diff --git a/md/train/-TwO99rbVRu/-TwO99rbVRu.md b/md/train/-TwO99rbVRu/-TwO99rbVRu.md
new file mode 100644
index 0000000000000000000000000000000000000000..15ee7cf6ba04deb63baf4dc268897589b2604495
--- /dev/null
+++ b/md/train/-TwO99rbVRu/-TwO99rbVRu.md
@@ -0,0 +1,331 @@
+# PSEUDOSEG: DESIGNING PSEUDO LABELS FOR SEMANTIC SEGMENTATION
+
+Yuliang $\mathbf { Z o u } ^ { 1 * }$ Zizhao Zhang2 Han Zhang3 Chun-Liang Li2 Xiao Bian2 Jia-Bin Huang1 Tomas Pfister2 1Virginia Tech 2Google Cloud AI 3Google Brain
+
+# ABSTRACT
+
+Recent advances in semi-supervised learning (SSL) demonstrate that a combination of consistency regularization and pseudo-labeling can effectively improve image classification accuracy in the low-data regime. Compared to classification, semantic segmentation tasks require much more intensive labeling costs. Thus, these tasks greatly benefit from data-efficient training methods. However, structured outputs in segmentation render particular difficulties (e.g., designing pseudo-labeling and augmentation) to apply existing SSL strategies. To address this problem, we present a simple and novel re-design of pseudo-labeling to generate well-calibrated structured pseudo labels for training with unlabeled or weaklylabeled data. Our proposed pseudo-labeling strategy is network structure agnostic to apply in a one-stage consistency training framework. We demonstrate the effectiveness of the proposed pseudo-labeling strategy in both low-data and highdata regimes. Extensive experiments have validated that pseudo labels generated from wisely fusing diverse sources and strong data augmentation are crucial to consistency training for semantic segmentation. The source code is available at https://github.com/googleinterns/wss.
+
+# 1 INTRODUCTION
+
+Image semantic segmentation is a core computer vision task that has been studied for decades. Compared with other vision tasks, such as image classification and object detection, human annotation of pixel-accurate segmentation is dramatically more expensive. Given sufficient pixellevel labeled training data (i.e., high-data regime), the current state-of-the-art segmentation models (e.g., DeepLabv $^ { 3 + }$ (Chen et al., 2018)) produce satisfactory segmentation prediction for common practical usage. Recent exploration demonstrates improvement over high-data regime settings with large-scale data, including self-training (Chen et al., 2020a; Zoph et al., 2020) and backbone pretraining (Zhang et al., 2020a).
+
+In contrast to the high-data regime, the performance of segmentation models drop significantly, given very limited pixel-labeled data (i.e., low-data regime). Such ineffectiveness at the low-data regime hinders the applicability of segmentation models. Therefore, instead of improving high-data regime segmentation, our work focuses on data-efficient segmentation training that only relies on few pixellabeled data and leverages the availability of extra unlabeled or weakly annotated (e.g., image-level) data to improve performance, with the aim of narrowing the gap to the supervised models trained with fully pixel-labeled data.
+
+Our work is inspired by the recent success in semi-supervised learning (SSL) for image classification, demonstrating promising performance given very limited labeled data and a sufficient amount of unlabeled data. Successful examples include MeanTeacher (Tarvainen & Valpola, 2017), UDA (Xie et al., 2019), MixMatch (Berthelot et al., 2019b), FeatMatch (Kuo et al., 2020), and FixMatch (Sohn et al., 2020a). One outstanding idea in this type of SSL is consistency training: making predictions consistent among multiple augmented images. FixMatch (Sohn et al., 2020a) shows that using high-confidence one-hot pseudo labels obtained from weakly-augmented unlabeled data to train strongly-augmented counterpart is the key to the success of SSL in image classification.
+
+However, effective pseudo labels and well-designed data augmentation are non-trivial to satisfy for semantic segmentation. Although we observe that many related works explore the second condition (i.e., augmentation) for image segmentation to enable consistency training framework (French et al., 2020; Ouali et al., 2020), we show that a wise design of pseudo labels for segmentation has great veiled potentials.
+
+In this paper, we propose PseudoSeg, a one-stage training framework to improve image semantic segmentation by leveraging additional data either with image-level labels (weakly-labeled data) or without any labels. PseudoSeg presents a novel design of pseudo-labeling to infer effective structured pseudo labels of additional data. It then optimizes the prediction of strongly-augmented data to match its corresponding pseudo labels. In summary, we make the following contributions:
+
+• We propose a simple one-stage framework to improve semantic segmentation by using a limited amount of pixel-labeled data and sufficient unlabeled data or image-level labeled data. Our framework is simple to apply and therefore network architecture agnostic. Directly applying consistency training approaches validated in image classification renders particular challenges in segmentation. We first demonstrate how well-calibrated soft pseudo labels obtained through wise fusion of predictions from diverse sources can greatly improve consistency training for segmentation. We conduct extensive experimental studies on the PASCAL VOC 2012 and COCO datasets. Comprehensive analyses are conducted to validate the effectiveness of this method at not only the low-data regime but also the high-data regime. Our experiments study multiple important open questions about transferring SSL advances to segmentation tasks.
+
+# 2 RELATED WORK
+
+Semi-supervised classification. Semi-supervised learning (SSL) aims to improve model performance by incorporating a large amount of unlabeled data during training. Consistency regularization and entropy minimization are two common strategies for SSL. The intuition behind consistencybased approaches (Laine & Aila, 2016; Sajjadi et al., 2016; Miyato et al., 2018; Tarvainen & Valpola, 2017) is that, the model output should remain unchanged when the input is perturbed. On the other hand, the entropy minimization strategy (Grandvalet & Bengio, 2005) argues that the unlabeled data can be used to ensured classes are well-separated, which can be achieved by encouraging the model to output low-entropy predictions. Pseudo-labeling (Lee, 2013) is one of the methods for implicit entropy minimization. Recently, holistic approaches (Berthelot et al., 2019b;a; Sohn et al., 2020a) combining both strategies have been proposed and achieved significant improvement. By redesigning the pseudo label, we propose an efficient one-stage semi-supervised learning framework of semantic segmentation for consistency training.
+
+Semi-supervised semantic segmentation. Collecting pixel-level annotations for semantic segmentation is costly and prone to error. Hence, leveraging unlabeled data in semantic segmentation is a natural fit. Early methods utilize a GAN-based model either to generate additional training data (Souly et al., 2017) or to learn a discriminator between the prediction and the ground truth mask (Hung et al., 2018; Mittal et al., 2019). Consistency regularization based approaches have also been proposed recently, by enforcing the predictions to be consistent, either from augmented input images (French et al., 2020; Kim et al., 2020), perturbed feature embeddings (Ouali et al., 2020), or different networks (Ke et al., 2020). Recently, Luo & Yang (2020) proposes a dual-branch training network to jointly learn from pixel-accurate and coarse labeled data, achieving good segmentation performance. To push the performance of state of the arts, iterative self-training approaches (Chen et al., 2020a; Zoph et al., 2020; Zhu et al., 2020) have been proposed. These methods usually assume the available labeled data is enough to train a good teacher model, which will be used to generate pseudo labels for the student model. However, this condition might not satisfy in the low-data regime. Our proposed method, on the other hand, realizing the ideas of both consistency regularization and pseudo-labeling in segmentation, consistently improves the supervised baseline in both low-data and high-data regimes.
+
+Weakly-supervised semantic segmentation. Instead of supervising network training with accurate pixel-level labels, many prior works exploit weaker forms of annotations (e.g., bounding boxes (Dai et al., 2015), scribbles (Lin et al., 2016), image-level labels). Most recent approaches use imagelevel labels as the supervisory signal, which exploits the idea of class activation map (CAM) (Zhou et al., 2016). Since the vanilla CAM only focus on the most discriminative region of objects, different ways to refine CAM have been proposed, including partial image/feature erasing (Hou et al., 2018; Wei et al., 2017; Li et al., 2018), using an additional saliency estimation model (Oh et al., 2017; Huang et al., 2018; Wei et al., 2018), utilizing pixel similarity to propagate the initial score map (Ahn & Kwak, 2018; Wang et al., 2020), or mining and co-segment the same category of objects across images (Sun et al., 2020; Zhang et al., 2020b). While achieving promising results using the approaches mentioned above, most of them require a multi-stage training strategy. The refined score maps are optimized again using a dense-CRF model (Krahenb ¨ uhl & Koltun ¨ , 2011), and then used as the target to train a separate segmentation network. On the other hand, we assume there exists a small number of fully-annotated data, which allows us to learn stronger segmentation models than general methods without needing pixel-labeled data.
+
+
+Figure 1: Overview of unlabeled data training branch. Given an image, the weakly augmented version is fed into the network to get the decoder prediction and Self-attention Grad-CAM (SGC). The two sources are then combined via a calibrated fusion strategy to form the pseudo label. The network is trained to make its decoder prediction from strongly augmented image to match the pseudo label by a per-pixel cross-entropy loss.
+
+# 3 THE PROPOSED METHOD
+
+In analogous to SSL for classification, our training objective in PseudoSeg consists of a supervised loss $\mathcal { L } _ { \mathrm { s } }$ applied to pixel-level labeled data $\mathcal { D } _ { l }$ , and a consistency constraint $\mathcal { L } _ { \mathrm { u } }$ applied to unlabeled data $\mathcal { D } _ { u }$ 1. Specifically, the supervised loss $\mathcal { L } _ { \mathrm { s } }$ is the standard pixel-wise cross-entropy loss on the weakly augmented pixel-level labeled examples:
+
+$$
+\mathcal { L } _ { \mathrm { s } } = \frac { 1 } { N \times | \mathcal { D } _ { l } | } \sum _ { x \in \mathcal { D } _ { l } } \sum _ { i = 0 } ^ { N - 1 } \mathrm { C r o s s E n t r o p y } \left( y _ { i } , f _ { \theta } ( \omega ( x _ { i } ) ) \right) ,
+$$
+
+where $\theta$ represents the learnable parameters of the network function $f$ and $N$ denotes the number of valid labeled pixels in an image $\boldsymbol { x } \in \mathbb { R } ^ { H \times W \times 3 }$ . $y _ { i } \in \mathbb { R } ^ { C }$ is the ground truth label of a pixel $i$ in $H \times W$ dimensions, and $f _ { \theta } ( \omega ( x _ { i } ) ) \in \mathbb { R } ^ { C }$ is the predicted probability of pixel $i$ , where $C$ is the number of classes to predict and $\omega ( \cdot )$ denotes the weak (common) data augmentation operations used by Chen et al. (2018).
+
+During training, the proposed PseudoSeg estimates a pseudo label $\widetilde { y } \in \mathbb { R } ^ { H \times W \times C }$ for each stronglyaugmented unlabeled data $x$ in $\mathcal { D } _ { u }$ e, which is then used for computing the cross-entropy loss. The unsupervised objective can then be written as:
+
+$$
+\mathcal { L } _ { \sf u } = \frac { 1 } { N \times | \mathcal { D } _ { u } | } \sum _ { x \in \mathcal { D } _ { u } } \sum _ { i = 0 } ^ { N - 1 } \mathrm { C r o s s E n t r o p y } \left( \widetilde { y } _ { i } , f _ { \theta } ( \beta \circ \omega ( x _ { i } ) ) \right) ,
+$$
+
+where $\beta ( \cdot )$ denotes a stronger data augmentation operation, which will be described in Section 3.2.
+We illustrate the unlabeled data training branch in Figure 1.
+
+# 3.1 THE DESIGN OF STRUCTURED PSEUDO LABELS
+
+The next important question is how to generate the desirable pseudo label $\widetilde { y }$ . A straightforward soluetion is directly using the decoder output of a trained segmentation model after confidence thresholding, as suggested by Sohn et al. (2020a); Zoph et al. (2020); Xie et al. (2020); Sohn et al. (2020b). However, as we demonstrate later in the experiments, the generated pseudo hard/soft labels as well as other post-processing of outputs are barely satisfactory in the low-data regime, and thus yield inferior final results. To address this issue, our design of pseudo-labeling has two key insights. First, we seek for a distinct yet efficient decision mechanisms to compensate for the potential errors of decoder outputs. Second, wisely fusing multiple sources of predictions to generate an ensemble and better-calibrated version of pseudo labels.
+
+Starting with localization. Compared with precise segmentation, learning localization is a simpler task as it only needs to provide coarser-grained outputs than pixel level of objects in images. Based on this motivation, we improve decoder predictions from the localization perspective. Class activation map (CAM) (Zhou et al., 2016) is a popular approach to provide localization for class-specific regions. CAM-based methods (Hou et al., 2018; Wei et al., 2017; Ahn & Kwak, 2018) have been successfully adopted to tackle a different weakly supervised semantic segmentation task from us, where they assume only image-level labels are available. In practice, we adopt a variant of class activation map, Grad-CAM (Selvaraju et al., 2017) in PseudoSeg.
+
+From localization to segmentation. CAM estimates the strength of classifier responses on local feature maps. Thus, an inherent limitation of CAM-based approaches is that it is prone to attending only to the most discriminative regions. Although many weakly-supervised segmentation approaches (Ahn & Kwak, 2018; Ahn et al., 2019; Sun et al., 2020) aim at refining CAM localization maps to segmentation masks, most of them have complicated post-processing steps, such as dense CRF (Krahenb ¨ uhl & Koltun ¨ , 2011), which increases the model complexity when used for consistency training. Here we present a computationally efficient yet effective refinement alternative, which is learnable using available pixel-labeled data.
+
+Although CAM only localizes partial regions of interests, if we know the pairwise similarities between regions, we can propagate the CAM scores from the discriminative regions to the rest unattended regions. Actually, it has been shown in many works that the learned high-level deep features are usually good at similarity measurements of visual objects. In this paper, we find hypercolumn (Hariharan et al., 2015) with a learnable similarity measure function works fairly effective.
+
+Given the vanilla Grad-CAM output for all $C$ classes, which can be viewed as a spatially-flatten 2-D vector of weight $m \in \mathbb { R } ^ { L \times C }$ , where each row $m _ { i }$ is the response weight per class for one region $i$ . Using a kernel function $\mathcal { K } ( \cdot , \cdot ) : \mathbb { R } ^ { H } \times \mathbb { R } ^ { H } \mathbb { R }$ that measures element-wise similarity given feature $h \in { \bar { \mathbb { R } } } ^ { H }$ of two regions, the propagated score $\hat { m } _ { i } \in \mathbb { R } ^ { C }$ can be computed as follows
+
+$$
+\hat { m } _ { i } = \left( m _ { i } + \sum _ { j = 0 } ^ { L - 1 } \frac { e ^ { K ( W _ { k } h _ { i } , W _ { v } h _ { j } ) } } { \sum _ { k = 0 } ^ { L - 1 } e ^ { K ( W _ { k } h _ { i } , W _ { v } h _ { k } ) } } m _ { j } \right) \cdot W _ { c } .
+$$
+
+The goal of this function is to train $\Theta = \{ W _ { k } , W _ { v } \in \mathbb { R } ^ { H \times H } , W _ { c } \in \mathbb { R } ^ { C \times C } \}$ in order to propagate the high value in $m$ to all adjacent elements in the feature space $\mathbb { R } ^ { H }$ (i.e., hypercolumn features) to region $i$ . Adding $m _ { i }$ in equation 3 indicates the skip-connection. To compute propagated score for all regions, the operations in equation 3 can be efficiently implemented with self-attention dotproduct (Vaswani et al., 2017). For brevity, we denote this efficient refinement process output as selfattention Grad-CAM (SGC) maps in $\mathbb { R } ^ { H \times H \times C }$ . Figure 6 in Appendix A specifies the architecture.
+
+Calibrated prediction fusion. SGC maps are obtained from low-resolution feature maps. It is then resized to the desired output resolution, and thus not sufficient at delineating crisp boundaries. However, compared to the segmentation decoder, SGC is capable of generating more locally-consistent masks. Thus, we propose a novel calibrated fusion strategy to take advantage of both decoder and SCG predictions for better pseudo labels.
+
+Specifically, given a batch of decoder outputs (pre-softmax logits) $\hat { p } = f _ { \theta } ( \omega ( x ) )$ and SGC maps $\hat { m }$ computed from weakly-augmented data $\omega ( x )$ , we generate the pseudo labels $\widetilde { y }$ by
+
+$$
+\mathcal { F } ( \hat { p } , \hat { m } ) = \mathrm { S h a r p e n } \left( \gamma \operatorname { S o f t m a x } \left( \frac { \hat { p } } { \operatorname { N o r m } ( \hat { p } , \hat { m } ) } \right) + ( 1 - \gamma ) \operatorname { S o f t m a x } \left( \frac { \hat { m } } { \operatorname { N o r m } ( \hat { p } , \hat { m } ) } \right) , T \right) .
+$$
+
+Two critical procedures are proposed to use here to make the fusion process successful. First, $\hat { p }$ and $\hat { m }$ are from different decision mechanisms and they could have very different degrees of overconfidence. Therefore, we introduce the operation $\begin{array} { r } { \mathrm { N o r m } ( a , b ) = \sqrt { \sum _ { i } ^ { | a | } ( a _ { i } ^ { 2 } + b _ { i } ^ { 2 } ) } } \end{array}$ as a normalization factor. It alleviates the over-confident probability after softmax, which could unfavorably dominate the resulted $\gamma$ -averaged probability. Second, the distribution sharpening operation Sharpen $\begin{array} { r } { ( a , T ) _ { i } ~ = ~ a _ { i } ^ { 1 / T } / \sum _ { j } ^ { C } a _ { j } ^ { 1 / T } } \end{array}$ adjusts the temperature scalar $T$ of categorical distribution (Berthelot et al., 2019b; Chen et al., 2020b). Figure 2 illustrates the predictions from different sources. More importantly, we investigate the pseudo-labeling from a calibration perspective (Section 4.3), demonstrating that the proposed soft pseudo label $\widetilde { y }$ leads to a better calibration metric comparing to other possible fusion alternatives, and justifying why it benefits the final segmentation performance.
+
+
+Figure 2: Visualization of pseudo labels and other predictions. The generated pseudo label by fusing the predictions from the decoder and SGC map is used to supervise the decoder (strong) predictions of the strongly-augmented counterpart.
+
+Training. Our final training objective contains two extra losses: a classification loss $\mathcal { L } _ { x }$ , and a segmentation loss $\mathcal { L } _ { s a }$ . First, to compute Grad-CAM, we add a one-layer classification head after the segmentation backbone and a multi-label classification loss $\mathcal { L } _ { x }$ . Second, as specified in Appendix A (Figure 6), SGC maps are scaled as pixel-wise probabilities using one-layer convolution followed by softmax in equation 3. Learning $\Theta$ to predict SGC maps needs pixel-labeled data $D _ { l }$ . It is achieved by an extra segmentation loss $\mathcal { L } _ { s a }$ between SGC maps of pixel-labeled data and corresponding ground truth. All the loss terms are jointly optimized (i.e., $\mathcal { L } _ { u } + \mathcal { L } _ { s } + \mathcal { L } _ { x } + \mathcal { L } _ { s a } )$ , while $\mathcal { L } _ { s a }$ only optimizes $\Theta$ (achieved by stopping gradient). See Figure 7 in the appendix for further details.
+
+# 3.2 INCORPORATING IMAGE-LEVEL LABELS AND AUGMENTATION
+
+The proposed PseudoSeg can easily incorporate image-level label information (if available) into our one-stage training framework, which also leads to consistent improvement as we demonstrate in experiments. We utilize the image-level data with two following steps. First, we directly use ground truth image-level labels to generate Grad-CAMs instead of using classifier outputs. Second, they are used to increase classification supervision beyond pixel-level labels for the classifier head.
+
+For strong data augmentation, we simply follow color jittering operations from SimCLR (Chen et al., 2020b) and remove all geometric transformations. The overall strength of augmentation can be controlled by a scalar (studied in experiments). We also apply once random CutOut (DeVries & Taylor, 2017) with a region of $5 0 \times 5 0$ pixels since we find it gives consistent though minor improvement (pixels inside CutOut regions are ignored in computing losses).
+
+# 4 EXPERIMENTAL RESULTS
+
+We start by specifying the experimental details. Then, we evaluate the method in the settings of using pixel-level labeled data and unlabeled data, as well as using pixel-level labeled data and image-level labeled data, respectively. Next, we conduct various ablation studies to justify our design choices. Lastly, we conduct more comparative experiments in specific settings.
+
+To evaluate the proposed method, we conduct the main experiments and ablation studies on the PASCAL VOC 2012 dataset (VOC12) (Everingham et al., 2015), which contains 21 classes including background. The standard VOC12 dataset has 1,449 images as the training set and 1,456 images as the validation set. We randomly subsample 1/2, 1/4, 1/8, and 1/16 of images in the standard training set to construct the pixel-level labeled data. The remaining images in the standard training set, together with the images in the augmented set (Hariharan et al., 2011) (around $9 \mathrm { k }$ images), are used as unlabeled or image-level labeled data. To further verify the effectiveness of the proposed method, we also conduct experiments on the COCO dataset (Lin et al., 2014). The COCO dataset has 118,287 images as the training set, and 5,000 images as the validation set. We evaluate on the 80 foreground classes and the background, as in the object detection task. As the COCO dataset is larger than VOC12, we randomly subsample smaller ratios, 1/32, 1/64, 1/128, 1/256, 1/512, of images from the training set to construct the pixel-level labeled data. The remaining images in the training set are used as unlabeled data or image-level labeled data. We evaluate the performance using the standard mean intersection-over-union (mIoU) metric. Implementation details can be found in Appendix B.
+
+
+Figure 3: Improvement over the strong supervised baseline, in a semi-supervised setting (w/ unlabeled data) on VOC12 val (left) and COCO val (right).
+
+# 4.1 EXPERIMENTS USING PIXEL-LEVEL LABELED DATA AND UNLABELED DATA
+
+Improvement over a strong baseline. We first demonstrate the effectiveness of the proposed method by comparing it with the DeepLabv $^ { 3 + }$ model trained with only the pixel-level labeled data. As shown in Figure 3 (a), the proposed method consistently outperforms the supervised training baseline on VOC12, by utilizing the pixel-level labeled data and the unlabeled data. The proposed method not only achieves a large performance boost in the low-data regime (when only $6 . 2 5 \%$ pixellevel labels available), but also improves the performance when the entire training set (1.4k images) is available. In Figure 3 (b), we again observe consistent improvement on the COCO dataset.
+
+Comparisons with the others. Next, we compare the proposed method with recent state of the arts on both the public $1 . 4 \mathrm { k } / 9 \mathrm { k }$ split (in Table 1) and the created low-data splits (in Table 2), on VOC12. Our method compares favorably with the others.
+
+Table 1: Comparison with state of the arts on VOC12 val set (w/ pixel-level labeled data and unlabeled data). We use the official training set (1.4k) as labeled data, and the augmented set (9k) as unlabeled data.
+
+
Method
Network
mIoU (%)
GANSeg (Souly et al., 2017)
VGG16
64.10
AdvSemSeg (Hung et al., 2018)
ResNet-101
68.40
CCT (Ouali et al., 2020)
ResNet-50
69.40
PseudoSeg (Ours)
ResNet-50
71.00
PseudoSeg (Ours)
ResNet-101
73.23
+
+Table 2: Comparison with state of the arts on VOC12 val set (w/ pixel-level labeled data and unlabeled data) using low-data splits. The exact numbers of pixel-labeled images are shown in brackets. All the methods use ResNet-101 as backbone except CCT (Ouali et al., 2020), which uses ResNet-50. \* indicates implementation from Ke et al. (2020), \*\* indicates implementation from French et al. (2020).
+
+
Method
1/2 (732)
1/4 (366)
1/8 (183)
1/16 (92)
AdvSemSeg (Hung et al., 2018)
65.27
59.97
47.58
39.69
CCT (Ouali et al., 2020)
62.10
58.80
47.60
33.10
*MT (Tarvainen & Valpola, 2017)
69.16
63.01
55.81
48.70
GCT (Ke et al., 2020)
70.67
64.71
54.98
46.04
**VAT (Miyato et al., 2018)
63.34
56.88
49.35
36.92
CutMix (French et al., 2020)
69.84
68.36
63.20
55.58
PseudoSeg (Ours)
72.41
69.14
65.50
57.60
+
+
+Figure 4: Improvement over the strong supervised baseline, in a semi-supervised setting (w/ image-level labeled data) on VOC12 val (left) and COCO val (right).
+
+Table 3: Comparison with state of the arts on VOC12 val set (w/ pixel-level labeled data and image-level labeled data). We use the official training set (1.4k) as labeled data, and the augmented set (9k) as image-level labeled data.
+
+
Method
Model
Network
mIoU (%)
WSSN (Papandreou et al., 2015)
DeepLab-CRF
VGG16
64.60
GAIN (Li et al., 2018)
DeepLab-CRF-LFOV
VGG16
60.50
MDC (Wei et al.,2018)
DeepLab-CRF-LFOV
VGG16
65.70
DSRG (Huang et al.,2018)
DeepLabv2
VGG16
64.30
GANSeg (Souly et al.,2017)
FCN
VGG16
65.80
FickleNet (Lee et al.,2019)
DeepLabv2
ResNet-101
65.80
CCT (Ouali et al., 2020)
PSP-Net
ResNet-50
73.20
PseudoSeg (Ours)
DeepLabv3+
ResNet-50
73.80
+
+Table 4: Comparison with state of the arts on VOC12 val set with pixel-level labeled data and image-level labeled data. Four ratios of pixel-level labeled examples are tested. Both CCT (Ouali et al., 2020) and our method use ResNet-50 as backbone.
+
+
Split
CCT
PseudoSeg
1/2
66.80
73.51
1/4
67.60
71.79
1/8
62.50
69.15
1/16
51.80
65.44
+
+Similar to semi-supervised learning using pixel-level labeled data and unlabeled data, we first demonstrate the efficacy of our method by comparing it with a strong supervised baseline. As shown in Figure 4, the proposed method consistently improves the strong baseline on both datasets. In Table 3, we evaluate on the public $1 . 4 \mathrm { k } / 9 \mathrm { k }$ split. The proposed method compares favorably with the other methods. Moreover, we further compare to best compared CCT on the created low-data splits (in Table 4). Both experiments show that the proposed PseudoSeg is more robust than the compared method given less data. On all splits on both datasets, using pixel-level labeled data and image-labeled data shows higher mIoU than the setting using pixel-level labeled data and unlabeled data.
+
+# 4.3 ABLATION STUDY
+
+In this section, we conduct extensive ablation experiments on VOC12 to validate our design choices.
+
+How to construct pseudo label? We investigate the effectiveness of the proposed pseudo labeling. Table 5 demonstrates quantitative results, indicating that using either decoder output or SGC alone gives an inferior performance. Naively using decoder output as pseudo labels can hardly work well. The proposed fusion consistently performs better, either with or without additional image-level labels. To further answer why our pseudo labels are effective, we study from the model calibration perspective. We measure the expected calibration error (ECE) (Guo et al., 2017) scores of all the intermediate steps and other fusion variants. As shown in Figure 5 (a), the proposed fusion strategy (denoted as G in the figure) achieves the lowest ECE scores, indicating that the significance of jointly using normalization with sharpening (see equation 4) compared with other fusion alternatives. We hypothesize using well-calibrated soft labels makes model training less affected by label noises. The comprehensive calibration study is left as a future exploration direction.
+
+Using hypercolumn feature or not? In Figure 5 (b), we study the effectiveness of using hypercolumn features instead of the last feature maps in equation 3. We conduct the experiments on the 1/16 split of VOC12. As we can see, hypercolumn features substantially improve performance.
+
+Soft or hard pseudo label? How to utilize predictions as pseudo labels remains an active question in SSL. Next, we study whether we should use soft or hard one-hot pseudo labels. We conduct the experiments in the setting where pixel-level labeled data and image-level labeled data are available. As shown in Figure 5 (c), using all predictions as soft pseudo label yields better performance than selecting confident predictions. This suggests that well-calibrated soft pseudo labels might be important in segmentation than over-simplified confidence thresholding.
+
+Table 5: Comparison to alternative pseudo labeling strategies. We conduct experiments using 1/4, 1/8, 1/16 of the pixel-level labeled data, the exact numbers of images are shown in the brackets.
+
+
Source
Using image-level labels
1/4 (366)
1/8 (183)
1/16 (92)
Decoder only
70.22
69.35
53.20
SGC only
67.07
62.61
53.42
Calibrated fusion
73.79
73.13
67.06
Decoder only
73.95
73.05
67.54
SGC only
71.73
67.57
64.26
Calibrated fusion
75.29
74.70
71.22
+
+
+Figure 5: Ablation studies on different factors. See Section 4.3 for complete details.
+
+Temperature sharpening or not? We study the effect of temperature sharpening in equation 4. We conduct the experiments in the setting where pixel-level labeled data and image-level labeled data are available. As shown in Figure 5 (d), temperature sharpening shows consistent and clear improvements.
+
+Strong augmentation strength. In Figure 5 (e), we study the effects of color jittering in the strong augmentation. The magnitude of jittering strength is controlled by a scalar (Chen et al., 2020b). We conduct the experiments in the setting where pixel-level labeled data and unlabeled data are available. If the magnitude is too small, performance drops significantly, suggesting the importance of strong augmentation.
+
+Impact of different feature backbones. In Figure 5 (f), we compare the performance of using ResNet-50, ResNet-101, and Xception-65 as backbone architectures, respectively. We conduct the experiments in the setting where pixel-level labeled data and unlabeled data are available. As we can see, the proposed method consistently improves the baseline by a substantial margin across different backbone architectures.
+
+# 4.4 COMPARISON WITH SELF-TRAINING
+
+Several recent approaches (Chen et al., 2020a; Zoph et al., 2020) exploit the Student-Teacher selftraining idea to improve the performance with additional unlabeled data. However, these methods only apply self-training in the high-data regime (i.e., sufficient pixel-labeled data to train teachers).
+
+Table 6: Comparison with self-training. We use our supervised baseline as the teacher to generate one-hot pseudo labels, following Zoph et al. (2020).
+
+
Method
Using image-level labels
1/4 (366)
1/8 (183)
1/16 (92)
Supervised (Teacher)
70.20
64.00
56.03
Self-training (Student)
1
72.85
69.88
64.20
PseudoSeg (Ours)
-
73.79
73.13
67.06
PseudoSeg (Ours)
√
75.29
74.70
71.22
+
+Here we compare these methods in the low-data regimes, where we focus on. To generate offline pseudo labels, we closely follow segmentation experiments in Zoph et al. (2020): pixels with a confidence score higher than 0.5 will be used as one-hot pseudo labels, while the remaining are treated as ignored regions. This step is considered important to suppress noisy labels. A student model is then trained using the combination of unlabeled data in VOC12 train and augmented sets with generated one-hot pseudo labels and all the available pixel-level labeled data. As shown in Table 6, although the self-training pretty well improves over the supervised baseline, it is inferior to the proposed method 2. We conjecture that the teacher model usually produces low confidence scores to pixels around boundaries, so pseudo labels of these pixels are filtered in student training. However, boundary pixels are important for improving the performance of segmentation (Kirillov et al., 2020). On the other hand, the design of our method (online soft pseudo labeling process) bypass this challenge. We will conduct more verification of this hypothesis in future work.
+
+# 5 IMPROVING THE FULLY-SUPERVISED METHOD WITH ADDITIONAL DAT
+
+We have validated the effectiveness of the proposed method in the low-data regime. In this section, we want to explore whether the proposed method can further improve supervised training in the full training set using additional data. We use the training set (1.4k) in VOC12 as the pixel-level labeled data. The additional data contains additional VOC 9k $( V _ { 9 k } )$ , COCO training set $( C _ { t r } )$ , and COCO unlabeled data $( C _ { u } )$ . More training details can be found in Appendix D. As shown in Table 7, the proposed PseudoSeg is able to improve upon the supervised baseline even in the high-data regime, using additional unlabeled or image-level labeled data.
+
+Table 7: Improving fully supervised model with extra data. No test-time augmentation is used.
+
+
+
+# 5 DISCUSSION AND CONCLUSION
+
+The key to the good performance of our method in the low-data regime is the novel re-design of pseudo-labeling strategy, which pursues a different decision mechanism from weakly-supervised localization to “remedy” weak predictions from segmentation head. Then augmentation consistency training progressively improves segmentation head quality. For the first time, we demonstrate that, with well-calibrated soft pseudo labels, utilizing unlabeled or image-labeled data significantly improves segmentation at low-data regimes. Further exploration of fusing stronger and better-calibrated pseudo labels worth more study as future directions (e.g., multi-scaling). Although color jittering works within our method as strong data augmentation, we have extensively explored geometric augmentations (leveraging STN (Jaderberg et al., 2015) to align pixels in pseudo labels and strongly-augmented predictions) for segmentation but find it not helpful. We believe data augmentation needs re-thinking beyond current success in classification for segmentation usage.
+
+# ACKNOWLEDGEMENT
+
+We thank Liang-Chieh Chen and Barret Zoph for their valuable comments.
+
+# REFERENCES
+
+Jiwoon Ahn and Suha Kwak. Learning pixel-level semantic affinity with image-level supervision for weakly supervised semantic segmentation. In CVPR, 2018. 3, 4
+
+Jiwoon Ahn, Sunghyun Cho, and Suha Kwak. Weakly supervised learning of instance segmentation with inter-pixel relations. In CVPR, 2019. 4, 14
+
+David Berthelot, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. Remixmatch: Semi-supervised learning with distribution matching and augmentation anchoring. In ICLR, 2019a. 2
+
+David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In NeurIPS, 2019b. 1, 2, 5
+
+Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In ECCV, 2018. 1, 3, 15
+
+Liang-Chieh Chen, Raphael Gontijo Lopes, Bowen Cheng, Maxwell D Collins, Ekin D Cubuk, Barret Zoph, Hartwig Adam, and Jonathon Shlens. Naive-student: Leveraging semi-supervised learning in video sequences for urban scene segmentation. In ECCV, 2020a. 1, 2, 8
+
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020b. 5, 8
+
+Franc¸ois Chollet. Xception: Deep learning with depthwise separable convolutions. In CVPR, 2017. 13
+
+Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016. 15
+
+Jifeng Dai, Kaiming He, and Jian Sun. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In ICCV, 2015. 2
+
+Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 5
+
+Mark Everingham, SM Ali Eslami, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes challenge: A retrospective. IJCV, 111(1):98–136, 2015. 5
+
+Geoff French, Timo Aila, Samuli Laine, Michal Mackiewicz, and Graham Finlayson. Semi-supervised semantic segmentation needs strong, high-dimensional perturbations. In BMVC, 2020. 2, 6, 15
+
+Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In NeurIPS, 2005. 2
+
+Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. ICML, 2017. 7
+
+Bharath Hariharan, Pablo Arbelaez, Lubomir Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours ´ from inverse detectors. In ICCV, 2011. 5
+
+Bharath Hariharan, Pablo Arbelaez, Ross Girshick, and Jitendra Malik. Hypercolumns for object segmentation ´ and fine-grained localization. In CVPR, 2015. 4
+
+Qibin Hou, PengTao Jiang, Yunchao Wei, and Ming-Ming Cheng. Self-erasing network for integral object attention. In NeurIPS, 2018. 3, 4
+
+Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu, and Jingdong Wang. Weakly-supervised semantic segmentation network with deep seeded region growing. In CVPR, 2018. 3, 7
+
+Wei-Chih Hung, Yi-Hsuan Tsai, Yan-Ting Liou, Yen-Yu Lin, and Ming-Hsuan Yang. Adversarial learning for semi-supervised semantic segmentation. In BMVC, 2018. 2, 6
+
+Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In NeurIPS, 2015. 9
+
+Peng-Tao Jiang, Qibin Hou, Yang Cao, Ming-Ming Cheng, Yunchao Wei, and Hong-Kai Xiong. Integral object mining via online attention accumulation. In ICCV, 2019. 14
+
+Zhanghan Ke, Di Qiu, Kaican Li, Qiong Yan, and Rynson WH Lau. Guided collaborative training for pixel-wise semi-supervised learning. In ECCV, 2020. 2, 6
+
+Jongmok Kim, Jooyoung Jang, and Hyunwoo Park. Structured consistency loss for semi-supervised semantic segmentation. arXiv preprint arXiv:2001.04647, 2020. 2
+Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, 2020. 9
+Philipp Krahenb ¨ uhl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge poten- ¨ tials. In NeurIPS, 2011. 3, 4
+Chia-Wen Kuo, Chih-Yao Ma, Jia-Bin Huang, and Zsolt Kira. Featmatch: Feature-based augmentation for semi-supervised learning. In ECCV, 2020. 1
+Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In ICLR, 2016. 2
+Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In ICML Workshop, 2013. 2
+Jungbeom Lee, Eunji Kim, Sungmin Lee, Jangho Lee, and Sungroh Yoon. Ficklenet: Weakly and semisupervised semantic image segmentation using stochastic inference. In CVPR, 2019. 7, 14
+Kunpeng Li, Ziyan Wu, Kuan-Chuan Peng, Jan Ernst, and Yun Fu. Tell me where to look: Guided attention inference network. In CVPR, 2018. 3, 7
+Di Lin, Jifeng Dai, Jiaya Jia, Kaiming He, and Jian Sun. Scribblesup: Scribble-supervised convolutional networks for semantic segmentation. In CVPR, 2016. 2
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014. 5
+Wenfeng Luo and Meng Yang. Semi-supervised semantic segmentation via strong-weak dual-branch network. In ECCV, 2020. 2
+Sudhanshu Mittal, Maxim Tatarchenko, and Thomas Brox. Semi-supervised semantic segmentation with highand low-level consistency. TPAMI, 2019. 2
+Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. TPAMI, 41(8):1979–1993, 2018. 2, 6
+Seong Joon Oh, Rodrigo Benenson, Anna Khoreva, Zeynep Akata, Mario Fritz, and Bernt Schiele. Exploiting saliency for object segmentation from image level labels. In CVPR, 2017. 3
+Yassine Ouali, Celine Hudelot, and Myriam Tami. Semi-supervised semantic segmentation with cross- ´ consistency training. In CVPR, 2020. 2, 6, 7
+George Papandreou, Liang-Chieh Chen, Kevin P Murphy, and Alan L Yuille. Weakly-and semi-supervised learning of a deep convolutional network for semantic image segmentation. In ICCV, 2015. 7
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 115(3):211–252, 2015. 13
+Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In NeurIPS, 2016. 2
+Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV, 2017. 4
+Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. In NeurIPS, 2020a. 1, 2, 4
+Kihyuk Sohn, Zizhao Zhang, Chun-Liang Li, Han Zhang, Chen-Yu Lee, and Tomas Pfister. A simple semisupervised learning framework for object detection. arXiv preprint arXiv:2005.04757, 2020b. 4
+Nasim Souly, Concetto Spampinato, and Mubarak Shah. Semi supervised semantic segmentation using generative adversarial network. In ICCV, 2017. 2, 6, 7
+Guolei Sun, Wenguan Wang, Jifeng Dai, and Luc Van Gool. Mining cross-image semantics for weakly supervised semantic segmentation. In ECCV, 2020. 3, 4, 14
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NeurIPS, 2017. 1, 2, 6
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 4
+Yude Wang, Jie Zhang, Meina Kan, Shiguang Shan, and Xilin Chen. Self-supervised equivariant attention mechanism for weakly supervised semantic segmentation. In CVPR, 2020. 3, 14
+Yunchao Wei, Jiashi Feng, Xiaodan Liang, Ming-Ming Cheng, Yao Zhao, and Shuicheng Yan. Object region mining with adversarial erasing: A simple classification to semantic segmentation approach. In CVPR, 2017. 3, 4
+Yunchao Wei, Huaxin Xiao, Honghui Shi, Zequn Jie, Jiashi Feng, and Thomas S Huang. Revisiting dilated convolution: A simple approach for weakly-and semi-supervised semantic segmentation. In CVPR, 2018. 3, 7
+Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V. Le. Unsupervised data augmentation for consistency training. arXiv preprint arXiv:1904.12848, 2019. 1
+Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In CVPR, 2020. 4
+Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li, and Alexander Smola. Resnest: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020a. 1
+Xiaolin Zhang, Yunchao Wei, and Yi Yang. Inter-image communication for weakly supervised localization. In ECCV, 2020b. 3
+Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016. 2, 4
+Yi Zhu, Zhongyue Zhang, Chongruo Wu, Zhi Zhang, Tong He, Hang Zhang, R Manmatha, Mu Li, and Alexander Smola. Improving semantic segmentation via self-training. arXiv preprint arXiv:2004.14960, 2020. 2
+Barret Zoph, Golnaz Ghiasi, Tsung-Yi Lin, Yin Cui, Hanxiao Liu, Ekin D Cubuk, and Quoc V Le. Rethinking pre-training and self-training. arXiv preprint arXiv:2006.06882, 2020. 1, 2, 4, 8, 9
+
+# APPENDIX
+
+# A SELF-ATTENTION GRAD-CAM
+
+We elaborate the detailed pipeline of generating Self-attention Grad-CAM (SGC) maps (equation 3) in Figure 6. To construct the hypercolumn feature, we extract the feature maps from the last two convolutional stages of the backbone network and concatenate them together. We then project the hypercolumn feature to two separate low-dimension embedding spaces to construct “key” and “query”, using two $1 \times 1$ convolutional layers. An attention matrix can then be computed via matrix multiplication of “key” and “query”. To construct “value”, we compute Grad-CAM for each foreground class and then concatenate them together. This results in a $H \times W \times ( C - 1 )$ score map, where the maximum score of each category is normalized to one separately. We then use image-level labels (either from classifier prediction or ground truth annotation) to set the score maps of non-existing classes to be zero. For each pixel localization, we use one to subtract the maximum score to construct the background score map, which is then concatenated with the foreground score maps to form “value” $( H \times W \times C )$ . The attention score matrix can then be used to reweight and propagate the scores in “value”. The propagated score is added back to the “value” score map, and the pass through a $1 \times 1$ convolution (w/ batch normalization) to output the SGC map.
+
+
+Figure 6: Diagram of Self-attention Grad-CAM (SGC) .
+
+# B IMPLEMENTATION DETAILS
+
+We implement our method on top of the publicly available official DeepLab codebase.3 Unless specified, we adopt the DeepLabv $^ { 3 + }$ model with Xception-65 (Chollet, 2017) as the feature backbone, which is pre-trained on the ImageNet dataset (Russakovsky et al., 2015). We train our model following the default hyper-parameters (e.g., an initial learning rate of 0.007 with a polynomial learning rate decay schedule, a crop size of $5 1 3 \times 5 1 3$ , and an encoder output stride of 16), using 16 GPUs 4. We use a batch size of 4 for each GPU for pixel-level labeled data, and 4 for unlabeled/image-level labeled data. For VOC12, we train the model for 30,000 iterations. For COCO, we train the model for 200,000 iterations. We set $\gamma = 0 . 5$ and $T = 0 . 5$ unless specified. We do not apply any test time augmentations.
+
+# C LOW-DATA SAMPLING IN PASCAL VOC 2012
+
+Unlike random sampling in image classification, it is difficult to sample uniformly in a low-data case for semantic segmentation due to the imbalance of rare classes. To avoid the missing classes at extremely low data regimes, we repeat the random sampling process for 1/16 three times (while ensuring each class has a certain amount) and report the results. We use Split 1 in the main manuscript. All splits will be released to encourage reproducibility. The results of all the three splits are shown as in Table 8.
+
+
+Figure 7: Training. For each network component, we show the loss supervision and the corresponding data.
+
+Table 8: Full results of 1/16 split in VOC12.
+
+
Method
Using image-level labels
Split 1
Split 2
Split 3
Supervised
■
56.03
56.87
55.92
PseudoSeg (Ours)
1
67.06
64.12
66.09
PseudoSeg (Ours)
√
71.22
68.11
69.72
+
+# D HIGH-DATA EXPERIMENTAL SETTINGS
+
+Here we provide more details about the experiments in Section 4.5. Since we have a lot more unlabeled/image-level labeled data, we adopt a longer training schedule (90,000 iterations) 5. We also adopt a slightly different fusion strategy in this setting by using $T = 0 . 7$ and $\gamma = 0 . 3$ .
+
+# E COMPARISON WITH WEAKLY-SUPERVISED APPROACHES
+
+In Table 9, we benchmark recent weakly supervised semantic segmentation performance on PASCAL VOC 2012 val set. Instead of enforcing the consistency between different augmented images as we do, these approaches tackle the semantic segmentation task from a different perspective, by exploiting the weaker annotations (image-level labels). As we can see, by exploiting the imagelevel labels with careful designs, weakly-supervised semantic segmentation methods could achieve reasonably well performance. We believe that both perspectives are feasible and promising for low-data regime semantic segmentation tasks, and complementary to each other. Therefore, these designs could be potentially integrated into our framework to generate better pseudo labels, which leads to improved performance.
+
+Table 9: Benchmarking state-of-the-art weakly supervised semantic segmentation methods. All the methods use image-level labels from VOC12 training (1.4k) and augmented (9k) sets.
+
+
Method
Pixel-level labeled data
mIoU (%)
FickleNet (Lee et al., 2019)
64.9
IRNet (Ahn et al., 2019)
63.5
OAA+ (Jiang et al., 2019)
65.2
SEAM (Wang et al., 2020)
64.5
MCIS (Sun et al., 2020)
66.2
PseudoSeg (Ours)
1/16 (92)
71.22
+
+# F PERFORMANCE ANALYSIS FOR TEMPERATURE SHARPENING
+
+We conduct an additional performance analysis for temporal sharpening. We conduct experiments over T on the 1/16 split of VOC using pixel-level labeled data and image-level labeled data. As shown in Table 10, adopting a $T < 1$ for distribution sharpening generally leads to improved performance.
+
+Table 10: Performance analysis over T.
+
+
Temperature (T)
mIoU (%)
0.1
71.11
0.3
70.11
0.5 (default)
71.22
0.7
72.37
1.0 (no sharpening)
68.15
+
+# G EXPERIMENTS ON CITYSCAPES
+
+In this section, we conduct additional experiments on the Cityscapes dataset (Cordts et al., 2016). The Cityscapes dataset contains 50 real-world driving sequences. Among these video sequences, 2,975 frames are selected as the training set, and 500 frames are selected as the validation set. Following previous common practice, we evaluate on 19 semantic classes.
+
+Comparison with state of the art. We compare our method with the current state-of-the-art method (French et al., 2020), in the setting of using pixel-level labeled and unlabeled data. We randomly subsample 1/4, 1/8, and 1/30 of the training set to construct the pixel-level labeled data, using the first random seed provided by French et al. (2020). Both French et al. (2020) and our method use ResNet-101 as the feature backbone and DeepLabv $^ { 3 + }$ (Chen et al., 2018) as the segmentation model. As shown in Table 11, the proposed method achieves promising results on all the three label ratios.
+
+Table 11: Experiments on Cityscapes (w/ pixel-level labeled data and unlabeled data).
+
+
Method
1/4 (744)
1/8 (372)
1/30 (100)
CutMix (French et al., 2020)
68.33
65.82
55.71
PseudoSeg (Ours)
72.36
69.81
60.96
+
+Per-class performance analysis. Next, we provide per-class performance break down analysis. We compare our method with the supervised baseline on the 1/30 split, using pixel-level labeled data and unlabeled data. As shown in Table 12, the distribution of the labeled pixels is severely imbalanced. Although our method does not in particular address the data imbalance issue, our method improves upon the supervised baseline on most of the classes (except for “Wall” and “Pole”).
+
+Table 12: Per-class performance analysis on Cityscapes (w/ pixel-level labeled data and unlabeled data).
+
+
Class Pixel ratio (%)
Road 36.36
Sidewalk 5.61
Building 20.99
Wall 0.53
Fence 0.98
Pole 1.19
Traffic light 0.14
Traffic sign 0.51
Vegetation 19.61
Terrain 1.29
Supervised PseudoSeg (Ours)
96.03
71.26
87.53
19.75
29.11
52.19
50.19
68.09
89.93
45.79
96.64
75.06
88.63
19.67
34.09
51.75
58.19
69.95
90.43
50.48
Class
Sky
Person
Rider
Car
Truck
Bus
Train
Motorcycle
Bicycle
Pixel ratio (%)
3.70
1.10
0.16
6.49
0.38
0.13
0.23
0.06
0.54
Supervised
91.01
74.12
43.91
89.91
7.68
14.19
17.78
25.86
69.88
PseudoSeg (Ours)
92.99
75.16
46.09
91.60
20.39
26.30
22.13
43.96
71.30
+
+Discussion. Although the scene layouts are quite similar for all the full images, it is still feasible to generate different image-level labels through a more aggressive geometric data augmentation (e.g., scaling, cropping, translation, etc.). In practice, standard segmentation preprocessing steps only crop a sub-region of the whole training images. It only contains partial images with a certain subset of image labels, making the training batches have diverse image-level labels (converted from pixellevel labels, in the fully-labeled+unlabeled setting). Moreover, in the fully-labeled+weakly-labeled setting, in practice, we can collect diverse Internet images and weakly label them, instead of weakly labeling images from Cityscapes.
+
+# H QUALITATIVE RESULTS
+
+We visualize several model prediction results for PASCAL VOC 2012 (Figure 8) and COCO (Figure 9). As we can see, the supervised baseline struggles to segment some of the categories and small objects, when trained in the low-data regime. On the other hand, PseudoSeg utilizes unlabeled or weakly-labeled data to generate more satisfying predictions.
+
+
+Figure 8: Qualitative results of PASCAL VOC 2012. Models are trained with 1/16 pixel-level labeled data in the training set.
+
+
+Figure 9: Qualitative results of COCO. Models are trained with 1/512 pixel-level labeled data in the training set. Note that white pixel in the ground truth indicates this pixel is not annotated for evaluation.
\ No newline at end of file
diff --git a/md/train/04cII6MumYV/04cII6MumYV.md b/md/train/04cII6MumYV/04cII6MumYV.md
new file mode 100644
index 0000000000000000000000000000000000000000..9fe2038ad67c7a5668e304689425e5a7c9e199e6
--- /dev/null
+++ b/md/train/04cII6MumYV/04cII6MumYV.md
@@ -0,0 +1,311 @@
+# A UNIVERSAL REPRESENTATION TRANSFORMER LAYER FOR FEW-SHOT IMAGE CLASSIFICATION
+
+Lu $\mathbf { L i u ^ { 1 , 2 * } }$ , William Hamilton $^ { 1 , 3 }$ †, Guodong Long2, Jing Jiang2, Hugo Larochelle1,4† 1 Mila, 2 Australian AI Institute, UTS, 3 McGill University, 4 Google Research, Brain Team Correspondence to lu.liu.cs@icloud.com
+
+# ABSTRACT
+
+Few-shot classification aims to recognize unseen classes when presented with only a small number of samples. We consider the problem of multi-domain few-shot image classification, where unseen classes and examples come from diverse data sources. This problem has seen growing interest and has inspired the development of benchmarks such as Meta-Dataset. A key challenge in this multi-domain setting is to effectively integrate the feature representations from the diverse set of training domains. Here, we propose a Universal Representation Transformer (URT) layer, that meta-learns to leverage universal features for few-shot classification by dynamically re-weighting and composing the most appropriate domain-specific representations. In experiments, we show that URT sets a new state-of-the-art result on Meta-Dataset. Specifically, it achieves top-performance on the highest number of data sources compared to competing methods. We analyze variants of URT and present a visualization of the attention score heatmaps that sheds light on how the model performs cross-domain generalization. Our code is available at https://github.com/liulu112601/URT.
+
+# 1 INTRODUCTION
+
+Learning tasks from small data remains a challenge for machine learning systems, which show a noticeable gap compared to the ability of humans to understand new concepts from few examples. A promising direction to address this challenge is developing methods that are capable of performing transfer learning across the collective data of many tasks. Since machine learning systems generally improve with the availability of more data, a natural assumption is that few-shot learning systems should benefit from leveraging data across many different tasks and domains—even if each individual task has limited training data available.
+
+This research direction is well captured by the problem of multi-domain few-shot classification. In this setting, training and test data spans a number of different domains, each represented by a different source dataset. A successful approach in this multi-domain setting must not only address the regular challenge of few-shot classification—i.e., the challenge of having only a handful of examples per class. It must also discover how to leverage (or ignore) what is learned from different domains, achieving generalization and avoiding cross-domain interference.
+
+Recently, Triantafillou et al. (2020) proposed a benchmark for multi-domain few-shot classification, Meta-Dataset, and highlighted some of the challenges that current methods face when training data is heterogeneous. Crucially, they found that methods which trained on all available domains would normally obtain improved performance on some domains at the expense of others. Following on their work, progress has been made, which includes the design of adapted hyper-parameter optimization strategies (Saikia et al., 2020) and more flexible meta-learning algorithms (Requeima et al., 2019). Most notable is SUR (Selecting Universal Representation) (Dvornik et al., 2020), a method that relies on a so-called universal representation, extracting from a collection of pre-trained and domain-specific neural network backbones. SUR prescribes a hand-crafted feature-selection procedure to infer how to weight each backbone for each task at hand, and produces an adapted representation for each task. This was shown to lead to some of the best performances on Meta-Dataset.
+
+In SUR, the classification procedure for each task is fixed and not learned. Thus, except for the underlying universal representation, there is no transfer learning performed with regards to how classification rules are inferred across tasks and domains. Yet, cross-domain generalization might be beneficial in that area as well, in particular when tasks have only few examples per class.
+
+Present work. To explore this question, we propose a Universal Representation Transformer (URT) layer, which can effectively learn to transform a universal representation into task-adapted representations. The URT layer is inspired from Transformer (Vaswani et al., 2017) and uses an attention mechanism to learn to retrieve or blend the appropriate backbones to use for each task. By training this layer across few-shot tasks from many domains, it can support transfer across these tasks.
+
+We show that our URT layer on top of a universal representation’s pre-trained backbones sets a new state-of-the-art performance on Meta-Dataset. It succeeds at outperforming SUR on 4 dataset sources without impairing accuracy on the others. This leads to top performance on 7 dataset sources when comparing to a set of competing methods. To interpret the strategy that URT learns to weigh the backbones from different domains, we visualize the attention scores for both seen and unseen domains and find that our model generates meaningful weights for the pre-trained domains. A comprehensive analysis on variants and ablations of the URT layer is provided to show the importance of various components of URT, notably the number of attention heads.
+
+# 2 FEW-SHOT CLASSIFICATION
+
+# 2.1 PROBLEM SETTING
+
+In this section, we will introduce the problem setting for few-shot classification and the formulation of meta-learning for few-shot classification. Few-shot classification aims to classify samples where only few examples are available for each class. We describe a few-shot learning classification task as the pair of examples, comprising of a support set $S$ to define the classification task and the query set $Q$ of samples to be classified.
+
+Meta-learning is a technique that aims to model the problem of few-shot classification as learning to learn from instances of few-shot classification tasks. The most popular way to train a meta-learning model is with episodic training. Here, tasks $T = ( Q , S )$ are sampled from a larger dataset by taking subsets of the dataset to build a support set $S$ and a query set $Q$ for the task. A common approach is to sample $N$ -way- $K$ -shot tasks, each time selecting a random subset of $N$ classes from the original dataset and choosing only $K$ examples for each class to add to the support set $S$ .
+
+The meta-learning problem can then be formulated by the following optimization:
+
+$$
+\operatorname* { m i n } _ { \Theta } \mathbb { E } _ { ( S , Q ) \sim p ( T ) } \left[ \mathcal { L } ( S , Q , \Theta ) \right] , \ \mathcal { L } ( S , Q , \Theta ) = \frac { 1 } { | Q | } \sum _ { { ( x , y ) } \sim Q } - \log p ( y | x , S ; \Theta ) + \lambda \Omega ( \Theta ) ,
+$$
+
+where $p ( T )$ is the distribution of tasks, $\Theta$ are the parameters of the model and $p ( \boldsymbol { y } | \boldsymbol { x } , S ; \Theta )$ is the probability assigned by the model to label $y$ of query example $_ { \textbf { \em x } }$ (given the support set $S$ ), and $\Omega ( \Theta )$ is an optional regularization term on the model parameters with factor $\lambda$ .
+
+Conventional few-shot classification targets the setting of $N$ -way- $K$ -shot, where the number of classes and examples are fixed in each episode. Popular benchmarks following this approach include Omniglot (Lake et al., 2015) or benchmarks made of subsets of ImageNet, such as miniImageNet (Vinyals et al., 2016) and tieredImageNet (Ren et al., 2018). In such benchmarks, the tasks for training cover a set of classes that is disjoint from the classes in the test set of tasks. However, with the training and test sets tasks coming from a single dataset/domain, the distribution of tasks found in either sets is similar and lacks variability, which may be unrealistic in practice.
+
+It is in this context that Triantafillou et al. (2020) proposed Meta-Dataset, as a further step towards large-scale, multi-domain few shot classification. Meta-Dataset includes ten datasets (domains), with eight of them available for training. Additionally, each task sampled in the benchmark varies in the number of classes $N$ , with each class also varying in the number of shots $K$ . As in all few-shot learning benchmarks, the classes used for training and testing do not overlap.
+
+# 2.2 BACKGROUND AND RELATED WORK
+
+Meta-Learning A promising approach for few-shot classification is to use meta-learning to more directly train a model to learn to perform few-shot classification, in an end-to-end way. The two most popular methods are Prototypical Networks (Snell et al., 2017) and Model Agnostic Meta-Learning (MAML) (Finn et al., 2017). Triantafillou et al. (2020) showed that prototypical networks and MAML could be combined by leveraging prototypes for the initialization of the output weights value in the inner loop. Requeima et al. (2019) also proposed Conditional Neural Adaptive Processes (CNAPs) for few-shot classification, which can be seen as extending prototypical networks with a more sophisticated architecture that allows for improved task adaptation. This architecture was later improved further by Bateni et al. (2020) with Simple CNAPS, leading to one of the current best methods on Meta-Dataset. Another line of work which leverages the idea of “transfer by fine-tuning” can be found in Appendix B.
+
+Universal Representations In contrast, our work instead builds on that of Dvornik et al. (2020) and their method SUR (Selecting from Universal Representations). Bilen & Vedaldi (2017) introduced the term universal representation to refer to a representation that supports good performance in multiple domains. One proposal towards such a representation is to train different neural networks backbones separately on the data of each available domain, then simply to concatenate the representation learned by each. Another is to introduce some parameter sharing between the backbones, by having a single network conditioned on the domain of the provenance of each batch of training data (Rebuffi et al., 2018), e.g. using Feature-wise Linear Modulate (FiLM) (Perez et al., 2018). SUR proposes to leverage a universal representation in few-shot learning tasks with a feature selection procedure that assigns different weights to each of the domain-specific subvectors of the universal representation. The objective is to assign high weights only to the domain-specific representations that are specifically useful for each few-shot task at hand. The weights are inferred by optimizing a loss on the support set that encourages high accuracy of a nearest-centroid classifier. As such, the method does not involve any meta-learning—a choice motivated by the concern that meta-learning may struggle in generalizing to domains that are dissimilar to the training domains. SUR achieved some of the best performances on Meta-Dataset. However, a contribution of our work is to provide evidence that meta-learning can actually be used to replace SUR’s hand-designed inference procedure and improve performance further.
+
+Task Adaptive Representations Another line of work tries to retrieve task adaptive representations for each task. Task specific representations can be conditioned on a representation of the current task (Oreshkin et al., 2018; Wang et al., 2019), projected to another space (Yoon et al., 2019), or masked based on inter-class commonality and inter-class uniqueness (Li et al., 2019). While the representation extracted from URT is also task adaptive, it is adaptive to a set of pretrained backbones and can be applied to more complicated multi-domain scenarios. Wang & Hebert (2016) proposed to improve a CNN by adding extra layers and train it using unsupervised data while our contribution mainly lies in composing representations instead of an improved CNN. Alet et al. (2018) introduced a modular meta-learning method, which learns a repertoire of modules that serves as nodes to construct a tree structure to solve a new robotic-related task. Comparatively, URT is a one-for-all layer which doesn’t need to construct different module structures for each task.
+
+Transformer Networks Our meta-learning approach to leverage universal representations is inspired directly from Transformer networks (Vaswani et al., 2017). Our model structure is inspired by the structure of the dot-product self-attention in the Transformer, which we adapted here to multidomain few-shot learning by designing appropriate parametrizations for queries, keys and values. Self-attention was explored in the single-domain training regime by Ye et al. (2020); Liu et al. (2019b;a; 2020), however for a different purpose, where each representation of individual examples in a task support set is influenced by all other examples. Rather than using self-attention between individual examples in the support set, our model uses self-attention to select between different domain-specific backbones.
+
+# 3 UNIVERSAL REPRESENTATION TRANSFORMER LAYER
+
+In this section, we describe our proposed URT layer, which uses meta-learning episodic training to learn how to combine the domain-specific backbones of a universal representation for any given fewshot learning classification task. URT layer can be built on top of any set of pretrained backbones without further costly fine-tuning of the backbones. More details on how to train multiple domainspecific backbones can be found in Appendix C.
+
+
+Figure 1: Illustration of how a single-head URT layer uses a universal representation to produce a task-specific representation. This example assumes the use of four backbones, with each color illustrating their domain-specific sub-vector representation in the universal representation.
+
+Conceptually, the proposed model views the support set $S$ of a task as providing information on how to query and retrieve from the set $\{ r _ { i } \}$ of $m$ pre-trained backbones the most appropriate backbone to build an adapted representation $\phi$ for the task.
+
+We would like the model to support a variety of strategies on how to retrieve backbones. For example, it might be beneficial for the model to retrieve a single backbone from the set, especially if the domain of the given task matches perfectly that of a domain found in the training set. Alternatively, if some of the training domains benefit from much more training data than others, a better strategy might be to attempt some cross-domain generalization towards the few-shot learning task by blending many backbones together, even if none matches the domain of the task perfectly.
+
+This motivates us to use dot-product self-attention, inspired by layers of Transformer networks (Vaswani et al., 2017). For this reason, we refer to our model as a Universal Representation Transformer (URT) layer. Additionally, since each class of the support set might require a different strategy, we perform attention separately for each class and their support set $S _ { c } = \{ { \pmb x } | ( { \pmb x } , y ) \in S$ and $y = c \}$ .
+
+# 3.1 SINGLE-HEAD URT LAYER
+
+We start by describing an URT layer consisting of a single attention head. An illustration of a singlehead URT layer is shown in Figure 1. Let $r _ { i } ( { \pmb x } )$ be the output vector of the backbone for domain $i$ . We then write the universal representation as
+
+$$
+r ( \mathbf x ) = \mathrm { c o n c a t } ( r _ { 1 } ( \mathbf x ) , \hdots , r _ { m } ( \mathbf x ) ) .
+$$
+
+This representation provides a natural starting point to obtain a representation of a support set class. Specifically, we will note
+
+$$
+r ( S _ { c } ) = \frac { 1 } { \left| S _ { c } \right| } \sum _ { { \pmb x } \in S _ { c } } r ( { \pmb x } )
+$$
+
+as the representation for the set $S _ { c }$ . From this, we can describe the URT layer by defining the queries1, keys, the attention mechanism and output of the layer:
+
+Queries $\mathbf { q } _ { c }$ : For each class $c$ , we obtain a query through $\mathbf { q } _ { c } = \mathbf { W } ^ { q } r ( S _ { c } ) + \mathbf { b } ^ { q }$ , where we have a learnable query linear transformation represented by matrix $\mathbf { W } ^ { q }$ and bias $\mathbf { b } ^ { q }$ .
+
+Keys $\mathbf { k } _ { i , c }$ : For each domain $i$ and class $c$ , we define keys as $\mathbf { k } _ { i , c } = \mathbf { W } ^ { k } r _ { i } ( S _ { c } ) + \mathbf { b } ^ { k }$ , using a learnable linear transformation $\mathbf { W } ^ { k }$ and $\mathbf { b } ^ { k }$ and where $r _ { i } ( S _ { c } ) = 1 / | S _ { c } | \textstyle \sum _ { { \pmb x } \in S _ { c } } r _ { i } ( { \pmb x } )$ , using a similar notation as for $r ( S _ { c } )$ .
+
+# Algorithm 1 Training of URT layer
+
+Input: Number of tasks $\tau _ { t o t a l }$ , $m$ pre-trained backbones ;
+
+1: for $\tau \in \{ 1 , \cdots , \tau _ { t o t a l } \}$ do
+2: Sample a few-shot task $T$ with support set $S$ and query set $Q$ ;
+3: # Infer adapted representation for task from $S$
+4: For each class, obtain representation using $m$ pre-trained backbones as in Eq. (3);
+5: Obtain attention scores using Eq. (4,5) for each head using support set $S$ ;
+6: # Use adapted representation to predict labels in $Q$ from support set $S$
+7: Compute adapted representation of examples in $S$ and $Q$ as in Eq. (6,7);
+8: Compute probabilities of label of examples in $Q$ using Prototypical Network as in Eq. (9);
+9: Compute loss as in Eq. (1,8) and perform gradient descent step on URT parameters $\Theta$ ;
+
+10: end for
+
+Attention scores $\alpha _ { i }$ : as for regular Transformer layers, we use scaled dot-product attention
+
+$$
+\alpha _ { i , c } = \frac { \exp ( \beta _ { i , c } ) } { \sum _ { i ^ { \prime } } \exp ( \beta _ { i ^ { \prime } , c } ) } , \beta _ { i , c } = \frac { { \bf q } _ { c } \mathrm { ~ } ^ { \top } { \bf k } _ { i , c } } { \sqrt { l } } ,
+$$
+
+where $l$ is the dimensionality of the keys and queries. Then, these per-class scores are aggregated to obtain scores for the full support set by averaging
+
+$$
+\alpha _ { i } = \frac { \sum _ { c } \alpha _ { i , c } } { N } .
+$$
+
+Equipped with these attention scores, the URT layer can now produce an adapted representation for the task (for the support and query set examples) by computing
+
+$$
+\phi ( { \bf x } ) = \sum _ { i } \alpha _ { i } r _ { i } ( { \bf x } ) .
+$$
+
+As we can see, this approach has the flexibility of either selecting a single domain-specific backbone (by assigning $\alpha _ { i } = 1$ for a single domain) or blending different domains together (by having $\alpha _ { i } > >$ 0 for multiple backbones).
+
+# 3.2 MULTI-HEAD URT LAYER
+
+The URT layer described so far can only learn to retrieve a single backbone (or blending of backbones). Yet, it might be beneficial to retrieve multiple different (blended) backbones, especially for a few-shot task that would include many classes of varying complexity.
+
+Thus, to achieve such diversity in the adapted representation, we also consider URT layers with multiple heads, i.e. where each head corresponds to the calculation of Equation 6 and each head has its own set of parameters $( \mathbf { W } ^ { q } , \mathbf { b } ^ { q } , \mathbf { W } ^ { k } , \bar { \mathbf { b } ^ { k } } )$ . Denoting each head now as $\phi _ { h }$ , a multi-head URT layer then produces as its output the concatenation of all of its heads:
+
+$$
+\phi ( { \bf x } ) = \mathrm { c o n c a t } ( \phi _ { 1 } ( { \bf x } ) , \ldots , \phi _ { \mathrm { H } } ( { \bf x } ) ) .
+$$
+
+Empirically we found that the randomness in the initialization of head weights alone did not lead to uniqueness and being complimentary between the heads, so inspired by Lin et al. (2017), we add a regularizer to avoid duplication of the attention scores:
+
+$$
+\Omega ( \Theta ) = \| ( \mathbf { A } \mathbf { A } ^ { \top } - \mathbf { I } ) \| _ { F } ^ { 2 } ,
+$$
+
+where $\| \cdot \| _ { F }$ is the Frobenius norm of a matrix and $\mathbf { A } \in \mathbb { R } ^ { n \times m }$ is the matrix for attention scores, with $\mathbf { A } _ { h }$ being the vector of all scores $\alpha _ { i }$ for head $h$ . The identity matrix I regularizes each set of attention scores to be more focused so that multiple heads can attend to different domain-specific backbones.
+
+# 3.3 TRAINING STRATEGY
+
+We train representations produced by the URT layer by following the approach of Prototypical Networks (Snell et al., 2017), where the probability of a label $y$ for a query example $_ { \textbf { \em x } }$ given the
+
+Table 1: Test accuracy (mean $\pm \mathrm { C I } \% 9 5 $ ) over 600 few-shot tasks. URT and the most recent methods, which are listed in the first column, are compared on Meta-Dataset (Triantafillou et al., 2020), which are listed in the first row. The numbers in bold have intersecting confidence intervals with the most accurate method.
+
+
+
+support set of a task is modeled as:
+
+$$
+p ( y = c | \pmb { x } , S ; \Theta ) = \frac { \exp ( - d ( \phi ( \pmb { x } ) - \pmb { p _ { c } } ) ) } { \sum _ { c ^ { \prime } = 1 } ^ { N } \exp ( - d ( \phi ( \pmb { x } ) - \pmb { p _ { c ^ { \prime } } } ) ) } ,
+$$
+
+where $d$ is a distance metric and $\pmb { p } _ { c } = 1 / | S _ { c } | \sum _ { \pmb { x } \in S _ { c } } \phi ( \pmb { x } )$ corresponds to the centroid of class $c _ { \cdot }$ referred to as its prototype. We use (negative) cosine similarity as the distance. The full training algorithm is presented in Algorithm 1.
+
+# 4 EXPERIMENTS
+
+In this section, we seek to answer three key experimental questions:
+
+Q1 How does URT compare with previous state-of-the-art on Meta-Dataset for multi-domain fewshot classification?
+Q2 Do the URT attention heads generate interpretable and meaningful attention scores?
+Q3 Does the URT layer provide consistent benefits, even when pre-trained backbones are trained in different ways?
+
+In addition, we investigate architectural choices made, such as our models for keys/queries and their regularization, and study their contribution to achieving strong performance with URT.
+
+# 4.1 DATASETS AND SETUP
+
+We test our methods on the large-scale few-shot learning benchmark Meta-Dataset (Triantafillou et al., 2020). It consists of ten datasets with various data distributions across different domains, including natural images (Birds, Fungi, VGG Flower), hand-written characters (Omniglot, Quick Draw), and human created objects (Traffic Signs, Aircraft). Among the ten datasets, eight provide data that can be used during either training, validation and testing (with each class assigned to only one of those sets), while two datasets are solely used for testing. Following Bateni et al. (2020); Requeima et al. (2019), we also report results on MNIST (LeCun et al., 1998), CIFAR10 and CIFAR100 (Krizhevsky et al., 2009) as additional unseen test datasets. Following Triantafillou et al. (2020), few-shot tasks are sampled with varying number of classes $N$ , varying number of shots $K$ and class imbalance. The performance is reported as the average accuracy over 600 sampled tasks. More details of Meta-Dataset can be found in Triantafillou et al. (2020).
+
+The domain-specific backbones are pre-trained following the setup in (Dvornik et al., 2020). Then, we freeze the backbone and train the URT layer for 10,000 episodes, with an initial learning rate of 0.01 and a cosine learning rate scheduler. Following Chen et al. (2020), the training episodes have $50 \%$ probability coming from the ImageNet data source. Since different pre-trained backbones may produce representations with different vector norms, we normalize the outputs of the backbones as in Dvornik et al. (2020). URT is trained with parameter weight decay of 1e-5 and with a regularization factor $\lambda = 0 . 1$ . The number of heads ( $H$ in Equation 7), is set to 2 and the dimension of the keys and queries (l in Equation 4) is set to 1024. We choose the hyper-parameters based on the performance of the validation set. Details of the hyper-parameter selection and how the performance is influenced by them are outlined in Section 4.5. We find that the bottleneck of training URT is extracting features from CNN. Since we freeze the CNN when training the URT, we find dumping the extracted feature episodes can significantly speed up the training procedure from days to around 2 hours.
+
+
+Figure 2: Average attention scores generated by URT with two heads. Rows correspond to the domain of the test tasks and the columns correspond to the pre-trained backbones $r _ { i } ( { \pmb x } )$ trained on the eight training domains.
+
+# 4.2 COMPARISON WITH PREVIOUS APPROACHES
+
+Table 1 presents a comparison of URT with SUR, as well as other baselines based on transfer learning by fine-tuning (Saikia et al., 2020) or meta-learning (Prototypical Networks (Snell et al., 2017), first-order MAML (Finn et al., 2017), ProtoMAML (Triantafillou et al., 2020), CNAPs (Requeima et al., 2019)) and Simple CNAPS(Bateni et al., 2020).
+
+We observe in Table 1 that URT establishes a new state-of-the-art on Meta-Dataset, by achieving the top performance on 8 out of the 10 dataset sources. When comparing to its predecessor, URT outperforms SUR on 4 datasets without compromising performance on others, which is challenging to achieve in the multi-domain setting. Of note, the average inference time for URT is 0.04 second per task, compared to 0.43 for SUR, on a single V100. Thus, getting rid of the optimization procedure for every episode with our meta-trained URT layer also significantly increases the latency, by more than $1 0 \times$ . More results on additional datasets can be found in Appendix A.
+
+# 4.3 INTERPRETING AND VISUALIZING ATTENTION BY URT
+
+To better understand how the URT model of Section 4.2 uses its two heads to build adapted representations, we visualize the attention scores produced on the test tasks of Meta-Dataset in Figure 2.
+
+The blue (first head) and orange (second head) heatmaps summarize the values of the attention scores (Equation 5), averaged across several tasks for each test domain. Specifically, the element on row $t$ and column $i$ is the averaged attention scores $\alpha _ { i }$ computed on test set domain $t$ for the backbone from domain $i$ . Note that the last two rows are the two unseen domain datasets. We found that for datasets from the seen domains, i.e. the first eight rows, one head (right, orange) consistently puts most of its weight on the backbone pre-trained on the same domain, while the other head (left, blue) learns relatively smoother weight distributions that blend other related domains. For unseen datasets, the right head puts half of its weight on ImageNet and the left head learned to blend the representations from four backbones.
+
+Table 2: Test accuracy (mean $\pm \mathrm { C I } \% 9 5$ ) over 600 few-shot tasks. All methods use parametric network family (pf) backbones.
+
+
SUR-pf
URT-pf
VS.
ILSVRC
56.0 ± 1.1
55.5 ± 1.1
二
Omniglot
90.0 ± 0.8
90.2 ± 0.6
二
Aircraft
79.7 ± 0.8
79.8 ± 0.7
=
Birds
75.9 ± 0.9
77.5 ± 0.8
三
Textures
72.5 ± 0.7
73.5 ± 0.7
Quick Draw
76.7 ± 0.7
75.8 ± 0.7
三 二
Fungi
49.8 ± 1.1
48.1 ± 0.9
+
VGG Flower
90.0 ± 0.6
91.9 ± 0.5
二
Traffic Signs
52.2 ± 0.8
52.0 ± 1.4
MSCOCO
50.2 ± 1.1
52.1 ± 1.0
MNIST
93.2 ± 0.4
93.9 ± 0.4
=
CIFAR10
66.4 ± 0.8
66.1 ± 0.8
三
CIFAR100
57.1 ± 1.0
57.3 ± 1.0
二
+
+# 4.4 URT USING FILM MODULATED BACKBONES
+
+As additional evidence of the benefit of URT on universal representations, we also present experiments based on a different set of backbone architectures. Following SUR (Dvornik et al., 2020), we consider the backbones from a parametric network family, obtained by training a base backbone on one dataset (ILSVRC) and then learning separate FiLM layers (Perez et al., 2018) for each other dataset, to modulate the backbone so it is adapted to the other domains. These backbones collectively have only $0 . 5 \%$ more parameters than a single backbone. More details of the backbones can be found in Appendix C.
+
+A comparison between SUR and URT using these backbones (referred to as SUR-pf and URT-pf) is presented in Table 2. Once again, URT can improve the performance on VGG Flower without sacrificing performance on others.
+
+# 4.5 HYPER-PARAMETER AND ABLATION STUDIES
+
+We analyze the importance of the various components of URT’s attention mechanism structure and training strategy in Table 3. First we analyze the importance of using the support set to model queries and/or keys. To this end, we consider setting the matrices $\mathbf { W } ^ { q } / \mathbf { W } ^ { k }$ of the query / key linear transformation to 0, which only leaves the bias term. We found that the support set representation is most crucial for building the keys (row w/o $\mathbf { W } ^ { k }$ in the table) and has minor benefits for queries (row $\mathbf { w } / \mathbf { o } \mathbf { W } ^ { q } )$ in the table. This observation is possibly related to the success of attention-based models with learnable constant queries (Liu et al., 2016; Lin et al., 2017). We also found that adding a regularizer $\Omega ( \Theta )$ as in Equation 8 is important for some datasets, specifically VGG Flower and Birds.
+
+Table 3: Meta-Dataset performance variation on ablations of elements of the URT layer.
+
+
+
+An important hyper-parameter in URT is the number of heads $H$ . We chose this hyper-parameter based on the performance on validation set of tasks in Meta-Dataset. In Table 4, we show the validation performance of URT for varying number of heads. As suggested by Triantafillou et al. (2020), we considered looking at the rank of the performance achieved by each choice of $H$ for each validation domains, and taking the average across domains as a validation metric. However, since the performances when using two to four heads are similar and yield the same average rank, we instead simply consider the average accuracy as the selection criteria.
+
+Table 4: Validation performance on Meta-Dataset using different number of heads
+
+
1
2
3
4
5
6
7
8
Average Accuracy
74.605
77.145
76.943
76.984
76.602
75.906
75.454
74.473
Average Rank
2.875
1.000
1.000
1.000
2.250
2.250
2.25
2.50
+
+In general, we observe a large jump in performance when using multiple heads instead of just one. However, since the number of heads controls the capacity, predictably we also observe that having too many heads leads to overfitting.
+
+# 5 CONCLUSION
+
+We proposed the URT layer to effectively integrate representations from multiple domains and demonstrated improved performance in multi-domain few-shot classification. Notably, our URT approach was able to set a new state-of-the-art on Meta-Dataset, and never performs worse than its predecessor (SUR) while also being $1 0 \times$ more efficient at inference. This work suggests that combining meta-learning with pre-trained universal representations is a promising direction for new few-shot learning methods. Specifically, we hope that future work can investigate the design of richer forms of universal representations that go beyond simply pre-training a single backbone for each domain, and developing meta-learners adapted to those settings.
+
+# REFERENCES
+
+Ferran Alet, Tomas Lozano-P ´ erez, and Leslie P Kaelbling. Modular meta-learning. In ´ Conference on Robot Learning (CoRL), 2018.
+
+Peyman Bateni, Raghav Goyal, Vaden Masrani, Frank Wood, and Leonid Sigal. Improved few-shot visual classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+
+Hakan Bilen and Andrea Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. arXiv preprint arXiv:1701.07275, 2017.
+
+Wei-Yu Chen, Yen-Cheng Liu, Zsolt Liu, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. In International Conference on Learning Representations (ICLR), 2019.
+
+Yinbo Chen, Xiaolong Wang, Zhuang Liu, Huijuan Xu, and Trevor Darrell. A new meta-baseline for few-shot learning. arXiv preprint arXiv:2003.04390, 2020.
+
+Guneet Singh Dhillon, Pratik Chaudhari, Avinash Ravichandran, and Stefano Soatto. A baseline for few-shot image classification. In International Conference on Learning Representations (ICLR), 2020.
+
+Nikita Dvornik, Cordelia Schmid, and Julien Mairal. Selecting relevant features from a universal representation for few-shot classification. arXiv preprint arXiv:2003.09338, 2020.
+
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In The International Conference on Machine Learning (ICML), 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 (CVPR), 2016.
+
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
+
+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, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang. Finding taskrelevant features for few-shot learning by category traversal. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
+
+Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. arXiv preprint arXiv:1703.03130, 2017.
+
+Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, Lina Yao, and Chengqi Zhang. Prototype propagation networks (PPN) for weakly-supervised few-shot learning on category graph. In International Joint Conferences on Artificial Intelligence (IJCAI), 2019a.
+
+Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, and Chengqi Zhang. Learning to propagate for graph meta-learning. In Neural Information Processing Systems (NeurIPS), 2019b.
+
+Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, and Chengqi Zhang. Attribute propagation network for graph zero-shot learning. In AAAI Conference on Artificial Intelligence (AAAI), 2020.
+
+Yang Liu, Chengjie Sun, Lei Lin, and Xiaolong Wang. Learning natural language inference using bidirectional lstm model and inner-attention. arXiv preprint arXiv:1605.09090, 2016.
+
+Boris Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. Tadam: Task dependent adaptive ´ metric for improved few-shot learning. In The Conference on Neural Information Processing Systems (NeurIPS), 2018.
+
+Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. Film: Visual reasoning with a general conditioning layer. In AAAI Conference on Artificial Intelligence (AAAI), 2018.
+
+Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Efficient parametrization of multidomain deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
+
+Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. In International Conference on Learning Representations (ICLR), 2018.
+
+James Requeima, Jonathan Gordon, John Bronskill, Sebastian Nowozin, and Richard E Turner. Fast and flexible multi-task classification using conditional neural adaptive processes. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 7957–7968, 2019.
+
+Tonmoy Saikia, Thomas Brox, and Cordelia Schmid. Optimized generic feature learning for fewshot classification across domains. arXiv preprint arXiv:2001.07926, 2020.
+
+Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In The Conference on Neural Information Processing Systems (NeurIPS), 2017.
+
+Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, et al. Meta-dataset: A dataset of datasets for learning to learn from few examples. In International Conference on Learning Representations (ICLR), 2020.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In The Conference on Neural Information Processing Systems (NeurIPS), 2017.
+
+Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In The Conference on Neural Information Processing Systems (NeurIPS), 2016.
+
+Xin Wang, Fisher Yu, Ruth Wang, Trevor Darrell, and Joseph E Gonzalez. Tafe-net: Task-aware feature embeddings for low shot learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
+
+Yu-Xiong Wang and Martial Hebert. Learning from small sample sets by combining unsupervised meta-training with cnns. In The Conference on Neural Information Processing Systems (NeurIPS), 2016.
+
+Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Few-shot learning via embedding adaptation with set-to-set functions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+
+Sung Whan Yoon, Jun Seo, and Jaekyun Moon. Tapnet: Neural network augmented with taskadaptive projection for few-shot learning. In The International Conference on Machine Learning (ICML), 2019.
+
+# A EXPERIMENTS ON MORE DATASETS
+
+We also report performances on the MNIST, CIFAR-10 and CIFAR-100 dataset sources in Table 5, and compare with the subset of methods that have reported on these datasets. There, URT neither improves nor gets worse performance than SUR, yeilding top performance on the MNIST domain but not on the CIFAR-10/CIFAR-100 domain, on which Simple CNAPS has the best performance.
+
+Table 5: Test performance (mean $1 { + } \mathrm { C I } \% 9 5$ ) over 600 few-shot tasks on additional datasets.
+
+
MNIST CIFAR10
CIFAR100
avg. rank
CNAPs
92.7 ± 0.4 61.5 ± 0.7
50.1 ± 1.0
4.7
TaskNorm
92.3 ± 0.4 69.3 ± 0.8
54.6 ± 1.1
3.3
SUR
94.3 ± 0.4 66.8 ± 0.9
56.6 ± 1.0
2.3
SimpleCNAPS
93.9 ± 0.4 74.3± 0.7
60.5 ± 1.0
1.7
URT (Ours)
94.8 ± 0.4 67.3 ± 0.8
56.9 ± 1.0
2.0
+
+# B MORE RELATED WORKS
+
+Transfer by fine-tuning A simple and effective method for few-shot classification is to perform transfer learning by first learning a neural network classifier on all data available for training and using its representation to initialize and then fine-tune neural networks on the few-shot classification tasks found at test time (Chen et al., 2019; Triantafillou et al., 2020; Dhillon et al., 2020; Saikia et al., 2020). Specifically, Saikia et al. (2020) have shown that competitive performance can be reached using a strong hyper-parameter optimization method applied on a carefully designed validation metric appropriate for few-shot learning.
+
+# C STRUCTURES AND TRAINING STRATEGY OF BACKBONES
+
+Our URT layer can be built on top of a set of pretrained backbones. The structures of the backbones follow the approach in Dvornik et al. (2020). For Table 1, we use the ResNet18 architecture (He et al., 2016) for the backbones, where a separate backbone is pretrained on each domain separately using the corresponding training data in meta-dataset. The training domains include ImageNet, Omniglot, Aircraft, CU-Birds, Textures, Quick Draw, Fungi and VGG-Flower. For the parametric network family in Table 2, a base ResNet18 is first trained on ImageNet. Then a small number of modulating parameters are trained on the other domains, using their domain-specific training data, while the rest of the base backbone’s weights stay fixed. Specifically, FiLM feature modulation (Perez et al., 2018) is used. This type of parametric network family thus allows for a much reduced number of learnable parameters, by reusing the weights from the base network. In experiments, we use the pretrained backbones released by Dvornik et al. (2020) for both cases, without any further finetuning. End-to-end training of a set of backbones and the URT layers requires unaffordable computational cost, so we fix the pretrained backbones and only train the URT layer.
+
+Implementation details for training backbones The training details of the backbones come from Dvornik et al. (2020). For optimization, SGD with momentum was used, using cosine learning rate annealing. Since the datasets come from different domains, the starting learning rate, the maximum number of training iterations and annealing frequency are set individually for each dataset. Data augmentation is applied and a constant weight decay of $\mathrm { \dot { 7 } } \times 1 0 ^ { - 4 }$ is set. For each dataset, a grid search over batch size in [8, 16, 32, 64] was run and the one that maximizes accuracy on the validation set was picked. For the parametric network family, the base ResNet18 trained on ImageNet is the same. For other backbones, cosine annealing as learning rate policy is also used, weight decay and data augmentation employed as above. Please refer to Table 4 and Table 5 in the original SUR paper (Dvornik et al., 2020) for the specific values of the hyperparameters for the individual feature networks and the parametric network family, respectively.
+
+# D RESULTS ON TRAFFIC SIGNS
+
+The shuffle buffer bug described in meta-dataset issue #54 (https://github.com/googleresearch/meta-dataset/issues/54) has been propagated to previous works such as CNAPs (Requeima et al., 2019). The results for the Traffic Signs dataset are considerably worse after fixing this bug. For instance, URT degrades from $6 9 . 4 { \pm } 0 . 8 $ to $5 1 . 1 { \pm } 1 . 1$ . Please visit the official meta-dataset GitHub repo for more details. The main paper shows the corrected results (for URT and competing approaches). For completeness, we also provide the tables as they were in the initial version of this paper for your reference in this Appendix. Both sets of results overall support the advantageous performance of URT over previous work.
+
+Table 6: Test accuracy ( $\mathrm { m e a n \pm C I \% 9 5 } ,$ ) over 600 few-shot tasks. URT and the most recent methods, which are listed in the first column, are compared on Meta-Dataset (Triantafillou et al., 2020), which are listed in the first row. The numbers in bold have intersecting confidence intervals with the most accurate method.
+
+
ILSVRC
Omniglot
Aircraft
Birds
Textures
QuickDraw
Fungi
VGGFlower
TrafficSigns
MSCOCO
avg.rank
MAML
37.8±1.0
83.9±1.0 76.4±0.7
62.4±1.1
64.1±0.8
59.7±1.1
33.5±1.1
79.9±0.8
42.9±1.3
29.4±1.1
8.0
ProtoNet
44.5±1.1
79.6±1.1
71.1±0.9 67.0±1.0 65.2±0.8
64.9±0.9
40.3±1.1
86.9±0.7
46.5±1.0
39.9±1.1
7.3
ProtoMAML
46.5±1.1
82.7±1.0 75.2±0.8 69.9±1.0 68.3±0.8
66.8±0.9
42.0±1.2
88.7±0.7
52.4±1.1
41.7±1.1
5.4
CNAPs
52.3±1.0
88.4±0.7 80.5±0.6 72.2±0.9 58.3±0.7
72.5±0.8
47.4±1.0
86.0±0.5
60.2±0.9
42.6±1.1
5.1
BOHB-E
55.4±1.1
77.5±1.1
60.9±0.9
73.6±0.8
72.8±0.7
61.2±0.9
44.5±1.1
90.6±0.6
57.5±1.0
51.9±1.0
4.4
TaskNorm
50.6±1.1
90.7±0.6 83.8±0.6
574.6±0.8
62.1±0.7
74.8±0.7
48.7±1.0
89.6±0.6
67.0±0.7
43.4±1.0
3.8
SUR
56.3±1.1
93.1±0.5 85.4±0.7 71.4±1.0 71.5±0.8
81.3±0.6
63.1±1.0
82.8±0.7
70.4±0.8
52.4±1.1
2.5
SimpleCNAPS 58.6±1.1 9
91.7±0.6 82.4±0.7 74.9±0.8 67.8±0.8
77.7±0.7
46.9±1.0
90.7±0.5
73.5±0.7
46.2±1.1
2.4
URT(Ours)
55.7±1.0
94.4±0.4 85.8±0.6 76.3±0.8 71.8±0.7
82.5±0.6
63.5±1.0
88.2±0.6
69.4±0.8
52.2±1.1
1.6
+
+Table 7: Test accuracy (mean $\pm \mathrm { C I } \% 9 5 $ ) over 600 few-shot tasks. All methods use parametric network family (pf) backbones.
+
+
SUR-pf
URT-pf
VS.
ILSVRC
56.4 ± 1.2
55.5 ± 1.1
=
Omniglot
88.5±0.8
90.2 ± 0.6
+
Aircraft
79.5 ± 0.8
79.8 ± 0.7
=
Birds
76.4 ± 0.9
77.5 ± 0.8
=
Textures
73.1 ± 0.7
73.5± 0.7
=
Quick Draw
75.7 ± 0.7
75.8 ± 0.7
=
Fungi
48.2 ± 0.9
48.1 ± 0.9
=
VGG Flower
90.6 ± 0.5
91.9 ± 0.5
+
Traffic Signs
65.1 ± 0.8
67.5 ± 0.8
+
MSCOCO
52.1 ± 1.0
52.1 ± 1.0
=
MNIST
93.2 ± 0.4
93.9 ± 0.4
=
CIFAR10
66.4 ± 0.8
66.1 ± 0.8
=
CIFAR100
57.1 ± 1.0
57.3 ±1.0
=
\ No newline at end of file
diff --git a/md/train/1Fqg133qRaI/1Fqg133qRaI.md b/md/train/1Fqg133qRaI/1Fqg133qRaI.md
new file mode 100644
index 0000000000000000000000000000000000000000..f8289e7b725f80b4bb5131698ce0747ab117fd8a
--- /dev/null
+++ b/md/train/1Fqg133qRaI/1Fqg133qRaI.md
@@ -0,0 +1,289 @@
+# TOWARDS FASTER AND STABILIZED GAN TRAINING FOR HIGH-FIDELITY FEW-SHOT IMAGE SYNTHESIS
+
+Bingchen ${ \bf L i u ^ { 1 , 2 } }$ , Yizhe $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 2 }$ , Kunpeng $\mathbf { S o n g ^ { 1 , 2 } }$ , Ahmed Elgammal1,2
+
+1Playform - Artrendex Inc., USA
+2Department of Computer Science, Rutgers University
+{bingchen.liu,yizhe.zhu,kunpeng.song}@rutgers.edu
+elgammal@artrendex.com
+
+# ABSTRACT
+
+Training Generative Adversarial Networks (GAN) on high-fidelity images usually requires large-scale GPU-clusters and a vast number of training images. In this paper, we study the few-shot image synthesis task for GAN with minimum computing cost. We propose a light-weight GAN structure that gains superior quality on $1 0 2 4 \times 1 0 2 4$ resolution. Notably, the model converges from scratch with just a few hours of training on a single RTX-2080 GPU, and has a consistent performance, even with less than 100 training samples. Two technique designs constitute our work, a skip-layer channel-wise excitation module and a self-supervised discriminator trained as a feature-encoder. With thirteen datasets covering a wide variety of image domains 1, we show our model’s superior performance compared to the state-of-the-art StyleGAN2, when data and computing budget are limited.
+
+# 1 INTRODUCTION
+
+The fascinating ability to synthesize images using the state-of-the-art (SOTA) Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) display a great potential of GANs for many intriguing real-life applications, such as image translation, photo editing, and artistic creation. However, expensive computing cost and the vast amount of required training data limit these SOTAs in real applications with only small image sets and low computing budgets.
+
+In real-life scenarios, the available samples to train a GAN can be minimal, such as the medical images of a rare disease, a particular celebrity’s portrait set, and a specific artist’s artworks. Transferlearning with a pre-trained model (Mo et al., 2020; Wang et al., 2020) is one solution for the lack of training images. Nevertheless, there is no guarantee to find a compatible pre-training dataset. Furthermore, if not, fine-tuning probably leads to even worse performance (Zhao et al., 2020).
+
+
+Figure 1: Synthetic results on $1 0 2 4 ^ { 2 }$ resolution of our model, trained from scratch on single RTX 2080-Ti GPU, with only 1000 images. Left: 20 hours on Nature photos; Right: 10 hours on FFHQ.
+
+In a recent study, it was highlighted that in art creation applications, most artists prefers to train their models from scratch based on their own images to avoid biases from fine-tuned pre-trained model. Moreover, It was shown that in most cases artists want to train their models with datasets of less than
+
+100 images (Elgammal et al., 2020). Dynamic data-augmentation (Karras et al., 2020a; Zhao et al., 2020) smooths the gap and stabilizes GAN training with fewer images. However, the computing cost from the SOTA models such as StyleGAN2 (Karras et al., 2020b) and BigGAN (Brock et al., 2019) remain to be high, especially when trained with the image resolution on $1 0 2 4 \times 1 0 2 4$ .
+
+In this paper, our goal is to learn an unconditional GAN on high-resolution images, with low computational cost and few training samples. As summarized in Fig. 2, these training conditions expose the model to a high risk of overfitting and mode-collapse (Arjovsky & Bottou, 2017; Zhang & Khoreva, 2018). To train a GAN given the demanding training conditions, we need a generator $( G )$ that can learn fast, and a discriminator $( D )$ that can continuously provide useful signals to train $G$ . To address these challenges, we summarize our contribution as:
+
+• We design the Skip-Layer channel-wise Excitation (SLE) module, which leverages lowscale activations to revise the channel responses on high-scale feature-maps. SLE allows a more robust gradient flow throughout the model weights for faster training. It also leads to an automated learning of a style/content disentanglement like StyleGAN2. We propose a self-supervised discriminator $D$ trained as a feature-encoder with an extra decoder. We force $D$ to learn a more descriptive feature-map covering more regions from an input image, thus yielding more comprehensive signals to train $G$ . We test multiple selfsupervision strategies for $D$ , among which we show that auto-encoding works the best. • We build a computational-efficient GAN model based on the two proposed techniques, and show the model’s robustness on multiple high-fidelity datasets, as demonstrated in Fig. 1.
+
+# 2 RELATED WORKS
+
+Speed up the GAN training: Speeding up the training of GAN has been approached from various perspectives. Ngxande et al. propose to reduce the computing time with depth-wise convolutions. Zhong et al. adjust the GAN objective into a min-max-min problem for a shorter optimization path. Sinha et al. suggest to prepare each batch of training samples via a coreset selection, leverage the better data preparation for a faster convergence. However, these methods only bring a limited improvement in
+
+
+Figure 2: The causes and challenges for training GAN in our studied conditions.
+
+training speed. Moreover, the synthesis quality is not advanced within the shortened training time.
+
+Train GAN on high resolution: High-resolution training for GAN can be problematic. Firstly, the increased model parameters lead to a more rigid gradient flow to optimize $G$ . Secondly, the target distribution formed by the images on $1 0 2 4 \times 1 0 2 4$ resolution is super sparse, making GAN much harder to converge. Denton et al. (2015); Zhang et al. (2017); Huang et al. (2017); Wang et al. (2018); Karras et al. (2019); Karnewar & Wang (2020); Karras et al. (2020b); Liu et al. (2021) develop the multi-scale GAN structures to alleviate the gradient flow issue, where $G$ outputs images and receives feedback from several resolutions simultaneously. However, all these approaches further increase the computational cost, consuming even more GPU memory and training time.
+
+Stabilize the GAN training: Mode-collapse on $G$ is one of the big challenges when training GANs. And it becomes even more challenging given fewer training samples and a lower computational budget (a smaller batch-size). As $D$ is more likely to be overfitting on the datasets, thus unable to provide meaningful gradients to train $G$ (Gulrajani et al., 2017).
+
+Prior works tackle the overfitting issue by seeking a good regularization for $D$ , including different objectives (Arjovsky et al., 2017; Lim & Ye, 2017; Tran et al., 2017); regularizing the gradients (Gulrajani et al., 2017; Mescheder et al., 2018); normalizing the model weights (Miyato et al., 2018); and augmenting the training data (Karras et al., 2020a; Zhao et al., 2020). However, the effects of these methods degrade fast when the training batch-size is limited, since appropriate batch statistics can hardly be calculated for the regularization (normalization) over the training iterations.
+
+Meanwhile, self-supervision on $D$ has been shown to be an effective method to stabilize the GAN training as studied in Tran et al. (2019); Chen et al. (2019). However, the auxiliary self-supervision tasks in prior works have limited using scenario and image domain. Moreover, prior works only studied on low resolution images ( $3 2 ^ { 2 }$ to $1 2 8 ^ { 2 }$ ), and without a computing resource limitation.
+
+# 3 METHOD
+
+We adopt a minimalistic design for our model. In particular, we use a single conv-layer on each resolution in $G$ , and apply only three (input and output) channels for the conv-layers on the high resolutions $( \geq 5 1 2 \times 5 1 2 )$ in both $G$ and $D$ . Fig. 3 and Fig. 4 illustrate the model structure for our $G$ and $D$ , with descriptions of the component layers and forward flow. These structure designs make our GAN much smaller than SOTA models and substantially faster to train. Meanwhile, our model remains robust on small datasets due to its compact size with the two proposed techniques.
+
+
+Figure 3: The structure of the skip-layer excitation module and the Generator. Yellow boxes represent feature-maps (we show the spatial size and omit the channel number), blue box and blue arrows represent the same up-sampling structure, red box contains the SLE module as illustrated on the left.
+
+# 3.1 SKIP-LAYER CHANNEL-WISE EXCITATION
+
+For synthesizing higher resolution images, the generator $G$ inevitably needs to become deeper, with more conv-layers, in concert with the up-sampling needs. A deeper model with more convolution layers leads to a longer training time of GAN, due to the increased number of model parameters and a weaker gradient flow through $G$ (Zhang et al., 2017; Karras et al., 2018; Karnewar & Wang, 2020). To better train a deep model, He et al. design the Residual structure (ResBlock), which uses a skip-layer connection to strengthen the gradient signals between layers. However, while ResBlock has been widely used in GAN literature (Wang et al., 2018; Karras et al., 2020b), it also increases the computation cost.
+
+We reformulate the skip-connection idea with two unique designs into the Skip-Layer Excitation module (SLE). First, ResBlock implements skip-connection as an element-wise addition between the activations from different conv-layers. It requires the spatial dimensions of the activations to be the same. Instead of addition, we apply channel-wise multiplications between the activations, eliminating the heavy computation of convolution (since one side of the activations now has a spatial dimension of $1 ^ { 2 }$ ). Second, in prior GAN works, skip-connections are only used within the same resolution. In contrast, we perform skip-connection between resolutions with a much longer range (e.g., $8 ^ { 2 }$ and $1 2 8 ^ { 2 }$ , $1 6 ^ { 2 }$ and $2 5 6 ^ { 2 }$ ), since an equal spatial-dimension is no longer required. The two designs make SLE inherits the advantages of ResBlock with a shortcut gradient flow, meanwhile without an extra computation burden.
+
+Formally, we define the Skip-Layer Excitation module as:
+
+$$
+\mathbf { y } = \mathcal { F } ( \mathbf { x } _ { l o w } , \{ \mathbf { W } _ { i } \} ) \cdot \mathbf { x } _ { h i g h }
+$$
+
+Here $\mathbf { x }$ and $\mathbf { y }$ are the input and output feature-maps of the SLE module, the function $\mathcal { F }$ contains the operations on $\mathbf { x } _ { l o w }$ , and $\mathbf { W } _ { i }$ indicates the module weights to be learned. The left panel in Fig. 3 shows an SLE module in practice, where $\mathbf { x } _ { l o w }$ and ${ \bf x } _ { h i g h }$ are the feature-maps at $8 \times 8$ and $1 2 8 \times 1 2 8$ resolution respectively. An adaptive average-pooling layer in $\mathcal { F }$ first down-samples $\mathbf { x } _ { l o w }$ into $4 \times 4$ along the spatial-dimensions, then a conv-layer further down-samples it into $1 \times 1$ . A LeakyReLU is used to model the non-linearity, and another conv-layer projects $\mathbf { x } _ { l o w }$ to have the same channel size as ${ \bf x } _ { h i g h }$ . Finally, after a gating operation via a Sigmoid function, the output from $\mathcal { F }$ multiplies ${ \bf x } _ { h i g h }$ along the channel dimension, yielding y with the same shape as ${ \bf x } _ { h i g h }$ .
+
+SLE partially resembles the Squeeze-and-Excitation module (SE) proposed by Hu et al.. However, SE operates within one feature-map as a self-gating module. In comparison, SLE performs between feature-maps that are far away from each other. While SLE brings the benefit of channel-wise feature re-calibration just like SE, it also strengthens the whole model’s gradient flow like ResBlock. The channel-wise multiplication in SLE also coincides with Instance Normalization (Ulyanov et al., 2016; Huang & Belongie, 2017), which is widely used in style-transfer. Similarly, we show that SLE enables $G$ to automatically disentangle the content and style attributes, just like StyleGAN (Karras et al., 2019). As SLE performs on high-resolution feature-maps, altering these feature-maps is shown to be more likely to change the style attributes of the generated image (Karras et al., 2019; Liu et al., 2021). By replacing $\mathrm { x } _ { l o w }$ in SLE from another synthesized sample, our $G$ can generate an image with the content unchanged, but in the same style of the new replacing image.
+
+# 3.2 SELF-SUPERVISED DISCRIMINATOR
+
+Our approach to provide a strong regularization for $D$ is surprisingly simple. We treat $D$ as an encoder and train it with small decoders. Such auto-encoding training forces $D$ to extract image features that the decoders can give good reconstructions. The decoders are optimized together with $D$ on a simple reconstruction loss, which is only trained on real samples:
+
+$$
+\mathcal { L } _ { r e c o n s } = \mathbb { E } _ { { \mathbf { f } } \sim D _ { e n c o d e } ( x ) , x \sim I _ { r e a l } } [ | | \mathcal { G } ( { \mathbf { f } } ) - \mathcal { T } ( x ) | | ] ,
+$$
+
+where f is the intermediate feature-maps from $D$ , the function $\mathcal { G }$ contains the processing on $\mathbf { f }$ and the decoder, and the function $\tau$ represents the processing on sample $x$ from real images $I _ { r e a l }$ .
+
+
+Figure 4: The structure and the forward flow of the Discriminator. Blue box and arrows represent the same residual down-sampling structure, green boxes mean the same decoder structure.
+
+Our self-supervised $D$ is illustrated in Fig. 4, where we employ two decoders for the feature-maps on two scales: $\mathbf { f } _ { 1 }$ on $1 6 ^ { 2 }$ and $\mathbf { f } _ { 2 }$ on $8 ^ { 2 }$ . The decoders only have four conv-layers to produce images at $1 2 8 \times 1 2 8$ resolution, causing little extra computations (much less than other regularization methods). We randomly crop $\mathbf { f } _ { 1 }$ with $\frac { 1 } { 8 }$ of its height and width, then crop the real image on the same portion to get $I _ { p a r t }$ . We resize the real image to get $I$ . The decoders produce $I _ { p a r t } ^ { \prime }$ from the cropped $\mathbf { f } _ { 1 }$ , and $I ^ { \prime }$ from $\mathbf { f } _ { 2 }$ . Finally, $D$ and the decoders are trained together to minimize the loss in eq. 2, by matching $I _ { p a r t } ^ { \prime }$ to $I _ { p a r t }$ and $I ^ { \prime }$ to $I$ .
+
+Such reconstructive training makes sure that $D$ extracts a more comprehensive representation from the inputs, covering both the overall compositions (from $\mathbf { f } _ { 2 }$ ) and detailed textures (from $\mathbf { f } _ { 1 }$ ). Note that the processing in $\mathcal { G }$ and $\tau$ are not limited to cropping; more operations remain to be explored for better performance. The auto-encoding approach we employ is a typical method for self-supervised learning, which has been well recognized to improve the model robustness and generalization ability (He et al., 2020; Hendrycks et al., 2019; Jing & Tian, 2020; Goyal et al., 2019). In the context of GAN, we find that a regularized $D$ via self-supervision training strategies significantly improves the synthesis quality on $G$ , among which auto-encoding brings the most performance boost.
+
+Although our self-supervision strategy for $D$ comes in the form of an auto-encoder (AE), this approach is fundamentally different from works trying to combine GAN and AE (Larsen et al., 2016;
+
+Guo et al., 2019; Zhao et al., 2016; Berthelot et al., 2017). The latter works mostly train $G$ as a decoder on a learned latent space from $D$ , or treat the adversarial training with $D$ as an supplementary loss besides AE’s training. In contrast, our model is a pure GAN with a much simpler training schema. The auto-encoding training is only for regularizing $D$ , where $G$ is not involved.
+
+In sum, we employ the hinge version of the adversarial loss (Lim & Ye (2017); Tran et al. (2017)) to iteratively train our $\mathrm { D }$ and G. We find the different GAN losses make little performance difference, while hinge loss computes the fastest:
+
+$$
+\begin{array} { r l } & { \mathcal { L } _ { D } = - \mathbb { E } _ { x \sim I _ { r { e a l } } } [ m i n ( 0 , - 1 + D ( x ) ) ] - \mathbb { E } _ { \hat { x } \sim G ( z ) } [ m i n ( 0 , - 1 - D ( \hat { x } ) ] + \mathcal { L } _ { r e c o n s } } \\ & { \mathcal { L } _ { G } = - \mathbb { E } _ { z \sim N } [ D ( G ( z ) ) ] , } \end{array}
+$$
+
+# 4 EXPERIMENT
+
+Datasets: We conduct experiments on multiple datasets with a wide range of content categories. On $2 5 6 \times 2 5 6$ resolution, we test on Animal-Face Dog and Cat (Si & Zhu, 2011), 100-Shot-Obama, Panda, and Grumpy-cat (Zhao et al., 2020). On $1 0 2 4 \times 1 0 2 4$ resolution, we test on Flickr-FaceHQ (FFHQ) (Karras et al., 2019), Oxford-flowers (Nilsback & Zisserman, 2006), art paintings from WikiArt (wikiart.org), photographs on natural landscape from Unsplash (unsplash.com), Pokemon (pokemon.com), anime face, skull, and shell. These datasets are designed to cover images with different characteristics: photo realistic, graphic-illustration, and art-like images.
+
+Metrics: We use two metrics to measure the models’ synthesis performance: 1) Frechet Inception ´ Distance (FID) (Heusel et al., 2017) measures the overall semantic realism of the synthesized images. For datasets with less than 1000 images (most only have 100 images), we let $G$ generate 5000 images and compute FID between the synthesized images and the whole training set. 2) Learned perceptual similarity (LPIPS) (Zhang et al., 2018) provides a perceptual distance between two images. We use LPIPS to report the reconstruction quality when we perform latent space back-tracking on $G$ given real images, and measure the auto-encoding performance. We find it unnecessary to involve other metrics, as FID is unlikely to be inconsistent with the others, given the notable performance gap between our model and the compared ones. For all the testings, we train the models 5 times with random seeds, and report the highest scores. The relative error is less than five percent on average.
+
+Compared Models: We compare our model with: 1) the state-of-the-art (SOTA) unconditional model, StyleGAN2, 2) a baseline model ablated from our proposed one. Note that we adopt StyleGAN2 with recent studies from (Karras et al., 2020a; Zhao et al., 2020), including the model configuration and differentiable data-augmentation, for the best training on few-sample datasets. Since StyleGAN2 requires much more computing-cost (cc) to train, we derive an extra baseline model. In sum, we compare our model with StyleGAN2 on the absolute image synthesis quality regardless of cc, and use the baseline model for the reference within a comparable cc range.
+
+The baseline model is the strongest performer that we integrated from various GAN techniques based on DCGAN (Radford et al., 2015): 1) spectral-normalization (Miyato et al., 2018), 2) exponentialmoving-average (Yazıcı et al., 2018) optimization on $G$ , 3) differentiable-augmentation, 4) GLU (Dauphin et al., 2017) instead of ReLU in $G$ . We build our model upon the baseline with the two proposed techniques: the skip-layer excitation module and the self-supervised discriminator.
+
+Table 1: Computational cost comparison of the models.
+
+
StyleGAN2@0.25
StyleGAN2@0.5
StyleGAN2
Baseline
Ours
Resolution: 2562 Batch-size: 8
Training time (hour/10k iter) Training vram (GB)
1
1.8
3.8
0.7
1
Model parameters (million)
7 27.557
16 45.029
18 108.843
5
6.5 47.363
Resolution: 10242
Training time (hour/10k iter)
44.359
Training vram (GB)
3.6
5
7
1.3
1.7
Batch-size: 8
Model parameters (million)
12
23
36
9
10
27.591
45.15
109.229
44.377
47.413
+
+Table. 1 presents the normalized cc figures of the models on Nvidia’s RTX 2080-Ti GPU, implemented using PyTorch (Paszke et al., 2017). Importantly, the slimed StyleGAN2 with $\frac { 1 } { 4 }$ parameters cannot converge on the tested datasets at $1 0 2 4 ^ { 2 }$ resolution. We compare to the StyleGAN2 with $\frac { 1 } { 2 }$ parameters (if not specifically mentioned) in the following experiments.
+
+# 4.1 IMAGE SYNTHESIS PERFORMANCE
+
+Few-shot generation: Collecting large-scale image datasets are expensive, or even impossible, for a certain character, a genre, or a topic. On those few-shot datasets, a data-efficient model becomes especially valuable for the image generation task. In Table. 2 and Table. 3, we show that our model not only achieves superior performance on the few-shot datasets, but also much more computationalefficient than the compared methods. We save the checkpoints every 10k iterations during training and report the best FID from the checkpoints (happens at least after 15 hours of training for StyleGAN2 on all datasets). Among the 12 datasets, our model performs the best on 10 of them.
+
+Please note that, due to the VRAM requirement for StyleGAN2 when trained on $1 0 2 4 ^ { 2 }$ resolution, we have to train the models in Table. 3 on a RTX TITAN GPU. In practice, 2080-TI and TITAN share a similar performance, and our model runs the same time on both GPUs.
+
+Table 2: FID comparison at $2 5 6 ^ { 2 }$ resolution on few-sample datasets.
+
+
Animal Face- Dog
Animal Face - Cat
Obama
Panda
Grumpy-cat
Image number
389
160
100
100
100
Training time on one RTX 2080-Ti
20 hour
StyleGAN2
58.85
42.44
46.87
12.06
27.08
StyleGAN2 finetune
61.03
46.07
35.75
14.5
29.34
Baseline 5 hour
108.19
150.3
62.74
15.4
42.13
Baseline+Skip
94.21
72.97
52.50
14.39
38.17
Baseline+decode Ours (B+Skip+decode)
56.25 50.66
36.74 35.11
44.34 41.05
10.12 10.03
29.38 26.65
+
+Training from scratch vs. fine-tuning: Fine-tuning from a pre-trained GAN (Mo et al., 2020; Noguchi & Harada, 2019; Wang et al., 2020) has been the go-to method for the image generation task on datasets with few samples. However, its performance highly depends on the semantic consistency between the new dataset and the available pre-trained model. According to Zhao et al., fine-tuning performs worse than training from scratch in most cases, when the content from the new dataset strays away from the original one. We confirm the limitation of current fine-tuning methods from Table. 2 and Table. 3, where we fine-tune StyleGAN2 trained on FFHQ use the Freeze-D method from Mo et al.. Among all the tested datasets, only Obama and Skull favor the fine-tuning method, making sense since the two sets share the most similar contents to FFHQ.
+
+Module ablation study: We experiment with the two proposed modules in Table. 2, where both SLE (skip) and decoding-on- $. D$ (decode) can separately boost the model performance. It shows that the two modules are orthogonal to each other in improving the model performance, and the self-supervised $D$ makes the biggest contribution. Importantly, the baseline model and StyleGAN2 diverge fast after the listed training time. In contrast, our model is less likely to mode collapse among the tested datasets. Unlike the baseline model which usually model-collapse after trained for 10 hours, our model maintains a good synthesis quality and won’t collapse even after trained for 20 hours. We argue that it is the decoding regularization on $D$ that prevents the model from divergence.
+
+Table 3: FID comparison at $1 0 2 4 ^ { 2 }$ resolution on few-sample datasets.
+
+
Art Paintings
FFHQ
Flower
Pokemon
Anime Face
Skull
Shell
Image number
1000
1000
1000
800
120
100
60
Training time on one RTX TITAN
24 hour
StyleGAN2 StyleGAN2 finetune
74.56 N/A
25.66 N/A
45.23 36.72
190.23 60.12
152.73 61.23
127.98 107.68
241.37
8 hour
Baseline Ours
62.27 45.08
38.35 24.45
42.25
67.86
101.23
186.45
220.45 202.32
+
+Table 4: FID comparison at $1 0 2 4 ^ { 2 }$ resolution on datasets with more images.
+
+
Model
Dataset
Art Paintings
FFHQ
Nature Photograph
Image number
2k 5k
10k
2k
5k
10k
70k
2k
5k
10k
StyleGAN2
70.02
48.36
41.23
18.38
10.45
7.86
4.4
67.12
41.47 39.05
Baseline
60.02
51.23
49.38
36.45
27.86
25.12
17.62 71.47
66.05
62.28
Ours
44.57
43.27
42.53
19.01
17.93
16.45
12.38 52.47
45.07
43.65
+
+Table 5: LPIPS of back-tracking with $G$
+
+
Cat
Dog
FFHQ
Art
Resolution
256
1024
Baseline @ 20k iter
2.113
2.073
2.589
2.916
Baseline @ 40k iter
2.513
2.171
2.583
2.812
Ours @ 40k iter
1.821
1.918
2.425
2.624
Ours @ 80k iter
1.897
1.986
2.342
2.601
+
+
+Figure 6: Latent space back-tracking and interpolation.
+
+Table 6: FID of self-supervisions for $D$
+
+
Art paintings
Nature photos
a. contrastive loss
47.14
57.04
b. predict aspect ratio
49.21
59.22
c.auto-encoding
42.53
43.65
d.a+b
46.02
54.23
e.a+b+c
44.21
47.65
+
+Training with more images: For more thorough evaluation, we also test our model on datasets with more sufficient training samples, as shown in Table. 4. We train the full StyleGAN2 for around five days on the Art and Photograph dataset with a batch-size of 16 on two TITAN RTX GPUs, and use the latest official figures on FFHQ from Zhao et al.. Instead, we train our model for only 24 hours, with a batch-size of 8 on a single 2080-Ti GPU. Specifically, for FFHQ with all 70000 images, we train our model with a larger batch-size of 32, to reflect an optimal performance of our model.
+
+In this test, we follow the common practice of computing FID by generating $5 0 \mathrm { k }$ images and use the whole training set as the reference distribution. Note that StyleGAN2 has more than double the parameters compared to our model, and trained with a much larger batch-size on FFHQ. These factors contribute to its better performances when given enough training samples and computing power. Meanwhile, our model keeps up well with StyleGAN2 across all testings with a considerably lower computing budget, showing a compelling performance even on larger-scale datasets, and a consistent performance boost over the baseline model.
+
+Qualitative results: The advantage of our model becomes more clear from the qualitative comparisons in Fig. 5. Given the same batch-size and training time, StyleGAN2 either converges slower or suffers from mode collapse. In contrast, our model consistently generates satisfactory images. Note that the best results from our model on Flower, Shell, and Pokemon only take three hours’ training, and for the rest three datasets, the best performance is achieved at training for eight hours. For StyleGAN2 on “shell”, “anime face”, and “Pokemon”, the images shown in Fig. 5 are already from the best epoch, which they match the scores in Table. 2 and Table. 3. For the rest of the datasets, the quality increase from StyleGAN2 is also limited given more training time.
+
+# 4.2 MORE ANALYSIS AND APPLICATIONS
+
+Testing mode collapse with back-tracking: From a well trained GAN, one can take a real image and invert it back to a vector in the latent space of $G$ , thus editing the image’s content by altering the back-tracked vector. Despite the various back-tracking methods (Zhu et al., 2016; Lipton & Tripathi, 2017; Zhu et al., 2020; Abdal et al., 2019), a well generalized $G$ is arguably as important for the good inversions. To this end, we show that our model, although trained on limited image samples, still gets a desirable performance on real image back-tracking.
+
+In Table 5, we split the images from each dataset with a training/testing ratio of 9:1, and train $G$ on the training set. We compute a reconstruction error between all the images from the testing set and their inversions from $G$ , after the same update of 1000 iterations on the latent vectors (to prevent the vectors from being far off the normal distribution). The baseline model’s performance is getting worse with more training iterations, which reflects mode-collapse on $G$ . In contrast, our model gives better reconstructions with consistent performance over more training iterations. Fig. 6 presents the back-tracked examples (left-most and right-most samples in the middle panel) given the real images.
+
+
+Figure 5: Qualitative comparison between our model and StyleGAN2 on $1 0 2 4 ^ { 2 }$ resolution datasets. The left-most panel shows the training images, and the right two panels show the uncurated samples from StyleGAN2 and our model. Both models are trained from scratch for 10 hours with a batch-size of 8. The samples are generated from the checkpoint with the lowest FID.
+
+The smooth interpolations from the back-tracked latent vectors also suggest little mode-collapse of our $G$ (Radford et al., 2015; Zhao et al., 2020; Robb et al., 2020).
+
+In addition, we show qualitative comparisons in appendix D, where our model maintains a good generation while StyleGAN2 and baseline are model-collapsed.
+
+The self-supervision methods and generalization ability on $D$ : Apart from the auto-encoding training for $D$ , we show that $D$ with other common self-supervising strategies also boost GAN’s performance in our training settings. We test five self-supervision settings, as shown in Table 6, which all brings a substantial performance boost compared to the baseline model. Specifically, setting-a refers to contrastive learning which we treat each real image as a unique class and let $D$ classify them. For setting- $\mathbf { \sigma } . \mathbf { b }$ , we train $D$ to predict the real image’s original aspect-ratio since they are reshaped to square when fed to $D$ . Setting-c is the method we employ in our model, which trains $D$ as an encoder with a decoder to reconstruct real images. To better validate the benefit of self-supervision on $D$ , all the testings are conducted on full training sets with 10000 images, with a batch-size of 8 to be consistent with Table 4. We also tried training with a larger batch-size of 16, which the results are consistent to the batch-size of 8.
+
+
+Figure 7: Style-mixing results from our model trained for only 5 hours on single GPU.
+
+Interestingly, according to Table 6, while setting-c performs the best, combining it with the rest two settings lead to a clear performance downgrade. The similar behavior can be found on some other self-supervision settings, e.g. when follow Chen et al. (2019) with a ”rotation-predicting” task on art-paintings and FFHQ datasets, we observe a performance downgrade even compared to the baseline model. We hypothesis the reason being that the auto-encoding forces $D$ to pay attention to more areas of the input image, thus extracts a more comprehensive feature-map to describe the input image (for a good reconstruction). In contrast, a classification task does not guarantee $D$ to cover the whole image. Instead, the task drives $D$ to only focus on small regions because the model can find class cues from small regions of the images. Focusing on limited regions (i.e., react to limited image patterns) is a typical overfitting behavior, which is also widely happening for $D$ in vanilla GANs. More discussion can be found in appendix B.
+
+Style mixing like StyleGAN. With the channel-wise excitation module, our model gets the same functionality as StyleGAN: it learns to disentangle the images’ high-level semantic attributes (style and content) in an unsupervised way, from $G$ ’s conv-layers at different scales. The style-mixing results are displayed in Fig. 7, where the top three datasets are $2 5 6 \times 2 5 6$ resolution, and the bottom three are $1 0 2 4 \times 1 0 2 4$ resolution. While StyleGAN2 suffers from converging on the bottom high-resolution datasets, our model successfully learns the style representations along the channel dimension on the “excited” layers (i.e., for feature-maps on $2 5 6 \times 2 5 6$ , $5 1 2 \times 5 1 2$ resolution). Please refer to appendix A and C for more information on SLE and style-mixing.
+
+# 5 CONCLUSION
+
+We introduce two techniques that stabilize the GAN training with an improved synthesis quality, given sub-hundred high-fidelity images and a limited computing resource. On thirteen datasets with a diverse content variation, we show that a skip-layer channel-wise excitation mechanism (SLE) and a self-supervised regularization on the discriminator significantly boost the synthesis performance of GAN. Both proposed techniques require minor changes to a vanilla GAN, enhancing GAN’s practicality with a desirable plug-and-play property. We hope this work can benefit downstream tasks of GAN and provide new study perspectives for future research.
+
+# REFERENCES
+
+Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In Proceedings of the IEEE international conference on computer vision, pp. 4432–4441, 2019.
+
+Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. In International Conference on Learning Representations, 2017.
+
+Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International conference on machine learning, pp. 214–223. PMLR, 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 International Conference on Learning Representations, 2019.
+
+Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised gans via auxiliary rotation loss. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12154–12163, 2019.
+
+Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International conference on machine learning, pp. 933–941, 2017.
+
+Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in neural information processing systems, pp. 1486–1494, 2015.
+
+Ahmed Elgammal, Marian Mazzone, et al. Artists, artificial intelligence and machine-based creativity in playform. Artnodes, (26):1–8, 2020.
+
+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.
+
+Priya Goyal, Dhruv Mahajan, Abhinav Gupta, and Ishan Misra. Scaling and benchmarking selfsupervised visual representation learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6391–6400, 2019.
+
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
+
+Yong Guo, Qi Chen, Jian Chen, Qingyao Wu, Qinfeng Shi, and Mingkui Tan. Auto-embedding generative adversarial networks for high resolution image synthesis. IEEE Transactions on Multimedia, 21(11):2726–2737, 2019.
+
+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.
+
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729–9738, 2020.
+
+Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In Advances in Neural Information Processing Systems, pp. 15663–15674, 2019.
+
+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.
+
+Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018.
+
+Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1501– 1510, 2017.
+
+Xun Huang, Yixuan Li, Omid Poursaeed, John Hopcroft, and Serge Belongie. Stacked generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5077–5086, 2017.
+
+Longlong Jing and Yingli Tian. Self-supervised visual feature learning with deep neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
+
+Animesh Karnewar and Oliver Wang. Msg-gan: Multi-scale gradients for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7799–7808, 2020.
+
+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.
+
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4401–4410, 2019.
+
+Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. arXiv preprint arXiv:2006.06676, 2020a.
+
+Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8110–8119, 2020b.
+
+Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. In International conference on machine learning, pp. 1558–1566. PMLR, 2016.
+
+Jae Hyun Lim and Jong Chul Ye. Geometric gan. arXiv preprint arXiv:1705.02894, 2017.
+
+Zachary C. Lipton and Subarna Tripathi. Precise recovery of latent vectors from generative adversarial networks. ICLR workshop, 2017.
+
+Bingchen Liu, Kunpeng Song, Yizhe Zhu, Gerard de Melo, and Ahmed Elgammal. Time: Text and image mutual-translation adversarial networks. In Thirty-Fifth AAAI Conference on Artificial Intelligence, 2021.
+
+Lars Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for gans do actually converge? In International conference on machine learning, pp. 3481–3490. PMLR, 2018.
+
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018.
+
+Sangwoo Mo, Minsu Cho, and Jinwoo Shin. Freeze discriminator: A simple baseline for fine-tuning gans. arXiv preprint arXiv:2002.10964, 2020.
+
+Mkhuseli Ngxande, Jules-Raymond Tapamo, and Michael Burke. Depthwisegans: Fast training generative adversarial networks for realistic image synthesis. In 2019 Southern African Universities Power Engineering Conference/Robotics and Mechatronics/Pattern Recognition Association of South Africa (SAUPEC/RobMech/PRASA), pp. 111–116. IEEE, 2019.
+
+Maria-Elena Nilsback and Andrew Zisserman. A visual vocabulary for flower classification. In IEEE Conference on Computer Vision and Pattern Recognition, volume 2, pp. 1447–1454, 2006.
+
+Atsuhiro Noguchi and Tatsuya Harada. Image generation from small datasets via batch statistics adaptation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2750– 2758, 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. 2017.
+
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
+
+Esther Robb, Wen-Sheng Chu, Abhishek Kumar, and Jia-Bin Huang. Few-shot adaptation of generative adversarial networks. arXiv preprint arXiv:2010.11943, 2020.
+
+Zhangzhang Si and Song-Chun Zhu. Learning hybrid image templates (hit) by information projection. IEEE Transactions on pattern analysis and machine intelligence, 34(7):1354–1367, 2011.
+
+Samarth Sinha, Han Zhang, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, and Augustus Odena. Small-gan: Speeding up gan training using core-sets. arXiv preprint arXiv:1910.13540, 2019.
+
+Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 7(3):13, 2017.
+
+Ngoc-Trung Tran, Viet-Hung Tran, Bao-Ngoc Nguyen, Linxiao Yang, and Ngai-Man Man Cheung. Self-supervised gan: Analysis and improvement with multi-class minimax game. Advances in Neural Information Processing Systems, 32:13253–13264, 2019.
+
+Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
+
+Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8798–8807, 2018.
+
+Yaxing Wang, Abel Gonzalez-Garcia, David Berga, Luis Herranz, Fahad Shahbaz Khan, and Joost van de Weijer. Minegan: effective knowledge transfer from gans to target domains with few images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9332–9341, 2020.
+
+Yasin Yazıcı, Chuan-Sheng Foo, Stefan Winkler, Kim-Hui Yap, Georgios Piliouras, and Vijay Chandrasekhar. The unusual effectiveness of averaging in gan training. arXiv preprint arXiv:1806.04498, 2018.
+
+Dan Zhang and Anna Khoreva. Pa-gan: Improving gan training by progressive augmentation. 2018.
+
+Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, and Dimitris N Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 5907–5915, 2017.
+
+Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586–595, 2018.
+
+Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
+
+Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient gan training. arXiv preprint arXiv:2006.10738, 2020.
+
+Jiachen Zhong, Xuanqing Liu, and Cho-Jui Hsieh. Improving the speed and quality of gan by adversarial training. arXiv preprint arXiv:2008.03364, 2020.
+
+Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. arXiv preprint arXiv:2004.00049, 2020.
+
+Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A Efros. Generative visual manipu- ¨ lation on the natural image manifold. In European conference on computer vision, pp. 597–613. Springer, 2016.
\ No newline at end of file
diff --git a/md/train/1FvkSpWosOl/1FvkSpWosOl.md b/md/train/1FvkSpWosOl/1FvkSpWosOl.md
new file mode 100644
index 0000000000000000000000000000000000000000..ac03b5051aaca0c5a24341a0a21534af30be8648
--- /dev/null
+++ b/md/train/1FvkSpWosOl/1FvkSpWosOl.md
@@ -0,0 +1,575 @@
+# IS ATTENTION BETTER THAN MATRIX DECOMPOSITION?
+
+Zhengyang $\mathbf { G e n g ^ { 1 , 2 } }$ , Meng-Hao $\mathbf { G u o ^ { 3 } }$ ∗, Hongxu Chen4, Xia $\mathbf { L i } ^ { 2 }$ , Ke Wei4, Zhouchen $\mathbf { L i n ^ { 2 , 5 } }$ † 1Zhejiang Lab; 2Key Lab. of Machine Perception (MoE), School of EECS, Peking University; 3Tsinghua University; 4School of Data Science, Fudan University; 5Pazhou Lab
+
+# ABSTRACT
+
+As an essential ingredient of modern deep learning, attention mechanism, especially self-attention, plays a vital role in the global correlation discovery. However, is hand-crafted attention irreplaceable when modeling the global context? Our intriguing finding is that self-attention is not better than the matrix decomposition (MD) model developed 20 years ago regarding the performance and computational cost for encoding the long-distance dependencies. We model the global context issue as a low-rank completion problem and show that its optimization algorithms can help design global information blocks. This paper then proposes a series of Hamburgers, in which we employ the optimization algorithms for solving MDs to factorize the input representations into sub-matrices and reconstruct a low-rank embedding. Hamburgers with different MDs can perform favorably against the popular global context module self-attention when carefully coping with gradients back-propagated through MDs. Comprehensive experiments are conducted in the vision tasks where it is crucial to learn the global context, including semantic segmentation and image generation, demonstrating significant improvements over self-attention and its variants. Code is available.
+
+# 1 INTRODUCTION
+
+Since self-attention and transformer (Vaswani et al., 2017) showed significant advantages over recurrent neural networks and convolutional neural networks in capturing long-distance dependencies, attention has been widely adopted by computer vision (Wang et al., 2018; Zhang et al., 2019a) and natural language processing (Devlin et al., 2019) for global information mining. However, is hand-crafted attention irreplaceable when modeling the global context?
+
+This paper focuses on a new approach to design global context modules. The key idea is, if we formulate the inductive bias like the global context into an objective function, the optimization algorithm to minimize the objective function can construct a computational graph, i.e., the architecture we need in the networks. We particularize this idea by developing a counterpart for the most representative global context module, self-attention. Considering extracting global information in the networks as finding a dictionary and the corresponding codes to capture the inherent correlation, we model the context discovery as low-rank completion of the input tensor and solve it via matrix decomposition. This paper then proposes a global correlation block, Hamburger, by employing matrix decomposition to factorize the learned representation into sub-matrices so as to recover the clean low-rank signal subspace. The iterative optimization algorithm to solve matrix decomposition defines the central computational graph, i.e., Hamburger’s architecture.
+
+Our work takes advantage of the matrix decomposition models as the foundation of Hamburger, including Vector Quantization (VQ) (Gray & Neuhoff, 1998), Concept Decomposition (CD) (Dhillon & Modha, 2001), and Non-negative Matrix Factorization (NMF) (Lee & Seung, 1999). Additionally, instead of directly applying Back-Propagation Through Time (BPTT) algorithm (Werbos et al., 1990) to differentiate the iterative optimization, we adopt a truncated BPTT algorithm, i.e., one-step gradient, to back-propagate the gradient effectively. We illustrate the advantages of Hamburger in the fundamental vision tasks where global information has been proven crucial, including semantic segmentation and image generation. The experiments prove that optimization-designed Hamburger can perform competitively with state-of-the-art attention models when avoiding the unstable gradient back-propagated through the iterative computational graph of MD. Hamburger sets new state-ofthe-art records on the PASCAL VOC dataset (Everingham et al., 2010) and PASCAL Context dataset (Mottaghi et al., 2014) for semantic segmentation and surpasses existing attention modules for GANs in the large scale image generation on ImageNet (Deng et al., 2009).
+
+The contributions of this paper are listed as follows:
+
+• We show a white-box approach to design global information blocks, i.e., by turning the optimization algorithm that minimizes an objective function, in which modeling the global correlation is formulated as a low-rank completion problem, into the architecture. We propose Hamburger, a light yet powerful global context module with ${ \mathcal { O } } ( n )$ complexity, surpassing various attention modules on semantic segmentation and image generation. We figure out that the main obstacle of applying MD in the networks is the unstable backward gradient through its iterative optimization algorithm. As a pragmatic solution, the proposed one-step gradient facilitates the training of Hamburger with MDs.
+
+# 2 METHODOLOGY
+
+# 2.1 WARM UP
+
+Since matrix decomposition is pivotal to the proposed Hamburger, we first review the idea of matrix decomposition. A common view is that matrix decomposition factorizes the observed matrix into a product of several sub-matrices, e.g., Singular Value Decomposition. However, a more illuminating perspective is that, by assuming the generation process, matrix decomposition acts as the inverse of the generation, disassembling the atoms that make up the complex data. From the reconstruction of the original matrices, matrix decomposition recovers the latent structure of observed data.
+
+Suppose that the given data are arranged as the columns of a large matrix $\pmb { X } = [ \pmb { x } _ { 1 } , \dots , \pmb { x } _ { n } ] \in \mathbb { R } ^ { d \times n }$ . A general assumption is that there is a low-dimensional subspace, or a union of multiple subspaces hidden in $\boldsymbol { X }$ . That is, there exists a dictionary matrix $D = [ \bar { \bf d } _ { 1 } , \boldsymbol { \cdot } \cdot \cdot , { \bf d } _ { r } ] \in \mathbb { R } ^ { d \times r }$ and corresponding codes $C = [ \mathbf { c } _ { 1 } , \cdot \cdot \cdot , \mathbf { c } _ { n } ] \in \mathbb { R } ^ { r \times n }$ that $\boldsymbol { X }$ can be expressed as
+
+$$
+X = \overbrace { \bar { X } + E = D C } ^ { g e n e r a t i o n } + E ,
+$$
+
+where $\bar { \boldsymbol { X } } \in \mathbb { R } ^ { d \times n }$ is the output low-rank reconstruction, and $\pmb { { \cal E } } \in \mathbb { R } ^ { d \times n }$ is the noise matrix to be discarded. Here we assume that the recovered matrix $\bar { X }$ has the low-rank property, such that
+
+$$
+\operatorname { r a n k } ( { \bar { X } } ) \leq \operatorname* { m i n } ( \operatorname { r a n k } ( D ) , \operatorname { r a n k } ( C ) ) \leq r \ll \operatorname* { m i n } ( d , n ) .
+$$
+
+Different MDs can be derived by assuming structures to matrices $\mathbf { \delta } _ { D , C }$ , and $\pmb { { \cal E } }$ (Kolda & Bader, 2009; Udell et al., 2016). MD is usually formulated as an objective with various constraints and then solved by optimization algorithms, with classic applications to image denoising (Wright et al., 2009; Lu et al., 2014), inpainting (Mairal et al., 2010), and feature extraction (Zhang et al., 2012).
+
+# 2.2 PROPOSED METHOD
+
+We focus on building global context modules for the networks without painstaking hand-crafted design. Before starting our discussion, we review the representative hand-designed context block self-attention pithily.
+
+The attention mechanism aims at finding a group of concepts for further conscious reasoning from massive unconscious context (Xu et al., 2015; Bengio, 2017; Goyal et al., 2019). As a representative, self-attention (Vaswani et al., 2017) is proposed for learning long-range dependencies in machine translation,
+
+$$
+{ \mathrm { A t t e n t i o n } } \left( Q , K , V \right) = { \mathrm { s o f t m a x } } \left( { \frac { Q K ^ { \top } } { \sqrt { d } } } \right) V ,
+$$
+
+where $Q , K , V \in \mathbb { R } ^ { n \times d }$ are features projected by linear transformations from the input. Selfattention extracts global information via attending all tokens at a time rather than the typical one-byone processing of recurrent neural networks.
+
+
+Figure 1: Overview of Hamburger
+
+Though self-attention and its variants achieved great success, researchers are confronted with (1) developing new global context modules based on self-attention, typically via hand-crafted engineering, and (2) explaining why current attention models work. This paper bypasses both issues and finds a method to easily design global context modules via a well-defined white-box toolkit. We try to formulate the human inductive bias, like the global context, as an objective function and use the optimization algorithm to solve such a problem to design the module’s architecture. The optimization algorithm creates a computational graph, takes some input, and finally outputs the solution. We apply the computational graph of optimization algorithms for the central part of our context module.
+
+Based on this approach, we need to model the networks’ global information issue as an optimization problem. Take the convolutional neural networks (CNN) as an example for further discussion. The networks output a tensor $\mathcal { X } \in \mathbb { R } ^ { C \times H \times W }$ after we feed into an image. Since the tensor can be seen as a set of $H W C$ -dimensional hyper-pixels, we unfold the tensor into a matrix $\pmb { X } \in \mathbb { R } ^ { C \times H W }$ . When the module learns the long-range dependencies or the global context, the hidden assumption is that the hyper-pixels are inherently correlated. For the sake of simplicity, we assume that hyper-pixels are linearly dependent, which means that each hyper-pixel in $\boldsymbol { X }$ can be expressed as the linear combination of bases whose elements are typically much less than $H W$ . In the ideal situation, the global information hidden in $\boldsymbol { X }$ can be low-rank. However, due to vanilla CNN’s poor ability to model the global context (Wang et al., 2018; Zhang et al., 2019a), the learned $\boldsymbol { X }$ is usually corrupted with redundant information or incompleteness. The above analysis suggests a potential method to model the global context, i.e., by completing the low-rank part $\bar { X }$ in the unfolded matrix $\boldsymbol { X }$ and discarding the noise part $\pmb { \cal E }$ , using the classic matrix decomposition models described in Eq. (1), which filters out the redundancy and incompleteness at the same time. We thus model learning the global context as a low-rank completion problem with matrix decomposition as its solution. Using the notion of Sec. 2.1, the general objective function of matrix decomposition is
+
+$$
+\operatorname* { m i n } _ { D , C } \mathcal { L } ( X , D C ) + \mathcal { R } _ { 1 } ( D ) + \mathcal { R } _ { 2 } ( C )
+$$
+
+where $\mathcal { L }$ is the reconstruction loss, $\mathcal { R } _ { 1 }$ and $\mathcal { R } _ { 2 }$ are regularization terms for the dictionary $_ D$ and the codes $C$ . Denote the optimization algorithm to minimize Eq. (4) as $\mathcal { M } . \mathcal { M }$ is the core architecture we deploy in our global context module. To help readers further understand this modeling, We also provide a more intuitive illustration in Appendix G.
+
+In the later sections, we introduce our global context block, Hamburger, and then discuss detailed MD models and optimization algorithms for $\mathcal { M }$ . Finally, we handle the gradient issue for back-propagation through matrix decomposition.
+
+# 2.2.1 HAMBURGER
+
+Hamburger consists of one slice of “ham” (matrix decomposition) and two slices of “bread” (linear transformation). As the name implies, Hamburger first maps the input $\boldsymbol { Z } \in \mathbb { R } ^ { d _ { z } \times n }$ into feature space with a linear transformation $W _ { l } ^ { ' } \in \mathbb { R } ^ { d \times d _ { z } }$ , namely “lower bread”, then uses matrix decomposition $\mathcal { M }$ to solve a low-rank signal subspace, corresponding to the “ham”, and finally transforms extracted signals into the output with another linear transformation $W _ { u } \in \mathbb { R } ^ { d _ { z } \times d }$ , called “upper bread”,
+
+$$
+\begin{array} { r } { \mathcal { H } ( Z ) = W _ { u } \mathcal { M } ( W _ { l } Z ) , } \end{array}
+$$
+
+where $\mathcal { M }$ is matrix decomposition to recover the clear latent structure, functioning as a global nonlinearity. Detailed architectures of $\mathcal { M }$ , i.e., optimization algorithms to factorize $\boldsymbol { X }$ , are discussed in Sec. 2.2.2. Fig. 1 describes the architecture of Hamburger, where it collaborates with the networks via Batch Normalization (BN) (Ioffe & Szegedy, 2015), a skip connection, and finally outputs $\mathbf { Y }$ ,
+
+$$
+\begin{array} { r } { Y = Z + \mathrm { B N } ( \mathcal { H } ( Z ) ) . } \end{array}
+$$
+
+# 2.2.2 HAMS
+
+This section describes the structure of “ham”, i.e., $\mathcal { M }$ in Eq. (5). As discussed in the previous section, by formulating the global information discovery as an optimization problem of MD, algorithms to solve MD naturally compose $\mathcal { M } , \mathcal { M }$ takes the output of “lower bread” as its input and computes a low-rank reconstruction as its output, denoted as $\boldsymbol { X }$ and $\bar { X }$ , respectively.
+
+$$
+\mathcal { M } ( X ) = \bar { X } = D C .
+$$
+
+We investigate two MD models for $\mathcal { M }$ , Vector Quantization (VQ), and Non-negative Matrix Factorization (NMF) to solve $_ D$ and $C$ and reconstruct $\bar { X }$ , while leaving Concept Decomposition (CD) to Appendix B. The selected MD models are introduced briefly because we endeavor to illustrate the importance of the low-rank inductive bias and the optimization-driven designing method for global context modules rather than any specific MD models. It is preferred to abstract the MD part as a whole, i.e., $\mathcal { M }$ in the context of this paper, and focus on how Hamburger can show the superiority in its entirety.
+
+Vector Quantization Vector Quantization (VQ) (Gray & Neuhoff, 1998), a classic data compression algorithm, can be formulated as an optimization problem in term of matrix decomposition:
+
+$$
+\operatorname* { m i n } _ { D , C } \| X - D C \| _ { F } \quad { \mathrm { s . t . ~ } } \mathbf { c } _ { i } \in \{ \mathbf { e } _ { 1 } , \mathbf { e } _ { 2 } , \cdot \cdot \cdot , \mathbf { e } _ { r } \} ,
+$$
+
+where $e _ { i }$ is the canonical basis vector, $\mathbf { e } _ { i } = [ 0 , \cdots , 1 , \cdots , 0 ] ^ { \top }$ . The solution to minimize the ith
+objective in Eq. (8) is K-means (Gray & Neuhoff, 1998). However, to ensure that VQ is differentiable, we replace the hard arg min and Euclidean distance with sof tmax and cosine similarity, leading to Alg. 1, where cosine(D, X) is a similarity matrix whose entries satisfy cosine(D, X)ij = d>i xjkdkkxk , and sof tmax is applied column-wise and $T$ is the temperature. Further we can obtain a hard assignment by a one-hot vector when $T 0$ .
+
+
Algorithm 1 Ham: Soft VQ
Input X. Initialize D, C.
for k from 1 to K do
C ← softmax(⊥cosine(D,X))
D ← XCTdiag(C1n)-1
end for
Output X = DC.
+
+
Algorithm2Ham:NMF with MU
Input X. Initialize non-negative D, C
for k from 1 to K do (DTX)ij
Cij←Cij (DT DC)ij
(xCT)ij Dij←Dij
(DCCT)ij end for
Output X = DC.
+
+Non-negative Matrix Factorization If we impose non-negative constraints on the dictionary $_ { D }$ and the codes $C$ , it leads to Non-negative Matrix Factorization (NMF) (Lee & Seung, 1999):
+
+$$
+\operatorname* { m i n } _ { D , C } \| X - D C \| _ { F } \quad \mathrm { s . t . } D _ { i j } \geq 0 , C _ { j k } \geq 0 .
+$$
+
+To satisfy the non-negative constraints, we add a ReLU non-linearity before putting $\boldsymbol { X }$ into NMF. We apply the Multiplicative Update (MU) rules (Lee & Seung, 2001) in Alg. 2 to solve NMF, which guarantees the convergence.
+
+As white-box global context modules, VQ, CD, and NMF are straightforward and light, showing remarkable efficiency. They are formulated into optimization algorithms that mainly consist of matrix multiplications with the complexity $\mathcal { O } ( n d r )$ , much cheaper than complexity $\mathcal { O } ( n ^ { 2 } \bar { d } )$ in self-attention as $r \ll n$ . All three MDs are memory-friendly since they avoid generating a large $n \times n$ matrix as an intermediate variable, like the product of $Q$ and $\kappa$ of self-attention in Eq. (3). In the later section, our experiments prove MDs are at least on par with self-attention, though the architectures of $\mathcal { M }$ are created by optimization and look different from classic dot product self-attention.
+
+# 2.3 ONE-STEP GRADIENT
+
+Since $\mathcal { M }$ involves an optimization algorithm as its computational graph, a crux to fuse it into the networks is how the iterative algorithm back-propagates gradient. The RNN-like behavior of optimization suggests Back-Propagation Through Time (BPTT) algorithm (Werbos et al., 1990) as the standard choice to differentiate the iterative process. We first review the BPTT algorithm below. However, in practice, the unstable gradient from BPTT does harm Hamburger’s performances. Hence we build an abstract model to analyze the drawbacks of BPTT and try to find a pragmatic solution while considering MD’s nature as an optimization algorithm.
+
+As shown in Fig. 2, x, y and $\mathbf { h } ^ { t }$ denote input, output and intermediate result at time step $t$ , respectively, while $\mathcal { F }$ and $\mathcal { G }$ are operators. At each time step, the model receives the same input $\mathbf { x }$ processed by the underlying networks.
+
+$$
+\begin{array} { r } { \mathbf { h } ^ { t + 1 } = \mathcal { F } ( \mathbf { h } ^ { t } , \mathbf { x } ) . } \end{array}
+$$
+
+The intermediate results $\mathbf { h } ^ { i }$ are all discarded. Only the output of the last step $\mathbf { h } ^ { t }$ is passed through $\mathcal { G }$ for output $\mathbf { y }$ ,
+
+$$
+\mathbf { y } = \mathcal { G } ( \mathbf { h } ^ { t } ) .
+$$
+
+In the BPPT algorithm, the gradient from output $\mathbf { y }$ to input $\mathbf { x }$ is given, according to the Chain rule:
+
+$$
+\frac { \partial \mathbf { y } } { \partial \mathbf { x } } = \sum _ { i = 0 } ^ { t - 1 } \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \left( \prod _ { j = t - i } ^ { t - 1 } \frac { \partial \mathbf { h } ^ { j + 1 } } { \partial \mathbf { h } ^ { j } } \right) \frac { \partial \mathbf { h } ^ { t - i } } { \partial \mathbf { x } } .
+$$
+
+
+Figure 2: One-step Gradient
+
+A thought experiment is to consider $t \to \infty$ , leading to a fully converged result $\mathbf { h } ^ { * }$ and infinite terms in Eq. (12). We suppose
+
+that both $\mathcal { F }$ and $\mathcal { G }$ are Lipschitz with constants $L _ { h }$ w.r.t. h, $L _ { x } w . r . t . \textbf { x }$ , and $L _ { \mathcal { G } }$ , and $L _ { h } < 1$ . Note that these assumptions apply to a large number of optimization or numerical methods. Then we have:
+
+Proposition 1 $\{ \mathbf { h } ^ { i } \} _ { t }$ has linear convergence.
+
+Proposition 2
+
+Table 1: One-step Gradient & BPTT
+
+
Method
One-step
BPTT
VQ
77.7(77.4)
76.6(76.3)
CD
78.1(77.5)
75.0(74.6)
NMF
78.3(77.8)
77.4(77.0)
+
+$$
+\begin{array} { r l } & { \underset { t \infty } { \operatorname* { l i m } } \frac { \partial \mathbf { y } } { \partial \mathbf { x } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { * } } ( I - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { * } } ) ^ { - 1 } \frac { \partial \mathcal { F } } { \partial \mathbf { x } } . } \\ & { \underset { t \infty } { \operatorname* { l i m } } \Vert \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { 0 } } \Vert = 0 , \underset { t \infty } { \operatorname* { l i m } } \Vert \frac { \partial \mathbf { y } } { \partial \mathbf { x } } \Vert \leq \frac { L _ { \mathcal { G } } L _ { x } } { 1 - L _ { h } } . } \end{array}
+$$
+
+Proposition 3
+
+It is easy to incur gradient vanishing w.r.t. $\mathbf { h } ^ { 0 }$ when $L _ { h }$ is close to 0 and gradient explosion w.r.t. $\mathbf { x }$ $\begin{array} { r } { ( { I - \frac { \partial \mathcal { F } } { \partial { \bf h ^ { * } } } } ) ^ { - 1 } } \end{array}$ when $L _ { h }$ is close to 1. The Jacobian matrix when the largest eigenvalue of $\textstyle { \frac { \partial { \mathcal { F } } } { \partial \mathbf { h } } }$ , i.e., the Lipschitz constant of ∂x , moreover, suffers from an ill-conditioned term $\mathcal { F }$ w.r.t. h, approaches 1 and its minimal eigenvalue typically stays near 0, thus restricts the capability of the gradient to search the well-generalized solution in the parameter space. The erratic scale and spectrum of the gradient back through the optimization algorithm indicate the infeasibility to apply BPTT to Hamburger directly, corroborated by the experiments in Tab. 1, using the same ablation settings as Sec. 3.1.
+
+The analysis inspires us a possible solution. Note that there are a multiplication of multiple Jacobian matrices ∂hj∂hj−1 and a summation of an infinite series in BPTT algorithm, leading to uncontrollable scales of gradients. It enlightens us to drop some minor terms in the gradient while preserving its dominant terms to ensure the direction is approximately right. Considering terms of Eq. (12) as a series, i.e., $\begin{array} { r } { \{ \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \left( \prod _ { j = t - i } ^ { t - 1 } \frac { \partial \mathbf { h } ^ { j + 1 } } { \partial \mathbf { h } ^ { j } } \right) \frac { \partial \mathbf { h } ^ { t - i } } { \partial \mathbf { x } } \} _ { i } } \end{array}$ , it makes sense to use the first term of this series to approximate the gradient if the scale of its terms decays exponentially measured by the operator norm. The first term of the gradient is from the last step of optimization, leading to the one-step gradient,
+
+$$
+\widehat { \frac { \partial \mathbf { y } } { \partial \mathbf { x } } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \frac { \partial \mathbf { h } ^ { t } } { \partial \mathbf { x } } .
+$$
+
+The one-step gradient is a linear approximation of the BPTT algorithm when $t \to \infty$ according to the Proposition 2. It is easy to implement, requiring a no_grad operation in PyTorch (Paszke et al., 2019) or stop_gradient operation in TensorFlow (Abadi et al., 2016) and reducing the time and space complexity from $\mathcal { O } ( t )$ in BPTT to $\mathcal { O } ( 1 )$ . We test adding more terms to the gradient but its performance is worse than using one step. According to experimental results, one-step gradient is acceptable to back-propagate gradient through MDs.
+
+Table 2: Ablation on components of Hamburger with NMF Ham.
+
+
Method
mIoU(%)
Params
baseline
75.9(75.7)
32.67M
basic
78.3(77.8)
+0.50M
- ham
75.8(75.6)
+0.50M
- upper bread
77.0(76.8)
+0.25M
- lower bread
77.3(77.2)
+0.25M
only ham
77.0(76.8)
+0M
+
+# 3 EXPERIMENTS
+
+In this section we present experimental results demonstrating the techniques described above. Two vision tasks that benefit a lot from global information and attention mechanism attract us, including semantic segmentation (over 50 papers using attention) and deep generative models like GANs (most state-of-the-art GANs adopt self-attention since SAGAN (Zhang et al., 2019a)). Both tasks are highly competitive and thus enough for comparing Hamburger with self-attention. Ablation studies show the importance of MD in Hamburger as well as the necessity of the one-step gradient. We emphasize the superiority of Hamburger on modeling global context over self-attention regarding both performance and computational cost.
+
+# 3.1 ABLATION EXPERIMENTS
+
+We choose to conduct all ablation experiments on the PASCAL VOC dataset (Everingham et al., 2010) for semantic segmentation, and report mIoU of 5 runs on the validation set in the form of best(mean). ResNet-50 (He et al., 2016) with output stride 16 is the backbone for all ablation experiments. We employ a $3 \times 3$ conv with BN (Ioffe & Szegedy, 2015) and ReLU to reduce channels from 2048 to 512 and then add Hamburger, the same location as popular attentions in semantic segmentation. For detailed training settings, please see Appendix E.1.
+
+
+Figure 3: Ablation on $d$ and $r$
+
+Breads and Hams We ablate each part of the Hamburger. Removing MD (ham) causes the most severe decay in performance, attesting to the importance of MD. Even if only the parameter-free MD is added (only ham), the performance can visibly improve. Parameterization also helps the Hamburger process the extracted features. Bread, especially upper bread, contributes considerable performance.
+
+Latent Dimension $d$ and $r$ It is worth noting that there is no simple linear relation between $d$ and $r$ with performances measured by mIoU, though $d = 8 r$ is a satisfactory choice. Experiments show that even $r = 8$ performs well, revealing that it can be very cheap for modeling the global context.
+
+
+Figure 4: Ablation on $K$
+
+Iterations $K$ We test more optimization steps in the evaluation stage. In general, the same $K$ for training and test is recommended. $K = 6$ is enough for CD and NMF, while even $K = 1$ is acceptable for VQ. Typically $3 { \sim } 6$ steps are enough since simple MD’s prior is still biased, and full convergence can overfit it. The few iterations are cheap and act as early stopping.
+
+# 3.2 A CLOSE LOOK AT HAMBURGER
+
+To understand the behavior of Hamburger in the networks, we visualize the spectrums of representations before and after Hamburger on the PASCAL VOC validation set. The input and output tensors are unfolded to $\mathbb { R } ^ { C \times H W }$ . The accumulative ratio of squared largest $r$ singular values over total squared singular values of the unfolded matrix has been shown in Fig. 5. A truncated spectrum is usually observed in classic matrix decomposition models’ results due to the low-rank reconstruction. In the networks, Hamburger also promotes energy concentration while preserving informative details via the skip connection. Additionally, we visualize the feature maps before and after Hamburger in Fig. 6. MD helps Hamburger learn interpretable global information by zeroing out uninformative channels, removing irregular noises, and completing details according to the context.
+
+
+Figure 5: Accumulative Ratio
+
+
+Figure 6: Visualization of feature maps
+
+# 3.3 A COMPARISON WITH ATTENTION
+
+This section shows the advantages of MD-based Hamburger over attention-related context modules in computational cost, memory consumption, and inference time. We compare Hamburger (Ham) with self-attention (SA) (Vaswani et al., 2017), Dual Attention (DA) module from DANet (Fu et al., 2019), Double Attention module from $A ^ { 2 }$ Net (Chen et al., 2018b), APC module from APCNet (He et al., 2019b), DM module from DMNet (He et al., 2019a), ACF module from CFNet (Zhang et al., 2019b), reporting parameters and costs of processing a tensor $\mathcal { Z } \in \mathbb { R } ^ { 1 \times 5 1 2 \times 1 2 8 \times 1 2 8 }$ in Tab. 3. Excessive memory usage is the key bottleneck of cooperating with attention in real applications. Hence we also provide the GPU load and inference time on NVIDIA TITAN Xp. In general, Hamburger is light in computation and memory compared with attention-related global context modules.
+
+Table 3: Comparisons between Hamburger and context modules.
+
+
Method
Params
MACs
GPU Load
GPU Time
Train
Infer
Train
Infer
SA
1.00M
292G
5253MB
2148MB
242.0ms
82.2ms
DA
4.82M
79.5G
2395MB
2203MB
72.6ms
64.4ms
A2
1.01M
25.7G
326MB
165MB
22.9ms
8.0ms
APC
2.03M
17.6G
458MB
264MB
26.5ms
11.6ms
DM
3.00M
35.1G
557MB
268MB
65.7ms
23.3ms
ACF
0.75M
79.5G
1380MB
627MB
71.0ms
22.6ms
Ham (CD)
0.50M
16.2G
162MB
102MB
20.0ms
13.0ms
Ham (NMF)
0.50M
17.6G
202MB
98MB
15.6ms
7.7ms
+
+# 3.4 SEMANTIC SEGMENTATION
+
+We benchmark Hamburger on the PASCAL VOC dataset (Everingham et al., 2010), and the PASCAL Context dataset (Mottaghi et al., 2014), against state-of-the-art attentions. We use ResNet-101 (He et al., 2016) as our backbone. The output stride of the backbone is 8. The segmentation head is the same as ablation experiments. NMF is usually better than CD and VQ in ablation studies (see Tab. 1). Therefore, we mainly test NMF in further experiments. We use HamNet to represent ResNet with Hamburger in the following section.
+
+Results on the PASCAL VOC test set, and the PASCAL Context validation set, are illustrated in Tab. 4, and Tab. 5, respectively. We mark all attention-based models with ∗ in which diverse attentions compose the segmentation heads. Though semantic segmentation is a saturated task, and most contemporary published works have approximate performances, Hamburger shows considerable improvements over previous state-of-the-art attention modules.
+
+Table 4: Comparisons with state-of-the-art on the PASCAL VOC test set w/o COCO pretraining.
+
+
Method
mIoU(%)
PSPNet (Zhao et al., 2017)
82.6
DFN* (Yu et al., 2018)
82.7
EncNet (Zhang et al., 2018)
82.9
DANet* (Fu et al., 2019)
82.6
DMNet* (He et al., 2019a)
84.4
APCNet* (He et al., 2019b)
84.2
CFNet* (Zhang et al., 2019b)
84.2
SpyGR* (Li et al., 2020)
84.2
SANet* (Zhong et al., 2020)
83.2
OCR* (Yuan et al., 2020)
84.3
HamNet
85.9
+
+Table 5: Results on the PASCAL-Context Val set.
+
+
Method
mIoU(%)
PSPNet (Zhao et al., 2017)
47.8
SGR* (Liang et al., 2018)
50.8
EncNet (Zhang et al., 2018)
51.7
DANet* (Fu et al., 2019)
52.6
EMANet* (Li et al., 2019)
53.1
DMNet* (He et al., 2019a)
54.4
APCNet* (He et al., 2019b)
54.7
CFNet* (Zhang et al., 2019b)
54.0
SpyGR* (Li et al., 2020)
52.8
SANet* (Zhong et al., 2020)
53.0
OCR*(Yuan et al., 2020)
54.8
HamNet
55.2
+
+# 3.5 IMAGE GENERATION
+
+Attention presents as the global context description block in deep generative models like GANs. Most state-of-the-art GANs for conditional image generation integrate self-attention into their architectures since SAGAN (Zhang et al., 2019a), e.g., BigGAN (Brock et al., 2018), $\mathrm { S ^ { 3 } G A N }$ (Luciˇ c et al.´ , 2019), and LOGAN (Wu et al., 2019). It is convincing to benchmark MDbased Hamburger in the challenging conditional image generation task on ImageNet (Deng et al., 2009).
+
+Table 6: Results on ImageNet $1 2 8 \times 1 2 8$ . ∗ are from Tab. 1 and Tab. 2 of Zhang et al. (2019a).
+
+
Method
FID↓
SNGAN-projection*
27.62
SAGAN*
18.28
HamGAN-baby
16.05
YLG
15.94
HamGAN-strong
14.77
+
+Experiments are conducted to compare Hamburger with self-attention on ImageNet $1 2 8 \times 1 2 8$ . Selfattention is replaced by Hamburger with NMF ham in both generator and discriminator at feature resolution $3 2 \times 3 2$ , named as HamGAN-baby. HamGAN achieves an appreciable improvement in Fr´echet Inception Distance (FID) (Heusel et al., 2017) over SAGAN. Additionally, we compare Hamburger with a recently developed attention variant Your Local GAN (YLG) (Daras et al., 2020) using their codebase and the same training settings, named HamGAN-strong. HamGAN-strong offers over $5 \%$ improvement in FID while being $15 \%$ faster for the total training time and $3 . 6 \mathbf { x }$ faster for the module time (1.54 iters/sec of HamGAN, 1.31 iters/sec of YLG, and 1.65 iters/sec without both context modules, averaged from 1000 iterations) on the same TPUv3 training platform.
+
+# 4 RELATED WORK
+
+General Survey for Attention The last five years have witnessed a roaring success of attention mechanisms (Bahdanau et al., 2015; Mnih et al., 2014; Xu et al., 2015; Luong et al., 2015) in deep learning. Roughly speaking, the attention mechanism is a term of adaptively generating the targets’ weights to be attended according to the requests. Its architectures are diverse, and the most well-known one is dot product self-attention (Vaswani et al., 2017). The attention mechanism has a wide range of applications, from a single source (Lin et al., 2017) to multi-source inputs (Luong et al., 2015; Parikh et al., 2016), from global information discovery (Wang et al., 2018; Zhang et al., 2019a) to local feature extraction (Dai et al., 2017; Parmar et al., 2019).
+
+Previous researchers attempt to explain the effectiveness of attention mechanisms from numerous aspects. Capturing long-range dependencies (Wang et al., 2018), sequentially decomposing visual scenes (Eslami et al., 2016; Kosiorek et al., 2018), inferring relationships between the part and the whole (Sabour et al., 2017; Hinton et al., 2018), simulating interactions between objects (Greff et al., 2017; van Steenkiste et al., 2018), and learning the dynamics of environments (Goyal et al., 2019) are often considered as the underlying mechanisms of attention.
+
+One common idea from biology is that attention simulates the emergence of concerns in many unconscious contexts (Xu et al., 2015). Some work tries to interpret the attention mechanism by visualizing or attacking attention weights (Serrano & Smith, 2019; Jain & Wallace, 2019; Wiegreffe & Pinter, 2019), while others formulate attention into non-local operation (Wang et al., 2018) or diffusion models (Tao et al., 2018; Lu et al., 2019) or build attention-like models via Expectation Maximization (Greff et al., 2017; Hinton et al., 2018; Li et al., 2019) or Variational Inference (Eslami et al., 2016) on a mixture model. A connection between transformer and graph neural network is discussed as well (Liang et al., 2018; Zhang et al., 2019c). Overall, discussions towards attention are still far from reaching agreements or consistent conclusions.
+
+Efficient Attention Recent works develop efficient attention modules via low-rank approximation in both computer vision (Chen et al., 2018b; Zhu et al., 2019; Chen et al., 2019; Li et al., 2019) and natural language processing (Mehta et al., 2019; Katharopoulos et al., 2020; Wang et al., 2020; Song et al., 2020). Technically, the low-rank approximation usually targets at the correlation matrix, i.e., the product of $Q$ and $\kappa$ after the sof tmax operation, using a product of two smaller matrices to approximate the correlation matrix and applying the associative law to save the memory cost and computation, where the approximation involves kernel functions or other similarity functions. Other works (Babiloni et al., 2020; Ma et al., 2019) make efforts to formulate attention into tensor form but may generate large intermediate variables. In this paper, we do not approximate attention or make it efficient. This paper formulates modeling the global context as a low-rank completion problem. The computation and memory efficiency is a by-product of the low-rank assumption on the clean signal subspace and optimization algorithms as architectures.
+
+Matrix Decomposition in Deep Learning There is a long history of combining MD with deep learning. Researchers focus on reducing the parameters in the networks via factorization on the weights, including the softmax layer (Sainath et al., 2013), the convolutional layer (Zhong et al., 2019), and the embedding layer (Lan et al., 2019). Tariyal et al. (2016) attempts to construct deep dictionary learning for feature extraction and trains the model greedily. This paper tries to factorize the representations to recover a clean signal subspace as the global context and provide a new formulation for modeling the long-range dependencies via matrix decomposition.
+
+# 5 CONCLUSION
+
+This paper studies modeling long-range dependencies in the networks. We formulate learning the global context as a low-rank completion problem. Inspired by such a low-rank formulation, we develop the Hamburger module based on well-studied matrix decomposition models. By specializing matrix decomposition’s objective function, the computational graph created by its optimization algorithm naturally defines ham, Hamburger’s core architecture. Hamburger learns interpretable global context via denoising and completing its input and improves the spectrum’s concentration. It is startling that, when prudently coped with the backward gradient, even simple matrix decomposition proposed 20 years ago is as powerful as self-attention in challenging vision tasks semantic segmentation and image generation, as well as light, fast, and memory-efficient. We plan to extend Hamburger to natural language processing by integrating positional information and designing a decoder like Transformer, build a theoretical foundation for the one-step gradient trick or find a better method to differentiate MDs, and integrate advanced MDs in the future.
+
+# ACKNOWLEDGMENTS
+
+Zhouchen Lin is supported by NSF China (grant no.s 61625301 and 61731018), Major Scientific Research Project of Zhejiang Lab (grant no.s 2019KB0AC01 and 2019KB0AB02), Beijing Academy of Artificial Intelligence, and Qualcomm. We thank Google’s Tensorflow Research Cloud (TFRC) for providing us Cloud TPUs.
+
+# REFERENCES
+
+Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. In Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, OSDI’16, pp. 265–283. USENIX Association, 2016. 5, 18
+
+Francesca Babiloni, Ioannis Marras, Gregory Slabaugh, and Stefanos Zafeiriou. Tesa: Tensor element self-attention via matricization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 9
+
+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, 2015. 8
+
+Yoshua Bengio. The consciousness prior. arXiv preprint arXiv:1709.08568, 2017. 2
+
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2018. 8
+
+Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoderdecoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pp. 801–818, 2018a. 17, 18
+
+Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. $\mathbf { A } \hat { \mathbf { \xi } } ^ { 2 }$ -nets: Double attention networks. In Advances in Neural Information Processing Systems 31, pp. 352–361. Curran Associates, Inc., 2018b. 7, 9
+
+Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Yan Shuicheng, Jiashi Feng, and Yannis Kalantidis. Graph-based global reasoning networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 9
+
+Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pp. 764–773, 2017. 9
+
+Giannis Daras, Augustus Odena, Han Zhang, and A. Dimakis. Your local gan: Designing two dimensional local attention mechanisms for generative models. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 14519–14527, 2020. 8, 18
+
+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. 2, 8, 17, 18
+
+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. 1
+
+Inderjit S. Dhillon and Dharmendra S. Modha. Concept decompositions for large sparse text data using clustering. Machine Learning, 42(1):143–175, Jan 2001. ISSN 1573-0565. doi: 10.1023/A:1007612920971. 1, 15
+
+S. M. Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, koray kavukcuoglu, and Geoffrey E Hinton. Attend, infer, repeat: Fast scene understanding with generative models. In Advances in Neural Information Processing Systems 29, pp. 3225–3233. Curran Associates, Inc., 2016. 9
+
+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. 2, 6, 8, 17
+
+Jun Fu, Jing Liu, Haijie Tian, Yong Li, Yongjun Bao, Zhiwei Fang, and Hanqing Lu. Dual attention network for scene segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3146–3154, 2019. 7, 8, 17
+
+Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. arXiv preprint arXiv:1909.10893, 2019. 2, 9
+
+R. M. Gray and D. L. Neuhoff. Quantization. IEEE Transactions on Information Theory, 44(6): 2325–2383, Oct 1998. doi: 10.1109/18.720541. 1, 4
+
+Klaus Greff, Sjoerd van Steenkiste, and Jürgen Schmidhuber. Neural expectation maximization. In Advances in Neural Information Processing Systems 30, pp. 6691–6701. Curran Associates, Inc., 2017. 9
+
+Junjun He, Zhongying Deng, and Yu Qiao. Dynamic multi-scale filters for semantic segmentation. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 3561–3571, 2019a. 7, 8
+
+Junjun He, Zhongying Deng, L. Zhou, Yali Wang, and Yu Qiao. Adaptive pyramid context network for semantic segmentation. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7511–7520, 2019b. 7, 8
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 6, 8, 17
+
+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, 2017. 8, 18
+
+Geoffrey E Hinton, Sara Sabour, and Nicholas Frosst. Matrix capsules with EM routing. In International Conference on Learning Representations, 2018. 9
+
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015. 4, 6
+
+Sarthak Jain and Byron C Wallace. Attention is not explanation. 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. 3543–3556, 2019. 9
+
+Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franccois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. ArXiv, abs/2006.16236, 2020. 9
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015. 18
+
+Tamara G. Kolda and Brett W. Bader. Tensor decompositions and applications. SIAM Review, 51(3): 455–500, 2009. doi: 10.1137/07070111X. 2
+
+Adam Kosiorek, Hyunjik Kim, Yee Whye Teh, and Ingmar Posner. Sequential attend, infer, repeat: Generative modelling of moving objects. In Advances in Neural Information Processing Systems, pp. 8606–8616, 2018. 9
+
+Karol Kurach, M. Lucic, Xiaohua Zhai, M. Michalski, and S. Gelly. A large-scale study on regularization and normalization in gans. In ICML, 2019. 18
+
+Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. In International Conference on Learning Representations, 2019. 9
+
+Daniel D Lee and H Sebastian Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755):788, 1999. 1, 4
+
+Daniel D. Lee and H. Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems 13. MIT Press, 2001. 4
+
+Xia Li, Zhisheng Zhong, Jianlong Wu, Yibo Yang, Zhouchen Lin, and Hong Liu. Expectationmaximization attention networks for semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 9167–9176, 2019. 8, 9, 17
+
+Xia Li, Y. Yang, Qijie Zhao, Tian cheng Shen, Zhouchen Lin, and Hong-Cheu Liu. Spatial pyramid based graph reasoning for semantic segmentation. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8947–8956, 2020. 8
+
+Xiaodan Liang, Zhiting Hu, Hao Zhang, Liang Lin, and Eric P Xing. Symbolic graph reasoning meets convolutions. In Advances in Neural Information Processing Systems, pp. 1853–1863, 2018. 8, 9
+
+Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. arXiv preprint arXiv:1703.03130, 2017. 9
+
+Canyi Lu, Jinhui Tang, Shuicheng Yan, and Zhouchen Lin. Generalized nonconvex nonsmooth low-rank minimization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4130–4137, 2014. 2
+
+Yiping Lu, Zhuohan Li, Di He, Zhiqing Sun, Bin Dong, Tao Qin, Liwei Wang, and Tie-Yan Liu. Understanding and improving transformer from a multi-particle dynamic system point of view. arXiv preprint arXiv:1906.02762, 2019. 9
+
+Mario Luciˇ c, Michael Tschannen, Marvin Ritter, Xiaohua Zhai, Olivier Bachem, and Sylvain ´ Gelly. High-fidelity image generation with fewer labels. In International Conference on Machine Learning, pp. 4183–4192, 2019. 8
+
+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. 8, 9
+
+Xindian Ma, Peng Zhang, Shuai Zhang, Nan Duan, Yuexian Hou, Ming Zhou, and Dawei Song. A tensorized transformer for language modeling. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. 9
+
+Julien Mairal, Francis Bach, Jean Ponce, and Guillermo Sapiro. Online learning for matrix factorization and sparse coding. Journal of Machine Learning Research, 11(Jan):19–60, 2010. 2
+
+Sneha Mehta, H. Rangwala, and N. Ramakrishnan. Low rank factorization for compact multi-head self-attention. ArXiv, abs/1912.00835, 2019. 9
+
+Takeru Miyato and Masanori Koyama. cGANs with projection discriminator. In International Conference on Learning Representations, 2018. 17, 18
+
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. 18
+
+Volodymyr Mnih, Nicolas Heess, Alex Graves, et al. Recurrent models of visual attention. In Advances in neural information processing systems, pp. 2204–2212, 2014. 8
+
+Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. arXiv preprint arXiv:1611.06440, 2016. 17
+
+Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille. The role of context for object detection and semantic segmentation in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 891–898, 2014. 2, 8, 17
+
+Ankur Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2249–2255, 2016. 9
+
+Niki Parmar, Prajit Ramachandran, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jon Shlens. Stand-alone self-attention in vision models. In Advances in Neural Information Processing Systems, pp. 68–80, 2019. 9
+
+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, pp. 8024–8035, 2019. 5
+
+Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in neural information processing systems, pp. 3856–3866, 2017. 9
+
+T. Sainath, Brian Kingsbury, V. Sindhwani, E. Arisoy, and B. Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6655–6659, 2013. 9
+
+Sofia Serrano and Noah A Smith. Is attention interpretable? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2931–2951, 2019. 9
+
+Kyungwoo Song, Yohan Jung, Dong-Jun Kim, and I. Moon. Implicit kernel attention. ArXiv, abs/2006.06147, 2020. 9
+
+Yunzhe Tao, Qi Sun, Qiang Du, and Wei Liu. Nonlocal neural networks, nonlocal diffusion and nonlocal modeling. In Advances in Neural Information Processing Systems 31, pp. 496–506. Curran Associates, Inc., 2018. 9
+
+Snigdha Tariyal, A. Majumdar, R. Singh, and Mayank Vatsa. Deep dictionary learning. IEEE Access, 4:10096–10109, 2016. 9
+
+Madeleine Udell, Corinne Horn, Reza Zadeh, and Stephen Boyd. Generalized low rank models. Foundations and Trends in Machine Learning, 9(1):1–118, 2016. ISSN 1935-8237. doi: 10.1561/ 2200000055. 2
+
+Sjoerd van Steenkiste, Michael Chang, Klaus Greff, and Jürgen Schmidhuber. Relational neural expectation maximization: Unsupervised discovery of objects and their interactions. In International Conference on Learning Representations, 2018. 9
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30, pp. 5998–6008. Curran Associates, Inc., 2017. 1, 2, 7, 9
+
+Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. ArXiv, abs/2006.04768, 2020. 9
+
+Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7794–7803, 2018. 1, 3, 9
+
+Paul J Werbos et al. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. 1, 5
+
+Sarah Wiegreffe and Yuval Pinter. Attention is not not explanation. 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. 11–20, 2019. 9
+
+John Wright, Arvind Ganesh, Shankar Rao, Yigang Peng, and Yi Ma. Robust principal component analysis: Exact recovery of corrupted low-rank matrices via convex optimization. In Advances in neural information processing systems, pp. 2080–2088, 2009. 2
+
+Yan Wu, Jeff Donahue, David Balduzzi, Karen Simonyan, and Timothy P. Lillicrap. Logan: Latent optimisation for generative adversarial networks. ArXiv, abs/1912.00953, 2019. 8
+
+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. 2, 8, 9
+
+Changqian Yu, Jingbo Wang, Chao Peng, Changxin Gao, Gang Yu, and Nong Sang. Learning a discriminative feature network for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1857–1866, 2018. 8
+
+Yuhui Yuan and Jingdong Wang. Ocnet: Object context network for scene parsing. arXiv preprint arXiv:1809.00916, 2018. 17
+
+Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. arXiv preprint arXiv:1909.11065, 2020. 8, 17
+
+Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. ICML, 2019a. 1, 3, 6, 8, 9, 17, 18
+
+Han Zhang, Zizhao Zhang, Augustus Odena, and Honglak Lee. Consistency regularization for generative adversarial networks. ArXiv, abs/1910.12027, 2020. 18
+
+Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, and Amit Agrawal. Context encoding for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7151–7160, 2018. 8
+
+Hang Zhang, Han Zhang, Chenguang Wang, and Junyuan Xie. Co-occurrent features in semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 548–557, 2019b. 7, 8, 17
+
+Songyang Zhang, Shipeng Yan, and Xuming He. LatentGNN: Learning efficient non-local relations for visual recognition. In Proceedings of the 36th International Conference on Machine Learning(ICML), volume 97 of Proceedings of Machine Learning Research, pp. 7374–7383. PMLR, 2019c. 9
+
+Zhengdong Zhang, Arvind Ganesh, Xiao Liang, and Yi Ma. Tilt: Transform invariant low-rank textures. International journal of computer vision, 99(1):1–24, 2012. 2
+
+Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2881–2890, 2017. 8, 18
+
+Zhisheng Zhong, Fangyin Wei, Zhouchen Lin, and Chao Zhang. Ada-tucker: Compressing deep neural networks via adaptive dimension adjustment tucker decomposition. Neural networks : the official journal of the International Neural Network Society, 110:104–115, 2019. 9
+
+Zilong Zhong, Zhong Qiu Lin, Rene Bidart, Xiaodan Hu, Ibrahim Ben Daya, Zhifeng Li, WeiShi Zheng, Jonathan Li, and Alexander Wong. Squeeze-and-attention networks for semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 8
+
+Zhen Zhu, Mengde Xu, Song Bai, Tengteng Huang, and Xiang Bai. Asymmetric non-local neural networks for semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 593–602, 2019. 9
+
+# A TABLE OF NOTION
+
+Table 7: Summary of notations in this paper
+
+
βXXZ
A scalar.A vector.A matrix.A tensor.
1nXiht8
A vector whose n elements are all 1.i-th column of matrix X.Vector h at time step t.Jacobian matrix of y W.r.t. X.
XX||F
Operator norm.Frobenius norm.
diagcosinesoftmaxnormalize
Map a vector to a diagonal matrix.Cosine similarity used in Alg.1.Column-wise softmax function.Column-wise normalization by L2 norm.
+
+# B HAMS
+
+Additionally, we introduce another type of ham adopted by Hamburger, Concept Decomposition.
+
+Concept Decomposition We first enhance Concept Decomposition (Dhillon & Modha, 2001) to the following form:
+
+$$
+\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { D , C } \| X - D C \| _ { F } ^ { 2 } + \beta \| C \| _ { F } ^ { 2 } } \\ { \displaystyle \mathrm { s . t . } D \in \arg \operatorname* { m a x } _ { D } \mathcal { Q } \left( D , X \right) . } \end{array}
+$$
+
+This problem has a closed solution w.r.t. $C$ under a given $_ { D }$ , i.e., $\pmb { C } = ( \pmb { D } ^ { \top } \pmb { D } + \beta \pmb { I } ) ^ { - 1 } \pmb { D } ^ { \top } \pmb { X }$ . Since $D ^ { \top } D + \beta I$ is a positive definite matrix with a regularized conditional number, the inverse can be more numerically stable than the original one where a semi-positive definite matrix $D ^ { \top } D$ is given under $\beta = 0$ . In practice, 0.01 or 0.1 makes no difference for $\beta$ .
+
+
Algorithm 3 Ham: Soft CD
Input X. Initialize D, C
for k from 1 to K do
C ← softmax(Tcosine(D,X))
D ← normalize(XCT)
end for
C ← (DD+ βI)-1DTX
Output X = DC.
+
+The dictionary in CD is given by spherical $\mathbf { K }$ -means (Dhillon & Modha, 2001) with objective $\mathcal { Q } \left( D , X \right)$ , as mentioned in Eq. (14).
+
+$$
+\begin{array} { r l } { \arg \operatorname* { m a x } } & { \sum _ { j = 1 } ^ { r } \sum _ { \mathbf { x } \in \pi _ { j } } c o s i n e \left( \mathbf { x } , \mathbf { d } _ { j } \right) } \\ { D , \{ \pi _ { j } \} _ { r } } & { \phantom { \sum _ { j = 1 } ^ { r } \sum _ { \mathbf { x } \in \pi _ { j } } c o s i n e \left( \mathbf { x } , \mathbf { d } _ { j } \right) } } \\ { \mathrm { s . t . } } & { \| \mathbf { d } _ { j } \| = 1 . } \end{array}
+$$
+
+The same strategy as VQ is adopted to make the whole algorithm differentiable, however, in which each column of $_ { D }$ is normalized to be a unit vector and thus differs from VQ.
+
+# C PROOF OF PROPOSITIONS
+
+We investigate an abstract RNN model inspired by numerical methods to understand the drawbacks of BPTT algorithm in differentiating the optimization algorithm of MDs, $\mathcal { M }$ . We show the propositions in Sec. 2.3 to illustrate the unstable gradient from $\mathcal { M }$ when using BPTT algorithm, considering MDs’ nature as optimization algorithms.
+
+Proposition 1 The iterations of $\mathcal { F }$ have linear convergence.
+
+Proof. It is obvious that $\mathcal { F }$ is a contraction mapping w.r.t. h under arbitrary given $\mathbf { x }$ . We can then conclude $\{ \mathbf { h } ^ { t } \}$ is a Cauthy sequence and $\mathcal { F } ( * , \mathbf { x } )$ admits a unique fixed point $\mathbf { h } ^ { * }$ due to Banach Fixed Point Theorem.
+
+$$
+\begin{array} { r l } & { \| \mathbf { h } ^ { t + 1 } - \mathbf { h } ^ { * } \| = \| \mathcal { F } ( \mathbf { h } ^ { t } , \mathbf { x } ) - \mathcal { F } ( \mathbf { h } ^ { * } , \mathbf { x } ) \| } \\ & { \qquad \leq L _ { h } \| \mathbf { h } ^ { t } - \mathbf { h } ^ { * } \| } \end{array}
+$$
+
+Eq. (16) shows the linear convergence.
+
+Proposition 2 $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \frac { \partial \mathbf { y } } { \partial \mathbf { x } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { \ast } } ( \pmb { I } - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { \ast } } ) ^ { - 1 } \frac { \partial \mathcal { F } } { \partial \mathbf { x } } . } \end{array}$
+
+Proof. Note that $\mathcal { F } ( \ast , { \mathbf { x } } )$ admits a unique fixed point $\mathbf { h } ^ { * }$ under arbitrary given $\mathbf { x }$ , i.e.,
+
+$$
+\mathbf { h } ^ { * } = \mathcal { F } ( \mathbf { h } ^ { * } , \mathbf { x } ) \quad \Longrightarrow \quad \mathbf { h } ^ { * } - \mathcal { F } ( \mathbf { h } ^ { * } , \mathbf { x } ) = \mathbf { 0 }
+$$
+
+By differentiating the above equation, we can obtain
+
+$$
+( I - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { * } } ) \frac { \partial \mathbf { h } ^ { * } } { \partial \mathbf { x } } = \frac { \partial \mathcal { F } } { \partial \mathbf { x } }
+$$
+
+The Jacobian matrix $\begin{array} { r } { I - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { * } } } \end{array}$ is invertible, which implies the existence of the implicit function $\mathbf { h } ^ { * } ( \mathbf { x } )$ . Immediately, we have
+
+$$
+\operatorname* { l i m } _ { t \to \infty } \frac { \partial \mathbf { y } } { \partial \mathbf { x } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { * } } \frac { \partial \mathbf { h } ^ { * } } { \partial \mathbf { x } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { * } } ( \pmb { I } - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { * } } ) ^ { - 1 } \frac { \partial \mathcal { F } } { \partial \mathbf { x } } ,
+$$
+
+which completes the proof.
+
+Proposition 3 $\begin{array} { r } { \underset { t \infty } { \operatorname* { l i m } } \Vert \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { 0 } } \Vert = 0 , \underset { t \infty } { \operatorname* { l i m } } \Vert \frac { \partial \mathbf { y } } { \partial \mathbf { x } } \Vert \leq \frac { L _ { \mathcal { G } } L _ { x } } { 1 - L _ { h } } . } \end{array}$
+
+Proof.
+
+$$
+\| \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { 0 } } \| = \| \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \prod _ { i = 1 } ^ { t } \frac { \partial \mathbf { h } ^ { i } } { \partial \mathbf { h } ^ { i - 1 } } \| \leq \| \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \| \prod _ { i = 1 } ^ { t } \| \frac { \partial \mathbf { h } ^ { i } } { \partial \mathbf { h } ^ { i - 1 } } \| \leq L _ { \mathcal { G } } L _ { h } ^ { t }
+$$
+
+Then we have:
+
+$$
+\operatorname* { l i m } _ { t \infty } \lVert \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { 0 } } \rVert = 0 .
+$$
+
+$$
+\begin{array} { r l } & { \| \displaystyle \frac { \partial \mathbf { y } } { \partial \mathbf { x } } \| = \| \sum _ { i = 0 } ^ { t } \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \| \prod _ { j = i + 1 } ^ { t } \frac { \partial \mathbf { h } ^ { j } } { \partial \mathbf { h } ^ { j - 1 } } \frac { \partial \mathbf { h } ^ { i } } { \partial \mathbf { x } } \| } \\ & { \qquad \le \displaystyle \sum _ { i = 0 } ^ { t } \| \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \| \prod _ { j = i + 1 } ^ { t } \| \frac { \partial \mathbf { h } ^ { j } } { \partial \mathbf { h } ^ { j - 1 } } \| \| \frac { \partial \mathbf { h } ^ { i } } { \partial \mathbf { x } } \| } \\ & { \qquad \le L { \mathcal { C } } ( \displaystyle \sum _ { i = 0 } ^ { t - 1 } L _ { n } ^ { i } ) L _ { x } } \\ & { \qquad = \displaystyle \frac { L _ { G } L _ { x } ( 1 - L _ { h } ^ { t } ) } { 1 - L _ { h } } } \end{array}
+$$
+
+Then we have:
+
+$$
+\operatorname* { l i m } _ { t \to \infty } \| \frac { \partial \mathbf { y } } { \partial \mathbf { x } } \| \leq \frac { L _ { \mathcal { G } } L _ { x } } { 1 - L _ { h } } .
+$$
+
+# D DATASETS
+
+PASCAL VOC The PASCAL VOC dataset (Everingham et al., 2010) is a widely used dataset in both semantic segmentation and detection. For segmentation, it contains 10,582 images for training, 1,449 images for validation and 1,456 images for testing. PASCAL VOC dataset involves 20 foreground object classes and a background class for segmentation and detection.
+
+PASCAL Context The PASCAL Context dataset (Mottaghi et al., 2014) is a challenging dataset in semantic segmentation, which provides detailed labels and involves 59 foreground object classes and a background class for segmentation. It consists of 4,998 and 5,105 images in training and validation set, respectively.
+
+ILSVRC 2012 The ILSVRC 2012 (ImageNet) (Deng et al., 2009) dataset contains 1.3M training samples and $5 0 \mathrm { k }$ test images, categorized into 1000 object classes. We resize images to resolution $1 2 8 \times 1 2 8$ , as done in SNGAN with projection (Miyato & Koyama, 2018) and SAGAN (Zhang et al., 2019a).
+
+# E DETAILS OF EXPERIMENTS
+
+# E.1 ABALATION EXPERIMENTS
+
+We use dilated ResNet-50 (He et al., 2016) with the output stride 16 as the backbone. The backbone is pre-trained on ImageNet (Deng et al., 2009). We apply a poly-learning rate policy under batch size 12 and 30k iterations (about 35 epochs) for fast experiments (less than 12 hours using 1 NVIDIA TITAN Xp GPU). The initial learning rate is set to 0.009, multiplied by $\begin{array} { r } { ( 1 - \frac { i t e r } { i t e r _ { m a x } } ) ^ { \tilde { 0 . } 9 } } \end{array}$ )0.9 after each iteration, with momentum 0.9 and weight decay 0.0001. Hyperparameters of Hamburger are the same as Appendix E.3.
+
+# E.2 A COMPARISON WITH ATTENTION MECHANISM
+
+We report MACs according to Molchanov et al. (2016), using torchprofile1, a more accurate profiler for Pytorch. Real-time cost is measured by built-in Pytorch memory tools on NVIDIA TITAN Xp GPU with a input tensor $\mathcal { Z } \in \mathbb { R } ^ { 1 \times 5 1 2 \times 1 2 8 \times 1 2 8 }$ . Inference times are averaged results from 20 repeats of 100 runs.
+
+# E.3 SEMANTIC SEGMENTATION
+
+Architectures We use ResNet-101 (He et al., 2016) with the ouptput strid 8 as our backbone. We adopt dilated convolution (Chen et al., 2018a) to preserve more detail spatial information and enlarge receptive field as done in the backbone of state-of-the-art attention models ( $\mathrm { F u }$ et al., 2019; Li et al., 2019; Zhang et al., 2019b). We employ a $3 \times 3$ convolution layer with BN and ReLU to reduce channels from 2048 to 512 and then add Hamburger on the top of the backbone. Note that the input of Hamburger is a tensor $\mathcal { Z } \in \mathbb { R } ^ { C \times H \times W }$ . We unfold $\mathcal { Z }$ to a matrix $\boldsymbol { Z } \in \mathbb { R } ^ { C \times H W }$ and set $d _ { z } = C$ and $n = H W$ for Hamburger. Latent dimension $d$ and $r$ , i.e., the column vectors’ dimension of the input matrix $\pmb { X } \in \mathbb { R } ^ { d \times n }$ to $\mathcal { M }$ and the number of atoms in the dictionary $\pmb { D } \in \mathbb { R } ^ { r \times d }$ , are set to 512 and 64. The iterations of MD’s optimization algorithm, $K$ , are set to 6. Non-negative Matrix Factorization (NMF) is our default ham for semantic segmentation.
+
+Data augmentation In the training stage, we apply random left-right flipping, random scaling (from 0.5 to 2), and cropping to augment the training data. Images are resized to $5 1 3 \times 5 1 3$ for the PASCAL VOC dataset and the PASCAL Context dataset. In the test stage, the multi-scale and flipping strategy is applied as other state-of-the-art attention-based models ( $\mathrm { F u }$ et al., 2019; Yuan & Wang, 2018; Yuan et al., 2020).
+
+Optimization We use mini-batch SGD with momentum 0.9 to train HamNet. Synchronized Batch Normalization is adopted in experiments on semantic segmentation. All backbones are fine-tuned from ImageNet (Deng et al., 2009) pre-training. Following previous works (Zhao et al., 2017; Chen et al., 2018a), we apply a poly-learning rate policy. The initial learning rate is multiplied by $\begin{array} { r } { ( 1 - \frac { i t e r } { i t e r _ { m a x } } ) ^ { 0 . 9 } } \end{array}$ )0.9. For the PASCAL VOC dataset, learning rate, weight decay, batch size, iterations are set to 0.009, 0.0001, 16, and $6 0 \mathrm { k }$ , respectively. We fine-tune HamNet on the PASCAL VOC trainval set with the learning rate down to a tenth. The learning rate, weight decay, batch size, iterations are 0.002, 0.0001, 16, and 25k for the PASCAL-Context dataset.
+
+# E.4 IMAGE GENERATION
+
+We use the official GAN codebase2 from Tensorflow (Abadi et al., 2016) and TF-GAN to train HamGAN and evaluate FID.
+
+Architectures Experiments on ImageNet are conducted using the same architecture as SAGAN (Zhang et al., 2019a), and YLG (Daras et al., 2020), including Spectral Normalization (Miyato et al., 2018) in both the generator and the discriminator, conditional Batch Normalization in the generator, and class projection in the discriminator (Miyato & Koyama, 2018). Hamburger with NMF ham is placed at feature resolution $3 2 \times 3 2$ in both the generator and the discriminator where self-attention can obtain the best FID according to Zhang et al. (2019a). We use $d = 8 r$ for Hamburger, and $d$ is the same as the input channels, while the optimization steps $K$ are 6. Restricted to expenditures of training GANs on ImageNet, $d , r$ , and $K$ are decided according to the ablation experiments on semantic segmentation without new ablation experiments.
+
+Optimization For all models, we use Adam (Kingma & Ba, 2015) optimizer with TTUR (Heusel et al., 2017). HamGAN employs the same training settings as SAGAN (Miyato et al., 2018) and YLG (Daras et al., 2020), respectively.
+
+Evaluation metrics The quality of images generated by GANs are evaluated by Fr´echet Inception Distance (FID) (Heusel et al., 2017). Lower FID indicates that the model can generate higher-fidelity images. In our experiments, $5 0 \mathrm { k }$ images are sampled from the generator to compute FID. We evaluate HamGAN for 6 runs and report the best FID to approximately match the convention in the modern GAN research like Kurach et al. (2019) and CR-GAN (Zhang et al., 2020), reporting top $5 \% / 1 5 \%$ results in the experiments.
+
+# F FURTHER RESULTS FROM ABLATION EXPERIMENTS
+
+Table 8: Ablation on initializations.
+
+
Init
NMF
CD
VQ
fixed
77.4(77.3)
77.7(77.4)
77.3(76.9)
learned
76.8(76.5)
75.0(73.7)
75.9(75.8)
random
78.3(77.8)
77.9(77.3)
77.7(77.4)
online
77.8(77.5)
78.1(77.5)
78.0(77.2)
+
+Initialization We test four types of initialization for the dictionary $_ { D }$ , including fixed initialization, learned initialization, random initialization, and warm start with online update. Usually, random initialization is the best choice that means we can sample each entry of $_ { D }$ from a given distribution like Uniform $( 0 , 1 )$ as the initialization of the optimization algorithm $\mathcal { M }$ . For NMF, after initializing $_ { D }$ , we initialize $\begin{array} { r } { \dot { \mathbf { C } } = s o f t m a x ( \frac { 1 } { T } c o s i n e ( \mathbf { D } , \mathbf { \dot { X } } ) ) } \end{array}$ since $\mathbf { K }$ -means is usually applied for initializing NMF and this initialization for $\bar { C }$ is equivalent to a single update in Spherical K-means. A special reminder is that it is not suitable to initialize either $_ D$ or $C$ to values too close to 0 due to the property of the MU rule. So the temperature $T$ is recommended to be a higher value like 1 in this initialization for $C$ . Random initialization also works for $C$ in NMF with scores 77.8(77.6) when sampling $C _ { i j } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ . Note that learned initialization is always the worst one since the BPTT algorithm is employed to learn the initialization that the gradient from $\mathcal { M }$ may impede the training of the backbone, instead of the one-step gradient. Warm start benefits MD with unit vectors in the dictionary $_ { D }$ like CD. In general, random initialization is good enough for all three selected MD models. A possible reason is that it can enforce the network to adapt to the results solved by different initializations during the training process, acting like an inner augmentation.
+
+Temperature $T$ As we have claimed, when $T$ approaches 0, we can get a solution close to the original problem in both VQ and CD. In VQ and CD experiments, a relatively low temperature $T$ is more recommended to solve a better $_ { D }$ for MD. However, it will not receive more gains but increase the variance during training if we further lower $T$ .
+
+Table 9: Influence of temperature $T$ with CD ham.
+
+
Temperature T
mIoU(%)
1
77.1(77.0)
0.1
78.2(77.5)
0.01
78.1(77.5)
+
+Iterations $K$ We take the iterations $K$ of optimization algorithms $\mathcal { M }$ for all three MD models, NMF, CD, and VQ, into our consideration. More iterations and even fully converged results for $\mathcal { M }$ are tested in the evaluation stage but worse than little optimization steps. The smaller $K$ , ranging from 1 to 8, can be treated as early stopping for the optimization algorithm $\mathcal { M }$ , obtaining satisfactory performances. For a detailed visualization, see Fig. 7, Fig. 8, Fig. 9.
+
+
+Figure 7: Impacts of $K$ on NMF
+
+
+Figure 8: Impacts of $K$ on CD
+
+
+Figure 9: Impacts of $K$ on VQ
+
+# G AN INTUITIVE ILLUSTRATION
+
+In this section, we hope to give an example to help our readers develop insight into why the low-rank assumption is useful for modeling the representations’ global context.
+
+The low-rank assumption helps because it represents the inductive bias that the low-level representations contain limited and much less high-level concepts than the scale of the representations themselves. Imagine an image in which a person works on the road. Many hyper-pixels extracted by the backbone CNN will describe the road. Note that the road can be considered as repeats of small road patches, which means that we can represent the road via modeling the basic road patches and repeat them. Mathematically, it is equivalent to finding a small set of bases $_ D$ corresponding to different road patches and a coefficient matrix $C$ that captures the relation between the elementary road patches and the hyper-pixels. This example illustrates that the high-level concepts, i.e., the global context, can be low-rank in the ideal situation.
+
+The hyper-pixels describing the road patches have close semantic attributes. However, due to the vanilla CNN’s inefficiency for modeling the long-range dependencies, the learned representation contains too many local details and incorrect information, lacking global guidance. Imagine that the person in the image wears gloves. When we see the gloves patch locally, we think that this patch describes gloves. When we consider the global context, we can understand that this patch is a part of a person. The semantic information is hierarchical, depending on at which level we hope to comprehend. This work aims at enabling the networks to understand the context globally via the low-rank completion formulation. We thus model the incorrect information, namely the redundancies and incompleteness, as a noise matrix. To emphasize the global context, we decompose the representations into two parts, a low-rank global information matrix and a noise matrix, by employing the optimization algorithm to recover the clean signal subspace, discard the noises, and enhance the global information via the skip connection. It could be learned from the data on how much global information the networks need for a specific task.
\ No newline at end of file
diff --git a/md/train/1NRMmEUyXMu/1NRMmEUyXMu.md b/md/train/1NRMmEUyXMu/1NRMmEUyXMu.md
new file mode 100644
index 0000000000000000000000000000000000000000..55b8ff9ef95f856b18643f6d8d35fc96eb5d9b24
--- /dev/null
+++ b/md/train/1NRMmEUyXMu/1NRMmEUyXMu.md
@@ -0,0 +1,346 @@
+# WORLD MODEL AS A GRAPH: LEARNING LATENT LANDMARKS FOR PLANNING
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Planning, the ability to analyze the structure of a problem in the large and decompose it into interrelated subproblems, is a hallmark of human intelligence. While deep reinforcement learning (RL) has shown great promise for solving relatively straightforward control tasks, it remains an open problem how to best incorporate planning into existing deep RL paradigms to handle increasingly complex environments. One prominent framework, Model-Based RL, learns a world model and plans using step-by-step virtual rollouts. This type of world model quickly diverges from reality when the planning horizon increases, thus struggling at long-horizon planning. How can we learn world models that endow agents with the ability to do temporally extended reasoning? In this work, we propose to learn graph-structured world models composed of sparse, multi-step transitions. We devise a novel algorithm to learn latent landmarks that are scattered (in terms of reachability) across the goal space as the nodes on the graph. In this same graph, the edges are the reachability estimates distilled from Q-functions. On a variety of high-dimensional continuous control tasks ranging from robotic manipulation to navigation, we demonstrate that our method, named $L ^ { 3 } P$ , significantly outperforms prior work, and is oftentimes the only method capable of leveraging both the robustness of model-free RL and generalization of graph-search algorithms. We believe our work is an important step towards scalable planning in reinforcement learning.
+
+# 1 INTRODUCTION
+
+An intelligent agent should be able to solve difficult problems by breaking them down into sequences of simpler problems. Classically, planning algorithms have been the tool of choice for endowing AI agents with the ability to reason over complex long-horizon problems (Doran & Michie, 1966; Hart et al., 1968). Recent years have seen an uptick in monographs examining the intersection of classical planning techniques – which excel at temporal abstraction – with deep reinforcement learning (RL) algorithms – which excel at state abstraction. Perhaps the ripest fruit born of this relationship is the AlphaGo algorithm, wherein a model free policy is combined with a MCTS (Coulom, 2006) planning algorithm to achieve superhuman performance on the game of Go (Silver et al., 2016a).
+
+In the field of robotics, progress on combining planning and reinforcement learning has been somewhat less rapid, although still resolute. Indeed, the laws of physics in the real world are infinitely more complex than the simple rules of Go. Unlike board games such as chess and Go, which have deterministic and known dynamics and discrete action space, robots have to deal with a probabilistic and unpredictable world, and the action space for robots is oftentimes continuous. As a result, planning in robotics presents a much harder problem. One general class of methods (Sutton, 1991) seeks to combine model-based planning and deep RL. These methods can be thought of as an extension of model-predictive control (MPC) algorithms, with the key difference being that the agent is trained over hypothetical experience in addition to the actually collected experience. The primary shortcoming of this class of methods is that, like MCTS in AlphaGo, they resort to planning with action sequences – forcing the robot to plan for each action at every hundred milliseconds. Planning on the level of action sequences is fundamentally bottlenecked by the accuracy of the learned dynamics model and the horizon of a task, as the learned world model quickly diverges over a long horizon. This limitation shows that world models in the traditional Model-based RL (MBRL) setting often fail to deliver the promise of planning.
+
+
+Figure 1: MBRL versus $L ^ { 3 } P$ (World Model as a Graph). MBRL does step-by-step virtual rollouts with the world model and quickly diverges from reality when the planning horizon increases. $L ^ { 3 } P$ models the world as a graph of sparse multi-step transitions, where the nodes are learned latent landmarks and the edges are reachability estimates. $L ^ { 3 } P$ succeeds at temporally extended reasoning.
+
+Another general class of methods, Hierarchical RL (HRL), introduces a higher-level learner to address the problem of planning (Dayan & Hinton, 1993; Vezhnevets et al., 2017; Nachum et al., 2018). In this scenario, a goal-based RL agent serves as the worker, and a manager learns what sequences of goals it must set for the worker to achieve a complex task. While this is apparently a sound solution to the problem of planning, hierarchical learners neither explicitly learn a higher-level model of the world nor take advantage of the graph structure inherent to the problem of search.
+
+To better combine classical planning and reinforcement learning, we propose to learn graph-structured world models composed of sparse multi-step transitions. To model the world as a graph, we borrow a concept from the navigation literature – the idea of landmarks (Wang et al., 2008). Landmarks are essentially states that an agent can navigate between in order to complete tasks. However, rather than simply using previously seen states as landmarks, as is traditionally done, we will instead develop a novel algorithm to learn the landmarks used for planning. Our key insight is that by mapping previously achieved goals into a latent space that captures the temporal distance between goals, we can perform clustering in the latent space to group together goals that are easily reachable from one another. Subsequently, we can then decode the latent centroids to obtain a set of goals scattered (in terms of reachability) across the goal space. Since our learned landmarks are obtained from latent clustering, we call them latent landmarks. The chief algorithmic contribution of this paper is a new method for planning over learned latent landmarks for high-dimensional continuous control domains, which we name Learning Latent Landmarks for Planning $( L ^ { 3 } P )$ .
+
+The idea of reducing planning in RL to a graph search problem has enjoyed some attention recently (Savinov et al., 2018a; Eysenbach et al., 2019; Huang et al., 2019; Liu et al., 2019; Yang et al., 2020; Laskin et al., 2020). A key difference between those works and $L ^ { 3 } P$ is that our use of latent landmarks allows us to substantially reduce the size of the search space. What’s more, we make improvements to the graph search module and the online planning algorithm to improve the robustness and sample efficiency of our method. As a result of those decisions, our algorithm is able to achieve superior performance on a variety of robotics domains involving both navigation and manipulation. In addition to the results presented in Section 5, videos of our algorithm’s performance, and an analysis of the sub-tasks discovered by the latent landmarks, may be found at https://sites.google.com/view/latent-landmarks/.
+
+# 2 RELATED WORKS
+
+The problem of learning landmarks to aid in robotics problems has a long and rich history (Gillner & Mallot, 1998; Wang & Spelke, 2002; Wang et al., 2008). Prior art has been deeply rooted in the classical planning literature. For example, traditional methods would utilize Dijkstra et al. (1959) to plan over generated waypoints, SLAM (Durrant-Whyte & Bailey, 2006) to simultaneously integrate mapping, or the RRT algorithm (LaValle, 1998) for explicit path planning. The $\mathbf { A } ^ { * }$ algorithm (Hart et al., 1968) further improved the computational efficiency of Dijkstra. Those types of methods often heavily rely on a hand-crafted configuration space that provides prior knowledge.
+
+Planning is intimately related to model-based RL (MBRL), as the core ideas underlying learned models and planners can enjoy considerable overlap. Perhaps the most clear instance of this overlap is Model Predictive Control (MPC), and the related Dyna algorithm (Sutton, 1991). When combined with modern techniques (Kurutach et al., 2018; Luo et al., 2018; Nagabandi et al., 2018; Ha & Schmidhuber, 2018; Hafner et al., 2019; Wang & Ba, 2019; Janner et al., 2019), MBRL is able to achieve some level of success. Corneil et al. (2018) and Hafner et al. (2020) also learn a discrete latent representation of the environment in the MBRL framework. As discussed in the introduction, planning on action sequences will fundamentally struggle to scale in robotics.
+
+Our method will make extensive use of a parametric goal-based RL agent to accomplish low-level navigation between states. This area has seen rapid progress recently, largely stemming from the success of Hindsight Experience Replay (HER) (Andrychowicz et al., 2017). Several improvements to HER augment the goal relabeling and sampling strategies to improve performance (Nair et al., 2018; Pong et al., 2018; 2019; Zhao et al., 2019; Pitis et al., 2020). There have also been attempts at incorporating search as inductive biases within the value function (Silver et al., 2016b; Tamar et al., 2016; Farquhar et al., 2017; Racaniere et al., 2017; Lee et al., 2018; Srinivas et al., 2018). The focus \` of this line of work is to improve the low-level policy and is thus orthogonal to our work.
+
+Recent work in Hierarchical RL (HRL) builds upon goal-based RL by learning a high-level parametric manager that feeds goals to the low-level goal-based agent (Dayan & Hinton, 1993; Vezhnevets et al., 2017; Nachum et al., 2018). This can be viewed as a parametric alternative to classical planning, as discussed in the introduction. Recently, Jurgenson et al. (2020); Pertsch et al. (2020) have derived HRL methods that are intimately tied to tree search algorithms. These papers are further connected to a recent trend in the literature wherein classical search methods are combined with parametric control (Savinov et al., 2018a; Eysenbach et al., 2019; Huang et al., 2019; Liu et al., 2019; Yang et al., 2020; Laskin et al., 2020). Several of these articles will be discussed throughout this paper. LEAP (Nasiriany et al., 2019) also considers the problem of proposing sub-goals for a goal-conditioned agent: it uses a VAE (Kingma & Welling, 2013) and does CEM on the prior distribution to form the landmarks. Our method constrains the latent space with temporal reachability between goals, a concept previously explored in Savinov et al. (2018b), and uses latent clustering and graph search rather than sampling-based methods to learn and propose sub-goals.
+
+# 3 BACKGROUND
+
+We consider the problem of Multi-Goal RL under a Markov Decision Process (MDP) that is parameterized by $( S , A , \bar { \mathbb { P } } , G , \Psi , R , \rho _ { 0 } )$ . $S$ and $A$ are the state and action space. The probability distribution of the initial states is given by $\rho _ { 0 } ( s )$ , and $\mathbb { P } ( s ^ { \prime } | s , a )$ is the transition probability. $\Psi : S \mapsto G$ is a mapping from the state space to the goal space, which assumes that every state $s$ can be mapped to a corresponding achieved goal $g$ . The reward function $R$ can be defined as $R ( s , a , s ^ { \prime } , g ) = - \mathbb { 1 } \{ \Psi ( s ^ { \prime } ) \neq g \}$ . We further assume that each episode has a fixed horizon $T$ .
+
+The goal-conditioned policy is a probability distribution $\pi : S \times G \times A \to \mathbb { R } ^ { + }$ . The policy gives rise to trajectory samples of the form $\tau = \{ s _ { 0 } , a _ { 0 } , g , s _ { 1 } , \cdot \cdot \cdot s _ { T } \}$ . The purpose of the policy $\pi$ is to learn how to reach the goals drawn from the goal distribution $p _ { g }$ , which means maximizing the cumulative rewards. Together with a discount factor $\gamma \in ( 0 , 1 )$ , the objective is to maximize $\begin{array} { r } { \mathcal { I } ( \pi ) = \mathbb { E } _ { g \sim p _ { g } , \tau \sim \pi ( g ) } [ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } \cdot R ( s _ { t } , a _ { t } , s _ { t + 1 } , g ) ] } \end{array}$ . Q-learning provides a sample-efficient way to optimize the above objective by utilizing off-policy data stored in a replay buffer $B$ . $Q ( s , a , g )$ estimates the reward-to-go under the current policy $\pi$ conditioned upon the given goal. An additional technique, called Hindsight Experience Replay, or HER (Andrychowicz et al., 2017), uses hindsight relabelling to drastically speed up training. This relabeling crucially relies upon the mapping $\Psi : S \mapsto G$ in the multi-goal MDP setting. We can write the the joint objective of multi-goal Q-learning with HER as minimizing:
+
+$$
+\begin{array} { r l } & { \underset { Q } { \operatorname* { m i n } } \mathbb { E } _ { \mathrm { } } _ { \mathrm { } \mathrm { } \tau \sim { \cal B } , t \sim \{ 0 \cdot \tau - 1 \} } \ \Biggl ( Q ( s _ { t } , a _ { t } , g ) - \Bigl ( R ( s _ { t } , a _ { t } , s _ { t + 1 } , g ) + \gamma \cdot Q ( s _ { t + 1 } , a ^ { \prime } , g ) \Bigr ) \Biggr ) ^ { 2 } } \\ & { \qquad k \sim \{ t + 1 \cdots T \} , g = \Psi ( s _ { t } ) } \\ & { \qquad a ^ { \prime } \sim \pi ( \cdot | s _ { t + 1 } , g ) } \end{array}
+$$
+
+
+Figure 2: An overview of $L ^ { 3 } P$ , which learns a small number of latent landmarks for planning. The main components of our method are: learning reachability estimates (via Q-learning and regression), learning a latent space (via an auto-encoder with reachability constraints), learning latent landmarks (via clustering in the latent space), graph search on the world model and online planning.
+
+# 4 THE $L ^ { 3 } P$ ALGORITHM
+
+Our overall objective in this section is to derive an algorithm that learns a small number of landmarks scattered across goal space in terms of reachability and use those learned landmarks for planning. There are three chief difficulties we must overcome when considering such an algorithm. First, how can we group together goals that are easily reachable from one another? The answer is to embed goals into a latent space, where the latent representation captures some notion of temporal distance between goals – in the sense that goals that would take many timesteps to navigate between are further apart in latent space. Second, we need to find a way to learn a sparse set of landmarks used for planning. Our method performs clustering on the constrained latent space, and decodes the learned centroids as the landmarks we seek. Finally, we need to develop a non-parametric planning algorithm responsible for selecting sequences of landmarks the agent must traverse to accomplish its high-level goal. The proposed online planning algorithm is simple, scalable, and robust.
+
+# 4.1 LEARNING A LATENT SPACE
+
+Let us consider the following question: “How should we go about learning a latent space of goals where the metric reflects reachability?” Suppose we have an auto-encoder (AE) in the agent’s goal space, with deterministic encoder $f _ { E }$ and decoder $f _ { D }$ . As usual, the reconstruction loss is given by $\begin{array} { r } { \bar { \mathcal { L } } _ { r e c } ( g ) = \left\| f _ { D } \big ( f _ { E } ( g ) \big ) - g \right\| _ { 2 } ^ { 2 } } \end{array}$ . We want to make sure that the distance between two latent codes would roughly correspond to the number of steps it would take the policy to go from one goal to another. Concretely, for any pair of goals $( g _ { 1 } , g _ { 2 } )$ , we optimize the following loss:
+
+$$
+\mathcal { L } _ { l a t e n t } ( g _ { 1 } , g _ { 2 } ) = \Bigg ( \big \| f _ { E } ( g _ { 1 } ) - f _ { E } ( g _ { 2 } ) \big \| _ { 2 } ^ { 2 } - \frac { 1 } { 2 } \Big ( V ( g _ { 1 } , g _ { 2 } ) + V ( g _ { 2 } , g _ { 1 } ) \Big ) \Bigg ) ^ { 2 }
+$$
+
+Where $V : G \times G \to \mathbb { R } ^ { + }$ is a mapping that estimates how many steps it would take the policy $\pi$ to go from one goal to another goal on average. By adding this constraint and solving a joint optimization $\mathcal { L } _ { r e c } + \lambda \cdot \mathcal { L } _ { l a t e n t }$ , the encoding-decoding mapping can no longer be arbitrary, giving more structure to the latent space. Goals that are close by in terms of reachability will be naturally clustered in the latent space, and interpolations between latent codes will lead to meaningful results.
+
+Of course, the constraint in Equation 2 is quite meaningless if we do not have a way to estimate the mapping $V$ . We will proceed towards this objective by noting the following interesting connection between multi-goal Q-functions and reachability. In the multi-goal RL framework considered in the background section, the reward is binary in nature. The agent receives a reward of $- 1$ until it reaches the goal, and then 0 when it reaches the desired goal. In this setting, the Q-function is implicitly estimating the number of steps it takes to reach the goal $g$ from the current state $s$ after the action $a$ is taken. Denote this quantity as $D ( s , a , g )$ , the Q-function can be re-written as:
+
+$$
+Q ( s , a , g ) = \sum _ { t = 0 } ^ { D ( s , a , g ) - 1 } \gamma ^ { t } \cdot ( - 1 ) + \sum _ { t = D ( s , a , g ) } ^ { T - 1 } \gamma ^ { t } \cdot 0 = - \frac { 1 - \gamma ^ { D ( s , a , g ) } } { 1 - \gamma }
+$$
+
+Choosing to parameterize Q-functions in this way disentangles the effect of $\gamma$ on multi-goal Qlearning. It also provides us with access the direct distance estimation function $D ( s , a , g )$ . We note
+
+that this distance is not a mathematical distance in the sense of a metric. Instead, we use the word distance to refer to the number of steps the policy $\pi$ needs to take in the environment.
+
+Given our tractable estimate of $D$ , it is now a straightforward matter to estimate the desired quantity $V$ , which approximates how many steps it takes the policy to transition between goals. To get the desired estimate, we regress $V$ towards $D$ as follows
+
+$$
+\displaystyle \operatorname* { m i n } _ { V } \mathbb { E } _ { \tau \sim B , t \sim \{ 0 \cdots T - 1 \} } \Biggl ( D \bigl ( s _ { t } , a _ { t } , \Psi ( s _ { k } ) \bigr ) - V \bigl ( \Psi ( s _ { t + 1 } ) , \Psi ( s _ { k } ) \bigr ) \Biggr ) ^ { 2 }
+$$
+
+where $\Psi$ is given by the environment to map the states to the goal space. One crucial detail is the use of $\Psi ( s _ { t + 1 } )$ rather than $\Psi ( s _ { t } )$ in the inputs to $V$ . This is due to the fact that $D : S \times A \times G \to \mathbb { R }$ outputs the number of steps to go after an action is taken, when the state has transitioned into $s _ { t + 1 }$ . The objective above provides an unbiased estimate of the average number of steps between two goals.
+
+The estimates $D$ and $V$ will prove useful beyond helping to optimize the auto-encoder in Equation 2.
+They will prove essential in weighting and planning over latent landmark nodes in Section 4.3.
+
+# 4.2 LEARNING LATENT LANDMARKS
+
+Planning on a graph can be expensive, as the number of edges can grow quadratically with the number of nodes. To battle this issue in scalability, we use the constrained latent space to learn a sparse set of landmarks. A landmark can be thought of as a waypoint that the agent can pass through enroute to achieve a desired goal. Ideally, goals that are easily reachable from one another should be grouped to form one single landmark. Since our latent representation captures the temporal reachability between goals, this can be achieved by doing clustering in the latent space. The cluster centroids, when decoded from the decoder, will be precisely the latent landmarks we are seeking.
+
+Clustering proceeds as follows. For $N$ clusters to be learned, we define a mixture of Gaussians in the latent space with $N$ trainable latent centroids, $\{ \mathbf { c } _ { 1 } \cdots \mathbf { c } _ { N } \}$ , and a shared trainable variance vector $\pmb { \sigma }$ We maximize the evidence lower bound (ELBO) with a uniform prior $p ( \mathbf { c } )$ :
+
+$$
+\log p \Big ( z = f _ { E } ( g ) \Big ) \ge \mathbb { E } _ { q ( \mathbf { c } \mid z ) } \Big [ \log p ( z \mid \mathbf { c } ) \Big ] - D _ { K L } \Big ( q ( \mathbf { c } \mid z ) \mid \mid p ( \mathbf { c } ) \Big )
+$$
+
+Ideally, we would like each batch of data given to the latent clustering model to be representative of the whole replay buffer, such that the centroids will quickly learn to scatter out. To this end, we propose to use the Greedy Latent Sparsification (GLS) algorithm (Algorithm 2 in the Appendix) on each batch of data sampled from the replay before taking a gradient step with the batch. GLS is inspired by kmeans $^ { + + }$ (Arthur & Vassilvitskii, 2007), with several key differences: this sparsification process is used for both training and initialization, it uses a neural metric for determining the distance between data points, and that it is compatible with mini-batch-style gradient-based training.
+
+# 4.3 PLANNING WITH LATENT LANDMARKS
+
+Having derived a latent encoding algorithm and an algorithm for learning latent landmarks, we at last turn our attention to planning. While prior works simply solve for the shortest path, we employ a soft version of the Floyd algorithm, where the soft relaxation operations can be seen as a soft value iteration procedure (see Equation 7 in the Appendix).
+
+To construct a weight matrix that at first provides a raw distance estimate between latent landmarks, we begin by decoding the learned centroids in the latent space into the nodes in the graph $\{ f _ { D } ( \mathbf { c } _ { 1 } ) \cdot \cdot \cdot \bar { f _ { D } } ( \mathbf { c } _ { N } ) \}$ . To build the graph, we add two edges directed in reverse orders for every pair of latent landmarks. For instance, for an edge going from $f _ { D } ( \mathbf { c } _ { i } )$ to $f _ { D } ( \mathbf { c } _ { j } )$ , the weight on that edge is $- V ( f _ { D } ( { \bf c } _ { i } ) , f _ { D } ( { \bf c } _ { j } ) )$ . Notice that the distances are negated to be negative. At the start of an episode, the agent receives a goal $g$ , and we construct the following matrix of size $( N + 1 ) \times ( N + 1 ) ^ { \top }$ :
+
+$$
+W = \left( \begin{array} { c c c c } { { 0 } } & { { \ldots } } & { { - V ( f _ { D } ( \mathbf { c } _ { 1 } ) , f _ { D } ( \mathbf { c } _ { N } ) ) } } & { { - V ( f _ { D } ( \mathbf { c } _ { 1 } ) , g ) } } \\ { { \vdots } } & { { \ddots } } & { { \vdots } } & { { \vdots } } \\ { { - V ( f _ { D } ( \mathbf { c } _ { N } ) , f _ { D } ( \mathbf { c } _ { 1 } ) ) } } & { { \ldots } } & { { 0 } } & { { - V ( f _ { D } ( \mathbf { c } _ { N } ) , g ) } } \\ { { - \infty } } & { { \ldots } } & { { - \infty } } & { { 0 } } \end{array} \right)
+$$
+
+
+Figure 3: For both Point and Ant, during training, the initialization state distribution and the goal proposal distribution are uniform around the maze. During test time, the agent is asked to traverse the longest path in the maze. The success rate on the test environment is reported in Figure 4. This environment demonstrates $L ^ { 3 } P$ ’s ability to generalize to longer horizon goals during test time.
+
+# Algorithm 1 Online Planning in $L ^ { 3 } P$
+
+Given: Environment env, initial state $s$ , goal $g$
+
+1: $\mathrm { { C n t } = 0 }$ . Sub $\Game = \mathbb { N } \mathrm { o n e }$ .
+2: Solve for $d _ { c g }$ with graph search.
+3: for $t = 1$ to $T$ do $\triangleright$ One episode
+4: if Cnt $\geq 1 . 0$ then
+5: $\mathtt { C n t } = \mathtt { C n t } - 1$
+6: else . We do not re-plan at every step
+7: Calculate ds→c.
+8: d ← ds→c + dc→g
+9: if SubG 6= None then
+10: $d [ \mathrm { { S u b G } ] - \infty }$
+11: end if . Remove the immediate
+previous landmark
+12: SubG, Cnt ← arg max d, − max d
+13: end if
+14: $a \sim \pi ( s , \mathtt { S u b G } )$ ; $s \gets \in \mathrm { n v }$ .step(a).
+15: end for
+
+For online planning, when the agent receives a goal at the start of an episode, we use graph search to solve for $d _ { c g }$ (which is fixed throughout an episode). For an observation state $s$ , the algorithm calculates $d _ { s c }$ :
+
+$$
+\begin{array} { r } { d _ { s c } = ( \begin{array} { c } { - D \big ( s , \pi ( s , f _ { D } ( \mathbf { c } _ { 1 } ) ) , f _ { D } ( \mathbf { c } _ { 1 } ) \big ) } \\ { \vdots } \\ { - D \big ( s , \pi ( s , f _ { D } ( \mathbf { c } _ { N } ) ) , f _ { D } ( \mathbf { c } _ { N } ) \big ) } \\ { - D \big ( s , \pi ( s , g ) , g \big ) } \end{array} ) } \end{array}
+$$
+
+The chosen landmark is subgoal $\gets$ arg $\operatorname* { m a x } ( d _ { s \to c } + d _ { c \to g } )$ . To further provide temporal abstraction and robustness, the agent will be asked to consistently pursue subgoal for $- d _ { s c } [ \mathsf { s u b g o a l } ]$ number of steps, which is how many steps it thinks it will need. The proposed goal does not change during this period.
+
+The algorithm makes sure that the agent does not re-plan at every step, and this mechanism for temporal abstraction is crucial to its robustness. After this many steps, the agent will decide on the next landmark to pursue by re-calculating $d _ { s c }$ , but the immediate previous landmark will not be considered as a candidate landmark. The reason is that, if the agent has failed to reach a self-proposed landmark within the reachability limit it has set for itself, then the agent should try something new for the immediate next goal rather than stick to the immediate previous landmark for another round. We have found that this simple algorithm helps the agent avoid getting stuck and improves the overall robustness of the agent.
+
+In summary, we have derived an algorithm that learns a sparse set of latent landmarks scattered across goal space in terms of reachability, and uses those learned landmarks for robust planning.
+
+# 5 EXPERIMENTS AND EVALUATION
+
+We investigate the impact of $L ^ { 3 } P$ in a variety of robotic manipulation and navigation environments. These include standard benchmarks such as Fetch-PickAndPlace, and more difficult environments such as AntMaze-Hard and Place-Inside-Box that have been engineered to require test-time generalization. Videos of our algorithm in action are available here: https: //sites.google.com/view/latent-landmarks/.
+
+# 5.1 BASELINES
+
+We compare our method with a variety of baselines. HER (Andrychowicz et al., 2017) is a model-free RL algorithm. SORB (Eysenbach et al., 2019) is a method that combines RL and graph search by using the entire replay buffer. Mapping State Space (MSS Huang et al. 2019) reduces the number
+
+
+Figure 4: Test time success rate vs. total number of timesteps, on maze and robotic manipulation environments. During test time, new more difficult goals are selected. $L ^ { 3 } P$ shows more robust generalization much more quickly than other methods. For every environment except PointmMaze, $\bar { L } ^ { 3 } P$ is the only algorithm that consistently solves the task.
+
+
+Figure 5: Visualizing planning on AntMaze at test time. Read images from upper left to bottom right. The blue dots are the learned latent landmarks decoded from the latent centroids. The orange dot represents the ant’s present location in the maze. The red dot is the final goal that the agent needs to reach. At each step, the blue star indicates the landmark chosen by our planning algorithm. Whereas MSS and SORB sample 400 and hundreds of thousands of landmarks (respectively), our method obtains a lean graph that only contain 50 landmarks. $L ^ { 3 } P$ is the only method capable of achieving over $80 \%$ test success rate on AntMaze-Hard within 3M timesteps.
+
+
+Figure 6: We consider two environments involving a fetch robot, a block, and a box. In Box-asidePickAndPlace, the fetch must learn to pick and place the block while avoiding collision with the box. In Place-Inside-Box, the fetch must pick the block and place it inside the box. We visualize the fetch states corresponding to learned landmarks in the second row of images.
+
+of vertices by sub-sampling the replay buffer. $L ^ { 3 } P$ , SORB, and MSS all use the same hindsight relabelling strategy proposed in HER. All of the domains are continuous control tasks, so we adopt DDPG (Lillicrap et al., 2015) as the learning algorithm for the low-level actor.
+
+# 5.2 GENERALIZATION TO LONGER HORIZONS
+
+The PointMaze-Hard and AntMaze-Hard environments introduced in Figure 5 are designed to test an agent’s ability to generalize to longer horizons. While PointMaze and AntMaze have been previously used in Duan et al. (2016); Huang et al. (2019); Pitis et al. (2020), we make slight changes to those environments in order to increase their difficulty. We use a short, 200-timestep time horizon during training and a $\rho _ { 0 }$ that is uniform in the maze. At test time, we always initialize the agent on one end of the maze, and set the goal on the other end. The horizon of the test environment is 500 steps. Crucially, no prior knowledge on the shape of the maze is given to the agent. We also set a much stricter threshold for determining whether an agent has reached the goal. In Figure 4, we see $L ^ { 3 } P$ is the only algorithm capable of solving AntMaze-Hard consistently.
+
+We observe an interesting trend where the success rates for other graph search methods crash and then slowly recover after making some initial progress. We postulate this occurs because methods that are based on using the entire replay or sub-sampling the replay for landmark selection will struggle as the buffer size increases. In contrast to these methods, $L ^ { 3 } \bar { P }$ does not exhibit such undesirable instability. The online planning algorithm in $L ^ { 3 } P$ , which effectively leverages temporal abstraction to improve robustness, also contributes to the asymptotic success rate. The result convincingly shows that, at least on the navigation tasks considered, $\bar { L } ^ { 3 } P$ is most effective at taking advantage of the problem’s inherent graph structure, and that learning latent landmarks is significantly more sample efficient and scalable than directly using or sub-sampling the replay buffer to build the graph.
+
+# 5.3 ROBOTIC MANIPULATION TASKS
+
+We also benchmark challenging robotic manipulations tasks with a Fetch robot introduced in Plappert et al. (2018); Andrychowicz et al. (2017). In Figure 6, we introduce two pick and place tasks involving a box on a table. In the Place-Inside-Box environment, we design a simple curriculum to cope with the difficulty of the task. During training, the goal distribution has $80 \%$ regular pick-and-place goals, enabling the agent to first learn how to fetch in general. Meanwhile, only $20 \%$ of the goals are inside the box, which is the harder part of the task. During testing, we evaluate the ability of the agent to pick the object from the table and place it inside the box. Our method achieves dominant performance in both learning speed and test-time generalization. We note that on those manipulation tasks considered, many prior planning methods hurt the performance of the model-free agent. Our method is the only one that is able to help the model-free agent learn faster and generalize better.
+
+# 5.4 UNDERSTANDING MODEL CHOICES IN $L ^ { 3 } P$
+
+We investigate $L ^ { 3 } P$ ’s sensitivity to different hyper-parameters and design choices via a set of ablation studies. More specifically, we study how the following factors affect the performance of $L ^ { 3 } P$ : number of latent landmarks, the choice of (online) planning algorithms, the choice of graph search algorithms, and edge cutoff threshold in graph search (a key hyper-parameter in the search module).
+
+The first question we try to understand is whether $L ^ { 3 } P$ is robust to the number of latent landmarks. In contrast to prior methods, $L ^ { 3 } P$ is able to learn the landmarks used for graph search from the agent’s own experience. We vary the number of learned landmarks in the challenging AntMaze-Hard environment, and we find that $L ^ { 3 } P$ is robust against a decreasing number of landmarks. This is expected, because the landmarks in the latent space of $L ^ { 3 } P$ will try to be equally scattered across the goal space according to the reachability metric. As the number of landmarks decreases, the learning procedure will automatically push the landmarks to be further away from one another.
+
+
+
+
+
+A key component in $L ^ { 3 } P$ is the online planning algorithm described in Algorithm 1. We find this algorithm to bear special importance to the good performance of $\dot { L ^ { 3 } } P$ . Our planning algorithm in $L ^ { 3 } P$ can take advantage of the temporal abstraction provided by the graph-structured world model. It does not re-plan at every step, but instead uses the reachability estimates to dynamically decide when to re-plan, striking a balance between adaptability and consistency in planning. This planner is also more tolerant of
+
+errors: it removes the immediate previous landmark when it re-plans, so that the agent will be less prone to getting stuck. A naive planner, on the other hand, simply re-calculates the shortest path at every step. The curve on the left shows that this planning algorithm is crucial to the success of $L ^ { 3 } P$ .
+
+The particular choice of graph search seems to have a small effect on the stability of learning. As explained Section 4.3 and Appendix A.2, we find that while employing the Floyd algorithm for graph search, a soft operation for relaxation leads to better stability during training. On the right, we show that a hard version of relaxation helps the agent take off faster but suffers from greater instability during policy improvement. The likely reason is that neural distance estimates are not entirely accurate, and in the presence of occasional bad edges, softmax in
+
+
+
+Equation 7 improves robustness. We therefore use soft relaxation in our graph search module.
+
+
+
+One of the most important hyper-parameters when combining RL with graph search is d max, the clipping threshold for the edges on the graph (Savinov et al., 2018a; Eysenbach et al., 2019; Huang et al., 2019; Laskin et al., 2020). The motivation for introducing this commonly used hyper-parameter is two-fold. Firstly, we only trust distance estimates when they are local. Secondly, we want the graph search module to produce sub-goals that are nearby. The d max value determines the maximum distance for each edge on the graph and masks out longer
+
+edges. One weakness of our current approach is that it is still quite sensitive to this hyper-parameter; a small change to $d$ max can have considerable impacts on learning. As this weakness is common to this class of approaches, we believe that further research is required to find other ways of encouraging search to be local. See Appendix A.2 for more details on implementing this clipping threshold.
+
+# 6 CLOSING REMARKS
+
+In this work, we introduce a way of learning graph-structured world models that endow agents with the ability to do temporally extended reasoning. The algorithm, $L ^ { 3 } P$ , learns a set of latent landmarks scattered across the goal space to enable scalable planning. We demonstrate that $L ^ { 3 } P$ achieves significantly better sample efficiency, higher asymptotic performance, and better generalization on a range of challenging robotic navigation and manipulation tasks. We hope that this work inspires more research in the direction of combining deep RL with classical planning.
+
+# REFERENCES
+
+Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in neural information processing systems, pp. 5048–5058, 2017.
+
+David Arthur and Sergei Vassilvitskii. k-means $^ { + + }$ : The advantages of careful seeding. Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 2007.
+
+Dane Corneil, Wulfram Gerstner, and Johanni Brea. Efficient model-based deep reinforcement learning with variational state tabulation. arXiv preprint arXiv:1802.04325, 2018.
+
+Remi Coulom. Efficient selectivity and backup operators in monte-carlo tree search. In ´ International conference on computers and games, pp. 72–83. Springer, 2006.
+
+Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in neural information processing systems, pp. 271–278, 1993.
+
+Edsger W Dijkstra et al. A note on two problems in connexion with graphs. Numerische mathematik, 1(1):269–271, 1959.
+
+James E Doran and Donald Michie. Experiments with the graph traverser program. Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, 294(1437):235–259, 1966.
+
+Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pp. 1329–1338, 2016.
+
+Hugh Durrant-Whyte and Tim Bailey. Simultaneous localization and mapping: part i. IEEE robotics & automation magazine, 13(2):99–110, 2006.
+
+Ben Eysenbach, Russ R Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. In Advances in Neural Information Processing Systems, pp. 15246–15257, 2019.
+
+Gregory Farquhar, Tim Rocktaschel, Maximilian Igl, and Shimon Whiteson. Treeqn and atreec: ¨ Differentiable tree-structured models for deep reinforcement learning. October 2017. URL http://arxiv.org/abs/1710.11417.
+
+Sabine Gillner and Hanspeter A Mallot. Navigation and acquisition of spatial knowledge in a virtual maze. Journal of cognitive neuroscience, 10(4):445–463, 1998.
+
+David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems, pp. 2450–2462, 2018.
+
+Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning, pp. 2555–2565. PMLR, 2019.
+
+Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020.
+
+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.
+
+Zhiao Huang, Fangchen Liu, and Hao Su. Mapping state space using landmarks for universal goal reaching. In Advances in Neural Information Processing Systems, pp. 1942–1952, 2019.
+
+Michael Janner, Justin Fu, Marvin Zhang, and Sergey Levine. When to trust your model: Model-based policy optimization. In Advances in Neural Information Processing Systems, pp. 12519–12530, 2019.
+
+Tom Jurgenson, Or Avner, Edward Groshev, and Aviv Tamar. Sub-goal trees–a framework for goal-based reinforcement learning. arXiv preprint arXiv:2002.12361, 2020.
+
+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. arXiv preprint arXiv:1312.6114, 2013.
+
+Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. arXiv preprint arXiv:1802.10592, 2018.
+
+Michael Laskin, Scott Emmons, Ajay Jain, Thanard Kurutach, Pieter Abbeel, and Deepak Pathak. Sparse graphical memory for robust planning. arXiv preprint arXiv:2003.06417, 2020.
+
+Steven M LaValle. Rapidly-exploring random trees: A new tool for path planning. 1998.
+
+Lisa Lee, Emilio Parisotto, Devendra Singh Chaplot, Eric Xing, and Ruslan Salakhutdinov. Gated path planning networks. June 2018. URL http://arxiv.org/abs/1806.06408.
+
+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.
+
+Kara Liu, Thanard Kurutach, Christine Kit-Ching Tung, Pieter Abbeel, and Aviv Tamar. Hallucinative topological memory for zero-shot visual planning. ArXiv, 2019. URL https://www.semanticscholar.org/paper/ b8f0417844523d788630bb28a600dfeb74914e2d.
+
+Yuping Luo, Huazhe Xu, Yuanzhi Li, Yuandong Tian, Trevor Darrell, and Tengyu Ma. Algorithmic framework for model-based deep reinforcement learning with theoretical guarantees. arXiv preprint arXiv:1807.03858, 2018.
+
+Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3303–3313, 2018.
+
+Anusha Nagabandi, Gregory Kahn, Ronald S Fearing, and Sergey Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7559–7566. IEEE, 2018.
+
+Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Advances in Neural Information Processing Systems, pp. 9191–9200, 2018.
+
+Soroush Nasiriany, Vitchyr Pong, Steven Lin, and Sergey Levine. Planning with goal-conditioned policies. In Advances in Neural Information Processing Systems, pp. 14843–14854, 2019.
+
+Karl Pertsch, Oleh Rybkin, Frederik Ebert, Chelsea Finn, Dinesh Jayaraman, and Sergey Levine. Long-horizon visual planning with goal-conditioned hierarchical predictors. arXiv preprint arXiv:2006.13205, 2020.
+
+Silviu Pitis, Harris Chan, Stephen Zhao, Bradly Stadie, and Jimmy Ba. Maximum entropy gain exploration for long horizon multi-goal reinforcement learning. arXiv preprint arXiv:2007.02832, 2020.
+
+Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
+
+Vitchyr Pong, Shixiang Gu, Murtaza Dalal, and Sergey Levine. Temporal difference models: Modelfree deep rl for model-based control. arXiv preprint arXiv:1802.09081, 2018.
+
+Vitchyr H Pong, Murtaza Dalal, Steven Lin, Ashvin Nair, Shikhar Bahl, and Sergey Levine. Skew-fit: State-covering self-supervised reinforcement learning. arXiv preprint arXiv:1903.03698, 2019.
+
+Sebastien Racani ´ ere, Theophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo \` Jimenez Rezende, Adria Puigdom \` enech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, Razvan Pas- \` canu, Peter Battaglia, Demis Hassabis, David Silver, and Daan Wierstra. Imagination-augmented agents for deep reinforcement learning. 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. 5690–5701. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7152-imagination-augmented-agents-for-deep-reinforcement-learning. pdf.
+
+Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. arXiv preprint arXiv:1803.00653, 2018a.
+
+Nikolay Savinov, Anton Raichuk, Raphael Marinier, Damien Vincent, Marc Pollefeys, Timothy Lilli- ¨ crap, and Sylvain Gelly. Episodic curiosity through reachability. arXiv preprint arXiv:1810.02274, 2018b.
+
+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, 2016a.
+
+David Silver, Hado van Hasselt, Matteo Hessel, Tom Schaul, Arthur Guez, Tim Harley, Gabriel DulacArnold, David Reichert, Neil Rabinowitz, Andre Barreto, and Thomas Degris. The predictron: End-to-end learning and planning. December 2016b. URL http://arxiv.org/abs/1612. 08810.
+
+Aravind Srinivas, Allan Jabri, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Universal planning networks. April 2018. URL http://arxiv.org/abs/1804.00645.
+
+Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160–163, 1991.
+
+Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. February 2016. URL http://arxiv.org/abs/1602.02867.
+
+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.
+
+Ranxiao Frances Wang and Elizabeth S Spelke. Human spatial representation: Insights from animals. Trends in cognitive sciences, 6(9):376–382, 2002.
+
+Tingwu Wang and Jimmy Ba. Exploring model-based planning with policy networks. arXiv preprint arXiv:1906.08649, 2019.
+
+Yang Wang, David Mulvaney, Ian Sillitoe, and Erick Swere. Robot navigation by waypoints. Journal of Intelligent and Robotic Systems, 52(2):175–207, 2008.
+
+Ge Yang, Amy Zhang, Ari S. Morcos, Joelle Pineau, Pieter Abbeel, and Roberto Calandra. Plan2vec: Unsupervised representation learning by latent plans. In Proceedings of The 2nd Annual Conference on Learning for Dynamics and Control, volume 120 of Proceedings of Machine Learning Research, pp. 1–12, 2020. arXiv:2005.03648.
+
+Rui Zhao, Xudong Sun, and Volker Tresp. Maximum entropy-regularized multi-goal reinforcement learning. arXiv preprint arXiv:1905.08786, 2019.
+
+# A APPENDIX
+
+A.1 GREEDY LATENT SPARSIFICATION
+
+Algorithm 2 Greedy Latent Sparsification (GLS) for Latent Cluster Training Given: Replay Buffer $B$ , Encoder $f _ { E }$ .
+Initialize: LatentEmbeds $= \{ \}$ . $\triangleright$ Set of embeddings selected. 1: Sample $K$ achieved goals from $B$ .
+2: Sample $k \sim \{ 0 \cdots K - 1 \}$ .
+3: dist $= [ \| f _ { E } ( g _ { 1 } ) - f _ { E } ( \bar { g } _ { k } ) \| _ { 2 } ^ { 2 } , \cdot \cdot \cdot , \| f _ { E } ( g _ { K } ) - f _ { E } ( g _ { k } ) \| _ { 2 } ^ { 2 } ]$
+4: for $\mathrm { i } = 1$ to $M$ do . Sub-sampling 5: $k $ arg max dist $[ k ]$
+6: Add $f _ { E } ( g _ { k } )$ to LatentEmbeds.
+7: NEWdist = [kfE(g1) − fE(gk)k22, · · · , kfE(gK ) − fE(gk)k22] 8: dist = ElementwiseMin(dist, NEWdist)
+9: end for
+10: Optimize equation 5 on LatentEmbeds.
+
+The Greedy Latent Sparsification (GLS) algorithm sub-samples a large batch by sparsification. GLS first randomly selects a latent embedding from the batch, and then greedily chooses the next embedding that is furthest away from already selected embeddings. After collecting some warm-up trajectories before planning starts (see Table 2) during training, we first use GLS to initialize the latent centroids, and then continue to use it to sample the batches used to train the latent clusters. As mentioned in Section 4.2, GLS is strongly inspired by Arthur & Vassilvitskii (2007), and this type of approach is known to improve clustering.
+
+# A.2 GRAPH SEARCH VIA SOFT VALUE ITERATIONS
+
+In this paper, we employ a soft version of Floyd algorithm, which we find to empirically work well. Rather than simply using the min operation to do relaxation, the soft value iteration procedure uses a sof t min operation when doing an update (note that, since we negated the distances to be negative in the weight matrix of the graph, which is Equation 6, the operations we use are actually max and softmax). The reason is that neural distances can be inconsistent and inaccurate at times, and using a soft operation makes the whole procedure more robust. More concretely, we repeat the following update on the weight matrix for $S$ steps with temperature $\beta$ :
+
+$$
+w _ { i , j } \gets \sum _ { k = 1 } ^ { N + 1 } \frac { \exp \frac { 1 } { \beta } ( w _ { i , k } + w _ { k , j } ) } { \sum _ { k ^ { \prime } = 1 } ^ { N + 1 } \exp \frac { 1 } { \beta } ( w _ { i , k ^ { \prime } } + w _ { k ^ { \prime } , j } ) } \Big ( w _ { i , k } + w _ { k , j } \Big )
+$$
+
+Following the practice in Eysenbach et al. (2019); Huang et al. (2019), we do the following initialization to the matrix in Equation 6: for entries smaller than the negative of $d _ { - } m a x$ , we penalize the entry by adding $- \infty$ to it (in this paper, we use $- 1 0 ^ { 6 }$ as the $- \infty$ value). The essential idea is that we only trust a neural estimate when it is local, and we rely on graph search to solve for global, longer-horizon distances. The $- \infty$ penalty effectively masks out those entries with large negative values in the softmax operation above. If we replace softmax with a hard max, we recover the original update in Floyd algorithm; we can interpolate between a hard Floyd and a soft Floyd by tuning the temperature $\beta$ .
+
+# A.3 HYPER-PARAMETERS
+
+Table 1 lists the common hyper-parameters across all environments. Table 2 lists the hyper-parameters that differ across the environments.
+
+Table 1: Hyper-parameters in Common
+
+
Parameter
Value
DDPGoptimizernumber of hidden layers (all networks)number of hidden units per layernonlinearitypolyak for target network(T)target update intervalratio between env vs optimization stepsRandom action probabilityInitial random trajs per workerHindsight relabelling ratio
Adam (Kingma & Ba, 2014)3256ReLU0.9951020.21000.85
256
LatentLandmarks&Auto-encodernumber of hidden layersnumber of hidden units per layernonlinearityembedding size入 for reachability constraint losslearning rate
2128ReLU161.03e-4
Graph Searchprobability of using search during trainS (number of soft value iterations)β (temperature)
0.5201.1
+
+Table 2: Hyper-parameters for Each Environment
+
+
Point-Maze Ant-Maze
DDPG
Learning rate
2e-4
2e-4
1e-3 12
Number of workers Batch size
1 512
3 1024
1024
Action L2
0.5
0.05
0.01
Gamma
0.98
0.98
0.99
Action noise
0.2
0.2
0.1
Hindsight relabelling range
80
100
50
LatentLandmarks&Auto-encoder
Number of latent landmarks
50
50
80
Number of warm-up trajectories
500
500
6000
Batch size
256
256
150
Graph Search
d_max (clipping threshold for distances)
20.0
20.0
15.0
Random landmarks added during train
150
150
20
+
+• We find that having a centralized replay for all parallel workers is significantly more sample efficient than having separate replays for each worker and simply averaging the gradients across workers.
+• For Ant-Maze environment, we do grad norm clipping by a value of 15.0 for all networks. For Fetch tasks, we normalize the inputs by running means and standard deviations per input dimensions.
+• Since $L ^ { 3 } P$ is able to decompose a long-horizon goal into many short-horizon goals, we shorten the range of future steps where we do hindsight relabelling; as a result, the agent can focus its optimization effort on more immediate goals. This corresponds to the hyperparameter: Hindsight relabelling range.
+• During training, we collect $5 0 \%$ of the data without the planning module, and the other $5 0 \%$ of the data with planning. This corresponds to the hyper-parameter: probability of using search during train.
+• At train time, to encourage exploration during planning, we temporarily add a small number of random landmarks from GLS (Algorithm 2) to the existing latent landmarks. A new set of random landmarks is selected for each episode before graph search starts (Algorithm 1). This corresponds to the hyper-parameter: Random landmarks added during train.
+• We find that collecting a certain number of warm-up trajectories for every worker before the planning procedure starts (during training) and before GLS (Algorithm 2) is used for initialization to help improve the planning results. This corresponds to the hyper-parameter: Number of warm-up trajectories.
\ No newline at end of file
diff --git a/md/train/4ADnf1HqIw/4ADnf1HqIw.md b/md/train/4ADnf1HqIw/4ADnf1HqIw.md
new file mode 100644
index 0000000000000000000000000000000000000000..67e3e89f826345c5865ba75bf8ba664f57035601
--- /dev/null
+++ b/md/train/4ADnf1HqIw/4ADnf1HqIw.md
@@ -0,0 +1,276 @@
+# RECOVERING GEOMETRIC INFORMATION WITH LEARNED TEXTURE PERTURBATIONS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Regularization is used to avoid overfitting when training a neural network; unfortunately, this reduces the attainable level of detail hindering the ability to capture high-frequency information present in the training data. Even though various approaches may be used to re-introduce high-frequency detail, it typically does not match the training data and is often not time coherent. In the case of network inferred cloth, these sentiments manifest themselves via either a lack of detailed wrinkles or unnaturally appearing and/or time incoherent surrogate wrinkles. Thus, we propose a general strategy whereby high-frequency information is procedurally embedded into low-frequency data so that when the latter is smeared out by the network the former still retains its high-frequency detail. We illustrate this approach by learning texture coordinates which when smeared do not in turn smear out the high-frequency detail in the texture itself but merely smoothly distort it. Notably, we prescribe perturbed texture coordinates that are subsequently used to correct the over-smoothed appearance of inferred cloth, and correcting the appearance from multiple camera views naturally recovers lost geometric information.
+
+# 1 INTRODUCTION
+
+Since neural networks are trained to generalize to unseen data, regularization is important for reducing overfitting, see e.g. Goodfellow et al. (2016); Scholkopf & Smola (2001). However, regularization also removes some of the high variance characteristic of much of the physical world. Even though high-quality ground truth data can be collected or generated to reflect the desired complexity of the outputs, regularization will inevitably smooth network predictions. Rather than attempting to directly infer highfrequency features, we alternatively propose to learn a low-frequency space in which such features can be embedded.
+
+We focus on the specific task of adding highfrequency wrinkles to virtual clothing, noting that the idea of learning a low-frequency embedding may be generalized to other tasks. Because cloth wrinkles/folds are high-frequency features,
+
+
+Figure 1: Texture coordinate perturbations (texture sliding) reduce shape inference errors: ground truth (blue), prediction (orange).
+
+existing deep neural networks (DNNs) trained to infer cloth shape tend to predict overly smooth meshes Alldieck et al. (2019a); Daneˇˇrek et al. (2017); Guan et al. (2012); Gundogdu et al. (2019); Jin et al. (2020); Lahner et al. (2018); Natsume et al. (2019); Santesteban et al. (2019); Wang et al. (2018); Patel et al. (2020). Rather than attempting to amend such errors directly, we perturb texture so that the rendered cloth mesh appears to more closely match the ground truth. See Figure 1. Then given texture perturbations from at least two unique camera views, 3D geometry can be accurately reconstructed Hartley & Sturm (1997) to recover high-frequency wrinkles. Similarly, for AR/VR applications, correcting visual appearance from two views (one for each eye) is enough to allow the viewer to accurately discern 3D geometry. Our proposed texture coordinate perturbations are highly dependent on the camera view. Thus, we demonstrate that one can train a separate texture sliding neural network (TSNN) for each of a finite number of cameras laid out into an array and use nearby networks to interpolate results valid for any view enveloped by the array. Although an approach similar in spirit might be pursued for various lighting conditions, this limitation is left as future work since there are a great deal of applications where the light is ambient/diffuse/non-directional/etc. In such situations, this further complication may be ignored without significant repercussion.
+
+# 2 RELATED WORK
+
+Cloth: While physically-based cloth simulation has matured as a field over the last few decades Baraff & Witkin (1998); Baraff et al. (2003); Bridson et al. (2002; 2003); Selle et al. (2008), datadriven methods are attractive for many applications. There is a rich body of work in reconstructing cloth from multiple views or 3D scans, see e.g. Bradley et al. (2008b); Franco et al. (2006); Vlasic et al. (2008). More recently, optimization-based methods have been used to generate higher resolution reconstructions Huang et al. (2015); Pons-Moll et al. (2017); Wu et al. (2012); Yang et al. (2016). Some of the most interesting work focuses on reconstructing the body and cloth separately Balan & ˘ Black (2008); Neophytou & Hilton (2014); Yang et al. (2018); Zhang et al. (2017). With advances in deep learning, one can aim to reconstruct 3D cloth meshes from single views. A number of approaches reconstruct a joint cloth/body mesh from a single RGB image Alldieck et al. (2019a;b); Natsume et al. (2019); Onizuka et al. (2020); Saito et al. (2019; 2020), RGB-D image Yu et al. (2019), or video Alldieck et al. (2018a;b); Habermann et al. (2019); Xu et al. (2018). To reduce the dimensionality of the output space, DNNs are often trained to predict the pose/shape parameters of human body models such as SCAPE Anguelov et al. (2005) or SMPL Loper et al. (2015) (see also Pavlakos et al. (2019)). Habermann et al. (2019); Natsume et al. (2019); Varol et al. (2018) leverage predicted pose information to infer shape. When only the garment shape is predicted, a number of recent works output predictions in UV space to represent geometric information as pixels Daneˇˇrek et al. (2017); Jin et al. (2020); Lahner et al. (2018), although others Gundogdu et al. (2019); Santesteban et al. (2019); Patel et al. (2020) define loss functions directly in terms of the 3D cloth vertices.
+
+Wrinkles and Folds: Cloth realism can be improved by introducing wrinkles and folds. In the graphics community, researchers have explored both procedural and data-driven methods for generating wrinkles De Aguiar et al. (2010); Guan et al. (2012); Hahn et al. (2014); Müller & Chentanez (2010); Rohmer et al. (2010); Wang et al. (2010). Other works add real-world wrinkles as a postprocessing step to improve smooth captured cloth: Popa et al. (2009) extracts the edges of cloth folds and then applies space-time deformations, Robertini et al. (2014) solves for shape deformations directly by optimizing over all frames of a video sequence. Recently, Lahner et al. (2018) used a conditional Generative Adversarial Network Mirza & Osindero (2014) to generate normal maps as proxies for wrinkles on captured cloth.
+
+Geometry: More broadly, deep learning on 3D meshes falls under the umbrella of geometric deep learning, which was coined by Bronstein et al. (2017) to characterize learning in non-Euclidean domains. Scarselli et al. (2008) was one of the earliest works in this area and introduced the notion of a Graph Neural Network (GNN) in relation to CNNs. Subsequent works similarly extend the CNN architecture to graphs and manifolds Boscaini et al. (2016); Maron et al. (2017); Masci et al. (2015); Monti et al. (2017). Kostrikov et al. (2018) introduces a latent representation that explicitly incorporates the Dirac operator to detect principal curvature directions. Tan et al. (2018) trains a mesh generative model to generate novel meshes outside an original dataset. Returning to the specific application of virtual cloth, Jin et al. (2020) embeds a non-Euclidean cloth mesh into a Euclidean pixel space, making it possible to directly use CNNs to make non-Euclidean predictions.
+
+# 3 METHODS
+
+We define texture sliding as the changing of texture coordinates on a per-camera basis such that any point which is visible from some stereo pair of cameras can be triangulated back to its ground truth position. Other stereo reconstruction techniques can also be used in place of triangulation because the images we generate are consistent with the ground truth geometry. See e.g. Bradley et al. (2008a); Hartley & Sturm (1997); Seitz et al. (2006).
+
+# 3.1 PER-VERTEX DISCRETIZATION
+
+Since the cloth mesh is discretized into vertices and triangles, we take a per-vertex, not a per-point, approach to texture sliding. Our proposed method (see Section 4.1) computes per-vertex texture coordinates on the inferred cloth that match those of the ground truth as seen by the camera under consideration. Then during 3D reconstruction, barycentric interpolation is used to find the subtriangle locations of the texture coordinates corresponding to ground truth cloth vertices. This assumes linearity, which is only valid when the triangles are small enough to capture the inherent nonlinearities in a piecewise linear sense; moreover, folds and wrinkles can create significant nonlinearity. See Figure 2.
+
+# 3.2 OCCLUSION BOUNDARIES
+
+Accurate 3D reconstruction requires that a vertex of the ground truth mesh be visible from at least two cameras and that camera projections of the vertex to the inferred cloth exist and are valid. However, occlusions can derail these assumptions.
+
+First, consider things from the standpoint of the inferred cloth. For a given camera view, some inferred cloth triangles will not contain any visible pixels, and we denote a vertex as occluded when none of its incident triangles contain any visible pixels. Although we do not assign perturbed texture coordinates to occluded vertices (i.e. they keep their original texture coordinates, or a perturbation of zero), we do aim to keep the texture coordinate perturbation function smooth (see Section 4.2). In addition, there will be so called non-occluded vertices in the inferred cloth that do not project to visible pixels of the ground truth cloth. This often occurs near silhouette boundaries where the inferred cloth silhouette is sometimes wider than the ground truth cloth silhouette. These vertices are also treated as occluded, similar to those around the back side of the cloth behind the silhouette, essentially treating some extra vertices near occlusion boundaries as also being occluded. See Figure 3a.
+
+Next, consider things from the standpoint of the ground truth cloth. For example, consider the case where all the cameras are in the front, and vertices on the back side of the ground truth cloth are not visible from any camera. The best one can do in reconstructing these occluded vertices is to use the inferred cloth vertex positions; however, care should be taken near occlusion boundaries to smoothly taper between our texture sliding 3D reconstruction and the inferred cloth prediction. A simple approach is to extrapolate/smooth the geometric difference between our texture sliding 3D reconstruction and the inferred cloth prediction to occluded regions of the mesh. Once again, the definition of occluded vertices needs to be broadened for silhouette consideration. Not only will vertices not visible from at least two cameras have to be considered occluded, but vertices that don’t project to the interior of an inferred cloth triangle with valid texture coordinate perturbations will also have to be considered occluded. See Figure 3b.
+
+
+Figure 2: Consider an extreme case, where the inferred cloth has a quite large triangle (shown in red). That triangle should encompass the nonlinear texture region outlined in yellow (shown in pattern space). Note: the yellow curve was generated by sampling the ground truth cloth’s texture coordinates along the projected edges of the red triangle. The linearity assumption implied by barycentric interpolation instead uses the region outlined in green.
+
+
+Figure 3: The method discussed in Section 4.1 can fail near silhouettes of the inferred and ground truth cloth meshes, in which case smoothness assumptions are used (see Section 4.2). In (a), inferred triangles with at least one vertex falling outside the silhouette of the ground truth mesh are colored red. In (b), ground truth triangles with at least one vertex falling outside the silhouette of the inferred mesh are colored blue.
+
+# 4 DATASET GENERATION
+
+Let $C = \{ X , T \}$ be a cloth triangulated surface with $n$ vertices $X \in \mathbb { R } ^ { 3 n }$ and texture coordinates $T \in \mathbb { R } ^ { 2 n }$ . We assume that mesh connectivity remains fixed throughout. The ground truth cloth mesh $C _ { G } ( \theta ) = \{ X _ { G } ( \theta ) , T _ { G } \}$ depends on the pose $\theta$ . Given a pre-trained DNN (we use the network from Jin et al. (2020)), the inferred cloth $C _ { N } ^ { \phantom { } } ( \theta ) = \{ X _ { N } ( \theta ) , T _ { G } \}$ is also a function of the pose $\theta$ . Our objective is to replace the ground truth texture coordinates $T _ { G }$ with perturbed texture coordinates $T _ { N } ( \boldsymbol { \theta } , \boldsymbol { v } )$ , i.e. to compute $\bar { C _ { N } ^ { \prime } } ( \theta , v ) = \{ X _ { N } ( \theta ) , T _ { N } ( \theta , v ) \}$ where $T _ { N } ( \boldsymbol { \theta } , \boldsymbol { v } )$ depends on both the pose $\theta$ and the view $v$ . Even though $T _ { N } ( \boldsymbol { \theta } , \boldsymbol { v } )$ is in principle valid for all $v$ using interpolation (see Section 6.3), training data $T _ { N } ( \theta , v _ { p } )$ is only required for a finite number of camera views $v _ { p }$ . For each camera $p$ , we also only require training data for finite number of poses $\theta _ { k }$ , i.e. we require $\dot { T } _ { N } ( \theta _ { k } , v _ { p } )$ , which is computed from $T _ { G }$ using $\bar { X _ { G } } ( \theta _ { k } )$ , $X _ { N } ( \theta _ { k } )$ , and $v _ { p }$ .
+
+# 4.1 TEXTURE COORDINATE PROJECTION
+
+We project texture coordinates to the inferred cloth vertices $X _ { N } ( \theta _ { k } )$ from the ground truth cloth mesh $C _ { G } ( \theta _ { k } )$ using ray intersection. For each inferred cloth vertex in $X _ { N } ( \theta _ { k } )$ , we cast a ray from camera $p$ ’s aperture through the vertex and find the first intersection with the ground truth mesh $C _ { G } ( \theta _ { k } )$ ; subsequently, $T _ { G }$ is barycentrically interpolated to the point of intersection and assigned to the inferred cloth vertex as its $T _ { N } ( \theta _ { k } , v _ { p } )$ value. See Figure 4. Rays are only cast for inferred cloth vertices that have at least one incident triangle with a nonzero area subregion visible to camera $p$ . Also, a ground truth texture coordinate value is only assigned to an inferred cloth vertex when the point of intersection with the ground truth mesh is visible to camera $p$ . We store and learn texture coordinate displacements $d _ { v _ { p } } ( \theta _ { k } ) = T _ { N } ( \theta _ { k } , v _ { p } ) - T _ { G }$ . Af
+
+
+Figure 4: Illustration of the ray intersection method for transferring texture coordinates to the inferred cloth from the ground truth cloth. Texture coordinates for the inferred cloth vertex (red cross) are interpolated from the ground truth mesh to the point of ray intersection (red circle).
+
+ter this procedure, any remaining vertices of the inferred cloth that have not been assigned $d _ { v _ { p } } ( \theta _ { k } )$ values are treated as occluded and handled via smoothness considerations as discussed in Section 4.2.
+
+# 4.2 OCCLUSION HANDLING
+
+Some vertices of the inferred cloth mesh remain unassigned with $d _ { v _ { v } } ( \theta _ { k } ) = 0$ after executing the algorithm outlined in Section 4.1. This creates a discontinuity in $\dot { d } _ { v _ { p } } ( \theta _ { k } )$ which excites high frequencies that require a more complex network architecture to capture. In order to alleviate demands on the network, we smooth $\bar { d } _ { v _ { p } } ( \theta _ { k } )$ as follows. First, we use the Fast Marching Method on triangulated surfaces Kimmel & Sethian (1998) to generate a signed distance field. Then, we extrapolate $d _ { v _ { p } } ( \theta _ { k } )$ normal to the distance field into the unassigned region, see e.g. Osher & Fedkiw (2002). Finally, a bit of averaging is used to provide smoothness, while keeping the assigned values of $d _ { v _ { p } } ( \theta _ { k } )$ unchanged. Alternatively, one could solve a Poisson equation as in Cong et al. (2015) while using the assigned $d _ { v _ { p } } ( \theta _ { k } )$ as Dirichlet boundary conditions.
+
+# 5 NETWORK ARCHITECTURE
+
+A separate texture sliding neural network (TSNN) is trained for each camera $p$ ; thus, we drop the $v _ { p }$ notation in this section. The loss is defined over all poses $\theta _ { k }$ in the training set
+
+$$
+\mathcal { L } = \sum _ { \theta _ { k } } \left\| d ( \theta _ { k } ) - \hat { d } ( \theta _ { k } ) \right\| _ { 2 }
+$$
+
+to minimize the difference between the desired displacements $d ( \theta _ { k } )$ and predicted displacements $\hat { d } ( \theta _ { k } )$ . The inferred cloth data we chose to correct are predictions of the T-shirt meshes from Jin et al. (2020), each of which contains about 3,000 vertices. The dataset spans about 10,000 different poses generated from a scanned garment using physically-based simulation, and includes texture coordinates for the garment mesh. To improve the resolution, we up-sampled each cloth mesh by subdividing each triangle into four subtriangles. Notably, our texture sliding approach can be used to augment the results of any dataset for which ground truth and inferred training examples are available. Moreover, it is trivial to increase the resolution of any such dataset simply by subdividing triangles. Note that perturbations of the subdivided geometry are unnecessary, as we merely desire more sample points (to address Figure 2). Finally, we applied an 80-10-10 training-validation-test set split.
+
+Similar to Jin et al. (2020), the displacements $d ( \theta _ { k } )$ are stored as pixel-based cloth images for the front and back sides of the T-shirt, though we still output per-vertex texture coordinate displacements in UV space. See Figure 5 for an overview of the network architecture. Given input joint transformation matrices of shape $1 \times 1 \times 9 0$ , TSNN applies a series of transpose convolution, batch normalization, and ReLU activation layers to upsample the input to $5 1 2 \times 5 1 2 \times 4$ . The first two dimensions of the output tensor represent the predicted displacements for the front side of the T-shirt, and the remaining two dimensions represent those for the back side.
+
+
+Figure 5: Texture sliding neural network (TSNN) architecture.
+
+# 6 EXPERIMENTS
+
+In Section 6.1, we quantify the data generation approach of Section 4 and highlight the advantages of mesh subdivision for up-sampling. In Section 6.2, we evaluate the predictions made by our trained texture sliding neural network (TSNN). In Section 6.3, we demonstrate the interpolation of texture sliding results to novel views between a finite number of cameras. Finally, in Section 6.4, we use multi-view texture sliding to reconstruct 3D geometry.
+
+# 6.1 DATASET GENERATION AND EVALUATION
+
+We aim to have the material coordinates of the cloth be in the correct locations as viewed by multiple cameras, so that the material can be accurately 3D reconstructed with point-wise accuracy. As such, our error metric is a bit more stringent than that commonly used because our aim is to reproduce the actual material behavior, not merely to mimic its look (e.g. , by perturbing normal vectors to create shading consistent with wrinkles in spite of the cloth being smooth, as in Lahner et al. (2018)). In order to elucidate this, consider a two-step approach where one first approximates a smooth cloth mesh and then perturbs that mesh to add wrinkles (similar to Santesteban et al. (2019)). In order to preserve area and achieve the correct material behavior, material in the vicinity of a newly forming wrinkle should slide laterally towards that wrinkle as it is formed. Merely non-physically stretching the material in order to create a wrinkle may look plausible, but does not admit the correct material behavior. In fact, the texture would be unrealistically stretched as well, although this is less apparent visually when using simple textures.
+
+Since texture coordinates provide a proxy surface parameterization for material coordinates, we measure texture coordinate errors in a per-pixel fashion comparing between the ground truth and inferred cloth at the center of each pixel. Figure 6a shows results typical for cloth inferred using the network from Jin et al. (2020), and Figure 6b shows the highly improved results obtained on the same inferred geometry using our texture sliding approach (with 1 level of subdivision). Note that the vast majority of the errors in Figure 6b occur near the wrinkles where the nonlinearities illustrated in Figure 2 are most prevalent. In Figure 6c, we deform the vertices of the inferred cloth mesh so that they lie exactly on the ground truth mesh in order to mimic a two-step approach (as discussed above). Note how our error metric captures the still rather large errors in the material coordinates (and thus cloth vertex positions) in spite of the mesh in Figure 6c appearing to have the same wrinkles and folds as the ground truth mesh. Figure 7 compares the local compression and extension energies of the ground truth mesh (Figure 7a), the inferred cloth mesh (Figure 7b), and the result of this two-step process (Figure $\mathrm { 7 c }$ ). In spite of the untextured mesh in Figure 7c bearing visual similarity to the ground truth in Figure 7a, it still has rather large errors in deformation energy.
+
+
+Figure 6: Per-pixel texture coordinate errors before (a) and after (b) applying texture sliding to the inferred cloth output by the network of Jin et al. (2020). The result of a two-step process (c) may well match the ground truth in a visual sense, whilst still having quite large errors in material coordinates. Blue $= 0$ , red $\geq 0 . 0 4$ .
+Figure 7: Local compression (blue) and extension (red) energies for a sample pose, comparing the ground truth cloth (a), the inferred cloth (b), and the result of a two-step process (c). In spite of the cloth mesh in (c) bearing visual resemblance to the ground truth in (a), it still has quite erroneous deformation energies.
+
+Figure 8 illustrates the efficacy of subdividing the cloth mesh to get more samples for texture sliding. The particular ground truth cloth wrinkle shown in Figure 8e is not captured by the inferred cloth geometry shown in Figure 8a. The texture sliding result shown in Figure 8b better represents the ground truth cloth. Figures 8c and 8d show how subdividing the inferred cloth mesh one and two times (respectively) progressively alleviates errors emanating from the linearity assumption illustrated in Figure 2. Table 1 shows quantitative results comparing the inferred cloth to texture sliding with and without subdivision.
+
+Table 1: Per-pixel square root of mean squared error (SqrtMSE) for the entire dataset.
+
+
Method
SqrtMSE(×10 3)
Jin et al. (2020) TS
24.496± 6.9536 5.2662 士 2.2320
TS + subdivision
3.5645 士 1.6617
+
+
+Figure 8: As the inferred cloth mesh (a) is subdivided, texture sliding (b-d) moves the inferred mesh’s appearance closer to the ground truth (e).
+
+# 6.2 NETWORK TRAINING AND INFERENCE
+
+The network was trained using the Adam optimizer Kingma & Ba (2014) with a $1 0 ^ { - 3 }$ learning rate in PyTorch Paszke et al. (2017). As mentioned earlier, we subdivided the mesh triangles once. Figure 9 shows a typical prediction on a test set example, including the per-pixel errors in predicted texture coordinates. While the TSNN is able to recover the majority of the shirt, it struggles near wrinkles. Figure 10 highlights a particular wrinkle comparing the inferred cloth (Figure 10a) and the results of the TSNN before (Figure 10b) and after (Figure 10c) subdivision to the ground truth (Figure 10d). Table 2 shows quantitative results comparing the inferred cloth to TSNN results with and without subdivision.
+
+
+Figure 9: A typical test set example prediction. (a) $\hat { C } _ { N } ^ { \prime }$ ) . $C _ { N } ^ { \prime }$ . (c) Per-pixel errors (blue $= 0$ , red $\geq 0 . 0 4 )$
+
+Table 2: Per-pixel SqrtMSE for the test set. Inspite of Table 1 demonstrating that subdivision improves the ground truth TS data, the improvements are not uniformly realized by the TSNN (which we discuss in the supplemental material).
+
+
Network
SqrtMSE(×10 3)
Jin et al. (2020) TSNN TSNN + subdivision
24.871 士 7.0613 13.335 士 4.2924 13.591 士 4.5194
+
+
+Figure 10: The results of the TSNN before (b) and after (c) subdivision, as compared to the ground truth (d). In spite of Table 2, some wrinkles are better resolved by the TSNN after subdivision. The inferred mesh with ground truth texture coordinates is shown in (a).
+
+# 6.3 INTERPOLATING TO NOVEL VIEWS
+
+Given a finite number of camera views $v _ { p }$ , one can specify a new view enveloped by the array using a variety of interpolation methods. For the sake of demonstration, we take a simple approach assuming that one can interpolate via $\begin{array} { r } { \boldsymbol { v } = \sum _ { p } w _ { p } \boldsymbol { v } _ { p } } \end{array}$ , and then use these same weights to compute $\begin{array} { r } { T _ { N } ( \theta _ { k } , v ) = \sum _ { p } w _ { p } T _ { N } ( \theta _ { k } , v _ { p } ) , } \end{array}$ . This same equation is also used for $\hat { T } _ { N } ( \theta _ { k } , v )$ . Figure 11 shows the results obtained by linearly interpolating between two camera views. Note how the largest errors appear near areas occluded by wrinkles, where one (or both) of the cameras has no valid texture sliding results and instead uses the inferred cloth textures. This can be alleviated by using more cameras placed closer together.
+
+
+Figure 11: Given two camera views (far left and far right images), texture sliding can be linearly interpolated to novel views between them. The top row shows per-pixel errors (blue $= 0$ , red $\geq 0 . 0 4 $ ), and the bottom row shows the cloth from a fixed front-facing view to illustrate how the interpolated texture changes as a function of the chosen novel view.
+
+# 6.4 3D RECONSTRUCTION
+
+In order to reconstruct the 3D position of a vertex of the ground truth mesh, we take the usual approach of finding rays that pass through that vertex and the camera aperture for a number of cameras. Then given at least two rays, one can triangulate a 3D point that is minimal distance from all the rays. We can do this without solving the typical image to image correspondence problem because we know the ground truth texture coordinates for any given vertex. Thus, we merely have to find the ray that passes through the camera aperture and the ground truth texture coordinate for the vertex under consideration.
+
+To find a ground truth texture coordinate on a texture corrected inferred cloth mesh $C _ { N } ^ { \prime } ( \theta _ { k } , v )$ , or $\hat { C } _ { N } ^ { \prime } ( \theta _ { k } , v )$ , we first find the triangle containing that texture coordinate. This can be done quickly by using a hierarchical bounding box structure where the base level boxes around each triangle are defined using the min/max texture coordinates at the three vertices. Then one can write the barycentric interpolation formula that interpolates the triangle vertex texture coordinates to obtain the given ground truth texture coordinate, and subsequently invert the matrix to solve for the weights. These weights determine the sub-triangle position of the vertex under consideration (taking care to note that different answers are obtained in 3D space versus screen space, since the camera projection is nonlinear). Figure 12 shows the 3D reconstruction of a test set example using texture sliding (Figure 12c) and the TSNN (Figure 12d). To remove reconstruction noise generated by network inference errors in Figure 12d, we used the postprocess from Geng et al. (2020); although, there are many other smoothing options in the literature that one might also consider. Figure 13 compares the per-pixel errors and local compression/extension energies of Figures 12c and 12d.
+
+
+Figure 12: The ground truth (a) and inferred cloth (b) compared to the 3D reconstructions obtained using texture sliding (c) and the TSNN (d).
+Figure 13: Per-pixel errors (top) and local compression/extension energies (bottom) for Figure $1 2 \mathrm { c }$ (a) and Figure 12d (b).
+
+# 7 DISCUSSION AND FUTURE WORK
+
+There are many disparate applications for clothing including for example video games, AR/VR, Hollywood special effects, virtual try-on and shopping, scene acquisition and understanding, and even bullet proof vests and soft armor. Various scenarios define accuracy or fidelity in vastly different ways. So while it is typical to state that one cares about more than just the visual appearance (or “graphics”), often those aiming for predictive capability still make concessions. For example, wherein Santesteban et al. (2019) proposes a network that well predicts wrinkles mapped to new body types, the discussion in Lahner et al. (2018) implies that the horizontal wrinkles predicted by Santesteban et al. (2019) are more characteristic of inaccurate physical simulation than real-world behavior. Instead, Lahner et al. (2018) strives for more vertical wrinkles to better match their data, but they accomplish this by predicting lighting to match an image while accepting overly smooth geometry. And as we have shown in Figure 7c, predicting the correct geometry still allows for rather large errors in the deformation (see Geng et al. (2020)).
+
+In light of this, we state the problem of most interest to us: Our aim is to study the efficacy of using deep neural networks to aid in the modeling of material behavior, especially for those materials for which predictive methods do not currently exist because of various unknowns including friction, material parameters (for cloth and body), etc. Given this goal, we focus on the accurate prediction of material coordinates, which are a super set of deformation, geometry, lighting, visual plausibility, etc.
+
+As demonstrated by the remarkably accurate 3D reconstruction in Figure 12c (see 13a), our approach to encoding high frequency wrinkles into lower frequency texture coordinates (i.e. texture sliding) works quite well. It can be used as a post-process to any existing neural network to capture lost details (as long as ground truth and inferred training examples are available); moreover, we showed that trivial subdivision could be used to increase the sampling resolution to limit linearization artifacts. One needs to take care when training the texture sliding neural network (TSNN) since inference errors can cause reconstruction noise. Thus, as future work, we plan on experimenting with the network architecture, the size of the image used in the CNN, the smoothing methods near occlusion boundaries, the amount of subdivision, etc. In addition, it would be interesting to consider more savvy multiview 3D reconstruction methods (particularly ones that employ DNNs; then, one might train the whole process end-to-end).
+
+# REFERENCES
+
+Thiemo Alldieck, Marcus Magnor, Weipeng Xu, Christian Theobalt, and Gerard Pons-Moll. Detailed human avatars from monocular video. In 2018 International Conference on 3D Vision (3DV), pp. 98–109. IEEE, 2018a.
+
+Thiemo Alldieck, Marcus Magnor, Weipeng Xu, Christian Theobalt, and Gerard Pons-Moll. Video based reconstruction of 3d people models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8387–8397, 2018b.
+
+Thiemo Alldieck, Marcus Magnor, Bharat Lal Bhatnagar, Christian Theobalt, and Gerard Pons-Moll. Learning to reconstruct people in clothing from a single rgb camera. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1175–1186, 2019a.
+
+Thiemo Alldieck, Gerard Pons-Moll, Christian Theobalt, and Marcus Magnor. Tex2shape: Detailed full human body geometry from a single image. In Proceedings of the International Conference on Computer Vision (ICCV). IEEE, 2019b.
+
+Dragomir Anguelov, Praveen Srinivasan, Daphne Koller, Sebastian Thrun, Jim Rodgers, and James Davis. Scape: shape completion and animation of people. In ACM transactions on graphics (TOG), volume 24, pp. 408–416. ACM, 2005.
+
+Alexandru O Balan and Michael J Black. The naked truth: Estimating body shape under clothing. In ˘ European Conference on Computer Vision, pp. 15–29. Springer, 2008.
+
+David Baraff and Andrew Witkin. Large steps in cloth simulation. In Proceedings of the 25th annual conference on Computer graphics and interactive techniques, pp. 43–54. ACM, 1998.
+
+David Baraff, Andrew Witkin, and Michael Kass. Untangling cloth. In ACM Transactions on Graphics (TOG), volume 22, pp. 862–870. ACM, 2003.
+
+Davide Boscaini, Jonathan Masci, Emanuele Rodolà, and Michael Bronstein. Learning shape correspondence with anisotropic convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 3189–3197, 2016.
+
+Derek Bradley, Tamy Boubekeur, and Wolfgang Heidrich. Accurate multi-view reconstruction using robust binocular stereo and surface meshing. In 2008 IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–8. IEEE, 2008a.
+
+Derek Bradley, Tiberiu Popa, Alla Sheffer, Wolfgang Heidrich, and Tamy Boubekeur. Markerless garment capture. In ACM Transactions on Graphics (TOG), volume 27, pp. 99. ACM, 2008b.
+
+Robert Bridson, Ronald Fedkiw, and John Anderson. Robust treatment of collisions, contact and friction for cloth animation. In ACM Transactions on Graphics (ToG), volume 21, pp. 594–603. ACM, 2002.
+
+Robert Bridson, Sebastian Marino, and Ronald Fedkiw. Simulation of clothing with folds and wrinkles. In Proceedings of the 2003 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 28–36. ACM, 2003.
+
+Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
+
+Matthew Cong, Michael Bao, Jane L E, Kiran S Bhat, and Ronald Fedkiw. Fully automatic generation of anatomical face simulation models. In Proceedings of the 14th ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 175–183. ACM, 2015.
+
+R Daneˇˇrek, Endri Dibra, Cengiz Öztireli, Remo Ziegler, and Markus Gross. Deepgarment: 3d garment shape estimation from a single image. In Computer Graphics Forum, volume 36, pp. 269–280. Wiley Online Library, 2017.
+
+Edilson De Aguiar, Leonid Sigal, Adrien Treuille, and Jessica K Hodgins. Stable spaces for real-time clothing. In ACM Transactions on Graphics (TOG), volume 29, pp. 106. ACM, 2010.
+
+Jean-Sébastien Franco, Marc Lapierre, and Edmond Boyer. Visual shapes of silhouette sets. In Third International Symposium on 3D Data Processing, Visualization, and Transmission (3DPVT’06), pp. 397–404. IEEE, 2006.
+
+Zhenglin Geng, Daniel Johnson, and Ronald Fedkiw. Coercing machine learning to output physically accurate results. Journal of Computational Physics, 406:109099, 2020.
+
+Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
+
+Peng Guan, Loretta Reiss, David A Hirshberg, Alexander Weiss, and Michael J Black. Drape: Dressing any person. ACM Trans. Graph., 31(4):35–1, 2012.
+
+Erhan Gundogdu, Victor Constantin, Amrollah Seifoddini, Minh Dang, Mathieu Salzmann, and Pascal Fua. Garnet: A two-stream network for fast and accurate 3d cloth draping. In Proceedings of the IEEE International Conference on Computer Vision, pp. 8739–8748, 2019.
+
+Marc Habermann, Weipeng Xu, Michael Zollhoefer, Gerard Pons-Moll, and Christian Theobalt. Livecap: Real-time human performance capture from monocular video. ACM Transactions on Graphics (TOG), 38(2):14, 2019.
+
+Fabian Hahn, Bernhard Thomaszewski, Stelian Coros, Robert W Sumner, Forrester Cole, Mark Meyer, Tony DeRose, and Markus Gross. Subspace clothing simulation using adaptive bases. ACM Transactions on Graphics (TOG), 33(4):105, 2014.
+
+Richard I Hartley and Peter Sturm. Triangulation. Computer vision and image understanding, 68(2): 146–157, 1997.
+
+Peng Huang, Margara Tejera, John Collomosse, and Adrian Hilton. Hybrid skeletal-surface motion graphs for character animation from 4d performance capture. ACM Transactions on Graphics (ToG), 34(2):17, 2015.
+
+Ning Jin, Yilin Zhu, Zhenglin Geng, and Ronald Fedkiw. A pixel-based framework for data-driven clothing. In Proceedings of the 19th ACM SIGGRAPH / Eurographics Symposium on Computer Animation, volume 39. Association for Computing Machinery, 2020.
+
+Ron Kimmel and James A Sethian. Computing geodesic paths on manifolds. Proceedings of the national academy of Sciences, 95(15):8431–8435, 1998.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Ilya Kostrikov, Zhongshi Jiang, Daniele Panozzo, Denis Zorin, and Joan Bruna. Surface networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2540–2548, 2018.
+
+Zorah Lahner, Daniel Cremers, and Tony Tung. Deepwrinkles: Accurate and realistic clothing modeling. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 667–684, 2018.
+
+Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J Black. Smpl: A skinned multi-person linear model. ACM transactions on graphics (TOG), 34(6):248, 2015.
+
+Haggai Maron, Meirav Galun, Noam Aigerman, Miri Trope, Nadav Dym, Ersin Yumer, Vladimir G Kim, and Yaron Lipman. Convolutional neural networks on surfaces via seamless toric covers. ACM Trans. Graph., 36(4):71–1, 2017.
+
+Jonathan Masci, Davide Boscaini, Michael Bronstein, and Pierre Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In Proceedings of the IEEE international conference on computer vision workshops, pp. 37–45, 2015.
+
+Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
+
+Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5115–5124, 2017.
+
+Matthias Müller and Nuttapong Chentanez. Wrinkle meshes. In Proceedings of the 2010 ACM SIGGRAPH/Eurographics symposium on computer animation, pp. 85–92. Eurographics Association, 2010.
+
+Ryota Natsume, Shunsuke Saito, Zeng Huang, Weikai Chen, Chongyang Ma, Hao Li, and Shigeo Morishima. Siclope: Silhouette-based clothed people. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4480–4490, 2019.
+
+Alexandros Neophytou and Adrian Hilton. A layered model of human body and garment deformation. In 2014 2nd International Conference on 3D Vision, volume 1, pp. 171–178. IEEE, 2014.
+
+Hayato Onizuka, Zehra Hayirci, Diego Thomas, Akihiro Sugimoto, Hideaki Uchiyama, and Rinichiro Taniguchi. Tetratsdf: 3d human reconstruction from a single image with a tetrahedral outer shell. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6011–6020, 2020.
+
+Stanley Osher and Ronald Fedkiw. Level Set Methods and Dynamic Implicit Surfaces. Springer, New York, 2002.
+
+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.
+
+Chaitanya Patel, Zhouyingcheng Liao, and Gerard Pons-Moll. Tailornet: Predicting clothing in 3d as a function of human pose, shape and garment style. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7365–7375, 2020.
+
+Georgios Pavlakos, Vasileios Choutas, Nima Ghorbani, Timo Bolkart, Ahmed AA Osman, Dimitrios Tzionas, and Michael J Black. Expressive body capture: 3d hands, face, and body from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10975–10985, 2019.
+
+Gerard Pons-Moll, Sergi Pujades, Sonny Hu, and Michael J Black. Clothcap: Seamless 4d clothing capture and retargeting. ACM Transactions on Graphics (TOG), 36(4):73, 2017.
+
+Tiberiu Popa, Quan Zhou, Derek Bradley, Vladislav Kraevoy, Hongbo Fu, Alla Sheffer, and Wolfgang Heidrich. Wrinkling captured garments using space-time data-driven deformation. In Computer Graphics Forum, volume 28, pp. 427–435. Wiley Online Library, 2009.
+
+Nadia Robertini, Edilson De Aguiar, Thomas Helten, and Christian Theobalt. Efficient multi-view performance capture of fine-scale surface detail. In 2014 2nd International Conference on 3D Vision, volume 1, pp. 5–12. IEEE, 2014.
+
+Damien Rohmer, Tiberiu Popa, Marie-Paule Cani, Stefanie Hahmann, and Alla Sheffer. Animation wrinkling: augmenting coarse cloth simulations with realistic-looking wrinkles. In ACM Transactions on Graphics (TOG), volume 29, pp. 157. ACM, 2010.
+
+Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In Proceedings of the International Conference on Computer Vision (ICCV). IEEE, 2019.
+
+Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3d human digitization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 84–93, 2020.
+
+Igor Santesteban, Miguel A Otaduy, and Dan Casas. Learning-based animation of clothing for virtual try-on. In Computer Graphics Forum, volume 38, pp. 355–366. Wiley Online Library, 2019.
+
+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, 2008.
+
+Bernhard Scholkopf and Alexander J Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2001.
+
+Steven M Seitz, Brian Curless, James Diebel, Daniel Scharstein, and Richard Szeliski. A comparison and evaluation of multi-view stereo reconstruction algorithms. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 1, pp. 519–528. IEEE, 2006.
+
+Andrew Selle, Jonathan Su, Geoffrey Irving, and Ronald Fedkiw. Robust high-resolution cloth using parallelism, history-based collisions, and accurate friction. IEEE transactions on visualization and computer graphics, 15(2):339–350, 2008.
+
+Qingyang Tan, Lin Gao, Yu-Kun Lai, and Shihong Xia. Variational autoencoders for deforming 3d mesh models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5841–5850, 2018.
+
+Gul Varol, Duygu Ceylan, Bryan Russell, Jimei Yang, Ersin Yumer, Ivan Laptev, and Cordelia Schmid. Bodynet: Volumetric inference of 3d human body shapes. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 20–36, 2018.
+
+Daniel Vlasic, Ilya Baran, Wojciech Matusik, and Jovan Popovic. Articulated mesh animation from´ multi-view silhouettes. In ACM Transactions on Graphics (TOG), volume 27, pp. 97. ACM, 2008.
+
+Huamin Wang, Florian Hecht, Ravi Ramamoorthi, and James F O’Brien. Example-based wrinkle synthesis for clothing animation. In Acm Transactions on Graphics (TOG), volume 29, pp. 107. ACM, 2010.
+
+Tuanfeng Y Wang, Duygu Ceylan, Jovan Popovic, and Niloy J Mitra. Learning a shared shape space ´ for multimodal garment design. In SIGGRAPH Asia 2018 Technical Papers, pp. 203. ACM, 2018.
+
+Chenglei Wu, Kiran Varanasi, and Christian Theobalt. Full body performance capture under uncontrolled and varying illumination: A shading-based approach. In European Conference on Computer Vision, pp. 757–770. Springer, 2012.
+
+Weipeng Xu, Avishek Chatterjee, Michael Zollhöfer, Helge Rhodin, Dushyant Mehta, Hans-Peter Seidel, and Christian Theobalt. Monoperfcap: Human performance capture from monocular video. ACM Transactions on Graphics (ToG), 37(2):27, 2018.
+
+Jinlong Yang, Jean-Sébastien Franco, Franck Hétroy-Wheeler, and Stefanie Wuhrer. Estimation of human body shape in motion with wide clothing. In European Conference on Computer Vision, pp. 439–454. Springer, 2016.
+
+Jinlong Yang, Jean-Sébastien Franco, Franck Hétroy-Wheeler, and Stefanie Wuhrer. Analyzing clothing layer deformation statistics of 3d human motions. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 237–253, 2018.
+
+Tao Yu, Zerong Zheng, Yuan Zhong, Jianhui Zhao, Qionghai Dai, Gerard Pons-Moll, and Yebin Liu. Simulcap: Single-view human performance capture with cloth simulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
+
+Chao Zhang, Sergi Pujades, Michael J Black, and Gerard Pons-Moll. Detailed, accurate, human shape estimation from clothed 3d scan sequences. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4191–4200, 2017.
\ No newline at end of file
diff --git a/md/train/4G2dEuRZ7eO/4G2dEuRZ7eO.md b/md/train/4G2dEuRZ7eO/4G2dEuRZ7eO.md
new file mode 100644
index 0000000000000000000000000000000000000000..344d140c50bbcb2870755f560ff4335a36298c62
--- /dev/null
+++ b/md/train/4G2dEuRZ7eO/4G2dEuRZ7eO.md
@@ -0,0 +1,290 @@
+# Progressive Coordinate Transforms for Monocular 3D Object Detection
+
+Li Wang1∗ Li Zhang1† Yi Zhu2 Zhi Zhang2 Tong He2 Mu Li2 Xiangyang Xue1 1Fudan University 2Amazon Inc.
+
+# Abstract
+
+Recognizing and localizing objects in the 3D space is a crucial ability for an AI agent to perceive its surrounding environment. While significant progress has been achieved with expensive LiDAR point clouds, it poses a great challenge for 3D object detection given only a monocular image. While there exist different alternatives for tackling this problem, it is found that they are either equipped with heavy networks to fuse RGB and depth information or empirically ineffective to process millions of pseudo-LiDAR points. With in-depth examination, we realize that these limitations are rooted in inaccurate object localization. In this paper, we propose a novel and lightweight approach, dubbed Progressive Coordinate Transforms (PCT) to facilitate learning coordinate representations. Specifically, a localization boosting mechanism with confidence-aware loss is introduced to progressively refine the localization prediction. In addition, semantic image representation is also exploited to compensate for the usage of patch proposals. Despite being lightweight and simple, our strategy leads to superior improvements on the KITTI and Waymo Open Dataset monocular 3D detection benchmarks. At the same time, our proposed PCT shows great generalization to most coordinatebased 3D detection frameworks. The code is available at: https://github.com/ amazon-research/progressive-coordinate-transforms.
+
+# 1 Introduction
+
+Object detection is a fundamental and challenging task in scene understanding applications. Recently, 3D object detection has received increasing attention and found applications in a wide range of scenarios such as autonomous driving, robotics, visual navigation and mixed reality. Despite the great progress from the area of 2D object detection [34, 49, 40, 18, 4], 3D object detection remains a largely unsolved problem as it aims to predict the object location in the 3D space alongside 3D object dimension and orientation.
+
+Existing prevalent approaches [50, 44, 35, 10, 11] for 3D object detection largely rely on LiDAR sensors, which provide accurate 3D point clouds of the scene. Although these approaches achieve superior performance, the dependence on expensive equipment severely limits their applicability to generic 3D perception. There also exists a cheaper alternative that takes a single-view RGB image as input, termed as monocular 3D object detection. However, its performance is far from satisfactory as itself is an ill-posed problem due to the loss of depth information in 2D image planes. Hence, several recent attempts introduce depth information to help monocular 3D detection. Such attempts can be roughly categorized into two directions, pixel-based and coordinate-based. Pixel-based approaches [9, 36, 31, 41] turn to use estimated depth map as additional input for improved detection performance. But at the same time, this leads to heavy computational burden and large memory footprint since they often operate on the entire image. Coordinated-based approaches [42, 29, 46, 27] pursue the coordinate representations as in LiDAR-based methods. They use the predicted depth map to convert the monocular image pixels to 3D coordinate representations, then apply a 3D detector on the converted coordinates. In particular, they are often lightweight since their network inputs are object proposals generated by 2D detectors [29, 27]. However, the performance of coordinated-based methods lags far behind LiDAR-based methods. So we ask, can we identify the bottleneck that holds back the 3D detection accuracy of coordinate-based methods and how can we improve them?
+
+Table 1: Probing investigation on coordinate-based methods, PatchNet [27] and Pseudo-LiDAR [42]. We examine the potential improvement by replacing the predicted factor with the corresponding ground truth. $^ *$ indicates our reproduced performance. We can see that coordinate-based methods mostly suffer from inaccurate localization.
+
+
Factor
PatchNet*[AP3D/APBEV]
Pseudo-LiDAR*[AP3D/APBEv]
Mod.
Easy
Hard
Mod.
Easy
Hard
Baseline
26.31/34.14
36.40/46.80
21.07/28.04
23.04/31.06
32.27/42.45
19.67/25.67
dimension
27.26/34.62
40.32/47.24
24.29/28.38
25.88/31.97
36.09/44.35
20.88/26.60
rotation
26.25/34.04
36.09/46.25
23.49/27.99
23.88/31.31
32.42/42.74
19.85/26.07
X
32.80/41.43
45.60/56.22
27.38/34.63
28.36/36.77
39.69/50.78
25.08/29.92
y
30.16/34.14
40.94/46.80
24.58/28.04
25.53/31.06
35.19/42.45
20.69/25.67
Z
42.42/53.48
55.42/68.29
35.54/45.60
38.37/50.81
50.04/63.96
32.24/43.32
location(xyz)
72.58/75.27
81.41/85.14
57.69/66.10
64.36/73.37
79.13/83.77
55.64/58.27
+
+In order to determine the bottleneck, we conduct an investigation on two widely adopted coordinatebased methods, PatchNet [27] and Pseudo-LiDAR [42]. Specifically, for each prediction target, we examine the potential improvement by replacing its value with the corresponding ground truth, and then re-compute the 3D detection accuracy. As shown in Table 1, using ground truth dimension and rotation do not bring significant improvements over the baseline. But using ground truth location (i.e., x/y/z values of the objects) almost triples detection accuracy. This indicates that coordinate-based methods mostly suffer from inaccurate localization even with the assistance of estimated depth maps.
+
+Based on this observation, we focus on improving the accuracy of 3D center localization. In this work, we propose a lightweight and generalized approach, called Progressive Coordinate Transforms (PCT), to enhance the localization capability for coordinate-based methods. First of all, since the localization regression network in most coordinate-based methods is less accurate but lightweight, we propose to progressively refine its prediction similar to gradient boosting [12, 13]. To be specific, a localization regression network can be seen as a weak learner, and we progressively train multiple consecutive networks such that each network fits the regression residual from the previous networks. These networks share the same lightweight structure so that the computation overhead is negligible. We also predict a confidence score for each network to help stabilize the end-to-end training. We term this progressive refining strategy as confidence-aware localization boosting (CLB). Compared to image-only or pixel-based methods, coordinated-based methods suffer from the problem of missing global context information due to the use of patched input. In order to further improve the localization accuracy, we exploit semantic image representations from 2D detector. We term this module as global context encoding (GCE). We find that GCE can not only improve center localization accuracy, but also contribute to the final 3D box estimation.
+
+Through extensive experiments, our progressive coordinate transforms, consisting of CLB and GCE, is shown to improve popular coordinate-based models [42, 27] by generating more accurate localization. Without bells and whistles, we achieve state-of-the-art monocular 3D detection performance on KITTI [16, 17, 15] with a strong base method [27]. Additionally, this also leads to superior improvements on Waymo Open Dataset [38] compared with the base method PatchNet.
+
+# 2 Related work
+
+# 2.1 Monocular 3D object detection
+
+Existing paradigms for monocular 3D object detection can be categorized into two types: image-only methods and depth-assisted methods.
+
+For image-only methods, they often adapt architectures and good practices from popular 2D detectors [34, 49, 40]. However, locating objects in 3D space is much more challenging without depth information. Hence, several works [30, 2, 25, 6, 49] integrate geometry consistency into the training strategy to constrain the localization prediction. Deep3DBox [30] divides orientation into multi-bins to stably regress them, and combines the 2D-3D box constraint to recover accurate 3D object pose. M3D-RPN [2] utilizes the geometric relationship between 2D and 3D perspectives by sharing the prior anchors and classification targets. MonoPair [6] leverages the spatial relationships between paired objects to improve accuracy on occluded objects. To further improve the performance of truncated objects, MonoFlex [48] decouples the features learning and prediction of truncated objects, and formulates an depth estimation to adaptively combine independent estimator based on uncertainty. [33] designs CaDDN as a fully differentiable end-to-end approach for joint depth estimation and object detection.
+
+Depth-assisted methods often estimate a depth map given a input image, and use it in different ways. Some pixel-based approaches [9, 26] directly feed images and estimated depth maps into networks to generate depth-aware features and enhance the 3D detection performance. Some other coordinatebased approaches first transform the pixels of input images to 3D coordinates by leveraging the depth and camera information, then feed the coordinate proposals to a 3D detector. Pioneering work Pseudo-LiDAR [42] imitates the process of LiDAR-based approaches, which uses LiDAR-based 3D detector upon coordinates proposals. AM3D [29] explores the multi-modal input fusion to embed the complementary RGB cue into the network. Recently, PatchNet [27] points out that the efficacy of pseudo-LiDAR representation comes from the coordinate transform, instead of sophisticated LiDAR-based networks. Hence, they design a simple 2D CNN to perform 3D detection. In this work, we follow the research of coordinate-based methods [42, 27]. Instead of regressing 3D localization directly with a single lightweight network, we propose to progressively refine the prediction inspired by gradient boosting. We also incorporate RGB image information to complement patch proposals and enhance global context modeling. Different from AM3D [29], we utilize the RGB features from the 2D detector directly which can share the same context, and we do not need to train another RGB network from scratch.
+
+# 2.2 Gradient boosting
+
+Gradient boosting is a well-known greedy algorithm proposed in [7], which trains a sequence of learners and progressively improves the prediction results. It is a general learning framework, and has been verified to be a formidable force when applied with lightweight learners. Meanwhile, when each learner in the sequence is heavy, the computation cost becomes high and the performance is not beneficial [24]. Early works in 2D detection area [19, 21, 22] also adopt the boosting mechanism following a standard cascade paradigm, and achieve improved performance. Li et al. [21] treat face detection as an image retrieval task and improve it with a boosted exemplar-based face detector. Karianakis et al. [19] and Li et al. [22] feed convolutional features of proposals instead of hand-crafted features to boosted classifiers and distinguish objects from backgrounds. We can also find the usage of gradient boosting in other computer vision tasks [37, 51].
+
+To our best knowledge, we are the first to explore the boosting mechanism in coordinate-based methods for 3D object detection. We perform this mechanism in two folds. First, instead of the entire 3D detection pipeline, we only progressively boost the localization regression network as its computational cost is insignificant comparing to the entire pipeline. Second, we refine the localization with an additional confidence score in the boosting procedure, such that the loss is balanced. These choices greatly improves the performance with small extra parameters.
+
+# 3 Background
+
+Before diving into the details, we first revisit recent coordinate-based monocular 3D detection methods and present a visual depiction of its common pipeline in Figure 1. The framework usually consists of four main components: 2D bounding box generation, depth map estimation, data transformation and 3D box estimation. Specifically, given an image $I$ , the process can be described as:
+
+2D bounding box generation. An off-the-shelf 2D object detector $F _ { 2 d }$ such as Faster R-CNN [34] is employed on image $I$ to generate region of interests (RoIs), $\mathscr { R } = F _ { 2 d } ( I )$ .
+
+
+Figure 1: A common pipeline of coordinate-based monocular 3D detectors. It consists of four steps to predict the final 3D boxes: 2D bounding box generation, depth map estimation, data transformation and 3D box estimation. In this work, we focus on improving the last step: 3D box estimation.
+
+Depth map estimation. An off-the-shelf depth estimator $F _ { z }$ such as DORN [14] is applied on image $I$ to predict its depth map, $\mathcal { Z } = F _ { z } ( I )$ .
+
+Data transformation. To convert a pixel $( u , v )$ within a RoI to 3D space, the associated depth $z = \mathcal { Z } ( u , v )$ is used to transform it into its 3D coordinates $\left( c _ { x } , c _ { y } , c _ { z } \right)$ by
+
+$$
+c _ { x } = { \frac { ( u - u ^ { \prime } ) \times z } { f _ { u } } } ; \quad c _ { y } = { \frac { ( v - v ^ { \prime } ) \times z } { f _ { v } } } ; \quad c _ { z } = z
+$$
+
+Here, $\left( c _ { x } , c _ { y } , c _ { z } \right)$ is a pixel in the generated 3D coordinate patch $c$ . $( u ^ { \prime } , v ^ { \prime } )$ is the camera principal point. $f _ { u }$ and $f _ { v }$ are the focal length along horizontal and vertical axis, respectively. $u ^ { \prime } , v ^ { \prime } , \bar { f } _ { u } , f _ { v }$ are usually provided by the datasets.
+
+3D box estimation. Once the 3D coordinates for each RoI are available, the final step is to predict 3D boxes with their center location, rotation and dimension. Different networks $F _ { 3 d }$ such as Frustum PointNet [32] can be employed to conduct 3D box prediction, $\boldsymbol { B } = F _ { 3 d } ( \boldsymbol { c } )$ . Here, $\boldsymbol { B }$ includes the center location $( x , y , z )$ , rotation $( \theta )$ , and dimensions $( w , h , l )$ of the 3D box.
+
+Since the first two steps use off-the-shelf models and the third step can be computed analytically, in this paper, we focus on improving the last step of coordinated-based methods. In particular, our goal is to improve the accuracy of localization prediction motivated by the observation in Table 1.
+
+# 4 Method
+
+In this section, we present our progressive coordinate transforms (PCT) for improved 3D detection. In order to obtain more accurate localization predictions, we introduce a confidence-aware localization boosting mechanism (CLB) in Sec. 4.1 to progressively refine the prediction. Then in Sec. 4.2, we incorporate RGB image information by a global context encoding (GCE) strategy to compensate for the drawbacks of using patch proposals. In the end, we illustrate the overall framework of PCT in Figure 2 (a).
+
+# 4.1 Confidence-aware localization boosting
+
+Following Frustum PointNet [32], most coordinate-based methods [42, 45, 27, 43] divide the last step of 3D box estimation into two major components. The first component is a lightweight 3D localization regressor $F$ , whose input is 3D coordinate proposals generated from data transformation. The second component is a relatively heavy network $G$ used to regress the final 3D box $\boldsymbol { B }$ . Recalling the results in Table 1, 3D localization performance is the weakest point of a coordinate-based model, accounting for up to 50 AP loss when all other modules keep intact. Therefore, can we find an efficient way to improve the accuracy of localization prediction and also generalizes to other coordinated-based methods?
+
+Gradient boosting [12, 13] is a general learning framework that combines multiple weak learners into a single strong one in an iterative fashion. Let $\mathcal { L } ( x )$ be the risk of ensemble models, the algorithm devotes to seek an approximation $h ( x )$ to minimize $\mathcal { L } ( y ^ { \ast } , x ) = \Psi ( y ^ { \ast } , h ( x ) )$ , where $y ^ { * }$ is a target value, $\Psi ( \cdot )$ is the loss function. $h ( x )$ is a linear combination of a set of weak (base) learners $f _ { t } ( x )$ from some class $\mathcal { F }$ , i.e., $\begin{array} { r } { h ( x ) = \sum _ { t = 1 } ^ { t = T } \gamma _ { t } f _ { t } ( x ) + c o n s t } \end{array}$ . Here, $T$ is the total training iterations and $\gamma _ { t }$ is the corresponding weight for each weak learner. To minimize the empirical risk, the algorithm starts with a model $h _ { 0 } ( x )$ , and then incrementally expands it in a greedy manner. This process manages to fit a new weak learner to the residual errors made by the previous set of learners. Mathematically, the
+
+
+Figure 2: (a) Schematic illustration of proposed Coordinate Transforms (PCT). We treat $F$ as a weaker learner, and perform coordinate transform $T$ steps via confidence-aware localization boosting (CLB module) to obtain a better localization. Then the refined coordinate proposals combined with corresponding encoded RGB features (GCE module) are fed into network $\mathbf { G }$ to generate final 3D bounding boxes. (b) The data flow of CLB mechanism in detail. For step $t$ , it takes refined coordinate patches $c _ { t - 1 }$ as input, which is transformed based on predicted $\Delta ( x _ { t - 1 } , y _ { t - 1 } , z _ { t - 1 } )$ . Then network $F _ { t }$ generate the residual localization for the next step, and confidence $s _ { t }$ is also generated during the training process.
+
+optimization can be formulated as
+
+$$
+\begin{array} { r l } & { h _ { 0 } ( x ) = \underset { \gamma _ { 0 } } { \arg \operatorname* { m i n } } \mathcal { L } _ { 0 } ( y ^ { * } , x ) ; } \\ & { ~ \quad \quad \cdots } \\ & { h _ { t } ( x ) = h _ { t - 1 } ( x ) + \underset { f _ { t } \in \mathcal { F } } { \arg \operatorname* { m i n } } \mathcal { L } _ { t } ( y ^ { * } , h _ { t - 1 } ( x ) + f _ { t } ( x ) ) . } \end{array}
+$$
+
+Inspired by gradient boosting, we imitate its optimization procedure to progressively adapt localization prediction by multiple localization regressors instead of a single one used in previous works [42, 29, 46, 27]. To be specific, we treat localization network $F$ as a weak learner and stack multiple of them as shown in Figure 2 (b). Given $F$ is a lightweight network, the extra computational cost brought by gradient boosting is insignificant. After the data transformation step, each 2D bounding box obtains its corresponding coordinate patch $c$ . We take the coordinate patch as the input of weak learner $F$ to regress the center localization residual $\Delta ( x , y , z )$ based on the prediction from previous stage,
+
+$$
+\Delta ( x _ { t } , y _ { t } , z _ { t } ) = F _ { t } ( c _ { t - 1 } ) ; { \mathrm { ~ w h e r e ~ } } c _ { t - 1 } = c _ { 0 } - \gamma _ { 0 } ( x _ { 0 } , y _ { 0 } , z _ { 0 } ) - \sum _ { i = 1 } ^ { t - 1 } \gamma _ { i } \Delta ( x _ { i } , y _ { i } , z _ { i } ) .
+$$
+
+We denote $c _ { 0 }$ and $( x _ { 0 } , y _ { 0 } , z _ { 0 } )$ to be the initial coordinate input patch and object location, respectively. Coordinate input patch $c _ { t - 1 }$ is then transformed according to the localization residual prediction, and fed into the next weak learner.
+
+Thus the risk at stage $t$ can be written as,
+
+$$
+\mathcal { L } _ { F _ { t } } ( ( x ^ { * } , y ^ { * } , z ^ { * } ) , c _ { t - 1 } ) = \Psi ( ( x ^ { * } , y ^ { * } , z ^ { * } ) , \gamma _ { 0 } ( x _ { 0 } , y _ { 0 } , z _ { 0 } ) + \sum _ { i = 1 } ^ { t - 1 } \gamma _ { i } \Delta ( x _ { i } , y _ { i } , z _ { i } ) )
+$$
+
+where $( x ^ { * } , y ^ { * } , z ^ { * } )$ indicates the ground truth location. At this point, we can easily see that $\mathrm { E q 4 }$ is a natural derivation from $\operatorname { E q } 2$ . After $T$ iterations, the final adjusted prediction $c _ { T }$ is fed into the network $G$ to estimate the 3D box $\boldsymbol { B }$ $3 , i . e . B = G ( c _ { T } )$ .
+
+Confidence-aware network loss In the case that the target of weak learner $f$ is differentiable, gradient boosting solves the optimization problem in a forward greedy manner as shown in Eq 2. For each iteration, it first fits the weak learner $f$ to the residual error, and then the optimal value of the coefficient weight $\gamma$ is determined for this weak learner. The optimization procedures train iteratively for $T$ iterations.
+
+However, for our center regression task, we would like to train $T$ weak localization networks $F _ { t } ( c _ { t - 1 } ) , t \in { 1 , . . . , T }$ and a 3D box prediction network $G$ in an end-to-end manner instead of bootstrapping. This is challenging in terms of both computational cost and optimization stability, given the simultaneous training of a set of weak learners and their coefficient weights. Therefore, we first simplify the problem by treating all $\gamma _ { t }$ the same and only focus on optimizing the localization networks. However, the contribution from each weak learner $F$ may not be the same during end-toend training, which leads to unstable optimization. Hence, we tailor a confidence-aware boosting loss to facilitate network training, by learning confidence score $s _ { t }$ for each localization loss function $\mathcal { L } _ { F _ { t } }$ . The confidence score $s _ { t }$ is learned from a small decoder and followed a self-balancing formulation closely coupled to the network loss. The overall loss function is defined as
+
+$$
+\mathcal { L } ( \boldsymbol { B } ^ { * } , \boldsymbol { c } _ { 0 } ) = \sum _ { t = 1 } ^ { T } s _ { t } \ast \mathcal { L } _ { \boldsymbol { F } _ { t } } ( ( \boldsymbol { x } ^ { * } , \boldsymbol { y } ^ { * } , \boldsymbol { z } ^ { * } ) , \boldsymbol { c } _ { t - 1 } ) + \lambda _ { s } \prod _ { t = 1 } ^ { T } ( 1 - s _ { t } ) + \mathcal { L } _ { G } ( \boldsymbol { B } ^ { * } , \boldsymbol { c } _ { T } ) ,
+$$
+
+where $B ^ { * }$ is the 3D box ground truth, $( x ^ { \ast } , y ^ { \ast } , z ^ { \ast } ) \in B ^ { \ast }$ and $\lambda _ { s }$ is the balance weight. $s _ { t }$ is the prediction after sigmoid, which represents the confidence of the localization regression loss at $t ^ { t h }$ stage, and $\textstyle \prod _ { t = 1 } ^ { T } ( 1 - s _ { t } )$ is the penalty on the network uncertainty. In other words, if $s _ { t }$ is approaching 1, which means the network is confident about localization refinement at $t ^ { t h }$ stage, then no penalty will be applied. Otherwise, the uncertainty of regression loss is high, thus triggers a higher penalty.
+
+# 4.2 Global context encoding
+
+Typical coordinate-based methods [42, 45, 27, 43] perform 3D detection based on 2D RoIs, which is similar to two-stage 2D detection frameworks, such as Faster R-CNN [34]. In a two-stage 2D object detection framework, the second stage reuses the features from the first stage via RoIPooling [34] or RoIAlign operators [18] guided by ROI proposals, and then a small decoder is used for localization refinement. However, in 3D detection, only cropped patches with coordinates information are fed to the network for 3D box regression. Neither RGB information nor global context is included.
+
+Considering that the RGB information is a vital visual clue, we explore its aggregation in the last 3D box estimation step. Similar to two-stage 2D detectors, we obtain the RGB information by directly cropping the corresponding features from a 2D detector $F _ { 2 d }$ . Then the input to 3D box estimator $G$ can be formulated as $\bar { c \mathbf { \eta } } = \{ [ \mathcal { D } ( { \boldsymbol u } , { \boldsymbol v } ) , \mathcal { A } ( { \boldsymbol u } , { \boldsymbol v } ) ] , \forall ( { \boldsymbol u } , { \boldsymbol v } ) \in \mathcal { R } \}$ . Here, $\mathcal { D } ( \cdot )$ represents the data transformation function and $\boldsymbol { \mathcal { A } } ( \cdot )$ represents the RoIAlign operation. Both operations are performed upon the generated regions of interest from $\mathcal { R }$ .
+
+After RoIAlign operation, features are of size $C \times K \times K$ , where $C$ is the number of channels and $K \times K$ is the corresponding width and height, respectively. A small feature encoder is then used to encode cropped features into vectors with the dimension of $C$ . A feature fusion is followed to integrate coordinate representations with the obtained image representations. Benefiting from the large receptive fields of image feature representations, 3D box estimator can now have access to global context. Besides, directly cropping on RGB features also avoids learning image representations of RoIs from scratch and reduces the overall network parameters.
+
+# 5 Experiments
+
+Two monocular 3D detection benchmarks are introduced in Sec. 5.1 and Sec. 5.2, while experimental implementation details are described in Sec. 5.3. In Sec. 5.4, we conduct main analysis on KITTI dataset [16, 17, 15] with base method PatchNet [27] given its current best performance. More experiments on Waymo Open Dataset [38] are also demonstrated to further verify the generality of our proposed PCT in Sec. 5.5.
+
+# 5.1 KITTI setup
+
+We first evaluate our method on the KITTI benchmark [16, 17, 15], which contains 7,481 and 7,518 images for training and testing respectively. We follow [5] to split the 7,481 training images into 3712 for training and 3,769 for validation.
+
+Table 2: Ablative analysis on KITTI validation set for $\mathrm { A P _ { 3 D } }$ and $\mathrm { A P _ { B E V } }$ at $\mathrm { I o U } = 0 . 7$ . Experiment Group (I) is the baseline method. Different experiment settings are explored: (II) applying localization boosting without confidence constraint, (III) performing confidence-aware localization boosting algorithm, (IV) adding global context encoding on Group (II), (V) our full approach.
+
+
Group
Localization Boosting
Uncertainty
GCE
AP3D
APBEV
Mod.
Easy
Hard
Mod.
Easy
Hard
I
-
-
1
25.88
36.07
20.99
33.34
46.39
27.54
Ⅱ
√
1
26.78
37.29
24.11
34.39
47.08
28.28
Ⅲ
√
√
=
27.24
38.32
24.39
33.92
46.77
27.98
IV
√
27.12
37.38
24.11
34.46
46.70
28.32
V
√
√
27.53
38.39
24.44
34.65
47.16
28.47
+
+Precision-recall curves are adopted for evaluation, and we report the average precision (AP) results of 3D and Bird’s eye view (BEV) object detection on KITTI validation and test set. For fair comparison to previous literature, the 40 recall positions-based metric $A P | _ { R 4 0 }$ is reported on test set while $\bar { A } P | _ { R 1 1 }$ is reported on validation set. Three levels of difficulty are defined in the benchmark according to the 2D bounding box height, occlusion, and truncation degree, namely, “Easy”, “Mod.”, and “Hard”. The KITTI benchmark ranks all methods based on the $\mathrm { A P _ { 3 D } }$ of “Mod.”. In particular, we focus on the “Car” category as in [42, 27], and we adopt $\mathrm { I o U } = 0 . 7$ as threshold for evaluation.
+
+# 5.2 Waymo setup
+
+We also carry out experiments on large-scale, high quality and diverse dataset, Waymo open dataset [38]. It provides pre-defined 798 training sequences and 202 validation sequences from different scenes, and another 150 test sequences without labels. The dataset contains camera images from five high-resolution pinhole cameras, and we only consider images with their 3D labels from front camera for monocular 3D detection task. We sample every third frame from the training sequences (total 52,386 images) as in CaDDN [33] to form the training set due to its large scale. And validation set contains all the 39,848 images from 202 different scenes.
+
+For evaluation, we adopt the officially released evaluation [39] to calculate the mean average precision (mAP) and the mean average precision weighted by heading (mAPH). Two levels are included according to difficulty rating, which are defined by LiDAR points. 3D labels without any points are ignored, LEVEL_2 is assigned to examples when it contains equal or lesser than 5 points, while the rest of the examples are assigned to LEVEL_1. Additionally, three distances (0 - 30m, 30 - 50m, $5 0 \mathrm { m }$ $- \infty )$ ) to sensor are considered during evaluation.
+
+# 5.3 Implementation details
+
+Our overall framework of PCT can be visualized in Figure 2. In terms of implementation details, we instantiate our algorithm on two widely adopted coordinate-based methods with public released code [28], PatchNet and Pseudo LiDAR. Bearing efficiency in mind, we use a real-time 2D detector RTM3D [23] with DLA-34 [47] as backbone. For the sake of fair comparison, we adopt depth predictor DORN [14] on KITTI dataset as in most depth-assisted literature. Since there is no published depth results on Waymo open dataset, we adopt a most recent monocular depth estimator AdaBins [1] trained on Waymo training set. For the CLB mechanism, we inherit the original localization regression framework in each method. Each $F _ { t }$ shares the same structure. The corresponding confidence is generated following the last convolutional layers of $F _ { t }$ with three linear layers and a Sigmoid function. $T = 3$ and $\lambda _ { s } = 1$ are set for the following experiments except for the ablation study on boosting iterations. For GCE module, we get the corresponding input image features by performing RoIAlign on the features from last convolutional layer of 2D detector. We set the output of RoIAlign as $1 6 \times 1 6$ . As 2D detector use DLA-34 as backbone, the obtained image feature representations have the size of $6 4 \times 1 6 \times 1 6$ and entitle arbitrary sized receptive field theoretically due to the embedded deformable convolution [8]. The structure of feature encoder in global context module is two common $6 4 \times 3 \times 3$ convolutional layers (stride $^ { = 4 }$ ) and a $6 4 \times 1 \times 1$ convolutional layer (stride ${ \mathop : } = 1$ ). Hence, image feature representations are encoded to a vector with 64-dim. The obtained features are then concatenated with the coordinate feature vectors from the final global pooling of box prediction network $G$ . With the lightweight structure, we are able to optimize the network end-to-end on a single Nvidia V100
+
+
+Figure 3: The statistic analysis and comparison on different Localization boosting stage when $T = 3$ . The vertical axis of the chart represents the number of samples after normalization. “loc. $1 / 2 / 3 ^ { \circ }$ denotes the $1 / 2 / 3 ^ { t h }$ step of localization errors in $F$ and “loc. $. 4 \ "$ is the final localization errors in $G$ . Note that when the curve is more thin, tall, and closer to zeros, the localization is more accurate.
+
+GPU with 16G memory. The training criterion for network $F$ and $G$ and other training settings follow the corresponding base methods for fair comparison.
+
+# 5.4 Method analysis on KITTI dataset
+
+Main ablative analysis In Table 2, we conduct ablation studies to analyze the effectiveness of our contributions: I) Without any localization regression network $F$ , network $G$ generates 3D box prediction directly. II) This configuration only contains localization boosting part without confidence constraint. III) The entire CLB mechanism is included to progressively regress center localization. IV) GCE module is added to the network based on the localization boosting block without confidence constraint since the feature fusion can be performed on either the localization regression networks $F$ or 3D box prediction network $G$ . V) Our full method with all the components.
+
+As depicted in Table 2, we can observe that the performance continues to grow with the addition of every component. From group II, localization boosting brings a noticeable improvement on all settings especially “Hard” set, which confirms its effectiveness in increasing localization accuracy. Group III shows that balancing training loss by adding confidence leads to better and more stable optimization. Group IV reveals that the proposed GCE module can effectively equip RGB information and global context with 3D coordinate representations. In the end, Group V demonstrates the complementarity of the proposed CLB mechanism and GCE module, leading to an improvement from 25.88/36.07/20.99 to 27.53/38.39/24.44 compared with Group I.
+
+Table 3: Comparison of different boosting iteration settings on KITTI validation split set.
+
+
Localization Boost (T)
AP3D/APBEV
Mod.
Easy
Hard
1
25.88/33.34
36.07/46.39
20.99/27.54
1
26.31/34.14
36.40/46.80
21.07/28.04
2
26.69/34.06
37.17/46.42
24.04/28.03
3
26.78/34.39
37.29/47.08
24.11/28.28
4
26.77/34.21
37.12/47.00
23.48/28.23
5
26.64/34.43
37.24/47.04
23.89/28.27
+
+Table 4: Evaluation of different coordinate feature fusion with GCE on KITTI validation set. Baseline is the Group (II) in Table 2.
+
+
Method
AP3D
Baseline
Mod. 26.78
Easy 37.29
Hard 24.11
F+GCE
27.08
37.33
24.07
G+GCE
27.12
37.38
24.11
All + GCE
27.07
37.43
24.18
+
+Localization boosting iteration settings We explore the effect of different localization boosting iteration settings in this part. For a fair comparison, we do not perform the confidence constraint on regression loss. As illustrated in Table 3, when boosting iteration $T = 3$ , we achieve the best 3D detection performance. More iterations of boosting do not bring improvements, which might be caused by overfitting with the increasing of network parameters.
+
+To verify the improvement of each step in boosting procedure, we conduct the comparison of localization errors at iteration $T = 3$ on the specific metrics (location “xyz”) of the ground truth. In particular, three stacked localization networks $F$ generate intermediate localization $^ { \bullet \bullet } \mathrm { l o c . } 1 / 2 / 3 ^ { \bullet \bullet }$ and $G$ output the final localization “loc.4”. As shown in Figure 3, we can see that the distributions of $\mathbf { \ddot { x } } ^ { , 5 }$ , “y” and “z” errors tend to distributed to zero with localization boosting iterating. For instance, the red line in left chart is narrow and tall near zero along horizontal axis compared with other lines, which means that the corresponding x coordinate is more accurate than others. This further suggests that localization boosting is useful for object localization. The corresponding BEV visualization will be shown in Supplementary Material.
+
+
+Figure 4: Qualitative comparison of ground truth (green), base method PatchNet (blue), and our method (red) on KITTI val set. The first and second rows show RGB and BEV images respectively.
+
+Table 5: Comparison of generalization on KITTI validation set. $^ *$ denotes that the method is reproduced by ourselves.
+
+
Method
AP3D
APBEV
Mod.
Easy
Hard
Mod.
Easy
Hard
Pseudo-LiDAR*[42]
23.04
32.27
19.67
31.06
42.45
25.67
Pseudo-LiDAR+ CLB
24.14
34.46
20.16
32.41
44.98
26.82
Pseudo-LiDAR + CLB +GCE
24.43
34.34
20.18
32.50
45.35
26.91
+
+Impact of global context encoding We also explore where the global context representation fusion operates. We take Group II as the baseline, and perform feature fusion on localization regression network $F$ (row one), 3D estimation network $G$ (row two) or on both (final row). RoI features are encoded into a vector with GCE and then concatenate with the feature vectors from network ( $F$ or $G$ ) global pooling. As shown in Table 4, the operation on $G$ outperforms it on $F$ , which indicates that image representation is more suitable for the overall box prediction rather than only localization as it contains the additional semantic appearance information. Although operation on all networks achieves a lightly higher than it on $G$ on the “Easy” and “Hard” set, introducing parameters is much larger due to operation on stacked localization networks. Hence, we only apply GCE on network $G$ in our approach for a lightweight network and avoid overfitting during training.
+
+Generally applicable to other coordinate-based algorithm In this section, we demonstrate the generalization capability of our algorithm to classic coordinate-based methods Pseudo-LiDAR [42]. As shown in Table 5, each component of our algorithm improves the original methods a lot. Specially, our approach improves Pseudo-LiDAR by 1.43/2.06/0.51 while 1.22/1.99/3.36 gains on PatchNet.
+
+Comparison with state-of-the-arts We build our test detector on the current state-of-the-art coordinate-based method PatchNet, and results are shown in Table 6. Quantitatively, our method achieves the highest performance on “Mod.” set with 22 FPS on NvidiaTesla v100 including 2D detector inference time, which is the main setting for ranking on the benchmark. Specially, large margins, 2.25/5.32/1.14 on 3D detection and 2.17/6.68/0.95 on BEV, are observed over the base method PatchNet with only additional 3.41M parameters. Besides, our methods also outperforms the pixel-based state-of-the-arts methods Liu et al. [26] especially on “Hard” set.
+
+Qualitative comparisons are shown in Figure 4. The ground truth, base method (PatchNet), and our method are colored in green, blue, and red, respectively. For better visualization, the first and second rows show RGB images and BEV images, respectively. Compared with the base method, our algorithm can produce higher-quality 3D bounding boxes in different kinds of scenes.
+
+Table 6: Comparison with SoTA methods on the KITTI test set at $\mathrm { I o U } = 0 . 7$ . Our algorithm achieves new SoTA performance. “Depth” means if the method belongs to depth-assisted methods or not. “Type” indicates the method input pattern, “Pixel” denotes the methods with image as inputs directly while “Coordinate” means the coordinate-based methods with 3D coordinates as inputs.
+
+
Method
Depth
Type
AP3D
APBEV
Mod.
Easy
Hard
Mod.
Easy
Hard
AM3D [29]
yes
Coordinate
10.74
16.50
9.52
17.32
25.30
14.91
PatchNet [27]
yes
Coordinate
11.12
15.68
10.17
16.86
22.97
14.97
GrooMeD-NMS[20]
no
Pixel
12.32
18.10
9.65
18.27
26.19
14.05
Kinematic3D[3]
yes
Pixel
12.72
19.07
9.17
17.52
26.69
13.10
DDMP-3D[41]
yes
Pixel
12.78
19.71
9.80
17.89
28.08
13.44
Liu et al. [26]
yes
Pixel
13.25
21.65
9.91
17.98
29.81
13.08
PCT
yes
Coordinate
13.37
21.00
11.31
19.03
29.65
15.92
+
+# 5.5 Results on Waymo Open Dataset
+
+Table 7 shows the results of base method PatchNet [27] and our proposed PCT. It can be observed that our method consistently outperforms the base method on mAP/mAPH of $0 . 5 0 \% / 0 . 5 1 \%$ and $0 . 2 8 \% / 0 . 3 0 \%$ on the LEVEL_1 and LEVEL_2 difficulties respectively under $\mathrm { I o U } = 0 . 7$ . Again, our method is efficient, e.g, it takes 5 days to complete training on large scale Waymo dataset with a 8-GPU node. More qualitative results can be seen at Supplementary Material.
+
+Table 7: 3D performance on Waymo validation set. We demonstrate results of base method PatchNet [27] and corresponding PCT at $\mathrm { I o U } = 0 . 7$ and $\mathrm { I 0 U } = 0 . 5$ . Our proposed PCT achieves consistent improvements on all settings.
+
+
Difficulty
Threshold
Method
3D mAP/3D mAPH
Overall
0-30m
30-50m
50-8
LEVEL_1
IoU=0.7
PatchNet PCT
0.39/0.37 0.89 / 0.88
1.67 / 1.63 3.18 / 3.15
0.13/0.12
0.03/0.03 0.07 /0.07
IoU=0.5
PatchNet
2.92/2.74
10.03/9.75
0.27 / 0.27 1.09/ 0.96
0.23/0.18
PCT
4.20 /4.15
14.70 / 14.54
1.78 / 1.75
0.39 / 0.39
LEVEL_2
IoU=0.7
PatchNet
0.38/0.36
1.67 / 1.63
0.13/0.11
0.03/0.03
IoU=0.5
PCT PatchNet
0.66 / 0.66
3.18 /3.15
0.27 /0.26
0.07 /0.07
2.42/2.28
10.01/9.73
1.07 /0.94
0.22/0.16
PCT
4.03 /3.99
14.67 / 14.51
1.74 / 1.71
0.36 / 0.35
+
+# 6 Conclusions
+
+In this paper, we have introduced a novel approach PCT to address the inaccurate localization problem for monocular 3D object detection. This is achieved by iteratively transforming the coordinate representation with a confidence-aware booting mechanism. Meanwhile, global context is introduced to compensate for the missing of semantic image representation in coordinated-based methods. Through extensive experiments, we have shown that our proposed PCT substantially improve the performance of the coordinate-based model by a large margin, and achieve state-of-the-art monocular 3D detection performance on KITTI test set. Moreover, we also show consistent improvements compared to the strong baseline on the large-scale Waymo Open dataset.
+
+There are several limitations that could indicate the possible directions for future work. First, the performance of off-the-shelf 2D detector directly influences the accuracy of coordinate-based methods, hence how to effectively design the 3D box estimation algorithm to fit with existing 2D detectors is important. Second, we only concentrate on the lightweight coordinate-based methods. It requires further exploration to extend our approach to pixel-based methods. Finally, our proposed global context encoding is a simple module. Despite working well, a more tailored feature fusion strategy between coordinate representation and RGB image representation is worth exploring.
+
+Potential impacts. Our method focuses on the monocular 3D detection which can be applied in autonomous driving field. One potential social problem of our work is that it may aggravate the employment crisis of human servants and drivers, which replaces human with autonomous robots and intelligent systems.
+
+# Acknowledgments
+
+This work was supported by Shanghai Municipal Science and Technology Major Projects (No.2021SHZDZX0103 and No.2018SHZDZX01).
+
+# References
+
+[1] Shariq Farooq Bhat, Ibraheem Alhashim, and Peter Wonka. Adabins: Depth estimation using adaptive bins. In CVPR, 2021.
+[2] Garrick Brazil and Xiaoming Liu. M3d-rpn: Monocular 3d region proposal network for object detection. In ICCV, 2019.
+[3] Garrick Brazil, Gerard Pons-Moll, Xiaoming Liu, and Bernt Schiele. Kinematic 3d object detection in monocular video. arXiv preprint, 2020.
+[4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
+[5] Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew G Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun. 3d object proposals for accurate object class detection. In NeurIPS, 2015.
+[6] Yongjian Chen, Lei Tai, Kai Sun, and Mingyang Li. Monopair: Monocular 3d object detection using pairwise spatial relationships. In CVPR, 2020.
+[7] Corinna Cortes, Mehryar Mohri, and Umar Syed. Deep boosting. In ICML, 2014.
+[8] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017.
+[9] Mingyu Ding, Yuqi Huo, Hongwei Yi, Zhe Wang, Jianping Shi, Zhiwu Lu, and Ping Luo. Learning depth-guided convolutions for monocular 3d object detection. In CVPR, 2019.
+[10] Liang Du, Xiaoqing Ye, Xiao Tan, Jianfeng Feng, Zhenbo Xu, Errui Ding, and Shilei Wen. Associate-3ddet: Perceptual-to-conceptual association for 3d point cloud object detection. In CVPR, 2020.
+[11] Liang Du, Xiaoqing Ye, Xiao Tan, Edward Johns, Bo Chen, Errui Ding, Xiangyang Xue, and Jianfeng Feng. Ago-net: Association-guided 3d point cloud object detection network. TPAMI, 2021.
+[12] Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, 2001.
+[13] Jerome H Friedman. Stochastic gradient boosting. Computational statistics & data analysis, 2002.
+[14] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In CVPR, 2018.
+[15] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. http://www.cvlibs. net/datasets/kitti/eval_object.php?obj_benchmark $\cdot ^ { = }$ 3d. 2013.
+[16] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. IJRR, 2013.
+[17] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, 2012.
+[18] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017.
+[19] Nikolaos Karianakis, Thomas J Fuchs, and Stefano Soatto. Boosting convolutional features for robust object proposals. arXiv preprint, 2015.
+[20] Abhinav Kumar, Garrick Brazil, and Xiaoming Liu. Groomed-nms: Grouped mathematically differentiable nms for monocular 3d object detection. In CVPR, pages 8973–8983, 2021.
+[21] Haoxiang Li, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Gang Hua. Efficient boosted exemplar-based face detection. In CVPR, 2014.
+[22] Haoxiang Li, Zhe Lin, Xiaohui Shen, Jonathan Brandt, and Gang Hua. A convolutional neural network cascade for face detection. In CVPR, 2015.
+[23] Peixuan Li, Huaici Zhao, Pengfei Liu, and Feidao Cao. Rtm3d: Real-time monocular 3d detection from object keypoints for autonomous driving. In ECCV, 2020.
+[24] Xuchun Li, Lei Wang, and Eric Sung. A study of adaboost with svm based weak learners. In IJCNN, 2005.
+[25] Lijie Liu, Jiwen Lu, Chunjing Xu, Qi Tian, and Jie Zhou. Deep fitting degree scoring network for monocular 3d object detection. In CVPR, 2019.
+[26] Y. Liu, Y. Yuan, and M. Liu. Ground-aware monocular 3d object detection for autonomous driving. IEEE Robotics and Automation Letters, 2021.
+[27] Xinzhu Ma, Shinan Liu, Zhiyi Xia, Hongwen Zhang, Xingyu Zeng, and Wanli Ouyang. Rethinking pseudo-lidar representation. In ECCV, 2020.
+[28] Xinzhu Ma, Shinan Liu, Zhiyi Xia, Hongwen Zhang, Xingyu Zeng, and Wanli Ouyang. https: //github.com/xinzhuma/patchnet. 2020.
+[29] Xinzhu Ma, Zhihui Wang, Haojie Li, Pengbo Zhang, Wanli Ouyang, and Xin Fan. Accurate monocular 3d object detection via color-embedded 3d reconstruction for autonomous driving. In ICCV, 2019.
+[30] Arsalan Mousavian, Dragomir Anguelov, John Flynn, and Jana Kosecka. 3d bounding box estimation using deep learning and geometry. In CVPR, 2017.
+[31] Erli Ouyang, Li Zhang, Mohan Chen, Anurag Arnab, and Yanwei Fu. Dynamic depth fusion and transformation for monocular 3d object detection. In ACCV, 2020.
+[32] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. In CVPR, 2018.
+[33] Cody Reading, Ali Harakeh, Julia Chae, and Steven L. Waslander. Categorical depth distributionnetwork for monocular 3d object detection. In CVPR, 2021.
+[34] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015.
+[35] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. In CVPR, 2019.
+[36] Xuepeng Shi, Zhixiang Chen, and Tae-Kyun Kim. Distance-normalized unified representation for monocular 3d object detection. In ECCV, 2020.
+[37] Jeany Son, Ilchae Jung, Kayoung Park, and Bohyung Han. Tracking-by-segmentation with online gradient boosting decision tree. In ICCV, 2015.
+[38] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al. Scalability in perception for autonomous driving: Waymo open dataset. In CVPR, 2020.
+[39] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al. https://github.com/ waymo-research/waymo-open-dataset. 2020.
+[40] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In ICCV, 2019.
+[41] Li Wang, Liang Du, Xiaoqing Ye, Yanwei Fu, Guodong Guo, Xiangyang Xue, Jianfeng Feng, and Li Zhang. Depth-conditioned dynamic message propagation for monocular 3d object detection. In CVPR, 2021.
+[42] Yan Wang, Wei-Lun Chao, Divyansh Garg, Bharath Hariharan, Mark Campbell, and Kilian Q Weinberger. Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. In CVPR, 2019.
+[43] Xinshuo Weng and Kris Kitani. Monocular 3d object detection with pseudo-lidar point cloud. In ICCV workshops, 2019.
+[44] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 2018.
+[45] Xiaoqing Ye, Liang Du, Yifeng Shi, Yingying Li, Xiao Tan, Jianfeng Feng, Errui Ding, and Shilei Wen. Monocular 3d object detection via feature domain adaptation. In ECCV, 2020.
+[46] Yurong You, Yan Wang, Wei-Lun Chao, Divyansh Garg, Geoff Pleiss, Bharath Hariharan, Mark Campbell, and Kilian Q Weinberger. Pseudo-lidar++: Accurate depth for 3d object detection in autonomous driving. arXiv preprint, 2019.
+[47] Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. In CVPR, 2018.
+[48] Yunpeng Zhang, Jiwen Lu, and Jie Zhou. Objects are different: Flexible monocular 3d object detection. In CVPR, 2021.
+[49] Xingyi Zhou, Dequan Wang, and Philipp Krähenbühl. Objects as points. arXiv preprint, 2019.
+[50] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In CVPR, 2018.
+[51] Yi Zhu, Zhongyue Zhang, Chongruo Wu, Zhi Zhang, Tong He, Hang Zhang, R. Manmatha, Mu Li, and Alexander Smola. Improving semantic segmentation via self-training. arXiv preprint arXiv:2004.14960, 2020.
+
+# Checklist
+
+1. For all authors...
+
+(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] We have described exactly in abstract section and Sec. 1.
+(b) Did you describe the limitations of your work? [Yes] See Sec. 6.
+(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Sec. 6.
+(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
+
+2. If you are including theoretical results...
+
+(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
+
+3. If you ran experiments...
+
+(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We demonstrate the codes in Github website. The dataset is public and URL [15, 39] is also attached in Sec. 5.
+(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Sec. 5.3.
+(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We report experiments results at the fixed seed.
+
+(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] The type of resources can be seen at Sec. 5.3. And each GPU can run two experiments, thus, our included experiments (total number of 15) in paper require about 8 Nvidia Tesla v100 GPUs (16G).
+
+4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
+
+(a) If your work uses existing assets, did you cite the creators? [Yes] See Sec. 5
+(b) Did you mention the license of the assets? [Yes] We conduct experiments on KITTI (license: CC BY-NC-SA 3.0) and Waymo (license: Custom (non-commercial)).
+(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
+(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
+(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] We conduct experiments only on public datasets.
+
+5. If you used crowdsourcing or conducted research with human subjects...
+
+(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
+(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
+(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
\ No newline at end of file
diff --git a/md/train/5FRJWsiLRmA/5FRJWsiLRmA.md b/md/train/5FRJWsiLRmA/5FRJWsiLRmA.md
new file mode 100644
index 0000000000000000000000000000000000000000..3fe2811a1e36c03630f7c4da0e2ef1aa710825df
--- /dev/null
+++ b/md/train/5FRJWsiLRmA/5FRJWsiLRmA.md
@@ -0,0 +1,416 @@
+# RESERVOIR TRANSFORMERS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We demonstrate that transformers obtain impressive performance even when some of the layers are randomly initialized and never updated. Inspired by old and wellestablished ideas in machine learning, we explore a variety of non-linear “reservoir” layers interspersed with regular transformer layers, and show improvements in wall-clock compute time until convergence, as well as overall performance, on various machine translation and (masked) language modelling tasks.
+
+# 1 INTRODUCTION
+
+Transformers (Vaswani et al., 2017) have dominated natural language processing (NLP) in recent years, from large scale machine translation (Ott et al., 2018) to pre-trained (masked) language modeling (Devlin et al., 2018; Radford et al., 2018), and are becoming more popular in other fields as well, from reinforcement learning (Vinyals et al., 2019) to speech recognition (Baevski et al., 2019) and computer vision (Carion et al., 2020). Their success is enabled in part by ever increasing computational demands, which has naturally led to an increased interest in improving their efficiency. Scalability gains in transformers could facilitate bigger, deeper networks with longer contexts (Kitaev et al., 2020; Wang et al., 2020; Beltagy et al., 2020; Kaplan et al., 2020; Tay et al., 2020b). Conversely, improved efficiency could reduce environmental costs (Strubell et al., 2019) and hopefully help democratize the technology.
+
+In this work, we explore a simple question: if some layers of the transformer are kept frozen—i.e., never updated after random initialization—can we match the performance of fully learned transformers, while being more efficient? Surprisingly, the answer is resoundingly yes; and what is more, we find that freezing layers may actually improve performance.
+
+Beyond desirable efficiency gains, random layers are interesting for several additional reasons. Fixed randomly initialized networks (Gallicchio & Scardapane, 2020) converge to Gaussian processes in the limit of infinite width (Daniely et al., 2016), have intriguing interpretations in metric learning (Rosenfeld & Tsotsos, 2019; Giryes et al., 2016), and have been shown to provide excellent “priors” either for subsequent learning (Ulyanov et al., 2018) or pruning (Frankle & Carbin, 2018). Fixed layers allow for efficient low-cost hardware implementations (Schrauwen et al., 2007) and can be characterized using only a random number generator and its seed, which might have repercussions in distributed training and enables highly efficient deployment to edge devices. The strong performance of networks with fixed layers also sheds new light on the inner workings of BERT (Devlin et al., 2018), and layer-wise interpretations of such models (Rogers et al., 2020; Tenney et al., 2019). It appears that “not all layers are created equal” (Zhang et al., 2019) is true to such an extent that some layers can simply remain random and fixed.
+
+These ideas have a long history in machine learning. By Cover’s theorem (Cover, 1965), any highdimensional non-linear transformation is more likely to be linearly separable than its lower-or-equaldimensional input space. By Johnson-Lindenstrauss (Johnson & Lindenstrauss, 1984), random projections distort Euclidean distances very little under mild assumptions, which is useful e.g. for dimensionality reduction and random indexing (Sahlgren, 2005). Fixed random layers in neural networks pre-date deep learning by far (Gamba et al., 1961; Baum, 1988). Indeed, random kernel methods have been an impactful idea in machine learning (Rahimi & Recht, 2008; 2009).
+
+One way to think of such layers is as “reservoirs” (Lukosevi ˇ cius & Jaeger, 2009), where a highly ˇ non-linear high-dimensional black box representation is provided to a lightweight “readout” network, as in echo state networks (Jaeger, 2003) and liquid state machines (Maass et al., 2002). The benefit of such an approach is that the reservoir has fixed parameters and is computationally efficient, as it can be pre-computed and does not (necessarily) require backpropagation.
+
+In NLP, Wieting & Kiela (2019) showed that random sentence encoders present a strong baseline for text classification, with subsequent work showing applications in a variety of NLP tasks (Enguehard et al., 2019; Garg et al., 2020; Pilault et al., 2020). To our knowledge, this work is the first to examine this phenomenon in transformers, and the first to recursively alternate reservoirs with subsequent transformer layers acting as readout functions. We introduce “reservoir transformers”, wherein fixed random reservoir layers are interspersed with regular updateable transformer layers. The goal of this work is not necessarily to set a new state of the art, but to put our understanding of transformer models on a more solid footing by providing empirical evidence of their capabilities even when some of their parameters are fixed. Our contributions are as follows:
+
+• We introduce a new area under the convergence curve metric for measuring performanceefficiency trade-offs, and show that replacing regular transformer layers with reservoir layers leads to better results on that metric.
+• We show that the addition of reservoir layers in fact leads to improved test set generalization on a variety of tasks in a variety of settings.
+We show that pre-trained masked language modelling architectures like BERT and RoBERTa (Liu et al., 2019) can benefit from having some of their layers frozen, both during pre-training as well as when fine-tuning on downstream tasks.
+• In addition, we experiment with different types of reservoir layers, including convolutional and recurrent neural network-based ones. We also show empirical evidence that the backward pass can be entirely skipped by approximating top-layer gradients using an approach we call backskipping, with a relatively small sacrifice in performance.
+
+# 2 APPROACH
+
+This paper is based on a very simple idea. Neural networks are trained via backpropagation, which involves consecutive steps of matrix addition and multiplication, i.e.,
+
+$$
+\theta _ { t + 1 } \theta _ { t } - \eta \frac { \partial J } { \partial \theta _ { t } } ; \frac { \partial J } { \partial \theta _ { t } } = \frac { \partial J } { \partial L _ { n } } \frac { \partial L _ { n } } { \partial L _ { n - 1 } } \cdot \cdot \cdot \frac { \partial L _ { 1 } } { \partial L _ { 0 } } \frac { \partial L _ { 0 } } { \partial x }
+$$
+
+for some objective $J$ , parameterization $\theta$ and learning rate $\eta$ , with the gradient computed via the chain rule, where $L _ { i }$ is the $i$ -th layer of the neural network and $x$ is the input. Let $L \ =$ Transformer $( X )$ be a single layer in a Transformer network (Vaswani et al., 2017), i.e.,
+
+$$
+\begin{array} { r } { H = \mathbf { M } \mathbf { u } ] \mathrm { t i } \mathbf { H e a d } \mathbf { S e l f A t t n } ( \mathbf { L a y e r N o r m } ( X ) ) + X } \\ { L = \mathbf { F F N } ( \mathbf { L a y e r N o r m } ( H ) ) + H } \end{array}
+$$
+
+Now, during every “backward pass”, we compute the Jacobian for parameters $\theta ^ { L }$ at layer $L$ , which are used to update the parameters of $L$ , $\theta _ { t } ^ { L }$ , as well as to compute the next layer’s Jacobian, thus back-propagating the gradients. In this work however, for some of the layers, we still backpropagate through them to compute gradients for earlier layers, but we never update their parameters. As a result, these layers stay fixed at their random initialization, saving computational resources.
+
+# 2.1 BACKGROUND
+
+Naturally, never updating some of the parameters is computationally more efficient, as some matrix addition operations can be skipped in the backward pass, but why is this not detrimental to the performance of the network?
+
+In the early days of neural networks, the bottom layers were often kept fixed as “associators” (Block, 1962), or what Minsky & Papert (2017) called the Gamba perceptron (Gamba et al., 1961; Borsellino & Gamba, 1961). Fixed random networks (Baum, 1988; Schmidt et al., 1992; Pao et al., 1994) have been explored from many angles, including as “random kitchen sink” kernel machines (Rahimi & Recht, 2008; 2009), “extreme learning machines” (Huang et al., 2006) and reservoir computing (Jaeger, 2003; Maass et al., 2002; Lukosevi ˇ cius & Jaeger, 2009). In reservoir computing, in- ˇ put data are represented through fixed random high-dimensional non-linear representations, called “reservoirs”, which are followed by a regular (often but not necessarily linear) “readout” network to make the final classification decision.
+
+The theoretical justification for these approaches lies in two well-known results in machine learning: Cover’s theorem (Cover, 1965) on the separability of patterns states that high-dimensional non-linear transformations are more likely to be linearly separable; and the Johnson-Lindenstrauss lemma (Johnson & Lindenstrauss, 1984) shows that random projections distort Euclidean distances very little under mild assumptions.
+
+Practically, random layers can be seen as a cheap way to increase network depth. There are interesting advantages to this approach. Fixed layers are known to have particularly low-cost hardware requirements and can be easily implemented on high-bandwidth FPGAs with low power consumption (Hadaeghi et al., 2017; Tanaka et al., 2019), or on optical devices (Hicke et al., 2013). This might yield interesting possibilities for training in a distributed fashion across multiple devices, as well as for neurmorphic hardware (Neftci et al., 2017). This approach also facilitates lower-latency deployment of neural networks to edge devices, since weights can be shared simply by sending the seed number, assuming the random number generator is known on both ends.
+
+# 2.2 RESERVOIR TRANSFORMERS
+
+This work explores inserting random non-linear transformations, or what we call reservoir layers, into transformer networks. Specifically, we experiment with a variety of reservoir layers:
+
+• Transformer Reservoir: The standard transformer layer as described above, but with all parameters fixed after initialization, including the self-attention module.
+• FFN Reservoir: A transformer-style fixed feed-forward layer without any self-attention, i.e., FFN(LayerNorm(Previous layer)) $^ +$ Previous layer.
+• BiGRU Reservoir: A fixed bidirectional Gated Recurrent Unit (Cho et al., 2014) layer, which is closer in spirit to previous work on reservoir computing, most of which builds on recurrent neural network architectures. CNN Reservoir: A fixed Convolutional Neural Network (LeCun et al., 1998) layer, specifically light dynamical convolution layers (Wu et al., 2019), which are known to be competitive with transformers in sequence-to-sequence tasks.
+
+We find that all these approaches work well, to a certain extent. For clarity, we focus primarily on the first two reservoir layers, but include a broader comparison in Appendix A.
+
+In each case, contrary to traditional reservoir computing, our reservoir layers are interspersed throughout a regular transformer network, or what we call a reservoir transformer. A good justification for this approach is that while random projections are not learned and might introduce noise, subsequent normal transformer “readout” layers might allow us to recover from any adverse effects of randomness. For example, previous work has shown that ResNets, with all of their parameters fixed except for the scale and shift parameters of batch normalization, can still achieve high performance, simply by scaling and shifting random features (Frankle et al., 2020). Adding noise to the parameters of neural networks is also known to help convergence and generalization (Jim et al., 1995; 1996; Gulcehre et al., 2016; Noh et al., 2017).
+
+# 3 EVALUATION
+
+We evaluate the proposed approach on a variety of well-known tasks in natural language processing, namely: machine translation, language modelling and masked language model pre-training.
+
+In this work, we are not necessarily interested in obtaining the state of the art on any task or even in improving overall task performance via this method. The main objective is to examine efficiency, i.e. the relationship between compute time and task performance. This is closely related to efforts in Green AI, which are concerned with the trade-offs between compute, data, and performance (Schwartz et al., 2019). We propose a new metric for our purposes, the area under the convergence curve (AUCC): similarly to how the area under the receiver operating characteristic (Bradley, 1997, AUC-ROC) measures a classifier’s performance independent of the classification threshold, AUCC measures a model’s performance independent of the specific compute budget. Specifically, AUCC is computed as follows:
+
+
+Figure 1: Validation BLEU AUCC and test BLEU for IWSLT (high is good). Comparison of regular transformer and reservoir transformer with FFN or Transformer reservoir layers added.
+
+$$
+\int _ { t = 0 } ^ { \hat { T } } \sum _ { x , y \in \mathcal { D } } g _ { t } ( f ( x ) , y )
+$$
+
+where $f$ is the network and $g$ is the evaluation metric, measured until convergence time $\hat { T }$ , which is the maximum convergence time of all models included in the comparison. Note that time here is wall-clock time, not iterations. By convergence, we mean that validation performance has stopped improving, and hence the convergence curve whose area we measure plots the desired metric over time. Runs are averaged over multiple seeds and reported with standard deviation. We normalize raw AUCC scores by their maximum score to ensure a more easily interpretable $[ 0 - 1 ]$ range.
+
+One potential downside of this approach is that the AUCC metric could lead to higher scores for a model that converges quickly but to ultimately worse performance, if measured in a small window. We account for this by making sure that $\hat { T }$ is set sufficiently high. We include the raw validation curves in the appendix and also report test set generalization in each experiment.
+
+# 3.1 EXPERIMENTAL SETTINGS AND IMPLEMENTATION DETAILS
+
+We evaluate on IWSLT de-en (Cettolo et al., 2015) and WMT en-de (Bojar et al., 2014) for machine translation; enwiki8 (LLC, 2009) for language modelling; and experiment with RoBERTa (Liu et al., 2019) in our pretraining experiments. For IWSLT, we follow the pre-processing steps in Edunov et al. (2018). The train/val/test split is $\_$ sentences. For WMT, we follow the pre-processing steps in Ott et al. (2018). The train/val/test split is $4 . 5 \mathrm { M } / 1 6 . 5 \mathrm { k } / 3 \mathrm { k }$ sentences. For enwiki8, we follow the pre-processing steps in Dai et al. (2019). The train/val/test split is 1M/54k/56k sentences. For RoBERTa pretraining, we follow the pre-processing steps in Liu et al. (2019).
+
+We use 8 Volta V100 GPUs for WMT and enwik8, 32 V100 GPUs for RoBERTa and a single V100 for IWSLT. The hyperparameters for IWSLT14 and WMT16 were set to the best-performing values from Ott et al. (2018) and Kasai et al. (2020) respectively. The enwik8 experiment settings followed Bachlechner et al. (2020) and the RoBERTa experiments followed Liu et al. (2019). All experiments were conducted using fairseq (Ott et al., 2019). Our code and experimental settings will be made open source at [ANONYMIZED-GITHUB-URL].
+
+Table 1: Wall-clock time (averaged over multiple runs) saved for IWSLT for different model types and encoder depths. Max BLEU is for validation. Number of layers is for encoder, decoder depth is kept fixed at 2. Ratio is computed compared to comparable number of layers in the normal case.
+
+
Model
#Layers
Frozen
Max BLEU
Train time until max (in hours)
Ratio
# Params Trainable (Total)
Train Time each epoch (in seconds)
Transformer
6
0
34.52 ± 0.07
2.548 ± 0.06
1
26.8M
122.73 ± 1.16
8
0
34.59 ± 0.11
2.557 ± 0.05
1
31.1M
142.28 ± 1.87
10
0
34.56 ± 0.05
3.173 ± 0.04
1
35.3M
161.66 ± 1.54
12
0
34.29 ± 0.12
3.521 ± 0.09
1
39.5M
172.45 ± 1.98
TReservoir
6
2
34.37 ± 0.12
2.422 ± 0.03
0.95
22.6M (26.8M)
120.59 ± 1.32
8
2
34.80 ± 0.07
2.450 ± 0.06
0.96
26.8M (31.1M)
134.49 ± 1.76
10
2
34.70 ± 0.03
2.831 ± 0.05
0.89
31.1M (35.3M)
144.42 ± 1.98
12
2
34.78 ± 0.04
3.476 ± 0.04
0.98
35.3M (39.5M)
159.43 ± 1.67
FFN Reservoir
6
2
34.43 ± 0.15
2.120 ± 0.04
0.83
22.6M (25.8M)
107.71 ± 1.73
8
2
34.56 ± 0.16
2.203 ± 0.06
0.86
26.8M (29.1M)
120.07 ± 1.65
10
2
34.66 ± 0.02
2.493 ± 0.05
0.79
31.1M (33.3M)
130.11 ± 1.43
12
2
34.76 ± 0.03
3.241 ± 0.04
0.92
35.3M (37.5M)
156.32 ± 1.87
LayerDrop
6
2
34.59 ± 0.15
2.364 ± 0.08
0.92
22.6M (26.8M)
119.30 ± 1.36
8
2
34.58 ± 0.16
2.554 ± 0.05
0.99
26.8M (31.1M)
138.62 ± 1.44
10
2
34.57 ± 0.07
3.404 ± 0.06
1.07
31.1M (35.3M)
140.88 ± 1.62
12
2
33.65 ± 0.24
3.251 ± 0.04
0.92
35.3M (39.5M)
160.85 ± 1.49
+
+All the experiments in this paper were run with 3 random seeds and the mean and standard deviation are reported. For the relatively small IWSLT, the $\hat { T }$ value in the AUCC metric was set to 4 hours. For WMT, which is larger, we set it to 20 hours. For enwiki8, it was 30 hours; and for the RoBERTa pre-training experiments, it was set to 60 hours.
+
+The projection weights in random layers were initialized using orthogonal initialization (Saxe et al., 2013), which makes sense since random orthogonal projections should be most informationpreserving, and which was found to work well empirically for initializing fixed random representations in previous work (Wieting & Kiela, 2019). Biases and layer norm parameters were initialized using their respective PyTorch defaults (based on Xavier init; Glorot & Bengio, 2010).
+
+We intersperse reservoir layers in alternating fashion starting from the middle. Specifically, we alternate one reservoir layer with one transformer layer, and place the alternating block in the middle. For example: a 7-layer encoder LLLLLLL in which we replace three layers with reservoirs becomes LRLRLRL, and with two becomes LLRLRLL. See Appendix C for a study comparing this strategy to alternative approaches (e.g., freezing in the bottom, middle or top).
+
+# 4 EXPERIMENTS
+
+In what follows, we first show our main result: reservoir transformers often have better AUCC metrics, less training time per epoch, less convergence time until the best validation performance is achieved, and even improved test set generalization metrics, on a variety of tasks. As a strong baseline method, we compare to LayerDrop (Fan et al., 2019). LayerDrop can also be seen as a method that dynamically bypasses parts of the computation during Transformer training in an attempt to improve efficiency, and is a suitable comparison to examine our methods.. We also examine whether we can minimize the expectation over the gradients of upper layers in the transformer network such that we do not have to pass the true gradients through the reservoir for further efficiency.
+
+# 4.1 MACHINE TRANSLATION
+
+Machine translation (MT) is one of the core tasks of NLP. We demonstrate on two well-known MT datasets, IWSLT’14 German-English and WMT’16 English-German, that reservoir transformers obtain a better AUCC. For the raw validation plots over time that were used to calculate the AUCC, please refer to Appendix F.
+
+Following Kasai et al. (2020), the architecture of the network is an N-layer reservoir transformer encoder, followed by a regular shallow one- or two-layer decoder. This design choice has been shown to lead to very good speed and efficiency trade-offs, and serves as a good baseline for our experiments. Moreover, shallow decoders make it easier to decide where to place reservoir layers (in the encoder) and makes it more straightforward to identify where performance gains come from.
+
+
+Figure 2: Validation BLEU AUCC and test BLEU for WMT (high is good). Comparison of regular transformer and reservoir transformer with FFN or Transformer reservoir layers added.
+
+
+Figure 3: Validation BPC AUCC and test BPC on the enwik8 language modelling task (low is good). Comparison of regular and reservoir transformers for varying depths.
+
+Figure 1 shows the results for IWSLT. On the y-axis we show validation AUCC for the BLEU metric; on the $\mathbf { X } ^ { } -$ -axis we show the number of updatable layers in the encoder. The performance of a regular transformer encoder with 6 layers and a reservoir transformer encoder with 6 layers plus N additional reservoir layers are plotted for the same $\mathbf { X }$ -axis value to show the total number of updated layers. Plots for the total number of layers (updatable plus not-updatable, so essentially shifted versions) are shown in Appendix E. Table 1 shows the time it took to achieve the maximum validation BLEU score and how that relates to the regular transformer, demonstrating that reservoir transformers consistently converge faster in terms of wall-clock time, up to $22 \%$ as much with the same number of updateable layers. We save as much as $27 \%$ time until convergence a 24 layer model on WMT, as shown in Table 3. One other noticeable point is that we can see that the T Reservoir achieves similar performance to LayerDrop on IWSLT and WMT in terms of wall-clock per epoch and wall-clock time to the best performance. However, on both tasks, FFN Reservoir performs much better than LayerDrop in terms of efficiency per epoch and achieves better/similar performance in less time in each case. As a point of reference, a half hour gain on IWSLT translates to a gain of several days in the training of bigger transformer models like GPT-3 (Brown et al., 2020).
+
+We observe that reservoir transformers consistently perform better than, or are competitive to, regular transformers, both in terms of validation BLEU AUCC as well as test time BLEU, for all examined encoder depths.
+
+
+Figure 4: Downstream RoBERTa performance on SST-2 (left) and MultiNLI-matched (right).
+
+Figure 2 shows a similar trend for WMT. WMT is much larger and requires a much deeper encoder, as illustrated by the fact that a certain minimum depth is required for reservoir transformers to achieve a comparable validation AUCC. At test time, reservoir transformers outperform regular transformers for almost all encoder depths. The FFN reservoir transformer seems to work best in both cases, which is surprising because it does not have any self-attention component at all. This finding shows that self-attention, or the mechanism to summarize context information, should be learned if present. Once the context features have been gathered, a random projection via a fixed FFN module appears to be beneficial, at least for MT.
+
+# 4.2 LANGUAGE MODELLING
+
+To examine whether the same findings hold for other tasks, we evaluate on the enwiki8 (LLC, 2009) language modelling task. We examine the BPC (bits per character) rate for a variety of network depths (since the task is language modelling, these layers are in the decoder). The results show that we obtain consistently better BPC for lower depths, except for the 64-layer regular transformer, which appears to be particularly optimal for this task. We observe similar trends during test time.
+
+# 4.3 MASKED LANGUAGE MODEL PRETRAINING
+
+We train RoBERTa (Liu et al., 2019) models from scratch at a variety of depths, both in the normal and reservoir setting. We find that these networks show minor differences in their best perplexity and similar AUCC perplexity (see Appendix D). We then examine the performance of these models when fine-tuned on downstream tasks, specifically the well known SST-2 (Socher et al., 2013) and MultiNLI1 (Williams et al., 2017) tasks. When fine-tuning the reservoir models, we keep the reservoir layers fixed (including them in fine-tuning did not work very well, see Appendix D).
+
+Figure 4 shows the results of fine-tuning. We observe that the reservoir transformer outperforms normal RoBERTa at all depths in both tasks. At lower depth, the improvements are substantial. As a sanity check, we also experiment with freezing some of the layers in normal RoBERTa during fine-tuning (Transformer frozen finetuned) and show that this helps a little but is still outperformed by the reservoir transformer.
+
+These findings suggest that you can train a RoBERTa model without updating all of the layers, achieve similar perplexity at a similar computational cost, but with better downstream performance. The fact that some layers can be kept random and entirely fixed during training, without sacrificing any performance, raises intriguing questions for “BERTology” (Rogers et al., 2020) and for the study of what different layers in transformers learn.
+
+
+Figure 5: IWSLT comparison of normal v frozen v backskipped
+
+# 4.4 BACKSKIPPING
+
+With the reservoir transformers as described above, we obtain better efficiency by skipping the “gradient application” matrix addition step in some of the layers (i.e., updating the weights). One step further would be to investigate skipping the entire backward pass for reservoirs altogether, which would save us from having to do the much more expensive matrix multiplication for these layers that is required for the propagation of gradients. We report on preliminary experiments where in the backward pass we replace the gradients for the layer $L _ { i }$ going into the reservoir $L _ { i + 1 }$ with a noisy estimate (Jaderberg et al., 2017; Czarnecki et al., 2017). Promisingly, Oktay et al. (2020) recently asked “why spend resources on exact gradients when we’re going to use stochastic optimization?” and show that you can do randomized auto-differentiation quite successfully.
+
+Here, rather than minimizing the actual gradients $\frac { \partial L _ { i } } { \partial \theta ^ { L _ { i } } }$ , we minimize their expectation and train via continuous-action REINFORCE (Williams, 1992). That is, $L _ { i }$ becomes a policy $\pi _ { a }$ : $s \mu$ whei.e., $\textstyle { \frac { 1 } { n } } \sum _ { i = 0 } ^ { n } ( { \dot { R } } ^ { i } - V ^ { i } ( a ) ) ^ { 2 }$ $a \sim \mathcal { N } ( \mu , 1 )$ . We train to miniREINFORCE loss $\mathbb { E } _ { a } \left[ \log ( { \bar { a } } ) \left( R - { \bar { V } } ( a ) \right) \right]$ ion loss via MSE,, where the value network $V$ acts as the baseline. $R$ is defined as the mean of the gradients of the top layer $L _ { i + 2 }$ , with the sign flipped. Thus, simply put, we train to minimize the expectation of the true gradients at the layer directly following the reservoir. We employ an annealing scheme where we first train the value network and propagate the true gradients during warmup. Afterwards, we anneal the probability of backskipping rather than performing a true backward pass (multiplying the probability by 0.99 every iteration until we only backskip). We experimented with setting $R$ to the negation of the total loss as well but found the current reward to work better. We call this approach backskipping.
+
+Figure 5 shows the results as validation BLEU over time. We observe that this approach helps especially during the earlier stages of training. Although it does not match the performance of the approach with true gradients quite yet, it actually performs competitively. Backskipping looks promising as an approach to further reduce computational costs, and would be even more efficient from a hardware perspective since the circuitry for such layers (which do not need to propagate gradients) can effectively be hardwired entirely.
+
+# 5 RELATED WORK
+
+Recent work has shown that modern NLP models are able to function with different numbers of layers for different examples (Elbayad et al., 2019; Fan et al., 2019); that different layers specialize for different purposes (Zhang et al., 2019); that layers can be compressed (Li et al., 2020); and, that layers can be reordered (Press et al., 2019). There is a growing body of work in efficient self-attention networks (Tay et al., 2020b), such as linear attention (Wang et al., 2020), on how to process long context information (Beltagy et al., 2020) and on approximations to make transformers more scalable (Kitaev et al., 2020; Katharopoulos et al., 2020). BigBIRD (Zaheer et al., 2020) provides random keys as additional inputs to its attention mechanism. Locality sensitive hashing (LSH) as employed e.g. in Reformer (Kitaev et al., 2020) utilizes a fixed random projection. Performer (Choromanski et al., 2020) computes the transformer’s multi-head attention weights as a fixed orthogonal random projection. Closely related to this work, Tay et al. (2020a) showed that randomized alignment matrices in their “Synthesizer” architecture are sufficient for many NLP tasks. While these works focus on random attention, we show that entire layers can be random and fixed. We also show that entire layers can be replaced by fixed random projections that do not have any attention whatsoever.
+
+Beyond transformers, random features have been extensively explored. Examples of this include FreezeOut (Brock et al., 2017), deep reservoir computing networks (Scardapane & Wang, 2017; Gallicchio & Micheli, 2017), as well as applications in domains as varied as text classification (Conneau et al., 2017; Zhang & Bowman, 2018; Wieting & Kiela, 2019) or music classification (Pons & Serra, 2019). It is well known that randomly initialized networks can display impressive performance on their own (Ulyanov et al., 2018; Rosenfeld & Tsotsos, 2019; Ramanujan et al., 2020), which underlies, for example, the recently popularized lottery ticket hypothesis (Frankle & Carbin, 2018; Zhou et al., 2019). We know that learning deep overparameterized networks appears to help in general (Li & Liang, 2018; Du et al., 2019). Our method represents an easy and cheap way to add both depth and parameters to transformer networks.
+
+# 6 CONCLUSION
+
+This work demonstrated that state-of-the-art transformer architectures can be trained without updating all of the layers. This complements a long history in machine learning of harnessing the power of random features. In most cases, “reservoir transformers” achieve better performance-efficiency trade-offs as measured by our newly introduced AUCC metric, and better test set generalization, on a variety of tasks and in a variety of settings. Future work includes further investigating hybrid networks and backskipping architectures, as well as utilizing pruning strategies at inference time, in order to try to obtain even better performance/efficiency trade-offs.
+
+# REFERENCES
+
+Thomas Bachlechner, Bodhisattwa Prasad Majumder, Huanru Henry Mao, Garrison W Cottrell, and Julian McAuley. Rezero is all you need: Fast convergence at large depth. arXiv preprint arXiv:2003.04887, 2020.
+Alexei Baevski, Steffen Schneider, and Michael Auli. vq-wav2vec: Self-supervised learning of discrete speech representations. arXiv preprint arXiv:1910.05453, 2019.
+Eric B Baum. On the capabilities of multilayer perceptrons. Journal of complexity, 4(3):193–215, 1988.
+Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
+Hans-Dieter Block. The perceptron: A model for brain functioning. i. Reviews of Modern Physics, 34(1):123, 1962.
+Ondˇrej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Ales Tamchyna. Findings of the 2014 workshop on statistical machine translation. In ˇ Proceedings of the Ninth Workshop on Statistical Machine Translation, Baltimore, Maryland, USA, June 2014. Association for Computational Linguistics.
+A Borsellino and A Gamba. An outline of a mathematical theory of papa. Il Nuovo Cimento (1955- 1965), 20(2):221–231, 1961.
+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.
+Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Freezeout: Accelerate training by progressively freezing layers. arXiv preprint arXiv:1706.04983, 2017.
+Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
+
+Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. arXiv preprint arXiv:2005.12872, 2020.
+
+M. Cettolo, J. Niehues, S. Stuker, L. Bentivogli, and Marcello Federico. Report on the 11 th iwslt ¨ evaluation campaign , iwslt 2014. In Proceedings of IWSLT, 2015.
+
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
+
+Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Jared Davis, Tamas Sarlos, David Belanger, Lucy Colwell, and Adrian Weller. Masked language modeling for proteins via linearly scalable long-context transformers. arXiv preprint arXiv:2006.03555, 2020.
+
+Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. arXiv preprint arXiv:1705.02364, 2017.
+
+Thomas M Cover. Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition. IEEE transactions on electronic computers, (3):326–334, 1965.
+
+Wojciech Marian Czarnecki, Grzegorz Swirszcz, Max Jaderberg, Simon Osindero, Oriol Vinyals, ´ and Koray Kavukcuoglu. Understanding synthetic gradients and decoupled neural interfaces. arXiv preprint arXiv:1703.00522, 2017.
+
+Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, July 2019. Association for Computational Linguistics.
+
+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.
+
+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.
+
+Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675– 1685, 2019.
+
+Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), New Orleans, Louisiana, June 2018. Association for Computational Linguistics.
+
+Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli. Depth-adaptive transformer. arXiv preprint arXiv:1910.10073, 2019.
+
+Joseph Enguehard, Dan Busbridge, Vitalii Zhelezniak, and Nils Hammerla. Neural language priors. arXiv preprint arXiv:1910.03492, 2019.
+
+Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019.
+
+Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
+
+Jonathan Frankle, David J Schwab, and Ari S Morcos. Training batchnorm and only batchnorm: On the expressive power of random features in cnns. arXiv preprint arXiv:2003.00152, 2020.
+
+Claudio Gallicchio and Alessio Micheli. Echo state property of deep reservoir computing networks. Cognitive Computation, 9(3):337–350, 2017.
+
+Claudio Gallicchio and Simone Scardapane. Deep randomized neural networks. In Recent Trends in Learning From Data, pp. 43–68. Springer, 2020.
+
+A. Gamba, L. Gamberini, G. Palmieri, and R. Sanna. Further experiments with papa. Il Nuovo Cimento (1955-1965), 20(2):112–115, 1961.
+
+Ankush Garg, Yuan Cao, and Qi Ge. Echo state neural machine translation. arXiv preprint arXiv:2002.11847, 2020.
+
+Raja Giryes, Guillermo Sapiro, and Alex M Bronstein. Deep neural networks with random gaussian weights: A universal classification strategy? IEEE Transactions on Signal Processing, 64(13): 3444–3457, 2016.
+
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249–256, 2010.
+
+Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. Noisy activation functions. In International conference on machine learning, pp. 3059–3068, 2016.
+
+Fatemeh Hadaeghi, Xu He, and Herbert Jaeger. Unconventional Information Processing Systems, Novel Hardware: A Tour D’Horizon. 2017.
+
+Konstantin Hicke, Miguel Escalona-Moran, Daniel Brunner, Miguel Soriano, Ingo Fischer, and Claudio Mirasso. Information processing using transient dynamics of semiconductor lasers subject to delayed feedback. Selected Topics in Quantum Electronics, IEEE Journal of, 19:1501610– 1501610, 07 2013. doi: 10.1109/JSTQE.2013.2241738.
+
+Guang-Bin Huang, Qin-Yu Zhu, and Chee-Kheong Siew. Extreme learning machine: theory and applications. Neurocomputing, 70(1-3):489–501, 2006.
+
+Max Jaderberg, Wojciech Marian Czarnecki, Simon Osindero, Oriol Vinyals, Alex Graves, David Silver, and Koray Kavukcuoglu. Decoupled neural interfaces using synthetic gradients. In International Conference on Machine Learning, pp. 1627–1635. PMLR, 2017.
+
+Herbert Jaeger. Adaptive nonlinear system identification with echo state networks. In Advances in neural information processing systems, 2003.
+
+Ganesh Jawahar, Benoˆıt Sagot, and Djame Seddah. What does BERT learn about the structure of ´ language? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019.
+
+Kam Jim, Bill G Horne, and C Lee Giles. Effects of noise on convergence and generalization in recurrent networks. In Advances in neural information processing systems, pp. 649–656, 1995.
+
+Kam-Chuen Jim, C Lee Giles, and Bill G Horne. An analysis of noise in recurrent neural networks: convergence and generalization. IEEE Transactions on neural networks, 7(6):1424–1438, 1996.
+
+William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
+
+Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
+
+Jungo Kasai, Nikolaos Pappas, Hao Peng, James Cross, and Noah A Smith. Deep encoder, shallow decoder: Reevaluating the speed-quality tradeoff in machine translation. arXiv preprint arXiv:2006.10369, 2020.
+
+Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franc¸ois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. arXiv preprint arXiv:2006.16236, 2020.
+
+Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
+
+Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
+
+Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 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.
+
+Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joseph E Gonzalez. Train large, then compress: Rethinking model size for efficient training and inference of transformers. arXiv preprint arXiv:2002.11794, 2020.
+
+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.
+
+MultiMedia LLC. Large text compression benchmark. 2009.
+
+Mantas Lukosevi ˇ cius and Herbert Jaeger. Reservoir computing approaches to recurrent neural net- ˇ work training. Computer Science Review, 3(3), 2009.
+
+Wolfgang Maass, Thomas Natschlager, and Henry Markram. Real-time computing without stable ¨ states: A new framework for neural computation based on perturbations. Neural computation, 14 (11):2531–2560, 2002.
+
+Marvin Minsky and Seymour A Papert. Perceptrons: An introduction to computational geometry. MIT press, 2017.
+
+Emre O Neftci, Charles Augustine, Somnath Paul, and Georgios Detorakis. Event-driven random back-propagation: Enabling neuromorphic deep learning machines. Frontiers in neuroscience, 11:324, 2017.
+
+Hyeonwoo Noh, Tackgeun You, Jonghwan Mun, and Bohyung Han. Regularizing deep neural networks by noise: Its interpretation and optimization. In Advances in Neural Information Processing Systems, pp. 5109–5118, 2017.
+
+Deniz Oktay, Nick McGreivy, Joshua Aduol, Alex Beatson, and Ryan P Adams. Randomized automatic differentiation. arXiv preprint arXiv:2007.10412, 2020.
+
+Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. arXiv preprint arXiv:1806.00187, 2018.
+
+Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan $\mathrm { N g }$ , David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
+
+Yoh-Han Pao, Gwang-Hoon Park, and Dejan J Sobajic. Learning and generalization characteristics of the random vector functional-link net. Neurocomputing, 6(2):163–180, 1994.
+
+Jonathan Pilault, Jaehong Park, and Christopher Pal. On the impressive performance of randomly weighted encoders in summarization tasks. arXiv preprint arXiv:2002.09084, 2020.
+
+Jordi Pons and Xavier Serra. Randomly weighted cnns for (music) audio classification. In ICASSP 2019-2019 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 336–340. IEEE, 2019.
+
+Ofir Press, Noah A Smith, and Omer Levy. Improving transformer models by reordering their sublayers. arXiv preprint arXiv:1911.03864, 2019.
+
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2018.
+
+Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pp. 1177–1184, 2008.
+
+Ali Rahimi and Benjamin Recht. Weighted sums of random kitchen sinks: Replacing minimization with randomization in learning. In Advances in neural information processing systems, pp. 1313– 1320, 2009.
+
+Vivek Ramanujan, Mitchell Wortsman, Aniruddha Kembhavi, Ali Farhadi, and Mohammad Rastegari. What’s hidden in a randomly weighted neural network? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11893–11902, 2020.
+
+Anna Rogers, Olga Kovaleva, and Anna Rumshisky. A primer in bertology: What we know about how bert works. arXiv preprint arXiv:2002.12327, 2020.
+
+Amir Rosenfeld and John K Tsotsos. Intriguing properties of randomly weighted networks: Generalizing while learning next to nothing. In 2019 16th Conference on Computer and Robot Vision (CRV), pp. 9–16. IEEE, 2019.
+
+Magnus Sahlgren. An introduction to random indexing. In Methods and applications of semantic indexing workshop at the 7th international conference on terminology and knowledge engineering, 2005.
+
+Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
+
+Simone Scardapane and Dianhui Wang. Randomness in neural networks: an overview. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 7(2):e1200, 2017.
+
+Wouter F Schmidt, Martin A Kraaijveld, and Robert PW Duin. Feedforward neural networks with random weights. In Proceedings of the 11th International Conference on Pattern Recognition, 1992. Vol. II. Conference B: Pattern Recognition Methodology and Systems, pp. 1–4, 1992.
+
+Benjamin Schrauwen, Michiel D’Haene, David Verstraeten, and Jan Campenhout. Compact hardware for real-time speech recognition using a liquid state machine. pp. 1097 – 1102, 09 2007. doi: 10.1109/IJCNN.2007.4371111.
+
+Roy Schwartz, Jesse Dodge, Noah A Smith, and Oren Etzioni. Green ai. arXiv preprint arXiv:1907.10597, 2019.
+
+Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y 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.
+
+Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
+
+Gouhei Tanaka, Toshiyuki Yamane, Jean Benoit Heroux, Ryosho Nakane, Naoki Kanazawa, Seiji ´ Takeda, Hidetoshi Numata, Daiju Nakano, and Akira Hirose. Recent advances in physical reservoir computing: A review. Neural Networks, 115:100 – 123, 2019.
+
+Yi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan, Zhe Zhao, and Che Zheng. Synthesizer: Rethinking self-attention in transformer models. arXiv preprint arXiv:2005.00743, 2020a.
+
+Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv preprint arXiv:2009.06732, 2020b.
+
+Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. arXiv preprint arXiv:1905.05950, 2019.
+
+Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9446–9454, 2018.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
+
+Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michael Mathieu, Andrew Dudzik, Juny- ¨ oung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander S. Vezhnevets, Remi Leblond, Tobias Pohlen, Valentin Dalibard, David ´ Budden, Yury Sulsky, James Molloy, Tom L. Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wunsch, Katrina McKinney, Oliver Smith, Tom ¨ Schaul, Timothy Lillicrap, Koray Kavukcuoglu, Demis Hassabis, Chris Apps, and David Silver. Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature, 575(7782): 350–354, November 2019.
+
+Sinong Wang, Belinda Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020.
+
+John Wieting and Douwe Kiela. No training required: Exploring random encoders for sentence classification. arXiv preprint arXiv:1901.10444, 2019.
+
+Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017.
+
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
+
+Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. arXiv preprint arXiv:1901.10430, 2019.
+
+Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
+
+Chiyuan Zhang, Samy Bengio, and Yoram Singer. Are all layers created equal? arXiv preprint arXiv:1902.01996, 2019.
+
+Kelly Zhang and Samuel Bowman. Language modeling teaches you more than translation does: Lessons learned through auxiliary syntactic task analysis. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2018.
+
+Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski. Deconstructing lottery tickets: Zeros, signs, and the supermask. In Advances in Neural Information Processing Systems, pp. 3597–3607, 2019.
+
+
+Figure 6: IWSLT comparison of different hybrid architectures with different reservoir layers.
+
+
+Figure 7: IWSLT validation AUCC and test BLEU with 6-layer decoder.
+
+A HYBRID NETWORKS AND NON-TRANSFORMER RESERVOIRS
+
+We investigate whether reservoir layers need to be transformer-based (or transformers-withoutattention, i.e., FFN). We examine two different alternatives: bidirectional Gated Recurrent Units (Cho et al., 2014) and Convolutional Neural Networks (LeCun et al., 1998; Kim, 2014), specifically light dynamical convolutions (Wu et al., 2019). Figure 6 shows the results for these hybrids: depending on the setting, they may obtain a better AUCC than the regular transformer, but this is less consistent than with the other reservoir layers, most likely because these layers have different computational properties. It’s possible that these hybrids simply require further tuning, as we found e.g. up-projecting to help for BiGRUs, but studying this is outside of the scope of the current work.
+
+# B DEEP DECODERS
+
+We show that the same results hold for a 6-layer decoder on IWSLT (although less pronounced for AUCC, probably because the decoder is computationally heavier). See Figure 7 and Table 2.
+
+# C FREEZING STRATEGY
+
+We explored different strategies for the placement of reservoir layers and found the “alternating” strategy reported in the main body of the paper to work best. Generally, we found repetitive application of reservoirs to yield diminishing returns, as might be expected. See Figure 8.
+
+Table 2: Wall-clock time (averaged over multiple runs) saved for IWSLT for different model types and encoder depths. Max BLEU is for validation. Number of layers is for encoder, decoder depth is kept fixed at 6. Ratio is computed compared to comparable number of layers in the normal case.
+
+
Model
#Layers
Frozen
Max BLEU
Train time until max (in hours)
Ratio
# Params Trainable (Total)
Train Time each epoch (in seconds)
Transformer
6
0
34.97 ± 0.05
1.984 ± 0.02
1
39.5M
177.84 ± 2.98
8
0
34.99 ± 0.08
2.161 ± 0.03
1
43.7M
206.59 ± 3.47
10
0
34.98 ± 0.04
2.345± 0.02
1
47.9M
236.72 ± 3.52
12
0
34.78 ± 0.11
2.535 ± 0.05
1
52.0M
265.90 ± 4.97
TReservoir
6
2
34.73 ± 0.11
1.838 ± 0.01
0.92
35.3M (39.5M)
166.11 ± 2.21
8
2
35.07 ± 0.05
1.912 ± 0.03
0.88
39.5M (43.7M)
190.08 ± 3.73
10
2
35.02 ± 0.01
1.970 ± 0.04
0.84
43.7M (47.9M)
204.42 ± 2.89
12
2
35.06 ± 0.02
2.429 ± 0.02
0.95
47.8M (52.0M)
236.41 ± 4.35
FFN Reservoir
6
2
34.85 ± 0.10
1.729 ± 0.03
0.87
35.3M (37.4M)
161.72 ± 2.32
8
2
34.99 ± 0.11
1.751 ± 0.02
0.81
39.5M (41.6M)
180.21 ± 2.68
10
2
34.92 ± 0.03
1.907 ± 0.02
0.81
43.7M (45.8M)
191.40 ± 2.49
12
2
35.16 ± 0.04
2.395 ± 0.01
0.94
47.8M (49.9M)
216.08 ± 2.57
LayerDrop
6
22
34.51 ± 0.12
1.908 ± 0.04
0.96
35.3M (39.5M)
169.62 ± 3.16
8
34.77 ± 0.11
2.023 ± 0.02
0.94
39.5M (43.7M)
186.71 ± 2.17
10
2
34.06 ± 0.05
1.912 ± 0.02
0.97
43.7M (47.9M)
205.52 ± 3.31
12
2
34.08 ± 0.13
2.524 ± 0.01
0.99
47.8M (52.0M)
222.45 ± 2.21
+
+
Model
# Layers
Frozen
Max BLEU
Train time until max (in hours)
Ratio
# Params Trainable (Total)
Train Time each epoch (in hours)
Transformer
12
0
24.46 ± 0.04
15.15 ± 0.15
1
75.6M
0.505 ± 0.005
16
0
24.52 ± 0.03
16.05 ± 0.18
88.2M
0.643 ± 0.006
24
0
24.69 ± 0.05
17.61 ± 0.85
1
113.4M
0.877 ± 0.029
32
0
24.83 ± 0.04
18.42 ± 0.28
1
138.6M
1.036 ± 0.010
TReservoir
12
4
24.26 ± 0.08
14.11 ± 0.21
0.93
72.4M (75.6M)
0.472 ± 0.007
16
4
24.50 ± 0.05
15.25 ± 0.28
0.95
75.6M (88.2M)
0.596 ± 0.009
24
4
25.11 ± 0.07
15.89 ± 0.74
0.90
100.8M (113.4M)
0.776 ± 0.024
32
4
24.66 ± 0.04
16.38 ± 0.24
0.88
126.0M (138.6M)
0.998 ± 0.009
FFN Reservoir
12
4
24.42 ± 0.05
14.01 ± 0.09
0.92
72.4M (71.4M)
0.441 ± 0.003
16
4
24.65 ± 0.07
14.53 ± 0.17
0.91
75.6M (83.9M)
0.524 ± 0.006
24
4
24.93 ± 0.04
12.62 ± 1.53
0.71
100.8M (109.2M)
0.743 ± 0.018
32
4
24.98 ± 0.03
13.96 ± 0.19
0.73
126.0M (134.4M)
0.964 ± 0.007
LayerDrop
12
4
24.27 ± 0.03
14.61 ± 0.14
0.96
72.4M (75.6M)
0.489 ± 0.006
16
4
24.15 ± 0.06
15.55 ± 0.54
0.97
75.6M (88.2M)
0.597 ± 0.017
24
4
24.37 ± 0.05
16.25 ± 0.36
0.92
100.8M (113.4M)
0.823 ± 0.013
32
4
23.84 ± 0.03
15.27 ± 0.38
0.83
126.0M (138.6M)
1.028 ± 0.012
+
+Table 3: Wall-clock time (averaged over multiple runs) saved for WMT for different model types and encoder depths. Max BLEU is for validation. Number of layers is for encoder, decoder depth is kept fixed at 1. Ratio is computed compared to comparable number of layers in the normal case.
+
+# D ROBERTA RESULTS
+
+Here we present the additional RoBERTa results for convergence plot and AUCC in various decoder depth setting in Figure 10. As stated in the main paper, the difference of AUCC / Convergence Plot between RoBERTa model with or without Reservoir layers are limited. Moreover, we plot the downstream task performance for SST-2 and MNLI compared to the pretraining wall-clock time in Figure 9. It can be seen that the FFN Reservoir can achieve up to $\cdot$ and $10 \%$ pretraining time savings while matching the best performance of vanilla transformers for MNLI-m and SST2, respectively.
+
+# E RESERVOIR RESULTS FOR TOTAL LAYERS
+
+Here we present the shifted Reservoir Results for IWSLT14, WMT16, Enwik8 and RoBERTa finetuning in Figure 11, 12, 13, 14, respectively. We show the same results also hold when it comes to replace normal transformer blocks with Reservoir blocks at least for MT.
+
+Table 4: Wall-clock time (averaged over multiple runs) saved for IWSLT/WMT for different model types and encoder depths. $\cdot$ Max BLEU is for validation.
+
+
Mode1
#Layers
IWSLT-Dec2 Train time until 95% max (in hours)
Max BLEU (95%)
#Layers
IWSLT-Dec6 Train time until 95% max (in hours)
Max BLEU (95%)
#Layers
WMT-Dec1 Train time until 95% max (in hours)
Max BLEU (95%)
Transformer
6
0.647 ± 0.03
32.89 ± 0.04
6
0.642 ± 0.02
33.36 ± 0.03
16
3.788 ± 0.053
23.36 ± 0.06
0.711 ± 0.05
33.04 ± 0.03
8
0.765 ± 0.03
33.41 ± 0.08
3.820 ± 0.072
23.41 ± 0.05
0.808 ± 0.02
33.96 ± 0.08
10
0.898 ± 0.04
33.32 ± 0.07
5.262 ± 0.607
23.50 ± 0.03
12
1.037 ± 0.03
33.07 ± 0.09
12
1.037 ± 0.03
33.07 ± 0.11
五
6.212 ± 0.232
23.81 ±0.04
0.569 ± 0.02
32.78 ±0.03
6
0.599 ± 0.01
33.09 ± 0.05
3.563 ± 0.061
23.21 ± 0.04
8
0.619 ± 0.04
33.12 ± 0.05
8
0.726 ± 0.02
33.38 ± 0.09
1
3.603 ± 0.056
23.80 ± 0.06
T Reservoir
0.729 ± 0.04
33.13 ± 0.07
10
0.738 ± 0.03
33.37 ± 0.04
24
4.923 ± 0.771
23.75 ± 0.02
12
0.982 ± 0.02
33.03 ± 0.11
12
0.958 ± 0.01
33.46± 0.09
32
5.780 ± 0.214
23.71 ±0.03
6
0.521 ± 0.05
32.85 ± 0.02
6
0.594 ± 0.03
33.13 ± 0.04
12
3.417 ± 0.046
23.22 ± 0.07
8
0.533 ± 0.03
33.84 ± 0.04
8
0.651 ± 0.04
33.36 ± 0.06
16
3.527 ± 0.063
23.54 ± 0.05
10
0.614 ± 0.01
33.05 ± 0.08
10
0.627 ± 0.05
33.26 ± 0.03
24
4.197 ± 0.697
23.74 ± 0.06
LayerDrop
12
0.811 ± 0.02
33.26 ± 0.10
12
0.780 ± 0.02
33.46 ± 0.08
32
4.984 ± 0.321
23.82 ± 0.02
0.837 ±0.08
32.87 ± 0.05
6
0.706 ±0.01
33.08 ± 0.03
12
3.912 ± 0.068
23.33 ± 0.08
6
0.934 ± 0.07
33.12 ± 0.03
8
0.753 ± 0.04
33.14 ± 0.05
16
3.581 ± 0.076
23.17 ± 0.04
10
0.901 ± 0.06
33.18 ±0.02
10
0.691 ± 0.03
32.39 ± 0.05
3
4.875 ± 0.728
23.43 ± 0.07
12
0.914 ± 0.01
32.33 ± 0.06
12
0.803 ± 0.02
32.94 ± 0.10
5.980 ± 0.219
22.97 ± 0.08
+
+
Model
#Layers
IWSLT-Dec2 Train time
IWSLT-Dec6
WMT-Dec1
until 99 % max (in hours)
Max BLEU (99%)
#Layers
Train time until 99 % max (in hours)
Max BLEU (99%)
#Layers
Train time until 99 % max (in hours)
Max BLEU (99%)
Transformer
1.454 ± 0.06
34.24 ± 0.05
6
1.297 ± 0.03
34.69 ± 0.05
1
9.961 ± 0.053
24.27 ± 0.04
1.475 ± 0.09
34.32 ± 0.09
8
1.390 ± 0.02
12.623 ± 0.072
24.35 ± 0.06
10
1.526 ± 0.04
34.25 ± 0.04
1.622 ± 0.05
34.75 ± 0.09 34.64 ± 0.03
3
13.412 ± 0.837
24.49 ± 0.07
12
2.259 ± 0.07
34.24 ± 0.11
10 12
1.748 ± 0.01
34.66 ± 0.08
15.117 ± 0.232
24.56 ± 0.02
TReservoir
1.257 ± 0.04
34.05 ± 0.09
6
1.291 ± 0.03
34.51 ± 0.10
1
8.314 ± 0.062
24.15 ± 0.06
10
1.472 ± 0.06
34.47 ± 0.05
1.339 ± 0.03
34.80 ± 0.04
9.221 ± 0.073
24.41 ± 0.05
12
1.530 ± 0.03
34.36 ± 0.02
10
1.419 ± 0.04
34.72 ± 0.03
10.413 ± 0.580
24.56 ± 0.03
2.043 ± 0.05
34.53 ± 0.07
12
1.642 ± 0.02
34.87 ± 0.02
3
11.465 ± 0.227
24.49 ±0.01
680
1.138 ± 0.03
34.10 ± 0.13
6
1.169 ± 0.02
34.71 ± 0.09
7.407 ± 0.087
24.33 ± 0.08
FFN Reservoir
1.101 ± 0.07
34.32 ± 0.11 34.36 ± 0.03
8 10
1.201 ± 0.03 1.276 ± 0.03
34.79 ±0.08 34.63 ± 0.03
9.336 ± 0.036
24.42 ± 0.05
12
1.281 ± 0.01
9.978 ± 0.546
24.91 ± 0.07
1.785 ± 0.03
34.42 ± 0.06
12
1.440 ± 0.01
34.87 ± 0.02
10.524 ± 0.341
24.96 ± 0.01
8
1.363 ± 0.05
34.58 ± 0.14
6
1.253 ± 0.01
34.42 ± 0.10
8.372 ± 0.059
24.17 ± 0.04
1.468 ± 0.03
34.50 ± 0.12
8
1.244 ± 0.04
34.44 ± 0.09
9.741 ± 0.043
23.93 ± 0.08
LayerDrop
10
1.678 ± 0.04
34.52 ± 0.07
10
33.83 ±0.06
16 3
10.145 ± 0.628
24.07 ± 0.09
12
2.071 ± 0.02
33.45 ± 0.23
12
1.343 ± 0.04 1.423 ± 0.02
33.97 ± 0.12
10.168 ± 0.329
23.81 ± 0.03
+
+Table 5: Wall-clock time (averaged over multiple runs) saved for IWSLT/WMT for different model types and encoder depths. $9 9 \%$ Max BLEU is for validation.
+
+# F VALIDATION PLOTS
+
+Here we present the validation plots for training a 8-layer encoder, 2-layer decoder model for IWSLT14, a 24-layer encoder, 1-layer decoder model for WMT14, a 48-layer decoder model for enwik8 and a 12-layer decoder model for RoBERTa for detailed steps to calculate the AUCC. It can be clearly observed that given the configurations from Section 3.1, all the models have converged. So when we compute the area under the convergence curve, this depicts the training efficiency of the model (basically time x performance) until convergence. Specifically, we set T sufficiently high for computing the AUCC, which is 4h for IWSLT, 20h for WMT, 30h for enwik8 and 60h for RoBERTa pretraning. From the training plot in the appendix, we can see that each model has converged at that point. The Reservoir model in Figure 15 has 2 layers frozen for IWSLT14, 8 layers frozen for enwik8, and 4 layers frozen for WMT14 and RoBERTa.
+
+# G ROBERTA PROBING
+
+We follow Jawahar et al. (2019) and investigate what the frozen layers in the Reservoir Transformer have actually “learned” (while being forzen) as measured by probing tasks, reported in Table 6. The results are gathered over 3 random seeds for reporting the mean and standard deviation. From the table, we can see that generally probing performance is quite similar between Transformer and the T Reservoir model. We also noticed that the representations collected after the frozen layer (3, 5, 7, 9) in the T Reservoir actually have significantly better performance over the regular Transformer representations across all the probing tasks. This has interesting repercussions for the study of “BERTology”, as it clearly shows, somewhat confusingly, that even completely random and frozen layers represent linguistic phenomena.
+
+
+Figure 8: IWSLT with 2-layer decoder using different freezing strategy.
+
+
+Figure 9: RoBERTa Reservoir Results, Pre-training versus downstream task plot for 12 layer RoBERTa. MNLI-m (left). SST-2 (right).
+
+
+Figure 10: RoBERTa Reservoir Results, Training plot for 12 layer RoBERTa (left). AUCC result (right).
+
+
+Figure 11: Validation BLEU AUCC and test BLEU for IWSLT (high is good). Comparison of regular transformer and reservoir transformer with FFN or Transformer reservoir layers added.
+
+
+Figure 12: Validation BLEU AUCC and test BLEU for WMT (high is good). Comparison of regular transformer and reservoir transformer with FFN or Transformer reservoir layers added.
+
+
+Figure 13: Validation BPC AUCC and test BPC on the enwik8 language modelling task (low is good). Comparison of regular and reservoir transformers for varying depths.
+
+
+Figure 14: Downstream RoBERTa performance on SST-2 (left) and MultiNLI-matched (right).
+
+
+Figure 15: IWSLT with 2-layer decoder validation plot (upper left). WMT with 24-layer decoder validation plot (upper right). Enwik8 with 48-layer decoder validation plot (lower left). RoBERTa with 12-layer decoder validation plot (lower right).
+
+
Model
Layer
SentLen (Surface)
TreeDepth (Syntactic)
TopConst (Syntactic)
BShift (Syntactic)
Tense (Semantic)
SubjNum (Semantic)
ObjNum (Semantic)
SOMO (Semantic)
CoordInv (Semantic)
Transformer
84.56 ± 0.54
32.30 ± 0.41
54.40 ± 0.33
49.99 ± 0.01
80.98 ± 0.32
76.26 ± 0.09
50.01 ± 0.19
76.38 ± 0.61
54.33 ± 0.47
87.22 ± 0.07
33.63 ± 0.57
58.38 ± 0.20
50.12 ± 0.17
82.84 ± 0.68
78.65 ± 0.19
51.47 ± 0.53
78.00 ± 1.12
54.66 ± 0.55
84.25 ± 0.16
32.60 ± 0.17
54.41 ± 0.10
50.02 ± 0.01
81.72 ± 0.59
77.00 ± 0.13
51.32 ± 0.64
76.57 ± 1.13
54.13 ± 0.51
87.37 ± 0.20
32.59 ± 0.29
50.06 ± 0.21
69.76 ± 0.26
81.63 ± 1.17
76.47 ± 0.09
52.41 ± 1.49
76.15 ± 0.84
52.62 ± 1.34
5
84.61 ± 0.24
31.14 ± 0.48
44.76 ± 0.38
74.82 ± 0.11
80.16 ± 0.19
73.66 ± 0.16
52.95 ± 1.77
72.90 ± 0.21
51.26 ± 1.14
6
82.56 ± 0.25
30.31 ± 0.40
39.30 ± 0.40
78.80 ±0.38
81.88 ± 0.47
75.30 ± 0.07
56.21 ± 1.26
74.37 ± 0.16
51.44 ± 1.04
70.85 ± 0.13
26.65 ± 0.72
40.70 ± 0.13
78.98 ± 0.32
85.11 ± 0.31
72.03 ± 0.46
58.15 ± 0.46
68.71 ± 0.91
55.39 ± 0.27
8
66.23 ± 1.33
23.46 ± 0.44
25.19 ± 1.02
77.42 ± 0.27
80.35 ± 0.45
67.55 ± 0.99
54.94 ± 2.04
63.69 ± 2.32
50.58 ± 0.83
9
71.17 ± 0.29
31.21 ± 0.31
58.42 ± 0.29
85.55 ± 0.44
86.77 ± 0.19
80.30 ± 0.08
64.36 ± 1.20
81.68 ± 0.45
66.90 ± 0.49
10
73.19 ± 0.50
27.74 ± 0.53
41.01 ± 0.22
83.56 ± 0.96
86.13 ± 0.35
83.04 ± 0.04
62.01 ± 0.59
79.73 ± 0.21
62.60 ± 1.04
11
71.37 ± 0.42
30.22 ± 0.28
48.58 ± 0.35
84.40 ± 0.44
87.28 ± 0.59
82.34 ± 0.15
61.10 ± 0.14
80.00 ± 0.40
64.44 ± 0.38
12
71.66 ± 0.12
33.43 ± 0.18
64.38 ± 0.20
87.38 ± 0.02
88.41 ± 0.09
84.46 ± 0.25
63.01 ± 0.05
81.80 ± 0.27
65.72 ± 0.16
87.75 ± 0.10
31.60 ± 0.21
50.38 ± 0.23
50.00 ± 0.00
80.40 ± 0.18
76.47 ± 0.20
50.53 ± 0.14
73.48 ± 0.15
TReservoir
2
81.28 ± 0.23
34.20 ± 0.41
60.64 ± 0.65
53.55 ± 0.70
61.41 ± 0.42
81.50 ± 0.77
76.33 ± 0.08
50.73 ± 0.34
74.28 ± 0.67
56.82 ± 0.10
3
89.28 ± 0.09
36.42 ± 0.11
67.36 ± 0.45
75.64 ± 0.52
85.42 ± 0.18
80.53 ± 0.02
52.50 ± 1.80
78.47 ± 1.81
57.16 ± 0.27
74.31 ± 0.32
32.42 ± 0.83
55.19 ± 0.33
73.41 ± 0.00
79.56 ± 0.00
75.15 ± 0.08
53.68 ± 0.66
75.02 ± 0.19
56.89 ± 0.08
88.03 ± 0.22 74.55 ± 0.37
38.34 ± 0.64 33.13 ± 0.29
68.65 ± 0.29
82.25 ± 0.12
86.80 ± 0.02
82.27 ± 0.33
57.95 ± 0.24
80.82 ± 0.91
58.05 ± 0.10
52.70 ± 0.81
79.21 ± 0.13
85.70 ± 0.36
77.43 ± 0.03
57.26 ± 0.19
75.38 ± 0.66
51.95 ± 1.30
85.82 ± 0.37 71.69 ± 0.71
37.63 ± 0.13 30.32 ± 0.01
70.43 ± 0.05 48.44 ± 0.30
84.12 ± 0.35 79.12 ± 0.12
86.88 ± 0.07
82.86 ± 0.30
61.17 ± 0.21
80.79 ± 0.17
61.83 ± 0.95
8 9
85.86 ± 0.12
37.89 ± 0.03
69.53 ± 0.37
85.55 ± 0.12
84.75 ± 0.09 87.98 ± 0.22
79.23 ± 0.11 84.13 ± 0.01
59.53 ± 0.16
76.80 ± 0.41
57.34 ± 0.14
69.22 ± 0.23
25.58 ± 0.35
29.20 ± 0.58
78.57 ± 0.09
63.06± 0.01
82.55 ± 0.31
66.07 ± 0.05
10
47.56 ± 0.02
85.02 ± 0.03
75.68 ± 0.16
57.55 ± 1.57
74.70 ± 0.02
55.02 ± 0.64
11
65.70 ± 0.05
30.57 ± 0.03
81.20 ± 0.00
86.78 ± 0.02
83.73 ± 0.05
60.38 ± 0.17
80.59 ± 0.15
62.50 ± 0.11
12
70.61 ± 0.18
34.45± 0.20
64.19 ± 0.10
84.53 ± 0.03
87.48 ± 0.16
84.86 ± 0.14
62.75 ± 0.14
82.08 ± 0.03
64.73 ± 0.06
+
+Table 6: RoBERTa Probing Results. The line in bold text are the the frozen layers in the T Reservoir.
\ No newline at end of file
diff --git a/md/train/B12Js_yRb/B12Js_yRb.md b/md/train/B12Js_yRb/B12Js_yRb.md
new file mode 100644
index 0000000000000000000000000000000000000000..514ff222dba9848536ac857f562734ec92a141f4
--- /dev/null
+++ b/md/train/B12Js_yRb/B12Js_yRb.md
@@ -0,0 +1,342 @@
+# LEARNING TO COUNT OBJECTS IN NATURAL IMAGES FOR VISUAL QUESTION ANSWERING
+
+Yan Zhang & Jonathon Hare & Adam Prugel-Bennett ¨
+
+Department of Electronics and Computer Science University of Southampton {yz5n12,jsh2,apb}@ecs.soton.ac.uk
+
+# ABSTRACT
+
+Visual Question Answering (VQA) models have struggled with counting objects in natural images so far. We identify a fundamental problem due to soft attention in these models as a cause. To circumvent this problem, we propose a neural network component that allows robust counting from object proposals. Experiments on a toy task show the effectiveness of this component and we obtain state-of-theart accuracy on the number category of the VQA v2 dataset without negatively affecting other categories, even outperforming ensemble models with our single model. On a difficult balanced pair metric, the component gives a substantial improvement in counting over a strong baseline by $6 . 6 \%$ .
+
+# 1 INTRODUCTION
+
+Consider the problem of counting how many cats there are in Figure 1. Solving this involves several rough steps: understanding what instances of that type can look like, finding them in the image, and adding them up. This is a common task in Visual Question Answering (VQA) – answering questions about images – and is rated as among the tasks requiring the lowest human age to be able to answer (Antol et al., 2015). However, current models for VQA on natural images struggle to answer any counting questions successfully outside of dataset biases (Jabri et al., 2016).
+
+One reason for this is the presence of a fundamental problem with counting in the widely-used soft attention mechanisms (section 3). Another reason is that unlike standard counting tasks, there is no ground truth labeling of where the objects to count are. Coupled with the fact that models need to be able to count a large variety of objects and that, ideally, performance on non-counting questions should not be compromised, the task of counting in VQA seems very challenging.
+
+To make this task easier, we can use object proposals – pairs of a bounding box and object features – from object detection networks as input instead of learning from pixels directly. In any moderately complex scene, this runs into the issue of double-counting overlapping object proposals. This is a problem present in many natural images, which leads to inaccurate counting in real-world scenarios.
+
+Our main contribution is a differentiable neural network component that tackles this problem and consequently can learn to count (section 4). Used alongside an attention mechanism, this component avoids a fundamental limitation of soft attention while producing strong counting features. We provide experimental evidence of the effectiveness of this component (section 5). On a toy dataset, we demonstrate that this component enables robust counting in a variety of scenarios. On the number category of the VQA v2 Open-Ended dataset (Goyal et al., 2017), a relatively simple baseline model using the counting component outperforms all previous models – including large ensembles of state-of-the-art methods – without degrading performance on other categories.
+
+# 2 RELATED WORK
+
+Usually, greedy non-maximum suppression (NMS) is used to eliminate duplicate bounding boxes. The main problem with using it as part of a model is that its gradient is piecewise constant. Various differentiable variants such as by Azadi et al. (2017), Hosang et al. (2017), and Henderson & Ferrari (2017) exist. The main difference is that, since we are interested in counting, our component does not need to make discrete decisions about which bounding boxes to keep; it outputs counting features, not a smaller set of bounding boxes. Our component is also easily integrated into standard VQA models that utilize soft attention without any need for other network architecture changes and can be used without using true bounding boxes for supervision.
+
+On the VQA v2 dataset (Goyal et al., 2017) that we apply our method on, only few advances on counting questions have been made. The main improvement in accuracy is due to the use of object proposals in the visual processing pipeline, proposed by Anderson et al. (2017). Their object proposal network is trained with classes in singular and plural forms, for example “tree” versus “trees”, which only allows primitive counting information to be present in the object features after region-of-interest pooling. Our approach differs in the way that instead of relying on counting features being present in the input, we create counting features using information present in the attention map over object proposals. This has the benefit of being able to count anything that the attention mechanism can discriminate instead of only objects that belong to the predetermined set of classes that had plural forms.
+
+Using these object proposals, Trott et al. (2018) train a sequential counting mechanism with a reinforcement learning loss on the counting question subsets of VQA v2 and Visual Genome. They achieve a small increase in accuracy and can obtain an interpretable set of objects that their model counted, but it is unclear whether their method can be integrated into traditional VQA models due to their loss not applying to non-counting questions. Since they evaluate on their own dataset, their results can not be easily compared to existing results in VQA.
+
+Methods such as by Santoro et al. (2017) and Perez et al. (2017) can count on the synthetic CLEVR VQA dataset (Johnson et al., 2017) successfully without bounding boxes and supervision of where the objects to count are. They also use more training data ${ \sim } 2 5 0 { , } 0 0 0$ counting questions in the CLEVR training set versus $\sim 5 0 { , } 0 0 0$ counting questions in the VQA v2 training set), much simpler objects, and synthetic question structures.
+
+More traditional approaches based on Lempitsky & Zisserman (2010) learn to produce a target density map, from which a count is computed by integrating over it. In this setting, Cohen et al. (2017) make use of overlaps of convolutional receptive fields to improve counting performance. Chattopadhyay et al. (2017) use an approach that divides the image into smaller non-overlapping chunks, each of which is counted individually and combined together at the end. In both of these contexts, the convolutional receptive fields or chunks can be seen as sets of bounding boxes with a fixed structure in their positioning. Note that while Chattopadhyay et al. (2017) evaluate their models on a small subset of counting questions in VQA, major differences in training setup make their results not comparable to our work.
+
+# 3 PROBLEMS WITH SOFT ATTENTION
+
+The main message in this section is that using the feature vectors obtained after the attention mechanism is not enough to be able to count; the attention maps themselves should be used, which is what we do in our counting component.
+
+Models in VQA have consistently benefited from the use of soft attention (Mnih et al., 2014; Bahdanau et al., 2015) on the image, commonly implemented with a shallow convolutional network. It learns to output a weight for the feature vector at each spatial position in the feature map, which is first normalized and then used for performing a weighted sum over the spatial positions to produce a single feature vector. However, soft spatial attention severely limits the ability for a model to count.
+
+Consider the task of counting the number of cats for two images: an image showing a single cat on a clean background and an image that consists of two side-by-side copies of the first image. What we will describe applies to both spatial feature maps and sets of object proposals as input, but we focus on the latter case for simplicity. With an object detection network, we detect one cat in the first image and two cats in the second image, producing the same feature vector for all three detections. The attention mechanism then assigns all three instances of the same cat the same weight.
+
+
+Figure 1: Simplified example about counting the number of cats. The light-colored cat is detected twice and results in a duplicate proposal. This shows the conversion from the attention weights a to a graph representation A and the eventual goal of this component with exactly one proposal per true object. There are 4 proposals (vertices) capturing 3 underlying objects (groups in dotted lines). There are 3 relevant proposals (black with weight 1) and 1 irrelevant proposal (white with weight 0). Red edges mark intra-object edges between duplicate proposals and blue edges mark the main inter-object duplicate edges. In graph form, the object groups, coloring of edges, and shading of vertices serve illustration purposes only; the model does not have these access to these directly.
+
+The usual normalization used for the attention weights is the softmax function, which normalizes the weights to sum to 1. Herein lies the problem: the cat in the first image receives a normalized weight of 1, but the two cats in the second image now each receive a weight of 0.5. After the weighted sum, we are effectively averaging the two cats in the second image back to a single cat. As a consequence, the feature vector obtained after the weighted sum is exactly the same between the two images and we have lost all information about a possible count from the attention map. Any method that normalizes the weights to sum to 1 suffers from this issue.
+
+Multiple glimpses (Larochelle & Hinton, 2010) – sets of attention weights that the attention mechanism outputs – or several steps of attention (Yang et al., 2016; Lu et al., 2016) do not circumvent this problem. Each glimpse or step can not separate out an object each, since the attention weight given to one feature vector does not depend on the other feature vectors to be attended over. Hard attention (Ba et al., 2015; Mnih et al., 2014) and structured attention (Kim et al., 2017) may be possible solutions to this, though no significant improvement in counting ability has been found for the latter so far (Zhu et al., 2017). Ren & Zemel (2017) circumvent the problem by limiting attention to only work within one bounding box at a time, remotely similar to our approach of using object proposal features.
+
+Without normalization of weights to sum to one, the scale of the output features depends on the number of objects detected. In an image with 10 cats, the output feature vector is scaled up by 10. Since deep neural networks are typically very scale-sensitive – the scale of weight initializations and activations is generally considered quite important (Mishkin & Matas, 2016) – and the classifier would have to learn that joint scaling of all features is somehow related to count, this approach is not reasonable for counting objects. This is evidenced in Teney et al. (2017) where they provide evidence that sigmoid normalization not only degrades accuracy on non-number questions slightly, but also does not help with counting.
+
+# 4 COUNTING COMPONENT
+
+In this section, we describe a differentiable mechanism for counting from attention weights, while also dealing with the problem of overlapping object proposals to reduce double-counting of objects. This involves some nontrivial details to produce counts that are as accurate as possible. The main idea is illustrated in Figure 1 with the two main steps shown in Figure 2 and Figure 3. The use of this component allows a model to count while still being able to exploit the benefits of soft attention.
+
+Our key idea for dealing with overlapping object proposals is to turn these object proposals into a graph that is based on how they overlap. We then remove and scale edges in a specific way such that an estimate of the number of underlying objects is recovered.
+
+Our general strategy is to primarily design the component for the unrealistic extreme cases of perfect attention maps and bounding boxes that are either fully overlapping or fully distinct. By introducing some parameters and only using differentiable operations, we give the ability for the module to interpolate between the correct behaviours for these extreme cases to handle the more realistic cases.
+
+These parameters are responsible for handling variations in attention weights and partial bounding box overlaps in a manner suitable for a given dataset.
+
+To achieve this, we use several piecewise linear functions $f _ { 1 } , \ldots , f _ { 8 }$ as activation functions (defined in Appendix A), approximating arbitrary functions with domain and range [0, 1]. The shapes of these functions are learned to handle the specific nonlinear interactions necessary for dealing with overlapping proposals. Through their parametrization we enforce that $f _ { k } ( 0 ) = 0$ , $f _ { k } ( 1 ) = 1$ , and that they are monotonically increasing. The first two properties are required so that the extreme cases that we explicitly handle are left unchanged. In those cases, $f _ { k }$ is only applied to values of 0 or 1, so the activation functions can be safely ignored for understanding how the component handles them. By enforcing monotonicity, we can make sure that, for example, an increased value in an attention map should never result in the prediction of the count to decrease.
+
+# 4.1 INPUT
+
+Given a set of features from object proposals, an attention mechanism produces a weight for each proposal based on the question. The counting component takes as input the $n$ largest attention weights $\mathbf { \bar { a } } = [ a _ { 1 } , \ldots , a _ { n } ] ^ { \mathsf { T } }$ and their corresponding bounding boxes $\mathbf { b } = [ b _ { 1 } , \ldots , b _ { n } ] ^ { \mathsf { T } }$ . We assume that the weights lie in the interval $[ 0 , 1 ]$ , which can easily be achieved by applying a logistic function.
+
+In the extreme cases that we explicitly handle, we assume that the attention mechanism assigns a value of 1 to $a _ { i }$ whenever the ith proposal contains a relevant object and a value of 0 whenever it does not. This is in line with what usual soft attention mechanisms learn, as they produce higher weights for relevant inputs. We also assume that either two object proposals fully overlap (in which case they must be showing the same object and thus receive the same attention weight) or that they are fully distinct (in which case they show different objects). Keep in mind that while we make these assumptions to make reasoning about the behaviour easier, the learned parameters in the activation functions are intended to handle the more realistic scenarios when the assumptions do not apply.
+
+Instead of partially overlapping proposals, the problem now becomes the handling of exact duplicate proposals of underlying objects in a differentiable manner.
+
+# 4.2 DEDUPLICATION
+
+We start by changing the vector of attention weights a into a graph representation in which bounding boxes can be utilized more easily. Hence, we compute the outer product of the attention weights to obtain an attention matrix.
+
+$$
+\mathbf { A } = \mathbf { a } \mathbf { a } ^ { \mathsf { T } }
+$$
+
+$\mathbf { A } \in \mathbb { R } ^ { n \times n }$ can be interpreted as an adjacency matrix for a weighted directed graph. In this graph, the ith vertex represents the object proposal associated with $a _ { i }$ and the edge between any pair of vertices $( i , j )$ has weight $a _ { i } a _ { j }$ . In the extreme case where $a _ { i }$ is virtually 0 or 1, products are equivalent to logical AND operators. It follows that the subgraph containing only the vertices satisfying $a _ { i } = 1$ is a complete digraph with self-loops.
+
+In this representation, our objective is to eliminate edges in such a way that, conceptually, the underlying true objects – instead of proposals thereof – are the vertices of that complete subgraph. In order to then turn that graph into a count, recall that the number of edges $| E |$ in a complete digraph with self-loops relates to the number of vertices $| V |$ through $| E | = | V | ^ { 2 }$ . $| E |$ can be computed by summing over the entries in an adjacency matrix and $| V |$ is then the count. Notice how when $| E |$ is set to the sum over A, ${ \sqrt { \textstyle | E | } } = \sum _ { i } a _ { i }$ holds. This convenient property implies that when all proposals are fully distinct, the component can output the same as simply summing over the original attention weights by default.
+
+There are two types of duplicate edges to eliminate to achieve our objective: intra-object edges and inter-object edges.
+
+# 4.2.1 INTRA-OBJECT EDGES
+
+First, we eliminate intra-object edges between duplicate proposals of a single underlying object.
+
+
+
+
+Figure 2: Removal of intra-object edges by masking the edges of the attention matrix A with the distance matrix D. The black vertices now form a graph without self-loops. The self-loops need to be added back in later.
+Figure 3: Removal of duplicate inter-object edges by computing a scaling factor for each vertex and scaling $\tilde { \mathbf { A } } ^ { \prime }$ accordingly. $\bar { \mathbf { A } } ^ { \prime }$ is $\tilde { \mathbf { A } }$ with self-loops already added back in. The scaling factor for one vertex is computed by counting how many vertices have outgoing edges to the same set of vertices; all edges of the two proposals on the right are scaled by 0.5. This can be seen as averaging proposals within each object and is equivalent to removing duplicate proposals altogether under a sum.
+
+To compare two bounding boxes, we use the usual intersection-over-union (IoU) metric. We define the distance matrix $\mathbf { D } \in \bar { \mathbb { R } } ^ { n \times n }$ to be
+
+$$
+D _ { i j } = 1 - \mathrm { I o U } ( b _ { i } , b _ { j } )
+$$
+
+$\mathbf { D }$ can also be interpreted as an adjacency matrix. It represents a graph that has edges everywhere except when the two bounding boxes that an edge connects would overlap.
+
+Intra-object edges are removed by elementwise multiplying $( \odot )$ the distance matrix with the attention matrix (Figure 2).
+
+$$
+\tilde { \mathbf { A } } = f _ { 1 } ( \mathbf { A } ) \odot f _ { 2 } ( \mathbf { D } )
+$$
+
+$\tilde { \mathbf { A } }$ no longer has self-loops, so we need to add them back in at a later point to still satisfy $| E | = | V | ^ { 2 }$ Notice that we start making use of the activation functions mentioned earlier to handle intermediate values in the interval $( 0 , 1 )$ for both A and $\mathbf { D }$ . They regulate the influence of attention weights that are not close to 0 or 1 and the influence of partial overlaps.
+
+# 4.2.2 INTER-OBJECT EDGES
+
+Second, we eliminate inter-object edges between duplicate proposals of different underlying objects.
+
+The main idea (depicted in Figure 3) is to count the number of proposals associated to each invidual object, then scale down the weight of their associated edges by that number. If there are two proposals of a single object, the edges involving those proposals should be scaled by 0.5. In essence, this averages over the proposals within each underlying object because we only use the sum over the edge weights to compute the count at the end. Conceptually, this reduces multiple proposals of an object down to one as desired. Since we do not know how many proposals belong to an object, we have to estimate this. We do this by using the fact that proposals of the same object are similar.
+
+Keep in mind that $\tilde { \mathbf { A } }$ has no self-loops nor edges between proposals of the same object. As a consequence, two nonzero rows in $\tilde { \mathbf { A } }$ are the same if and only if the proposals are the same. If the two rows differ in at least one entry, then one proposal overlaps a proposal that the other proposal does not overlap, so they must be different proposals. This means for comparing rows, we need a similarity function that satisfies the criteria of taking the value 1 when they differ in no places and 0 if they differ in at least one place. We define a differentiable similarity between proposals $i$ and $j$ as
+
+$$
+\mathrm { S i m } _ { i j } = f _ { 3 } ( 1 - | a _ { i } - a _ { j } | ) \prod _ { k } f _ { 3 } ( 1 - | X _ { i k } - X _ { j k } | )
+$$
+
+where $\mathbf { X } = f _ { 4 } ( \mathbf { A } ) \odot f _ { 5 } ( \mathbf { D } )$ is the same as $\tilde { \mathbf { A } }$ except with different activation functions. The $\prod$ term compares the rows of proposals $i$ and $j$ . Using this term instead of $f _ { 4 } ( 1 - D _ { i j } )$ was more robust to inaccurate bounding boxes in initial experiments.
+
+Note that the $f _ { 3 } ( 1 - | a _ { i } - a _ { j } | )$ term handles the edge case when there is only one proposal to count. Since $\mathbf { X }$ does not have self-loops, $\mathbf { X }$ contains only zeros in that case, which causes the row corresponding to $a _ { i } = 1$ to be incorrectly similar to the rows where $a _ { j \neq i } = 0$ . By comparing the attention weights through that term as well, this issue is avoided.
+
+Now that we can check how similar two proposals are, we count the number of times any row is the same as any other row and compute a scaling factor $s _ { i }$ for each vertex $i$ .
+
+$$
+s _ { i } = 1 / \sum _ { j } \mathrm { S i m } _ { i j }
+$$
+
+The time complexity of computing $\mathbf { s } = [ s _ { 1 } , \ldots , s _ { n } ] ^ { \mathsf { T } }$ is $\Theta ( n ^ { 3 } )$ as there are $n ^ { 2 }$ pairs of rows and $\Theta ( n )$ operations to compute the similarity of any pair of rows.
+
+Since these scaling factors apply to each vertex, we have to expand s into a matrix using the outer product in order to scale both incoming and outgoing edges of each vertex. We can also add self-loops back in, which need to be scaled by s as well. Then, the count matrix $\mathbf { C }$ is
+
+$$
+\mathbf { C } = \tilde { \mathbf { A } } \odot \mathbf { s s } ^ { \mathsf { T } } + \mathrm { { d i a g } } ( \mathbf { s } \odot f _ { 1 } ( \mathbf { a } \odot \mathbf { a } ) )
+$$
+
+where $\mathrm { d i a g ( \cdot ) }$ expands a vector into a diagonal matrix with the vector on the diagonal.
+
+The scaling of self-loops involves a non-obvious detail. Recall that the diagonal that was removed when going from $\mathbf { A }$ to $\tilde { \mathbf { A } }$ contains the entries $f _ { 1 } ( \mathbf { a } \odot \mathbf { a } )$ . Notice however that we are scaling this diagonal by s and not s $\odot$ s. This is because the number of inter-object edges scales quadratically with respect to the number of proposals per object, but the number of self-loops only scales linearly.
+
+# 4.3 OUTPUT
+
+Under a sum, $\mathbf { C }$ is now equivalent to a complete graph with self-loops that involves all relevant objects instead of relevant proposals as originally desired.
+
+To turn $\mathbf { C }$ into a count $c$ , we set $\begin{array} { r } { | E | = \sum _ { i , j } C _ { i j } } \end{array}$ as mentioned and
+
+$$
+c = | V | = \sqrt { | E | }
+$$
+
+We verified experimentally that when our extreme case assumptions hold, $c$ is always an integer and equal to the correct count, regardless of the number of duplicate object proposals.
+
+To avoid issues with scale when the number of objects is large, we turn this single feature into several classes, one for each possible number. Since we only used the object proposals with the largest $n$ weights, the predicted count $c$ can be at most $n$ . We define the output $\mathbf { o } ^ { \mathsf { ^ { - } } } = [ o _ { 0 } , o _ { 1 } , \ldots , o _ { n } ] ^ { \mathsf { T } }$ to be
+
+$$
+o _ { i } = \operatorname* { m a x } ( 0 , 1 - | c - i | )
+$$
+
+This results in a vector that is 1 at the index of the count and 0 everywhere else when $c$ is exactly an integer, and a linear interpolation between the two corresponding one-hot vectors when the count falls inbetween two integers.
+
+# 4.3.1 OUTPUT CONFIDENCE
+
+Finally, we might consider a prediction made from values of a and $\mathbf { D }$ that are either close to 0 or close to 1 to be more reliable – we explicitly handle these after all – than when many values are close to 0.5. To incorporate this idea, we scale $\mathbf { o }$ by a confidence value in the interval $[ 0 , 1 ]$ .
+
+We define $p _ { \mathbf { a } }$ and $p _ { \mathbf { D } }$ to be the average distances to 0.5. The choice of 0.5 is not important, because the module can learn to change it by changing where $f _ { 6 } ( x ) = 0 . 5$ and $f _ { 7 } ( x ) = 0 . 5$ .
+
+$$
+\begin{array} { l } { { \displaystyle p _ { \mathbf { a } } = \frac { 1 } { n } \sum _ { i } \left. f _ { 6 } ( a _ { i } ) - 0 . 5 \right. } } \\ { { \displaystyle p _ { \mathbf { D } } = \frac { 1 } { n ^ { 2 } } \sum _ { i , j } \left. f _ { 7 } ( D _ { i j } ) - 0 . 5 \right. } } \end{array}
+$$
+
+Then, the output of the component with confidence scaling is
+
+$$
+\tilde { \mathbf { o } } = f _ { 8 } ( p _ { \mathbf { a } } + p _ { \mathbf { D } } ) \cdot \mathbf { o }
+$$
+
+In summary, we only used diffentiable operations to deduplicate object proposals and obtain a feature vector that represents the predicted count. This allows easy integration into any model with soft attention, enabling a model to count from an attention map.
+
+# 5 EXPERIMENTS
+
+# 5.1 TOY TASK
+
+First, we design a simple toy task to evaluate counting ability. This dataset is intended to only evaluate the performance of counting; thus, we skip any processing steps that are not directly related such as the processing of an input image. Samples from this dataset are given in Appendix D
+
+The classification task is to predict an integer count $\hat { c }$ of true objects, uniformly drawn from 0 to 10 inclusive, from a set of bounding boxes and the associated attention weights. 10 square bounding boxes with side length $l \in ( 0 , 1 \bar { ] }$ are placed in a square image with unit side length. The $\mathbf { X }$ and y coordinates of their top left corners are uniformly drawn from $U ( 0 , 1 - l )$ so that the boxes do not extend beyond the image border. $l$ is used to control the overlapping of bounding boxes: a larger $l$ leads to the fixed number of objects to be more tightly packed, increasing the chance of overlaps. $\hat { c }$ number of these boxes are randomly chosen to be true bounding boxes. The score of a bounding box is the maximum IoU overlap of it with any true bounding box. Then, the attention weight is a linear interpolation between the score and a noise value drawn from $U ( 0 , 1 )$ , with $q \in [ 0 , 1 ]$ controlling this trade-off. $q$ is the attention noise parameter: when $q$ is 0, there is no noise and when $q$ is 1, there is no signal. Increasing $q$ also indirectly simulates imprecise placements of bounding boxes.
+
+We compare the counting component against a simple baseline that simply sums the attention weights and turns the sum into a feature vector with Equation 8. Both models are followed by a linear projection to the classes 0 to 10 inclusive and a softmax activation. They are trained with crossentropy loss for 1000 iterations using Adam (Kingma & Ba, 2015) with a learning rate of 0.01 and a batch size of 1024.
+
+# 5.1.1 RESULTS
+
+The results of varying $l$ while keeping $q$ fixed at various values and vice versa are shown in Figure 4. Regardless of $l$ and $q$ , the counting component performs better than the baseline in most cases, often significantly so. Particularly when the noise is low, the component can deal with high values for $l$ very successfully, showing that it accomplishes the goal of increased robustness to overlapping proposals. The component also handles moderate noise levels decently as long as the overlaps are limited. The performance when both $l$ and $q$ are high is closely matched by the baseline, likely due to the high difficulty of those parametrizations leaving little information to extract in the first place.
+
+We can also look at the shape of the activation functions themselves, shown in Figure 5 and Appendix C, to understand how the behaviour changes with varying dataset parameters. For simplicity, we limit our description to the two easiest-to-interpret functions: $f _ { 1 }$ for the attention weights and $f _ { 2 }$ for the bounding box distances.
+
+
+Figure 4: Accuracies on the toy task as side length $l$ and noise $q$ are varied in 0.01 step sizes.
+
+
+Figure 5: Shapes of trained activation functions $f _ { 1 }$ (attention weights) and $f _ { 2 }$ (bounding box distances) for varying bounding box side lengths (left) or the noise (right) in the dataset, varied in 0.01 step sizes. Best viewed in color.
+
+When increasing the side length, the height of the “step” in $f _ { 1 }$ decreases to compensate for the generally greater degree of overlapping bounding boxes. A similar effect is seen with $f _ { 2 }$ : it varies over requiring a high pairwise distance when $l$ is low – when partial overlaps are most likely spurious – and considering small distances enough for proposals to be considered different when $l$ is high. At the highest values for $l$ , there is little signal in the overlaps left since everything overlaps with everything, which explains why $f _ { 2 }$ returns to its default linear initialization for those parameters.
+
+When varying the amount of noise, without noise $f _ { 1 }$ resembles a step function where the step starts close to $x = 1$ and takes a value of close to 1 after the step. Since a true proposal will always have a weight of 1 when there is no noise, anything below this can be safely zeroed out. With increasing noise, this step moves away from 1 for both $x$ and $f _ { 1 } ( x )$ , capturing the uncertainty when a bounding box belongs to a true object. With lower $q$ , $f _ { 2 }$ considers a pair of proposals to be distinct for lower distances, whereas with higher $q$ , $f _ { 2 }$ follows a more sigmoidal shape. This can be explained by the model taking the increased uncertainty of the precise bounding box placements into account by requiring higher distances for proposals to be considered completely different.
+
+# 5.2 VQA
+
+VQA v2 (Goyal et al., 2017) is the updated version of the VQA v1 dataset (Antol et al., 2015) where greater care has been taken to reduce dataset biases through balanced pairs: for each question, a pair of images is identified where the answer to that question differs. The standard accuracy metric on this dataset accounts for disagreements in human answers by averaging $\mathrm { m i n } ( \textstyle { \frac { 1 } { 3 } }$ agreeing, 1) over all 10-choose-9 subsets of human answers, where agreeing is the number of human answers that agree with the given answer. This can be shown to be equal to $\operatorname* { m i n } ( 0 . 3 a g r e e i n g , 1 )$ without averaging.
+
+We use an improved version of the strong VQA baseline by Kazemi & Elqursh (2017) as baseline model (details in Appendix B). We have not performed any tuning of this baseline to maximize the performance difference between it and the baseline with counting module. To augment this model with the counting component, we extract the attention weights of the first attention glimpse (there are two in the baseline) before softmax normalization, and feed them into the counting component after applying a logistic function. Since object proposal features from Anderson et al. (2017) vary from 10 to 100 per image, a natural choice for the number of top- $^ n$ proposals to use is 10. The output of the component is linearly projected into the same space as the hidden layer of the classifier, followed by ReLU activation, batch normalization, and addition with the features in the hidden layer.
+
+Table 1: Results on VQA v2 of the top models along with our results. Entries marked with (Ens.) are ensembles of models. At the time of writing, our model with the counting module places third among all entries. All models listed here use object proposal features and are trained on the training and validation sets. The top-performing ensemble models use additional pre-trained word embeddings, which we do not use.
+
+
VQA v2 test-dev
VQA v2 test
Model
Yes/No
Number
Other
All
Yes/No
Number
Other
All
Teney et al. (2017)
81.82
44.21
56.05
65.32
82.20
43.90
56.26
65.67
Teney et al. (2017) (Ens.)
86.08
48.99
60.80
69.87
86.60
48.64
61.15
70.34
Zhou et al. (2017)
84.27
49.56
59.89
68.76
1
1
1
1
Zhou et al. (2017) (Ens.)
1
1
1
1
86.65
51.13
61.75
70.92
Baseline
82.98
46.88
58.99
67.50
83.21
46.60
59.20
67.78
+ counting module
83.14
51.62
58.97
68.09
83.56
51.39
59.11
68.41
+
+Table 2: Results on the VQA v2 validation set with models trained only on the training set. Reported are the mean accuracies and sample standard deviations $( \pm )$ over 4 random initializations.
+
+
VQA accuracy
Balanced pair accuracy
Model
Number
Count
All
Number
Count
All
Baseline
44.83±0.2
51.69±0.2
64.80±0.0
17.34±0.2
20.02±0.2
36.44±0.1
+ NMS
44.60±0.1
51.41±0.1
64.80±0.1
17.06±0.1
19.72±0.1
36.44±0.2
+ counting module
49.36±0.1
57.03±0.0
65.42±0.1
23.10±0.2
26.63±0.2
37.19±0.1
+
+# 5.2.1 RESULTS
+
+Table 1 shows the results on the official VQA v2 leaderboard. The baseline with our component has a significantly higher accuracy on number questions without compromising accuracy on other categories compared to the baseline result. Despite our single-model baseline being substantially worse than the state-of-the-art, by simply adding the counting component we outperform even the 8-model ensemble in Zhou et al. (2017) on the number category. We expect further improvements in number accuracy when incorporating their techniques to improve the quality of attention weights, especially since the current state-of-the-art models suffer from the problems with counting that we mention in section 3. Some qualitative examples of inputs and activations within the counting component are shown in Appendix E.
+
+We also evaluate our models on the validation set of VQA v2, shown in Table 2. This allows us to consider only the counting questions within number questions, since number questions include questions such as ”what time is it?” as well. We treat any question starting with the words ”how many” as a counting question. As we expect, the benefit of using the counting module on the counting question subset is higher than on number questions in general. Additionally, we try an approach where we simply replace the counting module with NMS, using the average of the attention glimpses as scoring, and one-hot encoding the number of proposals left. The NMS-based approach, using an IoU threshold of 0.5 and no score thresholding based on validation set performance, does not improve on the baseline, which suggests that the piecewise gradient of NMS is a major problem for learning to count in VQA and that conversely, there is a substantial benefit to being able to differentiate through the counting module.
+
+Additionally, we can evaluate the accuracy over balanced pairs as proposed by Teney et al. (2017): the ratio of balanced pairs on which the VQA accuracy for both questions is 1.0. This is a much more difficult metric, since it requires the model to find the subtle details between images instead of being able to rely on question biases in the dataset. First, notice how all balanced pair accuracies are greatly reduced compared to their respective VQA accuracy. More importantly, the absolute accuracy improvement of the counting module is still fully present with the more challenging metric, which is further evidence that the component can properly count rather than simply fitting better to dataset biases.
+
+When looking at the activation functions of the trained model, shown in Figure 9, we find that some characteristics of them are shared with high-noise parametrizations of the toy dataset. This suggests that the current attention mechanisms and object proposal network are still very inaccurate, which explains the perhaps small-seeming increase in counting performance. This provides further evidence that the balanced pair accuracy is maybe a more reflective measure of how well current VQA models perform than the overall VQA accuracies of over $70 \%$ of the current top models.
+
+# 6 CONCLUSION
+
+After understanding why VQA models struggle to count, we designed a counting component that alleviates this problem through differentiable bounding box deduplication. The component can readily be used alongside any future improvements in VQA models, as long as they still use soft attention as all current top models on VQA v2 do. It has uses outside of VQA as well: for many counting tasks, it can allow an object-proposal-based approach to work without ground-truth objects available as long as there is a – possibly learned – per-proposal scoring (for example using a classification score) and a notion of how dissimilar a pair of proposals are. Since each step in the component has a clear purpose and interpretation, the learned weights of the activation functions are also interpretable. The design of the counting component is an example showing how by encoding inductive biases into a deep learning model, challenging problems such as counting of arbitrary objects can be approached when only relatively little supervisory information is available.
+
+For future research, it should be kept in mind that VQA v2 requires a versatile skill set that current models do not have. To make progress on this dataset, we advocate focusing on understanding of what the current shortcomings of models are and finding ways to mitigate them.
+
+# REFERENCES
+
+Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and VQA. CoRR, arXiv:1707.07998, 2017.
+Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: Visual Question Answering. In ICCV, 2015.
+Samaneh Azadi, Jiashi Feng, and Trevor Darrell. Learning detection with diverse proposals. In CVPR, 2017.
+Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. In ICLR, 2015.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
+Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju, Dhruv Batra, and Devi Parikh. Counting everyday objects in everyday scenes. In CVPR, 2017.
+Kyunghyun Cho, B van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. In SSST@EMNLP, 2014.
+Joseph Paul Cohen, Henry Z. Lo, and Yoshua Bengio. Count-ception: Counting by fully convolutional redundant counting. CoRR, arXiv:1703.08710, 2017.
+Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In CVPR, 2017.
+
+Paul Henderson and Vittorio Ferrari. End-to-end training of object class detectors for mean average precision. In ACCV, 2017.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 1997.
+
+Jan Hosang, Rodrigo Benenson, and Bernt Schiele. Learning non-maximum suppression. In CVPR, 2017.
+
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
+
+Allan Jabri, Armand Joulin, and Laurens van der Maaten. Revisiting visual question answering baselines. In ECCV, 2016.
+
+Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In NIPS, 2015.
+
+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 CVPR, 2017.
+
+Vahid Kazemi and Ali Elqursh. Show, ask, attend, and answer: A strong baseline for visual question answering. CoRR, arXiv:1704.03162, 2017.
+
+Yoon Kim, Carl Denton, Luong Hoang, and Alexander M. Rush. Structured attention networks. In ICLR, 2017.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+
+Hugo Larochelle and Geoffrey E Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In NIPS, 2010.
+
+Victor Lempitsky and Andrew Zisserman. Learning to count objects in images. In NIPS, 2010.
+
+Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In NIPS, 2016.
+
+Dmytro Mishkin and Jiri Matas. All you need is a good init. In ICLR, 2016.
+
+Volodymyr Mnih, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. Recurrent models of visual attention. In NIPS, 2014.
+
+Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron Courville. FiLM: Visual reasoning with a general conditioning layer. CoRR, arXiv:1709.07871, 2017.
+
+Mengye Ren and Richard S. Zemel. End-to-end instance segmentation with recurrent attention. In CVPR, 2017.
+
+Adam Santoro, David Raposo, David G. T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy P. Lillicrap. A simple neural network module for relational reasoning. In NIPS, 2017.
+
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 2014.
+
+Damien Teney, Peter Anderson, Xiaodong He, and Anton van den Hengel. Tips and tricks for visual question answering: Learnings from the 2017 challenge. CoRR, arXiv:1708.02711, 2017.
+
+Alexander Trott, Caiming Xiong, and Richard Socher. Interpretable counting for visual question answering. In ICLR, 2018.
+
+Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alexander J. Smola. Stacked attention networks for image question answering. In CVPR, 2016.
+
+Seungil You, David Ding, Kevin Canini, Jan Pfeifer, and Maya Gupta. Deep Lattice Networks and Partial Monotonic Functions. In NIPS, 2017.
+
+Yu Zhou, Yu Jun, Xiang Chenchao, Fan Jianping, and Tao Dacheng. Beyond bilinear: Generalized multi-modal factorized high-order pooling for visual question answering. CoRR, arXiv:1708.03619, 2017.
+
+Chen Zhu, Yanpeng Zhao, Shuaiyi Huang, Kewei Tu, and Yi Ma. Structured attentions for visual question answering. CoRR, arXiv:1708.02071, 2017.
+
+# A PIECEWISE LINEAR ACTIVATION FUNCTION
+
+Intuitively, the interval $[ 0 , 1 ]$ is split into $d$ equal size intervals. Each contains a line segment that is connected to the neighboring line segments at the boundaries of the intervals. These line segments form the shape of the activation function.
+
+For each function $f _ { k }$ , there are $d$ weights $w _ { k 1 } , \ldots , w _ { k d }$ , where the weight $w _ { k i }$ is the gradient for the interval $[ \textstyle { \frac { i - 1 } { d } } , \textstyle { \frac { i } { d } } )$ . We arbitrarily fix $d$ to be 16 in this paper, observing no significant difference when changing it to 8 and 32 in preliminary experiments. All $w _ { k i }$ are enforced to be non-negative by always using the absolute value of them, which yields the monotonicity property. Dividing the weights by $\Sigma _ { m } ^ { d } \mid w _ { k m } \mid$ yields the property that $f ( 1 ) = 1$ . The function can be written as
+
+$$
+f _ { k } ( x ) = \sum _ { i = 1 } ^ { d } \operatorname* { m a x } ( 0 , 1 - | d x - i | ) \frac { \sum _ { j = 1 } ^ { i } | w _ { k j } | } { \sum _ { m = 1 } ^ { d } | w _ { k m } | }
+$$
+
+In essence, the max term selects the two nearest boundary values of an interval, which are normalized cumulative sums over the $w _ { k }$ weights, and linearly interpolates between the two. This approach is similar to the subgradient approach by Jaderberg et al. (2015) to make sampling from indices differentiable. All $w _ { k i }$ are initialized to 1, which makes the functions linear on initialization. When applying $f _ { k } ( { \bf x } )$ to a vector-valued input $\mathbf { x }$ , it is assumed to be applied elementwise. By caching the normalized cumulative sum $\begin{array} { r } { \sum _ { j } ^ { i } | w _ { k j } | / \sum _ { m } ^ { d } | w _ { k m } | } \end{array}$ , this function has linear time complexity with respect to $d$ and is efficiently implementable on GPUs.
+
+Extensions to this are possible through Deep Lattice Networks (You et al., 2017), which preserve monotonicity across several nonlinear neural network layers. They would allow A and $\mathbf { D }$ to be combined in more sophisticated ways beyond an elementwise product, possibly improving counting performance as long as the property of the range lying within $[ 0 , 1 ]$ is still enforced in some way.
+
+# B BASELINE ARCHITECTURE
+
+This model is based on the work of Kazemi & Elqursh (2017), who outperformed most previous VQA models on the VQA v1 dataset with a simple baseline architecture. We adapt the model to the VQA v2 dataset and make various tweaks that improve validation accuracy slightly. The architecture is illustrated in Figure 6. Details not mentioned here can be assumed to be the same as in their paper.
+
+The most significant change that we make is the use of object proposal features by Anderson et al. (2017) as previously mentioned. The following tweaks were made without considering the performance impact on the counting component; only the validation accuracy of the baseline was optimized.
+
+To fuse vision features $\mathbf { x }$ and question features y, the baseline concatenates and linearly projects them, followed by a ReLU activation. This is equivalent to ReLU $( \mathbf { W } _ { x } \mathbf { x } + \mathbf { W } _ { y } \mathbf { y } )$ . We include an additional term that measures how different the projected $\mathbf { x }$ is from the projected y, changing the fusion mechanism to $\mathbf { x } \odot \mathbf { y } = \operatorname { R e L U } ( \mathbf { W } _ { x } \mathbf { x } + \mathbf { W } _ { y } \mathbf { y } ) - ( \mathbf { W } _ { x } \mathbf { x } - \mathbf { W } _ { y } \mathbf { y } ) ^ { 2 }$ .
+
+The LSTM (Hochreiter & Schmidhuber, 1997) for question encoding is replaced with a GRU (Cho et al., 2014) with the same hidden size with dynamic per-example unrolling instead of a fixed 14 words per question. We apply batch normalization (Ioffe & Szegedy, 2015) before the last linear projection in the classifier to the 3000 classes. The learning rate is increased from 0.001 to 0.0015 and the batch size is doubled to 256. The model is trained for 100 epochs (1697 iterations per epoch to train on the training set, 2517 iterations per epoch to train on both training and validation sets) instead of 100,000 iterations, roughly in line with the doubling of dataset size when going from VQA v1 to VQA v2.
+
+Note that this single-model baseline is regularized with dropout (Srivastava et al., 2014), while the other current top models skip this and rely on ensembling to reduce overfitting. This explains why our single-model baseline outperforms most single-model results of the state-of-the-art models. We found ensembling of the regularized baseline to provide a much smaller benefit in preliminary experiments compared to the results of ensembling unregularized networks reported in Teney et al. (2017).
+
+
+Figure 6: Schematic view of a model using our counting component. The modifications made to the baseline model when including the counting component are marked in red. Blue blocks mark components with trainable parameters, gray blocks mark components without trainable parameters. White $\textsuperscript { \textregistered }$ mark linear layers, either linear projections or convolutions with a spatial size of 1 depending on the context. Dropout with drop probability 0.5 is applied before the GRU and every $\textsuperscript { \textregistered }$ , except before the $\textsuperscript { \textregistered }$ after the counting component. $\diamond$ stands for the fusion function we define in Appendix B, BN stands for batch normalization, $\sigma$ stands for a logistic, and Embedding is a word embedding that has been fed through a tanh function. The two glimpses of the attention mechanism are represented with the two lines exiting the $\textsuperscript { \textregistered }$ . Note that one of the two glimpses is shared with the counting component.
+
+
+Figure 7: Shape of activation functions as $l$ is varied for $q = 0 . 5$ on the toy dataset. Each line shows the shape of the activation function when $l$ is set to the value associated to its color. Best viewed in color.
+
+
+Figure 8: Shape of activation functions as $q$ is varied for $l = 0 . 5$ on the toy dataset. Each line shows the shape of the activation function when $q$ is set to the value associated to its color. Best viewed in color.
+
+
+Figure 9: Shape of activation functions for a model trained on the train and validation sets of VQA v2 (thick black), compared against the shapes when parametrizing the toy dataset with $q$ around 0.4 (green), 0.7 (orange), or 1.0 (red) with fixed $l = 0 . 2$ . Best viewed in color.
+
+
+Figure 10: Example toy dataset data for varying bounding box side lengths $l$ and noise $q$ . The ground truth column shows bounding boxes of randomly placed true objects (blue) and of irrelevant objects (red). The data column visualizes the samples that are actually used as input (dark blues represent weights close to 1, dark reds represent weights close to 0, lighter colors represent weights closer to 0.5). The weight of the ith bounding box $b _ { i }$ is defined as $a _ { i } = ( 1 - q )$ score $+ q z$ where the score is the maximum overlap of $b _ { i }$ with any true bounding box or 0 if there are no true bounding boxes and $z$ is drawn from $U ( 0 , 1 )$ . Note how this turns red bounding boxes that overlap a lot with a blue bounding box in the ground truth column into a blue bounding box in the data column, which simulates the duplicate proposal that we have to deal with. Best viewed in color.
+
+
+Figure 11: Selection of validation images with overlaid bounding boxes, values of the attention matrix A, distance matrix D, and the resulting count matrix C. White entries represent values close to 1, black entries represent values close to 0. The count $c$ is the usual square root of the sum over the elements of C. Notice how particularly in the third example, A clearly contains more rows/columns with high activations than there are actual objects (a sign of overlapping bounding boxes) and the counting module successfully removes intra- and inter-object edges to arrive at the correct prediction regardless. The prediction is not necessarily – though often is – the rounded value of $c$ .
\ No newline at end of file
diff --git a/md/train/B1spAqUp-/B1spAqUp-.md b/md/train/B1spAqUp-/B1spAqUp-.md
new file mode 100644
index 0000000000000000000000000000000000000000..4201be0702072ef654c50b97daa09cb232114090
--- /dev/null
+++ b/md/train/B1spAqUp-/B1spAqUp-.md
@@ -0,0 +1,195 @@
+# PIXEL DECONVOLUTIONAL NETWORKS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Deconvolutional layers have been widely used in a variety of deep models for up-sampling, including encoder-decoder networks for semantic segmentation and deep generative models for unsupervised learning. One of the key limitations of deconvolutional operations is that they result in the so-called checkerboard problem. This is caused by the fact that no direct relationship exists among adjacent pixels on the output feature map. To address this problem, we propose the pixel deconvolutional layer (PixelDCL) to establish direct relationships among adjacent pixels on the up-sampled feature map. Our method is based on a fresh interpretation of the regular deconvolution operation. The resulting PixelDCL can be used to replace any deconvolutional layer in a plug-and-play manner without compromising the fully trainable capabilities of original models. The proposed PixelDCL may result in slight decrease in efficiency, but this can be overcome by an implementation trick. Experimental results on semantic segmentation demonstrate that PixelDCL can consider spatial features such as edges and shapes and yields more accurate segmentation outputs than deconvolutional layers. When used in image generation tasks, our PixelDCL can largely overcome the checkerboard problem suffered by regular deconvolution operations.
+
+# 1 INTRODUCTION
+
+Deep learning methods have shown great promise in a variety of artificial intelligence tasks such as image classification (Krizhevsky et al., 2012; Simonyan & Zisserman, 2014), semantic segmentation (Noh et al., 2015; Shelhamer et al., 2016; Ronneberger et al., 2015), and natural image generation (Goodfellow et al., 2014; Kingma & Welling, 2014; Oord et al., 2016). Some key network layers, such as convolutional layers (LeCun et al., 1998), pooling layers, fully connected layers and deconvolutional layers, have been frequently used to create deep models for different tasks. Deconvolutional layers, also known as transposed convolutional layers (Vedaldi & Lenc, 2015), are initially proposed in (Zeiler et al., 2010; 2011). They have been primarily used in deep models that require up-sampling of feature maps, such as generative models (Radford et al., 2015; Makhzani & Frey, 2015; Rezende et al., 2014) and encoder-decoder architectures (Ronneberger et al., 2015; Noh et al., 2015). Although deconvolutional layers are capable of producing larger feature maps from smaller ones, they suffer from the problem of checkerboard artifacts (Odena et al., 2016). This greatly limits deep model’s capabilities in generating photo-realistic images and producing smooth outputs on semantic segmentation. To date, very little efforts have been devoted to improving the deconvolution operation.
+
+In this work, we propose a simple, efficient, yet effective method, known as the pixel deconvolutional layer (PixelDCL), to address the checkerboard problem suffered by deconvolution operations. Our method is motivated from a fresh interpretation of deconvolution operations, which clearly pinpoints the root of checkerboard artifacts. That is, the up-sampled feature map generated by deconvolution can be considered as the result of periodical shuffling of multiple intermediate feature maps computed from the input feature map by independent convolutions. As a result, adjacent pixels on the output feature map are not directly related, leading to the checkerboard artifacts. To overcome this problem, we propose the pixel deconvolutional operation to be used in PixelDCL. In this new layer, the intermediate feature maps are generated sequentially so that feature maps generated in a later stage are required to depend on previously generated ones. In this way, direct relationships among adjacent pixels on the output feature map have been established. Sequential generation of intermediate feature maps in PixelDCL may result in slight decrease in computational efficiency, but we show that this can be largely overcome by an implementation trick. Experimental results on semantic segmentation (samples in Figure 1) and image generation tasks demonstrate that the proposed PixelDCL can effectively overcome the checkerboard problem and improve predictive and generative performance.
+
+
+Figure 1: Comparison of semantic segmentation results. The first and second rows are images and ground true labels, respectively. The third and fourth rows are the results of using regular deconvolution and our proposed pixel deconvolution PixelDCL, respectively.
+
+Our work is related to the pixel recurrent neural networks (PixelRNNs) (Oord et al., 2016) and PixelCNNs (van den Oord et al., 2016; Reed et al., 2017), which are generative models that consider the relationship among units on the same feature map. They belong to a more general class of autoregressive methods for probability density estimation (Germain et al., 2015; Gregor et al., 2015; Larochelle & Murray, 2011). By using masked convolutions in training, the training time of PixelRNNs and PixelCNNs is comparable to that of other generative models such as generative adversarial networks (GANs) (Goodfellow et al., 2014; Reed et al., 2016) and variational autoencoders (VAEs) (Kingma & Welling, 2014; Johnson et al., 2016). However, the prediction time of PixelRNNs or PixelCNNs is very slow since it has to generate images pixel by pixel. In contrast, our PixelDCL can be used to replace any deconvolutional layer in a plug-and-play manner, and the slight decrease in efficiency can be largely overcome by an implementation trick.
+
+# 2 PIXEL DECONVOLUTIONAL LAYERS AND NETWORKS
+
+We introduce deconvolutional layers and analyze the cause of checkerboard artifacts in this section.
+We then propose the pixel deconvolutional layers and the implementation trick to improve efficiency.
+
+# 2.1 DECONVOLUTIONAL LAYERS
+
+Deconvolutional networks and deconvolutional layers are proposed in (Zeiler et al., 2010; 2011). They have been widely used in deep models for applications such as semantic segmentation (Noh et al., 2015) and generative models (Kingma & Welling, 2014; Goodfellow et al., 2014; Oord et al., 2016). Many encoder-decoder architectures use deconvolutional layers in decoders for up-sampling. One way of understanding deconvolutional operations is that the up-sampled output feature map is obtained by periodical shuffling of multiple intermediate feature maps obtained by applying multiple convolutional operations on the input feature maps (Shi et al., 2016).
+
+This interpretation of deconvolution in 1D and 2D is illustrated in Figures 2 and 3, respectively. It is clear from these illustrations that standard deconvolutional operation can be decomposed into several convolutional operations depending on the up-sampling factor. In the following, we assume the up-sampling factor is two, though deconvolution operations can be applied to more generic settings. Formally, given an input feature map $F _ { i n }$ , a deconvolutional layer can be used to generate
+
+
+Figure 2: Illustration of 1D deconvolutional operation. In this deconvolutional layer, a $4 \times 1$ feature map is up-sampled to an $8 \times 1$ feature map. The left figure shows that each input unit passes through an $1 \times 4$ kernel. The output feature map is obtained as the sum of values in each column. It can be seen from this figure that the purple outputs are only related to (1, 3) entries in the kernel, while the orange outputs are only related to (2, 4) entries in the kernel. Therefore, 1D deconvolution can be decomposed as two convolutional operations shown in the right figure. The two intermediate feature maps generated by convolutional operations are dilated and combined to obtain the final output. This indicates that the standard deconvolutional operation can be decomposed into multiple convolutional operations.
+
+
+Figure 3: Illustration of 2D deconvolutional operation. In this deconvolutional layer, a $4 \times 4$ feature map is up-sampled to an $8 \times 8$ feature map. Four intermediate feature maps (purple, orange, blue, and red) are generated using four different convolutional kernels. Then these four intermediate feature maps are shuffled and combined to produce the final $8 \times 8$ feature map. Note that the four intermediate feature maps rely on the input feature map but with no direct relationship among them.
+
+an up-sampled output $F _ { o u t }$ as follows:
+
+$$
+\begin{array} { r l r l r l } { F _ { 1 } = F _ { i n } \oplus k _ { 1 } , } & { } & { F _ { 2 } = F _ { i n } \oplus k _ { 2 } , } & { } & { F _ { 3 } = F _ { i n } \oplus k _ { 3 } , } & { } & { F _ { 4 } = F _ { i n } \oplus k _ { 4 } , } \\ & { } & { F _ { o u t } = F _ { 1 } \oplus F _ { 2 } \oplus F _ { 3 } \oplus F _ { 4 } , } & { } & { F _ { o u t } = F _ { i n } \oplus k _ { 2 } , } \end{array}
+$$
+
+where $\circledast$ denotes the convolutional operation and $\oplus$ denotes the periodical shuffling and combination operation as in Figure 3, $F _ { i }$ is the intermediate feature map generated by the corresponding convolutional kernel $k _ { i }$ for $i = 1 , \cdots , 4$ .
+
+It is clear from the above interpretation of deconvolution that there is no direct relationship among these intermediate feature maps since they are generated by independent convolutional kernels. Although pixels of the same position on intermediate feature maps depend on the same receptive field of the input feature map, they are not directly related to each other. Due to the periodical shuffling operation, adjacent pixels on the output feature map are from different intermediate feature maps. This implies that the values of adjacent pixels can be significantly different from each other, resulting in the problem of checkerboard artifacts (Odena et al., 2016) as illustrated in Figure 4. One way to alleviate checkerboard artifacts is to apply post-processing such as smoothing (Li et al., 2001), but this adds additional complexity to the network and makes the entire network not fully trainable. In this work, we propose the pixel deconvolutional operation to add direct dependencies among intermediate feature maps, thereby making the values of adjacent pixels close to each other and effectively solving the checkerboard artifact problem. In addition, our pixel deconvolutional layers can be easily used to replace any deconvolutional layers without compromising the fully trainable capability.
+
+
+Figure 4: Illustration of the checkerboard problem in semantic segmentation using deconvolutional layers. The first and second rows are the original images and semantic segmentation results, respectively.
+
+# 2.2 PIXEL DECONVOLUTIONAL LAYERS
+
+To solve the checkerboard problem in deconvolutional layers, we propose the pixel deconvolutional layers (PixelDCL) that can add dependencies among intermediate feature maps. As adjacent pixels are from different intermediate feature maps, PixelDCL can build direct relationships among them, thus solving the checkerboard problem. In this method, intermediate feature maps are generated sequentially instead of simultaneously. The intermediate feature maps generated in a later stage are required to depend on previously generated ones. The primary purpose of sequential generation is to add dependencies among intermediate feature maps and thus adjacent pixels in final output feature maps. Finally, these intermediate feature maps are shuffled and combined to produce final output feature maps. Compared to Eqn. 1, $F _ { o u t }$ is obtained as follows:
+
+$$
+\begin{array} { r l r l } & { F _ { 1 } = F _ { i n } \oplus k _ { 1 } , } & & { F _ { 2 } = [ F _ { i n } , F _ { 1 } ] \oplus k _ { 2 } , } \\ & { F _ { 3 } = [ F _ { i n } , F _ { 1 } , F _ { 2 } ] \oplus k _ { 3 } , } & & { F _ { 4 } = [ F _ { i n } , F _ { 1 } , F _ { 2 } , F _ { 3 } ] \oplus k _ { 4 } , } \\ & { F _ { o u t } = F _ { 1 } \oplus F _ { 2 } \oplus F _ { 3 } \oplus F _ { 4 } , } \end{array}
+$$
+
+where $[ \cdot , \cdot ]$ denotes the juxtaposition of feature maps. Note that in Eqn. 2, $k _ { i }$ denotes a set of kernels as it involves convolution with the juxtaposition of multiple feature maps. Since the intermediate feature maps in Eqn. 2 depend on both the input feature map and the previously generated ones, we term it input pixel deconvolutional layer (iPixelDCL). Through this process, pixels on output feature maps will be conditioned not only on input feature maps but also on adjacent pixels. Since there are direct relationships among intermediate feature maps and adjacent pixels, iPixelDCL is expected to solve the checkerboard problem to some extent. Note that the relationships among intermediate feature maps can be very flexible. The intermediate feature maps generated later on can rely on part or all of previously generated intermediate feature maps. This depends on the design of pixel dependencies in final output feature maps. Figure 5 illustrates a specific design of sequential dependencies among intermediate feature maps.
+
+In iPixelDCL, we add dependencies among generated intermediate feature maps, thereby making adjacent pixels on final output feature maps directly related to each other. In this process, the information of the input feature map is repeatedly used when generating intermediate feature maps. When generating the intermediate feature maps, information from both the input feature map and previous intermediate feature maps is used. Since previous intermediate feature maps already contain information of the input feature map, the dependencies on the input feature map can be removed. Removing such dependencies for some intermediate feature maps can not only improve the computational efficiency but also reduce the number of trainable parameters in deep models.
+
+In this simplified pixel deconvolutional layer, only the first intermediate feature map will depend on the input feature map. The intermediate feature maps generated afterwards will only depend on previously generated intermediate feature maps. This will simplify the dependencies among pixels on final output feature map. In this work, we use PixelDCL to denote this simplified design. Our experimental results show that PixelDCL yields better performance than iPixelDCL and regular deconvolution. Compared to Eqn. 2, $F _ { o u t }$ in PixelDCL is obtained as follows:
+
+
+Figure 5: Illustration of iPixelDCL and PixelDCL described in section 2.2. In iPixelDCL, there are additional dependencies among intermediate feature maps. Specifically, the four intermediate feature maps are generated sequentially. The purple feature map is generated from the input feature map (blue). The orange feature map is conditioned on both the input feature map and the purple feature map that has been generated previously. In this way, the green feature map relies on the input feature map, purple and orange intermediate feature maps. The red feature map is generated based on the input feature map, purple, orange, and green intermediate feature maps. We also propose to move one step further and allow only the first intermediate feature map to depend on the input feature map. This gives rise to PixelDCL. That is, the connections indicated by dashed lines are removed to avoid repeated influence of the input feature map. In this way, only the first feature map is generated from the input and other feature maps do not directly rely on the input. In PixelDCL, the orange feature map only depends on the purple feature map. The green feature map relies on the purple and orange feature maps. The red feature map is conditioned on the purple, orange, and green feature maps. The information of the input feature map is delivered to other intermediate feature maps through the first intermediate feature map (purple).
+
+$$
+\begin{array} { c c } { { F _ { 1 } = F _ { i n } \oplus k _ { 1 } , } } & { { F _ { 2 } = F _ { 1 } \oplus k _ { 2 } , } } \\ { { F _ { 3 } = [ F _ { 1 } , F _ { 2 } ] \oplus k _ { 3 } , } } & { { F _ { 4 } = [ F _ { 1 } , F _ { 2 } , F _ { 3 } ] \oplus k _ { 4 } , } } \\ { { F _ { o u t } = F _ { 1 } \oplus F _ { 2 } \oplus F _ { 3 } \oplus F _ { 4 } . } } & { { } } \end{array}
+$$
+
+PixelDCL is illustrated in Figure 5 by removing the connections denoted with dash lines. When analyzing the relationships of pixels on output feature maps, it is clear that each pixel will still rely on adjacent pixels. Therefore, the checkerboard problem can be solved with even better computational efficiency. Meanwhile, our experimental results demonstrate that the performance of models with these simplified dependencies is even better than that with complete connections. This demonstrates that repeated dependencies on the input may not be necessary.
+
+# 2.3 PIXEL DECONVOLUTIONAL NETWORKS
+
+Pixel deconvolutional layers can be applied to replace any deconvolutional layers in various models involving up-sampling operations such as U-Net (Ronneberger et al., 2015), VAEs (Kingma & Welling, 2014) and GANs (Goodfellow et al., 2014). By replacing deconvolutional layers with pixel deconvolutional layers, deconvolutional networks become pixel deconvolutional networks (PixelDCN). In U-Net for semantic segmentation, pixel deconvolutional layers can be used to upsample from low-resolution feature maps to high-resolution ones. In VAEs, they can be applied in decoders for image reconstruction. The generator networks in GANs typically use deep model (Radford et al., 2015) and thus can employ pixel deconvolutional layers to generate large images. In our experiments, we evaluate pixel deconvolutional layers in U-Net and VAEs. The results show that the performance of pixel deconvolutional layers outperforms deconvolutional layers in these networks.
+
+In practice, the most frequently used up-sampling operation is to increase the height and width of input feature maps by a factor of two, e.g., from $2 \times 2$ to $4 \times 4$ . In this case, the pixels on output feature maps can be divided into four groups as in Eqn. 1. The dependencies can be defined as in Figure 5. When implementing pixel deconvolutional layers, we design a simplified version to reduce sequential dependencies for better parallel computation and training efficiency as illustrated in Figure 6.
+
+
+Figure 6: An efficient implementation of the pixel deconvolutional layer. In this layer, a $4 \times 4$ feature map is up-sampled to a $8 \times 8$ feature map. The purple feature map is generated through a $3 \times 3$ convolutional operation from the input feature map (step 1). After that, another $3 \times 3$ convolutional operation is applied on the purple feature map to produce the orange feature map (step 2). The purple and orange feature maps are dilated and added together to form a larger feature map (step 3). Since there is no relationship between the last two intermediate feature maps, we can apply a masked $3 \times 3$ convolutional operation, instead of two separate $3 \times 3$ convolutional operations (step 4). Finally, the two large feature maps are combined to generate the final output feature map (step 5).
+
+In this design, there are four intermediate feature maps. The first intermediate feature map depends on the input feature map. The second intermediate feature map relies on the first intermediate feature map. The third and fourth intermediate feature maps are based on both the first and the second feature maps. Such simplified relationships enable the parallel computation for the third and fourth intermediate feature maps, since there is no dependency between them. In addition, the masked convolutional operation can be used to generate the last two intermediate feature maps. As has been mentioned already, a variety of different dependencies relations can be imposed on the intermediate feature maps. Our simplified design achieves reasonable balance between efficiency and performance.
+
+# 3 EXPERIMENTAL STUDIES
+
+In this section, we evaluate the proposed pixel deconvolutional methods on semantic segmentation and image generation tasks in comparison to the regular deconvolution method. Results show that the use of the new pixel deconvolutional layers improves performance consistently in both supervised and unsupervised learning settings.
+
+# 3.1 SEMANTIC SEGMENTATION
+
+Experimental Setup: We use the PASCAL 2012 segmentation dataset (Everingham et al., 2010) and MSCOCO 2015 detection dataset (Lin et al., 2014) to evaluate the proposed pixel deconvolutional methods in semantic segmentation tasks. For both datasets, the images are resized to $2 5 6 \times 2 5 6 \times 3$ for batch training. Our models directly predict the label for each pixel without any post-processing. Here we examine our models in two ways: training from scratch and fine-tuning from state-of-art model such as DeepLab-ResNet.
+
+For the training from scratch experiments, we use the U-Net architecture (Ronneberger et al., 2015) as our base model as it has been successfully applied in various image segmentation tasks. The network consists of four blocks in the encoder path and four corresponding blocks in the decoder path. Within each decoder block, there is a deconvolutional layer followed by two convolutional layers. The final output layer is adjusted based on the number of classes in the dataset. The PASCAL 2012 segmentation dataset has 21 classes while the MSCOCO 2015 detection dataset has 81 classes. As the MSCOCO 2015 detection dataset has more classes than the PASCAL 2012 segmentation dataset, the number of feature maps in each layer for this dataset is doubled to accommodate more output channels. The baseline U-Net model employs deconvolutional layers within the decoder path to up-sample the feature maps. We replace the deconvolutional layers with our proposed pixel deconvolutional layers (iPixelDCL) and their simplified version (PixelDCL) while keeping all other variables unchanged. The kernel size in DCL is $6 \times 6$ , which has the same number of parameters as iPixelDCL with 4 sets of $3 \times 3$ kernels, and more parameters than PixelDCL with 2 sets of $3 \times 3$ and 1 set of $2 \times 2$ kernels. This will enable us to evaluate the new pixel deconvolutional layers against the regular deconvolutional layers while controlling all other factors.
+
+
+Figure 7: Sample segmentation results on the PASCAL 2012 segmentation dataset using training from scratch models. The first and second rows are the original images and the corresponding ground truth, respectively. The third, fourth, and fifth rows are the segmentation results of models using deconvolutional layers, iPixelDCL, and PixelDCL, respectively.
+
+For the fine-tuning experiments, we fine-tune our models based on the architecture of DeepLabResNet (Chen et al., 2016). The DeepLab-ResNet model is fine-tuned from ResNet101 (He et al., 2016) and also use external data for training. The strategy of using external training data and finetuning from classic ResNet101 greatly boosts the performance of the model on both accuracy and mean IOU. The output of DeepLab-ResNet is eight times smaller than the input image on the height and width dimensions. In order to recover the original dimensions, we add three up-sampling blocks, each of which up-samples the feature maps by a factor of 2. For each up-sampling block, there is a deconvolutional layer followed by a convolutional layer. By employing the same strategy, we replace the deconvolutional layer by PixelDCL and iPixelDCL using kernels of the same size as in the training from scratch experiments.
+
+Analysis of Results: Some sample segmentation results of U-Net using deconvolutional layers (DCL), iPixelDCL, and PixelDCL on the PASCAL 2012 segmentation dataset and the MSCOCO 2015 detection dataset are given in Figures 7 and 8, respectively. We can see that U-Net models using iPixelDCL and PixelDCL can better capture the local information of images than the same base model using regular deconvolutional layers. By using pixel deconvolutional layers, more spacial features such as edges and shapes are considered when predicting the labels of adjacent pixels.
+
+Moreover, the semantic segmentation results demonstrate that the proposed models tend to produce smoother outputs than the model using deconvolution. We also observe that, when the training epoch is small (e.g., 50 epochs), the model that employs PixelDCL has better segmentation outputs than the model using iPixelDCL. When the training epoch is large enough (e.g., 100 epochs), they have similar performance, though PixelDCL still outperforms iPixelDCL in most cases. This indicates that PixelDCL is more efficient and effective, since it has much fewer parameters to learn.
+
+Table 1 shows the evaluation results in terms of pixel accuracy and mean IOU on the two datasets. The U-Net models using iPixelDCL and PixelDCL yield better performance than the same base model using regular deconvolution. The model using PixelDCL slightly outperforms the model using iPixelDCL. For the models fine-tuned from Deeplab-ResNet, the models using iPixelDCL and PixelDCL have better performance than the model using DCL, with iPixelDCL performs the best. In semantic segmentation, mean IOU is a more accuracy evaluation measure than pixel accuracy (Everingham et al., 2010). The models using pixel deconvolution have better evaluation results on mean IOU than the base model using deconvolution.
+
+
+Figure 8: Sample segmentation results on the MSCOCO 2015 detection dataset using training from scratch models. The first and second rows are the original images and the corresponding ground truth, respectively. The third, fourth, and fifth rows are the segmentation results of models using deconvolutional layers, iPixelDCL, and PixelDCL, respectively.
+
+Table 1: Semantic segmentation results on the PASCAL 2012 segmentation dataset and MSCOCO 2015 detection dataset. We compare the same base U-Net model and fine-tuned DeepLab-ResNet using three different up-sampling methods in decoders; namely regular deconvolution layer (DCL), the proposed input pixel deconvolutional layer (iPixelDCL) and pixel deconvolutional layer (PixelDCL). The pixel accuracy and mean IOU are used as performance measures.
+
+
+
+# 3.2 IMAGE GENERATION
+
+Experimental Setup: The dataset used for image generation is the celebFaces attributes (CelebA) dataset (Liu et al., 2015). To avoid the influence of background, the images have been preprocessed so that only facial information is retained. The image generation task is to reconstruct the faces excluding backgrounds in training images. The size of images is $6 4 \times 6 4 \times 3$ . We use the standard variational auto-encoder (VAE) (Kingma & Welling, 2014) as our base model for image generation. The decoder part in standard VAE employs deconvolutional layers for up-sampling. We apply our proposed PixelDCL to replace deconvolutional layers in decoder while keeping all other components the same. The kernel size in DCL is $6 \times 6 .$ , which has more parameters than PixelDCL with 2 sets of $3 \times 3$ and 1 set of $2 \times 2$ kernels.
+
+Analysis of Results: Figure 9 shows the generated faces using VAEs with regular deconvolution (baseline) and PixelDCL in decoders. Some images generated by the baseline model suffer from apparent checkerboard artifacts, while none is found on the images generated by the model with PixelDCL. This demonstrates that the proposed pixel deconvolutional layers are able to establish direct relationships among adjacent pixels on generated feature maps and images, thereby effectively overcoming the checkerboard problem. Our results demonstrate that PixelDCL is very useful for generative models since it can consider local spatial information and produce photo-realistic images without the checkerboard problem.
+
+
+Figure 9: Sample face images generated by VAEs when trained on the CelebA dataset. The first two rows are images generated by a standard VAE with deconvolutional layers for up-sampling. The last two rows generated by the same VAE model, but using PixelDCL for up-sampling.
+
+Table 2: Training and prediction time on semantic segmentation using the PASCAL 2012 segmentation dataset on a Tesla K40 GPU. We compare the training time of 10 epochs and prediction time of 2109 images for the same base U-Net model using three different methods for up-sampling in the decoders; namely DCL, iPixelDCL, and PixelDCL.
+
+
Model
Training time
Prediction time
U-Net + DCL
365m26s
2m42s
U-Net+iPixelDCL
511m19s
4m13s
U-Net + PixelDCL
464m31s
3m27s
+
+# 3.3 TIMING COMPARISON
+
+Table 2 shows the comparison of the training and prediction time of the U-Net models using DCL, iPixelDCL, and PixelDCL for up-sampling. We can see that the U-Net models using iPixelDCL and PixelDCL take slightly more time during training and prediction than the model using DCL, since the intermediate feature maps are generated sequentially. The model using PixelDCL is more efficient due to reduced dependencies and efficient implementation discussed in Section 2.3. Overall, the increase in training and prediction time is not dramatic, and thus we do not expect this to be a major bottleneck of the proposed methods.
+
+# 4 CONCLUSION
+
+In this work, we propose pixel deconvolutional layers that can solve the checkerboard problem in deconvolutional layers. The checkerboard problem is caused by the fact that there is no direct relationship among intermediate feature maps generated in deconvolutional layers. PixelDCL proposed here try to add direct dependencies among these generated intermediate feature maps. PixelDCL generates intermediate feature maps sequentially so that the intermediate feature maps generated in a later stage are required to depend on previously generated ones. The establishment of dependencies in PixelDCL can ensure adjacent pixels on output feature maps are directly related. Experimental results on semantic segmentation and image generation tasks show that PixelDCL is effective in overcoming the checkerboard artifacts. Results on semantic segmentation also show that PixelDCL is able to consider local spatial features such as edges and shapes, leading to better segmentation results. In the future, we plan to employ our PixelDCL in a broader class of models, such as the generative adversarial networks (GANs).
+
+# REFERENCES
+
+Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. arXiv:1606.00915, 2016.
+
+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.
+
+Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. In Proceedings of The 32nd International Conference on Machine Learning, pp. 881–889, 2015.
+
+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.
+
+Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1462–1471, 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, pp. 770–778, 2016.
+
+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.
+
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, 2014.
+
+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.
+
+Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In International Conference on Artificial Intelligence and Statistics, pp. 29–37, 2011.
+
+Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+Q Li, GP Steven, and YM Xie. A simple checkerboard suppression algorithm for evolutionary structural optimization. Structural and Multidisciplinary Optimization, 22(3):230–239, 2001.
+
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ European Conference on Computer Vision, pp. 740–755. Springer, 2014.
+
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015.
+
+Alireza Makhzani and Brendan J Frey. Winner-take-all autoencoders. In Advances in Neural Information Processing Systems, pp. 2791–2799, 2015.
+
+Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. Learning deconvolution network for semantic segmentation. In IEEE International Conference on Computer Vision, 2015.
+
+Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/ deconv-checkerboard.
+
+Aaron Van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In Proceedings of The 33rd International Conference on Machine Learning, pp. 1747–1756, 2016.
+
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
+
+Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In Proceedings of The 33rd International Conference on Machine Learning, volume 3, 2016.
+
+Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio G ¨ omez Colmenarejo, Ziyu Wang, Dan ´ Belov, and Nando de Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017.
+
+Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of The 31st International Conference on Machine Learning, pp. 1278–1286, 2014.
+
+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.
+
+Evan Shelhamer, Jonathon Long, and Trevor Darrell. Fully convolutional networks for semantic segmentation. IEEE transactions on pattern analysis and machine intelligence, 2016.
+
+Wenzhe Shi, Jose Caballero, Ferenc Huszar, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel ´ Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1874–1883, 2016.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+
+Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in Neural Information Processing Systems, pp. 4790–4798, 2016.
+
+Andrea Vedaldi and Karel Lenc. Matconvnet: Convolutional neural networks for matlab. In Proceedings of the 23rd ACM international conference on Multimedia, pp. 689–692. ACM, 2015.
+
+Matthew D Zeiler, Dilip Krishnan, Graham W Taylor, and Rob Fergus. Deconvolutional networks. In Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, pp. 2528–2535. IEEE, 2010.
+
+Matthew D Zeiler, Graham W Taylor, and Rob Fergus. Adaptive deconvolutional networks for mid and high level feature learning. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 2018–2025. IEEE, 2011.
\ No newline at end of file
diff --git a/md/train/B1x5KiCcFX/B1x5KiCcFX.md b/md/train/B1x5KiCcFX/B1x5KiCcFX.md
new file mode 100644
index 0000000000000000000000000000000000000000..8d232bfa2d7f81216c27cf1f53000531916a99b7
--- /dev/null
+++ b/md/train/B1x5KiCcFX/B1x5KiCcFX.md
@@ -0,0 +1,689 @@
+# UNDERSTANDING GANS VIA GENERALIZATION ANALYSIS FOR DISCONNECTED SUPPORT
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+This paper provides theoretical analysis of generative adversarial networks (GANs) to explain its advantages over other standard methods of learning probability measures. GANs learn a probability through observations, using the objective function with a generator and a discriminator. While many empirical results indicate that GANs can generate realistic samples, the reason for such successful performance remains unelucidated. This paper focuses the situation where the target probability measure satisfies the disconnected support property, which means a separate support of a probability, and relates it with the advantage of GANs. It is theoretically shown that, unlike other popular models, GANs do not suffer from the decrease of generalization performance caused by the disconnected support property. We rigorously quantify the generalization performance of GANs of a given architecture, and compare it with the performance of the other models. Based on the theory, we also provide a guideline for selecting deep network architecture for GANs. We demonstrate some numerical examples which support our results.
+
+# 1 INTRODUCTION
+
+Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) attract much attention as technology for learning a distribution and generating data. The purpose of GANs is to learn a probability measure from a given dataset and generate samples from the learned measure. It is often seen that samples generated by GANs can extract effectively features in the real world; it is difficult, for instance, to distinguish real images and generated images. By practical successes, a countless number of variations of GANs have been developed (Dziugaite et al., 2015; Arjovsky et al., 2017; Li et al., 2015; Nowozin et al., 2016; Gulrajani et al., 2017; Zhao et al., 2016), and applied to a wide range of tasks (Reed et al., 2016; Zhu et al., 2017; Gauthier, 2014).
+
+Understanding the remarkable performance of GANs is, however, still a challenging problem. There are active discussions on the role of generators in its learning scheme (Goodfellow, 2016; Arjovsky & Bottou, 2017; Arora et al., 2018; Creswell et al., 2018), and adversarial structures with discriminators are also a target of interest (Lotter et al., 2015; Zhang et al., 2018). A gaming structure between generators and discriminators is also regarded as a useful factor in the mechanism of GANs (Mescheder et al., 2017; Arora et al., 2017; Heusel et al., 2017). Generalization performance of GANs has been investigated in several studies (Liang, 2017; Liu et al., 2017; Tolstikhin et al., 2017). In spite of these studies, it is not yet clear why GANs can generate well-extracted data better than other standard methods.
+
+This paper introduces the disconnected support property, and explains an advantage of GANs in connection with this notion. The disconnected support property refers to a probability measures of which the support is divided into several disjoint sets, allowing non-differentiable density on the boundary. The property makes a probability measure be complex, hence it can be an obstacle for standard methods to learn the measure effectively. This property, however, is popularly seen in many real data, especially data with cluster structure, as demonstrated in Section 3.
+
+We investigate in detail the approximation and estimation ability of GANs and some other methods, and provide novel generalization analysis of probability measures with disconnected support. Firstly, we show that the other methods suffer worse generalization performance due to complex structures of disconnected supports (Proposition 1 and Lemma 2). Secondly, our generalization analysis reveals that GANs can learn the probability measure without loss of efficiency under the the disconnected supports (Theorem 1, Corollary 1 and ??). Additionally, we derive a guideline for choosing the number of layers or connections of the generator and discriminator from the generalization analysis. Numerical results support our theoretical findings.
+
+We remark that the disconnected support property is different from the low-dimensional supports studied in Arjovsky & Bottou (2017), where the support of a measure generated by neural networks is disjoint to the measure of observations. In contrast, this paper considers the case in which the support of the observation measure is divided into disjoint subsets. The problem of disconnected supports is complement to the low-dimensionality, hence these two problems can be investigated separately. In this paper, to simplify the discussion, we assume that the support of a probability measure is not low-dimensional.
+
+The contributions of this paper are summarized as follows:
+
+1. We show that GANs perform better than other standard methods of estimating probability measures when the measure satisfies the disconnected support property.
+2. We provide a new generalization error bound under a general formulation of GANs by analyzing an approximation error. The result is thus applicable to a wide range of variations of GANs.
+3. Based on the generalization bound, we provide a theoretical guideline for selecting architectures of generators and discriminators.
+
+All the proofs are given in Supplementary materials.
+
+# 2 PRELIMINARIES
+
+# 2.1 NOTATION
+
+We use notations $I : = [ 0 , 1 ]$ . A $j$ -th element of a vector $b$ is denoted by $b _ { j }$ , and $\begin{array} { r } { \| b \| _ { q } : = ( \sum _ { j } b _ { j } ^ { q } ) ^ { 1 / q } } \end{array}$ is the $q$ -norm $( q \in [ 0 , \infty ] )$ . $\mathrm { v e c } ( \cdot )$ is a vectorization operator for matrices. For $z \in \mathbb { N } , [ z ] : =$ $\{ 1 , 2 , \ldots , z \}$ is a set of positive integers no more than $z$ . For $\alpha \in \mathbb { R }$ , $\lfloor \alpha \rfloor$ denotes the largest integer which is not larger than ş $\alpha$ . For a domain $\Omega$ in a Euclidean space and a function $f : \Omega \mathbb { R }$ , $\Vert f \Vert _ { L ^ { p } } : = ( \int _ { \Omega } | f ( t ) | ^ { p } d t ) ^ { 1 / p }$ denotes the $L ^ { p }$ norm for $p \in [ 0 , \infty ]$ . For $f : \Omega \to \mathbb { R } ^ { D }$ with a multidimensional output, $f _ { d }$ denotes a $d$ -th coordinate of $\boldsymbol { f } ( \boldsymbol { x } ) = ( f _ { 1 } ( \boldsymbol { x } ) , . . . , f _ { D } ( \boldsymbol { x } ) ) ^ { \top } ,$ . Let $H ^ { \beta } ( \Omega )$ be the Hölder space for $\beta > 0$ such as a set of $\beta$ -smooth functions $f : \Omega \to { \mathbb { R } }$ , namely, $f$ is $C ^ { \lfloor \beta \rfloor }$ -class and its $\lfloor \beta \rfloor$ -th derivative is $\beta - \lfloor \beta \rfloor$ -Hölder continuous. $\otimes$ denotes a tensor product, and $\bigcirc$ a composition of functions, namely, for functions $f$ and $f ^ { \prime }$ , $f \circ f ^ { \prime } = f ( f ^ { \prime } ( \cdot ) )$ . A Borel $\sigma$ -algebra of $\Omega$ is denoted as $\sigma ( \Omega )$ . For a measurable mapping $f : \Omega \to \Omega ^ { \prime }$ and $B ^ { \prime } \subset \Omega ^ { \prime }$ , a pre-image of $f$ is defined as $f ^ { - 1 } ( B ^ { \prime } ) : = \{ t \in \Omega \mid B ^ { \prime } \ni f ( t ) \}$ . Let $I _ { \Omega } : x \mapsto \{ 0 , 1 \}$ be an indicator function such that $\pmb { I } _ { \Omega } ( x ) = 1$ if $x \in \Omega$ , and $\pmb { I } _ { \Omega } ( x ) = 0$ otherwise.
+
+# 2.2 GENERAL FRAMEWORK OF GANS
+
+We provide a general formulation of a learning problem with generative adversarial networks $( G A N s )$ following Liu et al. (2017). In this paper, we consider a probability measure $P ^ { * }$ on a measurable space $( I ^ { \breve { D } } , \Sigma )$ with a dimensionality $D \in \mathbb { N }$ and $\Sigma : = \sigma ( I ^ { \hat { D } } )$ . Here, we set $D \geqslant 3$ . Suppose we have a set of $n$ observations ř ${ \mathcal { D } } : = \{ X _ { 1 } , . . . , X _ { n } \}$ which is independently and identically generated from $P ^ { * }$ . Let $\begin{array} { r } { P _ { n } : = \frac { 1 } { n } \sum _ { i \in [ n ] } \delta _ { X _ { i } } } \end{array}$ be an empirical measure where $\delta _ { x }$ is the Dirac measure at $x$ .
+
+The goal of generative networks is to estimate $P ^ { * }$ from $\mathcal { D }$ . To this end, we construct a probability measure by generators. Let $P _ { Z }$ be the uniform distribution on $( I ^ { D } , \Sigma )$ . For a measurable mapping $g : I ^ { D } \to { \bf \check { \cal I } } ^ { \check { D } }$ , we define $P _ { g }$ as the pushforward measure: i.e., $\begin{array} { r } { P _ { g } ( B ) = P _ { Z } ( g ^ { - 1 } ( B ) ) } \end{array}$ for $B \in \Sigma$ . We call $g$ as a generator and use $\mathcal { G }$ for a set of generators.
+
+GANs employ a learning scheme with a metric with discriminators (Goodfellow et al., 2014). Let $\mathcal { F } = \{ f : \mathbf { \bar { \chi } } _ { I } D ^ { \bullet } \mathbb { R } \}$ be a a set of discriminators. This paper considers a general metric for GANs (Liu et al., 2017),
+
+$$
+d _ { \mathcal { F } } ( P , P ^ { \prime } ) : = \operatorname* { s u p } _ { f \in \mathcal { F } } \mathbb { E } _ { X \sim P } [ f ( X ) ] - \mathbb { E } _ { X \sim P ^ { \prime } } [ f ( X ) ] ,
+$$
+
+between probability measures $P$ and $P ^ { \prime }$ .
+
+For the learning process, we generate $m$ noise samples $\widetilde { Z } _ { 1 } , . . . , \widetilde { Z } _ { m }$ from $P _ { Z }$ and obtain generated samples as $\tilde { X } _ { j } : = g ( \tilde { Z } _ { j } )$ with $g \in { \mathcal { G } }$ for $j \in [ m ]$ . Let $\begin{array} { r } { P _ { g , m } : = \frac { 1 } { m } \sum _ { j \in [ m ] } \delta _ { \widetilde { X } _ { j } } } \end{array}$ denote the sampling measure. GANs construct an estimator $P _ { \hat { g } }$ for $P ^ { * }$ by learning $\widehat g$ with the following optimization problem
+
+$$
+{ \widehat { g } } \in \mathop { \mathrm { a r g m i n } } _ { g \in { \mathcal { G } } } d _ { { \mathcal { F } } } \left( P _ { n } , P _ { g , m } \right) .
+$$
+
+The metric (1) covers a wide variety of GANs by selecting $\mathcal { F }$ . Among others, the original GAN (Goodfellow et al., 2014) is realized if $\mathcal { F }$ contains a logarithm of density ratio; Wasserstein-GAN (Arjovsky et al., 2017), MMD-GAN (Dziugaite et al., 2015; Li et al., 2017) and Energy-Based GAN (Zhao et al., 2016) are given if $\mathcal { F }$ is the set of 1-Lipschitz functions, a reproducing kernel Hilbert space, and the bounded continuous functions, respectively. The $f$ -GAN (Nowozin et al., 2016) also belongs to this class.
+
+We assume that $\mathcal { F }$ is large enough to contain functions which can work as a discriminator, namely, we assume that the following holds:
+
+$$
+d _ { \mathcal { F } } ( P , P ^ { \prime } ) = 0 \Leftrightarrow P = P ^ { \prime } .
+$$
+
+A sufficient condition for (3) is investigated in Zhang et al. (2018).
+
+# 2.3 DEEP NEURAL NETWORKS FOR GENERATORS AND DISCRIMINATORS
+
+In the schemes of GANs, $\mathcal { F }$ and $\mathcal { G }$ are realized by deep neural networks (DNNs). For further discussion, we formulate the function class given by DNNs.
+
+Let $L \in \mathbb { N }$ be a number of layers in DNNs, and $D _ { \ell } ^ { \prime } \in \mathbb { N }$ be a dimensionality of variables in an $\ell \cdot$ -th layer for $\ell \in \left[ L + 1 \right]$ . Here, we set $D _ { L + 1 } ^ { \prime } = D$ for generators and $D _ { L + 1 } ^ { \prime } = \mathrm { \bar { 1 } }$ for discriminators. We introduce $A _ { \ell } \in \mathbb { R } ^ { D _ { \ell + 1 } ^ { \prime } \times D _ { \ell } ^ { \prime } }$ and $b _ { \ell } \in \mathbb { R } ^ { D _ { \ell } ^ { \prime } }$ as matrix and vector parametersof the $\ell$ -th layer. An architecture $\Theta$ of DNNs is defined as a set of $L$ pairs of $\left( A _ { \ell } , b _ { \ell } \right)$ as $\bar { \Theta : = ( ( A _ { 1 } , b _ { 1 } ) , . . . , ( A _ { L } , \bar { b } _ { L } ) ) }$ . We define notations for $\Theta$ as follow: $| \Theta | : = L$ as the number of layers, $\begin{array} { r } { \| \Theta \| _ { 0 } : = \sum _ { \ell \in [ L ] } \| \operatorname { v e c } ( A _ { \ell } ) \| _ { 0 } + \| b _ { \ell } \| _ { 0 } } \end{array}$ as the number of non-zero elements in $\Theta$ , and $\begin{array} { r } { \| \Theta \| _ { \infty } : = \operatorname* { m a x } \{ \operatorname* { m a x } _ { \ell \in [ L ] } \| \mathrm { v e c } ( \mathring { A } _ { \ell } ) \| _ { \infty } , \operatorname* { m a x } _ { \ell \in [ L ] } \| b _ { \ell } \| _ { \infty } \} } \end{array}$ be the scale of parameters in $\Theta$ . We employ the ReLU activation function $\eta : \mathbb { R } ^ { D ^ { \prime } } \to \mathbb { R } ^ { D ^ { \prime } }$ for each $D ^ { \prime } \in \mathbb { N }$ such as $\eta ( x ) = ( \operatorname* { m a x } \{ x _ { d } , 0 \} ) _ { d \in [ D ^ { \prime } ] }$ .
+
+We define functions of DNNs with an architecture $\Theta$ as $\xi [ \Theta ] : \mathbb { R } ^ { D ^ { \prime } } \mathbb { R } ^ { D ^ { \prime \prime } }$ by
+
+$$
+\xi [ \Theta ] ( x ) = x ^ { ( L + 1 ) } , x ^ { ( 1 ) } : = x , x ^ { ( \ell + 1 ) } : = \eta ( A _ { \ell } x ^ { ( \ell ) } + b _ { \ell } ) , \mathrm { f o r } \ell \in [ L ] .
+$$
+
+The function class of DNNs is thus given by
+
+$$
+\Xi ( S , B , L ) : = \Big \{ \xi [ \Theta ] : I ^ { D } \to \mathbb { R } \ | \ \| \Theta \| _ { 0 } \leqslant S , \| \Theta \| _ { \infty } \leqslant B , | \Theta | \leqslant L \Big \} ,
+$$
+
+where $S \in \mathbb { N } , B > 0$ , and $L \in \mathbb { N }$ are hyper-parameters. Here, $S$ bounds the number of non-zero parameters of DNNs, namely, it controls the sparseness of DNNs. $B$ is a bound for scales of parameters.
+
+# 3 DISCONNECTED SUPPORT PROPERTY
+
+# 3.1 INTRODUCTION AND EXAMPLE
+
+It is often observed that data in real world data the support of its probability measure may not be connected but a union of disjoint subsets. This is typical if the data has cluster structures, as seen in many data sets for classification tasks. Moreover, the density function of the probability measure may not be smooth at a boundary of the support. Figures 1 (MNIST, (LeCun et al., 1998)) and 2 (Shelter Animal, Center) illustrate such examples in the real world. They are projected onto a 2-dimensional Euclidean space by t-SNE (Maaten & Hinton, 2008) so that they preserve the original distance structure among points. We can see that both of the data are concentrated on several disjoint subsets and there are a clear gap or empty regions between some of the subsets. This observation suggests that the disconnected property of probability measures should be addressed in discussing estimation of probability measures, while standard analysis does not consider this phenomenon. In fact, this paper will show that the disconnected supports property has an important role in showing an advantage of GANs over standard estimation methods.
+
+
+Figure 1: Plot of the MNIST data.
+
+
+Figure 2: Plot of the animal data.
+
+# 3.2 MATHEMATICAL FORMULATION OF DISCONNECTED SUPPORTS
+
+Here we make a rigorous definition of disconnected supports. The property of smoothness (i.e. differentiability) is involved, which is a key factor to analyze generalization performance in the fields of the statistics (Stone, 1982; Tsybakov, 2009); Stone (1982) shows, for instance, that smoothness and a dimension of data are sufficient to characterize an optimal convergence of generalization errors.
+
+We first prepare a family of subsets as a component in the disconnected supports:
+
+$\begin{array} { r } { S _ { \alpha , J } : = \left\{ S \subset I ^ { D } \ \right| } \end{array}$ A boundary of $S$ is $J$ combination of $\alpha$ -smooth hyper surfaces .
+
+The supplementary material will provide a more rigorous definition.
+
+Now, we define the disconnected support property of probability measures as well as a probability measure with global support, i.e., with no the disconnected support property. Let $\operatorname { S u p p } ( P )$ be the support of $P$ ., i.e, ${ \dot { \operatorname { S u p p } } } ( P ) : = \{ x \in I ^ { D } \mid P ( V _ { x } ) > 0$ for all open neighborhood $V _ { x }$ of $x \}$ Hereafter, $M \geqslant 2$ is the number of disjoint components of a support.
+
+Definition 1. (Disconnected Supports / Global Support)
+Let $M \geqslant 2$ . A probability measure $P$ on $( I ^ { D } , \bar { \Sigma } )$ has $M$ disconnected supports, if there exist
+nonempty disjoint sets ${ \cal S } _ { 1 } , . . . , { \cal S } _ { M } \in { \cal S } _ { \alpha , J }$ such that
+
+$$
+\operatorname { S u p p } ( P ) = \bigcup _ { m \in [ M ] } S _ { m } .
+$$
+
+A probability measure $P$ on $( I ^ { D } , \Sigma )$ has a global support, if $\operatorname { S u p p } ( P ) = I ^ { D }$ .
+
+Figure 3 illustrates the disconnected support property.
+
+We next formulate a notion of smoothness for $P$ with disconnected supports. Let $\beta \geqslant 1$ be a parameter for a degree of smoothness of $P$ .
+
+Definition 2. (Local Smoothness)
+
+A probability measure $P$ with $M$ disconnected support is locally $\beta$ -smooth, if there exist $M$ pairs $( \widetilde { S } _ { m } , S _ { m } ) \in \mathrm { ~ \cal { S } ~ } _ { 2 \beta , J } \times S _ { 2 \beta , J }$ and $\beta + 1$ -smooth bijective measurable maps $\gamma _ { m } : \widetilde { S } _ { m } S _ { m }$ as
+
+$$
+P ( B ) = P _ { Z } ( \gamma _ { m } ^ { - 1 } ( B ) ) , \forall B \in \sigma ( S _ { m } ) ,
+$$
+
+for $m \in [ M ]$
+
+This definition of local smoothness says that a probability measure $P$ with disconnected supports can be generated by sufficiently smooth mappings $\gamma _ { m }$ . It is used for considering a smooth density function of $P$ restricted on $S _ { m }$ .
+
+Lemma 1. (Locally Smooth Density Functions)
+If a probability measure $P$ with $M$ disconnected support is locally $\beta$ -smooth, then there exists a
+function $p _ { m } : S _ { m } \to \mathbb { R } _ { + }$ such that
+
+$$
+P ( B ) = \int _ { B } p _ { m } ( x ) d \lambda , B \in \sigma ( S _ { m } ) ,
+$$
+
+where $\lambda$ is the Lebesgue measure, and $p _ { m }$ is $\beta$ -smooth for all $m \in [ M ]$ .
+
+We call $p _ { m }$ as a local density function.
+
+Note that, since Ť $P$ with disconnected supports is not absolutely continuous to the Lebesgue measure on $\textstyle I ^ { D } \backslash \bigcup _ { m \in [ M ] } S _ { m }$ , an ordinary density function cannot be defined. Instead, a localized version of density functions for each $S _ { m }$ is introduced, which is guaranteed by the local smoothness.
+
+
+Figure 3: Illustration of a probability measure $P$ with a disconnected support. $\operatorname { S u p p } ( P )$ is a union of two disjoint sets $S _ { 1 }$ and $S _ { 2 }$ .
+
+
+Figure 4: Illustration of a generator $g$ . To represent discontinuous $S _ { 1 }$ and $S _ { 2 }$ , $g$ should be discontinuous.
+
+# 3.3 DIFFICULTY WITH DISCONNECTED SUPPORTS
+
+As shown in this subsection, the generalization performance of many standard estimation methods is worsened with disconnected supports. We consider popular nonparametric methods, for which the generalization performance is well-studied in the asymptotics of the observation size $n$ . The considered methods are the kernel density estimator (KDE) (Nadaraya, 1964), the nonparametric Bayes (NB) by the Dirichlet mixtures of normal distributions (Ferguson, 1973), the series density estimator (SDE) (Efromovich et al., 2008; Efromovich, 2010) and the density estimator with Gaussian process (GP) (Leonard, 1978). Bounds of the generalization errors for these methods are already known (Tsybakov, 2009; Ghosal et al., 2007; van der Vaart $\&$ van Zanten, 2008), and they are optimal in the minimax sense. Here, their performance is evaluated with respect to a root of an expected squared loss with respect to the $L ^ { 2 }$ -norm, namely, $d _ { 2 } ( P , P ^ { \prime } ) : = \mathbb { E } [ \| p - p ^ { \prime } \| _ { L ^ { 2 } } ^ { 2 } ] ^ { 1 / 2 }$ where $p$ and $p ^ { \prime }$ are densities for $P$ and $P ^ { \prime }$ .
+
+We show the deterioration of their performance by the disconnected support property. Let $\hat { P }$ be an estimator for $P ^ { * }$ by KDE, NB, SDE, or GP. If $P ^ { * }$ has a global support and a $\beta$ -smooth density, the existing studies (Tsybakov, 2009; Ghosal et al., 2007; van der Vaart $\&$ van Zanten, 2008) show that
+
+$$
+d _ { 2 } ( P ^ { * } , \widehat { P } ) = O \left( n ^ { - \beta / ( 2 \beta + D ) } \right) .
+$$
+
+These bounds are sufficiently tight, since these bounds corresponds to an optimal rate (Stone, 1982), and the performance of the methods can be improved as the density for $P ^ { * }$ is smoother (larger $\beta$ ).
+
+On the other hand, we consider a case in which $P ^ { * }$ has the disconnected support property.
+
+Proposition 1. (Deterioration of other standard methods) There exists $P ^ { * }$ of the disconnected support property and locally $\beta$ -smooth such that
+
+$$
+d _ { 2 } ( P ^ { * } , \widehat { P } ) = { \cal O } \left( n ^ { - 1 / ( 2 + D ) } \right) .
+$$
+
+When $P ^ { * }$ has disconnected supports, the errors are worse than those for the global support, independent of $\beta$ . This worse generalization error can be understood by the non-smoothness or discontinuity of the density functions on the boundaries of the disconnected sets (see Figure 3).
+
+We next discuss other generative models for estimating a probability measure. To the best of our knowledge, other probabilistic generative methods (Koller et al., 2009) and the variational autoencoder (Kingma & Welling, 2013), their statistical generalization property is not well investigated. Here we provide a property of generators for probability measures with disconnected supports.
+
+Lemma 2. (Discontinuous Generators for Disconnected Supports)
+If $P ^ { * }$ has disconnected supports and $P ^ { * } = P _ { g ^ { * } }$ with a generator $g ^ { * }$ , then $g ^ { * }$ is not uniformly continuous.
+
+Lemma 2 states that a generator must be discontinuous to construct a probability measure with disconnected support sets. Intuitively, to make $P _ { g ^ { * } } ( B ) = 0$ for $B \in I ^ { D }$ with $\lambda ( B ) > 0$ , the slope of $g ^ { * }$ at $z \in I ^ { D }$ should be close to infinite for $z \in g ^ { * , - 1 } ( B )$ , hence $g ^ { * }$ cannot be uniformly continuous (see Figure 4). Because of the discontinuity, generative models with smooth functions, such as an adversarial generative model with kernel generators (Sinn & Rawat, 2018), cannot work well with disconnected supports.
+
+# 4 GENERALIZATION BY GANS
+
+We provide generalization analysis for GANs for probability measures with and without disconnected supports. For the purpose, we employ a metric $d _ { \mathcal { F } }$ with properly selected discriminators $\mathcal { F }$ and evaluate the generalization error $d _ { \mathcal { F } } ( P ^ { \ast } , P _ { \hat { g } } )$ with respect to an observation size $n$ and a sampling size $m$ . We assume $\mathcal { F }$ is realized by DNNs as $\mathcal { F } = \Xi ( S _ { f } , B _ { f } , L _ { f } ) \cap \widetilde { \mathcal { F } }$ with parameters $S _ { f } , B _ { f } , L _ { f }$ , where $\tilde { \mathcal { F } }$ is a specified functional class; for an example, $\tilde { \mathcal { F } }$ is 1-Lipschitz functions for WassersteinGAN. Here, we consider settings that all $f \in { \mathcal { F } }$ are $L _ { 1 }$ -Lipschitz continuous and $\| f \| _ { L ^ { \infty } } \leqslant B _ { F }$ with constants $L _ { 1 } , B _ { F } > 0 .$ Generators are also constructed by DNNs as $\mathcal { G } = \Xi ( S _ { g } , B _ { g } , L _ { g } )$ with parameters $S _ { g } , B _ { g } , L _ { g }$ .
+
+A standard line of discussing generalization, we should consider statistical errors and approximation errors. We define a measure of the complexity of $\mathcal { F }$
+
+$$
+\Upsilon _ { n } ( \mathcal { F } ) : = \operatorname* { i n f } _ { \eta > 0 } 4 \eta + 1 2 n ^ { - 1 / 2 } \int _ { \eta } ^ { c } \log \mathcal { N } ( ( L _ { 1 } + 1 ) ^ { - 1 } \epsilon , \mathcal { F } , \| \cdot \| _ { n } ) ^ { 1 / 2 } d \epsilon ,
+$$
+
+where $c > 0$ is a constant depends on $\mathcal { F }$ and $\mathcal { N } ( \epsilon , \tilde { \mathcal { F } } , \| \cdot \| )$ is a covering number of $\tilde { \mathcal { F } }$ with respect to an empirical norm $\| \cdot \|$ . We note that $\Upsilon _ { n } ( \mathcal { F } )$ bounds an expectation of the Rademacher complexity as
+
+$$
+\Upsilon _ { n } ( \mathcal { F } ) \geqslant \mathbb { E } \left[ \operatorname* { s u p } _ { f \in \mathcal { F } } \frac { 1 } { n } \left| \sum _ { i \in [ n ] } \tau _ { i } f ( X _ { i } ) \right| \right] ,
+$$
+
+where $\tau _ { i }$ is the i.i.d. Rademacher random variables; $\operatorname* { P r } ( \tau _ { i } = 1 ) = \operatorname* { P r } ( \tau _ { i } = 1 ) = 1 / 2$ , and the expectation is about $X _ { i }$ and $\tau _ { i }$ . Using the statistics and learning theory van der Vaart & Wellner (1996); Bartlett et al. (2005), we can apply a bound for $\Upsilon _ { n } ( \mathcal { F } )$ as
+
+$$
+\Upsilon _ { n } ( \mathcal { F } ) \leqslant C _ { \mathcal { F } } n ^ { - 1 / \kappa } ,
+$$
+
+with some constants $C _ { \mathcal { F } } > 0$ and $\kappa \geqslant 2$ .
+
+Regarding approximation errors, we need to consider approximation of a discontinuous function;
+since Lemma 2 shows that a discontinuous generator is necessary to represent disconnected supports.
+To approximate such generators, DNNs in GANs has an advantage.
+
+Lemma 3. (Approximation for Discontinuous $g$ by DNNs) Suppose $P ^ { * }$ has $M$ disconnected supports and locally $\beta$ -smooth, and also $P ^ { * } = P _ { g ^ { * } }$ holds with some $g ^ { * }$ . Then, for any $S _ { g }$ , there exist $\mathcal { G }$ , ${ \dot { g } } \in { \mathcal { G } }$ , and a constant $c _ { g } = c _ { g } ( B _ { g } , L _ { g } ) > 0$ such that
+
+$$
+\lVert \dot { \boldsymbol g } _ { d } - \boldsymbol g _ { d } ^ { * } \rVert _ { L ^ { 2 } } \leqslant c _ { g } M S _ { g } ^ { - \beta / D } , \forall d \in [ D ] .
+$$
+
+Furthermore, if $P ^ { * } = P _ { g ^ { * } }$ has a global support and it is $\beta$ -smooth, (4) holds with $M = 1$
+
+Lemma 3 shows that $\mathcal { G }$ for GANs can approximate $g ^ { * }$ for disconnected supports with the rate $\left( - \beta / D \right)$ by $S _ { g }$ , and the rate is same in the case of global support. This implies an advantage of GANs in comparison with the other standard methods (Proposition 1).
+
+Based on Lemma 3, we obtain the main theorem for generalization analysis.
+
+Theorem 1. (Generalization of GANs) Suppose that $P ^ { * }$ has $M$ disconnected supports and locally $\beta$ -smooth, and we have n observations and m samplings. Then, with $\mathcal { F }$ , an existing $\mathcal { G }$ , an estimator $P _ { \hat { g } }$ by (2), and finite constants $c _ { 1 } =$ $c _ { 1 } ( L _ { f } , B _ { f } , L _ { g } , B _ { g } ) , c _ { 2 } , c _ { 3 } = c _ { 3 } ( L _ { f } , B _ { f } ) > 0$ , the following inequality holds with high probability,
+
+$$
+d _ { \mathcal { F } } \big ( P ^ { * } , P _ { \widehat { g } } \big ) \leqslant \underbrace { \Upsilon _ { m } ( \widetilde { \mathcal { F } } ) + c _ { 1 } \frac { \sqrt { S _ { g } } + \sqrt { S _ { f } } } { \sqrt { m } } } _ { = : I } + \underbrace { c _ { 2 } M D S _ { g } ^ { - \beta / D } } _ { = : I I } + \underbrace { \Upsilon _ { n } ( \widetilde { \mathcal { F } } ) + c _ { 3 } \sqrt { \frac { S _ { f } } { n } } } _ { = : I I I } .
+$$
+
+Furthermore, $i f P ^ { * }$ has a global support and it is $\beta$ -smooth, (5) holds with $M = 1$
+
+Each of the terms $I , I I$ and $I I I$ has the following role: $I$ bounds an error by the $m$ samplings, $I I$ bounds an error from approximation by $\mathcal { G }$ , and $I I I$ bounds an error by $n$ observations.
+
+Proof Outline: By the definition of $P _ { \hat { g } }$ in (2) and standard calculation, we obtain the inequality
+
+$$
+d _ { \mathcal { F } } ( P ^ { * } , P _ { \hat { g } } ) \leqslant \underbrace { 2 \operatorname* { s u p } _ { g \in \mathcal { G } } \operatorname* { s u p } _ { f \in \mathcal { F } } \big | \mathbb { E } _ { P _ { g , m } } [ f ( X ) ] - \mathbb { E } _ { P _ { g } } [ f ( X ) ] \big | } _ { = : i } + \underbrace { \operatorname* { i n f } _ { g \in \mathcal { G } } d _ { \mathcal { F } } ( P _ { g } , P ^ { * } ) } _ { = : i i } + \underbrace { 2 d _ { \mathcal { F } } ( P _ { n } , P _ { 0 } ) } _ { = : i i i } .
+$$
+
+To obtain $i \leqslant I$ and $i i i \leqslant I I I$ , we apply an empirical process technique (van der Vaart & Wellner, 1996), especially convergence of integral probability measures (Sriperumbudur et al., 2012) and the entropy control technique (Lemma 4 and 5 in the supplementary material). To show $i i \leqslant I I$ , we employ recent results on approximation ability of DNNs (Yarotsky, 2017; Petersen & Voigtlaender, 2017; Imaizumi & Fukumizu, 2018) and obtain an approximation bound for $d _ { \mathcal { F } } ( P _ { g } , P ^ { * } )$ (Lemma 3). Combining these results, we obtain the statement of Theorem 1. □
+
+Theorem 1 provides two trade-off relations with respect to $S _ { g }$ and $S _ { f }$ . The generator class $\mathcal { G }$ controls uncertainty by sampling and the approximation error, while $S _ { f }$ controls uncertainty of observations and discrimination. For balancing the trade-offs, we select the number of parameters (connections of DNNs) with some constants $c _ { g } , c _ { f } > 0$ as
+
+$$
+S _ { g } = c _ { g } m ^ { D / ( 2 \beta + D ) } , ~ \mathrm { a n d } ~ S _ { f } = c _ { f } n ^ { ( \kappa - 2 ) / \kappa } ,
+$$
+
+for optimizing the bound (5). We then obtain the following corollary.
+
+Corollary 1. (Convergence Rate of GANs)
+Make the same assumptions as Theorem $^ { l }$ , and set $S _ { f }$ and $S _ { g }$ as in (6). Then, with high probability
+converging to 1, we obtain
+
+$$
+d _ { \mathcal { F } } ( P ^ { \ast } , P _ { \hat { g } } ) = O \left( n ^ { - 1 / \kappa } \right) + O \left( m ^ { - 1 / \kappa } + m ^ { - \beta / ( 2 \beta + D ) } \right) .
+$$
+
+A selection of $\tilde { \mathcal { F } }$ determines the first term in (7), since \` $\kappa$ depends on ˘ $\tilde { \mathcal { F } }$ . For an example, when $\mathcal { F }$ is a set of 1-Lipschitz functions, the first term is $O \left( n ^ { - 1 / \left( 2 + 2 D \right) } \right)$ (Sriperumbudur et al., 2012).
+
+Remark 1. (Heterogeneous Smoothness)
+
+Corollary 1 can be extended when $P ^ { * }$ has different smoothness for each $m \in [ M ]$ , i.e., $P ^ { * }$ is locally $\beta _ { m }$ -smooth on a set $S _ { m }$ . In this case, we can easily extend our analysis in Theorem 1 and Corollary 1, and obtain the following convergence rate.
+
+$$
+d _ { \mathcal { F } } ( P ^ { \ast } , P _ { \hat { g } } ) = O \left( n ^ { - 1 / \kappa } \right) + O \left( m ^ { - 1 / \kappa } + m ^ { - \widetilde { \beta } / ( 2 \widetilde { \beta } + D ) } \right) ,
+$$
+
+where $\widetilde { \beta } : = \operatorname* { m i n } _ { m \in \left[ M \right] } \beta _ { m }$
+
+# 5 DISCUSSION
+
+We emphasize the theoretical results show that GANs do not suffer from the effect of disconnected supports. A larger $\beta$ improves performance of GANs even with disconnected supports, as shown in Theorem 1 and Corollary 1. This phenomenon is different from the result of the other methods discussed in Proposition 1. Hence, we can state that GANs have advantages over the other methods which are deteriorated by the disconnected property (Section 3.3). In other words, when data are generated from a probability measure with disconnected supports and sufficiently smooth in each of the sets, only GANs can estimate the measure effectively and the other methdos cannot. This advantage of GANs comes from the approximation power for discontinuous generators shown in Lemma 3.
+
+The results (5) and (7) provide interpretation about performance of GANs. About convergence with $n$ the complexity of $\tilde { \mathcal { F } }$ and $S _ { f }$ control a trade-off between convergence and a power of discrimination. While smaller $S _ { f }$ reduce the errors in terms of $d _ { \mathcal { F } }$ , too small $S _ { f }$ can lose the power of discrimination to satisfy (1). Hence, setting $S _ { f }$ as in (6) can keep the discrimination power and does not worsen the overall rate of convergence $O ( n ^ { - 1 / \kappa } )$ . About convergence with $m$ , $S _ { g }$ controls the trade-off between the bias and variance of the estimator. An optimal way to select $S _ { g }$ is provided in (6) which depends on $\beta$ and $D$ , and it is more important when $\kappa$ is small (e.g. $\kappa = 2$ as MMD-GAN). Based on the interpretation and the selection rule (6), our study can provide a guideline for a design of the architecture of DNNs.
+
+# 5.1 RELATED WORKS
+
+Compared with studies for understanding GANs (Dziugaite et al., 2015; Liang, 2017; Liu et al., 2017; Zhang et al., 2018; Biau et al., 2018; Arora et al., 2017), we show that GANs can avoid influences of disconnected supports, unlike the other methods, hence it is a source of the advantage of GANs. This paper is the first work to focus on the disconnected support property, while several discussions (Goodfellow, 2016; Liang, 2017; Creswell et al., 2018) focus on models and metrics of the learning scheme of GANs.
+
+It is important to compare our result with other studies for generalization analysis. Although some existing studies (Dziugaite et al., 2015; Liang, 2017; Liu et al., 2017; Zhang et al., 2018; Biau et al., 2018; Arora et al., 2017) provide generalization analysis, they do not analyze an approximation effect, namely, they evaluate $\begin{array} { r } { d _ { \mathcal { F } } ( P ^ { * } , P _ { \hat { g } } ) - \operatorname* { i n f } _ { g \in \mathcal { G } } ( P ^ { * } , P _ { g } ) } \end{array}$ . Since we analyze the term ${ \operatorname* { i n f } } _ { g \in { \mathcal { G } } } ( P ^ { * } , P _ { g } )$ , we can provide a more general bound and discuss the effect of disconnected support.
+
+As we mentioned in the introduction, this paper is not along with studies for low-dimensional supports (Arjovsky & Bottou, 2017). We also note that an optimization aspect and gaming aspect of GANs are out of concerns of this paper. We focus on the statistical aspects of GANs such as sample complexity.
+
+# 6 NUMERICAL EXPERIMENTS
+
+We compare the numerical performance of GANs and the other methods with toy data with. We generate synthetic data from the following two settings: (A) Gaussian distribution restricted on a compact set (global support), and (B) a probability measure with two disconnected supports (density function is the black solid line in Figure 6). We generate $n = 5 0 0$ , 1000, ..., 5000 observations and estimate the true probability measures with Wasserstein GAN, MMD-GAN, KDE (the Gaussian kernel and the Epanechnikov kernel), SDE (Fourier basis), and NB (Dirichlet process prior). Hyperparameters for these methods are selected by cross-validation. For GANs, we set $m = n$ . We use $d _ { \mathcal { F } }$ to evaluate errors by GANs, and a root of the expected squared errors with the $L ^ { 2 }$ -norm for the other methods. The plots are the mean of 30 replications.
+
+Figure 5 shows generalization errors by the methods. With the disconnected support case (B), we plot the estimated density in Figure 6. The black line shows the true density, the dashed line is by estimated densities of the other methods, and bars are histograms by GANs. The results by Wasserstein-GAN and MMD-GAN are almost same, so we omit the result by Wasserstein-GAN.
+
+In Figure 5, we see that in the case of global support (A), the error of GANs and the other methods are comparable. In contrast, in the case of disconnected supports (B), the other standard methods show worse generalization and only GANs keep the high performance. From Figure 6, we can see that GANs can reveal the disconnected supports, while some of the other methods fail to fit. KDE with the Gaussian kernel represents the disconnected support by employing a small bandwidth. However, the small bandwidth yields a too sharp density, tending to worsen the generalization performance.
+
+
+
+
+Figure 5: Generalization errors.
+Figure 6: Estimated density functions with the case (B).
+
+# 7 CONCLUSION
+
+We investigate a generalization performance of GANs with a situation such that a support of real probability measures is divided into several sets. We find that GANs do not suffer from the division of supports, while some of the other nonparametric methods loss their efficiency by the division. Since real data are often distributed on such divided supports, the finding in this paper is related to the question of why GANs perform well with real datasets.
+
+# REFERENCES
+
+Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
+Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). arXiv preprint arXiv:1703.00573, 2017.
+Sanjeev Arora, Andrej Risteski, and Yi Zhang. Do gans learn the distribution? some theory and empirics. 2018.
+Peter L Bartlett, Olivier Bousquet, Shahar Mendelson, et al. Local rademacher complexities. The Annals of Statistics, 33(4):1497–1537, 2005.
+G Biau, B Cadre, M Sangnier, and U Tanielian. Some theoretical properties of gans. arXiv preprint arXiv:1803.07819, 2018.
+Austin Animal Center. Shelter animal outcomes. http://www.austintexas.gov/ department/aac.
+Antonia Creswell, Tom White, Vincent Dumoulin, Kai Arulkumaran, Biswa Sengupta, and Anil A Bharath. Generative adversarial networks: An overview. IEEE Signal Processing Magazine, 35(1): 53–65, 2018.
+Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, pp. 258–267. AUAI Press, 2015.
+Sam Efromovich. Orthogonal series density estimation. Wiley Interdisciplinary Reviews: Computational Statistics, 2(4):467–476, 2010.
+
+Sam Efromovich et al. Adaptive estimation of and oracle inequalities for probability densities and characteristic functions. The Annals of Statistics, 36(3):1127–1155, 2008.
+
+Thomas S Ferguson. A bayesian analysis of some nonparametric problems. The annals of statistics, pp. 209–230, 1973.
+
+Jon Gauthier. Conditional generative adversarial nets for convolutional face generation. Class Project for Stanford CS231N: Convolutional Neural Networks for Visual Recognition, Winter semester, 2014(5):2, 2014.
+
+Subhashis Ghosal, Aad Van Der Vaart, et al. Posterior convergence rates of dirichlet mixtures at smooth densities. The Annals of Statistics, 35(2):697–723, 2007.
+
+Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
+
+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.
+
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5769–5779, 2017.
+
+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. 6629–6640, 2017.
+
+Masaaki Imaizumi and Kenji Fukumizu. Deep neural networks learn non-smooth functions effectively. arXiv preprint arXiv:1802.04474, 2018.
+
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
+
+Daphne Koller, Nir Friedman, and Francis Bach. Probabilistic graphical models: principles and techniques. MIT press, 2009.
+
+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.
+
+Tom Leonard. Density estimation, stochastic processes and prior information. Journal of the Royal Statistical Society. Series B (Methodological), pp. 113–146, 1978.
+
+Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnabás Póczos. Mmd gan: Towards deeper understanding of moment matching network. In Advances in Neural Information Processing Systems, pp. 2200–2210, 2017.
+
+Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In International Conference on Machine Learning, pp. 1718–1727, 2015.
+
+Tengyuan Liang. How well can generative adversarial networks (gan) learn densities: A nonparametric view. arXiv preprint arXiv:1712.08244, 2017.
+
+Shuang Liu, Olivier Bousquet, and Kamalika Chaudhuri. Approximation and convergence properties of generative adversarial learning. In Advances in Neural Information Processing Systems, pp. 5551–5559, 2017.
+
+William Lotter, Gabriel Kreiman, and David Cox. Unsupervised learning of visual structure using predictive generative networks. arXiv preprint arXiv:1511.06380, 2015.
+
+Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
+
+Pascal Massart. Some applications of concentration inequalities to statistics. In Annales-Faculte des Sciences Toulouse Mathematiques, volume 9, pp. 245–303. Université Paul Sabatier, 2000.
+
+Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. The numerics of gans. In Advances in Neural Information Processing Systems, pp. 1823–1833, 2017.
+
+James R Munkres. Topology. Prentice Hall, 2000.
+
+Elizbar A Nadaraya. On estimating regression. Theory of Probability & Its Applications, 9(1): 141–142, 1964.
+
+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.
+
+Philipp Petersen and Felix Voigtlaender. Optimal approximation of piecewise smooth functions using deep relu neural networks. arXiv preprint arXiv:1709.05289, 2017.
+
+Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016.
+
+Johannes Schmidt-Hieber. Nonparametric regression using deep neural networks with relu activation function. arXiv preprint arXiv:1708.06633, 2017.
+
+Mathieu Sinn and Ambrish Rawat. Non-parametric estimation of jensen-shannon divergence in generative adversarial network training. In International Conference on Artificial Intelligence and Statistics, pp. 642–651, 2018.
+
+Bharath K Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Schölkopf, Gert RG Lanckriet, et al. On the empirical estimation of integral probability metrics. Electronic Journal of Statistics, 6:1550–1599, 2012.
+
+Elias M Stein. Singular integrals and differentiability properties of functions (PMS-30), volume 30. Princeton university press, 2016.
+
+Ingo Steinwart and Andreas Christmann. Support vector machines. Springer Science & Business Media, 2008.
+
+CJ Stone. Optimal global rates of convergence for nonparametric regression. The Annals of Statistics, 10:1040–1053, 1982.
+
+Ilya O Tolstikhin, Sylvain Gelly, Olivier Bousquet, Carl-Johann Simon-Gabriel, and Bernhard Schölkopf. Adagan: Boosting generative models. In Advances in Neural Information Processing Systems, pp. 5430–5439, 2017.
+
+Alexandre B Tsybakov. Introduction to nonparametric estimation, 2009.
+
+AW van der Vaart and JH van Zanten. Rates of contraction of posterior distributions based on gaussian process priors. The Annals of Statistics, 36(3):1435–1463, 2008.
+
+AW van der Vaart and Jon Wellner. Weak Convergence and Empirical Processes: With Applications to Statistics. Springer Science & Business Media, 1996.
+
+Dmitry Yarotsky. Error bounds for approximations with deep relu networks. Neural Networks, 94: 103–114, 2017.
+
+Pengchuan Zhang, Qiang Liu, Dengyong Zhou, Tao Xu, and Xiaodong He. On the discriminationgeneralization tradeoff in gans. Proceedings of International Conference on Learning Representations, 2018.
+
+Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
+
+Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017.
+
+# Supplementary Materials for “Understanding GANs via disconnected Support Detection”
+
+We introduce a new notation $P f : = \mathbb { E } _ { X \sim P } [ f ( X ) ]$ with a probability measure $P$ and a function $f$ . For a set $\Omega$ with equipped distance $d$ , let $\mathcal { N } ( \epsilon , \Omega , d )$ be a covering number which is a minimum number of $\epsilon$ -balls to cover $\Omega$ .
+
+# A SOME ADDITIONAL INFORMATION
+
+# A Rigorous Definition of $S _ { \alpha , J }$
+
+We consider a set represented by a combination of multiple horizon functions, which has been used in Petersen & Voigtlaender (2017). Given $\alpha$ -smooth function $h \in \check { H ^ { \alpha } } ( I ^ { D - 1 } )$ with $\alpha \geqslant 1$ , a horizon function $\Psi _ { h } : I ^ { D } \overset { \sim } { } \{ 0 , 1 \}$ is defined for some $d \in [ D ]$ as
+
+$$
+\Psi _ { h } = \Psi ( x _ { 1 } , \ldots , x _ { d - 1 } , x _ { d } \pm h ( x _ { 1 } , \ldots , x _ { d - 1 } , x _ { d + 1 } , \ldots , x _ { D } ) , x _ { d + 1 } , . . . , x _ { D } ) ,
+$$
+
+where $\Psi$ is the Heaviside function; $\Psi ( x ) = I _ { \{ x \in I ^ { D } | x _ { d } \geqslant 0 \} }$ . We define a set by the intersection of $J$ horizon functions $\Psi _ { h _ { 1 } } , . . . , \Psi _ { h _ { J } }$ ; namely the family of sets is defined by
+
+$$
+S _ { \alpha , J } : = \left\{ S \subset [ 0 , 1 ] ^ { D } \mid { \cal I } _ { S } = \Psi _ { h _ { 1 } } \otimes \cdot \cdot \cdot \otimes \Psi _ { h _ { J } } \right\} .
+$$
+
+Intuitively, $h$ is regarded as an $\alpha$ -smooth curved surface in $I ^ { D }$ , and $\Psi _ { h }$ describes a set which is one side of the surface. Also, $S \in S _ { \alpha , J }$ is a set which is a intersection of $J$ sets by $\Psi _ { h _ { 1 } } , . . . , \Psi _ { h _ { J } }$ .
+
+# A Support of Probability Measures
+
+Let $N _ { x }$ denote an open neighborhood of $x \in I ^ { D }$ , and For a probability measure $P$ , a support of $P$ is defined as
+
+$$
+\mathrm { S u p p } ( P ) : = \bigg \{ x \in I ^ { D } \ | \ P ( N _ { x } ) > 0 , \forall N _ { x } \in \Sigma \bigg \} .
+$$
+
+# B PROOFS
+
+# B.1 PROOF OF LEMMA 1
+
+Fix $m \in [ M ]$ and a corresponding $\widetilde { S } _ { m } , S _ { m }$ and $g _ { m }$ . For any $B \in \sigma ( S _ { m } )$ , the definition of $\gamma _ { m }$ yields
+
+$$
+P _ { X } ( B ) = P _ { Z } ( \gamma _ { m } ^ { - 1 } ( B ) ) = \int _ { \gamma _ { m } ^ { - 1 } ( B ) } p _ { Z } ( z ) d z ,
+$$
+
+where $p _ { Z }$ is a density function of a uniform measure $P _ { Z }$ . By changing variables $x = \gamma _ { m } ( z )$ , we have
+
+$$
+\int _ { \gamma _ { m } ^ { - 1 } ( B ) } p _ { Z } ( z ) d z = \int _ { B } p _ { Z } ( \gamma _ { m } ^ { - 1 } ( x ) ) J _ { \gamma _ { m } } ( x ) d x ,
+$$
+
+where $J _ { \gamma _ { m } } ( x ) = | \operatorname* { d e t } \nabla g _ { m } ^ { - 1 } ( x ) |$ . Using $p _ { Z } ( z ) = 1$ for all $z \in I ^ { D }$ , we obtain the following form of $P _ { X } ( B )$ using a function $p _ { m } : \widetilde { S } _ { m } S _ { m }$ as
+
+$$
+P _ { X } ( B ) = \int _ { B } J _ { g _ { m } } ( x ) d x = : \int _ { B } p _ { m } ( x ) d x ,
+$$
+
+and $p _ { m }$ is $\beta$ -smooth since $\gamma _ { m }$ is $\beta + 1$ -smooth and bijective.
+
+# B.2 PROOF OF LEMMA 2
+
+Firstly, we show the first points. Suppose that $g$ is a continuous mapping. By the generalized intermediate value theorem (Theorem 24.3 in Munkres (2000)), we know that $g ( I ^ { D } )$ is connected since $I ^ { D }$ is a connected set. Thus, a support of $P _ { g }$ is connected. However, $P _ { g }$ has a disconnected support, thus there is a contradiction. □
+
+In this proof, $a \lesssim b$ denotes that $b$ is larger than $a$ up to a finite constant. $a = b$ denotes that $a \lesssim b$ and $a \gtrsim b$ hold.
+
+By the definition of $\{ g _ { m } \} _ { m \in [ M ] }$ for the measure with local smoothness, we consider an explicit form of $g _ { m }$ . By Stein (2016), we can extend $g _ { m } : \widetilde { S } _ { m } S _ { m }$ to $\tilde { g } _ { m } : I ^ { D } \to S _ { m }$ since boundaries of $\widetilde { S } _ { m }$ are Lipschitz continuous. Then, we provide the following formulation
+
+$$
+\widetilde { \boldsymbol { g } } _ { m } ( \boldsymbol { x } ) = ( \gamma _ { m , 1 } ( \boldsymbol { x } ) , . . . , \gamma _ { m , D } ( \boldsymbol { x } ) ) ^ { \top } ,
+$$
+
+where $\gamma _ { m , d } \in H ^ { \beta } ( I ^ { D } )$ . Then, we obtain the form of $g ^ { * }$ as
+
+$$
+g ^ { * } = \sum _ { m \in [ M ] } \widetilde { g } _ { m } \otimes \pmb { I } _ { \widetilde { S } _ { m } } .
+$$
+
+Also, by the definition of $\mathcal { S } _ { 2 \beta , J }$ which contains $\widetilde { S } _ { m }$ , we obtain the form
+
+$$
+{ \cal I } _ { { \widetilde { \cal S } } _ { m } } = \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } ,
+$$
+
+with existing $\psi _ { h _ { m , j } }$ . Then, we have
+
+$$
+g ^ { * } = \sum _ { m \in [ M ] } \widetilde { g } _ { m } \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } .
+$$
+
+Preliminarily, we apply sub-neural networks from Yarotsky (2017) and Petersen & Voigtlaenderř (2017). Let $\zeta [ \Theta _ { + } ]$ be a network for summation such that $\begin{array} { r } { { \bf \Pi } \dot { \zeta } [ \Theta _ { + } ] ( x _ { 1 } , . . . , x _ { D ^ { \prime } } ) = \sum _ { d \in [ D ^ { \prime } ] } x _ { d } } \end{array}$ , and $\zeta [ \Theta _ { \times } ]$ be a network for approximate multiplication such as $| \zeta [ \Theta _ { \times } ] ( x _ { 1 } , . . . , x _ { D ^ { \prime } } ) - \prod _ { d \in [ D ^ { \prime } ] } x _ { d } | < \epsilon$ with some $\epsilon > 0$ for all $x , x ^ { \prime } \in I$ (Proposition 3 in Yarotsky (2017) and Lemma 1 in Imaizumi $\&$ Fukumizu (2018)).
+
+We consider approximation $\begin{array} { r } { \sum _ { m \in [ M ] } \gamma _ { m , d } \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } } \end{array}$ for each $d \in \mathsf { \Gamma } [ D ]$ . Let $\zeta [ \Theta _ { \gamma , d , m } ]$ and $\zeta [ \Theta _ { h , m , j } ]$ for $d \in [ D ] , m \in [ M ]$ and $j \in [ J ]$ , and we will specify the networks later. Also, let $\zeta \bar { [ \Theta _ { S , m } ] } ^ { - } = \zeta [ \Theta _ { \times } ] ( \bar { \zeta } [ \bar { \Theta } _ { h , m , 1 } ] \bar { ( \cdot ) } , \cdot . . . , \zeta [ \Theta _ { h , m , 1 } ] \bar { ( \cdot ) } )$ .
+
+We consider a neural network
+
+$$
+\zeta [ \Theta _ { d } ] = \zeta [ \Theta _ { + } ] ( \zeta [ \Theta _ { \times } ] ( \zeta [ \Theta _ { \gamma , d , 1 } ] ( \cdot ) , \zeta [ \Theta _ { S , 1 } ] ( \cdot ) ) , . . . , \zeta [ \Theta _ { \times } ] ( \zeta [ \Theta _ { \gamma , d , M } ] ( \cdot ) , \zeta [ \Theta _ { S , M } ] ( \cdot ) ) ) .
+$$
+
+Then, an approximation error is evaluated as
+
+$$
+\begin{array} { r l } & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
+$$
+
+where the last inequality follows the Hölder’s inequality.
+
+About $T _ { 1 , m }$ , there exists a corresponding $\zeta [ \Theta _ { \gamma , d , m } ]$ such that
+
+$$
+\begin{array} { r } { \| \gamma _ { m , d } - \zeta [ \Theta _ { \gamma , d , m } ] \| _ { L ^ { 2 } } \lesssim \| \Theta _ { \gamma , d , m } \| _ { 1 } ^ { - ( \beta + 1 ) / D } , } \end{array}
+$$
+
+by following Theorem A.8 in Petersen & Voigtlaender (2017). Also, since $\gamma _ { m , d }$ is bounded by its smoothness and compact support, we have $\| \gamma _ { m , d } \| _ { L ^ { \infty } } < \infty$ hence
+
+$$
+T _ { 1 , m } \lesssim \| \Theta _ { \gamma , d , m } \| _ { 1 } ^ { - ( \beta + 1 ) / D } .
+$$
+
+For $T _ { 2 , m }$ , we specify $\zeta [ \Theta _ { h , m , j } ]$ as Theorem 3.1 in Petersen & Voigtlaender (2017). Then, we evaluate the following as
+
+$$
+\begin{array} { r l } & { \| \gamma _ { m , d } - \zeta [ \Theta _ { \gamma , d , m } ] \| _ { L ^ { 2 } } } \\ & { \leqslant \| \displaystyle \bigoplus _ { j \in [ J ] } \psi _ { h _ { m , j } } - \zeta [ \Theta _ { \star } ] ( \zeta [ \Theta _ { h , m , 1 } ] ( \cdot ) , \ldots , \zeta [ \Theta _ { h , m , 1 } ] ( \cdot ) ) \| _ { L ^ { 2 } } } \\ & { \leqslant \| \displaystyle \bigoplus _ { j \in [ J ] } \psi _ { h _ { m , j } } - \zeta [ \Theta _ { h , m , j } ] \| _ { L ^ { 2 } } + \| \displaystyle \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } - \zeta [ \Theta _ { \star } ] ( \zeta [ \Theta _ { h , m , 1 } ] ( \cdot ) , \ldots , \zeta [ \Theta _ { h , m , 1 } ] ( \cdot ) ) \| _ { L ^ { 2 } } } \\ & { \leqslant \displaystyle \sum _ { j \in [ J ] } \prod _ { j \in [ J ] } \prod _ { l = \delta , j } ( | \psi _ { h _ { m , j } } , | \| _ { L ^ { 2 } } \forall [ \Theta _ { h , m , j } ] \| _ { L ^ { 2 } } ) \| \psi _ { h _ { m , j } } - \zeta [ \Theta _ { h , m , j } ] \| _ { L ^ { 2 } } + \epsilon _ { \times } } \\ & { \leqslant \displaystyle \sum _ { j \in [ J ] } \| \psi _ { h _ { m , j } } - \zeta [ \Theta _ { h , m , j } ] \| _ { L ^ { 2 } } + \epsilon _ { \times } . } \end{array}
+$$
+
+Here, the last inequality follows the boundedness of $\psi _ { h _ { m , j ^ { \prime } } }$ and $\zeta [ \Theta _ { h , m , j } ]$ by Theorem 3.1 in Petersen & Voigtlaender (2017). Also, Theorem 3.1 in Petersen $\&$ Voigtlaender (2017) provides an existence of $[ \Theta _ { h , m , j }$ such that
+
+$$
+\begin{array} { r } { \| \psi _ { h _ { m , j } } - \zeta [ \Theta _ { h , m , j } ] \| _ { L ^ { 2 } } \leqslant \| \Theta _ { h , m , j } \| _ { 1 } ^ { - \beta / ( D - 1 ) } . } \end{array}
+$$
+
+We apply the boundedness of $\zeta [ \Theta _ { h , m , j } ]$ , we have
+
+$$
+T _ { 2 , m } \lesssim \sum _ { j \in [ J ] } \| \Theta _ { h , m , j } \| _ { 1 } ^ { - \beta / ( D - 1 ) } + \epsilon _ { \times } .
+$$
+
+Combining the bounds for $T _ { 1 , m }$ and $T _ { 2 , m }$ , we bound
+
+$$
+\begin{array} { r l } & { \left\| \displaystyle \sum _ { m \in [ M ] } \gamma _ { m , d } \bigotimes \psi _ { h _ { m , j } } - \zeta [ \Theta _ { d } ] \right\| _ { L ^ { 2 } } } \\ & { \leqslant \displaystyle \sum _ { m \in [ M ] } \| \Theta _ { \gamma , d , m } \| _ { 1 } ^ { - ( \beta + 1 ) / D } + \displaystyle \sum _ { m \in [ M ] } \sum _ { j \in [ J ] } \| \Theta _ { h , m , j } \| _ { 1 } ^ { - \beta / ( D - 1 ) } + ( M + 1 ) \epsilon _ { \times } . } \end{array}
+$$
+
+Here, we consider a parameter $\begin{array} { r } { S = \sum _ { d \in [ D ] } \| \Theta _ { d } \| _ { 1 } } \end{array}$ such that $S = \| \Theta _ { \gamma , d , m } \| _ { 1 } \asymp \| \Theta _ { h , m , j } \| _ { 1 } \asymp \| \Theta _ { \times } \| _ { 1 }$ Also, following Yarotsky (2017) and Petersen & Voigtlaender (2017), a proper selection of $L = | \Theta _ { \times } |$ and $B = \| \Theta _ { \times } \| _ { \infty }$ provides $\epsilon _ { \times } \lesssim \| \Theta _ { \times } \| _ { 0 } ^ { - \beta / D }$ }´β{D0 . Then, we have
+
+$$
+\left. \sum _ { m \in [ M ] } \gamma _ { m , d } \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } - \zeta [ \Theta _ { d } ] \right. _ { L ^ { 2 } } \lesssim M J S ^ { - \beta / D } .
+$$
+
+Since $J$ is finite, we obtain the result.
+
+# B.4 PROOF OF THEOREM 1
+
+By the definition of $\widehat g$ in (2), the following inequality holds
+
+$$
+d _ { \mathcal { F } } ( P _ { n } , P _ { \hat { g } , m } ) = \operatorname* { s u p } _ { f \in \mathcal { F } } ( P _ { n } f - P _ { \hat { g } , m } f ) \leqslant d _ { \mathcal { F } } ( P _ { n } , P _ { g , m } ) = \operatorname* { s u p } _ { f \in \mathcal { F } } ( P _ { n } f - P _ { g , m } f ) ,
+$$
+
+for arbitrary $g \in { \mathcal { G } }$ .
+
+We consider a bound for $d _ { \mathcal { F } } ( P ^ { \ast } , P _ { \hat { g } } )$ as
+
+$$
+\begin{array} { r l } & { d _ { \mathcal { F } } \big ( P ^ { * } , P _ { \hat { g } } \big ) = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \big ( P ^ { * } f - P _ { \hat { g } } f \big ) } \\ & { \quad \quad = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \big ( P ^ { * } f - P _ { n } f + P _ { n } f - P _ { \hat { g } , m } f + P _ { \hat { g } , m } f - P _ { \hat { g } } f \big ) } \\ & { \quad \quad \leqslant \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \big ( P ^ { * } f - P _ { n } f + P _ { \hat { g } , m } f - P _ { \hat { g } } f \big ) + \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \big ( P _ { n } f - P _ { \hat { g } , m } f \big ) , } \end{array}
+$$
+
+where the inequality follows (9) with an existing ${ \dot { g } } \in { \mathcal { G } }$ . We will provide a detailed construction of $g ^ { * }$ . We continue the bound as
+
+$$
+\begin{array} { r l } & { d _ { \mathcal { F } } ( P ^ { * } , P _ { \widehat { g } } ) } \\ & { \leqslant \underset { f \in \mathcal { F } } { \operatorname* { s u p } } ( P ^ { * } f - P _ { n } f + P _ { \widehat { g } , m } f - P _ { \widehat { g } } f ) + \underset { f \in \mathcal { F } } { \operatorname* { s u p } } ( P _ { n } f - P ^ { * } f + P ^ { * } f - P _ { \widehat { g } } f + P _ { \widehat { g } } f - P _ { \widehat { g } , m } f ) } \\ & { \leqslant 2 \underset { g \in \mathcal { G } } { \operatorname* { s u p } } \underset { f \in \mathcal { F } } { \operatorname* { s u p } } | P _ { g , m } f - P _ { g } f | + \underset { f \in \mathcal { F } } { \operatorname* { s u p } } ( P ^ { * } f - P _ { \widehat { g } } f ) + 2 \underset { f \in \mathcal { F } } { \operatorname* { s u p } } | P _ { n } f - P ^ { * } f | } \\ & { = : i + i i + i i i . } \end{array}
+$$
+
+Here, $i$ denotes an effect from $m$ samplings, $\romannumeral 2$ denotes an approximation error, and iii denotes an uncertainty with the $n$ observations.
+
+To evaluate $i$ and $i i i$ , we provide the following lemma. This result follows a standard technique of the empirical process theory and we provide its outline for a sake of completeness.
+
+Lemma 4. Let $\mathcal { H }$ be a some set of measurable functions and $X _ { 1 } , . . . , X _ { n } \sim P$ be i.i.d. n observations. Suppose that $\mathbb { E } _ { P } [ h ^ { 2 } ( X ) ] \leqslant \sigma ^ { 2 }$ and $\| h \| _ { L ^ { \infty } } < C _ { h }$ hold with finite parameters $\sigma ^ { 2 } > 0$ and $C _ { h } > 0$ . Then, there exists a constant $C _ { \theta }$ and we obtain
+
+$$
+\begin{array} { r l r } { { \operatorname* { s u p } _ { h \in \mathcal { H } } | \frac { 1 } { n } \sum _ { i \in [ n ] } h ( X _ { i } ) - \mathbb { E } _ { P } [ h ( X ) ] | } } \\ & { } & { \leqslant \operatorname* { i n f } _ { \eta > 0 } \{ 4 \eta + 1 2 \int _ { \eta } ^ { C _ { h } } \sqrt { \frac { \log \mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { L ^ { \infty } } ) } { n } } d \epsilon + \sqrt { \frac { 2 \tau \sigma ^ { 2 } + 4 C _ { \theta } } { n } } + \frac { \tau C _ { h } } { n } ( \frac { 2 } { 3 } + C _ { \theta } ) \} } \end{array}
+$$
+
+with probability at least $1 - 2 \exp ( - \tau )$ for all $\tau > 0$ .
+
+Proof. At the beginning, we bound an expectation of the empirical process (Steinwart & Christmann, 2008; Bartlett et al., 2005; Massart, 2000; Sriperumbudur et al., 2012). Afterward, we evaluate a concentration of the empirical process around the expectation.
+
+By applying the symmetrization and concentration techniques (Proposition 7.10 in Steinwart & Christmann (2008)), we obtain
+
+$$
+\mathbb { E } _ { P ^ { \otimes n } } \left[ \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } h ( X _ { i } ) - \mathbb { E } [ h ( X ) ] \right| \right] \leqslant 2 \mathbb { E } _ { P ^ { \otimes n } \otimes \nu ^ { \otimes n } } \left[ \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] ,
+$$
+
+where $u _ { i } \sim \nu$ is the Rademacher variable which takes 0 or 1 with probability 0.5. Combining this bound with the Taralgand’s inequality (Theorem A.9.1 in Steinwart $\&$ Christmann (2008)), we obtain the following inequality
+
+$$
+\begin{array} { r l } & { \displaystyle \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } h ( X _ { i } ) - \mathbb { E } _ { P } [ h ( X ) ] \right| } \\ & { \leqslant ( 1 + \theta ) \mathbb { E } _ { P ^ { \otimes n } \otimes \nu ^ { \otimes n } } \left[ \displaystyle \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] + \sqrt { \frac { 2 \tau \sigma ^ { 2 } } { n } } + \frac { \tau C _ { h } } { n } \left( \frac { 2 } { 3 } + \displaystyle \frac { 1 } { \theta } \right) , } \end{array}
+$$
+
+with probability at least $1 - \exp ( - \tau )$ for all $\tau > 0$ and $\theta > 0$ .
+
+About the term with the Rademacher variable, we also apply a similar strategy (Lemma A.4 in Bartlett et al. (2005)), then obtain
+
+$$
+\mathbb { E } _ { P \hat { \otimes } n } \otimes _ { \mathcal { V } } \otimes n ^ { \prime } \left[ \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] \leqslant \frac { 1 } { 1 - \theta ^ { \prime } } \mathbb { E } _ { \nu } \otimes n \left[ \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] + \frac { \tau ^ { \prime } C _ { h } } { n \theta ^ { \prime } ( 1 - \theta ^ { \prime } ) } ,
+$$
+
+with probability at least $1 - \exp ( - \tau ^ { \prime } )$ for all $\tau ^ { \prime } > 0$ and $\theta ^ { \prime } > 0$ .
+
+Let $\| { \bf \nabla } \cdot { \bf \nabla } \| _ { n }$ be an empirical norm as ˇ ˇı $\begin{array} { r l r } { \| f \| _ { n } ^ { 2 } } & { { } = } & { n ^ { - 1 } \sum _ { i \in [ n ] } f ( X _ { i } ) ^ { 2 } } \end{array}$ . About the term $\begin{array} { r } { \mathbb { E } _ { \nu \otimes n } \left[ \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] } \end{array}$ , we apply the chaining technique and obtain
+
+$$
+\begin{array} { r } { \mathbb { E } _ { \boldsymbol \nu \otimes \boldsymbol n } \left[ \displaystyle \operatorname* { s u p } _ { h \in \mathcal { H } } \left| \frac { 1 } { n } \sum _ { i \in [ n ] } u _ { i } h ( X _ { i } ) \right| \right] \leqslant \displaystyle \operatorname* { i n f } _ { \boldsymbol \theta ^ { \prime \prime } > 0 } \left\{ 4 \boldsymbol \theta ^ { \prime \prime } + 1 2 \int _ { \boldsymbol \theta ^ { \prime \prime } } ^ { \tilde { C } _ { h } } \sqrt { \frac { \log \mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { n } ) } { n } } d \epsilon \right\} } \\ { \leqslant \displaystyle \operatorname* { i n f } _ { \boldsymbol \theta ^ { \prime \prime } > 0 } \left\{ 4 \boldsymbol \theta ^ { \prime \prime } + 1 2 \int _ { \boldsymbol \theta ^ { \prime \prime } } ^ { C _ { h } } \sqrt { \frac { \log \mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { L ^ { \infty } } ) } { n } } d \epsilon \right\} , } \end{array}
+$$
+
+where the last inequality follows a bound for an empirical norm and the boundedness of $\mathcal { H }$ .
+
+Combining (10), (11) and (12) and changing variables, we obtain the result.
+
+To bound $I$ with $\widetilde { X } _ { 1 } , . . . , \widetilde { X } _ { m } \sim P _ { g }$ , we consider the following value
+
+$$
+\begin{array} { r l } & { \underset { g \in \mathcal { G } } { \operatorname* { s u p } } \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \left| \frac { 1 } { m } \sum _ { i \in [ m ] } f ( \widetilde { X } _ { i } ) - \mathbb { E } _ { P _ { g } } [ h ( X ) ] \right| = \underset { g \in \mathcal { G } } { \operatorname* { s u p } } \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \left| \frac { 1 } { m } \sum _ { i \in [ m ] } f \circ g ( Z _ { i } ) - \mathbb { E } _ { P _ { \mathcal { Z } } } [ f \circ g ( X ) ] \right| } \\ & { \qquad = : \underset { h \in \mathcal { H } } { \operatorname* { s u p } } \left| \frac { 1 } { m } \sum _ { i \in [ m ] } h ( Z _ { i } ) - \mathbb { E } _ { P _ { \mathcal { Z } } } [ h ( X ) ] \right| , } \end{array}
+$$
+
+where we define $\mathcal { H } = \left\{ h = f \circ g \vert f \in \mathcal { F } , g \in \mathcal { G } \right\}$ . To apply Lemma 4, we investigate a covering number $\mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { L ^ { \infty } } )$ .
+
+Lemma 5. Assume that $f \in { \mathcal { F } }$ is $L _ { 1 }$ -Lipschitz continuous. We obtain
+
+$$
+\log \mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { L ^ { \infty } } ) \leqslant \log \mathcal { N } ( ( 1 + L _ { 1 } ) ^ { - 1 } \epsilon , \mathcal { G } , \| \cdot \| _ { L ^ { \infty } } ) + \log \mathcal { N } ( ( 1 + L _ { 1 } ) ^ { - 1 } \epsilon , \mathcal { F } , \| \cdot \| _ { L ^ { \infty } } )
+$$
+
+Proof. Fix $\epsilon > 0$ . Let $G \subset { \mathcal { G } }$ and $F \subset { \mathcal { F } }$ be covering sets as a set of centers of $\epsilon$ -balls for the covering $\mathcal { G }$ and $\mathcal { F }$ . Obviously, $| G | = \mathcal { N } ( \epsilon , \mathcal { G } , \| \cdot \| _ { L ^ { \infty } } )$ and $| F | = \mathcal { N } ( \epsilon , \mathcal { F } , \| \cdot \| _ { L ^ { \infty } } )$ . We define a subset
+
+$$
+H : = \left\{ h = f \circ g \vert g \in G , h \in F \right\} \subset \mathcal { H } ,
+$$
+
+and we known $| H | = | G | \times | F |$ .
+
+For any $h \in \mathcal H$ , there exist $g \in { \mathcal { G } }$ and $f \in { \mathcal { F } }$ , then $f = f \circ g$ holds. Also, by the definition of covering sets, there exist $f ^ { \prime } \in F$ and $g ^ { \prime } \in G$ such that $\| f - f ^ { \prime } \| _ { L ^ { \infty } } \leqslant \epsilon$ and $\| g - g ^ { \prime } \| _ { L ^ { \infty } } \leqslant \epsilon$ . Let $h ^ { \prime } = f ^ { \prime } \circ g ^ { \prime }$ , and we measure the distance
+
+$$
+\begin{array} { r l } & { \| h - h ^ { \prime } \| _ { L ^ { \infty } } \leqslant \| f \circ g - f ^ { \prime } \circ g ^ { \prime } \| _ { L ^ { \infty } } } \\ & { \qquad = \| f \circ g - f \circ g ^ { \prime } + f \circ g ^ { \prime } - f ^ { \prime } \circ g ^ { \prime } \| _ { L ^ { \infty } } } \\ & { \qquad \leqslant \| f \circ g - f \circ g ^ { \prime } \| _ { L ^ { \infty } } + \| f \circ g ^ { \prime } - f ^ { \prime } \circ g ^ { \prime } \| _ { L ^ { \infty } } } \\ & { \qquad \leqslant L _ { 1 } \| g - g ^ { \prime } \| _ { L ^ { \infty } } + \| f - f ^ { \prime } \| _ { L ^ { \infty } } } \\ & { \qquad \leqslant ( L _ { 1 } + 1 ) \epsilon . } \end{array}
+$$
+
+Here, the third inequality follows the Lipschitz property of $f \in { \mathcal { F } }$ . Here, we know that $\mathcal { H }$ is covered by $( L _ { 1 } + 1 ) \epsilon$ -balls with the center $H$ . Since $| H | = | G | \times | F |$ , the result holds. □
+
+Now, we have the following entropy bound
+
+$$
+\begin{array} { r l } & { \log \mathcal { N } ( \epsilon , \mathcal { H } , \| \cdot \| _ { L ^ { \infty } } ) } \\ & { \leqslant \log { \mathcal { N } ( ( 1 + L _ { 1 } ) ^ { - 1 } \epsilon , \mathcal { G } , \| \cdot \| _ { L ^ { \infty } } ) } + \log \mathcal { N } ( ( 1 + L _ { 1 } ) ^ { - 1 } \epsilon , \mathcal { F } , \| \cdot \| _ { L ^ { \infty } } ) } \\ & { \leqslant ( S _ { g } + 1 ) \log ( 2 ( L _ { 1 } + 1 ) \epsilon ^ { - 1 } ( L _ { g } + 1 ) D _ { g } B _ { g } ) } \\ & { \quad + \operatorname* { m i n } \Biggl \{ ( S _ { f } + 1 ) \log ( 2 ( L _ { 1 } + 1 ) \epsilon ^ { - 1 } ( L _ { f } + 1 ) D _ { f } B _ { f } ) , C _ { \kappa } ( 1 + L _ { 1 } ) \epsilon ^ { - \kappa } \Biggr \} } \end{array}
+$$
+
+with $\begin{array} { r } { D _ { g } : = \prod _ { \ell \in [ L _ { g } + 1 ] } ( D _ { \ell } + 1 ) } \end{array}$ and $\begin{array} { r } { D _ { f } : = \prod _ { \ell \in [ L _ { f } + 1 ] } ( D _ { \ell } + 1 ) } \end{array}$ . Let $\Gamma _ { f } : = 2 ( L _ { f } + 1 ) D _ { f } B _ { f }$ , and $N _ { \epsilon } ( \widetilde { \mathcal { F } } ) : = \log \mathcal { N } ( \epsilon , \widetilde { \mathcal { F } } , \| \cdot \| _ { n } )$ for brevity. Here, we apply Lemma 8 in Schmidt-Hieber (2017) for the entropy bound for $\mathcal { G }$ and $\mathcal { F }$ . Using the entropy bound and Lemma 4, we obtain
+
+$$
+\begin{array} { r l r } { { 2 \operatorname* { s u p } _ { j \in \mathcal { T } } \big | P _ { n } f - P ^ { * } f \big | } } \\ & { \leqslant 4 \eta + \frac { 1 2 } { n ^ { 1 / 2 } } \int _ { \eta } ^ { \infty } \operatorname* { m i n } \Big \{ N _ { c } ( \widetilde { \mathcal { F } } ) , ( S _ { f } + 1 ) \log ( \Gamma _ { f } \epsilon ^ { - 1 } ) \Big \} ^ { 1 / 2 } d \epsilon } \\ & { } & { + \frac { ( 2 \tau \sigma ^ { 2 } + C _ { \theta } ) ^ { 1 / 2 } } { n ^ { 1 / 2 } } + \frac { \tau C _ { h } ( 2 / 3 + C _ { \theta } ) } { n } } \\ & { \leqslant 4 \eta + \frac { 1 2 } { n ^ { 1 / 2 } } \int _ { \eta } ^ { \infty } N _ { c } ( \widetilde { \mathcal { F } } ) ^ { 1 / 2 } d \epsilon + \frac { 1 2 } { n ^ { 1 / 2 } } ( S _ { f } + 1 ) ^ { 1 / 2 } ( \log ^ { 1 / 2 } \Gamma _ { f } + C _ { \widetilde { \mathcal { F } } } \log ^ { 1 / 2 } C _ { \widetilde { \mathcal { F } } } - \eta \log ^ { 1 / 2 } \eta ) } \\ & { } & { + \frac { ( 2 7 \sigma ^ { 2 } + C _ { \theta } ) ^ { 1 / 2 } } { n ^ { 1 / 2 } } + \frac { \tau C _ { h } ( 2 / 3 + C _ { \theta } ) } { n } } \\ & { \leqslant \Upsilon _ { n } ( \widetilde { \mathcal { F } } ) + \frac { 1 } { n ^ { 1 / 2 } } ( ( S _ { f } + 1 ) ^ { 1 / 2 } A _ { 1 } + A _ { 2 } ) + \frac { A _ { 3 } } { n } , \qquad \mathrm { ~ o ~ } } \end{array}
+$$
+
+with some $\eta > 0$ , $A _ { 1 } = 1 2 \log ^ { 1 / 2 } \Gamma _ { f } , A _ { 2 } = C _ { \tilde { \pi } } \log ^ { 1 / 2 } C _ { \tilde { \pi } } + ( 2 \tau \sigma ^ { 2 } + C _ { \theta } ) ^ { 1 / 2 }$ , and $A _ { 3 } = \tau C _ { h } ( 2 / 3 +$ $C _ { \theta }$ q. Also, we set $\begin{array} { r } { \Upsilon _ { n } ( \widetilde { \mathcal { F } } ) = 4 \eta + \frac { 1 2 } { n ^ { 1 / 2 } } \int _ { \eta } ^ { C _ { \widetilde { \mathcal { F } } } } N _ { ( L _ { 1 } + 1 ) ^ { - 1 } \epsilon } ( \widetilde { \mathcal { F } } ) ^ { 1 / 2 } d \epsilon } \end{array}$ . Then, we have
+
+$$
+i i i \leqslant \Upsilon _ { n } ( \widetilde { \mathcal { F } } ) + \frac { 1 } { n ^ { 1 / 2 } } \left( ( S _ { f } + 1 ) ^ { 1 / 2 } A _ { 1 } + A _ { 2 } \right) + \frac { A _ { 3 } } { n } .
+$$
+
+About $I$ , we define $\Gamma _ { g } : = 2 ( L _ { f } + 1 ) D _ { g } B _ { g }$ and obtain a similar bound as
+
+$$
+\begin{array} { r l r } & { } & { i \leqslant \Upsilon _ { m } ( \widetilde { \mathcal { F } } ) + \displaystyle \frac { 1 } { m ^ { 1 / 2 } } \left( ( S _ { g } + 1 ) ^ { 1 / 2 } A _ { 1 } ^ { \prime } + A _ { 2 } ^ { \prime } \right) + \displaystyle \frac { A _ { 3 } ^ { \prime } } { m } , } \\ & { } & { A _ { 1 } ^ { \prime } = \smash { 1 2 ( \log ^ { 1 / 2 } \Gamma _ { f } + \log ^ { 1 / 2 } \Gamma _ { g } ) } , A _ { 2 } = C _ { \widetilde { \mathcal { F } } } \log ^ { 1 / 2 } C _ { \widetilde { \mathcal { F } } } + C _ { \mathcal { G } } \log ^ { 1 / 2 } C _ { \mathcal { G } } + 2 ( 2 \tau \sigma ^ { 2 } + C _ { \theta } ) ^ { 1 / 2 } , } \end{array}
+$$
+
+where and $A _ { 3 } \stackrel { - } { = } 2 \tau C _ { h } ( 2 / 3 + \check { C } _ { \theta } )$ .
+
+About $\romannumeral 2$ , we evaluate the error from approximation by constructing a specific deep neural network for generators. We apply Lemma 3 and let $\dot { \boldsymbol g } = ( \dot { g } _ { 1 } , . . . , \dot { g } _ { D } )$ be a generator specified in Lemma 3.
+
+$$
+\begin{array} { r l } & { \mathrm { i } i = P _ { g } \ast f - P _ { g } f } \\ & { = \displaystyle \int \big ( f o { g ^ { \ast } } - f o \bar { g } i \big ) d P _ { Z } } \\ & { \lesssim L \displaystyle \int \big | \displaystyle { g ^ { \ast } } - \bar { g } \big | | d P _ { Z } } \\ & { \lesssim L _ { 1 } \left( \displaystyle \sum _ { i \neq [ D ] } \left\lceil g _ { i } ^ { \ast } ( x ) - \bar { g } _ { d } ( x ) \right\rceil ^ { 2 } d P _ { Z } ( x ) \right) ^ { 1 / 2 } } \\ & { - L _ { 1 } \left( \displaystyle \sum _ { i \neq [ D ] } \| g _ { i } ^ { \ast } - \bar { g } _ { d } \| _ { L ^ { 2 } } ^ { 2 } \right) ^ { 1 / 2 } } \\ & { \lesssim \epsilon _ { g , L } \displaystyle L _ { 1 } D M _ { S } e ^ { \frac { 1 } { g } / D } , } \end{array}
+$$
+
+which follows $L _ { 1 }$ -Lipschitz continuity of $f$ , the Jensen’s inequality, the Cauchy-Schwartz inequality, compactness of the support $I ^ { D }$ , and uniformity of $P _ { Z }$ . Then, we have
+
+$$
+\begin{array} { r } { i i \leqslant c _ { 2 } M D S _ { g } ^ { - \beta / D } . } \end{array}
+$$
+
+Combining the result, we obtain the result of Theorem 1.
+
+# B.5 PROOF OF PROPOSITION 1
+
+When $P$ are globally smooth, we obtain a $\beta$ -smooth density function on $I ^ { D }$ by its definition. Due to the smoothness, the studies for nonparametric statistics (Nadaraya, 1964; Ghosal et al., 2007; Efromovich, 2010; van der Vaart $\&$ van Zanten, 2008; Tsybakov, 2009) guarantees that the methods (KDE,NB,SDE, and GP) obtain the rate $O ( n ^ { - \beta / ( 2 \beta + D ) } )$ with respect to the roof of $L ^ { 2 }$ norm.
+
+When $P$ have disconnected supports and locally smooth, we consider a following specific $P$ . Fix $M = 2$ . Let us define supports as $S _ { 1 } = \widetilde { S } _ { 1 } = \{ x \in I ^ { D } \mid x _ { 1 } \leqslant 0 . 5 \} \subset I ^ { D }$ and $S _ { 2 } = \bar { S } _ { 2 } = \{ x \in I ^ { D } \mid $ $x _ { 1 } \leqslant 0 . 5 \} \subset I ^ { D }$ . Also, $g _ { 1 } ( z ) = z$ and $g _ { 2 } : \widetilde { S } _ { 2 } S _ { 2 }$ as
+
+$$
+g _ { 2 } ( z ) = ( g _ { 2 , 1 } ( z _ { 1 } ) , . . . , g _ { 2 , D } ( z _ { D } ) ) ^ { \top } ,
+$$
+
+where $g _ { 2 , 1 } ( z _ { 1 } ) = 0 . 6 + c ( z _ { 1 } - 0 . 5 ) ^ { 1 / 3 }$ and $g _ { 2 , d } ( z _ { d } ) = z _ { d }$ for $d \in [ D ] \backslash \{ 1 \}$ with a constant $c$ . Then, by the proof of Lemma 1, $p _ { 2 } ( x )$ on $S _ { 2 }$ is a quadratic function with respect to $z _ { 1 }$ is 1-times differentiable but not twice-differentiable at the boundary $\{ x \in I ^ { D } \mid x _ { 1 } = 0 . 6 \dot \}$ . Hence, the studies (Nadaraya, 1964; Ghosal et al., 2007; Efromovich, 2010; van der Vaart & van Zanten, 2008; Tsybakov, 2009) provides that the generalization error of the methods is bounded by $O ( n ^ { - \beta / ( 2 \beta + D ) } )$ with $\beta = 1$ .
\ No newline at end of file
diff --git a/md/train/BJ6oOfqge/BJ6oOfqge.md b/md/train/BJ6oOfqge/BJ6oOfqge.md
new file mode 100644
index 0000000000000000000000000000000000000000..7c8767e99dada6bed0f78c76fc6b9fea615368d4
--- /dev/null
+++ b/md/train/BJ6oOfqge/BJ6oOfqge.md
@@ -0,0 +1,257 @@
+# TEMPORAL ENSEMBLING FOR SEMI-SUPERVISEDLEARNING
+
+Samuli Laine
+NVIDIA
+slaine@nvidia.com
+Timo Aila
+NVIDIA
+taila@nvidia.com
+
+# ABSTRACT
+
+In this paper, we present a simple and efficient method for training deep neural networks in a semi-supervised setting where only a small portion of training data is labeled. We introduce self-ensembling, where we form a consensus prediction of the unknown labels using the outputs of the network-in-training on different epochs, and most importantly, under different regularization and input augmentation conditions. This ensemble prediction can be expected to be a better predictor for the unknown labels than the output of the network at the most recent training epoch, and can thus be used as a target for training. Using our method, we set new records for two standard semi-supervised learning benchmarks, reducing the (non-augmented) classification error rate from $1 8 . 4 4 \%$ to $7 . 0 5 \%$ in SVHN with 500 labels and from $1 8 . 6 3 \%$ to $1 6 . 5 5 \%$ in CIFAR-10 with 4000 labels, and further to $5 . 1 2 \%$ and $1 2 . 1 6 \%$ by enabling the standard augmentations. We additionally obtain a clear improvement in CIFAR-100 classification accuracy by using random images from the Tiny Images dataset as unlabeled extra inputs during training. Finally, we demonstrate good tolerance to incorrect labels.
+
+# 1 INTRODUCTION
+
+It has long been known that an ensemble of multiple neural networks generally yields better predictions than a single network in the ensemble. This effect has also been indirectly exploited when training a single network through dropout (Srivastava et al., 2014), dropconnect (Wan et al., 2013), or stochastic depth (Huang et al., 2016) regularization methods, and in swapout networks (Singh et al., 2016), where training always focuses on a particular subset of the network, and thus the complete network can be seen as an implicit ensemble of such trained sub-networks. We extend this idea by forming ensemble predictions during training, using the outputs of a single network on different training epochs and under different regularization and input augmentation conditions. Our training still operates on a single network, but the predictions made on different epochs correspond to an ensemble prediction of a large number of individual sub-networks because of dropout regularization.
+
+This ensemble prediction can be exploited for semi-supervised learning where only a small portion of training data is labeled. If we compare the ensemble prediction to the current output of the network being trained, the ensemble prediction is likely to be closer to the correct, unknown labels of the unlabeled inputs. Therefore the labels inferred this way can be used as training targets for the unlabeled inputs. Our method relies heavily on dropout regularization and versatile input augmentation. Indeed, without neither, there would be much less reason to place confidence in whatever labels are inferred for the unlabeled training data.
+
+We describe two ways to implement self-ensembling, Π-model and temporal ensembling. Both approaches surpass prior state-of-the-art results in semi-supervised learning by a considerable margin. We furthermore observe that self-ensembling improves the classification accuracy in fully labeled cases as well, and provides tolerance against incorrect labels.
+
+The recently introduced transform/stability loss of Sajjadi et al. (2016b) is based on the same principle as our work, and the $\Pi$ -model can be seen as a special case of it. The Π-model can also be seen as a simplification of the $\Gamma$ -model of the ladder network by Rasmus et al. (2015), a previously presented network architecture for semi-supervised learning. Our temporal ensembling method has connections to the bootstrapping method of Reed et al. (2014) targeted for training with noisy labels.
+
+#
+
+
+Figure 1: Structure of the training pass in our methods. Top: $\Pi$ -model. Bottom: temporal ensembling. Labels $y _ { i }$ are available only for the labeled inputs, and the associated cross-entropy loss component is evaluated only for those.
+
+# Algorithm 1 Π-model pseudocode.
+
+
Require: xi = training stimuli
Require: L = set of training input indices with known labels Require:yi =labels for labeled inputs i∈L
Require: w(t) = unsupervised weight ramp-up function
Require: J fe(x)= stochastic neural network with trainable parameters 0
Require: g(x) = stochastic input augmentation function
for t in [1, num_epochs] do
for each minibatch B do
Zi∈B←fe(g(xi∈B))
> evaluate network outputs for augmented inputs
ZieB←fo(g(xi∈B))
V again,with different dropout and augmentation
loss ←-∑ie(BnL)log Zilyi]
supervised loss component
+w(t)oB∑ieBllzi-zll2
> unsupervised loss component
update θ using, e.g., ADAM
D update network parameters
end for
end for
return θ
+
+# 2 SELF-ENSEMBLING DURING TRAINING
+
+We present two implementations of self-ensembling during training. The first one, $\Pi$ -model, encourages consistent network output between two realizations of the same input stimulus, under two different dropout conditions. The second method, temporal ensembling, simplifies and extends this by taking into account the network predictions over multiple previous training epochs.
+
+We shall describe our methods in the context of traditional image classification networks. Let the training data consist of total of $N$ inputs, out of which $M$ are labeled. The input stimuli, available for all training data, are denoted $x _ { i }$ , where $i \in \{ 1 \ldots N \}$ . Let set $L$ contain the indices of the labeled inputs, $| L | = M$ . For every $i \in L$ , we have a known correct label $y _ { i } \in \{ 1 \ldots C \}$ , where $C$ is the number of different classes.
+
+# 2.1 Π-MODEL
+
+The structure of $\Pi$ -model is shown in Figure 1 (top), and the pseudocode in Algorithm 1. During training, we evaluate the network for each training input $x _ { i }$ twice, resulting in prediction vectors $z _ { i }$ and $\tilde { z } _ { i }$ . Our loss function consists of two components. The first component is the standard crossentropy loss, evaluated for labeled inputs only. The second component, evaluated for all inputs, penalizes different predictions for the same training input $x _ { i }$ by taking the mean square difference between the prediction vectors $z _ { i }$ and $\tilde { z } _ { i }$ .1 To combine the supervised and unsupervised loss terms, we scale the latter by time-dependent weighting function $w ( t )$ . By comparing the entire output vectors $z _ { i }$ and $\tilde { z } _ { i }$ , we effectively ask the “dark knowledge” (Hinton et al., 2015) between the two evaluations to be close, which is a much stronger requirement compared to asking that only the final classification remains the same, which is what happens in traditional training.
+
+It is important to notice that, because of dropout regularization, the network output during training is a stochastic variable. Thus two evaluations of the same input $x _ { i }$ under same network weights $\theta$ yield different results. In addition, Gaussian noise and augmentations such as random translation are evaluated twice, resulting in additional variation. The combination of these effects explains the difference between the prediction vectors $z _ { i }$ and $\tilde { z } _ { i }$ . This difference can be seen as an error in classification, given that the original input $x _ { i }$ was the same, and thus minimizing it is a reasonable goal.
+
+In our implementation, the unsupervised loss weighting function $w ( t )$ ramps up, starting from zero, along a Gaussian curve during the first 80 training epochs. See Appendix A for further details about this and other training parameters. In the beginning the total loss and the learning gradients are thus dominated by the supervised loss component, i.e., the labeled data only. We have found it to be very important that the ramp-up of the unsupervised loss component is slow enough—otherwise, the network gets easily stuck in a degenerate solution where no meaningful classification of the data is obtained.
+
+Our approach is somewhat similar to the $\Gamma$ -model of the ladder network by Rasmus et al. (2015), but conceptually simpler. In the $\Pi$ -model, the comparison is done directly on network outputs, i.e., after softmax activation, and there is no auxiliary mapping between the two branches such as the learned denoising functions in the ladder network architecture. Furthermore, instead of having one “clean” and one “corrupted” branch as in $\Gamma$ -model, we apply equal augmentation and noise to the inputs for both branches.
+
+As shown in Section 3, the $\Pi$ -model combined with a good convolutional network architecture provides a significant improvement over prior art in classification accuracy.
+
+# 2.2 TEMPORAL ENSEMBLING
+
+Analyzing how the Π-model works, we could equally well split the evaluation of the two branches in two separate phases: first classifying the training set once without updating the weights $\theta$ , and then training the network on the same inputs under different augmentations and dropout, using the just obtained predictions as targets for the unsupervised loss component. As the training targets obtained this way are based on a single evaluation of the network, they can be expected to be noisy. Temporal ensembling alleviates this by aggregating the predictions of multiple previous network evaluations into an ensemble prediction. It also lets us evaluate the network only once during training, gaining an approximate $2 \mathbf { x }$ speedup over the $\Pi$ -model.
+
+The structure of our temporal ensembling method is shown in Figure 1 (bottom), and the pseudocode in Algorithm 2. The main difference to the $\Pi$ -model is that the network and augmentations are evaluated only once per input per epoch, and the target vectors $\tilde { z }$ for the unsupervised loss component are based on prior network evaluations instead of a second evaluation of the network.
+
+After every training epoch, the network outputs $z _ { i }$ are accumulated into ensemble outputs $Z _ { i }$ by updating $Z _ { i } \gets \alpha Z _ { i } + ( 1 - \alpha ) z _ { i }$ , where $\alpha$ is a momentum term that controls how far the ensemble reaches into training history. Because of dropout regularization and stochastic augmentation, $Z$ thus contains a weighted average of the outputs of an ensemble of networks $f$ from previous training epochs, with recent epochs having larger weight than distant epochs. For generating the training targets $\tilde { z }$ , we need to correct for the startup bias in $Z$ by dividing by factor $( 1 - \alpha ^ { \bar { t } } )$ . A similar bias correction has been used in, e.g., Adam (Kingma & Ba, 2014) and mean-only batch normalization (Salimans & Kingma, 2016). On the first training epoch, $Z$ and $\tilde { z }$ are zero as no data from previous epochs is available. For this reason, we specify the unsupervised weight ramp-up function $w ( t )$ to also be zero on the first training epoch.
+
+Algorithm 2 Temporal ensembling pseudocode. Note that the updates of $Z$ and $\tilde { z }$ could equally well be done inside the minibatch loop; in this pseudocode they occur between epochs for clarity.
+
+
Require: xi = training stimuli
Require: L = set of training input indices with known labels
Require: Yi = labels for labeled inputs i ∈ L
Require: α =ensembling momentum, O ≤α<1
Require: w(t) = unsupervised weight ramp-up function Require: fe(x) = stochastic neural network with trainable parameters 0
Require: g(x) = stochastic input augmentation function
Z←O[N×C]
Dinitialize ensemble predictions
←O[N×C]
>initialize target vectors
for t in'[1, num-epochs] do
for each minibatch B do
Zi∈B←fe(g(xi∈B,t))
> evaluate network outputs for augmented inputs
loss ←-∑ie(BnL)log zi[yi]
supervised loss component
+ w(t)B∑ieBllzi -ill2
unsupervised loss component
update 0 using, e.g.,ADAM
update network parameters
end for Z←αZ+(1-α)z
>accumulate ensemble predictions
←Z/(1-at)
V construct target vectors by bias correction
end for
return θ
+
+The benefits of temporal ensembling compared to $\Pi$ -model are twofold. First, the training is faster because the network is evaluated only once per input on each epoch. Second, the training targets $\tilde { z }$ can be expected to be less noisy than with $\Pi$ -model. As shown in Section 3, we indeed obtain somewhat better results with temporal ensembling than with Π-model in the same number of training epochs. The downside compared to $\Pi$ -model is the need to store auxiliary data across epochs, and the new hyperparameter $\alpha$ . While the matrix $Z$ can be fairly large when the dataset contains a large number of items and categories, its elements are accessed relatively infrequently. Thus it can be stored, e.g., in a memory mapped file.
+
+An intriguing additional possibility of temporal ensembling is collecting other statistics from the network predictions $z _ { i }$ besides the mean. For example, by tracking the second raw moment of the network outputs, we can estimate the variance of each output component $z _ { i , j }$ . This makes it possible to reason about the uncertainty of network outputs in a principled way (Gal & Ghahramani, 2016). Based on this information, we could, e.g., place more weight on more certain predictions vs. uncertain ones in the unsupervised loss term. However, we leave the exploration of these avenues as future work.
+
+# 3 RESULTS
+
+Our network structure is given in Table 5, and the test setup and all training parameters are detailed in Appendix A. We test the Π-model and temporal ensembling in two image classification tasks, CIFAR-10 and SVHN, and report the mean and standard deviation of 10 runs using different random seeds.
+
+Although it is rarely stated explicitly, we believe that our comparison methods do not use input augmentation, i.e., are limited to dropout and other forms of permutation-invariant noise. Therefore we report the error rates without augmentation, unless explicitly stated otherwise. Given that the ability of an algorithm to extract benefit from augmentation is also an important property, we report the classification accuracy using a standard set of augmentations as well. In purely supervised training the de facto standard way of augmenting the CIFAR-10 dataset includes horizontal flips and random translations, while SVHN is limited to random translations. By using these same augmentations we can compare against the best fully supervised results as well. After all, the fully supervised results should indicate the upper bound of obtainable accuracy.
+
+Table 1: CIFAR-10 results with 4000 labels, averages of 10 runs (4 runs for all labels).
+
+
Errorrate(%)with#labels
Supervised-only
4000 35.56 ±1.59
All (50000) 7.33 ± 0.04
with augmentation Conv-Large, I-model (Rasmus et al., 2015)
34.85 ± 1.65 20.40 ± 0.47
6.05 ± 0.15
CatGAN (Springenberg,2016) GAN of Salimans et al. (2016)
19.58 ± 0.58
II-model
18.63 ± 2.32
II-model with augmentation
16.55 ± 0.29
6.90±0.07
Temporal ensembling with augmentation
12.36 ± 0.31 12.16 ± 0.24
5.56 ± 0.10 5.60 ± 0.10
+
+Table 2: SVHN results for 500 and 1000 labels, averages of 10 runs (4 runs for all labels).
+
+
Model
Error rate(%)with # labels
500
1000
All (73257)
Supervised-only with augmentation
35.18 ± 5.61 31.59 ± 3.60
20.47± 2.64 19.30 ± 3.89
3.05± 0.07 2.88 ±0.03
DGN (Kingma et al., 2014) Virtual Adversarial (Miyato et al., 2016)
36.02 ± 0.10
ADGM (Maalge et al., 2016)
24.63 22.86
SDGM (Maalge et al., 2016)
16.61 ± 0.24
GAN of Salimans et al. (2016)
18.44 ± 4.8
8.11 ± 1.3
II-model
7.05 ± 0.30
5.43 ± 0.25
2.78 ± 0.03
II-model with augmentation
6.65 ± 0.53
4.82 ± 0.17
2.54 ± 0.04
Temporal ensembling with augmentation
5.12 ± 0.13
4.42 ± 0.16
2.74± 0.06
+
+# 3.1 CIFAR-10
+
+CIFAR-10 is a dataset consisting of $3 2 \times 3 2$ pixel RGB images from ten classes. Table 1 shows a 2.1 percentage point reduction in classification error rate with 4000 labels (400 per class) compared to earlier methods for the non-augmented $\Pi$ -model.
+
+Enabling the standard set of augmentations further reduces the error rate by 4.2 percentage points to $1 2 . 3 6 \%$ . Temporal ensembling is slightly better still at $1 2 . 1 6 \%$ , while being twice as fast to train. This small improvement conceals the subtle fact that random horizontal flips need to be done independently for each epoch in temporal ensembling, while $\Pi$ -model can randomize once per a pair of evaluations, which according to our measurements is ${ \sim } 0 . 5$ percentage points better than independent flips.
+
+A principled comparison with Sajjadi et al. (2016b) is difficult due to several reasons. They provide results only for a fairly extreme set of augmentations (translations, flipping, rotations, stretching, and shearing) on top of fractional max pooling (Graham, 2014), which introduces random, local stretching inside the network, and is known to improve classification results substantially. They quote an error rate of only $1 3 . 6 0 \%$ for supervised-only training with 4000 labels, while our corresponding baseline is $3 4 . 8 5 \%$ . This gap indicates a huge benefit from versatile augmentations and fractional max pooling—in fact, their baseline result is already better than any previous semisupervised results. By enabling semi-supervised learning they achieve a $17 \%$ drop in classification error rate (from $1 3 . 6 0 \%$ to $1 1 . 2 9 \%$ ), while we see a much larger relative drop of $65 \%$ (from $3 4 . 8 5 \%$ to $1 2 . 1 6 \%$ ).
+
+# 3.2 SVHN
+
+The street view house numbers (SVHN) dataset consists of $3 2 \times 3 2$ pixel RGB images of real-world house numbers, and the task is to classify the centermost digit. In SVHN we chose to use only the official 73257 training examples following Salimans et al. (2016). Even with this choice our error rate with all labels is only $3 . { \bar { 0 } } 5 \%$ without augmentation.
+
+Table 3: CIFAR-100 results with 10000 labels, averages of 10 runs (4 runs for all labels).
+
+
Error rate(%)with#labels
Supervised-only
10000 51.21 ± 0.33
All (50000) 29.14±0.25
with augmentation
44.56 ± 0.30
26.42 ± 0.17
II-model II-model with augmentation Temporal ensembling with augmentation
Error rate(%) with # unlabeled auxiliary inputs from Tiny Images
Random 500k
Restricted 237k
I-model with augmentation
25.79 ± 0.17
25.43 ± 0.32
Temporal ensembling with augmentation
23.62 ± 0.23
23.79 ± 0.24
+
+Table 2 compares our method to the previous state-of-the-art. With the most commonly used 1000 labels we observe an improvement of 2.7 percentage points, from $8 . 1 1 \%$ to $5 . 4 3 \%$ without augmentation, and further to $4 . { \bar { 4 } } 2 \%$ with standard augmentations.
+
+We also investigated the behavior with 500 labels, where we obtained an error rate less than half of Salimans et al. (2016) without augmentations, with a significantly lower standard deviation as well. When augmentations were enabled, temporal ensembling further reduced the error rate to $5 . 1 2 \%$ . In this test the difference between $\Pi$ -model and temporal ensembling was quite significant at 1.5 percentage points.
+
+In SVHN Sajjadi et al. (2016b) provide results without augmentation, with the caveat that they use fractional max pooling, which is a very augmentation-like technique due to the random, local stretching it introduces inside the network. It leads to a superb error rate of $2 . 2 8 \%$ in supervisedonly training, while our corresponding baseline is $3 . 0 5 \%$ (or $2 . 8 8 \%$ with translations). Given that in a separate experiment our network matched the best published result for non-augmented SVHN when extra data is used $1 . 6 9 \%$ from Lee et al. (2015)), this gap is quite surprising, and leads us to conclude that fractional max pooling leads to a powerful augmentation of the dataset, well beyond what simple translations can achieve. Our temporal ensembling technique obtains better error rates for both 500 and 1000 labels $5 . 1 2 \%$ and $4 . 4 2 \%$ , respectively) compared to the $6 . 0 3 \%$ reported by Sajjadi et al. for 732 labels.
+
+# 3.3 CIFAR-100 AND TINY IMAGES
+
+The CIFAR-100 dataset consists of $3 2 \times 3 2$ pixel RGB images from a hundred classes. We are not aware of previous semi-supervised results in this dataset, and chose 10000 labels for our experiments. Table 3 shows error rates of $4 3 . 4 3 \%$ and $3 8 . 6 5 \%$ without and with augmentation, respectively. These correspond to 7.8 and 5.9 percentage point improvements compared to supervised learning with labeled inputs only.
+
+We ran two additional tests using unlabeled extra data from Tiny Images dataset (Torralba et al., 2008): one with randomly selected $5 0 0 \mathrm { k }$ extra images, most not corresponding to any of the CIFAR100 categories, and another with a restricted set of 237k images from the categories that correspond to those found in the CIFAR-100 dataset (see appendix A for details). The results are shown in Table 4. The addition of randomly selected, unlabeled extra images improved the error rate by 2.7 percentage points (from $2 6 . 3 0 \%$ to $2 3 . 6 3 \%$ ), indicating a desirable ability to learn from random natural images. Temporal ensembling benefited much more from the extra data than the $\Pi$ -model. Interestingly, restricting the extra data to categories that are present in CIFAR-100 did not improve the classification accuracy further. This indicates that in order to train a better classifier by adding extra data as unlabeled inputs, it is enough to have the extra data roughly in the same space as the actual inputs—in our case, natural images. We hypothesize that it may even be possible to use properly crafted synthetic data as unlabeled inputs to obtain improved classifiers.
+
+
+Figure 2: Percentage of correct SVHN classifications as a function of training epoch when a part of the labels is randomized. With standard supervised training (left) the classification accuracy suffers when even a small portion of the labels give disinformation, and the situation worsens quickly as the portion of randomized labels increases to $50 \%$ or more. On the other hand, temporal ensembling (right) shows almost perfect resistance to disinformation when half of the labels are random, and retains over ninety percent classification accuracy even when $80 \%$ of the labels are random.
+
+In order to keep the training times tolerable, we limited the number of unlabeled inputs to $5 0 \mathrm { k }$ per epoch in these tests, i.e., on every epoch we trained using all $5 0 \mathrm { k }$ labeled inputs from CIFAR-100 and $5 0 \mathrm { k }$ additional unlabeled inputs from Tiny Images. The $5 0 \mathrm { k }$ unlabeled inputs were chosen randomly on each epoch from the $5 0 0 \mathrm { k }$ or 237k extra inputs. In temporal ensembling, after each epoch we updated only the rows of $Z$ that corresponded to inputs used on that epoch.
+
+# 3.4 SUPERVISED LEARNING
+
+When all labels are used for traditional supervised training, our network approximately matches the state-of-the-art error rate for a single model in CIFAR-10 with augmentation (Lee et al., 2015; Mishkin & Matas, 2016) at $6 . 0 5 \%$ , and without augmentation (Salimans & Kingma, 2016) at $7 . 3 3 \%$ . The same is probably true for SVHN as well, but there the best published results rely on extra data that we chose not to use.
+
+Given this premise, it is perhaps somewhat surprising that our methods reduce the error rate also when all labels are used (Tables 1 and 2). We believe that this is an indication that the consistency requirement adds a degree of resistance to ambiguous labels that are fairly common in many classification tasks, and that it encourages features to be more invariant to stochastic sampling.
+
+# 3.5 TOLERANCE TO INCORRECT LABELS
+
+In a further test we studied the hypothesis that our methods add tolerance to incorrect labels by assigning a random label to a certain percentage of the training set before starting to train. Figure 2 shows the classification error graphs for standard supervised training and temporal ensembling.
+
+Clearly our methods provide considerable resistance to wrong labels, and we believe this is because the unsupervised loss term encourages the mapping function implemented by the network to be flat in the vicinity of all input data points, whereas the supervised loss term enforces the mapping function to have a specific value in the vicinity of the labeled input data points. This means that even the wrongly labeled inputs play a role in shaping the mapping function—the unsupervised loss term smooths the mapping function and thus also the decision boundaries, effectively fusing the inputs into coherent clusters, whereas the excess of correct labels in each class is sufficient for locking the clusters to the right output vectors through the supervised loss term. The difference to classical regularizers is that we induce smoothness only on the manifold of likely inputs instead of over the entire input domain. For further analysis about the importance of the gradient of the mapping function, see Simard et al. (1998).
+
+# 4 RELATED WORK
+
+There is a large body of previous work on semi-supervised learning (Zhu, 2005). In here we will concentrate on the ones that are most directly connected to our work.
+
+$\Gamma$ -model is a subset of a ladder network (Rasmus et al., 2015) that introduces lateral connections into an encoder-decoder type network architecture, targeted at semi-supervised learning. In $\Gamma \cdot$ -model, all but the highest lateral connections in the ladder network are removed, and after pruning the unnecessary stages, the remaining network consists of two parallel, identical branches. One of the branches takes the original training inputs, whereas the other branch is given the same input corrupted with noise. The unsupervised loss term is computed as the squared difference between the (pre-activation) output of the clean branch and a denoised (pre-activation) output of the corrupted branch. The denoised estimate is computed from the output of the corrupted branch using a parametric nonlinearity that has 10 auxiliary trainable parameters per unit. Our Π-model differs from the $\Gamma$ -model in removing the parametric nonlinearity and denoising, having two corrupted paths, and comparing the outputs of the network instead of pre-activation data of the final layer.
+
+Sajjadi et al. (2016b) recently introduced a new loss function for semi-supervised learning, so called transform/stability loss, which is founded on the same principle as our work. During training, they run augmentation and network evaluation $n$ times for each minibatch, and then compute an unsupervised loss term as the sum of all pairwise squared distances between the obtained $n$ network outputs. As such, their technique follows the general pseudo-ensemble agreement (PEA) regularization framework of Bachman et al. (2014). In addition, they employ a mutual exclusivity loss term (Sajjadi et al., 2016a) that we do not use. Our $\Pi$ -model can be seen as a special case of the transform/stability loss obtained by setting $n = 2$ . The computational cost of training with transform/stability loss increases linearly as a function of $n$ , whereas the efficiency of our temporal ensembling technique remains constant regardless of how large effective ensemble we obtain via the averaging of previous epochs’ predictions.
+
+In bootstrap aggregating, or bagging, multiple networks are trained independently based on subsets of training data (Breiman, 1996). This results in an ensemble that is more stable and accurate than the individual networks. Our approach can be seen as pulling the predictions from an implicit ensemble that is based on a single network, and the variability is a result of evaluating it under different dropout and augmentation conditions instead of training on different subsets of data. In work parallel to ours, Huang et al. (2017) store multiple snapshots of the network during training, hopefully corresponding to different local minima, and use them as an explicit ensemble.
+
+The general technique of inferring new labels from partially labeled data is often referred to as bootstrapping or self-training, and it was first proposed by Yarowsky (1995) in the context of linguistic analysis. Whitney & Sarkar (2012) analyze Yarowsky’s algorithm and propose a novel graph-based label propagation approach. Similarly, label propagation methods (Zhu & Ghahramani, 2002) infer labels for unlabeled training data by comparing the associated inputs to labeled training inputs using a suitable distance metric. Our approach differs from this in two important ways. Firstly, we never compare training inputs against each other, but instead only rely on the unknown labels remaining constant, and secondly, we let the network produce the likely classifications for the unlabeled inputs instead of providing them through an outside process.
+
+In addition to partially labeled data, considerable amount of effort has been put into dealing with densely but inaccurately labeled data. This can be seen as a semi-supervised learning task where part of the training process is to identify the labels that are not to be trusted. For recent work in this area, see, e.g., Sukhbaatar et al. (2014) and Patrini et al. (2016). In this context of noisy labels, Reed et al. (2014) presented a simple bootstrapping method that trains a classifier with the target composed of a convex combination of the previous epoch output and the known but potentially noisy labels. Our temporal ensembling differs from this by taking into account the evaluations over multiple epochs.
+
+Generative Adversarial Networks (GAN) have been recently used for semi-supervised learning with promising results (Maaløe et al., 2016; Springenberg, 2016; Odena, 2016; Salimans et al., 2016). It
+
+Table 5: The network architecture used in all of our tests.
+
+
+
+could be an interesting avenue for future work to incorporate a generative component to our solution.
+We also envision that our methods could be applied to regression-type learning tasks.
+
+# 5 ACKNOWLEDGEMENTS
+
+We thank the anonymous reviewers, Tero Karras, Pekka Janis, Tim Salimans, Ian Goodfellow, as ¨ well as Harri Valpola and his colleagues at Curious AI for valuable suggestions that helped to improve this article.
+
+# REFERENCES
+
+Philip Bachman, Ouais Alsharif, and Doina Precup. Learning with pseudo-ensembles. In Advances in Neural Information Processing Systems 27 (NIPS). 2014.
+
+Leo Breiman. Bagging predictors. Machine Learning, 24(2), 1996.
+
+Sander Dieleman, Jan Schluter, Colin Raffel, Eben Olson, Søren Kaae Sønderby, et al. Lasagne: ¨ First release., 2015.
+
+Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. CoRR, abs/1506.02142, 2016.
+
+Benjamin Graham. Fractional max-pooling. CoRR, abs/1412.6071, 2014.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. CoRR, abs/1502.01852, 2015.
+
+G. E. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015.
+
+Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q. Weinberger. Deep networks with stochastic depth. CoRR, abs/1603.09382, 2016.
+
+Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E. Hopcroft, and Kilian Q. Weinberger. Snapshot Ensembles: Train 1, get M for free. In Proc. International Conference on Learning Representations (ICLR), 2017.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
+
+Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in Neural Information Processing Systems 27 (NIPS). 2014.
+
+Chen-Yu Lee, Patrick W. Gallagher, and Zhuowen Tu. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. CoRR, abs/1509.08985, 2015.
+
+Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. CoRR, abs/1602.05473, 2016.
+
+Andrew L Maas, Awni Y Hannun, and Andrew Ng. Rectifier nonlinearities improve neural network acoustic models. In Proc. International Conference on Machine Learning (ICML), volume 30, 2013.
+
+Dmytro Mishkin and Jiri Matas. All you need is a good init. In Proc. International Conference on Learning Representations (ICLR), 2016.
+
+Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing with virtual adversarial training. In Proc. International Conference on Learning Representations (ICLR), 2016.
+
+Augustus Odena. Semi-supervised learning with generative adversarial networks. Data Efficient Machine Learning workshop at ICML 2016, 2016.
+
+Giorgio Patrini, Alessandro Rozza, Aditya Menon, Richard Nock, and Lizhen Qu. Making neural networks robust to label noise: a loss correction approach. CoRR, abs/1609.03683, 2016.
+
+Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semisupervised learning with ladder networks. In Advances in Neural Information Processing Systems 28 (NIPS). 2015.
+
+Scott E. Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. CoRR, abs/1412.6596, 2014.
+
+Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Mutual exclusivity loss for semi-supervised deep learning. In 2016 IEEE International Conference on Image Processing, ICIP 2016, pp. 1908–1912, 2016a.
+
+Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Advances in Neural Information Processing Systems 29 (NIPS). 2016b.
+
+Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. CoRR, abs/1602.07868, 2016.
+
+Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. CoRR, abs/1606.03498, 2016.
+
+Patrice Y. Simard, Yann A. LeCun, John S. Denker, and Bernard Victorri. Transformation Invariance in Pattern Recognition — Tangent Distance and Tangent Propagation, pp. 239–274. 1998.
+
+Saurabh Singh, Derek Hoiem, and David A. Forsyth. Swapout: Learning an ensemble of deep architectures. CoRR, abs/1605.06465, 2016.
+
+Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. In Proc. International Conference on Learning Representations (ICLR), 2016.
+
+Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806, 2014.
+
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014.
+
+Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. CoRR, abs/1406.2080, 2014.
+
+Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. CoRR, abs/1605.02688, May 2016.
+
+A. Torralba, R. Fergus, and W. T. Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE TPAMI, 30(11):1958–1970, 2008.
+
+Li Wan, Matthew Zeiler, Sixin Zhang, Yann L. Cun, and Rob Fergus. Regularization of neural networks using dropconnect. Proc. International Conference on Machine Learning (ICML), 28 (3):1058–1066, 2013.
+
+Max Whitney and Anoop Sarkar. Bootstrapping via graph propagation. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers - Volume 1, ACL ’12, 2012.
+
+David Yarowsky. Unsupervised word sense disambiguation rivaling supervised methods. In Proceedings of the 33rd Annual Meeting on Association for Computational Linguistics, ACL ’95, 1995.
+
+Xiaojin Zhu. Semi-supervised learning literature survey. Technical Report 1530, Computer Sciences, University of Wisconsin-Madison, 2005.
+
+Xiaojin Zhu and Zoubin Ghahramani. Learning from labeled and unlabeled data with label propagation. Technical Report CMU-CALD-02-107, Carnegie Mellon University, 2002.
+
+A NETWORK ARCHITECTURE, TEST SETUP, AND TRAINING PARAMETERS
+
+Table 5 details the network architecture used in all of our tests. It is heavily inspired by ConvPoolCNN-C (Springenberg et al., 2014) and the improvements made by Salimans & Kingma (2016). All data layers were initialized following He et al. (2015), and we applied weight normalization and mean-only batch normalization (Salimans & Kingma, 2016) with momentum 0.999 to all of them. We used leaky ReLU (Maas et al., 2013) with $\alpha = 0 . 1$ as the non-linearity, and chose to use max pooling instead of strided convolutions because it gave consistently better results in our experiments.
+
+All networks were trained using Adam (Kingma & Ba, 2014) with a maximum learning rate of $\lambda _ { m a x } = 0 . 0 0 3$ , except for temporal ensembling in the SVHN case where a maximum learning rate of $\lambda _ { m a x } = 0 . 0 0 1$ worked better. Adam momentum parameters were set to $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ as suggested in the paper. The maximum value for the unsupervised loss component was set to $w _ { m a x } \cdot M / N$ , where $M$ is the number of labeled inputs and $N$ is the total number of training inputs. For $\Pi$ -model runs, we used $w _ { m a x } = 1 0 0$ in all runs except for CIFAR-100 with Tiny Images where we set $w _ { m a x } = 3 0 0$ . For temporal ensembling we used $w _ { m a x } = 3 0$ in most runs. For the corrupted label test in Section 3.5 we used $w _ { m a x } = 3 0 0$ for $0 \%$ and $20 \%$ corruption, and $w _ { m a x } = 3 0 0 0$ for corruption of $50 \%$ and higher. For basic CIFAR-100 runs we used $w _ { m a x } = 1 0 0$ , and for CIFAR-100 with Tiny Images we used $w _ { m a x } = 1 0 0 0$ . The accumulation decay constant of temporal ensembling was set to $\alpha = 0 . 6$ in all runs.
+
+In all runs we ramped up both the learning rate $\lambda$ and unsupervised loss component weight $w$ during the first 80 epochs using a Gaussian ramp-up curve $\exp [ - 5 ( 1 - T ) ^ { 2 } ]$ , where $T$ advances linearly from zero to one during the ramp-up period. In addition to ramp-up, we annealed the learning rate $\lambda$ to zero and Adam $\beta _ { 1 }$ to 0.5 during the last 50 epochs, but otherwise we did not decay them during training. The ramp-down curve was similar to the ramp-up curve but time-reversed and with a scaling constant of 12.5 instead of 5. All networks were trained for 300 epochs with minibatch size of 100.
+
+CIFAR-10 Following previous work in fully supervised learning, we pre-processed the images using ZCA and augmented the dataset using horizontal flips and random translations. The translations were drawn from $[ - 2 , 2 ]$ pixels, and were independently applied to both branches in the Π-model.
+
+SVHN We pre-processed the input images by biasing and scaling each input image to zero mean and unit variance. We used only the 73257 items in the official training set, i.e., did not use the provided 531131 extra items. The training setups were otherwise similar to CIFAR-10 except that horizontal flips were not used.
+
+Implementation Our implementation is written in Python using Theano (Theano Development Team, 2016) and Lasagne (Dieleman et al., 2015), and is available at https://github.com/smlaine2/tempens.
+
+Model convergence As discussed in Section 2.1, a slow ramp-up of the unsupervised cost is very important for getting the models to converge. Furthermore, in our very preliminary tests with 250 labels in SVHN we noticed that optimization tended to explode during the ramp-up period, and we eventually found that using a lower value for Adam $\beta _ { 2 }$ parameter (e.g., 0.99 instead of 0.999) seems to help in this regard.
+
+We do not attempt to guarantee that the occurrence of labeled inputs during training would be somehow stratified; with bad luck there might be several consecutive minibatches without any labeled inputs when the label density is very low. Some previous work has identified this as a weakness, and have solved the issue by shuffling the input sequences in such a way that stratification is guaranteed, e.g. Rasmus et al. (2015) (confirmed from the authors). This kind of stratification might further improve the convergence of our methods as well.
+
+Tiny Images, extra data from restricted categories The restricted extra data in Section 3.3 was extracted from Tiny Images by picking all images with labels corresponding to the 100 categories used in CIFAR-100. As the Tiny Images dataset does not contain CIFAR-100 categories aquarium fish and maple tree, we used images with labels fish and maple instead. The result was a total of 237 203 images that were used as unlabeled extra data. Table 6 shows the composition of this extra data set.
+
+It is worth noting that the CIFAR-100 dataset itself is a subset of Tiny Images, and we did not explicitly prevent overlap between this extra set and CIFAR-100. This led to approximately a third of the CIFAR-100 training and test images being present as unlabeled inputs in the extra set. The other test with $5 0 0 \mathrm { k }$ extra entries picked randomly out of all 79 million images had a negligible overlap with CIFAR-100.
+
+Table 6: The Tiny Images (Torralba et al., 2008) labels and image counts used in the CIFAR-100 plus restricted extra data tests (rightmost column of Table 4). Note that the extra input images were supplied as unlabeled data for our networks, and the labels were used only for narrowing down the full set of 79 million images.
+
+
Label
#
Label #
Label
#
Label #
apple
2242
baby 2771
bear
2242
beaver 2116
bed
2767
bee 2193
beetle
2173
bicycle 2599
bottle
2212
bowl 2707
boy
2234
bridge 2274
bus
3068
butterfly 3036
camel
2121 can
2461
castle
3094
caterpillar 2382
cattle
2089
chair 2552
chimpanzee
1706
clock 2375
cloud
2390
cockroach 2318
couch
2171
crab 2735
crocodile
2712 cup
2287
dinosaur
2045
dolphin 2504
elephant
2794 fish*
3082
flatfish
1504
forest 2244
fox
2684 girl
2204
hamster
2294
house 2320
kangaroo
2563
keyboard 1948
lamp
2242
lawn_mower 1929
leopard
2139 lion
3045
lizard
2130
lobster 2136
man
2248
maple* 2149
motorcycle
2168
mountain 2249
mouse
2128
mushroom 2390
oak_tree
1995
orange 2650
orchid
1902
otter 2073
palm_tree
2107
pear 2120
pickup_truck
2478
pine_tree 2341
plain
2198
plate 3109
poppy
2730
porcupine 1900
possum
2008
rabbit 2408
raccoon
2587 ray
2564
road
2862
rocket 2180
rose
2237 sea
2122
seal
2159
shark 2157
shrew
1826
skunk 2450
skyscraper
2298
snail 2369
snake
2989
spider 3024
squirrel
2374
streetcar 1905
sunflower
2761
sweet-pepper 1983
table
3137
tank 1897
telephone
1889
television 2973
tiger
2603
tractor 1848
train
3020
trout 2726
tulip
2160
turtle 2438
wardrobe
2029
whale 2597
willow_tree
2040
wolf 2423
woman
2446
worm 2945
\ No newline at end of file
diff --git a/md/train/BJ8c3f-0b/BJ8c3f-0b.md b/md/train/BJ8c3f-0b/BJ8c3f-0b.md
new file mode 100644
index 0000000000000000000000000000000000000000..7ce14c109dbf0f43a063f39c64c0ac3d46912a31
--- /dev/null
+++ b/md/train/BJ8c3f-0b/BJ8c3f-0b.md
@@ -0,0 +1,494 @@
+# AUTO-ENCODING SEQUENTIAL MONTE CARLO
+
+Tuan Anh $\mathbf { L e } ^ { \dagger }$ , Maximilian $\mathbf { I g } \mathbf { I } ^ { \dagger }$ , Tom Rainforth‡, Tom $\mathbf { J i n } ^ { \dagger , \ S }$ , Frank Wood† †Department of Engineering Science, University of Oxford ‡Department of Statistics, University of Oxford §Department of Statistics, University of Warwick {tuananh,igl,jin,fwood}@robots.ox.ac.uk,
+
+# ABSTRACT
+
+We build on auto-encoding sequential Monte Carlo (AESMC):1 a method for model and proposal learning based on maximizing the lower bound to the log marginal likelihood in a broad family of structured probabilistic models. Our approach relies on the efficiency of sequential Monte Carlo (SMC) for performing inference in structured probabilistic models and the flexibility of deep neural networks to model complex conditional probability distributions. We develop additional theoretical insights and experiment with a new training procedure which can improve both model and proposal learning. We demonstrate that our approach provides a fast, easy-to-implement and scalable means for simultaneous model learning and proposal adaptation in deep generative models.
+
+# 1 INTRODUCTION
+
+We build upon AESMC (Le et al., 2017), a method for model learning that itself builds on variational auto-encoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014) and importance weighted auto-encoders (IWAEs) (Burda et al., 2016). AESMC is similarly based on maximizing a lower bound to the log marginal likelihood, but uses SMC (Doucet & Johansen, 2009) as the underlying marginal likelihood estimator instead of importance sampling (IS). For a very wide array of models, particularly those with sequential structure, SMC forms a substantially more powerful inference method than IS, typically returning lower variance estimates for the marginal likelihood. Consequently, by using SMC for its marginal likelihood estimation, AESMC often leads to improvements in model learning compared with VAEs and IWAEs. We provide experiments on structured time-series data that show that AESMC based learning was able to learn useful representations of the latent space for both reconstruction and prediction more effectively than the IWAE counterpart.
+
+AESMC was introduced in an earlier preprint (Le et al., 2017) concurrently with the closely related methods of Maddison et al. (2017); Naesseth et al. (2017). In this work we take these ideas further by providing new theoretical insights for the resulting evidence lower bounds (ELBOs), extending these to explore the relative efficiency of different approaches to proposal learning, and using our results to develop a new and improved training procedure. In particular, we introduce a method for expressing the gap between an ELBO and the log marginal likelihood as a Kullback-Leibler (KL) divergence between two distributions on an extended sampling space. Doing so allows us to investigate the behavior of this family of algorithms when the objective is maximized perfectly, which occurs only if the KL divergence becomes zero. In the IWAE case, this implies that the proposal distributions are equal to the posterior distributions under the learned model. In the AESMC case, it has implications for both the proposal distributions and the intermediate set of targets that are learned. We demonstrate that, somewhat counter-intuitively, using lower variance estimates for the marginal likelihood can actually be harmful to proposal learning. Using these insights, we experiment with an adaptation to the AESMC algorithm, which we call alternating ELBOs, that uses different lower bounds for updating the model parameters and proposal parameters. We observe that this adaptation can, in some cases, improve model learning and proposal adaptation.
+
+# 2 BACKGROUND
+
+# 2.1 STATE-SPACE MODELS
+
+State-space models (SSMs) are probabilistic models over a set of latent variables $x _ { 1 : T }$ and observed variables $y _ { 1 : T }$ . Given parameters $\theta$ , a $\mathbf { S } \mathbf { S } \mathbf { M }$ is characterized by an initial density $\mu _ { \theta } ( x _ { 1 } )$ , a series of transition densities $f _ { t , \theta } { \big ( } x _ { t } | x _ { 1 : t - 1 } { \big ) }$ , and a series of emission densities $g _ { t , \theta } ( y _ { t } | x _ { 1 : t } )$ with the joint density being $\begin{array} { r } { p _ { \theta } ( x _ { 1 : T } , y _ { 1 : T } ) = \mu _ { \theta } ( x _ { 1 } ) \prod _ { t = 2 } ^ { T } f _ { t , \theta } ( x _ { t } | x _ { 1 : t - 1 } ) \prod _ { t = 1 } ^ { T } g _ { t , \theta } ( y _ { t } | x _ { 1 : t } ) . } \end{array}$ .
+
+We are usually interested in approximating the posterior $p _ { \theta } ( x _ { 1 : T } | y _ { 1 : T } )$ or the expectation of some test function $\varphi$ under this posterior $\begin{array} { r } { I ( \varphi ) : = \bar { \int } \varphi ( \bar { x _ { 1 : T } } ) p _ { \theta } ( \bar { x _ { 1 : T } } | y _ { 1 : T } ) \mathrm { d } x _ { 1 : T } } \end{array}$ . We refer to these two tasks as inference. Inference in models which are non-linear, non-discrete, and non-Gaussian is difficult and one must resort to approximate methods, for which SMC has been shown to be one of the most powerful approaches (Doucet & Johansen, 2009).
+
+We will consider model learning as a problem of maximizing the marginal likelihood $p _ { \theta } ( y _ { 1 : T } ) =$ $\begin{array} { r } { \int p _ { \theta } \big ( x _ { 1 : T } , y _ { 1 : T } \big ) \mathrm { d } x _ { 1 : T } } \end{array}$ in the family of models parameterized by $\theta$ .
+
+# 2.2 SEQUENTIAL MONTE CARLO
+
+SMC performs approximate inference on a sequence of target distributions $( \pi _ { t } ( x _ { 1 : t } ) ) _ { t = 1 } ^ { T }$ . In the context of SSMs, the target distributions are often taken to be $( p _ { \theta } ( \underline { { x } } _ { 1 : t } | y _ { 1 : t } ) ) _ { t = 1 } ^ { T }$ . Given a parameter $\phi$ and proposal distributions $q _ { 1 , \phi } ( x _ { 1 } | y _ { 1 } )$ and $( q _ { t , \phi } ( x _ { t } | y _ { 1 : t } , x _ { 1 : t - 1 } ) ) _ { t = 2 } ^ { T }$ from which we can sample and whose densities we can evaluate, SMC is described in Algorithm 1.
+
+Using the set of weighted particles $( \tilde { x } _ { 1 : T } ^ { k } , w _ { T } ^ { k } ) _ { k = 1 } ^ { K }$ at the last time step, we can approximate the posterior as $\begin{array} { r } { \sum _ { k = 1 } ^ { K } \bar { w } _ { T } ^ { k } \delta _ { \tilde { x } _ { 1 : T } ^ { k } } ( x _ { 1 : T } ) } \end{array}$ and the integral $I _ { \varphi }$ as $\begin{array} { r } { \sum _ { k = 1 } ^ { K } \hat { w } _ { T } ^ { k } \varphi ( \tilde { x } _ { 1 : T } ^ { k } ) } \end{array}$ , where $\begin{array} { r } { \bar { w } _ { T } ^ { k } : = w _ { T } ^ { k } / \sum _ { j } w _ { T } ^ { j } } \end{array}$ is the normalized weight and $\delta _ { z }$ is a Dirac measure centered on $z$ . Furthermore, one can obtain an unbiased estimator of the marginal likelihood $p _ { \theta } ( y _ { 1 : T } )$ using the intermediate particle weights:
+
+$$
+\hat { Z } _ { \mathrm { S M C } } : = \prod _ { t = 1 } ^ { T } \left[ \frac { 1 } { K } \sum _ { k = 1 } ^ { K } w _ { t } ^ { k } \right] .
+$$
+
+# Algorithm 1: Sequential Monte Carlo
+
+Data: observed values $y _ { 1 : T }$ , model parameters $\theta$ , proposal parameters $\phi$ begin
+
+Sample initial particle values $x _ { 1 } ^ { k } \sim q _ { 1 , \phi } ( \cdot | y _ { 1 } )$
+
+Compute and normalize weights:
+
+$$
+w _ { 1 } ^ { k } = \frac { \mu _ { \theta } ( x _ { 1 } ^ { k } ) g _ { 1 , \theta } ( y _ { 1 } | x _ { 1 } ^ { k } ) } { q _ { 1 , \phi } ( x _ { 1 } ^ { k } | y _ { 1 } ) } , \qquad \quad \bar { w } _ { 1 } ^ { k } = \frac { w _ { 1 } ^ { k } } { \sum _ { \ell = 1 } ^ { K } w _ { 1 } ^ { \ell } } .
+$$
+
+Initialize particle set: $\tilde { x } _ { 1 } ^ { k } \gets x _ { 1 } ^ { k }$ for $t = 2 , 3 , \dots , T$ do
+
+Sample ancestor index $a _ { t - 1 } ^ { k } \sim \mathrm { D i s c r e t e } ( \cdot | \bar { w } _ { t - 1 } ^ { 1 } , \dots , \bar { w } _ { t - 1 } ^ { K } )$
+
+$x _ { t } ^ { k } \sim q _ { t , \phi } ( \cdot | y _ { 1 : t } , \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } )$
+
+$\tilde { x } _ { 1 : t } ^ { k } \gets ( \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } , x _ { t } ^ { k } )$
+
+Compute and normalize weights:
+
+$$
+w _ { t } ^ { k } = \frac { f _ { t , \theta } ( x _ { t } ^ { k } | \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } ) g _ { t , \theta } ( y _ { t } | \tilde { x } _ { 1 : t } ^ { k } ) } { q _ { t , \phi } ( x _ { t } ^ { k } | y _ { 1 : t } , \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } ) } ,
+$$
+
+$$
+\bar { w } _ { t } ^ { k } = \frac { w _ { t } ^ { k } } { \sum _ { \ell = 1 } ^ { K } w _ { t } ^ { \ell } } .
+$$
+
+Compute marginal likelihood: $\begin{array} { r } { \hat { Z } _ { \mathrm { S M C } } = \prod _ { t = 1 } ^ { T } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } w _ { t } ^ { k } } \end{array}$ return particles $( \tilde { x } _ { 1 : T } ^ { k } ) _ { k = 1 } ^ { K }$ , weights $( w _ { T } ^ { k } ) _ { k = 1 } ^ { K }$ , marginal likelihood estimate $\hat { Z } _ { S M C }$
+
+The sequential nature of SMC and the resampling step are crucial in making SMC scalable to large $T$ . The former makes it easier to design efficient proposal distributions as each step need only target the next set of variables $x _ { t }$ . The resampling step allows the algorithm to focus on promising particles in light of new observations, avoiding the exponential divergence between the weights of different samples that occurs for importance sampling as $T$ increases. This can be demonstrated both empirically and theoretically (Del Moral, 2004, Chapter 9). We refer the reader to (Doucet & Johansen, 2009) for an in-depth treatment of SMC.
+
+# 2.3 IMPORTANCE WEIGHTED AUTO-ENCODERS
+
+Given a dataset of observations $( y ^ { ( n ) } ) _ { n = 1 } ^ { N }$ , a generative network $p _ { \theta } ( x , y )$ and an inference network $q _ { \phi } ( x | y )$ , IWAEs (Burda et al., 2016) maximize $\begin{array} { r } { \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \operatorname { E L B O } _ { \mathrm { I S } } ( \theta , \phi , y ^ { ( n ) } ) } \end{array}$ where, for a given observation $y$ , the ELBOIS (with $K$ particles) is a lower bound on $\log p _ { \theta } ( y )$ by Jensen’s inequality:
+
+$$
+\begin{array} { r l } & { \displaystyle \mathrm { E L B O } _ { \mathrm { I S } } ( \theta , \phi , y ) = \int Q _ { \mathrm { I S } } ( x ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { I S } } ( x ^ { 1 : K } ) \mathrm { d } x ^ { 1 : K } \leq \log p _ { \theta } ( y ) \mathrm { , ~ w h e r e ~ } } \\ & { \displaystyle Q _ { \mathrm { I S } } ( x ^ { 1 : K } ) = \prod _ { k = 1 } ^ { K } q _ { \phi } ( x ^ { k } | y ) , \hat { Z } _ { \mathrm { I S } } ( x ^ { 1 : K } ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \frac { p _ { \theta } ( x ^ { k } , y ) } { q _ { \phi } ( x ^ { k } | y ) } . } \end{array}
+$$
+
+Note that for $K = 1$ particle, this objective reduces to a VAE (Kingma & Welling, 2014; Rezende et al., 2014) objective we will refer to as
+
+$$
+\operatorname { E L B O v a g } ( \theta , \phi , y ) = \int q _ { \phi } ( x | y ) ( \log p _ { \theta } ( x , y ) - \log q _ { \phi } ( x | y ) ) \mathrm { d } x .
+$$
+
+The IWAE optimization is performed using stochastic gradient ascent (SGA) where a sample from $\scriptstyle \left( \prod _ { k = 1 } ^ { K } q _ { \phi } ( x ^ { k } | y ^ { ( n ) } ) \right)$ is obtained using the reparameterization trick (Kingma & Welling, 2014) and the gradient $\begin{array} { r } { \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \nabla _ { \theta , \phi } \log \left( \sum _ { k = 1 } ^ { K } \frac { p _ { \theta } ( x ^ { k } , y ^ { ( n ) } ) } { q _ { \phi } ( x ^ { k } | y ^ { ( n ) } ) } \right) } \end{array}$ is used to perform an optimization step.
+
+# 3 AUTO-ENCODING SEQUENTIAL MONTE CARLO
+
+AESMC implements model learning, proposal adaptation, and inference amortization in a similar manner to the VAE and the IWAE: it uses SGA on an empirical average of the ELBO over observations. However, it varies in the form of this ELBO. In this section, we will introduce the AESMC ELBO, explain how gradients of it can be estimated, and discuss the implications of these changes.
+
+# 3.1 OBJECTIVE FUNCTION
+
+Consider a family of SSMs $\{ p _ { \theta } ( x _ { 1 : T } , y _ { 1 : T } ) ~ : ~ \theta ~ \in ~ \Theta \}$ and a family of proposal distributions $\begin{array} { r } { \{ q _ { \phi } ( x _ { 1 : T } | y _ { 1 : T } ) = q _ { 1 , \phi } ( x _ { 1 } | y _ { 1 } ) \prod _ { t = 2 } ^ { T } q _ { t , \phi } ( x _ { t } | x _ { 1 : t - 1 } , y _ { 1 : t } ) : \phi \in \Phi \} } \end{array}$ . AESMC uses an ELBO objective based on the SMC marginal likelihood estimator (1). In particular, for a given $y _ { 1 : T }$ , the objective is defined as
+
+$$
+\mathrm { E L B O } _ { \mathrm { S M C } } ( \theta , \phi , y _ { 1 : T } ) : = \int Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \mathrm { d } x _ { 1 : T } ^ { 1 : K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 : K } ,
+$$
+
+where $\hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ is defined in (1) and $Q _ { \mathrm { S M C } }$ is the sampling distribution of SMC,
+
+$$
+Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = \left( \prod _ { k = 1 } ^ { K } q _ { 1 , \phi } ( x _ { 1 } ^ { k } ) \right) \left( \prod _ { t = 2 } ^ { T } \prod _ { k = 1 } ^ { K } q _ { t , \phi } ( x _ { t } ^ { k } | \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } ) \cdot \operatorname { D i s c r e t e } ( a _ { t - 1 } ^ { k } | w _ { t - 1 } ^ { 1 : K } ) \right) .
+$$
+
+and the unbiasedness of the marginal likelihood estimator. Hence, given a dataset $\mathbf { E L B O } _ { \mathbf { S M C } }$ forms a lower bound to the log marginal likelihood $\log p _ { \theta } ( y _ { 1 : T } )$ due to Jensen’s inequality $( y _ { 1 : T } ^ { ( n ) } ) _ { n = 1 } ^ { N }$ , we can perform model learning based on maximizing the lower bound of $\begin{array} { r } { \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \log p _ { \theta } ( y _ { 1 : T } ^ { ( n ) } ) } \end{array}$ as a
+
+$$
+\mathcal { I } ( \theta , \phi ) : = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathrm { E L B O } _ { \mathrm { S M C } } \big ( \theta , \phi , y _ { 1 : T } ^ { ( n ) } \big ) .
+$$
+
+For notational convenience, we will talk about optimizing ELBOs in the rest of this section. However, we note that the main intended use of AESMC is to amortize over datasets, for which the ELBO is replaced by the dataset average ${ \mathcal { I } } ( \theta , \phi )$ in the optimization target. Nonetheless, rather than using the full dataset for each gradient update, will we instead use minibatches, noting that this forms unbiased estimator.
+
+# 3.2 GRADIENT ESTIMATION
+
+We describe a gradient estimator used for optimizing $\mathbf { \Theta } _ { \mathrm { E L B O } _ { \mathrm { S M C } } } ( \theta , \phi , y _ { 1 : T } )$ using SGA. The SMC sampler in Algorithm 1 proceeds by sampling $x _ { 1 } ^ { 1 : K } , \bar { a _ { 1 } ^ { 1 : K } } , x _ { 2 } ^ { 1 : K } ,$ : K , a 1: K1 , . . . sequentially from their respective distributions $\textstyle \prod _ { k = 1 } ^ { K } q _ { 1 } ( x _ { 1 } ^ { k } )$ , $\textstyle \prod _ { k = 1 } ^ { K }$ Discrete $( a _ { 1 } ^ { k } | w _ { 1 } ^ { 1 : K } )$ , $\begin{array} { r } { \prod _ { k = 1 } ^ { K } q _ { 2 } ( x _ { 2 } ^ { k } | x _ { 1 } ^ { a _ { 1 } ^ { k } } ) , . . . } \end{array}$ until the whole k=1 particle-weight trajectory $( x _ { 1 : K } ^ { 1 : T } , a _ { 1 : T - 1 } ^ { 1 : K } )$ 1 | 1 k=1 2 | 1 is sampled. From this trajectory, using equation (1), we can
+
+Assuming that the sampling of latent variables $x _ { 1 : T } ^ { 1 : K }$ is reparameterizable, we can make their sampling independent of $( \theta , \phi )$ . In particular, assume that there exists a set of auxiliary random variables 1:T t ∼by first sampling $\epsilon _ { 1 : T } ^ { 1 : K }$ where $\epsilon _ { t } ^ { k } \sim s _ { t }$ $\begin{array} { r } { \epsilon _ { 1 } ^ { 1 : K } \sim \prod _ { k = 1 } ^ { K } s _ { 1 } } \end{array}$ and a set of reparameterization functions and setting K $x _ { 1 } ^ { k } = r _ { 1 } ( \epsilon _ { 1 } ^ { k } )$ and . We can simulate the SMC sampler $\tilde { x } _ { 1 } ^ { k } = x _ { 1 } ^ { k }$ , then for K $t = 2 , \dots , T$ cycling through sampling $\begin{array} { r } { a _ { t - 1 } ^ { 1 : K } \sim \prod _ { k = 1 } ^ { K } } \end{array}$ Q k=1 Discrete $\left( a _ { t - 1 } ^ { k } | w _ { t - 1 } ^ { 1 : K } \right)$ and $\begin{array} { r } { \epsilon _ { t } ^ { 1 : K } \sim \prod _ { k = 1 } ^ { K } s _ { t } } \end{array}$ , and setting $x _ { t } ^ { k } = r _ { t } ( \epsilon _ { t } ^ { k } , \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } )$ and $\tilde { x } _ { 1 : t } ^ { k } \ = \ ( \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } , x _ { t } ^ { k } )$ . We use the resulting reparameterized sample of $( x _ { 1 : K } ^ { 1 : T } , a _ { 1 : T - 1 } ^ { 1 : K } )$ 1:t−1 1: 1:t−1 to evaluate the gradient estimator $\nabla _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ .
+
+To account for the discrete choices of ancestor indices $a _ { t } ^ { k }$ one could additionally use the REINFORCE (Williams, 1992) trick, however in practice, we found that the additional term in the estimator has problematically high variance. We explore various other possible gradient estimators and empirical assessments of their variances in Appendix A. This exploration confirms that including the additional REINFORCE terms leads to problematically high variance, justifying our decision to omit them, despite introducing a small bias into the gradient estimates.
+
+# 3.3 BIAS & IMPLICATIONS ON THE PROPOSALS
+
+In this section, we express the gap between ELBOs and the log marginal likelihood as a KL divergence and study implications on the proposal distributions. We present a set of claims and propositions whose full proofs are in Appendix B. These give insight into the behavior of AESMC and show the advantages, and disadvantages, of using our different ELBO. This insight motivates Section 4 which proposes an algorithm for improving proposal learning.
+
+Definition 1. Given an unnormalized target density ${ \tilde { P } } : { \mathcal { X } } \to [ 0 , \infty )$ with normalizing constant $Z _ { P } > 0$ , $P : = { \tilde { P } } / { Z _ { P } }$ , and $a$ proposal density $Q : \mathcal { X } [ 0 , \infty )$ , then
+
+$$
+\mathtt { E L B O } : = \int Q ( x ) \log \frac { \tilde { P } ( x ) } { Q ( x ) } \mathrm { d } x ,
+$$
+
+is a lower bound on $\log Z _ { P }$ and satisfies
+
+$$
+\begin{array} { r } { { \bf E L B O } = \log Z _ { P } - { \bf K L } \left( { Q } \vert \vert { P } \right) . } \end{array}
+$$
+
+This is a standard identity used in variational inference and VAEs. In the case of VAEs, applying Definition 1 with $P$ being $p _ { \theta } ( x | y )$ , $\tilde { P }$ being $p _ { \theta } ( x , y )$ , $Z _ { P }$ being $p _ { \theta } ( y )$ , and $Q$ being $q _ { \phi } ( x | y )$ , we can directly rewrite (4) as $\begin{array} { r } { \mathrm { E L B O } _ { \mathrm { V A E } } ( \theta , \phi , y ) = \log p _ { \theta } ( y ) - \mathrm { K L } \left( q _ { \phi } ( x | y ) | | p _ { \theta } ( x | y ) \right) } \end{array}$ .
+
+The key observation for expressing such a bound for general ELBOs such as $_ { \mathrm { E L B O _ { I S } } }$ and ELBOSMC is that the target density $P$ and the proposal density $Q$ need not directly correspond to $p _ { \theta } ( x | y )$ and $q _ { \phi } ( x | y )$ . This allows us to view the underlying sampling distributions of the marginal likelihood Monte Carlo estimators such as $Q _ { \mathrm { I S } }$ in (3) and $Q _ { \mathrm { S M C } }$ in (6) as proposal distributions on an extended space $\mathcal { X }$ . The following claim uses this observation to express the bound between a general ELBO and the log marginal likelihood as KL divergence from the extended space sampling distribution to a corresponding target distribution.
+
+Claim 1. Given a non-negative unbiased estimator $\hat { Z } _ { P } ( x ) \geq 0$ of the normalizing constant $Z _ { P }$ where x is distributed according to the proposal distribution $Q ( x )$ , the following holds:
+
+$$
+\begin{array} { r l } & { \displaystyle \mathrm { E L B O } = \int Q ( { \boldsymbol x } ) \log \hat { Z } _ { P } ( { \boldsymbol x } ) \mathrm { d } { \boldsymbol x } = \log Z _ { P } - \mathrm { K L } \left( Q | | P \right) , } \\ { { \boldsymbol w h e r e } } & { P ( { \boldsymbol x } ) = \displaystyle \frac { Q ( { \boldsymbol x } ) \hat { Z } _ { P } ( { \boldsymbol x } ) } { Z _ { P } } } \end{array}
+$$
+
+is the implied normalized target density.
+
+In the case of IWAEs, we can apply Claim 1 with $Q$ and $\hat { Z } _ { P }$ being $Q _ { \mathrm { I S } }$ and $\hat { Z } _ { \mathrm { I S } }$ respectively as defined in (3) and $Z _ { P }$ being $p _ { \theta } ( y )$ . This yields
+
+$$
+\begin{array} { r } { \begin{array} { r l } & { \mathrm { E L B O } _ { \mathrm { I S } } ( \theta , \phi , y ) = \log p _ { \theta } ( y ) - \mathrm { K L } \left( Q _ { \mathrm { I S } } | | P _ { \mathrm { I S } } \right) , \mathrm { ~ w h e r e } } \\ & { \qquad P _ { \mathrm { I S } } ( x ^ { 1 : K } ) = \displaystyle \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \left( q _ { \phi } ( x ^ { 1 } | y ) \cdots q _ { \phi } ( x ^ { k - 1 } | y ) p _ { \theta } ( x ^ { k } | y ) q _ { \phi } ( x ^ { k + 1 } | y ) \cdots q _ { \phi } ( x ^ { K } | y ) \right) . } \end{array} } \end{array}
+$$
+
+Similarly, in the case of AESMC, we obtain
+
+$$
+\begin{array} { r l } & { \mathrm { E L B O } _ { \mathrm { S M C } } ( \theta , \phi , y _ { 1 : T } ) = \log p _ { \theta } ( y _ { 1 : T } ) - \mathrm { K L } \left( Q _ { \mathrm { S M C } } | | P _ { \mathrm { S M C } } \right) , \mathrm { ~ w h e r e } } \\ & { P _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) / p _ { \theta } ( y _ { 1 : T } ) . } \end{array}
+$$
+
+Having expressions for the target distribution $P$ and the sampling distribution $Q$ for a given ELBO allows us to investigate what happens when we maximize that ELBO, remembering that the KL term is strictly non-negative and zero if and only if $P = Q$ . For the VAE and IWAE cases then, provided the proposal is sufficiently flexible, one can always perfectly maximize the ELBO by setting $\bar { p } _ { \theta } ( x | y ) = \bar { q _ { \phi } } ( \bar { x | y } )$ for all $x$ . The reverse implication also holds: if $\mathtt { E L B O } _ { \mathrm { V A E } } = \log Z _ { P }$ then it must be the case that $p _ { \theta } ( x | y ) = q _ { \phi } ( x | y )$ . However, for AESMC, achieving $\mathtt { E L B O } = \log Z _ { P }$ is only possible when one also has sufficient flexibility to learn a particular series of intermediate target distributions, namely the marginals of the final target distribution. In other words, it is necessary to learn a particular factorization of the generative model, not just the correct individual proposals, to achieve $P = Q$ and thus $\mathtt { E L B O } _ { \mathtt { S M C } } = Z _ { P }$ . These observations are formalized in Propositions 1 and 2 below.
+
+Proposition 1. $Q _ { I S } ( x ^ { 1 : K } ) = P _ { I S } ( x ^ { 1 : K } )$ for all $x ^ { 1 : K }$ if and only if $q ( x | y ) = p ( x | y )$ for all $x$
+
+Proposition 2. If $K > 1$ , then $P _ { S M C } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = Q _ { S M C } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ for all $( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) i f$ and only if
+
+$\begin{array} { r } { l . ~ \pi _ { t } ( x _ { 1 : t } ) = \int p ( x _ { 1 : T } | y _ { 1 : T } ) \mathrm { d } x _ { t + 1 : T } = p ( x _ { 1 : t } | y _ { 1 : T } ) , } \end{array}$ for all $x _ { 1 : t }$ and $t = 1 , \dots , T$ , and 2. $q _ { 1 } ( x _ { 1 } | y _ { 1 } ) = p ( x _ { 1 } | y _ { 1 : T } )$ for all $x _ { 1 }$ and $q _ { t } ( x _ { t } | x _ { 1 : t - 1 } , y _ { 1 : t } ) = p ( x _ { 1 : t } | y _ { 1 : T } ) / p ( x _ { 1 : t - 1 } | y _ { 1 : T } )$ for $t = 2 , \ldots , T$ for all $x _ { 1 : t }$ ,
+
+where $\pi _ { t } ( x _ { 1 : t } )$ are the intermediate targets used by SMC.
+
+Proposition 2 has the consequence that if the family of generative models is such that the first condition does not hold, we will not be able to make the bound tight. This means that, except for a very small class of models, then, for most convenient parameterizations, it will be impossible to learn a perfect proposal that gives a tight bound, i.e. there will be no $\theta$ and $\phi$ such that the above conditions can be satisfied. However, it also means that ELBOSMC encodes important additional information about the implications the factorization of the generative model has on the inference—the model depends only on the final target $\pi _ { T } ( x _ { 1 : T } ) = p _ { \theta } ( x _ { 1 : T } | y _ { 1 : T } )$ , but some choices of the intermediate targets $\pi _ { t } ( x _ { 1 : t } )$ will lead to much more efficient inference than others. Perhaps more importantly, SMC is usually a far more powerful inference algorithm than importance sampling and so the AESMC setup allows for more ambitious model learning problems to be effectively tackled than the VAE or IWAE. After all, even though it is well known in the SMC literature that, unlike for IS, most problems have no perfect set of SMC proposals which will generate exact samples from the posterior (Doucet & Johansen, 2009), SMC still gives superior performance on most problems with more than a few dimensions. These intuitions are backed up by our experiments that show that using ELBOSMC regularly learns better models than using ELBOIS.
+
+# 4 IMPROVING PROPOSAL LEARNING
+
+In practice, one is rarely able to perfectly drive the divergence to zero and achieve a perfect proposal. In addition to the implications of the previous section, this occurs because $q _ { \phi } ( x _ { 1 : T } | y _ { 1 : T } )$ may not be sufficiently expressive to represent $p _ { \theta } ( x _ { 1 : T } | y _ { 1 : T } )$ exactly and because of the inevitable sub-optimality of the optimization process, remembering that we are aiming to learn an amortized inference artifact, rather than a single posterior representation. Consequently, to accurately assess the merits of different ELBOs for proposal learning, it is necessary to consider their finite-time performance. We therefore now consider the effect the number of particles $K$ has on the gradient estimators for ELBOIS and ELBOSMC.
+
+Counter-intuitively, it transpires that the tighter bounds implied by using a larger $K$ is often harmful to proposal learning for both IWAE and AESMC. At a high-level, this is because an accurate estimate for $\hat { Z } _ { P }$ can be achieved for a wide range of proposal parameters $\phi$ and so the magnitude of $\nabla _ { \phi }$ ELBO reduces as $K$ increases. Typically, this shrinkage happens faster than increasing $K$ reduces the standard deviation of the estimate and so the standard deviation of the gradient estimate relative to the problem scaling (i.e. as a ratio of true gradient $\nabla _ { \phi }$ ELBO) actually increases. This effect is demonstrated in Figure 1 which shows a kernel density estimator for the distribution of the gradient estimate for different $K$ and the model given in Section 5.2. Here we see that as we increase $K$ , both the expected gradient estimate (which is equal to the true gradient by unbiasedness) and standard deviation of the estimate decrease. However, the former decreases faster and so the relative standard deviation increases. This is perhaps easiest to appreciate by noting that for $K > 1 0$ , there is a roughly equal probability of the estimate being positive or negative, such that we are equally likely to increase or decrease the parameter value at the next SGA iteration, inevitably leading to poor performance. On the other hand, when $K = 1$ , it is far more likely that the gradient estimate is positive than negative, and so there is clear drift to the gradient steps. We add to the empirical evidence for this behavior in Section 5. Note the critical difference for model learning is that $\nabla _ { \theta }$ ELBO does not, in general, decrease in magnitude as $K$ increases. Note also that using a larger $K$ should always give better performance at test time; it may though be better to learn $\phi$ using a smaller $K$ .
+
+
+Figure 1: Density estimate of $\nabla _ { \phi }$ ELBO for different $K$
+
+In simultaneously developed work (Rainforth et al., 2017), we formalized this intuition in the IWAE setting by showing that the estimator of $\nabla _ { \phi } \operatorname { E L B O } _ { \mathrm { I S } } ( \theta , \phi , x )$ with $K$ particles, denoted by $I _ { K }$ , has the following signal-to-noise ratio (SNR):
+
+$$
+\mathrm { { s N R } } : = { \frac { \mathbb { E } [ I _ { K } ] } { \sqrt { \operatorname { V a r } [ I _ { K } ] } } } = O \left( { \sqrt { \frac { 1 } { K } } } \right) .
+$$
+
+We thus see that increasing $K$ reduces the SNR and so the gradient updates for the proposal will degrade towards pure noise if $K$ is set too high.
+
+# 4.1 ALTERNATING ELBOS
+
+To address these issues, we suggest and investigate the alternating ELBOs (ALT) algorithm which updates $( \theta , \phi )$ in a coordinate descent fashion using different ELBOs, and thus gradient estimates, for each. We pick a $\theta$ -optimizing pair and a $\phi$ -optimizing pair $( A _ { \theta } , K _ { \theta } ) , ( A _ { \phi } , K _ { \phi } ) \in \{ \mathrm { I S } , \mathrm { S M C } \} \times$ $\{ 1 , 2 , \dots \}$ , corresponding to an inference type and number of particles. In an optimization step, we obtain an estimator for $\nabla _ { \theta } \operatorname { E L B O } _ { A _ { \theta } }$ with $K _ { \theta }$ particles and an estimator for $\nabla _ { \phi } \operatorname { E L B O } _ { A _ { \phi } }$ with $K _ { \phi }$ particles which we call $g _ { \boldsymbol { \theta } }$ and $g _ { \phi }$ respectively. We use $g _ { \theta }$ to update the current $\theta$ and $g _ { \phi }$ to update the current $\phi$ . The results from the previous sections suggest that using $A _ { \theta } = \mathsf { s M C }$ and $A _ { \phi } = \mathrm { I S }$ with a large $K _ { \theta }$ and a small $K _ { \phi }$ may perform better model and proposal learning than just fixing $( A _ { \theta } , K _ { \theta } ) = ( A _ { \phi } , K _ { \phi } )$ to (SMC, large) since using $A _ { \phi } = \mathrm { I S }$ with small $K _ { \phi }$ helps learning $\phi$ (at least in terms of the SNR) and using $A _ { \theta } = \mathsf { s M C }$ with large $K _ { \theta }$ helps learning $\theta$ . We experimentally observe that this procedure can in some cases improve both model and proposal learning.
+
+# 5 EXPERIMENTS
+
+We now present a series of experiments designed to answer the following questions: 1) Does tightening the bound by using either more particles or a better inference procedure lead to an adverse effect on proposal learning? 2) Can AESMC, despite this effect, outperform IWAE? 3) Can we further improve the learned model and proposal by using ALT?
+
+First we investigate a linear Gaussian state space model (LGSSM) for model learning and a latent variable model for proposal adaptation. This allows us to compare the learned parameters to the optimal ones. Doing so, we confirm our conclusions for this simple problem.
+
+We then extend those results to more complex, high dimensional observation spaces that require models and proposals parameterized by neural networks. We do so by investigating the Moving Agents dataset, a set of partially occluded video sequences.
+
+# 5.1 LINEAR GAUSSIAN STATE SPACE MODEL
+
+Given the following LGSSM
+
+$$
+\begin{array} { r l } & { p ( x _ { 1 } ) = \mathrm { N o r m a l } \left( x _ { 1 } ; 0 , 1 ^ { 2 } \right) , } \\ & { p ( x _ { t } | x _ { t - 1 } ) = \mathrm { N o r m a l } \left( x _ { t } ; \theta _ { 1 } x _ { t - 1 } , 1 ^ { 2 } \right) , } \\ & { ~ p ( y _ { t } | x _ { t } ) = \mathrm { N o r m a l } \left( y _ { t } ; \theta _ { 2 } x _ { t } , \sqrt { 0 . 1 } ^ { 2 } \right) , ~ t = 1 , \dots , T , } \end{array}
+$$
+
+we find that optimizing $\mathrm { E L B O } _ { \mathrm { S M C } } ( \theta , \phi , y _ { 1 : T } )$ w.r.t. $\theta$ leads to better generative models than optimizing $\mathrm { E L B O _ { I S } } ( \theta , \phi , y _ { 1 : T } )$ . The same is true for using more particles.
+
+We generate a sequence $y _ { 1 : T }$ for $T = 2 0 0$ by sampling from the model with $\theta = ( \theta _ { 1 } , \theta _ { 2 } ) = ( 0 . 9 , 1 . 0 )$ . We then optimize the different ELBOs w.r.t. $\theta$ using the bootstrap proposal $q _ { 1 } ( x _ { 1 } | y _ { 1 } ) = \mu _ { \theta } ( x _ { 1 } )$ and $q _ { t } ( x _ { t } | x _ { 1 : t - 1 } , y _ { 1 : t } ) = f _ { t , \theta } ( x _ { t } | x _ { 1 : t - 1 } )$ . Because we use the bootstrap proposal, gradients w.r.t. to $\theta$ are not backpropagated through $q$ .
+
+We use a fixed learning rate of 0.01 and optimize for 500 steps using SGA. Figure 2 shows that the convergence of both $\log p _ { \theta } ( y _ { 1 : T } )$ to $\operatorname* { m a x } _ { \theta } \log p _ { \theta } ( y _ { 1 : T } )$ and $\theta$ to argmax $\cdot \theta$ $\log p _ { \theta } ( y _ { 1 : T } )$ is faster when $\mathbf { E L B O } _ { \mathbf { S M C } }$ and more particles are used.
+
+
+Figure 2: (Left) Log marginal likelihood analytically evaluated at every $\theta$ during optimization; the black line indicates $\operatorname { m a x } _ { \theta }$ $\arg p _ { \theta } ( y _ { 1 : T } )$ obtained by the expectation maximization (EM) algorithm. (Right) learning of model parameters; the black line indicates argmax $\scriptstyle { \dot { \theta } }$ $\log p _ { \theta } ( y _ { 1 : T } )$ obtained by the EM algorithm.
+
+# 5.2 PROPOSAL LEARNING
+
+We now investigate how learning $\phi$ , i.e. the proposal, is affected by the the choice of ELBO and the number of particles.
+
+Consider a simple, fixed generative model $p ( \mu ) p ( x | \mu ) = \mathrm { N o r m a l } ( \mu ; 0 , 1 ^ { 2 } ) \mathrm { N o r m a l } ( x ; \mu , 1 ^ { 2 } )$ where $\mu$ and $x$ are the latent and observed variables respectively and a family of proposal distributions $q _ { \phi } ( \mu ) = \mathrm { N o r m a l } ( \mu ; \mu _ { q } , \sigma _ { q } ^ { 2 } )$ parameterized by $\phi \overset { \cdot } { = } ( \mu _ { q } , \operatorname { l o g } \sigma _ { q } ^ { 2 } )$ . For a fixed observation $x = 2 . 3$ , we initialize $\phi = ( 0 . 0 1 , 0 . 0 1 )$ and optimize $_ { \mathrm { E L B O _ { I S } } }$ with respect to $\phi$ . We investigate the quality of the learned parameter $\phi$ as we increase the number of particles $K$ during training. Figure 3 (left) clearly demonstrates that the quality of $\phi$ compared to the analytic posterior decreases as we increase $K$ .
+
+Similar behavior is observed in Figure 3 (middle, right) where we optimize $\mathrm { E L B O } _ { \mathrm { S M C } }$ with respect to both $\theta$ and $\phi$ for the LGSSM described in Section 5.1. We see that using more particles helps model learning but makes proposal learning worse. Using our ALT algorithm alleviates this problem and at the same time makes model learning faster as it profits from a more accurate proposal distribution. We provide more extensive experiments exploring proposal learning with different ELBOs and number of particles in Appendix C.3.
+
+
+Figure 3: (Left) Optimizing $_ { \mathrm { E L B O _ { I S } } }$ for the Gaussian unknown mean model with respect to $\phi$ results in worse $\phi$ as we increase number of particles $K$ . (Middle, right) Optimizing ELBOSMC with respect to $( \theta , \phi )$ for LGSSM and using the ALT algorithm for updating $( \theta , \phi )$ with $( A _ { \theta } , K _ { \theta } ) = ( \mathrm { s M C } , 1 0 0 0 )$ and $( A _ { \phi } , K _ { \phi } ) = ( \mathrm { { I S } , 1 0 ) }$ . Right measures the quality of $\phi$ by showing $\sqrt { \sum _ { t = 1 } ^ { T } ( \mu _ { t } ^ { \mathrm { k a l m a n } } - \mu _ { t } ^ { \mathrm { a p p r o x } } ) ^ { 2 } }$ where $\mu _ { t } ^ { \mathrm { k a l m a n } }$ is the marginal mean obtained from the Kalman smoothing algorithm under the model twith EM-optimized parameters and $\mu _ { t } ^ { \mathrm { a p p r o x } }$ is an marginal mean obtained from the set of $1 0 \ \mathrm { { s u c } }$ particles with learned/bootstrap proposal.
+
+# 5.3 MOVING AGENTS
+
+To show that our results are applicable to complex, high dimensional data we compare AESMC and IWAE on stochastic, partially observable video sequences. Figure 7 in Appendix C.2 shows an example of such a sequence.
+
+The dataset consists of $N = 5 0 0 0$ sequences of images $( y _ { 1 : T } ^ { ( n ) } ) _ { n = 1 } ^ { N }$ of which 1000 are randomly held out as test set. Each sequence contains $T = 4 0$ images represented as a 2 dimensional array of size $3 2 \times 3 2$ . In each sequence there is one agent, represented as circle, whose starting position is sampled randomly along the top and bottom of the image. The dataset is inspired by (Ondrúška & Posner, 2016), however with the crucial difference that the movement of the agent is stochastic. The agent performs a directed random walk through the image. At each timestep, it moves according to
+
+$$
+\begin{array} { r l } & { y _ { t + 1 } \sim \mathrm { N o r m a l } ( y _ { t + 1 } ; y _ { t } + 0 . 1 5 , 0 . 0 2 ^ { 2 } ) } \\ & { x _ { t + 1 } \sim \mathrm { N o r m a l } ( x _ { t + 1 } ; 0 , 0 . 0 2 ^ { 2 } ) } \end{array}
+$$
+
+where $( x _ { t } , y _ { t } )$ are the coordinates in frame $t$ in a unit square that is then projected onto $3 2 \times 3 2$ pixels. In addition to the stochasticity of the movement, half of the image is occluded, preventing the agent from being observed.
+
+For the generative model and proposal distribution we use a Variational Recurrent Neural Network (VRNN) (Chung et al., 2015). It extends recurrent neural networks (RNNs) by introducing a stochastic latent state $x _ { t }$ at each timestep $t$ . Together with the observation $y _ { t }$ , this state conditions the deterministic transition of the RNN. By introducing this unobserved stochastic state, the VRNN is able to better model complex long range variability in stochastic sequences. Architecture and hyperparameter details are given in Appendix C.1.
+
+Figure 4 shows $\mathrm { \ m a x { ( E L B O _ { I S } } }$ , $\mathrm { E L B O } _ { \mathrm { S M C } }$ ) for models trained with IWAE and AESMC for different particle numbers. The lines correspond to the mean over three different random seeds and the shaded areas indicate the standard deviation. The same number of particles was used for training and testing, additional hyperparameter settings are given in the appendix. One can see that models trained using AESMC outperform IWAE and using more particles improves the ELBO for both. In Appendix C.2, we inspect different learned generative models by using them for prediction, confirming the results presented here. We also tested ALT on this task, but found that while it did occasionally improve performance, it was much less stable than IWAE and AESMC.
+
+
+Figure 4: (Left) Rolling mean over 5 epochs of max(ELBOSMC, ELBOIS) on the test set, lines indicate the average over 3 random seeds and shaded areas indicate standard deviation. The color indicates the number of particles, the line style the used algorithm. (Right) The table shows the final max(ELBOSMC, ELBOIS) for each learned model.
+
+
Particles
Method
Moving Agents
10
IWAE
-357.3
AESMC
-356.7
20
IWAE
-356.6
AESMC
-356.1
40
IWAE
-356.2
AESMC
-356.1
+
+# 6 CONCLUSIONS
+
+We have developed AESMC—a method for performing model learning using a new ELBO objective which is based on the SMC marginal likelihood estimator. This ELBO objective is optimized using SGA and the reparameterization trick. Our approach utilizes the efficiency of SMC in models with intermediate observations and hence is suitable for highly structured models. We experimentally demonstrated that this objective leads to better generative model training than the IWAE objective for structured problems, due to the superior inference and tighter bound provided by using SMC instead of importance sampling.
+
+Additionally, in Claim 1, we provide a simple way to express the bias of objectives induced by log of marginal likelihood estimators as a KL divergence on an extended space. In Propositions 1 and 2, we investigate the implications of these KLs being zero in the case of IWAE and AESMC. In the latter case, we find that we can achieve zero KL only if we are able to learn SMC intermediate target distributions corresponding to marginals of the target distribution. Using our assertion that tighter variational bounds are not necessarily better, we then introduce and test a new method, alternating ELBOs, that addresses some of these issues and observe that, in some cases, this improves both model and proposal learning.
+
+# ACKNOWLEDGMENTS
+
+TAL is supported by EPSRC DTA and Google (project code DF6700) studentships. MI is supported by the UK EPSRC CDT in Autonomous Intelligent Machines and Systems. TR is supported by the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007- 2013) ERC grant agreement no. 617071; majority of TR’s work was undertaken while he was in the Department of Engineering Science, University of Oxford, and was supported by a BP industrial grant. TJ is supported by the UK EPSRC and MRC CDT in Statistical Science. FW is supported by The Alan Turing Institute under the EPSRC grant EP/N510129/1; DARPA PPAML through the U.S. AFRL under Cooperative Agreement FA8750-14-2-0006; Intel and DARPA D3M, under Cooperative Agreement FA8750-17-2-0093.
+
+# REFERENCES
+
+Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016.
+
+Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In Advances in neural information processing systems, pp. 2980–2988, 2015.
+
+P Del Moral. Feynman-Kac formulae: genealogical and interacting particle systems with applications. Probability and its applications, 2004.
+
+Arnaud Doucet and Adam M Johansen. A tutorial on particle filtering and smoothing: Fifteen years later. Handbook of nonlinear filtering, 12(656-704):3, 2009.
+
+Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In ICLR, 2014.
+
+Tuan Anh Le, Maximilian Igl, Tom Jin, Tom Rainforth, and Frank Wood. Auto-encoding sequential Monte Carlo. arXiv preprint arXiv:1705.10306v1, 2017.
+
+Chris J Maddison, John Lawson, George Tucker, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Teh. Filtering variational objectives. In Advances in Neural Information Processing Systems, pp. 6576–6586, 2017.
+
+Christian A Naesseth, Scott W Linderman, Rajesh Ranganath, and David M Blei. Variational sequential Monte Carlo. arXiv preprint arXiv:1705.11140, 2017.
+
+Peter Ondrúška and Ingmar Posner. Deep tracking: Seeing beyond seeing using recurrent neural networks. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
+
+Tom Rainforth, Tuan Anh Le, Maximilian Igl, Chris J Maddison, Yee Whye Teh, and Frank Wood. Tighter variational bounds are not necessarily better. NIPS Workshop on Bayesian Deep Learning, 2017.
+
+Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014.
+
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
+
+# A GRADIENTS
+
+The goal is to obtain an unbiased estimator for the gradient
+
+$$
+\nabla _ { \theta , \phi } \int Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \mathrm { d } x _ { 1 : T } ^ { 1 : K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 : K } .
+$$
+
+# A.1 FULL REINFORCE
+
+We express the required quantity as
+
+$$
+\begin{array} { r l } & { \nabla _ { \theta , \phi } \int Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \mathrm { d } x _ { 1 : T } ^ { 1 : K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 : K } } \\ & { = \displaystyle \int \nabla _ { \theta , \phi } Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) + } \\ & { \qquad Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \nabla _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \mathrm { d } x _ { 1 : T } ^ { 1 : K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 : K } } \\ & { = \displaystyle \int Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \left[ \nabla _ { \theta , \phi } \log Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) + \right. } \\ & { \qquad \left. \nabla _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \right] \mathrm { d } x _ { 1 : T } ^ { 1 : K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 : K } , } \end{array}
+$$
+
+which we can estimate by sampling $( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ directly from $Q _ { \mathrm { S M C } }$ and evaluating $\begin{array} { r } { \left[ \nabla _ { \theta , \phi } \log Q _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) + \nabla _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) \right] . } \end{array}$
+
+# A.2 REINFORCE & REPARAMETERIZATION
+
+We express the required quantity as
+
+$$
+\begin{array} { r l } { \nabla _ { \Phi , \Phi } \int Q _ { \mathrm { A W } } ( z _ { 1 , 1 } ^ { ( 1 ) K } , z _ { 1 } ^ { ( 1 ) K } - 1 ) \mathrm { i } \simeq \widetilde \chi _ { \Phi , \Phi } ( z _ { 1 , 1 } ^ { ( 1 ) K } , z _ { 1 } ^ { ( 1 ) K } - 1 ) \mathrm { d } z _ { 1 , 1 } ^ { ( 1 ) K } \mathrm { d } z _ { 1 , 1 } ^ { ( 1 ) K } - } & { \ : \ : \ : \ : \ : \ : \ : \ : \ : } \\ & { = \nabla _ { \Phi , \Phi } \int \left( \displaystyle \prod _ { k = 1 } ^ { 1 } \sigma _ { k } ( \boldsymbol { \bar { \epsilon } } ^ { ( 1 ) K } ) \right) \left( \displaystyle \prod _ { k = 2 } ^ { 1 } \| Q _ { \boldsymbol { k } } ( z _ { 1 , k } ^ { ( 1 ) K } | \boldsymbol { \bar { \epsilon } } _ { k - 1 } ^ { ( 2 ) K } ) - 1 ) \mathrm { d } z _ { 1 , k } ^ { ( 1 ) K } \mathrm { d } z _ { 1 , 1 } ^ { ( 1 ) K } \right) } \\ & { \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : } \\ & { = \nabla _ { \Phi , \Phi } \int \left( \displaystyle \prod _ { k = 1 } ^ { 1 } \sigma _ { k } ( \boldsymbol { \bar { \epsilon } } _ { k - 1 } ^ { ( K ) } , z _ { 1 - k } ^ { ( K ) } - 1 ) \mathrm { d } z _ { 1 , k } ^ { ( 1 ) K } \mathrm { d } z _ { 1 , 1 } ^ { ( K ) } - 1 \right. } \\ & { \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \left. \lVert \prod _ { k = 1 } ^ { 1 } \sigma _ { k } ( z _ { 1 , k } ^ { ( 1 ) K } ) \right) \left( \displaystyle \prod _ { k = 2 } ^ { 1 } \| Q _ { \boldsymbol { k } } ( z _ { 1 , k } ^ { ( 1 ) K } - 1 ) \mathrm { d } z _ { 1 , k } ^ { ( 1 ) K } \| \boldsymbol { \bar { \epsilon } } _ { k - 1 } ^ { ( K ) } \right) } \\ & \ : \ : \ : \ : \ : \ : \ : \ : \mathrm { i n f } \left( \displaystyle \prod _ { k = 1 } ^ { 1 } \sigma _ { k } ( z _ { 1 , k } ^ { ( 1 ) K } ) \right) \ : \ : \ : \ : \ : \ : \mathrm { d } z _ { 1 , k } ^ { ( 1 ) K } \sigma _ { k } ( \boldsymbol { \bar { \epsilon } } ^ { ( 1 ) K } , 1 ) \ : \ : \end{array}
+$$
+
+$$
+\begin{array} { l } { \displaystyle = \int \left( \prod _ { t = 1 } ^ { T } \prod _ { k = 1 } ^ { K } s _ { t } ( \epsilon _ { t } ^ { k } ) \right) \left( \prod _ { t = 2 } ^ { T } \prod _ { k = 1 } ^ { K } \mathrm { D i s c r e t e } ( a _ { t - 1 } ^ { k } | w _ { t - 1 } ^ { 1 ; K } ) \right) \cdot } \\ { \displaystyle \left[ \nabla _ { \theta , \phi } \log \left( \prod _ { t = 2 } ^ { T } \prod _ { k = 1 } ^ { K } \mathrm { D i s c r e t e } ( a _ { t - 1 } ^ { k } | w _ { t - 1 } ^ { 1 ; K } ) \right) \log \hat { Z } _ { \mathrm { S M C } } ( r ( \epsilon _ { 1 : T } ^ { 1 ; K } ) , a _ { 1 : T - 1 } ^ { 1 ; K } ) + \right. } \\ { \displaystyle \left. \nabla _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( r ( \epsilon _ { 1 : T } ^ { 1 ; K } ) , a _ { 1 : T - 1 } ^ { 1 ; K } ) \right] \mathrm { d } \epsilon _ { 1 : T } ^ { 1 ; K } \mathrm { d } a _ { 1 : T - 1 } ^ { 1 ; K } , } \end{array}
+$$
+
+where $r \big ( \epsilon _ { 1 : T } ^ { 1 : K } \big )$ denotes a sample with identical distribution as $x _ { 1 : T } ^ { 1 : K }$ obtained by passing the auxiliary samples $\epsilon _ { 1 : T } ^ { 1 : K }$ through the reparameterization function. We can thus estimate the gradient by sampling $\epsilon _ { 1 : T } ^ { 1 : K }$ from the auxiliary distribution, reparameterizing and evaluating h $\begin{array} { r } { \overset { \cdot } { \nabla } \varrho _ { \theta , \phi } \log \Big ( \prod _ { t = 2 } ^ { \bar { T } } \prod _ { k = 1 } ^ { \bar { K } } \bar { \mathrm { D i s c r e t e } ( a _ { t - 1 } ^ { k } | w _ { t - 1 } ^ { 1 : K } ) } \Big ) \log \hat { Z } _ { \mathrm { S M C } } ( r ( \epsilon _ { 1 : T } ^ { 1 : K } ) , a _ { 1 : T - 1 } ^ { 1 : K } ) + \nabla \varrho _ { \theta , \phi } \log \hat { Z } _ { \mathrm { S M C } } ( r ( \epsilon _ { 1 : T } ^ { 1 : K } ) , } \end{array}$ a1:K1:T −1 )i. In Figure 5, we demonstrate that the estimator in (31) has much higher variance if we include the first term.
+
+
+Figure 5: $T = 2 0 0$ model described in Section 5.1. Kernel density estimation (KDE) of $\nabla _ { \theta _ { 1 } }$ ELBOSMC evaluated at $\theta _ { 1 } = 0 . 1$ with $K = 1 6$ using 100 samples.
+
+# B PROOFS FOR BIAS & IMPLICATIONS ON THE PROPOSALS
+
+Derivation of (9).
+
+$$
+\begin{array} { r l } & { \displaystyle \mathrm { E L B O } = \int Q ( x ) \log \frac { Z _ { P } P ( x ) } { Q ( x ) } \mathrm { d } x } \\ & { \qquad = \displaystyle \int Q ( x ) \log Z _ { P } \mathrm { d } x - \int Q ( x ) \log \frac { Q ( x ) } { P ( x ) } \mathrm { d } x } \\ & { \qquad = \log Z _ { P } - \mathrm { K L } \left( Q | | P \right) . } \end{array}
+$$
+
+Proof of Claim $I$ . Since $\hat { Z } _ { P } ( x ) \geq 0$ , $Q ( x ) \geq 0$ and $\begin{array} { r } { \int Q ( x ) \hat { Z } _ { P } ( x ) \mathrm { d } x = Z _ { P } } \end{array}$ , we can let the unnormalized target density in Definition 1 be $\tilde { P } ( x ) = Q ( x ) \hat { Z } _ { P } ( x )$ . Hence, the normalized target density is $P ( x ) = Q ( x ) \hat { Z } _ { P } ( x ) / Z _ { P }$ . Substituting these quantities into (8) and (9) yields the two equalities in (10). □
+
+Proof of Proposition $^ { l }$ . $( \implies$ ) Substituting for $Q _ { \mathrm { I S } } ( x ^ { 1 : K } ) = P _ { \mathrm { I S } } ( x ^ { 1 : K } )$ , we obtain
+
+$$
+\begin{array} { l } { \displaystyle \prod _ { k = 1 } ^ { K } q ( x ^ { k } | y ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \frac { \prod _ { \ell = 1 } ^ { K } q ( x ^ { \ell } | y ) } { q ( x ^ { k } | y ) } p ( x ^ { k } | y ) } \\ { \displaystyle \qquad = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \left[ q ( x ^ { 1 } | y ) \cdot \cdot \cdot q ( x ^ { k - 1 } | y ) p ( x ^ { k } | y ) q ( x ^ { k + 1 } | y ) \cdot \cdot \cdot q ( x ^ { K } | y ) \right] . } \end{array}
+$$
+
+Integrating both sides with respect to $( x ^ { 2 } , \ldots , x ^ { K } )$ over the whole support (i.e. marginalizing out everything except $x ^ { 1 }$ ), we obtain:
+
+$$
+q ( x ^ { 1 } | y ) = { \frac { 1 } { K } } \left[ p ( x ^ { 1 } | y ) + \sum _ { k = 2 } ^ { K } q ( x ^ { 1 } | y ) \right] .
+$$
+
+Rearranging gives us $q ( x ^ { 1 } | y ) = p ( x ^ { 1 } | y )$ for all $x ^ { 1 }$ .
+
+( $\Longleftarrow )$ Substituting $p ( x ^ { k } | y ) = q ( x ^ { k } | y )$ , we obtain
+
+$$
+\begin{array} { l } { \displaystyle P _ { \mathrm { I S } } ( \boldsymbol { x } ^ { 1 : K } ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \frac { Q _ { \mathrm { I S } } ( \boldsymbol { x } ^ { 1 : K } ) } { q ( \boldsymbol { x } ^ { k } | \boldsymbol { y } ) } p ( \boldsymbol { x } ^ { k } | \boldsymbol { y } ) } \\ { \displaystyle ~ = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } Q _ { \mathrm { I S } } ( \boldsymbol { x } ^ { 1 : K } ) } \\ { \displaystyle ~ = Q _ { \mathrm { I S } } ( \boldsymbol { x } ^ { 1 : K } ) . } \end{array}
+$$
+
+Proof of Proposition 2. We consider the general sequence of target distributions $\pi _ { t } ( x _ { 1 : t } )$ $( p _ { \theta } ( x _ { 1 : t } | y _ { 1 : t } )$ in the case of SSMs), their unnormalized versions $\gamma _ { t } ( x _ { 1 : t } \bar { ) } \left( p _ { \theta } ( x _ { 1 : t } , y _ { 1 : t } ) \right.$ in the case of SSMs), their normalizing constants $\begin{array} { r } { Z _ { t } = \int \gamma _ { t } ( x _ { 1 : t } ) \mathrm { d } x _ { 1 : t } } \end{array}$ $( p _ { \theta } ( y _ { 1 : t } )$ in the case of SSMs), where $Z = Z _ { T } = p ( y _ { 1 : T } )$ .
+
+$( \Longrightarrow )$ ) It suffices to show that $\hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = Z$ for all $( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ implies 1 and 2 in Proposal 2 due to equation (11).
+
+We first prove that $\hat { Z } _ { \mathrm { S M C } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = Z$ for all $( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ implies that the weights
+
+$$
+\begin{array} { l } { { w _ { 1 } ( x _ { 1 } ) : = \displaystyle \frac { \gamma _ { 1 } ( x _ { 1 } ) } { q _ { 1 } ( x _ { 1 } ) } } } \\ { { w _ { t } ( x _ { 1 : t } ) : = \displaystyle \frac { \gamma _ { t } ( x _ { 1 : t } ) } { \gamma _ { t - 1 } ( x _ { 1 : t - 1 } ) q _ { t } ( x _ { t } | x _ { 1 : t - 1 } ) } \qquad \mathrm { f o r } t = 2 , \ldots , T } } \end{array}
+$$
+
+are constant with respect to $x _ { 1 : t }$
+
+Pick sets $t \in \{ 1 , \ldots , T \}$ $k , \ell \in \{ 1 , \dots , K \}$ Also, pick , illustrate $x _ { 1 : t }$ and Figu $x ^ { \prime } { _ { 1 : t } }$ . Now, consider twosuch that $( \bar { x } _ { 1 : T } ^ { 1 : K } , \bar { a } _ { 1 : T - 1 } ^ { 1 : K } )$ $( \tilde { x } _ { 1 : T } ^ { 1 : K } , \tilde { a } _ { 1 : T - 1 } ^ { 1 : K } )$
+
+$$
+\bar { x } _ { \tau } ^ { \kappa } = \left\{ \begin{array} { l l } { x ^ { \prime } { } _ { \tau } } & { \mathrm { ~ i f ~ } \kappa = \ell \mathrm { ~ a n d ~ } { } \tau < t } \\ { x ^ { \prime } { } _ { \tau } } & { \mathrm { ~ i f ~ } ( \kappa , \tau ) = ( k , t ) } \\ { x _ { \tau } } & { \mathrm { ~ i f ~ } \kappa = k \mathrm { ~ a n d ~ } { } \tau < t } \\ { x _ { \tau } ^ { \kappa } } & { \mathrm { ~ o t h e r w i s e } } \end{array} \right.
+$$
+
+$$
+\mathrm { f o r } \tau = 1 , \dots , T , \kappa = 1 , \dots , K ,
+$$
+
+$$
+{ \bar { a } } _ { \tau } ^ { \kappa } = \left\{ { \begin{array} { l l } { \ell } & { { \mathrm { ~ i f ~ } } ( \kappa , \tau ) = ( k , t - 1 ) { \mathrm { ~ o r ~ } } ( k , t ) } \\ { \kappa } & { { \mathrm { ~ o t h e r w i s e } } } \end{array} } \right.
+$$
+
+$$
+\mathrm { f o r } \tau = 1 , \dots , T - 1 , \kappa = 1 , \dots , K ,
+$$
+
+$$
+\tilde { x } _ { \tau } ^ { \kappa } = \left\{ \begin{array} { l l } { x _ { \tau } ^ { \prime } } & { \mathrm { ~ i f ~ } \kappa = \ell \mathrm { ~ a n d ~ } \tau < t } \\ { x _ { \tau } } & { \mathrm { ~ i f ~ } ( \kappa , \tau ) = ( k , t ) } \\ { x _ { \tau } } & { \mathrm { ~ i f ~ } \kappa = k \mathrm { ~ a n d ~ } \tau < t } \\ { x _ { \tau } ^ { \kappa } } & { \mathrm { ~ o t h e r w i s e ~ } } \end{array} \right.
+$$
+
+$$
+\mathfrak { r } \tau = 1 , \dots , T , \kappa = 1 , \dots , K ,
+$$
+
+$$
+\tilde { \boldsymbol { a } } _ { \tau } ^ { \kappa } = \left\{ \begin{array} { l l } { \ell } & { \mathrm { i f } \left( \kappa , \tau \right) = \left( k , t \right) } \\ { \boldsymbol { \kappa } } & { \mathrm { o t h e r w i s e } } \end{array} \right.
+$$
+
+
+Figure 6: (Left) particle set $( \bar { x } _ { 1 : T } ^ { 1 : K } , \bar { a } _ { 1 : T - 1 } ^ { 1 : K } )$ and (right) particle set $( \tilde { x } _ { 1 : T } ^ { 1 : K } , \tilde { a } _ { 1 : T - 1 } ^ { 1 : K } )$ . Lines indicate ancestor indices.
+
+The weights $\bar { w } _ { \tau } ^ { \kappa }$ and $\tilde { w } _ { \tau } ^ { \kappa }$ for the respective particle sets are identical except when $( \tau , \kappa ) = ( t , k )$ where
+
+$$
+\begin{array} { r } { \bar { w } _ { t } ^ { k } = w _ { t } ( x _ { 1 : t } ^ { \prime } ) , } \\ { \tilde { w } _ { t } ^ { k } = w _ { t } ( x _ { 1 : t } ) . } \end{array}
+$$
+
+Since $\hat { Z } ( \bar { x } _ { 1 : T } ^ { 1 : K } , \bar { a } _ { 1 : T - 1 } ^ { 1 : K } ) = \hat { Z } ( \tilde { x } _ { 1 : T } ^ { 1 : K } , \tilde { a } _ { 1 : T - 1 } ^ { 1 : K } )$ , we have $w _ { t } ( x ^ { \prime } _ { 1 : t } ) = w _ { t } ( x _ { 1 : t } )$ . As this holds for any arbitrary $t$ and $x _ { 1 : t }$ , it follows that $w _ { t } ( x _ { 1 : t } )$ must be constant with respect to $x _ { 1 : t }$ for all $t = 1 , \dots , T$ .
+
+Now, for $x _ { 1 : t }$ , consider the implied proposal by rearranging (41) and (42)
+
+$$
+\begin{array} { r l } { q _ { 1 } ( x _ { 1 } ) = \frac { \gamma _ { 1 } ( x _ { 1 } ) } { w _ { 1 } } } \\ { q _ { t } ( x _ { t } | x _ { 1 : t - 1 } ) = \frac { \gamma _ { t } ( x _ { 1 : t } ) } { \gamma _ { t - 1 } ( x _ { 1 : t - 1 } ) w _ { t } } \qquad } & { \mathrm { f o r } t = 2 , \dots , T , } \end{array}
+$$
+
+where $w _ { t } : = w _ { t } ( x _ { 1 : t } )$ is constant from our previous results. For this to be a normalized density with respect to $x _ { t }$ , we must have
+
+$$
+w _ { 1 } = \int \gamma _ { 1 } ( x _ { 1 } ) \mathrm { d } x _ { 1 } = Z _ { 1 } ,
+$$
+
+and for $t = 2 , \ldots , T$ :
+
+$$
+\begin{array} { r l } & { w _ { t } = \displaystyle \int \frac { \gamma _ { t } \big ( x _ { 1 : t } \big ) } { \gamma _ { t - 1 } \big ( x _ { 1 : t - 1 } \big ) } \mathrm { d } x _ { t } } \\ & { \quad = \displaystyle \frac { \int \gamma _ { t } \big ( x _ { 1 : t } \big ) \mathrm { d } x _ { t } } { \gamma _ { t - 1 } \big ( x _ { 1 : t - 1 } \big ) } } \\ & { \quad = \displaystyle \frac { Z _ { t } } { Z _ { t - 1 } } \cdot \frac { \int \pi _ { t } \big ( x _ { 1 : t } \big ) \mathrm { d } x _ { t } } { \pi _ { t - 1 } \big ( x _ { 1 : t - 1 } \big ) } . } \end{array}
+$$
+
+Since $\textstyle \int \pi _ { t + 1 } ( x _ { 1 : t + 1 } ) \mathrm { d } x _ { t + 1 }$ and $\pi _ { t } ( x _ { 1 : t } )$ are both normalized densities, we must have $\pi _ { t } ( x _ { 1 : t } ) =$ $\textstyle \int \pi _ { t + 1 } ( x _ { 1 : t + 1 } ) \mathrm { d } x _ { t + 1 }$ for all $t = 1 , \dots , T - 1$ for all $x _ { 1 : t }$ . For a given $t \in \{ 1 , \ldots , T - 1 \}$ and $x _ { 1 : t }$ , applying this repeatedly yields
+
+$$
+\tau _ { t } ( x _ { 1 : t } ) = \int \pi _ { t + 1 } ( x _ { 1 : t + 1 } ) \mathrm { d } x _ { t + 1 } = \int \int \pi _ { t + 2 } ( x _ { 1 : t + 2 } ) \mathrm { d } x _ { t + 2 } \mathrm { d } x _ { t + 1 } = \cdot \cdot = \int \pi _ { T } ( x _ { 1 : T } ) \mathrm { d } x _ { t + 1 : T } ,
+$$
+
+such that each $\pi _ { t } ( x _ { 1 : t } )$ must be the corresponding marginal of the final target. We also have
+
+$$
+\begin{array} { r l r } & { w _ { 1 } ( x _ { 1 } ) = Z _ { 1 } , } \\ & { w _ { t } ( x _ { 1 : t } ) = \displaystyle \frac { Z _ { t } } { Z _ { t - 1 } } , } & { t = 2 , \ldots , T , } \\ & { q _ { 1 } ( x _ { 1 } ) = \pi _ { 1 } ( x _ { 1 } ) = \pi _ { T } ( x _ { 1 } ) , } \\ & { q _ { t } ( x _ { t } | x _ { 1 : t - 1 } ) = \displaystyle \frac { \pi _ { t } ( x _ { 1 : t } ) } { \pi _ { t - 1 } ( x _ { 1 : t - 1 } ) } = \displaystyle \frac { \pi _ { T } ( x _ { 1 : t } ) } { \pi _ { T } ( x _ { 1 : t - 1 } ) } , } & { t = 2 , \ldots , T . } \end{array}
+$$
+
+( $\Longleftarrow )$ To complete the proof, we now simply substitute identities in 1 and 2 of Proposal 2 back to the expression of $\hat { Z } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } )$ to obtain $\bar { \hat { Z } } ( x _ { 1 : T } ^ { 1 : K } , a _ { 1 : T - 1 } ^ { 1 : K } ) = Z$ . □
+
+# C EXPERIMENTS
+
+# C.1 VRNN
+
+In the following we give the details of our VRNN architecture. The generative model is given by:
+
+$$
+p ( x _ { 1 : T } , h _ { 0 : T } , y _ { 1 : T } ) = p ( h _ { 0 } ) \prod _ { t } p ( x _ { t } | h _ { t - 1 } ) p ( y _ { t } | h _ { t - 1 } , x _ { t } ) p ( h _ { t } | h _ { t - 1 } , x _ { t } , y _ { t } )
+$$
+
+where
+
+$$
+\begin{array} { r } { p ( h _ { 0 } ) = \mathrm { N o r m a l } ( h _ { 0 } ; 0 , I ) \qquad } \\ { p ( x _ { t } | h _ { t - 1 } ) = \mathrm { N o r m a l } ( x _ { t } ; \mu _ { \theta } ^ { x } ( h _ { t - 1 } ) , \sigma _ { \theta } ^ { x } ( h _ { t - 1 } ) ^ { 2 } ) } \\ { p ( y _ { t } | h _ { t - 1 } , x _ { t } ) = \mathrm { B e r n o u l l i } ( y _ { t } ; \mu _ { \theta } ^ { y } ( \varphi _ { \theta } ^ { x } ( x _ { t } ) , h _ { t - 1 } ) ) } \\ { p ( h _ { t } | h _ { t - 1 } , x _ { t } , y _ { t } ) = \delta _ { f ( h _ { t - 1 } , \varphi _ { \theta } ^ { x } ( x _ { t } ) , \varphi _ { \theta } ^ { y } ( y _ { t } ) ) } ( h _ { t } ) } \end{array}
+$$
+
+and the proposal distribution is given by
+
+$$
+p ( x _ { t } | y _ { t } , h _ { t - 1 } ) = \mathrm { N o r m a l } ( x _ { t } ; \mu _ { \phi } ^ { p } ( \varphi _ { \phi } ^ { y } ( y _ { t } ) , h _ { t - 1 } ) , \sigma _ { \phi } ^ { p 2 } ( \varphi _ { \phi } ^ { y } ( y _ { t } ) , h _ { t - 1 } ) )
+$$
+
+The functions $\mu _ { \theta } ^ { x }$ and $\sigma _ { \theta } ^ { x }$ are computed by networks with two fully connected layers of size 128 whose first layer is shared. $\varphi _ { \theta } ^ { x }$ is one fully connected layer of size 128.
+
+For visual input, the encoding $\varphi _ { \theta } ^ { y }$ is a convolutional network with conv-4x4-2-1-32, conv-4x4-2-1-64, conv-4x4-2-1-128 where conv-wxh-s-p-n denotes a convolutional network with $n$ filters of size $w \times h$ , stride $s$ , padding $p$ . Between convolutions we use leaky ReLUs with slope 0.2 as nonlinearity and batch norms. The decoding $\mu _ { \boldsymbol { \theta } } ^ { y }$ uses transposed convolutions of the same dimensions but in reversed order, however with stride $s = 1$ and padding $p = 0$ for the first layer.
+
+A Gated Recurrent Unit (GRU) is used as RNN and if not stated otherwise ReLUs are used in between fully connected layers.
+
+For the proposal distribution, the functions $\mu _ { \phi } ^ { p }$ and $\sigma _ { \phi } ^ { p }$ are neural networks with three fully connected layers of size 128 that are sharing the first two layers. Sigmoid and softplus functions are used where values in $( 0 , 1 )$ or $\mathbb { R } ^ { + }$ are required. We use a minibatch size of 25.
+
+For the moving agents dataset we use ADAM with a learning rate of $1 0 ^ { - 3 }$ .
+
+A specific feature of the VRNN architecture is that the proposal and the generative model share the component $\varphi _ { \phi , \theta } ^ { y }$ . Consequently, we set $\phi = \theta$ for the parameters belonging to this module and train it using gradients for both and $\phi$ .
+
+# C.2 MOVING AGENTS
+
+In Figure 7 we investigate the quality of the generative model by comparing visual predictions. We do so for models learned by IWAE $( t o p )$ and AESMC (bottom). The models were learned using ten particles but for easier visualization we only predict using five particles.
+
+The first row in each graphic shows the ground truth. The second row shows the averaged predictions of all five particles. The next five rows show the predictions made by each particle individually.
+
+The observations (i.e. the top row) up to $t = 1 9$ are shown to the model. Up to this timestep the latent values $x _ { \mathrm { 0 : 1 9 } }$ are drawn from the proposal distribution $q ( x _ { t } | y _ { t } , h _ { t - 1 } )$ . From $t = 2 0$ onwards the latent values $x _ { 2 0 : 3 7 }$ are drawn from the generative model $p ( x _ { t } | x _ { t - 1 } )$ . Consequently, the model predicts the partially occluded, stochastic movement over 17 timesteps into the future.
+
+We note that most particles predict a viable future trajectory. However, the model learned by IWAE is not as consistent in the quality of its predictions, often ’forgetting’ the particle. This does not happen in every predicted sequence but the behavior shown here is very typical. Models learned by AESMC are much more consistent in the quality of their predictions.
+
+# C.3 OPTIMIZING ONLY PROPOSAL PARAMETERS
+
+We have run experiments where we optimize various ELBO objectives with respect to $\phi$ with $\theta$ fixed in order to see how various objectives have an effect on proposal learning. In particular, we train $_ { \mathrm { E L B O _ { I S } } }$ and $\mathrm { E L B O } _ { \mathrm { S M C } }$ with number of particles $K \in \{ 1 0 , 1 0 0 , 1 0 0 0 \}$ . Once the training is done, we use the trained proposal network to perform inference using both IS and SMC with number of particles $K _ { \mathrm { t e s t } } \in \{ 1 0 , 1 0 0 , 1 0 0 0 \}$ .
+
+In Figure 8, we see experimental results for the LGSSM described in Section 5.1. We measure the quality of the inference network using a proxy $\begin{array} { r } { \sqrt { \sum _ { t = 1 } ^ { T } ( \mu _ { t } ^ { \mathrm { k a l m a n } } - \mu _ { t } ^ { \mathrm { a p p r o x } } ) ^ { 2 } } } \end{array}$ where $\mu _ { t } ^ { \mathrm { k a l m a n } }$ is the true marginal mean $\mathbb { E } _ { p ( x _ { 1 : T } | y _ { 1 : T } ) } [ x _ { t } ]$ obtained from the Kalman smoothing algorithm and $\begin{array} { r } { \mu _ { t } ^ { \mathrm { a p p r o x } } = \left( \sum _ { k = 1 } ^ { K } w _ { T } ^ { k } x _ { t } \right) / \left( \sum _ { k = 1 } ^ { K } w _ { T } ^ { k } \right) } \end{array}$ is an approximate marginal mean obtained from the proposal parameterized by $\phi$ .
+
+
+Figure 7: Visualisation of the learned model. Ground truth observations (top row in each sub figure) are only revealed to the algorithm up until $_ { \mathrm { t = } 1 9 }$ inclusive. The second row shows the prediction averaged over all particles, all following rows show the prediction made by a single particle. (Top) IWAE. (Bottom) AESMC.
+
+We see that if we train using ELBOSMC with $K _ { \mathrm { t r a i n } } = 1 0 0 0$ , the performance for inference using SMC (with whichever $K _ { \mathrm { t e s t } } \in \{ 1 0 , 1 0 0 , 1 0 0 0 \} )$ is worse than if we train with $\mathrm { E L B O _ { I S } }$ with any number of particles $K _ { \mathrm { t r a i n } } \in \{ 1 0 , 1 0 0 , 1 0 0 0 \}$ . Examining the other axes of variation:
+
+• Increasing $K _ { \mathrm { t e s t } }$ (moving up in Figure 8 (Right)) improves inference. • Increasing $K _ { \mathrm { t r a i n } }$ (moving to the right in Figure 8 (Right)) worsens inference. • Among different possible combinations of (training algorithm, testing algorithm), (IS, SMC) $\begin{array} { r } { \succ ( \mathrm { S M C } , \mathrm { S M C } ) \succ ( \mathrm { I S } , \mathrm { I S } ) \succ ( \mathrm { S M C } , \mathrm { I S } ) , } \end{array}$ where we use “ $\mathbf { \boldsymbol { a } } \succ \mathbf { \boldsymbol { b } } ^ { \prime }$ to denote that the combination $a$ results in better inference than combination $b$ .
+
+
+
+Figure 8: (Left) Optimizing ELBO with respect to $\phi$ for LGSSM. (Right) The lengths of the squares are proportional (with a constant factor) to $\begin{array} { r } { \sqrt { \sum _ { t = 1 } ^ { T } ( \mu _ { t } ^ { \mathrm { k a l m a n } } - \mu _ { t } ^ { \mathrm { a p p r o x } } ) ^ { 2 } } } \end{array}$ which is a proxy for inference quality of $\phi$ described in the main text. The larger the square, the worse the inference.
\ No newline at end of file
diff --git a/md/train/BJfguoAcFm/BJfguoAcFm.md b/md/train/BJfguoAcFm/BJfguoAcFm.md
new file mode 100644
index 0000000000000000000000000000000000000000..e15d8fafb5e8adb9e4aac59a81737d5198e394d7
--- /dev/null
+++ b/md/train/BJfguoAcFm/BJfguoAcFm.md
@@ -0,0 +1,398 @@
+# LEARNING KOLMOGOROV MODELS FOR BINARY RANDOM VARIABLES
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We propose a framework for learning a Kolmogorov model, for a collection of binary random variables. More specifically, we derive conditions that link (in the sense of implications in mathematical logic) outcomes of specific random variables and extract valuable relations from the data. We also propose an efficient algorithm for computing the model and show its first-order optimality, despite the combinatorial nature of the learning problem. We exemplify our general framework to recommendation systems and gene expression data. We believe that the work is a significant step toward interpretable machine learning.
+
+# 1 INTRODUCTION
+
+Machine learning and artificial intelligence method have permeated a large number of areas (Marr, Sept 2016). These methods are based on machine learning models, which consist of learning an input-output mapping for a given dataset. Despite the plethora of such models (e.g., matrix factorization (Koren et al., 2009), SVD-based models (Koren, 2008), deep neural networks (LeCun et al., 2015), and models inspired from physics (Stark, 2016b)), they lack interpretability: they are not capable of offering insight about the data, nor the underlying process. The lack of interpretablity may have serious consequences in mission-critical systems, ethics, and validation of computeraided diagnosis (Doshi-Velez & Kim, 2017). While there is no consensus around the definition of interpretability, causality (Lipton, 2016) is a vital component: it refers to causal relations within the data and insight about the underlying data-generating process. We thus adopt a generalized version of causality using implication in mathematical logic as our ‘definition’ of interpretable models.
+
+To this end, we propose learning a so-called Kolmogorov Model (KM) associated with a set of binary Random Variables (RVs). In addition to prediction, the interpretability of the model (as defined above) enables learning causal relations.1 We derive a sufficient condition under which the realization of one RV’s outcome (causally) implies the outcome of the other. In the context of recommendation systems, causal relations identify groups of items, for which a user liking one item implies that he/she likes all other items in the group. In gene expression analysis, the same relations identify groups of DNA locations for which the expression of a gene in one of them implies its expression in all other locations. The foundation of our approach is to model binary RVs as elementary events on a Kolmogorov space, by an inner product of two vectors (formally stated in Section 2.1), which is based on established results from classical probability theory. To our best knowledge, this specific formulation is novel in the context of learning representation.
+
+The inner product of our formulation is reminiscent of factorization methods such as, matrix factorization (Koren, 2008), non-negative matrix factorization (Lee & Seung, 2001), SVD (Cai et al., 2010), and physics-inspired techniques, non-negative models (Stark, 2016a). It should be noted that the inner product components of these methods is usually based on strong intuition about the data, provided and validated by a human expert. In contrast, the proposed KM is a fully automated approach, deeply rooted in probability theory, which finds an interpretable model (as defined above) of the data without any human intervention. Thus, both the model and the causal relations within the data have a strong mathematical basis. Moreover, in most of the existing approaches, we may need to have one pipeline for learning the representation and another one for mining these relations. However, our approach requires only a single pipeline for both tasks. This is very appealing on a conceptual level, and it can drastically simplify coding and validation. Our method also generalizes K-means and some of its variants. Detailed discussions of the relation between our proposed method and these prior works is in Appendix A.3.
+
+In an abstract sense, we formulate a KM learning problem as a coupled combinatorial program, decompose it into two subproblems using the Block-Coordinate Descent (BCD) method, and obtain provably optimal solutions for both. For the first one, we exploit the structure of linear programs on the unit simplex and use low-complexity (yet optimal) Frank-Wolfe algorithm (Frank & Wolfe, 1956). To bypass the inherent complexity of the second subproblem (combinatorial and NP-hard), we propose a semidefinite relaxation, and show its quasi-optimality in recovering the optimal solution of the combinatorial subproblem. Finally, we show the convergence of our algorithm to a stationary point of the original problem. We propose a simple algorithm for mining the causal relations. All the proofs and additional discussions are available in Authors (Oct 2017).
+
+# 2 SYSTEM MODEL
+
+Notation: Lowercase letter $a$ , uppercase bold letter $\pmb { A }$ , and calligraphic letter $\mathcal { A }$ denote vectors, matrices, and sets, respectively. $[ A ] _ { i , j }$ and $A ^ { T }$ denote element $( i , j )$ and the transpose of $\pmb { A }$ . $\operatorname { s u p p } ( a )$ denotes the support set of $\textbf { \em a }$ . The inequality $\mathbf { \Delta } x \leq \mathbf { \Delta } y$ holds element-wise. $\pmb { I }$ denotes the identity matrix, 1 and 0 the all-one and all-zero vectors (of appropriate dimension). $e _ { n }$ is the $n$ th elementary basis, $\mathcal { P } = \{ \pmb { p } \in \mathbb { R } _ { + } ^ { D } \ | \ \mathbf { 1 } ^ { T } \pmb { p } = 1 \}$ the unit simplex, and ${ \bar { \{ n \} } } : = \{ 1 , \cdots , n \}$ .
+
+# 2.1 PROBLEM FORMULATION
+
+Consider a double-indexed set of binary Random Variables $( R V s )$ , $X _ { u , i } \in \mathcal { A } = \{ 1 , 2 \}$ , taken from a dataset $\mathcal { D } = \{ ( u , i ) \mid ( u , i ) \in \mathcal { U } \times \mathcal { \bar { Z } } \}$ . Each RV is defined on a sample space $\Omega$ , consisting of elementary events $\Omega = \{ \omega _ { d } \mid 1 \leq d \leq D \}$ . We denote by $\mathbb { P } [ X _ { u , i } = z ]$ , $z \in { \mathcal { A } }$ , the probability that RV $X _ { u , i }$ takes the value $z \in { \mathcal { A } }$ ; see example in Section 2.2. Since $X _ { u , i }$ is binary, it is fully characterized by considering one outcome. Thus, we write the Kolmogorov Model $( K M )$ for $X _ { u , i }$ as
+
+$$
+\mathrm { K M : } \quad \mathbb { P } [ X _ { u , i } = 1 ] = \pmb { \theta } _ { u } ^ { T } \pmb { \psi } _ { i } .
+$$
+
+Thus, each RV $X _ { u , i }$ is associated with (characterized by) a Probability Mass Function $( P M F )$ $\theta _ { u } , u \in \mathcal { U }$ , and an indicator vector $\psi _ { i } , i \in \mathcal { T }$ . The model follows from established results in classical probability theory (Kolmogorov, 1957),(Gray, 2009) (formalized in Appendix A.2). Notice that the model in (1) can approximate with arbitrarily small accuracy the measure corresponding to $\mathbb { P } [ \cdot ]$ for a large enough $D$ .
+
+Problem 1 (Problem Statement) Let $p _ { u , i }$ denote the empirical value of $\mathbb { P } [ X _ { u , i } = 1 ]$ . We assume that $\{ p _ { u , i } \}$ are known for elements of a training set $\kappa \subseteq \mathcal { D }$ , where $\mathcal { K } = \{ ( u , i ) | ( u , i ) \in \mathcal { U } \times \mathcal { T } \}$ . 2 Given samples coming from the model in (1), we wish to infer the parameters of underlying probability distribution: find parameters of the KM, i.e., $\{ \psi _ { i } , \pmb \theta _ { u } \}$ that best describe $\{ p _ { u , i } ~ | ~ ( \bar { u } , i ) \bar { \in } \mathcal { K } \}$ . The resulting problem is a fully parametric statistical inference task. For tractability, we address it using the minimum mean-squared error as a point estimator. The corresponding optimization problem is
+
+$$
+\begin{array} { r } { ( Q ) : \quad \{ \psi _ { i } ^ { \star } , \theta _ { u } ^ { \star } \} \in \left\{ \begin{array} { l l } { \displaystyle \operatorname { a r g m i n } _ { \{ \psi _ { i } \} , \{ \theta _ { u } \} } \sum _ { ( u , i ) \in { \mathcal K } } \left( \theta _ { u } ^ { T } \psi _ { i } - p _ { u , i } \right) ^ { 2 } \triangleq { \mathcal E } ( \{ \psi _ { i } \} , \{ \theta _ { u } \} ) } \\ { \mathrm { s . ~ t . ~ } \theta _ { u } \in { \mathcal P } \mathrm { ~ , ~ } \psi _ { i } \in { \mathbb B } ^ { D } , \forall ( u , i ) \in { \mathcal K } } \end{array} \right. \ . } \end{array}
+$$
+
+We present our solution to this coupled non-convex conspiratorial optimization in the next section. The obtained solution to $( Q )$ can be used for prediction on a test set, as well as extracting causality structures within training set (see Section 4).
+
+Proposed Approach: While the proposal to model binary RVs as elementary events on a Kolmogorov space is based on established results, the specific learning formulation (Problem 1) is novel. Because this model is rooted in probability theory, (1) defines the outcome of a RV in the strict Kolmogorov sense, and the resulting causal relations (Section 4) also hold from a strict analytical perspective. Note that causal relations (a.k.a. association rules) may still be extracted using existing methods, e.g., (non-negative) Matrix Factorization (MF) and their variants, SVD, binary MF, and K-means. However, these relations are not based on causality and the formal relations that (mathematically) follow from the KM in (1), but rather on intuitions/heuristics, which may yield different relations. Naturally, we wish the explore further in this work the causal relations that arise from the proposed model. Additionally, unlike existing methods, the prediction and causal relations mining are done in ’one-shot’, thereby simplifying the implementation/validation; see Appendix A.3.
+
+# 2.2 ILLUSTRATIVE EXAMPLE: RECOMMENDATION SYSTEMS
+
+In this context, $\mathcal { U }$ and $\mathcal { T }$ denote the set of users and items respectively, and $X _ { u , i }$ models the preference of user $u$ for item $i$ , $( u , i ) \in \mathcal { K }$ . Thus, $\mathbb { P } [ X _ { u , i } = 1 ]$ (or $\mathbb { P } [ X _ { u , i } = 2 ]$ ) is the probability that user $u$ likes (or dislikes) item $i$ . Moreover, $\theta _ { u }$ determines the profile/taste of user $u$ , $\psi _ { i }$ is related to item $i$ (depending on genre, price, etc.), and the elementary events denote movie genres (e.g., $\omega _ { 1 } =$ “Action”, $\omega _ { 2 } = { } ^ { \mathrm { 6 5 } } \mathrm { s c i F i } ^ { \mathrm { 3 } }$ , etc.). The training set, consisting of an empirical probability that user $\cdot$ likes item $i$ , $\cdot$ . We obtain this probability using $\_$ , where $\cdot$ denotes the rating that user $u$ has provided for item $i$ , and $R _ { \mathrm { m a x } }$ the maximum rating (Stark, 2015). For instance, if user $\cdot$ rates item $i$ with a score of $\cdot$ (where the maximum rating is 10), then $\cdot$ ; Other approaches may be used to obtain $\cdot$ depending on the specific application.
+
+As a concrete illustrative example, consider a 10-star “recommendation system”, having 2 users and 2 items. We then find the $D$ -dimensional ( $D = 3$ ) KM factorization to obtain , $\{ \psi _ { i } ^ { \star } \} _ { i = 1 } ^ { 2 }$ and $\lbrace \theta _ { u } ^ { \star } \rbrace _ { u = 1 } ^ { 2 }$ is the size of the Kolmogorov space $\Omega$ , the number of elementary events, and the dimension of the factorization (selected via cross-validation to minimize the test error). Solving $( Q )$ results in finding $\{ \psi _ { i } ^ { \star } \} _ { i = 1 } ^ { 2 }$ and $\lbrace \pmb { \theta } _ { u } ^ { \star } \rbrace _ { u = 1 } ^ { 2 }$ . An example result is given below:
+
+$$
+\underbrace { \left[ 0 . 3 \quad 1 \right] } _ { \{ p _ { u , i } \} } = \left[ \pmb { \theta } _ { 1 } ^ { \star ^ { T } } \Big \{ 0 . 2 \quad 0 . 3 \quad 0 . 5 \Big ] _ { \pmb { \theta } _ { 2 } ^ { \star ^ { T } } } \left[ \underbrace { 0 \quad 1 \quad 1 } _ { \psi _ { 1 } ^ { \star } } \quad \frac \} { \psi _ { 2 } ^ { \star } } \right] \mathrm { B c t i e n } \right]
+$$
+
+To showcase the model’s intuition, note that $p _ { 1 , 1 }$ , the probability that user 1 likes movie 1, is represented as $\psi _ { 1 } ^ { T } \pmb { \theta } _ { 1 }$ . It is thus expressed as convex/stochastic mixture of movie genres, since elementary events are movie genres in this scenario. We underline that this high degree of interpretability is not artificially enforced but rather context-dependent. More generally, a KM represents a set of observed outcomes for RVs as (context-dependent) mixtures of elementary events. The approach consists of learning a (hidden) latent model by jointly optimizing the PMF and binary indicator vectors. Thus, interpreting elements of the indicator vectors as movie genres requires a context-dependent map, from the elements of $\cdot$ to movie genres. Another way to find such an interpretation is when this context-dependent map is known apriori. In this setting, each item is already tagged with its movie genres, and $\cdot$ need not be optimized; Alas, having this context-dependent map comes at the expense of a loss in training/test (see Appendix A.4). However, recall that the primary interest of this work is not this facet of interpretability, but rather by that of the causal relations.
+
+# 3 PROPOSED ALGORITHM
+
+To approach a solution for problem (2), we use the block-coordinate descent $( B C D )$ method to split $( Q )$ into two sub-problems. Here, we derive our solution approach to each. We first refine the current PMF estimation $\pmb { \theta } _ { u }$ , and then that of the indicator $\psi _ { i }$ . Given $\{ \psi _ { i } ^ { ( n ) } \}$ at iteration $n$ , we pose the PMF refinement, $\theta$ -step, as
+
+$$
+\begin{array} { r } { ( Q _ { 1 } ) : \theta _ { u } ^ { ( n + 1 ) } \in \underset { \theta _ { u } \in \mathcal { P } } { \mathrm { a r g m i n } } f ( \theta _ { u } ) \triangleq \theta _ { u } ^ { T } \underbrace { Q _ { u } ^ { ( n ) } } _ { : = \sum _ { i \in \mathcal { Z } _ { K } } \psi _ { i } ^ { ( n ) } \psi _ { i } ^ { ( n ) ^ { T } } } \theta _ { u } - 2 \theta _ { u } ^ { T } \underbrace { r _ { u } ^ { ( n ) } } _ { : = \sum _ { i \in \mathcal { Z } _ { K } } \psi _ { i } ^ { ( n ) } p _ { u , i } } . } \end{array}
+$$
+
+We then pose the indicator vector refinement, $\psi$ -step, as
+
+$$
+\begin{array} { r } { ( Q _ { 2 } ) : \psi _ { i } ^ { ( n + 1 ) } \in \underset { \psi _ { i } \in \mathbb { B } ^ { D } } { \mathrm { a r g m i n } } g ( \psi _ { i } ) \triangleq \psi _ { i } ^ { T } \underbrace { S _ { i } ^ { ( n + 1 ) } } _ { : = \sum _ { u \in \mathcal { U } _ { K } } \theta _ { u } ^ { ( n + 1 ) } \theta _ { u } ^ { ( n + 1 ) T } } \psi _ { i } - 2 \psi _ { i } ^ { T } \underbrace { v _ { i } ^ { ( n + 1 ) } } _ { : = \sum _ { u \in \mathcal { U } _ { K } } \theta _ { u } ^ { ( n + 1 ) } p _ { u , i } } . } \end{array}
+$$
+
+Table 1: $\theta$ -step solution using FW
+
+
function[0*]=FW(Qu,ru,∈) for k=1,2,...,IFw do dk) = ej*, j*=argmin[Vf(0(k)]j
1≤j≤D 0(k+1)=(1-ak) ()0() +a(dk
Stopif|/(+1)-/≤e end for
+
+Table 2: $\psi$ -step solution using SDR
+
+function $[ \hat { \psi } _ { i } ] = \mathrm { S D R } \left( \vphantom { \sum _ { i } } S _ { i } , t _ { i } , M _ { r n d } \right)$ , // Repeat to approximate each $\psi _ { i } ^ { \star } , \forall i \in \mathcal { I } _ { K }$ Solve (5) to find X(SDR)i Factorize as $X _ { i } ^ { ( \mathrm { S D R } ) } = { \pmb { L } } _ { i } ^ { T } { \pmb { L } } _ { i }$ for $m = 1 , 2 , . . . , M _ { r n d }$ do Gen. zero-mean i.i.d Gaussian vector $\pmb { u } _ { i } ^ { ( m ) }$ Compute $\hat { \pmb { u } } _ { i } ^ { ( m ) } = \mathrm { s i g n } [ { \pmb { L } } _ { i } ^ { T } { \pmb { u } } _ { i } ^ { ( m ) } .$ end for $\begin{array} { r } { \mathbf { \Lambda } ^ { m ^ { \star } } = \operatorname * { a r g m i n } _ { 1 \leq m \leq D + 1 } \ \hat { \pmb u } _ { i } ^ { ( m ) ^ { T } } \tilde { \pmb S } _ { i } \hat { \pmb u } _ { i } ^ { ( m ) } } \end{array}$ Compute $\hat { z } _ { i } = [ \pmb { u } _ { i } ^ { ( m ^ { \star } ) } ] _ { 1 : D } ^ { - } [ \pmb { u } _ { i } ^ { ( m ^ { \star } ) } ] _ { D + 1 }$ Approximate $\psi _ { i } ^ { \star }$ , as $\hat { \psi } _ { i } = ( \hat { z } _ { i } + \mathbf { 1 } ) / 2$
+end function
+
+Moreover, $\boldsymbol { \mathcal { U } } _ { K }$ and $\mathcal { T } _ { K }$ are defined as $\mathcal { K } = \{ ( u , i ) \mid u \in \mathcal { U } _ { K } \subseteq \mathcal { U }$ , $i \in \mathcal { T } _ { K } \subseteq \mathcal { T } \}$ . Recall that having globally optimal solutions for both $\left( Q _ { 1 } \right)$ and $\left( Q _ { 2 } \right)$ is necessary to show the convergence of BCD (Tseng, 2001) - a challenging task due to the NP-hardness of $\left( Q _ { 2 } \right)$ .
+
+# 3.1 $\theta$ -STEP: REFINE PMF ESTIMATE
+
+We use the Frank-Wolfe (FW) algorithm (Frank & Wolfe, 1956) to solve $\left( Q _ { 1 } \right)$ as a succession of Linear Programs (LPs) over the unit simplex. While LP solvers generally have similar complexity as quadratic program solvers, solving an LP reduces to searching for the minimum index - which is computationally efficient, when the LP is over the unit simplex. We summarized this FW variant for solving $\left( Q _ { 1 } \right)$ ; see also Jaggi (2013)[Algorithm 1]. Here, we drop the BCD iteration index, $n$ , and just keep the FW iteration number, $k$ , for notation simplicity. We first determine the descent direction: $\begin{array} { r } { \pmb { d } _ { \boldsymbol { u } } ^ { ( k ) } \in \operatorname * { a r g m i n } _ { \boldsymbol { s } \in \mathcal { P } } \left( \nabla f ( \pmb { \theta } _ { \boldsymbol { u } } ^ { ( k ) } ) \right) ^ { T } \boldsymbol { s } } \end{array}$ . The constraint $s \in \mathcal { P }$ greatly simplifies the above LP and yields: $\begin{array} { r } { \pmb { d } _ { u } ^ { ( k ) } = \pmb { e } _ { j ^ { \star } , \_ j } j ^ { \star } \in \mathrm { a r g m i n } _ { 1 \leq j \leq { D } } [ \nabla f ( \pmb { \theta } _ { u } ^ { ( k ) } ) ] _ { j } } \end{array}$ ; see Proposition 2 (Appendix A.6). The solution follows from LPs over the unit probability simplex. Thus, finding the descent direction reduces to searching over the $D$ -dimensional gradient vector (done in $\mathcal { O } ( D ) .$ ). Then, the current value is updated using a simple step size rule, $\alpha _ { u } ^ { ( k ) } = k / ( k + 1 )$ . Table 1 shows the $\theta$ -step solution, and Proposition 3 in Appendix A.6 characterizes its convergence.
+
+# 3.2 $\psi$ -STEP: REFINE INDICATOR ESTIMATE
+
+To address the NP-hard nature of $\left( Q _ { 2 } \right)$ , we propose a solution based on Semi-Definite Relaxation and Randomization $( S D R )$ , and establish its quasi-optimality. We use the results of Ma et al. (2002)[Sec IV-C]) and a series of reformulations to rewrite $\left( Q _ { 2 } \right)$ in the following equivalent form (see Authors (Oct 2017) for all the derivations):
+
+$\begin{array} { r } { \pmb { X } _ { i } ^ { \star } \in \mathrm { a r g m i n } _ { \pmb { X } _ { i } } \mathrm { ~ t r } ( \tilde { S } _ { i } \pmb { X } _ { i } ) , \mathrm { ~ s . ~ t . ~ } \pmb { X } _ { i } \succeq \mathbf { 0 } , [ \pmb { X } _ { i } ] _ { k , k } = 1 , \forall k , \mathrm { r a n k } ( \pmb { X } _ { i } ) = 1 } \end{array}$ where $\pmb { X } _ { i } = \pmb { x } _ { i } \pmb { x } _ { i } ^ { T }$ $\begin{array} { r } { \mathbf { \Xi } _ { i } ^ { T } , \tilde { S } _ { i } = \left[ \begin{array} { c c } { ( 1 / 4 ) S _ { i } } & { - \tilde { t } _ { i } / 2 } \\ { - \tilde { t } _ { i } ^ { T } / 2 } & { 0 } \end{array} \right] , \mathbf { \Psi } _ { x _ { i } } = \left[ \begin{array} { c } { z _ { i } } \\ { w _ { i } } \end{array} \right] , z _ { i } = 2 \psi _ { i } - 1 , w _ { i } \in \{ - 1 , + 1 \} \mathrm { i s } } \end{array}$ an auxiliary variable, and $\tilde { \pmb { t } } _ { i } \triangleq ( \pmb { v } _ { i } - ( 1 / 2 ) \pmb { S } _ { i } \mathbf { 1 } )$ . The problem is then relaxed into a convex program,
+
+$$
+{ \pmb X } _ { i } ^ { ( \mathrm { S D R } ) } \in \ \mathrm { a r g m i n } _ { { \pmb X } _ { i } } \ \mathrm { t r } ( \tilde { S } _ { i } { \pmb X } _ { i } ) , \mathrm { s . t . } \ X _ { i } \succeq { \bf 0 } , [ { \pmb X } _ { i } ] _ { k , k } = 1 , \forall k
+$$
+
+X (SDR)i may be solved using generic solvers. Then, a randomization procedure (Ma et al., 2002) extracts an approximate (binary) solution for $\left( Q _ { 2 } \right)$ ; see Table 2. This evidently raises the issue of the sub-optimality gap for SDR. Based on the results of Tan $\&$ Rasmussen (2001) and Luo et al. (2010), we show in Proposition 4 (see Appendix A.6) that SDR (Table 2) is optimal (asymptotically in $D$ ) in recovering the binary solution of $\left( Q _ { 2 } \right)$ .
+
+We highlight that the performance bound in Proposition 4 compares the quality of both the approximate binary solution offered by SDR (with respect to the optimal binary solution of $( Q _ { 2 } ) )$ ), as well as their respective cost functions. The asymptotic optimality is empirically validated in Appendix A.7.
+
+# 3.3 ALGORITHM DESCRIPTION
+
+The BCD-based algorithm alternates between refining the indicator and PMF vectors; see Algorithm 1.
+Lemma 2 (Appendix A.6) shows its convergence to a stationary point of $( Q )$ .
+
+# Algorithm 1 Iterative computation of KMs
+
+// Randomly Initialize $\{ \pmb { \theta } _ { u } ^ { ( 1 ) } \in \mathcal { P } \}$
+for $n = 1 , 2 , \dots \mathbf { d o }$ Compute S(n)i and $\mathbf { \Delta } \mathbf { \mathbf { \mathbf { t } } } _ { i } ^ { ( n ) }$ using (4) Call $\hat { \psi } _ { i } ^ { ( n ) } = \mathrm { S D R } ( S _ { i } ^ { ( n ) } , t _ { i } ^ { ( n ) } , M _ { r n d } ) , \forall i \in \mathcal { T } _ { K }$ Compute $Q _ { u } ^ { ( n ) }$ and $\boldsymbol { r } _ { u } ^ { ( n ) }$ using (3) // Initialize FW with $\{ \pmb { \theta } _ { u } ^ { ( n - 1 ) } \}$ , from previous iteration Call $\pmb { \theta } _ { u } ^ { ( n ) ^ { \star } } = \mathrm { F W } ( \pmb { Q } _ { u } ^ { ( n ) } , \pmb { r } _ { u } ^ { ( n ) } , \bar { \epsilon } )$ , for all $u \in \mathcal { U } _ { K }$
+end for
+
+# 4 INTERPRETABILITY VIA CAUSAL RELATION
+
+# 4.1 CAUSAL RELATIONS
+
+Once a solution is found using Algorithm 1, here, we propose a method to find causal relations among the RVs. More specifically, we compare the support set of each pair of RVs from the training set, $\cdot$ and $X _ { u , j }$ , and check if there is any ‘overlap’ between their support set. Intuitively, this condition means that some of the elementary events (see Section 2.1) of one RV might be ‘contained’ in the elementary events of another. Consequently, the RVs are mutually related by causality, and the outcome of one determines that of the other. This insight is formalized here.
+
+Proposition 1 (Inclusion of Support Set) Consider two random variables $X _ { u , i }$ and $X _ { u , j }$ (belonging to the training set) whose KM are given by the model in (1). $I f \operatorname { s u p p } ( \psi _ { j } ) \subseteq \operatorname { s u p p } ( \psi _ { i } )$ , then the following two causal relations hold:
+
+$$
+X _ { u , i } = \mathrm { 1 \ i m p l i e s \ } X _ { u , j } = 1 \ , \ \mathrm { a n d \ } X _ { u , j } = 2 \ \mathrm { i m p l i e s \ } X _ { u , i } = 2 .
+$$
+
+Proof: See Authors (Oct 2017) for the proof.
+
+Stated plainly, when the support set condition holds, the first outcome of $X _ { u , i }$ implies the same outcome for $X _ { u , j }$ , and the second outcome for $X _ { u , j }$ implies the second one for $X _ { u , i }$ , thereby implying a mutual causal relation among them (since $X _ { u , i }$ influences $X _ { u , j }$ and vice-versa). Note that our above definition of causality and causal relations is different than conventional ones in Pearl (2009)[Chap 2.8]. Moreover, our definition is distinct from Granger causality, due to the mutual coupling among the RVs in question.
+
+We present next a special case of Proposition 1. When $\psi _ { i } ~ = ~ { \bf 1 }$ , then $\mathsf { s u p p } ( \psi _ { i } ) = \{ D \}$ , and $\operatorname { s u p p } ( \psi _ { j } ) \subseteq \operatorname { s u p p } ( \psi _ { i } )$ holds, for any choice of $\psi _ { j } , \forall j \in \mathcal { I } _ { K }$ , where $\mathcal { T } _ { K }$ defined in Section 3.
+
+Corollary 1 (Maximally Supported RVs) Let $\{ \psi _ { i } , ~ \pmb \theta _ { u } \} _ { ( u , i ) \in \mathcal K }$ denote the KM associated with $\{ \mathbb { P } [ X _ { u , i } = 1 ] \} _ { ( u , i ) \in \mathcal { K } }$ . We define $\mathcal { M }$ as set of RVs for which the support set of the indicator vector is one, i.e., $\mathcal { M } = \{ i \mid \psi _ { i } = { \bf 1 } \}$ . Then, the condition $\operatorname { s u p p } ( \psi _ { j } ) \subseteq \operatorname { s u p p } ( \psi _ { i } )$ (Proposition $^ { l }$ ) holds trivially $\forall j \ \in \mathcal { I } _ { K }$ . Thus, the causal relations in (6) hold, for every $i \in \mathcal { M }$ .
+
+For maximally supported RVs, the realization of one outcome, $X _ { u , i } = 1$ , determines that of all $R V s$ of the set $\{ X _ { u , j } = 1 | \forall j \in \mathbb { Z } _ { K } \}$ .
+
+Example 1 (Causal Relations in Recommendation Systems) In addition to prediction, recommendation systems are designed to accurately mine for association rules: if a user likes item $i$ will he/she like another item $j ?$ Thus, the causal relations of Proposition 1 and Corollary 1 will be quite powerful, as we shall see. In the example of Section 2.2, note that $\operatorname { s u p p } ( \psi _ { 1 } ) \subseteq \operatorname { s u p p } ( \psi _ { 2 } )$ . Then, Proposition 1 yields: if user 1 (or user 2) likes movie 2 implies he/she also likes movie 1. Moreover, $X _ { 1 , 2 }$ and $X _ { 2 , 2 }$ are maximally supported RVs, since $\psi _ { 2 } = { \bf 1 }$ . Thus, Corollary 1 reads: If any user likes item 2, then this causally implies that he/she likes all other items in the training set.
+
+
+Figure 1: Algorithm for CRM (toy example)
+
+Thus, our approach provides association rules that follow from causal relations between different RVs. Consequently, these relations are stricter (as they are rooted in Kolmogorov probability) than other methods for mining association rules, which are not based on causality.
+
+# 4.2 CAUSAL RELATIONS MINING (CRM)
+
+We provide an efficient algorithmic approach to automatically mine the above relations. In a nutshell, the algorithm does a pairwise check of the support set condition (Proposition 1), for pairs of RVs $X _ { u , i }$ and $X _ { u , j }$ , $\forall ( i , j ) \in \mathcal { T } _ { K } \times \mathcal { T } _ { K }$ . The method is illustrated in Figure 1, for the illustrative example of Section 2.2. The above causal relations can be modeled conveniently using the adjacency matrix $A \in \mathbb { B } ^ { | \mathcal { T } _ { K } | \times | \mathcal { T } _ { K } | }$ , defined as
+
+$$
+-
+$$
+
+Stated differently, $[ A ] _ { i , j } = 1$ if the support of $X _ { u , j }$ is contained in that of $X _ { u , i }$ . Note that when $\pmb { A }$ is sparse (resp. dense) is an indication for a dataset in which few (resp. many) casual relations exist. To quantify the sparsity level, we define an influence score, $\beta _ { i } = | \mathcal { T } _ { K } | ^ { \bar { - } 1 } \sum _ { j \in \mathcal { I } _ { K } } [ \pmb { A } ] _ { i , j }$ , which measures the normalized number of pairs $X _ { u , i }$ and $X _ { u , j }$ , satisfying the support set condition. These steps are summarized in the Algorithm 2 (illustrated in Figure 1). Moreover, its complexity is dominated by the pairwise search over $\mathcal { T } _ { K }$ (see Step 1), which comes at $\mathcal { O } ( \vert \mathcal { Z } _ { K } \vert ^ { 2 } - \vert \mathcal { T } _ { K } \vert ) \overset { \cdot } { \approx } \mathcal { O } ( \vert \dot { \mathcal { T } } _ { K } \vert ^ { 2 } )$ operations.
+
+# Algorithm 2 Causal Relations Mining (CRM)
+
+1. Check the support set condition, via a pairwise search to check for pairs $\psi _ { i }$ and $\psi _ { j }$ satisfying $\operatorname { s u p p } ( \psi _ { j } ) \subseteq \operatorname { s u p p } ( \psi _ { i } )$ , $\forall ( i , j ) \in \mathcal { T } _ { K } \times \mathcal { T } _ { K }$ , $i \neq j$ (done over the training set $\kappa$ ) 2. Build the adjacency matrix $\pmb { A }$ , in (7) , and compute the influence score $\beta _ { i }$ , $\forall i \in \mathcal { T } _ { K }$ 3. Find all pairs $( i , j )$ such that $a _ { i , j } = 1$ . For each of these pairs it holds that (Proposition 1), $X _ { u , i }$ and $X _ { u , j }$ are causally related, i.e.,
+
+$$
+X _ { u , i } = 1 { \mathrm { ~ i m p l i e s ~ } } X _ { u , j } = 1 , { \mathrm { ~ a n d ~ } } X _ { u , j } = 1 { \mathrm { ~ i m p l i e s ~ } } X _ { u , i } = 1
+$$
+
+4. Identify (if possible) maximally supported RVs (Corollary 1), $\mathcal { M } = \{ i \mid \psi _ { i } = { \bf 1 } \}$ . For each of them, the relations in (8) hold for all $i \in \mathcal { I } _ { K }$
+
+# 5 SPECIAL CASES AND APPLICATIONS
+
+We highlight relevant special cases and applications of our approach.
+
+Special Case: Unsupervised Learning Setting. Note that Algorithm 1 is equally applicable to an unsupervised learning task (no prediction needed). Moreover, if the training set has no missing data, i.e., $\kappa = \mathcal { D }$ , then an alternate solution to $( Q )$ may be obtained using the binary matrix factorization (MF) (Slawski et al., 2013) method. However, it is not applicable when factorizing a training set $\kappa$ (where $\kappa \subset D$ ). Unlike Algorithm 1, binary MF does not offer prediction.
+
+Application: Analysis of Gene Expression. The ability to analyze gene expression data is critical to DNA research (Zhang et al., 2009). This task can be formulated in our proposed framework as follows: $\mathbb { P } [ X _ { u , i } = \bar { 1 } ]$ denotes the probability that the genes being studied are expressed in sample $u \in \mathcal { U }$ at location $i \in \mathcal { T }$ of the DNA. In this setting, the set Kolmogorov elementary events, $\{ \omega _ { 1 } , \cdot \cdot \cdot , \omega _ { D } \}$ , represents the various genes that might be involved. Consequently, our approach models the probability that a set of genes is expressed as a convex mixture of $D$ various genes. We recall that this intuition follows from our model and is not enforced explicitly. More importantly, the causal relations can identify groups of DNA locations for which the expression of a gene (or its absence) in a given location implies its presence (or its absence) for all other locations in the group. We will numerically show the usefulness of these relations to DNA analysis, in Section 7.2.
+
+
+(a) Normalized Training RMSE vs Itera-(b) Normalized Training RMSE for KM (c) Influence score $\beta _ { i }$ tions (Setting 1) vs NNM (Setting 2) ( $D = 8$ , Setting 2)
+Figure 2: Performance of proposed method
+
+# 6 PRACTICAL CONSIDERATIONS
+
+Overfitting: Regularization parameters (to mitigate overfitting) can be included without any changes to the solution method. An $\ell _ { 2 }$ −regularization can be included in $\left( Q _ { 1 } \right)$ : $f ( \pmb { \theta } _ { u } ) ~ =$ $\pmb { \theta } _ { u } ^ { T } ( \tilde { \pmb { Q } } _ { u } + \lambda _ { u } \pmb { I } _ { D } ) \pmb { \theta } _ { u } - 2 \pmb { \theta } _ { u } ^ { T } \pmb { r } _ { u } + \gamma _ { u }$ , where the regularizer $\lambda _ { u } \geq 0$ is absorbed into a “new” matrix $( Q _ { u } + \lambda _ { u } I _ { D } )$ . Note that an $\ell _ { 1 }$ −regularization for $\theta _ { u }$ would not work, since $\pmb { \theta } _ { u } \in \mathcal { P }$ . Similarly, an $\ell _ { 1 }$ -regularization for $\left( Q _ { 2 } \right)$ is: $g ( \psi _ { i } \bar { ) = } \psi _ { i } ^ { T } S _ { i } \psi _ { i } - 2 ( v _ { i } - ( \mu _ { i } / 2 ) \mathbf { 1 } ) ^ { T } \psi _ { i } + \gamma _ { i }$ , where the regularizer $\mu _ { i } \geq 0$ is absorbed into the linear term, since $\mu _ { i } \| \psi _ { i } \| _ { 1 } = \mu _ { i } \mathbf { 1 } ^ { T } \psi _ { i }$ , for $\psi _ { i }$ binary.
+
+Optimality Gap: We recall that the proposed SDR method was shown to be quasi-optimal in providing approximate binary solutions to $\left( Q _ { 2 } \right)$ . Thus, the relaxation does not affect the interpretability, in the sense that Proposition 1 and Corollary 1 still hold. While the derivations pertaining to causal relations (Section 4) assume globally optimal solutions to $( Q )$ - an NP-hard problem, Algorithm 1 guarantees locally optimal ones. Thus, a bound on the gap between these solutions is needed. We highlight this issue as an interesting topic for further investigation.
+
+# 6.1 LIMITATIONS
+
+Computational Complexity: The computational complexity of Algorithm 1 is dominated by the solution in (5), which is $\cdot$ operations per iteration of Algorithm 1 (recalling the negligible cost of the FW method). Notice that the additional complexity compared to matrix factorization (its extensions), for which the complexity is $\mathcal { O } ( D ^ { 3 } )$ (e.g., $D \leq 1 6$ in all numerical results). Moreover, we are already investigating complexity reduction techniques leveraging the structure of the SDP, and distributed solutions to $\cdot$ to enable parallelization. Finally, the computational complexity of Algorithm 2 consists mainly of step 1, which has $\approx \mathcal { O } ( | \mathcal { T } _ { K } | ^ { 2 } )$ operations.
+
+Learning a non-stationary distribution: The proposed method assumes that distributions of the RVs in the training set are stationary: Indeed, scenarios with time-varying distributions are a limitation (and interesting future directions). However, in learning it is quite common to assume that the datagenerating distribution is stationary.
+
+# 7 NUMERICAL RESULTS
+
+# 7.1 APPLICATION TO RECOMMENDATION SYSTEMS
+
+Experimental Setup: We evaluate the performance of Algorithm 1 under the following. We opted to not have a stopping criterion based on the prediction error of the algorithm (on a validation set), since we are primarily interested in the model that we learn in the training phase. Nonetheless, as we have reported in Appendix A.7, there is not loss in the predictive performance of the model. Hereafter, “Prop.” refers to the proposed method.
+
+Setting 1: An artificial training dataset, where $p _ { u , i } \in \mathcal { K } = \{ U = 2 0 \} \times \{ I = 4 0 \}$ , where $\{ p _ { u , i } \}$ are i.i.d. and uniformly chosen on the unit interval. We benchmark against a variant on Algorithm 1, where the $\psi$ -step for $Q _ { 2 }$ is replaced by an exhaustive search. As the data is artificial (unsupervised learning setting), we include the Binary $M F$ in Slawski et al. (2013)[Algorithm 2].
+
+Setting 2: The training set $\kappa$ , is chosen as the MovieLens 100K, with $U = 9 4 3$ users and $I = 1 6 8 2$ items, split into $8 0 \%$ for training and $2 0 \%$ for testing. Let $\{ \hat { \psi } _ { i } \} , \{ \hat { \theta } _ { u } \}$ the output of Algorithm 1, after 5 iterations. We benchmark against matrix factorization $( M F )$ (Koren et al., 2009), non-negative MF (NMF) (Lee & Seung, 2001), $S V D + +$ (Koren, 2008) (ensuring the dimension of the factorization, $k$ , is close to $D$ ), non-negative models (NNM) Stark (2015), and the $K$ -means $( K { \cdot } M )$ algorithm. The implementation and results use the MyMediaLite package (Gantner et al., 2011).
+
+Training Performance for Unsupervised Learning (Setting 1): Fig 2a shows the resulting normalized training $\begin{array} { r } { \mathrm { R M S E } = ( \sum _ { ( u , i ) \in { \mathcal K } } | p _ { u , i } - \hat { \theta } _ { u } ^ { T } \hat { \psi } _ { i } | ^ { 2 } / | { \cal K } | ) ^ { 1 / 2 } } \end{array}$ . We observe that the monotone convergence in Lemma 2 is validated numerically, and that the training error decays with increasing model size, $D$ . Note that the training performance of Algorithm 1 is indistinguishable from its exhaustive search variant. Moreover, Algorithm 1 converges to solution whose performance is similar to Binary MF, with a few iterations (except for $D = 8$ where Algorithm 1 outperforms Binary MF).
+
+Training Performance for Supervised Learning (Setting 2): Recall that Binary MF is not applicable here, due to the supervised learning setting. The same conclusions hold when testing Algorithm 1 on the ML100K (Figure 2b). We underline that while NNMs yield better training performance over Algorithm 1, the latter will have better test performance (since NNMs are indeed defined by relaxing KMs). In Table 4 (Appendix A.7), we empirically verify that the test performance of the proposed method outperforms the benchmarks in Setting 2.
+
+Interpretability via Causal Relations (Setting 2): We numerically evaluate the relations of Algorithm 2. The influence score for each item in the training set, $\beta _ { i }$ , is shown in Figure 2c where we displayed items with ‘high’ influence score, $\beta _ { i } ~ \geq ~ 0 . 5$ . Note that each of these high influence items is causally related to at least half of the items in the training set. This confirms the effectiveness of Algorithm 2 for finding causal relations, and that a sparse adjacency matrix is uncommon. We next identify the set of items corresponding to maximally supported RVs, M = {119, 814, 1188, 1190, 1290, 1393, 1462, 1486, 1494, 1530, 1590, 1638}. For each of these items, a user liking one given item, implies he/she likes all other items in the training set. Interestingly, these results remain the same when $D = 2 4$ , thereby suggesting that procedure for mining causal relations is quite stable.
+
+# 7.2 APPLICATION TO GENE EXPRESSION
+
+Experimental Setup: Following the problem statement in Section 5, we show the usefulness Algorithm 2 for gene expression. We first define another setting.
+
+Setting 3: We use the REGED0 dataset 3. Element $( u , i )$ in the input matrix, $\cdot$ represents the level of gene expression for sample $\cdot$ at location $i$ of the DNA, and is reported as integer between 0 and $\cdot$ . Similarly to recommendation systems (Section 2.2), the training set is obtained as $\_$ . Thus, $\cdot$ denotes the (empirical) probability that the gene is expressed in sample $u$ at location $\cdot$ . 4 After running Algorithm 1, we use Algorithm 2 to mine causal relations. As this is unsupervised learning setting, we include the binary MF (Slawski et al., 2013) method.
+
+Results: While Fig 3a shows the training performance for several values of $D$ , Figure 3b plots the corresponding influence score that is obtained with our method. Fig 3a reveals a huge gap $\approx 3 \times$ less) between the training error of Algorithm 1 and Binary MF (unlike Figure 2a where both algorithms yield similar performance). This drastic degradation in the performance of binary MF compared to the small artificial of Figure 2a may be attributed to increasing the data/problem size (though we were unable to empirically verify this claim). Thus, we opted to use the solution of Algorithm 1 as
+
+
+Figure 3: Training performance of proposed method for REGED0 dataset
+
+
+(b) Influence score for each DNA location (Setting 3)
+
+(a) Normalized Training RMSE as a function of iterations (Setting 3)
+
+a basis for finding causal relations. We identified 10 DNA locations corresponding to the highest $\beta _ { i }$ as: {813, 250, 774, 706, 380, 49, 477, 162, 740, 702}. For instance, the highest influence score of .1612 at DNA location 813 allowed to identify a set, $s$ , of 161 different locations which are causally related to DNA location 813. More specifically, the expression (or absence) of a given gene in location 813 implies its expression (or absence) in all other DNA locations in $s$ . While similar relations are possible using gene analysis methods, the above causal relations follow from our rigorous mathematical framework.
+
+We also ran experiments on the ML 1M dataset ( $\cdot$ larger that ML 100K) and observed that main conclusions were the same. For lack of space, we instead opted to include different datasets such as the REGED0 dataset $\cdot$ larger than ML 100K) to exemplify another application of the approach. However, we note that a large-scale implementation of the method may be challenging at this stage. As mentioned earlier, we are currently investigating complexity reduction methods before running experiments involving large datasets. Rather, the current work is intended a proof of concept of the usefulness of such an approach.
+
+# 8 CONCLUSION
+
+We have proposed a framework for learning a Kolmogorov model, associated with a collection of binary random variables. Interpretability of the model (as defined by logical implication and causality) was harnessed by deriving causal relations, i.e., by finding sufficient conditions that bind outcomes of certain random variables. We also proposed an algorithm for computing a Kolmogorov model, a combinatorial non-convex problem, and showed its convergence to a stationary point of the problem using results from block-coordinate descent. The combinatorial nature of the problem was addressed using a semi-definite relaxation. We also proposed an efficient algorithm to mine for the causal relations inherent to our model. Our results suggest that increased interpretability and improved prediction, do not cause a significant increase in complexity. We highlight several key issues for future work, e.g., complexity reduction for (5) (leveraging that its dual is piece-wise linear), and a sufficient condition for identifiability (by adapting that of Fu et al. (2017))
+
+# REFERENCES
+
+Anonymous Authors. Learning elementary representations of random variables. Technical Report, Oct 2017. URL https://tinyurl.com/y7gpu4dc.
+
+Jian-Feng Cai, Emmanuel J. Cands, and Zuowei Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2010. doi: 10.1137/ 080738970.
+
+Mark Davenport and Justin Romberg. An overview of low-rank matrix recovery from incomplete observations. IEEE Journal of Selected Topics in Signal Processing, 10(4):608–622, June 2016. ISSN 1932-4553. doi: 10.1109/JSTSP.2016.2539100.
+
+Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv, 2017.
+
+Marguerite Frank and Philip Wolfe. An algorithm for quadratic programming. Naval Research Logistics Quarterly, 3(1-2):95–110, 1956. ISSN 1931-9193.
+
+Xiao Fu, Kejun Huang, and Nicholas D. Sidiropoulos. On identifiability of nonnegative matrix factorization. CoRR, abs/1709.00614, 2017.
+
+Zeno Gantner, Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme. Mymedialite: A free recommender system library. In Proceedings of the Fifth ACM Conference on Recommender Systems, RecSys ’11, pp. 305–308. ACM, 2011. ISBN 978-1-4503-0683-6.
+
+Robert M. Gray. Probability, Random Processes, and Ergodic Properties. Springer, 2nd edition, 2009. ISBN 1441910891, 9781441910899.
+
+Patrik O. Hoyer. Non-negative matrix factorization with sparseness constraints. CoRR, cs.LG/0408058, 2004.
+
+Martin Jaggi. Revisiting Frank-Wolfe: Projection-free sparse convex optimization. In Proceedings of the 30th International Conference on Machine Learning, volume 28, pp. 427–435, 2013.
+
+Andrei Nikolaevich Kolmogorov. On the representation of continuous functions of many variables by superposition of continuous functions of one variable and addition. In Doklady Akademii Nauk, volume 114, pp. 953–956. Russian Academy of Sciences, 1957.
+
+Y. Koren, Robert Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, Aug 2009. ISSN 0018-9162. doi: 10.1109/MC.2009.263.
+
+Yehuda Koren. Factorization meets the neighborhood: A multifaceted collaborative filtering model. In Proceedings of the 14th ACM International Conference on Knowledge Discovery and Data Mining, KDD, pp. 426–434. ACM, 2008. ISBN 978-1-60558-193-4.
+
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521, 2015. doi: 10.1038/nature14539.
+
+Daniel Lee and Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems (NIPS), pp. 556–562. MIT Press, 2001.
+
+Zachary Chase Lipton. The mythos of model interpretability. CoRR, abs/1606.03490, 2016.
+
+Stuart Lloyd. Least squares quantization in PCM. IEEE Trans. Inf. Theor., 28(2):129–137, September 2006. ISSN 0018-9448. doi: 10.1109/TIT.1982.1056489.
+
+Zhi-Quan Luo, Wing-Kin Ma, A.M.-C. So, Yinyu Ye, and Shuzhong Zhang. Semidefinite relaxation of quadratic optimization problems. IEEE Signal Processing Magazine,, 27(3):20–34, May 2010. ISSN 1053-5888. doi: 10.1109/MSP.2010.936019.
+
+Wing-Kin Ma, T. N. Davidson, Kon Max Wong, Zhi-Quan Luo, and Pak-Chung Ching. Quasimaximum-likelihood multiuser detection using semi-definite relaxation with application to synchronous CDMA. IEEE Transactions on Signal Processing, 50(4):912–922, April 2002.
+
+Bill Marr. The top 10 AI and machine learning use cases everyone should know about. Forbes Magazine, Sept 2016.
+
+Judea Pearl. Causality: Models, Reasoning and Inference. Cambridge University Press, New York, NY, USA, 2nd edition, 2009. ISBN 052189560X, 9780521895606.
+
+Martin Slawski, Matthias Hein, and Pavlo Lutsik. Matrix factorization with binary components. In Advances in Neural Information Processing Systems (NIPS), pp. 3210–3218, 2013.
+
+Cyril J. Stark. Expressive recommender systems through normalized nonnegative models. CoRR, abs/1511.04775, 2015.
+
+Cyril J. Stark. Expressive recommender systems through normalized nonnegative models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, pp. 1081–1087, 2016a.
+
+Cyril J. Stark. Recommender systems inspired by the structure of quantum theory. CoRR, abs/1601.06035, 2016b.
+
+Peng Hui Tan and L. K. Rasmussen. The application of semidefinite programming for detection in CDMA. IEEE Journal on Selected Areas in Communications, 19(8):1442–1449, Aug 2001. ISSN 0733-8716. doi: 10.1109/49.942507.
+
+P. Tseng. Convergence of a block coordinate descent method for nondifferentiable minimization. Journal of Optimization Theory and Applications, 109(3):475–494, 2001. ISSN 0022-3239. doi: 10.1023/A:1017501703105.
+
+Joyce Jiyoung Whang, Inderjit S. Dhillon, and David F. Gleich. Non-exhaustive, overlapping k-means. In Proceedings of the 2015 SIAM International Conference on Data Mining, pp. 936–944, 2015. doi: 10.1137/1.9781611974010.105.
+
+Zhong-Yuan Zhang, Tao Li, Chris Ding, Xian-Wen Ren, and Xiang-Sun Zhang. Binary matrix factorization for analyzing gene expression data. Data Mining and Knowledge Discovery, 20(1): 28, 2009. ISSN 1573-756X. doi: 10.1007/s10618-009-0145-2. URL http://dx.doi.org/ 10.1007/s10618-009-0145-2.
+
+# A SUPPLEMENTARY MATERIAL FORLEARNING KOLMOGOROV MODELS FOR BINARY RANDOM VARIABLES
+
+A.1 DEFINITIONS
+
+A.2 KOLMOGOROV MODEL FOR A RANDOM VARIABLE
+
+Let $( \Omega , { \mathcal { M } } , \mu )$ be a finite probability space. Here $\Omega$ is the sample space, the event class $\mathcal { M }$ is the power set of $\Omega$ , and $\mu$ assigns probabilities to the sets in $\mathcal { M }$ . Let $X _ { u , i }$ denote a doubly-indexed set of random variables on the given probability space, having output alphabet in $\mathcal { A }$ , where elements of $\mathcal { A }$ are indexed by $z$ , i.e., $\boldsymbol { \mathcal { A } } ( \boldsymbol { z } )$ represents the $z$ th element in $\mathcal { A }$ . Also, let $\mathbb { P } [ X _ { u , i } = \mathcal { A } ( z ) ] \in [ 0 , 1 ]$ denote the probability that outcome $\boldsymbol { \mathcal { A } } ( \boldsymbol { z } )$ occurs, for $1 \leq z \leq | { \mathcal { A } } |$ . We let $\Omega = \{ \omega _ { d } \mid 1 \leq d \leq D \} .$ where $\left\{ \omega _ { d } \right\}$ the set of all $D$ -elementary events. Since $X _ { u , i }$ is binary, i.e., $\mathcal { A } = \{ 1 , 2 \}$ , we write the KM for $X _ { u , i }$ as,
+
+$$
+\begin{array} { r l } & { \mathbb { P } [ X _ { u , i } = 1 ] = \pmb { \theta } _ { u } ^ { T } \psi _ { i , 1 } } \\ & { \mathbb { P } [ X _ { u , i } = 2 ] = \pmb { \theta } _ { u } ^ { T } \psi _ { i , 2 } = 1 - \pmb { \theta } _ { u } ^ { T } \psi _ { i , 1 } , } \end{array}
+$$
+
+where $\theta _ { u }$ is a Probability Mass Function $( P M F )$ vector on the unit simplex, $\mathcal { P }$ , and $\{ \psi _ { i , 1 } , \psi _ { i , 2 } \} \in \mathbb { B } ^ { D }$ are binary indicator vectors representing the support of its probability measure. Moreover, the last equality follows from $\psi _ { i , 1 } + \psi _ { i , 2 } = { \bf 1 }$ , which in turn follows from the outcomes of each RV summing to one. Since $X _ { u , i }$ is binary, it is fully characterized by considering one outcome,
+
+$$
+\mathbb { P } [ X _ { u , i } = 1 ] = \pmb { \theta } _ { u } ^ { T } \psi _ { i } ,
+$$
+
+# A.3 RELATED WORK
+
+Matrix Factorization Methods: Note that, $( Q )$ can be re-written as a low-rank matrix factorization problem, over the set of binary and stochastic matrices (see Appendix A.5. Thus, the proposed approach is connected to factorization methods: Matrix Factorization (MF) (Koren et al., 2009), Nonnegative Matrix Factorization (Lee & Seung, 2001), SVD (Cai et al., 2010) (and their many variants/extensions) have gained widespread applicability, covering areas in sound processing, (medical) image reconstruction, recommendation systems and prediction problems (Davenport & Romberg, 2016). These techniques model elements of the training set as inner product of two arbitrary vectors: Despite their success, the performance is inherently tied to the validity of that model, and consequently the extent to which these assumption hold. However, this inner product does not represent a RV (in a mathematical sense), when viewed in the context of the proposed model (see Section 2.1). Consequently, the analytical guarantees of Section 4, which underpin the causal relations, do not hold for general factorization methods.
+
+Nonnegative Sparse MF: Hoyer (2004) numerically showed that the two low-rank components that are offered by sparse nonnegative MF (a variant of MF) provide insights on the data they model. While our proposed method also provides insight among the data (via the causal relations), the proposed KM and the resulting causal relations are based on established axioms in probability. Unlike the relations offered by nonnegative sparse MF which are shown empirically for a handful of examples, the causal relations (Section 4) hold analytically.
+
+Binary MF: We underline that most MF methods also rely on BCD methods (alternating minimization), for which globally optimal solutions to each subproblem are needed for convergence. Thus, these methods cannot be directly applied to $( Q )$ , due to the binary constraints on $\psi _ { i }$ . The authors are unaware generic solution approaches for $( Q )$ . Nonetheless, the Binary $M F$ method (Slawski et al., 2013) can solve $( Q )$ when the problem is feasible and the training set spans the entire data set, i.e., $\kappa = \mathcal { D }$ . However, the method operates in the unsupervised learning setting only, without providing prediction (see Section 5). This indeed limits the applicability of binary MF to practical scenarios, since real-world data will have missing/erroneous data.
+
+Clustering Methods: Consider a special case of $( Q )$ , where $\psi _ { i }$ is constrained to have one nonzero element. The resulting problem becomes the well-known $K$ -means clustering (Lloyd, 2006). The K-means algorithms (and its variants $\mathbf { K }$ -medoids, fuzzy K-means and K-SVD), have become pervasive in an abundance of applications such as clustering, classification, image segmentation,
+
+DNA analysis, online dictionary learning, source coding, etc. Our approach generalizes $K$ -means, by allowing for overlapping clusters. While a similar generalization of the classical K-means algorithm was considered in (Whang et al., 2015), the number of points per cluster is determined explicitly.
+
+Nonnegative Models: Non-Negative Models (NNMs) (Stark, 2016a) are recent attempts at interpretable models. For reasons of computational tractability (Stark, 2016a), NNMs are defined by relaxing $\psi _ { i }$ in (1). However, this relaxation impairs the highly interpretable nature of the model in (1), making causal relations less accurate.
+
+# A.4 KNOWN CONTEXT-DEPENDENT MAP
+
+Consider the case where the elementary events correspond to each of the movie genres, i.e., $\Omega =$ $\{ \omega _ { 1 } , \cdot \cdot \cdot , \omega _ { D } \} = \{ { } ^ { \ast \cdot } \mathrm { A c t i o n } ^ { , , } , \cdot \cdot \cdot , { } ^ { \ast \cdot } \mathrm { S c i F i } ^ { , , } \}$ . We refer to this as a known context-dependent map: $\mathbb { P } [ X _ { u , i } = 1 ] = \psi _ { i } ^ { T } \pmb { \theta } _ { u } = t _ { i } ^ { T } \pmb { \theta } _ { u }$ is expressed as a convex/stochastic mixture of movie genres. These models are a ’holy grail’ for recommendation systems, due to the direct interpretation that they provide. In this case, $\cdot$ is a binary genre tag vector with $[ t _ { i } ] _ { m } = 1 , \forall m \in \{ D \}$ , if movie $\cdot$ belongs to movie genre $\cdot$ , and zero otherwise. Now consider a genie-aided setting, where the set of movie genre tags $\{ t _ { i } \}$ , are known (and consequently $\cdot$ are known as well). Then, one can revisit the optimization problem for determining the KM, ( $\cdot$ ), where the indicator vectors are given, $\{ \psi _ { i } = t _ { i } \}$ , and the optimization is performed over the PMF vectors only $\cdot$ :
+
+$$
+\operatorname* { m i n } _ { \theta _ { u } \in \mathcal { P } } \mathcal { E } ( \{ t _ { i } \} , \{ \theta _ { u } \} )
+$$
+
+However, numerical result reveal that the training and test performance of these representations is quite poor. We tested the performance of this highly interpretable model, by extracting the tag vectors $\{ t _ { i } \}$ from the ML 100K dataset, and using them to optimize the corresponding PMF vectors. We set $\cdot$ to match the total number of movie genres for the ML 100K dataset. As seen in Table 3, the
+
+
TrainingRMSE
Test RMSE
0.4468
0.4468
+
+Table 3: Normalized errors metrics when the context-dependent map is known (ML100K)
+
+known context-dependent map have poor performance. This suggests the existence of a trade-off between the having this content-dependent map, and training/test performance.
+
+# A.5 PROBLEM FORMULATION IN MATRIX FORM
+
+Let $\Psi = [ \psi _ { 1 } , \cdot \cdot \cdot , \psi _ { I } ]$ , $\Psi \in \mathbb { B } ^ { D \times I }$ denote the aggregate indicator matrix (containing all the individual indicator vectors), $\boldsymbol { \Theta } = [ \pmb { \theta } _ { 1 } , \cdots , \pmb { \theta } _ { U } ]$ , $\Theta \in \mathbb { R } _ { + } ^ { \tilde { D } \times U }$ the aggregate matrix of PMF vectors, and $[ \pmb { P } ] _ { ( u , i ) } = p _ { ( u , i ) } , \forall ( u , i ) \in \mathcal { U } \times \mathcal { T }$ , $P \in \mathbb { R } _ { + } ^ { U \times I }$ the aggregate matrix of known probabilities. Then, $( Q )$ can be written in equivalent matrix form,
+
+$$
+\{ \underset { \Psi , \Theta } { \operatorname* { m i n } } \ \mathcal { E } ( \Psi , \Theta ) = \lVert M \circ ( \Theta ^ { T } \Psi - P ) \rVert _ { F } ^ { 2 } \qquad \\ \mathrm { ~ s . ~ t . ~ } \Psi \in \mathbb { B } ^ { D \times I } , \ \Theta \in \mathbb { R } _ { + } ^ { D \times U } , \ \Theta ^ { T } \mathbf { 1 } = \mathbf { 1 } \ .
+$$
+
+where $\circ$ denotes the Hadamard product, and $M \in \mathbb { B } ^ { U \times I }$ is a mask matrix having $M _ { u , i } = 1 , \forall ( u , i ) \in$ $\kappa$ .
+
+# A.6 MAIN RESULTS
+
+Below, we summarized the results used in the paper; see Authors (Oct 2017) for the proofs.
+
+We use following known result to find the descent direction for the FW method (the proof is known).
+
+Proposition 2 Consider the following Linear Program $( L P )$ ,
+
+$$
+\left( P _ { P S } \right) \ \pmb { x } ^ { \star } = \underset { \pmb { x } \in \mathbb { R } ^ { n } } { \mathrm { a r g m i n } } c ^ { T } \pmb { x } , \ \mathrm { ~ s . ~ t . ~ } \ \mathbf { 1 } ^ { T } \pmb { x } = 1 , \ \pmb { x } \geq \mathbf { 0 }
+$$
+
+Its optimal solution is given by
+
+$$
+{ \pmb x } ^ { \star } = { \pmb e } _ { j ^ { \star } } \ , \mathrm { w h e r e } j ^ { \star } = \ \mathrm { a r g m i n } _ { 1 \leq j \leq n } { \pmb c } ^ { T } { \pmb e } _ { j }
+$$
+
+Thus, the solution reduces to searching over the vector $^ c$ .
+
+We show the convergence of the FW algorithm (Table 1).
+
+Proposition 3 Let $\pmb { \theta } _ { u } ^ { \star }$ be the optimal solution to $\left( Q _ { 1 } \right)$ . Then the sequence of iterates $\{ \pmb \theta _ { u } ^ { ( k ) } \}$ satisfies (Jaggi, 2013)[Theorem $I J ,$
+
+$$
+\| f ( \pmb \theta _ { u } ^ { ( k + 1 ) } ) - f ( \pmb \theta _ { u } ^ { \star } ) \| _ { 2 } \leq \mathcal { O } ( 1 / k ) , k = 1 , 2 , \cdots \boxed { }
+$$
+
+Proof: The linear convergence rate for all FW variants, was proved in Jaggi (2013)[Theorem 1].
+
+Quasi-optimality of SDR: The question was studied extensively in the context of binary detection for multi-antenna communication (Tan & Rasmussen, 2001). Interestingly, $\left( Q _ { 2 } \right)$ can be recast as a noiseless binary detection problem, where SDR has been to be optimal. The results is formalized below.
+
+Proposition 4 Let $g ( \psi _ { i } ^ { \star } )$ and $g ( \hat { \psi } _ { i } )$ denote the optimal solutions to the binary $Q P$ in $\left( Q _ { 2 } \right)$ , and its SDR after randomization (Table 2), respectively. The approximation quality is defined as (Luo et al., 2010),
+
+$$
+\eta \leq g ( \psi _ { i } ^ { \star } ) / g ( \hat { \psi } _ { i } ) \leq 1 .
+$$
+
+It holds that $\eta = 1$ , with probability $1 - \exp ^ { - \mathcal { O } ( D ) }$ , asymptotically in $D$ . Thus, the relaxation is quasi-optimal.
+
+Proof: See (Authors, Oct 2017).
+
+Lemma 2 Let $t _ { n } \triangleq \mathcal { E } ( \{ \psi _ { i } ^ { ( n ) } \} , \{ \pmb { \theta } _ { u } ^ { ( n ) } \} )$ , $n = 1 , 2 , \ldots$ be the sequence of iterates, resulting from the updates in Algorithm $^ { l }$ . Then, $\{ t _ { n } \}$ is non-increasing in $n$ , and converges to a stationary point of $( Q )$ in (2), almost surely.
+
+Proof: The convergence is shown in (Authors, Oct 2017).
+
+# A.7 ADDITIONAL NUMERICAL RESULTS
+
+Prediction Performance (Setting 2): Since the range of the predicted variable is different for MF/NMF/SVD++, and KM/NNM, we use the normalized test RMSE, i.e., NRMSE $=$ $\begin{array} { r } { \eta ( \sum _ { ( u , i ) \in \bar { \mathcal { K } } } | [ R ] _ { ( u , i ) } - \hat { R } _ { u , i } | ^ { 2 } / | \bar { \mathcal { K } } | ) ^ { 1 / 2 } } \end{array}$ where $\bar { \kappa }$ is the test set, and $\eta = ( R _ { \mathrm { m a x } } - R _ { \mathrm { m i n } } ) ^ { - 1 } = 1 / 4$ is the normalization for MF/NMF/SVD++. For KMs/NNMs the same metric reduces to ${ \mathrm { N R M S E } } =$ $\begin{array} { r } { \left( \sum _ { ( u , i ) \in \bar { \mathcal { K } } } | [ \boldsymbol { R } ] _ { ( u , i ) } / R _ { \operatorname* { m a x } } - \hat { \theta } _ { u } ^ { T } \hat { \psi } _ { i } | ^ { 2 } / | \bar { \mathcal { K } } | \right) ^ { 1 / 2 } } \end{array}$ . The best values for $\lambda _ { u }$ and $\mu _ { i }$ , were picked from a coarse two-dimensional grid by cross-validation, using a held-out validation set. The Normalized RMSE results are shown in Table 4. We observe a significant gap between KMs, and well known collaborative filtering methods, especially as $D$ increases. Moreover, the drop in performance for NNMs for increasing $D$ may be due to over-fitting.
+
+Asymptotic optimality of SDR for $\psi$ -step solution: Table 5 is a numerical validation of Proposition 4 where we computed the error rate of SDR (compared to the exhaustive search), aggregated over all iterations. We observe that the approximation error decreases, with increasing $D$ (following Proposition 4).
+
+Table 4: Normalized Test RMSE (Setting 2). The dimension of factorization for $\mathbf { M F / S V D + + }$ , $k$ , is equal to $D$ (unless stated in the corresponding entry). The normalized test RMSE for all other methods are taken from the following repository: http://www.mymedialite.net/examples/datasets.html ( $\cdot _ { - } ,$ indicates the unavailability of the correspond test RMSE from the repository.
+
+
\ No newline at end of file
diff --git a/md/train/BJgVaG-Ab/BJgVaG-Ab.md b/md/train/BJgVaG-Ab/BJgVaG-Ab.md
new file mode 100644
index 0000000000000000000000000000000000000000..351dcdd60baff1d89ba63550fce9163db404e360
--- /dev/null
+++ b/md/train/BJgVaG-Ab/BJgVaG-Ab.md
@@ -0,0 +1,358 @@
+# AUTOMATA GUIDED HIERARCHICAL REINFORCEMENT LEARNING FOR ZERO-SHOT SKILL COMPOSITION
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+An obstacle that prevents the wide adoption of (deep) reinforcement learning (RL) in control systems is its need for a large number of interactions with the environment in order to master a skill. The learned skill usually generalizes poorly across domains and re-training is often necessary when presented with a new task. We present a framework that combines techniques in formal methods with hierarchical reinforcement learning (HRL). The set of techniques we provide allows for the convenient specification of tasks with logical expressions, learns hierarchical policies (meta-controller and low-level controllers) with well-defined intrinsic rewards using any RL methods and is able to construct new skills from existing ones without additional learning. We evaluate the proposed methods in a simple grid world simulation as well as simulation on a Baxter robot.
+
+# 1 INTRODUCTION
+
+Reinforcement learning has received much attention in the recent years because of its achievements in games Mnih et al. (2015), Silver et al. (2016), robotics manipulation Jang et al., Levine et al. (2016), Gu et al. (2016) and autonomous driving Isele et al. (2017), Madrigal (2017). However, training a policy that sufficiently masters a skill requires an enormous amount of interactions with the environment and acquiring such experience can be difficult on physical systems. Moreover, most learned policies are tailored to mastering one skill (by maximizing the reward) and are hardly reusable on a new skill.
+
+Skill composition is the idea of constructing new skills out of existing skills (and hence their policies) with little to no additional learning. In stochastic optimal control, this idea has been adopted by authors of Todorov (2009) and Da Silva et al. (2009) to construct provably optimal control laws based on linearly solvable Markov decision processes. Authors of Haarnoja et al. (2017), Tang & Haarnoja have showed in simulated manipulation tasks that approximately optimal policies can result from adding the Q-functions of the existing policies.
+
+Hierarchical reinforcement learning is an effective means of achieving transfer among tasks. The goal is to obtain task-invariant low-level policies, and by re-training the meta-policy that schedules over the low-level policies, different skills can be obtain with less samples than training from scratch. Authors of Heess et al. (2016) have adopted this idea in learning locomotor controllers and have shown successful transfer among simulated locomotion tasks. Authors of Oh et al. (2017) have utilized a deep hierarchical architecture for multi-task learning using natural language instructions.
+
+Temporal logic is a formal language commonly used in software and digital circuit verification Baier & Katoen (2008) as well as formal synthesis Belta et al. (2017). It allows for convenient expression of complex behaviors and causal relationships. TL has been used by Sadraddini & Belta (2015), Leahy et al. (2015) to synthesize provably correct control policies. Authors of Aksaray et al. (2016) have also combined TL with Q-learning to learn satisfiable policies in discrete state and action spaces.
+
+In this work, we focus on hierarchical skill acquisition and zero-shot skill composition. Once a set of skills is acquired, we provide a technique that can synthesize new skills without the need to further interact with the environment (given the state and action spaces as well as the transition remain the same). We adopt temporal logic as the task specification language. Compared to most heuristic reward structures used in the RL literature to specify tasks, formal specification language excels at its semantic rigor and interpretability of specified behaviors. Our main contributions are:
+
+• We take advantage of the transformation between TL formula and finite state automata (FSA) to construct deterministic meta-controllers directly from the task specification without the necessity for additional learning. We show that by adding one discrete dimension to the original state space, structurally simple parameterized policies such as feed-forward neural networks can be used to learn tasks that require complex temporal reasoning. Intrinsic motivation has been shown to help RL agents learn complicated behaviors with less interactions with the environment Singh et al. (2004), Kulkarni et al. (2016), Jaderberg et al. (2016). However, designing a well-behaved intrinsic reward that aligns with the extrinsic reward takes effort and experience. In our work, we construct intrinsic rewards directly from the input alphabets of the FSA (a component of the automaton), which guarantees that maximizing each intrinsic reward makes positive progress towards satisfying the entire task specification. From a user’s perspective, the intrinsic rewards are constructed automatically from the TL formula. • In our framework, each FSA represents a hierarchical policy with low-level controllers that can be re-modulated to achieve different tasks. Skill composition is achieved by manipulating the FSA that results from their TL specifications in a deterministic fashion. Instead of interpolating/extrapolating among existing skills, we present a simple policy switching scheme based on graph manipulation of the FSA. Therefore, the compositional outcome is much more transparent. We introduce a method that allows learning of such hierarchical policies with any non-hierarchical RL algorithm. Compared with previous work on skill composition, we impose no constraints on the policy representation or the problem class.
+
+# 2 PRELIMINARIES
+
+2.1 THE OPTIONS FRAMEWORK IN HIERARCHICAL REINFORCEMENT LEARNING
+
+In this section, we briefly introduce the options framework Sutton et al. (1998), especially the terminologies that we will inherit in later sections. We start with the definition of a Markov Decision Process.
+
+Definition 1. An MDP is defined as a tuple $\mathcal { M } = \langle S , A , p ( \cdot | \cdot , \cdot ) , R ( \cdot , \cdot , \cdot ) \rangle$ , where $S \subseteq \mathbb { R } ^ { n }$ is the state space ; $A \subseteq \mathbb { R } ^ { m }$ is the action space ( $S$ and $A$ can also be discrete sets); $p : S \times A \times S [ 0 , 1 ]$ is the transition function with $p ( s ^ { \prime } | s , a )$ being the conditional probability density of taking action $a \in A$ at state $s \in S$ and ending up in state $s ^ { \prime } \in S$ ; $R : S \times A \times S \mathbb { R }$ is the reward function. let $T$ be the length of a fixed time horizon. The goal is to find a policy $\pi ^ { \star } : S A ( o r \pi ^ { \star } : S \times A [ 0 , 1 ]$ for stochastic policies) that maximizes the expected return, i.e.
+
+$$
+\pi ^ { \star } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } ^ { \pi } [ R ( \tau _ { T } ) ]
+$$
+
+where $\tau _ { T } = ( s _ { 0 } , a _ { 0 } , . . . , s _ { T } , )$ denotes the state-action trajectory from time 0 to $T$
+
+The options framework exploits temporal abstractions over the action space. An option is defined as a tuple $o = \langle \mathcal { Z } , \pi ^ { o } , \beta \rangle$ where $\mathcal { T }$ is the set of states that option $o$ can be initiated (here we let ${ \mathcal { T } } = S$ for all options), $\pi ^ { o } : S A$ is an options policy and $\beta : S [ 0 , 1 ] .$ is the termination probability for the option at state $s$ . In addition, there is a policy over options $\bar { \pi ^ { h } } : S O$ (where $O$ is a set of available options) that schedules among options. At a given time step $t$ , an option $o$ is chosen according to $\pi ^ { h } \dot { ( } s _ { t } )$ and the options policy $\pi ^ { o }$ is followed until the termination probability $\beta ( s ) >$ threshold at time $t + k$ , and the next option is chosen by $\pi ^ { h } ( s _ { t + k } )$ .
+
+We consider tasks specified with Truncated Linear Temporal Logic (TLTL). We restrict the set of allowed operators to be
+
+$$
+\begin{array} { r } { \phi : = \top \mid f ( s ) < c \mid \neg \phi \mid \phi \land \psi \mid \phi \lor \psi \mid } \\ { \big \langle \phi \mid \phi \mid \phi \mathcal { U } \psi \mid \phi \mathcal { T } \psi \mid \big \langle \phi \phi \mid \phi \Rightarrow \psi } \end{array}
+$$
+
+where $f ( s ) < c$ is a predicate, $\neg$ (negation/not), $\wedge$ (conjunction/and), and $\vee$ (disjunction/or) are Boolean connectives, and $\diamondsuit$ (eventually), $\mathcal { U }$ (until), $\tau$ (then), $\bigcirc$ (next), are temporal operators. Implication is denoted by $\Rightarrow$ (implication). Essentially we excluded the Always operator $( \sqsubseteq )$ with reasons similar to Kupferman $\&$ Vardi (2001). We refer to this restricted TLTL as syntactically co-safe TLTL (scTLTL) (Vasile et al. (2017) used similar idea for LTL). There exists a real-value function $\rho ( s _ { 0 : T } , \phi )$ called robustness degree that measures the level of satisfaction of trajectory $s _ { 0 : T }$ with respective to $\phi$ . $\rho ( s _ { 0 : T } , \phi ) > 0$ indicates that $s _ { 0 : T }$ satisfies $\phi$ and vice versa. Definitions for the boolean semantics and robustness degree are provided in Appendix E.
+
+Any scTLTL formula can be translated into a finite state automata (FSA) with the following definition:
+
+Definition 2. An FSA is defined as a tuple $\mathcal { A } _ { \phi } = \langle Q _ { \phi } , \Psi _ { \phi } , q ^ { 0 } , p _ { \phi } ( \cdot | \cdot ) , \mathcal { F } _ { \phi } \rangle$ , where $Q _ { \phi }$ is a set of automaton states; $\Psi _ { \phi }$ is an input alphabet, we denote $\psi _ { q _ { i } , q _ { j } } \in \Psi _ { \phi }$ the predicate guarding the transition from $q _ { i }$ to $q _ { j }$ (as illustrated in Figure $I$ ); $q ^ { 0 } \in Q _ { \phi }$ is the initial state; $p _ { \phi } : Q _ { \phi } \times Q _ { \phi } $ $[ 0 , 1 ]$ is a conditional probability defined as
+
+$$
+p _ { \phi } ( q _ { j } | q _ { i } ) = \left\{ \begin{array} { l l } { 1 } & { \psi _ { q _ { i } , q _ { j } } \ i s \ t r u e } \\ { 0 } & { o t h e r w i s e . } \end{array} \right.
+$$
+
+In addition, given an MDP state $s$ , we can calculate the transition in automata states at $s$ by
+
+$$
+p _ { \phi } ( q _ { j } | q _ { i } , s ) = \left\{ \begin{array} { r l } { 1 } & { { } \rho ( s , \psi _ { q _ { i } , q _ { j } } ) > 0 } \\ { 0 } & { { } o t h e r w i s e . } \end{array} \right.
+$$
+
+We abuse the notation $p _ { \phi }$ to represent both kinds of transitions when the context is clear. $\mathcal { F } _ { \phi }$ is a set of final automaton states.
+
+The translation from TLTL formula to FSA to can be done automatically with available packages like Lomap Ulusoy (2017).
+
+Example 1. Figure $^ { l }$ (left) illustrates the FSA resulting from formula $\phi = \lnot b u \scriptscriptstyle ($ a. In English, $\phi$ entails during a run, $b$ cannot be true until $a$ is true and a needs to be true at least once. The FSA has three automaton states $Q _ { \phi } = \{ q _ { 0 } , q _ { f } , t r a p \}$ with $q _ { 0 }$ being the input(initial) state (here $q _ { i }$ serves to track the progress in satisfying $\phi$ ). The input alphabet is defined as the $\Psi _ { \phi } = \{ \neg a \land \neg b , \neg a \land$ $b , a \land \lnot b , a \land b \}$ . Shorthands are used in the figure, for example $a = ( a \wedge b ) \vee ( a \wedge \neg b )$ . $\Psi _ { \phi }$ represents the power set of $\{ a , b \}$ , i.e. $\Psi _ { \phi } = 2 ^ { \{ a , b \} }$ . During execution, the FSA always starts from state $q _ { 0 }$ and transitions according to Equation (3) or (4). The specification is satisfied when $q _ { f }$ is reached and violated when trap is reached. In this example, $q _ { f }$ is reached only when a becomes true before $b$ becomes true.
+
+# 3 PROBLEM FORMULATION AND APPROACH
+
+We start with the following problem definition:
+
+Problem 1. Given an MDP in Definition $^ { l }$ with unknown transition dynamics $p ( s ^ { \prime } | s , a )$ and $a$ scTLTL specification $\phi$ over state predicates (along with its FSA $\mathcal { A } _ { \phi }$ ) as in Definition 2. Find $a$ policy $\pi _ { \phi } ^ { \star }$ such that
+
+$$
+\pi _ { \phi } ^ { \star } = \underset { \pi _ { \phi } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { \phi } } \big [ \mathbb { 1 } \big ( \rho \big ( s _ { 0 : T } , \phi \big ) > 0 \big ) \big ] .
+$$
+
+where $\mathbb { 1 } ( \rho ( s _ { 0 : T } , \phi ) > 0 )$ is an indicator function with value 1 if $\rho ( s _ { 0 : T } , \phi ) > 0$ and 0 otherwise.
+
+Problem 1 defines a policy search problem where the trajectories resulting from following the optimal policy should satisfy the given scTLTL formula in expectation.
+
+Problem 2. Given two scTLTL formula $\phi _ { 1 }$ and $\phi _ { 2 }$ along with policy $\pi _ { \phi _ { 1 } }$ that satisfies $\phi _ { 1 }$ and $\pi _ { \phi _ { 2 } }$ that satisfies $\phi _ { 2 }$ . Obtain a policy $\pi _ { \phi }$ that satisfies $\phi = \phi _ { 1 } \wedge \phi _ { 2 }$ .
+
+Problem 2 defines the problem of task composition. Given two policies each satisfying a scTLTL specification, construct the policy that satisfies the conjunction of the given specifications. Solving this problem is useful when we want to break a complex task into simple and manageable components, learn a policy that satisfies each component and ”stitch” all the components together so that the original task is satisfied. It can also be the case that as the scope of the task grows with time, the original task specification is amended with new items. Instead of having to re-learn the task from scratch, we can only learn a policy that satisfies the new items and combine them with the old policy.
+
+We propose to solve Problem 1 by constructing a product MDP from the given MDP and FSA that can be solved using any state-of-the-art RL algorithm. The idea of using product automaton for control synthesis has been adopted in various literature Leahy et al. (2015), Chen et al. (2012). However, the methods proposed in these works are restricted to discrete state and actions spaces. We extend this idea to continuous state-action spaces and show its applicability on robotics systems.
+
+For Problem 2, we propose a policy switching scheme that satisfies the compositional task specification. The switching policy takes advantage of the characteristics of FSA and uses robustness comparison at each step for decision making.
+
+# 4 FSA AUGMENTED MDP
+
+Problem 1 can be solved with any episode-based RL algorithm. However, doing so the agent suffers from sparse feedback because a reward signal can only be obtained at the end of each episode. To address this problem as well as setting up ground for automata guided HRL, we introduce the FSA augmented MDP
+
+Definition 3. An FSA augmented MDP corresponding to scTLTL formula $\phi$ is defined as $\mathcal { M } _ { \phi } =$ $\langle \tilde { S } , A , \tilde { p } ( \cdot | \cdot , \cdot ) , \tilde { R } ( \cdot , \cdot ) \rangle$ where ${ \tilde { S } } \subseteq S \times Q _ { \phi }$ , $A$ is the same as the original MDP. $\tilde { p } ( \tilde { s } ^ { \prime } | \tilde { s } , a )$ is the probability of transitioning to $\widetilde { s } ^ { \prime }$ given s˜ and $a$ , in particular
+
+$$
+\begin{array} { r l } & { \tilde { p } ( \tilde { s } ^ { \prime } | \tilde { s } , a ) = p \big ( ( s ^ { \prime } , q ^ { \prime } ) | ( s , q ) , a \big ) } \\ & { = \left\{ \begin{array} { l l } { p ( s ^ { \prime } | s , a ) } & { p _ { \phi } ( q ^ { \prime } | q , s ) = 1 } \\ { 0 } & { o t h e r w i s e . } \end{array} \right. } \end{array}
+$$
+
+Here $p _ { \phi }$ is defined in Equation (4). $\tilde { R } : \tilde { S } \times \tilde { S } \mathbb { R }$ is the FSA augmented reward function, defined by
+
+$$
+\tilde { R } ( \tilde { s } , \tilde { s } ^ { \prime } ) = \mathbb { 1 } \big ( \rho ( s ^ { \prime } , \mathrm { D } _ { \phi } ^ { q } ) > 0 \big ) ^ { 1 }
+$$
+
+where $\Omega _ { q }$ is the set of automata states that are connected with $q$ through outgoing edges. $D _ { \phi } ^ { q } =$ $\mathsf { V } _ { q ^ { \prime } \in \Omega _ { q } } \psi _ { q , q ^ { \prime } }$ represents the disjunction of all predicates guarding the transitions that originate from $q$ . The goal is to find the optimal policy that maximizes the expected sum of discounted return, i.e.
+
+$$
+\pi ^ { \star } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } ^ { \pi } \left[ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \tilde { R } ( s _ { t } , s _ { t + 1 } ) \right] ,
+$$
+
+where $\gamma < 1$ is the discount factor, $T$ is the time horizon.
+
+As a quick example to the notation $D _ { \phi } ^ { q }$ , consider the state $q _ { 0 }$ in the FSA in Figure 1 , $\Omega _ { q _ { 0 } } \ =$ $\{ t r a p , q _ { f } \}$ , $D _ { \phi } ^ { q _ { 0 } } = \psi _ { q _ { 0 } , t r a p } \vee \psi _ { q _ { 0 } , q f } = b \vee a$ . The goal is then to find a policy $\pi : { \tilde { S } } A$ that maximizes the expected sum of $\tilde { R }$ over the horizon $T$ .
+
+
+Figure 1 : FSA constructed from $\phi = \neg b \ : \mathcal { U } \ : a$ . (right): Specification amendment example. $\mathcal { A } _ { \phi _ { 1 } }$ is constructed from $\phi _ { 1 } = \diamondsuit a \diamond \diamond b$ . $\mathcal { A } _ { \phi _ { 2 } }$ is constructed from $\phi _ { 2 } ~ = ~ \neg b \mathcal { U } a$ . $\mathcal { A } _ { \phi }$ is constructed from $\phi = \phi _ { 1 } \wedge \phi _ { 2 }$ . The automaton state pair in parenthesis denote the corresponding states from $Q _ { \phi _ { 1 } }$ and $Q _ { \phi _ { 2 } }$ that the product state is constructed from. $q _ { i } ^ { 0 }$ denotes the initial state of $\mathcal { A } _ { \phi _ { i } }$ , $q _ { i , j }$ denotes the $j ^ { t h }$ state of $Q _ { \phi _ { i } }$ .
+
+The FSA augmented MDP can be constructed with any standard MDP and a scTLTL formula. And it can be solved with any off-the-shelf RL algorithm. By directly learning the flat policy $\pi$ we bypass the need to learn multiple options policies separately. After obtaining the optimal policy $\pi ^ { \star }$ , the optimal options policy for any option $o _ { q } \mathrm { c a n }$ be extracted by executing $\pi ^ { \star } ( a | s , q )$ without transitioning the automata state, i.e. keeping $q _ { i }$ fixed (denoted $\pi _ { q } ^ { \star }$ ). And $\pi _ { q } ^ { \star }$ satisfies
+
+$$
+\pi _ { q _ { i } } ^ { \star } = \underset { \pi _ { q _ { i } } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { q _ { 1 } } } \left[ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \mathbb { 1 } \left( \rho ( s _ { t + 1 } , D _ { \phi } ^ { q _ { i } } ) > 0 \right) \right] .
+$$
+
+In other words, the purpose of $\pi _ { q _ { i } }$ is to activate one of the outgoing edges of $q _ { i }$ as soon as possible and by doing so repeatedly eventually reach $q _ { f }$ .
+
+The reward function in Equation (7) encourages the system to exit the current automata state and move on to the next, and by doing so eventually reach the final state $q _ { f }$ . However, this reward does not distinguish between the trap state and other states and therefore will also promote entering of the trap state. One way to address this issue is to impose a terminal reward on both $q _ { f }$ and trap. Because the reward is an indicator function with maximum value of 1, we assign terminal rewards $R _ { q _ { f } } = 2$ and $R _ { t r a p } = - 2$ .
+
+Appendix D describes the typical learning routine using FSA augmented MDP. The algorithm utilizes memory replay which is popular among off-policy RL methods (DQN, A3C, etc) but this is not a requirement for learning with $\tilde { M } _ { \phi }$ . On-policy methods can also be used.
+
+# 5 AUTOMATA GUIDED TASK COMPOSITION
+
+In section, we provide a solution for Problem 2 by constructing the FSA of $\phi$ from that of $\phi _ { 1 }$ and $\phi _ { 2 }$ and using $\phi$ to synthesize the policy for the combined skill. We start with the following definition.
+
+Definition 4. Given $\begin{array} { c c l } { A _ { \phi _ { 1 } } } & { = } & { \langle Q _ { \phi _ { 1 } } , \Psi _ { \phi _ { 1 } } , q _ { 1 } ^ { 0 } , p _ { \phi _ { 1 } } , \mathcal { F } _ { \phi _ { 1 } } \rangle } \end{array}$ and $\begin{array} { c c l } { { A _ { \phi _ { 2 } } } } & { { = } } & { { \langle Q _ { \phi _ { 2 } } , \Psi _ { \phi _ { 2 } } , q _ { 2 } ^ { 0 } , p _ { \phi _ { 2 } } , { \mathcal F } _ { \phi _ { 2 } } \rangle } } \end{array}$ , The FSA of $\phi$ is the product automaton of $\mathcal { A } _ { \phi _ { 1 } }$ and $\mathcal { A } _ { \phi _ { 1 } }$ , i.e. ${ \mathcal A } _ { \phi = \phi _ { 1 } \wedge \phi _ { 2 } } \ = \ { \mathcal A } _ { \phi _ { 1 } } \times { \mathcal A } _ { \phi _ { 2 } } \ =$ $\langle Q _ { \phi } , \Psi _ { \phi } , q ^ { 0 } , p _ { \phi } , \mathcal { F } _ { \phi } \rangle$ where $Q _ { \phi } \subseteq Q _ { \phi _ { 1 } } \times Q _ { \phi _ { 2 } }$ is the set of product automaton, states, $q ^ { 0 } = ( q _ { 1 } ^ { 0 } , q _ { 2 } ^ { 0 } )$ is the product initial state, $\mathcal { F } \subseteq \mathcal { F } _ { \phi _ { 1 } } \cap \mathcal { F } _ { \phi _ { 2 } }$ is the final accepting states. Following Definition 2, for states $q = ( q _ { 1 } , q _ { 2 } ) \in Q _ { \phi }$ and $q ^ { \prime } = ( q _ { 1 } ^ { \prime } , q _ { 2 } ^ { \prime } ) \in Q _ { \phi }$ , the transition probability $p _ { \phi }$ is defined as
+
+$$
+p _ { \phi } ( q ^ { \prime } | q ) = \left\{ \begin{array} { r l } { 1 } & { p _ { \phi _ { 1 } } ( q _ { 1 } ^ { \prime } | q _ { 1 } ) p _ { \phi _ { 2 } } ( q _ { 2 } ^ { \prime } | q _ { 2 } ) = 1 } \\ { 0 } & { o t h e r w i s e . } \end{array} \right.
+$$
+
+Example 2. Figure $^ { l }$ (right) illustrates the FSA of $\mathcal { A } _ { \phi _ { 1 } }$ and $\mathcal { A } _ { \phi _ { 2 } }$ and their product automaton $\mathcal { A } _ { \phi }$ . Here $\phi _ { 1 } = \diamondsuit a \land \diamondsuit b$ which entails that both a and $b$ needs to be true at least once (order does not matter), and $\phi _ { 2 } = \neg b \ : \mathcal { U }$ a which is the same as Example $^ { l }$ . The resultant product corresponds to the formula $\phi = ( \diamondsuit a \land \diamondsuit b ) \land ( \neg b \varkappa a )$ which dictates that a and $b$ need to be true at least once, and a needs to be true before $b$ becomes true (an ordered visit). We can see that the trap state occurs in $\mathcal { A } _ { \phi _ { 2 } }$ and $\mathcal { A } _ { \phi }$ , this is because if $b$ is ever true before $a$ is true, the specification is violated and $q _ { f }$ can never be reached. In the product automaton, we aggregate all state pairs with a trap state component into one trap state.
+
+For $q = ( q _ { 1 } , q _ { 2 } ) \in Q _ { \phi }$ , let $\Psi _ { q }$ , $\Psi _ { q 1 }$ and $\Psi _ { q _ { 2 } }$ denote the set of predicates guarding the outgoing edges of $q , q _ { 1 }$ and $q _ { 2 }$ respectively. Equation (10) entails that a transition at $q$ in the product automaton $\mathcal { A } _ { \phi }$ exists only if corresponding transitions at $q _ { 1 }$ , $q _ { \mathrm { 2 } } \mathrm { e x i s t }$ in $\mathcal { A } _ { \phi _ { 1 } }$ and $\mathcal { A } _ { \phi _ { 2 } }$ respectively. Therefore, $\psi _ { q , q ^ { \prime } } = \psi _ { q _ { 1 } , q _ { 1 } ^ { \prime } } \wedge \psi _ { q _ { 2 } , q _ { 2 } ^ { \prime } }$ , for $\psi _ { q , q ^ { \prime } } \in \Psi _ { q } , \psi _ { q _ { 1 } , q _ { 1 } ^ { \prime } } \in \Psi _ { q _ { 1 } } , \psi _ { q _ { 2 } , q _ { 2 } ^ { \prime } } \in \Psi _ { q _ { 2 } }$ (here $q _ { i } ^ { \prime }$ is a state such that $p _ { \phi _ { i } } ( q _ { i } ^ { \prime } | q _ { i } ) = \bar { 1 } \bar { \mathrm { ~ } }$ ). Following Equation (9),
+
+$$
+\pi _ { q } ^ { \star } = \underset { \pi _ { q } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { q } } \big [ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \mathbb { 1 } \big ( \rho ( s _ { t + 1 } , D _ { \phi } ^ { q } ) > 0 \big ) \big ] ,
+$$
+
+Repeatedly applying the distributive law $\left( \Delta \wedge \Omega _ { 1 } \right) \vee \left( \Delta \wedge \Omega _ { 2 } \right) = \Delta \wedge \left( \Omega _ { 1 } \vee \Omega _ { 2 } \right)$ to the logic formula $D _ { \phi } ^ { q }$ transforms the formula to
+
+$$
+D _ { \phi } ^ { q } = \big ( \bigvee _ { q _ { 1 } ^ { \prime } } { \psi _ { q _ { 1 } , q _ { 1 } ^ { \prime } } } \big ) \wedge \big ( \bigvee _ { q _ { 2 } ^ { \prime } } { \psi _ { q _ { 2 } , q _ { 2 } ^ { \prime } } } \big ) = D _ { \phi _ { 1 } } ^ { q _ { 1 } } \wedge D _ { \phi _ { 2 } } ^ { q _ { 2 } } .
+$$
+
+Therefore,
+
+$$
+\begin{array} { r l } & { \pi _ { q } ^ { \star } = \underset { \pi _ { q } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { q } } \big [ \displaystyle \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \mathbb { 1 } \big ( \rho ( s _ { t + 1 } , D _ { \phi _ { 1 } } ^ { q _ { 1 } } \wedge D _ { \phi _ { 2 } } ^ { q _ { 2 } } ) > 0 \big ) \big ) \big ] } \\ & { \quad = \underset { \pi _ { q } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { q } } \big [ \displaystyle \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \mathbb { 1 } \big ( \operatorname* { m i n } ( \rho ( s _ { t + 1 } , D _ { \phi _ { 1 } } ^ { q _ { 1 } } ) , \rho ( s _ { t + 1 } , D _ { \phi _ { 2 } } ^ { q _ { 2 } } ) ) > 0 \big ) \big ) \big ] } \end{array}
+$$
+
+The second step in Equation (13) follows the robustness definition. Recall that the optimal options policies for $q _ { 1 }$ and $q _ { 2 }$ satisfy
+
+$$
+\pi _ { q _ { i } } ^ { \star } = \underset { \pi _ { q _ { i } } } { \arg \operatorname* { m a x } } \mathbb { E } ^ { \pi _ { \phi _ { i } } } \big [ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t + 1 } \mathbb { 1 } \left( \rho ( s _ { t + 1 } , D _ { \phi _ { i } } ^ { q _ { i } } ) > 0 ) \right) \big ] , i = 1 , 2 .
+$$
+
+Equation (13) provides a relationship among $\pi _ { q _ { . } } ^ { \star }$ , $\pi _ { q 1 } ^ { \star }$ and $\pi _ { q _ { 2 } } ^ { \star }$ . Given this relationship, We propose a simple switching policy based on stepwise robustness comparison that satisfies $\phi = \phi _ { 1 } \wedge \phi _ { 2 }$ as follows
+
+$$
+\pi _ { \phi } ( s , q ) = \left\{ \begin{array} { l l } { { \pi _ { \phi _ { 1 } } ( s , q _ { 1 } ) } } & { { \rho ( s _ { t } , D _ { \phi _ { 1 } } ^ { q _ { 1 } } ) < \rho ( s _ { t } , D _ { \phi _ { 2 } } ^ { q _ { 2 } } ) } } \\ { { \pi _ { \phi _ { 2 } } ( s , q _ { 2 } ) } } & { { o t h e r w i s e } } \end{array} \right.
+$$
+
+We show empirically the use of this switching policy for skill composition and discuss its limitations in the following sections.
+
+# 6 EXPERIMENTS AND DISCUSSION
+
+# 6.1 GRID WORLD SIMULATION
+
+In this section, we provide a simple grid world navigation example to illustrate the techniques presented in Sections 4 and 5. Here we have a robot navigating in a discrete 1 dimensional space. Its
+
+
+Figure $\mathbf { \mathfrak { z } } :$ upper left: Optimal policy for $\phi _ { 1 } = \diamondsuit a \land \diamondsuit b$ trained using Q-Learning. The arrows represent the action at each state and the dot represents stay still at that state. (upper right): Optimal policy for $\phi _ { 2 } = \lnot b \ u \ a$ . (lower left):Optimal policy for $\bar { \phi } = ( \diamondsuit a \land \diamondsuit b ) \land ( \neg b \varkappa a )$ . (lower right ): Robustness comparison used for construction of policy $\pi _ { \phi _ { 1 } \wedge \phi _ { 2 } } ^ { \star }$ . The robustness value is zero for states where bars disappear.
+
+MDP state space $S = \{ s | s \in [ - 5 , 5 ) , s$ is discrete}, its action space $A = \{ l e f t , s t a y , r i g h t \}$ . The robot navigates in the commanded direction with probability 0.8, and with probability 0.2 it randomly chooses to go in the opposite direction or stay in the same place. The robot stays in the same place if the action leads it to go out of bounds.
+
+We define two regions $a : - 3 < s < - 1$ and $b : 2 < s < 4$ . For the first task, the scTLTL specification $\phi _ { 1 } = \diamondsuit a \diamond \diamond b$ needs to be satisfied. In English, $\phi _ { 1 }$ entails that the robot needs to visit regions $a$ and $b$ at least once. To learn a deterministic optimal policy $\pi _ { \phi _ { 1 } } ^ { \star } : S \times Q A$ , we use standard Q-Learning Watkins (1989) on the FSA augmented MDP for this problem. We used a learning rate of 0.1, a discount factor of 0.99, epsilon-greedy exploration strategy with $\epsilon$ decaying linearly from 0.0 to 0.01 in 1500 steps. The episode horizon is $T = 5 0$ and trained for 500 iterations. All Q-values are initialized to zero. The resultant optimal policy is illustrated in Figure 2 .
+
+We can observe from the figure above that the policy on each automaton state $q$ serves a specific purpose. $\pi _ { q _ { 0 } } ^ { \star }$ tries to reach region $a$ or $b$ depending on which is closer. $\pi _ { q 1 } ^ { \star }$ always proceeds to region $a$ . $\pi _ { q _ { 2 } } ^ { \star }$ always proceeds to region $b$ . This agrees with the definition in Equation 9. The robot can start anywhere on the $s$ axis but must always start at automata state $q _ { 0 }$ . Following $\pi _ { \phi _ { 1 } }$ , the robot will first reach region $a$ or $b$ (whichever is nearer), and then aim for the other region which in turn satisfies $\phi$ . The states that have stay as their action are either goal regions (states $( - 2 , q _ { 0 } ) , ( 3 , q _ { 1 } )$ , etc) where a transition on $q$ happens or states that are never reached (states $( - 3 , q _ { 1 } ) , ( - 4 , q _ { 2 } )$ , etc) because a transition on $q$ occurs before they can be reached.
+
+To illustrate automata guided task composition described in Example 2, instead of learning the task described by $\phi$ from scratch, we can simply learn policy $\pi _ { \phi _ { 2 } }$ for the added requirement $\phi _ { 2 } = $ $\neg b \ u \ a$ . We use the same learning setup and the resultant optimal policy is depicted in Figure 4 . It can be observed that $\pi _ { \phi _ { 2 } }$ tries to reach $a$ while avoiding $b$ . This behavior agrees with the specification $\phi _ { 2 }$ and its FSA provided in Figure 2 . The action at $s = 4$ is stay because in order for the robot to reach $a$ it has to pass through $b$ , therefore it prefers to obtain a low reward over violating the task.
+
+Having learned policies $\pi _ { \phi _ { 1 } }$ and $\pi _ { \phi _ { 2 } }$ , we can now use Equation 15 to construct policy $\pi _ { \phi _ { 1 } \wedge \phi _ { 2 } }$ . The resulting policy for $\pi _ { \phi _ { 1 } \wedge \phi _ { 2 } }$ is illustrated in Figure 2 (upper right). This policy guides the robot to first reach $a$ (except for state $s = 4$ ) and then go to $b$ which agrees with the specification.
+
+Looking at Figure 1 , the FSA of $\phi = \phi _ { 1 } \wedge \phi _ { 2 }$ have two options policies $\pi _ { \phi } ( \cdot , q _ { 0 } )$ and $\pi _ { \phi } \big ( \cdot , q _ { 1 } \big ) ^ { 2 } ( t r a p$ state and $q _ { f }$ are terminal states which don’t have options). State $q _ { 1 }$ has only one outgoing edge with the guarding predicate $\psi _ { q _ { 1 } , q _ { f } } : b$ , which means $\pi _ { \phi } ( \cdot , q _ { 1 } ) = \pi _ { \phi _ { 1 } } ( \cdot , q _ { 2 } )$ (they have the same guarding predicate). Policy $\pi _ { \phi } ( \cdot , q _ { 0 } )$ is a switching policy between $\pi _ { \phi _ { 1 } } ( \cdot , q _ { 0 } )$ and $\pi _ { \phi _ { 2 } } ( \cdot , q _ { 0 } )$ . Figure 2 (lower left) shows the robustness comparison at each state. The policy with lower robustness is chosen following Equation (15). We can see that the robustness of both policies are the same from $s = - 5$ to $s = 0$ . And their policies agree in this range (Figures 3 and 4 ). As $s$ becomes larger, disagreement emerge because $\pi _ { \phi _ { 1 } } ( \cdot , q _ { 0 } )$ wants to stay closer to $b$ but $\pi _ { \phi _ { 2 } } ( \cdot , q _ { 0 } )$ wants otherwise. To maximize the robustness of their conjunction, the decisions of $\pi _ { \phi _ { 2 } } ( \cdot , q _ { 0 } )$ are chosen for states $s > 0$ .
+
+
+Figure $\ 3 : \ ( l e f t )$ : Baxter simulation Environment with three square regions (black,red, blue), two circular regions (red, blue), two boxes (red, blue) that the robot can manipulate and an interactive ball that the user can place anywhere on the table. Tasks are specified using these elements in Appendix A. (upper right): Learning curve for task $\phi _ { 1 }$ over 5 random seeds. (lower right): Policy deployment success rate
+
+# 6.2 SIMULATED BAXTER
+
+In this section, we construct a set of more complicated tasks that require temporal reasoning and evaluate the proposed techniques on a simulated Baxter robot. The environment is shown in Figure 3 (left). In front of the robot are three square regions and two circular regions. An object with planar coordinates $p = ( x , y )$ can use predicates $S _ { r e d } ( p ) , S _ { b l u e } ( p ) , S _ { b l a c k } ( p )$ , $\mathcal { C } _ { r e d } ( p ) , \mathcal { C } _ { b l u e } ( p )$ to evaluate whether or not it is within the each region. The predicates are defined by $S : ( x _ { m i n } < x < x _ { m a x } ) \wedge$ $( y _ { m i n } < y < y _ { m a x } )$ and $\mathcal { C } : d i s t ( ( x , y ) , ( x , y ) _ { c e n t e r } ) < r$ . $( x _ { m i n } , y _ { m i n } )$ and $( x _ { m a x } , y _ { m a x } )$ are the boundary coordinates of the square region, $( x , y ) _ { c e n t e r }$ and $r$ are the center and radius of the circular region. There are also two boxes which planar positions are denoted as $p _ { r e d b o x } = ( x , y ) _ { r e d b o x }$ and $p _ { b l u e b o x } = ( x , y ) _ { b l u e b o x }$ . And lastly there is an interactive ball that a user can move in space which 2D coordinate is denoted as $p _ { s p h e r e } = ( x , y ) _ { s p h e r e }$ (all objects move in the table plane).
+
+We design seven tasks each specified by a scTLTL formula. The task specifications and their English translations are provided in Appendix A. Throughout the experiments in this section, we use proximal policy search Schulman et al. (2017) as the policy optimization method. The hyperparameters are kept fixed across the experiments and are listed in Appendix B. The policy is a Gaussian distribution parameterized by a feed-forward neural network with 2 hidden layers, each layer has 64 relu units. The state and action spaces vary across tasks and comparison cases, and are described in Appendix C.
+
+We use the first task $\phi _ { 1 }$ to evaluate the learning outcome using the FSA augmented MDP. As comparisons, we design two other rewards structures. The first is to use the robustness $\rho ( s _ { 0 : T } , \phi )$ as the terminal reward for each episode and zero everywhere else, the second is a heuristic reward that aims to align with $\phi _ { 1 }$ . The heuristic reward consists of a state that keeps track of whether the sphere is in a region and a set of quadratic distance functions. For $\phi _ { 1 }$ , the heuristic reward is
+
+$$
+r _ { \phi _ { 1 } } = \left\{ \begin{array} { l l } { { - d i s t ( p _ { r e d b o x } , p _ { r e d s q u a r e c e n t e r } ) } } & { { p _ { s p h e r e } \mathrm { i s ~ i n ~ r e d ~ c i r c l e } } } \\ { { - d i s t ( p _ { r e d b o x } , P _ { \mathrm { b l a c k ~ s q u a r e ~ c e n t e r } } ) } } & { { \mathrm { o t h e r w i s e } . } } \end{array} \right.
+$$
+
+Heuristic rewards for other tasks are defined in a similar manner and are not presented explicitly.
+
+
+Figure 4 : (left): Learning curves for tasks $\phi _ { 6 }$ and $\phi _ { 7 }$ (task definitions provided in Appendix A). (right): Policy deployment success rate for tasks $\phi _ { 6 }$ and $\phi _ { 7 }$
+
+The results are illustrated in Figure 3 (right). The upper right plot shows the average robustness over training iterations. Robustness is chosen as the comparison metric for its semantic rigor (robustness greater than zero satisfies the task specification). The reported values are averaged over 60 episodes and the plot shows the mean and 2 standard deviations over 5 random seeds. From the plot we can observe that the FSA augmented MDP and the terminal robustness reward performed comparatively in terms of convergence rate, whereas the heuristic reward fails to learn the task. The FSA augmented MDP also learns a policy with lower variance in final performance.
+
+We deploy the learned policy on the robot in simulation and record the task success rate. For each of the three cases, we deploy the 5 policies learned from 5 random seeds on the robot and perform 10 sets of tests with randomly initialized states resulting in 50 test trials for each case. The average success rate is presented in Figure 3 (lower right). From the results we can see that the FSA augmented MDP is able to achieve the highest rate of success and this advantage over the robustness reward is due to the low variance of its final policy.
+
+To evaluate the policy switching technique for skill composition, we first learn four relatively simple policies $\pi _ { \phi _ { 2 } } , \pi _ { \phi _ { 3 } } , \pi _ { \phi _ { 4 } } , \pi _ { \phi _ { 5 } }$ using the FSA augmented MDP. Then we construct $\pi _ { \phi _ { 6 } } = \pi _ { \phi _ { 2 } \wedge \phi _ { 3 } }$ and $\pi _ { \phi _ { 7 } } = \pi _ { \phi _ { 2 } \wedge \phi _ { 3 } \wedge \phi _ { 4 } \wedge \phi _ { 4 } } \mathrm { u s i n g }$ Equation (15) (It is worth mentioning that the policies learned by the robustness and heuristic rewards do not have an automaton state in them, therefore the skill composition technique does not apply). We deploy $\pi _ { \phi _ { 6 } }$ and $\pi _ { \phi _ { 7 } }$ on tasks 6 and 7 for 10 trials and record the average robustness of the resulting trajectories. As comparisons, we also learn tasks 6 and 7 from scratch using terminal robustness rewards and heuristic rewards, the results are presented in Figure 4 . We can observe from the plots that as the complexity of the tasks increase, using the robustness and heuristic rewards fail to learn a policy that satisfies the specifications while the constructed policy can reliably achieve a robustness of greater than zero. We perform the same deployment test as previously described and looking at Figure 4 (right) we can see that for both tasks 6 and 7, only the policies constructed by skill composition are able to consistently complete the tasks.
+
+# 7 CONCLUSION
+
+In this paper, we proposed the FSA augmented MDP, a product MDP that enables effective learning of hierarchical policies using any RL algorithm for tasks specified by scTLTL. We also introduced automata guided skill composition, a technique that combines existing skills to create new skills without additional learning. We show in robotic simulations that using the proposed methods we enable simple policies to perform logically complex tasks.
+
+Limitations of the current framework include discontinuity at the point of switching (for Equation (15)), which makes this method suitable for high level decision tasks but not for low level control tasks. The technique only compares robustness at the current step and chooses to follow a sub-policy for one time-step, making the switching policy short-sighted and may miss long term opportunities. One way to address this is to impose a termination condition for following each subpolicy and terminate only when the condition is triggered (as in the original options framework). This termination condition can be hand designed or learned
+
+# REFERENCES
+
+Derya Aksaray, Austin Jones, Zhaodan Kong, Mac Schwager, and Calin Belta. Q-learning for robust satisfaction of signal temporal logic specifications. In Decision and Control (CDC), 2016 IEEE 55th Conference on, pp. 6565–6570. IEEE, 2016.
+
+Christel Baier and Joost-Pieter Katoen. Principles Of Model Checking, volume 950. 2008.
+
+Calin Belta, Boyan Yordanov, and Ebru Aydin Gol. Formal methods for discrete-time dynamical systems, 2017.
+
+Yushan Chen, Kun Deng, and Calin Belta. Multi-agent persistent monitoring in stochastic environments with temporal logic constraints. In Decision and Control (CDC), 2012 IEEE 51st Annual Conference on, pp. 2801–2806. IEEE, 2012.
+
+Marco Da Silva, Fredo Durand, and Jovan Popovi ´ c. Linear bellman combination for control of ´ character animation. Acm transactions on graphics (tog), 28(3):82, 2009.
+
+Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. arXiv preprint arXiv:1610.00633, 2016.
+
+Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. arXiv preprint arXiv:1702.08165, 2017.
+
+Nicolas Heess, Greg Wayne, Yuval Tassa, Timothy Lillicrap, Martin Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. arXiv preprint arXiv:1610.05182, 2016.
+
+David Isele, Akansel Cosgun, Kaushik Subramanian, and Kikuo Fujimura. Navigating Intersections with Autonomous Vehicles using Deep Reinforcement Learning. may 2017. URL http:// arxiv.org/abs/1705.01196.
+
+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.
+
+Eric Jang, Google Brain, Sudheendra Vijayanarasimhan, Peter Pastor, Julian Ibarz, and Sergey Levine. End-to-End Learning of Semantic Grasping. URL https://arxiv.org/pdf/ 1707.01932.pdf.
+
+Tejas D. Kulkarni, Karthik R. Narasimhan, Ardavan Saeedi, and Joshua B. Tenenbaum. Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation. 2016. URL http://arxiv.org/abs/1604.06057.
+
+Orna Kupferman and Moshe Y Vardi. Model checking of safety properties. Formal Methods in System Design, 19(3):291–314, 2001.
+
+Kevin Leahy, Austin Jones, Mac Schwager, and Calin Belta. Distributed information gathering policies under temporal logic constraints. In Decision and Control (CDC), 2015 IEEE 54th Annual Conference on, pp. 6803–6808. IEEE, 2015.
+
+Sergey Levine, Peter Pastor, Alex Krizhevsky, and Deirdre Quillen. Learning Hand-Eye Coordination for Robotic Grasping with Deep Learning and Large-Scale Data Collection. arXiv, 2016. doi: 10.1145/2835776.2835844. URL http://arxiv.org/abs/1603.02199v1.
+
+Xiao Li, Cristian-Ioan Vasile, and Calin Belta. Reinforcement learning with temporal logic rewards. arXiv preprint arXiv:1612.03471, 2016.
+
+Alexis C Madrigal. Inside Waymo’s Secret World for Training Self-Driving Cars, 2017. URL https://www.theatlantic.com/technology/archive/2017/08/ inside-waymos-secret-testing-and-simulation-facilities/537648/.
+
+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, 2015. doi: 10.1038/nature14236.
+
+Junhyuk Oh, Satinder Singh, Honglak Lee, and Pushmeet Kohli. Zero-Shot Task Generalization with Multi-Task Deep Reinforcement Learning. 2017.
+
+Sadra Sadraddini and Calin Belta. Robust Temporal Logic Model Predictive Control. 53rd Annual Conference on Communication, Control, and Computing (Allerton), 2015.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+
+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, and Koray Kavukcuoglu. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7585):484–489, 2016. ISSN 0028-0836. doi: 10.1038/nature16961. URL http://dx.doi.org/10.1038/nature16961.
+
+S. Singh, A.G. Barto, and N. Chentanez. Intrinsically motivated reinforcement learning. 18th Annual Conference on Neural Information Processing Systems (NIPS), 17(2):1281–1288, 2004. ISSN 1943-0604. doi: 10.1109/TAMD.2010.2051031.
+
+Richard S Sutton, Doina Precup, and Satinder Singh. Between MDPs and Semi-MDPs: Learning, Planning, and Representing Knowledge at Multiple Temporal Scales. Artificial Intelligence, 1 (98-74):1–39, 1998.
+
+Haoran Tang and Tuomas Haarnoja. Learning Diverse Skills via Maximum Entropy Deep Reinforcement Learning. URL http://bair.berkeley.edu/blog/2017/10/06/ soft-q-learning/.
+
+Emanuel Todorov. Compositionality of optimal control laws. In Advances in Neural Information Processing Systems, pp. 1856–1864, 2009.
+
+A Ulusoy. Ltl optimal multi-agent planner (lomap). Github repository, 2017.
+
+Cristian-Ioan Vasile, Jana Tumova, Sertac Karaman, Calin Belta, and Daniela Rus. Minimumviolation scltl motion planning for mobility-on-demand. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 1481–1488. IEEE, 2017.
+
+Christopher John Cornish Hellaby Watkins. Learning From Delayed Rewards. PhD thesis, King’s College, Cambridge, England, 1989.
+
+# Appendix
+
+# A TASK SPECIFICATIONS
+
+Task scTLTL Formula English Description If ball in red circle, $\begin{array} { r l } & { \left( \mathcal { C } _ { r e d } ( p _ { b a l l } ) \to \langle \rangle S _ { r e d } ( p _ { r e d b o x } ) \right) \Lambda } \\ & { \left( \neg \mathcal { C } _ { r e d } ( p _ { b a l l } ) \to \langle \rangle S _ { b l a c k } ( p _ { r e d b o x } ) \right) } \end{array}$ then red box eventually in
+$\phi _ { 1 }$ red square. Otherwise red box eventually in black square If ball in red circle, then red box eventually in $\begin{array} { c } { { ( \mathcal { C } _ { r e d } ( p _ { b a l l } ) \bigotimes S _ { r e d } ( p _ { r e d b o x } ) ) \wedge } } \\ { { ( \neg ( \mathcal { C } _ { r e d } ( p _ { b a l l } ) \vee ( S _ { b a c k } ( p _ { b a l l } ) ) \bigodot S _ { b l a c k } ( p _ { r e d b o x } ) ) } } \end{array}$ red square. If ball is
+$\phi _ { 2 }$ not in red circle or black square, then red box eventually in black square If ball in blue circle, then blue box eventually in
+$\begin{array} { r l r } { \phi _ { 3 } } & { } & { ( \mathcal { C } _ { b l u e } ( p _ { b a l l } ) \langle \rangle S _ { b l u e } ( p _ { b l u e b o x } ) ) \wedge } \\ { \phi _ { 3 } } & { } & { ( \neg ( \mathcal { C } _ { r e d } ( p _ { b a l l } ) \vee ( S _ { b a c k } ( p _ { b a l l } ) ) \langle \rangle S _ { b l a c k } ( p _ { b l u e b o x } ) ) } \end{array}$ blue square. If red ball is not in blue circle or black square, then blue box eventually in black square If ball in black square,
+$\phi _ { 4 }$ $\begin{array} { c } { { S _ { b l a c k } ( p _ { b a l l } ) \diamond S _ { b l u e } ( p _ { r e d b o x } ) } } \\ { { \ } } \\ { { S _ { b l a c k } ( p _ { b a l l } ) \diamond S _ { r e d } ( p _ { b l u e b o x } ) } } \\ { { \ } } \\ { { \phi _ { 2 } \wedge \phi _ { 3 } } } \\ { { \phi _ { 2 } \wedge \phi _ { 3 } \wedge \phi _ { 4 } \wedge \phi _ { 5 } } } \end{array}$ then eventually red box in blue square If ball in black square,
+$\phi _ { 5 }$ then eventually blue box in red square
+$\phi _ { 6 }$ Conjunction of task 2 and 3
+$\phi _ { 7 }$ Conjunction of tasks 2, 3, 4, 5
+
+B HYPERPARAMETERS FOR PROXIMAL POLICY OPTIMIZATION
+
+
Hyperparameter Value
Num.Hidden Layers 2Num.Units per layer 64Activation Relu
Policy Learning Rate 0.009
Value Learning Rate 0.009
Discount 0.99
Batch Size 60
GAE parameter 0.99
Num.Iterations 100
Num. Epochs 20
Clipping Parameter E 0.2
Horizon 20
+
+# C STATE AND ACTION SPACES
+
+For experiments with the simulated Baxter robot, we delegate low level control to motion planning packages and only learn high level decisions. Depending on the task, the states are the planar positions of objects (red box, blue box, ball) and the automata state. The actions are the target positions of the objects. We assume that the low level controller can take objects to the desired target position with minor uncertainty that will be dealt with by the learning agent. The table below shows state and action spaces used for each task. $s _ { \mathcal { M } }$ and $a _ { \mathcal { M } }$ denote the spaces for regular MDP (used for terminal robustness rewards and heuristic rewards). $^ s \tilde { \mathcal { M } }$ and $a _ { \tilde { \mathcal { M } } }$ denote the spaces for FSA augmented MDP. $q$ denotes the automata state.
+
+
Task
State Space
Action Space
1
S M = (Pball, Ppredbox) SM = (pball,Predbox,q)
aM/M = (predbox)target
2
SM=(Pball,Predbox) SM = (Pball,Predbox,q)
aM/M = (predbox)target
3
SM= (pball,Pbluebox) SM = (Pball, Pbluebox,q)
aM/M = (pbluebox)target
4
SM=(pball,Predbox) SM = (Pball, Predbox,q)
aM/M = (predbox)target
5
SM = (Pball, Pbluebox) SM = (Pball, Pbluebox, q)
aM/M = (pbluebox)target
6
S M = (pball, Predbox, Pbluebox) SM = (Pbal,Predbox,Pbluebox,qΦ2,qΦ3)
aM/M = (p,d)target
SM= (Pball,Predbox,Pbluebox) 7 SM = (Pball,Predbox, Pbluebox,qΦ2,qΦ3,q,5)
+
+For tasks $\phi _ { 6 }$ and $\phi _ { 7 }$ , the action space is three dimensional, the first two dimension $p = ( x , y )$ is a target position, the third dimension $d$ controls which object should be placed at $p$ . If $d < 0 . 5$ , then $p = p _ { r e d b o x }$ and if $d > 0 . 5$ , then $p = p _ { b l u e b o x }$ .
+
+# Algorithm 1 Automata Guided RL (off-policy version)
+
+1: Inputs: Episode horizon $T$ , $\tilde { M } _ { \phi }$ (consisting of an MDP and FSA $\mathcal { A } _ { \phi }$ ), maximum size for replay
+pool $N$
+2: Initialize parameterized policy $\pi ^ { \theta }$ $\triangleright \theta$ is the policy parameters
+3: Initialize replay pool $B \gets \{ \}$
+4: for $n = 1$ to number of training episodes do
+5: Select initial state $\tilde { s } _ { 0 } = ( s _ { 0 } , q _ { 0 } )$ $\triangleright \ s _ { 0 }$ can be randomly selected, $q _ { 0 }$ is always the initial
+automaton state $q ^ { 0 }$
+6: for $\mathrm { { t } = 0 }$ to T do $a _ { t } = \pi ( \tilde { s } _ { t } )$
+7: $\tilde { s } _ { t + 1 } = \mathrm { G e t N e x t S t a t e } ( \tilde { s } _ { t } , a _ { t } )$
+8: if $q _ { t + 1 } = = q _ { f }$ then
+9: r˜t = 2 . terminal reward for satisfying $\phi$
+10: break . $\phi$ is satisfied, restart episode
+11: else if $q _ { t + 1 } = = t r a p$ then
+12: $\tilde { r } _ { t } = - 2$ $\triangleright$ terminal reward for violating $\phi$
+13: break . $\phi$ is violated, restart episode
+14: else
+15: $\boldsymbol { \tilde { r } } _ { t } = \mathbf { G e t R e w a r d } ( \tilde { s } _ { t } , \tilde { s } _ { t + 1 } )$ . using Equation 7
+16:
+17: end if
+18: $\boldsymbol { B } \gets ( \tilde { s } _ { t } , a _ { t } , \tilde { s } _ { t + 1 } , \tilde { r } _ { t } )$ . store experience in replay pool
+19: if $s i z e ( B ) > N$ then
+20: $\boldsymbol { \mathrm { p o p } } ( B [ 0 ] )$
+21: end if
+22: $\theta \gets$ UpdatePolicy $( B )$ . this can be any RL update rule and doesn’t necessarily have to
+occur at this location
+23: end for
+24: end for
+
+# E SEMANTICS FOR SCTLTL
+
+Following the syntax for scTLTL provided in Section 2.2, here we define the semantics for the language. We denote $s _ { t } \in S$ to be the state at time $t$ , and $s _ { t : t + k }$ to be a sequence of states (state trajectory) from time $t$ to $t + k$ , i.e., $s _ { t : t + k } = s _ { t } s _ { t + 1 } . . . s _ { t + k }$ . The Boolean semantics of scTLTL is defined as:
+
+$$
+\begin{array} { r l r l } { s _ { t t + k } \pm | \pmb { \mathscr { f } } ( s ) < c } & { \Leftrightarrow } & { f ( s _ { t } ) < c , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = - \phi } & { \Leftrightarrow } & { - ( s _ { t t + k } \mp e ) , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \circ \psi } & { \Leftrightarrow } & { ( s _ { t t + k } \pmb { \mathscr { b } } + \phi ) \mp ( s _ { t t + k } \mp e ) , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \wedge \pmb { \mathscr { b } } } & { \Leftrightarrow } & { ( s _ { t t + k } \pmb { \mathscr { b } } + \phi ) \wedge ( s _ { t t + k } \mp e ) , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \vee \psi } & { \Leftrightarrow } & { ( s _ { t t + k } \pmb { \mathscr { b } } + \phi ) \vee ( s _ { t t + k } \mp e ) , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \bigotimes \phi } & { \Leftrightarrow } & { ( s _ { t t + k + k } \pmb { \mathscr { b } } ) \wedge ( \pmb { \mathscr { b } } > 0 ) , } \\ { s _ { t t + k + k } \pmb { \mathscr { b } } = \phi \circ } & { \Leftrightarrow } & { \pmb { \mathscr { a } } \notin [ \pmb { \mathscr { b } } , t + k ) s _ { v ( t + k } \mp e , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \pmb { \mathscr { b } } } & { \Leftrightarrow } & { \wedge ( \forall t , t + k ) s _ { t } , s _ { v ( t + k ) } \pmb { \mathscr { b } } = \psi , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \mathscr { U } } & { \Leftrightarrow } & { \wedge ( \forall t ^ { \prime } \in [ t , t ] ^ { \prime } s _ { t t } ^ { \prime } \circ \sigma _ { v ^ { t } , t } ^ { \prime } \Rightarrow \phi ) , } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \mathscr { T } \psi } & { \Leftrightarrow } & { \mathscr { a } t ^ { \prime } \in [ t , t ] s , t s _ { v ( t + k ) } \mp \psi } \\ { s _ { t t + k } \pmb { \mathscr { b } } = \phi \mathscr { T } \psi } & { \Leftrightarrow } & { \mathscr { a } t ^ { \prime } \in [ t , t ] ^ { \prime } s _ { t t } ^ { \prime } \circ \psi , } \end{array}
+$$
+
+A trajectory $s$ of horizon $T$ is said to satisfy formula $\phi$ if $s _ { 0 : T } \models \phi$ .
+
+We also define the quantitative semantics for scTLTL (robustness degree) , i.e., a real-valued function $\rho ( s _ { t : t + k } , \phi )$ of state trajectory $s _ { t : t + k }$ and a scTLTL specification $\phi$ that indicates how far $s _ { t : t + k }$ is from satisfying or violating the specification $\phi$ . The quantitative semantics of scTLTL is defined as follows:
+
+$$
+\begin{array} { r l r l } { \rho ( s _ { \mathrm { G r a t } } ^ { \prime } | s _ { \star } , \gamma ) } & { = } & { \rho _ { \mathrm { G r a t } } , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \hdots , \hdots , \hdots , \rho } ) } & { = } & { - \rho ( s _ { \mathrm { g r a t } , \hdots , \hdots , \hdots , \hdots , \rho } ) , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { - \rho ( s _ { \mathrm { g r a t } , \hdots , \phi } ) , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \operatorname* { m a x } \{ \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) , \rho ( s _ { \mathrm { t r a t } , \hdots , \phi } ) \} } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \operatorname* { m a x } \{ \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) , \rho ( s _ { \mathrm { t r a t } , \hdots , \phi } ) \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \operatorname* { m a x } \{ \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) , \rho ( s _ { \mathrm { t r a t } , \hdots , \phi } ) \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) \{ \xi > 0 \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \rho _ { \mathrm { G r a t } , \phi } \{ \rho ( s _ { \mathrm { g r a t } , \hdots , \phi } ) \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \rho _ { \mathrm { G r a t } , \phi } \{ \rho ( s _ { \mathrm { g r a t } , \hdots , \phi } ) \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & { \rho _ { \mathrm { G r a t } , \phi } \{ \rho ( s _ { \mathrm { g r a t } , \phi } ) \} , } \\ { \rho ( s _ { \mathrm { G r a t } , \hdots , \phi } ) } & { = } & \rho _ { \mathrm { G r a t } , \phi } \{ \rho ( s _ \end{array}
+$$
+
+where $\rho _ { m a x }$ represents the maximum robustness value. Moreover, $\rho ( s _ { t : t + k } , \phi ) > 0 \Rightarrow s _ { t : t + k } \mid = \phi$ and $\rho ( s _ { t : t + k } , \bar { \phi } ) \ : < \ : 0 \ : \Rightarrow \ : s _ { t : t + k } \ : \forall \ : \phi ,$ , which implies that the robustness degree can substitute Boolean semantics in order to enforce the specification $\phi$ (refer to Li et al. (2016) for a more detailed description of TLTL and robustness).
\ No newline at end of file
diff --git a/md/train/BJxh2j0qYm/BJxh2j0qYm.md b/md/train/BJxh2j0qYm/BJxh2j0qYm.md
new file mode 100644
index 0000000000000000000000000000000000000000..047ff89db734574146886f58581039bc3f2ccf7e
--- /dev/null
+++ b/md/train/BJxh2j0qYm/BJxh2j0qYm.md
@@ -0,0 +1,283 @@
+# Dynamic Channel Pruning: Feature Boosting and Suppression
+
+Xitong Gao $\bot$ ∗, Yiren Zhao $^ 2$ ∗, Lukasz Dudziak $^ 3$ , Robert Mullins4, Cheng-zhong $\mathbf { X u } ^ { \mathrm { 5 } }$
+
+1 Shenzhen Institutes of Advanced Technology, Shenzhen, China
+2,3,4 University of Cambridge, Cambridge, UK
+5 University of Macau, Macau, China
+1 xt.gao@siat.ac.cn, 2 yaz21@cam.ac.uk
+
+# Abstract
+
+Making deep convolutional neural networks more accurate typically comes at the cost of increased computational and memory resources. In this paper, we reduce this cost by exploiting the fact that the importance of features computed by convolutional layers is highly input-dependent, and propose feature boosting and suppression (FBS), a new method to predictively amplify salient convolutional channels and skip unimportant ones at run-time. FBS introduces small auxiliary connections to existing convolutional layers. In contrast to channel pruning methods which permanently remove channels, it preserves the full network structures and accelerates convolution by dynamically skipping unimportant input and output channels. FBS-augmented networks are trained with conventional stochastic gradient descent, making it readily available for many state-of-the-art CNNs. We compare FBS to a range of existing channel pruning and dynamic execution schemes and demonstrate large improvements on ImageNet classification. Experiments show that FBS can respectively provide $5 \times$ and $2 \times$ savings in compute on VGG-16 and ResNet-18, both with less than $0 . 6 \%$ top-5 accuracy loss.
+
+# 1 Introduction
+
+State-of-the-art vision and image-based tasks such as image classification (Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016), object detection (Ren et al., 2017; Huang et al., 2017) and segmentation (Long et al., 2015) are all built upon deep convolutional neural networks (CNNs). While CNN architectures have evolved to become more efficient, the general trend has been to use larger models with greater memory utilization, bandwidth and compute requirements to achieve higher accuracy. The formidable amount of computational resources used by CNNs present a great challenge in the deployment of CNNs in both cost-sensitive cloud services and low-powered edge computing applications.
+
+One common approach to reduce the memory, bandwidth and compute costs is to prune over-parameterized CNNs. If performed in a coarse-grain manner this approach is known as channel pruning (Ye et al., 2018; He et al., 2017; Liu et al., 2017; Wen et al., 2016). Channel pruning evaluates channel saliency measures and removes all input and output connections from unimportant channels— generating a smaller dense model. A saliency-based pruning method, however, has threefold disadvantages. Firstly, by removing channels, the capabilities of CNNs are permanently lost, and the resulting CNN may never regain its accuracy for difficult inputs for which the removed channels were responsible. Secondly, despite the fact that channel pruning may drastically shrink model size, without careful design, computational resources cannot be effectively reduced in a CNN without a detrimental impact on its accuracy. Finally, the saliency of a neuron is not static, which can be illustrated by the feature visualization in Figure 1. Here, a CNN is shown a set of input images, certain channel neurons in a convolutional output may get highly excited, whereas another set of images elicit little response from the same channels. This is in line with our understanding of CNNs that neurons in a convolutional layer specialize in recognizing distinct features, and the relative importance of a neuron depends heavily on the inputs.
+
+The above shortcomings prompt the question: why should we prune by static importance, if the importance is highly input-dependent? Surely, a more promising alternative is to prune dynamically depending on the current input. A dynamic channel pruning strategy allows the network to learn to prioritize certain convolutional channels and ignore irrelevant ones. Instead of simply reducing model size at the cost of accuracy with pruning, we can accelerate convolution by selectively computing only a subset of channels predicted to be important at run-time, while considering the sparse input from the preceding convolution layer. In effect, the amount of cached activations and the number of read, write and arithmetic operations used by a well-designed dynamic model can be almost identical to an equivalently sparse statically pruned one. In addition to saving computational resources, a dynamic model preserves all neurons of the full model, which minimizes the impact on task accuracy.
+
+In this paper, we propose feature boosting and suppression (FBS) to dynamically amplify and suppress output channels computed by the convolutional layer. Intuitively, we can imagine that the flow of information of each output channel can be amplified or restricted under the control of a “valve”. This allows salient information to flow freely while we stop all information from unimportant channels and skip their computation. Unlike pruning statically, the valves use features from the previous layer to predict the saliency of output channels. With conventional stochastic gradient descent (SGD) methods, the predictor can learn to adapt itself by observing the input and output features of the convolution operation.
+
+FBS introduces tiny auxiliary connections to existing convolutional layers. The minimal overhead added to the existing model is thus negligible when compared to the potential speed up provided by the dynamic sparsity. Existing dynamic computation strategies in CNNs (Lin et al., 2017; Odena et al., 2017; Bolukbasi et al., 2017) produce on/off pruning decisions or execution path selections. Training them thus often resorts to reinforcement learning, which in practice is often computationally expensive. Even though FBS similarly use non-differentiable functions, contrary to these methods, the unified losses are still wellminimized with conventional SGD.
+
+We apply FBS to a custom CIFAR-10 (Krizhevsky et al., 2014) classifier and popular CNN models such as VGG-16 (Simonyan & Zisserman, 2015) and ResNet-18 (He et al., 2016) trained on the ImageNet dataset (Deng et al., 2009). Empirical results show that under the same speed-ups, FBS can produce models with validation accuracies surpassing all other channel pruning and dynamic conditional execution methods examined in the paper.
+
+
+Figure 1: When images from the ImageNet validation dataset are shown to a pre-trained ResNet-18 (He et al., 2016), the outputs from certain channel neurons may vary drastically. The top rows in (a) and (b) are found respectively to greatly excite neurons in channels 114 and 181 of layer block 3b/conv2, whereas the bottom images elicit little activation from the same channel neurons. The number below each image indicate the maximum values observed in the channel before adding the shortcut and activation. Finally, (c) shows the distribution of maximum activations observed in the first 20 channels.
+
+# 2 Related Work
+
+# 2.1 Structured Sparsity
+
+Since LeCun et al. (1990) introduced optimal brain damage, the idea of creating more compact and efficient CNNs by removing connections or neurons has received significant attention. Early literature on pruning deep CNNs zero out individual weight parameters (Hassibi et al., 1994; Guo et al., 2016). This results in highly irregular sparse connections, which were notoriously difficult for GPUs to exploit. This has prompted custom accelerator solutions that exploit sparse weights (Parashar et al., 2017; Han et al., 2016). Although supporting both sparse and dense convolutions efficiently normally involves some compromises in terms of efficiency or performance.
+
+Alternatively, recent work has thus increasingly focused on introducing structured sparsity (Wen et al., 2016; Ye et al., 2018; Alvarez & Salzmann, 2016; Zhou et al., 2016), which can be exploited by GPUs and allows custom accelerators to focus solely on efficient dense operations. Wen et al. (2016) added group Lasso on channel weights to the model’s training loss function. This has the effect of reducing the magnitude of channel weights to diminish during training, and remove connections from zeroed-out channels. To facilitate this process, Alvarez & Salzmann (2016) additionally used proximal gradient descent, while Li et al. (2017) and He et al. (2018a) proposed to prune channels by thresholds, i.e. they set unimportant channels to zero, and fine-tune the resulting CNN. The objective to induce sparsity in groups of weights may present difficulties for gradient-based methods, given the large number of weights that need to be optimized. A common approach to overcome this is to solve (He et al., 2017) or learn (Liu et al., 2017; Ye et al., 2018) channel saliencies to drive the sparsification of CNNs. He et al. (2017) solved an optimization problem which limits the number of active convolutional channels while minimizing the reconstruction error on the convolutional output. Liu et al. (2017) used Lasso regularization on channel saliencies to induce sparsity and prune channels with a global threshold. Ye et al. (2018) learned to sparsify CNNs with an iterative shrinkage/thresholding algorithm applied to the scaling factors in batch normalization. There are methods (Luo et al., 2017; Zhuang et al., 2018) that use greedy algorithms for channel selection. Huang et al. (2018) and He et al. (2018b) adopted reinforcement learning to train agents to produce channel pruning decisions. PerforatedCNNs, proposed by Figurnov et al. (2016), use predefined masks that are model-agnostic to skip the output pixels in convolutional layers.
+
+# 2.2 Dynamic Execution
+
+In a pruned model produced by structured sparsity methods, the capabilities of the pruned neurons and connections are permanently lost. Therefore, many propose to use dynamic networks as an alternative to structured sparsity. During inference, a dynamic network can use the input data to choose parts of the network to evaluate.
+
+Convolutional layers are usually spatially sparse, i.e. their activation outputs may contain only small patches of salient regions. A number of recent publications exploit this for acceleration. Dong et al. (2017) introduced low-cost collaborative layers which induce spatial sparsity in cheap convolutions, so that the main expensive ones can use the same sparsity information. Figurnov et al. (2017) proposed spatially adaptive computation time for residual networks (He et al., 2016), which learns the number of residual blocks required to compute a certain spatial location. Almahairi et al. (2016) presented dynamic capacity networks, which use the gradient of a coarse output’s entropy to select salient locations in the input image for refinement. Ren et al. (2018) assumed the availability of $a$ priori spatial sparsity in the input image, and accelerated the convolutional layer by computing non-sparse regions.
+
+There are dynamic networks that make binary decisions or multiple choices for the inference paths taken. BlockDrop, proposed by Wu et al. (2018), trains a policy network to skip blocks in residual networks. Liu & Deng (2018) proposed conditional branches in deep neural networks (DNNs), and used Q-learning to train the branching policies. Odena et al. (2017) designed a DNN with layers containing multiple modules, and decided which module to use with a recurrent neural network (RNN). Lin et al. (2017) learned an RNN to adaptively prune channels in convolutional layers. The on/off decisions commonly used in these networks cannot be represented by differentiable functions, hence the gradients are not well-defined. Consequently, the dynamic networks above train their policy functions by reinforcement learning. There exist, however, methods that workaround such limitations. Shazeer et al. (2017) introduced sparsely-gated mixture-of-experts and used a noisy ranking on the backpropagate-able gating networks to select the expensive experts to evaluate. Bolukbasi et al. (2017) trained differentiable policy functions to implement early exits in a DNN. Hua et al. (2018) learned binary policies that decide whether partial or all input channels are used for convolution, but approximate the gradients of the non-differentiable policy functions with continuous ones.
+
+# 3 Feature Boosting and Suppression
+
+We start with a high-level illustration (Figure 2) of how FBS accelerates a convolutional layer with batch normalization (BN). The auxiliary components (in red) predict the importance of each output channel based on the input features, and amplify the output features accordingly. Moreover, certain output channels are predicted to be entirely suppressed (or zero-valued as represented by $\varTheta$ ), such output sparsity information can advise the convolution operation to skip the computation of these channels, as indicated by the dashed arrow. It is notable that the expensive convolution can be doubly accelerated by skipping the inactive channels from both the input features and the predicted output channel saliencies. The rest of this section provides detailed explanation of the components in Figure 2.
+
+
+Figure 2: A high level view of a convolutional layer with FBS. By way of illustration, we use the $l ^ { \mathrm { t h } }$ layer with 8-channel input and output features, where channels are colored to indicate different saliencies, and the white blocks $( \boxed { \mathcal { Q } } )$ represent all-zero channels.
+
+# 3.1 Preliminaries
+
+For simplicity, we consider a deep sequential batch-normalized (Ioffe & Szegedy, 2015) CNN with $L$ convolutional layers, i.e ${ \bf \therefore } \ { \bf x } _ { L } = F ( { \bf x } _ { 0 } ) = f _ { L } \left( \cdot \cdot \cdot f _ { 2 } ( f _ { 1 } ( { \bf x } _ { 0 } ) \right) \cdot \cdot \cdot { \bf \cdot } ) $ , where the $l ^ { \mathrm { t h } }$ layer $f _ { l } : \mathbb { R } ^ { C _ { l - 1 } \times H _ { l - 1 } \times W _ { l - 1 } } \to \mathbb { R } ^ { C _ { l } \times H _ { l } \times W _ { l } }$ computes the features $\mathbf { x } _ { l } \in \mathbb { R } ^ { C _ { l } \times H _ { l } \times W _ { l } }$ , which comprise of $C _ { l }$ channels of features with height $H _ { l }$ and width $W _ { l }$ . The $l ^ { \mathrm { t h } }$ layer is thus defined as:
+
+$$
+f _ { l } \left( \mathbf { x } _ { l - 1 } \right) = ( \gamma _ { l } \cdot \mathsf { n o r m } \left( \mathsf { c o n v } _ { l } \left( \mathbf { x } _ { l - 1 } , \pmb { \theta } _ { l } \right) \right) + \beta _ { l } ) _ { + } .
+$$
+
+Here, additions $( + )$ and multiplications $( \cdot )$ are element-wise, $( \mathbf { z } ) _ { + } = \operatorname* { m a x } \left( \mathbf { z } , 0 \right)$ denotes the ReLU activation, $\gamma _ { l } , \beta _ { l } \in \mathbb { R } ^ { C _ { l } }$ are trainable parameters, norm $\mathbf { \rho } ( \mathbf { z } )$ normalizes each channel of features $\mathbf { z }$ across the population of $\mathbf { z }$ , with $\mu _ { \mathbf { z } } , \pmb { \sigma } _ { \mathbf { z } } ^ { 2 } \in \mathbb { R } ^ { C _ { l } }$ respectively containing the population mean and variance of each channel, and a small $\epsilon$ prevents division by zero:
+
+$$
+\mathsf { n o r m } \left( \mathbf { z } \right) = \frac { \mathbf { z } - \mu _ { \mathbf { z } } } { \sqrt { \pmb { \sigma } _ { \mathbf { z } } ^ { 2 } + \epsilon } } .
+$$
+
+Additionally, convl $\left( \mathbf { x } _ { l - 1 } , \pmb { \theta } _ { l } \right)$ computes the convolution of input features using the weight tensor $\pmb { \theta } _ { l } \in \mathbb { R } ^ { C ^ { l } \times C ^ { l - 1 } \times k ^ { 2 } }$ , where $k$ −is the kernel size. Specifically, FBS concerns the
+
+optimization of convl $\left( \mathbf { x } _ { l - 1 } , \pmb { \theta } _ { l } \right)$ functions, as a CNN spends the majority of its inference time in them, using $k ^ { 2 } C _ { l - 1 } C _ { l } H _ { l } W _ { l }$ multiply-accumulate operations (MACs) for the $l ^ { \mathrm { t h } }$ layer.
+
+# 3.2 Designing a Dynamic Layer
+
+Consider the following generalization of a layer with dynamic execution:
+
+$$
+\hat { f } \left( \mathbf { x } , \cdots \right) = f \left( \mathbf { x } , \pmb { \theta } , \cdots \right) \cdot \pi \left( \mathbf { x } , \pmb { \phi } , \cdots \right) ,
+$$
+
+where $f$ and $\pi$ respectively use weight parameters $\pmb { \theta }$ and $\phi$ and may have additional inputs, and compute tensors of the same output shape, denoted by $\mathbf { F }$ and $\mathbf { G }$ . Intuitively, the expensive $\mathbf { F } ^ { [ \mathbf { i } ] }$ can always be skipped for any index i whenever the cost-effective $\mathbf { G } ^ { [ \mathbf { i } ] }$ evaluates to $\mathbf { 0 }$ . Here, the superscript [i] is used to index the $\mathbf { i } ^ { \mathrm { t h } }$ slice of the tensor. For example, if we have features $\mathbf { F } \in \mathbb { R } ^ { C \times H \times W }$ containing $C$ channels of $H$ -by- $W$ features, $\mathbf { F } ^ { \left\lfloor c \right\rfloor } \in \mathbb { R } ^ { H \times W }$ retrieves the $c ^ { \mathrm { t h } }$ feature image. We can further sparsify and accelerate the layer by adding, for instance, a Lasso on $\pi$ to the total loss, where $\mathbb { E } _ { \mathbf { x } } \left[ \mathbf { z } \right]$ is the expectation of $\mathbf { z }$ over $\mathbf { x }$ :
+
+$$
+\mathcal { R } \left( \mathbf { x } \right) = \mathbb { E } _ { \mathbf { x } } \left[ \left. \pi \left( \mathbf { x } , \phi , \cdot \cdot \cdot \right) \right. _ { 1 } \right] ,
+$$
+
+Despite the simplicity of this formulation, it is however very tricky to design $\hat { f }$ properly. Under the right conditions, we can arbitrarily minimize the Lasso while maintaining the same output from the layer by scaling parameters. For example, in low-cost collaborative layers (Dong et al., 2017), $f$ and $\pi$ are simply convolutions (with or without ReLU activation) that respectively have weights $\pmb { \theta }$ and $\phi$ . Since $f$ and $\pi$ are homogeneous functions, one can always halve $\phi$ and double $\pmb { \theta }$ to decrease (4) while the network output remains the same. In other words, the optimal network must have $\| \phi \| _ { \infty } 0$ , which is infeasible in finiteprecision arithmetic. For the above reasons, Dong et al. (2017) observed that the additional loss in (4) always degrades the CNN’s task performance. Ye et al. (2018) pointed out that gradient-based training algorithms are highly inefficient in exploring such reparameterization patterns, and channel pruning methods may experience similar difficulties. Shazeer et al. (2017) avoided this limitation by finishing $\pi$ with a softmax normalization, but (4) can no longer be used as the softmax renders the $\ell ^ { 1 }$ -norm, which now evaluates to 1, useless. In addition, similar to sigmoid, softmax (without the cross entropy) is easily saturated, and thus may equally suffer from vanishing gradients. Many instead design $\pi$ to produce on/off decisions and train them with reinforcement learning as discussed in Section 2.
+
+# 3.3 Feature Boosting and Suppression with Channel Saliencies
+
+Instead of imposing sparsity on features or convolutional weight parameters (e.g. Wen et al. (2016); Alvarez & Salzmann (2016); Li et al. (2017); He et al. (2018a)), recent channel pruning methods (Liu et al., 2017; Ye et al., 2018) induce sparsity on the BN scaling factors $\gamma _ { l }$ . Inspired by them, FBS similarly generates a channel-wise importance measure. Yet contrary to them, instead of using the constant BN scaling factors $\gamma _ { l }$ , we predict channel importance and dynamically amplify or suppress channels with a parametric function $\pi ( \mathbf { x } _ { l - 1 } )$ dependent on the output from the previous layer $\mathbf x l - 1$ . Here, we propose to replace the layer definition $f _ { l } \left( \mathbf { x } _ { l - 1 } \right)$ for each of $l \in [ 1 , L ]$ with $\hat { f } _ { l } \left( \mathbf { x } _ { l - 1 } \right)$ which employs dynamic channel pruning:
+
+$$
+\hat { f } _ { l } \left( \mathbf { x } _ { l - 1 } \right) = \left( \pi _ { l } \left( \mathbf { x } _ { l - 1 } \right) \cdot \left( \mathsf { n o r m } \left( \mathsf { c o n v } _ { l } \left( \mathbf { x } _ { l - 1 } , \pmb { \theta } _ { l } \right) \right) + \beta _ { l } \right) \right) _ { + } ,
+$$
+
+where a low-overhead policy $\pi _ { l } \left( \mathbf { x } _ { l - 1 } \right)$ evaluates the pruning decisions for the computationally demanding conv $\left( \mathbf { x } _ { l - 1 } , \pmb { \theta } _ { l } \right)$ :
+
+$$
+\pi _ { l } \left( \mathbf { x } _ { l - 1 } \right) = \mathsf { w t a } _ { \lceil d C _ { l } \rceil } \left( g _ { l } \left( \mathbf { x } _ { l - 1 } \right) \right) .
+$$
+
+Here, ${ \mathsf { w t a } } _ { k } ( { \mathbf { z } } )$ is a $k$ -winners-take-all function, i.e. it returns a tensor identical to $\mathbf { z }$ , except that we zero out entries in $\mathbf { z }$ that are smaller than the $k$ largest entries in absolute magnitude. In other words, $\mathsf { w t a } _ { \lceil d C _ { l } \rceil } \bigl ( g _ { l } \bigl ( \mathbf { x } _ { l - 1 } \bigr ) \bigr )$ provides a pruning strategy that computes only $\lceil d C _ { l } \rceil$ most salient channels predicted by $g _ { l } ( \mathbf { x } _ { l - 1 } )$ , and suppresses the remaining channels with zeros. In Section 3.4, we provide a detailed explanation of how we design a cheap $g _ { l } ( \mathbf { x } _ { l - 1 } )$ that learns to predict channel saliencies.
+
+It is notable that our strategy prunes $C _ { l } - \lceil d C _ { l } \rceil$ least salient output channels from $l ^ { \mathrm { t h } }$ layer, where the density $d \in ] 0 , 1 ]$ can be varied to sweep the trade-off relationship between performance and accuracy. Moreover, pruned channels contain all-zero values. This allows the subsequent $( l + 1 ) ^ { \mathrm { t h } }$ layer to trivially make use of input-side sparsity, since all-zero features can be safely skipped even for zero-padded layers. Because all convolutions can exploit both input- and output-side sparsity, the speed-up gained from pruning is quadratic with respect to the pruning ratio. For instance, dynamically pruning half of the channels in all layers gives rise to a dynamic CNN that uses approximately $\frac { 1 } { 4 }$ of the original MACs.
+
+Theoretically, FBS does not introduce the reparameterization discussed in Section 3.2. By batch normalizing the convolution output, the convolution kernel $\theta _ { l }$ is invariant to scaling. Computationally, it is more efficient to train. Many alternative methods use nondifferentiable $\pi$ functions that produce on/off decisions. In general, DNNs with these policy functions are incompatible with SGD, and resort to reinforcement learning for training. In contrast, (6) allows end-to-end training, as wta is a piecewise differentiable and continuous function like ReLU. Srivastava et al. (2015) suggested that in general, a network is easier and faster to train for complex tasks and less prone to catastrophic forgetting, if it uses functions such as wta that promote local competition between many subnetworks.
+
+# 3.4 Learning to Predict Channel Saliencies
+
+This section explains the design of the channel saliency predictor $g _ { l } ( \mathbf { x } _ { l - 1 } )$ . To avoid significant computational cost in $g _ { l }$ , we subsample $\mathbf x _ { l - 1 }$ by reducing the spatial dimensions of each channel to a scalar using the following function $\mathsf { s s } : \mathbb { R } ^ { C \times H \times W } \to \mathbb { R } ^ { C }$ :
+
+$$
+\mathfrak { s s } \left( \mathbf { x } _ { l - 1 } \right) = \frac { 1 } { H W } \left[ \mathfrak { s } \left( \mathbf { x } _ { l - 1 } ^ { [ 1 ] } \right) \ \mathfrak { s } \left( \mathbf { x } _ { l - 1 } ^ { [ 2 ] } \right) \ \cdot \ \cdot \ \mathfrak { s } \left( \mathbf { x } _ { l - 1 } ^ { [ C ] } \right) \right] ,
+$$
+
+where $\mathsf { s } \left( \mathbf { x } _ { l - 1 } ^ { [ c ] } \right)$ reduces the $c ^ { \mathrm { t h } }$ channel of $\mathbf { z }$ to a scalar using, for instance, the $\ell ^ { 1 }$ -norm $\| \mathbf { x } _ { l - 1 } ^ { [ c ] } \| _ { 1 }$ , $\ell ^ { 2 }$ -norm, $\ell ^ { \infty }$ -norm, or the variance of $\mathbf { x } _ { l - 1 } ^ { [ c ] }$ . The results in Section 4 use the $\ell ^ { 1 }$ - − − norm by default, which is equivalent to global average pooling for the ReLU activated $\mathbf x l - 1$ . We then design $g _ { l } ( \mathbf { x } _ { l - 1 } )$ − to predict channel saliencies with a fully connected layer following −the subsampled activations $\mathsf { s s } \left( \mathbf { x } _ { l - 1 } \right)$ , where $\phi _ { l } \in \mathbb { R } ^ { C ^ { l } \times C ^ { l - 1 } }$ is the weight tensor of the layer:
+
+$$
+g _ { l } \left( \mathbf { x } _ { l - 1 } \right) = \left( \mathsf { s s } \left( \mathbf { x } _ { l - 1 } \right) \phi _ { l } + \pmb { \rho } _ { l } \right) _ { + } .
+$$
+
+We generally initialize $\rho _ { l }$ with $1$ and apply He et al. (2015)’s initialization to $\phi _ { l }$ . Similar to how Liu et al. (2017) and Ye et al. (2018) induced sparsity in the BN scaling factors, we regularize all layers with the Lasso on $g _ { l } ( \mathbf { x } _ { l - 1 } )$ : $\begin{array} { r l } { { \lambda \sum _ { l = 1 } ^ { L } \mathbb { E } _ { \mathbf { x } } [ g _ { l } ( \mathbf { x } _ { l - 1 } ) _ { 1 } ] } \quad } & { { } } \end{array}$ in the total loss, where $\lambda = 1 0 ^ { - 8 }$ in our experiments.
+
+# 4 Experiments
+
+We ran extensive experiments on CIFAR-10 (Krizhevsky et al., 2014) and the ImageNet ILSVRC2012 (Deng et al., 2009), two popular image classification datasets. We use MCifarNet (Zhao et al., 2018), a custom 8-layer CNN for CIFAR-10 (see Appendix A for its structure), using only 1.3 M parameters with 91.37% and 99.67% top-1 and top-5 accuracies respectively. M-CifarNet is much smaller than a VGG-16 on CIFAR-10 (Liu et al., 2017), which uses $2 0 \mathrm { M }$ parameters and only $2 . 2 9 \%$ more accurate. Because of its compactness, our CNN is more challenging to accelerate. By faithfully reimplementing Network Slimming (NS) (Liu et al., 2017), we closely compare FBS with NS under various speedup constraints. For ILSVRC2012, we augment two popular CNN variants, ResNet-18 (He et al., 2016) and VGG-16 (Simonyan & Zisserman, 2015), and provide detailed accuracy/MACs trade-off comparison against recent structured pruning and dynamic execution methods.
+
+Our method begins by first replacing all convolutional layer computations with (5), and initializing the new convolutional kernels with previous parameters. Initially, we do not suppress any channel computations by using density $d = 1$ in (6) and fine-tune the resulting network. For fair comparison against NS, we then follow Liu et al. (2017) by iteratively decrementing the overall density $d$ of the network by 10% in each step, and thus gradually using fewer channels to sweep the accuracy/performance trade-off. The difference is that NS prunes channels by ranking globally, while FBS prunes around $1 - d$ of each layer.
+
+# 4.1 CIFAR-10
+
+
+Figure 3: Experimental results on M-CifarNet. We compare in (a) the accuracy/MACs trade-off between FBS, NS and FBS $^ +$ NS. The baseline is emphasized by the circle $\bigcirc$ . The heat map in (b) reveals the individual probability of skipping a channel for each channel ( $x$ -axis), when an image of a category ( $y$ -axis) is shown to the network with $d = 1$ .
+
+By respectively applying NS and FBS to our CIFAR-10 classifier and incrementally increasing sparsity, we produce the trade-off relationships between number of operations (measured in MACs) and the classification accuracy as shown in Figure 3a. FBS clearly surpasses NS in its ability to retain the task accuracy under an increasingly stringent computational budget. Besides comparing FBS against NS, we are interested in combining both methods, which demonstrates the effectiveness of FBS if the model is already less redundant, i.e. it cannot be pruned further using NS without degrading the accuracy by more than $1 \%$ . The composite method (NS+FBS) is shown to successfully regain most of the lost accuracy due to NS, producing a trade-off curve closely matching FBS. It is notable that under the same $9 0 . 5 0 \%$ accuracy constraints, FBS, NS+FBS, and NS respectively achieve $3 . 9 3 \times$ , $3 . 2 2 \times$ , and $1 . 1 9 \times$ speed-up ratios. Conversely for a $2 \times$ speed-up target, they respectively produce models with accuracies not lower than $9 1 . 5 5 \%$ , $9 0 . 9 0 \%$ and $8 7 . 5 4 \%$ .
+
+Figure 3b demonstrates that our FBS can effectively learn to amplify and suppress channels when dealing with different input images. The 8 heat maps respectively represent the channel skipping probabilities of the 8 convolutional layers. The brightness of the pixel at location $( x , y )$ denotes the probability of skipping the $x ^ { \mathrm { t h } }$ channel when looking at an image of the $y ^ { \mathrm { t h } }$ category. The heat maps verify our belief that the auxiliary network learned to predict which channels specialize to which features, as channels may have drastically distinct probabilites of being used for images of different categories. The model here is a M-CifarNet using FBS with $d = 0 . 5$ , which has a top-1 accuracy of $9 0 . 5 9 \%$ (top-5 $9 9 . 6 5 \%$ ). Moreover, channels in the heat maps are sorted so the channels that are on average least frequently evaluated are placed on the left, and channels shaded in stripes are never evaluated. The network in Figure 3b is not only approximately $4 \times$ faster than the original, by removing the unused channels, we also reduce the number of weights by 2.37 $\times$ . This reveals that FBS naturally subsumes channel pruning strategies such as NS, as we can simply prune away channels that are skipped regardless of the input. It is notable that even though we specified a universal density $d$ , FBS learned to adjust its dynamicity across all layers, and prune different ratios of channels from the convolutional layers.
+
+# 4.2 ImageNet ILSVRC2012 Classification
+
+By applying FBS and NS respectively to ResNet-18, we saw that the ILSVRC2012 validation accuracy of FBS consistently outperforms NS under different speed-up constraints (see Appendix B for the implementation details and trade-off curves). For instance, at $d = 0 . 7$ , it utilizes only 1.12 G MACs (1.62 $\times$ fewer) to achieve a top-1 error rate of $3 1 . 5 4 \%$ , while NS requires 1.51 G MACs (1.21 $\times$ fewer) for a similar error rate of $3 1 . 7 0 \%$ . When compared across recent dynamic execution methods examined in Table 1, FBS demonstrates simultaneously the highest possible speed-up and the lowest error rates. It is notable that the baseline accuracies for FBS refer to a network that has been augmented with the auxiliary layers featuring FBS but suppress no channels, i.e. $d = 1$ . We found that this method brings immediate accuracy improvements, an increase of $1 . 7 3 \%$ in top-1 and $0 . 4 6 \%$ in top-5 accuracies, to the baseline network, which is in line with our observation on M-CifarNet.
+
+In Table 2, we compare different structured pruning and dynamic execution methods to FBS for VGG-16 (see Appendix B for the setup). At a speed-up of 3.01 $\times$ , FBS shows a minimal increase of $0 . 4 4 \%$ and $0 . 0 4 \%$ in top-1 and top-5 errors respectively. At $5 . 2 3 \times$ speed-up, it only degrades the top-1 error by $1 . 0 8 \%$ and the top-5 by $0 . 5 9 \%$ .
+
+Not only does FBS use much fewer MACs, it also demonstrates significant reductions in bandwidth and memory requirements. In Table 3, we observe a large reduction in the number of memory accesses in single image inference as we simply do not access suppressed weights and activations. Because these memory operations are often costly DRAM accesses, minimizing them leads to power-savings. Table 3 further reveals that in diverse application scenarios such as low-end and cloud environments, the peak memory usages by the optimized models are much smaller than the originals, which in general improves cache utilization.
+
+Table 1: Comparisons of error rates of the baseline and accelerated ResNet-18 models.
+
+
Method
Dynamic
Baseline
Accelerated
MAC saving
Top-1
Top-5
Top-1
Top-5
Soft Filter Pruning (He et al., 2018a)
29.72
10.37
32.90
12.22
1.72×
Network Slimming (Liu et al. (20l7),our implementation)
31.02
11.32
32.79
12.61
1.39×
Discrimination-aware Channel Pruning (Zhuang et al., 2018)
30.36
11.02
32.65
12.40
1.89×
Low-cost Collaborative Layers (Dong et al., 2017)
30.02
10.76
33.67
13.06
1.53×
Channel Gating Neural Networks (Hua et al., 2018)
广
30.98
11.16
32.60
12.19
1.61×
Feature Boosting and Suppression (FBS)
√
29.29
10.32
31.83
11.78
1.98×
+
+Table 2: Comparisons of top-5 error rate increases for VGG-16 on ILSVRC2012 validation set under 3 $\times$ , 4 $\times$ and $5 \times$ speed-up constraints. The baseline has a $1 0 . 1 \%$ top-5 error rate. Results from He et al. (2017) only show numbers with one digit after the decimal point.
+
+
Method
Dynamic
△ top-5 errors 3× 4×
(%) 5×
Filter Pruning (Li et al. (20l7),reproduced by He et al. (2017))
8.6
14.6
Perforated CNNs (Figurnov et al., 2016)
3.7
5.5
Network Slimming (Liu et al. (20i7),our implementation)
1.37
3.26
5.18
Runtime Neural Pruning (Lin et al., 2017)
2.32
3.23
3.58
Channel Pruning (He et al., 2017)
0.0
1.0
1.7
AutoML for Model Compression (He et al., 2018b)
1.4
ThiNet-Conv (Luo et al., 2017)
0.37
Feature Boosting and Suppression (FBS)
0.04 0.52
0.59
+
+
Model
Total Memory Accesses
PeakMemory Usage
Weights
Activations
Edge (1 image)
Cloud (128 images)
VGG-16
56.2MB
86.5MB
24.6MB
3.09GB
VGG-16 3×
23.9 MB (2.35x)
40.8MB (2.12×)
9.97MB (2.47×)
1.24 GB (2.47×)
ResNet-18
44.6MB
17.8MB
9.19MB
0.47 GB
ResNet-18 2×
20.5MB (2.18×)
12.3 MB (1.45×)
4.68MB (1.96x)
0.31GB (1.49×)
+
+Table 3: Comparisons of the memory accesses and peak memory usage of the ILSVRC2012 classifiers with FBS respectively under $3 \times$ and $2 \times$ inference speed-ups. The Weights and Activations columns respectively show the total amount of weight and activation accesses required by all convolutions for a single image inference. The Peak Memory Usage columns show the peak memory usages with different batch sizes.
+
+# 5 Conclusion
+
+In summary, we proposed feature boosting and suppression that helps CNNs to achieve significant reductions in the compute required while maintaining high accuracies. FBS fully preserves the capabilities of CNNs and predictively boosts important channels to help the accelerated models retain high accuracies. We demonstrated that FBS achieves around 2 $\times$ and $5 \times$ savings in computation respectively on ResNet-18 and VGG-16 within $0 . 6 \%$ loss of top-5 accuracy. Under the same performance constraints, the accuracy gained by FBS surpasses all recent structured pruning and dynamic execution methods examined in this paper. In addition, it can serve as an off-the-shelf technique for accelerating many popular CNN networks and the fine-tuning process is unified in the traditional SGD which requires no algorithmic changes in training. Finally, the implementation of FBS and the optimized networks are fully open source and released to the public1.
+
+# Acknowledgements
+
+This work is supported in part by the National Key R&D Program of China (No.
+2018YFB1004804), the National Natural Science Foundation of China (No. 61806192).
+We thank EPSRC for providing Yiren Zhao his doctoral scholarship.
+
+# References
+
+Amjad Almahairi, Nicolas Ballas, Tim Cooijmans, Yin Zheng, Hugo Larochelle, and Aaron Courville. Dynamic capacity networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning (ICML), pp. 2549–2558, 2016.
+
+Jose M Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems (NIPS), pp. 2270–2278. 2016.
+
+Tolga Bolukbasi, Joseph Wang, Ofer Dekel, and Venkatesh Saligrama. Adaptive neural networks for efficient inference. In Proceedings of the 34th International Conference on Machine Learning (ICML), pp. 527–536, 2017.
+
+J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, 2009.
+
+Xuanyi Dong, Junshi Huang, Yi Yang, and Shuicheng Yan. More is less: A more complicated network with less inference complexity. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
+
+Michael Figurnov, Maxwell D. Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
+
+Mikhail Figurnov, Aizhan Ibraimova, Dmitry P Vetrov, and Pushmeet Kohli. PerforatedCNNs: Acceleration through elimination of redundant convolutions. In Advances in Neural Information Processing Systems (NIPS), pp. 947–955, 2016.
+
+Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient DNNs. In Advances in Neural Information Processing Systems (NIPS), 2016.
+
+Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J Dally. Eie: efficient inference engine on compressed deep neural network. In Computer Architecture (ISCA), 2016 ACM/IEEE 43rd Annual International Symposium on, pp. 243–254. IEEE, 2016.
+
+Babak Hassibi, David G. Stork, and Gregory Wolff. Optimal brain surgeon: Extensions and performance comparisons. In J. D. Cowan, G. Tesauro, and J. Alspector (eds.), Advances in Neural Information Processing Systems (NIPS), pp. 263–270. 1994.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, pp. 1026– 1034, Washington, DC, USA, 2015. IEEE Computer Society. ISBN 978-1-4673-8391-2. doi: 10.1109/ICCV.2015.123.
+
+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.
+
+Yang He, Guoliang Kang, Xuanyi Dong, Yanwei Fu, and Yi Yang. Soft filter pruning for accelerating deep convolutional neural networks. In International Joint Conference on Artificial Intelligence (IJCAI), pp. 2234–2240, 2018a.
+
+Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. IEEE International Conference on Computer Vision (ICCV), pp. 1398–1406, 2017.
+
+Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. AMC: AutoML for model compression and acceleration on mobile devices. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 784–800, 2018b.
+
+Weizhe Hua, Christopher De Sa, Zhiru Zhang, and G. Edward Suh. Channel gating neural networks. CoRR, abs/1805.12549, 2018. URL http://arxiv.org/abs/1805.12549.
+
+J. Huang, V. Rathod, C. Sun, M. Zhu, A. Korattikara, A. Fathi, I. Fischer, Z. Wojna, Y. Song, S. Guadarrama, and K. Murphy. Speed/accuracy trade-offs for modern convolutional object detectors. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3296–3297, July 2017.
+
+Qiangui Huang, Kevin Zhou, Suya You, and Ulrich Neumann. Learning to prune filters in convolutional neural networks. In IEEE Winter Conference on Computer Vision. 2018.
+
+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 (ICML), pp. 448–456, 2015.
+
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS). 2012.
+
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The CIFAR-10 and CIFAR-100 datasets. http://www.cs.toronto.edu/ kriz/cifar.html, 2014.
+
+Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In Advances in Neural Information Processing Systems (NIPS), pp. 598–605. 1990.
+
+Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. 2017.
+
+Ji Lin, Yongming Rao, Jiwen Lu, and Jie Zhou. Runtime neural pruning. In Advances in Neural Information Processing Systems (NIPS), pp. 2181–2191. 2017.
+
+Lanlan Liu and Jia Deng. Dynamic deep neural networks: Optimizing accuracy-efficiency trade-offs by selective execution. 2018.
+
+Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In International Conference on Computer Vision (ICCV), 2017.
+
+J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3431–3440, June 2015.
+
+Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. ThiNet: A filter level pruning method for deep neural network compression. In ICCV, pp. 5058–5066, 2017.
+
+Augustus Odena, Dieterich Lawson, and Christopher Olah. Changing model behavior at test-time using reinforcement learning. 2017.
+
+Angshuman Parashar, Minsoo Rhu, Anurag Mukkara, Antonio Puglielli, Rangharajan Venkatesan, Brucek Khailany, Joel Emer, Stephen W Keckler, and William J Dally. Scnn: An accelerator for compressed-sparse convolutional neural networks. In ACM SIGARCH Computer Architecture News, volume 45, pp. 27–40. ACM, 2017.
+
+Mengye Ren, Andrei Pokrovsky, Bin Yang, and Raquel Urtasun. SBNet: Sparse blocks network for fast inference. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
+
+S. Ren, K. He, R. Girshick, and J. Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1137–1149, June 2017.
+
+Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-ofexperts layer. 2017.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
+
+Rupesh Kumar Srivastava, Jonathan Masci, Faustino J. Gomez, and J¨urgen Schmidhuber. Understanding locally competitive networks. In International Conference on Learning Representations (ICLR), 2015.
+
+Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems (NIPS), pp. 2074–2082. 2016.
+
+Zuxuan Wu, Tushar Nagarajan, Abhishek Kumar, Steven Rennie, Larry S. Davis, Kristen Grauman, and Rogerio Feris. BlockDrop: Dynamic inference paths in residual networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
+
+Jianbo Ye, Xin Lu, Zhe L. Lin, and James Z. Wang. Rethinking the smaller-norm-lessinformative assumption in channel pruning of convolution layers. In International Conference on Learning Representations (ICLR), 2018.
+
+Yiren Zhao, Xitong Gao, Robert Mullins, and Chengzhong Xu. Mayo: A framework for autogenerating hardware friendly deep neural networks. In Proceedings of 2nd International Workshop on Embedded and Mobile Deep Learning, EMDL ’18. ACM, 2018. doi: 10.1145/ 3212725.3212726. URL http://doi.acm.org/10.1145/3212725.3212726.
+
+Hao Zhou, Jose M. Alvarez, and Fatih Porikli. Less is more: Towards compact cnns. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling (eds.), Computer Vision – ECCV 2016, pp. 662–677, Cham, 2016. Springer International Publishing. ISBN 978-3-319- 46493-0.
+
+Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In Advances in Neural Information Processing Systems (NIPS). 2018.
+
+# A Details of M-CifarNet on CIFAR-10
+
+For the CIFAR-10 classification task, we use M-CifarNet, a custom designed CNN, with less than 1.30 M parameters and takes 174 M MACs to perform inference for a 32-by-32 RGB image. The architecture is illustrated in Table 4, where all convolutional layers use $3 \times 3$ kernels, the Shape column shows the shapes of each layer’s features, and pool7 is a global average pooling layer.
+
+We trained M-CifarNet (see Appendix A) with a 0.01 learning rate and a 256 batch size. We reduced the learning rate by a factor of $1 0 \times$ for every 100 epochs. To compare FBS against NS fairly, every model with a new target MACs budget were consecutively initialized with the previous model, and trained for a maximum of 300 epochs, which is enough for all models to converge to the best obtainable accuracies. For NS, we follow Liu et al. (2017) and start training with an $\ell ^ { 1 }$ -norm sparsity regularization weighted by $1 0 ^ { - 5 }$ on the BN scaling factors. We then prune at 150 epochs and fine-tune the resulting network without the sparsity regularization.
+
+We additionally employed image augmentation procedures from Krizhevsky et al. (2012) to preprocess each training example. Each CIFAR-10 example was randomly horizontal flipped and slightly perturbed in the brightness, saturation and hue.
+
+Table 4 additionally provides further comparisons of layer-wise compute costs between FBS, NS, and the composition of the two methods (NS $^ +$ FBS). It is notable that the FBS column has two different output channel counts, where the former is the number of computed channels for each inference, and the latter is the number of channels remaining in the layer after removing the unused channels.
+
+Table 4: The network structure of M-CifarNet for CIFAR-10 classification. In addition, we provide a detailed per-layer MACs comparison between FBS, NS, and the composition of them (NS+FBS). We minimize the models generated by the three methods while maintaining a classification accuracy of at least $9 0 . 5 \%$ .
+
+
Layer
Shape
Number of MACs (Output Channels) Original NS FBS
convo
30 × 30
893k
NS+FBS
conv1
30 × 30
1.5 M (64)
1.3M (52) 27.0M (64)
(32/62) 8.4M (32/42)
860k (32) 10.2M (39)
conv2
15 ×15
33.2M (64)
4.2M
5.9M
15×15
16.6M (128)
15.9 M (123)
(64/67) 8.3M
(74 11.6 M
conv3
15 ×15
33.2M (128)
31.9M (128)
(64/79)
(77)
conv4 conv5
8×8
33.2M (128) 14.1M
33.1M (128) 13.4M (182)
8.3M (64/83)
12.1M (77)
conv6
8×8
(192) (192)
11.6 M (111)
3.6 M (96/128)
4.9M (110) 4.3M (67)
conv7
8×8
21.2M 21.2M
12.3 M
5.4M (96/152)
pool7
(192)
(192)
5.4 M (96/96)
4.5M (116)
fc
1×1 1×1
1.9k (10)
1.9k (10)
960 (10)
1.1k (10)
174.3M
146.5M
Total Saving
1
1.19×
44.3M 3.93×
54.2M 3.21×
+
+Figure 4 shows how the skipping probabilites heat maps of the convolutional layer conv4 evolve as we fine-tune FBS-augmented M-CifarNet. The network was trained for 12 epochs, and we saved the model at every epoch. The heat maps are generated with the saved models in sequence, where we apply the same reordering to all heat map channels with the sorted result from the first epoch. It can be observed that as we train the network, the channel skipping probabilites become more pronounced.
+
+
+Figure 4: The training history of a convolutional layer conv4 in M-CifarNet. The history is visualized by the 12 skipping probabilites heat maps, where the heights denote the 10 categories in CIFAR-10, and channels in conv4 occupy the width.
+
+# B Details of the ILSVRC2012 classifiers
+
+ILSVRC2012 classifiers, i.e. ResNet-18 and VGG-16, were trained with a procedure similar to Appendix A. The difference was that they were trained for a maximum of 35 epochs, the learning rate was decayed for every 20 epochs, and NS models were all pruned at 15 epochs. For image preprocessing, we additionally cropped and stretched/squeezed images randomly following Krizhevsky et al. (2012).
+
+Since VGG-16 is computationally intensive with over 15 G MACs, We first applied NS on VGG-16 to reduce the computational and memory requirements, and ease the training of the FBS-augmented variant. We assigned a $1 \%$ budget in top-5 accuracy degradation and compressed the network using NS, which gave us a smaller VGG-16 with $2 0 \%$ of all channels pruned. The resulting network is a lot less redundant, which almost halves the compute requirements, with only 7.90 G MACs remaining. We then apply FBS to the well-compressed network.
+
+Residual networks (He et al., 2016), such as ResNet-18, adopt sequential structure of residual blocks: $\mathbf { x } _ { b } = K \left( \mathbf { x } _ { b - 1 } \right) + F \left( \mathbf { x } _ { b - 1 } \right)$ , where $\mathbf { x } _ { b }$ is the output of the $b ^ { \mathrm { t h } }$ block, $K$ is either an identity function or a downsampling convolution, and $F ^ { \prime }$ consists of a sequence of convolutions. For residual networks, we directly apply FBS to all convolutional layers, with a difference in the way we handle the feature summation. Because the $\left( b + 1 \right) ^ { \mathrm { t h } }$ block receives as input the sum of the two features with sparse channels $K \left( \mathbf { x } _ { b - 1 } \right)$ and $F \left( \mathbf { x } _ { b - 1 } \right)$ , a certain channel of this sum is treated as sparse when the same channels in both features are simultaneously sparse.
+
+Figure 5 compares the accuracy/performance trade-off curves between FBS and NS for ResNet-18.
+
+
+Figure 5: The accuracy/performance trade-off comparison between NS and FBS for ResNet18 on the ImageNet ILSVRC2012 validation set.
\ No newline at end of file
diff --git a/md/train/BkG8sjR5Km/BkG8sjR5Km.md b/md/train/BkG8sjR5Km/BkG8sjR5Km.md
new file mode 100644
index 0000000000000000000000000000000000000000..07d229bcd2cdd7db3f8f6d1a581b66e368119d5a
--- /dev/null
+++ b/md/train/BkG8sjR5Km/BkG8sjR5Km.md
@@ -0,0 +1,395 @@
+# EMERGENT COORDINATION THROUGH COMPETITION
+
+Siqi Liu∗, Guy Lever∗, Josh Merel, Saran Tunyasuvunakool, Nicolas Heess, Thore Graepel
+DeepMind
+London, United Kingdom
+{liusiqi,guylever,jsmerel,stunya,heess,thore}@google.com
+
+# ABSTRACT
+
+We study the emergence of cooperative behaviors in reinforcement learning agents by introducing a challenging competitive multi-agent soccer environment with continuous simulated physics. We demonstrate that decentralized, populationbased training with co-play can lead to a progression in agents’ behaviors: from random, to simple ball chasing, and finally showing evidence of cooperation. Our study highlights several of the challenges encountered in large scale multi-agent training in continuous control. In particular, we demonstrate that the automatic optimization of simple shaping rewards, not themselves conducive to co-operative behavior, can lead to long-horizon team behavior. We further apply an evaluation scheme, grounded by game theoretic principals, that can assess agent performance in the absence of pre-defined evaluation tasks or human baselines.
+
+# 1 INTRODUCTION
+
+Competitive games have been grand challenges for artificial intelligence research since at least the 1950s (Samuel, 1959; Tesauro, 1995; Campbell et al., 2002; Vinyals et al., 2017). In recent years, a number of breakthroughs in AI have been made in these domains by combining deep reinforcement learning (RL) with self-play, achieving superhuman performance at Go and Poker (Silver et al., 2016; Moravk et al., 2017). In continuous control domains, competitive games possess a natural curriculum property, as observed in Bansal et al. (2017), where complex behaviors have the potential to emerge in simple environments as a result of competition between agents, rather than due to increasing difficulty of manually designed tasks. Challenging collaborative-competitive multi-agent environments have only recently been addressed using end-to-end RL by Jaderberg et al. (2018), which learns visually complex first-person 2v2 video games to human level. One longstanding challenge in AI has been robot soccer (Kitano et al., 1997), including simulated leagues, which has been tackled with machine learning techniques (Riedmiller et al., 2009; MacAlpine & Stone, 2018) but not yet mastered by end-to-end reinforcement learning.
+
+We investigate the emergence of co-operative behaviors through multi-agent competitive games. We design a simple research environment with simulated physics in which complexity arises primarily through competition between teams of learning agents. We introduce a challenging multi-agent soccer environment, using MuJoCo (Todorov et al., 2012) which embeds soccer in a wider universe of possible environments with consistent simulated physics, already used extensively in the machine learning research community (Heess et al., 2016; 2017; Bansal et al., 2017; Brockman et al., 2016; Tassa et al., 2018; Riedmiller et al., 2018). We focus here on multi-agent interaction by using relatively simple bodies with a 3-dimensional action space (though the environment is scalable to more agents and more complex bodies).1 We use this environment to examine continuous multiagent reinforcement learning and some of its challenges including coordination, use of shaping rewards, exploitability and evaluation.
+
+We study a framework for continuous multi-agent RL based on decentralized population-based training (PBT) of independent RL learners (Jaderberg et al., 2017; 2018), where individual agents learn off-policy with recurrent memory and decomposed shaping reward channels. In contrast to some recent work where some degree of centralized learning was essential for multi-agent coordinated behaviors (e.g. Lowe et al., 2017; Foerster et al., 2016), we demonstrate that end-to-end PBT can lead to emergent cooperative behaviors in our soccer domain. While designing shaping rewards that induce desired cooperative behavior is difficult, PBT provides a mechanism for automatically evolving simple shaping rewards over time, driven directly by competitive match results. We further suggest to decompose reward into separate weighted channels, with individual discount factors and automatically optimize reward weights and corresponding discounts online. We demonstrate that PBT is able to evolve agents’ shaping rewards from myopically optimizing dense individual shaping rewards through to focusing relatively more on long-horizon game rewards, i.e. individual agent’s rewards automatically align more with the team objective over time. Their behavior correspondingly evolves from random, through simple ball chasing early in the learning process, to more co-operative and strategic behaviors showing awareness of other agents. These behaviors are demonstrated visually and we provide quantitative evidence for coordination using game statistics, analysis of value functions and a new method of analyzing agents’ counterfactual policy divergence.
+
+Finally, evaluation in competitive multi-agent domains remains largely an open question. Traditionally, multi-agent research in competitive domains relies on handcrafted bots or established human baselines (Jaderberg et al., 2018; Silver et al., 2016), but these are often unavailable and difficult to design. In this paper, we highlight that diversity and exploitability of evaluators is an issue, by observing non-transitivities in the agents pairwise rankings using tournaments between trained teams. We apply an evaluation scheme based on Nash averaging (Balduzzi et al., 2018) and evaluate our agents based on performance against pre-trained agents in the support set of the Nash average.
+
+# 2 PRELIMINARIES
+
+We treat our soccer domain as a multi-agent reinforcement learning problem (MARL) which models a collection of agents interacting with an environment and learning, from these interactions, to optimize individual cumulative reward. MARL can be cooperative, competitive or some mixture of the two (as is the case in soccer), depending upon the alignment of agents’ rewards. MARL is typically modelled as a Markov game (Shapley, 1953; Littman, 1994), which comprises: a state space $s$ , $n$ agents with observation and action sets $O ^ { 1 } , . . . , O ^ { n }$ and $\mathcal { A } ^ { 1 } , . . . , \mathcal { A } ^ { n }$ ; a (possibly stochastic) reward function $R ^ { i } : \mathcal { S } \times \mathcal { A } ^ { i } \mathbb { R }$ for each agent; observation functions $\phi ^ { i } : { \bar { \cal S } } { \bar { \cal O } } ^ { i }$ ; a transition function $P$ which defines the conditional distribution over successor states given previous state-actions: $P ( S _ { t + 1 } | S _ { t } , A _ { t } ^ { 1 } , . . . , A _ { t } ^ { n } )$ , which satisfies the Markov property $P ( S _ { t + 1 } \bar { | } S _ { \tau } , \dot { A _ { \tau } ^ { 1 } } , . . . , A _ { \tau } ^ { n } , \forall \tau \leq t ) =$ $P ( S _ { t + 1 } | S _ { t } , A _ { t } ^ { 1 } , . . . , A _ { t } ^ { n } )$ ; and a start state distribution $P _ { 0 } ( S _ { 0 } )$ on $s$ . In our application the state and action sets are continuous, and the transition distributions should be thought of as densities. Each agent $i$ sequentially chooses actions, $a _ { t } ^ { i }$ , at each timestep $t$ , based on their observations, $\phi _ { t } ^ { i } = \phi ^ { i } ( s _ { t } )$ , and these interactions give rise to a trajectory $\bigl ( \bigl ( s _ { t } , a _ { t } ^ { 1 } , . . . , a _ { t } ^ { n } , r _ { t } ^ { 1 } , . . . , r _ { t } ^ { n } \bigr ) \bigr ) _ { t = 1 , 2 , . . . , H }$ , over a horizon $H$ , where at each time step $S _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ^ { 1 } , . . . , a _ { t } ^ { n } )$ , and $r _ { t } ^ { i } = R ^ { i } ( s _ { t } , a _ { t } ^ { i } )$ . Each agent aims to maximize expected cumulative reward, $\mathbb { E } [ \sum _ { t = 0 } ^ { H } \gamma ^ { t } r _ { t } ^ { i } ]$ (discounted by a factor $\gamma < 1$ to ensure convergence when $H$ is infinite), and chooses actions according to a policy $a _ { t } ^ { i } \sim \pi ^ { i } ( \cdot | x _ { t } ^ { i } )$ , which in general can be any function of the history $\ v { x } _ { t } ^ { i }$ of the agent’s prior observations and actions at time $t$ , $\overline { { x } } _ { t } ^ { i } : = ( \phi ^ { i } ( s _ { 1 } ) , a _ { 1 } ^ { i } , . . . , \phi ^ { i } ( s _ { t - 1 } ) , a _ { t - 1 } ^ { i } , \phi ^ { i } \bar { ( s _ { t } ) } )$ . The special case of a Markov game with one agent is a partially-observed Markov decision process (POMDP) (Sutton & Barto, 1998). In this work all players have the same action and observation space.
+
+# 3 METHODS
+
+We seek a method of training agents which addresses the exploitability issues of competitive games, arising from overfitting to a single opponents policy, and provides a method of automatically optimizing hyperparameters and shaping rewards online, which are otherwise hard to tune. Following Jaderberg et al. (2018), we combine algorithms for single-agent RL (in our case, SVG0 for continuous control) with population-based training (PBT) (Jaderberg et al., 2017). We describe the individual components of this framework, and several additional novel algorithmic components introduced in this paper.
+
+# 3.1 POPULATION BASED TRAINING
+
+Population Based Training (PBT) (Jaderberg et al., 2017) was proposed as a method to optimize hyperparameters via a population of simultaneously learning agents: during training, poor performing agents, according to some fitness function, inherit network parameters and some hyperparameters from stronger agents, with additional mutation. Hyperparameters can continue to evolve during training, rather than committing to a single fixed value (we show that this is indeed the case in Section 5.1). PBT was extended to incorporate co-play (Jaderberg et al., 2018) as a method of optimizing agents for MARL: subsets of agents are selected from the population to play together in multi-agent games. In any such game each agent in the population effectively treats the other agents as part of their environment and learns a policy $\pi _ { \theta }$ to optimize their expected return, averaged over such games. In any game in which $\pi _ { \theta }$ controls player $i$ in the game, if we denote by $\overline { { { \pi } } } _ { \backslash i } : = \{ \pi ^ { j } \} _ { j \in \{ 1 , 2 , . . . , n \} , j \neq i }$ the policies of the other agents $j \neq i$ , we can write the expected cumulative return over a game as
+
+Algorithm 1 Population-based Training for Multi-Agent RL.
+
+
1: procedure PBT-MARL
2: 3:
{Ai}i∈[1.,N] N independent agents forming a population. for agent Ai in {Ai}i∈[1.,N] do
4:
Initialize agent network parameters 0i and agent rating ri to fixed initial rating Rinit.
5: 6:
Sample initial hyper-parameter 0' from the initial hyper-parameter distribution.
end for
7: while true do
8:
Agents play TrainingMatches and update network parameters by Retrace-SVG0.
9:
for match result (si,sj) ∈ TrainingMatches do
10:
UpdateRating(ri,rj,Si,Sj) See Appendix B.1
11: 12:
end for
13:
for agent Ai E {Ai}ie[1,., N] do Evolution Procedure
14:
if Eligible(Ai) then > See Appendix B.2
15:
Aj←Select(Ai,{Ai}iε∈[1..,N];i≠j) See Appendix B.3
16:
if Aj ≠ NULL then
17:
Inherit(0,0,,) >Ai inherits from Aj,See Appendix B.4
18:
←Mutate(0) See Appendix B.5
19:
end if
20:
end if
21:
end for
22:
end while
end procedure
+
+$$
+J ^ { i } ( \pi _ { \theta } ; \pi _ { \setminus i } ) : = \mathbb { E } \left[ \sum _ { t = 0 } ^ { H } \gamma ^ { t } r _ { t } ^ { i } | \pi ^ { i } = \pi _ { \theta } , \pi _ { \setminus i } \right]
+$$
+
+where the expectation is w.r.t. the environment dynamics and conditioned on the actions being drawn from policies $\pi _ { \theta }$ and $\pi _ { \backslash i }$ . Each agent in the population attempts to optimize (1) averaged over the draw of all agents from the population $\mathcal { P }$ , leading to the PBT objective $J ( \pi _ { \theta } ) : =$ $\bar { \mathbb { E } _ { i } } [ \mathbb { E } _ { \pi _ { \backslash i } \sim \mathcal { P } } [ J ^ { i } ( \pi _ { \theta } ; \pi _ { \setminus i } ) | \pi ^ { i } = \pi _ { \theta } ] ]$ , where the outer expectation is w.r.t. the probability that the agent with policy $\pi _ { \theta }$ controls player $i$ in the environment, and the inner expectation is the expectation over the draw of other agents, conditioned on $\pi _ { \theta }$ controlling player $i$ in the game. PBT achieves some robustness to exploitability by training a population of learning agents against each other. Algorithm 1 describes PBT-MARL for a population of $N$ agents $\{ A _ { i } \} _ { i \in [ 1 , \ldots , N ] }$ , employed in this work.
+
+# 3.2 RETRACE-SVG0
+
+Throughout our experiments we use Stochastic Value Gradients (SVG0) (Heess et al., 2015b) as our reinforcement learning algorithm for continuous control. This is an actor-critic policy gradient algorithm, which in our setting is used to estimate gradients $\textstyle { \frac { \partial } { \partial \theta } } J ^ { i } ( \pi _ { \theta } ; \pi _ { \setminus i } )$ of the objective (1) for each game. Averaging these gradients over games will effectively optimize the PBT objective $J ( \pi _ { \theta } )$ . Policies are additionally regularized with an entropy loss $H ( \pi )$ i.e. we maximize ${ \hat { J } } ( \pi _ { \theta } ) : = { }$ $J ( \pi _ { \theta } ) + \alpha H ( \pi _ { \theta } )$ using the Adam optimizer (Kingma & Ba, 2014) to apply gradient updates where $\alpha$ represents a multiplicative entropy cost factor. A derivation of SVG0 is provided in Appendix A.
+
+SVG utilizes a differentiable Q-critic. Our critic is learned using experience replay, minimizing a $k$ -step TD-error with off-policy retrace corrections (Munos et al., 2016), using a separate target network for bootstrapping, as is also described in Hausman et al. (2018); Riedmiller et al. (2018). The identity of other agents $\pi _ { \backslash i }$ in a game are not explicitly revealed but are potentially vital for accurate action-value estimation (value will differ when playing against weak rather than strong opponents). Thus, we use a recurrent critic to enable the $Q$ -function to implicitly condition on other players observed behavior, better estimate the correct value for the current game, and generalize over the diversity of players in the population of PBT, and, to some extent, the diversity of behaviors in replay. We find in practice that a recurrent $Q$ -function, learned from partial unrolls, performs very well. Details of our Q-critic updates, including how memory states are incorporated into replay, are given in Appendix A.2.
+
+# 3.3 DECOMPOSED DISCOUNTS AND ACTION-VALUE ESTIMATION FOR REWARD SHAPING
+
+Reinforcement learning agents learning in environments with sparse rewards often require additional reward signal to provide more feedback to the optimizer. Reward can be provided to encourage agents to explore novel states for instance (e.g. Brafman & Tennenholtz, 2001), or some other form of intrinsic motivation. Reward shaping is particularly challenging in continuous control (e.g. Popov et al., 2017) where obtaining sparse rewards is often highly unlikely with random exploration, but shaping can perturb objectives (e.g. Bagnell & Ng, 2005) resulting in degenerate behaviors. Reward shaping is yet more complicated in the cooperative multi-agent setting in which independent agents must optimize a joint objective. Team rewards can be difficult to co-optimize due to complex credit assignment, and can result in degenerate behavior where one agent learns a reasonable policy before its teammate, discouraging exploration which could interfere with the first agent’s behavior as observed by Hausknecht (2016). On the other hand, it is challenging to design shaping rewards which induce desired co-operative behavior.
+
+We design $n _ { r }$ shaping reward functions $\{ r _ { j } : \mathcal { S } \times \mathcal { A } \mathbb { R } \} _ { j = 1 , \dots , n _ { r } }$ , weighted so that $r ( \cdot ) : =$ Pnrj=1 $\begin{array} { r } { \sum _ { j = 1 } ^ { n _ { r } } \alpha _ { j } r _ { j } ( \cdot ) } \end{array}$ is the agent’s internal reward and, as in Jaderberg et al. (2018), we use populationbased training to optimize the relative weighting $\{ \alpha _ { j } \} _ { j = 1 , \ldots , n _ { r } }$ . Our shaping rewards are simple individual rewards to help with exploration, but which would induce degenerate behaviors if badly scaled. Since the fitness function used in PBT will typically be the true environment reward (in our case win/loss signal in soccer), the weighting of shaping rewards can in principle be automatically optimized online using the environment reward signal. One enhancement we introduce is to optimize separate discount factors is then (recalling Equati $\{ \gamma _ { j } \} _ { j = 1 , \dots , n _ { r } }$ $\begin{array} { r } { J ( \pi _ { \theta } ; \pi _ { \setminus i } ) : = \mathbb { E } \big [ \sum _ { j = 1 } ^ { n _ { r } } \alpha _ { j } \sum _ { t = 0 } ^ { H } \gamma _ { j } ^ { t } r _ { j } \big ( s _ { t } , a _ { t } ^ { 1 } , . . . , a _ { t } ^ { n } \big ) \big | \pi ^ { i } = \pi _ { \theta } , \pi _ { \setminus i } \big ] } \end{array}$ . This separation of discount factors enables agents to learn to optimize the sparse environment reward far in the future with a high discount factor, but optimize dense shaping rewards myopically, which would also make value-learning easier. This would be impossible if discounts were confounded. The specific shaping rewards used for soccer are detailed in Section 5.1.
+
+# 4 EXPERIMENTAL SETUP
+
+# 4.1 MUJOCO SOCCER ENVIRONMENT
+
+We simulate 2v2 soccer using the MuJoCo physics engine (Todorov et al., 2012). The 4 players in the game are a single sphere (the body) with 2 fixed arms, and a box head, and have a 3-dimensional action space: accelerate the body forwards/backwards, torque can be applied around the vertical axis to rotate, and apply downwards force to “jump”. Applying torque makes the player spin, gently for steering, or with more force in order to “kick” the football with its arms. At each timestep, proprioception (position, velocity, accelerometer information), task (egocentric ball position, velocity and angular velocity, goal and corner positions) and teammate and opponent (orientation, position and velocity) features are observed making a 93-dimensional input observation vector. Each soccer match lasts upto 45 seconds, and is terminated when the first team scores. We disable contacts between the players, but enable contacts between the players, the pitch and the ball. This makes it impossible for players to foul and avoids the need for a complicated contact rules, and led to more dynamic matches. There is a small border around the pitch which players can enter, but when the ball is kicked out-of-bounds it is reset by automatic “throw in” a small random distance towards the center of the pitch, and no penalty is incurred. The players choose a new action every 0.05 seconds. At the start of an episode the players and ball are positioned uniformly at random on the pitch. We train agents on a field whose dimensions are randomized in the range $2 0 m \times 1 5 m$ to $2 8 m \times 2 1 m$ , with fixed aspect ratio, and are tested on a field of fixed size $2 4 m \times 1 8 m$ . We show an example frame of the game in Figure 1.
+
+
+Figure 1: Top-down view with individual camera views of 2v2 multi-agent soccer environment.
+
+# 4.2 PBT SETTINGS
+
+We use population-based training with 32 agents in the population, an agent is chosen for evolution if its expected win rate against another chosen agent drops below 0.47. The $\mathbf { k }$ -factor learning rate for Elo is 0.1 (this is low, due to the high stochasticity in the game results). Following evolution there is a grace period where the agent does not learn while its replay buffer refills with fresh data, and a further “burn-in” period before the agent can evolve again or before its weights can be copied into another agent, in order to limit the frequency of evolution and maintain diversity in the population. For each 2v2 training match 4 agents were selected uniformly at random from the population of 32 agents, so that agents are paired with diverse teammates and opponents.
+
+# 4.3 EVALUATION
+
+Unlike multi-agent domains where we possess hand-crafted bots or human baselines, evaluating agent performance in novel domains where we do not possess such knowledge remains an open question. A number of solutions have been proposed: for competitive board games, there exits evaluation metrics such as Elo (Elo, 1978) where ratings of two players should translate to their relative win-rates; in professional team sports, head-to-head tournaments are typically used to measure team performance; in Al-Shedivat et al. (2017), survival-of-the-fittest is directly translated to multiagent learning as a proxy to relative agent performance. Unfortunately, as shown in Balduzzi et al. (2018), in a simple game of rock-paper-scissors, a rock-playing agent will attain high Elo score if we simply introduce more scissor-play agents into a tournament. Survival-of-the-fittest analysis as shown in Al-Shedivat et al. (2017) would lead to a cycle, and agent ranking would depend on when measurements are taken (Tuyls et al., 2018).
+
+Nash-Averaging Evaluators: One desirable property for multi-agent evaluation is invariance to redundant agents: i.e. the presence of multiple agents with similar strategies should not bias the ranking. In this work, we apply Nash-averaging which possesses this property. Nash-Averaging consists of a meta-game played using a pair-wise win-rate matrix between $_ \mathrm { N }$ agents. A row player and a column player simultaneously pick distributions over agents for a mixed strategy, aiming for a non-exploitable strategy (see Balduzzi et al., 2018).
+
+In order to meaningfully evaluate our learned agents, we need to bootstrap our evaluation process. Concretely, we choose a set of fixed evaluation teams by Nash-averaging from a population of 10 teams previously produced by diverse training schemes, with 25B frames of learning experience each. We collected 1M tournament matches between the set of 10 agents. Figure 2 shows the pairwise expected goal difference among the 3 agents in the support set. Nash Averaging assigned nonzero weights to 3 teams that exhibit diverse policies with non-transitive performance which would not have been apparent under alternative evaluation schemes: agent A wins or draws against agent B on $5 9 . 7 \%$ of the games; agent B wins or draws against agent C on $7 1 . 1 \%$ of the games and agent C wins or draws against agent A on $6 5 . 3 \%$ of the matches. We show recordings of example tournament matches between agent A, B and C to demonstrate qualitatively the diversity in their policies (video 3 on the website 2). Elo rating alone would yield a different picture: agent $B$ is the best agent in the tournament with an Elo rating of 1084.27, followed by $C$ at 1068.85; Agent $A$ ranks 5th at 1016.48 and we would have incorrectly concluded that agent $\pmb { B }$ ought to beat agent A with a win-rate of $62 \%$ . All variants of agents presented in the experimental section are evaluated against the set of 3 agents in terms of their pair-wise expected difference in score, weighted by support weights.
+
+
+Figure $2 \colon L I$ : selected set of agents in Nash support set with their respective support weights. $L 2$ : pair-wise expected goal difference among evaluator agents. $L 3$ : Elo ratings for all agents computed from tournament matches. $L 4$ : pair-wise expected goal difference among all agents.
+
+# 5 RESULTS
+
+We describe in this section a set of experimental results. We first present the incremental effect of various algorithmic components. We further show that population-based training with co-play and reward shaping induces a progression from random to simple ball chasing and finally coordinated behaviors. A tournament between all trained agents is provided in Appendix D.
+
+# 5.1 ABLATION STUDY
+
+We incrementally introduce algorithmic components and show the effect of each by evaluating them against the set of 3 evaluation agents. We compare agent performance using expected goal difference weighted according to the Nash averaging procedure. We annotate a number of algorithmic components as follows: ff: feedforward policy and action-value estimator; evo: population-based training with agents evolving within the population; rwd shp: providing dense shaping rewards on top of sparse environment scoring/conceding rewards; lstm: recurrent policy with recurrent action-value estimator; lstm q: feedforward policy with recurrent action-value estimator; channels: decomposed action-value estimation for each reward component; each with its own, individually evolving discount factor.
+
+Population-based Training with Evolution: We first introduce PBT with evolution. Figure 3 (ff vs $\mathbf { f } \mathbf { f } + \mathbf { e v } \mathbf { o } { \mathrm { ~ , ~ } }$ ) shows that Evolution kicks in at 2B steps, which quickly improves agent performance at the population level. We show in Figure 4 that Population-based training coupled with evolution yields a natural progression of learning rates, entropy costs as well as the discount factor. Critic learning rate gradually decreases as training progresses, while discount factor increases over time, focusing increasingly on long-term return. Entropy costs slowly decreases which reflects a shift from exploration to exploitation over the course training.
+
+Reward Shaping: We introduced two simple dense shaping rewards in addition to the sparse scoring and conceding environment rewards: vel-to-ball: player’s linear velocity projected onto its unit direction vector towards the ball, thresholded at zero; vel-ball-to-goal: ball’s linear velocity projected onto its unit direction vector towards the center of opponent’s goal. Furthermore the sparse goal reward and concede penalty are separately evolved, and so can receive separate weight that trades off between the importance of scoring versus conceding.
+
+
+Figure 3: Weighted expected goal difference shown in blue line. Agents’ expected goal difference against each evaluator agent in point plot. A dummy evaluator that takes random actions has been introduced to show learning progress early in the training, with zero weight in the performance computation.
+
+
+Figure 4: Evolution of hyper-parameters. Hyperparameters of individual agents within the population in gray.
+
+Dense shaping rewards make learning significantly easier early in training. This is reflected by agents’ performance against the dummy evaluator where agents with dense shaping rewards quickly start to win games from the start (Figure 3, $\mathbf { f } \mathbf { f } + \mathbf { e } \mathbf { v } \mathbf { 0 }$ vs $\mathbf { f f } + \mathbf { e v 0 } +$ rwd shp). On the other hand, shaping rewards tend to induce sub-optimal policies $\mathrm { N g }$ et al., 1999; Popov et al., 2017); We show in Figure 5 however that this is mitigated by coupling training with hyper-parameter evolution which adaptively adjusts the importance of shaping rewards. Early on in the training, the population as a whole decreases the penalty of conceding a goal which evolves towards zero, assigning this reward relatively lower weight than scoring. This trend is subsequently reversed towards the end of training, where the agents evolved to pay more attention to conceding goals: i.e. agents first learn to optimize scoring and then incorporate defending. The dense shaping reward vel-to-ball however quickly decreases in relative importance which is mirrored in their changing behavior, see Section 5.2.
+
+Recurrence: The introduction of recurrence in the action-value function has a significant impact on agents’ performance as shown in Figure 3 $\mathbf { f f } + \mathbf { e v 0 } +$ rwd shp vs $\mathbf { l s t m + e v 0 + }$ rwd shp reaching weighted expected goal difference of 0 at 22B vs 35B steps). A recurrent policy seems to underperform its feedforward counterpart in the presence of a recurrent action-value function. This could be due to out-of-sample evaluators which suggests that recurrent policy might overfit to the behaviors of agents from its own population while feedforward policy cannot.
+
+Decomposed Action-Value Function: While we observed empirically that the discount factor increases over time during the evolution process, we hypothesize that different reward components require different discount factor. We show in Figure 6 that this is indeed the case, for sparse environment rewards and vel-ball-to-goal, the agents focus on increasingly long planning horizon. In contrast, agents quickly evolve to pay attention to short-term returns on vel-to-ball, once they learned the basic movements. Note that although this agent underperforms l $\mathbf { s t m + e v 0 + }$ rwd shp asymptotically, it achieved faster learning in comparison (reaching 0.2 at 15B vs 35B). This agent also attains the highest Elo in a tournament between all of our trained agents, see Appendix D. This indicates that the training population is less diverse than the Nash-averaging evaluation set, motivating future work on introducing diversity as part of training regime.
+
+
+Figure 5: Evolution of relative importance of dense shaping rewards over the course of training. Hyperparameters of individual agents within the population in gray.
+
+
+Figure 6: Evolution of discount factor for each reward component. We show hyperparameters of individual agents within the population in gray.
+
+# 5.2 EMERGENT MULTI-AGENT BEHAVIORS
+
+Assessing cooperative behavior in soccer is difficult. We present several indicators ranging from behavior statistics, policy analysis to behavior probing and qualitative game play in order to demonstrate the level of cooperation between agents.
+
+We provide birds-eye view videos on the website2 (video 1), where each agent’s value-function is also plotted, along with a bar plot showing the value-functions for each weighted shaping reward component. Early in the matches the 2 dense shaping rewards (rightmost channels) dominate the value, until it becomes apparent that one team has an advantage at which point all agent’s value functions become dominated by the sparse conceding/scoring reward (first and second channels) indicating that PBT has learned a balance between sparse environment and dense shaping rewards so that positions with a clear advantage to score will be preferred. There are recurring motifs in the videos: for example, evidence that agents have learned a “cross” pass from the sideline to a teammate in the centre (see Appendix F for example traces), and frequently appear to anticipate this and change direction to receive. Another camera angle is provided on the website2 (video 2) showing representative, consecutive games played between two fixed teams. These particular agents generally kick the ball upfield, avoiding opponents and towards teammates.
+
+# 5.2.1 BEHAVIOR STATISTICS
+
+Statistics collected during matches are shown in Figure 7. The vel-to-ball plot shows the agents average velocity towards the ball as training progresses: early in the learning process agents quickly maximize their velocity towards the ball (optimizing their shaping reward) but gradually fixate less on simple ball chasing as they learn more useful behaviors, such as kicking the ball upfield. The teammate-spread-out shows the evolution of the spread of teammates position on the pitch. This shows the percentage of timesteps where the teammates are spread at least $5 \mathrm { m }$ apart: both agents quickly learn to hog the ball, driving this lower, but over time learn more useful behaviors which result in diverse player distributions. pass/interception shows that pass, where players from the same team consecutively kicked the ball and interception, where players from the opposing teams kicked the ball in sequence, both remain flat throughout training. To pass is the more difficult behavior as it requires two teammates to coordinate whereas interception only requires one of the two opponents to position correctly. pass/interception-10m logs pass/interception events over more than $1 0 \mathrm { m }$ , and here we see a dramatic increase in pass-10m while interception-10m remains flat, i.e. long range passes become increasingly common over the course of training, reaching equal frequency as long-range interception.
+
+
+Figure 7: Behavior statistics evolution.
+
+
+Figure 8: $L l$ : agent’s average velocity towards the ball. $L 2$ : percentage of time when players within a team are spread out. $L 3$ : KL divergence incurred by replacing a subset of state with counterfactual information.
+
+# 5.2.2 COUNTERFACTUAL POLICY DIVERGENCE
+
+In addition to analyzing behavior statistics, we could ask the following: “had a subset of the observation been different, how much would I have changed my policy?”. This reveals the extent to which an agent’s policy is dependent on this subset of the observation space. To quantify this, we analyze counterfactual policy divergence: at each step, we replace a subset of the observation with 10 valid alternatives, drawn from a fixed distribution, and we measure the KL divergence incurred in agents’ policy distributions. This cannot be measured for a recurrent policy due to recurrent states and we investigate $\mathbf { f f } + \mathbf { e v 0 } +$ rwd shp instead (Figure 3), where the policy network is feedforward. We study the effect of five types of counterfactual information over the course of training.
+
+ball-position has a strong impact on agent’s policy distribution, more so than player and opponent positions. Interestingly, ball-position initially reaches its peak quickly while divergence incurred by counterfactual player/opponent positions plateau until reaching 5B training steps. This phase coincides with agent’s greedy optimization of shaping rewards, as reflected in Figure 8. Counterfactual teammate/opponent position increasingly affect agents’ policies from 5B steps, as they spread out more and run less directly towards the ball. Opponent-0/1-position incur less divergence than teammate position individually, suggesting that teammate position has relatively large impact than any single opponent, and increasingly so during 5B-20B steps. This suggests that comparatively players learn to leverage a coordinating teammate first, before paying attention to competing opponents. The gap between teammate-position and opponents-position eventually widens, as opponents become increasingly relevant to the game dynamics. The progression observed in counterfactual policy divergence provides evidence for emergent cooperative behaviors among the players.
+
+# 5.2.3 MULTI-AGENT BEHAVIOR PROBING
+
+Qualitatively, we could ask the following question: would agents coordinate in scenarios where it’s clearly advantageous to do so? To this end, we designed a probe task, to test our trained agents for coordination, where blue0 possesses the ball, while the two opponents are centered on the pitch in front. A teammate blue1 is introduced to either left or right side. In Figure 9 we show typical traces of agents’ behaviors (additional probe task video shown at Video 4 on our website2): at 5B steps, when agents play more individualistically, we observe that blue0 always tries to dribble the ball by itself, regardless of the position of blue1. Later on in the training, blue0 actively seeks to pass and its behavior is driven by the configuration of its teammate, showing a high-level of coordination. In “8e10 left” in particular, we observe two consecutive pass (blue0 to blue1 and back), in the spirit of 2-on-1 passes that emerge frequently in human soccer games.
+
+
+Figure 9: L1: Comparison between two snapshots (5B vs 80B) of the same agent. $L 2$ : number of successful passes and interception occurred in the first 100 timesteps, aggregated over 100 episodes.
+
+
pass
intercept
5B_left
0
100
5B_right
31
90
80B_left
76
24
80B_right
56
27
+
+# 6 RELATED WORK
+
+The population-based training we use here was introduced by Jaderberg et al. (2018) for the capturethe-flag domain, whereas our implementation is for continuous control in simulated physics which is less visually rich but arguably more open-ended, with potential for sophisticated behaviors generally and allows us to focus on complex multi-agent interactions, which may often be physically observable and interpretable (as is the case with passing in soccer). Other recent related approaches to multi-agent training include PSRO (Lanctot et al., 2017) and NFSP (Heinrich & Silver, 2016), which are motivated by game-theoretic methods (fictitious play and double oracle) for solving matrix games, aiming for some robustness by playing previous best response policies, rather than the (more data efficient and parallelizable) approach of playing against simultaneous learning agents in a population. The RoboCup competition is a grand challenge in AI and some top-performing teams have used elements of reinforcement learning (Riedmiller et al., 2009; MacAlpine & Stone, 2018), but are not end-to-end RL. Our environment is intended as a research platform, and easily extendable along several lines of complexity: complex bodies; more agents; multi-task, transfer and continual learning. Coordination and cooperation has been studied recently in deepRL in, for example, Lowe et al. (2017); Foerster et al. (2018; 2016); Sukhbaatar et al. (2016); Mordatch & Abbeel (2018), but all of these require some degree of centralization. Agents in our framework perform fully independent asynchronous learning yet demonstrate evidence of complex coordinated behaviors. Bansal et al. (2017); Al-Shedivat et al. (2017) introduce a MuJoCo Sumo domain with similar motivation to ours, and observe emergent complexity from competition, in a 1v1 domain. We are explicitly interested in cooperation within teams as well as competition. Other attempts at optimizing rewards for multi-agent teams include Liu et al. (2012).
+
+# 7 CONCLUSIONS AND FUTURE WORK
+
+We have introduced a new 2v2 soccer domain with simulated physics for continuous multi-agent reinforcement learning research, and used competition between agents in this simple domain to train teams of independent RL agents, demonstrating coordinated behavior, including repeated passing motifs. We demonstrated that a framework of distributed population-based-training with continuous control, combined with automatic optimization of shaping reward channels, can learn in this environment end-to-end. We introduced the idea of automatically optimizing separate discount factors for the shaping rewards, to facilitate the transition from myopically optimizing shaping rewards towards alignment with the sparse long-horizon team rewards and corresponding cooperative behavior. We have introduced novel method of counterfactual policy divergence to analyze agent behavior. Our evaluation has highlighted non-transitivities in pairwise match results and the practical need for robustness, which is a topic for future work. Our environment can serve as a platform for multiagent research with continuous physical worlds, and can be easily scaled to more agents and more complex bodies, which we leave for future research.
+
+# REFERENCES
+
+Maruan Al-Shedivat, Trapit Bansal, Yuri Burda, Ilya Sutskever, Igor Mordatch, and Pieter Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. arXiv preprint arXiv:1710.03641, 2017.
+
+J. Andrew Bagnell and Andrew Y. Ng. On local rewards and scaling distributed reinforcement learning. In Advances in Neural Information Processing Systems 18 [Neural Information Processing Systems, NIPS 2005, December 5-8, 2005, Vancouver, British Columbia, Canada], pp. 91–98, 2005.
+
+David Balduzzi, Karl Tuyls, Julien Perolat, and Thore Graepel. Re-evaluating evaluation. arXiv preprint arXiv:1806.02643, 2018.
+
+Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. arXiv preprint arXiv:1710.03748, 2017.
+
+Ronen I. Brafman and Moshe Tennenholtz. R-MAX - A general polynomial time algorithm for nearoptimal reinforcement learning. In Proceedings of the Seventeenth International Joint Conference on Artificial Intelligence, IJCAI 2001, Seattle, Washington, USA, August 4-10, 2001, pp. 953–958, 2001.
+
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016.
+
+Murray Campbell, A. Joseph Hoane Jr., and Feng-hsiung Hsu. Deep blue. Artif. Intell., 134(1-2): 57–83, 2002.
+
+Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). CoRR, abs/1511.07289, 2015.
+
+Arpad E. Elo. The rating of chessplayers, past and present. Arco Pub., New York, 1978. ISBN 0668047216 9780668047210. URL http://www.amazon.com/ Rating-Chess-Players-Past-Present/dp/0668047216.
+
+Jakob N. Foerster, Yannis M. Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 2137–2145, 2016.
+
+Jakob N. Foerster, Nantas Nardelli, Gregory Farquhar, Triantafyllos Afouras, Philip H. S. Torr, Pushmeet Kohli, and Shimon Whiteson. Stabilising experience replay for deep multi-agent reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 1146–1155, 2017.
+
+Jakob N. Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, New Orleans, Louisiana, USA, February 2-7, 2018, 2018.
+
+Matthew John Hausknecht. Cooperation and communication in multiagent deep reinforcement learning. PhD thesis, University of Texas at Austin, Austin, USA, 2016.
+
+Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations, 2018.
+
+Nicolas Heess, Jonathan J. Hunt, Timothy P. Lillicrap, and David Silver. Memory-based control with recurrent neural networks. CoRR, abs/1512.04455, 2015a.
+
+Nicolas Heess, Gregory Wayne, David Silver, Tim Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Advances in Neural Information Processing Systems, pp. 2944–2952, 2015b.
+
+Nicolas Heess, Gregory Wayne, Yuval Tassa, Timothy P. Lillicrap, Martin A. Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. CoRR, abs/1610.05182, 2016. URL http://arxiv.org/abs/1610.05182.
+
+Nicolas Heess, Dhruva TB, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, S. M. Ali Eslami, Martin A. Riedmiller, and David Silver. Emergence of locomotion behaviours in rich environments. CoRR, abs/1707.02286, 2017. URL http: //arxiv.org/abs/1707.02286.
+
+Johannes Heinrich and David Silver. Deep reinforcement learning from self-play in imperfectinformation games. CoRR, abs/1603.01121, 2016.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
+
+Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017.
+
+Max Jaderberg, Wojciech Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garc´ıa Castaneda, Charles Beattie, Neil C. Rabinowitz, Ari S. Morcos, Avraham Ruderman, Nico- ˜ las 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. CoRR, abs/1807.01281, 2018.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
+
+Hiroaki Kitano, Minoru Asada, Yasuo Kuniyoshi, Itsuki Noda, and Eiichi Osawa. Robocup: The robot world cup initiative. In Agents, pp. 340–347, 1997.
+
+Marc Lanctot, Vin´ıcius Flores Zambaldi, Audrunas Gruslys, Angeliki Lazaridou, Karl Tuyls, Julien Perolat, David Silver, and Thore Graepel. A unified game-theoretic approach to multiagent re- ´ inforcement learning. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 4193–4206, 2017.
+
+Michael L. Littman. Markov games as a framework for multi-agent reinforcement learning. In In Proceedings of the Eleventh International Conference on Machine Learning, pp. 157–163. Morgan Kaufmann, 1994.
+
+Bingyao Liu, Satinder P. Singh, Richard L. Lewis, and Shiyin Qin. Optimal rewards in multiagent teams. In 2012 IEEE International Conference on Development and Learning and Epigenetic Robotics, ICDL-EPIROB 2012, San Diego, CA, USA, November 7-9, 2012, pp. 1–8, 2012.
+
+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.
+
+Patrick MacAlpine and Peter Stone. Overlapping layered learning. Artif. Intell., 254:21–43, 2018. doi: 10.1016/j.artint.2017.09.001. URL https://doi.org/10.1016/j.artint.2017. 09.001.
+
+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.
+
+Matej Moravk, 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 no-limit poker. 356, 01 2017.
+
+Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, New Orleans, Louisiana, USA, February 2-7, 2018, 2018.
+
+Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc Bellemare. Safe and efficient off-policy ´ reinforcement learning. In Advances in Neural Information Processing Systems, pp. 1054–1062, 2016.
+
+Andrew Y. Ng, Daishi Harada, and Stuart J. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In Proceedings of the Sixteenth International Conference on Machine Learning (ICML 1999), Bled, Slovenia, June 27 - 30, 1999, pp. 278–287, 1999.
+
+Ivaylo Popov, Nicolas Heess, Timothy P. Lillicrap, Roland Hafner, Gabriel Barth-Maron, Matej Vecerik, Thomas Lampe, Yuval Tassa, Tom Erez, and Martin A. Riedmiller. Data-efficient deep reinforcement learning for dexterous manipulation. CoRR, abs/1704.03073, 2017.
+
+Martin Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Van de Wiele, Volodymyr Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playingsolving sparse reward tasks from scratch. arXiv preprint arXiv:1802.10567, 2018.
+
+Martin A. Riedmiller, Thomas Gabel, Roland Hafner, and Sascha Lange. Reinforcement learning for robot soccer. Auton. Robots, 27(1):55–73, 2009.
+
+A. L. Samuel. Some studies in machine learning using the game of checkers. IBM J. Res. Dev., 3 (3):210–229, July 1959. ISSN 0018-8646.
+
+L. S. Shapley. Stochastic games. Proceedings of the National Academy of Sciences of the United States of America, 39(10):1095–1100, 1953.
+
+David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin A. Riedmiller. Deterministic policy gradient algorithms. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pp. 387–395, 2014.
+
+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.
+
+Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 2244–2252, 2016.
+
+R. Sutton and A. Barto. Reinforcement Learning: An Introduction. MIT Press, 1998.
+
+Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy P. Lillicrap, and Martin A. Riedmiller. Deepmind control suite. CoRR, abs/1801.00690, 2018.
+
+G. Tesauro. Temporal difference learning and td-gammon. Commun. ACM, 38(3):58–68, March 1995.
+
+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, IROS 2012, Vilamoura, Algarve, Portugal, October 7-12, 2012, pp. 5026–5033, 2012.
+
+Karl Tuyls, Julien Perolat, Marc Lanctot, Joel Z Leibo, and Thore Graepel. A generalised method for empirical game theoretic analysis. arXiv preprint arXiv:1803.06376, 2018.
+
+Oriol Vinyals, Timo Ewalds, Sergey Bartunov, Petko Georgiev, Alexander Sasha Vezhnevets, Michelle Yeo, Alireza Makhzani, Heinrich Kuttler, John Agapiou, Julian Schrittwieser, John ¨ Quan, Stephen Gaffney, Stig Petersen, Karen Simonyan, Tom Schaul, Hado van Hasselt, David Silver, Timothy P. Lillicrap, Kevin Calderone, Paul Keet, Anthony Brunasso, David Lawrence, Anders Ekermo, Jacob Repp, and Rodney Tsing. Starcraft II: A new challenge for reinforcement learning. CoRR, abs/1708.04782, 2017.
+
+# A OFF-POLICY SVG0 ALGORITHM
+
+# A.1 POLICY UPDATES
+
+The Stochastic Value Gradients (SVG0) algorithm used throughout this work is a special case of the family of policy gradient algorithms provided by Heess et al. (2015b) in which the gradient of a value function used to compute the policy gradient, and is closely related to the Deterministic Policy Gradient algorithm (DPG) (Silver et al., 2014), which is itself a special case of SVG0. For clarity we provide the specific derivation of SVG0 here.
+
+Using the reparametrization method of Heess et al. (2015b) we write a stochastic policy $\pi _ { \boldsymbol { \theta } } ( \cdot | \boldsymbol { s } )$ as a deterministic policy $\mu _ { \theta } : { \mathcal { S } } \times \mathbb { R } \to { \mathcal { A } }$ further conditioned on a random variable $\eta \in \mathbb { R } ^ { p }$ , so that $a \sim \pi _ { \theta } ( \cdot | s )$ is equivalent to $a \sim \mu _ { \theta } ( s , \eta )$ , where $\eta \sim \rho$ for some distribution $\rho$ . Then,
+
+$$
+\begin{array} { r l } & { \begin{array} { r l } & { Q ^ { \pi _ { \theta } } ( s , a ) = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) } [ \mathbb { E } _ { a ^ { \prime } \sim \pi ( \cdot \vert s ^ { \prime } ) } [ Q ^ { \pi _ { \theta } } ( s ^ { \prime } , a ^ { \prime } ) ] ] } \\ & { \quad \quad \quad \quad \quad \quad = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) } [ \mathbb { E } _ { \eta ^ { \prime } \sim \rho } [ Q ^ { \pi _ { \theta } } ( s ^ { \prime } , \mu _ { \theta } ( s ^ { \prime } , \eta ^ { \prime } ) ) ] ] } \end{array} } \\ & { \begin{array} { r l } & { \underline { { \mathcal { Q } } } ^ { \pi _ { \theta } } ( s , a ) = \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) } [ \mathbb { E } _ { \eta ^ { \prime } \sim \rho } [ \underline { { \partial } } \theta Q ^ { \pi _ { \theta } } ( s ^ { \prime } , \mu _ { \theta } ( s ^ { \prime } , \eta ^ { \prime } ) ) ] ] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \end{array} } \\ & { = \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) } [ \mathbb { E } _ { \eta ^ { \prime } \sim \rho } [ \underline { { \partial } } Q ^ { \pi _ { \theta } } ( s ^ { \prime } , a ^ { \prime } ) ] _ { a ^ { \prime } = \mu _ { \theta } ( s ^ { \prime } , \eta ^ { \prime } ) } + \frac { \partial } { \partial a ^ { \prime } } Q ^ { \pi _ { \theta } } ( s ^ { \prime } , a ^ { \prime } ) ] _ { a ^ { \prime } = \mu _ { \theta } ( s ^ { \prime } , \eta ^ { \prime } ) } \frac { \partial } { \partial \theta } \mu _ { \theta } ( s ^ { \prime } , \eta ^ { \prime } ) ] } \end{array}
+$$
+
+from which we obtain a recursion for $\frac { \partial Q ^ { \pi _ { \theta } } ( s , a ) } { \partial \theta }$ . Expanding the recursion we obtain the policy gradient
+
+$$
+\begin{array} { c } { { \displaystyle \frac { \partial Q ^ { \pi _ { \theta } } ( s _ { 0 } , a _ { 0 } ) } { \partial \theta } = \sum _ { t = 1 } ^ { \infty } \gamma ^ { t } \mathbb { E } _ { s _ { t } \sim P ( \cdot | s _ { t - 1 } , a _ { t - 1 } ) } \Biggl [ \mathbb { E } _ { \eta _ { t } \sim \rho } \biggl [ \displaystyle \frac { \partial } { \partial a _ { t } } Q ^ { \pi _ { \theta } } ( s _ { t } , a _ { t } ) \biggr | _ { a _ { t } = \mu _ { \theta } ( s _ { t } , \eta _ { t } ) } \times } } \\ { { \displaystyle \left. \frac { \partial } { \partial \theta } \mu _ { \theta } ( s _ { t } , \eta _ { t } ) \right] \biggl | s _ { 0 } , a _ { 0 } , a _ { \tau } = \mu _ { \theta } ( s _ { \tau } , \eta _ { \tau } ) , \eta _ { \tau } \sim \rho \forall \tau < t \biggr ] } } \\ { { \displaystyle = \int _ { \mathcal { S } } \int _ { \mathbb { R } ^ { p } } \zeta ( s , \eta ) \displaystyle \frac { \partial } { \partial a } Q ^ { \pi _ { \theta } } ( s , a ) \Biggl | _ { a = \mu _ { \theta } ( s , \eta ) } \displaystyle \frac { \partial } { \partial \theta } \mu _ { \theta } ( s , \eta ) d \eta d s } } \end{array}
+$$
+
+where $\begin{array} { r } { \zeta ( s , \eta ) : = \sum _ { t = 1 } ^ { \infty } \gamma ^ { t } p _ { t } ( s , \eta ) } \end{array}$ and where $p _ { t } ( s , \eta )$ is the joint density over (state, $\eta$ ) at timestep $t$ following the policy. Typically $\gamma$ is replaced with 1 in the definition of $\zeta$ to avoid discounting terms depending on future states in the gradient too severely. This suggests Algorithm 3 given in Heess et al. (2015b). For details on recurrent policies see Heess et al. (2015a).
+
+# Algorithm 2 Off-policy SVG0 algorithm (Heess et al., 2015b).
+
+1: initialize replay buffer $B = \varnothing$
+2: sample initial state $s _ { 0 }$ from environment
+3: for t $\scriptstyle \mathbf { d o } = 0$ to $\infty$ do
+4: sample action from current policy $a _ { t } = \mu _ { \theta } ( \cdot | s _ { t } , \eta )$ , $\eta \sim \rho$
+5: observe reward and state observation $r _ { t } , s _ { t }$
+6: 7: $\begin{array} { r } { \theta \gets \theta + \alpha \frac { \partial } { \partial a } Q ^ { \pi _ { \theta } } ( s _ { t } , a ; \psi ) \big | _ { a = \mu _ { \theta } ( s _ { t } , \eta _ { t } ) } \frac { \partial } { \partial \theta } \mu _ { \theta } ( s _ { t } , \eta _ { t } ) } \end{array}$ $Q ^ { \pi _ { \theta } } ( \cdot , \cdot ; \psi )$ $\boldsymbol { B }$ )
+8: end for
+
+# A.2 Q-VALUE UPDATES
+
+As in Section 3.1, in any given game, by treating all other players as part of the environment dynamics, we can define action-value function for policy $\pi _ { \theta }$ controlling player $i$ :
+
+$$
+Q ^ { \pi _ { \theta } , i } ( s , a ; \pi _ { \backslash i } ) : = \mathbb { E } \big [ \sum _ { t = 0 } ^ { H } \gamma ^ { t } r _ { t } ^ { i } \big | s _ { 0 } = s , a _ { 0 } ^ { i } = a ; \pi ^ { i } = \pi _ { \theta } , \pi _ { \backslash i } \big ]
+$$
+
+In our soccer environment the reward is invariant over player and we can drop the dependence on $i$
+
+SVG requires the critic to learn a differentiable Q-function. The true state of the game $s$ and the identity of other agents $\pi _ { \backslash i }$ , are not revealed during a game and so identities must be inferred from their behavior, for example. Further, as noted in Foerster et al. (2017), off-policy replay is not always fully sound in multi-agent environments since the effective dynamics from any single agent’s perspective changes as the other agent’s policies change. Because of this, we generally model $Q$ as a function of an agents history of observations - typically keeping a low dimensional summary in the internal state of an LSTM: $Q ^ { \pi _ { \theta } } ( \cdot , \cdot ; \psi ) : \mathcal { X } \times \mathcal { A } \mathbb { R }$ , where $\mathcal { X }$ denotes the space of possible histories or internal memory state, parameterized by a neural network with weights $\psi$ . This enables the $Q$ -function to implicitly condition on other players observed behavior and generalize over the diversity of players in the population and diversity of behaviors in replay, $Q$ is learned using trajectory data stored in an experience replay buffer $\boldsymbol { B }$ , by minimizing the $k$ -step return TD-error with off-policy retrace correction (Munos et al., 2016), using a separate target network for bootstrapping, as is also described in Hausman et al. (2018); Riedmiller et al. (2018). Specifically we minimize:
+
+$$
+L ( \psi ) : = \mathbb { E } _ { \xi \sim \mathcal { B } } \left[ ( Q ^ { \pi _ { \theta } } ( x _ { i } , a _ { i } ; \psi ) - Q _ { \tt r e t r a c e } ( \xi ) ) ^ { 2 } \right]
+$$
+
+where $\xi : = ( ( s _ { t } , a _ { t } , r _ { t } ) ) _ { t = i } ^ { i + k }$ is a $\mathrm { k }$ -step trajectory snippet, where $i$ denotes the timestep of the first state in the snippet, sampled uniformly from the replay buffer of prior experience, and $Q _ { \tt r e t r a c e }$ is the off-policy corrected retrace target:
+
+$$
+\begin{array} { l } { { Q _ { \mathrm { r e t r a c e } } ( \xi ) : = \displaystyle \hat { Q } ( x _ { i } , a _ { i } ; \hat { \psi } ) + \sum _ { t = 0 } ^ { k } \gamma ^ { t } \left( \prod _ { s = i + 1 } ^ { t + i } c _ { s } \right) \left( r ( s _ { i + t } , a _ { i + t } ) + \right. } } \\ { { \left. \qquad \gamma \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert x _ { i + t + 1 } ) } [ \hat { Q } ( x _ { i + t + 1 } , a ; \hat { \psi } ) ] - \hat { Q } ( x _ { i + t } , a _ { i + t } ; \hat { \psi } ) \right) } } \end{array}
+$$
+
+where, for stability, $\hat { Q } ( \cdot , \cdot ; \hat { \psi } ) : \mathcal { X } \times \mathcal { A } \mathbb { R }$ and $\hat { \pi }$ are target network and policies (Mnih et al., 2015) periodically synced with the online action-value critic and policy (in our experiments we sync after every 100 gradient steps), and $\begin{array} { r } { c _ { s } : = m i n ( 1 , \frac { \pi ( a _ { s } | x _ { s } ) } { \beta ( a _ { s } | x _ { s } ) } ) } \end{array}$ , where $\beta$ denotes the behavior policy which generated the trajectory snippet $\xi$ sampled from $\boldsymbol { B }$ , and $\textstyle \prod _ { s = i \pm 1 } ^ { i } c _ { s } : = 1$ . In our soccer experiments $k = 4 0$ . Though we use off-policy corrections, the replay buffer has a threshold, to ensure that data is relatively recent.
+
+When modelling $Q$ using an LSTM the agent’s internal memory state at the first timestep of the snippet is stored in replay, along with the trajectory data. When replaying the experience the LSTM is primed with this stored internal state but then updates its own state during replay of the snippet. LSTMs are optimized using backpropagation through time with unrolls truncated to length 40 in our experiments.
+
+# B POPULATION-BASED TRAINING PROCEDURE
+
+# B.1 FITNESS
+
+We use Elo rating (Elo (1978)), introduced to evaluate the strength of human chess players, to measure an agent’s performance within the population of learning agents and determine eligibility for evolution. Elo is updated from pairwise match results and can be used to predict expected win rates against the other members of the population.
+
+For a given pair of agents $i , j$ (or a pair of agent teams), $s _ { e l o }$ estimates the expected win rate of agent $i$ playing against agent $j$ . We show in Algorithm 3 the update rule for a two player competitive game for simplicity, for a team of multiple players, we use their average Elo score instead.
+
+By using Elo as the fitness function, driving the evolution of the population’s hyperparamters, the agents’ internal hyperparameters (see Section 3.3) can be automatically optimized for the objective we are ultimately interested in - the win rate against other agents. Individual shaping rewards would otherwise be difficult to handcraft without biasing this objective.
+
+# Algorithm 3 Iterative Elo rating update.
+
+1: Initialize rating $r _ { i }$ for each agent in the agent population.
+2: $K$ : step size of Elo rating update given one match result.
+3: $s _ { i } , s _ { j }$ : score for agent $i , j$ in a given match.
+4: procedure UPDATERATIN $\mathsf { I G } ( r _ { i } , r _ { j } , s _ { i } , s _ { j } )$
+5: $s \gets ( \mathrm { s i g n } ( s _ { i } - s _ { j } ) + 1 ) / 2$
+6: selo ← 1/(1 + 10(rj−ri)/400)
+7: $r _ { i } r _ { i } + K ( s - s _ { e l o } )$
+8: $r _ { j } r _ { j } - K ( s - s _ { e l o } )$
+9: end procedure
+
+# B.2 EVOLUTION ELIGIBILITY
+
+To limit the frequency of evolution and prevent premature convergence of the population, we adopted the same eligibility criteria introduced in Jaderberg et al. (2017). In particular, we consider an agent $i$ eligible for evolution if it has:
+
+1. processed $2 \times 1 0 ^ { 9 }$ frames for learning since the beginning of training; and 2. processed $4 \times 1 0 ^ { 8 }$ frames for learning since the last time it became eligible for evolution. and agent $j$ can be a parent if agent $j$ has 1. processed $4 \times 1 0 ^ { 8 }$ frames for learning since it last evolved. which we refer to as a “burn-in” period.
+
+# B.3 SELECTION
+
+When an agent $i$ becomes eligible for evolution, it is compared against another agent $j$ who has finished its “burn-in” period for evolution selection. We describe this procedure in Algorithm 4.
+
+Algorithm 4 Given agent $i$ , select an agent $j$ to evolve to.
+
+1: $T _ { s e l e c t }$ : win rate selection threshold below which $A _ { i }$ should evolve to $A _ { j }$ .
+2: $r _ { i } , r _ { j }$ : Elo ratings of agents $i , j$ .
+3: procedure $\operatorname { S E L E C T } ( A _ { i } , \{ A _ { i } \} _ { i \in [ 1 , \dots , N ] ; i \neq j } )$
+4: Choose $A _ { j }$ uniformly at random from $\{ A _ { i } \} _ { i \in [ 1 , . . , N ] ; i \neq j }$ .
+5: selo ← 1/(1 + 10(rj−ri)/400)
+6: if $s _ { e l o } < T _ { s e l e c t }$ then
+7: return $A _ { j }$
+8: else
+9: return NULL
+10: end if
+11: end procedure
+
+# B.4 INHERITANCE
+
+Upon selection for evolution, agent $i$ inherits hyperparameters from agent $j$ by “cross-over” meaning that hyperparameters are either inherited or not independently with probability 0.5 as described in Algorithm 5:
+
+# B.5 MUTATION
+
+Upon each evolution action the child agent mutates its hyper-parameters with mutation probability $p _ { m u t a t e }$ at a multiplicative perturbation scale $p _ { p e r t u r b }$ . In this work, we apply a mutation probability of $p _ { m u t a t e } = 0 . 1$ and $p _ { p e r t u r b } = 0 . 2$ for all experiments. We limit a subset of hyperparameters to bounded ranges (e.g. discount factor) such that their values remain valid throughout training.
+
+Algorithm 5 Agent $i$ inherits from agent $j$ by cross-over.
+
+1: Agent $i , j$ with respective network parameters $\theta _ { i } , \theta _ { j }$ and hyper-parameters $\theta _ { i } ^ { h } , \theta _ { j } ^ { h }$ .
+2: procedure INHERIT $\cdot ( \theta _ { i } , \theta _ { j } , \theta _ { i } ^ { h } , \theta _ { j } ^ { h } )$
+3: ${ \theta _ { i } \theta _ { j } }$
+4: $m = ( m _ { k } ) _ { k }$ , mk ∼ bernouilli(0.5)
+5: $\theta _ { i } ^ { h } m \theta _ { i } ^ { h } + ( 1 - m ) \theta _ { j } ^ { h }$
+6: end procedure
+
+# C FURTHER ENVIRONMENT DETAILS AND AGENT PARAMETERIZATION
+
+# C.1 POLICY PARAMETRIZATION AND OPTIMIZATION
+
+We parametrize each agent’s policy and critic using neural networks. Observation preprocessing is first applied to each raw teammate and opponent feature using a shared 2-layer network with 32 and 16 neurons and Elu activations (Clevert et al., 2015) to embed each individual player’s data into a consistent, learned 16 dimensional embedding space. The maximum, minimum and mean of each dimension is then passed as input to the remainder of the network, where it is concatenated with the ball and pitch features. This preprocessing makes the network architecture invariant to the order of teammates and opponents features.
+
+Both critic and actor then apply 2 feed-forward, elu-activated, layers of size 512 and 256, followed by a final layer of 256 neurons which is either feed-forward or made recurrent using an LSTM (Hochreiter & Schmidhuber, 1997). Weights are not shared between critic and actor networks.
+
+We learn the parametrized gaussian policies using SVG0 as detailed in Appendix A, and the critic as described in Section A.2, with the Adam optimizer (Kingma & Ba, 2014) used to apply gradient updates.
+
+# D HEAD-TO-HEAD TOURNAMENT OF TRAINED AGENTS
+
+We also ran a round robin tournament with 50,000 matches between the best teams from 5 populations of agents (selected by Elo within their population), all trained for 5e10 agent steps - i.e. each learner had processed at least 5e10 frames from the replay buffer, though the number of raw environment steps would be much lower than that) and computed the Elo score. This shows the advantage of including shaping rewards, adding a recurrent critic and separate reward and discount channels, and the further (marginal) contribution of a recurrent actor. The full win rate matrix for this tournament is given in Figure 10. Note that the agent with full recurrence and separate reward channels attains the highest Elo in this tournament, though performance against our Nash evaluators in Section 5.1 is more mixed. This highlights the possibility for non-transitivities in this domain and the practical need for robustness to opponents.
+
+# E HYPERPARAMETER EVOLUTION
+
+To assess the relative importance of hyperparameters we replicated a single experiment (using a feed-forward policy and critic network) with 3 different seeds, see Figure 11. Critic learning rate and entropy regularizer evolve consistently over the three training runs. In particular the critic learning rate tends to be reduced over time. If a certain hyperparameter was not important to agent performance we would expect less consistency in its evolution across seeds, as selection would be driven by other hyperparameters: thus indicating performance is more sensitive to critic learning rate than actor learning rate.
+
+
+Figure 10: Win rate matrix for the Tournament between teams: from top to bottom, ordered by Elo, ascending: $\mathbf { f } \mathbf { f } + \mathbf { e v } \mathbf { o }$ ; $\mathbf { f f } + \mathbf { e v 0 } +$ rwd shp; lstm $\mathbf { q } + \mathbf { e v } \mathbf { 0 } +$ rwd shp; lstm $\mathbf { q } + \mathbf { e v } \mathbf { 0 } +$ rwd shp $^ +$ channels; $\mathbf { l s t m + e v 0 + }$ rwd shp $^ +$ channels. ELo derived from the tournament is given in the table.
+
+
+Figure 11: Hyperparameter evolution for three separate seeds, displayed over three separate rows.
+
+# F BEHAVIOR VISUALIZATIONS
+
+As well as the videos at the website3, we provide visualizations of traces of the agent behavior, in the repeated “cross pass” motif, see Figure 12.
+
+
+Figure 12: On the left red agent 0 has passed to agent 1, who apparently ran into position to receive. On the right blue agent 1 has passed to agent 0.
\ No newline at end of file
diff --git a/md/train/BkS3fnl0W/BkS3fnl0W.md b/md/train/BkS3fnl0W/BkS3fnl0W.md
new file mode 100644
index 0000000000000000000000000000000000000000..6b0c0ad9b4659876ae890446a880715be37ced54
--- /dev/null
+++ b/md/train/BkS3fnl0W/BkS3fnl0W.md
@@ -0,0 +1,264 @@
+# SEMI-SUPERVISED OUTLIER DETECTION USING GEN-ERATIVE AND ADVERSARY FRAMEWORK
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+In a conventional binary/multi-class classification task, the decision boundary is supported by data from two or more classes. However, in one-class classification task, only data from one class are available. To build a robust outlier detector using only data from the positive class, we propose a corrupted GAN (CorGAN), a deep convolutional Generative Adversary Network requiring no convergence during the training process. In the adversarial process of training the CorGAN, the Generator is supposed to generate outlier samples for the negative class, and the Discriminator is trained to distinguish training datasets (i.e., positive samples) from generated data from the Generator (i.e., negative samples). We also propose a lot of techniques to improve the performance of the built classifier (i.e., the Discriminator). The proposed model outperforms the traditional method $\mathrm { P C A } +$ PSVM (Scholkopf et al., 2000) and the solution based on Autoencoder (Thompson ¨ et al., 2002).
+
+# 1 INTRODUCTION
+
+(Hodge & Austin, 2004) addresses three fundamental approaches detecting outliers. The first approach is unsupervised clustering that identifies outliers without using any prior knowledge of the data. The second approach, supervised classification, requires labeled data from both positive class and negative class. The third addressed approach detects outliers using only data from the positive class via semi-supervised learning. Semi-supervised learning has gained increasing attention in recent years. One-class classification(OCC), as a typical semi-supervised learning technique, is applied to detect outliers using only positive examples from one class. The semi-supervised learning in this paper focuses on the OCC technique.
+
+To motivate the importance of OCC, we first make an introduction to a classic application scenario. In industry, machine monitoring system is used everywhere to detect machine faults. A classifier should be constructed to detect when the machine behaves abnormally. Obviously, the training data for the positive class is easy to obtain by measuring the normal operations of the machine. However, only limited training data is available, even totally unavailable. In such case, a classifier should be built only on positive training data. This kind of task is known as OCC task. The name ”oneclass classification” originates from the paper Moya et al. (1993). Other researchers also present similar tasks with other terms such as Outlier Detection (Ritter & Gallegos, 1997), Novelty Detection (Bishop, 1994) or Concept Learning (Japkowicz, 1999). They are used interchangeably in this paper, even though they have specific meanings in other works. One-class classification can be used not only in machine monitoring task but also in many other domains, e.g. Text mining (Basu et al., 2004), Sentiment Analysis (Agarwal et al., 2015) and IT security (Lakhina et al., 2005).
+
+Many solutions have been proposed to solve the one-class classification problem. However, almost none of them shows acceptable performance in high-dimensional space. Neural Network with deep architecture is well known for the ability to manipulate high-dimensional data. It achieves state-ofart results in speech recognition, visual object recognition, object detection and many other domains such as drug discovery and genomics (LeCun et al., 2015). This paper applies a neural network with deep architecture in outlier detection task. Generative adversary framework(GAN) is composed of a Generator $G$ that can be used to generate outliers and a Discriminator that can be trained as a binary classifier. The framework is a potential solution to detect outliers through generating counterexamples. Usually, the Nash equilibrium of the training process of GANs cannot be guaranteed in practice. Our proposed model requires no convergence of the training process since the $G$ is used to generate only outliers instead of high-quality images that are from the distribution the training dataset. The proposed deep architecture solution is implemented, analyzed and compared to other methods.
+
+The first section introduces the one-class classification problem and a potential solution with deeparchitecture neral network. The second section presents the work related to one-class classification problems (i.e., semi-supervised outlier detection). Then, the two primary steps of our solution for one-class classification problem are described in the third section, namely, the training step to optimize model and the detecting step to make an inference. Next, the fourth section proposes a technique to break Nash equilibrium so that the $G$ of GAN can keep generating outliers. Besides, this section also proposes other techniques to improve. The fifth section shows experiments, analyzes the results and compares the performance with that of other methods. Finally, the last section concludes our work and describes future work that remains to be further researched.
+
+# 2 RELATED WORK
+
+Five approaches to solve OCC problem are summarized in (Pimentel et al., 2014). Probabilistic approach estimates the generative probability density function (pdf) of the data from the positive class. The boundaries of normality in the data space are defined by the resultant distribution together with a specified threshold, and an unseen sample is tested whether it comes from the same distribution or not. Thereinto, Gaussian Mixture Models (GMMs) (Lindsay et al., 1989; Bishop, 2006) and Kernel Density Estimators (Parzen, 1962; Vincent & Bengio, 2003; Bengio et al., 2006) have proven to be popular. This approach requires complete density estimation in the feature space. If the data in feature space are high dimensional, huge amounts of data are required to fit the model because of the curse of dimensionality. Only when the data from the target class are large enough can this kind of method perform well. Another well-known approach, Reconstruction-based approach, first train a model minimising the reconstruction error of training data with positive labels. Then, the trained model assigns an outlier score, the distance between the input representation vector and the output of the model, for each test example. (Markou & Singh, 2003) reviews lots of the neural network-based methods. Additionally, PCA can also detect outliers by comparing the example before and after transformation. The reconstruction error approach abandons some information with low variance during reconstruction. However, the abandoned low-variance information has proven to be most informative (Tax & Muller, 2003). ¨
+
+Additionally, Distance-based approach, e.g. Nearest neighbour-based methods (Bay & Schwabacher, 2003; Breunig et al., 2000) and Clustering-based methods (Barbara et al., 2002; He ´ et al., 2003), avoids estimating pdf explicitly, but it requires a well-defined distance/similarity measure, which is especially difficult in high-dimensional space. Another approach is domain-based, which creates the boundary based on the structure of normal data without considering the density of the positive class. One-class SVM (Scholkopf et al., 2000) and Support vector data description ¨ (SVDD) (Tax & Duin, 1999) are two basic ones. However, the choice of an appropriate kernel function is not easy, which determines the computational cost. Moreover, the hyperparameters that control the tightness of the boundary are also difficult to select. Lastly, Information-theoretic approach tries to distinguish normal data and outliers by computing information content of dataset using information measure. Similarly, the selection of appropriate information-theoretic measure is challenging.
+
+The approaches described above learn from available positive samples only. Approaches that learn from both target samples and artificial outliers are also researched. (Hempstalk et al., 2008; Fan et al., 2004) generate outlier with a predefined distribution. The strong assumptions about the outlier data distribution in these approaches may be violated in real datasets (Abe et al., 2006). (Tax & Duin, 2001) proposes a method for generating artificial outliers, uniformly distributed in a hypersphere. However, in high-dimensional data space, their proposed technique is not feasible anymore because it is tough to get a confident estimate of the target volume due to the large difference in volume of the target and outlier class. (Banhalmi et al., 2007) extends dataset by generating outlier ´ examples distributed around the positive class. The approach first finds boundary points explicitly using SVM, which is computationally expensive. Then it generates negative examples only around positive class using a distance measure, which causes infeasibility in high-dimensional space. Our proposed CorGAN generates negative examples including both ones around the positive class and ones far from the positive class. Moreover, the model requires no explicit distance measure and does not need to find boundary points explicitly.
+
+Neural networks with deep architecture have already been used in OCC task, but mostly in Reconstruction error approaches (Markou & Singh, 2003). To our knowledge, our proposed CorGAN is the first work to generate outliers for OCC via deep architecture (i.e., Generative Adversary Network). A variant of the GAN framework (CatGAN) is applied to solve multi-class classification task in unsupervised or semi-supervised fashion (Springenberg, 2015). (Odena, 2016) does a further research about semi-supervised learning using GANs. (Schlegl et al., 2017) proposes AnoGAN to apply GAN in Anomaly Detection, which requires the Nash-equilibrium at the end of the training process. Nevertheless, all variants of GAN and the original one are known for its unstable training process.
+
+# 3 OUTLIER DETECTION USING CORGAN
+
+The proposed model and the improved techniques can be generalized to various kinds of data. To show the performance in high-dimensional space, we illustrate our model on image data. The proposed parametric method is composed of two steps:
+
+1. Training Step: Training the CorGAN with the improved techniques;
+2. Inference Step: Detecting outliers using the resulting $D$ of the trained CorGAN
+
+# 3.1 GENERATIVE ADVERSARY NETWORK
+
+Generative Adversary Network(GAN) is a framework for training generative models via an adversarial process (Goodfellow et al., 2014). The framework consists of two components, a generative model (Generator $G$ ) and a discriminative model (Discriminator $D$ ). The $G$ aims to capture the data distribution. The $D$ estimates the probability that a sample came from the training data rather than the Generator. This framework corresponds to a minimax two-player game. In the training procedure, the $D$ is trained to distinguish samples in training datasets from generated samples by assigning a high probability to the former and a low probability to the latter. Contrarily, the objective of $G$ is to maximize the probability of $D$ making a mistake. After the Nash-equilibrium of the training process, the output probability of the $D$ is always 0.5. In case of the convergence, the $G$ is capable of generating realistic images that have same/similar distribution as in training dataset, and the $D$ cannot make right discrimination anymore. The biggest advantage of this framework is that no Markov chains or unrolled approximate inference networks are required in the training and sampling process.
+
+# 3.2 STEP1: TRAINING THE CORGAN
+
+Architectures of the Generator and the Discriminator are neural networks, such as Multilayer Perceptron, Deep Convolutional Neural Network (LeCun et al., 1989), Convolutional Neural Network Cascade (Springenberg, 2015) and Recurrent Neural Network (Rumelhart et al., 1988). The BackPropagation algorithm can be used to train both the generative model and the discriminative model. The architecture applied in the proposed CorGAN is shown in Figure 1.
+
+The $G$ generally starts from prior distribution $p _ { z } ( z )$ (input noise variable $_ z$ ). In the case of convergent GANs, the $G$ maps the prior distribution to the training data distribution $p _ { i n l i e r } ( { \pmb x } )$ . The $G$ of CorGAN is used to generate outlier examples. Hence, it is supposed to map the prior distribution to outlier data distribution $G ( z ; \theta _ { g } )$ instead of the training data distribution. As usual, the $D$ maps the input (i.e. the training data or the generated samples) to a single scalar, which represents the probability that the input came from training datasets instead of the $G$ . The target value of the $D$ is $a _ { t } = 1$ for the input data from training dataset and $a _ { o } = 0$ for the input data generated by the $G$ . The $D$ as a binary classifier is trained to minimize the cost V(D):
+
+$$
+\displaystyle { \operatorname* { m i n } _ { D } V ( D ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( D ( G ( z ) ) - a _ { o } ) + \mathbb { E } _ { { \mathbf { x } } \sim p _ { i n l i e r } ( { \mathbf { x } } ) } \log ( a _ { t } - D ( { \mathbf { x } } ) ) }
+$$
+
+The objective of the $G$ of the CorGAN is to fool the D, but not necessarily maximise the probability D making a mistake. The new target value is $a _ { n e w } \in [ 0 , 1 ]$ (see section 4.2). The $G$ of the CorGAN
+
+
+Figure 1: The basic architecture of the CorGAN
+
+is trained to minimise the cost U(G):
+
+$$
+\operatorname* { m i n } _ { G } U ( G ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( | a _ { n e w } - D ( G ( z ) ) | )
+$$
+
+The CorGAN model is updated via back-propagation algorithm. If the $D$ is overly optimised without updating the $G$ , it will result in overfitting problem. The $D$ and the $G$ will be updated simultaneously or alternately to avoid the problem, e.g. k steps of optimizing the $D$ and one step of optimizing the $G$ . The traditional GANs reach Nash equilibrium after several training epochs. The new objective of the $G$ of CorGAN breaks Nash equilibrium of the training process, which causes that the $G$ can keep generating outlier samples.
+
+The inlier data is taken as training data in the CorGAN. In the adversarial process of training CorGAN, the $G$ is supposed to generate outlier samples for the negative class. The $D$ is trained to assign a high probability value to data from training datasets (i.e., the positive class) and a small probability value to generated data from the G (i.e., the negative class). The generated outliers not only distribute around the positive class but also cover feature space far away from the positive class. In order that the $G$ can map a prior distribution to a huge data space except for the positive class, we proposed a lot of improved techniques (section 4).
+
+# 3.3 STEP2: DETECTING OUTLIERS USING DISCRIMINATOR
+
+In the inference step, the resulting $D$ outputs a relatively high probability for data subjective to the distribution $p _ { i n l i e r }$ and a relatively low probability for data not from the distribution $p _ { i n l i e r }$ . That is to say that, if the output is a low probability in the outlier-detecting process, the input is predicted as an outlier. What is a low probability? So, we need a probability threshold to decide whether an output probability is high or low. The output of the sigmoid activation function of the last layer is a scalar value in the interval $( 0 , 1 )$ , we can intuitively set $t$ as the threshold. In that case, the input is an outlier, if the output from the $D$ is small than $t$ , otherwise an inlier.
+
+The one-class classification task is an extreme case of the imbalanced training. The optimal value of the threshold $t$ is not 0.5. It mainly depends on how the model is trained and the concrete application scenario. If the model is trained by specifying a new objective for the $G$ (like in CorGAN), the $D$ model learns distribution from training datasets for a long time. However, the $D$ is trained with data from a more extensive outlier distribution using the same time. The resulting $D$ will present a relatively higher probability for data that follow the same distribution as the training data (i.e., for inliers). So, the threshold $t$ with a value higher than 0.5 shows a better performance. We do not evaluate the $D$ on a single user-specified threshold.
+
+One-class classification, also called Outlier Detection, can be evaluated with F1-score, which is harmonic mean of precision and recall. The accepted fraction of the positive class $f _ { T + }$ and the rejected fraction of the negative class $f _ { O - }$ are both together also as a popular measure for OCC. However, the score of those measures strongly depends on the specified threshold. To justify our model objectively, the performance of the $D$ in this paper will be evaluated with Receiver operating characteristic curve (ROC) and Area under the ROC curve (AUC). The robustness of the built $D$ will be tested on various datasets.
+
+# 4 IMPROVED TECHNIQUES FOR GAN IN OCC
+
+If the training process reaches Nash equilibrium, the $G$ is able to generate examples following the distribution $p _ { i n l i e r }$ (see figure 2), and the output probability of the $D$ is always 0.5 for inliers and an unexpected value for outliers. It is difficult to distinguish outliers from inliers via a threshold. Our proposed corrupted generative adversary network (CorGAN) is a GAN without convergence. To avoid the Nash equilibrium that the training process can reach, we propose several techniques to break the convergence and build a robust outlier identifier. Thereinto, specifying a new objective for the $G$ is a basic one to keep it generating outlier samples, and other optional techniques further improve the performance of the model.
+
+
+Figure 2: Comparison between the generated data and the training data: The images of handwritten digit nine are training data. After several training epochs, the generated images and the training data are visualised in the figure.
+
+# 4.1 EARLY STOPPING
+
+In early training epochs (i.e., before convergence), the $G$ has no ability to generate data that follows the distribution $p _ { i n l i e r }$ . Meanwhile, the $D$ is trained with the training data with positive labels and the generated data with negative labels. Distributions from $G$ are different from the distribution of training datasets before convergence. The $D$ recognizes the distribution of training datasets by presenting a high probability. Early Stopping before convergence can obtain a well-behaved Discriminator.
+
+In term of implementation of this technique, we do not explicitly stop the training at a particular epoch, but always save the best model. Similar to the model selection, we take the best Discriminator as the final classifier, which appears definitely before the convergence of the training process. The performance of the $D$ is tested regularly during the training process. The score Area Under the Curve of $f _ { T + }$ (inlier accepted fraction), called positively biased AUC (see figure 3) is used to evaluate the performance of the $D$ . The $D$ saved with best biased AUC score shows not optimal but near-optimal performance on the test datasets. The objective of Early Stopping is defined as follows:
+
+$$
+\operatorname* { m a x } _ { D } A U C _ { b i a s e d } = \int _ { 0 } ^ { 1 } f _ { T + } ( t ) d t
+$$
+
+where $t$ is the threshold and $f _ { T + } ( t )$ is inlier accepted fraction of the Discriminator given the specific threshold $t$ .
+
+
+Figure 3: Area Under the Curve of inlier accepted fraction: The figure describes the relationship between the inlier accepted fraction and the specified threshould. Given the specified threshold $0 . 7$ , the point $P$ in the curve corresponds to the accepted fraction of inliers 0.68. Since no outlier is available, the area under this curve (positively biased AUC) is a good measure to select the near optimal model.
+
+Table 1: The behavior of the $G$ and the performance of the $D$ are presented in case of different new target values.
+
+
new target value anew
anew = 1: The objective of G is the exact same as that of the convergent GAN(Goodfellow et al., 2014). The training will converge.
anew E (~ O.9,1): The such adjustment of the objective of the G is proposed in(Salimans et al.,2O16) to improve the training process of GANs. The training processwill converge as well.
anew ∈ (~ O.5,~ 0.9): The G will generate data far from the distribution pinlierat the beginning of the training phase because of the random initialization.After several training epochs,it will generate data that distribute around the positive class.The tighter the boundary is,the larger space the generated data cover. The value 0.9results in most tight boundary.
anew ∈ [0,~ O.5): The G has similar objective to that of the D. It will tend togenerate data,from which the D can easily distinguish the training data. That is to say that allthe generated data distribute far from the distribution Pinlier·
+
+# 4.2 SPECIFYING A NEW OBJECTIVE FOR THE GENERATOR
+
+Even though Early Stopping avoids the problem the convergence causes, GAN can only be trained with a limited number of epochs. Hence, Early Stopping can only guarantee a high inlier accepted fraction $f _ { T + }$ , but not necessarily high outlier rejected fraction $f _ { O - }$ because the $\mathbf { D }$ is only trained with a certain number of generated samples (i.e., outliers). To build a robust outlier identifier against as many kinds of outlier distributions as possible, we should train the $D$ with as many generated samples as possible, which have different distribution from the distribution $p _ { i n l i e r }$ .
+
+We can explicitly break Nash equilibrium by specifying a new objective for $G$ . Without modification, the objective of $G$ is to maximise the probability of the $D$ making a mistake. We propose a new objective for $G$ :
+
+$$
+\operatorname* { m i n } _ { G } U ( G ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( | 0 . 9 - D ( G ( z ) ) | )
+$$
+
+Instead of maximising the probability that $D$ makes a mistake, the new objective is that the $D$ makes a mistake with a certain probability. The new target value used to calculate the cost for updating the $\mathbf { G }$ is $a _ { n e w } = 0 . 9$ . The choice of the value $a _ { n e w }$ is justified in the table 1. In case of $a _ { n e w } = 0 . 9$ , the $G$ explores the largest space, and the built $D$ will show robust performance.
+
+# 4.3 ATTACHING MORE IMPORTANCE TO GENERATED DATA
+
+The cost of the $D$ consists of two parts. These two parts are caused respectively by the training data and the generated data. Generally, the two parts are simply added together as the total cost for updating the parameters of the $D$ . That is to say that the training data and the generated data are treated with the same importance. They can be treated differently by assigning a weight to one of them to broaden the search space of parameters. The objective of the $D$ is defined as follows:
+
+$$
+\operatorname* { m i n } _ { D } V ( D ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( D ( G ( z ) ) - a _ { o } ) + w * \mathbb { E } _ { { \pi } \sim p _ { i n l i e r } ( { \bf x } ) } \log ( a _ { t } - D ( { \bf x } ) )
+$$
+
+, where $w \in ( 0 , 1 )$ is a hyperparameter. The value of $w$ can be selected by validation process with positively biased AUC score. While the outlier distributions are various and difficult to recover all of them, the inlier distribution is rather simple and easy to learn. During the training process, the cost that generated data caused should be reduced as far as possible by updating parameters of the $D$ . In other words, the generated data should be attached more importance by specifying the value of weight. Compared to the general case that the two parts of cost are not treated differently, this method shows a better performance on the test datasets whose distributions are far from the training dataset.
+
+# 4.4 COMBINING PREVIOUSLY GENERATED DATA
+
+Compared to the method of Early Stopping, the method of specifying a new objective for G presents a better performance, because the new objective trains $D$ with arbitrarily more generated data that are not from the distribution $p _ { i n l i e r }$ . With the new specified objective, the training procedure does not converge, and the $G$ is able to keep generating outliers. The $D$ can be trained with arbitrarily many generated distributions. However, the space of distribution learned by $D$ is limited to a great extent. On the one hand, the generated distribution always stays near the positive class after several training epochs. On the other hand, the $D$ can forget the previously learned distributions because of the limited capacity.
+
+In this subsection, we proposed a technique to broaden the learned distributions. The performance of the $D$ can be improved by being regularly trained with previously generated data. We can train the CorGAN with mini batches (batch size $s$ ) that combine the data generated recently and previously. The combined training data can avoid that the $D$ forgets the learned distribution to some degree.
+
+There exist a large amount of generated data in the training procedure. Which ones should be chosen to train $D$ and prevent it forgetting the previously generated distributions? Because the generated data can be arbitrarily many, it is inadvisable and impossible to save all of them. In this case, the generated data can be treated as stream data $\left( X _ { 1 } , X _ { 2 } , \ldots , X _ { t } \right)$ . We apply a Reservoir Sampling Algorithm (Vitter, 1985) to sample previously generated images. This algorithm samples examples from the stream data with the same probability (see equation 6) and specifies a reservoir $R$ to save the sampled examples.
+
+$$
+P ( X _ { i } \in R ) = \frac { 1 } { t - ( s / 2 ) }
+$$
+
+, where $i \in [ 1 , t - ( s / 2 ) ]$ . The mini batches that are composed of newly generated examples and the sampled examples saved in a reservoir is used to train $D$ . The mini batch $B$ at the timestamp $t$ is defined as follows:
+
+$$
+B = \left\{ R , X _ { t - ( s / 2 ) + 1 } , X _ { t - ( s / 2 ) + 2 } , \ldots , X _ { t } \right\}
+$$
+
+, where $R$ is the reservoir. The objective of the $D$ remains unchanged in the equation 1. The resultant $D$ can identify not only recently generated outliers but also previous ones.
+
+# 5 EXPERIMENTS AND ANALYSIS
+
+In this section, we justify our proposed model and improved techniques with experiments. To demonstrate the robust performance of the built classifier, we evaluate the $D$ on various outlier datasets. We describe the experiment settings of our models and the models to be compared. The experiment results, followed by a strong discussion, are presented in this section.
+
+Table 2: Training -, validation - and test datasets of experiments setting.
+
+
Datasets:
Source of images:
The Number of images:
Training dataset
digit of 9 in MNIST
4967
Validation dataset
digit of 9 in MNIST
900
Test dataset
Inliers: digit of 9 in MNIST
900
1.Outliers: digits of O-8 in MNIST
900
2.Outliers: CIFAR10
900
3.Outliers: Images composed of noise
900
+
+# 5.1 DATASETS AND EVALUATION:
+
+Three datasets are used in the experiments, namely, MNIST (LeCun et al., 1998), CIFAR10 (Krizhevsky, 2009) and an artificial noise image dataset. The image size in MINIST is (28, 28). The size of CIFAR10 images is cropped into (28, 28) by removing pixels along the sides. Especially, we specify a dataset composed of three group of noise images with the same size (28, 28). The values of their pixels are respectively subject to uniform distribution, Gaussian distribution and random values. The table 2 lists training dataset, validation dataset and test datasets. The performance of various approaches will be evaluated and compared with Receiver Operating Characteristic (ROC) and the Area Under the ROC Curve (AUC).
+
+# 5.2 EXPERIMENTS SETTING:
+
+PCA+PSVM: PCA is used to reduce the dimensionality of the high-dimensional data (i.e., images). The number of components K is set such that $9 5 \%$ of the variance is retained $\scriptstyle ( \mathrm { K = 1 } 1 1 $ ). Oneclass SVM proposed in (Scholkopf et al., 2000) is plane-based, called PSVM. To identify outliers ¨ in the feature space, PSVM tries to find a hyperplane that best separates the data from the origin. RBF kernel is used in this experiment. Other settings are defaults in sklearn.svm.OneClassSVM (Pedregosa et al., 2011).
+
+Autoencoder: Autoencoder detects outliers by computing reconstruction error and compares it with a specified threshold. The threshold is based on the difference between the inputs and outputs for the training data. If the reconstruction error for a test sample is larger than the threshold, then the sample is identified as an outlier, otherwise as inlier. To justify our proposal, we compare our model to convolutional autoencoder. The encoder has the same architecture as the Discriminator in CorGAN except for output layer. The decoder also has a same architecture as the Generator in CorGAN. The model is regularised with weight decay $\lambda = 0 . 0 1$ . The parameters are updated with SGD optimisation algorithm, minibatc $\scriptstyle \imath = 1 2 8$ and learning rate $l r { = } 0 . 1$ . The cost function is the cross-entropy function. The model is trained for 30 epochs without pretraining.
+
+CorGAN: The basic architecture of CorGAN, as well as the number of its layers and units, is shown in figure 1. We propose a lot of improved techniques. Since its combinations are numerous, we justify only three main models. The first model is a basic one, $\mathrm { C o r G A N } = \mathrm { G A N }$ with early stopping technique and a new objective for the $G$ (see section 4.2). The new target value $a _ { n e w }$ is set manually to 0.9 for the $G$ . The $G$ is regularised with weight decay $\lambda = 0 . 1$ . The optimisation algorithm is Adam, minibatch $= 1 2 8$ and learning rate $l r = 0 . 0 0 0 2$ . No pretraining is performed. The second model to be justified is based on the first one, $\mathrm { C o r G A N ^ { 2 } = C o r G A N + }$ Attaching more importance to generated images (see section 4.3). The weight is set to 0.5 manually. The third illustrated model is also based on the first one, $\mathrm { C o r G A N ^ { 3 } \bar { \ s } = C o r G A N \ s + \Delta }$ Combining previously generated images (see section 4.4). The minibatch size is composed of 64 images sampled from previous training epoch and 64 newly generated images.
+
+# 5.3 RESULTS AND ANALYSIS:
+
+The results of the experiments are shown in the figure 4 and the table 3. The outlier distribution of the handwritten digits images of the numbers (0-8) is relatively close to the inlier distribution of the number 9. Hence, all the approaches show the worse AUC scores on the first test dataset. The $\mathrm { P C A + P S V M }$ approach shows the better score on the second test dataset than on the noise test dataset. The traditional approach is not robust enough for noise outliers. The solutions based on neural networks often show a better performance against noise data because of the random initialization of its parameters. Especially, our proposed solution based on GAN framework, in which Generator generates many noise examples. The convolutional autoencoder can reconstruct natural images well by detects edges, corners and objects. Therefore, the convolutional autoencoder shows the poor score on natural images. Our proposed solution classifies test examples without reconstruction process, which shows robust performance against outlier natural images as well as noise images.
+
+
+Figure 4: The figures show the ROC curves of all models on three differenct test datasets. The area under the ROC curve represents the overall performance of a one-class classifier. The model $\mathrm { C o r G A N ^ { 3 } }$ shows robust performance on all the three datasets.
+
+Table 3: The AUC socres of various models are shown in the table. All the models are tested in three datasets: MNIST(9) $^ +$ MNIST(0-8), MNIST(9) $^ +$ CIFAR10, MNIST(9) $^ +$ Noise. Within MNIST(9) images are inliers, and other images are outliers. CorGAN, $\mathrm { C o r G A N ^ { 2 } }$ and $\mathrm { C o r G A N ^ { 3 } }$ are described in section 5.2.
+
+
AUC score:
MNIST(9)
MNIST(0-8)
CIFAR10
Noise
PCA+PSVM
0.8623
0.9720
0.9302
Autoencoder
0.8943
0.6785
0.9704
CorGAN
0.8974
0.9739
0.9995
CorGAN2
0.8343
0.9937
0.9999
CorGAN3
0.9253
0.9943
0.9999
+
+Compared to CorGAN, $\mathrm { C o r G A N ^ { 2 } }$ attaches more importance to generated images, which makes classifier more robust again the outliers whose distribution is far from inlier distribution. In consequence, $\mathrm { C o r G A N ^ { 2 } }$ shows the low score on the first dataset, in which the distributions of inliers and outliers are relatively close. In the model $\mathrm { C o r G A N ^ { 3 } }$ , the outlier examples generated previously are combined with newly generated examples to train the Discriminator. In this way, the Discriminator learned a large space of outlier distribution. The model $\mathrm { C o r G A N ^ { 3 } }$ shows the best scores on various test datasets. The robust $\mathrm { C o r G A N ^ { 3 } }$ learns a tight boundary in high-dimensional space. The farther the outlier distribution is from the inlier distribution $p _ { i n l i e r }$ , the better score it shows (see figure 4d).
+
+# 6 CONCLUSION AND FUTURE WORK
+
+In this paper, we present a solution to solve one-class classification problem based on GAN framework and successfully apply the Discriminator of the framework to detect outliers. We illuminate a few techniques to improve the performance and verify the proposed techniques with experiments. First, we choose the near optimal model to detect outliers by saving a better model during the training procedure. Then we specify a new objective for the $G$ so that it can keep generating outliers. Attaching more importance to generated images can further improve the performance of the $D$ . To prevent the $D$ forgetting the previously generated outliers, we combine previously generated outliers from the Generator to train the outlier identifier. These techniques show comparable AUC scores.
+
+In future work, We can further vary the generated outliers to train $D$ . We can specify multiple Generators in the generative adversary framework. The mini batch can combine the data generated by different Generators, which have different objectives, e.g. the different probabilities of D making a mistake. To further explore more generated distribution used to train the $D$ , we can even combine CorGAN with other generative models. Similarly, we must also change the objective of them to fit our goal, since the other generative models are also supposed to generate outliers.
+
+All the proposals in this paper do not leverage distance information(KLD) between distributions within a batch both in the training process and detecting process. Another topic worth studying is the clustering-based method to detect outlier using $D$ of GAN. One potential method of leveraging distance information is to model the closeness between examples in a mini-batch. The modeling process is described in Minibatch Discrimination (Salimans et al., 2016), an improved technique for training GANs.
+
+Regarding the task of detecting of outlier images, we will try to identify more fine attributes of images. For instance, the built outlier identifier should be able to distinguish images taken under different illumination as well as different viewpoints, which describe the same object. Furthermore, we can take images of a group of objects as inliers. We will build a one-class classifier to make a decision whether the object described by the given image comes from the group.
+
+# REFERENCES
+
+Naoki Abe, Bianca Zadrozny, and John Langford. Outlier detection by active learning. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 504–509. ACM, 2006.
+
+Basant Agarwal et al. One-class support vector machine for sentiment analysis of movie review documents. World Academy of Science, Engineering and Technology, International Journal of Computer, Electrical, Automation, Control and Information Engineering, 9(12):2458–2461, 2015.
+
+Andras B ´ anhalmi, Andr ´ as Kocsor, and R ´ obert Busa-Fekete. Counter-example generation-based ´ one-class classification. In ECML, pp. 543–550. Springer, 2007.
+
+Daniel Barbara, Yi Li, and Julia Couto. Coolcat: an entropy-based algorithm for categorical clus- ´ tering. In Proceedings of the eleventh international conference on Information and knowledge management, pp. 582–589. ACM, 2002.
+
+Sugato Basu, Mikhail Bilenko, and Raymond J Mooney. A probabilistic framework for semisupervised clustering. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 59–68. ACM, 2004.
+
+Stephen D Bay and Mark Schwabacher. Mining distance-based outliers in near linear time with randomization and a simple pruning rule. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 29–38. ACM, 2003.
+
+Yoshua Bengio, Hugo Larochelle, and Pascal Vincent. Non-local manifold parzen windows. In Advances in neural information processing systems, pp. 115–122, 2006.
+
+Christopher M Bishop. Novelty detection and neural network validation. IEE Proceedings-Vision, Image and Signal processing, 141(4):217–222, 1994.
+
+Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
+
+Markus M Breunig, Hans-Peter Kriegel, Raymond T $\mathrm { N g }$ , and Jorg Sander. Lof: identifying density- ¨ based local outliers. In ACM sigmod record, volume 29, pp. 93–104. ACM, 2000.
+
+Wei Fan, Matthew Miller, Sal Stolfo, Wenke Lee, and Phil Chan. Using artificial anomalies to detect unknown and known network intrusions. Knowledge and Information Systems, 6(5):507– 527, 2004.
+
+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.
+
+Zengyou He, Xiaofei Xu, and Shengchun Deng. Discovering cluster-based local outliers. Pattern Recognition Letters, 24(9):1641–1650, 2003.
+
+Kathryn Hempstalk, Eibe Frank, and Ian H Witten. One-class classification by combining density and class probability estimation. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 505–519. Springer, 2008.
+
+Victoria Hodge and Jim Austin. A survey of outlier detection methodologies. Artificial intelligence review, 22(2):85–126, 2004.
+
+Nathalie Japkowicz. Concept-learning in the absence of counter-examples: an autoassociationbased approach to classification. PhD thesis, Rutgers, The State University of New Jersey, 1999.
+
+A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
+
+Anukool Lakhina, Mark Crovella, and Christophe Diot. Mining anomalies using traffic feature distributions. In ACM SIGCOMM Computer Communication Review, volume 35, pp. 217–228. ACM, 2005.
+
+Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
+
+Yann LeCun et al. Generalization and network design strategies. Connectionism in perspective, pp. 143–155, 1989.
+
+Bruce Lindsay, G. L. Mclachlan, K. E. Basford, and Marcel Dekker. Mixture models: Inference and applications to clustering. Journal of the American Statistical Association, 84(405):337, 1989.
+
+Markos Markou and Sameer Singh. Novelty detection: a reviewpart 2:: neural network based approaches. Signal processing, 83(12):2499–2521, 2003.
+
+Mary M Moya, Mark W Koch, and Larry D Hostetler. One-class classifier networks for target recognition applications. Technical report, Sandia National Labs., Albuquerque, NM (United States), 1993.
+
+Augustus Odena. Semi-supervised learning with generative adversarial networks. arXiv preprint arXiv:1606.01583, 2016.
+
+Emanuel Parzen. On estimation of a probability density function and mode. The annals of mathematical statistics, 33(3):1065–1076, 1962.
+
+F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
+
+Marco AF Pimentel, David A Clifton, Lei Clifton, and Lionel Tarassenko. A review of novelty detection. Signal Processing, 99:215–249, 2014.
+
+Gunter Ritter and Mar´ıa Teresa Gallegos. Outliers in statistical pattern recognition and an application to automatic chromosome classification. Pattern Recognition Letters, 18(6):525–539, 1997.
+
+David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1, 1988.
+
+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. 2226–2234, 2016.
+
+Thomas Schlegl, Philipp Seebock, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg ¨ Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International Conference on Information Processing in Medical Imaging, pp. 146– 157. Springer, 2017.
+
+Bernhard Scholkopf, Robert C Williamson, Alex J Smola, John Shawe-Taylor, and John C Platt.¨ Support vector method for novelty detection. In Advances in neural information processing systems, pp. 582–588, 2000.
+
+Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015.
+
+David MJ Tax and Robert PW Duin. Support vector domain description. Pattern recognition letters, 20(11):1191–1199, 1999.
+
+David MJ Tax and Robert PW Duin. Uniform object generation for optimizing one-class classifiers. Journal of machine learning research, 2(Dec):155–173, 2001.
+
+David MJ Tax and Klaus-Robert Muller. Feature extraction for one-class classification. ¨ Lecture notes in computer science, pp. 342–349, 2003.
+
+Benjamin Berry Thompson, Robert J Marks, Jai J Choi, Mohamed A El-Sharkawi, Ming-Yuh Huang, and Carl Bunje. Implicit learning in autoencoder novelty assessment. In Neural Networks, 2002. IJCNN’02. Proceedings of the 2002 International Joint Conference on, volume 3, pp. 2878–2883. IEEE, 2002.
+
+Pascal Vincent and Yoshua Bengio. Manifold parzen windows. In Advances in neural information processing systems, pp. 849–856, 2003.
+
+Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37–57, 1985.
\ No newline at end of file
diff --git a/md/train/BkbY4psgg/BkbY4psgg.md b/md/train/BkbY4psgg/BkbY4psgg.md
new file mode 100644
index 0000000000000000000000000000000000000000..9dc43fb180ee09ceb36f7e592efb06c720d9eab5
--- /dev/null
+++ b/md/train/BkbY4psgg/BkbY4psgg.md
@@ -0,0 +1,623 @@
+# MAKING NEURAL PROGRAMMING ARCHITECTURES GENERALIZE VIA RECURSION
+
+Jonathon Cai, Richard Shin, Dawn Song
+Department of Computer Science
+University of California, Berkeley
+Berkeley, CA 94720, USA
+{jonathon,ricshin,dawnsong}@cs.berkeley.edu
+
+# ABSTRACT
+
+Empirically, neural networks that attempt to learn programs from data have exhibited poor generalizability. Moreover, it has traditionally been difficult to reason about the behavior of these models beyond a certain level of input complexity. In order to address these issues, we propose augmenting neural architectures with a key abstraction: recursion. As an application, we implement recursion in the Neural Programmer-Interpreter framework on four tasks: grade-school addition, bubble sort, topological sort, and quicksort. We demonstrate superior generalizability and interpretability with small amounts of training data. Recursion divides the problem into smaller pieces and drastically reduces the domain of each neural network component, making it tractable to prove guarantees about the overall system’s behavior. Our experience suggests that in order for neural architectures to robustly learn program semantics, it is necessary to incorporate a concept like recursion.
+
+# 1 INTRODUCTION
+
+Training neural networks to synthesize robust programs from a small number of examples is a challenging task. The space of possible programs is extremely large, and composing a program that performs robustly on the infinite space of possible inputs is difficult—in part because it is impractical to obtain enough training examples to easily disambiguate amongst all possible programs. Nevertheless, we would like the model to quickly learn to represent the right semantics of the underlying program from a small number of training examples, not an exhaustive number of them.
+
+Thus far, to evaluate the efficacy of neural models on programming tasks, the only metric that has been used is generalization of expected behavior to inputs of greater complexity (Vinyals et al. (2015), Kaiser & Sutskever (2015), Reed & de Freitas (2016), Graves et al. (2016), Zaremba et al. (2016)). For example, for the addition task, the model is trained on short inputs and then tested on its ability to sum inputs with much longer numbers of digits. Empirically, existing models suffer from a common limitation—generalization becomes poor beyond a threshold level of complexity. Errors arise due to undesirable and uninterpretable dependencies and associations the architecture learns to store in some high-dimensional hidden state. This makes it difficult to reason about what the model will do when given complex inputs.
+
+One common strategy to improve generalization is to use curriculum learning, where the model is trained on inputs of gradually increasing complexity. However, models that make use of this strategy eventually fail after a certain level of complexity (e.g. the single-digit multiplication task in Zaremba et al. (2016), the bubble sort task in Reed & de Freitas (2016), and the graph tasks in Graves et al. (2016)). In this version of curriculum learning, even though the inputs are gradually becoming more complex, the semantics of the program is succinct and does not change. Although the model is exposed to more and more data, it might learn spurious and overly complex representations of the program, as suggested in Zaremba et al. (2016). That is to say, the network does not learn the true program semantics.
+
+In this paper, we propose to resolve these issues by explicitly incorporating recursion into neural architectures. Recursion is an important concept in programming languages and a critical tool to reduce the complexity of programs. We find that recursion makes it easier for the network to learn the right program and generalize to unknown situations. Recursion enables provable guarantees on neural programs’ behavior without needing to exhaustively enumerate all possible inputs to the programs. This paper is the first (to our knowledge) to investigate the important problem of provable generalization properties of neural programs. As an application, we incorporate recursion into the Neural Programmer-Interpreter architecture and consider four sample tasks: grade-school addition, bubble sort, topological sort, and quicksort. Empirically, we observe that the learned recursive programs solve all valid inputs with $100 \%$ accuracy after training on a very small number of examples, out-performing previous generalization results. Given verification sets that cover all the base cases and reduction rules, we can provide proofs that these learned programs generalize perfectly. This is the first time one can provide provable guarantees of perfect generalization for neural programs.
+
+# 2 THE PROBLEM AND OUR APPROACH
+
+# 2.1 THE PROBLEM OF GENERALIZATION
+
+When constructing a neural network for the purpose of learning a program, there are two orthogonal aspects to consider. The first is the actual model architecture. Numerous models have been proposed for learning programs; to name a few, this includes the Differentiable Neural Computer (Graves et al., 2016), Neural Turing Machine (Graves et al., 2014), Neural GPU (Kaiser & Sutskever, 2015), Neural Programmer (Neelakantan et al., 2015), Pointer Network (Vinyals et al., 2015), Hierarchical Attentive Memory (Andrychowicz & Kurach, 2016), and Neural Random Access Machine (Kurach et al., 2016). The architecture usually possesses some form of memory, which could be internal (such as the hidden state of a recurrent neural network) or external (such as a discrete “scratch pad” or a memory block with differentiable access). The second is the training procedure, which consists of the form of the training data and the optimization process. Almost all architectures train on program input/output pairs. The only model, to our knowledge, that does not train on input-output pairs is the Neural Programmer-Interpreter (Reed & de Freitas, 2016), which trains on synthetic execution traces.
+
+To evaluate a neural network that learns a neural program to accomplish a certain task, one common evaluation metric is how well the learned model $M$ generalizes. More specifically, when $M$ is trained on simpler inputs, such as inputs of a small length, the generalization metric evaluates how well $M$ will do on more complex inputs, such as inputs of much longer length. $M$ is considered to have perfect generalization if $M$ can give the right answer for any input, such as inputs of arbitrary length.
+
+As mentioned in Section 1, all approaches to neural programming today fare poorly on this generalization issue. We hypothesize that the reason for this is that the neural network learns to spuriously depend on specific characteristics of the training examples that are irrelevant to the true program semantics, such as length of the training inputs, and thus fails to generalize to more complex inputs.
+
+In addition, none of the current approaches to neural programming provide a method or even aim to enable provable guarantees about generalization. The memory updates of these neural programs are so complex and interdependent that it is difficult to reason about the behaviors of the learned neural program under previously unseen situations (such as problems with longer inputs). This is highly undesirable, since being able to provide the correct answer in all possible settings is one of the most important aspects of any learned neural program.
+
+# 2.2 OUR APPROACH USING RECURSION
+
+In this paper, we propose that the key abstraction of recursion is necessary for neural programs to generalize. The general notion of recursion has been an important concept in many domains, including mathematics and computer science. In computer science, recursion (as opposed to iteration) involves solving a larger problem by combining solutions to smaller instances of the same problem. Formally, a function exhibits recursive behavior when it possesses two properties: (1) Base cases— terminating scenarios that do not use recursion to produce answers; (2) A set of rules that reduces all other problems toward the base cases. Some functional programming languages go so far as not to define any looping constructs but rely solely on recursion to enable repeated execution of the same code.
+
+In this paper, we propose that recursion is an important concept for neural programs as well. In fact, we argue that recursion is an essential element for neural programs to generalize, and makes it tractable to prove the generalization of neural programs. Recursion can be implemented differently for different neural programming models. Here as a concrete and general example, we consider a general Neural Programming Architecture (NPA), similar to Neural Programmer-Interpreter (NPI) in Reed & de Freitas (2016). In this architecture, we consider a core controller, e.g., an LSTM in NPI’s case, but possibly other networks in different cases. There is a (changing) list of neural programs used to accomplish a given task. The core controller acts as a dispatcher for the programs. At each time step, the core controller can decide to select one of the programs to call with certain arguments. When the program is called, the current context including the caller’s memory state is stored on a stack; when the program returns, the stored context is popped off the stack to resume execution in the previous caller’s context.
+
+In this general Neural Programming Architecture, we show it is easy to support recursion. In particular, recursion can be implemented as a program calling itself. Because the context of the caller is stored on a stack when it calls another program and the callee starts in a fresh context, this enables recursion simply by allowing a program to call itself. In practice, we can additionally use tail recursion optimization to avoid problems with the call stack growing too deep. Thus, any general Neural Programming Architecture supporting such a call structure can be made to support recursion. In particular, this condition is satisfied by NPI, and thus the NPI model naturally supports recursion (even though the authors of NPI did not consider this aspect explicitly).
+
+By nature, recursion reduces the complexity of a problem to simpler instances. Thus, recursion helps decompose a problem and makes it easier to reason about a program’s behavior for previously unseen situations such as longer inputs. In particular, given that a recursion is defined by two properties as mentioned before, the base cases and the set of reduction rules, we can prove a recursive neural program generalizes perfectly if we can prove that (1) it performs correctly on the base cases; (2) it learns the reduction rules correctly. For many problems, the base cases and reduction rules usually consist of a finite (often small) number of cases. For problems where the base cases may be extremely large or infinite, such as certain forms of motor control, recursion can still help reduce the problem of generalization to these two aspects and make the generalization problem significantly simpler to handle and reason about.
+
+As a concrete instantiation, we show in this paper that we can enable recursive neural programs in the NPI model, and thus enable perfectly generalizable neural programs for tasks such as sorting where the original, non-recursive NPI program fails. As aforementioned, the NPI model naturally supports recursion. However, the authors of NPI did not consider explicitly the notion of recursion and as a consequence, did not learn recursive programs. We show that by modifying the training procedure, we enable the NPI model to learn recursive neural programs. As a consequence, our learned neural programs empirically achieve perfect generalization from a very small number of training examples. Furthermore, given a verification input set that covers all base cases and reduction rules, we can formally prove that the learned neural programs achieve perfect generalization after verifying its behavior on the verification input set. This is the first time one can provide provable guarantees of perfect generalization for neural programs.
+
+We would also like to point out that in this paper, we provide as an example one way to train a recursive neural program, by providing a certain training execution trace to the NPI model. However, our concept of recursion for neural programs is general. In fact, it is one of our future directions to explore new ways to train a recursive neural program without providing explicit training execution traces or with only partial or non-recursive traces.
+
+# 3 APPLICATION TO LEARNING RECURSIVE NEURAL PROGRAMS WITH NPI
+
+# 3.1 BACKGROUND: NPI ARCHITECTURE
+
+As discussed in Section 2, the Neural Programmer-Interpreter (NPI) is an instance of a Neural Programmer Architecture and hence it naturally supports recursion. In this section, we give a brief review of the NPI architecture from Reed & de Freitas (2016) as background.
+
+We describe the details of the NPI model relevant to our contributions. We adapt machinery from the original paper slightly to fit our needs. The NPI model has three learnable components: a task-agnostic core, a program-key embedding, and domain-specific encoders that allow the NPI to operate in diverse environments.
+
+The NPI accesses an external environment, $Q$ , which varies according to the task. The core module of the NPI is an LSTM controller that takes as input a slice of the current external environment, via a set of pointers, and a program and arguments to execute. NPI then outputs the return probability and next program and arguments to execute. Formally, the NPI is represented by the following set of equations:
+
+$$
+\begin{array} { c } { s _ { t } = f _ { e n c } ( e _ { t } , a _ { t } ) } \\ { h _ { t } = f _ { l s t m } ( s _ { t } , p _ { t } , h _ { t - 1 } ) } \\ { r _ { t } = f _ { e n d } ( h _ { t } ) , p _ { t + 1 } = f _ { p r o g } ( h _ { t } ) , a _ { t + 1 } = f _ { a r g } ( h _ { t } ) } \end{array}
+$$
+
+$t$ is a subscript denoting the time-step; $f _ { e n c }$ is a domain-specific encoder (to be described later) that takes in the environment slice $e _ { t }$ and arguments $a _ { t }$ ; $f _ { l s t m }$ represents the core module, which takes in the state $s _ { t }$ generated by $f _ { e n c }$ , a program embedding $p _ { t } \in \mathbb { R } ^ { P }$ , and hidden LSTM state $h _ { t }$ ; $f _ { e n d }$ decodes the return probability $r _ { t }$ ; $f _ { p r o g }$ decodes a program key embedding $p _ { t + 1 }$ ;1 and $f _ { a r g }$ decodes arguments $a _ { t + 1 }$ . The outputs $r _ { t } , p _ { t + 1 } , a _ { t + 1 }$ are used to determine the next action, as described in Algorithm 1. If the program is primitive, the next environmental state $e _ { t + 1 }$ will be affected by $p _ { t }$ and $a _ { t }$ , i.e. $e _ { t + 1 } \sim f _ { e n v } ( e _ { t } , p _ { t } , a _ { t } )$ . As with the original NPI architecture, the experiments for this paper always used a 3-tuple of integers $a _ { t } = ( a _ { t } ( 1 ) , \hat { a } _ { t } ( 2 ) , a _ { t } ( 3 ) )$ .
+
+Algorithm 1 Neural programming inference
+
+
1:
Inputs: Environment observation e, program p,arguments a, stop threshold α
2:
function RUN(e,p, a)
3:
h↑0,r←0
4:
whiler<αdo
5:
s ←fenc(e,a),h ←fistm(s,p,h)
6:
r ←fend(h),p2 ← fprog(h),a2 ← farg(h)
7:
if p is a primitive function then
8:
e ← fenv(e,p,a).
9:
else
10:
function RUN(e,P2, a2)
+
+A description of the inference procedure is given in Algorithm 1. Each step during an execution of the program does one of three things: (1) another subprogram along with associated arguments is called, as in Line 10, (2) the program writes to the environment if it is primitive, as in Line 8, or (3) the loop is terminated if the return probability exceeds a threshold $\alpha$ , after which the stack frame is popped and control is returned to the caller. In all experiments, $\alpha$ is set to 0.5. Each time a subprogram is called, the stack depth increases.
+
+The training data for the Neural Programmer-Interpreter consists of full execution traces for the program of interest. A single element of an execution trace consists of a step input-step output pair, which can be synthesized from Algorithm 1: this corresponds to, for a given time-step, the step input tuple $( e , p , a )$ and step output tuple $( r , p _ { 2 } , a _ { 2 } )$ . An example of part of an addition task trace, written in shorthand, is given in Figure 1. For example, a step input-step output pair in Lines 2 and 3 of the left-hand side of Figure 1 is (ADD1, WRITE OUT 1). In this pair, the step input runs a subprogram ADD1 that has no arguments, and the step output contains a program WRITE that has arguments of OUT and 1. The environment and return probability are omitted for readability. Indentation indicates the stack is one level deeper than before.
+
+It is important to emphasize that at inference time in the NPI, the hidden state of the LSTM controller is reset (to zero) at each subprogram call, as in Line 3 of Algorithm 1 $h \mathbf { 0 }$ ). This functionality is critical for implementing recursion, since it permits us to restrict our attention to the currently relevant recursive call, ignoring irrelevant details about other contexts.
+
+
+Figure 1: Addition Task. The non-recursive trace loops on cycles of ADD1 and LSHIFT, whereas in the recursive version, the ADD function calls itself (bolded).
+
+# 3.2 RECURSIVE FORMULATIONS FOR NPI PROGRAMS
+
+We emphasize the overall goal of this work is to enable the learning of a recursive program. The learned recursive program is different from neural programs learned in all previous work in an important aspect: previous approaches do not explicitly incorporate this abstraction, and hence generalize poorly, whereas our learned neural programs incorporate recursion and achieve perfect generalization.
+
+Since NPI naturally supports the notion of recursion, a key question is how to enable NPI to learn recursive programs. We found that changing the NPI training traces is a simple way to enable this. In particular, we construct new training traces which explicitly contain recursive elements and show that with this type of trace, NPI easily learns recursive programs. In future work, we would like to decrease supervision and construct models that are capable of coming up with recursive abstractions themselves.
+
+In what follows, we describe the way in which we constructed NPI training traces so as to make them contain recursive elements and thus enable NPI to learn recursive programs. We describe the recursive re-formulation of traces for two tasks from the original NPI paper—grade-school addition and bubble sort. For these programs, we re-use the appropriate program sets (the associated subprograms), and we refer the reader to the appendix of Reed & de Freitas (2016) for further details on the subprograms used in addition and bubble sort. Finally, we implement recursive traces for our own topological sort and quicksort tasks.
+
+Grade School Addition. For grade-school addition, the domain-specific encoder is
+
+$$
+\begin{array} { r } { f _ { e n c } ( Q , i _ { 1 } , i _ { 2 } , i _ { 3 } , i _ { 4 } , a _ { t } ) = M L P ( [ Q ( 1 , i _ { 1 } ) , Q ( 2 , i _ { 2 } ) , Q ( 3 , i _ { 3 } ) , Q ( 4 , i _ { 4 } ) , a _ { t } ( 1 ) , a _ { t } ( 2 ) , a _ { t } ( 3 ) ] ) , } \end{array}
+$$
+
+where the environment $Q \in \mathbb { R } ^ { 4 \times N \times K }$ is a scratch-pad that contains four rows (the first input number, the second input number, the carry bits, and the output) and $N$ columns. $K$ is set to 11, to represent the range of 10 possible digits, along with a token representing the end of input.2 At any given time, the NPI has access to values pointed to by four pointers in each of the four rows, represented by $Q ( 1 , i _ { 1 } ) , Q ( 2 , i _ { 2 } ) , Q ( 3 , i _ { 3 } )$ , and $Q ( 4 , i _ { 4 } )$ .
+
+The non-recursive trace loops on cycles of ADD1 and LSHIFT. ADD1 is a subprogram that adds the current column (writing the appropriate digit to the output row and carrying a bit to the next column if needed). LSHIFT moves the four pointers to the left, to move to the next column. The program terminates when seeing no numbers in the current column.
+
+Figure 1 shows examples of non-recursive and recursive addition traces. We make the trace recursive by adding a tail recursive call into the trace for the ADD program after calling ADD1 and LSHIFT,
+
+# Full Recursive
+
+
+Figure 2: Bubble Sort Task. The non-recursive trace loops on cycles of BUBBLE and RESET. The difference between the partial recursive and full recursive versions is in the indentation of Lines 10-15 and 20-22 (bolded), since in the full recursive version, BSTEP and LSHIFT are made tail recursive; the final calls to BSTEP and LSHIFT return immediately as they occur after the pointer reaches the end of the array. Also note that COMPSWAP conditionally swaps numbers under the bubble pointers.
+
+as in Line 13 of the right-hand side of Figure 1. Via the recursive call, we effectively forget that the column just added exists, since the recursive call to ADD starts with a new hidden state for the LSTM controller. Consequently, there is no concept of length relevant to the problem, which has traditionally been an important focus of length-based curriculum learning.
+
+Bubble Sort. For bubble sort, the domain-specific encoder is
+
+$$
+f _ { e n c } ( Q , i _ { 1 } , i _ { 2 } , i _ { 3 } , a _ { t } ) = M L P ( [ Q ( 1 , i _ { 1 } ) , Q ( 1 , i _ { 2 } ) , i _ { 3 } = l e n g t h , a _ { t } ( 1 ) , a _ { t } ( 2 ) , a _ { t } ( 3 ) ] ) ,
+$$
+
+where the environment $Q \in \mathbb { R } ^ { 1 \times N \times K }$ is a scratch-pad that contains 1 row, to represent the state of the array as sorting proceeds in-place, and $N$ columns. $K$ is set to 11, to denote the range of possible numbers (0 through 9), along with the start/end token (represented with the same encoding) which is observed when a pointer reaches beyond the bounds of the input. At any given time, the NPI has access to the values referred to by two pointers, represented by $Q ( 1 , i _ { 1 } )$ and $Q ( 1 , i _ { 2 } )$ ,. The pointers at index $i _ { 1 }$ and $i _ { 2 }$ are used to compare the pair of numbers considered during the bubble sweep, swapping them if the number at $i _ { 1 }$ is greater than that in $i _ { 2 }$ . These pointers are referred to as bubble pointers. The pointer at index $i _ { 3 }$ represents a counter internal to the environment that is incremented once after each pass of the algorithm (one cycle of BUBBLE and RESET); when incremented a number of times equal to the length of the array, the flag $i _ { 3 } = =$ length becomes true and terminates the entire algorithm .
+
+The non-recursive trace loops on cycles of BUBBLE and RESET, which logically represents one bubble sweep through the array and reset of the two bubble pointers to the very beginning of the array, respectively. In this version, there is a dependence on length: BSTEP and LSHIFT are called a number of times equivalent to one less than the length of the input array, in BUBBLE and RESET respectively.
+
+Inside BUBBLE and RESET, there are two operations that can be made recursive. BSTEP, used in BUBBLE, compares pairs of numbers, continuously moving the bubble pointers once to the right each time until reaching the end of the array. LSHIFT, used in RESET, shifts the pointers left until reaching the start token.
+
+We experiment with two levels of recursion—partial and full. Partial recursion only adds a tail recursive call to BUBBLESORT after BUBBLE and RESET, similar to the tail recursive call described previously for addition. The partial recursion is not enough for perfect generalization, as will be presented later in Section 4. Full recursion, in addition to making the aforementioned tail recursive call, adds two additional recursive calls; BSTEP and LSHIFT are made tail recursive. Figure 2 shows examples of traces for the different versions of bubble sort. Training on the full recursive trace leads to perfect generalization, as shown in Section 4. We performed experiments on the partially recursive version in order to examine what happens when only one recursive call is implemented, when in reality three are required for perfect generalization.
+
+# Algorithm 2 Depth First Search Topological Sort
+
+1: Color all vertices white.
+2: Initialize an empty stack $S$ and a directed acyclic graph $D A G$ to traverse. 3: Begin traversing from Vertex 1 in the DAG. 4: function TOPOSORT $( D A G )$ 5: while there is still a white vertex $u$ : do 6: color[u] = grey 7: $v _ { a c t i v e } = u$ 8: do
+9: if $v _ { a c t i v e }$ has a white child $v$ then
+10: $\operatorname { c o l o r } [ v ] = \operatorname { g r e y }$
+11: push $v _ { a c t i v e }$ onto $S$
+12: $v _ { a c t i v e } = v$
+13: else
+14: $\mathrm { c o l o r } [ v _ { a c t i v e } ] = \mathrm { b l a c k }$
+15: Write $v _ { a c t i v e }$ to result
+16: if $S$ is empty then pass
+17: else pop the top vertex off $S$ and set it to $v _ { a c t i v e }$
+18: while $S$ is not empty
+
+Topological Sort. We choose to implement a topological sort task for graphs. A topological sort is a linear ordering of vertices such that for every directed edge $( u , v )$ from $u$ to $v , u$ comes before $v$ in the ordering. This is possible if and only if the graph has no directed cycles; that is to say, it must be a directed acyclic graph (DAG). In our experiments, we only present DAG’s as inputs and represent the vertices as values ranging from $1 , \ldots , n$ , where the DAG contains $n$ vertices.
+
+Directed acyclic graphs are structurally more diverse than inputs in the two tasks of grade-school addition and bubble sort. The degree for any vertex in the DAG is variable. Also the DAG can have potentially more than one connected component, meaning it is necessary to transition between these components appropriately.
+
+Algorithm 2 shows the topological sort task of interest. This algorithm is a variant of depth first search. We created a program set that reflects the semantics of Algorithm 2. For brevity, we refer the reader to the appendix for further details on the program set and non-recursive and recursive trace-generating functions used for topological sort.
+
+For topological sort, the domain-specific encoder is
+
+$$
+\begin{array} { r l } & { \ f _ { e n c } ( D A G , Q _ { c o l o r } , p _ { s t a c k } , p _ { s t a r t } , v _ { a c t i v e } , c h i l d L i s t , a _ { t } ) } \\ & { = M L P ( [ Q _ { c o l o r } ( p _ { s t a r t } ) , Q _ { c o l o r } ( D A G [ v _ { a c t i v e } ] [ c h i l d L i s t [ v _ { a c t i v e } ] ] ) , p _ { s t a c k } = = 1 , a _ { t } ( 1 ) , a _ { t } ( 2 ) , a _ { t } ( 3 ) , a _ { t } ) } \end{array}
+$$
+
+where $Q _ { c o l o r } \in \mathbb { R } ^ { U \times 4 }$ is a scratch-pad that contains $U$ rows, each containing one of four colors (white, gray, black, invalid) with one-hot encoding. $U$ varies with the number of vertices in the graph. We further have $Q _ { r e s u l t } \in \mathbb { N } ^ { U }$ , a scratch-pad which contains the sorted list of vertices at the end of execution, and $Q _ { s t a c k } \in \mathbb { N } ^ { U }$ , which serves the role of the stack $S$ in Algorithm 2. The contents of $Q _ { r e s u l t }$ and $Q _ { s t a c k }$ are not exposed directly through the domain-specific encoder; rather, we define primitive functions which manipulate these scratch-pads.
+
+The DAG is represented as an adjacency list where $D A G [ i ] [ j ]$ refers to the $j$ -th child of vertex $i$ . There are 3 pointers $( p _ { r e s u l t } , p _ { s t a c k } , p _ { s t a r t } )$ , $p _ { r e s u l t }$ points to the next empty location in $Q _ { r e s u l t }$ $p _ { s t a c k }$ points to the top of the stack in $Q _ { s t a c k }$ , and $p _ { s t a r t }$ points to the candidate starting node for a connected component. There are 2 variables ( $\boldsymbol { v } _ { a c t i v e }$ and $v _ { s a v e . }$ ); $v _ { a c t i v e }$ holds the active vertex (as in Algorithm 2) and $v _ { s a v e }$ holds the value of $v _ { a c t i v e }$ before executing Line 12 of Algorithm 2. $c h i l d L i s t \in \mathbb { N } ^ { U }$ is a vector of pointers, where childList[i] points to the next child under consideration for vertex $i$ .
+
+The three environment observations aid with control flow in Algorithm 2. $Q _ { c o l o r } ( p _ { s t a r t } )$ contains the color of the current start vertex, used in the evaluation of the condition in the WHILE loop in Line 5 of Algorithm 2. $Q _ { c o l o r } ( D A G [ v _ { a c t i v e } ] [ c h i l d L i s t [ v _ { a c t i v e } ] ] )$ refers to the color of the next child of $v _ { a c t i v e }$ , used in the evaluation of the condition in the IF branch in Line 9 of Algorithm 2. Finally, the boolean $p _ { s t a c k } = = 1$ is used to check whether the stack is empty in Line 18 of Algorithm 2.
+
+An alternative way of representing the environment slice is to expose the values of the absolute vertices to the model; however, this makes it difficult to scale the model to larger graphs, since large vertex values are not seen during training time.
+
+We refer the reader to the appendix for the non-recursive trace generating functions. In the non-recursive trace, there are four functions that can be made recursive—TOPOSORT, CHECK CHILD, EXPLORE, and NEXT START, and we add a tail recursive call to each of these functions in order to make the recursive trace. In particular, in the EXPLORE function, adding a tail recursive call resets and stores the hidden states associated with vertices in a stack-like fashion. This makes it so that we only need to consider the vertices in the subgraph that are currently relevant for computing the sort, allowing simpler reasoning about behavior for large graphs. The sequence of primitive operations (MOVE and WRITE operations) for the non-recursive and recursive versions are exactly the same.
+
+Quicksort. We implement a quicksort task, in order to demonstrate that recursion helps with learning divide-and-conquer algorithms. We use the Lomuto partition scheme; the logic for the recursive trace is shown in Algorithm 3. For brevity, we refer the reader to the appendix for information about the program set and non-recursive and recursive trace-generating functions for quicksort. The logic for the non-recursive trace is shown in Algorithm 4 in the appendix.
+
+# Algorithm 3 Recursive Quicksort
+
+1: Initialize an array $A$ to sort.
+2: Initialize $l o$ and $h i$ to be 1 and $n$ , where $n$ is the length of $A$ .
+3:
+4: function QUICKSORT $( A , l o , h i )$
+5: if $l o < h i$ : then
+6: $\mathsf { p } = \mathsf { P A R T I T I O N } ( A , l o , h i )$
+7: $\mathrm { Q U I C K S O R T } ( A , l o , p - 1 )$
+8: $\operatorname { Q U I C K S O R T } ( A , p + 1 , h i )$
+9:
+10: function PARTITION $( A , l o , h i )$
+11: $p i v o t = l o$
+12: for $j \in [ l o , h i - 1 ] : \mathbf { d o }$
+13: if $A [ j ] \leq A [ h i ]$ then
+14: swap A[pivot] with $A [ j ]$
+15: pivot = pivot + 1
+16: swap A[pivot] with A[hi]
+17: return pivot
+
+For quicksort, the domain-specific encoder is
+
+$$
+\begin{array} { r l } & { f _ { e n c } ( Q _ { a r r a y } , Q _ { s t a c k L o } , Q _ { s t a c k H i } , p _ { l o } , p _ { h i } , p _ { s t a c k L o } , p _ { s t a c k H i } , p _ { p i v o t } , p _ { j } , a _ { t } ) = } \\ & { \qquad M L P ( [ Q _ { a r r a y } ( p _ { j } ) \leq Q _ { a r r a y } ( p _ { h i } ) , p _ { j } = = p _ { h i } , } \\ & { \qquad Q _ { s t a c k L o } ( p _ { s t a c k L o } - 1 ) < Q _ { s t a c k H i } ( p _ { s t a c k H i } - 1 ) , p _ { s t a c k L o } = = } \\ & { \qquad \quad M L P ( [ Q _ { a r r a y } ( p _ { j } ) \leq \mathfrak { a } _ { t } ( 2 ) , a _ { t } ( 3 ) ] ) , } \end{array}
+$$
+
+where $Q _ { a r r a y } \in \mathbb { R } ^ { U \times 1 1 }$ is a scratch-pad that contains $U$ rows, each containing one of 11 values (one of the numbers 0 through 9 or an invalid state). Our implementation uses two stacks $Q _ { s t a c k L o }$ and
+
+$Q _ { s t a c k H i }$ , each in $\mathbb { R } ^ { U }$ , that store the arguments to the recursive QUICKSORT calls in Algorithm 3; before each recursive call, the appropriate arguments are popped off the stack and written to $p _ { l o }$ and $p _ { h i }$ .
+
+There are 6 pointers $( p _ { l o } , p _ { h i } , p _ { s t a c k L o } , p _ { s t a c k H i } , p _ { p i v o t } , p _ { j } )$ . $p _ { l o }$ and $p _ { h i }$ point to the lo and hi indices of the array, as in Algorithm 3. $p _ { s t a c k L o }$ and $p _ { s t a c k H i }$ point to the top (empty) positions in $Q _ { s t a c k L o }$ and $Q _ { s t a c k H i }$ . $p _ { p i v o t }$ and $p _ { j }$ point to the pivot and $j$ indices of the array, used in the PARTITION function in Algorithm 3. The 4 environment observations aid with control flow; $Q _ { s t a c k L o } ( p _ { s t a c k L o } - 1 ) < Q _ { s t a c k H i } ( p _ { s t a c k H i } - 1 )$ implements the $l o < h i$ comparison in Line 5 of Algorithm 3, $p _ { s t a c k L o } = = 1$ checks if the stacks are empty in Line 18 of Algorithm 4, and the other observations (all involving $p _ { p i v o t }$ or $p _ { j }$ ) deal with logic in the PARTITION function.
+
+Note that the recursion for quicksort is not purely tail recursive and therefore represents a more complex kind of recursion that is harder to learn than in the previous tasks. Also, compared to the bubble pointers in bubble sort, the pointers that perform the comparison for quicksort (the COMPSWAP function) are usually not adjacent to each other, making quicksort less local than bubble sort. In order to compensate for this, $p _ { p i v o t }$ and $p _ { j }$ require special functions (MOVE PIVOT LO and MOVE J LO) to properly set them to $l o$ in Lines 11 and 12 of the PARTITION function in Algorithm 3.
+
+# 3.3 PROVABLY PERFECT GENERALIZATION
+
+We show that if we incorporate recursion, the learned NPI programs can achieve provably perfect generalization for different tasks. Provably perfect generalization implies the model will behave correctly, given any valid input. In order to claim a proof, we must verify the model produces correct behavior over all base cases and reductions, as described in Section 2.
+
+We propose and describe our verification procedure. This procedure verifies that all base cases and reductions are handled properly by the model via explicit tests. Note that recursion helps make this process tractable, because we only need to test a finite number of inputs to show that the model will work correctly on inputs of unbounded complexity. This verification phase only needs to be performed once after training.
+
+Formally, verification consists of proving the following theorem:
+
+$$
+\forall i \in V , M ( i ) \downdownarrows P ( i )
+$$
+
+where $i$ denotes a sequence of step inputs (within one function call), $V$ denotes the set of valid sequences of step inputs, $M$ denotes the neural network model, $P$ denotes the correct program, and $P ( i )$ denotes the next step output from the correct program. The arrow in the theorem refers to evaluation, as in big-step semantics. The theorem states that for the same sequence of step inputs, the model produces the exact same step output as the target program it aims to learn. $M$ , as described in Algorithm 1, processes the sequence of step inputs by using an LSTM.
+
+Recursion drastically reduces the number of configurations we need to consider during the verification phase and makes the proof tractable, because it introduces structure that eliminates infinitely long sequences of step inputs that would otherwise need to be considered. For instance, for recursive addition, consider the family $F$ of addition problems $a _ { n } a _ { n - 1 } \dots a _ { 1 } a _ { 0 } + b _ { n } b _ { n - 1 } \dots b _ { 1 } b _ { 0 }$ where no CARRY operations occur. We prove every member of $F$ is added properly, given that subproblems $S = \{ a _ { n } a _ { n - 1 } + b _ { n } b _ { n - 1 } , a _ { n - 1 } { \bar { a } } _ { n - 2 } + b _ { n - 1 } b _ { n - 2 } , \dots , a _ { 1 } a _ { 0 } + b _ { 1 } b _ { 0 } \}$ are added properly.
+
+Without using a recursive program, such a proof is not possible, because the non-recursive program runs on an arbitrarily long addition problem that creates correspondingly long sequences of step inputs; in the non-recursive formulation of addition, ADD calls ADD1 a number of times that is dependent on the length of the input. The core LSTM module’s hidden state is preserved over all these ADD1 calls, and it is difficult to interpret with certainty what happens over longer timesteps without concretely evaluating the LSTM with an input of that length. In contrast, each call to the recursive ADD always runs for a fixed number of steps, even on arbitrarily long problems in $F$ , so we can test that it performs correctly on a small, fixed number of step input sequences. This guarantees that the step input sequences considered during verification contain all step input sequences which arise during execution of an unseen problem in $F$ , leading to generalization to any problem in $F$ . Hence, if all subproblems in $S$ are added correctly, we have proven that any member of $F$ will be added correctly, thus eliminating an infinite family of inputs that need to be tested.
+
+To perform the verification as described here, it is critical to construct $V$ correctly. If it is too small, then execution of the program on some input might require evaluation of $M ( i )$ on some $i \not \in V$ , and so the behavior of $M ( i )$ might deviate from $P ( i )$ . If it is too large, then the semantics of $P$ might not be well-defined on some elements in $V$ , or the spurious step input sequences may not be reachable from any valid problem input (e.g., an array for quicksort or a DAG for topological sort).
+
+To construct this set, by using the reference implementation of each subprogram, we construct a mapping between two sets of environment observations: the first set consists of all observations that can occur at the beginning of a particular subprogram’s invocation, and the second set contains the observations at the end of that subprogram. We can obtain this mapping by first considering the possible observations that can arise at the beginning of the entry function (ADD, BUBBLESORT, TOPOSORT, and QUICKSORT) for some valid program input, and iteratively applying the observation-to-observation mapping implied by the reference implementation’s step output at that point in the execution. If the step output specifies a primitive function call, we need to reason about how it can affect the environment so as to change the observation in the next step input. For non-primitive subprograms, we can update the observation-to-observation mapping currently associated with the subprogram and then apply that mapping to the current set. By iterating with this procedure, and then running $P$ on the input observation set that we obtain for the entry point function, we can obtain $V$ precisely. To make an analogy to MDPs, this procedure is analogous to how value iteration obtains the correct value for each state starting from any initialization.
+
+An alternative method is to run $P$ on many different program inputs and then observe step input sequences which occur, to create $V$ . However, to be sure that the generated $V$ is complete (covers all the cases needed), we need to check all pairs of observations seen in adjacent step inputs (in particular, those before and after a primitive function call), in a similar way as if we were constructing $V$ from scratch. Given a precise definition of $P$ , it may be possible to automate the generation of $V$ from $P$ in future work.
+
+Note that $V$ should also contain the necessary reductions, which corresponds to making the recursive calls at the correct time, as indicated by $P$ .
+
+After finding $V$ , we construct a set of problem inputs which, when executed on $P$ , create exactly the step input sequences which make up $V$ . We call this set of inputs the verification set, $S _ { V }$ .
+
+Given a verification set, we can then run the model on the verification set to check if the produced traces and results are correct. If yes, then this indicates that the learned neural program achieves provably perfect generalization.
+
+We note that for tasks with very large input domains, such as ones involving MNIST digits or speech samples, the state space of base cases and reduction rules could be prohibitively large, possibly infinite. Consequently, it is infeasible to construct a verification set that covers all cases, and the verification procedure we have described is inadequate. We leave this as future work to devise a verification procedure more appropriate to this setting.
+
+# 4 EXPERIMENTS
+
+As there is no public implementation of NPI, we implemented a version of it in Keras that is as faithful to the paper as possible. Our experiments use a small number of training examples.
+
+Training Setup. The training set for addition contains 200 traces. The maximum problem length in this training set is 3 (e.g., the trace corresponding to the problem $^ { \mathrm { \left. } } 1 0 9 + 1 0 1 ^ { \mathrm { \right. } }$ ).
+
+The training set for bubble sort contains 100 traces, with maximum problem length of 2 (e.g., the trace corresponding to the array [3,2]).
+
+The training set for topological sort contains 6 traces, with one synthesized from a graph of size 5 and the rest synthesized from graphs of size 7.
+
+The training set for quicksort contains 4 traces, synthesized from arrays of length 5.
+
+The same set of problems was used to generate the training traces for all formulations of the task, for non-recursive and recursive versions.
+
+Table 1: Accuracy on Randomly Generated Problems for Bubble Sort
+
+
Length of Array
Non-Recursive
PartiallyRecursive
FullRecursive
23
100%
100%
100%
6.7%
23%
100%
4
10%
10%
100%
8
0% 0%
0% 0%
100% 100%
20
100%
90
0%
0%
+
+We train using the Adam optimizer and use a 2-layer LSTM and task-specific state encoders for the external environments, as described in Reed & de Freitas (2016).
+
+4.1 RESULTS ON GENERALIZATION OF RECURSIVE NEURAL PROGRAMS
+
+We now report on generalization for the varying tasks.
+
+Grade-School Addition. Both the non-recursive and recursive learned programs generalize on all input lengths we tried, up to 5000 digits. This agrees with the generalization of non-recursive addition in Reed & de Freitas (2016), where they reported generalization up to 3000 digits. However, note that there is no provable guarantee that the non-recursive learned program will generalize to all inputs, whereas we show later that the recursive learned program has a provable guarantee of perfect generalization.
+
+In order to demonstrate that recursion can help learn and generalize better, for addition, we trained only on traces for 5 arbitrarily chosen 1-digit addition sum examples. The recursive version can generalize perfectly to long problems constructed from these components (such as the sum $^ { 6 6 } 8 2 2 + 2 3 3 ^ { 3 }$ , where $\because 8 + 2 ^ { , 5 }$ and $\bar { 2 } + 3 \bar { 2 }$ are in the training set), but the non-recursive version fails to sum these long problems properly.
+
+Bubble Sort. Table 1 presents results on randomly generated arrays of varying length for the learned non-recursive, partially recursive, and full recursive programs. For each length, we test each program on 30 randomly generated problems. Observe that partially recursive does slightly better than non-recursive for the setting in which the length of the array is 3, and that the fully recursive version is able to sort every array given to it. The non-recursive and partially recursive versions are unable to sort long arrays, beyond length 8.
+
+Topological Sort. Both the non-recursive and recursive learned programs generalize on all graphs we tried, up to 120 vertices. As before, the non-recursive learned program lacks a provable guarantee of generalization, whereas we show later that the recursive learned program has one.
+
+In order to demonstrate that recursion can help learn and generalize better, we trained a non-recursive and recursive model on just a single execution trace generated from a graph containing 5 nodes3 for the topological sort task. For these models, Table 2 presents results on randomly generated DAGs of varying graph sizes (varying in the number of vertices). For each graph size, we test the learned programs on 30 randomly generated DAGs. The recursive version of topological sort solves all graph instances we tried, from graphs of size 5 through 70. On the other hand, the non-recursive version has low accuracy, beginning from size 5, and fails completely for graphs of size 8 and beyond.
+
+Quicksort. Table 3 presents results on randomly generated arrays of varying length for the learned non-recursive and recursive programs. For each length, we test each program on 30 randomly generated problems. Observe that the non-recursive program’s correctness degrades for length 11 and beyond, while the recursive program can sort any given array.
+
+Table 2: Accuracy on Randomly Generated Problems for Topological Sort
+
+
NumberofVertices
Non-Recursive
Recursive
5
6.7%
100%
6
6.7%
100%
7
3.3%
100%
8
0%
100%
70
0%
100%
+
+Table 3: Accuracy on Randomly Generated Problems for Quicksort
+
+
LengthofArray
Non-Recursive
Recursive
3
100%
100%
5
100%
100%
7
100%
100%
11
73.3%
100%
15
60%
100%
20
30%
22
20%
100%
25
3.33%
100%
30
3.33%
100%
100%
70
0%
100%
+
+As mentioned in Section 2.1, we hypothesize the non-recursive programs do not generalize well because they have learned spurious dependencies specific to the training set, such as length of the input problems. On the other hand, the recursive programs have learned the true program semantics.
+
+# 4.2 VERIFICATION OF PROVABLY PERFECT GENERALIZATION
+
+We describe how models trained with recursive traces can be proven to generalize, by using the verification procedure described in Section 3.3. As described in the verification procedure, it is possible to prove our learned recursive program generalizes perfectly by testing on an appropriate set of problem inputs, i.e., the verification set. Recall that this verification procedure cannot be performed for the non-recursive versions, since the propagation of the hidden state in the core LSTM module makes reasoning difficult and so we would need to check an unbounded number of examples.
+
+We describe the base cases, reduction rules, and the verification set for each task in Appendix A.6. For each task, given the verification set, we check the traces and results of the learned, to-be-verified neural program (described in Section 4.1; and for bubble sort, Appendix A.6) on the verification set, and ensure they match the traces produced by the true program $P$ . Our results show that for all learned, to-be-verified neural programs, they all produced the same traces as those produced by $P$ on the verification set. Thus, we demonstrate that recursion enables provably perfect generalization for different tasks, including addition, topological sort, quicksort, and a variant of bubble sort.
+
+Note that the training set can often be considerably smaller than the verification set, and despite this, the learned model can still pass the entire verification set. Our result shows that the training procedure and the NPI architecture is capable of generalizing from the step input-output pairs seen in the training data to the unseen ones present in the verification set.
+
+# 5 CONCLUSION
+
+We emphasize that the notion of a neural recursive program has not been presented in the literature before: this is our main contribution. Recursion enables provably perfect generalization. To the best of our knowledge, this is the first time verification has been applied to a neural program, providing provable guarantees about its behavior. We instantiated recursion for the Neural ProgrammerInterpreter by changing the training traces. In future work, we seek to enable more tasks with recursive structure. We also hope to decrease supervision, for example by training with only partial or non-recursive traces, and to develop novel Neural Programming Architectures integrated directly with a notion of recursion.
+
+# ACKNOWLEDGMENTS
+
+This material is in part based upon work supported by the National Science Foundation under Grant No. TWC-1409915, DARPA under Grant No. FA8750-15-2-0104, and Berkeley Deep Drive. 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 National Science Foundation and DARPA.
+
+# REFERENCES
+
+Marcin Andrychowicz and Karol Kurach. Learning efficient algorithms with hierarchical attentive memory. CoRR, abs/1602.03218, 2016. URL http://arxiv.org/abs/1602.03218.
+
+Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
+
+Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwiska, Sergio Gmez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adri Puigdomnech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, October 2016. ISSN 0028-0836, 1476-4687. doi: 10.1038/nature20101. URL http://www.nature.com/doifinder/10.1038/nature20101.
+
+Lukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. CoRR, abs/1511.08228, 2015. URL http://arxiv.org/abs/1511.08228.
+
+Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random access machines. ERCIM News, 2016(107), 2016. URL http://ercim-news.ercim.eu/en107/special/ neural-random-access-machines.
+
+Arvind Neelakantan, Quoc V. Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent, 2015.
+
+Scott Reed and Nando de Freitas. Neural programmer-interpreters. ICLR, 2016.
+
+Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer 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. 2692–2700, 2015. URL http://papers.nips.cc/paper/5866-pointer-networks.
+
+Wojciech Zaremba, Tomas Mikolov, Armand Joulin, and Rob Fergus. Learning simple algorithms from examples. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pp. 421–429, 2016. URL http://jmlr. org/proceedings/papers/v48/zaremba16.html.
+
+A APPENDIX
+
+A.1 PROGRAM SET FOR NON-RECURSIVE TOPOLOGICAL SORT
+
+
Program
Descriptions
Calls
Arguments
TOPOSORT
Perform topologicalsort on graph
TRAVERSE,NEXT_START,WRITE,MOVE
NONE
TRAVERSE
Traverse graph untilstack is empty
CHECK_CHILD,EX-PLORE
NONE
CHECK_CHILD
Check ifawhitechild exists; if so, setchildList[Uactive] topoint to it
MOVE
NONE
EXPLORE
Repeatedlytraversesubgraphs until stackis empty
STACK,CHECK_CHILD,WRITE,MOVE
NONE
STACK
Interactwith stack,either pushing orpopping
WRITE,MOVE
PUSH,POP
NEXT_START
Move Pstart untilreaching a whitevertex. If a whitevertex is found,setPstart to point to it;this signifies the startof a traversal of anew connected com-ponent.If no whitevertex is found, theentireexecution isterminated
MOVE
NONE
WRITE
Write a value eitherto environment (e.g.,to color a vertex)or variable (e.g., tochange the value ofUactive)
NONE
Described below
MOVE
Move a pointer(e.g, Pstart orchildList[vactive])up or down
NONE
Described below
+
+# Argument Sets for WRITE and MOVE.
+
+WRITE. The WRITE operation has the following arguments:
+
+# ARG 1 (Main Action): COLOR CURR, COLOR NEXT, ACTIVE START, ACTIVE NEIGHB, ACTIVE STACK, SAVE, STACK PUSH, STACK POP, RESULT
+
+COLOR CURR colors $v _ { a c t i v e }$ , COLOR NEXT colors Vertex $D A G [ v _ { a c t i v e } ] [ c h i l d L i s t [ v _ { a c t i v e } ] ] ,$ , ACTIVE START writes pstart to $v _ { a c t i v e }$ , ACTIVE NEIGHB writes $D A G [ v _ { a c t i v e } ] [ c h i l d L i s t [ v _ { a c t i v e } ] ]$ to $v _ { a c t i v e }$ , ACTIVE STACK writes $Q _ { s t a c k } ( p _ { s t a c k } )$ to $v _ { a c t i v e }$ , SAVE writes $v _ { a c t i v e }$ to $v _ { s a v e }$ , $S T A C K \_ P U S H$ pushes $v _ { a c t i v e }$ to the top of the stack, $S T A C K \_ P O P$ writes a null value to the top of the stack, and $R E S U L T$ writes $v _ { a c t i v e }$ to $Q _ { r e s u l t } ( p _ { r e s u l t } )$ .
+
+ARG 2 (Auxiliary Variable): COLOR GREY, COLOR BLACK
+
+COLOR GREY and COLOR BLACK color the given vertex grey and black, respectively.
+
+MOVE. The MOVE operation has the following arguments:
+
+ARG 1 (Pointer): $p _ { r e s u l t } , p _ { s t a c k } , p _ { s t a r t } , c h i l d L i s t [ v _ { a c t i v e } ] , c h i l d L i s t [ v _ { s a v e } ]$
+
+Note that the argument is the identity of the pointer, not what the pointer points to; in other words, ARG 1 can only take one of 5 values.
+
+ARG 2 (Increment or Decrement): UP, DOWN
+
+# A.2 TRACE-GENERATING FUNCTIONS FOR TOPOLOGICAL SORT
+
+# A.2.1 NON-RECURSIVE TRACE-GENERATING FUNCTIONS
+
+1 // Top level topological sort call
+2 TOPOSORT() {
+3 while $( Q _ { c o l o r } \big ( p _ { s t a r t } \big )$ is a valid color): // color invalid when all vertices explored
+4 WRITE(ACTIVE_START)
+5 WRITE(COLOR_CURR, COLOR_GREY)
+6 TRAVERSE()
+7 MOVE(pstart, UP)
+8 NEXT_START()
+9 }
+10
+11 TRAVERSE() {
+12 CHECK_CHILD()
+13 EXPLORE()
+14 }
+15
+16 CHECK_CHILD() {
+17 while $( Q _ { c o l o r } \big ( D A G \big [ v _ { a c t i v e } \big ] \big [ c h i l d L i s t \big [ v _ { a c t i v e } \big ] \big ] \big )$ is not white and is not invalid): // color invalid when all children explored
+18 MOVE(childList[vactive], UP)
+19 }
+20
+21 EXPLORE() {
+22 do
+23 if (Qcolor(DAG[vactive][childList[vactive]]) is white):
+24 WRITE(COLOR_NEXT, COLOR_GREY)
+25 STACK(PUSH)
+26 WRITE(SAVE)
+27 WRITE(ACTIVE_NEIGHB)
+28 MOVE(childList[vsave], UP)
+29 else:
+30 WRITE(COLOR_CURR, COLOR_BLACK)
+31 WRITE(RESULT)
+32 MOVE(presult, UP)
+33 if(pstack == 1):
+34 break
+35 else:
+36 STACK(POP)
+37 CHECK_CHILD()
+38 while (true)
+39
+40
+41 STACK(op) {
+42 if (op == PUSH):
+43 WRITE(STACK_PUSH)
+44 MOVE(pstack, UP)
+45
+46 if (op == POP):
+47 WRITE(ACTIVE_STACK)
+48 WRITE(STACK_POP)
+49 MOVE(pstack, DOWN)
+50 }
+51
+52 NEXT_START() {
+53 while(Qcolor(pstart) is not white and is not invalid): // color invalid when all vertices explored
+54 MOVE(pstart, UP)
+55 }
+
+# A.2.2 RECURSIVE TRACE-GENERATING FUNCTIONS
+
+# Altered Recursive Functions
+
+1 // Top level topological sort call
+2 TOPOSORT() {
+3 if $\scriptstyle : Q _ { c o l o r }$ $_ { p _ { s t a r t } } ,$ is a valid color): // color invalid when all vertices explored
+4 WRITE(ACTIVE_START)
+5 WRITE(COLOR_CURR, COLOR_GREY)
+6 TRAVERSE()
+7 MOVE(pstart, UP)
+8 NEXT_START()
+9 TOPOSORT() // Recursive Call
+10 }
+11
+12 CHECK_CHILD() {
+13 if $\overline { { ( Q _ { c o l o r } ( D A G [ v _ { a c t i v e } ] [ c h i l d L i s t [ v _ { a c t i v e } ] ] ) } } ) \overline { { { } } }$ is not white and is not invalid): // color invalid when all children explore
+14 MOVE(childList[vactive], UP)
+15 CHECK_CHILD() // Recursive Call
+16 }
+17
+18 EXPLORE() {
+19 if (Qcolor(DAG[vactive][childList[vactive]]) is white):
+20 WRITE(COLOR_NEXT, COLOR_GREY)
+21 STACK(PUSH)
+22 WRITE(SAVE)
+23 WRITE(ACTIVE_NEIGHB)
+24 MOVE(childList[vsave], UP)
+25 else:
+26 WRITE(COLOR_CURR, COLOR_BLACK)
+27 WRITE(RESULT)
+28 MOVE(presult, UP)
+29 if $( p _ { s t a c k } = = 1$ ):
+30 return
+31 else:
+32 STACK(POP)
+33 CHECK_CHILD()
+34 EXPLORE() // Recursive Call
+35 }
+36
+37 NEXT_START() {
+38 if $( Q _ { c o l o r } \left( p _ { s t a r t } \right)$ is not white and is not invalid): // color invalid when all vertices explored
+39 MOVE $( p _ { s t a r t }$ , UP)
+40 NEXT_START() // Recursive Call
+41 }
+
+# Algorithm 4 Iterative Quicksort
+
+1: Initialize an array $A$ to sort and two empty stacks $S _ { l o }$ and $S _ { h i }$ .
+2: Initialize lo and $h i$ to be 1 and $n$ , where $n$ is the length of $A$ .
+3:
+4: function PARTITION $( A , l o , h i )$
+5: $p i v o t = l o$
+6: for $j \in [ l o , h i - 1 ] : \mathbf { d o }$
+7: if $A [ j ] \leq A [ h i ]$ then
+8: swap A[pivot] with $A [ j ]$
+9: pivot = pivot + 1
+10: swap A[pivot] with $A [ h i ]$
+11: return pivot
+12:
+13: function QUICK ${ \mathrm { : } } \operatorname { S o R T } ( A , l o , h i )$
+14: while $S _ { l o }$ and $S _ { h i }$ are not empty: do
+15: Pop states off $S _ { l o }$ and $S _ { h i }$ , writing them to $l o$ and $h i$ .
+16: $\mathsf { p } = \mathsf { P A R T I T I O N } ( A , l o , h i )$
+17: Push $p + 1$ and $h i$ to $S _ { l o }$ and $S _ { h i }$ .
+18: Push lo and $p - 1$ to $S _ { l o }$ and $S _ { h i }$ .
+
+A.4 PROGRAM SET FOR QUICKSORT
+
+
Program
Descriptions
Calls
Arguments
QUICKSORT
Runthequicksortroutine in place forthearrayA,forindices from lo to hi
Non-Recursive: PAR-TITION, STACK,WRITERecursive: same asnon-recursiveversion,alongwithQUICK-SORT
Implicitly:arrayA to sort, lo, hi
PARTITION
Runsthepartitionfunction. At end,pointer Ppivot ismoved to the pivot
COMPSWAP_LOOP,MOVE_PIVOT_LO,MOVE_JLO, SWAP
NONE
COMPSWAPLOOP
Runs the FOR loopinside the partitionfunction
COMPSWAP, MOVE
NONE
COMPSWAP
ComparesA[pivot] ≤ A[j]; ifso,perform a swapand increment Ppivot
SWAP, MOVE
NONE
SET_PIVOTLO
Sets Ppivot to lo in-dex
NONE
NONE
SETJLO
Sets pj to lo index
NONE
NONE
SET_J_NULL
Sets pj to-00
NONE
NONE
STACK
Pushes lo/hi statesonto stacks Sto andShi according to argument(describedbelow)
WRITE, MOVE
Described below
MOVE
Movespointerone unit up or down
NONE
Described below
SWAP
Swapselementsatgiven array indices
NONE
Described below
WRITE
Write a valueeither to stack(e.g QstackLoorQstackHi) or topointer (e.g tochangethe value ofPhi)
NONE
Described below
+
+Argument Sets for STACK, MOVE, SWAP, WRITE.
+
+STACK. The STACK operation has the following arguments:
+
+ARG 1 (Operation): STACK PUSH CALL1, STACK PUSH CALL2, STACK POP
+
+STACK PUSH CALL1 pushes $l o$ and pivot−1 to $Q _ { s t a c k L o }$ and $Q _ { s t a c k H i }$ . STACK PUSH CALL2 pushes pivot $+ 1$ and $h i$ to $Q _ { s t a c k L o }$ and $Q _ { s t a c k H i }$ . STACK POP pushes $- \infty$ values to $Q _ { s t a c k L o }$ and $Q _ { s t a c k H i }$ .
+
+MOVE. The MOVE operation has the following arguments:
+
+ARG 1 (Pointer): pstackLo, pstackHi, pj , ppivot
+
+Note that the argument is the identity of the pointer, not what the pointer points to; in other words, ARG 1 can only take one of 4 values.
+
+ARG 2 (Increment or Decrement): UP, DOWN
+
+SWAP. The SWAP operation has the following arguments:
+
+ARG 1 (Swap Object 1): ppivot
+
+ARG 2 (Swap Object 2): $p _ { h i } , p _ { j }$
+
+WRITE. The WRITE operation has the following arguments:
+
+ARG 1 (Object to Write): ENV STACK LO, ENV STACK HI, $p _ { h i } , p _ { l o }$
+
+ENV STACK LO and ENV STACK HI represent $Q _ { s t a c k L o } ( p _ { s t a c k L o } ) $ and $Q _ { s t a c k H i } ( p _ { s t a c k H i } )$ , re spectively.
+
+ARG 2 (Object to Copy): ENV STACK LO PEEK, ENV STACK HI PEEK, $p _ { h i } , p _ { l o } , p _ { p i v o t } - 1$ ppivot + 1, RESET
+
+ENV STACK LO PEEK and ENV STACK HI PEEK represent $Q _ { s t a c k L o } ( p _ { s t a c k L o } \mathrm { ~ - ~ } 1 )$ and $Q _ { s t a c k H i } ( p _ { s t a c k H i } - 1 )$ , respectively. RESET represents a $- \infty$ value.
+
+Note that the argument is the identity of the pointer, not what the pointer points to; in other words, ARG 1 can only take one of 4 values, and ARG 2 can only take one of 7 values.
+
+# A.5 TRACE-GENERATING FUNCTIONS FOR QUICKSORT
+
+# A.5.1 NON-RECURSIVE TRACE-GENERATING FUNCTIONS
+
+1 Initialize $p _ { l o }$ to 1 and $p _ { h i } \ t \circ \ n$ (length of array)
+2 Initialize $p _ { j } ~ \mathsf { t o } ~ - \infty$
+3
+4 QUICKSORT() {
+5 while $( p _ { s t a c k L o } \neq 1 )$ :
+6 if $( \stackrel { } { Q } _ { s t a c k L o } ^ { \prime \prime } ( \stackrel { \prime } { p } _ { s t a c k L o } - 1 ) < Q _ { s t a c k H i } ( p _ { s t a c k H i } - 1 ) ) :$
+7 STACK(STACK_POP)
+8 else:
+9 WRITE $( \boldsymbol { p } _ { h i }$ , ENV_STACK_HI_PEEK)
+10 WRITE(plo, ENV_STACK_LO_PEEK)
+11 STACK(STACK_POP)
+12 PARTITION()
+13 STACK(STACK_PUSH_CALL2)
+14 STACK(STACK_PUSH_CALL1)
+15 }
+16
+17 PARTITION() {
+18 SET_PIVOT_LO()
+19 SET_J_LO()
+20 COMPSWAP_LOOP()
+24 SWAP(ppivot, phi)
+SET_J_NULL()
+}
+COMPSWAP_LOOP() {
+while $( p _ { j } \neq p _ { h i } )$ :
+COMPSWAP()
+MOVE $( p _ { j }$ , UP)
+}
+30
+31 COMPSWAP() {
+32 if (A[pj ] ≤ A[phi]):
+33 SWAP(ppivot, pj)
+34 MOVE(ppivot, UP)
+35 }
+36
+37 STACK(op) {
+38 if (op == STACK_PUSH_CALL1):
+39 WRITE(ENV_STACK_LO, plo)
+40 WRITE(ENV_STACK_HI, ppivot − 1)
+41 MOVE(pstackLo, UP)
+42 MOVE(pstackHi, UP)
+43
+44 if (op $= =$ STACK_PUSH_CALL2):
+45 WRITE(ENV_STACK_LO, ppivot $^ { + 1 1 }$ )
+46 WRITE(ENV_STACK_HI, $p _ { h i }$ )
+47 MOVE(pstackLo, UP)
+48 MOVE(pstackHi, UP)
+49
+50 if (op $= =$ STACK_POP):
+51 WRITE(ENV_STACK_LO, RESET)
+52 WRITE(ENV_STACK_HI, RESET)
+53 MOVE(pstackLo, DOWN)
+54 MOVE(pstackHi, DOWN)
+55 }
+
+# A.5.2 RECURSIVE TRACE-GENERATING FUNCTIONS
+
+# Altered Recursive Functions
+
+Initialize to 1 and $p _ { h i } \ t \circ \ n$ (length of array)
+
+1 $p _ { l o }$
+2 Initialize $p _ { j }$ to −∞
+3
+4 QUIC $\begin{array} { r l } & { \mathrm { \sf { A S O R T } \left( \tau \right) } \quad \mathrm { \sf { \{ } } } \\ & { \mathrm { \sf { ( } } Q _ { s t a c k L o } ( p _ { s t a c k L o } - 1 ) < Q _ { s t a c k H i } ( p _ { s t a c k H i } - 1 ) ) : } \\ & { \mathrm { \sf { 2 } } \mathrm { \sf { A R T I T I O N } \left( \tau \right) } } \end{array}$
+5 if
+6
+7 STACK(STACK_PUSH_CALL2)
+8 STACK(STACK_PUSH_CALL1)
+9 WRITE $( p _ { h i }$ , ENV_STACK_HI_PEEK)
+10 WRITE $( p _ { l o }$ , ENV_STACK_LO_PEEK)
+11 QUICKSORT() // Recursive Call
+12 STACK(STACK_POP)
+13 WRITE $( p _ { h i }$ , ENV_STACK_HI_PEEK)
+14 WRITE $( p _ { l o }$ , ENV_STACK_LO_PEEK)
+15 QUICKSORT() // Recursive Call
+16 STACK(STACK_POP)
+17 }
+18
+19 COMPSWAP_LOOP() {
+20 if $( p _ { j } \neq p _ { h i } )$ :
+21 COMPSWAP()
+22 MOVE $( p _ { j }$ , UP)
+23 COMPSWAP_LOOP() // Recursive Call
+24 }
+
+A.6 BASE CASES, REDUCTION RULES, AND VERIFICATION SETS
+
+In this section, we describe the space of base cases and reduction rules that must be covered for each of the four sample tasks, in order to create the verification set.
+
+For addition, we analytically determine the verification set. For tasks other than addition, it is difficult to analytically determine the verification set, so instead, we randomly generate input candidates until they completely cover the base cases and reduction rules.
+
+Base Cases and Reduction Rules for Addition. For the recursive formulation of addition, we analytically construct the set of input problems that cover all base cases and reduction rules. We outline how to construct this set.
+
+It is sufficient to construct problems where every transition between two adjacent columns is covered. The ADD reduction rule ensures that each call to ADD only covers two adjacent columns, and so the LSTM only ever runs for a fixed number of steps necessary to process these two columns.
+
+We construct input problems by splitting into two cases: one case in which the left column contains a null value and another in which the left column does not contain any null values. We then construct problem configurations that span all possible valid environment states (for instance, in order to force the carry bit in a column to be 1, one can add the sum $\cdot _ { 1 + 9 } ,$ in the column to the right).
+
+The operations we need to be concerned most about are CARRY and LSHIFT, which induce partial environment states spanning two columns. It is straightforward to deal with all other operations, which do not induce partial environment states.
+
+Under the assumption that there are no leading 0’s (except in the case of single digits) and the two numbers to be added have the same number of digits, the verification set for addition contains 20,181 input problems. The assumption of leading 0’s can be easily removed, at the cost of slightly increasing the size of the verification set. We made the assumption of equivalent lengths in order to parametrize the input format with respect to length, but this assumption can be removed as well.
+
+Base Cases and Reduction Rules for Bubble Sort. The original version of the bubblesort implementation exposes the values within the array. While this matches the description from Reed & de Freitas (2016), we found that this causes an unnecessary blowup in the size of $V$ and makes it much more difficult to construct the verification set. For purposes of verification, we replace the domain-specific encoder with the following:
+
+$$
+\begin{array} { r l } & { f _ { e n c } ( Q , i _ { 1 } , i _ { 2 } , i _ { 3 } , a _ { t } ) = M L P ( [ Q ( 1 , i _ { 1 } ) \leq Q ( 1 , i _ { 2 } ) , 1 \leq i _ { 1 } \leq l e n g t h , 1 \leq i _ { 2 } \leq l e n g t h , } \\ & { ~ i _ { 3 } = = l e n g t h , a _ { t } ( 1 ) , a _ { t } ( 2 ) , a _ { t } ( 3 ) ] ) , } \end{array}
+$$
+
+Table 4: Accuracy on Randomly Generated Problems for Variant of Bubble Sort
+
+
Length of Array
Non-Recursive
Recursive
100%
100%
23
100%
100%
4
100%
100%
5
100%
100%
6
90%
100%
7
86.7%
100%
8
6.7%
100%
9
0%
100%
10
0%
12
0%
100%
15
0%
100%
100%
70
0%
100%
+
+which directly exposes which of the two values pointed to is larger. This modification also enables us to sort arrays containing arbitrary comparable elements.
+
+By reasoning about the possible set of environment observations created by all valid inputs, we construct $V$ using the procedure described in Section 3.3. Using this modification, we constructed a verification set consisting of one array of size 10.
+
+We also report on generalization results for the non-recursive and recursive versions of this variant of bubble sort. Table 4 demonstrates that the accuracy of the non-recursive program degrades sharply when moving from arrays of length 7 to arrays of length 8. This is due to the properties of the training set – we trained on 2 traces synthesized from arrays of length 7 and 1 trace synthesized from an array of length 6. Table 4 also demonstrates that the (verified) recursive program generalizes perfectly.
+
+Base Cases and Reduction Rules for Topological Sort. For each function we use to implement the recursive version of topological sort, we need to consider the set of possible environment observation sequences we can create from all valid inputs and test that the learned program produces the correct behavior on each of these inputs. We have three observations: the color of the start node, the color of the active node’s next child to be considered, and whether the stack is empty. Na¨ıvely, we might expect to synthesize and test an input for any sequence created by combining the four possible colors in two variables and another boolean variable for whether the stack is empty (so 32 possible observations at any point), but for various reasons, most of these combinations are impossible to occur at any given point in the execution trace.
+
+Through careful reasoning about the possible set of environment observations created by all valid inputs, and how each of the operations in the execution trace affects the environment, we can construct $V$ using the procedure described in Section 3.3. We then construct a verification set of size 73 by ensuring that randomly generated graphs cover the analytically derived $V$ . The model described in the training setup of Section 4 (trained on 6 traces) was verified to be correct via the matching procedure described in Section 4.2.
+
+Base Cases and Reduction Rules for Quicksort. As with the others, we apply the procedure described in Section 3.3 to construct $V$ and then empirically create a verification set which covers $V$ . The verification set can be very small, as we found a 10-element array ([8,2,1,2,0,8,5,8,3,7]) is sufficient to cover all of $V$ . We note that an earlier version of quicksort we tried lacked primitive operations to directly move a pointer to another, and therefore needed more functions and observations. As this complexity interfered with determining the base cases and reductions, we changed the algorithm to its current form. Even though the earlier version also generalized just as well in practice, relatively small differences in the formulation of the traces and the environment observations can drastically change the difficulty of verification.
\ No newline at end of file
diff --git a/md/train/BkgtDsCcKQ/BkgtDsCcKQ.md b/md/train/BkgtDsCcKQ/BkgtDsCcKQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..1f115755a8fe7b05d3ce1bf7b2bf373e6db44fa1
--- /dev/null
+++ b/md/train/BkgtDsCcKQ/BkgtDsCcKQ.md
@@ -0,0 +1,610 @@
+# FUNCTION SPACE PARTICLE OPTIMIZATION FOR BAYESIAN NEURAL NETWORKS
+
+Ziyu Wang, Tongzheng Ren, Jun Zhu∗, Bo Zhang Department of Computer Science & Technology, Institute for Artificial Intelligence, State Key Lab for Intell. Tech. & Sys., BNRist Center, THBI Lab, Tsinghua University {wzy196,rtz19970824}@gmail.com, {dcszj,dcszb}@tsinghua.edu.cn
+
+# ABSTRACT
+
+While Bayesian neural networks (BNNs) have drawn increasing attention, their posterior inference remains challenging, due to the high-dimensional and overparameterized nature. Recently, several highly flexible and scalable variational inference procedures based on the idea of particle optimization have been proposed. These methods directly optimize a set of particles to approximate the target posterior. However, their application to BNNs often yields sub-optimal performance, as they have a particular failure mode on over-parameterized models. In this paper, we propose to solve this issue by performing particle optimization directly in the space of regression functions. We demonstrate through extensive experiments that our method successfully overcomes this issue, and outperforms strong baselines in a variety of tasks including prediction, defense against adversarial examples, and reinforcement learning.
+
+# 1 INTRODUCTION
+
+Bayesian nerual networks (BNNs) provide a principled approach to reasoning about the epistemic uncertainty—uncertainty in model prediction due to the lack of knowledge. Recent work has demonstrated the potential of BNNs in safety-critical applications like medicine and autonomous driving, deep reinforcement learning, and defense against adversarial samples (see e.g. Ghosh et al., 2018; Zhang et al., 2018b; Feng et al., 2018; Smith & Gal, 2018).
+
+Modeling with BNNs involves placing priors on neural network weights, and performing posterior inference with the observed data. However, posterior inference for BNNs is challenging, due to the multi-modal and high dimensional nature of the posterior. Variational inference (VI) is a commonly used technique for practical approximate inference. Traditional VI methods approximate the true posterior with oversimplified distribution families like factorized Gaussians, which can severely limit the approximation quality and induce pathologies such as over-pruning (Trippe & Turner, 2018). These limitations have motivated the recent development of implicit VI methods (Li & Turner, 2018; Shi et al., 2018b), which allow the use of flexible approximate distributions without a tractable density. However, most of the implicit inference methods require to learn a “generator network” that maps a simple distribution to approximate the target posterior. Inclusion of such a generator network can introduce extra complexity, and may become infeasible when the number of parameters is very large, as in the case for BNNs.
+
+Compared with those generator-based methods, particle-optimization-based variational inference (POVI) methods constitute a simpler but more efficient class of implicit VI methods. In an algorithmic perspective, POVI methods iteratively update a set of particles, so that the corresponding empirical probability measure approximates the target posterior well. Formally, these methods consider the space of probabilistic measures equipped with different metrics, and simulate a gradient flow that converges to the target distribution. Examples of POVI methods include Stein variational gradient descent (SVGD; Liu & Wang, 2016), gradient flows in the 2-Wasserstein space (Chen et al., 2018), and accelerated first-order methods in the 2-Wasserstein space (Liu et al., 2018).
+
+While POVI methods have shown promise in a variety of challenging inference problems, their performance in BNNs is still far from ideal, as with a limited number of particles, it is hard to characterize the highly complex weight-space posterior. The first problem is the curse of dimensionality: Zhuo et al. (2018) and Wang et al. (2018) show that for SVGD with a RBF kernel, particles can collapse to the maximum a posteriori (MAP) estimate as the dimension of parameter increases. One may hope to alleviate such a problem by switching to other POVI methods that could be more suitable for BNN inference; however, this is not the case: BNN is over-parameterized, and there exist a large number of local modes in the weight-space posterior that are distant from each other, yet corresponding to the same regression function. Thus a possible particle approximation is to place each particle in a different mode. In prediction, such an approximate posterior will not perform better than a single point estimate. In other words, good approximations for the weight-space posterior do not necessarily perform well in prediction.
+
+To address the above issue, we propose to perform POVI directly for the posterior of regression functions, i.e. the function-space posterior, instead for the weight-space posterior. In our algorithm, particles correspond to regression functions. We address the infinite dimensionality of function space, by approximating the function particles by weight-space parameters, and presenting a minibatch version of particle update. Extensive experiments show that our method avoids the degenerate behavior of weight-space POVI methods, and leads to significant improvements on several tasks, including prediction, model robustness, and exploration in reinforcement learning.
+
+The rest of our paper is organized as follows. We first briefly review BNNs and POVI in Section 2. In Section 3 we present our algorithm for function-space POVI. We compare our method with existing work in Section 4, and finally demonstrate our method’s effectiveness in Section 5.
+
+# 2 BACKGROUND
+
+Bayesian Neural Networks (BNNs) Consider a supervised learning task. Let $\mathbf { X } = \{ x _ { i } \} _ { i = 1 } ^ { N }$ denote the training inputs and $\mathbf { Y } ~ = ~ \{ y _ { i } \} _ { i = 1 } ^ { N }$ denote the corresponding outputs, with $x _ { i } ~ \in ~ { \mathcal { X } }$ and $y _ { i } ~ \in ~ \mathcal { V }$ , respectively. Let $f ( \cdot ; \theta ) : \mathcal { X } \to \mathbb { R } ^ { F }$ denote a mapping function parameterized by a neural network, where $F$ will be clear according to the task. Then, we can define a conditional distribution $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } )$ by leveraging the flexibility of function $f ( x ; \theta )$ . For example, for real-valued regression where $\mathcal { V } = \mathbb { R }$ , we could set $F = 1$ and define the conditional distribution as $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } ) =$ $\bar { \mathcal { N } } ( y | f ( x ; \theta ) , \sigma ^ { 2 } )$ , where $\sigma ^ { 2 }$ is the variance of observation noise; for a classification problem with $K$ classes, we could set $F = K$ and let $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } ) = \mathrm { M u l t i n o m i a l } ( \boldsymbol { y } | \mathrm { s o f t m a x } ( \boldsymbol { f } ( \boldsymbol { x } ; \bar { \boldsymbol { \theta } } ) ) )$ . A BNN model further defines a prior $p ( \theta )$ over the weights $\theta$ . Given the training data $( \mathbf { X } , \mathbf { Y } )$ , one then infers the posterior distribution $p ( \boldsymbol { \theta } | \mathbf { \bar { X } } , \mathbf { Y } ) \propto p ( \boldsymbol { \theta } ) p ( \mathbf { \bar { Y } } | \boldsymbol { \theta } , \mathbf { X } )$ , and for a test data point $x _ { \mathrm { t e s t } }$ , $y$ is predicted to have the distribution $\begin{array} { r } { p ( y _ { \mathrm { t e s t } } | x _ { \mathrm { t e s t } } , \mathbf { X } , \mathbf { Y } ) = \int p ( y _ { \mathrm { t e s t } } | x _ { \mathrm { t e s t } } , \theta ) p ( d \theta | \mathbf { X } , \mathbf { Y } ) . } \end{array}$ .
+
+Posterior inference for BNNs is generally difficult due to the high-dimensionality of $\theta$ . The overparameterized nature of BNNs further exacerbates the problem: for over-parameterized models, there exist multiple $\theta$ that correspond to the same likelihood function $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } )$ . One could easily obtain an exponential number of such $\theta$ , by reordering the weights in the network. Each of the $\theta$ can be a mode of the posterior, which makes approximate inference particularly challenging for BNNs.
+
+Particle-Optimization based Variational Inference (POVI) Variational inference aims to find an approximation of the true posterior. POVI methods (Liu & Wang, 2016; Chen et al., 2018) view the approximate inference task as minimizing some energy functionals over probability measures, which obtain their minimum at the true posterior. The optimization problem is then solved by simulating a corresponding gradient flow in certain metric spaces, i.e. to simulate a PDE of the form
+
+$$
+\begin{array} { r } { \partial _ { t } q _ { t } = - \nabla \cdot ( \mathbf { v } \cdot q _ { t } ) , } \end{array}
+$$
+
+where $q _ { t }$ is the approximate posterior at time $t$ , and $\mathbf { v }$ is the gradient flow depending on the choice of metric and energy functional. As $q _ { t }$ can be arbitrarily flexible, it cannot be maintained exactly in simulation. Instead, POVI methods approximate it with a set of particles $\{ \theta ^ { ( i ) } \} _ { i = 1 } ^ { n }$ , i.e. $q _ { t } ( \theta ) \approx$ $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \delta ( \theta - \theta _ { t } ^ { ( i ) } ) } \end{array}$ , and simulate the gradient flow with a discretized version of the ODE $\mathrm { d } \theta _ { t } ^ { ( i ) } / \mathrm { d } t =$ $- \mathbf { v } ( \theta _ { t } ^ { ( i ) } )$ . In other words, in each iteration, we update the particles with
+
+$$
+\theta _ { \ell + 1 } ^ { i } \theta _ { \ell } ^ { i } - \epsilon _ { \ell } \mathbf { v } ( \theta _ { \ell } ^ { i } ) ,
+$$
+
+Table 1: Common choices of the gradient flow $\mathbf { v }$ in POVI methods, where $k$ denotes a kernel, and $\mathbf { K } _ { i j } : = k ( \theta ^ { ( i ) } , \theta ^ { ( j ) } )$ is the gram matrix. We omit the subscript $\ell$ for brevity.
+
+$$
+\begin{array} { l l } { \mathrm { M e t h o d ~ } } & { \mathrm { - } \mathbf { v } ( \theta ^ { ( i ) } ) } \\ { \mathrm { S V G D ~ ( L i u ~ \& ~ W a n g , ~ 2 0 1 6 ) } } & { \frac { 1 } { n } \sum _ { j = 1 } ^ { n } \mathbf { K } _ { i j } \nabla _ { \theta ( j ) } \log p ( \theta ^ { ( j ) } | \mathbf { x } ) + \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { i j } } \\ { \mathrm { ~ } } & { \mathrm { - } S \mathrm { G L D - B ~ ( C h e n ~ e t ~ a l . , ~ 2 0 1 8 ) ~ } } & { \nabla _ { \theta ^ { ( i ) } } \log p ( \theta ^ { ( i ) } | \mathbf { x } ) + \sum _ { j = 1 } ^ { n } \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { j i } / \sum _ { k = 1 } ^ { n } \mathbf { K } _ { j k } } \\ & { \mathrm { ~ } + \sum _ { j = 1 } ^ { n } \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { j i } / \sum _ { k = 1 } ^ { n } \mathbf { K } _ { i k } } \\ { \mathrm { ~ } } & { \mathrm { ~ } \mathrm { ~ s u m ~ o f - v i n ~ S V G D ~ a n d ~ w - S G L D - B ~ } } \\ { \mathrm { G F S F ~ ( L i u ~ e t ~ a l . , ~ 2 0 1 8 ) ~ } } & { \nabla _ { \theta ^ { ( i ) } } \log p ( \theta ^ { ( i ) } | \mathbf { x } ) + \sum _ { j = 1 } ^ { n } ( \mathbf { K } ^ { - 1 } ) _ { i j } \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { i j } } \end{array}
+$$
+
+where $\epsilon _ { \ell }$ is the step-size at the $\ell \cdot$ -th iteration. Table 1 summarizes the common choices of the gradient flow v for various POVI methods. We can see that in all cases, v consists of a (possibly smoothed) log posterior gradient term, which pushes particles towards high-density regions in the posterior; and a repulsive force term (e.g. $\nabla _ { \theta ( j ) } { \bf K } _ { i j }$ for SVGD), which prevents particles from collapsing into a single MAP estimate.
+
+While the flexibility of POVI methods is unlimited in theory, the use of finite particles can make them un-robust in practice, especially when applied to high-dimensional and over-parameterized models. The problem of high dimensionality is investigated in Zhuo et al. (2018) and Wang et al. (2018). Here we give an intuitive explanation of the over-parameterization problem1: in an overparameterized model like BNN, the target posterior has a large number of modes that are sufficiently distant from each other, yet corresponding to the same regression function $f$ . A possible convergence point for POVI with finite particles is thus to occupy all these modes, as such a configuration has a small 2-Wasserstein distance (Ambrosio et al., 2008) to the true posterior. In this case, prediction using these particles will not improve over using the MAP estimate. Such a degeneracy is actually observed in practice; see Section 5.1 and Appendix A.1.
+
+# 3 FUNCTION SPACE PARTICLE OPTIMIZATION
+
+To address the above degeneracy issue of existing POVI methods, we present a new perspective as well as a simple yet efficient algorithm to perform posterior inference in the space of regression functions, rather than in the space of weights.
+
+Our method is built on the insight that when we model with BNNs, there exists a map from the network weights $\theta$ to a corresponding regression function $f$ , $\theta \mapsto f ( \cdot ; \theta )$ , and the prior on $\theta$ implicitly defines a prior measure on the space of $f$ , denoted as $p ( f )$ . Furthermore, the conditional distribution $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } )$ also corresponds to a conditional distribution of $p ( y | x , f )$ . Therefore, posterior inference for network weights can be viewed as posterior inference for the regression function $f$ .
+
+A nice property of the function space inference is that it does not suffer from the overparameterization problem. However, it is hard to implement, as the function space is infinitedimensional, and the prior on it is implicitly defined. We will present a simple yet effective solution to this problem. In the sequel, we will use boldfaced symbols $\mathbf { x }$ (or y) to denote a subset of samples from $\mathcal { X }$ (or $y ) ^ { 2 }$ . We denote the approximate posterior measure as $q ( f )$ . For any finite subset x, we use $f ( \mathbf { x } )$ to denote the vector-valued evaluations of the regression function on $\mathbf { x }$ , and define $p ( f ( \mathbf { x } ) ) , q ( f ( \mathbf { x } ) )$ accordingly. We will use the notation $[ n ] : = \{ \bar { 1 , 2 } , . . . , n \}$ .
+
+# 3.1 FUNCTION SPACE PARTICLE OPTIMIZATION ON A FINITE INPUT SPACE
+
+For the clarity of presentation, we start with a simple setting, where $\mathcal { X }$ is a finite set and the gradient for the (log) function-space prior, $\nabla _ { f ( \mathbf { x } ) } \log p ( f ( \mathbf { x } ) )$ is available for any $\mathbf { x }$ . These assumptions will be relaxed in the subsequent section. In this case, we can treat the function values $f ( \mathcal X )$ as the parameter to be inferred, and apply POVI in this space. Namely, we maintain $n$ particles $f ^ { 1 } ( { \mathcal { X } } ) , \ldots , f ^ { n } ( { \mathcal { X } } )$ ; and in step $\ell$ , update each particle with
+
+$$
+f _ { \ell + 1 } ^ { i } ( \chi ) \gets f _ { \ell } ^ { i } ( \chi ) - \epsilon _ { \ell } \mathbf { v } [ f _ { \ell } ^ { i } ( \chi ) ] .
+$$
+
+This algorithm is sound when $f ( \mathcal X )$ is finite-dimensional, as theories on the consistency of POVI (e.g. Liu, 2017) directly apply. For this reason, we refer to this algorithm as the exact version of function-space POVI, even though the posterior is still approximated by particles.
+
+However, even in the finite- $\mathcal { X }$ case, this algorithm can be inefficient for large $\mathcal { X }$ . We address this issue by approximating function-space particles in a weight space, and presenting a mini-batch version of the update rule. As we shall see, these techniques naturally generalize to the case when $\mathcal { X }$ is infinite.
+
+# 3.1.1 PARAMETRIC APPROXIMATION TO PARTICLE FUNCTIONS
+
+Instead of explicitly maintaining $f ( x )$ for all $x \in \mathcal { X }$ , we can represent a function $f$ by a parameterized neural network. Although any flexible network can be used, here we choose the original network with parameters $\theta$ of the BNN model, which can faithfully represent any function in the support of the function prior. Note that although we now turn to deal with weights $\theta$ , our method is significantly different from the existing POVI methods, as explained below in Remark 3.2 and Appendix D. Formally, our method maintains $n$ weight-space particles $\theta _ { \ell } ^ { i }$ $( i \in [ n ] )$ at iteration $\ell$ , and defines the update rule as follows:
+
+$$
+\boldsymbol { \theta } _ { \ell + 1 } ^ { i } \gets \boldsymbol { \theta } _ { \ell } ^ { i } - \epsilon _ { \ell } \left( \frac { \partial f ( \mathcal { X } ; \boldsymbol { \theta } _ { \ell } ^ { i } ) } { \partial \boldsymbol { \theta } _ { \ell } ^ { i } } \right) ^ { \top } { \mathbf { v } } [ f _ { \ell } ^ { i } ( \mathcal { X } ) ] ,
+$$
+
+where we use the shorthand $f _ { \ell } ^ { i } ( \cdot ) : = f ( \cdot ; \theta _ { \ell } ^ { i } )$ . As the weights correspond to $n$ regression functions, the rule (3) essentially updates the particles of $f$ . In the following remarks, we relate (3) to the “exact rule” (2), and discuss its implications.
+
+Remark 3.1. ((3) as a single step of $\mathbf { G } D _ { \mathbf { \alpha } }$ ) The update rule (3) essentially is a one-step gradient descent $( G D )$ to minimize the squared distance between $f _ { \ell + 1 } ^ { i } ( \mathcal { X } )$ and $f _ { \ell } ^ { i } ( \mathcal { X } ) - \epsilon _ { \ell } { \bf v } [ f _ { \ell } ^ { i } ( \bar { \mathcal { X } } ) ]$ (the exact function-space update (2)) under the parametric representation of $f$ . Similar strategies have been successfully used in deep reinforcement learning (Mnih et al., 2015).
+
+Also note that (3) is easy to implement, as it closely relates to the familiar back-propagation $( B P )$ procedure for the maximum likelihood estimation $( M L E )$ . Namely, the GD for MLE corresponds to the update $\begin{array} { r l r } { \theta _ { \ell + 1 } } & { } & { \theta _ { \ell } - \epsilon _ { \ell } ( \frac { \partial f ( \mathcal { X } ; \theta _ { \ell } ) } { \partial \theta _ { \ell } } ) \nabla _ { f ( \mathcal { X } ; \theta _ { \ell } ) } \log p ( \mathbf { Y } | \mathbf { X } , f ( \mathcal { X } ; \theta _ { \ell } ) ) } \end{array}$ , where $\nabla _ { f ( \mathcal { X } ; \theta _ { \ell } ) } \log p ( \mathbf { Y } | \mathbf { X } , f ( \mathcal { X } ; \theta _ { \ell } ) )$ is commonly referred to as the “error signal of top-layer network activation” in $B P .$ In our algorithm, this term is replaced with $\mathbf { v }$ . Recall that v in commonly used POVI algorithms is the sum of a possibly smoothed log posterior gradient, which is similar to $\nabla _ { f } \log p ( \mathbf { Y } | \mathbf { X } , f )$ used in MLE training, and the repulsive force (RF) term. Thus our algorithm can be seen as $B P$ with a modified top-layer error signal.
+
+Remark 3.2. (Relation between (3), ensemble training, and weight-space POVI) The widely used ensemble training method (Opitz & Maclin, 1999) obtains n MAP estimates separately via GD. As stated above, our algorithm can be seen as a BP procedure with a modified top-layer error signal, thus it is closely related to ensemble training. The main difference is that our algorithm adds a $R F$ term to the error signal, which pushes the prediction of each particle away from that of others. As an example, consider function-space SVGD with RBF kernels. The function-space $R F$ term is $\begin{array} { r } { \frac { 1 } { n } \sum _ { j } \nabla _ { f _ { \ell } ^ { j } } k ( f _ { \ell } ^ { i } , f _ { \ell } ^ { j } ) \propto \sum _ { j \neq i } ( f _ { \ell } ^ { i } - f _ { \ell } ^ { j } ) k ( f _ { \ell } ^ { i } , f _ { \ell } ^ { j } ) } \end{array}$ (see Appendix $D$ ), which drives $f _ { \ell } ^ { i }$ away from $f _ { \ell } ^ { j }$ . Our algorithm thus enhances ensemble training, in which the predictions of all particles converge to the MAP and could suffer from overfitting.
+
+The relation to ensemble training also exists in weight-space POVI methods (Liu & Wang, 2016). However, the RF in those methods is determined by a weight-space kernel. As discussed in Section 2, commonly used weight-space kernels cannot characterize the distance between model predictions in over-parameterized models like BNNs. In contrary, the function-space RF in our method directly accounts for the difference between model predictions, and is far more efficient. We will present empirical evidence in Section 5.1. Derivations supporting this remark are included in Appendix D.
+
+Remark 3.3. Finally, the update rule (2) corresponds to a gradient flow in a Wasserstein space of measures of functions, while it is not clear if similar results exist for rule (3). As (3) is simple to implement, and has the desirable properties discussed in Remark 3.2, we consider (3) as a reasonable approximation to the exact gradient-flow based algorithm. As we show empirically in Appendix C, it does not impact convergence; a thorough theoretical treatment is left for future work.
+
+# 3.1.2 MINI-BATCH VERSION OF THE PARTICLE UPDATE
+
+One shortcoming of the above procedure is that it still needs to iterate over the whole set $\mathcal { X }$ when calculating the update rule (3), which can be inefficient for large $\mathcal { X }$ . We further improve the efficiency by presenting a mini-batch version, i.e., in each iteration, we draw a mini-batch with $B$ elements, $\mathbf x \sim \mu$ , for an arbitrary distribution $\mu$ supported on $\mathcal { X } ^ { B }$ ; we then replace the update rule (3) with evaluations on $\mathbf { x }$ , i.e.
+
+$$
+\boldsymbol { \theta } _ { \ell + 1 } ^ { i } \gets \boldsymbol { \theta } _ { \ell } ^ { i } - \epsilon _ { \ell } \left( \frac { \partial f ( \mathbf { x } ; \boldsymbol { \theta } _ { \ell } ^ { i } ) } { \partial \boldsymbol { \theta } _ { \ell } ^ { i } } \right) ^ { \top } \mathbf { v } [ f _ { \ell } ^ { i } ( \mathbf { x } ) ] .
+$$
+
+Justification of (4) As above, we have related the full-input-space update rule (3) to (2), a gradient flow (GF) in the Wasserstein space of measures of functions (Liu et al., 2017; Chen et al., 2018; Liu et al., 2018). Similarly, for any fixed $\mathbf { x }$ , the update (4) corresponds to a GF in the same space, denoted as $\partial _ { t } q = - \nabla \cdot \left( \mathbf { v _ { x } } \cdot q _ { t } \right)$ . Simulating (4) with $\mathbf { x }$ sampled from $\mu$ can be seen as a stochastic approximation to simulating the “averaged $G F ^ { \prime \prime }$ , $\partial _ { t } q = - \nabla \cdot \mathbb { E } _ { \mathbf { x } \sim \mu } ( \mathbf { v _ { x } } \cdot q _ { t } )$ . It is known that under certain assumptions, stochastic approximation to GF simulation does not impact convergence3, so it suffices to justify the simulation of the “averaged GF”. For any fixed and finite $\mathbf { x }$ , it is known that the $\operatorname { G F } \partial _ { t } q = - \nabla \cdot \left( \mathbf { v _ { x } } \cdot q _ { t } \right)$ minimizes a geodesically convex energy, denoted as $\mathcal { E } _ { \mathbf { x } } [ q ( f ) ]$ , whose minimizer $q ( f )$ must satisfy $q ( f ( \mathbf { x } ) ) = p ( { \bar { f } } ( \mathbf { x } ) | \mathbf { X } , \mathbf { Y } )$ (see Chen et al. (2018) for definition of $\mathcal { E } _ { \mathbf { x } }$ ). Thus the averaged GF minimizes the averaged energy $\mathbb { E } _ { \mathbf { x } \sim \mu } \mathcal { E } _ { \mathbf { x } } [ q ( f ) ]$ (Ambrosio et al., 2008). We discuss the implication of using $\mathbb { E } _ { \mathbf { x } \sim \mu } \mathcal { E } _ { \mathbf { x } } [ q ( f ) ]$ as the variational objective below.
+
+If the posterior process can be uniquely determined by almost all4 $B$ -dimensional marginals $\{ p ( f ( \mathbf { x } ) | \mathbf { X } , \mathbf { Y } ) : \mathbf { x } \in \operatorname { s u p p } ( { \boldsymbol { \mu } } ) \}$ , it will clearly become the unique minimizer of the averaged energy, and simulation of the averaged gradient flow yields the true posterior. As a concrete example, if the posterior is a Gaussian process, a sufficient condition is to set $B \geq 2$ , and $\mu$ to be the product measure of measures with support $\mathcal { X }$ , and measures with support X.5
+
+Even if not all marginals of the variational posterior $q ( f )$ converge to those of the true posterior, the averaged energy serves as a good variational objective on its own. This is because it measures the average approximation error of the lower-dimensional marginals of the posterior, weighted by $\mu$ ; and in most applications, we are only interested in this quantity. For example, in supervised learning tasks with i.i.d. training and test samples, we need to minimize the average approximation error of posterior predictive mean and variance. In this case, it is sufficient to obtain a good approximation of all two-dimensional marginal distributions, weighted by the input distribution; and we can set the full-support component in $\mu$ to be the kernel density estimation (KDE) of the training set.
+
+We reiterate that the above condition on $\mu$ does not imply $\mu$ must be “uniform” on $\mathcal { X }$ in any sense, or each of its $B$ marginals must be identically distributed.
+
+Computation of (4) To implement (4) we need to compute $\mathbf { v } [ f _ { \ell } ^ { i } ( \mathbf { x } ) ]$ . As shown in Table 1, it requires the specification of a kernel and access to (the gradient of) the log posterior density, both on the $B$ -dimensional space spanned by $f ( \mathbf { x } )$ ; it also requires the specification of $\mu$ . For kernels, any positive definite kernels can be used. In our experiments, we choose the RBF kernel with the median heuristic for bandwidth, as is standard in POVI implementations (Liu & Wang, 2016).
+
+The log posterior gradient consists of the gradient of log prior and that of log likelihood. As in this subsection, we assume $\nabla _ { \mathbf { x } } \log p ( f ( \mathbf { x } ) )$ is known, we only consider the log likelihood. As is standard in large-scale inference, we approximate it using mini-batches, i.e. to approximate it with (a scaled version of) $\log p ( \mathbf { y } _ { b } | \mathbf { x } _ { b } , f _ { \ell } ^ { i } ( \mathbf { x } _ { b } ) )$ , where $\left( \mathbf { x } _ { b } , \mathbf { y } _ { b } \right)$ is a mini-batch of the training set. The requirement to sample $\left( \mathbf { x } _ { b } , \mathbf { y } _ { b } \right)$ is implemented by specifying an appropriate form of $\mu$ : we define $\mu$ in such a way that a sample from $\mu$ consists of $B ^ { \prime } < B$ samples $\mathbf { x } _ { b }$ from the training set, and $B - B ^ { \prime }$ i.i.d. samples from a continuous distribution $\nu$ over $\mathcal { X }$ . This is a valid choice, as stated before. Now we can use the training-set part of samples to compute the log likelihood. Finally, the continuous component $\nu$ can be chosen as the KDE of $\mathbf { X }$ , when the test set is identically distributed as the training set, or incorporate distributional assumptions of the test set otherwise. For example, for unsupervised domain adaptation (Ganin & Lempitsky, 2015), we can use the KDE of the unlabeled test-domain samples.
+
+Summing up, we present a simple yet efficient function-space POVI procedure, as outlined in Algorithm 1. As we will show empirically in Appendix C, our algorithm converges robustly in practice.
+
+# Algorithm 1 Function Space POVI for Bayesian Neural Network
+
+1: Input: (Possibly approximated) function-space prior $p ( f ( \mathbf { x } ) )$ for any finite $\mathbf { x }$ ; training set $( \mathbf { X } , \mathbf { Y } )$ ; a continuous distribution $\nu$ supported on $\mathcal { X }$ (e.g. the KDE of $\mathbf { X }$ ); a choice of $\mathbf { v }$ from Table 1; batch size $B , B ^ { \prime }$ ; and a set of initial particles $\{ \theta _ { 0 } ^ { i } \} _ { i = 1 } ^ { n }$ .
+2: Output: A set of particles $\{ \theta ^ { i } \} _ { i = 1 } ^ { n }$ , such that $f ( \cdot ; \theta ^ { i } )$ approximates the target distribution.
+3: for iteration $\ell$ do
+4: Sample a mini-batch $\mathbf { x } _ { b } , \mathbf { y } _ { b }$ from the training set, and $\tilde { x } _ { 1 \dots B - B ^ { \prime } } \stackrel { i . i . d . } { \sim } \nu$ . Denote $\mathbf { x } = \mathbf { x } _ { b } \cup \{ \tilde { x } _ { i } :$ $i \in [ B - B ^ { \prime } ] \}$ .
+5: For each $i \in [ n ]$ , calculate the function space POVI update $\mathbf { v } [ f _ { \ell } ^ { i } ( \mathbf { x } ) ]$ .
+6: For each $i \in [ n ]$ , calculate $\theta _ { \ell + 1 } ^ { i }$ according to (4).
+7: Set $\ell \gets \ell + 1$ .
+8: end for
+
+# 3.2 GENERAL SCENARIOS
+
+We now relax the assumptions in Section 3.1 to make our setting more practical in real applications.
+Below we address the infinity of $\mathcal { X }$ and the lack of function-space prior gradient in turn.
+
+Infinite Set $\mathcal { X }$ While we assume $\mathcal { X }$ is a finite set to make Section 3.1.1 more easily understood, our algorithm works no matter $\mathcal { X }$ is finite or not: as our algorithm works with mini-batches, when $\mathcal { X }$ is infinite, we can also sample $\mathbf { x }$ from $\mathcal { X }$ and apply the whole procedure.
+
+Function-Space Prior Gradient The function space prior for BNN is implicitly defined, and we do not have access to its exact gradient. While we could in principle utilize gradient estimators for implicit models (Li & Turner, 2018; Shi et al., 2018a), we opt to use a more scalable workaround in implementation, which is to approximate the prior measure with a Gaussian process (GP). More specifically, given input $\mathbf { x }$ , we draw samples $\tilde { \theta } ^ { 1 } , \ldots , \tilde { \theta } ^ { k }$ from $p ( \theta )$ and construct a multivariate normal distribution that matches the first two moments of $\begin{array} { r } { \tilde { p } ( f ( \mathbf { x } ) ) = \frac { 1 } { k } \sum _ { j = 1 } ^ { k } \delta ( f ( \mathbf { x } ) - f ( \mathbf { x } ; \tilde { \theta } ^ { j } ) ) } \end{array}$ . We expect this approximation to be accurate for BNNs, because under assumptions like Gaussian prior on weights, as each layer becomes infinitely wide, the prior measure determined by BNNs will converge to a GP with a composite kernel (de G. Matthews et al., 2018; Garriga-Alonso et al., 2018; Lee et al., 2018; Novak et al., 2019).
+
+A small batch size is needed to reduce the sample size $k$ , as otherwise the covariance estimate in GP will have a high variance. While our procedure works for fairly small $B$ (e.g. $B \geq 2$ for a GP posterior), we choose to use separate batches of samples to estimate the gradient of the log prior and log likelihood. In this way, a much larger batch size could be used for the log likelihood estimate.
+
+# 4 RELATED WORK
+
+Our algorithm addresses the problem of over-parameterization, or equivalently, non-identifiability6. A classical idea addressing non-identifiability is to introduce alternative metrics in the weight space, so that parameters corresponding to similar statistical models are closer under that metric. The typical choice is the Fisher information metric, which has been utilized to improve Markov Chain Monte Carlo methods (Girolami & Calderhead, 2011), variational inference (Zhang et al., 2018a) and gradient descent (Amari, 1997). While such methods explore locally non-identifiable parameter regions more rapidly than their weight-space counterparts (Amari, 2016), they still suffer from global non-identifiability, which frequently occurs in models like Bayesian neural networks. Our work takes one step further: by defining metrics in the function space, we address local and global non-identifiability simultaneously.
+
+Closely related to our work is the variational implicit process (VIP; Ma et al., 2018), which shares the idea of function space inference. VIP addresses inference and model learning simultaneously; however, their inference procedure did not address the challenge of inference in complex models: the inference algorithm in VIP draws $S$ prior functions from $p ( f )$ , and fits a Bayesian linear regression model using these functions as features. As $S$ is limited by the computational budget, such an approximation family will have problem scaling to more complex models. We present comparisons to VIP in Appendix A.2.3.
+
+Approximate inference for BNN is a rich field. Under the VI framework, apart from the implicit VI methods mentioned in Section 1, Louizos & Welling (2017) proposed a hierarchical variational model, which approximates $p ( \boldsymbol { \theta } | \mathbf x , \mathbf y )$ with $\begin{array} { r } { q ( \theta ) = \int q ( \theta | \mathbf { z } ) q ( \mathbf { z } ) \overset { \cdot } { d } \mathbf { z } } \end{array}$ , where z represents layer-wise multiplicative noise, parameterized by normalizing flows. While this approach improves upon plain single-level variational models, its flexibility is limited by a oversimplified choice of $q ( \theta | \mathbf { z } )$ . Such a trade-off between approximation quality and computational efficiency is inevitable for weight-space VI procedures. Another line of work use stochastic gradient Markov Chain Monte Carlo (SGMCMC) for approximate inference (Li et al., 2016; Chen et al., 2014). While SG-MCMC converges to the true posterior asymptotically, within finite time it produces correlated samples, and has been shown to be less particle-efficient than the deterministic POVI procedures (Liu & Wang, 2016; Chen et al., 2018). Finally, there are other computationally efficient approaches to uncertainty estimation, e.g. Monte-Carlo dropout (Gal & Ghahramani, 2016), batch normalization (Hron et al., 2018), and efficient implementations of factorized Gaussian approximation (e.g., Blundell et al., 2015; Zhang et al., 2018a; Khan et al., 2018).
+
+# 5 EVALUATION
+
+In this section, we evaluate our method on a variety of tasks. First, we present a qualitative evaluation on a synthetic regression dataset. We then evaluate the predictive performance on several standard regression and classification datasets. Finally, we assess the uncertainty quality of our method on two tasks: defense against adversarial attacks, and contextual bandits.
+
+We compare with strong baselines. For our method, we only present results implemented with SVGD for brevity (abbreviated as “f-SVGD”); results using other POVI methods are similar, and can be found in Appendix A.1 and A.2.2. Unless otherwise stated, baseline results are directly taken from the original papers, and comparisons are carried out under the same settings.
+
+Code for the experiments will be available at https://github.com/thu-ml/fpovi. The implementation is based on ZhuSuan (Shi et al., 2017).
+
+# 5.1 SYNTHETIC DATA AND THE OVER-PARAMETERIZATION PROBLEM
+
+To evaluate the approximation quality of our method qualitatively, and to demonstrate the curseof-dimensionality problem encountered by weight space POVI methods, we first experiment on a simulated dataset. We follow the simulation setup in Sun et al. (2017): for input, we randomly generate 12 data points from $\mathrm { U n i f o r m } ( 0 , 0 . 6 )$ and 8 from Uniform $( 0 . 8 , 1 )$ . The output $y _ { n }$ for input $x _ { n }$ is modeled as yn $= x _ { n } + \epsilon _ { n } + \mathrm { s i n } ( 4 ( x _ { n } + \epsilon _ { n } ) ) + \mathrm { s i n } ( 1 3 ( x _ { n } + \epsilon _ { n } ) )$ ), where $\epsilon _ { n } \sim \mathcal { N } ( 0 , 0 . 0 0 0 9 )$ . The model is a feed-forward network with 2 hidden layers and ReLU activation; each hidden layer has 50 units. We use 50 particles for weight space SVGD and our method, and use Hamiltonian
+
+
+Figure 1: Approximate posterior obtained by different methods. Dots indicate observations, solid line indicates predicted mean, light shaded area corresponds to the predictive credible interval, and dark shaded area corresponds to the credible interval for mean estimate.
+
+
+Figure 2: Average test RMSE and predictive negative log-likelihood, on UCI regression datasets. Smaller (lower) is better. Best viewed in color.
+
+Monte Carlo (HMC) to approximate the ground truth posterior. We plot $9 5 \%$ credible intervals for prediction and mean estimate, representing epistemic and aleatoric7 uncertainties respectively.
+
+Fig. 1 shows the results. We can see our method provides a reasonable approximation for epistemic uncertainty, roughly consistent with HMC; on the other hand, weight-space POVI methods severely underestimate uncertainty. Furthermore, we found that such pathology exists in all weight-space POVI methods, and amplifies as model complexity increases; eventually, all weight-space methods yield degenerated posteriors concentrating on a single function. We thus conjecture it is caused by the over-parameterization problem in weight space. See Appendix A.1 for related experiments.
+
+# 5.2 PREDICTIVE PERFORMANCE
+
+Following previous work on Bayesian neural networks (e.g. Hernandez-Lobato & Adams, 2015), ´ we evaluate the predictive performance of our method on two sets of real-world datasets: a number of UCI datasets for real-valued regression, and the MNIST dataset for classification.
+
+# 5.2.1 UCI REGRESSION DATASET
+
+On the UCI datasets, our experiment setup is close to Hernandez-Lobato & Adams (2015). The ´ model is a single-layer neural network with ReLU activation and 50 hidden units, except for a larger dataset, Protein, in which we use 100 units. The only difference to Hernandez-Lobato & ´ Adams (2015) is that we impose an inverse-Gamma prior on the observation noise, which is also used in e.g. Shi et al. (2018b) and Liu & Wang (2016). Detailed experiment setup are included in Appendix A.2.1, and full data for our method in Appendix A.2.2.
+
+We compare with the original weight-space Stein variational gradient descent (SVGD), and two strong baselines in BNN inference: kernel implicit variational inference (KIVI, Shi et al., 2018b), and variational dropout with $\alpha$ -divergences (Li & Gal, 2017). The results are summarized in Fig. 2. We can see that our method has superior performance in almost all datasets.
+
+In addition, we compare with another two state-of-the-art methods for BNN inference: multiplicative normalizing flows and Monte-Carlo batch normalization. As the experiment setup is slightly different following (Azizpour et al., 2018), we report the results in Appendix A.2.3. In most cases, our method also compares favorably to these baselines.
+
+Table 2: Test error on the MNIST dataset. Boldface indicates the best result.
+
+
Method
BBB (Gaussian Prior)
BBB (Scale Mixture Prior)
KIVI
f-SVGD
Test Error
1.82%
1.36%
1.29%
1.21%
+
+# 5.2.2 MNIST CLASSIFICATION DATASET
+
+Following previous work such as Blundell et al. (2015), we report results on the MNIST handwriting digit dataset.We use a feed-forward network with two hidden layers, 400 units in each layer, and ReLU activation, and place a standard normal prior on the network weights. We choose this setting so the results are comparable with previous work.
+
+We compare our results with vanilla SGD, Bayes-by-Backprop (Blundell et al. (2015)), and KIVI. For our method, we use a mini-batch size of 100, learning rate of $2 \times 1 0 ^ { - 4 }$ and train for 1,000 epochs. We hold out the last 10,000 examples in training set for model selection. The results are summarized in Table 2. We can see that our method outperform all baselines.
+
+
+Figure 3: Accuracy on adversarial examples.
+
+# 5.3 ROBUSTNESS AGAINST ADVERSARIAL EXAMPLES
+
+Deep networks are vulnerable to adversarial noise, with many efficient algorithms to craft such noise (cf. e.g. Dong et al., 2018), while defending against such noise is till a challenge (e.g. Pang et al., 2018b;a). It is hypothesized that Bayesian models are more robust against adversarial examples due to their ability to handle epistemic uncertainty (Rawat et al., 2017; Smith & Gal, 2018). This hypothesis is supported by Li & Gal (2017), in a relatively easier setup with feed-forward networks on MNIST; to our knowledge, no results are reported using more flexible approximate inference techniques. In this section, we evaluate the robustness of our method on a setting compatible to previous work, as well as a more realistic setting with ResNet-32 on the CIFAR-10 dataset. We briefly introduce the experiment setup here; detailed settings are included in Appendix A.3.
+
+On the MNIST dataset, we follow the setup in Li & Gal (2017), and experiment with a feed-forward network. We use the iterative fast gradient sign method (I-FGSM) to construct targeted white-box attack samples. In each iteration, we limit the $\ell ^ { \infty }$ norm of the perturbation to 0.01 (pixel values are normalized to the range of $[ 0 , 1 ]$ ). We compare our method with vanilla SVGD, and MC Dropout.
+
+On the CIFAR-10 dataset, we use the ResNet-32 architecture (He et al., 2016a). As dropout requires modification of the model architecture, we only compare with the single MAP estimate, and an ensemble model. We use 8 particles for our method and the ensemble baseline. We use the FGSM method to construct white-box untargeted attack samples.
+
+Fig. 3 shows the results for both experiments. We can see our method improves robustness significantly, both when compared to previous approximate BNN models, and baselines in the more realistic setting.
+
+# 5.4 IMPROVED EXPLORATION IN CONTEXTUAL BANDIT
+
+Finally, we evaluate the approximation quality of our method on several contextual bandit problems, Contextual bandit is a standard reinforcement learning problem. It is an arguably harder task than supervised learning for BNN approximation methods, as it requires the agent to balance between exploitation and exploration, and decisions based on poorly estimated uncertainty will lead to catastrophic performance through a feedback loop (Riquelme et al., 2018). Problem background and experiment details are presented in Appendix A.4.
+
+We consider the Thompson sampling algorithm with Bayesian neural networks. We use a feedforward network with 2 hidden layers and 100 ReLU units in each layer. Baselines include other approximate inference methods including Bayes-by-Backprop and vanilla SVGD, as well as other uncertainty estimation procedures including Gaussian process and frequentist bootstrap. We use the mushroom and wheel bandits from Riquelme et al. (2018).
+
+The cumulative regret is summarized in Table 3. We can see that our method provides competitive performance compared to the baselines, and outperforming all baselines by a large margin in the wheel bandit, in which high-quality uncertainty estimate is especially needed.
+
+Table 3: Cumulative regret in different bandits. Results are averaged over 10 trials.
+
+
BBB
GP
Bootstrap
f-SVGD
Mushroom
19.15 ± 5.98
16.75 ± 1.63
2.71 ± 0.22
4.39 ± 0.39
Wheel
55.77 ± 8.29
60.80 ± 4.40
42.16 ± 7.80
7.54 ± 0.41
+
+# 6 CONCLUSION
+
+We present a flexible approximate inference method for Bayesian regression models, building upon particle-optimization based variational inference procedures. The newly proposed method performs POVI on function spaces, which is scalable and easy to implement and overcomes the degeneracy problem in direct applications of POVI procedures. Extensive experiments demonstrate the effectiveness of our proposal.
+
+# ACKNOWLEDGEMENTS
+
+The work was supported by the National NSF of China (Nos. 61621136008, 61620106010), the National Key Research and Development Program of China (No. 2017YFA0700900), Beijing Natural Science Foundation (No. L172037), Tsinghua Tiangong Institute for Intelligent Computing, the NVIDIA NVAIL Program, a project from Siemens, and a project from NEC.
+
+# REFERENCES
+
+Shun-ichi Amari. Neural learning in structured parameter spaces-natural riemannian gradient. In Advances in neural information processing systems, pp. 127–133, 1997.
+
+Shun-ichi Amari. Information geometry and its applications. Springer, 2016.
+
+Luigi Ambrosio, Nicola Gigli, and Giuseppe Savare.´ Gradient flows: in metric spaces and in the space of probability measures. Springer Science & Business Media, 2008.
+
+Hossein Azizpour, Mattias Teye, and Kevin Smith. Bayesian uncertainty estimation for batch normalized deep networks. In International Conference on Machine Learning (ICML), 2018.
+
+Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pp. 1613–1622, 2015.
+
+Silvere Bonnabel et al. Stochastic gradient descent on riemannian manifolds. IEEE Trans. Automat. Contr., 58(9):2217–2229, 2013.
+
+Olivier Chapelle and Lihong Li. An empirical evaluation of thompson sampling. In Advances in neural information processing systems, pp. 2249–2257, 2011.
+
+Changyou Chen, Ruiyi Zhang, Wenlin Wang, Bai Li, and Liqun Chen. A unified particleoptimization framework for scalable bayesian sampling. arXiv preprint arXiv:1805.11659, 2018.
+
+Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. In International Conference on Machine Learning, pp. 1683–1691, 2014.
+
+Kurt Cutajar, Edwin V Bonilla, Pietro Michiardi, and Maurizio Filippone. Random feature expansions for deep gaussian processes. arXiv preprint arXiv:1610.04386, 2016.
+
+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, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1-nGgWC-.
+
+Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9185–9193, 2018.
+
+Di Feng, Lars Rosenbaum, and Klaus Dietmayer. Towards safe autonomous driving: Capture uncertainty in the deep neural network for lidar 3d vehicle detection. arXiv preprint arXiv:1804.05132, 2018.
+
+Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059, 2016.
+
+Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1180–1189, Lille, France, 07–09 Jul 2015. PMLR.
+
+Adria Garriga-Alonso, Laurence Aitchison, and Carl Edward Rasmussen. Deep convolutional net- \` works as shallow gaussian processes. arXiv preprint arXiv:1808.05587, 2018.
+
+Soumya Ghosh, Jiayu Yao, and Finale Doshi-Velez. Structured variational learning of Bayesian neural networks with horseshoe priors. 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. 1744–1753, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/ghosh18a.html.
+
+Mark Girolami and Ben Calderhead. Riemann manifold langevin and hamiltonian monte carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 73(2): 123–214, 2011.
+
+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, 2016a.
+
+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, 2016b.
+
+Jose Miguel Hern ´ andez-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learn- ´ ing of bayesian neural networks. In International Conference on Machine Learning, pp. 1861– 1869, 2015.
+
+Jiri Hron, Alex Matthews, and Zoubin Ghahramani. Variational Bayesian dropout: pitfalls and fixes. 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. 2019–2028, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http: //proceedings.mlr.press/v80/hron18a.html.
+
+Mohammad Emtiyaz Khan, Didrik Nielsen, Voot Tangkaratt, Wu Lin, Yarin Gal, and Akash Srivastava. Fast and scalable bayesian deep learning by weight-perturbation in adam. arXiv preprint arXiv:1806.04854, 2018.
+
+Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ B1EA-M-0Z.
+
+Chunyuan Li, Changyou Chen, David E Carlson, and Lawrence Carin. Preconditioned stochastic gradient langevin dynamics for deep neural networks. In AAAI, 2016.
+
+Yingzhen Li and Yarin Gal. Dropout inference in bayesian neural networks with alpha-divergences. arXiv preprint arXiv:1703.02914, 2017.
+
+Yingzhen Li and Richard E. Turner. Gradient estimators for implicit models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=SJi9WOeRb.
+
+Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
+
+Chang Liu, Jingwei Zhuo, Pengyu Cheng, Ruiyi Zhang, Jun Zhu, and Lawrence Carin. Accelerated first-order methods on the wasserstein space for bayesian inference. arXiv preprint arXiv:1807.01750, 2018.
+
+Qiang Liu. Stein variational gradient descent as gradient flow. In Advances in Neural Information Processing Systems 30, pp. 3115–3123. 2017.
+
+Qiang Liu and Dilin Wang. Stein variational gradient descent: A general purpose bayesian inference algorithm. In Advances in Neural Information Processing Systems 29, pp. 2378–2386. 2016.
+
+Yang Liu, Prajit Ramachandran, Qiang Liu, and Jian Peng. Stein variational policy gradient. arXiv preprint arXiv:1704.02399, 2017.
+
+Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix gaussian posteriors. In International Conference on Machine Learning, pp. 1708–1716, 2016.
+
+Christos Louizos and Max Welling. Multiplicative normalizing flows for variational bayesian neural networks. In International Conference on Machine Learning, pp. 2218–2227, 2017.
+
+Chao Ma, Yingzhen Li, and Jose Miguel Hern ´ andez-Lobato. Variational implicit processes. ´ arXiv preprint arXiv:1806.02390, 2018.
+
+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.
+
+Roman Novak, Lechao Xiao, Yasaman Bahri, Jaehoon Lee, Greg Yang, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ B1g30j0qF7.
+
+Jerzy Ombach and Dawid Tarłowski. Nonautonomous stochastic search in global optimization. Journal of Nonlinear Science, 22(2):169–185, Apr 2012. ISSN 1432-1467. doi: 10.1007/ s00332-011-9112-3. URL https://doi.org/10.1007/s00332-011-9112-3.
+
+David Opitz and Richard Maclin. Popular ensemble methods: An empirical study. Journal of artificial intelligence research, 11:169–198, 1999.
+
+Tianyu Pang, Chao Du, Yinpeng Dong, and Jun Zhu. Towards robust detection of adversarial examples. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 4584–4594. Curran Associates, Inc., 2018a.
+
+Tianyu Pang, Chao Du, and Jun Zhu. Max-Mahalanobis linear discriminant analysis networks. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4016–4025, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018b. PMLR. URL http://proceedings. mlr.press/v80/pang18a/pang18a.pdf.
+
+Carl Edward Rasmussen. Gaussian processes in machine learning. In Advanced lectures on machine learning, pp. 63–71. Springer, 2004.
+
+A. Rawat, M. Wistuba, and M.-I. Nicolae. Adversarial Phenomenon in the Eyes of Bayesian Deep Learning. ArXiv e-prints, November 2017.
+
+Carlos Riquelme, George Tucker, and Jasper Snoek. Deep bayesian bandits showdown: An empirical comparison of bayesian deep networks for thompson sampling. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SyYe6k-CW.
+
+Jeff Schlimmer. Mushroom records drawn from the audubon society field guide to north american mushrooms. GH Lincoff (Pres), New York, 1981.
+
+Jiaxin Shi, Jianfei. Chen, Jun Zhu, Shengyang Sun, Yucen Luo, Yihong Gu, and Yuhao Zhou. ZhuSuan: A library for Bayesian deep learning. arXiv preprint arXiv:1709.05870, 2017.
+
+Jiaxin Shi, Shengyang Sun, and Jun Zhu. A spectral approach to gradient estimation for implicit distributions. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, pp. 4644–4653, 2018a.
+
+Jiaxin Shi, Shengyang Sun, and Jun Zhu. Kernel implicit variational inference. In International Conference on Learning Representations, 2018b. URL https://openreview.net/forum? id $=$ r1l4eQW0Z.
+
+Lewis Smith and Yarin Gal. Understanding measures of uncertainty for adversarial example detection. arXiv preprint arXiv:1803.08533, 2018.
+
+Shengyang Sun, Changyou Chen, and Lawrence Carin. Learning structured weight uncertainty in bayesian neural networks. In Artificial Intelligence and Statistics, pp. 1283–1292, 2017.
+
+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.
+
+Brian Trippe and Richard Turner. Overpruning in variational bayesian neural networks. arXiv preprint arXiv:1801.06230, 2018.
+
+Nilesh Tripuraneni, Nicolas Flammarion, Francis Bach, and Michael I. Jordan. Averaging stochastic gradient descent on Riemannian manifolds. In Sebastien Bubeck, Vianney Perchet, and Philippe ´ Rigollet (eds.), Proceedings of the 31st Conference On Learning Theory, volume 75 of Proceedings of Machine Learning Research, pp. 650–687. PMLR, 06–09 Jul 2018.
+
+Dilin Wang, Zhe Zeng, and Qiang Liu. Stein variational message passing for continuous graphical models. 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. 5219–5227, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/wang18l.html.
+
+Guodong Zhang, Shengyang Sun, David Duvenaud, and Roger Grosse. Noisy natural gradient as variational inference. 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. 5852–5861, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018a. PMLR. URL http://proceedings.mlr.press/v80/zhang18l.html.
+
+Ruiyi Zhang, Chunyuan Li, Changyou Chen, and Lawrence Carin. Learning structural weight uncertainty for sequential decision-making. In International Conference on Artificial Intelligence and Statistics, pp. 1137–1146, 2018b.
+
+Jingwei Zhuo, Chang Liu, Jiaxin Shi, Jun Zhu, Ning Chen, and Bo Zhang. Message passing stein variational gradient descent. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, pp. 6018–6027, 2018.
+
+# A EXPERIMENT DETAILS AND ADDITIONAL RESULTS
+
+# A.1 SYNTHETIC DATA
+
+Comparison with Other POVI Methods We present posterior approximations obtained by weight-space and function-space versions of other POVI methods. The simulation setup is the same as in Section 5.1. As shown in Figure 4, function-space methods provide improvement in all cases, avoid the degenerate behavior of weight-space methods.
+
+Experiments with Increasing Model Complexity To obtain a better understanding of the degenerate behavior of weight-space POVI methods, we repeat the experiment with increasingly complex models. Specifically, we repeat the experiment while varying the number of hidden units in each layer from 5 to 100. Other settings are the same as Section 5.1. The posteriors are shown in Figure 5. We can see that weight space methods provide accurate posterior estimates when the number of weights is small, and degenerate gradually as model complexity increases, eventually all particles collapse into a single function. On the contrary, function space methods produce stable approximations all the time.
+
+
+Figure 4: Posterior approximations obtained by weight space (up) and function space (down) variants of other POVI methods.
+
+
+Figure 5: Posterior approximations on increasingly complex models. $L$ denotes the number of hidden units in each layer. We can see a clear trend of degeneration for weight-space method.
+
+# A.2 UCI DATASETS
+
+# A.2.1 EXPERIMENT DETAILS IN 5.2.1
+
+For our method in all datasets, we use the AdaM optimizer with a learning rate of 0.004. For datasets with fewer than 1000 samples, we use a batch size of 100 and train for 500 epochs. For the larger datasets, we set the batch size to 1000, and train for 1000 epochs. We use a 90-10 random traintest split, repeated for 20 times, except for Protein in which we use 5 replicas. For our method and weight-space POVI methods, we use 20 particles. We use the RBF kernel, with the bandwidth chosen by the median trick (Liu & Wang, 2016).
+
+For our method, we approximate the function-space prior with GP, and separate the mini-batch used for prior gradient and other parts in v, as discussed in the main text. We construct the multivariate normal prior approximation with 40 draws and a batch size of 4.
+
+# A.2.2 FULL RESULTS WITH DIFFERENT POVI PROCEDURES
+
+In this section, we provide full results on UCI datasets, using weight-space and function-space versions of different POVI procedures. The experiment setup is the same as Section 5.2.1. The predictive RMSE and NLL are presented in Table 4 and 5, respectively. We can see that for all POVI methods, function space variants provide substantial improvement over their weight-space counterparts.
+
+Table 4: Average test RMSE on UCI datasets. Bold indicates statistically significant best results $( p < 0 . 0 5$ with t-test).
+
+
Dataset
Weight Space
Function Space (Ours)
SVGD
W-SGLD
pi-SGLD
SVGD
W-SGLD
pi-SGLD
Boston
2.96±0.10
2.84±0.15
2.84±0.15
2.61±0.12
2.62±0.12
2.62±0.12
Concrete
5.32 ±0.10
5.51 ± 0.10
5.49 ±0.10
4.73 ± 0.13
4.78 ± 0.14
4.77 ±0.13
Kin8nm
0.09 ±0.00
0.07 ±0.00
0.07 ±0.00
0.07 ± 0.00
0.07±0.00
0.07±0.00
Naval
0.00±0.00
0.00 ± 0.00
0.00±0.00
0.00 ±0.00
0.00±0.00
0.00 ±0.00
Power
3.94±0.03
3.97±0.03
3.97±0.03
3.80 ±0.03
3.83 ±0.03
3.83±0.03
Protein
4.61 ± 0.01
4.40 ±0.02
4.40 ±0.02
3.96 ±0.03
4.02 ±0.03
4.02 ±0.03
Winered
0.61 ± 0.01
0.63 ±0.01
0.63 ±0.01
0.61 ± 0.01
0.61 ±0.01
0.61±0.01
Yacht
0.86 ±0.05
0.95 ±0.07
0.93±0.07
0.63 ±0.06
0.63 ± 0.06
0.63 ±0.06
+
+Table 5: Average test NLL on UCI datasets. Bold indicates best results.
+
+
Dataset
WeightSpace
Function Space (Ours)
SVGD
W-SGLD
pi-SGLD
SVGD
W-SGLD
pi-SGLD
Boston
2.50±0.03
2.52±0.07
2.52 ± 0.07
2.47±0.08
2.52±0.09
2.51±0.08
Concrete
3.08±0.02
3.15 ±0.03
3.15 ±0.03
2.96 ± 0.04
3.02±0.04
3.01 ± 0.04
Kin8nm
-0.98 ± 0.01
-1.20 ± 0.01
-1.20 ± 0.01
-1.24 ±0.00
-1.25 ± 0.00
-1.25 ± 0.00
Naval
-4.09 ±0.01
-6.33±0.02
-6.39 ±0.02
-5.92 ±0.03
-6.43±0.04
-6.45 ± 0.05
Power
2.79 ±0.01
2.80 ±0.01
2.80 ±0.01
2.76 ± 0.01
2.76 ±0.01
2.76 ± 0.01
Protein
2.95±0.00
2.90 ±0.00
2.90 ±0.00
2.79 ± 0.01
2.81 ± 0.01
2.81 ± 0.01
Winered
0.93 ± 0.01
0.97 ± 0.01
0.97 ± 0.01
0.92 ±0.02
0.93 ±0.02
0.94 ±0.02
Yacht
1.23 ± 0.04
1.39 ± 0.07
1.37 ± 0.07
1.01 ± 0.06
0.99 ±0.06
1.00 ±0.06
+
+# A.2.3 COMPARISON WITH OTHER METHODS
+
+In this section, we provide comparison to a few other strong baselines in BNN inference.
+
+MNF and MCBN We first present comparisons with multiplicative normalizing flow (MNF; Louizos & Welling, 2017) and Monte-Carlo batch normalization (MCBN; Azizpour et al., 2018). We make the experiment setups consistent with Azizpour et al. (2018), and cite the baseline results from their work. The model is a BNN with 2 hidden layer, each with 50 units for the smaller datasets, and 100 for the protein dataset. We use $1 0 \%$ data for test, and hold out an additional fraction of $1 0 \%$ data to determine the optimal number of epochs. The hyperparameters and optimization scheme for our model is the same as in Section 5.2.1. The results are presented in Table 6. We can see that in most cases, our algorithm performs better than the baselines.
+
+VIP We present comparison to the variational implicit process (VIP; Ma et al., 2018). We follow the experiment setup in their work, and cite results from it. The model is a BNN with 2 hidden layer, each with 10 units. For our method, we follow the setup in Section 5.2.1. We note that this is not entirely a fair comparison, as the method in Ma et al. (2018) also enables model hyper-parameter learning, while for our method we keep the hyper-parameters fixed. However, as shown in Table 7, our method still compares even or favorably to them, outperforming them in NLL in 5 out of 9 datasets. This supports our hypothesis in Section 4 that the linear combination posterior used in Ma et al. (2018) limits their flexibility.
+
+Table 6: Average test RMSE and NLL following the setup of Azizpour et al. (2018). Bold indicates best results.
+
+
Dataset
TestRMSE
Test NLL
MCBN
MNF
f-SVGD
MCBN
MNF
f-SVGD
Boston
2.75±0.05
2.98±0.06
2.95±0.08
2.38±0.02
2.51±0.06
2.57±0.07
Concrete
4.78±0.09
6.57 ±0.04
5.03 ±0.10
3.45± 0.11
3.35 ±0.04
3.16 ±0.05
Kin8nm
0.07±0.00
0.09 ±0.00
0.06 ±0.00
-1.21 ± 0.01
-1.04 ± 0.00
-1.33 ± 0.00
Power
3.74 ±0.01
4.19 ± 0.01
3.50 ± 0.01
2.75±0.00
2.86 ±0.01
2.67 ±0.00
Protein
3.66 ±0.01
4.10 ±0.01
3.36 ±0.03
2.73 ±0.00
2.83±0.01
2.56 ±0.01
Winered
0.62±0.00
0.61 ±0.00
0.63± 0.01
0.95 ± 0.01
0.93 ±0.00
0.98 ±0.01
Yacht
1.23 ±0.05
2.13±0.05
0.85 ±0.06
1.39 ±0.03
1.96 ± 0.05
1.03 ±0.03
+
+Table 7: Average test RMSE and NLL on UCI datasets, following the setup in Ma et al. (2018). Bold indicates best results.
+
+
NLL
RMSE
VIP-BNN
f-SVGD
VIP-BNN
f-SVGD
Boston
2.45± 0.04
2.33±0.05
2.88±0.14
2.58±0.12
Concrete
3.02 ±0.02
2.93±0.02
4.81 ± 0.13
4.63±0.12
Energy
0.60 ±0.03
0.69 ±0.03
0.45 ±0.01
0.43 ±0.01
Kin8nm
-1.12 ± 0.01
-1.11 ± 0.01
0.07 ±0.00
0.07±0.00
Power
2.92 ±0.00
2.76±0.00
4.11 ± 0.05
3.78±0.02
Protein
2.87 ±0.00
2.85 ±0.00
4.25 ±0.07
3.95 ± 0.02
Winered
0.97 ±0.02
0.89 ±0.01
0.64 ± 0.01
0.61 ±0.01
Yacht
-0.02±0.07
1.17 ± 0.01
0.32 ±0.06
0.67 ±0.07
Naval
-5.62 ±0.04
-5.41 ±0.10
0.00±0.00
0.00±0.00
+
+# A.2.4 FURTHER EXPERIMENTS
+
+As suggested by the reviewers, we add further experiments to evaluate our method.
+
+Convergence Properties of Our Method We demonstrate the stability of our procedure, by presenting the negative log-likelihood on held-out data during a typical run. The experiment setup follows (Azizpour et al., 2018), and the result is plotted in Figure 6. As shown in the figure, the training process of our procedure is fairly stable.
+
+Benchmark on a Narrow Architecture To balance our discussion on weight-space POVI methods, we present a benchmark on a narrower BNN model. More specifically, we use the experiment setup in (Ma et al., 2018), which uses 10 hidden units in each layer. Other settings are summarized in the previous subsection. We compare f-SVGD with SVGD, and include the results for mean-field VI and MC dropout with $\alpha$ -divergence in (Ma et al., 2018) for reference. The results are presented in Table 8. We can see that weight-space POVI is a strong baseline under priors with simpler architectures. However, as the issue of over-parameterization still presents, the function-space method still outperform it by a significant margin.
+
+Table 8: Comparison with other baselines under a narrower network prior on some UCI datasets. boldface indicates best results.
+
+
NLL
RMSE
MFVI
alpha-dropout
SVGD
f-SVGD
MFVI
alpha-dropout
SVGD
f-SVGD
Boston
2.76 (0.04)
2.45 (0.02)
2.42 (0.07)
2.33 (0.05)
3.85 (0.22)
3.06 (0.09)
2.77 (0.20)
2.58 (0.12)
Kin8mn
-0.81 (0.01)
-0.92 (0.02)
-1.11 (0.01)
-1.11 (0.00)
0.10 (0.00)
0.10 (0.00)
0.08 (0.00)
0.08 (0.00)
Power
2.83 (0.01)
2.81 (0.00)
2.79 (0.01)
2.76 (0.00)
4.11 (0.04)
4.08 (0.00)
3.95 (0.02)
3.78 (0.02)
Protein
3.00 (0.00)
2.90 (0.00)
2.87 (0.00)
2.85 (0.00)
4.88 (0.04)
4.46 (0.00)
4.29 (0.02)
3.95 (0.02)
+
+
+Figure 6: Heldout NLL as a function of training time (in epochs) during a sample run on the Concrete dataset.
+
+# A.3 ADVERSARIAL EXAMPLES
+
+MNIST Experiment Details We follow the setup in Li & Gal (2017). We use a feed-forward network with ReLU activation and 3 hidden layers, each with 1000 units. For both SVGD and fSVGD, we use the AdaM optimizer with learning rate $5 \times 1 0 ^ { - 4 }$ ; we use a batch size of 1000 and train for 1000 epochs. The attack method is the targeted iterated FGSM with $\ell ^ { \infty }$ norm constraint, i.e. for $t = 1 , \dots , T$ , set
+
+$$
+\begin{array} { r } { \boldsymbol { x } _ { a d v } ^ { ( t ) } : = \boldsymbol { x } _ { a d v } ^ { ( t - 1 ) } + \epsilon \cdot \mathrm { s g n } ( \nabla \log \mathbb { E } _ { q ( f ) } [ p ( \boldsymbol { y } = 0 | \boldsymbol { x } _ { a d v } ^ { ( t - 1 ) } , f ) ] ) , } \end{array}
+$$
+
+$\epsilon = 0 . 0 1$ $x _ { a d v } ^ { ( 0 ) }$ $\ " { 0 } ^ { \ast }$
+
+For our method and weight-space SVGD, we use 20 particles, and scale the output logits to have a prior variance of 10. We use an additional 40 particles to generate 8-dimensional prior samples.
+
+A few notes on applying our method to classification problems: it is important to use the normalized logits as $f$ , so that the model is fully identified; also as for classification problems, $f ( x )$ is already high-dimensional for a single data point $x$ , one should down-sample $f ( x )$ within each $x$ . We choose to always include the true label in the down-sampled version, for labeled samples, and share negative labels across different $x$ .
+
+Test accuracy and log likelihood on clean samples are reported in Table 9.
+
+Table 9: MNIST: Test accuracy and NLL on clean samples
+
+
MC-dropout
SVGD
f-SVGD
accuracy
0.983
0.970
0.984
average NLL
0.075
0.109
0.065
+
+CIFAR Experiment Details We use the ResNet-32 architecture, defined in He et al. (2016b), and uses the same training scheme. We use 8 particles for our method and the ensemble method. For our method, we use 32 particles to generate 6-dimensional prior samples.
+
+The ResNet architecture consists of batch normalization layers, which needs to be computed with the full batch of input. We approximate it with a down-sampled batch, so that more prior samples can be produced more efficiently. In our implementation, we down-sample the input batch to $1 / 4$ of its original size.
+
+The test accuracy and log likelihood on clean samples are reported in Table 10. Our method outperforms the single point estimate, but is slightly worse than the ensemble prediction. Performance
+
+drop on clean samples is common that models obtained by adversarially robust methods (cf. e.g.
+Liao et al., 2017).
+
+Table 10: CIFAR-10: Test accuracy and NLL on clean samples
+
+
single
ensemble
f-SVGD
accuracy
0.925
0.937
0.934
average NLL
0.376
0.203
0.218
+
+# A.4 CONTEXTUAL BANDIT
+
+Contextual bandit is a classical online learning problem. The problem setup is as follows: for each time $t = 1 , 2 , \cdots , N$ , a context $s _ { t } \in S$ is provided to the online learner, where $s$ denotes the given context set. The online learner need to choose one of the $K$ available actions $I _ { t } \in \{ 1 , 2 , \cdots , K \}$ based on context $s _ { t }$ , and get a (stochastic) reward $\ell _ { I _ { t } , t }$ . The goal of the online learner is to minimize the pseudo-regret
+
+$$
+\overline { { R } } _ { n } ^ { S } = \operatorname* { m a x } _ { \substack { g : S \to \{ 1 , 2 , \cdots , K \} } } \mathbb { E } \left[ \sum _ { t = 1 } ^ { n } \ell _ { g ( s _ { t } ) , t } - \sum _ { t = 1 } ^ { n } \ell _ { I _ { t } , t } \right] .
+$$
+
+where $g$ denotes the mapping from context set $s$ to available actions $\{ 1 , 2 , \cdots , K \}$ . Pseudo-regret measures the regret of not following the best $g$ , thus pseudo-regret is non-negative, and minimize the pseudo-regret is equal to find such the best $g$ .
+
+For contextual bandits with non-adversarial rewards, Thompson sampling (a.k.a. posterior sampling; Thompson, 1933) is a classical algorithm that achieves state-of-the-art performance in practice (Chapelle & Li, 2011). Denote the underlying ground-truth reward distribution of context $s$ and action $I _ { t }$ as $\nu _ { s , I _ { t } }$ . In Thompson sampling, we place a prior $\mu _ { s , i , 0 }$ on reward for context $s$ and action $i$ , and maintain $\mu _ { s , i , t }$ , the corresponding posterior distribution at time $t$ . For each time $t = 1 , 2 , \ldots , N$ , Thompson sampling selects action by
+
+$$
+I _ { t } \in \underset { i = \{ 1 , 2 , \cdots , K \} } { \arg \operatorname* { m a x } } \hat { \ell } _ { i , t } , \hat { \ell } _ { i , t } \sim \mu _ { s , i , t } .
+$$
+
+The corresponding posterior is then updated with the observed reward $\ell _ { I _ { t } , t }$ . The whole procedure of Thompson sampling is shown in Algorithm 2.
+
+# Algorithm 2 Thompson Sampling
+
+Input: Prior distribution $\mu _ { s , i , 0 }$ , time horizon $N$
+for time $t = 1 , 2 , \cdots , N$ do Observe context $s _ { t } \in S$ Sample ˆ\`i,t ∼ µs,i,t. Select $I _ { t } \in \arg \operatorname* { m a x } _ { i = \{ 1 , 2 , \cdots , K \} } \hat { \ell _ { i , t } }$ and get $\ell _ { I _ { t } , t }$ Update the posterior of $\mu _ { s _ { t } , I _ { t } , t + 1 }$ with $\ell _ { I _ { t } , t }$ .
+end for
+
+Notice that contextual bandit problems always face the exploration-exploitation dilemma. Exploration should be appropriate, otherwise, we can either exploit too much sub-optimal actions or explore too much meaningless actions. Thompson sampling addresses this issue by each time selecting the actions greedy with the sampled rewards, which is equal to selecting action $i$ with the probability that $i$ can get the highest reward under context $s _ { t }$ . This procedure need an accurate posterior uncertainty. Either over-estimate or under-estimate the posterior uncertainty can lead to the failure of balancing exploration and exploitation, which further lead to the failure of Thompson sampling.
+
+Here, we focus on two benchmark contextual bandit problems, called mushroom and wheel.
+
+Mushroom Bandit In mushroom, we use the data from mushroom dataset (Schlimmer, 1981), which contains 22 attributes per mushroom and two classes: poisonous and safe. Eating a safe mushroom provides reward $+ 5$ . Eating a poisonous mushroom delivers reward $+ 5$ with probability 1/2 and reward -35 otherwise. If the agent does not eat a mushroom, then the reward is 0. We run 50000 rounds in this problem.
+
+
+Figure 7: Visualization of the wheel bandit, taken from (Riquelme et al., 2018). Best viewed in color.
+
+Wheel Bandit Wheel bandit is a synthetic problem that highlights the need for exploration. Let $\delta \in ( 0 , 1 )$ be an “exploration parameter”. Context $X$ is sampled uniformly at random in the unit circle in ${ \dot { \mathbb { R } } } ^ { 2 }$ . There are $k = 5$ possible actions: the first action results in a constant reward $\ell _ { 1 } \sim$ $\mathcal { N } ( \mu _ { 1 } , \sigma ^ { 2 } )$ ; the reward corresponding to other actions is determined by $X$ :
+
+• For contexts inside the blue circle in Figure 7, i.e. for $X$ s.t. $\| X \| \leq \delta$ , the other four actions all result in a suboptimal reward $\bar { \mathcal { N } } ( \mu _ { 2 } , \sigma ^ { 2 } )$ for $\mu _ { 2 } < \mu _ { 1 }$ .
+• Otherwise, one of the four contexts becomes optimal depend on the quarter $X$ is in. The optimal action results in a reward of $\mathcal { N } ( \mu _ { 3 } , \sigma ^ { 2 } )$ for $\mu _ { 3 } \gg \mu _ { 1 }$ , and other actions still have the reward $\mathcal { N } ( \mu _ { 2 } , \sigma ^ { 2 } )$ .
+
+As the probability that $X$ corresponds to a high reward is $1 - \delta ^ { 2 }$ , the need for exploration increases as $\delta$ increases, and it is expected that algorithm with poorly calibrated uncertainty will stuck in choosing the suboptimal action $a _ { 1 }$ in these regions. Such a hypothesis is confirmed in (Riquelme et al., 2018), making this bandit a particularly challenging problem. In our experiments, we use 50000 contexts, and set $\delta = 0 . 9 5$ .
+
+Experiment Setup The model for neural networks is a feed-forward network with 2 hidden layers, each with 100 units. The hyper-parameters for all models are tuned on the mushroom bandit, and kept the same for the wheel bandit. For the baselines, we use the hyper-parameters provided in (Riquelme et al., 2018). The main difference from (Riquelme et al., 2018) is that we use 20 replicas for bootstrap. For our method, we also use 20 particles.
+
+# B ON ALTERNATIVE KERNELS FOR WEIGHT-SPACE POVI
+
+Many POVI methods use a kernel to make the gradient flow well-defined for discrete distributions. A natural question is whether we could design the kernel carefully to alleviate the problem of overparameterization and high dimensionality. This idea is tempting: intuitively, for most POVI methods listed in Table 1, the kernel defines a repulsive force term, which push a particle away from its “most similar” neighbors. A better choice of the kernel makes the similarity measure more sensible. In this section, we will list candidates for such a kernel, and show that they do not work in general.
+
+
+Figure 8: Posterior approximations with weight-space SVGD and alternative kernels. k f corresponds to the function-value kernel, and $\mathtt { k \_ a }$ the activation kernel. We include the results for f-SVGD and HMC for reference.
+
+Table 11: Test NLL on UCI datasets for SVGD with alternative kernels.
+
+
Weight-Space SVGD
Function-Space SVGD
RBF
ka
kf
Boston
2.50 ± 0.03
2.50± 0.07
2.49±0.06
2.47± 0.08
Yacht
1.23 ± 0.04
1.35 ± 0.06
1.20 ± 0.07
1.01 ± 0.06
Concrete
3.08 ±0.02
3.12 ± 0.03
3.11 ± 0.03
2.96 ± 0.04
+
+Evaluation Setup For kernels considered in this section, we evaluate their empirical performance on the synthetic dataset and the UCI regression datasets, following the same setup as in the main text. We test on two POVI methods: SVGD and w-SGLD. As results are similar, we only report the results for SVGD for brevity. The results are presented in Figure 8 and Table 11.
+
+The “Function Value” Kernel Similar to our proposed method, one could define a weight-space kernel on function values, so it directly measures the difference of regression functions; i.e.
+
+$$
+k _ { f } ( \theta ^ { ( 1 ) } , \theta ^ { ( 2 ) } ) : = \mathbb { E } _ { \mathbf { x } \sim \mu } [ k ( f ( \mathbf { x } ; \theta ^ { ( 1 ) } ) , f ( \mathbf { x } ; \theta ^ { ( 2 ) } ) ) ] ,
+$$
+
+where $k$ is an ordinary kernel on $\mathbb { R } ^ { B }$ (e.g. the RBF kernel), $\mathbf { x } \in \mathcal { X } ^ { B }$ , and $\mu$ is an arbitrary measure supported on $\mathcal { X } ^ { B }$ . We first remark that $k _ { f }$ is not positive definite (p.d.) due to over-parameterization, and there is no guarantee that weight-space inference with $k _ { f }$ will converge to the true posterior in the asymptotic limit8. Furthermore, it does not improve over the RBF kernel empirically: predictive performance does not improve, and it drastically overestimates the epistemic uncertainty on the
+
+To understand the failure of this kernel, take SVGD as an example: the update rule $\theta _ { \ell + 1 } ^ { ( i ) } \theta _ { \ell } ^ { ( i ) } -$ $\epsilon _ { \ell } { \mathbf { v } } ( \theta _ { \ell } ^ { ( i ) } )$ is defined with
+
+$$
+- \mathbf { v } \big ( \theta ^ { ( i ) } \big ) = \frac { 1 } { n } \sum _ { j = 1 } ^ { n } \left( \underbrace { \mathbf { K } _ { i j } \nabla _ { \theta ^ { ( j ) } } \log p \big ( \theta ^ { ( j ) } | \mathbf { x } \big ) } _ { \mathrm { g r a d } _ { i j } } + \underbrace { \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { i j } } _ { \mathrm { r f } _ { i j } } \right) .
+$$
+
+Finite-sample SVGD is usually understood as follows (Liu & Wang, 2016): the first term follows a smoothed gradient direction, which pushes the particles towards high-probability region in posterior;
+
+the second term acts as a repulsive force, which prevents particles from collapse together. However, for inference with non positive definite kernels such as $k _ { f }$ , it is less clear if these terms still play the same role:
+
+1. When there are particles corresponding to the same regression function, their gradient for log posterior will be averaged in grad. This is clearly undesirable, as these particles can be distant to each other in the weight space, so their gradient contains little learning signal for each other.
+
+2. While for stationary kernels, the repulsive force
+
+$$
+\mathrm { r f } _ { i j } = \frac { 1 } { n } \sum _ { j } \nabla _ { \theta ^ { ( j ) } } \mathbf { K } _ { i j } = - \frac { 1 } { n } \sum _ { j } \nabla _ { \theta ^ { ( i ) } } \mathbf { K } _ { i j }
+$$
+
+drives particle $i$ away from other particles, this equality does not hold for $k _ { f }$ which is non-stationary. Furthermore, in such summation over $\nabla _ { \theta ^ { ( j ) } } { \bf K } _ { i j }$ , as $\begin{array} { r l } { \nabla _ { \theta ^ { ( j ) } } { \bf K } _ { i j } } & { = } \end{array}$ $\nabla _ { f ( \mathbf { x } ; \theta ^ { ( j ) } ) } \mathbf { K } _ { i j } \nabla _ { \theta ^ { ( j ) } } f ( \mathbf { x } ; \theta ^ { ( j ) } )$ , assuming $\nabla _ { \theta ^ { ( j ) } } f ( \mathbf { x } ; \theta ^ { ( j ) } )$ is of the same scale for $j$ , $\nabla _ { \theta ^ { ( j ) } } f ( \mathbf { x } ; \theta ^ { ( j ) } )$ will contribute to particle $i$ ’s repulsive force most if the function-space repulsive force, $\nabla _ { f ( \mathbf { x } ; \theta ^ { ( j ) } ) } \mathbf { K } _ { i j }$ is the largest. However, unlike in identifiable models, there is no guarantee that this condition imply $\theta ^ { ( j ) }$ is sufficiently close to $\theta ^ { ( i ) }$ , and mixing their gradient could be detrimental for the learning process.
+
+As similar terms also exist in other POVI methods, such an argument is independent to the choice of POVI methods. Also note that both parts of this argument depends on the over-parameterization property of the model, and the degeneracy (not being p.d.) of the kernel.
+
+The Activation Kernel Another kernel that seems appropriate for BNN inference can be defined using network layer activations. Specifically, let $h ( \mathbf { x } ; \theta )$ be the activations of all layers in the NN parameterized by $\theta$ , when fed with a batch of inputs $\mathbf { x }$ . The kernel is defined as
+
+$$
+k _ { a } ( \theta ^ { ( 1 ) } , \theta ^ { ( 2 ) } ) : = \mathbb { E } _ { \mathbf { x } \sim \mu } [ k ( h ( \mathbf { x } ; \theta ^ { ( 1 ) } ) , h ( \mathbf { x } ; \theta ^ { ( 2 ) } ) ) ) ] .
+$$
+
+This kernel is positive definite if the batch size $B$ is sufficiently large, but it does not work either: predictive performance is worse than weight-space SVGD with RBF kernel, and as shown in Figure 8, it also suffers from the collapsed prediction issue. Intuitively, our argument on over-parameterization in Section 2 should apply to all positive definite kernels.
+
+In conclusion, constructing sensible kernels for BNN in weight-space POVI is non-trivial; on the other hand, our proposed algorithm provides a more natural solution, and works better in practice.
+
+Our algorithm consists of several approximations. Assuming the function-space prior gradient is known, there remains two approximations, namely the parametric approximation to function particles (Section 3.1.1), and the stochastic approximation to particle update (Section 3.1.2). In this section, we examine the impact of them empirically, by comparing them to an exact implementation of the function-space POVI algorithm in a toy setting.
+
+
+Figure 9: Estimated $\mathrm { K L } \left( q \| p \right)$ w.r.t. training iterations, for f-SVGD using different sets of approximations. A baseline value is presented to help understanding the scale of KL divergence in this experiment; see below for details.
+
+Experiment Setup To make exact simulation of the function-space POVI procedure possible, we consider a 1-D regression problem on a finite-dimensional function space, with a closed form GP prior. Specifically, we set $\bar { \mathcal { X } } : = \mathbf { X _ { \mathrm { t r a i n } } } \cup \mathbf { X _ { \mathrm { t e s t } } } : = \{ - 2 , - 1 . 8 , - 1 . 6 , \bar { \mathbf { \Omega } } . . . , + 2 \} \cup \{ 1 . 7 , 1 . 9 , 2 . 1 \}$ . The training targets are generated by $y _ { i } \sim \mathcal { N } ( \sin ( x _ { i } ) , 0 . 1 ^ { 2 } )$ . The function-space prior is a GP prior with zero mean and a RBF kernel, which has a bandwidth of 0.5. The true posterior can be computed in closed form (Rasmussen, 2004):
+
+where
+
+$$
+\begin{array} { r l r } { { \mathbf { f } ( \mathbf { X } _ { \mathrm { t e s t } } ) | \mathbf { X } _ { \mathrm { t r a i n } } , \mathbf { Y } _ { \mathrm { t r a i n } } \sim \mathcal { N } ( \mu , \Sigma ) , } } \\ & { } & { \mu : = \mathbf { K } _ { t r } ( \mathbf { K } _ { r r } + \sigma ^ { 2 } I ) ^ { - 1 } ( \mathbf { Y } _ { \mathrm { t r a i n } } ) , } \\ & { } & { \Sigma : = \mathbf { K } _ { t t } - \mathbf { K } _ { t r } ( \mathbf { K } _ { r r } + \sigma ^ { 2 } I ) ^ { - 1 } \mathbf { K } _ { t r } ^ { \top } , } \end{array}
+$$
+
+and $\mathbf { K } _ { t t } , \mathbf { K } _ { t r } , \mathbf { K } _ { r r }$ denote the gram matrices $k ( { \mathbf { X } _ { \mathrm { { t e s t } } } } , { \mathbf { X } _ { \mathrm { { t e s t } } } } ) , k ( { \mathbf { X } _ { \mathrm { { t e s t } } } } , { \mathbf { X } _ { \mathrm { { t r a i n } } } } )$ and $k ( { \mathbf { X } } _ { \mathrm { t r a i n } } , { \mathbf { X } } _ { \mathrm { t r a i n } } )$ , respectively. We consider three versions of f-SVGD implementation:
+
+• An “exact” implementation, which treats $f ( \mathcal X )$ as the parameter space and directly applies SVGD. It is tractable in this experiment, as $f ( \mathcal X )$ is finite dimensional. The only approximation errors are due to discretization and particle approximation. It is known that as step-size approach 0, and number of particles approaches infinity, this method recovers the true posterior exactly (Liu et al., 2017).
+• f-SVGD with the parametric approximation, i.e. the algorithm described in Section 3.1.1.
+• f-SVGD with the parametric approximation, and the mini-batch approximation, i.e. the algorithm described in Section 3.1.2.
+
+To understand the scale of the KL divergence used here, we also report its value using a baseline posterior approximation $q$ , defined as the GP posterior conditioned on a down-sampled training set, $\tilde { \mathbf { X } } _ { \mathrm { t r a i n } } : = \{ - 2 , - 1 . 6 , \dots , + 2 \}$ .
+
+We use 1, 000 particles and a step size of $1 0 ^ { - 3 }$ . We run each version of f-SVGD for 20,000 iterations, and report the exclusive KL divergence of test predictions, $\mathrm { K L } \left( q [ f ( \mathbf { X } _ { \mathrm { t e s t } } ) ] \| p [ f ( \mathbf { X } _ { \mathrm { t e s t } } ) ] \right)$ , where $q ( f ( \cdot ) )$ is approximated with a multivariate normal distribution.
+
+The result is presented in Figure 9. We can see that even with 1,000 particles, our introduced approximations has a negligible impact on the solution quality, compared to the (well-understood)
+
+discretization and particle approximation in the original SVGD algorithm. Furthermore, the final algorithm in Section 3.1.2 has no convergence issues.
+
+# D THE RELATION BETWEEN FUNCTION-SPACE AND WEIGHT-SPACE POVI, AND FREQUENTIST ENSEMBLE TRAINING
+
+Function-space POVI, weight-space POVI, and ensembled gradient descent share a similar form: they all maintain $K$ particles in the parameter space; in each iteration, they all compute a update vector for each particle according to some rule, and add it to the parameter. In this section, we discuss this connection in more detail, by comparing the update rule for each algorithm.
+
+Consider a real-valued regression problem, where the likelihood model is $p ( y | f ( x ) ) \quad : =$ $\mathcal { N } ( y | f ( x ) , \sigma _ { y } ^ { 2 } )$ . We choose SVGD as the base POVI algorithm. The $B$ -dimensional kernel for f-SVGD is the RBF kernel with bandwidth $\sigma _ { k } ^ { 2 }$ . For all algorithms, denote the particles maintained at iteration $\ell$ as $\theta _ { \ell } ^ { 1 } , \ldots , \theta _ { \ell } ^ { K }$ . The three algorithms can all be written as
+
+$$
+\begin{array} { r } { \theta _ { \ell + 1 } ^ { i } : = \theta _ { \ell } ^ { i } + \epsilon \mathbf { u } _ { \ell } ^ { i } , } \end{array}
+$$
+
+for different choices of $\mathbf { u }$ . We drop the subscript $\ell$ below, as the context is clear. Denote $\mathcal { I } ^ { i } : =$ $\left( \frac { \partial f _ { \ell } ^ { i } ( \mathbf { x } _ { b } ) } { \partial \theta _ { \ell } ^ { i } } \right) ^ { \top }$ , where $\mathbf { x } _ { b } , \mathbf { y } _ { b }$ is the mini-batch from training set drawn in step $\ell$ ; denote $f ^ { i } ( \cdot ) : =$ $f ( \cdot ; \theta ^ { i } )$ .
+
+The Ensemble Method The ensemble algorithm computes $K$ maximum-a-posteriori estimates independently. The update rule is thus
+
+$$
+\begin{array} { r l r } { { \mathbf { u } _ { \mathrm { e n s } } ^ { i } : = \nabla _ { \theta ^ { i } } \log p ( \theta ^ { i } | \mathbf { X } , \mathbf { Y } ) } } \\ & { } & { \approx \underline { { N } } \nabla _ { \theta ^ { i } } \log p ( \mathbf { y } _ { b } | \theta ^ { i } , \mathbf { x } _ { b } ) + \nabla _ { \theta ^ { i } } \log p ( \theta ^ { i } ) } \\ & { } & { = \underbrace { \mathcal { I } ^ { i } [ \frac { N } { B \sigma _ { y } ^ { 2 } } ( \mathbf { y } _ { b } - f ^ { i } ( \mathbf { x } _ { b } ) ) ] } _ { \displaystyle B \sigma _ { y } ^ { 2 } } + \nabla _ { \theta ^ { i } } \log p ( \theta ^ { i } ) , } \end{array}
+$$
+
+where $B$ is the batch size.
+
+f-SVGD The update rule of f-SVGD can be derived by plugging in $\mathbf { v }$ from Table 1 into (4). With a RBF kernel and the Gaussian likelihood model, its form is
+
+$$
+\begin{array}{c} \begin{array} { l } { { \displaystyle { \bf u } _ { \mathrm { f - S V G D } } ^ { i } = - \mathcal { T } ^ { i } { \bf v } _ { \mathrm { S V G D } } ( f _ { \ell } ^ { i } ) } \ ~ } \\ { { \displaystyle ~ = \sum _ { j } \mathcal { I } ~ [ { \bf K } _ { i j } \nabla _ { f ^ { j } ( { \bf x } ) } \log p ( f ^ { j } ( { \bf x } ) | { \bf X } , { \bf Y } ) + \nabla _ { f ^ { j } ( { \bf x } ) } { \bf K } _ { i j } ] } \ ~ } \\ { { \displaystyle ~ \approx \sum _ { j } \left[ { \bf K } _ { i j } \mathcal { I } \ \left( \frac { N } { B \sigma _ { y } ^ { 2 } } ( { \bf y } _ { b } - f ^ { j } ( { \bf x } _ { b } ) ) + \nabla _ { f ^ { j } ( { \bf x } ) } \log p ( f ^ { j } ( { \bf x } ) ) \right) + \underbrace { { \bf K } _ { i j } } _ { \sigma _ { k } ^ { 2 } } \mathcal { I } \ ( f ^ { i } ( { \bf x } ) - f ^ { j } ( { \bf x } ) ) \right] } \ ~ } \\ { { \displaystyle ~ \times \sum _ { j } \left[ { \bf K } _ { i j } \mathcal { I } \ ~ \Big ( \frac { N } { B \sigma _ { y } ^ { 2 } } ( { \bf y } _ { b } - f ^ { j } ( { \bf x } _ { b } ) ) + \nabla _ { f ^ { j } ( { \bf x } ) } \log p ( f ^ { j } ( { \bf x } ) ) \Big ) + \underbrace { \frac { { \bf K } _ { i j } } { \sigma _ { k } ^ { 2 } } \mathcal { I } \ ( f ^ { i } ( { \bf x } ) - f ^ { j } ( { \bf x } ) ) } _ { \mathrm { f R F } _ { i j } } ~ \right]} \end{array} } \end{array}
+$$
+
+Denote $S _ { i } : = \textstyle \sum _ { j } \mathbf { K } _ { i j }$ , $\tilde { K } _ { i j } : = { \bf K } _ { i j } / S _ { i }$ , we turn (12) into
+
+$$
+\begin{array} { l } { { \displaystyle S _ { i } \mathcal { T } ^ { i } \sum _ { j } \bigg [ \tilde { K } _ { i j } \left( \frac { N } { B \sigma _ { y } ^ { 2 } } ( \mathbf { y } _ { b } - f ^ { j } ( \mathbf { x } _ { b } ) ) + \nabla _ { f ^ { j } ( \mathbf { x } ) } \log p ( f ^ { j } ( \mathbf { x } ) ) \right) + \frac { 1 } { S _ { i } } \mathbf { f R } \mathbf { F } _ { i j } \bigg ] } } \\ { { \displaystyle \propto \mathcal { I } ^ { i } \left\{ \frac { N } { B \sigma _ { y } ^ { 2 } } \left( \mathbf { y } _ { b } - \sum _ { j } \tilde { K } _ { i j } f ^ { j } ( \mathbf { x } _ { b } ) \right) + \sum _ { j } \tilde { K } _ { i j } \nabla _ { f ^ { j } ( \mathbf { x } ) } \log p ( f ^ { j } ( \mathbf { x } ) ) + \frac { 1 } { S _ { i } } \mathbf { f R } \mathbf { F } _ { i j } \right\} } } \end{array}
+$$
+
+The similarity between (12) and (9) is now clear: the first term in (14) corresponds to the backpropagated error signal in (9); the second term in (14), the function-space prior gradient, plays the same role as the parametric prior gradient in (9); A newly added term, $\mathbf { f R F } _ { i j }$ directly pushes ${ \dot { f } } ^ { i } ( \mathbf { x } )$ away from $f ^ { j } ( { \bf x } )$ , ensuring the particles eventually constitutes a posterior approximation, instead of collapsing into a single MAP estimate. In (14), all three terms act as function-space error signals, and get back-propagated to the weight space through ${ \mathcal { I } } ^ { i }$ .
+
+Consequently, our algorithm has many desirable properties:
+
+1. During the initial phase of training, as randomly initialized function particles are distant from each other, the repulsive force is relatively small, and particles will reach high-density regions rapidly like SGD;
+2. the repulsive force term takes into account the prediction of different particles, and prevents them from collapsing into a single, potentially overfitted, mode; as its scale is determined by the principled POVI algorithm, the final particles constitute an approximation to the function-space posterior;
+3. for large models, our algorithm could be easily parallelized following the model parallelism paradigm, as in each iteration, only function-space error signals need to be exchanged among particles, and the communication overhead is proportional to the batch size and number of particles.9
+
+SVGD with the function-value kernel Now we consider weight-space SVGD with the function value kernel (6), where both the finite-dimensional base kernel, and $\mu$ , are chosen to be the same as in f-SVGD. Therefore, fix a set of samples $\mathbf { x }$ , the evaluation on $\left( \theta ^ { i } , \theta ^ { j } \right)$ of (the stochastic approximation to) (6) equals $\mathbf { K } _ { i j }$ . Still, we denote it as $K _ { i j } ^ { f v }$ , as this kernel is a function of weights. The update rule is
+
+$$
+\begin{array} { r l r } { { \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { \boldsymbol 1 } } } } } } } _ { \mathrm { S V G D , f i v } } ^ { i } : = \sum _ { j } [ \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { K } } } } } _ { i j } ^ { f v } \nabla _ { \theta ^ { j } } \log p ( \theta ^ { j } | \mathbf { \boldsymbol { \mathsf { X } } } , \mathbf { Y } ) + \nabla _ { \theta ^ { j } } \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { \boldsymbol { \boldsymbol { \mathsf { K } } } } } } } } _ { i j } ^ { f v } ] } } \quad & { ( 1 5 ) } \\ & { } & { = \sum _ { j } [ \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { K } } } } } _ { i j } ^ { f v } ( \frac { \partial \theta ^ { j } } { \partial f ^ { j } } ) \nabla _ { f ^ { j } } \log p ( f ^ { j } | \mathbf { \boldsymbol { \mathsf { X } } } , \mathbf { Y } ) + ( \frac { \partial \theta ^ { j } } { \partial f ^ { j } } ) \nabla _ { f ^ { j } } \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { \boldsymbol { K } } } } } } _ { i j } ^ { f v } ] } \\ & { } & { \approx \sum _ { j } \{ \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { K } } } } } _ { i j } ^ { f v } \mathcal { I } ^ { ^ { j } } ( \frac { N } { B \sigma _ { y } ^ { 2 } } \bigl ( \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathit { \boldsymbol { \mathsf { J } } } } } } } _ { y } ^ { r } - f ^ { j } ( \mathbf { \boldsymbol { \mathsf { \boldsymbol { \boldsymbol { \mathsf { \boldsymbol { x } } } } } } } _ { b } ) \bigr ) ) + \nabla _ { \theta ^ { j } } \log p ( \theta ^ { j } ) + \frac { \mathbf { \boldsymbol { \mathsf { \boldsymbol { K } } } } _ { i j } ^ { f v } } { \sigma _ { k } ^ { 2 } } \mathcal { I } ^ { j } ( f ^ { i } ( \mathbf { \boldsymbol { \mathsf { \boldsymbol { x } } } } ) - f ^ { j } ( \mathbf { \boldsymbol { \mathsf { \boldsymbol { x } } } } ) ) \} . } \end{array}
+$$
+
+While (17) and (12) are very similar, the behavior of the resulted algorithms are drastically different. The key reason is that in (17), the Jacobian is for particle $j$ , and the first and third term in (17) are gradients for particle $j$ . But they are applied to particle $i$ . As we have discussed in Appendix B, this issue of gradient mixing could be highly detrimental for inference on over-parameterized models.
+
+SVGD with p.d. kernel Lastly, we present the update rule for SVGD using general kernels for completeness. It is
+
+$$
+\mathbf { u } _ { \mathrm { S V G D , p . d . } } ^ { i } \approx \sum _ { j } \left\{ \mathbf { K } _ { i j } ^ { f v } \mathcal { I } ^ { j } \left( \frac { N } { B \sigma _ { y } ^ { 2 } } ( \mathbf { y } _ { b } - f ^ { j } ( \mathbf { x } _ { b } ) ) \right) + \nabla _ { \theta ^ { j } } \log p ( \theta ^ { j } ) + \nabla _ { \theta ^ { j } } \mathbf { K } _ { i j } ^ { f v } \right\} .
+$$
+
+Although it also mixes gradients from different particles, such a behavior may be less detrimental than in the function-value kernel case, as the mixing coefficient $\mathbf { K } _ { i j }$ is usually based on similarity between network weights10. The issue of weight-space POVI using p.d. kernel is due to overparameterization, as we have discussed in Section 2.
\ No newline at end of file
diff --git a/md/train/Bkxonh4Ywr/Bkxonh4Ywr.md b/md/train/Bkxonh4Ywr/Bkxonh4Ywr.md
new file mode 100644
index 0000000000000000000000000000000000000000..0531f30af9f5a7d25a63f3e5dcf33b86b9745533
--- /dev/null
+++ b/md/train/Bkxonh4Ywr/Bkxonh4Ywr.md
@@ -0,0 +1,284 @@
+# LOCALIZING AND AMORTIZING: EFFICIENT INFERENCE FOR GAUSSIAN PROCESSES
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+The inference of Gaussian Processes concerns the distribution of the underlying function given observed data points. GP inference based on local ranges of data points is able to capture fine-scale correlations and allow fine-grained decomposition of the computation. Following this direction, we propose a new inference model that considers the correlations and observations of the $K$ nearest neighbors for the inference at a data point. Compared with previous works, we also eliminate the data ordering prerequisite to simplify the inference process. Additionally, the inference task is decomposed to small subtasks with several technique innovations, making our model well suits the stochastic optimization. Since the decomposed small subtasks have the same structure, we further speed up the inference procedure with amortized inference. Our model runs efficiently and achieves good performances on several benchmark tasks.
+
+# 1 INTRODUCTION
+
+Gaussian processes (GP) (Rasmussen & Williams, 2006) are flexible non-parametric models with a wide range of applications. GP poses a Gaussian prior over function values f and assumes observations y are generated independently given f. GP inference considers the calculation of the posterior of these function values (Matthews et al., 2016) given observations, namely $p ( \mathbf { f } | \mathbf { y } )$ . Direct computation of the posterior is often intractable on large datasets, motivating people to consider its approximations. Variational inference (Jordan et al., 1999; Blei et al., 2017) for GP (Rasmussen & Williams, 2006) has achieved great successes recently. Variational inference constructs a variational distribution, which is usually a multivariate Gaussian distribution, to approximate the posterior. The approximation is done by minimizing the KL divergence from the posterior to the variational distribution (Blei et al., 2017). The variational distribution is often constructed with some special structures to reduce the number of variational parameters and speed up the computation.
+
+Inducing-point methods (Quinonero-Candela & Rasmussen, 2005; Titsias, 2009; Hensman et al., ˜ 2013; 2015) define variational distributions on a small number $M$ of inducing points and then derive the distribution of non-inducing points conditioned on these inducing points. Inducing points summarize the entire posterior distribution, and their number $M$ balances the computational cost and the quality of the approximation. Inducing-point methods are further improved in several directions, such as generic inference for non-Gaussian likelihoods (Sheth et al., 2015; Dezfouli & Bonilla, 2015; Krauth et al., 2016; Hensman et al., 2015), inter-domain and subspace inducing points (Hensman et al., 2017; Panos et al., 2018), and decoupled approximation with two different sets of inducing points (Cheng & Boots, 2017; Salimbeni et al., 2018). Burt et al. (2019) provide theoretical analysis to show that a relatively small $M$ is sufficient to produce a reliable variational approximation when the input dimension is low.
+
+While inducing-point methods capture global correlations among data points through inducing points, inference methods based on local neighbors focus more on correlation structures at local scales. These methods consider only local-range dependencies to save computation because localrange correlations are often much stronger than distant ones. Nguyen-Tuong et al. (2009); Park & Apley (2018) partition the input space into subregions, fit local models over subregions and then stitch local models into one. Other works examine neighbors of each data point directly. Gramacy & Apley (2015) investigate the properties of GP predictive equation and construct a local predictive approximator. Covariance tapering (Furrer et al., 2006; Kaufman et al., 2008) gains computational efficiency by constructing a sparse correlation matrix with zero correlations between distant data points. Methods based on Vecchia’s approximation (Vecchia, 1988; Datta et al., 2016; Liu & Liu, 2019; Finley et al., 2019) decompose the joint probability of data points into conditionals according to a data ordering and then neglect far data points that are conditioned on.
+
+Recently, Liu & Liu (2019) propose the AIGP method, which extends the idea of local inference to GP models with non-Gaussian likelihoods. They use directed graphical models to approximate both the prior and the posterior. With this construction, the inference task decomposes into local inference subtasks, then they introduce amortized inference and use inference networks to identify solutions to these subtasks (Kingma & Welling, 2013; Dai et al., 2015; Miao et al., 2016). Amortization reduces the number of optimization parameters and greatly speeds up the inference procedure. However, this method has two drawbacks. First, the inference at a data point considers a few of its nearest neighbors but not all of them; therefore, it may lose some important correlations. Second, it depends on a data ordering. A bad ordering often deteriorates the performance, but it is hard to guard against such a bad situation. There are no easy fixes of the two issues, because all these designs in AIGP serve the purpose of decomposition.
+
+In this work, we propose a new GP inference method, Localized and Amortized Inference based on Nearest neighbors (LAIN). LAIN considers $K$ nearest neighbors for the inference at each data point. Particularly, LAIN uses a variational distribution whose covariance is parameterized by a sparse decomposition. The decomposition focuses on the correlations between every data point and its $K$ nearest neighbors 1. LAIN also eliminates the need for a data ordering. These nice properties come after several technical innovations. First, the new distribution does not admit a decomposable entropy calculation. We overcome this difficulty by using a decomposable lower bound of the entropy (Ranganath et al., 2016; Louizos & Welling, 2017). Second, to decompose the logarithm of the prior, AIGP and previous methods use a directed graphical model as an approximation of the prior. We follow this idea, but we consider all possible orderings of data points and collapse them to local combinations, making the computation manageable. With these techniques, LAIN still decomposes the inference task into subtasks, so amortized inference can apply. It is worthing noting that subtasks in LAIN are generated from the same mechanism while those in AIGP are not. We argue that subtasks sharing the same “distribution” are more appropriate for amortization.
+
+Our empirical evaluations show that the LAIN method outperforms baseline methods including AIGP in several learning tasks. Our investigation also indicates that LAIN can achieve decent performance even only a few neighbors are considered.
+
+# 2 BACKGROUND
+
+Gaussian Processes. Suppose we have a dataset containing a feature matrix $\mathbf { X } = ( \mathbf { x } _ { i } ) _ { i = 1 } ^ { N }$ and observations $\mathbf { y } = \mathbf { \Psi } ( y _ { i } ) _ { i = 1 } ^ { N }$ . We assume there is a latent function $f$ that generates $y _ { i }$ from $\mathbf { x } _ { i }$ for each $i$ . Particularly, each $y _ { i }$ is generated by a likelihood model $p ( y _ { i } | f _ { i } )$ with $f _ { i } = f ( \mathbf { x } _ { i } )$ . Denote $\mathbf { f } = ( f _ { i } ) _ { i = 1 } ^ { N }$ , then $\begin{array} { r } { p ( \mathbf { y } | \mathbf { f } ) = \prod _ { i = 1 } ^ { N } p ( y _ { i } | f _ { i } ) } \end{array}$ . The likelihood $p ( y _ { i } | f _ { i } )$ can be very general – here we only assume that $\log p ( y _ { i } | f _ { i } )$ is differentiable with respect to $f _ { i }$ . This mild assumption allows a wide range of data distributions. For example, if $y _ { i }$ is binary, $p ( y _ { i } | f _ { i } )$ is a Bernoulli distribution with $f _ { i }$ as the logit.
+
+We put a GP prior with a mean function $\nu ( \cdot )$ and a kernel function $\kappa ( \cdot , \cdot )$ over the latent function $f$ . The kernel function encodes the prior knowledge of the smoothness of $f$ . One commonly used kernel function is the Radial Basis Function (RBF) kernel, $\kappa ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) = r ^ { 2 } \exp ( - 0 . 5 \| \mathbf { x } _ { i } - \mathbf { x } _ { j } \| _ { 2 } ^ { 2 } / \sigma ^ { 2 } )$ , with $r$ and $\sigma$ as parameters. With this prior, function values in f follow a multivariate Gaussian, f $\sim$ $\mathcal { N } ( { \boldsymbol \nu } , { \Sigma } )$ , with the mean ${ \pmb { \nu } } = ( \nu ( x _ { i } ) ) _ { i = 1 } ^ { \mathbf { \hat { N } } }$ and the covariance matrix $\pmb { \Sigma }$ with $\Sigma _ { i , j } = \kappa ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) \ \forall i , j$ .
+
+GP inference concerns the calculation of the posterior $p ( \mathbf { f } | \mathbf { y } )$ (Matthews et al., 2016), from which we can infer the function value $f _ { \star }$ for any new input $\mathbf { x } _ { \star }$ with integral $\begin{array} { r } { \int _ { \mathbf { f } } p ( f _ { \star } | \mathbf { f } ) p ( \mathbf { f } | \mathbf { y } ) \mathrm { d } \mathbf { f } } \end{array}$ . The posterior $p ( \mathbf { f } | \mathbf { y } )$ is generally not tractable, so we appeal to approximate inference.
+
+Variational Inference for GP. Variational inference approximates the posterior $p ( \mathbf { f } | \mathbf { y } )$ with a variational distribution $q ( \mathbf { f } )$ , which is defined as a multivariate Gaussian distribution, $q ( \mathbf { f } ) \sim \mathcal { N } ( \mu , \mathbf { V } )$
+
+
+Figure 1: The structure of the variational distribution. The left box shows the amortization, which fits $\mu _ { i }$ -s and $R _ { i j }$ -s from their related prior kernel and observations. The right part shows the generation process of $f _ { i }$ -s.
+
+The inference is carried out by maximizing the Evidence Lower BOund (ELBO) with respect to $q ( \mathbf { f } )$ (Blei et al., 2017).
+
+$$
+\log p ( \mathbf { y } | \mathbf { X } ) \geq \operatorname* { m a x } _ { q ( \mathbf { f } ) } \underbrace { { \mathbb { E } } _ { q } \left[ \log p ( \mathbf { y } | \mathbf { f } ) \right] } _ { L _ { e l l } } + \underbrace { { \mathbb { E } } _ { q } \left[ \log p ( \mathbf { f } ) \right] } _ { L _ { c r o s s } } \underbrace { - { \mathbb { E } } _ { q } \left[ \log q ( \mathbf { f } ) \right] } _ { L _ { e n t } }
+$$
+
+Here we name the three terms in the ELBO for easy reference later. Typically the ELBO is maximized by gradient-based optimization, preferably stochastic gradient optimization when $N$ is large. Direct optimization of the ELBO is challenging, since the kernel matrix $\pmb { \Sigma }$ and the variational covariance $\mathbf { V }$ are both large and have size $N \times N$ .
+
+Inducing-point methods define $\begin{array} { r } { q ( \mathbf { f } ) ~ = ~ \int _ { \mathbf { f } _ { I } } q ( \mathbf { f } _ { I } ) p ( \mathbf { f } | \mathbf { f } _ { I } ) ~ \mathrm { d } \mathbf { f } _ { I } } \end{array}$ , where $q ( \mathbf { f } _ { I } )$ is the distribution over inducing points $I$ , and $p ( \mathbf { f } | \mathbf { f } _ { I } )$ is derived from the prior. The computation is reduced mainly because only the small distribution $q ( \mathbf { f } _ { I } )$ is optimized, while the conditional $p ( \mathbf { f } | \mathbf { f } _ { I } )$ is fixed when the prior is given.
+
+AIGP parameterizes $\mathbf { V }$ by a Cholesky decomposition, $\mathbf { V } = \mathbf { L L } ^ { \top }$ . Here $\mathbf { L }$ is a sparse lower triangular matrix, and each row of $\mathbf { L }$ has at most $K$ non-zero entries. AIGP uses a triangular $\mathbf { L }$ for easy entropy computation. It also approximates $\log p ( \mathbf { f } )$ with a directed graphical model. Both the lower triangular matrix $\mathbf { L }$ and the directed graph require an ordering of data points.
+
+# 3 METHOD
+
+# 3.1 THE VARIATIONAL DISTRIBUTION
+
+Following previous works, we also define the variational distribution $q ( \mathbf { f } )$ to be a multivariate Gaussian $\mathcal { N } ( \mu , \mathbf { V } )$ . We parameterize $\mathbf { V } = \mathbf { R } \mathbf { R } ^ { \top } + \delta ^ { 2 } \mathbf { I }$ with $\mathbf { R }$ being a sparse matrix and $\delta$ being a small constant. Note that we do not require $\mathbf { R }$ to be triangular. The sparse pattern of $\mathbf { R }$ is decided by the nearest neighbors: $R _ { i j } \neq 0$ only when $j \in n ( i )$ . Here $n ( i )$ is the neighbor set containing data points that have the largest covariance with $i$ in the prior (by definition $n ( i )$ includes $i$ ). In this work, we fix the size of $n ( i )$ to be $K$ , though our derivation works for varied sizes of $n ( i )$ . The row $\mathbf { R } _ { i }$ can be viewed as a representation of $f _ { i }$ in the variational distribution: $\mathbf { R } _ { i }$ informs $f _ { i }$ ’s correlation with other function values, just like a word embedding informs its relation with other words (Mikolov et al., 2013).
+
+Efficient sampling from the marginal is critical for the decomposition of the ELBO later. Owing to the sparse decomposition of the covariance matrix, we can cheaply draw marginal samples for an $f _ { i }$ from $q ( \mathbf { f } )$ with a linear transformation of white noise. The sampling scheme is shown in (2) and pictured in the right part of Figure 1.
+
+$$
+f _ { i } = \mu _ { i } + { \bf R } _ { i } \epsilon + \delta \xi = \mu _ { i } + { \bf R } _ { i , n ( i ) } \epsilon _ { n ( i ) } + \delta \xi , \epsilon \sim \mathcal { N } ( { \bf 0 , I } ) , \xi \sim \mathcal { N } ( { \bf 0 , 1 } ) .
+$$
+
+The constructed distribution $q ( \mathbf { f } )$ well approximates the strong correlations in the prior. From (2), $f _ { i }$ and $f _ { j }$ correlate in $q ( \mathbf { f } )$ by sharing noise entries in $n ( i ) \cap n ( j )$ when the intersection is not empty. In this case, either $f _ { i }$ neighbors $f _ { j }$ , or $f _ { j }$ neighbors $f _ { i }$ , or $f _ { i } , f _ { j }$ share common neighbors. When the neighbor sets are large enough, most strong correlations will be approximated by some non-zero entries in $\mathbf { V }$ .
+
+# 3.2 OPTIMIZATION OF THE ELBO
+
+We optimize the ELBO in (1) to find a good $q ( \mathbf { f } )$ to approximate the GP posterior. To apply stochastic optimization, we will decompose the three terms in the ELBO. We mainly consider the decomposition of $L _ { c r o s s }$ and $L _ { e n t }$ , as the decomposition of $L _ { e l l }$ is easy.
+
+We first decompose the cross entropy $L _ { c r o s s }$ . By convention, the GP prior has a zero mean. Though there is a closed-form calculation of $L _ { c r o s s }$ with both $q ( \mathbf { f } )$ and $p ( \mathbf { f } )$ being multivariate Gaussian, it involves expensive calculations of $\operatorname* { d e t } ( \pmb { \Sigma } )$ and $\Sigma ^ { - 1 }$ . Previous works approximate the prior with Vecchia’s method for easy decomposition and good approximation (Vecchia, 1988; Stein et al., 2004; Datta et al., 2016; Liu & Liu, 2019; Finley et al., 2019). The idea is to build a directed graphical model and approximate $\begin{array} { r } { p ( \mathbf { f } ) \approx \prod _ { i = 1 } ^ { N } p ( f _ { i } | f _ { \alpha ( i ) } ) } \end{array}$ with $\alpha ( i )$ being a small parent set of $i$ . In the original work, Vecchia (1988) first set an order to data points and then choose $\alpha ( i )$ as the $K$ nearest parents of $i$ . But it is not easy to guarantee a good ordering of data points (Banerjee et al., 2014; Guinness, 2018). Here we consider all possible orderings and take the average of approximations to address the data ordering concern.
+
+stimate for eac $L _ { c r o s s }$ as follows. First, we randomly saen we approximate the log-prior by $n ^ { \prime } ( i ) \subset n ( i )$ with , with $i \not \in$ $n ^ { \prime } ( i )$ $i$ $\begin{array} { r } { \log p ( \mathbf { f } ) \approx \sum _ { i = 1 } ^ { N } \log p ( f _ { i } | f _ { n ^ { \prime } ( i ) } ) } \end{array}$ conditional distribution $p ( f _ { i } | f _ { n ^ { \prime } ( i ) } )$ derived from the joint Gaussian $p ( f _ { i } , f _ { n ^ { \prime } ( i ) } )$ in the prior. Then $L _ { c r o s s }$ is estimated by a random batch of terms. The complete calculation is given as
+
+$$
+L _ { c r o s s } \approx \tilde { L } _ { c r o s s } = \frac { N } { | S | } \sum _ { i \in S } \mathbb { E } _ { q ( f _ { i } , f _ { n ^ { \prime } ( i ) } ) } \Big [ \log p ( f _ { i } | f _ { n ^ { \prime } ( i ) } ) \Big ] , \mathrm { ~ r a n d o m ~ s e t ~ } n ^ { \prime } ( i ) \subset n ( i ) .
+$$
+
+Here $S$ is a random batch of data points.
+
+Now we justify that this is an average over all data orderings. Suppose there is a data order $\pi ( \cdot )$ , such that we can define a directed graphical model over $p ( \mathbf { f } )$ by assigning every $i$ a parent set $n _ { \pi } ^ { \prime } ( i ) = \{ j : j \in n ( i ) , \pi ( j ) < \pi ( i ) \}$ . Denote $\Pi$ as all permutations of $N$ data points, with each permutation inducing a graphical model. The average of the log densities of all graphical models can be collapsed to the average computed from local neighborhoods. Denote $\Pi _ { n ( i ) }$ as permutations of indices in the set $n ( i )$ , then we have
+
+$$
+\frac { 1 } { N ! } \sum _ { \pi \in \Pi } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { q ( f _ { i } , f _ { n _ { \pi } ^ { \prime } ( i ) } ) } \Big [ \log p ( f _ { i } | f _ { n _ { \pi } ^ { \prime } ( i ) } ) \Big ] = \sum _ { i = 1 } ^ { N } \frac { 1 } { K ! } \sum _ { \pi \in \Pi _ { n ( i ) } } \mathbb { E } _ { q ( f _ { i } , f _ { n _ { \pi } ^ { \prime } ( i ) } ) } \Big [ \log p ( f _ { i } | f _ { n _ { \pi } ^ { \prime } ( i ) } ) \Big ] .
+$$
+
+Here we only need to consider permutations of data points within $n ( i )$ for each $i$ . Then we obtain (3) by estimating the inner summation by a single random permutation of $n ( i )$ and the outer summation by a random batch $S$ .
+
+We then decompose the entropy $L _ { e n t }$ . The entropy of $q ( \mathbf { f } )$ requires the expensive computation of $\operatorname* { d e t } ( \mathbf { V } )$ . To circumvent this difficulty, we find a decomposable lower bound of the entropy by using an auxiliary distribution (Ranganath et al., 2016; Louizos $\&$ Welling, 2017). Note that we always prefer a lower bound of the objective in this maximization problem. With an arbitrary distribution $r ( \epsilon | \mathbf { f } )$ , a lower bound of $L _ { e n t }$ is
+
+$$
+L _ { e n t } = - \mathbb { E } _ { q } \left[ \log q ( \mathbf { f } ) \right] \geq - \mathbb { E } _ { q ( \mathbf { f } , \epsilon ) } \left[ \log q ( \mathbf { f } | \epsilon ) + \log q ( \epsilon ) - \log r ( \epsilon | \mathbf { f } ) \right] .
+$$
+
+The bound is tight when $r ( \epsilon | \mathbf { f } )$ matches $q ( \epsilon | \mathbf { f } )$ . In this work, we try to let $r ( \epsilon | \mathbf { f } )$ match $q ( \epsilon | \mathbf { f } )$ . Particularly, we set $\begin{array} { r } { r ( \epsilon | \mathbf { f } ) = \prod _ { i } q ( \epsilon _ { i } | \mathbf { f } _ { n ( i ) } ) } \end{array}$ , where the conditional $q \bigl ( \epsilon _ { i } | \mathbf { f } _ { n ( i ) } \bigr )$ is derived from the joint Gaussian distribution $q \bigl ( \epsilon _ { i } , \mathbf { f } _ { n ( i ) } \bigr )$ . Then all terms in the lower bound in (5) are Gaussian loglikelihoods and are decomposable over data points. We can then reach the estimation of the entropy lower bound with a batch of data points.
+
+$$
+L _ { e n t } \geq \tilde { L } _ { e n t } = - \frac { 1 } { 2 } \frac { N } { | S | } \sum _ { i \in S } \log \left( 1 - \mathbf { R } _ { n ( i ) , i } ^ { \top } \left( \mathbf { R } _ { n ( i ) , : } \mathbf { R } _ { n ( i ) , : } ^ { \top } \right) ^ { - 1 } \mathbf { R } _ { n ( i ) , i } \right) + c o n s t .
+$$
+
+We finally decompose the likelihood $L _ { e l l }$ . The likelihood term $\log p ( \mathbf { y } | \mathbf { f } )$ naturally decomposes because $y _ { i }$ -s are conditionally independent given $f _ { i }$ -s.
+
+$$
+L _ { e l l } = \sum _ { i = 1 } ^ { N } \mathbb { E } _ { q ( f _ { i } ) } \left[ \log p ( y _ { i } | f _ { i } ) \right] , \quad \tilde { L } _ { e l l } = \frac { N } { | S | } \sum _ { i \in S } \log p ( y _ { i } | \hat { f } _ { i } ) .
+$$
+
+Here for each term $i$ in the summation, the expectation is estimated by a Monte Carlo sample $\hat { f } _ { i }$ from $q ( f _ { i } )$ . The gradients of variational parameters are propagated through ${ \hat { f } } _ { i }$ via reparameterization (Kingma & Welling, 2013).
+
+Finally, the ELBO has a decomposable approximation $\tilde { L } _ { e l l } + \tilde { L } _ { c r o s s } + \tilde { L } _ { e n t }$ to enable efficient stochastic optimization. From the derivations above, we see the objective can be decomposed by data points. The computation for a data point only involves itself and its $K$ nearest neighbors. Therefore, each stochastic gradient calculation takes time only $O ( K ^ { 3 } )$ . There are $N ( K + \bar { 1 } )$ parameters in $\pmb { \mu }$ and $\mathbf { R }$ to optimize, so the optimization takes at least $O ( N )$ time. We further reduce the number of parameters by amortizing the cost through a shared inference model, taking advantage of the fact that the inference for each data point $i$ only needs its $K$ nearest neighbors.
+
+# 3.3 AMORTIZED INFERENCE
+
+Following AIGP, we also apply amortized inference to GP inference. Particularly, we train an inference network to identify variational parameters ${ \bf \nabla } _ { \mu _ { i } }$ and $\mathbf { R } _ { i , n ( i ) } )$ for each data point $i$ . Since node correlations at a neighborhood can be easily treated as a weighted graph, we use Graph Convolutional Networks (GCNs) (Kipf & Welling, 2017) as our inference network.
+
+A GCN takes an adjacency matrix $\mathbf { A } \in \mathbb { R } ^ { k \times k }$ of graph and the node features $\mathbf { H } ^ { ( 0 ) } \in \mathbb { R } ^ { k \times d _ { 0 } }$ as the input and then makes predictions for all graph nodes. Let $\bar { \mathbf A }$ be the normalized adjacency matrix, $\bar { \mathbf { A } } = \mathbf { D } ^ { - \frac { 1 } { 2 } } \mathbf { A } \mathbf { D } ^ { - \frac { 1 } { 2 } }$ , with $\mathbf { D }$ being the diagonal degree matrix. A GCN layer $\ell$ with the input $\mathbf { H } ^ { ( \ell - 1 ) }$ is defined by $\mathbf { H } ^ { ( \ell ) } = g _ { \ell } ( \mathbf { H } ^ { ( \ell - 1 ) } , \mathbf { A } ) : = \overset { - } { \sigma } \big ( \bar { \mathbf { A } } \mathbf { H } ^ { ( \bar { \ell } - 1 ) } \mathbf { W } ^ { ( \ell ) } \big )$ . Here $\mathbf { W } ^ { ( l ) } \in \mathbb { R } ^ { d _ { \ell - 1 } \times d _ { \ell } }$ is the weight matrix of the layer $\ell$ . $\sigma ( \cdot )$ is the activation function. An $L$ -layer GCN computes its output by $\mathbf { H } = g c n ( \mathbf { H } ^ { 0 } , \mathbf { A } ) : = g _ { L } ( \mathbf { \sigma } _ { \cdot } \dots g _ { 1 } ( \mathbf { H } ^ { 0 } , \mathbf { A } ) \dots , \mathbf { A } )$ . We use two GCNs for the inference task, $g c n _ { 1 }$ for the calculation of $\mu _ { i }$ and $g c n _ { 2 }$ for $\mathbf { R } _ { i , n ( i ) }$ :
+
+$$
+\begin{array} { r } { \mu _ { i } = { \bf a } ^ { \top } g c n _ { 1 } \left( \left[ { \bf y } _ { n \left( i \right) } , { \bf e } _ { i } \right] , { \bf \Sigma } _ { n \left( i \right) , n \left( i \right) } \right) , { \bf R } _ { i , n \left( i \right) } = g c n _ { 2 } \left( \left[ { \bf y } _ { n \left( i \right) } , { \bf e } _ { i } \right] , { \bf \Sigma } _ { { n \left( i \right) } , n \left( i \right) } \right) . } \end{array}
+$$
+
+Here we use $\Sigma _ { n ( i ) , n ( i ) }$ as the adjacency matrix and stack the observation $\mathbf { y } _ { n ( i ) }$ and the one-hot vector $\mathbf { e } _ { i }$ as the input feature. The vector $\mathbf { e } _ { i }$ indicates the element $i$ for which the inference is running for. We choose the activation $\sigma ( \cdot )$ to be ReLU for intermediate layers and identity for the last layer. The last layer of each GCN has size 1 to output a $K \times 1$ vector. a is an averaging vector with all $K$ elements as $\textstyle { \frac { 1 } { K } }$ . The dashed box in Figure 1 shows the amortization.
+
+LAIN defines an inference subtask on a data point and its nearest neighbors, while AIGP defines a subtask on a data point and its parents. Due to this difference, LAIN has two advantages. First, the inference network of LAIN uses the observations from all the $K$ nearest neighbors, while the inference network of AIGP uses observations from parents only but not children. Second, inference subtasks of LAIN are generated with the same mechanism because the nearest-neighbor relationship is homogeneous across all data points. However, the parent-child relationship in AIGP depends on the ordering of data points (e.g. the first one in the order does not have parents). As a learning model, the inference network prefers subtasks from the same “distribution”.
+
+The computational cost of GCN is $O ( K ^ { 2 } )$ by treating the network size as constant. The complexity of one gradient calculation is $O ( K ^ { 3 } )$ . The optimization procedure converges fast since it only optimizes a constant number of variational parameters. In practice, we often observe that the optimization procedure converges in less than one epoch, which is not possible for methods without amortization. Finding nearest neighbors is the only step with running time bounds to the data size, but it only needs one run and is often fast on medium to large data sizes. If the data has a very large size, we can use k-d trees for low-dimensional data and approximate algorithms (Arya et al., 1998; Datar et al., 2004) for high dimensional data.
+
+# 3.4 PREDICTION
+
+For a new data point $\mathbf { x } _ { \star }$ with its $K$ nearest neighbors $n ( \star )$ in the prior, the predictive distribution is
+
+$$
+p ( y _ { \star } | \mathbf { x } _ { \star } , \mathbf { X } , \mathbf { y } ) \approx \int _ { f _ { \star } } p ( y _ { \star } | f _ { \star } ) q ( f _ { \star } | \mathbf { x } _ { \star } , \mathbf { X } _ { n ( \star ) } , \mathbf { y } _ { n ( \star ) } ) \mathrm { d } f _ { \star } \approx \frac { 1 } { | F | } \sum _ { \widehat { f } _ { \star } \in F } p ( y _ { \star } | \widehat { f } _ { \star } ) .
+$$
+
+
+Figure 2: The first two plots compare predictive distributions of full GP and LAIN with $K = 1 0$ . The right three plots show how SVGP, AIGP, and LAIN perform with a very small number of inducing points/neighbors. Data points in blue circles are not well fitted.
+
+Here $\begin{array} { r } { q ( f _ { \star } | \mathbf { x } _ { \star } , \mathbf { X } _ { n ( \star ) } , \mathbf { y } _ { n ( \star ) } ) = \int _ { \mathbf { f } _ { n ( \star ) } } p ( f _ { \star } | \mathbf { f } _ { n ( \star ) } ) q ( \mathbf { f } _ { n ( \star ) } ) \mathrm { d } \mathbf { f } _ { n ( \star ) } } \end{array}$ is a Gaussian with parameters,
+
+$$
+\begin{array} { r } { \mu _ { \star } = \mathbf { b } _ { \star } \mu _ { n ( \star ) } , \qquad \sigma _ { \star } ^ { 2 } = \Sigma _ { \star , \star } - \Sigma _ { \star , n ( \star ) } \mathbf { b } _ { \star } ^ { \top } + \mathbf { b } _ { \star } ( \mathbf { R } _ { n ( \star ) } \mathbf { R } _ { n ( \star ) } ^ { T } ) \mathbf { b } _ { \star } ^ { \top } , } \end{array}
+$$
+
+with $\mathbf { b _ { \star } } = \pmb { \Sigma } _ { \star , n ( \star ) } \pmb { \Sigma } _ { n ( \star ) , n ( \star ) } ^ { - 1 }$ . $F$ is a set of Monte Carlo samples from $q ( f _ { \star } | \mathbf { x } _ { \star } , \mathbf { X } _ { n ( \star ) } , \mathbf { y } _ { n ( \star ) } )$ . The
+
+# 4 EXPERIMENT
+
+We compare our method with five state-of-the-art methods: SVGP (Hensman et al., 2015), SAVIGP (Dezfouli & Bonilla, 2015), DGP (Cheng & Boots, 2017), VFF (Hensman et al., 2017), and AIGP (Liu & Liu, 2019). The first three methods are based on inducing points, VFF uses inter-domain inducing points, and AIGP uses local neighbors. Through all experiments, we use RBF as the default kernel, except for VFF we use Ma´tern- $\frac { 3 } { 2 }$ kernel (the code does not provide RBF kernel). We use the implementation of SVGP from GPFlow (Matthews et al., 2017), the implementation of DGP from Faust (2018), and implementations of all other algorithms from their authors.
+
+For SVGP, SAVIGP, and VFF, we vary the number of inducing points, $M \in \{ 2 0 0 , 1 0 0 0 , 2 0 0 0 \}$ , to check their performances. DGP has separate inducing points for mean approximation and those for variance approximation. We use 256 inducing points for variance approximation and vary the number of inducing points for mean approximation from 200 to 2000. We vary the number of neighbors, $K \in \{ 1 0 , 2 0 , 4 0 \}$ , for AIGP and LAIN. GCNs used in these two methods have three hidden layers with dimensions [20, 10, 1]. We randomly split each dataset into training $( 7 5 \% )$ and testing $( 2 5 \% )$ and report both the predictive performance on the test set and the inference running time. To save the space, we report results from two settings for each competing method: one setting is $M = 2 0 0$ or $K = 1 0$ , with which all methods have their fastest speed (marked by $\pmb { \mathscr { z } }$ ), and another setting giving the best predictive performance (marked by $\checkmark$ ).
+
+# 4.1 A TOY EXAMPLE
+
+In this section, we test different methods on a one-dimensional toy example studied in (Snelson & Ghahramani, 2006). The dataset contains 200 data points, shown as black dots in figure 2. We assume Gaussian likelihood in this experiment and run exact inference as the baseline. A smaller GCN (hidden dimensions [10, 5, 1]) is used in this task.
+
+The predictive mean and variance from the exact inference and LAIN with $K = 1 0$ are shown in the first two plots of Figure 2. The result of LAIN is very similar to that of exact inference, except that the mean curve of LAIN is less smooth, which does not really hurt the predictive performance.
+
+We test different methods with very small $M$ and $K$ and observe how they behave. We are likely to face this situation when we work on large datasets in high-dimensional spaces. The last three plots of Figure 2 exhibit predictive distributions of SVGP with $M = 2$ inducing points, AIGP with $K = 2$ parents, and LAIN with $K = 2$ nearest neighbors. When there are not enough inducing points, SVGP over-smooths the prediction and performs poorly for a good fraction of data points. AIGP does not have a good predictive mean either, because under a random ordering the directed graph constructed by AIGP cannot well capture neighboring relations. The predictive mean of LAIN does not deviate far from the ground-truth in the area with training instances, though the curve is rugged due to local variations.
+
+Table 1: Comparison on the eBird dataset.
+
+
Method
Config
Pred NLL
Time
SVGP
M=2004M=1000√
1.90±.031.88±.02
107s4.5ks
SAVIGP
M=2004M=2000√
2.04±.031.99±.03
167s50ks
VFF
M=200HM=2000
1.91±.021.91±.02
1.3ks13ks
DGP
M=2004M=2000
1.82±.021.80±.02
96s213s
AIGP
K=10 MK=20 √
1.79±.051.71±.05
45s125s
LAIN
K=10K=20K=40
1.69±.031.65±.031.60±.02
55s384s1.3ks
+
+Table 2: Comparison on the precipitation dataset.
+
+
Method
Config
Pred NLL
Time
SVGP
M=200HM=2000
1.57±.031.28±.03
2.5ks42ks
SAVIGP
M=2004M=2000
1.70±.021.58±.02
2.8ks50ks
VFF
M=2004M=2000
1.54±.031.53±.03
9.1ks32ks
DGP
M=200HM=2000
1.07±.051.00±.05
402s889s
AIGP
K=10 4K=10 √
0.96±.030.96±.03
155s155s
LAIN
K=10K=20K=40
0.74±.050.72±.050.69±.04
129s903s2.3ks
+
+
+Figure 3: ELBO trajectories of LAIN with and without inference networks.
+
+Table 3: Comparison on the MNIST dataset.
+
+
Method
Config
Pred NLL
Accuracy
Time
SVGP
M=200王M=1000√
0.053±.0040.051±.004
98.498.5
623s23ks
SAVIGP
M=200HM=200√
0.339±.0080.339±.008
51.751.7
6.5ks6.5ks
DGP
M=2004M=2000
0.059±.0050.052±.005
98.198.3
292s2.1ks
AIGP
K=10 4K=40 √
0.293±.0020.215±.003
98.098.2
3.9ks24ks
LAIN
K=10K=20K=40
0.053±.0030.050±.0030.051±.003
98.999.099.1
128s632s2.9ks
KNN
K=9K=19K=39
N.A.N.A.N.A.
98.698.397.6
24s26s28s
+
+# 4.2 BIRD ABUNDANCE ESTIMATION
+
+In this experiment, we estimate the spatial abundance of a bird species (Savannah Sparrow) using eBird dataset (Munson et al., 2015). The dataset has 14,393 observations, each of which is a reported bird count at a GPS location. We model the observed counts with GPS locations as the input. We set the likelihood to be a Poisson distribution, with rate given by $\lambda _ { i } = \exp ( f _ { i } )$ .
+
+We compare different inference methods in terms of Negative predictive Log-Likelihood (NLL, the smaller the better predictive performance). Table 1 shows the results. We can see that LAIN achieves the best predictive performance at $K = 4 0$ . Methods based on inducing points generally perform worse. In this dataset, observations have strong correlations in local areas, but inducing points are not efficient to capture the posterior at such a fine scale. In terms of running speed, LAIN is comparable to AIGP and DGP but faster than other methods. In our experiment, we have also tried to increase inducing points for DGP, but it does not improve its performance.
+
+In this experiment, we also investigate whether inference networks work correctly. We run LAIN without inference networks and optimize $\pmb { \mu }$ and $\mathbf { L }$ for the variational distribution directly. Then we compare LAIN models with and without inference networks by checking their optimization procedure. In this task, we fix hyperparameters, so the two methods solve a pure inference problem. Figure 3 is the trace plot of the negative ELBO versus training epochs. The figure shows the ELBO of the two LAIN models eventually converge to very similar values, though the ELBO without inference networks is slightly better after 50 epochs (likely due to the amortization gap). LAIN with inference networks significantly reduces the number of optimization epochs – the inference networks are well trained after only 0.01 epoch (about 100 iterations). In summary, the result indicates that inference networks can effectively identify the variational parameters using local information.
+
+# 4.3 PRECIPITATION LEVEL ESTIMATION
+
+In this task, we evaluate LAIN on a rainfall dataset. We process the precipitation dataset (Climate Data Online) and obtain the average precipitation level in May at 8,832 stations that are spatially distributed in the US. The GP inputs are GPS locations of these stations, and the observations are the average precipitation levels. We use the log-normal distribution as the likelihood, with its mean as function value $f$ from GP and variance as a hyperparameter learned from the data.
+
+Table 2 summaries the experimental results. LAIN has better predictive performance, and its running speed is comparable to or faster than other methods.
+
+We also analyze the goodness of our prior approximation since we can compute the exact $L _ { c r o s s }$ on this dataset. We compute $L _ { c r o s s }$ with the optimized $q ( \mathbf { f } )$ distribution as well as $\tilde { L } _ { c r o s s }$ . The true value $L _ { c r o s s }$ and the approximation $\tilde { L } _ { c r o s s }$ are: 5,465 versus 5,396 when $K \ : = \ : 1 0$ , 9,905 versus 8,490 when $K = 2 0$ , and 10,086 versus 9,009 when $K = 4 0$ . This result indicates that the approximation $\tilde { L } _ { c r o s s }$ is relatively accurate. Furthermore, $\tilde { L } _ { c r o s s }$ tends to be smaller than the true value and can be considered as a lower bound in such cases.
+
+# 4.4 HAND-WRITTEN DIGIT CLASSIFICATION
+
+In this experiment, we explore a high-dimensional inference problem, GP classification of MNIST digits (LeCun & Cortes, 2010). We consider a binary classification on handwritten images of 5 and 8. To make performance values of different methods more differentiable, we randomly choose a subset of size 7,858 from the original dataset. Pixel values are normalized to [0,1] in the preprocessing step. In the results, we also report the accuracy obtained by different methods.
+
+The results are shown in Table 3. We see that LAIN performs the best in terms of classification accuracy. Its predictive NLL and running speed also overperform competing methods, though not very significant. We also observe that AIGP makes less confident predictions than other methods, which accounts for its worse predictive NLL but high accuracy. We do not report results from VFF due to memory issues.
+
+We also examine KNN in this experiment. From the results, we notice that a small number of neighbors are often sufficient for KNN and LAIN models to perform well. By checking the running time of KNN, we also see that the time of finding nearest neighbors is only a small fraction of the total inference time on this dataset. There are slight differences regarding the test accuracy between KNN and LAIN, presumably due to different weighting schemes: LAIN weights different nearest neighbors according to their correlations, while KNN treats all nearest neighbors uniformly.
+
+# 5 CONCLUSION
+
+In this work, we propose a novel approach for GP inference. We construct a variational distribution that has a sparse decomposition on its covariance matrix. With this distribution, function value at a data point is inferred from its nearest neighbors, encouraging the inference efficiently focuses on approximating strong correlations posed by the prior. The proposed variational distribution is expressive to approximate the GP posterior and also provides a decent structure for efficient ELBO optimization. We further decompose the ELBO into homogeneous subtasks and therefore enable stochastic optimization. Finally, we devise inference networks to perform these subtasks and significantly reduce the number of variational parameters. Our proposed method performs well in terms of predictive performance and running speed on a series of benchmark tasks.
+
+# REFERENCES
+
+Sunil Arya, David M Mount, Nathan S Netanyahu, Ruth Silverman, and Angela Y Wu. An optimal algorithm for approximate nearest neighbor searching fixed dimensions. Journal of the ACM (JACM), 45(6):891–923, 1998.
+
+Sudipto Banerjee, Bradley P Carlin, and Alan E Gelfand. Hierarchical modeling and analysis for spatial data. Chapman and Hall/CRC, 2014.
+
+David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017.
+
+David Burt, Carl Edward Rasmussen, and Mark Van Der Wilk. Rates of convergence for sparse variational Gaussian process regression. 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. 862–871, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
+
+Ching-An Cheng and Byron Boots. Variational inference for gaussian process models with linear complexity. In Advances in Neural Information Processing Systems, pp. 5190–5200, 2017.
+
+Climate Data Online. https://www.ncdc.noaa.gov/cdo-web/datasets.
+
+Zhenwen Dai, Andreas Damianou, Javier Gonzalez, and Neil Lawrence. Variational auto-encoded´ deep gaussian processes. arXiv preprint arXiv:1511.06455, 2015.
+
+Mayur Datar, Nicole Immorlica, Piotr Indyk, and Vahab S Mirrokni. Locality-sensitive hashing scheme based on p-stable distributions. In Proceedings of the twentieth annual symposium on Computational geometry, pp. 253–262. ACM, 2004.
+
+Abhirup Datta, Sudipto Banerjee, Andrew O Finley, and Alan E Gelfand. Hierarchical nearestneighbor gaussian process models for large geostatistical datasets. Journal of the American Statistical Association, 111(514):800–812, 2016.
+
+Amir Dezfouli and Edwin V Bonilla. Scalable inference for gaussian process models with blackbox likelihoods. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1414–1422. Curran Associates, Inc., 2015.
+
+Aleksandra Faust. Decoupled gaussian process (github implementation). https://github. com/google/decoupled_gaussian_process, 2018.
+
+Andrew O Finley, Abhirup Datta, Bruce D Cook, Douglas C Morton, Hans E Andersen, and Sudipto Banerjee. Efficient algorithms for bayesian nearest neighbor gaussian processes. Journal of Computational and Graphical Statistics, pp. 1–14, 2019.
+
+Reinhard Furrer, Marc G Genton, and Douglas Nychka. Covariance tapering for interpolation of large spatial datasets. Journal of Computational and Graphical Statistics, 15(3):502–523, 2006.
+
+Robert B Gramacy and Daniel W Apley. Local gaussian process approximation for large computer experiments. Journal of Computational and Graphical Statistics, 24(2):561–578, 2015.
+
+Joseph Guinness. Permutation and grouping methods for sharpening gaussian process approximations. Technometrics, 60(4):415–429, 2018.
+
+James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013.
+
+James Hensman, Alexander G de G Matthews, and Zoubin Ghahramani. Scalable variational Gaussian process classification. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, 2015.
+
+James Hensman, Nicolas Durrande, and Arno Solin. Variational fourier features for gaussian processes. The Journal of Machine Learning Research, 18(1):5537–5588, 2017.
+
+Michael I. Jordan, Zoubin Ghahramani, Tommi S. Jaakkola, and Lawrence K. Saul. An introduction to variational methods for graphical models. Machine Learning, 37(2):183–233, 1999.
+
+Cari G Kaufman, Mark J Schervish, and Douglas W Nychka. Covariance tapering for likelihoodbased estimation in large spatial data sets. Journal of the American Statistical Association, 103 (484):1545–1555, 2008.
+
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the 2nd International Conference on Learning Representations (ICLR), number 2014, 2013.
+
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
+
+K. Krauth, E. V. Bonilla, K. Cutajar, and M. Filippone. AutoGP: Exploring the Capabilities and Limitations of Gaussian Process Models. ArXiv e-prints, October 2016.
+
+Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
+
+Linfeng Liu and Liping Liu. Amortized variational inference with graph convolutional networks for gaussian processes. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 2291–2300, 2019.
+
+Christos Louizos and Max Welling. Multiplicative normalizing flows for variational bayesian neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2218–2227. JMLR. org, 2017.
+
+Alexander G de G Matthews, James Hensman, Richard Turner, and Zoubin Ghahramani. On sparse variational methods and the kullback-leibler divergence between stochastic processes. In Artificial Intelligence and Statistics, pp. 231–239, 2016.
+
+Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo Leon-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.
+
+Yishu Miao, Lei Yu, and Phil Blunsom. Neural variational inference for text processing. In Proceedings of the 33rd International Conference on International Conference on Machine Learning, pp. 1727–1736, 2016.
+
+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.
+
+M. A. Munson, K. Webb, D. Sheldon, D. Fink, W. M. Hochachka, M. Iliff, M. Riedewald, D. Sorokina, B. Sullivan, C. Wood, and S. Kelling. The eBird reference dataset, version 2014, 2015.
+
+Duy Nguyen-Tuong, Jan R Peters, and Matthias Seeger. Local gaussian process regression for real time online model learning. In Advances in Neural Information Processing Systems, pp. 1193– 1200, 2009.
+
+A. Panos, P. Dellaportas, and M. K. Titsias. Fully Scalable Gaussian Processes using Subspace Inducing Inputs. ArXiv e-prints, July 2018.
+
+Chiwoo Park and Daniel Apley. Patchwork kriging for large-scale gaussian process regression. The Journal of Machine Learning Research, 19(1):269–311, 2018.
+
+Joaquin Quinonero-Candela and Carl Edward Rasmussen. A unifying view of sparse approximate ˜ gaussian process regression. Journal of Machine Learning Research, 6(Dec):1939–1959, 2005.
+
+Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In International Conference on Machine Learning, pp. 324–333, 2016.
+
+Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. The MIT Press, 2006.
+
+H. Salimbeni, C.-A. Cheng, B. Boots, and M. Deisenroth. Orthogonally Decoupled Variational Gaussian Processes. ArXiv e-prints, September 2018.
+
+Rishit Sheth, Yuyang Wang, and Roni Khardon. Sparse variational inference for generalized gaussian process models. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning, ICML’15, pp. 1302–1311. JMLR.org, 2015.
+
+Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Advances in neural information processing systems, pp. 1257–1264, 2006.
+
+Michael L Stein, Zhiyi Chi, and Leah J Welty. Approximating likelihoods for large spatial data sets. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 66(2):275–296, 2004.
+
+Michalis K. Titsias. Variational learning of inducing variables in sparse gaussian processes. In Proceedings of the Twelfth International Conference on Artificial Intelligence and Statistics, pp. 567–574, 2009.
+
+Aldo V Vecchia. Estimation and model identification for continuous spatial processes. Journal of the Royal Statistical Society: Series B (Methodological), 50(2):297–312, 1988.
\ No newline at end of file
diff --git a/md/train/ByeSYa4KPS/ByeSYa4KPS.md b/md/train/ByeSYa4KPS/ByeSYa4KPS.md
new file mode 100644
index 0000000000000000000000000000000000000000..e3cb94f7279c864592f4c0aefd296121b173b118
--- /dev/null
+++ b/md/train/ByeSYa4KPS/ByeSYa4KPS.md
@@ -0,0 +1,237 @@
+# SPARSE NETWORKS FROM SCRATCH: FASTER TRAINING WITHOUT LOSING PERFORMANCE
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We demonstrate the possibility of what we call sparse learning: accelerated training of deep neural networks that maintain sparse weights throughout training while achieving dense performance levels. We accomplish this by developing sparse momentum, an algorithm which uses exponentially smoothed gradients (momentum) to identify layers and weights which reduce the error efficiently. Sparse momentum redistributes pruned weights across layers according to the mean momentum magnitude of each layer. Within a layer, sparse momentum grows weights according to the momentum magnitude of zero-valued weights. We demonstrate state-of-the-art sparse performance on MNIST, CIFAR-10, and ImageNet, decreasing the mean error by a relative $8 \%$ , $15 \%$ , and $6 \%$ compared to other sparse algorithms. Furthermore, we show that sparse momentum reliably reproduces dense performance levels while providing up to $5 . 6 1 \mathrm { x }$ faster training. In our analysis, ablations show that the benefits of momentum redistribution and growth increase with the depth and size of the network.
+
+# 1 INTRODUCTION
+
+Current state-of-the-art neural networks need extensive computational resources to be trained and can have capacities of close to one billion connections between neurons (Vaswani et al., 2017; Devlin et al., 2018; Child et al., 2019). One solution that nature found to improve neural network scaling is to use sparsity: the more neurons a brain has, the fewer connections neurons make with each other (Herculano-Houzel et al., 2010). Similarly, for deep neural networks, it has been shown that sparse weight configurations exist which train faster and achieve the same errors as dense networks (Frankle and Carbin, 2019). However, currently, these sparse configurations are found by starting from a dense network, which is pruned and re-trained repeatedly – an expensive procedure.
+
+In this work, we demonstrate the possibility of training sparse networks that rival the performance of their dense counterparts with a single training run – no re-training is required. We start with random initializations and maintain sparse weights throughout training while also speeding up the overall training time. We achieve this by developing sparse momentum, an algorithm which uses the exponentially smoothed gradient of network weights (momentum) as a measure of persistent errors to identify which layers are most efficient at reducing the error and which missing connections between neurons would reduce the error the most. Sparse momentum follows a cycle of (1) pruning weights with small magnitude, (2) redistributing weights across layers according to the mean momentum magnitude of existing weights, and (3) growing new weights to fill in missing connections which have the highest momentum magnitude.
+
+We compare the performance of sparse momentum to compression algorithms and recent methods that maintain sparse weights throughout training. We demonstrate state-of-the-art sparse performance on MNIST, CIFAR-10, and ImageNet-1k. For CIFAR-10, we determine the percentage of weights needed to reach dense performance levels and find that AlexNet, VGG16, and Wide Residual Networks need between $3 5 . 5 0 \%$ , $5 . 1 0 \%$ , and $20 \%$ weights to reach dense performance levels. We also estimate the overall speedups of training our sparse convolutional networks to dense performance levels on CIFAR-10 for optimal sparse convolution algorithms and naive dense convolution algorithms compared to dense baselines. For sparse convolution, we estimate speedups between $2 . 7 4 \mathrm { x }$ and $5 . 6 1 \mathrm { x }$ and for dense convolution speedups between $1 . 0 7 \mathrm { x }$ and $1 . 3 6 \mathrm { x }$ . In your analysis, ablations demonstrate that the momentum redistribution and growth components are increasingly important as networks get deeper and larger in size – both are critical for good ImageNet performance.
+
+# 2 RELATED WORK
+
+From Dense to Sparse Neural Networks: Work that focuses on creating sparse from dense neural networks has an extensive history. Earlier work focused on pruning via second-order derivatives (LeCun et al., 1989; Karnin, 1990; Hassibi and Stork, 1992) and heuristics which ensure efficient training of networks after pruning (Chauvin, 1988; Mozer and Smolensky, 1988; Ishikawa, 1996). Recent work is often motivated by the memory and computational benefits of sparse models that enable the deployment of deep neural networks on mobile and low-energy devices. A very influential paradigm has been the iterative (1) train-dense, (2) prune, (3) re-train cycle introduced by Han et al. (2015). Extensions to this work include: Compressing recurrent neural networks and other models (Narang et al., 2017; Zhu and Gupta, 2018; Dai et al., 2018), continuous pruning and re-training (Guo et al., 2016), joint loss/pruning-cost optimization (Carreira-Perpinan and Idelbayev, 2018), ´ layer-by-layer pruning (Dong et al., 2017), fast-switching growth-pruning cycles (Dai et al., 2017), and soft weight-sharing (Ullrich et al., 2017). These approaches often involve re-training phases which increase the training time. However, since the main goal of this line of work is a compressed model for mobile devices, it is desirable but not an important main goal to reduce the run-time of these procedures. This is contrary to our motivation. Despite the difference in motivation, we include many of these dense-to-sparse compression methods in our comparisons. Other compression algorithms include $L _ { 0 }$ regularization (Louizos et al., 2018), and Bayesian methods (Louizos et al., 2017; Molchanov et al., 2017). For further details, see the survey of Gale et al. (2019).
+
+Interpretation and Analysis of Sparse Neural Networks: Frankle and Carbin (2019) show that “winning lottery tickets” exist for deep neural networks – sparse initializations which reach similar predictive performance as dense networks and train just as fast. However, finding these winning lottery tickets is computationally expensive and involves multiple prune and re-train cycles starting from a dense network. Followup work concentrated on finding these configurations faster (Frankle et al., 2019; Zhou et al., 2019). In contrast, we reach dense performance levels with a sparse network from random initialization with a single training run while accelerating training.
+
+Sparse Neural Networks Throughout Training: Methods that maintain sparse weights throughout training through a prune-redistribute-regrowth cycle are most closely related to our work. Bellec et al. (2018) introduce DEEP-R, which takes a Bayesian perspective and performs sampling for prune and regrowth decisions – sampling sparse network configurations from a posterior. While theoretically rigorous, this approach is computationally expensive and challenging to apply to large networks and datasets. Sparse evolutionary training (SET) (Mocanu et al., 2018) simplifies prune-regrowth cycles by using heuristics: (1) prune the smallest and most negative weights, (2) grow new weights in random locations. Unlike our work, where many convolutional channels are empty and can be excluded from computation, growing weights randomly fills most convolutional channels and makes it challenging to harness computational speedups during training without specialized sparse algorithms. SET also does not include the cross-layer redistribution of weights which we find to be critical for good performance, as shown in our ablation study. The most closely related work to ours is Dynamic Sparse Reparameterization (DSR) by Mostafa and Wang (2019), which includes the full prune-redistribute-regrowth cycle. However, DSR requires some specific layers to be dense. Our method works in a fully sparse setting and is thus more generally applicable. More distantly related is Single-shot Network Pruning (SNIP) (Lee et al., 2019), which aims to find the best sparse network from a single pruning decision. The goal of SNIP is simplicity, while our goal is maximizing predictive and run-time performance. In our experiments, we compare against all four methods: DEEP-R, SET, DSR, and SNIP.
+
+# 3 SPARSE LEARNING
+
+We define sparse learning to be the training of deep neural networks which maintain sparsity throughout training while matching the predictive performance of dense neural networks. To achieve this, intuitively, we want to find the weights that reduce the error most effectively. This is challenging since most deep neural network can hold trillions of different combinations of sparse weights. Additionally, during training, as feature hierarchies are learned, efficient weights might change gradually from shallow to deep layers. How can we find good sparse configurations? In this work, we follow a divide-and-conquer strategy that is guided by computationally efficient heuristics. We divide sparse learning into the following sub-problems which can be tackled independently: (1) pruning weights, (2) redistribution of weights across layers, and (3) regrowing weights, as defined in more detail below.
+
+
+Figure 1: Sparse Momentum is applied at the end of each epoch: (1) take the magnitude of the exponentially smoothed gradient (momentum) of each layer and normalize to 1; (2) for each layer, remove $p = 2 0 \%$ of the weights with the smallest magnitude; (3) across layers, redistribute the removed weights by adding weights to each layer proportionate to the momentum of each layer; within a layer, add weights starting from those with the largest momentum magnitude. Decay $p$ .
+
+# 3.1 SPARSE MOMENTUM
+
+We use the mean magnitude of momentum $\mathbf { M } _ { i }$ of existing weights $\mathbf { W } _ { i }$ in each layer $i$ to estimate how efficient the average weight in each layer is at reducing the overall error. Intuitively, we want to take weights from less efficient layers and redistribute them to weight-efficient layers. The sparse momentum algorithm is depicted in Figure 1. In this section, we first describe the intuition behind sparse momentum and then present a more detailed description of the algorithm.
+
+The gradient of the error with respect to a weight $\textstyle \frac { \partial \mathbf { E } } { \partial \mathbf { W } }$ yields the directions which reduce the error at the highest rate. However, if we use stochastic gradient descent, most weights of $\frac { \partial \mathbf { E } } { \partial \mathbf { W } }$ oscillate between small/large and negative/positive gradients with each mini-batch (Qian, 1999) – a good change for one mini-batch might be a bad change for another. We can reduce oscillations if we take the average gradient over time, thereby finding weights which reduce the error consistently. However, we want to value recent gradients, which are closer to the local minimum, more highly than the distant past. This can be achieved by exponentially smoothing $\frac { \partial \mathbf { E } } { \partial \mathbf { W } }$ – the momentum $\mathbf { M } _ { i }$ :
+
+$$
+\mathbf { M } _ { i } ^ { t + 1 } = \alpha \mathbf { M } _ { i } ^ { t } + ( 1 - \alpha ) \frac { \partial \mathbf { E } } { \partial \mathbf { W } _ { i } } ^ { t } ,
+$$
+
+where $\alpha$ is a smoothing factor, $\mathbf { M } _ { i }$ is the momentum for the weight $\mathbf { W } _ { i }$ in layer $i$ ; $\mathbf { M } _ { i }$ is initialized at $t = 0$ with 0.
+
+Momentum is efficient at accelerating the optimization of deep neural networks by identifying weights which reduce the error consistently. Similarly, the aggregated momentum of weights in each layer should reflect how good each layer is at reducing the error consistently. Additionally, the momentum of zero-valued weights – equivalent to missing weights in sparse networks – can be used to estimate how quickly the error would change if these weights would be included in a sparse network.
+
+The details of the full training procedure of our algorithm are shown in Algorithm 1. See Algorithm 2 in the Appendix for a more detailed, source-code-like description of sparse momentum.
+
+Algorithm 1: Sparse momentum algorithm.
+
+
Data: Layer i to k with: Momentum Mi,Weight Wi, binary Maski prune rate pi, density d 1 fori←O to k do
Wi ← xavierInit(Wi)
2 3
Maski ← createMaskForWeight(Wi,d)
4
applyMask(Wi,Maski)
5 end
6 for epoch ← O to numEpochs do
7
for j←O to numBatches do
8
batch ← getBatch(j) E
9
W = computeGradients(W, batch)
10
UpdateMomentum( 器)
11
UpdateWeights(M)
12
fori←O to k do
13
applyMask(Wi,Maski) end
14
end
15
16
totalMomentum ← getTotalMomentum(M)
17
totalPruned ← getTotalPrunedWeights(W, p)
18
fori←O to k do
19
mi ← getMomentumContribution(Mi,Maski,totalMomentum)
20
magnitudePruneWeight(Wi,Maski, Pi)
21
regrowWeights(Wi,Maski,mi · totalPruned)
22
Pi←decayPrunerate(pi)
23
applyMask(Wi,Maski)
24
end
25 end
+
+Before training, we initialize the network with a certain sparsity $s$ : we initialize the network as usual and then remove a fraction of $s$ weights for each layer. We train the network normally and mask the weights after each gradient update to enforce sparsity. We apply sparse momentum after each epoch. We can break the sparse momentum into three major parts: (a) redistribution of weights, (b) pruning weights, (c) regrowing weights. In step (a), we we take the mean of the element-wise momentum momentum $m _ { i }$ agnitude of all layers . The resulting pr $i$ ortion is the momentum magnitude $\scriptstyle \sum _ { i = 0 } ^ { k } m _ { i }$
+removed weights multiplied by each layers momentum contribution: $\mathrm { R e g r o w } _ { i } =$ Total Removed · $m _ { i }$ . In step (b), we prune a proportion of $p$ (prune rate) of the weights with the lowest magnitude for each layer. In step (c), we regrow weights by enabling the gradient flow of zero-valued (missing) weights which have the largest momentum magnitude.
+
+Additionally, there are two edge-cases which we did not include in Algorithm 1 for clarity. (1) If we allocate more weights to be regrown than is possible for a specific layer, for example regrowing 100 weights for a layer of maximum 10 weights, we redistribute the excess number of weights equally among all other layers. (2) For some layers, our algorithm will converge in that the average weight in layer $i$ has much larger momentum magnitude than weights in other layers, but at the same time, this layer is dense and cannot grow further. We do not want to prune weights from such important layers. Thus, for these layers, we reduce the prune rate $p _ { i }$ proportional to the sparsity: $p _ { i } = \mathrm { { m i n } } ( p , \mathrm { { s p a r s i t y } } _ { i } )$ .
+
+After each epoch, we decay the prune rate in Algorithm 1 in the same way learning rates are decayed. We use a cosine decay schedule that anneals the prune rate to zero on the last epoch. See Appendix A.1 for an analysis on how decay schedule and starting prune rate affects training.
+
+# 4 EXPERIMENTAL SETUP
+
+For comparison, we follow three different experimental settings, one from Lee et al. (2019) and two settings follow Mostafa and Wang (2019): For MNIST (LeCun, 1998), we use a batch size of 100, decay the learning rate by a factor of 0.1 every 25000 mini-batches. For CIFAR-10 (Krizhevsky and Hinton, 2009), we use standard data augmentations (horizontal flip, and random crop with reflective padding), a batch size of 128, and decay the learning rate every 30000 mini-batches. We train for 100 and 250 epochs on MNIST and CIFAR-10, use a learning rate of 0.1, stochastic gradient descent with Nesterov momentum of $\alpha = 0 . 9$ , and we use a weight decay of 0.0005. We use a fixed $10 \%$ of the training data as the validation set and train on the remaining $90 \%$ . We evaluate the test set performance of our models on the last epoch. For all experiments on MNIST and CIFAR-10, we report the standard errors. Our sample size is generally between 10 and 12 experiments per method/architecture/sparsity level with different random seeds for each experiment.
+
+We use the modified network architectures of AlexNet, VGG16, and LeNet-5 as introduced by Lee et al. (2019). We consider two different variations of the experimental setup of Mostafa and Wang (2019) for ImageNet and CIFAR-10. The first follows their procedure closely, in that we run the networks in a partially dense setting where the first convolutional layer and downsampling convolutional layers are dense. Additionally, for CIFAR-10 the last fully connected layer is dense. In the second setting, we compare in a fully sparse setting – no layer is dense at the beginning of training. For the fully sparse setting we increase overall number of weights according to the extra parameters in the dense layers and distribute them equally among the network. The parameters in the dense layers make up $5 . 6 3 \%$ weights of the ResNet-50 network. We refer to these two settings as the partially dense and fully sparse settings.
+
+On ImageNet (Deng et al., 2009), we use ResNet-50 (He et al., 2016) with a stride of 2 for the $3 \mathrm { x } 3$ convolution in the bottleneck layers. We use a batch size of 256, input size of 224, momentum of $\alpha = 0 . 9$ , and weight decay of $1 \dot { 0 } ^ { - 4 }$ . We train for 100 epochs and report validation set performance after the last epoch. We report results for the fully sparse and the partially dense setting.
+
+For all experiments, we keep biases and batch normalization weights dense. We tuned the prune rate $p$ and momentum rate $\alpha$ searching the parameter space $\{ 0 . 2 , 0 . 3 , \bar { 0 } . 4 , 0 . 5 , 0 . 6 , 0 . 7 \}$ and $\{ 0 . 5 , 0 . 6 , 0 . 7$ $0 . 8 , 0 . 9 , 0 . 9 5 , 0 . 9 9 \}$ on MNIST and CIFAR-10 and found that $p = 0 . 2$ and $\alpha = 0 . 9$ work well for most architectures. We use this prune and momentum rate throughout all experiments.
+
+ImageNet experiments were run on $4 \mathbf { x }$ RTX 2080 Ti and all other experiments on individual GPUs.
+
+Our software builds on PyTorch (Paszke et al., 2017) and is a wrapper for PyTorch neural networks with a modular architecture for growth, redistribution, and pruning algorithms. Currently, no GPUaccelerated libraries that utilize sparse tensors exist, and as such we use masked weights to simulate sparse neural networks. Using our software, any PyTorch neural network can be adapted to be a sparse momentum network with less than 10 lines of code. We will open-source our software along with trained models and individual experimental results.1
+
+# 5 RESULTS
+
+Results in Figure 2 and Table 1 show a comparison with model compression methods. On MNIST, sparse momentum is the only method that provides consistent strong performance across both LeNet 300-100 and LeNet-5 Caffe models. Soft-weight sharing (Ullrich et al., 2017) and Layer-wise Brain Damage (Dong et al., 2017) are competitive with sparse momentum for one model, but underperforms for the other model. For $1 \%$ of weights, variational dropout is more effective – but this method also uses dropout for further regularization while we only use weight decay. We can see that sparse momentum achieves equal performance to the LeNet-5 Caffe dense baseline with $8 \%$ weights.
+
+On CIFAR-10 in Table 1, we can see that sparse momentum outperforms Single-shot Network Pruning (SNIP) for all models and can achieve the same performance level as a dense model for VGG16-D with just $5 \%$ of weights.
+
+
+Figure 2: Comparisons against compression methods on MNIST with $9 5 \%$ confidence intervals.
+
+Figure 3 and Table 2 show comparisons of sparse learning methods on MNIST and CIFAR that follows the experimental procedure of Mostafa and Wang (2019) where some selected layers are dense. For LeNet 300-100 on MNIST, we can see that sparse momentum outperforms all other methods. For CIFAR-10, sparse momentum is better than dynamic sparse in 4 out of 5 cases. However, in general, the confidence intervals for most methods overlap – this particular setup for CIFAR-10 with specifically selected dense layers seems to be too easy to determine difference in performance between methods and we do not recommend this setup for future work. Table 2 shows that sparse momentum outperforms all other methods on ImageNet (ILSVRC2012) for the Top-1 accuracy measure. Dynamic sparse is better for the Top-5 accuracy with $20 \%$ weights. In the fully sparse setting, sparse momentum remains competitive and seems to find a weight distribution which works equally well for the $10 \%$ weights case. For $20 \%$ weights, the performance decreases slightly.
+
+
+Figure 3: Test set accuracy with $9 5 \%$ confidence intervals on MNIST and CIFAR at varying sparsity levels for LeNet 300-100 and WRN 28-2.
+
+# 5.1 SPEEDUPS AND WEIGHTS NEEDED FOR DENSE PERFORMANCE LEVELS
+
+We analyzed how many weights are needed to achieve dense performance for our networks on CIFAR-10 and how much faster would we able to train such a sparse network compared to a dense one. We do this analysis by increasing the number of weights by $5 \%$ until the sparse network trained with sparse momentum reaches a performance level that overlaps with a $9 5 \%$ confidence interval of the dense performance. We then measure the speedup of the model. For each network-density combination we perform ten training runs with different random seeds to calculate the mean test error and its standard error.
+
+To estimated the speedups that could be obtained using sparse momentum for these dense networks we follow two approaches: Theoretical speedups for sparse convolution algorithms which are proportional to reductions in FLOPS and practical speedups using dense convolutional algorithms which are proportional to empty convolutional channels. For our sparse convolution estimates, we calculate the FLOPS saved for each convolution operation throughout training as well as the runtime for each convolution. To receive the maximum speedups for sparse convolution, we then scale the runtime for each convolution operation by the FLOPS saved. While a fast sparse convolution algorithm for coarse block structures exist for GPUs (Gray et al., 2017), optimal sparse convolution algorithms for fine-grained patterns do not and need to be developed to enable these speedups.
+
+Table 1: CIFAR-10 test set error ( $\pm$ standard error) for dense baselines, Sparse Momentum and SNIP.
+
+
Sparse Error (%)
Weights (%)
Dense Error (%)
SNIP
Momentum
Model AlexNet-s
12.95±0.056
14.99
14.27±0.123
10
AlexNet-b
12.85±0.068
14.50
13.56±0.094
10
VGG16-C
6.49±0.038
7.27
7.00±0.054
5
VGG16-D
6.59±0.050
7.09
6.69±0.049*
5
VGG16-like
6.50±0.054
8.00
7.00±0.077
3
WRN-16-8
4.57±0.022
6.63
5.62±0.056
5
WRN-16-10
4.45±0.040
6.43
5.24±0.052
5
WRN-22-8
4.26±0.032
5.85
4.93±0.056
5
+
+\* $9 5 \%$ confidence intervals overlap with dense model. Table 2: Results for ResNet-50 on ImageNet.
+
+
Accuracy (%)
Model
Top-1
Top-5
Top-1
Top-5
Dense ResNet-50 (He et al., 2016)
74.9
92.4
74.9
92.4
Fully Sparse
10%
weights
20%
Weights
DeepR (Bellec et al., 2018) SET (Mocanu et al., 2018)
X
70.2
90.0
71.7
90.6
X
70.4
90.1
72.6
91.2
Dynamic Sparse (Mostafa and Wang,2019) X
71.6
90.5
73.3
92.4
Sparse momentum
72.3
91.0
74.2
91.9
×
72.3
91.0
73.8
91.8
+
+The second method measures practical speedups that can be obtained with naive, dense convolution algorithms which are available today. Dense convolution is unsuitable for the training of sparse networks but we include this measurement to highlight the algorithmic gap that exists to efficiently train sparse networks. For dense convolution algorithms, we estimate speedups as follows: If a convolutional channel consists entirely of zero-valued weights we can remove these channels from the computation without changing the outputs and obtain speedups. To receive the speedups for dense convolution we scale each convolution operation by the proportion of empty channels. Using these measures, we estimated the speedups for our models on CIFAR-10. The resulting speedups and dense performance levels can be seen in Table 3.
+
+We see that VGG16 networks can achieve dense performance with relatively few weights while AlexNet requires the most weights. Wide Residual Networks need an intermediate level of weights. Despite the large number of weights for AlexNet, sparse momentum still yields large speedups around $3 . 0 \mathbf { x }$ for sparse convolution. Sparse convolution speedups are particularly pronounced for Wide Residual Networks (WRN) with speedups as high as $5 . 6 1 \mathrm { x }$ . Dense convolution speedups are much lower and are mostly dependent on width, with wider networks receiving larger speedups. These results highlight the importance to develop optimized algorithms for sparse convolution.
+
+Beyond speedups, we also measured the overhead of our sparse momentum procedure to be equivalent of a slowdown to $0 . 9 7 3 \mathrm { x } \pm 0 . 0 2 9 \mathrm { x }$ compared to a dense baseline.
+
+Table 3: Dense performance equivalents and speedups for sparse networks on CIFAR-10.
+
+
Model
Weights (%)
Error(%)
Speedups
Dense Convolution (Empty Channels)
Sparse Convolution (FLOPS Reduction)
AlexNet-s
50
13.15±0.065
1.31x
3.01x
AlexNet-b
35
13.00±0.065
1.21x
2.74x
VGG16-C
10
6.64±0.040
1.32x
3.85x
VGG16-D
5
6.49±0.045
1.36x
3.51x
VGG16-like
5
6.46±0.036
1.32x
3.48x
WRN 16-8
30
4.72±0.051
1.07x
4.59x
WRN 16-10
25
4.56±0.037
1.07x
4.41x
WRN 22-8
20
4.40±0.037
1.21x
5.61x
+
+# 6 ANALYSIS
+
+# 6.1 ABLATION ANALYSIS
+
+Our method differs from previous methods like SET and Dynamic Sparse Reparameterization in two ways: (1) redistribution of weights and (2) growth of weights. To understand the performance contribution of these components, we perform ablations on CIFAR-10 for VGG16-D with $5 \%$ weights, MNIST for LeNet 300-100 and LeNet-5 Caffe with $5 \%$ weights, and ImageNet for ResNet-50 with $10 \%$ weights in the fully sparse setting. The results can be seen in Table 4.
+
+Redistribution: Redistributing weights according to the momentum magnitude becomes increasingly important the larger a network is as can be seen from the steady increases in error from the small LeNet 300-100 to the large ResNet-50 when no momentum redistribution is used. Increased test error is particularly pronounced for ImageNet where the Top-1 error increases by $3 . 4 2 \%$ to $9 . 7 1 \%$ if no redistribution is used.
+
+Momentum growth: Momentum growth improves performance over random growth by a large margin for ResNet-50 on ImageNet, but for smaller networks the combination of redistribution and random growth seems to be sufficient to find good weights. Random growth without redistribution, however, cannot find good weights. These results suggest that with increasing network size a random search strategy becomes inefficient and smarter growth algorithms are required for good performance.
+
+Table 4: Ablation analysis for different growth and redistribution algorithm combinations for LeNet 300-100 and LeNet-5 Caffe on MNIST, VGG16-D on CIFAR-10, and ResNet-50 on ImageNet.
+
+
Redistribution
Growth
Test error in %
LeNet 300-100
LeNet-5 Caffe
VGG16-D
ResNet-50
momentum
momentum
1.53±0.020
0.69±0.021
6.69±0.049
27.07
momentum
random
+0.07±0.022
-0.05±0.011
-0.19±0.040
+7.29
None
momentum
+0.01±0.018
+0.32±0.071
+1.54±0.101
+3.42
None
random
+0.11±0.020
+0.13±0.013
+1.49±0.147
+9.71
+
+# 7 CONCLUSION AND FUTURE WORK
+
+We presented our sparse learning algorithm, sparse momentum, which uses the mean magnitude of momentum to grow and redistribute weights. We showed that sparse momentum outperforms other sparse algorithms on MNIST, CIFAR-10, and ImageNet. Additionally, sparse momentum can rival dense neural network performance while accelerating training. Our analysis of speedups highlights the need for research into specialized sparse convolution and sparse matrix multiplication algorithms to enable the benefits of sparse networks.
+
+# REFERENCES
+
+Bellec, G., Kappel, D., Maass, W., and Legenstein, R. A. (2018). Deep rewiring: Training very sparse deep networks. CoRR, abs/1711.05136.
+
+Carreira-Perpinan, M. A. and Idelbayev, Y. (2018). learning-compression algorithms for neural net ´ pruning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8532–8541.
+
+Chauvin, Y. (1988). A back-propagation algorithm with optimal use of hidden units. In NIPS.
+
+Child, R., Gray, S., Radford, A., and Sutskever, I. (2019). Generating long sequences with sparse transformers. CoRR, abs/1904.10509.
+
+Dai, X., Yin, H., and Jha, N. K. (2017). Nest: A neural network synthesis tool based on a grow-andprune paradigm. CoRR, abs/1711.02017.
+
+Dai, X., Yin, H., and Jha, N. K. (2018). Grow and prune compact, fast, and accurate lstms. CoRR, abs/1805.11797.
+
+Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. (2009). Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee.
+
+Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805.
+
+Dong, X., Chen, S., and Pan, S. J. (2017). Learning to prune deep neural networks via layer-wise optimal brain surgeon. In NIPS.
+
+Frankle, J. and Carbin, M. (2019). The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR 2019.
+
+Frankle, J., Dziugaite, G. K., Roy, D. M., and Carbin, M. (2019). The lottery ticket hypothesis at scale. CoRR, abs/1903.01611.
+
+Gale, T., Elsen, E., and Hooker, S. (2019). The state of sparsity in deep neural networks. CoRR, abs/1902.09574.
+
+Gray, S., Radford, A., and Kingma, D. P. (2017). Gpu kernels for block-sparse weights.
+
+Guo, Y., Yao, A., and Chen, Y. (2016). Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, pages 1379–1387.
+
+Han, S., Pool, J., Tran, J., and Dally, W. (2015). Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pages 1135–1143.
+
+Hassibi, B. and Stork, D. G. (1992). Second order derivatives for network pruning: Optimal brain surgeon. In NIPS.
+
+He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778.
+
+Herculano-Houzel, S., Mota, B., Wong, P., and Kaas, J. H. (2010). Connectivity-driven white matter scaling and folding in primate cerebral cortex. Proceedings of the National Academy of Sciences of the United States of America, 107 44:19008–13.
+
+Ishikawa, M. (1996). Structural learning with forgetting. Neural Networks, 9:509–521.
+
+Karnin, E. D. (1990). A simple procedure for pruning back-propagation trained neural networks. IEEE transactions on neural networks, 1 2:239–42.
+
+Krizhevsky, A. and Hinton, G. (2009). Learning multiple layers of features from tiny images. Technical report, Citeseer.
+
+LeCun, Y. (1998). Gradient-based learning applied to document recognition.
+LeCun, Y., Denker, J. S., and Solla, S. A. (1989). Optimal brain damage. In NIPS.
+Lee, N., Ajanthan, T., and Torr, P. H. S. (2019). Snip: Single-shot network pruning based on connection sensitivity. In ICLR 2019.
+Louizos, C., Ullrich, K., and Welling, M. (2017). Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pages 3288–3298.
+Louizos, C., Welling, M., and Kingma, D. P. (2018). Learning sparse neural networks through $l _ { 0 }$ regularization. CoRR, abs/1712.01312.
+Mocanu, D. C., Mocanu, E., Stone, P., Nguyen, P. H., Gibescu, M., and Liotta, A. (2018). Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):2383.
+Molchanov, D., Ashukha, A., and Vetrov, D. P. (2017). Variational dropout sparsifies deep neural networks. In International Conference on MachineLearning (ICML).
+Mostafa, H. and Wang, X. (2019). Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In International Conference on Machine Learning (ICML).
+Mozer, M. C. and Smolensky, P. (1988). Skeletonization: A technique for trimming the fat from a network via relevance assessment. In NIPS.
+Narang, S., Diamos, G. F., Sengupta, S., and Elsen, E. (2017). Exploring sparsity in recurrent neural networks. CoRR, abs/1704.05119.
+Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A. (2017). Automatic differentiation in pytorch.
+Qian, N. (1999). On the momentum term in gradient descent learning algorithms. Neural networks : the official journal of the International Neural Network Society, 12 1:145–151.
+Simonyan, K., Vedaldi, A., and Zisserman, A. (2013). Deep inside convolutional networks: Visualising image classification models and saliency maps. CoRR, abs/1312.6034.
+Springenberg, J. T., Dosovitskiy, A., Brox, T., and Riedmiller, M. A. (2014). Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806.
+Ullrich, K., Meeds, E., and Welling, M. (2017). Soft weight-sharing for neural network compression. CoRR, abs/1702.04008.
+Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. (2017). Attention is all you need. In Advances in neural information processing systems, pages 5998–6008.
+Zeiler, M. D. and Fergus, R. (2014). Visualizing and understanding convolutional networks. In ECCV.
+Zhou, H., Lan, J., Liu, R., and Yosinski, J. (2019). Deconstructing lottery tickets: Zeros, signs, and the supermask. arXiv preprint arXiv:1905.01067.
+Zhu, M. and Gupta, S. (2018). To prune, or not to prune: Exploring the efficacy of pruning for model compression. CoRR, abs/1710.01878.
+
+# A APPENDIX
+
+# A.1 SENSITIVITY ANALYSIS
+
+Sparse momentum depends on two hyperparameters: Prune rate and momentum. In this section, we study the sensitivity of the accuracy of our models as we vary the prune rate and momentum. Since momentum parameter has an additional effect on the optimization procedure, we run control experiments for fully dense networks thus disentangling the difference in accuracy accounted by our sparse momentum procedure.
+
+We run experiments for VGG-D and AlexNet-s with $5 \%$ and $10 \%$ weights on CIFAR-10. Results can be seen in Figure 4. We see that sparse momentum is highly robust to the choice of prune rate with results barely deviating when the prune rate is in the interval between 0.2 to 0.4. However, we can see a gradual linear trend that indicates that smaller prune rates work slightly better than larger ones. Cosine and linear prune rate annealing schedules do equally well. For momentum, confidence intervals for values between 0.7 and 0.9 overlap indicating that our procedure is robust to the choice of the momentum parameter. Sparse momentum is more sensitive to low momentum values $( \le 0 . 6 )$ while it is less sensitive for large momentum values (0.95) compared to a dense control. Additionally, we test the null hypothesis that sparse momentum is equally sensitive to deviations from a momentum parameter value of 0.9 as a dense control. The normality assumption was violated and data transformations did not help. Thus we use the non-parametric Wilcoxon Signed-rank Test. We find no evidence that sparse momentum is more sensitive to the momentum parameter than a dense control, $W ( 1 6 ) = 2 2 . 0 , p = 0 . 5 8$ . Overall, we conclude that sparse momentum is highly robust to deviations of the pruning schedule and the momentum and prune rate parameters.
+
+
+Figure 4: Parameter sensitivity analysis for prune rate and momentum with $9 5 \%$ confidence intervals.
+
+B ADDITIONAL ANALYSIS
+
+# B.1 DENSE VS SPARSE FEATURES
+
+Are there differences between feature representations learned by dense and sparse networks? The answer to this question can help with the design of sparse learning algorithms and sparse architectures. In this section, we look at the features of dense and sparse networks and how specialized these features are for certain classes. We test difference between sparse and dense network features statistically.
+
+For feature visualization, it is common to backpropagate activity to the inputs to be able to visualize what these activities represent (Simonyan et al., 2013; Zeiler and Fergus, 2014; Springenberg et al., 2014). However, in our case, we are more interested in the overall distribution of features for each layer within our network, and as such we want to look at the magnitude of the activity in a channel since – unlike feature visualization – we are not just interested in feature detectors but also discriminators. For example, a face detector would induce positive activity for a ‘person’ class but might produce negative activity for a ‘mushroom’ class. Both kinds of activity are useful.
+
+With this reasoning, we develop the following convolutional channel-activation analysis: (1) pass the entire training set through the network and aggregate the magnitude of the activation in each convolutional channel separately for each class; (2) normalize across classes to receive for each channel the proportion of activation which is due to each class; (3) look at the maximum proportion of each channel as a measure of class specialization: a maximum proportion of $1 / N _ { c }$ where $N _ { c }$ is the number of classes indicates that the channel is equally active for all classes in the training set. The higher the proportion deviates from this value, the more is a channel specialized for a particular class.
+
+We obtain results for AlexNet-s, VGG16-D, and WRN 28-2 on CIFAR-10 and use as many weights as needed to reach dense performance levels. We then test the null hypothesis, that there are no differences in class specialization between features from sparse networks and dense networks. Equal variance assumptions was violated for VGG-D and normality was violated for WRN-28-2, while all assumptions hold for AlexNet-s. For consistency reasons we perform non-parametric Kruskal-Wallis one-way analysis of variance tests for all networks. For AlexNet-s, we find some evidence that features of sparse networks have lower class specialization compared to dense networks $\chi ^ { 2 } ( 5 ) = 4 . 4 3 , p = 0 . 0 3 \bar { 5 }$ , for VGG-D and WRN-28-2 we find strong evidence that features of sparse networks have lower class specialization than dense networks $\bar { \chi } ^ { 2 } ( 1 3 ) = 2 8 . 1 , p < 0 . 0 0 1$ , $\bar { \chi ^ { 2 } } ( 1 2 ) = 3 6 . 2 , p < 0 . 0 0 1$ . Thus we reject the null hypothesis. These results increase our confidence that sparse networks learn features which have lower class specialization than dense networks.
+
+Plots of the distributions of sparse vs. dense features for AlexNet-s, VGG16-D, and WRN 28-2 on CIFAR-10 in Figure 5. These plots were selected to highlight the difference in distribution in the first layers and last layers of each network. We see the convolutional channels in sparse networks have lower class-specialization indicating they learn features which are useful for a broader range of classes compared to dense networks. This trend intensifies with depth.
+
+Overall, we conclude that sparse networks might be able to rival dense networks by learning more general features that have lower class specialization.
+
+# C FURTHER RESULTS
+
+# C.1 TUNED RESNET-50 ON IMAGENET
+
+We also tried a better version of the ResNet-50 in the fully sparse setting for which we use a cosine learning rate schedule, label smoothing of 0.9, and we warmup the learning rate. The results can be seen in Table 5.
+
+Table 5: Fully sparse ImageNet results.
+
+
Model
Accuracy (%)
Weights (%) Top-1
Top-5
Tuned ResNet-50
100
77.0 93.5
Sparse momentum
10
72.9 91.5
20
74.9 92.5
30
75.9 92.9
+
+# D DETAILED SPARSE MOMENTUM ALGORITHM
+
+For a detailed NumPy-style algorithmic description of sparse momentum see Algorithm 2.
+
+
+Figure 5: Dense vs sparse histograms of class-specialization for convolutional channels on CIFAR-10. A class-specialization of 0.5 indicates that $50 \%$ of the overall activity comes from a single class.
+
+Algorithm 2: Sparse momentum algorithm in NumPy notation. Data: Layer i to k with: Momentum $\mathbf { M } _ { i }$ , Weight $\overline { { \mathbf { W } _ { \mathbf { i } } } }$ , binary $\mathbf { M a s k } _ { i }$ ; prune rate $p$ 1 TotalMomentum $\gets 0$ , TotalNonzero $ 0$ $/ \star$ (a) Calculate mean momentum contributions of all layers. \*/ 2 for $i \gets 0$ to $k$ do 3 MeanMomentum $_ i $ mean(a $\mathbf { b s } ( \mathbf { M } _ { i } \left[ \mathbf { W } _ { i } \neq 0 \right] ) _ { . }$ ) 4 TotalMomentum $\gets$ TotalMomentum $^ +$ MeanMomentumi 5 $\mathrm { N o n } Z \mathrm { e r o } _ { i } = \mathrm { s u m } ( \mathbf { W } _ { i } \neq 0 )$ 6 TotalNonzero TotalNonzero + NonZeroi 7 end 8 for $i \gets 0$ to $k$ do 9 LayerContribution $_ { \cdot i } \gets$ MeanMomentumi/TotalMomentum 10 $p _ { i } \gets$ getPruneRate $( \mathbf { W } _ { i } , p )$ 11 weights by finding the NumRemoveth smallest weight. 12 end 13 for $i \gets 0$ to $k$ do 14 NumRemove $\mathbf { \Sigma } _ { i } \mathrm { N o n Z e r o } _ { i } \cdot p$ 15 PruneThreshold $ \mathrm { s o r t } ( \mathrm { a b s } ( \mathbf W _ { i } [ \mathbf W _ { i } \neq 0 ] )$ ) [NumRemovei] 16 $\mathbf { M a s k } _ { i }$ $[ \mathbf { W } _ { i } <$ PruneThreshold] $ 0$ // Stop gradient flow. 17 $\mathbf { W } _ { i }$ $[ \mathbf { W } _ { i } <$ PruneThreshold] $\gets 0$ 18 end /\* (c) Enable gradient flow of weights with largest momentum magnitude. \*/ 19 for $i \gets 0$ to $k$ do 20 RegrowthThresh $\mathrm { \mathbf { \tau } _ { \mathrm { 1 } } } \mathbf { d } _ { i } \gets \mathrm { \mathbf { \mathrm { s o r t } } } ( \mathbf { \mathrm { a b s } } ( \mathbf { M } _ { i } \left[ \mathbf { W } _ { i } = = 0 \right] )$ ) [NumRegrowthi] 21 $\mathbf { Z } _ { i } = \mathbf { M } _ { i }$ · $\mathbf { W } _ { i } = = 0$ ) // Only consider the momentum of missing weights. 22 $\mathbf { M } \mathbf { a s } \mathbf { k } _ { i } \gets \mathbf { M } \mathbf { a s } \mathbf { k } _ { i }$ | ( $\mathbf { Z } _ { i } >$ RegrowthThreshold ) // | is the boolean OR operator 23 end 24 $p $ decayPruneRate(p) 25 applyMask()
\ No newline at end of file
diff --git a/md/train/BygdyxHFDS/BygdyxHFDS.md b/md/train/BygdyxHFDS/BygdyxHFDS.md
new file mode 100644
index 0000000000000000000000000000000000000000..df8b398365d1f976b6f77c6ffae79533afe214f2
--- /dev/null
+++ b/md/train/BygdyxHFDS/BygdyxHFDS.md
@@ -0,0 +1,367 @@
+# META-LEARNING CURIOSITY ALGORITHMS
+
+Ferran Alet∗, Martin F. Schneider∗, Tomas Lozano-P ´ erez & Leslie Pack Kaelbling ´
+
+Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02139, USA {alet,martinfs,tlp,lpk}@mit.edu
+
+# ABSTRACT
+
+We hypothesize that curiosity is a mechanism found by evolution that encourages meaningful exploration early in an agent’s life in order to expose it to experiences that enable it to obtain high rewards over the course of its lifetime. We formulate the problem of generating curious behavior as one of meta-learning: an outer loop will search over a space of curiosity mechanisms that dynamically adapt the agent’s reward signal, and an inner loop will perform standard reinforcement learning using the adapted reward signal. However, current meta-RL methods based on transferring neural network weights have only generalized between very similar tasks. To broaden the generalization, we instead propose to meta-learn algorithms: pieces of code similar to those designed by humans in ML papers. Our rich language of programs combines neural networks with other building blocks such as buffers, nearest-neighbor modules and custom loss functions. We demonstrate the effectiveness of the approach empirically, finding two novel curiosity algorithms that perform on par or better than human-designed published curiosity algorithms in domains as disparate as grid navigation with image inputs, acrobot, lunar lander, ant and hopper.
+
+# 1 INTRODUCTION
+
+When a reinforcement-learning agent is learning to behave, it is critical that it both explores its domain and exploits its rewards effectively. One way to think of this problem is in terms of curiosity or intrisic motivation: constructing reward signals that augment or even replace the extrinsic reward from the domain, which induce the RL agent to explore their domain in a way that results in effective longer-term learning and behavior (Pathak et al., 2017; Burda et al., 2018; Oudeyer, 2018). The primary difficulty with this approach is that researchers are hand-designing these strategies: it is difficult for humans to systematically consider the space of strategies or to tailor strategies for the distribution of environments an agent might be expected to face.
+
+We take inspiration from the curious behavior observed in young humans and other animals
+
+
+Figure 1: Our RL agent is augmented with a curiosity module, obtained by meta-learning over a complex space of programs, which computes a pseudo-reward $\widehat { r }$ at every time step.
+
+and hypothesize that curiosity is a mechanism found by evolution that encourages meaningful exploration early in an agent’s life. This exploration exposes it to experiences that enable it to learn to obtain high rewards over the course of its lifetime. We propose to formulate the problem of generating curious behavior as one of meta-learning: an outer loop, operating at “evolutionary” scale will search over a space of algorithms for generating curious behavior by dynamically adapting the agent’s reward signal, and an inner loop will perform standard reinforcement learning using the adapted reward signal. This process is illustrated in figure 1; note that the aggregate agent, outlined in gray, has the standard interface of an RL agent. The inner RL algorithm is continually adapting to its input stream of states and rewards, attempting to learn a policy that optimizes the discounted sum of proxy rewards $\textstyle \sum _ { k \geq 0 } \gamma ^ { k } \widehat { r } _ { t + k }$ . The outer “evolutionary” search is attempting to find a program for the curiosity module, so as to optimize the agent’s lifetime return $\textstyle \sum _ { t = 0 } ^ { T } r _ { t }$ , or another global objective like the mean performance on the last few trials.
+
+In this meta-learning setting, our objective is to find a curiosity module that works well given a distribution of environments from which we can sample at meta-learning time. Meta-RL has been widely explored recently, in some cases with a focus on reducing the amount of experience needed by initializing the RL algorithm well (Finn et al., 2017; Clavera et al., 2019) and, in others, for efficient exploration (Duan et al., 2016; Wang et al., 2017). The environment distributions in these cases have still been relatively low-diversity, mostly limited to variations of the same task, such as exploring different mazes or navigating terrains of different slopes. We would like to discover curiosity mechanisms that can generalize across a much broader distribution of environments, even those with different state and action spaces: from image-based games, to joint-based robotic control tasks. To do that, we perform meta-learning in a rich, combinatorial, open-ended space of programs.
+
+This paper makes three novel contributions.
+
+We focus on a regime of meta-reinforcement-learning in which the possible environments the agent might face are dramatically disparate and in which the agent’s lifetime is very long. This is a substantially different setting than has been addressed in previous work on meta-RL and it requires substantially different techniques for representation and search.
+
+We propose to do meta-learning in a rich, combinatorial space of programs rather than transferring neural network weights. The programs are represented in a domain-specific language (DSL) which includes sophisticated building blocks including neural networks complete with gradient-descent mechanisms, learned objective functions, ensembles, buffers, and other regressors. This language is rich enough to represent many previously reported hand-designed exploration algorithms. We believe that by performing meta-RL in such a rich space of mechanisms, we will be able to discover highly general, fundamental curiosity-based exploration methods. This generality means that a relatively computationally expensive meta-learning process can be amortized over the lifetimes of many agents in a wide variety of environments.
+
+We make the search over programs feasible with relatively modest amounts of computation. It is a daunting search problem to find a good solution in a combinatorial space of programs, where evaluating a single potential solution requires running an RL algorithm for up to millions of time steps. We address this problem in multiple ways. By including environments of substantially different difficulty and character, we can evaluate candidate programs first on relatively simple and short-horizon domains: if they don’t perform well in those domains, they are pruned early, which saves a significant amount of computation time. In addition, we predict the performance of an algorithm from its structure and operations, thus trying the most promising algorithms early in our search. Finally, we also monitor the learning curve of agents and stop unpromising programs before they reach all $T$ environment steps.
+
+We demonstrate the effectiveness of the approach empirically, finding curiosity strategies that perform on par or better than those in published literature. Interestingly, the top 2 algorithms, to the best of our knowledge, had not been proposed before, despite making sense in hindsight. We conjecture the first one (shown in figure 3) is deceptively simple and that the complexity of the other one (figure 10 in the appendix) makes it relatively implausible for humans to discover.
+
+# 2 PROBLEM FORMULATION
+
+# 2.1 META-LEARNING PROBLEM
+
+Let us assume we have an agent equipped with an RL algorithm (such as DQN or PPO, with all hyperparameters specified), $\mathcal { A }$ , which receives states and rewards from and outputs actions to an environment $\mathcal { E }$ , generating a stream of experienced transitions $e ( \boldsymbol { \mathcal { A } } ; \boldsymbol { \mathcal { E } } ) _ { t } = ( s _ { t } , a _ { t } , \bar { r } _ { t } , s _ { t + 1 } )$ . The agent continually learns a policy $\pi ( t ) : s _ { t } \to a _ { t }$ , which will change in time as described by algorithm $\mathcal { A }$ ;
+
+so $\pi ( t ) = \boldsymbol { \mathcal { A } } ( e _ { 1 : t - 1 } )$ and thus $a _ { t } \sim \mathcal { A } ( e _ { 1 : t - 1 } ) ( s _ { t } )$ . Although this need not be the case, we can think of $\mathcal { A }$ as an algorithm that tries to maximize the discounted reward $\textstyle \sum _ { i } \gamma ^ { i } r _ { t + i } , \gamma < 1$ and that, at any time-step $t$ , always takes the greedy action that maximizes its estimated expected discounted reward.
+
+To add exploration to this policy, we include a curiosity module $\mathcal { C }$ that has access to the stream of state transitions $e _ { t }$ experienced by the agent and that, at every time-step $t$ , outputs a proxy reward $\widehat { r } _ { t }$ . We connect this module so that the original RL agent receives these modified rewards, thus bobserving $e ( \boldsymbol { A } , \mathcal { C } ; \mathcal { E } ) _ { t } = ( s _ { t } , a _ { t } , \widehat { r } _ { t } = \mathcal { C } ( \bar { e _ { 1 : t - 1 } } ) , s _ { t + 1 } ) $ , without having access to the original $r _ { t }$ . bNow, even though the inner RL algorithm acts in a purely exploitative manner with respect to $\widehat { r }$ , it may efficiently explore in the outer environment.
+
+Our overall goal is to design a c osity module $\mathcal { C }$ that induces the agent to maximize $\textstyle \sum _ { t = 0 } ^ { T } r _ { t }$ , for $T$
+episodic problem, $T$ will span many episodes. More formally, given a single environment $\mathcal { E }$ , RL algorithm $\mathcal { A }$ , and curiosity module $\mathcal { C }$ , we can see the triplet (environment, curiosity module, agent) as a dynamical system that induces state transitions for the environment, and learning updates for the curiosity module and the agent. Our objective is to find $\mathcal { C }$ that maximizes the expected original reward obtained by the composite system in the environment. Note that the expectation is over two different distributions at different time scales: there is an “outer” expectation over environments $\mathcal { E }$ , and in “inner” expectation over the rewards received by the composite system in that environment, so our final objective is:
+
+$$
+\operatorname* { m a x } _ { \mathcal { C } } \left[ \mathbb { E } _ { \mathcal { E } } \left[ \mathbb { E } _ { r _ { t } \sim e ( A , \mathcal { C } ; \mathcal { E } ) } \left[ \sum _ { t = 0 } ^ { T } r _ { t } \right] \right] \right] \ .
+$$
+
+# 2.2 PROGRAMS FOR CURIOSITY
+
+In science and computing, mathematical language has been very successful in describing varied phenomena and powerful algorithms with short descriptions. As Valiant points out: “the power [of mathematics and algorithms] comes from the implied generality, that knowledge of one equation alone will allow one to make accurate predictions about a host of situations not even conceived when the equation was first written down” (Valiant, 2013). Therefore, in order to obtain curiosity modules that can generalize over a very broad range of tasks and that are sophisticated enough to provide exploration guidance over very long horizons, we describe them in terms of general programs in a domain-specific language. Algorithms in this language will map a history of $( s _ { t } , s _ { t + 1 } , a _ { t } , r _ { t } )$ tuples into a proxy reward $\widehat { r } _ { t }$ .
+
+Inspired by human-designed systems that compute and use intrinsic rewards, and to simplify the search, we decompose the curiosity module into two components: the first, $I$ , outputs an intrinsic reward value $i _ { t }$ based on the current experienced transition $\left( { { s _ { t } } , { a _ { t } } , { s _ { t + 1 } } } \right)$ (and past transitions $\left( s _ { 1 : t - 1 } , a _ { 1 : t - 1 } \right)$ indirectly through its memory); the second, $\chi$ , takes the current time-step $t$ , the actual reward $r _ { t }$ , and the intrinsic reward $i _ { t }$ (and, if it chooses to store them, their histories) and combines them to yield the proxy reward $\widehat { r _ { t } }$ . To ease generalization across different timescales, in practice, before feeding $t$ into $\chi$ bwe normalize it by the total length of the agent’s lifetime, $T$ .
+
+Both programs consist of a directed acyclic graph (DAG) of modules with polymorphically typed inputs and outputs. As shown in figure 2, there are four classes of modules:
+
+• Input modules (shown in blue), drawn from the set $\left\{ { { s } _ { t } } , { { a } _ { t } } , { { s } _ { t + 1 } } \right\}$ for the $I$ component and from the set $\{ i _ { t } , r _ { t } \}$ for the $\chi$ component. They have no inputs, and their outputs have the type corresponding to the types of states and actions in whatever domain they are applied to, or the reals numbers for rewards. Buffer and parameter modules (shown in gray) of two kinds: FIFO queues that provide as output a finite list of the $k$ most recent inputs, and neural network weights initialized at random at the start of the program and which may (pink border) or may not (black border) get updated via back-propagation depending on the computation graph.
+• Functional modules (shown in white), which compute output values given the inputs from their parent modules.
+
+
+Figure 2: Example diagrams of published algorithms covered by our language (larger figures in the appendix). The green box represents the output of the intrinsic curiosity function, the pink box is the loss to be minimized. Pink arcs represent paths and networks along which gradients flow back from the minimizer to update parameters.
+
+• Update modules (shown in pink), which are functional modules (such as $\mathbf { k }$ -NearestNeighbor) that either add variables to buffers or modules which add real-valued outputs to a global loss that will provide error signals for gradient descent.
+
+A single node in the DAG is designated as the output node (shown in green): the output of this node is considered to be the output of the entire program, but it need not be a leaf node of the DAG.
+
+On each call to a program (corresponding to one time-step of the system) the current input values and parameter values are propagated through the functional modules, and the output node’s output is given to the RL algorithm. Before the call terminates, the FIFO buffers are updated and the adjustable parameters are updated via gradient descent using the Adam optimizer (Kingma & Ba, 2014). Most operations are differentiable and thus able to propagate gradients backwards. Some operations are not differentiable, including buffers (to avoid backpropagating through time) and ”Detach” whose purpose is stopping the gradient from flowing back. In practice, we have multiple copies of the same agent running at the same time, with both a shared policy and shared curiosity module. Thus, we execute multiple reward predictions on a batch and then update on a batch.
+
+Programs representing several published designs for curiosity modules that perform internal gradient descent, including inverse features (Pathak et al., 2017), random network distillation (RND) (Burda et al., 2018), and ensemble predictive variance (Pathak et al., 2019), are shown in figure 2 (bigger versions can be found in appendix A.3). We can also represent algorithms similar to novelty search (Lehman & Stanley, 2008) and $E X ^ { 2 }$ (Fu et al., 2017), which include buffers and nearest neighbor regression modules. Details on the data types and module library are given in appendix A.
+
+A crucial, and possibly somewhat counter-intuitive, aspect of these programs is their use of neural network weight updates via gradient descent as a form of memory. In the parameter update step, all adjustable parameters are decremented by the gradient of the sum of the outputs of the loss modules, with respect to the parameters. This type of update allows the program to, for example, learn to make some types of predictions, online, and use the quality of those predictions in a state to modulate the proxy reward for visiting that state (as is done, for example, in RND).
+
+Key to our program search are polymorphic data types: the inputs and outputs to each module are typed, but the instantiation of some types, and thus of some operations, depends on the environment. We have four types: reals $\mathbb { R }$ , state space of the given environment $\mathbb { S }$ , action space of the given environment A and feature space $\mathbb { F }$ , used for intermediate computations and always set to $\mathbb { R } ^ { 3 2 }$ in our current implementation. For example, a neural network module going from $\mathbb { S }$ to $\mathbb { F }$ will be instantiated as a convolutional neural network if $\mathbb { S }$ is an image and as a fully connected neural network of the appropriate dimension if $\mathbb { S }$ is a vector. Similarly, if we are measuring an error in action space A we use mean-squared error for continuous action spaces and negative log-likelihood for discrete action spaces. This facility means that the same curiosity program can be applied, independent of whether states are represented as images or vectors, or whether the actions are discrete or continuous, or the dimensionality of either.
+
+This type of abstraction enables our meta-learning approach to discover curiosity modules that generalize radically, applying not just to new tasks, but to tasks with substantially different input and output spaces than the tasks they were trained on.
+
+To clarify the semantics of these programs, we walk through the operation of the RND program in figure 2. Its only input is $s _ { t + 1 }$ , which might be an image or an input vector, which is processed by two NNs with parameters $\Theta _ { 1 }$ and $\Theta _ { 2 }$ , respectively. The structure of the NNs (and, hence, the dimensions of the $\Theta _ { i }$ ) depends on the type of $s _ { t + 1 }$ : if $s _ { t + 1 }$ is an image, then they are CNNs, otherwise a fully connected networks. Each NN outputs a 32-dimensional vector; the $L _ { 2 }$ distance between these vectors is the output of the program on this iteration, and is also the input to a loss module. So, given an input $s _ { t + 1 }$ , the output intrinsic reward is large if the two NNs generate different outputs and small otherwise. After each forward pass, the weights in $\Theta _ { 2 }$ are updated to minimize the loss while $\Theta _ { 1 }$ remains constant, which causes the trainable NN to mimic the output of the randomly initialized NN. As the program’s ability to predict the output of the randomized NN on an input improves, the intrinsic reward for visiting that state decreases, driving the agent to visit new states.
+
+To limit the search space and prioritize short, meaningful programs we limit the total number of modules of the computation graph to 7. Our language is expressive enough to describe many (but far from all) curiosity mechanisms in the existing literature, as well as many other potential alternatives, but the expressiveness leads to a very large search space. Additionally, removing or adding a single operation can drastically change the behavior of a program, making the objective function nonsmooth and, therefore, the space hard to search. In the next section we explore strategies for speeding up the search over tens of thousands of programs.
+
+# 3 IMPROVING THE EFFICIENCY OF OUR SEARCH
+
+We wish to find curiosity programs that work effectively in a wide range of environments, from simple to complex. However, evaluating tens of thousands of programs in the most expensive environments would consume decades of GPU computation. Therefore, we designed multiple strategies for quickly discarding less promising programs and focusing computation on a few promising programs. In doing so, we take inspiration from efforts in the AutoML community (Hutter et al., 2018).
+
+We divide these pruning efforts into three categories: simple tests that are independent of running the program in any environment, “filtering” by ruling out some programs based on poor performance in simple environments, and “meta-meta-RL”: learning to predict which curiosity programs will produce good RL agents based on syntactic features.
+
+# 3.1 PRUNING INVALID ALGORITHMS WITHOUT RUNNING THEM
+
+Many programs are obviously bad curiosity programs. We have developed two heuristics to immediately prune these programs without an expensive evaluation.
+
+• Checking that programs are not duplicates. Since our language is highly expressive, there are many non-obvious ways of getting equivalent programs. To find duplicates, we designed a randomized test where we identically seed two programs, feed them both identical fake environment data for tens of steps and check whether their outputs are identical. Checking that the loss functions cannot be minimized independently of the input data. Many programs optimize some loss depending on neural network regressors. If we treat inputs as uncontrollable variables and networks as having the ability to become any possible function, then for every variable, we can determine whether neural networks can be optimized to minimize it, independently of the input data. For example, if our loss function is $| N N _ { \theta } ( s ) | ^ { 2 }$ the neural network can learn to make it 0 by disregarding $s$ and optimizing the weights $\theta$ to 0. We discard any program that has this property.
+
+# 3.2 PRUNING ALGORITHMS IN CHEAP ENVIRONMENTS
+
+Our ultimate goal is to find algorithms that perform well on many different environments, both simple and complex. We make two key observations. First, there may be only tens of reasonable programs that perform well on all environments but hundreds of thousands of programs that perform poorly. Second, there are some environments that are solvable in a few hundred steps while others require tens of millions. Therefore, a key idea in our search is to try many programs in cheap environments and only a few promising candidates in the most expensive environments. This was inspired by the effective use of sequential halving (Karnin et al., 2013) in hyper-parameter optimization (Jamieson & Talwalkar, 2016).
+
+By pruning programs aggressively, we may be losing multiple programs that perform well on complex environments. However, by definition, these programs will tend to be less general and robust than those that succeed in all environments. Moreover, we seek generalization not only for its own sake, but also to ease the search since, even if we only cared about the most expensive environment, performing the complete search only in this environment would be impractical.
+
+# 3.3 PREDICTING ALGORITHM PERFORMANCE
+
+Perhaps surprisingly, we find that we can predict program performance directly from program structure. Our search process bootstraps an initial training set of (program structure, program performance) pairs, then uses this training set to select the most promising next programs to evaluate. We encode each program’s structure with features representing how many times each operation is used, thus having as many features as number of operations in our vocabulary. We use a $k$ -nearestneighbor regressor, with $k = 1 0$ . We then try the most promising programs and update the regressor with their results. Finally, we add an $\epsilon$ -greedy exploration policy to make sure we explore all the search space. Even though the correlation between predictions and actual values is only moderately high (0.54 on a holdout test), this is enough to discover most of the top programs searching only half of the program space, which is our ultimate goal. Results are shown in appendix C.
+
+We can also prune algorithms during the training process of the RL agent. In particular, at any point during the meta-search, we use the top $K$ current best programs as benchmarks for all $T$ timesteps. Then, during the training of a new candidate program we compare its current performance at time $t$ with the performance at time $t$ of the top $K$ programs and stop the run if its performance is significantly lower. If the program is not pruned and reaches the final time-step $T$ with one of the top $K$ performances, it becomes part of the benchmark for the future programs.
+
+# 4 EXPERIMENTS
+
+Our RL agent uses PPO (Schulman et al., 2017) based on the implementation by Kostrikov (2018) in PyTorch (Paszke et al., 2017). Our code (https://github.com/mfranzs/ meta-learning-curiosity-algorithms) can take in any OpenAI gym environment (Brockman et al., 2016) with a specification of the desired exploration horizon $T$ .
+
+We evaluate each curiosity algorithm for multiple trials, using a seed dependent on the trial but independent of the algorithm, which leads to the PPO weights and curiosity data-structures being initialized identically on the same trials for all algorithms. As is common in PPO, we run multiple rollouts (5, except for MuJoCo which only has 1), with independent experiences but shared policy and curiosity modules. Curiosity predictions and updates are batched across these rollouts, but not across time. PPO policy updates are batched both across rollouts and multiple timesteps.
+
+# 4.1 FIRST SEARCH PHASE IN SIMPLE ENVIRONMENT
+
+We start by searching for a good intrinsic curiosity program $I$ in a purely exploratory environment, designed by Chevalier-Boisvert et al. (2018), which is an image-based grid world where agents navigate in an image of a 2D room either by moving forward in the grid or rotating left or right. We optimize the total number of distinct cells visited across the agent’s lifetime. This allows us to evaluate intrinsic reward programs in a fast and simple environment, without worrying about combining it with external reward.
+
+To bias towards simple, interpretable algorithms and keep the search space manageable, we search for programs with at most 7 operations. We first discard duplicate and invalid programs, as described in section 3.1, resulting in about 52,000 programs. We then randomly split the programs across 4 machines, each with 8 Nvidia Tesla K80 GPUs for 10 hours; thus a total of 13 GPU days.
+
+Each machine finds the highest-scoring 625 programs in its section of the search space and prunes programs whose partial learning curve is statistically significantly lower than the current top 625 programs. To do so, after every episode of every trial, we check whether $m e a n _ { p r o g r a m } ( s t e p ) \leq$ $m e a n _ { t o p 6 2 5 } ( s t e p ) - 2 s t d _ { t o p 6 2 5 } - s t d _ { p r o g r a m }$ .Thus, we account for both inter-program variability among the top 625 programs and intra-program variability among multiple trials of the same program.
+
+We use a 10-nearest-neighbor regressor to predict program performance and choose the next program to evaluate with an $\epsilon$ -greedy strategy, choosing the best predicted program ${ \dot { 9 } } 0 \%$ of the time and a random program $1 \bar { 0 } \%$ of the time. By doing this, we try the most promising programs early in our search. This is important for two reasons: first, we only try 26,000 programs, half of the whole search space, which we estimated from earlier results (shown in figure 8 in the appendix) would be enough to get $8 8 \%$ of the top $1 \%$ of programs. Second, the earlier we run our best programs, the higher the bar for later programs, thus allowing us to prune them earlier, further saving computation time. Searching through this space took a total of 13 GPU days. As shown in figure 9 in the appendix, we find that most programs perform relatively poorly, with a long tail of programs that are statistically significantly better, comprising roughly $0 . 5 \%$ of the whole program space.
+
+
+Figure 3: Fast Action-Space Transition(FAST): top-performing intrinsic curiosity algorithm discovered in our phase 1 search.
+
+The highest scoring program (a few other programs have lower average performance but are statistically equivalent) is surprisingly simple and meaningful, comprised of only 5 operations, even though the limit was 7. This program, which we call FAST (Fast Action-Space Transition), is shown in figure 3; it trains a single neural network (a CNN or MLP depending on the type of state) to predict the action from $s _ { t + 1 }$ and then compares its predictions based on $s _ { t + 1 }$ with its predictions based on $s _ { t }$ , generating high intrinsic reward when the difference is large. The action prediction loss module either computes a softmax followed by NLL loss or appends zeros to the action to match dimensions and applies MSE loss, depending on the type of the action space. Note that this is not the same as rewarding taking a different action in the previous time-step. The network predicting the action is learning to imitate the policy learned by the internal RL agent, because the curiosity module does not have direct access to the RL agent’s internal state.
+
+Of the top 16 programs, 13 are variants of FAST, including versions that predict the action from $s _ { t }$ instead of $s _ { t + 1 }$ . The other 3 are variants of a more complex program that is hard to understand at first glance, but we finally determined to be using ideas similar to cycle-consistency in the GAN literature Zhu et al. (2017) (we thus name it Cycle-consistency intrinsic motivation); the diagram and explanation are in figure 10 in the appendix. Interestingly, to the best of our knowledge neither algorithm had been proposed before: we conjecture the former was too simple for humans to believe it would be effective and the latter too hard for humans to design, as it was already very hard to understand in hindsight.
+
+# 4.2 TRANSFERRING TO NEW ENVIRONMENTS
+
+Our reward combiner was developed in lunar lander (the simplest environment with meaningful extrinsic reward) based on the best program among a preliminary set of 16,000 programs (which resembled Random Network Distillation; its computation graph is shown in appendix E). Among a set of 2,500 candidates (with 5 or fewer operations) the best reward combiner discovered by our search was $\begin{array} { r } { \widehat { r _ { t } } = \frac { ( 1 + i _ { t } - t / T ) \cdot i _ { t } + t / T \cdot r _ { t } } { 1 + i _ { t } } } \end{array}$ . Notice that for $0 < i _ { t } \ll 1$ (usually the case) this is approximately $\widehat { r _ { t } } \approx i _ { t } ^ { 2 } + ( 1 - t / T ) i _ { t } + ( t / T ) r _ { t }$ , which is a down-scaled version of intrinsic reward plus a linear binterpolation that ranges from all intrinsic reward at $t = 0$ to all extrinsic reward at $t = T$ . In future work, we hope to co-adapt the search for intrinsic reward programs and combiners as well as find multiple reward combiners.
+
+
+Figure 4: Correlation between program performance in gridworld and in harder environments (lunar lander on the left, acrobot on the right), using the top 2,000 programs in gridworld. Performance is evaluated using mean reward across all learning episodes, averaged over trials (two trials for acrobot / lunar lander and five for gridworld). The high number of algorithms performing around -300 in the middle of the right plot is an artifact of averaging the performance of two seeds and the mean performance in Acrobot having two peaks. Almost all intrinsic curiosity programs that had statistically significant performance for grid world also do well on the other two environments. In green, the performance of three published works; in increasing gridworld performance: disagreement (Pathak et al., 2019), inverse features (Pathak et al., 2017) and random distillation (Burda et al., 2018).
+
+Given the fixed reward combiner and the list of 2,000 selected programs found in the image-based grid world, we evaluate the programs on both lunar lander and acrobot, in their discrete action space versions. Notice that both environments have much longer horizons than the image-based grid world (37,500 and 50,000 vs 2,500) and they have vector-based, rather than image-based, inputs. The results in figure 4 show good correlation between performance on grid world and on each of the new environments. Especially interesting is that, for both environments, when intrinsic reward in grid world is above 400 (the lowest score that is statistically significantly good), performance on the other two environments is also good in more than $9 0 \%$ of cases.
+
+Finally, we evaluate on two MuJoCo environments (Todorov et al., 2012): hopper and ant. These environments have more than an order of magnitude longer exploration horizon than acrobot and lunar lander, exploring for 500K time-steps, as well as continuous action-spaces instead of discrete. We then compare the best 16 programs on grid world (most of which also did well on lunar lander and acrobot) to four weak baselines (constant 0,-1,1 intrinsic reward and Gaussian noise reward) and three published algorithms expressible in our language (shown in figure 2). We run two trials for each algorithm and pool all results in each category to get a confidence interval for the mean of that category. All trials used the reward combiner found on lunar lander. For both environments we find that the performance of our top programs is statistically equivalent to published work and significantly better than the weak baselines, confirming that we meta-learned good curiosity programs.
+
+Note that we meta-trained our intrinsic curiosity programs only on one environment (GridWorld) and showed they generalized well to other very different environments: they perform better than published works in this meta-train task and one meta-test task (Acrobot) and on par in the other 3 tasks meta-test tasks. Adding more meta-training tasks would be as simple as standardising the perfor
+
+
Class
Ant
Hopper
Baseline algorithms
[-95.3, -39.9]
[318.5, 525.0]
Meta-learned algorithms
[+67.5, +80.0]
[589.2, 650.6]
Published algorithms
[+67.4, +98.8]
[627.7, 692.6]
+
+Table 1: Meta-learned algorithms perform significantly better than constant rewards and statistically equivalently to published algorithms found by human researchers (see 2). The table shows the confidence interval (one standard deviation) for the mean performance (across trials, across algorithms) for each algorithm category. Performance is defined as mean episode reward for all episodes.
+
+mance within each task (to make results comparable) and then selecting the programs with best mean performance. We chose to only meta-train on a single, simple, task because it (surprisingly!) already gave great results, highlighting the broad generalization of meta-learning program representations.
+
+# 5 RELATED WORK
+
+In some regards our work is similar to neural architecture search (NAS) (Stanley & Miikkulainen, 2002; Zoph & Le, 2016; Elsken et al., 2018; Pham et al., 2018) or hyperparameter optimization for deep networks (Mendoza et al., 2016), which aim at finding the best neural network architecture and hyper-parameters for a particular task. However, in contrast to most (but not all, see Zoph et al. (2018)) NAS work, we want to generalize to many environments instead of just one. Moreover, we search over programs, which include non-neural operations and data structures, rather than just neural-network architectures, and decide what loss functions to use for training. Our work also resembles work in the AutoML community (Hutter et al., 2018) that searches in a space of programs, for example in the case of SAT solving (KhudaBukhsh et al., 2009) or auto-sklearn (Feurer et al., 2015) and concurrent work on learning loss functions to replace cross-entropy for training a fixed architecture on MNIST and CIFAR (Gonzalez & Miikkulainen, 2019; 2020). Although we took inspiration from ideas in that community (Jamieson & Talwalkar, 2016; Li et al., 2016), our algorithms specify both how to compute their outputs and their own optimization objectives in order to work well in synchrony with an expensive deep RL algorithm.
+
+There has been work on meta-learning with genetic programming (Schmidhuber, 1987), searching over mathematical operations within neural networks (Ramachandran et al., 2017; Gaier & Ha, 2019), searching over programs to solve games (Wilson et al., 2018; Kelly & Heywood, 2017; Silver et al., 2019) and to optimize neural networks (Bengio et al., 1995; Bello et al., 2017), and neural networks that learn programs (Reed & De Freitas, 2015; Pierrot et al., 2019). Our work uses neural networks as basic operations within larger algorithms. Finally, modular meta-learning (Alet et al., 2018; 2019) trains the weights of small neural modules and transfers to new tasks by searching for a good composition of modules; as such, it can be seen as a (restricted) dual of our approach.
+
+There has been much interesting work in designing intrinsic curiosity algorithms. We take inspiration from many of them to design our domain-specific language. In particular, we rely on the idea of using neural network training as an implicit memory, which scales well to millions of time-steps, as well as buffers and nearest-neighbour regressors. As we showed in figure 2 we can represent several prominent curiosity algorithms. We can also generate meaningful algorithms similar to novelty search (Lehman & Stanley, 2008) and $E X ^ { 2 }$ $\mathrm { F u }$ et al., 2017); which include buffers and nearest neighbours. However, there are many exploration algorithm classes that we do not cover, such as those focusing on generating goals (Srivastava et al., 2013; Kulkarni et al., 2016; Florensa et al., 2018), learning progress (Oudeyer et al., 2007; Schmidhuber, 2008; Azar et al., 2019), generating diverse skills (Eysenbach et al., 2018), stochastic neural networks (Florensa et al., 2017; Fortunato et al., 2017), count-based exploration (Tang et al., 2017) or object-based curiosity measures (Forestier & Oudeyer, 2016). Finally, part of our motivation stems from Ta¨ıga et al. (2019) showing that some bonus-based curiosity algorithms have trouble generalising to new environments.
+
+There have been research efforts on meta-learning exploration policies: Duan et al. (2016); Wang et al. (2017) learn an LSTM that explores an environment for one episode, retains its hidden state and is spawned in a second episode in the same environment; by training the network to maximize the reward in the second episode alone it learns to explore efficiently in the first episode. Stadie et al. (2018) improves their exploration and that of Finn et al. (2017) by considering the importance of sampling in RL policies. Gupta et al. (2018) combine gradient-based meta-learning with a learned latent exploration space in which they add structured noise for meaningful exploration. Closer to our formulation, Zheng et al. (2018) parametrize an intrinsic reward function which influences policygradient updates in a differentiable manner, allowing them to backpropagate through a single step of the policy-gradient update to optimize the intrinsic reward function for a single task. In contrast to all three of these methods, we search over algorithms, which will allows us to generalize more broadly and to consider the effect of exploration on up to $1 0 ^ { 5 } - 1 0 ^ { 6 }$ time-steps instead of the $1 0 ^ { 2 } - 1 0 ^ { 3 }$ of previous work. Finally, Chiang et al. (2019); Faust et al. (2019) have a setting similar to ours where they modify reward functions over the entire agent’s lifetime, but instead of searching over intrinsic curiosity algorithms they tune the parameters of a hand-designed reward function.
+
+Related work on meta-learning (Schmidhuber, 1987; Thrun & Pratt, 1998; Clune, 2019) and efforts to increase its generalization can be found in appendix B. Closest to our work, evolved policy gradients (EPG, Houthooft et al. (2018)) use evolutionary strategies to meta-learn a neural network that acts as a loss function and is used to train a policy network. EPG generalizes by meta-training with target locations east of the start location and meta-testing with target locations to the west. In contrast, we showed that by meta-learning programs, we can generalize between radically different environments, not just goal variations of a single environment. Concurrent to our work, Kirsch et al. (2019) also show generalization capabilities between environments similar to ours (lunar lander, hopper and half-cheetah). Their approach transfers a parametric representation, for which it is unclear how to adapt the learned neural losses to an unseen environment with a different observation space. Their approach thus does not encode states into the loss function, which is critical for efficient exploration. In contrast, our algorithms can leverage polymorphic data types that adapt the neural networks to the environment they are running in, adapting both the size and the type of network (CNN vs MLP) running in each environment.
+
+# 6 CONCLUSIONS
+
+In this work, we proposed to meta-learn algorithms and show that by transferring programs we can generalize between tasks much more varied than previously possible in meta-RL, even between those with different input or output spaces. In many settings, however, the input and output space remain the same as we change tasks. This opens the possibility of getting the best of both worlds by meta-learning weights along with structure, thus simultaneously transferring domain-specific knowledge in the weights and higher-level algorithmic knowledge in the architecture. In addition, we note that the approach of meta-learning programs instead of network weights may have further applications beyond finding curiosity algorithms, such as meta-learning optimization algorithms or even meta-learning meta-learning algorithms. Our relatively modest compute (2 GPU-weeks) and a simple search method restricted us to a medium-sized search space, but we expect that future work could search over significantly bigger spaces. It thus may be possible to automatically search for new machine learning algorithms from more fundamental building blocks for a wide variety of problems.
+
+# ACKNOWLEDGMENTS
+
+We thank Kelsey Allen, Peter Karkus, Kevin Smith, Josh Tenenbaum and the rest of the HondaCMM MIT team for their insightful feedback. We thank Chris Lu for his idea on what the algorithm in figure 10 is computing. We also want to thank Bernadette Bucher, Chelsea Finn, Abhishek Gupta, Deepak Pathak, Lerrel Pinto, Oleh Rybkin, Karl Schmeckpeper and Joaquin Vanschoren for valuable conversations. Finally, we also want to thank Maria Bauza and Tej Chajed for their feedback on early drafts and Clement Gehring for his help setting up the experiments.
+
+We gratefully acknowledge support from NSF grants 1523767 and 1723381, AFOSR grant FA9550- 17-1-0165, ONR grant N00014-18-1-2847, the Honda Research Institute, SUTD Temasek Laboratories and the MIT Quest for Intelligence. Any opinions, findings, and conclusions or recommendations expressed in this material do not necessarily reflect the views of our sponsors.
+
+# REFERENCES
+
+Ferran Alet, Tomas Lozano-Perez, and Leslie P. Kaelbling. Modular meta-learning. In Proceedings of The 2nd Conference on Robot Learning, pp. 856–868, 2018.
+
+Ferran Alet, Erica Weng, Tomas Lozano-Perez, and Leslie Kaelbling. Neural relational inference with fast modular meta-learning. In Advances in Neural Information Processing Systems (NeurIPS) 32. 2019.
+
+Mohammad Gheshlaghi Azar, Bilal Piot, Bernardo Avila Pires, Jean-Bastian Grill, Florent Altche,´ and Remi Munos. World discovery models. ´ arXiv preprint arXiv:1902.07685, 2019.
+
+Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V Le. Neural optimizer search with reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 459–468. JMLR. org, 2017.
+
+Samy Bengio, Yoshua Bengio, and Jocelyn Cloutier. On the search for new learning rules for anns. Neural Processing Letters, 2(4):26–30, 1995.
+
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
+
+Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
+
+Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. Minimalistic gridworld environment for openai gym. https://github.com/maximecb/gym-minigrid, 2018.
+
+Hao-Tien Lewis Chiang, Aleksandra Faust, Marek Fiser, and Anthony Francis. Learning navigation behaviors end-to-end with autorl. IEEE Robotics and Automation Letters, 4(2):2007–2014, 2019.
+
+Ignasi Clavera, Anusha Nagabandi, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt: Meta-learning for model-based control. In International Conference on Learning Representations, 2019.
+
+Jeff Clune. Ai-gas: Ai-generating algorithms, an alternate paradigm for producing general artificial intelligence. arXiv preprint arXiv:1905.10985, 2019.
+
+Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016.
+
+Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. arXiv preprint arXiv:1808.05377, 2018.
+
+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.
+
+Aleksandra Faust, Anthony Francis, and Dar Mehta. Evolving rewards to automate reinforcement learning. arXiv preprint arXiv:1905.07628, 2019.
+
+Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
+
+Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Springenberg, Manuel Blum, and Frank Hutter. Efficient and robust automated machine learning. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2962–2970. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5872-efficient-and-robust-automated-machine-learning.pdf.
+
+Chelsea Finn. Learning to Learn with Gradients. PhD thesis, EECS Department, University of California, Berkeley, Aug 2018. URL http://www2.eecs.berkeley.edu/Pubs/ TechRpts/2018/EECS-2018-105.html.
+
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
+
+Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
+
+Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. 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. 1515–1528, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/florensa18a.html.
+
+Sebastien Forestier and Pierre-Yves Oudeyer. Modular active curiosity-driven discovery of tool ´ use. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 3965–3972. IEEE, 2016.
+
+Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017.
+
+Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2577–2587, 2017.
+
+Adam Gaier and David Ha. Weight agnostic neural networks. arXiv preprint arXiv:1906.04358, 2019.
+
+Santiago Gonzalez and Risto Miikkulainen. Improved training speed, accuracy, and data utilization through loss function optimization. arXiv preprint arXiv:1905.11528, 2019.
+
+Santiago Gonzalez and Risto Miikkulainen. Evolving loss functions with multivariate taylor polynomial parameterizations, 2020.
+
+Abhishek Gupta, Russell Mendonca, YuXuan Liu, Pieter Abbeel, and Sergey Levine. Metareinforcement learning of structured exploration strategies. In Advances in Neural Information Processing Systems, pp. 5302–5311, 2018.
+
+Rein Houthooft, Yuhua Chen, Phillip Isola, Bradly Stadie, Filip Wolski, OpenAI Jonathan Ho, and Pieter Abbeel. Evolved policy gradients. In Advances in Neural Information Processing Systems, pp. 5400–5409, 2018.
+
+Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren (eds.). Automated Machine Learning: Methods, Systems, Challenges. Springer, 2018. In press, available at http://automl.org/book.
+
+Kevin Jamieson and Ameet Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Artificial Intelligence and Statistics, pp. 240–248, 2016.
+
+Zohar Karnin, Tomer Koren, and Oren Somekh. Almost optimal exploration in multi-armed bandits. In International Conference on Machine Learning, pp. 1238–1246, 2013.
+
+Stephen Kelly and Malcolm I Heywood. Multi-task learning in atari video games with emergent tangled program graphs. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 195–202. ACM, 2017.
+
+Ashiqur R KhudaBukhsh, Lin Xu, Holger H Hoos, and Kevin Leyton-Brown. Satenstein: Automatically building local search sat solvers from components. In Twenty-First International Joint Conference on Artificial Intelligence, 2009.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
+
+Louis Kirsch, Sjoerd van Steenkiste, and Jurgen Schmidhuber. Improving generalization in meta ¨ reinforcement learning using learned objectives. arXiv preprint arXiv:1910.04098, 2019.
+
+Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https:// github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 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, pp. 3675–3683, 2016.
+Joel Lehman and Kenneth O Stanley. Exploiting open-endedness to solve problems through the search for novelty. In ALIFE, pp. 329–336, 2008.
+Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. arXiv preprint arXiv:1603.06560, 2016.
+Hector Mendoza, Aaron Klein, Matthias Feurer, Jost Tobias Springenberg, and Frank Hutter. Towards automatically-tuned neural networks. In Workshop on Automatic Machine Learning, pp. 58–65, 2016.
+Alex Nichol, Vicki Pfau, Christopher Hesse, Oleg Klimov, and John Schulman. Gotta learn fast: A new benchmark for generalization in rl. arXiv preprint arXiv:1804.03720, 2018.
+Pierre-Yves Oudeyer. Computational theories of curiosity-driven learning. arXiv preprint arXiv:1802.10546, 2018.
+Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265–286, 2007.
+Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015.
+Adam Paszke, Sam Gross, and Adam Lerer. Automatic differentiation in PyTorch. In International Conference on Learning Representations, 2017.
+Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 16–17, 2017.
+Deepak Pathak, Dhiraj Gandhi, and Abhinav Gupta. Self-supervised exploration via disagreement. arXiv preprint arXiv:1906.04161, 2019.
+Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. arXiv preprint arXiv:1802.03268, 2018.
+Thomas Pierrot, Guillaume Ligner, Scott Reed, Olivier Sigaud, Nicolas Perrin, Alexandre Laterre, David Kas, Karim Beguir, and Nando de Freitas. Learning compositional neural programs with recursive tree search and planning. arXiv preprint arXiv:1905.12941, 2019.
+Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017.
+Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
+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.
+Jurgen Schmidhuber. ¨ Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universitat M¨ unchen, 1987. ¨
+Jurgen Schmidhuber. Driven by compression progress: A simple principle explains essential aspects ¨ of subjective beauty, novelty, surprise, interestingness, attention, curiosity, creativity, art, science, music, jokes. In Workshop on anticipatory behavior in adaptive learning systems, pp. 48–76. Springer, 2008.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+
+Tom Silver, Kelsey R Allen, Alex K Lew, Leslie Pack Kaelbling, and Josh Tenenbaum. Few-shot bayesian imitation learning with logic over programs. arXiv preprint arXiv:1904.06317, 2019.
+
+Rupesh Kumar Srivastava, Bas R Steunebrink, and Jurgen Schmidhuber. First experiments with ¨ powerplay. Neural Networks, 41:130–136, 2013.
+
+Bradly C Stadie, Ge Yang, Rein Houthooft, Xi Chen, Yan Duan, Yuhuai Wu, Pieter Abbeel, and Ilya Sutskever. Some considerations on learning to explore via meta-reinforcement learning. arXiv preprint arXiv:1803.01118, 2018.
+
+Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
+
+Adrien Ali Ta¨ıga, William Fedus, Marlos C Machado, Aaron Courville, and Marc G Bellemare. Benchmarking bonus-based exploration methods on the arcade learning environment. arXiv preprint arXiv:1908.02388, 2019.
+
+Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, OpenAI Xi Chen, Yan Duan, John Schulman, Filip DeTurck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. In Advances in neural information processing systems, pp. 2753– 2762, 2017.
+
+Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 1998.
+
+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.
+
+Leslie Valiant. Probably Approximately Correct: NatureOs Algorithms for Learning and Prospering ˜ in a Complex World. Basic Books (AZ), 2013.
+
+Vivek Veeriah, Matteo Hessel, Zhongwen Xu, Richard Lewis, Janarthanan Rajendran, Junhyuk Oh, Hado van Hasselt, David Silver, and Satinder Singh. Discovery of useful questions as auxiliary tasks. arXiv preprint arXiv:1909.04607, 2019.
+
+JX Wang, Z Kurth-Nelson, D Tirumala, H Soyer, JZ Leibo, R Munos, C Blundell, D Kumaran, and M Botivnick. Learning to reinforcement learn. arxiv 1611.05763, 2017.
+
+Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O Stanley. Paired open-ended trailblazer (poet): Endlessly generating increasingly complex and diverse learning environments and their solutions. arXiv preprint arXiv:1901.01753, 2019.
+
+Dennis G Wilson, Sylvain Cussat-Blanc, Herve Luga, and Julian F Miller. Evolving simple programs ´ for playing atari games. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 229–236. ACM, 2018.
+
+Zhongwen Xu, Hado P van Hasselt, and David Silver. Meta-gradient reinforcement learning. In Advances in neural information processing systems, pp. 2396–2407, 2018.
+
+Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Sergey Levine, and Chelsea Finn. Meta-world: A benchmark and evaluation for multi-task and meta-reinforcement learning, 2019. URL https://github.com/rlworkgroup/metaworld.
+
+Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Advances in Neural Information Processing Systems, pp. 4644–4654, 2018.
+
+Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 2223–2232, 2017.
+
+Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
+
+Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8697–8710, 2018.
+
+# A DETAILS OF OUR DOMAIN-SPECIFIC LANGUAGE FOR CURIOSITYALGORITHMS
+
+We have the following types. Note that $\mathbb { S }$ and $\mathbb { A }$ get defined differently for every environment.
+
+• $\mathbb { R }$ : real numbers such as $r _ { t }$ or the dot-product between two vectors.
+• $\mathbb { R } ^ { + }$ : numbers guaranteed to be positive, such as the distance between two vectors. The only difference to our program search between $\mathbb { R }$ and $\mathbb { R } ^ { + }$ is in pruning programs that can optimize objectives without looking at the data. For $\mathbb { R } ^ { + }$ we check whether they can optimize down to 0, for $\mathbb { R }$ we check whether they can optimize to arbitrarily negative values.
+• state space $\mathbb { S }$ : the environment state, such as a matrix of pixels or a vector with robot joint values. The particular form of this type is adapted to each environment.
+• action space A: either a 1-hot description of the action or the action itself. The particular form of this type is adapted to each environment.
+• feature-space $\mathbb { F } = \mathbb { R } ^ { 3 2 }$ : a space mostly useful to work with neural network embeddings. For simplicity, we only have a single feature space.
+• List[X]: for each type we may also have a list of elements of that type. All operations that take a particular type as input can also be applied to lists of elements of that type by mapping the function to every element in the list. Lists also support extra operations such as average or variance.
+
+A.1 CURIOSITY OPERATIONS
+
+
Operation
Input type(s)
State
Output type
Add
R,R
R
RunningNorm
R
R
R
VariableAsBuffer
X
List[X]
List[X]
NearestNeighborRegressor
F,F
List[F]
F
SubtractOneTenth
R
R
NormalDistribution
R
Subtract
R,R
R
Sqrt(Abs(x))
R
R+
NN F,F → F
F,F
OF,F→F
F
NNF,F→A
F,F
OF,F→A
A
NNF→A
F
OF→A
A
NN A→F
A
OA→F
F
(C)NN
S
Os→F
F
(C)NN, Detach
S
Os→F
F
(C)NNEnsemble
S
5xOs-→F
List[F]
NN Ensemble F→F
F
5xOF→F
List[F]
NN Ensemble F,F → F
F,F
5xOF,F→F
List[F]
NN Ensemble F,A →F
F,A
5xOA,F→F
List[F]
MinimizeValue
R
Adam
L2Norm
X
R+
L2Distance
X, X
R
ActionSpaceLoss
X,A
R+
DotProduct
X, X
R
Add
X, X
X
Detach
X
X
Mean
List[R]
R
Variance
List[X]
R+
Mean
List[X]
X
X
Mapped L2 Norm
List[X]
X
List[R]
Average Distance
List
X
,X
R
Minus
List
X
,X
List[X]
+
+Note that $\mathbb { X }$ stands for the option of being $\mathbb { F }$ or A. NearestNeighborRegressor takes a query and a target, automatically creates a buffer of the target (thus keeps a list as a state) and answers based on the buffer. RunningNorm keeps track of the variance of the input and normalizes by that variance.
+
+A.2 REWARD COMBINER OPERATIONS
+
+
Operation
Input type(s)
State
Output type
Constant {0.01,0.1,0.5,1]
R
NormalDistribution
R
Add
R,R
R
Max
R,R
R
Min
R,R
R
WeightedNormalizedSum
R, R, R, R
R
RunningNorm
R
R
R
VariableAsBuffer
R
List[R]
List[R]
Subtract
R,R
R
Multiply
R,R
R
Sqrt(Abs(x))
R
R+
Mean
List[R]
R
+
+Note that W eightedNormaliz $\begin{array} { r } { { \mathrm { { ? } } d } S u m ( a , b , c , d ) = \frac { a b + c d } { | a | + | c | } } \end{array}$ RunningNorm keeps track of the variance of the input and normalizes by that variance.
+
+# A.3 TWO OTHER PUBLISHED ALGORITHMS COVERED BY OUR DSL
+
+
+Figure 5: Curiosity by predictive error on inverse features by Pathak et al. (2017). In pink, paths and networks where gradients flow back from the minimizer.
+
+
+Figure 6: Curiosity by ensemble predictive variance Pathak et al. (2019). In pink, paths and networks where gradients flow back from the minimizer.
+
+# B RELATED WORK ON META-RL AND GENERALIZATION
+
+Most work on meta-RL has focused on learning transferable feature representations or parameter values for quickly adapting to new tasks (Finn et al., 2017; Finn, 2018; Clavera et al., 2019) or improving performance on a single task (Xu et al., 2018; Veeriah et al., 2019). However, the range of variability between tasks is typically limited to variations of the same goal (such as moving at different speeds or to different locations) or generalizing to different environment variations (such as different mazes or different terrain slopes). There have been some attempts to broaden the spectrum of generalization, showing transfer between Atari games thanks to modularity (Fernando et al., 2017; Rusu et al., 2016) or proper pretraining (Parisotto et al., 2015). However, as noted by Nichol et al. (2018), Atari games are too different to get big gains with current feature-transfer methods; they instead suggest using different levels of the game Sonic to benchmark generalization. Moreover, Yu et al. (2019) recently proposed a benchmark of many tasks. Wang et al. (2019) automatically generate different terrains for a bipedal walker and transfer policies between terrains, showing that this is more effective than learning a policy on hard terrains from scratch; similar to our suggestion in section 3.2. In contrast to these methods, we aim at generalization between completely different environments, even between environments that do not share the same state and action spaces.
+
+# C PREDICTING ALGORITHM PERFORMANCE
+
+
+Figure 7: Predicting algorithm performance from the structure of the program alone. Comparison between predicted and actual performance on a test set; showing a correlation of 0.54. In black, the identity line.
+
+
+Figure 8: Predicting algorithm performance allows us to find the best programs faster. We investigate the number of the top $1 \%$ of programs found vs. the number of programs evaluated, and observe that the optimized search (in blue) finds $8 8 \%$ of the best programs after only evaluating $50 \%$ of the programs (highlighted in green). The naive search order would have only found $50 \%$ of the best programs at that point.
+
+
+Figure 9: In black, mean performance across 5 trials for all 26,000 programs evaluated (out of their finished trials). In green mean plus one standard deviation for the mean estimate and in red one minus one standard deviation for the mean estimate. On the right, you can see program means form roughly a gaussian distribution of very big noise (thus probably not significant) with a very small (between ${ \bar { 0 . 5 \% } }$ and $1 \%$ of programs) long tail of programs with statistically significantly good performance (their red dots are much higher than almost all green dots), composed of algorithms leading to good exploration.
+
+
+Figure 10: Cycle-Consistency Intrinsic Motivation algorithm, found by our search (3 of the top 16 programs on grid world are variants of this program). The purple Predict Target From Query boxes feed the query to a neural network, return the prediction as output and add the prediction loss to the optimization, back-propagating to the network and the query, but not the target. Notice that $\theta _ { 1 }$ is not getting trained because no loss back-propagates there; thus producing a random feature embedding $s _ { f } ( t )$ from $s ( t )$ . The algorithm combines several concepts seen in the literature, such as an untrained network like RND Burda et al. (2018) and predicting another state in feature space like Pathak et al. (2017; 2019), but also includes weight sharing between both predictions, which makes the algorithm hard to interpret at first sight, see below for an in-depth explanation.
+
+One can give meaning to the role of all 3 neural networks by considering how they contribute to minimizing the loss. To do so, let us name the networks: $\theta \{ 1 \}$ (as labeled in the figure) as $r _ { \theta _ { 1 } }$ (for random embedding), $\theta \{ 2 \}$ as $b _ { \theta _ { 2 } }$ (for backwards) and $\theta \{ 3 \}$ as $f r _ { \theta _ { 3 } }$ (for forward and random embedding) and look at the algorithm in equation form:
+
+$$
+i _ { t } = \left. b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t } ) \right) - b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } \left( s _ { t + 1 } \right) \right) \right.
+$$
+
+$$
+\begin{array} { c } { { \displaystyle \theta _ { 2 } : = \theta _ { 2 } - \eta \displaystyle \frac { \partial } { \partial \theta _ { 2 } } \Big ( \| b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t } ) \right) - r _ { \theta _ { 1 } } ( s _ { t } ) \| + } } \\ { { \displaystyle \| b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t + 1 } ) \right) - f r _ { \theta _ { 3 } } ( s _ { t } ) \| \Big ) } } \\ { { \displaystyle \theta _ { 3 } : = \theta _ { 3 } - \eta \displaystyle \frac { \partial } { \partial \theta _ { 3 } } \Big ( \| b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t } ) \right) - r _ { \theta _ { 1 } } ( s _ { t } ) \| \Big ) } } \end{array}
+$$
+
+We can see that $r _ { \theta _ { 1 } }$ will indeed be a random embedding because the network is randomly initialized and is not trained. Then, we observe that the second term in the loss for $\theta _ { 2 }$ , which does not involve $\theta _ { 3 }$ and thus $\theta _ { 2 }$ has to minimize alone, is $\| b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t + 1 } ) \right) - f r _ { \theta _ { 3 } } ( s _ { t } ) \|$ . In this term, $b _ { \theta _ { 2 } }$ receives a transformation of $s _ { t + 1 }$ and has to make it very similar to the same transformation applied to $s _ { t }$ ; therefore, this term is similar to cycle-consistency found in some other parts of machine learning Zhu et al. (2017) and $b _ { \theta _ { 2 } }$ must act like a backward model. Finally, looking at the minimization of $\theta _ { 3 }$ receives the original $s _ { t }$ and has to output a vector such that the backward model will bring it close to the random embedding of $s _ { t }$ . Therefore $\theta _ { 3 }$ must learn a forward model composed with the random embedding of $\theta _ { 1 }$ . Finally, we see that the algorithm outputs $\left. b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } ( s _ { t } ) \right) - b _ { \theta _ { 2 } } \left( f r _ { \theta _ { 3 } } \left( s _ { t + 1 } \right) \right) \right.$ , going forward and backward for both $s _ { t + 1 }$ and $s _ { t }$ and comparing the difference. In summary, this distance combines errors in the cycle-consistency of predictions (which will be higher in unvisited parts of the state) with distance in the random embedding space between $s ( t )$ and $s ( t + 1 )$ , i.e. moving to a very different state.
+
+
+Figure 11: Top variant in preliminary search on grid world; variant on random network distillation using an ensemble of trained networks instead of a single one.
\ No newline at end of file
diff --git a/md/train/ByqFhGZCW/ByqFhGZCW.md b/md/train/ByqFhGZCW/ByqFhGZCW.md
new file mode 100644
index 0000000000000000000000000000000000000000..aecdff0b9b7e2620f153dc8d5ec94e65708b67dc
--- /dev/null
+++ b/md/train/ByqFhGZCW/ByqFhGZCW.md
@@ -0,0 +1,359 @@
+# MACHINE VS MACHINE: MINIMAX-OPTIMAL DEFENSE AGAINST ADVERSARIAL EXAMPLES
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Recently, researchers have discovered that the state-of-the-art object classifiers can be fooled easily by small perturbations in the input unnoticeable to human eyes. It is known that an attacker can generate strong adversarial examples if she knows the classifier parameters. Conversely, a defender can robustify the classifier by retraining if she has the adversarial examples. The cat-and-mouse game nature of attacks and defenses raises the question of the presence of equilibria in the dynamics. In this paper, we present a neural-network based attack class to approximate a larger but intractable class of attacks, and formulate the attacker-defender interaction as a zero-sum leader-follower game. We present sensitivity-penalized optimization algorithms to find minimax solutions, which are the best worst-case defenses against whitebox attacks. Advantages of the learning-based attacks and defenses compared to gradient-based attacks and defenses are demonstrated with MNIST and CIFAR-10.
+
+# 1 INTRODUCTION
+
+Recently, researchers have made an unsettling discovery that the state-of-the-art object classifiers can be fooled easily by small perturbations in the input unnoticeable to human eyes (Szegedy et al., 2013; Goodfellow et al., 2014b). Following studies tried to explain the cause of the seeming failure of deep learning toward such adversarial examples. The vulnerability was ascribed to linearity (Szegedy et al., 2013), low flexibility (Fawzi et al., 2015), or the flatness/curvedness of decision boundaries (Moosavi-Dezfooli et al., 2017), but a more complete picture is still under research. This is troublesome since such a vulnerability can be exploited in critical situations such as an autonomous car misreading traffic signs or a facial recognition system granting access to an impersonator without being noticed. Several methods of generating adversarial examples were proposed (Goodfellow et al., 2014b; Moosavi-Dezfooli et al., 2016; Carlini & Wagner, 2017), most of which use the knowledge of the classifier to craft examples. In response, a few defense methods were proposed: retraining target classifiers with adversarial examples called adversarial training (Szegedy et al., 2013; Goodfellow et al., 2014b); suppressing gradient by retraining with soft labels called defensive distillation (Papernot et al., 2016); hardening target classifiers by training with an ensemble of adversarial examples (Tramer et al., 2017). \`
+
+In this paper we focus on whitebox attacks, that is, the model and the parameters of the classifier are known to the attacker. This requires a more robust classifier or defense method than simply relying on the secrecy of the parameters as defense. When the classifier parameters are known to an attacker, existing attack methods are very successful at fooling the classifiers. Conversely, when the attack is known to the classifier, e.g., in the form of adversarial examples, one can weaken the attack by retraining the classifier with adversarial examples, called adversarial training. However, if we repeat adversarial sample generation and adversarial training back-to-back, it is observed that the current adversarially-trained classifier is no longer robust to previous attacks (see Sec. 3.1.) To find the classifier robust against the class of gradient-based attacks, we first propose a sensitivitypenalized optimization procedure. Experiments show that the classifier from the procedure is more robust than adversarially-trained classifiers against previous attacks, but it still remains vulnerable to some degrees. This raises the main question of the paper: Can a classifier be robust to all types of attacks? The answer seems to be negative in light of the strong adversarial examples that can be crafted by direct optimization procedures from Huang et al. (2015) or Carlini & Wagner (2017). Note that the class of optimization-based attack is very large, as there is no restriction on the adversarial patterns that can be generated except for certain bounds such as $l _ { p }$ -norm bounds. The vastness of the optimization-based attack class is a hindrance to the study of the problem, as the defender cannot learn efficiently about the attack class from a finite number of samples. To study the problem analytically, we use a class of learning-based attack that can be generated by a class of neural networks. This class of attack can be considered an approximation of the class of optimization -based attacks, in that the search space of optimal perturbation is restricted to the parameter space of a neural network architecture, e.g., all perturbations that can be generated by fully-connected 3- layer ReLU networks. Similar to what we propose, others have recently considered training neural networks to generate adversarial examples (Nguyen & Sinha, 2017; Baluja & Fischer, 2017). While the proposed learning-based attack is weaker than the optimization-based attack, it can generate adversarial examples in test time with only single feedforward passes, which makes real-time attacks possible. We also show that the class of neural-network based attacks is quite different from the the class of gradient-based attacks (see Sec. 4.1.)
+
+Using the learning-based attack class, we introduce a continuous game formulation for analyzing the dynamics of attack-defense. The game is played by an attacker and a defender/classifier 1, where the attacker tries to maximize the risk of the classification task by perturbing input samples under certain constraints such as $l _ { p }$ -norm bounds, and the defender/classifier tries to adjust its parameters to minimize the same risk given the perturbed inputs. It is important to note that for adversarial attack problems, the performance of an attack or a defense cannot be measured in isolation, but only in pairs of (attack, defense). This is because the effectiveness of an attack/defense depends on the defense/attack it is against. As a two-player game, there may not be a dominant defense that is no less robust than all other defenses against all attacks. However, there is a natural notion of the best defense or attack in the worst case. Suppose one player moves first by choosing her parameters and the other player responds with the knowledge of the first player’s move. This is an example of a leader-follower game (Bruckner & Scheffer, 2011) for which there are two well-known ¨ states, the minimax and the maximin solutions if it is a constant-sum game. To find those solutions empirically, we propose a new continuous optimization method using the sensitivity penalization term. We show that the minimax solution from the proposed method is indeed different from the solution from the conventional alternating descent/ascent and is also more robust. We also show that the strength/weakness of the minimax-trained classifier is different from that of adversarially-trained classifiers for gradient-based attacks. The contributions of this paper are summarized as follows.
+
+• We provide a continuous game model to analyze adversarial example attacks and defenses, using the neural network-based attack class as a feasible approximation to a larger but intractable class of optimization-based attacks.
+We demonstrate the difficulty of defending against multiple attack types and present the minimax defense as the best worst-case defense methods.
+We propose a sensitivity-penalized optimization method (Alg. 1) to numerically find continuous minimax solutions, which is better than alternating descent/ascent. The proposed optimization method can also be used for other minimax problems beyond the adversarial example problem.
+
+The proposed methods are demonstrated with the MNIST and the CIFAR-10 datasets. For readability, details about experimental settings and the results with CIFAR-10 are presented in the appendix.
+
+# 2 RELATED WORK
+
+Making a classifier robust to test-time adversarial attacks has been studied for linear (kernel) hyperplanes (Lanckriet et al., 2002), naive Bayes (Dalvi et al., 2004) and SVM (Globerson & Roweis, 2006), which also showed the game-theoretic nature of the robust classification problems. Since the recent discovery of adversarial examples for deep neural networks, several methods of generating adversarial samples were proposed (Szegedy et al., 2013; Goodfellow et al., 2014b; Huang et al., 2015; Moosavi-Dezfooli et al., 2016; Carlini & Wagner, 2017) as well as several methods of defense (Szegedy et al., 2013; Goodfellow et al., 2014b; Papernot et al., 2016; Tramer et al., 2017). These \` papers considered static scenarios, where the attack/defense is constructed against a fixed opponent.
+
+A few researchers have also proposed using a detector to detect and reject adversarial examples (Meng & Chen, 2017; Lu et al., 2017; Metzen et al., 2017). While we do not use detectors in this work, the minimax approach we proposed in the paper can be applied to train the detectors.
+
+The idea of using neural networks to generate adversarial samples has appeared concurrently (Baluja & Fischer, 2017; Nguyen & Sinha, 2017). Similar to our paper, the two papers demonstrates that it is possible to generate strong adversarial samples by a learning approach. Baluja & Fischer (2017) explored different architectures for the “adversarial transformation networks” against several different classifiers. Nguyen & Sinha (2017) proposed “attack learning neural networks” to map clean samples to a region in the feature space where misclassification occurs and “defense learning neural networks” to map them back to the safe region. Instead of prepending the defense layers before the fixed classifier (Nguyen & Sinha, 2017), we retrain the whole classifier as a defense method. However, the key difference of our work to the two papers is that we consider the dynamics of a learning-based defense stacked with a learning-based attack, and the numerical computation of the optimal defense/attack by continuous optimization.
+
+The alternating gradient-descent method for finding an equilibrium of a game has gained renewed interest since the introduction of Generative Adversarial Networks (GAN) (Goodfellow et al., 2014a). However, the instability of the alternating gradient-descent method has been known, and the “unrolling” method (Metz et al., 2016) was proposed to speed up the GAN training. The optimization algorithm proposed in the paper has a similarity with the unrolling method, but it is simpler (corresponding to a single-step unrolling) and involves a gradient-norm regularization which can be interpreted intuitively as sensitivity penalization (Gu & Rigazio, 2014; Lyu et al., 2015). Lastly, the framework of minimax risks was also studied in Hamm (2016) for the purpose of privacy preservation. We propose a different algorithm in this paper, but we also show that the attack on classification and the attack on privacy are the two sides of the same optimization problem with the opposite goals.
+
+# 3 CAT-AND-MOUSE GAME
+
+A classifier whose parameters are known to an attacker is easy to attack. Conversely, an attacker whose sample-generating method is known to a classifier is easy to defend from. In this section, we demonstrate the cat-and-mouse nature of the interaction, using adversarial training (Adv Train) as defense and the fast gradient sign method (FGSM) (Goodfellow et al., 2014b) and the iterative version (IFGSM) (Kurakin et al., 2016a) as attacks. We then show that the equilibrium, if it exists, can be found more efficiently by directly solving a sensitivity-penalized optimization problem.
+
+# 3.1 A NAIVE APPROACH
+
+Suppose $g$ is a classifier $g : \mathcal { X } \mathcal { Y }$ and $l ( g ( x ) , y )$ is a loss function. The FGSM attack generates a perturbed example $z ( x )$ given the clean sample $x$ as follows:
+
+$$
+z ( x ) = x + \eta \mathrm { s i g n } ( \nabla _ { x } l ( g ( x ) , y ) ) .
+$$
+
+The clean input images we use here are $l _ { \infty }$ -normalized, that is, all pixel values are in the range $[ - 1 , 1 ]$ . It was argued that the use of true label $y$ results in “label leaking” (Kurakin et al., 2016b), but we use will true labels in the paper for simplicity. For another attack example, the IFGSM attack iteratively refines an adversarial example by the following update
+
+$$
+\begin{array} { r } { z _ { i + 1 } = \mathrm { c l i p } _ { x , \eta } ( z _ { i } + \eta \mathrm { s i g n } ( \nabla _ { z } l ( g ( z _ { i } ) , y ) ) ) , } \end{array}
+$$
+
+where the clipping used in this paper is $\begin{array} { r } { \mathrm { c l i p } _ { x , \eta } ( x ^ { \prime } ) \triangleq \operatorname* { m i n } \{ 1 , \ x + \eta , \ \operatorname* { m a x } \{ - 1 , \ x - \eta , \ x ^ { \prime } \} \} . } \end{array}$
+
+Existing attack methods such as FGSM and IFGSM are very effective at fooling the classifier. Table 1 shows that the two methods are able to perfectly fool a convolutional neural network trained with clean images from MNIST. (Details of the classifier architecture and the settings are in the appendix.)
+
+On the other hand, these attacks, if known to the classifier, can be weakened by retraining the classifier with the original dataset augmented by adversarial examples with ground-truth labels, known as adversarial training. In this paper we use the 1:1 mixture of the clean and the adversarial samples for adversarial training. Table 2 shows the result of adversarial training for different attacks.
+
+
Defense\Attack
No attack
FGSM
IFGSM
n=0.3
m=0.4
m=0.5
n=0.6
m=0.3
m=0.4
n=0.5
n=0.6
No defense
0.006
1.000
1.000
1.000
1.000
1.000
1.000
1.000
1.000
+
+Table 1: Test error rates of FGSM and IFGSM attacks on an undefended convolutional neural network for MNIST. These attacks can cause perfect misclassification for the given range of $\eta$ .
+
+The test error rates for adversarial test examples after training become below $1 \%$ indicating nearperfect avoidance. This is in stark contrast with the perfect misclassification of the undefended classifier in Table 1.
+
+Table 2: Error rates of FGSM and IFGSM attacks on adversarially-trained classifiers for MNIST. This defense can avert the attacks and achieve the error rates of the no-attack case.
+
+
Defense\Attack
No attack
FGSM
IFGSM
n=0.3
n=0.4
m=0.5
n=0.6
n=0.3
n=0.4
m=0.5
n=0.6
Adv train
n/a
0.004
0.003
0.003
0.005
0.003
0.003
0.004
0.010
+
+A question arises as to what would happen if the procedure of 1) adversarial sample generation using the current classifier, and 2) retraining classifier using the current adversarial examples is repeated for many rounds. The answer to this cat-and-mouse game is easy to experiment although time-consuming. Let’s denote the attack on the original classifier as FGSM1, and the corresponding retrained classifier as Adv FGSM1. Repeating the procedure above generates the sequence of models $\mathrm { F G S M 1 } \to \mathrm { A d v } \ \mathrm { F G S M 1 } \to \mathrm { F G S M 2 } \to \mathrm { A d v } \ \mathrm { F C }$ GSM2, etc. Fig. 1 shows one such trial with $8 0 +$ 80 rounds of the procedure. Initially, the attacker achieves near-perfect attacks (i.e., error rate $\simeq 1$ ), and the defender achieves near-perfect defense (i.e., error rate $\simeq 0$ ). As the iteration increases, the attacker becomes weaker with error rate $\simeq 0 . 5$ , but the defense is still very successful, and the rate seems to oscillate persistently. While we can run more iterations to see if it converges, this is not a very principled nor efficient approach to find an equilibrium, if it exists.
+
+
+Figure 1: A cat-and-mouse game of FGSM attacks and adversarial training for MNIST. The upper red points are the error rates after adversarial training, and the lower green points are the error rates after FGSM attack $\eta = 0 . 3 )$ . After 160 iterations, the error rate is still oscillating between 0 and 0.5.
+
+# 3.2 GRADIENT-BASED ATTACKS AND SENSITIVITY PENALTY
+
+We can perform the cat-and-mouse simulation more efficiently by an optimization approach. Instead of training the classifier fully with adversarial examples and then regenerating adversarial examples, suppose we only update the classifier with a single gradient-descent step then regenerate adversarial examples. To emphasize the parameters $u$ of the classifier/defender $g ( x ; u )$ , let’s rewrite the empirical risk of classifying the perturbed data as
+
+$$
+f ( u , Z ) \triangleq \frac { 1 } { N } \sum _ { i = 1 } ^ { N } l ( g ( z ( x _ { i } ) ; u ) , y _ { i } ) ,
+$$
+
+where $z ( x )$ denote an FGSM-like attack based on the loss gradient
+
+$$
+\begin{array} { r } { z ( { \boldsymbol x } ) \gets { \boldsymbol x } + \eta \nabla _ { z } l ( g ( z ( { \boldsymbol x } ) ; { \boldsymbol u } ) , y ) , } \end{array}
+$$
+
+and $Z = ( z _ { 1 } , . . . , z _ { N } ) \triangleq ( z ( x _ { 1 } ) , . . . , z ( x _ { N } ) )$ is the sequence of perturbed examples. In expectation of the attack, the defender should choose $u$ to minimize $f ( u , Z ( u ) )$ where the dependence of the attack on the classifier $u$ is expressed explicitly. If we minimize $f$ using gradient descent
+
+$$
+u u - \lambda \frac { d f ( u , Z ) } { d u } ,
+$$
+
+then from the chain rule, the total derivative $\textstyle { \frac { d f } { d u } }$ is
+
+$$
+{ \frac { d f } { d u } } = { \frac { \partial f } { \partial u } } + { \frac { \partial Z } { \partial u } } { \frac { \partial f } { \partial Z } } = { \frac { \partial f } { \partial u } } + \sum _ { i } { \frac { \partial z _ { i } } { \partial u } } { \frac { \partial f } { \partial z _ { i } } } = { \frac { \partial f } { \partial u } } + { \frac { \eta } { N } } \sum _ { i } { \frac { \partial ^ { 2 } l } { \partial z _ { i } \partial u } } { \frac { \partial l } { \partial z _ { i } } }
+$$
+
+from (3) and (4).
+
+Interestingly, this total derivative (6) at the current state coincides with the gradient $\nabla _ { u }$ of the following cost
+
+$$
+f _ { \mathrm { s e n s } } ( u ) \triangleq f ( u , Z ) + \frac { \gamma } { 2 } \left\| \frac { \partial f ( u , Z ) } { \partial Z } \right\| ^ { 2 } = f ( u , Z ) + \frac { \eta } { 2 N } \sum _ { i = 1 } ^ { N } \left\| \frac { \partial l ( g ( z _ { i } ; u ) , y _ { i } ) } { \partial z _ { i } } \right\| ^ { 2 }
+$$
+
+where $\gamma = \eta N$ . There are two implications. Interpretation-wise, this cost function is the sum of the original risk $f$ and the ‘sensitivity’ term $\| \partial f / \partial Z \| ^ { 2 }$ which penalizes abrupt changes of the risk w.r.t. the input. Therefore, $u$ is chosen at each iteration to not only decrease the risk but also to make the classifier insensitive to input perturbation so that the attacker cannot take advantage of large gradients. The idea of minimizing the sensitivity to input is a familiar approach in robustifying classifiers (Gu & Rigazio, 2014; Lyu et al., 2015). Secondly, the new formulation can be implemented easily. The gradient descent update using the seemingly complicated gradient (6) can be replaced by the gradient descent update of (7). The capability of automatic differentiation (Rall, 1981) in modern machine learning libraries can be used to compute the gradient of (7) efficiently. Using this direct approach, we can find the defense parameters $u$ which will be robust to gradient-based attacks. Fig. 2 shows the decrease of test error during training using the this gradient descent approach for MNIST. It only takes a very small fraction of time to reach the final states of the Fig. 2 compared to that of Fig. 1.
+
+
+Figure 2: Convergence of test error rates for sensitivity-penalized optimization (7) with MNIST.
+
+There is also an important difference between the solution of the cat-and-mouse game and the minimizer of (7). Table 3 shows that the adversarially trained classifier (Adv FGSM1) is robust to both clean data and FGSM1 attack, but is susceptible to FGSM2 attack, displaying the cat-and-mouse nature. The same holds for Adv FGSM2, Adv FGSM3, etc. After 80 rounds of the cat-and-mouse procedure, the classifier Adv FGSM80 becomes robust to FGSM80 as well as moderately robust to other attacks including FGSM81 $\circleddash$ FGSM-curr). However, the classifier Sens FGSM from direct minimization of (7) is even more robust toward FGSM-curr than Adv FGSM80 and is overall the best. To see the advantage of the sensitivity term in (7), we also performed the minimization of (7) without the sensitivity term under the same conditions as Sens FGSM. This optimization method is similar to the method proposed in Huang et al. (2015), referred to as Learning with Adversaries (LWA FGSM). In the table, one can see that Sens FGSM is also better than LWA FGSM overall, although the difference is small.
+
+Note that Sens FGSM is better than other adversarially-trained classifiers, it too is still vulnerable to attacks such as FGSM80. This vulnerability raises the question if it is possible to make a classifier robust to any type of attacks, or more practically, robust to at least a large class of attacks. We discuss this issue in the next section.
+
+Table 3: Error rates of different attacks on various adversarially-trained classifiers for MNIST. FGSM-curr means the FGSM attack on the specific classifier on the left. Adv FGSM is the classifier adversarially trained with FGSM attacks. Sens FGSM is the result of minimizing (7) by gradient descent (5). LWA FGSM is the result of minimizing (7) without the gradient-norm term.
+
+
Defense\Attack
No attack
FGSM
FGSM-curr
FGSM1
FGSM2 :
FGSM80
n=0.3
No defense Adv FGSM1
0.026 0.012
1.000 0.004
0.881 0.995
:
0.355 1.000
0.999
:
0.499
0.995
Adv FGSM2
0.012
0.002 :
0.505
0.995
AdvFGSM80
0.009
0.335
0.273 :
0.009
0.442
LWAFGSM Sens FGSM
0.008
0.121
0.188 :
0.210 0.194
0.048 0.048
m=0.4
No defense
0.009 0.026
0.104 1.000
0.176 0.944
: :
0.528 1.000
AdvFGSM1
0.013
0.003
0.984
0.589 :
0.984
AdvFGSM2
0.017
0.999
0.005 :
0.549
0.999
AdvFGSM80
0.009
0.509
0.525
: 0.024
0.131
LWAFGSM
0.009
0.204
0.284
: 0.336
0.043
Sens FGSM
0.009
0.128
0.234
· 0.296
0.038
m=0.5
No defense
0.026
1.000
0.931
:
0.662
1.000
AdvFGSM1
0.010
0.002
0.970
:
0.724
0.970
Adv FGSM2
0.010
0.866
0.006
:
0.604
0.871
AdvFGSM80
0.008
0.653
0.559
:
0.023
0.089
LWAFGSM
0.009
0.248
0.260
:
0.432
0.035
Sens FGSM
0.009
0.266
0.285
:
0.365
0.039
n=0.6
No defense
0.026
1.000
0.963
:
0.803
1.000
AdvFGSM1
0.012
0.003
0.889
:
0.790
0.889
Adv FGSM2
0.008
0.649
0.007
:
0.687
0.767
AdvFGSM80
0.009
0.439
0.426
:
0.020
0.021
LWAFGSM
0.011
0.317
0.315
:
0.488
0.034
Sens FGSM
0.010
0.264
0.244
:
0.465
0.033
+
+# 4 GAME FORMULATION
+
+In this section, we consider the class of optimization-based attack and the class of neural-network based attacks as an approximation of the former. Using the neural-network based attack class, we formulate the attacker-defender dynamics as a game and discuss two types of equilibria – the minimax and the maximin solutions. We present algorithms that generalize the approach presented in the previous section.
+
+# 4.1 LEARNING-BASED ATTACK
+
+An attacker $z ( x ) : \mathcal { X } \mathcal { X }$ can be more general than a specific class of attacks such as FGSM. Again, let $g : \mathcal { X } \mathcal { Y }$ is a classifier parameterized by $u$ and $l ( g ( x ; u ) , y )$ is a loss function. If time complexity is not an issue, the following optimization-based attack (Huang et al., 2015)
+
+$$
+\operatorname* { m a x } _ { Z = ( z _ { 1 } , \ldots , z _ { N } ) } \left[ f ( u , Z ) \triangleq \frac { 1 } { N } \sum _ { i } l ( g ( z _ { i } ; u ) , y _ { i } ) \right] = \frac { 1 } { N } \sum _ { i } \operatorname* { m a x } _ { z _ { i } } \ l ( g ( z _ { i } ; u ) , y _ { i } ) ,
+$$
+
+which is also related to the CW attack (Carlini & Wagner, 2017), can generate strong adversarial examples, where adversarial patterns $Z = ( z _ { 1 } , . . . , z _ { N } )$ are unrestricted except for the bounds such as $\| z _ { i } - x _ { i } \| _ { p } \leq \eta$ . The corresponding class of adversarial patterns $Z$ is very large, which results in strong but non-generalizable adversarial examples. Non-generalizable means the perturbation $z ( x )$ has to be recomputed for every new test sample $x$ . While the class of optimization-based attacks is powerful, its large size makes it difficult to analytically study the optimal defense methods. To make the problem learnable, we restrict the class of patterns $Z$ to that which can be generated by a flexible but manageable class of perturbation $\{ z ( \cdot ; v ) \mid \forall v \in V \}$ , e.g., an autoencoder of a fixed architecture where the parameter $v$ is the network weights. This class is a clearly an approximation to the class of full optimization-based attacks, but is generalizable, i.e., no time-consuming optimization is required in the test phase but only single feedforward passes. The attack network (AttNet), as we call it, can be of any class of appropriate neural networks. Here we use a three-layer fully-connected network with 300 hiddens units per layer in this paper. Different from Nguyen & Sinha (2017) or Baluja & Fischer (2017), we feed the label $y$ into the input of the network along with the features $x$ . This is analogous to using the true label $y$ in the original FGSM. While this label input is optional but it can make the training of the attacker network easier. As with other attacks, we impose the $l _ { \infty }$ -norm constraint on $z$ , i.e., $\| z ( x ) - x \| _ { \infty } \leq \eta$ .
+
+Suppose now $f ( u , v )$ is the empirical risk of a classifier-attacker pair where the input $x$ is first transformed by attack network $z ( x ; v )$ and then fed to the classifier $g ( z ( x ; v ) ; u )$ . The attack network can be trained by gradient descent as well. Given a classifier $u$ , we can use gradient descent
+
+$$
+v v + \sigma { \frac { \partial f ( u , v ) } { \partial v } }
+$$
+
+to find an optimal attacker $v$ that maximizes the risk $f$ assuming the classifier $u$ is fixed. Table 4 compares the error rates of the FGSM attacks and the attack network (AttNet). The table shows that AttNet is better than or comparable to FGSM in all cases. In particular, we already observed that the FGSM attack is no more effective against the classifier hardened against gradient-based attacks (Adv FGSM80 or Sens FGSM), but the AttNet can incur significant error $( > \sim 0 . 9 )$ for those hardened defenders. This indicates that the class of learning-based attacks is indeed different from the class of gradient-based attacks.
+
+
Defense\Attack
FGSM-curr
AttNet-curr
FGSM-curr
AttNet-curr
n=0.3
n=0.4
No defense
1.000
1.000
1.000
1.000
AdvFGSM1
0.996
1.000
0.984
1.000
AdvFGSM80
0.473
0.899
0.131
0.903
Sens FGSM
0.048
0.965
0.038
0.902
No defense Adv FGSM1 AdvFGSM80
m=0.5
m=0.6
1.000
1.000
1.000
1.000
0.985
1.000
0.966
1.000
0.089
0.897 1.000
0.021
0.897
Sens FGSM
0.039
0.033 0.903
+
+Table 4: Error rates of FGSM vs learning-based attack network (AttNet) on various adversariallytrained classifiers for MNIST. FGSM-curr/AttNet-curr means they are computed/trained for the specific classifier on the leftmost column. Note that FGSM fails to attack hardened networks (Adv FGSM80 and Sens FGSM), whereas AttNet can still attack them successfully.
+
+# 4.2 MINIMAX GAME FOR LEARNING-BASED ATTACKS
+
+Finally, we consider the dynamics of the pair of classifier-attacker when each player can change its parameters. Given the current classifier $u$ , an optimal whitebox attacker parameter $v$ is the maximizer of the risk $f ( u , v )$
+
+$$
+v ^ { * } ( u ) \triangleq \arg \operatorname* { m a x } _ { v } f ( u , v ) .
+$$
+
+Consequently, the defender should choose the classifier parameters $u$ such that the maximum risk is minimized
+
+$$
+u ^ { * } \triangleq \arg \operatorname* { m i n } _ { u } \operatorname* { m a x } _ { v } f ( u , v ) = \arg \operatorname* { m i n } _ { u } f ( u , v ^ { * } ( u ) ) .
+$$
+
+This solution to the continuous minimax problem has a natural interpretation as the best worst-case solution. Assuming the attacker is optimal, i.e., it chooses the best attack from (10) given $u$ , no other defense can achieve a lower risk than the minimax defense $u ^ { * }$ in (11). The minimax defense is also a conservative defense. If the attacker is not optimal, and/or if the attack does not know the defense $u$ exactly (as in blackbox attacks), the actual risk can be lower than what the minimax solution $f ( u ^ { * } , v ^ { * } ( u ^ { * } ) )$ predicts. Before proceeding further, we point out that the claims above apply to the global minimizer $u ^ { * }$ and the maximizer function $v ^ { \ast } ( \cdot )$ , but in practice we can only find local solutions for complex risk functions of deep classifiers and attackers.
+
+To solve (11), we analyze the problem similarly to (5)-(7) from the previous section. At each iteration, the defender should choose $u$ in expectation of the attack and minimize $f ( u , v ^ { * } ( u ) )$ . We use
+
+gradient descent
+
+$$
+u u - \lambda \frac { d f ( u , v ^ { * } ( u ) ) } { d u } ,
+$$
+
+where the total derivative $\textstyle { \frac { d f } { d u } }$ is
+
+$$
+\frac { d f } { d u } = \frac { \partial f ( u , v ^ { * } ( u ) ) } { \partial u } + \frac { \partial v ^ { * } ( u ) } { \partial u } \frac { \partial f ( u , v ) } { \partial v } .
+$$
+
+Since the exact maximizer $v ^ { * } ( u )$ is difficult to find, we only update $v$ incrementally by one (or more) steps of gradient-ascent update
+
+$$
+v v + \sigma \frac { \partial f ( u , v ) } { \partial v } .
+$$
+
+The resulting formulation is closely related to the unrolled optimization (Metz et al., 2016) proposed for training GANs, although the latter has a very different cost function $f$ . Using the single update (14), the total derivative is
+
+$$
+\frac { d f } { d u } = \frac { \partial f ( u , v ^ { * } ( u ) ) } { \partial u } + \sigma \frac { \partial ^ { 2 } f ( u , v ) } { \partial u \partial v } \frac { \partial f ( u , v ) } { \partial v } .
+$$
+
+Similar to hardening a classifier against gradient-based attacks by minimizing (7) at each iteration, the gradient update of $u$ for $f ( u , v )$ can be done using the gradient of the following sensitivitypenalized function
+
+$$
+f _ { \mathrm { s e n s } } ( u ) \triangleq f ( u , v ) + { \frac { \sigma } { 2 } } \left\| { \frac { \partial f ( u , v ) } { \partial v } } \right\| ^ { 2 } .
+$$
+
+In other words, $u$ is chosen not only to minimize the risk but also to prevent the attacker from exploiting the sensitivity of $f$ to $v$ . The algorithm is summarized in Alg. 1.
+
+# Algorithm 1 Minimax Optimization by Sensitivity Penalization
+
+
a Yi-1 of(ui-1,Ui-1 Min step: Ui = Ui-1- Xi f(ui-1,Ui-1)+
du 2 du
end for Return (UT,UT).
+
+Note that this algorithm is actually independent of the adversarial example problem, and can be used for other minimax problems as well.
+
+# 4.3 MINIMAX VS MAXIMIN PROBLEMS
+
+In analogy with the minimax problem, we can also consider the maximin solution defined by
+
+$$
+v ^ { * } \triangleq \arg \operatorname* { m a x } _ { v } \operatorname* { m i n } _ { u } f ( u , v ) = \arg \operatorname* { m a x } _ { v } f ( u ^ { * } ( v ) , v ) .
+$$
+
+where
+
+$$
+u ^ { * } ( v ) \triangleq \arg \operatorname* { m i n } _ { u } f ( u , v )
+$$
+
+is the minimizer function. Here we are abusing the notations for the minimax solution $u ^ { * }$ , the maximin solution $v ^ { * }$ , the minimizer $u ^ { * } ( \cdot )$ , and the maximizer $v ^ { \ast } ( \cdot )$ . Similar to the minimax solution, the maximin solution has an intuitive meaning – it is the best worst-case solution for the attacker. Assuming the defender is optimal, i.e., it chooses the best defense from (18) that minimizes the risk $f ( u , v )$ given the attack $v$ , no other attack can inflict a higher risk than the maximin attack $v ^ { * }$ . It is also a conservative attack. If the defender is not optimal, and/or if the defender does not know the attack $v$ exactly, the actual risk can be higher than what the solution $f ( u ^ { * } ( v ^ { * } ) , v ^ { * } )$ predicts. Note that the maximin scenario where the defender knows the attack method is not very realistic but is the opposite of the minimax scenario and provides the lower bound.
+
+To summarize, minimax and maximin defenses and attacks have the following inherent properties.
+
+Lemma 1. Let $u ^ { * } , v ^ { * } ( u ) , v ^ { * } , u ^ { * } ( v )$ be the solutions of $( I I ) , ( I O ) , ( I 7 ) , ( I 8 ) .$ .
+
+1. $f ( u , v ^ { * } ( u ) ) \geq f ( u , v )$ : For any given defense $u$ , the max attack $v ^ { * } ( u )$ is the most effective attack.
+2. $f ( u ^ { * } , v ^ { * } ( u ^ { * } ) ) \leq f ( u , v ^ { * } ( u ) )$ : Against the optimal attack $v ^ { * } ( u )$ , the minimax defense $u ^ { * }$ is the most effective defense.
+3. $f ( u ^ { * } ( v ) , v ) \leq f ( u , v )$ : For any given attack $v$ , the min defense $u ^ { * } ( v )$ is the most effective defense.
+4. $f ( u ^ { * } ( v ) , v ^ { * } ) \geq f ( u ^ { * } ( v ) , v )$ : Against the optimal defense $u ^ { * } ( v )$ , the maximin attack $v ^ { * }$ is the most effective attack.
+5. $\begin{array} { r } { \operatorname* { m a x } _ { v } \operatorname* { m i n } _ { u } f ( u , v ) \leq \operatorname* { m i n } _ { u } \operatorname* { m a x } _ { v } f ( u , v ) . } \end{array}$ : The risk of the best worst-case attack is lower than that of the best worst-case defense.
+
+These properties follow directly from the definitions. The lemma helps us to better understand the dependence of defense and attack, and gives us the range of the possible risk values which can be measured empirically. To find maximin solutions, we use the same algorithm (Alg. 1) except that the variables $u$ and $v$ are switched and the sign of $f$ is flipped before the algorithm is called.
+
+# 4.4 EXPERIMENTS
+
+In addition to minimax and maximin optimization, we also consider as a reference algorithm the alternating descent/ascent method used in GAN training Goodfellow et al. (2014a)
+
+$$
+u u - \lambda \frac { \partial f } { \partial u } , \quad v v + \sigma \frac { \partial f } { \partial v } .
+$$
+
+Note that alternating descent/ascent finds local saddle points which are not necessarily minimax or maximin solutions, and therefore its solution will in general be different from the solution from Alg. 1. The difference of the solutions from three optimizations – Minimax, Maximin, and Alternating descent/ascent (Alt) – applied to a common problem, is demonstrated in Fig. 3. The figure shows the test error over the course of optimization starting from random initializations. One can see that Minimax (top blue curves) and Alt (middle green curves) converge to different values suggesting the learned classifiers will also be different.
+
+
+Figure 3: Convergence of the test error rates for Minimax optimization (blue), Alternating ascent/descent (green), and Maximin optimization (red) for MNIST.
+
+Table 5 compares the robustness of the classifiers trained by Minimax and Alt against the AttNet attack (1st/2nd rows and 2nd column for each $\eta$ .) Minimax defense is more robust than Alt defense at $\eta = 0 . 3$ (0.020 vs 0.104) and at $\eta = 0 . 4$ (0.552 vs 0.873). For larger $\eta$ ’s, both are unusably vulnerable. Different performance of the two classifiers implies that the minimax solution found by Alg. 1 is different from the local saddle point found by alternating descent/ascent. In addition, against FGSM attacks, Minimax is moderately robust $( 0 . 2 1 8 - 0 . 3 4 2 )$ despite that the classifiers are not specifically trained against gradient-based attacks. In contrast, Sens FGSM is very vulnerable (0.902 – 1.000) against AttNet which we have already observed. This result suggests that the class of AttNet attacks and the class of gradient-based attacks are indeed different, and the former class is larger than the latter.
+
+Table 5: Error rates of Minimax-, Alt-, and adversarially-trained (Sens FGSM) classifiers for MNIST. Minimax is overall better than Alt against AttNet-curr, and is also moderately robust against the out-of-class attack (FGSM-curr).
+
+
Defense\Attack
FGSM-curr
AttNet-curr
FGSM-curr
AttNet-curr
m=0.3
n=0.4
Minimax
0.218
0.020
0.238
0.552
Alt
0.244
0.104
0.503
0.873
Sens FGSM
0.048
0.965
0.038
0.902
Minimax Alt
m=0.5
m=0.6
0.342
1.000
0.299
1.000
0.289
0.902
0.157
0.899
Sens FGSM
0.039
1.000
0.033
0.903
+
+Lastly, the adversarial examples generated by various attacks in the paper have diverse patterns and are shown in Fig. 4 of the appendix.
+
+# 5 DISCUSSION
+
+# 5.1 ROBUSTNESS AGAINST MULTIPLE ATTACK TYPES
+
+We discuss some limitations of the framework and also propose an extension. Ideally, a defender should find a robust classifier against the worst attack from a very large class of attacks such as optimization-based attacks. However, it is difficult to train classifiers against attacks from a large class. On the other hand, if the class is too small, then the worst attack from that class is not representative of all possible worst attacks, and therefore the minimax defense found will not be robust to out-of-class attacks. The trade-off seems inevitable.
+
+It is, however, possible to build a defense against multiple specific types of attacks. Suppose $z _ { 1 } ( u ) , . . . , z _ { m } ( u )$ are $m$ different types of attacks, e.g., $z _ { \mathrm { 1 } } \mathrm { = F G S M }$ , $z _ { \mathrm { 2 } } { = } \mathrm { I F G S M }$ , etc. The minimax defense for the combined attack is the solution to the mixed continuous-discrete problem
+
+$$
+\operatorname* { m i n } _ { u } \operatorname* { m a x } \{ f ( u , z _ { 1 } ( u ) ) , . . . , f ( u , z _ { m } ( u ) ) \} .
+$$
+
+Additionally, suppose $z _ { m + 1 } ( u , v ) , . . . , z _ { m + n } ( u , v )$ are $n$ different types of learning-based attacks, e.g., $z _ { m + 1 } = 2$ -layer dense net, $z _ { m + 2 } = 5$ -layer convolutional nets, etc. The minimax defense against the mixture of multiple fixed-type and learning-based attacks can be found by solving
+
+$$
+\operatorname* { m i n } _ { u } \operatorname* { m a x } \{ f ( u , z _ { 1 } ( u ) ) , \dots , f ( u , z _ { m } ( u ) ) , \operatorname* { m a x } _ { v } f ( u , z _ { m + 1 } ( u , v ) ) , \dots , \operatorname* { m a x } _ { v } f ( u , z _ { m + n } ( u , v ) ) \} .
+$$
+
+Due to the huge computational demand to solve (21), we leave it as a future work.
+
+# 5.2 ADVERSARIAL EXAMPLES AND PRIVACY ATTACKS
+
+Lastly, we discuss a bigger picture of the game between adversarial players. The minimax optimization arises in the leader-follower game (Bruckner & Scheffer, 2011) with the constant sum constraint. ¨ The leader-follower setting makes sense because the defense $=$ classifier parameters) is often public knowledge and the attacker exploits the knowledge. Interestingly, the problem of the attack on privacy (Hamm, 2016) has a very similar formulation as the adversarial attack problem, different only in that the classifier is an attacker and the data perturbator is a defender. In the problem of privacy preservation against inference, the defender is a data transformer $z ( x )$ (parameterized by $u$ ) which perturbs the raw data, and the attacker is a classifier (parameterized by $v$ ) who tries to extract sensitive information such as identity from the perturbed data such as online activity of a person. The transformer is the leader, such as when the privacy mechanism is public knowledge, and the classifier is the follower as it attacks the given perturbed data. The risk for the defender is therefore the accuracy of the inference of sensitive information measured by $- E [ l ( \boldsymbol { z } ( \boldsymbol { x } ; \boldsymbol { u } ) , \boldsymbol { y } ; \boldsymbol { v } ) ]$ . Solving the minimax risk problem $\begin{array} { r l } { { ( \operatorname* { m i n } _ { u } \operatorname* { m a x } _ { v } - E [ l ( z ( x ; u ) , y ; v ) ] ) } \quad } & { { } } \end{array}$ gives us the best worst-case defense when the classifier/attacker knows the transformer/defender parameters, which therefore gives us a robust data transformer to preserve the privacy against the best inference attack (among the given class of attacks.) On the other hand, solving the maximin risk problem $\begin{array} { r l } { } & { { } ( \operatorname* { m a x } _ { v } \operatorname* { m i n } _ { u } - \bar { E } [ l ( \bar { z ( x ; u ) } , y ; v ) ] ) } \end{array}$ gives us the best worst-case classifier/attacker when its parameters are known to the transformer. As one can see, the problems of adversarial attack and privacy attack are two sides of the same coin which can be addressed by similar frameworks and optimization algorithms.
+
+# 6 CONCLUSION
+
+In this paper, we present a continuous game formulation of adversarial attacks and defenses using a learning-based attack class implemented by neural networks. We show that this class of attacks is quite different from the gradient-based attacks. While a classifier robust to all types of attack may yet be an elusive goal, the minimax defense against the neural network-based attack class is well-defined and practically achievable. We show that the proposed optimization method can find minimax defenses which are more robust than adversarially-trained classifiers and the classifiers from simple alternating descent/ascent. We demonstrate these with MNIST and CIFAR-10.
+
+# REFERENCES
+
+Shumeet Baluja and Ian Fischer. Adversarial transformation networks: Learning to generate adversarial examples. arXiv preprint arXiv:1703.09387, 2017.
+Michael Bruckner and Tobias Scheffer. Stackelberg games for adversarial prediction problems. In ¨ Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 547–555. ACM, 2011.
+Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017.
+Nilesh Dalvi, Pedro Domingos, Sumit Sanghai, Deepak Verma, et al. Adversarial classification. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 99–108. ACM, 2004.
+Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Analysis of classifiers’ robustness to adversarial perturbations. arXiv preprint arXiv:1502.02590, 2015.
+Amir Globerson and Sam Roweis. Nightmare at test time: robust learning by feature deletion. In Proceedings of the 23rd international conference on Machine learning, pp. 353–360. ACM, 2006.
+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.
+Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
+Jihun Hamm. Minimax filter: Learning to preserve privacy from inference attacks. arXiv preprint arXiv:1610.03577, 2016.
+Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvari. Learning with a strong adversary. ´ arXiv preprint arXiv:1511.03034, 2015.
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016a.
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016b.
+Gert RG Lanckriet, Laurent El Ghaoui, Chiranjib Bhattacharyya, and Michael I Jordan. A robust minimax approach to classification. Journal of Machine Learning Research, 3(Dec):555–582, 2002.
+Jiajun Lu, Theerasit Issaranon, and David Forsyth. Safetynet: Detecting and rejecting adversarial examples robustly. arXiv preprint arXiv:1704.00103, 2017.
+Chunchuan Lyu, Kaizhu Huang, and Hai-Ning Liang. A unified gradient regularization family for adversarial examples. In Data Mining (ICDM), 2015 IEEE International Conference on, pp. 301–309. IEEE, 2015.
+Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. arXiv preprint arXiv:1705.09064, 2017.
+Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016.
+Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. arXiv preprint arXiv:1702.04267, 2017.
+Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. arXiv preprint arXiv:1610.08401, 2016.
+Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, Pascal Frossard, and Stefano Soatto. Analysis of universal adversarial perturbations. arXiv preprint arXiv:1705.09554, 2017.
+Linh Nguyen and Arunesh Sinha. A learning approach to secure learning. arXiv preprint arXiv:1709.04447, 2017.
+Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 582–597. IEEE, 2016.
+Louis B Rall. Automatic differentiation: Techniques and applications. 1981.
+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 Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble adversarial \` training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
+
+# A RESULTS WITH MNIST
+
+The architecture of the MNIST classifier is similar to the Tensorflow model 2, and is trained with the following hyperparameters: $\{ B a t c h s i z e = I 2 8 \}$ , optimizer $=$ AdamOptimizer with $\lambda = 1 0 ^ { - 4 }$ , total # of iteration $\scriptstyle : = 5 0 , 0 0 0 . \}$
+
+The attack network has three hidden fully-connected layers of 300 units, trained with the following hyperparameters:
+{Batch $s i z e ~ = ~ I 2 8$ , dropout rate $= ~ 0 . 5$ , optimizer $=$ AdamOptimizer with $1 0 ^ { - 3 }$ , total $\#$ of iteration $\scriptstyle : = 3 0 , 0 0 0 . \}$
+
+For minimax, alt, and maximin optimization, the total number of iteration was 100,000. The sensitivity-penalty coefficient of $\gamma = 1$ was used in Alg. 1.
+
+
+Figure 4: Adversarial samples generated from different attacks at $\eta = 0 . 2$ . (a) Original data (b) FGSM1 (c) FGSM80 (d) IFGSM1 (e) Minimax (f) Alt (g) Maximin. Note the diversity of patterns.
+
+# B RESULTS WITH CIFAR-10
+
+We preprocess the CIFAR-10 dataset by removing the mean and normalizing the pixel values with the standard deviation of all pixels in the image. It is followed by clipping the values to $\pm 2$ standard deviations and rescaling to $[ - 1 , 1 ]$ . The architecture of the CIFAR classifier is similar to the Tensorflow model 3 but is simplified further by removing the local response normalization layers. With the simple structure, we attained $\sim 7 8 \%$ accuracy with the test data. The classifier is trained with the following hyperparameters:
+
+$\{ B a t c h s i z e = I 2 8 ,$ , optimizer $=$ AdamOptimizer with $\lambda = 1 0 ^ { - 4 }$ , total # of iteration $\scriptstyle : = I O O , O O O . \}$
+
+The attack network has three hidden fully-connected layers of 300 units, trained with the following hyperparameters:
+$\{ B a t c h \ s i z e \ = \ I 2 8 ,$ , dropout rate $= 0 . 5$ , optimizer $=$ AdamOptimizer with $\sigma = 1 0 ^ { - 3 }$ , total # of iteration $\scriptstyle : = 3 0 , 0 0 0 . \}$
+
+For minimax, alt, and maximin optimization, the total number of iteration was 100,000. The sensitivity-penalty coefficient of $\gamma = 1$ was used in Alg. 1.
+
+In the rest of the appendix, we repeat all the experiments with the MNIST dataset using the CIFAR10 dataset.
+
+
Defense\Attack
No attack
FGSM
IFGSM
n=0.1
n=0.2
n=0.3
m=0.4
n=0.1
m=0.2
n=0.3
m=0.4
No defense
0.222
0.976
0.825
0.869
0.884
0.668
0.907
0.959
0.971
+
+Table 6: Error rates of FGSM and IFGSM attacks on the original classifier for cifar10. These attacks can cause large misclassification for the given range of $\eta$ .
+
+
Defense\Attack
No attack
FGSM
IFGSM
n=0.1
n=0.2
n=0.3
n=0.4
n=0.1
n=0.2
m=0.3
n=0.4
Adv train
n/a
0.196
0.642
0.668
0.702
0.373
0.658
0.741
0.750
+
+Table 7: Error rates of FGSM and IFGSM attacks on the adversarially-trained classifiers for CIFAR10. This defense can significantly lower the errors from the attacks, although not as low as the MNIST problem.
+
+
+Figure 5: Cat and mouse game of FGSM attacks and adversarial training for CIFAR-10. The upper green points are the error rates after adversarial training, and the lower orange points are the error rates after FGSM attack. After 160 iterations $\eta = 0 . 3 )$ , the error rate is still oscillating.
+
+
+Figure 6: Convergence of test error rates for sensitivity-penalized optimization with MNIST.
+
+
+Figure 7: Convergence of the test error rates for Minimax optimization (blue), Alternating ascent/descent (green), and Maximin optimization (red) for CIFAR-10.
+
+Table 8: Error rates of different attacks on various adversarially-trained classifiers for CIFAR-10. FGSM-curr means the FGSM attack on the specific classifier on the leftmost column. Adv FGSM is the classifier adversally trained with FGSM attacks. Sens FGSM is the result of minimizing the sensitivity penalty (7). LWA FGSM is the result of minimizing (7) without the gradient-norm term.
+
+
Defense\Attack
No attack
FGSM
FGSM-curr
FGSM-1
FGSM-2
:
FGSM-80
n=0.1
No defense AdvFGSM1
0.222 0.220
0.976 0.196
0.671 0.680
: :
0.595 0.616
0.976 0.245
Adv FGSM2
0.258
0.640
0.484
:
0.612
0.708
AdvFGSM80
0.228
0.644
0.529
:
0.087
0.086
LWAFGSM Sens FGSM
0.223 0.223
0.283 0.342
0.692 0.701
:
0.652 0.663
0.125 0.106
n=0.2
No defense
0.222
0.825
0.692
: :
0.819
0.969
AdvFGSM1
0.216
0.642
0.630
:
0.609
0.264
Adv FGSM2
0.305
0.579
0.290
:
0.599
0.556
AdvFGSM80
0.218
0.445
0.502
·
0.078
0.078
LWAFGSM
0.209
0.689
0.666
··
0.615
0.105
Sens FGSM
0.209
0.713
0.672
:
0.637
0.073
n=0.3
No defense AdvFGSM1
0.222
0.869
0.891
:
0.877
0.955
0.214
0.668
0.628
:
0.642
0.424
Adv FGSM2
0.205
0.499
0.407
:
0.514
0.389
AdvFGSM80
0.223
0.471
0.324
:
0.081
0.084
LWAFGSM
0.215
0.686
0.634
:
0.640
0.215
Sens FGSM
0.213
0.715
0.628
·
0.652
0.089
n=0.4
No defense AdvFGSM1
0.222
0.884
0.899
:
0.892
0.941
0.208
0.702
0.687
:
0.697
0.536
Adv FGSM2
0.206
0.592
0.546
:
0.618
0.545
AdvFGSM80
0.225
0.497
0.385
:
0.121
0.124
LWAFGSM
0.210
0.693
0.639
:
0.626
0.173
Sens FGSM
0.214
0.714
0.635
·
0.640
0.109
+
+Table 9: Error rates of FGSM vs learning-based attack network (AttNet) on various adversariallytrained classifiers for CIFAR-10. FGSM-curr/AttNet-curr means they are computed/trained for the specific classifier on the leftmost column. Note that FGSM fails to attack against the ‘hardened’ networks (Adv FGSM80 and Sens FGSM), but AttNet can still attack them successfully.
+
+
Defense\Attack
FGSM-curr
AttNet-curr
FGSM-curr
AttNet-curr
n=0.1
=0.2
No defense
0.976
0.740
0.969
0.905
Adv FGSM1
0.245
0.999
0.264
1.000
Adv FGSM80
0.086
1.000
0.078
1.000
Sens FGSM
0.106
0.898
0.073
0.979
No defense Adv FGSM1 AdvFGSM80
m=0.3
m=0.4
0.955
0.888
0.941
0.999
0.424
1.000
0.536
1.000
0.084
1.000
0.124
0.900
Sens FGSM
0.089
1.000
0.109
1.000
+
+
Defense\Attack
FGSM-curr
AttNet-curr
FGSM-curr
AttNet-curr
n=0.1
m=0.2
Minimax
0.967
0.276
0.980
0.418
Alt
0.994
0.264
0.996
0.857
Sens FGSM
0.106
0.898
0.073
0.979
Minimax Alt
n=0.3
m=0.4
0.967
0.875
0.931
0.994
0.987
0.896
0.958
1.000
Sens FGSM
0.089
1.000
0.109
1.000
+
+Table 10: Error rates of Minimax-, Alt-, and adversarially-trained (Sens FGSM) classifiers for MNIST. While Minimax and Alt are both vulnerable to AttNet attacks, Minimax is much less vulnerable than Alt at $\eta = 0 . 2$ .
\ No newline at end of file
diff --git a/md/train/ByxCrerKvS/ByxCrerKvS.md b/md/train/ByxCrerKvS/ByxCrerKvS.md
new file mode 100644
index 0000000000000000000000000000000000000000..fe6e22340a4c1e69e8ef3afa7aeb6963caca9b72
--- /dev/null
+++ b/md/train/ByxCrerKvS/ByxCrerKvS.md
@@ -0,0 +1,271 @@
+# SET FUNCTIONS FOR TIME SERIES
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Despite the eminent successes of deep neural networks, many architectures are often hard to transfer to irregularly-sampled and asynchronous time series that occur in many real-world datasets, such as healthcare applications. This paper proposes a novel framework for classifying irregularly sampled time series with unaligned measurements, focusing on high scalability and data efficiency. Our method SEFT (Set Functions for Time Series) is based on recent advances in differentiable set function learning, extremely parallelizable, and scales well to very large datasets and online monitoring scenarios. We extensively compare our method to competitors on multiple healthcare time series datasets and show that it performs competitively whilst significantly reducing runtime.
+
+# 1 INTRODUCTION
+
+With the increasing digitalization, measurements over extensive time periods are becoming ubiquitous. Nevertheless, in many application domains, in particular healthcare (Yadav et al., 2018), measurements might not necessarily be observed at a regular rate or could be misaligned. Moreover, the presence or absence of a measurement and its observation frequency may carry information of its own (Little & Rubin, 2014), such that imputing the missing values is not always desired.
+
+While some algorithms can be readily applied to datasets with varying length, these methods usually assume regular sampling of the data and/or require the measurements across modalities to be aligned/synchronized, preventing their application to the aforementioned settings. Existing approaches for unaligned measurements, by contrast, typically rely on imputation to obtain a regularlysampled version of a dataset for classification. Learning a suitable imputation scheme, however, requires understanding the underlying dynamics of a system; this task is significantly more complicated and not necessarily required when classification is the main goal. Furthermore, even though a decoupled imputation scheme followed by classification is generally more scalable, it may lose information (in terms of “missingness patterns”) that could be crucial for prediction tasks. In addition, the fact that decoupled schemes perform worse than methods that are trained end-to-end has been has been empirically demonstrated by Li & Marlin (2016). Approaches that jointly optimize both tasks also add a large computational overhead, thus suffering from poor scalability or high memory requirements.
+
+Our method is motivated by the understanding that, while RNNs and similar architectures are well suited for capturing and modelling the dynamics of a time series and thus excel at tasks such as forecasting, retaining the order of an input sequence can even be a disadvantage in classification scenarios (Vinyals et al., 2015). We show that by relaxing the condition that a sequence must be processed in order, we can naturally derive an architecture that directly accounts for (i) irregular sampling, and (ii) unsynchronized measurements. Our method SEFT: Set Functions for Time Series, extends recent advances in set function learning to irregular sampled time series classification tasks, yields state-of-the-art performance, is highly scalable and improves over current approaches by almost an order of magnitude in terms of runtime.
+
+With SEFT, we propose to rephrase the problem of classifying time series as classifying a set of observations. We show how set functions can be exploited to learn classifiers that are naturally applicable to unaligned and irregularly sampled time series, leading to state-of-the-art performance in irregularly-sampled time series classification tasks. Our approach can be interpreted as learning dataset-specific summary statistics of time series which are optimized to separate instances by class.
+
+Furthermore, our method is highly parallelizable and can be readily extended to an online monitoring setup with up to thousands of patients.
+
+# 2 RELATED WORK
+
+This paper focuses on classifying time series with irregular sampling and potentially unaligned measurements. We briefly discuss recent work in this field; all approaches can be broadly grouped into the following three categories.
+
+Irregular sampling as missing data While the problem of supervised classification in the presence of missing data is closely related to irregular sampling on time series, there are some core differences. Missing data is usually defined with respect to a number of features that could be observed, whereas time series themselves can have different lengths and a “typical” number of observed values might not exist. Generally, an irregularly-sampled time series can be converted into a missing data problem by discretizing the time axis into non-overlapping intervals, and declaring intervals in which no data was sampled as missing. This approach is followed by Marlin et al. (2012), where a Gaussian Mixture Model was used to do semi-supervised clustering on electronic health records. Similarly, Lipton et al. (2016) discretize the time series into intervals, aggregate multiple measurements within an interval, and add missingness indicators to the input of a Recurrent Neural Network. By contrast, Che et al. (2018) present several variants of the Gated Recurrent Unit (GRU) combined with imputation schemes. Most prominently, the GRU-model was extended to include a decay term (GRU-D), such that the last observed value is decayed to the empirical mean of the time series via a learnable decay term. While these approaches are applicable to irregularly-sampled data, they either rely on imputation schemes or empirical global estimates on the data distribution (our method, by contrast, requires neither), without directly exploiting the global structure of the time series.
+
+Frameworks supporting irregular sampling Some frameworks support missing data. For example, Lu et al. (2008) directly defined a kernel on irregularly-sampled time series, permitting subsequent classification and regression with kernel-based classifiers or regression schemes. Furthermore, Gaussian Processes (Williams & Rasmussen, 2006) constitute a common probabilistic model for time series; they directly permit modelling of continuous time data using mean and covariance functions. Along these lines, Li & Marlin (2015) derived a kernel on Gaussian Process Posteriors, allowing the comparison and classification of irregularly-sampled time series using kernel-based classifiers. Nevertheless, all of these approaches still rely on separate tuning/training of the imputation method and the classifier so that structures supporting the classification could be potentially missed in the imputation step. An emerging line of research employs Hawkes processes (Hawkes, 1971; Liniger, 2009), i.e. a specific class of self-exciting point processes, for time series modelling and forecasting (Mei & Eisner, 2017; Yang et al., 2017; Xiao et al., 2017). While Hawkes processes exhibit extraordinary performance in these domains, there is no standardised way of using them for classification. Previous work (Lukasik et al., 2016) trains multiple Hawkes processes (one for each label) and classifies a time series by assigning it the label that maximises the respective likelihood function. Since this approach does not scale to our datasets, we were unable to perform a fair comparison. We conjecture that further research will be required to make Hawkes processes applicable to general time series classification scenarios.
+
+End-to-end learning of imputation schemes Methods of this type are composed of two modules with separate responsibilities, namely an imputation scheme and a classifier, where both components are trained discriminatively and end-to-end using gradient-based training. Recently, Li & Marlin (2016) proposed the Gaussian Process Adapters (GP Adapters) framework, where the parameters of a Gaussian Process Kernel are trained alongside a classifier. The Gaussian Process gives rise to a fixed-size representation of the irregularly-sampled time series, making it possible to apply any differentiable classification architecture. This approach was further extended to multivariate time series by Futoma et al. (2017) using Multi-task Gaussian Processes (MGPs) (Bonilla et al., 2008), which allow correlations between the imputed channels. Moreover, Futoma et al. (2017) made the approach more compatible with time series of different lengths by applying a Long Short Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) classifier. Motivated by the limited scalability of approaches based on GP Adapters, Shukla & Marlin (2019) suggest an alternative imputation scheme, the interpolation prediction networks. It applies multiple semi-parametric interpolation schemes to obtain a regularly-sampled time series representation. The parameters of the interpolation network are trained with the classifier in an end-to-end setup.
+
+
+Figure 1: Schematic overview of SEFT’s architecture. The first panel exemplifies a potential input, namely a multivariate time series, consisting of 3 modalities $m _ { 1 } , m _ { 2 } , m _ { 3 }$ . We treat the $j ^ { \mathrm { t h } }$ observation as a tuple $( t _ { j } , z _ { j } , m _ { j } )$ , comprising a time $t _ { j }$ , a value $z _ { j }$ , and a modality indicator $m _ { j }$ . All observations are summarized as a set of such tuples. Each set of tuples belonging to the same modality is then separately embedded $( f ^ { \prime } )$ and subsequently aggregated (agg). An attention mechanism (attn) as described in Section 3.3 is then applied to learn the importance of individual and consecutive observations. Respective query matrices for 2 attentions head are illustrated in purple and orange blocks. The results of each attention head are then concatenated and used as the input for final classification layers.
+
+# 3 PROPOSED METHOD
+
+Our paper focuses on the problem of time series classification of irregularly sampled and unaligned time series. We first define the required terms before describing our models
+
+# 3.1 NOTATION & REQUIREMENTS
+
+Definition 1 (Time series). We describe a time series of an instance i as a set $s _ { i }$ of $M : = \mathrm { l e n } ( S _ { i } )$ observations $s _ { j }$ such that $\mathcal { S } _ { i } : = \{ s _ { 1 } , . . . , s _ { M } \}$ . We assume each observation $s _ { j }$ to be represented as a tuple $( t _ { j } , z _ { j } , m _ { j } )$ , consisting of a time $t _ { j } \in \mathbb { R } ^ { + }$ , an observed value $z _ { j } \in \mathbb { R } ,$ , and a modality indicator $m _ { j } \in \{ 1 \cdot \dots D \}$ , where $D$ represents the dimensionality of the time series. We write $\Omega \subseteq \mathbb { R } ^ { + } \times \bar { \mathbb { R } } \times \mathbb { N } ^ { + }$ to denote the domain of observations. An entire time series can thus be represented as
+
+$$
+\begin{array} { r } { S _ { i } : = \left\{ \left( t _ { 1 } , z _ { 1 } , m _ { 1 } \right) , \ldots , \left( t _ { M } , z _ { M } , m _ { M } \right) \right\} , } \end{array}
+$$
+
+where for notational convenience we omitted the index $i$ .
+
+We leave this definition very general on purpose, allowing the length of each time series (comprising all channels, such as “heart rate”, “respiratory rate”, etc. of one instance) to differ, since our models are capable of handling this. Likewise, we neither enforce nor expect all time series to be synchronized, i.e. being sampled at the same time, but rather we permit unaligned or non-synchronized observations in the sense of not having to observe all modalities at each time point. Time series are collected in a dataset $\mathcal { D }$ .
+
+Definition 2 (Dataset). We consider a dataset $\mathcal { D }$ to contain $n$ time series. Elements of $\mathcal { D }$ are tuples, i.e. $\mathcal { D } : = \{ ( S _ { 1 } , y _ { 1 } ) , . . . , ( S _ { N } , y _ { N } ) \}$ , where $S _ { i }$ denotes the $i ^ { \mathrm { { t h } } }$ time series and $y _ { i } \in \{ 1 , \ldots , C \}$ its associated class label.
+
+Figure 1 gives a high-level overview of our method, including the individual steps required to perform classification. To get a more intuitive grasp of these definitions, we briefly illustrate our time series notation with an example. Let instance $i$ be an in-hospital patient, while the time series represent measurements of two channels of vital parameters during a hospital stay, namely heart rate (HR) and mean arterial blood pressure (MAP). We enumerate those channels as modalities 1 and 2. Counting from admission time, a HR of 60 and 65 beats per minute was measured after $0 . 5 \mathrm { h }$ and $3 . 0 \mathrm { h }$ , respectively, whereas MAP values of 80, 85, and $8 7 \mathrm { m m H g }$ were observed after $0 . 5 \mathrm { h }$ , $1 . 7 \mathrm { h }$ , and $2 . 5 \mathrm { h }$ . According to Definition 1, the time series is thus represented as $S _ { i } = \{ ( 0 . 5 , 6 0 , 1 ) , ( 3 , 6 5 , 1 ) , ( 0 . 5 , 8 0 , \bar { 2 } ) , ( 1 . 7 , 8 5 , 2 ) , ( 3 , 8 7 , 2 ) \}$ . In this example, observations are ordered by modality to increase readability; in practice, we are dealing with unordered sets.
+
+Definition 3 (Non-synchronized time series). We call a $D$ -dimensional time series nonsynchronized if there is at least one time point $t _ { j } ~ \in ~ \mathbb { R } ^ { + }$ at which at least one modality is not observed, i.e. if there exists $t _ { j } \in \mathbb { R } ^ { + }$ such that $| \{ ( t _ { k } , z _ { k } , m _ { k } ) \mid t _ { k } = t _ { j } \} | \neq D$ .
+
+Furthermore, we assume that no two measurements of the same modality $m _ { k }$ occur at the same time, i.e. $t _ { i } \neq t _ { j }$ for $i \neq j$ has to be satisfied for all measurements in $m _ { k }$ . This assumption is not required for technical reasons but for consistency. It also makes it possible to interpret the results later on.
+
+To summarize our generic setup, we do not require $M$ , the number of observations per time series, to be the same, i.e. $\mathrm { l e n } ( S _ { i } ) \neq \mathrm { l e n } ( S _ { j } )$ for $i \neq j$ is permitted, nor do we assume that the time points and modalities of the observations are the same across time series. This setting is common in biomedical time series, for example. Since typical machine learning algorithms are designed to operate on data of a fixed dimension, novel approaches to this non-trivial problem are required.
+
+# 3.2 OUR MODEL
+
+In the following, we describe an approach inspired by differentiable learning of functions that operate on sets (Zaheer et al., 2017; Wagstaff et al., 2019). We phrase the problem of classifying time series on irregular grids as learning a function $f$ on a set of arbitrarily many time series observations following Definition 1, i.e. ${ \cal S } = \{ ( t _ { 1 } , z _ { 1 } , m _ { 1 } ) , \ldots , ( t _ { M } , z _ { M } , m _ { M } ) \}$ , such that $f \colon S \mathbb { R } ^ { C }$ , where $s$ represents a generic time series of arbitrary cardinality and $\mathbb { R } ^ { C }$ corresponds to the logits of the $C$ classes in the dataset. As we previously discussed, we interpret each time series as an unordered set of measurements, where all information is conserved because the observation time is included for each set element. Specifically, we define $f$ to be a set function, i.e. a function that operates on a set and thus has to be invariant to the ordering of the elements in the set. Multiple architectures are applicable to constructing set functions such as Transformers (Lee et al., 2019; Vaswani et al., 2017), or Deep Sets (Zaheer et al., 2017). Due to preliminary experiments, where Transformers suffered from lower generalization performance in our setting1, we base this work on the framework of Zaheer et al. (2017). Intuitively, this can be seen as computing multivariate dataset-specific summary statistics, which are optimized to maximize classification performance. Thus, we sum-decompose the set function $f$ into the form
+
+$$
+f ( S ) = g \left( \frac { 1 } { | S | } \sum _ { s _ { j } \in S } h ( s _ { j } ) \right)
+$$
+
+where $h \colon \Omega \to { \mathbb { R } } ^ { d }$ and $g \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } ^ { C } }$ are neural networks, $d \in \mathbb { N } ^ { + }$ determines the dimensionality of the latent representation, and $s _ { j }$ represents a single observation of the time series $s$ . We can view the averaged representations $1 / | \mathcal { \bar { S } } | \sum _ { s _ { j } \in \mathcal { S } } h ( s _ { j } )$ in general as a dataset-specific summary statistic learned to best distinguish the class labels. Equation 2 also implies the beneficial scalability properties of our approach: each embedding can be calculated independently of the others; hence, the constant computational cost of passing a single observation through the function $h$ is scaled by the number of observations, resulting in a runtime of $\mathcal { O } ( M )$ for a time series of length $M$ .
+
+Recently, Wagstaff et al. (2019) derived requirements for a practical universal function representation of sum-decomposable set functions, i.e the requirements necessary for a sum-decomposable function to represent an arbitrary set-function given that $h$ and $g$ are arbitrarily expressive. In particular, they show that a universal function representation can only be guaranteed provided that $d \geq \operatorname* { m a x } _ { i } \operatorname { l e n } ( S _ { i } )$ is satisfied. During hyperparameter search we thus independently sample the dimensionality of the aggregation space, and allow it to be in the order of the number of observations that are to be expected in the dataset. Further, we explored the utilization of max, sum, and mean as alternative aggregation functions inspired by Zaheer et al. (2017); Garnelo et al. (2018).
+
+Intuition Our method can be connected to Takens’s embedding theorem (Takens, 1981) for dynamical systems: we also observe a set of samples from some unknown (but deterministic) dynamical process; provided the dimensionality of our architecture is sufficiently large2, we are capable of reconstructing the system up to diffeomorphism. The crucial difference is that we do not have to construct a time-delay embedding but rather, we let the network learn an embedding that is suitable for classification.
+
+Time encoding In order to represent the time point of an observation on a normalized scale, we employ variant of positional encodings, as introduced by Vaswani et al. (2017). Preliminary results indicated that this encoding scheme reduces the sensitivity towards initialization and training hyperparameters of a model. Specifically, the time encoding converts the one-dimensional time axis into a multi-dimensional input by passing the time $t$ of each observation through multiple sine and cosine functions of varying frequencies. Given a dimensionality $\tau \in \mathbb { N } ^ { + }$ of the time encoding, we refer to the encoded position as $x \in \mathbb { R } ^ { \tau }$ , where
+
+$$
+\begin{array} { r } { x _ { 2 k } ( t ) : = \sin \bigg ( \frac { t } { \operatorname* { m a x } _ { - } \mathrm { t s } ^ { 2 k / \tau } } \bigg ) } \\ { x _ { 2 k + 1 } ( t ) : = \cos \bigg ( \frac { t } { \operatorname* { m a x } _ { - } \mathrm { t s } ^ { 2 k / \tau } } \bigg ) } \end{array}
+$$
+
+with $k \in \{ 0 , \ldots , \tau / 2 \}$ and max ts representing the maximal time scale that is expected in the data. Intuitively, we select the wavelengths using a geometric progression from $2 \pi$ to max ts $\cdot 2 \pi$ , and treat the number of steps and the maximum timescale max ts as hyperparameters of the model. For all experiments time encodings were used, such that an observation is represented as $s _ { j } =$ $( x ( t _ { j } ) , z _ { j } , m _ { j } )$ .
+
+Loss function If not mentioned otherwise, we choose $h$ and $g$ in Equation 2 to be multilayer perceptron deep neural networks, parametrized by weights $\theta$ and $\psi$ , respectively. We thus denote these neural networks by $h _ { \theta }$ and $g _ { \psi }$ ; their parameters are shared across all instances per dataset. In our training setup, we follow Zaheer et al. (2017) and apply the devised set function to the complete time series, i.e. to the set of all observations for each time series. Overall, we optimize a loss function that is defined as
+
+$$
+\mathcal { L } ( \boldsymbol { \theta } , \boldsymbol { \psi } ) : = \mathbb { E } _ { ( S , \boldsymbol { y } ) \in \mathcal { D } } \left[ \ell \left( \boldsymbol { y } ; \boldsymbol { g } _ { \boldsymbol { \psi } } \left( \frac { 1 } { | S | } \sum _ { s _ { j } \in S } h _ { \boldsymbol { \theta } } ( s _ { j } ) \right) \right) \right] ,
+$$
+
+where $\ell ( \cdot )$ represents a task-specific loss function. In out setup, we either utilize the binary crossentropy in combination with a sigmoid activation function in the last layer for binary classification or multi-label classification tasks and categorical cross-entropy in combination with a softmax activation function in the last layer for multi-class classification tasks.
+
+# 3.3 ATTENTION-BASED AGGREGATION
+
+So far, our method permits encoding sets of arbitrary sizes into a fixed-size representation. For increasingly large set sizes, however, many irrelevant observations could influence the result of the set function. The mean aggregation function is particularly susceptible to this because the influence of an observation to the embedding shrinks proportionally to the size of the set. We thus suggest to use a weighted mean in order to allow the model to decide which observations are relevant and which should be considered irrelevant. This is equivalent to computing an attention $a ( S , s _ { j } )$ over the set input elements, and subsequently, computing the sum over all elements in the set.
+
+Our approach is based on scaled dot-product attention with multiple heads $i \in \{ 1 , \ldots , m \}$ in order to be able to cover different aspects of the aggregated $\mathrm { s e t } ^ { 3 }$ . We define $a ( \cdot )$ , i.e. the attention weight function of an individual time series, to depend on the overall set of observations. This is achieved by computing an embedding of the set elements using a smaller set function $f ^ { \prime }$ , and projecting the concatenation of the set representation and the individual set elements into a $d$ -dimensional space. Specifically, we have $K _ { j , i } ~ = ~ [ f ^ { \prime } ( { \cal { S } } ) , s _ { j } ] ^ { T } { \cal { W } } _ { i }$ where $W _ { i } \ \in \ \mathbb { R } ^ { ( \mathrm { i m } ( f ^ { \prime } ) + | s _ { j } | ) \times d }$ and $K \in \mathbb { R } ^ { | s | \times d }$ . Furthermore, we define a matrix of query points $Q \in \mathbb { R } ^ { m \times d }$ , which allow the model to summarize different aspects of the dataset via
+
+$$
+e _ { j , i } = \frac { K _ { j , i } \cdot Q _ { i } } { \sqrt { d } } \qquad \mathrm { a n d } \qquad a _ { j , i } = \frac { \exp ( e _ { j , i } ) } { \sum _ { j } \exp ( e _ { j , i } ) }
+$$
+
+where $a _ { j , i }$ represents the amount of attention that head $i$ gives to set element $j$ . The head-specific row $Q _ { i }$ of the query matrix $Q$ allows a head to focus on individual aspects (such as the distribution of one or multiple modalities) of a time series. For each head, we multiply the set element embeddings computed via the set function $f$ with the attentions derived for the individual instances, i.e. $r _ { i } =$ $\textstyle \sum _ { j } a _ { j , i } f ( s _ { j } )$ . The computed representation is concatenated and passed to the aggregation network $h _ { \theta }$ as in a regular set function, i.e. $r * = [ r _ { 1 } \ldots r _ { m } ]$ . In our setup, we initialize $Q$ with zeros, such that at the beginning of training, the attention mechanism is equivalent to computing the unweighted mean over the set elements.
+
+Overall, this aggregation function is similar to Transformers (Vaswani et al., 2017), but differs from them in a few key aspects. Standard Transformer blocks would use the information from all set elements in order to compute the embedding of an individual set element, leading to a runtime and space complexity of $\mathcal { O } ( \bar { n } ^ { 2 } )$ . In contrast, our approach computes the embeddings of set elements independently, leading lower runtime and memory complexity of ${ \mathcal { O } } ( n )$ . Further, we observed that computing embeddings with information from other set elements (as the Transformer does) actually decreases generalization performance (see Table 1 for details).
+
+# 4 EXPERIMENTS
+
+We executed all experiments and implementations in a unified code base, which we also make available4 to the community. While some of the datasets used subsequently have access restrictions, anybody can gain access after satisfying the defined requirements. This ensures the reproducibility of our results. Please consult Appendix A.2 for further details.
+
+# 4.1 DATASETS
+
+In order to benchmark the proposed method we selected 4 datasets with irregularly-sampled and non-synchronized measurements.
+
+Healing MNIST The H-MNIST dataset was introduced by Krishnan et al. (2015) in order to simulate characteristics which typically occur in medical time series. In our setup, we use a variant of this dataset. Every instance of the dataset contains 10 frames, derived from a single instance of MNIST dataset, where the digit is rotated according to an angle uniformly sampled between $- 9 0 ^ { \circ }$ to $9 0 ^ { \circ }$ . Furthermore, 3 randomly-selected consecutive frames are augmented by a square artefact in the top left corner of the image in order to indicate seasonality in the time series. Finally, $60 \%$ of the data points are randomly discarded in order to yield a final high-dimensional irregularly-sampled time series with non-synchronized measurements. Using these settings each instance has on average 3, 136 observations.
+
+MIMIC-III Tasks MIMIC-III (Johnson et al., 2016) is a widely-used, freely-accessible dataset containing around 50, 000 distinct ICU stays. The median length of stay is $2 . 1 \mathrm { d }$ and a wide range of physiological measurements (e.g. arterial blood pressure, respiration rate, heart rate) are recorded with a resolution of $^ { 1 \mathrm { h } }$ . Furthermore, laboratory test results, collected at irregular time intervals are available. Recently, Harutyunyan et al. (2019) defined a set of machine learning tasks, labels, and benchmarks using a subset of the MIMIC-III dataset. We trained and evaluated our method and competing methods on the binary mortality prediction task (M3-Mortality) and on the multiclass problem of phenotype classification (M3-Phenotyping), while applying additional filtering described in Appendix A.1. The goal of the mortality prediction task is to predict whether a patient will die during his/her hospital stay using only data from the first 48 hours of the ICU stay. This dataset contains around 21, 000 stays of which approximately $10 \%$ result in death. The phenotype classification task consists of 40, 000 patients, each of which can suffer from a multitude of 25 acute care conditions.
+
+Physionet Mortality Prediction Challenge The 2012 Physionet challenge dataset (Goldberger et al., 2000), which we abbreviate P-Mortality, contains $1 2 , 0 0 0 \mathrm { I C U }$ stays each of which lasts at least $4 8 \mathrm { h }$ . For each stay, a set of general descriptors (such as gender, age, height, weight) were collected at admission time. Depending on the course of the stay and patient status, up to 37 time series variables were measured (e.g. blood pressure, lactate, respiration rate, temperature). While some modalities might be measured in regular time intervals (e.g. hourly or daily), some are only collected when required. Not all variables are available for each stay. The goal of the challenge was to predict if—and with which certainty —a patient will die during the hospital stay. The training set consists of 8, 000 stays while the testing set comprises 4, 000 ICU visits. Both datasets are similarly imbalanced, with a prevalence of around $14 \%$ . For simplicity, the general descriptors (such as age and weight), were included as time points with a single observation at the beginning of the stay. This treatment is similar to the approach by Harutyunyan et al. (2019) in the MIMIC-III benchmarking datasets. Please refer to Table A.1, Table A.2, and Table A.3 in the appendix for a more detailed enumeration of samples sizes and label distributions. The total number of samples may slightly deviate from the originally published splits, as time series of excessive length prevented fitting some methods in reasonable time, and were therefore excluded.
+
+# 4.2 COMPETITOR METHODS
+
+GRU-simple GRU-SIMPLE (Che et al., 2018) augments the input at time $t$ of a Gated-RecurrentUnit RNN with a measurement mask $m _ { t } ^ { d }$ and a $\delta _ { t }$ matrix, which contains the time since the last measurement of the corresponding modality $d$ , such that
+
+$$
+\delta _ { t } = \left\{ \begin{array} { l l } { s _ { t } - s _ { t - 1 } + \delta _ { t - 1 } ^ { d } } & { t > 1 , m _ { t - 1 } ^ { d } = 0 } \\ { s _ { t } - s _ { t - 1 } } & { t > 1 , m _ { t - 1 } ^ { d } = 1 } \\ { 0 } & { t = 0 } \end{array} \right.
+$$
+
+where $s _ { t }$ represents the time associated with time step $t$ .
+
+Phased-LSTM The PHASED-LSTM (Neil et al., 2016) introduced a biologically inspired time dependent gating mechanism which regulates access to the hidden and cell state of a Long short-term RNN cell (Hochreiter & Schmidhuber, 1997). While this allows the network to handle event-based sequences with irregularly spaced observations, the approach does not support unaligned measurements. In order to still provide the architecture with all relevant information, we augment the input in a similar fashion as described for the GRU-SIMPLE approach.
+
+GRU-D GRU-D or GRU-Decay (Che et al., 2018) contains modifications to the GRU RNN cell, allowing it to decay past observations to the mean imputation of a modality using a learnable decay rate. By additionally providing the measurement masks as an input the recurrent neural network the last feed in value. Learns how fast to decay back to a mean imputation of the missing data modality.
+
+Interpolation Prediction Networks IP-NETWORKS (Shukla & Marlin, 2019) apply multiple semiparametric interpolation schemes to irregularly-sampled time series to obtain regularly-sampled representations that cover long-term trends, transients, and also sampling information. The method combines a univariate interpolation step with a subsequent multivariate interpolation; the parameters of the interpolation network are trained with the classifier in an end-to-end fashion.
+
+Transformer In the TRANSFORMER architecture (Vaswani et al., 2017) the elements of a sequence are encoded simultaneously and information between sequence elements is captured using MultiHead-Attention blocks. In our case, an individual sequence element corresponds to all measurements available at a given time point, augmented with a measurement indicator. Transformers are normally used for sequence-to-sequence modelling tasks and in our setup were adapted to classification tasks by mean-aggregating the final representation. This representation is then fed into a one-layer MLP to predict logits for the individual classes.
+
+
+Figure 2: Visualizations of a single attention head on an instance of the P-Mortality dataset. We display a set of variables relevant for assessing patient stability and organ failure: Serum Potassium (K), Lactate, Systolic Arterial Blood Pressure (SysABP), and Urine output. Darker colors represent higher attention values.
+
+# 4.3 EXPERIMENTAL SETUP
+
+To permit a fair comparison between the methods, we executed hyperparameter searches for each model on each dataset, composed of uniformly sampling 20 parameters according to Appendix A.3. Training was stopped after 20 epochs without improvement of the validation loss, the hyperparameters with the best overall validation performance were selected for quantifying the performance on the test set. The train, validation, and test splits were the same for all models and all evaluations. Final performance on the test set was calculated by 3 independent runs of the models; evaluation took place after the model was restored to the state with the best validation loss. In all subsequent benchmarks, we use the standard deviation of the test performance of these runs as generalization performance estimates.
+
+# 4.4 RESULTS
+
+The results are shown in Table 1. Overall, our proposed method exhibits the lowest per-epoch runtime on most datasets, while either yielding competitive or state-the-art performance. Further, the trade-off between runtime and performance of the proposed method is very good on all datasets (see Figure A.1 and Figure A.2 in the appendix for a visualization of this argument). In order to elucidate the contribution of individual model components, we also provide an ablation study in Table A.4. Here we see that the attention mechanism contributes more to the model performance, while the positional encoding seems to be beneficial for datasets with highly-varying time series lengths, in particular M3-Phenotyping.
+
+Opening the black box In the medical domain, it is of particular interest to understand the decisions a model makes based on the input it is provided with. The formulation of our model and its per observation perspective on time series gives it the unique property of being able to quantify to which extent an individual observation contributed to the output of the model. We exemplify this in Figure 2 with a patient time series that was combined with our models attention values, displayed for a set of clinically relevant variables. After reviewing these records with our medical expert, we find that our model is able to pick up regions with drastic changes in individual modalities. Moreover, it is able to inspect other modalities at the same associated time (for instance, at hour 20). This is behaviour similar to what one would expect from an alerted clinician reviewing the logged medical records. Interestingly, we observe that the model attends to known trends (that are consisting with domain knowledge about patient deterioration ultimately resulting in death) such as increase in lactate or hemodynamic instability, as indicated by drops in blood pressure. Furthermore, the model appears to be alerted by persisting low urine output. After several hours, this can be indicative of kidney failure.
+
+Table 1: Performance comparison of methods on benchmarking datasets. Performance metrics have been rescaled to 100 for readability reasons. “AUC” denotes the area under the Receiver Operating Characteristic (ROC) curve; “PR AUC” denotes the area under the precision recall curve. “MICRO” refers to evaluating the metric globally by treating each entry of the label indicator matrix as a label. For “MACRO”, the metric is computed for each class and then averaged, whereas in “WEIGHTED” the class-wise metrics are weighted by class imbalance. Values denoted with “OOM” were not obtainable due to restrictions in GPU memory.
+
+
DATASET
MODEL
MICRO AUC
MACRO AUC
WEIGHTED AUC
RUNTIME
H-MNIST
GRU-SIMPLE
99.09 ± 0.05
99.01 ± 0.05
99.03 ± 0.05
11.43 ± 0.47
PHASED-LSTM
98.63 ± 0.13
98.50 ± 0.15
98.52 ± 0.14
33.93 ±1.11
GRU-D
99.42 ± 0.01
99.37 ± 0.02
99.38 ±0.02
11.81 ± 0.44
IP-NETS
99.06 ± 0.05
98.96 ± 0.03
98.98 ± 0.03
127.76 ± 0.95
TRANSFORMER
99.59 ± 0.05
99.55 ± 0.05
99.56 ± 0.05
21.62 ± 0.90
SEFT*
99.76 ± 0.01
99.75 ± 0.01
99.75 ± 0.01
4.05 ± 0.35
M3-Phenotyping
GRU-SIMPLE
79.89 ± 0.14
73.91 ± 0.19
72.55 ± 0.16
112.58 ± 2.03
PHASED-LSTM
80.00±0.06
73.91 ± 0.09
72.65 ± 0.08
400.41 ± 14.14
GRU-D
82.16 ± 0.04
77.14 ± 0.03
76.08 ± 0.01
288.70± 16.66
IP-NETS
-OOM—
-OOM-
-OOM—
-0OM-
TRANSFORMER
—O0M-
-00M—
—00M-
—00M-
SEFT
81.22 ±0.12
75.95 ± 0.09
74.90 ± 0.11
56.27 ± 2.14
SEFT-ATTN
82.00 ± 0.06
76.95 ± 0.09
75.88 ± 0.09
52.32 ± 0.74
ACCURACY
PR AUC
AUC
RUNTIME
M3-Mortality
GRU-SIMPLE
88.24±0.38
36.36 ±1.31
79.36 ± 0.26
22.80 ±0.56
PHASED-LSTM
88.32 ±0.31
35.30 ±1.38
80.16 ±0.22
25.54 ± 0.26
GRU-D
89.56 ± 0.38
46.76 ± 0.65
83.73 ± 0.21
31.85 ± 0.86
IP-NETS
89.73 ± 0.16
45.88 ± 0.87
83.30 ± 0.56
101.12 ± 4.52
TRANSFORMER
89.14 ± 0.15
42.32 ± 0.41
82.60 ± 0.55
4.79 ± 0.02
SEFT
88.65 ± 0.49
36.18 ± 5.07
79.15 ± 3.00
3.72 ± 0.11
SEFT-ATTN
89.48 ± 0.16
45.25 ± 0.96
83.79 ± 0.59
16.64 ± 0.20
P-Mortality
GRU-SIMPLE
85.66 ± 0.14
39.43 ± 0.71
79.79 ±0.16
5.16 ± 0.06
PHASED-LSTM
85.57 ± 0.11
39.55 ± 0.62
78.71 ±0.76
18.59 ± 1.15
GRU-D
87.19 ± 0.30
54.95 ± 0.54
86.58 ± 0.32
14.08 ± 0.38
IP-NETS
87.23 ± 0.18
54.87 ± 0.41
86.42 ±0.18
7.21 ± 0.46
TRANSFORMER
86.47 ± 0.08
48.72 ± 0.61
83.49 ± 0.46
2.69 ± 0.43
SEFT
87.11 ± 0.32
52.07 ± 0.41
84.12 ±0.32
3.07 ± 0.03
SEFT-ATTN
87.62 ± 0.16
54.05 ± 0.27
85.50 ± 0.13
7.54 ± 0.08
+
+\*: Due to the high dimensionality of H-MNIST and associated memory issues, the set elements were constructed by concatenating the observation time with all values associated with the time point and measurement indicators. Furthermore, as this dataset features only 10 time steps and missingness is induced randomly, we refrained from applying the attention-based aggregation.
+
+# 5 CONCLUSION
+
+In this work, we presented a novel approach for classifying time series with irregularly-sampled and unaligned, that is non-synchronized, observations. Our approach yields state-of-the-art to strongly competitive performance on numerous simulated and real-world datasets, while reducing runtime by almost half. Moreover, we demonstrated that combining the perspective of individual observations with an attention mechanism permits increasing the interpretability of the model. This is particularly relevant for the medical and healthcare applications.
+
+For future work, we reserve a more extensive exploration of the learned latent representation to evaluate its utility for clustering of time series or visualization of their similarity.
+
+# REFERENCES
+
+Edwin V. Bonilla, Kian M Chai, and Christopher Williams. Multi-task gaussian process prediction. In Advances in Neural Information Processing Systems (NeurIPS), pp. 153–160, 2008.
+
+Zhengping Che, Sanjay Purushotham, Kyunghyun Cho, David Sontag, and Yan Liu. Recurrent neural networks for multivariate time series with missing values. Scientific reports, 8(1):6085, 2018.
+
+Joseph Futoma, Sanjay Hariharan, and Katherine Heller. Learning to detect sepsis with a Multitask Gaussian Process RNN classifier. In International Conference on Machine Learning (ICML), pp. 1174–1182, 2017.
+
+Marta Garnelo, Dan Rosenbaum, Christopher Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo Rezende, and SM Ali Eslami. Conditional neural processes. In International Conference on Machine Learning, pp. 1690–1699, 2018.
+
+Ary L. Goldberger, Luis A.N. Amaral, Leon Glass, Jeffrey M. Hausdorff, Plamen Ivanov, Roger G. Mark, Joseph E. Mietus, George B. Moody, Chung-Kang Peng, and H. Eugene Stanley. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. Circulation, 101(23):e215–e220, 2000.
+
+Hrayr Harutyunyan, Hrant Khachatrian, David C. Kale, Greg Ver Steeg, and Aram Galstyan. Multitask learning and benchmarking with clinical time series data. Scientific Data, 6(1):96, 2019. ISSN 2052-4463.
+
+Alan G. Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83–90, 1971.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
+
+Alistair E. W. Johnson, Tom J. Pollard, Lu Shen, Li-wei H. Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G. Mark. MIMIC-III, a freely accessible critical care database. Scientific Data, 3, 2016.
+
+Rahul G. Krishnan, Uri Shalit, and David Sontag. Deep Kalman Filters. arXiv e-prints, art. arXiv:1511.05121, Nov 2015.
+
+Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. 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. 3744–3753, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
+
+Steven Cheng-Xian Li and Benjamin M Marlin. Classification of sparse and irregularly sampled time series with mixtures of expected gaussian kernels and random features. In UAI, pp. 484– 493, 2015.
+
+Steven Cheng-Xian Li and Benjamin M. Marlin. A scalable end-to-end Gaussian process adapter for irregularly sampled time series classification. In Advances In Neural Information Processing Systems 29, pp. 1804–1812, 2016.
+
+Larry S. Liebovitch and Tibor Toth. A fast algorithm to determine fractal dimensions by box counting. Physics Letters A, 141(8):386–390, 1989.
+
+Thomas Josef Liniger. Multivariate Hawkes processes. PhD thesis, ETH Zurich, 2009.
+
+Zachary C Lipton, David Kale, and Randall Wetzel. Directly modeling missing data in sequences with rnns: Improved classification of clinical time series. In Machine Learning for Healthcare Conference, pp. 253–270, 2016.
+
+Roderick JA Little and Donald B Rubin. Statistical analysis with missing data, volume 333. John Wiley & Sons, 2014.
+
+Zhengdong Lu, Todd K Leen, Yonghong Huang, and Deniz Erdogmus. A reproducing kernel hilbert space framework for pairwise time series distances. In Proceedings of the 25th International Conference on Machine learning, pp. 624–631, 2008.
+
+Michal Lukasik, P. K. Srijith, Duy Vu, Kalina Bontcheva, Arkaitz Zubiaga, and Trevor Cohn. Hawkes processes for continuous time sequence classification: an application to rumour stance classification in Twitter. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 393–398, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-2064. URL https: //www.aclweb.org/anthology/P16-2064.
+
+Benjamin M. Marlin, David C. Kale, Robinder G. Khemani, and Randall C. Wetzel. Unsupervised pattern discovery in electronic health care data using probabilistic clustering models. In Proceedings of the 2nd ACM SIGHIT International Health Informatics Symposium, pp. 389–398. ACM, 2012.
+
+Hongyuan Mei and Jason M. Eisner. The neural Hawkes process: A neurally self-modulating multivariate point process. 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. 6754–6764. Curran Associates, Inc., 2017.
+
+Daniel Neil, Michael Pfeiffer, and Shih-Chii Liu. Phased lstm: Accelerating recurrent network training for long or event-based sequences. In Advances in Neural Information Processing Systems 29, pp. 3882–3890, 2016.
+
+Satya Narayan Shukla and Benjamin Marlin. Interpolation-prediction networks for irregularly sampled time series. In International Conference on Learning Representations, 2019.
+
+Floris Takens. Detecting strange attractors in turbulence. In David Rand and Lai-Sang Young (eds.), Dynamical Systems and Turbulence, pp. 366–381, Heidelberg, Germany, 1981. Springer.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), pp. 5998–6008, 2017.
+
+Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
+
+Edward Wagstaff, Fabian B. Fuchs, Martin Engelcke, Ingmar Posner, and Michael Osborne. On the Limitations of Representing Functions on Sets. 2019.
+
+Christopher K. Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. MIT Press, 2(3):4, 2006.
+
+Shuai Xiao, Junchi Yan, Mehrdad Farajtabar, Le Song, Xiaokang Yang, and Hongyuan Zha. Joint modeling of event sequence and time series with attentional twin recurrent neural networks. arXiv e-prints, art. arXiv:1703.08524, 2017.
+
+Pranjul Yadav, Michael Steinbach, Vipin Kumar, and Gyorgy Simon. Mining electronic health records (EHRs): a survey. ACM Computing Surveys, 50(6):85, 2018.
+
+Yingxiang Yang, Jalal Etesami, Niao He, and Negar Kiyavash. Online learning for multivariate hawkes processes. 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. 4937–4946. Curran Associates, Inc., 2017.
+
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R. Salakhutdinov, and Alexander J. Smola. Deep sets. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3391–3401, 2017.
+
+# A APPENDIX
+
+Table A.1: M3-Mortality prevalence of labels for the binary classification task
+
+
Training Prevalence
Testing Prevalence
In-hospital deaths
0.135
0.116
+
+Table A.2: P-Mortality prevalence of labels for the binary classification task
+
+
Training PrevalenceTesting Prevalence
In-hospital deaths S
0.140
0.146
+
+# A.1 DATA FILTERING
+
+Due to memory requirements of some of the competitor methods, it was necassary to excluded time series with extremly high number of measurements. For the M3-Phenotyping patients with more than 2000 distinct time points were discarded from training. For M3-Mortality patients with more than 1000 time points were discarded as they contained dramatically different measuring frequencies compared to the rest of the dataset.
+
+# A.2 IMPLEMENTATIONAL DETAILS
+
+All experiments were run using tensorflow $0 . 1 5 . 0 \Sigma \mathsf { c } 0$ and training was performed on NVIDIA Geforce GTX 1080 GPUs. In order to allow a fair comparison between methods, the input processing pipeline cached model specific representations and transformations of the data. To further increase efficiency of the RNNs, sequences were binned in to buckets of jointly trained instances depending on their sequence length. The buckets were determined according to the (0.25, 0.5, 0.75) quantiles of the length distributions of the datasets.
+
+# A.3 TRAINING, MODEL ARCHITECTURES AND HYPERPARAMETER SEARCH
+
+General All models were trained using the Adam optimizer, while randomly sampling the learning rate from (0.001, 0.0005, 0.00025, 0.0001). Further, the batch size of all methods was sampled from the values (32, 64, 128, 256).
+
+Recurrent neural networks For the RNN based methods (GRU-SIMPLE, PHASEDLSTM, GRU-D and IP-NETS), the number of units was sampled in from the values (16, 32, 64, 128, 256, 512). Further, recurrent dropout and input dropout were sampled from the values (0.0, 0.1, 0.2, 0.3). Solely, for the PHASED-LSTM method, we did not apply dropout to the recurrent state and the inputs, as the learnt frequencies were hypothesized to fulfill a similar function as dropout (Neil et al., 2016).
+
+SEFT We vary the number of layers, dropout in between the layers and the number of nodes per layer for both the encoding network $h _ { \theta }$ and the aggregation network $g _ { \psi }$ from the same ranges. The number of layers is randomly sampled between 1 and 5, the number of nodes in a layer are uniformly sampled from the range (16, 32, 64, 128, 256, 512) and the dropout fraction is sampled from the values $( 0 . 0 , 0 . 1 , 0 . 2 , 0 . 3 )$ . The width of the embedding space prior to aggregation is sampled from the values (32, 64, 128, 256, 512, 1024, 2048). The aggregation function selected to be one of mean, sum and max. The number of dimensions used for the positional embedding $\tau$ is selected uniformly from $( 4 , 8 , 1 6 )$ and max ts us selected from the values (10, 100, 1000).
+
+SEFT-Attn The parameters for the encoding and aggregation networks are sampled in a similar fashion as for SEFT. In contrast we set the aggregation function to be sum as described in the text.
+
+Table A.3: M3-Phenotyping prevalence of labels for the multi label classification task
+
+
Phenotype
Training
Validation
Testing
Acute and unspecified renal failure
0.216
0.207
0.211
Acute cerebrovascular disease
0.0746
0.0753
0.0662
Acute myocardial infarction
0.103
0.103
0.108
Cardiac dysrhythmias
0.322
0.317
0.323
Chronic kidney disease
0.135
0.131
0.132
Chronic obstructive pulmonary disease and bronchiectasis
0.132
0.128
0.126
Complications of surgical procedures or
0.207
0.201
0.213
medical care Conduction disorders
0.0726
0.07
0.0704
Congestive heart failure; nonhyperten- sive
0.268
0.264
0.268
Coronary atherosclerosis and other heart disease
0.323
0.317
0.331
Diabetes mellitus with complications
0.0955
0.0945
0.094
Diabetes mellitus without complication
0.194
0.187
0.192
Disorders of lipid metabolism
0.291
0.287
0.289
Essential hypertension
0.421
0.41
0.424
Fluid and electrolyte disorders
0.267
0.276
0.265
Gastrointestinal hemorrhage
0.0715
0.0747
0.0788
Hypertension with complications and
0.133
0.131
0.13
secondary hypertension Other liver diseases
0.0884
0.0904
0.0883
Other lower respiratory disease
0.0514
0.0484
0.0565
Other upper respiratory disease
0.0408
0.0371
0.0429
Pleurisy; pneumothorax; pulmonary
0.0858
0.09
0.0905
collapse Pneumonia (except that caused by tu- berculosis or sexually transmitted dis-
0.14
0.135
0.135
ease) Respiratory failure; insufficiency; arrest
0.18
0.184
0.177
(adult) Septicemia (except in labor)
0.142
0.145
0.138
Shock
0.0783
0.0745
0.0811
Total samples
29 208
6359
6266
+
+Further we use a constant architecture for the attention network $f ^ { \prime }$ with 2 layers, 64 nodes per layer, 4 heads and a dimensionality of the dot product space $d$ of 128. We solely sample the amount of attention dropout uniformly from the values $( 0 . 0 , 0 . 1 , 0 . 2 5 , 0 . 5 )$ .
+
+Transformer We utilize the same model architecture as defined in Vaswani et al. (2017), where we use a one hidden layer MLP as a feed-forward network, with dimensionality of the hidden layer selected to be twice the model dimensionality. The parameters for the Transformer network were sampled according to the following criteria. The dimensionality of the model was sampled uniformly from the values (64, 128, 256, 512, 1024), the number of attention heads per layer from the values $( 2 , 4 , 8 )$ and the number of layers from the range $[ 1 , 6 ] \in \mathbb { N }$ . Further, we sampled the amount of dropout of the residual connections and the amount of attention dropout uniformly from the values $( 0 . 0 , 0 . 1 , 0 . 2 , 0 . 3 , 0 . 5 )$ , and the maximal timescale for the time embedding from the values $( 1 0 , 1 0 0 , 1 0 0 0 )$ (similar to the SEFT approach).
+
+Table A.4: Ablation study of individual components of SEFT. “AUC” denotes the area under the Receiver Operating Characteristic (ROC) curve; “PR AUC” denotes the area under the precision recall curve; “RUNTIME” denotes the runtime of one training epoch in seconds.
+
+
DATASET
MODEL
MICRO AUC
MACRO AUC
WEIGHTED AUC
RUNTIME
H-MNIST
SEFT
99.76 ± 0.01
99.75 ± 0.01
99.75 ± 0.01
4.05 ± 0.35
M3-Phenotyping
SEFT (NO ATTENTION)
81.22 ± 0.12
75.95 ± 0.09
74.90 ± 0.11
56.27 ± 2.14
SEFT-ATTN (NO TIME ENC.)
80.46±0.86
74.70 ± 1.12
73.48 ± 1.18
50.17 ± 0.84
SEFT-ATTN
82.00 ± 0.06
76.95 ± 0.09
75.88 ± 0.09
52.32 ± 0.74
ACCURACY
PR AUC
AUC
RUNTIME
M3-Mortality
SEFT (NO ATTENTION)
88.65 ± 0.49
36.18 ± 5.07
79.15 ± 3.00
3.72 ± 0.11
SEFT-ATTN (NO TIME ENC.)
89.31±0.08
44.12 ± 0.06
83.72 ± 0.34
17.60 ± 0.43
SEFT-ATTN
89.48 ± 0.16
45.25 ± 0.96
83.79 ± 0.59
16.64± 0.20
P-Mortality
SEFT (NO ATTENTION)
87.11 ± 0.32
52.07 ±0.41
84.12 ± 0.32
3.07 ± 0.03
SEFT-ATTN (NO TIME ENC.)
87.03 ±0.06
51.86 ± 1.04
84.91 ± 0.29
7.04 ± 0.04
SEFT-ATTN
87.62 ± 0.16
54.05± 0.27
85.50 ± 0.13
7.54 ± 0.08
+
+
+Figure A.1: A visualisation of the runtime of all methods and their AUC for datasets with a binary classification scenario.
+
+
+Figure A.2: A visualisation of the runtime of all methods and their AUC for datasets with a multilabel classification scenario. Please note that the model definition for SEFT changes between the left and the right column; please see Table 1 for more details.
\ No newline at end of file
diff --git a/md/train/ByxdUySKvS/ByxdUySKvS.md b/md/train/ByxdUySKvS/ByxdUySKvS.md
new file mode 100644
index 0000000000000000000000000000000000000000..ccea18e4c29b6c8df23ab6a171c64500d4b5e522
--- /dev/null
+++ b/md/train/ByxdUySKvS/ByxdUySKvS.md
@@ -0,0 +1,310 @@
+# ADVERSARIAL AUTOAUGMENT
+
+Xinyu Zhang
+Huawei
+zhangxinyu10@huawei.com
+Qiang Wang
+Huawei
+wangqiang168@huawei.com
+Jian Zhang
+Huawei
+zhangjian157@huawei.com
+Zhao Zhong
+Huawei
+zorro.zhongzhao@huawei.com
+
+# ABSTRACT
+
+Data augmentation (DA) has been widely utilized to improve generalization in training deep neural networks. Recently, human-designed data augmentation has been gradually replaced by automatically learned augmentation policy. Through finding the best policy in well-designed search space of data augmentation, AutoAugment (Cubuk et al., 2019) can significantly improve validation accuracy on image classification tasks. However, this approach is not computationally practical for large-scale problems. In this paper, we develop an adversarial method to arrive at a computationally-affordable solution called Adversarial AutoAugment, which can simultaneously optimize target related object and augmentation policy search loss. The augmentation policy network attempts to increase the training loss of a target network through generating adversarial augmentation policies, while the target network can learn more robust features from harder examples to improve the generalization. In contrast to prior work, we reuse the computation in target network training for policy evaluation, and dispense with the retraining of the target network. Compared to AutoAugment, this leads to about $1 2 \times$ reduction in computing cost and $1 1 \times$ shortening in time overhead on ImageNet. We show experimental results of our approach on CIFAR-10/CIFAR-100, ImageNet, and demonstrate significant performance improvements over state-of-the-art. On CIFAR-10, we achieve a top-1 test error of $1 . 3 6 \%$ , which is the currently best performing single model. On ImageNet, we achieve a leading performance of top-1 accuracy $7 9 . 4 0 \%$ on ResNet-50 and $8 0 . 0 0 \%$ on ResNet-50-D without extra data.
+
+# 1 INTRODUCTION
+
+Massive amount of data have promoted the great success of deep learning in academia and industry. The performance of deep neural networks (DNNs) would be improved substantially when more supervised data is available or better data augmentation method is adapted. Data augmentation such as rotation, flipping, cropping, etc., is a powerful technique to increase the amount and diversity of data. Experiments show that the generalization of a neural network can be efficiently improved through manually designing data augmentation policies. However, this needs lots of knowledge of human expert, and sometimes shows the weak transferability across different tasks and datasets in practical applications. Inspired by neural architecture search (NAS)(Zoph & Le, 2016; Zoph et al., 2017; Zhong et al., 2018a;b; Guo et al., 2018), a reinforcement learning (RL) (Williams, 1992) method called AutoAugment is proposed by Cubuk et al. (2019), which can automatically learn the augmentation policy from data and provide an exciting performance improvement on image classification tasks. However, the computing cost is huge for training and evaluating thousands of sampled policies in the search process. Although proxy tasks, i.e., smaller models and reduced datasets, are taken to accelerate the searching process, tens of thousands of GPU-hours of consumption are still required. In addition, these data augmentation policies optimized on proxy tasks are not guaranteed to be optimal on the target task, and the fixed augmentation policy is also sub-optimal for the whole training process.
+
+
+Figure 1: The overview of our proposed method. We formulate it as a Min-Max game. The data of each batch is augmented by multiple pre-processing components with sampled policies $\{ \tau _ { 1 } , \tau _ { 2 } , \cdots , \tau _ { M } \}$ , respectively. Then, a target network is trained to minimize the loss of a large batch, which is formed by multiple augmented instances of the input batch. We extract the training losses of a target network corresponding to different augmentation policies as the reward signal. Finally, the augmentation policy network is trained with the guideline of the processed reward signal, and aims to maximize the training loss of the target network through generating adversarial policies.
+
+In this paper, we propose an efficient data augmentation method to address the problems mentioned above, which can directly search the best augmentation policy on the full dataset during training a target network, as shown in Figure 1. We first organize the network training and augmentation policy search in an adversarial and online manner. The augmentation policy is dynamically changed along with the training state of the target network, rather than fixed throughout the whole training process like normal AutoAugment (Cubuk et al., 2019). Due to reusing the computation in policy evaluation and dispensing with the retraining of the target network, the computing cost and time overhead are extremely reduced. Then, the augmentation policy network is taken as an adversary to explore the weakness of the target network. We augment the data of each min-batch with various adversarial policies in parallel, rather than the same data augmentation taken in batch augmentation (BA) (Hoffer et al., 2019). Then, several augmented instances of each mini-batch are formed into a large batch for target network learning. As an indicator of the hardness of augmentation policies, the training losses of the target network are used to guide the policy network to generate more aggressive and efficient policies based on REINFORCE algorithm (Williams, 1992). Through adversarial learning, we can train the target network more efficiently and robustly.
+
+The contributions can be summarized as follows:
+
+• Our method can directly learn augmentation policies on target tasks, i.e., target networks and full datasets, with a quite low computing cost and time overhead. The direct policy search avoids the performance degradation caused by the policy transfer from proxy tasks to target tasks.
+• We propose an adversarial framework to jointly optimize target network training and augmentation policy search. The harder samples augmented by adversarial policies are constantly fed into the target network to promote robust feature learning. Hence, the generalization of the target network can be significantly improved.
+• The experiment results show that our proposed method outperforms previous augmentation methods. For instance, we achieve a top-1 test error of $1 . 3 6 \%$ with PyramidNet+ShakeDrop (Yamada et al., 2018) on CIFAR-10, which is the state-of-the-art performance. On ImageNet, we improve the top-1 accuracy of ResNet-50 (He et al., 2016) from $7 6 . 3 \%$ to $7 9 . 4 \%$ without extra data, which is even $1 . 7 7 \%$ better than AutoAugment (Cubuk et al., 2019).
+
+# 2 RELATED WORK
+
+Common data augmentation, which can generate extra samples by some label-preserved transformations, is usually used to increase the size of datasets and improve the generalization of networks, such as on MINST, CIFAR-10 and ImageNet (Krizhevsky et al., 2012; Wan et al., 2013; Szegedy et al., 2015). However, human-designed augmentation policies are specified for different datasets. For example, flipping, the widely used transformation on CIFAR-10/CIFAR-100 and ImageNet, is not suitable for MINST, which will destroy the property of original samples.
+
+Hence, several works (Lemley et al., 2017; Cubuk et al., 2019; Lin et al., 2019; Ho et al., 2019) have attempted to automatically learn data augmentation policies. Lemley et al. (2017) propose a method called Smart Augmentation, which merges two or more samples of a class to improve the generalization of a target network. The result also indicates that an augmentation network can be learned when a target network is being training. Through well designing the search space of data augmentation policies, AutoAugment (Cubuk et al., 2019) takes a recurrent neural network (RNN) as a sample controller to find the best data augmentation policy for a selected dataset. To reduce the computing cost, the augmentation policy search is performed on proxy tasks. Population based augmentation (PBA) (Ho et al., 2019) replaces the fixed augmentation policy with a dynamic schedule of augmentation policy along with the training process, which is mostly related to our work. Inspired by population based training (PBT) (Jaderberg et al., 2017), the augmentation policy search problem in PBA is modeled as a process of hyperparameter schedule learning. However, the augmentation schedule learning is still performed on proxy tasks. The learned policy schedule should be manually adjusted when the training process of a target network is non-matched with proxy tasks.
+
+Another related topic is Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), which has recently attracted lots of research attention due to its fascinating performance, and also been used to enlarge datasets through directly synthesizing new images (Tran et al., 2017; Perez & Wang, 2017; Antoniou et al., 2017; Gurumurthy et al., 2017; Frid-Adar et al., 2018). Although we formulate our proposed method as a Min-Max game, there exists an obvious difference with traditional GANs. We want to find the best augmentation policy to perform image transformation along with the training process, rather than synthesize new images. Peng et al. (2018) also take such an idea to optimize the training process of a target network in human pose estimation.
+
+# 3 METHOD
+
+In this section, we present the implementation of Adversarial AutoAugment. First, the motivation for the adversarial relation between network learning and augmentation policy is discussed. Then, we introduce the search space with the dynamic augmentation policy. Finally, the joint framework for network training and augmentation policy search is presented in detail.
+
+# 3.1 MOTIVATIONS
+
+Although some human-designed data augmentations have been used in the training of DNNs, such as randomly cropping and horizontally flipping on CIFAR-10/CIFAR-100 and ImageNet, limited randomness will make it very difficult to generate effective samples at the tail end of the training. To struggle with the problem, more randomness about image transformation is introduced into the search space of AutoAugment (Cubuk et al., 2019) (described in Section 3.2). However, the learned policy is fixed for the entire training process. All of possible instances of each example will be send to the target network repeatedly, which still results in an inevitable overfitting in a long-epoch training. This phenomenon indicates that the learned policy is not adaptive to the training process of a target network, especially found on proxy tasks. Hence, the dynamic and adversarial augmentation policy with the training process is considered as the crucial feature in our search space.
+
+Another consideration is how to improve the efficiency of the policy search. In AutoAugment (Cubuk et al., 2019), to evaluate the performance of augmentation policies, a lot of child models should be trained from scratch nearly to convergence. The computation in training and evaluating the performance of different sampled policies can not be reused, which leads to huge waste of computation resources. In this paper, we propose a computing-efficient policy search framework through reusing prior computation in policy evaluation. Only one target network is used to evaluate the performance of different policies with the help of the training losses of corresponding augmented instances. The augmentation policy network is learned from the intermediate state of the target network, which makes generated augmentation policies more aggressive and adaptive. On the contrary, to combat harder examples augmented by adversarial policies, the target network has to learn more robust features, which makes the training more efficiently.
+
+
+Figure 2: An example of dynamic augmentation policies learned with ResNet-50 on ImageNet. With the training process of the target network, harder augmentation policies are sampled to combat overfitting. Intuitively, more geometric transformations, such as TranslateX, ShearY and Rotate, are picked in our sampled policies, which is obviously different from AutoAugment (Cubuk et al., 2019) concentrating on color-based transformations.
+
+# 3.2 SEARCH SPACE
+
+In this paper, the basic structure of the search space of AutoAugment (Cubuk et al., 2019) is reserved. An augmentation policy is defined as that it is composed by 5 sub-policies, each sub-policy contains two image operations to be applied orderly, each operation has two corresponding parameters, i.e., the probability and magnitude of the operation. Finally, the 5 best policies are concatenated to form a single policy with 25 sub-policies. For each image in a mini-batch, only one sub-policy will be randomly selected to be applied. To compare with AutoAugment (Cubuk et al., 2019) conveniently, we just slightly modify the search space with removing the probability of each operation. This is because that we think the stochasticity of an operation with a probability requires a certain epochs to take effect, which will detain the feedback of the intermediate state of the target network. There are totally 16 image operations in our search space, including ShearX/Y, TranslateX/Y, Rotate, AutoContrast, Invert, Equalize, Solarize, Posterize, Contrast, Color, Brightness, Sharpness, Cutout (Devries & Taylor, 2017) and Sample Pairing (Inoue, 2018). The range of the magnitude is also discretized uniformly into 10 values. To guarantee the convergence during adversarial learning, the magnitude of all the operations are set in a moderate range.1 Besides, the randomness during the training process is introduced into our search space. Hence, the search space of the policy in each epoch has $| S | = ( 1 6 \times 1 0 ) ^ { 1 0 } \approx 1 . 1 \times 1 0 ^ { 2 2 }$ possibilities. Considering the dynamic policy, the number of possible policies with the whole training process can be expressed as $| S | ^ { \# e p o c h s }$ . An example of dynamically learning the augmentation policy along with the training process is shown in Figure 2. We observe that the magnitude (an indication of difficulty) gradually increases with the training process.
+
+# 3.3 ADVERSARIAL LEARNING
+
+In this section, the adversarial framework of jointly optimizing network training and augmentation policy search is presented in detail. We use the augmentation policy network $\boldsymbol { \mathcal { A } } ( \cdot , \pmb { \theta } )$ as an adversary, which attempts to increase the training loss of the target network $\mathcal { F } ( \cdot , w )$ through adversarial learning. The target network is trained by a large batch formed by multiple augmented instances of each batch to promote invariant learning (Salazar et al., 2018), and the losses of different augmentation policies applied on the same data are used to train the augmentation policy network by RL algorithm.
+
+Considering the target network $\mathcal { F } ( \cdot , w )$ with a loss function $\mathcal { L } [ \mathcal { F } ( \pmb { x } , \pmb { w } ) , \pmb { y } ]$ , where each example is transformed by some random data augmentation $o ( \cdot )$ , the learning process of the target network can be defined as the following minimization problem
+
+$$
+\pmb { w } ^ { * } = \underset { \pmb { w } } { \arg \operatorname* { m i n } } \ \underset { \pmb { x } \sim \Omega } { \mathbb { E } } \mathcal { L } [ \mathcal { F } ( o ( \pmb { x } ) , \pmb { w } ) , \pmb { y } ] ,
+$$
+
+where $\Omega$ is the training set, $_ { \textbf { \em x } }$ and $\textbf { { y } }$ are the input image and the corresponding label, respectively. The problem is usually solved by vanilla SGD with a learning rate $\eta$ and batch size $N$ , and the training procedure for each batch can be expressed as
+
+$$
+\pmb { w } _ { t + 1 } = \pmb { w } _ { t } - \eta \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \nabla _ { \pmb { w } } \mathcal { L } [ \mathcal { F } ( o ( x _ { n } ) , \pmb { w } , y _ { n } ] .
+$$
+
+To improve the convergence performance of DNNs, more random and efficient data augmentation is performed under the help of the augmentation policy network. Hence, the minimization problem should be slightly modified as
+
+$$
+\pmb { w } ^ { * } = \underset { \pmb { w } } { \arg \operatorname* { m i n } } \ \underset { \pmb { x } \sim \Omega } { \mathbb { E } } \ \underset { \pmb { \mathcal { A } } ( \cdot , \pmb { \theta } ) } { \mathbb { E } } \mathcal { L } [ \mathcal { F } ( \tau ( \pmb { x } ) , \pmb { w } ) , \pmb { y } ] ,
+$$
+
+where $\tau ( \cdot )$ represents the augmentation policy generated by the network $\boldsymbol { \mathcal { A } } ( \cdot , \pmb { \theta } )$ . Accordingly, the training rule can be rewritten as
+
+$$
+\pmb { w } _ { t + 1 } = \pmb { w } _ { t } - \eta \frac { 1 } { M \cdot N } \sum _ { m = 1 } ^ { M } \sum _ { n = 1 } ^ { N } \nabla _ { \pmb { w } } \mathcal { L } [ \mathcal { F } ( \tau _ { m } ( x _ { n } ) , \pmb { w } ) , y _ { n } ] ,
+$$
+
+where we introduce $M$ different instances of each input example augmented by adversarial policies $\{ \tau _ { 1 } , \tau _ { 2 } , \cdots , \tau _ { M } \}$ . For convenience, we denote the training loss of a mini-batch corresponding to the augmentation policy $\tau _ { m }$ as
+
+$$
+\mathcal { L } _ { m } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } [ \mathcal { F } ( \tau _ { m } ( x _ { n } ) , \pmb { w } ) , y _ { n } ] .
+$$
+
+Hence, we have an equivalent form of Equation 4
+
+$$
+\pmb { w } _ { t + 1 } = \pmb { w } _ { t } - \eta \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \nabla _ { \pmb { w } } \mathcal { L } _ { m } .
+$$
+
+Note that the training procedure can be regarded as a larger $N \cdot M$ batch training or an average over $M$ instances of gradient computation without changing the learning rate, which will lead to a reduction of gradient variance and a faster convergence of the target network Hoffer et al. (2019). However, overfitting will also come. To overcome the problem, the augmentation policy network is designed to increase the training loss of the target network with harder augmentation policies. Therefore, we can mathematically express the object as the following maximization problem
+
+$$
+\begin{array} { c } { \pmb { \theta } ^ { * } = \underset { \pmb { \theta } } { \arg \operatorname* { m a x } } J ( \pmb { \theta } ) , } \\ { \mathrm { w h e r e } ~ J ( \pmb { \theta } ) = \underset { \pmb { x } \sim \Omega } { \mathbb { E } } ~ \underset { \pmb { \mathbb { E } } ( \cdot , \pmb { \theta } ) } { \mathbb { E } } \mathcal { L } [ \mathcal { F } ( \tau ( \pmb { x } ) , \pmb { w } ) , \pmb { y } ] . } \end{array}
+$$
+
+Similar to AutoAugment (Cubuk et al., 2019), the augmentation policy network is also implemented as a RNN shown in Figure 3. At each time step of the RNN controller, the softmax layer will predict an action corresponding to a discrete parameter of a sub-policy, and then an embedding of the predicted action will be fed into the next time step. In our experiments, the RNN controller will predict 20 discrete parameters to form a whole policy.
+
+
+Figure 3: The basic architecture of the controller for generating a sub-policy, which consists of two operations with corresponding parameters, the type and magnitude of each operation. When a policy contains $Q$ sub-policies, the basic architecture will be repeated $Q$ times. Following the setting of AutoAugment (Cubuk et al., 2019), the number of sub-policies $Q$ is set to 5 in this paper.
+
+However, there has a severe problem in jointly optimizing target network training and augmentation policy search. This is because that non-differentiable augmentation operations break gradient flow from the target network $\mathcal { F }$ to the augmentation policy network $\mathcal { A }$ (Wang et al., 2017; Peng et al., 2018). As an alternative approach, REINFORCE algorithm (Williams, 1992) is applied to optimize the augmentation policy network as
+
+$$
+\begin{array} { r l } & { \nabla _ { \theta } J ( \theta ) = \nabla _ { \theta } \underset { x \sim \Omega \tau \sim A ( \cdot , \theta ) } { \mathbb { E } } ~ \underset { { A } ^ { ( \cdot ) } } { \mathbb { E } } ~ \mathcal { L } [ \mathcal { F } ( \tau ( x ) , w ) , y ] } \\ & { \approx \displaystyle \sum _ { m } \mathcal { L } _ { m } \nabla _ { \theta } p _ { m } = \sum _ { m } \mathcal { L } _ { m } p _ { m } \nabla _ { \theta } \log p _ { m } } \\ & { ~ = \underset { { \tau \sim A ( \cdot , \theta ) } } { \mathbb { E } } ~ \mathcal { L } _ { m } \nabla _ { \theta } \log p _ { m } } \\ & { ~ \approx \frac { 1 } { M } \displaystyle \sum _ { m = 1 } ^ { M } \mathcal { L } _ { m } \nabla _ { \theta } \log p _ { m } , } \end{array}
+$$
+
+where $p _ { m }$ represents the probability of the policy $\tau _ { m }$ . To reduce the variance of gradient $\nabla _ { \pmb { \theta } } J ( \pmb { \theta } )$ , we replace the training loss of a mini-batch ${ \mathcal { L } } _ { m }$ with ${ \widehat { \mathcal { L } } } _ { m }$ a moving average over a certain minibatches2, and then normalize it among $M$ instances as ${ \widetilde { \mathcal { L } } } _ { m }$ . Hence, the training procedure of the augmentation policy network can be expressed as
+
+$$
+\begin{array} { r l } & { \nabla _ { \pmb { \theta } } J ( \pmb { \theta } ) \approx \cfrac { 1 } { M } \displaystyle \sum _ { m = 1 } ^ { M } \widetilde { \mathcal { L } } _ { m } \nabla _ { \pmb { \theta } } \log p _ { m } , } \\ & { \theta _ { e + 1 } = \theta _ { e } + \beta \displaystyle \frac { 1 } { M } \displaystyle \sum _ { m = 1 } ^ { M } \widetilde { \mathcal { L } } _ { m } \nabla _ { \pmb { \theta } } \log p _ { m } , } \end{array}
+$$
+
+The adversarial learning of target network training and augmentation policy search is summarized as Algorithm 1.
+
+# 4 EXPERIMENTS AND ANALYSIS
+
+In this section, we first reveal the details of experiment settings. Then, we evaluate our proposed method on CIFAR-10/CIFAR-100, ImageNet, and compare it with previous methods. Results in Figure 4 show our method achieves the state-of-the-art performance with higher computing and time efficiency3.
+
+Algorithm 1 Joint Training of Target Network and Augmentation Policy Network
+
+Initialization: target network $\mathcal { F } ( \cdot , w )$ , augmentation policy network $\boldsymbol { \mathcal { A } } ( \cdot , \pmb { \theta } )$ Input: input examples $_ { \textbf { \em x } }$ , corresponding labels $\textbf { { y } }$
+
+1: for $1 \leq e \leq$ epochs do
+2: Initialize $\widehat { \mathcal { L } } _ { m } = 0 , \forall m \in \{ 1 , 2 , \cdots , M \}$ ;
+3: Generate $M$ policies with the probabilities $\{ p _ { 1 } , p _ { 2 } , \cdots , p _ { M } \}$ ;
+4: for $1 \leq t \leq T$ do
+5: Augment each batch data with $M$ generated policies, respectively;
+6: Update $w _ { e , t + 1 }$ according to Equation 4;
+7: Update ${ \widehat { \mathcal { L } } } _ { m }$ through moving average, $\forall m \in \{ 1 , 2 , \cdot \cdot \cdot , M \}$ ;
+8: Collect $\{ \widehat { \mathcal { L } } _ { 1 } , \widehat { \mathcal { L } } _ { 2 } , \cdots , \widehat { \mathcal { L } } _ { M } \}$ ;
+9: Normalize ${ \widehat { \mathcal { L } } } _ { m }$ among $M$ instances as $\widetilde { \mathcal { L } } _ { m } , \forall m \in \{ 1 , 2 , \cdots , M \}$ ;
+10: Update $\pmb { \theta } _ { e + 1 }$ via Equation 9;
+11: Output $w ^ { \ast } , \theta ^ { \ast }$
+
+# 4.1 EXPERIMENT SETTINGS
+
+The RNN controller is implemented as a one-layer LSTM (Hochreiter & Schmidhuber, 1997). We set the hidden size to 100, and the embedding size to 32. We use Adam optimizer (Kingma & Ba, 2015) with a initial learning rate 0.00035 to train the controller. To avoid unexpected rapid convergence, an entropy penalty of a weight of 0.00001 is applied. All the reported results are the mean of five runs with different initializations.
+
+# 4.2 EXPERIMENTS ON CIFAR-10 AND CIFAR-100
+
+CIFAR-10 dataset (Krizhevsky & Hinton, 2009) has totally 60000 images. The training and test sets have 50000 and 10000 images, respectively. Each image in size of $3 2 \times 3 2$ belongs to one of 10 classes. We evaluate our proposed method with the following models: Wide-ResNet-28- 10 (Zagoruyko & Komodakis, 2016), Shake-Shake $( 2 6 ~ 2 \mathrm { x } 3 2 \mathrm { d } )$ (Gastaldi, 2017), Shake-Shake (26 $2 \mathrm { x } 9 6 \mathrm { d } )$ (Gastaldi, 2017), Shake-Shake $( 2 6 2 \mathrm { x } 1 1 2 \mathrm { d } )$ (Gastaldi, 2017), PyramidNet+ShakeDrop (Han et al., 2017; Yamada et al., 2018). All the models are trained on the full training set.
+
+Training details: The Baseline is trained with the standard data augmentation, namely, randomly cropping a part of $3 2 \times 3 2$ from the padded image and horizontally flipping it with a probability of 0.5. The Cutout (Devries & Taylor, 2017) randomly select a $1 6 \times 1 6$ patch of each image, and then set the pixels of the selected patch to zeros. For our method, the searched policy is applied in addition to standard data augmentation and Cutout. For each image in the training process, standard data augmentation, the searched policy and Cutout are applied in sequence. For Wide-ResNet-28- 10, the step learning rate (LR) schedule is adopted. The cosine LR schedule is adopted for the other models. More details about model hyperparameters are supplied in A.1.
+
+Choice of $M$ : To choose the optimal $M$ , we select Wide-ResNet-28-10 as a target network, and evaluate the performance of our proposed method verse different $M$ , where $M \in \{ 2 , 4 , 8 , 1 6 , 3 2 \}$ . From Figure 5, we can observe that the test accuracy of the model improves rapidly with the increase of $M$ up to 8. The further increase of $M$ does not bring a significant improvement. Therefore, to balance the performance and the computing cost, $M$ is set to 8 in all the following experiments.
+
+CIFAR-10 results: In Table 1, we report the test error of these models on CIFAR-10. For all of these models, our proposed method can achieve better performance compared to previous methods. We achieve $0 . 7 8 \%$ and $0 . 6 8 \%$ improvement on Wide-ResNet-28-10 compared to AutoAugment and PBA, respectively. We achieve a top-1 test error of $1 . 3 6 \%$ with PyramidNet $^ +$ ShakeDrop, which is $0 . 1 \%$ better than the current state-of-the-art reported in Ho et al. (2019). As shown in Figure 6(a) and 6(b),we further visualize the probability distribution of the parameters of the augmentation policies learned with PyramidNet+ShakeDrop on CIFAR-10 over time. From Figure 6(a), we can find that the percentages of some operations, such as TranslateY, Rotate, Posterize, and SampleParing, gradually increase along with the training process. Meanwhile, more geometric transformations, such as TranslateX, TranslateY, and Rotate, are picked in the sampled augmentation policies, which is different from color-focused AutoAugment (Cubuk et al., 2019) on CIFAR-10. Figure 6(b) shows that large magnitudes gain higher percentages during training. However, at the tail of training, low magnitudes remain considerable percentages. This indicates that our method does not simply learn the transformations with the extremes of the allowed magnitudes to spoil the target network.
+
+
+Figure 4: The Comparison of normalized performance between AutoAugment and our method. Please refer to the following tables for more details.
+
+
+Figure 5: The Top-1 test accuracy of WideResNet-28-10 on CIFAR-10 verse different $M$ , where $M \in \{ 2 , 4 , 8 , 1 6 , 3 2 \}$ .
+
+
+Figure 6: Probability distribution of the parameters in the learned augmentation policies on CIFAR10 over time. The number in (b) represents the magnitude of one operation. Larger number stands for more dramatic image transformations. The probability distribution of each parameter is the mean of each five epochs.
+
+CIFAR-100 results: We also evaluate our proposed method on CIFAR-100, as shown in Table 2.
+As we can observe from the table, we also achieve the state-of-the-art performance on this dataset.
+
+Table 1: Top-1 test error $( \% )$ on CIFAR-10. We replicate the results of Baseline, Cutout and AutoAugment methods from Cubuk et al. (2019), and the results of PBA from Ho et al. (2019) in all of our experiments.
+
+
Model
Baseline
Cutout
AutoAugment
PBA
Our Method
Wide-ResNet-28-10
3.87
3.08
2.68
2.58
1.90±0.15
Shake-Shake (26 2x32d)
3.55
3.02
2.47
2.54
2.36±0.10
Shake-Shake (26 2x96d)
2.86
2.56
1.99
2.03
1.85±0.12
Shake-Shake (26 2x112d)
2.82
2.57
1.89
2.03
1.78±0.05
PyramidNet+ShakeDrop
2.67
2.31
1.48
1.46
1.36±0.06
+
+# 4.3 EXPERIMENTS ON IMAGENET
+
+As a great challenge in image recognition, ImageNet dataset (Deng et al., 2009) has about 1.2 million training images and 50000 validation images with 1000 classes. In this section, we directly search the augmentation policy on the full training set and train ResNet-50 (He et al., 2016), ResNet-50-D (He et al., 2018) and ResNet-200 (He et al., 2016) from scratch.
+
+Table 2: Top-1 test error $( \% )$ on CIFAR-100.
+
+
Model
Baseline
Cutout
AutoAugment
PBA
Our Method
Wide-ResNet-28-10
18.80
18.41
17.09
16.73
15.49±0.18
Shake-Shake (26 2x96d)
17.05
16.00
14.28
15.31
14.10±0.15
PyramidNet+ShakeDrop
13.99
12.19
10.67
10.94
10.42±0.20
+
+Training details: For the baseline augmentation, we randomly resize and crop each input image to a size of $2 2 4 \times 2 2 4$ , and then horizontally flip it with a probability of 0.5. For AutoAugment (Cubuk et al., 2019) and our method, the baseline augmentation and the augmentation policy are both used for each image. The cosine LR schedule is adopted in the training process. The model hyperparameters on ImageNet is also detailed in A.1.
+
+ImageNet results: The performance of our proposed method on ImageNet is presented in Table 3. It can be observed that we achieve a top-1 accuracy $7 9 . 4 0 \%$ on ResNet-50 without extra data. To the best of our knowledge, this is the highest top-1 accuracy for ResNet-50 learned on ImageNet. Besides, we only replace the ResNet-50 architecture with ResNet-50-D, and achieve a consistent improvement with a top-1 accuracy of $8 0 . 0 0 \%$ .
+
+Table 3: Top-1 / Top-5 test error $( \% )$ on ImageNet. Note that the result of ResNet-50-D is achieved only through substituting the architecture.
+
+
Model
Baseline
AutoAugment
PBA
Our Method
ResNet-50
23.69 / 6.92
22.37 /6.18
1
20.60±0.15 /5.53±0.05
ResNet-50-D
22.84 / 6.48
1
20.00±0.12/5.25±0.03
ResNet-200
21.52 / 5.85
20.00 /4.90
1
18.68±0.18 /4.70±0.05
+
+# 4.4 ABLATION STUDY
+
+To check the effect of each component in our proposed method, we report the test error of ResNet-50 on ImageNet the following augmentation methods in Table 4.
+
+• Baseline: Training regularly with the standard data augmentation and step LR schedule.
+• Fixed: Augmenting all the instances of each batch with the standard data augmentation fixed throughout the entire training process. Random: Augmenting all the instances of each batch with randomly and dynamically generated policies. Ours: Augmenting all the instances of each batch with adversarial policies sampled by the policy network along with the training process.
+
+From the table, we can find that Fixed can achieve $0 . 9 9 \%$ error reduction compared to Baseline. This shows that a large-batch training with multiple augmented instances of each mini-batch can indeed improve the generalization of the model, which is consistent with the conclusion presented in Hoffer et al. (2019). In addition, the test error of Random is $1 . 0 2 \%$ better than Fixed. This indicates that augmenting batch with randomly generated policies can reduce overfitting in a certain extent. Furthermore, our method achieves the best test error of $2 0 . 6 0 \%$ through augmenting samples with adversarial policies. From the result, we can conclude that these policies generated by the policy network are more adaptive to the training process, and make the target network have to learn more robust features.
+
+# 4.5 COMPUTING COST AND TIME OVERHEAD
+
+Computing Cost: The computation in target network training is reused for policy evaluation. This makes the computing cost in policy search become negligible. Although there exists an increase of computing cost in target network training, the total computing cost in training one target network with augmentation policies is quite small compared to prior work.
+
+Time Overhead: Since we just train one target network with a large batch distributedly and simultaneously, the time overhead of the large-batch training is equal to the regular training. Meanwhile, the joint optimization of target network training and augmentation policy search dispenses with the process of offline policy search and the retraining of a target network, which leads to a extreme time overhead reduction.
+
+Table 4: Top-1 test error $( \% )$ of ResNet-50 with different augmentation methods on ImageNet.
+
+
Method
Aug. Policy
Enlarge Batch
LR Schedule
Test Error
Baseline
standard
M=1
step
23.69
Fixed
standard
M=8
cosine
22.70
Random
random
M=8
cosine
21.68
Ours
adversarial
M=8
cosine
20.60
+
+In Table 5, we take the training of ResNet-50 on ImageNet as an example to compare the computing cost and time overhead of our method and AutoAugment. From the table, we can find that our method is $1 2 \times$ less computing cost and $1 1 \times$ shorter time overhead than AutoAugment.
+
+Table 5: The comparison of computing cost (GPU hours) and time overhead (days) in training ResNet-50 on ImageNet between AutoAugment and our method. The computing cost and time overhead are estimated on 64 NVIDIA Tesla V100s.
+
+
Method
Computing Cost
Time Overhead
Searching
Training
Total
Searching
Training
Total
AutoAugment
15000
160
15160
10
1
11
Our Method
~0
1280
1280
~0
1
1
+
+# 4.6 TRANSFERABILITY ACROSS DATASETS AND ARCHITECTURES
+
+To further show the higher efficiency of our method, the transferability of the learned augmentation policies is evaluated in this section. We first take a snapshot of the adversarial training process of ResNet-50 on ImageNet, and then directly use the learned dynamic augmentation policies to regularly train the following models: Wide-ResNet-28-10 on CIFAR-10/100, ResNet-50-D on ImageNet and ResNet200 on ImageNet. Table 6 presents the experimental results of the transferability. From the table, we can find that a competitive performance can be still achieved through direct policy transfer. This indicates that the learned augmentation policies transfer well across datasets and architectures. However, compared to the proposed method, the policy transfer results in an obvious performance degradation, especially the transfer across datasets.
+
+Table 6: Top-1 test error $( \% )$ of the transfer of the augmentation policies learned with ResNet-50 on ImageNet.
+
+
Method
Dataset
AutoAugment
Our Method
Policy Transfer
Wide-ResNet-28-10
CIFAR-10
2.68
1.90
2.45±0.13
Wide-ResNet-28-10
CIFAR-100
17.09
15.49
16.48±0.15
ResNet-50-D
ImageNet
1
20.00
20.20±0.05
ResNet-200
ImageNet
20.00
18.68
19.05±0.10
+
+# 5 CONCLUSION
+
+In this paper, we introduce the idea of adversarial learning into automatic data augmentation. The policy network tries to combat the overfitting of the target network through generating adversarial policies with the training process. To oppose this, robust features are learned in the target network, which leads to a significant performance improvement. Meanwhile, the augmentation policy search is performed along with the training of a target network, and the computation in network training is reused for policy evaluation, which can extremely reduce the search cost and make our method more computing-efficient.
+
+# REFERENCES
+
+Antreas Antoniou, Amos J. Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. ICLR, 2017.
+
+Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: ´ Learning augmentation policies from data. CVPR, 2019.
+
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. CVPR, 2009.
+
+Terrance Devries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. CoRR, abs/1708.04552, 2017.
+
+Maayan Frid-Adar, Eyal Klang, Michal Amitai, Jacob Goldberger, and Hayit Greenspan. Synthetic data augmentation using GAN for improved liver lesion classification. IEEE International Symposium on Biomedical Imaging (ISBI), 2018.
+
+Xavier Gastaldi. Shake-shake regularization. CoRR, abs/1705.07485, 2017.
+
+Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. NIPS, 2014.
+
+Minghao Guo, Zhao Zhong, Wei Wu, Dahua Lin, and Junjie Yan. IRLAS: inverse reinforcement learning for architecture search. CoRR, abs/1812.05285, 2018.
+
+Swaminathan Gurumurthy, Ravi Kiran Sarvadevabhatla, and Venkatesh Babu Radhakrishnan. Deligan : Generative adversarial networks for diverse and limited data. CVPR, 2017.
+
+Dongyoon Han, Jiwhan Kim, and Junmo Kim. Deep pyramidal residual networks. CVPR, 2017.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016.
+
+Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. CoRR, abs/1812.01187, 2018.
+
+Daniel Ho, Eric Liang, Ion Stoica, Pieter Abbeel, and Xi Chen. Population based augmentation: Efficient learning of augmentation policy schedules. ICML, 2019.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 1997.
+
+Elad Hoffer, Tal Ben-Nun, Itay Hubara, Niv Giladi, Torsten Hoefler, and Daniel Soudry. Augment your batch: better training with larger batches. CoRR, abs/1901.09335, 2019.
+
+Hiroshi Inoue. Data augmentation by pairing samples for images classification. CoRR, abs/1801.02929, 2018.
+
+Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M. Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, Chrisantha Fernando, and Koray Kavukcuoglu. Population based training of neural networks. CoRR, abs/1711.09846, 2017.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR, 2015.
+
+Alex Krizhevsky and Geoffrey E. Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
+
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. NIPS, 2012.
+
+Joseph Lemley, Shabab Bazrafkan, and Peter Corcoran. Smart augmentation - learning an optimal data augmentation strategy. CoRR, abs/1703.08383, 2017.
+
+Chen Lin, Minghao Guo, Chuming Li, Wei Wu, Dahua Lin, Wanli Ouyang, and Junjie Yan. Online hyper-parameter learning for auto-augmentation strategy. CoRR, abs/1905.07373, 2019.
+
+Xi Peng, Zhiqiang Tang, Fei Yang, Rogerio Schmidt Feris, and Dimitris N. Metaxas. Jointly op- ´ timize data augmentation and network training: Adversarial data augmentation in human pose estimation. CVPR, 2018.
+
+Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning. CoRR, abs/1712.04621, 2017.
+
+Julian Salazar, Davis Liang, Zhiheng Huang, and Zachary C. Lipton. Invariant representation learning for robust deep networks. NeurIPS Workshop, 2018.
+
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. CVPR, 2015.
+
+Toan Tran, Trung Pham, Gustavo Carneiro, Lyle J. Palmer, and Ian D. Reid. A bayesian data augmentation approach for learning deep models. NIPS, 2017.
+
+Li Wan, Matthew Zeiler, Sixin Zhang, Yann LeCun, and Rob Fergus. Regularization of neural networks using dropconnect. ICML, 2013.
+
+Xiaolong Wang, Abhinav Shrivastava, and Abhinav Gupta. A-fast-rcnn: Hard positive generation via adversary for object detection. CVPR, 2017.
+
+Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 1992.
+
+Yoshihiro Yamada, Masakazu Iwamura, and Koichi Kise. Shakedrop regularization. CoRR, abs/1802.02375, 2018.
+
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. British Machine Vision Conference, 2016.
+
+Zhao Zhong, Junjie Yan, and Cheng-Lin Liu. Practical network blocks design with Q-learning. CVPR, 2018a.
+
+Zhao Zhong, Zichen Yang, Boyang Deng, Junjie Yan, Wei Wu, Jing Shao, and Cheng-Lin Liu. BlockQNN: Efficient block-wise neural network architecture generation. CoRR, abs/1808.05584, 2018b.
+
+Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. ICLR, 2016.
+
+Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. CVPR, 2017.
+
+A APPENDIX
+
+# A.1 HYPERPARAMETERS
+
+We detail the model hyperparameters on CIFAR-10/CIFAR-100 and ImageNet in Table 7.
+
+Table 7: Model hyperparameters on CIFAR-10/CIFAR-100 and ImageNet. LR represents learning rate, and WD represents weight decay. We do not specifically tune these hyperparameters, and all of these are consistent with previous works, expect for the number of epochs.
+
+
Dataset
Model
Batch Size (N · M)
LR
WD
Epoch
CIFAR-10
Wide-ResNet-28-10
128·8
0.1
5e-4
200
CIFAR-10
Shake-Shake (26 2x32d)
128·8
0.2
1e-4
600
CIFAR-10
Shake-Shake ( (262x96d)
128·8
0.2
1e-4
600
CIFAR-10
Shake-Shake (26 2x112d)
128·8
0.2
1e-4
600
CIFAR-10
PyramidNet+ShakeDrop
128·8
0.1
1e-4
600
CIFAR-100
Wide-ResNet-28-10
128·8
0.1
5e-4
200
CIFAR-100
Shake-Shake (26 2x96d)
128·8
0.1
5e-4
1200
CIFAR-100
PyramidNet+ShakeDrop
128·8
0.5
1e-4
1200
ImageNet
ResNet-50
2048·8
0.8
1e-4
120
ImageNet
ResNet-50-D
2048·8
0.8
1e-4
120
ImageNet
ResNet-200
2048·8
0.8
1e-4
120
\ No newline at end of file
diff --git a/md/train/H1Dy---0Z/H1Dy---0Z.md b/md/train/H1Dy---0Z/H1Dy---0Z.md
new file mode 100644
index 0000000000000000000000000000000000000000..e7f2f8368a802ed79397857690af73506b623ad6
--- /dev/null
+++ b/md/train/H1Dy---0Z/H1Dy---0Z.md
@@ -0,0 +1,340 @@
+# DISTRIBUTED PRIORITIZED EXPERIENCE REPLAY
+
+Dan Horgan
+DeepMind
+horgan@google.com
+John Quan
+DeepMind
+johnquan@google.com
+David Budden
+DeepMind
+budden@google.com
+
+Gabriel Barth-Maron DeepMind gabrielbm@google.com
+
+Matteo Hessel
+DeepMind
+mtthss@google.com
+
+Hado van Hasselt DeepMind hado@google.com
+
+David Silver
+DeepMind
+davidsilver@google.com
+
+# ABSTRACT
+
+We propose a distributed architecture for deep reinforcement learning at scale, that enables agents to learn effectively from orders of magnitude more data than previously possible. The algorithm decouples acting from learning: the actors interact with their own instances of the environment by selecting actions according to a shared neural network, and accumulate the resulting experience in a shared experience replay memory; the learner replays samples of experience and updates the neural network. The architecture relies on prioritized experience replay to focus only on the most significant data generated by the actors. Our architecture substantially improves the state of the art on the Arcade Learning Environment, achieving better final performance in a fraction of the wall-clock training time.
+
+# 1 INTRODUCTION
+
+A broad trend in deep learning is that combining more computation (Dean et al., 2012) with more powerful models (Kaiser et al., 2017) and larger datasets (Deng et al., 2009) yields more impressive results. It is reasonable to hope that a similar principle holds for deep reinforcement learning. There are a growing number of examples to justify this optimism: effective use of greater computational resources has been a critical factor in the success of such algorithms as Gorila (Nair et al., 2015), A3C (Mnih et al., 2016), GPU Advantage Actor Critic (Babaeizadeh et al., 2017), Distributed PPO (Heess et al., 2017) and AlphaGo (Silver et al., 2016).
+
+Deep learning frameworks such as TensorFlow (Abadi et al., 2016) support distributed training, making large scale machine learning systems easier to implement and deploy. Despite this, much current research in deep reinforcement learning concerns itself with improving performance within the computational budget of a single machine, and the question of how to best harness more resources is comparatively underexplored.
+
+In this paper we describe an approach to scaling up deep reinforcement learning by generating more data and selecting from it in a prioritized fashion (Schaul et al., 2016). Standard approaches to distributed training of neural networks focus on parallelizing the computation of gradients, to more rapidly optimize the parameters (Dean et al., 2012). In contrast, we distribute the generation and selection of experience data, and find that this alone suffices to improve results. This is complementary to distributing gradient computation, and the two approaches can be combined, but in this work we focus purely on data-generation.
+
+We use this distributed architecture to scale up variants of Deep Q-Networks (DQN) and Deep Deterministic Policy Gradient (DDPG), and we evaluate these on the Arcade Learning Environment benchmark (Bellemare et al., 2013), and on a range of continuous control tasks. Our architecture achieves a new state of the art performance on Atari games, using a fraction of the wall-clock time compared to the previous state of the art, and without per-game hyperparameter tuning.
+
+We empirically investigate the scalability of our framework, analysing how prioritization affects performance as we increase the number of data-generating workers. Our experiments include an analysis of factors such as the replay capacity, the recency of the experience, and the use of different data-generating policies for different workers. Finally, we discuss implications for deep reinforcement learning agents that may apply beyond our distributed framework.
+
+# 2 BACKGROUND
+
+Distributed Stochastic Gradient Descent Distributed stochastic gradient descent is widely used in supervised learning to speed up training of deep neural networks, by parallelizing the computation of the gradients used to update their parameters. The resulting parameter updates may be applied synchronously (Krizhevsky, 2014) or asynchronously (Dean et al., 2012). Both approaches have proven effective and are an increasingly standard part of the deep learning toolbox. Inspired by this, Nair et al. (2015) applied distributed asynchronous parameter updates and distributed data generation to deep reinforcement learning. Asynchronous parameter updates and parallel data generation have also been successfully used within a single-machine, in a multi-threaded rather than a distributed context (Mnih et al., 2016). GPU Asynchronous Actor-Critic (GA3C; Babaeizadeh et al., 2017) and Parallel Advantage Actor-Critic (PAAC; Clemente et al., 2017) adapt this approach to make efficient use of GPUs.
+
+Distributed Importance Sampling A complementary family of techniques for speeding up training is based on variance reduction by means of importance sampling (cf. Hastings, 1970). This has been shown to be useful in the context of neural networks (Hinton, 2007). Sampling non-uniformly from a dataset and weighting updates according to the sampling probability in order to counteract the bias thereby introduced can increase the speed of convergence by reducing the variance of the gradients. One way of doing this is to select samples with probability proportional to the $L _ { 2 }$ norm of the corresponding gradients. In supervised learning, this approach has been successfully extended to the distributed setting (Alain et al., 2015). An alternative is to rank samples according to their latest known loss value and make the sampling probability a function of the rank rather than of the loss itself (Loshchilov & Hutter, 2015).
+
+Prioritized Experience Replay Experience replay (Lin, 1992) has long been used in reinforcement learning to improve data efficiency. It is particularly useful when training neural network function approximators with stochastic gradient descent algorithms, as in Neural Fitted Q-Iteration (Riedmiller, 2005) and Deep Q-Learning (Mnih et al., 2015). Experience replay may also help to prevent overfitting by allowing the agent to learn from data generated by previous versions of the policy. Prioritized experience replay (Schaul et al., 2016) extends classic prioritized sweeping ideas (Moore & Atkeson, 1993) to work with deep neural network function approximators. The approach is strongly related to the importance sampling techniques discussed in the previous section, but using a more general class of biased sampling procedures that focus learning on the most ‘surprising’ experiences. Biased sampling can be particularly helpful in reinforcement learning, since the reward signal may be sparse and the data distribution depends on the agent’s policy. As a result, prioritized experience replay is used in many agents, such as Prioritized Dueling DQN (Wang et al., 2016), UNREAL (Jaderberg et al., 2017), DQfD (Hester et al., 2017), and Rainbow (Hessel et al., 2017). In an ablation study conducted to investigate the relative importance of several algorithmic ingredients (Hessel et al., 2017), prioritization was found to be the most important ingredient contributing to the agent’s performance.
+
+# 3 OUR CONTRIBUTION: DISTRIBUTED PRIORITIZED EXPERIENCE REPLAY
+
+In this paper we extend prioritized experience replay to the distributed setting and show that this is a highly scalable approach to deep reinforcement learning. We introduce a few key modifications that enable this scalability, and we refer to our approach as Ape-X.
+
+
+Figure 1: The Ape-X architecture in a nutshell: multiple actors, each with its own instance of the environment, generate experience, add it to a shared experience replay memory, and compute initial priorities for the data. The (single) learner samples from this memory and updates the network and the priorities of the experience in the memory. The actors’ networks are periodically updated with the latest network parameters from the learner.
+
+
Algorithm1 Actor
1: procedure ACTOR(B,T)
>Run agent in environment instance,storing experiences.
2:
00←LEARNER.PARAMETERS()
Remote call to obtain latest network parameters.
3:
SO←ENVIRONMENT.INITIALIZE()
>Get initial state from environment.
4:
fort=1toTdo
5:
at-1←π0t-1(St-1)
Select an action using the current policy.
6:
(Tt,t,St) ←ENVIRONMENT.STEP(at-1)
>Apply the action in the environment.
7:
LOCALBUFFER.ADD((St-1,at-1,rt,/t))
Add data to local buffer.
8:
if LOCALBUFFER.SIzE()≥ B thenIn a background thread, periodically send data to replay.
9:
T ←LOCALBUFFER.GET(B)
Get buffered data (e.g.batch of multi-step transitions).
10:
p ← COMPUTEPRIORITIEs(T)>Calculate priorities for experience (e.g.absolute TD error).
11:
REPLAY.ADD(T,p)
>Remote call to add experience to replay memory.
12:
endif
13:
PERIODICALLY(0t ← LEARNER.PARAMETERS())
Obtain latest network parameters.
14:
end for
15: end procedure
+
+# Algorithm 2 Learner
+
+1: procedure LEARNER $( T )$ . Update network using batches sampled from memory.
+2: 3: $\theta _ { 0 } \gets$ INITIALIZENETWORK( )
+for $t = 1$ to $T$ do . Update the parameters $T$ times.
+4: id, τ ← REPLAY.SAMPLE( ) . Sample a prioritized batch of transitions (in a background thread).
+5: lt ← COMPUTELOSS $( \tau ; \theta _ { t } )$ . Apply learning rule; e.g. double Q-learning or DDPG
+6: $\theta _ { t + 1 } \gets$ UPDATEPARAMETERS $\left( l _ { t } ; \theta _ { t } \right)$
+7: $p $ COMPUTEPRIORITIES( ) $\triangleright$ Calculate priorities for experience, (e.g. absolute TD error).
+8: REPLAY.SETPRIORITY $( i d , p )$ $\triangleright$ Remote call to update priorities.
+9: PERIODICALLY(REPLAY.REMOVETOFIT()) . Remove old experience from replay memory.
+10: end for
+11: end procedure
+
+As in Gorila (Nair et al., 2015), we decompose the standard deep reinforcement learning algorithm into two parts, which run concurrently with no high-level synchronization. The first part consists of stepping through an environment, evaluating a policy implemented as a deep neural network, and storing the observed data in a replay memory. We refer to this as acting. The second part consists of sampling batches of data from the memory to update the policy parameters. We term this learning.
+
+In principle, both acting and learning may be distributed across multiple workers. In our experiments, hundreds of actors run on CPUs to generate data, and a single learner running on a GPU samples the most useful experiences (Figure 1). Pseudocode for the actors and learners is shown in Algorithms 1 and 2. Updated network parameters are periodically communicated to the actors from the learner.
+
+In contrast to Nair et al. (2015), we use a shared, centralized replay memory, and instead of sampling uniformly, we prioritize, to sample the most useful data more often. Since priorities are shared, high priority data discovered by any actor can benefit the whole system. Priorities can be defined in various ways, depending on the learning algorithm; two instances are described in the next sections.
+
+In Prioritized DQN (Schaul et al., 2016) priorities for new transitions were initialized to the maximum priority seen so far, and only updated once they were sampled. This does not scale well: due to the large number of actors in our architecture, waiting for the learner to update priorities would result in a myopic focus on the most recent data, which has maximum priority by construction. Instead, we take advantage of the computation the actors in Ape-X are already doing to evaluate their local copies of the policy, by making them also compute suitable priorities for new transitions online. This ensures that data entering the replay has more accurate priorities, at no extra cost.
+
+Sharing experiences has certain advantages compared to sharing gradients. Low latency communication is not as important as in distributed SGD, because experience data becomes outdated less rapidly than gradients, provided the learning algorithm is robust to off-policy data. Across the system, we take advantage of this by batching all communications with the centralized replay, increasing the efficiency and throughput at the cost of some latency. With this approach it is even possible for actors and learners to run in different data-centers without limiting performance.
+
+Finally, by learning off-policy (cf. Sutton & Barto, 1998; 2017), we can further take advantage of Ape-X’s ability to combine data from many distributed actors, by giving the different actors different exploration policies, broadening the diversity of the experience they jointly encounter. As we will see in the results, this can be sufficient to make progress on difficult exploration problems.
+
+# 3.1 APE-X DQN
+
+The general framework we have described may be combined with different learning algorithms. First, we combined it with a variant of DQN (Mnih et al., 2015) with some of the components of Rainbow (Hessel et al., 2017). More specifically, we used double Q-learning (van Hasselt, 2010; van Hasselt et al., 2016) with multi-step bootstrap targets (cf. Sutton, 1988; Sutton & Barto, 1998; 2017; Mnih et al., 2016) as the learning algorithm, and a dueling network architecture (Wang et al., 2016) as the function approximator $q ( \cdot , \cdot , \pmb \theta )$ .
+
+This results in computing for all elements in the batch the loss $l _ { t } ( \pmb \theta ) = { \textstyle { \frac { 1 } { 2 } } } ( G _ { t } - q ( S _ { t } , A _ { t } , \pmb \theta ) ) ^ { 2 }$ with
+
+$$
+G _ { t } = R _ { t + 1 } + \gamma R _ { t + 2 } + . . . + \gamma ^ { n - 1 } R _ { t + n } + \gamma ^ { n } \overbrace { q ( S _ { t + n } , \underset { a } { \mathrm { a r g m a x } } q ( S _ { t + n } , a , \pmb { \theta } ) , \pmb { \theta } ^ { - } ) } ^ { \theta _ { t } } ,
+$$
+
+where $t$ is a time index for an experience sampled from the replay starting with state $S _ { t }$ and action $A _ { t }$ , and $\pmb { \theta } ^ { - }$ denotes parameters of the target network (Mnih et al., 2015), a slow moving copy of the online parameters. Multi-step returns are truncated if the episode ends in fewer than $n$ steps.
+
+In principle, Q-learning variants are off-policy methods, so we are free to choose the policies we use to generate data. However, in practice, the choice of behaviour policy does affect both exploration and the quality of function approximation. Furthermore, we are using a multi-step return with no off-policy correction, which in theory could adversely affect the value estimation. Nonetheless, in Ape-X DQN, each actor executes a different policy, and this allows experience to be generated from a variety of strategies, relying on the prioritization mechanism to pick out the most effective experiences. In our experiments, the actors use $\epsilon$ -greedy policies with different values of . Low $\epsilon$ policies allow exploring deeper in the environment, while high $\epsilon$ policies prevent over-specialization.
+
+# 3.2 APE-X DPG
+
+To test the generality of the framework we also combined it with a continuous-action policy gradient system based on DDPG (Lillicrap et al., 2016), an implementation of deterministic policy gradients Silver et al. (2014) also similar to older methods (Werbos, 1990; Prokhorov & Wunsch, 1997), and tested it on continuous control tasks from the DeepMind Control Suite (Tassa et al., 2018).
+
+
+Figure 2: Left: Atari results aggregated across 57 games, evaluated from random no-op starts. Right: Atari training curves for selected games, against baselines. Blue: Ape- $\mathrm { . } \mathrm { X }$ DQN with 360 actors; Orange: A3C; Purple: Rainbow; Green: DQN. See appendix for longer runs over all games.
+
+The Ape-X DPG setup is similar to Ape-X DQN, but the actor’s policy is now represented explicitly by a separate policy network, in addition to the Q-network. The two networks are optimized separately, by minimizing different losses on the sampled experience. We denote the policy and Q-network parameters by $\phi$ and $\psi$ respectively, and adopt the same convention as above to denote target networks. The Q-network outputs an action-value estimate $q ( s , a , \psi )$ for a given state $s$ , and multi-dimensional action $a \in \mathbb { R } ^ { m }$ . It is updated using temporal-difference learning with a multi-step bootstrap target. The Q-network loss can be written as $\begin{array} { r } { l _ { t } ( \dot { \psi } ) = \frac { 1 } { 2 } ( G _ { t } - q ( S _ { t } , A _ { t } , \hat { \psi } ) ) ^ { 2 } } \end{array}$ , where
+
+$$
+G _ { t } = { R } _ { t + 1 } + \gamma { R } _ { t + 2 } + \ldots + \gamma ^ { n - 1 } { R } _ { t + n } + \gamma ^ { n } q ( S _ { t + n } , \pi ( S _ { t + n } , \phi ^ { - } ) , \psi ^ { - } ) .
+$$
+
+The policy network outputs an action $A _ { t } = \pi ( S _ { t } , \phi ) \in \mathbb { R } ^ { m }$ . The policy parameters are updated using policy gradient ascent on the estimated Q-value, using gradient $\nabla _ { \phi } q ( S _ { t } , \pi ( S _ { t } , \phi ) , \psi )$ — note that this depends on the policy parameters $\phi$ only through the action $A _ { t } = \pi ( S _ { t } , \phi )$ that is input to the critic network. Further details of the Ape- $\mathbf { \nabla } \cdot \mathbf { X }$ DPG algorithm are available in the appendix.
+
+# 4 EXPERIMENTS
+
+# 4.1 ATARI
+
+In our first set of experiments we evaluate Ape-X DQN on Atari, and show state of the art results on this standard reinforcement learning benchmark. We use 360 actor machines (each using one CPU core) to feed data into the replay memory as fast as they can generate it; approximately 139 frames per second (FPS) each, for a total of $\mathord { \sim } 5 0 \mathrm { K }$ FPS, which corresponds to ${ \sim } 1 2 . 5 \mathrm { K }$ transitions (because of a fixed action repeat of 4). The actors batch experience data locally before sending it to the replay: up to 100 transitions may be buffered at a time, which are then sent asynchronously in batches of $B = 5 0$ . The learner asynchronously prefetches up to 16 batches of 512 transitions, and computes updates for 19 such batches each second, meaning that gradients are computed for ${ \sim } 9 . 7 \mathrm { K }$ transitions per second on average. To reduce memory and bandwidth requirements, observation data is compressed using a PNG codec when sent and when stored in the replay. The learner decompresses data as it prefetches it, in parallel with computing and applying gradients. The learner also asynchronously handles any requests for parameters from actors.
+
+
Training Time
Environment Frames
Resources (per game)
Median (no-op starts)
Median (human starts)
Ape-X DQN
5 days
22800M
376 cores,1 GPU a
434%
358%
Rainbow
10 days
200M
1 GPU
223%
153%
Distributional (C51)
10 days
200M
1 GPU
178%
125%
A3C
4 days
16 cores
117%
Prioritized Dueling
9.5 days
200M
1 GPU
172%
115%
DQN
9.5 days
200M
1 GPU
79%
68%
GorilaDQN
~4 days
unknown b
96%
78%
UNREAL d
250M
16 cores
331% d
250% d
+
+Table 1: Median normalized scores across 57 Atari games. a Tesla P100. $^ \mathrm { b } > 1 0 0$ CPUs, with a mixed number of cores per CPU machine. c Only evaluated on 49 games. d Hyper-parameters were tuned per game.
+
+Actors copy the network parameters from the learner every 400 frames ${ \sim } 2 . 8$ seconds). Each actor $i \in \{ 0 , . . . , N - 1 \}$ executes an $\epsilon _ { i }$ -greedy policy where $\epsilon _ { i } = \epsilon ^ { 1 + \frac { i } { N - 1 } \alpha }$ with $\epsilon = 0 . 4$ , $\alpha = 7$ . Each $\epsilon _ { i }$ is held constant throughout training. The episode length is limited to 50000 frames during training.
+
+The capacity of the shared experience replay memory is soft-limited to 2 million transitions: adding new data is always permitted, to not slow down the actors, but every 100 learning steps any excess data above this capacity threshold is removed en masse, in FIFO order. The median actual size of the memory is 2035050. Data is sampled according to proportional prioritization, with a priority exponent of 0.6 and an importance sampling exponent set to 0.4.
+
+In Figure 2, on the left, we compare the median human normalized score across all 57 games to several baselines: DQN, Prioritized DQN, Distributional DQN (Bellemare et al., 2017), Rainbow, and Gorila. In all cases the performance is measured at the end of training under the no-op starts testing regime (Mnih et al., 2015). On the right, we show initial learning curves (taken from the greediest actor) for a selection of 6 games (full learning curves for all games are in the appendix). Given that Ape-X can harness substantially more computation than most baselines, one might expect it to train faster. Figure 2 shows that this was indeed the case. Perhaps more surprisingly, our agent achieved a substantially higher final performance.
+
+In Table 1 we compare the median human-normalized performance of Ape-X DQN on the Atari benchmark to corresponding metrics as reported for other baseline agents in their respective publications. Whenever available we report results both for no-op starts and for human starts. The human-starts regime (Nair et al., 2015) corresponds to a more challenging generalization test, as the agent is initialized from random starts drawn from games played by human experts. Ape-X’s performance is higher than the performance of any of the baselines according to both metrics.
+
+# 4.2 CONTINUOUS CONTROL
+
+In a second set of experiments we evaluated Ape-X DPG on four continuous control tasks. In the manipulator domain the agent must learn to bring a ball to a specified location. In the humanoid domain the agent must learn to control a humanoid body to solve three distinct tasks of increasing complexity: Standing, Walking and Running. Since here we learn from features, rather than from pixels, the observation space is much smaller than it is in the Atari domain. We therefore use small, fully-connected networks (details in the appendix). With 64 actors on this domain, we obtain ${ \sim } 1 4 \mathrm { K }$ total FPS (the same number of transitions per second; here we do not use action repeats). We process 86 batches of 256 transitions per second, or ${ \sim } 2 2 \mathrm { K }$ transitions processed per second.
+
+Figure 3 shows that Ape-X DPG achieved very good performance on all four tasks. The figure shows the performance of Ape-X DPG for different numbers of actors: as the number of actors increases our agent becomes increasingly effective at solving these problems rapidly and reliably, outperforming a standard DDPG baseline trained for over 10 times longer. A parallel paper (Barth-Maron et al., 2018) builds on this work by combining Ape-X DPG with distributional value functions, and the resulting algorithm is successfully applied to further continuous control tasks.
+
+
+Figure 3: Performance of Ape-X DPG on four continuous control tasks, as a function of wall clock time. Performance improves as we increase the numbers of actors. The black dashed line indicates the maximum performance reached by a standard DDPG baseline over 5 days of training.
+
+
+Figure 4: Scaling the number of actors. Performance consistently improves as we scale the number of actors from 8 to 256, note that the number of learning updates performed does not depend on the number of actors.
+
+# 5 ANALYSIS
+
+In this section we describe additional Ape-X DQN experiments on Atari that helped improve our understanding of the framework, and we investigate the contribution of different components.
+
+First, we investigated how the performance scales with the number of actors. We trained our agent with different numbers of actors (8, 16, 32, 64, 128 and 256) for 35 hours on a subset of 6 Atari games. In all experiments we kept the size of the shared experience replay memory fixed at 1 million transitions. Figure 4 shows that the performance consistently improved as the number of actors increased. The appendix contains learning curves for additional games, and a comparison of the scalability of the algorithm with and without prioritized replay. It is perhaps surprising that performance improved so substantially purely by increasing the number of actors, without changing the rate at which the network parameters are updated, the structure of the network, or the update rule. We hypothesize that the proposed architecture helps with a common deep reinforcement learning failure mode, in which the policy discovered is a local optimum in the parameter space, but not a global one, e.g., due to insufficient exploration. Using a large number of actors with varying amounts of exploration helps to discover promising new courses of action, and prioritized replay ensures that when this happens, the learning algorithm focuses its efforts on this important information.
+
+Next, we investigated varying the capacity of the replay memory (see Figure 5). We used a setup with 256 actors, for a median of ${ \sim } 3 7 \mathrm { K }$ total environment frames per second (approximately ${ \sim } 9 \mathrm { K }$ transitions). With such a large number of actors, the contents of the memory is replaced much faster than in most DQN-like agents. We observed a small benefit to using a larger replay capacity. We hypothesize this is due to the value of keeping some high priority experiences around for longer and replaying them. As above, a single learner machine trained the network with median 19 batches per second, each of 512 transitions, for a median of ${ \sim } 9 . 7 \mathrm { K }$ transitions processed per second.
+
+
+Figure 5: Varying the capacity of the replay. Agents with larger replay memories perform better on most games. Each curve corresponds to a single run, smoothed over 20 points. The curve for Wizard Of Wor with replay size 250K is incomplete because training diverged; we did not observe this with the other replay sizes.
+
+Finally, we ran additional experiments to disentangle potential effects of two confounding factors in our scalability analysis: recency of the experience data in the replay memory, and diversity of the data-generating policies. The full description of these experiments is confined to the appendix; to summarize, neither factor alone is sufficient to explain the performance we see. We therefore conclude that the results are due substantially to the positive effects of gathering more experience data; namely better exploration of the environment and better avoidance of overfitting.
+
+# 6 CONCLUSION
+
+We have designed, implemented, and analyzed a distributed framework for prioritized replay in deep reinforcement learning. This architecture achieved state of the art results in a wide range of discrete and continuous tasks, both in terms of wall-clock learning speed and final performance.
+
+In this paper we focused on applying the Ape-X framework to DQN and DPG, but it could also be combined with any other off-policy reinforcement learning update. For methods that use temporally extended sequences (e.g., Mnih et al., 2016; Wang et al., 2017), the Ape-X framework may be adapted to prioritize sequences of past experiences instead of individual transitions.
+
+Ape-X is designed for regimes in which it is possible to generate large quantities of data in parallel. This includes simulated environments but also a variety of real-world applications, such as robotic arm farms, self-driving cars, online recommender systems, or other multi-user systems in which data is generated by many instances of the same environment (c.f. Silver et al., 2013). In applications where data is costly to obtain, our approach will not be directly applicable. With powerful function approximators, overfitting is an issue: generating more training data is the simplest way of addressing it, but may also provide guidance towards data-efficient solutions.
+
+Many deep reinforcement learning algorithms are fundamentally limited by their ability to explore effectively in large domains. Ape-X uses a naive yet effective mechanism to address this issue: generating a diverse set of experiences and then identifying and learning from the most useful events. The success of this approach suggests that simple and direct approaches to exploration may be feasible, even for synchronous agents.
+
+Our architecture illustrates that distributed systems are now practical both for research and, potentially, large-scale applications of deep reinforcement learning. We hope that the algorithms, architecture, and analysis we have presented will help to accelerate future efforts in this direction.
+
+# ACKNOWLEDGMENTS
+
+We would like to acknowledge the contributions of our colleagues at DeepMind, whose input and support has been vital to the success of this work. Thanks in particular to Tom Schaul, Joseph Modayil, Sriram Srinivasan, Georg Ostrovski, Josh Abramson, Todd Hester, Jean-Baptiste Lespiau, Alban Rrustemi and Dan Belov.
+
+# REFERENCES
+
+Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
+
+Guillaume Alain, Alex Lamb, Chinnadhurai Sankar, Aaron Courville, and Yoshua Bengio. Variance reduction in sgd by distributed importance sampling. arXiv preprint arXiv:1511.06481, 2015.
+
+Mohammad Babaeizadeh, Iuri Frosio, Stephen Tyree, Jason Clemons, and Jan Kautz. Reinforcement learning through asynchronous advantage actor-critic on a gpu. In International Conference on Learning Representations, 2017.
+
+Gabriel Barth-Maron, Matthew W. Hoffman, David Budden, Will Dabney, Dan Horgan, Dhruva TB, Alistair Muldal, Nicolas Heess, and Timothy Lillicrap. Distributional policy gradients. In International Conference on Learning Representations, 2018.
+
+Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res. (JAIR), 47:253–279, 2013.
+
+Marc G. Bellemare, Will Dabney, and Remi Munos. A distributional perspective on reinforcement ´ learning. In International Conference on Machine Learning, 2017.
+
+Alfredo V. Clemente, Humberto Nicolas Castej ´ on Mart ´ ´ınez, and Arjun Chandra. Efficient parallel methods for deep reinforcement learning. arXiv preprint arXiv:1705.04862, 2017.
+
+Jeffrey Dean, Greg S. Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc V. Le, Mark Z. Mao, Marc’Aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, and Andrew Y. Ng. Large scale distributed deep networks. In Proceedings of the 25th International Conference on Neural Information Processing Systems, NIPS’12, pp. 1223–1231, USA, 2012. Curran Associates Inc.
+
+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.
+
+W Keith Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970.
+
+Nicolas Heess, Dhruva TB, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, S. M. Ali Eslami, Martin A. Riedmiller, and David Silver. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
+
+Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. arXiv preprint arXiv:1710.02298, 2017.
+
+Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Andrew Sendonaris, Gabriel Dulac-Arnold, Ian Osband, John Agapiou, Joel Z. Leibo, and Audrunas Gruslys. Learning from demonstrations for real world reinforcement learning. CoRR, abs/1704.03732, 2017.
+
+Geoffrey E Hinton. To recognize shapes, first learn to generate images. Prog. Brain Res., 165: 535–547, 2007.
+
+Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In International Conference on Learning Representations, 2017.
+
+Lukasz Kaiser, Aidan N. Gomez, Noam Shazeer, Ashish Vaswani, Niki Parmar, Llion Jones, and Jakob Uszkoreit. One model to learn them all. CoRR, abs/1706.05137, 2017.
+
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
+
+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. In International Conference on Learning Representations, 2016.
+
+Long-H Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine Learning, 1992.
+
+Ilya Loshchilov and Frank Hutter. Online batch selection for faster training of neural networks. arXiv preprint arXiv:1511.06343, 2015.
+
+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, 26 February 2015.
+
+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, 11 June 2016.
+
+Andrew W Moore and Christopher G Atkeson. Prioritized sweeping: Reinforcement learning with less data and less time. Machine learning, 13(1):103–130, 1993.
+
+Arun Nair, Praveen Srinivasan, Sam Blackwell, Cagdas Alcicek, Rory Fearon, Alessandro De Maria, Vedavyas Panneershelvam, Mustafa Suleyman, Charles Beattie, Stig Petersen, Shane Legg, Volodymyr Mnih, Koray Kavukcuoglu, and David Silver. Massively parallel methods for deep reinforcement learning. arXiv preprint arXiv:1507.04296, 15 July 2015.
+
+Danil V Prokhorov and Donald C Wunsch. Adaptive critic designs. IEEE transactions on Neural Networks, 8(5):997–1007, 1997.
+
+Martin Riedmiller. Neural Fitted Q Iteration – First Experiences with a Data Efficient Neural Reinforcement Learning Method, pp. 317–328. Springer Berlin Heidelberg, Berlin, Heidelberg, 2005. ISBN 978-3-540-31692-3. doi: 10.1007/11564096 32.
+
+Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. In International Conference on Learning Representations, 2016.
+
+David Silver, Leonard Newnham, David Barker, Suzanne Weller, and Jason McFall. Concurrent reinforcement learning from customer interactions. In Sanjoy Dasgupta and David McAllester (eds.), Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pp. 924–932, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR.
+
+David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 387–395, 2014.
+
+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.
+
+Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9–44, 1988.
+
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press Cambridge, 1998.
+
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, 2nd edition. 2017.
+
+Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018.
+
+Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
+
+George E Uhlenbeck and Leonard S Ornstein. On the theory of the brownian motion. Physical review, 36(5):823, 1930.
+
+Hado van Hasselt. Double Q-learning. In Advances in Neural Information Processing Systems, pp. 2613–2621, 2010.
+
+Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double Qlearning. In Advances in Neural Information Processing Systems, 2016.
+
+Ziyu Wang, Tom Schaul, Matteo Hessel, Hado van Hasselt, Marc Lanctot, and Nando de Freitas. Dueling network architectures for deep reinforcement learning. In International Conference on Machine Learning, 2016.
+
+Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. In International Conference on Learning Representations, 2017.
+
+Paul J Werbos. A menu of designs for reinforcement learning over time. Neural networks for control, pp. 67–95, 1990.
+
+
+Figure 6: Testing whether improved performance is caused by recency alone: $n$ denotes the number of actors, $k$ the number of times each transition is replicated in the replay. The data in the run with $n = 3 2$ , $k = 8$ is therefore as recent as the data in the run with $n = 2 5 6$ , $k = 1$ , but performance is not as good.
+
+
+Figure 7: Varying the data-generating policies: Red: fixed set of 6 values for $\cdot$ . Blue: full range of values for $\epsilon$ . In both cases, the curve plotted is from a separate actor that does not add data to the replay memory, and which follows an $\epsilon$ -greedy policy with $\epsilon = 0 . 0 0 1 6 4$ .
+
+# A RECENCY OF EXPERIENCE
+
+In our main experiments we do not change the size of the replay memory in proportion to the number of actors, so by changing the number of actors we also increased the rate at which the contents of the replay memory is replaced. This means that in the experiments with more actors, transitions in the replay memory are more recent: they are generated by following policies whose parameters are closer to version of the parameters being optimized by the learner, and in this sense they are more onpolicy. Could this alone be sufficient to explain the improved performance? If so, we might be able to recover the results without needing a large number of actor machines. To test this, we constructed an experiment wherein we replicate the rate at which the contents of the replay memory is replaced in the 256-actor experiments, but instead of actually using 256 actors, we use 32 actors but add each transition they generate to the replay memory 8 times over. In this setup, the contents of the replay memory is similarly generated by policies with a recent version of the network parameters: the only difference is that the data is not as diverse as in the 256-actor case. We observe (see Figure 6) that this does not recover the same performance, and therefore conclude that the recency of the experience alone is not sufficient to explain the performance of our method. Indeed, we see that adding the same data multiple times can sometimes harm performance, since although it increases recency this comes at the expense of diversity.
+
+Note: in principle, duplicating the added data in this fashion has a similar effect to reducing the capacity of the replay memory, and indeed, our results with a smaller replay memory in Figure 5 do corroborate the finding. However, we test also by duplicating the data primarily in order to exclude any effects arising from the implementation. In particular, in contrast to simply reducing the replay capacity, duplicating each data point means that the computational demands on the replay server in these runs are the same as when we use the corresponding number of real actors.
+
+# B VARYING THE DATA-GENERATING POLICIES
+
+Another factor that could conceivably contribute to the scalability of our algorithm is the fact that each actor has a different $\epsilon$ . To determine the extent to which this impacts upon the performance, we ran an experiment (see Figure 7) with some simple variations on the mechanism we use to choose the policies that generate the data we train on. The first alternative we tested is to choose a small fixed set of 6 values for $\epsilon$ , instead of the full range that we typically use. In this test, we use prioritized
+
+replay as normal, and we find that the results with the full range of $\epsilon$ are overall slightly better.
+However, it is not essential for achieving good results within our distributed framework.
+
+# C ATARI: ADDITIONAL DETAILS
+
+The frames received from the environment are preprocessed on the actor side with the standard transformations introduced by DQN. This includes greyscaling, frame stacking, repeating actions 4 times, and clipping rewards to $[ - 1 , 1 ]$ .
+
+The learner waits for at least 50000 transitions to be accumulated in the replay before starting learning. We use a Centered RMSProp optimizer with a learning rate of $0 . 0 0 0 2 5 \mid 4$ , decay of 0.95, epsilon of 1.5e-7, and no momentum to minimize the multi-step loss (with $n = 3$ ). Gradient norms are clipped to 40. The target network used in the loss calculation is copied from the online network every 2500 training batches. We use the same network as in the Dueling DDQN agent.
+
+# D CONTINUOUS CONTROL: ADDITIONAL DETAILS
+
+The critic network has a layer with 400 units, followed by a tanh activation, followed by another layer of 300 units. The actor network has a layer with 300 units, followed by a tanh activation, followed by another layer of 200 units. The gradient used to update the actor network is clipped to $[ - 1 , 1 ]$ , element-wise. Training uses the Adam optimizer (Kingma & Ba (2014)) with learning rate of 0.0001. The target network used in the loss calculation is copied from the online network every 100 training batches.
+
+Replay sampling priorities are set according to the absolute TD error as given by the critic, and are sampled by the learner using proportional prioritized sampling (see appendix F) with priority exponent $\alpha _ { \mathrm { s a m p l e } } = 0 . 6$ . To maintain a fixed replay capacity of $\mathrm { { \bar { 1 } 0 ^ { 6 } } }$ , transitions are periodically evicted using proportional prioritized sampling, with priority exponent $\alpha _ { \mathrm { e v i c t } } = - 0 . 4$ . This is a different strategy for removing data than in the Atari experiments, which simply removed the oldest data first - it remains to be seen which is superior.
+
+Unlike the original DPG algorithm which applies autocorrelated noise sampled from a OrnsteinUhlenbeck process (Uhlenbeck & Ornstein (1930)), we apply exploration noise to each action sampled from a normal distribution with $\sigma = 0 . 3$ . Evaluation is performed using the noiseless deterministic policy. Hyperparameters are otherwise as per DQN.
+
+Benchmarking was performed in two continuous control domains ((a) Humanoid and (b) Manipulator, see Figure 8) implemented in the MuJoCo physics simulator (Todorov et al. (2012)). Humanoid is a humanoid walker with action, state and observation dimensionalities $| { \mathcal { A } } | = 2 1$ , $| S | = 5 5$ and $| \mathcal { O } | = 6 7 $ respectively. Three Humanoid tasks were considered: walk (reward for exceeding a minimum velocity), run (reward proportional to movement speed) and stand (reward proportional to standing height). Manipulator is a 2-dimensional planar arm with $| { \mathcal { A } } | = 2$ , $| { \cal S } | = 2 2$ and $| \mathcal { O } | = 3 7 $ , which receives reward for catching a randomly-initialized moving ball.
+
+
+Figure 8: Continuous control domains considered for benchmarking Ape-X DPG: (a) Humanoid, and (b) Manipulator. All tasks simulated in the MuJoCo physics simulator (Todorov et al. (2012)).
+
+# E TUNING
+
+On Atari, we performed some limited tuning of the learning rate and batch size: we found that larger batch sizes contribute significantly to performance, when using many actors. We tried batch sizes from $\{ 3 2 , 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ , seeing clear benefits up to 512. We attempted increasing the learning rate to 0.00025 with the larger batch sizes but this destabilized training on some games. We also tried a lower learning rate of $0 . 0 0 0 2 5 / 8$ , but this did not reliably improve results.
+
+Likewise for continuous control, we experimented with batch sizes $\{ 3 2 , 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ and learning rates from $1 0 ^ { - 3 }$ to $1 0 ^ { - 5 }$ . We also experimented with the prioritization exponents $\alpha$ from 0.0 to 1.0, with results proving essentially consistent within the range [0.3, 0.7] (beyond 0.7, training would sometimes become unstable and diverge).
+
+For the experiments with many actors, we set the period for updating network parameters on the actors to be high enough that the learner was not overloaded with requests, and we set the number of transitions that are locally accumulated on each actor to be high enough that the replay server would not be overloaded with network traffic, but we did not otherwise tune those parameters and have not observed them to have significant impact on the learning dynamics.
+
+# F IMPLEMENTATION
+
+The following section makes explicit some of the more practical details that may be of interest to anyone wishing to implement a similar system.
+
+Data Storage The algorithm is implemented using TensorFlow (Abadi et al., 2016). Replay data is kept in a distributed in-memory key-value store implemented using custom TensorFlow ops, similar to the lookup ops available in core TensorFlow. The ops allow adding, reading, and removing batches of Tensor data efficiently.
+
+Sampling Data We also implemented ops for efficiently maintaining and sampling from a prioritized distribution over the keys, using the algorithm for proportional prioritization described in Schaul et al. (2016). The probability of sampling a transition is $p _ { k } ^ { \alpha } / \sum _ { k } \bar { p _ { k } ^ { \alpha } }$ where $p _ { k }$ is the priority of the transition with key $k$ . The exponent $\alpha$ controls the amount of prioritization, and when $\alpha = 0$ uniform sampling is recovered. The proportional variant sets priority $p _ { k } \ = \ | \delta _ { k } |$ where $\delta _ { k }$ is the TD error for transition $k$ . Whenever a batch of data is added to or removed from the store, or is processed by the learner, this distribution is correspondingly updated, recording any change to the set of valid keys and the priorities associated with them.
+
+A background thread on the learner fetches batches of sampled data from the remote replay and decompresses it using the learner’s CPU, in parallel with the gradients being computed on the GPU. The fetched data is buffered in a TensorFlow queue, so that the GPU always has data available to train on.
+
+Adding Data In order to efficiently construct $n$ -step transition data, each actor maintains a circular buffer of capacity $n$ containing tuples $( S _ { t } , A _ { t } , R _ { t : t + B } , \gamma _ { t : t + B } , q ( S _ { t } , * ) )$ , where $B$ is the current size of the buffer. With each step, the new data is appended and the accumulated per-step discounts $\gamma _ { t : t + B }$ and partial returns $R _ { t : t + B }$ for all entries in the buffer are updated. If the buffer has reached its capacity, $n$ , then its first element may be combined with the latest state $S _ { t + n }$ and value estimates $q ( S _ { t + n } )$ to produce a valid $n$ -step transition (with accompanying Q-values).
+
+However, instead of being directly added to the remote replay memory on each step, the constructed transitions $( S _ { t } , A _ { t } , R _ { t : t + B } , \gamma _ { t : t + B } , S _ { t + n } , q ( S _ { t } , * ) , q ( S _ { t + n } , * ) )$ are first stored in a local TensorFlow queue, in order to reduce the number of requests to the replay server. The queue is periodically flushed, at which stage the absolute $n$ -step TD-errors (and thus the initial priorities) for the queued transitions are computed in batch, using the buffered Q-values to avoid recomputation. The Q-value estimates from which the initial priorities are derived are therefore based on the actor’s copy of the network parameters at the time the corresponding state was obtained from the environment, rather than the latest version on the learner. These $\mathbf { Q }$ -values need not be stored after this, since the learner does not require them, although they can be helpful for debugging.
+
+A unique key is assigned to each transition, which records which actor and environment step it came from, and the dequeued transition tuples are stored in the remote replay memory. As mentioned in the previous section, the remote sampling distribution is immediately updated with the newly added keys and the corresponding initial priorities computed by the actor. Note that, since we store both the start and the end state with each transition, we are storing some data twice: this costs more RAM, but simplifies the code.
+
+Contention It is important that the replay server be able to handle all requests in a timely fashion, in order to avoid slowing down the whole system. Possible bottlenecks include CPU, network bandwidth, and any locks protecting the shared data. In our experiments we found CPU to be the main bottleneck, but this was resolved by ensuring all requests and responses use sufficiently large batches. Nonetheless, it is advisable to consider all of these potential performance concerns when designing such systems.
+
+Asynchronicity In our framework, since acting and learning proceed with no synchronization, and performance depends on both, it can be misleading to consider performance with reference to only one of these. For example, the results after a given total number of environment frames have been experienced are highly dependent on the number of updates the learner has performed in that time. For this reason it is important to monitor and report the speeds of all parts of the system and to consider them when analyzing results.
+
+Failure Tolerance In distributed systems with many workers, it is inevitable that interruptions or failures will occur, either due to occasional hardware issues or because shared resources are needed by higher priority jobs. All stateful parts of the system therefore must periodically save their work and be able to resume where they left off when restarted. In our system, actors may be interrupted at any time and this will not prevent continued learning, albeit with a temporarily reduced rate of new data entering the replay memory. If the replay server is interrupted, the data it contains is discarded, and upon resuming, the memory is refilled quickly by the actors. In this event, to avoid overfitting, the learner will pause training briefly, until the minimum amount of data has once again been accumulated. If the learner is interrupted, progress will stall until it resumes.
+
+
+Figure 9: Training curves for 57 Atari games (performance against wall clock time). Green: DQN baseline. Purple: Rainbow baseline. Orange: A3C baseline. Blue: Ape-X DQN with 360 actors, 1 replay server and 1 Tesla P100 GPU learner. The anomaly in Riverraid is due to an infrastructure error.
+
+
+Figure 10: Training curves for 57 Atari games (performance against environment frames). Only the first billion frames are shown, corresponding to 5-6 hours of training for Ape-X. Green: DQN baseline. Purple: Rainbow baseline. Blue: ApeX-DQN with 360 actors, 1 replay server and 1 Tesla P100 GPU learner.
+
+
+Figure 11: Speed of data generation scales linearly with the number of actors.
+
+
+Figure 12: Training curves showing performance against wall clock time for various numbers of actors on a selection of Atari games. Blue: prioritized replay, with learning rate $0 . 0 0 0 2 5 \mid 4$ . Red: uniform replay, with learning rate 0.00025. For both prioritized and uniform, we tried both of these learning rates and selected the best. Both variants benefit from larger numbers of actors, but prioritized can better take advantage of the increased amount of data. In the 256-actor run, prioritized is equal or better in 7 of 9 games.
+
+
Game
No-op starts
Human starts
40,804.9
17,731.5
alien
1,047.3
amidar
8,659.2
assault
24,559.4
24,404.6
asterix
313,305.0
283,179.5
asteroids
155,495.1
117,303.4
atlantis
944,497.5
918,714.5
bank_heist battle_zone
1,716.4
1,200.8
beam_rider
98,895.0
92,275.0
berzerk
63,305.2 57,196.7
72,233.7 55,598.9
bowling
17.6
30.2
boxing
100.0
80.9
breakout
800.9
756.5
centipede
12,974.0
5,711.6
chopper_command
721,851.0
576,601.5
crazy_climber
320,426.0
263,953.5
defender
411,943.5
399,865.3
demon_attack
133,086.4
133,002.1
double_dunk
23.5
22.3
enduro
2,177.4
2,042.4
fishing_derby
44.4
22.4
freeway
33.7
29.0
frostbite
9,328.6
6,511.5
gopher
120,500.9
121,168.2
gravitar
1,598.5
662.0
hero
31,655.9
26,345.3
ice_hockey
33.0
24.0
jamesbond
21,322.5
18,992.3
kangaroo
1,416.0
577.5
krull
11,741.4
8,592.0
kung_fu_master
97,829.5
72,068.0
montezuma_revenge
2,500.0
1,079.0
ms_pacman
11,255.2
6,135.4
name_this-game
25,783.3
23,829.9
phoenix
224,491.1
188,788.5
pitfall
-0.6
-273.3
pong
20.9
18.7
private_eye
49.8
864.7
qbert
302,391.3
380,152.1
riverraid
63,864.4
road_runner
222,234.5
49,982.8
robotank
73.8
127,111.5
seaquest
392,952.3
68.5
skiing
-10,789.9
377,179.8
solaris
2,892.9
-11,359.3
space_invaders
3,115.9
54,681.0
50,699.3
star_gunner
434,342.5
432,958.0
surround
7.1
5.5
tennis
23.9
23.0
time_pilot
87,085.0
71,543.0
tutankham
272.6
127.7
up_n_down
401,884.3
347,912.2
venture
1,813.0
935.5
video_pinball
565,163.2
873,988.5
wizard_of_wor
46,204.0
46,897.0
yars_revenge zaxxon
148,594.8 42,285.5
131,701.1 37,672.0
+
+Table 2: Scores obtained by Ape-X DQN in final evaluation, under the standard no-op starts and human starts regimes. In some games the scores are higher than in the training curves: this is because the maximum episode length is shorter during training. 19
\ No newline at end of file
diff --git a/md/train/H1W1UN9gg/H1W1UN9gg.md b/md/train/H1W1UN9gg/H1W1UN9gg.md
new file mode 100644
index 0000000000000000000000000000000000000000..0fff5f4511157b1344ce3ee5c33a59f2a7d478d1
--- /dev/null
+++ b/md/train/H1W1UN9gg/H1W1UN9gg.md
@@ -0,0 +1,547 @@
+# DEEP INFORMATION PROPAGATION
+
+Samuel S. Schoenholz∗ Google Brain
+
+Justin Gilmer∗ Google Brain
+
+Surya Ganguli Stanford University
+
+Jascha Sohl-Dickstein Google Brain
+
+# ABSTRACT
+
+We study the behavior of untrained neural networks whose weights and biases are randomly distributed using mean field theory. We show the existence of depth scales that naturally limit the maximum depth of signal propagation through these random networks. Our main practical result is to show that random networks may be trained precisely when information can travel through them. Thus, the depth scales that we identify provide bounds on how deep a network may be trained for a specific choice of hyperparameters. As a corollary to this, we argue that in networks at the edge of chaos, one of these depth scales diverges. Thus arbitrarily deep networks may be trained only sufficiently close to criticality. We show that the presence of dropout destroys the order-to-chaos critical point and therefore strongly limits the maximum trainable depth for random networks. Finally, we develop a mean field theory for backpropagation and we show that the ordered and chaotic phases correspond to regions of vanishing and exploding gradient respectively.
+
+# 1 INTRODUCTION
+
+Deep neural network architectures have become ubiquitous in machine learning. The success of deep networks is due to the fact that they are highly expressive (Montufar et al., 2014) while simultaneously being relatively easy to optimize (Choromanska et al., 2015; Goodfellow et al., 2014) with strong generalization properties (Recht et al., 2015). Consequently, developments in machine learning often accompany improvements in our ability to train increasingly deep networks. Despite this, designing novel network architectures is frequently equal parts art and science. This is, in part, because a general theory for neural networks that might inform design decisions has lagged behind the feverish pace of design.
+
+A pair of recent papers (Poole et al., 2016; Raghu et al., 2016) demonstrated that random neural networks are exponentially expressive in their depth. Central to their approach was the consideration of networks after random initialization, whose weights and biases were i.i.d. Gaussian distributed. In particular the paper by Poole et al. (2016) developed a “mean field” formalism for treating wide, untrained, neural networks. They showed that these mean field networks exhibit an order-to-chaos transition as a function of the weight and bias variances. Notably the mean field formalism is not closely tied to a specific choice of activation function or loss.
+
+In this paper, we demonstrate the existence of several characteristic “depth” scales that emerge naturally and control signal propagation in these random networks. We then show that one of these depth scales, $\xi _ { c }$ , diverges at the boundary between order and chaos. This result is insensitive to many architectural decisions (such as choice of activation function) and will generically be true at any order-to-chaos transition. We then extend these results to include dropout and we show that even small amounts of dropout destroys the order-to-chaos critical point and consequently removes the divergence in $\xi _ { c }$ . Together these results bound the depth to which signal may propagate through random neural networks.
+
+We then develop a corresponding mean field model for gradients and we show that a duality exists between the forward propagation of signals and the backpropagation of gradients. The ordered and chaotic phases that Poole et al. (2016) identified correspond to regions of vanishing and exploding gradients, respectively. We demonstrate the validity of this mean field theory by computing gradients of random networks on MNIST. This provides a formal explanation of the ‘vanishing gradients’ phenomenon that has long been observed in neural networks (Bengio et al., 1993). We continue to show that the covariance between two gradients is controlled by the same depth scale that limits correlated signal propagation in the forward direction.
+
+Finally, we hypothesize that a necessary condition for a random neural network to be trainable is that information should be able to pass through it. Thus, the depth-scales identified here bound the set of hyperparameters that will lead to successful training. To test this ansatz we train ensembles of deep, fully connected, feed-forward neural networks of varying depth on MNIST and CIFAR10, with and without dropout. Our results confirm that neural networks are trainable precisely when their depth is not much larger than $\xi _ { c }$ . This result is dataset independent and is, therefore, a universal function of network architecture.
+
+A corollary of these result is that asymptotically deep neural networks should be trainable provided they are initialized sufficiently close to the order-to-chaos transition. The notion of “edge of chaos” initialization has been explored previously. Such investigations have been both direct as in Bertschinger et al. (2005); Glorot & Bengio (2010) or indirect, through initialization schemes that favor deep signal propagation such as batch normalization (Ioffe & Szegedy, 2015), orthogonal matrix initialization (Saxe et al., 2014), random walk initialization (Sussillo & Abbott, 2014), composition kernels (Daniely et al., 2016), or residual network architectures (He et al., 2015). The novelty of the work presented here is two-fold. First, our framework predicts the depth at which networks may be trained even far from the order-to-chaos transition. While a skeptic might ask when it would be profitable to initialize a network far from criticality, we respond by noting that there are architectures (such as neural networks with dropout) where no critical point exists and so this more general framework is needed. Second, our work provides a formal, as opposed to intuitive, explanation for why very deep networks can only be trained near the edge of chaos.
+
+# 2 BACKGROUND
+
+We begin by recapitulating the mean-field formalism developed in Poole et al. (2016). Consider a fully-connected, untrained, feed-forward, neural network of depth $L$ with layer width $N _ { l }$ and some nonlinearity $\phi : \mathbb { R } \mathbb { R }$ . Since this is an untrained neural network we suppose that its weights and biases are respectively i.i.d. as $W _ { i j } ^ { l } \sim N ( 0 , \sigma _ { w } ^ { 2 } / N _ { l } )$ and $b _ { i } ^ { l } \sim N ( 0 , \sigma _ { b } ^ { 2 } )$ . Notationally we set $z _ { i } ^ { l }$ to be the pre-activations of the lth layer and $y _ { i } ^ { l + 1 }$ to be the activations of that layer. Finally, we take the input to the network to be $y _ { i } ^ { 0 } = x _ { i }$ . The propagation of a signal through the network is described by the pair of equations,
+
+$$
+z _ { i } ^ { l } = \sum _ { j } W _ { i j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l } ~ y _ { i } ^ { l + 1 } = \phi ( z _ { i } ^ { l } ) .
+$$
+
+Since the weights and biases are randomly distributed, these equations define a probability distribution on the activations and pre-activations over an ensemble of untrained neural networks. The “mean-field” approximation is then to replace $z _ { i } ^ { l }$ by a Gaussian whose first two moments match those of $z _ { i } ^ { l }$ . For the remainder of the paper we will take the mean field approximation as given.
+
+Consider first the evolution of a single input, $x _ { i ; a }$ , as it evolves through the network (as quantified by $y _ { i ; a } ^ { l }$ and $z _ { i ; a } ^ { l } )$ . Since the weights and biases are independent with zero mean, the first two moments of the pre-activations in the same layer will be,
+
+$$
+\mathbb { E } [ z _ { i ; a } ^ { l } ] = 0 \qquad \mathbb { E } [ z _ { i ; a } ^ { l } z _ { j ; a } ^ { l } ] = q _ { a a } ^ { l } \delta _ { i j }
+$$
+
+where $\delta _ { i j }$ is the Kronecker delta. Here $q _ { a a } ^ { l }$ is the variance of the pre-activations in the lth layer due to an input $x _ { i ; a }$ and it is described by the recursion relation,
+
+$$
+q _ { a a } ^ { l } = \sigma _ { w } ^ { 2 } \int { \mathcal { D } } z \phi ^ { 2 } \left( { \sqrt { q _ { a a } ^ { l - 1 } } } z \right) + \sigma _ { b } ^ { 2 }
+$$
+
+where $\textstyle \int { \mathcal { D } } z = { \frac { 1 } { \sqrt { 2 \pi } } } \int d z e ^ { - { \frac { 1 } { 2 } } z ^ { 2 } }$ is the measure for a standard Gaussian distribution. Together these equations completely describe the evolution of a single input through a mean field neural network. For any choice of $\sigma _ { w } ^ { 2 }$ and $\sigma _ { b } ^ { 2 }$ with bounded $\phi$ , eq. 3 has a fixed point at $q ^ { * } = \operatorname* { l i m } _ { l \to \infty } q _ { a a } ^ { l }$ .
+
+The propagation of a pair of signals, $x _ { i ; a } ^ { 0 }$ and $x _ { i ; b } ^ { 0 }$ , through this network can be understood similarly. Here the mean pre-activations are trivially the same as in the single-input case. The independence
+
+of the weights and biases implies that the covariance between different pre-activations in the same layer will be given by, $\mathbb { E } [ z _ { i ; a } ^ { l } z _ { j ; b } ^ { l } ] = q _ { a b } ^ { l } \delta _ { i j }$ . The covariance, $q _ { a b } ^ { l }$ , will be given by the recurrence relation,
+
+$$
+q _ { a b } ^ { l } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( u _ { 1 } ) \phi ( u _ { 2 } ) + \sigma _ { b } ^ { 2 }
+$$
+
+where $u _ { 1 } = \sqrt { q _ { a a } ^ { l - 1 } } z _ { 1 }$ and $u _ { 2 } = \sqrt { q _ { b b } ^ { l - 1 } } \left( c _ { a b } ^ { l - 1 } z _ { 1 } + \sqrt { 1 - ( c _ { a b } ^ { l - 1 } ) ^ { 2 } } z _ { 2 } \right)$ , with $c _ { a b } ^ { l } = q _ { a b } ^ { l } / \sqrt { q _ { a a } ^ { l } q _ { b b } ^ { l } }$ are Gaussian approximations to the pre-activations in the preceding layer with the correct covariance matrix. Moreover $c _ { a b } ^ { l }$ is the correlation between the two inputs after $l$ layers.
+
+
+Figure 1: Mean field criticality. (a) The mean field phase diagram showing the boundary between ordered and chaotic phases as a function of $\sigma _ { w } ^ { 2 }$ and $\sigma _ { b } ^ { 2 }$ . (b) The residual $| \boldsymbol { q } ^ { * } - \boldsymbol { q } _ { a a } ^ { l } |$ as a function of depth on a log-scale with $\sigma _ { b } ^ { 2 } = 0 . 0 5$ and $\sigma _ { w } ^ { 2 }$ from 0.01 (red) to 1.7 (purple). Clear exponential behavior is observed. (c) The residual $| c ^ { * } - c _ { a b } ^ { l } |$ as a function of depth on a log-scale. Again, the exponential behavior is clear. The same color scheme is used here as in (b).
+
+Examining eq. 4 it is clear that $c ^ { * } = 1$ is a fixed point of the recurrence relation. To determine whether or not the $c ^ { * } = 1$ is an attractive fixed point the quantity,
+
+$$
+\chi _ { 1 } = \frac { \partial c _ { a b } ^ { l } } { \partial c _ { a b } ^ { l - 1 } } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) \right] ^ { 2 }
+$$
+
+is introduced. Poole et al. (2016) note that the $c ^ { * } = 1$ fixed point is stable if $\chi _ { 1 } < 1$ and is unstable otherwise. Thus, $\chi _ { 1 } = 1$ represents a critical line separating an ordered phase (in which $c ^ { * } = 1$ and all inputs end up asymptotically correlated) and a chaotic phase (in which $c ^ { * } < 1$ and all inputs end up asymptotically decorrelated). For the case of $\phi = \operatorname { t a n h }$ , the phase diagram in fig. 1 (a) is observed.
+
+# 3 ASYMPTOTIC EXPANSIONS AND DEPTH SCALES
+
+Our first contribution is to demonstrate the existence of two depth-scales that arise naturally within the framework of mean field neural networks. Motivating the existence of these depth-scales, we iterate eq. 3 and 4 until convergence for many values of $\sigma _ { w } ^ { 2 }$ between 0.1 and 3.0 and with $\sigma _ { b } ^ { 2 } = 0 . 0 5$ starting with $q _ { a a } ^ { 0 } = q _ { b b } ^ { 0 } = 0 . \mathbf { \bar { 8 } }$ and $c _ { a b } ^ { 0 } = 0 . 6$ . We see, in fig. 1 (b) and (c), that the manner in which both $q _ { a a } ^ { l }$ approaches $q ^ { * }$ and $c _ { a b } ^ { l }$ approaches $c ^ { * }$ is exponential over many orders of magnitude. We therefore anticipate that asymptotically $| q _ { a a } ^ { l } - q ^ { * } | \sim e ^ { - l / \xi _ { q } }$ and $| c _ { a b } ^ { l } - c ^ { * } | \sim e ^ { - l / \xi _ { c } }$ for sufficiently large $l$ . Here, $\xi _ { q }$ and $\xi _ { c }$ define depth-scales over which information may propagate about the magnitude of a single input and the correlation between two inputs respectively.
+
+We will presently prove that $q _ { a a } ^ { l }$ and $c _ { a b } ^ { l }$ are asymptotically exponential. In both cases we will use the same fundamental strategy wherein we expand one of the recurrence relations (either eq. 3 or eq. 4) about its fixed point to get an approximate “asymptotic” recurrence relation. We find that this asymptotic recurrence relation in turn implies exponential decay towards the fixed point over a depth-scale, $\xi _ { x }$ .
+
+We first analyze eq. 3 and identify a depth-scale at which information about a single input may propagate. Let $q _ { a a } ^ { l } = q ^ { * } + \epsilon ^ { l }$ . By construction so long as $\begin{array} { r } { \operatorname* { l i m } _ { l \to \infty } q _ { a a } ^ { l } = q ^ { * } } \end{array}$ exists it follows that $\epsilon ^ { l } 0$ as $l \infty$ . Eq. 3 may be expanded to lowest order in $\epsilon ^ { l }$ to arrive at an asymptotic recurrence relation (see Appendix 7.1),
+
+$$
+\epsilon ^ { l + 1 } = \epsilon ^ { l } \left[ \chi _ { 1 } + \sigma _ { w } ^ { 2 } \int { \mathcal { D } } z \phi ^ { \prime \prime } \left( { \sqrt { q ^ { * } } } z \right) \phi \left( { \sqrt { q ^ { * } } } z \right) \right] + { \mathcal { O } } \left( ( \epsilon ^ { l } ) ^ { 2 } \right) .
+$$
+
+Notably, the term multiplying $\epsilon ^ { l }$ is a constant. It follows that for large $l$ the asymptotic recurrence relation has an exponential solution, $\epsilon ^ { l } \sim e ^ { - l / \xi _ { q } }$ , with $\xi _ { q }$ given by
+
+$$
+\xi _ { q } ^ { - 1 } = - \log \left[ \chi _ { 1 } + \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { \prime \prime } \left( \sqrt { q ^ { * } } z \right) \phi \left( \sqrt { q ^ { * } } z \right) \right] .
+$$
+
+This establishes $\xi _ { q }$ as a depth scale that controls how deep information from a single input may penetrate into a random neural network.
+
+Next, we consider eq. 4. Using a similar argument (detailed in Appendix 7.2) we can expand about $c _ { a b } ^ { l } = c ^ { * } + \epsilon ^ { l }$ to find an asymptotic recurrence relation,
+
+$$
+\epsilon ^ { l + 1 } = \epsilon ^ { l } \left[ \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ^ { * } ) \phi ^ { \prime } ( u _ { 2 } ^ { * } ) \right] + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) .
+$$
+
+Here $u _ { 1 } ^ { * } = \sqrt { q ^ { * } } z _ { 1 }$ and $u _ { 2 } ^ { * } = \sqrt { q ^ { * } } ( c ^ { * } z _ { 1 } + \sqrt { 1 - ( c ^ { * } ) ^ { 2 } } z _ { 2 } )$ . Thus, once again, we expect that for large $l$ this recurrence will have an exponential solution, $\epsilon ^ { l } \sim e ^ { - l / \xi _ { c } }$ , with $\xi _ { c }$ given by
+
+$$
+\xi _ { c } ^ { - 1 } = - \log \left[ \sigma _ { w } ^ { 2 } \int { \mathcal D } z _ { 1 } { \mathcal D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ^ { * } ) \phi ^ { \prime } ( u _ { 2 } ^ { * } ) \right] .
+$$
+
+In the ordered phase $c ^ { * } = 1$ and so $\xi _ { c } ^ { - 1 } = - \log \chi _ { 1 }$ . Since the transition between order and chaos occurs when $\chi _ { 1 } = 1$ it follows that $\xi _ { c }$ diverges at any order-to-chaos transition so long as $q ^ { * }$ and $c ^ { * }$ exist.
+
+
+Figure 2: Depth scales. (a) The iterative correlation map showing $c _ { a b } ^ { l + 1 }$ as a function of $c _ { a b } ^ { l }$ for three different values of $\sigma _ { w } ^ { 2 }$ . Green inset lines show the linearization of the iterative map about the critical point, $e ^ { - 1 / \xi _ { c } }$ . The three curves show networks far in the ordered regime (red), at the edge of chaos (purple), and deep in the chaotic regime (blue). (b) The depth scale for information propagated in a single input, $\xi _ { q }$ as a function of $\sigma _ { w } ^ { 2 }$ for $\sigma _ { b } ^ { 2 } = 0 . 0 1$ (black) to $\sigma _ { b } ^ { 2 } = 0 . 3$ (green). Dashed lines show theoretical predictions while solid lines show measurements. (c) The depth scale for correlations between inputs, $\xi _ { c }$ for the same values of $\sigma _ { b } ^ { 2 }$ . Again dashed lines are the theoretical predictions while solid lines show measurements. Here a clear divergence is observed at the order-to-chaos transition.
+
+These results can be investigated intuitively by plotting $c _ { a b } ^ { l + 1 }$ vs $c _ { a b } ^ { l }$ in fig. 2 (a). In the ordered phase there is only a single fixed point, $c _ { a b } ^ { l } = 1$ . In the chaotic regime we see that a second fixed point develops and the $c _ { a b } ^ { l } = 1$ point becomes unstable. We see that the linearization about the fixed points becomes significantly closer to the trivial map near the order-to-chaos transition.
+
+To test these claims we measure $\xi _ { q }$ and $\xi _ { c }$ directly by iterating the recurrence relations for $q _ { a a } ^ { l }$ and $c _ { a b } ^ { l }$ as before with $q _ { a a } ^ { 0 } = q _ { b b } ^ { 0 } = 0 . \bar { 8 }$ and $c _ { a b } ^ { 0 } = 0 . 6$ . In this case we consider values of $\sigma _ { w } ^ { 2 }$ between
+
+0.1 and 3.0 and $\sigma _ { b } ^ { 2 }$ between 0.01 and 0.3. For each hyperparameter settings we fit the resulting residuals, $| q _ { a a } ^ { l } - q ^ { * } |$ and $| c _ { a b } ^ { l } - c ^ { * } |$ , to exponential functions and infer the depth-scale. We then compare this measured depth-scale to that predicted by the asymptotic expansion. The result of this measurement is shown in fig. 2. In general we see that the agreement is quite good. As expected we see that $\xi _ { c }$ diverges at the critical point.
+
+As observed in Poole et al. (2016) we see that the depth scale for the propagation of information in a single input, $\xi _ { q }$ , is consistently finite and significantly shorter than $\xi _ { c }$ . To understand why this is the case consider eq. 6 and note that for tanh nonlinearities the second term is always negative. Thus, even as $\chi _ { 1 }$ approaches 1 we expect $\begin{array} { r } { \chi _ { 1 } + \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { \prime \prime } ( \sqrt { q ^ { * } } z ) \phi ( \sqrt { q ^ { * } } z ) } \end{array}$ to be substantially smaller than 1.
+
+# 3.1 DROPOUT
+
+The mean field formalism can be extended to include dropout. The main contribution here will be to argue that even infinitesimal amounts of dropout destroys the mean field critical point, and therefore limits the trainable network depth. In the presence of dropout the propagation equation, eq. 1, becomes,
+
+$$
+z _ { i } ^ { l } = \frac { 1 } { \rho } \sum _ { j } W _ { i j } ^ { l } p _ { j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l }
+$$
+
+where $p _ { j } \sim \mathrm { B e r n o u l l i } ( \rho )$ and $\rho$ is the dropout rate. As is typically the case we have re-scaled the sum by $\rho ^ { - 1 }$ so that the mean of the pre-activation is invariant with respect to our choice of dropout rate.
+
+Following a similar procedure to the original mean field calculation consider the fate of two inputs, x0i;a and $\mathbf { \bar { \Phi } } _ { x _ { i ; b } } ^ { 0 }$ , as they are propagated through such a random network. We take the dropout masks to be chosen independently for the two inputs mimicking the manner in which dropout is employed in practice. With dropout the diagonal term in the covariance matrix will be (see Appendix 7.3),
+
+$$
+\bar { q } _ { a a } ^ { l } = \frac { \sigma _ { w } ^ { 2 } } { \rho } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { \bar { q } _ { a a } ^ { l - 1 } } z \right) + \sigma _ { b } ^ { 2 } .
+$$
+
+The variance of a single input with dropout will therefore propagate in an identical fashion to the vanilla case with a re-scaling $\sigma _ { w } ^ { 2 } \to \sigma _ { w } ^ { 2 } / \rho$ . Intuitively, this result implies that, for the case of a single input, the presence of dropout simply increases the effective variance of the weights.
+
+Computing the off-diagonal term of the covariance matrix similarly (see Appendix 7.4),
+
+$$
+\bar { q } _ { a b } ^ { l } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( \bar { u } _ { 1 } ) \phi ( \bar { u } _ { 2 } ) + \sigma _ { b } ^ { 2 }
+$$
+
+with $\bar { u } _ { 1 } , \bar { u } _ { 2 }$ , and $\bar { c } _ { a b } ^ { l }$ defined by analogy to the mean field equations without dropout. Here, unlike in the case of a single input, the recurrence relation is identical to the recurrence relation without dropout. To see that $\bar { c } ^ { * } = 1$ is no longer a fixed point of these dynamics consider what happens to eq. 12 when we input $\bar { c } ^ { l } = 1$ . For simplicity, we leverage the short range of $\xi _ { q }$ to replace $\bar { q } _ { a a } ^ { l } = \bar { q } _ { b b } ^ { l } = \bar { q } ^ { * }$ . We find (see Appendix 7.5),
+
+$$
+\bar { c } _ { a b } ^ { l + 1 } = 1 - \frac { 1 - \rho } { \rho \bar { q } ^ { * } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { \bar { q } ^ { * } } z \right) .
+$$
+
+The s erm is positive for any $\rho < 1$ . This implies that if $\bar { c } _ { a b } ^ { l } = 1$ for any $l$ then $\bar { c } _ { a b } ^ { l + 1 } < 1$ . $c ^ { * } = 1$ is not a fixed point of eq. 12 for any . Since eq. 12 is identical in form to eq. 4 it follows that the depth scale for signal propagation with dropout will likewise be given by eq. 9 with the substitutions $q ^ { * } \to \bar { q } ^ { * }$ and $c ^ { * } \to \bar { c } ^ { * }$ computed using eq. 11 and eq. 12 respectively. Importantly, since there is no longer a sharp critical point with dropout we do not expect a diverging depth scale.
+
+As in networks without dropout we plot, in fig. 3 (a), the iterative map $\bar { c } _ { a b } ^ { l + 1 }$ as a function of $\bar { c } _ { a b } ^ { l }$ Most significantly, we see that the $\bar { c } _ { a b } ^ { l } = 1$ is no longer a fixed point of the dynamics. Instead, as the dropout rate increases $\bar { c } _ { a b } ^ { l }$ gets mapped to decreasing values and the fixed point monotonically decreases.
+
+
+Figure 3: Dropout destroys the critical point, and limits the depth to which information can propagate in a deep network. (a) The iterative correlation map showing $\bar { c } _ { a b } ^ { l + 1 }$ as a function of $\bar { c } _ { a b } ^ { l }$ for three different values of the dropout rate $\rho$ for networks tuned close to their critical point. Green inset lines show the linearization of the iterative map about the critical point, $e ^ { - 1 / \xi _ { c } }$ . (b) The asymptotic value of the correlation map, $c ^ { * }$ , as a function of $\sigma _ { w } ^ { 2 }$ for different values of dropout from $\rho = 1$ (black) to $\rho = 0 . 8$ (blue). We see that for all values of dropout except for $\rho = 1$ , $c ^ { * }$ does not show a sharp transition between an ordered phase and a chaotic phase. (c) The correlation depth scale $\xi _ { c }$ as a function of $\sigma _ { w } ^ { 2 }$ for the same values of dropout as in (b). We see here that for all values of $\rho$ except for $\rho = 1$ there is no divergence in $\xi _ { c }$ .
+
+To test these results we plot in fig. 3 (b) the asymptotic correlation, $c ^ { * }$ , as a function of $\sigma _ { w } ^ { 2 }$ for different values of dropout from $\rho = 0 . 8$ to $\rho = 1 . 0$ . As expected, we see that for all $\rho < 1$ there is no sharp transition between $c ^ { * } = 1$ and $c ^ { * } < 1$ . Moreover as the dropout rate increases the correlation $c ^ { * }$ monotonically decreases. Intuitively this makes sense. Identical inputs passed through two different dropout masks will become increasingly dissimilar as the dropout rate increases. In fig. 3 (c) we show the depth scale, $\xi _ { c }$ , as a function of $\sigma _ { w } ^ { 2 }$ for the same range of dropout probabilities. We find that, as predicted, the depth of signal propagation with dropout is drastically reduced and, importantly, there is no longer a divergence in $\xi _ { c }$ . Increasing the dropout rate continues to decrease the correlation depth for constant $\sigma _ { w } ^ { 2 }$ .
+
+# 4 GRADIENT BACKPROPAGATION
+
+There is a duality between the forward propagation of signals and the backpropagation of gradients. To elucidate this connection consider the backpropagation equations given a loss $E$ ,
+
+$$
+\frac { \partial E } { \partial W _ { i j } ^ { l } } = \delta ^ { l } _ { i } \phi ( z _ { j } ^ { l - 1 } ) \qquad \quad \delta _ { i } ^ { l } = \phi ^ { \prime } ( z _ { i } ^ { l } ) \sum _ { j } \delta _ { j } ^ { l + 1 } W _ { j i } ^ { l + 1 }
+$$
+
+with the identification $\delta _ { i } ^ { l } = \partial E / \partial z _ { i } ^ { l }$ . Within mean field theory, it is clear that the scale of fluctuations of the gradient of weights in a layer will be proportional to $\mathbb { E } [ ( \delta _ { i } ^ { l } ) ^ { 2 } ]$ (see appendix 7.6). In contrast to the pre-activations in forward propagation (eq. 1), the $\delta _ { i } ^ { l }$ will typically not be Gaussian distributed even in the large layer width limit.
+
+Nonetheless, we can work out a recurrence relation for the variance of the error, $\tilde { q } _ { a a } ^ { \ l } = \mathbb { E } [ ( \delta _ { i } ^ { l } ) ^ { 2 } ]$ , leveraging the Gaussian ansatz on the pre-activations. In order to do this, however, we must first make an additional approximation that the weights used during forward propagation are drawn independently from the weights used in backpropagation. This approximation is similar in spirit to the vanilla mean field approximation and is reminiscent of work on feedback alignment (Lillicrap et al., 2014). With this in mind we arrive at the recurrence (see appendix 7.7),
+
+$$
+\tilde { q } _ { a a } ^ { l } = \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l } } \chi _ { 1 } .
+$$
+
+The presence of $\chi _ { 1 }$ in the above equation should perhaps not be surprising. In Poole et al. (2016) they show that $\chi _ { 1 }$ is intimately related to the tangent space of a given layer in mean field neural networks. We note that the backpropagation recurrence features an explicit dependence on the ratio of widths of adjacent layers of the network, $N _ { l + 1 } / N _ { l }$ . Here we will consider exclusively constant width networks where this factor is unity. For a discussion of the case of unequal layer widths see Glorot & Bengio (2010).
+
+Since $\chi _ { 1 }$ depends only on the asymptotic $q ^ { * }$ it follows that for constant width networks we expect eq. 15 to again have an exponential solution with,
+
+$$
+\begin{array} { r } { \tilde { q } _ { a a } ^ { l } = \tilde { q } _ { a a } ^ { L } e ^ { - ( L - l ) / \xi } \nabla \qquad \xi _ { \nabla } ^ { - 1 } = - \log \chi _ { 1 } . } \end{array}
+$$
+
+Note that here $\xi _ { \nabla } ^ { - 1 } = - \log \chi _ { 1 }$ both above and below the transition. It follows that $\xi _ { \nabla }$ can be both positive and negative. We conclude that there should be three distinct regimes for the gradients.
+
+1. In the ordered phase, $\chi _ { 1 } < 1$ and so $\xi _ { \nabla } > 0$ . We therefore expect gradients to vanish over a depth $| \xi _ { \nabla } |$ .
+2. At criticality, $\chi _ { 1 } 1$ and so $\xi _ { \nabla } \infty$ . Here gradients should be stable regardless of depth.
+3. In the chaotic phase, $\chi _ { 1 } > 1$ and so $\xi _ { \nabla } < 0$ . It follows that in this regime gradients should explode over a depth $| \xi _ { \nabla } |$ .
+
+Intuitively these three regimes make sense. To see this, recall that perturbations to a weight in layer $l$ can alternatively be viewed as perturbations to the pre-activations in the same layer. In the ordered phase both the perturbed signal and the unperturbed signal will be asymptotically mapped to the same point and the derivative will be small. In the chaotic phase the perturbed and unperturbed signals will become asymptotically decorrelated and the gradient will be large.
+
+
+Figure 4: Gradient backpropagation behaves similarly to signal forward propagation. (a) The 2- norm, $| | \nabla _ { W _ { a b } ^ { l } } E | | _ { 2 } ^ { 2 }$ as a function of layer, $l$ , for a 240 layer random network with a cross-entropy loss on MNIST. Different values of $\sigma _ { w } ^ { 2 }$ from 1.0 (blue) to 4.0 (red) are shown. Clear exponential vanishing $/$ explosion is observed over many orders of magnitude. (b) The depth scale for gradients predicted by theory (dashed line) compared with measurements from experiment (red dots). Similarity between theory and experiment is clear. Deviations near the critical point are primarily due to finite size effects.
+
+To investigate these predictions we construct deep random networks of depth $L = 2 4 0$ and layerwidth $N _ { l } = 3 0 0$ . We then consider the cross-entropy loss of these networks on MNIST. In fig. 4 (a) we plot the layer-by-layer 2-norm of the gradient, $| | \nabla _ { W _ { a b } ^ { l } } E | | _ { 2 } ^ { 2 }$ , as a function of layer, $l$ , for different values of $\sigma _ { w } ^ { 2 }$ . We see that $| | \nabla _ { W _ { a b } ^ { l } } E | | _ { 2 } ^ { 2 }$ behaves exponentially over many orders of magnitude. Moreover, we see that the gradient vanishes in the ordered phase and explodes in the chaotic phase. We test the quantitative predictions of eq. 16 in fig. 4 (b) where we compare $| \xi _ { \nabla } |$ as predicted from theory with the measured depth-scale constructed from exponential fits to the gradient data. Here we see good quantitative agreement between the theoretical predictions from mean field random networks and experimentally realized networks. Together these results suggest that the approximations on the backpropagation equations were representative of deep, wide, random networks.
+
+Finally, we show that the depth scale for correlated signal propagation likewise controls the depth at which information stored in the covariance between gradients can survive. The existence of consistent gradients across similar samples from a training set ought to be especially important for determining whether or not a given neural network architecture can be trained. To establish this depth-scale first note (see Appendix 7.8) that the covariance between gradients of two different inputs, $x _ { i ; 1 }$ and $x _ { i ; 2 }$ , will be proportional to $( \nabla _ { W _ { i j } ^ { l } } E _ { a } ) \cdot ( \nabla _ { W _ { i j } ^ { l } } E _ { b } ) \sim \mathbb { E } [ \breve { \delta } _ { i ; a } ^ { l } \delta _ { i ; b } ^ { l } ] = \tilde { q } _ { a b } ^ { l }$ where $E _ { a }$ is the loss evaluated on $x _ { i ; a }$ and $\delta _ { i ; a } = \partial E _ { a } / \partial z _ { i ; a } ^ { l }$ are appropriately defined errors.
+
+It can be shown (see Appendix 7.9) that $\tilde { q } _ { a b } ^ { \ l }$ features the recurrence relation,
+
+$$
+\tilde { q } _ { a b } ^ { l } = \tilde { q } _ { a b } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ) \phi ^ { \prime } ( u _ { 2 } )
+$$
+
+where $u _ { 1 }$ and $u _ { 2 }$ are defined similarly as for the forward pass. Expanding asymptotically it is clear that to zeroth order in $\epsilon ^ { l }$ , $\tilde { q } _ { a b } ^ { l }$ will have an exponential solution with $\tilde { q } _ { a b } ^ { l } = \tilde { q } _ { a b } ^ { \perp } e ^ { - } ( L - l ) / \xi _ { c }$ with $\xi _ { c }$ as defined in the forward pass.
+
+# 5 EXPERIMENTAL RESULTS
+
+Taken together, the results of this paper lead us to the following hypothesis: a necessary condition for a random network to be trained is that information about the inputs should be able to propagate forward through the network, and information about the gradients should be able to propagate backwards through the network. The preceding analysis shows that networks will have this property precisely when the network depth, $L$ , is not much larger than the depth-scale $\xi _ { c }$ . This criterion is data independent and therefore offers a “universal” constraint on the hyperparameters that depends on network architecture alone. We now explore this relationship between depth of signal propagation and network trainability empirically.
+
+
+Figure 5: Mean field depth scales control trainable hyperparameters. The training accuracy for neural networks as a function of their depth and initial weight variance, $\sigma _ { w } ^ { 2 }$ from a high accuracy (red) to low accuracy (black). In (a) we plot the training accuracy after 200 training steps on MNIST using SGD. Here overlayed in grey dashed lines are different multiples of the depth scale for correlated signal propagation, $n \xi _ { c }$ . We plot the accuracy in (b) after 2000 training steps on CIFAR10 using SGD, in (c) after 14000 training steps on MNIST using SGD, and in (d) after 300 training steps on MNIST using RMSPROP. Here we overlay in white dashed lines $6 \xi _ { c }$ .
+
+To investigate this prediction, we consider random networks of depth $1 0 \leq L \leq 3 0 0$ and $1 \leq \sigma _ { w } ^ { 2 } \leq$ 4 with $\sigma _ { b } ^ { 2 } = 0 . 0 5$ . We train these networks using Stochastic Gradient Descent (SGD) and RMSProp on MNIST and CIFAR10. We use a learning rate of $1 0 ^ { - 3 }$ for SGD when $L \lesssim 2 0 0 , 1 0 ^ { - 4 }$ for larger $L$ , and $1 0 ^ { - 5 }$ for RMSProp. These learning rates were selected by grid search between $1 0 ^ { - 6 }$ and $1 0 ^ { - 2 }$ in exponentially spaced steps of size 10. We note that the depth dependence of learning rate was explored in detail in Saxe et al. (2014). In fig. 5 (a)-(d) we color in red the training accuracy that neural networks achieved as a function of $\sigma _ { w } ^ { 2 }$ and $L$ for different datasets, training time, and choice of minimizer (see Appendix 7.10 for more comparisons). In all cases the neural networks over-fit the data to give a training accuracy of $1 0 0 \%$ and test accuracies of $9 8 \%$ on MNIST and $5 5 \%$ on CIFAR10. We emphasize that the purpose of this study is to demonstrate trainability as opposed to optimizing test accuracy.
+
+We now make the connection between the depth scale, $\xi _ { c }$ , and the maximum trainable depth more precise. Given the arguments in the preceding sections we note that if $L = n \xi _ { c }$ then signal through the network will be attenuated by a factor of $e ^ { n }$ . To understand how much signal can be lost while still allowing for training, we overlay in fig. 5 (a) curves corresponding to $n \xi _ { c }$ from $n = 1$ to 6. We find that networks appear to be trainable when $L \lesssim 6 \xi _ { c }$ . It would be interesting to understand why this is the case.
+
+Motivated by this argument in fig. 5 (b)-(d) in white, dashed, overlay we plot twice the predicted depth scale, $6 \xi _ { c }$ . There is clearly a relationship between the depth of correlated signal propagation and whether or not these networks are trainable. Networks closer to their critical point appear to train more quickly than those further away. Moreover, this relationship has no obvious dependence on dataset, duration of training, or minimizer. We therefore conclude that these bounds on trainable hyperparameters are universal. This in turn implies that to train increasingly deep networks, one must generically be ever closer to criticality.
+
+
+Figure 6: The effect of dropout on trainability. The same scheme as in fig. 5 but with dropout rates of (a) $\rho = 0 . 9 9$ , (b) $\rho = 0 . 9 8$ , and (c) $\rho = 0 . 9 4$ . Even for modest amounts of dropout we see an upper bound on the maximum trainable depth for neural networks. We continue to see good agreement between the prediction of our theory and our experimental training accuracy.
+
+Next we consider the effect of dropout. As we showed earlier, even infinitesimal amounts of dropout disrupt the order-to-chaos phase transition and cause the depth scale to become finite. However, since the effect of a single dropout mask is to simply re-scale the weight variance by $\sigma _ { w } ^ { 2 } \to \sigma _ { w } ^ { 2 } / \rho$ , the gradient magnitude will be stable near criticality, while the input and gradient correlations will not be. This therefore offers a unique opportunity to test whether the relevant depth-scale is $| 1 / \log \chi _ { 1 } |$ or $\xi _ { c }$ .
+
+In fig. 6 we repeat the same experimental setup as above on MNIST with dropout rates $\rho =$ 0.99, 0.98, and 0.94. We observe, first and foremost, that even extremely modest amounts of dropout limit the maximum trainable depth to about $L = 1 0 0$ . We additionally notice that the depth-scale, $\xi _ { c }$ , predicts the trainable region accurately for varying amounts of dropout.
+
+# 6 DISCUSSION
+
+In this paper we have elucidated the existence of several depth-scales that control signal propagation in random neural networks. Furthermore, we have shown that the degree to which a neural network can be trained depends crucially on its ability to propagate information about inputs and gradients through its full depth. At the transition between order and chaos, information stored in the correlation between inputs can propagate infinitely far through these random networks. This in turn implies that extremely deep neural networks may be trained sufficiently close to criticality. However, our contribution goes beyond advocating for hyperparameter selection that brings random networks to be nearly critical. Instead, we offer a general purpose framework that predicts, at the level of mean field theory, which hyperparameters should allow a network to be trained. This is especially relevant when analyzing schemes like dropout where there is no critical point and which therefore imply an upper bound on trainable network depth.
+
+An alternative perspective as to why information stored in the covariance between inputs is crucial for training can be understood by appealing to the correspondence between infinitely wide Bayesian neural networks and Gaussian Processes (Neal, 2012). In particular the covariance, $\dot { q } _ { a b } ^ { l }$ , is intimately related to the kernel of the induced Gaussian Process. It follows that cases in which signal stored in the covariance between inputs may propagate through the network correspond precisely to situations in which the associated Gaussian Process is well defined.
+
+Our work suggests that it may be fruitful to investigate pre-training schemes that attempt to perturb the weights of a neural network to favor information flow through the network. In principle this could be accomplished through a layer-by-layer local criterion for information flow or by selecting the mean and variance in schemes like batch normalization to maximize the covariance depth-scale.
+
+These results suggest that theoretical work on random neural networks can be used to inform practical architectural decisions. However, there is still much work to be done. For instance, the framework developed here does not apply to unbounded activations, such as rectified linear units, where it can be shown that there are phases in which eq. 3 does not have a fixed point. Additionally, the analysis here applies directly only to fully connected feed-forward networks, and will need to be extended to architectures with structured weight matrices such as convolutional networks.
+
+We close by noting that in physics it has long been known that, through renormalization, the behavior of systems near critical points can control their behavior even far from the idealized critical case. We therefore make the somewhat bold hypothesis that a broad class of neural network topologies will be controlled by the fully-connected mean field critical point.
+
+# ACKNOWLEDGMENTS
+
+We thank Ben Poole, Jeffrey Pennington, Maithra Raghu, and George Dahl for useful discussions. We are additionally grateful to RocketAI for introducing us to Temporally Recurrent Online Learning and two-dimensional time.
+
+# REFERENCES
+
+Y Bengio, Paolo Frasconi, and P Simard. The problem of learning long-term dependencies in recurrent networks. In Neural Networks, 1993., IEEE International Conference on, pp. 1183– 1188. IEEE, 1993.
+
+Nils Bertschinger, Thomas Natschlager, and Robert A. Legenstein. At the edge of chaos: Real-time ¨ computations and self-organized criticality in recurrent neural networks. In L. K. Saul, Y. Weiss, and L. Bottou (eds.), Advances in Neural Information Processing Systems 17, pp. 145–152. MIT Press, 2005.
+
+Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In AISTATS, 2015.
+
+A. Daniely, R. Frostig, and Y. Singer. Toward Deeper Understanding of Neural Networks: The Power of Initialization and a Dual View on Expressivity. arXiv:1602.05897, 2016.
+
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010.
+
+Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv:1412.6544, 2014.
+
+K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. ArXiv e-prints, December 2015.
+
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of The 32nd International Conference on Machine Learning, pp. 448–456, 2015.
+
+Timothy P Lillicrap, Daniel Cownden, Douglas B Tweed, and Colin J Akerman. Random feedback weights support learning in deep neural networks. arXiv:1411.0247, 2014.
+
+Guido F Montufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2924–2932. Curran Associates, Inc., 2014.
+
+Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
+
+B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein, and S. Ganguli. Exponential expressivity in deep neural networks through transient chaos. arXiv:1606.05340, June 2016.
+
+M. Raghu, B. Poole, J. Kleinberg, S. Ganguli, and J. Sohl-Dickstein. On the expressive power of deep neural networks. arXiv:1606.05336, June 2016.
+
+Benjamin Recht, Moritz Hardt, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. arXiv:1509.01240, 2015.
+
+A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. International Conference on Learning Representations, 2014.
+
+David Sussillo and LF Abbott. Random walks: Training very deep nonlinear feed-forward networks with smart initialization. CoRR, vol. abs/1412.6558, 2014.
+
+# 7 APPENDIX
+
+Here we present derivations of results from throughout the paper.
+
+# 7.1 SINGLE INPUT DEPTH-SCALE
+
+# Result:
+
+Consider the recurrence relation for the variance of a single input,
+
+$$
+q _ { a a } ^ { l } = \sigma _ { w } ^ { 2 } \int { \mathcal { D } } z \phi ^ { 2 } \left( { \sqrt { q _ { a a } ^ { l - 1 } } } z \right) + \sigma _ { b } ^ { 2 }
+$$
+
+and a fixed point of the dynamics, $q ^ { * }$ . $q _ { a a } ^ { l }$ can be expanded about the fixed point to yield the asymptotic recurrence relation,
+
+$$
+\epsilon ^ { l + 1 } = \epsilon ^ { l } \left[ \chi _ { 1 } + \sigma _ { w } ^ { 2 } \int { \mathcal { D } } z \phi ^ { \prime \prime } \left( { \sqrt { q ^ { * } } } z \right) \phi \left( { \sqrt { q ^ { * } } } z \right) \right] + { \mathcal { O } } \left( ( \epsilon ^ { l } ) ^ { 2 } \right) .
+$$
+
+# Derivation:
+
+We begin by first expanding to order $\epsilon ^ { l }$ ,
+
+$$
+\begin{array} { l } { \displaystyle q ^ { s } + \epsilon ^ { l + 1 } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi \left( \sqrt { q ^ { * } + \epsilon ^ { l } } z \right) \right] ^ { 2 } + \sigma _ { b } ^ { 2 } } \\ { \displaystyle \approx \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi \left( \sqrt { q ^ { * } } z + \frac { 1 } { 2 } \frac { \epsilon ^ { l } z } { \sqrt { q ^ { * } } } \right) \right] ^ { 2 } + \sigma _ { b } ^ { 2 } } \\ { \displaystyle \approx \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi \left( \sqrt { q ^ { * } } z \right) + \frac { 1 } { 2 } \frac { \epsilon ^ { l } z } { \sqrt { q ^ { * } } } \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) \right] ^ { 2 } + \sigma _ { b } ^ { 2 } + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) } \\ { \displaystyle \approx \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) + \sigma _ { b } ^ { 2 } + \epsilon ^ { l } \frac { \sigma _ { w } ^ { 2 } } { \sqrt { q ^ { * } } } \int \mathcal { D } z z \phi \left( \sqrt { q ^ { * } } z \right) \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) } \\ { \displaystyle \approx q ^ { * } + \epsilon ^ { l } \frac { \sigma _ { w } ^ { 2 } } { \sqrt { q ^ { * } } } \int \mathcal { D } z z \phi \big ( \sqrt { q ^ { * } } z \big ) \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) . } \end{array}
+$$
+
+We therefore arrive at the approximate reccurence relation,
+
+$$
+\epsilon ^ { l + 1 } = \epsilon ^ { l } \frac { \sigma _ { w } ^ { 2 } } { \sqrt { q ^ { * } } } \int \mathcal { D } z z \phi ( \sqrt { q ^ { * } } z ) \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) .
+$$
+
+Using the identity, $\begin{array} { r } { \int \mathcal { D } z z f ( z ) = \int \mathcal { D } z f ^ { \prime } ( z ) } \end{array}$ we can rewrite this asymptotic recurrence relation as,
+
+$$
+\begin{array} { c } { { \displaystyle \epsilon ^ { l + 1 } = \epsilon ^ { l } \left[ \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi ^ { \prime } \left( \sqrt { q ^ { * } } z \right) \right] ^ { 2 } + \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { \prime \prime } \left( \sqrt { q ^ { * } } z \right) \phi \left( \sqrt { q ^ { * } } z \right) \right] + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) } } \\ { { { } } } \\ { { = \displaystyle \epsilon ^ { l } \left[ \chi _ { 1 } + \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { \prime \prime } \left( \sqrt { q ^ { * } } z \right) \phi \left( \sqrt { q ^ { * } } z \right) \right] + \mathcal { O } ( ( \epsilon ^ { l } ) ^ { 2 } ) } } \end{array}
+$$
+
+as required.
+
+# 7.2 TWO INPUT DEPTH-SCALE
+
+# Result:
+
+Consider the recurrence relation for the co-variance of two input,
+
+$$
+q _ { a b } ^ { l } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( u _ { 1 } ) \phi ( u _ { 2 } ) + \sigma _ { b } ^ { 2 } ,
+$$
+
+a correlation between the inputs, $c _ { a b } ^ { l } = q _ { a b } ^ { l } / \sqrt { q _ { a a } ^ { l } q _ { b b } ^ { l } }$ , and a fixed point of the dynamics, $c ^ { * }$ . $c _ { a b } ^ { l }$ can be expanded about the fixed point to yield the asymptotic recurrence relation,
+
+$$
+\epsilon ^ { l + 1 } = \epsilon ^ { l } \left[ \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ) \phi ^ { \prime } ( u _ { 2 } ) \right] + \mathcal { O } \left( ( \epsilon ^ { l } ) ^ { 2 } \right) .
+$$
+
+# Derivation:
+
+Since the relaxation of $q _ { a a } ^ { l }$ and $q _ { b b } ^ { l }$ to $q ^ { * }$ occurs much more quickly than the convergence of $q _ { a b } ^ { l }$ we approximate $q _ { a a } ^ { l } = q _ { b b } ^ { l } = q ^ { * }$ as in Poole et al. (2016). We therefore consider the perturbation $q _ { a b } ^ { l } / q ^ { * } = c _ { a b } ^ { l } = c ^ { * } + { \epsilon } ^ { l }$ . It follows that we may make the approximation,
+
+$$
+\begin{array} { r l } & { u _ { 2 } ^ { l } = \sqrt { q ^ { * } } \left( c _ { a b } ^ { l } z _ { 1 } + \sqrt { 1 - ( c _ { a b } ^ { l } ) ^ { 2 } } z _ { 2 } \right) } \\ & { \quad \approx \sqrt { q ^ { * } } \left( c ^ { * } z _ { 1 } + \sqrt { 1 - ( c ^ { * } ) ^ { 2 } - 2 c ^ { * } \epsilon ^ { l } } z _ { 2 } \right) + \sqrt { q ^ { * } } \epsilon ^ { l } z _ { 1 } + \mathcal { O } ( \epsilon ^ { 2 } ) } \end{array}
+$$
+
+We now consider the case where $c ^ { * } < 1$ and $c ^ { * } = 1$ separately; we will later show that these two results agree with one another. First we consider the case where $c ^ { * } < 1$ in which case we may safely expand the above equation to get,
+
+$$
+u _ { 2 } ^ { l } = \sqrt { q ^ { * } } \left( c ^ { * } z _ { 1 } + \sqrt { 1 - ( c ^ { * } ) ^ { 2 } } z _ { 2 } \right) + \sqrt { q ^ { * } } \epsilon ^ { l } \left( z _ { 1 } - \frac { c ^ { * } } { \sqrt { 1 - ( c ^ { * } ) ^ { 2 } } } z _ { 2 } \right) + \mathcal { O } ( \epsilon ^ { 2 } ) .
+$$
+
+This allows us to in turn approximate the recurrence relation,
+
+$$
+\begin{array} { r l } { \frac { d ^ { 2 } + 1 } { d t } = \frac { \sigma _ { 0 } ^ { 4 } } { \sqrt { \sigma _ { 0 } ^ { 4 } } } } & { \frac { 1 } { \sqrt { \sigma _ { 0 } ^ { 4 } } } } \\ { \times } & { \frac { \sigma _ { 0 } ^ { 4 } } { \sigma _ { 0 } ^ { 4 } } \int \mathcal { D } _ { \Sigma ^ { 1 } } \mathcal { D } _ { \Sigma ^ { 2 } } \phi ( s _ { 1 } ^ { \prime } ) \Bigg [ \delta ( u _ { 2 } ^ { \prime } ) + \sqrt { \mathcal { F } } ^ { c } \epsilon ( \frac { \sigma _ { 1 } } { \sqrt { 1 - ( \epsilon ^ { \prime } ) ^ { 2 } } } ) ^ { 2 } \epsilon ( \sigma _ { 2 } ^ { \prime } ) \Bigg ] + \sigma _ { 0 } ^ { 2 } \delta ( \sigma _ { 1 } ^ { 2 } ) } \\ & { \frac { \sigma _ { 1 } ^ { 2 } } { \sqrt { 1 - ( \epsilon ^ { \prime } ) ^ { 2 } } } } \\ & { = \epsilon ^ { * } - \frac { \sigma _ { 0 } ^ { 2 } } { \sqrt { \sigma _ { 0 } ^ { 4 } } } \epsilon \Bigg [ \mathcal { D } _ { \Sigma ^ { 1 } } \mathcal { D } _ { \Sigma ^ { 3 } } ( z _ { 1 } - \frac { \epsilon ^ { \prime } } { \sqrt { 1 - ( \epsilon ^ { \prime } ) ^ { 2 } } } ) \epsilon ( s _ { 1 } ^ { \prime } ) | \phi ( u _ { 2 } ^ { \prime } ) | ^ { 2 } \delta ( z _ { 1 } ^ { \prime } ) } \\ & { = \epsilon ^ { * } - \frac { \sigma _ { 0 } ^ { 2 } } { \sqrt { \sigma _ { 0 } ^ { 4 } } } \epsilon \Bigg [ \int \mathcal { D } _ { \Sigma ^ { 1 } } \mathcal { D } _ { \Sigma ^ { 2 } \Sigma ^ { 3 } } ( \epsilon ( \frac { \sigma _ { 1 } } { \sqrt { 1 + ( \epsilon ^ { \prime } ) ^ { 2 } } } ) ^ { 2 } ( \sigma _ { 2 } ^ { \prime } ) - \frac { \epsilon ^ { * } } { \sqrt { 1 - ( \epsilon ^ { \prime } ) ^ { 2 } } } \int \mathcal { D } _ { \Sigma ^ { 1 } } \mathcal { D } _ { \Sigma ^ { 2 } \Sigma ^ { 3 } } \phi ( s _ { 1 } ^ { \prime } ) | \phi ( z _ { 2 } ^ { \prime } ) \Bigg ] } \\ & = \epsilon ^ { * } - \frac \end{array}
+$$
+
+where $u _ { 1 } ^ { * }$ and $u _ { 2 } ^ { * }$ are appropriately defined asymptotic random variables. This leads to the asymptotic recurrence relation,
+
+$$
+\epsilon ^ { l + 1 } = \sigma _ { w } ^ { 2 } \epsilon ^ { l } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ^ { * } ) \phi ^ { \prime } ( u _ { 2 } ^ { * } )
+$$
+
+as required.
+
+We now consider the case where $c ^ { * } = 1$ and $c _ { a b } ^ { l } = 1 - \epsilon ^ { l }$ . In this case the expansion of $u _ { 2 } ^ { l }$ will become,
+
+$$
+u _ { 2 } ^ { l } = \sqrt { q ^ { * } } z _ { 1 } + \sqrt { 2 q ^ { * } \epsilon ^ { l } } z _ { 2 } - \sqrt { q ^ { * } } \epsilon ^ { l } z _ { 1 } + \mathcal { O } ( \epsilon ^ { 3 / 2 } )
+$$
+
+and so the lowest order correction is of order $\mathcal { O } ( \sqrt { \epsilon } ^ { l } )$ as opposed to $\mathcal { O } ( \epsilon ^ { l } )$ . As usual we now expand the recurrence relation, noting that $u _ { 2 } ^ { * } = u _ { 1 } ^ { * }$ is independent of $z _ { 2 }$ when $c ^ { * } = 1$ to find,
+
+$$
+\begin{array} { r l r } { c _ { \omega \delta } ^ { i + 1 } } & { = \frac { \sigma _ { w } ^ { 2 } } { q ^ { * } } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( u _ { 1 } ^ { * } ) \phi ( u _ { 2 } ^ { l } ) + \sigma _ { b } ^ { 2 } } & { ( 4 ; } \\ & { \approx \frac { \sigma _ { w } ^ { 2 } } { q ^ { * } } \displaystyle \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( u _ { 1 } ^ { * } ) \left[ \phi ( u _ { 2 } ^ { * } ) + \left( \sqrt { 2 q ^ { * } t } z _ { 2 } - \sqrt { q ^ { * } } t z _ { 1 } \right) \phi ^ { \prime } ( u _ { 2 } ^ { * } ) + q ^ { * } t ^ { \frac { l } { 2 } } z _ { 2 } ^ { 2 } \phi ^ { \prime \prime } ( u _ { 2 } ^ { * } ) \right] + \sigma _ { b } ^ { 2 } } & \\ & { } & { ( 4 ; } \\ & { = c ^ { * } + \sigma _ { w } ^ { 2 } \epsilon ^ { l } \displaystyle \int \mathcal { D } z \phi ( \sqrt { q ^ { * } } z ) \left[ \phi ^ { \prime \prime } ( \sqrt { q ^ { * } } z ) - \frac { 1 } { \sqrt { q ^ { * } } } z \phi ^ { \prime } ( \sqrt { q ^ { * } } z ) \right] } & { ( 4 ; } \\ & { } & { = c ^ { * } + \sigma _ { w } ^ { 2 } \epsilon ^ { l } \displaystyle \left[ \int \mathcal { D } z \phi ( \sqrt { q ^ { * } } z ) \phi ^ { \prime \prime } ( \sqrt { q ^ { * } } z ) - \frac { 1 } { \sqrt { q ^ { * } } } \displaystyle \int \mathcal { D } z z \phi ( \sqrt { q ^ { * } } z ) \phi ^ { \prime } ( \sqrt { q ^ { * } } z ) \right] } & { ( 4 ; } \\ & { } & { ( 4 ; } \end{array}
+$$
+
+It follows that the asymptotic recurrence relation in this case will be,
+
+$$
+\epsilon ^ { l + 1 } = - \epsilon ^ { l } \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi ^ { \prime } ( \sqrt { q ^ { * } } z ) \right] ^ { 2 } = - \epsilon ^ { l } \chi _ { 1 } .
+$$
+
+where $\chi _ { 1 }$ is the stability condition for the ordered phase. We note that although the approximations were somewhat different the asymptotic recurrence relation for $c ^ { * } < 1$ reduces eq. 47 result for $c ^ { * } = 1$ . We may therefore use 4 for all $c ^ { * }$ .
+
+# 7.3 VARIANCE OF AN INPUT WITH DROPOUT
+
+# Result:
+
+In the presence of dropout with rate $\rho$ , the variance of a single input as it is passed through the network is described by the recurrence relation,
+
+$$
+\bar { q } _ { a a } ^ { l } = \frac { \sigma _ { w } ^ { 2 } } { \rho } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { \bar { q } _ { a a } ^ { l - 1 } } z \right) + \sigma _ { b } ^ { 2 } .
+$$
+
+# Derivation:
+
+Recall that the recurrence relation for the pre-activations is given by,
+
+$$
+z _ { i } ^ { l } = \frac { 1 } { \rho } \sum _ { j } W _ { i j } ^ { l } p _ { j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l }
+$$
+
+where $p _ { j } ^ { l } \sim \mathrm { B e r n o u l l i } ( \rho )$ . It follows that the variance will be given by,
+
+$$
+\begin{array} { l } { \displaystyle { \bar { q } _ { a a } ^ { l } = \mathbb { E } [ ( z _ { i } ^ { l } ) ^ { 2 } ] } } \\\ { { \displaystyle ~ = \frac { 1 } { \rho ^ { 2 } } \sum _ { j } \mathbb { E } [ ( W _ { i j } ^ { l } ) ^ { 2 } ] \mathbb { E } [ ( \rho _ { j } ^ { l } ) ^ { 2 } ] \mathbb { E } [ ( y _ { j } ^ { l } ) ^ { 2 } ] + \mathbb { E } [ ( b _ { i } ^ { l } ) ^ { 2 } ] } } \\ { { \displaystyle ~ = \frac { \sigma _ { w } ^ { 2 } } { \rho } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { \bar { q } _ { a a } ^ { l - 1 } } z \right) + \sigma _ { b } ^ { 2 } . } } \end{array}
+$$
+
+where we have used the fact that $\mathbb { E } [ ( p _ { j } ^ { l } ) ^ { 2 } ] = \rho$ .
+
+# 7.4 COVARIANCE OF TWO INPUTS WITH DROPOUT
+
+# Result:
+
+The co-variance between two signals, $z _ { i ; a } ^ { l }$ and $z _ { i ; b } ^ { l }$ , with separate i.i.d. dropout masks $p _ { i ; a } ^ { l }$ and $p _ { i ; b } ^ { l }$ is given by,
+
+$$
+\bar { q } _ { a b } ^ { l } = \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( \bar { u } _ { 1 } ) \phi ( \bar { u } _ { 2 } ) + \sigma _ { b } ^ { 2 } .
+$$
+
+where, in analogy to eq. 4, $\bar { u } _ { 1 } = \sqrt { \bar { q } _ { a a } ^ { l } } z _ { 1 }$ and $\hat { u } _ { 2 } = \sqrt { \hat { q } _ { b b } ^ { l } } \left( \hat { c } _ { a b } ^ { l } z _ { 1 } + \sqrt { 1 - ( \hat { c } _ { a b } ^ { l } ) ^ { 2 } } z _ { 2 } \right) .$
+
+# Derivation:
+
+Proceeding directly we find that,
+
+$$
+\begin{array} { r l r } { { \mathbb { E } [ z _ { i ; a } ^ { l } z _ { i ; b } ^ { l } ] = \frac { 1 } { \rho ^ { 2 } } \sum _ { j } \mathbb { E } [ ( W _ { i j } ^ { l } ) ^ { 2 } ] \mathbb { E } [ p _ { j ; a } ^ { l } ] \mathbb { E } [ p _ { j ; b } ^ { l } ] \mathbb { E } [ y _ { j ; a } ^ { l } y _ { j ; b } ^ { l } ] + \mathbb { E } [ b _ { i } ^ { l } ] } } \\ & { } & \\ & { } & { = \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ( \bar { u } _ { 1 } ) \phi ( \bar { u } _ { 2 } ) + \sigma _ { b } ^ { 2 } } \end{array}
+$$
+
+where we have used the fact that $\mathbb { E } [ p _ { i ; a } ^ { l } ] = \mathbb { E } [ p _ { i ; b } ^ { l } ] = \rho$ . We have also used the same substitution for $\mathbb { E } [ y _ { j ; a } ^ { l } y _ { j ; b } ^ { l } ]$ used in the original mean field calculation with the appropriate substitution.
+
+7.5 THE LACK OF A $c ^ { * } = 1$ FIXED POINT WITH DROPOUT
+
+# Result:
+
+$c _ { a b } ^ { l } = 1$ then it follows that,
+
+$$
+\bar { c } _ { a b } ^ { l + 1 } = 1 - \frac { 1 - \rho } { \rho \bar { q } ^ { * } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { \bar { q } ^ { * } } z \right)
+$$
+
+subject to the approximation, $q _ { a a } ^ { l } \approx q _ { b b } ^ { l } \approx q ^ { * }$ . This implies that $c _ { a b } ^ { l + 1 } < 1$
+
+# Derivation:
+
+Plugging in $c _ { a b } ^ { l } = 1$ with $q _ { a a } ^ { l } \approx q _ { b b } ^ { l } \approx q ^ { * }$ we find that $\bar { u } _ { 1 } = \bar { u } _ { 2 } = \sqrt { q ^ { * } } z _ { 1 }$ . It follows that,
+
+$$
+\begin{array} { r l } & { c _ { a b } ^ { l + 1 } = \frac { q _ { a b } ^ { l + 1 } } { q ^ { * } } } \\ & { \quad = \frac { 1 } { q ^ { * } } \left[ \sigma _ { w } ^ { 2 } \left( \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) + \sigma _ { b } ^ { 2 } \right] \right. } \\ & { \quad \left. = \frac { 1 } { q ^ { * } } \left[ \sigma _ { w } ^ { 2 } ( 1 - \rho ^ { - 1 } + \rho ^ { - 1 } ) \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) + \sigma _ { b } ^ { 2 } \right] \right. } \\ & { \quad = \frac { 1 } { q ^ { * } } \left[ \frac { \sigma _ { w } ^ { 2 } } { \rho } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) + \sigma _ { b } ^ { 2 } \right] + \frac { \sigma _ { w } ^ { 2 } } { q ^ { * } } ( 1 - \rho ^ { - 1 } ) \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) } \\ & { \quad = 1 - \frac { 1 - \rho } { \rho \tilde { q } ^ { * } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z \phi ^ { 2 } \left( \sqrt { q ^ { * } } z \right) } \end{array}
+$$
+
+as required. Here we have integrated out $z _ { 2 }$ since nether $\bar { u } _ { 1 }$ nor $\bar { u } _ { 2 }$ depend on it.
+
+# 7.6 MEAN FIELD GRADIENT SCALING
+
+# Result:
+
+In mean field theory the expected magnitude of the gradient $| | \nabla _ { W _ { i j } ^ { l } } E | | ^ { 2 }$ will be proportional to $\mathbb { E } [ ( \delta _ { i } ^ { l } ) ^ { 2 } ]$ .
+
+# Derivation:
+
+We first note that since the $W _ { i j } ^ { l }$ are i.i.d. it follows that,
+
+$$
+\begin{array} { l } { | | \nabla _ { W _ { i j } ^ { l } } E | | ^ { 2 } = \displaystyle \sum _ { i j } \left( \frac { \partial E } { \partial W _ { i j } ^ { l } } \right) ^ { 2 } } \\ { \approx N _ { l } N _ { l + 1 } \mathbb { E } \left[ \left( \frac { \partial E } { \partial W _ { i j } ^ { l } } \right) ^ { 2 } \right] } \end{array}
+$$
+
+where we have used the fact that the first line is related to the sample expectation over the different realizations of the $W _ { i j } ^ { l }$ to approximate it by the analytic expectation in the second line. In mean field theory since the pre-activations in each layer are assumed to be i.i.d. Gaussian it follows that,
+
+$$
+\mathbb { E } \left[ \left( \frac { \partial E } { \partial W _ { i j } ^ { l } } \right) ^ { 2 } \right] = \mathbb { E } [ ( \delta _ { i } ^ { l } ) ^ { 2 } ] \mathbb { E } [ \phi ^ { 2 } ( z _ { j } ^ { l - 1 } ) ]
+$$
+
+and the result follows.
+
+# 7.7 MEAN FIELD BACKPROPAGATION
+
+# Result:
+
+In mean field theory the recursion relation for the variance of the errors, $\tilde { q } ^ { l } = \mathbb { E } [ ( \delta _ { i } ^ { l } ) ^ { 2 } ]$ is given by,
+
+$$
+\tilde { q } _ { a a } ^ { l } = \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \chi _ { 1 } ( q _ { a a } ^ { l } ) .
+$$
+
+# Derivation:
+
+Computing the variance directly and using mean field approximation,
+
+$$
+\begin{array} { r l } { \tilde { q } _ { a a } ^ { l } = \mathbb { E } [ ( \delta _ { \xi ; a } ^ { l } ) ^ { 2 } ] = \mathbb { E } [ ( \phi ^ { l } ( z _ { : a } ^ { l } ) ) ^ { 2 } ] \underset { \textstyle \mathcal { j } } { \sum } \mathbb { E } [ ( \delta _ { \xi ; a } ^ { l + 1 } ) ^ { 2 } ] \mathbb { E } [ ( W _ { \xi } ^ { l + 1 } ) ^ { 2 } ] } \\ & { = \mathbb { E } [ ( \phi ^ { l } ( z _ { : a } ^ { l } ) ) ^ { 2 } ] \frac { \sigma _ { w } ^ { 2 } } { N _ { l + 1 } } \underset { \textstyle \mathcal { j } } { \sum } \mathbb { E } [ ( \delta _ { \xi ; a } ^ { l + 1 } ) ^ { 2 } ] } \\ & { = \mathbb { E } [ ( \phi ^ { l } ( z _ { : a } ^ { l } ) ) ^ { 2 } ] \frac { N _ { l + 1 } } { N _ { l + 2 } } \sigma _ { w } ^ { 2 } \widehat { q } _ { a a } ^ { l + 1 } } \\ & { = \sigma _ { w } ^ { 2 } \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \int \mathcal { D } z \left[ \phi ^ { l } \left( \sqrt { q _ { a a } ^ { l } } z \right) \right] ^ { 2 } } \\ & { \approx \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \chi _ { 1 } } \end{array}
+$$
+
+as required. In the last step we have made the approximation that $q _ { a a } ^ { l } \approx q ^ { * }$ since the depth scale for the variance is short ranged.
+
+# 7.8 MEAN FIELD GRADIENT COVARIANCE SCALING
+
+# Result:
+
+In mean field theory we expect the covariance between the gradients of two different inputs to scale as,
+
+$$
+\begin{array} { r } { \left( \nabla _ { W _ { i j } ^ { l } } E _ { a } \right) \cdot \left( \nabla _ { W _ { i j } ^ { l } } E _ { b } \right) \sim \mathbb { E } [ \delta _ { i ; a } \delta _ { i ; b } ] . } \end{array}
+$$
+
+# Derivation:
+
+We proceed in a manner analogous to Appendix 7.6. Note that in mean field theory since the weights are i.i.d. it follows that
+
+$$
+\begin{array} { r l } { \displaystyle ( \nabla _ { W _ { i j } ^ { l } } E _ { a } ) \cdot ( \nabla _ { W _ { i j } ^ { l } } E _ { b } ) = \sum _ { i j } \frac { \partial E _ { a } } { \partial W _ { i j } ^ { l } } \frac { \partial E _ { b } } { \partial W _ { i j } ^ { l } } } & { } \\ { \displaystyle \approx N _ { l } N _ { l + 1 } \mathbb { E } \left[ \frac { \partial E _ { a } } { \partial W _ { i j } ^ { l } } \frac { \partial E _ { b } } { \partial W _ { i j } ^ { l } } \right] } \end{array}
+$$
+
+where, as before, the final term is approximating the sample expectation. Since the weights in the forward and backwards passes are chosen independently it follows that we can factor the expectation as,
+
+$$
+\mathbb { E } \left[ \frac { \partial E _ { a } } { \partial W _ { i j } ^ { l } } \frac { \partial E _ { b } } { \partial W _ { i j } ^ { l } } \right] = \mathbb { E } [ \delta _ { i ; a } ^ { l } \delta _ { i ; b } ^ { l } ] \mathbb { E } [ \phi ( \boldsymbol { z } _ { i ; a } ^ { l } ) \phi ( \boldsymbol { z } _ { i ; b } ^ { l } ) ]
+$$
+
+and the result follows.
+
+# 7.9 MEAN FIELD BACKPROPAGATION OF COVARIANCE
+
+# Result:
+
+The covariance between the gradients due to two inputs scales as,
+
+$$
+\tilde { q } _ { a b } ^ { l } = \tilde { q } _ { a b } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ) \phi ^ { \prime } ( u _ { 2 } )
+$$
+
+under backpropagation.
+
+# Derivation
+
+As in the analogous derivation for the variance, we compute directly,
+
+$$
+\begin{array} { l } { { \displaystyle { \tilde { q } } _ { a b } ^ { l } = \mathbb { E } [ \delta _ { i ; a } ^ { l } \delta _ { i ; b } ^ { l } ] = \mathbb { E } [ \phi ^ { \prime } ( z _ { i ; a } ) \phi ^ { \prime } ( z _ { i ; b } ) ] \sum _ { j } \mathbb { E } [ \delta _ { j ; a } ^ { l + 1 } \delta _ { j ; b } ^ { l + 1 } ] \mathbb { E } [ ( W _ { j i } ^ { l + 1 } ) ^ { 2 } ] } } \\ { ~ } \\ { { \displaystyle ~ = \tilde { q } _ { a b } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \sigma _ { w } ^ { 2 } \int \mathcal { D } z _ { 1 } \mathcal { D } z _ { 2 } \phi ^ { \prime } ( u _ { 1 } ) \phi ^ { \prime } ( u _ { 2 } ) } } \end{array}
+$$
+
+as required.
+
+Here we include some more experimental figures that investigate the effects of training time, minimizer, and dataset more closely.
+
+
+Figure 7: Training accuracy on MNIST after (a) 45 (b) 304 (c) 2048 and (d) 13780 steps of SGD with learning rate $\mathrm { \bar { 1 0 } ^ { - 3 } }$ .
+
+
+Figure 8: Training accuracy on MNIST after (a) 45 (b) 304 (c) 2048 and (d) 13780 steps of RMSProp with learning rate $1 0 ^ { - 5 }$ .
\ No newline at end of file
diff --git a/md/train/H1eqviAqYX/H1eqviAqYX.md b/md/train/H1eqviAqYX/H1eqviAqYX.md
new file mode 100644
index 0000000000000000000000000000000000000000..b2aeead328292dd783dc7a8b44aecc04a8145c9e
--- /dev/null
+++ b/md/train/H1eqviAqYX/H1eqviAqYX.md
@@ -0,0 +1,452 @@
+# WHY DO NEURAL RESPONSE GENERATION MODELS PREFER UNIVERSAL REPLIES?
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Recent advances in neural Sequence-to-Sequence (Seq2Seq) models reveal a purely data-driven approach to the response generation task. Despite its diverse variants and applications, the existing Seq2Seq models are prone to producing short and generic replies, which blocks such neural network architectures from being utilized in practical open-domain response generation tasks. In this research, we analyze this critical issue from the perspective of the optimization goal of models and the specific characteristics of human-to-human conversational corpora. Our analysis is conducted by decomposing the goal of Neural Response Generation (NRG) into the optimizations of word selection and ordering. It can be derived from the decomposing that Seq2Seq based NRG models naturally tend to select common words to compose responses, and ignore the semantic of queries in word ordering. On the basis of the analysis, we propose a max-marginal ranking regularization term to avoid Seq2Seq models from producing the generic and uninformative responses. The empirical experiments on benchmarks with several metrics have validated our analysis and proposed methodology.
+
+# 1 INTRODUCTION
+
+Past years have witnessed the dramatic progress on the application of generative sequential models (also noted as seq2seq learning (Sutskever et al., 2014; Bahdanau et al., 2015)) on Neural Response Generation (NRG) fields (Vinyals & Le, 2015; Serban et al., 2017). Seq2seq model has been proved to be capable of directly generating reply given an open domain query (Li et al., 2016c; Xing et al., 2017). Both relevant words or phrases are automatically selected, and smoothness and fluency of responses are guaranteed through the end-to-end learning. Moreover, abundant impressive humanto-machine conversation cases have been presented in many previous studies (Serban et al., 2016; Shang et al., 2015; Shao et al., 2017).
+
+Despite these promising results, current Sequence-to-Sequence (Seq2Seq) architectures for response generation are still far from steadily generating relevant and coherent replies. The essential issue identified by many studies is the Universal Replies: the model tends to generate short and general replies which contain limited information, such as “That’s great!”, “I don’t know”, etc. (Li et al., 2016b;d; Mou et al., 2016; Xing et al., 2017). Intuitively, this problem was attributed to the vast coverage of common replies in the training set and insufficient guiding knowledge in the models’ response generation step (Mou et al., 2016; Shao et al., 2017). Hence, current efforts mainly focus on introducing external information to the model (Mou et al., 2016; Xing et al., 2017), and encouraging the model to generate diverse responses in searching space via variational beam search strategies during inference (Shao et al., 2017; Li et al., 2016b;d).
+
+Nevertheless, most previous analysis over the issue are empirical and lack of statistical evidence. Therefore, in this paper, we conduct an in-depth investigation on the performance of seq2seq models on the NRG task. In our inspections on the existing dialog corpora, it is shown that those repeatedly appeared replies have two essential traits: 1) Most of them are composed of highly frequent words; 2) They cover a large portion of the dialog corpora that each universal reply stands for the response of various queries. Above characteristics of universal replies deviate the NRG from other successful applications of sea2seq model such as translation, and lead current generative NRG models to prefer common replies. To discuss the influences from the specific distributed corpus, we decompose the target sequence’s probability into two parts and analyze the probability respectively.
+
+Table 1: Replies and translated version of an example which reveal the different source-target sentence distribution for dialog and translation.
+
+
Query
I would add Metropolis to the list.
Replies
I love this film so much. Me too,itisa beautiful film. This movie has beautiful background art. Fritz is really a good director,I like his film.
Translate
Brigitte cooling off on the set of Metropolis. J'ajouterais Metropolis ala liste. Je voudrais ajouter Metropolis a la liste.
+
+To break down the mentioned characteristics of dialog corpora in the model training step, we propose a ranking-oriented regularization term to prune the scores of those irrelevant replies. Experimental results reveal that the model with such regularization can produce better results and avoid generating ambiguous responses. Also, case studies show that the issue of generic response is alleviated that these common responses are ranked relatively lower than more appropriate answers.
+
+The main contributions of this paper are concluded as follows: 1) We analyze the loss function of Seq2seq models on NRG task and conclude several critical reasons that the NRG models prefer universal replies; 2) Based on the analysis, a max-marginal ranking regularization is presented to help the model converge to informative responses.
+
+# 2 ANALYSIS OF SEQ2SEQ MODELS FOR NRG
+
+Different from significant advances in machine translation (Bahdanau et al., 2015) and abstractive summarization (Rush et al., 2015; Nallapati et al., 2016), it remains challenging to apply Seq2Seq models in practical response generation. One widely accepted issue within current models is that Seq2Seq architectures are inclined to produce common and unrelated replies, even when the quality of training data is significantly improved and different Seq2Seq variants are proposed. The primary reason for this phenomenon lies in the fact that the semantic constraint from query to the possible responses is naturally weak, since the responses to a given query are not required to be semantically equivalent. In contrast, the references in machine translation or summarization are usually restricted to be equivalent to each other semantically or even lexically. Especially, for machine translation, words that appear in the target language should satisfy word level mapping from the source sentence, so the learned word alignment function could ensure the model to generate suitable translated words. Different from learning the semantic alignments between languages in NMT, in NRG the replies can be diversified as they only need to satisfy the causality with the given queries. Moreover, given a query, the sequential model is optimized to learn the shared information among all replies, thus the model is more likely to choose those high-frequent common replies, which is also mentioned in Ritter et al. (2011).
+
+Taking the case in Table 1 for example, the topic of this query is about movie. It can be observed that the replies shown in the table are semantically diversified: the first two replies are related to the opinion of the respondent toward the movie, while the rest of the replies are about the director, content, and origin of the movie. By contrast, the two valid translations in French are very similar regarding their semantics, which can be attributed to the fixed word-level mapping between query and targets.
+
+# 2.1 PROBLEM DECOMPOSITION
+
+The sequence-mapping problem in NRG can be decomposed into two independent sub-learning problems: 1) Target word selection, in which a query is summarized and translated into the semantic space of responses, and then a set of target words is selected to represent the meaning; 2) Word ordering, in which a grammatical coherent reply is generated based on the candidate word set (Vinyals et al., 2016). The word selection and ordering of the target sequence are jointly learned which can also be reflected in the model’s loss function by two possible factored phases:
+
+
+Figure 1: Response Unigram probability distribution in Table 1.
+
+$$
+- \log p ( y | x ) = - \log p ( S ( y ) | x ) - \log p ( y | S ( y ) , x )
+$$
+
+where $x$ stands for the given query and $y$ is the corresponding response with $n$ words. Besides, $\boldsymbol { S } ( y ) = \{ w _ { 1 } , \cdots , w _ { n } | \boldsymbol { \bar { w _ { i } } } \in y , \boldsymbol { \bar { i } } \in [ 1 , n ] \}$ represents all predicted words without sequential order, so $p ( \boldsymbol { S } ( y ) | \boldsymbol { x } )$ is referred as the probability of the target word selection. Meanwhile, $p ( \boldsymbol { y } | \boldsymbol { S } ( \boldsymbol { y } ) , \boldsymbol { x } )$ indicates the probability of word ordering given this group of possible words. Thus, the objective can be redescribed from maximizing the probability of the ground truth response $y$ under query $x$ to maximizing these two joint probabilities simultaneously.
+
+After the above interpretation, we will further discuss the impact of the implicative constriction from two separated probabilities in Eq. 1, which results in the potential failure of models in learning conversational patterns.
+
+# 2.2 TARGET WORD SELECTION PROBABILITY
+
+Assuming that we have a set of $\kappa$ ground-truth replies: $\{ y _ { 1 } , \cdots , y _ { K } \}$ to a given query $x$ , the upper bound of the target word selection probability can be derived via Jensen’s Inequality (Boyd $\&$ Vandenberghe, 2004):
+
+$$
+\begin{array} { l } { \displaystyle \sum _ { k } ^ { K } \log p ( \mathcal { S } ( y _ { k } ) | x ) = \displaystyle \sum _ { k } ^ { K } \log \prod _ { w \in \mathcal { S } ( y _ { k } ) } p ( w | x ) } \\ { = \displaystyle \sum _ { w \in \cup _ { k } ^ { K } \mathcal { S } ( y _ { k } ) } \log p ( w | x ) } \\ { \leq L _ { \mathcal { S } } \log \displaystyle \sum _ { w \in \cup _ { k } ^ { K } \mathcal { S } ( y _ { k } ) } \frac { p ( w | x ) } { L _ { \mathcal { S } } } } \end{array}
+$$
+
+where $\cup _ { k } ^ { K } S ( y _ { k } )$ denotes all the words appearing in the entire response set, and $L _ { S } = | \cup _ { k } ^ { K } S ( y _ { k } ) |$ . Thus, optimizing the first segment is proportional to maximizing the last conditional probabilities, and the optimal strategy is to assign probabilities according to the frequency of words in these $\kappa$ responses. Such strategy adopted by Seq2Seq can be verified by the long-tailed distribution of words in Fig. 1, in which only few common words are assigned with preferred high probabilities. Given that, during the inference, the best strategy is to employ more frequently occurring words rather than rare ones such as “background,” “art,” and “director” in Table 1.
+
+Furthermore, assuming that each response contains a fixed number of $T$ words (so that $1 \leq L _ { S } \leq$ $\kappa \times T )$ , we can find that the probability of each response for $x$ is inversely proportional to $\kappa$ :
+
+$$
+L _ { S } \log \sum _ { w \in \cup _ { k } ^ { \kappa } { \cal S } ( y _ { k } ) } \frac { p ( w | x ) } { L _ { S } } = L _ { S } \log \frac { \mathbb { E } ( w | x ) \times T } { K \times T \times L _ { S } } \propto \log \frac { 1 } { ( K \times L _ { S } ) ^ { L _ { S } } } \leq \log \frac { 1 } { K }
+$$
+
+where $\mathbb { E } ( w | x )$ denotes the mean frequency of words appeared in these $\kappa$ replies, which is 1.32 for the cases in Table 1. In general, the mean frequency is around 1 owing to the long-tailed Unigram distribution which satisfies Zipf’s law (Zipf, 1935). In other words, the target word selection
+
+probability is limited by $\kappa$ , so queries with more diverse answers are more challenging to learn. Meanwhile, it is difficult to obtain good predictions for lower-informational queries, as they contain more possible responses which are somewhat equivalent to a larger $\kappa$ (Li et al., 2016a).
+
+Nonetheless, the translation task requires word-level mappings as they are well-aligned in the semantic space, therefore source and target sentences are semantically equivalent. So that, translated candidates are confined to $\kappa \approx 1$ . Thus the upper bound can be approximated as the full probability.
+
+# 2.3 WORD ORDERING PROBABILITY
+
+# 2.3.1 LEMMAS
+
+Before discussing the word ordering probability, we present four lemmas and corresponding proofs.
+Moreover, all these lemmas are only available for the response generation task except Lemma 1.
+
+According to the Zipf’s law (Zipf, 1935), the frequency of any word is inversely proportional to its rank in the frequency table, such that the probability $p ( w _ { i } ) = Z / i ^ { \alpha }$ , where $Z \approx 0 . 1$ , $\alpha \approx 1$ , and $i$ is the frequency rank of the word $w _ { i }$ . Then, denoting the vocabulary size as $V$ and the total number of query-response pairs as $N$ , we can formulate two characteristics of a universal reply $y$ as follows:
+
+1) A response is universal if it consists of only top- $\mathbf { \nabla } \cdot t$ ranked words. For any word $w$ in such response, $p ( w ) \geq 1 / ( 1 0 t )$ according to the Zipf’s law.
+
+2) The amount of possible queries $M$ of $y$ is directly proportional to the size of query-response pairs $N$ , noted as $1 \ll M \propto N$ .
+
+To simplify, we suppose that $t > 1 0 0 0$ to cover most universal replies, and the frequency of the response not belonging to the universal replies is a constant $c$ $1 \leq c \ll M$ ). Accordingly, we can derive the following lemmas.
+
+Lemma 1 $p ( \boldsymbol { S } ( y ) | y ) = 1$ $\begin{array} { r } { \mathbf { \Phi } _ { I } ) \vert y \rangle = 1 , p ( S ( y ) , y ) = p ( y ) , p ( x , y , S ( y ) ) = p ( x , y ) . } \end{array}$
+
+Proof. Lemma 1 describes the obvious fact that the event “the word set of the response equals to $\boldsymbol { S } ( y ) ^ { \flat }$ must happen when the event ${ \ " } y$ stands for the response” is established.
+
+Lemma 2 $p ( x | y _ { u r } ) = \epsilon _ { 1 }$ , where $\epsilon _ { 1 } > 0$ and is sufficiently small, and $y _ { u r }$ is a universal reply.
+
+Proof. Based on the second character of the universal reply and the fact that $N$ is a very large number for any large scaled datasets, Lemma 2 is established as: $\begin{array} { r } { \dot { p } ( x | y _ { u r } ) = \frac { 1 } { M } \propto \frac { 1 } { N } = \epsilon _ { 1 } } \end{array}$
+
+Lemma 3 $\begin{array} { r } { \sum _ { i } p ( y _ { i } ^ { u r } | S ( y ) ) 1 } \end{array}$ , $p ( y _ { j } ^ { o } | S ( y ) ) = \epsilon _ { 2 }$ , where $\epsilon _ { 2 } > 0$ and is sufficiently small, $y _ { i } ^ { u r }$ stands for the $i$ -th universal reply and $\check { y } _ { j } ^ { o }$ is the $j$ -th non-universal grammatical replies, meanwhile, ${ \cal S } ( y _ { i } ^ { u r } ) \subseteq { \cal S } ( y )$ and $S ( y _ { j } ^ { o } ) \subseteq S ( y )$
+
+Proof. According to the following inequation $\begin{array} { r } { \sum _ { i } ^ { t } \frac { 1 } { i } ~ > ~ \int _ { 1 } ^ { t + 1 } \frac { 1 } { x } d x = l n ( t + 1 ) } \end{array}$ , we can get the conclusion that the probability of a chosen word belonging to the most frequent $t$ words is large than $0 . 1 * l n ( t + 1 ) > 0 . 6 9$ . Since $y$ contains $T$ words, there is at least $T l n ( t + 1 )$ words belonging to the top-t ranked on average according to the binomial distribution.
+
+We suppose $m$ responses are universal replies among the $n$ possible responses when their words are constrained by $\bar { \mathcal { S } } ( \bar { y } )$ . Besides, the proportion of $\mathbf { m }$ can be computed as:
+
+$$
+\begin{array} { l } { \displaystyle \frac { m } { n } = \sum _ { i = 1 } ^ { T l n ( t + 1 ) } \frac { C _ { T } ^ { i } } { \sum _ { j = 1 } ^ { T } C _ { T } ^ { j } } \ast \frac { 1 } { 1 0 } l n ( t + 1 ) } \\ { \displaystyle = \frac { 2 ^ { T } - \sum _ { i = T l n ( t + 1 ) } ^ { T } C _ { T } ^ { i } } { 2 ^ { T } } \ast \frac { 1 } { 1 0 } l n ( t + 1 ) } \\ { \displaystyle > \frac { 1 } { 2 0 } l n ( t + 1 ) } \\ { \displaystyle > 0 . 3 4 } \end{array}
+$$
+
+where $C$ donates the combination. Since $n / m$ is not a very large number, the total probability of these $m$ replies can be deducted as:
+
+$$
+\begin{array} { l } { \displaystyle \sum _ { i } p ( y _ { i } ^ { u r } | \mathcal S ( y ) ) = \frac { \sum _ { i } ^ { m } f ( y _ { i } ^ { u r } ) } { \sum _ { i } ^ { m } f ( y _ { i } ^ { u r } ) + \sum _ { i } ^ { n - m } f ( Y _ { i } ^ { o } ) } } \\ { = \frac { M * m } { M * m + c * ( n - m ) } } \\ { = \frac { M } { M + n / m - c } } \\ { > \frac { M } { M + 3 - c } } \end{array}
+$$
+
+where $f ( y )$ donates the frequency of a response $y$ in the corpus. According to the Eq. 5 and the fact that $M \propto N$ is a very large number for any practical large-scale datasets, $\begin{array} { r } { \sum _ { i } p ( \bar { y _ { i } ^ { u r } } | S ( y ) ) 1 } \end{array}$ can be established. Apparently, for any other candidate response $y _ { j } ^ { o }$ , its probability satisfies $\begin{array} { r } { p ( y _ { j } ^ { o } | S ( y ) ) < 1 - \sum _ { i } p ( y _ { i } ^ { u r } | S ( y ) ) = \epsilon _ { 2 } } \end{array}$ .
+
+Lemma 4 Assuming each informative query has $\kappa$ ground-truth replies and the query-response pairs are extracted from a multi-turn conversational corpus, a reply y not belonging to universal replies has $\kappa$ unique queries, noted as $\begin{array} { r } { p ( x | y ) = \frac { 1 } { \mathcal { K } } } \end{array}$ .
+
+Proof. Most query-response pairs are extracted from a practical large-scale multi-turn conversational corpus, so that any response always works as the post in another pair. That is, $y$ also appears $\kappa$ times as it also has $\kappa$ replies. Therefore, there also exist $\kappa$ unique posts for $y$ .
+
+# 2.3.2 DISCUSSION
+
+On the basis of Lemma 1, the word ordering probability could be deducted as:
+
+$$
+\begin{array} { r l } { \iota o g p ( y | S ( y ) , x ) = l o g \frac { p ( S ( y ) | y ) p ( y ) p ( x | \cdot | S ( y ) ) } { p ( S ( y ) ) p ( x | S ( y ) ) } } \\ & { = l o g 1 + l o g \frac { p ( y ) } { p ( S ( y ) ) } + l o g \frac { p ( x | y ) , S ( y ) ) } { p ( x | S ( y ) ) } } \\ & { = l o g \frac { p ( y , S ( y ) ) } { p ( S ( y ) ) } + l o g \frac { p ( x , y , S ( y ) ) p ( S ( y ) ) } { p ( y , S ( y ) ) p ( x , S ( y ) ) } } \\ & { = l o g p ( y | S ( y ) ) + l o g \frac { p ( x , y , y ) p ( S ( y ) ) } { p ( y , S ( y ) ) p ( x , S ( y ) ) } } \\ & { = l o g p ( y ) S ( y ) + l o g \frac { p ( x , y ) p ( S ( y ) ) } { p ( y ) p ( x , S ( y ) ) } } \\ & { = l o g p ( y ) S ( y ) ) + l o g \frac { p ( x | y ) } { p ( x ) S ( y ) } } \\ & { = l o g p ( y ) S ( y ) ) + l o g \frac { p ( x | y ) } { p ( x ) S ( y ) } } \end{array}
+$$
+
+All the possible $y _ { i }$ satisfying $S ( y _ { i } ) \subseteq S ( y )$ can be divided into three categories: ground-truth reply $y$ , universal replies $y ^ { u r }$ and other replies $y ^ { o }$ . From above, we can get the following direct proportion according to the Lemma 2 and Lemma 3,
+
+$$
+\begin{array} { l } { { \displaystyle \sum _ { i } p ( x | y _ { i } ) p ( y _ { i } | S ( y ) ) } \ ~ } \\ { { \displaystyle = p ( x | y ) p ( y | S ( y ) ) + \sum _ { i } p ( x | y _ { i } ^ { u r } ) p ( y _ { i } ^ { u r } | S ( y ) ) + \sum _ { i } p ( x | y _ { i } ^ { o } ) p ( y _ { i } ^ { o } | S ( y ) ) } } \\ { { \displaystyle \propto p ( x | y ) p ( y | S ( y ) ) + \epsilon _ { 1 } + \epsilon _ { 2 } } } \end{array}
+$$
+
+On the basis of Eq. 7 and Lemma 4, for any reply $y$ not belonging to universal replies, the Eq. 6 can be further deducted as:
+
+$$
+\mathit { l o g p } ( y | S ( y ) , x ) \propto \mathit { l o g p } ( y | S ( y ) ) + \mathit { l o g } \frac { p ( x | y ) } { p ( x | y ) p ( y | S ( y ) ) + \epsilon } \propto \mathit { l o g } \frac { p ( y | S ( y ) ) } { p ( y | S ( y ) ) + K \epsilon }
+$$
+
+where $\epsilon = \epsilon _ { 1 } + \epsilon _ { 2 } > 0$ , which is also a sufficiently small positive value. Thus, optimizing the word ordering probability for the non-universal replies is partially equivalent to maximizing $\bar { p } ( y | S ( y ) )$ . In fact the term $p ( \boldsymbol { y } | \boldsymbol { S } ( \boldsymbol { y } ) )$ is the language model probability and it is irrelevant with the query $x$ (Maning et al., 2009). In the sequential models, it is performed as $\begin{array} { r } { \prod _ { t } p ( y _ { t } | y _ { 1 : t - 1 } , S ( y ) ) } \end{array}$ , in other words the sequences are generated based only on previously outputted words. This equation indicates that optimizing the mainly seeks the grammatical competence based on the selected words.
+
+# 2.4 BRIEF SUMMARY
+
+In conclusion, the insufficient constraint of the target words’ cross-entropy loss in NRG is the primary reason that hinders seq2seq models from exploring presumable parameters. This situation is mainly caused by the particular distribution of NRG corpus, since there exist many universal replies composed of high-frequent words in corpus. Consequently, the model tends to promotes such universal replies, regardless of the given query.
+
+# 3 MAX-MARGINAL RANKING REGULARIZATION
+
+As discussed above, various responses corresponding to the same query appearing in the training data leads to the undesired preference of NRG on universal replies, so an intuitive solution is removing the multiple replies and just keeping one-to-one pairs. However, filtering the training dataset in large scale raises the difficulty of model training. Besides, naively removing the multiple replies is detrimental to the reply diversity, which is important in NRG task. As shown in Table 1, an ideal chatbot agent is prospected to provide all listed replies and build a connection with some keywords such as ‘film’, ‘background’, ‘director’ and ‘book’, rather than other commonly appeared words like ‘I’, ‘him’, ‘a’ and ‘really’.
+
+Thus, under this assumption, we propose a max-marginal ranking loss to emphasize the queries’ impact on these less common but relevant words. During training, as it becomes a necessity to constrain the learned feature space and reinforce related replies with more discriminative information, we classify the candidate responses into two categories: positive (i.e., highly related) and negative (i.e., irrelevant) answers. A training instance is re-constructed as a triplet $( x , y , y ^ { - } )$ , where a tuple $( x , y )$ is the original query-response pair and noise $y ^ { - }$ is uniformly sampled from all of the responses in the training data. Given that, the model’s loss function is reconstructed as:
+
+$$
+\ell _ { \theta } = - \log p ( y | x ) + \lambda \operatorname* { m a x } \{ 0 , - \log p ( y | x ) + \log p ( y ^ { - } | x ) + \gamma \}
+$$
+
+where $\gamma > 0$ , $\log p ( y | x )$ denotes the cross-entropy loss between the model’s prediction and ground truth sequences, and the second part encourages the separation between the irrelevant responses and related replies. Moreover, the hyper-parameter $\lambda$ defines the penalty for the seq2seq loss, it offers a degree of freedom to control the importance of the max-marginal between the positive and negative instances. The model is trained in the same setting as the conventional model when $\lambda = 0$ .
+
+The gradient of $\ell _ { \theta }$ is computed using the sub-gradient method, as the second term is nondifferentiable but convex (Agarwal & Collins, 2010). Supposing $\log p ( y | x ) - \log p ( y ^ { - } | x ) \leq \gamma$ , the gradient of the composed loss function can be formalized as:
+
+$$
+\nabla _ { \boldsymbol { \theta } } \ell _ { \boldsymbol { \theta } } = - \nabla _ { \boldsymbol { \theta } } \log { p ( \boldsymbol { y } | \boldsymbol { x } ) } ,
+$$
+
+If $\log p ( y | x ) - \log p ( y ^ { - } | x ) > \gamma$ , then the gradient should be written as:
+
+$$
+\nabla _ { \boldsymbol { \theta } } \ell _ { \boldsymbol { \theta } } = - ( \lambda + 1 ) \nabla _ { \boldsymbol { \theta } } \log p ( \boldsymbol { y } | \boldsymbol { x } ) + \lambda \nabla _ { \boldsymbol { \theta } } \log p ( \boldsymbol { y } ^ { - } | \boldsymbol { x } ) .
+$$
+
+The underlying motivation of our proposed loss function is based on three considerations: 1) Universal replies are more likely to be sampled from a statistical perspective, so adding a negative term would directly ease the weight of these generic responses, and the ranking regularization can penalize those irrelevant responses; 2) Positive and negative sentences overall share a same set of generic words, which suggests that the loss optimization should pay more attention on those different words rather than generic ones; 3) Only differentiable loss can solely be served as the model’s optimization goal for the sequence generation model. Furthermore, the newly proposed loss aims to penalize frequent words and irrelevant candidates, rather than repudiating the literal expression included in negative samples. Consequently, based on these considerations, we propose this term as a regularization to constrain the search space of parameters instead of the stand-alone loss function.
+
+Table 2: Dataset statistics. For multiple replies, the three values represent the percentages of queries with one, two, and more than two responses, respectively. For the out of vocabulary (OOV) columns, the number in front of “/” denotes the percentage rate of the query, and the other one denotes replies.
+
+
# train
# valid
#test
QA Pairs
5,982,868
315,136
315,136
Unique Replies
4,499,176
298,723
287,312
Multi Replies(%)
70/24/6
97/2/1
96/3/1
0OV (%)
.90/.90
.92/.93
.91/.92
Vocab Size
29241/27859
+
+# 4 EXPERIMENTAL STUDIES
+
+4.1 EXPERIMENTAL SETUPS
+
+# 4.1.1 DATASET DESCRIPTION
+
+The dataset used in this study contained almost ten million query and response pairs collected from a popular Chinese social media site: Douban Group Chat1. All case studies used in this paper were extracted from this dataset and translated into English.
+
+For easier training and better efficiency, the maximal lengths of queries and replies were set to 30 and 50 respectively. In all of our experiments, our dataset was split into the training, validation and test sets, with detailed statistical characterization given in Table 2. Thirty percent of queries had more than one responses, and each answer appeared about 1.33 times in the training dataset, which is consistent with our hypothesis in the analysis section.
+
+# 4.1.2 BASELINE MODELS
+
+To validate the performance of the proposed model, the following baselines were considered:
+
+• S2SA: The basic seq2seq model with attention mechanism (Bahdanau et al., 2015) at the target output side.
+• $\mathrm { S } 2 \mathrm { S A } + \mathrm { M M I }$ : The best performing model in Li et al. (2016b) with the length norm based on the same S2SA.
+• Ranking-Reg: The seq2seq model with proposed ranking regularization and attention. In this model, negative samples were uniformly sampled from the corpus, and the process was repeated 4 times for every positive case. The averaged negative loss was calculated as the probability of universal replies.
+• Ranking- $\mathbf { \nabla \cdot R e g + M M I }$ : Ranking-Reg with MMI during inference procedure.
+
+# 4.1.3 EVALUATION METRICS
+
+The quality of response was measured using both numeric metrics and human annotators. Firstly, Word Perplexity (PPL) is used to measure the model’s ability to account for the syntactic structure for each utterance (Serban et al., 2016). Secondly, ROGUE score (Lin, 2004), which evaluates the extent of overlapping words between the ground-truth and predicted replies, was also adopted in experiments. Thirdly, we employed the widely used diversity measurements Distinct-1 and Distinct2 to evaluate the number of distinct Unigrams and Bigrams of generated responses (Li et al., 2016b).
+
+Furthermore, we recruited three highly educated human annotators to cross verify the quality of generated responses. We randomly sampled 100 queries and generated 10 replies for each query using different models, with beam size set to 10. The labeled results were categorized into three degree (Xing et al., 2017; Mou et al., 2016):
+
+Table 3: Summarized results of testing set with metrics: Human Label, ROGUE-1, ROGUE-L, Distinct-1, Distinct-2 and PPL.
+
+
Methods
Human Label
ROUGE
Distinct
PPL
0
1
2
ROUGE-1
ROUGE-L
1
2
S2SA
52.46%
20.52%
27.02%
4.97%
3.13%
.129
.285
110.0
S2SA +MMI
51.88%
19.92%
28.20%
3.96%
2.77%
.140
.312
110.0
Rank-Reg
48.20%
15.38%
36.42%
3.45%
2.55%
.163
.358
85.6
Rank-Reg + MMI
47.40%
18.75%
33.85%
3.43%
2.63%
.167
.345
85.6
+
+0: The response cannot be used as a reply to the message. It is either semantically irrelevant or not fluent (e.g., with grammatical errors or UNK).
+
+1: The response can be used as a reply to the message, which includes the universal replies such as “Yes, I see” , “Me too” and “I dont know”.
+
+2: The response is not only relevant and natural, but also informative and interesting.
+
+# 4.1.4 TRAINING PROCEDURES
+
+For all of the models, LSTM was chosen as the recurrent cell, and there were 512 hidden units for both the encoder and decoder (Greff et al., 2017). Embedding size and batch size were set to 200 and 20 respectively. The Adam algorithm was employed for gradient optimization (Kingma & Ba, 2015), and the initial learning rate was 1e-4. All of the models were implemented in Theano (Theano Development Team, 2016), and each ran on a standalone K40m GPU device for 7 epochs, which took 7 days; twice longer time was required for training models with rank regularization.
+
+
+Figure 2: Learning curve for the two models.
+
+The last two models with the rank regularization share the related hyper-parameters. We set $\lambda$ to 0.1 and $\gamma$ to 0.18, according to the model’s performance on the validation set.
+
+Fig. 2 shows cross-entropy loss flows vs. training epoch numbers. The model with max-marginal ranking regularization converges faster than S2SA throughout the training. This shows that the additional regularization term helps to speed up the fitting by removing these sub-optimal paths.
+
+# 4.2 RESULTS AND ANALYSIS
+
+# 4.2.1 EXPERIMENTAL RESULTS.
+
+The performance of four models on existing metrics is summarized in Table 3. The model with the max-marginal ranking regularization outperforms the model with primary loss function on the target loss PPL. As the MMI method is performing during inference, losses of models with MMI are identical to those without revision.
+
+However, the results are opposite regarding the ROGUE scores. The generated responses by the S2SA model contain more words appearing in the ground truth answers. These experimental results can be attributed to mainly two factors. a) The very low ROUGE scores reflect few words shared by any predictions and the ground truth. Most n-gram overlaps belonging to the common words, such as “I”, “are”, “that”. b) A certain proportion of replies in the test set are universal themselves. Therefore, S2SA has achieved higher ROUGE score as its’ results are more consistent with those common ground truth responses.
+
+University are far away, and the city's most famous commercial street are near to me.Query:
+
+# Replies from $\mathbf { S } 2 \mathbf { S } + .$ Attention:
+
+# Replies from Ranking Loss :
+
+1) Where is your home?
+2) Where is your city?
+3) Where is your location?
+4) Where is your hometown?
+5) Where is your city, hn?
+6) Where is your location?
+7) Where is your home, mine
+1) Joy City Shopping mall?
+2) Is shopping mall?
+3) Joy City Shopping mall!
+4) Where is your location?
+5) Where?
+6) Near that road.
+7) That Joy City shopping mall is great.
+
+
+
+Most Banks are not reliable.Query:
+
+# Replies from $\mathbf { S } 2 \mathbf { S } +$ Attention:
+
+# Replies from Ranking Loss :
+
+
+Figure 3: Response re-rank capability. Responses generated by the basic model and model with rank loss are linked by arrows, and same topics are typeset using the same color. Some ungrammatical and incomprehensible sentences exist due to the translating try to keep the word order.
+
+The human evaluation is the most important metric, and it is clear from Table 3 that the models with rank regularization beat S2SA with a large margin. It increases the number of meaningful responses by around $10 \%$ and reduces the number of irrelevant cases by around $4 \%$ . Meanwhile, most the acceptable replies (labeled as “1” or “2”) of S2SA is labeled as “1”, which indicates the model prefer the safe responses. We attribute the gaps to the promotion of highly related words and reducing of the universal replies. Same trend can be also spotted on Distinct-1 and Distinct-2, it reveals the model’s ability to generate diverse responses (Li et al., 2016b; Serban et al., 2015). The seq2seq model yields lower levels of unigram and bigram diversity than the rank loss model.
+
+As another comparison, we note that the improvement introduced by MMI is much smaller than that introduced by the ranking regularization, whereas MMI is a widely used mechanism for promoting diverse responses during inference. Besides, performing it upon the regularization reduces the rate of informative and interesting responses. This observation indicates that the fundamental reason behind generating tasteless or inappropriate replies is that Seq2Seq model learned from conversational corpora prefers universal replies. Moreover, the revision during the greedy search is less effective on solving the underlying problems than the proposed ranking regularization.
+
+# 4.2.2 RANKING LOSS FOR GENERIC RESPONSES.
+
+From the generated results, it is found that the seq2seq model with the ranking regularization term prefers meaningful content when the query contains sufficient amount of information. We present top responses for two queries generated by different models in Fig. 3. As shown in the first case, user posts a query which initiates a complicated discussion about locations. It is observed that S2SA converges to a typical “where is your” pattern of replies when discussing locations, which is an example of universal replies. As the greedy beam search strategy is utilized during inference, many location-related constraints further promote these relevant universal replies instead of more varied results from different beams. In contrast, some of the responses in the right column captured the “commercial street” clues and inferred a possible location “Joy City shopping mall” demoting the generic beams results. We attributed this to the boosting ability associated with semantically relevant words, as mentioned in Section 3.
+
+The second case is quite different. In this case, the seq2seq model did not perform satisfactorily. Even though the subject “bank” was extracted into the generated candidates, we cannot perceive the results aligned with the same “not reliable” topic, and most of them were just chosen from two beams. Inspecting the replies generated by the rank loss model, we found that more complicated and diverse sentences that discuss “unreliable” can be generated, and irrelevant answers about “bank” are lower-ranked. To further investigate the difference brought by the max-marginal ranking regularization, we randomly sampled more cases shown in the Fig. 4 as appendix. Even though some of them were bad cases and contained some grammatical errors, overall the model with rank regularization tends to generate more informative and interesting sentences compared with baselines.
+
+In conclusion, the seq2seq model with rank regularization can not only formulate the conditional language model but also boost related answers to higher ranks than the rest of universal or inappropriate replies.
+
+# 5 RELATED WORK
+
+Recent years have witnessed the rapid development of data-driven dialog models with the help of accumulated conversational data from online communities. Query-response pairs are modeled by Seq2Seq models with attention mechanism (Sutskever et al., 2014; Serban et al., 2016; Bahdanau et al., 2015), and NRG model are designed to maximize the likelihood of target response given the source query. As there exist various reasonable responses given a query, some researches conclude that the limited information in many queries constrains the model inference, which makes the NRG models prefer universal replies (Shao et al., 2017; Mou et al., 2016).
+
+To address this issue, various works are conducted on bringing more information to Seq2Seq models. Some works focus on constraining the replies with topic information or keywords (Mou et al., 2016; Xing et al., 2017; Wang et al., 2017; Wu et al., 2018). Other researchers argue that diverse responses are buried by the greedy beam-search rules (Li et al., 2016b), so their works mainly focus on involving more punishment or randomness in the inference stages. For example, Li et al. (2016b) constrain the search space using mutual information with the query, while Shao et al. (2017) randomly chose candidate words from top beams to constrain short phrases. These existing works mainly focus on the generation strategies during inference, in contrast, the model’s architecture and loss function have rarely been explored.
+
+Serban et al. (2017) introduce to model the underlying distribution over possible replies directly with supposing various latent variables to affect the response generation. Shen et al. (2017) further constructs a variational lower bound for response constraint. During inference, these models generate responses by first sampling an assignment of latent variables, so that models can generate more diverse responses. Such methods attempt to improve the diversity of responses by modifying the Seq2Seq architecture, and our analysis may be also helpful to design more effective latent variable based models to restrain current problems. Besides, the ranking penalty has also been used by Wiseman & Rush (2016), they employ a word-level margin to promote ground-truth sequences appearing in the beam search results. Different from our method, they directly optimize the beam search procedure to fine-tune the trained model.
+
+# 6 CONCLUSION
+
+Eliminating generic responses is the essence for the widely practical utilization of the Seq2Seq based neural response generation architectures, and thus, this paper has conducted a thorough investigation on the cause of such uninformative responses and proposed the solution from the statistical perspective. The main contributions of this work can be summarized as follows: a) The theoretical analysis is performed to capture the root reason of NRG models producing generic responses through the optimization goal of models and the statistical characteristics of human-to-human conversational corpora, which has been little studied currently. In detail, we have decomposed the goal of NRG into the optimizations of word selection and word ordering, and finally derived that NRG models tend to select common words as responses and order words from the language model perspective which ignores queries. b) According to the analysis, a max-marginal ranking regularization term is proposed to cooperate with the learning target of Seq2Seq, so as to help NRG models converge to the status of producing informative responses, rather than merely manipulating the decoding procedure to constrain the generation of universal replies. Furthermore, the empirical experiments on the conversation dataset indicate that the models utilizing this strategy notably outperform the current baseline models.
+
+# REFERENCES
+
+Shivani Agarwal and Michael Collins. Maximum margin ranking algorithms for information retrieval. In Proc. of ECIR, pp. 332–343, 2010.
+
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015.
+
+Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. ISBN 0521833787.
+
+Klaus Greff, Rupesh K Srivastava, Jan Koutn´ık, Bas R Steunebrink, and Jurgen Schmidhuber. Lstm: ¨ A search space odyssey. IEEE transactions on neural networks and learning systems, 28(10): 2222–2232, 2017.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. international conference on learning representations, 2015.
+
+Chaozhuo Li, Yu Wu, Wei Wu, Chen Xing, Zhoujun Li, and Ming Zhou. Detecting context dependent messages in a conversational environment. In Proc. of COLING, pp. 1990–1999, 2016a.
+
+Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. In Proc. of NAACL-HLT, pp. 110–119, 2016b.
+
+Jiwei Li, Michel Galley, Chris Brockett, Georgios P. Spithourakis, Jianfeng Gao, and William B. Dolan. A persona-based neural conversation model. In Proc. of ACL, pp. 994–1003, 2016c.
+
+Jiwei Li, Will Monroe, and Dan Jurafsky. A simple, fast diverse decoding algorithm for neural generation. CoRR, abs/1611.08562, 2016d.
+
+Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Proc. of ACL workshop, volume 8, 2004.
+
+Christopher Maning, Prabhaker Raghavan, and Hinrich Schtze. An introduction to information retrieval. 2009.
+
+Lili Mou, Yiping Song, Rui Yan, Ge Li, Lu Zhang, and Zhi Jin. Sequence to backward and forward sequences: A content-introducing approach to generative short-text conversation. In Proc. of COLING, pp. 3349–3358, 2016.
+
+Ramesh Nallapati, Bowen Zhou, C´ıcero Nogueira dos Santos, C¸ aglar Gulc¸ehre, and Bing Xiang. ¨ Abstractive text summarization using sequence-to-sequence rnns and beyond. In Proc. of CoNLL, pp. 280–290, 2016.
+
+Alan Ritter, Colin Cherry, and William B. Dolan. Data-driven response generation in social media. In Proc. of EMNLP, pp. 583–593, 2011.
+
+Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. empirical methods in natural language processing, pp. 379–389, 2015.
+
+Iulian Vlad Serban, Ryan Lowe, Peter Henderson, Laurent Charlin, and Joelle Pineau. A survey of available corpora for building data-driven dialogue systems. CoRR, abs/1512.05742, 2015.
+
+Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In Proc. of AAAI, pp. 3776–3784, 2016.
+
+Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, pp. 3295–3301, 2017.
+
+Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. In Proc. of ACL, pp. 1577–1586, 2015.
+
+Yuanlong Shao, Stephan Gouws, Denny Britz, Anna Goldie, Brian Strope, and Ray Kurzweil. Generating high-quality and informative conversation responses with sequence-to-sequence models. In Proc. of EMNLP, pp. 2210–2219, 2017.
+
+Xiaoyu Shen, Hui Su, Yanran Li, Wenjie Li, Shuzi Niu, Yang Zhao, Akiko Aizawa, and Guoping Long. A conditional variational framework for dialog generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 504–509, 2017.
+
+Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proc. of NIPS, pp. 3104–3112, 2014.
+
+Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016.
+
+Oriol Vinyals and Quoc V. Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015.
+
+Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In Proc. of ICLR, 2016.
+
+Di Wang, Nebojsa Jojic, Chris Brockett, and Eric Nyberg. Steering output style and topic in neural response generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2140–2150, 2017.
+
+Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In Proc. of EMNLP, pp. 1296–1306, 2016.
+
+Yu Wu, Wei Wu, Zhoujun Li, Can Xu, and Dejian Yang. Neural response generation with dynamic vocabularies. national conference on artificial intelligence, 2018.
+
+Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In Proc. of AAAI, pp. 3351–3357, 2017.
+
+George Kingsley Zipf. The psychobiology of language. 1935.
+
+# A CASES
+
+What should I do?Query:
+
+# Replies form S2S+Attention:
+
+1) Do nothing.
+2) Go on.
+3) Do nothing, hm.
+4) How?
+5) Do nothing do nothing.
+6) Then go ahead.
+7) So how do you do?
+
+# Replies from Ranking Loss :
+
+1) Do nothing.
+2) Do nothing.
+3) Go to sleep.
+4) Don’t worry.
+5) You should keep on.
+6) Then go ahead.
+7) Keep finding.
+
+How about the salary?Query:
+
+# Replies from S2S+Attention:
+
+1) negotiable
+2) Salary negotiable.
+3) Salary negotiable.
+4) Salary negotiable!
+5) Salary and payment negotiable.
+6) Payment is nice.
+7) Payment is nice, and salary negotiable.
+
+# Replies from Ranking Loss :
+
+1) Salary negotiable.
+2) Salary negotiable.
+3) High salary.
+4) Basic salary and plus
+5) Salary negotiable!
+6) Salary and payment negotiable.
+7) Payment is nice, send your CV.
+
+I’m 23, why I’m still in growth?Query:
+
+# Replies from S2S+Attention:
+
+1) 23
+2) 22.
+3) 21.
+4) 20.
+5) 25.
+6) 23 years old.
+7) 22 years old.
+
+# Replies from Ranking Loss :
+
+1) 23.
+2) 23.
+3) just 23.
+4) just 22.
+5) 23 years old are not
+6) 23 years old are not old
+7) 23 years old are not old!
+
+Where are you graduate?Query:
+
+# Replies from S2S+Attention:
+
+1) Xi’an.
+2) Wuhan.
+3) .
+4) Nanjing.
+5) Junior.
+6) In Junior.
+7) In junior junior Shanghai.
+
+# Replies from Ranking Loss :
+
+1) Peking.
+2) Chengdu.
+3) Xi’an.
+4) In Chengdu.
+5) I study in Chengdu.
+6) I study in Shanghai.
+7) I study in Beijing.
+
+My child is born.Query:
+
+# Replies from S2S+Attention:
+
+# Replies from Ranking Loss :
+
+1) .
+2) born.
+3) born baby.
+4) children born.
+5) born born children.
+6) born born born children.
+7) born children born children.
+1) ok
+2) Cheers!
+3) Em.
+4) ok, born child.
+5) cheers, congulations!
+6) born born born children.
+7) born children born children.
+
+Figure 4: Cases for comparing the S2SA and the model with ranking regularization, and the topics or expressions of the generated replies marked with blue are excluded in the responses generated by SASA.
\ No newline at end of file
diff --git a/md/train/H1lmhaVtvr/H1lmhaVtvr.md b/md/train/H1lmhaVtvr/H1lmhaVtvr.md
new file mode 100644
index 0000000000000000000000000000000000000000..04a20c3a7d223a2283a343b00ec68023dc780cee
--- /dev/null
+++ b/md/train/H1lmhaVtvr/H1lmhaVtvr.md
@@ -0,0 +1,323 @@
+# DYNAMICAL DISTANCE LEARNING FOR SEMI-SUPERVISED AND UNSUPERVISED SKILL DISCOVERY
+
+Kristian Hartikainen∗ University of California, Berkeley University of Oxford
+
+Xinyang Geng University of California, Berkeley
+
+Tuomas Haarnoja†
+University of California, Berkeley
+Google DeepMind
+
+Sergey Levine† University of California, Berkeley
+
+# ABSTRACT
+
+Reinforcement learning requires manual specification of a reward function to learn a task. While in principle this reward function only needs to specify the task goal, in practice reinforcement learning can be very time-consuming or even infeasible unless the reward function is shaped so as to provide a smooth gradient towards a successful outcome. This shaping is difficult to specify by hand, particularly when the task is learned from raw observations, such as images. In this paper, we study how we can automatically learn dynamical distances: a measure of the expected number of time steps to reach a given goal state from any other state. These dynamical distances can be used to provide well-shaped reward functions for reaching new goals, making it possible to learn complex tasks efficiently. We show that dynamical distances can be used in a semi-supervised regime, where unsupervised interaction with the environment is used to learn the dynamical distances, while a small amount of preference supervision is used to determine the task goal, without any manually engineered reward function or goal examples. We evaluate our method both on a real-world robot and in simulation. We show that our method can learn to turn a valve with a real-world 9-DoF hand, using raw image observations and just ten preference labels, without any other supervision. Videos of the learned skills can be found on the project website: https://sites.google.com/view/dynamical-distance-learning.
+
+# 1 INTRODUCTION
+
+The manual design of reward functions represents a major barrier to the adoption of reinforcement learning (RL), particularly in robotics, where vision-based policies can be learned end-toend (Levine et al., 2016; Haarnoja et al., 2018c), but still require reward functions that themselves might need visual detectors to be designed by hand (Singh et al., 2019). While in principle the reward only needs to specify the goal of the task, in practice RL can be exceptionally time-consuming or even infeasible unless the reward function is shaped so as to provide a smooth gradient towards a successful outcome. Prior work tackles such situations with dedicated exploration methods (Houthooft et al., 2016; Osband et al., 2016; Andrychowicz et al., 2017), or by using large amounts of random exploration (Mnih et al., 2015), which is feasible in simulation but infeasible for real-world robotic learning. It is also common to employ heuristic shaping, such as the Cartesian distance to a goal for an object relocation task (Mahmood et al., 2018; Haarnoja et al., 2018a). However, this kind of shaping is brittle and requires manual insight, and is often impossible when ground truth state observations are unavailable, such as when learning from image observations.
+
+
+Figure 1: We present a dynamical distance learning (DDL) method that can learn a 9-DoF real-world dexterous manipulation task directly from raw image observations. DDL does not assume access to the true reward function and solves the 180 degree valve-rotation task in 8 hours by relying only on 10 human-provided preference labels.
+
+In this paper, we aim to address these challenges by introducing dynamical distance learning (DDL), a general method for learning distance functions that can provide effective shaping for goal-reaching tasks without manual engineering. Instead of imposing heuristic metrics that have no relationship to the system dynamics, we quantify the distance between two states in terms of the number of time steps needed to transition between them. This is a natural choice for dynamical systems, and prior works have explored learning such distances in simple and low-dimensional domains (Kaelbling, 1993). While such distances can be learned using standard model-free reinforcement learning algorithms, such as Q-learning, we show that such methods generally struggle to acquire meaningful distances for more complex systems, particularly with high-dimensional observations such as images. We present a simple method that employs supervised regression to fit dynamical distances, and then uses these distances to provide reward shaping, guide exploration, and discover distinct skills.
+
+The most direct use of DDL is to provide reward shaping for a standard deep RL algorithm, to optimize a policy to reach a given goal state. We can also formulate a semi-supervised skill learning method, where a user expresses preferences over goals, and the agent autonomously collects experience to learn dynamical distances in a self-supervised way. Finally, we can use DDL in a fully unsupervised method, where the most distant states are selected for exploration, resulting in an unsupervised reinforcement learning procedure that discovers difficult skills that reach dynamically distant states from a given start state. All of these applications avoid the need for manually designed reward functions, demonstrations, or user-provided examples, and involve minimal modification to existing deep RL algorithms.
+
+DDL is a simple and scalable approach to learning dynamical distances that can readily accommodate raw image inputs and, as shown in our experiments, substantially outperforms prior methods that learn goal-conditioned policies or distances using approximate dynamic programming techniques, such as Q-learning. We show that using dynamical distances as a reward function in standard reinforcement learning methods results in policies that take the shortest path to a given goal, despite the additional shaping. Empirically, we compare the semi-supervised variant of our method to prior techniques for learning from preferences. We also compare our method to prior methods for unsupervised skill discovery on tasks ranging from 2D navigation to quadrupedal locomotion. Our experimental evaluation demonstrates that DDL can learn complex locomotion skills without any supervision at all, and that the preferences-based version of DDL can learn to turn a valve with a real-world 9-DoF hand, using raw image observations and 10 human-provided preference labels, without any other supervision.
+
+# 2 RELATED WORK
+
+Dynamical distance learning is most closely related to methods that learn goal-conditioned policies or value functions (Schaul et al., 2015; Sutton et al., 2011). Many of these works learn goal-reaching directly via model-free RL, often by using temporal difference updates to learn the distance function as a value function (Kaelbling et al., 1996; Schaul et al., 2015; Andrychowicz et al., 2017; Pong et al., 2018; Nair et al., 2018; Florensa et al., 2019). For example, Kaelbling (1993) learns a goal conditioned Q-function to represent the shortest path between any two states, and Andrychowicz et al. (2017) learns a value function that resembles a distance to goals, under a user-specified lowdimensional goal representation. Unlike these methods, DDL learns policy-conditioned distances with an explicit supervised learning procedure, and then employs these distances to recover a reward function for RL. We experimentally compare to RL-based distance learning methods, and show that
+
+DDL attains substantially better results, especially with complex observations. Another line of prior work uses a learned distance to build a search graph over a set of visited states (Savinov et al., 2018; Eysenbach et al., 2019), which can then be used to plan to reach new states via the shortest path. Our method also learns a distance function separately from the policy, but instead of using it to build a graph, we use it to obtain a reward function for a separate model-free RL algorithm.
+
+The semi-supervised variant of DDL is guided by a small number of preference queries. Prior work has explored several ways to elicit goals from users, such as using outcome examples and a small number of label queries (Singh et al., 2019), or using a large number of relatively cheap preferences (Christiano et al., 2017). The preference queries that our semi-supervised method uses are easy to obtain and, in contrast to prior work (Christiano et al., 2017), we only need a small number of these queries to learn a policy that reliably achieves the user’s desired goal. Our method is also well suited for fully unsupervised learning, in which case DDL uses the distance function to propose goals for unsupervised skill discovery. Prior work on unsupervised reinforcement learning has proposed choosing goals based on a variety of unsupervised criteria, typically with the aim of attaining broad state coverage (Nair et al., 2018; Florensa et al., 2018; Eysenbach et al., 2018; Warde-Farley et al., 2018; Pong et al., 2019). Our method instead repeatedly chooses the most distant state as the goal, which produces rapid exploration and quickly discovers relatively complex skills. We provide a comparative evaluation in our experiments.
+
+# 3 PRELIMINARIES
+
+In this work, we study control of systems defined by fully observed Markovian dynamics $p ( \mathbf { s } ^ { \prime } | \mathbf { s } , \mathbf { a } ) :$ $s \times s \times { \mathcal { A } } \to { \mathbb { R } } _ { > 0 }$ , where $s$ and $\mathcal { A }$ are continuous state and action spaces. We aim to learn a stochastic policy $\pi ( \mathbf { \bar { a } } | \mathbf { s } ) : \mathcal { A } \times \mathcal { S } \to \mathbb { R } _ { \geq 0 }$ , to reach a goal state $\mathbf { g } \in { \mathcal { S } }$ . We will denote a trajectory with $\boldsymbol { \tau } \triangleq ( \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , . . . , \mathbf { s } _ { T } ) \sim \rho _ { \pi }$ , where $\rho _ { \pi }$ is a the trajectory distribution induced by the policy $\pi$ , and $\mathbf { s } _ { 0 }$ is sampled from an initial state distribution $\rho ( \mathbf { s } _ { 0 } )$ . The policy can be optimized using any reinforcement learning algorithm by maximizing
+
+$$
+\mathcal { L } ( \pi ) = \mathbb { E } _ { \tau \sim \rho _ { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { \mathbf { g } } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] ,
+$$
+
+where $r _ { \mathbf { g } } : \mathcal { S } \times \mathcal { A } [ - R _ { \operatorname* { m i n } } , R _ { \operatorname* { m a x } } ]$ is a bounded reward function and $\gamma \in [ 0 , 1 )$ is a discount factor.1 However, we do not assume that we have access to a shaped reward function. In principle, we could set the reward to $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) = 0$ if $\mathbf { s } = \mathbf { g }$ and $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) = - 1$ otherwise to learn a policy to reach the goal in as few time steps as possible. Unfortunately, such a sparse reward signal is extremely hard to optimize, as it does not provide any gradient towards the optimal solution until the goal is actually reached. Instead, in Section 4, we will show that we can efficiently learn to reach goals by making use of a learned dynamical distance function.
+
+# 4 DYNAMICAL DISTANCE LEARNING
+
+The aim of our method is to learn policies that reach goal states. These goal states can be selected either in an unsupervised fashion, to discover complex skills, or selected manually by the user. The learning process alternates between two steps: in the distance evaluation step, we learn a policyspecific dynamical distance, which is defined in the following subsection. In the policy improvement step, the policy is optimized to reach the desired goal by using the distance function as the negative reward. This process will lead to a sequence of policies and dynamical distance functions that converge to an effective goal-reaching policy. Under certain assumptions, we can prove that this process converges to a policy that minimizes the distance from any state to any goal, as discussed in Appendix B. In this section, we define dynamical distances and describe our dynamical distance learning (DDL) procedure. In Section 5, we will describe the different ways that the goals can be chosen to instantiate our method as a semi-supervised or unsupervised skill learning procedure.
+
+# 4.1 DYNAMICAL DISTANCE FUNCTIONS
+
+The dynamical distance associated with a policy $\pi$ , which we write as $d ^ { \pi } ( \mathbf { s } _ { i } , \mathbf { s } _ { j } )$ , is defined as the expected number of time steps it took for $\pi$ to reach a state ${ \bf s } _ { j }$ from a state $\mathbf { s } _ { i }$ , given that the two were visited in the same episode.2 Mathematically, the distance is defined as:
+
+$$
+d ^ { \pi } ( \mathbf { s } , \mathbf { s } ^ { \prime } ) \triangleq \mathbb { E } _ { \tau \sim \pi | \mathbf { s } _ { i } = \mathbf { s } , \mathbf { s } _ { j } = \mathbf { s } ^ { \prime } , \ j \geq i } \left[ \sum _ { { t = i } } ^ { j - 1 } \gamma ^ { t - i } c ( \mathbf { s } _ { t } , \mathbf { s } _ { { t + 1 } } ) \right] ,
+$$
+
+where $\tau$ is sampled from the conditional distribution of trajectories that passes through first s and then $\mathbf { s } ^ { \prime }$ , and where $c$ is some local cost of moving from $\mathbf { s } _ { i }$ to $\mathbf { s } _ { i + 1 }$ . For example, in a typical case in the absence of supervision, we can set $c ( \mathbf { s } _ { t } , \mathbf { s } _ { t + 1 } ) \equiv 1$ analogously to the binary reward function in Equation 1, in which case the sum reduces to $j - i$ , and we recover the expected number of time steps to reach $\mathbf { s } ^ { \prime }$ . In principle, we could also trivially incorporate more complex local costs $c$ , for example to include action costs. This modification would be straightforward, though we focus on the simple $c ( \mathbf { s } _ { t } , \mathbf { s } _ { t + 1 } ) \equiv 1$ in our derivation and experiments. We include the discount factor to extend the definition to infinitely long trajectories, but in practice we set $\gamma = 1$ .
+
+# 4.2 DISTANCE EVALUATION
+
+In the distance evaluation step, we learn a distance function $d _ { \psi } ^ { \pi } ( { \bf s } , { \bf s } ^ { \prime } )$ , parameterized by $\psi$ , to estimate the dynamical distance between pairs of states visited by a given policy $\pi _ { \phi }$ , parameterized by $\phi$ . We first roll out the policy multiple times to sample trajectories $\tau _ { k }$ of length $T$ . The empirical distance between states $\mathbf { s } _ { i } , \mathbf { s } _ { j } \in \tau _ { k }$ , where $0 \leq i \leq j \leq T$ , is given by $j - i$ . Because the trajectories have a finite length, we are effectively ignoring the cases where reaching ${ \bf s } _ { j }$ from $\mathbf { s } _ { i }$ would take more than $T - i$ steps, biasing this estimate toward zero, but since the bias becomes smaller for shorter distances, we did not find this to be a major limitation in practice. We can now learn the distance function via supervised regression by minimizing
+
+$$
+\mathcal { L } _ { d } ( \psi ) = \frac { 1 } { 2 } \mathbb { E } _ { \stackrel { \tau \sim \rho _ { \pi } } { i \sim \left[ 0 , T \right] } } \left[ \left( d _ { \psi } ^ { \pi } ( \mathbf { s } _ { i } , \mathbf { s } _ { j } ) - ( j - i ) ) \right) ^ { 2 } \right] .
+$$
+
+As we will show in our experimental evaluation, this supervised regression approach makes it feasible to learn dynamical distances for complex tasks with raw image observations, something that has proven exceptionally challenging for methods that learn distances via goal-conditioned policies or value functions and rely on temporal difference-style methods. In direct comparisons, we find that such methods generally struggle to learn on the more complex tasks with image observations. On the other hand, a disadvantage of supervised regression is that it requires on-policy experience, potentially leading to poor sample efficiency. However, because we use the distance as an intermediate representation that guides off-policy policy learning, as we will discuss in Section 4.3, we did not find the on-policy updates for the distance to slow down learning. Indeed, our experiments in Section 6.1 show that we can learn a manipulation task on a real robot with roughly the same amount of experience as is necessary when using a well-shaped and hand-tuned reward function.
+
+# 4.3 POLICY IMPROVEMENT
+
+In the policy improvement step, we use $d _ { \psi } ^ { \pi }$ to optimize a policy $\pi _ { \phi }$ , parameterized by $\phi$ , to reach a goal g. In principle, we could optimize the policy by choosing actions that greedily minimize the distance to the goal, which essentially treats negative distances as the values of a value function, and would be equivalent to the policy improvement step in standard policy iteration. However, acting greedily with respect to the dynamical distance defined in Equation 2 would result in a policy that is optimistic with respect to the dynamics.
+
+This is because the dynamical distance is defined as the expected number of time steps conditioned on the policy successfully reaching the second state from the first state, and therefore does not account for the case where the second state is not reached successfully. In some cases, this results in pathologically bad value functions. For example, consider the MDP shown on the right, where the agent can reach the goal g using one of two paths. The first path has one intermediate state that leads to the target state with probability $p$ , and an absorbing terminal state $\mathbf { s _ { T } }$ with probability $1 - p$ . The other path has two intermediate states, but allows the agent to reach the target every time. The optimal dynamical distance will be 2, regardless of the value of $p$ , causing the policy to always choose the risky path and potentially miss the target completely.
+
+
+
+The definition of dynamical distances in Equation 2 follows directly from how we learn the distance function, by choosing both $\mathbf { s } _ { i }$ and ${ \bf s } _ { j }$ from the same trajectory. Conditioning on both $\mathbf { s } _ { i }$ and ${ \bf s } _ { j }$ is needed when the state space is continuous or large, since visiting two states by chance has zero or near-zero probability. We instead propose to use the distance as a negative reward, and apply reinforcement learning to minimize the cumulative distance on the path to the goal:
+
+$$
+\mathcal { L } _ { \pi } ( \phi ) = \mathbb { E } _ { \tau \sim \rho _ { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } d _ { \psi } ^ { \pi } ( \mathbf { s } _ { t } , \mathbf { g } ) \right] .
+$$
+
+This amounts to minimizing the cumulative distance over visited states, and thus taking a risky action becomes unfavourable if it takes the agent to a state that is far from the target at a later time. We further show that, under certain assumption, the policy that optimizes Equation 4 will indeed acquire the correct behavior, as discussed in Appendix A, and will converge to a policy that takes the shortest path to the goal, as we show in Appendix B.
+
+We note that our simulated experiments below are run in deterministic environments and we do not fully understand why cumulative distances work better than greedily minimizing the distances even in those cases. A comparison between these two cases is shown in Section 6.2.
+
+# 4.4 ALGORITHM SUMMARY
+
+The dynamical distance learning (DDL) algorithm is described in Figure 1. Our implementation uses soft actor-critic (SAC) (Haarnoja et al., 2018c) as the policy optimizer, but one could also use any other off-the-shelf algorithm. In each iteration, DDL first samples a trajectory using the current policy, and saves it in a replay pool $\mathcal { D }$ . In the second step, DDL updates the distance function by minimizing the loss in Equation 3. The distance function is optimized for a fixed number of $N _ { d }$ stochastic gradient steps. Note that this method requires that we use recent experience from $\mathcal { D }$ , so
+
+# Algorithm 1 Dynamical Distance Learning
+
+1: Input: φ, ψ . Initial policy and distance parameters
+2: Input: D . Empty replay pool repeat $\tau \sim \rho _ { \pi }$ , $\mathcal { D } \mathcal { D } \cup \tau$ . Sample a new trajectory for $i = 0$ to $N _ { d }$ do $\psi \psi - \lambda _ { d } \hat { \nabla } \mathcal { L } _ { d } ( \psi ; \pi )$ . Minimize distance loss end for $\mathbf { g } $ choose goal $( \mathcal { D } )$ . Choose goal state for $i = 0$ to $N _ { \pi }$ do
+10: $\phi \phi - \dot { \lambda } _ { \pi } \hat { \nabla } \mathcal { L } _ { \pi } ( \phi ; d , \mathbf { g } ) \circ$ . Minimize policy loss
+11: end for
+12: until converged
+
+as to learn the distance corresponding to the current policy. In the third step, DDL chooses a goal state from the recent experience buffer. We will describe two methods to choose these goal states in Section 5. In the fourth step, DDL updates the policy by taking $N _ { \pi }$ gradient steps to minimize the loss in Equation 4. The implementation of this step depends on the RL algorithm of choice. These steps are then repeated until convergence.
+
+# 5 GOAL PROPOSALS
+
+In the previous section, we discussed how we can utilize a learned distance function to efficiently optimize a goal-reaching policy. However, a learned distance function is only meaningful if evaluated at states from the distribution it has been trained on, suggesting that the goal states should be chosen from the replay pool. Choosing a goal that the policy can already reach might at first appear strange, but it turns out to yield efficient directed exploration, as explained next.
+
+Simple random exploration, such as $\epsilon$ -greedy exploration or other strategies that add noise to the actions, can effectively cover states that are close to the starting state, in terms of dynamical distance. However, when high-reward states or goal states are far away from the start state, such na¨ıve strategies are unlikely to reach them. From this observation, we can devise a simple and effective exploration strategy that leverages the learned dynamical distances: we first use the policy to reach a known goal as quickly as possible and then explore the vicinity of that goal. This way more time is
+
+
+Figure 2: We evaluate our method both in simulation and on a real-world robot. We show that our method can learn to turn a valve with a real-world 9-DoF hand (a), and run ablations in the simulated version of the same task (b). We also demonstrate that our method can learn pole balancing (c) and locomotion (d, e, f) skills in simulation.
+
+left to randomly explore states far from the initial state and this way likely discovering useful states.
+We propose two different strategies for choosing the goals below.
+
+# 5.1 SEMI-SUPERVISED LEARNING FROM PREFERENCES
+
+DDL can be used to learn to reach specific goals elicited from a user. The simplest way to do this is for a user to provide the goal state directly, either by specifying the full state, or selecting the state manually from the replay pool. However, we can also provide a more convenient way to elicit the desired state with preference queries. In this setting, the user is repeatedly presented with a small slate of candidate states from the replay pool, and asked to select the one that they prefer most. In practice, we present the user with a visualization of the final state in several of the most recent episodes, and the user selects the one that they consider closest to their desired goal.
+
+For example, if the user wishes to train a legged robot to walk forward, they might pick the state where the robot has progressed the largest distance in the desired direction. The required user effort in selecting these states is minimal, and most of the agent’s experience is still unsupervised, simply using the latest user-chosen state as the goal. In our experiments, we show that this semi-supervised learning procedure, which we call dynamical distance learning from preferences (DDLfP) can learn to rotate a valve with real-world hand from just ten queries, and can learn simulated locomotion tasks using 100 simulated queries.
+
+# 5.2 UNSUPERVISED EXPLORATION AND SKILL ACQUISITION
+
+We can also use DDL to efficiently acquire complex behaviors, such as locomotion skills, in a completely unsupervised fashion. From the observation that many high-reward states are far away from the start state, we can devise a simple and effective exploration strategy that leverages our learned dynamical distances: we can simply select goals that are far from the initial state according to their estimated dynamical distance. We call this variant of our method “dynamical distance learning - unsupervised” (DDLUS).
+
+Intuitively, this method causes the agent to explore the “frontier” of hard-to-reach states, either discovering shorter paths for reaching them and thus making them no longer be on the frontier, or else finding new states further on the fringe through additive random exploration. In practice, we find that this allows the agent to quickly explore distant states in a directed fashion. In Section 6, we show that, by setting choose go $\begin{array} { r } { \mathrm { a l } ( \mathscr { D } ) \equiv \mathrm { \bar { a r g } m a x } _ { \mathbf { g } \in \mathscr { D } } d _ { \psi } ^ { \pi } ( \mathbf { s } _ { 0 } , \mathbf { g } ) } \end{array}$ , where $\mathbf { s } _ { 0 }$ is the initial state, we can acquire effective running gaits and pole balancing skills in a variety of simulated settings. While this approach is not guaranteed to discover interesting and useful skills in general, we find that, on a variety of commonly used benchmark tasks, this approach to unsupervised goal selection actually discovers behaviors that perform better with respect to the (unknown) task reward than previously proposed unsupervised reinforcement learning objectives.
+
+# 6 EXPERIMENTS
+
+Our experimental evaluation aims to study the following empirical questions: (1) Does supervised regression provide a good estimator of the true dynamical distance? (2) Is DDL applicable to realworld, vision-based robotic control tasks? (3) Does DDL provide an efficient method of learning skills a) from user-provided preferences, and b) completely unsupervised?
+
+We evaluate our method both in the real world and in simulation on a set of state- and visionbased continuous control tasks. We consider a 9-DoF real-world dexterous manipulation task and 4 standard OpenAI Gym tasks (Hopper-v3, HalfCheetah-v3, Ant-v3, and InvertedDoublePendulumv2). For all of the tasks, we parameterize our distance function as a neural network, and use soft actor-critic (SAC) (Haarnoja et al., 2018b) with the default hyperparameters to learn the policy. For state-based tasks, we use feed-forward neural networks and for the vision-based tasks we add a convolutional preprocessing network before these fully connected layers. The image observation for all the vision-based tasks are 3072 dimensional $3 2 \mathrm { x } 3 2$ RGB images). Further details are presented in Appendix E.
+
+We study question (1) using a simple didactic example involving navigation through a twodimensional S-shaped maze, which we present in Appendix C. The other two research questions are studied in the following sections.
+
+# 6.1 VISION-BASED REAL-WORLD MANIPULATION FROM HUMAN PREFERENCES
+
+To study the question (2), we apply DDLfP to a real-world vision-based robotic manipulation task. The domain consists of a 9-DoF “DClaw” hand introduced by Ahn et al. (2019), and the manipulation task requires the hand to rotate a valve 180 degrees, as shown in Figure 1. The human operator is queried for a preference every 10K environment steps. Both the visionand state-based experiments with the real robot use 10 queries during the first 4 hours of an 8- hour training period. Note that, for this and all the subsequent experiments, DDLfP does not have access to the true reward, and must learn entirely from preference queries, which in this case are provided by a human operator.
+
+Figure 3 presents the performance over the course of training. DDLfP uses 10 preference queries to learn the task and its performance is comparable to that of SAC trained with a ground truth shaped reward function. We also
+
+
+Figure 3: (Left) learning curves for the valve rotation task learned from state. (Right) Same task from vision. The curves correspond to the final distance (measured in radians) of the valve from the target angle during a rollout. Our method (DDLfP, orange) solves the task in 8 hours. Its performance is comparable to that of SAC with true rewards, and VICE with example outcome images. DDLfP only requires 10 preference queries, and learns without true rewards or outcome images. We compare our method in the simulated version of this task in Figure 5.
+
+show a comparison to variational inverse control with events (VICE) (Singh et al., 2019), a recent classifier-based reward specification framework. Instead of preference queries, VICE requires the user to provide examples of the desired goal state at the beginning of training (20 images in this case). For vision-based tasks, VICE involves directly showing images of the desired outcome to the user, which requires physically arranging a scene and taking a picture of it. Preferences, on the other hand, require a user to simply select one state out of a small set, which can be done with a button press and done e.g. remotely, thus often making it substantially less labor-intensive than VICE. As we can see in the experiments, DDLfP achieves similar performance with substantially less operator effort, using only a small number of preference queries. The series of goal preferences queried from the human operator are shown in Appendix D.
+
+# 6.2 ABLATIONS, COMPARISONS, AND ANALYSIS
+
+Next, we analyze design decisions in our method and compare it to prior methods in simulation. First, we replace the cumulative objective in Equation 4 with objective that greedily minimizes the distance function trained with supervised loss. This objective is unable to learn the task from either state or vision observations. Next, we replace the supervised loss in Equation 3 of our DDL method with a temporal difference (TD) Q-learning style update rule that learns dynamical distances with approximate dynamic programming. The results in Figure 5 show that, all else being equal, the TD-based method fails to learn successfully from both low-dimensional state and vision observations. Figure 5 further shows a comparison between using the dynamical distance as the reward in comparison to a reward of -1 for each step until the goal is reached, which corresponds to hindsight experience replay (HER) with goal sampling replaced with preference goals (Andrychowicz et al., 2017). We see that dynamical distances allow the policy to reach the goal when learning both from state and from images, while HER is only successful when learning from low-dimensional states.
+
+
+Figure 4: Learning curves for MuJoCo tasks with DDLfP. The y-axis presents the true return of the task. We compare DDLfP to SAC trained directly from the true reward function, which provides an oracle upper bound baseline, and the prior method proposed by Christiano et al. (2017). The prior method uses an on-policy RL algorithm which typically requires more samples than off-policy algorithms, and thus we also plot its final performance after 20M training steps with red star. At the time of the submission, the Ant-v3 run is still in progress and the complete learning curve will be included in the final.
+
+These results are corroborated by prior results in the literature that have found that temporal difference learning struggles to capture the true value accurately (Lillicrap et al., 2015; Fujimoto et al., 2018). Note that prior work work does not use the full state as the goal, but rather manually selects a low-dimensional subspace, such as the location of an object, forcing the distance to focus on task-relevant objects (Andrychowicz et al., 2017). Our method learns distances between full image states (3072-dimensional) while HER uses 3- dimensional goals, a difference of two orders of magnitude in dimensionality. This difficulty of learning complex image-based goals is further corroborated in prior work (Pong et al., 2018; Nair et al., 2018; Pong et al., 2019; WardeFarley et al., 2018).
+
+
+Figure 5: We compare DDL against alternative methods for learning distances on the simulated valve turning task, when learning from the underlying low-dimensional state (left) and from images (right). Dynamical distances used greedily (orange) or learned with TD (green) generally perform poorly. HER (red) can learn from lowdimensional states, but fails to learn from images. Our method, DDLfP (blue) successfully learns the task from either states or images.
+
+Figure 4 presents results for learning from preferences via DDLfP (in green) on a set of continuous control tasks to further study the question (3,a). The plots show the true reward for each method on each task. DDLfP receives only sparse preferences as task-specific supervision, and the preferences in this case are provided synthetically, choosing the state that has progressed the largest distance from the initial state in the desired direction, i.e. the state with largest x-coordinate value. However, this still provides substantially less supervision signal than access to the true reward for all samples. We compare to (Christiano et al., 2017), which also uses preferences for learning skills, but without the use of dynamical distances. The prior method is provided with 750 preference queries over the course of training, while our method uses 100 for all locomotion tasks, and only a single query for the InvertedDoublePendulum-v2, as the initial state and the goal states coincides.3 Note that Christiano et al. (2017) utilizes an on-policy RL algorithms, which is less efficient than SAC. However, DDLfP outperforms this prior method in terms of both final performance and learning speed on all tasks, except for the Hopper-v3 task.
+
+Locomotion tasks like the ones considered here do not fit into DDL framework directly. In this particular case of locomotion tasks, we can fix the issue by considering a case where the ultimate task is to reach a specific goal, i.e. the operator would always choose the goal to be the state closest to the ”ultimate task goal”. In that case, we can see the locomotion task to be the limit case where the ultimate goal is as far as possibly reachable within the maximum episode length.
+
+
+Figure 6: (Top) Learning curves for DDLUS. The y-axis plots the environment return (not accessible during the training) for InvertedDoublePendulum-v3, and the L2-distance travelled from the origin for Hopper-v3, HalfCheetah-v3, and Ant-v3. (Bottom) Frequency histograms of skills learned with DDLUS (blue) and DIAYN (orange) (Eysenbach et al., 2018) across different training runs, evaluated according to the travelled L2-distance from the origin.
+
+# 6.3 ACQUIRING UNSUPERVISED SKILLS
+
+Finally, we study question (3,b) in order to understand how well DDLUS can acquire skills without any supervision. We structure these experiments analogously to the unsupervised skill learning experiments proposed by Eysenbach et al. (2018), and compare to the DIAYN algorithm, another unsupervised skill discovery method, proposed in their prior work. While our method maximizes the complexity of the learned skills by attempting to reach the furthest possible goal, DIAYN maximizes the diversity of learned skills. This of course produces different biases in the skills produced by the two methods. Figure 6 shows both learning curves and histograms of the skills learned in the locomotion tasks with the two methods, evaluated according to how far the simulated robot in each domain travels from the initial state. Our DDLUS method learns skills that travel further than DIAYN, while still providing a variety of different behaviors (e.g., travel in different directions). This experiment aims to provide a direct comparison to the DIAYN algorithm (Eysenbach et al., 2018), though a reasonable criticism is that maximizing dynamical distance is particularly wellsuited for the criteria proposed by Eysenbach et al. (2018). We also evaluated DDLUS on the InvertedDoublePendulum-v2 domain, where the task is to balance a pole on a cart. As can be seen from Figure 6, DDLUS can efficiently solve the task without the true reward, as reaching dynamically far states amounts to avoiding failure as far as possible.
+
+# 7 CONCLUSION
+
+We presented dynamical distance learning (DDL), an algorithm for learning dynamical distances that can be used to specify reward functions for goal reaching policies, and support both unsupervised and semi-supervised exploration and skill discovery. Our algorithm uses a simple and stable supervised learning procedure to learn dynamical distances, which are then used to provide a reward function for a standard reinforcement learning method. This makes DDL straightforward to apply even with complex and high-dimensional observations, such as images. By removing the need for manual reward function design and manual reward shaping, our method makes it substantially more practical to employ deep reinforcement learning to acquire skills even with real-world robotic systems. We demonstrate this by learning a valve-turning task with a real-world robotic hand, using 10 preference queries from a human, without any manual reward design or other examples or supervision. One of the main limitations of our current approach is that, although it can be used with an off-policy reinforcement learning algorithm, it requires on-policy data collection for learning the dynamical distances. While the resulting method is still efficient enough to learn directly in the real world, the efficiency of our approach can likely be improved in future work by lifting this limitation. This would not only make learning faster but would also make it possible to pre-train dynamical distances using previously collected experience, potentially making it feasible to scale our method to a multi-task learning setting, where the same dynamical distance function can be used to learn multiple distinct skills.
+
+# ACKNOWLEDGMENTS
+
+We thank Vikash Kumar for the DClaw robot design, Nicolas Heess for helpful discussion, and Henry Zhu and Justin Yu for their help on setting up and running the hardware experiments. This research was supported by the Office of Naval Research, the National Science Foundation through IIS-1651843 and IIS-1700696, and Berkeley DeepDrive.
+
+# 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.
+
+Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems (NeurIPS), pp. 5048–5058, 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 (NeurIPS), pp. 4299–4307, 2017.
+
+B. Eysenbach, A. Gupta, J. Ibarz, and S. Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018.
+
+Benjamin Eysenbach, Ruslan Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. arXiv preprint arXiv:1906.05253, 2019.
+
+Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. In International Conference on Machine Learning (ICML), 2018.
+
+Carlos Florensa, Jonas Degrave, Nicolas Heess, Jost Tobias Springenberg, and Martin Riedmiller. Self-supervised learning of image embedding for continuous control. arXiv preprint arXiv:1901.00943, 2019.
+
+S. Fujimoto, H. van Hoof, and D. Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning (ICML), 2018.
+
+T. Haarnoja, V. Pong, A. Zhou, M. Dalal, P. Abbeel, and S. Levine. Composable deep reinforcement learning for robotic manipulation. In International Conference on Robotics and Automation (ICRA). IEEE, 2018a.
+
+T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning (ICML), 2018b.
+
+T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Kumar, H. Zhu, A. Gupta, P. Abbeel, and S. Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018c.
+
+Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1109–1117, 2016.
+
+L. P. Kaelbling, M. L. Littman, and A. W. Moore. Reinforcement learning: A survey. Journal of artificial intelligence research, 4:237–285, 1996.
+
+Leslie Pack Kaelbling. Learning to achieve goals. In International Joint Conference on Artificial Intelligence (IJCAI), pp. 1094–1099. Citeseer, 1993.
+
+S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. Journal of Machine Learning Research, 17(39):1–40, 2016.
+
+T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
+
+A Rupam Mahmood, Dmytro Korenkevych, Brent J Komer, and James Bergstra. Setting up a reinforcement learning task with a real-world robot. In International Conference on Intelligent Robots and Systems (IROS), pp. 4635–4640. IEEE, 2018.
+V. Mnih, K. Kavukcuoglu, D. Silver, A. A Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
+Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Advances in Neural Information Processing Systems, pp. 9191–9200, 2018.
+Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In Advances in neural information processing systems (NeurIPS), pp. 4026– 4034, 2016.
+Vitchyr Pong, Shixiang Gu, Murtaza Dalal, and Sergey Levine. Temporal difference models: Modelfree deep RL for model-based control. In International Conference on Learning Representations (ICLR), 2018.
+Vitchyr Pong, Murtaza Dalal, Steven Lin, Ashvin Nair, Shikhar Bahl, and Sergey Levine. Skew-fit: State-covering self-supervised reinforcement learning. arXiv preprint arXiv:1903.03698, 2019.
+Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference of Learning Representations (ICLR), 2018.
+T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. In International Conference on Machine Learning (ICML), pp. 1312–1320, 2015.
+Avi Singh, Larry Yang, Kristian Hartikainen, Chelsea Finn, and Sergey Levine. End-to-end robotic reinforcement learning without reward engineering. arXiv preprint arXiv:1904.07854, 2019.
+Richard S Sutton, Joseph Modayil, Michael Delp, Thomas Degris, Patrick M Pilarski, Adam White, and Doina Precup. Horde: A scalable real-time architecture for learning knowledge from unsupervised sensorimotor interaction. In The 10th International Conference on Autonomous Agents and Multiagent Systems-Volume 2, pp. 761–768. International Foundation for Autonomous Agents and Multiagent Systems, 2011.
+David Warde-Farley, Tom Van de Wiele, Tejas Kulkarni, Catalin Ionescu, Steven Hansen, and Volodymyr Mnih. Unsupervised control through non-parametric discriminative rewards. arXiv
+
+preprint arXiv:1811.11359, 2018.
+
+# Appendices
+
+# A CORRECT BEHAVIOR IN THE PATHOLOGICAL MDP
+
+In this appendix we show that the policy that maximizes the objective in Equation 1, with the reward $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) { \bar { \mathbf { \eta } } } = - d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ , where $d ^ { \pi }$ is given by Equation 2, prefers safe actions over risky actions.
+
+Assume that $c ( \mathbf { s } _ { t } , \mathbf { s } _ { t + 1 } ) = \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t } \right]$ is an indicator function that is 0 if $\mathbf { s } _ { t }$ is a goal state or terminal state and 1 for all the other states. We can now write the definition of $d ^ { \pi }$ as an infinite sum and substitute $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) - d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ in Equation 1:
+
+$$
+\mathcal { L } ( \pi ) = - \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { E } _ { \tau ^ { \prime } \sim \pi } \left[ \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { k } \right] \middle | \mathbf { s } _ { 0 } ^ { \prime } = \mathbf { s } _ { t } , \mathbf { a } _ { 0 } ^ { \prime } = \mathbf { a } _ { t } \right] \right] .
+$$
+
+The first term $k = 0 ,$ ) in the inner sum depends only on $\mathbf { s } _ { 0 } ^ { \prime }$ , which is given, and the term can thus be moved outside the inner expectation:
+
+$$
+\mathcal { L } ( \boldsymbol { \pi } ) = - \mathbb { E } _ { \boldsymbol { \tau } \sim \boldsymbol { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t } \right] + \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { E } _ { \boldsymbol { \tau } ^ { \prime } \sim \boldsymbol { \pi } } \left[ \sum _ { k = 1 } ^ { \infty } \gamma ^ { k } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { k } ^ { \prime } \right] \bigg \vert \mathbf { s } _ { 0 } ^ { \prime } = \mathbf { s } _ { t } , \mathbf { a } _ { 0 } ^ { \prime } = \mathbf { a } _ { t } \right] \right] .
+$$
+
+Next, note that the statistics of the inner expectation over $( \mathbf { s } _ { 1 } ^ { \prime } , \mathbf { a } _ { 1 } ^ { \prime } )$ are the same as the outer expectation over $( \mathbf { s } _ { 1 } , \mathbf { a } _ { 1 } )$ , as they are both conditioned on the same $\left( \mathbf { s } _ { t } , \mathbf { a } _ { t } \right)$ . Thus, we can condition the second expectation directly on $( \mathbf { s } _ { 1 } ^ { \prime } , \mathbf { a } _ { 1 } ^ { \prime } ) = ( \mathbf { s } _ { t + 1 } , \mathbf { a } _ { t + 1 } )$ :
+
+$$
+\mathcal { L } ( \boldsymbol { \pi } ) = - \mathbb { E } _ { \boldsymbol { \tau } \sim \boldsymbol { \pi } } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { 1 } _ { \mathbf { g } } [ \mathbf { s } _ { t } ] + \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { E } _ { \boldsymbol { \tau } ^ { \prime } \sim \boldsymbol { \pi } } [ \sum _ { k = 1 } ^ { \infty } \gamma ^ { k } \mathbb { 1 } _ { \mathbf { g } } [ \mathbf { s } _ { k } ^ { \prime } ] | \mathbf { s } _ { 1 } ^ { \prime } = \mathbf { s } _ { t + 1 } , \mathbf { a } _ { 1 } ^ { \prime } = \mathbf { a } _ { t + 1 } ] ] .
+$$
+
+We can now apply the same argument as before and move $\mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { 1 } ^ { \prime } \right]$ outside the inner expectation. Repeating these steps multiple times yields
+
+$$
+\begin{array} { l } { { \displaystyle { \mathcal { L } } ( \boldsymbol { \pi } ) = - \mathbb { E } _ { \boldsymbol { \tau } \sim \boldsymbol { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t } \right] + \sum _ { t = 0 } ^ { \infty } \gamma ^ { t + 1 } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t + 1 } \right] + \sum _ { t = 0 } ^ { \infty } \gamma ^ { t + 2 } \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t + 2 } \right] + . . . \right] } } \\ { { \displaystyle ~ = - \mathbb { E } _ { \boldsymbol { \tau } \sim \boldsymbol { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( t + 1 ) \mathbb { 1 } _ { \mathbf { g } } \left[ \mathbf { s } _ { t } \right] \right] . } } \end{array}
+$$
+
+Assuming that the agent always reaches the goal relatively quickly compared to the discount factor, such that $\gamma ^ { t } \approx 1$ , the trajectories that take longer dominate the loss due to the $( t + 1 )$ factor. Therefore, an optimal agent prefers actions that reduce the risk of long, highly suboptimal trajectories, avoiding the pathological behavior discussed in Section 4.3.
+
+# B POLICY IMPROVEMENT WHEN USING DISTANCE AS REWARD
+
+In this appendix we show that, when we use the negative dynamical distance $- d ^ { \pi }$ as the reward function in RL, we can learn an optimal policy with respect to the true dynamical distance, leading to policies that optimize the actual number of time steps needed to reach the goal. This result is nontrivial, since the reward function does not at first glance directly optimize for shortest paths. Our proof relies on the assumption that the MDP has deterministic dynamics. However, this assumption holds in all of our experiments, since the MuJoCo benchmark tasks are governed by deterministic dynamics. Under this assumption, DDL will learn policies that take the shortest path to the goal at convergence, despite using the negative dynamical distance as the reward.
+
+Let $d ^ { * } ( { \bf s } , { \bf g } ) = \operatorname* { m i n } _ { \pi } d ^ { \pi } ( { \bf s } , { \bf g } )$ be the optimal distance from state s to goal state $\mathbf { g }$ . Let $\pi ^ { \prime }$ be the optimal policy for the reinforcement learning problem with reward $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) = - d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ . DDL can be viewed as alternating between fitting $d ^ { \pi }$ to the current policy $\pi$ , and learning a new policy $\pi ^ { \prime }$ that is optimal with respect to the reward function given by $- d ^ { \pi }$ .4 We can now state our main theorem as follows:
+
+Theorem 1. Under deterministic dynamics, for any state s and g, we have:
+
+1. $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) .$ .
+2. If $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) = d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ , then $d ^ { \pi ^ { \prime } } ( { \bf s } , { \bf g } ) = d ^ { \ast } ( { \bf s } , { \bf g } ) .$
+
+This implies that, when the policy converges, such that $\pi ^ { \prime } = \pi$ , the policy $\pi ^ { \prime }$ achieves the optimal distance to any goal, and therefore is the optimal policy for the shortest path reward function (e.g., the reward function that assigns a reward of $- 1$ for any step that does not reach the goal).
+
+Proof.
+
+Part 1 Without loss of generality, we assume that our policy is deterministic, since the set of optimal policies in an MDP always includes at least one deterministic policy. We also assume that g is a terminal state and thus $d ( \mathbf { g } , \mathbf { g } ) = 0$ . Let us denote the action of policy $\pi$ on state s as $\pi ( \mathbf { s } )$ . We start by showing that $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ . We fix a particular goal $\mathbf { g }$ . Let $S _ { k } = \left\{ \mathbf { s } ; d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) = k \right\}$ be the set of states that takes $k$ steps under $\pi$ to reach the goal. We show that $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) =$ $k$ for all $\mathbf { s } \in S _ { k }$ for each $k$ by contradiction.
+
+For $k = 0$ , $S _ { 0 } = \{ \mathbf { g } \}$ is just the single goal state and ${ d ^ { \pi } } ^ { \prime } ( { \bf g } , { \bf g } ) = { d ^ { \pi } } ( { \bf g } , { \bf g } ) = 0$ by definition. For $k = 1$ , for all $\mathbf { s } \in S _ { 1 }$ , there is an action a that reaches the goal state as the direct next state. Therefore, the optimized policy $\pi ^ { \prime }$ would still take the same action a on these states and $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) = 1$ .
+
+Now assume that the opposite is true, that $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) > d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ for some states. Then, there must be a smallest number $K > 1$ and a state ${ \bf s } _ { 0 } \in { \cal S } _ { K }$ such that $d ^ { \pi ^ { \prime } } ( \mathbf { s } _ { 0 } , \mathbf { g } ) = T > d ^ { \pi } ( \mathbf { s } _ { 0 } , \mathbf { g } ) = K$ . Now let us denote the trajectory of states taken by $\pi$ starting from ${ \bf s } _ { 0 }$ as $\{ \mathbf { s } _ { 0 } , \mathbf { s } _ { 1 } , . . . , \mathbf { s } _ { K } = g \}$ , and the trajectory taken by $\pi ^ { \prime }$ as $\{ \mathbf { s } _ { 0 } ^ { \prime } = \mathbf { s } _ { 0 } , \mathbf { s } _ { 1 } ^ { \prime } , . . . , \mathbf { s } _ { T } ^ { \prime } = g \}$ . Let $\mathcal { L } _ { \pi } ( \cdot )$ denote the accumulated discounted sum of distance as defined in Equation 4. By our assumption $T > K$ , and since $\pi ^ { \prime }$ is optimal with respect to the reward $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) = - d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ , we have
+
+$$
+\mathcal { L } _ { \pi } ( \pi ^ { \prime } ) = \sum _ { i = 0 } ^ { T - 1 } \gamma ^ { i } d ^ { \pi } ( \mathbf { s } _ { i } ^ { \prime } , \mathbf { g } ) \leq \mathcal { L } _ { \pi } ( \pi ) = \sum _ { i = 0 } ^ { K - 1 } \gamma ^ { i } d ^ { \pi } ( \mathbf { s } _ { i } , \mathbf { g } ) = \sum _ { i = 0 } ^ { K - 1 } \gamma ^ { i } ( K - 1 - i )
+$$
+
+Then there must be a time $\hat { t } < K$ such that $d ^ { \pi } ( \mathbf { s } _ { \hat { t } } ^ { \prime } , \mathbf { g } ) < d ^ { \pi } ( \mathbf { s } _ { \hat { t } } , \mathbf { g } ) = K - 1 - \hat { t }$ . Therefore $\mathbf { s } _ { \hat { t } } ^ { \prime } \in S _ { k }$ for some $k < K - 1 - \hat { t }$ . However, starting from $\mathbf { s } _ { \hat { t } } ^ { \prime }$ , we have $d ^ { \pi ^ { \prime } } ( \mathbf { s } _ { \hat { t } } ^ { \prime } , \mathbf { g } ) = T - 1 - \hat { t } > K - 1 - \hat { t } =$ $d ^ { \pi } ( \mathbf { s } _ { \hat { t } } ^ { \prime } , \mathbf { g } )$ . Therefore, we reached a contradiction with our assumption that $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ for all s, $k < K$ such that $\mathbf { s } \in S _ { k }$ . Therefore, $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ holds for all states.
+
+Part 2 Now we show the second part: if $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) = d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } )$ , then $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) = d ^ { * } ( \mathbf { s } , \mathbf { g } )$ . We prove this with a similar argument, grouping states by distance. Let $S _ { k } ^ { * } = \{ \mathbf { s } ; d ^ { * } ( \mathbf { s } , \mathbf { g } ) = k \}$ be the set of states that takes $k$ steps under the optimal policy to reach the goal. Note that, for any arbitrary policy $\pi$ , we have $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) \geq d ^ { * } ( \mathbf { s } , \mathbf { g } )$ by definition, since $d ^ { * }$ is the optimal distance.
+
+Suppose that $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) > d ^ { * } ( \mathbf { s } , \mathbf { g } )$ for some state s. Then there must be a smallest integer $K \geq 0$ such that there exists a state ${ \bf s } _ { 0 } \in { \cal S } _ { K } ^ { * }$ where $d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) > d ^ { * } ( { \bf s } _ { 0 } , { \bf g } )$ . For all $k \ < \ K$ , we have $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) = d ^ { * } ( \mathbf { s } , \mathbf { g } )$ for all $\mathbf { s } \in S _ { k } ^ { * }$ . Now starting from that state ${ \bf s } _ { 0 }$ , let the trajectory of states taken by $\pi$ be $\{ \mathbf { s } _ { 0 } , \mathbf { s } _ { 1 } , . . . , \mathbf { s } _ { T } = g \}$ . Note that since $d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) > d ^ { * } ( { \bf s } _ { 0 } , { \bf g } ) = { \cal K } , $ $T > K$ . Let $\hat { \pi }$ be the policy such that it agrees with $\pi ^ { * }$ on $\mathbf { s } _ { 0 }$ and agrees with $\pi$ everywhere else. At the first step, $\hat { \pi }$ lands on state $\mathbf { s } _ { 1 } ^ { \prime }$ . Since ${ \bf s } _ { 0 }$ is $K$ steps away from $\mathbf { g }$ under $d ^ { * }$ , $\mathbf { s } _ { 1 } ^ { \prime }$ must be $K - 1$ steps away under $d ^ { * }$ and ${ \bf s } _ { 1 } ^ { \prime } \in { \cal S } _ { K - 1 } ^ { * }$ . Therefore, since $\pi$ and $\pi ^ { * }$ agrees on all states that are less than $K$ steps away from goal g, $\hat { \pi }$ would take the same action as $\pi ^ { * }$ and hence take another $K - 1$ steps to goal g. Now let us denote the trajectory taken by $\hat { \pi }$ as $\{ \mathbf { s } _ { 0 } ^ { \prime } = \mathbf { s } _ { 0 } , \mathbf { s } _ { 1 } ^ { \prime } , . . . , \mathbf { s } _ { K } ^ { \prime } = g \}$ . We compare the discounted sum of rewards of $\pi$ and $\hat { \pi }$ under the reward function $r _ { \mathbf { g } } ( \mathbf { s } , \mathbf { a } ) = - d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ .
+
+$$
+\begin{array} { l } { { \displaystyle { \mathcal { L } } _ { \pi } ( \pi ) = \sum _ { i = 0 } ^ { T - 1 } \gamma ^ { i } d ^ { \pi } ( { \bf s } _ { i } , { \bf g } ) = d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) + \sum _ { i = 1 } ^ { T - 1 } \gamma ^ { i } d ^ { \pi } ( { \bf s } _ { i } , { \bf g } ) } \ ~ } \\ { { \displaystyle ~ = d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) + \sum _ { i = 1 } ^ { T - 1 } \gamma ^ { i } ( T - i ) \geq d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) + \sum _ { i = 1 } ^ { K - 1 } \gamma ^ { i } ( K - i ) } \ ~ } \\ { { \displaystyle ~ = d ^ { \pi } ( { \bf s } _ { 0 } , { \bf g } ) + \sum _ { i = 1 } ^ { K - 1 } \gamma ^ { i } d ^ { \pi } ( { \bf s } _ { i } ^ { \prime } , { \bf g } ) = \sum _ { i = 0 } ^ { K - 1 } \gamma ^ { i } d ^ { \pi } ( { \bf s } _ { i } ^ { \prime } , { \bf g } ) = { \mathcal L } _ { \pi } ( \hat { \pi } ) } \ ~ } \end{array}
+$$
+
+Therefore, we can see that $\hat { \pi }$ is a better policy than $\pi$ . Then the optimal policy $\pi ^ { \prime }$ under this reward must be different from $\pi$ on at least one state. Hence $d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) \neq d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } )$ .
+
+We’ve now reached the conclusion that if $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \neq d ^ { * } ( \mathbf { s } , \mathbf { g } )$ , then $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \neq d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ . Hence, by contraposition, if $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) = d ^ { \pi } ( \mathbf { s } , \mathbf { g } )$ , then it must be that $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) = d ^ { \ast } ( \mathbf { s } , \mathbf { g } )$ . Our proof is thus complete.
+
+C DIDACTIC EXAMPLE
+
+Our didactic example involves a simple 2D point robot navigating an S-shaped maze. The state space is two-dimensional, and the action is a two-dimensional velocity vector. This experiment is visualized in Figure 7. The black rectangles correspond to walls, and the goal is depicted with a blue star. The learned distance from all points in the maze to the goal is illustrated with a heat map, in which lighter colors correspond to closer states and darker colors to distant states. During the training, the initial state is chosen uniformly at random, and the policy is trained to reach the goal state. From the visualization, it is apparent that DDL learns an accurate estimate of the true dynamical distances in this domain. Note that, in contrast to na¨ıve metrics, such as Euclidean distance, the dynamical distances conform to the walls and provide an accurate estimate of reachability, making them ideally suited for reward shaping.
+
+
+Figure 7: Evaluation of the learned distance in a 2D point environment. The state is the xycoordinates of the point, and action corresponds to 2D velocities. The black bars denote walls, blue star is a goal state, and the heat map denotes the estimated distance to the goal. (a) Our method learns an accurate estimate of the shape of the distance function. (b) Ground-truth distance.
+
+# D PREFERENCE QUERIES FOR REAL-WORLD DCLAW EXPERIMENT
+
+
+Figure 8: Human preference queries for the vision-based DClaw experiment presented in Section 6.1. Each image row presents the set of images shown to the human operator on a single query round. On each row, the first 10 images correspond to the last states of the most recent rollouts and the right-most image corresponds to the last goal. For each query, the human operator picks a new goal by inputting its index (between 0-10) into a text-based interface. The goals selected by human are highlighted with white borders.
+
+# E TECHNICAL DETAILS
+
+All our experiments use Soft Actor-Critic as the policy optimizer, trained the default parameters by provided by the authors in (Haarnoja et al., 2018c).
+
+For all of the tasks, we parameterize our distance function as a neural network. For state-based tasks, we use feed-forward neural networks with two 256-unit hidden layers. For the vision-based tasks we add a convolutional preprocessing network before these fully-connected layers, consisting of four convolutional layers, each with $6 4 3 \mathrm { x } 3 $ filters. Both cases use Adam optimizer with learning rate 3e4 and TensorFlow‘s default momentum parameters. The image observation for all the vision-based tasks are 3072 dimensional (32x32 RGB images).
+
+Most important hyperparameters that we swept over in the final experiments, namely the size of the on-policy pool for training the distance function and the number of gradient steps per environment samples, are presented in Table 1 below:
+
+Table 1: Distance estimator hyperparameters.
+
+
Environment
gradient steps per environment steps
on-policy pool size
InvertedDoublePendulum-v2
1/64
100k
Hopper-v3
1/64
16k
HalfCheetah-v3
1/16
16k
Ant-v3
1/64
10k
DClaw (both state and vision)
1/16
100k
+
+For the DDLUS goal proposals, we consider all the samples in the distance on-policy pool as the goal candidates. For DDLfP, we present the operator the last states $( s _ { T - 1 } )$ of the last $N$ episodes, where $N = 5$ for all the simulated experiments, and $N = 1 0$ for the hardware DClaw.
+
+As discussed in Section 5, for both DDLUS and DDLfP, the agent needs to explore in the vicinity of the goal state. In practice, we implement this by switching to a random uniform policy after $0 . 9 \mathrm { T }$ timesteps of each episode, where $\mathrm { T }$ is the maximum episode length (1000 for all the mujoco tasks and 200 for the DClaw task).
\ No newline at end of file
diff --git a/md/train/H1xaJn05FQ/H1xaJn05FQ.md b/md/train/H1xaJn05FQ/H1xaJn05FQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..245645a7841eea93990a55caefc18019533d3300
--- /dev/null
+++ b/md/train/H1xaJn05FQ/H1xaJn05FQ.md
@@ -0,0 +1,469 @@
+# SLICED-WASSERSTEIN AUTO-ENCODERS
+
+Soheil Kolouri, Phillip E. Pope, & Charles E. Martin,
+
+Gustavo K. Rohde
+
+Information and Systems Sciences Laboratory HRL Laboratories, LLC.
+Malibu, CA, USA
+{skolouri,pepope,cemartin}@hrl.com
+
+Department of Electrical Engineering University of Virginia Charlottesville, VA, USA gustavo@virginia.edu
+
+# ABSTRACT
+
+In this paper we use the geometric properties of the optimal transport (OT) problem and the Wasserstein distances to define a prior distribution for the latent space of an auto-encoder. We introduce Sliced-Wasserstein Auto-Encoders (SWAE), that enable one to shape the distribution of the latent space into any samplable probability distribution without the need for training an adversarial network or having a likelihood function specified. In short, we regularize the auto-encoder loss with the sliced-Wasserstein distance between the distribution of the encoded training samples and a samplable prior distribution. We show that the proposed formulation has an efficient numerical solution that provides similar capabilities to Wasserstein Auto-Encoders (WAE) and Variational Auto-Encoders (VAE), while benefiting from an embarrassingly simple implementation. We provide extensive error analysis for our algorithm, and show its merits on three benchmark datasets.
+
+Scalable generative models that capture the rich and often nonlinear distribution of high-dimensional data, (i.e., image, video, and audio), play a central role in various applications of machine learning, including transfer learning Isola et al. (2017); Murez et al. (2018), super-resolution Ledig et al. (2016); Kolouri & Rohde (2015), image inpainting and completion Yeh et al. (2017), and image retrieval Creswell & Bharath (2016), among many others. The recent parametric generative models, including Generative Adversarial Networks (GANs) Goodfellow et al. (2014); Radford et al. (2015); Arjovsky et al. (2017); Berthelot et al. (2017) and Variational auto-encoders (VAE) Kingma & Welling (2013); Mescheder et al. (2017); Bousquet et al. (2017) enable an unsupervised and end-to-end modeling of the high-dimensional distribution of the training data.
+
+Learning such generative models boils down to minimizing a dissimilarity measure between the data distribution and the output distribution of the generative model. To this end, and following the work of Arjovsky et al. (2017) and Bousquet et al. (2017), we approach the problem of generative modeling from the optimal transport point of view. The optimal transport problem Villani (2008); Kolouri et al. (2017) provides a way to measure the distances between probability distributions by transporting (i.e., morphing) one distribution into another. Moreover, and as opposed to the common information theoretic dissimilarity measures (e.g., $f$ -divergences), the p-Wasserstein dissimilarity measures that arise from the optimal transport problem: 1) are true distances, and 2) metrize a weak convergence of probability measures (at least on compact spaces). Wasserstein distances have recently attracted a lot of interest in the learning community Frogner et al. (2015); Gulrajani et al. (2017); Bousquet et al. (2017); Arjovsky et al. (2017); Kolouri et al. (2017) due to their exquisite geometric characteristics Santambrogio (2015). See the supplementary material for an intuitive example showing the benefit of the Wasserstein distance over commonly used $f$ -divergences.
+
+In this paper, we introduce a new type of auto-encoders for generative modeling (Algorithm 1), which we call Sliced-Wasserstein auto-encoders (SWAE), that minimize the sliced-Wasserstein distance between the distribution of the encoded samples and a samplable prior distribution. Our work is most closely related to the recent work by Bousquet et al. (2017) and more specifically the follow-up work by Tolstikhin et al. (2017). However, our approach avoids the need to perform adversarial training in the encoding space and is not restricted to closed-form distributions, while still benefiting from a Wasserstein-like distance measure in the latent space. Calculating the Wasserstein distance can be computationally expensive, but our approach permits a simple numerical solution to the problem. Finally, we note that there has been several concurrent papers, including the work by Deshpande et al. (2018) and ¸Sim¸sekli et al. (2018), that also looked into the application of sliced-Wasserstein distance in generative modeling. Regardless of the concurrent nature of these papers, our work remains novel and is distinguished from these methods. Deshpande et al. (2018) use the sliced-Wasserstein distance to match the distributions of high-dimensional reconstructed images, which require large number of slices, $\mathcal { O } ( 1 0 ^ { 4 } )$ , while in our method and due to the distribution matching in the latent space we only need $\mathcal { O } ( 1 0 )$ slices. We also note that Deshpande et al. (2018) proposed to learn discriminative slices to mitigate the need for a very large number of random projections that is in essence similar to the adversarial training used in GANs, which contradicts with our goal of not using adversarial training. ¸Sim¸sekli et al. (2018), on the other hand, take an interesting but different approach of parameter-free generative modeling via sliced-Wasserstein flows.
+
+# 1 NOTATION AND PRELIMINARIES
+
+Let $X$ denote the compact domain of a manifold in Euclidean space and let $x _ { n } \in X$ denote an individual input data point. Furthermore, let $\rho _ { X }$ be a Borel probability measure defined on $X$ . We define the probability density function $p _ { X } ( x )$ for input data $x$ to be:
+
+$$
+d \rho _ { X } ( x ) = p _ { X } ( x ) d x
+$$
+
+Let $\phi : X \to Z$ denote a deterministic parametric mapping from the input space to a latent space $Z$ (e.g., a neural network encoder). To obtain the density of the push forward of $\rho _ { X }$ with respect to $\phi$ , i.e., $\rho _ { Z } = \phi _ { * } ( \rho _ { X } )$ , we use Random Variable Transformation (RVT) Gillespie (1983)). In short, the probability density function of the encoded samples $z$ can be expressed in terms of $\phi$ and $p _ { X }$ by:
+
+$$
+p _ { Z } ( z ) = \int _ { X } p _ { X } ( x ) \delta ( z - \phi ( x ) ) d x ,
+$$
+
+where $\delta$ denotes the Dirac distribution function. Similar to variational Auto-Encoders (VAEs) Kingma $\&$ Welling (2013) and the Wasserstein Auto-Encoders (WAE) Tolstikhin et al. (2017), our main objective is to encode the input data points $x \in X$ into latent codes $z \in Z$ such that: 1) $x$ can be recovered/approximated from $z$ , and 2) the probability density function of the encoded samples, $p _ { Z }$ , follows a prior distribution $q _ { Z }$ . Let $\psi : Z \to X$ be the decoder that maps the latent codes back to the original space such that
+
+$$
+p _ { Y } ( y ) = \int _ { X } p _ { X } ( x ) \delta ( y - \psi ( \phi ( x ) ) ) d x ,
+$$
+
+where $y$ denotes the decoded samples. It is straightforward to see that when $\psi = \phi ^ { - 1 }$ (i.e. $\psi ( \phi ( \cdot ) ) =$ $i d ( \cdot ) )$ , the distribution of the decoder $p _ { Y }$ and the input distribution $p _ { X }$ are identical. Hence, in its most general form, the objective of such auto-encoders simplifies to learning $\phi$ and $\psi$ , so that they minimize a dissimilarity measure between $p _ { Y }$ and $p _ { X }$ , and between $p _ { Z }$ and $q _ { Z }$ . In what follows, we briefly review the existing dissimilarity measures for these distributions.
+
+# 1.1 MINIMIZING DISSIMILARITY BETWEEN $p _ { X }$ AND $p _ { Y }$
+
+We first emphasize that the VAE often assumes stochastic encoders and decoders Kingma & Welling (2013), while we consider the case of only deterministic mappings. Although, we note that, similar to WAE, SWAE can also be formulated with stochastic encoders. Different measures have been used previously to compute the dissimilarity between $p _ { X }$ and $p _ { Y }$ . Most notably, Nowozin et al. (2016) showed that for the general family of $f$ -divergences, $D _ { f } ( p _ { X } , p _ { Y } )$ , (including the KL-divergence, JensenShannon, etc.), using the Fenchel conjugate of the convex function $f$ and minimizing $D _ { f } ( p _ { X } , p _ { Y } )$ leads to a min-max problem that is equivalent to the adversarial training widely used in the generative modeling literature Goodfellow et al. (2014); Makhzani et al. (2015); Mescheder et al. (2017).
+
+Others have utilized the rich mathematical foundation of the OT problem and Wasserstein distances Arjovsky et al. (2017); Gulrajani et al. (2017); Bousquet et al. (2017); Tolstikhin et al. (2017) to define a distance between $p _ { X }$ and $p _ { Y }$ . In Wasserstein-GAN, Arjovsky et al. (2017) utilized the Kantorovich-Rubinstein duality for the 1-Wasserstein distance, $W _ { 1 } ( p _ { X } , p _ { Y } )$ , and reformulated the problem as a min-max optimization that is solved through an adversarial training scheme.
+
+Inspired by the work of Bousquet et al. (2017) and Tolstikhin et al. (2017), it can be shown that (see supplementary material for a proof):
+
+$$
+\begin{array} { r c l } { W _ { c } ( p _ { X } , p _ { Y } ) \leq W _ { c } ^ { \dagger } ( p _ { X } , p _ { Y } ) } & { : = } & { \mathbb { E } _ { p _ { X } } \left( c ( x , \psi ( \phi ( x ) ) ) \right) } \\ & { = } & { \displaystyle \int _ { X } c ( x , \psi ( \phi ( x ) ) ) p _ { X } ( x ) d x , } \end{array}
+$$
+
+Furthermore, the r.h.s. of equation 3 supports a simple implementation where for i.i.d samples of the input distribution, $\{ x _ { n } \} _ { n = 1 } ^ { N }$ , the upper bound can be approximated as:
+
+$$
+W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } ) \approx \frac { 1 } { N } \sum _ { n = 1 } ^ { N } c ( x _ { n } , \psi ( \phi ( x _ { n } ) ) )
+$$
+
+The r.h.s of equation 3 and equation 4 take advantage of the existence of pairs $x _ { n }$ and $y _ { n } = \psi { \bigl ( } \phi ( x _ { n } ) { \bigr ) }$ , which make $f ( \cdot ) = \psi ( \phi ( \cdot ) )$ a transport map between $p _ { X }$ and $p _ { Y }$ (but not necessarily the optimal transport map). In this paper, we minimize $W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } )$ following equation 4 to minimize the discrepancy between $p _ { X }$ and $p _ { Y }$ . Next, we focus on the discrepancy measures between $p _ { Z }$ and $q _ { Z }$ .
+
+# 1.2 MINIMIZING DISSIMILARITY BETWEEN $p _ { Z }$ AND $q _ { Z }$
+
+If $q _ { Z }$ is a known distribution with an explicit formulation (e.g. Normal distribution) the most straightforward approach for measuring the (dis)similarity between $p _ { Z }$ and $q _ { Z }$ is the log-likelihood of $z = \phi ( x )$ with respect to $q _ { Z }$ , formally:
+
+$$
+s u p _ { \phi } \int _ { X } p _ { X } ( x ) l o g ( q _ { Z } ( \phi ( x ) ) ) d x
+$$
+
+maximizing the log-likelihood is equivalent to minimizing the KL-divergence between $p _ { Z }$ and $q _ { Z }$ , $D _ { K L } ( p _ { Z } , q _ { Z } )$ (see supplementary material for more details and derivation of Equation equation 5). This approach has two major limitations: 1) The KL-Divergence and in general $f$ -divergences do not provide meaningful dissimilarity measures for distributions supported on non-overlapping lowdimensional manifolds Arjovsky et al. (2017); Kolouri et al. (2018) (see supplementary material), which is common in hidden layers of neural networks, and therefore they do not provide informative gradients for training $\phi$ , and 2) we are limited to distributions $q _ { Z }$ that have known explicit formulations, which is restrictive as it eliminates the ability to use the much broader class of samplable distributions.
+
+Various alternatives exist in the literature to address the above-mentioned limitations. These methods often sample $\tilde { \mathcal { Z } } \ = \ \{ \tilde { z } _ { j } \} _ { j = 1 } ^ { N }$ from $q _ { Z }$ and $\mathcal Z \ = \ \{ z _ { n } \ = \ \phi ( x _ { n } ) \} _ { n = 1 } ^ { N }$ from $p _ { X }$ and measure the discrepancy between these sets (i.e. point clouds). Note that there are no one-to-one correspondences between $\tilde { z } _ { j } \mathrm { s }$ and $z _ { n } \mathbf { S }$ . In their influential WAE paper, Tolstikhin et al. (2017) proposed two different approaches for measuring the discrepancy between $\tilde { \mathcal { Z } }$ and $\mathcal { Z }$ , namely the GAN-based and the maximum mean discrepancy (MMD)-based approaches. The GAN-based approach proposed in Tolstikhin et al. (2017) defines a discriminator network, $D _ { Z } ( p _ { Z } , q _ { Z } )$ , to classify $\tilde { z } _ { j } \mathrm { s }$ and $z _ { n } s$ as coming from ‘true’ and ‘fake’ distributions correspondingly, and proposes a min-max adversarial optimization for learning $\phi$ and $D _ { Z }$ . The MMD-based approach, utilizes a positive-definite reproducing kernel $k : Z \times Z \to \mathbb { R }$ to measure the discrepancy between $\tilde { \mathcal { Z } }$ and $\mathcal { Z }$ . The choice of the kernel and its parameterization, however, remain a data-dependent design parameter.
+
+An interesting alternative approach is to use the Wasserstein distance between $p _ { Z }$ and $q _ { Z }$ . Following the work of Arjovsky et al. (2017), this can be accomplished utilizing the Kantorovich-Rubinstein duality and through introducing a min-max problem, which leads to yet another adversarial training scheme similar to the GAN-based method in Tolstikhin et al. (2017). Note that, since elements of $\tilde { \mathcal { Z } }$ and $\mathcal { Z }$ are not paired, an approach similar to equation 4 could not be used to minimize the discrepancy. In this paper, we propose to use the sliced-Wasserstein metric, Rabin & Peyré (2011); Rabin et al. (2011); Bonneel et al. (2015); Kolouri et al. (2016b); Carriere et al. (2017); Kolouri et al. (2018), to measure the discrepancy between $p _ { Z }$ and $q _ { Z }$ . We show that using the sliced-Wasserstein distance ameliorates the need for training an adversary network or choosing a data-dependent kernel (as in WAE-MMD), and provides an efficient, stable, and simple numerical implementation.
+
+Before explaining our proposed approach, it is worthwhile to point out the major difference between learning auto-encoders as generative models and GANs. In GANs, one needs to minimize a distance between {ψ(˜zj )|z˜j ∼ qZ}Mj=1 and $\{ x _ { n } \} _ { n = 1 } ^ { M }$ , which are high-dimensional point clouds for which there are no correspondences between $\psi ( \tilde { z } _ { j } ) \mathrm { s }$ and $x _ { n } s$ . For the auto-encoders, on the other hand, there exists correspondences between the high-dimensional point clouds $\{ x _ { n } \} _ { n = 1 } ^ { M }$ and $\{ y _ { n } = \psi ( \phi ( x _ { n } ) ) \} _ { n = 1 } ^ { M }$ and the problem simplifies to matching the lower-dimensional point clouds $\{ { \bar { \phi } } ( x _ { n } ) \} _ { n = 1 } ^ { M }$ and $\{ \tilde { z } _ { j } \sim$ $q _ { Z } \} _ { j = 1 } ^ { M }$ . In other words, the encoder performs a nonlinear dimensionality reduction, that enables us to solve a simpler problem compared to GANs. Next we introduce the details of our approach.
+
+# 2 PROPOSED METHOD
+
+In what follows we first provide a brief review of the necessary equations to understand the Wasserstein and sliced-Wasserstein distances and then present our Sliced Wasserstein auto-encoder (SWAE).
+
+# 2.1 WASSERSTEIN DISTANCES
+
+The Wasserstein distance between probability measures $\rho _ { X }$ and $\rho _ { Y }$ , with corresponding densities $d \rho _ { X } = p _ { X } ( x ) d x$ and $d \rho _ { Y } = p _ { Y } ( y ) d y$ is defined as:
+
+$$
+W _ { c } ( p _ { X } , p _ { Y } ) = i n f _ { \gamma \in \Gamma ( \rho _ { X } , \rho _ { Y } ) } \int _ { X \times Y } c ( x , y ) d \gamma ( x , y )
+$$
+
+where $\Gamma ( \rho _ { X } , \rho _ { Y } )$ is the set of all transportation plans (i.e. joint measures) with marginal densities $p _ { X }$ and $p _ { Y }$ , and $c : X \times Y \to \mathbb { R } ^ { + }$ is the transportation cost. equation 6 is known as the Kantorovich formulation of the optimal mass transportation problem, which seeks the optimal transportation plan between $p _ { X }$ and $p _ { Y }$ . If there exist diffeomorphic mappings, $f : X \to Y$ (i.e. transport maps) such that $y = f ( x )$ and consequently,
+
+$$
+p _ { Y } ( y ) = \int _ { X } p _ { X } ( x ) \delta ( y - f ( x ) ) d x { \xrightarrow [ { \mathrm { ~ u i f f e o m o r p h i s m } } ] { \mathrm { W h e n ~ f ~ i s } } } ~ p _ { Y } ( y ) = d e t ( D f ^ { - 1 } ( y ) ) p _ { X } ( f ^ { - 1 } ( y ) )
+$$
+
+where $d e t ( D \cdot )$ is the determinant of the Jacobian, then the Wasserstein distance could be defined based on the Monge formulation of the problem (see Villani (2008) and Kolouri et al. (2017)) as:
+
+$$
+W _ { c } ( p _ { X } , p _ { Y } ) = m i n _ { f \in M P } \int _ { X } c ( x , f ( x ) ) d \rho _ { X } ( x )
+$$
+
+where $M P$ is the set of all diffeomorphisms that satisfy equation 7. As can be seen from equation 6 and equation 8, obtaining the Wasserstein distance requires solving an optimization problem. We note that various efficient optimization techniques have been proposed in the past (e.g. Cuturi (2013); Solomon et al. (2015); Oberman $\&$ Ruan (2015)) to solve this optimization. For one-dimensional probability densities, $p _ { X }$ and $p _ { Y }$ , however, the Wasserstein distance has a closed-form solution. Let $P _ { X }$ and $P _ { Y }$ be the cumulative distributions of one-dimensional probability distributions $p _ { X }$ and $p _ { Y }$ , correspondingly. The Wassertein distance can then be calculated as below (see Kolouri et al. (2017) for more details):
+
+$$
+W _ { c } ( p _ { X } , p _ { Y } ) = \int _ { 0 } ^ { 1 } c ( P _ { X } ^ { - 1 } ( \tau ) , P _ { Y } ^ { - 1 } ( \tau ) ) d \tau ,
+$$
+
+This closed-form solution motivates the definition of sliced-Wasserstein distances.
+
+# 2.2 SLICED-WASSERSTEIN DISTANCES
+
+Sliced-Wasserstein distance has similar qualitative properties to the Wasserstein distance, but it is much easier to compute. The sliced-Wasserstein distance was used in Rabin & Peyré (2011); Rabin et al. (2011) to calculate barycenter of distributions and point clouds. Bonneel et al. (2015) provided a nice theoretical overview of barycenteric calculations using the sliced-Wasserstein distance. Kolouri et al. (2016b) used it to define positive definite kernels for distributions and Carriere et al. (2017) to define a kernel for persistence diagrams. Sliced-Wasserstein was recently used for learning Gaussian mixture models in Kolouri et al. (2018), and it was also used as a measure of goodness of fit for GANs in Karras et al. (2017).
+
+The main idea behind the sliced-Wasserstein distance is to slice (i.e., project) higher-dimensional probability densities into sets of one-dimensional marginal distributions and compare these marginal distributions via the Wasserstein distance. The slicing/projection process is related to the field of Integral Geometry and specifically the Radon transform (see Helgason (2011)). The relevant result to our discussion is that a d-dimensional probability density $p _ { X }$ can be uniquely represented as the set of its one-dimensional marginal distributions following the Radon transform and the Fourier slice theorem Helgason (2011). These one dimensional marginal distributions of $p _ { X }$ are defined as:
+
+$$
+\mathcal { R } p _ { X } ( t ; \theta ) = \int _ { X } p _ { X } ( x ) \delta ( t - \theta \cdot x ) d x , \forall \theta \in \mathbb { S } ^ { d - 1 } , \forall t \in \mathbb { R }
+$$
+
+where $\mathbb { S } ^ { d - 1 }$ is the $\mathrm { d }$ -dimensional unit sphere. Note that for any fixed $\theta \in \mathbb { S } ^ { d - 1 }$ , $\mathcal { R } p _ { X } ( \cdot ; \theta )$ is a one-dimensional slice of distribution $p _ { X }$ . In other words, $\mathcal { R } p _ { X } ( \cdot ; \theta )$ is a marginal distribution of $p _ { X }$
+
+that is obtained from integrating $p _ { X }$ over the hyperplane orthogonal to $\theta$ .Utilizing these marginal distributions in equation 10, the sliced Wasserstein distance could be defined as:
+
+$$
+S W _ { c } ( p _ { X } , p _ { Y } ) = \int _ { \mathbb { S } ^ { d - 1 } } W _ { c } ( \mathscr { R } p _ { X } ( \cdot ; \theta ) , \mathscr { R } p _ { Y } ( \cdot ; \theta ) ) d \theta
+$$
+
+Given that $\mathcal { R } p _ { X } ( \cdot ; \theta )$ and $\mathcal { R } p _ { Y } ( \cdot ; \theta )$ are one-dimensional, the Wasserstein distance in the integrand has a closed-form solution (see equation 9). Moreover, it can be shown that $S W _ { c }$ is a true metric (Bonnotte (2013) and Kolouri et al. (2016a)), and it induces the same topology as $W _ { c }$ , at least on compact sets Santambrogio (2015). A natural transportation cost that has extensively studied in the past is the $\ell _ { 2 } ^ { 2 }$ , $c ( x , y ) { \overset { \cdot } { = } } \| x - y \| _ { 2 } ^ { 2 }$ , for which there are theoretical guarantees on existence and uniqueness of transportation plans and maps (see Santambrogio (2015) and Villani (2008)). When $c ( \bar { x , y } ) = \| x - y \| _ { p } ^ { p }$ for $p \geq 2$ , the following upper bound hold for the SW distance:
+
+$$
+S W _ { p } ^ { p } ( p _ { X } , p _ { Y } ) \leq \alpha _ { d , p } W _ { p } ^ { p } ( p _ { X } , p _ { Y } )
+$$
+
+where, $\begin{array} { r } { \alpha _ { d , p } = \frac { 1 } { d } \int _ { \mathbb { S } ^ { d - 1 } } \| \theta \| _ { p } ^ { p } d \theta \leq 1 } \end{array}$ . Chapter 5 in Bonnotte (2013) proves this inequality. In our paper, we are interested in $p = 2$ , for which $\begin{array} { r } { \alpha _ { p , d } = \frac { 1 } { d } } \end{array}$ , and we have:
+
+$$
+S W _ { 2 } ( p _ { X } , p _ { Y } ) \leq \frac { 1 } { \sqrt { d } } W _ { 2 } ( p _ { X } , p _ { Y } )
+$$
+
+In the Numerical Implementation Section, we provide a numerical experiment to compare $W _ { 2 }$ and $S W _ { 2 }$ , that confirms the above equation.
+
+# 2.3 SLICED-WASSERSTEIN AUTO-ENCODER (SWAE)
+
+Our proposed formulation for the SWAE is as follows:
+
+$$
+\begin{array} { r } { \operatorname * { a r g m i n } _ { \phi , \psi } W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } ) + \lambda S W _ { c } ( p _ { Z } , q _ { Z } ) } \end{array}
+$$
+
+where $\phi$ is the encoder, $\psi$ is the decoder, $p _ { X }$ is the data distribution, $p _ { Y }$ is the data distribution after encoding and decoding ( equation 2), $p _ { Z }$ is the distribution of the encoded data ( equation 1), $q _ { Z }$ is a predefined samplable distribution, and $\lambda$ indicates the relative importance of the loss functions. To further clarify why we use the sliced-Wasserstein distance to measure the difference between $p _ { Z }$ and $q _ { Z }$ , we reiterate that due to the lack of correspondences between $\tilde { z } _ { i } \mathbf { s }$ and $z _ { j } \mathbf { s }$ , one cannot minimize the upper-bound in equation 4, and calculation of the Wasserstein distance requires an additional optimization step to obtain the optimal coupling between $p _ { Z }$ and $q _ { Z }$ . To avoid this additional optimization, while maintaining the favorable characteristics of the Wasserstein distance, we use the sliced-Wasserstein distance to measure the discrepancy between $p _ { Z }$ and $q _ { Z }$ .
+
+# 3 NUMERICAL IMPLEMENTATION
+
+We now describe the numerical details of our approach.
+
+# 3.1 NUMERICAL IMPLEMENTATION OF THE WASSERSTEIN DISTANCE IN 1D
+
+The Wasserstein distance between two one-dimensional probability densities $p _ { X }$ and $p _ { Y }$ is obtained from equation 9. The integral in equation 9 can be numerically estimated using the midpoint Riemann sum, $\begin{array} { r } { \frac { 1 } { M } \sum _ { m = 1 } ^ { M } a _ { m } } \end{array}$ , where $a _ { m } = c ( P _ { X } ^ { - 1 } ( \tau _ { m } ) , P _ { Y } ^ { - 1 } ( \tau _ { m } ) )$ and $\begin{array} { r } { \tau _ { m } = \frac { 2 m - 1 } { 2 M } } \end{array}$ (see Fig. 1). In scenarios re only samples from s can be estimated as $x _ { m } \sim p _ { X }$ $y _ { m } \sim p _ { Y }$ cal den-, where $\begin{array} { r } { p _ { X } \approx p _ { X , M } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta _ { x _ { m } } } \end{array}$ $\begin{array} { r } { p _ { Y } \approx p _ { Y , M } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta _ { y _ { m } } } \end{array}$ $\delta _ { x _ { m } }$ is the Dirac delta function centered at $x _ { m }$ . Therefore the corresponding empirical distribution function of $p _ { X }$ is $\begin{array} { r } { P _ { X } ( t ) \approx P _ { X , M } ( t ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } u ( t - x _ { m } ) } \end{array}$ where $u ( . )$ is the step function $( P _ { Y , M } ( t )$ is defined similarly). From Glivenko-Cantelli Theorem we have that $\operatorname* { s u p } _ { t } | P _ { X , M } ( t ) - P _ { X } ( t ) | \xrightarrow { a . s . } 0 ,$ where the convergence behavior is achieved via Dvoretzky–Kiefer–Wolfowitz inequality bound: $\begin{array} { r } { P r o b ( \operatorname* { s u p } _ { t } | P _ { X , M } ( t ) - P _ { X } ( t ) | > \epsilon ) \leq 2 \exp \left( - 2 M \epsilon ^ { 2 } \right) . } \end{array}$ . Calculating the Wasserstein distance with the empirical distribution function is computationally attractive. Sorting $x _ { m } s$ in an ascending order, such that $x _ { i [ m ] } ~ \leq ~ x _ { i [ m + 1 ] }$ and where $i [ m ]$ is the index of the sorted $x _ { m } s$ , it is straightforward to see that $P _ { X , M } ^ { - 1 } ( \tau _ { m } ) = x _ { i [ m ] }$ (see Fig. 1 for a visualization). The Wasserstein distance can be approximated by first sorting $x _ { m } s$ and $y _ { m } \mathbf { s }$ and then calculating:
+
+$$
+W _ { c } ( p _ { X } , p _ { Y } ) \approxeq W _ { c } ( p _ { X , M } , p _ { Y , M } ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } c ( x _ { i [ m ] } , y _ { j [ m ] } )
+$$
+
+
+Figure 1: The Wasserstein distance for one-dimensional probability distributions $p _ { X }$ and $p _ { Y }$ (top left) is calculated based on equation 9. For a numerical implementation, the integral in equation 9 is substituted with 1 PMm= M 1 am where, am = c(P −1X (τm), P −1Y (τm)) (top right). When only samples from the distributions are available $x _ { n } \sim p _ { X }$ and $y _ { n } \sim Y$ (bottom left), the Wasserstein distance is approximated by sorting $x _ { m } s$ and $y _ { m } \mathbf { s }$ and letting $a _ { m } = c ( x _ { i [ m ] } , y _ { j [ m ] } )$ , where $i [ m ]$ and $j [ m ]$ are the sorted indices (bottom right).
+
+The problem of calculating the Wasserstein distance between samples from one-dimensional densities simplifies to solving two sorting problems (solved in $\mathcal { O } ( M ) / \mathcal { O } ( \bar { M } l o g ( M ) )$ best/worst case).
+
+We need to address one final question here. How well does equation 15 approximate the Wasserstein distance, $W _ { c } ( p _ { X } , p _ { Y } ) ?$ We first note that the rates of convergence of empirical distributions, for the $\boldsymbol { \mathrm { p } }$ -Wasserstein metric (i.e., $c ( x , y ) = | x - y | ^ { p } )$ of order $p \geq 1$ , have been extensively studied in the mathematics and statistics communities (see for instance Bobkov & Ledoux (2014) and Dedecker et al. (2015)). A detailed description of these rates is, however, beyond the scope of this paper, especially since these rates are dependent on the choice of $p$ . In short, for $p = 1$ it can be shown that E(W1(pX,M , pX ) ≤ √CM where $C$ is an absolute constant. Similar results are achieved for $\mathbb { E } ( W _ { p } ( p _ { X , M } , p _ { X } ) )$ and $( \mathbb { E } ( W _ { p } ^ { p } ( p _ { X , M } , p _ { X } ) ) ) ^ { \frac { 1 } { p } }$ , although under more strict assumptions on $p _ { X }$ (i.e., slightly stronger assumptions than having a finite second moment). Using the triangle inequality together with the convergence rates of empirical distributions with respect to the p-Wasserstein distance, see Bobkov $\&$ Ledoux (2014), for $W _ { 1 } ( p _ { X , M } , p _ { X } )$ (or more generally $W _ { p } ( p _ { X , M } , p _ { X } ) )$ ) we can show that (see supplementary material):
+
+$$
+\mathbb { E } ( W _ { 1 } ( p _ { X } , p _ { Y } ) - W _ { 1 } ( p _ { X , M } , p _ { Y , M } ) ) \leq \frac { C } { \sqrt { M } }
+$$
+
+for some absolute constant, $C$ . We reiterate that similar bounds could be found for $W _ { p }$ although with slightly more strict assumptions on $p _ { X }$ and $p _ { Y }$ .
+
+# 3.2 SLICING EMPIRICAL DISTRIBUTIONS
+
+In scenarios where only samples from the $\mathrm { d }$ -dimensional distribution, $p _ { X }$ , are available, $x _ { m } \sim p _ { X }$ , the empirical density can be estimated as $\begin{array} { r } { p _ { X , M } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta _ { x _ { m } } } \end{array}$ . Following equation 10 it is straightforward to show that the marginal densities (i.e. slices) are obtained from:
+
+$$
+\mathcal { R } p _ { X } ( t , { \boldsymbol { \theta } } ) \approx \mathcal { R } p _ { X , M } ( t , { \boldsymbol { \theta } } ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta ( t - { \boldsymbol { x } } _ { m } \cdot { \boldsymbol { \theta } } ) , \ \forall { \boldsymbol { \theta } } \in \mathbb { S } ^ { d - 1 } , \mathrm { a n d } \ \forall t \in \mathbb { R }
+$$
+
+see the supplementary material for a proof. The Dvoretzky–Kiefer–Wolfowitz upper bound holds for $\mathcal { R } p _ { X } ( t , { \theta } )$ and $\mathcal { R } p _ { X , M } ( t , \theta )$ .
+
+# 3.3 MINIMIZING SLICED-WASSERSTEIN VIA RANDOM SLICING
+
+Minimizing the sliced-Wasserstein distance (i.e., as in the second term of 14) requires an integration over the unit sphere in $\mathbb { R } ^ { d }$ , i.e., $\mathbb { S } ^ { d - 1 }$ . In practice, this integration is approximated by using a simple Monte Carlo scheme that draws uniform samples from $\bar { \mathbb { S } } ^ { d - 1 }$ and replaces the integral with a
+
+finite-sample average,
+
+$$
+S W _ { c } ( p _ { Z } , q _ { Z } ) \approx \frac { 1 } { | \Theta | } \sum _ { \theta _ { l } \in \Theta } W _ { c } ( \mathcal { R } p _ { Z } ( \cdot ; \theta _ { l } ) , \mathcal { R } q _ { Z } ( \cdot ; \theta _ { l } ) )
+$$
+
+Such Monte Carlo estimation was used in Rabin & Peyré (2011), and later used in Bonneel et al. (2015); Kolouri et al. (2018); ¸Sim¸sekli et al. (2018); Deshpande et al. (2018). Moreover, the global minimum for $S W _ { c } ( p _ { Z } , q _ { Z } )$ is also a global minimum for each $W _ { c } ( \mathcal { \bar { R } } p _ { Z } ( \cdot ; \theta _ { l } ) , \mathcal { R } q _ { Z } ( \cdot ; \theta _ { l } ) )$ . Note that $\begin{array} { r l r l } { S W _ { c } ( p z , q z ) } & { { } } & { = } & { { } } \end{array}$ $\mathbb { E } _ { \mathbb { S } ^ { ( d - 1 ) } } ( W _ { c } ( \mathcal { R } p _ { Z } ( \cdot ; \theta ) , \mathcal { R } q _ { Z } ( \cdot ; \theta ) ) )$ .
+
+A fine sampling of $\mathbb { S } ^ { d - 1 }$ , however, is required for a good approximation of $S W _ { c } ( p _ { Z } , q _ { Z } )$ . Intuitively, if $p _ { Z }$ and $q _ { Z }$ are similar, then their projections with respect to any finite subset of $\mathbb { S } ^ { d - 1 }$ would also be similar. This
+
+
+Figure 2: SW approximations (scaled by $1 . 2 2 { \sqrt { d } } )$ of the Wdistance in different dimensions, $d \in \{ 2 ^ { \bar { n } } \} _ { n = 1 } ^ { 1 0 }$ , and different number of random slices, $L$ .
+
+leads to a stochastic gradient descent scheme where in addition to the random sampling of the input data, we also random sample the projection angles from $\mathbb { S } ^ { d - 1 }$ .
+
+A natural question arises on the effect of the number of random slices, $L = | \Theta |$ , on the approximation of the SW distance. Here, we devised a simple experiment that demonstrates the effect of $L$ on aa $d$ proximating the SW distan-dimensional space, where $d \in \{ 2 ^ { \overline { { n } } } \} _ { n = 1 } ^ { 1 0 }$ ted two ran, to serve as $p _ { X } = \mathcal { N } ( \mu _ { X } , \Sigma _ { X } )$ aussand $p _ { X } = \mathcal { N } ( \mu _ { Y } , \Sigma _ { Y } )$
+
+$$
+W _ { 2 } ^ { 2 } ( p _ { X } , p _ { Y } ) = \| \mu _ { X } - \mu _ { Y } \| _ { 2 } ^ { 2 } + t r a c e ( \Sigma _ { X } + \Sigma _ { Y } - 2 ( \Sigma _ { X } ^ { \frac { 1 } { 2 } } \Sigma _ { Y } \Sigma _ { X } ^ { \frac { 1 } { 2 } } ) ^ { \frac { 1 } { 2 } } ) ,
+$$
+
+which served as the ground-truth distance between the distributions. We then measured the SW distance between $M = 1 0 0 0$ samples generated from the two Gaussian distributions using $L \in$ $\{ 1 , 1 0 , 5 0 , 1 0 0 , 5 0 0 , 1 0 0 0 \}$ random slices. We repeated the experiment for each $L$ and $d$ , a thousand times and report the means and standard deviations in Figure 2. Following equation 13 we scaled the SW distance by $\sqrt { d }$ . Moreover we found out empirically that $1 . 2 2 \sqrt { d } \mathbb { E } ( S W _ { 2 } ( p _ { X , M } , p _ { Y , M } ) ) \approx$ $W _ { 2 } ( p _ { X } , p _ { Y } )$ . It can be seen from Figure 2 that the expected value of the scaled $S W$ -distance closely follows the true Wasserstein distance. A more interesting observation is that the variance of estimation increases for higher dimensions $d$ and decreases as the number of random projections, $L$ , increases. Hence, calculating the SW distance in the image space, as in Deshpande et al. (2018), requires a very large number of projections $L$ to get a less variant approximation of the distance.
+
+# 3.4 PUTTING IT ALL TOGETHER
+
+To optimize the proposed SWAE objective function in equation 14 we use a stochastic gradient m Xrandom samples from the input data and the predefined distribution, $\{ x _ { m } \sim p _ { X } \} _ { m = 1 } ^ { M }$ $q _ { Z }$ 1 m Z m=, correspondingly. Let $\{ \theta _ { l } \} _ { l = 1 } ^ { L }$ be i.i.d be randomly sampled from a uniform distribution on $\mathbb { S } ^ { d - 1 }$ . Then using the numerical approximations described in this section, the loss function in equation 14 can be rewritten as:
+
+$$
+\mathcal { L } ( \phi , \psi ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } c ( x _ { m } , \psi ( \phi ( x _ { m } ) ) ) + \frac { \lambda } { L M } \sum _ { l = 1 } ^ { L } \sum _ { m = 1 } ^ { M } c ( \theta _ { l } \cdot \tilde { z } _ { i [ m ] } , \theta _ { l } \cdot \phi ( x _ { j [ m ] } ) )
+$$
+
+where $i [ m ]$ and $j [ m ]$ are the indices of sorted $\theta _ { l } { \cdot } \tilde { z } _ { m } s$ and $\theta _ { l } { \cdot } \phi ( x _ { m } )$ with respect to $m$ , correspondingly. The steps of our proposed method are presented in Algorithm 1. It is worth pointing out that sorting is by itself an optimization problem (which can be solved very efficiently), and therefore the sorting followed by the gradient descent update on $\phi$ and $\psi$ is in essence a min-max problem, which is being solved in an alternating fashion. Finally, we point out that each iteration of SWAE costs $\mathcal { O } ( \bar { L M l o g } ( M ) )$ operations.
+
+# Algorithm 1 Sliced-Wasserstein Auto-Encoder (SWAE)
+
+
Require:Regularization coefficient 入,and number of random projections,L.
Initialize the parameters of the encoder,Φ,and decoder,
whileand have not converged do
Sample{x1,..,xm} from training set(i.e. px)
Sample{≥1,..,zm} fromqz
Sample {01,.,} from Sk-1
Sort0t·zM such that0t· i[m]≤0t·Zi[m+1]
Sort0t·Φ(xm) such that0t:Φ(xj[m])≤0t·(xj[m+1])
M
end while
+
+# 4 EXPERIMENTS
+
+In our experiments we used three image datasets, namely the MNIST dataset by LeCun (1998), the CelebFaces Attributes Dataset (CelebA) by Liu et al. (2015), and the LSUN Bedroom Dataset by Yu et al. (2015). For the MNIST dataset we used a simple auto-encoder with mirrored classic deep convolutional neural networks with 2D average poolings, leaky rectified linear units (Leaky-ReLu) as the activation functions, and upsampling layers in the decoder. For the CelebA and LSUN datasets we used the DCGAN Radford et al. (2015) architecture similar to Tolstikhin et al. (2017).
+
+To test the capability of our proposed algorithm in shaping the latent space of the encoder, we started with the MNIST dataset and trained SWAE to encode this dataset to a two-dimensional latent space (for the sake of visualization) while enforcing a match between $p _ { X }$ and $p _ { Y }$ and $p _ { Z }$ and $q _ { Z }$ . We chose four different samplable distributions as shown in Figure 3. It can bee seen that SWAE can successfully embed the dataset into the latent space while enforcing $p _ { Z }$ to closely follow $q _ { Z }$ . In addition, we sample the two-dimensional latent spaces on a $2 5 \times 2 5$ grid in $[ - 1 , 1 ] ^ { 2 }$ and decode these points to visualize their corresponding images in the digit/image space.
+
+To get a sense of the convergence behavior of SWAE, and similar to the work of Karras et al. (2017), we calculate the Sliced Wasserstein distance between $p _ { Z }$ and $q _ { Z }$ as well as $p _ { X }$ and $p _ { Y }$ at each batch iteration where we used p-LDA Wang et al. (2011) to calculate projections (See supplementary material). We compared the convergence behavior of SWAE with the closest related work, WAE Tolstikhin et al. (2017) (specifically WAE-GAN) where an adversarial training is used to match $p _ { Z }$ to $q _ { Z }$ , while the loss function for $p _ { X }$ and $p _ { Y }$ remains exactly the same between the two methods. We repeated the experiments 100 times and report the summary of results in Figure 4. We mention that the exact same models and optimizers were used for both methods in this experiment. An interesting observation, here is that while WAE-GAN provides good or even slightly better generated random samples for MNIST (lower sliced-Wasserstein distance between $p _ { X }$ and $p _ { Y . }$ ), it fails to provide a good match between $p _ { Z }$ and $q _ { Z }$ for the choice of the prior distribution reported in Figure 4. This phenomenon seems to be related to the mode-collapse problem of GANs, where the adversary fails to sense that the distribution is not fully covered. Finally, in our experiments we did not notice a significant difference between the computational time for SWAE and WAE-GAN. For the MNIST experiment and on a single NVIDIA Tesla $P 1 0 0$ GPU, each batch iteration (batchsize $\mathord { \vert \kern - delimiterspace } = 5 0 0$ ) of WAEGAN took $0 . 2 5 7 1 \pm 0 . 0 4 3 5 ( \mathrm { s e c } )$ while SWAE (with $L = 5 0$ projections) took $0 . 2 4 3 7 \pm 0 . 0 3 9 1 ( \mathrm { s e c } )$ .
+
+
+Figure 5: Interpolation in the latent space, $\psi ( t \phi ( I _ { 0 } ) + ( 1 - t ) \phi ( I _ { 1 } ) )$ for $t \in [ 0 , 1 ]$ .
+
+
Dataset
Iteration ·10-4
Model
logSW(pz,qz)
logSW(px,Py)
NLL(Z|qz)·10
CelebA
1
SWAE
-0.81±0.05
-2.19±0.04
3.14±0.05
WAE-GAN
-0.78 ± 0.05
-2.04±0.05
3.25 ± 0.15
WAE-MMD(IMQ)
-1.44± 0.19
-2.51 ± 0.05
3.66±0.12
WAE-MMD(RBF)
3.26±0.02
-2.60±0.02
2392±89
5
SWAE
-1.80 ±0.03
-2.63±0.03
3.22±0.02
WAE-GAN
-1.37±0.12
-2.42±0.05
3.47±0.13
WAE-MMD(IMQ)
-2.15 ±0.02
-2.86±0.01
3.51± 0.04
WAE-MMD(RBF)
3.28±0.02
-2.89±0.02
2469±79
10
SWAE
-2.01 ±0.04
-2.75 ±0.03
3.24 ±0.00
WAE-GAN
-2.33±0.14
-2.55 ± 0.06
3.42 ± 0.04
WAE-MMD(IMQ)
-2.23±0.00
-2.97±0.01
3.50± 0.01
WAE-MMD(RBF)
3.23±0.02
-2.99±0.02
2227±88
LSUNBedroom
1
SWAE
-0.98 ± 0.17
-1.88 ±0.06
3.12 ±0.07
WAE-GAN
-1.18 ± 0.16
-1.90±0.07
3.31±0.16
WAE-MMD(IMQ)
-1.72 ±0.07
-2.13±0.02
3.61 ±0.04
WAE-MMD(RBF)
3.45± 0.02
-2.16±0.04
3446±152
5
SWAE
-1.94 ± 0.12
-2.34 ±0.04
3.22 ±0.02
WAE-GAN
-2.34 ± 0.04
-2.30 ± 0.04
3.40±0.08
WAE-MMD(IMQ)
-2.21 ±0.02
-2.47±0.02
3.48±0.04
WAE-MMD(RBF)
3.53±0.03
-2.47±0.02
4009±258
10
SWAE
-2.08 ±0.11
-2.46±0.03
3.23±0.01
WAE-GAN
-2.49±0.02
-2.41±0.03
3.35± 0.05
WAE-MMD(IMQ)
-2.25±0.02
-2.59±0.02
3.50±0.01
WAE-MMD(RBF)
3.48± 0.04
-2.60±0.02
3624±282
+
+Table 1: Quantitative comparison of the SWAE and WAE-GAN using the sliced-Wasserstein distance with discriminant slices in the latent space, $S W ( p _ { Z } , q _ { Z } )$ , and the output space, $S W ( p _ { X } , p _ { Y } )$ . The distribution in the 64-dimensional latent space, $q _ { Z }$ , was set to Normal. We also report the negative log-likelihood of $\{ z _ { i } = \phi ( x _ { i } ) \}$ with repect to $q _ { Z }$ for 1000 testing samples for both datasets. We did not use Nowizin’s trick for the GAN models.
+
+Table 2: FID score statistics $N = 5$ ) at final iteration of training. Lower is better. Scores were computed with $1 0 ^ { 4 }$ random samples from the testing set against an equivalent amount of generated samples.
+
+
Model
FID -CelebA
FID -LSUN Bedroom
SWAE
79±6
225±7
WAE-GAN
53±2
232±2
WAE-MMD(IMQ)
55±1
226±2
WAE-MMD(RBF)
363±17
378±12
True Data
2
3
+
+The CelebA face and the LSUN bedroom datasets contain higher degrees of variations compared to the MNIST dataset and therefore a two-dimensional latent-space does not suffice to capture the variations in these datasets (See supplementary material for more details on the dimensionality of the latent space). We used a $K = 6 4$ dimensional latent spaces for both the CelebA and the LSUN Bedroom datasets, and also used a larger auto-encoder (i.e., DCGAN, following the work of Tolstikhin et al. (2017)). For these datasets SWAE was trained with $q _ { Z }$ being the Normal distribution to enable the calculation of the negative log likelihood (NLL). Table 1 shows the comparison between SWAE and WAE for these two datasets. We note that all experimental parameters were kept the same to enable an apples to apples comparison. Finally, Figure 5 demonstrates the interpolation between two sample points in the latent space, i.e. ${ \psi } ( t \dot { \phi } ( { I _ { 0 } } ) { ^ { - } } + ( 1 - t ) { \phi } ( { I _ { 1 } } ) )$ for $t \in [ 0 , 1 ]$ , for all three datasets.
+
+# 5 CONCLUSIONS
+
+We introduced Sliced Wasserstein auto-encoders (SWAE), which enable one to shape the distribution of the encoded samples to any samplable distribution without the need for adversarial training or having a likelihood function specified. In addition, we provided a simple and efficient numerical scheme for this problem, which only relies on few inner products and sorting operations in each SGD iteration. We further demonstrated the capability of our method on three image datasets, namely the MNIST, the CelebA face, and the LSUN Bedroom datasets, and showed competitive performance, in the sense of matching distributions $p _ { Z }$ and $q _ { Z }$ , to the techniques that rely on additional adversarial trainings. Finally, we envision SWAE could be effectively used in transfer learning and domain adaptation algorithms where $q _ { Z }$ comes from a source domain and the task is to encode the target domain $p _ { X }$ in a latent space such that the distribution follows the distribution of the target domain.
+
+
+Figure 3: The results of SWAE on the MNIST dataset with a two-dimensional embedding space for four different distributions as , ${ \mathbf { } } q z$ , namely the ring distribution (top left), the uniform distribution (bottom left), the uniform polar distribution (top right), and a custom polar distribution (bottom right). Note that the far right visualization demonstrates the decoding of a $2 5 \times 2 5$ grid in $[ - 1 , 1 ] ^ { 2 }$ .
+
+
+Figure 4: Sample convergence behavior for our method compared to the WAE-GAN, where $q _ { Z }$ is set to a ring distribution (Figure 3, top left). The columns represent batch iterations (batchsize $= 5 0 0$ ). The top half of the table shows results of $\psi ( z )$ for $z \sim q _ { Z }$ , and the bottom half shows $z \sim q _ { Z }$ and $\phi ( x )$ for $x \sim p _ { X }$ . It can be seen that the adversarial loss in the latent space does not provide a full coverage of the distribution, which is a similar problem to the well-known ‘mode collapse’ problem in the GANs. It can be seen that SWAE provides a superior match between $p _ { Z }$ and $q _ { Z }$ while it does not require adversarial training.
+
+# REFERENCES
+
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017.
+
+David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
+
+Sergey Bobkov and Michel Ledoux. One-dimensional empirical measures, order statistics and kantorovich transport distances. preprint, 2014.
+
+Nicolas Bonneel, Julien Rabin, Gabriel Peyré, and Hanspeter Pfister. Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 51(1):22–45, 2015.
+
+Nicolas Bonnotte. Unidimensional and evolution methods for optimal transportation. PhD thesis, Paris 11, 2013.
+
+Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, Carl-Johann Simon-Gabriel, and Bernhard Schoelkopf. From optimal transport to generative modeling: the VEGAN cookbook. arXiv preprint arXiv:1705.07642, 2017.
+
+Mathieu Carriere, Marco Cuturi, and Steve Oudot. Sliced wasserstein kernel for persistence diagrams. arXiv preprint arXiv:1706.03358, 2017.
+
+Antonia Creswell and Anil Anthony Bharath. Adversarial training for sketch retrieval. In European Conference on Computer Vision, pp. 798–809. Springer, 2016.
+
+Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292–2300, 2013.
+
+Jérôme Dedecker, Aurélie Fischer, Bertrand Michel, et al. Improved rates for wasserstein deconvolution with ordinary smooth error in dimension one. Electronic journal of statistics, 9(1):234–265, 2015.
+
+Ishan Deshpande, Ziyu Zhang, and Alexander Schwing. Generative modeling using the sliced wasserstein distance. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
+
+Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a wasserstein loss. In Advances in Neural Information Processing Systems, pp. 2053–2061, 2015.
+
+Daniel T Gillespie. A theorem for physicists in the theory of random variables. American Journal of Physics, 51(6):520–533, 1983.
+
+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.
+
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5769–5779, 2017.
+
+Sigurdur Helgason. The radon transform on rn. In Integral Geometry and Radon Transforms, pp. 1–62. Springer, 2011.
+
+Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint, 2017.
+
+Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017.
+
+Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
+
+Soheil Kolouri and Gustavo K Rohde. Transport-based single frame super resolution of very low resolution face images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4876–4884, 2015.
+
+Soheil Kolouri, Se Rim Park, and Gustavo K Rohde. The radon cumulative distribution transform and its application to image classification. IEEE transactions on image processing, 25(2):920–934, 2016a.
+
+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, 2016b.
+
+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 Hoffman. Sliced Wasserstein distance for learning Gaussian mixture models. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 3427–, 2018.
+
+Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
+
+Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. arXiv preprint, 2016.
+
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
+
+Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
+
+Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational Bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
+
+Zak Murez, Soheil Kolouri, David Kriegman, Ravi Ramamoorthi, and Kyungnam Kim. Image to image translation for domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 4500–4509, 2018.
+
+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.
+
+Adam M Oberman and Yuanlong Ruan. An efficient linear programming method for optimal transportation. arXiv preprint arXiv:1509.03668, 2015.
+
+Julien Rabin and Gabriel Peyré. Wasserstein regularization of imaging problem. In Image Processing (ICIP), 2011 18th IEEE International Conference on, pp. 1541–1544. IEEE, 2011.
+
+Julien Rabin, Gabriel Peyré, Julie Delon, and Marc Bernot. Wasserstein barycenter and its application to texture mixing. In International Conference on Scale Space and Variational Methods in Computer Vision, pp. 435–446. Springer, 2011.
+
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
+
+Filippo Santambrogio. Optimal transport for applied mathematicians. Birkäuser, NY, pp. 99–102, 2015.
+
+Umut ¸Sim¸sekli, Antoine Liutkus, Szymon Majewski, and Alain Durmus. Sliced-wasserstein flows: Nonparametric generative modeling via optimal transport and diffusions. arXiv preprint arXiv:1806.08141, 2018.
+
+Justin Solomon, Fernando De Goes, Gabriel Peyré, Marco Cuturi, Adrian Butscher, Andy Nguyen, Tao Du, and Leonidas Guibas. Convolutional wasserstein distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):66, 2015.
+
+Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. arXiv preprint arXiv:1711.01558, 2017.
+
+Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
+
+Wei Wang, Yilin Mo, John A Ozolek, and Gustavo K Rohde. Penalized fisher discriminant analysis and its application to image-based morphometry. Pattern recognition letters, 32(15):2128–2135, 2011.
+
+Raymond A Yeh, Chen Chen, Teck Yian Lim, Alexander G Schwing, Mark Hasegawa-Johnson, and Minh N Do. Semantic image inpainting with deep generative models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5485–5493, 2017.
+
+Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a largescale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
+
+
+Figure 6: These plots show $W _ { 1 } ( p , q _ { \tau } )$ and $J S ( p , q _ { \tau } )$ where $p$ is a uniform distribution around zero and $\boldsymbol { q } _ { \ u { \tau } } ( \boldsymbol { x } ) = \boldsymbol { p } ( \boldsymbol { x } - \boldsymbol { \tau } )$ . It is clear that JS divergence does not provide a usable gradient when distributions are supported on non-overlapping domains.
+
+# SUPPLEMENTARY MATERIAL
+
+COMPARISON OF DIFFERENT DISTANCES
+
+Following the example by Arjovsky et al. (2017) and later Kolouri et al. (2018) here we show a simple example comparing the Jensen-Shannon divergence with the Wasserstein distance. First note that the Jensen-Shannon divergence is defined as,
+
+$$
+J S ( p , q ) = K L ( p , { \frac { p + q } { 2 } } ) + K L ( q , { \frac { p + q } { 2 } } )
+$$
+
+where $\begin{array} { r } { K L ( p , q ) = \int _ { X } p ( x ) l o g ( \frac { p ( x ) } { q ( x ) } ) d x } \end{array}$ is the Kullback-Leibler divergence. Now consider the following densities, $p ( x )$ be a uniform distribution around zero and let $\begin{array} { r } { q _ { \tau } ( x ) = p ( x - \tau ) } \end{array}$ be a shifted version of the $p$ . Figure 6 show $W _ { 1 } ( p , q _ { \tau } )$ and $J S ( p , q _ { \tau } )$ as a function of $\tau$ . As can be seen the JS divergence fails to provide a useful gradient when the distributions are supported on non-overlapping domains.
+
+# LOG-LIKELIHOOD
+
+To maximize (minimize) the similarity (dissimilarity) between $p _ { Z }$ and $q _ { Z }$ , we can write :
+
+$$
+\begin{array} { r c l } { { \mathrm { a r g m a x } _ { \phi } \displaystyle \int _ { Z } p _ { Z } ( z ) l o g ( q _ { Z } ( z ) ) d z } } & { { = } } & { { \displaystyle \int _ { Z } \int _ { X } p _ { X } ( x ) \delta ( z - \phi ( x ) ) l o g ( q _ { Z } ( z ) ) d x d z } } \\ { { } } & { { = } } & { { \displaystyle \int _ { X } p _ { X } ( x ) l o g ( q _ { Z } ( \phi ( x ) ) ) d x } } \end{array}
+$$
+
+where we replaced $p _ { Z }$ with equation 1. Furthermore, it is straightforward to show:
+
+$$
+\begin{array} { l l l } { { \mathrm { a r g m a x } _ { \phi } \displaystyle \int _ { Z } p _ { Z } ( z ) l o g ( q _ { Z } ( z ) ) d z } } & { { = } } & { { \mathrm { a r g m a x } _ { \phi } \displaystyle \int _ { Z } p _ { Z } ( z ) l o g ( \frac { q _ { Z } ( z ) } { p _ { Z } ( z ) } ) d z } } \\ { { } } & { { = } } & { { \mathrm { a r g m i n } _ { \phi } D _ { K L } ( p _ { Z } , q _ { Z } ) } } \end{array}
+$$
+
+PROOF OF EQUATION 3
+
+The Wasserstein distance between the two probability measures $\rho _ { X }$ and $\rho _ { Y }$ with respective densities $p _ { X }$ and $p _ { Y }$ , can be measured via the Kantorovich formulation of the optimal mass transport problem:
+
+$$
+W _ { c } ( p _ { X } , p _ { Y } ) = \operatorname* { i n f } _ { \gamma \in \Gamma } \int _ { X } \int _ { Y } c ( x , y ) \gamma ( x , y ) d x d y
+$$
+
+where $\Gamma : = \{ \gamma : X \times Y \to \mathbb { R } ^ { + } | \int _ { Y } \gamma ( x , y ) d y = p _ { X } ( x ) , \int _ { X } \gamma ( x , y ) d x = p _ { Y } ( y ) \}$ is the set of all transportation plans (i.e., couplings or joint distributions) over $p _ { X }$ and $p _ { Y }$ . Now, note that the two step process of encoding $p _ { X }$ into the latent space $Z$ and decoding it to $p _ { Y }$ , provides a unique decomposition of $\gamma$ as $\gamma _ { 0 } ( x , y ) = \delta ( y - \psi ( \phi ( x ) ) ) p _ { X } ( x ) \in \Gamma$ .
+
+
+Figure 7: The optimal coupling (i.e., transport plan) between $p _ { X }$ and $p _ { Y }$ could be equal or different from $\gamma ( x , y ) = \bar { \delta } ( y - \psi ( \phi ( x ) ) ) p _ { X } ( x )$ . This leads to the scenario on the right where $\bar { W _ { c } } ( p _ { X } , p _ { Y } ) = 0$ but $W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } ) > 0$ .
+
+Therefore we can write:
+
+$$
+\begin{array} { l } { \displaystyle { W _ { c } ( p _ { X } , p _ { Y } ) = \operatorname* { i n f } _ { \gamma \in \Gamma } \int _ { X } \int _ { Y } c ( x , y ) \gamma ( x , y ) d x d y \le } } \\ { \displaystyle { W _ { c } ^ { \dagger } ( p _ { X } , p _ { Y } ) : = \int _ { X } \int _ { Y } c ( x , y ) \gamma _ { 0 } ( x , y ) d x d y = \int _ { X } c ( x , \psi ( \phi ( x ) ) ) p _ { X } ( x ) d x } } \end{array}
+$$
+
+which proves equation 3. Finally, taking the infimum of the two sides of the inequality, with respect to $\phi$ and $\psi$ , we have:
+
+$$
+\begin{array} { l } { { \operatorname* { i n f } _ { \psi , \phi } W _ { c } ( p _ { X } , p _ { Y } ) = \operatorname* { i n f } _ { \psi , \phi } \operatorname* { i n f } _ { \gamma \in \Gamma _ { \psi , \phi } } \displaystyle \int _ { X } \int _ { Y } c ( x , y ) \gamma ( x , y ) d x d y \le } } \\ { { \operatorname* { i n f } _ { \psi , \phi } W _ { c } ^ { \dagger } ( p _ { X } , p _ { Y } ) = \operatorname* { i n f } _ { \psi , \phi } \displaystyle \int _ { X } c ( x , \psi ( \phi ( x ) ) ) p _ { X } ( x ) d x } } \end{array}
+$$
+
+where $\begin{array} { r } { \Gamma _ { \psi , \phi } : = \{ \gamma | \int _ { Y } \gamma ( x , y ) d y = p _ { X } ( x ) , \int _ { X } \gamma ( x , y ) d x = \int _ { X } p _ { X } ( x ) \delta ( y - \psi ( \phi ( x ) ) ) d x \} } \end{array}$ . Figure 7 demonstrates a simple scenario were the Wasserstein distance, $W _ { c } ( p _ { X } , p _ { Y } )$ , is zero however, $W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } )$ is non-zero. Finally, we note that $\psi ( \phi ( \cdot ) ) = i d ( \cdot )$ is a global optima for both $W _ { c } ( p _ { X } , p _ { Y } )$ and $W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } )$ .
+
+# SLICING EMPIRICAL DISTRIBUTIONS
+
+Following equation 10 a distribution can be sliced via:
+
+$$
+\mathcal { R } p _ { X } ( t , \theta ) = \int _ { X } p _ { X } ( x ) \delta ( t - \theta \cdot x ) d x
+$$
+
+Figure 8 visualizes two sample slices for an example distribution $p _ { X }$ . Here we calculate a Radon slice of the empirical distribution $\begin{array} { r } { p _ { X } ( x ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta ( x - x _ { m } ) } \end{array}$ with respect to $\theta \in \mathbb { S } ^ { d - 1 }$ . Using the definition of the Radon transform in equation 10 and RVT in equation 1 we have:
+
+$$
+\begin{array} { l l l } { \mathcal { R } p _ { X } ( t , { \boldsymbol { \theta } } ) } & { = } & { \displaystyle \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \int _ { X } \delta ( { \boldsymbol { x } } - { \boldsymbol { x } } _ { m } ) \delta ( t - { \boldsymbol { \theta } } \cdot { \boldsymbol { x } } ) d { \boldsymbol { x } } } \\ & { = } & { \displaystyle \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \delta ( { \boldsymbol { t } } - { \boldsymbol { \theta } } \cdot { \boldsymbol { x } } _ { m } ) } \end{array}
+$$
+
+
+Figure 8: Visualization of the slicing process defined in equation 10
+
+
+Figure 9: Trained SWAE outputs for sample input images with different embedding spaces of size $K = 2$ and $K = 1 2 8$ .
+
+DIMENSIONALITY OF THE LATENT SPACE
+
+Figure 9 demonstrates the outputs of trained SWAEs with $K = 2$ and $K = 1 2 8$ for sample input images. The input images were resized to $6 4 \times 6 4$ and then fed to our auto-encoder structure. This effect can also be seen for the MNIST dataset as shown in Figure 10. When the dimensionality of the latent-space (i.e. information bottleneck) is too low the latent space will not contain enough information to reconstruct crisp images. Increasing the dimensionality of the latent space leads to crisper images.
+
+# CALCULATING THE SLICED WASSERSTEIN DISTANCE AS A MEASURE OF GOODNESS OF FIT
+
+In this paper we also used the sliced Wasserstein distance as a measure of goodness of fit (for convergence analysis). To provide a fair comparison between different methods, we avoided random projections for this comparison. Instead, we calculated a discriminant subspace to separate $\psi ( z )$ from $\psi ( \phi ( x ) )$ for $z \sim q z$ and $x \sim p _ { X }$ , and set the projection parameters $\theta \mathrm { s }$ to the calculated discriminant components. This will lead to only slices that contain discriminant information. We point out that the linear discriminant analysis (LDA) is not a good choice for this task as it only leads to one discriminant component (because we only have two classes). We used the penalized linear discriminant analysis (p-LDA) that utilizes a combination of LDA and PCA. In short, p-LDA solves the following objective function:
+
+$$
+\operatorname { a r g m a x } _ { \theta } \quad { \frac { \theta ^ { T } S _ { T } \theta } { \theta ^ { T } ( S _ { W } + \alpha I ) \theta } }
+$$
+
+
+Figure 10: Interpolation results for on the MNIST dataset with various dimensions of the latent space. The parameter $t \in [ 0 , 1 ]$ indicates the interpolation parameter.
+
+where $S _ { W }$ is the within class covariance matrix, $S _ { T }$ is the data covariance matrix, $I$ is the identity matrix, and $\alpha$ identifies the interpolation between PCA and LDA (i.e. $\alpha = 0$ leads to LDA and $\alpha \to \infty$ leads to PCA).
+
+# ERROR ANALYSIS OF WASSERSTEIN DISTANCE
+
+For $p \geq 1$ we can use the triangle inequality and write
+
+$$
+\begin{array} { l l l } { { W _ { p } ( p _ { X } , p _ { Y } ) } } & { { \le } } & { { W _ { p } ( p _ { X } , p _ { X , M } ) + W _ { p } ( p _ { Y } , p _ { X , M } ) } } \\ { { } } & { { \le } } & { { W _ { p } ( p _ { X } , p _ { X , M } ) + W _ { p } ( p _ { Y } , p _ { Y , M } ) + W _ { p } ( p _ { X , M } , p _ { Y , M } ) } } \end{array}
+$$
+
+which leads to
+
+$$
+\begin{array} { r l r } { W _ { p } ( p _ { X } , p _ { Y } ) - W _ { p } ( p _ { X , M } , p _ { Y , M } ) } & { \leq } & { W _ { p } ( p _ { X } , p _ { X , M } ) + W _ { p } ( p _ { Y } , p _ { Y , M } ) } \end{array}
+$$
+
+Taking the expectation of both sides of the inequality and using the empirical convergence bounds of $W _ { p }$ (in this case $W _ { 1 }$ ) we have,
+
+$$
+\begin{array} { r c l } { \mathbb { E } ( W _ { 1 } ( p _ { X } , p _ { Y } ) - W _ { 1 } ( p _ { X , M } , p _ { Y , M } ) ) } & { \leq } & { \mathbb { E } ( W _ { 1 } ( p _ { X } , p _ { X , M } ) ) + \mathbb { E } ( W _ { 1 } ( p _ { Y } , p _ { Y , M } ) ) } \\ & { \leq } & { \displaystyle \frac { C } { \sqrt { M } } } \end{array}
+$$
+
+for some absolute constant $C$ , where the last line comes from the empirical convergence bounds of distributions with respect to the Wasserstein distance, see Bobkov & Ledoux (2014).
+
+
+
+
+
+SWAE provides a superior match between φ(x (i.e. pZ and qZwhile being less computationally expensive a ))
\ No newline at end of file
diff --git a/md/train/H38f_9b90BO/H38f_9b90BO.md b/md/train/H38f_9b90BO/H38f_9b90BO.md
new file mode 100644
index 0000000000000000000000000000000000000000..298274b0a61ab5c529427e3bd7ba96a2dc804eb4
--- /dev/null
+++ b/md/train/H38f_9b90BO/H38f_9b90BO.md
@@ -0,0 +1,604 @@
+# TOWARDS ROBUST GRAPH NEURAL NETWORKS AGAINST LABEL NOISE
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Massive labeled data have been used in training deep neural networks, thus label noise has become an important issue therein. Although learning with noisy labels has made great progress on image datasets in recent years, it has not yet been studied in connection with utilizing GNNs to classify graph nodes. In this paper, we propose a method, named LPM, to address the problem using Label Propagation (LP) and Meta learning. Different from previous methods designed for image datasets, our method is based on a special attribute (label smoothness) of graphstructured data, i.e., neighboring nodes in a graph tend to have the same label. A pseudo label is computed from the neighboring labels for each node in the training set using LP; meta learning is utilized to learn a proper aggregation of the original and pseudo label as the final label. Experimental results demonstrate that LPM outperforms state-of-the-art methods in graph node classification task with both synthetic and real-world label noise. Source code to reproduce all results will be released.
+
+# 1 INTRODUCTION
+
+Deep Neural Networks (DNNs) have achieved great success in various domains, but the necessity of collecting large amount of samples with high-quality labels is both expensive and time-consuming. To address this problem, cheaper alternatives have emerged. For example, the onerous labeling process can be completed on some crowdsourced system like Amazon Mechanical Turk 1. Besides, we can collect labeled samples from web with search engines and social media. However, all these methods are prone to produce noisy labels of low quality. As is shown in recent research (Zhang et al., 2016b), an intractable problem is that DNNs can easily overfit to noisy labels, which dramatically degrades the generalization performance. Therefore, it is necessary and urgent to design some valid methods for solving this problem.
+
+Graph Neural Networks (GNNs) have aroused keen research interest in recent years, which resulted in rapid progress in graph-structured data analysis (Kipf & Welling, 2016; Velickovic et al., 2017; Xu et al., 2018; Hou et al., 2019; Wang & Leskovec, 2020). Graph node classification is the mostcommon issue in GNNs. However, almost all the previous works about label noise focus on image classification problem and handling noisy labels in the task of graph node classification with GNNs has not been studied yet. Fortunately, most edges in the graph-structured datasets are intra-class edges (Wang & Leskovec, 2020), indicating that a node’s label can be estimated by its neighbor nodes’ labels. In this paper, we utilize this special attribute of graph data to alleviate the damages caused by noisy labels. Moreover, meta learning paradigm serves as a useful tool for us to learn a proper aggregation between origin labels and pseudo labels as the final labels.
+
+The key contributions of this paper are as follows:
+
+• To the best of our knowledge, we are the first to focus on the label noise existing in utilizing GNNs to classify graph nodes, which may serve as a beginning for future research towards robust GNNs against label noise.
+
+• We utilize meta-learning to learn how to aggregate origin labels and pseudo labels properly to get more credible supervision instead of learning to re-weight different samples.
+
+We experimentally show that our LPM outperforms state-of-the-art algorithms in utilizing GNNs to classify graph nodes with both synthetic and real-world label noise.
+
+# 2 RELATED WORK
+
+# 2.1 GRAPH NEURAL NETWORKS
+
+To start, we use $\mathcal { G } = ( \nu , \mathcal { E } , \mathcal { X } )$ to denote a graph whose nodes set is $\nu$ and edges set is $\mathcal { E }$ , and $\mathcal { X } \in R ^ { n \times d }$ is the input feature matrix, where $n$ denotes the number of nodes in the graph and $d$ is the dimension of the input feature vector of each node. We use $e _ { u , v } \in \mathcal { E }$ to denote the edge that connects node $u$ and $v$ . For each node $v \in \mathcal V$ , its neighbor nodes set can be donated as $\mathcal { N } _ { v } = \{ u : e _ { u , v } \in \mathcal { E } \}$ . For node classification task, the goal of GNNs is to learn optimal mapping function $f ( \cdot )$ to predict the class label $y _ { v }$ for node $v$ . Generally speaking, GNNs follows a framework including aggregation and combination in each layer. Different GNNs have proposed different ways of aggregation and combination. In general, the $k$ -th layer of a GNN reads
+
+$$
+a _ { v } ^ { ( k ) } = A g g r e g a t e ^ { ( k ) } ( \{ h _ { u } ^ { ( k - 1 ) } : u \in \mathcal { N } ( v ) \} ) , h _ { v } ^ { ( k ) } = C o m b i n e ^ { ( k ) } ( h _ { v } ^ { ( k - 1 ) } , a _ { v } ^ { ( k ) } ) ,
+$$
+
+where $h _ { v } ^ { ( k ) }$ is the output for $k$ -th layer of node $v$ , $h _ { v } ^ { ( 0 ) }$ is the input vector of node $v$
+
+# 2.2 LABEL PROPAGATION
+
+In Label Propagation (LP), node labels are propagated and aggregated along the edges in the graph (Zhou et al., 2004; Zhu et al., 2005; Wang & Zhang, 2007; Karasuyama & Mamitsuka, 2013). There are some works which were designed to improve the performance of label propagation. For example, Gong et al. (2016) proposed a novel iterative label propagation algorithm which explicitly optimizes the propagation quality by manipulating the propagation sequence to move from simple to difficult examples; Zhang et al. (2020) introduces a triple matrix recovery mechanism to remove noise from the estimated soft labels during propagation. Label propagation has been applied in semi-supervised image classification task. For example, Gong et al. (2017) used a weighted Knearest neighborhood graph to bridge the datapoints so that the label information can be propagated from the scarce labeled examples to unlabeled examples along the graph edges. Park et al. (2020) proposed a novel framwork to propagate the label information of the sampled data (reliable) to adjacent data along a similarity based graph. Compared to these methods, we utilize the intrinsic graph structure instead of handcrafted graph to propagate clean labels information, which is more reliable for graph-structured data. Besides, GNNs are utilized by us to extract features and classify nodes for graph-structured data.
+
+# 2.3 META-LEARNING BASED METHODS AGAINST NOISY LABELS
+
+Meta-learning aims to learn not only neural networks’ weights, but also itself, such as hand-designed parameters, optimizer and so on (Andrychowicz et al., 2016; Finn et al., 2017). Several works have utilized meta-learning paradigm to deal with label noise. For example, Li et al. (2019) has proposed to find noise-tolerant model parameters by keeping the consistency between the output of teacher and student networks, and Li et al. (2017b) trains the teacher networks with samples with clean labels and then transfer the knowledge to student networks so that the student can learn correctly even if the existence of mislabeled data. Besides, Ren et al. (2018); Jenni & Favaro (2018); Shu et al. (2019) utilize meta-learning paradigm to re-weight samples, i.e., weight samples with clean labels more and weight mislabeled samples less. The weighting factors are optimized by gradient decent or generated by a network to minimizes the loss on a small amount of samples with correct labels. In contrast, meta-learning paradigm is utilized in this paper to learn how to aggregate origin labels and pseudo labels properly. We can get more credible supervision by combining the original label information with the label information provided by LP properly.
+
+
+Figure 1: Illustration of label propagation in our method. The two types of nodes are distinguished by two colours (blue and green). The nodes surrounded by dotted line are training nodes $\mathcal { D } _ { t r a i n }$ whose label may be incorrect and those surrounded by solid line are clean sets $\mathcal { D } _ { c l e a n }$ . In Figure.1(b), one half of every training node is pseudo label predicted by LP and the other half is original label. Some nodes’ (node 5,7) pseudo labels are the same with their original labels, we select them $\mathcal { D } _ { s e l e c t }$ to train GNNs and inject them to clean sets for better label propagation. We can get proper labels for the left nodes $\mathcal { D } _ { l e f t }$ (node 6,8,9,10) based on meta learning.
+
+# 3 METHODS
+
+# 3.1 PRELIMINARIES
+
+Given a graph data with $n$ nodes and their labels $\mathcal { D } \ = \ \{ ( x _ { 0 } , y _ { 0 } ) , ( x _ { 1 } , y _ { 1 } ) , . . . , ( x _ { n - 1 } , y _ { n - 1 } ) \}$ , where $x _ { j }$ is the $j$ -th node and $y _ { j } \in \{ 0 , 1 \} ^ { c }$ is the label over $c$ classes. $\begin{array} { r l } { \mathcal { D } _ { t r a i n } } & { { } = } \end{array}$ $\left\{ { \left( x _ { 0 } , y _ { 0 } \right) } , { \left( x _ { 1 } , y _ { 1 } \right) } , . . . , { \left( x _ { s - 1 } , y _ { s - 1 } \right) } \right\}$ are training nodes with noisy labels. Our goal is to enable the GNNs $f ( x _ { j } ; w )$ trained with noisy sets $\mathcal { D } _ { t r a i n }$ can also generalize well on test nodes. $\cdot$ is the learnable parameters of GNNs. In our method, $m$ nodes with true labels $\mathcal { D } _ { c l e a n } ~ =$ $\{ ( x _ { s } , y _ { s } ) , ( x _ { s + 1 } , y _ { s + 1 } ) , . . . , ( x _ { s + m - 1 } , y _ { s + m - 1 } ) \}$ in the graph are provided as the initial clean sets $( m \ll s )$ . GCN (Kipf & Welling, 2016) and GAT (Velickovic et al., 2017) are utilized in our experiments to extract features and classify nodes. Our method includes two main parts: label propagation and label aggregation. We will go into details about these two parts in the following section 3.2 and section 3.3.
+
+# 3.2 LABEL PROPAGATION
+
+Label Propagation is based on the label smoothness that two connected nodes tend to have the same label. Therefore, the weighted average of neighbor nodes’ label of a node is similar to this node’s true label. An illustration of LP part in our method can be found in Figure. 1. The first step of LP is to construct an appropriate neighborhood graph. A common choice is $\mathbf { k }$ -nearest graph (Iscen et al., 2019; Liu et al., 2018) but there is an intrinsic graph structure (adjacency matrix $A$ ) in graph data, so our similarities matrix $W$ with zero diagonal can be constructed with $A$ , whose elements $\cdot$ are pairwise similarities between node $i$ and node $j$ :
+
+$$
+= \frac { A _ { i , j } } { d ( h _ { i } , h _ { j } ) + \varepsilon } ,
+$$
+
+where $h _ { i } , h _ { j }$ are the feature vectors extracted by GNNs for node $i$ and node $j , \ d ( \cdot , \cdot )$ is a distance measure (e.g.,Euclidean distance). $\varepsilon$ is an infinitesimal. Note that we can get $W$ with time complexity $\mathcal { O } ( | \mathcal { E } | )$ instead of $\mathcal { O } ( n ^ { 2 } )$ because $A$ is a sparse matrix whose edge lists are given. Then we can normalize the similarities matrix $W$ :
+
+$$
+S = D ^ { - 1 / 2 } W D ^ { - 1 / 2 } ,
+$$
+
+$D$ atrix withbe the sof $( i , i )$ -value to be the sum of thbel matrix in LP iteration $i$ -th rowand the f -t $W$ . Low $Y ^ { ( k ) } =$ $[ y _ { 1 } ^ { ( k ) } , . . . , y _ { n } ^ { ( k ) } ] ^ { T } \ \in \ \mathbb { R } ^ { n \times c }$ $k$ $i$ $y _ { i } ^ { ( k ) }$ predicted label distribution for node $i$ . When $k = 0$ , the initial label matrix $Y ^ { ( 0 ) } = [ y _ { 1 } ^ { ( 0 ) } , . . . , y _ { n } ^ { ( 0 ) } ] ^ { T }$
+
+consists of one-hot label vectors for $i = s , s + 1 , . . . , s + m - 1$ (i.e., initial clean sets) or zero vectors otherwise. The LP (Zhu et al., 2005) in iteration $k$ can be formulated as:
+
+$$
+Y ^ { ( k + 1 ) } = S Y ^ { ( k ) } ,
+$$
+
+$$
+y _ { i } ^ { ( k + 1 ) } = y _ { i } ^ { ( 0 ) } , \forall i \in [ s , s + m - 1 ]
+$$
+
+In Eq. (4), every node’s label in the $( k + 1 )$ -th iteration equals the weighted average of its neighbor nodes’ labels in $k$ -th iteration. In this way, the clean sets propagate labels to the noisy training nodes according to normalized edge weights. And then in Eq. (5), the labels of clean sets nodes are reset to their initial values. The reason is that we can take full advantage of the tiny minority of clean nodes and in case that the effect of clean sets fade away.
+
+Co-teaching (Han et al., 2018) and $\mathbf { C o }$ -teaching plus (Yu et al., 2019) have been proposed to train DNNs robustly against label noise. There are two DNNs which select samples with small loss from noisy training sets to train each other. Our method is similar to theirs to some extent because LP is utilized by us to select true-labeled samples from Gradients descent $\mathcal { D } _ { t r a i n }$ for training. However, instead of taking the nodes with small loss as true-labeled nodes, we select the nodes $\mathcal { D } _ { s e l e c t }$ whose original labels are same with pseudo labels for training. Original labels of $\mathcal { D } _ { s e l e c t }$ are credible and we also inject them to initial clean sets $\mathcal { D } _ { c l e a n }$ for better LP in next epoch. This is why our method can achieve better performance even if few true-labeled nodes are provided.
+
+# 3.3 META-LEARNING BASED LABEL AGGREGATION
+
+
+Figure 2: Computation graph of meta-learning based label aggregation.
+
+In section 3.2, the selected training nodes (node 5,7 in Figure.1) have been utilized for training and LP but the left training nodes $\mathcal { D } _ { l e f t }$ (node 6,8,9,10 in Figure.1) with abundant information haven’t been fully exploited. In this section, we mine the abundant and precious information from $\mathcal { D } _ { l e f t }$ via meta learning. The computation process of label aggregation is shown in Figure. 2.
+
+For $\forall ( x _ { j } , y _ { j } ) \in \mathcal { D } _ { l e f t }$ , we can get two loss values:
+
+$$
+\begin{array} { r } { l _ { 1 } = l o s s ( \hat { y } _ { j } , y _ { j } ) , } \\ { l _ { 2 } = l o s s ( \hat { y } _ { j } , \tilde { y } _ { j } ) , } \end{array}
+$$
+
+where $\hat { y } _ { j }$ is the label predicted by GNNs for training node $j$ and $\tilde { y } _ { j }$ is the pseudo label predicted by LP for node $j$ . We can also get final label ${ \overline { { y } } } _ { j }$ for node $j$ by aggregating original label $y _ { j }$ and pseudo label $\tilde { y } _ { j }$ :
+
+$$
+\overline { { y } } _ { j } = \lambda _ { j } y _ { j } + ( 1 - \lambda _ { j } ) \widetilde { y } _ { j } , \lambda _ { j } \in [ 0 , 1 ]
+$$
+
+where $\lambda$ is the aggregation coefficient. Some previous methods designed a weighting function mapping training loss to sample weights for noisy label problems (Kumar et al., 2010; Ren et al., 2018; Shu et al., 2019). Instead, we utilize a 3-layer multi-layer perceptron (MLP) as the aggregation network $g ( \cdot ; \cdot )$ to map loss values to aggregation coefficient $\lambda _ { j }$ :
+
+$$
+\lambda _ { j } = g ( l _ { 1 } \parallel l _ { 2 } ; \theta ) = \lambda _ { j } ( \theta ; w ) ,
+$$
+
+Where $l _ { 1 } \parallel l _ { 2 }$ is a 2-dimensional vector which is the concatenation of $l _ { 1 }$ and $l _ { 2 }$ and $\theta$ is the weights of aggregation network $g$ . The rationality lies on a consensus that samples’ loss values are affiliated with the credibility of samples’ original labels (Kumar et al., 2010; Shu et al., 2019; Yu et al., 2019). The MLP or aggregation networks’ input layer are 2 neurons and its output layer is one neuron, which can be an approximator to almost any continuous functions. The activation function of the last layer is sigmoid function to ensure that output $\lambda _ { j } \in [ 0 , 1 ]$ . We can get the training loss $L _ { j } ^ { t r }$ for node $j$ :
+
+$$
+L _ { j } ^ { t r } ( w , \theta ) = l o s s ( \hat { y } _ { j } ( w ) , \overline { { y } } _ { j } ( \theta ) ) ,
+$$
+
+Then we can backward on the GNNs:
+
+$$
+\hat { w } _ { t } \big ( \theta _ { t } \big ) = w _ { t } - \frac { \alpha } { \mid \mathcal { D } _ { l e f t } \mid } \sum _ { ( x _ { j } , y _ { j } ) \in \mathcal { D } _ { l e f t } } \nabla _ { w } L _ { j } ^ { t r } \big ( w , \theta _ { t } \big ) | _ { w _ { t } } ,
+$$
+
+where $\alpha$ is the learning rate of GNNs. Then we can get the loss $L ^ { c }$ on clean sets $\mathcal { D } _ { c l e a n }$
+
+$$
+L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) = \frac { 1 } { | \mathcal { D } _ { c l e a n } ~ | } \sum _ { ( x _ { i } , y _ { i } ) \in \mathcal { D } _ { c l e a n } } l o s s ( f ( x _ { i } ; \hat { w } _ { t } ( \theta _ { t } ) ) , y _ { i } ) ,
+$$
+
+Where $f ( x _ { i } ; \hat { w } _ { t } ( \theta _ { t } ) )$ is the output of GNNs. Then we can utilize $L ^ { c }$ to update the weights of aggregation network:
+
+$$
+\theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } ,
+$$
+
+where $\beta$ is the learning rate of aggregation network. Finally, GNNs’ weights can be updated:
+
+$$
+w _ { t + 1 } = w _ { t } - \frac { \alpha } { | \mathcal { D } _ { l e f t } ~ | } \sum _ { ( x _ { j } , y _ { j } ) \in \mathcal { D } _ { l e f t } } \nabla _ { w } L _ { j } ^ { t r } ( w , \theta _ { t + 1 } ) | _ { w _ { t } } .
+$$
+
+To some extent, this part is similar to re-weight based methods (Ren et al., 2018; Shu et al., 2019). However, LPM has two significant advantages. Firstly, re-weight based methods can not remove the damages caused by incorrect labels because they assign every noisy training sample a positive weight while LPM potentially has the ability to take full advantage of noisy samples positively. Secondly, LPM can generate comparatively credible labels for other usages while re-weight or some other methods can not. Algorithm. 1 shows all the steps of our algorithm.
+
+# 3.4 CONVERGENCE OF LPM
+
+Here we show theoretically that the loss functions will converge to critical points under some mild conditions. The detailed proof of the following theorems will be provided in Appendix C.
+
+Theorem 1 Suppose the loss function loss is $L$ -Lipschitz smooth, and $\lambda ( \cdot )$ is differential with a $\delta$ - bounded gradient, twice differential with its Hessian bounded by $\boldsymbol { B }$ with respect to $\theta$ . Let the learning rate $\alpha _ { t } = \operatorname* { m i n } \{ 1 , { \frac { k } { T } } \}$ , for some $k > 0$ , such that $\begin{array} { r } { { \frac { k } { T } } < 1 } \end{array}$ and learning rate $\beta _ { t }$ a monotone descent sequence, $\begin{array} { r } { \beta _ { t } = \operatorname* { m i n } \{ \frac { 1 } { L } , \frac { c } { \sqrt { T } } \} } \end{array}$ for some $c > 0$ , such that $L \leq { \frac { c } { \sqrt { T } } }$ and $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \beta _ { t } \le \infty , \sum _ { t = 1 } ^ { \infty } \beta _ { t } ^ { 2 } \le } \end{array}$ $\infty$ . Then the clean loss of Aggregation Net can achieve $\| \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \le \epsilon$ in $\mathcal { O } ( 1 / \epsilon ^ { 2 } )$ steps. More specifically,
+
+$$
+\operatorname* { m i n } _ { 0 \leq t \leq T } \| \nabla _ { \boldsymbol { \theta } } L ^ { c } ( \hat { w } ( \boldsymbol { \theta } _ { t } ) ) \| _ { 2 } ^ { 2 } \leq \mathcal { O } ( \frac { C } { \sqrt { T } } ) .
+$$
+
+Theorem 2 Under the conditions of Theorem $^ { l }$ , with the gradient of loss bounded by $\rho$ , then
+
+$$
+\operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } , \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 .
+$$
+
+Algorithm 1: LPM. Line 2-12: label propagation; Line 13-22: label aggregation.
+Data: $\overline { { \mathcal { D } , \mathcal { D } _ { t r a i n } , \mathcal { D } _ { c l e a n } } }$ , max epochs $T$ , LP iterations $K$ in every epoch, $A$ ,feature matrix
+$\mathcal { X }$ ,GNNs feature extractor $f$ , Aggregation Network $g$ , expanding clean set for LP $\cdot$
+Result: Robust GNNs parameters $w _ { T }$
+1 Dc = Dclean
+2 for $t = 0 , 1 , 2 , . . . , T - 1$ do
+3 for $\forall v \in \mathcal { D }$ do $h _ { v } = f ( x _ { v } ; w _ { t } )$ ;
+4 for (i, j) ∈ {1, 2, ..., n}2 do Wi,j = Ai,jd(hi,hj )+ε ;
+5 $\left| \begin{array} { l } { \begin{array} { r l } { Y ^ { ( k + 1 ) } = D ^ { - 1 / 2 } W D ^ { - 1 / 2 } Y ^ { ( k ) } , y _ { j } ^ { ( k + 1 ) } = y _ { j } ^ { ( 0 ) } ( \forall \bmod { e } \ j \in \mathcal { D } _ { c } ) } \end{array} } \end{array} \right.$ $k = 0 , 1 , 2 , . . . , K - 1$
+7 end
+8 $\mathcal { D } _ { s e l e c t } = \mathcal { D } _ { l e f t } = \emptyset$ ;
+9 for ∀ node $i \in \mathcal { D } _ { t r a i n }$ do
+10 if onehot $( y _ { i } ^ { ( K ) } ) = y _ { i }$ do $\mathcal { D } _ { s e l e c t } =$ node $\{ i \} \cup \mathcal { D } _ { s e l e c t }$ ;
+11 else do $\mathcal { D } _ { l e f t } = \mathrm { n o d }$ e $\{ i \} \cup \mathcal { D } _ { l e f t }$ ;
+12 end
+13 $-$
+14 $w _ { t } \gets$ one-step optimization of $w _ { t }$ with the selected nodes $\mathcal { D } _ { s e l e c t }$ ;
+15 for $\forall$ node $j \in \mathcal { D } _ { l e f t }$ do
+16 $\hat { y } _ { j } = f ( x _ { j } ; w _ { t } )$ ;
+17 $\bar { l _ { 1 } } = l o s s ( \hat { y } _ { j } , y _ { j } ) ; l _ { 2 } = l o s s ( \hat { y } _ { j } , \tilde { y } _ { j } ) ;$ ;
+18 $\lambda _ { j } = g ( l _ { 1 } \parallel \bar { l } _ { 2 } ; \bar { \theta } _ { t } )$ ;
+19 $\overline { { y } } _ { j } = \lambda _ { j } y _ { j } + ( 1 - \lambda _ { j } ) \widetilde { y } _ { j } , \lambda _ { j } \in [ 0 , 1 ] ; L _ { j } ^ { t r } ( w , \theta ) = l o s s ( \widehat { y } _ { j } ( w ) , \overline { { y } } _ { j } ( \theta ) ) ;$
+20 end
+21 $\begin{array} { r } { \hat { w } _ { t } ( \theta _ { t } ) = w _ { t } - \frac { \alpha } { | \mathcal { D } _ { l e f t } | } \sum _ { ( x _ { j } , y _ { j } ) \in \mathcal { D } _ { l e f t } } \nabla _ { w } L _ { j } ^ { t r } ( w , \theta _ { t } ) | _ { w _ { t } } ; } \end{array}$
+22 $\begin{array} { r } { L ^ { c } ( \hat { w } _ { t } ( \boldsymbol { \theta } _ { t } ) ) = \frac { 1 } { | \mathcal { D } _ { c l e a n } | } \sum _ { ( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) \in \mathcal { D } _ { c l e a n } } l o s s ( f ( \boldsymbol { x } _ { i } ; \boldsymbol { \hat { w } } _ { t } ( \boldsymbol { \theta } _ { t } ) ) , \boldsymbol { y } _ { i } ) . } \end{array}$ | P(xi,yi)∈Dclean l ;
+23 $\theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } }$ ;
+24 $\begin{array} { r } { w _ { t + 1 } = w _ { t } - \frac { \alpha } { | \mathscr { D } _ { l e f t } | } \sum _ { ( x _ { j } , y _ { j } ) \in \mathscr { D } _ { l e f t } } \nabla _ { w } L _ { j } ^ { t r } ( w ; \theta _ { t + 1 } ) | _ { w _ { t } } . } \end{array}$
+
+25 end
+
+# 4 EXPERIMENTS
+
+# 4.1 DATASETS AND IMPLEMENTATION DETAILS
+
+We validate our method on six benchmark datasets, namely citation networks (Sen et al., 2008) including Cora, Citeseer and Pubmed. Coauthor-Phy dataset (Shchur et al., 2018) is also utilized in our experiments, but the results are shown in Appendix A due to the limited space. Summary of the graph datasets mentioned above are shown in Table. 1. The Clothing1M (Xiao et al., 2015) and Webvision (Li et al., 2017a) dataset are utilized to validate the effectiveness of our method in real-world label noise settings. We take a $k \mathbf { N N }$ graph $k = 5$ ) as the graph structure so that GNNs can be applied in these two datasets, which follows previous work (Franceschi et al., 2019). More details about our preprocessing on Clothing1M and Webvision datasets can be seen in Appendix B.
+
+The experiments are conducted with two types of label noise: uniform noise and flip noise following previous works (Zhang et al., 2016a; Shu et al., 2019). The former means that the label of each sample is independently changed to a random class with probability $p$ , and the latter means that the label is independently flipped to a similar class with total probability $p$ . The ratio of training, validation, and test nodes are set as 4:4:2. Only nearly 25 nodes with clean labels in the validation set are provided as the clean set in each dataset and we ensure that each class has the same number of samples. For example, we use 8 clean samples per label class for Pubmed. GCN (Kipf & Welling, 2016) serves as the base classification network model in our experiments and it is trained using Adam (Kingma & Ba, 2014) with an initial learning rate 0.01 and a weight decay $5 \times 1 0 ^ { - 4 }$ , except that the weight decay equals to 0 in Clothing1M and Coauthor-Phy datasets.
+
+We compare LPM with multiple baselines using the same network architecture. These baselines are typical and some of them achieve state-of-the-arts performance on image datasets, which include:
+
+Table 1: Dataset statistics after removing self-loops and duplicate edges (Wang & Leskovec, 2020)
+
+
Cora
Citeseer
Pubmed
Coauthor-Phy
#nodes
2708
3327
19717
34493
#edges
5278
4552
44324
247962
#features
1433
3703
500
8415
#classes
7
6
3
5
#Intra-class edge rate
81.0%
73.6%
80.2%
93.1%
+
+Table 2: Comparison with baselines in test accuracy $( \% )$ on Cora and Citeseer with uniform noise ranging from $0 \%$ to $80 \%$ . Mean accuracy (std) over 5 repetitions are reported. The best and the second best results are highlighted in bold and italic bold respectively.
+
+
Datasets
Cora
Citeseer
Method/noise rate
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
Basemodel
87.84 (0.04)
85.92 (0.10)
82.42 (0.13)
75.77 (0.18)
56.32 (0.19)
77.67 (0.13)
76.06 (0.15)
72.97 (0.09)
67.98 (0.12)
55.26 (0.22)
GCN+FT
88.05 (0.06)
86.07 (0.13)
82.48 (0.14)
75.88 (0.15)
58.81(0.22)
77.86 (0.15)
76.24 (0.07)
73.42 (0.21)
68.13 (0.19)
56.12 (0.28)
L2RW
88.84 (0.19)
85.10 (0.21)
80.67 (0.22)
73.43 (0.42)
50.09 (0.37)
76.73 (0.20)
73.68 (0.14)
69.93 (0.29)
62.31(0.32)
46.55 (0.49)
Co-teaching plus + FT
86.76 (0.14)
83.03 (0.19)
71.68 (0.21)
50.05 (0.31)
36.39 (0.44)
76.28 (0.19)
75.49 (0.24)
72.71 (0.13)
66.63 (0.41)
56.27 (0.36)
MW-Nets
88.33 (0.16)
85.93 (0.22)
82.61 (0.45)
75.60 (0.41)
56.37 (0.51)
78.27 (0.12)
76.62 (0.14)
74.25 (0.21)
68.06 (0.25)
56.53 (0.45)
GCEloss+FT
87.87 (0.13)
85.10 (0.09)
82.89 (0.07)
76.16 (0.15)
60.43 (0.21)
78.01 (0.12)
76.54 (0.09)
74.06 (0.18)
69.18 (0.24)
58.48 (0.31)
APL+FT
87.68 (0.08)
86.26 (0.05)
82.01 (0.13)
74.49 (0.19)
58.72 (0.25)
76.54 (0.08)
74.32 (0.17)
71.77 (0.15)
66.78 (0.22)
56.08 (0.34)
Ours
88.75 (0.07)
87.46 (0.11)
83.95 (0.15)
79.66 (0.22)
63.38 (0.27)
78.12 (0.13)
77.07 (0.06)
75.19 (0.15)
70.05 (0.11)
61.71 (0.22)
+
+Base model, referring to the GCN that directly trained on noisy training nodes; Meta-learning based methods L2RW (Ren et al., 2018), MW-Nets (Shu et al., 2019); Typical and effective method Co-teaching plus (Yu et al., 2019); Robust loss function against label noise GCE loss (Zhang & Sabuncu, 2018) and APL (Ma et al., 2020); The most recent method based on co-training JoCoR (Wei et al., 2020). For those baselines that don’t need clean sets (Base model, Co-teaching plus, GCE loss, JoCoR and APL), we finetune (denoted by FT in this paper) them on the initial clean sets after the model was trained on training sets for a fair comparison. More experimental details about LPM and all baselines are available in the Appendix B.
+
+# 4.2 RESULTS
+
+Table. 2 shows the results on Cora and Citeseer with different levels of uniform noise ranging from $0 \%$ to $80 \%$ . Every experiment are repeated 5 times with different random seeds. Finally, we report the best test accuracy across all epochs averaged over 5 repetitions for each experiment. As can be seen in Table. 2, our method gets the best performance across all the datasets and all noise rates, except the second for $0 \%$ uniform noise rate. Our method performs even better when the labels are corrupted at high rate. Table. 3 shows the performance on Cora, Citeseer and Pubmed with different levels of flip noise ranging from $0 \%$ to $40 \%$ . It can be seen that our method also outperforms state-of-the-arts methods under flip noise across different noise rate, except that the second for $0 \%$ flip noise rate. Our method outperforms the corresponding second best method by a large margin when the noise rate is 0.4. As can be seen in Table. 4, our method can also perform better than other baselines in datasets with real-world label noise. We also experiment with Graph Attention Networks (Velickovic et al., 2017) as the feature extractor and classifier, the results shown in Appendix A demonstrate that our method can also perform well with other GNNs.
+
+Table 3: Comparison with baselines in test accuracy $( \% )$ on Cora , Citeseer and Pubmed with flip noise ranging from $0 \%$ to $40 \%$ . Mean accuracy (std) over 5 repetitions are reported. The best and the second best results are highlighted in bold and italic bold respectively.
+
+
Datasets
Cora
Citeseer
Pubmed
Method/noise rate
0
0.2
0.4
0
0.2
0.4
0
0.2
0.4
Basemodel
87.84 (0.04)
81.64 (0.11)
61.12 (0.24)
77.67 (0.13)
75.91 (0.14)
52.67 (0.35)
86.18 (0.08)
85.30 (0.21)
74.21 (0.29)
GCN+FT
88.05 (0.06)
82.89 (0.14)
67.39 (0.42)
77.86 (0.15)
75.08 (0.22)
61.41 (0.23)
86.21 (0.09)
85.55 (0.24)
80.88 (0.32)
L2RW
88.84 (0.19)
80.90 (0.21)
59.00 (0.34)
76.73 (0.20)
71.85 (0.25)
50.04 (0.44)
86.34 (0.14)
84.54 (0.19)
76.97 (0.31)
Co-teaching plus+FT
86.76 (0.14)
81.37 (0.21)
53.00 (0.51)
76.28 (0.19)
74.66 (0.21)
60.59 (0.33)
85.59 (0.09)
84.61 (0.22)
73.99 (0.33)
MW-Nets
88.33 (0.16)
85.33 (0.23)
67.71 (0.43)
78.27 (0.12)
76.84 (0.19)
61.97 (0.33)
86.02 (0.07)
84.74 (0.17)
78.59 (0.28)
GCEloss+FT
87.87 (0.13)
83.21 (0.13)
67.80 (0.37)
78.01 (0.12)
76.36 (0.20)
63.66 (0.46)
86.15 (0.11)
85.47 (0.06)
80.03 (0.42)
APL+FT
87.68 (0.08)
81.09 (0.14)
70.07 (0.19)
76.54 (0.08)
73.38 (0.13)
60.81 (0.52)
86.16 (0.05)
85.52 (0.06)
70.08 (0.16)
Ours
88.75 (0.07)
86.95 (0.12)
78.97 (0.33)
78.12 (0.13)
76.39 (0.14)
69.71 (0.39)
86.48 (0.05)
85.58 (0.13)
83.15 (0.36)
+
+Table 4: Comparison with baselines in test accuracy $( \% )$ on Clothing1M and Webvision. Mean accuracy $\pm$ std) over 5 repetitions are reported. The best is highlighted in bold.
+
+
Methods
Basemodel
GCN+FT
L2RW
MW-Nets
GCEloss+FT
JoCoR+FT
Ours
Clothing1M
35.83±0.03
38.05±0.13
53.5±0.08
54.15±0.23
56.9±0.08
56.3±0.12
57.35±0.11
Webvision
32.43±0.05
34.58±0.08
50.12±0.16
52.42±0.25
53.45±0.13
54.12±0.22
55.43±0.17
+
+
+Figure 3: Comparsion of the true-labeled samples rate in $\mathcal { D } _ { t r a i n }$ and $\mathcal { D } _ { s e l e c t }$ in various datasets.
+
+Table 5: The performance of LPM without label aggregation and LPM with random $\lambda$ in Citeseer.
+
+
Noise type
Uniform noise
Flip noise
Method/noise rate
0
0.2
0.4
0.6
0.8
0.2
0.4
Ours w/o label aggregation
72.07
68.36
65.69
62.16
54.39
69.26
63.14
Ours with random 入
76.88
75.08
72.07
68.28
57.40
74.89
68.30
Ours with tuned 入
77.22
76.31
73.55
69.17
58.54
75.11
68.72
Ours
78.12
77.07
75.19
70.05
61.71
76.39
69.71
+
+# 4.3 ANALYSIS OF THE NECESSITY AND EFFECTIVENESS OF DIFFERENT PARTS
+
+We design five experiments to validate the necessity and effectiveness of different components of our algorithm. Firstly, we compare the ratio of truelabeled nodes in $\mathcal { D } _ { s e l e c t }$ with $\mathcal { D } _ { t r a i n }$ in the last epoch to validate the effectiveness of LP. Figure. 3 shows the ratio of true-labeled nodes in $\mathcal { D } _ { s e l e c t }$ in the last epoch and $\mathcal { D } _ { t r a i n }$ under uniform noise on various datasets. It can be found that nearly all the nodes selected by LP are true-labeled even if most training nodes are mislabeled, which demonstrates the great ability of LP to select true-labeled nodes from noisy training nodes. Secondly, we remove the label aggregation in LPM to validate its necessity and the result shows that the performance of our method become much worse without label aggregation. It is necessary to mine the potential information from the left noisy training nodes after LP selection. Besides, we validate the effectiveness by replacing the learned aggregation coefficients $\lambda$ with random numbers between 0 and 1. It is obvious that the aggregation coefficients $\lambda$ optimized by meta learning outperform random $\lambda$ . Also, we assign the percentage of clean nodes of each label class as $\cdot$ (tuned) for comparison. These validate the effectiveness of the meta-learning based label aggregation. The results of above two experiments are shown in Table. 5. We denote the average of $\cdot$ of clean nodes and noisy nodes in $\mathscr { D } _ { l e f t }$ as $\lambda _ { c l e a n }$ and $\cdot$ respectively, $-$ . We plot the variation of $\cdot$ during training stage in Figure. 4. It can be observed that $\lambda _ { c l e a n } > \lambda _ { n o i s e }$ across the training stage and the margin between $\lambda _ { c l e a n }$ and $\cdot$ grows larger with the training process, which suggests that $\lambda$ optimized by our method is valid.
+
+
+Figure 4: $\Delta \lambda$ varies during the training stage on Cora with various uniform noise rate.
+
+
+Figure 5: Test accuracy on Cora and Citeseer across various flip noise rate.
+
+# 4.4 IMPACT OF FINETUNING AND NOISE RATE
+
+We would like to investigate how our baselines can perform without finetuning. As can be seen in Figure. 5, the performance of the baselines will degenerate relatively significantly without finetuning across different noise rate. This illustrates that some baselines (without finetuning) that are designed for image datasets may perform relatively poor on graph-structured data and this motivates our work which trains GNNs robustly utilizing the structure information of graph data. Besides, We can also observe that our method only drops nearly $9 \%$ when the flip noise rate increased from $0 \%$ to $40 \%$ , whereas the baseline has dropped nearly $2 0 \% - 3 0 \%$ , which illustrates that our method is more robust, especially at high noise rate. At $0 \%$ noise, our method only slightly underperforms reweights besed methods. This is reasonable because the original labels are all correct but our method will inevitably perturb a few clean labels while the re-weights based methods will not.
+
+# 4.5 SIZE OF THE CLEAN SET
+
+We try to strike a balance and understand when finetuning will be effective. As can be seen in Figure. 6, our method can also perform better even if the size of clean set is extremely small. The overall test accuracy does not grow much when the size of clean set is large enough. Besides, the test accuracy of baselines with fintuning will increase significantly when the size of clean set grows larger. This suggests that finetuning will be valid when the size of clean set grows larger because GNNs can achieve good performance with relatively less samples (Kipf & Welling, 2016; Velickovi ˇ c et al., 2017). From this perspective, our method can also serve as complementary for ´ finetuning based methods when the size of clean set is large enough.
+
+
+Figure 6: Test accuracy on Cora and Citeseer across various size of clean set.
+
+# 5 CONCLUSION AND FUTURE WORK
+
+In this work, we proposed a robust framwork for GNNs against label noise. This is the first method that specially designed for label noise problem existing in utilizing GNNs to classify graph nodes and it outperforms state-of-the-arts methods in graph-structured data, which may serve as the beginning for future research towards robust GNNs against label noise. As a future work, we may design an inductive robust method. Besides, better methods that don’t need clean sets are also the goals of us.
+
+# REFERENCES
+
+Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in neural information processing systems, pp. 3981–3989, 2016.
+
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
+
+Luca Franceschi, Mathias Niepert, Massimiliano Pontil, and Xiao He. Learning discrete structures for graph neural networks. arXiv preprint arXiv:1903.11960, 2019.
+
+Chen Gong, Dacheng Tao, Wei Liu, Liu Liu, and Jie Yang. Label propagation via teaching-tolearn and learning-to-teach. IEEE transactions on neural networks and learning systems, 28(6): 1452–1465, 2016.
+
+Chen Gong, Hengmin Zhang, Jian Yang, and Dacheng Tao. Learning with inadequate and incorrect supervision. In 2017 IEEE International Conference on Data Mining (ICDM), pp. 889–894. IEEE, 2017.
+
+Edward Grefenstette, Brandon Amos, Denis Yarats, Phu Mon Htut, Artem Molchanov, Franziska Meier, Douwe Kiela, Kyunghyun Cho, and Soumith Chintala. Generalized inner loop metalearning. arXiv preprint arXiv:1910.01727, 2019.
+
+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, pp. 8527–8537, 2018.
+
+Yifan Hou, Jian Zhang, James Cheng, Kaili Ma, Richard TB Ma, Hongzhi Chen, and Ming-Chang Yang. Measuring and improving the use of graph information in graph neural networks. In International Conference on Learning Representations, 2019.
+
+Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Label propagation for deep semisupervised learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5070–5079, 2019.
+
+Simon Jenni and Paolo Favaro. Deep bilevel learning. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 618–633, 2018.
+
+Masayuki Karasuyama and Hiroshi Mamitsuka. Manifold-based similarity adaptation for label propagation. In Advances in neural information processing systems, pp. 1547–1555, 2013.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
+
+M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In Advances in neural information processing systems, pp. 1189–1197, 2010.
+
+Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S Kankanhalli. Learning to learn from noisy labeled data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5051–5059, 2019.
+
+Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data. arXiv preprint arXiv:1708.02862, 2017a.
+
+Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1910–1918, 2017b.
+
+Yanbin Liu, Juho Lee, Minseop Park, Saehoon Kim, Eunho Yang, Sung Ju Hwang, and Yi Yang. Learning to propagate labels: Transductive propagation network for few-shot learning. arXiv preprint arXiv:1805.10002, 2018.
+
+Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. Normalized loss functions for deep learning with noisy labels. arXiv preprint arXiv:2006.13554, 2020.
+
+Hyoungseob Park, Minki Jeong, Youngeun Kim, and Changick Kim. Self-training of graph neural networks using similarity reference for robust training with noisy labels. In 2020 IEEE International Conference on Image Processing (ICIP), pp. 1951–1955. IEEE, 2020.
+
+Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018.
+
+Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
+
+Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
+
+Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-weightnet: Learning an explicit mapping for sample weighting. In Advances in Neural Information Processing Systems, pp. 1919–1930, 2019.
+
+Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv: Machine Learning, 2017.
+
+Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
+
+Fei Wang and Changshui Zhang. Label propagation through linear neighborhoods. IEEE Transactions on Knowledge and Data Engineering, 20(1):55–67, 2007.
+
+Hongwei Wang and Jure Leskovec. Unifying graph convolutional neural networks and label propagation. arXiv preprint arXiv:2002.06755, 2020.
+
+Hongxin Wei, Lei Feng, Xiangyu Chen, and Bo An. Combating noisy labels by agreement: A joint training method with co-regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
+
+Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. pp. 2691–2699, 2015.
+
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
+
+Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor W Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? arXiv preprint arXiv:1901.04215, 2019.
+
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016a.
+
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016b.
+
+Huan Zhang, Zhao Zhang, Mingbo Zhao, Qiaolin Ye, Min Zhang, and Meng Wang. Robust triplematrix-recovery-based auto-weighted label propagation for classification. IEEE Transactions on Neural Networks and Learning Systems, 2020.
+
+Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in neural information processing systems, pp. 8778–8788, 2018.
+
+Dengyong Zhou, Olivier Bousquet, Thomas N Lal, Jason Weston, and Bernhard Scholkopf. Learn- ¨ ing with local and global consistency. In Advances in neural information processing systems, pp. 321–328, 2004.
+
+Xiaojin Zhu, John Lafferty, and Ronald Rosenfeld. Semi-supervised learning with graphs. PhD thesis, Carnegie Mellon University, language technologies institute, school of . . . , 2005.
+
+# A APPENDIX : ADDITIONAL EXPERIMENT RESULTS
+
+Table A.6: Comparison with baselines in test accuracy $( \% )$ on Cora and Pubmed with flip noise ranging from $0 \%$ to $40 \%$ and Graph Attention Networks. The best result are highlighted in bold.
+
+
Datasets
Cora
Pubmed
Methods/Noise rate
0
0.2
0.4
0
0.2
0.4
GAT
89.85
84.13
67.10
85.55
84.57
74.11
GAT+FT
89.85
84.50
73.12
85.55
84.57
80.55
MW-Nets
87.52
84.26
69.99
85.64
84.5
75.82
Co-teaching plus+FT
88.56
85.42
74.94
85.56
84.48
82.40
GCEloss+FT
89.98
84.38
74.23
85.45
84.54
80.65
JoCoR+FT
90.16
85.00
73.74
85.47
84.58
80.95
Ours
89.92
87.20
75.65
85.72
84.62
83.00
+
+Table A.7: Comparison with baselines in test accuracy $( \% )$ on Coauthor-Phy with flip noise ranging from $0 \%$ to $40 \%$ . The best result are highlighted in bold.
+
+
Method/Noise rate
0.0
0.1
0.2
0.3
0.4
Basemodel
96.92
96.32
95.57
94.91
86.25
GCN+FT
96.96
96.41
95.54
94.46
92.25
Co-teaching plus+FT
96.45
96.39
96.10
95.27
92.79
MW-Nets
96.56
96.24
95.62
95.56
89.25
GCEloss+FT
96.99
96.58
95.96
94.77
93.64
JoCoR+FT
96.83
96.59
96.07
94.95
94.11
Ours
96.75
96.71
96.49
96.14
95.14
+
+We also take Graph Attention Networks (GAT) as the feature extractor and classifier and the results shown in Table. A.6 validate that our method can also perform well with various GNNs. Besides, LPM can also perform better than other baselines in larger graph dataset Coauthor-Phy, the results can be seen in Table. A.7. We also demonstrate confusion matrices of Basemodel and LPM in Figure. A.4, which visually show that our method can improve the robustness against label noise of GNNs by a large margin.
+
+# B APPENDIX : ADDITIONAL DETAILS OF OUR EXPERIMENTS
+
+Original Clothing1M and Webvision datasets are all large-scale datasets with real-world label noise. We randomly choose 5000 images in 10 classes from original datasets and every image serves as a node in the graph, a kNN graph $\left( \mathrm { k } \mathrm { = } 5 \right)$ is treated as the graph structure so that GNNs can be applied in Clothing1M datasets. This setting is similar to some previous works which also aim to apply GNNs in datasets without graph structure. ResNet-50 with ImageNet pretrained weights is utilized by us to extract feature vectors for all the images.
+
+Table. A.8 shows the different hyper-parameters in LPM experiments for different datasets. In all the experiments, 25 true-labeled nodes are utilized as the initial clean sets or as the samples for finetuning and the total epoch of all the experiments is 300. In Co-teaching plus experiment, the initial epoch is 270, the forget rate is 0.1 and 5 epochs for linear drop rate ,the exponent of the forget rate is 1. For MW-Nets, the dimension of the meta net’s middle layer is 100 and the learning rate is $5 \times 1 0 ^ { - 3 }$ . $q$ for GCEloss is 0.1. The combination of Normalized Focal Loss and Mean Absolute Error is utilized in APL experiments, the weight of Normalized Focal Loss is 0.1 and the weight of Mean Absolute Error is 10. For JoCoR experiments, the epochs for linear drop rate is 5 and the exponent of the forget rate is 2. The balance coefficient between conventional supervised learning loss and contrastive loss is 0.01. The learning rate and weight decay of Graph Attention Networks are 0.01 and $5 \times 1 0 ^ { - 4 }$ . The dimension of hidden layer of GAT is 16 and the number of head attentions is 8. The alpha of the leaky relu is 0.2 and the dropout rate is 0.5. Throughout this work we implemented gradient based meta-learning algorithms in PyTorch using the Higher library (Grefenstette et al., 2019).
+
+Table A.8: The hyper-parameters of LPM in different datasets.
+
+
Cora
Citeseer
Pubmed
Coauthor-Phy
Clothing1M
Aggregation Net's learning rate
1×10-4
1×10-4
1×10-3
1×10-3
1×10-3
Aggregation Net's mid-dimension
64
100
100
64
50
Aggregation Net's weight decay
1×10-4
1×10-4
1×10-4
1×10-4
1×10-4
LPA iterations
50
50
50
50
50
+
+
+Figure A.4: Confusion matrices of Basemodel and LPM on various datasets under $40 \%$ flip noise. Figure. 4(a)-4(c) are the results of Basemodel. Figure. 4(d)-4(f) are the results of LPM.
+
+# C APPENDIX : CONVERGENCE OF LPM
+
+Our proof of the convergence of LPM mainly follow some previous works (Ren et al., 2018; Shu et al., 2019) that utilize meta-learning to reweight noisy training samples. As is illustrated in some previous works (Zhou et al., 2004; Zhu et al., 2005), LPA will converge to a fixed point. Namely, $\mathcal { D } _ { s e l e c t }$ and $\mathcal { D } _ { l e f t }$ will converge to fixed sets. In our proof, the final $\mid \mathcal { D } _ { l e f t } \mid$ and final $\mid \mathcal { D } _ { c l e a n } \mid$ are denoted with $n$ and $m$ for easier illustration. Loss function loss is denoted by $l$ in this proof. Here we first rewrite the forward and backward equations as follows:
+
+$$
+\begin{array} { c } { { \displaystyle \hat { y } _ { j } = f ( x _ { j } ; w _ { t } ) = y _ { j } ( w ) \vert _ { w _ { t } } } } \\ { { \lambda _ { j } = g ( l ( y _ { j } , \hat { y } _ { j } ) \parallel l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ; \theta _ { t } ) = \lambda _ { j } ( \theta ; w _ { t } ) \vert _ { \theta _ { t } } } } \\ { { { } } } \\ { { { \cal L } ^ { t r } ( w _ { t } ; \theta _ { t } ) = \displaystyle \frac { 1 } { n } \sum _ { j = 1 } ^ { n } l ( \lambda _ { j } y _ { j } + ( 1 - \lambda _ { j } ) \tilde { y } _ { j } , \hat { y } _ { j } ) } } \\ { { \hat { w } _ { t } ( \theta _ { t } ) = w _ { t } - \alpha \nabla _ { w } L ^ { c } ( w ; \theta _ { t } ) \vert _ { w _ { t } } } } \end{array}
+$$
+
+$$
+\begin{array} { c } { \displaystyle \hat { y } _ { i } = f ( \boldsymbol { x } _ { i } ; \hat { \boldsymbol { w } } _ { t } ) = y _ { i } ( \hat { \boldsymbol { w } } ; \boldsymbol { x } _ { i } ) \vert _ { \hat { \boldsymbol { w } } _ { t } } } \\ { \displaystyle L ^ { c } ( \hat { \boldsymbol { w } } ) \vert _ { \hat { \boldsymbol { w } } _ { t } } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } L _ { i } ^ { c } ( \hat { \boldsymbol { w } } ) \vert _ { \hat { \boldsymbol { w } } _ { t } } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } L _ { i } ^ { c } ( \hat { w } _ { t } ( \boldsymbol { \theta } ) ) \vert _ { \theta _ { t } } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } l ( y _ { i } , \hat { y } _ { i } ) } \\ { \displaystyle \theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \boldsymbol { \theta } } L ^ { c } ( \hat { w } ( \boldsymbol { \theta } ) ) \vert _ { \theta _ { t } } } \\ { \displaystyle w _ { t + 1 } = w _ { t } - \alpha \nabla _ { \boldsymbol { w } } L ^ { t r } ( w ; \theta _ { t + 1 } ) \vert _ { w _ { t } } } \end{array}
+$$
+
+$( x _ { j } , y _ { j } )$ is node from the final left training set $\mathcal { D } _ { l e f t }$
+
+$( x _ { i } , y _ { i } )$ is node from the final clean set $\mathcal { D } _ { c l e a n }$ ;
+
+$f$ is the GCN for classification with its weights $w$ ;
+$g$ is the Aggregation Net whose input are the nodes from clean set with its weights $\theta$ ;
+$L ^ { c }$ is the loss on clean sets. $L ^ { t r }$ is the final training loss.
+
+$l ( y , \hat { y } )$ is the loss (such as Cross Entropy) which satisfies linearity given by
+
+$$
+l ( \lambda y _ { 1 } + ( 1 - \lambda ) y _ { 2 } , \hat { y } ) = \lambda l ( y _ { 1 } , \hat { y } ) + ( 1 - \lambda ) l ( y _ { 2 } , \hat { y } ) .
+$$
+
+# Derivation of the equation of updating the weights in Aggregation Net
+
+$$
+\frac { 1 } { m } \sum _ { i = 1 } ^ { m } \nabla _ { \theta } L _ { i } ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \frac { \partial L _ { i } ^ { c } ( \hat { w } ) } { \partial \hat { w } } | _ { \hat { w } _ { t } } \sum _ { j = 1 } ^ { n } \frac { \partial \hat { w } _ { t } ( \theta ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } \frac { \partial \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta } | _ { \theta _ { t } } .
+$$
+
+According to Equation (20)
+
+$$
+\begin{array} { l } { \displaystyle \dot { \varpi } _ { t } ( \theta ) | _ { \theta _ { t } } = w _ { t } - \alpha \nabla _ { w _ { t } } \frac { 1 } { n _ { j = 1 } ^ { n } } { l ( \lambda _ { j } y _ { j } + ( 1 - \lambda _ { j } ) \tilde { y } _ { j } , \hat { y } _ { j } ) } } \\ { \displaystyle \frac { \partial \hat { w } _ { t } ( \theta ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } = - \frac { \alpha } { n } \nabla _ { w _ { t } } \frac { \partial ( l _ { \lambda j } y _ { j } + ( 1 - \lambda _ { j } ) \tilde { y } _ { j } , \hat { y } _ { j } ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } } \\ { \displaystyle \frac { \partial \hat { w } _ { t } ( \theta ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } = - \frac { \alpha } { n } \nabla _ { w _ { t } } \frac { \partial [ \lambda _ { j } l ( y _ { j } , \hat { y } _ { j } ) + ( 1 - \lambda _ { j } ) l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ] } { \partial \lambda _ { j } } | _ { \theta _ { t } } } \\ { \displaystyle \frac { \partial \hat { w } _ { t } ( \theta ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } = - \frac { \alpha } { n } \nabla _ { w _ { t } } ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) | _ { \theta _ { t } } } \\ { \displaystyle \frac { \partial \hat { w } _ { t } ( \theta ) } { \partial \lambda _ { j } } | _ { \theta _ { t } } = - \frac { \alpha } { n } \frac { \partial ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) } { \partial w _ { t } } | _ { w _ { t } } } \end{array}
+$$
+
+Therefore, Equation (25) can be written as
+
+$$
+\begin{array} { r l } & { \frac { 1 } { m } \displaystyle \sum _ { i = 1 } ^ { m } \nabla _ { \theta } L _ { i } ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } } \\ & { = - \frac { \alpha } { m } \displaystyle \sum _ { i = 1 } ^ { m } \frac { \partial L _ { i } ^ { c } ( \hat { w } ( \theta ) ) } { \partial \hat { w } } | _ { \hat { w } _ { i } } \sum _ { j = 1 } ^ { n } \frac { \partial \left( l ( y _ { j } , \hat { y } _ { j } ) - l ( \hat { y } _ { j } , \hat { y } _ { j } ) \right) } { \partial w _ { t } } | _ { w _ { t } } \frac { \partial \lambda _ { j } \left( \theta ; w _ { t } \right) } { \partial \theta } | _ { \theta _ { t } } } \\ & { = - \frac { \alpha } { n } \displaystyle \sum _ { j = 1 } ^ { n } ( \frac { 1 } { m } \displaystyle \sum _ { i = 1 } ^ { m } \frac { \partial L _ { i } ^ { c } ( \hat { w } ( \theta ) ) } { \partial \hat { w } } | _ { \hat { w } _ { i } } \frac { \partial \left( l ( y _ { j } , \hat { y } _ { j } ) - l ( \hat { y } _ { j } , \hat { y } _ { j } ) \right) } { \partial \theta } | _ { w _ { t } } \frac { \partial \lambda _ { j } \left( \theta ; w _ { t } \right) } { \partial \theta } | _ { \theta _ { t } } } \\ & { = - \frac { \alpha } { n } \displaystyle \sum _ { j = 1 } ^ { n } ( \frac { 1 } { m } \displaystyle \sum _ { i = 1 } ^ { m } G _ { i j } ) \frac { \partial \lambda _ { j } \left( \theta ; w _ { t } \right) } { \partial \theta } | _ { \theta _ { t } } \mu _ { \epsilon } } \\ & { + \frac { \partial L _ { i } ^ { c } ( \hat { w } ) } { \partial \theta } | _ { \hat { w } _ { i } } \frac { \partial \left( l ( y _ { j } , \hat { y } _ { j } ) - l ( \hat { y } _ { j } , \hat { y } _ { j } ) \right) } { \partial \theta } | _ { \theta _ { t } } . } \end{array}
+$$
+
+where
+
+Lemma 1. Suppose the loss function $l$ is $\mathrm { L }$ -Lipschitz smooth, and $\lambda ( \cdot )$ is differential with a $\delta$ -bounded gradient, twice differential with its Hessian bounded by $\boldsymbol { B }$ with respcet to $\theta$ , and the loss function $l ( \cdot , \cdot )$ have $\rho$ -bounded gradients with respect to the parameter $w$ . Then the gradient of $w$ with respect to $L _ { i } ^ { c } ( \hat { w } )$ is Lipschitz continuous.
+
+Proof. The supposition is equivalent to the following inequalities,
+
+$$
+\| \nabla _ { \hat { w } } L ^ { c } ( \hat { w } ) | _ { w _ { 1 } } - \nabla _ { \hat { w } } L ^ { c } ( \hat { w } ) | _ { w _ { 2 } } \| \leq L \| w _ { 1 } - w _ { 2 } \| ,
+$$
+
+for any $w _ { 1 } , w _ { 2 }$ ;
+
+$$
+\begin{array} { r l r } & { } & { \| \nabla _ { \theta } \lambda ( \theta ; w _ { t } ) \| \le \rho ; } \\ & { } & { \| \nabla _ { \theta ^ { 2 } } ^ { 2 } \lambda ( \theta ; w _ { t } ) \| \le \mathcal B ; } \\ & { } & { \| \nabla _ { w } l ( y _ { i } , \hat { y } _ { i } ( ( \hat { w } _ { t } ( w ) ; x _ { i } ) ) ) \| \le \delta . } \end{array}
+$$
+
+The gradient of $\theta$ with respect to loss on clean set reads
+
+$$
+\begin{array} { l } { { \displaystyle \nabla _ { \theta } L _ { i } ^ { c } ( \hat { w } ( \theta ) ) \big | _ { \theta _ { t } } } } \\ { { \displaystyle = - \frac { \alpha } { n } \sum _ { j = 1 } ^ { n } \frac { \partial L _ { i } ^ { c } ( \hat { w } ) } { \partial \hat { w } } \vert _ { \hat { w } _ { t } } ^ { T } \frac { \partial ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) } { \partial { w _ { t } } } \vert _ { w _ { t } } \frac { \partial \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta } \vert _ { \theta _ { t } } } } \\ { { \displaystyle = - \frac { \alpha } { n } \sum _ { j = 1 } ^ { n } G _ { i j } \frac { \partial \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta } \vert _ { \theta _ { t } } } } \end{array}
+$$
+
+Taking the gradient of $\theta$ in both sides of the equation, we have
+
+$$
+\nabla _ { \theta ^ { 2 } } ^ { 2 } L _ { i } ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } = - \frac { \alpha } { n } \sum _ { j = 1 } ^ { n } ( \frac { \partial G _ { i j } } { \partial \theta } | _ { \theta _ { t } } \frac { \partial \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta } | _ { \theta _ { t } } + ( G _ { i j } ) \frac { \partial ^ { 2 } \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta ^ { 2 } } | _ { \theta _ { t } } ) .
+$$
+
+For the first term in summation,
+
+$$
+\begin{array} { r l } & { \quad \| \frac { \partial G _ { i j } } { \partial \vartheta } | _ { \kappa _ { i } } \frac { \partial \lambda _ { j } ( \theta ; w _ { i } ) } { \partial \vartheta } | _ { \kappa _ { i } } \| } \\ & { \quad \le \delta \| \frac { \partial } { \partial \tilde { w } } ( \frac { \partial L _ { \epsilon } ^ { \epsilon } ( \tilde { w } ) } { \partial \vartheta } | _ { \kappa _ { i } } ) | _ { \kappa _ { i } } ^ { T } \frac { \partial ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) } { \partial w _ { k } } | _ { w _ { k } } \| } \\ & { \quad \le \delta \| \frac { \partial } { \partial \tilde { w } } ( - \frac { \alpha } { n } \sum _ { k = 1 } ^ { n } \frac { \partial L _ { \epsilon } ^ { \epsilon } ( \tilde { w } ) } { \partial \tilde { w } } | _ { \kappa _ { i } } ^ { T } \frac { \partial ( l ( y _ { k } , \hat { y } _ { k } ) - l ( \tilde { y } _ { k } , \hat { y } _ { k } ) ) } { \partial w _ { k } } | _ { w _ { k } } \frac { \partial \lambda _ { j } ( \theta ; w _ { k } ) } { \partial \theta } | _ { \kappa _ { i } } ) | _ { \tilde { w } _ { k } } ^ { T } \frac { \partial ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) } { \partial w _ { \ell } } | _ { w _ { k } } , } \\ & \quad \le \delta \| ( - \frac { \alpha } { n } \sum _ { k = 1 } ^ { n } \frac { \partial ^ { 2 } L _ { \epsilon } ^ { \epsilon } ( \tilde { w } ) } { \partial \tilde { w } ^ { 2 } } | _ { \kappa _ { i } } ^ { T } \frac { \partial ( l ( y _ { k } , \hat { y } _ { k } ) - l ( \tilde { y } _ { k } , \hat { y } _ { k } ) ) } { \partial w _ { \ell } } | _ { w _ { \ell } } \frac { \partial \lambda _ { k } ( \theta ; w _ { \ell } ) } { \partial \theta } | _ { \theta _ { k } } \| _ { \tilde { w } _ { \ell } } \frac \partial ( l ( y _ j \end{array}
+$$
+
+And for the second term,
+
+$$
+\| ( G _ { i j } ) \frac { \partial ^ { 2 } \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta ^ { 2 } } | _ { \theta _ { t } } \| = \| \frac { \partial L _ { i } ^ { c } ( \hat { w } ) } { \partial \hat { w } } | _ { \hat { w } _ { t } } ^ { T } \frac { \partial ( l ( y _ { j } , \hat { y } _ { j } ) - l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ) } { \partial w _ { t } } | _ { w _ { t } } \frac { \partial ^ { 2 } \lambda _ { j } ( \theta ; w _ { t } ) } { \partial \theta ^ { 2 } } | _ { \theta _ { t } } \| \leq 2 \mathcal { B } \rho ^ { 2 } .
+$$
+
+Therefore,
+
+$$
+\| \nabla _ { \theta ^ { 2 } } ^ { 2 } L _ { i } ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } \| \leq 4 \alpha ^ { 2 } L \rho ^ { 2 } \delta ^ { 2 } + 2 \alpha \rho ^ { 2 } \mathcal { B } .
+$$
+
+Let $L _ { v } = 4 \alpha ^ { 2 } L \rho ^ { 2 } \delta ^ { 2 } + 2 \alpha \rho ^ { 2 } \beta$ ,Based on Lagrange mean value theorem, we have
+
+$$
+\lVert \nabla _ { \theta } L ^ { c } ( \hat { w } _ { t } ( \theta _ { 1 } ) ) - \nabla _ { \theta } L ^ { c } ( \hat { w } _ { t } ( \theta _ { 2 } ) ) \rVert \leq L _ { v } \lVert \theta _ { 1 } - \theta _ { 2 } \rVert ,
+$$
+
+for all $\theta _ { 1 } , \theta _ { 2 }$
+
+Theorem 1. Suppose the loss function $l$ is L-Lipschitz smooth, and $\lambda ( \cdot )$ is differential with a $\delta$ - bounded gradient, twice differential with its Hessian bounded by $\boldsymbol { B }$ with respect to $\theta$ . Let the learning rate $\alpha _ { t } = \operatorname* { m i n } \{ 1 , { \frac { k } { T } } \}$ , for some $k > 0$ , such that $\begin{array} { r } { { \frac { k } { T } } < 1 } \end{array}$ and learning rate $\beta _ { t }$ a monotone descent sequence, $\begin{array} { r } { \beta _ { t } = \operatorname* { m i n } \{ \frac { 1 } { L } , \frac { c } { \sqrt { T } } \} } \end{array}$ for some $c > 0$ , such that $L \leq { \frac { c } { \sqrt { T } } }$ and $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \beta _ { t } \le \infty , \sum _ { t = 1 } ^ { \infty } \beta _ { t } ^ { 2 } \le } \end{array}$ $\infty$ . Then the loss of Aggregation Net can achieve $\| \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \le \epsilon$ in $\mathcal { O } ( 1 / \epsilon ^ { 2 } )$ steps. More specifically,
+
+$$
+\operatorname* { m i n } _ { 0 \leq t \leq T } \| \nabla _ { \boldsymbol { \theta } } L ^ { c } ( \hat { w } ( \boldsymbol { \theta } _ { t } ) ) \| _ { 2 } ^ { 2 } \leq \mathcal { O } ( \frac { C } { \sqrt { T } } ) .
+$$
+
+Proof. The iteration for updating the parameter $\theta$ reads
+
+$$
+\theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } _ { t } ( \theta ) ) | _ { \theta _ { t } } .
+$$
+
+In two successive iteration, observe that
+
+$$
+\begin{array} { r l } & { \quad L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) } \\ & { = [ L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) ] + [ L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) ] . } \end{array}
+$$
+
+For the first term, given that loss function on clean set is Lipschitz smooth, we have
+
+$$
+\begin{array} { r l } & { \quad L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) } \\ & { \leq < \nabla L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) , \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) - \hat { w } _ { t } ( \theta _ { t + 1 } ) > + \displaystyle \frac { L } { 2 } \| \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) - \hat { w } _ { t } ( \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } . } \end{array}
+$$
+
+According to Equation (20) and (23),
+
+$$
+\hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) - \hat { w } _ { t } ( \theta _ { t + 1 } ) = - \frac { \alpha _ { t } } { n } \sum _ { j = 1 } ^ { n } [ \lambda _ { j } \nabla _ { w } l ( y _ { j } , \hat { y } _ { j } ) + ( 1 - \lambda _ { j } ) \nabla _ { w } l ( \tilde { y } _ { j } , \hat { y } _ { j } ) ] | _ { w _ { t + 1 } } ,
+$$
+
+and thus,
+
+$$
+\| L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) \| \leq \alpha _ { t } \rho ^ { 2 } + \frac { L } { 2 } \alpha _ { t } ^ { 2 } \rho ^ { 2 } ,
+$$
+
+since the first gradient of loss function is bounded by $\rho$
+
+By the Lipschitz continuity of $L ^ { c } ( \hat { w } _ { t } ( \theta ) )$ according to Lemma 1., it can be obtained that
+
+$$
+\begin{array} { r l } & { \quad L ^ { c } ( \hat { w } _ { t } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) } \\ & { \le \langle \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) , \theta _ { t + 1 } - \theta _ { t } \rangle + \displaystyle \frac { L } { 2 } \| \theta _ { t + 1 } - \theta _ { t } \| _ { 2 } ^ { 2 } } \\ & { = \langle \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) , - \beta _ { t } \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \rangle + \displaystyle \frac { L \beta _ { t } ^ { 2 } } { 2 } \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } } \\ & { = - ( \beta _ { t } - \displaystyle \frac { L \beta _ { t } ^ { 2 } } { 2 } ) \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } . } \end{array}
+$$
+
+Therefore, the Equation (32) satisfies
+
+$$
+\begin{array} { r l r } & { } & { L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) - L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \le \alpha _ { t } \rho ^ { 2 } + \displaystyle \frac { L } { 2 } \alpha _ { t } ^ { 2 } \rho ^ { 2 } - ( \beta _ { t } - \frac { L \beta _ { t } ^ { 2 } } { 2 } ) \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } } \\ & { } & { ( \beta _ { t } - \frac { L \beta _ { t } ^ { 2 } } { 2 } ) \| _ { 2 } ^ { 2 } \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \le \alpha _ { t } \rho ^ { 2 } + \displaystyle \frac { L } { 2 } \alpha _ { t } ^ { 2 } \rho ^ { 2 } - L ^ { c } ( \hat { w } _ { t + 1 } ( \theta _ { t + 1 } ) ) + L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) . } \end{array}
+$$
+
+Summing up above inequalities from 1 to $T$ , we have
+
+$$
+\begin{array} { r } { \displaystyle \sum _ { t = 1 } ^ { T } ( \beta _ { t } - \frac { L \beta _ { t } ^ { 2 } } { 2 } ) \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \leq L ^ { c } ( \hat { w } _ { 1 } ( \theta _ { 1 } ) ) + \displaystyle \sum _ { t = 1 } ^ { T } ( \alpha _ { t } \rho ^ { 2 } + \frac { L } { 2 } \alpha _ { t } ^ { 2 } \rho ^ { 2 } ) } \\ { \displaystyle \sum _ { t = 1 } ^ { T } ( \beta _ { t } - \frac { L \beta _ { t } ^ { 2 } } { 2 } ) \operatorname* { m i n } _ { t } \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \leq L ^ { c } ( \hat { w } _ { 1 } ( \theta _ { 1 } ) ) + \displaystyle \sum _ { t = 1 } ^ { T } ( \alpha _ { t } \rho ^ { 2 } + \frac { L } { 2 } \alpha _ { t } ^ { 2 } \rho ^ { 2 } ) . } \end{array}
+$$
+
+Furthermore,
+
+$$
+\begin{array} { r l } { \operatorname* { m i n } _ { 1 } \| \nabla _ { 0 } , L ^ { \nu } ( \hat { \omega } ; \hat { \omega } _ { \hat { \omega } } ^ { \dagger } ) \| _ { 2 } ^ { 2 } \leq \frac { L ^ { 2 } ( \hat { \omega } ; \hat { \omega } ( \hat { \omega } _ { \hat { \omega } } ( \hat { \theta } _ { 1 } ) ) + 1 ) - \sum _ { i = 1 } ^ { N } ( \alpha _ { i } \mu ^ { 2 } + \frac { L ^ { 2 } } { 2 } \hat { \omega } _ { \hat { \omega } } ^ { 2 } \hat { \omega } _ { \hat { \omega } } ^ { 2 } ) } { \sum _ { \alpha ^ { \prime } = 1 } ^ { N } ( \beta _ { i } - \frac { L ^ { 2 } } { 2 } \mu ^ { 2 } ) } } \\ & { \leq \frac { 2 L ^ { 2 } ( \hat { \omega } ; \hat { \omega } ( \hat { \omega } _ { 1 } ( \hat { \omega } _ { 1 } ) ) + \sum _ { i = 1 } ^ { N } ( 2 \omega _ { i } \mu ^ { 2 } + \frac { L ^ { 2 } } { 2 } \mu ^ { 2 } ) + L ^ { 2 } \mu ^ { 2 } ) } { \sum _ { \alpha ^ { \prime } = 1 } ^ { N } ( 2 \hat { \omega } _ { \hat { \omega } } - \frac { L ^ { 2 } } { 2 } ) } } \\ & { \leq \frac { 2 L ^ { 2 } ( \hat { \omega } ; \hat { \omega } ( \hat { \omega } _ { 1 } ( \hat { \omega } _ { 1 } ) ) + \sum _ { i = 1 } ^ { N } ( 2 \omega _ { i } \mu ^ { 2 } + L ^ { 2 } \omega ^ { 2 } ) + L ^ { 2 } \mu ^ { 2 } ) } { \sum _ { \alpha ^ { \prime } = 1 } ^ { N } ( \beta _ { i } ) } } \\ & { \leq \frac { 2 L ^ { 2 } ( \hat { \omega } ; \hat { \omega } ( \hat { \omega } _ { 1 } ( \hat { \omega } _ { 1 } ) ) + \sum _ { i = 1 } ^ { N } ( 2 \omega _ { i } \mu ^ { 2 } + L ^ { 2 } \omega ^ { 2 } ) } { \sum _ { \alpha ^ { \prime } = 1 } ^ { N } ( \beta _ { i } ) } } \\ & \leq \frac 2 L ^ { 2 } ( \hat { \omega } ; \hat { \omega } ( \hat { \omega } _ { 1 } ) ) - 2 ( \hat { \omega } ; \hat { \omega } ^ { 2 } ) + L ^ { 2 } ( 2 \end{array}
+$$
+
+It holds for $\begin{array} { r } { \sum _ { t = 1 } ^ { T } ( \beta _ { t } ) \leq \sum _ { t = 1 } ^ { T } ( 2 \beta _ { t } - L \beta _ { t } ^ { 2 } ) } \end{array}$ . In conclusion, it proves that the algorithm can always achieve $\begin{array} { r } { \operatorname* { m i n } _ { 0 \leq t \leq T } \| \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \leq \mathcal { O } ( \frac { 1 } { \sqrt { T } } ) } \end{array}$ in $T$ steps.
+
+Lemma 2. Let $( a _ { n } ) _ { 1 \leq n } , ( b _ { n } ) _ { 1 \leq n }$ be two non-negative re nces such that the series $\textstyle \sum _ { i _ { i } } ^ { \infty } a _ { n }$ diverges, the series $\textstyle \sum _ { i _ { i } } ^ { \infty } a _ { n } b _ { n }$ converges, and there exists $K > 0$ such that $\| b _ { n + 1 } - b _ { n } \| \leq \dot { K } a _ { n }$ . Then the seqences $\left( b _ { n } \right) _ { 1 \leq n }$ converges to 0.
+
+Proof. See the proof of Lemma A.5 in [Stochastic majorization-minimization algorithms for ].
+
+Theorem 2. Suppose the loss function $l$ is L-Lipschitz smooth and have $\rho$ -bounded gradients with respect to training data and clean set, and $\lambda ( \cdot )$ is differential with a $\delta$ -bounded gradient twice differential with its Hessian bounded by $\boldsymbol { B }$ with respect to $\theta$ . Let the learning rate $\alpha _ { t } = \operatorname* { m i n } \{ 1 , { \frac { k } { T } } \}$ , for some $k > 0$ , such that $\begin{array} { r } { { \frac { k } { T } } < 1 } \end{array}$ and learning rate $\beta _ { t }$ a monotone descent sequence, $\begin{array} { r } { \beta _ { t } = \operatorname* { m i n } \{ \frac { 1 } { L } , \frac { c } { \sqrt { T } } \} } \end{array}$ for some $c > 0$ , such that $L \leq { \frac { c } { \sqrt { T } } }$ and $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \beta _ { t } \leq \infty , \sum _ { t = 1 } ^ { \infty } \beta _ { t } ^ { 2 } \leq \infty } \end{array}$ . Then
+
+$$
+\operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 .
+$$
+
+Proof. It is obvious that $a _ { t }$ satisfy $\begin{array} { r } { \sum _ { t = 0 } ^ { \infty } a _ { t } = \infty , \sum _ { t = 0 } ^ { \infty } a _ { t } \le \infty . } \end{array}$ . In Eq. 18, 19, 20, and the linearity of $L$ , we rewrite the update of $w$ as
+
+$$
+\begin{array} { l } { { \displaystyle w _ { t + 1 } = w _ { t } - \alpha _ { t } \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) } } \\ { { \displaystyle \qquad = w _ { t } - \frac { \alpha _ { t } } { n } \sum _ { j = 1 } ^ { n } \lambda _ { j } ( \theta _ { t + 1 } ; w _ { t } ) \nabla _ { w _ { t } } l ( y _ { j } , \hat { y } _ { j } ( w _ { t } ) ) + ( 1 - \lambda _ { j } ( \theta _ { t + 1 } ; w _ { t } ) ) \nabla _ { w _ { t } } l ( \tilde { y } _ { j } , \hat { y } _ { j } ( w _ { t } ) ) . } } \end{array}
+$$
+
+First, we have the difference of the loss function on training set between two iterations,
+
+$$
+\begin{array} { r l } & { \quad L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) } \\ & { = \lbrack L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 1 } ) \rbrack + \lbrack L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 1 } ) - L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \rbrack . } \end{array}
+$$
+
+For the first term in Eq.33, by the L-Lipschitz-smooth and $\rho$ −bounded gradients of $\lambda$ with respect to training and clean set,
+
+$$
+\begin{array} { l } { { \displaystyle { \cal L } ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - { \cal L } ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 1 } ) } } \\ { \displaystyle { = \frac { 1 } { n } \sum _ { j = 1 } ^ { n } ( \lambda _ { j } ( \theta _ { t + 2 } ; w _ { t + 1 } ) - \lambda _ { j } ( \theta _ { t + 1 } ; w _ { t + 1 } ) ) l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) + ( \lambda _ { j } ( \theta _ { t + 1 } ; w _ { t + 1 } ) - \lambda _ { j } ( \theta _ { t + 2 } ; w _ { t + 1 } ) ) l ( \tilde { y } _ { j } , \hat { y } ( w _ { t + 1 } ) ) } } \\ { \displaystyle { \le \frac { 1 } { n } \sum _ { j = 1 } ^ { n } ( \left. \frac { \partial \lambda _ { j } ( \theta _ { j } ; w _ { t + 1 } ) } { \partial \theta } \vert _ { \theta _ { t + 1 } } , \theta _ { t + 2 } - \theta _ { t + 1 } \right. + \frac { \delta } { 2 } \| \theta _ { t + 2 } - \theta _ { t + 1 } \| _ { 2 } ^ { 2 } ) ( l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) + l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) ) } } \\ { \displaystyle { = \frac { 1 } { n } \sum _ { j = 1 } ^ { n } ( \left. \frac { \partial \lambda _ { j } ( \theta ; w _ { t + 1 } ) } { \partial \theta } \vert _ { \theta ^ { t + 1 } } , - \beta _ { t } \nabla _ { \theta _ { t } } L ( \hat { w } _ { t } ( \theta _ { t } ) ) \right. + \frac { \delta \beta _ { t } ^ { 2 } } { 2 } \| \nabla _ { \theta _ { t } } L ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } ) ( l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) + l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) ) } } \end{array}
+$$
+
+For the second term in Eq. 33,
+
+$$
+\begin{array} { r l } & { \quad L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 1 } ) - L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) } \\ & { \le \bigl \langle \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) , w _ { t + 1 } - w _ { t } \bigr \rangle + \frac { L } { 2 } \| w _ { t + 1 } - w _ { t } \| _ { 2 } ^ { 2 } } \\ & { = - \bigl ( \alpha _ { t } - \frac { L a _ { t } ^ { 2 } } { 2 } \bigr ) \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } . } \end{array}
+$$
+
+Therefore, we have
+
+$$
+\begin{array} { r l } & { \quad L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) } \\ & { \le \displaystyle \frac { 1 } { n } \sum _ { j = 1 } ^ { n } ( \left. \frac { \partial \lambda _ { j } ( \theta ; w _ { t + 1 } ) } { \partial \theta } | _ { \theta ^ { t + 1 } } , - \beta _ { t } \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \right. } \\ & { + \displaystyle \frac { \delta \beta _ { t } ^ { 2 } } { 2 } \| \nabla _ { \theta _ { t } } L ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } ) ( l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) + l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) ) } \\ & { - ( \alpha _ { t } - \frac { L \alpha _ { t } ^ { 2 } } { 2 } ) \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } . } \end{array}
+$$
+
+Summing up the inequalities in both sides from $t = 1$ to $\infty$ , we have
+
+$$
+\begin{array} { r l } & { \displaystyle \underset { t = 1 } { \operatorname* { l i m } } \| L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - L ^ { t r } ( w _ { 1 } ; \theta _ { 2 } ) \| } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { \infty } - \frac { \beta _ { t } } { n } \sum _ { j = 1 } ^ { n } [ \| \frac { \partial \lambda _ { j } ( \theta ; w _ { t + 1 } ) } { \partial \theta } | _ { \theta ^ { t + 1 } } \| _ { 2 } \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ( \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) \| _ { 2 } + \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) \| _ { 2 } , } \\ & { + \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \delta \beta _ { t } ^ { 2 } } { 2 } \displaystyle \sum _ { j = 1 } ^ { n } \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } ^ { 2 } ] ( \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) \| _ { 2 } + \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) ) \| _ { 2 } ) } \\ & { - \displaystyle \sum _ { t = 1 } ^ { \infty } ( \alpha _ { t } - \frac { L \alpha _ { t } ^ { 2 } } { 2 } ) \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } . } \end{array}
+$$
+
+Rearrange the terms of the inequality, we obtain
+
+$$
+\begin{array} { r l } & { \displaystyle \sum _ { t = 1 } ^ { \infty } \alpha _ { t } \| \nabla _ { w _ { 1 } } L ^ { t \top } ( w _ { : t } , \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } } \\ & { + \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \beta _ { t } } { \eta } \displaystyle \sum _ { j = 1 } ^ { n } \| \frac { \partial \lambda _ { t } ( \theta ; w _ { t + 1 } ) } { \partial \theta } | _ { \theta ^ { ( 1 ) } } \| _ { \theta ^ { ( 1 ) } } \| _ { 2 } \| \nabla _ { \theta , L ^ { t } } ( \bar { w } _ { t } , \theta _ { t } ) \| _ { 2 } \| \boldsymbol { l } ( \vartheta _ { j } , \hat { \theta } ( w _ { + 1 } ) ) \| _ { 2 } + \| \boldsymbol { l } ( \boldsymbol { y } _ { j } , \hat { \psi } ( w _ { * + 1 } ) ) \| _ { 2 } ) } \\ & { \leq \displaystyle \sum _ { t = 1 } ^ { L \alpha _ { t } } \| \nabla _ { w _ { 1 } } L ^ { t \top } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } } \\ & { + \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \delta \beta _ { t } ^ { 2 } } { 2 } \displaystyle \sum _ { s = 1 } ^ { n } \| \nabla _ { v _ { 1 } } L ^ { t \top } ( w _ { 1 } ; \theta _ { t } ) ) \| _ { 2 } ^ { 2 } \| \boldsymbol { l } ( \boldsymbol { l } ; \theta _ { s } , \hat { \boldsymbol { y } } ( w _ { t + 1 } ) ) \| _ { 2 } + \| \boldsymbol { l } ( \boldsymbol { y } _ { s } , \hat { \boldsymbol { y } } ( w _ { t + 1 } ) ) \| _ { 2 } ) } \\ & { - \displaystyle \operatorname* { l i m } _ { t = 1 } ^ { \infty } [ L ^ { t \top } ( w _ { t + 1 } ; \theta _ { t + 2 } ) ] + \| L ^ { t t \top } ( w _ { 1 } ; \theta _ { 2 } ) \| _ { 2 } } \\ & \leq \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { L \alpha _ { t } } { 2 } \rho ^ { 2 } + \| L ^ { t t } ( w _ { 1 } ; \theta _ { 2 } ) \| _ { 2 } + \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \delta \beta _ { t } ^ { 2 } } { 2 } ( 2 \boldsymbol { y } _ { t } ) ^ 2 \end{array}
+$$
+
+The inequality next to last holds since our loss function is bounded by $M$ , and the last one holds for $\textstyle \sum _ { t = 1 } ^ { \infty } \alpha _ { t } ^ { 2 }$ and $\textstyle \sum _ { t = 1 } ^ { \infty } \beta _ { t } ^ { 2 }$ are finite.
+
+In addition, since
+
+$$
+\begin{array} { r l } & { \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \beta _ { t } } { n } \sum _ { j = 1 } ^ { n } \| \frac { \partial \lambda _ { j } ( \theta ; w _ { t + 1 } ) } { \partial \theta } | _ { \theta ^ { t + 1 } } \| _ { 2 } \| \nabla _ { \theta _ { t } } L ^ { c } ( \hat { w } _ { t } ( \theta _ { t } ) ) \| _ { 2 } \big ( \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) \big ) \| _ { 2 } + \| l ( y _ { j } , \hat { y } ( w _ { t + 1 } ) \big ) \| _ { 2 } \big ) } \\ & { \displaystyle \le 2 M \rho \delta \sum _ { t = 1 } ^ { \infty } \beta _ { t } \le \infty , } \end{array}
+$$
+
+we can obtain that
+
+$$
+\sum _ { t = 1 } ^ { \infty } \alpha _ { t } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } \leq \infty .
+$$
+
+In the other hand, based on the inequality:
+
+$$
+( \| a \| + \| b \| ) ( \| a \| - \| b \| ) \leq \| a + b \| \| a - b \| ,
+$$
+
+we have
+
+$$
+\begin{array} { r l } & { \quad \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) \| _ { 2 } ^ { 2 } - \| \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } \| } \\ & { = ( \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) \| _ { 2 } + \| \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ) ( \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) \| _ { 2 } - \| \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ) } \\ & { \le \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) + \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } \| \| _ { 2 } \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } } \\ & { \le ( \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) \| _ { 2 } + \| \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ) \| \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) - \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ) } \\ & { \le 2 L \rho \| ( w _ { t + 1 } , \theta _ { t + 2 } ) - ( w _ { t } , \theta _ { t + 1 } ) \| _ { 2 } } \\ & { \le 2 L \rho \alpha _ { t } \beta _ { t } \| ( \nabla L ^ { t r } ( w _ { t } , \theta _ { t + 1 } ) , \nabla L ^ { c } ( w _ { t } , \theta _ { t + 1 } ) ) \| _ { 2 } } \\ & { \le 2 \sqrt { 2 } L \rho ^ { 2 } \beta _ { 1 } \alpha _ { t } } \end{array}
+$$
+
+For Eq. 34 which reads
+
+$$
+\sum _ { t = 1 } ^ { \infty } \alpha _ { t } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } \leq \infty ,
+$$
+
+since $\textstyle \sum _ { t = 0 } ^ { \infty } \alpha _ { t } \ = \ \infty$ , and there exists $K \ = \ C \ > \ 0$ , such that $\big | \big | \nabla L ^ { t r } ( w _ { t + 1 } ; \theta _ { t + 2 } ) \big | \big | _ { 2 } ^ { 2 } \ -$ $\| \nabla L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } | \le C \alpha _ { t }$ , by Lemma 2., we can conclude that
+
+$$
+\operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 ,
+$$
+
+which indicates that the gradient of loss on training set of our algorithm will finally achieve to zero, and thus the iteration of $w$ enables training loss to converge.
\ No newline at end of file
diff --git a/md/train/HCSgyPUfeDj/HCSgyPUfeDj.md b/md/train/HCSgyPUfeDj/HCSgyPUfeDj.md
new file mode 100644
index 0000000000000000000000000000000000000000..7d7f6ea2ef49993daa936fa764bc36e250d2b9ba
--- /dev/null
+++ b/md/train/HCSgyPUfeDj/HCSgyPUfeDj.md
@@ -0,0 +1,475 @@
+# LEARNING AND EVALUATING REPRESENTATIONS FOR DEEP ONE-CLASS CLASSIFICATION
+
+Kihyuk Sohn∗, Chun-Liang $\mathbf { L i } ^ { * }$ , Jinsung Yoon, Minho Jin & Tomas Pfister Google Cloud AI {kihyuks,chunliang,jinsungyoon,minhojin,tpfister}@google.com
+
+# ABSTRACT
+
+We present a two-stage framework for deep one-class classification. We first learn self-supervised representations from one-class data, and then build one-class classifiers on learned representations. The framework not only allows to learn better representations, but also permits building one-class classifiers that are faithful to the target task. We argue that classifiers inspired by the statistical perspective in generative or discriminative models are more effective than existing approaches, such as a normality score from a surrogate classifier. We thoroughly evaluate different self-supervised representation learning algorithms under the proposed framework for one-class classification. Moreover, we present a novel distribution-augmented contrastive learning that extends training distributions via data augmentation to obstruct the uniformity of contrastive representations. In experiments, we demonstrate state-of-the-art performance on visual domain oneclass classification benchmarks, including novelty and anomaly detection. Finally, we present visual explanations, confirming that the decision-making process of deep one-class classifiers is intuitive to humans. The code is available at https: //github.com/google-research/deep_representation_one_class.
+
+# 1 INTRODUCTION
+
+One-class classification aims to identify if an example belongs to the same distribution as the training data. There are several applications of one-class classification, such as anomaly detection or outlier detection, where we learn a classifier that distinguishes the anomaly/outlier data without access to them from the normal/inlier data accessible at training. This problem is common in various domains, such as manufacturing defect detection, financial fraud detection, etc.
+
+Generative models, such as kernel density estimation (KDE), is popular for one-class classification [1, 2] as they model the distribution by assigning high density to the training data. At test time, low density examples are determined as outliers. Unfortunately, the curse of dimensionality hinders accurate density estimation in high dimensions [3]. Deep generative models (e.g. [4, 5, 6]), have demonstrated success in modeling high-dimensional data (e.g., images) and have been applied to anomaly detection [7, 8, 9, 10, 11]. However, learning deep generative models on raw inputs remains as challenging as they appear to assign high density to background pixels [10] or learn local pixel correlations [12]. A good representation might still be beneficial to those models.
+
+Alternately, discriminative models like one-class SVM (OC-SVM) [13] or support vector data description (SVDD) [14] learn classifiers describing the support of one-class distributions to distinguish them from outliers. These methods are powerful when being with non-linear kernels. However, its performance is still limited by the quality of input data representations.
+
+In either generative or discriminative approaches, the fundamental limitation of one-class classification centers on learning good high-level data representations. Following the success of deep learning [15], deep one-class classifications [16, 17, 18], which extend the discriminative one-class classification using trainable deep neural networks, have shown promising results compared to their kernel counterparts. However, a naive training of deep one-class classifiers leads to a degenerate solution that maps all data into a single representation, also known as “hypersphere collapse” [16]. Previous works circumvent such issues by constraining network architectures [16], autoencoder pretraining [16, 17], surrogate multi-class classification on simulated outliers [19, 20, 21, 22] or injecting noise [18].
+
+In this work, we present a two-stage framework for building deep one-class classifiers. As shown in Figure 1, in the first stage, we train a deep neural network to obtain a high-level data representation. In the second stage, we build a one-class classifier, such as OC-SVM or KDE, using representations from the first stage. Comparing to using surrogate losses [20, 21], our framework allows to build a classifier that is more faithful to one-class classification. Decoupling representation learning from classifier construction further opens up opportunities of using state-of-the-art representation learning methods, such as self-supervised contrastive learning [23]. While vanilla contrastive representations are less compatible with one-class classification as they are uniformly distributed on the hypersphere [24], we show that, with proper fixes, it provides representations achieving competitive one-class classification performance to previous state-of-the-arts. Furthermore, we propose a distribution-augmented contrastive learning, a novel variant of contrastive learning with distribution augmentation [25]. This is particularly effective in learning representations for one-class classification, as it reduces the class collision between examples from the same class [26] and uniformity [24]. Lastly, although representations are not optimized for one-class classification as in end-to-end trainable deep one-class classifiers [16], we demonstrate state-of-the-art performance on visual one-class classification benchmarks. We summarize our contributions as follows:
+
+• We present a two-stage framework for building deep one-class classifiers using unsupervised and self-supervised representations followed by shallow one-class classifiers. • We systematically study representation learning methods for one-class classification, including augmentation prediction, contrastive learning, and the proposed distribution-augmented contrastive learning method that extends training data distributions via data augmentation. • We show that, with a good representation, both discriminative (OC-SVM) and generative (KDE) classifiers, while being competitive with each other, are better than surrogate classifiers based on the simulated outliers [20, 21]. • We achieve strong performance on visual one-class classification benchmarks, such as CIFAR10/100 [27], Fashion MNIST [28], Cat-vs-Dog [29], CelebA [30], and MVTec AD [31]. • We extensively study the one-class contrastive learning and the realistic evaluation of anomaly detection under unsupervised and semi-supervised settings. Finally, we present visual explanations of our deep one-class classifiers to better understand their decision making processes.
+
+# 2 RELATED WORK
+
+One-class classification [32] has broad applications, including fraud detection [33], spam filtering [34], medical diagnosis [35], manufacturing defect detection [31], to name a few. Due to the lack of granular semantic information for one-class data, learning from unlabeled data have been employed for one-class classification. Generative models, which model the density of training data distribution, are able to determine outlier when the sample shows low density [8, 35, 36]. These include simple methods such as kernel density estimation or mixture models [37], as well as advanced ones [4, 5, 6, 38, 39, 40, 41]. However, the density from generative models for high-dimensional data could be misleading [9, 12, 42, 43]. New detection mechanisms based on the typicality [44] or likelihood ratios [10] have been proposed to improve out-of-distribution detection.
+
+Self-supervised learning is commonly used for learning representations from unlabeled data by solving proxy tasks, such as jigsaw puzzle [45], rotation prediction [46], clustering [47], instance discrimination [48] and contrastive learning [23, 49, 50]. The learned representations are then used for multi-class classification, or transfer learning, all of which require labeled data for downstream tasks. They have also been extended to one-class classification. For example, contrastive learning is adopted to improve the out-of-distribution detection under multi-class setting [51], whereas our work focuses on learning from a single class of examples, leading to propose a novel distributionaugmented contrastive learning. Notably, learning to predict geometric transformations [20, 21, 22] extends the rotation prediction [46] to using more geometric transformations as prediction targets. Unlike typical applications of self-supervised learning where the classifier or projection head [23] are discarded after training, the geometric transformation classifier is used as a surrogate for oneclass classification. As in Section 4.1, however, the surrogate classifier optimized for the selfsupervised proxy task is suboptimal for one-class classification. We show that replacing it with
+
+
+
+Figure 1: Overview of our two-stage framework for building deep one-class classifier. (a) In the first stage, we learn representations from one-class training distribution using self-supervised learning methods, and (b) in the second stage, we train one-class classifiers using learned representations.
+
+$$
+\begin{array} { r l } & \frac { | \mathrm { ~ { ~ P r o x y ~ T a s k ~ } ~ } | | } { { \mathrm { ~ G o l a n ~ a n d ~ E l - Y a n i v ~ [ 2 0 ] ~ } } \left| \begin{array} { l l l } { ~ } & { { \mathrm { P r o x y ~ T a s k ~ } } } & { \vert } & { { \mathrm { N o r m a l i t y ~ S c o r e ~ a t ~ T e s t ~ T i m e ~ } ( x _ { t } ) } } \\ { ~ } & { \left| ~ { \textit { p } } _ { q } \left( 0 | f ( x _ { t } ) \right) \mathrm { ~ o r ~ } \sum _ { y \in \{ 0 , 1 , 2 , 3 \} } { { p } _ { q } \left( y | f ( \mathrm { r o t } 9 0 ( x _ { t } , y ) ) \right) } } & { \right| } \end{array} \right. } \\ & { \frac { \mathrm { ~ H e n d r y c k s ~ e t a l . } \left[ 2 1 \right] } { { \mathrm { ~ O u r s ~ } } } \left| \begin{array} { l l l } { ~ } & { { \mathrm { ~ } } } & { \int _ { \mathrm { c r o t . } } , \mathcal { L } _ { \mathrm { c r r } } , \frac { \mathcal { L } _ { \mathrm { c l r } } ^ { \mathrm { d i s t a u g } } } { c _ { \mathrm { c r } } } , \ldots ~ \big \vert } & { { \mathrm { ~ K D E } \left( f ( x _ { t } ) \right) \mathrm { ~ o r ~ O C - S V M } \left( f ( x _ { t } ) \right) } } \end{array} \right. } \end{array}
+$$
+
+Table 1: A comparison between one-class classifiers based on self-supervised learning. Previous works [20, 21] train one-class classifiers using augmentation prediction with geometric transformations (e.g. ${ \mathcal L } _ { \mathrm { r o t . } }$ ) and determine outliers using augmentation classifiers $( p _ { q } )$ . We learn representations using proxy tasks of different self-supervised learning methods, such as contrastive learning $( \mathcal { L } _ { \mathrm { c l r } } )$ , and build simple one-class classifiers, such as KDE or OC-SVM, on learned inlier representations.
+
+simple one-class classifiers consistently improve the performance. Furthermore, we propose strategies for better representation learning for both augmentation prediction and contrastive learning.
+
+Distribution-augmented contrastive learning is concurrently developed in [52] as a part of their multi-task ensemble model. While sharing a similar technical formulation, we motivate from fixing the uniformity of contrastive representations. We note that our study not only focuses on representation learning, but also on the importance of detection algorithms, which is under explored before.
+
+# 3 A TWO-STAGE FRAMEWORK FOR DEEP ONE-CLASS CLASSIFICATION
+
+In Section 3.1, we review self-supervised representation learning algorithms, discuss how they connect to existing one-class classification methods, raise issues of state-of-the-art contrastive representation learning [23] for one-class classification, and propose ways to resolve these issues. Then, in Section 3.2, we study how to leverage the learned representations for one-class classification.
+
+# 3.1 LEARNING REPRESENTATIONS FOR ONE-CLASS CLASSIFICATION
+
+Let $\mathcal { A }$ be the stochastic data augmentation process, which is composed of resize and crop, horizontal flip, color jittering, gray-scale and gaussian blur, following [23], for image data. As in Figure 1, selfsupervised learning methods consist of a feature extractor $f$ parameterized by deep neural networks and the proxy loss $\mathcal { L }$ . Optionally, $f$ is further processed with projection head $g$ at training, which is then used to compute the proxy loss. Unless otherwise stated, normalize $( f ) { \overset { \Delta } { = } } f / | | f | | _ { 2 }$ is used as a representation at test time. Below, we discuss details of self-supervised learning methods.
+
+# 3.1.1 EXTRACTING RICHER REPRESENTATION BY LEARNING WITH PROJECTION HEAD
+
+While the efficacy of projection head has been confirmed for contrastive learning [23] or BYOL [53], it is not widely adopted for other types of self-supervised learning, including rotation prediction [46]. On the other hand, Gidaris et al. [46] show that the lower-layer representation often perform better for downstream tasks as the last layer directly involved in optimizing the proxy loss becomes overly discriminative to the proxy task, while losing useful information of the data.
+
+Inspired by these observations, we adopt the projection head for augmentation prediction training as well. As in Figure 1a, we extend the network structure as $g \circ f$ , where $g$ is the projection head used to compute proxy losses and $f$ outputs representations used for the downstream task. Note that using an identity head $g ( x ) = x$ recovers the network structure of previous works [20, 21, 46].
+
+# 3.1.2 AUGMENTATION PREDICTION
+
+One way of representation learning is to learn by discriminating augmentations applied to the data. For example, the rotation prediction [46] learns deep representations by predicting the degree of
+
+
+Figure 2: One-class classification on different levels of uniformity of inlier distributions. (a) When representations are uniform, isolating outliers is hard. (b) Reducing uniformity makes boundary between inlier and outlier clear. (c) Distribution augmentation allows inlier distribution more compact.
+
+rotation augmentations. The training objective of the rotation prediction task is given as follows:
+
+$$
+\mathcal { L } _ { \mathrm { r o t } } = \mathbb { E } _ { x \sim P x , \mathcal { A } } \Bigl [ \mathrm { C r o s s E n t r o p y } \bigl ( y , p _ { q \circ g } \bigl ( y | \mathrm { r o t } 9 0 \left( \mathcal { A } ( x ) , y ) \right) \bigr ) \Bigr ]
+$$
+
+where $y \in \{ 0 , 1 , 2 , 3 \}$ is a prediction target representing the rotation degree, and $\mathrm { r o t 9 0 } ( x , y )$ rotates an input $x$ by 90 degree $y$ times. We denote the classifier $p _ { q \circ g } ( y | x )$ as $p _ { q } ( y | g ( x ) ) \propto \exp ( q \circ g ( x ) ) [ y ]$ containing the representation $g$ and a linear layer $q$ with 4 output units for rotation degrees.
+
+Application to One-Class Classification. Although not trained to do so, the likelihood of learned rotation classifiers2 $p _ { q } ( y = 0 | g ( x ) )$ is shown to well approximate the normality score and has been used for one-class classification [20, 21, 22]. A plausible explanation is via outlier exposure [19], where the classifier learns a decision boundary distinguishing original images from simulated outliers by image rotation. However, it assumes inlier images are not rotated, and the classifier may not generalize to one-class classification task if it overfits to the proxy rotation prediction task.
+
+# 3.1.3 CONTRASTIVE LEARNING
+
+Unlike augmentation prediction that learns discriminative representations to data augmentation, contrastive learning [23] learns representation by distinguishing different views (e.g., augmentations) of itself from other data instances. Let $\phi ( x ) = \mathrm { n o r m a l i z e } ( g ( x ) )$ , i.e., $\| \phi ( x ) \| = 1$ . Following [54], the proxy task loss of contrastive learning is written as:
+
+$$
+\begin{array} { r l } & { \mathcal { L } _ { \mathrm { c l r } } = - \mathbb { E } _ { x , x _ { i } \sim P x , \mathcal { A } , \mathcal { A } ^ { \prime } } \Bigg [ \log \frac { \exp \left( \frac { 1 } { \tau } \phi ( A ( x ) ) ^ { \top } \phi ( \mathcal { A } ^ { \prime } ( x ) ) \right) } { \exp \left( \frac { 1 } { \tau } \phi ( A ( x ) ) ^ { \top } \phi ( \mathcal { A } ^ { \prime } ( x ) ) \right) + \sum _ { i = 1 } ^ { M - 1 } \exp \left( \frac { 1 } { \tau } \phi ( \mathcal { A } ( x ) ) ^ { \top } \phi ( \mathcal { A } ( x _ { i } ) ) \right) } \Bigg ] } \end{array}
+$$
+
+where $\mathcal { A }$ and $\mathcal { A } ^ { \prime }$ are identical but independent stochastic augmentation processes for two different views of $x$ . $\mathcal { L } _ { \mathrm { c l r } }$ regularizes representations of the same instance with different views $( \mathcal { A } ( \boldsymbol { x } ) , \mathcal { A } ^ { \prime } ( \boldsymbol { x } ) )$ to be similar, while those of different instances $( \mathcal { A } ( x ) , \mathcal { A } ^ { \prime } ( x ^ { \prime } ) )$ to be unlike.
+
+Class Collision and Uniformity for One-Class Classification. While contrastive representations have achieved state-of-the-art performance on visual recognition tasks [23, 24, 49, 55] and have been theoretically proven to be effective for multi-class classification [26, 56], we argue that it could be problematic for one-class classification.
+
+First, a class collision [26]. The contrastive loss in Eq. (2) is minimized by maximizing the distance between representations of negative pairs $( x , x _ { i } ) , x \neq x _ { i }$ , even though they are from the same class when applied to the one-class classification. This seems to contradict to the idea of deep one-class classification [16], which learns representations by minimizing the distance between representations with respect to the center: $\begin{array} { r } { \operatorname* { m i n } _ { g , f } \bar { \mathbb { E } } _ { x } \| g \circ f ( x ) - \bar { c } \| ^ { 2 } } \end{array}$ .
+
+Second, a uniformity of representations [24]. It is proved that the optimal solution for the denominator of Eq. (2) is perfect uniformity as $M \to \infty$ [24], meaning that $\phi ( x )$ follows a uniform distribution on the hypersphere. This is problematic since one can always find an inlier $x \in \mathcal { X }$ in the proximity to any outlier $x ^ { \prime } \notin \mathcal { X }$ on the hypersphere, as shown in Figure 2a. In contrast, with reduced uniformity as in Figure 2b, it is easier to isolate outliers from inliers.
+
+
+Figure 3: Distribution-augmented contrastive learning. Not only learning to discriminate different instances from an original distribution (e.g., two images of different dogs on the left), it also learns to discriminate instances from different distributions created via augmentations, such as rotations (e.g., two images of the same dog with different rotation degrees on the top).
+
+One-Class Contrastive Learning. First, to reduce the uniformity of representations, we propose to use a moderate $M$ (batch size). This is in contrast with previous suggestions to train with large $M$ for contrastive representations to be most effective on multi-class classification tasks [23, 55, 57]. The impact of batch size $M$ for one-class classification will be discussed in Section 5.1.
+
+In addition, we propose distribution augmentation3 for one-class contrastive learning. The idea is that, instead of modeling the training data distribution $P _ { \mathcal { X } }$ , we model the union of augmented training distribution $\operatorname { \ u p } _ { \mathbf { \Phi } } { \operatorname { \cup } } _ { \mathbf { a } } a ( \mathbf { \boldsymbol { \chi } } )$ , where $a ( { \overset { \cdot } { \mathcal { X } } } ) = \{ a ( { \boldsymbol { x } } ) | { \boldsymbol { x } } \in { \mathcal { X } } \}$ . Note that augmentation $a$ for augmenting distribution is disjoint from those for data augmentation $\mathcal { A }$ that generates views. Inspired by Golan and El-Yaniv [20], we employ geometric transformations, such as rotation or horizontal flip, for distribution augmentation. For example, as in Figure 3, $x$ and ro ${ \mathfrak { g } } 0 ( x )$ (German shepherds in the top row) are considered as two separate instances and therefore are encouraged to be distant in the representation space. Not only increasing the number of data instances to train on (e.g., distribution augmentation by rotating $9 0 °$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ increases the dataset by 4 times), but it also eases the uniformity of representations on the resulted hypersphere. A pictorial example is in Figure 2c, where thanks to augmented distribution, the inlier distribution may become more compact.
+
+# 3.2 BUILDING DEEP ONE-CLASS CLASSIFIERS WITH LEARNED REPRESENTATIONS
+
+We present a two-stage framework for deep one-class classification that builds one-class classifiers on learned representations as in Figure 1. Compared to end-to-end training [16, 20, 21, 22], our framework provides flexibility in using various representations as the classifier is not bound to representation learning. It also allows the classifier consistent with one-class classification objective.
+
+To construct a classifier, we revisit an old wisdom which considers the full spectrum of the distribution of the learned data representation. For generative approaches, we propose to use nonparametric kernel density estimation (KDE) to estimate densities from learned representations. For discriminative approaches, we train one-class SVMs [13]. Both methods work as a black-box and in experiment we use the default training setting except the kernel width where we reduce by 10 times than default. We provide detailed classifier formulations in Appendix A.1.
+
+# 3.2.1 GRADIENT-BASED EXPLANATION OF DEEP ONE-CLASS CLASSIFIER
+
+Explaining the decision making process helps users to trust deep learning models. There have been efforts to visually explain the reason for model decisions of multi-class classifiers [58, 59, 60, 61, 62, 63, 64] using the gradients computed from the classifier. In this work, we introduce a gradient-based visual explanation of one-class classification that works for any deep representations. To construct an end-to-end differentiable decision function, we employ a KDE detector, whose formulation is in Appendix A.1, built on top of any differentiable deep representations: $\begin{array} { r } { \frac { \partial \mathrm { K D E } ( f ( x ) ) } { \partial x } = \frac { \partial \mathrm { K D E } ( f ( x ) ) } { \partial f ( x ) } \frac { \partial f ( \bar { x } ) } { \partial x } } \end{array}$ .
+
+# 4 EXPERIMENTS
+
+Following [20], we evaluate on one-class classification benchmarks, including CIFAR-10, CIFAR$1 0 0$ [27], Fashion-MNIST [28], and Cat-vs-Dog [29]. Images from one class are given as inlier and those from remaining classes are given as outlier. We further propose a new protocol using CelebA eyeglasses dataset [30], where face images with eyeglasses are denoted as an outlier. It is
+
+Table 2: We report the mean and standard deviation of one-class classification AUCs averaged over classes over 5 runs. The best methods are bold-faced for each setting. The per-class AUCs are reported in Appendix A.5. All methods are implemented and evaluated under the same condition.
+
+
Representation
Classifier CIFAR-10
CIFAR-100f-MNISTCat-vs-Dog CelebA
Mean
ResNet-50 (ImageNet)
OC-SVMKDE
80.080.0
83.783.7
91.890.5
74.574.6
81.482.4
84.083.7
RotNet [20]
Rotation ClassifierKDE
86.8±0.489.3±0.3
80.3±0.581.9±0.5
87.4±1.794.6±0.3
86.1±0.386.4±0.2
51.4±3.977.4±1.0
83.186.6
Denoising
OC-SVMKDE
83.4±1.083.5±1.0
75.2±1.075.2±1.0
93.9±0.493.7±0.4
57.3±1.357.3±1.3
66.8±0.967.0±0.7
80.4
80.4
Rotation Prediction
OC-SVMKDE
90.8±0.391.3±0.3
82.8±0.684.1±0.6
94.6±0.395.8±0.3
83.7±0.686.4±0.6
65.8±0.969.5±1.7
87.1
88.2
Contrastive
OC-SVMKDE
89.0±0.789.0±0.7
82.4±0.882.4±0.8
93.9±0.393.6±0.3
87.7±0.587.7±0.4
83.5±2.484.6±2.5
86.9
2.5
86.8
Contrastive (DA)
OC-SVMKDE
92.5±0.692.4±0.7
86.5±0.786.5±0.7
94.8±0.394.5±0.4
89.6±0.589.6±0.4
84.5±1.1
84.5±1.1
89.989.8
85.6±0.5
+
+
CIFAR-10
CIFAR-100
f-MNIST
cat-vs-dog
Ruff et al. [16] Golan and El-Yaniv [20]t Bergman and Hoshen [22]† Hendrycks et al.[21]†
64.8 86.0 88.2 90.1
1 78.7 1
、 93.5 94.1
1 88.8 1
Ours: Rotation prediction Ours: Contrastive (DA)
86.6 91.3±0.3 92.5±0.6
78.8 84.1±0.6 86.5±0.7
93.9 95.8±0.3 94.8±0.3
1 86.4±0.6 89.6±0.5
+
+Table 3: Comparison to previous one-class classification methods. † denotes evaluation methods using test time data augmentation. Our methods are both more accurate and computationally efficient.
+
+more challenging since the difference between in and outlier samples is finer-grained. Last, in addition to semantic anomaly detection as aforementioned, we consider the defect detection benchmark MVTec [31] in Section 4.2.
+
+We evaluate the performance of (1) representations trained with unsupervised and self-supervised learning methods, including denoising autoencoder [65], rotation prediction [46], contrastive learning [23, 48], and (2) using different one-class classifiers, such as OC-SVM or KDE. We use rotation augmentations for distribution-augmented contrastive learning, denoted as Contrastive (DA). We train a ResNet-18 [66] for feature extractor $f$ and a stack of linear, batch normalization, and ReLU, for MLP projection head $g$ . More experiment details can be found in Appendix A.4.
+
+# 4.1 MAIN RESULTS
+
+We report the mean and standard deviation of AUCs averaged over classes over 5 runs in Table 2. The mean of 5 datasets is weighted by the number of classes for each dataset. Besides those using self-supervised representations, we provide results using ImageNet pretrained ResNet-50 to highlight the importance of learning representations from in-domain distributions.
+
+ImageNet pretrained ResNet-50 achieves the best performance of 84.0 mean AUC over 5 datasets. Compared to representations learned with denoising objective, it works particularly well on datasets such as CIFAR-100, cat-vs-dog, and CelebA, which we attribute it to the subset of ImaegNet classes is closely related to the classes of these datasets.
+
+Similar to the findings from [20, 21], we observe significant performance gains with self-supervised learning. Moreover, while RotNet [20], an end-to-end trained classifier using rotation prediction, achieves 83.1 AUC, the RotNet representation evaluated with the KDE detector achieves 86.6, emphasizing the importance of a proper detector in the second stage. Finally, the quality of RotNet representation improves when trained with the MLP projection head, resulting in 88.2 AUC.
+
+The representations learned with vanilla contrastive loss achieve 86.9 AUC with OC-SVM, which under-perform those trained with rotation prediction loss (88.2). The distribution-augmented contrastive loss achieves the highest mean AUC of 89.9 among all methods, demonstrating performance gains on all datasets by a large margin upon its vanilla counterparts.
+
+Comparison to Previous Works. We make comparisons to previous works in Table 3. While some comparisons may not be fair as different works use different implementations, we note that our implementation is based on the common choices of network (e.g., ResNet-18) and optimizer (e.g., momentum SGD) for image classification. We advance the previous state-of-the-art on one-class
+
+
Protocol
RotNet [20, 21]
RotNet†
RotNet (MLP head)+
Vanilla CLRt
DistAug CLRt
Detection
71.0±3.5
83.5±3.0
86.3±2.4
80.2±1.8
86.5±1.6
Localization
75.6±2.1
92.6±1.0
93.0±0.9
85.6±1.3
90.4±0.8
+
+Table 4: Image-level detection and pixel-level localization AUCs on MVTec anomaly detection dataset [31]. We run experiments 5 times with different random seeds and report the mean and standard deviations. We bold-face the best entry of each row and those within the standard deviation. We use $\dagger$ to denote the use of KDE for an one-class classifier.
+
+
+(a) MMDs with various batch sizes. (b) AUCs with various batch sizes. (c) AUCs with various MLP depths.
+Figure 4: Ablation study of contrastive representations trained with different batch sizes. We use (a) the MMD distance between the representations and the data sampled from uniform distributions to measure uniformity. Small MMD distance means being similar to uniform distribution. We also report (b) one-class classification performance in AUCs evaluated by kernel OC-SVMs and (c) the performance with MLP heads of different depths.
+
+classification benchmarks by a large margin without test-time augmentation nor ensemble of models.
+We further improve the performance with model ensemble, which we report in Appendix A.2.2.
+
+# 4.2 EXPERIMENTS ON MVTEC ANOMALY (DEFECT) DETECTION
+
+Finally, we evaluate our proposed framework on MVTec [31] defect detection dataset, which is comprised of 15 different categories, including objects and textures. Instead of learning representations from the entire image, we learn representations of $3 2 \times 3 2$ patches. At test time, we compute the normality scores of $3 2 \times 3 2$ patches densely extracted from $2 5 6 \times 2 5 6$ images with stride of 4. For image-level detection, we apply spatial max-pooling to obtain a single image-level score. For localization, we upsample the spatial score map with Gaussian kernel [67]. Please see Appendix B for more implementation details and experimental results.
+
+We report in Table 4 the detection and localization AUCs. We verify the similar trend to previous experiments. For example, while using the same representation, RotNet with KDE (RotNet†) significantly outperform the RotNet using built-in rotation classifier. Moreover, distribution-augmented contrastive learning (with rotation) improves the performance of vanilla contrastive learning. Due to a space constraint, we show localization results in Appendix B.4.
+
+# 5 ANALYSIS AND ABLATION STUDY
+
+In Section 5.1, we analyze behaviors of one-class contrastive representations and in Section 5.4, we report visual explanations of various deep one-class classifiers. Due to a space constraint, more studies, including an in-depth study on distribution-augmented contrastive representations and data efficiency of self-supervised learning for one-class classification, are in Appendix A.2.
+
+5.1 UNIFORMITY, BATCH SIZE AND DISTRIBUTION AUGMENTATION [23, 49, 55, 57] have shown substantial improvement on contrastive representations evaluated on multi-class classification using very large batch sizes, which results in uniformity. However, uniformity [24] and class collision [26] can be an issue for one-class classification as discussed in Section 3.1.3. Here we investigate the relations between performance and uniformity, and how we can resolve the issue via batch size, MLP head and distribution-augmented contrastive learning.
+
+We measure the uniformity via MMD distance [68] between the learned representation and samples from uniform distributions on hyperspheres. Smaller MMD distance implies the distribution of representation is closer to uniform distributions. We train models with various batch sizes $\{ 2 ^ { 3 } , \ldots , 2 ^ { 9 } \}$ . We report in Figure 4 the average and standard deviation over 5 runs on CIFAR-10 validation set.
+
+
+
+
+(b) Unsupervised setting for learning representation and $1 \%$ (50) oneclass data for building detector.
+
+(a) Unsupervised settings for learning representation and building detector with various outlier ratio.
+
+
+(c) Unsupervised setting for learning representation and $2 \%$ (100) one-class data for building detector.
+
+Figure 5: Realistic evaluation of anomaly detection under (5a) unsupervised and (5b, 5c) one-class or semi-supervised settings. For unsupervised settings, we either learn representation or build detector from a training set containing both inlier and outlier data without their labels. For one-class or semisupervised settings, we learn from a training set containing only a small amount of one-class (inlier) data. We report AUCs on CIFAR-10 and OC-SVM with RBF kernel is used for evaluation.
+
+Distribution Augmentation. In Figure 4a, the representations from the projection head $g \circ f$ trained by standard contrastive learning (Contrastive $g \circ f )$ are closer to be uniformly distributed when we increase the batch size as proven by [24]. Therefore, in one-class classification, the nearly uniformly distributed representation from contrastive learning is only slightly better than random guess (50 AUC) as in Figure 4b. In contrast, with distribution augmentations, the learned representations (Contrastive (DA) $g \circ f )$ are less uniformly distributed and result in a significant performance gain.
+
+Batch Size. Following the discussion, large batch sizes result in nearly uniformly distributed representations $( g \circ f )$ , which is harmful to the one-class classification. On the other hand, small batch sizes $( \le 1 6 )$ , though less uniform, hinders us learning useful representations via information maximization [69]. As in Figure $\cdot$ , there is a trade-off of batch size for one-class classification, and we find batch size of 32 results in the best one-class classification performance. Further analysis showing the positive correlation between the uniformity measured by the MMD and the one-class classification performance is in Appendix A.2.2 and Figure 8.
+
+MLP Projection Head. Similarly to [23], we find that $f$ , an input to the projection head, performs better on the downstream task than $g \circ f$ . As in Figure $_ \mathrm { 4 c }$ , the performance of $f$ improves with deeper MLP head, while $g \circ f$ degrades, as it overfits to the proxy task.
+
+Lastly, we emphasize that all these fixes contribute to an improvement of contrastive representations for one-class classification. As in Figure 4 AUC drops when any of these components are missing.
+
+# 5.2 ANALYSIS ON DIFFERENT DISTRIBUTION AUGMENTATIONS
+
+The choice of distributions affects the performance. The ablation study using horizontal flip (hflip) and rotation augmentations is reported in Figure 7. Note that hflip is used only to augment distribution in this experiment. Interestingly, simply adding hflip improves the AUC to 90.7. This suggests a different insight from [52] who augments distribution as a means to outlier exposure [19]. Although we report the numbers with rotation augmentations in Table 2, with hflip, rot90, rot90+hflip as augmented distributions, we achieve the best mean AUC, 93.7, on CIFAR-10, without any test-time augmentation. Additional study on distribution augmentation follows in Appendix A.2.2.
+
+# 5.3 APPLICATIONS TO UNSUPERVISED AND SEMI-SUPERVISED ANOMALY DETECTION
+
+We conduct experiments for unsupervised anomaly detection, where the training set may contain a few outlier data.5 We study two settings: 1) Unsupervised settings for both learning representation and building detector, and 2) unsupervised setting for learning representation, but building detector with a small amount (as few as 50 data instances) of one-class data only. For both settings, we vary the outlier ratio in the training set from $0 . 5 \%$ to $1 0 \%$ . We show results in Figure 5. As in Figure 5a, we observe the decrease in performance when increasing the outlier ratio as expected. Rotation prediction is slightly more robust than contrastive learning for high outlier ratio. On the other hand, when classifier is built with clean one-class data, contrastive representations performs better. Interestingly, contrastive learning benefits from outlier data, as it naturally learn to distinguish inlier and outlier. Due to space constraint, we provide more results and analysis in Appendix A.3.
+
+
+Figure 6: Visual explanations of deep one-class classifiers on cat-vs-dog and CelebA eyeglasses datasets. (a) input images, (b–e) images with heatmaps using integrated gradients [62], and (f–i) those using GradCAM [61]. RotNet∗: RotNet $^ +$ KDE. More examples are in Appendix A.6.
+
+
+Figure 7: AUCs of contrastive representations trained from various augmented distributions on CIFAR-10. From left to right, we train by accumulating distributions. For example, an entry with $\mathrm { ^ { 6 6 } + r o t 9 0 }$ , hflip” is trained with 4 distributions, i.e., original, hflip, rot90 and rot90, hflip.
+
+# 5.4 VISUAL EXPLANATION OF DEEP ONE-CLASS CLASSIFIERS
+
+We investigate the decision making process of our deep one-class classifiers using the tools described in Section 3.2.1. Specifically, we inspect by highlighting the most influential regions using two popular visual explanation algorithms, namely, integrated gradients (IG) [62] and GradCAM [61], for distribution-augmented contrastive representation, as well as RotNet and DAE on images from cat-vs-dog and CelebA eyeglasses datasets. For RotNet, we test using both a rotation classifier and KDE (RotNet∗ in Figure 6) to compute gradients.
+
+As in Figure 6, the proposed visual explanation method based on the KDE one-class classifier permits highlighting human-intuitive, meaningful regions in the images, such as dog faces or eyeglasses instead of spurious background regions (Figure 6b). On the other hand, even though the classification AUC is not too worse (86.1 AUC on cat-vs-dog as opposed to 89.6 for ours), the visual explanation based on the rotation classifier (Figure 6c) suggests that the decision may be made sometimes based on the spurious features (e.g., human face in the background). We present more examples for visual explanation in Appendix A.6.
+
+# 6 CONCLUSION
+
+Inspired by an old wisdom of learning representations followed by building classifiers, we present a two-stage framework for deep one-class classification. We emphasize the importance of decoupling building classifiers from learning representations, which allows classifier to be consistent with the target task, one-class classification. Moreover, it permits applications of various self-supervised representation learning methods, including contrastive learning [23] with proper fixes, for one-class classification, achieving strong performance on visual one-class classification benchmarks. Finally, we exhibit visual explanation capability of our two-stage self-supervised deep one-class classifiers.
+
+REFERENCES
+[1] Markus M Breunig, Hans-Peter Kriegel, Raymond T $\mathrm { N g }$ , and Jorg Sander. Lof: identifying ¨ density-based local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pages 93–104, 2000. 1
+[2] Longin Jan Latecki, Aleksandar Lazarevic, and Dragoljub Pokrajac. Outlier detection with kernel density functions. In International Workshop on Machine Learning and Data Mining in Pattern Recognition, pages 61–75. Springer, 2007. 1
+[3] Alexandre B Tsybakov. Introduction to nonparametric estimation. Springer Science & Business Media, 2008. 1, 15
+[4] Aaron Van Den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural ¨ networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning-Volume 48, pages 1747–1756, 2016. 1, 2
+[5] Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in neural information processing systems, pages 10215–10224, 2018. 1, 2
+[6] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 1, 2
+[7] Shuangfei Zhai, Yu Cheng, Weining Lu, and Zhongfei Zhang. Deep structured energy based models for anomaly detection. arXiv preprint arXiv:1605.07717, 2016. 1
+[8] Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Daeki Cho, and Haifeng Chen. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. In International Conference on Learning Representations, 2018. 1, 2
+[9] Hyunsun Choi, Eric Jang, and Alexander A Alemi. Waic, but why? generative ensembles for robust anomaly detection. arXiv preprint arXiv:1810.01392, 2018. 1, 2
+[10] Jie Ren, Peter J Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark Depristo, Joshua Dillon, and Balaji Lakshminarayanan. Likelihood ratios for out-of-distribution detection. In Advances in Neural Information Processing Systems, pages 14707–14718, 2019. 1, 2
+[11] Warren R Morningstar, Cusuh Ham, Andrew G Gallagher, Balaji Lakshminarayanan, Alexander A Alemi, and Joshua V Dillon. Density of states estimation for out-of-distribution detection. arXiv preprint arXiv:2006.09273, 2020. 1
+[12] Polina Kirichenko, Pavel Izmailov, and Andrew Gordon Wilson. Why normalizing flows fail to detect out-of-distribution data. arXiv preprint arXiv:2006.08545, 2020. 1, 2
+[13] Bernhard Scholkopf, Robert C Williamson, Alex J Smola, John Shawe-Taylor, and John C ¨ Platt. Support vector method for novelty detection. In Advances in neural information processing systems, pages 582–588, 2000. 1, 5, 15
+[14] David MJ Tax and Robert PW Duin. Support vector data description. Machine learning, 54 (1):45–66, 2004. 1
+[15] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436– 444, 2015. 1
+[16] Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Muller, and Marius Kloft. Deep one-class classification. In ¨ International conference on machine learning, pages 4393–4402, 2018. 1, 2, 4, 5, 6
+[17] Raghavendra Chalapathy, Aditya Krishna Menon, and Sanjay Chawla. Anomaly detection using one-class neural networks. arXiv preprint arXiv:1802.06360, 2018. 1, 2
+[18] Poojan Oza and Vishal M Patel. One-class convolutional neural network. IEEE Signal Processing Letters, 26(2):277–281, 2018. 1, 2
+[19] Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. arXiv preprint arXiv:1812.04606, 2018. 2, 4, 8, 16
+[20] Izhak Golan and Ran El-Yaniv. Deep anomaly detection using geometric transformations. In Advances in Neural Information Processing Systems, pages 9758–9769, 2018. 2, 3, 4, 5, 6, 7, 15, 16, 18, 20, 21, 25
+
+[21] Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In Advances in Neural Information Processing Systems, pages 15637–15648, 2019. 2, 3, 4, 5, 6, 7, 16, 25
+
+[22] Liron Bergman and Yedid Hoshen. Classification-based anomaly detection for general data. In Eighth International Conference on Learning Representations, 2020. 2, 4, 5, 6, 16
+
+[23] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 2, 3, 4, 5, 6, 7, 8, 9, 15
+
+[24] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020. 2, 4, 7, 8
+
+[25] Heewoo Jun, Rewon Child, Mark Chen, John Schulman, Aditya Ramesh, Alec Radford, and Ilya Sutskever. Distribution augmentation for generative modeling. In Proceedings of Machine Learning and Systems 2020, pages 10563–10576, 2020. 2, 5
+
+[26] Nikunj Saunshi, Orestis Plevrakis, Sanjeev Arora, Mikhail Khodak, and Hrishikesh Khandeparkar. A theoretical analysis of contrastive unsupervised representation learning. In International Conference on Machine Learning, pages 5628–5637, 2019. 2, 4, 7
+
+[27] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. 2, 5
+
+[28] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. 2, 5
+
+[29] Jeremy Elson, John R Douceur, Jon Howell, and Jared Saul. Asirra: a captcha that exploits interest-aligned manual image categorization. In ACM Conference on Computer and Communications Security, volume 7, pages 366–374, 2007. 2, 5
+
+[30] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pages 3730– 3738, 2015. 2, 5
+
+[31] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad–a comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9592–9600, 2019. 2, 6, 7, 25, 26, 27, 28, 29, 30, 31, 32
+
+[32] Mary M Moya, Mark W Koch, and Larry D Hostetler. One-class classifier networks for target recognition applications. STIN, 93:24043, 1993. 2
+
+[33] Clifton Phua, Vincent Lee, Kate Smith, and Ross Gayler. A comprehensive survey of data mining-based fraud detection research. arXiv preprint arXiv:1009.6119, 2010. 2
+
+[34] Igor Santos, Carlos Laorden, Xabier Ugarte-Pedrero, Borja Sanz, and Pablo G Bringas. Spam filtering through anomaly detection. In International Conference on $E$ -Business and Telecommunications, pages 203–216. Springer, 2011. 2
+
+[35] Thomas Schlegl, Philipp Seebock, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg ¨ Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging, pages 146–157. Springer, 2017. 2
+
+[36] Chaoqing Huang, Jinkun Cao, Fei Ye, Maosen Li, Ya Zhang, and Cewu Lu. Inverse-transform autoencoder for anomaly detection. arXiv preprint arXiv:1911.10676, 2019. 2, 6
+
+[37] Christopher M Bishop. Pattern recognition and machine learning. springer, 2006. 2 [38] Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems, pages 153–160, 2007. 2
+
+[39] 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, pages 2672–2680, 2014. 2
+
+[40] Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pages 4790–4798, 2016. 2
+[41] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. 2
+[42] Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? arXiv preprint arXiv:1810.09136, 2018. 2
+[43] V´ıt Skv ˇ ara, Tom ´ a´s Pevn ˇ y, and V \` aclav ´ Smˇ ´ıdl. Are generative deep models for novelty detection truly better? arXiv preprint arXiv:1807.05027, 2018. 2
+[44] Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, and Balaji Lakshminarayanan. Detecting out-of-distribution inputs to deep generative models using a test for typicality. arXiv preprint arXiv:1906.02994, 5, 2019. 2
+[45] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pages 69–84. Springer, 2016. 2
+[46] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In Sixth International Conference on Learning Representations, 2018. 2, 3, 6, 26
+[47] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 132–149, 2018. 2
+[48] Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6210–6219, 2019. 2, 6
+[49] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 2, 4, 7
+[50] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729–9738, 2020. 2
+[51] Jim Winkens, Rudy Bunel, Abhijit Guha Roy, Robert Stanforth, Vivek Natarajan, Joseph R Ledsam, Patricia MacWilliams, Pushmeet Kohli, Alan Karthikesalingam, Simon Kohl, et al. Contrastive training for improved out-of-distribution detection. arXiv preprint arXiv:2007.05566, 2020. 2
+[52] Jihoon Tack, Sangwoo Mo, Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via contrastive learning on distributionally shifted instances. arXiv preprint arXiv:2007.08176, 2020. 3, 8, 16
+[53] Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. 3
+[54] Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In Advances in neural information processing systems, pages 1857–1865, 2016. 4
+[55] Olivier J Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, ´ and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019. 4, 5, 7
+[56] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. arXiv preprint arXiv:2008.10150, 2020. 4, 15
+[57] Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In Advances in Neural Information Processing Systems, pages 15535–15545, 2019. 5, 7
+[58] Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014. 5
+[59] Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert ´ Muller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by ¨ layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015. 5
+[60] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2921–2929, 2016. 5
+[61] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradientbased localization. In Proceedings of the IEEE international conference on computer vision, pages 618–626, 2017. 5, 9, 21, 22, 23, 24
+[62] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In International Conference on Machine Learning, pages 3319–3328, 2017. 5, 9, 21, 22, 23, 24
+[63] Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Advances in Neural Information Processing Systems, pages 9505–9515, 2018. 5
+[64] Andrei Kapishnikov, Tolga Bolukbasi, Fernanda Viegas, and Michael Terry. Xrai: Better attri- ´ butions through regions. In Proceedings of the IEEE International Conference on Computer Vision, pages 4948–4957, 2019. 5
+[65] Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pages 1096–1103, 2008. 6
+[66] 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, pages 770–778, 2016. 6
+[67] Philipp Liznerski, Lukas Ruff, Robert A Vandermeulen, Billy Joe Franks, Marius Kloft, and Klaus-Robert Muller. Explainable deep one-class classification. ¨ arXiv preprint arXiv:2007.01760, 2020. 7, 25
+[68] Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander ¨ Smola. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723–773, 2012. 7
+[69] Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In International Conference on Machine Learning, pages 5171– 5180, 2019. 8
+[70] Varun Chandola, Arindam Banerjee, and Vipin Kumar. Anomaly detection: A survey. ACM computing surveys (CSUR), 41(3):1–58, 2009. 8, 17
+[71] Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. Deep kernel learning. In Artificial intelligence and statistics, pages 370–378, 2016. 15
+[72] Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnabas P ´ oczos. Mmd ´ gan: Towards deeper understanding of moment matching network. In Advances in Neural Information Processing Systems, pages 2203–2213, 2017. 15
+[73] Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. In Fifth International Conference on Learning Representations, 2017. 19
+[74] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. 19
+[75] 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 12th {USENIX} Symposium on Operating Systems Design and Implementation $\left( \left\{ O S D I \right\} { } I 6 \right)$ , pages 265–283, 2016. 19
+[76] Shashanka Venkataramanan, Kuan-Chuan Peng, Rajat Vikram Singh, and Abhijit Mahalanobis. Attention guided anomaly localization in images. arXiv preprint arXiv:1911.08616, 2019. 25, 26
+
+[77] Lukas Ruff, Jacob R Kauffmann, Robert A Vandermeulen, Gregoire Montavon, Wojciech ´ Samek, Marius Kloft, Thomas G Dietterich, and Klaus-Robert Muller. A unifying review ¨ of deep and shallow anomaly detection. arXiv preprint arXiv:2009.11732, 2020. 26
+
+# A APPENDIX
+
+# A.1 FORMULATIONS OF ONE-CLASS CLASSIFIERS
+
+For completeness, we provide formulations of one-class classifiers, such as one-class support vector machine (OC-SVM) [13] and kernel density estimator, used in our work.
+
+One-Class Support Vector Machine solves the following optimization problem to find support vectors describing the boundary of one-class distribution:
+
+$$
+\operatorname* { m i n } _ { w , \rho , \xi _ { i } } \frac { \| w \| ^ { 2 } } { 2 } + \frac { 1 } { \nu n } \sum _ { i = 1 } ^ { n } \xi _ { i } - \rho
+$$
+
+where $f _ { i } = f ( x _ { i } )$ is a feature map. The decision score is given as follows:
+
+$$
+s ( x ) = \sum _ { i = 1 } ^ { n } \alpha _ { i } k ( x _ { i } , x ) - \rho
+$$
+
+with coefficients $\alpha _ { i } > 0$ for support vectors. Linear or RBF $( k _ { \gamma } ( x , y ) = \exp \left( - \gamma \| x - y \| ^ { 2 } \right) )$ kernels are used for experiments.
+
+Kernel Density Estimation is a nonparametric density estimation algorithm. The normality score of KDE with RBF kernel parameter $\gamma$ is written as follows:
+
+$$
+\mathrm { K D E } _ { \gamma } ( x ) = \frac { 1 } { \gamma } \log \Big [ \sum _ { y } \exp \big ( { - \gamma \| x - y \| ^ { 2 } } \big ) \Big ]
+$$
+
+# A.2 ADDITIONAL ABLATION STUDY
+
+# A.2.1 WELL BEHAVED CONTRASTIVE REPRESENTATION
+
+Linear Separability. A common belief is the good representations are linearly separable with respect to some underlying labels, which is supported by several empirical success [23]. The linear classifiers are proven to be nearly optimal [56] when we learn representations on data with all possible labels along with some additional assumptions. In one-class classification, although we violate the assumptions that we only train on one class of data, we are interested in the linear separability of the data to understand the characteristics of the learned embedding. To this end, in addition to training RBF kernel OC-SVM, we train OC-SVM with linear kernels on the learned embedding. We note that it is atypical to use linear OC-SVM, which is usually considered to be suboptimal for describing decision boundaries of one-class classification problems. However, with good representations, linear classifiers show good performance on one-class classification as shown in Table 5, and are better than existing works [20] in Table 2. Lastly, we note that OC-SVM with nonlinear RBF kernel is still better than linear models in Table 5. Similar observations are found in other problems such as regression [71] and generative models [72].
+
+Parametric Models. In addition to studying from the perspective of discriminative model, we also dive into the generative model side. Instead of using the nonparametric KDE for density estimation, we use a parametric model, single multivariate Gaussian, whose density is defined as
+
+$$
+p ( x ) \propto \mathrm { d e t } \left( { \Sigma } \right) ^ { - \frac { 1 } { 2 } } \exp \big \{ - \frac { 1 } { 2 } ( f ( x ) - \mu ) ^ { \top } \Sigma ^ { - 1 } ( f ( x ) - \mu ) \big \} .
+$$
+
+A shown in Table 5, the Gaussian density estimation (GDE) model shows competitive performance as KDE. It suggests the learned representations from distribution-augmented contrastive learning is compact as our expectation, which can be well approximated by a simple parametric model with single Gaussian. Compared with nonparametric methods, although parametric models have strong assumptions on the underlying data distributions, using parametric model is more data efficient if the assumption holds6. In addition, parametric models have huge advantage in computation during testing. Therefore, there is trade-off between assumptions of the data as well as model flexibility and computational efficiency. We note that the single Gaussian parametric model may not be a good alternative of KDE universally. A candidate with good trade-off is Gaussian Mixture Models, which can be treated as a middle ground of nonparametric KDE and parametric single Gaussian model. We leave the study for future works.
+
+Table 5: One-class classification results using different one-class classifiers on rotation-augmented contrastive representations. In addition to OC-SVM and KDE, both of which with RBF kernels, we test with the linear OC-SVM and the Gaussian density estimator (GDE).
+
+
Representation
Classifier
CIFAR-10
CIFAR-100
f-MNIST
Cat-vs-Dog
CelebA
Mean
Contrastive (DA)
OC-SVM (linear)
90.7±0.8
81.1±1.3
93.7±0.8
86.3±0.7
88.4±1.4
86.7
OC-SVM (kernel)
92.5±0.6
86.5±0.7
94.8±0.3
89.6±0.5
84.5±1.1
89.9
KDE
92.4±0.7
86.5±0.7
94.5±0.4
89.6±0.4
85.6±0.5
89.8
GDE
92.0±0.5
86.0±0.8
95.5±0.3
88.9±0.3
90.6±0.4
89.8
+
+# A.2.2 ANALYSIS ON DISTRIBUTION AUGMENTED CONTRASTIVE REPRESENTATIONS
+
+Relation to Outlier Exposure [19]. Distribution augmentation shares a similarity to outlier exposure [19] in that both methods introduce new data distributions for training. However, outlier exposure requires a stronger assumption on the data distribution that introduced outlier should not overlap with inlier distribution, while such an assumption is not required for distribution augmentation. For example, let’s consider rotation prediction as an instance of outlier exposure. When training the model on randomly-rotated CIFAR-10, where we randomly rotate images of CIFAR-10, the performance of rotation prediction representation drops to 60.7 AUC, which is slightly better than a random guess. On the other hand, rotation-augmented contrastive representation is not affected by random rotation and achieves 92.4 AUC.
+
+Ensemble of Contrastive Representations. We note that most previous methods have demonstrated improved performance via extensive test-time data augmentation [20, 21, 22, 52]. While already achieving state-of-the-art one-class classification performance without test-time data augmentation, we observe marginal improvement using test time data augmentation. Instead, we find that an ensemble of classifiers built on different representations significantly improve the performance. In Table 6, we report the performance of distribution-augmented contrastive representations trained with different sets of augmented distributions on CIFAR-10. We observe that ensemble of 5 models trained with different seeds consistently improves the performance. Moreover, not only we improve one-class classification AUCs when aggregating scores across models trained with different distribution augmentations, we also observe lower standard deviation across different seeds. Finally, when ensemble over $5 \times 5 = 2 5$ models, we achieve 94.6 AUC.
+
+
Representations
+hflip,+rot90
+rot90,hflip
+rot180
+rot180,hflip +rot270 Ensemble of 5
single modelensemble of 5 models
93.1±0.493.9
93.7±0.694.4
93.6±0.494.3
93.5±0.594.2
93.1±0.893.9
94.4±0.294.6
+
+Table 6: Performance of single and ensemble models of distribution augmented contrastive representations on CIFAR-10. For each augmented distribution, we report the mean and standard deviation of single model performance (“single model”) and that of ensemble model whose ensemble score is aggregated from 5 models trained with different random seeds (“ensemble of 5 models”). “Ensemble of $5 ^ { \circ }$ aggregates score from 5 models with different augmentation distributions.
+
+Correlation between Uniformity and One-class Classification. We present scatter plots in Figure 8 showing the positive correlation between the uniformity $( \log ( \mathrm { M M D } ) )$ ) and the one-class classification AUCs. Specifically, we compute the MMD using $g \circ f$ , an output of MLP projection head that are used to optimize the contrastive loss at training. We evaluate AUCs using both $g \circ f$ (left of Figure 8) and $f$ (right of Figure 8). Data points in the plots are obtained from vanilla and DistAug contrastive models trained with various batch sizes, including 32, 64, 128, 256 and 512. For each configuration, we train 5 models with different random seeds.
+
+From the left plot of Figure 8, we observe a strong positive correlation between MMD and AUC, suggesting that the more uniformly distributed (i.e., lower MMD), the worse the one-class classification performance is (i.e., low AUCs). We also compute the Pearson’s correlation coefficient, which results in 0.914. We also investigate the correlation between the MMD using $g \circ f$ and the AUC using $f$ , as shown in the right plot of Figure 8. We observe highly positive correlation of 0.774 Pearsons correlation coefficient between the MMD using $g \circ f$ and the AUC using $f$ . Overall, our results suggest that reducing uniformity of $g \circ f$ improves the one-class classification accuracy tested with both $g \circ f$ and $f$ representations.
+
+
+Figure 8: Scatter plots between uniformity metric $( \log ( \mathrm { M M D } ) )$ ) and one-class classification AUCs on CIFAR-10. MMD scores are obtained using $g \circ f$ . For AUCs, we show both evaluated using $g \circ f$ (left) and $f$ (right). Data points are obtained from vanilla and DistAug contrastive representations trained with batch sizes of 32, 64, 128, 256 and 512 using 5 different random seeds.
+
+# A.2.3 DATA EFFICIENCY OF SELF-SUPERVISED REPRESENTATION LEARNING
+
+While previous works on self-supervised learning have demonstrated the effectiveness on learning from large-scale unlabeled data, not much has shown for the data efficiency of these methods. Unlike multi-class classification tasks where the amount of data could scale multiplicative with the number of classes, data efficiency of representation learning becomes of particular interest for one-class classification as it is hard to collect large-scale data even without an annotation.
+
+We present one-class classification AUCs of representations with various training data sizes, along with two baseline representations such as ResNet-18 using random weights or ImageNet-pretrained ResNet-50 in Figure 9. Note that we vary the training set sizes at representation learning phase only, but use a fixed amount (5000) to train classifiers for fair evaluation of the representation quality. We find that even with 50 examples, classifiers benefit from self-supervised learning when comparing against raw or deep features with random weights. The proposed distribution-augmented contrastive loss could match the performance of ImageNet-pretrained ResNet-50 with only 100 examples, while rotation prediction loss and vanilla contrastive loss require 250 and 1000 examples, respectively.
+
+# A.3 UNSUPERVISED AND SEMI-SUPERVISED ANOMALY DETECTION
+
+In this section, we conduct experiments for unsupervised anomaly detection. Note that one-class classification assumes access to training data drawn entirely from one-class, inlier distribution and is often referred to semi-supervised anomaly detection [70] as it requires human effort to filter out training data from outlier distribution. On the other hand, unsupervised anomaly detection assumes to include training data both from inlier and outlier distributions without knowing their respective labels. In other words, unsupervised anomaly detection may be viewed as an one-class classification with noisy data.
+
+Here, we are interested in analyzing the impact of label noise (e.g., outlier examples are given as inlier) on one-class classification methods. To this end, we conduct experiments under unsupervised settings that includes different ratios, such as $0 . 5 \%$ , $1 \%$ , $2 \%$ , $5 \%$ , or $1 0 \%$ , of outlier examples in the train set without their labels. Note that the total amount of training examples for different settings remain unchanged. We show results in Figure 10 of 4 models: rotation prediction without (“RotNet”) and with (“Rotation Prediction”) MLP projection head, contrastive (“Contrastive”) and distribution-augmented contrastive (“Contrastive (DA)”) learning. We also report thee performance evaluated with different classifiers, including OC-SVM with RBF (Figure 10a) and linear (Figure 10c) kernels, and Gaussian Density Estimator (GDE, Figure 10b). For all models, we observe performance degradation of deep one-class classifiers trained with outlier examples as expected. Rotation prediction has shown more robust when outlier ratio is high (5 or $1 0 \%$ ). While showing stronger performance under one-class setting, kernel-based classifiers (OC-SVM with RBF kernel, KDE) have shown less robust than parameteric (GDE) or linear classifiers under high outlier ratios, as kernel-based methods focus more on the local neighborhood structures to determine a decision boundary.
+
+
+Figure 9: Self-supervised representations are trained from different data sizes, from 50 to 5000, on CIFAR-10. Standard deviations are obtained by sampling subsets 5 times. Classifiers are trained with the full (5000) train set for fair evaluation of representations. We provide baseline representations of ResNet-18 using random weights and ImageNet-pretrained ResNet-50. Standard deviations are computed by running 5 times with different seeds.
+
+Table 7: One-class classification results using different representations and one-class classifiers. We report the mean and standard deviation over 5 runs of AUCs averaged over classes. The best methods are bold-faced for each setting.
+
+
Representation
Classifier
CIFAR-10
CIFAR-100
f-MNIST
cat-vs-dog
CelebA
Mean
ResNet-18 (Random)
OC-SVM (linear)
50.1±0.9
50.1±1.7
50.3±0.9
50.0±0.4
49.9±0.3
50.1
OC-SVM (kernel)
61.2±2.3
59.6±1.9
89.8±0.9
50.7±0.5
57.1±0.6
66.5
KDE
60.5±2.4
58.7±2.2
89.4±1.0
50.8±0.6
57.3±0.8
65.9
ResNet-50 (ImageNet)
OC-SVM (linear)
67.9
71.0
77.0
61.0
58.0
70.9
OC-SVM (kernel)
80.0
83.7
91.8
74.5
81.4
84.0
KDE
80.0
83.7
90.5
74.6
82.4
83.7
RotNet [20]
Rotation Classifier
86.8±0.4
80.3±0.5
87.4±1.7
86.1±0.3
51.4±3.9
83.1
KDE
89.3±0.3
81.9±0.5
94.6±0.3
86.4±0.2
77.4±1.0
86.6
Denoising
OC-SVM (linear)
72.6±1.8
62.4±2.1
55.0±3.9
61.0±1.5
59.8±4.0
62.9
OC-SVM (kernel)
83.4±1.0
75.2±1.0
93.9±0.4
57.3±1.3
66.8±0.9
80.4
KDE
83.5±1.0
75.2±1.0
93.7±0.4
57.3±1.3
67.0±0.7
80.4
Rotation Prediction
OC-SVM(linear)
88.5±0.8
72.3±1.7
89.0±1.5
81.4±1.4
62.6±4.1
80.1
OC-SVM (kernel)
90.8±0.3
82.8±0.6
94.6±0.3
83.7±0.6
65.8±0.9
87.1
KDE
91.3±0.3
84.1±0.6
95.8±0.3
86.4±0.6
69.5±1.7
88.2
Contrastive
OC-SVM (linear)
85.6±1.2
74.9±1.4
92.3±1.1
82.8±1.1
91.7±0.7
82.2
OC-SVM (kernel)
89.0±0.7
82.4±0.8
93.9±0.3
87.7±0.5
83.5±2.4
86.9
KDE
89.0±0.7
82.4±0.8
93.6±0.3
87.7±0.4
84.6±2.5
86.8
Contrastive (DA)
OC-SVM (linear)
90.7±0.8
81.1±1.3
93.7±0.8
86.3±0.7
88.4±1.4
86.7
OC-SVM (kernel)
92.5±0.6
86.5±0.7
94.8±0.3
89.6±0.5
84.5±1.1
89.9
KDE
92.4±0.7
86.5±0.7
94.5±0.4
89.6±0.4
85.6±0.5
89.8
+
+In addition, we conduct a study under another semi-supervised setting, where we are given a small amount of labeled inlier data and a large amount of unlabeled training data composed of both inlier and outlier examples. Note that this is more realistic scenario for anomaly detection problems since it is easier to obtain some portions of labeled inlier examples than outlier examples. To demonstrate its effectiveness, we apply our proposed framework without any modification by first training representations on unlabeled training data and then building classifiers on these representations using small amount of inlier data. Results are shown in Figure 11. Interestingly, we observe consistent improvement in classification performance for contrastive representations trained on data with higher proportions of outlier examples when classifier is trained on a pure one-class data. Plausible explanation is that the model learns better contrastive representations when trained with both inlier and outlier as it naturally learn to distinguish inlier and outlier. On the other hand, representations from rotation prediction still show performance degradation as it learns to classify inlier and outlier into the same category.
+
+
+Figure 10: Classification performance under unsupervised learning setting of representation and classifier. For unsupervised setting, training set contains both inlier and outlier examples without their labels, whereas for one-class setting, training set contains only inlier examples. For representations trained with different outlier ratios, classification performances are evaluated with different classifiers, such as OC-SVMs with RBF and linear kernels, and Gaussian density estimation.
+
+
+Figure 11: Classification performance under unsupervised representation learning and one-class classifier learning settings. For unsupervised representation learning, training set contains both inlier and outlier examples without their labels. For one-class classifier learning, a small portion of inlier data is used for training an OC-SVM with RBF kernel.
+
+# A.4 DETAILS OF EXPERIMENTAL SETTING
+
+We resize images into $6 4 \times 6 4$ for cat-vs-dog and CelebA datasets and $3 2 \times 3 2$ for the rest. Unless otherwise stated, models are trained for 2048 epochs with momentum (0.9) SGD and a single cycle of cosine learning rate decay [73]. L2 weight regularization with coefficient of 0.0003 is applied. We use scikit-learn [74] implementation of OC-SVMs with default value of $\nu$ . We use $\gamma = 1 0 / | f | \cdot \mathrm { V a r } ( f )$ , which is 10 times larger than the default value for kernel OC-SVM. Same value of $\gamma$ is used for KDE. We use scikit-learn implementation of Gaussian mixture model using a single component for Gaussian density estimator (GDE). No hyperparameters are tuned for GDE. Finally, all experiments are conducted using TensorFlow [75].
+
+Other hyperparameters, such as learning rate or the MLP projection head depth, are cross-validated using small labeled data. While this may violate the assumption of one-class classification, supervised model selection is inevitable for deep learning models as their behaviors may be largely dependent on hyperparameters. To this end, we use $10 \%$ of inlier (500) and the same number of outlier examples of CIFAR-10 for hyperparameter selection, and use the same set of hyperparameters to test methods on other datasets, which could demonstrate the algorithm robustness. Learning rate $\in \{ 0 . 1 , 0 . 0 3 , 0 . 0 1 , 0 . 0 0 3 , 0 . 0 0 1 \}$ and the depth $\in \{ 0 , \cdots , 8 \}$ of an MLP projection head are tuned for all methods. In addition, the temperature $\tau { \in } \{ 1 , 0 . 5 , 0 . 2 , 0 . 1 \}$ and the batch size $\in \{ 2 ^ { n } , n = 3 , . . . , 9 \}$ of contrastive loss are tuned. To this end, we train all models across all datasets using the same hyperparameter configurations, such as learning rate of 0.01, projection head of depth 8 $( [ 5 1 2 \times 8 , 1 2 8 ]$ ), temperature $\tau$ of 0.2, or batch size of 32.
+
+A.5 PER-CLASS AUCS
+Table 8: Per-class one-class classification AUCs on CIFAR-10.
+
+
+
+# A.6 MORE EXAMPLES FOR VISUAL EXPLANATION OF DEEP ONE-CLASS CLASSIFIERS
+
+
+Figure 12: Visual explanations on CelebA eyeglasses dataset. (a) input images, (b–e) images with heatmaps using integrated gradients [62], and (f–i) those using GradCAM [61]. RotNet∗: RotNet $^ +$ KDE.
+
+
+Figure 13: Visual explanations on CelebA eyeglasses dataset. (a) input images, (b–e) images with heatmaps using integrated gradients [62], and (f–i) those using GradCAM [61]. RotNet∗: RotNet $^ +$ KDE.
+
+
+Figure 14: Visual explanations on cat-vs-dog dataset. (a) input images, (b–e) images with heatmaps using integrated gradients [62], and (f–i) those using GradCAM [61]. RotNet∗: RotNet $^ +$ KDE.
+
+
+Figure 15: Visual explanations on cat-vs-dog dataset. (a) input images, (b–e) images with heatmaps using integrated gradients [62], and (f–i) those using GradCAM [61]. RotNet∗: RotNet $^ +$ KDE.
+
+# B EXPERIMENTS ON MVTEC ANOMALY DETECTION DATASET
+
+# B.1 DATASET DESCRIPTION
+
+There are 15 different categories in MVTec anomaly detection dataset [31], where 10 are object (e.g., bottle, cable, transistor) and 5 are texture (e.g., grid, leather) categories. Each category comes with the training set containing ${ \sim } 2 4 1$ images per category from normal data distribution and the test set containing ${ \sim } 1 1 5$ images per category from both normal and defective data distributions. The dataset also provides pixel-accurate annotation for defective regions, allowing to measure the defect localization performance. Images are of high-resolution, whose side length is as long as 1024.
+
+# B.2 EXPERIMENTAL SETTING
+
+First, we resize all images into $2 5 6 \times 2 5 6$ in our experiments. One challenge of learning representations from scratch on MVTec dataset is that the amount of training set is too small ${ \sim } 2 4 1$ images per category). As in Figure 9, self-supervised representation learning methods benefit from the large amount of training data and the performance degrades when the amount of training data is limited. Instead of learning the holistic image representation, we learn a patch representation of size $3 2 \times 3 2$ via the proposed self-supervised representation learning methods. Similarly to our previous experiments, we train ResNet-18 from scratch.
+
+For evaluation, we compute both image-level detection and localization AUCs. We densely extract embeddings $f$ from image patches with the stride of 4 and compute anomaly scores with KDE at each patch location, which results in a For image-level detection, we apply s $( { \textstyle { \frac { 2 5 6 - 2 2 4 } { 4 } } } + 1 ) \times ( { \textstyle { \frac { 2 5 6 - 2 2 4 } { 4 } } } + 1 ) = 5 7 \times 5 7$ anomaly score map.re. For localization, we upsample $5 7 \times 5 7$ into $2 5 6 \times 2 5 6$ with Gaussian kernel7 [67] and compare with the annotation.
+
+B.3 EXPERIMENTAL RESULTS
+
+
AUC
CAVGA-Ru [76]
RotNet [20,21]
RotNet + KDE
RotNet (MLP head) +KDE
Vanilla Contrastive
DistAug Contrastive
Detection on object
83.8
77.9±2.3
85.9±2.1
89.0±2.0
83.8±1.4
88.6±1.4
Detection on texture Detection on all
78.2 81.9
73.2±3.5
75.5±3.1
81.0±3.4
73.0±2.6
82.5±2.2
71.0±3.5
83.5±3.0
86.3±2.4
80.2±1.8
86.5±1.6
Localization on object
1
74.1±1.6
95.7±0.7
96.4±0.4
91.7±1.0
94.4±0.5
Localization on texture
1
78.8±3.1
86.4±1.8
86.3±2.0
73.4±1.8
82.5±1.5
Localization on all
89
75.6±2.1
92.6±1.0
93.0±0.9
85.6±1.3
90.4±0.8
+
+Table 12: Image-level detection and pixel-level localization AUC results on MVTec anomaly detection dataset. We run experiments 5 times with different random seeds and report the mean and standard deviations. We bold-face the best entry of each row and those within the standard deviation.
+
+We report quantitative results in Table 12. Specifically, we report detection and localization AUCs averaged over object, texture, and all categories. Likewise, we run experiments 5 times with different random seeds and report the mean and standard deviation. We report the performance of RotNet (using rotation classifier, as in [20, 21]), the same representation but with KDE detectors as proposed, and RotNet trained with an MLP head and evaluated with KDE detector as proposed. In addition, we evaluate the performance of contrastive representations without (Vanilla) and with distribution augmentation (DistAug) as proposed. For comparison, we include the results of CAVGA $R _ { u }$ [76], which is also evaluated under the same setting. Below we highlight some points from our results:
+
+1. The proposed two-stage framework, which trains a RotNet and constructs an one-class classifier, clearly outperforms an end-to-end framework, which trains the RotNet and uses a built-in rotation classifier [20, 21].
+2. The proposed modification of RotNet with MLP projection head further improves the representation of RotNet for one-class classification.
+
+3. The proposed distribution augmentation (rotation) improves the performance of contrastive representations.
+
+4. We improve the localization AUC upon [76] both in detection and localization, both on object and texture categories.
+
+5. Both RotNet and contrastive representations are effective for “object” categories, but not as much for “texture” categories. As reviewed by [77], semantic and texture anomaly detection problems are different and may require different tools to solve. The methods relying on geometric transformations are effective in learning representations of visual objects [46] and thus more effective for semantic anomaly detection, but less effective for texture anomaly detection.
+
+
+Figure 16: Visualization of defect localization on bottle category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 17: Visualization of defect localization on cable category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 18: Visualization of defect localization on capsule category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 19: Visualization of defect localization on screw category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 20: Visualization of defect localization on transistor category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 21: Visualization of defect localization on grid category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
+
+
+Figure 22: Visualization of defect localization on leather category of MVTec dataset [31] using representations trained with rotation prediction on patches. From left to right, defective input data in test set, ground-truth mask, and localization visualization via heatmap.
\ No newline at end of file
diff --git a/md/train/HJOQ7MgAW/HJOQ7MgAW.md b/md/train/HJOQ7MgAW/HJOQ7MgAW.md
new file mode 100644
index 0000000000000000000000000000000000000000..3cea77e1b23bb89286fa355594d21699926dc653
--- /dev/null
+++ b/md/train/HJOQ7MgAW/HJOQ7MgAW.md
@@ -0,0 +1,226 @@
+# LONG SHORT-TERM MEMORY AS A DYNAMICALLYCOMPUTED ELEMENT-WISE WEIGHTED SUM
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Long short-term memory networks (LSTMs) were introduced to combat vanishing gradients in simple recurrent neural networks (S-RNNs) by augmenting them with additive recurrent connections controlled by gates. We present an alternate view to explain the success of LSTMs: the gates themselves are powerful recurrent models that provide more representational power than previously appreciated. We do this by showing that the LSTM’s gates can be decoupled from the embedded S-RNN, producing a restricted class of RNNs where the main recurrence computes an element-wise weighted sum of context-independent functions of the inputs. Experiments on a range of challenging NLP problems demonstrate that the simplified gate-based models work substantially better than S-RNNs, and often just as well as the original LSTMs, strongly suggesting that the gates are doing much more in practice than just alleviating vanishing gradients.
+
+# 1 INTRODUCTION
+
+Long short-term memory networks (LSTM) (Hochreiter & Schmidhuber, 1997) have become the de-facto recurrent neural network (RNN) for learning representations of sequences in many research areas, including natural language processing (NLP). Like simple recurrent neural networks (SRNNs) (Elman, 1990), LSTMs are able to learn non-linear functions of arbitrary-length input sequences. However, they also introduce an additional memory cell to mitigate the vanishing gradient problem (Hochreiter, 1991; Bengio et al., 1994). This memory is controlled by a mechanism of gates, whose additive connections allow long-distance dependencies to be learned more easily during backpropagation. While this view is mathematically accurate, in this paper we argue that it does not provide a complete picture of why LSTMs work in practice.
+
+We present an alternate view to explain the success of LSTMs: the gates themselves are powerful recurrent models that provide more representational power than previously appreciated. To demonstrate this, we first show that LSTMs can be seen as a combination of two recurrent models: (1) an S-RNN, and (2) an element-wise weighted sum of the S-RNN’s outputs over time, which is implicitly computed by the gates. We hypothesize that, for many practical NLP problems, the weighted sum serves as the main modeling component. The S-RNN, while theoretically expressive, is in practice only a minor contributor that clouds the mathematical clarity of the model. By replacing the S-RNN with a context-independent function of the input, we arrive at a much more restricted class of RNNs, where the main recurrence is via the element-wise weighted sums that the gates are computing.
+
+We test our hypothesis on NLP problems, where LSTMs are wildly popular at least in part due to their ability to model crucial language phenomena such as word order (Adi et al., 2017), syntactic structure (Linzen et al., 2016), and even long-range semantic dependencies (He et al., 2017). We consider four challenging tasks: language modeling, question answering, dependency parsing, and machine translation. Experiments show that while removing the gates from an LSTM can severely hurt performance, replacing the S-RNN with a simple linear transformation of the input results in minimal or no loss in model performance. We further show that in many cases, LSTMs can be further simplified by removing the output gate, arriving at an even more transparent architecture, where the output is a context-independent function of the weighted sum. Together, these results suggest that the gates’ ability to compute an element-wise weighted sum, rather than the non-linear transition dynamics of S-RNNs, are the driving force behind LSTM’s success.
+
+# 2 THE MEMORY CELL COMPUTES AN ELEMENT-WISE WEIGHTED SUM
+
+LSTMs are typically motivated as an augmentation of simple RNNs (S-RNNs), defined as follows:
+
+$$
+\pmb { h } _ { t } = \operatorname { t a n h } ( \pmb { W } _ { h h } \pmb { h } _ { t - 1 } + \pmb { W } _ { h x } \pmb { x } _ { t } + \pmb { b } _ { h } )
+$$
+
+S-RNNs suffer from the vanishing gradient problem (Hochreiter, 1991; Bengio et al., 1994) due to compounding multiplicative updates of the hidden state. By introducing a memory cell and an output layer that are controlled by a set of gates, LSTMs enable shortcuts through which gradients can flow easily when learning with backpropagation. This mechanism enables learning of long-distance dependencies while preserving the expressive power of recurrent non-linear transformations provided by S-RNNs.
+
+Rather than viewing the gates as simply an auxiliary mechanism to address a learning problem, we present an alternate view that emphasizes their modeling strengths. We argue that the LSTM should be interpreted as a hybrid of two distinct recurrent architectures: (1) the S-RNN which provides multiplicative connections across timesteps, and (2) the memory cell which provides additive connections across timesteps. On top of these recurrences, an output layer is included that simply squashes and filters the memory cell at each step.
+
+Throughout this paper, let $\{ \pmb { x } _ { 1 } , \ldots , \pmb { x } _ { n } \}$ be the sequence of input vectors, $\{ h _ { 1 } , \ldots , h _ { n } \}$ be the sequence of output vectors, and $\{ c _ { 1 } , \ldots , c _ { n } \}$ be the memory cell’s states. Then, given the basic LSTM definition below, we can formally identify three sub-components.
+
+$$
+\begin{array} { r l } & { \tilde { c } _ { t } = \mathrm { t a n h } ( W _ { c h } h _ { t - 1 } + W _ { c x } { \boldsymbol x } _ { t } + { \boldsymbol b } _ { c } ) } \\ & { ~ i _ { t } = \sigma ( W _ { i h } h _ { t - 1 } + W _ { i x } { \boldsymbol x } _ { t } + { \boldsymbol b } _ { i } ) } \\ & { f _ { t } = \sigma ( W _ { f h } h _ { t - 1 } + W _ { f x } { \boldsymbol x } _ { t } + { \boldsymbol b } _ { f } ) } \\ & { c _ { t } = i _ { t } \circ \tilde { c } _ { t } + f _ { t } \circ c _ { t - 1 } } \\ & { o _ { t } = \sigma ( W _ { o h } h _ { t - 1 } + W _ { o x } { \boldsymbol x } _ { t } + { \boldsymbol b } _ { o } ) } \\ & { h _ { t } = o _ { t } \circ \mathrm { t a n h } ( c _ { t } ) } \end{array}
+$$
+
+Content Layer (Equation 2) We refer to $\widetilde { c } _ { t }$ as the content layer, which is the output of an S-RNN. eEvaluating the need for the multiplicative recurrent connections in this content layer is the focus of this work. The content layer is passed to the memory cell, which decides which parts of it to store.
+
+Memory Cell (Equations 3-5) The memory cell $c _ { t }$ is controlled by two gates. The input gate $\mathbf { \delta } _ { i _ { t } }$ controls what part of the content $( \widetilde { c } _ { t } )$ is written to the memory, while the forget gate $f _ { t }$ controls what epart of the memory is deleted by filtering the previous state of the memory $( c _ { t - 1 } )$ . Writing to the memory is done by adding the filtered content $( i _ { t } \circ \widetilde { c } _ { t } )$ to the retained memory $( f _ { t } \circ c _ { t - 1 } )$ .
+
+Output Layer (Equations 6-7) The output layer $h _ { t }$ passes the memory cell through a tanh activation function and uses an output gate $\mathbf { } _ { o _ { t } }$ to read selectively from the squashed memory cell.
+
+Our goal is to study how much each of these components contribute to the empirical performance of LSTMs. In particular, it is worth considering the memory cell in more detail to reveal why it could serve as a standalone powerful model of long-distance context. It is possible to show that it implicitly computes an element-wise weighted sum of all the previous content layers by expanding the recurrence relation in equation (5):
+
+$$
+\begin{array} { l } { { \displaystyle c _ { t } = \dot { a } _ { t } \circ \widetilde c _ { t } + f _ { t } \circ c _ { t - 1 } } } \\ { { \displaystyle \quad = \sum _ { j = 0 } ^ { t } \left( \dot { a } _ { j } \circ \prod _ { k = j + 1 } ^ { t } f _ { k } \right) \circ \widetilde c _ { j } } } \\ { { \displaystyle \quad = \sum _ { j = 0 } ^ { t } w _ { j } ^ { t } \circ \widetilde c _ { j } } } \end{array}
+$$
+
+Each weight $\boldsymbol { w } _ { j } ^ { t }$ is a product of the input gate $i _ { j }$ (when its respective input $\widetilde { c } _ { j }$ was read) and every subsequent forget gate $f _ { k }$ e. An interesting property of these weights is that, like the gates, they are also soft element-wise binary filters.1
+
+This sum is similar to recent architectures that rely on self-attention to learn context-dependent word representations (Cheng et al., 2016; Parikh et al., 2016; Vaswani et al., 2017). There are two major differences from self-attention: (1) instead of computing a weighted sum for each attention head, a separate weighted sum is computed for every dimension of the memory cell, (2) the weighted sum is accumulated with a dynamic program, enabling a linear rather than quadratic complexity in comparison to self-attention.
+
+# 3 MEMORY CELLS ARE POWERFUL STANDALONE MODELS
+
+The restricted space of element-wise weighted sums allows for easier mathematical analysis, visualization, and perhaps even learnability. However, constrained function spaces are also less expressive, and a natural question is whether these models will work well for NLP problems that need highly contextualized word representations. We hypothesize that the memory cell (which computes weighted sums) can function as a standalone contextualizer. To test this hypothesis, we present several simplifications of the LSTM’s architecture (Section 3.1), and show on a variety of NLP benchmarks that there is a qualitative performance difference between models that contain a memory cell and those that do not (Section 3.2). We conclude that the content and output layers are relatively minor contributors, and that the space of element-wise weighted sums is sufficiently powerful to compete with fully parameterized LSTMs (Section 3.3).
+
+# 3.1 SIMPLIFIED MODELS
+
+The modeling power of LSTMs is commonly assumed to derive from the S-RNN in the content layer, with the rest of the model acting as a learning aid to bypass the vanishing gradient problem. We first isolate the S-RNN by ablating the gates (denoted as $L S T M - G A T E S$ for consistency).
+
+To test whether the memory cell has enough modeling power of its own, we take an LSTM and replace the S-RNN in the content layer from Equation 2 with a simple linear transformation, creating the LSTM – S-RNN model:
+
+$$
+\begin{array} { r l } & { \tilde { c } _ { t } = W _ { c x } { \boldsymbol x } _ { t } } \\ & { i _ { t } = \sigma ( W _ { i h } h _ { t - 1 } + W _ { i x } { \boldsymbol x } _ { t } + b _ { i } ) } \\ & { f _ { t } = \sigma ( W _ { f h } h _ { t - 1 } + W _ { f x } { \boldsymbol x } _ { t } + b _ { f } ) } \\ & { c _ { t } = i _ { t } \circ \tilde { c } _ { t } + f _ { t } \circ c _ { t - 1 } } \\ & { o _ { t } = \sigma ( W _ { o h } h _ { t - 1 } + W _ { o x } { \boldsymbol x } _ { t } + b _ { o } ) } \\ & { h _ { t } = o _ { t } \circ \operatorname { t a n h } ( c _ { t } ) } \end{array}
+$$
+
+We further simplify the LSTM by removing the output gate from Equation 7, leaving only the activation function in the output layer $( L S T M - S - R N N - O U T )$ :
+
+$$
+\begin{array} { r l } & { \tilde { c } _ { t } = W _ { c x } { \boldsymbol x } _ { t } } \\ & { i _ { t } = \sigma ( W _ { i h } h _ { t - 1 } + W _ { i x } { \boldsymbol x } _ { t } + b _ { i } ) } \\ & { f _ { t } = \sigma ( W _ { f h } h _ { t - 1 } + W _ { f x } { \boldsymbol x } _ { t } + b _ { f } ) } \\ & { c _ { t } = i _ { t } \circ \tilde { c } _ { t } + f _ { t } \circ c _ { t - 1 } } \\ & { h _ { t } = \operatorname { t a n h } ( c _ { t } ) } \end{array}
+$$
+
+After removing the S-RNN and the output gate from the LSTM, the entire ablated model can be written in a modular, compact form:
+
+$$
+\pmb { h } _ { t } = \mathrm { O U T P U T } \Big ( \sum _ { j = 0 } ^ { t } \pmb { w } _ { j } ^ { t } \circ \mathrm { C O N T E N T } ( \pmb { x } _ { j } ) \Big )
+$$
+
+where the content layer CONTENT $( \cdot )$ and the output layer OUTPUT $( \cdot )$ are both context-independent functions, making the entire model highly constrained and interpretable. The complexity of modeling contextual information is needed only for computing the weights $\boldsymbol { w } _ { j } ^ { t }$ . As we will see in Section 3.2, both of these ablations perform on par with LSTMs on language modeling, question answering, dependency parsing, and machine translation.
+
+There are many other models that can be expressed in the weighted-sum form (Equation 11). In this work, we focus on the closest variant of LSTM that satisfies this property; removing the S-RNN and the output gate is sufficient for the content and output functions to be context-independent. We leave more thorough investigations into the necessity of the remaining architecture as future work.
+
+# 3.2 EXPERIMENTS
+
+We compare model performance on four NLP tasks, with an experimental setup that is lenient towards LSTMs and harsh towards its simplifications. In each case, we use existing implementations and previously reported hyperparameter settings. Since these settings were tuned for LSTMs, any simplification that performs equally to (or better than) LSTMs under these LSTM-friendly settings provides strong evidence that the ablated component is not a contributing factor. For each task we also report the mean and standard deviation of 5 runs of the LSTM settings to demonstrate the typical variance observed due to training with different random initializations.2 The code and settings to replicate these experiments are publicly available.3
+
+# 3.2.1 LANGUAGE MODELING
+
+We evaluate on two language modeling datasets: the Penn Treebank (PTB) (Marcus et al., 1993), and Google’s billion-word benchmark (BWB) (Chelba et al., 2014). PTB contains approximately 1M tokens over a vocabulary of 10K words. We used the implementation of Zaremba et al. (2014) while replacing any invocation of LSTMs with simpler models. We tested two of their configurations: medium, which uses two layers of 650-dimension LSTMs, and large, which uses two layers of 1500-dimension LSTMs.
+
+BWB is about a thousand times larger than PTB, and uses a more diverse vocabulary of 800K words. Using the implementation of Józefowicz et al. (2016), we tested their LSTM-2048-512 configuration. Our experiments use exactly the same hyperparameters (dimensions, dropout, learning rates, etc) that were originally tuned for LSTMs (Józefowicz et al., 2016). Following their implementation, we project the hidden state at each time step down to 512 dimensions. Due to the enormous size of this dataset, we stopped training after 5 epochs.
+
+Table 1 shows overall model performance. In all three cases, replacing the LSTM’s content layer with a linear transformation results in small differences in perplexity. The most important result is that the small fluctuations in performance between the various gated architectures are minuscule in comparison to the enormous gap between the S-RNN $( L S T M - G A T E S )$ and the original LSTM. This striking difference strongly supports our hypothesis that the weighted sums computed by the gates – not the S-RNN – is the recurrent model that contributes mostly strongly to the final performance.
+
+# 3.2.2 QUESTION ANSWERING
+
+For question answering, we use two different QA systems on the Stanford question answering dataset (SQuAD) (Rajpurkar et al., 2016): the Bidirectional Attention Flow model (BiDAF) (Seo et al., 2016) and DrQA (Chen et al., 2017). BiDAF contains 3 LSTMs, which are referred to as the phrase layer, the modeling layer, and the span end encoder. Our experiments replace each of these LSTMs with their simplified counterparts. We directly use the implementation of BiDAF from AllenNLP (Gardner et al., 2017), and all experiments reuse the existing hyperparameters that were tuned for LSTMs. Likewise, we use an open-source implementation of $\mathrm { \dot { D r } Q A } ^ { 4 }$ and replace only the LSTMs, while leaving everything else intact.
+
+Table 2 shows that all the gated models do comparably. Most importantly, ablating the S-RNN from the LSTM has a minor effect in comparison to the drop in performance when ablating the gates.
+
+# 3.2.3 DEPENDENCY PARSING
+
+For dependency parsing, we use the Deep Biaffine Dependency Parser (Dozat & Manning, 2016), which relies on stacked bidirectional LSTMs to learn context-sensitive word embeddings for determining arcs between a pair of words. We directly use their released implementation, which is evaluated on the Universal Dependencies English Web Treebank v1.3 (Silveira et al., 2014). In our experiments, we use the existing hyperparameters and only replace the LSTMs with the simplified architectures.
+
+Table 1: The performance of simplified LSTM architectures on language modeling benchmarks, measured by perplexity.
+
+
Configuration
Model
Perplexity
PTB
LSTM
83.9 ± 0.3
- GATES
140.9
- S-RNN
80.5
- S-RNN-OUT
81.6
PTB (Large Model)
LSTM
78.8± 0.2
- GATES
126.1
- S-RNN
76.0
- S-RNN -OUT
78.5
BWB
LSTM (J6zefowicz et al., 2016)
47.5
- GATES
82.2
- S-RNN
45.4
- S-RNN-OUT
47.9
+
+Table 2: The performance of simplified LSTM architectures on the question answering benchmark, SQuAD, measured by exact match (EM) and span overlap (F1).
+
+
System
Model
EM
F1
BiDAF
LSTM
67.9 ± 0.3
77.5 ± 0.2
- GATES
62.9
73.3
- S-RNN
68.4
78.2
- S-RNN-OUT
67.4
77.2
DrQA
LSTM
68.8 ± 0.2
78.2 ± 0.2
- GATES
56.4
66.5
- S-RNN
67.7
77.0
- S-RNN -OUT
67.0
76.2
+
+Table 3: The performance of simplified LSTM architectures on the universal dependencies parsing benchmark, measured by unlabeled attachment score (UAS) and labeled attachment score (LAS).
+
+
Model
UAS
LAS
LSTM
90.60 ± 0.21
88.05 ± 0.33
- GATES
87.75
84.61
- S-RNN
90.77
88.49
- S-RNN-OUT
90.70
88.31
+
+We observe the same pattern in the ablations for dependency parsing. The differences in performance between the gated models fall within the differences between multiple experiments with LSTMs. Consistent with ablation results from other tasks, removing the gating mechanisms causes a 3-4 point drop in performance.
+
+# 3.2.4 MACHINE TRANSLATION
+
+For machine translation, we used OpenNMT (Klein et al., 2017) to train English to German translation models on the multi-modal benchmarks from WMT 2016 (used in OpenNMT’s readme file). We use OpenNMT’s default model and hyperparameters, replacing the stacked bidirectional LSTM of its
+
+
Model
BLEU
LSTM
35.95
- GATES
12.22
- S-RNN
36.66
- S-RNN-OUT
36.39
+
+Table 4: The performance of simplified LSTM architectures on the WMT 2016 multi-modal English to German translation benchmark, measured by BLEU.
+
+encoder with the simplified architectures. Table 4 shows that while models containing memory cells perform more-or-less on par, removing the memory cell yields a substantial performance drop.
+
+# 3.3 DISCUSSION
+
+In the above experiments, we show three major ablations of the LSTM. In the S-RNN experiments $( L S T M - G A T E S )$ , we ablate the memory cell and the output layer. In the LSTM – S-RNN and LSTM – $S – R M N - O U T$ experiments, we ablate the S-RNN. As consistent with previous literature, removing the memory cell degrades performance drastically. In contrast, removing the S-RNN makes little to no difference in the final performance, suggesting that the memory cell alone is largely responsible for the success of LSTMs in NLP. The results also confirm our hypothesis that weighted sums of context words is a powerful, yet more interpretable, model of contextual information.
+
+# 4 WEIGHT VISUALIZATION
+
+Given the empirical evidence that LSTMs are effectively learning weighted sums of the content layers, it is natural to investigate what weights the model learns in practice. Using the more mathematically transparent simplification of LSTMs, we can visualize the weights $\boldsymbol { w } _ { j } ^ { t }$ that are placed on every input $j$ at every timestep $t$ (see Equation 11).
+
+Unlike attention mechanisms, these weights are vectors rather than scalar values. Therefore, we can only provide a coarse-grained visualization of the weights by rendering their $L ^ { 2 }$ -norm, as shown in Table 5. In the visualization, each column indicates the word represented by the weighted sum, and each row indicates the word over which the weighted sum is computed. Dark horizontal streaks indicate the duration for which a word was remembered. Unsurprisingly, the weights on the diagonal are always the largest since it indicates the weight of the current word. More interesting task-specific patterns emerge when inspecting the off-diagonals that represent the weight on the context words.
+
+The first visualization uses the language model from BWB. Due to the language modeling setup, there are only non-zero weights on the current or previous words. We find that the common function words are quickly forgotten, while infrequent words that signal the topic are remembered over very long distances.
+
+The second visualization uses the dependency parser. In this setting, since the recurrent architectures are bidirectional, there are non-zero weights on all words in the sentence. The top-right triangle indicates weights from the forward direction, and the bottom-left triangle indicates from the backward direction. For syntax, we see a significantly different pattern. Function words that are useful for determining syntax are more likely to be remembered. Weights on head words are also likely to persist until the end of a constituent.
+
+This illustration provides only a glimpse into what the model is capturing, and perhaps future, more detailed visualizations that take the individual dimensions into account can provide further insight into what LSTMs are learning in practice.
+
+# 5 RELATED WORK
+
+Many variants of LSTMs (Hochreiter & Schmidhuber, 1997) have been previously explored. These typically consist of a different parameterization the gates, such as LSTMs with peephole connections (Gers & Schmidhuber, 2000), or a rewiring of the connections, such as GRUs (Cho et al., 2014).
+
+
+Table 5: Visualization of the weights on context words learned by the memory cell. Each column represents the current word $t$ , and each row represents a context word $j$ . The gating mechanism implicitly computes element-wise weighted sums over each column. The darkness of each square indicates the $L ^ { \dot { 2 } }$ -norm of the vector weights $\boldsymbol { w } _ { j } ^ { t }$ from Equation 11. Figures on the left show weights learned by a language model. Figures on the right show weights learned by a dependency parser.
+
+However, these modifications invariably maintain the recurrent content layer. Even more systematic explorations of LSTM variants (Józefowicz et al., 2015; Greff et al., 2016; Zoph & Le, 2017) do not question the importance of the embedded S-RNN. This is the first study to provide apples-to-apples comparisons between LSTMs and LSTMs without the recurrent content layer.
+
+Several other recent works have also reported promising results with recurrent models that are vastly simpler than LSTMs, such as quasi-recurrent neural networks (Bradbury et al., 2016), strongly-typed recurrent neural networks (Balduzzi & Ghifary, 2016), kernel neural networks (Lei et al., 2017), and simple recurrent units (Lei & Zhang, 2017), making it increasingly apparent that LSTMs are over-parameterized. While these works indicate an obvious trend, their focus is not to provide insight into what exactly LSTMs are learning. In our carefully controlled ablation studies, we propose and evaluate the minimal changes required to test our hypothesis that LSTMs are powerful because they dynamically compute element-wise weighted sums of content layers.
+
+As mentioned in Section 2, this weighted-sum view of LSTMs is highly related to neural attention (Bahdanau et al., 2015), which assigns a normalized scalar weight to each element as a function of its compatibility with an external element. The ability to inspect attention weights has driven the use of more interpretable neural models. Self-attention (Cheng et al., 2016; Parikh et al., 2016) extends this notion by computing intra-sequence attention. Vaswani et al. (2017) further showed that state-of-the-art machine translation can be achieved using only self-attention and without LSTMs. Recently, Arora et al. (2017) proposed a theory-driven approach to assign scalar weights to elements in a bag of words. The success of self-attention corroborates our findings that weighted sums are indeed a more effective method of learning context-sensitive representations than previously appreciated.
+
+# 6 CONCLUSION
+
+We presented an alternate view of LSTMs: they are a hybrid of S-RNNs and a gated model that dynamically computes weighted sums of the S-RNN outputs. Our experiments investigated whether the S-RNN is a necessary component of LSTMs. In other words, are the gates alone as powerful of a model as an LSTM? Results across four major NLP tasks (language modeling, question answering, dependency parsing, and machine translation) indicate that LSTMs suffer little to no performance loss when removing the S-RNN, but removing the gates can degrade performance substantially. This provides evidence that the gating mechanism is doing the heavy lifting in modeling context, and that element-wise weighted sums of context-independent functions of the inputs are often as effective as fully-parameterized LSTMs.
+
+This work sheds light on the inner workings of the relatively opaque LSTM. By removing the S-RNN and the output gate, we also show that the resulting model is a far more mathematically transparent variant of LSTMs. This transparency enables a visualization of how the context affects the output of the model at every timestep, much like in attention-based models. We hope that this new outlook on LSTMs will foster better and more efficient models of contextualization.
+
+# REFERENCES
+
+Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In ICLR, 2017.
+
+Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. In ICLR, 2017.
+
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
+
+David Balduzzi and Muhammad Ghifary. Strongly-typed recurrent neural networks. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pp. 1292–1300, 2016. URL http://jmlr.org/proceedings/ papers/v48/balduzzi16.html.
+
+Yoshua Bengio, Patrice Y. Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, 1994.
+
+James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. CoRR, abs/1611.01576, 2016.
+
+Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, and Phillipp Koehn. One billion word benchmark for measuring progress in statistical language modeling. In INTERSPEECH, 2014.
+
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Association for Computational Linguistics (ACL), 2017.
+
+Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 551–561, Austin, Texas, November 2016. Association for Computational Linguistics. URL https://aclweb.org/anthology/D16-1053.
+
+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 Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/D14-1179.
+
+Timothy Dozat and Christopher D. Manning. Deep biaffine attention for neural dependency parsing. CoRR, abs/1611.01734, 2016.
+
+Jeffrey L. Elman. Finding structure in time. Cognitive Science, 14:179–211, 1990.
+
+Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. Allennlp: A deep semantic natural language processing platform, 2017. URL http://allennlp.org/papers/AllenNLP_white_ paper.pdf.
+
+Felix A. Gers and Jürgen Schmidhuber. Recurrent nets that time and count. In IJCNN, 2000.
+
+Klaus Greff, Rupesh K Srivastava, Jan Koutník, Bas R Steunebrink, and Jürgen Schmidhuber. Lstm: A search space odyssey. IEEE Transactions on Neural Networks and Learning Systems, 2016.
+
+Luheng He, Kenton Lee, Mike Lewis, and Luke Zettlemoyer. Deep semantic role labeling: What works and what’s next. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, 2017.
+
+Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. Diploma, Technische Universität München, 91, 1991.
+
+Sepp Hochreiter and Jürgen Schmidhuber. Long Short-term Memory. Neural computation, 9(8): 1735–1780, 1997.
+
+Rafal Józefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In ICML, 2015.
+
+Rafal Józefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
+
+Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. Opennmt: Opensource toolkit for neural machine translation. In Proc. ACL, 2017. doi: 10.18653/v1/P17-4012. URL https://doi.org/10.18653/v1/P17-4012.
+
+Tao Lei and Yu Zhang. Training rnns as fast as cnns. arXiv preprint arXiv:1709.02755, 2017.
+
+Tao Lei, Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Deriving neural architectures from sequence and graph kernels. In ICML, 2017.
+
+Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntaxsensitive dependencies. TACL, 4:521–535, 2016.
+
+Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. Computational Linguistics, 19:313–330, 1993.
+
+Ankur Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2249–2255, Austin, Texas, November 2016. Association for Computational Linguistics. URL https://aclweb.org/anthology/D16-1244.
+
+Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, $0 0 0 +$ questions for machine comprehension of text. In EMNLP, 2016.
+
+Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. CoRR, abs/1611.01603, 2016.
+
+Natalia Silveira, Timothy Dozat, Marie-Catherine de Marneffe, Samuel Bowman, Miriam Connor, John Bauer, and Christopher D. Manning. A gold standard dependency corpus for English. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC-2014), 2014.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
+
+Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
+
+Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2017.
\ No newline at end of file
diff --git a/md/train/HJf9ZhC9FX/HJf9ZhC9FX.md b/md/train/HJf9ZhC9FX/HJf9ZhC9FX.md
new file mode 100644
index 0000000000000000000000000000000000000000..cc9ea4b95d97716efd0495b6cbc5282a5b8c027c
--- /dev/null
+++ b/md/train/HJf9ZhC9FX/HJf9ZhC9FX.md
@@ -0,0 +1,697 @@
+# STOCHASTIC GRADIENT/MIRROR DESCENT: MINIMAX OPTIMALITY AND IMPLICIT REGULARIZATION
+
+Navid Azizan
+California Institute of Technology
+Pasadena, CA 91125
+azizan@caltech.edu
+Babak Hassibi
+California Institute of Technology
+Pasadena, CA 91125
+hassibi@caltech.edu
+
+# ABSTRACT
+
+Stochastic descent methods (of the gradient and mirror varieties) have become increasingly popular in optimization. In fact, it is now widely recognized that the success of deep learning is not only due to the special deep architecture of the models, but also due to the behavior of the stochastic descent methods used, which play a key role in reaching “good” solutions that generalize well to unseen data. In an attempt to shed some light on why this is the case, we revisit some minimax properties of stochastic gradient descent (SGD) for the square loss of linear models—originally developed in the 1990’s—and extend them to general stochastic mirror descent (SMD) algorithms for general loss functions and nonlinear models. In particular, we show that there is a fundamental identity which holds for SMD (and SGD) under very general conditions, and which implies the minimax optimality of SMD (and SGD) for sufficiently small step size, and for a general class of loss functions and general nonlinear models. We further show that this identity can be used to naturally establish other properties of SMD (and SGD), namely convergence and implicit regularization for over-parameterized linear models (in what is now being called the “interpolating regime”), some of which have been shown in certain cases in prior literature. We also argue how this identity can be used in the so-called “highly over-parameterized” nonlinear setting (where the number of parameters far exceeds the number of data points) to provide insights into why SMD (and SGD) may have similar convergence and implicit regularization properties for deep learning.
+
+# 1 INTRODUCTION
+
+Deep learning has proven to be extremely successful in a wide variety of tasks (Krizhevsky et al., 2012; LeCun et al., 2015; Mnih et al., 2015; Silver et al., 2016; Wu et al., 2016). Despite its tremendous success, the reasons behind the good generalization properties of these methods to unseen data is not fully understood (and, arguably, remains somewhat of a mystery to this day). Initially, this success was mostly attributed to the special deep architecture of these models. However, in the past few years, it has been widely noted that the architecture is only part of the story, and, in fact, the optimization algorithms used to train these models, typically stochastic gradient descent (SGD) and its variants, play a key role in learning parameters that generalize well.
+
+In particular, it has been observed that since these deep models are highly over-parameterized, they have a lot of capacity, and can fit to virtually any (even random) set of data points (Zhang et al., 2016). In other words, highly over-parameterized models can “interpolate” the data, so much so that this regime has been called the “interpolating regime” (Ma et al., 2018). In fact, on a given dataset, the loss function often has (uncountably infinitely) many global minima, which can have drastically different generalization properties, and it is not hard to construct “trivial” global minima that do not generalize. Which minimum among all the possible minima we pick in practice is determined by the optimization algorithm that we use for training the model. Even though it may seem at first that, because of the non-convexity of the loss function, the stochastic descent algorithms may get stuck in local minima or saddle points, in practice they almost always achieve a global minimum (Kawaguchi, 2016; Zhang et al., 2016; Lee et al., 2016), which perhaps can also be justified by the fact that these models are highly over-parameterized. What is even more interesting is that not only do these stochastic descent algorithms converge to global minima, but they converge to “special” ones that generalize well, even in the absence of any explicit regularization or early stopping (Zhang et al., 2016). Furthermore, it has been observed that even among the common optimization algorithms, namely SGD or its variants (AdaGrad (Duchi et al., 2011), RMSProp (Tieleman & Hinton, 2012), Adam (Kingma & Ba, 2014), etc.), there is a discrepancy in the solutions achieved by different algorithms and their generalization capabilities (Wilson et al., 2017), which again highlights the important role of the optimization algorithm in generalization.
+
+There have been many attempts in recent years to explain the behavior and properties of these stochastic optimization algorithms, and many interesting insights have been obtained (Achille & Soatto, 2017; Chaudhari & Soatto, 2018; Shwartz-Ziv & Tishby, 2017; Soltanolkotabi et al., 2017). In particular, it has been argued that the optimization algorithms perform an implicit regularization (Neyshabur et al., 2017; Ma et al., 2017; Gunasekar et al., 2017; 2018a; Soudry et al., 2017; Gunasekar et al., 2018b) while optimizing the loss function, which is perhaps why the solution generalizes well. Despite this recent progress, most results explaining the behavior of the optimization algorithm, even for SGD, are limited to linear or very simplistic models. Therefore, a general characterization of the behavior of stochastic descent algorithms for more general models would be of great interest.
+
+# 1.1 OUR CONTRIBUTION
+
+In this paper, we present an alternative explanation of the behavior of SGD, and more generally, the stochastic mirror descent (SMD) family of algorithms, which includes SGD as a special case. We do so by obtaining a fundamental identity for such algorithms (see Lemmas 2 and 5). Using these identities, we show that for general nonlinear models and general loss functions, when the step size is sufficiently small, SMD (and therefore also SGD) is the optimal solution of a certain minimax filtering (or online learning) problem. The minimax formulation is inspired by, and rooted, in $H ^ { \infty }$ filtering theory, which was originally developed in the 1990’s in the context of robust control theory (Hassibi et al., 1999; Simon, 2006; Hassibi et al., 1996), and we generalize several results from this literature, e.g., (Hassibi et al., 1994; Kivinen et al., 2006). Furthermore, we show that many properties recently proven in the learning/optimization literature, such as the implicit regularization of SMD in the over-parameterized linear case—when convergence happens—(Gunasekar et al., 2018a), naturally follow from this theory. The theory also allows us to establish new results, such as the convergence (in a deterministic sense) of SMD in the over-parameterized linear case. We also use the theory developed in this paper to provide some speculative arguments into why SMD (and SGD) may have similar convergence and implicit regularization properties in the so-called “highly over-parameterized” nonlinear setting (where the number of parameters far exceeds the number of data points) common to deep learning.
+
+In an attempt to make the paper easier to follow, we first describe the main ideas and results in a simpler setting, namely, SGD on the square loss of linear models, in Section 3, and mention the connections to $H ^ { \infty }$ theory. The full results, for SMD on a general class of loss functions and for general nonlinear models, are presented in Section 4. We demonstrate some implications of this theory, such as deterministic convergence and implicit regularization, in Section 5, and we finally conclude with some remarks in Section 6. Most of the formal proofs are relegated to the appendix.
+
+# 2 PRELIMINARIES
+
+Denote the training dataset by $\{ ( x _ { i } , y _ { i } ) : i = 1 , \ldots , n \}$ , where $x _ { i } \in \mathbb { R } ^ { d }$ are the inputs, and $y _ { i } \in \mathbb { R }$ are the labels. We assume that the data is generated through a (possibly nonlinear) model $f _ { i } ( w ) =$ $f ( x _ { i } , w )$ with some parameter vector $w \in \mathbb { R } ^ { m }$ , plus some noise $v _ { i }$ , i.e., $y _ { i } = f ( x _ { i } , w ) + v _ { i }$ for $i = 1 , \ldots , n$ . The noise can be due to actual measurement error, or it can be due to modeling error (if the model $f ( x _ { i } , \cdot )$ is not rich enough to fully represent the data), or it can be a combination of both. As a result, we do not make any assumptions on the noise (such as stationarity, whiteness, Gaussianity, etc.).
+
+Since typical deep models have a lot of capacity and are highly over-parameterized, we are particularly interested in the over-parameterized (so-caled interpolating) regime, i.e., when $m > n$ . In this case, there are many parameter vectors $w$ (in fact, uncountably infinitely many) that are consistent with the observations. We denote the set of these parameter vectors by
+
+$$
+\mathcal { W } = \left\{ w \in \mathbb { R } ^ { m } \mid y _ { i } = f ( x _ { i } , w ) , i = 1 , \ldots , n \right\} .
+$$
+
+(Note the absence of the noise term, since in this regime we can fully interpolate the data.) The set $\mathcal { W }$ is typically an $( m - n )$ -dimensional manifold and depends only on the training data $\left\{ \left( x _ { i } , y _ { i } \right) : \right.$ $i = 1 , \ldots , n \}$ and nonlinear model $f ( \cdot , \cdot )$ .
+
+The total loss on the training set (empirical risk) can be denoted by $\begin{array} { r } { L ( w ) = \sum _ { i = 1 } ^ { n } L _ { i } ( w ) } \end{array}$ , where $L _ { i } ( \cdot )$ is the loss on the individual data point $i$ . We assume that the loss $L _ { i } ( \cdot )$ depends only on the residual, i.e., the difference between the prediction and the true label. In other words,
+
+$$
+L _ { i } ( w ) = l ( y _ { i } - f ( x _ { i } , w ) ) ,
+$$
+
+where $l ( \cdot )$ can be any nonnegative differentiable function with $l ( 0 ) = 0$ . Typical examples of $l ( \cdot )$ include square $( l _ { 2 } )$ loss, Huber loss, etc. We remark that, in the interpolating regime, every parameter vector in the set $\mathcal { W }$ renders each individual loss zero, i.e., $L _ { i } ( w ) = 0$ , for all $w \in \mathcal { W }$ .
+
+# 3 WARM-UP: REVISITING SGD ON SQUARE LOSS OF LINEAR MODELS
+
+In this section, we describe the main ideas and results in a simple setting, i.e., stochastic gradient descent (SGD) for the square loss of a linear model, and we revisit some of the results from $H ^ { \infty }$ theory (Hassibi et al., 1999; Simon, 2006). In this case, the data model is $y _ { i } = x _ { i } ^ { T } w + v _ { i } , i =$ $1 , \ldots , n$ (where there is no assumption on $v _ { i }$ ) and the loss function is $\begin{array} { r } { L _ { i } ( w ) = \frac { 1 } { 2 } ( y _ { i } - x _ { i } ^ { T } w ) ^ { 2 } } \end{array}$ .
+
+Assuming the data is indexed randomly, the SGD updates are defined as $w _ { i } = w _ { i - 1 } - \eta \nabla L _ { i } ( w _ { i - 1 } )$ where $\eta > 0$ is the step size or learning rate.1 The update in this case can be expressed as
+
+$$
+w _ { i } = w _ { i - 1 } + \eta \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) x _ { i } ,
+$$
+
+for $i \geq 1$ (for $i > n$ , we can either cycle through the data, or select them at random).
+
+Remark. We should point out that, when the step size $\eta$ is fixed, the SGD recursions have no hope of converging, unless there exists a weight vector $w$ which perfectly interpolates the data $\{ ( \bar { x } _ { i } , y _ { i } ) : i = \bar { 1 } , \bar { . } . . , n \}$ . The reason being that, if this is not the case, for any estimated weight vector in SGD there will exist at least one data point that has a nonzero instantaneous gradient and that will therefore move the estimate by a non-vanishing amount.2 It is for this reason that the results on the convergence of SGD and SMD (Sections 3.3 and 5) pertain to the interpolating regime.
+
+# 3.1 CONSERVATION OF UNCERTAINTY
+
+Prior to the $i$ -th step of any optimization algorithm, we have two sources of uncertainty: our uncertainty about the unknown parameter vector $w$ , which we can represent by $w - w _ { i - 1 }$ , and our uncertainty about the $i$ -th data point $( x _ { i } , y _ { i } )$ , which we can represent by the noise $v _ { i }$ . After the $i$ -th step, the uncertainty about $w$ is transformed to $w - w _ { i }$ . But what about the uncertainty in $v _ { i } ?$ What is it transformed to? In fact, we will view any optimization algorithm as one which redistributes the uncertainties at time $i - 1$ to new uncertainties at time $i$ . The two uncertainties, or error terms, we will consider are $e _ { i }$ and $e _ { p , i }$ , defined as follows.
+
+$$
+e _ { i } : = y _ { i } - x _ { i } ^ { T } w _ { i - 1 } , \mathrm { ~ a n d ~ } e _ { p , i } : = x _ { i } ^ { T } w - x _ { i } ^ { T } w _ { i - 1 } .
+$$
+
+$e _ { i }$ is often referred to as the innvovations and is the error in predicting $y _ { i }$ , given the input $x _ { i }$ . $e _ { p , i }$ is sometimes called the prediction error, since it is the error in predicting the noiseless output $x _ { i } ^ { T } w$ , i.e., in predicting what the best output of the model is. In the absence of noise, $e _ { i }$ and $e _ { p , i }$ coincide.
+
+One can show that SGD transforms the uncertainties in the fashion specified by the following lemma, which was first noted in (Hassibi et al., 1996).
+
+
+Figure 1: Illustration of Lemma 1. Each step of SGD can be viewed as a transformation of the uncertainties with the right coefficients.
+
+Lemma 1. For any parameter $w$ and noise values $\{ v _ { i } \}$ that satisfy $y _ { i } = x _ { i } ^ { T } w + v _ { i }$ for $i = 1 , \ldots , n ,$ and for any step size $\eta > 0$ , the following relation holds for the SGD iterates $\{ w _ { i } \}$ given in Eq. (3)
+
+$$
+\begin{array} { r } { \| w - w _ { i - 1 } \| ^ { 2 } + \eta v _ { i } ^ { 2 } = \| w - w _ { i } \| ^ { 2 } + \eta \left( 1 - \eta \| x _ { i } \| ^ { 2 } \right) e _ { i } ^ { 2 } + \eta e _ { p , i } ^ { 2 } , \quad \forall i \ge 1 . } \end{array}
+$$
+
+As illustrated in Figure 1, this means that each step of SGD can be thought of as a lossless transformation of the input uncertainties to the output uncertainties, with the specified coefficients.
+
+Once one knows this result, proving it is straightforward. To see that, note that we can write $v _ { i } =$ $y _ { i } - x _ { i } ^ { T } w$ as $v _ { i } = ( y _ { i } - x _ { i } ^ { T } \mathcal { \bar { w } } _ { i - 1 } ) \stackrel { \smile } { - } ( x _ { i } ^ { T } w - \bar { x } _ { i } ^ { T } w _ { i - 1 } )$ . Multiplying both sides by $\sqrt { \eta }$ , we have
+
+$$
+\sqrt { \eta } v _ { i } = \sqrt { \eta } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) - \sqrt { \eta } ( x _ { i } ^ { T } w - x _ { i } ^ { T } w _ { i - 1 } ) .
+$$
+
+On the other hand, subtracting both sides of the update rule (3) from $w$ yields
+
+$$
+w - w _ { i } = \left( w - w _ { i - 1 } \right) - \eta \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) x _ { i } .
+$$
+
+Squaring both sides of (6) and (7), and subtracting the results leads to Equation (5).
+
+A nice property of Equation (5) is that, if we sum over all $i = 1 , \dots , T$ , the terms $\| w - w _ { i } \| ^ { 2 }$ and $\lVert \boldsymbol { w } - \boldsymbol { w } _ { i - 1 } \rVert ^ { 2 }$ on different sides cancel out telescopically, leading to the following important lemma.
+
+Lemma 2. For any parameter $w$ and noise values $\{ v _ { i } \}$ that satisfy $y _ { i } = x _ { i } ^ { T } w + v _ { i }$ for $i = 1 , \ldots , n ,$ , any initialization $w _ { 0 }$ , any step size $\eta > 0$ , and any number of steps $T \geq 1$ , the following relation holds for the SGD iterates $\{ w _ { i } \}$ given in Eq. (3)
+
+$$
+\boxed { \| w - w _ { 0 } \| ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } v _ { i } ^ { 2 } = \| w - w _ { T } \| ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } \left( 1 - \eta \| x _ { i } \| ^ { 2 } \right) e _ { i } ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } e _ { p , i } ^ { 2 } . }
+$$
+
+As we will show next, this identity captures most properties of SGD, and implies several important results in a very transparent fashion. For this reason, this relation can be viewed as a “fundamental identity” for SGD.
+
+# 3.2 MINIMAX OPTIMALITY OF SGD
+
+For a given horizon $T$ , consider the following minimax problem:
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { \Vert w - w _ { T } \Vert ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } e _ { p , i } ^ { 2 } } { \Vert w - w _ { 0 } \Vert ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } v _ { i } ^ { 2 } } .
+$$
+
+This minimax problem is motivated by the theory of $H ^ { \infty }$ control and estimation (Francis, 1987; Hassibi et al., 1999; Bas¸ar & Bernhard, 2008). The denominator of the cost function can be interpreted as the energy of the uncertainties and consists of two terms, $\| w - w _ { 0 } \| ^ { 2 }$ , the energy of our uncertainty of the unknown weight vector at the beginning of learning when we have not yet observed the data, and $\textstyle \sum _ { i = 1 } ^ { T } v _ { i } ^ { 2 }$ , the energy of the uncertainty in the measurements. The numerator denotes the energy of the estimation errors in an online setting. The first term, $\| w - w _ { T } \| ^ { 2 }$ , is the energy of our uncertainty of the unknown weight vector after we have observed $T$ data points, and the second term, P i=1 e p,i $\begin{array} { r } { \sum _ { i = 1 } ^ { T } e _ { p , i } ^ { \dot { 2 } } = \sum _ { i = 1 } ^ { T } ( x _ { i } ^ { T } w - x _ { i } ^ { \hat { T } } w _ { i - 1 } ) ^ { 2 } } \end{array}$ , is the energy of the prediction error, i.e., how well we can predict the true uncorrupted output $x _ { i } ^ { T } w$ using measurements up to time $i - 1$ . The parameter $\eta$ weighs the two energy terms relative to each other. In this minimax problem, nature has access to the unknown weight vector $w$ and the noise sequence $v _ { i }$ and would like to maximize the energy gain from the uncertainties to prediction errors (so that the estimator behaves poorly), whereas the estimator attempts to minimize the energy gain. Such an estimator is referred to as $H ^ { \infty }$ -optimal and is robust because it safeguards against the worst-case noise. It is also conservative—for the exact same reason.3
+
+Theorem 3. For any initialization $w _ { 0 }$ , any step size $\begin{array} { r } { 0 < \eta \leq \operatorname* { m i n } _ { i } { \frac { 1 } { \| x _ { i } \| ^ { 2 } } } } \end{array}$ , and any number of steps $T \geq 1$ , the stochastic gradient descent iterates $\{ w _ { i } \}$ given in Eq. (3) are the optimal solution to the minimax problem (9). Furthermore, the optimal minimax value (achieved by SGD) is 1.
+
+This theorem explains the observed robustness and conservatism of SGD. Despite the conservativeness of safeguarding against the worst-case disturbance, this choice may actually be the rational thing to do in situations where we do not have much knowledge about the disturbances, which is the case in many machine learning tasks.
+
+Theorem 3 holds for any horizon $T \geq 1$ . A variation of this result, i.e., when $T \to \infty$ and without the $\Vert w - w _ { T } \Vert ^ { 2 }$ term in the numerator, was first shown in (Hassibi et al., 1994; 1996). In that case, the ratio $\begin{array} { r } { \frac { \eta \sum _ { i = 1 } ^ { \infty } e _ { p , i } ^ { 2 } } { \Vert w - w _ { 0 } \Vert ^ { 2 } + \eta \sum _ { i = 1 } ^ { \infty } v _ { i } ^ { 2 } } } \end{array}$ in the minimax problem is in fact the √ $H ^ { \infty }$ norm of the transfer operator√ that maps the unknown disturbances $( w - w _ { 0 } , \{ \sqrt { \eta } v _ { i } \} )$ to the prediction errors $\{ \sqrt { \eta } e _ { p , i } \}$ .
+
+We end this section with a stochastic interpretation of SGD (Hassibi et al., 1996). Assume that the true weight vector has a normal distribution with mean $w _ { 0 }$ and covariance matrix $\eta I$ , and that the noise $v _ { i }$ are iid standard normal. Then SGD solves
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \mathbb { E } \exp \left( \frac { 1 } { 2 } \cdot \left( \| w - w _ { T } \| ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } ( x _ { i } ^ { T } w - x _ { i } ^ { T } w _ { i - 1 } ) ^ { 2 } \right) \right) ,
+$$
+
+and no exponent larger than $\frac { 1 } { 2 }$ is possible, in the sense that no estimator can keep the expected cost finite. This means that, in the Gaussian setting, SGD minimizes the expected value of an exponential quadratic cost. The algorithm is thus very adverse to large estimation errors, as they are penalized exponentially larger than moderate ones.
+
+# 3.3 CONVERGENCE AND IMPLICIT REGULARIZATION
+
+The over-parameterized (interpolating) linear regression regime is a simple but instructive setting, recently considered in some papers (Gunasekar et al., 2018a; Zhang et al., 2016). In this setting, we can show that, for sufficiently small step, i.e. $\begin{array} { r } { 0 < \eta \leq \operatorname* { m i n } _ { i } \frac { \mathbf { \tilde { 1 } } } { \| x _ { i } \| ^ { 2 } } } \end{array}$ , SGD always converges to a special solution among all the solutions $\mathcal { W }$ , in particular to the one with the smallest $l _ { 2 }$ distance from $w _ { 0 }$ . In other words, if, for example, initialized at zero, SGD implicitly regularizes the solution according to an $l _ { 2 }$ norm. This result follows directly from Lemma 2.
+
+To see that, note that in the interpolating case the $v _ { i }$ are zero, and we have $e _ { i } = y _ { i } - x _ { i } ^ { T } w _ { i - 1 } =$ $x _ { i } ^ { T } w - x _ { i } ^ { T } w _ { i - 1 } = e _ { p , i }$ . Hence, identity (8) reduces to
+
+$$
+\| w - w _ { 0 } \| ^ { 2 } = \| w - w _ { T } \| ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } \left( 2 - \eta \| x _ { i } \| ^ { 2 } \right) e _ { i } ^ { 2 } ,
+$$
+
+for all $w \in \mathbf { \Sigma } \mathcal { W }$ . By dropping the $\| w \mathrm { ~ - ~ } w _ { T } \| ^ { 2 }$ term and taking $\textit { T } \infty$ , we have $\begin{array} { r } { \eta \sum _ { i = 1 } ^ { \infty } \left( 2 - \eta \| x _ { i } \| ^ { 2 } \right) e _ { i } ^ { 2 } \ \leq \ \| w - w _ { 0 } \| ^ { 2 } } \end{array}$ T , which implies that, for $\begin{array} { r } { 0 < \eta < \operatorname* { m i n } _ { i } \frac { 2 } { \| x _ { i } \| ^ { 2 } } } \end{array}$ , we must have $e _ { i } \to 0$ as $i \infty$ . When $e _ { i } = y _ { i } - x _ { i } ^ { T } w _ { i - 1 }$ goes to zero, the updates in (3) vanish and we get convergence, i.e., $w w _ { \infty }$ . Further, again because $e _ { i } \to 0$ , all the data points are being fit, which means $w _ { \infty } \in \mathcal { W }$ . Moreover, it is again very straightforward to see from (11) that the solution converged to is the one with minimum Euclidean norm from the initial point. To see that, notice that the summation term in Eq. (11) is independent of $w$ (it depends only on $x _ { i } , y _ { i }$ and $w _ { 0 }$ ). Therefore, by taking $T \to \infty$ and minimizing both sides with respect to $w \in \mathcal { W }$ , we get
+
+$$
+\boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } \left\| \boldsymbol { w } - \boldsymbol { w } _ { 0 } \right\| .
+$$
+
+Once again, this also implies that if SGD is initialized at the origin, i.e., $w _ { 0 } = 0$ , then it converges to the minimum- $l _ { 2 }$ -norm solution, among all the solutions.
+
+# 4 MAIN RESULT: GENERAL CHARACTERIZATION OF STOCHASTIC MIRROR DESCENT
+
+Stochastic Mirror Descent (SMD) (Nemirovskii et al., 1983; Beck & Teboulle, 2003; Cesa-Bianchi et al., 2012; Zhou et al., 2017) is one of the most widely used families of algorithms for stochastic optimization, which includes SGD as a special case. In this section, we provide a characterization of the behavior of general SMD, on general loss functions and general nonlinear models, in terms of a fundamental identity and minimax optimality.
+
+For any strictly convex and differentiable potential $\psi ( \cdot )$ , the corresponding SMD updates are defined as
+
+$$
+\boldsymbol { w } _ { i } = \underset { \boldsymbol { w } } { \arg \operatorname* { m i n } } \ \eta \boldsymbol { w } ^ { T } \nabla L _ { i } ( \boldsymbol { w } _ { i - 1 } ) + D _ { \boldsymbol { \psi } } ( \boldsymbol { w } , \boldsymbol { w } _ { i - 1 } ) ,
+$$
+
+where
+
+$$
+D _ { \psi } ( w , w _ { i - 1 } ) = \psi ( w ) - \psi ( w _ { i - 1 } ) - \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } )
+$$
+
+is the Bregman divergence with respect to the potential function $\psi ( \cdot )$ . Note that $D _ { \psi } ( \cdot , \cdot )$ is nonnegative, convex in its first argument, and that, due to strict convexity, $D _ { \psi } ( w , w ^ { \prime } ) = \stackrel { . } { 0 }$ iff $w = w ^ { \prime }$ . Moreover, the updates can be equivalently written as
+
+$$
+\nabla \psi ( w _ { i } ) = \nabla \psi ( w _ { i - 1 } ) - \eta \nabla L _ { i } ( w _ { i - 1 } ) ,
+$$
+
+which are uniquely defined because of the invertibility of $\nabla \psi$ (again, implied by the strict convexity of $\psi ( \cdot ) )$ ). In other words, stochastic mirror descent can be thought of as transforming the variable $w$ , with a mirror map $\nabla \psi ( \cdot )$ , and performing the SGD update on the new variable. For this reason, $\nabla \psi ( w )$ is often referred to as the dual variable, while $w$ is the primal variable.
+
+Different choices of the potential function $\psi ( \cdot )$ yield different optimization algorithms, which, as we will see, result in different implicit regularizations. To name a few examples: For the potential function $\psi ( w ) = \textstyle { \frac { 1 } { 2 } } \| w \| ^ { 2 }$ , the Bregman divergence is $\begin{array} { r } { D _ { \psi } ( w , w ^ { \prime } ) = \frac 1 2 \| w - w ^ { \prime } \| ^ { 2 } } \end{array}$ , and the update rule reduces to that of SGD. For $\begin{array} { r } { \psi ( \boldsymbol { w } ) { \bf \bar { \chi } } = \sum _ { j } w _ { j } \operatorname* { l o g } w _ { j } } \end{array}$ , the Bregman divergence becomes the unnormalized relative entropy (Kullback-Leibler divergence) $\begin{array} { r } { D _ { \psi } ( w , w ^ { \prime } ) = \sum _ { j } w _ { j } \log \frac { w _ { j } } { w _ { j } ^ { \prime } } - \sum _ { j } w _ { j } + \sum _ { j } w _ { j } ^ { \prime } } \end{array}$ , which corresponds to the exponentiated gradient descent (aka the exponential weights) algorithm. Other examples include $\begin{array} { r } { \psi ( \dot { w } ) = \frac { 1 } { 2 } \| w \| _ { Q } ^ { 2 } = \frac { 1 } { 2 } w ^ { T } Q w } \end{array}$ for a positive definite matrix $Q$ , which yields $\begin{array} { r } { D _ { \psi } ( w , w ^ { \prime } ) = \frac 1 2 ( w - w ^ { \prime } ) ^ { T } Q ( w - w ^ { \prime } ) } \end{array}$ , and the $q$ -norm squared $\begin{array} { r } { \psi ( w ) = \frac 1 2 \| w \| _ { q } ^ { 2 } } \end{array}$ , which with $\textstyle { \frac { 1 } { p } } + { \frac { 1 } { q } } = 1$ yields the $p$ -norm algorithms (Grove et al., 2001; Gentile, 2003).
+
+In order to derive an equivalent “conservation law” for SMD, similar to the identity (5), we first need to define a new measure for the difference between the parameter vectors $w$ and $w ^ { \prime }$ according to the loss function $L _ { i } ( \cdot )$ . To that end, let us define
+
+$$
+D _ { L _ { i } } ( w , w ^ { \prime } ) : = L _ { i } ( w ) - L _ { i } ( w ^ { \prime } ) - \nabla L _ { i } ( w ^ { \prime } ) ^ { T } ( w - w ^ { \prime } ) ,
+$$
+
+which is defined in a similar way to a Bregman divergence for the loss function.4 The difference though is that, unlike the potential function of the Bregman divergence, the loss function $L _ { i } ( \cdot ) =$ $\ell ( y _ { i } - f ( x _ { i } , \cdot ) )$ need not be convex, even when $\ell ( \cdot )$ is, due to the nonlinearity of $f ( \cdot , \cdot )$ . As a result, $D _ { L _ { i } } ( w , w ^ { \prime } )$ is not necessarily non-negative. The following result, which is the general counterpart of Lemma 1, states the identity that characterizes SMD updates in the general setting.
+
+Lemma 4. For any (nonlinear) model $f ( \cdot , \cdot )$ , any differentiable loss $l ( \cdot )$ , any parameter $w$ and noise values $\{ v _ { i } \}$ that satisfy $y _ { i } = f ( x _ { i } , w ) + v _ { i }$ for $i = 1 , \ldots , n$ , and any step size $\eta > 0$ , the following relation holds for the SMD iterates $\{ w _ { i } \}$ given in Eq. (15)
+
+$$
+D _ { \psi } ( w , w _ { i - 1 } ) + \eta l ( v _ { i } ) = D _ { \psi } ( w , w _ { i } ) + E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) ,
+$$
+
+4It is easy to verify that for linear models and quadratic loss we obtain $D _ { L _ { i } } ( w , w ^ { \prime } ) = ( x _ { i } ^ { T } w - x _ { i } ^ { T } w ^ { \prime } ) ^ { 2 }$
+
+for all $i \geq 1$ , where
+
+$$
+\begin{array} { r } { E _ { i } ( w _ { i } , w _ { i - 1 } ) : = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) + \eta L _ { i } ( w _ { i } ) . } \end{array}
+$$
+
+The proof is provided in Appendix A. Note that $E _ { i } ( w _ { i } , w _ { i - 1 } )$ is not a function of $w$ . Furthermore, even though it does not have to be nonnegative in general, for $\eta$ sufficiently small, it becomes nonnegative, because the Bregman divergence $D _ { \psi } ( . , . )$ is nonnegative.
+
+Summing Equation (17) over all $i = 1 , \dots , T$ leads to the following identity, which is the general counterpart of Lemma 2.
+
+Lemma 5. For any (nonlinear) model $f ( \cdot , \cdot )$ , any differentiable loss $l ( \cdot )$ , any parameter $w$ and noise values $\{ v _ { i } \}$ that satisfy $y _ { i } = f ( x _ { i } , w ) + v _ { i }$ for $i = 1 , \ldots , n$ , any initialization $w _ { 0 }$ , any step size $\eta > 0$ , and any number of steps $T \geq 1$ , the following relation holds for the SMD iterates $\{ w _ { i } \}$ given in Eq. (15)
+
+$$
+\boxed { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) . }
+$$
+
+We should reiterate that Lemma 5 is a fundamental property of SMD, which allows one to prove many important results, in a direct way.
+
+In particular, in this setting, we can show that SMD is minimax optimal in a manner that generalizes Theorem 3 of Section 3, in the following 3 ways: 1) General potential $\psi ( \cdot ) , 2 )$ General model $f ( \cdot , \cdot )$ , and 3) General loss function $l ( \cdot )$ . The result is as follows.
+
+Theorem 6. Consider any (nonlinear) model $f ( \cdot , \cdot )$ , any non-negative differentiable loss $l ( \cdot )$ with the property $l ( 0 ) = l ^ { \prime } ( 0 ) \stackrel { . } { = } 0$ , and any initialization $w _ { 0 }$ . For sufficiently small step size, i.e., for any $\eta > 0$ for which ${ \psi } ( w ) - \eta L _ { i } ( w )$ is convex for all $i ,$ , and for any number of steps $T \geq 1$ , the SMD iterates $\{ w _ { i } \}$ given by $E q$ . (15), w.r.t. any strictly convex potential $\psi ( \cdot )$ , is the optimal solution to the following minimization problem
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) } .
+$$
+
+Furthermore, the optimal value (achieved by SMD) is 1.
+
+The proof is provided in Appendix B. For the case of square loss and a linear model, the result reduces to the following form.
+
+Corollary 7. For $\begin{array} { r } { L _ { i } ( w ) = \frac { 1 } { 2 } ( y _ { i } - x _ { i } ^ { T } w ) ^ { 2 } } \end{array}$ , for any initialization $w _ { 0 }$ , any sufficiently small step size, i.e., $\begin{array} { r } { 0 < \eta \leq \frac { \alpha } { \| x _ { i } \| ^ { 2 } } } \end{array}$ , and any number of steps $T \geq 1$ , the SMD iterates $\{ w _ { i } \}$ given by Eq. (15), w.r.t. any $\alpha$ -strongly convex potential $\psi ( \cdot )$ , is the optimal solution to
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \frac { \eta } { 2 } \sum _ { i = 1 } ^ { T } e _ { p , i } ^ { 2 } } { D _ { \psi } ( w , w _ { 0 } ) + \frac { \eta } { 2 } \sum _ { i = 1 } ^ { T } v _ { i } ^ { 2 } } .
+$$
+
+The optimal value (achieved by SMD) is 1.
+
+We should remark that Theorem 6 and Corollary 7 generalize several known results in the literature. In particular, as mentioned in Section 3, the result of (Hassibi et al., 1994) is a special case of Corollary 7 for $\begin{array} { r } { \psi ( w ) = \frac { 1 } { 2 } \| w \| ^ { 2 } } \end{array}$ . Furthermore, our result generalizes the result of (Kivinen et al., 2006), which is the special case for the $p$ -norm algorithms, again, with square loss and a linear model. Another interesting connection to the literature is that it was shown in (Hassibi & Kailath, 1995) that SGD is locally minimax optimal, with respect to the $H ^ { \infty }$ norm. Strictly speaking, our result is not a generalization of that result; however, Theorem 6 can be interpreted as SGD/SMD being globally minimax optimal, but with respect to different metrics in the numerator and denominator. Namely, the uncertainty about the weight vector $w$ is measured by the Bregman divergence of the potential, the uncertainty about the noise by the loss, and the prediction error by the “Bregman-divergencelike” expression of the loss.
+
+# 5 CONVERGENCE AND IMPLICIT REGULARIZATION IN OVER-PARAMETERIZED MODELS
+
+In this section, we show some of the implications of the theory developed in the previous section. In particular, we show convergence and implicit regularization, in the over-parameterized (so-called interpolating) regime5, for general SMD algorithms. We first consider the linear interpolating case, which has been studied in the literature, and show that the known results follow naturally from our Lemma 5. Further, we shall obtain some new convergence results. Finally, we discuss the implications for nonlinear models, and argue that the same results hold qualitatively in highlyoverparameterized settings, which is the typical scenario in deep learning.
+
+# 5.1 OVER-PARAMETERIZED LINEAR MODELS
+
+In this setting, the $v _ { i }$ are zero, ${ \mathcal { W } } = \left\{ w \mid y _ { i } = x _ { i } ^ { T } w , i = 1 , \ldots , n \right\}$ , and $L _ { i } ( w ) = l ( y _ { i } - x _ { i } ^ { T } w )$ , with any differentiable loss $l ( \cdot )$ . Therefore, Eq. (19) reduces to
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) ,
+$$
+
+for all $w \in \mathcal W$ , where
+
+$$
+\begin{array} { r l } & { { D } _ { L _ { i } } ( w , w _ { i - 1 } ) = L _ { i } ( w ) - L _ { i } ( w _ { i - 1 } ) - \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } ) } \\ & { \qquad = 0 - l ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) + l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) x _ { i } ^ { T } ( w - w _ { i - 1 } ) } \\ & { \qquad = - l ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) + l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) } \end{array}
+$$
+
+which is notably independent of $w$ . As a result, we can easily minimize both sides of Eq. (22) with respect to $w \in \mathcal W$ , which for $T \to \infty$ leads to the following result.
+
+Proposition 8. For any differentiable loss $l ( \cdot )$ , any initialization $w _ { 0 }$ , and any step size $\eta _ { ; }$ , consider the SMD iterates given in Eq. (15) with respect to any strictly convex potential $\psi ( \cdot )$ . If the iterates converge to a solution $w _ { \infty } \in \mathcal { W }$ , then
+
+$$
+\boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
+$$
+
+Remark. In particular, for the initialization $\begin{array} { r } { { w _ { 0 } } = \arg \operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } \psi ( w ) } \end{array}$ , if the iterates converge to a solution $w _ { \infty } \in \mathcal { W }$ , then
+
+$$
+\boldsymbol { w } _ { \infty } = \arg \operatorname* { m i n } _ { \boldsymbol { w } \in \mathcal { W } } \boldsymbol { \psi } ( \boldsymbol { w } ) .
+$$
+
+An equivalent form of Proposition 8 has been shown recently in, e.g., (Gunasekar et al., 2018a).6 Other implicit regularization results have been shown in (Gunasekar et al., 2018b; Soudry et al., 2017) for classification problems, which are not discussed here. Note that the result of (Gunasekar et al., 2018a) does not say anything about whether the algorithm converges or not. However, our fundamental identity of SMD (Lemma 5) allows us to also establish convergence to the regularized point, for some common cases, which will be shown next.
+
+What Proposition 8 says is that depending on the choice of the potential function $\psi ( \cdot )$ , the optimization algorithm can perform an implicit regularization without any explicit regularization term. In other words, for any desired regularizer, if one chooses a potential function that approximates the regularizer, we can run the optimization without explicit regularization, and if it converges to a solution, the solution must be the one with the minimum potential.
+
+In principle, one can choose the potential function in SMD for any desired convex regularization. For example, we can find the maximum entropy solution by taking the potential to be the negative entropy. Another illustrative example follows.
+
+Example [Compressed Sensing]: In compressed sensing, one seeks the sparsest solution to an under-determined (over-parameterized) system of linear equations. The surrogate convex problem one solves is:
+
+$$
+\begin{array} { r l } { \operatorname* { m i n } } & { { } \| w \| _ { 1 } } \\ { \mathrm { s u b j e c t ~ t o } } & { { } y _ { i } = x _ { i } ^ { T } w , i = 1 , \dots n } \end{array}
+$$
+
+One cannot choose $\psi ( w ) = \| w \| _ { 1 }$ , since it is neither differentiable nor strictly convex. However, $\psi ( w ) = \| w \| _ { 1 + \epsilon }$ , for any $\epsilon > 0$ , can be used. Figure 4 shows a compressed sensing example, with $n = 5 0$ , $m = 1 0 0$ , and sparsity $k = 1 0$ . SMD was used with a step size of $\eta = 0 . 0 0 1$ and the potential function was ${ \psi } ( \cdot ) \mathbf { \bar { \psi } } = \| \cdot \| _ { 1 . 1 }$ . SMD converged to the true sparse solution after around 10,000 iterations. On this example, it was an order of magnitude faster than standard $l _ { 1 }$ optimization.
+
+
+Figure 2: The training loss and actual error of stochastic mirror descent for compressed sensing. SMD recovers the actual sparse signal.
+
+Next we establish convergence to the regularized point for the convex case.
+
+Proposition 9. Consider the following two cases.
+
+(i) $l ( \cdot )$ is differentiable and convex and has a unique root at $O$ , $\psi ( \cdot )$ is strictly convex, and $\eta > 0$ is such that $\psi - \eta L _ { i }$ is convex for all $i$ .
+(ii) $l ( \cdot )$ is differentiable and quasi-convex, $l ^ { \prime } ( \cdot )$ is zero only at zero, $\psi ( \cdot )$ is $\alpha$ -strongly convex, and 0 < η ≤ mini i i i−1 kxik2|l0(yi−xTi wi−1)| .
+
+If either (i) or (ii) holds, then for any $w _ { 0 }$ , the SMD iterates given in Eq. (15) converge to
+
+$$
+\boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
+$$
+
+The proof is provided in Appendix C.
+
+# 5.2 DISCUSSION OF HIGHLY OVER-PARAMETERIZED NONLINEAR MODELS
+
+Let us consider the highly-overparameterized nonlinear model
+
+$$
+y _ { i } = f ( x _ { i } , w ) , \quad i = 1 , \ldots , n , \quad w \in \mathbb { R } ^ { m }
+$$
+
+where by highly-overparameterized we mean $m \gg n$ . Since the model is highly over-parameterized, it is assumed that we can perfectly interpolate the data points $( x _ { i } , y _ { i } )$ so that the noise $v _ { i }$ is zero. In this case, the set of parameter vectors that interpolate the data is given by $\mathcal { W } = \{ w \in \mathbb { R } ^ { m } \ | \ y _ { i } =$ $f ( x _ { i } , w ) , i = 1 , \ldots , n \}$ , and Eq. (19), again, reduces to
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) ,
+$$
+
+for all $w \in \mathcal W$ . Our proofs of convergence and implicit regularization for SGD and SMD in the linear case relied on two facts: (i) $D _ { L _ { i } } ( w , w _ { i - 1 } )$ was non-negative (this allowed us to show convergence), and (ii) $D _ { L _ { i } } ( w , w _ { i - 1 } )$ was independent of $w$ (this allowed us to show implicit regularization). Unfortunately, neither of these hold in the nonlinear case.
+
+However, they do hold in a local sense. In other words, (i) $D _ { L _ { i } } ( w , w _ { i - 1 } ) \geq 0$ for $w _ { i - 1 }$ “close enough” to $w$ (see Figure 3), and (ii) $D _ { L _ { i } } ( w , w _ { i - 1 } )$ is weakly dependent on $w$ for $w _ { i - 1 }$ “close enough.” (Both statements can be made precise.)
+
+
+Figure 3: Non-negativity of $D _ { L _ { i } } ( w , w _ { i - 1 } )$ for $w _ { i - 1 }$ “close enough” to $w$ .
+
+Now define
+
+$$
+w _ { * } = \arg \operatorname* { m i n } _ { w \in \mathcal { W } } D _ { \psi } ( w , w _ { 0 } ) .
+$$
+
+Then one can show the following result.
+
+Theorem 10. There exists an $\epsilon > 0$ , such that if $\lVert w _ { * } - w _ { 0 } \rVert < \epsilon$ , then for sufficiently small step size $\eta > 0$ :
+
+1. SMD iterates converge to a point $w _ { \infty } \in \mathcal { W }$
+
+$$
+\| w _ { \infty } - w _ { * } \| = o ( \epsilon )
+$$
+
+This shows that if the initial condition is close enough, then we have convergence to a point $w _ { \infty }$ that interpolates the data, and that $w _ { \infty }$ is an order of magnitude closer to $w _ { * }$ (the implicitly regularized solution) than the initial $w _ { 0 }$ was. At first glance, this result seems rather dissatisfying. It relies on $w _ { 0 }$ being close to the manifold $\mathcal { W }$ which appears hard to guarantee. We would now like to argue that in deep learning $w _ { 0 }$ being close to $\mathcal { W }$ is often the case.
+
+In the highly-overparameterized regime, $m \gg n$ , and so the dimension of the manifold $\mathcal { W }$ is $m - n$ , which is very large. Now if the $x _ { i }$ are sufficiently random, then the tangent space to $\mathcal { W }$ at $w _ { * }$ will be a randomly oriented affine subspace of dimension $m - n$ . This means that any randomly chosen $w _ { 0 }$ will whp have a very large component when projected onto $\mathcal { W }$ . In particular, it can be shown that $\begin{array} { r } { \| w _ { * } ^ { \cdot } - w _ { 0 } \| ^ { 2 } = { \bf \dot { O } } ( \frac { \bar { n } ^ { \cdot } } { m } ) \cdot \| y ^ { \cdot } - f ( x , w ) \| ^ { 2 } } \end{array}$ , where $y = \sec ( y _ { i } , i = 1 , \dots , n )$ and $f ( x , w ) = \sec ( f ( x _ { i } , w ) , i = 1 , \dots , n )$ . Thus, we may expect that, when $m \gg n$ , the distance of any randomly chosen $w _ { 0 }$ to $\mathcal { W }$ will be small and so SMD will converge to a point on $\mathcal { W }$ that approximately performs implicit regularization.
+
+The gist of the argument is that (i) When $m \gg n$ , any random initial condition is “close” to the $n - m$ dimensional solution manifold $\mathcal { W }$ , (ii) when $w _ { 0 }$ is “close” to $w _ { * }$ , then SMD converges to a point $w _ { \infty } \in \mathcal { W }$ , (iii) $w _ { \infty }$ is “an order of magnitude closer” to $w _ { * }$ than $w _ { 0 }$ was, and (iv) thus, when highly overparamatrized, SMD converges to a point that exhibits implicit regularization.
+
+Of course, this was a very heuristic argument that merits a much more careful analysis. But it is suggestive of the fact that SGD and SMD, when performed on highly-overparameterized nonlinear models, as occurs in deep learning, may exhibit implicit regularization.
+
+# 6 CONCLUDING REMARKS
+
+We should remark that all the results stated throughout the paper extend to the case of time-varying step size $\eta _ { i }$ , with minimal modification. In particular, it is easy to show that in this case, the identity (the counterpart of Eq. (19)) becomes
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } l ( v _ { i } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) ,
+$$
+
+where $E _ { i } ( w _ { i } , w _ { i - 1 } ) = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta _ { i } D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) + \eta _ { i } L _ { i } ( w _ { i } )$ . As a consequence, our main result will be the same as in Theorem 6, with the only difference that the small-step-size condition in this case is the convexity of ${ \psi } ( w ) - \eta _ { i } L _ { i } ( w )$ for all $i$ , and the SMD with time-varying step size will be the optimal solution to the following minimax problem
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } l ( v _ { i } ) } .
+$$
+
+Similarly, the convergence and implicit regularization results can be proven under the same conditions (See Appendix D for more details on the time-varying case).
+
+This paper opens up a variety of important directions for future work. Most of the analysis developed here is general, in terms of the model, the loss function, and the potential function. Therefore, it would be interesting to study the implications of this theory for specific classes of models (such as different neural networks), specific losses, and specific mirror maps (which induce different regularization biases). Something for future work.
+
+# ACKNOWLEDGMENTS
+
+This work was supported in part by the National Science Foundation under grants CCF-1423663, CCF-1409204 and ECCS-1509977, by a grant from Qualcomm Inc., by NASA’s Jet Propulsion Laboratory through the President and Director’s Fund, and by Amazon Web Services Inc. and PIMCO LLC through fellowships.
+
+# REFERENCES
+
+Alessandro Achille and Stefano Soatto. On the emergence of invariance and disentangling in deep representations. arXiv preprint arXiv:1706.01350, 2017.
+
+Navid Azizan and Babak Hassibi. A characterization of stochastic mirror descent algorithms and their convergence properties. In IEEE International Conference on Acoustics, Speech and Signal Processing, 2019.
+
+Tamer Bas¸ar and Pierre Bernhard. H-infinity optimal control and related minimax design problems: a dynamic game approach. Springer Science & Business Media, 2008.
+
+Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167–175, 2003.
+
+Nicolo Cesa-Bianchi, Pierre Gaillard, Gabor Lugosi, and Gilles Stoltz. Mirror descent meets fixed ´ share (and feels no regret). In Advances in Neural Information Processing Systems, pp. 980–988, 2012.
+
+Pratik Chaudhari and Stefano Soatto. Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks. In International Conference on Learning Representations, 2018.
+
+John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
+
+Bruce A Francis. A course in H-infinity control theory. Berlin; New York: Springer-Verlag, 1987.
+
+Claudio Gentile. The robustness of the p-norm algorithms. Machine Learning, 53(3):265–299, 2003.
+
+Adam J Grove, Nick Littlestone, and Dale Schuurmans. General convergence results for linear discriminant updates. Machine Learning, 43(3):173–210, 2001.
+
+Suriya Gunasekar, Blake E Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Implicit regularization in matrix factorization. In Advances in Neural Information Processing Systems, pp. 6152–6160, 2017.
+
+Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. arXiv preprint arXiv:1802.08246, 2018a.
+
+Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Implicit bias of gradient descent on linear convolutional networks. arXiv preprint arXiv:1806.00468, 2018b.
+
+Babak Hassibi and Thomas Kailath. Hoo optimal training algorithms and their relation to backpropagation. In Advances in Neural Information Processing Systems 7, pp. 191–198. 1995.
+
+Babak Hassibi, Ali H. Sayed, and Thomas Kailath. Hoo optimality criteria for LMS and backpropagation. In Advances in Neural Information Processing Systems 6, pp. 351–358. 1994.
+
+Babak Hassibi, Ali H Sayed, and Thomas Kailath. Hoo optimality of the LMS algorithm. IEEE Transactions on Signal Processing, 44(2):267–280, 1996.
+
+Babak Hassibi, Ali H Sayed, and Thomas Kailath. Indefinite-Quadratic Estimation and Control: A Unified Approach to H2 and H-infinity Theories, volume 16. SIAM, 1999.
+
+Elad Hazan. Introduction to online convex optimization. Foundations and Trends in Optimization, 2(3-4):157–325, 2016. ISSN 2167-3888.
+
+Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Jyrki Kivinen, Manfred K Warmuth, and Babak Hassibi. The p-norm generalization of the LMS algorithm for adaptive filtering. IEEE Transactions on Signal Processing, 54(5):1782–1793, 2006.
+
+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, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436, 2015.
+
+Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent only converges to minimizers. In Conference on Learning Theory, pp. 1246–1257, 2016.
+
+Cong Ma, Kaizheng Wang, Yuejie Chi, and Yuxin Chen. Implicit regularization in nonconvex statistical estimation: Gradient descent converges linearly for phase retrieval, matrix completion and blind deconvolution. arXiv preprint arXiv:1711.10467, 2017.
+
+Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of SGD in modern over-parametrized learning. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pp. 3325–3334. PMLR, 2018.
+
+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.
+
+Arkadii Nemirovskii, David Borisovich Yudin, and Edgar Ronald Dawson. Problem complexity and method efficiency in optimization. 1983.
+
+Behnam Neyshabur, Ryota Tomioka, Ruslan Salakhutdinov, and Nathan Srebro. Geometry of optimization and implicit regularization in deep learning. arXiv preprint arXiv:1705.03071, 2017.
+
+Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2012. ISSN 1935-8237.
+
+Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
+
+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.
+
+Dan Simon. Optimal state estimation: Kalman, H infinity, and nonlinear approaches. John Wiley & Sons, 2006.
+
+Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv preprint arXiv:1707.04926, 2017.
+
+Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. arXiv preprint arXiv:1710.10345, 2017.
+
+Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26– 31, 2012.
+
+Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems, pp. 4151–4161, 2017.
+
+Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
+
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
+
+Zhengyuan Zhou, Panayotis Mertikopoulos, Nicholas Bambos, Stephen Boyd, and Peter W Glynn. Stochastic mirror descent in variationally coherent optimization problems. In Advances in Neural Information Processing Systems, pp. 7043–7052, 2017.
+
+# Supplementary Material
+
+# A PROOF OF LEMMA 4
+
+Proof. Let us start by expanding the Bregman divergence $D _ { \psi } ( w , w _ { i } )$ based on its definition
+
+$$
+D _ { \psi } ( w , w _ { i } ) = \psi ( w ) - \psi ( w _ { i } ) - \nabla \psi ( w _ { i } ) ^ { T } ( w - w _ { i } ) .
+$$
+
+By plugging the SMD update rule $\nabla \psi ( w _ { i } ) = \nabla \psi ( w _ { i - 1 } ) - \eta \nabla L _ { i } ( w _ { i - 1 } )$ into this, we can write it
+
+$$
+D _ { \psi } ( w , w _ { i } ) = \psi ( w ) - \psi ( w _ { i } ) - \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) + \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) .
+$$
+
+Using the definition of Bregman divergence for $( w , w _ { i - 1 } )$ and $( w _ { i } , w _ { i - 1 } )$ , i.e., $D _ { \psi } ( w , w _ { i - 1 } ) =$ $\psi ( w ) ~ - ~ \psi ( w _ { i - 1 } ) ~ - ~ \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w ~ - ~ w _ { i - 1 } )$ and $D _ { \psi } ( w _ { i } , w _ { i - 1 } ) = \psi ( w _ { i } ) - \psi ( w _ { i - 1 } ) - \psi$ $\nabla \psi ( w _ { i - 1 } ) ^ { T } \big ( w _ { i } - w _ { i - 1 } \big )$ , we can express this as
+
+$$
+\begin{array} { r l } & { D _ { \psi } ( w , w _ { i } ) = D _ { \psi } ( w , w _ { i - 1 } ) + \psi ( w _ { i - 1 } ) + \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } ) - \psi ( w _ { i } ) } \\ & { \qquad - \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) + \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) } \\ & { \qquad = D _ { \psi } ( w , w _ { i - 1 } ) + \psi ( w _ { i - 1 } ) - \psi ( w _ { i } ) + \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w _ { i } - w _ { i - 1 } ) } \\ & { \qquad \quad \qquad + \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) } \\ & { \qquad = D _ { \psi } ( w , w _ { i - 1 } ) - D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i } ) . } \end{array}
+$$
+
+Expanding the last term using $w - w _ { i } = ( w - w _ { i - 1 } ) - ( w _ { i } - w _ { i - 1 } )$ , and following the definition of $D _ { L _ { i } } ( . , . )$ from (16) for $( w , w _ { i - 1 } )$ and $( w _ { i } , w _ { i - 1 } )$ , we have
+
+$$
+\begin{array} { r l } & { D _ { \psi } ( w , w _ { i } ) = D _ { \psi } ( w , w _ { i - 1 } ) - D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } ) } \\ & { \qquad - \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w _ { i } - w _ { i - 1 } ) } \\ & { \qquad = D _ { \psi } ( w , w _ { i - 1 } ) - D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta \left( L _ { i } ( w ) - L _ { i } ( w _ { i - 1 } ) - D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) } \\ & { \qquad - \eta \left( L _ { i } ( w _ { i } ) - L _ { i } ( w _ { i - 1 } ) - D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) \right) } \\ & { \qquad = D _ { \psi } ( w , w _ { i - 1 } ) - D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta \left( L _ { i } ( w ) - D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) } \\ & { \qquad - \eta \left( L _ { i } ( w _ { i } ) - D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) \right) } \end{array}
+$$
+
+Defining $E _ { i } ( w _ { i } , w _ { i - 1 } ) : = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) + \eta L _ { i } ( w _ { i } )$ , we can write the above equality as
+
+$$
+D _ { \psi } ( w , w _ { i } ) = D _ { \psi } ( w , w _ { i - 1 } ) - E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta \left( L _ { i } ( w ) - D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) .
+$$
+
+Notice that for any model class with additive noise, and any loss function $L _ { i }$ that depends only on the residual (i.e. the difference between the prediction and the true label), the term $L _ { i } ( w )$ depends only on the noise term, for any “true” parameter $w$ . In other words, for all $w$ that satisfy $y _ { i } =$ $f ( x _ { i } , w ) + v _ { i }$ , we have $L _ { i } ( w ) \stackrel { \cdot } { = } l ( y _ { i } - \stackrel { \cdot } { f } ( x _ { i } , w ) ) = l ( y _ { i } - ( y _ { i } - v _ { i } ) ) = l ( v _ { i } )$ . Finally, reordering the terms leads to
+
+$$
+D _ { \psi } ( w , w _ { i } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) + E _ { i } ( w _ { i } , w _ { i - 1 } ) = D _ { \psi } ( w , w _ { i - 1 } ) + \eta l ( v _ { i } ) ,
+$$
+
+which concludes the proof.
+
+# B PROOF OF THEOREM 6
+
+Proof. We prove the theorem in two parts. First, we show that the value of the minimax is at least 1. Then we prove that the values is at most 1, and is achieved by stochastic mirror descent for small enough step size.
+
+1. Consider the maximization problem
+
+$$
+\operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) } .
+$$
+
+Clearly, the optimal solution(s) and the optimal value of this problem can, and will, be a function of $\{ w _ { i } \}$ . Similarly, we can also choose feasible points that depend on $\{ w _ { i } \}$ . Any choice of a feasible point $( \dot { w } , \{ \hat { v } _ { i } \} )$ gives a lower bound on the value of the problem. Before choosing a feasible point, let us first expand the $D _ { L _ { i } } ( w , w _ { i - 1 } )$ term in the numerator, according to its definition.
+
+$$
+D _ { L _ { i } } ( w , w _ { i - 1 } ) = l ( v _ { i } ) - l ( y _ { i } - f _ { i } ( w _ { i - 1 } ) ) + l ^ { \prime } ( y _ { i } - f _ { i } ( w _ { i - 1 } ) ) \nabla f ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } ) ,
+$$
+
+where we have used the fact that $l ( y _ { i } - f _ { i } ( w ) ) = l ( v _ { i } )$ for all consistent $w$ , in the first term.
+
+Now, we choose a feasible point as follows
+
+$$
+\hat { v } _ { i } = f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ,
+$$
+
+where $\hat { w }$ is the choice of $w$ , as will be described soon. The reason for choosing this value for the noise is that it “fools” the estimator by making its loss on the corresponding data point zero. In other words, for this choice, we have
+
+$$
+\begin{array} { r l } & { \cal { D } _ { L _ { i } } ( w , w _ { i - 1 } ) = l ( \hat { v } _ { i } ) - l ( 0 ) + l ^ { \prime } ( 0 ) \nabla f ( w _ { i - 1 } ) ^ { T } ( \hat { w } - w _ { i - 1 } ) } \\ & { \quad \quad \quad \quad = l ( \hat { v } _ { i } ) } \end{array}
+$$
+
+because $l ( 0 ) = l ^ { \prime } ( 0 ) = 0$ . It should be clear at this point that this choice makes the second terms in the numerator and the denominator equal, independent of the choice of $\hat { w }$ . What remains to do, in order to show the 1 lower-bound, is to take care of the other two terms, i.e., $D _ { \psi } ( w , w _ { T } )$ and $D _ { \psi } ( w , w _ { 0 } )$ . As we would like to make the ratio equal to one, we would like to have $D _ { \psi } ( \dot { w } , w _ { T } ) = D _ { \psi } ( w , w _ { 0 } )$ , which is equivalent to having
+
+$$
+\psi ( w ) - \psi ( w _ { T } ) - \nabla \psi ( w _ { T } ) ^ { T } ( w - w _ { T } ) = \psi ( w ) - \psi ( w _ { 0 } ) - \nabla \psi ( w _ { 0 } ) ^ { T } ( w - w _ { 0 } )
+$$
+
+which is, in turn, equivalent to
+
+$$
+\left( \nabla \psi ( \boldsymbol { w } _ { T } ) - \nabla \psi ( \boldsymbol { w } _ { 0 } ) \right) ^ { T } \boldsymbol { w } = - \psi ( \boldsymbol { w } _ { T } ) + \psi ( \boldsymbol { w } _ { 0 } ) + \nabla \psi ( \boldsymbol { w } _ { T } ) ^ { T } \boldsymbol { w } _ { T } - \nabla \psi ( \boldsymbol { w } _ { 0 } ) ^ { T } \boldsymbol { w } _ { 0 } .
+$$
+
+Since $\nabla \psi$ is an invertible function, $\nabla \psi ( w _ { T } ) - \nabla \psi ( w _ { 0 } ) \neq 0$ , if $w _ { T } \neq w _ { 0 }$ . Therefore, the above equation has a solution for $w$ , if $w _ { T } \neq w _ { 0 }$ . As a result, choosing $\hat { w }$ to be a solution to (46) makes $D _ { \psi } ( \hat { w } , w _ { T } ) = D _ { \psi } ( \hat { w } , w _ { 0 } )$ , if $w _ { T } \ne w _ { 0 }$ . For the case when $w _ { T } = w _ { 0 }$ , it is trivial that $D _ { \psi } ( \hat { w } , w _ { T } ) = D _ { \psi } ( \hat { w } , w _ { 0 } )$ for any choice of $\hat { w }$ . In this case, we only need to choose $\hat { w }$ to be different from $w _ { 0 }$ , to avoid making the ratio $\frac { 0 } { 0 }$ . Hence, we have the following choice
+
+$$
+\hat { w } = \left\{ \begin{array} { l l } { \mathrm { a ~ s o l u t i o n ~ o f ~ } ( 4 6 ) } & { \mathrm { ~ f o r ~ } w _ { T } \neq w _ { 0 } } \\ { w _ { 0 } + \delta w \mathrm { ~ f o r ~ s o m e ~ } \delta w \neq 0 } & { \mathrm { ~ f o r ~ } w _ { T } = w _ { 0 } } \end{array} \right.
+$$
+
+Choosing the feasible point $\hat { w } , \{ v _ { i } \}$ according to (47) and (45) leads to
+
+$$
+\begin{array} { r l } & { \displaystyle \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) } } \\ & { \quad \quad \quad \quad \quad \geq \displaystyle \frac { D _ { \psi } ( \hat { w } , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } l ( f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ) } { D _ { \psi } ( \hat { w } , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ) } . } \end{array}
+$$
+
+Taking the minimum of both sides with respect to $\{ w _ { i } \}$ , we have
+
+$$
+\begin{array} { r l } & { \displaystyle \underset { \{ w _ { i } \} } { \operatorname* { m i n } } \ \underset { w , \{ v _ { i } \} } { \operatorname* { m a x } } \frac { D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) } } \\ & { \qquad \ge \displaystyle \operatorname* { m i n } _ { \{ w _ { i } \} } \frac { D _ { \psi } ( \hat { w } , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } l ( f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ) } { D _ { \psi } ( \hat { w } , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ) } = 1 . } \end{array}
+$$
+
+The equality to 1 comes from the fact the that the optimal solution of the minimization either has $w _ { T } ^ { * } = w _ { 0 }$ or $w _ { T } ^ { * } \neq w _ { 0 }$ , and in both cases the ratio is equal to 1.
+
+2. Now we prove that, under the small step size condition (convexity of ${ \psi } ( w ) - \eta L _ { i } ( w )$ for all $i$ ), SMD makes the minimax value at most 1, which means that it is indeed an optimal solution. Recall from Lemma 5 that
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) ,
+$$
+
+where
+
+$$
+\begin{array} { r } { E _ { i } ( w _ { i } , w _ { i - 1 } ) = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) + \eta L _ { i } ( w _ { i } ) . } \end{array}
+$$
+
+It is easy to check that when ${ \psi } ( w ) - \eta L _ { i } ( w )$ is convex, $D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } )$ is in fact a Bregman divergence (i.e. the Bregman divergence with respect to the potential ${ \psi } ( w ) - \eta L _ { i } ( w ) )$ , and therefore it is nonnegative for any $w _ { i }$ and $w _ { i - 1 }$ . Furthermore, we know that the loss $L _ { i } ( w _ { i } )$ is also nonnegative for all $w _ { i }$ . It follows that $E _ { i } ( w _ { i } , w _ { i - 1 } )$ is nonnegative for all values of $w _ { i } , w _ { i - 1 }$ and $i$ . As a result, we have the following bound.
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) \ge D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) .
+$$
+
+Since the Bregman divergence $D _ { \psi } ( w , w _ { 0 } )$ and the loss $l ( v _ { i } )$ are nonnegative, the left-hand side expression is nonnegative, and it follows that
+
+$$
+\frac { D _ { \psi } ( w , w _ { T } ) + \eta \sum _ { i = 1 } ^ { T } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \eta \sum _ { i = 1 } ^ { T } l ( v _ { i } ) } \le 1 .
+$$
+
+In fact, this means that independent of the choice of the maximizer (i.e. for all $\{ v _ { i } \}$ and $w$ ), as long as the step size condition is met, SMD makes the ratio less than or equal to 1.
+
+Combining the results of 1 and 2 above concludes the proof.
+
+# B.1 PROOF OF THEOREM 3
+
+Proof. This result is a special case of Theorem 6, which was proven above. In this case, $\psi ( w ) = $ $\scriptstyle { \frac { 1 } { 2 } } \| w \| ^ { 2 }$ , $f ( x _ { i } , w ) = x _ { i } ^ { T } \dot { w }$ , and $\begin{array} { r } { l ( z ) = \frac { 1 } { 2 } z ^ { 2 } } \end{array}$ . Therefore, $\begin{array} { r } { D _ { \psi } ( w , \dot { w } _ { T } ) = \frac { 1 } { 2 } \| w - w _ { T } \| ^ { 2 } , D _ { \psi } ( \dot { w } , \dot { w } _ { 0 } ) = } \end{array}$ $\begin{array} { r } { \frac 1 2 \| w - w _ { 0 } \| ^ { 2 } , D _ { L _ { i } } ( w , w _ { i - 1 } ) = \frac 1 2 ( x _ { i } ^ { T } w ^ { - } { x _ { i } ^ { T } } w _ { i - 1 } ) ^ { 2 } } \end{array}$ , and $\begin{array} { r } { l ( v _ { i } ) = \frac 1 2 v _ { i } ^ { 2 } } \end{array}$ , which leads to the result. $\boxed { \begin{array} { r l } \end{array} }$
+
+# C PROOF OF PROPOSITION 9
+
+Proof. To prove convergence, we appeal again to Equation (22), i.e.
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) ,
+$$
+
+for all $w \in \mathcal W$ . We prove the two cases separately.
+
+1. The proof of case (i) is straightforward. When $l ( \cdot )$ is differentiable and convex, $L _ { i }$ is also convex, and therefore $D _ { L _ { i } } ( w , w _ { i - 1 } )$ is nonnegative. Moreover, when $\psi - \eta L _ { i }$ is convex, $E _ { i } ( w _ { i } , w _ { i - 1 } )$ is also nonnegative. Therefore, the entire summand in Eq. (52) is nonnegative, and has to go to zero for $i \infty$ . That is because as $T \to \infty$ , the sum should remain bounded, i.e., $\begin{array} { r } { \sum _ { i = 1 } ^ { \infty } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) \le D _ { \psi } ( w , w _ { 0 } ) } \end{array}$ . As a result of the non-negativity of both terms in the sum, we have both $E _ { i } ( w _ { i } , w _ { i - 1 } ) 0$ and $D _ { L _ { i } } ( w , w _ { i - 1 } ) \to 0$ as $i \to \infty$ , the latter of which implies $L _ { i } ( w _ { i - 1 } ) \to \mathrm { 0 }$ . This implies that the updates in (15) vanish and we get convergence, i.e., $w w _ { \infty }$ . Further, again because $L _ { i } ( w _ { i - 1 } ) 0$ , and 0 is the unique root of $l ( \cdot )$ , all the data point are being fit, which means $w _ { \infty } \in \mathcal { W }$ .
+
+2. To prove case (ii), note that we have
+
+$$
+\begin{array} { r l } & { { D } _ { L _ { i } } ( w , w _ { i - 1 } ) = L _ { i } ( w ) - L _ { i } ( w _ { i - 1 } ) - \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } ) } \\ & { \phantom { D } = 0 - l ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) + l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) x _ { i } ^ { T } ( w - w _ { i - 1 } ) } \\ & { \phantom { D } = - l ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) + l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) , } \end{array}
+$$
+
+and
+
+$$
+\begin{array} { r l r } { { E _ { i } ( w _ { i } , w _ { i - 1 } ) = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) - \eta D _ { L _ { i } } ( w _ { i } , w _ { i - 1 } ) + \eta L _ { i } ( w _ { i } ) } } & { ( 5 6 ) } \\ & { } & { = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta ( L _ { i } ( w _ { i - 1 } ) + \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w _ { i } - w _ { i - 1 } ) ) \qquad ( 5 7 ) } \\ & { } & { = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta ( l ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) - l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) x _ { i } ^ { T } ( w _ { i } - w _ { i - 1 } ) ) . } \end{array}
+$$
+
+It follows from (55) and (58) that the summand in Equation (52) is
+
+$$
+E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta D _ { L _ { i } } ( w , w _ { i - 1 } ) = D _ { \psi } ( w _ { i } , w _ { i - 1 } ) + \eta l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) ( y _ { i } - x _ { i } ^ { T } w _ { i } ) .
+$$
+
+The first term is a Bregman divergence, and is therefore nonnegative. In order to establish convergence, one needs to argue that the second term is nonnegative as well, so that the summand goes to zero as $i \to \infty$ . Since $l ( \cdot )$ is increasing for positive values and decreasing for negative values, it is enough to show that ${ y } _ { i } - { x } _ { i } ^ { T } { w } _ { i - 1 }$ and $\stackrel { \cdot } { y _ { i } } - x _ { i } ^ { T } w _ { i }$ have the same sign, in order to establish nonnegativity. It is not hard to see that if the distance between the two points is less than or equal to the distance of $y _ { i } - x _ { i } ^ { T } w _ { i }$ from the origin, then the signs are the same. In other words, if $| ( y _ { i } - x _ { i } ^ { T } w _ { i } ) - ( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } ) | = | x _ { i } ^ { T } ( w _ { i } - w _ { i - 1 } ) | \leq | y _ { i } - x _ { i } ^ { T } w _ { i - 1 } | .$ , then the sign are the same.
+
+Note that by the definition of $\alpha$ -strong convexity of $\psi ( \cdot )$ , we have
+
+$$
+\begin{array} { r } { ( \nabla \psi ( w _ { i } ) - \nabla \psi ( w _ { i - 1 } ) ) ^ { T } ( w _ { i } - w _ { i - 1 } ) \geq \alpha \| w _ { i } - w _ { i - 1 } \| ^ { 2 } , } \end{array}
+$$
+
+which implies
+
+$$
+- \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w _ { i } - w _ { i - 1 } ) \geq \alpha \| w _ { i } - w _ { i - 1 } \| ^ { 2 } ,
+$$
+
+by substituting from the SMD update rule. Upper-bounding the left-hand side by $\eta \| \nabla L _ { i } ( w _ { i - 1 } ) \| \| ( w _ { i } - w _ { i - 1 } ) \|$ implies
+
+$$
+\eta \| \nabla L _ { i } ( w _ { i - 1 } ) \| \geq \alpha \| w _ { i } - w _ { i - 1 } \| .
+$$
+
+This implies that we have the following bound
+
+$$
+| x _ { i } ^ { T } ( w _ { i } - w _ { i - 1 } ) | \leq \| x _ { i } \| \| w _ { i } - w _ { i - 1 } \| \leq \frac { \eta \| x _ { i } \| \| \nabla L _ { i } ( w _ { i - 1 } ) \| } { \alpha } .
+$$
+
+It follows that if $\begin{array} { r } { \eta ~ \leq ~ \frac { \alpha | y _ { i } - x _ { i } ^ { T } w _ { i - 1 } | } { \| x _ { i } \| \| \nabla L _ { i } ( w _ { i - 1 } ) \| } } \end{array}$ , for all $i$ , then the signs are the same, and the summand in Eq.(52) is indeed nonnegative. This condition can be equivalently expressed as $\begin{array} { r } { \eta \leq \frac { \alpha | y _ { i } - x _ { i } ^ { T } w _ { i - 1 } | } { \| x _ { i } \| ^ { 2 } | l ^ { \prime } \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) | } } \end{array}$ for all $i$ , or $\begin{array} { r } { \eta \leq \operatorname* { m i n } _ { i } \frac { \alpha | y _ { i } - x _ { i } ^ { T } w _ { i - 1 } | } { \| x _ { i } \| ^ { 2 } | l ^ { \prime } \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) | } } \end{array}$ , which is the condition in the statement of the proposition.
+
+Now that we have argued that the summand is nonnegative, the convergence to $w _ { \infty } \in \mathcal { W }$ is immediate. The reason is that both $D _ { \psi } ( w _ { i } , w _ { i - 1 } ) 0$ and $l ^ { \prime } ( y _ { i } - x _ { i } ^ { T } \bar { w } _ { i - 1 } ) ( y _ { i } - x _ { i } ^ { T } w _ { i } ) $ $0$ , as $i \infty$ . The first one implies convergence to a point $w _ { \infty }$ . The second one implies that either $y _ { i } - x _ { i } ^ { T } w _ { i - 1 } = 0$ or $\mathbf { \bar { \Psi } } y _ { i } - x _ { i } ^ { T } w _ { i } \bar { = } 0$ , which, in turn, implies $w _ { \infty } \in \mathcal { W }$ .
+
+# D TIME-VARYING STEP-SIZE
+
+The update rule for the stochastic mirror descent with time-varying step size is as follows.
+
+$$
+\boldsymbol { w } _ { i } = \mathop { \mathrm { a r g } \mathrm { m i n } } _ { \boldsymbol { w } } \ \eta _ { i } \boldsymbol { w } ^ { T } \nabla L _ { i } ( \boldsymbol { w } _ { i - 1 } ) + D _ { \boldsymbol { \psi } } ( \boldsymbol { w } , \boldsymbol { w } _ { i - 1 } ) ,
+$$
+
+which can be equivalently expressed as $\nabla \psi ( w _ { i } ) = \nabla \psi ( w _ { i - 1 } ) - \eta _ { i } \nabla L _ { i } ( w _ { i - 1 } )$ , for all $i$ . The main results in this case are as follows.
+
+Lemma 11. For any (nonlinear) model $f ( \cdot , \cdot )$ , any differentiable loss $l ( \cdot )$ , any parameter $w$ and noise values $\{ v _ { i } \}$ that satisfy $y _ { i } = f ( x _ { i } , w ) + v _ { i }$ for $i = 1 , \ldots , n$ , any initialization $w _ { 0 }$ , any step size sequence $\{ \eta _ { i } \}$ , and any number of steps $T \geq 1$ , the following relation holds for the SMD iterates $\{ w _ { i } \}$ given in Eq. (64)
+
+$$
+D _ { \psi } ( w , w _ { 0 } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } l ( v _ { i } ) = D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \left( E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) \right) ,
+$$
+
+Proof. The proof is straightforward by summing the following equation for all $i = 1 , \dots , T$
+
+$$
+D _ { \psi } ( w , w _ { i - 1 } ) + \eta _ { i } l ( v _ { i } ) = D _ { \psi } ( w , w _ { i } ) + E _ { i } ( w _ { i } , w _ { i - 1 } ) + \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) ,
+$$
+
+which can be easily shown in the same way as in the proof of Lemma 4 in Appendix A.
+
+Theorem 12. Consider any general model $f ( \cdot , \cdot )$ , and any differentiable loss function $l ( \cdot )$ with property $l ( 0 ) = l ^ { \prime } ( 0 ) = 0$ . For sufficiently small step size, i.e., for any sequence $\{ \eta _ { i } \}$ for which ${ \psi } ( w ) - \eta _ { i } L _ { i } ( w )$ is convex for all $i$ , the SMD iterates $\{ w _ { i } \}$ given by Eq. (64) are the optimal solution to the following minimization problem
+
+$$
+\operatorname* { m i n } _ { \{ w _ { i } \} } \operatorname* { m a x } _ { w , \{ v _ { i } \} } \frac { D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } l ( v _ { i } ) } .
+$$
+
+Furthermore, the optimal value (achieved by SMD) is 1.
+
+Proof. The proof is similar to that of Theorem 6, as presented in Appendix B. The argument for the upper-bound of 1 is exactly the same. For the second part of the proof, we use the previous Lemma. It follows from the convexity of ${ \psi } ( w ) - \eta _ { i } L _ { i } ( w )$ that $E _ { i } ( w _ { i } , w _ { i - 1 } ) \ge 0$ , and as a result we have
+
+$$
+\frac { D _ { \psi } ( w , w _ { T } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } D _ { L _ { i } } ( w , w _ { i - 1 } ) } { D _ { \psi } ( w , w _ { 0 } ) + \sum _ { i = 1 } ^ { T } \eta _ { i } l ( v _ { i } ) } \le 1
+$$
+
+for SMD updates, which concludes the proof.
+
+The convergence and implicit regularization results hold similarly, and can be formally stated as follows.
+
+Proposition 13. Consider the following two cases.
+
+(i) $l ( \cdot )$ is differentiable and convex and has a unique root at $O _ { ; }$ , $\psi ( \cdot )$ is strictly convex, and the positive sequence $\{ \eta _ { i } \}$ is such that $\psi - \eta _ { i } L _ { i }$ is convex for all i.
+(ii) $l ( \cdot )$ is differentiable and quasi-convex and has zero derivative only at $O$ , $\psi ( \cdot )$ is $\alpha$ -strongly convex, and 0 < ηi ≤ i i i−1 kxik2|l0(yi−xTi wi−1)| for all $i$ .
+
+If either (i) or (ii) holds, then for any initialization $w _ { 0 }$ , the SMD iterates given in Eq. (64) converge to
+
+$$
+\boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
+$$
+
+Proof. The proof is similar to that of Proposition 9, as provided in Appendix C.
\ No newline at end of file
diff --git a/md/train/HJgBA2VYwH/HJgBA2VYwH.md b/md/train/HJgBA2VYwH/HJgBA2VYwH.md
new file mode 100644
index 0000000000000000000000000000000000000000..cbd12f30abcaa952a6f4d302c49fc99e8bc3eb01
--- /dev/null
+++ b/md/train/HJgBA2VYwH/HJgBA2VYwH.md
@@ -0,0 +1,426 @@
+# FSPOOL: LEARNING SET REPRESENTATIONS WITH FEATUREWISE SORT POOLING
+
+Yan Zhang
+University of Southampton
+Southampton, UK
+yz5n12@ecs.soton.ac.uk Jonathon Hare
+University of Southampton Southampton, UK
+jsh2@ecs.soton.ac.uk
+
+Adam Prügel-Bennett University of Southampton Southampton, UK apb@ecs.soton.ac.uk
+
+# ABSTRACT
+
+Traditional set prediction models can struggle with simple datasets due to an issue we call the responsibility problem. We introduce a pooling method for sets of feature vectors based on sorting features across elements of the set. This can be used to construct a permutation-equivariant auto-encoder that avoids this responsibility problem. On a toy dataset of polygons and a set version of MNIST, we show that such an auto-encoder produces considerably better reconstructions and representations. Replacing the pooling function in existing set encoders with FSPool improves accuracy and convergence speed on a variety of datasets.
+
+# 1 INTRODUCTION
+
+Consider the following task: you have a dataset wherein each datapoint is a set of 2-d points that form the vertices of a regular polygon, and the goal is to learn an auto-encoder on this dataset. The only variable is the rotation of this polygon around the origin, with the number of points, size, and centre of it fixed. Because the inputs and outputs are sets, this problem has some unique challenges.
+
+Encoder: This turns the set of points into a latent space. The order of the elements in the set is irrelevant, so the feature vector the encoder produces should be invariant to permutations of the elements in the set. While there has been recent progress on learning such functions (Zaheer et al., 2017; Qi et al., 2017), they compress a set of any size down to a single feature vector in one step. This can be a significant bottleneck in what these functions can represent efficiently, particularly when relations between elements of the set need to be modeled (Murphy et al., 2019; Zhang et al., 2019b).
+
+Decoder: This turns the latent space back into a set. The elements in the target set have an arbitrary order, so a standard reconstruction loss cannot be used naïvely – the decoder would have to somehow output the elements in the same arbitrary order. Methods like those in Achlioptas et al. (2018) therefore use an assignment mechanism to match up elements (section 2), after which a usual reconstruction loss can be computed. Surprisingly, their model is still unable to solve the polygon reconstruction task with close-to-zero reconstruction error, despite the apparent simplicity of the dataset.
+
+In this paper, we introduce a set pooling method for neural networks that addresses both the encoding bottleneck issue and the decoding failure issue. We make the following contributions:
+
+1. We identify the responsibility problem (section 3). This is a fundamental issue with existing set prediction models that has not been considered in the literature before, explaining why these models struggle to model even the simple polygon dataset. 2. We introduce FSPOOL: a differentiable, sorting-based pooling method for variable-size sets (section 4). By using our pooling in the encoder of a set auto-encoder and inverting the sorting in the decoder, we can train it with the usual MSE loss for reconstruction without the need for an assignment-based loss. This avoids the responsibility problem.
+
+3. We show that our auto-encoder can learn polygon reconstructions with close-to-zero error, which is not possible with existing set auto-encoders (subsection 6.1). This benefit transfers over to a set version of MNIST, where the quality of reconstruction and learned representation is improved (subsection 6.2). In further classification experiments on CLEVR (subsection 6.3) and several graph classification datasets (subsection 6.4), using FSPool in a set encoder improves over many non-trivial baselines. Lastly, we show that combining FSPool with Relation Networks significantly improves over standard Relation Networks in a model that heavily relies on the quality of the representation (subsection 6.5).
+
+# 2 BACKGROUND
+
+The problem with predicting sets is that the output order of the elements is arbitrary, so computing an elementwise mean squared error does not make sense; there is no guarantee that the elements in the target set happen to be in the same order as they were generated. The existing solution around this problem is an assignment-based loss, which assigns each predicted element to its “closest” neighbour in the target set first, after which a traditional pairwise loss can be computed.
+
+We have a predicted set $\hat { Y }$ with feature vectors as elements and a ground-truth set $\mathbf { Y }$ , and we want to measure how different the two sets are. These sets can be represented as matrices with the feature vectors placed in the columns in some arbitrary order, so $\hat { \pmb { Y } } = [ \pmb { \hat { y } } ^ { ( 1 ) } , \dots , \pmb { \hat { y } } ^ { ( n ) } ]$ and $\pmb { Y } = [ \pmb { y } ^ { ( 1 ) } , \dots , \pmb { y } ^ { ( n ) } ]$ with $n$ as the set size (columns) and $d$ as the number of features per element (rows). In this work, we assume that these two sets have the same size. The usual way to produce $\hat { Y }$ is with a multi-layer perceptron (MLP) that has $d \times n$ outputs.
+
+Linear assignment One way to do this assignment is to find a linear assignment that minimises the total loss, which can be solved with the Hungarian algorithm in $O ( n ^ { 3 } )$ time. With $\Pi$ as the space of all $n$ -length permutations:
+
+$$
+\mathcal { L } _ { H } ( \hat { \pmb { Y } } , \pmb { Y } ) = \operatorname* { m i n } _ { \pi \in \Pi } \sum _ { i } ^ { n } | | \pmb { \hat { y } } ^ { ( i ) } - \pmb { y } ^ { ( \pi ( i ) ) } | | ^ { 2 }
+$$
+
+Chamfer loss Alternatively, we can assign each element directly to the closest element in the target set. To ensure that all points in the target set are covered, a term is added to the loss wherein each element in the target set is also assigned to the closest element in the predicted set. This has $O ( n ^ { 2 } )$ time complexity and can be run efficiently on GPUs.
+
+$$
+\mathcal { L } _ { C } ( \hat { \boldsymbol { Y } } , \boldsymbol { Y } ) = \sum _ { i } \operatorname* { m i n } _ { j } | | \hat { \pmb { y } } ^ { ( i ) } - { \pmb { y } } ^ { ( j ) } | | ^ { 2 } + \sum _ { j } \operatorname* { m i n } _ { i } | | \hat { \pmb { y } } ^ { ( i ) } - { \pmb { y } } ^ { ( j ) } | | ^ { 2 }
+$$
+
+Both of these losses are examples of permutation-invariant functions: the loss is the same regardless of how the columns of $\mathbf { Y }$ and $\hat { Y }$ are permuted.
+
+# 3 RESPONSIBILITY PROBLEM
+
+It turns out that standard neural networks struggle with modeling symmetries that arise because there are $n !$ different list representations of the same set, which we highlight here with an example. Suppose we want to train an auto-encoder on our polygon dataset and have a square (so a set of 4 points with the $\mathbf { X }$ -y coordinates as features) with some arbitrary initial rotation (see Figure 1). Each pair in the 8 outputs of the MLP decoder is responsible for producing one of the points in this square. We mark each such pair with a different colour in the figure.
+
+If we rotate the square (top left in figure) by 90 degrees (top right in figure), we simply permute the elements within the set. They are the same set, so they also encode to the same latent representation and decode to the same list representation. This means that each output is still responsible for producing the point at the same position after the rotation, i.e. the dark red output is still responsible for the top left point, the light red output is responsible for the top right point, etc. However, this also means that at some point during that 90 degree rotation (bottom path in figure), there must exist a discontinuous jump (red arrow in figure) in how the outputs are assigned. We know that the 90 degree rotation must start and end with the top left point being produced by the dark red output. Thus, we know that there is a rotation where all the outputs must simultaneously change which point they are responsible for, so that completing the rotation results in the top left point being produced by the dark red output. Even though we change the set continuously, the list representation (MLP or RNN outputs) must change discontinuously.
+
+
+Figure 1: Discontinuity (red arrow) when rotating the set of points. The coloured points denote which output of the network is responsible for which point. In the top path, the set rotated by $9 0 ^ { \circ }$ is the same set (exactly the same shape before and after rotation) and encodes to the same feature vector, so the output responsibility (colouring) must be the same too. In this example, after $3 0 ^ { \circ }$ and a further small clockwise rotation by $\epsilon$ , the point that each output pair is responsible for has to suddenly change.
+
+This is a challenge for neural networks to learn, since they can typically only model functions without discontinuous jumps. As we increase the number of vertices in the polygon (number of set elements), it must learn an increasing frequency of situations where all the outputs must discontinuously change at once, which becomes very difficult to model. Our experiment in subsection 6.1 confirms this.
+
+This example highlights a more general issue: whenever there are at least two set elements that can be smoothly interchanged, these discontinuities arise. We show this more formally in Appendix A. For example, the set of bounding boxes in object detection can be interchanged in much the same way as the points of our square here. An MLP or RNN that tries to generate these (like in Rezatofighi et al. (2018); Stewart & Andriluka (2016)) must handle which of its outputs is responsible for what element in a discontinuous way. Note that traditional object detectors like Faster R-CNN do not have this responsibility problem, because they do not treat object detection as a proper set prediction task with their anchor-based approach. When the set elements come from a finite domain (often a set of labels) and not $\mathbb { R } ^ { d }$ , it does not make sense to interpolate set elements. Thus, the responsibility problem does not apply to methods for such problems, for example Welleck et al. (2018); Rezatofighi. et al. (2017).
+
+# 4 FEATUREWISE SORT POOLING
+
+The main idea behind our pooling method is simple: sorting each feature across the elements of the set and performing a weighted sum. The numerical sorting ensures the property of permutationinvariance. The difficulty lies in how to determine the weights for the weighted sum in a way that works for variable-sized sets.
+
+A key insight for auto-encoding is that we can store the permutation that the sorting applies in the encoder and apply the inverse of that permutation in the decoder. This allows the model to restore the arbitrary order of the set element so that it no longer needs an assignment-based loss for training. This avoids the problem in Figure 1, because rotating the square by $9 0 ^ { \circ }$ also permutes the outputs of the network accordingly. Thus, there is no longer a discontinuity in the outputs during this rotation. In other words, we make the auto-encoder permutation-equivariant: permuting the input set also permutes the neural network’s output in the same way.
+
+We describe the model for the simplest case of encoding fixed-size sets in subsection 4.1, extend it to variable-sized sets in subsection 4.2, then discuss how to use this in an auto-encoder in subsection 4.3.
+
+
+Figure 2: Overview of our FSPOOL model for variable-sized sets. In this example, the weights define piecewise linear functions with two pieces. The four dots on each line correspond to the positions where $f$ is evaluated for a set of size four.
+
+# 4.1 FIXED-SIZE SETS
+
+We are given a set of $n$ feature vectors $\pmb { X } = [ \pmb { x } ^ { ( 1 ) } , \ldots , \pmb { x } ^ { ( n ) } ]$ where each $\mathbf { \boldsymbol { x } } ^ { ( i ) }$ is a column vector of dimension $d$ placed in some arbitrary order in the columns of $\pmb { X } \in \mathbb { R } ^ { d \times n }$ . From this, the goal is to produce a single feature vector in a way that is invariant to permutation of the columns in the matrix.
+
+We first sort each of the $d$ features across the elements of the set by numerically sorting within the rows of $\boldsymbol { X }$ to obtain the matrix of sorted features $\vec { X }$ :
+
+$$
+\vec { X } _ { i , j } = \mathrm { S o R T } ( X _ { i , : } ) _ { j }
+$$
+
+where $X _ { i , }$ ,: is the ith row of $\boldsymbol { X }$ and $\mathrm { S O R T } ( \cdot )$ sorts a vector in descending order. While this may appear strange since the columns of $\vec { X }$ no longer correspond to individual elements of the set, there are good reasons for this. A transformation (such as with an MLP) prior to the pooling can ensure that the features being sorted are mostly independent so that little information is lost by treating the features independently. Also, if we were to sort whole elements by one feature, there would be discontinuities whenever two elements swap order. This problem is avoided by our featurewise sorting.
+
+Efficient parallel implementations of SORT are available in Deep Learning frameworks such as PyTorch, which uses a bitonic sort $\ O ( \log ^ { 2 } n )$ parallel time, $O ( n \log ^ { 2 } n )$ comparisons). While the permutation that the sorting applies is not differentiable, gradients can still be propagated pathwise according to this permutation in a similar way as for max pooling.
+
+Then, we apply a learnable weight matrix $W \in \mathbb { R } ^ { d \times n }$ to $\vec { X }$ by elementwise multiplying and summing over the columns (row-wise dot products).
+
+$$
+y _ { i } = \sum _ { j } ^ { n } W _ { i , j } { \vec { X } } _ { i , j }
+$$
+
+$\boldsymbol { y } \in \mathbb { R } ^ { d }$ is the final pooled representation of $\vec { X }$ . The weight vector allows different weightings of different ranks and is similar in spirit to the parametric version of the gather step in Gather-Excite (Hu et al., 2018). This is a generalisation of both max and sum pooling, since max pooling can be obtained with the weight vector $[ 1 , 0 , \ldots , 0 ]$ and sum pooling can be obtained with the 1 vector. Thus, it is also a maximally powerful pooling method for multi-sets (Xu et al., 2019) while being potentially more flexible (Murphy et al., 2019) in what it can represent.
+
+# 4.2 VARIABLE-SIZE SETS
+
+When the size $n$ of sets can vary, our previous weight matrix can no longer have a fixed number of columns. To deal with this, we define a continuous version of the weight vector in each row: we use a fixed number of weights to parametrise a piecewise linear function $f : [ 0 , 1 ] \to \mathbb { R }$ , also known as calibrator function (Jaderberg et al., 2015). For a set of size three, this function would be evaluated at 0, 0.5, and 1 to determine the three weights for the weighted sum. For a set of size four, it would be evaluated at 0, 1/3, 2/3, and 1. This decouples the number of columns in the weight matrix from the set size that it processes, which allows it to be used for variable-sized sets.
+
+To parametrise a piecewise linear function $f$ , we have a weight vector $\bar { \pmb w } \in \mathbb { R } ^ { k }$ where $k - 1$ is the number of pieces defined by the $k$ points. With the ratio $r \in [ 0 , 1 ]$ ,
+
+$$
+f ( r , \bar { w } ) = \sum _ { i = 1 } ^ { k } \operatorname* { m a x } ( 0 , 1 - | r ( k - 1 ) - ( i - 1 ) | ) \bar { w } _ { i }
+$$
+
+The $\operatorname* { m a x } ( { \mathord { \cdot } } )$ term selects the two nearest points to $r$ and linearly interpolates them. For example, if $k = 3$ , choosing $r \in [ 0 , 0 . 5 ]$ interpolates between the first two points in the weight vector with $( 1 - 2 r ) w _ { 1 } + 2 r w _ { 2 }$ .
+
+We have a different $\bar { \pmb w }$ for each of the $d$ features and place them in the rows of a weight matrix $\bar { \boldsymbol { W } } \in \mathbb { R } ^ { d \times k }$ , which no longer depends on $n$ . Using these rows with $f$ to determine the weights:
+
+$$
+y _ { i } = \sum _ { j = 1 } ^ { n } f ( \frac { j - 1 } { n - 1 } , W _ { i , : } ) \vec { X } _ { i , j }
+$$
+
+$\textbf { { y } }$ is now the pooled representation with a potentially varying set size $n$ as input. When $n = k$ , this reduces back to Equation 4. For most experiments, we simply set $k = 2 0$ without tuning it.
+
+# 4.3 AUTO-ENCODER
+
+To create an auto-encoder, we need a decoder that turns the latent space back into a set. Analogously to image auto-encoders, we want this decoder to roughly perform the operations of the encoder in reverse. The FSPool in the encoder has two parts: sorting the features, and pooling the features. Thus, the FSUnpool version should “unpool” the features, and “unsort” the features. For the former, we define an unpooling version of Equation 6 that distributes information from one feature vector to a variable-size list of feature vectors. For the latter, the idea is to store the permutation of the sorting from the encoder and use the inverse of it in the decoder to unsort it. This allows the auto-encoder to restore the original ordering of set elements, which makes it permutation-equivariant.
+
+With $\pmb { y } ^ { \prime } \in \mathbb { R } ^ { d }$ as the vector to be unpooled, we define the unpooling similarly to Equation 6 as
+
+$$
+\vec { X } _ { i , j } ^ { \prime } = f ( \frac { j - 1 } { n - 1 } , W _ { i , : } ^ { \prime } ) y _ { i } ^ { \prime }
+$$
+
+In the non-autoencoder setting, the lack of differentiability of the permutation is not a problem due to the pathwise differentiability. However, in the auto-encoder setting we make use of the permutation in the decoder. While gradients can still be propagated through it, it introduces discontinuities whenever the sorting order in the encoder for a set changes, which we empirically observed to be a problem. To avoid this issue, we need the permutation that the sort produces to be differentiable. To achieve this, we use the recently proposed sorting networks (Grover et al., 2019), which is a continuous relaxation of numerical sorting. This gives us a differentiable approximation of a permutation matrix $P _ { i } \in [ 0 , 1 ] ^ { n \times n } , i \in \{ 1 , \dots , d \}$ for each of the $d$ features, which we can use in the decoder while still keeping the model fully differentiable. It comes with the trade-off of increased computation costs with ${ \bar { O ( } } n ^ { 2 } )$ time and space complexity, so we only use the relaxed sorting in the auto-encoder setting. It is possible to decay the temperature of the relaxed sort throughout training to 0, which allows the more efficient traditional sorting algorithm to be used at inference time.
+
+Lastly, we can use the inverse of the permutation from the encoder to restore the original order.
+
+$$
+X ^ { \prime } { } _ { i , j } = ( \vec { X } _ { i , : } ^ { \prime } \pmb { P } _ { i } ^ { T } ) _ { j }
+$$
+
+where ${ \cal P } _ { i } ^ { T }$ permutes the elements of the ith row in ${ \vec { X } } ^ { \prime }$
+
+Because the permutation is stored and used in the decoder, this makes our auto-encoder similar to a U-net architecture (Long et al., 2015) since it is possible for the network to skip the small latent space. Typically we find that this only starts to become a problem when $d$ is too big, in which case it is possible to only use a subset of the $P _ { i }$ in the decoder to counteract this.
+
+# 5 RELATED WORK
+
+We are proposing a differentiable function that maps a set of feature vectors to a single feature vector. This has been studied in many works such as Deep Sets (Zaheer et al., 2017) and PointNet (Qi et al., 2017), with universal approximation theorems being proven. In our notation, the Deep Sets model is $g ( \sum _ { j } h ( \pmb { X } _ { : , j } ) )$ where $h : \mathbb { R } ^ { d } \mathbb { R } ^ { p }$ and $g : \mathbb { R } ^ { p } \mathbb { R } ^ { q }$ . Since this is $O ( n )$ in the set size $n$ , it is clear that while it may be able to approximate any set function, problems that depend on higher-order interactions between different elements of the set will be difficult to model aside from pure memorisation. This explains the success of relation networks (RN), which simply perform this sum over all pairs of elements, and has been extended to higher orders by Murphy et al. (2019). Our work proposes an alternative operator to the sum that is intended to allow some relations between elements to be modeled through the sorting, while not incurring as large of a computational cost as the $O ( n ^ { 2 } )$ complexity of RNs.
+
+Sorting-based set functions The use of sorting has often been considered in the set learning literature due to its natural way of ensuring permutation-invariance. The typical approach is to sort elements of the set as units rather than our approach of sorting each feature individually.
+
+For example, the similarly-named SortPooling (Zhang et al., 2018) sorts the elements based on one feature of each element. However, this introduces discontinuities into the optimisation whenever two elements swap positions after the sort. For variable-sized sets, they simply truncate (which again adds discontinuities) or pad the sorted list to a fixed length and process this with a CNN, treating the sorted vectors as a sequence. Similarly, Cangea et al. (2018) and Gao & Ji (2019) truncate to a fixed-size set by computing a score for each element and keeping elements with the top- $\mathbf { \nabla } \cdot \mathbf { k }$ scores. In contrast, our pooling handles variable set sizes without discontinuities through the featurewise sort and continuous weight space. Gao & Ji (2019) propose a graph auto-encoder where the decoder use the “inverse” of what the top- $\mathbf { \nabla } \cdot \mathbf { k }$ operator does in the encoder, similar to our approach. Instead of numerically sorting, Mena et al. (2018) and Zhang et al. (2019b) learn an ordering of set elements instead.
+
+Outside of the set learning literature, rank-based pooling in a convolutional neural network has been used in Shi et al. (2016), where the rank is turned into a weight. Sorting within a single feature vector has been used for modeling more powerful functions under a Lipschitz constraint for Wasserstein GANs (Anil et al., 2018) and improved robustness to adversarial examples (Cisse et al., 2017).
+
+Set prediction Assignment-based losses combined with an MLP or similar are a popular choice for various auto-encoding and generative tasks on point clouds (Fan et al., 2017; Yang et al., 2018; Achlioptas et al., 2018). An interesting alternative approach is to perform the set generation sequentially (Stewart & Andriluka, 2016; Johnson, 2017; You et al., 2018). The difficulty lies in how to turn the set into one or multiple sequences, which these papers try to solve in different ways. Since the initial release of this paper, Zhang et al. (2019a) developed a set prediction method which uses FSPool as a core component and motivate their work by our observations about the responsibility problem. Interestingly, their model uses the gradient of the set encoder, which involves computing the gradient of FSPool; this is closely related to the FSUnpool we proposed.
+
+# 6 EXPERIMENTS
+
+We start with two auto-encoder experiments, then move to tasks where we replace the pooling in an established model with FSPool. Full results can be found in the appendices, experimental details can be found in Appendix H, and we provide our code for reproducibility at [redacted].
+
+# 6.1 ROTATING POLYGONS
+
+We start with our simple dataset of auto-encoding regular polygons (section 3), with each point in a set corresponding to the x-y coordinate of a vertex in that polygon. This dataset is designed to explicitly test whether the responsibility problem occurs in practice. We keep the set size the same within a training run and only vary the rotation. We try this with set sizes of increasing powers of 2.
+
+Model The encoder contains a 2-layer MLP applied to each set element, FSPool, and a 2-layer MLP to produce the latent space. The decoder contains a 2-layer MLP, FSUnpool, and a 2-layer MLP applied on each set element. We train this model to minimise the mean squared error. As baseline, we use a model where the decoder has been replaced with an MLP and train it with either the linear assignment or Chamfer loss (equivalent to AE-EMD and AE-CD models in Achlioptas et al. (2018)).
+
+
+Figure 3: MNIST as point sets with different amounts of Gaussian noise $( \sigma )$ and their reconstructions. The baseline uses sum pooling and an MLP decoder, which had the best quantitative results among the baselines. We used the best network for our model $( 0 . 2 8 \times 1 0 ^ { 4 }$ average Chamfer loss) and the best network for the baseline model $\mathrm { 0 . 2 0 \times 1 0 ^ { 4 } }$ average Chamfer loss). The examples are not cherry-picked.
+
+Results First, we verified that if the latent space is always zeroed out, the model with FSPool is unable to train, suggesting that the latent space is being used and is necessary. For our training runs with set sizes up to 128, our auto-encoder is able to reconstruct the point set close to perfectly (see Appendix B). Meanwhile, the baseline converges significantly slower with high reconstruction error when the number of points is 8 or fewer and outputs the same set irrespective of input above that, regardless of loss function. Even when significantly increasing the latent size, dimensionality of layers, tweaking the learning rate, and replacing FSPool in the encoder with sum, mean, or max, the baseline trained with the linear assignment or Chamfer loss fails completely at 16 points. We verified that for 4 points, the baseline shows the discontinuous jump behaviour in the outputs as we predict in Figure 1. This experiment highlights the difficulty of learning this simple dataset with traditional approaches due to the responsibility problem, while our model is able to fit this dataset with ease.
+
+# 6.2 NOISY MNIST SETS
+
+Next, we turn to the harder task of auto-encoding MNIST images – turned into sets of points – using a denoising auto-encoder. Each pixel that is above the mean pixel level is considered to be part of the set with its x-y coordinates as feature, scaled to be within the range of [0, 1]. The set size varies between examples and is 133 on average. We add Gaussian noise to the points in the set and use the set without noise as training target for the denoising auto-encoder.
+
+Model We use exactly the same architecture as on the polygon dataset. As baseline models, we combine sum/mean/max pooling encoders with MLP/LSTM decoders and train with the Chamfer loss. This closely corresponds to the AE-CD approach (Achlioptas et al., 2018) with the MLP decoder and the model by Stewart & Andriluka (2016) with the LSTM decoder. We tried the approach by Zhang et al. (2019a), but it performs much worse than the other baselines, likely because it requires a bigger encoder (our encoder has ${ \sim } 3 0 0 0$ parameters, their encoder has ${ \sim } 8 5 0 0 0$ parameters).
+
+Results We show example outputs in Figure 3 and the full results in Appendix C. We focus on comparing our FSPool-FSUnpool model against the best baseline, which uses the sum pooling encoder and MLP decoder. In general, our model can reconstruct the digits much better than the baseline, which tends to predict too few points even though it always has 342 (the maximum set size) times 2 outputs available. Occasionally, the baseline also makes big errors such as turning 5s into 8s (first $\sigma = 0 . 0 1$ example), which we have not observed with our model.
+
+Table 1: MNIST classification accuracy over 6 runs (different pre-trained networks between runs): mean $\pm$ stdev for $\sigma = 0 . 0 5$ . Frozen: training with frozen pre-trained auto-encoder weights. Unfrozen: unfrozen auto-encoder weights (fine-tuning). Random init: auto-encoder weights not used.
+
+
1 epoch of training
10 epochs of training
Frozen
Unfrozen
Random init
Frozen
Unfrozen
Random init
FSPOOL
82.2%±2.1
86.9%±1.3
84.7%±1.9
84.3%± 1.8
91.5%±0.5
91.9%±0.5
SUM
76.6%±1.3
68.7%±3.5
30.3%±5.6
79.0%±1.0
77.7%±2.3
72.7%±3.4
MEAN
25.7%±3.6
32.2%±10.5
30.1%±1.6
36.8%±5.0
75.0%±2.7
73.0%±1.7
MAX
73.6%±1.3
73.0%±3.5
56.1%±5.6
77.3%±0.9
80.4%±1.8
76.9%±1.3
+
+# 6.2.1 CLASSIFICATION
+
+Instead of auto-encoding MNIST sets, we can also classify them. We use the same dataset and replace the set decoder in our model and the baseline with a 2-layer MLP classifier. We consider three variants: using the trained auto-encoder weights for the encoder and freezing them, not freezing them (finetuning), and training all weights from random initialisation. This tests how informative the learned representations of the pre-trained auto-encoder and the encoder are.
+
+Results We show our results for $\sigma = 0 . 0 5$ in Table 1. Results for $\sigma = 0 . 0 0$ and 100 epochs are shown in Appendix D. Even though our model can store information in the permutation that skips the latent space, our latent space contains more information to correctly classify a set, even when the weights are fixed. Our model with fixed encoder weights already performs better after 1 epoch of training than the baseline models with unfrozen weights after 10 epochs of training. This shows the benefit of the FSPool-FSUnpool auto-encoder to the representation. When allowing the encoder weights to change (Unfrozen and Random init), our results again improve significantly over the baselines. Interestingly, switching the relaxed sort to the unrelaxed sort in our model when using the fixed auto-encoder weights does not hurt accuracy. Training the FSPool model takes 45 seconds per epoch on a GTX 1080 GPU, only slightly more than the baselines with 37 seconds per epoch.
+
+# 6.3 CLEVR
+
+CLEVR (Johnson, 2017) is a visual question answering dataset where the task is to classify an answer to a question about an image. The images show scenes of 3D objects with different attributes, and the task is to answer reasoning questions such as “what size is the sphere that is left of the green thing”. Since we are interested in sets, we use this dataset with the ground-truth state description – the set of objects (maximum size 10) and their attributes – as input instead of an image of the rendered scene.
+
+Model For this dataset, we compare against relation networks (RN) (Santoro et al., 2017) – explicitly modeling all pairwise relations – Janossy pooling (Murphy et al., 2019), and regular pooling functions. While the original RN paper reports a result of $9 6 . 4 \%$ for this dataset, we use a tuned implementation by Messina et al. (2018) with $2 . 6 \%$ better accuracy. For our model, we modify this to not operate on pairwise relations and replace the existing sum pooling with FSPool. We use the same hyperparameters for our model as the strong RN baseline without further tuning them.
+
+Results Over 10 runs, Table 2 shows that our FSPool model reaches the best accuracy and also reaches the listed accuracy milestones in fewer epochs than all baselines. The difference in accuracy is statistically significant (two-tailed t-tests against sum, mean, RN, all with $p \approx 0 . 0 1$ ). Also, FSPool reaches $9 9 \%$ accuracy in $5 . 3 \mathrm { h }$ , while the fastest baseline, mean pooling, reaches the same accuracy in $6 . 2 \mathrm { ~ h ~ }$ . Surprisingly, RNs do not provide any benefit here, despite the hyperparameters being explicitly tuned for the RN model. We show some of the functions $f ( \cdot , \bar { W } )$ that FSPool has learned in Appendix E. These confirm that FSPool uses more complex functions than just sums or maximums, which allow it to capture more information about the set than other pooling functions.
+
+Table 2: CLEVR results over 10 runs: mean $\pm$ stdev of accuracy after 350 epochs, epochs to reach an accuracy milestone, and wall time required with a 1080 Ti GPU. \* averages over only 8 runs because 2 runs did not reach $9 9 \%$ . MAC (Hudson & Manning, 2018) is a model specifically designed for CLEVR and the state-of-the-art for image inputs and without program supervision.
+
+
Epochs to reach accuracy
Time for 350 epochs
Model
Accuracy
98.00%
98.50%
99.00%
FSPOOL
99.27%±0.18
141± 5
166±16
209±33
8.8h
RN
98.98%±0.25
144±6
189±29
*268±46
15.5 h
JANOSSY
97.00%±0.54
1
1
1
11.5 h
SUM
99.05%±0.17
146±13
191±40
281±56
8.0h
MEAN
98.96%±0.27
169±6
225±31
273±33
8.0h
MAX
96.99%±0.26
1
1
1
8.0h
MAC
99.0 %
1
1
1
1
+
+# 6.4 GRAPH CLASSIFICATION
+
+We perform a large number of experiments on various graph classification datasets from the TU repository (Kersting et al., 2016): 4 graph datasets from bioinformatics (for example with the graph encoding the structure of a molecule) and 5 datasets from social networks (for example with the graph encoding connectivity between people who worked with each other). The task is to classify the whole graph into one of multiple classes such as positive or negative drug response.
+
+Model We use the state-of-the-art graph neural network GIN (Xu et al., 2019) as baseline. This involves a series of graph convolutions (which includes aggregation of features from each node’s set of neighbours into the node), a readout (which aggregates the set of all nodes into one feature vector), and a classification with an MLP. We replace the usual sum or mean pooling readout with FSPool $k = 5$ for our model. We repeat 10-fold cross-validation on each dataset 10 times and use the same hyperparameter ranges as $\mathrm { X u }$ et al. (2019) for our model and the GIN baseline.
+
+Results We show the results in Appendix F. On 6 out of 9 datasets, FSPool achieves better test accuracy. On a different 6 datasets, it converges to the best validation accuracy faster. A Wilcoxon signed-rank test shows that the difference in accuracy to the standard GIN has $p \approx 0 . 0 7$ ( $W = 7 ,$ and the difference in convergence speed has $p \approx 0 . 1 1$ $W = 9$ ). Keep in mind that just because the results have $p > 0 . 0 5$ , it does not mean that the results are invalid.
+
+# 6.5 CLEVR WITH DEEP SET PREDICTION NETWORKS
+
+Zhang et al. (2019a) build on the ideas in this paper to develop a model that can predict sets from an image. Their model requires from a set encoder that the more similar two set inputs are, the more similar their representations should be. This is harder than classification, because different inputs (of the same class) should no longer map to the same representation. In this experiment, we quantify the benefit of the $\mathrm { R N } + \mathrm { F S P o o l }$ set encoder they used. We use their experimental set-up and replace FSPool with sum (this gives the normal RN model) or max pooling. We train this on CLEVR to predict the set of bounding boxes or the state description (this was the input in subsection 6.3).
+
+Results Appendix G shows that for both bounding box and state prediction models, the RN encoder using FSPool is much better than sum or max. This shows that it is possible to improve on standard Relation Networks simply by replacing the sum with FSPool when the task is challenging enough.
+
+# 7 DISCUSSION
+
+In this paper, we identified the responsibility problem with existing approaches for predicting sets and introduced FSPool, which provides a way around this issue in auto-encoders. In experiments on two datasets of point clouds, we showed that this results in much better reconstructions. We believe that this is an important step towards set prediction tasks with more complex set elements. However, because our decoder uses information from the encoder, it is not easily possible to turn it into a generative set model, which is the main limitation of our approach. Still, we find that using the auto-encoder to obtain better representations and pre-trained weights can be beneficial by itself. Our insights about the responsibility problem have already been successfully used to create a model without the limitations of our auto-encoder (Zhang et al., 2019a).
+
+In classification experiments, we also showed that simply replacing the pooling function in an existing model with FSPool can give us better results and faster convergence. We showed that FSPool consistently learns better set representations at a relatively small computational cost, leading to improved results in the downstream task. Our model thus has immediate applications in various types of set models that have traditionally used sum or max pooling. It would be useful to theoretically characterise what types of relations are more easily expressed by FSPool through an analysis like in Murphy et al. (2019). This may result in further insights into how to learn better set representations efficiently.
+
+# REFERENCES
+
+Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas J Guibas. Learning representations and generative models for 3D point clouds. In Proceedings of the 35th International Conference on Machine Learning (ICML), 2018.
+Cem Anil, James Lucas, and Roger Grosse. Sorting out Lipschitz function approximation. arXiv:1811.05381, 2018.
+James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems 29 (NeurIPS), 2016.
+Cat˘ alina Cangea, Petar Veli ˘ ckovi ˇ c, Nikola Jovanovi ´ c, Thomas Kipf, and Pietro Liò. Towards sparse ´ hierarchical graph classifiers. NeurIPS Workshop, Relational Representation Learning, 2018.
+Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval Networks: Improving robustness to adversarial examples. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
+Haoqiang Fan, Hao Su, and Leonidas J. Guibas. A point set generation network for 3D object reconstruction from a single image. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
+Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Müller. SplineCNN: Fast geometric deep learning with continuous B-spline kernels. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
+Hongyang Gao and Shuiwang Ji. Graph U-Net, 2019. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJePRoAct7.
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS), 2010.
+Aditya Grover, Eric Wang, Aaron Zweig, and Stefano Ermon. Stochastic optimization of sorting networks via continuous relaxations. In International Conference on Learning Representations (ICLR), 2019.
+Jie Hu, Li Shen, Samuel Albanie, Gang Sun, and Andrea Vedaldi. Gather-Excite: Exploiting feature context in convolutional neural networks. In Advances in Neural Information Processing Systems 31 (NeurIPS), 2018.
+Drew A. Hudson and Christopher D. Manning. Compositional Attention Networks for Machine Reasoning. In International Conference on Learning Representations (ICLR), 2018.
+Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems 28 (NeurIPS), 2015.
+
+Daniel D. Johnson. Learning graphical state transitions. In International Conference on Learning Representations (ICLR), 2017.
+
+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.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
+
+Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
+
+Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning Latent Permutations with Gumbel-Sinkhorn Networks. In International Conference on Learning Representations (ICLR), 2018.
+
+Nicola Messina, Giuseppe Amato, Fabio Carrara, Fabrizio Falchi, and Claudio Gennaro. Learning relationship-aware visual features, 2018. URL http://www.rcbir.org/ learning-relationship-aware-preprint.pdf.
+
+Ryan L. Murphy, Balasubramaniam Srinivasan, Vinayak Rao, and Bruno Ribeiro. Janossy pooling: Learning deep permutation-invariant functions for variable-size inputs. In International Conference on Learning Representations (ICLR), 2019.
+
+Marion Neumann, Roman Garnett, Christian Bauckhage, and Kristian Kersting. Propagation kernels: Efficient graph kernels from propagated information. Machine Learning, 102(2):209–245, 2016. ISSN 0885-6125.
+
+Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of the 33rd International Conference on Machine Learning (ICML), 2016.
+
+Charles R. Qi, Hao Su, Kaichun Mo, and Leonidas J. Guibas. PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
+
+S. Hamid Rezatofighi., Vijay Kumar B G, Anton Milan, Ehsan Abbasnejad, Anthony Dick, and Ian Reid. DeepSetNet: Predicting sets with deep neural networks. In The IEEE International Conference on Computer Vision (ICCV), 2017.
+
+S. Hamid Rezatofighi, Roman Kaskman, Farbod T. Motlagh, Qinfeng Shi, Daniel Cremers, Laura Leal-Taixé, and Ian Reid. Deep perm-set net: Learn to predict sets with unknown permutation and cardinality using deep neural networks. arXiv:1805.00613, 2018.
+
+Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Tim Lillicrap. A simple neural network module for relational reasoning. In Advances in Neural Information Processing Systems 30 (NeurIPS), 2017.
+
+Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M. Borgwardt. Weisfeiler-Lehman Graph Kernels. Journal of Machine Learning Research, 12: 2539–2561, 2011. ISSN 1532-4435.
+
+Zenglin Shi, Yangdong Ye, and Yunpeng Wu. Rank-based pooling for deep convolutional neural networks. Neural Networks, 83:21 – 31, 2016. ISSN 0893-6080.
+
+Russell Stewart and Mykhaylo Andriluka. End-to-end people detection in crowded scenes. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
+
+Sean Welleck, Zixin Yao, Yu Gai, Jialin Mao, Zheng Zhang, and Kyunghyun Cho. Loss functions for multiset prediction. In Advances in Neural Information Processing Systems 31 (NeurIPS), 2018.
+
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
+
+Yaoqing Yang, Chen Feng, Yiru Shen, and Dong Tian. FoldingNet: Point cloud auto-encoder via deep grid deformation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
+
+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 31 (NeurIPS), 2018.
+
+Jiaxuan You, Rex Ying, Xiang Ren, William Hamilton, and Jure Leskovec. GraphRNN: Generating realistic graphs with deep auto-regressive models. In Proceedings of the 35th International Conference on Machine Learning (ICML), 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 (NeurIPS), 2017.
+
+Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI), 2018.
+
+Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Deep Set Prediction Networks. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
+
+Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Learning representations of sets through optimized permutations. In International Conference on Learning Representations (ICLR), 2019b.
+
+# A FORMAL RESPONSIBILITY PROBLEM
+
+The following theorem is a more formal treatment of the responsibility problem resulting in discontinuities.
+
+Theorem 1. For any set function $f : S _ { n } ^ { d } \to \mathbb { R } ^ { d \times n }$ ( $\hphantom { 0 } d \geq 2$ , $n \geq 2$ , $S _ { n } ^ { d }$ is the set of all sets of size $n$ with elements in $\mathbb { R } ^ { d }$ ) from a set of points $S = \{ \pmb { x } _ { 1 } , \pmb { x } _ { 2 } , \ldots , \pmb { x } _ { n } \}$ to a list representation of that set ${ \pmb { L } } = [ { \pmb { x } } _ { \sigma ( 1 ) } , { \pmb { x } } _ { \sigma ( 2 ) } , \ldots , { \pmb { x } } _ { \sigma ( n ) } ]$ with some fixed permutation $\sigma \in \Pi$ , there will be a discontinuity in $f$ : there exists an $\varepsilon > 0$ such that for all $\delta > 0$ , there exist two sets $S _ { 1 }$ and $S _ { 2 }$ where:
+
+$$
+d _ { s } \big ( S _ { 1 } , S _ { 2 } \big ) < \delta \quad a n d \quad d _ { l } \big ( f \big ( S _ { 1 } \big ) , f \big ( S _ { 2 } \big ) \big ) \ge \varepsilon .
+$$
+
+$d _ { s }$ is a measure of the distance between two sets (e.g. Chamfer loss) and $d _ { l }$ is the sum of Euclidean distances $\begin{array} { r } { ( { d _ { l } } ( \pmb { A } , \mathbf { \tilde { B } } ) = \sum _ { j } \left\| \pmb { a } _ { j } - \pmb { b } _ { j } \right\| _ { 2 } ) } \end{array}$ .
+
+
+Figure 4: Example of the set with two points.
+
+Proof. We prove the theorem by considering mappings from a set of two points in two dimensions. For larger sets or sets with more dimensions, we can isolate two points and two dimensions and ignore the remaining points and dimensions.
+
+Let us consider the set of two points $\begin{array} { r } { \pmb { S } ( \theta ) = \left\{ \left[ \begin{array} { l } { - \cos ( \theta ) } \\ { - \sin ( \theta ) } \end{array} \right] , \left[ \sin ( \theta ) \right] \right\} } \end{array}$ (see Figure 4). This is mapped to a list $L ( \theta ) = f ( S ( \theta ) )$ . Without loss of generality, we can assume that our list representation for $\theta = 0$ is $\begin{array} { r } { \pmb { L } ( 0 ) = \left[ - \cos ( 0 ) \cos ( 0 ) \right] = \left[ \begin{array} { l l } { - 1 } & { 1 } \\ { - \sin ( 0 ) \sin ( 0 ) } \end{array} \right] } \end{array}$ . Since the order of set elements is irrelevant and $f$ is a (permutation-invariant) set function, $\pmb { S } ( \pi ) = \pmb { S } ( 0 )$ and therefore $\pmb { L } ( \pi ) = \pmb { L } ( 0 ) = \left[ \begin{array} { l l } { - 1 } & { 1 } \\ { 0 } & { 0 } \end{array} \right]$ . This implies that for at least one value of $\theta = \theta ^ { * }$ , there is a change in responsibility such that for $\bar { { \boldsymbol { \theta } } } \leq { \boldsymbol { \theta } } ^ { * }$ , the list representation will be $L _ { 1 } ( \theta ) = { \tiny \left[ \begin{array} { l l } { - \cos ( \theta ) \ \cos ( \theta ) } \\ { - \sin ( \theta ) \ \sin ( \theta ) } \end{array} \right] }$ while for $\theta > \theta ^ { * }$ , the list representation will be $L _ { 2 } ( \theta ) = { \biggl [ } { \cos ( \theta ) } - \cos ( \theta ) { \biggr ] }$ in order to satisfy $\pmb { L } ( \pi ) = \pmb { L } ( 0 )$ . For any $\theta$ $\begin{array} { r } { 9 , d _ { l } ( L _ { 1 } ( \theta ) , L _ { 2 } ( \theta ) ) = 4 } \end{array}$ . Let $\varepsilon = 3 . 9$ and $\delta$ be given. We can find a sufficiently small $\alpha > 0$ so that $d _ { s } ( S ( \theta ^ { * } ) , S ( \theta ^ { * } + \alpha ) ) < \delta$ and $d _ { l } ( L ( \theta ^ { * } ) , L ( \theta ^ { * } \bar { + } \alpha ) ) > \varepsilon$ . □
+
+The reason why this does not apply to our method is that rather than choosing a fixed $\sigma$ for the list representation, the permutation-equivariance (instead of the invariance of set functions) allows our model to have $\pmb { L } ( \pi ) \neq \pmb { L } ( 0 )$ .
+
+# B POLYGONS
+
+Results In Table 3, Table 4, and Table 5, we show the results of various model and training loss combinations. We include a random baseline that outputs a polygon with the correct size and centre, but random rotation.
+
+These show that FSPool with the direct MSE training loss is clearly better than the baseline with either linear assignment or Chamfer loss on all the evaluation metrics. When the set size is 16 or greater, the other combinations only perform as well as the random baseline because they output the same constant set regardless of input.
+
+Table 3: Direct mean squared error (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
+
+
Set size
2
4
8
16
32
64
FSPOOL
0.000
0.001
0.000
0.000
0.000
0.0001
RANDOM
100.323
100.134
99.367
99.951
99.438
99.523
+
+Table 4: Chamfer loss (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
+
+
Set size
2
4
8
16
32
64
FSPOOL
0.001
0.001
0.001
0.000
0.001
0.002
MLP+ Chamfer
1.189
1.771
0.274
1.272
0.316
0.085
MLP +Hungarian
1.517
0.400
0.251
1.266
0.326
0.081
RANDOM
72.848
19.866
5.112
1.271
0.322
0.081
+
+Table 5: Linear assignment loss (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
+
+
Set size
2
4
8
16
32
64
FSPOOL
0.000
0.001
0.000
0.000
0.000
0.001
MLP +Chamfer
0.595
0.885
0.137
0.641
0.160
0.285
MLP + Hungarian
0.758
0.200
0.126
0.634
0.163
0.040
RANDOM
36.424
9.933
2.556
0.635
0.161
0.041
+
+# C MNIST RECONSTRUCTION
+
+Results We show the results for the default MNIST setting in Table 6. Interestingly, the sum pooling baseline has a lower Chamfer reconstruction error than our model, despite the example outputs in Figure 3 looking clearly worse. This demonstrates a weakness of the Chamfer loss. Our model avoids this weakness by being trained with a normal MSE loss (with the cost of a potentially higher Chamfer loss), which is not possible with the baselines. The sum pooling baseline has a better test Chamfer loss because it is trained to minimise it, but it is also solving an easier task, since it does not need to distinguish padding from non-padding elements.
+
+The main reason for this difference comes from the shortcoming of the Chamfer loss in distinguishing sets with duplicates or near-duplicates. For example, the Chamfer loss between [1, 1.001, 9] and [1, 9, 9.001] is close to 0. Most points in an MNIST set are quite close to many other points and there are many duplicate padding elements, so this problem with the Chamfer loss is certainly present on MNIST. That is why minimising MSE can lead to different results with higher Chamfer loss than minimising Chamfer loss directly, even though the qualitative results seem worse for the latter.
+
+We can make the comparison between our model and the baselines more similar by forcing the models to predict an additional “mask feature” for each set element. This takes the value 1 when the point is present (non-padding element) and 0 (padding element) when not. This setting is useful for tasks where the predicted set size matters, as it allows points at the coordinates $( 0 , 0 )$ to be distinguished from padding elements. These padding elements are necessary for efficient minibatch-wise training.
+
+The results of this variant are shown in Table 7. Now, our model is clearly better: even though our auto-encoder minimises an MSE loss, the test Chamfer loss is also much better than all the baselines. Having to predict this additional mask feature does not affect our model predictions much because our model structure lets our model “know” which elements are padding elements, while this is much more challenging for the baselines.
+
+Table 6: Test Chamfer loss (in 10 000ths) for MNIST for different input noise levels $\sigma$ over 6 runs. Lower is better.
+
+
Noise σ
0.00
0.01
0.02
0.03
0.04
0.05
FSPOOL+FSUNPOOL(
0.42±0.06
0.34±0.05
0.36±0.02
0.38±0.03
0.41±0.00
0.44±0.01
SUM+MLP
0.30±0.04
0.28±0.03
0.28±0.03
0.28±0.03
0.27±0.01
0.31±0.04
SUM+RNN
0.76±0.46
0.58±0.06
0.57±0.09
0.54±0.11
0.64±0.13
0.78±0.39
MAX+MLP
1.29±0.23
1.37±0.28
1.23±0.16
1.74±0.32
1.27±0.19
1.43±0.30
MEAN+MLP
1.41±0.12 1.22±0.18 1.33±0.29 1.25±0.09
)1.31±0.15
1.49±0.31
+
+Table 7: Test Chamfer loss (in 10 000ths) for MNIST with additional mask features (see description in Appendix C) on every element for different input noise levels $\sigma$ over 6 runs. Lower is better.
+
+
+
+Table 9: Classification accuracy (mean $\pm$ stdev) on MNIST for 100 epochs over 6 runs.
+
+
σ = 0.05,100 epochs
σ = 0.00,100 epochs
Frozen
Unfrozen
Random init
Frozen
Unfrozen
Random init
FSPOOL
84.9%±1.7
93.9%±0.4
94.0%±0.3
88.6%±1.6
97.4%±0.3
97.5%±0.3
SUM
79.8%±1.0
85.3%±1.1
83.1%±1.9
85.6%±0.9
89.5%±2.5
88.3%±1.4
MEAN
48.2%±6.9
86.5%±0.8
84.1%±2.3
57.0%±7.7
90.3%±1.3
91.1%±0.8
MAX
78.8%±0.8
84.7%±1.0
84.6%±0.9
89.2%±0.8
95.3%±0.7
95.1%±1.5
+
+# D MNIST CLASSIFICATION
+
+Results Table 8 and Table 9 show the results for $\sigma = 0 . 0 0$ and for 100 epochs for both $\sigma = 0 . 0 5$ and $\sigma = 0 . 0 0$ respectively. Note that these are based on pre-trained models from the default MNIST setting without mask feature. Like before, the FSPool-based models are consistently superior to all the baselines. Note that while (Qi et al., 2017) report an accuracy of ${ \sim } 9 9 \%$ on a similar set version of MNIST, our model uses noisy sets as input and is much smaller and simpler: we have 3820 parameters, while their model has 1.6 million parameters. Our model also does not use dropout, batch norm, a branching network architecture, and a stepped learning rate schedule. When we try to match their model size, our accuracies for $\sigma = 0 . 0 0$ increase to ${ \sim } 9 9 \%$ as well.
+
+# E CLEVR
+
+
+Figure 5: Shapes of piecewise linear functions learned by the FSPool model on CLEVR. These show $r \in [ 0 , 1 ]$ on the $\mathbf { X }$ -axis and $f ( r , { \bar { \boldsymbol { w } } } )$ on the $\mathsf { y }$ -axis for a particular $\bar { \pmb w }$ of a fully-trained model. A common shape among these functions are variants of max pooling: close to 0 weight for most ranks and a large non-zero weight on either the maximum or the minimum value, for example in row 2 column 2. There are many functions that simple maximums or sums can not easily represent, such as a variant of max pooling with the values slightly below the max receiving a weight of the opposite sign (see row 1 column 1) or the shape in the penultimate row column 5. The functions shown here may have a stronger tendency towards 0 values than normal due to the use of weight decay on CLEVR.
+
+# F GRAPH CLASSIFICATION
+
+Experimental setup The datasets and node features used are the same as in GIN; we did not cherry-pick them. Because the social network datasets are purely structural without node features, a constant 1 feature is used on the RDT datasets and the one-hot-encoded node degree is used on the other social network datasets. The hyperparameter sweep is done based on best validation accuracy for each fold in the cross-validation individually and over the same combinations as specified in GIN.
+
+Table 10: Cross-validation classification results $( \% )$ on various commonly-used graph classification datasets, with the mean cross-validation accuracy averaged over 10 repeats and sample standard deviations $( \pm )$ . Hyperparameters of entries marked with \* are known to be selected based on test accuracy instead of validation accuracy, so results are likely not comparable to other existing approaches that were (hopefully) selected based on validation accuracy. Our results were selected based on validation accuracy.
+
+
Social Network
IMDB-B
IMDB-M
RDT-B
RDT-M5K
COLLAB
Num. graphs
1000
1500
2000
5000
5000
Num. classes
2
3
2
5
3
Avg. nodes
19.8
13.0
429.6
508.5
74.5
Max. nodes
136
89
3063
2012
492
DCNN (Atwood & Towsley,2016)
49.1
33.5
1
1
52.1
PATCHY-SAN (Niepert et al.,2016)
71.0 ±2.3
45.2 ±2.8
86.3 ±1.6
49.1 ±0.7
72.6 ±2.2
SORTPoOL (Zhang et al., 2018)
70.0 ±0.9
47.8 ±0.9
1
1
73.8 ±0.5
DIFFPOOL (Ying et al., 2018)
1
1
1
1
75.5
WL* (Xu et al., 2019)
73.8
50.9
81.0
52.5
78.9
GIN-BASE* (Xu et al., 2019)
75.1
52.3
92.4
57.5
80.2
GIN-FSPOOL
72.1 ±2.0
49.9 ±1.7
89.1 ±1.2
51.8 ±0.9
80.0 ±0.4
- epochs
95±70
27 ±23
124 ±64
66 ±31
124 ±56
GIN-BASE
71.3 ±1.2
48.8 ±1.7
84.8 ±1.7
48.1 ±2.0
80.3 ±0.4
- epochs
83 ±73
57 ±59
156 ±58
211 ±27
204 ±26
+
+
Bioinformatics
MUTAG
PROTEINS
PTC
NCI1
Num. graphs
188
1113
344
4110
Num.classes
2
2
2
2
Avg. nodes
17.9
39.1
25.5
29.8
Max.nodes PK (Neumann et al., 2016)
28 76.0 ±2.7
620 73.7 ±0.7
109 59.5 ±2.4
111 82.5 ±0.5
DCNN (Atwood & Towsley,2016)
67.0
61.3
56.6
62.6
PATCHY-SAN (Niepert et al., 2016)
92.6 ±4.2
75.9 ±2.8
60.0 ±4.8
78.6 ±1.9
SORTPoOL (Zhang et al.,2018)
85.8 ±1.7
75.5 ±0.9
58.6 ±2.5
74.4 ±0.5
DIFFPOOL (Ying et al., 2018)
1
76.3
1
1
WL (Shervashidze et al., 2011)
84.1 ±1.9
74.7 ±0.5
58.0 ±2.5
85.5 ±0.5
WL* (Xu et al., 2019)
90.4
75.0
59.9
86.0
GIN-BASE* (Xu et al., 2019)
89.4
76.2
64.6
82.7
85.9 ±2.4
GIN-FSPOOL
299
73.8 ±0.9
59.3 ±1.8
79.2 ±0.6
- epochs
±91
69 ±23
214 ±110
361 ±54
GIN-BASE
85.0 ±1.5
73.2 ±1.2
59.9 ±2.4
79.4 ±0.6
- epochs
244 ±95
160 ±123
202 ±100
412 ±55
+
+Note that in GIN, hyperparameters are selected based on best test accuracy. This is a problem, because they consider the number of epochs a hyperparameter when accuracies tend to significantly vary between individual epochs. For example, our average result on the PROTEINS dataset would change from $7 3 . 8 \%$ to $7 7 . 1 \%$ if we were to select based on best test accuracy, which would be better than their $7 6 . 2 \%$ .
+
+While we initially also used $k = 2 0$ in FSPool for this experiment, we found that $k = 5$ was consistently an improvement. The $k = 2 0$ model was still better than the baseline on average by a smaller margin.
+
+Results We show our results of GIN-FSPool and the GIN baseline averaged over 10 repeats in Table 10. On the majority of datasets, FSPool has slightly better accuracies than the strong baseline and consistently takes fewer epochs to reach its highest validation accuracy. On the two RDT datasets, this improvement is large. Interestingly, these are the two datasets where the number of nodes to be pooled is by far the largest with an average of $4 0 0 +$ nodes per graph, compared to the next largest COLLAB with an average of 75 nodes. This is perhaps evidence that FSPool is helping to avoid the bottleneck problem of pooling a large set of feature vectors to a single feature vector.
+
+We emphasise that the main comparison to be made is between the GIN-Base and the GIN-FSPool model, since that is the only comparison where the only factor of difference is the pooling method. When comparing against other models, the network architecture, training hyperparameters, and evaluation methodology can differ significantly.
+
+Keep in mind that while GIN-Base looks much worse than the original GIN-Base\*, the difference is that our implementation has hyperparameters properly selected by validation accuracy, while GINBase\* selected them by test accuracy. If we were to select based on test accuracy, our implementation frequently outperforms their results. Also, they only performed a single run of 10-fold crossvalidation.
+
+# G DEEP SET PREDICTION NETWORKS
+
+Table 11: Average Precision (AP, mean $\pm$ stdev) for different intersection-over-union thresholds of the predicted bounding boxes over 6 runs. DSPN-RN-FSPool results are taken from Zhang et al. (2019a).
+
+
Model
AP50
AP90
AP95
AP98
AP99
DSPN-RN-FSPOOL (10 iters)
98.8±0.3
94.3±1.5
85.7±3.0
34.5±5.7
2.9±1.2
DSPN-RN-FSPOOL (20 iters)
99.8±0.0
98.7±1.1
86.2±7.2
24.3±8.0
1.4±0.9
DSPN-RN-FSPOOL (30 iters)
99.8±0.1
96.7±2.4
75.5±12.3
17.4±7.7
0.9±0.7
DSPN-RN-SUM (10 iters)
88.3±3.7
43.4±14.4
10.0±7.4
DSPN-RN-SUM (20 iters)
87.2±3.0
42.9±11.9
5.7±3.5
0.1±0.1 0.0±0.0
0.0±0.0 0.0±0.0
DSPN-RN-SUM (30 iters)
79.0±11.9
32.5±12.4
3.4±2.2
DSPN-RN-MAX (10 iters)
68.0±4.3
4.0±2.2
0.1±0.1
0.0±0.0 0.0±0.0
0.0±0.0 0.0±0.0
DSPN-RN-MAX (20 iters)
66.6±4.5
3.3±1.8
0.1±0.0
0.0±0.0
0.0±0.0
DSPN-RN-MAX (30 iters)
64.1±5.0
2.3±1.1
0.0±0.0
0.0±0.0
0.0±0.0
+
+Table 12: Average Precision (AP, mean $\pm$ stdev) for different distance thresholds of the predicted state descriptions over 6 runs. DSPN-RN-FSPool results are taken from Zhang et al. (2019a).
+
+
Model
APo
AP1
AP0.5
AP0.25
AP0.125
DSPN-RN-FSPOOL (10 iters)
72.8±2.3
59.2±2.8
39.0±4.4
12.4±2.5
1.3±0.4
DSPN-RN-FSPOOL (20 iters)
84.0±4.5
80.0±4.9
57.0±12.1
16.6±9.0
1.6±0.9
DSPN-RN-FSPOOL (30 iters)
85.2±4.8
81.1±5.2
47.4±17.6
10.8±9.0
0.6±0.7
DSPN-RN-SUM(10 iters)
44.6±3.8
21.9±4.8
7.1±2.7
1.0±0.5
0.0±0.0
DSPN-RN-SUM (20 iters)
39.6±5.4
15.2±6.4
3.0±2.2
0.3±0.3
0.0±0.0
DSPN-RN-SUM (30 iters)
30.2±9.2
7.1±3.8
0.9±0.8
0.1±0.1
0.0±0.0
DSPN-RN-MAX (10 iters)
3.0±0.2
0.9±0.1
0.5±0.2
0.1±0.1
0.0±0.0
DSPN-RN-MAX (20 iters)
3.1±0.1
1.2±0.1
0.8±0.2
0.3±0.2
0.0±0.0
DSPN-RN-MAX (30 iters)
3.1±0.1
1.2±0.1
0.9±0.2
0.3±0.2
0.0±0.0
+
+Results Table 11 and Table 12 show that the FSPool-based RN encoder is much better than any of the baselines. The representation of DSPN-RN-FSPool is good enough that iterating the DSPN algorithm for more steps than the model was trained with can benefit the prediction, while for the baselines it generally just worsens.
+
+This is especially apparent for the harder dataset of state prediction, where more information has to be compressed into the latent space.
+
+# H EXPERIMENTAL DETAILS
+
+We provide the code to reproduce all experiments at [redacted].
+
+For almost all experiments, we used FSPool and the unpooling version of it with $k = 2 0$ . We guessed this value without tuning, and we did not observe any major differences when we tried to change this on CLEVR to $k = 5$ and $k = 4 0$ . $\bar { \boldsymbol { W } }$ can be initialised in different ways, such as by sampling from a standard Gaussian. However, for the purposes of starting the model as similarly as possible to the sum pooling baseline on CLEVR and on the graph classification datasets, we initialise $\bar { \boldsymbol { W } }$ to a matrix of all 1s on them.
+
+# H.1 POLYGONS
+
+The polygons are centred on 0 with a radius of 1. The points in the set are randomly permuted to remove any ordering in the set from the generation process that a model that is not permutationinvariant or permutation-equivariant could exploit. We use a batch size of 16 for all three models and train it for 10240 steps. We use the Adam optimiser (Kingma & Ba, 2015) with 0.001 learning rate and their suggested values for the other optimiser parameters (PyTorch defaults). Weights of linear and convolutional layers are initialised as suggested in Glorot & Bengio (2010). The size of every hidden layer is set to 16 and the latent space is set to 1 (it should only need to store the rotation as latent variable). We have also tried much hidden and latent space sizes of 128 when we tried to get better results for the baselines.
+
+# H.2 MNIST RECONSTRUCTION
+
+We train on the training set of MNIST for 10 epochs and the shown results come from the test set of MNIST. For an image, the coordinate of a pixel is included if the pixel is above the mean pixel level of 0.1307 (with pixel levels ranging 0–1). Again, the order of the points are randomised. We did not include results of the linear assignment loss because we did not get the model to converge to results of similar quality to the direct MSE loss or Chamfer loss, and training time took too long $\mathit { \Theta } > 1$ day) in order to find better parameters.
+
+The latent space is increased from 1 to 16 and the size of the hidden layers is increased from 16 to 32.
+All other hyperparameters are the the same as for the Polygons dataset.
+
+# H.3 CLEVR
+
+The architecture and hyperparameters come from the third-party open-source implementation available at https://github.com/mesnico/RelationNetworks-CLEVR. For the RN baseline, the set is first expanded into the set of all pairs by concatenating the 2 feature vectors of the pair for all pairs of elements in the set. For the Janossy Pooling baseline, we use the model configuration from Murphy et al. (2019) that appeared best in their experiments, which uses $\pi$ -SGD with an LSTM that has $| h |$ as neighbourhood size.
+
+The question representation coming from the 256-unit LSTM, processing the question tokens in reverse with each token embedded into 32 dimensions, is concatenated to all elements in the set. Each element of this new set is first processed by a 4-layer MLP with 512 neurons in each layer and ReLU activations. The set of feature vectors is pooled with a pooling method like sum and the output of this is processed with a 3-layer MLP (hidden sizes 512, 1024, and number of answer classes) with ReLU activations. A dropout rate of 0.05 is applied before the last layer of this MLP. Adam is used with a starting learning rate of 0.000005, which doubles every 20 epochs until the maximum learning rate of 0.0005 is reached. Weight decay of 0.0001 is applied. The model is trained for 350 epochs.
+
+Table 13: Average of best hyperparameters over 10 repeats.
+
+
IMDB-B
IMDB-M
RDT-B
RDT-M5K
COLLAB
MUTAG
PROTEINS
PTC
NCI1
GIN-FSPOOL
- dimensionality
64.0
64.0
64.0
64.0
64.0
28.8
19.2
28.8
30.4
- batch size
66.0
100
45.6
32.0
86.4
89.6
60.8
41.6
128
- dropout
0.25
0.15
0.35
0.10
0.40
0.15
0.35
0.20
0.50
GIN-BASE
- dimensionality
64.0
64.0
64.0
64.0
64.0
27.2
20.8
25.6
28.8
- batch size
86.4
93.2
72.8
100
100
70.4
60.8
60.8
128
- dropout
0.30
0.15
0.25
0.45
0.40
0.25
0.45
0.20
0.35
+
+# H.4 GRAPH CLASSIFICATION
+
+The GIN architecture starts with 5 sequential blocks of graph convolutions. Each block starts with summing the feature vector of each node’s neighbours into the node’s own feature vector. Then, an MLP is applied to the feature vectors of all the nodes individually. The details of this MLP were somewhat unclear in $\mathrm { X u }$ et al. (2019) and we chose Linear-ReLU-BN-Linear-ReLU-BN in the end. We tried Linear-BN-ReLU-Linear-BN-ReLU as well, which gave us slightly worse validation results for both the baseline and the FSPool version. The outputs of each of the 5 blocks are concatenated and pooled, either with a sum for the social network datasets, mean for the social network datasets (this is as specified in GIN), or with FSPool for both types of datasets. This is followed by BNLinear-ReLU-Dropout-Linear as classifier with a softmax output and cross-entropy loss. We used the torch-geometric library (Fey et al., 2018) to implement this model.
+
+The starting learning rate for Adam is 0.01 and is reduced every 50 epochs. Weights are initialised as suggested in Glorot & Bengio (2010). The hyperparameters to choose from are: dropout ratio $\in \{ 0 , 0 . 5 \}$ , batch si $\mathsf { z e } \in \{ 3 2 , 1 2 8 \}$ , if bioinformatics dataset hidden sizes of all layers $\in \{ 1 6 , 3 2 \}$ and 500 epochs, if social network dataset the hidden size is 64 and 250 epochs. Due to GPU memory limitations we used a batch size of 100 instead of 128 for social network datasets. The best hyperparameters are selected based on best average validation accuracy across the 10-fold cross-validation, where one of the 9 training folds is used as validation set each time. In other words, within one 10-fold cross-validation run the hyperparameters used for the test set are the same, while across the 10 repeats of this with different seeds the best hyperparameters may differ.
+
+# H.5 DEEP SET PREDICTION NETWORKS
+
+The architecture and hyperparameters come from the third-party open-source implementation available at https://github.com/Cyanogenoid/dspn. The only thing we change from this is replacing the pooling in the RN. All other hyperparameters are kept the same.
+
+The input image is encoded with a ResNet-34 with two additional convolutional layers with 512 filters and stride two to obtain a feature vector for the image. This feature vector is decoded into a set using the DSPN algorithm, which requires encoding an intermediate set with the set encoder and performing gradient descent on it. This set encoder creates all pairs of sets like in normal RNs, processes each pair with a 2-layer MLP with 512 neurons with one ReLU activation in the middle, then pools this into a feature vector. The intermediate set is updated with the gradient 10 times in training, but can be iterated a different amount in evaluation. The model is trained to minimise the linear assignment loss with the Adam optimiser for 100 epochs using a learning rate of 0.0003.
\ No newline at end of file
diff --git a/md/train/HJgVisRqtX/HJgVisRqtX.md b/md/train/HJgVisRqtX/HJgVisRqtX.md
new file mode 100644
index 0000000000000000000000000000000000000000..532021327fc9d47fca6ef0aea07062afa4c82d0f
--- /dev/null
+++ b/md/train/HJgVisRqtX/HJgVisRqtX.md
@@ -0,0 +1,369 @@
+# SEGEN: SAMPLE-ENSEMBLE GENETIC EVOLUTIONARY NETWORK MODEL
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Deep learning, a rebranding of deep neural network research works, has achieved a remarkable success in recent years. With multiple hidden layers, deep learning models aim at computing the hierarchical feature representations of the observational data. Meanwhile, due to its severe disadvantages in data consumption, computational resources, parameter tuning costs and the lack of result explainability, deep learning has also suffered from lots of criticism. In this paper, we will introduce a new representation learning model, namely “Sample-Ensemble Genetic Evolutionary Network” (SEGEN), which can serve as an alternative approach to deep learning models. Instead of building one single deep model, based on a set of sampled sub-instances, SEGEN adopts a genetic-evolutionary learning strategy to build a group of unit models generations by generations. The unit models incorporated in SEGEN can be either traditional machine learning models or the recent deep learning models with a much “narrower” and “shallower” architecture. The learning results of each instance at the final generation will be effectively combined from each unit model via diffusive propagation and ensemble learning strategies. From the computational perspective, SEGEN requires far less data, fewer computational resources and parameter tuning efforts, but has sound theoretic interpretability of the learning process and results. Extensive experiments have been done on several different real-world benchmark datasets, and the experimental results obtained by SEGEN have demonstrated its advantages over the state-of-the-art representation learning models.
+
+# 1 INTRODUCTION
+
+In recent years, deep learning, a rebranding of deep neural network research works, has achieved a remarkable success. The essence of deep learning is to compute the hierarchical feature representations of the observational data Goodfellow et al. (2016); LeCun et al. (2015). With multiple hidden layers, the deep learning models have the capacity to capture very good projections from the input data space to the objective output space, whose outstanding performance has been widely illustrated in various applications, including speech and audio processing Deng et al. (2013); Hinton et al. (2012), language modeling and processing Arisoy et al. (2012); Mnih & Hinton (2009), information retrieval Hill (2012); Salakhutdinov & Hinton (2009), objective recognition and computer vision LeCun et al. (2015), as well as multimodal and multi-task learning Weston et al. (2010; 2011). By this context so far, various kinds of deep learning models have been proposed already, including deep belief network Hinton et al. (2006), deep Boltzmann machine Salakhutdinov & Hinton (2009), deep neural network Jaeger (2002); Krizhevsky et al. (2012) and deep autoencoder model Vincent et al. (2010).
+
+Meanwhile, deep learning models also suffer from several serious criticism due to their several severe disadvantages Zhou & Feng (2017a). Generally, learning and training deep learning models usually demands (1) a large amount of training data, (2) large and powerful computational facilities, (3) heavy parameter tuning costs, but lacks (4) theoretic explanation of the learning process and results. These disadvantages greatly hinder the application of deep learning models in many areas which cannot meet the requirements or requests a clear interpretability of the learning performance. Due to these reasons, by this context so far, deep learning research and application works are mostly carried out within/via the collaboration with several big technical companies, but the models proposed by them (involving hundreds of hidden layers, billions of parameters, and using a large cluster with thousands of server nodes Dean et al. (2012)) can hardly be applied in other real-world applications.
+
+In this paper, we propose a brand new model, namely SEGEN (Sample-Ensemble Genetic Evolutionary Network), which can work as an alternative approach to the deep learning models. Instead of building one single model with a deep architecture, SEGEN adopts a genetic-evolutionary learning strategy to train a group of unit models generations by generations. Here, the unit models can be either traditional machine learning models or deep learning models with a much “narrower” and “shallower” structure. Each unit model will be trained with a batch of training instances sampled form the dataset. By selecting the good unit models from each generation (according to their performance on a validation set), SEGEN will evolve itself and create the next generation of unit modes with probabilistic genetic crossover and mutation, where the selection and crossover probabilities are highly dependent on their performance fitness evaluation. Finally, the learning results of the data instances will be effectively combined from each unit model via diffusive propagation and ensemble learning strategies. These terms and techniques mentioned here will be explained in great detail in Section 4. Compared with the existing deep learning models, SEGEN have several great advantages, and we will illustrate them from both the bionics perspective and the computational perspective as follows.
+
+From the bionics perspective, SEGEN effectively models the evolution of creatures from generations to generations, where the creatures suitable for the environment will have a larger chance to survive and generate the offsprings. Meanwhile, the offsprings inheriting good genes from its parents will be likely to adapt to the environment as well. In the SEGEN model, each unit network model in generations can be treated as an independent creature, which will receive a different subsets of training instances and learn its own model variables. For the unit models suitable for the environment (i.e., achieving a good performance on a validation set), they will have a larger chance to generate their child models. The parent model achieving better performance will also have a greater chance to pass their variables to the child model.
+
+From the computational perspective, SEGEN requires far less data and resources, and also has a sound theoretic explanation of the learning process and results. The unit models in each generation of SEGEN are of a much simpler architecture, learning of which can be accomplished with much less training data, less computational resources and less hyper-parameter tuning efforts. In addition, the training dataset pool, model hyper-parameters are shared by the unit models, and the increase of generation size (i.e., unit model number in each generation) or generation number (i.e., how many generation rounds will be needed) will not increase the learning resources consumption. The relatively “narrower” and “shallower” structure of unit models will also significantly enhance the interpretability of the unit models training process as well as the learning results, especially if the unit models are the traditional non-deep learning models. Furthermore, the sound theoretical foundations of genetic algorithm and ensemble learning will also help explain the information inheritance through generations and result ensemble in SEGEN.
+
+In this paper, we will use network embedding problem Wang et al. (2016); Chang et al. (2015); Perozzi et al. (2014) (applying autoencoder as the unit model) as an example to illustrate the SEGEN model. Meanwhile, applications of SEGEN on other data categories (e.g., images and raw feature inputs) with CNN and MLP as the unit model will also be provided in Section 5.3. The following parts of this paper are organized as follows. The problem formulation is provided in Section 3. Model SEGEN will be introduced in Section 4, whose performance will be evaluated in Section 5. Finally, Section 2 introduces the related works and we conclude this paper in Section 6.
+
+# 2 RELATED WORK
+
+Deep Learning Research and Applications: The essence of deep learning is to compute hierarchical features or representations of the observational data Goodfellow et al. (2016); LeCun et al. (2015). With the surge of deep learning research and applications in recent years, lots of research works have appeared to apply the deep learning methods, like deep belief network Hinton et al. (2006), deep Boltzmann machine Salakhutdinov & Hinton (2009), Deep neural network Jaeger (2002); Krizhevsky et al. (2012) and Deep autoencoder model Vincent et al. (2010), in various applications, like speech and audio processing Deng et al. (2013); Hinton et al. (2012), language modeling and processing Arisoy et al. (2012); Mnih & Hinton (2009), information retrieval Hill (2012); Salakhutdinov & Hinton (2009), objective recognition and computer vision LeCun et al. (2015), as well as multimodal and multi-task learning Weston et al. (2010; 2011).
+
+Network Embedding: Network embedding has become a very hot research problem recently, which can project a graphstructured data to the feature vector representations. In graphs, the relation can be treated as a translation of the entities, and many translation based embedding models have been proposed, like TransE Bordes et al. (2013), TransH Wang et al. (2014) and TransR Lin et al. (2015). In recent years, many network embedding works based on random walk model and deep learning models have been introduced, like Deepwalk Perozzi et al. (2014), LINE Tang et al. (2015), node2vec Grover & Leskovec (2016), HNE Chang et al. (2015) and DNE Wang et al. (2016). Perozzi et al. extends the word2vec model Mikolov et al. (2013) to the network scenario and introduce the Deepwalk algorithm Perozzi et al. (2014). Tang et al. Tang et al. (2015) propose to embed the networks with LINE algorithm, which can preserve both the local and global network structures. Grover et al. Grover & Leskovec (2016) introduce a flexible notion of a node’s network neighborhood and design a biased random walk procedure to sample the neighbors. Chang et al. Chang et al. (2015) learn the embedding of networks involving text and image information. Chen et al. Chen & Sun (2016) introduce a task guided embedding model to learn the representations for the author identification problem.
+
+# 3 PROBLEM FORMULATION
+
+In this section, we will provide the definitions of several important terminologies, based on which we will define the network representation learning problem.
+
+# 3.1 TERMINOLOGY DEFINITION
+
+The SEGEN model will be illustrated based on the network representation learning problem in this paper, where the input is usually a large-sized network structured dataset.
+
+DEFINITION 1 (Network Data): Formally, a network structured dataset can be represented as a graph $G = ( \nu , \mathcal { E } )$ , where $\nu$ denotes the node set and $\mathcal { E }$ contains the set of links among the nodes.
+
+In the real-world applications, lots of data can be modeled as networks. For instance, online social media can be represented as a network involving users as the nodes and social connections as the links; e-commerce website can be denoted as a network with customer and products as the nodes, and purchase relation as the links; academic bibliographical data can be modeled as a network containing papers, authors as the nodes, and write/cite relationships as the links. Given a large-sized input network data $G = ( \nu , \mathcal { E } )$ , a group of sub-networks can be extracted from it, which can be formally represented as a sub-network set of $G$ .
+
+
+Step 1: Network Sampling Step 2: Sub-Network Representation Learning Step 3: Result Ensemble
+Figure 1: The SEGEN Framework.
+
+DEFINITION 2 (Sub-network Set): Based on a certain sampling strategy, we can represent the set of sampled subnetworks from network $G$ as set ${ \mathcal { G } } = \{ g _ { 1 } , g _ { 2 } , \cdot \cdot \cdot , g _ { m } \}$ of size m. Here, $g _ { i } \in \mathcal G$ denotes a sub-network of $G$ , and it can be represented as $g _ { i } = ( \mathcal { V } _ { g _ { i } } , \mathcal { E } _ { g _ { i } } )$ , where $\nu _ { g _ { i } } \subseteq \nu$ , $\mathcal { E } _ { g _ { i } } \subseteq \mathcal { E }$ and $G \neq g _ { i }$ .
+
+In Section 4, we will introduce several different sampling strategies, which will be applied to obtained several different sub-network pools for unit model building and validation.
+
+# 3.2 PROBLEM FORMULATION
+
+Problem Statement: Based on the input network data $G = ( \nu , \mathcal { E } )$ , the network representation learning problem aims at learning a mapping $f : \mathcal { V } \to \mathbb { R } ^ { d }$ to project each node from the network to a low-dimensional feature space. There usually exist some requirements on mapping $f ( \cdot )$ , which should preserve the original network structure, i.e., closer nodes should have close representations; while disconnected nodes have different representations on the other hand.
+
+# 4 PROPOSED METHODS
+
+In this section, we will introduce the proposed framework SEGEN in detail. As shown in Figure 1, the proposed framework involves three steps: (1) network sampling, (2) sub-network representation learning, and (3) result ensemble. Given the large-scale input network data, framework SEGEN will sample a set of sub-networks, which will be used as the input to the genetic evolutionary network model for representation learning. Based on the learned results for the sub-networks, framework SEGEN will combine them together to obtain the final output result. In the following parts, we will introduce these three steps in great detail respectively.
+
+# 4.1 NETWORK SAMPLING
+
+In framework SEGEN, instead of handling the input large-scale network data directly, we propose to sample a subset (of set size $s$ ) of small-sized sub-networks (of a pre-specified sub-network size $k$ ) instead and learn the representation feature vectors of nodes based on the sub-networks. To ensure the learned representations can effectively represent the characteristics of nodes, we need to ensure the sampled sub-networks share similar properties as the original large-sized input network. As shown in Figure 1, 5 different types of network sampling strategies (indicated in 5 different colors) are adopted in this paper, and each strategy will lead to a group of small-sized sub-networks, which can capture both the local and global structures of the original network.
+
+# 4.1.1 BFS BASED NETWORK SAMPLING
+
+Based on the input network $G = ( \nu , \mathcal { E } )$ , Breadth-First-Search (BFS) based network sampling strategy randomly picks a seed node from set $\nu$ and performs BFS to expend to the unreached nodes. Formally, the neighbors of node $v \in \mathcal V$ can be denoted as set $\Gamma ( v ; 1 ) \stackrel { \scriptscriptstyle - } { = } \{ u | u \in \mathcal { V } \wedge ( u , \bar { v _ { ) } } \in \mathcal { E } \}$ . After picking $v$ , the sampling strategy will continue to randomly add $k - 1$ nodes from set $\Gamma ( v ; 1 )$ , if $| \Gamma ( v ; 1 ) | \geq k - 1$ ; otherwise, the sampling strategy will go to the 2-hop neighbors of $v$ (i.e., $\Gamma ( v ; 2 ) = \{ u | \exists w \in \mathcal { V } , ( u , w ) \in \mathcal { E } \land ( w , v ) \in \mathcal { E } \ /$ ∧ (u, v) ∈ E} / ) and so forth until the remaining $k - 1$ nodes are selected. In the case when the size of connected component that $v$ involves in is smaller than $k$ , the strategy will further pick another seed node to do BFS from that node to finish the sampling of $k$ nodes. These sampled $k$ nodes together with the edges among them will form a sampled sub-network $g$ , and all the $p$ sampled sub-networks will form the sub-network pool $\bar { \mathcal { G } } ^ { \mathrm { B F S } }$ (parameter $p$ denotes the pool size).
+
+# 4.1.2 DFS BASED NETWORK SAMPLING
+
+Depth-First-Search (DFS) based network sampling strategy works in a very similar way as the BFS based strategy, but it adopts DFS to expand to the unreached nodes instead. Similar to the BFS method, in the case when the node connected component has size less than $k$ , DFS sampling strategy will also continue to pick another node as the seed node to continue the sampling process. The sampled nodes together with the links among them will form the sub-networks to be involved in the final sampled sub-network pool ${ \mathcal { G } } ^ { \mathrm { { D F S } } }$ (of size $p$ ).
+
+A remark to be added here: the sub-networks sampled via BFS can mainly capture the local network structure of nodes (i.e., the neighborhood), and in many of the cases they are star structured diagrams with the picked seed node at the center surrounded by its neighbors. Meanwhile, the sub-networks sampled with DFS are slightly different, which involve “deeper” network connection patterns. In the extreme case, the sub-networks sampled via DFS can be a path from the seed nodes to a node which is $( k - 1 )$ -hop away.
+
+# 4.1.3 HS BASED NETWORK SAMPLING
+
+To balance between those extreme cases aforementioned, we introduce a Hybrid-Search (HS) based network sampling strategy by combining BFS and DFS. HS randomly picks seed nodes from the network, and reaches other nodes based on either BFS or DFS strategies with probabilities $p$ and $( 1 - p )$ respectively. For instance, in the sampling process, HS first picks node $v \in \mathcal V$ as the seed node, and samples a random node $u \in \Gamma ( v ; 1 )$ . To determine the next node to sample, HS will “toss a coin” with $p$ probability to sample nodes from $\Gamma ( v ; 1 ) \setminus \{ u \}$ (i.e., BFS) and $1 - p$ probability to sample nodes from $\Gamma ( u ; 1 ) \setminus \{ v \}$ (i.e., DFS). Such a process continues until $k$ nodes are selected, and the sampled nodes together with the links among them will form the sub-network. We can represent all the sampled sub-networks by the HS based network sampling strategy as pool ${ \mathcal { G } } ^ { \mathrm { H S } }$ .
+
+These three network sampling strategies are mainly based on the connections among the nodes, and nodes in the sampled sub-networks are mostly connected. However, in the real-world networks, the connections among nodes are usually very sparse, and most of the node pairs are not connected. In the following part, we will introduce two other sampling strategies to handle such a case.
+
+# 4.1.4 BIASED NODE SAMPLING
+
+Instead of sampling sub-networks via the connections among them, the node sampling strategy picks the nodes at random from the network. Based on node sampling, the final sampled sub-network may not necessarily be connected and can involve many isolated nodes. Furthermore, uniform sampling of nodes will also deteriorate the network properties, since it treats all the nodes equally and fails to consider their differences. In this paper, we propose to adopt the biased node sampling strategy, where the nodes with more connections (i.e., larger degrees) will have larger probabilities to be sampled. Based on the connections among the nodes, we can represent the degree of node $v \in \mathcal V$ as $d ( u ) = | \Gamma ( u ; 1 ) |$ , and the probabilities for $u$ to be sampled can be denoted as $\begin{array} { r } { p ( u ) \ = \ \frac { d ( u ) } { 2 | \mathcal { E } | } } \end{array}$ . Instead of focusing on the local structures of the network, the sub-networks sampled with the biased node sampling strategy can capture more “global” structures of the input network. Formally, all the sub-networks sampled via this strategy can be represented as pool $\mathcal { G } ^ { \mathrm { N S } }$ .
+
+# 4.1.5 BIASED EDGE SAMPLING
+
+Another “global” sub-network sampling strategy is the edge based sampling strategy, which samples the edges instead of nodes. Here, uniform sampling of edges will be reduced to biased node selection, where high-degree nodes will have a larger probability to be involved in the sub-network. In this paper, we propose to adopt a biased edge sampling strategy instead. For each edge $( u , v ) \in \mathcal { E }$ , the probability for it to be sampled is actually proportional to $\frac { d ( u ) + d ( v ) } { 2 | \mathcal { E } | }$ . The sampled edges together with the incident nodes will form a sub-network, and all the sampled sub-networks with biased edge sampling strategy can be denoted as pool $\mathcal { G } ^ { \mathrm { E S } }$ .
+
+These two network sampling strategies can select the sub-structures of the input network from a global perspective, which can effectively capture the sparsity property of the input network. In the experiments to be introduced in Section 5, we will evaluate these different sampling strategies in detail.
+
+# 4.2 GEN MODEL
+
+In this part, we will focus on introducing the Genetic Evolutionary Network (GEN) model, which accepts each sub-network pool as the input and learns the representation feature vectors of nodes as the output. We will use $\mathcal { G }$ to represent the sampled pool set, which can be ${ \mathcal { G } } ^ { \mathrm { B F S } }$ , ${ \mathcal { G } } ^ { \mathrm { { D F S } } }$ , $\mathcal { G } ^ { \mathrm { H S } }$ , $\mathcal { G } ^ { \mathrm { N S } }$ or $\mathcal { G } ^ { \mathrm { E S } }$ respectively.
+
+# 4.2.1 UNIT MODEL POPULATION INITIALIZATION
+
+In the GEN model, there exist multiple generations of unit models, where the earlier generations will evolve and generate the later generations. Each generation will also involve a group of unit models, namely the unit model population. Formally, the initial generation of the unit models (i.e., the $1 _ { s t }$ generation) can be represented as set $\mathcal { M } ^ { 1 } = \{ \hat { M _ { 1 } ^ { 1 } } , \hat { M } _ { 2 } ^ { 1 } , \cdot \cdot \cdot , M _ { m } ^ { 1 } \}$ (of size $m$ ), where $M _ { i } ^ { 1 }$ is a base unit model to be introduced in the following subsection. Formally, the variables involved in each unit model, e.g., $M _ { i } ^ { 1 }$ , can be denoted as vector $\theta _ { i } ^ { 1 }$ , which covers the weight and bias terms in the model (which will be treated as the model genes in the evolution to be introduced later). In the initialization step, the variables of each unit model are assigned with a random value generated from the standard normal distribution.
+
+# 4.2.2 UNIT MODEL DESCRIPTION
+
+In this paper, we will take network representation learning as an example, and propose to adopt the correlated autoencoder as the base model. We want to clarify again that the SEGEN framework is a general framework, and it works well for different types of data as well as different base models. For some other tasks or other learning settings, many other existing models, e.g., CNN and MLP to be introduced in Section 5.3, can be adopted as the base model as well.
+
+Autoencoder is an unsupervised neural network model, which projects data instances from the original feature space to a lower-dimensional feature space via a series of non-linear mappings. Autoencoder model involves two steps: encoder and decoder. The encoder part projects the original feature vectors to the objective feature space, while the decoder step recovers the latent feature representations to a reconstructed feature space.
+
+Based on each sampled sub-network $g \in { \mathcal { T } }$ , where $g = ( \mathcal { V } _ { g } , \mathcal { E } _ { g } )$ , we can represent
+the sub-network structure as an adjacency matrix $\mathbf { A } _ { g } ~ = ~ \{ 0 , 1 \} ^ { | \mathcal { V } _ { g } | \times | \mathcal { V } _ { g } | }$ , where
+$A _ { g } ( i , j ) = 1$ iff $( v _ { i } , v _ { j } ) \in \mathcal { E } _ { g }$ . Formally, for each node $v _ { i } \in \mathcal V _ { g }$ , we can represent its
+raw feature as $\mathbf { x } _ { i } = \mathbf { A } _ { g } ( i , : )$ . Let $\mathbf { y } _ { i } ^ { 1 } , \mathbf { y } _ { i } ^ { 2 } , \cdots , \mathbf { y } _ { i } ^ { o }$ be the corresponding latent feature
+representation of $\mathbf { x } _ { i }$ at hidden layers $1 , 2 , \cdots , o$ in the encoder step. The encoding
+result in the objective feature space can be denoted as $\mathbf { z } _ { i } \in \mathbb { R } ^ { d }$ of dimension $d$ . In
+the decoder step, the input will be the latent feature vector $\mathbf { z } _ { i }$ , and the final output
+will be the reconstructed vector $\hat { \mathbf { x } } _ { i }$ (of the same dimension as $\mathbf { x } _ { i }$ ). The latent feature
+vectors at each hidden layers can be represented as $\hat { \mathbf { y } } _ { i } ^ { o } , \hat { \mathbf { y } } _ { i } ^ { o - 1 } , \cdots , \hat { \mathbf { y } } _ { i } ^ { 1 }$ . As shown in
+the architecture in Figure 2, the relationships among these variables can be represented with the following equations:
+
+
+Figure 2: Autoencoder Model.
+
+$$
+\left\{ \begin{array} { l l } { \mathrm { E n c o d e r : } } \\ { \mathbf { y } _ { i } ^ { 1 } = \sigma ( \mathbf { W } ^ { 1 } \mathbf { x } _ { i } + \mathbf { b } ^ { 1 } ) , } \\ { \mathbf { y } _ { i } ^ { k } = \sigma ( \mathbf { W } ^ { k } \mathbf { y } _ { i } ^ { k - 1 } + \mathbf { b } ^ { k } ) , \forall k \in \{ 2 , \cdots , o \} , } \\ { \mathbf { z } _ { i } = \sigma ( \mathbf { W } ^ { o + 1 } \mathbf { y } _ { i } ^ { o } + \mathbf { b } ^ { o + 1 } ) . } \end{array} \right. \quad \forall k = \{ 2 , \cdots , o \} \left\{ \begin{array} { l l } { \mathrm { D e c o d e r : } } \\ { \hat { \mathbf { y } } _ { i } ^ { o } = \sigma ( \hat { \mathbf { W } } ^ { o + 1 } \mathbf { z } _ { i } + \hat { \mathbf { b } } ^ { o + 1 } ) , } \\ { \hat { \mathbf { y } } _ { i } ^ { k - 1 } = \sigma ( \hat { \mathbf { W } } ^ { k } \mathbf { \hat { y } } _ { i } ^ { k } + \hat { \mathbf { b } } ^ { k } ) , \forall k \in \{ 2 , \cdots , o \} , } \\ { \hat { \mathbf { x } } _ { i } = \sigma ( \hat { \mathbf { W } } ^ { 1 } \hat { \mathbf { y } } _ { i } ^ { 1 } + \hat { \mathbf { b } } ^ { 1 } ) . } \end{array} \right.
+$$
+
+The objective of traditional autoencoder model is to minimize the loss between the original feature vector $\mathbf { x } _ { i }$ and the reconstructed feature vector $\hat { \mathbf { x } } _ { i }$ of data instances. Meanwhile, for the network representation learning task, the learning task of nodes in the sub-networks are not independent but highly correlated. For the connected nodes, they should have closer representation feature vectors in the latent feature space; while for those which are isolated, their latent representation feature vectors should be far away instead. What’s more, since the input feature vectors are extremely sparse (lots of the entries are 0s), simply feeding them to the model may lead to some trivial solutions, like 0 vector for both $\mathbf { z } _ { i }$ and the decoded vector $\hat { \mathbf { x } } _ { i }$ . Therefore, we propose to extend the Autoencoder model to the correlated scenario for networks, and define the objective of the correlated autoencoder model as follows:
+
+$$
+\mathcal { L } _ { e } ( g ) = \sum _ { v _ { i } \in \mathcal { V } _ { g } } \| ( \mathbf { x } _ { i } - \hat { \mathbf { x } } _ { i } ) \odot \mathbf { b } _ { i } \| _ { 2 } ^ { 2 } + \alpha \sum _ { v _ { i } , v _ { j } \in \mathcal { V } _ { g } , v _ { i } \ne v _ { j } } \left| \| \mathbf { z } _ { i } - \mathbf { z } _ { j } \right| \| _ { 2 } ^ { 2 } + \beta \cdot \sum _ { i = 1 } ^ { o } \left( \left\| \mathbf { W } ^ { i } \right\| _ { F } ^ { 2 } + \left\| \hat { \mathbf { W } } ^ { i } \right\| _ { F } ^ { 2 } \right) ,
+$$
+
+where si,j = $s _ { i , j } = { \left\{ \begin{array} { l l } { + 1 , } & { { \mathrm { i f } } \ A _ { g } ( i , j ) = 1 ; } \\ { - 1 , } & { { \mathrm { i f } } \ A _ { g } ( i , j ) = 0 . } \end{array} \right. }$ and $\alpha , \beta$ are the weights of the correlation and regularization terms respectively. Entries in weight vector $\mathbf { b } _ { i }$ have value 1 except the entries corresponding to non-zero element in $\mathbf { x } _ { i }$ , which will be assigned with value $\gamma \left( \gamma > 1 \right)$ to preserve these non-zero entries in the reconstructed vector $\hat { \mathbf { x } } _ { i }$ .
+
+# 4.2.3 GENERATION MODEL LEARNING SETTING
+
+Instead of fitting each unit model with all the sub-networks in the pool $\mathcal { G }$ , in GEN, a set of sub-network training batches $\mathcal { T } _ { 1 } , \mathcal { T } _ { 2 } , \cdots , \mathcal { T } _ { m }$ will be sampled for each unit model respectively in the learning process, where $| \mathcal { T } _ { i } | = b , \forall i \ \bar { \in }$ $\{ 1 , 2 , \cdots , m \}$ are of the pre-defined batch size $b$ . These batches may share common sub-networks as well, i.e., $\mathcal { T } _ { i } \cap \mathcal { T } _ { j }$ may not necessary be $\varnothing$ . In the GEN model, the unit models learning process for each generation involves two steps: (1) generating the batches $\mathcal { T } _ { i }$ from the pool set $\mathcal { G }$ for each unit model $\breve { M } _ { i } ^ { 1 } \in { \mathcal { M } } ^ { 1 }$ , and (2) learning the variables of the unit model $M _ { i } ^ { \bar { 1 } }$ based on sub-networks in batch $\mathcal { T } _ { i }$ . Considering that the unit models have a much smaller number of hidden layers, the learning time cost of each unit model will be much less than the deeper models on larger-sized networks. In Section 5, we will provide a more detailed analysis about the running time cost and space cost of SEGEN.
+
+# 4.2.4 UNIT MODEL FITNESS EVALUATION AND SELECTION
+
+The unit models in the generation set $\mathcal { M } ^ { 1 }$ can have different performance, due to (1) different initial variable values, and (2) different training batches in the learning process. In framework SEGEN, instead of applying “deep” models with multiple hidden layers, we propose to “deepen” the models in another way: “evolve the unit model into ‘deeper’ generations”. A genetic algorithm style method is adopted here for evolving the unit models, in which the well-trained unit models will have a higher chance to survive and evolve to the next generation. To pick the well-trained unit models, we need to evaluate their performance, which is done with the validation set $\nu$ sampled from the pool. For each unit model $M _ { k } ^ { 1 } \in \mathcal { M } ^ { 1 }$ , based on the sub-networks in set $\nu$ , we can represent the introduced loss of the model as
+
+$$
+\mathcal { L } _ { c } ( M _ { k } ^ { 1 } ; \mathcal { V } ) = \sum _ { g \in \mathcal { V } } \sum _ { v _ { i } , v _ { j } \in \mathcal { V } _ { g } , v _ { i } \neq v _ { j } } s _ { i , j } \left. \mathbf { z } _ { k , i } ^ { 1 } - \mathbf { z } _ { k , j } ^ { 1 } \right. _ { 2 } ^ { 2 } ,
+$$
+
+where $\mathbf { z } _ { k , i } ^ { 1 }$ and $\mathbf { z } _ { k , j } ^ { 1 }$ denote the learned latent representation feature vectors of nodes $v _ { i } , v _ { j }$ in the sampled sub-network $g$ and $s _ { i , j }$ is defined based on $g$ in the same way as introduced before.
+
+The probability for each unit model to be picked as the parent model for the crossover and mutation operations can be represented as
+
+$$
+p ( M _ { k } ^ { 1 } ) = \frac { \exp ^ { - \mathcal { L } ( M _ { k } ^ { 1 } ; \mathcal { V } ) } } { \sum _ { M _ { i } ^ { 1 } \in \mathcal { M } ^ { 1 } } \exp ^ { - \mathcal { L } ( M _ { i } ^ { 1 } ; \mathcal { V } ) } } .
+$$
+
+In the real-world applications, a normalization of the loss terms among these unit models is necessary. For the unit model introducing a smaller loss, it will have a larger chance to be selected as the parent unit model. Considering that the crossover is usually done based a pair of parent models, we can represent the pairs of parent models selected from set $\mathcal { M } ^ { 1 }$ as $\mathcal { P } ^ { 1 } = \{ ( M _ { i } ^ { 1 } , \dot { M } _ { j } ^ { 1 } ) _ { k } \} _ { k \in \{ 1 , 2 , \cdots , m \} }$ , based on which we will be able to generate the next generation of unit models, i.e., $\mathcal { M } ^ { 2 }$ .
+
+# 4.2.5 UNIT MODEL CROSSOVER AND MUTATION
+
+For the $k _ { t h }$ pair of parent unit model $( M _ { i } ^ { 1 } , M _ { j } ^ { 1 } ) _ { k } \in \mathcal { P } ^ { 1 }$ , we can denote their genes as their variables $\theta _ { i } ^ { 1 } , \theta _ { j } ^ { 1 }$ respectively (since the differences among the unit models mainly lie in their variables), which are actually their chromosomes for crossover and mutation.
+
+Crossover: In this paper, we propose to adopt the uniform crossover to get the chromosomes (i.e., the variables) of their child model. Considering that the parent models $M _ { i } ^ { 1 }$ and $M _ { j } ^ { 1 }$ can actually achieve different performance on the validation set $\nu$ , in the crossover, the unit model achieving better performance should have a larger chance to pass its chromosomes to the child model.
+
+Formally, the chromosome inheritance probability for parent model $M _ { i } ^ { 1 }$ can be represented as
+
+$$
+p ( M _ { i } ^ { 1 } ) = \frac { \exp ^ { - \mathcal { L } ( M _ { i } ^ { 1 } ; \mathcal { V } ) } } { \exp ^ { - \mathcal { L } ( M _ { i } ^ { 1 } ; \mathcal { V } ) } + \exp ^ { - \mathcal { L } ( M _ { j } ^ { 1 } ; \mathcal { V } ) } }
+$$
+
+Meanwhile, the chromosome inheritance probability for model $M _ { j } ^ { 1 }$ can be denoted as $p ( M _ { j } ^ { 1 } ) = 1 - p ( M _ { i } ^ { 1 } )$ .
+
+In the uniform crossover method, based on parent model pair $( M _ { i } ^ { 1 } , M _ { j } ^ { 1 } ) _ { k } \in \mathcal { P } ^ { 1 }$ , we can represent the obtained child model chromosome vector as $\theta _ { k } ^ { 2 } \in \mathbb { R } ^ { | \theta ^ { 1 } | }$ (the superscript denotes the $2 _ { n d }$ generation and $| \theta ^ { 1 } |$ denotes the variable length), which is generated from the chromosome vectors $\mathbf { \bar { \boldsymbol { \theta } } } _ { i } ^ { 1 }$ and $\mathbf { \widetilde { \theta } } _ { j } ^ { 1 }$ of the parent models. Meanwhile, the crossover choice at each position of the chromosomes vector can be represented as a vector $\mathbf { c } \in \{ i , j \} ^ { | \theta ^ { 1 } | }$ . The entries in vector c are randomly selected from values in $\{ i , j \}$ with a probability $p ( M _ { i } ^ { 1 } )$ to pick value $i$ and a probability $p ( M _ { j } ^ { 1 } )$ to pick value $j$ respectively. The $l _ { t h }$ entry of vector $\theta _ { k } ^ { 2 }$ before mutation can be represented as
+
+$$
+\begin{array} { r } { \hat { \theta } _ { k } ^ { 2 } ( l ) = \mathbb { 1 } ( c ( l ) = i ) \cdot \theta _ { i } ^ { 1 } ( l ) + \mathbb { 1 } ( c ( l ) = j ) \cdot \theta _ { j } ^ { 1 } ( l ) , } \end{array}
+$$
+
+where indicator function $\mathbb { 1 } ( \cdot )$ returns value 1 if the condition is True; otherwise, it returns value 0.
+
+Mutation: The variables in the chromosome vector $\hat { \theta } _ { k } ^ { 2 } ( l ) \in \mathbb { R } ^ { | \theta ^ { 1 } | }$ are all real values, and some of them can be altered, which is also called mutation in traditional genetic algorithm. Mutation happens rarely, and the chromosome mutation probability is $\gamma$ in the GEN model. Formally, we can represent the mutation indicator vector as $\mathbf { m } \in \{ 0 , 1 \} ^ { d }$ , and the $l _ { t h }$ entry of vector $\theta _ { k } ^ { 2 }$ after mutation can be represented as
+
+$$
+\theta _ { k } ^ { 2 } ( l ) = \mathbb { 1 } \left( m ( l ) = 0 \right) \cdot \hat { \theta } _ { k } ^ { 2 } ( l ) + \mathbb { 1 } \left( c ( l ) = 1 \right) \cdot r a n d ( 0 , 1 ) ,
+$$
+
+where $r a n d ( 0 , 1 )$ denotes a random value selected from range $[ 0 , 1 ]$ . Formally, the chromosome vector $\theta _ { k } ^ { 2 }$ defines a new unit model with knowledge inherited form the parent models, which can be denoted as $M _ { k } ^ { 2 }$ . Based on the parent model set $\mathcal { P } ^ { 1 }$ , we can represent all the newly generated models as $\mathcal { M } ^ { 2 } = \big \{ M _ { k } ^ { 2 } \big \} _ { ( M _ { i } ^ { 1 } , M _ { j } ^ { 1 } ) _ { k } \in \mathcal { P } ^ { 1 } }$ , which will form the $2 _ { n d }$ generation of unit models.
+
+# 4.3 RESULT ENSEMBLE
+
+Based on the models introduced in the previous subsection, in this part, we will introduce the hierarchical result ensemble method, which involves two steps: (1) local ensemble of results for the sub-networks on each sampling strategies, and (2) global ensemble of results obtained across different sampling strategies.
+
+# 4.3.1 LOCAL ENSEMBLE
+
+Based on the sub-network pool $\mathcal { G }$ obtained via the sampling strategies introduced before, we have learned the $K _ { t h }$ generation of the GEN model $\bar { \mathcal { M } } ^ { K }$ (or $\mathcal { M }$ for simplicity), which contains $m$ unit models. In this part, we will introduce how to fuse the learned representations from each sub-networks with the unit models. Formally, given a sub-network $g \in { \mathcal { G } }$ with node set $\nu _ { g }$ , by applying unit model $M _ { j } \in \mathcal { M }$ to $g$ , we can represent the learned representation for node $v _ { q } \in \mathcal { V } _ { g }$ as vector ${ \bf z } _ { j , q }$ , where $q$ denotes the unique node index in the original complete network $G$ before sampling. For the nodes $v _ { p } \notin \mathcal { V } _ { g }$ , we can denote its representation vector $\mathbf { z } _ { j , p } = \mathbf { n u l l }$ , which denotes a dummy vector of length $d$ . Formally, we will be able represent the learned representation feature vector for node $v _ { q }$ as
+
+$$
+\mathbf { z } _ { q } = \bigcup _ { g \in \mathcal { G } , M _ { j } \in \mathcal { M } , } \mathbf { z } _ { j , q } ,
+$$
+
+where operator t denotes the concatenation operation of feature vectors.
+
+Considering that in the network sampling step, not all nodes will be selected in sub-networks. For the nodes $v _ { p } \notin \mathcal { V } _ { g } , \forall g \in$ $\mathcal { G }$ , we will not be able to learn its representation feature vector (or its representation will be filled with a list of dummy empty vector). Formally, we can represent these non-appearing nodes as set $\begin{array} { r } { \mathcal { V } _ { n } = \mathcal { V } \setminus \bigcup _ { g \in \mathcal { G } } \mathcal { V } _ { g } } \end{array}$ . In this paper, to compute the representation for these nodes, we propose to propagate the learned representation from their neighborhoods to them instead. Formally, given node $v _ { p } \in \mathcal { V } _ { n }$ and its neighbor set $\Gamma ( v _ { p } ) = \{ v _ { o } | \bar { v } _ { o } \in \mathcal { V } \wedge ( u , v _ { p } ) \in \mathcal { E } \}$ , if there exists node in $\Gamma ( v _ { p } )$ with non-empty representation feature vector, we can represent the propagated representation for $v _ { p }$ as
+
+$$
+\mathbf { z } _ { p } = \frac { 1 } { N } \sum _ { v _ { o } \in \Gamma ( v _ { p } ) } \mathbb { 1 } ( v _ { o } \notin \mathcal { V } _ { n } ) \cdot \mathbf { z } _ { o } ,
+$$
+
+where $\begin{array} { r } { N = \sum _ { v _ { o } \in \Gamma ( v _ { p } ) } \mathbb { 1 } ( v _ { o } \notin \mathcal { V } _ { n } ) } \end{array}$ . In the case that $\Gamma ( v _ { p } ) \subset \mathcal { V } _ { n }$ , random padding will be applied to get the representation vector $\mathbf { z } _ { p }$ for node $v _ { p }$ .
+
+# 4.3.2 GLOBAL ENSEMBLE
+
+Generally, these different network sampling strategies introduced at the beginning in Section 4.1 captures different local/global structures of the network, which will all be useful for the node representation learning. In the global result ensemble step, we propose to group these features together as the output.
+
+Formally, based on the BFS, Drepresentations for nodes (e.g., $v _ { q } \in \mathcal { V } ,$ biased node and biased edge sampling strategies, to d), we can denoted their representation feature vectors as ${ \bf z } _ { q } ^ { \mathrm { B F S } } , { \bf z } _ { q } ^ { \mathrm { D F S } } , { \bf z } _ { q } ^ { \mathrm { H S } } , { \bf z } _ { q } ^ { \mathrm { N S } }$ rnedand $\mathbf { z } _ { q } ^ { \mathrm { E S } }$ respectively. In the case that node $v _ { q }$ has never appeared in any sub-networks in any of the sampling strategies, its corresponding feature vector can be denoted as a dummy vector filled with 0s. In the global ensemble step, we propose to linearly sum the feature vectors to get the fuses representation $\bar { \mathbf { z } } _ { q }$ as follows:
+
+$$
+\bar { \mathbf { z } } _ { q } = \sum _ { i \in \{ \mathrm { B F S } , \mathrm { D F S } , \mathrm { H S } , \mathrm { N S } , \mathrm { E S } \} } w ^ { i } \cdot \mathbf { z } _ { q } ^ { i } .
+$$
+
+Learning of the weight parameters $w ^ { \mathrm { B F S } }$ , $w ^ { \mathrm { D F S } }$ , $w ^ { \mathrm { H S } }$ , $w ^ { \mathrm { N S } }$ and $w ^ { \mathrm { E S } }$ is feasible with the complete network structure, but it may introduce eequal value, i.e., $\bar { \mathbf { z } } _ { q }$ a time costs andis an average of $\mathbf { z } _ { q } ^ { \mathrm { B F S } } , \mathbf { \bar { z } } _ { q } ^ { \mathrm { D F S } } , \mathbf { z } _ { q } ^ { \mathrm { H S } } , \mathbf { z } _ { q } ^ { \mathrm { N S } }$ effiand $\mathbf { z } _ { q } ^ { \mathrm { E S } }$ cy SEGEN. In this paper, we will simply assign them withlearned with different sampling strategies.
+
+# 4.4 MODEL ANALYSIS
+
+In this section, we will analyze the proposed model SEGEN regarding its performance, running time and space cost, which will also illustrate the advantages of SEGEN compared with the other existing deep learning models.
+
+# 4.4.1 PERFORMANCE ANALYSIS
+
+Model SEGEN, in a certain sense, can also be called a “deep” model. Instead of stacking multiple hidden layers inside one single model like existing deep learning models, SEGEN is deep since the unit models in the successive generations are generated by a namely “evolutionary layer” which performs the validation, selection, crossover, and mutation operations connecting these generations. Between the generations, these “evolutionary operations” mainly work on the unit model variables, which allows the immigration of learned knowledge from generation to generation. In addition, via these generations, the last generation in SEGEN can also capture the overall patterns of the dataset. Since the unit models in different generations are built with different sampled training batches, as more generations are involved, the dataset will be samples thoroughly for learning SEGEN. There have been lots of research works done on analyzing the convergence, performance bounds of genetic algorithms Rudolph (1994), which can provide the theoretic foundations for SEGEN.
+
+Due to the difference in parent model selection, crossover, mutation operations and different sampled training batches, the unit models in the generations of SEGEN may perform quite differently. In the last step, SEGEN will effectively combine the learning results from the multiple unit models together. With the diverse results combined from these different learning models, SEGEN is able to achieve better performance than each of the unit models, which have been effectively demonstrated in Zhou et al. (2002).
+
+# 4.4.2 SPACE AND TIME COMPLEXITY ANALYSIS
+
+According the the model descriptions provided in Section 4, we summarize the key parameters used in SEGEN as follows, which will help analyze its space and time complexity.
+
+• Sampling: Original data size: $n$ . Sub-instance size: $n ^ { \prime }$ . Pool size: $p$ .
+
+• Learning: Generation number: $K$ . Population size: $m$ . Feature vector size: $d$ . Training/Validation batch size: $b$ .
+
+Here, we will use network structured data as an example to analyze the space and time complexity of the SEGEN model.
+
+Space Complexity: Given a large-scale network with $n$ nodes, the space cost required for storing the whole network in a matrix representation is $O ( n ^ { 2 } )$ . Meanwhile, via network sampling, we can obtain a pool of sub-networks, and the space required for storing these sub-networks takes $O \left( p ( n ^ { \prime } ) ^ { 2 } \right)$ . Generally, in application of SEGEN, $n ^ { \prime }$ can take very small number, e.g., 50, and $p$ can take value $\textstyle p = c \cdot { \frac { n } { n ^ { \prime } } }$ ( $c$ is a constant) so as to cover all the nodes in the network. In such a case, the space cost of SEGEN will be linear to $n$ , $O ( c n ^ { \prime } n )$ , which is much smaller than $O ( n ^ { 2 } )$ .
+
+Time Complexity: Depending on the specific unit models used in composing SEGEN, we can represent the introduced time complexity of learn one unit model with the original network with $n$ nodes as $O ( f ( n ) )$ , where $f ( n )$ is usually a highorder function. Meanwhile, for learning SEGEN on the sampled sub-networks with $n ^ { \prime }$ nodes, all the introduced time cost will be $O \left( K m ( b \cdot f ( n ^ { \prime } ) + d \cdot n ^ { \prime } ) \right)$ , where term $d \cdot n ^ { \prime }$ (an approximation to variable size) represents the cost introduced in the unit model crossover and mutation about the model variables. Here, by assigning $b$ with a fixed value $\textstyle b = c \cdot { \frac { n } { n ^ { \prime } } }$ , the time complexity of SEGEN will be reduced to $O \left( K m c { \frac { f ( n ^ { \prime } ) } { n ^ { \prime } } } \cdot n + K m d n ^ { \prime } \right)$ , which is linear to $n$ .
+
+Table 1: Representation Learning Experiment Results Comparison on Foursquare Network Dataset.
+
+
Network Recovery
AUC
Prec@500
Community Detection
Density
Silhouette
1
5
10
1
5
10
5
25
50
5
25
50
SEGEN(PS2)
0.909 (2)
0.909(2)
0.909 (2)
0.872 (2)
0.642 (3)
0.530 (3)1
SEGEN(PS3)
0.875 (2)
0.550 (2)
0.792(3)
0.353(2)
0.206 (2)
0.208 (3)
SEGEN(PS1)
0.817(6)
0.819(6)
0.818(6)
0.772 (5)
0.400(4)
0.266 (4)|
SEGEN(PS1)
0.792(6)
0.477(4)
0.742(4)
0.317(4)
0.188 (3)
0.156(5)
SEGEN-HS(PS2)
0.935(1)
0.936 (1)
0.936(1)
0.852 (4)
0.388(5)
0.000 (-)|
SEGEN-HS(PS3)
0.812(5)
0.385 (11)
0.705 (5)
0.252(10)
0.056(6)
0.166(4)
SEGEN-BFS(PS2)
0.860 (4)
0.859(4)
0.858(4)
0.428(10)
0.000(-)
0.000 (-)|
|SEGEN-BFS(PS3)
0.746(7)
0.425((8))
0.587(6)
0.206(11)
0.022(10)
0.108(6)
SEGEN-DFS(PS2) 0.881(3) 0.882 (3)
0.881(3)
0.965 (1)
0.814(2)
0.648 (2)|
| SEGEN-DFS(PS3)
0.860(4)
0.532(3)
0.436 (11)
0.280(9)
0.017(11)
-0.006 (11)
SEGEN-NS(PS2)
0.801 (7)
0.797(7)
0.797(7)
0.256(11)
0.002(10)
0.002 (9)
SEGEN-NS(PS3)
0.871(3)
0.425 (8)
0.824 (2)
0.327(3)
0.060 (5)
0.294 (2)
SEGEN-ES(PS2)
0.820 (5) 0.822 (5)
0.822 (5)
0.872 (2)
0.872(1)
0.872 (1))
SEGEN-ES(PS3)
0.948 (1)
0.933 (1)
0.924(1)
0.482 (1)
0.429 (1)
0.407(1)
LINE
0.536(9)
0.537(9)
0.537(9)
0.712 (6)
0.268 (9)
0.172 (7)1
LINE
0.695 (8)
0.443(6)
0.478(8)
0.311(5)
0.046(8)
0.082(8)
DEEPWALK
0.536(9) 0.537(9)
)0.537(9)
0.686 (9)
0.308(7)
0.184 (6))
DEEPWALK
0.695(8)
0.449 (5)
0.485(7)
0.311(5)
0.042 (9)
0.082(8)
NODE2VEC
0.538(8)
0.540(8)
0.539(8)
0.692(8)
0.299(8)
0.162(8)|
NODE2VEC
0.691(11)
0.419 (10)
0.469(9)
0.2978
0.066(4)
0.070(10)
HPE
0.536(9) 0.537(9) 0.537(9) 0.708(7)
0.354(6)
0.188(5))
HPE
0.695 (8)
0.431(7)
0.465 (10)
0.311(5)
0.051(7)
0.089(7)
+
+# 4.4.3 ADVANTAGES OVER DEEP LEARNING MODELS
+
+Compared with existing deep learning models based on the whole dataset, the advantages of SEGEN are summarized below:
+
+• Less Data for Unit Model Learning: For each unit model, which are of a “shallow” and “narrow” structure (shallow: less or even no hidden layers, narrow: based on sampled sub-instances with a much smaller size), which needs far less variables and less data for learning each unit model.
+• Less Computational Resources: Each unit model is of a much simpler structure, learning process of which consumes far less computational resources in both time and space costs.
+• Less Parameter Tuning: SEGEN can accept both deep (in a simpler version) and shallow learning models as the unit model, and the hyper-parameters can also be shared among the unit models, which will lead to far less hyper-parameters to tune in the learning process.
+• Sound Theoretic Explanation: The unit learning model, genetic algorithm and ensemble learning (aforementioned) can all provide the theoretic foundation for SEGEN, which will lead to sound theoretic explanation of both the learning result and the SEGEN model itself.
+
+# 5 EXPERIMENTS
+
+To test the effectiveness of the proposed model, extensive experiments will be done on several real-world network structured datasets, including social networks, images and raw feature representation datasets. In this section, we will first introduce the detailed experimental settings, covering experimental setups, comparison methods, evaluation tasks and metrics for the social network representation learning task. After that, we will show its convergence analysis, parameter analysis and the main experimental results of SEGEN on the social network datasets. Finally, we will provide the experiments SEGEN based on the image and raw feature representation datasets involving CNN and MLP as the unit models respectively.
+
+# 5.1 SOCIAL NETWORK DATASET EXPERIMENTAL SETTINGS
+
+# 5.1.1 EXPERIMENTAL SETUP
+
+The network datasets used in the experiments are crawled from two different online social networks, Twitter and Foursquare, respectively. The Twitter network dataset involves 5, 120 users and 130, 576 social connections among the user nodes. Meanwhile, the Foursquare network dataset contains 5, 392 users together with the 55, 926 social links connecting them. According to the descriptions of SEGEN, based on the complete input network datasets, a set of sub-networks are randomly sampled with network sampling strategies introduced in this paper, where the sub-network size is denoted as $n ^ { \prime }$ , and the pool size is controlled by $p$ . Based on the training/validation batches sampled sub-network pool, $K$ generations of unit models will be built in SEGEN, where each generation involves $m$ unit models (convergence analysis regarding parameter $K$ is available in Section 7.1.1). Finally, the learning results at the ending generation will be effectively combined to generate the ensemble output. For the nodes which have never been sampled in any sub-networks, their representations can be learned with the diffusive propagation from their neighbor nodes introduced in this paper. The learned results by SEGEN will be evaluated with two application tasks, i.e., network recovery and community detection respectively. The detailed parameters sensitivity analysis is also available in Section 7.1.2.
+
+# 5.1.2 COMPARISON METHODS
+
+The network representation learning comparison models used in this paper are listed as follows
+
+Table 2: Representation Learning Experiment Results Comparison on Twitter Network Dataset.
+
+
+
+• SEGEN: Model SEGEN proposed in this paper is based on the genetic algorithm and ensemble learning, which effectively combines the learned sub-network representation feature vectors from the unit models to generate the feature vectors of the whole network. • LINE: The LINE model is a scalable network embedding model proposed in Tang et al. (2015), which optimizes an objective function that preserves both the local and global network structures. LINE uses a edge-sampling algorithm to addresses the limitation of the classical stochastic gradient descent. DEEPWALK: The DEEPWALK model Perozzi et al. (2014) extends the word2vec model Mikolov et al. (2013) to the network embedding scenario. DEEPWALK uses local information obtained from truncated random walks to learn latent representations.
+• NODE2VEC: The NODE2VEC model Grover & Leskovec (2016) introduces a flexible notion of a node’s network neighborhood and design a biased random walk procedure to sample the neighbors for node representation learning.
+• HPE: The HPE model Chen et al. (2016) is originally proposed for learning user preference in recommendation problems, which can effectively project the information from heterogeneous networks to a low-dimensional space.
+
+# 5.1.3 EVALUATION TASKS AND METRICS
+
+The network representation learning results can hardly be evaluated directly, whose evaluations are usually based on certain application tasks. In this paper, we propose to use application tasks, network recovery and clustering, to evaluate the learned representation features from the comparison methods. Furthermore, the network recovery results are evaluated by metrics, like AUC and Precision $@ 5 0 0$ . Meanwhile the clustering results are evaluated by Density and Silhouette. Without specific remarks, the default parameter setting for SEGEN in the experiments will be Parameter Setting 1 (PS1): sub-network size: 10, pool size: 200, batch size: 10, generation unit model number: 10, generation number: 30.
+
+# 5.2 SOCIAL NETWORK DATASET EXPERIMENTAL RESULTS
+
+The model training convergence analysis, and detailed analysis about the pool sampling and model learning parameters is available in the Appendix in Section 7.1. Besides these analysis results, we also provide the performance analysis of SEGEN and baseline methods in Tables 1-2, where the parameter settings are specified next to the method name. We provide the rank of method performance among all the methods, which are denoted by the numbers in blue font, and the top 5 results are in a bolded font. As shown in the Tables, we have the network recovery and community detection results on the left and right sections respectively. For the network recovery task, we change the ratio of negative links compared with positive links with values $\{ 1 , 5 , 1 0 \}$ , which are evaluated by the metrics AUC and Prec $@ 5 0 0$ . For the community detection task, we change the number of clusters with values $\{ 5 , 2 5 , 5 0 \}$ , and the results are evaluated by the metrics Density and Silhouette.
+
+Besides PS1 introduced at the beginning of Section 5.1, we have 4 other parameter settings selected based on the parameter analysis introduced before. PS2 for network recovery on Foursquare: sub-network size 50, pool size 600, batch size 5, generation size 50. PS3 for community detection on Foursquare: sub-network size 25, pool size 300, batch size 35, generation size 5. PS4 for network recovery on Twitter: sub-network size 50, pool size 700, batch size 10, generation size 5. PS5 for community detection on Twitter: sub-network size 45, pool size 500, batch size 50, generation size 5.
+
+According to the results shown in Table 1, method SEGEN with PS2 can obtain very good performance for both the network recovery task and the community detection task. For instance, for the network recovery task, method SEGEN with PS2 achieves 0.909 AUC score, which ranks the second and only lose to SEGEN-HS with PS2; meanwhile, SEGEN with PS2 also achieves the second highest Prec $@ 5 0 0$ score (i.e., 0.872 for np-ratio $= 1$ ) and the third highest Prec $@ 5 0 0$ score (i.e., 0.642 and 0.530 for np-ratios 5 and 10) among the comparison methods. On the other hand, for the community detection task, SEGEN with PS3 can generally rank the second/third among the comparison methods for both density and silhouette evaluation metrics. For instance, with the cluster number is 5, the density obtained by SEGEN ranks the second among the methods, which loses to SEGEN-LS only. Similar results can be observed for the Twitter network as shown in Figure 2.
+
+Table 3: Experiments on MNIST Dataset.
+
+
Comparison Methods
Accuracy Rate%
SEGEN(CNN)
99.37
LeNet-5
99.05 Lecun et al. (1998)
gcForest
99.26 Zhou & Feng (2017b)
Deep Belief Net
98.75 Hinton et al. (2006)
Random Forest
96.8 Zhou & Feng (2017b)
SVM (rbf)
98.60 Decoste & Scholkopf (2002)
+
+Table 4: Experiments on Other Datasets.
+
+
Comparison Methods
Accuracy/Rate%onDatasets
YEAST
ADULT
LETTER
SEGEN (MLP)
63.70
87.05
96.90
MLP
62.05
85.03
96.70
gcForest
63.45
86.40
97.40
Random Forest
60.44
85.63
96.28
SVM (rbf)
40.76
76.41
97.06
kNN (k=3)
48.80
76.00
95.23
+
+By comparing SEGEN with SEGEN merely based on HS, BFS, DFS, NS, LS, we observe that the variants based on one certain type of sampling strategies can obtain relatively biased performance, i.e., good performance for the network recovery task but bad performance for the community detection task or the reverse. For instance, as shown in Figure 1, methods SEGEN with HS, BFS, DFS performs very good for the network recovery task, but its performance for the community detection ranks even after LINE, HPE and DEEPWALK. On the other hand, SEGEN with NS and LS is shown to perform well for the community detection task instead in Figure 1, those performance ranks around 7 for the network recovery task. For the Twitter network, similar biased results can be observed but the results are not identically the same. Model SEGEN combining these different sampling strategies together achieves relatively balanced and stable performance for different tasks. Compared with the baseline methods LINE, HPE, DEEPWALK and NODE2VEC, model SEGEN can obtain much better performance, which also demonstrate the effectiveness of SEGEN as an alternative approach for deep learning models on network representation learning.
+
+# 5.3 EXPERIMENTS ON OTHER DATASETS AND UNIT MODELS
+
+Besides the extended autoencoder model and the social network datasets, we have also tested the effectiveness of SEGEN on other datasets and with other unit models. In Table 3, we show the experimental results of SEGEN and other baseline methods on the MNIST hand-written image datasets. The dataset contains 60, 000 training instances and 10, 000 testing instances, where each instance is a $2 8 \times 2 8$ image with labels denoting their corresponding numbers. Convolutional Neural Network (CNN) is used as the unit model in SEGEN, which involves 2 convolutional layers, 2 max-pooling layers, and two fully connection layers (with a 0.2 dropout rate). ReLU is used as the activation function in CNN, and we adopt Adam as the optimization algorithm. Here, the images are of a small size and no sampling is performed, while the learning results of the best unit model in the ending generation (based on a validation batch) will be outputted as the final results. In the experiments, SEGEN (CNN) is compared with several classic methods (e.g., LeNet-5, SVM, Random Forest, Deep Belief Net) and state-of-the-art method (gcForest). According to the results, SEGEN (CNN) can outperform the baseline methods with great advantages. The Accuracy rate obtained by SEGEN is $9 9 . 3 7 \%$ , which is much higher than the other comparison methods.
+
+Meanwhile, in Table 4, we provide the learning results on three other benchmark datasets, including YEAST1, ADULT2 and LETTER3. These three datasets are in the traditional feature representations. Multi-Layer Perceptron (MLP) is used as the unit model in SEGEN for these three datasets. We cannot find one unified architecture of MLP, which works for all these three datasets. In the experiments, for the YEAST dataset, the MLP involves 1 input layer, 2 hidden layers and 1 output layers, whose neuron numbers are 8-64-16-10; for the ADULT, the MLP architecture contains the neurons 14-70- 50-2; for the LETTER dataset, the used MLP has 3 hidden layers with neurons 16-64-48-32-26 at each layer respectively. The Adam optimization algorithm with 0.001 learning rate is used to train the MLP model. For the ensemble strategy in these experiments, the best unit model is selected to generate the final prediction output. According to the results, compared with the baseline methods, SEGEN (MLP) can also perform very well with MLP on the raw feature representation datasets with great advantages, especially the YEAST and ADULT datasets. As to the LETTER dataset, SEGEN (MLP) only loses to gcForest, but can outperform the other methods consistently.
+
+# 6 CONCLUSION
+
+In this paper, we have introduced an alternative approach to deep learning models, namely SEGEN. Significantly different from the existing deep learning models, SEGEN builds a group of unit models generations by generations, instead of building one single model with extremely deep architectures. The choice of unit models covered in SEGEN can be either traditional machine learning models or the latest deep learning models with a “smaller” and “narrower” architecture. SEGEN has great advantages over deep learning models, since it requires much less training data, computational resources, parameter tuning efforts but provides more information about its learning and result integration process. The effectiveness of efficiency of SEGEN have been well demonstrated with the extensive experiments done on the real-world network structured datasets.
+
+REFERENCES
+E. Arisoy, T. Sainath, B. Kingsbury, and B. Ramabhadran. Deep neural network language models. In WLM, 2012.
+A. Bordes, N. Usunier, A. Garcia-Duran, J. Weston, and O. Yakhnenko. Translating embeddings for modeling multirelational data. In NIPS. 2013.
+S. Chang, W. Han, J. Tang, G. Qi, C. Aggarwal, and T. Huang. Heterogeneous network embedding via deep architectures. In KDD, 2015.
+C. Chen, M. Tsai, Y. Lin, and Y. Yang. Query-based music recommendations via preference embedding. In RecSys, 2016.
+T. Chen and Y. Sun. Task-guided and path-augmented heterogeneous network embedding for author identification. CoRR, abs/1612.02814, 2016.
+J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, Q. Le, M. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang, and A. Ng. Large scale distributed deep networks. In NIPS, 2012.
+D. Decoste and B. Scholkopf. Training invariant support vector machines. ¨ Mach. Learn., 2002.
+L. Deng, G. Hinton, and B. Kingsbury. New types of deep neural network learning for speech recognition and related applications: An overview. In ICASSP, 2013.
+I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook. org.
+A. Grover and J. Leskovec. Node2vec: Scalable feature learning for networks. In KDD, 2016.
+S. Hill. Elite and upper-class families. In Families: A Social Class Perspective. 2012.
+G. Hinton, S. Osindero, and Y. Teh. A fast learning algorithm for deep belief nets. Neural Comput., 2006.
+G. Hinton, L. Deng, D. Yu, G. Dahl, A. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. Sainath, and B. Kingsbury. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Processing Magazine, 2012.
+H. Jaeger. Tutorial on training recurrent neural networks, covering BPPT, RTRL, EKF and the “echo state network” approach. Technical report, Fraunhofer Institute for Autonomous Intelligent Systems (AIS), 2002.
+A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
+Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998.
+Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521, 2015. doi: 10.1038/nature14539. http://dx.doi. org/10.1038/nature14539.
+Y. Lin, Z. Liu, M. Sun, Y. Liu, and X. Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI, 2015.
+T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013.
+A. Mnih and G. Hinton. A scalable hierarchical distributed language model. In NIPS. 2009.
+B. Perozzi, R. Al-Rfou, and S. Skiena. Deepwalk: Online learning of social representations. In KDD, 2014.
+G. Rudolph. Convergence analysis of canonical genetic algorithms. IEEE Transactions on Neural Networks, 1994.
+R. Salakhutdinov and G. Hinton. Semantic hashing. International Journal of Approximate Reasoning, 2009.
+J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei. Line: Large-scale information network embedding. In WWW, 2015.
+P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 2010.
+D. Wang, P. Cui, and W. Zhu. Structural deep network embedding. In KDD, 2016.
+Z. Wang, J. Zhang, J. Feng, and Z. Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI, 2014.
+
+J. Weston, S. Bengio, and N. Usunier. Large scale image annotation: Learning to rank with joint word-image embeddings. Journal of Machine Learning, 2010.
+
+J. Weston, S. Bengio, and N. Usunier. Wsabie: Scaling up to large vocabulary image annotation. In IJCAI, 2011.
+
+Z. Zhou and J. Feng. Deep forest: Towards an alternative to deep neural networks. In IJCAI, 2017a.
+
+Z. Zhou and J. Feng. Deep forest: Towards an alternative to deep neural networks. In IJCAI, 2017b.
+
+Z. Zhou, J. Wu, and W. Tang. Ensembling neural networks: Many could be better than all. Artif. Intell., 2002.
+
+# 7 APPENDIX
+
+# 7.1 SOCIAL NETWORK DATASET EXPERIMENTAL ANALYSIS
+
+In this part, we will provide experimental analysis about the convergence and parameters of SEGEN, including the subnetwork size, the pool size, batch size and generation size respectively.
+7.1.1 CONVERGENCE ANALYSIS
+
+
+Figure 3: Convergence Analysis on Foursquare and Twitter.
+
+The learning process of SEGEN involves multiple generations. Before showing the experimental results, we will analyze how many generations will be required for achieving stable results. In Figure 3, we provide the introduced loss by the SEGEN on both Foursquare and Twitter networks, where the $\mathbf { X }$ axis denotes the generations and y axis represents the sum of introduced $\mathcal { L } _ { c }$ loss on the validation set based on all these 5 different sampling strategies. According to the results, model SEGEN can converge within less 30 generations for the network representation learning on both Foursquare and Twitter, which will be used as the max-generation number throughout the following experiments. 7.1.2 POOL SAMPLING AND MODEL LEARNING PARAMETER ANALYSIS
+
+
+Figure 4: Sampling Parameter Analysis on Foursquare and Twitter.
+
+In Figure 4, we show the sensitivity analysis about the network sampling parameters, i.e., sub-network size and th pool size, evaluated by AUC, Prec $@ 5 0 0$ , Density and Silhouette respectively, where Figures 4(a)-4(d) are about th
+
+Foursquare and Figures 4(e)-4(h) are about the Twitter network. The sub-network size parameter changes with values in $\{ 5 , 1 0 , 1 5 , \cdots , 5 0 \}$ and pool size changes with values in range $\{ 1 0 0 , 2 0 0 , \cdots , 1 0 0 0 \}$ .
+
+According to the plots, for the Foursquare network, larger sub-network size and larger pool size will lead to better performance in the network recovery task; meanwhile, smaller sub-network size will achiver better performance for the community detection task. For instance, SEGEN can achieve the best performance with sub-network size 50 and pool size 600 for the network recovery task; and SEGEN obtain the best performance with sub-network size 25 and pool size 300 for the community detection. For the Twitter network, the performance of SEGEN is relatively stable for the parameters analyzed, which has some fluctuations for certain parameter values. According to the results, the optimal sub-network and pool sizes parameter values for the network recovery task are 50 and 700 for the network recovery task; meanwhile, for the community detection task, the optimal parameter values are 45 and 500 respectively.
+
+
+Figure 5: Batch and Generation Size Parameter Analysis on Foursquare and Twitter.
+
+In Figure 5, we provide the parameter sensitivity analysis about the batch size and generation size (i.e., the number of uni models in each generation) on Foursquare and Twitter. We change the generation size and batch size both with values i $\{ 5 , 1 0 , 1 5 , \cdot \cdot \cdot , 5 0 \}$ , and compute the AUC, Prec $@ 5 0 0$ , Density and Silhouette scores obtained by SEGEN.
+
+According Figures 5(a)-5(d), batch size has no significant impact on the performance of SEGEN, and the generation size may affect SEGEN greatly, especially for the Prec $@ 5 0 0$ metric (the AUC obtained by SEGEN changes within range [0.81, 0.82] with actually minor fluctuation in terms of the values). The selected optimal parameter values selected for network recovery are 50 and 5 for generation and bath sizes. Meanwhile, for the community detection, SEGEN performs the best with smaller generation and batch size, whose optimal values are 5 and 35 respectively. For the Twitter network, the impact of the batch size and generation size is different from that on Foursquare: smaller generation size lead to better performance for SEGEN evaluated by Prec $@ 5 0 0$ . The fluctuation in terms of AUC is also minor in terms of the values, and the optimal values of the generation size and batch size parameters for the network recovery task are 5 and 10 respectively. For the community detection task on Twitter, we select generation size 5 and batch size 40 as the optimal value.
\ No newline at end of file
diff --git a/md/train/HJgXsjA5tQ/HJgXsjA5tQ.md b/md/train/HJgXsjA5tQ/HJgXsjA5tQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..89d44242221b0a888513266d9eb9a970a34d186d
--- /dev/null
+++ b/md/train/HJgXsjA5tQ/HJgXsjA5tQ.md
@@ -0,0 +1,549 @@
+# ON THE LOSS LANDSCAPE OF A CLASS OF DEEP NEURAL NETWORKS WITH NO BAD LOCAL VALLEYS
+
+Quynh Nguyen Saarland University, Germany
+
+Mahesh Chandra Mukkamala Saarland University, Germany
+
+Matthias Hein University of Tübingen, Germany
+
+# ABSTRACT
+
+We identify a class of over-parameterized deep neural networks with standard activation functions and cross-entropy loss which provably have no bad local valley, in the sense that from any point in parameter space there exists a continuous path on which the cross-entropy loss is non-increasing and gets arbitrarily close to zero. This implies that these networks have no sub-optimal strict local minima.
+
+# 1 INTRODUCTION
+
+It has been empirically observed in deep learning (Dauphin et al., 2014; Goodfellow et al., 2015) that the training problem of over-parameterized1 deep CNNs (LeCun et al., 1990; Krizhevsky et al., 2012) does not seem to have a problem with bad local minima. In many cases, local search algorithms like stochastic gradient descent (SGD) frequently converge to a solution with zero training error even though the training objective is known to be non-convex and potentially has many distinct local minima (Auer et al., 1996; Safran & Shamir, 2018). This indicates that the problem of training practical over-parameterized neural networks is still far from the worst-case scenario where the problem is known to be NP-hard (Blum & Rivest., 1989; Sima, 2002; Livni et al., 2014; ShalevShwartz et al., 2017). A possible hypothesis is that the loss landscape of these networks is“wellbehaved” so that it becomes amenable to local search algorithms like SGD and its variants. As not all neural networks have a well-behaved loss landscape, it is interesting to identify sufficient conditions on their architecture so that this is guaranteed. In this paper our motivation is to come up with such a class of networks in a practically relevant setting, that is we study multi-class problems with the usual empirical cross-entropy loss and deep (convolutional) networks and almost no assumptions on the training data, in particular no distributional assumptions. Thus our results directly apply to the networks which we use in the experiments.
+
+
+Figure 1: An example loss landscape with bad local valleys (left) and without bad local valley (right).
+
+Our contributions. We identify a family of deep networks with skip connections to the output layer whose loss landscape has no bad local valleys (see Figure 1 for an illustration). Our setting is for the empirical loss and there are no distributional assumptions on the training data. Moreover, we study directly the standard cross-entropy loss for multi-class problems. There are little assumptions on the network structure which can be arbitrarily deep and can have convolutional layers (weight sharing) and skip-connections between hidden layers. From a practical perspective, one can generate an architecture which fulfills our conditions by taking an existing CNN architecture and then adding skip-connections from a random subset of $N$ neurons ( $N$ is the number of training samples), possibly from multiple hidden layers, to the output layer (see Figure 2 for an illustration). For these networks we show that there always exists a continuous path from any point in parameter space on which the loss is non-increasing and gets arbitrarily close to zero. We note that this implies the loss landscape has no strict local minima, but theoretically non-strict local minima can still exist. Beside that, we show that the loss has also no local maxima.
+
+Beside the theoretical analysis, we show in experiments that despite achieving zero training error, the aforementioned class of neural networks generalize well in practice when trained with SGD whereas an alternative training procedure guaranteed to achieve zero training error has significantly worse generalization performance and is overfitting. Thus we think that the presented class of neural networks offer an interesting test bed for future work to study the implicit bias/regularization of SGD.
+
+# 2 DESCRIPTION OF NETWORK ARCHITECTURE
+
+We consider a family of deep neural networks which have $d$ input units, $H$ hidden units, $m$ output units and satisfy the following conditions:
+
+1. Every hidden unit of the first layer can be connected to an arbitrary subset of input units.
+2. Every hidden unit at higher layers can take as input an arbitrary subset of hidden units from (multiple) lower hidden layers.
+3. Any subgroup of hidden units lying on the same layer can have non-shared or shared weights, in the later case their number of incoming units have to be equal.
+4. There exist $N$ hidden units which are connected to the output nodes with independent weights ( $N$ denotes the number of training samples).
+5. The output of every hidden unit $j$ in the network, denoted as $f _ { j } : \mathbb { R } ^ { d } \mathbb { R }$ , is given as
+
+$$
+f _ { j } ( x ) = \sigma _ { j } \Bigl ( b _ { j } + \sum _ { k : k \to j } f _ { k } ( x ) u _ { k \to j } \Bigr )
+$$
+
+where $x \in \mathbb { R } ^ { d }$ is an input vector of the network, $\sigma _ { j } : \mathbb { R } \mathbb { R }$ is the activation function of unit $j$ , $b _ { j } \in \mathbb { R }$ is the bias of unit $j$ , and $u _ { k \to j } \in \mathbb { R }$ the weight from unit $k$ to unit $j$ .
+
+This definition covers a class of deep fully connected and convolutional neural networks with an additional condition on the number of connections to the output layer. In particular, while conventional architectures have just connections from the last hidden layer to the output, we require in our setting that there must exist at least $N$ neurons, “regardless” of their hidden layer, that are connected to the output layer. Essentially, this means that if the last hidden layer of a traditional network has just $L < N$ neurons then one can add connections from $N - L$ neurons in the hidden layers below it to the output layer so that the network fulfills our conditions.
+
+Similar skip-connections have been used in DenseNet (Huang et al., 2017) which are different from identity skip-connections as used in ResNets (He et al., 2016). In Figure 2 we illustrate a network with and without skip connections to the output layer which is analyzed in this paper. We note that several architectures like DenseNets Huang et al. (2017) already have skip-connections between hidden layers in their original architecture, whereas our special skip-connections go from hidden layers directly to the output layer. As our framework allow both kinds to exist in the same network (see Figure 2 for an example), we would like to separate them from each other by making the convention that in the following skip-connections, if not stated otherwise, always refer to ones which connect hidden neurons to output neurons.
+
+We denote by $d$ the dimension of the input and index all neurons in the network from the input layer to the output layer as $1 , 2 , \ldots , d , d + 1 , \ldots , d + H , d + H + 1 , \ldots , d + H + m$ which correspond to $d$ input units, $H$ hidden units and $m$ output units respectively. As we only allow directed arcs from lower layers to upper layers, it follows that $k \ < \ j$ for every $k j$ . Let $N$ be the number of training samples. Suppose that there are $M$ hidden neurons which are directly connected to the output with independent weights where it holds $N \leq M \leq H$ . Let $\{ p _ { 1 } , \hdots , p _ { M } \}$ with $p _ { j } \in \{ d + 1 , \ldots , d + H \}$ be the set of hidden units which are directly connected to the output units. Let $\mathrm { i n } ( j )$ be the set of incoming nodes to unit $j$ and $u _ { j } = [ u _ { k j } ] _ { k \in \mathrm { i n } ( j ) }$ the weight vector of the $j$ -th unit. Let $U = ( u _ { d + 1 } , \dots , u _ { d + H } , b _ { d + 1 } , \dots , b _ { d + H } )$ denote the set of all weights and biases of all hidden units in the network. Let $V \in \mathbb { R } ^ { M \times m }$ be the weight matrix which connects the $M$ hidden neurons to the $m$ output units of the network. An important quantity in the following is the matrix $\Psi \in \mathbb { R } ^ { N \times M }$ defined as
+
+
+Figure 2: Left: An example neural network represented as directed acyclic graph. Right: The same network with skip connections added from a subset of hidden neurons to the output layer. All neurons with the same color can have shared or non-shared weights.
+
+$$
+\Psi = \left[ \begin{array} { c c c } { { f _ { p _ { 1 } } ( x _ { 1 } ) } } & { { \ldots } } & { { f _ { p _ { M } } ( x _ { 1 } ) } } \\ { { \vdots } } & { { } } & { { \vdots } } \\ { { f _ { p _ { 1 } } ( x _ { N } ) } } & { { \ldots } } & { { f _ { p _ { M } } ( x _ { N } ) } } \end{array} \right]
+$$
+
+As $\Psi$ depends on $U$ , we write $\Psi _ { U }$ or $\Psi ( U )$ as a function of $U$ . Let $G \in \mathbb { R } ^ { N \times m }$ be the output of the network for all training samples. In particular, $G _ { i j }$ is the value of the $j$ -th output neuron for training sample $x _ { i }$ . It follows from our definition that
+
+$$
+G _ { i j } = \langle \Psi _ { i : } , V _ { : j } \rangle = \sum _ { k = 1 } ^ { M } f _ { p _ { k } } ( x _ { i } ) V _ { k j } , \quad \forall i \in [ N ] , j \in [ m ]
+$$
+
+Let $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N }$ be the training set where $y _ { i }$ denotes the target class for sample $x _ { i }$ . In the following we analyze the commonly used cross-entropy loss given as
+
+$$
+\Phi ( U , V ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } - \log \Big ( \frac { e ^ { G _ { i y _ { i } } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Big )
+$$
+
+We refer to Section $\textrm { C }$ in the appendix for extension of our results to general convex losses. The cross-entropy loss is bounded from below by zero but this value is not attained. In fact the global minimum of the cross-entropy loss need not exist e.g. if a classifier achieves zero training error then by upscaling the function to infinity one can drive the loss arbitrarily close to zero. Due to this property, we do not study the global minima of the cross-entropy loss but the question if and how one can achieve zero training error. Moreover, we note that sufficiently small cross-entropy loss implies zero training error as shown in the following lemma.
+
+Lemma 2.1 If $\begin{array} { r } { \Phi ( U , V ) < \frac { \log ( 2 ) } { N } } \end{array}$ , then the training error is zero.
+
+Proof: We note that if $\begin{array} { r } { \Phi ( U , V ) < \frac { \log ( 2 ) } { N } } \end{array}$ < log(2)N , then it holds due to the positivity of the loss,
+
+$$
+\operatorname* { m a x } _ { i = 1 , \dots , N } - \log \Big ( \frac { e ^ { G _ { i y _ { i } } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Big ) \leq \sum _ { i = 1 } ^ { N } - \log \Big ( \frac { e ^ { G _ { i y _ { i } } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Big ) < \log ( 2 ) .
+$$
+
+This implies that for all $i = 1 , \ldots , N$ ,
+
+$$
+\log \left( 1 + \sum _ { k \neq y _ { i } } e ^ { G _ { i k } - G _ { i y _ { i } } } \right) < \log ( 2 ) \quad \Longrightarrow \quad \sum _ { k \neq y _ { i } } e ^ { G _ { i k } - G _ { i y _ { i } } } < 1 .
+$$
+
+In particular: $\begin{array} { r } { \operatorname* { m a x } _ { k \neq y _ { i } } e ^ { G _ { i k } - G _ { i y _ { i } } } < 1 } \end{array}$ and thus $\begin{array} { r } { \operatorname* { m a x } _ { k \neq y _ { i } } G _ { i k } - G _ { i y _ { i } } < 0 } \end{array}$ for all $i = 1 , \ldots , N$ which implies the result.
+
+# 3 MAIN RESULT
+
+The following conditions are required for the main result to hold.
+
+Assumption 3.1 increasing
+
+1. All activation functions $\{ \sigma _ { d + 1 } , \ldots , \sigma _ { d + H } \}$ are real analytic and strictly
+
+2. Among $M$ neurons $\{ p _ { 1 } , \hdots , p _ { M } \}$ which are connected to the output units, there exist $N \leq M$ neurons, say w.l.o.g. $\{ p _ { 1 } , \dotsc , p _ { N } \}$ , such that one of the following conditions hold:
+
+• For every $1 \le j \le N : \sigma _ { p _ { j } }$ is bounded and $\begin{array} { r } { \operatorname* { l i m } _ { t - \infty } \sigma _ { p _ { j } } ( t ) = 0 } \end{array}$ • For every $1 \le j \le N : \sigma _ { p _ { j } }$ is the softplus activation (3), and there exists a backward path from $p _ { j }$ to the first hidden layer s.t. on this path there is no neuron which has skip-connections to the output or shared weights with other skip-connection neurons.
+
+3. The input patches of different training samples are distinct. In particular, let $n _ { 1 }$ be the number of units in the first hidden layer and denote by $S _ { i }$ for $i \in [ d + 1 , d + n _ { 1 } ]$ their input support, then for all $r \neq s \in [ N ]$ , and $i \in [ d + 1 , d + n _ { 1 } ]$ , it holds $x _ { r } | _ { S _ { i } } \neq x _ { s } | _ { S _ { i } }$ .
+
+The first condition of Assumption 3.1 is satisfied for softplus, sigmoid, tanh, etc, whereas the second condition is fulfilled for sigmoid and softplus. For softplus activation function (smooth approximation of ReLU),
+
+$$
+\sigma _ { \gamma } ( t ) = \frac { 1 } { \gamma } \log ( 1 + e ^ { \gamma t } ) , ~ \mathrm { f o r ~ s o m e } \gamma > 0 ,
+$$
+
+we require an additional assumption on the network architecture. The third condition is always satisfied for fully connected networks if the training samples are distinct. For CNNs, this condition means that the corresponding input patches across different training samples are distinct. This could be potentially violated if the first convolutional layer has very small receptive fields. However, if this condition is violated for the given training set then after an arbitrarily small random perturbation of all training inputs it will be satisfied with probability 1. Note that the $M$ neurons which are directly connected to the output units can lie on different hidden layers in the network. Also there is no condition on the width of every individual hidden layer as long as the total number of hidden neurons in the network is larger than $N$ so that our condition $M \geq N$ is feasible.
+
+Overall, we would like to stress that Assumption 3.1 covers a quite large class of interesting network architectures but nevertheless allows us to show quite strong results on their empirical loss landscape.
+
+The following key lemma shows that for almost all $U$ , the matrix $\Psi ( U )$ has full rank.
+
+Lemma 3.2 Under Assumption 3.1, the set of $U$ such that $\Psi ( U )$ has not full rank N has Lebesgue measure zero.
+
+Proof: (Proof sketch) Due to space limitation, we can only present below a proof sketch. We refer the reader to the appendix for the detailed proof. The proof consists of two main steps. First, we show that there exists $U$ s.t. the submatrix $\Psi _ { 1 : N , 1 : N }$ has full rank. By Assumption 3.1, all activation functions are real analytic, thus the determinant of $\Psi _ { 1 : N , 1 : N }$ is a real analytic function of the network parameters which $\Psi$ depends on. By the first result, this determinant function is not identically zero, thus Lemma A.1 shows that the set of $U$ for which $\Psi$ has not full rank has Lebesgue measure zero.
+
+Now we sketch the proof for the first step, that is to find a $U$ s.t. $\Psi$ has full rank. By Assumption 3.1.3, one can always choose the weight vectors of the first hidden layer so that every neuron at this layer has distinct values for different training samples. For higher neurons, we set their initial weight vectors to be unit vectors with exactly one 1 and 0 elsewhere. Note that the above construction of weights can be easily done so that all the neurons from the same layer and with the same number of incoming units can have shared/unshared weights according to our description of network architecture in Section 2. Let $c ( j )$ be the neuron below $j$ s.t. $u _ { c ( j ) j } = 1$ . To find $U$ , we are going to scale up each weight vector $u _ { j }$ by a positive scalar $\alpha _ { j }$ . The idea is to show that the determinant of $\Psi _ { 1 : N , 1 : N }$ is non-zero for some positive value of $\{ \alpha _ { j } \}$ . The biases can be chosen in such a way that the following holds for some $\beta \in \mathbb { R }$ ,
+
+$$
+\Psi _ { i j } = f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \Big ( \beta + \alpha _ { p _ { j } } \big ( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \big ) \Big ) \quad \forall j \in [ N ]
+$$
+
+where $f _ { c ( p _ { j } ) } ( \boldsymbol { x } ) = \sigma _ { c ( p _ { j } ) } ( \alpha _ { c ( p _ { j } ) } \sigma _ { c ( c ( p _ { j } ) ) } ( \ldots f _ { q _ { j } } ( \boldsymbol { x } ) \ldots ) )$ with $q _ { j }$ being the index of some neuron in the first hidden layer. Note that by our construction the value of unit $q _ { j }$ is distinct at different training samples, and thus it follows from the strict monotonic property of activation functions from Assumption 3.1 and the positivity of $\big \{ \alpha _ { c ( p _ { j } ) } , . . . \big \}$ that $f _ { c ( p _ { j } ) } ( x _ { i } ) \ne f _ { c ( p _ { j } ) } ( x _ { j } )$ for every $i \neq j$ . Next, we show that the set of training samples can be re-ordered in such a way that it holds $f _ { c ( p _ { j } ) } ( x _ { i } ) < f _ { c ( p _ { j } ) } ( x _ { j } )$ for every $i > j$ . Note that this re-ordering does not affect the rank of $\Psi$ Now, the intuition is that if one let $\alpha _ { p _ { j } }$ go to infinity then $\Psi _ { i j }$ converges to zero for $i > j$ because it holds for all activations from Assumption 3.1 that $\begin{array} { r } { \operatorname* { l i m } _ { t - \infty } \sigma _ { p _ { j } } ( t ) = 0 } \end{array}$ . Thus the determinant of $\Psi _ { 1 : 1 , 1 : N }$ converges to $\begin{array} { r } { \prod _ { i = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) } \end{array}$ which can be chosen to be non-zero by a predefined value of $\beta$ in which case $\Psi$ will have full rank. The detailed proof basically will show how to choose the specific values of $\{ \alpha _ { j } \}$ so that all the above criteria are met. In particular, it is important to make sure that the weight vectors of two neurons ${ j , j ^ { \prime } }$ from the same layer will be scaled by the same factor $\alpha _ { j } = \alpha _ { j \prime }$ as we want to maintain any potential weight-sharing conditions. The choice of activation functions from the second condition of Assumption 3.1 basically determines how the values of $\alpha$ should be chosen.
+
+While we conjecture that the result of Lemma 3.2 holds for softplus activation function without the additional condition as mentioned in Assumption 3.1, the proof of this is considerably harder for such a general class of neural networks since one has to control the output of neurons with skip connection from different layers which depend on each other. However, please note that the condition is also not too restrictive as it just might require more connections from lower layers to upper layers but it does not require that the network is wide. Before presenting our main result, we first need a formal definition of bad local valleys.
+
+Definition 3.3 The $\alpha$ -sublevel set of $\Phi$ is defined as $L _ { \alpha } = \{ ( U , V ) \mid \Phi ( U , V ) < \alpha \}$ . A local valley is defined as a connected component of some sublevel set $L _ { \alpha }$ . A bad local valley is a local valley on which the loss function $\Phi$ cannot be made “arbitrarily small”.
+
+Intuitively, a typical example of a bad local valley is a small neighborhood around a sub-optimal strict local minimum. We are now ready to state our main result.
+
+Theorem 3.4 The following holds under Assumption 3.1:
+
+1. There exist uncountably many solutions with zero training error.
+
+2. The loss landscape of $\Phi$ does not have any bad local valley.
+
+3. There exists no suboptimal strict local minimum.
+
+4. There exists no local maximum.
+
+# Proof:
+
+1. By Lemma 3.2 the set of $U$ such that $\Psi ( U )$ has not full rank $N$ has Lebesgue measure zero. Given $U$ such that $\Psi$ has full rank, the linear system $\Psi ( U ) V = Y$ has for every possible target output matrix $Y \in \mathbb { R } ^ { N \times m }$ at least one solution $V$ . As this is possible for almost all $U$ , there exist uncountably many solutions achieving zero training error.
+
+2. Let $C$ be a non-empty, connected component of some $\alpha$ -sublevel set $L _ { \alpha }$ for $\alpha > 0$ . Suppose by contradiction that the loss on $C$ cannot be made arbitrarily small, that is there exists an $\epsilon > 0$ such that $\Phi ( U , V ) ~ \ge ~ \epsilon$ for all $( U , V ) \in C$ , where $\epsilon \ < \ \alpha$ . By definition, $L _ { \alpha }$ can be written as the pre-image of an open set under a continuous function, that is $L _ { \alpha } = \Phi ^ { - 1 } ( \{ a \mid a < \alpha \} )$ , and thus $L _ { \alpha }$ must be an open set (see Proposition A.2). Since $C$ is a non-empty connected component of $L _ { \alpha }$ , $C$ must be an open set as well, and thus $C$ has non-zero Lebesgue measure. By Lemma 3.2 the set of $U$ where $\Psi ( U )$ has not full rank has measure zero and thus $C$ must contain a point $( U , V )$ such that $\Psi ( U )$ has full rank. Let $Y$ be the usual zero-one one-hot encoding of the target network output. As $\Psi ( U )$ has full rank, there always exist $V ^ { * }$ such that $\Psi ( U ) V ^ { * } = Y t ^ { * }$ , where $\begin{array} { r } { t ^ { * } = \log \left( \frac { m - 1 } { e ^ { \frac { \epsilon } { 2 } } - 1 } \right) } \end{array}$ Note that the loss of $( U , V ^ { * } )$ is
+
+$$
+\Phi ( U , V ^ { * } ) = - \log \Big ( \frac { e ^ { t ^ { * } } } { e ^ { t ^ { * } } + ( m - 1 ) } \Big ) = \log ( 1 + ( m - 1 ) e ^ { - t ^ { * } } ) = \frac { \epsilon } { 2 } .
+$$
+
+As the cross-entropy loss $\Phi ( U , V )$ is convex in $V$ and $\Phi ( U , V ) < \alpha$ we have for the line segment $V ( \lambda ) = \lambda V + ( 1 - \lambda ) V ^ { * }$ for $\lambda \in [ 0 , 1 ]$ ,
+
+$$
+\Phi ( U , V ( \lambda ) ) \le \lambda \Phi ( U , V ) + ( 1 - \lambda ) \Phi ( U , V ^ { * } ) < \lambda \alpha + ( 1 - \lambda ) \frac { \epsilon } { 2 } < \alpha .
+$$
+
+Thus the whole line segment is contained in $L _ { \alpha }$ and as $C$ is a connected component it has to be contained in $C$ . However, this contradicts the assumption that for all $( U , V ) \in C$ it holds $\Phi ( U , V ) \ge \epsilon$ . Thus on every connected component $C$ of $L _ { \alpha }$ the training loss can be made arbitrarily close to zero and thus the loss landscape has no bad valleys.
+
+3. Let $( U _ { 0 } , V _ { 0 } )$ be a strict suboptimal local minimum, then there exists $r > 0$ such that $\Phi ( U , V ) > \Phi ( U _ { 0 } , V _ { 0 } ) > 0$ for all $( U , V ) \in { \cal B } ( ( U _ { 0 } , V _ { 0 } ) , r ) \ : \backslash \ : \{ ( U _ { 0 } , V _ { 0 } ) \}$ where $B ( \cdot , r )$ denotes a closed ball of radius $r$ . Let $\begin{array} { r } { \alpha = \operatorname* { m i n } _ { ( U , V ) \in \partial B \big ( ( U _ { 0 } , V _ { 0 } ) , r \big ) } \Phi ( U , V ) } \end{array}$ which exists as $\Phi$ is continuous and the boundary $\partial B \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ of $B \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ is compact. Note that $\alpha > \Phi ( U _ { 0 } , V _ { 0 } )$ as $( U _ { 0 } , V _ { 0 } )$ is a strict local minimum. Consider the sub-level set $D = L _ { \frac { \alpha + \Phi ( U _ { 0 } , V _ { 0 } ) } { 2 } }$ . As ent o $\begin{array} { r } { \Phi ( U _ { 0 } , V _ { 0 } ) < \frac { \alpha + \Phi ( U _ { 0 } , V _ { 0 } ) } { 2 } } \end{array}$ α+Φ(U0,V0) it holds (U0, V0) ∈ D. Let E be the , that i t holds $D$ $( U _ { 0 } , V _ { 0 } )$ $( U _ { 0 } , V _ { 0 } ) \in E \subseteq D$ $E \subset B { \big ( } ( U _ { 0 } , V _ { 0 } ) , r { \big ) }$ as $\begin{array} { r } { \Phi ( U , V ) < \frac { \alpha + \Phi ( U _ { 0 } , V _ { 0 } ) } { 2 } < \alpha } \end{array}$ α+Φ(U0,V0) < α for all (U, V ) ∈ E. Moreover, $\Phi ( U , V ) \ge \Phi ( U _ { 0 } , V _ { 0 } ) > 0$ for all $( U , V ) \in E$ and thus $\Phi$ can not be made arbitrarily small on a connected component of a sublevel set of $\Phi$ and thus $E$ would be a bad local valley which contradicts 3.3.2.
+
+4. Suppose by contradiction that $( U , V )$ is a local maximum. Then the Hessian of $\Phi$ is negative semi-definite. However, as principal submatrices of negative semi-definite matrices are again negative semi-definite, then also the Hessian of $\Phi$ w.r.t $V$ must be negative semidefinite. However, $\Phi$ is always convex in $V$ and thus its Hessian restricted to $V$ is positive semi-definite. The only matrix which is both p.s.d. and n.s.d. is the zero matrix. It follows that $\nabla _ { V } ^ { 2 } \Phi ( U , V ) = 0$ . One can easily show that
+
+$$
+\nabla _ { V _ { : j } } ^ { 2 } \Phi = \sum _ { i = 1 } ^ { N } \frac { e ^ { G _ { i j } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Bigl ( 1 - \frac { e ^ { G _ { i j } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Bigr ) \Psi _ { i : } \Psi _ { i : } ^ { T }
+$$
+
+From Assumption 3.1 it holds that there exists $j \in [ N ]$ s.t. $\sigma _ { p _ { j } }$ is strictly positive, and thus some entries of $\Psi _ { i }$ : must be strictly positive. Moreover, one has ${ \frac { e ^ { G _ { i j } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } } \in ( 0 , 1 )$ . It follows that some entries of $\nabla _ { V : j } ^ { 2 } \Phi$ must be strictly positive. Thus $\nabla _ { V : j } ^ { 2 } \Phi$ cannot be identically zero, leading to a contradiction. Therefore $\Phi$ has no local maximum.
+
+Theorem 3.4 shows that there are infinitely many solutions which achieve zero training error, and the loss landscape is nice in the sense that from any point in the parameter space there exists a continuous path that drives the loss arbitrarily close to zero (and thus a solution with zero training error) on which the loss is non-increasing.
+
+While the networks are over-parameterized, we show in the next Section 4 that the modification of standard networks so that they fulfill our conditions leads nevertheless to good generalization performance, often even better than the original network. We would like to note that the proof of Theorem 3.4 also suggests a different algorithm to achieve zero training error: one initializes all weights, except the weights to the output layer, randomly (e.g. Gaussian weights), denoted as $U$ , and then just solves the linear system $\Psi ( U ) V = Y$ to obtain the weights $V$ to the output layer. Basically, this algorithm uses the network as a random feature generator and fits the last layer directly to achieve zero training error. The algorithm is successful with probability 1 due to Lemma 3.2. Note that from a solution with zero training error one can drive the cross-entropy loss to zero by upscaling to infinity but this does not change the classifier. We will see, that this simple algorithm shows bad generalization performance and overfitting, whereas training the full network with SGD leads to good generalization performance. This might seem counter-intuitive as our networks have more parameters than the original networks but is inline with recent observations in Zhang et al. (2017) that state-of-the art networks, also heavily over-parameterized, can fit even random labels but still generalize well on the original problem. Due to this qualitative difference of SGD and the simple algorithm which both are able to find solutions with zero training error, we think that our class of networks is an ideal test bed to study the implicit regularization/bias of SGD, see e.g. Soudry et al. (2018).
+
+# 4 EXPERIMENTS
+
+The main purpose of this section is to investigate the generalization ability of practical neural networks with skip-connections added to the output layer to fulfill Assumption 3.1.
+
+Datasets. We consider MNIST and CIFAR10 datasets. MNIST contains $5 . 5 \times 1 0 ^ { 4 }$ training samples and $1 0 ^ { 4 }$ test samples, and CIFAR10 has $5 \times 1 0 ^ { 4 }$ training samples and $1 0 ^ { 4 }$ test samples. We do not use any data pre-processing nor data-augmentation in all of our experiments.
+
+Network architectures. For MNIST, we use a plain CNN architecture with 13 layers, denoted as CNN13 (see Table 3 in the appendix for more details about this architecture). For CIFAR10 we use VGG11, VGG13, VGG16 (Simonyan & Zisserman, 2015) and DenseNet121 (Huang et al., 2017). As the VGG models were originally proposed for ImageNet and have very large fully connected layers, we adapted these layers for CIFAR10 by reducing their width from 4096 to 128. For each given network, we create the corresponding skip-networks by adding skip-connections to the output so that our condition $M \geq N$ from the main theorem is satisfied. In particular, we aggregate all neurons of all the hidden layers in a pool and randomly choose from there a subset of $N$ neurons to be connected to the output layer (see e.g. Figure 2 for an illustration). As existing network architectures have a large number of feature maps per layer, the total number of neurons is often very large compared to number of training samples, thus it is easy to choose from there a subset of $N$ neurons to connect to the output. In the following, we test both sigmoid and softplus activation function $( \gamma = 2 0 )$ ) for each network architecture and their skip-variants. We use the standard cross-entropy loss and train all models with SGD+Nesterov momentum for 300 epochs. The initial learning rate is set to 0.1 for Densenet121 and 0.01 for the other architectures. Following Huang et al. (2017), we also divide the learning rate by 10 after $5 0 \%$ and $7 5 \%$ of the total number of training epochs. Note that we do not use any explicit regularization like weight decay or dropout.
+
+The main goal of our experiments is to investigate the influence of the additional skip-connections to the output layer on the generalization performance. We report the test accuracy for the original models and the ones with skip-connections to the output layer. For the latter one we have two different algorithms: standard SGD for training the full network as described above (SGD) and the randomized procedure (rand). The latter one uses a slight variant of the simple algorithm described at the end of the last section: randomly initialize the weights of the network $U$ up to the output layer by drawing each of them from a truncated Gaussian distribution with zero mean and variance $\textstyle { \frac { 2 } { d } }$ where $d$ is the number of weight parameters and the truncation is done after $\pm 2$ standard deviations (standard keras initialization), then use SGD to optimize the weights $V$ for a linear classifier with fixed features $\Psi ( U )$ which is a convex optimization problem.
+
+Our experimental results are summarized in Table 1 for MNIST and Table 2 for CIFAR10. For skip-models, we report mean and standard deviation over 8 random choices of the subset of $N$ neurons connected to the output.
+
+Discussion of results. First of all, we note that adding skip connections to the output improves the test accuracy in almost all networks (with the exception of Densenet121) when the full network is
+
+
Sigmoid activation function
Softplus activation function
CNN13
11.35
99.20
CNN13-skip (SGD)
98.40 ± 0.07
99.14 ± 0.04
+
+Table 1: Test accuracy $( \% )$ of CNN13 on MNIST dataset. CNN13 denotes the original architecture from Table 3 while CNN13-skip denotes the corresponding skip-model. There are in total 179, 840 hidden neurons from the original CNN13 (see Table 3), out of which we choose a random subset of $N = 5 5$ , 000 neurons to connect to the output layer to obtain CNN13-skip.
+
+Table 2: Traning and test accuracy of several CNN architectures with/without skip-connections on CIFAR10 (no data-augmentation). For each original model A, A-skip denotes the corresponding skip-model in which a subset of $N$ hidden neurons “randomly selected” from the hidden layers are connected to the output units. For Densenet121, these neurons are randomly chosen from the first dense block. The names in open brackets (rand/SGD) specify how the networks are trained: rand $U$ is randomized and fixed while $V$ is learned with SGD), SGD (both $U$ and $V$ are optimized with SGD). Additional experimental results with data-augmentation are shown in Table 5 in the appendix.
+
+
+
+trained with SGD. In particular, for the sigmoid activation function the skip connections allow for all models except Densenet121 to get reasonable performance whereas training the original model fails. This effect can be directly related to our result of Theorem 3.4 that the loss landscape of skip-networks has no bad local valley and thus it is not difficult to reach a solution with zero training error (see Section F in the appendix for more detailed discussions on this issue, as well as Section E for a visual example which shows why the skip-models can succeed while the original models fail). The exception is Densenet121 which gets already good performance for the sigmoid activation function for the original model. We think that the reason is that the original Densenet121 architecture has already quite a lot of skip-connections between the hidden layers which thus improves the loss surface already so that the additional connections added to the output units are not necessary anymore.
+
+The second interesting observation is that we do not see any sign of overfitting for the SGD version even though we have increased for all models the number of parameters by adding skip connections to the output layer and we know from Theorem 3.4 that for all the skip-models one can easily achieve zero training error. This is in line with the recent observation of Zhang et al. (2017) that modern heavily over-parameterized networks can fit everything (random labels, random input) but nevertheless generalize well on the original training data when trained with SGD. This is currently an active research area to show that SGD has some implicit bias (Neyshabur et al., 2017; Brutzkus et al., 2018; Soudry et al., 2018) which leads to a kind of regularization effect similar to the linear least squares problem where SGD converges to the minimum norm solution. Our results confirm that there is an implicit bias as we see a strong contrast to the (skip-rand) results obtained by using the network as a random feature generator and just fitting the connections to the output units (i.e. $V$ ) which also leads to solutions with zero training error with probability 1 as shown in Lemma 3.2 and the proof of Theorem 3.4. For this version we see that the test accuracy gets worse as one is moving from simpler networks (VGG11) to more complex ones (VGG16 and Densenet121) which is a sign of overfitting. Thus we think that our class of networks is also an interesting test bed to understand the implicit regularization effect of SGD. It seems that SGD selects from the infinite pool of solutions with zero training error one which generalizes well, whereas the randomized feature generator selects one with much worse generalization performance.
+
+# 5 RELATED WORK
+
+In the literature, many interesting theoretical results have been developed on the loss surface of neural networks Yu & Chen (1995); Haeffele & Vidal (2017); Choromanska et al. (2015); Kawaguchi (2016); Safran & Shamir (2016); Hardt & Ma (2017); Yun et al. (2017); Lu & Kawaguchi (2017); Venturi et al. (2018); Liang et al. (2018b); Zhang et al. (2018); Nouiehed & Razaviyayn (2018). The behavior of SGD for the minimization of training objective has been also analyzed for various settings (Andoni et al., 2014; Sedghi & Anandkumar, 2015; Janzamin et al., 2016; Gautier et al., 2016; Brutzkus & Globerson, 2017; Soltanolkotabi, 2017; Soudry & Hoffer, 2017; Zhong et al., 2017; Tian, 2017; Du et al., 2018; Wang et al., 2018) to name a few. Most of current results are however limited to shallow networks (one hidden layer), deep linear networks and/or making simplifying assumptions on the architecture or the distribution of training data. An interesting recent exception is Liang et al. (2018a) where they show that for binary classification one neuron with a skip-connection to the output layer and exponential activation function is enough to eliminate all bad local minima under mild conditions on the loss function. More closely related in terms of the setting are (Nguyen & Hein, 2017; 2018) where they study the loss surface of fully connected and convolutional networks if one of the layers has more neurons than the number of training samples for the standard multi-class problem. However, the presented results are stronger as we show that our networks do not have any suboptimal local valley or strict local minima and there is less over-parameterization if the number of classes is small.
+
+# 6 CONCLUSION
+
+We have identified a class of deep neural networks whose loss landscape has no bad local valleys. While our networks are over-parameterized and can easily achieve zero training error, they generalize well in practice when trained with SGD. Interestingly, a simple different algorithm using the network as random feature generator also achieves zero training error but has significantly worse generalization performance. Thus we think that our class of models is an interesting test bed for studying the implicit regularization effect of SGD.
+
+# REFERENCES
+
+A. Andoni, R. Panigrahy, G. Valiant, and L. Zhang. Learning polynomials with neural networks. ICML, 2014.
+T. M. Apostol. Mathematical analysis. Addison Wesley, 1974.
+P. Auer, M. Herbster, and M. K. Warmuth. Exponentially many local minima for single neurons. NIPS, 1996.
+A. Blum and R. L Rivest. Training a 3-node neural network is np-complete. NIPS, 1989.
+A. Brutzkus and A. Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. ICML, 2017.
+A. Brutzkus, A. Globerson, E. Malach, and S. Shalev-Shwartz. Sgd learns over-parameterized networks that provably generalize on linearly separable data. ICLR, 2018.
+A. Choromanska, M. Hena, M. Mathieu, G. B. Arous, and Y. LeCun. The loss surfaces of multilayer networks. AISTATS, 2015.
+Y. Dauphin, R. Pascanu, C. Gulcehre, K. Cho, S. Ganguli, and Y. Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. NIPS, 2014.
+S. Du, J. Lee, Y. Tian, A. Singh, and B. Póczos. Gradient descent learns one-hidden-layer cnn: Don’t be afraid of spurious local minima. ICML, 2018.
+A. Gautier, Q. Nguyen, and M. Hein. Globally optimal training of generalized polynomial neural networks with nonlinear spectral methods. NIPS, 2016.
+X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. ICML, 2010.
+I. J. Goodfellow, O. Vinyals, and A. M. Saxe. Qualitatively characterizing neural network optimization problems. ICLR, 2015.
+B. D. Haeffele and R. Vidal. Global optimality in neural network training. CVPR, 2017.
+M. Hardt and T. Ma. Identity matters in deep learning. ICLR, 2017.
+K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CVPR, 2016.
+G. Huang, Z. Liu, L. Maaten, and K. Weinberger. Densely connected convolutional networks. CVPR, 2017.
+M. Janzamin, H. Sedghi, and A. Anandkumar. Beating the perils of non-convexity: Guaranteed training of neural networks using tensor methods. arXiv:1506.08473, 2016.
+K. Kawaguchi. Deep learning without poor local minima. NIPS, 2016.
+A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. NIPS, 2012.
+Y. LeCun, B. Boser, J.S. Denker, D. Henderson, R.E. Howard, W. Hubbard, and L.D. Jackel. Handwritten digit recognition with a back-propagation network. NIPS, 1990.
+H. Li, Z. Xu, G. Taylor, C. Studer, and T. Goldstein. Visualizing the loss landscape of neural nets. In ICLR Workshop, 2018.
+S. Liang, R. Sun, J. D. Lee, and R. Srikant. Adding one neuron can eliminate all bad local minima. arXiv:1805.08671, 2018a.
+S. Liang, R. Sun, Y. Li, and R. Srikant. Understanding the loss surface of neural networks for binary classification. In ICML, 2018b.
+R. Livni, S. Shalev-Shwartz, and O. Shamir. On the computational efficiency of training neural networks. NIPS, 2014.
+H. Lu and K. Kawaguchi. Depth creates no bad local minima. arXiv:1702.08580, 2017.
+B. Mityagin. The zero set of a real analytic function. arXiv:1512.07276, 2015.
+B. Neyshabur, S. Bhojanapalli, D. McAllester, and N. Srebro. Exploring generalization in deep learning. NIPS, 2017.
+Q. Nguyen and M. Hein. The loss surface of deep and wide neural networks. ICML, 2017.
+Q. Nguyen and M. Hein. Optimization landscape and expressivity of deep cnns. ICML, 2018.
+V. D. Nguyen. Complex powers of analytic functions and meromorphic renormalization in qft. arXiv:1503.00995, 2015.
+M. Nouiehed and M. Razaviyayn. Learning deep models: Critical points and local openness. ICLR Workshop, 2018.
+I. Safran and O. Shamir. On the quality of the initial basin in overspecified networks. ICML, 2016.
+I. Safran and O. Shamir. Spurious local minima are common in two-layer relu neural networks. ICML, 2018.
+H. Sedghi and A. Anandkumar. Provable methods for training neural networks with sparse connectivity. ICLR Workshop, 2015.
+S. Shalev-Shwartz, O. Shamir, and S. Shammah. Failures of gradient-based deep learning. ICML, 2017.
+J. Sima. Training a single sigmoidal neuron is hard. Neural Computation, 14:2709–2728, 2002.
+K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. ICLR, 2015.
+M. Soltanolkotabi. Learning relus via gradient descent. NIPS, 2017.
+D. Soudry and E. Hoffer. Exponentially vanishing sub-optimal local minima in multilayer neural networks. ICLR Workshop 2018, 2017.
+D. Soudry, E. Hoffer, M. S. Nacson, and N. Srebro. The implicit bias of gradient descent on separable data. ICLR, 2018.
+Y. Tian. An analytical formula of population gradient for two-layered relu network and its applications in convergence and critical point analysis. ICML, 2017.
+L. Venturi, A. S. Bandeira, and J. Bruna. Spurious valleys in two-layer neural network optimization landscapes. arXiv:1802.06384, 2018.
+G. Wang, G. B. Giannakis, and J. Chen. Learning relu networks on linearly separable data: Algorithm, optimality, and generalization. arXiv:1808.04685, 2018.
+X. Yu and G. Chen. On the local minima free condition of backpropagation learning. IEEE Transaction on Neural Networks, 6:1300–1303, 1995.
+C. Yun, S. Sra, and A. Jadbabaie. Global optimality conditions for deep neural networks. ICLR, 2017.
+S. Zagoruyko and N. Komodakis. Wide residual networks. BMCV, 2016.
+C. Zhang, S. Bengio, M. Hardt, B. Recht, and Oriol Vinyals. Understanding deep learning requires re-thinking generalization. ICLR, 2017.
+H. Zhang, J. Shao, and R. Salakhutdinov. Deep neural networks with multi-branch architectures are less non-convex. arXiv:1806.01845, 2018.
+K. Zhong, Z. Song, P. Jain, P. Bartlett, and I. Dhillon. Recovery guarantees for one-hidden-layer neural networks. ICML, 2017.
+
+# A MATHEMATICAL TOOLS
+
+In the proof of Lemma 3.2 we make use of the following property of analytic functions.
+
+Lemma A.1 (Nguyen, 2015; Mityagin, 2015) If $f : \mathbb { R } ^ { n } \mathbb { R }$ is a real analytic function which is not identically zero then the set $\{ x \in \mathbb { R } ^ { n } \mid f ( x ) = 0 \}$ has Lebesgue measure zero.
+
+We recall the following standard result from topology (see e.g. Apostol (1974), Theorem 4.23, p. 82), which is used in the proof of Theorem 3.4.
+
+Proposition A.2 Let $f : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ be a continuous function. If $U \subseteq \mathbb { R } ^ { n }$ is an open set then $f ^ { - 1 } ( U )$ is also open.
+
+# B PROOF OF LEMMA 3.2
+
+Proof: We assume w.l.o.g. that $\{ p _ { 1 } , \dotsc , p _ { N } \}$ is a subset of the neurons with skip connections to the output layer and satisfy Assumption 3.1. In the following, we will show that there exists a weight configuration $U$ such that the submatrix $\Psi _ { 1 : N , 1 : N }$ has full rank. Using then that the determinant is an analytic function together with Lemma A.1, we will conclude that the set of weight configurations $U$ such that $\Psi$ has not full rank has Lebesgue measure zero.
+
+We remind that all the hidden units in the network are indexed from the first hidden layer till the higher layers as $d + 1 , \dotsc , d + H$ . For every hidden neuron $j \in [ d + 1 , d + H ]$ , $u _ { j }$ denotes the associated weight vector
+
+$$
+u _ { j } = [ u _ { k j } ] _ { k \in \mathrm { i n } ( j ) } \in \mathbb { R } ^ { | \mathrm { i n } ( j ) | } , \quad \mathrm { w h e r e ~ i n } ( j ) = \mathrm { t h e ~ s e t ~ o f ~ i n c o m i n g ~ u n i t s ~ t o ~ u n i t ~ } j .
+$$
+
+Let $n _ { 1 }$ be the number of units of the first hidden layer. For every neuron $j$ from the first hidden layer, let us define the pre-activation output gj,
+
+$$
+g _ { j } ( x _ { i } ) = \sum _ { k j } ( x _ { i } ) _ { k } u _ { k } { } j .
+$$
+
+Due to Assumptions 3.1 (condition 3), we can always choose the weights $\{ u _ { d + 1 } , \ldots , u _ { d + n _ { 1 } } \}$ so that the output of every neuron in the first layer is distinct for different training samples, that is $g _ { j } ( x _ { i } ) \neq g _ { j } ( x _ { i ^ { \prime } } )$ for every $j \in [ d + 1 , d + n _ { 1 } ]$ and $i \neq i ^ { \prime }$ . For every neuron $j \in [ d + n _ { 1 } + 1 , d + H ]$ in the higher layers we choose the weight vector $u _ { j }$ such that it has exactly one 1 and 0 elsewhere. According to our definition of network in Section 2, the weight vectors of neurons of the same layer need not have the same dimension, but any subgroup of these neurons can still have shared weights as long as the dimensions among them agree. Thus the above choice of $u$ is always possible. In the following, let $c ( j )$ denote the neuron below $j$ such that $u _ { c ( j ) j } = 1$ . This leads to
+
+$$
+\sum _ { k j } f _ { k } ( x ) u _ { k j } = f _ { c ( j ) } ( x ) .
+$$
+
+Let $\alpha : = ( \alpha _ { d + 1 } , \dots , \alpha _ { d + H } )$ be a tuple of positive scalars. Let $\beta \in \mathbb { R }$ such that $\sigma _ { p _ { j } } ( \beta ) \neq 0$ for every $j \in [ N ]$ . We consider a family of configurations of network parameters of the form $( \alpha _ { j } u _ { j } , b _ { j } ) _ { j = d + 1 } ^ { d + H }$ where the biases are chosen as
+
+$$
+\begin{array} { l } { b _ { p _ { j } } = \beta - \alpha _ { p _ { j } } g _ { p _ { j } } ( x _ { j } ) \quad \forall j \in [ N ] , p _ { j } \in [ d + 1 , d + n _ { 1 } ] } \\ { b _ { p _ { j } } = \beta - \alpha _ { p _ { j } } f _ { c ( p _ { j } ) } ( x _ { j } ) \quad \forall j \in [ N ] , p _ { j } \notin [ d + 1 , d + n _ { 1 } ] } \\ { b _ { j } = 0 \quad \forall j \in \{ d + 1 , \ldots , d + H \} \setminus \{ p _ { 1 } , \ldots , p _ { N } \} } \end{array}
+$$
+
+Note that the assignment of biases can be done via a forward pass through the network. By the above choice of biases and our definition of neurons in Section 2, we have
+
+$$
+\begin{array} { r l } & { f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \Big ( \beta + \alpha _ { p _ { j } } \big ( g _ { p _ { j } } ( x _ { i } ) - g _ { p _ { j } } ( x _ { j } ) \big ) \Big ) , \quad \forall j \in [ N ] , p _ { j } \in [ d + 1 , d + n _ { 1 } ] , } \\ & { f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \Big ( \beta + \alpha _ { p _ { j } } \big ( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \big ) \Big ) \quad \forall j \in [ N ] , p _ { j } \notin [ d + 1 , d + n _ { 1 } ] , } \\ & { f _ { j } ( x _ { i } ) = \sigma _ { j } \Big ( \alpha _ { j } f _ { c ( j ) } ( x _ { i } ) \Big ) \quad \forall j \in \{ d + n _ { 1 } + 1 , \ldots , d + H \} \setminus \{ p _ { 1 } , \ldots , p _ { N } \} , } \\ & { f _ { j } ( x _ { i } ) = \sigma _ { j } \Big ( \alpha _ { j } g _ { j } ( x _ { i } ) \Big ) \quad \forall j \in \{ d + 1 , \ldots , d + n _ { 1 } \} \setminus \{ p _ { 1 } , \ldots , p _ { N } \} . } \end{array}
+$$
+
+One notes that the output of every skip-connection neuron $p _ { j }$ is given by the first equation if $p _ { j }$ lies on the first layer and by the second equation if $p _ { j }$ lies on higher layers. In the following, to reduce notational complexity we make a convention that: $f _ { c ( p _ { j } ) } = g _ { p _ { j } }$ for every $p _ { j }$ lies on the first layer. This allows us to use the second equation for every skip-connection neuron, that is,
+
+$$
+f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \left( \beta + \alpha _ { p _ { j } } \left( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \right) \right) \forall j \in [ N ] .
+$$
+
+Now, since $\alpha > 0$ and all activation functions are strictly increasing by Assumption 3.1, one can easily show from the above recursive definitions that if $p _ { j }$ is a skip-connection neuron which does not lie on the first hidden layer then one has the relation: $f _ { c ( p _ { j } ) } ( x _ { i } ) < f _ { c ( p _ { j } ) } ( x _ { j } )$ if and only if $g _ { q _ { j } } ( x _ { i } ) < g _ { q _ { j } } ( x _ { j } )$ , where $q _ { j }$ is some neuron in the first hidden layer. This means if one sorts the elements of the set $\left\{ f _ { c ( p _ { j } ) } ( x _ { 1 } ) , \ldots , f _ { c ( p _ { j } ) } ( x _ { N } ) \right\}$ in increasing order then for every positive tuple $\alpha$ , the order is fully determined by the corresponding order of $\left\{ g _ { q _ { j } } ( x _ { 1 } ) , \ldots , g _ { q _ { j } } ( x _ { N } ) \right\}$ for some neuron $q _ { j }$ in the first layer. Note that this order can be different for different neurons $q _ { j }$ in the first layer, and thus can be different for different skip-connection neurons $p _ { j }$ . Let $\pi$ be a permutation such that it holds for every $j = 1 , 2 , \dots , N$ that
+
+$$
+\pi ( j ) = \underset { i \in \{ 1 , \ldots , N \} \setminus \{ \pi ( 1 ) , \ldots , \pi ( j - 1 ) \} } { \arg \operatorname* { m a x } } f _ { c ( p _ { j } ) } ( x _ { i } )
+$$
+
+It follows from above that $\pi$ is fully determined by the values of $g$ at the first layer. By definition one has $f _ { c ( p _ { j } ) } ( x _ { \pi _ { i } } ) \mathop { < } _ { c ( p _ { j } ) } ( x _ { \pi _ { j } } )$ for every $i > j$ . Since $\pi$ is independent of every positive tuple $\alpha$ and fully determined by the values of $g$ , it can be fixed in the beginning. One can assume w.l.o.g. that $\pi$ is the identity permutation as otherwise one can reorder the training samples according to $\pi$ so that the rank of $\Psi$ does not change. Thus it holds for every $\alpha > 0$ that
+
+$$
+\delta _ { i j } : = f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) < 0 \quad \forall i , j \in [ N ] , i > j
+$$
+
+Now, we are ready to show that there exists a positive tuple $\alpha$ for which $\Psi$ has full rank. We consider two cases of the activation functions of skip-connection neurons as stated in Assumption 3.1:
+
+• In the first case, the activation functions $\sigma _ { p _ { j } } : \mathbb { R } \mathbb { R }$ for every $j \in [ N ]$ are strictly increasing, bounded and $\begin{array} { r } { \operatorname* { l i m } _ { t - \infty } \sigma _ { p _ { j } } ( t ) = \mathbf { \bar { 0 } } } \end{array}$ . In the following, let $l ( j )$ denote the layer index of the hidden unit $j$ . For every hidden unit $j \in \{ d + 1 , \ldots , d + H \}$ we set $\alpha _ { j }$ to be the maximum of certain bounds (explained later in (10)) associated to all skip-connection neurons $p _ { k }$ lying on the same layer, that is,
+
+$$
+\alpha _ { j } = \operatorname* { m a x } \left\{ 1 , \operatorname* { m a x } _ { \substack { k \in [ N ] | l ( p _ { k } ) = l ( j ) } } \operatorname* { m a x } _ { i > k } \frac { \sigma _ { p _ { k } } ^ { - 1 } ( \epsilon ) - \beta } { f _ { c ( p _ { k } ) } ( x _ { i } ) - f _ { c ( p _ { k } ) } ( x _ { k } ) } \right\}
+$$
+
+where $\epsilon > 0$ is an arbitrarily small constant which will be specified later. There are a few remarks we want to make for Eq. (9) before proceeding with our proof. First, the second term in (9) can be empty if there is no skip-connection unit $p _ { k }$ which lies on the same layer as unit $j$ , in which case $\alpha _ { j }$ is simply set to 1. Second, $\alpha _ { j }$ ’s are well-defined by constructing the values $f _ { c ( p _ { k } ) } ( x _ { r } )$ , $\dot { r } = 1 , \ldots , N$ by a forward pass through the network (note that the network is a directed, acyclic graph; in particular, in the formula of $\alpha _ { j }$ , one has $l ( c ( p _ { k } ) ) < l ( p _ { k } ) = l ( j )$ and thus the computation of $\alpha _ { j }$ is feasible given the values of hidden units lying below the layer of unit $j$ , namely $f _ { c ( p _ { k } ) } .$ ). Third, if $j$ and $j ^ { \prime }$ are two neurons from the same layer, i.e. $l ( j ) = l ( j ^ { \prime } )$ , then it follows from (9) that $\alpha _ { j } = \alpha _ { j \prime }$ , meaning that their corresponding weight vectors are scaled by the same factor, thus any potential weight sharing conditions imposed on these neurons can still be satisfied.
+
+The main idea of choosing the above values of $\alpha$ is to obtain
+
+$$
+\begin{array} { r } { \Psi _ { i j } = f _ { p _ { j } } ( x _ { i } ) \le \epsilon \quad \forall i , j \in [ N ] , i > j . } \end{array}
+$$
+
+To see this, one first observes that the inequality (8) holds for the constructed values of $\alpha$ since they are all positive. From (9) it holds for every skip-connection unit $p _ { j }$ that
+
+$$
+\alpha _ { p _ { j } } > \operatorname* { m a x } _ { i > j } \frac { \sigma _ { p _ { j } } ^ { - 1 } ( \epsilon ) - \beta } { f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) } \quad \forall j \in [ N ]
+$$
+
+which combined with (8) leads to
+
+$$
+\begin{array} { r } { \alpha _ { p _ { j } } \big ( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \big ) \le \sigma _ { p _ { j } } ^ { - 1 } ( \epsilon ) - \beta \quad \forall i , j \in [ N ] , i > j . } \end{array}
+$$
+
+and thus using (6) we obtain (10).
+
+Coming back to the main proof of the lemma, since $\sigma _ { p _ { j } } ( j \in [ N ] )$ are bounded there exists a finite positive constant $C$ such that it holds that
+
+$$
+\vert \Psi _ { i j } \vert \le C \quad \forall i , j \in [ N ]
+$$
+
+By the Leibniz-formula one has
+
+$$
+\operatorname* { d e t } ( \Psi _ { 1 : N , 1 : N } ) = \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) + \sum _ { \pi \in S _ { N } \backslash \{ \gamma \} } \mathrm { s i g n } ( \pi ) \prod _ { j = 1 } ^ { N } \Psi _ { \pi ( j ) j }
+$$
+
+where $S _ { N }$ is the set of all $N !$ permutations of the set $\{ 1 , \ldots , N \}$ and $\gamma$ is the identity permutation. Now, one observes that for every permutation $\pi \neq \gamma$ , there always exists at least one component $j$ where $\pi ( j ) > j$ in which case it follows from (10) and (11) that
+
+$$
+\Bigl | \sum _ { \pi \in S _ { N } \backslash \{ \gamma \} } \mathrm { s i g n } ( \pi ) \prod _ { j = 1 } ^ { N } \Psi _ { \pi ( j ) j } \Bigr | \ \le N ! C ^ { N - 1 } \epsilon
+$$
+
+By choosing $\begin{array} { r } { \epsilon = \frac { \bigg | \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) \bigg | } { 2 N ! C ^ { N - 1 } } } \end{array}$ , we get that
+
+$$
+\operatorname* { d e t } ( \Psi _ { 1 : N , 1 : N } ) \geq \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) - \frac { 1 } { 2 } \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) = \frac { 1 } { 2 } \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) \neq 0
+$$
+
+and thus $\Psi$ has full rank.
+
+• In the second case we consider the softplus activation function which satisfies our Assumption 3.1 that there exists a backward path from every skip-connection neuron $p _ { j }$ to the first hidden layer s.t. on this path there is no neuron which has skip-connections to the output or shared weights with other skip-connection neurons.
+
+We choose all the weights and biases similarly to the first case. The only difference is that for every skip-connection neuron $p _ { j } ( 1 \leq j \leq N )$ , the position of 1 in its weight vector $\boldsymbol { \underline { { u } } _ { p _ { j } } }$ is chosen s.t. the value of neuron $p _ { j }$ is determined by the first neuron on the corresponding backward path as stated in Assumption 3.1, that is,
+
+$$
+\sum _ { k p _ { j } } f _ { k } ( x _ { i } ) u _ { k p _ { j } } = f _ { c ( p _ { j } ) } ( x _ { i } ) .
+$$
+
+For skip-connection neurons we set all $\{ \alpha _ { p 1 } , \dotsc , \alpha _ { p _ { N } } \}$ to some scalar variable $\alpha$ , and for non-skip connection neurons $j$ we set $\alpha _ { j } = 1$ . From (6) and equations of (5) we have
+
+$$
+\begin{array} { r l } & { f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \Big ( \beta + \alpha \big ( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \big ) \Big ) \quad \forall j \in [ N ] , } \\ & { \quad f _ { j } ( x _ { i } ) = \sigma _ { j } \big ( f _ { c ( j ) } ( x _ { i } ) \big ) \quad \forall j \in \{ d + 1 , \ldots , d + H \} \setminus \{ p _ { 1 } , \ldots , p _ { N } \} . } \end{array}
+$$
+
+Note that with above construction of $u$ and $\alpha$ , the only case where our weight sharing conditions can be potentially violated is between a skip-connection neuron ( $( \alpha _ { j } = \alpha )$ ) with a neuron on a backward path ${ \bf \Phi } _ { \cdot } ( x _ { j } = 1$ ). However, this is not possible because our assumption in this case states that there is no weight sharing between a skip-connection neuron and a neuron on one of the backward paths.
+
+Next, by our assumption the recursive backward path $c ^ { ( k ) } ( p _ { j } )$ does not contain any skipconnection unit and thus will eventually end up at some neuron $q _ { j } \in [ d + 1 , d + n _ { 1 } ]$ in the first hidden layer after some finite number of steps. Thus we can write for every $j \in [ N ]$
+
+$$
+f _ { p _ { j } } ( x _ { i } ) = \sigma _ { p _ { j } } \Bigl ( \beta + \alpha \bigl ( f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) \bigr ) \Bigr ) ,
+$$
+
+where
+
+$$
+f _ { c ( p _ { j } ) } ( x _ { i } ) = \sigma _ { c ( p _ { j } ) } ( \sigma _ { c ( c ( p _ { j } ) ) } ( \hdots ( g _ { q _ { j } } ( x _ { i } ) ) \hdots ) ) \quad \forall i \in [ N ] .
+$$
+
+Moreover, we have from (8) that $f _ { c ( p _ { j } ) } ( x _ { i } ) < f _ { c ( p _ { j } ) } ( x _ { j } )$ for every $i > j$ . Note that softplus fulfills for $t < 0$ , $\begin{array} { r } { \sigma _ { \gamma } ( t ) \leq \frac { 1 } { \gamma } e ^ { \gamma t } } \end{array}$ , whereas for $t > 0$ one has $\begin{array} { r } { \sigma _ { \gamma } ( t ) \leq \frac { 1 } { \gamma } + t } \end{array}$ . The latter property implies $\begin{array} { r } { \sigma ^ { ( K ) } ( t ) \le \frac { K } { \gamma } + t } \end{array}$ . Finally, this together implies that there exist positive constants $c _ { 1 } , c _ { 2 } , c _ { 3 } , c _ { 4 }$ such that it hods
+
+$$
+| \prod _ { j = 1 } ^ { N } \Psi _ { \pi ( j ) j } | \leq c _ { 1 } e ^ { - \alpha c _ { 2 } } ( c _ { 3 } + \alpha ) ^ { N - 1 } .
+$$
+
+This can be made arbitrarily small by increasing $\alpha$ . Thus we get
+
+$$
+\operatorname* { l i m } _ { \alpha \to \infty } \operatorname* { d e t } ( \Psi _ { 1 : N , 1 : N } ) = \prod _ { j = 1 } ^ { N } \sigma _ { p _ { j } } ( \beta ) \neq 0
+$$
+
+So far, we have shown that there always exist $U$ such that $\Psi$ has full rank. Since every activation function is real analytic by Assumption 3.1, every entry of $\Psi$ is also a real analytic function of the network parameters where $\Psi$ depends on. The set of low rank matrices $\Psi$ can be characterized by a system of equations such that all the $\textstyle { \binom { M } { N } }$ determinants of all $N \times N$ sub-matrices of $\Psi$ are zero. As the determinant is a polynomial in the entries of the matrix and thus an analytic function of the entries and composition of analytic functions are again analytic, we conclude that each determinant is an analytic function of $U$ . As shown above, there exists at least one $U$ such that one of these determinant functions is not identically zero and thus by Lemma A.1, the set of $U$ where this determinant is zero has measure zero. But as all submatrices need to have low rank in order that $\Psi$ has low rank, it follows that the set of $U$ where $\Psi$ has low rank has just measure zero. $\boxed { \begin{array} { r l } \end{array} }$
+
+# C EXTENSION OF THEOREM 3.4 TO GENERAL CONVEX LOSSES
+
+In this section, we consider a more general training objective, defined as
+
+$$
+\Phi ( U , V ) = \varphi ( G ( U , V ) )
+$$
+
+where $G ( U , V ) = \Psi ( U ) V \in \mathbb { R } ^ { N \times m }$ is the output of the network for all training samples at some given parameters $( U , V )$ , and $\varphi : \mathbb { R } ^ { N \times m } \mathbb { R }$ the loss function applied on the network output.
+
+Assumption C.1 The loss function $\varphi : \mathbb { R } ^ { N \times m } \mathbb { R }$ is convex and bounded from below.
+
+One can easily check that the following loss functions satisfy Assumption C.1 as they are all convex and bounded from below by zero:
+
+1. The cross-entropy loss from Equation 2, in particular:
+
+$$
+\varphi ( G ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } - \log \Big ( \frac { e ^ { G _ { i y _ { i } } } } { \sum _ { k = 1 } ^ { m } e ^ { G _ { i k } } } \Big ) ,
+$$
+
+where $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N }$ is the training data with $y _ { i }$ being the ground-truth class of $x _ { i }$
+
+2. The standard square loss (for classification/regression tasks)
+
+$$
+\varphi ( G ) = \frac { 1 } { 2 } \left. G - Y \right. _ { F } ^ { 2 } ,
+$$
+
+where $Y \in \mathbb { R } ^ { N \times m }$ is the ground-truth matrix.
+
+3. The multi-class Hinge-loss (for classification tasks)
+
+$$
+\varphi ( G ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \operatorname* { m a x } _ { j \neq y _ { i } } \operatorname* { m a x } ( 0 , 1 - ( G _ { i y _ { i } } - G _ { i j } ) ) ,
+$$
+
+where $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N }$ is the training data with $y _ { i }$ being the ground-truth class of $x _ { i }$ .
+
+By Assumption C.1, $\varphi$ is bounded from below, thus it attains a finite infimum:
+
+$$
+p ^ { * } : = \operatorname* { i n f } _ { G \in \mathbb { R } ^ { N \times m } } \varphi ( G ) < \infty .
+$$
+
+Basically, $p ^ { * }$ serves as a lower bound on our training objective $\Phi$ . For the above examples, it holds $p ^ { * } = 0$ . Next, we adapt the definition of “bad local valleys” from Definition 3.3 to the current setting.
+
+Definition C.2 The $\alpha$ -sublevel set of $\Phi$ is defined as $L _ { \alpha } = \{ ( U , V ) \mid \Phi ( U , V ) < \alpha \} \ : ,$ . A local valley is defined as a connected component of some sublevel set $L _ { \alpha }$ . A bad local valley is a local valley on which the training objective $\Phi$ cannot be made arbitrarily close to $p ^ { * }$ .
+
+The following result extends Theorem 3.4 to general convex losses. The proofs are mostly similar as before, but we present them below for the completeness and convenience of the reader.
+
+Theorem C.3 The following holds under Assumption 3.1 and Assumption $C . I$ :
+
+1. There exist uncountably many solutions with zero training error.
+
+2. The loss landscape of $\Phi$ does not have any bad local valley.
+
+3. There exists no suboptimal strict local minimum.
+
+4. For cross-entropy loss (2) and square loss (14) there exists no local maximum.
+
+# Proof:
+
+1. By Lemma 3.2 the set of $U$ such that $\Psi ( U )$ has not full rank $N$ has Lebesgue measure zero. Given $U$ such that $\Psi$ has full rank, the linear system $\Psi ( U ) V = Y$ has for every possible target output matrix $Y \in \mathbb { R } ^ { N \times m }$ at least one solution $V$ . As this is possible for almost all $U$ , there exist uncountably many solutions achieving zero training error.
+
+2. Let $C$ be a non-empty, connected component of some sub-level set $L _ { \alpha }$ where $\alpha > p ^ { * }$ . Note that $L _ { \alpha } = \mathcal { O }$ if $\alpha \leq p ^ { * }$ by Definition C.2. Given any $\epsilon \in ( p ^ { * } , \alpha )$ , we will show that $C$ always contains a point $( U , V )$ s.t. $\Phi ( U , V ) \leq \epsilon$ as this would imply that the loss $\Phi$ restricted to $C$ can always attain arbitrarily small value close to $p ^ { * }$ .
+
+We note that $L _ { \alpha } = \Phi ^ { - 1 } ( ( - \infty , \alpha ) )$ is an open set according to Proposition A.2. Since $C$ is a non-empty connected component of $L _ { \alpha }$ , $C$ must also be an open set with non-zero Lebesgue measure. By Lemma 3.2 the set of $U$ where $\Psi ( U )$ has not full rank has measure zero and thus $C$ must contain a point $( U , V )$ such that $\Psi ( U )$ has full rank. By Assumption C.1, $\varphi$ attains its infimum at $p ^ { * } < \epsilon$ , and thus by continuity of $\varphi$ , there exists $\dot { G } ^ { * } \in \mathbb { R } ^ { N \times m }$ such that $p ^ { * } \leq \varphi ( G ^ { * } ) \leq \epsilon$ . As $\Psi ( U )$ has full rank, there always exist $V ^ { * }$ such that $\Psi ( U ) V ^ { * } = G ^ { * }$ Now, one notes that the loss $\Phi ( U , V ) = \varphi ( \Psi ( U ) V )$ is convex in $V$ , and that $\Phi ( U , V ) < \alpha$ thus we have for the line segment $V ( \lambda ) = \lambda V + ( 1 - \lambda ) V ^ { * }$ for $\lambda \in [ 0 , 1 ]$ ,
+
+$$
+\Phi ( U , V ( \lambda ) ) \le \lambda \Phi ( U , V ) + ( 1 - \lambda ) \Phi ( U , V ^ { * } ) < \lambda \alpha + ( 1 - \lambda ) \epsilon < \alpha .
+$$
+
+Thus the whole line segment from $( U , V )$ to $( U , V ^ { * } )$ is contained in $L _ { \alpha }$ . Since $C$ is a connected component of $L _ { \alpha }$ which contains $( U , V )$ , it follows that $( U , V ^ { * } ) \in C$ . Moreover, one has $\Phi ( U , \bar { V } ^ { * } ) = \varphi ( G ^ { * } ) \leq \epsilon .$ , which thus implies that the loss can always be made $\epsilon$ -small inside the set $C$ for every $\epsilon \in ( p ^ { * } , \alpha )$ .
+
+3. Let $( U _ { 0 } , V _ { 0 } )$ be a strict suboptimal local minimum, then there exists $r > 0$ such that $\Phi ( U , V ) > \Phi ( U _ { 0 } , V _ { 0 } ) > p ^ { * }$ for all $( U , V ) \in { \cal B } ( ( U _ { 0 } , V _ { 0 } ) , r ) \ : \backslash \ : \{ ( U _ { 0 } , V _ { 0 } ) \}$ where $B ( \cdot , r )$ denotes a closed ball of radius r. Let α = min(U,V )∈∂B (U0,V0),r which exists as $\Phi$ is continuous and the boundary $\partial B \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ of $B \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ is compact. Note that $\Phi ( U _ { 0 } , V _ { 0 } ) < \alpha$ as $( U _ { 0 } , V _ { 0 } )$ is a strict local minimum, and thus $( U _ { 0 } , \dot { V } _ { 0 } ) \in L _ { \alpha }$ . Let $E$ be the connected component of $L _ { \alpha }$ which contains $( U _ { 0 } , V _ { 0 } )$ , that is, $( U _ { 0 } , V _ { 0 } ) \in E \subseteq L _ { \alpha }$ . Since the loss of every point inside $E$ is strictly smaller than $\alpha$ , whereas the loss of every point on the boundary $\mathrm { \widehat { \partial } } D \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ is greater than or equal to $\alpha$ , $E$ must be contained in the interior of the ball, that is $E \subset \dot { B } \big ( ( U _ { 0 } , V _ { 0 } ) , r \big )$ . Moreover, $\Phi ( U , V ) \ge \Phi ( U _ { 0 } , V _ { 0 } ) > p ^ { * }$ for every $( U , V ) \in E$ and thus the values of $\Phi$ restricted to $E$ can not be arbitrarily close to $p ^ { * }$ , which means that $E$ is a bad local valley, which contradicts G.3.2.
+
+4. The proof for cross-entropy loss is similar to Theorem 3.4. For square loss, one has
+
+$$
+\Phi ( U , V ) = \frac { 1 } { 2 } \left\| \Psi ( U ) V - Y \right\| _ { F } ^ { 2 } = \frac { 1 } { 2 } \left\| \left( \mathbb { I } _ { m } \otimes \Psi ( U ) \right) \nu e c ( V ) - \nu e c ( Y ) \right\| _ { 2 } ^ { 2 }
+$$
+
+w.r.t. where $V$ $\otimes$ is denotes Kronecker product, and $\nabla _ { \nu e c ( V ) } ^ { 2 } \Phi = ( \mathbb { I } _ { m } \diamondsuit \Psi ( U ) ) ^ { T } ( \mathbb { I } _ { m } \otimes \Psi ( U ) )$ $\mathbb { I } _ { m }$ an $m \times m$ . identity matrix. The hessian of $\Phi$
+
+Suppose by contradiction that $( U , V )$ is a local maximum. Then the Hessian of $\Phi$ is negative semi-definite. As principal submatrices of negative semi-definite matrices are again negative semi-definite, the Hessian of $\Phi$ w.r.t $V$ must be also negative semi-definite. However, $\Phi$ is which is both p.s.d. and n.s.d. is the zero matrix. It follows that convex in $V$ thus its Hessian restricted to $V$ must be positive semi-definite. The only matrix $\nabla _ { \nu e c ( V ) } ^ { 2 } \Phi ( U , V ) \stackrel { \cdot } { = } 0$ and thus $\Psi ( U ) = 0$ . By Assumption 3.1, there exists $j \in [ M ]$ s.t. $\sigma _ { p _ { j } }$ is strictly positive, thus some entries of $\Psi ( U )$ must be strictly positive, and so $\Psi ( U )$ cannot be identically zero, leading to a contradiction. Therefore $\Phi$ has no local maximum.
+
+D THE ARCHITECTURE OF CNN13 FROM TABLE 1: SEE TABLE 3
+
+
Layer
Output size
#neurons
Input: 28 × 28
28×28×1
3×3conv-64,stride1
28×28×64
50176
3×3conv-64,stride1
28×28×64
50176
3×3conv-64,stride 2
14×14×64
12544
3 ×3conv -128,stride1
14×14×128
25088
3 ×3conv-128,stride1
14×14×128
25088
3 ×3conv-128,stride2
7×7×128
6272
3 ×3conv -256,stride1
7×7×256
12544
1 × 1conv - 256,stride1
7×7×256
12544
3×3conv-256,stride2
4×4×256
4096
3×3conv-256,stride1
4×4×256
4096
3×3conv-256,stride2
2×2×256
1024
3 × 3conv- 256,stride1
2×2×256
1024
3×3conv-256,stride2
1×1×256
256
Fully connected,10 output units
+
+Table 3: The architecture of CNN13 for MNIST dataset. There are in total 179, 840 hidden neurons.
+
+# E VISUALIZATION OF THE LOSS LANDSCAPE BEFORE AND AFTER ADDING SKIP-CONNECTIONS TO THE OUTPUT LAYER
+
+Similar to Li et al. (2018); Goodfellow et al. (2015), we visualize the loss surface restricted to a two dimensional subspace of the parameter space. The subspace is chosen to go through some point $( U _ { 0 } , V _ { 0 } )$ learned by SGD and spanned by two random directions $( U _ { 1 } , V _ { 1 } )$ and $( U _ { 2 } , V _ { 2 } )$ .
+
+For the purpose of illustration, we train with SGD a two-hidden-layer fully connected network with 784 and 300 hidden units respectively, followed by a 10-way softmax. The training set consists of 1024 images, which are randomly selected from MNIST dataset. After adding skip-connections to the output, the network fulfills $M = N = 1 0 2 4$ . Figure 3 shows the heat map of the loss surface before and after adding skip-connections. One can see a visible effect that skip-connections have helped to smooth the loss landscape near a small sub-optimal region and allows gradient descent to flow directly from there to the bottom of the landscape with smaller objective value.
+
+# F DISCUSSION OF TRAINING ERROR IN TABLE 2
+
+Training error for the experiment in Table 2. As shown in Table 2, the training error is zero in all cases, except when the original VGG models are used with sigmoid activation function. The reason, as noticed in our experiments, is because the learning of these sigmoidal networks converges quickly to a constant zero classifier (i.e. the output of the last hidden layer converges to zero), which makes both training and test accuracy converge to $1 0 \%$ and the loss in Equation (2) converges to $- \log ( 1 / 1 0 )$ . While we are not aware of a theoretical explanation for this behavior, it is not restricted to the specific architecture of VGGs but hold in general for plain sigmoidal networks with depth ${ > } 5$ as pointed out earlier by Glorot & Bengio (2010). As shown in Table 2, Densenets however do not suffer from this phenomenon, probably because they already have skip-connections between all the hidden layers of a dense block, thus gradients can easily flow from the output to every layer of a dense block, which makes the training of this network with sigmoid activation function become feasible.
+
+
+Figure 3: Loss surface of a two-hidden-layer network on a small MNIST dataset.
+
+
+
+Discussion of convergence speed. For sigmoid activation, we noticed that skip-models when trained with the random sampling approach (skip-rand) often converge much slower than when trained with full SGD (skip-SGD). In our experiments, to be sure that one gets absolute zero training error, we set the number of training epochs to 5000 for the former case and 1000 for the later. Perhaps a better learning rate schedule might help to reduce this number, or maybe not, but this is beyond the scope of this paper. For softplus activation, we noticed a much faster convergence – all models often converge within 300 epochs to absolute zero training error.
+
+Skip-connections are also helpful for training very deep networks with softplus activation. Previously we have shown that skip-connections are helpful for training deep sigmoidal networks. In this part, we show a similar result for softplus activation function. For the purpose of illustration, we create a small dataset with $N = 1 0 0 0$ training images randomly chosen from CIFAR10 dataset. We use a very deep network with 150 fully connected layers, each of width 10, and softplus activation. A skip-model is created by adding skip-connections from $N$ randomly chosen neurons to the output units. We train both networks with SGD. The best learning rate for each model is empirically chosen from $\left\{ 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } , 1 0 ^ { - 5 } \right\}$ . We report the training loss and training error of both models in Figure 5. One can see that the skip-network easily converge to zero training error within 200 epochs, whereas the original network has stronger fluctuations and fails to converge after 1000 epochs. This is directly related to our result of Theorem 3.4 in the sense that skip-connections can help to smooth the loss landscape and enable effective training of very deep networks.
+
+
+Figure 5: Training progress of a 150-layer neural network with and without skip-connections.
+
+# G ADDITIONAL EXPERIMENTS: MAX-POOLING OF VGGS ARE REPLACED BY 2X2 CONVOLUTIONAL LAYERS OF STRIDE 2
+
+The original VGG Simonyan & Zisserman (2015) and Densenet Huang et al. (2017) contain pooling layers in their architecture. In particular, original VGGs have max-pooling layers, and original Densenets have averaging pooling layers. In the following, we will clarify how/if these pooling layers have been used in our experiments in Table 2, and whether and how our theretical results are appicable to this case, as well as presenting additional experimental results in this regard.
+
+First of all, we note that Densenets Huang et al. (2017) contain pooling layers only after the first dense block. Meanwhile, as noted in Table 2, our experiments with Densenets only use skip-connections from hidden units of the first dense block, and thus Lemma 3.2 and Theorem 3.4 are applicable. The reason is that one can restrict the full-rank analysis of matrix $\Psi$ in Lemma 3.2 to the hidden units of the first dense block, so that it follows that the set of parameters of the first dense block where $\Psi$ has not full rank has Lebesgue measure zero, from which our results of Theorem 3.4 follow immediately.
+
+However for VGGs in Table 2, we kept their max-pooling layers similar to the original architecture as we wanted to have a fair comparison between our skip-models and the original models. In this setting, our results are not directly applicable because we lose the analytic property of the entries of $\Psi$ w.r.t. its dependent parameters, which is crucial to prove Lemma 3.2. Therefore in this section, we would like to present additional results to Table 2 in which we replace all max-pooling layers of all VGG models from Table 2 with $2 \mathbf { x } 2$ convolutional layers of stride 2. In this case, the whole network consists of only convolutional and fully connected layers, hence our theoretical results are applicable.
+
+The experimental results are presented in Table 4. Overall, our main observations are similar as before. The performance gap between original models and their corresponding skip-variants are approximately the same as in Table 2 or slightly more pronounced in some cases. A one-to-one comparison with Table 2 also shows that the performance of skip-models themselves have decreased by $4 - 7 \%$ after the replacement of max-pooling layers with $2 \mathbf { x } 2$ convolutional layers. This is perhaps not so surprising because the problem gets potentially harder when the network has more layers to be learned, especially in case of sigmoid activation where the decrease is sharper. Similar to Table 2, adding skip-connections to the output units still prove to be very helpful – it improves the result for softplus while making the training of deep networks with sigmoid activation become possible at all. Finally, the training of full network with SGD still yields significantly better solutions in terms of generalization error than the random feature approach. This confirms once again the implicit bias of SGD towards high quality solutions among infinitely many solutions with zero training error.
+
+Table 4: Test accuracy $( \% )$ of VGG networks from Table 2 where max-pooling layers are replaced by $2 \mathbf { x } 2$ convolutional layers of stride 2 (denoted as mp2conv). Other notations are similar to Table 2.
+
+
+
+# H DATA-AUGMENTATION RESULTS FOR TABLE 2
+
+The following Table 5 shows additional results to Table 2 where data-augmentation is used now. For data-augmentation, we follow the procedure as described in (Zagoruyko & Komodakis, 2016) by considering random crops of size $3 2 \times 3 2$ after 4 pixel padding on each side of the training images and random horizontal flips with probability 0.5. For the convenience of the reader, we also repeat the results of Table 2 in the new table 5.
+
+Table 5: Test accuracy $( \% )$ of several CNN architectures with/without skip-connections on CIFAR10 $^ +$ denotes data augmentation). For each model A, A-skip denotes the corresponding skip-model in which a subset of $N$ hidden neurons “randomly selected” from the hidden layers are connected to the output units. For Densenet121, these neurons are randomly chosen from the first dense block. The names in open brackets (rand/SGD) specify how the networks are trained: rand ( $U$ is randomized and fixed while $V$ is learned with SGD), SGD (both $U$ and $V$ are optimized with SGD).
+
+
\ No newline at end of file
diff --git a/md/train/HJgeEh09KQ/HJgeEh09KQ.md b/md/train/HJgeEh09KQ/HJgeEh09KQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..887921d05f84f7cb4648f2a94be99ff6d10a3806
--- /dev/null
+++ b/md/train/HJgeEh09KQ/HJgeEh09KQ.md
@@ -0,0 +1,337 @@
+# BOOSTING ROBUSTNESS CERTIFICATION OF NEURAL NETWORKS
+
+Gagandeep Singh, Timon Gehr, Markus Puschel, Martin Vechev ¨
+Department of Computer Science
+ETH Zurich, Switzerland
+{gsingh,timon.gehr,pueschel,martin.vechev}@inf.ethz.ch
+
+# ABSTRACT
+
+We present a novel approach for the certification of neural networks against adversarial perturbations which combines scalable overapproximation methods with precise (mixed integer) linear programming. This results in significantly better precision than state-of-the-art verifiers on challenging feedforward and convolutional neural networks with piecewise linear activation functions.
+
+# 1 INTRODUCTION
+
+Neural networks are increasingly applied in critical domains such as autonomous driving (Bojarski et al., 2016), medical diagnosis (Amato et al., 2013), and speech recognition (Hinton et al., 2012). However, it has been shown by Goodfellow et al. (2014) that neural networks can be vulnerable against adversarial attacks, i.e., imperceptible input perturbations cause neural networks to misclassify. To address this challenge and prove that a network is free of adversarial examples (usually, in a region around a given input), recent work has started investigating the use of certification techniques. Current verifiers can be broadly classified as either complete or incomplete.
+
+Complete verifiers are exact, i.e., if the verifier fails to certify a network then the network is nonrobust (and vice-versa). Existing complete verifiers are based on Mixed Integer Linear Programming (MILP) (Lomuscio & Maganti, 2017; Fischetti & Jo, 2018; Dutta et al., 2018; Cheng et al., 2017) or SMT solvers (Katz et al., 2017; Ehlers, 2017). Although precise, these can only handle networks with a small number of layers and neurons. To scale, incomplete verifiers usually employ overapproximation methods and hence they are sound but may fail to prove robustness even if it holds. Incomplete verifiers use methods such as duality (Dvijotham et al., 2018), abstract interpretation (Gehr et al., 2018; Singh et al., 2018; 2019), linear approximations (Weng et al., 2018; Wong & Kolter, 2018; Zhang et al., 2018), semidefinite relaxations (Raghunathan et al., 2018), combination of linear and non-linear approximation (Xiang et al., 2017), or search space discretization (Huang et al., 2017). Incomplete verifiers are more scalable than complete ones, but can suffer from precision loss for deeper networks. In principle, incomplete verifiers can be made asymptotically complete by iteratively refining the input space (Wang et al., 2018a) or the neurons (Wang et al., 2018b); however, in the worst case, this may eliminate any scalability gains and thus defeat the purpose of using overapproximation in the first place.
+
+This work: boosting complete and incomplete verifiers. A key challenge then is to design a verifier which improves the precision of incomplete methods and the scalability of complete ones. In this work, we make a step towards addressing this challenge based on two key ideas: (i) a combination of state-of-the-art overapproximation techniques used by incomplete methods, including LP relaxations, together with MILP solvers, often employed in complete verifiers; (ii) a novel heuristic, which points to neurons whose approximated bounds should be refined. We implemented these ideas in a system called RefineZono, and showed that is is faster than state-of-the-art complete verifiers on small networks while improving precision of existing incomplete verifiers on larger networks.
+
+The recent works of (Wang et al., 2018b) and Tjeng et al. (2019) have also explored the combination of linear programming with overapproximation. However, both use simpler and coarser overapproximations than ours. Our evaluation shows that RefineZono is faster than both for complete verification. For example, RefineZono is faster than the work of Tjeng et al. (2019) for the complete verification of a $3 \times 5 0$ network, while for the larger $9 \times 2 0 0$ network their method does not finish within multiple days on images which RefineZono verifies in $\approx 1 4$ minutes.
+
+
+Figure 1: Robustness analysis of a toy example neural network using our method. Here, approximation results computed with DeepZ (blue box) are refined using MILP whereas those in green are refined using LP.
+
+Main contributions. Our main contributions are:
+
+• A refinement-based approach for certifying neural network robustness that combines the strengths of fast overapproximation methods with MILP solvers and LP relaxations.
+• A novel heuristic for selecting neurons whose bounds should be further refined.
+• A complete end-to-end implementation of our approach in a system called RefineZono, publicly available at https://github.com/eth-sri/eran.
+• An evaluation, showing that RefineZono is more precise than existing state-of-the-art incomplete verifiers on larger networks and faster (while being complete) than complete verifiers on smaller networks.
+
+# 2 OVERVIEW
+
+We now demonstrate how our method improves the precision of a state-of-the-art incomplete verifier. The main objective here is to provide an intuitive understanding of our approach; full formal details are provided in the next section.
+
+Consider the simple fully connected feedforward neural network with ReLU activations shown in Fig. 1. There are two inputs to the network, both in the range $[ 0 , 1 ]$ . The network consists of an input layer, two hidden layers, and one output layer. Each layer consist of two neurons each. For our explanation, we separate each neuron into two parts: one represents the output of the affine transformation while the other captures the output of the ReLU activation. The weights for the affine transformation are represented by weights on the edges. The bias for each node is shown above or below it. Our goal is to verify that for any input in $[ 0 , 1 ] \times [ 0 , 1 ]$ , the output at neuron $x _ { 1 3 }$ is greater than the output at $x _ { 1 4 }$ .
+
+We now demonstrate how our verifier operates on this network. We assume that the analysis results after the second affine transformation are refined using a MILP formulation of the network whereas the results after the third affine transformation are refined by an LP formulation of the network. In the next section, we will explain our heuristic for selecting MILP or LP formulations of different neurons in the network. Our analysis leverages the Zonotope domain (Ghorbal et al., 2009) together with the abstract Zonotope transformers specialized to neural network activations as used in DeepZ (Singh et al., 2018), a state of the art verifier for neural network robustness. The Zonotope domain associates an affine form $\hat { x }$ with each neuron $x$ in the network:
+
+
+Figure 2: ReLU transformers, computing an affine form. Here, $l _ { x } , u _ { x }$ are the original bounds, whereas $l _ { x } ^ { \prime } , u _ { x } ^ { \prime }$ are the refined bounds. The slope of the two non-vertical parallel blue lines is $\lambda = u _ { x } / ( \bar { u } _ { x } - \bar { l } _ { x } )$ and the slope of the two non-vertical parallel green lines is $\lambda ^ { \prime } = u _ { x } ^ { \prime } / ( u _ { x } ^ { \prime } - l _ { x } ^ { \prime } )$ . The blue parallelogram is used to compute an affine form in DeepZ, whereas the green parallelogram is used to compute the output of the refined ReLU transformer considered in this work.
+
+$$
+\hat { x } : = c _ { 0 } + \sum _ { i = 1 } ^ { p } c _ { i } \cdot \eta _ { i }
+$$
+
+Here, $c _ { 0 } , c _ { i } \in \mathbb { R }$ are real coefficients and $\eta _ { i } \in \left[ s _ { i } , t _ { i } \right] \subseteq \left[ - 1 , 1 \right]$ are the noise symbols, which are shared between the affine forms for different neurons. This sharing makes the domain relational and thus more precise than non-relational domains such as Interval (Box). An abstract element in our analysis is an intersection between a Zonotope (given as a list of affine forms) and a bounding box. Thus, for each neuron $x$ , we keep the affine form $\hat { x }$ and an interval $[ l _ { x } , u _ { x } ]$ .
+
+First layer. Our analysis starts by setting
+
+$$
+\hat { x } _ { 1 } = 0 . 5 + 0 . 5 \cdot \eta _ { 1 } , l _ { 1 } = 0 , u _ { 1 } = 1
+$$
+
+and
+
+$$
+\begin{array} { r } { \hat { x } _ { 2 } = 0 . 5 + 0 . 5 \cdot \eta _ { 2 } , l _ { 2 } = 0 , u _ { 2 } = 1 , } \end{array}
+$$
+
+representing the input $[ 0 , 1 ]$ at $x _ { 1 }$ and [0, 1] at $x _ { 2 }$ in our domain, respectively. Next, an affine transformation is applied on the inputs resulting in the output
+
+$$
+\hat { x } _ { 3 } = \hat { x } _ { 1 } + \hat { x } _ { 2 } = 1 + 0 . 5 \cdot \eta _ { 1 } + 0 . 5 \cdot \eta _ { 2 } , l _ { 3 } = 0 , u _ { 3 } = 2
+$$
+
+and
+
+$$
+\hat { x } _ { 4 } = \hat { x } _ { 1 } - \hat { x } _ { 2 } = 0 . 5 \cdot \eta _ { 1 } - 0 . 5 \cdot \eta _ { 2 } , l _ { 4 } = - 1 , u _ { 4 } = 1 .
+$$
+
+Note that the Zonotope affine transformer is exact for this transformation. Next, the Zonotope ReLU transformer is applied. We note that as $l _ { 3 } \geq 0$ , the neuron $x _ { 3 }$ provably takes only non-negative values. Thus, the ReLU Zonotope transformer outputs ${ \hat { x } } _ { 5 } = { \hat { x } } _ { 3 }$ and we set $l _ { 5 } = l _ { 3 } , u _ { 5 } = l _ { 3 }$ which is the exact result. For $x _ { 4 }$ , $l _ { 4 } < 0$ and $u _ { 4 } > 0$ and thus neuron $x _ { 4 }$ can take both positive and negative values. The corresponding output does not have a closed affine form and hence the approximation in blue shown in Fig. 2 is used to compute the result. This approximation minimizes the area of the result in the input-output plane and introduces a new noise symbol $\eta _ { 3 } \in [ - 1 , 1 ]$ . The result is
+
+$$
+\hat { x } _ { 6 } = 0 . 2 5 + 0 . 2 5 \cdot \eta _ { 1 } - 0 . 2 5 \cdot \eta _ { 2 } + 0 . 2 5 \cdot \eta _ { 3 } , l _ { 6 } = - 0 . 5 , u _ { 6 } = 1 .
+$$
+
+Note that the Zonotope approximation for $x _ { 6 }$ from Fig. 2 permits negative values whereas $x _ { 6 }$ can only take non-negative values in the concrete. This overapproximation typically accumulates as the analysis progresses deeper into the network, resulting in overall imprecision and failure to prove properties that actually hold.
+
+MILP-based refinement at second layer. Next, the analysis handles the second affine transformation and computes
+
+$$
+\hat { x } _ { 7 } = \hat { x } _ { 5 } - \hat { x } _ { 6 } + 1 = 1 . 7 5 + 0 . 2 5 \cdot \eta _ { 1 } + 0 . 7 5 \cdot \eta _ { 2 } - 0 . 2 5 \cdot \eta _ { 3 } , l _ { 7 } = 0 . 5 , u _ { 7 } = 3
+$$
+
+and
+
+$$
+\hat { x } _ { 8 } = \hat { x } _ { 5 } - \hat { x } _ { 6 } - 1 = - 0 . 2 5 + 0 . 2 5 \cdot \eta _ { 1 } + 0 . 7 5 \cdot \eta _ { 2 } - 0 . 2 5 \cdot \eta _ { 3 } , l _ { 8 } = - 1 . 5 , u _ { 8 } = 1 .
+$$
+
+Here, $x _ { 7 }$ is provably positive, whereas $x _ { 8 }$ can take both positive and negative values. Due to the approximation for $x _ { 6 }$ , the bounds for $x _ { 7 }$ and $x _ { 8 }$ are imprecise. Note that the DeepZ ReLU transformer for $x _ { 8 }$ applied next will introduce more imprecision and although the ReLU transformer for provably positive inputs such as $x _ { 7 }$ does not lose precision with respect to the input, it still propagates the imprecision in the computation of the abstract values for $x _ { 7 }$ .
+
+Thus, to reduce precision loss, in our method we refine the bounds for both $x _ { 7 }$ and $x _ { 8 }$ by formulating the network up to (and including) the second affine transformation as a MILP instance based on a formulation from Tjeng et al. (2019) and compute bounds for $x _ { 7 }$ and $x _ { 8 }$ , respectively. The MILP solver improves the lower bounds for $x _ { 7 }$ and $x _ { 8 }$ to 1 and $- 1$ , respectively, which then updates the corresponding lower bounds in our abstraction, i.e., $l _ { 7 } = 1$ and $l _ { 8 } = - 1$ .
+
+Next, the ReLU transformer is applied. Since $x _ { 7 }$ is provably positive, we get $\hat { x } _ { 9 } = \hat { x } _ { 7 } , l _ { 9 } = l _ { 7 }$ , and $u _ { 9 } = u _ { 7 }$ . We note that $x _ { 8 }$ can take both positive and negative values and is therefore approximated. However, the ReLU transformer now uses the refined bounds instead of the original bounds and thus the approximation shown in green from Fig. 2 is used. This approximation has smaller area in the input-output plane compared to the blue one and thus reduces the approximation error. The result is
+
+$$
+\hat { x } _ { 1 0 } = 0 . 1 2 5 + 0 . 1 2 5 \cdot \eta _ { 1 } + 0 . 3 7 5 \cdot \eta _ { 2 } - 0 . 1 2 5 \cdot \eta _ { 3 } + 0 . 2 5 \cdot \eta _ { 4 } , l _ { 8 } = - 0 . 5 , u _ { 8 } = 1 .
+$$
+
+LP-based refinement at final layer. Continuing with the analysis, we now process the final affine transformation, which yields
+
+$$
+{ \hat { x } } _ { 1 1 } = 4 . 8 7 5 + 0 . 6 2 5 \cdot \eta _ { 1 } + 1 . 8 7 5 \cdot \eta _ { 2 } - 0 . 6 2 5 \cdot \eta _ { 3 } + 0 . 2 5 \cdot \eta _ { 4 } , l _ { 1 1 } = 1 . 7 5 , u _ { 1 1 } = 8 . 2 5
+$$
+
+and
+
+$$
+{ \hat { x } } _ { 1 2 } = 2 . 6 2 5 + 0 . 1 2 5 \cdot \eta _ { 1 } + 0 . 3 7 5 \cdot \eta _ { 2 } - 0 . 1 2 5 \cdot \eta _ { 3 } - 0 . 2 5 \cdot \eta _ { 4 } , l _ { 1 2 } = 1 . 7 5 , u _ { 1 2 } = 3 . 5 .
+$$
+
+Due to the approximations from previous layers, the computed values can be imprecise. We note that, as the analysis proceeds deeper into the network, refining bounds with MILP becomes expensive. Thus, we refine the bounds by encoding the network up to (and including) the third affine transformation using the faster LP relaxation of the network based on Ehlers (2017) and compute the bounds for $x _ { 1 1 }$ and $x _ { 1 2 }$ , respectively. This leads to better results for $l _ { 1 1 } = 3 . 2 5$ , $l _ { 1 2 } = 2$ , and $u _ { 1 2 } = 3$ . As both $x _ { 1 1 }$ and $x _ { 1 2 }$ are provably positive, the subsequent ReLU transformations set $\hat { x } _ { 1 3 } = \hat { x } _ { 1 1 } , l _ { 1 3 } = l _ { 1 1 } , u _ { 1 3 } = u _ { 1 1 }$ and $\hat { x } _ { 1 4 } = \hat { x } _ { 1 2 } , l _ { 1 4 } = l _ { 1 2 } , u _ { 1 4 } = u _ { 1 2 } .$ .
+
+Proving robustness. Since the lower bound $l _ { 1 3 }$ for $x _ { 1 3 }$ is greater than the upper bound $u _ { 1 4 }$ for $x _ { 1 4 }$ , our analysis can prove that the given neural network provides the same label for all inputs in $[ 0 , 1 ] \times [ 0 , 1 ]$ and is thus robust. In contrast, DeepZ without our refinement would compute
+
+$$
+{ \hat { x } } _ { 1 3 } = 4 . 9 5 + 0 . 6 \cdot \eta _ { 1 } + 1 . 8 \cdot \eta _ { 2 } - 0 . 6 \cdot \eta _ { 3 } + 0 . 3 \cdot \eta _ { 4 } , l _ { 1 3 } = 1 . 6 5 , u _ { 1 3 } = 8 . 2 5
+$$
+
+and
+
+$$
+\hat { x } _ { 1 4 } = 2 . 5 5 + 0 . 1 5 \cdot \eta _ { 1 } + 0 . 4 5 \cdot \eta _ { 2 } - 0 . 1 5 \cdot \eta _ { 3 } - 0 . 3 \cdot \eta _ { 4 } , l _ { 1 4 } = 1 . 5 , u _ { 1 4 } = 3 . 6 .
+$$
+
+As a result, DeepZ fails to prove that $x _ { 1 3 }$ is greater than $x _ { 1 4 }$ , and thus fails to prove robustness.
+
+Generalization to other abstractions. We note that our refinement-based approach is not restricted to the Zonotope domain. It can be extended for refining the results computed by other abstractions such as Polyhedra (Singh et al., 2017) or the abstraction used in DeepPoly (Singh et al., 2019). For example, the ReLU transformer in Singh et al. (2019) also depends on the bounds of input neurons and thus it will benefit from the precise bounds computed using our refinement. Since DeepPoly often produces more precise results than DeepZ, we believe a combination of this work with DeepPoly will further improve verification results.
+
+# 3 OUR APPROACH
+
+We now describe our approach in more formal terms. As in the previous section, we will consider affine transformations and ReLU activations as separate layers. As illustrated earlier, the key idea will be to combine abstract interpretation (Cousot & Cousot, 1977) with exact and inexact MILP formulations of the network, which are then solved, in order to compute more precise results for neuron bounds. We begin by describing the core ingredients of abstract interpretation.
+
+Our approach requires an abstract domain $\mathbb { A } _ { n }$ over $n$ variables (i.e., some set whose elements can be encoded symbolically) such as Interval, Zonotope, the abstraction in DeepPoly, or Polyhedra. An abstract domain has a bottom element $\perp \in \mathbb { A } _ { n }$ as well as the following components:
+
+• A (potentially non-computable) concretization function $\gamma _ { n } \colon \mathbb { A } _ { n } \to { \mathcal { P } } ( \mathbb { R } ^ { n } )$ that associates with each abstract element $a \in \mathbb { A } _ { n }$ the set of concrete points from $\mathbb { R } ^ { n }$ that it abstracts. We have $\gamma _ { n } ( \bot ) = \emptyset$ .
+• An abstraction function $\alpha _ { n } \colon { \mathbb { B } } _ { n } \to { \mathbb { A } } _ { n }$ , where $\mathbb { X } \subseteq \gamma _ { n } ( \alpha _ { n } ( \mathbb { X } ) )$ for all $\mathbb { X } \in \mathbb { B } _ { n }$ . We assume that $\textstyle \alpha _ { n } ( \prod _ { i } [ l _ { i } , u _ { i } ] )$ is a computable function of $l , \pmb { u } \in \mathbb { R } ^ { n }$ . Here, $\begin{array} { r } { \mathbb { B } _ { n } = \bigcup _ { l , u \in \mathbb { R } ^ { n } } \prod _ { i } [ l _ { i } , u _ { i } ] } \end{array}$ and $\begin{array} { r } { \prod _ { i } [ l _ { i } , u _ { i } ] = \{ \pmb { x } \in \mathbb { R } ^ { n } \ | \ l _ { i } \leq x _ { i } \leq u _ { i } \} . } \end{array}$ . (For many abstract domains, $\alpha _ { n }$ can be defined on a larger domain $\mathbb { B } _ { n }$ , but in this work, we only consider Interval input regions.)
+• A bounding box function $\iota _ { n } \colon \mathbb { A } _ { n } \to \mathbb { R } ^ { n } \times \mathbb { R } ^ { n }$ , where $\begin{array} { r } { \gamma _ { n } ( a ) \subseteq \prod _ { i } [ l _ { i } , u _ { i } ] } \end{array}$ for $( l , u ) = \iota _ { n } ( a )$ for all $a \in \mathbb { A } _ { n }$ .
+• A meet operation $a \sqcap L$ for each $a \in \mathbb { A } _ { n }$ and linear constraints $L$ over $n$ real variables, where $\{ x ^ { \prime } \in \gamma _ { n } ( a ) \mid L ( x ) \} \subseteq \gamma _ { n } ( a \cap L )$ .
+• An affine abstract transformer T #x7→Ax+b : Am → An for each transformation of the form $( { \pmb x } \mapsto { \pmb A } { \pmb x } + { \pmb b } ) \colon \mathbb { R } ^ { m } \to \mathbb { R } ^ { n }$ , where $\{ A x + b \mid x \in \gamma _ { n } ( a ) \} \subseteq \gamma _ { n } ( T _ { x \mapsto A x + b } ^ { \# } ( a ) )$
+
+for all $a \in \mathbb { A } _ { m }$
+
+• A ReLU abstract transformer $T _ { \mathrm { R e L U } | _ { \Pi _ { i } [ l _ { i } , u _ { i } ] } } ^ { \# } : \mathbb { A } _ { n } \to \mathbb { A } _ { n }$ , where
+
+$$
+\{ \mathrm { R e L U } ( { \pmb x } ) \mid { \pmb x } \in \gamma _ { n } ( a ) \cap \prod _ { i } [ l _ { i } , u _ { i } ] \} \subseteq T _ { \mathrm { R e L U } | _ { \prod _ { i } [ l _ { i } , u _ { i } ] } } ^ { \# } ( a )
+$$
+
+for all abstract elements $a \in \mathbb { A } _ { n }$ and for all lower and upper bounds $l , \pmb { u } \in \mathbb { R } ^ { n }$ on input activations of the ReLU operation.
+
+Verification via Abstract interpretation. As first shown by Gehr et al. (2018), any such abstract domain induces a method for robustness certification of neural networks with ReLU activations.
+
+For example, assume that we want to certify that a given neural network $f \colon { \mathbb { R } } ^ { m } \to { \mathbb { R } } ^ { n }$ considers class $i$ more likely than class $j$ for all inputs $\bar { \mathbf { x } }$ with $| | \bar { \pmb x } - \pmb x | | _ { \infty } \le \epsilon$ for a given $_ { \textbf { \em x } }$ and $\epsilon$ . We can first use the abstraction function $\alpha _ { m }$ to compute a symbolic overapproximation of the set of possible inputs $\bar { \mathbf { x } }$ , namely
+
+$$
+a _ { \mathrm { i n } } = \alpha _ { m } ( \{ \bar { \pmb { x } } \in \mathbb { R } ^ { m } \ | \ | \bar { \pmb { x } } - \pmb { x } | | _ { \infty } \leq \epsilon \} ) .
+$$
+
+Given that the neural network can be written as a composition of affine functions and ReLU layers, we can then propagate the abstract element $a _ { \mathrm { i n } } ^ { }$ through the corresponding abstract transformers to obtain a symbolic overapproximation $a _ { \mathrm { o u t } }$ of the concrete outputs of the neural network.
+
+For example, if the neural network $f ( \boldsymbol { x } ) = A ^ { \prime } \cdot \mathrm { R e L U } ( A \boldsymbol { x } + \boldsymbol { b } ) + b ^ { \prime }$ has a single hidden layer with $h$ hidden neurons, we first compute T #x7→Ax+b(ain), which is a symbolic overapproximation of the input to the ReLU activation function. We then compute $( l , u ) = \iota _ { h } ( a ^ { \prime } )$ to obtain opposite corners of a bounding box of all possible ReLU input activations, such that we can apply the ReLU abstract transformer:
+
+$$
+a ^ { \prime \prime } = T _ { \mathrm { R e L U } | } ^ { \# } { } _ { \Pi _ { i } \lbrack l _ { i } , u _ { i } \rbrack } ( a ^ { \prime } ) .
+$$
+
+Finally, we apply the affine abstract transformer again to obtain T #x7→A0x+b0 (a00). Using our assumptions, we can conclude that the set $\gamma _ { n } ( a _ { \mathrm { o u t } } )$ contains all output activations that $f$ can possibly produce when given any of the inputs $\bar { \mathbf { x } }$ . Therefore, if $a _ { \mathrm { o u t } } \sqcap ( x _ { i } \leq x _ { j } ) = \bot$ , we have proved the property: for all $\bar { \mathbf { x } }$ , the neural network considers class $i$ more likely than class $j$ .
+
+Incompleteness. While this approach is sound (i.e., whenever we prove the property, it actually holds), it is incomplete (i.e., we might not prove the property, even if it holds), because the abstract transformers produce a superset of the set of concrete outputs that the corresponding concrete executions produce. This can be quite imprecise for deep neural networks, because the overapproximations introduced in each layer accumulate.
+
+Refining the bounds. To combat spurious overapproximation, we use mixed integer linear programming (MILP) to compute refined lower and upper bounds $\mathbf { \Phi } _ { l ^ { \prime } , \mathbf { \Lambda } \mathbf { u } ^ { \prime } }$ after applying each affine abstract transformer (except for the first layer). We then refine the abstract element using the meet operator of the underlying abstract domain and the linear constraints $l _ { i } ^ { \prime } \le x _ { i } \le u _ { i } ^ { \prime }$ for all input activations $i$ , i.e., we replace the current abstract element $a$ by $a ^ { \prime } = a \sqcap ( \bigwedge _ { i } l _ { i } ^ { \prime } \leq x _ { i } \leq u _ { i } ^ { \prime } )$ , and continue analysis with the refined abstract element.
+
+Importantly, we obtain a more refined abstract transformer for ReLU than the one used in DeepZ by leveraging the new lower and upper bounds. That is, using the tighter bounds $l _ { x } ^ { \prime } , u _ { x } ^ { \prime }$ for $x$ , we define the ReLU transformer for $y : = \operatorname* { m a x } ( 0 , x )$ as follows:
+
+$$
+\begin{array} { r } { \hat { y } = \left\{ \begin{array} { l l } { \hat { x } , } & { \mathrm { i f ~ } l _ { x } ^ { \prime } > 0 , } \\ { 0 , } & { \mathrm { i f ~ } u _ { x } ^ { \prime } \leq 0 , } \\ { \lambda \cdot \hat { x } + \mu + \mu \cdot \epsilon _ { \mathrm { n e w } } , } & { \mathrm { o t h e r w i s e } . } \end{array} \right. } \end{array}
+$$
+
+Here $\begin{array} { r } { \lambda = \frac { u _ { x } ^ { \prime } } { u _ { x } ^ { \prime } - l _ { x } ^ { \prime } } } \end{array}$ x− l 0x , µ = − u0x·l0x2·(u0x−l0x) , and new ∈ [−1, 1] is a new noise symbol.
+
+The refined ReLU transformer benefits from the improved bounds. For example, when $l _ { x } < 0$ and $u _ { x } > 0$ holds for the original bounds then after refinement:
+
+• If $l _ { x } ^ { \prime } > 0$ , then the output is the same as the input and no overapproximation is added. • Else if $u _ { x } ^ { \prime } \leq 0$ , then the output is exact. • Otherwise, as shown in Fig. 2, the approximation with the tighter $l _ { x } ^ { \prime }$ and $u _ { x } ^ { \prime }$ has smaller area in the input-output plane than the original transformer that uses the imprecise $l _ { x }$ and $u _ { x }$ .
+
+Obtaining constraints for refinement. To enable refinement with MILP, we need to obtain constraints which fully capture the behavior of the neural network up to the last layer whose abstract transformer has been executed. In our encoding, we have one variable for each neuron and we write $x _ { i } ^ { ( k ) }$ to denote the variable corresponding to the activation of the $i$ -th neuron in the $k$ -th layer, where the input layer has $k = 0$ . Similarly, we write $l _ { i } ^ { ( k ) }$ ) and u(k)i to denote the best derived lower and upper bounds for this neuron.
+
+From the input layer, we obtain constraints of the form $l _ { i } ^ { 0 } \ \leq \ x _ { i } ^ { ( 0 ) } \ \leq \ u _ { i } ^ { 0 }$ , from affine layers, we obtain constraints of the form $\begin{array} { r } { x _ { i } ^ { ( k ) } = \sum _ { j } a _ { i j } ^ { ( k - 1 ) } x _ { j } ^ { ( k - 1 ) } + \bar { b } _ { i } ^ { ( k - 1 ) } } \end{array}$ and from ReLU layers we obtain constraints of the form $x _ { i } ^ { ( k ) } = \operatorname* { m a x } ( 0 , x _ { i } ^ { ( k - 1 ) } )$
+
+MILP. Let $\varphi ^ { ( k ) }$ denote the conjunction of all constraints up to and including those from layer $k$ . To obtain the best possible lower and upper bounds for layer $k$ with $p$ neurons, we need to solve the following $2 \cdot p$ optimization problems:
+
+$$
+\begin{array} { l } { { l _ { i } ^ { \prime ( k ) } = \displaystyle \operatorname* { m i n } _ { x _ { 1 } ^ { ( 0 ) } , \ldots , x _ { p } ^ { ( k ) } } x _ { i } ^ { ( k ) } , \mathrm { f o r } i = 1 , \ldots , p , } } \\ { { \mathrm { s . t . } \varphi ^ { ( k ) } ( x _ { 1 } ^ { ( 0 ) } , \ldots , x _ { p } ^ { ( k ) } ) } } \\ { { u _ { i } ^ { \prime ( k ) } = \displaystyle \operatorname* { m a x } _ { x _ { 1 } ^ { ( 0 ) } , \ldots , x _ { p } ^ { ( k ) } } x _ { i } ^ { ( k ) } , \mathrm { f o r } i = 1 , \ldots , p . } } \\ { { \mathrm { s . t . } \varphi ^ { ( k ) } ( x _ { 1 } ^ { ( 0 ) } , \ldots , x _ { p } ^ { ( k ) } ) } } \end{array}
+$$
+
+As was shown by Tjeng et al. (2019), such optimization problems can be encoded exactly as MILP instances using the bounds computed by abstract interpretation and the instances can then be solved using off-the-shelf MILP solvers to comput e l0(k) and $u _ { i } ^ { \prime ( k ) }$ .
+
+LP relaxation. While not introducing any approximation, unfortunately, current MILP solvers do not scale to larger neural networks. It becomes increasingly more expensive to refine bounds with the MILP-based formulation as the analysis proceeds deeper into the network. However, for soundness it is not crucial that the produced bounds are the best possible: for example, plain abstract interpretation uses sound bounds produced by the bounding box function $\iota$ instead. Therefore, for deeper layers in the network, we explore the trade-off between precision and scalability by also considering an intermediate method, which is faster than exact MILP, but also more precise than abstract interpretation. We relax the constraints in $\varphi ^ { ( k ) }$ using the bounds computed by abstract interpretation in the same way as Ehlers (2017) to obtain a set of weaker linear constraints $\varphi _ { \mathrm { L P } } ^ { ( k ) }$ . We then use the solver to solve the relaxed optimization problems that are constrained by $\varphi _ { \mathrm { L P } } ^ { ( k ) }$ instead of $\varphi ^ { ( k ) }$ , producing possibly looser bounds $\smash { l ^ { \prime } ( k ) }$ and ${ \pmb u } ^ { \prime ( k ) }$ . Note that the encoding of subsequent layers depends on the bounds computed in previous layers, where tighter bounds reduce the amount of newly introduced approximation.
+
+Anytime MILP relaxation. MILP solvers usually provide the option to provide an explicit timeout after which the solver must terminate. In return, the solver may not be able to solve the instance exactly, but it will instead provide lower and upper bounds on the objective function in a best-effort fashion. This provides another way to compute sound but inexact bounds $\smash { l ^ { \prime } ( k ) }$ and ${ \pmb u } ^ { \prime ( k ) }$ .
+
+In practice, we choose a fraction $\theta \in ( 0 , 1 ]$ of neurons in a given layer $k$ and compute bounds for them using MILP with a timeout $T$ in a first step. In the second step, for a fraction $\delta \in [ 0 , 1 - \theta ]$ of neurons in the layer, we set the timeout to $\beta \cdot { \overline { { T } } }$ , where $\overline { T }$ is the average time taken by the MILP solver to solve one of the instances from the first step and $\beta \in [ 0 , 1 ]$ is a parameter.
+
+Neuron selection heuristic. To select the $\theta$ -fraction of neurons for the first step of the anytime MILP relaxation for the $k$ -th layer, we rank the neurons. If the next layer is a ReLU layer, we first ignore all neurons whose activations can be proven to be non-positive using abstract interpretation (i.e., using the bounds produced by $\iota$ ), because in this case it is already known that ReLU will map the activation to 0. The remaining neurons are ordered in up to two different ways, once by width (i.e. neuron $i$ has key u(k)i − l(k)i ), and possibly once by the sum of absolute output weights. i.e., if the next layer is a fully connected layer ${ \pmb x } \mapsto { \pmb A } { \pmb x } + { \pmb b }$ , the key of neuron $i$ is $\textstyle \sum _ { j } | A _ { i , j } |$ . If the next layer is a ReLU layer, we skip the ReLU layer and use the weights from the fully connected layer that follows it (if any). The two ranks of a neuron in both orders are added, and the $\theta$ -fraction with smallest rank sum is selected and their bounds are refined with a timeout of $T$ whereas the next $\delta$ -fraction of neurons are refined with a timeout of $\beta \cdot { \overline { { T } } }$ .
+
+RefineZono: end-to-end approach. To certify robustness of deep neural networks, we combine MILP, LP relaxation, and abstract interpretation. We first pick numbers of layers $k _ { \mathrm { M I L P } } , k _ { \mathrm { L P } } , k _ { \mathrm { A I } }$ that sum to the total number of layers of the neural network. For the analysis of the first $k _ { \mathrm { M I L P } }$ layers, we refine bounds using anytime MILP relaxation with the neuron selection heuristic. As an optimization, we do not perform refinement after the abstract transformer for the first layer in case it is an affine transformation, as the abstract domain computes the tightest possible bounding box for an affine transformation of a box (this is always the case in our experiments). For the next $k _ { \mathrm { L P } }$ layers, we refine bounds using LP relaxation (i.e., the network up to the layer to be refined is encoded using linear constraints) combined with the neuron selection heuristic. For the remaining $k _ { \mathrm { A I } }$ layers, we use abstract interpretation without additional refinement (however, this also benefits from refinement that was performed in previous layers), and compute the bounds using $\iota$ .
+
+Final property certification. Let $k$ be the index of the last layer and $p$ be the number of output classes. We can encode the final certification problem using the output abstract element $a _ { \mathrm { o u t } }$ obtained after applying the abstract transformer for the last layer in the network. If we want to prove that class $i$ is assigned a higher probability than class $j$ , it suffices to show that $a _ { \mathrm { o u t } } \sqcap ( x _ { i } ^ { ( k ) } \leq x _ { j } ^ { ( k ) } ) = \bot$ . If this fails, one can resort to complete verification using MILP: the property is satisfied if and only if the set of constraints $\varphi ^ { ( k ) } ( x _ { 1 } ^ { ( 0 ) } , \dots , x _ { p } ^ { ( k ) } ) \wedge ( x _ { i } ^ { ( k ) } \leq x _ { j } ^ { ( k ) } )$ )) ∧ (x(k)i ≤ is unsatisfiable.
+
+Table 1: Neural network architectures used in our experiments.
+
+
Dataset
Model
Type
#Neurons
#layers
Defense
MNIST
3×50
fully connected
160
3
None
5×100
fully connected
510
5
DiffAI
6×100
fully connected
610
6
None
9 ×100
fully connected
910
9
None
6 ×200
fully connected
1210
6
None
9 ×200
fully connected
1810
9
None
ConvSmall
convolutional
3 604
3
None
ConvBig
convolutional
34688
6
DiffAI
ConvSuper
convolutional
88 500
6
DiffAI
CIFAR10
6 ×100
fully connected
610
6
None
ConvSmall
convolutional
4852
3
DiffAI
ACAS Xu
6×50
fully connected
305
6
None
+
+# 4 EVALUATION
+
+We evaluate the effectiveness of our approach for the robustness verification of ReLU-based feedforward and convolutional neural networks. The results show that our approach enables faster complete verification than the state-of-the-art complete verifiers: Wang et al. (2018b) and Tjeng et al. (2019), and produces more precise results than state-of-the-art incomplete verifiers: DeepZ (Singh et al., 2018) and DeepPoly (Singh et al., 2019), when complete certification becomes infeasible.
+
+We implemented our approach in a system called RefineZono. RefineZono uses Gurobi (Gurobi Optimization, LLC, 2018) for solving MILP and LP instances and is built on top of the ELINA library (eli, 2018; Singh et al., 2017) for numerical abstract domains. All of our code, neural networks, and images used in our experiments are publicly available at https://github.com/eth-sri/eran.
+
+Evaluation datasets. We used the popular MNIST (Lecun et al., 1998), CIFAR10 (Krizhevsky, 2009), and ACAS $\mathrm { X u }$ (Julian et al., 2018) datasets in our experiments. MNIST contains grayscale images of size $2 8 \times 2 8$ pixels whereas CIFAR10 contains RGB images of size $3 2 \times 3 2$ . ACAS Xu contains 5 inputs representing aircraft sensor data.
+
+Neural networks. Table 1 shows 12 different MNIST, CIFAR10, and ACAS Xu feedforward (FNNs) and convolutional networks (CNNs) with ReLU activations used in our experiments. Out of these 4 were trained to be robust against adversarial attacks using DiffAI (Mirman et al., 2018) whereas the remaining 8 had no adversarial training. The largest network in our experiments contains $> 8 8 \mathrm { K }$ neurons whereas the deepest network contains 9 layers.
+
+Robustness properties. For MNIST and CIFAR10, we consider the $L _ { \infty }$ -norm (Carlini & Wagner, 2017) based adversarial region parameterized by $\epsilon \in \mathbb { R }$ . Our goal here is to certify that the network produces the correct label on all points in the adversarial region. For ACAS Xu, our goal is to verify that the property $\phi _ { 9 }$ (Katz et al., 2017) holds for the $6 \times 5 0$ network (known to be hard).
+
+Experimental setup. All experiments for the $3 \times 5 0$ MNIST FNN and all CNNs were carried out on a $2 . 6 \operatorname { G H z } 1 4$ core Intel Xeon CPU E5-2690 with 512 GB of main memory; the remaining FNNs were evaluated on a 3.3 GHz 10 Core Intel i9-7900X Skylake CPU with a main memory of $6 4 \mathrm { G B }$ .
+
+Benchmarks. For each MNIST and CIFAR10 network, we selected the first 100 images from the respective test set and filtered out those images that were not classified correctly. We consider complete certification with RefineZono on the ACAS Xu network and the $3 \times 5 0$ MNIST network. For the $3 \times 5 0$ network, we choose an $\epsilon$ for which the incomplete verifier DeepZ certified $< 4 0 \%$ of all candidate images. We consider incomplete certification for the remaining networks and choose an $\epsilon$ for which complete certification with RefineZono becomes infeasible.
+
+Table 2: Precision and runtime of RefineZono vs. DeepZ and DeepPoly.
+
+
Dataset
Model
E
DeepZ
DeepPoly
RefineZono
precision(%)
time(s)
precision(%)
time(s)
precision(%)
time(s)
MNIST
5×100
0.07
38
0.6
53
0.3
53
381
6×100
0.02
31
0.6
47
0.2
67
194
9×100
0.02
28
1.0
44
0.3
59
246
6×200
0.015
13
1.8
32
0.5
39
567
9×200
0.015
12
3.7
30
0.9
38
826
ConvSmall
0.12
7
1.4
13
6.0
21
748
ConvBig
0.2
79
7
78
61
80
193
ConvSuper
0.1
97
133
97
400
97
665
CIFAR10
6×100
0.0012
31
4.0
46
0.6
46
765
ConvSmall
0.03
17
5.8
21
20
21
550
+
+# 4.1 COMPLETE CERTIFICATION
+
+RefineZono first runs DeepZ analysis on the whole network collecting the bounds for all neurons in the network. If DeepZ fails to certify the network, then the collected bounds are used to encode the robustness certification as a MILP instance (discussed in section 3).
+
+ACAS Xu $6 \times 5 0$ network. As this network has only 5 inputs, we uniformly split the pre-condition defined by $\phi _ { 9 }$ to produce 6 300 smaller input regions. We certify that the post-condition defined by $\phi _ { 9 }$ holds for each region with RefineZono. RefineZono certifies that $\phi _ { 9 }$ holds for the network in 227 seconds which is $> 4 \mathbf { x }$ faster than the fastest verifier for ACAS Xu from Wang et al. (2018b).
+
+MNIST $3 \times 5 0$ network. We use $\epsilon = 0 . 0 3$ for the $L _ { \infty }$ -norm attack. We compare RefineZono against the state-of-the-art complete verifier for MNIST from Tjeng et al. (2019). This approach is also MILP-based like ours, but it uses Interval analysis and LP to determine neuron bounds. We implemented the Interval analysis and LP-based analysis to determine the initial bounds. We call the MILP solver only if LP analysis (or Interval analysis) fails to certify. All complete verifiers certify the neural network to be robust against $L _ { \infty }$ -norm perturbations on ${ \dot { 8 } } 5 \%$ of the images. The average runtime of RefineZono, MILP with bounds from the Interval analysis, and MILP with bounds from the LP analysis are 28, 123, and 35 seconds respectively. Based on our result, we believe that the Zonotope analysis offers a good middle ground between the speed of the Interval analysis and the precision of LP for bound computation, as it produces precise bounds faster than LP.
+
+# 4.2 INCOMPLETE CERTIFICATION
+
+We next compare RefineZono against DeepZ and DeepPoly for the incomplete robustness certification of the remaining networks. We note that DeepZ has the same precision as Fast-Lin (Weng et al., 2018) and DeepPoly has the same precision as CROWN (Zhang et al., 2018). The $\epsilon$ values used for the $L _ { \infty }$ -norm attack are shown in Table 2. The $\epsilon$ values for networks trained to be robust are larger than for networks that are not. For each verifier, we report the average runtime per image in seconds and the precision measured by the $\%$ of images for which the verifier certified the network to be robust. We note that running the Interval analysis to obtain initial bounds is too imprecise for these large networks with the $\epsilon$ values considered in our experiments. As a result, the approach from Tjeng et al. (2019) has to rely on applying LP per neuron to obtain precise bounds for the MILP solver which does not scale. For example, on the $9 \times 2 0 0$ network, determining bounds with LP already takes $> ~ 2 0$ minutes (without calling the MILP solver which is more expensive than LP) whereas RefineZono has an average running time of $\approx 1 4$ minutes.
+
+Parameter values. We experimented with different values of the analysis parameters $k _ { \mathrm { M I L P } } , k _ { \mathrm { L P } }$ , ${ { k } _ { \mathrm { A I } } } , \theta , \delta , \beta , T$ and chose values that offered the best tradeoff between performance and precision for the certification of each neural network. We refine the neuron bounds after all affine transformations that are followed by a ReLU except the first one. In a given layer, we consider all neurons that can take positive values after the affine transformation as refinement candidates.
+
+For the MNIST FNNs, we refine the bounds of the candidate neurons in layers 2-4 with MILP and those in the remaining layers using LP. For MILP based refinement, we use $\theta = \textstyle { \frac { \omega } { 5 ^ { k - 2 } \cdot p } }$ where $\omega$ is the number of candidates and $p$ is the total number of neurons in layer $k$ . For LP based refinement, we use θ = ω2k−5·p . We use timeout $T = 1$ second, $\beta = 0 . 5$ , and $\delta = { \frac { \omega } { p } } - \theta$ for both MILP and LP based refinements. For the CIFAR10 FNN, we use the same values except that we use θ = ω2k−2·p for MILP refinement and set $T = 6$ seconds for both MILP and LP based refinement as it is more expensive to refine neuron bounds in CIFAR10 networks due to these having more input neurons.
+
+For the CNNs, the convolutional layers have large number of candidates so we do not refine these. Instead, we refine all candidates in the fully connected layers with a larger timeout so to compensate for the more difficult problem instances for the solver. For the MNIST ConvSmall, ConvBig and CIFAR10 ConvSmall networks, we refine all the candidate neurons using MILP with $T = 1 0$ seconds. For the MNIST ConvSuper network, we refine similarly but use LP with $T = 1 5$ seconds.
+
+Results for incomplete certification. Table 2 shows the precision and the average runtime of all three verifiers. RefineZono either improves or achieves the precision of the state-of-the-art verifiers on all neural networks. It certifies more images than DeepZ on all networks except the MNIST ConvSuper network. This is because DeepZ is already very precise for the $\epsilon$ considered. We could not try larger $\epsilon$ for this network, as the DeepZ analysis becomes too expensive. RefineZono certifies the network to be more robust on more images than DeepPoly on 6 out of 10 networks.
+
+It can be seen that the number of neurons in the network is not the determining factor for the average runtime of RefineZono. We observe that RefineZono runs faster on the networks trained to be robust and the top three networks with the largest runtime for RefineZono are all networks not trained to be robust. This is because robust networks are relatively easier to certify and produce only a small number of candidate neurons for refinement, which are easier to refine by the solver. For example, even though the same parameter values are used for refining the results on the MNIST ConvSmall and ConvBig networks, the average runtime of RefineZono on the robustly trained ConvBig network with $\approx 3 5 \mathrm { K }$ neurons, 6 layers and a perturbation region defined using $\epsilon = 0 . 2$ is almost 4 times less than on the non-robust ConvSmall network with only 3 604 neurons, 3 layers and a smaller $\epsilon = 0 . 1 2$ .
+
+# 4.3 EFFECT OF NEURON SELECTION HEURISTIC
+
+We use the neuron selection heuristic from section 3 to determine neurons which need to be refined more than others for FNNs, as refining all neurons in a layer with MILP can significantly slow down the analysis. To check whether our heuristic can identify important neurons, we ran the analysis on the MNIST $9 \times 2 0 0$ FNN by keeping all analysis parameters the same, except instead of selecting the neurons with the smallest rank sum first we selected the neurons with the largest rank sum first (thus refining neurons more if our heuristic deems them unimportant). With this change, the average runtime does not change significantly. However, the modified analysis loses precision and fails to certify two images that the analysis refining with our neuron selection heuristic succeeds on.
+
+# 5 CONCLUSION
+
+We presented a novel refinement-based approach for effectively combining overapproximation techniques used by incomplete verifiers with linear-programming-based methods used in complete verifiers. We implemented our method in a system called RefineZono and showed its effectiveness on verification tasks involving feedforward and convolutional neural networks with ReLU activations.
+
+Our evaluation demonstrates that RefineZono can certify robustness properties beyond the reach of existing state-of-the-art complete verifiers (these can fail due to scalability issues) while simultaneously improving on the precision of existing incomplete verifiers (which can fail due to using too coarse of an overapproximation).
+
+Overall, we believe combining the strengths of overapproximation methods with those of mixed integer linear programming as done in this work is a promising direction for further advancing the state-of-the-art in neural network verification.
+
+# REFERENCES
+
+ELINA: ETH Library for Numerical Analysis, 2018. URL http://elina.ethz.ch.
+
+Filippo Amato, Alberto Lopez, Eladia Mar ´ ´ıa Pena-M ˜ endez, Petr Va ´ nhara, Ale ˇ s Hampl, and Josef ˇ Havel. Artificial neural networks in medical diagnosis. Journal of Applied Biomedicine, 11(2):47 – 58, 2013.
+
+Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D. Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, Xin Zhang, Jake Zhao, and Karol Zieba. End to end learning for self-driving cars. CoRR, abs/1604.07316, 2016.
+
+Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. In Proc. IEEE Symposium on Security and Privacy (SP), pp. 39–57, 2017.
+
+Chih-Hong Cheng, Georg Nuhrenberg, and Harald Ruess. Maximum resilience of artificial neural ¨ networks. In Automated Technology for Verification and Analysis (ATVA), 2017.
+
+Patrick Cousot and Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th ACM symposium on Principles of programming languages (POPL), pp. 238–252, 1977.
+
+Souradeep Dutta, Susmit Jha, Sriram Sankaranarayanan, and Ashish Tiwari. Output range analysis for deep feedforward neural networks. In NASA Formal Methods (NFM), 2018.
+
+Krishnamurthy Dvijotham, Robert Stanforth, Sven Gowal, Timothy A. Mann, and Pushmeet Kohli. A dual approach to scalable verification of deep networks. CoRR, abs/1803.06567, 2018.
+
+Rudiger Ehlers. Formal verification of piece-wise linear feed-forward neural networks. In ¨ Automated Technology for Verification and Analysis (ATVA), 2017.
+
+Matteo Fischetti and Jason Jo. Deep neural networks and mixed integer linear optimization. Constraints, 23(3):296–309, 2018.
+
+T. Gehr, M. Mirman, D. Drachsler-Cohen, P. Tsankov, S. Chaudhuri, and M. Vechev. AI2: Safety and robustness certification of neural networks with abstract interpretation. In Proc. IEEE Symposium on Security and Privacy (SP), volume 00, pp. 948–963, 2018.
+
+Khalil Ghorbal, Eric Goubault, and Sylvie Putot. The zonotope abstract domain taylor1 $^ +$ . In Proc. Computer Aided Verification (CAV), pp. 627–633, 2009.
+
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, abs/1706.07351, 2014.
+
+Gurobi Optimization, LLC. Gurobi optimizer reference manual, 2018. URL http://www. gurobi.com.
+
+G. Hinton, L. Deng, D. Yu, G. E. Dahl, A. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, and B. Kingsbury. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012.
+
+Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neural networks. In Computer Aided Verification (CAV), pp. 3–29, 2017.
+
+Kyle D. Julian, Mykel J. Kochenderfer, and Michael P. Owen. Deep neural network compression for aircraft collision avoidance systems. CoRR, abs/1810.04240, 2018.
+
+Guy Katz, Clark Barrett, David L. Dill, Kyle Julian, and Mykel J. Kochenderfer. Reluplex: An efficient SMT solver for verifying deep neural networks. In Computer Aided Verification (CAV), pp. 97–117, 2017.
+
+Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
+
+Yann Lecun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. In Proc. of the IEEE, pp. 2278–2324, 1998.
+
+Alessio Lomuscio and Lalit Maganti. An approach to reachability analysis for feed-forward ReLU neural networks. CoRR, 2017.
+
+Matthew Mirman, Timon Gehr, and Martin Vechev. Differentiable abstract interpretation for provably robust neural networks. In Proc. International Conference on Machine Learning (ICML), pp. 3575–3583, 2018.
+
+Aditi Raghunathan, Jacob Steinhardt, and Percy S Liang. Semidefinite relaxations for certifying robustness to adversarial examples. In Proc. Advances in Neural Information Processing Systems (NeurIPS), pp. 10900–10910. 2018.
+
+Gagandeep Singh, Markus Puschel, and Martin Vechev. Fast polyhedra abstract domain. In ¨ Proc. Principles of Programming Languages (POPL), pp. 46–59, 2017.
+
+Gagandeep Singh, Timon Gehr, Matthew Mirman, Markus Puschel, and Martin Vechev. Fast and ¨ effective robustness certification. In Proc. Advances in Neural Information Processing Systems (NeurIPS), pp. 10825–10836. 2018.
+
+Gagandeep Singh, Timon Gehr, Markus Puschel, and Martin Vechev. An abstract domain for certify- ¨ ing neural networks. Proc. ACM Program. Lang., 3(POPL):41:1–41:30, 2019. ISSN 2475-1421.
+
+Vincent Tjeng, Kai Y. Xiao, and Russ Tedrake. Evaluating robustness of neural networks with mixed integer programming. In Proc. International Conference on Learning Representations (ICLR), 2019.
+
+Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. Formal security analysis of neural networks using symbolic intervals. In USENIX Security Symposium (USENIX Security 18), pp. 1599–1614, 2018a.
+
+Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. Efficient formal safety analysis of neural networks. In Proc. Advances in Neural Information Processing Systems (NeurIPS), pp. 6369–6379. 2018b.
+
+Lily Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Luca Daniel, Duane Boning, and Inderjit Dhillon. Towards fast computation of certified robustness for ReLU networks. In Proc. International Conference on Machine Learning (ICML), volume 80, pp. 5276–5285, 2018.
+
+Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In Proc. International Conference on Machine Learning (ICML), volume 80, pp. 5286–5295, 2018.
+
+Weiming Xiang, Hoang-Dung Tran, and Taylor T. Johnson. Output reachable set estimation and verification for multi-layer neural networks. CoRR, abs/1708.03322, 2017.
+
+Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. In Proc. Advances in Neural Information Processing Systems (NeurIPS), pp. 4944–4953. 2018.
\ No newline at end of file
diff --git a/md/train/HJguLo0cKQ/HJguLo0cKQ.md b/md/train/HJguLo0cKQ/HJguLo0cKQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..999cb8e9da087dde8bb8b862b87f26304b5baf09
--- /dev/null
+++ b/md/train/HJguLo0cKQ/HJguLo0cKQ.md
@@ -0,0 +1,255 @@
+# STRENGTH IN NUMBERS: TRADING-OFF ROBUSTNESS AND COMPUTATION VIA ADVERSARIALLY-TRAINED ENSEMBLES
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+While deep learning has led to remarkable results on a number of challenging problems, researchers have discovered a vulnerability of neural networks in adversarial settings, where small but carefully chosen perturbations to the input can make the models produce extremely inaccurate outputs. This makes these models particularly unsuitable for safety-critical application domains (e.g. self-driving cars) where robustness is extremely important. Recent work has shown that augmenting training with adversarially generated data provides some degree of robustness against test-time attacks. In this paper we investigate how this approach scales as we increase the computational budget given to the defender. We show that increasing the number of parameters in adversarially-trained models increases their robustness, and in particular that ensembling smaller models while adversarially training the entire ensemble as a single model is a more efficient way of spending said budget than simply using a larger single model. Crucially, we show that it is the adversarial training of the ensemble, rather than the ensembling of adversarially trained models, which provides robustness.
+
+# 1 INTRODUCTION
+
+Deep neural networks have demonstrated state-of-the-art performance in a wide range of application domains Krizhevsky et al. (2012). However, researchers have discovered that deep networks are in some sense ‘brittle’, in that small changes to their inputs can result in wildly different outputs (Huang et al., 2017; Jia & Liang, 2017; Szegedy et al., 2013). For instance, practically imperceptible (to human) modifications to images can result in misclassification of the image with high confidence. Not only are networks susceptible to these ‘attacks’, but these attacks are also relatively easy to compute using standard optimization techniques (Carlini & Wagner, 2017b; Goodfellow et al., 2014). These changes are often referred to as adversarial perturbations, in the sense that an adversary could craft a very small change to the input in order to create an undesirable outcome. This phenomenon is not unique to image classification, nor to particular network architectures, nor to particular training algorithms (Papernot et al., 2016; 2017).
+
+Adversarial attacks can be broken into different categories depending on how much knowledge of the underlying model the adversary has access to. In ‘white-box’ attacks the adversary has full access to the model, and can perform both forward and backwards passes (though not change the weights or logic of the network) (Carlini & Wagner, 2017a; Goodfellow et al., 2014). In the ‘black-box’ setting the adversary has no access to the model, but perhaps knows the dataset that the model was trained on (Papernot et al., 2016; 2017). Despite several recent papers demonstrating new defences against adversarial attacks (Akhtar & Mian, 2018; Guo et al., 2017; Liao et al., 2017; Song et al., 2017; Tramer et al., 2018; Warde-Farley & Goodfellow, 2016; Xie et al., 2017; Yuan et al., 2017), recent \` papers have demonstrated that most of these new defences are still susceptible to attacks and largely just obfuscate the gradients that the attacker can follow, and that non-gradient based attacks are still effective Uesato et al. (2018); Athalye et al. (2018).
+
+Exploring Tradeoff of Computation and Robustness In many safety-critical application domains (e.g. self-driving cars), robustness is extremely important even if it comes at the cost of increased computation. This motivated the central question considered by this paper: Is it possible to increase adversarial robustness of a classifier at the cost of increased computation?
+
+There are a number of possibilities to employ extra computation available at runtime. We can use a much larger model that requires more time to run, execute the original model multiple times and aggregate the predictions, or instead of using a single model, make predictions from a portfolio or ensemble of models. While researchers have proposed the use of portfolios and ensembles as a mechanism to improve adversarial robustness Abbasi & Gagne (2017); Thilo Strauss (2017), our ´ experimental results indicate that stronger adversaries are able to attack the ensembles successfully.
+
+Contributions In this paper, we study and analyze the trade-off of adversarial robustness and computation (memory and runtime). We propose the use of adversarial training of ensemble of models and through an exhaustive ablative analysis make the following empirical findings:
+
+• increased computation and/or model size can be used to increase robustness,
+• ensembles on their own are not very robust, but can be made robust through adversarial training where the ensemble is treated as a single model,
+• adversarially trained ensembles are more robust than adversarially trained individual models requiring the same amount of parameters/computation
+
+Related Work Recently, Tramer et al. (2018) investigated the use of ensembles for adversarial \` robustness. However, their goal and approach was quite different from the technique we are investigating. In Tramer et al. (2018), the authors generated adversarial perturbations using an ensemble of \` pre-trained models in order to transfer the example to another model during training. This procedure decouples adversarial example generation from the current model, and consequently the model being trained cannot simply ‘overfit’ to the procedure for generating adversarial examples, which they generally took to be single-step attack methods. The authors demonstrated strong robustness of the resulting trained model to black-box attacks. By contrast, in this paper we investigate using an ensemble of models as our predictive model, and we train the models using multi-step adversarial training. We show increased robustness to both black-box and white-box adversarial attacks using this strategy.
+
+# 2 PRELIMINARIES
+
+Here we lay out the basics of attacking a neural network by the generation of adversarial examples. Denote an input to the network as $\boldsymbol { x } \in \mathbb { R } ^ { d }$ with correct label $\hat { y } \in \mathcal { V } \subset \mathbb { N }$ , and let $m _ { \theta } : \mathbb { R } ^ { d } \mathbb { R } ^ { | \bar { y } | }$ be the mapping performed by the neural network which is parameterized by $\theta \in \mathbb { R } ^ { p }$ . Let $L : \mathcal { V } \times \mathbb { R } ^ { | \mathcal { V } | } \to$ $\mathbb { R }$ denote the loss we are trying to minimize (e.g., the cross-entropy). When training a neural network we seek to solve
+
+$$
+\begin{array} { r l } { \mathrm { m i n i m i z e } } & { { } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } L ( \hat { y } , m _ { \theta } ( x ) ) } \end{array}
+$$
+
+over variable $\theta$ , where $\mathcal { D }$ is the data distribution. Given any fixed $\theta$ we can generate (untargeted) adversarial inputs by perturbing the input $x$ so as to maximize the loss. We restrict ourselves to small perturbations around a nominal input, and we denote by $\boldsymbol { B }$ this set of allowable inputs. For example, if we restrict ourselves to small perturbations in $\ell _ { \infty }$ norm around a nominal input $x ^ { \mathrm { n o m } }$ then we could set $\mathcal { B } = \left\{ x \vert \| x - x ^ { \mathrm { n o m } } \| _ { \infty } \leq \epsilon \right\}$ where $\epsilon > 0$ is the tolerance. A common approach for generating adversarial examples is projected gradient descent Carlini $\&$ Wagner (2016), i.e., to iteratively update the input $x$ by
+
+$$
+\tilde { { \boldsymbol { x } } } ^ { k + 1 } = \Pi _ { { \boldsymbol { \mathcal { B } } } } ( \tilde { { \boldsymbol { x } } } ^ { k } + \eta \nabla _ { x } L ( y , m _ { \theta } ( \tilde { { \boldsymbol { x } } } ^ { k } ) ) ) ,
+$$
+
+where typically $x ^ { 0 } = x + \epsilon$ for some noise $\epsilon$ , $\eta > 0$ is a step-size parameter and $\Pi _ { B }$ denotes the Euclidean projection on $\boldsymbol { B }$ . We add noise to the initial point so that the network can’t memorize the training dataset and mask or obfuscate the gradients at that point Uesato et al. (2018); Athalye et al. (2018), in other words the added noise encourages generalization of adversarial robustness to the test dataset. If instead of using the gradient we just use the sign of the gradient then this is the fast-gradient-sign method Goodfellow et al. (2014). Empirically speaking, for most networks just a few steps of either of these procedures is sufficient to generate an $\tilde { x }$ that is close to $x ^ { \mathrm { n o m } }$ but has a different label with high confidence.
+
+In this paper we are primarily concerned with the performance of ensembles of models when trained with adversarial training Madry et al. (2017). In adversarial training we train a network to minimize a weighted sum of two losses (where the relative weighting is a hyper-parameter). The first loss is the standard loss of the problem we are trying to solve on the normal training data, e.g., the cross-entropy for a classification task. The second loss is the same function as the first loss, except evaluated on adversarially generated data, where typically the adversarial data is generated by attacking the network at that time-step. In other words we replace the problem in eq. (1) with
+
+$$
+\mathbb { E } _ { ( x , y ) \sim \mathcal { D } } ( L ( \hat { y } , m _ { \theta } ( x ) ) + \rho L ( \hat { y } , m _ { \theta } ( \tilde { x } ) ) )
+$$
+
+where $\rho \geq 0$ is the weighting parameter and $\tilde { x }$ is an adversarial example generated from $x$ at model parameters $\theta$ using, for example, the update in eq. (2). This problem is usually approximated by sampling and minimizing the empirical expectation.
+
+# 3 ADVERSARIALLY-TRAINED ENSEMBLES
+
+In this section we lay out the basic strategy of using ensembles of models to increase robustness to adversarial attacks. The notion of ensemble used here simply involves taking $k$ separatelyparameterized models and averaging their predictions. If the output of network $i$ as a function of input $x$ and with network parameters $\theta _ { i }$ is given by $p ( \cdot | x , \theta _ { i } ) = m _ { \theta _ { i } } ( \bar { x } )$ , then the output of the ensemble is
+
+$$
+p ( \boldsymbol { y } | \boldsymbol { x } ) = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } _ { i } ) .
+$$
+
+Alternatively, we could consider using a ‘gating network’ to generate data-dependent weights for each model rather than a simple average, though we found the performance to be similar.
+
+Using ensembles to improve the performance of statistical models is a very old idea; see, e.g. Opitz & Maclin (1999) for a survey. The basic intuition is that several weak models can be combined in such a way that the ensemble performs better than any individual, and is sometimes explained as being caused by the errors of the models ‘cancelling’ with one another.
+
+In order to ensure that the models are actually producing different outputs the diversity of the models must be maintained. This can be done in several ways, such as bootstrapping the data, whereby each model gets a slightly different copy of the data, or using totally different model types or architectures. In the case that the model training procedure is convex, and if all models architectures are the same and are getting the same data, then the models in the ensemble would be expected to converge on the same parameters. In the case of neural networks however, the model training procedure is not convex and so our strategy for maintaining diversity is very simple—initialize each model differently. Due to the nature of training neural networks it is likely that differently initialized networks will converge (assuming they do, in fact, converge) to different points of the parameter space. The insight that only different initialization is required is not new, previous papers have observed that different initialization is sufficient for uncertainty estimation Lakshminarayanan et al. (2016); Osband et al. (2016).
+
+Different initialization for networks has an appealing interpretation. If we take a Bayesian approach to the classification problem, then we have a prior over possible model parameters, $p ( \theta )$ , a likelihood of the data, $p ( D | \theta ) ^ { \overline { { } } }$ , and a probability of a label $y$ given an input and a model, $\overset { \cdot } { p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } ) }$ . The ‘Bayes-optimal’ classification of a new data point $x$ is given by
+
+$$
+y ^ { \star } = \mathrm { a r g m a x } _ { y } \int _ { \theta } p ( y | x , \theta ) p ( D | \theta ) p ( \theta ) .
+$$
+
+This classifier is optimal in the sense that no other classifier can outperform it on average, given the same model class and knowledge of the prior and likelihood; however, the formulation is intractable for all but small problems. We can consider approximating it by the following approach, sample initial parameters from the prior $p ( \theta )$ and run an iterative procedure to (approximately) maximize the likelihood $p ( D | \theta )$ . Very loosely speaking, we can consider this procedure as approximately sampling from the posterior over models $p ( \theta | D ) \propto p ( D | \theta ) p ( \theta )$ . Consequently, we output the classification
+
+$$
+y ^ { \star } = \operatorname { a r g m a x } _ { y } \sum _ { i = 1 } ^ { k } p ( y | x , \theta _ { i } ) ,
+$$
+
+Algorithm 1 Adversarial ensemble training using PGD under $\ell _ { \infty }$ norm constraint input: $k$ neural networks $m _ { \theta _ { i } }$ , $i = 1 , \ldots , k$ ; attack steps $N$ ; step sizes $\eta , \hat { \eta }$ ; initial variance $\sigma$ adversarial loss weighting $\rho$ ; perturbation width $\delta$
+
+initialize: neural network parameters $\theta _ { i } ^ { 0 }$ randomly, $i = 1 , \ldots , k$
+for time-step $t = 0 , 1 , \ldots , \mathbf { i }$ o sample input minibatch $( x , \hat { y } ) \sim \mathcal { D }$ initialize $\bar { \tilde { x } } { } ^ { 0 } = x + \epsilon$ where $\epsilon \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ define $\boldsymbol { \mathcal { B } } = \{ x ^ { \prime } \ | \ \| x - x ^ { \prime } \| _ { \infty } \leq \delta \}$ for $k = 0 , \ldots , N - 1$ do
+
+$$
+\tilde { { \boldsymbol { x } } } ^ { k + 1 } = \Pi _ { \mathcal { B } } \big ( \tilde { { \boldsymbol { x } } } ^ { k } + \hat { \eta } \nabla _ { x } L \big ( \hat { y } , \frac { 1 } { k } \sum _ { i = 1 } ^ { k } m _ { \theta _ { i } } ( \tilde { { \boldsymbol { x } } } ^ { k } ) \big ) \big )
+$$
+
+# end for
+
+update parameters for each $i = 1 , \ldots , k$ :
+
+$$
+\theta _ { i } ^ { t + 1 } = \theta _ { i } ^ { t } - \eta \nabla _ { \theta _ { i } } \left( L ( \hat { y } , \frac { 1 } { k } \sum _ { j = 1 } ^ { k } m _ { \theta _ { j } ^ { t } } ( x ) ) + \rho L ( \hat { y } , \frac { 1 } { k } \sum _ { j = 1 } ^ { k } m _ { \theta _ { j } ^ { t } } ( \tilde { x } ^ { N } ) ) \right)
+$$
+
+# end for
+
+i.e., the best guess of the ensemble. The role of initialization therefore is that of sampling from our prior over possible model parameters.
+
+Adversarial training of Ensembles Up to this point we have discussed the use of ensembles for improving classification performance and approximating the Bayes optimal classifier. Typically speaking neural networks appear to not benefit much from ensembling in terms of nominal performance. Here, however, we make the claim that adversarially trained ensembles of networks provide a level of robustness to adversarial attacks. When using ensembles the loss function for adversarial training in (3) is replaced by the mean of the loss over the $k$ models, i.e., now we want to solve
+
+$$
+\begin{array} { r l } { \mathrm { m i n i m i z e } } & { \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \left( L \big ( \hat { y } , \frac { 1 } { k } \sum _ { i = 1 } ^ { k } m _ { \theta _ { i } } ( x ) \big ) + \rho L \big ( \hat { y } , \frac { 1 } { k } \sum _ { i = 1 } ^ { k } m _ { \theta _ { i } } ( \tilde { x } ) \big ) \right) } \end{array}
+$$
+
+over variables $\theta _ { i }$ , $i = 1 , \ldots , k .$ , and where $\tilde { x }$ is an adversarial example generating by attacking the entire ensemble. The exact procedure is outlined in Algorithm 1. We demonstrate empirically in the numerical results section that this procedure increases robustness to adversarial inputs. Following these results, we offer an analysis and hypothesis why ensembles outperform single models, even when controlling for number of parameters.
+
+# 4 EXPERIMENTAL SETUP
+
+# 4.1 MODELS COMPARED
+
+Non-Adversarial Benchmarks The Baseline model for our investigation is a Wide ResNet (Zagoruyko & Komodakis, 2016) consisting of a $3 \times 3$ convolution layer, followed by three layers containing 28 ResNet blocks of width factor 10, followed by batch normalization Ioffe & Szegedy (2015) layer, followed by a ReLU (Nair & Hinton, 2010), and by a final linear layer projecting into the logits of the CIFAR-10 classes. All models we experimented with here are variations on this architecture, and where hyperparameters are not explicitly referenced, they are assumed to be the same as this base model. Ensemble2 contains two copies of the baseline architecture. This has twice the number of parameters of the baseline. Together with the base model, these constitute our non-adversarially trained benchmarks.
+
+Adversarial Models When adding adversarial training to the baseline architecture, we obtain our SingleAdv benchmark, which has the same number of parameters as the baseline. When trained with adversarial training, whereby the whole ensemble is attacked by Iterated Fast Gradient Sign Method (IFGSM) (Kurakin et al., 2016) at each training step to obtain adversarial inputs, we refer to the ensemble as Ensemble2Adv. This ensemble has as many parameters as its non-adversarially-trained counterparts.
+
+
+Figure 1: Schematic depiction of classes of models compared in this paper. Here, $n$ indicates the number of parameters in the base model, $\hat { y }$ indicates the ground trouth label, $x$ is a clean input from the dataset, $\tilde { x }$ is that input after a number of steps of the chosen adversarial training attack (7 steps of IFGSM in our experiments), $y$ is the output distribution according to the network based on clean input $x$ , and $\tilde { y }$ is the output based on adversarial input $\tilde { x }$ . Adversarially trained networks are shown to have two inputs (and two losses) for compactness, but in practice two parameter-sharing copies of the network will be instantiated, with one taking clean input, the other taking adversarial input, and their losses will be computed separately and averaged before optimisation.
+
+Comparisons to Ensemble2Adv In order to compare Ensemble2Adv to the SingleAdv benchmark while controlling for number of parameters, we introduce a variant DoubleAdv of this benchmark with ResNet blocks of width 15, which yields roughly the same number of parameters as Ensemble2Adv. Finally, we train two separately parameterised instances of SingleAdv and ensemble them at test time for the purpose of evaluating the hypothesis that it is adversarial training of ensembles that provides and advantage, and call this test-time model SeparateEnsemble2Adv.
+
+The model variations described here are illustrated in Figure 1, which can serve as a basis for repeating these experiments with a different base model architecture.
+
+# 4.2 TRAINING PROCEDURE
+
+We train and evaluate our models on CIFAR-10 (Krizhevsky & Hinton, 2009). We use similar hyperparameters to Zagoruyko & Komodakis (2016), with additional iterations to account for the fact that minimizing the adversarial objective requires more training steps. We train all models for 500,000 iterations using a momentum optimiser with minibatches of size 128, with an initial learning rate of 0.1, a momentum of 0.9, and a learning rate factor (decay) of 0.2 after $\{ \mathrm { 3 0 k , 6 0 k , 9 0 k } \}$ steps. When doing adversarial training, we train both on “clean” versions of the minibatch images, and on adversarial examples produced by 7 steps of IFGSM, following Madry et al. (2017). The cross-entropy losses with regard to the ground truth labels for both the adversarial and clean images are averaged to obtain gradients for the model (i.e. $\rho = 1$ ).
+
+# 4.3 EVALUATION PROCEDURE
+
+During training, we run an evaluation job which evaluates the accuracy of the model on the entire CIFAR-10 test set. We consider two white-box adversaries, both with a maximum $L _ { \infty }$ perturbation of 8 (out of 255): IFGSM which performs the iterated fast gradient sign method update, which is equivalent to steepest descent with respect to the $L _ { \mathrm { i n f } }$ norm Madry et al. (2017); Kurakin et al. (2016) and PGD which performs projected gradient descent using the Adam Kingma & Ba (2014) update rule. During training, we evaluate using IFGSM7, the training adversary which performs 7 iterations of the IFGSM update, also used in Madry et al. (2017), as well as PGD5 and PGD20, the 5 and 20-step versions of our PGD attack. Additionally, for the best model, we run these attacks 500 steps in order to estimate the strongest possible attacks.
+
+We further include a black-box adversary in our evaluation procedure. We use a dataset of precomputed adversarial examples, following the procedure in Liu et al. (2016) against an ensemble of a Wide ResNet Zagoruyko & Komodakis (2016) and VGG-like Simonyan & Zisserman (2014) architectures. The two models are trained with standard training procedures and achieve $9 6 . 0 \%$ and $9 4 . 5 \%$ accuracy respectively on the CIFAR-10 clean test set, and are ensembled by an arithmetic mean of their logits. The adversary is the PGD20 adversary which fools all members of the ensemble on $100 \%$ of the evaluation set. We note that the exact values for robustness of networks to black box attacks can be highly contingent on the similarity between the original and attacked networks Uesato et al. (2018), rather than the true adversarial robustness of the attacked network. However, we include black box accuracies for best practice, as a check against models which achieve illusory robustness through obscured gradients Goodfellow et al. (2014).
+
+We trained and evaluated each model with three separate random seeds. Evaluation outliers, caused by occasional crashes of evaluation jobs, are removed according to the following procedure. We compute a smoothed version of each time series by using a centered rolling median window of width 50. We take the absolute difference of each original time series and its smoothed form, compute the mean of the difference, and replace points in the original time series with their smoothed version only when the absolute difference exceeds three standard deviations with this mean. This removes at most two outlier points per model per evaluation in our runs. Evaluation time series for different seeds are then interpolated to obtain results on the same 1000 time-steps, which are then averaged across seeds, per model class.
+
+# 5 RESULTS AND ANALYSIS
+
+We give a numerical break down of evaluation accuracies for the metrics described above, during and at the end training, in Table 1: in Table 1a, we report the average of the last 10 evaluation steps for all models, and in Table 1b, we report the evaluation metrics at the time step where each model obtained the best evaluation score on FGSM5. In Figures 2a and 2b, we show the evolution of evaluation accuracies for selected metrics. To more thoroughly evaluate the models compared here, we show in Figure 2c how the accuracy of our models drops as the number of PGD attack steps increases. We report the evaluation results for 500 steps of PGD of the model snapshots used for Table 1b in Table 1c.
+
+Figures 2a and 2b show that adversarially trained models uniformly outperform non-adversarially trained ones. Especially with weaker attacks, such as IFGSM5 and PGD5, non-adversarially trained models exhibit some recovery of robustness to attacks after 2–300,000 steps of training, but this is not stable and decays with further training. We further confirm that even such models which achieve some robustness against weak adversaries have true adversarial robustness close to $0 \%$ when the adversarial optimization is run for longer. In contrast, the robustness of adversarially trained models is stable throughout training. We read, in Table 1b, that all models incorporating adversarial training do slightly worse on the CIFAR-10 test, suffering a drop of roughly 10 points in accuracy, a phenomenon which was also observed in other work Madry et al. (2017). On PGD20, the smallest gap between an adversarially trained model and a baseline is $22 \%$ . Ensemble2Adv yields an improvement of $7 \%$ over a SingleAdv, of $5 \%$ over the parameterically equivalent DoubleAdv, and of $29 \%$ over the non-adversarially trained Ensemble2Adv.
+
+In Figure 2c, we see that while the accuracies of the Ensemble2Adv drop more readily as the number of attack steps increases, they preserve a gap 7 accuracy points over the SingleAdv benchmark. Here, we also compare to an ensemble, Separate2Adv, where the individual models in the ensemble were separately adversarially trained. We observe that this ensemble produces a robustness to adversarial attacks which is closer to the SingleAdv results than to Ensemble2Adv, despite having the exact same structure and number of parameters. We present the evaluation accuracies after 500 steps of PGD in Table 1c, which maintains the relative ordering and rough gaps between models seen in Table 1b, thereby helping validate our results.
+
+Table 1: Evaluation Results
+(a) Average of last 10 evaluation steps
+
+
clean accuracy
IFGSM5 accuracy
PGD5 accuracy
PGD20 accuracy
black box accuracy
Baseline
0.94
0.34
0.15
0.01
0.27
Ensemble2
0.94
0.59
0.44
0.30
0.22
Ensemble4
0.91
0.50
0.40
0.34
0.26
SingleAdv
0.82
0.55
0.44
0.43
0.80
DoubleAdv
0.83
0.57
0.46
0.44
0.82
Ensemble2Adv
0.85
0.62
0.55
0.52
0.83
Ensemble4Adv
0.87
0.66
0.58
0.53
0.85
+
+(b) Evaluation results for model at best IFGSM5 training step
+
+
clean accuracy
FGSM5 accuracy
PGD5 accuracy
PGD20 accuracy
black box accuracy
Baseline
0.95
0.57
0.29
0.09
0.26
Ensemble2
0.95
0.65
0.52
0.38
0.22
Ensemble4
0.93
0.60
0.48
0.43
0.24
SingleAdv
0.84
0.57
0.46
0.45
0.81
DoubleAdv
0.85
0.60
0.48
0.47
0.84
Ensemble2Adv
0.87
0.64
0.56
0.52
0.85
Ensemble4Adv
0.88
0.67
0.58
0.52
0.86
+
+(c) Model accuracy after 500 attack steps.
+
+
Ensemble
Baseline
SingleAdv
DoubleAdv
-2
-2Adv
Separate2Adv
IFGSM
0.16
0.46
0.47
0.13
0.55
0.49
PGD
0.04
0.44
0.47
0.02
0.52
0.47
+
+# 6 DISCUSSION
+
+In this section we briefly discuss the possible reasons for the behaviours observed. As we saw, an ensemble of models trained adversarially outperforms the other setups at test time. We suspect, that this might be happening due to a mechanism described below.
+
+When the model is being trained, it is exposed to pairs of images, both “clean” and adversarially modified. The adversarial training exploits the fact that the original image is close to the decision boundary of the model. The model then, when provided with both clean and adversarial image would attempt to modify the decision boundary in order to engulf them both. It is relatively easy to imagine why SingleAdv would be weaker then the other models—it simply has less parameters than the competition. In order to accommodate the adversarial example it has to compromise the decision boundary somewhere else, pulling it close to other clean images, making it vulnerable to subsequent attack. This is illustrated in Figure 3a.
+
+The possible reason why Ensemble2Adv outperforms DoubleAdv is more elusive. Both models have the same number of parameters, so one could expect them to display a similar performance. As Ensemble2Adv is more robust to white box attack during test time we argue, that this might be due to the fact that in abundance of flexibility DoubleAdv tends often to spread out thin “tentacles”
+
+
+Figure 2: Evaluation Curves
+
+(c) Accuracy under PGD attack as a function of the number of attack steps.
+
+
+Figure 3: Different responses of various architectures to adversarial training. Solid lines represent decision boundary of the models that see only “clean” images. Dashed lines are the boundaries modified due to the presence of adversarial training. The black dot is a clean image, the red dot is its adversarial modification. In the presence of two models $\mathrm { M o d e l } _ { 1 }$ is blue and $\mathrm { M o d e l _ { 2 } }$ is green. In case it needs to be specified with respect to which model the adversarial example is constructed the red dot has a circle in an appropriate color around it.
+
+(Figure 3b) which do not cover up too much of a space. On the other hand, given that Ensemble2Adv is comprised of two separate models they are both subject to lesser ability to overfit following from the smaller number of parameters available in them. Thus we argue, that in most cases the modification of the model with adversarial training covers the adversarial example by modifying one model more than the other. This way the decision boundary of the model modified to a lesser degree still “provides protection” for “clean” images, while at the same time the “tentacle” generated by the model modified more is thicker than the one DoubleAdv creates. We illustrate that with Figure 3c.
+
+Finally, it was shown that SeparateEnsemble2Adv is outperformed by a Ensemble2Adv trained “jointly”. We think that this is due to the fact that the adversarial training has to weaken both of the submodels simultaneously. Figure 3d illustrates that.
+
+For a further illustration of the effects of adversarial training we plotted actual images of the decision boundaries for non-adversarially and adversarially trained Baseline and 2-Ensemble models (Figure 4).
+
+
+Figure 4: Decision boundaries for various architectures/training methods. Each column shows the decision regions of two models on the same 2-dimensional plane in the space of all images. On every picture the black dot corresponds to the datapoint—an unaltered (ship) image from the test dataset. The light rectangle superimposed over the dot represents the bounds of the permitted attack region within the region. The two red arrows are the two vectors—attack directions on the base image, with respect to respectively the first and second tested model. The red dots are the images resulting from the attack. The plane presented is then the (unique) 2-dimensional plane containing those 3 points. Dark grey is void (outside the slice boundaries), and all other pixels are generated by a forward pass of the model at those coordinates, with the colour used representing the majority class.
+
+Decision regions of the models are 3072-dimensional sets, so visualizing them itself poses a challenge. What we present are color-coded values of the models restricted to 2-dimensional planes in the space of all images, chosen so that the original image and the closest adversarial example (or attempt to find one) for both models in a pair being compared are co-planar. We observe, amongst other things, some support for the hypothesis put forward in Figure 3: adversarial training adds “thickness” around the natural image points, pushing the boundary further away from them, and in doing so, making adversarial examples harder to find (even within the test set); ensembling makes some classes more “consistent” within the decision plane, but introduce small “pockets” or “tentacles” of other classes; and the combinator thereof removes said pockets to create large regions of the correct class around images. We believe that such an approach of choosing a good plane and plotting the values of models on it is a more informative way of visualizing phenomena taking place in the universe of robustness and adversarial examples than more traditional approaches like t-SNE plots (Maaten & Hinton, 2008).
+
+# 7 CONCLUSIONS AND FURTHER WORK
+
+In this paper, we provide an empirical study of the effect of increasing the number of parameters in a model trained with adversarial training methods, with regard to its robustness to test-time adversarial attacks. We showed that while increasing parameters improves robustness, it is better to do so by ensembling smaller models than by producing one larger model. Through our experiments, we show that this result is not only due to ensembling alone, or to the implicit robustness of an ensemble of adversarially trained models, but specifically to due to the adversarial training of an ensemble as if it were a single model. We proposed a high level interpretation of why this phenomenon might occur. Further work should seek to determine whether scaling the number of models in the ensemble while controlling for number of parameters produces significant improvements over the minimal ensembles studied here in an attempt to draw conclusions about why such architectures are generally more robust than larger single models, even under adversarial training.
+
+# REFERENCES
+
+Mahdieh Abbasi and Christian Gagne. Robustness to adversarial examples through an ensemble of ´ specialists. 2017. URL http://arxiv.org/abs/1702.06856.
+
+Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. arXiv preprint arXiv:1801.00553, 2018.
+
+Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. Accessed: 2018-02-03, 2018. URL https://arxiv.org/abs/1802.00420.
+
+Nicholas Carlini and David Wagner. Defensive distillation is not robust to adversarial examples. arXiv preprint arXiv:1607.04311, 2016.
+
+Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14. ACM, 2017a.
+
+Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017b.
+
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
+
+Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. arXiv preprint arXiv:1711.00117, 2017.
+
+Sandy Huang, Nicolas Papernot, Ian Goodfellow, Yan Duan, and Pieter Abbeel. Adversarial attacks on neural network policies. arXiv preprint arXiv:1702.02284, 2017.
+
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
+
+Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328, 2017.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 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.
+
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
+
+Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. arXiv preprint arXiv:1612.01474, 2016.
+
+Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. arXiv preprint arXiv:1712.02976, 2017.
+
+Siqi Liu, Zhenhai Zhu, Ning Ye, Sergio Guadarrama, and Kevin Murphy. Improved image captioning via policy gradient optimization of spider. arXiv preprint arXiv:1612.00370, 2016.
+
+Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
+
+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.
+
+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.
+
+David Opitz and Richard Maclin. Popular ensemble methods: An empirical study. Journal of artificial intelligence research, 11:169–198, 1999.
+
+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.
+
+Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
+
+Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pp. 506–519. ACM, 2017.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+
+Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. arXiv preprint arXiv:1710.10766, 2017.
+
+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.
+
+Andrej Junginger Holger Ulmer Thilo Strauss, Markus Hanselmann. Ensemble methods as a defense to adversarial perturbations against deep neural networks. 2017. URL https://arxiv.org/ abs/1709.03423.
+
+Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble \` adversarial training: Attacks and defenses. In ICLR, 2018.
+
+Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. In The 35th International Conference on Machine Learning (ICML), 2018.
+
+David Warde-Farley and Ian Goodfellow. Adversarial perturbations of deep neural networks. Perturbations, Optimization, and Statistics, pp. 311, 2016.
+
+Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
+
+Xiaoyong Yuan, Pan He, Qile Zhu, Rajendra Rana Bhat, and Xiaolin Li. Adversarial examples: Attacks and defenses for deep learning. arXiv preprint arXiv:1712.07107, 2017.
+
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
\ No newline at end of file
diff --git a/md/train/Hk5elxbRW/Hk5elxbRW.md b/md/train/Hk5elxbRW/Hk5elxbRW.md
new file mode 100644
index 0000000000000000000000000000000000000000..273bca6035d9947f289e566d3653e391522ea2ec
--- /dev/null
+++ b/md/train/Hk5elxbRW/Hk5elxbRW.md
@@ -0,0 +1,878 @@
+# SMOOTH LOSS FUNCTIONS FOR DEEP TOP-K CLASSIFICATION
+
+Leonard Berrada1, Andrew Zisserman1 and M. Pawan Kumar1,2
+
+1Department of Engineering Science
+University of Oxford
+2Alan Turing Institute
+{lberrada,az,pawan}@robots.ox.ac.uk
+
+# ABSTRACT
+
+The top- $k$ error is a common measure of performance in machine learning and computer vision. In practice, top- $k$ classification is typically performed with deep neural networks trained with the cross-entropy loss. Theoretical results indeed suggest that cross-entropy is an optimal learning objective for such a task in the limit of infinite data. In the context of limited and noisy data however, the use of a loss function that is specifically designed for top- $k$ classification can bring significant improvements. Our empirical evidence suggests that the loss function must be smooth and have non-sparse gradients in order to work well with deep neural networks. Consequently, we introduce a family of smoothed loss functions that are suited to top- $k$ optimization via deep learning. The widely used cross-entropy is a special case of our family. Evaluating our smooth loss functions is computationally challenging: a na¨ıve algorithm would require $\mathcal { O } ( { \textstyle \binom { n } { k } } )$ operations, where $n$ is the number of classes. Thanks to a connection to polynomial algebra and a divideand-conquer approach, we provide an algorithm with a time complexity of $\mathcal { O } ( k n )$ Furthermore, we present a novel approximation to obtain fast and stable algorithms on GPUs with single floating point precision. We compare the performance of the cross-entropy loss and our margin-based losses in various regimes of noise and data size, for the predominant use case of $k = 5$ . Our investigation reveals that our loss is more robust to noise and overfitting than cross-entropy.
+
+# 1 INTRODUCTION
+
+In machine learning many classification tasks present inherent label confusion. The confusion can originate from a variety of factors, such as incorrect labeling, incomplete annotation, or some fundamental ambiguities that obfuscate the ground truth label even to a human expert. For example, consider the images from the ImageNet data set (Russakovsky et al., 2015) in Figure 1, which illustrate the aforementioned factors. To mitigate these issues, one may require the model to predict the $k$ most likely labels, where $k$ is typically very small compared to the total number of labels. Then the prediction is considered incorrect if all of its $k$ labels differ from the ground truth, and correct otherwise. This is commonly referred to as the top- $k$ error. Learning such models is a longstanding task in machine learning, and many loss functions for top- $k$ error have been suggested in the literature.
+
+In the context of correctly labeled large data, deep neural networks trained with cross-entropy have shown exemplary capacity to accurately approximate the data distribution. An illustration of this phenomenon is the performance attained by deep convolutional neural networks on the ImageNet challenge. Specifically, state-of-the-art models trained with cross-entropy yield remarkable success on the top-5 error, although cross-entropy is not tailored for top-5 error minimization. This phenomenon can be explained by the fact that cross-entropy is top- $k$ calibrated for any $k$ (Lapin et al., 2016), an asymptotic property which is verified in practice in the large data setting. However, in cases where only a limited amount of data is available, learning large models with cross-entropy can be prone to over-fitting on incomplete or noisy labels.
+
+To alleviate the deficiency of cross-entropy, we present a new family of top- $k$ classification loss functions for deep neural networks. Taking inspiration from multi-class SVMs, our loss creates a margin between the correct top- $k$ predictions and the incorrect ones. Our empirical results show that traditional top- $k$ loss functions do not perform well in combination with deep neural networks. We believe that the reason for this is the lack of smoothness and the sparsity of the derivatives that are used in backpropagation. In order to overcome this difficulty, we smooth the loss with a temperature parameter. The evaluation of the smooth function and its gradient is challenging, as smoothing increases the na¨ıve time complexity from ${ \mathcal { O } } ( n )$ to $\mathcal { O } ( { \textstyle \binom { n } { k } } )$ . With a connection to polynomial algebra and a divide-and-conquer method, we present an algorithm with $\mathcal { O } ( k n )$ time complexity and training time comparable to cross-entropy in practice. We provide insights for numerical stability of the forward pass. To deal with instabilities of the backward pass, we derive a novel approximation. Our investigation reveals that our top- $k$ loss outperforms cross-entropy in the presence of noisy labels or in the absence of large amounts of data. We further confirm that the difference of performance reduces with large correctly labeled data, which is consistent with known theoretical results.
+
+
+Figure 1: Examples of images with label confusion, from the validation set of ImageNet. The top-left image is incorrectly labeled as “red panda”, instead of “giant panda”. The bottom-left image is labeled as “strawberry”, although the categories “apple”, “banana” and “pineapple” would be other valid labels. The center image is labeled as “indigo bunting”, which is only valid for the lower bird of the image. The right-most image is labeled as a cocktail shaker, yet could arguably be a part of a music instrument (for example with label “cornet, horn, trumpet, trump”). Such examples motivate the need to predict more than a single label per image.
+
+# 2 RELATED WORK
+
+Top- $k$ Loss Functions. The majority of the work on top- $k$ loss functions has been applied to shallow models: Lapin et al. (2016) suggest a convex surrogate on the top- $k$ loss; Fan et al. (2017) select the $k$ largest individual losses in order to be robust to data outliers; Chang et al. (2017) formulate a truncated re-weighted top- $k$ loss as a difference-of-convex objective and optimize it with the Concave-Convex Procedure (Yuille & Rangarajan, 2002); and Yan et al. (2017) propose to use a combination of top- $k$ classifiers and to fuse their outputs.
+
+Closest to our work is the extensive review of top- $k$ loss functions for computer vision by Lapin et al. (2017). The authors conduct a study of a number of top- $k$ loss functions derived from cross-entropy and hinge losses. Interestingly, they prove that for any $k$ , cross-entropy is top- $k$ calibrated, which is a necessary condition for the classifier to be consistent with regard to the theoretically optimal top- $k$ risk. In other words, cross-entropy satisfies an essential property to perform the optimal top- $k$ classification decision for any $k$ in the limit of infinite data. This may explain why cross-entropy performs well on top-5 error on large scale data sets. While thorough, the experiments are conducted on linear models, or pre-trained deep networks that are fine-tuned. For a more complete analysis, we wish to design loss functions that allow for the training of deep neural networks from a random initialization.
+
+Smoothing. Smoothing is a helpful technique in optimization (Beck & Teboulle, 2012). In work closely related to ours, Lee & Mangasarian (2001) show that smoothing a binary SVM with a temperature parameter improves the theoretical convergence speed of their algorithm. Schwing et al. (2012) use a temperature parameter to smooth latent variables for structured prediction. Lapin et al. (2017) apply Moreau-Yosida regularization to smooth their top- $k$ surrogate losses.
+
+Smoothing has also been applied in the context of deep neural networks. In particular, Zheng et al. (2015) and Clevert et al. (2016) both suggest modifying the non-smooth ReLU activation to improve the training. Gulcehre et al. (2017) suggest to introduce “mollifyers” to smooth the objective function by gradually increasing the difficulty of the optimization problem. Chaudhari et al. (2017) add a local entropy term to the loss to promote solutions with high local entropy. These smoothing techniques are used to speed up the optimization or improve generalization. In this work, we show that smoothing is necessary for the neural network to perform well in combination with our loss function. We hope that this insight can also help the design of losses for tasks other than top- $k$ error minimization.
+
+# 3 TOP-K SVM
+
+# 3.1 BACKGROUND: MULTI-CLASS SVM
+
+In order to build an intuition about top- $k$ losses, we start with the simple case of $k = 1$ , namely multi-class classification, where the output space is defined as $\mathcal { Y } = \{ 1 , . . . , n \}$ . We suppose that a vector of scores per label $\mathbf { s } \in \mathbb { R } ^ { n }$ , and a ground truth label $y \in \mathcal { V }$ are both given. The vector s is the output of the model we wish to learn, for example a linear model or a deep neural network. The notation $\mathbb { 1 }$ will refer to the indicator function over Boolean statements (1 if true, 0 if false).
+
+Prediction. The prediction is given by any index with maximal score:
+
+$$
+P ( \mathbf { s } ) \in \mathrm { a r g m a x } \mathbf { s } .
+$$
+
+Loss. The classification loss incurs a binary penalty by comparing the prediction to the ground truth label. Plugging in equation (1), this can also be written in terms of scores s as follows:
+
+$$
+\Lambda ( \mathbf { s } , y ) \triangleq \mathbb { 1 } ( y \neq P ( \mathbf { s } ) ) = \mathbb { 1 } ( \operatorname* { m a x } _ { j \in \mathcal { Y } } s _ { j } > s _ { y } ) .
+$$
+
+Surrogate. The loss in equation (2) is not amenable to optimization, as it is not even continuous in s. To overcome this difficulty, a typical approach in machine learning is to resort to a surrogate loss that provides a continuous upper bound on $\Lambda$ . Crammer & Singer (2001) suggest the following upper bound on the loss, known as the multi-class SVM loss:
+
+$$
+l ( \mathbf { s } , y ) = \operatorname* { m a x } \left\{ \operatorname* { m a x } _ { j \in \mathcal { V } \backslash \{ y \} } \left\{ s _ { j } + 1 \right\} - s _ { y } , 0 \right\} .
+$$
+
+In other words, the surrogate loss is zero if the ground truth score is higher than all other scores by a margin of at least one. Otherwise it incurs a penalty which is linear in the difference between the score of the ground truth and the highest score over all other classes.
+
+Rescaling. Note that the value of 1 as a margin is an arbitrary choice, and can be changed to $\alpha$ for any $\alpha > 0$ . This simply entails that we consider the cost $\Lambda$ of a misclassification to be $\alpha$ instead of 1. Moreover, we show in Proposition 8 of Appendix D.2 how the choices of $\alpha$ and of the quadratic regularization hyper-parameter are interchangeable.
+
+# 3.2 TOP-K CLASSIFICATION
+
+We now generalize the above framework to top- $k$ classification, where $k \in \{ 1 , . . . , n - 1 \}$ . We use the following notation: for $p \in \{ 1 , . . . , n \}$ , $^ S [ p ]$ refers to the $p$ -th largest element of s, and ${ \mathbf { s } } _ { \backslash p }$ to the vector $( s _ { 1 } , . . . , s _ { p - 1 } , s _ { p + 1 } , . . . , s _ { n } ) \in \mathbb { R } ^ { n - 1 }$ (that is, the vector s with the $p$ -th element omitted). The term $\mathcal { V } ^ { ( k ) }$ denotes the set of $k$ -tuples with $k$ distinct elements of $\mathcal { V }$ . Note that we use a bold font for a tuple $\bar { \mathbf { y } } \in \mathcal { V } ^ { ( k ) }$ in order to distinguish it from a single label $\bar { y } \in \mathcal { V }$ .
+
+Prediction. Given the scores $\mathbf { s } \in \mathbb { R } ^ { n }$ , the top- $k$ prediction consists of any set of labels corresponding to the $k$ largest scores:
+
+$$
+P _ { k } ( \mathbf { s } ) \in \left\{ \bar { \mathbf { y } } \in \mathcal { y } ^ { ( k ) } : \forall i \in \{ 1 , . . , k \} , s _ { \bar { y } _ { i } } \geq s _ { [ k ] } \right\} .
+$$
+
+Loss. The loss depends on whether $y$ is part of the top- $k$ prediction, which is equivalent to comparing the $k$ -largest score with the ground truth score:
+
+$$
+\Lambda _ { k } ( \mathbf { s } , y ) \triangleq \mathbb { 1 } ( y \notin P _ { k } ( \mathbf { s } ) ) = \mathbb { 1 } ( s _ { [ k ] } > s _ { y } ) .
+$$
+
+Again, such a binary loss is not suitable for optimization. Thus we introduce a surrogate loss.
+
+Surrogate. As pointed out in Lapin et al. (2015), there is a natural extension of the previous multi-class case:
+
+$$
+l _ { k } ( { \bf s } , y ) \triangleq \operatorname* { m a x } \left\{ \left( { \bf s } _ { \backslash y } + { \bf 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} .
+$$
+
+This loss creates a margin between the ground truth and the $k$ -th largest score, irrespectively of the values of the $\left( k - 1 \right)$ -largest scores. Note that we retrieve the formulation of Crammer & Singer (2001) for $k = 1$ .
+
+Difficulty of the Optimization. The surrogate loss $l _ { k }$ of equation (6) suffers from two disadvantages that make it difficult to optimize: (i) it is not a smooth function of s – it is continuous but not differentiable – and (ii) its weak derivatives have at most two non-zero elements. Indeed at most two elements of s are retained by the $( \cdot ) _ { [ k ] }$ and max operators in equation (6). All others are discarded and thus get zero derivatives. When $\bar { l _ { k } }$ is coupled with a deep neural network, the model typically yields poor performance, even on the training set. Similar difficulties to optimizing a piecewise linear loss have also been reported by Li et al. (2017) in the context of multi-label classification. We illustrate this in the next section.
+
+We postulate that the difficulty of the optimization explains why there has been little work exploring the use of SVM losses in deep learning (even in the case $k = 1$ ), and that this work may help remedy it. We propose a smoothing that alleviates both issues (i) and (ii), and we present experimental evidence that the smooth surrogate loss offers better performance in practice.
+
+# 3.3 SMOOTH SURROGATE LOSS
+
+Reformulation. We introduce the following notation: given a label $\bar { y } \in \mathcal { V } , \mathcal { V } _ { \bar { y } } ^ { ( k ) }$ is the subset of tuples from $\mathcal { V } ^ { ( k ) }$ that include $\bar { y }$ as one of their elements. For $\bar { \mathbf { y } } \in \mathcal { V } ^ { ( k ) }$ and $y \in \mathcal { V }$ , we further define $\Delta _ { k } ( \bar { \mathbf { y } } , y ) \triangleq \mathbb { 1 } ( y \notin \bar { \mathbf { y } } )$ . Then, by adding and subtracting the $k - 1$ largest scores of ${ \mathbf { s } } _ { \backslash y }$ as well as $s _ { y }$ we obtain:
+
+$$
+\begin{array} { l } { l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } \left\{ \left( { \bf s } _ { \backslash y } + { \bf 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} , } \\ { = \displaystyle \operatorname* { m a x } _ { { \bar { \bf y } } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( { \bar { \bf y } } , y ) + \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \displaystyle \operatorname* { m a x } _ { { \bar { \bf y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \sum _ { j \in \bar { \bf y } } s _ { j } \right\} . } \end{array}
+$$
+
+We give a more detailed proof of this in Appendix A.1. Since the margin can be rescaled without loss of generality, we rewrite $l _ { k }$ as:
+
+$$
+l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} .
+$$
+
+Smoothing. In the form of equation (8), the loss function can be smoothed with a temperature parameter $\tau > 0$ :
+
+$$
+\underline { { \hat { c } } } _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \Bigg [ \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \frac { 1 } { \tau } \Big ( \Delta _ { k } ( \bar { \mathbf { y } } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) \right) \Bigg ] - \tau \log \Bigg [ \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \Big ( \frac { 1 } { k \tau } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) \Bigg ] .
+$$
+
+Note that we have changed the notation to use $L _ { k , \tau }$ to refer to the smooth loss. In what follows, we first outline the properties of $L _ { k , \tau }$ and its relationship with cross-entropy. Then we show the empirical advantage of $L _ { k , \tau }$ over its non-smooth counter-part $l _ { k }$ .
+
+Properties of the Smooth Loss. The smooth loss $L _ { k , \tau }$ has a few interesting properties. First, for any $\tau > 0$ , $L _ { k , \tau }$ is infinitely differentiable and has non-sparse gradients. Second, under mild conditions, when $\tau \to 0 ^ { + }$ , the non-maximal terms become negligible, therefore the summations collapse to maximizations and $L _ { k , \tau } \to l _ { k }$ in a pointwise sense (Proposition 2 in Appendix A.2). Third, $L _ { k , \tau }$ is an upper bound on $l _ { k }$ if and only if $k = 1$ (Proposition 3 in Appendix A.3), but $L _ { k , \tau }$ is, up to a scaling factor, an upper bound on $\Lambda _ { k }$ (Proposition 4 in Appendix A.4). This makes it a valid surrogate loss for the minimization of $\Lambda _ { k }$ .
+
+Relationship with Cross-Entropy. We have previously seen that the margin can be rescaled by a factor of $\alpha > 0$ . In particular, if we scale $\Delta$ by $\alpha 0 ^ { + }$ and choose a temperature $\tau = 1$ , it can be seen that $L _ { 1 , 1 }$ becomes exactly the cross-entropy loss for classification. In that sense, $L _ { k , \tau }$ is a generalization of the cross-entropy loss to: (i) different values of $k \geq 1$ , (ii) different values of temperature and (iii) higher margins with the scaling $\alpha$ of $\Delta$ . For simplicity purposes, we will keep $\alpha = 1$ in this work.
+
+Experimental Validation. In order to show how smoothing helps the training, we train a DenseNet 40-12 on CIFAR-100 from Huang et al. (2017) with the same hyper-parameters and learning rate schedule. The only difference with Huang et al. (2017) is that we replace the cross-entropy loss with $L _ { 5 , \tau }$ for different values of $\tau$ . We plot the top-5 training error in Figure 2a (for each curve, the value of $\tau$ is held constant during training):
+
+
+
+(a) Top-5 training error for different values of τ . The dashed line $y = 0 . 9 5$ represents the base error for random predictions. The successive drops in the curves correspond to the decreases of the learning rate at epochs 150 and 225.
+
+(b) Proportion of non (numerically) zero elements in the loss derivatives for different values of $\tau$ . These values are obtained with the initial random weights of the neural network, and are averaged over the training set.
+
+Figure 2: Influence of the temperature τ on the learning of a DenseNet 40-12 on CIFAR-100. We confirm that smoothing helps the training of a neural network in Figure 2a, where a large enough value of $\tau$ greatly helps the performance on the training set. In Figure 2b, we observe that such high temperatures yield gradients that are not sparse. In other words, with a high temperature, the gradient is informative about a greater number of labels, which helps the training of the model.
+
+We remark that the network exhibits good accuracy when $\tau$ is high enough (0.01 or larger). For $\tau$ too small, the model fails to converge to a good critical point. When $\tau$ is positive but small, the function is smooth but the gradients are numerically sparse (see Figure 2b), which suggests that the smoothness property is not sufficient and that non-sparsity is a key factor here.
+
+# 4 COMPUTATIONAL CHALLENGES AND EFFICIENT ALGORITHMS
+
+# 4.1 CHALLENGE
+
+Experimental evidence suggests that it is beneficial to use $L _ { k , \tau }$ rather than $l _ { k }$ to train a neural network. However, at first glance, $L _ { k , \tau }$ may appear prohibitively expensive to compute. Specifically, there are summations over $\mathcal { V } ^ { ( k ) }$ and ${ \mathcal { V } } _ { y } ^ { ( k ) }$ , which have a cardinality of $\binom { n } { k }$ and $\binom { n } { k - 1 }$ respectively. For instance for ImageNet, we have $k = 5$ and $n = 1 , 0 0 0$ , which amounts to $\binom { n } { k } \simeq 8 . 1 0 ^ { 1 2 }$ terms to compute and sum over for each single sample, thereby making the approach practically infeasible. This is in stark contrast with $l _ { k }$ , for which the most expensive operation is to compute the $k$ -th largest score of an array of size $n$ , which can be done in ${ \mathcal { O } } ( n )$ . To overcome this computational challenge, we will now reframe the problem and reveal its exploitable structure.
+
+For a vector $\mathbf { e } \in \mathbb { R } ^ { n }$ and $i \in \{ 1 , . . , n \}$ , we define $\sigma _ { i } ( \mathbf { e } )$ as the sum of all products of $i$ distinct elements of e. Explicitly, $\sigma _ { i } ( \mathbf { e } )$ can be written as $\begin{array} { r } { \sigma _ { i } ( \mathbf { e } ) = \sum _ { 1 \leq j _ { 1 } < . . . < j _ { i } \leq n } \bar { e _ { j _ { 1 } } } . . . e _ { j _ { i } } } \end{array}$ . The terms $\sigma _ { i }$ are known as the elementary symmetric polynomials. We further define $\sigma _ { 0 } ( \mathbf { e } ) = 1$ for convenience.
+
+We now re-write $L _ { k , \tau }$ using the elementary symmetric polynomials, which appear naturally when separating the terms that contain the ground truth from the ones that do not:
+
+$$
+\begin{array} { r l } { T _ { k , l ; c _ { l } } ( \mathbf { s } , y , y ) = \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( \Delta _ { x } ( \bar { y } , y ) / \tau ) \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] } & { \mathrm { ~ f r o s t ~ } ( s _ { y } / k \tau ) \Bigg ] } \\ & { \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] , } \\ & { = \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) + \exp ( \mathrm { i } / \tau ) \displaystyle \sum _ { y \in S _ { l } } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] } \\ & { \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) + \exp ( \mathrm { i } / \tau ) \displaystyle \sum _ { y \in S _ { l } \backslash \{ x \} _ { y } ^ { \infty } \land \neq y } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) ] } \\ & { \quad \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Big ] , } \\ & { = \tau \log \Bigg [ \exp ( \delta _ { y } ( \mathcal { M } _ { y } / \tau ) \sigma _ { k - i } ( \mathrm { e x p } ( s _ { y } / k \tau ) ) + \exp ( \mathrm { i } / \tau ) \sigma _ { k } \Big ( \exp \{ \mathrm { e x p } ( s _ { y } / k \tau ) \} \Big ] } \\ & { \quad \quad \quad - \tau \log \Bigg [ \exp ( \mathrm { e x p } \{ \mathrm { e x p } / \mathrm { e x p } / \mathrm { e x p } / k \tau \} ) \Big ] . } \end{array}
+$$
+
+Note that the application of exp to vectors is meant in an element-wise fashion. The last equality of equation (10) reveals that the challenge is to efficiently compute $\sigma _ { k - 1 }$ and $\sigma _ { k }$ , and their derivatives for the optimization.
+
+While there are existing algorithms to evaluate the elementary symmetric polynomials, they have been designed for computations on CPU with double floating point precision. For the most recent work, see Jiang et al. (2016). To efficiently train deep neural networks with $L _ { k , \tau }$ , we need algorithms that are numerically stable with single floating point precision and that exploit GPU parallelization. In the next sections, we design algorithms that meet these requirements. The final performance is compared to the standard alternative algorithm in Appendix B.3.
+
+# 4.2 FORWARD COMPUTATION
+
+We consider the general problem of efficiently computing $( \sigma _ { k - 1 } , \sigma _ { k } )$ . Our goal is to compute $\sigma _ { k } ( \mathbf { e } )$ , where $\mathbf { e } \in \mathbb { R } ^ { n }$ and $k \ll n$ . Since this algorithm will be applied to $\mathbf { e } = \exp ( \mathbf { s } _ { \backslash y } / k \tau )$ (see equation (10)), we can safely assume $e _ { i } \neq 0$ for all $i \in [ [ 1 , n ] ]$ .
+
+The main insight of our approach is the connection of $\sigma _ { i } ( \mathbf { e } )$ to the polynomial:
+
+$$
+P \triangleq ( X + e _ { 1 } ) ( X + e _ { 2 } ) . . . ( X + e _ { n } ) .
+$$
+
+Indeed, if we expand $P$ to $\alpha _ { 0 } + \alpha _ { 1 } X + \ldots + \alpha _ { n } X ^ { n }$ , Vieta’s formula gives the relationship:
+
+$$
+\forall i \in [ [ 0 , n ] ] , \quad \alpha _ { i } = \sigma _ { n - i } ( \mathbf { e } ) .
+$$
+
+Therefore, it suffices to compute the coefficients $\alpha _ { n - k }$ to obtain the value of $\sigma _ { k } ( \mathbf { e } )$ . To compute the expansion of $P$ , we can use a divide-and-conquer approach with polynomial multiplications when merging two branches of the recursion.
+
+This method computes all $( \sigma _ { i } ) _ { 1 \leq i \leq n }$ instead of the only $( \sigma _ { i } ) _ { k - 1 \leq i \leq k }$ that we require. Since we do not need $\sigma _ { i } ( \mathbf { e } )$ for $i > k$ , we can avoid computations of all coefficients for a degree higher than $n - k$ . However, typically $k \ll n$ . For example, in ImageNet, we have $k = 5$ and $n = 1 , 0 0 0$ , therefore we have to compute coefficients up to a degree 995 instead of 1,000, which is a negligible improvement. To turn $k \ll n$ to our advantage, we notice that $\sigma _ { i } ( \mathbf { e } ) = \sigma _ { n } ( \mathbf { e } ) \sigma _ { n - i } ( 1 / \mathbf { e } )$ . Moreover, $\sigma _ { n } ( \mathbf { e } ) = \prod _ { i = 1 } ^ { n } e _ { i }$ can be computed in ${ \mathcal { O } } ( n )$ . Therefore we introduce the polynomial:
+
+$$
+Q \triangleq \sigma _ { n } ( \mathbf { e } ) ( X + { \frac { 1 } { e _ { 1 } } } ) ( X + { \frac { 1 } { e _ { 2 } } } ) \ldots ( X + { \frac { 1 } { e _ { n } } } ) .
+$$
+
+Then if we expand $Q$ to $\beta _ { 0 } + \beta _ { 1 } X + . . . + \beta _ { n } X ^ { n }$ , we obtain with Vieta’s formula again:
+
+$$
+\forall i \in [ [ 0 , n ] ] , \quad \beta _ { i } = \sigma _ { n } ( \mathbf { e } ) \sigma _ { n - i } ( 1 / \mathbf { e } ) = \sigma _ { i } ( \mathbf { e } ) .
+$$
+
+Subsequently, in order to compute $\sigma _ { k } ( \mathbf { e } )$ , we only require the $k$ first coefficients of $Q$ , which is very efficient when $k$ is small in comparison with $n$ . This results in a time complexity of $\mathcal { O } ( k n )$ (Proposition 5 in Appendix B.1). Moreover, there are only ${ \mathcal { O } } ( \log ( n ) )$ levels of recursion, and since every level can have its operations parallelized, the resulting algorithm scales very well with $n$ when implemented on a GPU (see Appendix B.3.2 for practical runtimes).
+
+The algorithm is described in Algorithm 1: step 2 initializes the polynomials for the divide and conquer method. While the polynomial has not been fully expanded, steps 5-6 merge branches by performing the polynomial multiplications (which can be done in parallel). Step 10 adjusts the coefficients using equation (14). We point out that we could obtain an algorithm with a time complexity of $\mathcal { O } ( n \log ( \bar { k } ) ^ { 2 } )$ if we were using Fast Fourier Transform for polynomial multiplications in steps 5-6. Since we are interested in the case where $k$ is small (typically 5), such an improvement is negligible.
+
+# Algorithm 1 Forward Pass
+
+Require: $\mathbf { e } \in ( \mathbb { R } _ { + } ^ { * } ) ^ { n }$ , $k \in \mathbb { N } ^ { * }$
+
+1: $t \gets 0$
+2: $P _ { i } ^ { ( t ) } \gets ( 1 , 1 / e _ { i } )$ for $i \in [ [ 1 , n ] ]$ . Initialize $n$ polynomials to $\textstyle X + { \frac { 1 } { e _ { i } } }$ (encoded by coefficients)
+3: $p \gets n$ . Number of polynomials
+4: while $p > 1$ do . Merge branches with polynomial multiplications
+5: $P _ { 1 } ^ { ( t + 1 ) } P _ { 1 } ^ { ( t ) } * P _ { 2 } ^ { ( t ) }$ . Polynomial multiplication up to degree $k$
+6: ... $\begin{array} { l } { P _ { ( p - 1 ) / / 2 } ^ { ( t + 1 ) } P _ { p - 1 } ^ { ( t ) } * P _ { p } ^ { ( t ) } } \\ { t t + 1 } \\ { p ( p - 1 ) / / 2 } \end{array}$ . Polynomial multiplication up to degree $k$
+7:
+8: . Update number of polynomials
+9: end while
+$\begin{array} { l } { { \displaystyle 1 0 \colon P ^ { ( t + 1 ) } \gets P ^ { ( t ) } \times \prod _ { i = 1 } ^ { n } e _ { i } } } \\ { { \displaystyle 1 1 \colon \mathbf { r e t u r n } P ^ { ( t + 1 ) } } } \end{array}$ $\triangleright { \mathrm { R e c o v e r } } \sigma _ { i } ( { \mathbf { e } } ) = \sigma _ { n - i } ( 1 / { \mathbf { e } } ) \sigma _ { n } ( { \mathbf { e } } )$
+
+Obtaining numerical stability in single floating point precision requires special attention: the use of exponentials with an arbitrarily small temperature parameter is fundamentally unstable. In Appendix B.2.1, we describe how operating in the log-space and using the log-sum-exp trick alleviates this issue. The stability of the resulting algorithm is empirically verified in Appendix B.3.3.
+
+# 4.3 BACKWARD COMPUTATION
+
+A side effect of using Algorithm 1 is that a large number of buffers are allocated for automatic differentiation: for each addition in log-space, we apply log and exp operations, each of which needs to store values for the backward pass. This results in a significant amount of time spent on memory allocations, which become the time bottleneck. To avoid this, we exploit the structure of the problem and design a backward algorithm that relies on the results of the forward pass. By avoiding the memory allocations and considerably reducing the number of operations, the backward pass is then sped up by one to two orders of magnitude and becomes negligible in comparison to the forward pass. We describe our efficient backward pass in more details below.
+
+First, we introduce the notation for derivatives:
+
+$$
+\mathrm { F o r } i \in [ [ 1 , n ] ] , 1 \leq j \leq k , \quad \delta _ { j , i } \triangleq \frac { \partial \sigma _ { j } ( \mathbf { e } ) } { \partial e _ { i } } .
+$$
+
+We now observe that:
+
+$$
+\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
+$$
+
+In other words, equation (16) states that $\delta _ { j , i }$ , the derivative of $\sigma _ { j } ( \mathbf { e } )$ with respect to $e _ { i }$ , is the sum of product of all $( j - 1 )$ -tuples that do not include $e _ { i }$ . One way of obtaining $\sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } )$ is to compute a forward pass for ${ \mathbf { e } } _ { \backslash i }$ , which we would need to do for every $i \in [ [ 1 , n ] ]$ . To avoid such expensive computations, we remark that $\sigma _ { j } ( \mathbf { e } )$ can be split into two terms: the ones that contain $e _ { i }$ (which can expressed as $e _ { i } \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) )$ and the ones that do not (which are equal to $\sigma _ { j } ( \mathbf { e } _ { \backslash i } )$ by definition). This gives the following relationship:
+
+$$
+\sigma _ { j } ( \mathbf { e } _ { \backslash i } ) = \sigma _ { j } ( \mathbf { e } ) - e _ { i } \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
+$$
+
+Simplifying equation (17) using equation (16), we obtain the following recursive relationship:
+
+$$
+\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
+$$
+
+Since the $( \sigma _ { j } ( \mathbf { e } ) ) _ { 1 \leq i \leq k }$ have been computed during the forward pass, we can initialize the induction with $\delta _ { 1 , i } = \mathrm { 1 }$ and iteratively compute the derivatives $\delta _ { j , i }$ for $j \geq 2$ with equation (18). This is summarized in Algorithm 2.
+
+# Algorithm 2 Backward Pass
+
+Require: e, $( \sigma _ { j } ( \mathbf { e } ) ) _ { 1 \leq j \leq k }$ , k ∈ N ∗ . (σj(e))1≤j≤k have been computed in the forward pass
+1: $\delta _ { 1 , i } = 1$ for $i \in [ [ 1 , n ] ]$
+2: for $j \in [ [ 1 , k ] ]$ J do
+3: $\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i }$ for $i \in [ [ 1 , n ] ]$
+4: end for
+
+Algorithm 2 is subject to numerical instabilities (Observation 1 in Appendix B.2.2). In order to avoid these, one solution is to use equation (16) for each unstable element, which requires numerous forward passes. To avoid this inefficiency, we provide a novel approximation in Appendix B.2.2: the computation can be stabilized by an approximation with significantly smaller overhead.
+
+# 5 EXPERIMENTS
+
+Theoretical results suggest that Cross-Entropy (CE) is an optimal classifier in the limit of infinite data, by accurately approximating the data distribution. In practice, the presence of label noise makes the data distribution more complex to estimate when only a finite number of samples is available. For these reasons, we explore the behavior of CE and $L _ { k , \tau }$ when varying the amount of label noise and the training data size. For the former, we introduce label noise in the CIFAR-100 data set (Krizhevsky, 2009) in a manner that would not perturb the top-5 error of a perfect classifier. For the latter, we vary the training data size on subsets of the ImageNet data set (Russakovsky et al., 2015).
+
+In all the following experiments, the temperature parameter is fixed throughout training. This choice is discussed in Appendix D.1. The algorithms are implemented in Pytorch (Paszke et al., 2017) and are publicly available at https://github.com/oval-group/smooth-topk. Experiments on CIFAR-100 and ImageNet are performed on respectively one and two Nvidia Titan Xp cards.
+
+# 5.1 CIFAR-100 WITH NOISE
+
+Data set. In this experiment, we investigate the impact of label noise on CE and $L _ { 5 , 1 }$ . The CIFAR100 data set contains 60,000 RGB images, with 50,000 samples for training-validation and 10,000 for testing. There are 20 “coarse” classes, each consisting of 5 “fine” labels. For example, the coarse class “people” is made up of the five fine labels “baby”, “boy”, “girl”, “man” and “woman”. In this set of experiments, the images are centered and normalized channel-wise before they are fed to the network. We use the standard data augmentation technique with random horizontal flips and random crops of size $3 2 \times 3 2$ on the images padded with 4 pixels on each side.
+
+We introduce noise in the labels as follows: with probability $p$ , each fine label is replaced by a fine label from the same coarse class. This new label is chosen at random and may be identical to the original label. Note that all instances generated by data augmentation from a single image are assigned the same label. The case $p = 0$ corresponds to the original data set without noise, and $p = 1$ to the case where the label is completely random (within the fine labels of the coarse class). With this method, a perfect top-5 classifier would still be able to achieve $100 \%$ accuracy by systematically predicting the five fine labels of the unperturbed coarse label.
+
+Methods. To evaluate our loss functions, we use the architecture DenseNet 40-40 from Huang et al. (2017), and we use the same hyper-parameters and learning rate schedule as in Huang et al. (2017). The temperature parameter is fixed to one. When the level of noise becomes non-negligible, we empirically find that CE suffers from over-fitting and significantly benefits from early stopping – which our loss does not need. Therefore we help the baseline and hold out a validation set of 5,000 images, on which we monitor the accuracy across epochs. Then we use the model with the best top-5 validation accuracy and report its performance on the test set. Results are averaged over three runs with different random seeds.
+
+Table 1: Testing performance on CIFAR-100 with different levels of label noise. With noisy labels, $L _ { 5 , 1 }$ consistently outperforms CE on both top-5 and top-1 accuracies, with improvements increasingly significant with the level of noise. For reference, a model making random predictions would obtain $1 \%$ top-1 accuracy and $5 \%$ top-5 accuracy.
+
+
Noise Level
Top-1 Accuracy (%) CE
L5.1 CE
Top-5 Accuracy (%)
0.0
76.68 69.33
94.34
L5.1 94.29
0.2
68.20 71.30
87.89
90.59
0.4
61.18 70.02
83.04
87.39
0.6
52.50 67.97
79.59
83.86
0.8
35.53 55.85
74.80
79.32
1.0
14.06 15.28
67.70
72.93
+
+Results. As seen in Table 1, $L _ { 5 , 1 }$ outperforms CE on the top-5 testing accuracy when the labels are noisy, with an improvement of over $5 \%$ in the case $p = 1$ . When there is no noise in the labels, CE provides better top-1 performance, as expected. It also obtains a better top-5 accuracy, although by a very small margin. Interestingly, $L _ { 5 , 1 }$ outperforms CE on the top-1 error when there is noise, although $L _ { 5 , 1 }$ is not a surrogate for the top-1 error. For example when $p = 0 . 8$ , $L _ { 5 , 1 }$ still yields an accuracy of $5 5 . 8 5 \%$ , as compared to $3 5 . 5 3 \%$ for CE. This suggests that when the provided label is only informative about top-5 predictions (because of noise or ambiguity), it is preferable to use ${ \cal L } _ { 5 , 1 }$ .
+
+# 5.2 IMAGENET
+
+Data set. As shown in Figure 1, the ImageNet data set presents different forms of ambiguity and noise in the labels. It also has a large number of training samples, which allows us to explore different regimes up to the large-scale setting. Out of the 1.28 million training samples, we use subsets of various sizes and always hold out a balanced validation set of 50,000 images. We then report results on the 50,000 images of the official validation set, which we use as our test set. Images are resized so that their smaller dimension is 256, and they are centered and normalized channel-wise. At training time, we take random crops of $2 2 4 \times 2 2 4$ and randomly flip the images horizontally. At test time, we use the standard ten-crop procedure (Krizhevsky et al., 2012).
+
+We report results for the following subset sizes of the data: 64k images $( 5 \% )$ , 128k images $( 1 0 \% )$ , $3 2 0 \mathrm { k }$ images $( 2 5 \% )$ , $6 4 0 \mathrm { k }$ images $( 5 0 \% )$ and finally the whole data set $( 1 . 2 8 \mathrm { M } - 5 0 \mathrm { k } = 1 . 2 3 \mathrm { M }$ images for training). Each strict subset has all 1,000 classes and a balanced number of images per class. The largest subset has the same slight unbalance as the full ImageNet data set.
+
+Methods. In all the following experiments, we train a ResNet-18 (He et al., 2016), adapting the protocol of the ImageNet experiment in Huang et al. (2017). In more details, we optimize the model with Stochastic Gradient Descent with a batch-size of 256, for a total of 120 epochs. We use a Nesterov momentum of 0.9. The temperature is set to 0.1 for the SVM loss (we discuss the choice of the temperature parameter in Appendix D.1). The learning rate is divided by ten at epochs 30, 60 and 90, and is set to an initial value of 0.1 for CE and 1 for $L _ { 5 , 0 . 1 }$ . The quadratic regularization hyper-parameter is set to 0.0001 for CE. For $L _ { 5 , 0 . 1 }$ , it is set to 0.000025 to preserve a similar relative weighting of the loss and the regularizer. For both methods, training on the whole data set takes about a day and a half (it is only $10 \%$ longer with $L _ { 5 , 0 . 1 }$ than with CE). As in the previous experiments, the validation top-5 accuracy is monitored at every epoch, and we use the model with best top-5 validation accuracy to report its test error.
+
+Probabilities for Multiple Crops. Using multiple crops requires a probability distribution over labels for each crop. Then this probability is averaged over the crops to compute the final prediction. The standard method is to use a softmax activation over the scores. We believe that such an approach is only grounded to make top-1 predictions. The probability of a label $\bar { y }$ being part of the top-5 prediction should be marginalized over all combinations of 5 labels that include $\bar { y }$ as one of their elements. This can be directly computed with our algorithms to evaluate $\sigma _ { k }$ and its derivative. We refer the reader to Appendix C for details. All the reported results of top-5 error with multiple crops are computed with this method. This provides a systematic boost of at least $0 . 2 \%$ for all loss functions. In fact, it is more beneficial to the CE baseline, by up to $1 \%$ in the small data setting.
+
+Table 2: Top-5 accuracy $( \% )$ on ImageNet using training sets of various sizes. Results are reported on the official validation set, which we use as our test set.
+
+
% Data Set
Number of Images
CE
L5,0.1
100%
1.23M
90.67
90.61
50%
640k
87.57
87.87
25%
320k
82.62
83.38
10%
128k
71.06
73.10
5%
64k
58.31
60.44
+
+Results. The results of Table 2 confirm that $L _ { 5 , 0 . 1 }$ offers better top-5 error than CE when the amount of training data is restricted. As the data set size increases, the difference of performance becomes very small, and CE outperforms $L _ { 5 , 0 . 1 }$ by an insignificant amount in the full data setting.
+
+# 6 CONCLUSION
+
+This work has introduced a new family of loss functions for the direct minimization of the top- $k$ error (that is, without the need for fine-tuning). We have empirically shown that non-sparsity is essential for loss functions to work well with deep neural networks. Thanks to a connection to polynomial algebra and a novel approximation, we have presented efficient algorithms to compute the smooth loss and its gradient. The experimental results have demonstrated that our smooth top-5 loss function is more robust to noise and overfitting than cross-entropy when the amount of training data is limited.
+
+We have argued that smoothing the surrogate loss function helps the training of deep neural networks. This insight is not specific to top- $k$ classification, and we hope that it will help the design of other surrogate loss functions. In particular, structured prediction problems could benefit from smoothed SVM losses. How to efficiently compute such smooth functions could open interesting research problems.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by the EPSRC grants AIMS CDT EP/L015987/1, Seebibyte EP/M013774/1, EP/P020658/1 and TU/B/000048, and by Yougov. Many thanks to A. Desmaison and R. Bunel for the helpful discussions.
+
+# REFERENCES
+
+Amir Beck and Marc Teboulle. Smoothing and first order methods: A unified framework. SIAM Journal on Optimization, 2012.
+
+Xiaojun Chang, Yao-Liang Yu, and Yi Yang. Robust top-k multiclass SVM for visual category recognition. International Conference on Knowledge Discovery and Data Mining, 2017.
+
+Pratik Chaudhari, Anna Choromanska, Stefano Soatto, and Yann LeCun. Entropy-SGD: Biasing gradient descent into wide valleys. International Conference on Learning Representations, 2017.
+
+Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (ELUs). International Conference on Learning Representations, 2016.
+
+Koby Crammer and Yoram Singer. On the algorithmic implementation of multiclass kernel-based vector machines. Journal of Machine Learning Research, 2001.
+
+Yanbo Fan, Siwei Lyu, Yiming Ying, and Bao-Gang Hu. Learning with average top- $\mathbf { \nabla } \cdot \mathbf { k }$ loss. Neural Information Processing Systems, 2017.
+
+Caglar Gulcehre, Marcin Moczulski, Francesco Visin, and Yoshua Bengio. Mollifying networks. International Conference on Learning Representations, 2017.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Conference on Computer Vision and Pattern Recognition, 2016.
+
+Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. Conference on Computer Vision and Pattern Recognition, 2017.
+
+Hao Jiang, Stef Graillat, Roberto Barrio, and Canqun Yang. Accurate, validated and fast evaluation of elementary symmetric functions and its application. Applied Mathematics and Computation, 2016.
+
+Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
+
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Neural Information Processing Systems, 2012.
+
+Maksim Lapin, Matthias Hein, and Bernt Schiele. Top-k multiclass SVM. Neural Information Processing Systems, 2015.
+
+Maksim Lapin, Matthias Hein, and Bernt Schiele. Loss functions for top- $\mathbf { \nabla } \cdot \mathbf { k }$ error: Analysis and insights. Conference on Computer Vision and Pattern Recognition, 2016.
+
+Maksim Lapin, Matthias Hein, and Bernt Schiele. Analysis and optimization of loss functions for multiclass, top-k, and multilabel classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
+
+Yuh-Jye Lee and Olvi L Mangasarian. SSVM: A smooth support vector machine for classification. Computational optimization and Applications, 2001.
+
+Yuncheng Li, Yale Song, and Jiebo Luo. Improving pairwise ranking for multi-label image classification. Conference on Computer Vision and Pattern Recognition, 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. NIPS Autodiff Workshop, 2017.
+
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision, 2015.
+
+Alexander G. Schwing, Tamir Hazan, Marc Pollefeys, and Raquel Urtasun. Efficient structured prediction with latent variables for general graphical models. International Conference on Machine Learning, 2012.
+
+Caixia Yan, Minnan Luo, Huan Liu, Zhihui Li, and Qinghua Zheng. Top-k multi-class svm using multiple features. Information Sciences, 2017.
+
+Alan L. Yuille and Anand Rangarajan. The concave-convex procedure (CCCP). Neural Information Processing Systems, 2002.
+
+Hao Zheng, Zhanlei Yang, Wenju Liu, Jizhong Liang, and Yanpeng Li. Improving deep neural networks using softplus units. International Joint Conference on Neural Networks, 2015.
+
+# APPENDIX
+
+# A Surrogate Losses: Properties 14
+
+A.1 Reformulation . . 14
+A.2 Point-wise Convergence 14
+A.3 Bound on Non-Smooth Function 15
+A.4 Bound on Prediction Loss . . . 16
+
+# B Algorithms: Properties & Performance 18
+
+B.1 Time Complexity 18
+B.2 Numerical Stability 19
+B.2.1 Forward Pass . . 19
+B.2.2 Backward Pass 19
+B.3 A Performance Comparison with the Summation Algorithm 20
+B.3.1 Summation Algorithm 20
+B.3.2 Speed . 21
+B.3.3 Stability . . . 21
+
+# C Top-k Prediction: Marginalization with the Elementary Symmetric Polynomials 22
+
+# D Hyper-Parameters & Experimental Details 23
+
+# D.1 The Temperature Parameter . 23
+
+D.1.1 Optimization and Learning . 23
+D.1.2 Illustration on CIFAR-100 23
+D.1.3 To Anneal or Not To Anneal 23
+D.1.4 Practical Methodology 23
+
+# D.2 The Margin 24
+
+D.2.1 Relationship with Squared Norm Regularization 24
+D.2.2 Experiment on ImageNet . . 25
+
+D.3 Supplementary Details 25
+
+# A SURROGATE LOSSES: PROPERTIES
+
+In this section, we fix $n$ the number of classes. We let $\tau > 0$ and $k \in \{ 1 , . . . , n - 1 \}$ . All following results are derived with a loss $l _ { k }$ defined as in equation (8):
+
+$$
+l _ { k } ( \mathbf { s } , y ) \triangleq \operatorname* { m a x } \left\{ \left( \frac { 1 } { k } \mathbf { s } _ { \backslash y } + \mathbf { 1 } \right) _ { [ k ] } - \frac { 1 } { k } s _ { y } , 0 \right\} .
+$$
+
+# A.1 REFORMULATION
+
+Proposition 1. We can equivalently re-write $l _ { k }$ as:
+
+$$
+l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} .
+$$
+
+Proof.
+
+$$
+\begin{array} { r l } & { h _ { k } ( s , y ) = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } ( \mathbf { x } + \mathbf { y } ) \bigg | _ { \mathbb { H } } - \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } , 0 \bigg \} , } \\ & { = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } ( \mathbf { x } + \mathbf { y } ) \bigg | _ { \mathbb { H } } - \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } , 0 \bigg \} + \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) - \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) , } \\ & { = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } + \mathbf { y } \bigg ) _ { \mathbb { H } } + \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg \} - \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) , } \\ & { = \operatorname* { m a x } \Bigg \{ \displaystyle \operatorname* { m a x } _ { y \in \mathbb { S } ^ { ( 0 , 0 ) } \times \displaystyle \frac { 1 } { k } } \bigg \{ 1 + \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \bigg \} , \ \operatorname* { m a x } _ { y \in \Phi ^ { ( 1 ) } } \bigg \{ \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \Bigg \} - \operatorname* { m a x } _ { y \in \Phi ^ { ( 1 ) } } \Bigg \} , } \\ & = \operatorname* { m a x } _ { y \in \Phi ^ { ( 0 , 0 ) } } \Bigg \{ \Delta _ { k } ( \bar { y } , y ) + \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \Bigg \} - \operatorname* { m a x } _ { y \in \Phi ^ { ( 0 , 0 ) } } \Bigg \{ \displaystyle \end{array}
+$$
+
+# A.2 POINT-WISE CONVERGENCE
+
+Lemma 1. Let $n \geq 2$ and $\mathbf { e } \in \mathbb { R } ^ { n }$ . Assume that the largest element of e is greater than its second largest element: $e _ { [ 1 ] } > e _ { [ 2 ] }$ . Then $\operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( e _ { i } / \tau ) \right) = e _ { [ 1 ] } .$
+
+Proof. For simplicity of notation, and without loss of generality, we suppose that the elements of $\mathbf { e }$ are sorted in descending order. Then for $i \in \{ 2 , . . n \}$ , we have $e _ { i } - e _ { 1 } \leq e _ { 2 } - e _ { 1 } < 0$ by assumption, and thus $\forall i \in \{ 2 , . . n \} , \operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = \bar { 0 }$ . Therefore:
+
+$$
+\operatorname* { l i m } _ { \tau \to 0 } \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = \sum _ { i = 1 } ^ { n } \operatorname* { l i m } _ { \tau \to 0 } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = 1 .
+$$
+
+And thus:
+
+$$
+\operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) \right) = 0 .
+$$
+
+The result follows by noting that:
+
+$$
+\tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( e _ { i } / \tau ) \right) = e _ { 1 } + \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) \right) .
+$$
+
+Proposition 2. Assume that $s _ { [ k - 1 ] } ~ > ~ s _ { [ k ] }$ and that $s _ { [ k ] } > s _ { [ k + 1 ] } o r \frac { 1 } { k } s _ { y } > 1 + \frac { 1 } { k } s _ { [ k ] }$ . Then $\operatorname* { l i m } _ { \tau 0 } L _ { k , \tau } ( \mathbf { s } , y ) = l _ { k } ( \mathbf { s } , y )$ .
+
+Proof. From $s _ { [ k ] } > s _ { [ k + 1 ] }$ or $\frac { 1 } { k } s _ { y } > 1 + \frac { 1 } { k } s _ { [ k ] }$ + 1k s[k], one can see that max(k) $\left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\}$ is a strict maximum. Similarly, from $s _ { [ k - 1 ] } > s _ { [ k ] }$ , we have that $\operatorname* { m a x } _ { \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \right\}$ is a strict maximum. Since $L _ { k , \tau }$ can be written as:
+
+$$
+\begin{array} { l } { { \displaystyle { \cal L } _ { k , \tau } ( { \bf s } , y ) = \tau \log \left[ \sum _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \left( \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right) / \tau \right) \right] } } \\ { { \displaystyle ~ - \tau \log \left[ \sum _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \left( \left( \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right) / \tau \right) \right] , } } \end{array}
+$$
+
+the result follows by two applications of Lemma 1.
+
+# A.3 BOUND ON NON-SMOOTH FUNCTION
+
+Proposition 3. $L _ { k , \tau }$ is an upper bound on $l _ { k }$ if and only if $k = 1$ .
+
+Proof. Suppose $k = 1$ . Let s $\in \mathbb { R } ^ { n }$ and $y \in \mathcal { V }$ . We introduce $y ^ { * } = \underset { \bar { y } \in \mathcal { V } } { \mathrm { a r g m a x } } \{ \Delta _ { 1 } ( \bar { y } , y ) + s _ { \bar { y } } \}$ . Then we have:
+
+$$
+\begin{array} { r l } & { l _ { 1 } ( \mathbf { s } , y ) = \Delta _ { 1 } ( y ^ { * } , y ) + s _ { y ^ { * } } - s _ { y } , } \\ & { \qquad = \tau \log ( \exp ( ( \Delta _ { 1 } ( y ^ { * } , y ) + s _ { y ^ { * } } ) / \tau ) - \tau \log \exp ( s _ { y } / \tau ) , } \\ & { \qquad \leq \tau \log ( \displaystyle \sum _ { \bar { y } \in \mathcal { Y } } \exp ( ( \Delta _ { 1 } ( \bar { y } , y ) + s _ { \bar { y } } ) / \tau ) - \tau \log \exp ( s _ { y } / \tau ) = L _ { 1 , \tau } ( \mathbf { s } , y ) . } \end{array}
+$$
+
+Now suppose $k \geq 2$ . We construct an example $( \mathbf { s } , y )$ such that $L _ { k , \tau } ( \mathbf { s } , y ) < l _ { k } ( \mathbf { s } , y )$ . For simplicity, we set $y = 1$ . Then let $s _ { 1 } = \alpha$ , $s _ { i } = \beta$ for $i \in \{ 2 , . . . , k + 1 \}$ and $s _ { i } = - \infty$ for $i \in \{ k + 2 , . . . , n \}$ . The variables $\alpha$ and $\beta$ are our degrees of freedom to construct the example. Assuming infinite values simplifies the analysis, and by continuity of $L _ { k , \tau }$ and $l _ { k }$ , the proof will hold for real values sufficiently small. We further assume that $\begin{array} { r } { 1 + \frac { 1 } { k } ( \beta - \alpha ) > 0 } \end{array}$ . Then can write $l _ { k } ( { \mathbf s } , y )$ as:
+
+$$
+l _ { k } ( \mathbf { s } , y ) = 1 + \frac { 1 } { k } ( \beta - \alpha ) .
+$$
+
+Exploiting the fact that $\exp ( { s _ { i } / \tau } ) = 0$ for $i \geq k + 2$ , we have:
+
+$$
+\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } \exp ( ( 1 + s _ { j } ) / k \tau ) = \exp \left( \frac { 1 + \beta } { \tau } \right) ,
+$$
+
+And:
+
+$$
+\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \left( \Big ( \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) / \tau \right) = k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) .
+$$
+
+This allows us to write $L _ { k , \tau }$ as:
+
+$$
+\begin{array} { l } { \displaystyle \dot { \Sigma } _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \left( k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) + \exp \left( \frac { 1 + \beta } { \tau } \right) \right) - \tau \log \left( k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { \exp \left( \frac { 1 + \beta } { \tau } \right) } { k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) } \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { \exp \left( \frac { 1 } { \tau } \right) } { k \exp \left( \frac { \alpha - \beta } { k \tau } \right) } \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { 1 } { \tau } ( 1 + \frac { 1 } { k } ( \beta - \alpha ) ) \right) \right) . } \end{array}
+$$
+
+We introduce $\begin{array} { r } { x = 1 + \frac { 1 } { k } ( \beta - \alpha ) } \end{array}$ . Then we have:
+
+$$
+L _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) ,
+$$
+
+And:
+
+$$
+l _ { k } ( \mathbf { s } , y ) = x .
+$$
+
+For any value $x > 0$ , we can find $( \alpha , \beta ) \in \mathbb { R } ^ { 2 }$ such that $\begin{array} { r } { x = 1 + \frac { 1 } { k } ( \beta - \alpha ) } \end{array}$ and that all our hypotheses are verified. Consequently, we only have to prove that there exists $x > 0$ such that:
+
+$$
+\Delta ( x ) \triangleq \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) - x < 0 .
+$$
+
+We show that $\operatorname* { l i m } _ { x \to \infty } \Delta ( x ) < 0$ , which will conclude the proof by continuity of $\Delta$ .
+
+$$
+\begin{array} { r l r } { { \Delta ( x ) = \tau \log ( 1 + \frac { 1 } { k } \exp ( \frac { x } { \tau } ) ) - x , } } \\ & { } & \\ & { } & { = \tau \log ( 1 + \frac { 1 } { k } \exp ( \frac { x } { \tau } ) ) - \tau \log ( \exp ( \frac { x } { \tau } ) ) , ~ } \\ & { } & \\ & { } & { = \tau \log ( \exp ( \frac { - x } { \tau } ) + \frac { 1 } { k } ) \xrightarrow [ x \to \infty ] { } \tau \log ( \frac { 1 } { k } ) < 0 \quad \mathrm { s i n c e } k \geq 2 . } \end{array}
+$$
+
+# A.4 BOUND ON PREDICTION LOSS
+
+Lemma 2. Let $( p , q ) \in \mathbb { N } ^ { 2 }$ such that $p \leq q - 1$ and $q \geq 1$ . Then ${ \binom { q } { p } } \leq q { \binom { q } { p + 1 } }$ .
+
+Proof.
+
+$$
+\begin{array} { c } { { \frac { \binom { q } { p } } { \binom { q } { p + 1 } } = \displaystyle \frac { ( q - p - 1 ) ! ( p + 1 ) ! } { ( q - p ) ! p ! } , \hfill } } \\ { { = \displaystyle \frac { ( p + 1 ) } { q - p } . \hfill } } \end{array}
+$$
+
+This is a monotonically increasing function of $p \leq q - 1$ , therefore it is upper bounded by its maximal value at $p = q - 1$ :
+
+$$
+{ \frac { { \binom { q } { p } } } { { \binom { q } { p + 1 } } } } = { \frac { ( p + 1 ) } { q - p } } \leq q .
+$$
+
+Lemma 3. Assume that $y \notin P _ { k } ( \mathbf { s } )$ . Then we have:
+
+$$
+\frac { 1 } { k } \sum _ { \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } } \exp \left( \sum _ { j \in \bar { \mathbf { y } } } \frac { s _ { j } } { k \tau } \right) \leq \sum _ { \bar { \mathbf { y } } \in \mathcal { y } ^ { ( k ) } \setminus \mathcal { y } _ { y } ^ { ( k ) } } \exp \left( \sum _ { j \in \bar { \mathbf { y } } } \frac { s _ { j } } { k \tau } \right) .
+$$
+
+Proof. Let $j \in [ [ 0 , k - 1 ]$ . We introduce the random variable $U _ { j }$ , whose probability distribution is uniform over the set $\mathcal { U } _ { j } \triangleq \{ \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } : \bar { \mathbf { y } } \cap P _ { k } ( \mathbf { s } ) = j \}$ . Then $V _ { j }$ is the random variable such that $V _ { j } | U _ { j }$ replaces $y$ from $U _ { j }$ with a value drawn uniformly from $\breve { P } _ { k } ( { \bf s } )$ . We denote by $\nu _ { j }$ the set of values taken by $V _ { j }$ with non-zero probability. Since $V _ { j }$ replaces the ground truth score by one of the values of $P _ { k } ( { \bf s } )$ , it can be seen that:
+
+$$
+{ \mathcal V } _ { j } = \{ \bar { \mathbf y } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { Y } _ { y } ^ { ( k ) } : \bar { \mathbf y } \cap P _ { k } ( \mathbf s ) = j + 1 \} .
+$$
+
+Furthermore, we introduce the scoring function $f : \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } \mapsto \exp ( \frac { 1 } { k \tau } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } )$ . Since $P _ { k } ( { \bf s } )$ is the set of the $k$ largest scores and $y \notin P _ { k } ( \mathbf { s } )$ , we have that:
+
+$$
+f ( V _ { j } | U _ { j } ) \geq f ( U _ { j } ) \qquad \mathrm { w i t h ~ p r o b a b i l i t y ~ } 1 .
+$$
+
+Therefore we also have that:
+
+$$
+\mathbb { E } _ { V _ { j } | U _ { j } } f ( V _ { j } ) \geq f ( U _ { j } ) \qquad \mathrm { w i t h p r o b a b i l i t y ~ 1 . }
+$$
+
+This finally gives us:
+
+$$
+\begin{array} { r } { \mathbb { E } _ { U _ { j } } \mathbb { E } _ { V _ { j } | U _ { j } } f ( V _ { j } ) \geq \mathbb { E } _ { U _ { j } } f ( U _ { j } ) , } \\ { \mathbb { E } _ { V _ { j } } f ( V _ { j } ) \geq \mathbb { E } _ { U _ { j } } f ( U _ { j } ) . } \end{array}
+$$
+
+Making the (uniform) probabilities explicit, we obtain:
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { | \mathcal { V } _ { j } | } \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \frac { 1 } { | \mathcal { U } _ { j } | } \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) , } \\ { \displaystyle \frac { | \mathcal { U } _ { j } | } { | \mathcal { V } _ { j } | } \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) . } \end{array}
+$$
+
+To derive the set cardinalities, we rewrite $\mathcal { U } _ { j }$ and $\nu _ { j }$ as:
+
+$$
+\begin{array} { r l } & { \mathcal { U } _ { j } = \big \{ \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } : \bar { \bf y } \cap P _ { k } ( { \bf s } ) = j \big \} = \{ y \} \times P _ { k } ( { \bf s } ) ^ { ( j ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( { \bf s } ) ) ^ { ( k - j - 1 ) } , } \\ & { \mathcal { V } _ { j } = \{ \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) } : \bar { \bf y } \cap P _ { k } ( { \bf s } ) = j + 1 \} = P _ { k } ( { \bf s } ) ^ { ( j + 1 ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( { \bf s } ) ) ^ { ( k - j - 1 ) } . } \end{array}
+$$
+
+Therefore we have that:
+
+$$
+\begin{array} { l } { { | \mathcal { U } _ { j } | = \left| \{ y \} \times P _ { k } ( \mathbf { s } ) ^ { ( j ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( \mathbf { s } ) ) ^ { ( k - j - 1 ) } \right| , } } \\ { { \qquad = { \binom { k } { j } } { \binom { n - k - 1 } { k - j - 1 } } , } } \end{array}
+$$
+
+And:
+
+$$
+\begin{array} { c } { { | \mathcal { V } _ { j } | = \Big | P _ { k } ( \mathbf { s } ) ^ { ( j + 1 ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( \mathbf { s } ) ) ^ { ( k - j - 1 ) } \Big | , } } \\ { { = \binom { k } { j + 1 } \binom { n - k - 1 } { k - j - 1 } . } } \end{array}
+$$
+
+Therefore:
+
+$$
+\frac { | \mathcal { U } _ { j } | } { | \mathcal { V } _ { j } | } = \frac { { \binom { k } { j } } { \binom { n - k - 1 } { k - j - 1 } } } { { \binom { k } { j + 1 } } { \binom { n - k - 1 } { k - j - 1 } } } = \frac { { \binom { k } { j } } } { { \binom { k } { j + 1 } } } \leq k \quad \mathrm { b y ~ L e m m a ~ } 2 .
+$$
+
+Combining with equation (42), we obtain:
+
+$$
+k \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) .
+$$
+
+We sum over $j \in [ [ 0 , k - 1 ]$ , which yields:
+
+$$
+k \sum _ { j = 0 } ^ { k - 1 } \sum _ { { \bf v } \in \mathcal { V } _ { j } } f ( { \bf v } ) \geq \sum _ { j = 0 } ^ { k - 1 } \sum _ { { \bf u } \in \mathcal { U } _ { j } } f ( { \bf u } ) .
+$$
+
+Finally, we note that $\{ \mathcal { U } _ { j } \} _ { 0 \le j \le k - 1 }$ and $\{ \mathcal { V } _ { j } \} _ { 0 \leq j \leq k - 1 }$ are respective partitions of ${ \mathcal { V } } _ { y } ^ { ( k ) }$ and ${ \mathcal { V } } ^ { ( k ) } \backslash { \mathcal { V } } _ { y } ^ { ( k ) }$ , which gives us the final result:
+
+$$
+k \sum _ { \mathbf { v } \in \mathcal { V } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { V } _ { y } ^ { ( k ) } } f ( \mathbf { u } ) .
+$$
+
+Proposition 4. $L _ { k , \tau }$ is, up to a scaling factor, an upper bound on the prediction loss $\Lambda _ { k }$ :
+
+$$
+L _ { k , \tau } ( \mathbf { s } , y ) \geq ( 1 - \tau \log ( k ) ) \Lambda _ { k } ( \mathbf { s } , y ) .
+$$
+
+Proof. Suppose that $\Lambda _ { k } ( \mathbf { s } , y ) = 0$ . Then the inequality is trivial because $L _ { k , \tau } ( \mathbf { s } , y ) \geq 0$ . We now assume that $\Lambda _ { k } ( \mathbf { s } , y ) = \mathrm { 1 }$ . Then there exist at least $k$ higher scores than $s _ { y }$ . To simplify indexing, we introduce $\mathcal { Z } _ { y } ^ { ( k ) } = \mathcal { V } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) }$ and $\mathcal { T } _ { k }$ the set of $k$ labels corresponding to the $k$ -largest scores. By assumption, $y \notin \mathcal { T } _ { k }$ since $y$ is misclassified. We then write:
+
+$$
+\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \Delta ( \bar { \mathbf { y } } , y ) / \tau \right) \prod _ { j \in \bar { \mathbf { y } } } u _ { j } = \exp \left( 1 / \tau \right) \sum _ { \bar { \mathbf { y } } \in \mathcal { Z } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } + \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } .
+$$
+
+Thanks to Lemma 3, we have:
+
+$$
+\sum _ { \bar { \mathbf { y } } \in \mathcal { Z } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } \geq \frac { 1 } { k } \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } .
+$$
+
+Injecting this back into (51):
+
+$$
+\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \Delta ( \bar { \mathbf { y } } , y ) / \tau \right) \prod _ { j \in \bar { \mathbf { y } } } u _ { j } \geq \big ( 1 + \frac { 1 } { k } \exp \left( 1 / \tau \right) \big ) \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } ,
+$$
+
+And back to the original loss:
+
+$$
+\begin{array} { l } { { \displaystyle { \cal L } _ { k , \tau } ( { \bf s } , y ) \geq \tau \log \left[ ( 1 + \frac { 1 } { k } \exp { ( 1 / \tau ) } ) \sum _ { \bar { y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { y } } u _ { j } \right] - \tau \log \left[ \sum _ { \bar { y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { y } } u _ { j } \right] } , } \\ { { \displaystyle ~ \quad = \tau \log ( 1 + \frac { 1 } { k } \exp { ( 1 / \tau ) } ) \geq \tau \log ( \frac { 1 } { k } \exp { ( 1 / \tau ) } ) = \tau \log ( \frac { 1 } { k } ) + 1 = 1 - \tau \log ( k ) } . } \end{array}
+$$
+
+# B ALGORITHMS: PROPERTIES & PERFORMANCE
+
+# B.1 TIME COMPLEXITY
+
+Lemma 4. Let $P$ and $Q$ be two polynomials of degree $p$ and $q$ . The time complexity of obtaining the first r coefficients of $P Q$ is $\mathcal { O } ( \operatorname* { m i n } \{ r , p \} \operatorname* { m i n } \{ r , q \} )$ .
+
+Proof. The multiplication of two polynomials can be written as the convolution of their coefficients, which can be truncated at degree $r$ for each polynomial. □
+
+Proposition 5. The time complexity of Algorithm $I$ is $\mathcal { O } ( k n )$ .
+
+Proof. Let $N = \log _ { 2 } ( n )$ , or equivalently $n = 2 ^ { N }$ . With the divide-and-conquer algorithm, the complexity of computing the $k$ first coefficients of $P$ can be written as:
+
+$$
+T ( k , n ) = 2 T ( k , \frac { n } { 2 } ) + \operatorname* { m i n } \{ k , n \} ^ { 2 } .
+$$
+
+Indeed we decompose $P = Q _ { 1 } Q _ { 2 }$ , with each $Q _ { i }$ of degree $n / 2$ , and for these we compute their $k$ first coefficients in $T ( \textstyle { \frac { n } { 2 } } )$ . Then given the $k$ first coefficients of $Q _ { 1 }$ and $Q _ { 2 }$ , the $k$ first coefficients of $P$ are computed in $\mathcal { O } ( \operatorname* { m i n } \{ k , n \} ^ { 2 } )$ by Lemma 4. Then we can write:
+
+$$
+\begin{array} { c } { { T ( k , n ) = 2 T ( k , \displaystyle \frac { n } { 2 } ) + \operatorname* { m i n } \{ k , n \} ^ { 2 } , } } \\ { { 2 T \big ( k , \displaystyle \frac { n } { 2 } \big ) = 4 T \big ( k , \displaystyle \frac { n } { 4 } \big ) + 2 \operatorname* { m i n } \bigg \{ k , \displaystyle \frac { n } { 2 } \bigg \} ^ { 2 } , } } \\ { { \cdots } } \\ { { 2 ^ { N - 1 } T \big ( k , \displaystyle \frac { n } { 2 ^ { N - 1 } } \big ) = \underbrace { 2 ^ { N } T ( k , 1 ) } _ { 2 ^ { N } \mathcal { O } ( 1 ) = \mathcal { O } ( n ) } + 2 ^ { N - 1 } \operatorname* { m i n } \bigg \{ k , \displaystyle \frac { n } { 2 ^ { N - 1 } } \bigg \} ^ { 2 } . } } \end{array}
+$$
+
+By summing these terms, we obtain $T ( k , n ) = 2 ^ { N } T ( k , 1 ) + \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \Big \{ k , \frac { n } { 2 ^ { j } } \Big \} ^ { 2 }$ . Let $n _ { 0 } \in \mathbb { N }$ such that $\frac { n } { 2 ^ { n _ { 0 } + 1 } } < k \leq \frac { n } { 2 ^ { n _ { 0 } } }$ . In loose notation, we have $k \frac { 2 ^ { n _ { 0 } } } { n } = \mathcal { O } ( 1 )$ . Then we can write:
+
+$$
+\begin{array} { l } { { \displaystyle \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } = \sum _ { j = 0 } ^ { n _ { 0 } } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } + \sum _ { j = n _ { 0 } + 1 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } } } \\ { { \displaystyle \qquad = \sum _ { j = 0 } ^ { n _ { 0 } } 2 ^ { j } k ^ { 2 } + \sum _ { j = n _ { 0 } + 1 } ^ { N - 1 } 2 ^ { j } \left( \frac { n } { 2 ^ { j } } \right) ^ { 2 } } , } \\ { { \displaystyle \qquad = ( 2 ^ { n _ { 0 } + 1 } - 1 ) k ^ { 2 } + n ^ { 2 } ( 2 ^ { - n _ { 0 } - 1 } - 2 ^ { - N } ) } , } \\ { { \displaystyle \qquad = \mathcal { O } ( k n ) . } } \end{array}
+$$
+
+Thus finally:
+
+$$
+\begin{array} { l } { { \displaystyle T ( k , n ) = 2 ^ { N } T ( k , 1 ) + \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } } , } \\ { { \displaystyle \quad \quad = \mathcal { O } ( n ) + \mathcal { O } ( k n ) , } } \\ { { \displaystyle \quad = \mathcal { O } ( k n ) . } } \end{array}
+$$
+
+# B.2 NUMERICAL STABILITY
+
+# B.2.1 FORWARD PASS
+
+In order to ensure numerical stability of the computation, we maintain all computations in the log space: for a multiplication $\exp ( x _ { 1 } ) \exp ( x _ { 2 } )$ , we actually compute and store $x _ { 1 } + x _ { 2 }$ ; for an addition $\mathrm { { e x p } } ( x _ { 1 } ) + \exp ( \bar { x _ { 2 } } )$ we use the “log-sum-exp” trick: we compute $m = \operatorname* { m a x } \{ x _ { 1 } , x _ { 2 } \}$ , and store $m + \log ( \exp ( x _ { 1 } - m ) + \exp ( x _ { 2 } - m ) )$ , which guarantees stability of the result. These two operations suffice to describe the forward pass.
+
+# B.2.2 BACKWARD PASS
+
+Observation 1. The backward recursion of Algorithm 2 is unstable when $e _ { i } \gg 1$ and $e _ { i } \gg \operatorname* { m a x } _ { p \neq i } \{ e _ { p } \}$
+
+Sketch of Proof. To see that, assume that when we compute $( \sum _ { p = 1 } ^ { n } e _ { p } ) - e _ { i }$ , we make a numerical error in the order of $\epsilon$ (e.g $\epsilon \simeq 1 0 ^ { - 5 }$ for single floating point precision). With the numerical errors, we
+
+obtain approximate $\hat { \delta }$ as follows:
+
+$$
+\begin{array} { l } { { \displaystyle \hat { \delta } _ { 1 , i } = 1 , \qquad } } \\ { { \displaystyle \hat { \delta } _ { 2 , i } = \sigma _ { 1 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { 1 , i } = \sum _ { p = 1 } ^ { n } e _ { p } - e _ { i } = \delta _ { 2 , i } + \mathcal { O } ( \epsilon ) , } } \\ { { \displaystyle \hat { \delta } _ { 3 , i } = \sigma _ { 2 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { 2 , i } = \sigma _ { 2 } ( { \bf e } ) - e _ { i } \big ( \delta _ { 2 , i } + \mathcal { O } ( \epsilon ) \big ) = \delta _ { 3 , i } + \mathcal { O } ( e _ { i } \epsilon ) ) , } } \\ { { \displaystyle \dots } } \\ { { \displaystyle \hat { \delta } _ { k , i } = \sigma _ { k - 1 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { k - 1 , i } = \dots = \delta _ { k , i } + \mathcal { O } ( e _ { i } ^ { k - 1 } \epsilon ) ) . } } \end{array}
+$$
+
+Since $e _ { i } \gg 1$ , we quickly obtain unstable results.
+
+Definition 1. For $p \in \{ 0 , . . . , n - k \}$ , we define the $p$ -th order approximation to the gradient as:
+
+$$
+\tilde { \delta } _ { k , i } ^ { ( p ) } \triangleq \sum _ { j = 0 } ^ { p } ( - 1 ) ^ { j } \frac { \sigma _ { k + j } ( \mathbf { e } ) } { e _ { i } ^ { j } } .
+$$
+
+Proposition 6. If we approximate the gradient by its $p$ -th order approximation as defined in equation (60), the absolute error is:
+
+$$
+\Big | \delta _ { k , i } - \tilde { \delta } _ { k , i } ^ { ( p ) } \Big | = \frac { \sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) } { e _ { i } ^ { p + 1 } } .
+$$
+
+Proof. We remind equation (18), which gives a recursive relationship for the gradients:
+
+$$
+\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
+$$
+
+This can be re-written as:
+
+$$
+\delta _ { j - 1 , i } = \frac { 1 } { e _ { i } } \left( \sigma _ { j - 1 } ( \mathbf { e } ) - \delta _ { j , i } \right) .
+$$
+
+We write $\sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) = \delta _ { k + p + 1 , i }$ , and the result follows by repeated applications of equation (62) for $j \in \{ k + 1 , k + 2 , . . . , k + p + 1 \}$ . □
+
+Intuition. We have seen in Observation 1 that the recursion tends to be unstable for $\delta _ { j , i }$ when $e _ { i }$ is among the largest elements. When that is the case, the ratio $\displaystyle \frac { \sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) } { e _ { i } ^ { p + 1 } }$ decreases quickly with $p$ . This has two consequences: (i) the sum of equation (60) is stable to compute because the summands have different orders of magnitude and (ii) the error becomes small. Unfortunately, it is difficult to upper-bound the error of equation (61) by a quantity that is both measurable at runtime (without expensive computations) and small enough to be informative. Therefore the approximation error is not controlled at runtime. In practice, we detect the instability of $\delta _ { k , i }$ : numerical issues arise if subtracted terms have a very small relative difference. For those unstable elements we use the $p$ -th order approximation (to choose the value of $p$ , a good rule of thumb is $p \simeq 0 . 2 k _ { \cdot }$ ). We have empirically found out that this heuristic works well in practice. Note that this changes the complexity of the forward pass to $O ( ( k + p ) n )$ since we need $p$ additional coefficients during the backward. If $p \simeq 0 . 2 k$ , this increases the running time of the forward pass by $20 \%$ , which is a moderate impact.
+
+# B.3 A PERFORMANCE COMPARISON WITH THE SUMMATION ALGORITHM
+
+# B.3.1 SUMMATION ALGORITHM
+
+The Summation Algorithm (SA) is an alternative to the Divide-and-Conquer (DC) algorithm for the evaluation of the elementary symmetric polynomials. It is described for instance in (Jiang et al., 2016). The algorithm can be summarized as follows:
+
+Implementation. Note that the inner loop can be parallelized, but the outer one is essentially sequential. In our implementation for speed comparisons, the inner loop is parallelized and a buffer is pre-allocated for the $\sigma _ { j , i }$ .
+
+# Algorithm 3 Summation Algorithm
+
+Require: $\mathbf { e } \in \mathbb { R } ^ { n }$ , k ∈ N ∗
+1: $\sigma _ { 0 , i } \gets 1$ for $1 \leq i \leq n$
+2: $\sigma _ { j , i } \gets 0$ for i < j
+3: $\sigma _ { 1 , 1 } e _ { 1 }$
+4: for $i \in [ [ 2 , n ]$ do
+5: $m \bar { } \operatorname* { m a x } \{ 1 , i + k - n \}$
+6: M ← min{i, k}
+7: for i ∈ m, M do
+8: $\sigma _ { j , i } \sigma _ { j , i - 1 } + e _ { i } \sigma _ { j - 1 , i - 1 }$
+9: end for
+10: end for
+11: return $\sigma _ { k , n }$
+
+$\triangleright \sigma _ { j , i } = \sigma _ { j } ( e _ { 1 } , \ldots , e _ { i } )$ . Do not define values for $i < j$ (meaningless) $\triangleright$ Initialize recursion
+
+# B.3.2 SPEED
+
+We compare the execution time of the DC and SA algorithms on a GPU (Nvidia Titan $\mathrm { X p }$ ). We use the following parameters: $k = 5$ , a batch size of 256 and a varying value of $n$ . The following timings are given in seconds, and are computed as the average of 50 runs. In Table 3, we compare the speed of Summation and DC for the evaluation of the forward pass. In Table 4, we compare the speed of the evaluation of the backward pass using Automatic Differentiation (AD) and our Custom Algorithm (CA) (see Algorithm 2).
+
+Table 3: Execution time (s) of the forward pass. The Divide and Conquer (DC) algorithm offers nearly logarithmic scaling with n in practice, thanks to its parallelization. In contrast, the runtime of the Summation Algorithm (SA) scales linearly with $n$ .
+
+$$
+\begin{array} { r } { \frac { \mathrm { ~ n ~ } } { \mathrm { ~ S A ~ } } \left| \begin{array} { c c c c } { 1 0 0 } & { 1 , 0 0 0 } & { 1 0 , 0 0 0 } & { 1 0 0 , 0 0 0 } \\ { 0 . 0 0 6 } & { 0 . 0 6 2 } & { 0 . 6 2 7 } & { 6 . 2 5 8 } \\ { 0 . 0 1 1 } & { 0 . 0 1 8 } & { 0 . 0 2 4 } & { 0 . 1 4 6 } \end{array} \right. } \end{array}
+$$
+
+We remind that both algorithms have a time complexity of $\mathcal { O } ( k n )$ . SA provides little parallelization (the parallelizable inner loop is small for $k \ll n ,$ ), which is reflected in the runtimes. On the other hand, DC is a recursive algorithm with ${ \mathcal { O } } ( \log ( n ) )$ levels of recursion, and all operations are parallelized at each level of the recursion. This allows DC to have near-logarithmic effective scaling with $n$ , at least in the range $\{ 1 0 0 - 1 0 , 0 0 0 \}$ .
+
+Table 4: Execution time $( s )$ of the backward pass. Our Custom Backward (CB) is faster than Automatic Differentiation $( A D )$ .
+
+$$
+\begin{array} { r } { \frac { \mathrm { n } } { \mathrm { D C \left( A D \right) } } \left| \begin{array} { l l l l } { 1 0 0 } & { 1 , 0 0 0 } & { 1 0 , 0 0 0 } & { 1 0 0 , 0 0 0 } \\ { 0 . 0 9 3 } & { 0 . 1 3 9 } & { 0 . 1 9 4 } & { 0 . 2 8 7 } \\ { 0 . 0 0 7 } & { 0 . 0 0 6 } & { 0 . 0 2 0 } & { 0 . 1 7 1 } \end{array} \right. } \end{array}
+$$
+
+These runtimes demonstrate the advantage of using Algorithm 2 instead of automatic differentiation. In particular, we see that in the use case of ImageNet $( n = 1 , 0 0 0 )$ , the backward computation changes from being ${ 8 } \mathbf { { x } }$ slower than the forward pass to being 3x faster.
+
+# B.3.3 STABILITY
+
+We now investigate the numerical stability of the algorithms. Here we only analyze the numerical stability, and not the precision of the algorithm. We point out that compensation algorithms are useful to improve the precision of SA but not its stability. Therefore they are not considered in this discussion.
+
+Jiang et al. (2016) mention that SA is a stable algorithm, under the assumption that no overflow or underflow is encountered. However this assumption is not verified in our use case, as we demonstrate below. We consider that the algorithm is stable if no overflow occurs in the algorithm (underflows are not an issue for our use cases). We stress out that numerical stability is critical for our machine learning context: if an overflow occurs, the weights of the learning model inevitably diverge to infinite values.
+
+To test numerical stability in a representative setting of our use cases, we take a random mini-batch of 128 images from the ImageNet data set and forward it through a pre-trained ResNet-18 to obtain a vector of scores per sample. Then we use the scores as an input to the SA and DC algorithms, for various values of the temperature parameter $\tau$ . We compare the algorithms with single (S) and double (D) floating point precision.
+
+Table 5: Stability on forward pass. A setting is considered stable if no overflow has occurred.
+
+$$
+{ \begin{array} { l } { { \frac { \tau } { \mathrm { S A } \left( { \mathrm { S } } \right) } } } \\ { { \mathrm { S A } \left( { \mathrm { D } } \right) } } \\ { { \mathrm { D C l o g ~ ( S ) } } } \\ { { \mathrm { D C l o g ~ ( D ) } } } \end{array} } \left| \begin{array} { l l l l l l l l } { { 1 0 ^ { 1 } } } & { { 1 0 ^ { 0 } } } & { { 1 0 ^ { - 1 } } } & { { 1 0 ^ { - 2 } } } & { { 1 0 ^ { - 3 } } } & { { 1 0 ^ { - 4 } } } \\ { { \check { \checkmark } } } & { { \check { \check { \checkmark } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } } & { { \check { \pmb { \check { \check { \check { \check { \tau } } } } } } } } & { { \check { \pmb { \check { \check { \check { \tau } } } } } } } & { { \check { \pmb { \check { \check { \check { \tau } } } } } } } \\ { { \check { \check { \check { \check { \check { \check { \check } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \check } } } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } & { \check { \pmb { \check { \check { \check { \check { \check { \check } } } } } } } } \\ { { \check { \check { \check { \check { \check } { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check } } } } } } \end{array} } \right| }
+$$
+
+By operating in the log-space, DC is significantly more stable than SA. In this experimental setting, DC log is stable in single floating point precision until $\tau = 1 0 ^ { - 3 6 }$ .
+
+# C TOP-K PREDICTION: MARGINALIZATION WITH THE ELEMENTARY SYMMETRIC POLYNOMIALS
+
+We consider the probability of label $i$ being part of the final top- $k$ prediction. To that end, we marginalize over all $k$ -tuples that contain $i$ as one of their element. Then the probability of selecting label $i$ for the top- $k$ prediction can be written as:
+
+$$
+p _ { i } ^ { ( k ) } \propto \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { i } ^ { ( k ) } } \exp ( \sum _ { j \in \bar { \mathbf { y } } } s _ { j } ) .
+$$
+
+Proposition 7. The unnormalized probability can be computed as:
+
+$$
+p _ { i } ^ { ( k ) } \propto \frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } .
+$$
+
+Proof.
+
+$$
+\begin{array} { l } { p _ { i } ^ { ( k ) } \propto \exp ( s _ { i } ) \sigma _ { k - 1 } ( \exp ( \mathbf { s } _ { \backslash i } ) ) , } \\ { \displaystyle \quad = \exp ( s _ { i } ) \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d \exp ( s _ { i } ) } , } \\ { \displaystyle \quad = \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } . } \end{array}
+$$
+
+Finally we can rescale the unnormalized probability $p _ { i } ^ { ( k ) }$ by $\sigma _ { k } \big ( \exp ( \mathbf { s } ) \big )$ since the latter quantity is independent of $i$ . We obtain:
+
+$$
+\hat { p _ { i } } ^ { ( k ) } \propto \frac { 1 } { \sigma _ { k } ( \exp ( \mathbf { s } ) ) } \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } = \frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } .
+$$
+
+NB. We prefer to use $\frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } }$ rather than $\frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } }$ for stability reasons. Once the unnormalized probabilities are computed, they can be normalized by simply dividing by their sum.
+
+# D HYPER-PARAMETERS & EXPERIMENTAL DETAILS
+
+# D.1 THE TEMPERATURE PARAMETER
+
+In this section, we discuss the choice of the temperature parameter. Note that such insights are not necessarily confined to a top- $k$ minimization: we believe that these ideas generalize to any loss that is smoothed with a temperature parameter.
+
+# D.1.1 OPTIMIZATION AND LEARNING
+
+When the temperature $\tau$ has a low value, propositions 3 and 4 suggest that $L _ { k , \tau }$ is a sound learning objective. However, as shown in Figure 2a, optimization is difficult and can fail in practice. Conversely, optimization with a high value of the temperature is easy, but uninformative about the learning: then $L _ { k , \tau }$ is not representative of the task loss we wish to learn.
+
+In other words, there is a trade-off between the ease of the optimization and the quality of the surrogate loss in terms of learning. Therefore, it makes sense to use a low temperature that still permits satisfactory optimization.
+
+# D.1.2 ILLUSTRATION ON CIFAR-100
+
+In Figure 2a, we have provided the plots of the training objective to illustrate the speed of convergence. In Table 6, we give the training and validation accuracies to show the influence of the temperature:
+
+Table 6: Influence of the temperature parameter on the training accuracy and testing accuracy.
+
+
Temperature
Training Accuracy (%)
Testing Accuracy (%)
0
10.01
10.38
10-3
17.40
18.19
10-2
98.95
91.35
10-1100
99.7399.78
91.7091.52
101
99.62
90.92
102
99.42
90.46
+
+# D.1.3 TO ANNEAL OR NOT TO ANNEAL
+
+The choice of temperature parameter can affect the scale of the loss function. In order to preserve a sensible trade-off between regularizer and loss, it is important to adjust the regularization hyperparameter(s) accordingly (the value of the quadratic regularization for instance). Similarly, the energy landscape may vary significantly for a different value of the temperature, and the learning rate may need to be adapted too.
+
+Continuation methods usually rely on an annealing scheme to gradually improve the quality of the approximation. For this work, we have found that such an approach required heavy engineering and did not provide substantial improvement in our experiments. Indeed, we have mentioned that other hyper-parameters depend on the temperature, thus these need to be adapted dynamically too. This requires sensitive heuristics. Furthermore, we empirically find that setting the temperature to an appropriate fixed value yields the same performance as careful fine-tuning of a pre-trained network with temperature annealing.
+
+# D.1.4 PRACTICAL METHODOLOGY
+
+We summarize the methodology that reflects the previous insights and that we have found to work well during our experimental investigation. First, the temperature hyper-parameter is set to a low fixed value that allows for the model to learn on the training data set. Then other hyper-parameters, such as quadratic regularization and learning rate are adapted as usual by cross-validation on the validation set. We believe that the optimal value of the temperature is mostly independent of the architecture of the neural network, but is greatly influenced by the values of $k$ and $n$ (see how these impact the number of summands involved in $L _ { k , \tau }$ , and therefore its scale).
+
+# D.2 THE MARGIN
+
+# D.2.1 RELATIONSHIP WITH SQUARED NORM REGULARIZATION
+
+In this subsection, we establish the relationship between hyper-parameters of the margin and of the regularization with a squared norm. Typically the regularizing norm is the Frobenius norm in deep learning, but the following results will follow for any norm $\| \cdot \|$ . Although we prove the result for our top- $k$ loss, we also point out that these results easily generalize to any linear latent structural SVM.
+
+First, we make explicit the role of $\alpha$ in $l _ { k }$ with an overload of notation:
+
+$$
+l _ { k } ( \mathbf { s } , y , \alpha ) = \operatorname* { m a x } \left\{ \left( \mathbf { s } _ { \backslash y } + \alpha \mathbf { 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} ,
+$$
+
+where $\alpha$ is a non-negative real number. Now consider the problem of learning a linear top- $k$ SVM on a dataset $\left( \mathbf { x } _ { i } , y _ { i } \right) _ { 1 \leq i \leq N } \in \left( \mathbb { R } ^ { d } \times \{ 1 , . . . , n \} \right) ^ { N }$ . We (hyper-)parameterize this problem by $\lambda$ and $\alpha$ :
+
+$$
+( P _ { \lambda , \alpha } ) : \operatorname* { m i n } _ { \mathbf { w } \in \mathbb { R } ^ { d \times n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } l _ { k } ( \mathbf { w } ^ { T } \mathbf { x } _ { i } , y _ { i } , \alpha ) .
+$$
+
+Definition 2. Let $\lambda _ { 1 } , \lambda _ { 2 } , \alpha _ { 1 } , \alpha _ { 2 } \geq 0$ . We say that $\left( P _ { \lambda _ { 1 } , \alpha _ { 1 } } \right)$ and $\left( P _ { \lambda _ { 2 } , \alpha _ { 2 } } \right)$ are equivalent if there exists $\gamma > 0 , \nu \in \mathbb { R }$ such that:
+
+Justification. This definition makes sense because for $\gamma > 0 , \nu \in \mathbb { R }$ , $( \gamma \mathbf { w } + \nu )$ has the same decision boundary as w. In other words, equivalent problems yield equivalent classifiers.
+
+Proposition 8. Let $\lambda , \alpha \geq 0$ .
+
+1. If $\alpha > 0$ and $\lambda > 0$ , then problem $( P _ { \lambda , \alpha } )$ is equivalent to problems $( P _ { \alpha \lambda , 1 } )$ and $\left( P _ { 1 , \alpha \lambda } \right)$ .
+2. If $\alpha = 0$ or $\lambda = 0$ , then problem $( P _ { \lambda , \alpha } )$ is equivalent to problem $( P _ { 0 , 0 } )$ .
+
+Proof. Let $\mathbf { w } \in \mathbb { R } ^ { d \times n }$ . We introduce a constant $\beta > 0$ . Then we can successively write:
+
+$$
+\begin{array} { r l } & { \iff \implies \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n t o ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } l _ { k } ( \mathbf { w } ^ { T } \mathbf { x } _ { \mathbf { x } } , y _ { \mathbf { x } } , \alpha ) , } \\ & { \implies \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { x } } + \alpha \mathbf { I } ) _ { \vert k \vert } - \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { x } } , 0 \} , } \\ & { \iff \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { y } } + \frac { \alpha } { \beta } \mathbf { I } ) _ { \vert k \vert } - \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { x } } ^ { T } \mathbf { x } _ { \mathbf { x } } , 0 \} , } \\ & \iff \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \frac { 1 } { \beta } \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { y } } + \frac { \alpha } { \beta } \ \end{array}
+$$
+
+This holds for any $\beta > 0$ .
+
+If $\alpha > 0$ and $\lambda > 0$ , we show equivalence with $\left( P _ { \alpha \lambda , 1 } \right)$ by setting $\beta$ to $\alpha$ and with $\left( P _ { 1 , \alpha \lambda } \right)$ by setting $\beta$ to $\textstyle { \frac { 1 } { \lambda } }$ . If $\alpha = 0$ , then $\begin{array} { r } { \frac { \alpha } { \beta } = 0 } \end{array}$ for any $\beta > 0$ and we can choose $\beta$ as small as needed to make $\beta \lambda$ arbitrarily
+
+small.
+
+If $\lambda = 0$ , $\beta \lambda = 0$ for any $\beta > 0$ and we can choose $\beta$ as large as needed to make $\frac { \alpha } { \beta }$ arbitrarily small.
+
+Note that we do not need any hypothesis on the norm $\| \cdot \|$ , the result makes only use of the positive homogeneity property.
+
+Consequence On Deep Networks. Proposition 8 shows that for a deep network trained with $l _ { k }$ , one can fix the value of $\alpha$ to 1, and treat the quadratic regularization of the last fully connected layer as an independent hyper-parameter. By doing this rather than tuning $\alpha$ , the loss keeps the same scale which may make it easier to find an appropriate learning rate.
+
+When using the smooth loss, there is no direct equivalent to Proposition 8 because the log-sumexp function is not positively homogeneous. However one can consider that with a low enough temperature, the above insight can still be used in practice.
+
+# D.2.2 EXPERIMENT ON IMAGENET
+
+In this section, we provide experiments to qualitatively assess the importance of the margin by running experiments with a margin of either 0 or 1. The following results are obtained on our validation set, and do not make use of multiple crops.
+
+Top-1 Error. As we have mentioned before, the case $( k , \tau , \alpha ) = ( 1 , 1 , 0 )$ corresponds exactly to Cross-Entropy. We compare this case against the same loss with a margin of 1: $( k , \bar { \tau } , \alpha ) = ( 1 , \ i , 1 )$ . We obtain the following results:
+
+Table 7: Influence of the margin parameter on top-1 performance.
+
+
Margin
Top-1 Accuracy (%)
0
71.03
1
71.15
+
+Top-5 Error. We now compare $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 0 )$ and $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 1 )$ :
+
+Table 8: Influence of the margin parameter on top-5 performance.
+
+
Margin
Top-5 Accuracy (%)
0
89.12
1
89.45
+
+# D.3 SUPPLEMENTARY DETAILS
+
+In the main paper, we report the average of the scores on CIFAR-100 for clarity purposes. Here, we also detail the standard deviation of the scores for completeness.
+
+Table 9: Testing performance on CIFAR-100 with different levels of label noise. We indicate the mean and standard deviation (in parenthesis) for each score.
+
+
Noise Level
Top-1 Accuracy (%) CE L5,1
Top-5 Accuracy (%) CE
0.0
76.68 (0.38)
L5,1 94.29 (0.10)
0.2
68.20 (0.50)
69.33 (0.27) 71.30 (0.79)
94.34 (0.09) 87.89 (0.08)
0.4
83.04 (0.38)
90.59 (0.08)
0.6
61.18 (0.97)
70.02 (0.40) 67.97 (0.51)
79.59 (0.36)
87.39 (0.23)
0.8
52.50 (0.27) 35.53 (0.79)
55.85 (0.80)
74.80 (0.15)
83.86 (0.39)
1.0
67.70 (0.16)
79.32 (0.25)
14.06 (0.13)
15.28 (0.39)
72.93 (0.25)
\ No newline at end of file
diff --git a/md/train/HkGmDsR9YQ/HkGmDsR9YQ.md b/md/train/HkGmDsR9YQ/HkGmDsR9YQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..ca6f9fdcdc4e21ea0e817ff53b503d79fc82c0a8
--- /dev/null
+++ b/md/train/HkGmDsR9YQ/HkGmDsR9YQ.md
@@ -0,0 +1,288 @@
+# GENERALIZATION AND REGULARIZATION IN DQN
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Deep reinforcement learning (RL) algorithms have shown an impressive ability to learn complex control policies in high-dimensional environments. However, despite the ever-increasing performance on popular benchmarks like the Arcade Learning Environment (ALE), policies learned by deep RL algorithms can struggle to generalize when evaluated in remarkably similar environments. These results are unexpected given the fact that, in supervised learning, deep neural networks often learn robust features that generalize across tasks. In this paper, we study the generalization capabilities of DQN in order to aid in understanding this mismatch between generalization in deep RL and supervised learning methods. We provide evidence suggesting that DQN overspecializes to the domain it is trained on. We then comprehensively evaluate the impact of traditional methods of regularization from supervised learning, $\ell _ { 2 }$ and dropout, and of reusing learned representations to improve the generalization capabilities of DQN. We perform this study using different game modes of Atari 2600 games, a recently introduced modification for the ALE which supports slight variations of the Atari 2600 games used for benchmarking in the field. Despite regularization being largely underutilized in deep RL, we show that it can, in fact, help DQN learn more general features. These features can then be reused and fine-tuned on similar tasks, considerably improving the sample efficiency of DQN.
+
+# 1 INTRODUCTION
+
+Recently, reinforcement learning (RL) has proven very successful on complex high-dimensional problems, in large part due to the increase in computational power and to the use of deep neural networks for function approximation (e.g., Mnih et al., 2015; Silver et al., 2016). Despite the generality of the proposed solutions, applying these algorithms to slightly different environments generally requires agents to learn the new task from scratch. Practitioners often realize that the learned policies rarely generalize to other domains, even when they are remarkably similar, and that the learned representations are seldom reusable.
+
+Deep neural networks, though, are lauded for their generalization capabilities (e.g., LeCun et al., 1998). Some communities heavily rely on reusing representations learned by neural networks. In computer vision, classification and segmentation algorithms are rarely trained from scratch; instead they are initialized with pre-trained models from larger datasets like ImageNet (e.g., Razavian et al., 2014; Long et al., 2015). The field of natural language processing has also seen successes in reusing and refining weights from certain layers of neural networks using pre-trained word embeddings, with more recent techniques able to reuse all weights of the network (e.g., Howard & Ruder, 2018).
+
+In light of the successes of traditional supervised learning methods, the current lack of generalization or reusable knowledge (e.g., policies, representation) acquired by current deep RL algorithms is somewhat surprising. In this paper we investigate whether the representation learned by deep RL methods can be generalized, or at the very least reused and refined on small variations to the task at hand. First, we evaluate the generalization capabilities of DQN (Mnih et al., 2015). We further explore whether the experience gained by the supervised learning community to improve generalization and to avoid overfitting could be used in deep RL. We employ conventional supervised learning techniques, albeit largely unexplored in deep RL, such as fine-tuning (i.e., reusing and refining the representation) and regularization. We show that a learned representation trained with regularization allows us to learn more general features capable of being reused and fine-tuned. Besides improving the generalization capabilities of the learned policies this fine-tuning procedure has the potential to greatly improve sample efficiency on settings in which an agent might face multiple variations of the same task. Finally, the results we present here also can be seen as paving a way towards novel curriculum learning approaches for deep RL.
+
+We perform our experiments using different game modes and difficulties of Atari 2600 games, a newly introduced feature of the Arcade Learning Environment (ALE; Bellemare et al., 2013). These game modes allow agents to be trained in one environment while being evaluated in a slightly different environment that still captures key concepts of the original environment (e.g., game sprites, agent goals, dynamics). This use of game modes is itself a novel approach for measuring our progress toward a longstanding goal of agents that can learn to be generally competent and generalize across tasks (Bellemare et al., 2013; Machado et al., 2018; Nichol et al., 2018). This paper also introduces the first baselines for the different modes of Atari 2600 games.
+
+# 2 BACKGROUND
+
+# 2.1 REINFORCEMENT LEARNING
+
+Reinforcement learning (RL) is a problem where an agent interacts with an environment with the goal of maximizing some form of cumulative long term reward. RL problems are often modeled as a Markov decision process (MDP), defined by a 5-tuple $\langle \mathcal { S } , \mathcal { A } , p , r , \gamma \rangle$ . At a discrete time step $t$ the agent observes the current state $S _ { t } ~ \in ~ \mathcal { S }$ and chooses an action $A _ { t } \in \mathcal A$ to probabilistically transition to the next state $S _ { t + 1 } \in \mathcal S$ according to the transition dynamics function $p ( s ^ { \prime } \mid s , a ) \ { \stackrel { . } { = } }$ $P ( S _ { t + 1 } = s ^ { \prime } | S _ { t } = s , A _ { t } = \stackrel { . } { a } )$ . The agent receives a reward signal $R _ { t + 1 }$ according to the reward function $r : \mathcal { S } \times \mathcal { A } \mathbb { R }$ . The agents goal is to learn a policy $\pi : \mathcal { S } \times \mathcal { A }$ defined as the conditional probability of taking action $a$ in state $s$ written as $\pi ( a | s )$ . The learning agent refines its policy with the objective of maximizing the expected return, that is, the cumulative discounted reward incurred from time $t$ , defined by $\begin{array} { r } { G _ { t } \stackrel { } { = } \sum _ { k = 0 } ^ { \infty ^ { \bullet } } \gamma ^ { k } R _ { t + k + 1 } } \end{array}$ where $\gamma \in [ 0 , 1 )$ is the discount factor.
+
+Q-learning (Watkins & Dayan, 1992) is a traditional approach to learning an optimal policy from samples obtained from interactions with the environment. It is used to learn an optimal state-action value function via a bootstrapped iterative method. For a given policy $\pi$ we define the state-action value function as the expected return conditioned on a state and action $q _ { \pi } ( s , a ) \doteq \mathbb { E } _ { \pi } \bigl [ G _ { t } | S _ { t } = s , A _ { t } = a \bigr ]$ . The agent iteratively updates the state-action value function based on samples from the environment using the update rule
+
+$$
+Q ( S _ { t } , A _ { t } ) Q ( S _ { t } , A _ { t } ) + \alpha \big [ R _ { t + 1 } + \gamma \operatorname* { m a x } _ { a ^ { \prime } \in A } Q ( S _ { t + 1 } , a ^ { \prime } ) - Q ( S _ { t } , A _ { t } ) \big ]
+$$
+
+where $t$ denotes the current timestep and $\alpha$ the step size. Generally, due to the exploding size of the state space in many real-world problems, it is intractable to learn a state-action pairing for the entire MDP, with researchers and practitioners often resorting to learning an approximate to $q _ { \pi }$ .
+
+DQN approximates the state-action value function such that $q _ { \pi } ( s , a ) \approx Q ( s , a ; \theta )$ , where $\theta$ denotes the weights of a neural network. The network takes as input some encoding of the current state $S _ { t }$ and outputs $| { \cal A } |$ scalars corresponding to the state-action values for that given state. DQN is trained to minimize
+
+$$
+L ^ { \mathrm { { D Q N } } } = \underset { S _ { t } , A _ { t } , R _ { t + 1 } , S _ { t + 1 } \sim U ( \cdot ) } { \mathbb { E } } \left[ \left( R _ { t + 1 } + \underset { a ^ { \prime } \in A } { \operatorname* { m a x } } Q ( S _ { t + 1 } , a ^ { \prime } ; \theta ^ { - } ) - Q ( S _ { t } , A _ { t } ; \theta ) \right) ^ { 2 } \right]
+$$
+
+where $( S _ { t } , A _ { t } , R _ { t + 1 } , S _ { t + 1 } )$ are uniformly sampled from $U ( \cdot )$ , the experience replay buffer filled with experience collected by the agent. The weights $\theta ^ { - }$ of a duplicate network are updated less frequently for stability purposes.
+
+# 2.2 SUPERVISED LEARNING
+
+In the supervised learning problem we are given a dataset of examples represented by a matrix $X \in \mathbb { R } ^ { m \times n }$ with $m$ training examples of dimension $n$ , and a vector $\mathbf { y } ^ { \star } \in \mathbb { R } ^ { 1 \times m }$ denoting the output target $y _ { i }$ for each training example $X _ { i }$ . We want to learn a function which maps each training example $X _ { i }$ to its predicted output label $\hat { y } _ { i }$ . The goal is to learn a robust model that accurately predicts $y _ { i }$ from $X _ { i }$ while also being able to generalize to unseen training examples. In this paper we focus on using a neural network parameterized by the weights $\theta$ to learn the function $f$ such that $\hat { y } _ { i } = f ( X _ { i } ; \theta )$ . We typically train these models by minimizing
+
+$$
+\operatorname* { m i n } _ { \theta } \ \frac { \lambda } { 2 } \ \| \theta \| _ { 2 } ^ { 2 } + \frac { 1 } { m } \sum _ { i = 1 } ^ { m } L ( y _ { i } , \hat { y } _ { i } ) = \operatorname* { m i n } _ { \theta } \ \frac { \lambda } { 2 } \ \| \theta \| _ { 2 } ^ { 2 } + \frac { 1 } { m } \sum _ { i = 1 } ^ { m } L ( y _ { i } , f ( X _ { i } ; \theta ) )
+$$
+
+where $L$ is a differentiable loss function which outputs a scalar determining the quality of the prediction (e.g., squared error loss). The first term is a form of regularization, i.e., $\ell _ { 2 }$ regularization, which encourages generalization. $\ell _ { 2 }$ regularization imposes a penalty on large weight vectors with $\lambda$ being the weighted importance of the regularization term.
+
+Another popular regularization technique is dropout (Srivastava et al., 2014). When using dropout, during forward propagation each neural unit has a chance of being set to zero according to a Bernoulli distribution with probability $p \in [ 0 , 1 ]$ , referred to as the dropout rate. Dropout discourages the network from relying on a small number of neurons to make a prediction, making it hard for the network to memorize the dataset.
+
+Prior to training, the network parameters are usually initialized through a stochastic process (e.g., Xavier initialization; Glorot & Bengio, 2010). We can also initialize the network using pre-trained weights from a different task. If we reuse one or more pre-trained layers we say the weights encoded by those layers will be fine-tuned during training (e.g., Razavian et al., 2014; Long et al., 2015).
+
+# 3 THE ALE AS A PLATFORM FOR EVALUATING GENERALIZATION
+
+The Arcade Learning Environment (ALE) is a platform used to evaluate agents across dozens of Atari 2600 games (Bellemare et al., 2013). It has become one of the standard evaluation platforms in the field and has led to a number of exciting algorithmic advances (e.g., Mnih et al., 2015). The ALE poses the problem of general competency by having agents use the same learning algorithm to perform well in as many games as possible, while learning without using game specific knowledge. Learning to play multiple games with the same agent, or learning to play a game faster by leveraging knowledge acquired in a different game is much harder, with fewer successes being known (e.g., Rusu et al., 2016; Kirkpatrick et al., 2016; Parisotto et al., 2016; Schwarz et al., 2018; Espeholt et al., 2018).
+
+In this paper, we use the different modes and difficulties of Atari 2600 games to evaluate a neural network’s ability to generalize in high-dimensional state spaces. Game modes, originally native to the Atari console, were recently added in the ALE (Machado et al., 2018). They give us modifications of the default environment dynamics and state space, often modifying sprites, velocities, and partial observability. These modes pose a tractable way to investigate generalization of RL agents in a high-dimensional environment. Instead of requiring an agent to play multiple games that are visually very different or even non-analogous, it requires agents to play games that are visually very similar and that can be played with policies that are very similar, at least from a human perspective.
+
+We use 13 flavours (combinations of a mode and a difficulty) obtained from 4 games: FREEWAY, HERO, BREAKOUT, and SPACE INVADERS. In FREEWAY, the different modes vary the speed and number of vehicles, while different difficulties change how the player is penalized for running into a vehicle. In HERO, subsequent modes start the player off at increasingly harder levels of the game. The mode we use in BREAKOUT makes the bricks partially observable. The used modes in SPACE INVADERS allow for oscillating shield barriers, increasing the width of the player sprite, and partially observable aliens. Full explanations of specific games, their modes, and their difficulties can be found in Appendix A. Figure 1 provides screenshots showing side by side comparisons of some of the modes explored in this paper. When reading the analyses of this paper it is important to keep in mind how remarkably similar these modes are.
+
+# 4 GENERALIZATION OF THE LEARNED POLICIES AND OVERFITTING
+
+In order to test the generalization capabilities of DQN we first evaluate whether a policy learned in one flavour can perform well in a different flavour. As afformentioned, different modes and difficulties of a single game look very similar. If the representation encodes a robust policy we might expect it to be able to generalize to slight variations of the underlying reward signal, game dynamics, or observations. Evaluating the learned policy in a similar but different flavour can be seen as evaluating generalization in RL, similar to cross-validation in supervised learning.
+
+
+Figure 1: Each column shows variation between two selected flavours of each game. From left to right: FREEWAY, HERO, BREAKOUT, and SPACE INVADERS.
+
+To evaluate DQN’s ability to generalize across flavours we evaluate the learned $\epsilon$ -greedy policy on a new flavour after being trained for 50M frames in the default flavour, $\mathrm { m 0 d 0 }$ (mode 0, difficulty 0). We measure the cumulative reward averaged over 100 episodes in the new flavour, adhering to the evaluation protocol suggested by Machado et al. (2018). The results are summarized in Table 1. Baseline results where the agent is trained from scratch for 50M frames in the flavour we use for evaluation are summarized in the baseline column. Theoretically, this baseline can be seen as an upper bound on the performance DQN can achieve in that flavour, as it represents the agent’s performance when evaluated in the same flavour it was trained on. Full baseline results with the agent’s performance after different number of frames can be found in Appendix B.
+
+We can see in the results that the policies learned by DQN do not generalize well to different flavours, even when the flavours are remarkably similar. For example, in FREEWAY, a high-level policy applicable to all flavours is to go up while avoiding cars. Perhaps surprisingly, this does not seem to be what DQN learns. For example, the default flavour $\mathrm { m 0 d 0 }$ and $\scriptstyle \mathrm { m 4 d 0 }$ have exactly the same sprites on the screen, the only difference is that in $\mathrm { m 4 d 0 }$ some cars accelerate and decelerate over time. The close to optimal policy learned in $\mathrm { m 0 d 0 }$ is only able to score 15.8 points when evaluated on $\scriptstyle \mathrm { m 4 d 0 }$ , which is approximately half of what the policy learned from scratch in that flavour achieves (29.9 points). The learned policy when evaluated on flavours that differ more from $\mathrm { m 0 d 0 }$ perform even worse.
+
+As previously mentioned, the different modes of HERO can be seen as giving the agent a curriculum or a natural progression. Interestingly, the agent trained in the default mode for 50M frames can progress to at least level 3 and sometimes level 4. Mode 1 starts the agent off at level 5, and performance in this mode suffers greatly during evaluation. There are very few game mechanics added to level 5, indicating that perhaps the agent is memorizing trajectories instead of learning a robust policy capable of solving each level.
+
+The results in some flavours suggest that the agent is overfitting to the flavour it is trained on. We tested this hypothesis by periodically evaluating the policy being learned in each of the other flavours of that game. This process involved taking checkpoints of the network at every 500, 000 frames and evaluating the $\epsilon$ -greedy policy in the prescribed flavour for 100 episodes, again further averaged over five runs. The obtained results in FREEWAY, the most pronounced game in which we see this overfitting trend, are depicted in Figure 2. Learning curves for all flavours can be found in Appendix C.
+
+In FREEWAY, while we see the policy’s performance flattening out in $\mathrm { m 4 d 0 }$ , we do see the traditional bell-shaped curve associated to overfitting in the other modes. At first, improvements in the original policy do correspond to improvements in the performance of that policy in other domains. With time, it seems that it starts to refine its policy for the specific flavour it is being trained on, overfitting to that flavour. With other game flavours being significantly more complex in their dynamics and gameplay, we do not observe this prominent bell-shaped curve though. For example, in BREAKOUT, we actually observe a monotonic increase in performance throughout the evaluation process.
+
+Table 1: Direct policy evaluation. Each game was initially trained in the default mode for 50M frames then evaluated in each listed game flavour. Reported numbers are the average over 5 runs. Standard deviation is reported between parentheses.
+
+
GAME VARIANT
EVALUATION
LEARN SCRATCH
FREEWAY
m1d0
0.2 (0.2)
4.8 (9.3)
m1d1
0.1 (0.1)
0.0 (0.0)
m4d0
15.8 (1.0)
29.9 (0.7)
HERO
m1d0
82.1 (89.3)
1425.2 (1755.1)
m2d0
33.9 (38.7)
326.1 (130.4)
BREAKOUT
m12d0
43.4 (11.1)
67.6 (32.4)
SPACE INVADERS
m1d0
258.9 (88.3)
753.6 (31.6)
m1d1
140.4 (61.4)
698.5 (31.3)
m9d0
179.0 (75.1)
518.0 (16.7)
+
+
+Freeway Policy Evaluation
+Figure 2: Performance of an agent that was trained in the default mode of FREEWAY and evaluated at every 500, 000 frames in each corresponding mode. Results are averaged over five seeds. The y-axis is log scaled.
+
+In conclusion, when looking at Table 1, it seems that the policies learned by DQN struggle to generalize to even small variations encountered in game flavours. This lack of generalization is surprising, and results as seen in FREEWAY exhibit a troubling notion of overfitting. Based on these results we aim to evaluate whether deep RL could benefit from established methods from supervised learning promoting generalization and reducing overfitting.
+
+# 5 REGULARIZATION IN DEEP RL
+
+In order to evaluate the hypothesis that the observed lack of generalization is due to overfitting, we revisit some popular regularization methods from the supervised learning literature. The two forms of regularization we test are dropout and $\ell _ { 2 }$ regularization.
+
+First we want to understand the effect of regularization on evaluating the learned policy in a different flavour. We do so by applying dropout to the first four layers of the network during training, that is, the three convolutional layers and the first fully connected layer. We simultaneously apply $\ell _ { 2 }$ regularization on all weights in the network based on preliminary experiments that showed an additive effect when combining dropout and $\ell _ { 2 }$ regularization. This confirms, for example, Srivastava et al.’s (2014) result that these methods provide benefit in tandem.
+
+We follow the same evaluation scheme described when evaluating the unregularized policy to different flavours. We evaluate the policy learned after 50M frames of the default mode of each game. A grid search was performed on FREEWAY to find reasonable hyperparameters for the dropout rate $p \in$ $\{ 0 . 0 5 , 0 . 1 , 0 . 2 , \bar { 0 } . 3 , 0 . 4 , 0 . 5 \}$ and the weighted regularization parameter $\lambda \in \{ 1 0 ^ { - 2 } , \dot { 1 } 0 ^ { - 3 } , 1 0 ^ { - 4 } \}$ . These parameters were then used for each subsequent flavour. Notably, significantly smaller dropout values were required compared to heuristics used in supervised learning, although this could be due to the small size of the network in question. We ended up choosing $\lambda \stackrel { = } { = } 1 0 ^ { - 4 }$ , $p = 0 . 0 5$ for the first three convolutional layers, and $p = 0 . 1$ for the first fully connected layer. We contrast these results with the results presented in the previous section. This evaluation protocol allows us to directly evaluate the effect of regularization on the learned policy’s ability to generalize. A baseline agent trained from scratch for 50M frames in each flavour is also provided. The results are presented in Table 2 with the evaluation learning curves being available in the Appendix.
+
+When using regularization during training we sometimes observe a performance hit in the default flavour. Dropout generally requires increased training iterations to reach the same level of performance sans-dropout. Suprisingly, we did not observe this performance hit in all games. Nevertheless, maximal performance in one flavour is not our goal. We are interested in the setting where one may be willing to take lower performance on one task in order to obtain higher performance, or adaptability, on future tasks. Nevertheless, full baseline results using regularization in the default flavour can also be found in Table 7 in the Appendix.
+
+Table 2: Policy evaluation using regularization. Each game was initially trained in the default mode for 50M frames with dropout and $\ell _ { 2 }$ regularization then evaluated on each listed flavour. Reported numbers are the average over 5 runs. Standard deviation is reported between parentheses.
+
+
GAME VARIANT
EVAL. WITH REGULARIZATION
EVAL.WITHOUT REGULARIZATION
LEARN SCRATCH
FREEWAY
m1do
5.8
(3.5)
0.2 (0.2)
4.8
(9.3)
m1d1
4.4
(2.3)
0.1 (0.1)
0.0
(0.0)
m4d0
20.6
(0.7)
15.8 (1.0)
29.9
(0.7)
HERO
m1d0o
116.8
(76.0)
82.1 (89.3)
1425.2
(1755.1)
m2d0
30.0
(36.7)
33.9 (38.7)
326.1
(130.4)
BREAKOUT
m12d0
31.0
(8.6)
43.4 (11.1)
67.6
(32.4)
SPACE INVADERS
m1d0
456.0
(221.4)
258.9 (88.3)
753.6
(31.6)
m1d1
146.0
(84.5)
140.4 (61.4)
698.5
(31.3)
m9d0
290.0
(257.8)
179.0 (75.1)
518.0
(16.7)
+
+
+Freeway Policy Evaluation w/ Regularization
+Figure 3: Performance of an agent that was evaluated every 500, 000 frames after being trained in the default flavour of FREEWAY with dropout and $\ell _ { 2 }$ regularization. Results are averaged over five seeds. The y-axis is log scaled.
+
+In most flavours, evaluating the policy trained with regularization does not negatively impact performance when compared to the performance of the policy trained without regularization. In some flavours we even see an increase in performance. Interestingly, when using regularization the agent in FREEWAY improves for all flavours and even learns a policy capable of outperforming the baseline learned from scratch in two of the three flavours. Moreover, in FREEWAY we now observe increasing performance during evaluation throughout most of the learning procedure as depicted in Figure 3. These results seem to confirm the notion of overfitting observed in Figure 2.
+
+Despite slight improvements from these techniques, regularization by itself does not seem sufficient to enable policies to generalize across flavours. As shown in the next section, perhaps the real benefit of regularization in deep RL comes from the ability to learn more general features. These features may lead to a more adaptable representation which can be reused and subsequently fine-tuned on other flavours, which is often the case in supervised learning.
+
+# 6 VALUE FUNCTION FINE-TUNING
+
+We hypothesize that the benefit of regularizing deep RL algorithms may not come from improvements during evaluation, but instead in having a good parameter initialization that can be adapted to new tasks that are similar. We evaluate this hypothesis using two common practices in machine learning. First, we the use the weights trained with regularization as the initialization for the entire network. We subsequently fine-tune all weights in the network. This is similar to what is performed in computer vision with supervised classification methods (e.g., Razavian et al., 2014). Secondly, we evaluate reusing and fine-tuning only early layers of the network. This has been shown to improve generalization in some settings (e.g., Yosinski et al., 2014), and is sometimes used in natural language processing (e.g., Mou et al., 2016; Howard & Ruder, 2018).
+
+When fine-tuning the entire network, we take the weights of the network trained in the default flavour for 50M frames and use them to initialize the network commencing training in the new flavour for 50M frames. We perform this set of experiments twice. Once for the weights trained without regularization, and again for the weights trained with regularization, as described in the previous section. Each run is averaged over five seeds. For comparison we provide a baseline trained from scratch for 50M and 100M frames in each flavour. Directly comparing the performance obtained after fine-tuning to the performance after 50M frames (SCRATCH) shows the benefit of re-using a representation learned in a different task instead of randomly initializing the network. Comparing the performance obtained after fine-tuning to the performance of 100M frames (SCRATCH) lets us take into consideration the whole learning process. The results are presented in Table 3.
+
+Fine-tuning from an unregularized representation yields conflicting conclusions. Although in FREEWAY we obtained positive fine-tuning results, we note that rewards are so sparse in m1d0 and m1d1 that this initialization is likely to be simply acting as a form of optimistic initialization, biasing the agent to go up. The agent observes rewards more often, therefore, it learns quicker about the new flavour. However, the agent is still unable to reach the maximum score in these flavours.
+
+Table 3: Experiments fine-tuning the entire network with and without regularization (dropout $+ \ell _ { 2 } .$ ). An agent is trained with dropout $+ ~ \ell _ { 2 }$ regularization in the default flavour of each game for 50M frames, then DQN’s parameters $\theta$ were used to initialize the fine-tuning procedure on each new flavour for 50M frames. The baseline agent is trained from scratch up to 100M frames. Standard deviation reported between parenthesis.
+
+
FINE-TUNING
REGULARIZED FINE-TUNING
SCRATCH
GAME VARIANT
10M
50M
10M
50M
50M
100M
FREEWAY
m1d0
2.9
(3.7)
22.5
(7.5)
20.2
(1.9)
25.4
(0.2)
4.8
(9.3)
7.5
(11.5)
m1d1
0.1
(0.2)
17.4
(11.4)
18.5
(2.8)
25.4
(0.4)
0.0
(0.0)
2.5
(7.3)
m4d0
20.8
(1.1)
31.4
(0.5)
22.6
(0.7)
32.2
(0.5)
29.9
(0.7)
32.8
(0.2)
HERO
m1d0
220.7
(98.2)
496.7
(362.8)
322.5
(39.3)
4104.6
(2192.8)
1425.2
(1755.1)
5026.8
(2174.6)
m2d0
74.4
(31.7)
92.5
(26.2)
84.8
(56.1)
211.0
(100.6)
326.1
(130.4)
323.5
(76.4)
BREAKOUT
m12d0
11.5
(10.7)
69.1
(14.9)
48.2
(4.1)
96.1
(11.2)
67.6
(32.4)
55.2
(37.2)
SPACE INVADERS
m1d0
617.8
(55.9)
926.1
(56.6)
701.8
(28.5)
1033.5
(89.7)
753.6
(31.6)
979.7
(39.8)
m1d1
482.6
(63.4)
799.4
(52.5)
656.7
(25.5)
920.0
(83.5)
698.5
(31.3)
906.9
(56.5)
m9d0
354.8
(59.4)
574.1
(37.0)
519.0
(31.1)
583.0
(17.5)
518.0
(16.7)
567.7
(40.1)
+
+The results of fine-tuning the regularized representation are more exciting. In FREEWAY we observe the highest scores on $\mathrm { m l d 0 }$ and m1d1 throughout the whole paper. In HERO we vastly outperform fine-tuning from an unregularized representation. In SPACE INVADERS we obtain higher scores across the board on average when comparing to the same amount of experience. These results suggest that reusing a regularized representation in deep RL might allow us to learn more general features which can be more successfully fine-tuned.
+
+Moreover, initializing the network with a regularized representation has a big impact on the agent’s performance when compared to initializing the network randomly. These results are impressive when we consider the potential regularization has in reducing the sample complexity of deep RL algorithms. Such an observation also holds when we take the total number of frames seen between two flavours into consideration. When directly comparing one row of REGULARIZED FINE-TUNING to SCRATCH we are comparing two algorithms that observed 100M frames. However, to generate two rows of SCRATCH we used 200M frames while two rows of REGULARIZED FINE-TUNING used 150M frames (50M from scratch $\mathbf { \Gamma } + 5 0 \mathbf { M }$ in each row). The distinction becomes bigger and bigger as more tasks are taken into consideration.
+
+We further investigate which layers may encode general features able to be fine-tuned. Inspiration was taken from other studies that have shown that neural networks can re-learn co-adaptations when their final layers are randomly initialized, sometimes improving generalization (Yosinski et al., 2014). We conjectured DQN may benefit from re-learning the co-adaptations between early layers comprising general features and the randomly initialized layers which ultimately assign state-action values. We hypothesized that it might be beneficial to re-learn the final layers from scratch since state-action values are ultimately conditioned on the flavour at hand. Therefore, we also evaluated whether fine-tuning only the convolutional layers, or the convolutional layers and the first fully connected layer was more effective than fine-tuning the whole network. Suprisingly, this does not seem to be the case. The performance obtained when the whole network is fine-tuned (Table 3) is consistently better than when it is not (Table 4). We speculate that this might not be the case on more dissimilar tasks.
+
+# 7 DISCUSSION AND CONCLUSION
+
+Many studies have tried to explain generalization of deep neural networks in supervised learning settings (e.g., Zhang et al., 2018; Dinh et al., 2017). Analyzing generalization and overfitting in deep RL has its own issues on top of the challenges posed in the supervised learning case. Actually, generalization in RL can be seen in different ways. We can talk about generalization in RL in terms of conditioned sub-goals within an environment (e.g., Andrychowicz et al., 2017; Sutton, 1995), learning multiple tasks at once (e.g., Teh et al., 2017; Parisotto et al., 2016), or sequential task learning as in a continual learning setting (e.g., Schwarz et al., 2018; Kirkpatrick et al., 2016). In this paper we evaluated generalization in terms of small variations of high-dimensional control tasks. This provides a candid evaluation method to study how well features and policies learned by deep neural networks in RL problems can generalize. The approach of studying generalization with respect to the representation learning problem intersects nicely with the aforementioned problems in RL where generalization is key.
+
+REGULARIZED FINE-TUNING 3CONV
+REGULARIZED FINE-TUNING REGULARIZED 3CONV+1FC FINE-TUNING
+Table 4: Experiments fine-tuning early layers of the network trained with regularization. An agent is trained with dropout $+ \ell _ { 2 }$ regularization in the default flavour of each game for 50M frames, then DQN’s parameters $\theta$ were used to initialize the corresponding layers to be further fine-tuned on each new flavour. Remaining layers were randomly initialized. Compared against fine-tuning the entire network from Table 3. Standard deviation reported between parenthesis.
+
+
GAME VARIANT
10M
50M
10M
50M
50M
FREEWAY
m1d0
0.0
(0.0)
0.7
(1.4)
0.1
(0.1)
4.9 (9.9)
25.4 (0.2)
m1d1
0.0
(0.0)
0.0
(0.0)
0.1
(0.1)
10.0 (12.3)
25.4 (0.4)
m4d0
7.3
(3.5)
30.4
(0.6)
4.9
(4.8)
30.7 (1.7)
32.2 (0.5)
HERO
m1d0
405.1
(82.0)
1949.1
(2076.4)
350.3
(52.1)
3085.3 (2055.6)
4104.6 (2192.8)
m2d0
232.1
(30.1)
455.2
(170.4)
150.4
(38.5)
307.6 (64.8)
211.0
(100.6)
BREAKOUT
m12d0
4.3
(1.7)
63.7
(26.6)
5.4
(0.8)
89.1 (16.7)
96.1 (11.2)
SPACE INVADERS
m1d0
669.3
(29.1)
998.1
(78.8)
681.3
(17.2) 989.6
(39.4)
1033.5
(89.7)
m1d1
609.8
(16.6)
836.3
(55.9)
638.7
(19.1)
883.4 (38.1)
920.0 (83.5)
m9d0
436.1
(18.9)
581.0
(12.2)
439.9
(40.3) 586.7
(39.7)
583.0
(17.5)
+
+The empirical evaluation presented in this paper has shown that traditional DQN seems to generalize poorly even between very similar high-dimensional control tasks. Given this lack of generality we investigated how dropout and $\ell _ { 2 }$ regularization can be used to improve generalization in deep RL. Other forms of regularization in RL that have been explored in the past are sticky-actions, random initial states, entropy regularization (Zhang et al., 2018), and procedural generation of environments (Justesen et al., 2018). More related to our work, regularization in the form of weight constraints has been applied in the continual learning setting in order to reduce the catastrophic forgetting exhibited by fine-tuning on many sequential tasks (Kirkpatrick et al., 2016; Schwarz et al., 2018). Similar weight constraint methods have been explored in multitask learning (Teh et al., 2017).
+
+Evaluation practices in RL often focuses on training and evaluating agents on exactly the same task. Consequently, regularization has traditionally been underutilized in deep RL. With a renewed emphasis on generalization in RL, regularization applied to the representation learning problem can be a feasible method to improving generalization on closely related tasks. Our results suggest that dropout and $\ell _ { 2 }$ regularization seem to be able to learn more general purpose features which can be adapted to similar problems. Although other communities relying on deep neural networks have shown similar successes, this is of particular importance for the deep RL community which struggles with sample efficiency (Henderson et al., 2018). This work is also related to recent metalearning procedures like MAML (Finn et al., 2017) which aim to find a parameter initialization that can be quickly adapted to new tasks. In fact, some of the results here can also be seen under the light of curriculum learning. The regularization techniques we’ve evaluated here seem to be effective in leveraging situations where an easier task is presented first, sometimes leading to unseen performance levels (e.g., FREEWAY).
+
+Finally, we believe it would be extremely beneficial for the field if we were able to develop algorithms that can generalize across tasks. Ultimately we want agents that can keep learning as they interact with the world in a continual learning fashion. The ability to generalize is essential. Throughout this paper we often avoided the expression transfer learning because we believe that succeeding in slightly different environments should be actually seen as a problem of generalization. Our results suggested that regularizing and fine-tuning representations in deep RL might be a viable approach towards improving sample efficiency and generalization on multiple tasks. It is particularly interesting that fine-tuning a regularized network was the most successful approach because this might also be applicable in the continual learning settings where the environment changes without the agent being told so, and re-initializing layers of a network is obviously not an option. In this setting, the work from Kirkpatrick et al. (2016), and Schwarz et al. (2018) might be a great starting point as they provide a more thorough discussion of generalization in continual learning.
+
+# REFERENCES
+
+Marcin Andrychowicz, Dwight Crow, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems (NIPS), pp. 5055–5065, 2017.
+
+Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
+
+Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Proceedings of the International Conference on Machine Learning (ICML), pp. 1019–1028, 2017.
+
+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 International Conference on Machine Learning (ICML), pp. 1406–1415, 2018.
+
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the International Conference on Machine Learning (ICML), pp. 1126–1135, 2017.
+
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 249–256, 2010.
+
+Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. In Proceedings of the AAAI Conference on Artificial Intelligence, 2018.
+
+Jeremy Howard and Sebastian Ruder. Fine-tuned language models for text classification. CoRR, abs/1801.06146, 2018.
+
+Niels Justesen, Ruben Rodriguez Torrado, Philip Bontrager, Ahmed Khalifa, Julian Togelius, and Sebastian Risi. Procedural level generation improves generality of deep reinforcement learning. CoRR, abs/1806.10729, 2018.
+
+James Kirkpatrick, Razvan Pascanu, Neil C. 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. CoRR, abs/1612.00796, 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.
+
+Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3431–3440, 2015.
+
+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. Journal of Artificial Intelligence Research, 61:523–562, 2018.
+
+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.
+
+Lili Mou, Zhao Meng, Rui Yan, Ge Li, Yan Xu, Lu Zhang, and Zhi Jin. How transferable are neural networks in NLP applications? In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 479–489, 2016.
+
+Alex Nichol, Vicki Pfau, Christopher Hesse, Oleg Klimov, and John Schulman. Gotta learn fast: A new benchmark for generalization in RL. CoRR, abs/1804.03720, 2018.
+
+Emilio Parisotto, Lei Jimmy Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2016.
+
+Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. CNN features offthe-shelf: An astounding baseline for recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pp. 512–519, 2014.
+
+Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. CoRR, abs/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 Proceedings of the International Conference on Machine Learning (ICML), pp. 4535–4544, 2018.
+
+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.
+
+Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
+
+Richard S. Sutton. Generalization in reinforcement learning: Successful examples using sparse coarse coding. In Advances in Neural Information Processing Systems (NIPS), pp. 1038–1044, 1995.
+
+Yee Whye Teh, Victor Bapst, Wojciech M. Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In Advances in Neural Information Processing Systems (NIPS), pp. 4499–4509, 2017.
+
+Christopher J. C. H. Watkins and Peter Dayan. Q-learning. Machine Learning, 8:279–292, 1992.
+
+Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in Neural Information Processing Systems (NIPS), pp. 3320–3328, 2014.
+
+Chiyuan Zhang, Oriol Vinyals, Rémi Munos, and Samy Bengio. A study on overfitting in deep reinforcement learning. CoRR, abs/1804.06893, 2018.
+
+# A GAME MODES
+
+FREEWAY
+
+
+
+In FREEWAY a chicken must cross a road containing multiple lanes of moving traffic within a prespecified time limit. In all modes of FREEWAY, the agent gets rewarded for reaching the top of the screen and is subsequently teleported to the bottom of the screen. If the chicken collides with a vehicle in difficulty 0 it gets bumped down one lane of traffic, alternatively, in difficulty 1 the chicken gets teleported to its starting position on the bottom of the screen. Mode 1 changes some vehicle sprites to include buses, adds more vehicles to some lanes, and increases the velocity of all vehicles. Mode 4 is almost identical to Mode 1; the only difference being vehicles can oscillate between two speeds.
+
+HERO
+
+
+
+In HERO you control a character who must navigate a maze in order to save a trapped miner within a cave system. The agent scores points for any forward progression such as clearing an obstacle or killing an enemy. Once the miner is rescued, the level is terminated and you continue to the next level with a different maze. Some levels have partially observable rooms, more enemies, and more difficult obstacles to traverse. Past the default mode, each subsequent mode starts off at increasingly harder levels denoted by a level number increasing by multiples of 5. The default mode starts you off at level 1, mode 1 starts at level 5, and so on.
+
+# BREAKOUT
+
+
+(a) BREAKOUT m0d0
+
+
+(b) BREAKOUT m12d0
+
+In BREAKOUT you control a paddle which can move horizontally along the bottom of the screen. At the beginning of the game, or on loss of life a ball is set into motion and can bounce off the paddle and collide with bricks at the top of the screen. The objective of the game is to break all the bricks without having the ball fall below your paddles horizontal plane. Subsequently, mode 12 of breakout hides the bricks from the player until the ball collides with the bricks in which case the bricks flash for a brief moment before disappearing again.
+
+
+
+# SPACE INVADERS
+
+When playing SPACE INVADERS you control a spaceship which can move horizontally along the bottom of the screen. There is a grid of aliens which are above you and the objective of the game is to shoot-out all aliens. You are afforded some protection from the alien bullets with three barriers just above the spaceship. Difficulty 1 of space invaders widens your spaceships sprite making it harder to doge enemy bullets. Mode 1 of SPACE INVADERS causes the shields above you to oscillate horizontally. Mode 9 of SPACE INVADERS is similar to Mode 12 of BREAKOUT where the aliens are partially observable until struck with the players bullet.
+
+# B BASELINE RESULTS
+
+In all experiments performed in this paper we utilize the neural network architecture used by Mnih et al. (2015). That is, a convolutional neural network with three convolutional layers and two fully connected layers. A visualization of this network can be found in Figure 8. Hyperparametes are generally kept consistent with Machado et al. (2018). Below we provide a table of the key hyperparameters used in the baseline experiments.
+
+# NEURAL NETWORK ARCHITECTURE
+
+
+Figure 8: Neural network architecture used by DQN to predict state-action values.
+
+# HYPERPARAMETERS
+
+Learning rate $\alpha$
+Minibatch size
+Dropout rate convolutions
+Dropout rate fully connected
+Regularization term $\lambda$
+
+0.00025
+32
+0.05
+0.1
+0.0001
+Replay buffer size 1, 000, 000
+Target update frequency 4
+ϵ decay horizon 1M frames
+$\epsilon$ initial 1.0
+ϵ final 0.01
+Discount factor $\gamma$ 0.99
+
+# EVALUATION
+
+Each baseline run is trained for up to 100M frames in each game flavour. We decay epsilon linearly over the $\epsilon$ -decay period to allow for an exploratory period at the beginning of training. We use sticky-actions with a probability of $p = 0 . 2 5$ of executing $A _ { t - 1 }$ instead of action $A _ { t }$ (Machado et al., 2018). We allow the agent access to all 18 primitive actions in the ALE, we do not utilize the reduced action set nor the lives signal.
+
+Furthermore, as a crude measure for environment complexity, we measure the best greedy action an agent could take in a game flavour. Simply put, we iterate through every action in $\mathcal A$ , executing this action $\epsilon$ -greeidly, with $\epsilon = 0 . 0 1$ , at every time step for 100 episodes. These results were then averaged over 5 runs with the standard deviations between runs reported in parenthesis.
+
+Table 5: Baselines using vanilla DQN for all tested game variants.
+
+
GAME VARIANT
10M
50M
100M
BEST ACTION
PAAAIAA
m0d0
3.0
(1.0)
31.4
(0.2)
32.1
(0.1)
23.0
(1.4)
m1d0
0.0
(0.1)
4.8
(9.3)
7.5
(11.5)
5.0
(1.5)
m1d1
0.0
(0.0)
0.0
(0.0)
2.5
(7.3)
4.2
(1.3)
m4d0
4.4
(1.4)
29.9
(0.7)
32.8
(0.2)
7.5
(2.8)
HREH
m0d0
3187.8
(78.3)
9034.4
(1610.9)
13961.0
(181.9)
150.0
(0.0)
m1d0
326.9
(40.3)
1425.2
(1755.1)
5026.8
(2174.6)
75.8
(7.5)
m2d0
116.3
(11.0)
326.1
(130.4)
323.5
(76.4)
12.0
(27.5)
BHARAIRI
m0d0
17.5
(2.0)
72.5
(7.7)
73.4
(13.5)
2.3
(1.3)
m12d0
17.7
(1.3)
67.6
(32.4)
55.2
(37.2)
1.8
(1.1)
SSIAAAII IIISSS
m0d0
250.3
(16.2)
698.8
(32.2)
927.1
m1d0
203.6
753.6
979.7
(85.3)
243.6
(95.9)
m1d1
(24.3)
698.5
(31.6)
(39.8)
192.6
(65.7)
193.6
(11.0)
(31.3)
906.9
(56.5)
180.9
(101.9)
m9d0
173.0
(17.8)
518.0
(16.7)
567.7
(40.1)
174.6
(65.9)
+
+Table 6: Baselines using dropout $+ \ell _ { 2 }$ regularization for each default flavour.
+
+
GAME VARIANT
10M
50M
100M
BEST ACTION
FREEWAY
m0d0
4.6
(5.0)
25.9
(0.6)
29.0
(0.8)
23.0
(1.4)
HERO
m0d0
2466.5
(630.8)
6505.9
(1843.0)
12446.9
(397.4)
150.0
(0.0)
BREAKOUT
m0d0
6.1
(2.7)
34.1
(1.8)
66.4
(3.6)
2.3
(1.3)
SPACE INVADERS
m0d0
214.6
(13.8)
623.1
(16.3)
617.4
(29.6)
243.6
(95.9)
+
+
GAME VARIANT
BASELINE
BASELINEW/REGULARIZATION
10M
50M
100M
10M
50M
100M
FREEWAY
m0d0
3.0
(1.0)
31.4
(0.2)
32.1
(0.1)
4.6(5.0)
25.9
(0.6)
29.0
(0.8)
HERO
m0do
3187.8
(78.3)
9034.4
(1610.9)
13961.0
(181.9)
2466.5
(630.8)
6505.9
(1843.0)
12446.9
(397.4)
BREAKOUT
m0do
17.5
(2.0)
72.5
(7.7)
73.4
(13.5)
6.1
(2.7)
34.1
(1.8)
66.4
(3.6)
SPACE INVADERS
m0do
250.3
(16.2)
698.8
(32.2)
927.1
(85.3)
214.6
(13.8)
623.1
(16.3)
617.4
(29.6)
+
+Table 7: Comparison of baseline results with and without regularization in the default flavour. The baseline agent with regularization was trained with dropout and $\ell _ { 2 }$ regularization.
+
+# C POLICY EVALUATION LEARNING CURVES
+
+We provide learning curves for evaluating a policy learned in the default flavour $( \mathrm { m o d 0 } )$ to each subsequent flavour of that game. Each subplot are the results of evaluating the policy from a representation trained with and without regularization.
+
+# EVALUATION
+
+Checkpoint of the network weights $\theta$ were taken during training every 500, 000 frames, up to 50M frames in total. Each checkpoint was then evaluated in the target mode for 100 episodes averaged over five runs. Hyperparameters are kept consistent with the baseline experiments in Appendix B.
+
+
+Figure 9: Performance curves for policy evaluation results. The $\mathbf { X }$ -axis is the number of frames before we evaluated the $\epsilon$ -greedy policy from the default flavour on the target flavour. The y-axis is the cumulative reward the agent incurred.
\ No newline at end of file
diff --git a/md/train/Hkfmn5n6W/Hkfmn5n6W.md b/md/train/Hkfmn5n6W/Hkfmn5n6W.md
new file mode 100644
index 0000000000000000000000000000000000000000..b7200efa391090fb256ff579a59697e30d00db78
--- /dev/null
+++ b/md/train/Hkfmn5n6W/Hkfmn5n6W.md
@@ -0,0 +1,1442 @@
+# EXPONENTIALLY VANISHING SUB-OPTIMAL LOCAL MINIMA IN MULTILAYER NEURAL NETWORKS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Background: Statistical mechanics results (Dauphin et al. (2014); Choromanska et al. (2015)) suggest that local minima with high error are exponentially rare in high dimensions. However, to prove low error guarantees for Multilayer Neural Networks (MNNs), previous works so far required either a heavily modified MNN model or training method, strong assumptions on the labels (e.g., “near” linear separability), or an unrealistically wide hidden layer with $\Omega \left( N \right)$ units.
+
+Results: We examine a MNN with one hidden layer of piecewise linear units, a single output, and a quadratic loss. We prove that, with high probability in the limit of $N \to \infty$ datapoints, the volume of differentiable regions of the empiric loss containing sub-optimal differentiable local minima is exponentially vanishing in comparison with the same volume of global minima, given standard normal input of dimension $d _ { 0 } = \tilde { \Omega } \left( \sqrt { N } \right)$ , and a more realistic number of $d _ { 1 } = \tilde { \Omega } \left( N / d _ { 0 } \right)$ hidden units. We demonstrate our results numerically: for example, $0 \%$ binary classification training error on CIFAR with only $N / d _ { 0 } \approx 1 6$ hidden neurons.
+
+# 1 INTRODUCTION
+
+Motivation. Multilayer Neural Networks (MNNs), trained with simple variants of stochastic gradient descent (SGD), have achieved state-of-the-art performances in many areas of machine learning (LeCun et al., 2015). However, theoretical explanations seem to lag far behind this empirical success (though many hardness results exist, e.g., (Síma, 2002; Shamir, 2016)). For example, as a common rule-of-the-thumb, a MNN should have at least as many parameters as training samples. However, it is unclear why such over-parameterized MNNs often exhibit remarkably small generalization error (i.e., difference between “training error” and “test error”), even without explicit regularization (Zhang et al., 2017a).
+
+Moreover, it has long been a mystery why MNNs often achieve low training error (Dauphin et al., 2014). SGD is only guaranteed to converge to critical points in which the gradient of the expected loss is zero (Bottou, 1998), and, specifically, to local minima (Pemantle, 1990) (this is true also for regular gradient descent (Lee et al., 2016)). Since loss functions parameterized by MNN weights are non-convex, it is unclear why does SGD often work well – rather than converging to sub-optimal local minima with high training error, which are known to exist (Fukumizu & Amari, 2000; Swirszcz et al., 2016). Understanding this behavior is especially relevant in important cases where SGD does get stuck (He et al., 2016) – where training error may be a bottleneck in further improving performance.
+
+Ideally, we would like to quantify the probability to converge to a local minimum as a function of the error at this minimum, where the probability is taken with the respect to the randomness of the initialization of the weights, the data and SGD. Specifically, we would like to know, under which conditions this probability is very small if the error is high, as was observed empirically (e.g., (Dauphin et al., 2014; Goodfellow et al., 2015)). However, this seems to be a daunting task for realistic MNNs, since it requires a characterization of the sizes and distributions of the basins of attraction for all local minima.
+
+Previous works (Dauphin et al., 2014; Choromanska et al., 2015), based on statistical physics analogies, suggested a simpler property of MNNs: that with high probability, local minima with high error diminish exponentially with the number of parameters. Though proving such a geometric property with realistic assumptions would not guarantee convergence to global minima, it appears to be a necessary first step in this direction (see discussion on section 6). It was therefore pointed out as an open problem at the Conference of Learning Theory (COLT) 2015. However, one has to be careful and use realistic MMN architectures, or this problem becomes “too easy”.
+
+For example, one can easily achieve zero training error (Nilsson, 1965; Baum, 1988) – if the MNN’s last hidden layer has more neurons than training samples. Such extremely wide MNNs are easy to optimize (Yu, 1992; Huang et al., 2006; Livni et al., 2014; Haeffele & Vidal, 2015; Shen, 2016; Nguyen & Hein, 2017). In this case, the hidden layer becomes linearly separable in classification tasks, with high probability over the random initialization of the weights. Thus, by training the last layer we get to a global minimum (zero training error). However, such extremely wide layers are not very useful, since they result in a huge number of weights, and serious overfitting issues. Also, training only the last layer seems to take little advantage of the inherently non-linear nature of MNNs.
+
+Therefore, in this paper we are interested to understand the properties of local and global minima, but at a more practical number of parameters – and when at least two weight layers are trained. For example, Alexnet (Krizhevsky, 2014) is trained using about 1.2 million ImageNet examples, and has about 60 million parameters – 16 million of these in the two last weight layers. Suppose we now train the last two weight layers in such an over-parameterized MNN. When do the sub-optimal local minima become exponentially rare in comparison to the global minima?
+
+Main contributions. We focus on MNNs with a single hidden layer and piecewise linear units, optimized using the Mean Square Error (MSE) in a supervised binary classification task (Section 2). We define $N$ as the number of training samples, $d _ { l }$ as the width of the $l$ -th activation layer, and $g \left( x \right) \dot { < } h \left( x \right)$ as an asymptotic inequality in the leading order (formally: $\begin{array} { r } { \operatorname* { l i m } _ { x \infty } \frac { \log g ( x ) } { \log h ( x ) } < 1 ) } \end{array}$ . We examine Differentiable Local Minima (DLMs) of the MSE: sub-optimal DLMs where at least a fraction of $\epsilon > 0$ of the training samples are classified incorrectly, and global minima where all samples are classified correctly.
+
+Our main result, Theorem 10, states that, with high probability, the total volume of the differentiable regions of the MSE containing sub-optimal DLMs is exponentially vanishing in comparison to the same volume of global minima, given that:
+
+Assumption 1. The datapoints (MNN inputs) are sampled from a standard normal distribution.
+
+Assumption 2. $N \to \infty$ , $d _ { 0 } \left( N \right)$ and $d _ { 1 } \left( N \right)$ increase with $N$ , while $\epsilon \in ( 0 , 1 )$ is a constant1.
+
+Assumption 3. The input dimension scales as $\sqrt { N } \dot { < } d _ { 0 } \dot { \le } N$ .
+
+Assumption 4. The hidden layer width scales as
+
+$$
+\frac { N \log ^ { 4 } N } { d _ { 0 } } \dot { < } d _ { 1 } \dot { < } N .
+$$
+
+Importantly, we use a standard, unmodified, MNN model, and make no assumptions on the target function. Moreover, as the number of parameters in the MNN is approximately $d _ { 0 } d _ { 1 }$ , we require only “asymptotically mild” over-parameterization: $d _ { 0 } d _ { 1 } { \dot { > } } N \log ^ { 4 } N$ from eq. (1.1). For example, if $d _ { 0 } \propto N$ , we only require $d _ { 1 } \dot { > } \log ^ { 4 } N$ neurons. This improves over previously known results (Yu, 1992; Huang et al., 2006; Livni et al., 2014; Shen, 2016; Nguyen & Hein, 2017) – which require an extremely wide hidden layer with $d _ { 1 } \geq N$ neurons (and thus $N d _ { 0 }$ parameters) to remove sub-optimal local minima with high probability.
+
+In section 5 we validate our results numerically. We show that indeed the training error becomes low when the number of parameters is close to $N$ . For example, with binary classification on CIFAR and ImageNet, with only 16 and 105 hidden neurons (about $N / d _ { 0 }$ ), respectively, we obtain less then $0 . 1 \%$ training error. Additionally, we find that convergence to non-differentiable critical points does not appear to be very common.
+
+Lastly, in section 6 we discuss our results might be extended, such as how to apply them to “mildly” non-differentiable critical points.
+
+Plausibility of assumptions. Assumption 1 is common in this type of analysis (Andoni et al., 2014; Choromanska et al., 2015; Xie et al., 2016; Tian, 2017; Brutzkus & Globerson, 2017). At first it may appear rather unrealistic, especially since the inputs are correlated in typical datasets. However, this no-correlation part of the assumption may seem more justified if we recall that datasets are many times whitened before being used as inputs. Alternatively, if, as in our motivating question, we consider the input to the our simple MNN to be the output of the previous layers of a deep MNN with fixed random weights, this also tends to de-correlate inputs (Poole et al., 2016, Figure 3). The remaining part of assumption 1, that the distribution is normal, is indeed strong, but might be relaxed in the future, e.g. using central limit theorem type arguments.
+
+In assumption 2 we use this asymptotic limit to simplify our proofs and final results. Multiplicative constants and finite (yet large) $N$ results can be found by inspection of the proofs. We assume a constant error $\epsilon$ since typically the limit $\epsilon 0$ is avoided to prevent overfitting.
+
+In assumption 3, for simplicity we have $d _ { 0 } { \dot { \le } } N$ , since in the case $d _ { 0 } \geq N$ the input is generically linearly separable, and sub-optimal local minima are not a problem (Gori & Tesi, 1992; Safran & Shamir, 2016). Additionally, we have $\sqrt { N } \dot { < } d _ { 0 }$ , which seems very reasonable, since for example, $d _ { 0 } / N \approx 0 . 0 1 6 , 0 . 0$ 61 and 0.055 MNIST, CIFAR and ImageNet, respectively.
+
+In assumption 4, for simplicity we have $d _ { 1 } \dot { < } N$ , since, as mentioned earlier, if $d _ { 1 } \geq N$ the hidden layer is linearly separable with high probability, which removes sub-optimal local minima. The other bound $N \log ^ { 4 } N { \dot { < } } d _ { 0 } d _ { 1 }$ is our main innovation – a large over-parameterization which is nevertheless asymptotically mild and improves previous results.
+
+Previous work. So far, general low (training or test) error guarantees for MNNs could not be found – unless the underlying model (MNN) or learning method (SGD or its variants) have been significantly modified. For example, (Dauphin et al., 2014) made an analogy with high-dimensional random Gaussian functions, local minima with high error are exponentially rare in high dimensions; (Choromanska et al., 2015; Kawaguchi, 2016) replaced the units (activation functions) with independent random variables; (Pennington & Bahri, 2017) replaces the weights and error residuals with independent random variables; (Baldi, 1989; Saxe et al., 2014; Hardt & Ma, 2017; Lu & Kawaguchi, 2017; Zhou & Feng, 2017) used linear units; (Zhang et al., 2017b) used unconventional units (e.g., polynomials) and very large hidden layers $( d _ { 1 } = \mathrm { p o l y } \left( d _ { 0 } \right)$ , typically $\gg N$ ); (Brutzkus & Globerson, 2017; Du et al., 2017; Shalev-Shwartz et al., 2017) used a modified convnet model with less then $d _ { 0 }$ parameters (therefore, not a universal approximator (Cybenko, 1989; Hornik, 1991)); (Tian, 2017; Soltanolkotabi et al., 2017; Li & Yuan, 2017) assume the weights are initialized very close to those of the teacher generating the labels; and (Janzamin et al., 2015; Zhong et al., 2017) use a non-standard tensor method during training. Such approaches fall short of explaining the widespread success of standard MNN models and training practices.
+
+Other works placed strong assumptions on the target functions. For example, to prove convergence of the training error near the global minimum, (Gori & Tesi, 1992) assumed linearly separable datasets, while (Safran & Shamir, 2016) assumed strong clustering of the targets (“near” linear-separability). Also, (Andoni et al., 2014) showed a $p$ -degree polynomial is learnable by a MNN, if the hidden layer is very large $( d _ { 1 } = \Omega \left( d _ { 0 } ^ { 6 p } \right)$ , typically $\gg N$ ) so learning the last weight layer is sufficient. However, these are not the typical regimes in which MNNs are required or used. In contrast, we make no assumption on the target function. Other closely related results (Soudry & Carmon, 2016; Xie et al., 2016) also used unrealistic assumptions, are discussed in section 6, in regards to the details of our main results.
+
+Therefore, in contrast to previous works, the assumptions in this paper are applicable in some situations (e.g., Gaussian input) where a MNN trained using SGD might be used and be useful (e.g., have a lower test error then a linear classier).
+
+# 2 PRELIMINARIES AND NOTATION
+
+Model. We examine a Multilayer Neural Network (MNN) with a single hidden layer and a scalar output. The MNN is trained on a finite training set of $N$ datapoints (features) $\textbf { X } \triangleq$ $\left[ \mathbf { x } ^ { ( 1 ) } , \ldots , \mathbf { x } ^ { ( N ) } \right] \ \in \ \mathbb { R } ^ { d _ { 0 } \times N }$ with their target labels $\mathbf { y } \ \triangleq \ \left[ y ^ { ( 1 ) } , \ldots , y ^ { ( N ) } \right] ^ { \intercal } \ \in \ \left\{ 0 , 1 \right\} ^ { N } -$ each datapoint-label pair $\left( \mathbf { x } ^ { ( n ) } , y ^ { ( n ) } \right)$ is independently sampled from some joint distribution $\mathbb { P } _ { X , Y }$ . We define $\mathbf { W } = \left[ \mathbf { w } _ { 1 } , \ldots , \mathbf { w } _ { d _ { 1 } } \right] ^ { \top } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ and $\mathbf { z } \in \mathbb { R } ^ { d _ { 1 } }$ as the first and second weight layers (bias terms are ignored for simplicity), respectively, and $f \left( \cdot \right)$ as the common leaky rectifier linear unit (LReLU (Maas et al., 2013))
+
+$$
+\begin{array} { r } { f \left( u \right) \triangleq u a \left( u \right) \mathrm { ~ w i t h ~ } a \left( u \right) \triangleq \left\{ \begin{array} { l l } { 1 } & { \mathrm { , ~ i f ~ } , u > 0 } \\ { \rho } & { \mathrm { , ~ i f ~ } u < 0 } \end{array} \right. , } \end{array}
+$$
+
+for some $\rho \neq 1$ (so the MNN is non-linear) , where both functions $f$ and $a$ operate component-wise (e.g., for any matrix M: $\left( f \left( \mathbf { M } \right) \right) _ { i j } = f \left( M _ { i j } \right) )$ . Thus, the output of the MNN on the entire dataset can be written as
+
+$$
+{ f } \left( { { \mathbf { W } } { \mathbf { X } } } \right) ^ { \top } { \mathbf { z } } \in \mathbb { R } ^ { N } .
+$$
+
+We use the mean square error (MSE) loss for optimization
+
+$$
+\operatorname { M S E } \triangleq \frac { 1 } { N } \left. \mathbf { e } \right. ^ { 2 } \mathrm { w i t h } \mathbf { e } \triangleq \mathbf { y } - f \left( \mathbf { W } \mathbf { X } \right) ^ { \top } \mathbf { z } ,
+$$
+
+where $\lVert \cdot \rVert$ is the standard euclidean norm. Also, we measure the empiric performance as the fraction of samples that are classified correctly using a decision threshold at $y = 0 . 5$ , and denote this as the mean classification error, or $\mathbf { M C E } ^ { 2 }$ . Note that the variables $\mathbf { e }$ , MSE, MCE and other related variables (e.g., their derivatives) all depend on $\mathbf { W } , \mathbf { z } , \mathbf { X } , \mathbf { y }$ and $\rho$ , but we keep this dependency implicit, to avoid cumbersome notation.
+
+Additional Notation. We define g (x) \epsilon > 0$ . We would like to compare the angular volume (definition 3) corresponding to both types of DLMs. Thus, we make the following definitions.
+
+Definition 4. We define3 $\mathcal { L } _ { \epsilon } \subset \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ as the union of differentiable regions containing sub-optimal DLMs with $\mathrm { M C E } > \epsilon$ , and $\mathcal { G } \subset \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ as the union of differentiable regions containing global minima with $\mathrm { M C E } = 0$ .
+
+Definition 5. We define the constant $\gamma _ { \epsilon }$ as $\begin{array} { r } { \gamma _ { \epsilon } \triangleq 0 . 2 3 \operatorname* { m a x } \left[ \operatorname* { l i m } _ { N \to \infty } \left( d _ { 0 } \left( N \right) / N \right) , \epsilon \right] ^ { 3 / 4 } } \end{array}$ if $\rho \neq$ $\{ 0 , 1 \}$ , and $\gamma _ { \epsilon } \triangleq 0 . 2 3 \epsilon ^ { 3 / 4 }$ if $\rho = 0$ .
+
+In this section, we use assumptions 1-4 (stated in section 1) to bound the angular volume of the region $\mathcal { L } _ { \epsilon }$ encapsulating all sub-optimal DLMs, the region $\mathcal { G }$ , encapsulating all global minima, and the ratio between the two.
+
+Angular volume of sub-optimal DLMs. First, in appendix section 8 we prove the following upper bound in expectation
+
+Theorem 6. Given assumptions 1-4, the expected angular volume of sub-optimal DLMs, with $\mathrm { M C E } > \epsilon > 0$ , is exponentially vanishing in $N$ as
+
+$$
+\begin{array} { r } { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) . } \end{array}
+$$
+
+and, using Markov inequality, its immediate probabilistic corollary
+
+Corollary 7. Given assumptions $I$ -4, for any $\delta > 0$ (possibly a vanishing function of $N$ ), we have, with probability $1 - \delta$ , that the angular volume of sub-optimal DLMs, with $\mathrm { M C E } > \epsilon > 0 ,$ , is exponentially vanishing in $N$ as
+
+$$
+{ \mathcal { V } } \left( { \mathcal { L } } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \leq } \frac { 1 } { \delta } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right)
+$$
+
+Proof idea of Theorem 6: we first show that in differentiable regions with $\mathrm { M C E } > \epsilon > 0$ , the condition in Lemma 2, $\left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0$ , implies that $\mathbf { A } = a \left( \mathbf { W } \mathbf { X } \right)$ must have a low rank. Then, we show that, when $\mathbf { X } \sim { \mathcal { N } }$ and $\mathbf { W } \sim { \mathcal { N } }$ , the matrix $\mathbf { A } = a \left( \mathbf { W } \mathbf { X } \right)$ has a low rank with exponentially low probability. Combining both facts, we obtain the bound.
+
+Existence of global minima. Next, to compare the volume of sub-optimal DLMs with that of global minima, in appendix section 9 we show first that, generically, global minima do exist (using a variant of the proof of (Baum, 1988, Theorem 1)):
+
+Theorem 8. For any $\mathbf { y } \in \{ 0 , 1 \} ^ { N }$ and $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ almost everywhere4 we find matrices $\mathbf { W } ^ { * } \in$ $\mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ and $\mathbf { z } ^ { * } \in \mathbb { R } ^ { d _ { 1 } ^ { * } }$ , such that $\mathbf { y } = f \left( \mathbf { W } ^ { * } \mathbf { X } \right) ^ { \top } \mathbf { z } ^ { * }$ , where $d _ { 1 } ^ { * } \triangleq 4 \lceil N / ( 2 d _ { 0 } - 2 ) \rceil$ and $\forall i , n$ : $\mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \neq 0$ . Therefore, every MNN with $d _ { 1 } \geq d _ { 1 } ^ { * }$ has a DLM which achieves zero error $\mathbf { e } = 0$ .
+
+Recently (Zhang et al., 2017a, Theorem 1) similarly proved that a 2-layer MNN with approximately $2 N$ parameters can achieve zero error. However, that proof required $N$ neurons (similarly to (Nilsson, 1965; Baum, 1988; Yu, 1992; Huang et al., 2006; Livni et al., 2014; Shen, 2016)), while Theorem 8 here requires much less: approximately $d _ { 1 } ^ { * } \approx 2 N / d _ { 0 }$ . Also, (Hardt & Ma, 2017, Theorem 3.2) showed a deep residual network with $N \log N$ parameters can achieve zero error. In contrast, here we require just one hidden layer with $2 N$ parameters.
+
+Note the construction in Theorem 8 here achieves zero training error by overfitting to the data realization, so it is not expected to be a “good” solution in terms of generalization. To get good generalization, one needs to add additional assumptions on the data ( $\mathbf { X }$ and y). Such a possible (common yet insufficient for MNNs) assumption is that the problem is “realizable”, i.e., there exist a small “solution MNN”, which achieves low error. For example, in the zero error case:
+
+Assumption 5. (Optional) The labels are generated by some teacher $\mathbf { y } = f \left( \mathbf { W } ^ { * } \mathbf { X } \right) ^ { \top } \mathbf { z } ^ { * }$ with weight matrices $\mathbf { W } ^ { * } \in \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ and $\mathbf { z } ^ { * } \in \mathbb { R } ^ { d _ { 1 } ^ { * } }$ independent of $\mathbf { X }$ , for some $d _ { 1 } ^ { * } { \dot { < } } N / d _ { 0 }$ .
+
+This assumption is not required for our main result (Theorem 10) – it is merely helpful in improving the following lower bound on $\mathcal { V } \left( \mathcal { G } \right)$ .
+
+Angular volume of global minima. We prove in appendix section 10:
+
+Theorem 9. Given assumptions 1-3, we set $\delta { \doteq } \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } / N$ and $d _ { 1 } ^ { * } = 2 N / d _ { 0 }$ , or if assumption 5 holds, we set $d _ { 1 } ^ { * }$ as in this assumption. Then, with probability $1 - \delta$ , the angular volume of global minima is lower bounded as,
+
+$$
+\mathscr { V } \left( \mathscr { G } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { > } \exp \left( - d _ { 1 } ^ { * } d _ { 0 } \log N \right) \dot { \geq } \exp \left( - 2 N \log N \right) .
+$$
+
+Proof idea: First, we lower bound $\mathcal { V } \left( \mathcal { G } \right)$ with the angular volume of a single differentiable region of one global minimum $( \mathbf { W } ^ { * } , \mathbf { z } ^ { * } )$ – either from Theorem 8, or from assumption 5. Then we show that this angular volume is lower bounded when $\mathbf { W } \sim { \mathcal { N } }$ , given a certain angular margin between the datapoints in $\mathbf { X }$ and the rows of $\mathbf { W } ^ { * }$ . We then calculate the probability of obtaining this margin when $\mathbf { X } \sim { \mathcal { N } }$ . Combining both results, we obtain the final bound.
+
+Main result: angular volume ratio. Finally, combining Theorems 6 and 9 it is straightforward to prove our main result in this paper, as we do in appendix section 11:
+
+Theorem 10. Given assumptions 1-3, we set $\delta \doteq \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } / N$ . Then, with probability $1 - \delta$ , the angular volume of sub-optimal DLMs, with $\mathrm { M C E } > \epsilon > 0$ , is exponentially vanishing in $N _ { : }$ , in comparison to the angular volume of global minima with $\mathrm { M C E } = 0$
+
+$$
+\frac { \mathscr { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) } { \mathscr { V } \left( \mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \right) } \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) \dot { \leq } \exp \left( - \gamma _ { \epsilon } N \log N \right) .
+$$
+
+# 5 NUMERICAL EXPERIMENTS
+
+Theorem 10 implies that, with “asymptotically mild” over-parameterization (i.e. in which #parameters $\mathrm { = } \tilde { \Omega } \left( N \right) )$ , differentiable regions in weight space containing sub-optimal DLMs (with high MCE) are exponentially small in comparison with the same regions for global minima. Since these results are asymptotic in $N \infty$ , in this section we examine it numerically for a finite number of samples and parameters. We perform experiments on random data, MNIST, CIFAR10 and ImageNetILSVRC2012. In each experiment, we used ReLU activations $( \rho = 0 )$ ), a binary classification target (we divided the original classes to two groups), MSE loss for optimization (eq. (2.3)), and MCE to determine classification error. Additional implementation details are given in appendix part III.
+
+
+Figure 5.1: Gaussian data: final training error (mean±std, 30 repetitions) in the overparameterized regime is low (right of the dashed black line). We trained MNNs with one and two hiddens layer (with widths equal to $d = d _ { 0 }$ ) on a synthetic random dataset in which $\forall n = 1 , \ldots , N$ , $\mathbf { x } ^ { ( n ) }$ was drawn from a normal distribution $\mathcal { N } ( 0 , 1 )$ , and $y ^ { ( n ) } = \pm 1$ with probability 0.5.
+
+Table 1: Binary classification of MNIST, CIFAR and ImageNet: 1-hidden layer achieves very low training error (MCE) with a few hidden neurons, so that #parameters $\approx d _ { 0 } d _ { 1 } \approx N$ . In ImageNet we downsampled the images to allow input whitening.
+
+
MCE
do
d1
N
#parameters/N
MNIST
0%
784
89
7·104
0.999
CIFAR
0%
3072
16
5·104
0.983
ImageNet (downsampled to 64 × 64)
0.1%
12288
105
128·104
1.008
+
+First, on the small synthetic Gaussian random data (matching our assumptions) we perform a scan on various networks and dataset sizes. With either one or two hidden layers (Figure 5.1) , the error goes to zero when the number of non-redundant parameters (approximately $d _ { 0 } d _ { 1 } ,$ ) is greater than the number of samples, as suggested by our asymptotic results. Second, on the non-syntehtic datasets, MNIST, CIFAR and ImageNet (In ImageNet we downsampled the images to size $6 4 \times 6 4$ , to allow input whitening) we only perform a simulation with a single 1-hidden layer MNN for which #parameters $\approx N$ , and again find (Table 1) that the final error is zero (for MNIST and CIFAR) or very low (ImageNet).
+
+Lastly, in Figure 5.2 we find that, on the Gaussian dataset, the inputs to the hidden neurons converge to a distinctly non-zero value. This indicates we converged to differentiable critical points – since nondifferentiable critical points must have zero neural inputs. Note that occasionally, during optimization, we could find some neural inputs with very low values near numerical precision level, so convergence to non-differentiable minima may be possible. However, as explained in the next section, as long as the number of neural inputs equal to zero are not too large, our bounds also hold for these minima.
+
+# 6 DISCUSSION
+
+In this paper we examine Differentiable Local Minima (DLMs) of the empiric loss of Multilayer Neural Networks (MNNs) with one hidden layer, scalar output, and LReLU nonlinearities (section 2). We prove (Theorem 10) that with high probability the angular volume (definition 3) of sub-optimal DLMs is exponentially vanishing in comparison to the angular volume of global minima (definition 4), under assumptions 1-4. This results from an upper bound on sub-optimal DLMs (Theorem 6) and a lower bound on global minima (Theorem 9).
+
+
+Figure 5.2: Gaussian data: convergence of the MSE to differentiable critical points, as indicated by the convergence of the neural inputs to distinctly non-zero values. We trained MNNs with one hidden layer on the Gaussian dataset from Figure 5.1, with various widths $d = d _ { 0 } = d _ { 1 }$ and $N = \lfloor d ^ { 2 } / 5 \rfloor$ for 1000 epochs, then decreased the learning rate exponentially for another 1000 epochs. This was repeated 30 times. For all $d$ and repeats, we see that (left) the final absolute value of the minimal neural input $( i . e . , \operatorname* { m i n } _ { i , n } \left| \mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right| )$ in the range of $1 0 ^ { - 3 } - 1 0 ^ { 0 }$ , which is much larger then $( \mathrm { r } i g h t )$ the final MSE error for all $d$ and all repeats – in the range $1 0 ^ { - 3 1 } - 1 0 ^ { - 7 }$ .
+
+Convergence of SGD to DLMs. These results suggest a mechanism through which low training error is obtained in such MNNs. However, they do not guarantee it. One issue is that sub-optimal DLMs may have exponentially large basins of attraction. We see two possible paths that might address this issue in future work, using additional assumptions on y. One approach is to show that, with high probability, no sub optimal DLM falls within the vanishingly small differentiable regions we bounded in Theorem 6. Another approach would be to bound the size of these basins of attraction, by showing that sufficiently large of number of differentiable regions near the DLM are also vanishingly small (other methods might also help here (Freeman & Bruna, 2016)). Another issue is that SGD might get stuck near differentiable saddle points, if their Hessian does not have strictly negative eigenvalues (i.e., the strict saddle property (Sun et al., 2015)). It should be straightforward to show that such points also have exponentially vanishing angular volume, similar to sub-optimal DLMs. Lastly, SGD might also converge to non-differentiable critical points, which we discuss next.
+
+Non-differentiable critical points. The proof of Theorem 6 stems from a first order necessary condition (Lemma 2): $\left( \mathbf { A } \circ \mathbf { \bar { X } } \right) \mathbf { e } = 0$ , which is true for any DLM. However, non-differentiable critical points, in which some neural inputs are exactly zero, may also exist (though, numerically, they don’t seem very common – see Figure 5.2). In this case, to derive a similar bound, we can replace the condition with $\mathbf { P } \left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0$ , where $\mathbf { P }$ is a projection matrix to the subspace orthogonal to the non-differentiable directions. As long as there are not too many zero neural inputs, we should be able to obtain similar results. For example, if only a constant ratio $r$ of the neural inputs are zero, we can simply choose $\mathbf { P }$ to remove all rows of $( \mathbf { A } \circ \mathbf { X } )$ corresponding to those neurons, and proceed with exactly the same proof as before, with $d _ { 1 }$ replaced with $( 1 - r ) d _ { 1 }$ . It remains a theoretical challenge to find reasonable assumptions under which the number of non-differentiable directions (i.e., zero neural inputs) does not become too large.
+
+Related results. Two works have also derived related results using the $\left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0$ condition from Lemma 2. In (Soudry & Carmon, 2016), it was noticed that an infinitesimal perturbation of $\mathbf { A }$ makes the matrix $\mathbf { A } \circ \mathbf { X }$ full rank with probability 1 (Allman et al., 2009, Lemma 13) – which entails that $\mathbf { e } = 0$ at all DLMs. Though a simple and intuitive approach, such an infinitesimal perturbation is problematic: from continuity, it cannot change the original MSE at sub-optimal DLMs – unless the weights go to infinity, or the DLM becomes non-differentiable – which are both undesirable results. An extension of this analysis was also done to constrain e using the singular values of $\mathbf { A } \circ \mathbf { X }$ (Xie et al., 2016), deriving bounds that are easier to combine with generalization bounds. Though a promising approach, the size of the sub-optimal regions (where the error is high) does not vanish exponentially in the derived bounds. More importantly, these bounds require assumptions on the activation kernel spectrum $\gamma _ { m }$ , which do not appear to hold in practice (e.g., (Xie et al., 2016, Theorems 1,3) require $m \gamma _ { m } \gg 1$ to hold with high probability, while $m \gamma _ { m } < \bar { 1 0 } ^ { - 2 }$ in (Xie et al., 2016, Figure 1)).
+
+Modifications and extensions. There are many relatively simple extensions of these results: the Gaussian assumption could be relaxed to other near-isotropic distributions (e.g., sparse-land model, (Elad, 2010, Section 9.2)) and other convex loss functions are possible instead of the quadratic loss. More challenging directions are extending our results to MNNs with multi-output and multiple hidden layers, or combining our training error results with novel generalization bounds which might be better suited for MNNs (e.g., (Feng et al., 2016; Sokolic et al., 2016; Dziugaite & Roy, 2017)) than previous approaches (Zhang et al., 2017a).
+
+# REFERENCES
+
+models with many observed variables. Annals of Statistics, 37(6 A):3099–3132, 2009. ISSN 00905364. doi: 10.1214/09-AOS689. A Andoni, R Panigrahy, G Valiant, and L Zhang. Learning Polynomials with Neural Networks. In ICML, 2014. Pierre Baldi. Linear Learning: Landscapes and Algorithms. Advances in Neural Information Processing Systems 1, (1):65–72, 1989. Eric B. Baum. On the capabilities of multilayer perceptrons. Journal of Complexity, 4(3):193–215, 1988. ISSN 10902708. doi: 10.1016/0885-064X(88)90020-9. L Bottou. Online learning and stochastic approximations. In On-line learning in neural networks, pp. 9–42. 1998. ISBN 978-0521117913. Alon Brutzkus and Amir Globerson. Globally Optimal Gradient Descent for a ConvNet with Gaussian Inputs. arXiv, 2017. Ronald W. Butler. Saddlepoint Approximations with Applications. 2007. ISBN 9780511619083. doi: 10.1017/ CBO9780511619083. Yingtong Chen and Jigen Peng. Influences of preconditioning on the mutual coherence and the restricted isometry property of Gaussian/Bernoulli measurement matrices. Linear and Multilinear Algebra, 64(9): 1750–1759, 2016. ISSN 0308-1087. doi: 10.1080/03081087.2015.1116495. Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Y LeCun. The Loss Surfaces of Multilayer Networks. AISTATS15, 38, 2015. T M Cover. Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition. Electronic Computers, IEEE Transactions on, (3):326–334, 1965. G Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems (MCSS), 2:303–314, 1989. Yann Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. NIPS, pp. 1–9, 2014. ISSN 10495258. Simon S. Du, Jason D. Lee, and Yuandong Tian. When is a Convolutional Filter Easy To Learn? arXiv, sep 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, 2017. Michael Elad. Sparse and redundant representations: from theory to applications in signal and image processing. Springer New York, New York, NY, 2010. Jiashi Feng, Tom Zahavy, Bingyi Kang, Huan Xu, and Shie Mannor. Ensemble Robustness of Deep Learning Algorithms. ArXiv, feb 2016. C. Daniel Freeman and Joan Bruna. Topology and Geometry of Deep Rectified Network Optimization Landscapes. ArXiv: 1611.01540, 2016. K. Fukumizu and S. Amari. Local minima and plateaus in hierarchical structures of multilayer perceptrons. Neural Networks, 13:317–327, 2000. ISSN 08936080. doi: 10.1016/S0893-6080(00)00009-5. Ian J. Goodfellow, Oriol Vinyals, and Andrew M. Saxe. Qualitatively characterizing neural network optimization problems. In ICLR, 2015. Marco Gori and Alberto Tesi. On the problem of local minima in backpropagation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(1):76–86, 1992. ISSN 01628828. doi: 10.1109/34.107014. B D Haeffele and R Vidal. Global Optimality in Tensor Factorization, Deep Learning, and Beyond. ArXiv:1506.07540, (1):7, 2015. Moritz Hardt and Tengyu Ma. Identity Matters in Deep Learning. ICLR, pp. 1–19, 2017. K He, X Zhang, S Ren, and J. Sun. Deep Residual Learning for Image Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving Deep into Rectifiers: Surpassing HumanLevel Performance on ImageNet Classification. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1026–1034, 2015. ISBN 978-1-4673-8391-2. doi: 10.1109/ICCV.2015.123. K Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4(1989):251–257, 1991. Guang-Bin Huang, Qin-Yu Zhu, and Chee-Kheong Siew. Extreme learning machine: Theory and applications. Neurocomputing, 70(1-3):489–501, 2006. ISSN 09252312. doi: 10.1016/j.neucom.2005.12.126. M Janzamin, H Sedghi, and A Anandkumar. Beating the Perils of Non-Convexity: Guaranteed Training of Neural Networks using Tensor Methods. ArXiv:1506.08473, pp. 1–25, 2015. Kenji Kawaguchi. Deep Learning without Poor Local Minima. In NIPS, 2016. Diederik P Kingma and Jimmy Lei Ba. Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980, pp. 1–13, 2014. Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv:1404.5997, 2014.
+
+Y LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. ISSN 0028-0836. doi: 10.1038/nature14539.
+Jason D. Lee, Max Simchowitz, Michael I. Jordan, and Benjamin Recht. Gradient Descent Converges to Minimizers. Conference on Learning Theory, 2016.
+Yuanzhi Li and Yang Yuan. Convergence Analysis of Two-layer Neural Networks with ReLU Activation. arXiv, may 2017.
+Roi Livni, S Shalev-Shwartz, and Ohad Shamir. On the Computational Efficiency of Training Neural Networks. NIPS, 2014.
+Haihao Lu and Kenji Kawaguchi. Depth Creates No Bad Local Minima. ArXiv, (2014):1–9, 2017.
+Andrew L. Maas, Awni Y. Hannun, and Andrew Y. Ng. Rectifier nonlinearities improve neural network acoustic models. In ICML Workshop on Deep Learning for Audio, Speech, and Language Processing, pp. 6, 2013.
+Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. Arxiv, 2017.
+Nils J. Nilsson. Learning machines. McGraw-Hill New York, 1965.
+R Pemantle. Nonconvergence to unstable points in urn models and stochastic approximations. The Annals of Probability, 18(2):698–712, 1990.
+Jeffrey Pennington and Yasaman Bahri. Geometry of Neural Network Loss Surfaces via Random Matrix Theory. Proceedings of the 34th International Conference on Machine Learning, 70:2798–2806, 2017. ISSN 1938-7228.
+Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In NIPS, 2016.
+Mark Rudelson and Roman Vershynin. Non-asymptotic Theory of Random Matrices: Extreme Singular Values. Proceedings of the International Congress of Mathematicians, pp. 1576–1602, 2010. doi: 10.1142/ 9789814324359_0111.
+Itay Safran and Ohad Shamir. On the Quality of the Initial Basin in Overspecified Neural Networks. In ICML, 2016.
+A M Saxe, J L. McClelland, and S Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. ICLR, 2014.
+Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Weight Sharing is Crucial to Succesful Optimization. jun 2017.
+Ohad Shamir. Distribution Specific Hardness of Learning Neural Networks. arXiv preprint arXiv:1609.01037, pp. 1–26, 2016.
+Hao Shen. Designing and Training Feedforward Neural Networks: A Smooth Optimisation Perspective. ArXiv, (i):1–19, 2016.
+Jirí Síma. Training a single sigmoidal neuron is hard. Neural computation, 14(11):2709–28, 2002. ISSN 0899-7667. doi: 10.1162/089976602760408035.
+D Slepian. The One Sided Problem for Gaussian Noise. Bell System Technical Journal, 1962.
+Jure Sokolic, Raja Giryes, Guillermo Sapiro, and Miguel R. D. Rodrigues. Robust Large Margin Deep Neural Networks, 2016.
+Mahdi Soltanolkotabi, Adel Javanmard, and Jason D. Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv, jul 2017.
+D. Soudry and Y Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. In arXiv:1605.08361, 2016.
+Ju Sun, Qing Qu, and John Wright. When Are Nonconvex Problems Not Scary? arXiv:1510.06096 [cs, math, stat], pp. 1–6, 2015.
+Grzegorz Swirszcz, Wojciech Marian Czarnecki, and Razvan Pascanu. Local minima in training of deep networks. arXiv:1611.06310, pp. 1–13, 2016.
+Yuandong Tian. Symmetry-Breaking Convergence Analysis of Certain Two-layered Neural Networks with ReLU nonlinearity. Submitted to ICLR, 2017.
+L. Welch. Lower bounds on the maximum cross correlation of signals. IEEE Transactions on Information Theory, 20(3):397–399, may 1974. ISSN 0018-9448. doi: 10.1109/TIT.1974.1055219.
+Bo Xie, Yingyu Liang, and Le Song. Diversity Leads to Generalization in Neural Networks. pp. 1–23, 2016.
+Xiao Hu Yu. Can Backpropagation Error Surface Not Have Local Minima. IEEE Transactions on Neural Networks, 3(6):1019–1021, 1992. ISSN 19410093. doi: 10.1109/72.165604.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017a.
+Qiuyi Zhang, Rina Panigrahy, Sushant Sachdeva, and Ali Rahimi. Electron-Proton Dynamics in Deep Learning. arXiv:1702.00458, pp. 1–31, 2017b.
+Kai Zhong, Ut-Austin Zhao Song, Prateek Jain, Peter L. Bartlett, and Inderjit S. Dhillon. Recovery Guarantees for One-hidden-layer Neural Networks. ICML, jun 2017.
+Pan Zhou and Jiashi Feng. The Landscape of Deep Learning Algorithms. may 2017.
+
+# Supplementary information - Appendix
+
+The appendix is divided into three parts. In part I we prove all the main theorems mentioned in the paper. Some of these rely on other technical results, which we prove later in part II. Lastly, in part III we give additional numerical details and results. First, however, we define additional notation (some already defined in the main paper) and mention some known results, which we will use in our proofs.
+
+# EXTENDED PRELIMINARIES
+
+• The indicator function ${ \mathcal { T } } \left( { \mathcal { A } } \right) \triangleq { \left\{ \begin{array} { l l } { 1 } & { , { \mathrm { i f } } \ A } \\ { 0 } & { , { \mathrm { e l s e } } } \end{array} \right. }$ , for any event $\mathcal { A }$ .
+• Kronecker’s delta $\delta _ { i j } \triangleq { \mathcal { T } } ( i = j )$ .
+• The Matrix $\mathbf { I } _ { d }$ as the identity matrix in $\mathbb { R } ^ { d \times d }$ , and $\mathbf { I } _ { d \times k }$ is the relevant $\mathbb { R } ^ { d \times k }$ upper left sub-matrix of the identity matrix.
+• $[ L ] \triangleq \{ 1 , 2 , \dots , L \}$
+The vector ${ \bf m } _ { n }$ as the $n$ ’th column of a matrix $\mathbf { M }$ , unless defined otherwise (then ${ \bf m } _ { n }$ will be a row of $\mathbf { M }$ ).
+• $\mathbf M > 0$ implies that $\forall i , j : M _ { i j } > 0$ .
+• $\mathbf { M } _ { S }$ is the matrix composed of the columns of $\mathbf { M }$ that are in the index set $S$ .
+• A property holds “M-almost everywhere” (a.e. for short), if the set of entries of $\mathbf { M }$ for which the property does not hold has zero measure (Lebesgue).
+• $\begin{array} { r } { \| \mathbf { v } \| _ { 0 } = \sum _ { i = 1 } ^ { d } \mathcal { T } \left( v _ { i } > 0 \right) } \end{array}$ is the $L _ { 0 }$ “norm” that counts the number of non-zero values in $\mathbf { v } \in \mathbb { R } ^ { d }$ .
+• If $\mathbf { x } \sim \mathcal { N } ( \pmb { \mu } , \pmb { \Sigma } )$ the $\mathbf { x }$ is random Gaussian vector.
+• $\begin{array} { r } { \phi \left( x \right) \triangleq \frac { 1 } { \sqrt { 2 \pi } } \exp \left( - \frac { 1 } { 2 } x ^ { 2 } \right) } \end{array}$ as the univariate Gaussian probability density function. • $\textstyle \Phi \left( x \right) \triangleq \int _ { - \infty } ^ { x } \phi \left( u \right) d u$ as the Gaussian cumulative distribution function.
+• $B \left( x , y \right)$ as the beta function.
+
+Lastly, we recall the well known Markov Inequality:
+
+Fact 11. (Markov Inequality) For any random variable $X \geq 0$ , we have $\forall \eta > 0$
+
+$$
+\mathbb { P } \left( X \geq \eta \right) \leq \frac { \mathbb { E } X } { \eta } .
+$$
+
+# Part I
+
+# Proofs of the main results
+
+7 FIRST ORDER CONDITION: PROOF OF LEMMA 2
+
+Lemma 12. (Lemma 2 restated) At all DLMs in ${ \mathcal { D } } _ { \mathbf { A } } \left( \mathbf { X } \right)$ the residual error e is identical, and furthermore
+
+$$
+\left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0 .
+$$
+
+Proof. Let $\mathbf { W } = \left[ \mathbf { w } _ { 1 } , \ldots , \mathbf { w } _ { d _ { 1 } } \right] ^ { \top } \in \mathcal { D } _ { \mathbf { A } } \left( \mathbf { X } \right)$ , $\mathbf { G } \triangleq \mathbf { A } \circ \mathbf { X } \ \in \ \mathbb { R } ^ { d _ { 0 } d _ { 1 } \times N }$ , $\tilde { \mathbf { W } } = \mathrm { d i a g } \left( \mathbf { z } \right) \mathbf { W } =$ $\left[ \tilde { \mathbf { w } } _ { 1 } , \ldots , \tilde { \mathbf { w } } _ { d _ { 1 } } \right] ^ { \top }$ and $\tilde { \mathbf { w } } \triangleq \mathrm { v e c } \left( \tilde { \mathbf { W } } ^ { \top } \right) \in \mathbb { R } ^ { d _ { 0 } d _ { 1 } }$ , where $\operatorname { d i a g } \left( \mathbf { v } \right)$ is the diagonal matrix with $\mathbf { v }$ in its
+
+diagonal, and vec (M) is vector obtained by stacking the columns of the matrix $\mathbf { M }$ on top of one another. Then, we can re-write the MSE (eq. (2.3)) as
+
+$$
+\mathrm { M S E } = { \frac { 1 } { N } } \left\| \mathbf { y } - \mathbf { G } ^ { \top } { \tilde { \mathbf { w } } } \right\| ^ { 2 } = { \frac { 1 } { N } } \left\| \mathbf { e } \right\| ^ { 2 } ,
+$$
+
+where $\mathbf { G } ^ { \top } \tilde { \mathbf { w } }$ is the output of the MNN. Now, if $( \mathbf { W } , \mathbf { z } )$ is a DLM of the MSE in eq. (2.3), then there is no infinitesimal perturbation of $( \mathbf { W } , \mathbf { z } )$ which reduces this MSE.
+
+Next, for each row $i$ , we will show that $\partial \mathrm { M S E } / \partial \tilde { \bf w } _ { i } = 0$ , since otherwise we can find an infinitesimal perturbation of $( \mathbf { W } , \mathbf { z } )$ which decreases the MSE, contradicting the assumption that $( \mathbf { W } , \mathbf { z } )$ is a local minimum. For each row $i$ , we divide into two cases:
+
+First, we consider the case $z _ { i } \neq 0$ . In this case, any infinitesimal perturbation $\mathbf { q } _ { i }$ in $\tilde { \mathbf { w } } _ { \mathbf { i } }$ can be produced by an infinitesimal perturbation in $\mathbf { w } _ { i }$ $\mathbf { \widetilde { w } } _ { i } + \mathbf { q } _ { i } = ( \mathbf { w } _ { i } + \mathbf { q } _ { i } / z _ { i } ) z _ { i }$ . Therefore, unless the gradient $\partial \mathrm { { M S E } } / \partial \tilde { \bf { w } } _ { i }$ is equal to zero, we can choose an infinitesimal perturbation $\mathbf { q } _ { i }$ in the opposite direction to this gradient, which will decrease the MSE.
+
+Second, we consider the case $z _ { i } ~ = ~ 0$ . In this case, the MSE is not affected by changes made exclusively to $\mathbf { w } _ { i }$ . Therefore, all $\mathbf { w } _ { i }$ derivatives of the MSE are equal to zero $( \partial ^ { \bar { k } } \mathrm { M S E } / \partial ^ { k } \mathbf { w } _ { i }$ , to any order $k$ ) . Also, since we are at a differentiable local minimum, $\partial \mathrm { M S E } / \partial z _ { i } = 0$ . Thus, using a Taylor expansion, if we perturb $\left( \mathbf { w } _ { i } , z _ { i } \right)$ by $( \hat { \mathbf { w } } _ { i } , \hat { z } _ { i } )$ then the MSE is perturbed by
+
+$$
+\hat { z } _ { i } \hat { \mathbf { w } } _ { i } ^ { \top } \frac { \partial } { \partial \tilde { \mathbf { w } } _ { i } } \frac { \partial } { \partial z _ { i } } \mathrm { M S E } + O ( \hat { z } _ { i } ^ { 2 } )
+$$
+
+Therefore, unless $\partial ^ { 2 } \mathrm { M S E } / \left( \partial \mathbf { w } _ { i } \partial z _ { i } \right) = 0$ we can choose $\hat { \mathbf { w } } _ { i }$ and a sufficiently small $\hat { z } _ { i }$ such that the MSE is decreased. Lastly, using the chain rule
+
+$$
+\frac { \partial } { \partial z _ { i } } \frac { \partial } { \partial \mathbf { w } _ { i } } \mathrm { M S E } = \frac { \partial } { \partial z _ { i } } \left[ z _ { i } \frac { \partial } { \partial \tilde { \mathbf { w } } _ { i } } \mathrm { M S E } \right] = \frac { \partial } { \partial \tilde { \mathbf { w } } _ { i } } \mathrm { M S E } .
+$$
+
+Thus, $\partial \mathrm { M S E } / \partial \tilde { \bf w } _ { i } = 0$ . This implies that w˜ is also a $\mathrm { D L M } ^ { 5 }$ of eq. (7.2), which entails
+
+$$
+0 = - \frac { N } { 2 } \frac { \partial } { \partial \tilde { \bf w } _ { i } } \mathrm { M S E } = { \bf G } \left( { \bf y } - { \bf G } ^ { \top } \tilde { \bf w } \right) .
+$$
+
+Since $\mathbf { G } = \mathbf { A } \circ \mathbf { X }$ and $\mathbf { e } = \mathbf { y } - \mathbf { G } ^ { \top } \tilde { \mathbf { w } }$ this proves eq. (7.1). Now, for any two solutions $\tilde { \mathbf { w } } _ { 1 }$ and $\tilde { \mathbf { w } } _ { 2 }$ of eq. (7.3), we have
+
+$$
+0 = \mathbf { G } \left( \mathbf { y } - \mathbf { G } ^ { \top } \tilde { \mathbf { w } } _ { 1 } \right) - \mathbf { G } \left( \mathbf { y } - \mathbf { G } ^ { \top } \tilde { \mathbf { w } } _ { 1 } \right) = \mathbf { G } \mathbf { G } ^ { \top } \left( \tilde { \mathbf { w } } _ { 2 } - \tilde { \mathbf { w } } _ { 1 } \right) .
+$$
+
+Multiplying by $\big ( \tilde { \mathbf { w } } _ { 2 } - \tilde { \mathbf { w } } _ { 1 } \big ) ^ { \top }$ from the left we obtain
+
+$$
+\left\| \mathbf { G } ^ { \top } \left( \tilde { \mathbf { w } } _ { 2 } - \tilde { \mathbf { w } } _ { 1 } \right) \right\| ^ { 2 } = 0 \Rightarrow \mathbf { G } ^ { \top } \left( \tilde { \mathbf { w } } _ { 2 } - \tilde { \mathbf { w } } _ { 1 } \right) = 0 .
+$$
+
+Therefore, the MNN output and the residual error $\mathbf { e }$ are equal for all DLMs in ${ \mathcal { D } } _ { \mathbf { A } } \left( \mathbf { X } \right)$ .
+
+# 8 SUB-OPTIMAL DIFFERENTIABLE LOCAL MINIMA: PROOF OF THEOREM 6 AND ITS COROLLARY
+
+Theorem 13. (Theorem 6 restated) Given assumptions 1-4, the expected angular volume of suboptimal DLMs, with $\mathrm { M C E } > \epsilon > 0$ , is exponentially vanishing in $N$ as
+
+$$
+\begin{array} { r } { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) , } \end{array}
+$$
+
+To prove this theorem we upper bound the angular volume of $\mathcal { L } _ { \epsilon }$ (definition 4), i.e., differentiable regions in which there exist DLMs with $\mathrm { M C E } > \epsilon > 0$ . Our proof uses the first order necessary condition for DLMs from Lemma 2, $\left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0$ , to find which configurations of $\mathbf { A }$ allow for a high residual error e with $\mathrm { M C E } > \epsilon > 0$ . In these configurations $\mathbf { A } \circ \mathbf { X }$ cannot have full rank, and therefore, as we show (Lemma 14 below), $\mathbf { A } = a \left( \mathbf { W } \mathbf { X } \right)$ must have a low rank. However, $\mathbf { A } = a \left( \mathbf { W } \mathbf { X } \right)$ has a low rank with exponentially low probability when $\mathbf x \sim \mathcal N$ and $\mathbf { W } \sim { \mathcal { N } }$ (Lemmas 15 and 16 below). Thus, we derive an upper bound on $\mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right)$ .
+
+Before we begin, let us recall some notation: $[ L ] \triangleq \{ 1 , 2 , \dots , L \} , \mathbf { M } > 0$ implies that $\forall i , j : M _ { i j } >$ 0, $\mathbf { M } _ { S }$ is the matrix composed of the columns of M that are in the index set $S$ , $\left\| \mathbf { v } \right\| _ { 0 }$ as the $L _ { 0 }$ “norm” that counts the number of non-zero values in $\mathbf { v }$ . First we consider the case $\rho \neq 0$ . Also, we denote $K _ { r } \triangleq \operatorname* { m a x } \left[ N \epsilon , r d _ { 0 } \right]$ .
+
+First we consider the case $\rho \neq 0$ .
+
+From definition 3 of the angular volume
+
+$$
+\begin{array} { r l } { \mathfrak { r } _ { \mathbf { x } \times \mathcal { N } } \mathcal { V } ( \mathcal { L } , ( \mathbf { X } , \mathbf { y } ) ) = \mathfrak { h } _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { N } _ { \mathbf { x } \times \mathbf { y } } } \times \mathbf { w } \times ( \mathbf { \overline { { B } } } \otimes \mathcal { L } , ( \mathbf { x } , \mathbf { x } , \mathbf { y } ) ) } & { } \\ { \overset { ( 1 ) } { \leq } \mathbf { R } _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { D } _ { \mathbf { x } \times \mathbf { y } } } \times \mathbf { w } \times \times ( \mathbf { a } \in \{ \rho _ { 1 } \} ) ^ { d _ { 1 } \times \mathbb { N } } , \ \mathbf { W } \in \mathcal { D } _ { \mathbf { A } } ( \mathbf { X } ) , \mathbf { v } \in \mathbb { R } ^ { N } \ ; \ ( \mathbf { A } \circ \mathbf { X } ) \times \mathbf { v } \times \mathbf { w } } & { } \\ { \overset { ( 2 ) } { \leq } \mathbf { R } _ { \mathbf { x } \times \mathcal { N } , \mathbf { w } \times \mathbf { N } } \times ( \mathbf { A } \in \{ \rho _ { 1 } \} ) ^ { d _ { 1 } \times \mathbb { N } } , \ \mathbf { W } \in \mathcal { D } _ { \mathbf { A } } ( \mathbf { X } ) , \mathbf { v } \in \mathbb { R } ^ { N } \ ; \ ( \mathbf { A } \circ \mathbf { X } ) \times \mathbf { v } = 0 , } & { } \\ { \overset { ( 4 ) } { \leq } \mathbf { R } _ { \mathbf { x } \times \mathcal { N } , \mathbf { w } \times \mathbf { N } } ( \mathbf { S } \subset [ \mathbf { N } ] \ \cdot \{ | \mathbf { S } | \ \ \geq \operatorname* { m a x } [ N _ { c , \mathrm { t r a l i k } } ( \alpha ( \langle \mathbf { W } \mathbf { X } ) ) d _ { 0 } + 1 ] \} } & { } \\ - \mathbf { B } _ { \mathbf { x } \times \mathbf { y } } [ \mathbb { W } _ { \mathbf { w } \times \mathbf { x } } ( \mathcal { S } \subset [ \mathbf { N } ] \ \cdot \{ | \mathbf { S } | \ \geq \operatorname* { m a x } [ \mathcal { N } _ { c , \mathrm { r a l i k } } ( \alpha ( \mathbf { W } \mathbf { X } ) ) d _ \end{array}
+$$
+
+where
+
+1. If we are at DLM a in $\mathcal { D } _ { \mathbf { A } } \left( \mathbf { X } \right)$ , then Lemma 2 implies $\left( \mathbf { A } \circ \mathbf { X } \right) \mathbf { e } = 0$ . Also, if $e ^ { ( n ) } = 0$ on some sample, we necessarily classify it correctly, and therefore $\mathrm { M C E } \leq \| \mathbf { e } \| _ { 0 } / N$ . Since $\mathrm { M C E } > \epsilon$ in $\mathcal { L } _ { \epsilon }$ this implies that $N \bar { \epsilon } < \| \mathbf { e } \| _ { 0 }$ . Thus, this inequality holds for ${ \bf v } = { \bf e }$ .
+
+2. We apply assumption 1, that $\mathbf { X } \sim { \mathcal { N } }$ .
+
+3. Assumption 4 implies $d _ { 0 } d _ { 1 } { \dot { > } } N \log ^ { 4 } N \geq N$ . Thus, we can apply the following Lemma, proven in appendix section 12.1:
+
+Lemma 14. Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ , $\mathbf { A } \in \{ \rho , 1 \} ^ { d _ { 1 } \times N }$ , $S \subset [ N ]$ and $d _ { 0 } d _ { 1 } \geq N$ . Then, simultaneously for every possible A and $S$ such that
+
+$$
+\left. S \right. \leq \mathrm { r a n k } \left( { \bf A } _ { S } \right) d _ { 0 } ,
+$$
+
+we have that, $\mathbf { X }$ -a.e., $\mathbf { \Delta } \nexists \mathbf { v } \in \mathbb { R } ^ { N }$ such that $v _ { n } \neq 0 \forall n \in S$ and $( \mathbf { A } \circ \mathbf { X } ) \mathbf { v } = 0$ .
+
+4. Recall that $K _ { r } \triangleq \operatorname* { m a x } \left[ N \epsilon , r d _ { 0 } \right]$ . We use the union bound over all possible ranks $r \geq 1$ we ignore the $r = 0$ case since for $\rho \neq 0$ (see eq. (2.1)) there is zero probability that rank $( a ( \mathbf { W } \mathbf { X } _ { S } ) ) = 0$ for some non-empty $S$ . For each rank $r \geq 1$ , it is required that $| S | > K _ { r } = \operatorname* { m a x } \left[ N \epsilon , r d _ { 0 } \right]$ , so $| S | = K _ { r }$ is a relaxation of the original condition, and thus its probability is not lower.
+
+5. We again use the union bound over all possible subsets $S$ of size $K _ { r }$ .
+
+Thus, from eq. (8.1), we have
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { \mathbf { x } \times \mathbf { x } ^ { \beta } } \nu ( \xi , \alpha ( \mathbf { x } , \mathbf { x } ) ) } \\ & = \frac { \nu ( \mathbf { x } ) } { 2 } \sum _ { i = 1 } ^ { N } \sum _ { \substack { s \geq 0 , i \geq 1 } } \sum _ { \substack { [ \xi \in \mathcal { S } _ { \mathbf { x } } \times \mathcal { N } _ { i } ] ( \xi \in \mathcal { S } _ { \mathbf { x } } \times \{ i \} ) = ( \xi \cup \mathbf { X } _ { \mathbf { x } } ) ] = ( \xi \mid \mathbf { X } _ { \mathbf { x } } ) } } \\ & { \leq \frac { \nu ( \mathbf { x } ) } { 2 } \sum _ { i = 1 } ^ { N } \operatorname* { s u p } _ { ( \xi \in \mathcal { S } _ { \mathbf { x } } ) } [ \xi \operatorname* { s u p } _ { ( \xi \in \mathcal { S } _ { \mathbf { x } } ) ] } ( \operatorname* { s u p } _ { ( \xi \in \mathcal { S } _ { \mathbf { x } } ) \{ ( \xi \mathbf { X } _ { \mathbf { x } } ) \} = \{ \alpha \} } ] } \\ & \overset { ( a ) } { \geq } \sum _ { i = 1 } ^ { N } ( \frac { \nu } { L } ) \sum _ { \substack { ( \xi ) \leq ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ) = ( \xi ) } } \\ & \overset { ( a ) } { \leq } \sum _ { i = 1 } ^ { N } ( \frac { \nu } { L } ) \sum _ \substack { ( \xi ) \leq ( \xi ) ( \xi ) \leq ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) ( \xi ) \leq ( \xi ) \mathrm { h } } \{ \alpha \} \exp \{ ( \xi \} \sum _ \mathbf { x } \in \{ \xi \} \} \xi ) ( \xi ) ( \xi ) ( \end{array}
+$$
+
+1. Since we take the expectation over $\mathbf { X }$ , the location of $S$ does not affect the probability. Therefore, we can set without loss of generality $S = \left[ K _ { r } \right]$ .
+
+2. Note that $r \leq N / d _ { 0 } \dot { < } \operatorname* { m i n } \left[ d _ { 0 } , d _ { 1 } \right]$ from assumptions 3 and 4. Thus, with $k = K _ { r } \ge d _ { 0 }$ , we apply the following Lemma, proven in appendix section 12.2:
+
+Lemma 15. Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times k }$ be a random matrix with independent and identically distributed columns, and $\mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ an independent standard random Gaussian matrix. Then, in the limit m $\mathrm { i n } \left[ k , d _ { 0 } , d _ { 1 } \right] \dot { > } r$ ,
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathrm { r a n k } \left( a \left( \mathbf { W } \mathbf { X } \right) \right) = r \right) \dot { \leq } 2 ^ { k + r d _ { 0 } \left( \log d _ { 1 } + \log k \right) + r ^ { 2 } } \mathbb { P } \left( \mathbf { W } \mathbf { X } _ { [ \lfloor k / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+3. Note that $K _ { r } \geq N \epsilon \dot { = } N > 2 d _ { 1 }$ , and $\operatorname* { m i n } \left[ K _ { r } , d _ { 0 } , d _ { 1 } \right] \dot { > } d _ { 0 } \underline { { d _ { 1 } } } / K _ { r } \dot { > } 1$ from assumptions 2 and 4. Thus, we apply the following Lemma (with $\mathbf { C } = \mathbf { X } ^ { \top }$ , $\mathbf { B } = \mathbf { W } ^ { \top }$ , $M = d _ { 0 }$ , $L = d _ { 1 }$ and $N = K _ { r } / 2$ ), proven in appendix section 12.3:
+
+Lemma 16. Let $\mathbf { C } \in \mathbb { R } ^ { N \times M }$ and $\mathbf { B } \in \mathbb { R } ^ { M \times L }$ be two independent standard random Gaussian matrices. Without loss of generality, assume $N \geq L ,$ , and denote $\alpha \triangleq M L / N$ . Then, in the regime $M \leq N$ and in the limit min $[ N , M , L ] \dot { > } \alpha \dot { > } 1$ , we have
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathbf { C B } > 0 \right) \dot { \leq } \exp \left( - 0 . 4 N \alpha ^ { 1 / 4 } \right) . } \end{array}
+$$
+
+4. We use $r d _ { 0 } \leq N , \left( \begin{array} { c } { { N } } \\ { { K _ { r } } } \end{array} \right) \leq 2 ^ { N } , K _ { r } \leq N ,$ , and $d _ { 1 } \dot { < } N$ (from assumption 4) and $r ^ { 2 } \leq$ $N ^ { 2 } / d _ { 0 } ^ { 2 } { \dot { < } } N$ (from assumption (3)) to simplify the combintaorial expressions.
+
+5. First, note that $r = 1$ is the maximal term in the sum, so we can neglect the other, exponentially smaller, terms. Second, from assumption 3 we have $d _ { 0 } { \dot { \le } } N$ , so
+
+$$
+\operatorname* { l i m } _ { N \to \infty } 0 . 2 3 \operatorname* { m a x } \left[ \epsilon , d _ { 0 } \left( N \right) / N \right] ^ { 3 / 4 } = 0 . 2 3 \operatorname* { m a x } \left[ \epsilon , \operatorname* { l i m } _ { N \to \infty } d _ { 0 } \left( N \right) / N \right] ^ { 3 / 4 } = \gamma _ { \epsilon } .
+$$
+
+Third, from assumption 4 we have $N \log ^ { 4 } N { \dot { < } } d _ { 0 } d _ { 1 }$ , so the $2 ^ { N \log N }$ term is negligible.
+
+Thus,
+
+$$
+\begin{array} { r } { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) . } \end{array}
+$$
+
+which proves the Theorem for the case $\rho \neq 0$ .
+
+Next, we consider the case $\rho = 0$ . In this case, we need to change transition (4) in eq. (8.1), so the sum starts from $r = 0$ , since now we can have rank $( a ( \mathbf { W } \mathbf { X } _ { S } ) \bar { ) } = 0$ . Following exactly the same
+
+logic (except the modification to the sum), we only need to modify transition (5)in eq. (8.2) – since now the maximal term in the sum is at $r = 0$ . This entails $\gamma _ { \epsilon } = 0 . 2 3 \epsilon ^ { 3 / 4 }$ .
+
+Corollary 17. (Corollary 7 restated) Given assumptions 1-4, for any $\delta > 0$ (possibly a vanishing function of $N _ { . }$ ), we have, with probability $1 - \delta$ , that the angular volume of sub-optimal DLMs, with $\mathrm { M C E } > \epsilon > 0$ , is exponentially vanishing in $N$ as
+
+$$
+{ \mathcal { V } } \left( { \mathcal { L } } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \leq } \frac { 1 } { \delta } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right)
+$$
+
+Proof. Since $\mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) \geq 0$ we can use Markov’s Theorem $( \mathrm { F a c t } 1 1 ) \forall \eta > 0$ :
+
+$$
+\mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) < \eta \right) > 1 - \frac { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) } { \eta }
+$$
+
+denoting $\begin{array} { r } { \eta = \frac { 1 } { \delta } \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) } \end{array}$ , and using Theorem (6) we prove the corollary.
+
+$$
+\begin{array} { r l } & { 1 - \delta < \mathbb { P } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left( \displaystyle \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) < \frac { 1 } { \delta } \mathbb { E } _ { { \mathbf { X } } \sim { \mathcal { N } } } \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) \right) } \\ & { \quad \quad \quad < \mathbb { P } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left( \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) \dot { \leq } \frac { 1 } { \delta } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) \right) } \end{array}
+$$
+
+where we note that replacing a regular inequality $<$ with inequality in the leading order $\dot { \leq }$ only removes constraints, and therefore increases the probability. □
+
+# 9 CONSTRUCTION OF GLOBAL MINIMA: PROOF OF THEOREM 8:
+
+Recall the LReLU non-linearity
+
+$$
+f \left( x \right) \triangleq { \left\{ \begin{array} { l l } { \rho x } & { , { \mathrm { i f ~ } } x < 0 } \\ { x } & { , { \mathrm { i f ~ } } x \geq 0 } \end{array} \right. }
+$$
+
+in eq. (2.1), where $\rho \neq 1$
+
+Theorem 18. (Theorem 8 restated) For any $\mathbf { y } \in \{ 0 , 1 \} ^ { N }$ and $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ almost everywhere we find matrices $\mathbf { W ^ { * } } ~ \in ~ \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ and $\mathbf { z } ^ { * } ~ \in ~ \mathbb { R } ^ { d _ { 1 } ^ { * } }$ , such that $\mathbf { y } ~ = ~ f \left( \mathbf { W } ^ { * } \mathbf { X } \right) ^ { \top } \mathbf { z } ^ { * }$ , where $d _ { 1 } ^ { * } \ \triangleq$ $4 \left\lceil N / \left( 2 d _ { 0 } - 2 \right) \right\rceil$ and $\forall i , n : \mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \neq 0$ . Therefore, every MNN with $d _ { 1 } \ \geq \ d _ { 1 } ^ { * }$ has a DLM which achieves zero error $\mathbf { e } = 0$ .
+
+We prove the existence of a solution $( \mathbf { W } ^ { * } , \mathbf { z } ^ { * } )$ , by explicitly constructing it. This construction is a variant of (Baum, 1988, Theorem 1), except we use LReLU without bias and MSE – instead of threshold units with bias and MCE. First, we note that for any $\epsilon _ { 1 } > \epsilon _ { 2 } > 0$ , the following trapezoid function can be written as a scaled sum of four LReLU:
+
+$$
+\begin{array} { l } { \displaystyle \tau \left( x \right) \triangleq \left\{ \begin{array} { l l } { 0 } & { \mathrm { , ~ i f ~ } | x | > \epsilon _ { 1 } } \\ { 1 } & { \mathrm { , ~ i f ~ } | x | \leq \epsilon _ { 2 } } \\ { \frac { \epsilon _ { 1 } - | x | } { \epsilon _ { 1 } - \epsilon _ { 2 } } } & { \mathrm { , ~ i f ~ } \epsilon _ { 2 } < | x | \leq \epsilon _ { 1 } } \\ { = \displaystyle \frac { 1 } { \epsilon _ { 1 } - \epsilon _ { 2 } } \frac { 1 } { 1 - \rho } \left[ f \left( x + \epsilon _ { 1 } \right) - f \left( x + \epsilon _ { 2 } \right) - f \left( x - \epsilon _ { 2 } \right) + f \left( x - \epsilon _ { 1 } \right) \right] . } \end{array} \right. } \end{array}
+$$
+
+Next, we examine the set of data points which are classified to 1: $S ^ { + } \triangleq \left\{ n \in [ N ] | y ^ { ( n ) } = 1 \right\}$ . Without loss of generality, assume $\vert S ^ { + } \vert \le \frac { N } { 2 }$ . We partition $S ^ { + }$ to
+
+$$
+K = \left\lceil { \frac { | S ^ { + } | } { d _ { 0 } - 1 } } \right\rceil \leq \left\lceil { \frac { N } { 2 \left( d _ { 0 } - 1 \right) } } \right\rceil
+$$
+
+subsets $\left\{ { \cal { S } } _ { i } ^ { + } \right\} _ { i = 1 } ^ { K }$ , each with no more than $d _ { 0 } - 1$ samples. For almost any dataset we can find K $K$ i=1hyperplanes passing through the origin, with normals such that each hyperplane contains all $d _ { 0 } - 1$ points in subset ${ S } _ { i } ^ { + }$ , i.e.,
+
+$$
+\tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { X } _ { S _ { i } ^ { + } } = 0 ,
+$$
+
+but no other point, so $\forall n \notin S _ { i } ^ { + } : \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \neq 0$ ,
+
+If $\epsilon _ { 1 } , \epsilon _ { 2 }$ in eq. (9.1) are sufficiently small $( \forall n \notin S _ { i } ^ { + } : \left| \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right| > \epsilon _ { 1 } )$ then we have
+
+$$
+\tau \left( \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) = \left\{ \begin{array} { l l } { 1 } & { \mathrm { , ~ i f ~ } n \in S _ { i } ^ { + } } \\ { 0 } & { \mathrm { , ~ e l s e } } \end{array} \right. .
+$$
+
+Then we have
+
+$$
+\sum _ { i = 1 } ^ { K } \tau \left( \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) = \left\{ \mathbf { 1 } \quad , \mathrm { i f } n \in \mathcal { S } ^ { + } \right.
+$$
+
+which gives the correct classification on all the data points. Thus, from eq. (9.1), we can construct a MNN with
+
+$$
+d _ { 1 } ^ { * } = 4 K
+$$
+
+hidden neurons which achieves zero error. This is straightforward to do if we have a bias in each neuron. To construct this MNN even without bias, we first find a vector $\hat { \mathbf { w } } _ { i }$ such that
+
+$$
+\hat { \mathbf { w } } _ { i } ^ { \top } \left[ { \bf X } _ { S _ { i } ^ { + } } , \tilde { \mathbf { w } } _ { i } \right] = \left[ 1 , \ldots , 1 , 1 , 0 \right] .
+$$
+
+Note that this is possible since $\left[ { \bf X } _ { S _ { i } ^ { + } } , \tilde { { \bf w } } _ { i } \right]$ has full rank $\mathbf { X }$ -a.e. (the matrix $\mathbf { X } _ { S _ { i } ^ { + } } \in \mathbb { R } ^ { d _ { 0 } \times d _ { 0 } - 1 }$ has, $\mathbf { X }$ -a.e., one zero left eigenvector, which is $\tilde { \mathbf { w } } _ { i }$ , according to eq. (9.2)). Additionally, we can set
+
+$$
+\begin{array} { r } { \| \tilde { \mathbf { w } } _ { i } \| = \| \hat { \mathbf { w } } _ { i } \| ~ , } \end{array}
+$$
+
+since changing the scale of $\mathbf { w } _ { i }$ would not affect the validity of eq. (9.2). Then, we denote
+
+$$
+\begin{array} { r l } & { { \mathbf w } _ { i } ^ { ( 1 ) } \triangleq \tilde { \mathbf { w } } _ { i } + \epsilon _ { 1 } \hat { \mathbf { w } } _ { i } ; { \mathbf w } _ { i } ^ { ( 2 ) } \triangleq \tilde { \mathbf { w } } _ { i } + \epsilon _ { 2 } \hat { \mathbf { w } } _ { i } } \\ & { { \mathbf w } _ { i } ^ { ( 3 ) } \triangleq \tilde { \mathbf { w } } _ { i } - \epsilon _ { 2 } \hat { \mathbf { w } } _ { i } ; { \mathbf w } _ { i } ^ { ( 4 ) } \triangleq \tilde { \mathbf { w } } _ { i } - \epsilon _ { 1 } \hat { \mathbf { w } } _ { i } . } \end{array}
+$$
+
+Note, from eqs. (9.2) and (9.4) that this choice satisfies
+
+$$
+\forall n \in S _ { i } ^ { + } : \mathbf { w } _ { i } ^ { ( j ) \top } \mathbf { x } ^ { ( n ) } = \left\{ \begin{array} { l l } { \epsilon _ { 1 } } & { , \mathrm { i f } j = 1 } \\ { \epsilon _ { 2 } } & { , \mathrm { i f } j = 2 } \\ { - \epsilon _ { 2 } } & { , \mathrm { i f } j = 3 } \\ { - \epsilon _ { 1 } } & { , \mathrm { i f } j = 4 } \end{array} \right. .
+$$
+
+Also, to ensure that $\forall n \notin S _ { i } ^ { + }$ the sign of $\mathbf { w } _ { i } ^ { ( j ) ^ { \top } } \mathbf { x } ^ { ( n ) }$ does not change for different $j$ , for some $\beta , \gamma < 1$ we define
+
+$$
+\epsilon _ { 1 } = \beta \frac { \operatorname* { m i n } _ { n \not \in { \cal S } _ { i } ^ { + } } \left| \tilde { \mathbf { w } } _ { i } ^ { \top } { \mathbf { x } } ^ { ( n ) } \right| } { \operatorname* { m a x } _ { n \not \in { \cal S } _ { i } ^ { + } } \left| \hat { \mathbf { w } } _ { i } ^ { \top } { \mathbf { x } } ^ { ( n ) } \right| } , \epsilon _ { 2 } = \gamma \epsilon _ { 1 } ,
+$$
+
+where with probability $\begin{array} { r } { 1 , \operatorname* { m i n } _ { n \not \in \mathcal { S } _ { i } ^ { + } } \left| \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right| > 0 } \end{array}$ and $\mathrm { m a x } _ { n \notin { \cal S } _ { i } ^ { + } } \left| \hat { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right| > 0$ . Defining
+
+$$
+\begin{array} { r l } & { \mathbf { W } _ { i } \triangleq \left[ \mathbf { w } _ { i } ^ { ( 1 ) } , \mathbf { w } _ { i } ^ { ( 2 ) } , \mathbf { w } _ { i } ^ { ( 3 ) } , \mathbf { w } _ { i } ^ { ( 4 ) } \right] ^ { \top } \in \mathbb { R } ^ { 4 K \times d _ { 0 } } } \\ & { \mathbf { z } _ { i } \triangleq \left[ 1 , - 1 , - 1 , 1 \right] ^ { \top } \in \mathbb { R } ^ { 4 } } \end{array}
+$$
+
+and combining all the above facts, we have
+
+$$
+\begin{array} { l } { f \left( \mathbf { W } _ { i } \mathbf { x } ^ { ( n ) } \right) ^ { \top } \mathbf { z } _ { i } } \\ { \ = \displaystyle \frac { 1 } { \epsilon _ { 1 } - \epsilon _ { 2 } } \frac { 1 } { 1 - \rho } \left[ f \left( \mathbf { w } _ { i } ^ { ( 1 ) \top } \mathbf { x } ^ { ( n ) } \right) - f \left( \mathbf { w } _ { i } ^ { ( 2 ) \top } \mathbf { x } ^ { ( n ) } \right) - f \left( \mathbf { w } _ { i } ^ { ( 3 ) \top } \mathbf { x } ^ { ( n ) } \right) + f \left( \mathbf { w } _ { i } ^ { ( 3 ) \top } \mathbf { x } ^ { ( n ) } \right) \right] } \\ { \ = \displaystyle \frac { 1 } { \epsilon _ { 1 } - \epsilon _ { 2 } } \frac { 1 } { 1 - \rho } \left[ f \left( \widetilde { \mathbf { w } } _ { i } ^ { ( 1 ) } \mathbf { x } ^ { ( n ) } + \epsilon _ { 1 } \widehat { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) - f \left( \widetilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } + \epsilon _ { 2 } \widehat { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) \right. } \\ { \ - \left. f \left( \widetilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } - \epsilon _ { 2 } \widehat { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) + f \left( \widetilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } - \epsilon _ { 1 } \widehat { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) \right] } \\ { \ = \displaystyle \frac { 1 } { \left\{ 0 \right. \ } , \ \mathrm { i f } n \in \mathcal { S } _ { i } ^ { + } } . \end{array}
+$$
+
+Thus, for
+
+$$
+\begin{array} { c } { { \displaystyle { \bf W } ^ { * } = \left[ { \bf W } _ { 1 } ^ { \top } , \ldots , { \bf W } _ { K } ^ { \top } \right] ^ { \top } \in \mathbb { R } ^ { 4 \times d _ { 0 } } } } \\ { { \displaystyle { \bf z } ^ { * } = \frac { 1 } { \epsilon _ { 1 } - \epsilon _ { 2 } } \frac { 1 } { 1 - \rho } \cdot \left[ { \bf z } _ { 1 } , \ldots , { \bf z } _ { K } \right] \in \mathbb { R } ^ { 4 K } } } \end{array}
+$$
+
+we obtain a MNN that implements
+
+$$
+f \left( \mathbf { W } ^ { * } \mathbf { x } ^ { ( n ) } \right) ^ { \top } \mathbf { z } ^ { * } = { \left\{ \begin{array} { l l } { 1 } & { , { \mathrm { i f } } \ n \in S ^ { + } } \\ { 0 } & { , { \mathrm { e l s e } } } \end{array} \right. }
+$$
+
+and thus achieves zero error. Clearly, from this construction, if $\mathbf { w } _ { i }$ is a row of $\mathbf { W } ^ { * }$ , then $\forall n \in S _ { i } ^ { + } , \forall i :$ $| \mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } | \geq \epsilon _ { 2 }$ , and with probability $1 \forall n \notin S _ { i } ^ { + } , \forall i : \left| \mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right| > 0$ , so this construction does not touch any non-differentiable region of the MSE.
+
+# 10 GLOBAL MINIMA: PROOF OF THEOREM 9
+
+Theorem 19. (Theorem 9 restated). Given assumptions 1-3, we set $\delta \dot { = } \sqrt { { \textstyle \frac { 8 } { \pi } } } d _ { 0 } ^ { - 1 / 2 } \ +$ $2 d _ { 0 } ^ { 1 / 2 } \sqrt { { \log d _ { 0 } } } / { N }$ and $d _ { 1 } ^ { * } = 2 N / d _ { 0 }$ , or if assumption $^ { 5 }$ holds, we set $d _ { 1 } ^ { * }$ as in this assumption. Then, with probability $1 - \delta$ , the angular volume of global minima is lower bounded as,
+
+$$
+\mathscr { V } \left( \mathscr { G } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { > } \exp \left( - d _ { 1 } ^ { \ast } d _ { 0 } \log N \right) \dot { \geq } \exp \left( - 2 N \log N \right) .
+$$
+
+In this section we lower bound the angular volume of $\mathcal { G }$ (definition 4), i.e., differentiable regions in which there exist DLMs with $\mathrm { { M C E } = 0 }$ . We lower bound $\mathcal { V } \left( \mathcal { G } \right)$ using the angular volume corresponding to the differentiable region containing a single global minimum.
+
+From assumption 4, we have $d _ { 0 } d _ { 1 } \dot { > } N$ , so we can apply Theorem 8 and say that the labels are generated using a $( \mathbf { X } , \mathbf { y } )$ -dependent MNN: $\mathbf { y } ~ = ~ f \left( \mathbf { W } ^ { * } \mathbf { X } \right) ^ { \top } \mathbf { z } ^ { * }$ with target weights $\begin{array} { r l } { \mathbf { W } ^ { * } } & { { } = } \end{array}$ $\left[ { \bf w } _ { 1 } ^ { * \top } , \ldots , { \bf w } _ { d _ { 1 } ^ { * } } ^ { * \top } \right] ^ { \top } \in \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ and $\mathbf { z } ^ { * } \in \mathbb { R } ^ { d _ { 1 } }$ . If, in addition, assumption 5 holds then we can assume $\mathbf { W } ^ { * }$ and $\mathbf { z } ^ { \ast }$ are independent from $( \mathbf { X } , \mathbf { y } )$ . In both cases, the following differentiable region
+
+$$
+\begin{array} { r } { \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \triangleq \left\{ \mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } } | \forall i \le d _ { 1 } ^ { * } : \ \mathrm { s i g n } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { X } \right) = \mathrm { s i g n } \left( \mathbf { w } _ { i } ^ { * ^ { \top } } \mathbf { X } \right) \right\} , } \end{array}
+$$
+
+also contains a differentiable global minimum (just set $\mathbf { w } _ { i } = \mathbf { w } _ { i } ^ { * }$ , $z _ { i } = z _ { i } ^ { * } \forall i \leq d _ { 1 } ^ { * }$ , and $z _ { i } = 0$ $\forall i > d _ { 1 } ^ { * } ,$ ), and therefore $\forall \mathbf { X } , \mathbf { y }$ and their corresponding $\mathbf { W } ^ { * }$ , we have
+
+$$
+\mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \supset \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right)
+$$
+
+Also, we will make use of the following definition.
+
+Definition 20. Let $\mathbf { X }$ have an angular margin $\alpha$ from $\mathbf { W } ^ { * }$ if all datapoints (columns in $\mathbf { X }$ ) are at an angle of at least $\alpha$ from all the weight hyperplanes (rows of $\mathbf { W } ^ { * }$ ) , i.e., $\mathbf { X }$ is in the set
+
+$$
+\mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \triangleq \left. \mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N } | \forall i , n : \left| \frac { \mathbf { x } ^ { ( n ) \top } \mathbf { w } _ { i } ^ { * } } { \left\| \mathbf { x } ^ { ( n ) } \right\| \left\| \mathbf { w } _ { i } ^ { * } \right\| } \right| > \mathrm { s i n } \alpha \right. .
+$$
+
+Using the definitions in eqs. (10.3) and (10.1), we prove the Theorem using the following three Lemmas.
+
+First, In appendix section 13.2 we prove
+
+Lemma 21. For any $\alpha$ , $i f \mathbf { W } ^ { * }$ is independent from W then, in the limit $N \to \infty$ , $\forall \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right)$ with l $\mathrm { { o g } s i n } \alpha \dot { > } d _ { 0 } ^ { - 1 } \log d _ { 0 }$
+
+$$
+\begin{array} { r } { \mathcal { V } \left( \tilde { \mathcal { G } } \right) = \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \right) \dot { \geq } \exp \left( d _ { 0 } d _ { 1 } ^ { * } \log \sin \alpha \right) . } \end{array}
+$$
+
+Second, in appendix section 13.3 we prove
+
+Lemma 22. Let $\mathbf { W } ^ { * } \in \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ a fixed matrix independent of $\mathbf { X }$ . Then, in the limit $N \infty$ with $d _ { 1 } ^ { * } { \dot { \leq } } d _ { 0 } { \dot { \leq } } N$ , the probability of not having an angular margin $\sin \alpha = 1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$ (eq. (10.3)) is upper bounded by
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \leq } \sqrt { \frac { 2 } { \pi } } d _ { 0 } ^ { - 1 / 2 }
+$$
+
+Lastly, in appendix section 13.4 we prove
+
+Lemma 23. Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ be a standard random Gaussian matrix of datapoints. Then we can find, with probability $I$ , $( \mathbf { X } , \mathbf { y } )$ -dependent matrices $\mathbf { W } ^ { * }$ and $\mathbf { z } ^ { \ast }$ as in Theorem 8 (where $d _ { 1 } ^ { * }$ , $4 \ : \lceil N / \left( 2 d _ { 0 } - 2 \right) \rceil $ . Moreover, in the limit $N \to \infty$ , where $N / d _ { 0 } { \dot { \le } } d _ { 0 } { \dot { \le } } N$ , for any y, we can bound the probability of not having an angular margin (eq. (10.3)) with $\sin \alpha = 1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$ by
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \leq } \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N }
+$$
+
+Recall that $\forall \mathbf { X } , \mathbf { y }$ and their corresponding $\mathbf { W } ^ { * }$ , we have $\mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \subset \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right)$ (eq. (10.2)). Thus, combining Lemmas 21 with $\sin \alpha = 1 / \left( \bar { d } _ { 1 } ^ { * } d _ { 0 } N \right)$ together with either Lemma 22 or 23, we prove the first (left) inequality of Theorem 9:
+
+$$
+{ \mathcal { V } } \left( { \mathcal { G } } \left( \mathbf { X } , \mathbf { y } \right) \right) { \dot { \geq } } \exp \left( - d _ { 1 } ^ { * } d _ { 0 } \log N \right)
+$$
+
+Next, if $d _ { 1 } ^ { * } = 2 N / d _ { 0 }$ or $d _ { 1 } ^ { * } { \dot { < } } N / d _ { 0 }$ (is assumption 5 holds), we obtain the second (right) inequality
+
+$$
+\exp \left( - d _ { 1 } ^ { \ast } d _ { 0 } \log N \right) \dot { \geq } \exp \left( - 2 N \log N \right) .
+$$
+
+11 VOLUME RATIO OF GLOBAL AND LOCAL MINIMA: PROOF OF THEOREM 10
+
+Theorem 24. (Theorem 10 restated) Given assumptions 1-3, we set $\delta \doteq \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } +$ $2 d _ { 0 } ^ { 1 / 2 } \sqrt { { \log d _ { 0 } } } / { N }$ . Then, with probability $1 - \delta$ , the angular volume of sub-optimal DLMs, with $\mathrm { M C E } > \epsilon > 0 ,$ , is exponentially vanishing in $N ,$ , in comparison to the angular volume of global minima with $\mathrm { M C E } = 0$
+
+$$
+\frac { \mathscr { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) } { \mathscr { V } \left( \mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \right) } \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) \dot { \leq } \exp \left( - \gamma _ { \epsilon } N \log N \right) .
+$$
+
+To prove this theorem we first calculate the expectation of the angular volume ratio given the $\mathbf { X }$ -event that the bound in Theorem 9 holds (given assumptions 1-3), i.e., $\mathcal { V } \left( \mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \right) \dot { \geq } \dot { \exp } \left( - 2 N \log N \right)$ . Denoting this even $ { \varepsilon } ^ { 6 }$ as $\mathcal { M }$ , we find:
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left[ \frac { \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) } { \mathcal { V } \left( \mathcal { G } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) } | { \mathcal { M } } \right] \overset { ( 1 ) } { \leq } \frac { \mathbb { E } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left[ \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) \big | { \mathcal { M } } \right] } { \exp \left( - 2 N \log N \right) } \overset { ( 2 ) } { \leq } } \\ & { \frac { \mathbb { E } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left[ \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) \right] } { \mathbb { P } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left( { \mathcal { M } } \right) \exp \left( - 2 N \log N \right) } \overset { ( 3 ) } { \leq } \frac { \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) } { \mathbb { P } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left( { \mathcal { M } } \right) \exp \left( - 2 N \log N \right) } \overset { ( 4 ) } { \leq } } \\ & { \quad \quad \frac { \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) } { \exp \left( - 2 N \log N \right) } \overset { ( 5 ) } { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) } \end{array}
+$$
+
+where
+
+1. We apply Theorem 9.
+2. We use the following fact
+
+Fact 25. For any variable $X \geq 0$ and event $\mathcal { A }$ (where $\bar { A }$ is its complement)
+
+$$
+\mathbb { E } \left[ X \right] = \mathbb { E } \left[ X | { \cal { A } } \right] \mathbb { P } \left( { \cal { A } } \right) + \mathbb { E } \left[ X | { \bar { \cal { A } } } \right] ( 1 - \mathbb { P } \left( { \cal { A } } \right) ) \geq \mathbb { E } \left[ X | { \cal { A } } \right] \mathbb { P } \left( { \cal { A } } \right)
+$$
+
+3. We apply Theorem 6.
+
+4. We apply Theorem 9.
+
+5. We use assumption 4, which implies $\gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \dot { > } 2 N \log N .$
+
+For simplicity, in the reminder of the proof we denote
+
+$$
+R \left( \mathbf { X } \right) \triangleq \frac { \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( \mathbf { X } , \mathbf { y } \right) \right) } { \mathcal { V } \left( \mathcal { G } \left( \mathbf { X } , \mathbf { y } \right) \right) } .
+$$
+
+From Markov inequality (Fact 11), since $R \left( { \bf X } \right) \geq 0$ , we have $\forall \eta \left( N \right) > 0$ :
+
+$$
+\mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \geq \eta \left( N \right) \vert \mathcal { M } \right] \leq \frac { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \vert \mathcal { M } \right] } { \eta \left( N \right) }
+$$
+
+On the other hand, from fact 25, we have
+
+$$
+\begin{array} { r } { 1 - \operatorname { \mathbb { P } } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) < \eta \left( N \right) \vert \mathcal { M } \right] \ge 1 - \frac { \operatorname { \mathbb { P } } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) < \eta \left( N \right) \right] } { \operatorname { \mathbb { P } } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) } . } \end{array}
+$$
+
+Combining Eqs. (11.2)-(11.3) we obtain
+
+$$
+\frac { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \vert \mathcal { M } \right] } { \eta \left( N \right) } \geq 1 - \frac { \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) < \eta \left( N \right) \right] } { \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) } ,
+$$
+
+and so
+
+$$
+\mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) - \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) \frac { \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \middle | \mathcal { M } \right] } { \eta \left( N \right) } \leq \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) < \eta \left( N \right) \right] .
+$$
+
+We choose
+
+$$
+\eta \left( { \cal N } \right) = N \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( { \cal M } \right) \mathbb { E } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \vert \mathcal { M } \right] \doteq \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right)
+$$
+
+so that
+
+$$
+\mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) - \frac { 1 } { N } \le \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left[ R \left( \mathbf { X } \right) \dot { \le } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) \right] .
+$$
+
+Then, from Theorem 9 we have
+
+$$
+1 - \mathbb { P } _ { \mathbf { X } \sim \mathcal { N } } \left( \mathcal { M } \right) \dot { \leq } \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N } .
+$$
+
+so we obtain the first (left) inequality in the Theorem (10)
+
+$$
+\sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N } \dot { \geq 1 } - \mathbb { P } _ { { \mathbf { X } } \sim { \mathcal { N } } } \left[ \frac { \mathcal { V } \left( \mathcal { L } _ { \epsilon } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) } { \mathcal { V } \left( \mathcal { G } \left( { \mathbf { X } } , { \mathbf { y } } \right) \right) } \dot { \leq } \exp \left( - \gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \right) \right] .
+$$
+
+Lastly, we note that assumption 4 implies $\gamma _ { \epsilon } N ^ { 3 / 4 } \left[ d _ { 1 } d _ { 0 } \right] ^ { 1 / 4 } \dot { > } N \log N$ , which proves the second (right) inequality of the theorem.
+
+# Part II
+
+# Proofs of technical results
+
+In this part we prove the technical results used in part I.
+
+12 UPPER BOUNDING THE ANGULAR VOLUME OF SUB-OPTIMAL DIFFERENTIABLE LOCAL MINIMA: PROOFS OF LEMMAS USED IN SECTION 8
+
+# 12.1 PROOF OF LEMMA 14
+
+In this section we will prove Lemma 14 in subsection 12.3.3. Recall the following definition Definition 26. Let
+
+$$
+{ \bf A } = [ { \pmb a } _ { 1 } , \ldots , { \pmb a } _ { N } ] \ ; \ { \bf X } = [ { \pmb x } _ { 1 } , \ldots , { \pmb x } _ { N } ] ,
+$$
+
+where $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ and $\mathbf { A } \in \mathbb { R } ^ { d _ { 1 } \times N }$ . The Khatari-Rao product between the two matrices is defined as
+
+$$
+\begin{array} { r l } { \mathbf { A } \circ \mathbf { X } } & { \triangleq } & { \left[ \pmb { a } _ { 1 } \otimes \mathbf { x } _ { 1 } , \pmb { a } _ { 2 } \otimes \mathbf { x } _ { 2 } , . . . \pmb { a } _ { N } \otimes \mathbf { x } _ { N } \right] } \\ & { = } & { \left( \begin{array} { c c c } { a _ { 1 1 } \mathbf { x } _ { 1 } } & { a _ { 1 2 } \mathbf { x } _ { 2 } } & { . . . } \\ { a _ { 2 1 } \mathbf { x } _ { 1 } } & { a _ { 2 2 } \mathbf { x } _ { 2 } } & { \ddots } \\ { \vdots } & { \ddots } & { \ddots } \end{array} \right) . } \end{array}
+$$
+
+Lemma 27. (Lemma 14 restated) Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ , $\mathbf { A } \in \{ \rho , 1 \} ^ { d _ { 1 } \times N }$ , $S \subset [ N ]$ and $d _ { 0 } d _ { 1 } \geq N$ . Then, simultaneously for every possible A and $S$ such that
+
+$$
+\left. S \right. \leq \mathrm { r a n k } \left( { \bf A } _ { S } \right) d _ { 0 } ,
+$$
+
+we have that, X-a.e., $\mathbf { \Delta } \nexists \mathbf { v } \in \mathbb { R } ^ { N }$ such that $v _ { n } \neq 0 \forall n \in S$ and $( \mathbf { A } \circ \mathbf { X } ) \mathbf { v } = 0$
+
+Proof. We examine specific $\mathbf { A } \in \{ \rho , 1 \} ^ { d _ { 1 } \times N }$ and $S \subset [ N ]$ , and such that $| S | \le d _ { S } d _ { 0 }$ , where we defined $d _ { S } \triangleq \operatorname { r a n k } \left( \mathbf { A } _ { S } \right)$ . We assume that $d _ { S } \geq 1$ , since otherwise the proof is trivial. Also, we assume by contradiction that $\exists \mathbf { v } \in \mathbb { R } ^ { N }$ such that $v _ { i } \neq 0 \forall i \in S$ and $( \mathbf { A } \circ \mathbf { X } ) \mathbf { v } = 0$ . Without loss of generality, assume that $S = \{ 1 , 2 , . . . , | S | \}$ and that $\mathbf { } a _ { 1 } , \mathbf { } a _ { 2 } , . . . , \mathbf { } a _ { d _ { S } }$ are linearly independent. Then
+
+$$
+( \mathbf { A } \circ \mathbf { X } ) \mathbf { v } = \sum _ { n = 1 } ^ { | S | } v _ { n } a _ { k , n } \mathbf { x } _ { n } = 0
+$$
+
+for every $1 \leq k \leq d _ { 1 }$ . From the definition of $S$ we must have $v _ { n } \neq 0$ for every $1 \leq n \leq | S |$ . Since $\mathbf { } a _ { 1 } , \mathbf { } a _ { 2 } , . . . , \mathbf { } a _ { d _ { S } }$ are linearly independent, the rows of $\mathbf { A } _ { d _ { S } } = [ \pmb { a } _ { 1 } , \pmb { a } _ { 2 } , . . . , \pmb { a } _ { d _ { S } } ]$ span a $d _ { S }$ -dimensional space. Therefore, it is possible to find a matrix $\mathbf { R }$ such that $\mathbf { R } \mathbf { A } _ { d _ { S } } = [ \mathbf { I } _ { d _ { S } \times d _ { S } } , 0 _ { d _ { S } \times ( d _ { 1 } - d _ { S } ) } ] ^ { \top }$ , where $0 _ { i \times j }$ is the all zeros matrix with $i$ columns and $j$ rows. Consider now $\mathbf { A } _ { S } \circ \mathbf { X } _ { S }$ , i.e., the matrix composed of the columns of $\mathbf { A } \circ \mathbf { X }$ in $S$ . Applying $\mathbf { R } ^ { \prime } = \mathbf { R } \otimes \mathbf { I } _ { d _ { 0 } }$ to $\mathbf { A } _ { S } \circ \mathbf { X } _ { S }$ , turns (12.2) into $d _ { 0 } d _ { S }$ equations in the variables $v _ { 1 } , . . . , v _ { | S | }$ , of the form
+
+$$
+v _ { k } \mathbf { x } _ { k } + \sum _ { n = d _ { S } + 1 } ^ { | S | } v _ { n } { \tilde { a } } _ { k , n } \mathbf { x } _ { n } = 0
+$$
+
+for every $1 \leq k \leq d _ { S }$ . We prove by induction that for every $1 \leq d \leq d _ { S }$ , the first $d _ { 0 } d$ equations are linearly independent, except for a set of matrices $\mathbf { X }$ of measure 0. This will immediately imply $| S | > d _ { S } \dot { d } _ { 0 }$ , or else eq. 12.2 cannot be true for $\mathbf { v } \neq 0$ . which will contradict our assumption, as required. The induction can be viewed as carrying out Gaussian elimination of the system of equations described by (12.3), where in each elimination step we characterize the set of matrices $\mathbf { X }$ that for which that step is impossible, and show it has measure 0.
+
+For $d = 1$ , the first $d _ { 0 }$ equations read $\begin{array} { r } { v _ { 1 } \mathbf { x } _ { 1 } + \sum _ { n = d _ { S } + 1 } ^ { | S | } v _ { n } \tilde { a } _ { 1 , n } \mathbf { x } _ { n } = 0 } \end{array}$ , and since $v _ { 1 } \neq 0$ , we must have $\mathbf { x } _ { 1 } \in \mathrm { S p a n } \left\{ \widetilde { a } _ { 1 , d _ { S } + 1 } \mathbf { x } _ { d _ { S } + 1 } , . . . , \widetilde { a } _ { 1 , | S | } \mathbf { x } _ { | S | } \right\}$ . However, except for a set of measure 0 with respect to $\mathbf { x } _ { 1 }$ (a linear subspace of $\mathbb { R } ^ { d _ { 0 } }$ with dimension less than $d _ { 0 }$ ), this can only happen if dim Span $\left\{ \tilde { a } _ { 1 , d _ { S } + 1 } \mathbf { x } _ { d _ { S } + 1 } , . . . , \tilde { a } _ { 1 , | S | } \mathbf { x } _ { | S | } \right\} = d _ { 0 }$ , which implies $| S | \ge d _ { S } - 1 + d _ { 0 } > d _ { 0 }$ and also that the first $d _ { 0 }$ rows are linearly independent (since there are $d _ { 0 }$ independent columns).
+
+For a general $d$ , we begin by performing Gaussian elimination on the first $( d - 1 ) d _ { 0 }$ equations, resulting in a new set of $r _ { d }$ equations, such that every new equation contains one variable that appears in no other new equation. Let $C$ be the set of the indices (equivalently, columns) of these variables $r _ { d }$ variables. From (12.3) it is clear none of the variables $v _ { d } , v _ { d + 1 } , . . . , v _ { d _ { S } }$ appear in the first $( d - 1 ) d _ { 0 }$ equations, and therefore $C \subseteq S ^ { \prime } = S \setminus \{ d , d + 1 , . . . , d _ { S } \}$ . By our induction assumptions, except for a set of measure 0, the first $( d - 1 ) d _ { 0 }$ are independent, which means that $| C | = r _ { d } = ( d - 1 ) d _ { 0 }$ . We now extend the Gaussian elimination to the next $d _ { 0 }$ equations, and eliminate all the variables in $C$ from them. The result of the elimination can be written down as,
+
+$$
+v _ { d } \mathbf { x } _ { d } + \sum _ { n \in S ^ { \prime } \backslash C } v _ { n } \left( \tilde { a } _ { d , n } \mathbf { I } _ { d _ { 0 } } - \mathbf { Y } \right) \mathbf { x } _ { n } = { 0 } ,
+$$
+
+where $\mathbf { Y }$ is a square matrix of size $d _ { 0 }$ whose coefficients depend only on $\{ \widetilde { a } _ { k , n } \} _ { n \in C , d > k \geq 1 }$ and on $\{ \mathbf { x } _ { n } \} _ { n \in C }$ , and in particular do not depend on $\mathbf { x } _ { d }$ and $\left\{ \mathbf { x } _ { n } \right\} _ { n \in S ^ { \prime } \backslash C }$ .
+
+Now set $\tilde { \mathbf { x } } _ { n } \ = \ ( \tilde { a } _ { d , n } \mathbf { I } _ { d _ { 0 } } - \mathbf { Y } ) \mathbf { x } _ { n }$ for $n \in S ^ { \prime } \setminus C$ . As in the case of $d \ : = \ : 1$ , since $v _ { d } \neq 0$ , $\mathbf { x } _ { d } \in \mathrm { S p a n } \{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C }$ . Therefore, for all values of $\mathbf { x } _ { d } \in \mathbb { R } ^ { d _ { 0 } }$ but a set of measure zero (linear subspace of with dimension less than $d _ { 0 }$ ), we must have di $\begin{array} { r } { \operatorname* { m } \mathrm { { S p a n } } \{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C } = d _ { 0 } } \end{array}$ . From the independence of $\{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C }$ on $\mathbf { x } _ { d }$ it follows that $\mathrm { d i m } \mathrm { S p a n } \{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C } = d _ { 0 }$ holds a.e. with respect to the Lebesgue measure over $\mathbf { x }$ .
+
+Whenever $\mathrm { d i m } \mathrm { S p a n } \{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C } = d _ { 0 }$ we must have $| S ^ { \prime } C | \geq d _ { 0 }$ and therefore
+
+$$
+| S | > | S ^ { \prime } | = | C | + | S ^ { \prime } \setminus C | \geq \left( d - 1 \right) d _ { 0 } + d _ { 0 } = d _ { 0 } d .
+$$
+
+Moreover, $\mathrm { d i m } \mathrm { S p a n } \{ \tilde { \mathbf { x } } _ { n } \} _ { n \in S ^ { \prime } \backslash C } = d _ { 0 }$ implies that the $d _ { 0 }$ equations $\begin{array} { r } { v _ { d } \mathbf { x } _ { d } + \sum _ { n \in S ^ { \prime } \backslash C } v _ { n } \tilde { \mathbf { x } } _ { n } = 0 } \end{array}$ are independent. Thus, we may perform another step of Gaussian elimination on these $d _ { 0 }$ equations, forming $d _ { 0 }$ new equations each with a variable unique to it. Denoting by $C ^ { \prime }$ the set of these $d _ { 0 }$ variables, it is seen from (12.4) that $C ^ { \prime } \subseteq ( S ^ { \prime } \cup \{ d \} ) \setminus C$ and in particular $C ^ { \prime }$ is disjoint from $C$ . Thus, considering the first $( d - 1 ) d _ { 0 }$ equations together with the new $d _ { 0 }$ equations, we see that there is a set $C \cup C ^ { \prime }$ of $d _ { 0 } d$ variables, such that each variable in $C \cup C ^ { \prime }$ appears only in one of the $d _ { 0 } d$ equations, and each of the $d _ { 0 } d$ contains only a single variable in $C \cup C ^ { \prime }$ . This means that the first $d _ { 0 } d$ must be linearly independent for all values of $\mathbf { X }$ except for a set of Lebesgue measure zero, completing the induction.
+
+Thus, we have proven, that for some $\mathbf { A } \in \{ \rho , 1 \} ^ { d _ { 1 } \times N }$ and $S \subset [ N ]$ such that $| S | \leq \mathrm { r a n k } \left( \mathbf { A } _ { S } \right) d _ { 0 }$ the event
+
+$$
+\mathcal E \left( \mathbf A , S \right) = \left\{ \mathbf X \in \mathbb R ^ { d _ { 0 } \times N } | \exists \mathbf v \in \mathbb R ^ { N } : \left( \mathbf A \circ \mathbf X \right) \mathbf v = 0 \mathrm { a n d } v _ { n } \neq 0 , \forall n \in S \right\}
+$$
+
+has zero measure. The event discussed in the theorem is a union of these events:
+
+$$
+\mathcal { E } _ { 0 } \triangleq \bigcup _ { \mathbf { A } \in \{ \rho , 1 \} ^ { d _ { 1 } \times N } } \left[ \bigcup _ { S \subset [ N ] : | S | \leq \operatorname { r a n k } ( \mathbf { A } _ { S } ) d _ { 0 } } \mathcal { E } \left( \mathbf { A } , S \right) \right] ,
+$$
+
+and it also has zero measure, since it is a finite union of zero measure events.
+
+For completeness we note the following corollary, which is not necessary for a our main results.
+
+Corollary 28. If $N \leq d _ { 1 } d _ { 0 }$ , then rank $( \mathbf { A } \circ \mathbf { X } ) = N$ , X-a.e., if and only $i f ,$
+
+$$
+\forall S \subseteq [ N ] : | S | \leq \mathrm { r a n k } \left( \mathbf { A } _ { S } \right) d _ { 0 } .
+$$
+
+Proof. We define $d _ { S } \triangleq \operatorname { r a n k } \left( \mathbf { A } _ { S } \right)$ and $\mathbf { A } \circ \mathbf { X }$ . The necessity of the condition $| S | \le d _ { 0 } d _ { S }$ holds for every $\mathbf { X }$ , as can be seen from the following counting argument. Since the matrix $\mathbf { A } _ { S }$ has rank $d _ { S }$ ,
+
+there exists an invertible row transformation matrix $\mathbf { R }$ , such that $\mathbf { R A } _ { S }$ has only $d _ { S }$ non-zero rows. Consider now $\mathbf { G } _ { S } = \mathbf { A } _ { S } \circ \mathbf { X } _ { S }$ , i.e., the matrix composed of the columns of $\mathbf { G }$ in $S$ . We have
+
+$$
+\mathbf { G } _ { S } ^ { \prime } = ( \mathbf { R } \mathbf { A } _ { S } ) \circ \mathbf { X } _ { S } = \mathbf { R } ^ { \prime } \left( \mathbf { A } _ { S } \circ \mathbf { X } _ { S } \right) = \mathbf { R } ^ { \prime } \mathbf { G } _ { S } ,
+$$
+
+where $\mathbf { R } ^ { \prime } = \mathbf { R } \otimes \mathbf { I } _ { d _ { 0 } }$ is also an invertible row transformation matrix, which applies $\mathbf { R }$ separately on the $d _ { 0 }$ sub-matrices of $\mathbf { G } _ { S }$ that are constructed by taking one every $d _ { 0 }$ rows. Since $\mathbf { G } _ { S } ^ { \prime }$ has at most $d _ { 0 } d _ { S }$ non-zero rows, the rank of $\mathbf { G } _ { S }$ cannot exceed $d _ { 0 } d _ { S }$ . Therefore, if $| S | > d _ { 0 } d _ { S }$ , $\mathbf { G } _ { S }$ will not have full column rank, and hence neither will $\mathbf { G }$ . To demonstrate sufficiency a.e., suppose $\mathbf { G }$ does not have full column rank. Let $S$ be the minimum set of columns of $\mathbf { G }$ which are linearly dependent. Since the columns of $\mathbf { G } _ { S }$ are assumed linearly dependent there exists $\mathbf { v } \in \mathbb { R } ^ { | S | }$ such $\| \mathbf { v } \| _ { 0 } = | S |$ and $\mathbf { G } _ { S } \mathbf { v } = 0$ . Using Lemma 28 we complete the proof. □
+
+# 12.2 PROOF OF LEMMA 15
+
+In this section we will prove Lemma 15 in subsection 12.3.3. This proof relies on two rather basic results, which we first prove in subsections 12.2.1 and 12.2.2.
+
+# 12.2.1 NUMBER OF DICHOTOMIES INDUCED BY A HYPERPLANE
+
+Fact 29. A hyperplane ${ \mathbf w } \in d _ { 0 }$ can separate a given set of points $\mathbf { X } = \left[ \mathbf { x } ^ { ( 1 ) } , \ldots , \mathbf { x } ^ { ( N ) } \right] \in \mathbb { R } ^ { d _ { 0 } \times N }$ into several different dichotomies, i.e., different results for $\mathrm { s i g n } \left( \mathbf { w } ^ { \top } \mathbf { X } \right)$ . The number of dichotomies is upper bounded as follows:
+
+$$
+\sum _ { \mathbf { h } \in \{ - 1 , 1 \} ^ { N } } \mathscr { T } \left( \exists \mathbf { w } : \mathrm { s i g n } \left( \mathbf { w } ^ { \top } \mathbf { X } \right) = \mathbf { h } ^ { \top } \right) \leq 2 \sum _ { k = 0 } ^ { d _ { 0 } - 1 } \left( \begin{array} { l } { N - 1 } \\ { k } \end{array} \right) \leq 2 N ^ { d _ { 0 } } .
+$$
+
+Proof. See (Cover, 1965, Theorem 1) for a proof of the left inequality as equality (the Schläfli Theorem) in the case that the columns of $\mathbf { X }$ are in “general position” (which holds $\mathbf { X }$ -a.e, see definition in (Cover, 1965)) . If $\mathbf { X }$ is not in general position then this result becomes an upper bound, since some dichotomies might not be possible.
+
+Next, we prove the right inequality. For $N = 1$ and $N = 2$ the inequality trivially holds. For $N \geq 3$ , we have
+
+$$
+2 \sum _ { k = 0 } ^ { d _ { 0 } - 1 } \left( \begin{array} { c } { { N - 1 } } \\ { { k } } \end{array} \right) \stackrel { \left( 1 \right) } { \leq } 2 \sum _ { k = 0 } ^ { d _ { 0 } - 1 } \left( N - 1 \right) ^ { k } \stackrel { \left( 2 \right) } { \leq } 2 \frac { \left( N - 1 \right) ^ { d _ { 0 } } - 1 } { N - 2 } \leq 2 N ^ { d _ { 0 } } .
+$$
+
+where in (1) we used the bound $\left( \begin{array} { c } { { N } } \\ { { k } } \end{array} \right) \le N ^ { k }$ , in (2) we used the sum of a geometric series.
+
+# 12.2.2 A BASIC PROBABILISTIC BOUND
+
+Lemma 30. Let $\mathbf { H } = \left[ \mathbf { h } _ { 1 } ^ { \top } , \ldots , \mathbf { h } _ { d _ { 1 } } ^ { \top } \right] ^ { \top } \in \{ - 1 , 1 \} ^ { d _ { 1 } \times k }$ be a deterministic binary matrix, ${ \textbf { W } } =$ $\left[ \mathbf { w } _ { 1 } ^ { \top } , \ldots , \mathbf { w } _ { d _ { 1 } } ^ { \top } \right] ^ { \top } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ be an independent standard random Gaussian matrix, and $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times k }$ be a random matrix with independent and identically distributed columns.
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \operatorname { s i g n } \left( { \mathbf { W } } { \mathbf { X } } \right) = { \mathbf { H } } \right) \leq \left( \begin{array} { c } { k } \\ { \lfloor k / 2 \rfloor } \end{array} \right) \mathbb { P } \left( { \mathbf { W } } { \mathbf { X } } _ { [ \lfloor k / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+Proof. By direct calculation
+
+$$
+\begin{array} { r l } { \displaystyle \widehat { \mathbf { \xi } } \displaystyle \geq ( \mathrm { s i g n } ( \mathbf { W X } ) = \mathbf { H } ) = } & { \displaystyle \mathbb { E } [ \mathbb { P } ( \mathrm { s i g n } ( \mathbf { W X } ) = \mathbf { H } \vert \mathbf { X } ) ] \stackrel { ( 1 ) } { = } \mathbb { E } [ \displaystyle \prod _ { i = 1 } ^ { d } \mathbb { P } ( \mathrm { s i g n } ( \mathbf { w } _ { i } ^ { \top } \mathbf { X } ) = \mathbf { h } _ { i } ^ { \top } \vert \mathbf { X } ) ] } \\ & { \stackrel { ( 2 ) } { \leq } \mathbb { E } [ \displaystyle \prod _ { i = 1 } ^ { d _ { 1 } } \mathbb { P } ( \mathbf { w } _ { i } ^ { \top } \mathbf { X } _ { \delta ( \mathbf { h } _ { i } ) } > 0 \vert \mathbf { X } ) ] \stackrel { ( 3 ) } { \leq } \mathbb { E } [ \displaystyle \prod _ { i = 1 } ^ { d _ { 1 } } \mathbb { P } ( \mathbf { w } _ { i } ^ { \top } \mathbf { X } _ { S _ { i } } > 0 \vert \mathbf { X } ) ] } \\ & { \stackrel { ( 4 ) } { = } \mathbb { E } [ \mathbb { P } ( \mathbf { W X } _ { S _ { s } } > 0 \vert \mathbf { X } ) ] \stackrel { ( 5 ) } { \leq } \mathbb { E } [ \displaystyle \sum _ { S \geq [ R _ { 1 } ] : S \mid = \lfloor k / 2 \rfloor } } \\ & { = \displaystyle \sum _ { S \leq [ k ] : S = \lfloor k / 2 \rfloor } \mathbb { E } [ \mathbb { P } ( \mathbf { W X } _ { S } > 0 \vert \mathbf { X } ) ] \stackrel { ( 6 ) } { = } ( \begin{array} { l } { k } \\ { \lfloor k / 2 \rfloor } \end{array} ) \mathbb { P } ( \mathbf { W } _ { \mathbf { X } _ { \lfloor k / 2 \rfloor } } > 0 ) . } \end{array}
+$$
+
+where
+
+1. We used the independence of the $\mathbf { w } _ { i }$ .
+
+2. We define $\hat { S } _ { \pm } \left( \mathbf { h } \right) \ \triangleq \ \left\{ S \subset \left[ k \right] : \pm \mathbf { h } _ { S } ^ { \top } > 0 \right\}$ as the sets in which $\mathbf { h }$ is always positive/negative, and $\hat { S } \left( \mathbf { h } \right)$ as the maximal set between these two. Note that $\mathbf { w } _ { i }$ has a standard normal distribution which is symmetric to sign flips, so $\forall S : \mathbb { P } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { X } _ { S } > 0 | \mathbf { X } \right) =$ $\mathbb { P } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { X } _ { S } < 0 | \mathbf { X } \right)$ .
+
+3. Note that $\left| \hat { S } \left( \mathbf { h } \right) \right| \ge \lfloor k / 2 \rfloor$ . Therefore, we define S∗ = argmax $\mathbb { P } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { X } _ { S } > 0 | \mathbf { X } \right)$ . $S C [ k ] : \bar { | } S | = \lfloor k / 2 \rfloor$
+
+4. We used the independence of the $\mathbf { w } _ { i }$
+
+5. The maximum is a single term in the following sum of non-negative terms.
+
+6. Taking the expectation over $\mathbf { X }$ , since the columns of $\mathbf { X }$ are independent and identically distributed, the location of $S$ does not affect the probability. Therefore, we can set without loss of generality $S = [ \lfloor k / 2 \rfloor ]$ .
+
+# 12.2.3 MAIN PROOF: BOUND ON THE NUMBER OF CONFIGURATIONS FOR A BINARY MATRIX WITH CERTAIN RANK
+
+Recall the function $a \left( \cdot \right)$ from eq. (2.1):
+
+$$
+a \left( u \right) \triangleq \left\{ \begin{array} { l l } { 1 } & { , \mathrm { i f } , u > 0 } \\ { \rho } & { , \mathrm { i f } u < 0 } \end{array} \right. .
+$$
+
+where $\rho \neq 1$
+
+Lemma 31. (Lemma 15 restated). Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times k }$ be a random matrix with independent and identically distributed columns, and $\mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ an independent standard random Gaussian matrix. Then, in the limit $\operatorname* { m i n } \left[ k , d _ { 0 } , d _ { 1 } \right] \dot { > } r$ ,
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathrm { r a n k } \left( a \left( \mathbf { W } \mathbf { X } \right) \right) = r \right) \dot { \leq } 2 ^ { k + r d _ { 0 } ( \log d _ { 1 } + \log k ) + r ^ { 2 } } \mathbb { P } \left( \mathbf { W } \mathbf { X } _ { [ \lfloor k / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+Proof. We denote $\mathbf { A } = a \left( \mathbf { W } \mathbf { X } \right) \in \{ \rho , 1 \} ^ { d _ { 1 } \times k }$ . For any such A for which rank $( \mathbf { A } ) = r$ , we have a collection of $r$ rows that span the remaining rows. There are $\left( \begin{array} { c } { d _ { 1 } } \\ { r } \end{array} \right)$ possible locations for these $r$ spanning rows. In these rows there exist a collection of $r$ columns that span the remaining columns. There are $\left( \begin{array} { l } { k } \\ { r } \end{array} \right)$ possible locations for these $r$ spanning columns. At the intersection of the spanning rows and columns, there exist a full rank sub-matrix D. We denote $\tilde { \mathbf { A } }$ as the matrix A which rows and columns are permuted so that $\mathbf { D }$ is the lower right block
+
+$$
+\begin{array} { r } { \tilde { \mathbf { A } } \triangleq \left( \begin{array} { l l } { \mathbf { Z } } & { \mathbf { B } } \\ { \mathbf { C } } & { \mathbf { D } } \end{array} \right) = a \left( \begin{array} { l l } { \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } } & { \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } } \\ { \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } } & { \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } } \end{array} \right) , } \end{array}
+$$
+
+where $\mathbf { D }$ is an invertible $r \times r$ matrix, and we divided $\mathbf { X }$ and $\mathbf { W }$ to the corresponding block matrices
+
+$$
+\mathbf { W } \triangleq \left[ \mathbf { W } _ { 1 } ^ { \top } , \mathbf { W } _ { 2 } ^ { \top } \right] ^ { \top } , \mathbf { X } \triangleq \left[ \mathbf { X } _ { 1 } , \mathbf { X } _ { 2 } \right] ,
+$$
+
+with $\mathbf { W } _ { 2 } \in \mathbb { R } ^ { r \times d _ { 0 } }$ rows and $\mathbf { X } _ { 2 } \in \mathbb { R } ^ { d _ { 0 } \times r }$ .
+
+Since $\mathrm { r a n k } \left( \tilde { \mathbf { A } } \right) = r$ , the first $d _ { 1 } - r$ rows are contained in the span of the last $r$ rows. Therefore, there exists a matrix $\mathbf { Q }$ such that $\mathbf { Q C } = \mathbf { Z }$ and $\mathbf { Q D } = \mathbf { B }$ . Since $\mathbf { D }$ is invertible, this implies that ${ \bf Q } = { \bf B } { \bf D } ^ { - 1 }$ and therefore
+
+$$
+{ \bf Z } = { \bf B } { \bf D } ^ { - 1 } { \bf C } ,
+$$
+
+i.e., $\mathbf { B } , \mathbf { C }$ and $\mathbf { D }$ uniquely determine $\mathbf { Z }$ .
+
+Using the union bound over all possible permutations from $\mathbf { A }$ to $\tilde { \mathbf { A } }$ , and eq. (12.9), we have
+
+$$
+\begin{array} { r l r } & { \mathbb { P } ( \mathrm { r a n k } ( \mathbf { A } ) = r ) } & { ( 1 2 . 1 0 ) } \\ & { \leq ( \begin{array} { l } { d _ { 1 } } \\ { r } \end{array} ) ( \begin{array} { l } { k } \\ { r } \end{array} ) \mathbb { P } ( \mathrm { r a n k } ( \bar { \mathbf { A } } ) = r ) } \\ & { \leq ( \begin{array} { l } { d _ { 1 } } \\ { r } \end{array} ) ( \begin{array} { l } { k } \\ { r } \end{array} ) \mathbb { P } ( \mathbf { Z } = \mathbf { B } \mathbf { D } ^ { - 1 } \mathbf { C } ) } \\ & { = ( \begin{array} { l } { d _ { 1 } } \\ { r } \end{array} ) ( \begin{array} { l } { k } \\ { r } \end{array} ) \mathbb { P } ( a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) [ a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ] ^ { - 1 } a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) ) } \\ & = ( \begin{array} { l } { d _ { 1 } } \\ { r } \end{array} ) ( \begin{array} { l } { k } \\ { r } \end{array} ) \underbrace { \mathrm { H } ( a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) [ a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ] ^ { - 1 } a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = a ( \mathbf { H } ) | \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) = \mathbf { H } ) \mathbb { P } ( \mathrm { s i g n } ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ) } \end{array}
+$$
+
+Using Lemma 30, we have
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathrm { s i g n } \left( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } \right) = \mathbf { H } \right) \leq \left( \begin{array} { c } { k - r } \\ { \lfloor ( k - r ) / 2 \rfloor } \end{array} \right) \mathbb { P } \left( \mathbf { W } _ { 1 } \mathbf { X } _ { \lfloor \lfloor ( k - r ) / 2 \rfloor \rfloor } > 0 \right) , } \end{array}
+$$
+
+an upper bound which does not depend on $\mathbf { H }$ . So all that remains is to compute the sum:
+
+$$
+\begin{array} { r l } & { \qquad \displaystyle \sum _ { \mathbf { H } \in \{ - 1 , 1 \} ^ { ( d _ { 1 } - r ) \times ( k - r ) } } \mathbb { P } ( a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) [ a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ] ^ { - 1 } a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = a ( \mathbf { H } ) | \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) = \mathbf { H } ) } \\ { = } & { \qquad \displaystyle \sum _ { \mathbf { H } \in \{ - 1 , 1 \} ^ { ( d _ { 1 } - r ) \times ( k - r ) } } \mathbb { E } [ \mathbb { P } ( a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) [ a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ] ^ { - 1 } a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = a ( \mathbf { H } ) | \mathbf { W } _ { 1 } , \mathbf { X } _ { 1 } ) | \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) = \mathbf { H } } \\ & { \mathrm { H } _ { 1 } ^ { 1 } [ \displaystyle \sum _ { \mathbf { H } \in \{ - 1 , 1 \} ^ { ( d _ { 1 } - r ) \times ( k - r ) } } \mathbb { Z } ( \exists ( \mathbf { W } _ { 2 } , \mathbf { X } _ { 2 } ) : a ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) [ a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } ) ] ^ { - 1 } a ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = a ( \mathbf { H } ) ) ] \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) = \mathbf { H } } \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \overset { 2 } { \leq } \mathbb { R } [ 2 ^ { r ^ { 2 } } [ \displaystyle \sum _ { \mathbf { H } \in \{ - 1 , 1 \} ^ { ( d _ { \mathbf { X } } _ { 2 } : \mathrm { ~ s i g n } } } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } ) = \mathbf { H } ) ] [ \displaystyle \sum _ { \mathbf { H } \in \{ - 1 , 1 \} ^ { r \times ( k - r ) } } \mathbb { Z } ( \exists \mathbf { W } _ { 2 } : \mathrm { s i g n } ( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } ) = \mathbf { H } ) ] ] | \mathrm { s i g n } } \\ & { \leq \mathbb { R } [ 2 ^ { r ^ { 2 } } [ \displaystyle \sum _ { \mathbf { h } \in \{ - 1 , 1 \} ^ { ( d _ { \mathbf { X } } : \mathrm { s i g n } } } ( \mathbf { W } _ { 1 } \mathbf { x } ) = \mathbf { h } ) ] ^ { r } [ \displaystyle \sum _ { \mathbf { h } \in \{ - 1 , 1 \} ^ { ( k - r ) } } \mathbb { Z } ( \exists \mathbf { w } : \mathrm { s i g n } ( \mathbf { w } ^ { \mathsf { T } } \mathbf { X } _ { 1 } ) = \mathbf { h } ^ { \mathsf { T } } ) ] ^ { r } ] | \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) } \\ & { \overset { 3 } { \leq } \mathbb { R } [ 2 ^ { r ^ { 2 } } 2 ^ { r d _ { 0 } \log ( d _ { 1 } - r ) + r _ { 2 } r d _ { 0 } \log ( k - r ) + r } ] | \mathrm { s i g n } ( \mathbf { W } _ { 1 } \mathbf { X } _ { 1 } ) = \mathbf { H } ] } \\ & { = 2 ^ { r d _ { 0 } [ \log ( d _ { 1 } - r ) + \log ( k - r ) ] + r ^ { 2 } + 2 r } , } \end{array}
+$$
+
+where
+
+1. Given $( \mathbf { W } _ { 1 } , \mathbf { X } _ { 1 } )$ , and eq. (12.8), the indicator function in eq. (12.12) is equal to zero only if $\begin{array} { r } { \mathbb { P } \left( a \left( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } \right) \left[ a \left( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } \right) \right] ^ { - 1 } a \left( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } \right) = \mathbf { A } \mathbf { | } \mathbf { W } _ { 1 } , \mathbf { X } _ { 1 } \right) = 0 } \end{array}$ , and one otherwise.
+
+2. This sum counts the number of values of $\mathbf { H }$ consistent with $\mathbf { W } _ { 1 }$ and $\mathbf { X } _ { 1 }$ . Conditioned on $( \mathbf { W } _ { 1 } , \mathbf { X } _ { 1 } ) , \mathbf { D } = \left[ a \left( \mathbf { W } _ { 2 } \mathbf { X } _ { 2 } \right) \right] ^ { - 1 } , \mathbf { B } = a \left( \mathbf { W } _ { 1 } \mathbf { X } _ { 2 } \right)$ and $\mathbf { C } = a \left( \mathbf { W } _ { 2 } \mathbf { X } _ { 1 } \right)$ can have multiple values, depending on $\mathbf { W } _ { 2 }$ and $\mathbf { X } _ { 2 }$ . Also, any single value for $( { \bf D } , { \bf B } , { \bf C } )$ results in a single value of $\mathbf { H }$ . Therefore, the number of possible values of $\mathbf { H }$ in eq. (12.12) is upper bounded by the product of the number of possible values of $\mathbf { D }$ , $\mathbf { B }$ and $\mathbf { C }$ , which is product in the following equation.
+
+3. The function $\begin{array} { r } { \sum _ { \mathbf { h } \in \{ - 1 , 1 \} ^ { ( k - r ) } } \mathscr { T } \left( \exists \mathbf { w } : \mathrm { s i g n } \left( \mathbf { w } ^ { \top } \mathbf { X } _ { 1 } \right) = \mathbf { h } ^ { \top } \right) } \end{array}$ counts the number of dichotomies that can be induced by the linear classifier w on $\mathbf { X } _ { 1 }$ . Using eq. (12.7) we can bound this number by $2 \left( k - r \right) ^ { d _ { 0 } }$ . Similarly, the other sum can be bounded by $2 \left( d _ { 1 } - r \right) ^ { r }$ .
+
+Combining eqs. (12.10), (12.11) and (12.13) we obtain
+
+$$
+\begin{array} { r l } & { \mathbb { P } \left( \mathrm { r a n k } \left( \mathbf { A } \right) = r \right) \leq } \\ & { \left( \begin{array} { l } { d _ { 1 } } \\ { r } \end{array} \right) \left( \begin{array} { l } { k } \\ { r } \end{array} \right) \left( \begin{array} { c } { k - r } \\ { \lfloor ( k - r ) / 2 \rfloor } \end{array} \right) 2 ^ { r d _ { 0 } \left[ \log ( d _ { 1 } - r ) + \log ( k - r ) \right] + r ^ { 2 } + 2 r } \mathbb { P } \left( \mathbf { W } _ { 1 } \mathbf { X } _ { [ \lfloor ( k - r ) / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+Next, we take the log. To upper bound $\left( \begin{array} { c } { { N } } \\ { { k } } \end{array} \right)$ , for small $k$ we use $\left( \begin{array} { c } { { N } } \\ { { k } } \end{array} \right) \le N ^ { k }$ , while for $k = N / 2$ , we use $\left( \begin{array} { c } { { N } } \\ { { N / 2 } } \end{array} \right) \le 2 ^ { N }$ . Thus, we obtain
+
+$$
+\begin{array} { r l r } & { } & { \log \mathbb { P } \left( \mathrm { r a n k } \left( \mathbf { A } \right) = r \right) \leq \left( r d _ { 0 } \left( \log \left( d _ { 1 } - r \right) + \log \left( k - r \right) \right) + r ^ { 2 } + 2 r \right) \log 2 \qquad ( 1 2 \triangle ( r \mathrm { ~ o ~ t ~ } r ) } \\ & { } & { + r \log d _ { 1 } + r \log k + ( k - r ) \log 2 + \log \mathbb { P } \left( \mathbf { W } _ { 1 } \mathbf { X } _ { [ \vert ( k - r ) / 2 ] ] } > 0 \right) . } \end{array}
+$$
+
+Recalling that $\mathbf { W } _ { 1 } \in \mathbb { R } ^ { ( d _ { 1 } - r ) \times d _ { 0 } }$ while $\mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ , we obtain from Jensen’s inequality
+
+$$
+\begin{array} { r } { \log \mathbb { P } \left( \mathbf { W } _ { 1 } \mathbf { X } _ { [ \lfloor ( k - r ) / 2 \rfloor ] } > 0 \right) \le \frac { \left\lfloor \left( k - r \right) / 2 \right\rfloor \left\lfloor d _ { 1 } - r \right\rfloor } { \left\lfloor k / 2 \right\rfloor \left\lfloor d _ { 1 } \right\rfloor } \log \mathbb { P } \left( \mathbf { W } \mathbf { X } _ { [ \lfloor k / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+Taking the limit $\mathrm { n i n } \left[ k , d _ { 0 } , d _ { 1 } \right] \dot { > } r$ on eqs. (12.14) and (12.15) we obtain
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathrm { r a n k } \left( \mathbf { A } \right) = r \right) \overset { * } { \leq } 2 ^ { k + r d _ { 0 } ( \log d _ { 1 } + \log k ) + t ^ { 2 } } \mathbb { P } \left( { \mathbf { W } } \mathbf { X } _ { [ \lfloor k / 2 \rfloor ] } > 0 \right) . } \end{array}
+$$
+
+# 12.3 PROOF OF LEMMA 16
+
+In this section we will prove Lemma 16 in subsection 12.3.3. This proof relies on more elementary results, which we first prove in subsections 12.3.1 and 12.3.2.
+
+# 12.3.1 ORTHANT PROBABILITY OF A RANDOM GAUSSIAN VECTOR
+
+Recall that $\phi \left( x \right)$ and $\Phi \left( x \right)$ are, respectively, the probability density function and cumulative distribution function for a scalar standard normal random variable.
+
+Definition 32. We define the following functions $\forall x \geq 0$
+
+$$
+\begin{array} { l } { \displaystyle { g \left( x \right) \triangleq \frac { x \Phi \left( x \right) } { \phi \left( x \right) } , } } \\ { \displaystyle { \psi \left( x \right) \triangleq \frac { \left( g ^ { - 1 } \left( x \right) \right) ^ { 2 } } { 2 x } - \log \left( \Phi \left( g ^ { - 1 } \left( x \right) \right) \right) , } } \end{array}
+$$
+
+where the inverse function $g ^ { - 1 } ( x ) : [ 0 , \infty ) [ 0 , \infty )$ is well defined since $g \left( x \right)$ monotonically increase from 0 to $\infty$ , for $x \geq 0$ .
+
+Lemma 33. Let $\mathbf { z } \sim \mathcal { N } ( 0 , \pmb { \Sigma } )$ be a random Gaussian vector in $\mathbb { R } ^ { K }$ , with a covariance matrix $\Sigma _ { i j } = \left( 1 - \theta K ^ { - 1 } \right) \delta _ { m n } + \theta K ^ { - 1 }$ where $K \gg \theta > 0$ . Then, recalling $\psi \left( \theta \right)$ in eq. (12.17), we have
+
+$$
+\begin{array} { r } { \log \mathbb { P } \left( \forall i : z _ { i } > 0 \right) \le - K \psi \left( \theta \right) + O \left( \log K \right) . } \end{array}
+$$
+
+Proof. Note that we can write $\mathbf { z } = \mathbf { u } + \eta$ , where $\mathbf { u } \sim { \mathcal { N } } \left( 0 , \left( 1 - \theta K ^ { - 1 } \right) \mathbf { I } _ { K } \right)$ , and $\eta \sim \mathcal { N } \left( 0 , \theta K ^ { - 1 } \right)$ . Using this notation, we have
+
+$$
+\begin{array} { r l } & { \quad \mathbb { P } \left( \overline { { \psi } } : z _ { i } > 0 \right) } \\ & { = \int _ { - \infty } ^ { \infty } d \eta \left[ \displaystyle \prod _ { i = 1 } ^ { K } \int _ { - \infty } ^ { \infty } d u _ { i } \mathcal { T } \left( \sqrt { 1 - \theta K ^ { - 1 } } u _ { i } + \sqrt { \theta K ^ { - 1 } } \eta > 0 \right) \phi \left( u _ { i } \right) \right] \phi \left( \eta \right) } \\ & { = \int _ { - \infty } ^ { \infty } d \eta \left[ \Phi \left( \sqrt { \frac { \theta K ^ { - 1 } } { 1 - \theta K ^ { - 1 } } } \eta \right) \right] ^ { K } \phi \left( \eta \right) } \\ & { \stackrel { ( 1 ) } { = } \sqrt { \displaystyle \frac { \theta } { 2 \pi \left( K - \theta \right) } } \int _ { - \infty } ^ { \infty } d \xi \left[ \Phi \left( \xi \right) \right] ^ { K } \exp \left( - \frac { \left( K - \theta \right) \xi ^ { 2 } } { 2 \theta } \right) } \\ & { = \sqrt { \displaystyle \frac { \theta } { 2 \pi \left( K - \theta \right) } } \int _ { - \infty } ^ { \infty } d \xi \exp \left( \frac { \xi ^ { 2 } } { 2 } \right) \exp \left[ K \left( \log \Phi \left( \xi \right) - \frac { \xi ^ { 2 } } { 2 \theta } \right) \right] , } \end{array}
+$$
+
+where in (1) we changed the variable of integration to $\xi = \sqrt { \theta / \left( K - \theta \right) } \eta$ . We denote, for a fixed $\theta$
+
+$$
+\begin{array} { l } { { \displaystyle q \left( \xi \right) \triangleq \log \Phi \left( \xi \right) - \frac { \xi ^ { 2 } } { 2 \theta } } } \\ { { \displaystyle h \left( \xi \right) \triangleq \sqrt { \frac { \theta } { 2 \pi \left( K - \theta \right) } } \exp \left( \frac { \xi ^ { 2 } } { 2 } \right) } } \end{array}
+$$
+
+and $\xi _ { 0 }$ as its global maximum. Since $q$ is twice differentiable, we can use Laplace’s method (e.g., (Butler, 2007)) to simplify eq. (12.18)
+
+$$
+\log \int _ { - \infty } ^ { \infty } h \left( \xi \right) \exp \left( K q \left( \xi \right) \right) d \xi = K q \left( \xi _ { 0 } \right) + O \left( \log K \right) .
+$$
+
+To find $\xi _ { 0 }$ , we differentiate $q \left( \xi \right)$ and equate to zero to obtain
+
+$$
+q ^ { \prime } \left( \xi \right) = \frac { \phi \left( \xi \right) } { \Phi \left( \xi \right) } - \frac { 1 } { \theta } \xi = 0 .
+$$
+
+which implies (recall eq. (12.16))
+
+$$
+g \left( \xi \right) \triangleq \frac { \xi \Phi \left( \xi \right) } { \phi \left( \xi \right) } = \theta .
+$$
+
+This is a monotonically increasing function from 0 to $\infty$ in the range $\xi \ge 0$ . Its inverse function can also be defined in that range $g ^ { - 1 } \check { ( \theta ) } : [ 0 , \infty ] [ 0 , \infty ]$ . This implies that this equation has only one solution, $\xi _ { 0 } = g ^ { - 1 } \left( \theta \right)$ . Since $\begin{array} { r } { \operatorname* { l i m } _ { \xi \to \infty } q \left( \xi \right) = - \infty } \end{array}$ , this $\xi _ { 0 }$ is indeed the global maximum of $q \left( \xi \right)$ Substituting this solution into $q \left( \xi \right)$ , we get (recall eq. (12.17))
+
+$$
+\forall \theta > 0 : q \left( \xi _ { 0 } \right) = - \psi \left( \theta \right) = q \left( g ^ { - 1 } \left( \theta \right) \right) = \log \left( \Phi \left( g ^ { - 1 } \left( \theta \right) \right) \right) - \frac { \left( g ^ { - 1 } \left( \theta \right) \right) ^ { 2 } } { 2 \theta } .
+$$
+
+Using eq. (12.18), (12.21) and (12.24) we obtain:
+
+$$
+\begin{array} { l } { \displaystyle \log \mathbb { P } \left( \forall i : z _ { i } > 0 \right) } \\ { = \log \left[ \int _ { - \infty } ^ { \infty } d \xi \exp \left( \frac { \xi ^ { 2 } } { 2 } \right) \exp \left[ K \left( \log \Phi \left( \xi \right) - \frac { \xi ^ { 2 } } { 2 \theta } \right) \right] \right] + O \left( \log K \right) } \\ { = - K \psi \left( \theta \right) + O \left( \log K \right) . } \end{array}
+$$
+
+Next, we generalize the previous Lemma to a general covariance matrix.
+
+Corollary 34. Let $\mathbf { u } \sim \mathcal { N } ( 0 , \pmb { \Sigma } )$ be a random Gaussian vector in $\mathbb { R } ^ { K }$ for which $\forall n : \Sigma _ { n n } = 1$ , and $\theta \geq K \operatorname* { m a x } _ { n , m : n \neq m } \Sigma _ { n m } > 0$ . Then, again, for large $K$
+
+$$
+\begin{array} { r } { \log \mathbb { P } \left( \forall i : u _ { i } > 0 \right) \le - K \psi \left( \theta \right) + O \left( \log K \right) . } \end{array}
+$$
+
+Proof. We define $\tilde { \mathbf { u } } \sim \mathcal { N } \left( 0 , \tilde { \Sigma } \right)$ , with $\tilde { \Sigma } _ { m n } = \left( 1 - \theta K ^ { - 1 } \right) \delta _ { m n } + \theta K ^ { - 1 }$ . Note that $\forall n : \Sigma _ { n n } =$ $\tilde { \Sigma } _ { n n } = 1$ and $\forall m \neq n$ : $\Sigma _ { m n } \leq \tilde { \Sigma } _ { m n }$ . Therefore, from Slepian’s Lemma (Slepian, 1962, Lemma 1),
+
+$$
+\mathbb { P } \left( \forall n : \tilde { u } _ { n } > 0 \right) \ge \mathbb { P } \left( \forall n : u _ { n } > 0 \right) .
+$$
+
+Using Lemma 33 on $\tilde { \mathbf { u } }$ completes the proof.
+
+# 12.3.2 MUTUAL COHERENCE BOUNDS
+
+Definition 35. We define the mutual coherence of the columns of a matrix $\mathbf { A } = [ \pmb { a } _ { 1 } , \cdots , \pmb { a } _ { N } ] \in$ $\mathbb { R } ^ { M \times N }$ as the maximal angle between different columns
+
+$$
+\gamma \left( { \bf A } \right) \triangleq \operatorname* { m a x } _ { i , j : i \neq j } \frac { \left| { \pmb a } _ { i } ^ { \top } { \pmb a } _ { j } \right| } { \left\| { \pmb a } _ { i } \right\| \left\| { \pmb a } _ { j } \right\| } .
+$$
+
+Note that $\gamma \left( \mathbf { A } \right) \leq 1$ and from (Welch, 1974), for $\begin{array} { r } { N \ge M , \gamma \left( { \mathbf { A } } \right) \ge \sqrt { \frac { N - M } { M \left( N - 1 \right) } } . } \end{array}$
+
+Lemma 36. Let $\mathbf { A } = [ \pmb { a } _ { 1 } , \cdot \cdot \cdot , \pmb { a } _ { N } ] \in \mathbb { R } ^ { M \times N }$ be a standard random Gaussian matrix, and $\gamma \left( \mathbf { A } \right)$ is the mutual coherence of it columns (see definition 35). Then
+
+$$
+\mathbb { P } \left( \gamma \left( { \bf A } \right) > \epsilon \right) \le 2 N ^ { 2 } \exp \left( - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) .
+$$
+
+Proof. In this case, we have from (Chen & Peng, 2016, Appendix 1):
+
+$$
+\mathbb { P } \left( \gamma \left( \mathbf { A } \right) > \epsilon \right) \leq N \left( N - 1 \right) \left[ \exp \left( - \frac { M a ^ { 2 } \epsilon ^ { 2 } } { 4 \left( 1 + \epsilon / 2 \right) } \right) + \exp \left( - \frac { M } { 4 } \left( 1 - a \right) ^ { 2 } \right) \right] ,
+$$
+
+for any $a \in ( 0 , 1 )$ . Setting $a = 1 - \epsilon / 2$
+
+$$
+\begin{array} { r l } & { \mathbb { P } \left( \gamma \left( \mathbf { A } \right) > \epsilon \right) \le N \left( N - 1 \right) \left[ \exp \left( - \frac { M \left( 1 - \epsilon / 2 \right) ^ { 2 } \epsilon ^ { 2 } } { 4 \left( 1 + \epsilon / 2 \right) } \right) + \exp \left( - \frac { M } { 1 6 } \epsilon ^ { 2 } \right) \right] } \\ & { \qquad \overset { \left( 1 \right) } { \le } N \left( N - 1 \right) \left[ \exp \left( - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) + \exp \left( - \frac { M } { 1 6 } \epsilon ^ { 2 } \right) \right] } \\ & { \qquad \le 2 N ^ { 2 } \exp \left( - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) , } \end{array}
+$$
+
+where in (1) we can assume that $\epsilon \leq 1$ , since for $\epsilon \geq 1$ , we have $\mathbb { P } \left( \gamma \left( \mathbf { A } \right) > \epsilon \right) = 0$ (recall $\gamma ( \mathbf { A } ) \leq 1 )$ . □
+
+Lemma 37. Let $\mathbf { B } = [ \mathbf { b } _ { 1 } , \cdots , \mathbf { b } _ { L } ] \in \mathbb { R } ^ { M \times L }$ be a standard random Gaussian matrix and mutual coherence $\gamma$ as in definition 35. Then, $\forall \epsilon > 0$ and $\forall K \in [ L ]$ :
+
+$$
+\mathbb { P } \left( \operatorname* { m i n } _ { S \subset [ N ] : | S | = K } \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) \leq \exp \left[ \left( 2 \log \left( 2 K \right) - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) \left( \frac { L } { K } - 1 \right) \right] .
+$$
+
+Proof. We upper bound this probability by partitioning the set of column vectors into $\lfloor L / K \rfloor$ subsets $S _ { i }$ of size $| \bar { S _ { i } } \bar { | } = K$ and require that in each subset the mutual coherence is lower bounded by $\epsilon$ .
+
+Since the columns are independent, we have
+
+$$
+\begin{array} { r l } & { \mathbb { P } \left( \underset { S \subset [ N ] : | S | = K } { \operatorname* { m i n } } \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) } \\ & { \le \displaystyle \prod _ { i = 1 } ^ { \lfloor L / K \rfloor } \mathbb { P } \left( \forall S = \{ 1 + \left( i - 1 \right) K , 2 + \left( 1 - i \right) K , \ldots , i K \} : \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) } \\ & { \stackrel { \mathrm { ( 1 ) } } { \le } \displaystyle \prod _ { i = 1 } ^ { L / K - 1 } 2 K ^ { 2 } \exp \left( - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) } \\ & { \le \exp \left[ \left( 2 \log \left( 2 K \right) - \frac { M \epsilon ^ { 2 } } { 2 4 } \right) \left( \frac { L } { K } - 1 \right) \right] , } \end{array}
+$$
+
+where in (1) we used the bound from Lemma 36.
+
+12.3.3 MAIN PROOF: ORTHANT PROBABILITY OF A PRODUCT GAUSSIAN MATRICES
+
+Lemma 38. (Lemma 16 restated). Let $\mathbf { C } = \left[ \mathbf { c } _ { 1 } , \cdots , \mathbf { c } _ { N } \right] ^ { \top } \in \mathbb { R } ^ { N \times M }$ and $\mathbf { B } \in \mathbb { R } ^ { M \times L }$ be two independent random Gaussian matrices. Without loss of generality, assume $N \geq L$ , and denote $\alpha \triangleq M L / N$ . Then, in the regime $M \leq N$ and in the limit $\operatorname* { m i n } \left[ N , M , L \right] \dot { > } \alpha \dot { > } 1$ , we have
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathbf { C B } > 0 \right) \dot { \leq } \exp \left( - 0 . 4 N \alpha ^ { 1 / 4 } \right) . } \end{array}
+$$
+
+Proof. For some $\theta > 0$ , and subset $S$ such that $| S | = K < L$ , we have
+
+$$
+\begin{array} { r l } & { \quad \mathbb { P } \left( \mathbf { C B } > 0 \right) } \\ & { \le \mathbb { P } \left( \mathbf { C B } _ { S } > 0 | \gamma \left( \mathbf { B } _ { S } \right) \le \epsilon \right) \mathbb { P } \left( \gamma \left( \mathbf { B } _ { S } \right) \le \epsilon \right) + \mathbb { P } \left( \mathbf { C B } _ { S } > 0 | \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) \mathbb { P } \left( \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) } \\ & { \le \mathbb { P } \left( \mathbf { C B } _ { S } > 0 | \gamma \left( \mathbf { B } _ { S } \right) \le \epsilon \right) + \mathbb { P } \left( \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) } \\ & { = \mathbb { E } \left[ \left[ \mathbb { P } \left( \mathbf { c } _ { 1 } ^ { \top } \mathbf { B } _ { S } > 0 | \mathbf { B } _ { S } , \gamma \left( \mathbf { B } _ { S } \right) \le \epsilon \right) \right] ^ { N } | \gamma \left( \mathbf { B } _ { S } \right) \le \epsilon \right] + \mathbb { P } \left( \gamma \left( \mathbf { B } _ { S } \right) > \epsilon \right) , } \end{array}
+$$
+
+where in the last equality we used the fact that the rows of $\mathbf { C }$ are independent and identically distributed.
+
+We choose a specific subset
+
+$$
+S ^ { * } = \mathrm { a r g m i n } _ { S C [ L ] : | S | = K } \gamma \left( \mathbf { B } _ { S } \right)
+$$
+
+to minimize the second term and then upper bound it using Lemma 37 with $\theta = K \epsilon$ ; additionally, we apply Corollary 34 on the first term with the components of the vector $\mathbf { u }$ being
+
+$$
+u _ { i } = \left( \mathbf { B } _ { S } ^ { \top } \mathbf { c } _ { 1 } \right) _ { i } / \sqrt { \left( \mathbf { B } _ { S } ^ { \top } \mathbf { B } _ { S } \right) _ { i i } } \in \mathbb { R } ^ { K } ,
+$$
+
+which is a Gaussian random vector with mean zero and covariance $\pmb { \Sigma }$ for which $\forall i : \Sigma _ { i i } = 1$ and $\forall i \neq j : \Sigma _ { i j } \leq \epsilon = \theta K ^ { - 1 }$ . Thus, we obtain
+
+$$
+\mathbb { P } \left( \mathbf { C } \mathbf { B } > 0 \right) \leq \exp \left( - N K \psi \left( \theta \right) + O \left( N \log K \right) \right) + \exp \left[ \left( \log \left( 2 K \right) ^ { 2 } - \frac { M \theta ^ { 2 } } { 2 4 K ^ { 2 } } \right) \left( \frac { L } { K } - 1 \right) \right] ,
+$$
+
+where we recall $\psi \left( \theta \right)$ is defined in eq. (12.17).
+
+Next, we wish to select good values for $\theta$ and $K$ , which minimize this bound for large $( M , N , L , K )$ Thus, keeping only the first order terms in each exponent (assuming $L \gg K \gg 1$ ), we aim to minimize the function as much as possible
+
+$$
+f \left( K , \theta \right) \triangleq \exp \left( - N K \psi \left( \theta \right) \right) + \exp \left( - \frac { M \theta ^ { 2 } L } { 2 4 K ^ { 3 } } \right) .
+$$
+
+Note that the first term is decreasing in $K$ , while the second term increases. Therefore, for any $\theta$ the minimum of this function in $K$ would be approximately achieved when both terms are equal, i.e.,
+
+$$
+N K \psi \left( \theta \right) = \frac { M \theta ^ { 2 } L } { 2 4 K ^ { 3 } } ,
+$$
+
+so we choose
+
+$$
+{ \cal K } \left( \theta \right) = \left( { \frac { \theta ^ { 2 } M L } { 2 4 \psi \left( \theta \right) N } } \right) ^ { 1 / 4 } .
+$$
+
+Substituting $K \left( \theta \right)$ into $f \left( K , \theta \right)$ yields
+
+$$
+f \left( K \left( \theta \right) , \theta \right) = 2 \exp \left( - N \left[ \frac { \psi ^ { 3 } \left( \theta \right) \theta ^ { 2 } M L } { 2 4 N } \right] ^ { 1 / 4 } \right) .
+$$
+
+To minimize this function in $\theta$ , we need to maximize the function $\psi ^ { 3 } \left( \theta \right) \theta ^ { 2 }$ (which has a single maximum). Doing this numerically gives us
+
+$$
+\theta _ { * } \approx 2 3 . 2 5 ; \psi \left( \theta _ { * } \right) \approx 0 . 1 0 6 2 ; \psi ^ { 3 } \left( \theta _ { * } \right) \theta _ { * } ^ { 2 } \approx 0 . 6 4 7 8 .
+$$
+
+Substituting eqs. (12.27) and (12.28) into eq. (12.25), we obtain
+
+$$
+\begin{array} { r l } & { \mathbb { P } \left( \mathbf { C } \mathbf { B } > 0 \right) } \\ & { \leq \exp \left( - N \left[ \frac { M L } { 3 7 . 0 5 N } \right] ^ { 1 / 4 } + O \left( N \log K \right) \right) } \\ & { + \exp \left[ - N \left[ \frac { M L } { 3 7 . 0 5 N } \right] ^ { 1 / 4 } + 2 L \frac { \log K } { K } + \frac { M \theta ^ { 2 } } { 2 4 K ^ { 2 } } - \log \left( 2 K ^ { 2 } \right) \right] } \\ & { \leq \exp \left( - N \left[ \frac { M L } { 3 7 . 0 5 N } \right] ^ { 1 / 4 } + O \left( N \log \left( \frac { M L } { N } \right) \right) \right) , } \end{array}
+$$
+
+where in the last line we used $N \geq L , N \geq M$ and $\operatorname* { m i n } \left[ N , M , L \right] \dot { > } \alpha \dot { > } 1$ . Taking the log, and denoting $\alpha \triangleq M L / N$ , we thus obtain
+
+$$
+\begin{array} { r } { \log \mathbb { P } \left( \mathbf { C B } > 0 \right) \le - 0 . 4 N \alpha ^ { 1 / 4 } + O \left( N \log \alpha \right) , } \end{array}
+$$
+
+Therefore, in the limit that $N \to \infty$ and $\alpha ( N ) \infty$ , with $\alpha \left( N \right) \dot { < } N$ , we have
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \mathbf { C B } > 0 \right) \dot { \leq } \exp \left( - 0 . 4 N \alpha ^ { 1 / 4 } \right) . } \end{array}
+$$
+
+# 13 LOWER BOUNDING THE ANGULAR VOLUME OF GLOBAL MINIMA: PROOF OF LEMMAS USED IN SECTION 10
+
+# 13.1 ANGLES BETWEEN RANDOM GAUSSIAN VECTORS
+
+To prove the results in the next appendix sections, we will rely on the following basic Lemma.
+
+Lemma 39. For any vector y and $\mathbf { x } \sim \mathcal { N } \left( 0 , \mathbf { I } _ { d _ { 0 } } \right)$ , we have
+
+$$
+\mathbb { P } \left( \left| \frac { \mathbf { x } ^ { \top } \mathbf { y } } { \left\| \mathbf { x } \right\| \left\| \mathbf { y } \right\| } \right| > \cos \left( \epsilon \right) \right) \geq \frac { 2 \sin \left( \epsilon \right) ^ { d _ { 0 } - 1 } } { \left( d _ { 0 } - 1 \right) B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) }
+$$
+
+$$
+\mathbb { P } \left( \left| \frac { \mathbf { x } ^ { \top } \mathbf { y } } { \left\| \mathbf { x } \right\| \left\| \mathbf { y } \right\| } \right| < u \right) \leq \frac { 2 u } { B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } ,
+$$
+
+where we recall that $B \left( x , y \right)$ is the beta function.
+
+Proof. Since $\mathcal { N } ( 0 , \mathbf { I } _ { d _ { 0 } } )$ is spherically symmetric, we can set $\mathbf { y } = \left[ 1 , 0 \ldots , 0 \right] ^ { \top }$ , without loss of generality. Therefore,
+
+$$
+\left| { \frac { \mathbf { x } ^ { \top } \mathbf { y } } { \left\| \mathbf { x } \right\| \left\| \mathbf { y } \right\| } } \right| ^ { 2 } = { \frac { x _ { 1 } ^ { 2 } } { x _ { 1 } ^ { 2 } + \sum _ { i = 2 } ^ { d _ { 0 } } x _ { i } ^ { 2 } } } \sim { \mathcal { B } } \left( { \frac { 1 } { 2 } } , { \frac { d _ { 0 } - 1 } { 2 } } \right) ,
+$$
+
+the Beta distribution, since $x _ { 1 } ^ { 2 } \sim \chi ^ { 2 } ( 1 )$ and ${ \textstyle \sum _ { i = 2 } ^ { d _ { 0 } } x _ { i } ^ { 2 } \sim \chi ^ { 2 } \left( d _ { 0 } - 1 \right) }$ are independent chi-square random variables.
+
+Suppose $Z \sim B \left( \alpha , \beta \right)$ , $\alpha \in ( 0 , 1 )$ , and $\beta > 1$
+
+$$
+\mathbb { P } \left( Z > u \right) = \frac { \int _ { u } ^ { 1 } x ^ { \alpha - 1 } \left( 1 - x \right) ^ { \beta - 1 } d x } { B \left( \alpha , \beta \right) } \geq \frac { \int _ { u } ^ { 1 } 1 ^ { \alpha - 1 } \left( 1 - x \right) ^ { \beta - 1 } d x } { B \left( \alpha , \beta \right) } = \frac { \int _ { 0 } ^ { 1 - u } x ^ { \beta - 1 } d x } { B \left( \alpha , \beta \right) } = \frac { \left( 1 - u \right) ^ { \beta } } { \beta B \left( \alpha , \beta \right) } .
+$$
+
+Therefore, for $\epsilon > 0$ ,
+
+$$
+\mathbb { P } \left( \left| \frac { \mathbf { x } ^ { \mathsf { T } } \mathbf { y } } { \left\| \mathbf { x } \right\| \left\| \mathbf { y } \right\| } \right| ^ { 2 } > \cos ^ { 2 } \left( \epsilon \right) \right) \geq \frac { 2 \left( 1 - \cos ^ { 2 } \left( \epsilon \right) \right) ^ { \frac { d _ { 0 } - 1 } { 2 } } } { \left( d _ { 0 } - 1 \right) B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } = \frac { 2 \sin \left( \epsilon \right) ^ { d _ { 0 } - 1 } } { \left( d _ { 0 } - 1 \right) B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } ,
+$$
+
+which proves eq. (13.1).
+
+Similarly, for $\alpha \in ( 0 , 1 )$ and $\beta > 1$
+
+$$
+\mathbb { P } \left( Z < u \right) = \frac { \int _ { 0 } ^ { u } x ^ { \alpha - 1 } \left( 1 - x \right) ^ { \beta - 1 } d x } { B \left( \alpha , \beta \right) } \leq \frac { \int _ { 0 } ^ { u } x ^ { \alpha - 1 } 1 ^ { \beta - 1 } d x } { B \left( \alpha , \beta \right) } = \frac { u ^ { \alpha } } { \alpha B \left( \alpha , \beta \right) } .
+$$
+
+Therefore, for $\epsilon > 0$
+
+$$
+\mathbb { P } \left( \left| \frac { \mathbf { x } ^ { \top } \mathbf { y } } { \left\| \mathbf { x } \right\| \left\| \mathbf { y } \right\| } \right| ^ { 2 } < u ^ { 2 } \right) \leq \frac { 2 u } { B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } ,
+$$
+
+which proves eq. (13.2).
+
+# 13.2 PROOF OF LEMMA 21:
+
+Given three matrices: datapoints, $\begin{array} { r c l c l } { \mathbf { X } } & { = } & { \left[ \mathbf { x } ^ { ( 1 ) } , \ldots , \mathbf { x } ^ { ( N ) } \right] } & { \in } & { \mathbb { R } ^ { d _ { 0 } \times N } } \end{array}$ , weights $\begin{array} { r l } { \mathbf { W } } & { { } = } \end{array}$ $\left[ { \bf w } _ { 1 } ^ { \top } , \ldots , { \bf w } _ { d _ { 1 } } ^ { \top } \right] ^ { \top } \ \in \ \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } }$ , and target weights $\mathbf W ^ { * } ~ = ~ \left[ \mathbf w _ { 1 } ^ { * \top } , \ldots , \mathbf w _ { d _ { 1 } ^ { * } } ^ { * \top } \right] ^ { \top } ~ \in ~ \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ , with $d _ { 1 } ^ { * } \leq d _ { 1 }$ ,we recall the following definitions:
+
+$$
+\mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \triangleq \left\{ \mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N } | \forall i , n : \left| \frac { \mathbf { x } ^ { ( n ) \top } \mathbf { w } _ { i } ^ { * } } { \left\| \mathbf { x } ^ { ( n ) } \right\| \left\| \mathbf { w } _ { i } ^ { * } \right\| } \right| > \mathrm { s i n } \alpha \right\}
+$$
+
+and
+
+$$
+\begin{array} { r } { \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \triangleq \left\{ \mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } } | \forall i \le d _ { 1 } ^ { * } : \ \mathrm { s i g n } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { X } \right) = \mathrm { s i g n } \left( \mathbf { w } _ { i } ^ { * } { } ^ { \top } \mathbf { X } \right) \right\} . } \end{array}
+$$
+
+Using these definitions, in this section we prove the following Lemma.
+
+Lemma 40. (Lemma 21 restated). For any $\alpha$ , if $\mathbf { W } ^ { * }$ is independent from W then, in the limit $N \to \infty$ , $\forall \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right)$ with $\log \sin \alpha { \dot { > } } { \dot { d } _ { 0 } } ^ { - 1 } \log { d _ { 0 } }$
+
+$$
+\begin{array} { r } { \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \right) \dot { \geq } \exp \left( d _ { 0 } d _ { 1 } ^ { * } \log \sin \alpha \right) . } \end{array}
+$$
+
+Proof. To lower bound $\mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \right) \forall \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right)$ , we define the event that all weight hyperplanes (with normals $\mathbf { w } _ { i }$ ) have an angle of at least $\alpha$ from the corresponding target hyperplanes (with normals $\mathbf { w } _ { i } ^ { * }$ ).
+
+$$
+\begin{array} { r } { \tilde { \mathcal { G } } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) = \left\{ \mathbf { W } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 0 } } \big | \left| \frac { \mathbf { W } _ { i } ^ { \top } \mathbf { w } _ { i } ^ { * } } { \left\| \mathbf { w } _ { i } \right\| \left\| \mathbf { w } _ { i } ^ { * } \right\| } \right| < \cos \left( \alpha \right) \right\} . } \end{array}
+$$
+
+In order that $\mathrm { s i g n } \left( \mathbf { w } _ { i } ^ { \top } \mathbf { x } ^ { ( n ) } \right) \neq \mathrm { s i g n } \left( \mathbf { w } _ { 1 } ^ { \ast \top } \mathbf { x } ^ { ( n ) } \right)$ , $\mathbf { w } _ { i }$ must be rotated in respect to $\mathbf { w } _ { i } ^ { * }$ by an angle greater then the angular margin $\alpha$ , which is the minimal the angle between $\mathbf { x } ^ { ( n ) }$ and the solution hyperplanes (with normals $\mathbf { w } _ { i } ^ { * }$ ). Therefore, we have that, given $\mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right)$ ,
+
+$$
+\forall \alpha : \bigcap _ { i = 1 } ^ { d _ { 1 } ^ { * } } \tilde { \mathcal { G } } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \subset \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) .
+$$
+
+And so, $\forall \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right)$ :
+
+$$
+\begin{array} { r l } & { \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \right) \overset { ( 1 ) } { \geq } \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \displaystyle \bigcap _ { i = 1 } ^ { d _ { 1 } ^ { * } } \tilde { \mathcal { G } } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) } \\ & { \overset { ( 2 ) } { = } \displaystyle \prod _ { i = 1 } ^ { d _ { 1 } ^ { * } } \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \overset { ( 3 ) } { \geq } \left[ \frac { 2 \sin \left( \alpha \right) ^ { d _ { 0 } - 1 } } { \left( d _ { 0 } - 1 \right) B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } \right] ^ { d _ { 1 } ^ { * } } , } \end{array}
+$$
+
+where in (1) we used eq. (13.5), in (2) we used the independence of $\{ { \bf w } _ { i } \} _ { i = 1 } ^ { d _ { 1 } ^ { * } }$ and in (3) we used eq. (13.1) from Lemma 39. Lastly, to simplify this equation we use the asymptotic expansion of the beta function $B \left( { \textstyle \frac { 1 } { 2 } } , x \right) = { \sqrt { \pi / x } } + O \left( x ^ { - 3 / 2 } \right)$ for large $x$ :
+
+$$
+\begin{array} { r } { \log \mathbb { P } _ { \mathbf { W } \sim \mathcal { N } } \left( \mathbf { W } \in \tilde { \mathcal { G } } \left( \mathbf { X } , \mathbf { W } ^ { * } \right) \right) \geq d _ { 0 } d _ { 1 } ^ { * } \log \sin \alpha + O \left( d _ { 1 } ^ { * } \log d _ { 0 } \right) . } \end{array}
+$$
+
+We obtain the Lemma in the limit $N \to \infty$ when $\log \sin \alpha { \dot { > } } d _ { 0 } ^ { - 1 } \log d _ { 0 }$ .
+
+# 13.3 PROOF OF LEMMA 22:
+
+Lemma 41. (Lemma 22 restated). Let $\mathbf { W } ^ { * } = \left[ \mathbf { w } _ { 1 } ^ { \top } , \ldots , \mathbf { w } _ { d _ { 1 } ^ { * } } ^ { \top } \right] ^ { \top } \in \mathbb { R } ^ { d _ { 1 } ^ { * } \times d _ { 0 } }$ a fixed matrix independent of $\mathbf { X }$ . Then, in the limit $N \infty$ with $d _ { 1 } ^ { * } { \dot { \leq } } d _ { 0 } { \dot { \leq } } N _ { \mathrm { ~ } }$ , the probability of not having an angular margin $\sin \alpha = 1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$ (eq. (13.3)) is upper bounded by
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \leq } \sqrt { \frac { 2 } { \pi } } d _ { 0 } ^ { - 1 / 2 }
+$$
+
+Proof. We define
+
+$$
+\mathcal M _ { n , i } ^ { \alpha } ( \mathbf W ^ { * } ) \triangleq \{ \mathbf X \in \mathbb R ^ { d _ { 0 } \times N } | | \frac { \mathbf x ^ { ( n ) \top } \mathbf w _ { i } ^ { * } } { \| \mathbf x ^ { ( n ) } \| \| \mathbf w _ { i } ^ { * } \| } | > \sin ( \alpha ) \} ,
+$$
+
+and $\begin{array} { r } { \mathcal { M } _ { n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \triangleq \bigcap _ { i = 1 } ^ { d _ { 1 } ^ { * } } \mathcal { M } _ { n , i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) } \end{array}$ . Since $\begin{array} { r } { \mathcal { M } \left( \mathbf { W } ^ { * } \right) = \bigcap _ { n = 1 } ^ { N } \mathcal { M } _ { n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) } \end{array}$ , we have
+
+$$
+\begin{array} { r l } & { \displaystyle \mathbb { P } \left( \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \stackrel { ( 1 ) } { = } \prod _ { n = 1 } ^ { N } \mathbb { P } \left( \mathbf { X } \in \mathcal { M } _ { n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) = \prod _ { n = 1 } ^ { N } \left[ 1 - \mathbb { P } \left( \mathbf { X } \notin \mathcal { M } _ { n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \right] } \\ & { \displaystyle \overset { ( 2 ) } { \geq } \prod _ { n = 1 } ^ { N } \left[ 1 - \sum _ { i = 1 } ^ { d _ { 1 } ^ { * } } \mathbb { P } \left( \mathbf { X } \notin \mathcal { M } _ { n , i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \right] \stackrel { ( 3 ) } { \geq } \left[ 1 - d _ { 1 } ^ { * } \frac { 2 \sin \left( \alpha \right) } { B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } \right] ^ { N } , } \end{array}
+$$
+
+where in (1) we used the independence of x(n) Nn= , in (2) we use the union bound, and in (3) we use eq. (13.2) from Lemma 39. Taking the log and we using the asymptotic expansion of the beta function $B \left( { \textstyle \frac { 1 } { 2 } } , x \right) = { \sqrt { \pi / x } } + O \left( x ^ { - 3 / 2 } \right)$ for large $x$ , we get
+
+$$
+\begin{array} { r l } & { \log \mathbb { P } \left( \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \geq N \log \left[ 1 - \sqrt { \frac { 2 } { \pi } d _ { 0 } } d _ { 1 } ^ { * } \sin \alpha + O \left( d _ { 1 } ^ { * } d _ { 0 } ^ { - 1 / 2 } \sin \alpha \right) \right] } \\ & { \qquad = - \sqrt { \frac { 2 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + O \left( d _ { 0 } ^ { - 3 / 2 } / N + d _ { 0 } ^ { - 1 } N ^ { - 2 } \right) , } \end{array}
+$$
+
+where in the last line we recalled $\sin \alpha = 1 / N$ . Recalling that $d _ { 1 } ^ { * } { \dot { \le } } d _ { 0 } { \dot { \le } } N$ , we find
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \geq } 1 - \exp \left( - \sqrt { \frac { 2 } { \pi } } d _ { 0 } ^ { - 1 / 2 } \right) \geq \sqrt { \frac { 2 } { \pi } } d _ { 0 } ^ { - 1 / 2 }
+$$
+
+# 13.4 PROOF OF LEMMA 23:
+
+Lemma 42. (Lemma 23 restated). Let $\mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N }$ be a standard random Gaussian matrix of datapoints. Then we can find, with probability $^ { l }$ , $( \mathbf { X } , \mathbf { y } )$ -dependent matrices $\mathbf { W } ^ { * }$ and $\mathbf { z } ^ { \ast }$ as in Theorem 8 (where $d _ { 1 } ^ { * } \triangleq 4 \lceil N / \left( 2 d _ { 0 } - 2 \right) \rceil ,$ ). Moreover, in the limit $N \to \infty$ , where $N / d _ { 0 } { \dot { \le } } d _ { 0 } { \dot { \le } } N$ , for any y, we can bound the probability of not having an angular margin (eq. (13.3)) with $\sin \alpha =$ $1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$ by
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \leq } \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N }
+$$
+
+Proof. In this proof we heavily rely on the notation and results from the proof of in appendix section 9. Without loss of generality we assume $S _ { 1 } ^ { + } = [ d _ { 0 } - 1 ]$ . Unfortunately, we can’t use Lemma $4 1 -$ this proof is significantly more complicated since the constructed solution $\mathbf { W } ^ { * }$ depends on $\mathbf { X }$ (we keep this dependence implicit, for brevity). Similarly to the proof of Lemma 41, we define,
+
+$$
+\mathcal { M } _ { i , n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \triangleq \left\{ \mathbf { X } \in \mathbb { R } ^ { d _ { 0 } \times N } | \left| \frac { \mathbf { x } ^ { ( n ) \top } \mathbf { w } _ { i } ^ { * } } { \left\| \mathbf { x } ^ { ( n ) } \right\| \left\| \mathbf { w } _ { i } ^ { * } \right\| } \right| > \sin \left( \alpha \right) \right\}
+$$
+
+and $\begin{array} { r } { \mathcal { M } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \triangleq \bigcap _ { n = 1 } ^ { N } \mathcal { M } _ { i , n } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) , \operatorname { s o } \mathcal { M } \left( \mathbf { W } ^ { * } \right) = \bigcap _ { i = 1 } ^ { d _ { 1 } ^ { * } } \mathcal { M } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) . \operatorname { W e } } \end{array}$ have
+
+$$
+\mathbb { P } \left( \mathbf { X } \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) = 1 - \mathbb { P } \left( \mathbf { X } \not \in \mathcal { M } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \overset { ( 1 ) } { \geq } 1 - \sum _ { i = 1 } ^ { d _ { 1 } } \mathbb { P } \left( \mathbf { X } \not \in \mathcal { M } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right)
+$$
+
+nd in (2) we used the fact that, from symmetr. Next, we examine the minimal angular margin in $\forall i :$ $\mathbb { P } \left( \mathbf { X } \notin \mathcal { M } _ { i } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) = \mathbb { P } \left( \mathbf { X } \notin \mathcal { M } _ { 1 } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right)$ $\mathcal { M } _ { 1 , n } ^ { \alpha }$ separately for $\forall n < d _ { 0 }$ and $\forall n \geq d _ { 0 }$ . Recalling the construction of in appendix section 9, we have, for $\forall n < d _ { 0 }$ :
+
+$$
+\operatorname* { m i n } _ { i , n < d _ { 0 } } \left. \frac { \mathbf { x } ^ { ( n ) \top } \mathbf { w } _ { i } ^ { * } } { \left\| \mathbf { x } ^ { ( n ) } \right\| \left\| \mathbf { w } _ { i } ^ { * } \right\| } \right. = \operatorname* { m i n } _ { n < d _ { 0 } , \pm } \frac { \left| \left( \tilde { \mathbf { w } } _ { 1 } \pm \epsilon _ { 2 } \hat { \mathbf { w } } _ { 1 } \right) ^ { \top } \mathbf { x } ^ { ( n ) } \right| } { \left\| \tilde { \mathbf { w } } _ { 1 } \pm \epsilon _ { 2 } \hat { \mathbf { w } } _ { 1 } \right\| \left\| \mathbf { x } ^ { ( n ) } \right\| }
+$$
+
+$$
+\begin{array} { r } { \underline { { \underline { { ( 1 ) } } } } _ { n < d _ { 0 } , \pm } \frac { \epsilon _ { 2 } } { \left\| \tilde { \mathbf { w } } _ { 1 } \pm \epsilon _ { 2 } \hat { \mathbf { w } } _ { 1 } \right\| \left\| \mathbf { x } ^ { ( n ) } \right\| } \overset { ( 2 ) } { = } \frac { \gamma \epsilon _ { 1 } / \sqrt { 1 + \gamma ^ { 2 } \epsilon _ { 1 } ^ { 2 } } } { \left\| \hat { \mathbf { w } } _ { 1 } \right\| \operatorname* { m a x } _ { n < d _ { 0 } } \left\| \mathbf { x } ^ { ( n ) } \right\| } , } \end{array}
+$$
+
+where in (1) we used $\forall n < d _ { 0 }$ : $\mathbf { x } ^ { ( n ) \top } \hat { \mathbf { w } } _ { 1 } = 1$ and $\mathbf { x } ^ { ( n ) \top } \tilde { \mathbf { w } } _ { 1 } = 0$ , from the construction of $\tilde { \mathbf { w } } _ { 1 }$ and $\hat { \mathbf { w } } _ { 1 }$ (eqs. (9.2), (9.5), and (9.4)), and in (2) we used the fact that $\hat { \mathbf { w } } _ { 1 } ^ { \top } \tilde { \mathbf { w } } _ { 1 } = 0$ from eq. (9.4) together with $\| \tilde { \mathbf { w } } _ { 1 } \| = \| \hat { \mathbf { w } } _ { 1 } \|$ from eq. (9.5), and $\epsilon _ { 2 } = \gamma \epsilon _ { 1 }$ from eq. (9.7).
+
+For $\forall n \geq d _ { 0 }$ :
+
+$$
+\operatorname* { m i n } _ { i , n \geq d _ { 0 } } \left. \frac { \mathbf { x } ^ { \left( n \right) \top } \mathbf { w } _ { i } ^ { * } } { \left. \mathbf { x } ^ { \left( n \right) } \right. \left. \mathbf { w } _ { i } ^ { * } \right. } \right. = \operatorname* { m i n } _ { n \geq d _ { 0 } , \pm } \frac { \left. \left( \tilde { \mathbf { w } } _ { 1 } \pm \epsilon _ { 1 } \hat { \mathbf { w } } _ { 1 } \right) ^ { \top } \mathbf { x } ^ { \left( n \right) } \right. } { \left. \tilde { \mathbf { w } } _ { 1 } \pm \epsilon _ { 1 } \hat { \mathbf { w } } _ { 1 } \right. \left. \mathbf { x } ^ { \left( n \right) } \right. } \geq \frac { \left( 1 - \gamma \beta \right) \epsilon _ { 1 } } { \gamma \beta \sqrt { 1 + \epsilon _ { 1 } ^ { 2 } } } \operatorname* { m i n } _ { n \geq d _ { 0 } } \frac { \left. \tilde { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { x } ^ { \left( n \right) } \right. } { \left. \tilde { \mathbf { w } } _ { 1 } \right. \left. \mathbf { x } ^ { \left( n \right) } \right. } ,
+$$
+
+where we used the fact that $\forall n \geq d _ { 0 } : \epsilon _ { 2 } \left| \hat { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { x } ^ { ( n ) } \right| \leq \gamma \beta \left| \tilde { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { x } ^ { ( n ) } \right|$ , from eq. (9.7), and also that $\hat { \mathbf { w } } _ { 1 } ^ { \top } \tilde { \mathbf { w } } _ { 1 } = 0$ from eq. (9.4).
+
+We substitute eqs. (13.8) and (13.9) into $\mathbb { P } \left( \mathbf { X } \in \mathcal { M } _ { 1 } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right)$ :
+
+$\mathbb { P } \left( \mathbf { X } \in \mathcal { M } _ { 1 } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right)$
+
+$$
+\begin{array} { r l } & { \geq \mathbb { P } \left( \frac { \gamma \epsilon _ { 1 } / \sqrt { 1 + \gamma ^ { 2 } \epsilon _ { 1 } ^ { 2 } } } { \left\| \hat { \mathbf { w } } _ { 1 } \right\| \operatorname* { m a x } _ { n < d _ { 0 } } \left\| \mathbf { x } ^ { ( n ) } \right\| } > \sin \alpha , \frac { \left( 1 - \gamma \beta \right) \epsilon _ { 1 } } { \gamma \beta \sqrt { 1 + \epsilon _ { 1 } ^ { 2 } } } \underset { n \geq d _ { 0 } } { \operatorname* { m i n } } \frac { \left| \hat { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { x } ^ { ( n ) } \right| } { \left\| \hat { \mathbf { w } } _ { 1 } \right\| \left\| \mathbf { x } ^ { ( n ) } \right\| } > \sin \alpha \right) } \\ & { \overset { ( 1 ) } { \geq } \mathbb { P } \left( \frac { \gamma \kappa } { \left\| \hat { \mathbf { w } } _ { 1 } \right\| \operatorname* { m a x } _ { n < d _ { 0 } } \left\| \mathbf { x } ^ { ( n ) } \right\| } > \sin \alpha , \frac { \left( 1 - \gamma \beta \right) } { \gamma \beta } \kappa \underset { n \geq d _ { 0 } } { \operatorname* { m i n } } \frac { x _ { 1 } ^ { ( n ) } } { \left\| \mathbf { x } ^ { ( n ) } \right\| } > \sin \alpha , \frac { \epsilon _ { 1 } } { \sqrt { 1 + \epsilon _ { 1 } ^ { 2 } } } > \kappa \right) } \end{array}
+$$
+
+$$
+\overset { \mathtt { ( 2 ) } } { \geq } \mathbb { P } \left( \frac { \gamma \kappa } { \eta \sin \alpha } > \left. \hat { \mathbf { w } } _ { 1 } \right. , \eta > \operatorname* { m a x } _ { n < d _ { 0 } } \left. \mathbf { x } ^ { ( n ) } \right. \right) \mathbb { P } \left( \frac { ( 1 - \gamma \beta ) } { \gamma \beta } \kappa \operatorname* { m i n } _ { n \geq d _ { 0 } } \frac { x _ { 1 } ^ { ( n ) } } { \left. \mathbf { x } ^ { ( n ) } \right. } > \sin \alpha , \frac { \epsilon _ { 1 } } { \sqrt { 1 + \epsilon _ { 1 } ^ { 2 } } } > \kappa \right) ,
+$$
+
+where in (1) we rotate the axes so that $\hat { \mathbf { w } } _ { 1 } \propto [ 1 , 0 , 0 \ldots , 0 ]$ axes $\tilde { \mathbf { w } } _ { 1 } \propto [ 0 , 1 , 0 , 0 \ldots , 0 ] - \mathrm { t h i s }$ is possible due to the spherical symmetry of $\mathbf { x } ^ { ( n ) }$ , and the fact that $\hat { \mathbf { w } } _ { 1 }$ and $\tilde { \mathbf { w } } _ { 1 }$ are functions of $\mathbf { x } ^ { ( n ) }$ for $n < d _ { 0 }$ (from eqs. (9.4) and (9.2)), and as such, they are independent from $\mathbf { x } ^ { ( n ) }$ for $n \geq d _ { 0 }$ , in (2) we use that fact that $\left. \hat { \mathbf { w } } _ { 1 } \right.$ and $\operatorname* { m a x } _ { n < d _ { 0 } } \left\| \mathbf { x } ^ { ( n ) } \right\|$ are functions of $\mathbf { x } ^ { ( n ) }$ for $n < d _ { 0 }$ , and as such, they are independent from $\mathbf { x } ^ { ( n ) }$ for $n \geq d _ { 0 }$ . Thus,
+
+$$
+\begin{array} { r l } & { \mathbb { P } ^ { \nu } ( \mathbf { X } \times M _ { 1 } ^ { \nu } ( \mathbf { W } ^ { \nu } ) ) } \\ & { \geq \left( 1 - \mathbb { P } \left( \frac { \mathcal { X } } { \eta \sin \alpha } \leq \left. \mathbf { w } _ { 1 } \right. \textnormal { \texttt { O } } \eta \leq \operatorname* { m a x } \left. \mathbf { s } ^ { \nu } ( \mathbf { u } ) \right. \right) \right) } \\ & { \cdot \left( 1 - \mathbb { P } \left( \frac { \left\{ 1 - \eta \beta \right\} } { \gamma \beta } \right) \operatorname* { m i n } \frac { x _ { 1 } ^ { \nu \alpha } } { x _ { 2 } ^ { \nu \alpha } \left. \mathbf { s } ^ { \nu \alpha } \right. } \leq \sin \alpha \alpha \frac { \mathbb { E } _ { 1 } } { \sqrt { 1 + \epsilon _ { 1 } ^ { \alpha } } } \leq \kappa \right) \right) } \\ & { \overset { ( a ) } { \geq } \left( 1 - \mathbb { P } \left( \frac { \mathcal { X } } { \eta \sin \alpha } \leq \left. \mathbf { s } \right. _ { 1 } \right) - \mathbb { P } \left( \eta \leq \operatorname* { m a x } \left. \mathbf { s } ^ { \nu \alpha } \right. \right) \right) } \\ & { \cdot \left( 1 - \mathbb { P } \left( \frac { \left\{ 1 - \eta \beta \right\} } { \gamma \beta } \operatorname* { m i n } \frac { x _ { 1 } ^ { \nu \alpha } } { x _ { 2 } ^ { \nu \alpha } \left. \mathbf { s } ^ { \nu \alpha } \right. } \leq \sin \alpha \right) - \mathbb { E } \left( \frac { \mathcal { X } } { \sqrt { 1 + \epsilon _ { 1 } ^ { \alpha } } } \leq \kappa \right) \right) } \\ & { = \left( \mathbb { P } \left( \eta > \frac { \mathcal { X } } { \eta \sin \alpha } \left. \mathbf { s } ^ { \nu \alpha } \right. \right) - \mathbb { P } \left( \frac { \mathcal { Y } } { \eta \sin \alpha } \leq \left. \mathbf { s } \right. \right) \right) } \\ & \cdot \left( \mathbb { E } \left( \frac { \left\{ 1 - \gamma \beta \right\} } { \gamma \beta } \right) \operatorname* { m i n } \frac { x _ { 1 } ^ { \nu \alpha } } { x _ { 2 } ^ { \nu \alpha } \left. \mathbf { s } ^ { \nu \alpha } \right. } \leq \sin \alpha \right) - \mathbb { P } \left( \frac { \mathcal { Z } } { \sqrt { 1 + \epsilon _ { 1 } ^ { \alpha } } } \leq \kappa \end{array}
+$$
+
+where in (1) we use the union bound on both probability terms.
+
+All that remains is to calculate each remaining probability term in eq. (13.11). First, we have
+
+$$
+\begin{array} { r l } & { \mathbb { P } \left( \frac { \epsilon _ { 1 } } { \sqrt { 1 + \epsilon _ { 1 } ^ { 2 } } } \leq \kappa \right) = 1 - \mathbb { P } \left( \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } < \epsilon _ { 1 } \right) } \\ & { \stackrel { \left( 1 \right) } { = } 1 - \mathbb { P } \left( \underset { n \geq d _ { 0 } } { \operatorname* { m i n } } \left| \tilde { \mathbf { w } } _ { i } ^ { \top } \mathbf { x } ^ { \left( n \right) } \right| > \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } \frac { 1 } { \beta } \right) \stackrel { \left( 2 \right) } { = } 1 - \mathbb { P } \left( \underset { n \geq d _ { 0 } } { \operatorname* { m i n } } \left| \frac { x _ { 2 } ^ { \left( n \right) } } { x _ { 1 } ^ { \left( n \right) } } \right| > \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } \frac { 1 } { \beta } \right) } \\ & { \stackrel { \left( 3 \right) } { = } 1 - \left[ \mathbb { P } \left( \left| \frac { x _ { 2 } ^ { \left( 1 \right) } } { x _ { 1 } ^ { \left( 1 \right) } } \right| > \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } \frac { 1 } { \beta } \right) \right] ^ { N - d _ { 0 } - 1 } \stackrel { \left( 4 \right) } { \leq } 1 - \left[ 1 - \frac { 2 } { \pi } \arctan \left( \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } \frac { 1 } { \beta } \right) \right] ^ { N } , } \end{array}
+$$
+
+where in (1) we used eq. (9.7), in (2) we recall that in eq. (13.10) we rotated the axes so that $\hat { \mathbf { w } } _ { 1 } \propto [ 1 , 0 , 0 \ldots , 0 ]$ axes $\tilde { \mathbf { w } } _ { 1 } \propto [ 0 , 1 , 0 , 0 \ldots , 0 ]$ , in (3) we used the independence of different $\mathbf { x } ^ { ( n ) }$ , and in (4) we used the fact that the ratio of two independent Gaussian variables is distributed according to the symmetric Cauchy distribution, which has the cumulative distribution function $\mathbb { P } \left( X > \breve { x } \right) = \textstyle \frac { 1 } { 2 } - \breve { \frac { } { \pi } }$ arctan $( x )$ , and therefore $\begin{array} { r } { \mathbb { P } \left( | X | > x \right) = 1 - \frac { 2 } { \pi } } \end{array}$ arctan $( x )$ .
+
+Second, we use eq. (13.2)
+
+$$
+\mathbb { P } \left( \operatorname* { m i n } _ { n \geq d _ { 0 } } \frac { x _ { 1 } ^ { ( n ) } } { \left\| \mathbf { x } ^ { ( n ) } \right\| } > \frac { \gamma \beta \sin \alpha } { \left( 1 - \gamma \beta \right) \kappa } \right) > \left[ 1 - \frac { 2 \gamma \beta \sin \alpha } { \left( 1 - \gamma \beta \right) \kappa B \left( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } \right) } \right] ^ { N } .
+$$
+
+Third, $\left\| \mathbf { x } ^ { ( n ) } \right\| ^ { 2 }$ is distributed according to the chi-square distribution of order $d _ { 0 }$ , so for $\eta ^ { 2 } > d _ { 0 }$
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \left\| \mathbf { x } ^ { ( n ) } \right\| ^ { 2 } \geq \eta ^ { 2 } \right) \leq \left( \eta ^ { 2 } \exp \left( 1 - \eta ^ { 2 } / d _ { 0 } \right) / d _ { 0 } \right) ^ { d _ { 0 } / 2 } . } \end{array}
+$$
+
+Therefore,
+
+$$
+\mathbb { P } \left( \operatorname* { m a x } _ { n < d _ { 0 } } \left\| \mathbf { x } ^ { ( n ) } \right\| ^ { 2 } < \eta ^ { 2 } \right) > \left[ 1 - \left( \eta ^ { 2 } \exp \left( 1 - \eta ^ { 2 } / d _ { 0 } \right) / d _ { 0 } \right) ^ { d _ { 0 } / 2 } \right] ^ { d _ { 0 } - 1 } .
+$$
+
+Lastly, we bound $\| \tilde { \mathbf { w } } _ { 1 } \| = \| \hat { \mathbf { w } } _ { 1 } \|$ (from eq. (9.5)). From eq. (9.4), we have
+
+$$
+\hat { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { X } _ { [ d _ { 0 } - 1 ] } = \left[ 1 , \ldots , 1 , 1 \right] ,
+$$
+
+where $\mathbf { X } _ { [ d _ { 0 } - 1 ] }$ has a singular value decomposition
+
+$$
+\mathbf { X } _ { [ d _ { 0 } - 1 ] } = \sum _ { i = 1 } ^ { d _ { 0 } } \sigma _ { i } \mathbf { u } _ { i } \mathbf { v } _ { i } ^ { \top } ,
+$$
+
+with $\sigma _ { i }$ being the singular values, and $\mathbf { u } _ { i }$ and $\mathbf { v } _ { i }$ being the singular vectors. The singular values are ordered from smallest to largest, and $\sigma _ { 1 } = 0$ with $\mathbf { u } _ { 1 } = \tilde { \mathbf { w } } _ { 1 }$ , from eq. (9.2). With probability 1, the other $d _ { 0 } - 1$ singular value are non-zero: they are the square roots of the eigenvalues of the random matrix $\mathbf { \bar { X } } _ { [ d _ { 0 } - 1 ] } ^ { \top } \mathbf { \bar { X } } _ { [ d _ { 0 } - 1 ] } \in \mathbb { R } ^ { d _ { 0 } - 1 \times d _ { 0 } - 1 }$ . Taking the squared norm of eq. (13.15), we have
+
+$$
+d _ { 0 } - 1 = \hat { \mathbf { w } } _ { 1 } ^ { \top } \mathbf { X } _ { [ d _ { 0 } - 1 ] } \mathbf { X } _ { [ d _ { 0 } - 1 ] } ^ { \top } \hat { \mathbf { w } } _ { 1 } = \sum _ { i = 1 } ^ { d _ { 0 } } { \sigma _ { i } ^ { 2 } } \left( \mathbf { u } _ { i } ^ { \top } \hat { \mathbf { w } } _ { 1 } \right) ^ { 2 } \geq \sigma _ { 2 } ^ { 2 } \left. \hat { \mathbf { w } } _ { 1 } \right. ^ { 2 } ,
+$$
+
+where the last inequality stems from the fact that $\mathbf { u } _ { 1 } ^ { \top } \hat { \mathbf { w } } _ { 1 } = \tilde { \mathbf { w } } _ { 1 } ^ { \top } \hat { \mathbf { w } } _ { 1 } = 0$ (from eq. (9.4)), so the minimal possible value is attained when $\mathbf { u } _ { 2 } ^ { \top } \hat { \mathbf { w } } _ { 1 } = \| \hat { \mathbf { w } } _ { 1 } \|$ . The minimal nonzero singular value, $\sigma _ { 2 }$ , can be bounded using the following result from (Rudelson & Vershynin, 2010, eq. (3.2))
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \underset { { \mathbf { r } } \in \mathbb { R } ^ { d _ { 0 } } } { \operatorname* { m i n } } \left. \mathbf { X } _ { [ d _ { 0 } ] } \mathbf { r } \right. \leq \eta d _ { 0 } ^ { - 1 / 2 } \right) \leq \eta . } \end{array}
+$$
+
+Since
+
+$$
+\sigma _ { 2 } = \operatorname* { m i n } _ { \mathbf { r } \in \mathbb { R } ^ { d _ { 0 } - 1 } } \left\| \mathbf { X } _ { [ d _ { 0 } - 1 ] } \mathbf { r } \right\| \geq \operatorname* { m i n } _ { \mathbf { r } \in \mathbb { R } ^ { d _ { 0 } } } \left\| \mathbf { X } _ { [ d _ { 0 } ] } \mathbf { r } \right\|
+$$
+
+we have,
+
+$$
+\begin{array} { r } { \mathbb { P } \left( \sigma _ { 2 } < \eta d _ { 0 } ^ { - 1 / 2 } \right) \le \eta . } \end{array}
+$$
+
+Combining this with eq. (13.16) we get
+
+$$
+\mathbb { P } \left( \frac { \beta \kappa } { \eta \sin \alpha } < \| \mathbf { w } _ { 1 } \| \right) \le \frac { \eta d _ { 0 } } { \beta \kappa } \sin \alpha .
+$$
+
+Lastly, combining eqs. (13.12), (13.13), (13.14) and (13.17) into eqs. (13.7) and (13.11), we get, for $\eta ^ { 2 } > d _ { 0 }$ ,
+
+$$
+\begin{array} { r l } & { \mathbb { P } ( \mathbf { X } \in \mathcal { M } ^ { \alpha } ( \mathbf { W } ^ { \star } ) ) } \\ & { \geq 1 - d _ { 1 } ^ { \ast } ( 1 - ( [ 1 - ( \eta ^ { 2 } \exp ( 1 - \eta ^ { 2 } / d _ { 0 } ) / d _ { 0 } ) ^ { \hat { d } _ { 0 } / 2 } ] ^ { d _ { 0 } - 1 } - \frac { \eta d _ { 0 } } { \gamma \kappa } \sin \alpha ) } \\ & { \Bigg . \Bigg . \Bigg . } \\ & { \quad \Bigg . \Bigg . \Bigg . \Bigg . \Bigg . \Bigg . \Bigg . \Bigg . \Bigg \Gamma ( 1 - \frac { 2 \gamma \beta \sin \alpha } { ( 1 - \gamma \beta ) \kappa B ( \frac { 1 } { 2 } , \frac { d _ { 0 } - 1 } { 2 } ) } \Bigg ] ^ { N } - [ 1 - \frac { 2 } { \pi } \arctan ( \frac { \kappa } { \sqrt { 1 - \kappa ^ { 2 } } } \frac { 1 } { \beta } ) ] ^ { N } \Bigg ) \Bigg ) } \\ & { \geq 1 - d _ { 1 } ^ { \ast } ( 1 - ( [ 1 - ( \log d _ { 0 } \exp ( 1 - \log d _ { 0 } ) ) ^ { d _ { 0 } / 2 } ] ^ { d _ { 0 } - 1 } - \frac { 2 d _ { 0 } ^ { \hat { d } _ { 0 } ^ { \prime } / 2 } \sqrt { \log { d _ { 0 } } } } { d _ { 1 } ^ { \ast } N } ) \Bigg . } \\ & { \Bigg ( [ 1 - \sqrt { \frac { \kappa } { \pi } } \frac { 1 } { d _ { 1 } ^ { \ast } d _ { 0 } ^ { \dagger } N } + \mathcal { O } ( \frac { 1 } { N d _ { 1 } ^ { \ast } d _ { 0 } ^ { \dagger } } ) ] ^ { N } - 0 . 4 5 ^ { N } \Bigg ) \Bigg ) ~ , } \end{array}
+$$
+
+where in the last line we take $\beta = \gamma = \kappa = 1 / \sqrt { 2 }$ , $\eta = d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } }$ , $\sin \alpha = 1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$ . Using the asymptotic expansion of the beta function $B \left( { \textstyle { \frac { 1 } { 2 } } } , x \right) = { \sqrt { \pi / x } } + O \left( x ^ { - 3 / 2 } \right)$ for large $x$ , we obtain,
+
+$$
+\begin{array} { r l } & { \| \arcsin \alpha - \operatorname* { l i } ( \theta C \ln ( \theta ) ) } \\ & { 1 - \operatorname* { P } ( \mathbf { X } \in \mathcal { M } ^ { \alpha } ( \operatorname { W e V } ^ { * } ) ) } \\ & { \leq d _ { 1 } ^ { \alpha } ( 1 - ( [ 1 - \exp ( - \frac { d _ { 0 } } { 2 } \operatorname* { l i m } _ { | \phi | } ( \frac { d _ { 0 } } { \log ( d _ { 0 } \phi _ { 0 } ) } ) ) ] ^ { \theta | \alpha - 1 } - \frac { 2 d _ { 1 } ^ { \alpha } | ^ { 2 } \sqrt { \log ( \frac { d _ { 0 } } { \log ( d _ { 0 } ) } } ) } { d _ { 1 } ^ { \alpha } } ) } \\ & { \cdot ( [ 1 - \sqrt { \frac { \alpha } { \sqrt { \kappa } } \frac { 1 } { \sqrt { \kappa } \sqrt { \kappa } \frac { 1 } { \log ( d _ { 0 } ^ { \alpha } ) ^ { 2 } } } } + \mathcal { O } ( \frac { 1 } { \sqrt { \kappa } \frac { 1 } { \sqrt { \kappa } \phi _ { 0 } ^ { 2 } } \phi _ { 0 } ^ { 2 } } ) ] ^ { \mathbf { N } } - 2 ^ { - \kappa } ) ) } \\ & { = d _ { 1 } ^ { \alpha } ( 1 - ( 1 - \frac { 2 d _ { 1 } ^ { \alpha } / \sqrt { \kappa } \log ( \frac { d _ { 0 } } { \kappa } ) } { d _ { 1 } ^ { \alpha } \sqrt { \kappa } } + \mathcal { O } ( \frac { d _ { 0 } \tan \phi } { d _ { 0 } \sqrt { \kappa } } ( - \frac { d _ { 0 } } { 2 } \log ( \frac { d _ { 0 } } { \log ( d _ { 0 } \phi _ { 0 } ) } ) ) ) ) } \\ & \cdot ( 1 - \sqrt \frac { \kappa } { \delta } \frac { 1 } { \lambda _ { 0 } ^ { \alpha } \sqrt { \kappa } ( \frac { 1 } { \log ( d _ { 0 } ^ { \alpha } ) ^ { 2 } } } + \mathcal { O } ( \frac { 1 } { \kappa \phi _ { 0 } ^ { \alpha } \sqrt { \kappa } ^ { 2 } } + \frac { 1 } { d _ { 1 } ^ { \alpha } \sqrt { \kappa } ^ { 2 } \alpha ^ { 2 } } + \alpha _ { 1 } ^ { \alpha } \mathcal { A } _ { 0 } \exp \ \end{array}
+$$
+
+Thus, taking the log, and using $\log { ( 1 - x ) } = - x + O \left( x ^ { 2 } \right)$ , we obtain, forsin $\alpha = 1 / \left( d _ { 1 } ^ { * } d _ { 0 } N \right)$
+
+log P (X ∈ Mα (W∗))
+
+$$
+\begin{array} { r l } & { \log \mathfrak { s } : \mathrm { ~ } \ll \mathcal { N } : \mathrm { ~ } \ll \mathcal { N } : \mathrm { ~ } \ll \mathcal { N } } \\ & { \geq \log \left( 1 - \sqrt { \frac { 8 } { \pi } } \frac { 1 } { d _ { 0 } ^ { 1 / 2 } } - \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N } + O \left( \frac { 1 } { d _ { 0 } ^ { 3 / 2 } } + \frac { d _ { 0 } ^ { 1 / 4 } } { d _ { 1 } ^ { * } N } + d _ { 1 } ^ { * } 2 ^ { - N } + d _ { 0 } \exp \left( - \frac { d _ { 0 } } { 2 } \log \left( \frac { d _ { 0 } } { \log d _ { 0 } } \right) \right) \right) \right) } \\ & { = - \sqrt { \frac { 8 } { \pi } } \frac { 1 } { d _ { 0 } ^ { 1 / 2 } } - \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N } + O \left( \frac { 1 } { d _ { 0 } ^ { 3 / 2 } } + \frac { d _ { 0 } ^ { 1 / 4 } } { d _ { 1 } ^ { * } N } + d _ { 1 } ^ { * } 2 ^ { - N } + d _ { 0 } \exp \left( - \frac { d _ { 0 } } { 2 } \log \left( \frac { d _ { 0 } } { \log d _ { 0 } } \right) \right) \right) . } \end{array}
+$$
+
+Recall that $d _ { 1 } ^ { * } \triangleq 4 \lceil N / \left( 2 d _ { 0 } - 2 \right) \rceil \doteq N / d _ { 0 }$ . Taking the limit $N \to \infty$ , $d _ { 0 } \to \infty$ with $d _ { 1 } ^ { * } { \dot { \leq } } d _ { 0 } { \dot { \leq } } N$ , we have
+
+$$
+\mathbb { P } \left( \mathbf { X } \notin { \mathcal { M } } ^ { \alpha } \left( \mathbf { W } ^ { * } \right) \right) \dot { \leq } 1 - \exp \left( - \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } - \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N } \right) \leq \sqrt { \frac { 8 } { \pi } } d _ { 0 } ^ { - 1 / 2 } + \frac { 2 d _ { 0 } ^ { 1 / 2 } \sqrt { \log d _ { 0 } } } { N }
+$$
+
+# Part III
+
+# Numerical Experiments - implementation details
+
+Code and trained models for CIFAR and ImageNet results is available here https://github. com/MNNsMinima/Paper. In MNIST, CIFAR and ImageNet we performed binary classification on between the original odd and even class numbers. In we performed this binary classification between digits $0 - 4$ and $5 - 9$ . Weights were initialized to be uniform with mean zero and variance $2 / d$ , where $d$ is fan-in (here the width of the previous neuron layer), as suggested in (He et al., 2015). In each epoch we randomly permuted the dataset and used the Adam (Kingma & Ba, 2014) optimization method (a variant of SGD) with $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 , \varepsilon = 1 0 ^ { - 8 }$ . Different learning rates and mini-batch sizes were selected for each dataset and architecture. In CIFAR10 and ImageNet we used a learning-rate of $\alpha = 1 0 ^ { - 3 }$ and a mini-batch size of 1024; also, ZCA whitening of the training samples was done to remove correlations between the input dimensions, allowing faster convergence. We define $L$ as the number of weight layers. For the random dataset we use a mini-batch size of $\left\lfloor \operatorname* { m i n } \left( N / 2 , d / 2 \right) \right\rfloor$ with learning rate $\alpha = 0 . 1$ and 0.05, for $L = 2$ and 3, respectively. In the random data parameter scans the training was done for no more than 4000 epochs – we stopped if $\mathbf { M C E } = 0$ was reached.
\ No newline at end of file
diff --git a/md/train/Hkg4TI9xl/Hkg4TI9xl.md b/md/train/Hkg4TI9xl/Hkg4TI9xl.md
new file mode 100644
index 0000000000000000000000000000000000000000..0bd9543ca3318cda61b5329751368856ac7ff95b
--- /dev/null
+++ b/md/train/Hkg4TI9xl/Hkg4TI9xl.md
@@ -0,0 +1,246 @@
+# A BASELINE FOR DETECTING MISCLASSIFIED ANDOUT-OF-DISTRIBUTION EXAMPLESIN NEURAL NETWORKS
+
+Dan Hendrycks∗ University of California, Berkeley hendrycks@berkeley.edu
+
+Kevin Gimpel
+Toyota Technological Institute at Chicago
+kgimpel@ttic.edu
+
+# ABSTRACT
+
+We consider the two related problems of detecting if an example is misclassified or out-of-distribution. We present a simple baseline that utilizes probabilities from softmax distributions. Correctly classified examples tend to have greater maximum softmax probabilities than erroneously classified and out-of-distribution examples, allowing for their detection. We assess performance by defining several tasks in computer vision, natural language processing, and automatic speech recognition, showing the effectiveness of this baseline across all. We then show the baseline can sometimes be surpassed, demonstrating the room for future research on these underexplored detection tasks.
+
+# 1 INTRODUCTION
+
+When machine learning classifiers are employed in real-world tasks, they tend to fail when the training and test distributions differ. Worse, these classifiers often fail silently by providing highconfidence predictions while being woefully incorrect (Goodfellow et al., 2015; Amodei et al., 2016). Classifiers failing to indicate when they are likely mistaken can limit their adoption or cause serious accidents. For example, a medical diagnosis model may consistently classify with high confidence, even while it should flag difficult examples for human intervention. The resulting unflagged, erroneous diagnoses could blockade future machine learning technologies in medicine. More generally and importantly, estimating when a model is in error is of great concern to AI Safety (Amodei et al., 2016).
+
+These high-confidence predictions are frequently produced by softmaxes because softmax probabilities are computed with the fast-growing exponential function. Thus minor additions to the softmax inputs, i.e. the logits, can lead to substantial changes in the output distribution. Since the softmax function is a smooth approximation of an indicator function, it is uncommon to see a uniform distribution outputted for out-of-distribution examples. Indeed, random Gaussian noise fed into an MNIST image classifier gives a “prediction confidence” or predicted class probability of $91 \%$ , as we show later. Throughout our experiments we establish that the prediction probability from a softmax distribution has a poor direct correspondence to confidence. This is consistent with a great deal of anecdotal evidence from researchers (Nguyen & O’Connor, 2015; Yu et al., 2010; Provost et al., 1998; Nguyen et al., 2015).
+
+However, in this work we also show the prediction probability of incorrect and out-of-distribution examples tends to be lower than the prediction probability for correct examples. Therefore, capturing prediction probability statistics about correct or in-sample examples is often sufficient for detecting whether an example is in error or abnormal, even though the prediction probability viewed in isolation can be misleading.
+
+These prediction probabilities form our detection baseline, and we demonstrate its efficacy through various computer vision, natural language processing, and automatic speech recognition tasks. While these prediction probabilities create a consistently useful baseline, at times they are less effective, revealing room for improvement. To give ideas for future detection research, we contribute one method which outperforms the baseline on some (but not all) tasks. This new method evaluates the quality of a neural network’s input reconstruction to determine if an example is abnormal.
+
+In addition to the baseline methods, another contribution of this work is the designation of standard tasks and evaluation metrics for assessing the automatic detection of errors and out-of-distribution examples. We use a large number of well-studied tasks across three research areas, using standard neural network architectures that perform well on them. For out-of-distribution detection, we provide ways to supply the out-of-distribution examples at test time like using images from different datasets and realistically distorting inputs. We hope that other researchers will pursue these tasks in future work and surpass the performance of our baselines.
+
+In summary, while softmax classifier probabilities are not directly useful as confidence estimates, estimating model confidence is not as bleak as previously believed. Simple statistics derived from softmax distributions provide a surprisingly effective way to determine whether an example is misclassified or from a different distribution from the training data, as demonstrated by our experimental results spanning computer vision, natural language processing, and speech recognition tasks. This creates a strong baseline for detecting errors and out-of-distribution examples which we hope future research surpasses.
+
+# 2 PROBLEM FORMULATION AND EVALUATION
+
+In this paper, we are interested in two related problems. The first is error and success prediction: can we predict whether a trained classifier will make an error on a particular held-out test example; can we predict if it will correctly classify said example? The second is in- and out-of-distribution detection: can we predict whether a test example is from a different distribution from the training data; can we predict if it is from within the same distribution?1 Below we present a simple baseline for solving these two problems. To evaluate our solution, we use two evaluation metrics.
+
+Before mentioning the two evaluation metrics, we first note that comparing detectors is not as straightforward as using accuracy. For detection we have two classes, and the detector outputs a score for both the positive and negative class. If the negative class is far more likely than the positive class, a model may always guess the negative class and obtain high accuracy, which can be misleading (Provost et al., 1998). We must then specify a score threshold so that some positive examples are classified correctly, but this depends upon the trade-off between false negatives (fn) and false positives (fp).
+
+Faced with this issue, we employ the Area Under the Receiver Operating Characteristic curve (AUROC) metric, which is a threshold-independent performance evaluation (Davis & Goadrich, 2006). The ROC curve is a graph showing the true positive rate $( \mathrm { t p r = t p / ( t p + f n ) } )$ ) and the false positive rate $( \mathrm { f p r = f p / ( f p + t n ) } )$ against each other. Moreover, the AUROC can be interpreted as the probability that a positive example has a greater detector score/value than a negative example (Fawcett, 2005). Consequently, a random positive example detector corresponds to a $50 \%$ AUROC, and a “perfect” classifier corresponds to $100 \%$ .2
+
+The AUROC sidesteps the issue of threshold selection, as does the Area Under the Precision-Recall curve (AUPR) which is sometimes deemed more informative (Manning & Schutze ¨ , 1999). This is because the AUROC is not ideal when the positive class and negative class have greatly differing base rates, and the AUPR adjusts for these different positive and negative base rates. For this reason, the AUPR is our second evaluation metric. The PR curve plots the precision $( \mathrm { t p } / ( \mathrm { t p } + \mathrm { f p } ) )$ and recall $( \mathrm { t p } / ( \mathrm { t p } + \mathrm { f n } ) )$ ) against each other. The baseline detector has an AUPR approximately equal to the precision (Saito & Rehmsmeier, 2015), and a “perfect” classifier has an AUPR of $1 0 0 \%$ . Consequently, the base rate of the positive class greatly influences the AUPR, so for detection we must specify which class is positive. In view of this, we show the AUPRs when we treat success/normal classes as positive, and then we show the areas when we treat the error/abnormal classes as positive. We can treat the error/abnormal classes as positive by multiplying the scores by $- 1$ and labeling them positive. Note that treating error/abnormal classes as positive classes does not change the AU
+
+ROC since if $S$ is a score for a successfully classified value, and $E$ is the score for an erroneously classified value, $\mathrm { A U R O C } = P ( S > E ) = { \dot { P } } ( - E > - S )$ .
+
+We begin our experiments in Section 3 where we describe a simple baseline which uses the maximum probability from the softmax label distribution in neural network classifiers. Then in Section 4 we describe a method that uses an additional, auxiliary model component trained to reconstruct the input.
+
+# 3 SOFTMAX PREDICTION PROBABILITY AS A BASELINE
+
+In what follows we retrieve the maximum/predicted class probability from a softmax distribution and thereby detect whether an example is erroneously classified or out-of-distribution. Specifically, we separate correctly and incorrectly classified test set examples and, for each example, compute the softmax probability of the predicted class, i.e., the maximum softmax probability.3 From these two groups we obtain the area under PR and ROC curves. These areas summarize the performance of a binary classifier discriminating with values/scores (in this case, maximum probabilities from the softmaxes) across different thresholds. This description treats correctly classified examples as the positive class, denoted “Success” or “Succ” in our tables. In “Error” or “Err” we treat the the incorrectly classified examples as the positive class; to do this we label incorrectly classified examples as positive and take the negatives of the softmax probabilities of the predicted classes as the scores.
+
+For “In,” we treat the in-distribution, correctly classified test set examples as positive and use the softmax probability for the predicted class as a score, while for “Out” we treat the out-of-distribution examples as positive and use the negative of the aforementioned probability. Since the AUPRs for Success, Error, In, Out classifiers depend on the rate of positive examples, we list what area a random detector would achieve with “Base” values. Also in the upcoming results we list the mean predicted class probability of wrongly classified examples (Pred Prob Wrong (mean)) to demonstrate that the softmax prediction probability is a misleading confidence proxy when viewed in isolation. The “Pred. Prob (mean)” columns show this same shortcoming but for out-of-distribution examples.
+
+Table labels aside, we begin experimentation with datasets from vision then consider tasks in natural language processing and automatic speech recognition. In all of the following experiments, the AUROCs differ from the random baselines with high statistical significance according to the Wilcoxon rank-sum test.
+
+# 3.1 COMPUTER VISION
+
+In the following computer vision tasks, we use three datasets: MNIST, CIFAR-10, and CIFAR100 (Krizhevsky, 2009). MNIST is a dataset of handwritten digits, consisting of 60000 training and 10000 testing examples. Meanwhile, CIFAR-10 has colored images belonging to 10 different classes, with 50000 training and 10000 testing examples. CIFAR-100 is more difficult, as it has 100 different classes with 50000 training and 10000 testing examples.
+
+In Table 1, we see that correctly classified and incorrectly classified examples are sufficiently distinct and thus allow reliable discrimination. Note that the area under the curves degrade with image recognizer test error.
+
+Next, let us consider using softmax distributions to determine whether an example is in- or outof-distribution. We use all test set examples as the in-distribution (positive) examples. For out-ofdistribution (negative) examples, we use realistic images and noise. For CIFAR-10 and CIFAR-100, we use realistic images from the Scene UNderstanding dataset (SUN), which consists of 397 different scenes (Xiao et al., 2010). For MNIST, we use grayscale realistic images from three sources. Omniglot (Lake et al., 2015) images are handwritten characters rather than the handwritten digits in MNIST. Next, notMNIST (Bulatov, 2011) consists of typeface characters. Last of the realistic images, CIFAR-10bw are black and white rescaled CIFAR-10 images. The synthetic “Gaussian” data is random normal noise, and “Uniform” data is random uniform noise. Images are resized when necessary.
+
+Table 1: The softmax predicted class probability allows for discrimination between correctly and incorrectly classified test set examples. “Pred. Prob Wrong(mean)” is the mean softmax probability for wrongly classified examples, showcasing its shortcoming as a direct measure of confidence. Succ/Err Base values are the AUROCs or AUPRs achieved by random classifiers. All entries are percentages.
+
+
Dataset
AUROC /Base
AUPR Succ/Base
AUPR Err/Base
Pred.Prob Wrong(mean)
Test Set Error
MNIST
97/50
100/98
48/1.7
86
1.69
CIFAR-10
93/50
100/95
43/5
80
4.96
CIFAR-100
87/50
96/79
62/21
66
20.7
+
+Table 2: Distinguishing in- and out-of-distribution test set data for image classification. CIFAR10/All is the same as CIFAR-10/(SUN, Gaussian). All values are percentages.
+
+
In-Distribution / Out-of-Distribution
AUROC /Base
AUPR In /Base
AUPR Out/Base
Pred.Prob (mean)
CIFAR-10/SUN
95/50
89/33
97/67
72
CIFAR-10/Gaussian
97/50
98/49
95/51
77
CIFAR-10/AIl
96/50
88/24
98/76
74
CIFAR-100/SUN
91/50
83/27
96/73
56
CIFAR-100/Gaussian
88/50
92/43
80/57
77
CIFAR-100/AIl
90/50
81/21
96/79
63
MNIST/Omniglot
96/50
97/52
96/48
86
MNIST/notMNIST
85/50
86/50
88/50
92
MNIST/CIFAR-10bw
95/50
95/50
95/50
87
MNIST/Gaussian
90/50
90/50
91/50
91
MNIST/Uniform
99/50
99/50
98/50
83
MNIST/AII
91/50
76/20
98/80
89
+
+The results are shown in Table 2. Notice that the mean predicted/maximum class probabilities (Pred. Prob (mean)) are above $7 5 \%$ , but if the prediction probability alone is translated to confidence, the softmax distribution should be more uniform for CIFAR-100. This again shows softmax probabilities should not be viewed as a direct representation of confidence. Fortunately, out-of-distribution examples sufficiently differ in the prediction probabilities from in-distribution examples, allowing for successful detection and generally high area under PR and ROC curves.
+
+For reproducibility, let us specify the model architectures. The MNIST classifier is a three-layer, 256 neuron-wide, fully-connected network trained for 30 epochs with Adam (Kingma & Ba, 2015). It uses a GELU nonlinearity (Hendrycks & Gimpel, 2016b), $x \Phi ( x )$ , where $\Phi ( x )$ is the CDF of the standard normal distribution. We initialize our weights according to (Hendrycks & Gimpel, 2016c), as it is suited for arbitrary nonlinearities. For CIFAR-10 and CIFAR-100, we train a 40-4 wide residual network (Zagoruyko & Komodakis, 2016) for 50 epochs with stochastic gradient descent using restarts (Loshchilov & Hutter, 2016), the GELU nonlinearity, and standard mirroring and cropping data augmentation.
+
+# 3.2 NATURAL LANGUAGE PROCESSING
+
+Let us turn to a variety of tasks and architectures used in natural language processing.
+
+# 3.2.1 SENTIMENT CLASSIFICATION
+
+The first NLP task is binary sentiment classification using the IMDB dataset (Maas et al., 2011), a dataset of polarized movie reviews with 25000 training and 25000 test reviews. This task allows us to determine if classifiers trained on a relatively small dataset still produce informative softmax distributions. For this task we use a linear classifier taking as input the average of trainable, randomly initialized word vectors with dimension 50 (Joulin et al., 2016; Iyyer et al., 2015). We train for 15 epochs with Adam and early stopping based upon 5000 held-out training reviews. Again, Table 3 shows that the softmax distributions differ between correctly and incorrectly classified examples, so prediction probabilities allow us to detect reliably which examples are right and wrong.
+
+Table 3: Detecting correct and incorrect classifications for binary sentiment classification.
+
+
Dataset
AUROC /Base
AUPR Succ/Base
AUPR Err/Base
Pred.Prob Wrong(mean)
Test Set Error
IMDB
82/50
97/88
36/12
74
11.9
+
+Table 4: Distinguishing in- and out-of-distribution test set data for binary sentiment classification. IMDB/All is the same as IMDB/(Customer Reviews, Movie Reviews). All values are percentages.
+
+
In-Distribution / Out-of-Distribution
AUROC /Base
AUPR In /Base
AUPR Out/Base
Pred.Prob (mean)
IMDB/Customer Reviews
95/50
99/89
60/11
62
IMDB/Movie Reviews
94/50
98/72
80/28
63
IMDB/All
94/50
97/66
84/34
63
+
+Now we use the Customer Review (Hu & Liu, 2004) and Movie Review (Pang et al., 2002) datasets as out-of-distribution examples. The Customer Review dataset has reviews of products rather than only movies, and the Movie Review dataset has snippets from professional movie reviewers rather than full-length amateur reviews. We leave all test set examples from IMDB as in-distribution examples, and out-of-distribution examples are the 500 or 1000 test reviews from Customer Review and Movie Review datasets, respectively. Table 4 displays detection results, showing a similar story to Table 2.
+
+# 3.2.2 TEXT CATEGORIZATION
+
+We turn to text categorization tasks to determine whether softmax distributions are useful for detecting similar but out-of-distribution examples. In the following text categorization tasks, we train classifiers to predict the subject of the text they are processing. In the 20 Newsgroups dataset (Lang, 1995), there are 20 different newsgroup subjects with a total of 20000 documents for the whole dataset. The Reuters 8 (Lewis et al., 2004) dataset has eight different news subjects with nearly 8000 stories in total. The Reuters 52 dataset has 52 news subjects with slightly over 9000 news stories; this dataset can have as few as three stories for a single subject.
+
+For the 20 Newsgroups dataset we train a linear classifier on 30-dimensional word vectors for 20 epochs. Meanwhile, Reuters 8 and Retuers 52 use one-layer neural networks with a bag-of-words input and a GELU nonlinearity, all optimized with Adam for 5 epochs. We train on a subset of subjects, leaving out 5 newsgroup subjects from 20 Newsgroups, 2 news subjects from Reuters 8, and 12 news subjects from Reuters 52, leaving the rest as out-of-distribution examples. Table 5 shows that with these datasets and architectures, we can detect errors dependably, and Table 6 informs us that the softmax prediction probabilities allow for detecting out-of-distribution subjects.
+
+Table 5: Detecting correct and incorrect classifications for text categorization.
+
+
Dataset
AUROC /Base
AUPR Succ/Base
AUPR Err/Base
Pred.Prob Wrong(mean)
Test Set Error
15 Newsgroups
89/50
99/93
42/7.3
53
7.31
Reuters 6
89/50
100/98
35/2.5
77
2.53
Reuters 40
91/50
99/92
45/7.6
62
7.55
+
+Table 6: Distinguishing in- and out-of-distribution test set data for text categorization.
+
+
In-Distribution / Out-of-Distribution
AUROC /Base
AUPR In/Base
AUPR Out/Base
Pred.Prob (mean)
15/5 Newsgroups
75/50
92/84
45/16
65
Reuters6/Reuters2
92/50
100/95
56/4.5
72
Reuters40/Reuters12
95/50
100/93
60/7.2
47
+
+Table 7: Detecting correct and incorrect classifications for part-of-speech tagging.
+
+
Dataset
AUROC /Base
AUPR Succ/Base
AUPR Err/Base
Pred.Prob Wrong(mean)
Test Set Error
WSJ
96/50
100/96
51/3.7
71
3.68
Twitter
89/50
98/87
53/13
69
12.59
+
+# 3.2.3 PART-OF-SPEECH TAGGING
+
+Part-of-speech (POS) tagging of newswire and social media text is our next challenge. We use the Wall Street Journal portion of the Penn Treebank (Marcus et al., 1993) which contains 45 distinct POS tags. For social media, we use POS-annotated tweets (Gimpel et al., 2011; Owoputi et al., 2013) which contain 25 tags. For the WSJ tagger, we train a bidirectional long short-term memory recurrent neural network (Hochreiter & Schmidhuber, 1997) with three layers, 128 neurons per layer, with randomly initialized word vectors, and this is trained on $9 0 \%$ of the corpus for 10 epochs with stochastic gradient descent with a batch size of 32. The tweet tagger is simpler, as it is twolayer neural network with a GELU nonlinearity, a weight initialization according to (Hendrycks & Gimpel, 2016c), pretrained word vectors trained on a corpus of 56 million tweets (Owoputi et al., 2013), and a hidden layer size of 256, all while training on 1000 tweets for 30 epochs with Adam and early stopping with 327 validation tweets. Error detection results are in Table 7. For out-ofdistribution detection, we use the WSJ tagger on the tweets as well as weblog data from the English Web Treebank (Bies et al., 2012). The results are shown in Table 8. Since the weblog data is closer in style to newswire than are the tweets, it is harder to detect whether a weblog sentence is outof-distribution than a tweet. Indeed, since POS tagging is done at the word-level, we are detecting whether each word is out-of-distribution given the word and contextual features. With this in mind, we see that it is easier to detect words as out-of-distribution if they are from tweets than from blogs.
+
+
In-Distribution/ Out-of-Distribution
AUROC /Base
AUPR In/Base
AUPR Out/Base
Pred.Prob (mean)
WSJ/Twitter
80/50
98/92
41/7.7
81
WSJ/Weblog*
61/50
88/86
30/14
93
+
+Table 8: Detecting out-of-distribution tweets and blog articles for part-of-speech tagging. All values are percentages. \*These examples are atypically close to the training distribution.
+
+# 3.3 AUTOMATIC SPEECH RECOGNITION
+
+Now we consider a task which uses softmax values to construct entire sequences rather than determine an input’s class. Our sequence prediction system uses a bidirectional LSTM with two-layers and a clipped GELU nonlinearity, optimized for 60 epochs with RMSProp trained on $8 0 \%$ of the TIMIT corpus (Garofolo et al., 1993). The LSTM is trained with connectionist temporal classification (CTC) (Graves et al., 2006) for predicting sequences of phones given MFCCs, energy, and first and second deltas of a 25ms frame. When trained with CTC, the LSTM learns to have its phone label probabilities spike momentarily while mostly predicting blank symbols otherwise. In this way, the softmax is used differently from typical classification problems, providing a unique test for our detection methods.
+
+We do not show how the system performs on correctness/incorrectness detection because errors are not binary and instead lie along a range of edit distances. However, we can perform out-ofdistribution detection. Mixing the TIMIT audio with realistic noises from the Aurora-2 dataset (Hirsch & Pearce, 2000), we keep the TIMIT audio volume at $100 \%$ and noise volume at $30 \%$ , giving a mean SNR of approximately 5. Speakers are still clearly audible to the human ear but confuse the phone recognizer because the prediction edit distance more than doubles. For more outof-distribution examples, we use the test examples from the THCHS-30 dataset (Wang & Zhang, 2015), a Chinese speech corpus. Table 9 shows the results. Crucially, when performing detection, we compute the softmax probabilities while ignoring the blank symbol’s logit. With the blank symbol’s presence, the softmax distributions at most time steps predict a blank symbol with high confidence, but without the blank symbol we can better differentiate between normal and abnormal distributions. With this modification, the softmax prediction probabilities allow us to detect whether an example is out-of-distribution.
+
+Table 9: Detecting out-of-distribution distorted speech. All values are percentages.
+
+
In-Distribution / Out-of-Distribution
AUROC /Base
AUPR In/Base
AUPR Out/Base
Pred.Prob (mean)
TIMIT/TIMIT+Airport
99/50
99/50
99/50
59
TIMIT/TIMIT+Babble
100/50
100/50
100/50
55
TIMIT/TIMIT+Car
98/50
98/50
98/50
59
TIMIT/TIMIT+Exhibition
100/50
100/50
100/50
57
TIMIT/TIMIT+Restaurant
98/50
98/50
98/50
60
TIMIT/TIMIT+Street
100/50
100/50
100/50
52
TIMIT/TIMIT+Subway
100/50
100/50
100/50
56
TIMIT/TIMIT+Train
100/50
100/50
100/50
58
TIMIT/Chinese
85/50
80/34
90/66
64
TIMIT/AII
97/50
79/10
100/90
58
+
+# 4 ABNORMALITY DETECTION WITH AUXILIARY DECODERS
+
+Having seen that softmax prediction probabilities enable abnormality detection, we now show there is other information sometimes more useful for detection. To demonstrate this, we exploit the learned internal representations of neural networks. We start by training a normal classifier and append an auxiliary decoder which reconstructs the input, shown in Figure 1. Auxiliary decoders are sometimes known to increase classification performance (Zhang et al., 2016). The decoder and scorer are trained jointly on in-distribution examples. Thereafter, the blue layers in Figure 1 are frozen. Then we train red layers on clean and noised training examples, and the sigmoid output of the red layers scores how normal the input is. Consequently, noised examples are in the abnormal class, clean examples are of the normal class, and the sigmoid is trained to output to which class an input belongs. After training we consequently have a normal classifier, an auxiliary decoder, and what we call an abnormality module. The gains from the abnormality module demonstrate there are possible research avenues for outperforming the baseline.
+
+# 4.1 TIMIT
+
+We test the abnormality module by revisiting the TIMIT task with a different architecture and show how these auxiliary components can greatly improve detection. The system is a three-layer, 1024- neuron wide classifier with an auxiliary decoder and abnormality module. This network takes as input 11 frames and must predict the phone of the center frame, 26 features per frame. Weights are initialized according to (Hendrycks & Gimpel, 2016c). This network trains for 20 epochs, and the abnormality module trains for two. The abnormality module sees clean examples and, as negative examples, TIMIT examples distorted with either white noise, brown noise (noise with its spectral density proportional to $\bar { 1 } / f ^ { 2 } )$ , or pink noise (noise with its spectral density proportional to $\bar { 1 } / f$ ) at various volumes.
+
+We note that the abnormality module is not trained on the same type of noise added to the test examples. Nonetheless, Table 10 shows that simple noised examples translate to effective detection of realistically distorted audio. We detect abnormal examples by comparing the typical abnormality module outputs for clean examples with the outputs for the distorted examples. The noises are from Aurora-2 and are added to TIMIT examples with $30 \%$ volume. We also use the THCHS-30 dataset for Chinese speech. Unlike before, we use the THCHS-30 training examples rather than test set examples because fully connected networks can evaluate the whole training set sufficiently quickly. It is worth mentioning that fully connected deep neural networks are noise robust (Seltzer et al., 2013), yet the abnormality module can still detect whether an example is out-of-distribution. To see why this is remarkable, note that the network’s frame classification error is $2 9 . 6 9 \%$ on the entire test (not core) dataset, and the average classification error for distorted examples is $3 0 . 4 3 \%$ —this is unlike the bidirectional LSTM which had a more pronounced performance decline. Because the classification degradation was only slight, the softmax statistics alone did not provide useful outof-distribution detection. In contrast, the abnormality module provided scores which allowed the detection of different-but-similar examples. In practice, it may be important to determine whether an example is out-of-distribution even if it does not greatly confuse the network, and the abnormality module facilitates this.
+
+Table 10: Abnormality modules can generalize to novel distortions and detect out-of-distribution examples even when they do not severely degrade accuracy. All values are percentages.
+
+
In-Distribution/ Out-of-Distribution
AUROC /Base Softmax
AUROC /Base AbMod
AUPR In/Base Softmax
AUPR In/Base AbMod
AUPR Out/Base Softmax
AUPR Out/Base AbMod
TIMIT/+Airport
75/50
100/50
77/41
100/41
73/59
100/59
TIMIT/+Babble TIMIT/+Car
94/50
100/50
95/41
100/41
91/59
100/59
TIMIT/+Exhib.
70/50
98/50
69/41
98/41
70/59
98/59
TIMIT/+Rest.
91/50
98/50
92/41
98/41
91/59
98/59
TIMIT/+Subway
68/50 76/50
95/50
70/41
96/41
67/59
95/59
TIMIT/+Street
89/50
96/50 98/50
77/41
96/41
74/59
96/59
80/50
100/50
91/41
99/41
85/59
98/59
TIMIT/+Train
79/50
82/41
100/41 66/12
77/59
100/59
TIMIT/Chinese
80
90/50 97
41/12 77
96/88
98/88
Average
95
80
98
+
+Table 11: Improved detection using the abnormality module. All values are percentages.
+
+
In-Distribution / Out-of-Distribution
AUROC /Base Softmax
AUROC /Base AbMod
AUPR In/Base Softmax
AUPR In/Base AbMod
AUPR Out/Base Softmax
AUPR Out/Base
MNIST/Omniglot
95/50
100/50
95/52
100/52
95/48
AbMod 100/48
MNIST/notMNIST
87/50
100/50
88/50
100/50
90/50
100/50
MNIST/CIFAR-10bw
98/50
100/50
98/50
100/50
98/50
100/50
MNIST/Gaussian
88/50
100/50
88/50
100/50
90/50
100/50
MNIST/Uniform
99/50
100/50
99/50
100/50
99/50
100/50
Average
93
100
94
100
94
100
+
+# 4.2 MNIST
+
+Finally, much like in a previous experiment, we train an MNIST classifier with three layers of width 256. This time, we also use an auxiliary decoder and abnormality module rather than relying on only softmax statistics. For abnormal examples we blur, rotate, or add Gaussian noise to training images. Gains from the abnormality module are shown in Table 11, and there is a consistent out-of-sample detection improvement compared to softmax prediction probabilities. Even for highly dissimilar examples the abnormality module can further improve detection.
+
+# 5 DISCUSSION AND FUTURE WORK
+
+The abnormality module demonstrates that in some cases the baseline can be beaten by exploiting the representations of a network, suggesting myriad research directions. Some promising future avenues may utilize the intra-class variance: if the distance from an example to another of the same predicted class is abnormally high, it may be out-of-distribution (Giryes et al., 2015). Another path is to feed in a vector summarizing a layer’s activations into an RNN, one vector for each layer. The RNN may determine that the activation patterns are abnormal for out-of-distribution examples. Others could make the detections fine-grained: is the out-of-distribution example a known-unknown or an unknown-unknown? A different avenue is not just to detect correct classifications but to output the probability of a correct detection. These are but a few ideas for improving error and out-of-distribution detection.
+
+We hope that any new detection methods are tested on a variety of tasks and architectures of the researcher’s choice. A basic demonstration could include the following datasets: MNIST, CIFAR, IMDB, and tweets because vision-only demonstrations may not transfer well to other architectures and datasets. Reporting the AUPR and AUROC values is important, and so is the underlying classifier’s accuracy since an always-wrong classifier gets a maximum AUPR for error detection if error is the positive class. Also, future research need not use the exact values from this paper for comparisons. Machine learning systems evolve, so tethering the evaluations to the exact architectures and datasets in this paper is needless. Instead, one could simply choose a variety of datasets and architectures possibly like those above and compare their detection method with a detector based on the softmax prediction probabilities from their classifiers. These are our basic recommendations for others who try to surpass the baseline on this underexplored challenge.
+
+# 6 CONCLUSION
+
+We demonstrated a softmax prediction probability baseline for error and out-of-distribution detection across several architectures and numerous datasets. We then presented the abnormality module, which provided superior scores for discriminating between normal and abnormal examples on tested cases. The abnormality module demonstrates that the baseline can be beaten in some cases, and this implies there is room for future research. Our hope is that other researchers investigate architectures which make predictions in view of abnormality estimates, and that others pursue more reliable methods for detecting errors and out-of-distribution inputs because knowing when a machine learning system fails strikes us as highly important.
+
+# ACKNOWLEDGMENTS
+
+We would like to thank John Wieting, Hao Tang, Karen Livescu, Greg Shakhnarovich, and our reviewers for their suggestions. We would also like to thank NVIDIA Corporation for donating several TITAN X GPUs used in this research.
+
+# REFERENCES
+
+Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mane. Con- ´ crete problems in ai safety. arXiv, 2016.
+
+Ann Bies, Justin Mott, Colin Warner, and Seth Kulick. English Web Treebank, 2012.
+
+Yaroslav Bulatov. notMNIST dataset. 2011.
+
+Jesse Davis and Mark Goadrich. The relationship between precision-recall and ROC curves. In International Conference on Machine Learning (ICML), 2006.
+
+Tom Fawcett. An introduction to ROC analysis. Pattern Recognition Letters, 2005.
+
+John Garofolo, Lori Lamel, William Fisher, Jonathan Fiscus, David Pallett, Nancy Dahlgren, and Victor Zue. TIMIT Acoustic-Phonetic Continuous Speech Corpus. Linguistic Data Consortium, 1993.
+
+Kevin Gimpel, Nathan Schneider, Brendan $\mathrm { O ^ { \prime } }$ Connor, Dipanjan Das, Daniel Mills, Jacob Eisenstein, Michael Heilman, Dani Yogatama, Jeffrey Flanigan, and Noah A. Smith. Part-of-Speech Tagging for Twitter: Annotation, Features, and Experiments. Association for Computational Linguistics (ACL), 2011.
+
+Raja Giryes, Guillermo Sapiro, and Alex M. Bronstein. Deep neural networks with random gaussian weights: A universal classification strategy? arXiv, 2015.
+
+Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
+
+Alex Graves, Santiago Fernandez, Faustino Gomez, and J ´ urgen Schmidhuber. Connectionist tem- ¨ poral classification: Labeling unsegmented sequence data with recurrent neural networks. In International Conference on Machine Learning (ICML), 2006.
+
+Dan Hendrycks and Kevin Gimpel. Methods for detecting adversarial images and a colorful saliency map. arXiv, 2016a.
+
+Dan Hendrycks and Kevin Gimpel. Bridging nonlinearities and stochastic regularizers with Gaussian error linear units. arXiv, 2016b.
+
+Dan Hendrycks and Kevin Gimpel. Adjusting for dropout variance in batch normalization and weight initialization. arXiv, 2016c.
+
+Hans-Gunter Hirsch and David Pearce. The Aurora experimental framework for the performance¨ evaluation of speech recognition systems under noisy conditions. ISCA ITRW ASR2000, 2000.
+
+Sepp Hochreiter and Jurgen Schmidhuber. ¨ Long short-term memory. Neural Computation, 1997.
+
+Minqing Hu and Bing Liu. Mining and Summarizing Customer Reviews. Knowledge Discovery and Data Mining (KDD), 2004.
+
+Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daume Iii. ´ Deep Unordered Composition Rivals Syntactic Methods for Text Classification. Association for Computational Linguistics (ACL), 2015.
+
+Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv, 2016.
+
+Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. International Conference for Learning Representations (ICLR), 2015.
+
+Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images, 2009.
+
+Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 2015.
+
+Ken Lang. Newsweeder: Learning to filter netnews. In International Conference on Machine Learning (ICML), 1995.
+
+David D. Lewis, Yiming Yang, Tony G. Rose, and Fan Li. Rcv1: A new benchmark collection for text categorization research. Journal of Machine Learning Research (JMLR), 2004.
+
+Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with restarts. arXiv, 2016.
+
+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 (ACL), 2011.
+
+Chris Manning and Hinrich Schutze. ¨ Foundations of Statistical Natural Language Processing. MIT Press, 1999.
+
+Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of English: The Penn Treebank. Computational linguistics, 1993.
+
+Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Computer Vision and Pattern Recognition (CVPR), 2015.
+
+Khanh Nguyen and Brendan O’Connor. Posterior calibration and exploratory analysis for natural language processing models. In Empirical Methods in Natural Language Processing (EMNLP), 2015.
+
+Olutobi Owoputi, Brendan O’Connor, Chris Dyer, Kevin Gimpel, Nathan Schneider, and Noah A. Smith. Improved part-of-speech tagging for online conversational text with word clusters. In North American Chapter of the Association for Computational Linguistics (NAACL), 2013.
+
+Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. Thumbs up? sentiment classification using machine learning techniques. In Empirical Methods in Natural Language Processing (EMNLP), 2002.
+
+Foster Provost, Tom Fawcett, and Ron Kohavi. The case against accuracy estimation for comparing induction algorithms. In International Conference on Machine Learning (ICML), 1998.
+
+Takaya Saito and Marc Rehmsmeier. The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. In PLoS ONE. 2015.
+
+Michael L. Seltzer, Dong Yu, and Yongqiang Wang. Investigation of deep neural networks for noise robust speech recognition. In IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2013.
+
+Jacob Steinhardt and Percy Liang. Unsupervised risk estimation using only conditional independence structure. In Neural Information Processing Systems (NIPS), 2016.
+
+Dong Wang and Xuewei Zhang. Thchs-30 : A free chinese speech corpus. In Technical Report, 2015.
+
+Gethin Williams and Steve Renals. Confidence measures for hybrid hmm/ann speech recognition. In Proceedings of EuroSpeech, 1997.
+
+Jianxiong Xiao, James Hays, Krista A. Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010.
+
+Dong Yu, Jinyu Li, and Li Deng. Calibration of confidence measures in speech recognition. In IEEE Transactions on Audio, Speech, and Language, 2010.
+
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. British Machine Vision Conference, 2016.
+
+Yuting Zhang, Kibok Lee, and Honglak Lee. Augmenting supervised neural networks with unsupervised objectives for large-scale image classification. In International Conference on Machine Learning (ICML), 2016.
+
+# A ABNORMALITY MODULE EXAMPLE
+
+
+Figure 1: A neural network classifying a diamond image with an auxiliary decoder and an abnormality module. Circles are neurons, either having a GELU or sigmoid activation. The blurred diamond reconstruction precedes subtraction and elementwise squaring. The probability vector is the softmax probability vector. Blue layers train on in-distribution data, and red layers train on both in- and out-of-distribution examples.
\ No newline at end of file
diff --git a/md/train/HkxAAvcxx/HkxAAvcxx.md b/md/train/HkxAAvcxx/HkxAAvcxx.md
new file mode 100644
index 0000000000000000000000000000000000000000..8e1e4fa10c16fdd410390e4a193e2aaacd1fc0fd
--- /dev/null
+++ b/md/train/HkxAAvcxx/HkxAAvcxx.md
@@ -0,0 +1,179 @@
+# TRANSFORMATION-BASED MODELS OF VIDEO SEQUENCES
+
+Joost van Amersfoort ∗, Anitha Kannan, Marc’Aurelio Ranzato, Arthur Szlam, Du Tran & Soumith Chintala
+
+Facebook AI Research joost@joo.st, {akannan, ranzato, aszlam, trandu, soumith}@fb.com
+
+# ABSTRACT
+
+In this work we propose a simple unsupervised approach for next frame prediction in video. Instead of directly predicting the pixels in a frame given past frames, we predict the transformations needed for generating the next frame in a sequence, given the transformations of the past frames. This leads to sharper results, while using a smaller prediction model.
+
+In order to enable a fair comparison between different video frame prediction models, we also propose a new evaluation protocol. We use generated frames as input to a classifier trained with ground truth sequences. This criterion guarantees that models scoring high are those producing sequences which preserve discriminative features, as opposed to merely penalizing any deviation, plausible or not, from the ground truth. Our proposed approach compares favourably against more sophisticated ones on the UCF-101 data set, while also being more efficient in terms of the number of parameters and computational cost.
+
+# 1 INTRODUCTION
+
+There has been an increased interest in unsupervised learning of representations from video sequences (Mathieu et al., 2016; Srivastava et al., 2015; Vondrick et al., 2016). A popular formulation of the task is to learn to predict a small number of future frames given the previous K frames; the motivation being that predicting future frames requires understanding how objects interact and what plausible sequences of motion are. These methods directly aim to predict pixel values, with either MSE loss or adversarial loss.
+
+In this paper, we take a different approach to the problem of next frame prediction. In particular, our model operates in the space of transformations between frames, directly modeling the source of variability. We exploit the assumption that the transformations of objects from frame to frame should be smooth, even when the pixel values are not. Instead of predicting pixel values, we directly predict how objects transform. The key insight is that while there are many possible outputs, predicting one such transformation will yield motion that may not correspond to ground truth, yet will be realistic; see fig. 1. We therefore propose a transformation-based model that operates in the space of affine transforms. Given the affine transforms of a few previous frames, the model learns to predict the local affine transforms that can be deterministically applied on the image patches of the previous frame to generate the next frame. The intuition is that estimation errors will lead to a slightly different yet plausible motion. Note that this allows us to keep using the MSE criterion, which is easy to optimize, as long as it is in transformation space. No blur in the pixel space will be introduced since the output of the transformation model is directly applied to the pixels, keeping sharp edges intact. Refer to fig. 5 and our online material 1 for examples.
+
+The other contribution of this work is the evaluation protocol. Typically, generative models of video sequences are evaluated in terms of MSE in pixel space (Srivastava et al., 2015), which is not a good choice since this metric favors blurry predictions over other more realistic looking options that just happen to differ from the ground truth. Instead, we propose to feed the generated frames to a video classifier trained on ground truth sequences. The idea is that the less the classifier’s performance is affected by the generates frames the more the model has preserved distinctive features and the more the generated sequences are plausible. Regardless of whether they resemble the actual ground truth or not. This protocol treats the classifier as a black box to measure how well the generated sequences can serve as surrogate for the truth sequence for the classification task. In this paper we will validate our assumption that motion can be modelled by local affine transforms, after which we will compare our method with networks trained using adversarial training and simple regression on the output frame, using both this new evaluation protocol and by providing samples for qualitative inspection.
+
+
+Figure 1: Motivating toy example. From left to right: the first digit shows what the model is conditioned upon, the second digit shows the frame we would like to predict at the next time step, the third digit shows the blurry prediction if we were to minimize MSE in pixel space, the last digit shows the prediction when minimizing MSE in the space of transformations. While the two models may have the same MSE in pixel space, the transformation-based model generates much sharper outputs. Although the motion is different than the ground truth (second digit), it is still a plausible next frame to the conditioned frame. In practice, the input is a sequence of consecutive frames.
+
+Our experiments show that our simple and efficient model outperforms other baselines, including much more sophisticated models, on benchmarks on the UCF-101 data set (Soomro et al., 2012). We also provide qualitative comparisons to the moving MNIST digit data set (Srivastava et al., 2015).
+
+# 1.1 RELATED WORK
+
+Early work on video modeling focused on predicting small patches (Michalski et al., 2014; Srivastava et al., 2015); unfortunately, these models have not shown to scale to the complexity of highresolution videos. Also these models require a significant amount of parameters and computational power for even relatively simple data.
+
+In Ranzato et al. (2014), the authors circumvented this problem by quantizing the space of image patches. While they were able to predict a few high-resolution frames in the future, it seems dissatisfying to impose such a drastic assumption to simplify the prediction task.
+
+Mathieu et al. (2016) recently proposed to replace MSE in pixel space with a MSE on image gradients, leveraging prior domain knowledge, and further improved using a multi-scale architecture with adversarial training (Goodfellow et al., 2014). While producing better results than earlier methods, the models used require a very large amount of computational power. We make an explicit comparison to this paper in the experiments section 3.
+
+In Oh et al. (2015), frames of a video game are predicted given an action (transformation) taken by the player. While the paper shows great results, the movement in a natural video cannot be described by a simple action and is therefore not widely applicable. Finally, our work is also related to optical flow estimation (Brox et al., 2004). Instead of estimating the flow of pixels, here we estimate the flow of patches and separately predict how these patches transform in future frames.
+
+Prior work relating to the evaluation protocol can be found in Yan et al. (2015). The authors generate images using a set of predefined attributes and later show that they can recover these using a pretrained neural network. Our proposal extends this to videos, which is more complicated since both appearance and motion are needed for correct classification.
+
+
+Figure 2: Outline of the transformation-based model. The model is a CNN that takes as input a sequence of consecutive affine transforms between pairs of adjacent video frames. It predicts the affine transform between the last input frame and the next one in the sequence. We compute affine transforms (6 parameters per patch) for overlapping patches of size $8 \times 8$ in each video frame. Learning operates in the space of transformations as shown inside the dashed box. The front-end on the left is a module that estimates the affine transforms between pairs of consecutive input frames. The post-processor on the right reconstructs a frame from the predicted set of affine transforms and it is only used at test time.
+
+# 2 MODEL
+
+The model we propose is based on three key assumptions: 1) just estimating object motion yields sequences that are plausible and relatively sharp, 2) global motion can be estimated by tiling highresolution video frames into patches and estimating motion “convolutionally” at the patch level, and 3) patches at the same spatial location over two consecutive time steps undergo a deformation which can be well described by an affine transformation.
+
+The first assumption is at the core of the proposed method: by considering uncertainty in the space of transformations we produce sequences that may still look plausible. The other two assumptions state that a video sequence can be composed by patches undergoing affine transformations. We agree that these are simplistic assumptions, which ignore how object identity affects motion and do not account for out of plane rotations and more general forms of deformation. However, our qualitative and quantitative evaluation shows the efficacy of these assumptions to real video sequence as can be seen in section 3 and from visualizations in the supplementary material2.
+
+Our approach consists of three steps. First, we estimate affine transforms of every video sequence to build a training set for our model. Second, we train a model that takes the past $N$ affine transforms and predicts the next $M$ affine transforms. Finally, at test time, the model uses the predicted affine transforms to reconstruct pixel values of the generated sequence. We describe the details of each phase in the following sections.
+
+# 2.1 AFFINE TRANSFORM EXTRACTOR
+
+Given a frame $x$ and the subsequent frame $y$ , the goal of the affine transform extractor is to learn mappings that can warp $x$ into $y$ . Since different parts of the scene may undergo different transforms, we tile $x$ into overlapping patches and infer a transformation for each patch. The estimation process couples the transformations at different spatial locations because we minimize the reconstruction error of the entire frame $y$ , as opposed to treating each patch independently.
+
+
+Figure 3: Outline of the system predicting 4 frames ahead in time. Only affine transforms $A _ { 1 }$ , $A _ { 2 }$ and $A _ { 3 }$ are provided, and the model predicts ${ \tilde { A } } _ { 4 }$ , ${ \tilde { A } } _ { 5 }$ , ${ \tilde { A } } _ { 6 }$ and ${ \tilde { A } } _ { 7 }$ , which are used to reconstruct the next 4 frames. Since affine parameters are continuous values and the whole chain of CNNs is differentiable, the whole unrolled system can be trained by back-propagation of the error. Note that CNNs all share the same parameters
+
+Let $x$ and $y$ have size $D _ { r } \times D _ { c }$ . Let image $x$ be decomposed into a set of overlapping patches, each containing pixels from patches of size $d _ { r } \times d _ { c }$ with $d _ { r } \leq D _ { r }$ and $d _ { c } \leq D _ { c }$ . These patches are laid out on a regular grid with stride $s _ { r }$ and $s _ { c }$ pixels over rows and columns, respectively. Therefore, every pixel participates in $\frac { d _ { r } } { s _ { r } } \frac { d _ { c } } { s _ { c } }$ overlapping patches, not taking into account for the sake of simplicity border effects and non-integer divisions. We denote the whole set of overlapping patches by $\{ X _ { k } \}$ , where index $k$ runs over the whole set of patches. Similarly and using the same coordinate system, we denote by $\left\{ Y _ { k } \right\}$ the set of overlapping patches of $y$ .
+
+We assume that there is an affine mapping $A _ { k }$ that maps $X _ { k }$ to $Y _ { k }$ , for all values of $k$ . $A _ { k }$ is a $2 \times 3$ matrix of free parameters representing a generic affine transform (translation, rotation and scaling) between the coordinates of output and input frame. Let $\tilde { Y } _ { k }$ be the transformed patches obtained when $A _ { k }$ is applied to $X _ { k }$ . Since coordinates overlap between patches, we reconstruct $y$ by averaging all predictions at the same location, yielding the estimate $\tilde { y }$ . The joint set of $A _ { k }$ is then jointly determined by minimizing the mean squared reconstruction error between $y$ and $\tilde { y }$ .
+
+Notice that our approach and aim differs from spatial transformer networks (Jaderberg et al., 2015) since we perform this estimation off-line only for the input frames, computing one transform per patch.
+
+In our experiments, we extracted $1 6 \times 1 6$ pixel patches from the input and we used stride 4 over rows and columns. The input patches are then matched at the output against smaller patches of size $8 \times 8$ pixels, to account for objects moving in and out of the patch region.
+
+# 2.2 AFFINE TRANSFORM PREDICTOR
+
+The affine transform predictor is used to predict the affine transforms between the last input frame and the next frame in the sequence. A schematic illustration of the system is shown in fig. 2. It receives as input the affine transforms between pairs of adjacent frames, as produced by the affine transform extractor described in the previous section. Each transform is arranged in a grid of size $6 \times n \times n$ , where $n$ is the number of patches in a row/column and 6 is the number of parameters of each affine transform. Therefore, if four frames are used to initialize the model, the actual input consists of 18 maps of size $n \times n$ , which are the concatenation of $A _ { t - 2 } , A _ { t - 1 } , A _ { t }$ , where $A _ { t }$ is the collection of patch affine transforms between frame at time $t - 1$ and $t$ .
+
+The model consists of a multi-layer convolutional network without any pooling. The network is the composition of convolutional layers with ReLU non-linearity, computing a component-wise thresholding as in $v = \operatorname* { m a x } ( 0 , u )$ . We learn the parameters in the filters of the convolutional layers by minimizing the mean squared error between the output of the network and the target transforms.
+
+Notice that we do not add any regularization to the model. In particular, we rely on the convolutional structure of the model to smooth out predictions at nearby spatial locations.
+
+# 2.3 MULTI-STEP PREDICTION
+
+In the previous section, we described how to predict the set of affine transforms at the next time step.
+In practice, we would like to predict several time steps in the future.
+
+A greedy approach would: a) train as described above to minimize the prediction error for the affine transforms at the next time step, and b) at test time, predict one step ahead and then re-circulate the model prediction back to the input to predict the affine transform two steps ahead, etc. Unfortunately, errors may accumulate throughout this process because the model was never exposed to its own predictions at training time.
+
+The approach we propose replicates the model over time, also during training as shown in fig. 3. If we wish to predict $M$ steps in the future, we replicate the CNN $M$ times and pass the output of the CNN at time step $t$ as input to the same CNN at time step $t + 1$ , as we do at test time. Since predictions live in a continuous space, the whole system is differentiable and amenable to standard back-propagation of the error. Since parameters of the CNN are shared across time, the overall system is equivalent to a peculiar recurrent neural network, where affine transforms play the role of recurrent states. The experiments in section 3 demonstrate that this method is more accurate and robust than the greedy approach.
+
+# 2.4 TESTING
+
+At test time, we wish to predict $M$ frames in the future given the past $N$ frames. After extracting the $N - 1$ affine transforms from the frames we condition upon, we replicate the model $M$ times and feed its own prediction back to the input, as explained in the previous section.
+
+Once the affine transforms are predicted, we can reconstruct the actual pixel values. We use the last frame of the sequence and apply the first set of affine transforms to each patch in that frame. Each pixel in the output frame is predicted multiple times, depending on the stride used. We average these predictions and reconstruct the whole frame. As required, we can repeat this process for as many frames as necessary, using the last reconstructed frame and the next affine transform.
+
+In order to evaluate the generation, we propose to feed the generated frames to a trained classifier for a task of interest. For instance, we can condition the generation using frames taken from video clips which have been labeled with the corresponding action. The classifier has been trained on ground truth data but it is evaluated using frames fantasized by the generative model. The performance of the classifier on ground truth data is an upper bound on the performance of any generative model. This evaluation protocol does not penalize any generation that deviates from the ground truth, as standard MSE would. It instead check that discriminative features and the overall semantics of the generated sequence is correct, which is ultimately what we are interested in.
+
+# 3 EXPERIMENTS
+
+In this section, we validate the key assumptions made by our model and compare against state-ofthe-art generative models on two data sets. We strongly encourage the reader to watch the short video clips in the Supplementary Material to better understand the quality of our generations.
+
+In section 2, we discussed the three key assumptions at the foundations of our model: 1) errors in the transformation space look still plausible, 2) a frame can be decomposed into patches, and 3) each patch motion is well modeled by an affine transform. The results in the Supplementary Material 3 validate assumption 2 and 3 qualitatively. Every row shows a sequence from the UCF101 dataset (Soomro et al., 2012). The column on the left shows the original video frames and the one on the right the reconstructions from the estimated affine transforms, as described in section 2.1. As you can see there is barely any noticeable difference between these video sequences, suggesting that video sequences can be very well represented as tiled affine transforms. For a quantitative comparison and for an assessment of how well the first assumption holds, please refer to section 3.2.
+
+
+Figure 4: Predictions of 4 sequences from the moving MNIST dataset. The top row of each pair shows the ground truth frames; the first four frames are used as input to the model. The bottom row shows the predictions of the model.
+
+In the next section, we will first report some results using the toy data set of “moving MNIST digits” (Srivastava et al., 2015). We then discuss generations of natural high-resolution videos using the UCF-101 dataset and compare to current state-of-the-art methods.
+
+# 3.1 MOVING MNIST
+
+For our first experiment, we used the dataset of moving MNIST digits (Srivastava et al., 2015) and perform qualitative analysis4. It consists of one or two MNIST digits, placed at random locations and moving at constant speed inside a $6 4 \times 6 4$ frame. When a digit hits a boundary, it bounces, meaning that velocity in that direction is reversed. Digits can occlude each other and bounce off walls, making the data set challenging.
+
+Using scripts provided by Srivastava et al. (2015), we generated a fixed dataset of 128,000 sequences and used $80 \%$ for training, $10 \%$ for validation and $10 \%$ for testing. Next, we estimated the affine transforms between every pair of adjacent frames to a total of 4 frames, and trained a small CNN in the space of affine transforms. The CNN has 3 convolutional layers and the following number of feature maps: 18, 32, 32, 6. All filters have size $3 \times 3$ .
+
+Fig. 4 shows some representative test sequences and the model outputs. Each subfigure corresponds to a sequence from the test set; the top row corresponds to the ground truth sequence while the bottom row shows the generations. The input to the CNN are three sets of affine transforms corresponding to the first four consecutive frames. The network predicts the next six sets of affine transforms from which we reconstruct the corresponding frames. These results should be compared to fig. 5 in Srivastava et al. (2015). The generations in fig. 4 show that the model has potential to represent and generate video sequences, it learns to move digits in the right direction, to bounce them, and it handles multiple digits well except when occluion makes inputs too ambiguous. The model’s performance is analyzed quantitatively in the next section using high resolution natural videos.
+
+# 3.2 UCF 101 DATA SET
+
+The UCF-101 dataset (Soomro et al., 2012) is a collection of 13320 videos of 101 action categories. Frames have size $2 4 0 \times 3 2 0$ pixels. We train a CNN on patches of size $6 4 \times 6 4$ pixels; the CNN has 6 convolutional layers and the following number of feature maps: 18, 128, 128, 128, 64, 32, 16, 6. All filters have size $3 \times 3$ . The optimal number of filters has been found using cross-validation in order to minimize the estimation error of the affine transform parameters. Unless otherwise stated, we condition generation on 4 ground truth frames and we predict the following 8 frames.
+
+We evaluate several models5: a) a baseline which merely copies the last frame used for conditioning, b) a baseline method which estimates optical flow (Brox et al., 2004) from two consecutive frames and extrapolates flow in subsequent frames under the assumption of constant flow speed, c) an adversarially trained multi-scale CNN (Mathieu et al., 2016) and several variants of our proposed approach.
+
+
+Figure 5: Example of predictions produced by different models. Each row shows an example. The first two columns show the ground truth. The two frames are 4 time steps apart. The next two columns show predictions from a baseline model employing optical flow. Next, we show the prediction produced by the adversarially trained CNN proposed by Mathieu et al. (2016). The last two column show the prediction produced by our affine-transformation based approach. All pairs in the same column group are four time steps apart. All methods were conditioned on the same set of 4 input frames (not shown in the figure)
+
+Table 1: Classification accuracy on UCF-101 dataset. The classifier is trained on the actual training video sequences, but it is tested using frames generated by various generative models. Each column shows the accuracy on the test set when taking a different number of input frames as input. Our approach maps $1 6 \times 1 6$ patches into $8 \times 8$ with stride 4, and it takes 4 frames at the input.
+
+
Method
4 frames
8 frames
Ground truth frames
72.46
72.29
Using ground truth affine transforms
71.7
71.28
Copy last frame
60.76
54.27
Optical Flow
57.29
49.37
Mathieu et al. (2016)
57.98
47.01
ours - one step prediction (not unrolled)
64.13
57.63
ours - four step prediction (unrolled 4 times)
64.54
57.88
+
+Qualitative comparisons can be seen in the fig. 5 and in the supplementary material6. The first column on the page shows the input, the second the ground truth, followed by results from our model, Mathieu et al. (2016) and optical flow (Brox et al., 2004). Note especially the severe deformations in the last two columns, while our model keeps the frame recognizable. It produces fairly sharp reconstructions validating our first hypothesis that errors in the space of transformations still yield plausible reconstructions (see section 2). However it is also apparent that our approach underestimates movement, which follows directly from using the MSE criterion. As discussed before, MSE in pixel space leads to blurry results, however using MSE in transformation space also has some drawbacks. In practice, the model will predict the average of several likely transformations, which could lead to an understimation of the true movement.
+
+In order to quantify the generation quality we use the metric described in section 2.4. We use C3D network (Tran et al., 2015) as the video action classifier: C3D uses both appearance and temporal information jointly, and is pre-trained with Sports1M (Karpathy et al., 2014) and fine tuned on UCF 101. Due to the model constraints, we trained only two models, that takes 4 and 8 frames as input, respectively.
+
+We evaluate the quality of generation using 4 (the first four predicted frames) and the whole set of 8 predicted frames, for the task of action classification. At test time, we generate frames from each model under consideration, and then use them as input to the corresponding C3D network.
+
+Table 1 shows the accuracy of our approach and several baselines. The best performance is achieved by using ground truth frames, a result comparable to methods recently appeared in the literature (Karpathy et al., 2014; Tran et al., 2015). We see that for ground truth frames, the number of frames (4 or 8) doesn’t make a difference. There is not much additional temporal or spatial signal provided by having greater than four frames. Next, we evaluate how much we lose by representing frames as tiled affine transforms. As the second row shows there is negligible if any loss of accuracy when using frames reconstructed from the estimated affine transforms (using the method described in section 2.1), validating our assumptions at the beginning of section 2 on how video sequences can be represented. The next question is then whether these affine transforms are predictable at all. The last two rows of Table 1 show that this is indeed the case, to some extent. The longer the sequence of generated frames the poorer the performance, since the generation task gets more and more difficult.
+
+Compared to other methods, our approach performs better than optical flow and even the more sophisticated multi-scale CNN proposed in Mathieu et al. (2016) while being computationally cheaper. For instance, our method has less than half a million parameters and requires about 2G floating point operations to generate a frame at test time, while the multi-scale CNN of Mathieu et al. (2016) has 25 times more parameters (not counting the discriminator used at training time) and it requires more than 100 times more floating point operations to generate a single frame.
+
+Finally, we investigate the robustness of the system to its hyper-parameters: a) choice of patch size, b) number of input frames, and c) number of predicted frames. The results reported in Table 2 demonstrate that the model is overall pretty robust to these choices. Using patch sizes that are too big makes reconstructions blocky but within each block motion is coherent. Smaller patch sizes give more flexibility but make the prediction task harder as well. Mapping into patches of size smaller than $1 6 \times 1 6$ seems a good choice. Using only 2 input frames does not seem to provide enough context to the predictor, but anything above 3 works equally well. Training for prediction of the next frame works well, but better results can be achieved by training to predict several frames in the future, overall when evaluating longer sequences.
+
+Table 2: Analysis of the robustness to the choice of hyper-parameters, shows classification scores compared to reference model. The reference model takes 4 frames as input, predicts one frame, and maps $1 2 \times 1 2$ patches onto $8 \times 8$ patches with stride 4.
+
+
Method
4 frames
8 frames
reference
63.57
57.32
Varying patch sizefrom 32 × 32 to 16× 16from 16 × 16 to 8 × 8
61.7363.75
53.8557.18
Number of input frames23
63.663.8
57.1157.4
Number of predicted frames24
64.164.54
57.557.88
+
+# 4 CONCLUSIONS
+
+In this work, we proposed a new approach to generative modeling of video sequences. This model does not make any assumption about the spatio-temporal resolution of video sequences nor about object categories. The key insight of our approach is to model in the space of transformations as opposed to raw pixel space. A priori we lack a good metric to measure how well a frame is reconstructed under uncertainty due to objects motion in natural scenes. Uncertainty about object motion and occlusions causes blurry generations when using MSE in pixel space. Instead, by operating in the space of transformations we aim at predicting how objects move, and estimation errors only yield a different, and possibly still plausible, motion. With this motivation we proposed a simple CNN operating in the space of affine transforms and we showed that it can generate sensible sequences up to about 4 frames. This model produces sequences that are both visually and quantitatively better than previously proposed approaches.
+
+The second contribution of this work is the metric to compare generative models of video sequences. A good metric should not penalize a generative model for producing a sequence which is plausible but different from the ground truth. With this goal in mind and assuming we have at our disposal labeled sequences, we can first train a classifier using ground truth sequences. Next, the classifier is fed with sequences produced by our generative model for evaluation. A good generative model should produce sequences that still retain discriminative features. In other words, plausibility of generation is assessed in terms of how well inherent information is preserved during generation as opposed to necessarily and merely reproducing the ground truth sequences.
+
+The proposed model is relatively simple; straightforward extensions that could improve its prediction accuracy are the use of a multi-scale architecture and the addition of recurrent units. These would enable a better modeling of objects of different sizes moving at varying speeds and to better capture complex temporal dynamics (e.g., cyclical movements like walking). A larger extension would be the addition of an appearance model, which together with our explicit transformation model could lead to learning better feature representations for classification.
+
+In our view, the proposed approach should be considered as a stronger baseline for future research into next frame prediction. Even though our analysis shows improved performance and better looking generations, there are also obvious limitations. The first such limitation is the underestimation of transformations due to usage of the MSE as a criterion. We consider two main avenues worth pursuing in this space. First, we consider modelling a distribution of transformations and sampling one from it. The challenge of this approach is to sample a consistent trajectory. One could model the distribution of an entire trajectory, but that is a complex optimization problem. A second option is to use adversarial training to force the model to pick a plausible action. This option does not guarantee that underestimation of movement will be avoided. This will depend on the discriminator model accepting this as a plausible option.
+
+Another limitation is that the current model does not factor out the “what” from the “where”, appearance from motion. The representation of two distinct objects subject to the same motion, as well as the representation of the same object subject to two different motion patterns are intrinsically different. Instead, it would be more powerful to learn models that can discover such factorization and leverage it to produce more efficient and compact representations.
+
+# ACKNOWLEDGMENTS
+
+Authors thank Camille Couprie and Michael Mathieu for discussions and helping with evaluation of their models.
+
+# REFERENCES
+
+Thomas Brox, Andres Bruhn, Nils Papenberg, and Joachim Weickert. High accuracy optical flow ´ estimation based on a theory for warping. In Computer Vision-ECCV 2004, pp. 25–36. Springer, 2004.
+
+I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014.
+
+Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. NIPS, 2015.
+
+Andrej Karpathy, George Toderici, Sachin Shetty, Tommy Leung, Rahul Sukthankar, and Li FeiFei. Large-scale video classification with convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2014 IEEE Conference on, pp. 1725–1732. IEEE, 2014.
+
+Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016.
+
+Vincent Michalski, Roland Memisevic, and Kishore Konda. Modeling deep temporal dependencies with recurrent grammar cells. In NIPS, 2014.
+
+Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. NIPS, 2015.
+
+MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv preprint arXiv:1412.6604, 2014.
+
+Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. CRCV-TR-12-01, 2012.
+
+Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using lstms. CoRR, abs/1502.04681, 2, 2015.
+
+Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4489–4497, 2015.
+
+Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. arXiv preprint arXiv:1609.02612, 2016.
+
+Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2image: Conditional image generation from visual attributes. arXiv preprint arXiv:1512.00570, 2015.
\ No newline at end of file
diff --git a/md/train/Hyfg5o0qtm/Hyfg5o0qtm.md b/md/train/Hyfg5o0qtm/Hyfg5o0qtm.md
new file mode 100644
index 0000000000000000000000000000000000000000..1414e709d654daf883a83ed3c6f2811cc3ca29e5
--- /dev/null
+++ b/md/train/Hyfg5o0qtm/Hyfg5o0qtm.md
@@ -0,0 +1,356 @@
+# TEMPORAL GAUSSIAN MIXTURE LAYER FOR VIDEOS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We introduce a new convolutional layer named the Temporal Gaussian Mixture (TGM) layer and present how it can be used to efficiently capture longer-term temporal information in continuous activity videos. The TGM layer is a temporal convolutional layer governed by a much smaller set of parameters (e.g., location/variance of Gaussians) that are fully differentiable. We present our fully convolutional video models with multiple TGM layers for activity detection. The experiments on multiple datasets including Charades and MultiTHUMOS confirm the effectiveness of TGM layers, outperforming the state-of-the-arts.
+
+# 1 INTRODUCTION
+
+Activity videos are spatio-temporal data: they are image frames with a specific width/height (XY) concatenated along time axis (T). Recognition from such videos requires capturing both spatial and temporal information in the videos, desirably using learned convolutional kernels. Temporal convolution is particularly beneficial in activity ‘detection’ tasks, which require making activity decisions at every frame given a continuous video (Sigurdsson et al., 2016b; Yeung et al., 2015). Previous methods investigated using 3-D XYT convolutional filters (Tran et al., 2014; Carreira & Zisserman, 2017) as well as the models with 2-D XY conv. layers followed by 1-D temporal conv. (Tran et al., 2018), pooling or attention layers (Piergiovanni et al., 2017).
+
+Understanding complex multi-activity videos requires capturing information in long-term time intervals. Different frames contain different information, and the model needs to learn to take advantage of as many frames as possible, while abstracting them efficiently. Previous attempts of simply pooling representations over time or learning temporal conv. filters with a small number of frames (e.g., 16 or 64) was thus often insufficient to fully consider rich long-term temporal context. Simultaneously, bruteforcely increasing the temporal filter length (to look at more frames) results more learnable parameters, requiring more training data, which can be expensive when activities are rare.
+
+In this paper, we introduce a new convolutional layer named the Temporal Gaussian Mixture (TGM) layer, and present how it can be used to efficiently capture longer-term temporal information in activity videos. Our temporal Gaussian mixture layer is a temporal convolutional layer, whose filters/kernels are controlled by a set of (temporal) Gaussian distribution parameters. Each of our temporal Gaussian distributions specify (temporally) ‘where’ the model should look, and our Gaussian mixture layer combines them as multiple convolutional filters to be applied on top of temporallycontinuous representations. This layer allows the video representation at each time step to be constructed while focusing on different neighboring temporal regions, instead of only focusing on its local segment. It is a convolutional layer governed by a much smaller set of parameters (i.e., locations/variances of the Gaussians as well as their mixture weights) that are fully differentiable.
+
+The motivation behind our temporal Gaussian mixture layer is to learn the temporal structure of an activity as a composition of temporal Gaussian regions/attentions. Such structure allows the model to obtain a compact spatio-temporal representation abstracting each (long-term) time interval, using multiple temporal conv. layers with far fewer parameters. It is also related to the previous temporal attention works (Piergiovanni et al., 2017), but our model is designed to be fully convolutional to handle continuous data and it learns more compositional structures with multiple layers.
+
+We present video-CNN models using our TGM layers for activity detection in continuous videos. Our model stacks TGM layers on top of several state-of-the-art CNNs such as I3D (Carreira & Zisserman, 2017). This enables our model to capture longer-term temporal information than what we use as base CNNs, compositionally modeling temporal structure with multiple TGM layers. Our model was evaluated on multiple public datasets including MultiTHUMOS and Charades, and was able to outperform the best previous activity detection CNNs by a meaningful margin.
+
+# 2 RELATED WORKS
+
+Learning video representations for human activity recognition has been successful. CNN methods allow end-to-end learning of video features and representations optimized for the training data, performing superior to traditional works (Aggarwal & Ryoo, 2011) for video understanding.
+
+Two-stream CNN models take a single RGB frame and a small number of optical flow frames as inputs to capture both motion and appearance information in videos (Simonyan & Zisserman, 2014; Feichtenhofer et al., 2016). Models learning 3-D spatio-temporal (XYT) convolutional filters were designed and applied to many activity recognition tasks as well (Tran et al., 2014; Carreira & Zisserman, 2017; Tran et al., 2017; Hara et al., 2017). Large scale datasets for activity detection, such as THUMOS (Jiang et al., 2014), ActivityNet (Heilbron et al., 2015), Kinetics (Kay et al., 2017), and Charades (Sigurdsson et al., 2016b) provided these approach the necessary training data to learn the models. Such 3-D XYT CNNs were also used to capture spatio-temporal information for activity detection (Xu et al., 2017; Shou et al., 2016; 2017; Zhao et al., 2017). However, all these CNNs were limited to the consideration of a fixed local video segment (e.g., 16 frames in (Tran et al., 2014) and 64-99 frames in (Carreira & Zisserman, 2017)) when making activity decisions.
+
+Some works studied combining representations over longer-term temporal intervals (Karpathy et al., 2014; $\mathrm { N g }$ et al., 2015; Varol et al., 2017), but it was generally done with a temporal pooling of local representations or (spatio-)temporal convolutions with a bit larger fixed intervals. Recurrent neural networks (RNNs) have also been used to model activity transitions between frames (Yeung et al., 2015; 2016; Escorcia et al., 2016), but they were strictly sequential and had limitations in maintaining temporal information over a longer temporal duration, particularly for videos with multiple complex activities. Recently, CNN models using temporal attention for activity videos (Piergiovanni et al., 2017; Piergiovanni & Ryoo, 2018b) were studied as well. However, a fully convolutional model to analyze continuous videos while efficiently representing information in long term intervals has been lacking.
+
+Our layer is different from the previous standard (spatio-)temporal convolutional layers in that it relies on significantly fewer parameters by forcing filter shapes to be Gaussian compositions. Our temporal layer is also different from previous Gaussian Mixture Model layers (Variani et al., 2015) in that our layer is convolutional while they are not.
+
+# 3 APPROACH
+
+In this section, we introduce a new convolutional layer named the Temporal Gaussian Mixture (TGM) layer, and present how it can be used for activity recognition. Our Temporal Gaussian Mixture layer is a temporal convolutional layer to be applied on top of a sequence of representations (usually from frame-level or segment-level CNNs), whose filters/kernels are controlled by a set of (temporal) Gaussian distribution parameters. The motivation is to make each temporal Gaussian distribution specify (temporally) ‘where to look’ with respect to the activity center, and represent the activity as a collection/mixture of such temporal Gaussians convolved with video features. Our layer is fully differentiable and trainable using standard backpropagation.
+
+Our TGM layer can be interpreted as a a form of 1-D convolution where the filters are determined by a mixture of Gaussians. However, our TGM layer differs from the standard temporal convolutional layers of learning 1-D (time) or 2-D (channel-by-time) filters in the following aspects:
+
+1. Our temporal Gaussian mixture layer handles multiple 3-D tensors internally to preserve channels from the frame-level CNN by adding a new temporal channel axis. Its input is 3-D (channel-by-channel-by-time), where one channel dimension is inherited from the frame-level CNN and this dimension size remains unchanged.
+2. Instead of learning temporal convolution filters of any arbitrary values, our filter is forced to have the form of a temporal Gaussian mixture shared across all frame-level channels. This allows the layer to rely on significantly fewer number of (fully differentiable) parameters, while capturing the concept of temporal structure/attention.
+
+
+Figure 1: Example illustrating how our Temporal Gaussian Mixture layer is computed. Multiple $( M )$ temporal Gaussian distributions are learned, and they are combined with the learned soft attention weights to form the $C$ temporal convolution filters. $L$ is the temporal length of the filter.
+
+# 3.1 TEMPORAL GAUSSIAN MIXTURE LAYER
+
+Our temporal Gaussian mixture layer takes a 3-D input with the dimensionality of $C _ { i n } \times D \times T$ , where $\dot { C } _ { i n }$ is the number of input channels, $D$ is the dimensionality of the representations from frame-level (or segment-level) CNNs, and $T$ is the time. Given such input, the TGM layer convolves it with $C _ { o u t }$ number of $1 \times L$ filters/kernels, generating a $C _ { o u t } \times D \times T$ -dim representation as an output. $L$ is the temporal length of the temporal Gaussian mixture filter. $D$ is usually 1K or 4K and $T$ is the number of time steps (frames) in each video (i.e., it varies per video). $C _ { o u t }$ is the number of different mixtures, corresponding to the number of output channels in standard convolution.
+
+Our layer is composed of a set of $M$ Gaussians. Each Gaussian has 2 parameters: a center $\hat { \mu }$ and a width $\hat { \sigma }$ . Each layer has additional hyper-parameters: $L$ , the temporal duration and $M$ , the number of Gaussians to learn. We force the learned center to be between ${ \bar { - } } { \frac { L } { 2 } }$ and $\begin{array} { l } { { \frac { L } { 2 } } } \end{array}$ and $\sigma$ to be positive:
+
+$$
+\mu = ( L - 1 ) \cdot \frac { \operatorname { t a n h } { ( \hat { \mu } + 1 ) } } { 2 } , \sigma ^ { 2 } = \exp { ( \hat { \sigma } ) } .
+$$
+
+We use the above $\mu$ and $\sigma$ to construct the temporal Gaussian kernels. This acts as a strong sparsity constraint on the convolutional kernel as well as a drastic reduction of the number of learnable parameters. We construct a temporal Gaussian mixture convolutional kernel as:
+
+$$
+\hat { K } _ { m , l } = \frac { 1 } { Z } \exp { - \frac { ( l - \mu _ { m } ) ^ { 2 } } { 2 \sigma _ { m } ^ { 2 } } }
+$$
+
+where $Z$ is a normalization constant such that $\begin{array} { r } { \sum _ { l } ^ { L } \hat { K } _ { m , l } = 1 } \end{array}$ , resulting in $\hat { K }$ being an $M \times L$ matrix.
+
+Instead of making the model learn a separate set of Gaussian distributions per activity class, we take the approach of maintaining multiple Gaussian distributions shared across classes and obtain a Gaussian ‘mixture’ filter by learning soft-attention weights. We learn a set of soft-attention weights per output channel $i$ , $\omega \in \overline { { \mathcal { R } } } ^ { C _ { o u t } \times \breve { M } }$ . We create the soft-attention weights by applying the softmax function over the $M$ Gaussians, enforcing each input channel weights sum to 1.
+
+$$
+a _ { i , m } = \frac { \exp \omega _ { i , m } } { \sum _ { j } \exp \omega _ { i , j } }
+$$
+
+Based on temporal Gaussian distributions $\hat { K } _ { i }$ and attention weights $a _ { i , m }$ , the temporal convolution filters our TGM layer is computed as:
+
+$$
+K _ { i } = \sum _ { m } a _ { i , m } \hat { K } _ { i } .
+$$
+
+This provides us convolutional filters having the form of a mixture of temporal Gaussians, controlled based on $2 \cdot M + C _ { i n } \cdot C _ { o u t } \cdot M$ parameters (instead of learning $D ^ { 2 } \cdot L$ parameters without any constraint, as in standard temporal convolution where $C < < D$ ). An overview of this process is shown in Fig. 1.
+
+# 3.1.1 SINGLE TGM LAYER - DIRECT PER-CLASS ACTIVITY MODELING
+
+The representation we obtain by applying our base CNNs to each frame (or local segment) has the dimensionality of $D$ , and stacking them along time axis provides us the representation with
+
+
+Figure 2: Illustration of a TGM layer with grouped convolution. This layer learns a set of $C$ Gaussian mixtures that are convolved with the input channels.
+
+$1 \times D \times T$ -dim. That is, in the case of using only one TGM layer to capture activity representations, our $C _ { i n }$ is fixed to 1 and $C _ { o u t }$ is fixed to be the number of activity classes. This is the simplest case of our model, attaching one TGM layer on top of the $1 \times D \times T$ representation.
+
+Our convolutional kernel, $K$ , has a learned Gaussian mixture for each activity class. Let the video features $v$ be a $D \times T$ matrix. Each $K _ { i }$ is a 2-D convolutional filter with a size of $1 \times L$ , and convolving this with $v$ provides us a representation $S$ with $C _ { o u t }$ number of $D \times T$ responses since $C _ { i n }$ is 1 in this case. This per-class representation can then be used as input to a fully-connected layer for activity classification. For $i \in \mathsf { \bar { \{ 1 , 2 , \ldots , C _ { o u t } \} } }$ :
+
+$$
+s _ { i } = v * K _ { i } , \ S = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { C _ { o u t } } ]
+$$
+
+Fig. 7 in the appendix visually illustrates how each TGM filter is convolved with the input (Fig. 7d), compared to the standard 1-D convolution (Fig. 7a) or other forms of the temporal layers (Fig. 7b-c).
+
+# 3.1.2 MULTIPLE TGM LAYERS - GROUPED CONVOLUTION
+
+We generalize the above formulation to allow the TGM layers to be sequentially applied. The idea is to enable our model to capture more complex, nonlinear temporal structure by having multiple levels of temporal layers. In this case, the input for each layer is $C _ { i n } \times D \times T$ dimensional (instead of $1 \times D \times T$ ), where the input channels are the number of output channels from the previous layer. Our kernels at each layer, $K _ { i }$ , are parameterized and learned as before.
+
+By using grouped convolution with the number of groups set to $C _ { i n }$ , we can efficiently separate the input into per-channel values and convolve each of them with the designated $K _ { i }$ kernel, as shown in Fig. 2. That is, we learn a filter $K _ { i }$ per channel by setting $C _ { i n } = C _ { o u t }$ . For $i \in [ 1 , C _ { o u t } ]$ ,
+
+$$
+s _ { i } = f _ { i } * K _ { i } , ~ S = [ s _ { 1 } , s _ { 2 } , . ~ . ~ . s _ { C _ { o u t } } ]
+$$
+
+Here, $f$ is a $C _ { i n } \times D \times T$ tensor, where $D$ is the dimensionality of the feature and $T$ is the number of frames. The result of the per-channel convolution, $s _ { i }$ , is a $D \times T$ representation. We concatenate these representations along the channel axis, resulting in $S$ , a $C _ { o u t } \times D \times T$ representation. As this convolution results in the same output shape, we can stack these layers. Each layer is able to capture increasing temporal resolution, allowing the model to capture levels of abstractions.
+
+# 3.1.3 MULTIPLE TGM LAYERS - CHANNEL COMBINATION
+
+In the above subsection, we introduced an approach of stacking multiple TGM layers to model a hierarchical composition of temporal representations. However, in the grouped convolution case, each output channel of the layer is solely dependent on its corresponding input channel. That is, each kernel only considers information from a single output channel of the previous layer.
+
+Therefore, we further generalize our TGM layer so that the layer combines representations from multiple input channels for each output channel while using the learned temporal kernels. We learn a set of convolutional kernels $K \in \mathop { \mathcal { R } } ^ { C _ { o u t } \times C _ { i n } \times L }$ (i.e., we learn $C _ { o u t } \cdot C _ { i n }$ Gaussian mixtures). Given $f$ which is the $C _ { i n } \times D \times T$ representation, for each output channel $i \in [ 1 , C _ { o u t } ]$ and each input channel $j \in [ 1 , C _ { i n } ]$ pair, we convolve the associated filters with the input.
+
+$$
+G _ { i , j } = ( f _ { j } * K _ { i , j } )
+$$
+
+where each $G _ { i , j }$ is a $D \times T$ -dim representation.
+
+We then learn a 1x1 convolution followed by a ReLU activation function for each $i \in [ 1 , C _ { o u t } ]$ , which we call $w _ { i }$ , that maps from $C _ { i n }$ channels to 1 channel. The 1x1 convolution learns to combine
+
+
+Figure 3: Illustration of a TGM layer with channel combination. The kernels are applied to each input channel, $C _ { i n }$ , and a 1x1 convolution is applied to combine the $C _ { i n }$ input channels for each output channel, $C _ { o u t }$ .
+
+the channels from the previous layer. By design, the TGM kernel is positive and sums to 1. Adding the unconstrained 1x1 convolution adds non-linearity (using the ReLU activation function) to our layer and only adds $C _ { o u t } \cdot C _ { i n }$ parameters.
+
+$$
+s _ { i } = G _ { i } * w _ { i } = ( f _ { j } * K _ { i , j } ) * w _ { i } , \ S = [ s _ { 1 } , s _ { 2 } \ldots , s _ { C _ { o u t } } ]
+$$
+
+We then stack the $s _ { i }$ representations along the channel axis to produce $S$ , the $C _ { o u t } \times D \times T$ -dim representation. This process is illustrated in Fig. 3. This method generalizes our approach to allow the layer to take input of $C _ { i n } \times D \times T$ and produce output of $C _ { o u t } \times D \times T$ . These layers can easily be stacked to learn a hierarchical representation.
+
+# 3.2 VIDEO CNN MODELS WITH TGM LAYERS
+
+Our goal is to do activity detection which we define as making a per-frame (or per-segment) classification. Given a video, at each time step $t$ , we want to make the model decide which activity the frame corresponds to (including no-activity). As a baseline, we train a fully-connected layer that classifies each per-frame $D$ -dimensional vector, $v _ { t }$ . As multiple activities can occur at the same time, or no activities at all, we treat this as a mutli-label classification task. We minimize binary cross entropy:
+
+$$
+L ( v ) = \sum _ { t , c } z _ { t , c } \log ( p ( c | v _ { t } ) ) + ( 1 - z _ { t , c } ) \log ( 1 - p ( c | v _ { t } ) )
+$$
+
+where $z _ { t , c }$ is the ground truth label, 1 if activity $c$ is occurring at time $t$ and $p ( c | v _ { t } )$ is the output of our model for class $c$ at time $t$ . Fig. 4 shows an example CNN.
+
+
+Figure 4: An overview of an example video CNN model with two TGM layers. It is able to handle videos with any length, because of its fully convolutional design.
+
+# 4 EXPERIMENTS
+
+# 4.1 IMPLEMENTATION AND BASELINES
+
+Implementation We used I3D (Carreira & Zisserman, 2017) and the two-stream version of InceptionV3 (Szegedy et al., 2016) pretrained on Imagenet and Kinetics as our base per-frame CNNs. Our default $L$ setting used for the TGM layers as well as the other baselines was as follows: when using I3D segment features (collected at 3fps), the 1 layer models used $L = 1 5$ and the 3 layer models used $L = 5$ . When using InceptionV3 frame feature (collected at 8fps), the 1 layer models used $L = 3 0$ and the 3 layer models used $L = 1 0$ . These layers were attached on top of the base CNN, as described in Subsection 3.2. Please check the appendix for implementation and training details and results on other datasets.
+
+Baselines In order to confirm the advantages of our TGM layers, particularly against previous temporal models, we implemented several baselines. The first is (i) a standard per-frame classifier in which the prediction at each time-step only depends on a single feature vector with no contextual temporal information. We also used (ii) LSTMs on top of per-frame representations, which were popularly used to capture temporal information (Donahue et al., 2015). We train a bi-directional LSTM with 512 hidden units to make per-frame predictions. We also tried (iii) the fixed pyramid temporal max-pooling of level 3 (Ryoo et al., 2015). Finally, we compare our model against (iv) the model with standard temporal convolutional layers (i.e., 1-D convolution with a $D \times L$ kernel) on top of per-frame representations. This is similar to the temporal conv. used in (Tran et al., 2018). Temporal lengths (i.e., $L$ ) of the 1-D conv. filters and the pooling windows were set to be identical to the TGM filters. That is, they capture the same temporal duration as TGMs. In all our experiments, we follow the standard evaluation setting of computing per-frame mean average precision (mAP) and report those values. We also compare to different versions of the TGM layer, (v) with a learned mixture of random temporal filters and (vi) with a learned mixture of fixed Gaussians.
+
+In addition, we also tried the approach of combining our TGM layers with the recent super-event representations (Piergiovanni & Ryoo, 2018b). We concatenated the learned super-event representation with our representations from TGM layers.
+
+# 4.2 MULTITHUMOS
+
+Dataset MultiTHUMOS (Yeung et al., 2015) is an extended version of the THUMOS (Jiang et al., 2014) dataset that densely annotates the continuous videos. The dataset consists of 65 different classes, compared to 20 in THUMOS, and contains on average 10.5 activities per video and 1.5 labels per frame and up to 25 activity instances in each video. This is in contrast to many other activity detection dataset such as ActivityNet (Heilbron et al., 2015), which only has on average ${ \sim } 1$ activity per video. MultiTHUMOS consists of YouTube videos of various sport activities such as basketball games, volleyball games, weight lifting, and track and field.
+
+We followed the standard MultiTHUMOS evaluation setting of measuring mAP based on per-frame annotations. There are 1010 validation videos and 1574 test videos. We used these continuous validation videos for the training of our models. We did not need to take advantage of the separate training set with segmented videos; even without them, we outperformed the state-of-the-arts.
+
+Results We compared baselines as well as multiple different versions of our architectures, shown in Table 1. The model with our TGM layers consistently outperformed baseline I3D (or InceptionV3) while using the same per-segment representations. Learning 3 TGM layers further improved the performances. On the other hand, we found that stacking multiple standard temporal convolutional layers does not improve performance, often performing worse than the baseline. While a single standard temporal conv. layer improves over the baseline, having multiple of them significantly increases the number of parameters to learn (Table 2) and we suspect that this was causing the overfitting with the limited amount of samples in the dataset. In Table 3, we compare the results of using a LSTM or temporal conv. with a similar number of parameters. This was done by making their temporal conv. filters to share values across multiple channels. These models result in nearly random performance, as they were not designed to cope with a small number of parameters. We also show results with a mixture of random (fixed) temporal filters and with a mixture of fixed Gaussians. These results confirm that (i) modeling the temporal structure as a learned Gaussian mixture is beneficial and that (ii) further learning the Gaussian distribution parameters is important.
+
+Table 1: Comparison of various architectures on MultiTHUMOS using both I3D per-segment and InceptionV3 per-frame features. We found that TGM layers with 1x1 convolution channel combination performed the best. Results are in mAP $\%$ . Note that we use the same filter length for “Temporal Conv” and “TGM” models, as described in Section 4.1.
+
+
13D
InceptionV3
Spatial
Temporal
Two-Stream
Spatial
Temporal
Two-Stream
Baseline
22.3
25.0
29.7
13.6
14.1
15.2
Temporal Conv
32.5
35.5
38.4
15.2
15.5
15.8
3 Temporal Conv
20.4
23.4
24.4
5.3
6.1
6.5
TGM layers with grouped convolution
1 TGM
35.1
37.8
40.5
16.3
17.5
18.0
3 TGM
36.4
42.3
43.5
17.5
18.3
19.2
TGM layers with channel combination
1 TGM (soft)
35.2
37.9
40.2
17.2
17.6
18.4
1 TGM (1x1)
36.1
38.2
40.8
17.2
17.7
18.4
3 TGM (soft)
36.2
40.1
42.3
17.5
19.1
21.2
3 TGM (1x1)
37.2
42.1
44.3
17.9
19.3
22.2
+
+Table 2: Additional number of parameters for models when added to the base architecture (e.g., I3D or Inception V3).
+
+
Model
# of parameters
LSTM
10.5M
1 Temporal Conv
10.5M
3 Temporal Conv
31.5M
1 TGM Layer
10K
3 TGMLayers
100K
+
+Table 3: Comparison of previous methods with comparable number of parameters and random forms of our TGM layer.
+
+
Model
mAP
LSTM with 100k parameters
6.5
Temporal Conv. with 1OOk parameters
7.3
TGM with random temporal filters
34.5
TGM with fixed Gaussians
38.5
Full TGM
44.3
+
+Learning multiple TGM layers with channel combination outperforms the grouped convolution version of TGM and all the baselines. We also experimented with a version using soft-attention weights to combine the TGM layer channels, in addition to our method (Fig. 3) of using 1x1 convolution followed by a ReLU (to gain non-linearity). We found that the 1x1 convolution performed better. We tested various number of Gaussian mixtures (i.e., output channels) and found that using 80 for the first and second layer and using 65 (i.e., number of classes) for the final layer performs best.
+
+Table 4 compares our model using TGM layers with multiple previous state-of-the-art approaches and baselines such as LSTM. Our approach meaningfully outperforms all previous approaches. Importantly, we are comparing our approach with different methods of capturing temporal information such as LSTMs and fixed temporal pyramid pooling while making them use the exactly same per-frame representations. We found that while all these methods capture some temporal information, the TGM layers provide the best performance. Further, combining the super-event representation (Piergiovanni & Ryoo, 2018b) with our TGM feature also benefited detection, confirming that our TGMs and super-events capture different aspects of the activity videos. In Fig. 5, we show an example of the various models predictions on a basketball video. We outperform the previous state-of-the-art performance (mAP) by $10 \%$ (36.4 vs. 46.4).
+
+# 4.3 CHARADES
+
+Dataset Charades (Sigurdsson et al., 2016b) is a large scale dataset with 9848 videos across 157 activity classes. These videos were recorded in home environments of the participants based on provided scripts. Each video contains on an average of 6.8 activity instances, and there are often complex activities co-occurring. The activities were mainly performed at home. For example, some activity classes are ‘preparing a meal’, ‘eating’, ‘sitting’, ‘cleaning’, etc.
+
+In our experiments, we follow the original Charades detection setting (i.e., Charades v1 localize evaluation), which is the setting used in many previous approaches (Sigurdsson et al., 2016a; Xu
+
+
+Figure 5: Illustration of the temporal regions classified as various basketball activities from a basketball game video in MultiTHUMOS. Our TGM layers greatly improve performance.
+
+Table 4: Performances of the state-of-the-art methods and our approach on MultiTHUMOS. Our approach meaningfully outperforms all previous results.
+
+
+
+et al., 2017; Piergiovanni & Ryoo, 2018b). This is the original setting more challenging than the Charades Challenge 2017 setting (whose evaluation server was no longer approving new account access), in the aspect that it uses less amount of training videos.
+
+Results We compare our results with the state-of-the-arts in Table 5. To our knowledge, our method is obtaining the best known performance in the original localization setting of the Charades dataset. Notably, it is performing better than I3D that obtained the best competition performance, while using the same feature. Our method also outperforms standard temporal convolution, LSTMs, and fixed pyramid pooling, as well as the use of latent super-events. When setting $L = 3 0$ and using 3 TGM layers, our model is able to capture around 800 frames (about $\pm 1 5$ seconds from each frame) of temporal information, significantly more than previous works (e.g., I3D only captures $\pm 2$ seconds).
+
+# 5 CONCLUSIONS
+
+We newly introduced the Temporal Gaussian Mixture (TGM) layer and demonstrated its effectiveness for multi-activity detection in continuous videos. Our layer is fully differentiable and trainable using standard backpropagation, designed to learn temporal structure. We were able to confirm that our layer performs superior to state-of-the-art methods on activity detection datasets including MultiTHUMOS and Charades, obtaining the best known performance. We also tested our approach with two more public video datasets, MLB-YouTube (Piergiovanni & Ryoo, 2018a) and AVA (Gu et al., 2017), and confirmed its advantage over the previous works in Appendix.
+
+# REFERENCES
+
+J. K. Aggarwal and M. S. Ryoo. Human activity analysis: A review. ACM Computing Surveys, 43: 16:1–16:43, April 2011.
+
+Table 5: Per-frame mAP on Charades, evaluated with the ‘Charades v1 localize’ setting. I3D models are two-stream, using both RGB and optical flow inputs.
+
+
mAP
Predictive-corrective (Dave et al., 2017) Two-stream (Sigurdsson et al., 2016a) Two-stream+LSTM (Sigurdsson et al., 2016a)
8.9 8.94 9.6
R-C3D (Xu et al., 2017) Sigurdsson et al. (Sigurdsson et al., 2016a)
+
+Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
+
+Achal Dave, Olga Russakovsky, and Deva Ramanan. Predictive-corrective networks for action detection. arXiv preprint arXiv:1704.03615, 2017.
+
+Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2625–2634, 2015.
+
+Victor Escorcia, Fabian Caba Heilbron, Juan Carlos Niebles, and Bernard Ghanem. Daps: Deep action proposals for action understanding. In Proceedings of European Conference on Computer Vision (ECCV), pp. 768–784. Springer, 2016.
+
+Christoph Feichtenhofer, Axel Pinz, and Andrew Zisserman. Convolutional two-stream network fusion for video action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1933–1941, 2016.
+
+Chunhui Gu, Chen Sun, Sudheendra Vijayanarasimhan, Caroline Pantofaru, David A. Ross, George Toderici, Yeqing Li, Susanna Ricco, Rahul Sukthankar, Cordelia Schmid, and Jitendra Malik. AVA: A video dataset of spatio-temporally localized atomic visual actions. arXiv preprint arXiv:1705.08421, 2017.
+
+Kensho Hara, Hirokatsu Kataoka, and Yutaka Satoh. Learning spatio-temporal features with 3d residual networks for action recognition. In Proceedings of the ICCV Workshop on Action, Gesture, and Emotion Recognition, volume 2, pp. 4, 2017.
+
+Fabian Caba Heilbron, Victor Escorcia, Bernard Ghanem, and Juan Carlos Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 961–970, 2015.
+
+Y.-G. Jiang, J. Liu, A. Roshan Zamir, G. Toderici, I. Laptev, M. Shah, and R. Sukthankar. THUMOS challenge: Action recognition with a large number of classes. http://crcv.ucf.edu/THUMOS14/, 2014.
+
+Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li FeiFei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1725–1732, 2014.
+
+Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
+
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Joe Yue-Hei $\mathrm { N g }$ , Matthew Hausknecht, Sudheendra Vijayanarasimhan, Oriol Vinyals, Rajat Monga, and George Toderici. Beyond short snippets: Deep networks for video classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4694– 4702. IEEE, 2015.
+
+AJ Piergiovanni and Michael S. Ryoo. Fine-grained activity recognition in baseball videos. In CVPR Workshop on Computer Vision in Sports, 2018a.
+
+AJ Piergiovanni and Michael S. Ryoo. Learning latent super-events to detect multiple activities in videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018b.
+
+AJ Piergiovanni, Chenyou Fan, and Michael S Ryoo. Learning latent sub-events in activity videos using temporal attention filters. In Proceedings of the American Association for Artificial Intelligence (AAAI), 2017.
+
+Michael S Ryoo, Brandon Rothrock, and Larry Matthies. Pooled motion features for first-person videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 896–904, 2015.
+
+Zheng Shou, Dongang Wang, and Shih-Fu Chang. Temporal action localization in untrimmed videos via multi-stage cnns. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1049–1058, 2016.
+
+Zheng Shou, Jonathan Chan, Alireza Zareian, Kazuyuki Miyazawa, and Shih-Fu Chang. Cdc: Convolutional-de-convolutional networks for precise temporal action localization in untrimmed videos. arXiv preprint arXiv:1703.01515, 2017.
+
+Gunnar A Sigurdsson, Santosh Divvala, Ali Farhadi, and Abhinav Gupta. Asynchronous temporal fields for action recognition. arXiv preprint arXiv:1612.06371, 2016a.
+
+Gunnar A. Sigurdsson, Gul Varol, Xiaolong Wang, Ali Farhadi, Ivan Laptev, and Abhinav Gupta. ¨ Hollywood in homes: Crowdsourcing data collection for activity understanding. In Proceedings of European Conference on Computer Vision (ECCV), 2016b.
+
+Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In Advances in Neural Information Processing Systems (NIPS), pp. 568–576, 2014.
+
+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 (CVPR), pp. 2818–2826, 2016.
+
+Du Tran, Lubomir D Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. C3d: generic features for video analysis. CoRR, abs/1412.0767, 2(7):8, 2014.
+
+Du Tran, Jamie Ray, Zheng Shou, Shih-Fu Chang, and Manohar Paluri. Convnet architecture search for spatiotemporal feature learning. arXiv preprint arXiv:1708.05038, 2017.
+
+Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6450–6459, 2018.
+
+Ehsan Variani, Erik McDermott, and Georg Heigold. A gaussian mixture model layer jointly optimized with discriminative features within a deep neural network architecture. In Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on, pp. 4270– 4274. IEEE, 2015.
+
+Gul Varol, Ivan Laptev, and Cordelia Schmid. Long-term Temporal Convolutions for Action Recog- ¨ nition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
+Huijuan Xu, Abir Das, and Kate Saenko. R-c3d: Region convolutional 3d network for temporal activity detection. arXiv preprint arXiv:1703.07814, 2017.
+Serena Yeung, Olga Russakovsky, Ning Jin, Mykhaylo Andriluka, Greg Mori, and Li Fei-Fei. Every moment counts: Dense detailed labeling of actions in complex videos. International Journal of Computer Vision (IJCV), pp. 1–15, 2015.
+Serena Yeung, Olga Russakovsky, Greg Mori, and Li Fei-Fei. End-to-end learning of action detection from frame glimpses in videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2678–2687, 2016.
+Christopher Zach, Thomas Pock, and Horst Bischof. A duality based approach for realtime tv-l 1 optical flow. In Joint Pattern Recognition Symposium, pp. 214–223. Springer, 2007.
+Yue Zhao, Yuanjun Xiong, Limin Wang, Zhirong Wu, Xiaoou Tang, and Dahua Lin. Temporal action detection with structured segment networks. arXiv preprint arXiv:1704.06228, 2017.
+
+# A IMPLEMENTATION DETAILS
+
+As our base per-segment CNN, we use the I3D (Carreira & Zisserman, 2017) network pretrained on the ImageNet and Kinetics (Kay et al., 2017) datasets. I3D obtained state-of-the-art results on segmented video tasks, and this allows us to obtain reliable $v _ { t }$ . We also use two-stream version of InceptionV3 (Szegedy et al., 2016) pretrained on Imagenet and Kinetics as our base per-frame CNN, and compared them. We chose InceptionV3 as it is deeper than previous two-stream CNNs such as (Simonyan & Zisserman, 2014; Feichtenhofer et al., 2016). We extracted frames from the videos at 25 fps, computed TVL1 (Zach et al., 2007) optical flow, clipped to $[ - 2 0 , 2 0 ]$ . For InceptionV3, we computed features for every 3 frames (8 fps). For I3D, every frame was used as the input. I3D has a temporal stride of 8, resulting in 3 features per second (3 fps).
+
+We implemented our TGM layers as well as other baseline layers in PyTorch. Our default setting was as follows: for 3-layer models, we set $L = 1 0$ for frame-based features (i.e., InceptionV3) and $L = 5$ for segment-based features (i.e., I3D), as each segment already contains some temporal information. For 1-layer models, we set $L = 3 0$ for frame-based features and $L = 1 5$ for segmentbased features. We set $M = 1 6$ and $C _ { o u t } = 8 0 $ and $C _ { o u t } = 6 5$ for the last TGM layer. We found these values to work well on a held out portion of the training set of MultiTHUMOS. In all models, we used one fully-connected layer at the end to make the per-frame or per-segment classification.
+
+We trained our models using the Adam (Kingma & Ba, 2014) optimizer with the learning rate set to 0.01. We decayed the learning rate by a factor of 10 after every 10 training epochs. We trained our models for 50 epochs. We plan to make all our source code and trained models publicly available once the paper is published.
+
+# B HYPERPARAMETER EXPERIMENTS
+
+We conducted a set of experiments to compare the effects of the temporal duration, $L$ , number of Gaussians, $M$ , and the number of output channels, $C _ { o u t }$ . For these experiments, we only used the one-stream version of I3D with RGB inputs.
+
+Effect of $L$ : In Table 6, we compare different values of $L$ . For these experiments, we use $M = 1 6$ and $C _ { o u t } = 1 6$ . We find that the 3-layer model with $L = 5$ performs the best. With I3D features, this allows the model to capture up to 8 seconds of information. The average activity in MultiTHUMOS is 3.3 seconds long and the maximum is 14.7 seconds long, and with this setting, the model is able to capture enough temporal context to perform well. Larger values of $L$ capture too much temporal information, but due to the Gaussian structure, it does not drastically harm performance. Figure 6 shows that even with longer kernels, the Gaussians learn to focus mostly on the center of the interval and capture the rough duration of the activities. Thus, having too long intervals does not drastically harm performance, which is in contrast to the standard 1-D convolution. Note that for Charades, the temporal kernels are learned to capture much longer temporal duration, as the average activity in charades is 12.8 seconds and larger values of $L$ perform better.
+
+Figure 6 illustrates examples of the learned TGM kernels of various lengths. The figure shows that the kernels focus on short temporal intervals on MultiTHUMOS even if we make the filters longer, as the activities are an average of 3.3 seconds long. On Charades, the TGM kernels learn to capture much longer intervals, as the activities are an average of 12.8 seconds long. We believe that this suggests TGMs are learning to capture information from the important necessary intervals.
+
+In Table 6, we also report the results of using a standard 1-D conv. layer with different $L$ values. The number of parameters in our TGM layer is independent of $L$ , however, with the standard 1-D conv. layer, the number of parameters increases as $L$ increases. We find that increasing $L$ with 1-D convolution helps for small values of $L$ , but for $L > 1 5$ , the performance drastically drops, while TGM layers only show a small decrease.
+
+Effect of $M$ : In Table 7, we compare different values of $M$ . For these experiments, we set $L = 1 5$ and $C _ { o u t } = 1 6$ . We find that $M = 1 6$ performs best, suggesting that smaller values of $M$ restrict the possible temporal kernels too much. We also observe that larger values of $M$ performs slightly worse than $M = 1 6$ (but not much), likely because they introduce more parameters than needed. When $M$ and $L$ have similar values, it allows the model to learn a sufficient number of Gaussians and create a diverse range of temporal kernels. When $M$ is larger than $L$ , it results in learning a kernel similar to standard 1-D convolution.
+
+Table 6: Effect of $L$ on MultiTHUMOS and Charades using only RGB I3D features. Note that the 3 TGM layer models have larger temporal resolution than the 1 TGM layer models for the same values of $L$ . We also compare to using standard one-layer 1-D conv layer with different values of $L$ .
+
+
MultiTHUMOS
Charades
1 Layer
3 Layers
1-D Conv
1 Layer
3 Layers
1-D Conv
I3DBaseline
22.3
=
=
15.3
=
=
L=3
30.2
31.7
26.6
15.5
16.1
15.5
L=5
32.5
37.2
28.3
15.7
17.8
16.3
L=10
34.5
35.4
31.7
16.1
18.2
16.6
L=15
36.1
34.1
32.5
17.5
18.6
16.8
L=30
32.5
33.9
26.5
18.1
18.9
12.1
L= 50
32.1
33.7
15.4
18.3
18.8
6.7
+
+Table 7: Comparison of various values of $M$ on MultiTHUMOS and Charades using RGB I3D features. For these experiments, 1 layer was used with $L = 1 5$ and $C _ { o u t } = 1 6$ .
+
+
MultiTHUMOS
Charades
M=2
27.8
15.5
M=4
33.1
16.2
M=8
34.8
17.5
M=16
36.1
17.5
M= 32
35.7
17.1
M= 64
35.8
17.3
+
+Table 8: Comparison of values of $C _ { o u t }$ on MultiTHUMOS and Charades using RGB I3D features. For these experiments, 1 layer was used with $L = 1 5$ and $M = 1 6$ .
+
+
MultiTHUMOS
Charades
Cout 1
33.5
16.2
Cout 4
34.2
17.4
Cout 8
35.5
17.5
Cout 16
36.1
17.5
Cout 32
36.0
17.2
Cout 64
36.1
17.4
Cout = 80
36.1
17.5
+
+Effect of $C _ { o u t }$ : In Table 8, we compare different values of $C _ { o u t }$ . For these experiments, $L =$ 15, we used 1-layer and $M = 1 6$ . We find that $C _ { o u t }$ performs best when set to 16 or larger on these datasets. Larger values of $C _ { o u t }$ seem to capture redundant information, as it does not lower performance.
+
+
+Figure 6: Illustration of several learned TGM kernels. On MultiTHUMOS, it learns to focus on shorter intervals to capture shorter events. On Charades, the Gaussians have a larger $\sigma$ value, resulting in filters that attend to longer temporal durations.
+
+
+Figure 7: (a-c) Different forms of 1-D temporal convolutions which take a $D \times T$ input and produces a $C \times T$ output based on $C$ number of $D \times L$ kernels: (a) the standard 1-D convolution, $\mathbf { ( b ) }$ using Gaussian mixtures for 1-D convolution while sharing Gaussian mixtures across input channels, and (c) using $D$ different Gaussian mixtures for 1-D convolution. (d) Our TGM layer in its simplest form (i.e., 1-layer case) applying the $1 \times L$ temporal kernel in a 2-D convolutional fashion, maintaining both time and feature axis.
+
+
+Figure 8: A temporal convolutional layer with channel combination similar to Fig. 3. The difference is that this layer does not learn Gaussian mixtures, but unconstrained 1-D temporal kernels.
+
+# C COMPARISON OF DIFFERENT LAYER FORMS
+
+To confirm the various aspects of our design, we conducted experiments comparing different types of temporal convolution. In Fig. 7a we illustrate the standard 1-D convolution, taking $D \times T$ input and producing a $C \times T$ output, where $D$ is the number of input channels and $C$ is the number of output channels. In Fig. 7b, we illustrate the method of applying a Gaussian mixture kernel as 1-D convolution. Here, the Gaussian mixture kernel is shared by all $D$ input channels and we learn a $C$ number of such kernels. In Fig. 7c, we illustrate the approach of applying a Gaussian mixture kernel as 1-D convolution while learning $D$ different Gaussian mixtures. This is very similar to the standard 1-D convolution, except that the filter values are constrained to have the shape of Gaussian mixtures.
+
+Fig. 8 illustrates one more baseline. This is similar to our full TGM layer with the channelcombination described Fig. 3. However, in this baseline, instead of learning Gaussian mixtures, we learn $C _ { i n } \cdot C _ { o u t }$ number of $1 \times L$ kernels. The kernel values are left unconstrained. While the TGM layer has $2 \cdot M + C _ { i n } \cdot C _ { o u t } \cdot M + C _ { i n } \cdot C _ { o u t }$ parameters, this layer has $L \cdot C _ { i n } \cdot C _ { o u t } \cdot M + C _ { i n } \cdot C _ { o u t }$ , which is more than the TGM layer.
+
+In Table 9, we compare the results of the various above-mentioned layers on MultiTHUMOS using RGB I3D features. We find that the Fig. 7b method performs poorly, while the Fig. 7c method slightly outperforms the standard 1-D convolution. The Fig. 8 method is slightly better than the standard 1-D convolution, but performs worse than Fig. 7c. However, none of these layers perform as well as our TGM layer, confirming that both the design of learning Gaussian mixtures and maintaining temporal channel axis are important for activity detection.
+
+Table 9: Comparison of the different forms of temporal convolution on MultiTHUMOS using RGB I3D features. We set $L = 1 5$ and used 1 layer models for these experiments.
+
+
MultiTHUMOS
Standard 1-D Convolution (Fig. 7a)
32.5
The layer described in Fig.7b
28.6
The layer described in Fig. 7c
33.2
The layer described in Fig. 8
32.8
Our TGM Layer
36.1
+
+
+Figure 9: Examples of several of the activities in the MLB-YouTube dataset: (a) Pitch, (b) Hit, (c) Bunt, (d) Hit by pitch, (e) No activity. This shows the difficulty of this dataset, as the difference between hit and bunt, swing and no swing are very small.
+
+# D EXPERIMENTS ON ADDITIONAL DATASETS
+
+# D.1 MLB-YOUTUBE DATASET
+
+# D.1.1 DATASET
+
+The MLB-YouTube dataset (Piergiovanni & Ryoo, 2018a) consists of 20 baseball games from the 2017 MLB post-season available on YouTube. This dataset consists of over 42 hours of video. For these experiments, we used the continuous video setting which have 2,126 1-2 minute long clips. Each clip is densely annotated with the baseball activities that occur. There are 8 activity classes: pitch, strike, ball, swing, hit, foul, hit by pitch, and bunt. Examples of some of these classes are shown in Fig. 9. Each continuous clip contains on average of 7.2 activities, giving a total of over 15,000 activity instances in the dataset.
+
+What makes this dataset challenging is that the variation between classes is very small. In ActivityNet (Heilbron et al., 2015), for example, the difference between swimming and brushing hair is drastic. The background, motion, and even size of the person in the video is different. However, in broadcast baseball videos, the difference between a ball and a strike, or a swing and a bunt, are small. All actions are recorded from the same camera angle as we can confirm from Fig. 9.
+
+# D.1.2 RESULTS
+
+In Table 10, we compare various approaches on this dataset. Our TGM layers improve over the baseline by ${ \sim } 6 \%$ (40.1 vs. 34.2). Additionally, we compare to methods using the super-event representation (Piergiovanni & Ryoo, 2018b), which previously achieved state-of-the-art performance on several activity detection datasets. On this dataset, our approach outperforms the super-event representation, and further the concatenation of our TGM representation with such super-event representation performs best by a significant margin $\sim 1 3 \%$ compared to the baseline). This suggests that TGMs and super-event capture different temporal information and are both useful to the detection task.
+
+We further find that using multiple, standard temporal convolution layers leads to worse performance, likely due to overfitting from the large number of parameters. While using multiple TGM layers improves performance, confirming that the Gaussian structure and sparsity constraint benefits model learning.
+
+Table 10: Result mAP on the MLB-YouTube dataset using InceptionV3 and I3D to obtain features. Our TGM layers significantly outperform the baseline models.
+
+
Model
Spatial
Temporal
Two-stream
Random
13.4
13.4
13.4
InceptionV3
31.2
31.8
31.9
InceptionV3 +LSTM
32.1
33.5
34.1
InceptionV3 +1 temporal conv
32.8
34.4
35.2
InceptionV3 + 3 temporal conv
28.4
29.8
30.1
InceptionV3 + super-events
31.5
36.2
39.6
InceptionV3 +1TGM
32.4
36.3
37.4
InceptionV3+3 TGM
33.2
38.2
38.2
InceptionV3 + 3 TGM+super-events
34.6
42.4
42.9
I3D
33.8
35.1
34.2
I3D + LSTM
36.2
37.3
39.4
I3D +1 temporal conv
37.3
38.6
39.9
I3D + 3 temporal conv
32.4
34.6
35.6
I3D + super-events
38.7
38.6
39.1
I3D+1TGM
35.5
37.5
38.5
I3D+3 TGM
36.5
38.4
40.1
I3D +3 TGM+super-events
39.4
46.0
47.1
+
+Table 11: Results on AVA dataset with the temporal annotation-only setting (i.e., frame classification without using bounding box training labels).
+
+
mAP
Random
2.65
I3D baseline
7.5
I3D + 3 temporal conv. layers
7.9
I3D+LSTM
7.8
I3D + super-events(Piergiovanni & Ryoo,2018b)
9.8
I3D+1TGMs
11.2
I3D +3 TGMs
14.5
I3D +3 TGMs + super-events
14.9
+
+# D.2 AVA
+
+# D.2.1 DATASET
+
+AVA (Gu et al., 2017) is a large-scale video dataset containing of 80 atomic action classes in $5 7 \mathrm { k }$ video clips. These clips are drawn from movies. Existing datasets, such as Charades, have very specific actions that depend on objects, such as holding a cup vs. holding a picture. In AVA, the actions are intentionally generic, such as sit, stand, hold, carry, etc. Further, the AVA dataset is annotated with both spatial and temporal locations of activities. Since we are interested in temporal activity detection, we follow the setting of Piergiovanni & Ryoo (2018b) and label each frame with the occurring activities while ignoring the spatial location. We evaluate performance following the same method as MultiTHUMOS, Charades and MLB-YouTube by measuring per-frame mAP.
+
+# D.2.2 RESULTS
+
+In Table 11, we present the results of our model. We again find that temporal convolution and LSTMs provide some benefit over the baseline, but TGM layers further improve performance. Again, combining the TGM, which captures local temporal structure, with super-events which capture global temporal structure, provides the best performance by $\sim 7 . 4 \%$ .
\ No newline at end of file
diff --git a/md/train/HyxhqhVKPB/HyxhqhVKPB.md b/md/train/HyxhqhVKPB/HyxhqhVKPB.md
new file mode 100644
index 0000000000000000000000000000000000000000..2bd6f2791035be99c8e03266d1386a85642831c2
--- /dev/null
+++ b/md/train/HyxhqhVKPB/HyxhqhVKPB.md
@@ -0,0 +1,1867 @@
+# MONIQUA: MODULO QUANTIZED COMMUNICATION IN DECENTRALIZED SGD
+
+Anonymous authors Paperunder double-blind review ABSTRACT
+
+Decentralized stochastic gradient descent (SGD), where parallel workers are connected to form a graph and communicate adjacently, has shown promising results both theoretically and empirically. In this paper we propose Moniqua, a technique that allows decentralized SGD to use quantized communication. We prove in theory that Moniqua communicates a provably bounded number of bits per iteration, while converging at the same asymptotic rate as the original algorithm does with full-precision communication.Moniqua improves upon prior works in that it (1) requires no additional memory, (2) applies to non-convex objectives,and (3) supports biased or linear quantizers.We demonstrate empirically that Moniqua converges faster with respect to wall clock time than other quantized decentralized algorithms. We also show that Moniqua is robust to very low bit-budgets, allowing less than 4-bits-per-parameter communication without affecting convergence when training VGG16 on CIFAR10.
+
+# 1INTRODUCTION
+
+Stochastic gradient descent (SGD), as a widely adopted optimization algorithm for machine learning, has shown promising performance when running at large scale (Zhang, 2OO4; Bottou, 2O1o; Dean et al.,2012; Goyal et al., 2017). However, the communication botleneck among workers1 when running distributed SGD presents a non-trivial challenge (Alistarh,2O18). State-of-the-art frameworks such as TensorFlow (Abadi et al.,2016), CNTK (Seide and Agarwal,2016) and MXNet (Chen et al., 2015)are built in a centralized fashion, where workers exchange gradients either via a centralized parameter server (Li et al., 2014a;b) or the MPI AllReduce operation (Gropp et al.,1999). Such a design, however, puts heavy pressure on the central server and strict requirements on the underlying network.In other words, when the underlying network is poorly constructed,i.e. high latency or low bandwidth, it can easily cause degradation of training performance due to communication congestion in the central server or stragglers (slow workers) in the system.
+
+There are two general approaches to deal with these problems: (1) decentralized training (Lian et al.,2017a;b; Tang et al.,2018a; Hendrikx et al.,2018) and (2) quantized communication² (Zhang et al.,2017; Alistarh et al.,2017; Wen et al.,2017). In decentralized training,allthe workers are connected to form a graph and each worker communicates only with adjacent workers by averaging model parameters. This balances load and is robust to scenarios where workers can only be partially connected or the communication latency is high. On the other hand, quantized communication reduces the amount of data exchanged among workers, which leads to faster convergence with respect to wall clock time (Alistarh et al.,2017; Seide et al.,2014; Doan et al.,2018; Zhang et al., 2017; Wang et al., 2O18). This is especially useful when the communication bandwidth is restricted.
+
+At this point, a natural question is: Can we apply quantized communication to decentralized training, and thus beneft from both ofthem? Unfortunately,directly combining them together negatively affects the convergence rate (Tang et al.,2O18b). This happens because existing quantization techniques are mostly designed for centralized SGD, where workers communicate via exchanging gradients (Alistarh et al.,2017; Seide et al.,2014; Wangni et al.,2018). Gradients are robust to quantization since they get smaller in magnitude near local optimum and in some sense carry less information, causing quantization error to approach zero (De Sa et al., 2O18). In contrast, decentralized workers are communicating model parameters, which do not necessarily approach zero,and so quantization error does not diminish unless precision is explicitly increased (Tang et al., 2O18c). Previous work solved this problem by adding an error tracker to compensate quantization errors (Tang et al., 2019) or adding replicas of neighboring models and focusing on quantizing model difference which does approach zero (Koloskova et al., 2019; Tang et al.,2018b). However, these methods suffer from trade-offs and limitations in that: (1) the extra replicas or error tracking incurs substantial memory overhead that is proportional to model size (more details in Section 2); and (2) these methods are statistically restricted,in the sense that they are either limited to convex problems (Koloskova et al., 2019) or require unbiased or non-linear quantizers (Koloskova et al.,2019; Tang et al., 2018b; 2019).
+
+To address these problems, in this paper we propose Moniqua, an extra-memory-free (details in Section 2) method for decentralized training to use quantized communication. Moniqua supports both biased and linear quantizers,as well as non-convex objectives.
+
+Intuition behind Moniqua.In a communication step of decentralized training,a worker $w _ { 1 }$ updates its model parameter $m _ { 1 }$ by averaging with a neighboring worker $w _ { 2 }$ 's model parameter $m _ { 2 }$ $m _ { 1 } \gets$ $\textstyle { \frac { 1 } { 2 } } ( m _ { 1 } + { \dot { m } } _ { 2 } )$ . Note that $\begin{array} { r } { \frac { 1 } { 2 } \overline { { ( m _ { 1 } + m _ { 2 } ) } } = m _ { 1 } + \frac { 1 } { 2 } \overline { { ( m _ { 2 } - m _ { 1 } ) } } } \end{array}$ , so averaging is equivalent to letting $w _ { 1 }$ obtain $m _ { 2 } - m _ { 1 }$ (same logic for $w _ { 2 }$ ). Since $m _ { 1 }$ and $m _ { 2 }$ will approach the same local optimum as the algorithm converges, we can expect the higher-order bits of $m _ { 1 }$ and $m _ { 2 }$ to get close. Then we can save communication by having $w _ { 2 }$ not communicate those higher-order bits to $w _ { 1 }$ .More explicitly, if we know that $\| m _ { 1 } - m _ { 2 } \| _ { \infty } \leq \theta$ for some known parameter $\theta$ (later we will show it can be derived in theory),then instead of sending the entire model $m _ { 2 }$ which might cause overhead, $w _ { 2 }$ can just send its $j$ -th coordinate $( m _ { 2 } ) _ { j }$ as $( \bar { m _ { 2 } } ) _ { j }$ mod $\mathcal { I } \left( \forall j \in [ d ] \right)$ ). Note that given $\| m _ { 1 } - m _ { 2 } \| _ { \infty } \leq \theta$
+
+$$
+( m _ { 2 } ) _ { j } { \mathrm { ~ m o d ~ } } \theta - ( m _ { 1 } ) _ { j } { \mathrm { ~ m o d ~ } } \theta = ( ( m _ { 2 } ) _ { j } - ( m _ { 2 } ) _ { j } ) { \mathrm { ~ m o d ~ } } \theta = ( m _ { 2 } ) _ { j } - ( m _ { 2 } ) _ { j }
+$$
+
+so $w _ { 1 }$ can obtain the $j$ -th coordinate of $m _ { 2 } - m _ { 1 }$ by locally computing $( m _ { 2 } ) _ { j }$ mod $\theta - ( m _ { 1 } ) _ { j }$ mod $\theta$ with $( m _ { 2 } ) _ { j }$ mod $\theta$ received from $w _ { 2 }$ . Since $( m _ { 2 } ) _ { j }$ mod $\theta$ is generally a smaller number than $( m _ { 2 } ) _ { j }$ , $w _ { 2 }$ can send fewer bits with the same level of absolute error.
+
+In this paper, we make the following contributions.
+
+· We show by example that directly quantizing communication in decentralized training, even with an unbiased quantizer, can fail to converge asymptotically. (Section 3)
+,We propose Moniqua, a general algorithm that uses modular arithmetic for communication quantization in decentralized training. We prove applying Moniqua achieves the same asymptotic convergence rate as the baseline full-precision algorithm (D-PSGD) while requiring at most $O ( \log \log n )$ number of bits per parameter communicated, where $n$ is the number of parallel workers. (Section 4) We apply Moniqua to decentralized algorithms with variance reduction and asynchronous communication ( $\dot { D } ^ { 2 }$ and AD-PSGD) and prove Moniqua enjoys the same asymptotic rate as with full-precision communication when applied to these cases. (Section 5)
+· We empirically evaluate Moniqua and show it outperforms all the related algorithms given an identical quantizer. We also show Moniqua is scalable and robust to very low bitbudgets,and we introduce techniques we found empirically useful to run Moniqua even more efficiently. (Section 6)
+
+# 2RELATED WORK
+
+Decentralized Stochastic Gradient Descent (SGD) Decentralized algorithms (Mokhtari and Ribeiro,2015; Sirb and Ye,2016; Lan et al.,2017; Wu et al.,2018a) have been widely studied with consideration of communication eficiency, privacy and scalability. In the domain of largescale machine learning, D-PSGD was the first Decentralized SGD algorithm that enjoys the same asymptotic convergence rate $O ( 1 / { \sqrt { K n } } )$ (where $K$ is the number of total iterations and $n$ is the number of workers) as centralized algorithms (Lian et al., 2O17a). After D-PSGD came $D ^ { 2 }$ ,which improves D-PSGD and is applicable to the case where workers are not sampling from identical data sources (Tang et al.,2O18a). Another extension was AD-PSGD,which lets workers communicate asynchronously and has a convergence rate of $O ( 1 / { \sqrt { K } } )$ (Lian et al., 2017b). In this paper we prove that Moniqua is applicable to allof these three algorithms. Other relevant work includes: He et al. (2018), which investigates decentralized learning on linear models; Nazari et al. (2O19), which introduces decentralized algorithms with online learning; Zhang and You (2O19), which analyzes the case when workers cannot mutually communicate; and Asran et al. (2O18), which investigates Decentralized SGD specifically for deep learning.
+
+Quantized Communication in Centralized SGD Prior research on quantized communication is often focused on centralized algorithms,such as randomized quantization (Doan et al.,2O18; Suresh et al.,2017; Zhang et al.,2017) and randomized sparsification (Wangni et al.,2018; Stich et al.,2018; Wang et al.,2018; Alistarh et al.,2O18). Many examples of prior work focus on studying quantization in the communication of deep learning tasks specifically (Han et al.,2O15; Wen et al.,2O17; Grubic et al., 2018). Alistarh et al. (2017) proposes QSGD, which uses an encoding-efficient scheme, and discusses its communication complexity. Another method,1bitSGD,quantizes exchanged gradients with one bit and shows great empirical success on speech recognition (Seide et al.,2014). Other work discusses the convergence rate under sparsified or quantized communication (Jiang and Agrawal, 2018; Stich et al., 2018). Acharya et al. (2019) theoretically analyzes sublinear communication for distributed training.
+
+Quantized Communication in Decentralized SGD Quantized communication for decentralized algorithms is a rising topic in the optimization community. Previous work has proposed decentralized algorithms with quantized communication for strongly convex objectives (Reisizadeh et al., 2018; Koloskova et al., 2019). Following that, Tang et al. (2018b) proposes DCD/ECD-PSGD,which quantizes communication via estimating model difference. Furthermore, Tang et al. (2019) proposes DeepSqueeze, which applies an error-compensation method (Wu et al.,2O18b) to decentralized setting. From a systems perspective, Koloskova et al. (2019) and Tang et al. (2O18b) require $O ( d \cdot l )$ and Tang et al. (2019) requires $O ( d )$ extra memory compared to D-PSGD to implement quantized communication,where $d$ denotes the dimension of the model and $l$ denotes the number of connections in the network. In comparison, Moniqua is extra-memory-free.
+
+# 3SETTING AND NOTATION
+
+In this section, we introduce our notation and the general assumptions we wil make about the quantizers for our results to hold. Then we describe D-PSGD (Lian et al.,2O17a), the basic algorithm for Decentralized SGD,and we show how naive quantization can fail in decentralized training.
+
+Quantizers. Throughout this paper, we assume that we use a quantizer $\mathcal { Q } _ { \delta }$ that has bounded error
+
+$$
+\| \mathcal { Q } _ { \delta } ( x ) - x \| _ { \infty } \leq \delta , \quad \forall x \in [ - 1 , 1 ] ^ { d }
+$$
+
+where $\delta$ is some constant. In general, a smaller $\delta$ denotes more fine-grained quantization requiring more bits.For example,a biased linear quantizer can achieve (1) by rounding $x$ to the nearest number in the set $\{ 2 \delta n \mid n \in \mathbb { Z } \}$ ; this will require about $\delta ^ { - 1 }$ quantization points to cover the interval $[ - 1 , 1 ]$ So such a linear quantizer can satisfy (1) using only $\begin{array} { r } { \left\lceil \log _ { 2 } \left( \frac { 1 } { \delta } + 1 \right) \right\rceil } \end{array}$ bits (Li et al., 2017; Gupta et al., 2015). Note that (1) can be satisfied (for appropriate values of $\delta$ by both linear (Gupta et al.,2015; De Sa et al., 2017) and non-linear (Stich,2018; Alistarh et al.,2017) quantizers,and thus it is more general than assumptions used in previous works where only non-linear quantizers are considered (Koloskova et al., 2019; Tang et al., 2018c; 2019).
+
+Decentralized parallel SGD (D-PSGD). D-PSGD (Lian et al., 2O17a) is the first and most basic Decentralized SGD algorithm. In D-PSGD, $n$ workers are connected to form a graph. Each worker $i$ stores a copy of model $x \in \mathbb { R } ^ { d }$ and a local dataset $\mathcal { D } _ { i }$ and collaborates to optimize
+
+$$
+\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \underbrace { \mathbb { E } _ { \xi \sim { \mathcal { D } } _ { i } } f _ { i } ( x ; \xi ) } _ { f _ { i } ( x ) }
+$$
+
+where $\xi$ is data sample from $\mathcal { D } _ { i }$ . In each iteration of D-PSGD,worker $i$ computes a local gradient sample using $\mathcal { D } _ { i }$ . Then it averages its model parameters with its neighbors according to a symmetric and doubly stochastic matrix $W$ ,where $W _ { i j }$ denotes the ratio worker $j$ averages from worker $i$ Formally: Let $x _ { k , i }$ and $\widetilde { g } _ { k , i }$ denote local model and sampled gradient on worker $i$ at $k$ -th iteration, respectively. Let $\alpha$ denote the step size. The update rule of D-PSGD can be expressed as:
+
+$$
+x _ { k + 1 , i } = \sum _ { j = 1 } ^ { n } x _ { k , j } W _ { j i } - \alpha \widetilde { g } _ { k , i } = x _ { k , i } \underbrace { - \sum _ { j = 1 } ^ { n } ( x _ { k , i } - x _ { k , j } ) W _ { j i } } _ { \mathrm { c o m m u n i c a t e t o r e d u c e ~ d i f f e r e n c e } } \underbrace { - \alpha \widetilde { g } _ { k , i } } _ { \mathrm { g r a d i e n t s t e p } }
+$$
+
+From (3) we can see the update of a single local model contains two parts: communication to reduce model difference and a gradient step.Lian et al. (2O17a) shows that all local models in D-PSGD are able to reach the same stationary point.
+
+Failure with direct quantization. Here, we illustrate why directly quantizing communication in decentralized training—naively quantizing the exchanged data—can fail to converge asymptotically even on a simple problem. This naive approach with quantizer $\mathcal { Q } _ { \delta }$ can be represented by
+
+$$
+x _ { k + 1 , i } = x _ { k , i } W _ { i i } + \sum _ { j \neq i } \mathcal { Q } _ { \delta } ( x _ { k , j } ) W _ { j i } - \alpha \widetilde { g } _ { k , i }
+$$
+
+Based on Equation 4, we obtain the following theorem.
+
+Theorem 1 For some constant $\delta$ , suppose that we use an unbiased linear quantizer $\mathcal { Q }$ with representable points $\{ \delta n \mid n \in \mathbb { Z } \}$ to learn on the quadratic objective function $\bar { f ( x ) } = ( x - \delta / 2 ) ^ { \top } \bar { ( x - }$ $\delta / 2 ) / 2$ with the direct quantization approach (4). Let $\phi$ denote the smallest value of a non-zero entry in $W$ . Regardless of what step size we adopt, it will always hold for all iterations $k$ and local modelindicesat( That is,the local iterates will fail to asymptotically converge to a region of small gradient magnitude in expectation.
+
+# 4MONIQUA
+
+Theorem 1 shows that when directly quantizing communication in decentralized SGD, even with an unbiased quantizer, any local model can fail to converge on a simple quadratic objective. In this seciton, we propose a technique,Moniqua, that solves this problem. Moniqua works under the following common assumptions for analyzing decentralized optimization algorithms (Lian et al., $2 0 1 7 \mathrm { a }$ ; Tang et al., 2018b; Koloskova et al.,2019).
+
+(A1) Lipschitzian gradient. Al the functions $f _ { i }$ have $L$ -Lipschitzian gradients.
+
+$$
+\| \nabla f _ { i } ( x ) - \nabla f _ { i } ( y ) \| \leq L \| x - y \| , \forall x , y \in \mathbb { R } ^ { d }
+$$
+
+(A2) Spectral gap. The communication matrix $W$ is a symmetric doubly stochastic matrix and $\operatorname* { m a x } \{ | \lambda _ { 2 } ( W ) | , | \lambda _ { n } ( W ) | \} = \rho < 1$ ,where $\lambda _ { i } ( W )$ denotes the ith eigenvalue of $W$ :
+
+(A3) Bounded variance. There exist non-negative $\sigma$ and $\varsigma$ such that
+
+$$
+\begin{array} { r } { \mathbb { E } _ { \xi _ { i } \sim \mathcal { D } _ { i } } \left\| \nabla \widetilde { f } _ { i } ( x ; \xi _ { i } ) - \nabla f _ { i } ( x ) \right\| ^ { 2 } \leq \sigma ^ { 2 } , \qquad \mathbb { E } _ { i \sim \{ 1 , \cdots , n \} } \left\| \nabla f _ { i } ( x ) - \nabla f ( x ) \right\| ^ { 2 } \leq \varsigma ^ { 2 } } \end{array}
+$$
+
+where $\nabla \widetilde { f } _ { i } ( x ; \xi _ { i } )$ denotes gradient sample on worker $i$ computed via data sample $\xi _ { i }$
+
+(A4) Initialization.All the local models are initialized by the same weight: $x _ { 0 , i } = x _ { 0 }$ ,for all $i$ and without loss of generality $x _ { 0 } = 0$
+(A5) Bounded gradient magnitude. The norm of a sampled gradient is bounded by $\begin{array} { r } { \| \widetilde { g } _ { k , i } \| _ { \infty } \leq } \end{array}$ $G _ { \infty }$ ,for all $i$ and $k$ with some constant $G _ { \infty }$ :
+
+In Section 1, we described how a modulo operation can be used to avoid sending redundant bits if a bound $\theta$ on model difference is known. Here we outline how we can obtain such a bound. We do so by leveraging the following insight: in decentralized training,all the workers initialize local models at same point and average with each other periodically. The only difference among their models is caused by the sampled gradients (updated with the step size),and this difference is reduced each time they communicate. Since we have an upper bound on the magnitude of the gradients (A5) as well as a bound characterizing how quickly the communication process converges (A2), we can combine these to get an a priori bound $\theta$ on how much the models can differ. We can then pass this bound $\theta$ as a parameter to the algorithm, which can proceed to modulo-quantize the communication via the process described in Section 1.We formalize this approach as Moniqua (Algorithm 1).
+
+Input:initial point $x _ { 0 , i } = x _ { 0 }$ ,step size $\alpha$ , the priori bound $\theta$ ,communication matrix $W$ , number of iterations $K$ ,quantizer $\mathcal { Q } _ { \delta }$ ,neighbor list ${ \mathcal { N } } _ { i }$
+1: for $k = 0 , 1 , 2 , \cdots , K - 1$ do
+23 Coputemoa $\widetilde { g } _ { k , i }$ el $\xi _ { k , i }$ $x _ { k , i }$ mod) $q _ { k , i } \gets \theta \cdot \mathcal { Q } _ { \delta }$ $\frac { x _ { k , i } } { \theta } \ \mathrm { m o d } \ 1 )$
+4: Average with neighboring workers: $\begin{array} { r } { x _ { k + \frac { 1 } { 2 } , i } \gets x _ { k , i } + \sum _ { j \in \mathcal { N } _ { i } } ( q _ { k , j } - q _ { k , i } ) W _ { j i } } \end{array}$
+5: Update the local weight with local gradient: $x _ { k + 1 , i } \gets x _ { k + \frac { 1 } { 2 } , i } - \alpha \widetilde { g } _ { k , i }$
+6: end for
+
+In line 3 we rescale each coordinate so that the number to be quantized fals in the region of $[ - 1 , 1 ]$ which is required for(1) to apply. Note that with quantization, the priori bound $\theta$ could increase since local models may move further apart due to quantization error. However, with appropriately chosen $\delta$ ,we can still obtain a bound $\theta$ and apply modulo-quantized communication that allows Moniqua to converge. We present these parameter choices in Theorem 2,along with the resulting convergence rate for Moniqua.
+
+Theorem 2 If we run Algorithm $I$ in a setting where
+
+$$
+\theta = \frac { 2 \log ( 1 6 n ) \alpha G _ { \infty } } { 1 - \rho } , ~ \delta = \frac { 1 - \rho } { 4 \log ( 1 6 n ) } , ~ a n d ~ \alpha = \frac { 1 } { \zeta ^ { 2 / 3 } K ^ { 1 / 3 } + \sigma \sqrt { K / n } + 2 L } ,
+$$
+
+then the output of Algorithm $^ { l }$ converges at the asymptotic rate
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \lesssim \frac { 1 } { K } + \frac { \sigma } { \sqrt { n K } } + \frac { \varsigma ^ { \frac { 2 } { 3 } } } { K ^ { \frac { 2 } { 3 } } } + \frac { \sigma ^ { 2 } n } { \sigma ^ { 2 } K + n } + \frac { G _ { \infty } ^ { 2 } d n } { \sigma ^ { 2 } K + n } .
+$$
+
+where $\rho _ { ; }$ $f ( 0 ) - f ^ { * }$ and $L$ are omitted as constants.
+
+Consistent with D-PSGD. Note that D-PSGD converges at the asymptotic rate of $O ( \sigma / \sqrt { n K } +$ $\varsigma ^ { \frac { 2 } { 3 } } / K ^ { \frac { 2 } { 3 } } + n / K )$ ,and thus Moniqua has thesameasymptoticrate as D-PSGD(Lianetal.,2017a).In other words, the asymptotic convergence rate is not negatively impacted by the quantization.
+
+Robust to large $d$ In Assumptions (A3) and (A5), we use $l _ { 2 }$ -norm and $l _ { \infty }$ -norm to bound sample variance and gradient magnitude, respectively. Note that, when $d$ gets larger, the variance $\sigma ^ { 2 }$ will also grow proportionally. So, the last term will tend to remain $n / K$ asymptotically with large $d$
+
+How many bits does Moniqua need? The specific number of bits required by Moniqua depends on the underlying quantizer $( \mathcal { Q } _ { \delta } )$ . If we use nearest rounding (Gupta et al.,2015) as $\mathcal { Q } _ { \delta }$ in Theorem 2, it suffices to use at each step a number of bits $\boldsymbol { B }$ for each parameter sent, where
+
+$$
+\begin{array} { r } { \mathcal { B } = \left\lceil \log _ { 2 } \left( \frac { 1 } { \delta } + 1 \right) \right\rceil = \left\lceil \log _ { 2 } \left( \frac { 4 \log _ { 2 } \left( 1 6 n \right) } { 1 - \rho } + 1 \right) \right\rceil } \end{array}
+$$
+
+Note that this bound is independent of model dimension $d$ . When the system scales up,the number of required bits grows at a rate of $O \left( \log \log n \right)$ :
+
+# 5SCALABLE MONIQUA
+
+Previous work has extended D-PSGD to $D ^ { 2 }$ (Tang et al., 2018a) (to make Decentralized SGD applicable to workers sampling from different data sources) and AD-PSGD (Lian et al., 2017b) (an asynchronous version of D-PSGD). In this section, we theoretically prove Moniqua is applicable to both of these algorithms.
+
+Moniqua with Decentralized Data Decentralized data refers to the case where all the local datasets $\mathcal { D } _ { i }$ are not identically distributed (Tang et al.,2O18a). More explicitly, the outer variance $\mathbb { E } _ { i \sim \{ 1 , \cdots , n \} } \parallel \nabla f _ { i } ( x ) - \nabla f ( x ) \parallel ^ { 2 }$ is no longer bounded by $\varsigma ^ { 2 }$ as assumed in D-PSGD (Assumption (A3)). This update rule presented can be explicitly expressed in two steps3:
+
+$$
+\begin{array} { r l } & { X _ { k + \frac { 1 } { 2 } } = 2 X _ { k } - X _ { k - 1 } - \alpha \widetilde { G } _ { k } + \alpha \widetilde { G } _ { k - 1 } } \\ & { \ X _ { k + 1 } = X _ { k + \frac { 1 } { 2 } } W + ( Q _ { k } - X _ { k + \frac { 1 } { 2 } } ) ( W - I ) } \end{array}
+$$
+
+where $X _ { k } , { \widetilde { G } } _ { k }$ and $Q _ { k }$ are matrix in the shape of $\mathbb { R } ^ { d \times n }$ , where their $i$ -th column are $x _ { k , i } , \widetilde { g } _ { k , i }$ and $q _ { k , i }$ respectively. And $X _ { - 1 }$ and $\widetilde { G } _ { - 1 }$ are $0 ^ { d \times n }$ by convention.Basedonthis,weobtain the following convergence theorem.
+
+Theorem 3 If we run $D ^ { 2 }$ with Monqiua in a setting where
+
+$$
+\theta = ( 6 D _ { 1 } n + 8 ) \alpha G _ { \infty } , \qquad \delta = \frac { 1 } { 6 n D _ { 2 } } , \quad a n d \qquad \alpha = \frac { 1 } { \sigma \sqrt { K / n } + 2 L } ,
+$$
+
+where $D _ { 1 }$ and $D _ { 2 }$ are two constants that only depend on the eigenvalues of $W$ (definition can be found in supplementary material), the output has the following asymptotic convergence rate:
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \lesssim \frac { 1 } { K } + \frac { \sigma } { \sqrt { n K } } + \frac { \sigma ^ { 2 } n } { \sigma ^ { 2 } K + n } + \frac { G _ { \infty } ^ { 2 } d n } { \sigma ^ { 2 } K + n } .
+$$
+
+Note that $D ^ { 2 }$ (Tang et al., 2018a) with full-precision communication has the asymptotic convergence rate of $O \left( 1 / K + \sigma / \sqrt { n K } + n / K \right)$ , Moniqua on $D ^ { 2 }$ has the same asymptotic rate.
+
+Moniqua with Asychronous Communication. Both D-PSGD and $D ^ { 2 }$ are synchronous algorithms as they require global synchronization at the end of each iteration, which can become a bottleneck when such synchronization is not cheap. Another algorithm,AD-PSGD,avoids this overhead by leting workers communicate asynchronously (Lian et al.,2O17b). In the analysis of AD-PSGD,an iteration represents a single gradient update on one randomly-chosen worker,rather than a synchronous bulk update of allthe workers.This single-worker-update analysis models the asynchronous nature of the algorithm. We apply Moniqua to AD-PSGD and obtain the following update rule4:
+
+$$
+X _ { k + 1 } = X _ { k } W _ { k } + ( Q _ { k } - X _ { k } ) ( W _ { k } - I ) - \alpha \widetilde { G } _ { k - \tau _ { k } }
+$$
+
+where $W _ { k }$ describes the communication behaviour between the $k$ th and $( k + 1 ) \operatorname { t h }$ gradient update, and $\tau _ { k }$ denotes the delay (measured as a number of iterations) between when the gradient is computed and updated to the model. Note that unlike D-PSGD, here $W _ { k }$ can be different at each update step and usually each individually has $\rho = 1$ , so we can't expect to get a bound in terms of a bound on the spectral gap,as we did in Theorems 2 and 3.Instead, we require the following condition, which is inspired by the literature on Markov chain Monte Carlo methods: for some constant $t _ { \mathrm { m i x } }$ ,
+
+$$
+\begin{array} { r } { \forall \mu \in \mathbb { R } ^ { n } , \ \forall k \in \mathbb { N } , \ \mathrm { i f } \ \mu _ { i } \geq 0 \ \mathrm { a n d } \ 1 ^ { \top } \mu = 1 , \ \mathrm { i t } \ \mathrm { m u s t } \ \mathrm { h o l d } \ \mathrm { t h a t } \ \left\| \left( \prod _ { i = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { k + i } \right) \mu - \frac { 1 } { n } \right\| _ { 1 } \leq \frac { 1 } { 2 } . } \end{array}
+$$
+
+We call this constant $t _ { \mathrm { m i x } }$ because it is effectively the mixing time of the time-inhomogeneous Markov chain with transition probability matrix $W _ { k }$ at time $k$ (Levin and Peres, 2017). Note that this condition is more general than those used in previous work on AD-PSGD because it does not require that the $W _ { k }$ are sampled independently or in an unbiased manner. Using this, we obtain the following convergence theorem.
+
+Theorem 4 If we run AD-PSGD with Moniqua in a setting where
+
+$$
+\theta = 1 6 t _ { \mathrm { m i x } } \alpha G _ { \infty } , \qquad \delta = \frac { 1 } { 3 2 t _ { \mathrm { m i x } } } , \quad a n d \qquad \alpha = \frac { n } { 2 L + \sqrt { K ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) } } ,
+$$
+
+the output has the following asymptotic convergence rate:
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \lesssim \frac { 1 } { K } + \frac { \sqrt { \sigma ^ { 2 } + 6 \varsigma ^ { 2 } } } { \sqrt { K } } + \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) t _ { \operatorname* { m i x } } ^ { 2 } n ^ { 2 } } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 1 } + \frac { n ^ { 2 } t _ { \operatorname* { m i x } } ^ { 2 } G _ { \infty } ^ { 2 } d } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 1 }
+$$
+
+Note that AD-PSGD (Lian et al., 2017b) with ful-recision communication has the asymptotic convergence rate of $O \left( 1 / K + \sqrt { \sigma ^ { 2 } + 6 \varsigma ^ { 2 } } / \sqrt { K } + n ^ { 2 } / K \right)$ , Moniquacovergs atera
+
+# 6EXPERIMENTS
+
+In this section, we evaluate Moniqua empirically. First, we compare Moniqua and other quantized decentralized training algorithms’ convergence under different network configurations. Second, we evaluate Moniqua's scalability on $D ^ { 2 }$ and AD-PSGD. Third, we introduce two additional techniques to run Moniqua more efficiently and empirically investigate the limits of Moniqua.
+
+Configuration. Allthe models and training scripts in this section are implemented in PyTorch and run on Google Cloud Platform. We launch an instance as one worker, each configured with a 2-core CPU with 4 GB memory and an NVIDIA Tesla P100 GPU. We use MPICH as the communication backend. Allthe instances are running Ubuntu 16.O4,and latency and bandwidth on the underlying network are configured using the $\pm _ { \mathrm { { C } } }$ command in Linux. In all the experiments, we use the following hyperparameters by default: batch $\mathrm { s i z e } = 1 2 8$ ,weight decay $= 1 e - 4$ ,and momentum $= 0 . 9$ ,which are default values adopted in previous works (Lian et al.,2017b; Grubic et al., 2O18). We tune the step size from set $\{ 0 . 5 , 0 . 1 , 0 . { \overset { \cdot } { 0 } } . 0 5 , 0 . 0 1 \}$ for each algorithm. Throughout our experiments, we adopt the commonly used (Gupta et al.,2O15; Li et al.,2O17) stochastic rounding5 with quantization step $\delta$
+
+
+Figure 1: Performance of different algorithms under different network configurations
+
+
+Figure 2: Performance of Moniqua and other quantization algorithms under extreme bit-budget.
+
+Wall-clock Time Evaluation. We start by evaluating the performance of Moniqua and other baseline algorithms under diferent network configurations. We launch 8 workers connected in a ring topology and train a ResNet110 (He et al.,2016) model on CIFAR10 (Krizhevsky et al.,2014). We compare Moniqua with the following baselines:6 Centralized (implemented as a standard AllReduce operation), D-PSGD (Lian et al.,2017a) with full-precision communication, DCD/ECD-PSGD (Tang et al., 2018b), ChocoSGD (Koloskova et al., 20i9) and DeepSqueeze (Tang et al., 2019).We set $\delta = 0 . 0 1$ for stochastic rounding across al algorithms that use quantization. To prevent overflow, we use l6-bit integers7 torch .int 1 6 as the floored output on the sender side. For Moniqua, we set $\theta = 3 . 0$ :
+
+We plot our results in Figure 1. As can be seen in Figure 1(a),with respect to epochs,All the algorithms have similar convergence curve while DCD/ECD-PSGD have slightly slower convergence curves.We can see from Figures 1(b) and 1(c) that when the network bandwidth decreases, the curves begin to separate. AllReduce and full-precision D-PSGD suffer the most, since they require a large volume of high-precision exchanged data. And from Figure 1(b) to Figure 1(d), when the network latency increases,we observe similar behavior. On the other hand, from Figure 1(b) to Figure 1(c) and Figure 1(d), curves of allthe quantized baselines (DCD/ECD-PSGD, ChocoSGD and DeepSqueeze) are geting closer to Moniqua. This is because, as shown in Figure 1(b), the extra updating of the replicas in DCD/ECD-PSGD and ChocoSGD as wel as the error tracking in DeepSqueeze counteract the benefits from accelerated communication. However, when network bandwidth decreases or latency increases, communication becomes the botleneck and allow these algorithms obtain acceleration compared to centralized SGD and D-PSGD. Delay between Moniqua and quantized baselines does not vary with the network since that only depends on the their extra local computation (error tracking and replica update). We observe that compared to Moniqua, DCD/ECDPSGD is approximately 13 seconds slower while ChocoSGD and DeepSqueeze being 10 and 8 seconds slower repectively. From Figure 1 we can see that Moniqua outperforms all these other algorithms.
+
+Aggressive Quantization. Now we investigate how Moniqua and baselines behave under aggressive quantization. We enforce two strict bit-budget: 2bit and 3bit (per parameter). We plot the results in Figure 2.We can see that DCD-PSGD fails to converge in both cases and ECD-PSGD fails to converge with 2bit. This is consistent with results in previous work (Tang et al.,2O18c; 2019). On the other hand,Moniqua converges faster than any other baselines.We observe at the end of 15O epoch, with 3-bit communication Moniqua achieves $8 5 \%$ training accuracy while other baselines are below $7 0 \%$ (full precision achieves $9 7 \%$ ). Compared to the theoretical results in Section 4,we show that Moniqua is much more robust to low-bits budget in practice.
+
+
+Figure 3: Performance of applying Moniqua ol $D ^ { \frac { \pi } { 2 } }$ and AD-PSGD
+Figure 4: Performance of Moniqua on VGG16 and ResNetl1O under different $\theta$
+
+Scalability of Moniqua. We evaluate how Moniqua can be applied to $D ^ { 2 }$ (Tang et al., 2018a) and AD-PSGD (Lian et al., 2017b). First, we demonstrate how applying Moniqua to $D ^ { 2 }$ can handle decentralized data. We launch 10 workers,collaborating to train a VGG16 (Simonyan and Zisserman, 2014) model on CIFAR10. Similar to the setting of $D ^ { 2 ^ { - } }$ (Tang et al., 2018a), we let each worker have exclusive access to 1 labels (of the 10 labels total in CIFAR1O). In this way, the data variance among workers is maximized. We plot the results in Figure 3(a). We observe that applying Moniqua on $D ^ { 2 }$ does not affect the convergence rate while D-PSGD can no longer converge because of the outer variance. Here we omit the wall clock time comparison since the communication volume is the same in comparison of Moniqua and Centralized algorithm in Figure 1.
+
+Next, we evaluate Moniqua on AD-PSGD. We launch 6 workers organized in a ring topology, collaborating to train a ResNet110 model on CIFAR10. We set the network bandwidth to be 20Mbps and latency to be $0 . 1 5 \mathrm { m s }$ .We plot the results in Figure 3(b). We can see that both AD-PSGD and asynchronous Moniqua outperform D-PSGD. Besides, Moniqua outperforms AD-PSGD in that communication is reduced, which is aligned with the intuition and theory.
+
+Efficient Moniqua. There are two techniques we have observed to improve the performance of Moniqua when using stochastic rounding: $\mathcal { Q } _ { \delta } ( x ) = \delta \lfloor \textstyle { \frac { x } { \delta } } + u \rfloor$ (where $u$ is uniformly sampled from $[ 0 , 1 ] )$ , $\forall x \in \mathbb { R } ^ { d }$ . The first is to use shared randomness,in which the same random seed is used for stochastic rounding on all the workers. That is, if two workers are exchanging tensors $x$ and $y$ respectively, then the floored tensors $\textstyle { \lfloor { \frac { x } { \delta } } + u \rfloor }$ and $\textstyle { \lfloor { \frac { y } { \delta } } + u \rfloor }$ they send use the same randomly sampled value $u$ This provably reduces the error due to quantization (more details are in the supplementary material). The second technique is to use a standard entropy compressor like $\mathtt { b } z \mathtt { i } \mathtt { p }$ to further compress the communicated tensors. This can help further reduce the number of bits because the modulo operation in Moniqua can introduce some redundancy in the higher-order bits,which a traditional compression algorithm can easily remove.
+
+To evaluate these methods, we train both ResNet110 and VGG16 on CIFAR10 using 8 ring-connected workers.We plot the training loss under different $\theta$ in Figure 4 (with $\delta = 0 . 0 1$ for stochastic rounding). Note that for VGG16, it can tolerate small $\theta = 0 . 0 8$ while still preserving the convergence rate. On the other hand, for ResNetl1O, it begins to diverge when $\theta$ decreases to O.5.This is because VGG16 has more fully connected layers than ResNet11O,and these layers are less sensitive to quantization, as claimed in (Grubic et al.,2O18). We observed that the fewest number of bits per number needed to communicate by Moniqua for VGG16 and ResNet110 to guarantee convergence (accuracy loss $< 0 . 3 \%$ ,criterion adopted by (Grubic et al.,2018)) are 3.64 and 5.67,respectively (details in the supplementary material).
+
+# 7CONCLUSIONS
+
+In this paper we propose Moniqua, a simple unified method of quantizing the communication in decentralized training algorithms. Theoretically, Moniqua supports biased quantizer and non-convex problems, while enjoying the same asymptotic convergence rate as full-precision-communication algorithms without incurring storage or computation overhead. Empirically, we observe Moniqua converges faster than other related algorithms with respect to wall clock time. Additionall, Moniqua is robust to very low bits-budget.
+
+# REFERENCES
+
+Tong Zhang. Solving large scale linear prediction problems using stochastic gradient descent algorithms. In Proceedings of the twenty-first international conference on Machine learning, page 116.ACM, 2004.
+
+Leon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT'2010, pages 177-186. Springer, 2010.
+
+Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, Andrew Senior, Paul Tucker, Ke Yang, Quoc VLe, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pages 1223-1231,2012.
+
+Priya Goyal, Piotr Dollar, Ross Girshick,Pieter Noordhuis,Lukasz Wesolowski,Aapo Kyrola, Andrew Tulloch, Yangqing Jia,and Kaiming He. Accurate,large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677,2017.
+
+Dan Alistarh. A brief tutorial on distributed and concurrent machine learning. In Proceedings of the 2018 ACM Symposium on Principles of Distributed Computing, pages 487-488. ACM, 2018.
+
+Martin Abadi,Paul Barham, Jianmin Chen, Zhifeng Chen,Andy Davis, Jeffrey Dean,Mathieu Devin, Sanjay Ghemawat, Geoffrey Irving,Michael Isard, et al. Tensorflow: a system for large-scale machine learning. In OSDI, volume 16, pages 265-283,2016.
+
+Frank Seide and Amit Agarwal. Cntk: Microsoft's open-source deep-learning toolkit. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 2135-2135.ACM,2016.
+
+Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang,Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang,and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274,2015.
+
+Mu Li,David G Andersen, Jun Woo Park, Alexander JSmola, Amr Ahmed, Vanja Josifovski, James Long,Eugene JShekita,and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In OSDI, volume 14, pages 583-598,2014a.
+
+Mu Li, David G Andersen, Alexander J Smola,and Kai Yu. Communication effcient distributed machine learning with the parameter server. In Advances in Neural Information Processing Systems, pages 19-27,2014b.
+
+Wiliam Gropp, Rajeev Thakur, and Ewing Lusk. Using MPI-2: Advanced features of the message passing interface.MIT press,1999.
+
+Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang,and Ji Liu. Can decentralized algorithms outperform centralized algorithms? a case study for decentralized parallel stochastic gradient descent. In Advances in Neural Information Processing Systems,pages 5330-5340,2017a.
+
+Xiangru Lian,Wei Zhang,Ce Zhang,and Ji Liu. Asynchronous decentralized parallel stochastic gradient descent. arXiv preprint arXiv:1710.06952,2017b.
+
+Hanlin Tang, Xiangru Lian, Ming Yan, Ce Zhang,and Ji Liu. D2: Decentralized training over decentralized data. arXiv preprint arXiv:1803.07068,2018a.
+
+Hadrien Hendrikx, Laurent Massoulié,and Francis Bach. Accelerated decentralized optimization with local updates for smooth and strongly convex objectives. arXiv preprint arXiv:1810.02660, 2018.
+
+Hantian Zhang, Jerry Li, Kaan Kara, Dan Alistarh, Ji Liu,and Ce Zhang. Zipml: Training linear models with end-to-end low precision,and a little bit of deep learning. In International Conference on Machine Learning, pages 4035-4043,2017.
+
+Dan Alistarh,Demjan Grubic,Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communicationefficient sgd via gradient quantization and encoding. In Advances in Neural Information Procesing Systems, pages 1709-1720,2017.
+
+Wei Wen, Cong Xu,Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen,and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in neural information processing systems, pages 1509-1519,2017.
+
+Frank Seide,Hao Fu, Jasha Droppo, Gang Li,and Dong Yu.1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Communication Association, 2014.
+
+Thinh T Doan, Siva Theja Maguluri, and Justin Romberg. On the convergence of distributed subgradient methods under quantization. In 2018 56th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 567-574. IEEE,2018.
+
+Hongyi Wang, ScottSievert, Shengchao Liu, Zachary Charles, Dimitris Papailiopoulos,and Stephen Wright. Atomo: Communication-efficient learning via atomic sparsification. In Advances in Neural Information Processing Systems, pages 9850-9861, 2018.
+
+Hanlin Tang, Shaoduo Gan, Ce Zhang, Tong Zhang,and Ji Liu. Communication compression for decentralized training. In Advances in Neural Information Processing Systems, pages 7663-7673, 2018b.
+
+Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communicationefficient distributed optimization. In Advances in Neural Information Processing Systems, pages 1306-1316,2018.
+
+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.
+
+Hanlin Tang, Chen Yu, Cedric Renggli, Simon Kassing,Ankit Singla, Dan Alistarh, Ji Liu,and Ce Zhang. Distributed learning over unreliable networks. arXiv preprint arXiv:1810.07766,2018c.
+
+Hanlin Tang, Xiangru Lian, Shuang Qiu, Lei Yuan, Ce Zhang,Tong Zhang,and Ji Liu. Deepsqueeze: Parallel stochastic gradient descent with double-pass error-compensated compression. arXiv preprint arXiv:1907.07346,2019.
+
+Anastasia Koloskova, Sebastian U Stich,and Martin Jaggi. Decentralized stochastic optimization and gossip algorithms with compressed communication. arXiv preprint arXiv:1902.00340, 2019.
+
+Aryan Mokhtari and Alejandro Ribeiro. Decentralized double stochastic averaging gradient. In Signals,Systems and Computers,2015 49th Asilomar Conference on, pages 406-410.IEEE,2015.
+
+Benjamin Sirb and Xiaojing Ye. Consensus optimization with delayed and stochastic gradients on decentralized networks. In Big Data (Big Data), 2016 IEEE International Conference on, pages 76-85.IEEE,2016.
+
+Guanghui Lan, Soomin Lee,and Yi Zhou. Communication-efficient algorithms for decentralized and stochastic optimization. arXiv preprint arXiv:1701.03961,2017.
+
+Tianyu Wu, Kun Yuan, Qing Ling, Wotao Yin, and Ali H Sayed. Decentralized consensus optimization with asynchrony and delays. IEEE Transactions on Signal and Information Processing over Networks,4(2):293-307,2018a.
+
+Lie He,An Bian, and Martin Jaggi. Cola: Decentralized linear learning. In Advances in Neural Information Processing Systems, pages 4541-4551,2018.
+
+Parvin Nazari, Davoud Ataee Tarzanagh,and George Michailidis. Dadam: A consensus-based distributed adaptive gradient method for online optimization. arXiv preprint arXiv:1901.09109, 2019.
+
+Jiaqi Zhang and Keyou You. Asynchronous decentralized optimization in directed networks. arXiv preprint arXiv:1901.08215,2019.
+
+Mahmoud Assran, Nicolas Loizou, Nicolas Ballas,and Michael Rabbat. Stochastic gradient push for distributed deep learning. arXiv preprint arXiv:1811.10792, 2018.
+
+Ananda Theertha Suresh,Felix X Yu, Sanjiv Kumar,and H Brendan McMahan. Distributed mean estimation with limited communication. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 3329-3337. JMLR. org, 2017.
+
+Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified sgd with memory. In Advances in Neural Information Processing Systems,pages 4452-4463,2018.
+
+Dan Alistarh, Torsten Hoefler, Mikael Johansson, Nikola Konstantinov, Sarit Khirirat, and Cédric Renggli. The convergence of sparsified gradient methods. In Advances in Neural Information Processing Systems, pages 5973-5983,2018.
+
+Song Han, Huizi Mao, and William JDally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00l49,2015.
+
+D Grubic, L Tam, Dan Alistarh, and Ce Zhang. Synchronous multi-gpu deep learning with lowprecision communication: An experimental study. Proceedings of the EDBT 2O18,2018.
+
+Peng Jiang and Gagan Agrawal. A linear speedup analysis of distributed deep learning with sparse and quantized communication. In Advances in Neural Information Processing Systems, pages 2525-2536,2018.
+
+Jayadev Acharya, Christopher De Sa, Dylan J Foster, and Karthik Sridharan. Distributed learning with sublinear communication. arXiv preprint arXiv:1902.11259,2019.
+
+Amirhossein Reisizadeh,Aryan Mokhtari, S.Hamed Hassani, and Ramtin Pedarsani. Quantized decentralized consensus optimization. CoRR,abs/1806.11536,2018. URL http: //arxiv. org/abs/1806.11536.
+
+Jiaxiang Wu, Weidong Huang, Junzhou Huang,and Tong Zhang. Error compensated quantized sgd and its applications to large-scale distributed optimization. arXiv preprint arXiv:1806.08054, 2018b.
+
+Hao Li, Soham De, Zheng Xu, Christoph Studer, Hanan Samet, and Tom Goldstein. Training quantized nets: A deeper understanding. In Advances in Neural Information Processing Systems, pages 5811-5821,2017.
+
+Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan,and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pages 1737-1746, 2015.
+
+Christopher De Sa, Mathew Feldman, Christopher Ré,and Kunle Olukotun. Understanding and optimizing asynchronous low-precision stochastic gradient descent. In ACM SIGARCH Computer Architecture News, volume 45, pages 561-574. ACM, 2017.
+
+Sebastian U Stich. Local sgd converges fast and communicates little. arXiv preprint arXiv:1805.09767, 2018.
+
+David A Levin and Yuval Peres. Markov chains and mixing times, volume 1O7. American Mathematical Soc., 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, pages 770-778,2016.
+
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The cifar-10 dataset. online: htp://www. cs. toronto. edu/kriz/cifar. html,2014.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556,2014.
+
+# Supplementary Material
+
+# AOVERVIEW
+
+This supplementary material contains proofs of all the theoretical results and extra experimental results of Moniqua. It is organized as follows: In Section B,we provably explain why using shared randomness in communication with stochastic rounding can improve performance (theoretical explanation for technique 1 in Experiment Effcient Moniqua). Then we demonstrate more experimental results in Section C. In Section D, we illustrate why naively quantizing communication in D-PSGD fails to converge asymptotically, as a proof to Theorem 1. In Section E, we introduce some useful tools of modeling communication as a Markov Chain for the rest of the proof (part of the intuition is illustrated in the paper). We recommend to go through this before geting into Section F to H.Finally we will provide proof to Theorem 2,3 and 4 from Section F to H, with corollaries contained in the corresponding sections.Detailed algorithm statements for applying Moniqua on $D ^ { 2 }$ and AD-PSGD can be found in Section G Algorithm 2 and Section H Algorithm 3,respectively.
+
+# BSHARED RANDOMNESS (EXPERIMENT OF Efficient Moniqua)
+
+In this section, we provide a theoretical explanation why using shared randomness in the stochastic rounding is able to improve the performance. Without the loss of generality,in the following analysis, we let the quantization step associated with stochastic rounding quantizer $\mathcal { Q }$ be $\delta = 1$ . For any $z$ quantized using $\mathcal { Q }$ ,let $z _ { f } = z - \lfloor z \rfloor$ ,the variance of quantization error can be expressed as
+
+$$
+\begin{array} { r } { \mathbb { E } \left\| \mathscr { Q } ( z ) - z \right\| ^ { 2 } = ( 1 - z _ { f } ) ( - z _ { f } ) ^ { 2 } + z _ { f } ( 1 - z _ { f } ) ^ { 2 } = z _ { f } ( 1 - z _ { f } ) } \end{array}
+$$
+
+Note that in Moniqua, the term asssociate with quantization error is
+
+$$
+\mathbb { E } \left\| ( q _ { k , j } - x _ { k , j } ) - ( q _ { k , i } - x _ { k , i } ) \right\| ^ { 2 }
+$$
+
+We now show for $\forall x , y \in \mathbb { R } ^ { d }$
+
+$$
+\begin{array} { r } { \mathbb { E } \left\| ( \boldsymbol { \mathcal { Q } } ( x ) - x ) - ( \boldsymbol { \mathcal { Q } } ( y ) - y ) \right\| ^ { 2 } = \mathbb { E } \left\| \boldsymbol { \mathcal { Q } } ( y - x ) - ( y - x ) \right\| ^ { 2 } } \end{array}
+$$
+
+With out the loss of generality, let $x - \lfloor x \rfloor \leq y - \lfloor y \rfloor$ .Let $x _ { f } = x - \lfloor x \rfloor$ and $y _ { f } = y - \lfloor y \rfloor$ ,then
+
+$$
+{ \begin{array} { r l r l } & { \lfloor x + u \rfloor = \lfloor x \rfloor } & { { \mathrm { a n d } } } & { \lfloor y + u \rfloor = \lfloor y \rfloor , { \mathrm { w i t h ~ p r o b a b i l i t y } } } & { \lceil y \rceil - y } \\ & { \lfloor x + u \rfloor = \lceil x \rceil } & { { \mathrm { a n d } } } & { \lfloor y + u \rfloor = \lceil y \rceil , { \mathrm { w i t h ~ p r o b a b i l i t y } } } & { x - \lfloor x \rfloor } \\ & { \lfloor x + u \rfloor = \lfloor x \rfloor } & { { \mathrm { a n d } } } & { \lfloor y + u \rfloor = \lceil y \rceil , { \mathrm { w i t h ~ p r o b a b i l i t y } } } & { ( \lceil x \rceil - x ) - ( \lceil y \rceil - y ) } \end{array} }
+$$
+
+Then we have
+
+$$
+\begin{array} { r l } & { \quad \mathbb { E } \| ( Q ( x ) - x ) - ( Q ( y ) - y ) \| ^ { 2 } } \\ & { = \mathbb { E } \| ( \delta \lfloor \frac { x } { \delta } + u \rfloor - x ) - ( \delta \lfloor \frac { y } { \delta } + u \rfloor - y ) \| ^ { 2 } } \\ & { = ( [ y ] - y ) ( ( \lfloor x \rfloor - x ) - ( \lfloor y \rfloor - y ) ) ^ { 2 } + ( x - \lfloor x \rfloor ) ( ( \lceil x \rceil - x ) - ( \lceil y \rceil - y ) ) ^ { 2 } } \\ & { \quad + ( ( \lceil x \rceil - x ) - ( \lceil y \rceil - y ) ) ( ( \lfloor x \rfloor - x ) - ( \lceil y \rceil - y ) ) ^ { 2 } } \\ & { = ( 1 - y _ { f } ) ( x _ { f } - y _ { f } ) ^ { 2 } + ( x _ { f } ) ( x _ { f } - y _ { f } ) + ( y _ { f } - x _ { f } ) ( y _ { f } - x _ { f } - 1 ) ^ { 2 } } \\ & { = ( 1 - y _ { f } + x _ { f } ) ( y _ { f } - x _ { f } ) ^ { 2 } + ( y _ { f } - x _ { f } ) ( y _ { f } - x _ { f } - 1 ) ^ { 2 } } \\ & { = ( 1 - y _ { f } + x _ { f } ) ( y _ { f } - x _ { f } ) } \\ & { = \mathbb { E } \| ( \mathcal { Q } ( y - x ) - ( y - x ) \| ^ { 2 } } \end{array}
+$$
+
+The last equality holds due to equation 5. Next, let
+
+$$
+\begin{array} { l } { \Delta = y - x } \\ { r = \mathcal { Q } ( \Delta ) - \Delta } \end{array}
+$$
+
+And let $r _ { h }$ denote $h$ -th entry of $r$ ,let $\Delta _ { h }$ denote $h$ -th entry of $\Delta$ . We obtain
+
+$$
+r _ { h } = \mathcal { Q } ( \Delta _ { h } ) - \Delta _ { h }
+$$
+
+$$
+\begin{array} { r l } & { = \delta \{ - \frac { \Delta _ { h } } { \delta } + \lfloor \frac { \Delta _ { h } } { \delta } \rfloor + 1 , p _ { t } \leq \frac { \Delta _ { h } } { \delta } - \lfloor \frac { \Delta _ { h } } { \delta } \rfloor } \\ & { - \frac { \Delta _ { h } } { \delta } + \lfloor \frac { \Delta _ { h } } { \delta } \rfloor , \qquad \mathrm { o t h e r w i s e } } \\ & { = \delta \{ \begin{array} { l l } { - q + 1 , } & { p _ { t } \leq q } \\ { - q , } & { \mathrm { o t h e r w i s e } } \end{array} } \end{array}
+$$
+
+where
+
+Based on that, we have
+
+$$
+q = \frac { \Delta _ { h } } { \delta } - \left\lfloor \frac { \Delta _ { h } } { \delta } \right\rfloor , q \in [ 0 , 1 ]
+$$
+
+$$
+\begin{array} { r l } & { \mathbb { E } \left[ r _ { h } ^ { 2 } \right] \leq \delta ^ { 2 } ( ( - q + 1 ) ^ { 2 } q + ( - q ) ^ { 2 } ( 1 - q ) ) } \\ & { \qquad = \delta ^ { 2 } q ( 1 - q ) } \\ & { \qquad \leq \delta ^ { 2 } \operatorname* { m i n } \{ q , 1 - q \} } \end{array}
+$$
+
+Since $\begin{array} { r } { \operatorname* { m i n } \{ q , 1 - q \} \leq \left| \frac { x _ { h } } { \delta } \right| } \end{array}$ , we have
+
+$$
+\mathbb { E } \left[ r _ { h } ^ { 2 } \right] \leq \delta ^ { 2 } \left| \frac { \Delta _ { h } } { \delta } \right| \leq \delta \left| \Delta _ { h } \right|
+$$
+
+Summing over the index $h$ yields,
+
+$$
+\begin{array} { r } { \mathbb { E } \left\| r \right\| _ { 2 } ^ { 2 } \leq \delta \mathbb { E } \left\| \Delta \right\| _ { 1 } \leq \sqrt { d } \delta \mathbb { E } \left\| \Delta \right\| _ { 2 } } \end{array}
+$$
+
+Pushing back $x$ and $r$ , we have
+
+$$
+\begin{array} { r } { \mathbb { E } \left\| \boldsymbol { \mathcal { Q } } ( y - x ) - ( y - x ) \right\| ^ { 2 } \leq \sqrt { d } \delta \mathbb { E } \left\| y - x \right\| = \sqrt { d } \delta \mathbb { E } \left\| x - y \right\| } \end{array}
+$$
+
+Putting it back we have
+
+$$
+\begin{array} { r } { \mathbb { E } \left\| ( \boldsymbol { \mathcal { Q } } ( x ) - x ) - ( \boldsymbol { \mathcal { Q } } ( y ) - y ) \right\| ^ { 2 } \leq \sqrt { d } \delta \mathbb { E } \left\| x - y \right\| } \end{array}
+$$
+
+Now we can see that the error term is bounded by the distance of two quantized tensor, which, in decentralized training, refers to the distance between two models on adjacent workers. In such a way, the error bound can be reduced since the workers are getting close to each other.
+
+# CMORE EXPERIMENTAL RESULTS
+
+# C.1COMPUTE NUMBER OF BITS
+
+In Experiment of Effcient Moniqua, we calculate the number of bits in the following way: First, we calculate the total number of bits each worker send out,sum them up and divided by number of epochs,and we get the average bandwidth consumption $\overline { { B W } }$ of the whole system in each epoch. Then we compute the number of bits required for each number in the following way (note that every worker has 2 neighbors in a ring topology):
+
+$$
+\# b i t s = { \frac { \overline { { B W } } } { \# \mathrm { n e i g h b o r s } \cdot \# \mathrm { w o r k e r s } \cdot \# \mathrm { p a r a m s ~ o f ~ m o d e l } } }
+$$
+
+In our experiments, #neighbors $^ { = 2 }$ ,#workers $^ { = 8 }$ For VGG16,#params of model $\equiv$ 15,245,130 while for ResNet110, #params of model=1,146,842.We formalize the results in Table C.1 8.
+
+# C.2VARIOUS QUANTIZERS
+
+In this section, we will verify Moniqua is applicable to other quantizers aside from linear quantizer as shown in the paper. We test it on two more quantizers:
+
+# 1. Nearest Rounding (Biased)
+
+$$
+\mathcal { Q } ( x ) = \delta \left\lfloor \frac { x } { \delta } + 0 . 5 \right\rfloor
+$$
+
+where $\delta$ is the quantization step as defined in the linear quantizer. In this experiment, we set $\delta = 0 . 0 1$ , the same value as we used in the paper with stochastic rounding.
+
+Table 1: Wall Clock Time consumption (Seconds)/Epoch in average under different network in Experiment of Evaluation of Moniqua.
+
+
100mbps/0.15ms
20mbps/0.15ms
100mbps/10ms
Extra Memory
Centralized
38.92
206.14
343.28
N/A
D-PSGD
36.25
189.48
310.98
N/A
DCD-PSGD
32.99
105.40
202.42
20.4 MB
ECD-PSGD
31.96
105.26
202.04
20.4 MB
ChocoSGD
32.03
105.18
201.18
20.4 MB
DeepSqueeze
30.01
103.67
193.92
13.6 MB
Moniqua
22.42
95.08
184.86
0B
+
+Table 2: Bandwidth consumption under different $\theta$ and $\delta$ when applying linear quantizer in Moniqua
+
+
MODEL
MOD PARAM 0
QUANT STEP
BYTES/EPOCH
AVG BITS
VGG16
NONE
NONE
45594MB
32
1.0
0.01
5206MB
3.65
0.08
0.01
5192MB
3.64
REsNET110
NONE
NONE
3430MB
32
2.0
0.01
609MB
5.67
1.3
0.01
608MB
5.67
+
+# 2. Randomized Gossip (Non-linear)
+
+$$
+\mathcal { Q } ( x ) = \left\{ \begin{array} { l l } { x , } & { \mathrm { w i t h ~ p r o b a b i l i t y } \quad p } \\ { 0 , } & { \mathrm { w i t h ~ p r o b a b i l i t y } \quad 1 - p } \end{array} \right.
+$$
+
+In this experiment, we set $p = 0 . 7$
+
+We train ResNet110 on CIFAR10,and plot the results in Figure 5(c). We can see that the training curves of using three quantizers are all aligned with D-PSGD with full-precision communication. Note that in the paper we show that previous work cannot perserve the aligned curve even with stochastic rounding (unbiased),thus we are not comparing them here.
+
+# C.3MORE RESULTS ON DIFFERENT HYPERPARAMETERS
+
+In this experiment, we plot more result of training ResNet110 and VGG16 on CIFAR10 under different $\delta$ and $\theta$ in the experiment of aggressive quantization. And we plot the results in Figure 5(a) and Figure 5(b).
+
+
+
+
+Epoch
+(a)Performance of Moniqua( VGG16 under different $\theta$ and $\delta$
+
+
+I(b) Performance of Moniqua on (c)Performance of algorithms unResNet110 under different $\theta$ and der different quantizer 8
+
+We report the results in experiment of "Aggressive Quantization” and report the test error and test accuracy in the Figure 5 and Figure 6.
+
+
+
+(d) Training Accuracy under differ-(e) Test Accuracy under different (f) Test Loss under diffrent algoent algorithms with 3-bit communi-algorithms with 3-bit communica-rithms with 3-bit communication cation tion
+
+Figure 5: More statistics from Experiment of Aggressve Quantization under 3-bit communication
+
+D-PSGD D-PSGD D-PSGD
+100f 山 ECD-PSGD(2bit) 山 ECD-PSGD(2bit) 0.020f ECD-PSGD(2bit)
+80 ChocoSGD(2bit) DeepSqueeze(2bit) 80 DeepSqueeze(2bit) ChocoSGD(2bit) 1 DeepSqueeze(2bit) ChocoSGD(2bit) Moniqua(2bit) 60 Moniqua(2bit) Moniqua(2bit)
+60
+40 40 0.010
+20 20 0.005 0 50 100 150 0 50 100 150 0 50 100 150 Epoch Epoch Epoch
+
+(a)Training Accuracy under differ-(b) Test Accuracy under different (c) Test Loss under different algoent algorithms with 2-bit communi-algorithms with 2-bit communica-rithms with 2-bit communication cation tion
+
+Figure 6: More statistics from Experiment of Aggressive Quantization under 2-bit communication
+
+# C.5DECREASING STEP SIZE AND CONSENSUS ERROR
+
+In this subsection, we provide more experimental results with decreasing step size. We also provide and discuss results on consensus error in this experiment. We run the experiments in the following setting:
+
+Models, Datasets and Hyperparameters. We launch 8 workers connected using a ring network. We train ResNet110 and ResNet18 on CIFAR10.The hyperparameters of Moniqua are: ResNet110 (Initial step size $= 0 . 0 5$ $\theta = 3 . 0$ ,batch size $= 1 2 8$ ,weight decay $= 3 e - 4$ ,and momentum $= 0 . 9$ ) and ResNet18 (Initial step size $= 0 . 1$ , $\theta = 2 . 5$ ,batch size $= ~ 1 2 8$ ,weight decay $= 1 e - 4$ ,and momentum $= 0 . 9$ ).Step size is decreased (times a O.1 factor) every 3O epochs.To be consistent with the original paper, we use the stochastic rounding to quantize each number.
+
+Results of Decreasing Step SizeWe plot the results of test accuracy in Figure 7. We can see from Figure 7(a) that Moniqua requires at least 6 bits to achieve the comparable (accuracy drop $< 0 . 3 \%$ test accuracy as the baseline (D-PSGD with 32 bits). Once the numeber bits decrease to 5, there is a accuracy gap between Moniqua and D-PSGD. On the other hand, other baselines including DeepSqueeze, ChocoSGD and DCD/ECD-PSGD are not able to achieve comparable test accuracy with 6 bits. Similarily, we can see from Figure 7(b) that when training ResNet18 with 4 bits, Moniqua is able to achieve comparable test accuracy after 12O epochs, while other baselines suffer a certain accuracy gap.
+
+We also plot the test accuracy of different algorithms under different bit-level communication in Figure 8 (ResNet110). We can see that compared to the baselines,Moniqua is generally robust to low bits-budget. (Some of the dots are missing for some algorithms,that means they do not converge under the corresponding bits-budget.)
+
+
+Figure 7: Test Accuracy and Consensus Error of Moniqua under decreasing step size.
+
+
+Figure 8: Test Accuracy of different algorithms on training ResNet110 on CIFAR10.
+
+Results of Consensus Error.To better measure the behaviour of workers reaching consensus, we define the consensus error at iteration $k$ : $\mathcal { C } _ { k }$ as follows (Notations are the same as in the original paper):
+
+$$
+\mathcal { C } _ { k } = \frac { 1 } { n k } \sum _ { t = 0 } ^ { k - 1 } \sum _ { i = 1 } ^ { n } \left. \frac { 1 } { n } \sum _ { j = 1 } ^ { n } x _ { t , j } - x _ { t , i } \right. ^ { 2 }
+$$
+
+Note that $\mathcal { C } _ { k }$ is essentially the running average of distance among workers and the averaged model. Trivially,a decreasing $\mathcal { C } _ { k }$ indicates the workers are reaching consensus.We measure the consensus error in three aspects.We first provide the results of the original paper in Figure 9(a), where constant step size is adopted. We can see that even with extremely small number of bits as used in "Aggressive Quantization”,allthe workers are able to reach consensus.We further plot consensus error under the setting where decreasing step size is adopted as defined in this section. We can see in Figure 9(b) and Figure 9(c) that all the workers are able to reach consensus.
+
+
+Figure 9: Consensus Error of Moniqua with different number of bits.
+
+# DWHY NAIVE QUANTIZATION FAILS IN D-PSGD (PROOF TO THEOREM 1)
+
+The update rule of naive quantization on D-PSGD is
+
+$$
+\boldsymbol { x } _ { k + 1 , i } = \boldsymbol { x } _ { k , i } W _ { i i } + \sum _ { j = 1 , j \neq i } ^ { n } \mathcal { Q } ( \boldsymbol { x } _ { k , j } ) W _ { j i } - \alpha _ { k } \widetilde { g } _ { k , i } = \boldsymbol { x } _ { k , i } + \sum _ { j = 1 , j \neq i } ^ { n } \big ( \mathcal { Q } ( \boldsymbol { x } _ { k , j } ) - \boldsymbol { x } _ { k , i } \big ) W _ { j i } - \alpha _ { k } \widetilde { g } _ { k , i }
+$$
+
+where $\alpha _ { k }$ is allowed to vary with any policy. Let
+
+$$
+\begin{array} { l } { { \displaystyle X _ { k } = [ x _ { k , 1 } , \cdots , x _ { k , n } ] \in \mathbb { R } ^ { d \times n } } } \\ { { \displaystyle \Omega _ { k } = \left[ \sum _ { j \neq 1 } W _ { j 1 } \left( \mathcal { Q } ( x _ { k , j } ) - x _ { k , 1 } \right) , \cdots , \sum _ { j \neq n } W _ { j n } \left( \mathcal { Q } ( x _ { k , j } ) - x _ { k , n } \right) \right] \in \mathbb { R } ^ { d \times n } } } \\ { { \displaystyle \widetilde G _ { k } = [ \widetilde g _ { k , 1 } , \cdots , \widetilde g _ { k , n } ] \in \mathbb { R } ^ { d \times n } } } \end{array}
+$$
+
+by rewritting the update rule, we obtain
+
+$$
+X _ { k + 1 } = X _ { k } + \Omega _ { k } - \alpha _ { k } \widetilde { G } _ { k }
+$$
+
+Let $Y _ { k } = X _ { k } - x ^ { * } \mathbb { 1 } _ { n } ^ { \top }$ , and considering the fact that $\nabla f ( x ) = x - \delta / 2 = x - x ^ { * }$ , we can rewrite the update rule as
+
+$$
+Y _ { k + 1 } e _ { i } = Y _ { k } e _ { i } + \Omega _ { k } e _ { i } - \alpha _ { k } Y _ { k } e _ { i } + \alpha _ { k } \left( \widetilde { G } _ { k } - G _ { k } \right) e _ { i }
+$$
+
+where $\left( \widetilde { G } _ { k } - G _ { k } \right)$ denotes ariace headplig
+
+Suppose that by using the update rule of naive quantization, worker $i$ converges to $x ^ { * }$ . Then there must exist a $K$ such that $\forall k \geq K$ ,
+
+$$
+\mathbb { E } \left. Y _ { k + 1 } e _ { i } \right. ^ { 2 } \leq \mathbb { E } \left. Y _ { k } e _ { i } \right. ^ { 2 } < \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) }
+$$
+
+Next we show that this assumption lets us derive a contradiction. Firstly,considering the property of linear quantizer,
+
+$$
+\frac { \delta ^ { 2 } } { 4 } \leq \mathbb { E } \left\| \mathscr { Q } ( x _ { k , i } ) - x ^ { * } \right\| ^ { 2 } \leq 2 \mathbb { E } \left\| \mathscr { Q } ( x _ { k , i } ) - x _ { k , i } \right\| ^ { 2 } + 2 \mathbb { E } \left\| x _ { k , i } - x ^ { * } \right\| ^ { 2 }
+$$
+
+As a result
+
+$$
+\mathbb { E } \left. \mathcal { Q } ( x _ { k , i } ) - x _ { k , i } \right. ^ { 2 } \geq \frac { \delta ^ { 2 } } { 8 } - \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) } = \frac { \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) }
+$$
+
+Since $\mathcal { Q }$ is unbiased, that means $\mathbb { E } [ \mathcal { Q } ( x ) - x ] = 0$ , then we have
+
+$$
+\mathbb { E } \left. \Omega _ { k } \boldsymbol { e } _ { i } \right. ^ { 2 }
+$$
+
+$$
+\begin{array} { r l } & { = \mathbb { E } \left\| \displaystyle \sum _ { j \neq i } W _ { j i } \left( \mathcal { Q } ( x _ { k , j } ) - x _ { k , i } \right) \right\| ^ { 2 } } \\ & { = \displaystyle \sum _ { j \neq N _ { i } } W _ { j i } ^ { 2 } \mathbb { E } \| \left( \mathcal { Q } ( x _ { k , j } ) - x _ { k , i } \right) \| ^ { 2 } + \displaystyle \sum _ { m \neq n \neq i } \mathbb { E } \left. \left( \mathcal { Q } ( x _ { k , m } ) - x _ { k , i } \right) W _ { m i } , \left( \mathcal { Q } ( x _ { k , n } ) - x _ { k , i } \right) W _ { n i } \right. } \\ & { \geq \phi ^ { 2 } \displaystyle \sum _ { j \neq N _ { i } } \mathbb { E } \| \left( \mathcal { Q } ( x _ { k , j } ) - x _ { k , i } \right) \| ^ { 2 } + \displaystyle \sum _ { m \neq n \neq i } \mathbb { E } \left. \left( \mathcal { Q } ( x _ { k , m } ) - x _ { k , i } \right) W _ { m i } , \left( \mathcal { Q } ( x _ { k , n } ) - x _ { k , i } \right) W _ { n i } \right. } \\ & { \overset { ( c ) } { = } \phi ^ { 2 } \displaystyle \sum _ { j \neq N _ { i } } \mathbb { E } \| \mathcal { Q } ( x _ { k , j } ) - x _ { k , i } \| ^ { 2 } } \\ & { > \phi ^ { 2 } \delta ^ { 2 } } \end{array}
+$$
+
+where step $( * )$ holds due to unbiased quantizer. Puting it back to the update rule, we obtain
+
+$$
+\begin{array} { r l } & { \mathbb { E } \left\| Y _ { k + 1 } e _ { i } \right\| ^ { 2 } = \mathbb { E } \left\| \left( Y _ { k } + \Omega _ { k } - \alpha _ { k } Y _ { k } + \alpha _ { k } \left( \widetilde { G } _ { k } - G _ { k } \right) \right) e _ { i } \right\| ^ { 2 } } \\ & { \qquad \overset { ( * ) } { = } \mathbb { E } \left\| \left( 1 - \alpha _ { k } \right) Y _ { k } e _ { i } \right\| ^ { 2 } + \mathbb { E } \left\| \Omega _ { k } e _ { i } \right\| ^ { 2 } + \mathbb { E } \left\| \alpha _ { k } \left( \widetilde { G } _ { k } - G _ { k } \right) e _ { i } \right\| ^ { 2 } } \\ & { \qquad \geq \mathbb { E } \left\| \Omega _ { k } e _ { i } \right\| ^ { 2 } } \\ & { \qquad \geq \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 \left( 1 + \phi ^ { 2 } \right) } } \end{array}
+$$
+
+where cross terms in the $( * )$ step are all O due to the unbiased quantizer and unbiased sampling of the gradient. Her weobtain the contradictorythat $\begin{array} { r } { \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) } \leq \mathbb { E } \left. x _ { k + 1 } - x ^ { * } \right. ^ { 2 } < \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) } } \end{array}$ . That being said, for $\forall k , i$
+
+$$
+\mathbb { E } \left\| x _ { k , i } - x ^ { * } \right\| ^ { 2 } = \mathbb { E } \left\| \nabla f ( x _ { k , i } ) \right\| ^ { 2 } \geq \frac { \phi ^ { 2 } \delta ^ { 2 } } { 8 ( 1 + \phi ^ { 2 } ) }
+$$
+
+Thus we complete the proof.
+
+# EA MARKOV CHAIN ANALYSIS ON THE COMMUNICATION
+
+To better understand how the parallel workers reach consensus over a communication matrix, in this section we use theory from the analysis of Markov Chains to obtain some useful lemmas for proof of Moniqua on D-PSGD and AD-PSGD.
+
+Since the communication matrix $W$ is doubly stochastic (each row and column sum to 1), it has the
+s . N ther and ofa MarkoyXChait wth $\frac { \mathbb { 1 } _ { n } } { n }$ $\begin{array} { r } { W { \frac { \mathbb { 1 } _ { n } } { n } } = { \frac { \mathbb { 1 } _ { n } } { n } } } \end{array}$ $t _ { \mathrm { m i x } }$ $d ( t )$
+state and stationary distribution as defined in Markov Chain theory.9
+
+# E.1 D-PSGD
+
+In D-PSGD, the communication matrix is fixed during the training. That makes it perfectly aligned with the structure of a Markov Chain. As a result, we obtain the following lemma:
+
+Lemma 1
+
+$$
+\left. \mathbf { \mathscr { W } } ^ { t } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right. _ { 1 } \leq 2 \cdot 2 ^ { - \left\lfloor \frac { t } { t _ { \operatorname* { m i x } } } \right\rfloor }
+$$
+
+Proof Fol $\cdot \forall x \in \mathbb { R } ^ { d }$ let $u \in \mathbb { R } ^ { d }$ be such a vector that every entry of $u$ is the positive entry of x and 0 otherwise. Let $v \in \mathbb { R } ^ { d }$ be such a vector that every entry of $v$ is the absolute value of negative entry of $x$ and $O$ otherwise. The setting above means $x = u - v$ For example,
+
+$$
+x = [ 2 , - 1 ] ^ { \top }
+$$
+
+$$
+\begin{array} { r } { u = \left[ 2 , 0 \right] ^ { \top } } \\ { v = \left[ 0 , 1 \right] ^ { \top } } \end{array}
+$$
+
+And we have
+
+$$
+\begin{array} { r l } & { \left\| W ^ { t } \left( I - \frac { \mathbb { I } _ { n } \frac { \mathbb { I } _ { n } ^ { \top } } { n } } \right) x \right\| _ { 1 } } \\ & { = \left\| W ^ { t } \left( I - \frac { \mathbb { I } _ { n } \frac { \mathbb { I } _ { n } ^ { \top } } { n } } \right) ( u - v ) \right\| _ { 1 } } \\ & { \leq \left\| W ^ { t } \left( I - \frac { \mathbb { I } _ { n } \frac { \mathbb { I } _ { n } ^ { \top } } { n } } { n } \right) u \right\| _ { 1 } + \left\| W ^ { t } \left( I - \frac { \mathbb { I } _ { n } \frac { \mathbb { I } _ { n } ^ { \top } } { n } } { n } \right) v \right\| _ { 1 } } \\ & { = \mathbb { I } _ { n } ^ { \top } u \left\| W ^ { t } \frac { u } { \mathbb { I } _ { n } ^ { \top } u } - \frac { \mathbb { I } _ { n } } { n } \right\| _ { 1 } + \mathbb { I } _ { n } ^ { \top } v \left\| W ^ { t } \frac { v } { \mathbb { I } _ { n } ^ { \top } v } - \frac { \mathbb { I } _ { n } } { n } \right\| _ { 1 } } \\ & { \leq 2 ( \mathbb { I } _ { n } ^ { \top } u + \mathbb { I } _ { n } ^ { \top } v ) d ( t ) } \\ & { \leq 2 d ( \mathbb { I } \left\| \mathfrak { I } \right\| _ { 1 } ) \left\| x \right\| _ { 1 } } \end{array}
+$$
+
+Considering the definition of $L I$ -norm, we have
+
+$$
+\left\| { W ^ { t } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) } \right\| _ { 1 } = \operatorname* { m a x } \frac { \left\| \ b { W ^ { t } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \ b { x } } \right\| _ { 1 } } { \left\| \ b { x } \right\| _ { 1 } } \leq 2 d ( t )
+$$
+
+According to a well-known results on the theory of Markov Chains,10 $d ( l t _ { \mathrm { m i x } } ) \leq 2 ^ { - l }$ holds for any non-negative integer $l$ ,so we have
+
+$$
+\left\| W ^ { t } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \leq 2 d ( t ) \leq 2 d \left( \frac { t } { t _ { \operatorname* { m i x } } } \cdot t _ { \operatorname* { m i x } } \right) \leq 2 d \left( \left\lfloor \frac { t } { t _ { \operatorname* { m i x } } } \right\rfloor t _ { \operatorname* { m i x } } \right) \leq 2 \cdot 2 ^ { - \left\lfloor \frac { t } { t _ { \operatorname* { m i x } } } \right\rfloor }
+$$
+
+That completes the proof.
+
+Additionally,based on standard results in the theory of reversible Markov Chains, we also havel1
+
+$$
+t _ { \operatorname* { m i x } } \leq \log \left( \frac { 1 } { \frac { 1 } { 4 } \cdot \frac { 1 } { n } } \right) \frac { 1 } { 1 - \rho } \leq \frac { \log ( 4 n ) } { 1 - \rho } .
+$$
+
+# E.2AD-PSGD
+
+Note that unlike D-PSGD, here $W _ { k }$ can be different at each update step and usually each individually have spectral radius $\rho = 1$ , so we can't expect to get a bound in terms of a bound on the spectral gap as we did in Theorems 2 and 3. Instead, we require the following condition, which is inspired by the literature on Markov chain Monte Carlo methods: for some constant $t _ { \mathrm { m i x } }$ (here $t _ { \mathrm { m i x } }$ is the same as $t _ { \mathrm { m i x } }$ in the paper) and for any $k$ and any non-negative vector $\mu \in \mathbb { R } ^ { d }$ such that $\mathbb { I } _ { n } ^ { \top } \boldsymbol { \mu } = 1$ , it must hold that
+
+$$
+\left\| \left( \prod _ { i = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { k + i } \right) \mu - \frac { \mathbb { 1 } _ { n } } { n } \right\| _ { 1 } \leq \frac { 1 } { 2 } .
+$$
+
+We call this constant $t _ { \mathrm { m i x } }$ because it is effectively the mixing time of the time-inhomogeneous Markov chain with transition probability matrix $W _ { k }$ at time $k$ . Note that this condition is more general than those used in previous work on AD-PSGD because it does not require that the $W _ { k }$ are sampled independently or in an unbiased manner. Based on the above analysis, we can prove the following lemma, which is analogous to the lemma used in the synchronous case.
+
+Lemma 2 For any $k \geq 0$ and for any $b \geq a \geq 0$ there exists $t _ { \mathrm { m i x } }$ such that
+
+$$
+\left\| \prod _ { q = a } ^ { b } W _ { q } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \leq 2 \cdot 2 ^ { - \left\lfloor \frac { b - a + 1 } { t _ { \operatorname* { m i x } } } \right\rfloor }
+$$
+
+Proof Note that for any $x \in \mathbb { R } ^ { d }$ , and let u and $v$ be two vectors having same definition as in Lemma 1 with respect to $x$ ,then we have for any $k$
+
+$$
+\begin{array} { r l } { \displaystyle \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \left( I - \frac { 1 } { n } \pi \frac { 1 } { n } \right) x \right\| _ { 1 } } & { = \displaystyle \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \left( I - \frac { 1 _ { n } \mathbb { I } _ { n } ^ { \mathbb T } } { n } \right) ( u - v ) \right\| _ { 1 } } \\ & { \leq \displaystyle \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \left( I - \frac { 1 _ { n } \mathbb { I } _ { n } ^ { \mathbb T } } { n } \right) u \right\| _ { 1 } + \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \mathbb T } } { n } \right) v \right\| _ { 1 } } \\ & { = \displaystyle \mathbb { I } _ { n } ^ { \mathbb { T } } u \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \frac { u } { \mathbb { I } _ { n } ^ { \mathbb T } u } - \frac { \mathbb { I } _ { n } } { n } \right\| _ { 1 } + \displaystyle \mathbb { I } _ { n } ^ { \mathbb { T } } v \left\| \displaystyle \prod _ { q = 1 } ^ { \operatorname* { m a x } } W _ { q + k } \frac { v } { \mathbb { I } _ { n } ^ { \mathbb { T } } v } - \frac { 1 } { n } \right\| _ { 1 } } \\ & { \leq \displaystyle \frac { 1 } { 2 } ( \mathbb { I } _ { n } ^ { \mathbb { T } } u + \mathbb { I } _ { n } ^ { \mathbb { T } } v ) } \\ & { \leq \frac { 1 } { 2 } \| x \| _ { 1 } } \end{array}
+$$
+
+Considering the definition of the induced $\ell _ { 1 }$ operator norm, we have
+
+$$
+\left\| \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { q + k } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } = \operatorname* { m a x } _ { x } \frac { \left\| \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { q + k } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) x \right\| _ { 1 } } { \| x \| _ { 1 } } \leq \frac { 1 } { 2 }
+$$
+
+As a result,from the submultiplicativity of the matrix induced norm, we obtain
+
+$$
+\begin{array} { r l } & { \left\| \displaystyle \prod _ { q = a } ^ { b } W _ { q } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } } \\ & { \leq \left\| \displaystyle \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { a - 1 + q } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \cdots \left\| \displaystyle \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { \cdots + q } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \cdot \left\| \displaystyle \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { \cdots + q } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } } \\ & { \leq 2 ^ { - \left\lfloor \frac { b - a + 1 } { t _ { \operatorname* { m i x } } } \right\rfloor } \left\| \displaystyle \prod _ { q = 1 } ^ { t _ { \operatorname* { m i x } } } W _ { \cdots + q } \left( I - \frac { \mathbb { I } _ { n } \mathbb { I } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } } \end{array}
+$$
+
+where $t _ { r } = ( b - a + 1 )$ mod $t _ { \mathrm { m i x } }$ Note that
+
+$$
+\left\| \prod _ { q = 1 } ^ { t _ { r } } W _ { q } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \leq 1 - \frac { 1 } { n } + ( n - 1 ) \frac { 1 } { n } = 2 - \frac { 2 } { n } \leq 2
+$$
+
+Putting it back we obtain
+
+$$
+\left\| \prod _ { q = a } ^ { b } W _ { \cdots + q } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \leq 2 \cdot 2 ^ { - \left\lfloor \frac { b - a + 1 } { t _ { \operatorname* { m i x } } } \right\rfloor }
+$$
+
+That completes the proof.
+
+Note that in the analysis of Moniqua on AD-PSGD (Section $\mathrm { H }$ ),we will use this lemma as an assumption.
+
+# FMONIQUA ON D-PSGD (PROOF TO THEOREM 2)
+
+Consistent with linear and non-linear quantizer Here we briefly explain why using $\theta$ · $\begin{array} { r } { \mathcal { Q } _ { \delta } \left( \frac { x } { \theta } \bmod { 1 } \right) } \end{array}$ instead of $\mathcal { Q } _ { \delta } \left( x \mathrm { m o d } \theta \right)$ for theoretical analysis and how it covers both linear and non-linear quantizers.Note that typically,a linear quantizer has:
+
+$$
+\Vert \mathcal { Q } _ { \delta } ( x ) - x \Vert _ { \infty } \leq \delta , \quad \forall x \in \mathbb { R } ^ { d }
+$$
+
+while a non-linear quantizer has
+
+$$
+\begin{array} { r } { \| \mathcal { Q } _ { \delta } ( x ) - x \| _ { \infty } \leq \delta \| x \| _ { \infty } , \quad \forall x \in \mathbb { R } ^ { d } } \end{array}
+$$
+
+so that for linear quantizer, with a given $x \leq \theta$
+
+$$
+\left\| \theta \cdot \mathcal { Q } _ { \delta } \left( \frac { x } { \theta } \mathrm { m o d } 1 \right) - x \right\| _ { \infty } = \theta \left\| \mathcal { Q } _ { \delta } \left( \frac { x } { \theta } \mathrm { m o d } 1 \right) - \left( \frac { x } { \theta } \mathrm { m o d } 1 \right) \right\| _ { \infty } \leq \theta \delta = \theta \delta
+$$
+
+And for non-linear quantizer, with a given $x \leq \theta$
+
+$$
+\left\| \theta \cdot \mathcal { Q } _ { \delta } \left( \frac { x } { \theta } \operatorname { m o d } 1 \right) - x \right\| _ { \infty } = \theta \left\| \mathcal { Q } _ { \delta } \left( \frac { x } { \theta } \operatorname { m o d } 1 \right) - \left( \frac { x } { \theta } \operatorname { m o d } 1 \right) \right\| _ { \infty } \leq \theta \delta \cdot 1 = \theta \delta
+$$
+
+As a result, we can use the same bound $\theta \delta$ for quantizers with both of the properties,which we will show in the rest of the proof.
+
+# F.1 PROOF TO THEOREM 2
+
+Proof For convenience, we define the following notation
+
+$$
+\begin{array} { r l } & { X _ { k } = \left[ x _ { k , 1 } , \cdots , x _ { k , n } \right] , \qquad Q _ { k } = \left[ q _ { k , 1 } , \cdots , q _ { k , n } \right] } \\ & { \widetilde { G } _ { k } = \left[ \widetilde { g } _ { k , 1 } , \cdots , \widetilde { g } _ { k , n } \right] , \qquad G _ { k } = \left[ g _ { k , 1 } , \cdots , g _ { k , n } \right] } \\ & { \overline { { X } } = X \displaystyle \frac { \mathbb { 1 } _ { n } } { n } , \forall X \in \mathbb { R } ^ { d \times n } , \qquad \Omega _ { k } = ( Q _ { k } - X _ { k } ) ( W - I ) } \end{array}
+$$
+
+where ${ g } _ { k , i }$ denotes gradient computed via the whole dataset $\mathcal { D } _ { i }$ and $x _ { k , i }$
+
+From a local view, the update rule of Algorithm $^ { l }$ on worker $i$ at iteration $k$ can be written as
+
+$$
+x _ { k + 1 , i } x _ { k , i } + \sum _ { j \in \mathcal { N } _ { i } } ( q _ { k , j } - q _ { k , i } ) W _ { j i } - \alpha \widetilde { g } _ { k , i }
+$$
+
+which is equivalent to
+
+$$
+x _ { k + 1 , i } = x _ { k , i } + \sum _ { j = 1 } ^ { n } \left( x _ { k , j } - x _ { k , i } \right) W _ { j i } - \alpha \widetilde { g } _ { k , i } + \sum _ { j = 1 } ^ { n } \left( \left( q _ { k , j } - x _ { k , j } \right) - \left( q _ { k , i } - x _ { k , i } \right) \right) W _ { j i }
+$$
+
+From a global view, the update rule can be written as
+
+$$
+X _ { k + 1 } = X _ { k } + Q _ { k } ( W - I ) - \alpha \widetilde { G } _ { k } = X _ { k } W - \alpha \widetilde { G } _ { k } + ( Q _ { k } - X _ { k } ) ( W - I )
+$$
+
+From Lemma $5$ we have
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \leq \frac { 4 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 \alpha L } { n } \sigma ^ { 2 } + \frac { 8 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { ( 1 - \rho ) ^ { 2 } } } \\ { \displaystyle \qquad + \frac { 8 L ^ { 2 } } { n K ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Note that
+
+$$
+\sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } = \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \sum _ { j = 1 } ^ { n } \left( \left( q _ { k , j } - x _ { k , j } \right) - \left( q _ { k , i } - x _ { k , i } \right) \right) W _ { j i } \right\| ^ { 2 }
+$$
+
+The last step holds because $\begin{array} { r } { \delta \theta = \frac { 1 } { 2 } \alpha G _ { \infty } } \end{array}$ . Pushing it back we obtain
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \leq \frac { 4 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 \alpha L } { n } \sigma ^ { 2 } + \frac { 8 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { ( 1 - \rho ) ^ { 2 } } + \frac { 8 \alpha ^ { 2 } G _ { \infty } ^ { 2 } d L ^ { 2 } } { ( 1 - \rho ) ^ { 2 } }
+$$
+
+By settingα = 3K+√+2L' ,we have
+
+$$
+\begin{array} { r l } & { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \leq \frac { 8 ( f ( 0 ) - f ^ { * } ) L } { K } + \frac { 4 \sigma ( f ( 0 ) - f ^ { * } + L / 2 ) } { \sqrt { n K } } + \frac { 4 \varsigma ^ { \frac { 2 } { 3 } } ( f ( 0 ) - f ^ { * } ) } { K ^ { \frac { 2 } { 3 } } } } \\ & { \qquad + \frac { 8 L ^ { 2 } \sigma ^ { 2 } n } { ( 1 - \rho ) ^ { 2 } ( \sigma ^ { 2 } K + 4 n L ^ { 2 } ) } + \frac { 2 4 L ^ { 2 } \varsigma ^ { \frac { 2 } { 3 } } } { ( 1 - \rho ) ^ { 2 } K ^ { \frac { 2 } { 3 } } } + \frac { 8 L ^ { 2 } G _ { \infty } ^ { 2 } d n } { ( 1 - \rho ) ^ { 2 } ( \sigma ^ { 2 } K + 4 n L ^ { 2 } ) } } \\ & { \qquad \lesssim \frac { 1 } { K } + \frac { \sigma } { \sqrt { n K } } + \frac { \varsigma ^ { \frac { 2 } { 3 } } } { K ^ { \frac { 2 } { 3 } } } + \frac { \sigma ^ { 2 } n } { \sigma ^ { 2 } K + n } + \frac { G _ { \infty } ^ { 2 } d n } { \sigma ^ { 2 } K + n } } \end{array}
+$$
+
+That completes the proof of Theorem 2.
+
+# F.2 LEMMA FOR MONIQUA ON D-PSGD
+
+Lemma 3 If $\| x _ { t , i } - x _ { t , j } \| _ { \infty } \leq \theta , \forall i , j$ holds at iteration $t$ ,then
+
+$$
+\left\| \sum _ { j = 1 } ^ { n } \left( \left( q _ { t , j } - x _ { t , j } \right) - \left( q _ { t , i } - x _ { t , i } \right) \right) W _ { j i } \right\| _ { \infty } \leq 2 \delta \theta
+$$
+
+# Proof
+
+$$
+\begin{array} { r l } & | \begin{array} { l } { \displaystyle \sum _ { j = 1 } ^ { N } \mathsf { G } _ { \theta , j } - v _ { \theta , j } \mathsf { I } - \mathsf { I } ( y _ { \theta } - x _ { \theta } ) \mathsf { I } \mathsf { I } _ { \theta , j } | _ { \alpha = 1 } } \\ { \displaystyle \sum _ { j = 1 } ^ { N } \mathbb { E } _ { y _ { \theta } , j } [ \mathsf { I } _ { \theta , j } - v _ { \theta , j } - \mathsf { I } _ { \theta , i } - v _ { \theta , i } ] \mathsf { I } _ { \theta , i } } \\ { = \displaystyle \sum _ { j = 1 } ^ { N } \mathbb { E } _ { y _ { \theta } , j } [ \mathsf { I } _ { \theta , j } ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } - v _ { \theta , i } ] \mathsf { I } _ { \theta , i } } \\ { = \displaystyle \sum _ { j = 1 } ^ { N } v _ { i , j } [ \theta ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } ( \theta _ { i , j } - v _ { \theta , i } ) ] _ { \alpha = 1 } } \\ { = \displaystyle \sum _ { j = 1 } ^ { N } v _ { i , j } [ \theta ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } ( \theta _ { i , j } ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } ( \theta _ { i , j } ( \theta _ { i , j } ( \theta _ { i , j } ( \theta _ { i , j } ( \theta _ { i , j } ) ) ) ) ) ] _ { \alpha = 1 } ] \mathsf { I } _ { \theta , j } } \\ = \displaystyle \sum _ { j = 1 } ^ { N } V _ { i , j } [ \theta ( \frac { v _ { \theta } } { \theta } ) ^ { - 1 } v _ { i , j } ( \theta _ { i , j } ^ { ( \alpha _ { \alpha \beta } ) } ( \theta _ { i , j } ^ { ( \alpha _ { \alpha \beta } ) } ( 1 ) ) ( \theta _ { i , j } ^ { ( \alpha _ { \alpha } ) } ( \theta _ i \end{array} \end{array}
+$$
+
+Lemma 4 In any iteration $k \geq 0 ,$ , and for any two worker $i$ and $j$ ,we have:
+
+$$
+\| X _ { k } ( e _ { i } - e _ { j } ) \| _ { \infty } \leq \theta = \frac { 2 \log ( 1 6 n ) } { 1 - \rho } \alpha G _ { \infty }
+$$
+
+Proof We use mathematical induction to prove this:
+
+1. When $k = 0$ $\left\| X _ { 0 } ( e _ { i } - e _ { j } ) \right\| _ { \infty } = 0 \leq \theta , \forall i , j$
+
+II. Suppose for $\left\| X _ { k } ( e _ { i } - e _ { j } ) \right\| _ { \infty } \leq \theta , k \geq 0 , \forall i , j ,$ we have
+
+$$
+\begin{array} { r } { \lVert X _ { k + 1 } ( e _ { i } - e _ { j } ) \rVert _ { \infty } = \Big \lVert \Big ( X _ { k } W - \alpha \widetilde { G } _ { k } + \Omega _ { k } \Big ) ( e _ { i } - e _ { j } ) \Big \rVert _ { \infty } } \\ { \overset { X _ { \underline { { 0 } } = 0 } } { = } \left. \displaystyle \sum _ { t = 0 } ^ { k } \left( - \alpha \widetilde { G } _ { t } + \Omega _ { t } \right) W ^ { k - t } ( e _ { i } - e _ { j } ) \right. _ { \infty } } \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \qquad \le \displaystyle \sum _ { \ell = 0 } ^ { k } \left\| \left( - \alpha \bar { G } _ { \ell } + \Omega _ { t } \right) W ^ { k - \ell } ( e _ { \ell } - e _ { \ell } ) \right\| _ { \infty } } \\ & { \qquad \le \displaystyle \sum _ { \ell = 0 } ^ { k } \left\| - \alpha \bar { G } _ { \ell } + \Omega _ { t } \right\| _ { 1 , \infty } \left\| W ^ { k - \ell } ( e _ { \ell } - e _ { \ell } ) \right\| _ { 1 } } \\ & { \qquad \le \displaystyle \sum _ { \ell = 0 } ^ { k } \left( \alpha \left\| \bar { G } _ { \ell } \right\| _ { 1 , \infty } + \left\| \Omega _ { \ell } \right\| _ { 1 , \infty } \right) \left\| W ^ { k - \ell } ( e _ { \ell } - e _ { \ell } ) \right\| _ { 1 } } \\ & { \qquad \le \displaystyle \sum _ { \ell = 0 } ^ { k } \left( \alpha \mathcal { G } _ { \infty } + 2 \delta \theta \right) \displaystyle \sum _ { \ell = 0 } ^ { k } \left\| W ^ { k - \ell } ( e _ { \ell } - e _ { \ell } ) \right\| _ { 1 } } \\ & { \qquad \le \displaystyle ( \alpha G _ { \infty } + 2 \delta \theta ) \displaystyle \sum _ { \ell = 0 } ^ { \infty } \left\| W ^ { \ell } ( e _ { \ell } - e _ { \ell } ) \right\| _ { 1 } } \end{array}
+$$
+
+For any $t \geq 0$ ,on one hand
+
+$$
+\left. W ^ { t } ( e _ { i } - e _ { j } ) \right. _ { 1 } \leq \sqrt { n } \left. W ^ { t } ( e _ { i } - e _ { j } ) \right. _ { 2 } \leq \sqrt { n } \left. W ^ { t } e _ { i } - \frac { \mathbb { 1 } _ { n } } { n } \right. + \sqrt { n } \left. W ^ { t } e _ { j } - \frac { \mathbb { 1 } _ { n } } { n } \right. \leq 2 \sqrt { n } \rho ^ { t }
+$$
+
+where the last step holds due to the diagonalizability of $W$ . On the other hand,
+
+$$
+\begin{array} { r } { \left\| { W ^ { t } ( e _ { i } - e _ { j } ) } \right\| _ { 1 } \le { \mathbb { 1 } _ { n } ^ { \top } } W ^ { t } e _ { i } + { \mathbb { 1 } _ { n } ^ { \top } } W ^ { t } e _ { i } = { \mathbb { 1 } _ { n } ^ { \top } } e _ { i } + { \mathbb { 1 } _ { n } ^ { \top } } e _ { j } = 2 } \end{array}
+$$
+
+So
+
+$$
+\left\| W ^ { t } ( e _ { i } - e _ { j } ) \right\| _ { 1 } \leq \operatorname* { m i n } \{ 2 { \sqrt { n } } \rho ^ { t } , 2 \}
+$$
+
+Let $\begin{array} { r } { T _ { 0 } = \left\lceil \frac { - \log ( \sqrt { n } ) } { \log ( \rho ) } \right\rceil } \end{array}$ , so hat $n \rho ^ { T _ { 0 } } \leq 1$ then we have
+
+$$
+\begin{array} { r l } { \displaystyle \sum _ { t = 0 } ^ { \infty } \left\| W ^ { t } ( e _ { i } - e _ { i } ) \right\| _ { 1 } = \displaystyle \sum _ { t = 0 } ^ { T _ { 0 } - 1 } \left\| W ^ { t } ( e _ { i } - e _ { i } ) \right\| _ { 1 } + \displaystyle \sum _ { t = T _ { 0 } } ^ { \infty } \left\| W ^ { t } ( e _ { i } - e _ { j } ) \right\| _ { 1 } } & { } \\ { \displaystyle \leq \displaystyle \sum _ { t = 0 } ^ { T _ { 0 } - 1 } + \displaystyle \sum _ { t = 0 } ^ { \infty } \sum \sqrt { n } \rho ^ { i + T _ { 0 } } } & { } \\ { \displaystyle \leq 2 \left\lceil \frac { - \log ( \sqrt { n } ) } { \log ( \rho ) } \right\rceil + \displaystyle \sum _ { t = 0 } ^ { \infty } 2 \left( \sqrt { n } \rho ^ { T _ { 0 } } \right) \rho ^ { i } } & { } \\ { \displaystyle \leq \frac { 2 \log ( \sqrt { n } ) } { 1 - \rho } + 2 + \frac { 2 } { 1 - \rho } } & { } \\ { \displaystyle \leq \frac { \log ( \log ( \log ) ) } { 1 - \rho } } & { } \end{array}
+$$
+
+As a result, we have
+
+$$
+\| X _ { k + 1 } ( e _ { i } - e _ { j } ) \| _ { \infty } \leq \left( \alpha G _ { \infty } + 2 \delta \theta \right) \frac { \log ( 1 6 n ) } { 1 - \rho }
+$$
+
+Since $\begin{array} { r } { \delta = \frac { 1 - \rho } { 4 \log ( 1 6 n ) } } \end{array}$ , we have
+
+$$
+\left\| X _ { k + 1 } ( e _ { i } - e _ { j } ) \right\| _ { \infty } \leq ( \alpha G _ { \infty } + 2 \delta \theta ) \frac { \log ( 1 6 n ) } { 1 - \rho } \leq \frac { 2 \log ( 1 6 n ) } { 1 - \rho } \alpha G _ { \infty } = \theta
+$$
+
+Combining I and $I I$ , we complete the proof.
+
+Lemma 5 The output of Algorithm $I$ has the following bound:
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \leq \frac { 4 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 \alpha L } { n } \sigma ^ { 2 } + \frac { 8 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { ( 1 - \rho ) ^ { 2 } } } \\ { \displaystyle \qquad + \frac { 8 L ^ { 2 } } { n K ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Proof From Lemma 8, we have
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \frac { 1 - \alpha L } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { G } _ { k } \right\| ^ { 2 } + \displaystyle \frac { 1 } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \quad \le \displaystyle \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \displaystyle \frac { L ^ { 2 } } { n K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \\ & { \quad \overset { L e m m a n ~ } { \le } \displaystyle \frac { 2 \big ( f ( 0 ) - f ^ { * } \big ) } { \alpha K } + \displaystyle \frac { \alpha L } { n } \sigma ^ { 2 } + \displaystyle \frac { 2 \alpha ^ { 2 } L ^ { 2 } } { M _ { 1 } \big ( 1 - \rho \big ) ^ { 2 } } \left( \sigma ^ { 2 } + 3 s ^ { 2 } + \displaystyle \frac { 3 } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \right) } \\ & { \quad \quad \quad + \displaystyle \frac { 2 L ^ { 2 } } { M _ { 1 } n K \big ( 1 - \rho \big ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+where
+
+$$
+M _ { 1 } = 1 - \frac { 6 \alpha ^ { 2 } L ^ { 2 } } { ( 1 - \rho ) ^ { 2 } }
+$$
+
+Rearrange the terms, we get
+
+$$
+\begin{array} { r l } & { \displaystyle \frac { 1 - \alpha L } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \left( 1 - \frac { 6 \alpha ^ { 2 } L ^ { 2 } } { M _ { 1 } ( 1 - \rho ) ^ { 2 } } \right) \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \displaystyle \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { 2 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { M _ { 1 } ( 1 - \rho ) ^ { 2 } } + \frac { 2 L ^ { 2 } } { M _ { 1 } n K ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Let
+
+$$
+M _ { 2 } = 1 - \frac { 6 \alpha ^ { 2 } L ^ { 2 } } { M _ { 1 } ( 1 - \rho ) ^ { 2 } }
+$$
+
+we get
+
+$$
+\begin{array} { r l } & { \displaystyle \frac { 1 - \alpha L } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { M _ { 2 } } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \displaystyle \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { 2 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { M _ { 1 } ( 1 - \rho ) ^ { 2 } } + \frac { 2 L ^ { 2 } } { M _ { 1 } n K ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Let $\begin{array} { r } { M _ { 1 } , M _ { 2 } \ge \frac { 1 } { 2 } } \end{array}$ and rearrange the terms, we have
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \leq \frac { 4 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 \alpha L } { n } \sigma ^ { 2 } + \frac { 8 \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } \right) } { ( 1 - \rho ) ^ { 2 } } } \\ { \displaystyle \qquad + \frac { 8 L ^ { 2 } } { n K ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+and that completes the proof
+
+Lemma6 Let M1 = 1- 6o²L² we have
+
+$$
+\begin{array} { r l r } { { \frac { L ^ { 2 } } { n K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \| \overline { { X } } _ { k } - x _ { k , i } \| ^ { 2 } \leq \frac { 2 \alpha ^ { 2 } L ^ { 2 } } { M _ { 1 } ( 1 - \rho ) ^ { 2 } } ( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } + \frac { 3 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } ) } } \\ & { } & { \quad + \frac { 2 L ^ { 2 } } { M _ { 1 } n K ( 1 - \rho ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \Omega _ { k } \| _ { F } ^ { 2 } } \end{array}
+$$
+
+Proof
+
+$$
+\sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| { \overline { { X } } } _ { k } - x _ { k , i } \right\| ^ { 2 }
+$$
+
+$$
+\begin{array} { r l } & { \quad - \frac { \sqrt { 3 } } { 2 } \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & { \quad - \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & { \quad - \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & { = - \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & { \quad - \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \times \frac { \sqrt { 5 } } { 2 } \frac { \sqrt { 5 } } { 2 } \left\{ \left| { \bf { x } } _ { \perp \perp } ^ { ( 1 ) } - { \bf { x } } _ { \perp \perp } ^ { ( 2 ) } \right| ^ { 2 } \right\} } \\ & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
+$$
+
+Rearrange the terms, we have
+
+$$
+\begin{array} { l } { \displaystyle \left( 1 - \frac { 6 \alpha ^ { 2 } L ^ { 2 } } { ( 1 - \rho ) ^ { 2 } } \right) \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 \alpha ^ { 2 } } { ( 1 - \rho ) ^ { 2 } } \left( n \sigma ^ { 2 } K + 3 n \varsigma ^ { 2 } K + 3 n \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \right) + \frac { 2 } { ( 1 - \rho ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+$\begin{array} { r } { M _ { 1 } = 1 - \frac { 6 \alpha ^ { 2 } L ^ { 2 } } { ( 1 - \rho ) ^ { 2 } } > 0 , } \end{array}$ we have
+
+$$
+\begin{array} { r l r } { { \frac { L ^ { 2 } } { n K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \| \overline { { X } } _ { k } - x _ { k , i } \| ^ { 2 } \leq \frac { 2 \alpha ^ { 2 } L ^ { 2 } } { M _ { 1 } ( 1 - \rho ) ^ { 2 } } ( \sigma ^ { 2 } + 3 \varsigma ^ { 2 } + \frac { 3 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } ) } } \\ & { } & { \quad + \frac { 2 L ^ { 2 } } { M _ { 1 } n K ( 1 - \rho ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \Omega _ { k } \| _ { F } ^ { 2 } } \end{array}
+$$
+
+# Lemma 7
+
+$$
+\sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \tilde { G } _ { k } \right\| _ { F } ^ { 2 } \leq n \sigma ^ { 2 } K + 3 L ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } + 3 n \varsigma ^ { 2 } K + 3 n \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 }
+$$
+
+Proof From the property of Frobenius norm, we have
+
+$$
+\mathbb { E } \left\| \widetilde { G } _ { k } \right\| _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \widetilde { g } _ { k , i } \right\| ^ { 2 }
+$$
+
+Next, we derive the upper bound ofE $\| \widetilde { g } _ { k , i } \| ^ { 2 }$
+
+$$
+\begin{array} { r l } & { \quad \mathbb { E } \left\| \widetilde { g } _ { k , i } \right\| ^ { 2 } } \\ & { = \mathbb { E } \left\| \widetilde { g } _ { k , i } - g _ { k , i } + g _ { k , i } \right\| ^ { 2 } } \\ & { = \mathbb { E } \left\| \widetilde { g } _ { k , i } - g _ { k , i } \right\| ^ { 2 } + \mathbb { E } \left\| g _ { k , i } \right\| ^ { 2 } + 2 \mathbb { E } \left. \widetilde { g } _ { k , i } - g _ { k , i } , g _ { k , i } \right. } \\ & { = \mathbb { E } \left\| \widetilde { g } _ { k , i } - g _ { k , i } \right\| ^ { 2 } + \mathbb { E } \left\| g _ { k , i } \right\| ^ { 2 } } \\ & { \leq \sigma ^ { 2 } + 3 \mathbb { E } \left\| g _ { k , i } - \nabla f _ { i } ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + 3 \mathbb { E } \left\| \nabla f _ { i } ( \overline { { X } } _ { k } ) - \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + 3 \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \leq \sigma ^ { 2 } + 3 L ^ { 2 } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } + 3 \mathrm { c } ^ { 2 } + 3 \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \end{array}
+$$
+
+Summing from $k = 0$ to $K - 1$ ,we obtain
+
+$$
+\begin{array} { l } { { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { G } _ { k } \right\| _ { F } ^ { 2 } } } \\ { { \displaystyle = \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \| \widetilde { g } _ { k , i } \| ^ { 2 } } } \\ { { \displaystyle \leq \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \sigma ^ { 2 } + 3 L ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } + 3 \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } } \\ { { \displaystyle - n \sigma ^ { 2 } K + 3 L ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } + 3 n \boldsymbol { \mathcal { S } } ^ { 2 } K + 3 n \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } } \end{array}
+$$
+
+That completes the proof
+
+# Lemma 8
+
+$$
+\begin{array} { r l } & { \frac { 1 - \alpha L } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { 1 } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { L ^ { 2 } } { n K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \end{array}
+$$
+
+Proof Let $\mathbb { 1 } _ { n }$ denote a $n$ -dimensional vector with all the entries be 1. And we have
+
+$$
+\overline { { X } } _ { k + 1 } = ( X _ { k } W - \alpha \widetilde { G } _ { k } + \Omega _ { k } ) \frac { 1 _ { n } } { n } = \overline { { X } } _ { k } - \alpha \overline { { \widetilde { G } } } _ { k } + ( Q _ { k } - X _ { k } ) ( W - I ) \frac { 1 _ { n } } { n } = \overline { { X } } _ { k } - \alpha \overline { { \widetilde { G } } } _ { k }
+$$
+
+And by Taylor Expansion, we have
+
+$$
+\begin{array} { r l } & { \mathbb { E } f ( \overline { { X } } _ { k + 1 } ) = \mathbb { E } f \left( \frac { \left( X _ { k } W - \alpha \widetilde { G } _ { k } + \Omega _ { k } \right) \mathbb { 1 } _ { n } } { n } \right) } \\ & { \quad \quad \quad = \mathbb { E } f \left( \overline { { X } } _ { k } - \alpha \overline { { \widetilde { G } } } _ { k } \right) } \\ & { \quad \quad \quad \le \mathbb { E } f ( \overline { { X } } _ { k } ) - \alpha \mathbb { E } \langle \nabla f ( \overline { { X } } _ { k } ) , \overline { { \widetilde { G } } } _ { k } \rangle + \frac { \alpha ^ { 2 } L } { 2 } \mathbb { E } \left\| \overline { { \widetilde { G } } } _ { k } \right\| ^ { 2 } } \end{array}
+$$
+
+And for the last term, we have
+
+$$
+\begin{array} { r l } & { \mathbb { E } \left\| \widetilde { \boldsymbol { G } } _ { k } \right\| ^ { 2 } = \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } \widetilde { g } _ { k , i } } { n } \right\| ^ { 2 } } \\ & { \quad \quad \quad = \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } \widetilde { g } _ { k , i } - \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } + \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } \\ & { \quad \quad \quad = \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } \widetilde { g } _ { k , i } - \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } + \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } \end{array}
+$$
+
+$$
+\begin{array} { l } { { \displaystyle + \mathbb { E } \left. \frac { \sum _ { i = 1 } ^ { n } \widetilde { g } _ { k , i } - \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } + \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right. } } \\ { { \displaystyle \quad = \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } \widetilde { g } _ { k , i } - \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } + \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } } \\ { { \displaystyle A s s u m p t i o n \ ( A 3 ) \ \frac { 1 } { n ^ { 2 } } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \widetilde { g } _ { k , i } - g _ { k , i } \right\| ^ { 2 } + \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } } \\ { { \displaystyle A s s u m p t i o n \ ( A 3 ) \ \frac { \sigma ^ { 2 } } { n } + \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } } \end{array}
+$$
+
+Putting it back,we obtain
+
+$$
+\begin{array} { r l } & { \mathbb { E } f ( \overline { { X } } _ { k + 1 } ) \leq \mathbb { E } f ( \overline { { X } } _ { k } ) - \alpha \mathbb { E } \langle \nabla f ( \overline { { X } } _ { k } ) , \overline { { \widetilde { G } } } _ { k } \rangle + \frac { \alpha ^ { 2 } L } { 2 n } \sigma ^ { 2 } + \frac { \alpha ^ { 2 } L } { 2 } \mathbb { E } \left\| \frac { \sum _ { i = 1 } ^ { n } g _ { k , i } } { n } \right\| ^ { 2 } } \\ & { \qquad = \mathbb { E } f ( \overline { { X } } _ { k } ) - \frac { \alpha - \alpha ^ { 2 } L } { 2 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } - \frac { \alpha } { 2 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + \frac { \alpha ^ { 2 } L } { 2 n } \sigma ^ { 2 } } \\ & { \qquad + \frac { \alpha } { 2 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) - \overline { { G } } _ { k } \right\| ^ { 2 } } \end{array}
+$$
+
+where the last step comes from $2 \langle a , b \rangle = \| a \| ^ { 2 } + \| b \| ^ { 2 } = \| a - b \| ^ { 2 }$ And
+
+$$
+\begin{array} { r l } { \displaystyle \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) - \overline { { G } } _ { k } \right\| ^ { 2 } \leq \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \nabla f _ { i } \left( \frac { \sum _ { i ^ { \prime } = 1 } ^ { n } x _ { k , i ^ { \prime } } } { n } \right) - \nabla f _ { i } ( x _ { k , i } ) \right\| ^ { 2 } } & { } \\ { \displaystyle \underset { \leq } { A s s u m p t i o n ~ ( A 1 ) } \underbrace { L ^ { 2 } } \sum _ { n } ^ { n } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \frac { \sum _ { i ^ { \prime } = 1 } ^ { n } x _ { k , i ^ { \prime } } } { n } - x _ { k , i } \right\| ^ { 2 } } & { } \\ { \displaystyle } & { = \frac { L ^ { 2 } } { n } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \end{array}
+$$
+
+putting it back,we have
+
+$$
+\frac { x - \alpha ^ { 2 } L } { 2 } \mathbb { E } \left. \overline { { G } } _ { k } \right. ^ { 2 } + \frac { \alpha } { 2 } \mathbb { E } \left. \nabla f ( \overline { { X } } _ { k } ) \right. ^ { 2 } \leq \mathbb { E } f ( \overline { { X } } _ { k } ) - \mathbb { E } f ( \overline { { X } } _ { k + 1 } ) + \frac { \alpha ^ { 2 } L } { 2 n } \sigma ^ { 2 } + \frac { \alpha L ^ { 2 } } { 2 n } \sum _ { i = 1 } ^ { n } \mathbb { E } \left. \overline { { X } } _ { k } - x _ { k , i } \right. ^ { 2 }
+$$
+
+summing over from $k = 0$ to $K - 1$ on both sides, we have
+
+$$
+\begin{array} { r l } & { \frac { 1 - \alpha L } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { 1 } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { L ^ { 2 } } { n K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \end{array}
+$$
+
+That completes the proof.
+
+Lemma 9 Given two non-negative sequences $\{ a _ { t } \} _ { t = 1 } ^ { \infty }$ and $\{ b _ { t } \} _ { t = 1 } ^ { \infty }$ that satisfying
+
+$$
+a _ { t } = \sum _ { s = 1 } ^ { t } \rho ^ { t - s } b _ { s }
+$$
+
+with $0 \leq \rho < 1$ ,we have
+
+$$
+\begin{array} { l } { \displaystyle { S _ { k } = \sum _ { t = 1 } ^ { k } a _ { t } \le \frac { 1 } { 1 - \rho } \sum _ { s = 1 } ^ { k } b _ { s } } } \\ { \displaystyle { D _ { k } = \sum _ { t = 1 } ^ { k } a _ { t } ^ { 2 } \le \frac { 1 } { ( 1 - \rho ) ^ { 2 } } \sum _ { s = 1 } ^ { k } b _ { s } ^ { 2 } } } \end{array}
+$$
+
+# Proof
+
+$$
+\begin{array} { r l } & { \displaystyle { S _ { k } = \sum _ { t = 1 } ^ { k } a _ { t } = \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \rho ^ { t - s } b _ { s } = \sum _ { s = 1 } ^ { k } \sum _ { t = s } ^ { k } \rho ^ { t - s } b _ { s } = \sum _ { s = 1 } ^ { k } \sum _ { t = 0 } ^ { k - s } \rho ^ { t } b _ { s } \leq \frac { 1 } { 1 - \rho } \sum _ { s = 1 } ^ { k } b _ { s } } } \\ & { \displaystyle { D _ { k } = \sum _ { t = 1 } ^ { k } a _ { t } = \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \rho ^ { t - s } b _ { s } \sum _ { r = 1 } ^ { t } \rho ^ { t - r } b _ { r } = \sum _ { s = 1 } ^ { k } \sum _ { t = s } ^ { k } \rho ^ { t - s } b _ { s } = \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \rho ^ { 2 t - s - r } b _ { s } b _ { r } } } \\ & { \displaystyle { \leq \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \sum _ { r = 1 } ^ { k } \rho ^ { 2 t - s - r } \frac { b _ { s } ^ { 2 } + b _ { r } ^ { 2 } } { 2 } = \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \sum _ { r = 1 } ^ { t } \rho ^ { 2 t - s - r } b _ { s } ^ { 2 } } } \\ & { \displaystyle { \leq \frac { 1 } { 1 - \rho } \sum _ { t = 1 } ^ { k } \sum _ { s = 1 } ^ { t } \rho ^ { t - s } b _ { s } ^ { 2 } \leq \frac { 1 } { ( 1 - \rho ) ^ { 2 } } \sum _ { s = 1 } ^ { k } b _ { s } ^ { 2 } } } \end{array}
+$$
+
+Lemma 10 For any $X _ { t } \in \mathbb { R } ^ { d \times n }$ ,we have
+
+$$
+\left\| \sum _ { t = 0 } ^ { k - 1 } { X _ { t } \left( \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - W ^ { k - t - 1 } \right) } \right\| _ { F } ^ { 2 } \leq \left( \sum _ { t = 0 } ^ { k - 1 } \rho ^ { k - t - 1 } \left\| X _ { t } \right\| _ { F } \right) ^ { 2 }
+$$
+
+Proof
+
+$$
+\begin{array} { r l } { \left\| \displaystyle \sum _ { t = 0 } ^ { k - 1 } X _ { t } \left( \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - W ^ { k - t - 1 } \right) \right\| _ { F } ^ { 2 } = \left( \left\| \displaystyle \sum _ { t = 0 } ^ { k - 1 } X _ { t } \left( \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - W ^ { k - t - 1 } \right) \right\| _ { F } \right) ^ { 2 } } & { } \\ { \leq \left( \displaystyle \sum _ { t = 0 } ^ { k - 1 } \left\| X _ { t } \left( \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - W ^ { k - t - 1 } \right) \right\| _ { F } \right) ^ { 2 } } & { } \\ { \leq \left( \displaystyle \sum _ { t = 0 } ^ { k - 1 } \| X _ { t } \| _ { F } \left\| \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - W ^ { k - t - 1 } \right\| \right) ^ { 2 } } & { } \\ { \leq \left( \displaystyle \sum _ { t = 0 } ^ { k - 1 } \rho ^ { k - t - 1 } \| X _ { t } \| _ { F } \right) ^ { 2 } } & { } \end{array}
+$$
+
+That completes the proof.
+
+# G•MONIQUA ON $D ^ { 2 }$ (PROOF TO THEOREM 3)
+
+G.1ALGORITHM
+
+# Algorithm 2 Moniqua with Variance Reduction on worker $i$
+
+Input: initial point $x _ { 0 , i } = x _ { 0 }$ , step size $\alpha$ ,the discrepency bound $\theta$ , communication matrix $\overline { W }$ , number of iterations $K$ ,neighbor list of worker $i$ :: ${ \mathcal { N } } _ { i }$ 1:for $k = 0 , 1 , 2 , \cdots , K - 1$ do 2: Randomly sample data $\xi _ { k , i }$ from local memory 3: Compute a local stochastic gradient based on $\xi _ { k , i }$ and current weight $x _ { k , i } \colon \widetilde { g } _ { k , i }$ 4: if $k = 0$ then 5: Update local weight: $x _ { k + \frac { 1 } { 2 } , i } \gets x _ { k , i } - \alpha \widetilde { g } _ { k , i }$ 6: else 7: Update local weight: $x _ { k + \frac { 1 } { 2 } , i } \gets 2 x _ { k , i } - x _ { k - 1 , i } - \alpha \widetilde { g } _ { k , i } + \alpha \widetilde { g } _ { k - 1 , i }$ 89 Compute modulo-ed model: $\begin{array} { r } { q _ { k , i } \gets \theta \cdot \mathcal { Q } _ { \delta } \left( \frac { x _ { k + \frac { 1 } { 2 } , i } } { \theta } \bmod 1 \right) } \end{array}$ (element-wise divisio and mod)
+10: Average with neighboring workers: $\begin{array} { r } { x _ { k + 1 , i } \gets x _ { k + \frac { 1 } { 2 } , i } + \sum _ { j \in \mathcal { N } _ { i } } ( q _ { k , j } - q _ { k , i } ) W _ { j i } } \end{array}$
+Outpud $\begin{array} { r } { \overline { { X } } _ { K } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } x _ { K , i } } \end{array}$
+
+# G.2AsSUMPTIONS
+
+$D ^ { 2 }$ makes the following assumptions (1-4),and we add the additional assumption (5):
+
+1. Lipschitzian Gradient: All the function $f _ { i }$ have L-Lipschitzian gradients.
+
+2. Communication Matrix: Communication matrix $W$ is a symmetric doubly stochastic matrix. Let the eigenvalues of $W \in \mathbb { R } ^ { n \times n }$ be $\lambda _ { 1 } \geq \cdots \geq \lambda _ { n }$ . We assume $\lambda _ { 2 } < \mathbf { \bar { 1 } } , \lambda _ { n } > - \frac { 1 } { 3 }$
+
+# 3.Bounded Variance:
+
+$$
+\mathbb { E } _ { \xi _ { i } \sim \mathcal { D } _ { i } } \left\| \nabla \widetilde { f } _ { i } ( x _ { i } ; \xi _ { i } ) - \nabla f _ { i } ( x ) \right\| ^ { 2 } \le \sigma ^ { 2 } , \forall i
+$$
+
+where $\nabla \widetilde { f } _ { i } ( \boldsymbol { x } ; \boldsymbol { \xi } _ { i } )$ denotes gradient sample on worker $i$ computed via data sample $\xi _ { i }$ :
+
+4. Initialization: All the models are initialized by the same parameters: $x _ { 0 , i } = x _ { 0 } , \forall i$ and with out the loss of generality $x _ { 0 } = 0$
+
+5. Gradient magnitude: The norm of a sampled gradient is bounded by $\| \widetilde { g } _ { k , i } \| _ { \infty } \le G _ { \infty }$ for some constant $G _ { \infty }$ :
+
+# G.3PROOF TO THEOREM 3
+
+Proof From a local view, define $x _ { - 1 } = \widetilde { g } _ { - 1 } = 0$ , the update rule of Moniqua on $D ^ { 2 }$ on worker i in iteration $k$ can be writen as
+
+$$
+\begin{array} { l } { { \displaystyle x _ { k + \frac { 1 } { 2 } , i } = 2 x _ { k , i } - x _ { k - 1 , i } - \alpha \widetilde { g } _ { k , i } + \alpha \widetilde { g } _ { k - 1 , i } } } \\ { { \displaystyle x _ { k + 1 , i } = \sum _ { j = 1 } ^ { n } x _ { k + \frac { 1 } { 2 } , j } W _ { j i } + \sum _ { j = 1 } ^ { n } \left( ( q _ { k , j } - x _ { k + \frac { 1 } { 2 } , j } ) - ( q _ { k , i } - x _ { k + \frac { 1 } { 2 } , i } ) \right) W _ { j i } } } \end{array}
+$$
+
+From a global view, the update rule can be writen as
+
+$$
+\begin{array} { r l } & { X _ { k + \frac { 1 } { 2 } } = 2 X _ { k } - X _ { k - 1 } - \alpha \widetilde { G } _ { k } + \alpha \widetilde { G } _ { k - 1 } } \\ & { X _ { k + 1 } = X _ { k + \frac { 1 } { 2 } } W + ( Q _ { k } - X _ { k + \frac { 1 } { 2 } } ) ( W - I ) } \end{array}
+$$
+
+Define
+
+$$
+\Omega _ { k } = ( Q _ { k } - X _ { k + \frac { 1 } { 2 } } ) ( W - I )
+$$
+
+Since $W$ is symmetric, it can be diagonalized as $W = P \Lambda P ^ { \top }$ ,where the i-th column of $P$ and $\Lambda$ are $W$ 's i-th eigenvector and eigenvalue, respectively. And we obtain
+
+$$
+X _ { k + 1 } = 2 X _ { k } P \Lambda P ^ { \top } - X _ { k - 1 } P \Lambda P ^ { \top } - \alpha \widetilde { G } _ { k } P \Lambda P ^ { \top } + \alpha \widetilde { G } _ { k - 1 } P \Lambda P ^ { \top } + \Omega _ { k }
+$$
+
+and
+
+$$
+X _ { k + 1 } P = 2 X _ { k } P \Lambda - X _ { k - 1 } P \Lambda - \alpha \widetilde { G } _ { k } P \Lambda + \alpha \widetilde { G } _ { k - 1 } P \Lambda + \Omega _ { k } P
+$$
+
+Denote $Y _ { k } = X _ { k } P$ , $H ( X _ { k } ; \xi _ { k } ) = \widetilde { G } _ { k } P$ , and denote $y _ { k , i } , h _ { k , i }$ and $r _ { k , i }$ as the $i$ -th column of $Y _ { k }$ , $H _ { k }$ and $\Omega _ { k } P$ ,respectively. Then we have
+
+$$
+y _ { k + 1 , i } = \lambda _ { i } ( 2 y _ { k , i } - y _ { k - 1 , i } - \alpha h _ { k , i } + \alpha h _ { k - 1 , i } ) + r _ { k , i }
+$$
+
+From Lemma $^ { 1 5 }$ (Constants $C _ { 1 }$ $C _ { 2 }$ , $C _ { 3 }$ andn $C _ { 4 }$ are defined in the Lemma $_ { I I }$ Constants $D _ { 1 }$ and $D _ { 2 }$ are defined in Lemma $^ { 1 5 }$ )we get
+
+$$
+\begin{array} { l } { \displaystyle \left( 1 - \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } } { C _ { 4 } } \right) \mathbb { E } \| \nabla f ( 0 ) \| + \left( 1 - \alpha L - 3 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 4 } L ^ { 4 } \right) \frac { 1 } { K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 \left( f ( 0 ) - f ^ { * } \right) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + \varsigma _ { 0 } ^ { 2 } \right) } { C _ { 4 } K } + 6 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } \sigma ^ { 2 } L ^ { 2 } + 3 \frac { C _ { 2 } } { n C _ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 4 } } \end{array}
+$$
+
+$$
++ \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } } \left( \frac { 3 D _ { 1 } n + 4 } { 3 D _ { 2 } n } \right) ^ { 2 } \alpha ^ { 2 } G _ { \infty } ^ { 2 } d
+$$
+
+$\begin{array} { r } { \alpha = \frac { 1 } { \sigma \sqrt { K / n } + 2 L } } \end{array}$ we have
+
+$$
+\begin{array} { r l } & { \frac { 1 } { K } \frac { K - 1 } { K } \nabla f ( \overline { { \boldsymbol { X } } } _ { \perp } ) ^ { 2 } } \\ & { \le \frac { 2 f ( \boldsymbol { Q } ) - f ^ { * } } { K } + \frac { \alpha } { n } o ^ { 2 } + \frac { 3 C _ { 1 } \omega ^ { 2 } L ^ { 2 } ( \sigma ^ { 2 } ( \cdot \frac { \sigma ^ { 2 } } { c _ { 1 } } ) \cdot \frac { \sigma ^ { 2 } } { c _ { 1 } } ) } { C _ { 4 } K } + 6 \frac { C _ { 2 } ^ { 2 } \alpha ^ { 2 } c ^ { 2 } L ^ { 2 } } { C _ { 4 } ^ { 2 } } + 3 \frac { C _ { 2 } ^ { 2 } } { n C _ { 4 } ^ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 4 } } \\ & { \quad + ( \frac { 3 D _ { 1 } \alpha + 4 } { 3 2 D _ { 4 } \alpha } ) ^ { 2 } \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } K } \sigma _ { \alpha } ^ { 2 } } \\ & { \le \frac { 4 f ( \boldsymbol { Q } ) - f ^ { * } L } { 3 2 D _ { 4 } \alpha } + \frac { 2 \sigma L ( \theta ) } { \sqrt { n K } } - \frac { 3 C _ { 1 } L ^ { 2 } ( \sigma ^ { 2 } + \frac { \sigma ^ { 2 } } { c _ { 1 } } ) ^ { 1 0 } } { C _ { 4 } ( \sigma ^ { 2 } K ^ { 2 } + 4 n L ^ { 2 } + \sigma ^ { 2 } K ) } + \frac { 6 C L _ { 2 } L ^ { 2 } \sigma ^ { 2 } n } { C _ { 4 } ( \sigma ^ { 2 } K + 4 n L ^ { 2 } + \sigma ^ { 2 } ) } } \\ & \quad + \frac { 3 C _ { 2 } \alpha \sigma L ^ { 2 } L ^ { 2 } } { C _ { 4 } ( \sigma ^ { 2 } K ^ { 2 } + 1 6 n ^ { 2 } L ^ { 2 } ) } + ( \frac { 3 D _ { 1 } \alpha + 4 } { 3 2 D _ { 3 } n } ) ^ { 2 } \frac { C _ { 3 } \sigma _ { \alpha } ^ { 2 } L ^ { 2 } n } { C _ { 3 } ( \sigma ^ { 2 } K - 4 n L ^ { 2 } ) ^ { 2 } } \\ & \le \frac { 1 } { K } + \frac { \sigma } { \sqrt { K } } ( \end{array}
+$$
+
+That completes the proof.
+
+# G.4 LEMMA FOR $D ^ { 2 }$
+
+Lemma 11 Define
+
+$$
+\begin{array} { l } { \displaystyle { D _ { 1 } = \operatorname* { m a x } \left\{ | v _ { n } | + \frac { 2 | \lambda _ { n } | } { 1 - | v _ { n } | } , \sqrt { \frac { \lambda _ { 2 } } { 1 - \lambda _ { 2 } } } + \frac { 2 \lambda _ { 2 } } { 1 - \lambda _ { 2 } } \right\} } } \\ { \displaystyle { D _ { 2 } = \operatorname* { m a x } \left\{ \frac { 2 } { 1 - | v _ { n } | } , \frac { 2 } { \sqrt { 1 - \lambda _ { 2 } } } \right\} } } \\ { \displaystyle v _ { n } = \lambda _ { n } - \sqrt { \lambda _ { n } ^ { 2 } - \lambda _ { n } } } \end{array}
+$$
+
+Let $\begin{array} { r } { \delta = \frac { 1 } { 6 n D _ { 2 } } } \end{array}$ , and we have for $\forall i , j$
+
+$$
+\left\| x _ { k + \frac { 1 } { 2 } } ( e _ { i } - e _ { j } ) \right\| _ { \infty } \le \theta = ( 6 D _ { 1 } n + 8 ) \alpha G _ { \infty }
+$$
+
+Proof We use mathematical induction to prove this:
+
+I. When $k = 0$
+
+$$
+\begin{array} { r } { | X _ { 0 + \frac { 1 } { 2 } } ( e _ { i } - e _ { j } ) | | _ { \infty } = \| - \alpha \widetilde { G } _ { 0 } ( e _ { i } - e _ { j } ) \| _ { \infty } \le \alpha \| \widetilde { G } _ { 0 } \| _ { 1 , \infty } \| e _ { i } - e _ { j } \| _ { 1 } \le 2 \alpha G _ { \infty } \le ( 6 D _ { 1 } n + 8 ) \alpha G _ { \infty } } \end{array}
+$$
+
+I1. supose for $k \geq 0 , \forall t \leq k$ we have $\left\| X _ { t + \frac { 1 } { 2 } } ( e _ { i } - e _ { j } ) \right\| \leq ( 6 D _ { 1 } n + 8 ) \alpha G _ { \infty }$ , then for i,j
+
+$$
+\begin{array} { r l } & { \qquad \left\| X _ { k + 1 } ( e _ { i } - e _ { j } ) \right\| _ { \infty } } \\ & { \leq \left\| X _ { k + 1 } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| _ { \infty } + \left\| X _ { k + 1 } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { j } \right) \right\| _ { \infty } } \\ & { = \left\| X _ { k + 1 } P P ^ { \top } e _ { i } - X _ { k + 1 } P \left[ \begin{array} { l l l l l } { 1 } & { 0 } & { 0 } & { \ldots } & { 0 } \\ { 0 } & { 0 } & { 0 } & { \ldots } & { 0 } \\ { 0 } & { 0 } & { 0 } & { \ldots } & { 0 } \\ { \vdots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { 0 } & { \ldots } & { 0 } \end{array} \right] P ^ { \top } e _ { i } \right\| _ { \infty } } \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \quad + \left\| X _ { k + 1 } P P ^ { * } \ e _ { j } - X _ { k + 1 } P ^ { 1 0 } \ w \quad 0 \quad \cdots \quad w \right\| _ { \zeta } ^ { P * } \ e _ { j } \Bigg \| _ { L ^ { \infty } } } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
+$$
+
+From the update rule, we have
+
+$y _ { k + 1 , i } = \lambda _ { i } ( 2 y _ { k , i } - y _ { k - 1 , i } - \alpha h _ { k , i } + \alpha h _ { k - 1 , i } ) + r _ { k , i } = \lambda _ { i } ( 2 y _ { k , i } - y _ { k - 1 , i } ) + \lambda _ { i } \beta _ { k , i } + r _ { k , i }$ $w h e r e \beta _ { k , i } = - \alpha h _ { k , i } + \alpha h _ { k - 1 , i } ,$ for all $y _ { i }$ with $\begin{array} { r } { - \frac { 1 } { 3 } < \lambda _ { i } < 0 } \end{array}$ from Lemma $^ { 1 3 }$ we have
+
+$$
+y _ { k + 1 , i } = y _ { 1 , i } \left( \frac { u _ { i } ^ { k + 1 } - v _ { i } ^ { k + 1 } } { u _ { i } - v _ { i } } \right) + \sum _ { s = 1 } ^ { k } ( \lambda _ { i } \beta _ { s , i } + r _ { s , i } ) \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } }
+$$
+
+where $u _ { i } = \lambda _ { i } + \sqrt { \lambda _ { i } ^ { 2 } - \lambda _ { i } }$ and $v _ { i } = \lambda _ { i } - \sqrt { \lambda _ { i } ^ { 2 } - \lambda _ { i } }$ , we obtain
+
+$$
+\begin{array} { l } { \displaystyle \| y _ { k + 1 , i } \| _ { \infty } \leq \| y _ { 1 , i } \| _ { \infty } \left| \frac { u _ { i } ^ { k + 1 } - v _ { i } ^ { k + 1 } } { u _ { i } - v _ { i } } \right| + | \lambda _ { i } | \displaystyle \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| _ { \infty } \left| \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } } \right| } \\ { \displaystyle \quad + \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| _ { \infty } \left| \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } } \right| } \end{array}
+$$
+
+Since
+
+$$
+\left| \frac { u _ { i } ^ { n + 1 } - v _ { i } ^ { n + 1 } } { u _ { i } - v _ { i } } \right| \leq | v _ { i } | ^ { n } \left| \frac { u _ { i } \left( \frac { u _ { i } } { v _ { i } } \right) ^ { n } - v _ { i } } { u _ { i } - v _ { i } } \right| \leq | v _ { i } | ^ { n }
+$$
+
+We obtain
+
+$$
+\left\| y _ { k + 1 , i } \right\| _ { \infty } \leq \left\| y _ { 1 , i } \right\| _ { \infty } | v _ { i } | ^ { k } + | \lambda _ { i } | \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| _ { \infty } | v _ { i } | ^ { k - s } + \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| _ { \infty } | v _ { i } | ^ { k - s }
+$$
+
+For $\beta _ { s , i }$ ,we have
+
+$$
+\begin{array} { r l } & { \| \beta _ { s , i } \| _ { \infty } = \| { - } \alpha h _ { k , i } + \alpha h _ { k - 1 , i } \| _ { \infty } \leq 2 \alpha ( \| h _ { k , i } \| _ { \infty } + \| h _ { k - 1 , i } \| _ { \infty } ) } \\ & { \qquad \leq 2 \alpha ( \| G _ { k } \| _ { 1 , \infty } \| P e _ { i } \| _ { 1 } + \| G _ { k - 1 } \| _ { 1 , \infty } \| P e _ { i } \| _ { 1 } ) } \\ & { \qquad \leq 2 \alpha \sqrt { n } G _ { \infty } } \end{array}
+$$
+
+For $r _ { s , i }$ ,we have
+
+$$
+\left\| r _ { k , i } \right\| _ { \infty } = \left\| \Omega _ { k } P e _ { i } \right\| _ { \infty } \leq \left\| \Omega _ { k } \right\| _ { 1 , \infty } \| P e _ { i } \| _ { 1 } \leq 2 \sqrt { n } \delta \theta
+$$
+
+when $\lambda _ { i } < 0$ ,we have
+
+$$
+\left\| y _ { k + 1 , i } \right\| _ { \infty } \leq \left\| y _ { 1 , i } \right\| _ { \infty } | v _ { i } | ^ { k } + | \lambda _ { i } | \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| _ { \infty } | v _ { i } | ^ { k - s } + \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| _ { \infty } | v _ { i } | ^ { k - s }
+$$
+
+$$
+\begin{array} { l } { \displaystyle \leq \| y _ { 1 , i } \| _ { \infty } | v _ { n } | ^ { k } + | \lambda _ { n } | \displaystyle \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| _ { \infty } | v _ { n } | ^ { k - s } + \displaystyle \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| _ { \infty } | v _ { n } | ^ { k - s } } \\ { \displaystyle \leq \alpha \sqrt { n } G _ { \infty } | v _ { n } | ^ { k } + 2 \alpha \sqrt { n } G _ { \infty } | \lambda _ { n } | \displaystyle \sum _ { s = 1 } ^ { \infty } | v _ { n } | ^ { k - s } + 2 \sqrt { n } \delta \theta \displaystyle \sum _ { s = 1 } ^ { \infty } | v _ { n } | ^ { k - s } } \\ { \displaystyle \leq \alpha \sqrt { n } G _ { \infty } | v _ { n } | + \frac { 2 \alpha \sqrt { n } G _ { \infty } | \lambda _ { n } | } { 1 - | v _ { n } | } + \frac { 2 \sqrt { n } \delta \theta } { 1 - | v _ { n } | } } \end{array}
+$$
+
+where $v _ { n } = \lambda _ { n } - \sqrt { \lambda _ { n } ^ { 2 } - \lambda _ { n } }$
+
+On the other hand,when $0 \leq \lambda _ { i } < 1$ ,from Lemma $^ { 1 3 }$ we have
+
+$$
+\begin{array} { l } { { \displaystyle y _ { k + 1 , i } \sin \theta _ { i } = y _ { 1 , i } \lambda _ { i } ^ { \frac { k } { 2 } } \sin [ ( t + 1 ) \theta _ { i } ] + \lambda _ { i } \sum _ { s = 1 } ^ { k } \beta _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] } } \\ { { \displaystyle \qquad + \sum _ { s = 1 } ^ { k } r _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] } } \end{array}
+$$
+
+By taking norm, we get
+
+$$
+\begin{array} { l } { \displaystyle \left\| y _ { k + 1 , i } \right\| _ { \infty } \left| \sin \theta _ { i } \right| = \left\| y _ { 1 , i } \right\| _ { \infty } \lambda _ { i } ^ { \frac { k } { 2 } } \left| \sin [ ( t + 1 ) \theta _ { i } ] \right| + \lambda _ { i } \displaystyle \sum _ { s = 1 } ^ { k } \left\| \beta _ { s , i } \right\| _ { \infty } \left| \lambda _ { i } ^ { \frac { k - s } { 2 } } \right| \left| \sin [ ( k + 1 - s ) \theta _ { i } ] \right| } \\ { \displaystyle \qquad + \sum _ { s = 1 } ^ { k } \left\| r _ { s , i } \right\| _ { \infty } \left| \lambda _ { i } ^ { \frac { k - s } { 2 } } \right| \left| \sin [ ( k + 1 - s ) \theta _ { i } ] \right| } \\ { \displaystyle \qquad \leq \left\| y _ { 1 , i } \right\| _ { \infty } \lambda _ { 2 } ^ { \frac { k } { 2 } } + 2 \alpha \sqrt { n } G _ { \infty } \lambda _ { 2 } \displaystyle \sum _ { s = 1 } ^ { \infty } \lambda _ { 2 } ^ { \frac { s } { 2 } } + 2 \sqrt { n } \delta \theta \displaystyle \sum _ { s = 1 } ^ { \infty } \lambda _ { 2 } ^ { \frac { s } { 2 } } } \\ { \displaystyle \qquad \leq \alpha \sqrt { n } G _ { \infty } \sqrt { \lambda _ { 2 } } + \frac { 2 \alpha \sqrt { n } G _ { \infty } \lambda _ { 2 } + 2 \sqrt { n } \delta \theta } { \sqrt { 1 - \lambda _ { 2 } } } } \end{array}
+$$
+
+Since $| \sin \theta _ { i } | \geq \sqrt { 1 - \lambda _ { 2 } }$ , putting it back, we get
+
+$$
+\left\| y _ { k + 1 , i } \right\| \leq \alpha { \sqrt { n } } G _ { \infty } { \sqrt { \frac { \lambda _ { 2 } } { 1 - \lambda _ { 2 } } } } + { \frac { 2 \alpha { \sqrt { n } } G _ { \infty } \lambda _ { 2 } + 2 { \sqrt { n } } \delta \theta } { 1 - \lambda _ { 2 } } }
+$$
+
+So there exists $D _ { 1 } , D _ { 2 }$
+
+$$
+\begin{array} { l } { \displaystyle { D _ { 1 } = \operatorname* { m a x } \left\{ | v _ { n } | + \frac { 2 | \lambda _ { n } | } { 1 - | v _ { n } | } , \sqrt { \frac { \lambda _ { 2 } } { 1 - \lambda _ { 2 } } } + \frac { 2 \lambda _ { 2 } } { 1 - \lambda _ { 2 } } \right\} } } \\ { \displaystyle { D _ { 2 } = \operatorname* { m a x } \left\{ \frac { 2 } { 1 - | v _ { n } | } , \frac { 2 } { \sqrt { 1 - \lambda _ { 2 } } } \right\} } } \end{array}
+$$
+
+such that
+
+$$
+\left\| y _ { k + 1 , i } \right\| _ { \infty } \leq D _ { 1 } \alpha \sqrt { n } G _ { \infty } + D _ { 2 } \sqrt { n } \delta \theta
+$$
+
+Putting it back we have $\forall i , j$
+
+$$
+\| X _ { k + 1 } ( e _ { i } - e _ { j } ) \| _ { \infty } \leq D _ { 1 } \alpha n G _ { \infty } + D _ { 2 } n \delta \theta
+$$
+
+As a result
+
+$$
+\begin{array} { r l } & { \quad \left\| X _ { k + \frac { 1 } { 2 } } ( e _ { i } - e _ { j } ) \right\| _ { \infty } } \\ & { = \left\| ( 2 X _ { k } - X _ { k - 1 } - \alpha \widetilde G _ { k } + \alpha \widetilde G _ { k - 1 } ) ( e _ { i } - e _ { j } ) \right\| _ { \infty } } \\ & { \leq 2 \left\| X _ { k } ( e _ { i } - e _ { j } ) \right\| _ { \infty } + \left\| X _ { k - 1 } ( e _ { i } - e _ { j } ) \right\| _ { \infty } + \alpha \left\| \widetilde G _ { k } \right\| _ { 1 , \infty } \left\| e _ { i } - e _ { j } \right\| _ { 1 } + \alpha \left\| \widetilde G _ { k - 1 } \right\| _ { 1 , \infty } \left\| e _ { i } - e _ { j } \right\| _ { 1 } } \end{array}
+$$
+
+$$
+\begin{array} { l } { \leq 3 ( D _ { 1 } \alpha n G _ { \infty } + D _ { 2 } n \delta \theta ) + 4 \alpha G _ { \infty } } \\ { \leq ( 6 D _ { 1 } n + 8 ) \alpha G _ { \infty } } \end{array}
+$$
+
+The last stepis because δ= 6nD2
+
+Combining I and $\boldsymbol { { I I } }$ we complete the proof.
+
+# Lemma 12
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \left( 1 - 1 2 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } \right) \sum _ { i = 1 } ^ { n } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \\ & { \leq 3 C _ { 1 } \alpha ^ { 2 } n \sigma ^ { 2 } + 3 C _ { 1 } \alpha ^ { 2 } n \varsigma _ { 0 } ^ { 2 } + 3 C _ { 1 } \alpha ^ { 2 } n \mathbb { E } \left\| \nabla f ( 0 ) \right\| + 6 C _ { 2 } \alpha ^ { 2 } n \sigma ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 2 } K } \\ & { + 3 C _ { 2 } \alpha ^ { 4 } n L ^ { 2 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + C _ { 3 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Proof
+
+$$
+\begin{array} { c } { \displaystyle \sum _ { i = 1 } ^ { n } \left\| \overline { { \boldsymbol X } } _ { k } - \boldsymbol x _ { k , i } \right\| ^ { 2 } = \displaystyle \sum _ { i = 1 } ^ { n } \left\| \boldsymbol X _ { k } \left( e _ { i } - \frac { \mathbb { 1 } _ { n } } { n } \right) \right\| ^ { 2 } } \\ { \displaystyle = \left\| \boldsymbol X _ { k } \left( \boldsymbol I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { F } ^ { 2 } } \\ { \displaystyle = \left\| \boldsymbol X _ { k } \boldsymbol P \boldsymbol P ^ { \top } - \boldsymbol X _ { k } \boldsymbol v _ { 1 } \boldsymbol v _ { 1 } ^ { \top } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+$$
+{ \begin{array} { l } { { \boldsymbol { L e m m a I 4 } } } \\ { = } \\ { \qquad \left\| { \boldsymbol { X } } _ { k } P \left[ { \begin{array} { l l l l l } { 0 } & { 0 } & { 0 } & { \dots } & { 0 } \\ { 0 } & { 1 } & { 0 } & { \dots } & { 0 } \\ { 0 } & { 0 } & { 1 } & { \dots } & { 0 } \\ { \vdots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { 0 } & { \dots } & { 1 } \end{array} } \right] \right\| _ { F } ^ { 2 } } \\ { = \sum _ { i = 2 } ^ { n } \left\| { \boldsymbol { y } } _ { k , i } \right\| ^ { 2 } } \end{array} }
+$$
+
+From the update rule, we obtain,
+
+$y _ { k + 1 , i } = \lambda _ { i } ( 2 y _ { k , i } - y _ { k - 1 , i } - \alpha h _ { k , i } + \alpha h _ { k - 1 , i } ) + r _ { k , i } = \lambda _ { i } ( 2 y _ { k , i } - y _ { k - 1 , i } ) + \lambda _ { i } \beta _ { k , i } + r _ { k , i }$ $w h e r e \beta _ { k , i } = - \alpha h _ { k , i } + \alpha h _ { k - 1 , i } ,$ for all $y _ { i }$ with $\begin{array} { r } { - \frac { 1 } { 3 } < \lambda _ { i } < 0 } \end{array}$ from Lemma $^ { 1 3 }$ we have
+
+$$
+y _ { k + 1 , i } = y _ { 1 , i } \left( \frac { u _ { i } ^ { k + 1 } - v _ { i } ^ { k + 1 } } { u _ { i } - v _ { i } } \right) + \sum _ { s = 1 } ^ { k } ( \lambda _ { i } \beta _ { s , i } + r _ { k , i } ) \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } }
+$$
+
+where $u _ { i } = \lambda _ { i } + \sqrt { \lambda _ { i } ^ { 2 } - \lambda _ { i } }$ and $v _ { i } = \lambda _ { i } - \sqrt { \lambda _ { i } ^ { 2 } - \lambda _ { i } } ,$ we obtain
+
+$$
+\begin{array} { l } { \displaystyle \| y _ { k + 1 , i } \| ^ { 2 } \leq 3 \| y _ { 1 , i } \| ^ { 2 } \left( \frac { u _ { i } ^ { k + 1 } - v _ { i } ^ { k + 1 } } { u _ { i } - v _ { i } } \right) ^ { 2 } + 3 \lambda _ { i } ^ { 2 } \left( \displaystyle \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| \left| \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } } \right| \right) ^ { 2 } } \\ { \displaystyle \qquad + 3 \left( \displaystyle \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| \left| \frac { u _ { i } ^ { k - s + 1 } - v _ { i } ^ { k - s + 1 } } { u _ { i } - v _ { i } } \right| \right) ^ { 2 } } \end{array}
+$$
+
+Since
+
+$$
+\left| \frac { u _ { i } ^ { n + 1 } - v _ { i } ^ { n + 1 } } { u _ { i } - v _ { i } } \right| \leq | v _ { i } | ^ { n } \left| \frac { u _ { i } \left( \frac { u _ { i } } { v _ { i } } \right) ^ { n } - v _ { i } } { u _ { i } - v _ { i } } \right| \leq | v _ { i } | ^ { n }
+$$
+
+We obtain
+
+$$
+\left\| y _ { k + 1 , i } \right\| ^ { 2 } \leq 3 \left\| y _ { 1 , i } \right\| ^ { 2 } | v _ { i } | ^ { 2 t } + 3 \lambda _ { i } ^ { 2 } \left( \sum _ { s = 1 } ^ { k } \left\| \beta _ { s , i } \right\| | v _ { i } | ^ { k - s } \right) ^ { 2 } + 3 \left( \sum _ { s = 1 } ^ { k } \| r _ { s , i } \| | v _ { i } | ^ { k - s } \right) ^ { 2 }
+$$
+
+Summing over from $k = 0$ to $t = K - 1$ ,we obtain
+
+$$
+\begin{array} { l } { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \| y _ { k + 1 , s } \| ^ { 2 } = \displaystyle \sum _ { k = 1 } ^ { K } \| y _ { k , i } \| ^ { 2 } } \\ { \le 3 \| y _ { 1 , i } \| ^ { 2 } \displaystyle \sum _ { k = 0 } ^ { K - 1 } | v _ { \mathrm { t } } | ^ { 2 k } + 3 \lambda _ { i } ^ { 2 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \left( \displaystyle \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| | v _ { \mathrm { i } } | ^ { k - s } \right) ^ { 2 } + 3 \displaystyle \sum _ { k = 1 } ^ { K - 1 } \left( \displaystyle \sum _ { s = 1 } ^ { k } \| | r _ { s , i } \| | | v _ { \mathrm { i } } | ^ { k - s } \right) ^ { 2 } } \\ { \le \frac { 3 } { 1 - | v _ { \mathrm { i } } | ^ { 2 } } + \displaystyle \frac { 3 \lambda _ { i } ^ { 2 } } { ( 1 - | v _ { \mathrm { i } } | ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| \beta _ { k , i } \| ^ { 2 } + \displaystyle \frac { 3 } { ( 1 - | v _ { \mathrm { i } } | ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| r _ { k , i } \| ^ { 2 } } \\ { \le \frac { 3 } { 1 - | v _ { \mathrm { i } } | ^ { 2 } } + \displaystyle \frac { 3 \lambda _ { n } ^ { 2 } } { ( 1 - | v _ { \mathrm { i } } | ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| \beta _ { k , i } \| ^ { 2 } + \displaystyle \frac { 3 } { ( 1 - | v _ { \mathrm { i } } | ) ^ { 2 } } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| r _ { k , i } \| ^ { 2 } } \end{array}
+$$
+
+where $v _ { n } = \lambda _ { n } - \sqrt { \lambda _ { n } ^ { 2 } - \lambda _ { n } }$
+
+On the other hand,when $0 \leq \lambda _ { i } < 1$ ,from Lemma $^ { 1 3 }$ we have
+
+$$
+\begin{array} { l } { { \displaystyle y _ { k + 1 , i } \sin \theta _ { i } = y _ { 1 , i } \lambda _ { i } ^ { \frac { k } { 2 } } \sin [ ( t + 1 ) \theta _ { i } ] + \lambda _ { i } \sum _ { s = 1 } ^ { k } \beta _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] } } \\ { { \displaystyle \qquad + \sum _ { s = 1 } ^ { k } r _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] } } \end{array}
+$$
+
+And we have
+
+$$
+\begin{array} { r l r } { { \| y _ { k + 1 , i } \| ^ { 2 } \sin ^ { 2 } \theta _ { i } \leq 3 \| y _ { 1 , i } \| ^ { 2 } \lambda _ { i } ^ { k } \sin ^ { 2 } [ ( t + 1 ) \theta _ { i } ] + 3 \lambda _ { i } ^ { 2 } ( \displaystyle \sum _ { s = 1 } ^ { k } \beta _ { s , i } { \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] } ) ^ { 2 } } } \\ & { } & { + 3 ( \displaystyle \sum _ { s = 1 } ^ { k } r _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \sin [ ( k + 1 - s ) \theta _ { i } ] ) ^ { 2 } } \\ & { } & { \leq 3 \| y _ { 1 , i } \| ^ { 2 } \lambda _ { i } ^ { k } + 3 \lambda _ { i } ^ { 2 } ( \displaystyle \sum _ { s = 1 } ^ { k } \beta _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } ) ^ { 2 } + 3 ( \displaystyle \sum _ { s = 1 } ^ { k } r _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } ) ^ { 2 } } \end{array}
+$$
+
+Summing from $k = 0$ to $K - 1$ ,we have
+
+$$
+\begin{array} { l } { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \| y _ { k + 1 , i } \| ^ { 2 } \sin ^ { 2 } \theta _ { i } = \displaystyle \sum _ { k = 1 } ^ { K } \| y _ { k , i } \| ^ { 2 } \sin ^ { 2 } \theta _ { i } } \\ { \displaystyle \leq 3 \| y _ { 1 , i } \| ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \lambda _ { i } ^ { t } + 3 \lambda _ { i } ^ { 2 } \sum _ { k = 1 } ^ { K - 1 } \left( \sum _ { s = 1 } ^ { k } \| \beta _ { s , i } \| \lambda _ { i } ^ { \frac { t - s } { 2 } } \right) ^ { 2 } + 3 \sum _ { k = 1 } ^ { K - 1 } \left( \sum _ { s = 1 } ^ { k } r _ { s , i } \lambda _ { i } ^ { \frac { k - s } { 2 } } \right) ^ { 2 } } \\ { \displaystyle \leq \frac { 3 \| y _ { 1 , i } \| ^ { 2 } } { 1 - \lambda _ { i } } + \frac { 3 \lambda _ { i } ^ { 2 } } { ( 1 - \sqrt { \lambda _ { i } } ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \| \beta _ { k , i } \| ^ { 2 } + \frac { 3 } { ( 1 - \sqrt { \lambda _ { i } } ) ^ { 2 } } \sum _ { k = 1 } ^ { K - 1 } \| r _ { k , i } \| ^ { 2 } } \end{array}
+$$
+
+Since $\sin ^ { 2 } \theta _ { i } = 1 - \lambda _ { i } ,$ we have
+
+$$
+\begin{array} { r } { \displaystyle \sum _ { = 1 } ^ { K } \| y _ { k , i } \| ^ { 2 } \leq \frac { 3 } { ( 1 - \lambda _ { i } ) ^ { 2 } } \| y _ { 1 , i } \| ^ { 2 } + \frac { 3 \lambda _ { i } ^ { 2 } } { ( 1 - \sqrt { \lambda _ { i } } ) ^ { 2 } ( 1 - \lambda _ { i } ) } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| \beta _ { k , i } \| ^ { 2 } + \frac { 3 } { ( 1 - \sqrt { \lambda _ { i } } ) ^ { 2 } ( 1 - \lambda _ { i } ) } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| r _ { k , i } \| ^ { 2 } } \\ { \leq \frac { 3 } { ( 1 - \lambda _ { 2 } ) ^ { 2 } } + \frac { 3 \lambda _ { 2 } ^ { 2 } } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| \beta _ { k , i } \| ^ { 2 } + \frac { 3 } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \| r _ { k , i } \| ^ { 2 } } \end{array}
+$$
+
+So there exists $C _ { 1 } , C _ { 2 } , C _ { 3 }$
+
+$$
+\begin{array} { l } { { C _ { 1 } = \operatorname* { m a x } \left\{ \displaystyle \frac { 3 } { 1 - | v _ { n } | ^ { 2 } } , \displaystyle \frac { 3 } { ( 1 - \lambda _ { 2 } ) ^ { 2 } } \right\} } } \\ { { C _ { 2 } = \operatorname* { m a x } \left\{ \displaystyle \frac { 3 \lambda _ { n } ^ { 2 } } { ( 1 - | v _ { n } | ) ^ { 2 } } , \displaystyle \frac { 3 \lambda _ { 2 } ^ { 2 } } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \right\} } } \\ { { C _ { 3 } = \operatorname* { m a x } \left\{ \displaystyle \frac { 3 } { ( 1 - | v _ { n } | ) ^ { 2 } } , \displaystyle \frac { 3 } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \right\} } } \end{array}
+$$
+
+$$
+\sum _ { k = 1 } ^ { K } \left\| y _ { k , i } \right\| ^ { 2 } \leq C _ { 1 } \left\| y _ { 1 , i } \right\| ^ { 2 } + C _ { 2 } \sum _ { k = 1 } ^ { K - 1 } \left\| \beta _ { k , i } \right\| ^ { 2 } + C _ { 3 } \sum _ { k = 1 } ^ { K - 1 } \left\| r _ { k , i } \right\| ^ { 2 }
+$$
+
+By taking expectation we have
+
+$$
+\sum _ { k = 1 } ^ { K } \mathbb { E } \left\| y _ { k , i } \right\| ^ { 2 } \leq C _ { 1 } \mathbb { E } \left\| y _ { 1 , i } \right\| ^ { 2 } + C _ { 2 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \beta _ { k , i } \right\| ^ { 2 } + C _ { 3 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| r _ { k , i } \right\| ^ { 2 }
+$$
+
+We next analyze $\beta _ { k , i }$
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { \rho } ^ { \lambda _ { 1 } } ( \mathbf { x } , \rho ) } \\ & { = \kappa _ { 1 } ^ { \lambda _ { 2 } } \frac { \rho \lambda _ { 1 } \lambda _ { 2 } } { \lambda _ { 1 } } } \\ & { \quad - \kappa _ { 2 } ^ { \lambda _ { 3 } } \frac { \rho \lambda _ { 2 } \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Delta \mathbf { t } _ { \rho } - \Delta \mathbf { t } _ { \rho } ^ { \lambda _ { 1 } } , } \\ & { \quad - \kappa _ { 3 } ^ { \lambda _ { 3 } } \frac { \rho \lambda _ { 2 } \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Big [ \Delta \mathbf { t } _ { \rho } \Delta \mathbf { t } _ { \rho } - \Delta \mathbf { t } _ { \rho } \mathbf { x } ^ { \lambda _ { 3 } } \Big ] ^ { \frac { \rho } { \lambda _ { 1 } } } } \\ & { \quad - \kappa _ { 3 } ^ { \lambda _ { 3 } } \frac { \rho \lambda _ { 2 } \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Big [ \Delta \mathbf { t } _ { \rho } \Delta \mathbf { t } _ { \rho } - \Delta \mathbf { t } _ { \rho } \mathbf { t } _ { \rho } ^ { \lambda _ { 1 } } \Big ] ^ { \frac { \rho } { \lambda _ { 2 } } } } \\ & { \quad - \kappa _ { 3 } ^ { \lambda _ { 3 } } \frac { \rho \lambda _ { 3 } \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Delta \mathbf { t } _ { \rho } - \Delta \mathbf { t } _ { \rho } \mathbf { t } _ { \rho } ^ { \lambda _ { 1 } } \Big ] ^ { \frac { \rho } { \lambda _ { 2 } } } } \\ & { = \frac { \kappa _ { 1 } ^ { \lambda _ { 2 } } \rho \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Big [ \Delta \mathbf { t } _ { \rho } \Delta \mathbf { t } _ { \rho } \Big ] ^ { \frac { \rho } { \lambda _ { 3 } } } , } \\ & \quad - \kappa _ { 3 } ^ { \lambda _ { 3 } } \frac { \rho \lambda _ { 2 } \lambda _ { 3 } } { \rho \lambda _ { 1 } } \Delta \mathbf { t } _ { \rho } \Big [ \Delta \mathbf { t } _ { \rho } \Delta \mathbf { t } _ { \rho } \Big ] ^ { \frac { \rho } { \lambda _ { 3 } } } \\ & \quad \times \frac { \rho \lambda _ { 1 } } \lambda \end{array}
+$$
+
+$$
+\leq 6 \alpha ^ { 2 } n \sigma ^ { 2 } + 3 \alpha ^ { 2 } L ^ { 2 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| y _ { k , i } - y _ { k - 1 , i } \right\| ^ { 2 }
+$$
+
+And Putting it back, we have
+
+$$
+\begin{array} { r l } & { \displaystyle \sum _ { i = 2 } ^ { n } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| y _ { k , i } \right\| ^ { 2 } } \\ & { \leq C _ { 1 } \mathbb { E } \left\| Y _ { 1 } \right\| _ { F } ^ { 2 } + C _ { 2 } \displaystyle \sum _ { i = 2 } ^ { n } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \beta _ { k , i } \right\| ^ { 2 } + C _ { 3 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \sum _ { i = 2 } ^ { n } \mathbb { E } \left\| r _ { k , i } \right\| ^ { 2 } } \\ & { \leq C _ { 1 } \mathbb { E } \left\| Y _ { 1 } \right\| _ { F } ^ { 2 } + C _ { 2 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \Bigg ( 6 \alpha ^ { 2 } n \sigma ^ { 2 } + 3 \alpha ^ { 2 } L ^ { 2 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| y _ { k , i } - y _ { k - 1 , i } \right\| ^ { 2 } \Bigg ) + C _ { 3 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \sum _ { i = 2 } ^ { n } \mathbb { E } \left\| r _ { k , i } \right\| ^ { 2 } } \\ & { \overset { e m a l } { \leq } C _ { 1 } \mathbb { E } \left\| Y _ { 1 } \right\| _ { F } ^ { 2 } + 6 C _ { 2 } \alpha ^ { 2 } n \sigma ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| y _ { k , i } - y _ { k - 1 , i } \right\| ^ { 2 } + C _ { 3 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Since
+
+$$
+\begin{array} { r l } & { \mathbb { E } \left\| y _ { k , 1 } - y _ { k - 1 , 1 } \right\| ^ { 2 } = \mathbb { E } \left\| X _ { k } P e _ { 1 } - X _ { k - 1 } P e _ { 1 } \right\| ^ { 2 } = \mathbb { E } \left\| X _ { k } v _ { 1 } - X _ { k - 1 } v _ { 1 } \right\| ^ { 2 } } \\ & { = \mathbb { E } \left\| X _ { k } \frac { 1 } { \sqrt { n } } \mathbb { 1 } _ { n } - X _ { k - 1 } \frac { 1 } { \sqrt { n } } \mathbb { 1 } _ { n } \right\| ^ { 2 } = n \mathbb { E } \left\| \overline { { X } } _ { k } - \overline { { X } } _ { k - 1 } \right\| ^ { 2 } = n \alpha ^ { 2 } \mathbb { E } \left\| \overline { { \widetilde { G } _ { k } } } \right\| ^ { 2 } } \\ & { \leq n \alpha ^ { 2 } \mathbb { E } \left\| \overline { { \widetilde { G } _ { k } } } - \overline { { G } } _ { k } \right\| ^ { 2 } + n \alpha ^ { 2 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } \leq n \alpha ^ { 2 } \frac { \sigma ^ { 2 } } { n } + n \alpha ^ { 2 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } } \\ & { = \alpha ^ { 2 } \sigma ^ { 2 } + n \alpha ^ { 2 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } } \end{array}
+$$
+
+Putting it back,and we obtain
+
+$$
+\begin{array} { r l } & { \displaystyle \frac { \sum _ { k = 1 } ^ { N } \sum _ { i = 1 } ^ { N } 2 \| u _ { k - i } \| ^ { 2 } } { \sum _ { i = 1 } ^ { N } 2 } } \\ & { \displaystyle \leq C _ { 3 } \| \boldsymbol { \Sigma } \| ^ { 2 } - C _ { 6 } \| \alpha _ { 2 } ^ { \prime \prime } w _ { 2 } w _ { 3 } w _ { 4 } w _ { 2 } w _ { 5 } ^ { \prime } E ( k + 3 C _ { 2 } \alpha _ { 3 } ^ { \prime } k w _ { 2 } ^ { \prime } \sum _ { k = 1 } ^ { N - 1 } \| ( E _ { k } ) \| ^ { 2 } } \\ & { \displaystyle - 3 C _ { 2 } \alpha _ { 2 } ^ { \prime } L ^ { 2 } \sum _ { k = 1 } ^ { N } \sum _ { i = 1 } ^ { N } 2 \| u _ { k - i } - u _ { k - i } \| ^ { 2 } - C _ { 3 } \sum _ { k = 1 } ^ { N } 1 \| u _ { k } \| ^ { 2 } } \\ & { \displaystyle \leq C _ { 3 } \| \boldsymbol { \Sigma } \| ^ { 2 } \sum _ { i = 1 } ^ { N } \frac { \sum _ { i = 1 } ^ { N } 2 } { \sum _ { i = 1 } ^ { N } 2 } y _ { i k } ^ { \prime } \alpha _ { 3 } - y _ { 3 } w _ { 4 } w _ { 5 } ^ { \prime } E ( k + 3 C _ { 2 } \alpha _ { 3 } ^ { \prime } L ^ { 2 } \mathbb { S } + 3 C _ { 2 } \alpha _ { 3 } ^ { \prime } L ^ { 2 } \mathbb { S } + 1 6 L _ { 2 } \alpha _ { 3 } ^ { \prime } L ^ { 2 } } \\ & { \displaystyle - 6 C _ { 3 } ( 2 \alpha _ { 2 } ^ { \prime } L ^ { 2 } \mathbb { S } + 3 C _ { 3 } ^ { \prime } L ^ { 2 } ( | u _ { k - i } | ^ { 2 } + | u _ { k - i } | ^ { 2 } ) ) + C _ { 3 } \sum _ { i = 1 } ^ { N } | \mathbb { A } _ { i } | ^ { 2 } } \\ & { \displaystyle \leq C _ { 3 } \| \boldsymbol { \Sigma } \| ^ { 2 } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \Big ( \| u _ { k - i } \| ^ { 2 } + \| u _ { k - i } \| ^ { 2 } \Big ) + C _ { 3 } \sum _ { i = 1 } ^ { N } \| u _ { j } \| _ { L ^ { 2 } } ^ { 2 } } \\ & \displaystyle \leq C _ \end{array}
+$$
+
+Rearrange the terms, we get
+
+$$
+( 1 - 1 2 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } ) \sum _ { i = 2 } ^ { n } \sum _ { k = 1 } ^ { K } \mathbb { E } \left. y _ { k , i } \right. ^ { 2 }
+$$
+
+$$
+\begin{array} { l } { \displaystyle \leq C _ { 1 } \mathbb { E } \left\| Y _ { 1 } \right\| _ { F } ^ { 2 } + 6 C _ { 2 } \alpha ^ { 2 } n \sigma ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } n L ^ { 2 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + C _ { 3 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \\ { \displaystyle \leq C _ { 1 } \mathbb { E } \left\| X _ { 1 } \right\| _ { F } ^ { 2 } + 6 C _ { 2 } \alpha ^ { 2 } n \sigma ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } n L ^ { 2 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + C _ { 3 } \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+# Considering
+
+$$
+\begin{array} { l } { \displaystyle \mathbb { E } \left\| X _ { 1 } \right\| _ { F } ^ { 2 } = \alpha ^ { 2 } \mathbb { E } \left\| \widetilde { G } _ { 0 } \right\| _ { F } ^ { 2 } } \\ { \displaystyle \quad = \alpha ^ { 2 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \widetilde { G } _ { 0 , i } - G _ { 0 , i } + G _ { 0 , i } - \nabla f ( 0 ) + \nabla f ( 0 ) \right\| ^ { 2 } } \\ { \displaystyle \quad \leq 3 \alpha ^ { 2 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \widetilde { G } _ { 0 , i } - G _ { 0 , i } \right\| ^ { 2 } + 3 \alpha ^ { 2 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| G _ { 0 , i } - \nabla f ( 0 ) \right\| ^ { 2 } + 3 \alpha ^ { 2 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \nabla f ( 0 ) \right\| ^ { 2 } } \\ { \displaystyle \quad \leq 3 \alpha ^ { 2 } n \sigma ^ { 2 } + 3 \alpha ^ { 2 } n \varsigma _ { 0 } ^ { 2 } + 3 \alpha ^ { 2 } n \mathbb { E } \left\| \nabla f ( 0 ) \right\| } \end{array}
+$$
+
+We finally get
+
+$$
+\begin{array} { l } { \displaystyle \left( 1 - 1 2 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } \right) \sum _ { i = 2 } ^ { n } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| y _ { k , i } \right\| ^ { 2 } } \\ { \displaystyle = \left( 1 - 1 2 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } \right) \sum _ { i = 1 } ^ { n } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \\ { \displaystyle \leq 3 C _ { 1 } \alpha ^ { 2 } n \sigma ^ { 2 } + 3 C _ { 1 } \alpha ^ { 2 } n \varsigma _ { 0 } ^ { 2 } + 3 C _ { 1 } \alpha ^ { 2 } n \mathbb { E } \left\| \nabla f ( 0 ) \right\| + 6 C _ { 2 } \alpha ^ { 2 } n \sigma ^ { 2 } K + 3 C _ { 2 } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 2 } K } \\ { \displaystyle K - 1 } \\ { \displaystyle + 3 C _ { 2 } \alpha ^ { 4 } n L ^ { 2 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + C _ { 3 } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+That completes the proof.
+
+Lemma 13 Given $\rho \in \left( - \frac { 1 } { 3 } , 0 \right) \cup \left( 0 , 1 \right)$ , for any two sequence $\{ a _ { t } \} _ { t = 1 } ^ { \infty } , \{ b _ { t } \} _ { t = 1 } ^ { \infty }$ and $\{ c _ { t } \} _ { t = 1 } ^ { \infty }$ that satisfying
+
+$$
+\begin{array} { r } { a _ { 0 } = b _ { 0 } = 0 , \qquad } \\ { a _ { t + 1 } = \rho \left( 2 a _ { t } - a _ { t - 1 } \right) + b _ { t } - b _ { t - 1 } + c _ { t } , \forall t \geq 1 } \end{array}
+$$
+
+we have
+
+$$
+a _ { t + 1 } = a _ { 1 } \left( \frac { u ^ { t + 1 } - v ^ { t + 1 } } { u - v } \right) + \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) \left( \frac { u ^ { t - s + 1 } - v ^ { t - s + 1 } } { u - v } \right) , \forall t \geq 0
+$$
+
+where
+
+$$
+u = \rho + \sqrt { \rho ^ { 2 } - \rho } , v = \rho - \sqrt { \rho ^ { 2 } - \rho }
+$$
+
+Moreover, if $\because 0 < \rho < 1$ , we have
+
+$$
+a _ { t + 1 } = a _ { 1 } \rho ^ { \frac { t } { 2 } } \frac { \sin [ ( t + 1 ) \theta ] } { \sin \theta } + \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) \rho ^ { \frac { t - s } { 2 } } \frac { \sin [ ( t - s + 1 ) \theta ] } { \sin \theta }
+$$
+
+where
+
+$$
+\theta = \operatorname { a r c c o s } \left( \sqrt { \rho } \right)
+$$
+
+Proof when $t \geq 1$ ,we have
+
+$$
+a _ { t + 1 } = 2 \rho a _ { t } - \rho a _ { t - 1 } + b _ { t } - b _ { t - 1 } + c _ { t }
+$$
+
+since,
+
+$$
+u = \rho + \sqrt { \rho ^ { 2 } - \rho } , v = \rho - \sqrt { \rho ^ { 2 } - \rho }
+$$
+
+we obtain
+
+$$
+a _ { t + 1 } - u a _ { t } = ( a _ { t } - u a _ { t - 1 } ) v + b _ { t } - b _ { t - 1 } + c _ { t }
+$$
+
+Recursively we have
+
+$$
+\begin{array} { l } { { a _ { t + 1 } - u a _ { t } = ( a _ { t } - u a _ { t - 1 } ) v + b _ { t } - b _ { t - 1 } + c _ { t } } } \\ { { \displaystyle \quad = ( a _ { t - 1 } - u a _ { t - 2 } ) v ^ { 2 } + ( b _ { t - 1 } - b _ { t - 2 } + c _ { t - 1 } ) v + b _ { t } - b _ { t - 1 } + c _ { t } } } \\ { { \displaystyle \quad = ( a _ { 1 } - u a _ { 0 } ) v ^ { t } + \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - s } } } \\ { { \displaystyle \quad \quad = a _ { 1 } v ^ { t } + \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - s } } } \end{array}
+$$
+
+Dividing both sides by $\boldsymbol u ^ { t + 1 }$ , we have
+
+$$
+\begin{array} { l } { \displaystyle \frac { a _ { t + 1 } } { u ^ { t + 1 } } = \frac { a _ { t } } { u ^ { t } } + u ^ { - ( t + 1 ) } \left( a _ { 1 } v ^ { t } + \displaystyle \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - s } \right) } \\ { \displaystyle \quad = \frac { a _ { t - 1 } } { u ^ { t - 1 } } + u ^ { - t } \left( a _ { 1 } v ^ { t - 1 } + \displaystyle \sum _ { s = 1 } ^ { t - 1 } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - 1 - s } \right) } \\ { \displaystyle \qquad + u ^ { - ( t + 1 ) } \left( a _ { 1 } v ^ { t } + \displaystyle \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - s } \right) } \\ { \displaystyle \qquad = \frac { a _ { 1 } } { u } + \displaystyle \sum _ { k = 1 } ^ { t } u ^ { - k - 1 } \left( a _ { 1 } v ^ { k } + \displaystyle \sum _ { s = 1 } ^ { k } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { k - s } \right) } \end{array}
+$$
+
+Multiplying both sides by $\boldsymbol u ^ { t + 1 }$
+
+$$
+\begin{array} { r l } & { \alpha _ { \neq + 1 } = a _ { 1 } u ^ { t } + \displaystyle \sum _ { k = 1 } ^ { t } u ^ { t - k } \left( a _ { i k } v ^ { k } + \displaystyle \sum _ { s = 1 } ^ { k } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { t - s } \right) } \\ & { \qquad = a _ { 1 } u ^ { t } \left( 1 + \displaystyle \sum _ { k = 1 } ^ { t } \left( \frac v { w } \right) ^ { k } \right) + u ^ { t } \displaystyle \sum _ { k = 1 } ^ { t } \sum _ { s = 1 } ^ { k } ( b _ { s } - b _ { s - 1 } + c _ { s } ) v ^ { s - s } \left( \displaystyle \frac v u \right) ^ { k } } \\ & { \qquad = a _ { 1 } u ^ { t } \displaystyle \sum _ { k = 0 } ^ { t } \left( \frac v \left| w \right| ^ { k } \right) ^ { k } + u ^ { t } \displaystyle \sum _ { s = 1 } ^ { t } \sum _ { k = 0 } ^ { t } \left( b _ { s } - b _ { s - 1 } + c _ { s } \right) v ^ { s - s } \left( \displaystyle \frac v u \right) ^ { k } } \\ & { \qquad = a _ { 1 } u ^ { t } \left( \displaystyle \frac { 1 - \left( \frac v u \right) ^ { \xi + 1 } } { 1 - \frac v 8 } \right) + u ^ { t } \displaystyle \sum _ { s = 1 } ^ { t } \left( b _ { s } - b _ { s - 1 } + c _ { s } \right) v ^ { - s } \left( \displaystyle \frac v u \right) ^ { \xi } \displaystyle \frac { 1 - \left( \frac v u \right) ^ { t - s - 1 } } { 1 - \frac v { s } } } \\ & { \qquad = a _ { 1 } \left( \displaystyle \frac { u ^ { t + 1 } - v ^ { t + 1 } } { \upsilon - v } \right) + \displaystyle \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) \displaystyle \frac { u ^ { t - s + 1 } - v ^ { t - s + 1 } } { \upsilon - v } } \end{array}
+$$
+
+Note that when $0 < \rho < 1$ ,both u and v are complex numbers, we have
+
+$$
+u = \sqrt { \rho } e ^ { i \theta } , v = \sqrt { \rho } e ^ { - i \theta }
+$$
+
+where $\theta = \operatorname { a r c c o s } \sqrt { \rho }$ And under this context,we have
+
+$$
+a _ { t + 1 } = a _ { 1 } \rho ^ { \frac { t } { 2 } } \frac { \sin [ ( t + 1 ) \theta ] } { \sin \theta } + \sum _ { s = 1 } ^ { t } ( b _ { s } - b _ { s - 1 } + c _ { s } ) \rho ^ { \frac { t - s } { 2 } } \frac { \sin [ ( t - s + 1 ) \theta ] } { \sin \theta }
+$$
+
+That completes the proof.
+
+Lemma 14 For any matrix $X \in \mathbb { R } ^ { N \times n }$ , we have
+
+$$
+\begin{array} { c } { { \displaystyle \sum _ { i = 2 } ^ { n } \left\| X v _ { i } \right\| ^ { 2 } \leq \sum _ { i = 1 } ^ { n } \left\| X v _ { i } \right\| ^ { 2 } = \left\| X \right\| _ { F } ^ { 2 } } } \\ { { \displaystyle \sum _ { i = 1 } ^ { n } \left\| X P ^ { \top } e _ { i } \right\| ^ { 2 } = \left\| X P ^ { \top } \right\| _ { F } ^ { 2 } = \left\| X \right\| _ { F } ^ { 2 } } } \end{array}
+$$
+
+# Proof
+
+$$
+\sum _ { i = 2 } ^ { n } \left\| X _ { t } \boldsymbol { v } _ { i } \right\| ^ { 2 } \leq \sum _ { i = 1 } ^ { n } \left\| X _ { t } \boldsymbol { v } _ { i } \right\| ^ { 2 } = \left\| X _ { t } \boldsymbol { P } \right\| _ { \boldsymbol { F } } ^ { 2 } = T r \big ( X _ { t } \boldsymbol { P } \boldsymbol { P } ^ { \top } \boldsymbol { X } _ { t } ^ { \top } \big ) = T r \big ( X _ { t } \boldsymbol { X } _ { t } ^ { \top } \big ) = \left\| \boldsymbol { X } _ { t } \right\| _ { \boldsymbol { F } } ^ { 2 }
+$$
+
+And similarly,
+
+$$
+\sum _ { i = 1 } ^ { n } \left\| { \boldsymbol X } { \boldsymbol P } ^ { \top } { \boldsymbol e } _ { i } \right\| ^ { 2 } = \left\| { \boldsymbol X } { \boldsymbol P } ^ { \top } \right\| _ { F } ^ { 2 } = T r ( X _ { t } { \boldsymbol P } ^ { \top } { \boldsymbol P } { \boldsymbol X } _ { t } ^ { \top } ) = T r ( X _ { t } { \boldsymbol X } _ { t } ^ { \top } ) = \left\| { \boldsymbol X } _ { t } \right\| _ { F } ^ { 2 }
+$$
+
+That completes the proof.
+
+Lemma 15 If we run Algorithm 2 for $K$ iterations the following inequality holds:
+
+$$
+\begin{array} { l } { \displaystyle \left( 1 - \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } } { C _ { 4 } } \right) \mathbb { E } \left\| \nabla f ( 0 ) \right\| + \left( 1 - \alpha L - 3 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 4 } L ^ { 4 } \right) \frac { 1 } { K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { G } _ { k } \right\| ^ { 2 } } \\ { \displaystyle \quad + \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 \left( f ( 0 ) - f ^ { * } \right) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + \varsigma _ { 0 } ^ { 2 } \right) } { C _ { 4 } K } + 6 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } \sigma ^ { 2 } L ^ { 2 } + 3 \frac { C _ { 2 } } { n C _ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 4 } } \\ { \displaystyle \quad + \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } } \left( \frac { 3 D _ { 1 } n + 4 } { 3 D _ { 2 } n } \right) ^ { 2 } \alpha ^ { 2 } G _ { \infty } ^ { 2 } d } \end{array}
+$$
+
+where
+
+$$
+\begin{array} { l } { { { \cal C } _ { 1 } = \displaystyle \operatorname* { m a x } \left\{ \displaystyle \frac { 3 } { 1 - | v _ { n } | ^ { 2 } } , \displaystyle \frac { 3 } { ( 1 - \lambda _ { 2 } ) ^ { 2 } } \right\} } } \\ { { { \cal C } _ { 2 } = \displaystyle \operatorname* { m a x } \left\{ \displaystyle \frac { 3 \lambda _ { n } ^ { 2 } } { ( 1 - | v _ { n } | ) ^ { 2 } } , \displaystyle \frac { 3 \lambda _ { 2 } ^ { 2 } } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \right\} } } \\ { { { \cal C } _ { 3 } = \displaystyle \operatorname* { m a x } \left\{ \displaystyle \frac { 3 } { ( 1 - | v _ { n } | ) ^ { 2 } } , \displaystyle \frac { 3 } { ( 1 - \sqrt { \lambda _ { 2 } } ) ^ { 2 } ( 1 - \lambda _ { 2 } ) } \right\} } } \\ { { { \cal C } _ { 4 } = 1 - 1 2 C _ { 2 } \alpha ^ { 2 } L ^ { 2 } } } \\ { { { \mit C } _ { k } c _ { i } = \displaystyle \sum _ { j = 1 } ^ { n } \left( \displaystyle ( q _ { k , j } - x _ { k + \frac { 1 } { 2 } , j } ) - ( q _ { k , i } - x _ { k + \frac { 1 } { 2 } , i } ) \right) W _ { j i } } } \end{array}
+$$
+
+Proof Since
+
+$$
+\begin{array} { r l } & { \overline { { \boldsymbol X } } _ { k + 1 } = ( 2 X _ { k } - X _ { k - 1 } - \alpha \widetilde G _ { k } + \alpha \widetilde G _ { k - 1 } ) W \frac { \mathbb { 1 } _ { n } } { n } + ( Q _ { k } - X _ { k + \frac { 1 } { 2 } } ) ( W - I ) \frac { \mathbb { 1 } _ { n } } { n } } \\ & { \qquad = 2 \overline { { \boldsymbol X } } _ { k } - \overline { { \boldsymbol X } } _ { k - 1 } - \alpha \overline { { \widetilde G } } _ { k } + \alpha \overline { { \widetilde G } } _ { k - 1 } } \end{array}
+$$
+
+and we have
+
+$$
+\begin{array} { r l } { { \overline { { X } } _ { k + 1 } - \overline { { X } } _ { k } = \overline { { X } } _ { k } - \overline { { X } } _ { k - 1 } - \alpha \overline { { \widetilde { G } } } _ { k } + \alpha \overline { { \widetilde { G } } } _ { k - 1 } } } \\ & { ~ = \overline { { X } } _ { 1 } - \overline { { X } } _ { 0 } - \alpha \displaystyle \sum _ { t = 1 } ^ { k } ( \overline { { \widetilde { G } } } _ { t } - \overline { { \widetilde { G } } } _ { t - 1 } ) } \\ & { ~ = - \alpha \overline { { \widetilde { G } } } _ { k } } \end{array}
+$$
+
+As a result, we can reuse Lemma 8 from $D$ -PSGD, thus we have
+
+$$
+\begin{array} { r l } & { \frac { 1 - \alpha L } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { 1 } { K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { L ^ { 2 } } { n K } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \overline { { X } } _ { k } - x _ { k , i } \right\| ^ { 2 } } \end{array}
+$$
+
+From Lemma 12 we obatin
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \frac { 1 - \alpha L } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } } \\ & { \leq \frac { 2 ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { \alpha L } { n } \sigma ^ { 2 } + \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } \left( \sigma ^ { 2 } + \varsigma _ { 0 } ^ { 2 } + \mathbb { E } \left\| \nabla f ( 0 ) \right\| \right) } { C _ { 4 } K } + 6 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } \sigma ^ { 2 } L ^ { 2 } + 3 \frac { C _ { 2 } } { n C _ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 4 } } \\ & { + 3 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 4 } L ^ { 4 } \frac { 1 } { K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \overline { { G } } _ { k } \right\| ^ { 2 } + \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } n K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } } \end{array}
+$$
+
+Rearrange the terms, we get
+
+$$
+\begin{array} { r l } & { \qquad ( 1 - \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } R ^ { 2 } } { C _ { 4 } } ) \mathbb { E } \| \nabla f ( 0 \| ) \| + ( 1 - \alpha L - \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } L ^ { 2 } \alpha ^ { 4 } L ^ { 4 } ) \frac { 1 } { K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \overline { G } _ { k } \| ^ { 2 } } \\ & { \qquad + \frac { 1 } { K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } } \\ & { \qquad \le \frac { 2 ( f ( 0 ) - f ^ { * } ) } { K } + \frac { \alpha L } { 3 } \sigma ^ { 2 } + \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } ( \sigma ^ { 2 } + s _ { 0 } ^ { 2 } ) } { C _ { 1 } K } + \theta \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } \sigma ^ { 2 } L ^ { 2 } + 3 \frac { C _ { 2 } } { \nu C _ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 3 } } \\ & { \qquad + \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } \pi K } \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \Omega _ { k } \| _ { L } ^ { 2 } } \\ & { \overset { L o m a x ~ } { \le } \frac { \alpha L } { \le } ( f ( 0 ) - f ^ { * } ) + \frac { \alpha L } { K } \sigma ^ { 2 } + \frac { 3 C _ { 1 } \alpha ^ { 2 } L ^ { 2 } ( \sigma ^ { 2 } + s _ { 0 } ^ { 2 } ) } { C _ { 4 } K } + 6 \frac { C _ { 2 } } { C _ { 4 } } \alpha ^ { 2 } \sigma ^ { 2 } L ^ { 2 } + 3 \frac { C _ { 2 } } { \nu C _ { 4 } } \alpha ^ { 4 } \sigma ^ { 2 } L ^ { 3 } } \\ & { \qquad + \frac { C _ { 3 } L ^ { 2 } } { C _ { 4 } } ( 3 \mathcal { D } _ { 1 0 1 } + 4 ) ^ { 2 } \alpha ^ { 2 } C _ { 2 } ^ { 2 } \alpha ^ { 2 } } \end{array}
+$$
+
+That completes the proof.
+
+# Lemma 16
+
+$$
+\sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } \leq \left( \frac { 3 D _ { 1 } n + 4 } { 3 D _ { 2 } n } \right) ^ { 2 } \alpha ^ { 2 } G _ { \infty } ^ { 2 } d n K
+$$
+
+Proof Similar to the case in D-PSGD,we have
+
+$$
+\sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \Omega _ { k } \right\| _ { F } ^ { 2 } = \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } \mathbb { E } \left\| \sum _ { j = 1 } ^ { n } \left( \big ( q _ { k , j } - x _ { k + \frac { 1 } { 2 } , j } \big ) - \big ( q _ { k , i } - x _ { k + \frac { 1 } { 2 } , i } \big ) \right) W _ { j i } \right\| ^ { 2 }
+$$
+
+That completes the proof.
+
+# H MONIQUA ON AD-PSGD (PROOF TO THEOREM 4)
+
+H.1ALGORITHM
+
+# Algorithm 3 Moniqua with Asynchronous Communication
+
+Input: initial point $x _ { 0 , i } ~ = ~ x _ { 0 }$ ,step size $\alpha$ ,the discrepency bound $\theta$ ,number of iterations $\overline { { K } }$ quantization function $\mathcal { Q }$ ,initial random seed
+1:for $k = 0 , 1 , 2 , \cdots , K - 1$ do
+2: worker $i _ { k }$ is updating the gradient while during this iteration the global communication behaviour is written in the form of $W _ { k }$ :
+3: Compute a local tochastic gradient with model delayed by $\tau _ { k } \colon \widetilde { g } _ { k - \tau _ { k } , i _ { k } }$
+4: Compute modulo-ed model: $q _ { k , i _ { k } } \gets \theta \cdot \mathcal { Q } _ { \delta }$ Ck,ik mod 1) (element-wise division and mod)
+5: Randomly select one of the neighbors $j _ { k }$ and average local weights with remote weights while subtracting the biased term: $\begin{array} { r } { x _ { k + \frac { 1 } { 2 } , i _ { k } } ^ { - } x _ { k , i _ { k } } + \frac { 1 } { 2 } \overline { { q } } _ { k , j _ { k } } - \frac { 1 } { 2 } q _ { k , i _ { k } } } \end{array}$
+6: Update the local weight with local gradient: $x _ { k + 1 , i _ { k } } \gets x _ { k , i _ { k } } - \alpha \widetilde { g } _ { k - \tau _ { k } , i _ { k } }$
+7: end for
+
+# H.2DEFINITION AND NOTATION
+
+In the original analysis of AD-PSGD,to better capture the nature of workers computing at different speed, the objective function is expressed as
+
+$$
+f ( x ) = \sum _ { i = 1 } ^ { n } p _ { i } f _ { i } ( x )
+$$
+
+where $p _ { i }$ is a parameter denoting the speed of $i$ -th worker gradient updates.In the rest of the proof, we denote $p = \operatorname* { m a x } _ { i } \{ p _ { i } \}$
+
+For simplicity, we also define the following terms
+
+$$
+\begin{array} { r l } & { \nabla F ( X _ { k } ) = n \left[ p _ { 1 } g _ { k , 1 } , \cdots , p _ { n } g _ { k , n } \right] \in \mathbb { R } ^ { d \times n } } \\ & { \nabla \widetilde { F } ( X _ { k } ) = n \left[ p _ { 1 } \widetilde { g } _ { k , 1 } , \cdots , p _ { n } \widetilde { g } _ { k , n } \right] \in \mathbb { R } ^ { d \times n } } \\ & { \qquad \widetilde { G } _ { k } = [ \cdots , \widetilde { g } _ { k , i _ { k } } , \cdots ] } \\ & { \qquad G _ { k } = [ \cdots , g _ { k , i _ { k } } , \cdots ] } \\ & { \qquad \Lambda _ { a } ^ { b } = \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } - \displaystyle { \prod _ { q = a } ^ { b } W _ { q } } } \end{array}
+$$
+
+# H.3ASSUMPTION
+
+We makes the following assumptions:
+
+1. Lipschitzian Gradient: All the function $f _ { i }$ have L-Lipschitzian gradients.
+
+2. Communication Matrix 12: The communication matrix $W _ { k }$ is doubly stochastic for any $k \geq 0$ and for any $b \geq a \geq 0$ ,there exists $t _ { \mathrm { m i x } }$ such that
+
+$$
+\left\| \prod _ { q = a } ^ { b } W _ { q } \left( I - \frac { \mathbb { 1 } _ { n } \mathbb { 1 } _ { n } ^ { \top } } { n } \right) \right\| _ { 1 } \leq 2 \cdot 2 ^ { - \left\lfloor \frac { b - a + 1 } { t _ { \operatorname* { m i x } } } \right\rfloor }
+$$
+
+# 3.Bounded Variance:
+
+$$
+\mathbb { E } _ { \xi _ { i } \sim \mathcal { D } _ { i } } \left\| \nabla \widetilde { f } _ { i } ( x _ { i } ; \xi _ { i } ) - \nabla f _ { i } ( x ) \right\| ^ { 2 } \le \sigma ^ { 2 } , \forall i
+$$
+
+$$
+\mathbb { E } _ { i \sim \{ 1 , \cdots , n \} } \left\| \nabla f _ { i } ( x ) - \nabla f ( x ) \right\| ^ { 2 } \leq \varsigma ^ { 2 } , \forall i
+$$
+
+where $\nabla \widetilde { f } _ { i } ( \boldsymbol { x } ; \boldsymbol { \xi } _ { i } )$ denotes gradient sample on worker $i$ computed via data sample $\xi _ { i }$
+
+4.Bounded Staleness: There exists $T$ such that $\tau _ { k } \leq T , \forall k$
+
+5. Gradient magnitude: The norm of a sampled gradient is bounded by $\| \widetilde { g } _ { k , i } \| _ { \infty } \le G _ { \infty }$ for some constant $G _ { \infty }$ :
+
+# H.4PROOF TO THEOREM 4
+
+# Proof We start from
+
+$$
+\begin{array} { r l } & { \quad \quad \frac { 1 } { R } \frac { R ^ { 2 } - 1 } { R ^ { 3 } } \mathbb { E } \left[ \nabla f ( \mathbf { X } ; s ) \right] ^ { 2 } + \left( 1 - \frac { 2 \sigma ( s ) } { R } \right) ^ { \frac { 1 } { R } } \frac { \nabla ^ { 2 } } { \lambda _ { \mathrm { B } } ^ { 2 } } \frac { \left[ \nabla f ( \mathbf { X } ; s , \varepsilon ) \right] ^ { 2 } } { R ^ { 3 } } } \\ & { \quad \times \frac { 2 \sigma ( s ) } { R ^ { 3 } } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } - \left( \frac { 4 \sigma ^ { 2 } ( s ) - 2 \sigma ^ { 2 } ( s ) } { R ^ { 3 } } - \frac { 2 } { R ^ { 3 } } \right) \frac { 1 } { R } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \mathbb { E } \Bigg [ \frac { \lambda _ { \mathrm { B } } } { \partial \tau } \dots \Big ( \frac { \lambda _ { \mathrm { B } } } { \partial \tau } - \sigma _ { s } \Big ) \Bigg ] \Bigg \| } \\ & { \quad \quad + \frac { 2 \sigma ^ { 2 } ( s ) } { R ^ { 3 } } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } } \\ & \quad \times \frac { 2 \sigma ( s ) } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial ( s ) } { \partial \tau } \left( 1 + \frac { 2 \sigma ( s ) } { R ^ { 3 } } - \frac { 2 } { R ^ { 3 } } \right) \frac { 1 } { R ^ { 3 } } \frac { \partial } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \frac { \partial \tau } { \partial \tau } \Bigg | \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \frac { \partial } { \partial \tau } \\ & \quad \quad \end{array}
+$$
+
+where $A _ { 1 } = 1 - 1 9 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 }$ as defined in Lemma 19.
+
+Rearrange the terms, we get
+
+$$
+\begin{array} { r l } { { \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } \leq \frac { 2 n ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) \alpha L } { n } + \frac { 2 \alpha ^ { 2 } T ^ { 2 } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) L ^ { 2 } } { n ^ { 2 } } } } \\ & { \phantom { \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } } + \frac { 1 2 8 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 } } { A _ { 1 } } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) + \frac { 1 2 8 \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 } } { A _ { 1 } } G _ { \infty } ^ { 2 } d } \end{array}
+$$
+
+By setting $\begin{array} { r } { \alpha = \frac { n } { 2 L + \sqrt { K ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) } } } \end{array}$
+
+$$
+\begin{array} { r l } & { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } \lesssim \frac { 1 } { K } + \frac { \sqrt { \sigma ^ { 2 } + 6 \varsigma ^ { 2 } } } { \sqrt { K } } + \frac { p t _ { \operatorname* { m i x } } ^ { 2 } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) n ^ { 2 } } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 4 L ^ { 2 } } + \frac { n ^ { 2 } t _ { \operatorname* { m i x } } ^ { 2 } G _ { \infty } ^ { 2 } d } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 4 L ^ { 2 } } } \\ & { \qquad \lesssim \frac { 1 } { K } + \frac { \sqrt { \sigma ^ { 2 } + 6 \varsigma ^ { 2 } } } { \sqrt { K } } + \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) t _ { \operatorname* { m i x } } ^ { 2 } n ^ { 2 } } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 1 } + \frac { n ^ { 2 } t _ { \operatorname* { m i x } } ^ { 2 } G _ { \infty } ^ { 2 } d } { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 1 } } \end{array}
+$$
+
+# H.5LEMMA FOR MONIQUA ON AD-PSGD
+
+# Lemma 17
+
+$$
+\mathbb { E } \left\| \widetilde { G } _ { k - \tau _ { k } } \frac { \mathbb { 1 } _ { n } } { n } \right\| ^ { 2 } \leq \frac { \sigma ^ { 2 } } { n ^ { 2 } } + \frac { 1 } { n ^ { 2 } } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| g _ { k - \tau _ { k } , i } \right\| ^ { 2 } , \forall k \geq 0 .
+$$
+
+# Proof
+
+$$
+\begin{array} { l } { \mathbb { E } \| | | \widetilde { G } _ { k - \tau _ { k } } \frac { \mathbb { 1 } _ { n } } { n } | | ^ { 2 } \leq \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \frac { \widetilde { g } _ { k - \tau _ { k } , i } } { n } \| ^ { 2 } } \\ { \displaystyle = \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \frac { \widetilde { g } _ { k - \tau _ { k } , i } - g _ { k - \tau _ { k } , i } } { n } \| ^ { 2 } + \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \frac { g _ { k - \tau _ { k } , i } } { n } \| ^ { 2 } } \\ { \leq \displaystyle \frac { \sigma ^ { 2 } } { n ^ { 2 } } + \frac { 1 } { n ^ { 2 } } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } \| ^ { 2 } } \end{array}
+$$
+
+# Lemma 18
+
+$$
+\sum _ { = 1 } ^ { n } p _ { i } \mathbb { E } \left. g _ { k - \tau _ { k } , i } \right. ^ { 2 } \leq 1 2 L ^ { 2 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left. X _ { k - \tau _ { k } } \left( \frac { \mathbb { I } _ { n } } { n } - e _ { i } \right) \right. ^ { 2 } + 6 \varsigma ^ { 2 } + 2 \mathbb { E } \left. \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right. ^ { 2 } , \forall k \geq 0 .
+$$
+
+# Proof
+
+$$
+\begin{array} { r l } { { \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } \| ^ { 2 } = \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } - \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } + \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 } } } \\ & { \leq 2 \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } - \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 } + 2 \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 } } \\ & { = 2 \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } - \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 } + 2 \mathbb { E } \| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 } } \end{array}
+$$
+
+And
+
+$$
+\begin{array} { r l } & { \quad \frac { 1 } { \sqrt { 2 } } \displaystyle { \sum _ { j = 1 } ^ { N } \bigg [ \displaystyle \sum _ { i = 1 } ^ { N } \frac { \partial _ { j } ( \boldsymbol { x } - \boldsymbol { x } ) } { \partial x } - \boldsymbol { x } - \boldsymbol { x } \bigg ] ^ { 2 } } } \\ & { \quad \le \frac { 1 } { \sqrt { 2 } } \displaystyle { \sum _ { i = 1 } ^ { N } \frac { \partial _ { j } ( \boldsymbol { x } - \boldsymbol { x } ) } { \partial x } - \frac { \partial _ { i } ( \boldsymbol { x } - \boldsymbol { x } ) } { \partial x } - 1 } \bigg [ \frac { 1 } { \sqrt { 2 } } \sum _ { j = 1 } ^ { N } \bigg [ \gamma _ { i } ( \boldsymbol { x } - \boldsymbol { x } _ { i - 1 } ) - \frac { \partial _ { j } ( \boldsymbol { x } - \boldsymbol { x } ) } { \partial x } \bigg ] ^ { 2 } } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \ \end{array}
+$$
+
+That completes the proof.
+
+Lemma 19 Let $A _ { 1 } = 1 - 1 9 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 }$
+
+$$
+\begin{array} { l } { { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } } \\ { { \displaystyle \leq \frac { 3 2 \alpha ^ { 2 } { t _ { \operatorname* { m i x } } ^ { 2 } } } { A _ { 1 } } \left( ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) p K + 2 p \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } + G _ { \infty } ^ { 2 } d K \right) } } \end{array}
+$$
+
+Proof
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| X _ { k } ( \frac { 1 _ { n } } { n } - e _ { i } ) \| ^ { 2 } } \\ & { \quad \displaystyle = \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| ( X _ { k - 1 } W _ { k - 1 } - \alpha \widetilde { G } _ { k - 1 - r _ { k } } _ { 1 } + \Omega _ { k - 1 } ) ( \frac { 1 _ { n } } { n } - e _ { i } ) \| ^ { 2 } } \\ & { \displaystyle { X _ { \mathfrak { a } } } \equiv 0 \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \displaystyle \sum _ { t = 0 } ^ { k - 1 } ( - \alpha \widetilde { G } _ { t - \tau _ { t } } + \Omega _ { t } ) \Lambda _ { t + 1 } ^ { k - 1 } e _ { i } \| ^ { 2 } } \\ & { \quad \leq 2 \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \displaystyle \sum _ { t = 0 } ^ { k - 1 } \alpha \widetilde { G } _ { t - \tau _ { t } } \Lambda _ { t + 1 } ^ { k - 1 } e _ { i } \| ^ { 2 } + 2 \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \displaystyle \sum _ { t = 0 } ^ { k - 1 } \Omega _ { t } \Lambda _ { t + 1 } ^ { k - 1 } e _ { i } \| ^ { 2 } } \end{array}
+$$
+
+Now for the first term, we have
+
+$$
+\begin{array} { r l r } { { 2 \sum _ { i = 1 } ^ { n } p , \mathbb { E } \| \sum _ { t = 0 } ^ { k - 1 } \alpha \tilde { G } _ { t - \tau _ { i } } \Lambda _ { t + 1 } ^ { k - 1 } e _ { i } \| ^ { 2 } \leq 2 p \alpha ^ { 2 } \mathbb { E } \| \sum _ { t = 0 } ^ { k - 1 } \tilde { G } _ { t - \tau _ { i } } \Lambda _ { t + 1 } ^ { k - 1 } \| _ { F } ^ { 2 } } } \\ & { } & { \leq 2 p \alpha ^ { 2 } \mathbb { E } ( \sum _ { t = 0 } ^ { k - 1 } \| \tilde { G } _ { t - \tau _ { i } } \| _ { F } \| \Lambda _ { t + 1 } ^ { k - 1 } \| ) ^ { 2 } } \\ & { } & { \leq 2 p \alpha ^ { 2 } \mathbb { E } ( \sum _ { t = 0 } ^ { k - 1 } \| \tilde { G } _ { t - \tau _ { i } } \| _ { F } \| \Lambda _ { t + 1 } ^ { k - 1 } \| _ { 1 } ) ^ { 2 } } \\ & { } & { \leq 8 p \alpha ^ { 2 } \mathbb { E } ( \sum _ { t = 0 } ^ { k - 1 } \| \tilde { G } _ { t - \tau _ { i } } \| _ { F } \| \Lambda _ { t + 1 } ^ { k - 1 } \| _ { 1 } ) ^ { 2 } } \\ & { } & { \leq 8 p \alpha ^ { 2 } \mathbb { E } ( \sum _ { t = 0 } ^ { k - 1 } \| \tilde { G } _ { t - \tau _ { i } } \| _ { F } 2 ^ { - \lfloor \frac { k - i - 1 } { \ell _ { \mathrm { t o t h } } } \rfloor } ) ^ { 2 } } \end{array}
+$$
+
+Now we replace $k$ with $k - \tau _ { k }$ ,that is
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| X _ { k - \tau _ { k } } ( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } ) \| ^ { 2 } } \\ & { \leq 8 p \alpha ^ { 2 } \mathbb { E } ( \sum _ { t = 0 } ^ { k - \tau _ { k } - 1 } \| \widetilde { G } _ { t - \tau _ { t } } \| _ { F } 2 ^ { - \lfloor \frac { k - \tau _ { k } - t - 1 } { t _ { \mathrm { m i x } } } \rfloor } ) ^ { 2 } + 2 \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| \sum _ { t = 0 } ^ { k - \tau _ { k } - 1 } \Omega _ { t } \Lambda _ { t + 1 } ^ { k - \tau _ { k } - 1 } e _ { i } \| ^ { 2 } } \end{array}
+$$
+
+Summing from $k = 0$ to $K - 1$ on both sides,we obtain
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } \\ & { \leq 8 p \alpha ^ { 2 } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left( \sum _ { t = 0 } ^ { k - \tau _ { k } - 1 } \left\| \tilde { G } _ { t - \tau _ { t } } \right\| _ { F } 2 ^ { - \left\lfloor \frac { k - \tau _ { k } - t - 1 } { t _ { \mathrm { m i x } } } \right\rfloor } \right) ^ { 2 } } \\ & { \quad \quad + 2 \displaystyle \sum _ { i = 1 } ^ { n } p _ { i } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { t = 0 } ^ { k - \tau _ { k } - 1 } \Omega _ { t } \Lambda _ { t + 1 } ^ { k - \tau _ { k } - 1 } e _ { i } \right\| ^ { 2 } } \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \quad \le \delta g ^ { \prime \prime } \frac { \delta - 1 } { \gamma } ( \displaystyle \sum _ { i = 1 } ^ { N - 1 } ( \frac { \partial ^ { i } } { \partial \tau } - | \mathfrak { x } _ { i } | _ { 2 } ) ( \frac { \partial ^ { i } } { \partial \tau } - | \mathfrak { x } _ { i } | _ { 2 } ) ^ { 2 } ) } \\ & { \quad \le ( \frac { \partial ^ { i } } { \partial \tau } - \frac { \partial ^ { i } } { \partial \tau } ) \displaystyle \sum _ { i = 1 } ^ { N } ( \displaystyle \sum _ { i = 1 } ^ { N - 1 } | \mathfrak { x } _ { i , i } | _ { 2 } | | \mathfrak { x } _ { i \in \mathcal { B } ^ { i - 1 } } ^ { i - 1 } | _ { 1 } ) ^ { 2 } } \\ & { \quad \le ( \frac { \partial ^ { i } } { \partial \tau } ) \displaystyle \sum _ { i = 1 } ^ { N } ( \frac { \partial ^ { i } } { \partial \tau } - | \mathfrak { x } _ { i } | _ { 2 } | | \mathfrak { x } _ { i \in \mathcal { B } ^ { i - 1 } } ^ { i - 1 } | _ { 1 } ) ^ { 2 } } \\ & { \quad \le \delta g ^ { \prime \prime } \displaystyle \sum _ { i = 1 } ^ { N } ( \frac { \partial ^ { i } } { \partial \tau } ) ^ { 2 } ( \frac { \partial ^ { i } } { \partial \tau } - | \mathfrak { x } _ { i } | _ { 2 } | | \mathfrak { x } _ { i \in \mathcal { B } ^ { i - 1 } } ^ { i - 1 } | _ { 1 } ) ^ { 2 } } \\ & { \quad \quad \quad + ( \frac { \partial ^ { i } } { \partial \tau } ) \displaystyle \sum _ { i = 1 } ^ { N } ( | \frac { \partial ^ { i } } { \partial \tau } | ^ { 2 } | \mathfrak { x } _ { i \in \mathcal { B } ^ { i - 1 } } | _ { 1 } ) ^ { 2 } } \\ & \quad \le ( \frac { \partial ^ { i } } { \partial \tau } ) \displaystyle \sum _ { i = 1 } ^ { N - 1 } ( \frac { \partial ^ { i } } { \partial \tau } ) ( \frac { \partial ^ { i } } { \partial \tau } ) ( \frac { \partial ^ { i } } { \partial \tau } ) \displaystyle \sum _ { i = 1 } ^ N - 1 \end{array}
+$$
+
+Note that for the frst term, we have
+
+$$
+\begin{array} { r l } & { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { G } _ { k - \tau _ { k } } \right\| _ { F } ^ { 2 } } \\ & { \leq \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { G } _ { k - \tau _ { k } , k } \right\| ^ { 2 } } \\ & { = \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { g } _ { k - \tau _ { k } , k } \right\| ^ { 2 } } \\ & { = \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \widetilde { g } _ { k - \tau _ { k } , k - \tau } - g _ { k - \tau _ { k } , k } \right\| ^ { 2 } + \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| g _ { k - \tau _ { k } , k } \right\| ^ { 2 } } \\ & { \leq \sigma ^ { 2 } K + \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { k = 0 } ^ { p _ { I } } \mathbb { E } \left\| g _ { k - \tau _ { k } , k } \right\| ^ { 2 } } \\ & { \leq ( \sigma ^ { 2 } + 6 \epsilon ^ { 2 } ) K + 1 2 L ^ { 2 } \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { k = 1 } ^ { n } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathrm { L } _ { n } } { n } - \epsilon _ { k } \right) \right\| ^ { 2 } + 2 \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \displaystyle \sum _ { \widetilde { \epsilon } = 1 } ^ { n } p _ { k } g _ { k - \tau _ { k } , k } \right\| ^ { 2 } } \end{array}
+$$
+
+Putting these two terms back, we obtain
+
+$$
+\begin{array} { r l } & { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { I } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } \\ & { \lesssim 3 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } \left( ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 1 2 L ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { I } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| \right. } \\ & { \left. 1 2 8 \delta ^ { 2 } \theta ^ { 2 } d t _ { \mathrm { m i x } } ^ { 2 } K \right. } \end{array}
+$$
+
+Rearrange the terms, we obtain
+
+$$
+\begin{array} { r l } & { \qquad \displaystyle \left( 1 - 1 9 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 } \right) \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } \\ & { \qquad \displaystyle \leq 3 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } \left( ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } \right) + 1 2 8 \delta ^ { 2 } \theta ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } K } \end{array}
+$$
+
+$$
+\stackrel { L e m m a 2 3 } { \leq } 3 2 \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } \left( ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) p K + 2 p \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } + G _ { \infty } ^ { 2 } d K \right)
+$$
+
+Let $A _ { 1 } = 1 - 1 9 2 p \alpha ^ { 2 } t _ { \mathrm { m i x } } ^ { 2 } L ^ { 2 }$ we obtain
+
+$$
+\begin{array} { l } { { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } } \\ { { \displaystyle \leq \frac { 3 2 \alpha ^ { 2 } { t _ { \operatorname* { m i x } } ^ { 2 } } } { A _ { 1 } } \left( ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) p K + 2 p \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } + G _ { \infty } ^ { 2 } d K \right) } } \end{array}
+$$
+
+Lemma 20
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + \left( 1 - \frac { 2 \alpha L } { n } \right) \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 n ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 L ^ { 2 } } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \frac { ( X _ { k } - X _ { k - \tau _ { k } } ) \mathbb { 1 } _ { n } } { n } \right\| ^ { 2 } } \\ { \displaystyle + \left( 2 L ^ { 2 } + \frac { 1 2 \alpha L ^ { 3 } } { n } \right) \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } + \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) \alpha L } { n } } \end{array}
+$$
+
+Proof We start from $f ( \overline { { X } } _ { k + 1 } )$ Since
+
+$$
+\overline { { { X } } } _ { k + 1 } = X _ { k } W _ { k } \frac { \mathbb { 1 } _ { n } } { n } + ( Q _ { k } - X _ { k } ) ( W _ { k } - I ) \frac { \mathbb { 1 } _ { n } } { n } - \alpha \overline { { \widetilde { G } } } _ { k - \tau _ { k } } = \overline { { { X } } } _ { k } - \alpha \overline { { \widetilde { G } } } _ { k - \tau _ { k } }
+$$
+
+Then from Taylor Expansion, we have
+
+$$
+\begin{array} { r l } & { - \mathbb { E } \bigg \{ \widetilde X _ { \lambda } - \widetilde \mathbf { u } \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \bigg \} } \\ & { \leq \mathbb { E } \| \widetilde X _ { \lambda } - \widetilde \mathbf { u } \widetilde \Omega \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \bigg \} \Big ( \mathcal { E } ( \widetilde X _ { \lambda - \lambda } ) , \widetilde \Omega _ { \lambda - \lambda } \Big ) + \frac { \sigma ^ { 2 } L _ { \gamma } } { 2 } \mathbb { E } \bigg \| \overline { \tilde \zeta } _ { \lambda - \lambda } \bigg \| ^ { 2 } } \\ & { \quad - \mathbb { E } \| \widetilde X _ { \lambda } - \widetilde \Omega \widetilde \Omega \widetilde \Sigma ( \widetilde X ( \widetilde X ( \widetilde X _ { \lambda - \lambda } ) ) , \widetilde \Omega _ { \lambda - \lambda } ) - 2 \mathbb { E } \mathbb { E } \| \widetilde X _ { \lambda } \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } - \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \bigg \} + \frac { \sigma ^ { 2 } L _ { \gamma } } { 2 } \mathbb { E } \bigg \| \widetilde \mathcal \sigma _ { \lambda - \lambda } \bigg \| ^ { 2 } } \\ & { = \mathbb { E } \| \widetilde X _ { \lambda } - \frac { \sigma } { 2 } \mathbb { E } \mathbb { E } \| \widetilde X _ { \lambda } ^ { \lambda } \| ^ { 2 } \mathbb { E } ( \widetilde X _ { \lambda - \lambda } ) \nabla ^ { \lambda } \Big \langle \widetilde X _ { \lambda - \lambda - \lambda } \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \Big \rangle - \frac { \sigma ^ { 2 } L _ { \gamma } } { 2 } \mathbb { E } \bigg \| \frac { \widetilde \sigma _ { \lambda - \lambda } ^ { \lambda } } { 2 } \mathbb { E } \bigg \| \overline { \tilde \sigma } _ { \lambda - \lambda } ^ { \lambda } \bigg \| ^ { 2 } } \\ & { \quad - \mathbb { E } \| \widetilde X _ { \lambda } ^ { \lambda } - \frac { \sigma } { 2 } \mathbb { E } \| \mathcal { E } ( \widetilde X _ { \lambda } ) \nabla ^ { \lambda } \widetilde \Omega _ { \lambda - \lambda } ^ { \lambda } \bigg \} = \mathbb { E } \| \widetilde X _ { \lambda } ^ { \lambda } \| ^ { 2 } \frac { \sigma } { 2 } \mathbb { E } \bigg \| \frac { \widetilde \sigma } { 2 } \mathbb { E } \bigg \| \overline { \tilde \sigma } _ { \lambda - \lambda } ^ { \lambda } \bigg \| ^ { 2 } } \end{array}
+$$
+
+Rearrange these terms, we can get
+
+$$
+\begin{array} { r l } { { \frac { \alpha } { 2 n } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) \| ^ { 2 } + \frac { \alpha } { 2 n } \mathbb { E } \| \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \| ^ { 2 } } } \\ & { \leq \mathbb { E } f ( \overline { { X } } _ { k } ) - \mathbb { E } f ( \overline { { X } } _ { k + 1 } ) + \frac { \alpha } { 2 n } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \| ^ { 2 } } \end{array}
+$$
+
+$$
++ \frac { \alpha ^ { 2 } L \sigma ^ { 2 } } { 2 n ^ { 2 } } + \frac { \alpha ^ { 2 } L } { 2 n ^ { 2 } } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } \| ^ { 2 }
+$$
+
+Summing over $k = 0$ to $K - 1$ on both sides, we can get
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 n ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) - \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 } + \frac { \alpha L \sigma ^ { 2 } } { n } + \frac { \alpha L } { n K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \| g _ { k - \tau _ { k } , i } \| ^ { 2 } } \end{array}
+$$
+
+$\begin{array} { r l } { { F o r } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) - \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 } } & { { } } \end{array}$ we have
+
+$$
+\begin{array} { l } { \displaystyle \sum _ { k = 1 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla \overline { { F } } ( X _ { k - \pi ; k } ) \| ^ { 2 } } \\ { \displaystyle \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla f ( \overline { { X } } _ { k - \pi ; k } ) \| ^ { 2 } + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k - \pi ; k } ) - \nabla \overline { { F } } ( X _ { k - \pi ; k } ) \| ^ { 2 } } \\ { \displaystyle \leq 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla f ( \overline { { X } } _ { k - \pi ; k } ) \| ^ { 2 } + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \sum _ { k = 0 } ^ { \infty } p _ { k } ( \nabla f _ { k } ( \overline { { X } } _ { k - \pi ; k } ) - g _ { k - \pi ; k } ) \| ^ { 2 } } \\ { \displaystyle = 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla f ( \overline { { X } } _ { k - \pi ; k } ) \| ^ { 2 } + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \sum _ { k = 1 } ^ { \infty } p _ { k } ( \nabla f _ { k } ( \overline { { X } } _ { k - \pi ; k } ) - g _ { k - \pi ; k } ) \| ^ { 2 } } \\ { \displaystyle \leq 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \nabla f ( \overline { { X } } _ { k } ) - \nabla f ( \overline { { X } } _ { k - \pi ; k } ) \| ^ { 2 } + 2 \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \sum _ { i = 1 } ^ { \infty } p _ { i } \| \nabla f _ { k } ( \overline { { X } } _ { k - \pi ; k } ) - g _ { k - \pi ; k } \| ^ { 2 } } \\ \displaystyle \leq 2 L ^ { 2 } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \frac { ( X _ { k } - X _ { k - \pi } ) _ { \mathbb { L } _ { k } } } \pi \end{array}
+$$
+
+Putting it back, we have
+
+$$
+\begin{array} { r l } & { \quad _ { 1 } \frac { 1 } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \left| \left( \tau ^ { 2 } X ^ { 2 } X ^ { 3 } \right) \right| ^ { 2 } } \ _ { 1 } \Biggl | \ _ { 1 } \sum _ { j = 1 } ^ { N } \left| \left( \tau ^ { 2 } X ^ { 3 } X ^ { 3 } - u _ { j } ^ { 2 } \right) \right| ^ { 2 } } \\ & { \quad \le \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \left| \left( \tau ^ { 2 } \right) - \frac { \lambda ^ { 2 } } { \sqrt { S } } \right| ^ { 2 } } + \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \left| \left( \frac { \lambda ^ { 2 } - \lambda ^ { 2 } } { \sqrt { S } } \right) \right| ^ { 2 } } \Biggr | ^ { 2 } } \\ & \quad \quad + \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \sum _ { i = 1 } ^ { N } \left| \sum _ { i = 1 } ^ { N } \left| \frac { \lambda ^ { 2 } } { \sqrt { S } } \right| ^ { 2 } - \frac { \lambda ^ { 2 } } { \sqrt { S } } \right| ^ { 2 } + \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \sum _ { i = 1 } ^ { N } \sum _ { i = 1 } ^ { N } \cdots \int _ { 1 } ^ { N } } } \\ & \quad \quad - \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \left| \left( \tau ^ { 2 } \right) - \frac { \lambda ^ { 2 } } { \sqrt { S } } \right| ^ { 2 } } + \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \left| \left( \frac { \lambda ^ { 2 } - \lambda ^ { 2 } } { \sqrt { S } } \right) \right| ^ { 2 } } - \frac { \lambda ^ { 2 } } { \sqrt { S } } \displaystyle { \sum _ { i = 1 } ^ { N } \frac { \lambda ^ { 2 } } { \sqrt { S } } \sum _ { j = 1 } ^ { N } \left| \left( \frac { \lambda ^ { 2 } } { \sqrt { S } } \right) \right| ^ { 2 } } \\ & \quad \quad \end{array}
+$$
+
+$$
++ \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) \alpha L } { n } + \frac { 2 \alpha L } { n K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \| ^ { 2 }
+$$
+
+Note that
+
+$$
+\mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } = \mathbb { E } \left\| \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 }
+$$
+
+Moving it to the left side, we finally get
+
+$$
+\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla f ( \overline { { X } } _ { k } ) \right\| ^ { 2 } + \left( 1 - \frac { 2 \alpha L } { n } \right) \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \nabla \overline { { F } } ( X _ { k - \tau _ { k } } ) \right\| ^ { 2 } } \\ { \displaystyle \leq \frac { 2 n ( f ( 0 ) - f ^ { * } ) } { \alpha K } + \frac { 2 L ^ { 2 } } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \frac { ( X _ { k } - X _ { k - \tau _ { k } } ) \mathbb { 1 } _ { n } } { n } \right\| ^ { 2 } } \\ { \displaystyle + \left( 2 L ^ { 2 } + \frac { 1 2 \alpha L ^ { 3 } } { n } \right) \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } + \frac { ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) \alpha L } { n } } \end{array}
+$$
+
+That completes the proof.
+
+Lemma 21 For all $k \geq 0$ , we have
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \frac { 2 L ^ { 2 } } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| ( X _ { k } - X _ { k - \tau _ { k } } ) \frac { \mathbb { I } _ { n } } { n } \right\| ^ { 2 } } \\ & { \le \displaystyle \frac { 2 \alpha ^ { 2 } T ^ { 2 } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) L ^ { 2 } } { n ^ { 2 } } + \frac { 2 4 L ^ { 4 } \alpha ^ { 2 } T ^ { 2 } } { n ^ { 2 } K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { I } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } \\ & { \quad \displaystyle + \frac { 4 \alpha ^ { 2 } T ^ { 2 } L ^ { 2 } } { n ^ { 2 } K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } } \end{array}
+$$
+
+Proof From Lemma $2 0$ ,we know the fact
+
+$$
+\overline { { { X } } } _ { k + 1 } = X _ { k } W _ { k } \frac { \mathbb { 1 } _ { n } } { n } + ( Q _ { k } - X _ { k } ) ( W _ { k } - I ) \frac { \mathbb { 1 } _ { n } } { n } - \alpha \overline { { { \widetilde { G } } } } _ { k - \tau _ { k } } = \overline { { { X } } } _ { k } - \alpha \overline { { { \widetilde { G } } } } _ { k - \tau _ { k } }
+$$
+
+As a result
+
+$$
+\begin{array} { r l } & { \mathbb { E } ( | X _ { n - 1 } ^ { \varepsilon } - X _ { n - 1 } ^ { \varepsilon } | ^ { 2 } ) } \\ & { \leq \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \begin{array} { l } { \varepsilon ( X _ { n } - X _ { n - 1 } ) \frac { 1 } { \varepsilon ^ { 2 } } \rbrace ^ { 2 } } \\ { \quad + \varepsilon ^ { 3 } ( \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ) ^ { 2 } } \\ { \quad + \varepsilon ^ { 4 } ( \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ) ^ { 2 } } \end{array} ^ { 2 } } \\ & { \leq \varepsilon ^ { 4 } \sum _ { j \in \mathcal { F } _ { n } } ^ { \varepsilon ^ { 3 } - 1 } \begin{array} { l } { \sum _ { i = 1 } ^ { n } \varepsilon ^ { \varepsilon } \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \binom { 1 } { i } \leq \varepsilon ^ { 2 } } \\ { \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ( \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ) ^ { 2 } } \end{array} } \\ & { \leq \varepsilon ^ { 4 } \sum _ { j \in \mathcal { F } _ { n } } ^ { \varepsilon ^ { 4 } - 1 } \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \begin{array} { l } { \sum _ { i = 1 } ^ { n } \varepsilon ^ { \varepsilon } \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \biggr \rvert ^ { 2 } } \\ { \varepsilon ^ { 2 } + \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 2 } } ( \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ) ^ { 2 } } \end{array} } \\ & \leq \varepsilon ^ { 4 } \sum _ { j \in \mathcal { F } _ { n } } ^ { \varepsilon ^ { 4 } - 1 } \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \begin{array} { l } { \sum _ { i = 1 } ^ { n } \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 3 } } \biggr \rvert ^ { 2 } } \\ { \varepsilon ^ { 2 } + \frac { \varepsilon ^ { 2 } } { \varepsilon ^ { 2 } } ( \varepsilon ^ { 2 } + \varepsilon ^ { 2 } ) ^ { 2 } \leq \varepsilon ^ { 2 } \varepsilon ^ { 3 } \begin{array} { l } { 1 } \\ { 2 } \end{array} } \\ & \leq \varepsilon ^ { 2 } \sum _ { i = 1 } ^ { n } \frac \varepsilon ^ \end{array} \end{array}
+$$
+
+$$
+\begin{array} { l } { { \displaystyle = \frac { \alpha ^ { 2 } T ^ { 2 } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) K } { n ^ { 2 } } + \frac { 1 2 L ^ { 2 } \alpha ^ { 2 } T ^ { 2 } } { n ^ { 2 } } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { 1 } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } } \\ { { \displaystyle \quad + \frac { 2 \alpha ^ { 2 } T ^ { 2 } } { n ^ { 2 } } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } } } \end{array}
+$$
+
+And we get
+
+$$
+\begin{array} { r l } & { \quad \displaystyle \frac { 2 L ^ { 2 } } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| ( X _ { k } - X _ { k - \tau _ { k } } ) \frac { \mathbb { I } _ { n } } { n } \right\| ^ { 2 } } \\ & { \le \displaystyle \frac { 2 \alpha ^ { 2 } T ^ { 2 } ( \sigma ^ { 2 } + 6 \varsigma ^ { 2 } ) L ^ { 2 } } { n ^ { 2 } } + \frac { 2 4 L ^ { 4 } \alpha ^ { 2 } T ^ { 2 } } { n ^ { 2 } K } \sum _ { k = 0 } ^ { K - 1 } \sum _ { i = 1 } ^ { n } p _ { i } \mathbb { E } \left\| X _ { k - \tau _ { k } } \left( \frac { \mathbb { I } _ { n } } { n } - e _ { i } \right) \right\| ^ { 2 } } \\ & { \quad \displaystyle + \frac { 4 \alpha ^ { 2 } T ^ { 2 } L ^ { 2 } } { n ^ { 2 } K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left\| \sum _ { i = 1 } ^ { n } p _ { i } g _ { k - \tau _ { k } , i } \right\| ^ { 2 } } \end{array}
+$$
+
+That completes the proof.
+
+Lemma 22 Given non-negative sequences $\{ a _ { t } \} _ { t = 1 } ^ { \infty }$ $\{ b _ { t } \} _ { t = 1 } ^ { \infty }$ and $\{ \tau _ { t } \} _ { t = 1 } ^ { \infty }$ and a positive number $T$ that satisfying
+
+$$
+a _ { t } = \sum _ { s = 1 } ^ { t - \tau _ { t } } \rho ^ { \lfloor \frac { t - \tau _ { t } - s } { T } \rfloor } b _ { s }
+$$
+
+with $0 \leq \rho < 1$ ,we have
+
+$$
+\begin{array} { r l } & { S _ { k } = \displaystyle \sum _ { t = 1 } ^ { k } a _ { t } \le \frac { ( 2 - \rho ) T } { 1 - \rho } \sum _ { s = 1 } ^ { k } b _ { s } } \\ & { D _ { k } = \displaystyle \sum _ { t = 1 } ^ { k } a _ { t } ^ { 2 } \le \frac { ( 2 - \rho ) T ^ { 2 } } { ( 1 - \rho ) ^ { 2 } } \sum _ { s = 1 } ^ { k } b _ { s } ^ { 2 } } \end{array}
+$$
+
+# Proof
+
+$$
+\begin{array} { r l } { S _ { k } = \displaystyle \sum _ { i = 1 } ^ { k } a _ { i } = \sum _ { j = 1 } ^ { k - 1 } \sum _ { j = 1 } ^ { k - 1 } \mu _ { j } \frac { \sum _ { i = j + 1 } ^ { k } } { 2 } \| _ { \boldsymbol { h } _ { i } } \leq \displaystyle \sum _ { i = 1 } ^ { k } \sum _ { j = 1 } ^ { k } \mu _ { i } \| _ { \boldsymbol { h } _ { i } } = \sum _ { i = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s u b } } \mu _ { i } = \sum _ { j = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s u b } } \| _ { \boldsymbol { h } _ { i } } = } & \\ { = \displaystyle \sum _ { i = 1 } ^ { k } \sum _ { j = 0 } ^ { k } \mu _ { i } ^ { \mathrm { s u b } } - \sum _ { j = 1 } ^ { k } \mu _ { j } ^ { \mathrm { s u b } } \mu _ { i } \leq \sum _ { i = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s b } } \mu _ { i } \leq \sum _ { j = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s b } } \mu _ { j } \qquad \delta _ { k } + \pi \sum _ { i = 1 } ^ { k } b _ { i } \leq \delta \left( 1 - \frac { \boldsymbol { p } } { 1 - \boldsymbol { p } } \right) \sum _ { i = 1 } ^ { k } } \\ \displaystyle \sum _ { j = 1 } ^ { k } \sum _ { i = 1 } ^ { k } a _ { i } ^ { \mathrm { s u b } } - \sum _ { j = 1 } ^ { k - 1 } \mu _ { i } ^ { \mathrm { s u b } } \mu _ { i } \leq \sum _ { j = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s u b } } \mu _ { j } \leq \sum _ { i = 1 } ^ { k } \mu _ { i } ^ { \mathrm { s u b } } \mu _ { i } ^ { \mathrm { s u b } } \mu _ { j } \leq \pi \sum _ { i = 1 } ^ { k } b _ { i } ^ { \mathrm { s u b } } \mu _ { i } = \delta \left( 1 - \frac { \boldsymbol { p } } { 1 - \boldsymbol { p } } \right) \sum _ { j = 1 } ^ { k } \mu _ { j } ^ { \mathrm { s u b } } \\ \displaystyle \sum _ { i = 1 } ^ { k } \sum _ { j = 1 } ^ { k } \sum _ { i = 1 } ^ { k - 1 } \mu _ { i } ^ { \mathrm { f i v } } \mu _ { j } \leq \displaystyle \sum _ { i = 1 } ^ k \end{array}
+$$
+
+Lemma 23 for $\forall i , j$ and $\forall k \geq 0$ ,we have
+
+$$
+\left\| X _ { k } ( e _ { i } - e _ { j } ) \right\| _ { \infty } \leq \theta = 1 6 t _ { \operatorname* { m i x } } \alpha G _ { \infty }
+$$
+
+Proof Similar to Section $F$ and Section $G$ we use mathmatical induction to prove this.
+
+I. First, for $k = 0$ ,we have
+
+$$
+\left\| X _ { k } ( e _ { i } - e _ { j } ) \right\| _ { \infty } = 0 \leq \theta = 1 6 t _ { \operatorname* { m i x } } \alpha G _ { \infty }
+$$
+
+II. Suppose for $k \geq 0$ ,we have $\left\| X _ { t } ( e _ { i } - e _ { j } ) \right\| _ { \infty } \leq \theta , \forall t \leq k$ , then we have
+
+$$
+\begin{array} { r l } & { \mathcal { L } _ { \mathrm { X } , \mathrm { L } } ( \gamma , \theta ) = \mathcal { L } _ { \mathrm { Y } , \mathrm { R } } } \\ & { \mathcal { L } _ { \mathrm { X } , \mathrm { L } } ( \frac { 1 } { \omega } - \alpha _ { \mathrm { Y } , 0 } ^ { 2 } ) = \frac { 1 } { \omega } ( \frac { 1 } { \omega } \sin ( \frac { \mathrm { L } _ { \mathrm { X } } } { \omega } - \alpha _ { \mathrm { Y } } ^ { 2 } ) ) } \\ & { - ( \frac { 1 } { \omega } \sin ( \frac { \mathrm { L } _ { \mathrm { X } } } { \omega } - \alpha _ { \mathrm { Y } } ^ { 2 } ) ) } \\ & { - ( \frac { 1 } { \omega } \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega } ) - \frac { \mathrm { R } _ { \mathrm { X } } ^ { 2 } } { \omega ^ { 2 } } ) [ \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega } ) - ( \frac { 1 } { \omega } - \alpha _ { \mathrm { Y } } ^ { 2 } ) ] } \\ & { - ( \frac { 1 } { \omega } \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega } ) - \frac { \mathrm { R } _ { \mathrm { X } } ^ { 2 } } { \omega ^ { 2 } } ) [ \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega } ) - ( \frac { 1 } { \omega } \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega ^ { 2 } } ) ) ] } \\ & { + \mathcal { L } _ { \mathrm { Y } , \mathrm { R } } ^ { 2 } } \\ & { - 2 [ \frac { 1 } { \omega } \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega } - \alpha _ { \mathrm { Y } } ^ { 2 } ) ] ( \frac { 1 } { \omega } \sin ^ { 2 } ( \frac { \mathrm { R } _ { \mathrm { X } } } { \omega ^ { 2 } } ) ] } \\ & - ( \frac { 1 } { \omega } \frac { \mathrm { R } _ { \mathrm { X } } } { \omega ^ { 2 } } + \frac { \mathrm { R } _ { \mathrm { Y } } } { \omega ^ { 2 } } \ \end{array}
+$$
+
+Put in $\begin{array} { r } { \delta = \frac { 1 } { 3 2 t _ { \mathrm { m i x } } } } \end{array}$ we obtain
+
+$$
+\begin{array} { r } { \| X _ { k + 1 } ( e _ { i } - e _ { j } ) \| _ { 2 } \leq 8 ( \alpha G _ { \infty } + 2 \delta \theta ) t _ { \operatorname* { m i x } } = 8 t _ { \operatorname* { m i x } } \alpha G _ { \infty } + 8 t _ { \operatorname* { m i x } } \alpha G _ { \infty } = 1 6 t _ { \operatorname* { m i x } } \alpha G _ { \infty } } \end{array}
+$$
+
+Combining I and II and we complete the proof.
\ No newline at end of file
diff --git a/md/train/I55UqU-M11y/I55UqU-M11y.md b/md/train/I55UqU-M11y/I55UqU-M11y.md
new file mode 100644
index 0000000000000000000000000000000000000000..8625b93842360bafb45f0ba23e4970c167775d42
--- /dev/null
+++ b/md/train/I55UqU-M11y/I55UqU-M11y.md
@@ -0,0 +1,231 @@
+# Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting
+
+Haixu Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long $( \boxtimes )$ School of Software, BNRist, Tsinghua University, China {whx20,xjh20}@mails.tsinghua.edu.cn, {jimwang,mingsheng}@tsinghua.edu.cn
+
+# Abstract
+
+Extending the forecasting time is a critical demand for real applications, such as extreme weather early warning and long-term energy consumption planning. This paper studies the long-term forecasting problem of time series. Prior Transformerbased models adopt various self-attention mechanisms to discover the long-range dependencies. However, intricate temporal patterns of the long-term future prohibit the model from finding reliable dependencies. Also, Transformers have to adopt the sparse versions of point-wise self-attentions for long series efficiency, resulting in the information utilization bottleneck. Going beyond Transformers, we design Autoformer as a novel decomposition architecture with an Auto-Correlation mechanism. We break with the pre-processing convention of series decomposition and renovate it as a basic inner block of deep models. This design empowers Autoformer with progressive decomposition capacities for complex time series. Further, inspired by the stochastic process theory, we design the Auto-Correlation mechanism based on the series periodicity, which conducts the dependencies discovery and representation aggregation at the sub-series level. Auto-Correlation outperforms self-attention in both efficiency and accuracy. In long-term forecasting, Autoformer yields stateof-the-art accuracy, with a $38 \%$ relative improvement on six benchmarks, covering five practical applications: energy, traffic, economics, weather and disease. Code is available at this repository: https://github.com/thuml/Autoformer.
+
+# 1 Introduction
+
+Time series forecasting has been widely used in energy consumption, traffic and economics planning, weather and disease propagation forecasting. In these real-world applications, one pressing demand is to extend the forecast time into the far future, which is quite meaningful for the long-term planning and early warning. Thus, in this paper, we study the long-term forecasting problem of time series, characterizing itself by the large length of predicted time series. Recent deep forecasting models [41, 17, 20, 28, 23, 29, 19, 35] have achieved great progress, especially the Transformer-based models. Benefiting from the self-attention mechanism, Transformers obtain great advantage in modeling long-term dependencies for sequential data, which enables more powerful big models [7, 11].
+
+However, the forecasting task is extremely challenging under the long-term setting. First, it is unreliable to discover the temporal dependencies directly from the long-term time series because the dependencies can be obscured by entangled temporal patterns. Second, canonical Transformers with self-attention mechanisms are computationally prohibitive for long-term forecasting because of the quadratic complexity of sequence length. Previous Transformer-based forecasting models [41, 17, 20] mainly focus on improving self-attention to a sparse version. While performance is significantly improved, these models still utilize the point-wise representation aggregation. Thus, in the process of efficiency improvement, they will sacrifice the information utilization because of the sparse point-wise connections, resulting in a bottleneck for long-term forecasting of time series.
+
+To reason about the intricate temporal patterns, we try to take the idea of decomposition, which is a standard method in time series analysis [1, 27]. It can be used to process the complex time series and extract more predictable components. However, under the forecasting context, it can only be used as the pre-processing of past series because the future is unknown [15]. This common usage limits the capabilities of decomposition and overlooks the potential future interactions among decomposed components. Thus, we attempt to go beyond pre-processing usage of decomposition and propose a generic architecture to empower the deep forecasting models with immanent capacity of progressive decomposition. Further, decomposition can ravel out the entangled temporal patterns and highlight the inherent properties of time series [15]. Benefiting from this, we try to take advantage of the series periodicity to renovate the point-wise connection in self-attention. We observe that the sub-series at the same phase position among periods often present similar temporal processes. Thus, we try to construct a series-level connection based on the process similarity derived by series periodicity.
+
+Based on the above motivations, we propose an original Autoformer in place of the Transformers for long-term time series forecasting. Autoformer still follows residual and encoder-decoder structure but renovates Transformer into a decomposition forecasting architecture. By embedding our proposed decomposition blocks as the inner operators, Autoformer can progressively separate the long-term trend information from predicted hidden variables. This design allows our model to alternately decompose and refine the intermediate results during the forecasting procedure. Inspired by the stochastic process theory [8, 24], Autoformer introduces an Auto-Correlation mechanism in place of self-attention, which discovers the sub-series similarity based on the series periodicity and aggregates similar sub-series from underlying periods. This series-wise mechanism achieves $\mathcal { O } ( L \log L )$ complexity for length- $L$ series and breaks the information utilization bottleneck by expanding the point-wise representation aggregation to sub-series level. Autoformer achieves the state-of-the-art accuracy on six benchmarks. The contributions are summarized as follows:
+
+• To tackle the intricate temporal patterns of the long-term future, we present Autoformer as a decomposition architecture and design the inner decomposition block to empower the deep forecasting model with immanent progressive decomposition capacity. • We propose an Auto-Correlation mechanism with dependencies discovery and information aggregation at the series level. Our mechanism is beyond previous self-attention family and can simultaneously benefit the computation efficiency and information utilization. • Autoformer achieves a $38 \%$ relative improvement under the long-term setting on six benchmarks, covering five real-world applications: energy, traffic, economics, weather and disease.
+
+# 2 Related Work
+
+# 2.1 Models for Time Series Forecasting
+
+Due to the immense importance of time series forecasting, various models have been well developed. Many time series forecasting methods start from the classic tools [32, 9]. ARIMA [6, 5] tackles the forecasting problem by transforming the non-stationary process to stationary through differencing. The filtering method is also introduced for series forecasting [18, 10]. Besides, recurrent neural networks (RNNs) models are used to model the temporal dependencies for time series [36, 26, 40, 22]. DeepAR [28] combines autoregressive methods and RNNs to model the probabilistic distribution of future series. LSTNet [19] introduces convolutional neural networks (CNNs) with recurrent-skip connections to capture the short-term and long-term temporal patterns. Attention-based RNNs [39, 30, 31] introduce the temporal attention to explore the long-range dependencies for prediction. Also, many works based on temporal convolution networks (TCN) [34, 4, 3, 29] attempt to model the temporal causality with the causal convolution. These deep forecasting models mainly focus on the temporal relation modeling by recurrent connections, temporal attention or causal convolution.
+
+Recently, Transformers [35, 38] based on the self-attention mechanism shows great power in sequential data, such as natural language processing [11, 7], audio processing [14] and even computer vision [12, 21]. However, applying self-attention to long-term time series forecasting is computationally prohibitive because of the quadratic complexity of sequence length $L$ in both memory and time. LogTrans [20] introduces the local convolution to Transformer and proposes the LogSparse attention to select time steps following the exponentially increasing intervals, which reduces the complexity to $\mathcal { O } ( L ( \log L ) ^ { 2 } )$ . Reformer [17] presents the local-sensitive hashing (LSH) attention and reduces the complexity to $\mathcal { O } ( L \log L )$ . Informer [41] extends Transformer with KL-divergence based ProbSparse attention and also achieves $\mathcal { O } ( L \log L )$ complexity. Note that these methods are based on the vanilla Transformer and try to improve the self-attention mechanism to a sparse version, which still follows the point-wise dependency and aggregation. In this paper, our proposed Auto-Correlation mechanism is based on the inherent periodicity of time series and can provide series-wise connections.
+
+# 2.2 Decomposition of Time Series
+
+As a standard method in time series analysis, time series decomposition [1, 27] deconstructs a time series into several components, each representing one of the underlying categories of patterns that are more predictable. It is primarily useful for exploring historical changes over time. For the forecasting tasks, decomposition is always used as the pre-processing of historical series before predicting future series [15, 2], such as Prophet [33] with trend-seasonality decomposition and N-BEATS [23] with basis expansion and DeepGLO [29] with matrix decomposition. However, such pre-processing is limited by the plain decomposition effect of historical series and overlooks the hierarchical interaction between the underlying patterns of series in the long-term future. This paper takes the decomposition idea from a new progressive dimension. Our Autoformer harnesses the decomposition as an inner block of deep models, which can progressively decompose the hidden series throughout the whole forecasting process, including both the past series and the predicted intermediate results.
+
+# 3 Autoformer
+
+The time series forecasting problem is to predict the most probable length- $O$ series in the future given the past length- ${ \mathbf { \nabla } } \cdot { I }$ series, denoting as input-I-predict- $O$ . The long-term forecasting setting is to predict the long-term future, i.e. larger $O$ . As aforementioned, we have highlighted the difficulties of long-term series forecasting: handling intricate temporal patterns and breaking the bottleneck of computation efficiency and information utilization. To tackle these two challenges, we introduce the decomposition as a builtin block to the deep forecasting model and propose Autoformer as a decomposition architecture. Besides, we design the Auto-Correlation mechanism to discover the period-based dependencies and aggregate similar sub-series from underlying periods.
+
+# 3.1 Decomposition Architecture
+
+We renovate Transformer [35] to a deep decomposition architecture (Figure 1), including the inner series decomposition block, Auto-Correlation mechanism, and corresponding Encoder and Decoder.
+
+Series decomposition block To learn with the complex temporal patterns in long-term forecasting context, we take the idea of decomposition [1, 27], which can separate the series into trend-cyclical and seasonal parts. These two parts reflect the long-term progression and the seasonality of the series respectively. However, directly decomposing is unrealizable for future series because the future is just unknown. To tackle this dilemma, we present a series decomposition block as an inner operation of Autoformer (Figure 1), which can extract the long-term stationary trend from predicted intermediate hidden variables progressively. Concretely, we adapt the moving average to smooth out periodic fluctuations and highlight the long-term trends. For length- $L$ input series $\breve { \mathcal { X } } \in \mathbb { R } ^ { L \times d }$ , the process is:
+
+$$
+\begin{array} { r l } & { \mathcal { X } _ { \mathrm { t } } = \mathrm { A v g P o o l } ( \mathrm { P a d d i n g } ( \mathcal { X } ) ) } \\ & { \mathcal { X } _ { \mathrm { s } } = \mathcal { X } - \mathcal { X } _ { \mathrm { t } } , } \end{array}
+$$
+
+where $\boldsymbol { \mathcal { X } } _ { \mathrm { s } } , \boldsymbol { \mathcal { X } } _ { \mathrm { t } } \in \mathbb { R } ^ { L \times d }$ denote the seasonal and the extracted trend-cyclical part respectively. We adopt the $\operatorname { A v g P o o l } ( \cdot )$ for moving average with the padding operation to keep the series length unchanged. We use $\mathcal { X } _ { \mathrm { s } } , \mathcal { X } _ { \mathrm { t } } = \mathrm { S e r i e s D e c o m p } ( \mathcal { X } )$ to summarize above equations, which is a model inner block.
+
+Model inputs The inputs of encoder part are the past $I$ time steps $\mathcal { X } _ { \mathrm { e n } } \in \mathbb { R } ^ { I \times d }$ . As a decomposition architecture (Figure 1), the input of Autoformer decoder contains both the seasonal part $\chi _ { \mathrm { d e s } } \in$ $\mathbb { R } ^ { ( \frac { I } { 2 } + O ) \times d }$ and trend-cyclical part $\chi _ { \mathrm { d e t } } \in \mathbb { R } ^ { ( \frac { I } { 2 } + O ) \times d }$ to be refined. Each initialization consists of two parts: the component decomposed from the latter half of encoder’s input $\mathcal { X } _ { \mathrm { e n } }$ with length $\frac { I } { 2 }$ to provide recent information, placeholders with length $O$ filled by scalars. It’s formulized as follows:
+
+$$
+\begin{array} { r l } & { \mathcal { X } _ { \mathrm { e n s } } , \mathcal { X } _ { \mathrm { e n t } } = \mathrm { S e r i e s D e c o m p } ( \mathcal { X } _ { \mathrm { e n } \frac { I } { 2 } : I } ) } \\ & { \qquad \mathcal { X } _ { \mathrm { d e s } } = \mathrm { C o n c a t } ( \mathcal { X } _ { \mathrm { e n s } } , \mathcal { X } _ { 0 } ) } \\ & { \qquad \mathcal { X } _ { \mathrm { d e t } } = \mathrm { C o n c a t } ( \mathcal { X } _ { \mathrm { e n t } } , \mathcal { X } _ { \mathrm { M e a n } } ) , } \end{array}
+$$
+
+
+Figure 1: Autoformer architecture. The encoder eliminates the long-term trend-cyclical part by series decomposition blocks (blue blocks) and focuses on seasonal patterns modeling. The decoder accumulates the trend part extracted from hidden variables progressively. The past seasonal information from encoder is utilized by the encoder-decoder Auto-Correlation (center green block in decoder).
+
+where $\chi _ { \mathrm { e n s } } , \chi _ { \mathrm { e n t } } \in \mathbb { R } ^ { \frac { I } { 2 } \times d }$ denote the seasonal and trend-cyclical parts of $\mathcal { X } _ { \mathrm { e n } }$ respectively, and $\mathcal { X } _ { 0 } , \mathcal { X } _ { \mathrm { M e a n } } \in \mathbb { R } ^ { O \times d }$ denote the placeholders filled with zero and the mean of $\mathcal { X } _ { \mathrm { e n } }$ respectively.
+
+Encoder As shown in Figure 1, the encoder focuses on the seasonal part modeling. The output of the encoder contains the past seasonal information and will be used as the cross information to help the decoder refine prediction results. Suppose we have $N$ encoder layers. The overall equations for $l$ -th encoder layer are summarized as $\mathcal { X } _ { \mathrm { e n } } ^ { \hat { l } ^ { \mathrm { ~ \tiny ~ \cdot ~ } } } = \mathrm { E n c o d e r } ( \mathcal { X } _ { \mathrm { e n } } ^ { l - 1 } )$ . Details are shown as follows:
+
+$$
+\begin{array} { r l } & { S _ { \mathrm { e n } } ^ { l , 1 } , \ l _ { - } = \mathrm { S e r i e s D e c o m p } \Big ( \mathrm { A u t o - C o r r e l a t i o n } ( \mathcal { X } _ { \mathrm { e n } } ^ { l - 1 } ) + \mathcal { X } _ { \mathrm { e n } } ^ { l - 1 } \Big ) } \\ & { S _ { \mathrm { e n } } ^ { l , 2 } , \ l _ { - } = \mathrm { S e r i e s D e c o m p } \Big ( \mathrm { F e e d F o r w a r d } ( S _ { \mathrm { e n } } ^ { l , 1 } ) + S _ { \mathrm { e n } } ^ { l , 1 } \Big ) , } \end{array}
+$$
+
+where $\underline { { { \bf \Pi } } } ^ { 6 6 } \underline { { { \bf \Pi } } } ^ { 5 9 }$ is the eliminated trend part. $\mathcal { X } _ { \mathrm { e n } } ^ { l } = S _ { \mathrm { e n } } ^ { l , 2 } , l \in \{ 1 , \cdots , N \}$ denotes the output of $l$ -th encoder layer and $\mathcal { X } _ { \mathrm { e n } } ^ { 0 }$ is the embedded $\mathcal { X } _ { \mathrm { e n } }$ . $S _ { \mathrm { e n } } ^ { l , i }$ , $i \in \{ 1 , 2 \}$ represents the seasonal component after the -th series decomposition block in the $l$ -th layer respectively. We will give detailed description of Auto-Correlation $( \cdot )$ in the next section, which can seamlessly replace the self-attention.
+
+Decoder The decoder contains two parts: the accumulation structure for trend-cyclical components and the stacked Auto-Correlation mechanism for seasonal components (Figure 1). Each decoder layer contains the inner Auto-Correlation and encoder-decoder Auto-Correlation, which can refine the prediction and utilize the past seasonal information respectively. Note that the model extracts the potential trend from the intermediate hidden variables during the decoder, allowing Autoformer to progressively refine the trend prediction and eliminate interference information for period-based dependencies discovery in Auto-Correlation. Suppose there are $M$ decoder layers. With the latent variable $\chi _ { \mathrm { e n } } ^ { N }$ from the encoder, the equations of $l$ -th decoder layer can be summarized as $\mathcal { X } _ { \mathrm { d e } } ^ { l } =$ $\mathrm { D e c o d e r } ( \mathcal { X } _ { \mathrm { d e } } ^ { l - 1 } , \mathcal { X } _ { \mathrm { e n } } ^ { N } )$ . The decoder can be formalized as follows:
+
+$$
+\begin{array} { r l } & { S _ { \mathrm { d e } } ^ { l , 1 } , \mathcal { T } _ { \mathrm { d e } } ^ { l , 1 } = \mathrm { S e r i e s D e c o m p } \left( \mathrm { A u t o - C o r r e l a t i o n } ( \mathcal { X } _ { \mathrm { d e } } ^ { l - 1 } ) + \mathcal { X } _ { \mathrm { d e } } ^ { l - 1 } \right) } \\ & { S _ { \mathrm { d e } } ^ { l , 2 } , \mathcal { T } _ { \mathrm { d e } } ^ { l , 2 } = \mathrm { S e r i e s D e c o m p } \left( \mathrm { A u t o - C o r r e l a t i o n } ( S _ { \mathrm { d e } } ^ { l , 1 } , \mathcal { X } _ { \mathrm { e n } } ^ { N } ) + S _ { \mathrm { d e } } ^ { l , 1 } \right) } \\ & { S _ { \mathrm { d e } } ^ { l , 3 } , \mathcal { T } _ { \mathrm { d e } } ^ { l , 3 } = \mathrm { S e r i e s D e c o m p } \left( \mathrm { F e e d F o r w a r d } ( S _ { \mathrm { d e } } ^ { l , 2 } ) + S _ { \mathrm { d e } } ^ { l , 2 } \right) } \\ & { \qquad \mathcal { T } _ { \mathrm { d e } } ^ { l } = \mathcal { T } _ { \mathrm { d e } } ^ { l - 1 } + \mathcal { W } _ { l , 1 } \ast \mathcal { T } _ { \mathrm { d e } } ^ { l , 1 } + \mathcal { W } _ { l , 2 } \ast \mathcal { T } _ { \mathrm { d e } } ^ { l , 2 } + \mathcal { W } _ { l , 3 } \ast \mathcal { T } _ { \mathrm { d e } } ^ { l , 3 } , } \end{array}
+$$
+
+where $\mathcal { X } _ { \mathrm { d e } } ^ { l } = { S } _ { \mathrm { d e } } ^ { l , 3 } , l \in \{ 1 , \cdots , M \}$ denotes the output of $l$ -th decoder layer. $\mathcal { X } _ { \mathrm { d e } } ^ { 0 }$ is embedded from $\mathcal { X } _ { \mathrm { d e s } }$ de de for deep transform and $\mathcal { T } _ { \mathrm { d e } } ^ { 0 } = \mathcal { X } _ { \mathrm { d e t } }$ is for accumulatio . $S _ { \mathrm { d e } } ^ { l , i } , T _ { \mathrm { d e } } ^ { l , i } , i \in \{ 1 , 2 , 3 \}$ represent the $i$ $l$ -th layer respectively. $\mathcal { W } _ { l , i } , i \in \{ 1 , 2 , 3 \}$ represents the projector for the $i$ -th extracted trend $\mathcal { T } _ { \mathrm { d e } } ^ { l , i }$ .
+
+
+Figure 2: Auto-Correlation (left) and Time Delay Aggregation (right). We utilize the Fast Fourier Transform to calculate the autocorrelation $\mathcal { R } ( \tau )$ , which reflects the time-delay similarities. Then the similar sub-processes are rolled to the same index based on selected delay $\tau$ and aggregated by $\mathcal { R } ( \tau )$ .
+
+The final prediction is the sum of the two refined decomposed components, as $\mathcal { W } _ { S } \ast \mathcal { X } _ { \mathrm { d e } } ^ { M } + \mathcal { T } _ { \mathrm { d e } } ^ { M }$ where is to project the deep transformed seasonal component to the target dimension.
+
+# 3.2 Auto-Correlation Mechanism
+
+As shown in Figure 2, we propose the Auto-Correlation mechanism with series-wise connections to expand the information utilization. Auto-Correlation discovers the period-based dependencies by calculating the series autocorrelation and aggregates similar sub-series by time delay aggregation.
+
+Period-based dependencies It is observed that the same phase position among periods naturally provides similar sub-processes. Inspired by the stochastic process theory [8, 24], for a real discretetime process $\{ \mathcal { X } _ { t } \}$ , we can obtain the autocorrelation $\mathcal { R } _ { \mathcal { X } \mathcal { X } } ( \tau )$ by the following equations:
+
+$$
+\mathcal { R } _ { \mathcal { X } \mathcal { X } } ( \tau ) = \operatorname* { l i m } _ { L \infty } \frac { 1 } { L } \sum _ { t = 1 } ^ { L } \mathcal { X } _ { t } \mathcal { X } _ { t - \tau } .
+$$
+
+$\mathcal { R } _ { \mathcal { X } \mathcal { X } } ( \tau )$ reflects the time-delay similarity between $\{ \mathcal { X } _ { t } \}$ and its $\tau$ lag series $\{ \mathcal { X } _ { t - \tau } \}$ . As shown in Figure 2, we use the autocorrelation $\mathcal { R } ( \tau )$ as the unnormalized confidence of estimated period length $\tau$ . Then, we choose the most possible $k$ period lengths $\tau _ { 1 } , \cdots , \tau _ { k }$ . The period-based dependencies are derived by the above estimated periods and can be weighted by the corresponding autocorrelation.
+
+1Time delay aggregation The period-based dependencies connect the sub-series among estimated 1periods. Thus, we present the time delay aggregation block (Figure 2), which can roll the series based on selected time delay $\tau _ { 1 } , \cdots , \tau _ { k }$ . This operation can align similar sub-series that are at the same phase position of estimated periods, which is different from the point-wise dot-product aggregation in self-attention family. Finally, we aggregate the sub-series by softmax normalized confidences.
+
+For the single head situation and time series $\mathcal { X }$ with length- $L$ , after the projector, we get query $\mathcal { Q }$ , key $\kappa$ and value $\nu$ . Thus, it can replace self-attention seamlessly. The Auto-Correlation mechanism is:
+
+$$
+\begin{array} { r l } & { \qquad \tau _ { 1 } , \cdots , \tau _ { k } = \underset { \tau \in \{ 1 , \cdots , L \} } { \mathrm { a r g } \mathrm { T o p k } } ( \mathcal { R } _ { \mathcal { Q } , \mathcal { K } } ( \tau ) ) } \\ & { \qquad \widehat { \mathcal { R } } _ { \mathcal { Q } , \mathcal { K } } ( \tau _ { 1 } ) , \cdots , \widehat { \mathcal { R } } _ { \mathcal { Q } , \mathcal { K } } ( \tau _ { k } ) = \mathrm { S o f t M a x } ( \mathcal { R } _ { \mathcal { Q } , \mathcal { K } } ( \tau _ { 1 } ) , \cdots , \mathcal { R } _ { \mathcal { Q } , \mathcal { K } } ( \tau _ { k } ) ) } \\ & { \mathrm { A u t o - C o r r e l a t i o n } ( \mathcal { Q } , \mathcal { K } , \mathcal { V } ) = \underset { i = 1 } { \overset { k } { \sum } } \mathrm { R o l l } ( \mathcal { V } , \tau _ { i } ) \widehat { \mathcal { R } } _ { \mathcal { Q } , \mathcal { K } } ( \tau _ { i } ) , } \end{array}
+$$
+
+where ar $\boldsymbol { \mathrm { \xi ^ { 2 } } } \mathrm { T o p k } ( \cdot )$ is to get the arguments of the Topk autocorrelations and let $k = \lfloor c \times \log L \rfloor$ , $c$ is a hyper-parameter. $\mathcal { R } _ { \mathcal { Q } , \kappa }$ is autocorrelation between series $\mathcal { Q }$ and $\kappa$ . $\mathrm { R o l l } ( \mathcal { X } , \tau )$ represents the operation to $\mathcal { X }$ with time delay $\tau$ , during which elements that are shifted beyond the first position are re-introduced at the last position. For the encoder-decoder Auto-Correlation (Figure 1), $\kappa , \nu$ are from the encoder $\chi _ { \mathrm { e n } } ^ { N }$ and will be resized to length- $O$ , $\mathcal { Q }$ is from the previous block of the decoder.
+
+
+Figure 3: Auto-Correlation vs. self-attention family. Full Attention [35] (a) adapts the fully connection among all time points. Sparse Attention [17, 41] (b) selects points based on the proposed similarity metrics. LogSparse Attention [20] (c) chooses points following the exponentially increasing intervals. Auto-Correlation (d) focuses on the connections of sub-series among underlying periods.
+
+For the multi-head version used in Autoformer, with hidden variables of $d _ { \mathrm { m o d e l } }$ channels, $h$ heads, the query, key and value for $i$ -th head are $\mathcal { Q } _ { i } , \mathcal { K } _ { i } , \mathcal { V } _ { i } \in \mathbb { R } ^ { L \times \frac { d _ { \mathrm { m o d e l } } } { h } }$ , $i \in \{ 1 , \cdots , h \}$ . The process is:
+
+$$
+\begin{array} { r l } & { \mathrm { M u l t i H e a d } ( \mathcal { Q } , K , \mathcal { V } ) = \mathcal { W } _ { \mathrm { o u t p u t } } * \mathrm { C o n c a t } ( \mathrm { h e a d } _ { 1 } , \cdot \cdot \cdot , \mathrm { h e a d } _ { h } ) } \\ & { \quad \quad \quad \mathrm { w h e r e ~ h e a d } _ { i } = \mathrm { A u t o - C o r r e l a t i o n } ( \mathcal { Q } _ { i } , K _ { i } , \mathcal { V } _ { i } ) . } \end{array}
+$$
+
+Efficient computation For period-based dependencies, these dependencies point to sub-processes at the same phase position of underlying periods and are inherently sparse. Here, we select the most possible delays to avoid picking the opposite phases. Because we aggregate ${ \mathcal { O } } ( \log L )$ series whose length is $L$ , the complexity of Equations 6 and 7 is $\mathcal { O } ( L \log L )$ . For the autocorrelation computation (Equation 5), given time series $\{ \mathcal { X } _ { t } \}$ , $\mathcal { R } _ { \mathcal { X } \mathcal { X } } ( \tau )$ can be calculated by Fast Fourier Transforms (FFT) based on the Wiener–Khinchin theorem [37]:
+
+$$
+\begin{array} { r l } & { \displaystyle \mathcal { S } _ { \mathcal { X } \mathcal { X } } ( f ) = \mathcal { F } \left( \mathcal { X } _ { t } \right) \mathcal { F } ^ { * } \left( \mathcal { X } _ { t } \right) = \int _ { - \infty } ^ { \infty } \mathcal { X } _ { t } e ^ { - i 2 \pi t f } \mathrm { d } t \overline { { \int _ { - \infty } ^ { \infty } \mathcal { X } _ { t } e ^ { - i 2 \pi t f } \mathrm { d } t } } } \\ & { \displaystyle \mathcal { R } _ { \mathcal { X } \mathcal { X } } ( \tau ) = \mathcal { F } ^ { - 1 } \left( S _ { \mathcal { X } \mathcal { X } } ( f ) \right) = \int _ { - \infty } ^ { \infty } S _ { \mathcal { X } \mathcal { X } } ( f ) e ^ { i 2 \pi f \tau } \mathrm { d } f , } \end{array}
+$$
+
+where $\tau \in \{ 1 , \cdots , L \}$ , $\mathcal { F }$ denotes the FFT and ${ \mathcal { F } } ^ { - 1 }$ is its inverse. $^ *$ denotes the conjugate operation and $\mathcal { S } _ { \mathcal { X X } } ( f )$ is in the frequency domain. Note that the series autocorrelation of all lags in $\{ 1 , \cdots , L \}$ can be calculated at once by FFT. Thus, Auto-Correlation achieves the $\mathcal { O } ( L \log L )$ complexity.
+
+Auto-Correlation vs. self-attention family Different from the point-wise self-attention family, Auto-Correlation presents the series-wise connections (Figure 3). Concretely, for the temporal dependencies, we find the dependencies among sub-series based on the periodicity. In contrast, the self-attention family only calculates the relation between scattered points. Though some selfattentions [20, 41] consider the local information, they only utilize this to help point-wise dependencies discovery. For the information aggregation, we adopt the time delay block to aggregate the similar sub-series from underlying periods. In contrast, self-attentions aggregate the selected points by dot-product. Benefiting from the inherent sparsity and sub-series-level representation aggregation, Auto-Correlation can simultaneously benefit the computation efficiency and information utilization.
+
+# 4 Experiments
+
+We extensively evaluate the proposed Autoformer on six real-world benchmarks, covering five mainstream time series forecasting applications: energy, traffic, economics, weather and disease.
+
+Datasets Here is a description of the six experiment datasets: (1) ETT [41] dataset contains the data collected from electricity transformers, including load and oil temperature that are recorded every
+
+Table 1: Multivariate results with different prediction lengths $O \in \{ 9 6 , 1 9 2 , 3 3 6 , 7 2 0 \}$ . We set the input length $I$ as 36 for ILI and 96 for the others. A lower MSE or MAE indicates a better prediction.
+
+
Models Autoformer
Informer[41]
LogTrans[20]
Reformer[17]
LSTNet[19]
LSTM[13]
TCN[3]
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE MAE
MSE MAE
MSE
MAE
T
96 192 336
0.255 0.281 0.339
0.339 0.340
0.365 0.533
0.453 0.563
0.768 0.989
0.642 0.757
0.658
0.619
3.142 3.154
1.365 1.369
2.041 2.249
1.073 1.112
3.041 3.072
1.330 1.339
1.078 0.827 1.549
720 96
0.422 0.201
0.372 0.419
1.363 3.379
0.887 1.388
3.048
1.334
0.872 1.328
2.631
0.972 1.242
3.160 3.171
1.369 1.368 2.720
2.568
1.238 1.287
3.105 3.135
1.348 1.354
erneera
192 336
0.222
0.317 0.334
0.274 0.296
0.368 0.386
0.258 0.266
0.357 0.368
0.312 0.348
0.402 0.433
0.680 0.645 0.725
0.676
0.375 0.442
0.437 0.473
0.985 0.996
0.813 0.821
720
0.231 0.254
0.338 0.361
0.300 0.373
0.394 0.439
0.280 0.283
0.380 0.376
0.350 0.340
0.433 0.420
0.828 0.957
0.727 0.811
0.439 0.980
0.473 0.814
1.000 1.438
0.824 0.784
uepeg
96 192
0.197
0.323
0.847
0.752
0.968
0.812
1.065
0.829
1.551
1.058 1.453
1.049 3.004
1.432
336
0.300 0.509
0.369 0.524
1.204
0.895
1.040
0.851
1.188
0.906
1.477
1.028
1.846
1.179
3.048
1.444
720
1.447
0.941
1.672 2.478
1.036 1.310
1.659 1.941
1.081 1.127
1.357 1.510
0.976 1.016
1.507 2.285
1.031 1.243
2.136 2.984
1.231
3.113
1.459
96
0.613
0.388
0.719
0.391
0.684
0.384
0.732
0.423
1.427
3.150
1.458
[Tjeee
192
0.616
0.382
0.696
0.379
0.685
0.390
0.733
0.420
1.107 1.157
0.685 0.706
0.843 0.847
0.453 0.453
1.438 1.463
0.784 0.794
336 720
0.622
0.337
0.777
0.420
0.733
0.408
0.742
0.420
1.216
0.730
0.853
0.455
1.479
0.799
0.660
0.408
0.864
0.472
0.717
0.396
0.755
0.423
1.481
0.805
1.500
0.805
1.499
0.804
waaeee
96
0.266
0.336
0.300
0.384
0.458
0.490
0.689
0.596
0.594
0.587
0.369
0.406
0.615
0.589
192 336
0.307
0.367
0.598
0.544
0.658
0.589
0.752
0.638
0.560
0.565
0.416
0.435
0.629
0.600
720
0.359
0.395
0.578
0.523
0.797
0.652
0.639
0.596
0.597
0.587
0.455
0.454
0.639
0.608
0.419
0.428
1.059
0.741
0.869
0.675
1.130
0.792
0.618
0.599
0.535
0.520
0.639
0.610
24
3.483
5.764
36
1.287
1.677
4.480
1.444
4.400
1.382
6.026
1.770
5.914
1.734
6.624
1.830
Ⅱ
48
3.103
1.148
4.755
1.467
4.799
1.467
4.783
1.448
5.340
1.668
6.631
1.845
6.858
1.879
2.669
1.085
4.763
1.469
4.800
1.468
4.832
1.465
6.080
1.787
6.736
1.857
6.968
60
1.125
5.264
1.564
5.278
1.560
4.882
1.483
5.548
1.720 6.870
1.879
7.127
1.892 1.918
2.770
+
+\* ETT means the ETTm2. See supplementary materials for the full benchmark of ETTh1, ETTh2, ETTm1.
+
+15 minutes between July 2016 and July 2018. (2) Electricity1 dataset contains the hourly electricity consumption of 321 customers from 2012 to 2014. (3) Exchange [19] records the daily exchange rates of eight different countries ranging from 1990 to 2016. (4) Traffic2 is a collection of hourly data from California Department of Transportation, which describes the road occupancy rates measured by different sensors on San Francisco Bay area freeways. (5) Weather3 is recorded every 10 minutes for 2020 whole year, which contains 21 meteorological indicators, such as air temperature, humidity, etc. (6) $I L I ^ { 4 }$ includes the weekly recorded influenza-like illness (ILI) patients data from Centers for Disease Control and Prevention of the United States between 2002 and 2021, which describes the ratio of patients seen with ILI and the total number of the patients. We follow standard protocol and split all datasets into training, validation and test set in chronological order by the ratio of 6:2:2 for the ETT dataset and 7:1:2 for the other datasets.
+
+Implementation details Our method is trained with L2 loss, using the ADAM [16] optimizer with an initial learning rate of $1 0 ^ { - 4 }$ . Batch size is set to 32. The training process is early stopped within 10 epochs. All experiments are repeated three times, implemented in PyTorch [25] and conducted on a single NVIDIA TITAN RTX 24GB GPUs. The hyper-parameter $c$ of Auto-Correlation is in the range of 1 to 3 to trade off performance and efficiency. See supplementary materials for standard deviations and sensitivity analysis. Autoformer contains 2 encoder layers and 1 decoder layer.
+
+Baselines We include 10 baseline methods. For the multivariate setting, we select three latest stateof-the-art transformer-based models: Informer [41], Reformer [17], LogTrans [20], two RNN-based models: LSTNet [19], LSTM [13] and CNN-based TCN [3] as baselines. For the univariate setting, we include more competitive baselines: N-BEATS[23], DeepAR [28], Prophet [33] and ARMIA [1].
+
+Table 2: Univariate results with different prediction lengths $O \in \{ 9 6 , 1 9 2 , 3 3 6 , 7 2 0 \}$ on typical datasets. We set the input length $I$ as 96. A lower MSE or MAE indicates a better prediction.
+
+
+
+# 4.1 Main Results
+
+To compare performances under different future horizons, we fix the input length and evaluate models with a wide range of prediction lengths: 96, 192, 336, 720. This setting precisely meets the definition of long-term forecasting. Here are results on both the multivariate and univariate settings.
+
+Multivariate results As for the multivariate setting, Autoformer achieves the consistent state-ofthe-art performance in all benchmarks and all prediction length settings (Table 1). Especially, under the input-96-predict-336 setting, compared to previous state-of-the-art results, Autoformer gives $74 \%$ $1 . 3 3 4 { } 0 . 3 3 9 _ { . }$ ) MSE reduction in ETT, $18 \%$ $0 . 2 8 0 { } 0 . 2 3 1$ ) in Electricity, $61 \%$ ( $1 . 3 5 7 { } 0 . 5 0 9 \rangle$ in Exchange, $15 \%$ $( 0 . 7 3 3 { } 0 . 6 2 2 )$ in Traffic and $21 \%$ $( 0 . 4 5 5 { } 0 . 3 5 9 )$ ) in Weather. For the input36-predict-60 setting of ILI, Autoformer makes $43 \%$ $4 . 8 8 2 { } 2 . 7 7 0$ ) MSE reduction. Overall, Autoformer yields a $38 \%$ averaged MSE reduction among above settings. Note that Autoformer still provides remarkable improvements in the Exchange dataset that is without obvious periodicity. See supplementary materials for detailed showcases. Besides, we can also find that the performance of Autoformer changes quite steadily as the prediction length $O$ increases. It means that Autoformer retains better long-term robustness, which is meaningful for real-world practical applications, such as weather early warning and long-term energy consumption planning.
+
+Univariate results We list the univariate results of two typical datasets in Table 2. Under the comparison with extensive baselines, our Autoformer still achieves state-of-the-art performance for the long-term forecasting tasks. In particular, for the input-96-predict-336 setting, our model achieves $14 \%$ $0 . 1 8 0 { } 0 . 1 4 5$ MSE reduction on the ETT dataset with obvious periodicity. For the Exchange dataset without obvious periodicity, Autoformer surpasses other baselines by $17 \%$ $( 0 . 6 1 1 { } 0 . 5 0 8 )$ and shows greater long-term forecasting capacity. Also, we find that ARIMA [1] performs best in the input-96-predict-96 setting of the Exchange dataset but fails in the long-term setting. This situation of ARIMA can be benefited from its inherent capacity for non-stationary economic data but is limited by the intricate temporal patterns of real-world series.
+
+# 4.2 Ablation studies
+
+Table 3: Ablation of decomposition in multivariate ETT with MSE metric. Ours adopts our progressive architecture into other models. Sep employs two models to forecast pre-decomposed seasonal and trend-cyclical components separately. Promotion is the MSE reduction compared to Origin.
+
+
Input-96
Transformer[35]
Informer[41]
LogTrans[17]
Reformer[20]
Promotion
Predict-O| Origin
Sep
Ours
Origin
Sep
Ours
Origin
Sep
Ours
Origin Sep
Ours
Sep
Ours
96
0.604
0.311
0.204
0.365
0.490
0.354
0.768
0.862
0.231
0.658
0.445
0.218
0.069
0.347
192
1.060 0.760(
0.266
0.533
0.658
0.432
0.989
0.533
0.378
1.078
0.510 0.336
0.300 0.562
336
1.413
0.665
0.375
1.363
1.469
0.481
1.334
0.762
0.362
1.549
1.028
0.366
0.434
1.019
720
2.672
3.200
0.537
3.379
2.766
0.822
3.048
2.601
0.539
2.631
2.845
0.502
0.079 2.332
+
+Decomposition architecture With our proposed progressive decomposition architecture, other models can gain consistent promotion, especially as the prediction length $O$ increases (Table 3). This verifies that our method can generalize to other models and release the capacity of other dependencies learning mechanisms, alleviate the distraction caused by intricate patterns. Besides, our architecture outperforms the pre-processing, although the latter employs a bigger model and more parameters. Especially, pre-decomposing may even bring negative effect because it neglects the interaction of components during long-term future, such as Transformer [35] predict-720, Informer [41] predict-336.
+
+Auto-Correlation vs. self-attention family As shown in Table 4, our proposed Auto-Correlation achieves the best performance under various input- ${ \mathbf { \nabla } } J$ -predict- $O$ settings, which verifies the effectiveness of series-wise connections comparing to point-wise self-attentions (Figure 3). Furthermore, we can also observe that Auto-Correlation is memory efficiency from the last column of Table 4, which can be used in long sequence forecasting, such as input-336-predict-1440.
+
+Table 4: Comparison of Auto-Correlation and self-attention in the multivariate ETT. We replace the Auto-Correlation in Autoformer with different self-attentions. The “-” indicates the out-of-memory.
+
+
Input Length I Prediction Length O
96
192
336
336
720
1440
336
720
1440
336
720
1440
Auto- Correlation
MSE MAE
0.339 0.372
0.422 0.419
0.555 0.496
0.355 0.392
0.429 0.430
0.503 0.484
0.361 0.406
0.425 0.440
0.574 0.534
Full Attention[35]
MSE MAE
0.375 0.425
0.537 0.502
0.667 0.589
0.450 0.470
0.554 0.533
- -
0.501 0.485
0.647 0.491
1 =
LogSparse Attention[20]
MSE MAE
0.362 0.413
0.539 0.522
0.582 0.529
0.420 0.450
0.552 0.513
0.958 0.736
0.474 0.474
0.601 0.524
- =
LSH Attention[17]
MSE MAE
0.366 0.404
0.502 0.475
0.663 0.567
0.407 0.421
0.636 0.571
1.069 0.756
0.442 0.476
0.615 0.532
1 -
ProbSparse Attention[41]
MSE MAE
0.481 0.472
0.822 0.559
0.715 0.586
0.404 0.425
1.148 0.654
0.732 0.602
0.417 0.434
0.631 0.528
1.133 0.691
+
+# 4.3 Model Analysis
+
+Time series decomposition As shown in Figure 4, without our series decomposition block, the forecasting model cannot capture the increasing trend and peaks of the seasonal part. By adding the series decomposition blocks, Autoformer can aggregate and refine the trend-cyclical part from series progressively. This design also facilitates the learning of the seasonal part, especially the peaks and troughs. This verifies the necessity of our proposed progressive decomposition architecture.
+
+
+Figure 4: Visualization of learned seasonal gradually add the decomposition blocks in $\mathcal { X } _ { \mathrm { d e } } ^ { M }$ and trend-cyclical der from left to rig $\mathcal { T } _ { \mathrm { d e } } ^ { M }$ of the last decoder layer. Wehis case is from ETT dataset under input-96-predict-720 setting. For clearness, we add the linear growth to raw data additionally.
+
+Dependencies learning The marked time delay sizes in Figure 5(a) indicate the most likely periods. Our learned periodicity can guide the model to aggregate the sub-series from the same or neighbor phase of periods by $\mathrm { R o l l } ( \mathcal { X } , \tau _ { i } )$ , $i \in \{ 1 , \cdots , 6 \}$ . For the last time step (declining stage), AutoCorrelation fully utilizes all similar sub-series without omissions or errors compared to self-attentions. This verifies that Autoformer can discover the relevant information more sufficiently and precisely.
+
+Complex seasonality modeling As shown in Figure 6, the lags that Autoformer learns from deep representations can indicate the real seasonality of raw series. For example, the learned lags of the daily recorded Exchange dataset present the monthly, quarterly and yearly periods (Figure 6 (b)). For the hourly recorded Traffic dataset (Figure 6 (c)), the learned lags show the intervals as 24-hours and 168-hours, which match the daily and weekly periods of real-world scenarios. These results show that Autoformer can capture the complex seasonalities of real-world series from deep representations and further provide a human-interpretable prediction.
+
+
+Figure 5: Visualization of learned dependencies. For clearness, we select the top-6 time delay sizes $\tau _ { 1 } , \cdots , \tau _ { 6 }$ of Auto-Correlation and mark them in raw series (red lines). For self-attentions, top-6 similar points with respect to the last time step (red stars) are also marked by orange points.
+
+
+Figure 6: Statistics of learned lags. For each time series in the test set, we count the top 10 lags learned by decoder for the input-96-predict-336 task. Figure (a)-(d) are the density histograms.
+
+Efficiency analysis We compare the running memory and time among Auto-Correlation-based and self-attention-based models (Figure 7) during the training phase. The proposed Autoformer shows $\mathcal { O } ( L \log L )$ complexity in both memory and time and achieves better long-term sequences efficiency.
+
+
+Figure 7: Efficiency Analysis. For memory, we replace Auto-Correlation with self-attention family in Autoformer and record the memory with input 96. For running time, we run the Auto-Correlation or self-attentions $1 0 ^ { 3 }$ times to get the execution time per step. The output length increases exponentially.
+
+# 5 Conclusions
+
+This paper studies the long-term forecasting problem of time series, which is a pressing demand for real-world applications. However, the intricate temporal patterns prevent the model from learning reliable dependencies. We propose the Autoformer as a decomposition architecture by embedding the series decomposition block as an inner operator, which can progressively aggregate the longterm trend part from intermediate prediction. Besides, we design an efficient Auto-Correlation mechanism to conduct dependencies discovery and information aggregation at the series level, which contrasts clearly from the previous self-attention family. Autoformer can naturally achieve $\mathcal { O } ( L \log L )$ complexity and yield consistent state-of-the-art performance in extensive real-world datasets.
+
+# Acknowledgments and Disclosure of Funding
+
+This work was supported by the National Natural Science Foundation of China under Grants 62022050 and 62021002, Beijing Nova Program under Grant Z201100006820041, China’s Ministry of Industry and Information Technology, the MOE Innovation Plan and the BNRist Innovation Fund.
+
+# References
+
+[1] O. Anderson and M. Kendall. Time-series. 2nd edn. J. R. Stat. Soc. (Series D), 1976. [2] Reza Asadi and Amelia C Regan. A spatio-temporal decomposition based deep neural network for time series forecasting. Appl. Soft Comput., 2020. [3] 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. [4] Anastasia Borovykh, Sander Bohte, and Cornelis W Oosterlee. Conditional time series forecasting with convolutional neural networks. arXiv preprint arXiv:1703.04691, 2017. [5] G. E. P. Box and Gwilym M. Jenkins. Time series analysis, forecasting and control. 1970. [6] George EP Box and Gwilym M Jenkins. Some recent advances in forecasting and control. J. R. Stat. Soc. (Series-C), 1968.
+[7] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In NeurIPS, 2020. [8] Chris Chatfield. The analysis of time series: an introduction. 1981. [9] Renyi Chen and Molei Tao. Data-driven prediction of general hamiltonian dynamics via learning exactlysymplectic maps. ICML, 2021.
+[10] Emmanuel de Bézenac, Syama Sundar Rangapuram, Konstantinos Benidis, Michael Bohlke-Schneider, Richard Kurle, Lorenzo Stella, Hilaf Hasson, Patrick Gallinari, and Tim Januschowski. Normalizing kalman filters for multivariate time series analysis. In NeurIPS, 2020.
+[11] J. Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
+[12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
+[13] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Comput., 1997.
+[14] Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Ian Simon, Curtis Hawthorne, Noam Shazeer, Andrew M. Dai, Matthew D. Hoffman, Monica Dinculescu, and Douglas Eck. Music transformer. In ICLR, 2019.
+[15] Rob J Hyndman and George Athanasopoulos. Forecasting: principles and practice. 2018.
+[16] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+[17] Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In ICLR, 2020.
+[18] Richard Kurle, Syama Sundar Rangapuram, Emmanuel de Bézenac, Stephan Günnemann, and Jan Gasthaus. Deep rao-blackwellised particle filters for time series forecasting. In NeurIPS, 2020.
+[19] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporal patterns with deep neural networks. In SIGIR, 2018.
+[20] Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In NeurIPS, 2019.
+[21] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021.
+[22] Danielle C Maddix, Yuyang Wang, and Alex Smola. Deep factors with gaussian processes for forecasting. arXiv preprint arXiv:1812.00098, 2018.
+[23] Boris N Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio. N-BEATS: Neural basis expansion analysis for interpretable time series forecasting. ICLR, 2019.
+[24] Athanasios Papoulis and H Saunders. Probability, random variables and stochastic processes. 1989.
+[25] Adam Paszke, S. Gross, Francisco Massa, A. Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Z. Lin, N. Gimelshein, L. Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.
+[26] Syama Sundar Rangapuram, Matthias W Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and Tim Januschowski. Deep state space models for time series forecasting. In NeurIPS, 2018.
+[27] Cleveland Robert, C William, and Terpenning Irma. STL: A seasonal-trend decomposition procedure based on loess. J. Off. Stat, 1990.
+[28] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. Int. J. Forecast., 2020.
+[29] Rajat Sen, Hsiang-Fu Yu, and Inderjit S. Dhillon. Think globally, act locally: A deep neural network approach to high-dimensional time series forecasting. In NeurIPS, 2019.
+[30] Shun-Yao Shih, Fan-Keng Sun, and Hung-yi Lee. Temporal pattern attention for multivariate time series forecasting. Mach. Learn., 2019.
+[31] Huan Song, Deepta Rajan, Jayaraman Thiagarajan, and Andreas Spanias. Attend and diagnose: Clinical time series analysis using attention models. In AAAI, 2018.
+[32] Antti Sorjamaa, Jin Hao, Nima Reyhani, Yongnan Ji, and Amaury Lendasse. Methodology for long-term prediction of time series. Neurocomputing, 2007.
+[33] Sean J Taylor and Benjamin Letham. Forecasting at scale. Am. Stat., 2018.
+[34] Aäron van den Oord, S. Dieleman, H. Zen, K. Simonyan, Oriol Vinyals, A. Graves, Nal Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. In SSW, 2016.
+[35] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
+[36] Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multi-horizon quantile recurrent forecaster. NeurIPS, 2017.
+[37] Norbert Wiener. Generalized harmonic analysis. Acta Math, 1930.
+[38] Sifan Wu, Xi Xiao, Qianggang Ding, Peilin Zhao, Ying Wei, and Junzhou Huang. Adversarial sparse transformer for time series forecasting. In NeurIPS, 2020.
+[39] Q. Yao, D. Song, H. Chen, C. Wei, and G. W. Cottrell. A dual-stage attention-based recurrent neural network for time series prediction. In IJCAI, 2017.
+[40] Rose Yu, Stephan Zheng, Anima Anandkumar, and Yisong Yue. Long-term forecasting using tensor-train rnns. arXiv preprint arXiv:1711.00073, 2017.
+[41] Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In AAAI, 2021.
\ No newline at end of file
diff --git a/md/train/I6NRcao1w-X/I6NRcao1w-X.md b/md/train/I6NRcao1w-X/I6NRcao1w-X.md
new file mode 100644
index 0000000000000000000000000000000000000000..4bb9c71eec5030110219f7a27487edb314f9eb83
--- /dev/null
+++ b/md/train/I6NRcao1w-X/I6NRcao1w-X.md
@@ -0,0 +1,405 @@
+# ROBUST REINFORCEMENT LEARNING USING ADVERSARIAL POPULATIONS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Reinforcement Learning (RL) is an effective tool for controller design but can struggle with issues of robustness, failing catastrophically when the underlying system dynamics are perturbed. The Robust RL formulation tackles this by adding worst-case adversarial noise to the dynamics and constructing the noise distribution as the solution to a zero-sum minimax game. However, existing work on learning solutions to the Robust RL formulation has primarily focused on training a single RL agent against a single adversary. In this work, we demonstrate that using a single adversary does not consistently yield robustness to dynamics variations under standard parametrizations of the adversary; the resulting policy is highly exploitable by new adversaries. We propose a population-based augmentation to the Robust RL formulation in which we randomly initialize a population of adversaries and sample from the population uniformly during training. We empirically validate across robotics benchmarks that the use of an adversarial population results in a less exploitable, more robust policy. Finally, we demonstrate that this approach provides comparable robustness and generalization as domain randomization on these benchmarks while avoiding a ubiquitous domain randomization failure mode.
+
+# 1 INTRODUCTION
+
+Developing controllers that work effectively across a wide range of potential deployment environments is one of the core challenges in engineering. The complexity of the physical world means that the models used to design controllers are often inaccurate. Optimization based control design approaches, such as reinforcement learning (RL), have no notion of model inaccuracy and can lead to controllers that fail catastrophically under mismatch. In this work, we aim to demonstrate an effective method for training reinforcement learning policies that are robust to model inaccuracy by designing controllers that are effective in the presence of worst-case adversarial noise in the dynamics.
+
+An easily automated approach to inducing robustness is to formulate the problem as a zero-sum game and learn an adversary that perturbs the transition dynamics (Tessler et al., 2019; Kamalaruban et al., 2020; Pinto et al., 2017). If a global Nash equilibrium of this problem is found, then that equilibrium provides a lower bound on the performance of the policy under some bounded set of perturbations. Besides the benefit of removing user design once the perturbation mechanism is specified, this approach is maximally conservative, which is useful for safety critical applications.
+
+However, the literature on learning an adversary predominantly uses a single, stochastic adversary. This raises a puzzling question: the zero-sum game does not necessarily have any pure Nash equilibria (see Appendix C in Tessler et al. (2019)) but the existing robust RL literature mostly appears to attempt to solve for pure Nash equilibria. That is, the most general form of the minimax problem searches over distributions of adversary and agent policies, however, this problem is approximated in the literature by a search for a single agent-adversary pair. We contend that this reduction to a single adversary approach can sometimes fail to result in improved robustness under standard parametrizations of the adversary policy.
+
+The following example provides some intuition for why using a single adversary can decrease robustness. Consider a robot trying to learn to walk east-wards while an adversary outputs a force representing wind coming from the north or the south. For a fixed, deterministic adversary the agent knows that the wind will come from either south or north and can simply apply a counteracting force at each state. Once the adversary is removed, the robot will still apply the compensatory forces and possibly become unstable. Stochastic Gaussian policies (ubiquitous in continuous control) offer little improvement: they cannot represent multi-modal perturbations. Under these standard policy parametrizations, we cannot use an adversary to endow the agent with a prior that a strong wind could persistently blow either north or south. This leaves the agent exploitable to this class of perturbations.
+
+The use of a single adversary in the robustness literature is in contrast to the multi-player game literature. In multi-player games, large sets of adversaries are used to ensure that an agent cannot easily be exploited (Vinyals et al., 2019; Czarnecki et al., 2020; Brown & Sandholm, 2019). Drawing inspiration from this literature, we introduce RAP (Robustness via Adversary Populations): a randomly initialized population of adversaries that we sample from at each rollout and train alongside the agent. Returning to our example of a robot perturbed by wind, if the robot learns to cancel the north wind effectively, then that opens a niche for an adversary to exploit by applying forces in another direction. With a population, we can endow the robot with the prior that a strong wind could come from either direction and that it must walk carefully to avoid being toppled over.
+
+Our contributions are as follows:
+
+• Using a set of continuous robotics control tasks, we provide evidence that a single adversary does not have a consistent positive impact on the robustness of an RL policy while the use of an adversary population provides improved robustness across all considered examples. We investigate the source of the robustness and show that the single adversary policy is exploitable by new adversaries whereas policies trained with RAP are robust to new adversaries. • We demonstrate that adversary populations provide comparable robustness to domain randomization while avoiding potential failure modes of domain randomization.
+
+# 2 RELATED WORK
+
+This work builds upon robust control (Zhou & Doyle, 1998), a branch of control theory focused on finding optimal controllers under worst-case perturbations of the system dynamics. The Robust Markov Decision Process (R-MDP) formulation extends this worst-case model uncertainty to uncertainty sets on the transition dynamics of an MDP and demonstrates that computationally tractable solutions exist for small, tabular MDPs (Nilim & El Ghaoui, 2005; Lim et al., 2013). For larger or continuous MDPs, one successful approach has been to use function approximation to compute approximate solutions to the R-MDP problem (Tamar et al., 2014).
+
+One prominent variant of the R-MDP literature is to interpret the perturbations as an adversary and attempt to learn the distribution of the perturbation under a minimax objective. Two variants of this idea that tie in closely to our work are Robust Adversarial Reinforcement Learning (RARL)(Pinto et al., 2017) and Noisy Robust Markov Decision Processes (NR-MDP) (Tessler et al., 2019) which differ in how they parametrize the adversaries: RARL picks out specific robot joints that the adversary acts on while NR-MDP adds the adversary action to the agent action. Both of these works attempt to find an equilibrium of the minimax objective using a single adversary; in contrast our work uses a large set of adversaries and shows improved robustness relative to a single adversary.
+
+A strong alternative to the minimax objective, domain randomization, asks a designer to explicitly define a distribution over environments that the agent should be robust to. For example, (Peng et al., 2018) varies simulator parameters to train a robot to robustly push a puck to a target location in the real world; (Antonova et al., 2017) adds noise to friction and actions to transfer an object pivoting policy directly from simulation to a Baxter robot. Additionally, domain randomization has been successfully used to build accurate object detectors solely from simulated data (Tobin et al., 2017) and to zero-shot transfer a quadcopter flight policy from simulation (Sadeghi & Levine, 2016).
+
+The use of population based training is a standard technique in multi-agent settings. Alphastar, the grandmaster-level Starcraft bot, uses a population of "exploiter" agents that fine-tune against the bot to prevent it from developing exploitable strategies (Vinyals et al., 2019). (Czarnecki et al., 2020) establishes a set of sufficient geometric conditions on games under which the use of multiple adversaries will ensure gradual improvement in the strength of the agent policy. They empirically demonstrate that learning in games can often fail to converge without populations. Finally, Active Domain Randomization (Mehta et al., 2019) is a very close approach to ours, as they use a population of adversaries to select domain randomization parameters whereas we use a population of adversaries to directly perturb the agent actions. However, they explicitly induce diversity using a repulsive term and use a discriminator to generate the reward.
+
+# 3 BACKGROUND
+
+In this work we use the framework of a multi-agent, finite-horizon, discounted, Markov Decision Process (MDP) (Puterman, 1990) defined by a tuple $\langle A _ { \mathrm { a g e n t } } \times A _ { \mathrm { a d v e r s a r y } } , S , \mathcal { T } , r , \gamma \rangle$ . Here $A _ { \mathrm { a g e n t } }$ is the set of actions for the agent, $A _ { \mathrm { a d v e r s a r y } }$ is the set of actions for the adversary, $S$ is a set of states, $\mathcal { T } : A _ { \mathrm { a g e n t } } \times A _ { \mathrm { a d v e r s a r y } } \times S \to \Delta ( S )$ is a transition function, $r : A _ { \mathrm { a g e n t } } \times A _ { \mathrm { a d v e r s a r y } } \times S \mathbb { R }$ is a reward function and $\gamma$ is a discount factor. $S$ is shared between the adversaries as they share a state-space with the agent. The goal for a given MDP is to find a policy $\pi _ { \theta }$ parametrized by $\theta$ that maximizes the expected cumulative discounted reward $\begin{array} { r } { J ^ { \theta } = \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } ) | \pi _ { \theta } \right] } \end{array}$ . The conditional in this expression is a short-hand to indicate that the actions in the MDP are sampled via $a _ { t } \sim \pi _ { \theta } ( s _ { t } , a _ { t - 1 } )$ . We denote the agent policy parametrized by weights $\theta$ as $\pi _ { \theta }$ and the policy of adversary $i$ as $\bar { \pi } _ { \phi _ { i } }$ . Actions sampled from the adversary policy $\bar { \pi } _ { \phi _ { i } }$ will be written as $\bar { a } _ { t } ^ { i }$ . We use $\xi$ to denote the parametrization of the system dynamics (e.g. different values of friction, mass, wind, etc.) and the system dynamics for a given state and action as $s _ { t + 1 } \sim f _ { \xi } ( s _ { t } , a _ { t } )$ .
+
+# 3.1 BASELINES
+
+Here we outline prior work and the approaches that will be compared with RAP. Our baselines consist of a single adversary and domain randomization.
+
+# 3.1.1 SINGLE MINIMAX ADVERSARY
+
+Our adversary formulation uses the Noisy Action Robust MDP (Tessler et al., 2019) in which the adversary adds its actions onto the agent actions. The objective is
+
+$$
+\begin{array} { r l } & { \underset { \theta } { \operatorname* { m a x } } \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } + \alpha \bar { a _ { t } } ) | \pi _ { \theta } , \ \bar { \pi } _ { \phi } \right] } \\ & { \underset { \phi } { \operatorname* { m i n } } \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } + \alpha \bar { a _ { t } } ) | \pi _ { \theta } , \ \bar { \pi } _ { \phi } \right] } \end{array}
+$$
+
+where $\alpha$ is a hyperparameter controlling the adversary strength. This is a game in which the adversary and agent play simultaneously. We note an important restriction inherent to this adversarial model. Since the adversary is only able to attack the agent through the actions, there is a restricted class of dynamical systems that it can represent; this set of dynamical systems may not necessarily align with the set of dynamical systems that the agent may be tested in. This is a restriction caused by the choice of adversarial perturbation and could be alleviated by using different adversarial parametrizations e.g. perturbing the transition function directly.
+
+# 3.1.2 DYNAMICS RANDOMIZATION
+
+Domain randomization is the setting in which the user specifies a set of environments which the agent should be robust to. This allows the user to directly encode knowledge about the likely deviations between training and testing domains. For example, the user may believe that friction is hard to measure precisely and wants to ensure that their agent is robust to variations in friction; they then specify that the agent will be trained with a wide range of possible friction values. We use $\xi$ to denote some vector that parametrizes the set of training environments (e.g. friction, masses, system dynamics, etc.). We denote the domain over which $\xi$ is drawn from as $\Xi$ and use ${ \mathcal { P } } \left( { \Xi } \right)$ to denote some probability distribution over $\xi$ . The domain randomization objective is
+
+$$
+\begin{array} { r l } & { \underset { \theta } { \operatorname* { m a x } } \mathbb { E } _ { \xi \sim \mathcal { P } ( \Xi ) } \left[ \mathbb { E } _ { s _ { t + 1 } \sim f _ { \xi } ( s _ { t } , a _ { t } ) } \left[ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } ) | \pi _ { \theta } \right] \right] } \\ & { \quad \quad \quad \quad s _ { t + 1 } \sim f _ { \xi } ( s _ { t } , a _ { t } ) } \\ & { \quad \quad \quad \quad a _ { t } \sim \pi _ { \theta } ( s _ { t } ) } \end{array}
+$$
+
+Here the goal is to find an agent that performs well on average across the distribution of training environment. Most commonly, and in this work, the parameters $\xi$ are sampled uniformly over $\Xi$ .
+
+# 4 RAP: ROBUSTNESS VIA ADVERSARY POPULATIONS
+
+RAP extends the minimax objective with a population based approach. Instead of a single adversary, at each rollout we will sample uniformly from a population of adversaries. By using a population, the agent is forced to be robust to a wide variety of potential perturbations rather than a single perturbation. If the agent begins to overfit to any one adversary, this opens up a potential niche for another adversary to exploit. For problems with only one failure mode, we expect the adversaries to all come out identical to the minimax adversary, but as the number of failure modes increases the adversaries should begin to diversify to exploit the agent. To induce this diversity, we will rely on randomness in the gradient estimates and randomness in the initializations of the adversary networks rather than any explicit term that induces diversity.
+
+Denoting $\bar { \pi } _ { \phi _ { i } }$ as the $i$ -th adversary and $i \sim U ( 1 , n )$ as the discrete uniform distribution defined on 1 through n, the objective becomes
+
+$$
+\cdot
+$$
+
+For a single adversary, this is equivalent to the minimax adversary described in Sec. 3.1.1. This is a game in which the adversary and agent play simultaneously.
+
+We will optimize this objective by converting the problem into the equivalent zero-sum game. At the start of each rollout, we will sample an adversary index from the uniform distribution and collect a trajectory using the agent and the selected adversary. For notational simplicity, we assume the trajectory is of length T and that adversary $i$ will participate in $J _ { i }$ total trajectories while, since the agent participates in every rollout, the agent will receive J total trajectories. We denote the j-th collected trajectory for the agent as τj $\mathbf { \Phi } = \left( s _ { 0 } , a _ { 0 } , r _ { 0 } , s _ { 1 } \right) \times \cdots \times \left( s _ { M } , a _ { M } , r _ { M } , s _ { M + 1 } \right)$ and the associated trajectory for adversary $i$ as $\tau _ { j } ^ { i } = ( s _ { 0 } , a _ { 0 } , - r _ { 0 } , s _ { 1 } ) \times \cdot \cdot \cdot \times ( s _ { M } , a _ { M } , - r _ { M } ,$ sM ). Note that the adversary reward is simply the negative of the agent reward. We will use Proximal Policy Optimization (Schulman et al., 2017) (PPO) to update our policies. We caution that we have overloaded notation slightly here and for adversary $i$ , $\tau _ { j = 1 : J _ { i } } ^ { i }$ refers only to the trajectories in which the adversary was selected: adversaries will only be updated using trajectories where they were active.
+
+At the end of a training iteration, we update all our policies using gradient descent. The algorithm is summarized below:
+
+Initialize $\theta , \phi _ { 1 } \cdots \phi _ { n }$ using Xavier initialization (Glorot & Bengio, 2010);
+while not converged do for rollout $j { = } l { \ldots } J$ do sample adversary $i \sim U ( 1 , n )$ ; run policies $\pi _ { \theta }$ , $\bar { \pi } _ { \phi _ { i } }$ in environment until termination; collect trajectories $\tau _ { j } , \tau _ { j } ^ { i }$ end update $\theta , \phi _ { 1 } \cdots \phi _ { n }$ using PPO (Schulman et al., 2017) and trajectories $\tau _ { j }$ for $\theta$ and $\tau _ { j } ^ { i }$ for each $\phi _ { i }$ ;
+end
+
+# 5 EXPERIMENTS
+
+In this section we present experiments on continuous control tasks from the OpenAI Gym Suite (Brockman et al., 2016; Todorov et al., 2012). We compare with the existing literature and evaluate the efficacy of a population of learned adversaries across a wide range of state and action space sizes. We investigate the following hypotheses:
+
+H1. Agents are more likely to overfit to a single adversary than a population of adversaries, leaving them less robust on in-distribution tasks.
+H2. Agents trained against a population of adversaries will generalize better, leading to improved performance on out-of-distribution tasks.
+
+In-distribution tasks refer to the agent playing against perturbations that are in the training distribution: adversaries that add their actions onto the agent. However, the particular form of the adversary and their restricted perturbation magnitude means that there are many dynamical systems that they cannot represent (for example, significant variations of joint mass and friction). These tasks are denoted as out-of-distribution tasks. All of the tasks in the test set described in Sec. 5.1 are likely out-of-distribution tasks.
+
+# 5.1 EXPERIMENTAL SETUP AND HYPERPARAMETER SELECTION
+
+While we provide exact details of the hyperparameters in the Appendix, adversarial settings require additional complexity in hyperparameter selection. In the standard RL procedure, optimal hyperparameters are selected on the basis of maximum expected cumulative reward. However, if an agent playing against an adversary achieves a large cumulative reward, it is possible that the agent was simply playing against a weak adversary. Conversely, a low score does not necessarily indicate a strong adversary nor robustness: it could simply mean that we trained a weak agent.
+
+To address this, we adopt a version of the train-validate-test split from supervised learning. We use the mean policy performance on a suite of validation tasks to select the hyperparameters, then we train the policy across ten seeds and report the resultant mean and standard deviation over twenty trajectories. Finally, we evaluate the seeds on a holdout test set of eight additional model-mismatch tasks. These tasks vary significantly in difficulty; for visual clarity we report the average across tasks in this paper and report the full breakdown across tasks in the Appendix.
+
+We experiment with the Hopper, Ant, and Half Cheetah continuous control environments used in the original RARL paper Pinto et al. (2017); these are shown in Fig. 1. To generate the validation model mismatch, we pre-define ranges of mass and friction coefficients as follows: for Hopper, mass $\in [ 0 . 7 , 1 . 3 ]$ and friction $\in [ 0 . 7 , 1 . 3 ]$ ; Half Cheetah and Ant, mass $\in [ 0 . 5 , 1 . 5 ]$ and friction $\in [ 0 . 1 , 0 . 9 ]$ We scale the friction of every Mujoco geom and the mass of the torso with the same (respective) coefficients. We compare the robustness of agents trained via RAP against: 1) agents trained against a single adversary in a zero-sum game, 2) oracle agents trained using domain randomization, and 3) an agent trained only using PPO and no perturbation mechanism. To train the domain randomization oracle, at each rollout we uniformly sample a friction and mass coefficient from the validation set ranges. We then scale the friction of all geoms and the mass of the torso by their respective coefficients; this constitutes directly training on the validation set. To generate the test set of model mismatch, we take both the highest and lowest friction coefficients from the validation range and apply them to different combinations of individual geoms. For the exact selected combinations, please refer to the Appendix.
+
+
+Figure 1: From left to right, the Hopper, Half-Cheetah, and Ant environments we use to test our algorithm.
+
+As further validation of the benefits of RAP, we include an additional set of experiments on a continuous control task, a gridworld maze search task, and a Bernoulli Bandit task in Appendix Sec. F. Finally, we note that both our agent and adversary networks are two layer-neural networks with 64 hidden units in each layer and a tanh nonlinearity.
+
+# 6 RESULTS
+
+# H1. In-Distribution Tasks: Analysis of Overfitting
+
+A globally minimax optimal adversary should be unexploitable and perform equally well against any adversary of equal strength. We investigate the optimality of our policy by asking whether the minimax agent is robust to swaps of adversaries from different training runs, i.e. different seeds. Fig. 2 shows the result of these swaps for the one adversary and three adversary case. The diagonal corresponds to playing against the adversaries the agent was trained with while every other square corresponds to playing against adversaries from a different seed. To simplify presentation, in the three adversary case, each square is the average performance against all the adversaries from that seed. We observe that the agent trained against three adversaries (top row right) is robust under swaps while the single adversary case is not (top row left). The agent trained against a single adversary is highly exploitable, as can be seen by its extremely sub-par performance against an adversary from any other seed. Since the adversaries off-diagonal are feasible adversaries, this suggests that we have found a poor local optimum of the objective.
+
+In contrast, the three adversary case is generally robust regardless of which adversary it plays against, suggesting that the use of additional adversaries has made the agent more robust. One possible hypothesis for why this could be occurring is that the adversaries in the $\cdot$ adversary" case are somehow weaker than the adversaries in the "1 adversary" case. The middle row of the figure shows that it is not the case that the improved performance of the agent playing against the three adversaries is due to some weakness of the adversaries. If anything, the adversaries from the three adversary case are stronger as the agent trained against 1 adversary does extremely poorly playing against the three adversaries (left) whereas the agent trained against three adversaries still performs well when playing against the adversaries from the single-adversary runs. Finally, the bottom row investigates how an agent trained with domain randomization fairs against adversaries from either training regimes. In neither case is the domain randomization agent robust on these tasks.
+
+# H2. Out-of-Distribution Tasks: Robustness and Generalization of Population Training
+
+Here we present the results from the validation and holdout test sets described in Section 5.1. We compare the performance of training with adversary populations of size three and five against vanilla PPO, the domain randomization oracle, and the single minimax adversary. We refer to domain randomization as an oracle as it is trained directly on the test distribution.
+
+Fig.6 shows the average reward (the average of ten seeds across the validation or test sets respectively) for each environment. Table 1 gives the corresponding numerical values and the percent change of each policy from the baseline. Standard deviations are omitted on the test set due to wide variation in task difficulty; the individual tests that we aggregate here are reported in the Appendix with appropriate error bars. In all environments we achieve a higher reward across both the validation and holdout test set using RAP of size three and/or five when compared to the single minimax adversary case. These results from testing on new environments with altered dynamics supports hypothesis H2. that training with a population of adversaries leads to more robust policies than training with a single adversary in out-of-distribution tasks. Furthermore, while the performance is only comparable with the domain randomization oracle, the adversarial approach does not require prior engineering of appropriate randomizations. Furthermore, despite domain randomization being trained directly on these out-of-distribution tasks, domain randomization can have serious failure modes of domain randomization due to its formulation. A detailed analysis of this can be found in Appendix E.
+
+
+Figure 2: Top row: Average cumulative reward under swaps for one adversary training (left) and three-adversary training (right). Each square corresponds to 20 trials. In the three adversary case, each square is the average performance against the adversaries from that seed. Middle row: (Left) Playing the agent trained against 1 adversary against the adversaries from the three adversary case. (Right) Playing the agent trained against 3 adversaries against the adversaries from the one adversary case. Bottom row: (Left) Playing the DR agent against the adversaries from the three adversary case. (Right) Playing the DR agent against the adversaries from the one adversary case.
+
+For a more detailed comparison of robustness across the validation set, Fig. 4 shows heatmaps of the performance across all the mass, friction coefficient combinations. Here we highlight the heatmaps for Hopper and Half Cheetah for vanilla PPO, domain randomization oracle, single adversary, and best adversary population size. Additional heatmaps for other adversary population sizes and the Ant environment can be found in the Appendix. Note that Fig. 4 is an example of a case where a single adversary has negligible effect on or slightly reduces the performance of the resultant policy on the
+
+
+Figure 3: Average reward for Ant, Hopper, and Cheetah environments across ten seeds and across the validation set (top row) and across the holdout test set (bottom row). We compare vanilla PPO, the domain randomization oracle, and the minimax adversary against RAP of size three and five. Bars represent the mean and the arms represent the std. deviation. Both are computed over 20 rollouts for each test-set sample. The std. deviation for the test set are not reported here for visual clarity due to the large variation in holdout test difficulty.
+
+
Validation
Test
Ant
0 Adv
DR
1Adv
3 Adv
5 Adv
0 Adv
DR
1 Adv
3 Adv
5 Adv
Mean Rew.% Change
6336
67436.4
63490.2
64321.5
64381.6
2908
361324.3
320610.2
327212.5
320310.2
Validation
Test
Hopper
0 Adv
DR
1 Adv
3 Adv
5 Adv
0 Adv
DR
1 Adv
3 Adv
5 Adv
Mean Rew.% Change
1182
2662125
1094-7.4
203972.6
202171
472
1636246
91393.4
1598238
1565231
Validation
Test
Cheetah
0 Adv
DR
1 Adv
3 Adv
5 Adv
0 Adv
DR
1 Adv
3 Adv
5 Adv
Mean Rew.% Change
5659
3864-32
5593-1.2
59124.5
632311.7
5592
3656-35
56641.3
60468.1
640614.6
+
+Table 1: Average reward and $\%$ change from vanilla PPO (0 Adv) for Ant, Hopper, and Cheetah environments across ten seeds and across the validation (left) or holdout test set (right). Across all environments, we see consistently higher robustness using RAP than the minimax adversary. Most robust adversarial approach is bolded as domain randomization is an oracle and outside the class of perturbations that our adversaries can construct, and best result overall is italicized.
+
+validation set. This supports our hypothesis that a single adversary can actually lower the robustness of an agent.
+
+# 7 CONCLUSIONS AND FUTURE WORK
+
+In this work we demonstrate that the use of a single adversary to approximate the solution to a minimax problem does not consistently lead to improved robustness. We propose a solution through the use of multiple adversaries (RAP), and demonstrate that this provides robustness across a variety of robotics benchmarks. We also compare RAP with domain randomization and demonstrate that while DR can lead to a more robust policy, it requires careful parametrization of the domain we sample from to ensure robustness. RAP does not require this tuning, allowing for use in domains where appropriate tuning requires extensive prior knowledge or expertise.
+
+There are several open questions stemming from this work. While we empirically demonstrate the effects of RAP, we do not have a compelling theoretical understanding of why multiple adversaries are helping. Perhaps RAP helps approximate a mixed Nash equilibrium as discussed in Sec. 1 or perhaps population based training increases the likelihood that one of the adversaries is strong? Would the benefits of RAP disappear if a single adversary had the ability to represent mixed Nash?
+
+
+Figure 4: Average reward across ten seeds on each validation set parametrization – friction coefficient on the x-axis and mass coefficient on the y-axis. DR refers to domain randomization and X Adv is an agent trained against X adversaries. Top row is Hopper and bottom row is Half Cheetah.
+
+There are some extensions of this work that we would like to pursue. We have looked at the robustness of our approach in simulated settings; future work will examine whether this robustness transfers to real-world settings. Additionally, our agents are currently memory-less and therefore cannot perform adversary identification; perhaps memory leads to a system-identification procedure that improves transfer performance. Our adversaries can also be viewed as forming a task distribution, allowing them to be used in continual learning approaches like MAML (Nagabandi et al., 2018) where domain randomization is frequently used to construct task distributions.
+
+# REFERENCES
+
+Rika Antonova, Silvia Cruciani, Christian Smith, and Danica Kragic. Reinforcement learning for pivoting task. arXiv preprint arXiv:1703.00472, 2017.
+
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
+
+Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456): 885–890, 2019.
+
+Wojciech Marian Czarnecki, Gauthier Gidel, Brendan Tracey, Karl Tuyls, Shayegan Omidshafiei, David Balduzzi, and Max Jaderberg. Real world games look like spinning tops. arXiv preprint arXiv:2004.09468, 2020.
+
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249–256, 2010.
+
+Parameswaran Kamalaruban, Yu-Ting Huang, Ya-Ping Hsieh, Paul Rolland, Cheng Shi, and Volkan Cevher. Robust reinforcement learning via adversarial training with langevin dynamics. arXiv preprint arXiv:2002.06063, 2020.
+
+Eric Liang, Richard Liaw, Philipp Moritz, Robert Nishihara, Roy Fox, Ken Goldberg, Joseph E Gonzalez, Michael I Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. arXiv preprint arXiv:1712.09381, 2017.
+
+Shiau Hong Lim, Huan Xu, and Shie Mannor. Reinforcement learning in robust markov decision processes. In Advances in Neural Information Processing Systems, pp. 701–709, 2013.
+
+Bhairav Mehta, Manfred Diaz, Florian Golemo, Christopher J Pal, and Liam Paull. Active domain randomization. arXiv preprint arXiv:1904.04762, 2019.
+
+Anusha Nagabandi, Chelsea Finn, and Sergey Levine. Deep online learning via meta-learning: Continual adaptation for model-based rl. arXiv preprint arXiv:1812.07671, 2018.
+
+Arnab Nilim and Laurent El Ghaoui. Robust control of markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798, 2005.
+
+Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In 2018 IEEE international conference on robotics and automation (ICRA), pp. 1–8. IEEE, 2018.
+
+Lerrel Pinto, James Davidson, Rahul Sukthankar, and Abhinav Gupta. Robust adversarial reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2817–2826. JMLR. org, 2017.
+
+Martin L Puterman. Markov decision processes. Handbooks in operations research and management science, 2:331–434, 1990.
+
+Aravind Rajeswaran, Sarvjeet Ghotra, Balaraman Ravindran, and Sergey Levine. Epopt: Learning robust neural network policies using model ensembles. arXiv preprint arXiv:1610.01283, 2016.
+
+Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. arXiv preprint arXiv:1611.04201, 2016.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+
+Aviv Tamar, Shie Mannor, and Huan Xu. Scaling up robust mdps using function approximation. In International Conference on Machine Learning, pp. 181–189, 2014.
+
+Yuval Tassa, Saran Tunyasuvunakool, Alistair Muldal, Yotam Doron, Siqi Liu, Steven Bohez, Josh Merel, Tom Erez, Timothy Lillicrap, and Nicolas Heess. dm_control: Software and tasks for continuous control. arXiv preprint arXiv:2006.12983, 2020.
+
+Chen Tessler, Yonathan Efroni, and Shie Mannor. Action robust reinforcement learning and applications in continuous control. arXiv preprint arXiv:1901.09184, 2019.
+
+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. In 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 23–30. IEEE, 2017.
+
+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, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
+
+Kemin Zhou and John Comstock Doyle. Essentials of robust control, volume 104. Prentice hall Upper Saddle River, NJ, 1998.
+
+# A FULL DESCRIPTION OF THE CONTINUOUS CONTROL MDPS
+
+We use the Mujoco ant, cheetah, and hopper environments as a test of the efficacy of our strategy versus the 0 adversary, 1 adversary, and domain randomization baselines. We use the Noisy Action Robust MDP formulation Tessler et al. (2019) for our adversary parametrization. If the normal system dynamics are
+
+$$
+s _ { k + 1 } = s _ { k } + f ( s _ { k } , a _ { k } ) \Delta t
+$$
+
+the system dynamics under the adversary are
+
+$$
+s _ { k + 1 } = s _ { k } + f ( s _ { k } , a _ { k } + a _ { k } ^ { \mathrm { a d v } } ) \Delta t
+$$
+
+where $a _ { k } ^ { \mathrm { a d v } }$ is the adversary action at time $\mathbf { k }$
+
+The notion here is that the adversary action is passed through the dynamics function and represents some additional set of dynamics. It is standard to clip actions within some boundary but for the above reason, we clip the agent and adversary actions separately. Otherwise, an agent would be able to limit the effect of the adversary by always taking actions at the bounds of its clipping range. The agent is clipped between $[ - 1 , 1 ]$ in the Hopper environment and the adversary is clipped between $[ - . 2 5 , . 2 5 ]$ .
+
+The MDP through which we train the agent policy is characterized by the following states, actions, and rewards:
+
+$s _ { t } ^ { \mathrm { a g e n t } } = \left[ o _ { t } , a _ { t } \right]$ where $o _ { t }$ is an observation returned by the environment, and $a _ { t }$ is the action taken by the agent.
+We use the standard rewards provided by the OpenAI Gym Mujoco environments at https: //github.com/openai/gym/tree/master/gym/envs/mujoco. For the exact functions, please refer to the code at ANONYMIZED.
+• $a _ { t } ^ { \mathrm { { a g e n t } } } \in [ a _ { \operatorname* { m i n } } , a _ { \operatorname* { m a x } } ] ^ { n } .$
+
+The MDP for adversary $i$ is the following:
+
+• st = st The adversary sees the same states as the agent. • The adversary reward is the negative of the agent reward. • $a _ { t } ^ { \mathrm { a d v } } \in \left[ a _ { \operatorname* { m i n } } ^ { \mathrm { a d v } } , a _ { \operatorname* { m a x } } ^ { \mathrm { a d v } } \right] ^ { n } .$
+
+For our domain randomization Hopper baseline, we use the following randomization: at each rollout, we scale the friction of all joints by a single value uniformly sampled from [0.7, 1.3]. We also randomly scale the mass of the ’torso’ link by a single value sampled from [0.7, 1.3]. For Half-Cheetah and Ant the range for friction is [0.1, 0.9] and for mass the range is [0.5, 1.5].
+
+
+Figure 5: Average reward for Hopper across varying adversary number.
+
+# B INCREASING ADVERSARY POOL SIZE
+
+We investigate whether RAP is robust to adversary number as this would be a useful property to minimize hyperparameter search. Here we hypothesize that while having more adversaries can represent a wider range of dynamics to learn to be robust to, we expect there to be diminishing returns due to the decreased batch size that each adversary receives (total number of environment steps is held constant across all training variations). We expect decreasing batch size to lead to worse agent policies since the batch will contain under-trained adversary policies. We cap the number of adversaries at eleven as our machines ran out of memory at this value. We run ten seeds for every adversary value and Fig. 5 shows the results for Hopper. Agent robustness on the test set increases monotonically up to three adversaries and roughly begins to decrease after that point. This suggests that a trade-off between adversary number and performance exists although we do not definitively show that diminishing batch sizes is the source of this trade-off. However, we observe in Fig. 6 that both three and five adversaries perform well across all studied Mujoco domains.
+
+
+Figure 6: Average reward for Ant, Hopper, and Cheetah environments across ten seeds and across the validation set (top row) and across the holdout test set (bottom row). We compare vanilla PPO, the domain randomization oracle, and the minimax adversary against RAP of size three and five. Bars represent the mean and the arms represent the std. deviation. Both are computed over 20 rollouts for each test-set sample. The std. deviation for the test set are not reported here for visual clarity due to the large variation in holdout test difficulty.
+
+# C HOLDOUT TESTS
+
+In this section we describe in detail all of the holdout tests used.
+
+
+Figure 7: Labelled Body Segments of Hopper Table 2: Hopper Holdout Test Descriptions
+
+
Test
Body with Friction Coeff 1.3
Body with Friction Coeff 0.7
A
Torso,Leg
Floor, Thigh,Foot
B
Floor, Thigh
Torso,Leg,Foot
C
Foot,Leg
Floor, Torso, Thigh
D
Torso,Thigh,Floor
Foot,Leg
E
Torso,Foot
Floor, Thigh,Leg
F
Floor, Thigh,Leg
Torso,Foot
G
Floor, Foot
Torso, Thigh,Leg
H
Thigh,Leg
Floor, Torso,Foot
+
+# C.1 HOPPER
+
+The Mujoco geom properties that we modified are attached to a particular body and determine its appearance and collision properties. For the Mujoco holdout transfer tests we pick a subset of the hopper ‘geom’ elements and scale the contact friction values by maximum friction coefficient, 1.3. Likewise, for the rest of the ‘geom’ elements, we scale the contact friction by the minimum value of 0.7. The body geoms and their names are visible in Fig. 7.
+
+The exact combinations and the corresponding test name are indicated in Table 2 for Hopper.
+
+# C.2 CHEETAH
+
+The Mujoco geom properties that we modified are attached to a particular body and determine its appearance and collision properties. For the Mujoco holdout transfer tests we pick a subset of the
+
+
+Figure 8: Labelled Body Segments of Cheetah
+
+Table 3: Cheetah Holdout Test Descriptions. Joints in the table receive the maximum friction coefficient of 0.9. Joints not indicated have friction coefficient 0.1
+
+
+
+
+Figure 9: Labelled Body Segments of Ant
+
+cheetah ‘geom’ elements and scale the contact friction values by maximum friction coefficient, 0.9. Likewise, for the rest of the ‘geom’ elements, we scale the contact friction by the minimum value of 0.1. The body geoms and their names are visible in Fig. 8.
+
+The exact combinations and the corresponding test name are indicated in Table 4 for Hopper.
+
+# C.3 ANT
+
+We will use torso to indicate the head piece, leg to refer to one of the four legs that contact the ground, and ’aux’ to indicate the geom that connects the leg to the torso. Since the ant is symmetric we adopt a convention that two of the legs are front-left and front-right and two legs are back-left and back-right. Fig. 9 depicts the convention. For the Mujoco holdout transfer tests we pick a subset of the ant ‘geom’ elements and scale the contact friction values by maximum friction coefficient, 0.9. Likewise, for the rest of the ‘geom’ elements, we scale the contact friction by the minimum value of 0.1.
+
+Table 4: Ant Holdout Test Descriptions. Joints in the table receive the maximum friction coefficient of 0.9. Joints not indicated have friction coefficient 0.1
+
+
+
+Table 5: Results on holdout tests for each of the tested approaches for Hopper. Bolded values have the highest mean
+
+
Test Name
0 Adv
1 Adv
3 Adv
Five Adv
Domain Rand
Test A
410±140
1170 ± 570
2210±630
2090±920
1610±310
Test B
430 ± 150
1160 ± 540
2240 ± 730
2200 ± 880
1610 ± 290
Test C
560 ±120
490 ± 150
610± 250
580 ±120
1660 ± 260
Test D
420 ±150
1140 ± 560
2220 ±680
2130 ± 890
1612 ± 360
TestE
550 ±120
500 ± 150
600 ± 240
590 ±120
1680 ± 280
Test F
420 ±150
1200 ± 620
2080 ± 750
2160 ± 890
1650 ± 360
Test H
560 ± 130
500 ±140
600 ± 230
600 ±140
1710 ± 370
Test G
420 ±150
1160 ± 590
2210 ±680
2160 ± 920
1560 ± 340
+
+
Test Name
0 Adv
1 Adv
3 Adv
Five Adv
Domain Rand
Test A
4400±2160
5110± 730
4960±1280
5560±1060
2800±1540
Test B
6020 ± 880
5980 ± 290
6440 ± 1620
6880±1090
3340 ± 600
Test C
5880 ± 1030
5730 ± 640
6740±1190
6410 ± 790
4280± 240
Test D
5990 ± 940
5960 ± 260
6430 ± 1610
6880±1090
3360 ± 570
TestE
5570± 570
5670 ± 290
5800 ± 1316
6530±1250
3720 ± 540
TestF
5870± 750
5800 ± 350
6500 ± 1100
6770±1070
3810 ± 330
Test H
5310 ± 1060
5270 ± 700
5610 ± 720
5660 ± 980
4560 ± 560
Test G
5710 ± 650
5790 ± 300
5890 ± 1240
6560±1240
3380 ± 720
+
+Table 6: Results on holdout tests for each of the tested approaches for Half Cheetah. Bolded values have the highest mean
+
+The exact combinations and the corresponding test name are indicated in Table 4 for Hopper.
+
+# D RESULTS
+
+Here we recompute the values of all the results and display them with appropriate standard deviations in tabular form.
+
+There was not space for the ant validation set results so they are reproduced here.
+
+
Test Name
0 Adv
1 Adv
3 Adv
Five Adv
Domain Rand
Test A
590± 650
730± 630
600±440
560± 580
900±580
Test B
5240 ± 280
5530 ± 200
5770 ± 100
5710 ±180
6150 ±180
Test C
750± 820
1090 ± 660
1160 ± 540
1040 ± 760
1370 ± 800
Test D
5220 ± 300
5560 ± 220
5770 ± 90
5660 ± 190
6120 ±180
TestE
5270± 290
5570 ± 210
5770±100
5660± 220
6140 ±150
TestF
780 ±860
1160 ± 570
1120 ± 580
1140 ± 870
1390 ± 750
Test H
130 ± 290
420 ± 300
210 ± 220
160 ± 270
700 ± 560
Test G
5290± 280
5560 ± 220
5770 ±100
5700 ± 190
6150 ±160
+
+Table 7: Results on holdout tests for each of the tested approaches for Ant. Bolded values have the highest mean
+
+
+Figure 10: Ant Heatmap: Average reward across 10 seeds on each validation set (mass, friction) parametrization.
+
+# E CHALLENGES OF DOMAIN RANDOMIZATION
+
+In our experiments, we find that naive parametrization of domain randomization can result in a brittle policy, even when evaluated on the same distribution it was trained on.
+
+# Effect of Domain Randomization Parametrization
+
+From Fig. 6, we see that in the Ant and Hopper domains, the DR oracle achieves the highest transfer reward in the validation set as expected since the DR oracle is trained directly on the validation set. Interestingly, we found that the domain randomization policy performed much worse on the Half Cheetah environment, despite having access to the mass and friction coefficients during training. Looking at the performance for each mass and friction combination in Fig. 11, we found that the DR agent was able to perform much better at the low friction coefficients and learned to prioritize those values at the cost of significantly worse performance on average. This highlights a potential issue with domain randomization: while training across a wide variety of dynamics parameters can increase robustness, naive parametrizations can cause the policy to exploit subsets of the randomized domain and lead to a brittle policy. This is a problem inherent to the expectation across domains that is used in domain randomization; if some subset of randomizations have sufficiently high reward the agent will prioritize performance on those at the expense of robustness.
+
+We hypothesize that this is due to the DR objective in Eq. 2 optimizing in expectation over the sampling range. To test this, we created a separate range of ‘good’ friction parameters [0.5, 1.5] and compared the robustness of a DR policy trained with ‘good‘ range against a DR policy trained with ‘bad’ range [0.1, 0.9] in Fig. 11. Here we see that a ‘good’ parametrization leads to the expected result where domain randomization is the most robust. We observe that domain randomization underperforms adversarial training on the validation set despite the validation set literally constituting the training set for domain randomization. This suggests that underlying optimization difficulties caused by significant variations in reward scaling are partially to blame for the poor performance of domain randomization. Notably, the adversary-based methods are not susceptible to the same parametrization issues.
+
+# Alternative DR policy architecture
+
+As discussed above and also identified in Rajeswaran et al. (2016), the expectation across randomizations that is used in domain randomization causes it to prioritize a policy that performs well in a high-reward subset of the randomization domains. This is harmless when domain randomization is used for randomizations of state, such as color, where all the randomization environments have the same expected reward, but has more pernicious effects in dynamics randomizations. Consider a set of $\cdot$ randomization environments, $N - 1$ of which have reward $\cdot$ and one of which has has reward $R _ { \mathrm { h i g h } }$ where $\_$ . If the agent cannot identify which of the randomization environments it is in, the intuitively optimal solution is to pick the policy that optimizes the high reward environment. One possible way out of the quandary is to use an agent that has some memory, such as an LSTM-based policy, thus giving the possibility of identifying which environment the agent is in and deploying the appropriate response. However, if $R _ { \mathrm { h i g h } }$ is sufficiently large and there is some reduction in reward associated with performing the system-identification necessary to identify the randomization, then the agent will not perform the system identification and will prioritize achieving $R _ { \mathrm { h i g h } }$ . As an illustration of this challenge, Fig. 12 compares the results of domain randomization on the half-cheetah environment with and without memory. In the memory case, we use a 64 unit LSTM. As can be seen, there is an improvement in the ability of the domain randomized policy to perform well on the full range of low-friction / high mass values, but the improved performance does not extend to higher friction values. In fact, the performance contrast is enhanced even further as the policy does a good deal worse on the high friction values than the case without memory.
+
+
+Figure 11: Average reward for Half Cheetah environment across ten seeds. Top row shows the average reward when trained with a ‘bad’ friction parametrization which lead to DR not learning a robust agent policy, and bottom row shows the average reward when trained with a ‘good’ friction parametrization.
+
+
+Figure 12: Left: heatmap of the performance of the half-cheetah domain randomized policy across the friction and mass value grid. Right: Left: heatmap of the performance of the half-cheetah domain randomized policy across the friction and mass value grid where the agent policy is an LSTM.
+
+# F ADDITIONAL EXPERIMENTS
+
+Here we outline a few more experiments we ran that demonstrate the value of additional adversaries. We run the following tasks:
+
+# F.1 DEEPMIND CONTROL CATCH
+
+This task uses the same Markov Decision Process described in Sec. A. The challenge (Tassa et al., 2020), pictured in Fig. 13, is to get the ball to fall inside the cup. As in the other continuous control tasks, we apply the adversary to the actions of the agents (which is controlling the cup). We then test on variations of the mass of both the ball and the cup. The heatmaps for this task are presented in Fig. 14 where the 3 adversary case provides a slight improvement in the robustness region relative to the 1 adversary case.
+
+
+Figure 13: The DeepMind Control catch task. The cup moves around and attempts to get the ball to fall inside.
+
+
+Figure 14: (Top left) 0 adversary, (top right) 1 adversary, (bottom left) 3 adversary, (bottom right) 5 adversaries for variations of cup and ball mass.
+
+# F.2 MULTI-ARMED BERNOULLI BANDITS
+
+As an illustrative example, we examine a multi-armed stochastic bandit, a problem widely studied in reinforcement learning literature. Generally, successful strategies for multi-arm bandit problems involve successfully balancing the exploration across arms and exploiting the ’best’ arm. A "robust" strategy should have vanishing regret as the time horizon goes to infinity. We construct a 10-armed bandit where each arm $\cdot$ is parametrized by a value $\cdot$ where p is the probability of that arm returning
+
+1. The goal of the agent is to minimize total cumulative regret $R _ { n }$ over a horizon of $n$ steps:
+
+$$
+R _ { n } = n \operatorname* { m a x } _ { i } \mu _ { i } - \mathbb { E } \left[ \sum _ { t = 0 } ^ { n } a _ { t } \right]
+$$
+
+where $\cdot$ corresponds to picking a particular arm. At each step, the agent is given an observation buffer of stacked frames consisting of all previous (action, reward) pairs padded with zeros to keep the length fixed. The adversary has a horizon of 1; at time-step zero it receives an observation of 0 and outputs the probability for each arm. At the termination of the horizon the adversary receives the negative of the cumulative agent reward. For our domain randomization baseline we use uniform sampling of the $\cdot$ value for each arm. We chose a horizon length of $\cdot$ steps. The MDP of the agent is characterized as follows:
+
+$$
+\begin{array} { r l } & { \bullet s _ { t } = \left[ 0 ^ { n * ( T - t ) \times 1 } , r _ { t } , a _ { t } , r _ { t - 1 } , a _ { t - 1 } , \dotsc , \dotsc , r _ { 0 } , a _ { 0 } \right] } \\ & { \bullet r _ { t } = X ( a _ { i } ) - \operatorname* { m a x } _ { i } \mu _ { i } } \\ & { \bullet a _ { t } ^ { \mathrm { a g e n t } } \in 0 \dots . . 9 } \end{array}
+$$
+
+At each step, the agent is given an observation buffer of stacked frames consisting of all previous (action, reward) pairs. The buffer matching the horizon length is padded with zeros. For each training step, the agent receives a reward of the negative expected regret. We set up the adversary problem as an MDP with a horizon of 1.
+
+$$
+\begin{array} { r l } & { \bullet s _ { t } = [ 0 . 0 ] } \\ & { \bullet r = - \sum _ { i = 1 } ^ { T } r _ { t } } \\ & { \bullet a ^ { \mathrm { a d v } } \in [ 0 , 1 ] ^ { 1 0 } } \end{array}
+$$
+
+During adversarial training, we sample a random adversary at the beginning of each rollout, and allow it to pick $\cdot$ values that are then shuffled randomly and then assigned to each arm (this is to prevent the agent from deterministically knowing which arm has which $p$ value). The adversary is always given an observation of a vector of zeros and is rewarded once at the end of the rollout. We also construct a hold-out test of two bandit examples which we colloquially refer to as "evenly spread" and "one good arm." In "evenly spread", the arms, going from 1 to 10 have evenly spaced probabilities in steps of $-$ . In "one good arm" 9 arms have probability 0.1 and one arm has probability 0.9. As our policy for the agent, we use a Gated Recurrent Unit network with hidden size 256.
+
+An interesting feature of the bandit task is that it makes clear that the single adversary approach corresponds to training on a single, adversarially constructed bandit instance. Surprisingly, as indicated in Fig. 15, this does not perform terribly on our two holdout tasks. However, there is a clear improvement on both tasks in the four adversary case. All adversarial approaches outperform an Upper Confidence Bound-based expert (shown in red). Interestingly, domain randomization, which had superficially good reward at training time, completely fails on the "one good arm" holdout task. This suggests another possible failure mode of domain randomization where in high dimensions uniform sampling may just fail to yield interesting training tasks. Finally, we note that since the upper confidence approach only tries to minimize regret asymptotically, our outperforming it may simply be due to our relatively short horizon; we simply provide it as a baseline.
+
+# G COST AND HYPERPARAMETERS
+
+Here we reproduce the hyperparameters we used in each experiment and compute the expected runtime and cost of each experiment. Numbers indicated in $\{ \}$ were each used for one run. Otherwise the parameter was kept fixed at the indicated value.
+
+# G.1 HYPERPARAMETERS
+
+For Mujoco the hyperparameters are:
+
+• Learning rate:
+
+
+Figure 15: Two transfer tests for the bandit task. On both tasks the 4 adversary case has improved performance relative to RARL while domain randomization performs terribly on all tasks. Bars indicate one std. deviation of the performance over 100 trials.
+
+– $- \ \{ . 0 0 0 3 , . 0 0 0 5 \}$ for half cheetah – $- \ \{ . 0 0 0 5 , . 0 0 0 0 5 \}$ for hopper and ant • Generalized Advantage Estimation $\lambda$ – $\cdot \ \{ 0 . 9 , 0 . 9 5 , 1 . 0 \}$ for half cheetah – $\textbf { - } \{ 0 . 5 , 0 . 9 , 1 . 0 \}$ for hopper and ant • Discount factor $\gamma = 0 . 9 9 5$ • Training batch size: 100000 • SGD minibatch size: 640 • Number of SGD steps per iteration: 10 • Number of iterations: 700 • We set the seed to 0 for all hyperparameter runs. • The maximum horizon is 1000 steps.
+
+For the validation across seeds we used 10 seeds ranging from 0 to 9. All other hyperparameters are the default values in RLlib Liang et al. (2017) 0.8.0
+
+# G.2 COST
+
+For all of our experiments we used AWS EC2 c4.8xlarge instances which come with 36 virtual CPUs. For the Mujoco experiments, we use 2 nodes and 11 CPUs per hyper-parameter, leading to one full hyper-parameter sweep fitting onto the 72 CPUs. We run the following set of experiments and ablations, each of which takes 8 hours.
+
+• 0 adversaries
+• 1 adversary
+• 3 adversaries
+• 5 adversaries
+• Domain randomization
+
+for a total of 5 experiments for each of Hopper, Cheetah, Ant. For the best hyperparameters and each experiment listed above we run a seed search with 6 CPUs used per-seed, a process which takes about 12 hours. This leads to a total of $2 * 8 * 5 * 3 + 2 * 1 2 * 3 * 5 = 6 0 0$ node hours and $3 6 * 6 0 0 \approx 2 2 0 0 0$
+
+
+Figure 16: Wall-clock time vs. reward for varying numbers of adversaries. Despite varying adversary numbers, the wall-clock time of 1, 3, 5, and 7 adversary runs are all the same.
+
+CPU hours. At a cost of $\approx 0 . 3$ dollars per node per hour for EC2 spot instances, this gives $\approx 1 8 0$ dollars to fully reproduce our results for this experiment. If the chosen hyperparameters are used and only the seeds are sweep, this is $\approx 1 0 0$ dollars.
+
+# G.3 RUN TIME AND SAMPLE COMPLEXITY
+
+Here we briefly analyze the expected run-time of our algorithms. While there is an additional cost for adding a single adversary equal to the sum of the cost of computing gradients at train time and actions at run-time for an additional agent, there is no additional cost for adding additional adversaries. Since we divide the total set of samples per iteration amongst the adversaries, we compute approximately the same number of gradients and actions in the many-adversary case as we do in the single adversary case. In Fig. 16 plot of reward vs. wall-clock time supports this argument: the 0 adversary case runs the fastest but all the different adversary numbers complete 700 iterations of training in approximately the same amount of time. Additionally, Fig. 17 demonstrates that there is some variation in sample complexity but the trend is not consistent across adversary number.
+
+# G.4 CODE
+
+Our code is available at ANONYMIZED. For our reinforcement learning code-base we used RLlib Liang et al. (2017) version 0.8.0 and did not make any custom modifications to the library.
+
+# H PURE NASH EQUILIBRIA DO NOT NECESSARILY EXIST
+
+While there are canonical examples of games in which pure Nash equilibria do not exist such as rock-paper-scissors, we are not aware one for sequential games with continuous actions. Tessler et al. (2019) contains an example of a simple, horizon 1 MDP where duality is not satisfied. The pure minimax solution does not equal the value of the pure maximin solution and a greater value can be achieved by randomizing one of the policies showing that there is no pure equilibrium.
+
+
+Figure 17: Iterations vs. reward for varying numbers of adversaries. Despite varying adversary numbers, the wall-clock time of 1, 3, 5, and 7 adversary runs are all the same.
\ No newline at end of file
diff --git a/md/train/IQgbmaoDDjd/IQgbmaoDDjd.md b/md/train/IQgbmaoDDjd/IQgbmaoDDjd.md
new file mode 100644
index 0000000000000000000000000000000000000000..6db77f4a6697afcad7a92d5221c83980ca92e481
--- /dev/null
+++ b/md/train/IQgbmaoDDjd/IQgbmaoDDjd.md
@@ -0,0 +1,455 @@
+# Cooperative Multi-Agent Reinforcement Learning with Sequential Credit Assignment
+
+Anonymous Author(s)
+Affiliation
+Address
+email
+
+# Abstract
+
+1 Centralized training with decentralized execution is a standard paradigm for coop
+2 erative multi-agent reinforcement learning (MARL), with credit assignment being
+3 a major challenge. In this paper, we propose a cooperative MARL method with
+4 sequential credit assignment (SeCA) that deduces each agent’s contribution to the
+5 team’s success one by one to learn better cooperation. We first present a sequential
+6 MARL framework, under which we introduce a new counterfactual advantage to
+7 evaluate each agent based on its preceding agents’ actions in a specific sequence.
+8 As this credit assignment sequence tremendously impacts the performance, we
+9 further present a sequence adjustment algorithm utilizing integrated gradients. It
+10 dynamically modifies the sequence among agents according to their contribution
+11 to the team. SeCA employs a network which either estimates the Q value for
+12 training the centralized critic or deduces the proposed advantage of each agent for
+13 decentralized policy learning. Our method is evaluated on a challenging set of
+14 StarCraft II micromanagement tasks and achieves state-of-the-art performance.
+
+# 15 1 Introduction
+
+16 Cooperative multi-agent reinforcement learning (MARL) is a helpful tool in numerous applications
+17 such as robot swarm control [9], autonomous vehicle coordination [3], network routing [36], and
+18 productivity optimization [37]. This kind of problem where agents learn coordinated policies to
+19 optimize the global reward has been extensively studied in recent years [7, 19, 18, 38, 8].
+20 One natural way of addressing the cooperative MARL problem is the centralized approach, which
+21 treats the team as a single actor with a joint action space. Although we can trivially apply single-agent
+22 reinforcement learning algorithms to such settings, it usually does not scale well because the size of
+23 the joint action space grows exponentially with the number of agents. Besides, it is not applicable
+24 in real-world settings due to the inherent constraints on agent observability and communication.
+25 An alternative approach is to learn decentralized policies by independently training agents based
+26 on their local observations, but simultaneous exploration often brings non-stationarity that causes
+27 unstable learning and difficulties in convergence. As a result, the majority of work on MARL
+28 follows the centralized training with decentralized execution (CTDE) paradigm [17, 10, 22, 6], where
+29 decentralized policies can access extra state information during training.
+30 A crucial challenge of the CTDE paradigm in cooperative settings is to correctly deduce each agent’s
+31 contribution to the team’s success, also known as the multi-agent credit assignment problem [4].
+32 Existing methods can be classified as implicit and explicit credit assignment [39]. Previous implicit
+33 methods often deduce all agents’ contributions by representing the global state-action value as an
+34 aggregation of each agent’s state-action value [26, 22, 12, 24, 21, 29] and assigning the shared rewards
+35 to each agent according to the joint action at one time. In this way, these methods avoid the complex
+36 interaction analysis and instead fit these cooperation relationships by neural networks. However,
+37 implicit methods often face limitations in expressiveness, and their extensions to continuous action
+38 spaces may require additional strategies [39].
+39 On the other hand, recognized explicit approaches calculate difference rewards [34] against a certain
+40 reward baseline [28, 20, 6]. However, in cooperative MARL, evaluating any agent’s action requires
+41 considering the actions of all agents, so it is often difficult to determine the impact a particular agent’s
+42 behavior has on the team when we have not assessed other agents’ actions. In other words, we can
+43 not say that a single agent’s action is bad if the team receives a small reward because the shared
+44 reward is not decided only by this agent’s behavior. Maybe its action is actually good in that state.
+45 This paper presents a sequential credit assignment SeCA to evaluate individual agent actions explicitly
+46 and sequentially. Our motivation is to address the drawbacks of implicit methods that neglect the
+47 cooperation between agents or simply leave it to neural networks and further improve explicit credit
+48 assignment. In summary, we face two main challenges to learn a better explicit credit assignment: (1)
+49 how to alleviate the problem that it is hard to accurately deduce the contribution of one agent without
+50 previously assessing all the others’ action, and (2) how to evaluate agents better in an explicit way.
+51 To deal with (1), we introduce a sequential MARL framework. As mentioned above, without assessing
+52 the behaviors of other agents, we would never be able to evaluate a given agent’s action accurately.
+53 However, we point out in this paper that some agents are less affected by such influences than others,
+54 and we can first assign credit to them. For instance, evaluating a staff’s action needs to take the
+55 CEO’s command or action into consideration, while the former has little importance in assessing the
+56 CEO. Thus, we could evaluate the CEO first without considering the staff’s behavior and then analyze
+57 the staff based on the CEO’s action. We fully consider the action coordination between agents and
+58 explicitly deduce contribution to them one by one according to a particular order, so as to make up
+59 for the disadvantage of implicit methods that the cooperation is only inexplicably fitted by neural
+60 networks. Intuitively, the order significantly impacts the overall performance, so we further propose
+61 an algorithm to adjust the sequence dynamically through integrated gradients [25].
+62 As for (2), we compute an advantage function for each agent to attribute agent contributions explicitly.
+63 COMA [6] is a representative method that computes a baseline for each agent to reason about
+64 counterfactuals in which only one agent $a$ ’s action changes, so its evaluation of $a$ ’s action is based on
+65 the joint action $\mathbf { u } ^ { - a }$ of other agents. In other words, the policy gradient of COMA only encourages
+66 agent $a$ to learn in the direction that benefits the team while other agents are acting $\mathbf { u } ^ { - a }$ , but the
+67 others’ actions are not necessarily $\mathbf { u } ^ { - a }$ when executing. Unlike COMA, we focus more on the action
+68 coordination among agents and propose a new advantage under the proposed sequential framework.
+69 We summarize the contributions of this paper as follows: (1) We propose a sequential MARL
+70 framework in Section 3.2; (2) Under this framework, we introduce a sequential advantage function
+71 for each agent to guide their learning explicitly in Section 3.3. We further prove that the sequential
+72 credit assignment we proposed achieves additive advantage-decomposition. (3) We present a sequence
+73 adjustment algorithm based on integrated gradients to modify the credit assignment order dynamically
+74 in Section 3.4. This algorithm alleviates the impact caused by the sequence’s randomness and helps
+75 achieve competitive performance on a challenging set of StarCraft II micromanagement tasks [23].
+
+# 76 2 Related Work
+
+77 Explicit credit assignment gives valuable insights into agent actions’ contributions to the shared
+78 team reward and substantially promotes policy optimization. The representative method COMA [6]
+79 utilizes a counterfactual baseline that marginalizes out a single agent’s action while keeping the other
+80 agents’ actions fixed to calculate the advantage function. However, the advantage evaluates a single
+81 agent’s action based on the other agents’ current behaviors and ignores different action combinations.
+82 SQDDPG [30] distributes the global reward reflecting each agent’s contribution through Shapley
+83 Value. Although SQDDPG provides a theoretically justified framework, its assumption on the
+84 observability and convex game makes it impractical and performs poorly in complex environments.
+85 Implicit methods are a more common way when addressing the credit assignment challenge. Among
+86 them, LICA [39] is a policy-based method, which learns an end-to-end differentiable optimization
+87 where it trains a hypernetwork that maps the state into a set of weights which, in turn, maps the
+88 action policies into the Q estimate. On the other hand, value-based methods often represent the
+89 global state-action value as an aggregation of the individual values. The value decomposition is linear
+90 in the earlier work VDN [26], and it ignores the state information. QMIX [22] learns a non-linear
+91 mixing network with the global state and maps the individual state-action values into the joint Q value
+92 estimate. Although QMIX performs well in various environments, it still faces the mixing network’s
+93 monotonicity constraint limitation. QTRAN [24] further avoids the representation limitations by
+94 using linear constraints between individual utilities and the global state-action value. It guarantees
+95 optimal decentralization, but its constraints are computationally intractable, and the relaxations often
+96 lead to unsatisfied performance. QPLEX [29] decomposes Q values following the dueling structure,
+97 transferring the monotonicity condition from Q values to advantage values. QPD [35] leverages the
+98 integrated gradient attribution technique to decompose global Q values along trajectory paths based
+99 on the assumption that an agent’s local reward is linearly correlated with its contribution to the team.
+
+# 3 Methods
+
+# 3.1 Preliminaries
+
+Notations. This work considers a fully cooperative multi-agent task with $n$ agents $\mathcal { A } = \{ 1 , . . . , n \}$ as a Dec-POMDP [16] defined by a tuple $\mathbf { \bar { { G } } } = ( S , U , P , \bar { r } , Z , O , n , \gamma )$ . The environment has a true state $s \in S$ . Each agent $a$ chooses an action $u _ { t } ^ { a }$ from its action space $U$ at each timestep $t$ and forms a joint action $\mathbf { u } _ { t }$ that induces a transition in the environment according to the state transition function $P ( s _ { t + 1 } | s _ { t } , \mathbf { u } _ { t } ) : S \times U ^ { n } \times S [ 0 , 1 ] .$ . The agents share the same reward function $r ( s , \mathbf { u } ) : S \times u ^ { n } \mathbb { R }$ , and $\gamma \in [ 0 , 1 )$ is the discount factor. We consider partially observable scenarios in which agent $a$ acquires its local observation $z ^ { a } \in Z$ drawn from $O ( s _ { t } , a ) : S \times \mathcal { A } \to Z$ Each agent has an action-observation history $\tau ^ { a } \in T \equiv ( Z \times U ) ^ { * }$ , on which it conditions a policy $\pi ^ { a } ( u ^ { a } | \bar { \tau } ^ { a } ) : T \times U \to [ 0 , 1 ]$ . We denote joint quantities over agents in bold and joint quantities over agents other than a given agent $a$ with the superscript $- a$ .
+
+112 Integrated Gradients. Many works aim to attribute the predictions of deep networks to their input
+113 features [1, 15, 2]. As one of them, integrated gradients [25] aggregates the gradients along the inputs
+114 that fall on the lines between the baseline $\vec { b }$ and the input ${ \vec { x } } = ( x _ { 1 } , . . . , x _ { j } , . . . , x _ { d } )$ . It explains how
+115 much one feature affects the deep network output $F$ while changing from $F ( \vec { b } )$ to $F ( \vec { x } )$ along a
+116 path between $\vec { b }$ and $\vec { x }$ . Given a path function $\tau ( \alpha )$ with $\alpha \in [ 0 , 1 ]$ specifying a path from baseline
+117 $\tau ( 0 ) = \vec { b }$ to the input $\tau ( 1 ) = \vec { x }$ , then integrated gradients along the $j ^ { t h }$ dimension is acquired by:
+
+$$
+c _ { j } = \mathrm { P a t h I G } _ { j } ^ { \tau } ( \vec { x } ) : : = \int _ { 0 } ^ { 1 } \frac { \partial F ( \tau ( \alpha ) ) } { \partial \tau _ { j } ( \alpha ) } \frac { \partial \tau _ { j } ( \alpha ) } { \partial \alpha } d \alpha ,
+$$
+
+118 where $c _ { j }$ represents $x _ { j }$ ’s contribution to the difference between baseline prediction $F ( \vec { b } )$ and $F ( \vec { x } )$ .
+119 In this work, we leverage the integrated gradients technique to dynamically adjust the order of our
+120 proposed sequential credit assignment according to each agent’s contribution to the team.
+
+# 3.2 Sequential MARL Framework
+
+122 The relationship in a multi-agent system is complicated, as every agent makes decisions based on
+123 the environment interfered with by the other agents. If we model each agent as a node and model
+124 the cooperations between them as edges, the cooperative relationship will be built as a complicated
+125 web-like graph shown in Figure 1(a). Evaluating the actions of any agent should take into account
+126 the behaviors of other agents in this situation. It is hard to judge whether an agent’s current action is
+127 beneficial to the team when we have not evaluated other agents’ actions. If we cannot determine an
+128 analysis order, we can only analyze all the agents implicitly as most existing methods did, and the
+129 cooperation is often fitted only by deep neural networks, leading to unsatisfactory results.
+130 This section presents a sequential framework for cooperative MARL, which aims to analyze agents’
+131 actions one by one. Our key assumption is that evaluations of some agents in a team are less affected
+132 than others. Thus we can study these less-affected agents first and then analyze the others based on
+133 the actions of these already-studied agents. For instance, when evaluating a staff’s action, the CEO’s
+134 decision plays a vital role because we have to judge whether the staff obeys the command or not. On
+135 the contrary, the staff intuitively has little impact on evaluating the CEO’s decision. In assessing the
+136 CEO, we often consider external factors such as market situation, modeled as state $s$ in MARL.
+137 We introduce a variable $\mathcal { O } _ { i }$ to help model this sequential MARL framework. This additional variable
+138 represents a random event that our cooperation study (e.g., credit assignment) on agent $a _ { i }$ is optimal or
+139 precise. Then the probability $p ( \mathcal { O } _ { i } )$ denotes the accuracy of our research on agent $a _ { i }$ . For illustration
+140 and understanding convenience, we discuss a simple multi-agent system with three agents as an
+141 example, in which agents are identified by $a _ { i } ( i \in \mathsf { \bar { \{ 1 , 2 , 3 \} } } )$ . In original MARL, the evaluation of
+142 agent $a _ { i }$ will influence all the other agents’ assessments. Thus events $\mathcal { O } _ { 1 }$ , $\mathcal { O } _ { 2 }$ and $\mathcal { O } _ { 3 }$ are mutually
+143 dependent, as shown in Figure 1(b). We calculate the probability of studying the system accurately
+144 by computing conditional probabilities:
+
+
+Figure 1: A toy example with three agents. (a) Agents affect each other as they choose actions based on the state interfered with by the others’ actions. (b) The study on one agent will influence all the other agents’ assessments in the original MARL framework. Agent’s cooperation analyses are interrelated. (c) Each agent’s cooperation study in the proposed sequential MARL framework. Dotted arrows representing correlations decrease from 6 in (b) to 3 in (c), reducing the complexity by half. This merit also holds for systems with other numbers of agents.
+
+$$
+\begin{array} { r l } { p ( \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } , \mathcal { O } _ { 3 } ) = p ( \mathcal { O } _ { 1 } ) \cdot p ( \mathcal { O } _ { 2 } | \mathcal { O } _ { 1 } ) \cdot p ( \mathcal { O } _ { 3 } | \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } ) } & { { } } \\ { \vdots } \\ { = p ( \mathcal { O } _ { 3 } ) \cdot p ( \mathcal { O } _ { 2 } | \mathcal { O } _ { 3 } ) \cdot p ( \mathcal { O } _ { 1 } | \mathcal { O } _ { 2 } , \mathcal { O } _ { 3 } ) } & { { } } \end{array}
+$$
+
+145 where $p ( \mathcal { O } _ { j } | \mathcal { O } _ { i } )$ denotes the probability of agent $a _ { j }$ ’s accurate analysis under the condition of
+146 conducting a precise study on agent $a _ { i }$ . It also indicates the accuracy of $a _ { j }$ ’s analysis conditions on
+147 precisely assess $a _ { i }$ . We then conclude that:
+
+148 where $i , j , k \in \{ 1 , 2 , 3 \} , i \neq j , k \neq i , j$
+
+$$
+\begin{array} { r l } & { \quad p ( \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } , \mathcal { O } _ { 3 } ) = p ( \mathcal { O } _ { i } ) \cdot p ( \mathcal { O } _ { j } | \mathcal { O } _ { i } ) \cdot p ( \mathcal { O } _ { k } | \mathcal { O } _ { i } , \mathcal { O } _ { j } ) } \\ & { , 3 \} , i \not = j , k \not = i , j . } \end{array}
+$$
+
+149 We take Equ.(2a) as an example. To study the cooperation of this multi-agent system precisely (i.e.,
+150 big $p ( \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } , \mathcal { O } _ { 3 } ) )$ , we can first analyze $a _ { 1 }$ as accurately as possible (i.e., big $p ( \mathcal { O } _ { 1 } ) )$ and then go
+151 on to investigate $a _ { 2 }$ and $a _ { 3 }$ respectively with the best possible accuracy (i.e., big $\partial ( \mathcal { O } _ { 2 } | \mathcal { O } _ { 1 } )$ and
+152 $p ( \mathcal { O } _ { 3 } | \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } ) )$ under the condition of preceding agents’ precise analysis.
+153 The sequential MARL framework reduces the complexity of the model with six dotted arrows that
+154 indicate correlations between agents’ evaluations in Figure 1(b) by half, as those three dotted lines in
+155 Figure 1(c) show. Equ.(3) suggests that we can analyze the cooperation of a multi-agent system in
+156 any order, but from the CEO-Staff example, we can see that the difficulty of analyzing in various
+157 orders is not the same. Further discussion on the sequence will show in Section 3.4.
+158 In general, we specify an order to analyze the cooperation in the sequential MARL framework. We
+159 fix an agent’s actions after assessing it and study a particular agent based on the fixed actions of its
+160 preceding agents, reflecting the intuition that a CEO’s decision has a strong influence on evaluating
+161 the staff in the example mentioned earlier. This sequential MARL framework significantly alleviates
+162 the correlations in studying agents and helps us assess their cooperation more directly.
+
+# 3.3 Sequential Credit Assignment
+
+64 Following the CTDE paradigm, we utilize a centralized critic for each actor to follow a gradient
+165 based on an advantage function $A$ estimated from this critic:
+
+$$
+g = \nabla _ { \theta ^ { \pi } } \log \pi \left( u | \tau _ { t } ^ { a } \right) A .
+$$
+
+
+Figure 2: Performances between COMA’s counterfactual advantage and ours in two environments. (Left) Predator-Prey. Three predators cooperate to chase a faster prey that acts randomly in an area containing two obstacles. The game terminates when a predator captures the prey, and then a shared reward is given. The predators trained by our advantage capture the prey faster. (Right) Cooperative Navigation initializes three agents and three landmarks with random locations. Agents cooperate to cover all the landmarks, and the shared reward is the negative sum of displacements between each landmark and its nearest agent. Our method helps the team gain bigger rewards than COMA.
+
+166 The advantage function $A$ for each actor explicitly deduces how that particular agent contributes to
+167 the team. COMA [6] introduced a counterfactual baseline inspired by difference rewards [34]. For
+168 each agent $a$ , COMA computes an advantage function that compares the Q-value for the action $u ^ { a }$ to
+169 a counterfactual baseline that marginalizes out $u ^ { a }$ while keeping the others’ actions $\mathbf { u } ^ { - a }$ fixed:
+
+$$
+A _ { C O M A } ^ { a } ( s , { \mathbf { u } } ) = Q \left( s , \left( u ^ { a } , { \mathbf { u } } ^ { - a } \right) \right) - \sum _ { u ^ { \prime } \circ } \pi ^ { a } \left( u ^ { \prime } { } ^ { a } | \tau ^ { a } \right) \cdot Q \left( s , \left( { \mathbf { u } } ^ { - a } , u ^ { \prime } { } ^ { a } \right) \right) .
+$$
+
+170 COMA avoids expensive calculations through careful network design. However, each agent’s
+171 contribution deduced by COMA is still imperfect. The evaluation of $u ^ { a }$ is based on the fixed $\mathbf { u } ^ { - a }$
+172 in Equ.(5), so agent $a$ will learn a policy that works better with $\mathbf { u } ^ { - a }$ in this way. It ignores the joint
+173 actions $( u ^ { a } , \mathbf { u } ^ { - a \prime } )$ with $\mathbf { u } ^ { - a \prime } \neq \mathbf { u } ^ { - a }$ that may lead to unexpected results when assessing $u ^ { a }$ .
+174 To analyze each agent $a$ ’s contribution more objectively, we consider the influence of all joint actions
+175 with $u ^ { a }$ . Considering all potential action combinations, we calculate a counterfactual advantage for
+176 each agent’s action, derived by computing the expectation on all the actions of other agents:
+
+$$
+A ^ { a } ( s , { \mathbf { u } } ) = \mathbb { E } _ { { \mathbf { u } } ^ { - a } } \left[ Q \left( s , \left( u ^ { a } , { \mathbf { u } } ^ { - a } \right) \right) \right] - \mathbb { E } _ { { \mathbf { u } } ^ { - a } } \left[ \sum _ { u ^ { \prime } { } ^ { a } } \pi ^ { a } \left( u ^ { \prime a } | \tau ^ { a } \right) \cdot Q \left( s , \left( { \mathbf { u } } ^ { - a } , u ^ { \prime a } \right) \right) \right] .
+$$
+
+177 Under our proposed sequential MARL framework, we carry out credit assignment according to a
+178 specific order, and there is no need to consider all the possible joint actions. After assessing agent $a$ ,
+179 we fix its action and evaluate agents after it based on $a$ ’s fixed action, so the following agents’ credit
+180 assignments do not have to compute the expectation on $u ^ { a }$ anymore.
+
+181 We now give the detailed sequential credit assignment for a team with $n$ agents identified by 182 $a _ { i } ( i \in \{ 1 , { \overline { { \ldots , n } } } \} )$ under one specific sequence $\{ a _ { 1 } , a _ { 2 } , . . . , a _ { n } \}$ , and it can also be concluded from the rest 183 $( n ! - 1 )$ orders in the same way. Here we denote $\mathbf u _ { a _ { 1 } } ^ { a _ { i - 1 } } \stackrel { \cdot } { = } \left[ u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i - 1 } } \right]$ $( i = 2 , 3 , . . . , n )$ .
+
+184 As for agent 185 i been deduced. We fix the leading agents’ actions and assess agent $( i \neq 1 )$ ) in the sequence, the contribution of its leading agents $a _ { i }$ 1 2’s action based on $a _ { 1 } , a _ { 2 } , . . . , a _ { i - 1 }$ $\mathbf { u } _ { a _ { 1 } } ^ { a _ { i - 1 } }$ has , so
+186 there is no need to calculate the expectations on $[ u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i - 1 } } ]$ , simplifying Equ.(6) to:
+
+$$
+\begin{array} { r l } & { \displaystyle \ = \sum _ { u ^ { \prime } { } ^ { a _ { i } + 1 } } \cdot \cdot \cdot \sum _ { u ^ { \prime } { } ^ { a _ { n } } } \pi ^ { a _ { i } + 1 } \left( u ^ { \prime } { } ^ { a _ { i } + 1 } \left. \tau ^ { a _ { i } + 1 } \right. \cdot \cdot \cdot \pi ^ { a _ { n } } \left( u ^ { \prime } { } ^ { a _ { n } } \left. \tau ^ { a _ { n } } \right. \cdot \right. \right. Q \left( s , \left( \mathbf { u } _ { a _ { 1 } } ^ { a _ { i } } , u ^ { \prime } { } ^ { a _ { i } + 1 } , \cdot \cdot \cdot , u ^ { \prime } { } ^ { a _ { n } } \right) \right) \right. } \\ & { \left. \left. \quad - \sum _ { u ^ { \prime } { } ^ { a _ { i } } } \cdot \cdot \cdot \sum _ { u ^ { \prime } { } ^ { a _ { n } } } \pi ^ { a _ { i } } \left( u ^ { \prime } { } ^ { a _ { i } } \left. \tau ^ { a _ { i } } \right. \cdot \cdot \cdot \pi ^ { a _ { n } } \left( u ^ { \prime } { } ^ { a _ { n } } \left. \tau ^ { a _ { n } } \right) \cdot Q \left( s , \left( \mathbf { u } _ { a _ { 1 } } ^ { a _ { i } - 1 } , u ^ { \prime } { } ^ { a _ { i } } , \cdot \cdot \cdot \cdot \right. , u ^ { \prime } { } ^ { a _ { n } } \right) \right) \right. \right. } \end{array}
+$$
+
+187 Then the first agent $a _ { 1 }$ ’s advantage is:
+
+$$
+\begin{array} { l } { { \displaystyle { \cal A } ^ { a _ { 1 } } \left( s , { \bf u } \right) = \sum _ { u ^ { \prime } = 2 } \cdots \sum _ { u ^ { \prime } = n } \pi ^ { a _ { 2 } } \left( u ^ { \prime } { } ^ { a _ { 2 } } \big \vert \tau ^ { a _ { 2 } } \right) \cdot \cdot \cdot \pi ^ { a _ { n } } \left( u ^ { \prime } { } ^ { a _ { n } } \big \vert \tau ^ { a _ { n } } \right) \cdot Q \left( s , \big ( u ^ { a _ { 1 } } , u ^ { \prime } { } ^ { a _ { 2 } } , \cdot \cdot \cdot , u ^ { \prime } { } ^ { a _ { n } } \big ) \right) } \ ~ } \\ { { \displaystyle ~ - \sum _ { u ^ { \prime } = 1 } \cdot \cdot \cdot \sum _ { u ^ { \prime } = n } \pi ^ { a _ { 1 } } \left( u ^ { \prime } { } ^ { a _ { 1 } } \big \vert \tau ^ { a _ { 1 } } \right) \cdot \cdot \cdot \pi ^ { a _ { n } } \left( u ^ { \prime } { } ^ { a _ { n } } \big \vert \tau ^ { a _ { n } } \right) \cdot Q \left( s , \big ( u ^ { \prime } { } ^ { a _ { 1 } } , u ^ { \prime } { } ^ { a _ { 2 } } , \cdot \cdot \cdot , u ^ { \prime } { } ^ { a _ { n } } \big ) \right) } \ ~ } \end{array}
+$$
+
+
+Figure 3: (a) A centralized mixing critic network that maps the state into a set of weights (top) and the decentralized agent network structure (bottom). (b) The overall SeCA architecture. (c) Critic learning (top) and policy learning (bottom) flow. View in color if possible for better understanding.
+
+188 To illustrate the effectiveness of our sequential counterfactual advantage, we conduct a simple
+189 but illuminating test in two common multi-agent particle environments [11], Predator-Prey and
+190 Cooperative Navigation. We train both methods with 5 random seeds, and agents are trained for 5000
+191 episodes. We provide detailed information on the environments and experiments in the Appendix. As
+192 shown in Figure 2, our sequential advantage functions help agents handle the task faster and better.
+93 Our sequential advantage for each agent achieves an additive decomposition of the total advantage
+94 function, which to some extent explains the soundness and superiority of our advantage over COMA’s.
+
+95 Claim 1. The proposed sequential credit assignment achieves additive advantage-decomposition.
+
+196 Proof. See Appendix A.
+
+97 Facing the same problem as COMA that those evaluations are expensive, we model the first term
+98 in Equ.(7) as a function $f _ { \phi }$ of $\left( u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i } } , \pi ^ { a _ { i + 1 } } , . . . , \pi ^ { a _ { n } } \right)$ to address this issue, and the second
+199 term is a similar function of $\bigl ( u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i - 1 } } , \pi ^ { a _ { i } } , . . . , \pi ^ { a _ { n } } \bigr ) .$ Thus, we rewrite Equ.(7) as:
+
+$$
+A ^ { a _ { i } } = f _ { \phi } \left( s ; u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i } } , \pi ^ { a _ { i + 1 } } , . . . , \pi ^ { a _ { n } } \right) - f _ { \phi } \left( s ; u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i - 1 } } , \pi ^ { a _ { i } } , . . . , \pi ^ { a _ { n } } \right) .
+$$
+
+Here 200 $f _ { \phi }$ is a function evaluating agents’ action-policy vectors, where $f _ { \phi } \left( u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { n } } \right) = Q$ and 201 $f _ { \phi } \left( \pi ^ { a _ { 1 } } , \pi ^ { a _ { 2 } } , . . . , \pi ^ { a _ { n } } \right) = V$ . We design the complete setup for SeCA, which is illustrated in Figure 3.
+
+202 Critic Learning. We train critic $f _ { \phi }$ on-policy to estimate $Q$ , utilizing a practical variant of $\mathrm { T D } ( \lambda )$ [27]
+203 adapted for use with deep neural networks. In particular, the critic parameter $\phi$ is updated by minibatch
+204 gradient descent to minimize the following loss:
+
+$$
+\mathcal { L } _ { t } ( \phi ) = \left( y _ { t } ^ { ( \lambda ) } - f _ { \phi } ( s _ { t } , \mathbf { u } _ { t } ) \right) ^ { 2 } , \mathrm { ~ w h e r e ~ } y _ { t } ^ { ( \lambda ) } = r _ { t } + \gamma \left( \lambda y _ { t + 1 } ^ { ( \lambda ) } + ( 1 - \lambda ) f _ { \phi ^ { - } } ( s _ { t + 1 } , \mathbf { u } _ { t + 1 } ) \right) .
+$$
+
+205 We utilize a target critic $f _ { \phi ^ { - } }$ [14] to improve learning stability and update ${ \phi } ^ { - } \phi$ periodically. The
+206 critic learning flow is shown at the top of Figure 3(c). The input for critic training is the state $s$ and
+207 the action vector $\mathbf { u } = \left[ u ^ { 1 } , u ^ { 2 } , . . . , u ^ { n } \right]$ denoted as $\mathbf { v } ^ { 1 : n }$ .
+208 Policy Learning. We optimize each agent $a$ ’s policy parameter $\theta _ { a }$ by maximizing the following
+209 objective, which contains our proposed advantage function and an entropy regularization term $\mathcal { H }$ :
+
+$$
+g ^ { a } = \mathbb { E } _ { \tau \sim \pi } \left[ \nabla _ { \theta _ { a } } \log \pi ^ { a } ( u ^ { a } | \tau ^ { a } ) A ^ { a } ( s , \mathbf { u } ) + \mathcal { H } \left( \pi ^ { a } ( \cdot | \tau ^ { a } ) \right) \right] ,
+$$
+
+where the derivative of the adaptive entropy regularization term 210 $\mathcal { H } ( \pi ^ { a } ( \cdot | \tau ^ { a } ) )$ [39] with respect to the 211 $i$ -th action probability $p _ { i } ^ { a }$ is given by:
+
+$$
+\begin{array} { r } { d \mathcal { H } _ { i } : = - \xi \cdot ( \log p _ { i } ^ { a } + 1 ) / H ( \pi ^ { a } ( \cdot | \tau ^ { a } ) ) , \mathrm { ~ w h e r e ~ } H ( \pi ^ { a } ( \cdot | \tau ^ { a } ) ) = \mathbb { E } _ { u ^ { a } \sim \pi ^ { a } } \left[ - \log \pi ^ { a } ( u ^ { a } | \tau ^ { a } ) \right] . } \end{array}
+$$
+
+212 We share parameters among agents, and the gradient we use to train the actor shared by all agents is:
+
+$$
+g = \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { a } \left( \nabla _ { \theta _ { a } } \log \pi ^ { a } ( u ^ { a } | \tau ^ { a } ) A ^ { a } ( s , \mathbf { u } ) + \mathcal { H } \left( \pi ^ { a } ( \cdot | \tau ^ { a } ) \right) \right) \right] .
+$$
+
+213 The inputs of the centralized critic $f _ { \phi }$ to compute the advantage function are the state $s$ and two
+214 action-policy vectors $\mathbf { v } ^ { 1 : i } = \left[ u ^ { 1 } , . . . , \dot { u } ^ { i } , \pi ^ { i + 1 } , . . . , \pi ^ { n } \right]$ and $\mathbf { v } ^ { 1 : i - \bar { 1 } } = \left[ u ^ { 1 } , . . . , u ^ { i - 1 } , \pi ^ { i } , . . . , \pi ^ { n } \right]$ . The
+215 bottom of Figure 3(c) demonstrates the policy learning flow.
+
+# 3.4 Sequence Adjustment Through Integrated Gradients
+
+We apply integrated gradients to adjust the credit assignment sequence dynamically. Reviewing the enlightening and straightforward CEO-Staff example discussed in Section 3.2, we can evaluate the staff’s behavior based on the CEO’s decision, but assessing the CEO does not require much attention to the staff’s action. Therefore, we would analyze the CEO first and then evaluate the staff based on the CEO’s current action. However, this example is not generalized for two reasons: (1) There are often multiple agents taking the same role in a system with superior-subordinate relationships, and the sequence of these agents is hard to determine; (2) Not all scenarios have such superior-subordinate relationships. The agents often do not need to follow others’ commands in many applications.
+
+225 We generalize the CEO-Staff example to propose a universal model. Instead of focusing on the roles
+226 among the agents as in [31, 32], we are more interested in agents’ contributions. Although the CEO
+227 and the staff have a superior-subordinate relationship, they are essentially employees of an enterprise.
+228 The staff plays an auxiliary role and acts based on the CEO’s decision. The staff’s work is meaningful
+229 only if the CEO’s decision is correct. Therefore, we often intuitively assume that an enterprise’s
+230 leader is paid more and contributes more. Based on this, we transform the roles of the CEO and staff
+231 into employees with different contributions to the enterprise. In the sequential MARL framework, we
+232 first assign credit to the agent with a higher contribution to the team.
+233 The attribution method is a powerful way to determine the influence of input features’ each component
+234 on the network output value [2]. Among them, integrated gradients [25] leverages path integral to
+235 aggregate gradients along the inputs that fall on the lines between the baseline and the input, which
+236 is a natural tool for measuring each agent’s contribution. QPD [35] utilizes the integrated gradient
+237 attribution technique to decompose shared rewards along trajectory paths, revealing how much each
+238 agent’s observation and action contributes to the global Q value. However, it remains unclear whether
+239 individual Q value should be linearly correlated to or approximated by the agent’s contribution, as in
+240 the case of QPD. The proper connection between agents’ contributions and their individual Q values
+241 in a cooperative team is worth well studied for the community.
+
+Here we avoid detailed analysis on the relationship between agents’ contributions and their individual rewards. Instead, we use integrated gradients to measure agents’ contributions to the state transition and adjust the credit assignment sequence based on their contributions. In particular, we estimate agent $a$ ’s contribution $c ^ { a }$ in the trajectory path $\tau _ { t _ { 1 } } ^ { t _ { 2 } }$ from time $t _ { 1 }$ to $t _ { 2 }$ based on its policy vector $\pi ^ { a }$ :
+
+$$
+c ^ { a } = \sum _ { x _ { j } \in \pi ^ { a } } \mathrm { P a t h I G } _ { j } ^ { \tau _ { t _ { 1 } } ^ { t _ { 2 } } } ( \pi ^ { a } ) ,
+$$
+
+246 where $x _ { j }$ is $j$ -th dimension of the policy vector $\pi ^ { a }$ . The computation for PathIG is shown in Equ.(1).
+247 We compute each agent’s contribution $c$ to the state transition from $s _ { t _ { 1 } }$ to $s _ { t _ { 2 } }$ and analyze the agent
+248 with higher $c$ first. We further study the adjustment frequency and its effectiveness in Section 4.2
+
+# 4 Experiments and Analysis
+
+# 4.1 Experimental Setup
+
+We consider a challenging set of cooperative StarCraft II maps from the SMAC benchmark [23] classified as Easy, Hard, and Super Hard scenarios according to the baseline algorithms’ performance. The inherent differences among various methods and their training procedure (e.g., on/off-policy learning for value-based/policy-based methods) bring difficulties when comparing methods in a reasonably fair manner without introducing additional components (e.g., importance sampling [13, 33] for off-policy methods). To attribute any poor performance of policy-based methods to potential algorithmic limitations or poor training conditions (in particular, high variance due to small batch sizes or insufficient gradient steps), we follow [5, 39], training all methods with 32 parallel runners to generate trajectories and using batches of 32 episodes. We evaluate each method every 320K steps with 32 episodes and report the 1st, median, and 3rd quartile win rates across 5 random seeds. Detailed information about the scenarios and the experimental setup is shown in the Appendix.
+
+
+Figure 4: Ablations for SeCA’s key elements on scenario MMM2 (Super Hard). (a) investigates the effects of our sequential advantage and network architecture. (b) validates our sequence adjustment through integrated gradients. (c) shows the test win percentage with various adjustment frequencies.
+
+# 4.2 Ablation Studies
+
+# We first carry out ablation experiments on a Super Hard map MMM2 to validate key elements of SeCA.
+
+Proposed Advantage and Architecture. In Section 3.3, we compare our sequential advantage with COMA’s in two simple multi-agent particle environments and show our superiority in Figure 2. Afterward, we introduce a $f _ { \phi }$ approximation and a corresponding network architecture. Here we apply the same approximation and architecture for COMA’s counterfactual advantage (COMA-newArchi) and compare it with the original COMA and our method SeCA to show the effects of our advantage function, approximation, and network architecture. The result is illustrated in Figure 4(a). COMA performs poorly on this Super Hard map but acquires significant improvement with our approximation and architecture. Our sequential advantage further accelerates and stabilizes the training.
+
+Sequence Adjustment Algorithm. SeCA’s credit assignment sequence is dynamic. We compare our method with some intuitive adjustments to validate its effects. One could first evaluate agents with higher current-action probability (SeCA-Prob) or lower policy entropy (SeCA-Entro), as these agents are more confident in their acts, and we can assess other agents based on their behaviors. Since SeCA-Prob and Entro get a new order at each step, to be fair, we set the path length in Equ.(14) to one, i.e., consider agents’ contributions based on the transition from $s _ { t }$ to $s _ { t + 1 }$ (SeCA-IG-1). Figure 4(b) illustrates that SeCA-Prob and Entro learn better than the fixed method (SeCA-Fixed), but Prob has a larger variance than Entro. Fixed is better than expected, which we believe is because that the fixed sequence acquires adequate training. Our integrated-gradients-adjustment performs the best in win rates and stability, and the others have inferior performance and incredibly high variance.
+
+Sequence Adjustment Frequency. We next consider how the sequence adjustment frequency in SeCA-IG affects the performance. Except per step adjustment (i.e., SeCA-IG-1), one could also update the sequence after a stage or an episode. If we change the credit assignment order for every episode during training (SeCA-IG-episode), then $\tau _ { t _ { 1 } } ^ { t _ { 2 } }$ in Equ.(14) represents a whole episode. As for stage adjustment, it is hard to define a stage in these tasks, and the stage length varies in diverse maps. Here we set stage length to 10 and 20, respectively denoted as SeCA-IG-10 and SeCA-IG-20. As the results in Figure 4(c) show, IG-1 and IG-episode have similar final win rates. However, IG-episode converges more quickly with smaller variance. The reason for IG-10(20)’s mediocre performance and high variance may be because the stage length needs to be dynamically adjusted. Inappropriate adjustment frequency fails to adapt to the stage changes in the task and causes insufficient training for each sequence. We utilized SeCA-IG-episode in other experiments and will investigate dynamic stage learning in the future to improve stage adjustment.
+
+# 94 4.3 Comparisons with State-of-the-arts
+
+We compare SeCA with some competitive algorithms, including the representative explicit credit assignment method COMA, the policy-based implicit method LICA, the common-used baseline QMIX and QTRAN. Methods are evaluated on 6 scenarios, including 2 Easy ones (2s3z, 1c3s5z), 2 Hard ones $( 2 \mathsf { c } _ { - } \mathsf { v s } _ { - } 6 4 \mathsf { z g } , 3 \mathsf { s } _ { - } \mathsf { v s } _ { - } 5 \mathsf { z } )$ , and 2 Super Hard ones (MMM2, $ { 3 \mathbf { s } } 5 { \mathbf { z } } _ { - } { \mathbf { v } } { \mathbf { s } } _ { - } 3 { \mathbf { s } } 6 z ,$ . We train all methods for 32 million steps in Easy maps and 64 million steps in Hard and Super Hard maps. These scenarios involve homogeneous and heterogeneous teams, symmetric and asymmetric battles, allowing a holistic study on all methods. Our experiments are based on the latest PyMARL [23]
+
+
+Figure 5: The comparison of SeCA against various baseline algorithms on six SMAC maps.
+
+302 utilizing SC2.4.10. Performance is not always comparable between versions, so the results may be
+303 subtly different from the original papers.
+304 As we can see in Figure 5, SeCA demonstrates its robustness by achieving good performances in
+305 scenarios with various characteristics. All methods except COMA and QTRAN solve two Easy
+306 scenarios, and SeCA performs better in convergence speed and stability. SeCA’s advantage is further
+307 extended in the Hard map $\mathsf { 2 c _ { - } v s _ { - } 6 4 z g }$ , and it converges significantly faster than other methods.
+308 Although classified only as Hard, $ { 3 \mathrm { s } } _ { - } { \mathrm { v } } { \mathrm { s } } _ { - } { 5 z }$ invalidates most algorithms except QMIX and SeCA, as
+309 Stalkers have to learn dispersing and making enemies give chase while maintaining enough distance
+310 ("kiting" technique) in this map. SeCA has a higher variance than QMIX. This is possibly because
+311 the Stalkers’ scattering prioritizes individual performance over cooperation which is more in line
+312 with QMIX’s monotonicity constraint. Nevertheless, SeCA’s performance improvements on the
+313 Super Hard scenarios MMM2 and $ { 3 \mathbf { s } } 5 { \mathbf { z } } _ { - } { \mathbf { v } } { \mathbf { s } } _ { - } 3 { \mathbf { s } } 6 { \mathbf { z } }$ demonstrate the effectiveness of our method. LICA’s
+314 performance in $ { 3 \mathbf { s } } 5 { \mathbf { z } } _ { - } { \mathbf { v } } { \mathbf { s } } _ { - } 3 { \mathbf { s } } 6 { \mathbf { z } }$ here is different from the original paper, as the original results for
+315 this map are obtained by using a different entropy coefficient, which is explained in its open-source
+316 implementation.1 This parameter tuning is unfair when comparing methods, so all experiments in this
+317 paper use the fixed entropy coefficient. We also visualize the learned sequences in different battles of
+318 $3 { \bf s } _ { - } \mathtt { v } { \bf s } _ { - } 5 z$ to provide insights into our sequence adjustment in the Appendix.
+19 We are supposed to compare our method with QPD that also utilizes integrated gradients to show
+320 our improvement. However, QPD modifies the original SMAC environment to acquire additional
+321 information for policy training, which is mentioned in its open-source implementation.2 Therefore, it
+322 is unfair to compare QPD’s learning curves in the modified environment with other methods, and
+323 QPD’s authors did not provide methods’ learning curves comparison in the original paper. We follow
+324 them, providing a win rate table in the Appendix to show our superiority over QPD.
+
+# 5 Conclusions and Future Work
+
+This paper presents SeCA, a cooperative MARL framework with sequential credit assignment. SeCA computes counterfactual advantage functions to evaluate each agent based on the actions of the preceding agents under a specific sequence. The sequence is adjusted dynamically according to agents’ contributions to the team deduced by integrated gradients. SeCA accelerates policy convergence and improves the final performance over existing recognized methods in practice. In the future, we will further investigate stage learning in an episode and adjust the sequence per stage to improve SeCA and achieve adaptive cooperation in various task situations.
+
+References
+[1] Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. In International Conference on Learning Representations, 2018.
+[2] Guillem Brasó Andilla. Attribution methods for deep convolutional networks.
+[3] Yongcan Cao, Wenwu Yu, Wei Ren, and Guanrong Chen. An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics, 9(1):427–438, 2012.
+[4] Yu-han Chang, Tracey Ho, and Leslie Kaelbling. All learning is local: Multi-agent learning in global reward games. In Advances in Neural Information Processing Systems, pages 808–814, 2004.
+[5] Yali Du, Lei Han, Meng Fang, Ji Liu, Tianhong Dai, and Dacheng Tao. Liir: Learning individual intrinsic reward in multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pages 4403–4414, 2019.
+[6] Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In AAAI Conference on Artificial Intelligence, pages 2974–2982, 2018.
+[7] Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pages 66–83, 2017.
+[8] Pablo Hernandez-Leal, Bilal Kartal, and Matthew E Taylor. A survey and critique of multiagent deep reinforcement learning. Autonomous Agents and Multi-Agent Systems, 33(6):750–797, 2019.
+[9] Maximilian Hüttenrauch, Adrian Šošic, and Gerhard Neumann. Guided deep reinforcement ´ learning for swarm systems. In AAMAS Autonomous Robots and Multirobot Systems (ARMS) Workshop, 2017.
+[10] Landon Kraemer and Bikramjit Banerjee. Multi-agent reinforcement learning as a rehearsal for decentralized planning. Neurocomputing, 190:82–94, 2016.
+[11] Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pages 6382–6393, 2017.
+[12] Anuj Mahajan, Tabish Rashid, Mikayel Samvelyan, and Shimon Whiteson. Maven: Multiagent variational exploration. In Advances in Neural Information Processing Systems, pages 7611–7622, 2019.
+[13] A Rupam Mahmood, Hado van Hasselt, and Richard S Sutton. Weighted importance sampling for off-policy learning with linear function approximation. In Advances in Neural Information Processing Systems, pages 3014–3022, 2014.
+[14] 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–533, 2015.
+[15] Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 73:1–15, 2018.
+[16] Frans A Oliehoek and Christopher Amato. A concise introduction to decentralized POMDPs. Springer, 2016.
+[17] Frans A Oliehoek, Matthijs TJ Spaan, and Nikos Vlassis. Optimal and approximate q-value functions for decentralized pomdps. Journal of Artificial Intelligence Research, 32:289–353, 2008.
+380 [18] Afshin OroojlooyJadid and Davood Hajinezhad. A review of cooperative multi-agent deep reinforcement learning. arXiv preprint arXiv:1908.03963, 2019.
+382 [19] Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani. Lenient multi-agent deep reinforcement learning. In International Conference on Autonomous Agents and MultiAgent Systems, pages 443–451, 2018. [20] Scott Proper and Kagan Tumer. Modeling difference rewards for multiagent learning. In International Conference on Autonomous Agents and Multi-Agent Systems, pages 1397–1398, 2012.
+388 [21] Tabish Rashid, Gregory Farquhar, Bei Peng, and Shimon Whiteson. Weighted qmix: Expanding monotonic value function factorisation. In Advances in Neural Information Processing Systems, pages 10199–10210, 2020. [22] Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pages 4295–4304, 2018. [23] Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philiph H. S. Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. CoRR, abs/1902.04043, 2019.
+398 [24] Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pages 5887–5896, 2019. [25] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In International Conference on Machine Learning, pages 3319–3328, 2017. [26] Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Valuedecomposition networks for cooperative multi-agent learning based on team reward. In International Conference on Autonomous Agents and MultiAgent Systems, pages 2085–2087, 2018. [27] Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3(1):9–44, 1988.
+410 [28] Kagan Tumer and Adrian Agogino. Distributed agent-based air traffic flow management. In International Joint Conference on Autonomous Agents and Multiagent Systems, pages 1–8, 2007. [29] Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. Qplex: Duplex dueling multi-agent q-learning. arXiv preprint arXiv:2008.01062, 2020. [30] Jianhong Wang, Yuan Zhang, Tae-Kyun Kim, and Yunjie Gu. Shapley q-value: A local reward approach to solve global reward games. In AAAI Conference on Artificial Intelligence, pages 7285–7292, 2020. [31] Tonghan Wang, Heng Dong, Victor Lesser, and Chongjie Zhang. Roma: Multi-agent reinforcement learning with emergent roles. In International Conference on Machine Learning, pages 9876–9886, 2020. [32] Tonghan Wang, Tarun Gupta, Anuj Mahajan, Bei Peng, Shimon Whiteson, and Chongjie Zhang. Rode: Learning roles to decompose multi-agent tasks. arXiv preprint arXiv:2010.01523, 2020. [33] Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. arXiv preprint arXiv:1611.01224, 2016. [34] David H Wolpert and Kagan Tumer. Optimal payoff functions for members of collectives. In Modeling complexity in economic and social systems, pages 355–369. World Scientific, 2002.
+[35] Yaodong Yang, Jianye Hao, Guangyong Chen, Hongyao Tang, Yingfeng Chen, Yujing Hu, Changjie Fan, and Zhongyu Wei. Q-value path decomposition for deep multiagent reinforcement learning. In International Conference on Machine Learning, pages 10706–10715, 2020.
+[36] Dayong Ye, Minjie Zhang, and Yun Yang. A multi-agent framework for packet routing in wireless sensor networks. Sensors, 15(5):10026–10047, 2015.
+[37] Wang Ying and Sang Dayong. Multi-agent framework for third party logistics in e-commerce. Expert Systems with Applications, 29(2):431–436, 2005.
+[38] Kaiqing Zhang, Zhuoran Yang, and Tamer Ba¸sar. Multi-agent reinforcement learning: A selective overview of theories and algorithms. arXiv preprint arXiv:1911.10635, 2019.
+[39] Meng Zhou, Ziyu Liu, Pengwei Sui, Yixuan Li, and Yuk Ying Chung. Learning implicit credit assignment for cooperative multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, 2020.
+
+# Checklist
+
+1. For all authors...
+
+(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
+(b) Did you describe the limitations of your work? [Yes] We discussed it in the experiment analysis in Section 4.3 and future work in Section 5.
+(c) Did you discuss any potential negative societal impacts of your work? [N/A]
+(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
+
+2. If you are including theoretical results...
+
+(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] We provided the proof of our Claim in the supplemental material.
+
+3. If you ran experiments...
+
+(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We provided our code and instructions in the supplemental material.
+(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We described the training details in the supplemental material.
+(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Figure 2, 4 and 5.
+(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We described it in the supplemental material.
+
+4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
+
+(a) If your work uses existing assets, did you cite the creators? [Yes]
+(b) Did you mention the license of the assets? [Yes]
+(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We provided our code in the supplemental material.
+(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
+(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
+
+5. If you used crowdsourcing or conducted research with human subjects...
+
+(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
+
+476 (b) Did you describe any potential participant risks, with links to Institutional Review
+477 Board (IRB) approvals, if applicable? [N/A]
+478 (c) Did you include the estimated hourly wage paid to participants and the total amount
+479 spent on participant compensation? [N/A]
\ No newline at end of file
diff --git a/md/train/KUDUoRsEphu/KUDUoRsEphu.md b/md/train/KUDUoRsEphu/KUDUoRsEphu.md
new file mode 100644
index 0000000000000000000000000000000000000000..6f4d9ee2e0cdd8b9a880a671ac32f88f40638829
--- /dev/null
+++ b/md/train/KUDUoRsEphu/KUDUoRsEphu.md
@@ -0,0 +1,362 @@
+# LEARNING INCOMPRESSIBLE FLUID DYNAMICS FROM SCRATCH - TOWARDS FAST, DIFFERENTIABLE FLUID MODELS THAT GENERALIZE
+
+Nils Wandel
+Department of Computer Science University of Bonn
+wandeln@cs.uni-bonn.de
+Michael Weinmann
+Department of Computer Science
+University of Bonn
+mw@cs.uni-bonn.de
+Reinhard Klein
+Department of Computer Science
+University of Bonn
+rk@cs.uni-bonn.de
+
+# ABSTRACT
+
+Fast and stable fluid simulations are an essential prerequisite for applications ranging from computer-generated imagery to computer-aided design in research and development. However, solving the partial differential equations of incompressible fluids is a challenging task and traditional numerical approximation schemes come at high computational costs. Recent deep learning based approaches promise vast speed-ups but do not generalize to new fluid domains, require fluid simulation data for training, or rely on complex pipelines that outsource major parts of the fluid simulation to traditional methods.
+
+In this work, we propose a novel physics-constrained training approach that generalizes to new fluid domains, requires no fluid simulation data, and allows convolutional neural networks to map a fluid state from time-point $t$ to a subsequent state at time $t + d t$ in a single forward pass. This simplifies the pipeline to train and evaluate neural fluid models. After training, the framework yields models that are capable of fast fluid simulations and can handle various fluid phenomena including the Magnus effect and Kármán vortex streets. We present an interactive real-time demo to show the speed and generalization capabilities of our trained models. Moreover, the trained neural networks are efficient differentiable fluid solvers as they offer a differentiable update step to advance the fluid simulation in time. We exploit this fact in a proof-of-concept optimal control experiment. Our models significantly outperform a recent differentiable fluid solver in terms of computational speed and accuracy.
+
+# 1 INTRODUCTION
+
+Simulating the behavior of fluids by solving the incompressible Navier-Stokes equations is of great importance for a wide range of applications and accurate as well as fast fluid simulations are a long-standing research goal. On top of simulating the behavior of fluids, several applications such as sensitivity analysis of fluids or gradient-based control algorithms rely on differentiable fluid simulators that allow to propagate gradients throughout the simulation (Holl et al. (2020)).
+
+Recent advances in deep learning aim for fast and accurate fluid simulations but rely on vast datasets and / or do not generalize to new fluid domains. Kim et al. (2019) present a framework to learn parameterized fluid simulations and allow to interpolate efficiently in between such simulations. However, their work does not generalize to new domain geometries that lay outside the training data. Kim & Lee (2020) train a RNN-GAN that produces turbulent flow fields within a pipe domain, but do not show generalization results beyond pipe domains. Xie et al. (2018) introduce a tempoGAN to perform temporally consistent superresolution of smoke simulations. This allows to produce plausible high-resolution smoke-density fields for arbitrary low-resolution inputs, but our fluid model should output a complete fluid state description consisting of a velocity and a pressure field. Tompson et al. (2017) present how a Helmholtz projection step can be learned to accelerate Eulerian fluid simulations. This method generalizes to new domain geometries, but a particle tracer is needed to deal with the advection term of the Navier-Stokes equations. Furthermore, as Eulerian fluids do not model viscosity, effects like e.g. the Magnus effect or Kármán vortex streets cannot be simulated. Geneva & Zabaras (2020) propose a physics-informed framework to learn the entire update step for the Burgers equations in 1D and 2D, but no generalization results for new domain geometries are demonstrated. All of the aforementioned methods rely on the availability of vast amounts of data from fluid-solvers such as FEniCS, OpenFOAM or Mantaflow. Most of these methods do not generalize well or outsource a major part of the fluid simulation to traditional methods such as low-resolution fluid solvers or a particle tracer.
+
+In this work, we propose a novel unsupervised training framework to learn incompressible fluid dynamics from scratch. It does not require any simulated fluid-data (neither as ground truth data, nor to train an adversarial network, nor to initialize frames for a physics-constrained loss) and generalizes to fluid domains unseen during training. It allows CNNs to learn the entire update-step of mapping a fluid domain from time-point $t$ to $t + d t$ without having to rely on low resolution fluid-solvers or a particle-tracer. In fact, we will demonstrate that a physicsconstrained loss function combined with a simple strategy to recycle fluid-data generated by the neural network at training time suffices to teach CNNs fluid dynamics on increasingly realistic statistics of fluid states. This drastically simplifies the training pipeline. Fluid simulations get efficiently unrolled in time by recurrently applying the trained model on a fluid state. Furthermore, the fluid models include viscous friction and handle effects such as the Magnus effect and Kármán vortex streets. On top of that, we show by a gradient-based optimal control example how backpropagation through time can be used to differentiate the fluid simulation. Code and pretrained models are publicly available at https://github.com/aschethor/ Unsupervised_Deep_Learning_of_Incompressible_Fluid_Dynamics/.
+
+# 2 RELATED WORK
+
+In literature, several different approaches can be found that aim to approximate the dynamics of PDEs in general and fluids in particular with efficient, learning-based surrogate models.
+
+Lagrangian methods such as smoothed particle hydrodynamcs (SPH) Gingold & Monaghan (1977) handle fluids from the perspective of many individual particles that move with the velocity field. Following this approach, learning-based methods using regression forests by Ladický et al. (2015), graph neural networks by Mrowca et al. (2018); Li et al. (2019) and continuous convolutions by Ummenhofer et al. (2020) have been developed. In addition, Smooth Particle Networks (SP-Nets) by Schenck & Fox (2018) allow for differentiable fluid simulations within the Lagrangian frame of reference. These Lagrangian methods are particularly suitable when a fluid domain exhibits large, dynamic surfaces (e.g. waves or droplets). However, to simulate the dynamics within a fluid domain accurately, Eulerian methods, that treat the Navier-Stokes equations in a fixed frame of reference, are usually better suited.
+
+Continuous Eulerian methods allow for mesh-free solutions by mapping domain coordinates (e.g. $x , y , t )$ directly onto field values (e.g. velocity $\vec { v } \ : /$ pressure $p$ ) (Sirignano & Spiliopoulos (2018); Grohs et al. (2018); Khoo et al. (2019)). Recent applications focused on flow through porous media (Zhu & Zabaras (2018); Zhu et al. (2019); Tripathy & Bilionis (2018)), fluid modeling (Yang et al. (2016); Raissi et al. (2018)), turbulence modeling (Geneva & Zabaras (2019); Ling et al. (2016)) and modeling of molecular dynamics (Schöberl et al. (2019)). Training is usually based on physics-constrained loss functions that penalize residuals of the underlying PDEs. Similar to our approach, Raissi et al. (2019) uses vector potentials to obtain continuous divergence-free velocity fields to approximate the incompressible Navier-Stokes equations. Continuous methods return smooth, accurate results and can overcome the curse of dimensionality of discrete techniques in high-dimensional PDEs (Grohs et al. (2018)). However, these networks are trained on a specific domain and cannot generalize to new environments or be used in interactive scenarios.
+
+Discrete Eulerian methods, on the other hand, aim to solve the underlying PDEs on a grid and early work dates back to Harlow & Welch (1965) and Stam (1999). Accelerating such traditional works with deep learning techniques is a major field of research and all of the methods mentioned in the introduction fall into this category. Further methods include the approach by Thuerey et al. (2019) to learn solutions of the Reynolds-averaged Navier-Stokes equations for airfoil flows, but requires large amounts of training data and does not generalize beyond airfoil flows. In the work by Um et al. (2020), a correction step is learned that brings solutions of a low-resolution differentiable fluid solver closer to solutions of a high-resolution fluid simulation. However, generalization results for new domain geometries were not presented. The works of Mohan et al. (2020) and Kim et al. (2019) show that vector potentials are suitable to enforce the incompressibility constraint in fluids but do not generalize to new fluid domains beyond their training data.
+
+# 3 METHOD
+
+In this section, we briefly review the incompressible Navier-Stokes equations, which are to be solved by the neural network. Then, we explain how the Helmholtz decomposition can be exploited to ensure incompressibility within the fluid domain. Furthermore, we provide details of our discrete spatio-temporal fluid representation and introduce the fluid model. Afterwards, we formulate a physics-constrained loss function based on residuals of the Navier-Stokes equations and introduce a pressure regularization term for very high Reynolds numbers. Finally, we explain the unsupervised training strategy.
+
+# 3.1 INCOMPRESSIBLE NAVIER-STOKES EQUATIONS
+
+Most fluids can be modeled with the incompressible Navier-Stokes equations - a set of non-linear equations that describe the interplay of a velocity field $\vec { v }$ and a pressure field $p$ within a fluid domain $\Omega$ :
+
+$$
+\begin{array} { r l r } { \boldsymbol { \nabla } \cdot \boldsymbol { \vec { v } } = 0 } & { \mathrm { i n c o m p r e s s i b i l i t y ~ o n ~ } \Omega } \\ { \rho \dot { \vec { v } } = \rho \left( \frac { \partial \vec { v } } { \partial t } + \left( \vec { v } \cdot \boldsymbol { \nabla } \right) \vec { v } \right) = - \boldsymbol { \nabla } p + \mu \Delta \vec { v } + \vec { f } } & { \mathrm { c o n s e r v a t i o n ~ o f ~ m o m e n t u m ~ o n ~ } \Omega } \end{array}
+$$
+
+Here, $\rho$ describes the fluid density and $\mu$ the viscosity. Equation 1 states that the fluid is incompressible and thus $\vec { v }$ is divergence-free. Equation 2 states that the change in momentum of fluid particles must correspond to the sum of forces that arise from the pressure gradient, viscous friction and external forces. Here, external forces on the fluid (such as e.g. gravity) can be neglected, so we set ${ \vec { f } } = 0$ .
+
+These incompressible Navier-Stokes equations shall be solved by a CNN given initial conditions $\vec { v } ^ { 0 }$ and $p ^ { 0 }$ at the beginning of the simulation and Dirichlet boundary conditions which constrain the velocity field at the domain boundary $\partial \Omega$ :
+
+$$
+\vec { v } = \vec { v } _ { d } \qquad \mathrm { D i r i c h l e t ~ b o u n d a r y ~ c o n d i t i o n ~ o n ~ } \partial \Omega
+$$
+
+# 3.2 HELMHOLTZ DECOMPOSITION
+
+A common method to ensure incompressibility of a fluid (see Equation 1) is to project the flow field onto the divergence-free part of its Helmholtz decomposition. The Helmholtz theorem states that every vector field $\vec { v }$ can be decomposed into a curl-free part $( \nabla q )$ and a divergence-free part $( \nabla \times \vec { a } )$ :
+
+$$
+\vec { v } = \nabla q + \nabla \times \vec { a }
+$$
+
+Note, that $\nabla \times ( \nabla q ) = \vec { 0 }$ and $\nabla \cdot ( \nabla \times { \vec { a } } ) = 0$ . The Helmholtz projection consists of solving the Poisson problem $\nabla \cdot \vec { v } = \Delta q$ for $q$ , followed by substracting $\nabla q$ from the original flow field. However, solving the Poisson equation on arbitrary domains comes at high computational costs for classical methods and one has to rely e.g. on conjugate gradient methods to approximate its solution.
+
+Here, we propose a different approach and directly try to learn a vector potential $\vec { a }$ with $\vec { v } = \nabla \times \vec { a }$ . This ensures that the network outputs a divergence-free velocity field within the domain $\Omega$ and automatically solves Equation 1. In this work, we consider 2D fluid simulations, so only the $\mathbf { Z }$ - component of $\vec { a }$ , $a _ { z }$ , is of interest since $v _ { z }$ and all derivatives with respect to the $z$ -axis are zero:
+
+$$
+\nabla \times { \vec { a } } = \left( { \partial _ { z } a _ { x } - \partial _ { z } a _ { y } } \right) = \left( { \partial _ { y } a _ { z } } \right) = \left( { \begin{array} { c } { v _ { x } } \\ { v _ { y } } \\ { 0 } \end{array} } \right) = { \vec { v } }
+$$
+
+# 3.3 DISCRETE SPATIO-TEMPORAL FLUID REPRESENTATION
+
+Marker-And-Cell (MAC) grid To solve the Navier-Stokes equations, we represent the relation between $a _ { z } , v _ { x } , v _ { y } , p$ on a 2D staggered marker-and-cell (MAC) grid (see Figure 1a). Therefore, we discretise time and space as follows:
+
+$$
+\vec { a } ( x , y , t ) = \left( \begin{array} { c } { 0 } \\ { 0 } \\ \left( a _ { z } \right) _ { i , j } ^ { t } \rule { 0 ex } { 5 ex } \right) ; \vec { v } ( x , y , t ) = \binom { \left( v _ { x } \right) _ { i , j } ^ { t } } { \left( v _ { y } \right) _ { i , j } ^ { t } } ; p ( x , y , t ) = p _ { i , j } ^ { t } \end{array}
+$$
+
+Obtaining gradient, divergence, Laplace and curl operations on this grid with finite differences is straight forward and can be efficiently implemented with convolutions (see appendix A).
+
+
+Figure 1: MAC grid and diagram of the fluid model.
+
+Explicit, Implicit, Implicit-Explicit (IMEX) time integration methods The discretization of the time domain is needed to deal with the time-derivative of the velocity fiel d ∂\~v∂t in Equation 2, which becomes:
+
+$$
+\rho \left( \frac { \vec { v } ^ { t + d t } - \vec { v } ^ { t } } { d t } + \left( \vec { v } ^ { t ^ { \prime } } \cdot \nabla \right) \vec { v } ^ { t ^ { \prime } } \right) = - \nabla p ^ { t + d t } + \mu \Delta \vec { v } ^ { t ^ { \prime } } + \vec { f }
+$$
+
+The goal is to take as large as possible timesteps $d t$ while maintaining stable and accurate solutions. Stability and accuracy largely depend on the definition of $v ^ { t ^ { \prime } }$ . In literature, choosing $\boldsymbol { v } ^ { t ^ { \prime } } = \boldsymbol { v } ^ { t }$ is often referred to as explicit integration methods and frequently leads to unstable behavior. Choosing $v ^ { t ^ { \prime } } = v ^ { t + d t }$ is usually associated with implicit integration methods and gives stable solutions at the cost of numerical dissipation. Implicit-Explicit (IMEX) methods, which set $v ^ { t ^ { \prime } } = ( v ^ { t } + v ^ { t + d t } ) / 2$ are a compromise between both methods and considered to be more accurate but less stable than implicit methods.
+
+# 3.4 FLUID MODEL
+
+We represent the fluid dynamics by a recurrent model that maps the fluid state $p ^ { t } , \vec { a } ^ { t }$ for timestep $t$ and the domain description $\Omega ^ { t + d t } , \vec { v } _ { d } ^ { t + d t }$ to the fluid state $p ^ { t + d t } , \vec { a } ^ { t + d t }$ of the next timestep. Here, $p ^ { t }$ describes the pressure field and $\vec { a } ^ { t }$ describes the vector potential of . For $t = 0$ , we consider initial states $p ^ { 0 } = 0$ and $\vec { a } ^ { 0 } = \vec { 0 }$ , however, other initial conditions could be considered as well. $\Omega ^ { t + d t }$ is a binary mask that contains the domain geometry and is 1 for the fluid domain and 0 everywhere else. For the boundary of the domain, we simply take the inverse of $\Omega \colon \partial \Omega = 1 - \Omega$ . $\vec { v } _ { d } ^ { t + \dot { d } t }$ represents the Dirichlet boundary conditions and contains a velocity field that must be matched by ${ \vec { v } } ^ { t + d t }$ at the domain boundaries. Figure 1b shows a diagram of the fluid model. First, $\left( p ^ { t } , \vec { a } ^ { t } , \Omega ^ { t + d t } , \vec { v } _ { d } ^ { t + d t } \right)$ are taken to derive a slightly more meaningful feature representation that comprises $\left( p ^ { t } , a ^ { t } , \nabla \times a ^ { t } , \Omega ^ { t + d t } , \partial \Omega ^ { t + d t } , \Omega ^ { t + d t } \cdot \nabla \times a ^ { t } , \Omega ^ { t + d t } \cdot p ^ { t } , \partial \Omega ^ { t + d t } \cdot \vec { v } _ { d } ^ { t + d t } \right)$ . These features can be very efficiently computed with convolutions and are then fed into a U-Net (Ronneberger et al. (2015)) with a reduced number of channels (the exact network configuration can be found in appendix B). The mean of the U-Net output is set to 0 in order to keep $p$ and $\vec { a }$ well defined and prevent drifting offset values. Finally, the output is added to $p ^ { t }$ and $\vec { a } ^ { t }$ to obtain the updated fluid state $p ^ { t + d t }$ and $\vec { a } ^ { t + d t }$ .
+
+# 3.5 PHYSICS-CONSTRAINED LOSS FUNCTION
+
+Using the residuals of the Navier-Stokes equations (Equations 1 and 2), we can formulate the following loss terms on $\Omega$ and $\partial \Omega$ :
+
+$$
+\begin{array} { l l } { { L _ { d } = \displaystyle { \left\| \nabla \cdot \vec { v } \right\| ^ { 2 } } } } & { { \qquad \mathrm { ~ d i v e r g e n c e ~ l o s s ~ o n ~ } \Omega } } \\ { { L _ { p } = \displaystyle { \left\| \rho \left( \frac { \partial \vec { v } } { \partial t } + \left( \vec { v } \cdot \nabla \right) \vec { v } \right) + \nabla p - \mu \Delta \vec { v } - \vec { f } \right\| ^ { 2 } } } } & { { \qquad \mathrm { ~ m o m e n t u m ~ l o s s ~ o n ~ } \Omega } } \\ { { L _ { b } = \displaystyle { \left\| \vec { v } - \vec { v } _ { d } \right\| ^ { 2 } } } } & { { \qquad \mathrm { ~ b o u n d a r y ~ l o s s ~ o n ~ } \partial \Omega } } \end{array}
+$$
+
+Combining the described loss terms, we obtain the following loss function:
+
+$$
+L = \alpha L _ { d } + \beta L _ { p } + \gamma L _ { b }
+$$
+
+where $\alpha , \beta , \gamma$ are hyperparameters that weight the contributions of the different loss terms. Note that if we use a vector potential ${ \vec { v } } = \nabla \times { \vec { a } }$ , $L _ { d } = 0$ is automatically fulfilled and we can set $\alpha = 0$ . This loss function can be computed very efficiently with convolutions in $O ( N )$ (where $N =$ number of grid cells), whereas solving the Navier-Stokes equations explicitly would be computationally a lot more expensive. For detailed descriptions regarding the fully discretized loss-function, we refer to appendix A.
+
+# 3.6 PRESSURE REGULARIZATION
+
+For very high Reynolds numbers (see Equation 13) and inviscid flows, training becomes unstable as viscous friction cannot dissipate enough energy out of the system. This leads to unrealistic gradients in $\vec { v }$ and $p$ . For such cases, we introduce an additional regularization term for the loss function (11) that can be traded off with $L _ { p }$ to stabilize training:
+
+$$
+L _ { r } = \| \nabla p \| ^ { 2 }
+$$
+
+The intuition behind this regularization term is, that we want to penalize unrealistically high energies in the pressure field.
+
+# 3.7 TRAINING STRATEGY
+
+Training starts with initializing a pool $\{ \Omega _ { k } ^ { 0 } , ( v _ { d } ) _ { k } ^ { 0 } , ( a _ { z } ) _ { k } ^ { 0 } , p _ { k } ^ { 0 } \}$ of randomized domains $\Omega _ { k } ^ { 0 }$ and boundary conditions $( v _ { d } ) _ { k } ^ { 0 }$ as well as initial conditions for the vector potential and pressure fields that we both set to zero $( \check { ( a _ { z } ) } _ { k } ^ { 0 } = 0$ and $p _ { k } ^ { 0 } = 0$ ). The resolution of our training domains is $1 0 0 \mathrm { x } 3 0 0$ grid cells and example-domains of the training pool are shown in appendix C. Note that our training pool does not rely on any previously simulated fluid-data.
+
+At each training step, a random mini-batch $\{ \Omega _ { k } ^ { t } , ( v _ { d } ) _ { k } ^ { t } , ( a _ { z } ) _ { k } ^ { t } , p _ { k } ^ { t } \} _ { \{ k \in \operatorname * { m i n i b a t c h } \} }$ is drawn from the pool and fed into the neural network which is designed to predict the velocity $( \vec { v } _ { k } ^ { t + d t } = \nabla \times \vec { a } _ { k } ^ { t + d t } )$ and pressure $( p _ { k } ^ { t + d t } )$ fields of the next time step. Based on a physics-constrained loss-function (Equation 11), we update the weights of the network using the Adam optimizer (Kingma & Ba (2015)). At the end of each training step, the pool is updated by replacing the old vector potential and pressure fields $( a _ { z } ) _ { k } ^ { t } , p _ { k } ^ { t }$ by the newly predicted ones $( a _ { z } ) _ { k } ^ { t + \dot { d t } } , p _ { k } ^ { \dot { t } + d t }$ t, pt+dtk . This recycling strategy fills the training pool with more and more realistic fluid states as the model becomes better at simulating fluid dynamics.
+
+From time to time, old environments of the training pool are replaced by new randomized environments and the vector potential as well as the pressure fields are reset to 0. This increases the variance of the training pool and helps the neural network to learn "cold starts" from \~0-velocity and 0-pressure fields.
+
+Besides the fluid model described above, which we denote as $\vec { a }$ -Net in the following, we also trained an ablation model, $\vec { v }$ -Net, that directly learns to predict the velocity field without a vector potential. For the implementation of both models, we used the popular machine learning framework Pytorch and trained the models on a NVidia GeForce RTX 2080 Ti. Training converged after about 1 day. The hyperparameters in the loss-function for the $\vec { a }$ -Net were $\beta = 1$ and $\gamma = 2 0$ . The reason for choosing a higher weight for the loss term $L _ { b }$ than for $L _ { p }$ was the observation, that errors in $L _ { b }$ can lead to unrealistic flows leaking through boundaries. For the ablation study $\vec { v } \cdot \vec { }$ -Net), we used $\alpha = 1 0 0 , \beta = 1 , \gamma = 0 . 0 0 1$ . Here, we had to choose a very high weight for $L _ { d }$ to ensure incompressibility of the fluid, otherwise unrealistic source and sink effects start to appear. For $L _ { b }$ , on the other hand, we used a very low weight as the boundary conditions can be trivially learned by the $\vec { v }$ -Net. We used these parameter settings for all experiments.
+
+# 4 RESULTS
+
+To evaluate the potential of our method, we assess its ability to reproduce physical effects such as Kármán vortex streets and the Magnus effect. In addition, we demonstrate its generalization capability and real-time performance. Finally, we test the fluid models quantitatively.
+
+# 4.1 QUALITATIVE EVALUATION
+
+Qualitative analysis of wake dynamics Qualitative effects in fluid dynamics such as the wake dynamics behind an obstacle are closely related to the Reynolds number. It is a dimensionless quantity defined by:
+
+$$
+R e = \frac { \rho \left\| \vec { v } \right\| D } { \mu }
+$$
+
+Here, $\rho$ is the fluid density, $\lVert \vec { v } \rVert$ is the fluid speed, $D$ is the diameter of the obstacle, and $\mu$ is the viscosity. (We use the units of the grid).
+
+We retrained models for different values of $\mu$ and $\rho$ to compare the fluid behavior for a wide range of Reynolds numbers. Figure 2 shows, that the trained models are able to predict the wake dynamics behind an obstacle in good accordance with qualitative expectations from fluid dynamics. As a rule of thumb, for $R e \ll 1$ , the flow becomes time-reversible. This can be noticed in Figure 2a by the symmetry of the flow before and after the obstacle and the nearly constant pressure gradient within the pipe. Starting from $R e \approx 1 0$ , the flow is still laminar but a static wake is forming behind the obstacle (see Figure 2b). For Reynolds numbers $R e > \approx 9 0$ , Kármán vortex streets start to appear (see Figure 2c). A Kármán vortex street consists of clock and counterclockwise spinning vortices that are generated at the obstacle and then start moving in a regularly oscillating pattern with the flow. For very large Reynolds numbers or inviscid flows, the flow field becomes turbulent, which can be recognized by the irregular patterns behind the obstacle in Fig 2d.
+
+
+Figure 2: After training, our models are able to show correct wake flow dynamics for a wide range of different Reynolds numbers. $\dot { \boldsymbol { D } } = 3 0$ , $\| \vec { v } \| = 0 . 5 )$ . Streamlines indicate flow direction, linewidth indicates speed and colors represent the pressure field (blue: low pressure / yellow: high pressure).
+
+Magnus effect The Magnus effect appears when a flow interacts with a rotating body. It is widely known e.g. in sports such as soccer or tennis where spin is used to deflect the path of a ball. The reason for the deflection stems from a low pressure field where the surface of the object moves along flow direction and a high pressure field where the object surface moves against the flow. Figure 3a shows, that our models are able to reproduce the Magnus effect around a rotating cylinder.
+
+
+(a) Magnus effect on a clock-wise turning cylinder.(b) Generalization example: Note that the fluid model has never been confronted with wingprofiles during training.
+
+Figure 3: Our models feature the Magnus effect and generalize to new fluid domains. Further examples are presented in appendix D and the video.
+
+Analysis of generalization capability We tested the networks capability to generalize to objects not seen during training. Figure 3b shows the networks capability to meet boundary conditions of an airfoil and return a plausible pressure field that produces lift (see low pressure on top of wing). Note that in contrast to the approach by Thuerey et al. (2019), which learns simplified, time-averaged solutions of the Navier-Stokes equations, our method is able to simulate the full incompressible Navier-Stokes equations for an airfoil without relying on any ground truth data or having seen airfoilgeometries during training. In fact, the network was only trained on simple randomized domains as highlighted in appendix C and Figure 7. Possible reasons for the networks generalization capabilities are:
+
+• During training, the network gets confronted with an infinite number of different flowfields and randomized domain configurations because the training pool gets updated at every training step. This prevents the network from over-fitting.
+
+• The dynamics of a fluid-particle are mostly determined by its local neighborhood / surrounding particles. This means, the update step for a certain cell on the MAC grid is mostly determined by close / neighboring MAC-grid cells. Since more complicated shapes can be seen locally as a composition of basic shapes (e.g. the front of the wing can be locally regarded as a cylinder), it suffices to train on basic shapes that provide the network with enough examples to generalize to more complicated shapes.
+
+Further generalization examples are provided in appendix D.
+
+Real-time capability The fluid simulation can be easily parallelized and takes low computational costs as one time-integration step consists just of a single forward pass through a convolutional neural network. This enables for example interactive real-time simulations. We implemented a demo that allows to interact with a fluid by moving obstacles, rotating spheres and changing the flow speed within a pipe (see video in supplementary material and source code). Our method runs at 250 timesteps per second on a $1 0 0 \mathrm { x } 3 0 0$ grid. In the respective experiments, we used a NVidia GeForce RTX 2080 Ti consuming about $8 6 0 \mathrm { M B }$ of GPU memory.
+
+# 4.2 QUANTITATIVE EVALUATION
+
+We compare our method $\vec { a }$ -Net) quantitatively with PhiFlow by Holl et al. (2020). Phiflow is a recent, open source, differentiable fluid simulator based on a MAC grid data structure. Furthermore, we provide an ablation study ${ \vec { v } } .$ -Net) that does not make use of the Helmholtz decomposition but directly works on the velocity field $\vec { v }$ .
+
+Quantitative comparison of different fluid solvers is challenging, as their performance is highly dependent on factors like the geometry of the domain, fluid parameters such as viscosity or density, flow speed or the timestep of the integrator. As benchmarks for fluid simulations on MAC grids are not yet available, we built a simple toy domain on a $1 0 0 \mathrm { ~ x ~ } 1 0 0$ grid which simulates a flow around an obstacle within a pipe (more details are provided in appendix E).
+
+First, we compared the computational speed on a CPU and GPU by comparing the integration time-steps per second (see Table 1). The $\vec { v }$ -Net as well as the $\vec { a }$ -Net are significantly faster than PhiFlow (11x on CPU and $4 0 \mathrm { x }$ on GPU) as they do not rely on an iterative conjugate gradient solver but instead use a single forward pass through a convolutional neural network that can be easily parallelized on a GPU. To provide a fair comparison on $L _ { d }$ , we set the velocity field at the boundaries equal to $\vec { v _ { d } }$ . This enables us to compute $L _ { d }$ for the $\vec { a }$ -Net architecture on the domain boundaries which would otherwise have zero divergence everywhere. This way, $L _ { d }$ can be interpreted as a metric on how well the orthogonal components of the Dirichlet boundary conditions are met (i.e. no flow leaks through the boundaries). For $d t = 4$ , we outperformed Phiflow by several orders of magnitude. For both, $L _ { d }$ and $L _ { p }$ , the $\vec { a }$ -Net architecture significantly outperformed the more naive $\vec { v }$ -Net approach.
+
+Furthermore, we investigated stability by evaluating the evolution of $L _ { p }$ and $L _ { d }$ for the $\vec { a }$ -Net over time (see Figure 4). As the fluid state is initialized with $a _ { z } = 0$ and $p = 0$ , the $\vec { a }$ -Net has to perform a cold-start which is the reason for high $L _ { p }$ and $L _ { d }$ during the first circa 70 steps. Afterwards, the $\vec { a }$ -Net continues an accurate and stable fluid simulation.
+
+Table 1: Quantitative comparison of timesteps per second (TPS) on CPU / GPU as well as divergence loss and momentum loss for differentiable fluid solvers on a $1 0 0 \mathrm { x } 1 0 0$ grid for viscosity $\mu =$ 0.1, density $\rho = 4$ and timesteps of size $d t = 4$ .
+
+
Method
CPU[TPS]
GPU[TPS]
Ld
Lp
PhiFlow
7
-
6.2e-4
-
U-Net (ours)
82
311
8.66e-7
4.87e-5
α-Net (ours)
82
311
5.44e-7
1.56e-5
+
+
+Figure 4: Long term stability of fluid simulations performed by the $\vec { a }$ -Net
+
+# 4.3 OPTIMAL CONTROL OF VORTEX SHEDDING FREQUENCY
+
+In this section, we present a proof-of-concept experiment that aims at controlling the shedding frequency of a Kármán vortex street behind an obstacle by changing the flow speed (see Figure 5a). To this end, we exploit our previously trained differentiable fluid models.
+
+
+
+(a) control setup (domain size: $2 0 0 \mathrm { x } 1 0 0$ grid cells)
+
+
+Figure 5: The frequency of vortex streets can be controlled using our differentiable fluid models.
+
+First, we measure the y-component of the velocity field $v _ { y } ( t )$ behind an obstacle (see white box in Figure 5a) over 200 time steps. Then, we compute the frequency spectrum $V _ { y } ( f )$ of $v _ { y } ( t )$ using the fast Fourier transform (see Figure 5b). Now, we want to adjust the inflow $/$ outflow boundary conditions in $\vec { v _ { d } }$ such that $E [ | V _ { y } ( f ) | ^ { 2 } ] = \hat { f }$ . Here, $\hat { f }$ is the target frequency. To optimize $\Vec { v _ { d } }$ , we define a loss function $L = ( E [ | V _ { y } ( f ) | ^ { 2 } ] - \hat { f } ) ^ { 2 }$ and compute the gradients $\frac { \partial L } { \partial \vec { v } _ { d } }$ with backpropagation through time. This is possible since all parts of the loss function including the fluid simulation that is performed by our trained neural fluid model as well as the fast Fourier transform are differentiable. Computing the gradients with a standard automatic differentiation library (Pytorch) took 3.5 seconds for all 200 time steps on our $2 0 0 \mathrm { x } 1 0 0$ domain setup. This is considerably faster than the current state-of-the-art differentiable fluid solver by Takahashi et al. (2021) which takes 5.42 seconds for only 30 time steps on a smaller $1 2 8 \mathrm { x } 1 2 8$ grid. The update steps of $\Vec { v _ { d } }$ are done using the ADAMoptimizer and converge after approximately 70 iterations (see Figure 5c). We want to emphasize that differentiable fluid simulations are limited to scenarios with low Reynolds numbers as in the presence of turbulences, chaotic behavior will lead to exploding gradients.
+
+# 5 DISCUSSION AND OUTLOOK
+
+In this work, we present an unsupervised learning scheme for the incompressible Navier-Stokes equations and introduce a fluid model that uses a vector potential to output divergence-free velocity fields. Qualitative results of our trained fluid models are in good accordance with expectations from fluid dynamics for a wide range of Reynolds numbers and generalize to unknown fluid domains. Quantitative assessment showed superior performance in terms of accuracy and speed compared to Phiflow and an ablation study that directly predicts the velocity field. We present a real-time demo and demonstrate how differentiability can be used in a proof-of-concept fluid control scenario. We believe that our fluid models can significantly speed up more sophisticated fluid control pipelines such as described by Holl et al. (2020).
+
+First experiments of extending this approach to 3D deliver encouraging results and are topic of future research. Furthermore, on top of Dirichlet boundary conditions, Neumann boundary conditions and multi-phase domains could be incorporated in future fluid models as well.
+
+# REFERENCES
+
+Nicholas Geneva and Nicholas Zabaras. Quantifying model form uncertainty in reynolds-averaged turbulence models with bayesian deep neural networks. Journal of Computational Physics, 383: 125 – 147, 2019. ISSN 0021-9991. doi: https://doi.org/10.1016/j.jcp.2019.01.021. URL http: //www.sciencedirect.com/science/article/pii/S0021999119300464.
+
+Nicholas Geneva and Nicholas Zabaras. Modeling the dynamics of pde systems with physicsconstrained deep auto-regressive networks. Journal of Computational Physics, 403:109056, 2020.
+
+Robert A. Gingold and Joseph J. Monaghan. Smoothed particle hydrodynamics: theory and application to non-spherical stars. Monthly notices of the royal astronomical society, 181(3): 375–389, 1977.
+
+Philipp Grohs, Fabian Hornung, Arnulf Jentzen, and Philippe Von Wurstemberger. A proof that artificial neural networks overcome the curse of dimensionality in the numerical approximation of black-scholes partial differential equations. arXiv preprint arXiv:1809.02362, 2018.
+
+Francis H. Harlow and J. Eddie Welch. Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface. The physics of fluids, 8(12):2182–2189, 1965.
+
+Philipp Holl, Vladlen Koltun, and Nils Thuerey. Learning to control pdes with differentiable physics. ICLR, 2020.
+
+Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving for high-dimensional committor functions using artificial neural networks. Research in the Mathematical Sciences, 6(1):1, 2019.
+
+Byungsoo Kim, Vinicius C. Azevedo, Nils Thuerey, Theodore Kim, Markus Gross, and Barbara Solenthaler. Deep fluids: A generative network for parameterized fluid simulations. In Computer Graphics Forum, volume 38, pp. 59–70. Wiley Online Library, 2019.
+
+Junhyuk Kim and Changhoon Lee. Deep unsupervised learning of turbulence for inflow generation at various reynolds numbers. Journal of Computational Physics, 406:109216, 2020. ISSN 0021- 9991. doi: https://doi.org/10.1016/j.jcp.2019.109216. URL http://www.sciencedirect. com/science/article/pii/S0021999119309210.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
+
+L’ubor Ladický, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Datadriven fluid simulations using regression forests. ACM Trans. Graph., 34(6), October 2015. ISSN 0730-0301. doi: 10.1145/2816795.2818129. URL https://doi.org/10.1145/ 2816795.2818129.
+
+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.
+
+Julia Ling, Andrew Kurzawski, and Jeremy Templeton. Reynolds averaged turbulence modelling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 807:155– 166, 2016.
+
+Arvind T. Mohan, Nicholas Lubbers, Daniel Livescu, and Michael Chertkov. Embedding hard physical constraints in neural network coarse-graining of 3d turbulence, 2020.
+
+Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li Fei-Fei, Joshua B. Tenenbaum, and Daniel L. K. Yamins. Flexible neural representation for physics prediction. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, pp. 8813–8824, Red Hook, NY, USA, 2018. Curran Associates Inc.
+
+Maziar Raissi, Alireza Yazdani, and George Em Karniadakis. Hidden fluid mechanics: A navierstokes informed deep learning framework for assimilating flow visualization data. arXiv preprint arXiv:1808.04327, 2018.
+
+Maziar Raissi, P. Perdikaris, and George Em Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686 – 707, 2019. ISSN 0021- 9991. doi: https://doi.org/10.1016/j.jcp.2018.10.045. URL http://www.sciencedirect. com/science/article/pii/S0021999118307125.
+
+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.
+
+Connor Schenck and Dieter Fox. Spnets: Differentiable fluid dynamics for deep neural networks. In Conference on Robot Learning, pp. 317–335, 2018.
+
+Markus Schöberl, Nicholas Zabaras, and Phaedon-Stelios Koutsourelakis. Predictive collective variable discovery with deep bayesian models. The Journal of Chemical Physics, 150(2):024109, 2019. doi: 10.1063/1.5058063. URL https://doi.org/10.1063/1.5058063.
+
+Justin Sirignano and Konstantinos Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of Computational Physics, 375:1339 – 1364, 2018. ISSN 0021- 9991. doi: https://doi.org/10.1016/j.jcp.2018.08.029. URL http://www.sciencedirect. com/science/article/pii/S0021999118305527.
+
+Jos Stam. Stable fluids. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques, pp. 121–128, 1999.
+
+Tetsuya Takahashi, Junbang Liang, Yi-Ling Qiao, and Ming C Lin. Differentiable fluids with solid coupling for learning and control. 2021.
+
+Nils Thuerey, Konstantin Weißenow, Lukas Prantl, and Xiangyu Hu. Deep learning methods for reynolds-averaged navier–stokes simulations of airfoil flows. AIAA Journal, pp. 1–12, 2019.
+
+Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating eulerian fluid simulation with convolutional networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3424–3433. JMLR. org, 2017.
+
+Rohit K. Tripathy and Ilias Bilionis. Deep uq: Learning deep neural network surrogate models for high dimensional uncertainty quantification. Journal of Computational Physics, 375:565 – 588, 2018. ISSN 0021-9991. doi: https://doi.org/10.1016/j.jcp.2018.08.036. URL http://www. sciencedirect.com/science/article/pii/S0021999118305655.
+
+Kiwon Um, Raymond Fei, Philipp Holl, Robert Brand, and Nils Thuerey. Solver-in-the-loop: Learning from differentiable physics to interact with iterative pde-solvers, 2020.
+
+Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id $=$ B1lDoJSYDH.
+
+You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. Tempogan: A temporally coherent, volumetric gan for super-resolution fluid flow. ACM Trans. Graph., 37(4), July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201304. URL https://doi.org/10.1145/3197517.3201304.
+
+Cheng Yang, Xubo Yang, and Xiangyun Xiao. Data-driven projection method in fluid simulation. Computer Animation and Virtual Worlds, 27(3-4):415–424, 2016. doi: 10.1002/cav.1695. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/cav.1695.
+
+Yinhao Zhu and Nicholas Zabaras. Bayesian deep convolutional encoder–decoder networks for surrogate modeling and uncertainty quantification. Journal of Computational Physics, 366:415 – 447, 2018. ISSN 0021-9991. doi: https://doi.org/10.1016/j.jcp.2018.04.018. URL http: //www.sciencedirect.com/science/article/pii/S0021999118302341.
+
+Yinhao Zhu, Nicholas Zabaras, Phaedon-Stelios Koutsourelakis, and Paris Perdikaris. Physicsconstrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data. Journal of Computational Physics, 394:56 – 81, 2019. ISSN 0021-9991. doi: https://doi.org/10.1016/j.jcp.2019.05.024. URL http://www.sciencedirect.com/ science/article/pii/S0021999119303559.
+
+# A PHYSICS-CONSTRAINED LOSS ON A MAC GRID
+
+As mentioned in Section 3.3 of the paper, our method relies on a staggered marker-and-cell grid representation for the vector potential as well as the velocity and pressure fields. In the following, we provide further details on how to apply this representation to learn incompressible fluid dynamics.
+
+To calculate the velocity field $\vec { v } = \nabla \times \vec { a }$ of a vector potential $\vec { a }$ on a MAC grid in 2D, we have to compute the curl as follows:
+
+$$
+\begin{array} { r } { ( v _ { x } ) _ { i , j } = ( a _ { z } ) _ { i + 1 , j } - ( a _ { z } ) _ { i , j } } \\ { ( v _ { y } ) _ { i , j } = ( a _ { z } ) _ { i , j } - ( a _ { z } ) _ { i , j + 1 } } \end{array}
+$$
+
+If this vector potential is inserted into the divergence operator on a MAC grid, we can show that $\nabla \cdot \vec { v } _ { i , j } = 0$ is indeed fulfilled:
+
+$$
+\begin{array} { r l } & { \nabla \cdot \vec { v } _ { i , j } = ( { v } _ { x } ) _ { i , j + 1 } - ( { v } _ { x } ) _ { i , j } + ( { v } _ { y } ) _ { i + 1 , j } - ( { v } _ { y } ) _ { i , j } } \\ & { \qquad = \begin{array} { r l } & { ( ( a _ { z } ) _ { i + 1 , j + 1 } - ( a _ { z } ) _ { i , j + 1 } ) - ( ( a _ { z } ) _ { i + 1 , j } - ( a _ { z } ) _ { i , j } ) } \\ & { \qquad + \left( ( a _ { z } ) _ { i + 1 , j } - ( a _ { z } ) _ { i + 1 , j + 1 } \right) - ( ( a _ { z } ) _ { i , j } - ( a _ { z } ) _ { i , j + 1 } ) } \\ & { \qquad = 0 } \end{array} } \end{array}
+$$
+
+Thus, for the $\vec { a }$ -Net, the incompressibility equation is automatically fulfilled and no further training on the divergence loss $L _ { d }$ is required. However, for the $\vec { v }$ -Net, the residuals of the divergence are still of importance:
+
+$$
+( R _ { d } ) _ { i , j } ^ { t + d t } = \nabla \cdot \vec { v } _ { i , j } ^ { t + d t } ( = 0 \mathrm { f o r } \vec { a } \ – \mathrm { N e t } )
+$$
+
+The residuals of the momentum equation in $x$ -direction can be computed as follows:
+
+$$
+\begin{array} { r l } & { { R _ { p _ { x } } } ) _ { i , j } ^ { t + d t } = \rho ( \frac { ( v _ { x } ) _ { i , j } ^ { t + d t } - ( v _ { x } ) _ { i , j } ^ { t } } { d t } + ( v _ { x } ) _ { i , j } ^ { t ^ { \prime } } \cdot \frac { ( v _ { x } ) _ { i , j + 1 } ^ { t ^ { \prime } } - ( v _ { x } ) _ { i , j - 1 } ^ { t ^ { \prime } } } { 2 } } \\ & { \qquad + \frac { \frac { ( v _ { y } ) _ { i , j - 1 } ^ { t ^ { \prime } } + ( v _ { y } ) _ { i , j } ^ { t ^ { \prime } } } { 2 } \cdot ( ( v _ { x } ) _ { i , j } ^ { t ^ { \prime } } - ( v _ { x } ) _ { i - 1 , j } ^ { t ^ { \prime } } ) + \frac { ( v _ { y } ) _ { i + 1 , j - 1 } ^ { t ^ { \prime } } + ( v _ { y } ) _ { i + 1 , j } ^ { t ^ { \prime } } } { 2 } \cdot ( ( v _ { x } ) _ { i + 1 , j } ^ { t ^ { \prime } } - ( v _ { x } ) _ { i , j } ^ { t ^ { \prime } } } { ( \frac { 1 } { 2 } } } \\ & { \qquad + ( p _ { i , j } ^ { t + d t } - p _ { i , j - 1 } ^ { t + d t } ) - \mu \cdot \Delta ( v _ { x } ) _ { i , j } ^ { t ^ { \prime } } } \end{array}
+$$
+
+Here, we use the following isotropic Laplace operator:
+
+$$
+\begin{array} { c } { \Delta s _ { i , j } = \displaystyle \frac { 1 } { 4 } ( 1 * s _ { i - 1 , j - 1 } + 2 * s _ { i - 1 , j } + 1 * s _ { i - 1 , j + 1 } } \\ { + 2 * s _ { i , j - 1 } - 1 2 * s _ { i , j } + 2 * s _ { i , j + 1 } } \\ { + 1 * s _ { i + 1 , j - 1 } + 2 * s _ { i + 1 , j } + 1 * s _ { i + 1 , j + 1 } ) } \end{array}
+$$
+
+The derivation of the advection term for $R _ { p _ { x } }$ is a bit more complex since on a MAC grid, $v _ { x }$ and $v _ { y }$ are displaced by half a pixel in $x$ -direction and $y$ -direction. To obtain the residuals of the momentum equation in $y$ -direction, $( R _ { p _ { y } } ) _ { i , j }$ , one has to take $( R _ { p _ { x } } ) _ { i , j }$ and swap $x$ and $y$ and the indices respectively.
+
+Now, the discretized loss terms can be written as follows:
+
+$$
+\begin{array} { l } { { { \cal L } _ { d } ^ { t + d t } = \displaystyle \sum _ { i , j } \Omega _ { i , j } ^ { t + d t } ( ( R _ { d } ) _ { i , j } ^ { t + d t } ) ^ { 2 } } } \\ { { { \cal L } _ { p } ^ { t + d t } = \displaystyle \sum _ { i , j } \Omega _ { i , j } ^ { t + d t } \left( ( ( R _ { p _ { x } } ) _ { i , j } ^ { t + d t } ) ^ { 2 } + ( ( R _ { p _ { y } } ) _ { i , j } ^ { t + d t } ) ^ { 2 } \right) } } \\ { { { \cal L } _ { b } ^ { t + d t } = \displaystyle \sum _ { i , j } \partial \Omega _ { i , j } ^ { t + d t } \left. \vec { v } _ { d } ^ { t + d t } - \vec { v } ^ { t + d t } \right. ^ { 2 } } } \end{array}
+$$
+
+Note, that all mentioned operations can be efficiently implemented with convolutions. To obtain the final velocities on a square grid, we project the velocity fields of the MAC grid back onto the $\vec { a }$ -grid using linear interpolation:
+
+$$
+\vec { v } = \frac { 1 } { 2 } \left( { ( v _ { x } ) _ { i - 1 , j } } + { ( v _ { x } ) _ { i , j } } \right)
+$$
+
+# B NETWORK ARCHITECTURE
+
+Our fluid model is based on the U-Net architecture (Ronneberger et al. (2015)) with fewer channels (see Figure 6). As the pressure field and vector potential can have an arbitrary offset, we always normalize the mean of the pressure $( \Delta p )$ and vector potential $( \Delta a _ { z } )$ to 0 to keep these fields welldefined and prevent drifting offset values.
+
+
+Figure 6: U-Net architecture with fewer channels.
+
+# C EXAMPLES OF TRAINING DOMAINS
+
+The domains we used for training consist of $1 0 0 \times 3 0 0$ grids. We used 3 different randomized domains as exemplary depicted in Figure 7. First, we have boxes with randomized height and width that float on randomized paths inspired by Brownian motion in a pipe with randomized flow speed. Second, we have the same setup but replaced the boxes by cylinders with randomized radii and angular velocities in order to learn the Magnus effect. Finally, we have a folded pipe system with randomized flow speed, that is randomly flipped along the $x$ -axis.
+
+# D FURTHER EXAMPLES OF GENERALIZATION
+
+Note that the network was only trained on simple domain geometries as presented in appendix C. Still, as can be seen in Figure 8, the network is capable of generalizing to far more complicated domain geometries (e.g. shark, car). Figure 8c shows that it can generalize to multiple objects in the scene, although the training set contained at most one object per scene. And Figure 8d shows that we can alter the outer boundary conditions as well. For real-time simulations, please have a look at our source code and the supplementary video.
+
+# E QUANTITATIVE ANALYSIS: THE BENCHMARK PROBLEM
+
+Figure 9 shows the domain $\Omega$ and $v _ { d }$ on a $1 0 0 \times 1 0 0$ grid which was used as the benchmark problem for quantitative analysis. The flow speed for the inlet and outlet was set to 0.5. The timestep of the integrator was set to $d t = 4$ and the viscosity and fluid density were set to $\mu = 0 . 1$ and $\rho = 4$ respectively.
+
+
+Figure 7: The left column shows $\Omega$ (in white) / $\partial \Omega$ (in black) and the right column shows $\vec { v _ { d } }$ for three examples of training domains. (Colors indicate the direction and magnitude of $\vec { v _ { d } }$ as depicted in Figure 9a)
+
+
+Figure 8: Our models generalize to various domain geometries, although being trained only on simple shapes (see Figure 7)
+
+# F QUALITATIVE COMPARISON OF $\vec { a }$ -NET AND $\vec { v }$ -NET
+
+We give a qualitative example to show the benefits of using a vector potential. Figure 10 demonstrates that the $\vec { a }$ -Net finds plausible solutions for a folded pipe domain while the $\vec { v }$ -Net looses most of the flow in the center of the domain. This is in good accordance with quantitative results shown in section 1. The folded pipe domain is particularly difficult to learn as the flow field contains long range dependencies to the inlet and outlet (as shown in the bottom row in Figure 7).
+
+# G TRAINING WITHOUT RESETTING ENVIRONMENTS
+
+We performed an ablation study to investigate what happens if we do not reset old environments from time to time and, thus, do not continuously present the fluid model with cold starts during training. Figure 11 shows that in this case, large error spikes appear in the validation curve. These error spikes appear since the model has troubles to perform a cold start as can be seen in Figure 11b: compared to a properly trained model (see Figure 4) the model takes longer to perform a cold start (ca 100 steps) and converges to a solution with high $L _ { p }$ - and $L _ { d } .$ - losses. By resetting the environments from time to time during training, we can prevent these error spikes as shown in Figure 11c.
+
+
+Figure 9: a) shows legend for $\scriptstyle { \vec { v _ { d } } }$ ; b) shows $\Omega$ (in white) $/ \partial \Omega$ (in black) for the benchmark problem; c) shows $\vec { v _ { d } }$ for the benchmark problem. (Colors indicate the direction of $\vec { v _ { d } }$ as depicted in a)
+
+
+Figure 10: Qualitative comparison of $\vec { a }$ -Net and $\vec { v }$ -Net in a folded pipe domain
+
+
+Figure 11: a) ablation study without resetting environments: validation curve shows large error spikes during training; b) error spike: the fluid model takes longer to perform a cold start and converges to a solution with high losses; c) original training with resetting environments: validation curve is stable
\ No newline at end of file
diff --git a/md/train/LWH-C1HoQG_/LWH-C1HoQG_.md b/md/train/LWH-C1HoQG_/LWH-C1HoQG_.md
new file mode 100644
index 0000000000000000000000000000000000000000..9531c9a78d92b40d679237a6632c11195321bba8
--- /dev/null
+++ b/md/train/LWH-C1HoQG_/LWH-C1HoQG_.md
@@ -0,0 +1,243 @@
+# Few-Shot Segmentation via Cycle-Consistent Transformer
+
+Gengwei Zhang1,2∗, Guoliang Kang3, Yi Yang4, Yunchao Wei5,6† 1 Baidu Research
+2 ReLER, Centre for Artificial Intelligence, University of Technology Sydney 3 University of Texas, Austin
+4 CCAI, College of Computer Science and Technology, Zhejiang University 5 Institute of Information Science, Beijing Jiaotong University 6 Beijing Key Laboratory of Advanced Information Science and Network {zgwdavid, kgl.prml, wychao1987, yee.i.yang} $@$ gmail.com
+
+# Abstract
+
+Few-shot segmentation aims to train a segmentation model that can fast adapt to novel classes with few exemplars. The conventional training paradigm is to learn to make predictions on query images conditioned on the features from support images. Previous methods only utilized the semantic-level prototypes of support images as the conditional information. These methods cannot utilize all pixel-wise support information for the query predictions, which is however critical for the segmentation task. In this paper, we focus on utilizing pixel-wise relationships between support and query images to facilitate the few-shot segmentation task. We design a novel Cycle-Consistent TRansformer (CyCTR) module to aggregate pixel-wise support features into query ones. CyCTR performs cross-attention between features from different images, i.e. support and query images. We observe that there may exist unexpected irrelevant pixel-level support features. Directly performing cross-attention may aggregate these features from support to query and bias the query features. Thus, we propose using a novel cycle-consistent attention mechanism to filter out possible harmful support features and encourage query features to attend to the most informative pixels from support images. Experiments on all few-shot segmentation benchmarks demonstrate that our proposed CyCTR leads to remarkable improvement compared to previous state-of-the-art methods. Specifically, on Pascal- ${ \mathrm { ~ \bar { \cdot } ~ } } 5 ^ { i }$ and $\mathrm { C O C O - } \bar { 2 } 0 ^ { i }$ datasets, we achieve $6 7 . 5 \%$ and $4 5 . 6 \%$ mIoU for 5-shot segmentation, outperforming previous state-of-the-art method by $5 . 6 \%$ and $7 . 1 \%$ respectively.
+
+# 1 Introduction
+
+Recent years have witnessed great progress in semantic segmentation [19, 4, 47]. The success can be largely attributed to large amounts of annotated data [48, 17]. However, labeling dense segmentation masks are very time-consuming [45]. Semi-supervised segmentation [15, 39, 38] has been broadly explored to alleviate this problem, which assumes a large amount of unlabeled data is accessible. However, semi-supervised approaches may fail to generalize to novel classes with very few exemplars. In the extreme low data regime, few-shot segmentation [26, 35] is introduced to train a segmentation model that can quickly adapt to novel categories.
+
+
+Figure 1: Different learning frameworks for few-shot segmentation, from the perspective of ways to utilize support information. (a) Class-wise mean pooling based method. (b) Clustering based method. (c) Foreground pixel attention method. (d) Our Cycle-Consistent TRansformer (CyCTR) framework that enables all beneficial support pixel-level features (foreground and background) to be considered.
+
+Most few-shot segmentation methods follow a learning-to-learn paradigm where predictions of query images are made conditioned on the features and annotations of support images. The key to the success of this training paradigm lies in how to effectively utilize the information provided by support images. Previous approaches extract semantic-level prototypes from support features and follow a metric learning [29, 7, 35] pipeline extending from PrototypicalNet [28]. According to the granularity of utilizing support features, these methods can be categorized into two groups, as illustrated in Figure 1: 1) Class-wise mean pooling [35, 46, 44] (Figure 1(a)). Support features within regions of different categories are averaged to serve as prototypes to facilitate the classification of query pixels. 2) Clustering [18, 41] (Figure 1(b)). Recent works attempt to generate multiple prototypes via EM algorithm or K-means clustering [41, 18], in order to extract more abundant information from support images. These prototype-based methods need to “compress" support information into different prototypes (i.e. class-wise or cluster-wise), which may lead to various degrees of loss of beneficial support information and thus harm segmentation on query image. Rather than using prototypes to abstract the support information, [43, 34] (Figure 1(c)) propose to employ the attention mechanism to extract information from support foreground pixels for segmenting query. However, such methods ignore all the background support pixels that can be beneficial for segmenting query image, and incorrectly consider partial foreground support pixels that are quite different from the query ones, leading to sub-optimal results.
+
+In this paper, we focus on equipping each query pixel with relevant information from support images to facilitate the query pixel classification. Inspired by the transformer architecture [32] which performs feature aggregation through attention, we design a novel Cycle-Consistent Transformer (CyCTR) module (Figure 1(d)) to aggregate pixel-wise support features into query ones. Specifically, our CyCTR consists of two types of transformer blocks: the self-alignment block and the cross-alignment block. The selfalignment block is employed to encode the query image features by aggregating its relevant context information, while the cross-alignment aims to aggregate the pixel-wise features of support images into the pixel-wise features of query image. Different from self-alignment where Query3, Key and Value come from the same
+
+
+Figure 2: The motivation of our proposed method. Many pixel-level support features are quite different from the query ones, and thus may confuse the attention. We incorporate cycle-consistency into attention to filter such confusing support features. Note that the confusing support features may come from foreground and background.
+
+embedding, cross-alignment takes features from query images as Query, and those from support images as Key and Value. In this way, CyCTR provides abundant pixel-wise support information for pixel-wise features of query images to make predictions.
+
+Moreover, we observe that due to the differences between support and query images, e.g., scale, color and scene, only a small proportion of support pixels can be beneficial for the segmentation of query image. In other words, in the support image, some pixel-level information may confuse the attention in the transformer. Figure 2 provides a visual example of a support-query pair together with the label masks. The confusing support pixels may come from both foreground pixels and background pixels. For instance, point $p _ { 1 }$ in the support image located in the plane afar, which is indicated as foreground by the support mask. However, the nearest point $p _ { 2 }$ in the query image (i.e. $p _ { 2 }$ has the largest feature similarity with $p _ { 1 }$ ) belongs to a different category, i.e. background. That means, there exists no query pixel which has both high similarity and the same semantic label with $p _ { 1 }$ . Thus, $p _ { 1 }$ is likely to be harmful for segmenting "plane" and should be ignored when performing the attention. To overcome this issue, in CyCTR, we propose to equip the cross-alignment block with a novel cycle-consistent attention operation. Specifically, as shown in Figure 2, starting from the feature of one support pixel, we find its nearest neighbor in the query features. In turn, this nearest neighbor finds the most similar support feature. If the starting and the end support features come from the same category, a cycle-consistency relationship is established. We incorporate such an operation into attention to force query features only attend to cycle-consistent support features to extract information. In this way, the support pixels that are far away from query ones are not considered. Meanwhile, cycle-consistent attention enables us to more safely utilize the information from background support pixels, without introducing much bias into the query features.
+
+In a nutshell, our contributions are summarized as follows: (1) We tackle few-shot segmentation from the perspective of providing each query pixel with relevant information from support images through pixel-wise alignment. (2) We propose a novel Cycle-Consistent TRansformer (CyCTR) to aggregate the pixel-wise support features into the query ones. In CyCTR, we observe that many support features may confuse the attention and bias pixel-level feature aggregation, and propose incorporating cycle-consistent operation into the attention to deal with this issue. (3) Our CyCTR achieves state-ofthe-art results on two few-shot segmentation benchmarks, i.e., Pascal- $5 ^ { i }$ and COCO- $2 0 ^ { i }$ . Extensive experiments validate the effectiveness of each component in our CyCTR.
+
+# 2 Related Work
+
+# 2.1 Few-Shot Segmentation
+
+Few-shot segmentation [26] is established to perform segmentation with very few exemplars. Recent approaches formulate few-shot segmentation from the view of metric learning [29, 7, 35]. For instance, [7] first extends PrototypicalNet [28] to perform few-shot segmentation. PANet [35] simplifies the framework with an efficient prototype learning framework. SG-One [46] leverage the cosine similarity map between the single support prototype and query features to guide the prediction. CANet [44] replaces the cosine similarity with an additive alignment module and iteratively refines the network output. PFENet [30] further designs an effective feature pyramid module and leverages a prior map to achieve better segmentation performance. Recently, [41, 18, 43] point out that only a single support prototype is insufficient to represent a given category. Therefore, they attempt to obtain multiple prototypes via EM algorithm to represent the support objects and the prototypes are compared with query image based on cosine similarity [18, 41]. Besides, [43, 34] attempt to use graph attention networks [33, 40] to utilize all foreground support pixel features. However, they ignore all pixels in the background region by default. Besides, due to the large difference between support and query images, not all support pixels will benefit final query segmentation. Recently, some concurrent works propose to learn dense matching through Hypercorrelation Squeeze Networks [22] or mining latent classes [42] from the background region. Our work aims at mining information from the whole support image, but exploring to use the transformer architecture and from a different perspective, i.e., reducing the noise in the support pixel-level features.
+
+# 2.2 Transformer
+
+Transformer and self-attention were firstly introduced in the fields of machine translation and natural language processing [6, 32], and are receiving increasing interests recently in the computer vision area. Previous works utilize self-attention as additional module on top of existing convolutional networks, e.g., Nonlocal [36] and CCNet [14]. ViT [8] and its following work [31] demonstrate the pure transformer architecture can achieve state-of-the-art for image recognition. On the other hand, DETR [3] builds up an end-to-end framework with a transformer encoder-decoder on top of backbone networks for object detection. And its deformable vairents [51] improves the performance and training efficiency. Besides, in natural language processing, a few works [2, 5, 27] have been introduced for long documents processing with sparse transformers. In these works, each Query token only attends to a pre-defined subset of Key positions.
+
+# 2.3 Cycle-consistency Learning
+
+Our work is partially inspired by cycle-consistency learning [50, 9] that is explored in various computer vision areas. For instance, in image translation, CycleGAN [50] uses cycle-consistency to align image pairs. It is also effective in learning 3D correspondence [49], consistency between video frames [37] and association between different domains [16]. These works typically constructs cycle-consistency loss between aligned targets (e.g., images). However, the simple training loss cannot be directly applied to few-shot segmentation because the test categories are unseen from the training process and no finetuning is involved during testing. In this work, we incorporate the idea of cycle-consistency into transformer to eliminate the negative effect of confusing or irrelevant support pixels.
+
+# 3 Methodology
+
+# 3.1 Problem Setting
+
+Few-shot segmentation aims at training a segmentation model that can segment novel objects with very few annotated samples. Specifically, given dataset $D _ { t r a i n }$ and $D _ { t e s t }$ with category set $C _ { t r a i n }$ and $C _ { t e s t }$ respectively, where $C _ { t r a i n } \cap C _ { t e s t } = { \emptyset }$ , the model trained on $D _ { t r a i n }$ is directly used to test on $D _ { t e s t }$ . In line with previous works [30, 35, 44], episode training is adopted in this work for few-shot segmentation. Each episode is composed of $k$ support images $I _ { s }$ and a query image $I _ { q }$ to form a $k$ -shot episode $\{ \{ I _ { s } \} ^ { k } , I _ { q } \}$ , in which all $\{ I _ { s } \} ^ { k }$ and $I _ { q }$ contain objects from the same category. Then the training set and test set are represented by $\hat { D } _ { t r a i n } = \{ \{ I _ { s } \} ^ { k } , I _ { q } \} ^ { N _ { t r a i n } }$ and $D _ { t e s t } = \{ \{ I _ { s } \} ^ { k } , I _ { q } \} ^ { N _ { t e s t } }$ , where $N _ { t r a i n }$ and $N _ { t e s t }$ is the number of episodes for training and test set. During training, both support masks $M _ { s }$ and query masks $M _ { q }$ are available for training images, and only support masks are accessible during testing.
+
+# 3.2 Revisiting of Transformer
+
+Following the general form in [32], a transformer block is composed of alternating layers of multi-head attention (MHA) and multi-layer perceptron (MLP). LayerNorm (LN) [1] and residual connection [12] are applied at the end of each block. Specially, an attention layer is formulated as
+
+$$
+\mathrm { A t t e n } ( Q , K , V ) = \mathrm { s o f t m a x } ( \frac { Q K ^ { T } } { \sqrt { d } } ) V ,
+$$
+
+where $[ Q ; K ; V ] = [ W _ { q } Z _ { q } ; W _ { k } Z _ { k v } ; W _ { v } Z _ { k v } ] ,$ , in which $Z _ { q }$ is the input Query sequence, $Z _ { k v }$ is the input Key/Value sequence, $W _ { q } , W _ { k } , W _ { v } \in \mathbb R ^ { d \times d }$ denote the learnable parameters, $d$ is the hidden dimension of the input sequences and we assume all sequences have the same dimension $d$ by default. For each Query element, the attention layer computes its similarities with all Key elements. Then the computed similarities are normalized via softmax, which are used to multiply the Value elements to achieve the aggregated outputs. When $Z _ { q } = Z _ { k v }$ , it functions as self-attention mechanism.
+
+The multi-head attention layer is an extention of attention layer, which performs $h$ attention operations and concatenates consequences together. Specifically,
+
+$$
+\mathrm { M H A } ( Q , K , V ) = [ \mathrm { h e a d } _ { 1 } , . . . , \mathrm { h e a d } _ { \mathrm { h } } ] ,
+$$
+
+where $\mathrm { h e a d } _ { \mathrm { m } } = \mathrm { A t t e n } ( Q _ { m } , K _ { m } , V _ { m } )$ and the inputs $[ Q _ { m } , K _ { m } , V _ { m } ]$ are the $m ^ { t h }$ group from $[ Q , K , V ]$ with dimension $d / h$ .
+
+# 3.3 Cycle-Consistent Transformer
+
+Our framework is illustrated in Figure 3(a). Generally, an encoder of our Cycle-Consistent TRansformer (CyCTR) consists of a self-alignment transformer block for encoding the query features and a cross-alignment transformer block to enable the query features to attend to the informative support features. The whole CyCTR module stacks $L$ encoders.
+
+
+Figure 3: Framework of our proposed Cycle-Consistent TRansformer (CyCTR). Each encoder of CyCTR consists of two transformers blocks, i.e., the self-alignment block for utilizing global context within the query feature map and the cross-alignment block for aggregate information from support images. In the cross-alignment block, we introduce the multi-head cycle-consistent attention (shown on the right, with the number of heads $h = 1$ for simplicity). The attention operation is guided by the cycle-consistency among query and support features.
+
+Specifically, for the given query feature $X _ { q } \in \mathbb { R } ^ { H _ { q } \times W _ { q } \times d }$ and support feature $X _ { s } \in \mathbb R ^ { H _ { s } \times W _ { s } \times d }$ , we first flatten them into 1D sequences (with shape $H W \times d )$ as inputs for transformer, in which a token is represented by the feature $z \in \mathbb { R } ^ { d }$ at one pixel location. The self-alignment block only takes the flattened query feature as input. As context information of each pixel has been proved beneficial for segmentation [4, 47], we adopt the self-alignment block to pixel-wise features of query image to aggregate their global context information. We don’t pass support images through the self-alignment block, as we mainly focus on the segmentation performance of query images. Passing through the support images which don’t coordinate with the query mask may do harm to the self-alignment on query images.
+
+In contrast, the cross-alignment block performs attention between query and support pixel-wise features to aggregate relevant support features into query ones. It takes the flattened query feature and a subset of support feature (the sampling procedure is discussed latter) with size $N _ { s } \leq H _ { s } W _ { s }$ as Key/Value sequence $Z _ { k v }$ .
+
+With these two blocks, it is expected to better encoder the query features to facilitate the subsequent pixel-wise classification. When stacking $L$ encoders, the output of the previous encoder is fed into the self-alignment block. The outputs of self-alignment block and the sampled support features are then fed into the cross-alignment block.
+
+# 3.3.1 Cycle-Consistent Attention
+
+According to the aforementioned discussion, the pure pixel-level attention may be confused by excessive irrelevant support features. To alleviate this issue, as shown in Figure 3(b), a cycleconsistent attention operation is proposed. We first go through the proposed approach for 1-shot case for presentation simplicity and then discuss it in the multiple shot setting.
+
+Formally, an affinity map A = QKT√ , $\begin{array} { r } { A = \frac { Q K ^ { T } } { \sqrt { d } } , A \in \mathbb { R } ^ { H _ { q } W _ { q } \times N _ { s } } } \end{array}$ is first calculated to measure the correspondence between all query and support pixels. Then, for an arbitrary support pixel/token $j$ $( \bar { j } \in \{ 0 , 1 , . . . , N _ { s } - 1 \}$ , $N _ { s }$ is the number of support pixels), its most similar query pixel/token $i ^ { \star }$ is obtained by
+
+$$
+i ^ { \star } = \operatorname * { a r g m a x } _ { i } A _ { ( i , j ) } ,
+$$
+
+where $i \in \{ 0 , 1 , . . . , H _ { q } W _ { q } - 1 \}$ denotes the spatial index of query pixels. Since the query mask is not accessible, the label of query pixel $i ^ { \star }$ is unknown. However, we can in turn find its most similar support pixel $j ^ { \star }$ in the same way:
+
+$$
+j ^ { \star } = \operatorname * { a r g m a x } _ { j } A _ { ( i ^ { \star } , j ) } .
+$$
+
+Given the sampled support label $M _ { s } \in \mathbb { R } ^ { N _ { s } }$ , cycle-consistency is satisfied if $M _ { s ( j ) } = M _ { s ( j ^ { \star } ) }$ Previous work [16] attempts to encourage the feature similarity between cycle-consistent pixels to improve the model’s generalization ability within the same set of categories. However, in few-shot segmentation, the goal is to enable the model to fast adapt to novel categories rather than making the model fit better to training categories. Thus, we incorporate the cycle-consistency into the attention operation to encourage the cycle-consistent cross-attention. First, by traversing all support tokens, an additive bias $B \in \mathbb { R } ^ { \breve { N } _ { s } }$ is obtained by
+
+$$
+{ \cal B } _ { j } = \left\{ \begin{array} { c l } { { 0 , } } & { { \mathrm { i f } M _ { s ( j ) } = M _ { s ( j ^ { \star } ) } } } \\ { { - \infty , } } & { { \mathrm { i f } M _ { s ( j ) } \neq M _ { s ( j ^ { \star } ) } } } \end{array} \right. ,
+$$
+
+where $j \in \{ 0 , 1 , . . . , N _ { s } \}$ . Then, for a single query token $Z _ { q ( i ) } \in \mathbb { R } ^ { d }$ at location $i$ , the support information is aggregated by
+
+$$
+\mathrm { C y C A t t e n } ( Q _ { i } , K _ { i } , V _ { i } ) = \mathrm { s o f t m a x } ( A _ { ( i ) } + B ) V ,
+$$
+
+where $i \in \{ 0 , 1 , . . . , H _ { q } W _ { q } \}$ and $A$ is obtained by $\frac { Q K ^ { T } } { \sqrt { d } }$ . In the forward process, $B$ is element-wise added with the affinity $A _ { ( i ) }$ for $Z _ { q ( i ) }$ to aggregate support features. In this way, the attention weight for the cycle-inconsistent support features become zero, implying that these irrelevant information will not be considered. Besides, the cycle-consistent attention implicitly encourages the consistency between the most relevant query and support pixel-wise features through backpropagation. Note that our method aims at removing support pixels with certain inconsistency, rather than ensuring all support pixels to form cycle-consistency, which is impossible without knowing the query ground truth labels.
+
+When performing self-attention in the self-alignment block, there may also exist the same issue, i.e. the query token may attend to irrelevant or even harmful features (especially when background is complex). According to our cycle-consistent attention, each query token should receive information from more consistent pixels than aggregating from all pixels. Due to the lack of query mask $M _ { q }$ , it is impossible to establish the cycle-consistency among query pixels/tokens. Inspired by DeformableAttention [51], the consistent pixels can be obtained via a learnable way as $\Delta \bar { = } f ( Q \bar { + }$ Coord) and $A ^ { ' } = g ( Q + \mathrm { C o o r d } )$ , where $\Delta \in \mathbb { R } ^ { H _ { p } W _ { p } \times P }$ is the predicted consistent pixels, in which each element $\delta \in \mathbb { R } ^ { P }$ in $\Delta$ represents the relative offset from each pixel and $P$ represents the number of pixels to aggregate. And $\mathbf { \bar { \Psi } } A ^ { ' } \in \mathbb { R } ^ { H _ { q } W _ { q } \times P }$ is the attention weights. Coord $\in \mathbb { R } ^ { H _ { q } W _ { q } \times d }$ is the positional encoding [24] to make the prediction be aware of absolute position, and $f ( \cdot )$ and $g ( \cdot )$ are two fully connected layers that predict the offsets4 and attention weights. Therefore, the self-attention within the self-alignment transformer block is represented as
+
+$$
+\mathrm { P r e d A t t e n } ( Q _ { r } , V _ { r } ) = \sum _ { g } ^ { P } \mathrm { s o f t m a x } ( A ^ { ' } ) _ { ( r , g ) } V _ { r + \Delta _ { ( r , g ) } } ,
+$$
+
+where $r \in \{ 0 , 1 , . . . , H _ { q } W _ { q } \}$ is the index of the flattened query feature, both $Q$ and $V$ are obtained by multiplying the flattened query feature with the learnable parameter.
+
+Generally speaking, the cycle-consistent transformer effectively avoids the attention being biased by irrelevant features to benefit the training of few-shot segmentation.
+
+Mask-guided sparse sampling and $K$ -shot Setting: Our proposed cycle-consistency transformer can be easily extended to $K$ -shot setting where $K > 1$ . When multiple support feature maps are provided, all support features are flattened and concatenated together as input. As the attention is performed at the pixel-level, the computation load will be high if the number of support pixels/tokens is large, which is usually the case under $K$ -shot setting. In this work, we apply a simple mask-guided sampling strategy to reduce the computation complexity and make our method more scalable. Concretely, given the $k$ -shot support sequence $Z _ { s } \in \bar { \mathbb R } ^ { k H _ { s } \bar { W } _ { s } \times d }$ and the flattened support masks $M _ { s } \in \mathbb { R } ^ { k H _ { s } W _ { s } }$ , the support pixels/tokens are obtained by uniformly sampling $N _ { f g }$ tokens $\begin{array} { r } { ( N _ { f g } \ < = \ \frac { N _ { s } } { 2 } } \end{array}$ , where $N _ { s } \le k H _ { s } W _ { s } )$ from the foreground regions and $N _ { s } - N _ { f g }$ tokens from the background regions in all support images. With a proper $N _ { s }$ , the sampling operation reduces the computational complexity, and makes our algorithm more scalable with the increase of spatial size of support images. Additionally, this strategy helps balance the foreground-background ratio and also implicitly considers different sizes of various object regions in support images.
+
+Table 1: Comparison with other state-of-the-art methods for 1-shot and 5-shot segmentation on PASCAL- $. 5 ^ { i }$ using the mIoU $( \% )$ evaluation metric. Best results are shown in bold.
+
+
Method
Backbone
1-shot
5-shot
50
5
52
5
Mean
50
5
5²
53
Mean
PANet [35]
Vgg-16
42.3
58.0
51.1
41.2
48.1
51.8
64.6
59.8
46.5
55.7
FWB [23]
47.0
59.6
52.6
48.3
51.9
50.9
62.9
56.5
50.1
55.1
SG-One [46]
40.2
58.4
48.4
38.4
46.3
41.9
58.6
48.6
39.4
47.1
RPMM [41]
Res-50
47.1
65.8
50.6
48.5
53.0
50.0
66.5
51.9
47.6
54.0
CANet [44]
52.5
65.9
51.3
51.9
55.4
55.5
67.8
51.9
53.2
57.1
PGNet [43]
56.0
66.9
50.6
50.4
56.0
57.7
68.7
52.9
54.6
58.5
RPMM [41]
55.2 47.8
66.9
52.6 53.8
50.7
56.3
56.3
67.3
54.5
51.0
57.3
PPNet [18]
58.8
45.6
51.5
58.4
67.8
64.9
56.7
62.0
PFENet [30]
Res-50
61.7
69.5
55.4
56.3
60.8
63.1
70.7
55.8
57.9
61.9
CyCTR (Ours)
65.7
71.0
59.5
59.7
64.0
69.3
73.5
63.8
63.5
67.5
FWB [23]
Res-101
51.3
64.5
56.7
52.2
56.2
54.9
67.4
62.2
55.3
59.9
DAN [34]
54.7
68.6
57.8
51.6
58.2
57.9
69.0
60.1
54.9
60.5
PFENet [30]
Res-101
60.5
69.4
54.4
55.9
60.1
62.8
70.4
54.9
57.6
61.4
CyCTR (Ours)
67.2
71.1
57.6
59.0
63.7
71.0
75.0
58.5
65.0
67.4
+
+# 3.4 Overall Framework
+
+Following previous works [30, 35, 44], both query and support images are first feed into a shared backbone (e.g., ResNet [12]) which is initialized with weights pretrained from ImageNet [25] to obtain general image features. Similar to [30], middle-level query features (the concatenation of query features from the $3 ^ { r d }$ and the $4 ^ { t h }$ blocks of ResNet) are processed by a $1 \times 1$ convolution to reduce the hidden dimension. The high-level query features (from the $5 ^ { t h }$ block) are used to generate a prior map (the prior map is generated by calculating the pixel-wise similarity between query and support features, details can be found in the supplementary materials) and then are concatenated with the middle-level query features. The average masked support feature is also concatenated to provide global support information. The concatenated features are processed by a $1 \times 1$ convolution. The output query features are then fed into our proposed CyCTR encoders. The output of CyCTR encoders is fed into a classifier to obtain the final segmentation results. The classifier consists of a $3 \times 3$ convolutional layer, a ReLU layer and a $1 \times 1$ convolutional layer. More details about our network structure can be found in the supplementary materials.
+
+# 4 Experiments
+
+# 4.1 Dataset and Evaluation Metric
+
+We conduct experiments on two commonly used few-shot segmentation datasets, Pascal- ${ \cdot } 5 ^ { i }$ [10] (which is combined with SBD [11] dataset) and COCO- $2 0 ^ { i }$ [17], to evaluate our method. For Pascal$5 ^ { i }$ , 20 classes are separated into 4 splits. For each split, 15 classes are used for training and 5 classes for test. At the test time, 1,000 pairs that belong to the testing classes are sampled from the validation set for evaluation. In $\mathrm { C O C O - 2 0 ^ { i } }$ , we follow the data split settings in FWB [23] to divide 80 classes evenly into 4 splits, 60 classes for training and test on 20 classes, and 5,000 validation pairs from the 20 classes are sampled for evaluation. Detailed data split settings can be found in the supplementary materials. Following common practice [30, 35, 46], the mean intersection over union (mIoU) is adopted as the evaluation metric, which is the averaged value of IoU of all test classes. We also report the foreground-background IoU (FB-IoU) for comparison.
+
+# 4.2 Implementation Details
+
+In our experiments, the training strategies follow the same setting in [30]: training for 50 epochs on $\mathrm { C O C O - 2 0 } ^ { i }$ and 200 epochs on Pascal- $5 ^ { i }$ . Images are resized and cropped to $4 7 3 \times 4 7 3$ for both datasets and we use random rotation from $- 1 0 ^ { \circ }$ to $1 0 ^ { \circ }$ as data augmentation. Besides, we use ImageNet [25] pretrained ResNet [12] as the backbone network and its parameters (including BatchNorms) are freezed. For the parameters except those in the transformer layers, we use the initial learning rate $2 . 5 \times 1 0 ^ { - 3 }$ , momentum 0.9, weight decay $1 \times 1 0 ^ { - 4 }$ and SGD optimizer with poly learning rate decay [4]. The mini batch size on each gpu is set to 4. Experiments are carried out on Tesla V100 GPUs. For Pascal- ${ \cdot } 5 ^ { i }$ , one model is trained on a single GPU, while for $\mathrm { C O C O - 2 0 ^ { i } }$ , one model is trained with 4 GPUs. We construct our baseline as follows: as stated in Section 3.4, the middle-level query features from backbone network are concatenated and merged with the global support feature and the prior map. This feature is processed by two residule blocks and input to the same classifier as our method. Dice loss [21] is used as the training objective. Besides, the middle-level query feature is averaged using the ground truth and concatenated with support feature to predict the support segmentation map, which produces an auxiliary loss for aligning features. The same settings are also used in our method except that we use our cycle-consistent transformer to process features rather than the residule blocks. For the proposed cycle-consistent transformer, we set the number of sampled support tokens $N _ { s }$ to 600 for 1-shot and $5 \times 6 0 0$ for 5-shot setting. The number of sampled tokens is obtained according to the averaged number of foreground pixels among Pascal- ${ \cdot } 5 ^ { i }$ training set. For the self-attention block, the number of points $P$ is set to 9. For other hyper-parameters in transformer blocks, we use $L = 2$ transformer encoders. We set the hidden dimension of MLP layer to $3 \times 2 5 6$ and that of input to 256. The number of heads for all attention layers is set to 8 for Pascal- ${ \cdot } 5 ^ { i }$ and 1 for $\mathrm { C O C O - 2 0 } ^ { \bar { i } }$ . Parameters in the transformer blocks are optimized with AdamW [20] optimizer following other transformer works [3, 8, 31], with learning rate $1 \times 1 0 ^ { - 4 }$ and weight decay $1 \times 1 0 ^ { - 2 }$ . Besides, we use Dropout with the probability 0.1 in all attention layers.
+
+Table 2: Comparison with other state-of-the-art methods for 1-shot and 5-shot segmentation on COCO- ${ \it 2 0 ^ { i } }$ using the mIoU $( \% )$ evaluation metric. Best results are shown in bold.
+
+
Method
Backbone
1-shot
5-shot
200
201
20
20
Mean
200
201
20
20
Mean
FWB [23]
Res-101
19.9
18.0
21.0
28.9
21.2
19.1
21.5
23.9
30.1
23.7
PPNet[18]
Res-50
28.1
30.8
29.5
27.7
29.0
39.0
40.8
37.1
37.3
38.5
RPMM [41]
Res-50
29.5
36.8
29.0
27.0
30.6
33.8
42.0
33.0
33.3
35.5
PFENet [30]
Res-101
34.3
33.0
32.3
30.1
32.4
38.5
38.6
38.2
34.3
37.4
CyCTR (Ours)
Res-50
38.9
43.0
39.6
39.8
40.3
41.1
48.9
45.2
47.0
45.6
+
+# 4.3 Comparisons with State-of-the-Art Methods
+
+In Table 1 and Table 2, we compare our method with other state-of-the-art few-shot segmentation approaches on Pascal- ${ \cdot } 5 ^ { i }$ and $\mathrm { C O C O - 2 0 ^ { i } }$ respectively. It can be seen that our approach achieves new state-of-the-art performance on both Pascal- $5 ^ { i }$
+
+and $\mathrm { C O C O - 2 0 ^ { i } }$ . Specifically, on Pascal- $5 ^ { i }$ , to make fair comparisons with other methods, we report results with both ResNet-50 and ResNet101. Our CyCTR achieves $6 4 . 0 \%$ mIoU with ResNet-50 backbone and $6 3 . 7 \%$ mIoU with ResNet-101 backbone for 1-shot segmentation, significantly outperforming previous state-ofthe-art results by $3 . 2 \%$ and $3 . 6 \%$ , respectively. For 5-shot segmentation, our CyCTR can even surpass state-of-the art methods by $5 . 6 \%$ and $6 . 0 \%$ mIoU when using ResNet-50 and ResNet
+
+Table 3: Comparison with other methods using FB-IoU $( \% )$ on Pascal- ${ \cdot } 5 ^ { i }$ for 1-shot and 5-shot segmentation.
+
+
Method
Backbone
FB-IoU (%)
1-shot 5-shot
A-MCG [13]
Res-101
61.2 62.2
DAN [34]
Res-101
71.9 72.3
PFENet [30]
Res-101
72.9 73.5
CyCTR (Ours)
Res-101
73.0 75.4
+
+101 backbones respectively. For $\mathrm { C O C O - 2 0 ^ { i } }$ results in Table 2, our method also outperforms other methods by a large margin due to the capability of the transformer to fit more complex data. Besides, Table 3 shows the comparison using FB-IoU on PASCAL- ${ \cdot } 5 ^ { i }$ for 1-shot and 5-shot segmentation, our method also obtains the state-of-the-art performance.
+
+# 4.4 Ablation Studies
+
+To provide a deeper understanding of our proposed method, we show ablation studies in this section. The experiments are performed on Pascal- $5 ^ { i }$ 1-shot setting with ResNet-50 as the backbone network, and results are reported in terms of mIoU.
+
+Table 4: Ablation studies that validate the effectiveness of each component in our Cycle-Consistent TRansformer. The first result is obtained by our baseline (see Section 4.2 for details).
+
+
self-alignment
cross-alignment
CyCTR (pred)
CyCTR (fg. only)
CyCTR
mIoU (%)
59.3 62.5
>>>
62.9
62.6
>>>
√
厂
63.0
广
√
√
63.5
+
+# 4.4.1 Component-Wise Ablations
+
+We perform ablation studies regarding each component of our CyCTR in Table 4. The first line is the result of our baseline, where we use two residual blocks to merge features as stated in Section 4.2. For all ablations in Table 4, the hidden dimension is set to 128 and two transformer encoders are used. The mIoU results are averaged over four splits. Firstly, we only use the self-alignment block that only encodes query features. The support information in this case comes from the concatenated global support feature and the prior map used in [44]. It can already bring decent results, showing that the transformer encoder is effective for modeling context for few-shot segmentation. Then, we utilize the cross-alignment block but only with the vanilla attention operation in Equation 1. The mIoU increases by $0 . 4 \%$ , indicating that pixel-level features from support can provide additional performance gain. By using our proposed cycle-consistent attention module, the performance can be further improved by a large margin, i.e. $0 . 6 \%$ mIoU compared to the vanilla attention. This result demonstrates our cycle-consistent attention’s capability to suppress possible harmful information from support. Besides, we assume some background support features may also benefit the query segmentation and therefore use the cycle-consistent transformer to aggregate pixel-level information from background support features as well. Comparing the last two lines in Table 4, we show that our way of utilizing beneficial background pixel-level support information brings $0 . 5 \%$ mIoU improvement, validating our assumption and the effectiveness of our proposed cycle-consistent attention operation.
+
+Besides, one may be curious about whether the noise can also be removed by predicting the aggregation position like the way in Equation 6 for aggregating support features to query. Therefore, we use predicted aggregation instead of the cycle-consistent attention in the cross-alignment block, as denoted by $C y C T R ( p r e d )$ in Table 4. It does benefit the few-shot segmentation by aggregating useful information from support but is $0 . 9 \%$ worse than the proposed cycle-consistent attention. The reason lies in the dramatically changing support images under few-shot segmentation testing. The cycle-consistency is better than the learnable way as it can globally consider the varying conditional information from both query and support.
+
+# 4.4.2 Effect of Model Capacity
+
+We can stack more encoders or increase the hidden dimension of encoders to increase its capacity and validate the effectiveness of our CyCTR. The results with different numbers of encoders (denoted as $L$ ) or hidden dimensions (denoted as $d$ ) are shown in Table 5a and 5b. While increasing $L$ or $d$ within a certain range, CyCTR achieves better results. We chose $L = 2$ as our default choice for accuracy-efficiency trade-off.
+
+Table 5: Effect of varying (a) number of encoders $L$ and (b) hidden dimensions $d$ . When varying $L$ , $d$ is fixed to 128; while varying $d , L$ is fixed to 2.
+
+
#Encoder
mIoU (%)
#Dim
mIoU (%)
1
62.4
128
63.5
2
63.5
256
64.0
3
63.7
384
63.9
(a)
(b)
+
+# 4.5 Qualitative results
+
+In Figure 4, we show some qualitative results generated by our model on Pascal- $5 ^ { i }$ . Our cycleconsistent attention can improve the segmentation quality by suppressing possible harmful information from support. For instance, without cycle-consistency, the model misclassifies trousers as “cow” in the first row, baby’s hair as “cat” in the second row, and a fraction of mountain as “car” in the third row, while our model rectifies these part as background. However, in the first row, our CyCTR still segments part of the trousers as "cow" and the right boundary of the segmentation mask is slightly worse than the model without cycle-consistency. The reason comes from the extreme differences between query and support, i.e. the support image shows a "cattle" but the query image contains a milk cow. The cycle-consistency may over-suppress the positive region in support images. Solving such issue may be a potential direction to investigate to improve our method further.
+
+
+Figure 4: Qualitative results on Pascal- ${ \cdot } 5 ^ { i }$ . From left to right, each column shows the examples of: Support image with mask region in red; Query image with ground truth mask region in blue; Result produced by the model without cycle-consistency in CyCTR; Result produced by our method.
+
+# 5 Conclusion
+
+In this paper, we design a CyCTR module to deal with the few-shot segmentation problem. Different from previous practices that either adopt semantic-level prototype(s) from support images or only use foreground support features to encode query features, our CyCTR utilizes all pixel-level support features and can effectively eliminate aggregating confusing and harmful support features with the proposed novel cycle-consistency attention. We conduct extensive experiments on two popular benchmarks, and our CyCTR outperforms previous state-of-the-art methods by a significant margin. We hope this work can motivate researchers to utilize pixel-level support features to design more effective algorithms to advance the few-shot segmentation research.
+
+# References
+
+[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
+[2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
+[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229. Springer, 2020.
+[4] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834–848, 2017.
+[5] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
+[6] 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.
+[7] Nanqing Dong and Eric P Xing. Few-shot semantic segmentation with prototype learning. In BMVC, volume 3-4, 2018.
+[8] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+[9] Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet, and Andrew Zisserman. Temporal cycle-consistency learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1801–1810, 2019.
+[10] 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.
+[11] Bharath Hariharan, Pablo Arbeláez, Ross Girshick, and Jitendra Malik. Simultaneous detection and segmentation. In European Conference on Computer Vision, pages 297–312. Springer, 2014.
+[12] 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 (CVPR), pages 770–778, 2016.
+[13] Tao Hu, Pengwan Yang, Chiliang Zhang, Gang Yu, Yadong Mu, and Cees GM Snoek. Attentionbased multi-context guiding for few-shot semantic segmentation. In Association for the Advancement of Artificial Intelligence (AAAI), volume 33, pages pp. 8441–8448, 2019.
+[14] Zilong Huang, Xinggang Wang, Lichao Huang, Chang Huang, Yunchao Wei, and Wenyu Liu. Ccnet: Criss-cross attention for semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 603–612, 2019.
+[15] Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu, and Jingdong Wang. Weaklysupervised semantic segmentation network with deep seeded region growing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7014–7023, 2018.
+[16] Guoliang Kang, Yunchao Wei, Yi Yang, Yueting Zhuang, and Alexander G Hauptmann. Pixellevel cycle association: A new perspective for domain adaptive semantic segmentation. In NeurIPS, 2020.
+[17] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision (ECCV), 2014.
+[18] Yongfei Liu, Xiangyi Zhang, Songyang Zhang, and Xuming He. Part-aware prototype network for few-shot semantic segmentation. In European Conference on Computer Vision, pages 142–158. Springer, 2020.
+[19] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431–3440, 2015.
+[20] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+[21] Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 2016 fourth international conference on 3D vision (3DV), pages 565–571. IEEE, 2016.
+[22] Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. arXiv preprint arXiv:2104.01538, 2021.
+[23] Khoi Nguyen and Sinisa Todorovic. Feature weighting and boosting for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 622–631, 2019.
+[24] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
+[25] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
+[26] Amirreza Shaban, Shray Bansal, Zhen Liu, Irfan Essa, and Byron Boots. One-shot learning for semantic segmentation. In British Machine Vision Conference (BMVC), 2018.
+[27] Han Shi, Jiahui Gao, Xiaozhe Ren, Hang Xu, Xiaodan Liang, Zhenguo Li, and James T Kwok. Sparsebert: Rethinking the importance analysis in self-attention. arXiv preprint arXiv:2102.12871, 2021.
+[28] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems (NeurIPS), 2017.
+[29] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1199–1208, 2018.
+[30] Z Tian, H Zhao, M Shu, Z Yang, R Li, and J Jia. Prior guided feature enrichment network for few-shot segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
+[31] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
+[32] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000–6010, 2017.
+[33] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
+[34] Haochen Wang, Xudong Zhang, Yutao Hu, Yandan Yang, Xianbin Cao, and Xiantong Zhen. Few-shot semantic segmentation with democratic attention networks. In European Conference on Computer Vision (ECCV), 2020.
+[35] Kaixin Wang, Jun Hao Liew, Yingtian Zou, Daquan Zhou, and Jiashi Feng. Panet: Few-shot image semantic segmentation with prototype alignment. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9197–9206, 2019.
+[36] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
+[37] Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycleconsistency of time. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2566–2576, 2019.
+[38] Yunchao Wei, Jiashi Feng, Xiaodan Liang, Ming-Ming Cheng, Yao Zhao, and Shuicheng Yan. Object region mining with adversarial erasing: A simple classification to semantic segmentation approach. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1568–1576, 2017.
+[39] Yunchao Wei, Huaxin Xiao, Honghui Shi, Zequn Jie, Jiashi Feng, and Thomas S Huang. Revisiting dilated convolution: A simple approach for weakly-and semi-supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7268–7277, 2018.
+[40] Yangxin Wu, Gengwei Zhang, Yiming Gao, Xiajun Deng, Ke Gong, Xiaodan Liang, and Liang Lin. Bidirectional graph reasoning network for panoptic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9080–9089, 2020.
+[41] Boyu Yang, Chang Liu, Bohao Li, Jianbin Jiao, and Qixiang Ye. Prototype mixture models for few-shot semantic segmentation. In European Conference on Computer Vision, pages 763–778. Springer, 2020.
+[42] Lihe Yang, Wei Zhuo, Lei Qi, Yinghuan Shi, and Yang Gao. Mining latent classes for few-shot segmentation. arXiv preprint arXiv:2103.15402, 2021.
+[43] Chi Zhang, Guosheng Lin, Fayao Liu, Jiushuang Guo, Qingyao Wu, and Rui Yao. Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9587–9595, 2019.
+[44] Chi Zhang, Guosheng Lin, Fayao Liu, Rui Yao, and Chunhua Shen. Canet: Class-agnostic segmentation networks with iterative refinement and attentive few-shot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5217–5226, 2019.
+[45] Shiyin Zhang, Jun Hao Liew, Yunchao Wei, Shikui Wei, and Yao Zhao. Interactive object segmentation with inside-outside guidance. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12234–12244, 2020.
+[46] Xiaolin Zhang, Yunchao Wei, Yi Yang, and Thomas S Huang. Sg-one: Similarity guidance network for one-shot semantic segmentation. IEEE Transactions on Cybernetics, 50(9):3855– 3865, 2020.
+[47] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), 2017.
+[48] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
+[49] Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A Efros. Learning dense correspondence via 3d-guided cycle consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 117–126, 2016.
+[50] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223–2232, 2017.
+[51] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
\ No newline at end of file
diff --git a/md/train/MD3D5UbTcb1/MD3D5UbTcb1.md b/md/train/MD3D5UbTcb1/MD3D5UbTcb1.md
new file mode 100644
index 0000000000000000000000000000000000000000..099d8d8d3403522d72213bf060ee95d10281d4ce
--- /dev/null
+++ b/md/train/MD3D5UbTcb1/MD3D5UbTcb1.md
@@ -0,0 +1,488 @@
+# A UNIFIED VIEW ON GRAPH NEURAL NETWORKS AS GRAPH SIGNAL DENOISING
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Graph Neural Networks (GNNs) have risen to prominence in learning representations for graph structured data. A single GNN layer typically consists of a feature transformation and a feature aggregation operation. The former normally uses feed-forward networks to transform features, while the latter aggregates the transformed features over the graph. Numerous recent works have proposed GNN models with different designs in the aggregation operation. In this work, we establish mathematically that the aggregation processes in a group of representative GNN models including GCN, GAT, PPNP, and APPNP can be regarded as (approximately) solving a graph denoising problem with a smoothness assumption. Such a unified view across GNNs not only provides a new perspective to understand a variety of aggregation operations but also enables us to develop a unified graph neural network framework UGNN. To demonstrate its promising potential, we instantiate a novel GNN model, ADA-UGNN, derived from UGNN, to handle graphs with adaptive smoothness across nodes. Comprehensive experiments show the effectiveness of ADA-UGNN.
+
+# 1 INTRODUCTION
+
+Graph Neural Networks (GNNs) have shown great capacity in learning representations for graphstructured data and thus have facilitated many down-stream tasks such as node classification (Kipf & Welling, 2016; Velickovi ˇ c et al. ´ , 2017; Ying et al., 2018a; Klicpera et al., 2018) and graph classification (Defferrard et al., 2016; Ying et al., 2018b). As traditional deep learning models, a GNN model is usually composed of several stacking GNN layers. Given a graph $\mathcal { G }$ with $N$ nodes, a GNN layer typically contains a feature transformation and a feature aggregation operation as:
+
+Feature Transformation: ${ \bf X } _ { i n } ^ { \prime } = f _ { t r a n s } ( { \bf X } _ { i n } )$ ; Feature Aggregation: ${ \bf X } _ { o u t } = f _ { a g g } ( { \bf X } _ { i n } ^ { \prime } ; \mathcal { G } )$ (1) where ${ \bf X } _ { i n } \in \mathbb { R } ^ { N \times d _ { i n } }$ and $\mathbf { X } _ { o u t } \in \mathbb { R } ^ { N \times d _ { o u t } }$ denote the input and output features of the GNN layer with $d _ { i n }$ and $d _ { o u t }$ as the corresponding dimensions, respectively. Note that the non-linear activation is not included in Eq. (1) to ease the discussion. The feature transformation operation $f _ { t r a n s } ( \cdot )$ transforms the input of ${ \bf X } _ { i n }$ to $\mathbf { X } _ { i n } ^ { \prime } \in \mathbb { R } ^ { N \times d _ { o u t } }$ as its output; and the feature aggregation operation $f _ { a g g } ( \cdot ; \mathcal { G } )$ updates the node features by aggregating the transformed node features via the graph $\mathcal { G }$ .
+
+In general, different GNN models share similar feature transformations (often, a single feed-forward layer), while adopting different designs for aggregation operation. We raise a natural question – is there an intrinsic connection among these feature aggregation operations and their assumptions? The significance of a positive answer to this question is two-fold. Firstly, it offers a new perspective to create a uniform understanding on representative aggregation operations. Secondly, it enables us to develop a general GNN framework that not only provides a unified view on multiple existing representative GNN models, but also has the potential to inspire new ones. In this paper, we aim to build the connection among feature aggregation operations of representative GNN models including GCN (Kipf & Welling, 2016), GAT (Velickovi ˇ c et al. ´ , 2017), PPNP and APPNP (Klicpera et al., 2018). In particular, we mathematically establish that the aggregation operations in these models can be unified as the process of exactly, and sometimes approximately, addressing a graph signal denoising problem with Laplacian regularization (Shuman et al., 2013). This connection suggests that these aggregation operations share a unified goal: to ensure feature smoothness of connected nodes. With this understanding, we propose a general GNN framework, UGNN, which not only provides a straightforward, unified view for many existing aggregation operations, but also suggests various promising directions to build new aggregation operations suitable for distinct applications. To demonstrate its potential, we build an instance of UGNN called ADA-UGNN, which is suited for handling varying smoothness properties across nodes, and conduct experiments to show its effectiveness.
+
+# 2 REPRESENTATIVE GRAPH NEURAL NETWORKS
+
+In this section, we introduce notations for graphs and briefly summarize several representative GNN models. A graph can be denoted as $\mathcal { G } = \{ \dot { \mathcal { V } } , \mathcal { E } \}$ , where $\nu$ and $\mathcal { E }$ are its corresponding node and edge sets. The connections in $\mathcal { G }$ can be represented as an adjacency matrix $\mathbf { A } \in \bar { \mathbb { R } } ^ { N \times N }$ , with $N$ the number of nodes in the graph. The Laplacian matrix of the graph $\mathcal { G }$ is denoted as $\mathbf { L }$ . It is defined as $\mathbf { L } = \mathbf { D } - \mathbf { A }$ , where $\mathbf { D }$ is a diagonal degree matrix corresponding to A. There are also normalized versions of the Laplacian matrix such as $\mathbf { L } = \mathbf { I } - \mathbf { D } ^ { - \frac { 1 } { 2 } } \bar { \mathbf { A } } \mathbf { D } ^ { - \frac { 1 } { 2 } }$ or $\mathbf { L } = \mathbf { I } - \mathbf { D } ^ { - 1 } \mathbf { A }$ . In this work, we sometimes adopt different Laplacians to establish connections between different GNNs and the graph denoising problem, clarifying in the text. In this section, we generally use ${ \bf X } _ { i n } \in \mathbb { R } ^ { N \times d _ { i n } }$ and $\mathbf { X } _ { o u t } \in \mathbb { R } ^ { \bar { N } \times d _ { o u t } }$ to denote input and output features of GNN layers. Next, we describe a few representative GNN models.
+
+# 2.1 GRAPH CONVOLUTIONAL NETWORKS (GCN)
+
+Following Eq. (1), a single layer in GCN (Kipf & Welling, 2016) can be written as follows:
+
+Feature Transformation: $\mathbf { X } _ { i n } ^ { \prime } = \mathbf { X } _ { i n } \mathbf { W }$ ; Feature Aggregation: $\mathbf { X } _ { o u t } = \tilde { \mathbf { A } } \mathbf { X } _ { i n } ^ { \prime }$ ,
+
+where $\mathbf { W } \in \mathbb { R } ^ { d _ { i n } \times d _ { o u t } }$ is a feature transformation matrix, and $\tilde { \mathbf { A } }$ is a normalized adjacency matrix which includes a self-loop, defined as follows:
+
+$$
+\tilde { \mathbf { A } } = \hat { \mathbf { D } } ^ { - \frac { 1 } { 2 } } \hat { \mathbf { A } } \hat { \mathbf { D } } ^ { - \frac { 1 } { 2 } } , \quad \mathrm { w i t h } \quad \hat { \mathbf { A } } = \mathbf { A } + \mathbf { I } \quad \mathrm { a n d } \quad \mathbf { D } = \mathrm { d i a g } ( \sum _ { j } \hat { \mathbf { A } } _ { 1 , j } , \ldots , \sum _ { j } \hat { \mathbf { A } } _ { N , j } ) .
+$$
+
+In practice, multiple GCN layers can be stacked, where each layer takes the output of its previous layer as input. Non-linear activation functions are included between consecutive layers.
+
+# 2.2 GRAPH ATTENTION NETWORKS (GAT)
+
+Graph Attention Networks (GAT) adopts the same feature transformation operation as GCN in Eq. (2). The feature aggregation operation (written node-wise) for a node $i$ is as:
+
+$$
+\mathbf { X } _ { o u t } [ i , : ] = \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \alpha _ { i j } \mathbf { X } _ { i n } ^ { \prime } [ j , : ] , \quad \mathrm { w i t h } \quad \alpha _ { i j } = \frac { \exp \left( e _ { i j } \right) } { \sum _ { k \in \tilde { \mathcal { N } } ( i ) } \exp \left( e _ { i k } \right) } .
+$$
+
+where $\tilde { \mathcal { N } } ( i ) = \mathcal { N } ( i ) \cup \{ i \}$ denotes the neighbors (self-inclusive) of node $i$ , and $\mathbf { X } _ { o u t } [ i , : ]$ is the $i$ -th row of the matrix $\mathbf { X } _ { o u t }$ , i.e. the output node features of node $i$ . In this aggregation operation, $\alpha _ { i j }$ is a learnable attention score to differentiate the importance of distinct nodes in the neighborhood. Specifically, $\alpha _ { i j }$ is a normalized form of $e _ { i j }$ , which is modeled as:
+
+$$
+e _ { i j } = \mathrm { L e a k y R e L U } \left( \left[ \mathbf { X } _ { i n } ^ { \prime } [ i , : ] \Vert \mathbf { X } _ { i n } ^ { \prime } [ j , : ] \right] \mathbf { a } \right)
+$$
+
+where $[ \cdot \| \cdot ]$ denotes the concatenation operation and $\mathbf { a } \in \mathbb { R } ^ { 2 d }$ is a learnable vector. Similar to GCN, a GAT model usually consists of multiple stacked GAT layers.
+
+# 2.3 PERSONALIZED PROPAGATION OF NEURAL PREDICTIONS (PPNP)
+
+Personalized Propagation of Neural Predictions (PPNP) (Klicpera et al., 2018) introduces an aggregation operation based on Personalized PageRank (PPR). Specifically, the PPR matrix is defined as $\alpha ( \mathbf { I } - ( 1 - \alpha ) \tilde { \mathbf { A } } ) ^ { - 1 }$ , where $\alpha \in ( 0 , 1 )$ is a hyper-parameter. The $i j$ -th element of the PPR matrix specifies the influence of node $i$ on node $j$ . The feature transformation operation is modeled as Multi-layer Perception (MLP). The PPNP model can be written in the form of Eq. (1) as follows:
+
+Feature Transformation: ${ \bf X } _ { i n } ^ { \prime } = { \bf M L P } ( { \bf X } _ { i n } )$ ;
+
+Unlike GCN and GAT, PPNP only consists of a single feature aggregation layer, but with a potentially deep feature transformation. Since the matrix inverse in Eq. (6) is costly, Klicpera et al. (2018) also introduces a practical, approximated version of PPNP, called APPNP, where the aggregation operation is performed in an iterative way as:
+
+$$
+\mathbf { X } _ { o u t } ^ { ( k ) } = ( 1 - \alpha ) \tilde { \mathbf { A } } \mathbf { X } _ { o u t } ^ { ( k - 1 ) } + \alpha \mathbf { X } _ { i n } ^ { \prime } \quad k = 1 , \ldots K ,
+$$
+
+where X(0)out $\mathbf { X } _ { o u t } ^ { ( 0 ) } = \mathbf { X } _ { i n } ^ { \prime }$ n and X(K)out is the output of the feature aggregation operation. As proved in Klicpera et al. (2018), $\mathbf { X } _ { o u t } ^ { ( K ) }$ converges to the solution obtained by PPNP, i.e., $\mathbf { X } _ { o u t }$ in Eq. (6).
+
+# 3 GNNS AS GRAPH SIGNAL DENOISING
+
+In this section, we aim to establish the connections between the introduced GNN models and a graph signal denoising problem with Laplacian regularization. We first introduce the problem.
+
+Problem 1 (Graph Signal Denoising with Laplacian Regularization). Suppose that we are given a noisy signal $\bar { \mathbf { X } } \in \bar { \mathbb { R } } ^ { N \times d }$ on a graph $\mathcal { G }$ . The goal of the problem is to recover a clean signal $\mathbf { F } \in \bar { \mathbb { R } ^ { N \times \bar { d } } }$ , assumed to be smooth over $\mathcal { G }$ , by solving the following optimization problem:
+
+$$
+\arg \operatorname* { m i n } _ { \mathbf { F } } \mathcal { L } = \| \mathbf { F } - \mathbf { X } \| _ { F } ^ { 2 } + c \cdot t r ( \mathbf { F } ^ { \top } \mathbf { L } \mathbf { F } ) ,
+$$
+
+Note that the first term guides $\mathbf { F }$ to be close to $\mathbf { X }$ , while the second term $t r ( \mathbf { F } ^ { \top } \mathbf { L F } )$ is the Laplacian regularization that guides the smoothness of $\mathbf { F }$ over the graph. $c > 0$ is a balancing constant. Assuming we adopt the unnormalized version of Laplacian matrix with $\mathbf { L } = \mathbf { D } - \mathbf { A }$ (the adjacency matrix $\mathbf { A }$ is assumed to be binary), the second term in Eq. (8) can be written in an edge-centric way or a node-centric way as:
+
+$$
+| \mathrm { g e - c e n t r i c : } \ c \sum _ { ( i , j ) \in \mathcal { E } } \| \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \| _ { 2 } ^ { 2 } ; \quad \mathrm { n o d e - c e n t r i c : } \ \frac { 1 } { 2 } c \sum _ { i \in \mathcal { V } } \sum _ { j \in \tilde { N } ( i ) } \ \| \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \| _ { 2 } ^ { 2 } .
+$$
+
+Clearly, from the edge-centric view, the regularization term measures the global smoothness of $\mathbf { F }$ , which is small when connected nodes share similar features. On the other hand, we can view the term $\begin{array} { r } { \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \left\| \mathbf { F } \left[ i , : \right] - \mathbf { F } \left[ j , : \right] \right\| _ { 2 } ^ { 2 } } \end{array}$ as a local smoothness measure for node $i$ as it measures the difference between node $i$ and all its neighbors. The regularization term can then be regarded as a summation of local smoothness over all nodes. Note that the adjacency matrix $\mathbf { A }$ is assumed to be binary when deriving Eq. (9). Similar formulations can also be derived to other types of Laplacian matrices. In the following subsections, we demonstrate the connections between aggregation operations in various GNN models and the graph signal denoising problem.
+
+# 3.1 CONNECTION TO PPNP AND APPNP
+
+In this subsection, we establish the connection between the graph signal denoising problem (8) and the aggregation propagations in PPNP and APPNP in Theorem 1 and Theorem 2, respectively.
+
+Theorem 1. When we adopt the normalized Laplacian matrix $\mathbf { L } = \mathbf { I } - \tilde { \mathbf { A } }$ , with $\tilde { \mathbf { A } }$ defined in Eq. (3), the feature aggregation operation in PPNP (Eq. (6)) can be regarded as exactly solving the graph signal denoising problem (8) with $\mathbf { X } _ { i n } ^ { \prime }$ as the input noisy signal and $\begin{array} { r } { c = \frac { 1 } { \alpha } - 1 } \end{array}$ .
+
+Proof. Note that the objective in Eq. (8) is convex. Hence, its closed-form solution $\mathbf { F } ^ { * }$ to exactly solve the graph signal denosing problem can be obtained by setting its derivative to 0 as:
+
+$$
+{ \frac { \partial { \mathcal { L } } } { \partial \mathbf { F } } } = 2 ( \mathbf { F } - \mathbf { X } ) + 2 c \mathbf { L } \mathbf { F } = 0 \Rightarrow \mathbf { F } ^ { * } = ( \mathbf { I } + c \mathbf { L } ) ^ { - 1 } \mathbf { X }
+$$
+
+Given $\mathbf { L } = \mathbf { I } - \tilde { \mathbf { A } } , \mathbf { F } ^ { * }$ can be reformulated as:
+
+$$
+\mathbf { F } ^ { * } = \left( \mathbf { I } + c \mathbf { L } \right) ^ { - 1 } \mathbf { X } = \left( \mathbf { I } + c \left( \mathbf { I } - \tilde { \mathbf { A } } \right) \right) ^ { - 1 } \mathbf { X } = \frac { 1 } { 1 + c } \left( \mathbf { I } - \frac { c } { 1 + c } \tilde { \mathbf { A } } \right) ^ { - 1 } \mathbf { X }
+$$
+
+The feature aggregation operation in Eq. (6) is equivalent to the closed-form solution in Eq. (11) when we set $\alpha = 1 / ( 1 + c ) \bar { }$ and ${ \bf X } = { \bf X } _ { i n } ^ { \prime }$ . This completes the proof.
+
+Theorem 2. When we adopt the normalized Laplacian matrix $\mathbf { L } = \mathbf { I } - \tilde { \mathbf { A } }$ , the feature aggregation operation in APPNP (Eq. (7)) approximately solves the graph signal denoising problem (8) by iterative gradient descent with $\mathbf { X } _ { i n } ^ { \prime }$ as the input noisy signal, $\begin{array} { r } { c = \frac { 1 } { \alpha } - 1 } \end{array}$ and stepsize $\begin{array} { r } { b = \frac { 1 } { 2 + 2 c } } \end{array}$ .
+
+Proof. To solve the graph signal denoising problem (8), we take iterative gradient method with the stepsize $b$ . Specifically, the $\bar { k }$ -th step gradient descent on problem (8) is as follows:
+
+$$
+\mathbf { F } ^ { ( k ) } \gets \mathbf { F } ^ { ( k - 1 ) } - b \cdot \frac { \partial \mathcal { L } } { \partial \mathbf { F } } ( \mathbf { F } = \mathbf { F } ^ { ( k - 1 ) } ) = ( 1 - 2 b - 2 b c ) \mathbf { F } ^ { ( k - 1 ) } + 2 b \mathbf { X } + 2 b c \tilde { \mathbf { A } } \mathbf { F } ^ { ( k - 1 ) }
+$$
+
+where $\mathbf { F } ^ { ( 0 ) } = \mathbf { X }$ . When we set the stepsize $b$ as $\frac { 1 } { 2 + 2 c }$ , we have the following iterative steps:
+
+$$
+\mathbf { F } ^ { ( k ) } \frac { 1 } { 1 + c } \mathbf { X } + \frac { c } { 1 + c } \tilde { \mathbf { A } } \mathbf { F } ^ { ( k - 1 ) } , k = 1 , \dots K ,
+$$
+
+which is equivalent to the iterative aggregation operation of the APPNP model in Eq. (7) with $\mathbf { X } = \mathbf { X } _ { i n } ^ { \prime }$ and $\begin{array} { r } { \alpha = \frac { 1 } { 1 + c } } \end{array}$ . This completes the proof. □
+
+These two connections provide a new explanation on the hyper-parameter $\alpha$ in PPNP and APPNP from the graph signal denoising perspective. Specifically, a smaller $\alpha$ indicates a larger $c$ , which means the obtained $\mathbf { X } _ { o u t }$ is enforced to be smoother over the graph.
+
+# 3.2 CONNECTION TO GCN
+
+We draw the connection between the GCN model (Kipf & Welling, 2016) and the graph signal denoising problem in Theorem 3.
+
+Theorem 3. When we adopt the normalized Laplacian matrix $\begin{array} { r } { \mathbf { L } = \mathbf { I } - \tilde { \mathbf { A } } , } \end{array}$ , the feature aggregation operation in GCN Eq. (2) can be regarded as solving the graph signal denoising problem (8) using one-step gradient descent with $\mathbf { X } _ { i n } ^ { \prime }$ as the input noisy signal and stepsize $\begin{array} { r } { b = \frac { 1 } { 2 c } } \end{array}$ .
+
+Proof. The gradient with respect to $\mathbf { F }$ at $\mathbf { X }$ is $\begin{array} { r } { \frac { \partial \mathcal { L } } { \partial \mathbf { F } } | _ { \mathbf { F } = \mathbf { X } } = 2 c \mathbf { L } \mathbf { X } } \end{array}$ . Hence, one-step gradient descent for the graph signal denoising problem (8) can be described as:
+
+$$
+\mathbf { F } \mathbf { X } - b { \frac { \partial { \mathcal { L } } } { \partial \mathbf { F } } } | _ { \mathbf { F } = \mathbf { X } } = \mathbf { X } - 2 b c \mathbf { L } \mathbf { X } = ( 1 - 2 b c ) \mathbf { X } + 2 b c { \tilde { \mathbf { A } } } \mathbf { X } .
+$$
+
+When stepsize operation of GC $\smash { b = \frac { 1 } { 2 c } }$ and ${ \bf X } = { \bf X } _ { i n } ^ { \prime }$ , we have $\mathbf { F } \gets \tilde { \mathbf { A } } \mathbf { X } _ { i n } ^ { \prime }$ , which is the same as the aggregation
+
+With this connection, it is easy to verify that a GCN model with multiple GCN layers can be regarded as solving the graph signal denoising problem multiple times with different noisy signals. Specifically, each layer of a GCN model corresponds to a graph signal denoising problem, where the input noisy signal is the output from the previous layer after the feature transformation of the current layer. Note that there are earlier works (NT & Maehara, 2019; Zhao & Akoglu, 2019) drawing connection between GCN and the optimization problem in Eq. (8), where the aggregation operation in GCN is shown to be the first-order approximation of the exact solution.
+
+# 3.3 CONNECTION TO GAT
+
+To establish the connection between graph signal denoising and GAT (Velickovi ˇ c et al. ´ , 2017), in this subsection, we adopt an unnormalized version of the Laplacian. It is defined based on the adjacency matrix with self-loop $\hat { \bf A }$ , i.e. $\mathbf { L } = { \hat { \mathbf { D } } } - { \hat { \mathbf { A } } }$ with $\hat { \bf D }$ denoting the diagonal degree matrix of $\hat { \bf A }$ . Then, the denoising problem in Eq. (8) can be rewritten from a node-centric view as:
+
+$$
+\arg \operatorname* { m i n } _ { \mathbf { F } } \mathcal { L } = \sum _ { i \in \mathcal { V } } \| \mathbf { F } [ i , : ] - \mathbf { X } [ i , : ] \| _ { 2 } ^ { 2 } + \frac { 1 } { 2 } \sum _ { i \in \mathcal { V } } c \cdot \sum _ { j \in \tilde { N } ( i ) } \| \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \| _ { 2 } ^ { 2 } ,
+$$
+
+where $\tilde { \mathcal { N } } ( i ) = \mathcal { N } ( i ) \cup \{ i \}$ denotes the neighbors (self-inclusive) of node $i$ . In Eq. (15), the constant $c$ is shared by all nodes, which indicates that the same level of local smoothness is enforced to all nodes. However, nodes in a real-world graph can have varied local smoothness. For nodes with low local smoothness, we should impose a relatively smaller $c$ , while for those nodes with higher local smoothness, we need a larger $c$ . Hence, instead of a unified $c$ as in Eq. (15), we could consider a node-dependent $c _ { i }$ for each node $i$ . Then, the optimization problem in Eq. (15) can be adjusted as:
+
+$$
+\arg \operatorname* { m i n } _ { \mathbf { F } } \mathcal { L } = \sum _ { i \in \mathcal { V } } \| \mathbf { F } \left[ i , : \right] - \mathbf { X } \left[ i , : \right] \| _ { 2 } ^ { 2 } + \frac { 1 } { 2 } \sum _ { i \in \mathcal { V } } c _ { i } \cdot \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \| \mathbf { F } \left[ i , : \right] - \mathbf { F } \left[ j , : \right] \| _ { 2 } ^ { 2 }
+$$
+
+We next show that the aggregation operation in GAT is closely connected to an approximate solution of problem (16) with the help of the following theorem.
+
+Theorem 4. With adaptive stepsize $b _ { i } = 1 / \sum _ { j \in \tilde { \mathcal { N } } ( i ) } ( c _ { i } + c _ { j } )$ for each node i, the process of taking one step of gradient descent from $\mathbf { X }$ to solve problem (16) can be described as follows:
+
+$$
+\mathbf { F } [ i , : ] \sum _ { j \in \tilde { \mathcal { N } } ( i ) } b _ { i } ( c _ { i } + c _ { j } ) \mathbf { X } [ j , : ] .
+$$
+
+Proof. The gradient of optimization problem in Eq. (16) with respect to $\mathbf { F }$ focusing on a node $i$ can be formulated as:
+
+$$
+\frac { \partial \mathcal { L } } { \partial \mathbf { F } \left[ i , : \right] } = 2 \left( \mathbf { F } \left[ i , : \right] - \mathbf { X } \left[ i , : \right] \right) + \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \left( c _ { i } + c _ { j } \right) \left( \mathbf { F } \left[ i , : \right] - \mathbf { F } \left[ j , : \right] \right) ,
+$$
+
+where $c _ { j }$ in the second term appears since $i$ is also in the neighborhood of $j$ . Then, the gradient at $\mathbf { X }$ is $\frac { \partial \mathcal { L } } { \partial \mathbf { F } [ i , : ] } \Big | _ { \mathbf { F } [ i , : ] = \mathbf { X } [ i , : ] } = \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \left( c _ { i } + c _ { j } \right) \left( \mathbf { X } \left[ i , : \right] - \mathbf { X } \left[ j , : \right] \right)$ . Thus, taking a step of gradient descent starting from $\mathbf { X }$ with stepsize $b$ can be described as follows:
+
+$$
+\mathbf { F } \left[ i , : \right] \gets \mathbf { X } \left[ i , : \right] - b \cdot \left. \frac { \partial \mathcal { L } } { \partial \mathbf { F } \left[ i , : \right] } \right| _ { \mathbf { F } \left[ i , : \right] = \mathbf { X } \left[ i , : \right] } = \left( 1 - b \sum _ { j \in \tilde { N } \left( i \right) } \left( c _ { i } + c _ { j } \right) \right) \mathbf { X } \left[ i , : \right] + \sum _ { j \in \tilde { N } \left( i \right) } b \left( c _ { i } + c _ { j } \right) \mathbf { X } \left[ j , : \right]
+$$
+
+Given $b = 1 / \sum _ { \mathbf { i } } \ \left( c _ { i } + c _ { j } \right)$ , Eq. (19) can be rewritten as $\mathbf { F } [ i , : ] \sum _ { j \in \tilde { \mathcal { N } } ( i ) } b _ { i } ( c _ { i } + c _ { j } ) \mathbf { X } [ j , : ]$ , which $\mathsf { \Pi } _ { j \in \overline { { \tilde { \mathcal { N } } } } ( i ) }$
+completes the proof.
+
+Eq. (17) resembles the aggregation operation of GAT in Eq. (4) if we treat $b _ { i } ( c _ { i } + c _ { j } )$ as the attention score $\alpha _ { i j }$ . Note that we have $\sum _ { j \in \tilde { \mathcal { N } } ( i ) } ( c _ { i } + c _ { j } ) = 1 / b _ { i }$ , for all $i \in \mathcal V$ . So, $( c _ { i } + c _ { j } )$ can be regarded as the pre-normalized attention score and $1 / b _ { i }$ can be regarded as the normalization constant. We further compare $b _ { i } ( c _ { i } + c _ { j } )$ with $\alpha _ { i j }$ by investigating the formulation of $e _ { i j }$ in Eq. (5). Eq. (5) can be rewritten as:
+
+$$
+e _ { i j } = \mathrm { L e a k y R e L U } \left( \mathbf { X } _ { i n } ^ { \prime } [ i , : ] \mathbf { a } _ { 1 } + \mathbf { X } _ { i n } ^ { \prime } [ j , : ] \mathbf { a } _ { 2 } \right)
+$$
+
+where $\mathbf { a } _ { 1 } \in \mathbb { R } ^ { d }$ and $\mathbf { a } _ { 2 } \in \mathbb { R } ^ { d }$ are learnable column vectors, which can be concatenated to form a in Eq. (5). Comparing $e _ { i j }$ with $( c _ { i } + c _ { j } )$ , we find that they take a similar form. Specifically, ${ \bf X } _ { i n } ^ { \prime } [ i , : ] { \bf a } _ { 1 }$ and $\mathbf { X } _ { i n } ^ { \prime } [ j , : ] \dot { \mathbf { a } } _ { 2 }$ can be regarded as the approximations of $c _ { i }$ and $c _ { j }$ , respectively. The difference between $b _ { i } ( c _ { i } + c _ { j } )$ and $\alpha _ { i j }$ is that the normalization in Eq. (17) for $b _ { i } \mathbf { \bar { ( } } c _ { i } + c _ { j } \mathbf { ) }$ is achieved via summation rather than a softmax as in Eq. (4) for $\alpha _ { i j }$ . Note that since GAT makes the $c _ { i }$ and $c _ { j }$ learnable, they also include a non-linear activation in calculating $e _ { i j }$ . By viewing the attention mechanism in GAT from the perspective of Eq. (17), namely that $c _ { i }$ actually indicates a notion of local smoothness for node $i$ , we can develop other ways to parameterize $c _ { i }$ . For example, instead of directly using the node features of $i$ as an indicator of local smoothness like GAT, we can consider the neighborhood information. In fact, we adopt this idea to design a new aggregation operation in Section 5.
+
+# 4 UGNN: A UNIFIED GNN FRAMEWORK VIA GRAPH SIGNAL DENOISING
+
+In the previous section, we established that the aggregation operations in PPNP, APPNP, GCN and GAT are intimately connected to the graph signal denoising problem with (generalized) Laplacian regularization. In particular, from this perspective, all their aggregation operations aim to ensure feature smoothness: either a global smoothness over the graph as in PPNP, APPNP and GCN, or a local smoothness for each node as in GAT. This understanding allows us to develop a unified feature aggregation operation by posing the following, more general graph signal denoising problem:
+
+Problem 2 (Generalized UGNN Graph Signal Denoising Problem).
+
+$$
+\arg \operatorname* { m i n } _ { \mathbf { F } } \mathcal { L } = \| \mathbf { F } - \mathbf { X } \| _ { F } ^ { 2 } + r ( \mathcal { C } , \mathbf { F } , \mathcal { G } ) ,
+$$
+
+where $r ( \mathcal { C } , \mathbf { F } , \mathcal { G } )$ denotes a flexible regularization term to enforce some prior over $\mathbf { F }$
+
+Note that we overload the notation $\mathcal { C }$ here: it can function as a scalar (like a global constant in GCN), a vector (like node-wise constants in GAT) or even a matrix (edge-wise constants) if we want to give flexibility to each node pair. Different choices of $r ( \cdot )$ imply different feature aggregation operations. Besides PPNP, APPNP, GCN and GAT, there are aggregation operations in more GNN models that can be associated with Problem 2 with different regularization terms such as PairNorm (Zhao & Akoglu, 2019) and DropEdge (Rong et al., 2019) (more details can be found in Appendix B). The above mentioned regularization terms are all related to the Laplacian regularization. Other regularization terms can also be adopted, which may lead to novel designs of GNN layers. For example, if we aim to enforce that the clean signal is piece-wise linear, we can adopt $r ( \dot { \mathcal { C } } , \mathbf { F } , \mathcal { G } ) = \mathcal { C } \cdot \| \dot { \mathbf { L } } \mathbf { F } \| _ { 1 }$ designed for trend filtering (Tibshirani et al., 2014; Wang et al., 2016).
+
+With these discussions, we propose a unified framework (UGNN) to design GNN layers from the graph signal processing perspective as: (1) Design a graph regularization term $r ( \mathcal { C } , \dot { \bf F } , \mathcal { G } )$ in Problem 2 according to specific applications; (2) Feature Transformation: ${ \bf X } _ { i n } ^ { \prime } = f _ { t r a n s } ( { \bf X } _ { i n } )$ ; and (3) Feature Aggregation: Solving Problem 2 with ${ \bf X } = { \bf X } _ { i n } ^ { \prime }$ and the designed $r ( \mathcal { C } , \mathbf { F } , \mathcal { G } )$ . To demonstrate the potential of UGNN, next we introduce a new GNN model ADA-UGNN by instantiating UGNN with $r ( \mathcal { C } , \mathbf { F } , \mathcal { G } )$ enforcing adaptive local smoothness across nodes. Note that we introduce ADA-UGNN with node classification as the downstream task.
+
+# 5 ADA-UGNN: ADAPTIVE LOCAL SMOOTHING WITH UGNN
+
+From the graph signal denoising perspective, PPNP, APPNP, and GCN enforces global smoothness by penalizing the difference with a constant $\mathcal { C }$ for all nodes. However, real-world graphs may consist of multiple groups of nodes which have different behaviors in connecting to similar neighbors. For example, Section 6.1 shows several graphs with varying distributions of local smoothness (as measured by label homophily): summarily, not all nodes are highly label-homophilic, and some nodes have considerably “noisier” neighborhoods than others. Moreover, as suggested by Wu et al. (2019); Jin et al. (2020), adversarial attacks on graphs tend to promote such label noise in graphs by connecting nodes from different classes and disconnecting nodes from the same class, rendering resultant graphs with varying local smoothness across nodes. Under these scenarios, a constant $\mathcal { C }$ might not be optimal and adaptive (i.e. non-constant) smoothness to different nodes is desired. As shown in Section 3.3 by viewing GAT’s aggregation as a solution to regularized graph signal denoising, GAT can be regarded as adopting an adaptive $\mathcal { C }$ for different nodes, which facilitates adaptive local smoothness. However, in GAT, the graph denoising problem is solved by a single step of gradient descent, which might still be suboptimal. Furthermore, when modeling the local smoothness factor $c _ { i }$ in Eq. (17), GAT only uses features of node $i$ as input, which may not be optimal since by understanding $c _ { i }$ as local smoothness, it should be intrinsically related to the neighborhood of node $i$ . In this section, we adapt this notion directly into the UGNN framework by introducing a new regularization term, and develop a resulting GNN model (ADA-UGNN) which aims to enforce adaptive local smoothness to nodes in a different manner to GAT. We then utilize an iterative gradient descent method to approximate the optimal solution for Problem 2 with the following regularization term:
+
+$$
+r ( \mathcal { C } , \mathbf { F } , \mathcal { G } ) = \frac { 1 } { 2 } \cdot \sum _ { i \in \mathcal { V } } \mathcal { C } _ { i } \sum _ { j \in \tilde { \mathcal { N } } ( i ) } \left\| \frac { \mathbf { F } [ i , : ] } { \sqrt { d _ { i } } } - \frac { \mathbf { F } [ j , : ] } { \sqrt { d _ { j } } } . \right\| _ { 2 } ^ { 2 }
+$$
+
+where $d _ { i } , d _ { j }$ denotes the degree of node $i$ and $j$ respectively, and $\mathcal { C } _ { i }$ indicates the smoothness factor of node $i$ , which is assumed to be a fixed scalar. Note that, the above regularization term can be regarded as a generalized version of the regularization term used in PPNP, APPNP, and GCN. Similar to PPNP and APPNP, ADA-UGNN only consists of a single GNN layer. However, ADA-UGNN assumes adaptive local smoothness. We next describe the feature transformation and aggregation operations of ADA-UGNN, and show how to derive the model via UGNN.
+
+# 5.1 FEATURE TRANSFORMATION
+
+Similar to PPNP and APPNP, we adopt MLP for the feature transformation. Specifically, for a node classification task, the dimension of the output of the feature transformation $\mathbf { \bar { X } } _ { i n } ^ { \prime }$ is the number of classes in the graph.
+
+# 5.2 FEATURE AGGREGATION
+
+We use iterative gradient descent to solve Problem 2 with the regularization term in Eq. (22) The iterative gradient descent steps are stated in the following theorem and its proof can be found at Appendix A.1.
+
+Theorem 5. With adaptive stepsize $b _ { i } = 1 / \left( 2 + \sum _ { j \in \tilde { \mathcal { N } } ( i ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ for each node i, the iterative gradient descent steps to solve Problem 2 with the regularization term in Eq. (22) is as follows:
+
+$$
+\mathbf { F } ^ { ( k ) } [ i , : ] 2 b \mathbf { X } [ i , : ] + b _ { i } \sum _ { j \in \tilde { \cal N } ( i ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { i } ) \frac { \mathbf { F } ^ { ( k - 1 ) } [ j , : ] } { \sqrt { d _ { i } d _ { j } } } ; \quad k = 1 , \dots .
+$$
+
+where ${ \bf F } ^ { ( 0 ) } [ i , : ] = { \bf X } [ i , : ]$
+
+The iterative steps in Eq. (23) is guaranteed for convergence as stated in the following theorem and its proof can be found in Appendix A.2.
+
+Theorem 6. The iterative steps in Eq. (23) is guaranteed to converge to the optimal solution of Problem 2 with Eq. (22) as regularization term.
+
+Following the iterative solution in Eq. (23), we model the aggregation operation (for node $i$ ) for ADA-UGNN as follows:
+
+$$
+{ \bf X } _ { o u t } ^ { ( k ) } [ i , : ] 2 b _ { i } { \bf X } _ { i n } ^ { \prime } [ i , : ] + b _ { i } \sum _ { v _ { j } \in \tilde { \cal N } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) \frac { { \bf X } _ { o u t } ^ { ( k - 1 ) } [ j , : ] } { \sqrt { d _ { i } d _ { j } } } ; \quad k = 1 , \dots K ,
+$$
+
+where $K$ is the number gradient descent iterations, $\mathcal { C } _ { i }$ can be considered as a positive scalar to control the level of “local smoothness” for node $i$ and $b _ { i }$ can be calculated from $\bar { \{ { \mathcal C } _ { j } | j } \in \tilde { \mathcal { N } } ( i ) \}$ as $b _ { i } = 1 / \left( 2 + \sum _ { j \in \tilde { \mathcal { N } } ( i ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ . However, in practice, $\mathcal { C } _ { i }$ is usually unknown. One possible solution is to treat $\mathcal { C } _ { i }$ as hyper-parameters. Treating $\mathcal { C } _ { i }$ as hyper-parameters for all nodes is impractical, since there are, in total $N$ of them and we do not have their prior knowledge. Thus, we model $\mathcal { C } _ { i }$ as a function of the information of the neighborhood of node $i$ as follows:
+
+$$
+\mathcal { C } _ { i } = s \cdot \sigma \left( h _ { 1 } \left( h _ { 2 } \left( \left\{ \mathbf { X } _ { i n } ^ { \prime } [ j , : ] | j \in \tilde { N } ( i ) \right\} \right) \right) \right) ,
+$$
+
+where $h _ { 2 } ( \cdot )$ is a function to transform the neighborhood information of node $i$ to a vector, while $h _ { 1 } ( \cdot )$ further transforms it to a scalar. $\sigma ( \cdot )$ denotes the sigmoid function, which maps the output scalar from $h _ { 1 } ( \cdot )$ to $( 0 , 1 )$ and $s$ can be treated as a hyper-parameter controlling the upper bound of $\mathcal { C } _ { i }$ . $h _ { 1 } ( \cdot )$ can be modeled as a single layer fully-connected neural network. There are different designs for $h _ { 2 } ( \cdot )$ such as channel-wise variance or mean (Corso et al., 2020). In this paper, we adopt channel-wise variance as the $h _ { 2 } ( \cdot )$ function. In this case, the calculation of $\mathcal { C } _ { i }$ in Eq. (25) only involves $H$ parameters, with $H$ denoting number of classes in the dataset. APPNP can be regarded a special case of ADA-UGNN, where $\bar { h _ { 2 } } ( \cdot )$ is modeled as a constant function producing 1 as the outpafter for all nodes. For the node classification task, the representation iterations as in Eq. (24), is directly softmax normalized row-wise $\mathbf { X } _ { o u t } ^ { ( K ) }$ ,s hich is obtained-th row indicates $K$ $i$ the discrete class distribution of node $i$ .
+
+# 6 EXPERIMENT
+
+In this section, we evaluate how the proposed ADA-UGNN handles graphs with varying local smoothness. We conduct node classification experiments on natural graphs, and also evaluate the model’s robustness under adversarial attacks. We note that our main goal in proposing/evaluating ADA-UGNN is to demonstrate the promise of deriving new aggregations as solutions of denoising problems, rather than state-of-the-art performance.
+
+# 6.1 NODE CLASSIFICATION
+
+In this section, we conduct the node classification task. We first introduce the datasets and the experimental settings in Section 6.1.1 and then present the results in Section 6.1.2.
+
+# 6.1.1 DATASETS AND EXPERIMENTAL SETTINGS
+
+We conduct the node classification task on 8 datasets from various domains including citation, social, co-authorship and co-purchase networks. Specifically, we use three citation networks including CORA, CITESEER, and PUBMED (Sen et al., 2008); one social network, BLOGCATALOG (Huang et al., 2017); two co-authorship networks including COAUTHOR-CS and COAUTHOR-PH (Shchur et al., 2018); and two co-purchase networks including AMAZON-COMP and Amazon Photos (Shchur et al., 2018). Descriptions and detail statistics about these datasets can be found in Appendix C.1. To provide a sense of the local smoothness properties of these datasets, in addition to the summary statistics, we also illustrate the local label smoothness distributions in Appendix C.1.1: here, we define the local label smoothness of a node as the ratio of nodes in its neighborhood that share the same label (see formal definition in Eq. (34) in Appendix C.1.1). Notably, the variety in local label smoothness within several real-world datasets – also observed in (Shah, 2020) – clearly motivates the importance of the adaptive smoothness assumption in ADA-UGNN. For the citation networks, we use the standard split as provided in Kipf & Welling (2016); Yang et al. (2016). For BLOGCATALOG, we adopt the split provided in Zhao et al. (2020). For both the citation networks and BLOGCATALOG, the experiments are run with 30 random seeds and the average results are reported. For co-authorship and co-purchase networks, we utilize 20 labels per class for training, 30 nodes per class for validation and the remaining nodes for test. This process is repeated 20 times, which results in 20 different training/validation/test splits. For each split, the experiment is repeated for 20 times with different initialization. The average results over $2 0 \times 2 0$ experiments are reported. We compare our methods with the methods introduced in Section 2 including GCN, GAT and APPNP. Note that we do not include PPNP as it is difficult to scale for most of the datasets due to the calculation of inverse in Eq. 6. For all methods, we tune the hyperparameters from the following options: 1) learning rate: $\{ 0 . 0 0 \dot { 5 } , 0 . 0 1 , 0 . 0 5 \} ;$ 2) weight decay $\{ 5 e - 0 \dot { 4 } , 5 e - 0 5 , 5 e - 0 6 , 5 e - 0 7 , 5 e - 0 \dot { 8 } \}$ ; and 3) dropout rate: $\{ 0 . 2 , 0 . 5 , 0 . 8 \}$ . For APPNP and our method we further tune the number of iterations $K$ and the upper bound $s$ for $c _ { i }$ in Eq. (25) from the following range: 1) $K$ : $\{ 5 , 1 0 \}$ ; and $s$ : $\{ 1 , 9 , 1 9 \}$ . Note that we treat APPNP as a special case of our proposed method with $\overset { \cdot } { h _ { 2 } } ( \cdot ) = 1$ .
+
+# 6.1.2 PERFORMANCE COMPARISON
+
+The performance comparison is shown in Table 1, where $t$ -test is used to test the significance. First, GAT outperforms GCN in most datasets. It indicates that modeling adaptive local smoothness is helpful. Second, APPNP/ADA-UGNN outperform GCN/GAT in most settings, suggesting that iterative gradient descent may offer advantages to single-step gradients, due to their better ability to achieve a solution closer to the optimal. Third, and most notably, the proposed ADA-UGNN achieves consistently better performance than GCN/GAT, and outperforms or matches the stateof-the-art APPNP across datasets. Notice that in some datasets such as CORA, CITESEER, and
+
+Table 1: Node Classification Accuracy on Various Datasets
+
+
Dataset
GCN
GAT
APPNP
ADA-UGNN
CORA
81.75±0.8
82.56±0.8
84.49±0.6
84.59±0.8*
CITESEER
70.13±1.0
70.77±0.8
71.97±0.6
72.05±0.5
PUBMED
78.56±0.5
78.88±0.5
79.92±0.5
79.70±0.4
BLOGCATALOG
71.38±2.7
72.90±1.2
92.43±0.9
93.33±0.3***
AMAZON-COMP
82.79±1.3
83.01±1.5
82.99±1.6
83.40±1.3***
AMAZON-PHOTO
89.60±1.5
90.33±1.2
91.38±1.2
91.44±1.2
COAUTHOR-CS
91.55±0.6
90.95±0.7
91.69±0.4
92.33±0.5***
COAUTHOR-PH
93.23±0.7
92.86±0.7
93.84±0.5
93.92±0.6**
+
+∗, $^ { \ast \ast }$ , $^ { \ast \ast \ast }$ indicate the improvement over APPNP is significant at $\overline { { p < 0 . 1 , 0 . 0 5 } }$ and 0.005
+
+
+Figure 1: Accuracy for nodes with low and high local label smoothness.
+
+COAUTHOR-PH, the improvements of the proposed model compared with APPNP are not very significant. Figure 3 in Appendix C.1.1 shows that these datasets have extremely skewed local label smoothness distributions, with the majority of nodes having perfect, 1.0, label homophily (they are only connected to other nodes of the same label). APPNP shines in such cases, since its assumption of $h _ { 2 } ( \cdot ) = 1$ is ideal for these nodes (designating maximal local smoothness). Conversely, our model has the challenging task of learning $h _ { 2 } ( \cdot )$ – in such skewed cases, learning $h _ { 2 } ( \cdot )$ may be quite challenging and unfruitful. On the other hand, for datasets with higher diversity in local label smoothness across nodes such as BLOGCATALOG and AMAZON-COMP, the proposed ADA-UGNN achieves more significant improvements.
+
+To further validate, we partition the nodes in the test set of each dataset into two groups: (1) high smoothness: those with local label smoothness $> 0 . 5$ , and (2) low smoothness: those with $\le 0 . 5$ , and evaluate accuracy for APPNP and the proposed ADA-UGNN for each group. The results for CORA, BLOGCATALOG, AMAZON-COMP and COAUTHOR-CS are presented in Figure 1 while the results for the remaining datasets can be found in Figure 4 in Appendix C.2. Figure 1 clearly shows that ADA-UGNN consistently improves performance for low-smoothness nodes in most datasets, while keeping comparable (or marginally worse) performance for high-smoothness nodes. In cases where many nodes have low-level smoothness (like BLOGCATALOG or AMAZON-COMP), our method can notably improve overall performance.
+
+# 6.2 ROBUSTNESS UNDER ADVERSARIAL ATTACKS
+
+Adversarial attacks on graphs tend to connect nodes from different classes and remove edges between nodes from the same class (Wu et al., 2019; Jin et al., 2020), producing graphs with varying local label smoothness after attack (we demonstrate this in Appendix C.3). To further demonstrate that ADA-UGNN can handle graphs with varying local label smoothness better than alternatives, we conduct experiments to show its robustness under adversarial attacks. Specifically, we adopt Mettack (Zugner & G ¨ unnemann ¨ , 2019) to perform the attacks. Mettack produces non-targeted attacks which aim to impair test set node classification performance by strategically adding or removing edges from the victim graph. We utilize the attacked graphs $( 5 \% - 2 5 \%$ perturb rate) from Jin et al. (2020) and follow the same setting, i.e., each method is run with 10 random seeds and the average performance is reported. These attacked graphs are generated from CORA, CITESEER and PUBMED, respectively and only the largest connected component is retained in each graph. Furthermore, the training, validation and test split ratio is $1 0 / 1 0 \dot { / } 8 0 \%$ , which is different from the standard splits we use in Section 6.1. Thus, the performances reported in this section is not directly comparable with those in the previous section. We compare our method both with standard GNNs discussed in Section 2 (GCN, GAT, APPNP), but also with recent state-of-the-art defense techniques against adversarial attacks including GCN-Jaccard (Wu et al., 2019), GCN-SVD (Entezari et al., 2020), ProGNN-fs and Pro-GNN (Jin et al., 2020). The detailed description of these methods can be found at
+
+
+Figure 2: Robustness under adversarial attacks (node classification accuracy).
+
+Appendix C.4. Results under varying perturbation rates (attack intensities) are shown in Figure 2. Again, we observe that GAT outperforms GCN, suggesting the appeal of an adaptive local smoothness assumption. Here, our method (orange) substantially outperforms GCN, GAT and APPNP by a large margin, especially in scenarios with high perturbation rate. Moreover, the proposed ADAUGNN is also even more robust than several specially designed adversarial defense methods, like GCN-Jaccard and GCN-SVD, which are based on pre-processing the adversarial attack graphs to obtain cleaner ones, thanks to its adaptive smoothness assumption. Compared with Pro-GNN-fs, our method performs comparably or even better in a few settings, especially when perturbation rate is high. Furthermore, in these settings, the performance of our method is even closer to ProGNN, which is the current state-of-the art adversarial defense technique. Note that, Pro-GNN-fs and Pro-GNN involves learning cleaner adjacency matrices of the attacked graphs, and thus has $O ( M )$ parameters (M denotes the number of edges in a graph), while our proposed model has far less parameters. Specifically, we have $O ( d _ { i n } \cdot \bar { d _ { o u t } } )$ for feature transformation and $H$ parameters for modelling $h _ { 1 } ( \cdot )$ with $H$ denoting the number of labels.
+
+# 7 RELATED WORKS
+
+There are mainly two streams of work in developing GNN models, i.e, spectral-based and spatialbased. When designing spectral-based GNNs, graph convolution (Shuman et al., 2013), defined based on spectral theory, is utilized to design graph neural network layers together with the feature transformation and non-linearity (Bruna et al., 2013; Henaff et al., 2015; Defferrard et al., 2016). These designs of the spectral-based graph convolution are tightly related with graph signal processing, and they can be regarded as graph filters. Low-pass graph filters can usually be adopted to denoise graph signals (Chen et al., 2014). In fact, most algorithms discussed in our work can be regarded as low-pass graph filters. With the emergence of GCN (Kipf & Welling, 2016), which can be regarded as a simplified spectral-based and also a spatial-based graph convolution operator, numerous spatial-based GNN models have since been developed (Hamilton et al., 2017; Velickovi ˇ c´ et al., 2017; Monti et al., 2017; Gao et al., 2018; Gilmer et al., 2017).
+
+Graph signal denoising is to infer a cleaner graph signal given a noisy signal, and can be usually formulated as a graph regularized optimization problem (Chen et al., 2014). Recently, several works connect GCN with graph signal denoising with Laplacian regularization (NT & Maehara, 2019; Zhao & Akoglu, 2019), where they found the aggregation process in GCN models can be regarded as the first-order approximation of the optimal solution of the denoising problem. On the other hand, GNNs are also utilized to develop novel algorithms for graph denoising (Chen et al., 2020). Unlike these works, our paper details how a family of GNN models can be unified with a graph signal denoising perspective, and demonstrates its promise for new architecture design.
+
+# 8 CONCLUSION
+
+In this paper, we show how various representative GNN models including GCN, PPNP, APPNP and GAT can be unified mathematically as natural instances of graph denoising problems. Specifically, the aggregation operations in these models can be regarded as exactly or approximately addressing such denoising problems subject to Laplacian regularization. With these observations, we propose a general framework, UGNN, which enables the design of new GNN models from the denoising perspective via regularizer design. As an example demonstrating the promise of this paradigm, we instantiate the UGNN framework with a regularizer addressing adaptive local smoothness across nodes, a property prevalent in several real-world graphs, and proposed and evaluated a suitable new GNN model, ADA-UGNN.
+
+# REFERENCES
+
+Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
+
+Siheng Chen, Aliaksei Sandryhaila, Jose MF Moura, and Jelena Kovacevic. Signal denoising on ´ graphs via graph filtering. In 2014 IEEE Global Conference on Signal and Information Processing (GlobalSIP), pp. 872–876. IEEE, 2014.
+
+Siheng Chen, Yonina C Eldar, and Lingxiao Zhao. Graph unrolling networks: Interpretable neural networks for graph signal denoising. arXiv preprint arXiv:2006.01301, 2020.
+
+Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Lio, and Petar Veli \` ckovi ˇ c. Principal ´ neighbourhood aggregation for graph nets. arXiv preprint arXiv:2004.05718, 2020.
+
+Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In Advances in neural information processing systems, pp. 3844–3852, 2016.
+
+Negin Entezari, Saba A Al-Sayouri, Amirali Darvishzadeh, and Evangelos E Papalexakis. All you need is low (rank) defending against adversarial attacks on graphs. In Proceedings of the 13th International Conference on Web Search and Data Mining, pp. 169–177, 2020.
+
+Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD, pp. 1416–1424, 2018.
+
+Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017.
+
+Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pp. 1024–1034, 2017.
+
+Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
+
+Xiao Huang, Jundong Li, and Xia Hu. Label informed attributed network embedding. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pp. 731–739, 2017.
+
+Wei Jin, Yao Ma, Xiaorui Liu, Xianfeng Tang, Suhang Wang, and Jiliang Tang. Graph structure learning for robust graph neural networks. arXiv preprint arXiv:2005.10203, 2020.
+
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
+
+Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: ¨ Graph neural networks meet personalized pagerank. arXiv preprint arXiv:1810.05997, 2018.
+
+Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proceedings of the IEEE Conference on CVPR, pp. 5115–5124, 2017.
+
+Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013.
+
+Hoang NT and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. arXiv preprint arXiv:1905.09550, 2019.
+
+Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Dropedge: Towards deep graph convolutional networks on node classification. In International Conference on Learning Representations, 2019.
+
+Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
+
+Neil Shah. Scale-free, attributed and class-assortative graph generation to facilitate introspection of graph neural networks. KDD Mining and Learning with Graphs, 2020.
+
+Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
+
+David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE signal processing magazine, 30(3):83–98, 2013.
+
+Ryan J Tibshirani et al. Adaptive piecewise polynomial estimation via trend filtering. The Annals of Statistics, 42(1):285–323, 2014.
+
+Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
+
+Yu-Xiang Wang, James Sharpnack, Alexander J Smola, and Ryan J Tibshirani. Trend filtering on graphs. The Journal of Machine Learning Research, 17(1):3651–3691, 2016.
+
+Huijun Wu, Chen Wang, Yuriy Tyshetskiy, Andrew Docherty, Kai Lu, and Liming Zhu. Adversarial examples on graph data: Deep insights into attack and defense. arXiv preprint arXiv:1903.01610, 2019.
+
+Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In International conference on machine learning, pp. 40–48. PMLR, 2016.
+
+Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD, pp. 974–983, 2018a.
+
+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, 2018b.
+
+Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. arXiv preprint arXiv:1909.12223, 2019.
+
+Tong Zhao, Yozen Liu, Leonardo Neves, Oliver Woodford, Meng Jiang, and Neil Shah. Data augmentation for graph neural networks. arXiv preprint arXiv:2006.06830, 2020.
+
+Daniel Zugner and Stephan G ¨ unnemann. Adversarial attacks on graph neural networks via meta ¨ learning. arXiv preprint arXiv:1902.08412, 2019.
+
+# A PROOFS
+
+A.1 PROOF OF THEOREM 5
+
+Theorem 5. With adaptive stepsize $b _ { i } = 1 / \left( 2 + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ for each node $v _ { i }$ , the iterative gradient descent steps to solve Problem 2 with the regularization term in Eq. (22) is as follows:
+
+$$
+\mathbf { F } ^ { ( k ) } [ i , : ] \longleftarrow 2 b \mathbf { X } [ i , : ] + b _ { i } \sum _ { v _ { j } \in \tilde { N } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { i } ) \frac { \mathbf { F } ^ { ( k - 1 ) } [ j , : ] } { \sqrt { d _ { i } d _ { j } } } ; \quad k = 1 , \dots
+$$
+
+where ${ \bf F } ^ { ( 0 ) } [ i , : ] = { \bf X } [ i , : ]$ .
+
+Proof. The gradient of the optimization problem 2 with the regularization term in Eq. (22) with respect to $\mathbf { F }$ (focusing on node $i$ ) is as follows:
+
+$$
+\frac { \partial \mathcal { L } } { \partial \mathbf { F } [ i , : ] } = 2 ( \mathbf { F } [ i , : ] - \mathbf { X } [ i , : ] ) + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } \frac { \mathcal { C } _ { i } + \mathcal { C } _ { j } } { \sqrt { d _ { i } } } \left( \frac { \mathbf { F } [ i , : ] } { \sqrt { d _ { i } } } - \frac { \mathbf { F } [ j , : ] } { \sqrt { d _ { j } } } \right) ,
+$$
+
+where $\mathcal { C } _ { j }$ in the second term appears since node $i$ is also in the neighborhood of node $j$ . The iterative gradient descent steps with adaptive stepsize $b _ { i }$ can be formulated as follows:
+
+$$
+\mathbf { F } ^ { ( k ) } [ i , : ] \mathbf { F } ^ { ( k - 1 ) } [ i , : ] - b _ { i } \cdot \frac { \partial \mathcal { L } } { \partial \mathbf { F } [ i , : ] } | _ { \mathbf { F } [ i , : ] = \mathbf { F } ^ { ( k - 1 ) } [ i , : ] } ; \quad k = 1 , \dots .
+$$
+
+With the gradient in Eq. (27), the iterative steps in Eq. (28) can be rewritten as:
+
+$$
+\begin{array} { c } { { { \bf F } ^ { ( k ) } [ i , : ] ( 1 - 2 b _ { i } - b _ { i } \displaystyle \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } \frac { \mathcal { C } _ { i } + \mathcal { C } _ { j } } { d _ { i } } ) { \bf F } ^ { ( k - 1 ) } [ i , : ] + 2 b _ { i } { \bf X } [ i , : ] } } \\ { { + b _ { i } \displaystyle \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) \frac { { \bf F } ^ { ( k ) } [ j , : ] } { \sqrt { d _ { i } d _ { j } } } ; \quad k = 1 , . . . } } \end{array}
+$$
+
+Given $b _ { i } = 1 / \left( 2 + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ , the iterative steps in Eq. (29) can be re-written as follows:
+
+$$
+\mathbf { F } ^ { ( k ) } [ i , : ] 2 b \mathbf { X } [ i , : ] + b _ { i } \sum _ { v _ { j } \in \tilde { \cal N } ( v _ { i } ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) \frac { \mathbf { F } ^ { ( k - 1 ) } [ j , : ] } { \sqrt { d _ { i } d _ { j } } } ; \quad k = 1 , \dots ,
+$$
+
+with ${ \bf F } ^ { ( 0 ) } [ i , : ] = { \bf X } [ i , : ]$ , which completes the proof.
+
+# A.2 PROOF OF THEOREM 6
+
+Theorem 6. The iterative steps in Eq. (23) is guaranteed to converge to the optimal solution of Problem 2 with Eq. (22) as regularization term.
+
+Proof. By taking the second derivative with respect to $\mathbf { F } [ i , : ]$ , we obtain the Hessian matrix as:
+
+$$
+\frac { \partial \mathcal { L } ^ { 2 } } { \partial \mathbf { F } [ i , : ] ^ { 2 } } = 2 \mathbf { I } + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } ( \frac { \mathcal { C } _ { i } + \mathcal { C } _ { j } } { d _ { i } } ) \mathbf { I }
+$$
+
+which implies the Lipschitz constant of the gradient in Eq. (27) is $2 + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( v _ { i } ) } ( \frac { \mathcal { C } _ { i } + \mathcal { C } _ { j } } { d _ { i } } )$ . To guarantee convergence, the stepsize $b _ { i }$ for node $i$ should be smaller than $2 / \left( 2 + \sum _ { v _ { j } \in \tilde { \mathcal { N } } ( i ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ (Nesterov, 2013). The stepsize we adopt in Theorem 5 is $b _ { i } = 1 / \left( 2 + \sum _ { j \in \tilde { \mathcal { N } } ( i ) } ( \mathcal { C } _ { i } + \mathcal { C } _ { j } ) / d _ { i } \right)$ , hence the convergence is guaranteed.
+
+# B CONNECTIONS TO PAIRNORM AND DROPEDGE
+
+PairNorm and DropEdge, which are two recently proposed GNN enhancements for developing deeper GNN models, are corresponding to the following regularization terms:
+
+$$
+\mathrm { P a i r N o r m : } \ : \ : \sum _ { ( i , j ) \in \mathcal { E } } \ : \mathcal { C } _ { p } \cdot \| \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \| _ { 2 } ^ { 2 } - \ : \sum _ { ( i , j ) \notin \mathcal { E } } \ : \mathcal { C } _ { n } \cdot \| \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \| _ { 2 } ^ { 2 } ,
+$$
+
+$$
+\sum _ { ( i , j ) \in \mathcal { E } } \mathcal { C } _ { i j } \cdot \Vert \mathbf { F } [ i , : ] - \mathbf { F } [ j , : ] \Vert _ { 2 } ^ { 2 } , \mathrm { ~ w h e r e ~ } \mathcal { C } _ { i j } \in \{ 0 , 1 \} .
+$$
+
+For PairNorm, $\mathcal { C }$ consists of $\mathcal { C } _ { p } , \mathcal { C } _ { n } > 0$ and the regularization term ensures connected nodes to be similar while disconnected nodes to be dissimilar. For DropEdge, $\mathcal { C }$ is a sparse matrix having the same shape as adjacency matrix. For each edge $( i , j )$ , its corresponding $\mathcal { C } _ { i j }$ is sampled from a Bernoulli distribution with mean $1 - q$ , where $q$ is a pre-defined dropout rate.
+
+# C EXPERIMENTS
+
+# C.1 DATASETS
+
+Table 2: Dataset summary statistics.
+
+
#Nodes
#Edges
#Labels
#Features
CORA
2708
13264
7
1433
CITESEER
3327
12431
6
3703
PUBMED
19717
108365
3
500
BLOGCATALOG
5196
348682
6
8189
AMAZON-COMP
13381
504937
10
767
AMAZON-PHOTO
7487
245573
8
745
COAUTHOR-CS
18333
182121
15
6805
COAUTHOR-PH
34493
530417
5
8415
+
+In this section, we provide information of the datasets we used in the experiments as follows:
+
+• Citation Networks: CORA, CITESEER and PUBMED are widely adopted benchmarks of GNN models. In these graphs, nodes represent documents and edges denote the citation links between them. Each node is associated bag-of-words features of its corresponding document and also a label indicating the research field of the document.
+
+• Blogcatalog: BLOGCATALOG is an online blogging community where bloggers can follow each other. The BLOGCATALOG graph consists of blogger as nodes while their social relations as edges. Each blogger is associated with some features generated from key words of his/her blogs. The bloggers are labeled according to their interests.
+
+• Co-purchase Graph: AMAZON-COMP and AMAZON-PHOTO are co-purchase graphs, where nodes represent items and edges indicate that two items are frequently bought together. Each item is associated with bag-of-words features extract from its corresponding reviews. The labels of items are given by the category of them.
+
+• Co-authorship Graphs: COAUTHOR-CS and COAUTHOR-PH are co-authorship graphs, where nodes are authors and edges indicating the co-authorship between authors. Each author is associated with some features representing the keywords of his/her papers. The label of an author indicates the his/her most active research field.
+
+Some statistics of these graphs are shown in Table 2.
+
+# C.1.1 LOCAL LABEL SMOOTHNESS OF DATASETS
+
+We further present the distribution of local label smoothness in these datasets. For a node $v _ { i }$ we formally define the local label smoothness as follows
+
+$$
+\mathbf { l s } ( i ) = \frac { \displaystyle \sum _ { j \in \mathcal { N } ( i ) } \mathbf { 1 } \{ l ( i ) = l ( j ) \} } { | \mathcal { N } ( i ) | }
+$$
+
+
+Figure 3: Distribution of local label smoothness (homophily) on different graph datasets: note the non-homogeneity of smoothness values.
+
+
+Figure 4: Accuracy with low label smoothness and high label smoothness nodes. Note the consistent improvement in low smoothness cases, enabled by adaptive local smoothing.
+
+where $l ( v _ { i } )$ denotes the label of node $v _ { i }$ and ${ \bf 1 } \{ a \}$ is an indicator function, which takes 1 as output only when $a$ is true, otherwise 0. The distributions of local label smoothness for all 8 datasets are presented in Figure 3.
+
+C.2 NODE CLASSIFICATION ACCURACY FOR NODES WITH LOW-LEVEL AND HIGH-LEVEL LOCAL LABEL SMOOTHNESS
+
+The performance of nodes with low local label smoothness and high local label smoothness in CITESEER, PUBMED, AMAZON-PHOTO and COAUTHOR-PH are presented in Figure 4.
+
+# C.3 LOCAL SMOOTHNESS DISTRIBUTION OF ATTACKED GRAPH
+
+Graph adversarial attacks tend to connect nodes from different classes while disconnect nodes from the same class, which typically leads to more diverse distributions of local smoothness level. We present the distributions of the graphs generated by Mettack (Zugner & G ¨ unnemann ¨ , 2019) with different perturbation rate for CORA, CITESEER and PUBMED in Figure 5, Figure 6 and Figure 7, respectively.
+
+# C.4 BASELINES FOR ADVERSARIAL DEFENSE
+
+In this section, we list the descriptions of the defense algorithms we adopt in Section 6.2 as follows:
+
+• GCN-Jaccard (Wu et al., 2019): GCN-Jaccard aims to pre-process a given attacked graph by removing those edges added by the attackers. Specifically, Jaccard smilarlity is utilized to measure the feature similarity between connected pairs of nodes. The edges between node pairs with low-similarity are removed by the algorithm. This pre-processed graph is then utilized for the node classification task.
+
+
+Figure 5: Distribution of local label smoothness on CORA with various attack perturbation rates.
+
+
+Figure 6: Distribution of local label smoothness on CITESEER with various attack perturbation rates.
+
+
+Figure 7: Distribution of local label smoothness on PUBMED with various attack perturbation rates.
+
+• GCN-SVD (Entezari et al., 2020): GCN-SVD is also a pre-process method. It use SVD to decompose the adjacency matrix of a given perturbed graph and then obtain its low-rank approximation. The low-rank approximation is believed to be cleaner as graph adversarial attacks are observed to be high-rank in (Entezari et al., 2020).
+
+• Pro-GNN (Jin et al., 2020): Pro-GNN tries to learn a cleaner graph while training the node classification model at the same time. Specifically, it treats the adjacency as parameters, which is optimized during the training stage. Several different constraints are enforced to this learnable adjacency matrix, including: 1) the learned adjacency matrix should be close to the original adjacency matrix; 2) the learned adjacency matrix should be low-rank; and 3) the learned adjacency matrix should ensure feature smoothness. Pro-GNN-fs is a variant of Pro-GNN where the third constraint, i.e. feature smoothness, is not enforced.
+
+# C.5 INVESTIGATION ON NUMBER OF GRADIENT DESCENT STEPS IN ADA-UGNN
+
+In this section, we conducted experiments to check how the performance of ADA-UGNN is affected by $K$ . For each $K$ , we run the experiments on standard splits of CORA, CITESEER and PUBMED with 30 random seeds (i.e., the same setting as in Section 6.) The average performance is reported. As shown in Figure 8, the performance increases quickly as $K$ gets larger when $K$ is relatively small. After $K$ becomes large, the performance either slowly grows or slightly fluctuates as $K$ further increases.
+
+
+Figure 8: ADA-UGNN performance (test accuracy) under different numbers of gradient steps $( K )$ .
\ No newline at end of file
diff --git a/md/train/MjNFN44NbZm/MjNFN44NbZm.md b/md/train/MjNFN44NbZm/MjNFN44NbZm.md
new file mode 100644
index 0000000000000000000000000000000000000000..8b565363f8a9da46ef52866f5211f860b49374e8
--- /dev/null
+++ b/md/train/MjNFN44NbZm/MjNFN44NbZm.md
@@ -0,0 +1,334 @@
+# Policy Finetuning: Bridging Sample-Efficient Offline and Online Reinforcement Learning
+
+Tengyang Xie UIUC tx10@illinois.edu
+
+Nan Jiang UIUC nanjiang@illinois.edu
+
+Huan Wang Salesforce Research huan.wang@salesforce.com
+
+Caiming Xiong Salesforce Research cxiong@salesforce.com
+
+Yu Bai Salesforce Research yu.bai@salesforce.com
+
+# Abstract
+
+Recent theoretical work studies sample-efficient reinforcement learning (RL) extensively in two settings: learning interactively in the environment (online RL), or learning from an offline dataset (offline RL). However, existing algorithms and theories for learning near-optimal policies in these two settings are rather different and disconnected. Towards bridging this gap, this paper initiates the theoretical study of policy finetuning, that is, online RL where the learner has additional access to a “reference policy” $\mu$ close to the optimal policy $\pi _ { \star }$ in a certain sense. We consider the policy finetuning problem in episodic Markov Decision Processes (MDPs) with $S$ states, $A$ actions, and horizon length $H$ . We first design a sharp offline reduction algorithm—which simply executes $\mu$ and runs offline policy optimization on the collected dataset—that finds an $\varepsilon$ near-optimal policy within $\bar { \tilde { O } } ( \bar { H ^ { 3 } } S C ^ { \star } / \varepsilon ^ { 2 } )$ episodes, where $C ^ { \star }$ is the single-policy concentrability coefficient between $\mu$ and $\pi _ { \star }$ . This offline result is the first that matches the sample complexity lower bound in this setting, and resolves a recent open question in offline RL. We then establish an $\Omega ( H ^ { 3 } S \bar { \operatorname* { m i n } } \{ C ^ { \star } , A \} / \varepsilon ^ { 2 } )$ sample complexity lower bound for any policy finetuning algorithm, including those that can adaptively explore the environment. This implies that—perhaps surprisingly—the optimal policy finetuning algorithm is either offline reduction or a purely online RL algorithm that does not use $\mu$ . Finally, we design a new hybrid offline/online algorithm for policy finetuning that achieves better sample complexity than both vanilla offline reduction and purely online RL algorithms, in a relaxed setting where $\mu$ only satisfies concentrability partially up to a certain time step. Overall, our results offer a quantitative understanding on the benefit of a good reference policy, and make a step towards bridging offline and online RL.
+
+# 1 Introduction
+
+Reinforcement learning (RL)—where agents learn to play sequentially in an environment to maximize a cumulative reward function—has achieved great recent success in many artificial intelligence challenges such as video games playing [38, 52], large-scale strategy games (e.g. GO) [44, 45], robotic manipulation [3, 32], behavior learning in social scenarios [8], and more. In many such challenging domains, achieving human-like or superhuman performance requires training the RL agent with millions of samples (steps of acting or game playing) or more. Understanding and improving the sample efficiency of RL algorithms has been a central topic of research.
+
+Sample-efficient RL has been studied in a rich body of theoretical work in two main settings: online $R L$ , in which the learner has interactive access to the environment and can execute any policy; and offline $R L$ , in which the learner only has access to an “offline” dataset collected by executing some (one or many) policies within the environment, and is not allowed to further access the environment. These two settings share some common learning goals such as the sample complexity (number of episodes of playing) for finding the optimal policy. However, existing algorithms and theories in the online and offline setting seem rather different and disconnected—In online RL, state-of-the-art sample-efficient algorithms typically explore the entire environment, e.g. by using optimism to encourage visitation to unseen states and actions [9, 27, 19, 41, 21, 5, 22, 12, 23, 53]. In contrast, offline RL does not allow interactive exploration, and sample-efficient policy optimization algorithms typically focus on optimizing an unbiased (or downward biased) estimator of the value function [39, 48, 4, 40, 10, 56, 35, 58, 25, 42]. It is therefore of interest to ask whether these two types of algorithms and theories can be connected in any way.
+
+Further, on the empirical end, insights and patterns from offline RL often help as well in designing online RL algorithms and improving the sample efficiency in the real world. For example, there are online RL algorithms that alternate between data collection steps using a fixed policy, and policy improvement steps by learning on the collected dataset [20]. The replay buffer in value-based algorithms can also be seen as a local form of offline (off-policy) policy optimization and are often be used in conjunction with optimistic exploration techniques [38, 18, 49]. The prevalence of these algorithms also offers practical motivations for us to look for a more unified understanding of online and offline RL in theory. These reasonings motivate us to ask the following question:
+
+# Can we bridge sample-efficient offline and online RL from a theoretical perspective?
+
+This paper proposes policy finetuning, a new RL setting that investigates the benefit of a good initial policy in reinforcement learning, and encapsulates challenges of both online and offline RL. In the policy finetuning problem, the learner is given interactive access to the environment and asked to learn a near-optimal policy, but in addition has access to a reference policy $\mu$ that is good in certain aspects. This setting offers great flexibility for the algorithm design: For example, the algorithm is allowed to either simply collect data from $\mu$ and run any offline policy optimization algorithm on the collected dataset. It is also allowed to play any other policy interactively, including those that adaptively explores the environment. The policy finetuning problem offers a common playground for both offline and online types of algorithms, and has a unified performance metric (sample complexity for finding the near-optimal policy) for comparing their performance.
+
+We study the policy finetuning problem theoretically in finite-horizon Markov Decision Processes (MDPs) with $H$ time steps, $S$ states, and $A$ actions. We summarize our contributions as follows.
+
+• We begin by considering offline reduction algorithms which simply collect data using the reference policy $\mu$ and run an offline policy optimization algorithm on the collected dataset. This setting equivalent to offline RL with behavior policy $\mu$ , and thus our result translates to a same result for offline RL as well. We design an algorithm PEVI-ADV that is able to find an $\varepsilon$ -optimal policy (for small $\varepsilon$ ) within $\tilde { O } ( H ^ { 3 } S \bar { C } ^ { \star } / \varepsilon ^ { 2 } )$ episodes of play, where $C ^ { \star }$ is the single-policy concentrability coefficient between $\mu$ and some optimal policy $\pi _ { \star }$ (Section 3). This improves over the best existing offline result by an $H ^ { 2 }$ factor in the same setting and matches the lower bound (up to log factors), thereby resolving the recent open question of [42] on tight offline RL under single-policy concentrability.
+• Under the same assumption on $\mu$ , we establish an $\Omega ( H ^ { 3 } S \operatorname* { m i n } { \{ C ^ { \star } , A \} } / \varepsilon ^ { 2 } )$ sample complexity lower bound for any policy finetuning algorithm, including those that adaptively explores the environment (Section 4). This implies that the optimal policy finetuning algorithm is either offline reduction via PEVI-ADV, or a “purely” online RL algorithm from scratch (such as UCBVI), depending on whether $C ^ { \star } \leq A$ . This comes rather surprising, as it rules out possibilities of combining online exploration and knowledge of $\mu$ to further improve the sample complexity over the aforementioned two baselines.
+• Finally, we consider policy finetuning in a more challenging setting where $\mu$ only satisfies concentrability up to a certain time step. We design a “hybrid offline/online” algorithm HOOVI that combines online exploration and offline data collection, and show that it achieves better sample complexity than both vanilla offline reduction and purely online algorithms in certain cases (Section 5). This gives a positive example on when such hybrid algorithm designs are beneficial.
+
+# 1.1 Related work
+
+Sample-efficient online RL There is a long line of work on establishing provably sample-efficient online RL algorithms. A major portion of these works is concerned with the tabular setting with finitely many states and actions [9, 27, 19, 5, 11, 2, 22, 63]. For episodic MDPs with inhomogeneous transition functions with $S$ states, and $A$ actions, and horizon length $H$ , the optimal sample complexity for finding the $\varepsilon$ near-optimal policy is $\widetilde { \cal O } ( H ^ { 3 } S A / \varepsilon ^ { 2 } )$ , achieved by various algorithms such as UCBVI of Azar et al. [5] and UCB-Advantage of Zhang et al. [63]. Our paper adapts the reference-advantage decomposition technique of Zhang et al. [63] to designing sharp offline algorithms. Online RL with with large state/action spaces are also studied by using function approximation in conjunction with structural assumptions on the MDP [23, 61, 62, 1, 41, 21, 47, 53, 57, 14, 24].
+
+Offline RL Offline/batch RL studies the case where the agent only has access to an offline dataset obtained by executing a behavior policy in the environment. Sample-efficient learning results in offline RL typically work by assuming either sup-concentrability assumptions [39, 48, 4, 40, 15, 51, 10, 56]) or lower bounded exploration constants [58, 59] to ensure the sufficient coverage of offline data over all (relevant) states and actions. However, such strong coverage assumptions can often fail to hold in practice [16]. More recent works address this by using either policy constraint/regularization [16, 35, 29, 55], or the pessimism principle to optimize conservatively on the offline data [30, 60, 28, 25, 59, 42]. The policy-constraint/regularization-based approaches prevent the policy to visit states and actions that has no or low coverage from the offline data. Our proposed offline RL algorithm PEVI-ADV (Algorithm 1) is inspired by the pessimistic value iteration algorithms of [25, 42] and achieves an improved sample complexity over these work under the same single-policy concentrability assumption on the behavior policy.
+
+Bridging online and offline RL Kalashnikov et al. [26] observed empirically that the performance of policies trained purely from offline data can be improved considerably by a small amount of additional online fine-tuning. A recent line of work studied low switching cost RL [6, 63, 17, 54]— which forbits online RL algorithms from switching its policy too often—as an interpolation between the online and offline settings. The same problem is also studied empirically as deployment-efficient RL [36, 46]. While we also attempt to bridge online and offline RL, our work differs from this line in that our policy finetuning setting allows a direct comparison between “fully offline” and “fully online” algorithms, whereas the low switching cost setting prohibits fully online algorithms.
+
+# 2 Preliminaries
+
+Markov Decision Processes In this paper, we consider episodic Markov decision processes (MDPs) with time-inhomogeneous transitions, specified by $M = ( \mathcal { S } , \mathcal { A } , H , \mathbb { P } , r )$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $H$ is the horizon length, $\mathbb { P } = \{ \mathbb { P } _ { h } \} _ { h = 1 } ^ { H }$ where $\mathbb { P } _ { h } ( \cdot | s , a ) \in \Delta _ { S }$ is the transition probabilities at step $h$ , and $r = \{ r _ { h } : \mathcal { S } \times \mathcal { A } \to [ 0 , 1 ] \} _ { h = 1 } ^ { H }$ =1 are the deterministic1 reward functions at time step $h \in [ H ]$ . Without loss of generality, we assume that the initial state $s _ { 1 }$ is deterministic2.
+
+Policies, value functions, visitation distributions A policy $\pi = \{ \pi _ { h } ( \cdot | s ) \} _ { h \in [ H ] , s \in { \mathcal S } }$ consists of distributions $\pi _ { h } ( \cdot | s ) \in \Delta _ { { \cal A } }$ . We use $\mathbb { E } _ { \pi } [ \cdot ]$ to denote the expectation with respect to the random trajectory induced by $\pi$ in the MDP $M$ , that is, $\left( s _ { 1 } , a _ { 1 } , r _ { 1 } , s _ { 2 } , a _ { 2 } , r _ { 2 } , \ldots , s _ { H } , a _ { H } , r _ { H } \right)$ , where $a _ { h } =$ $\pi _ { h } ( s _ { h } )$ , $r _ { h } = r _ { h } ( s _ { h } , a _ { h } )$ , $s _ { h + 1 } \sim \mathbb { P } _ { h } ( \cdot | s _ { h } , a _ { h } )$ . For each policy $\pi$ , let $V _ { h } ^ { \pi } : { \cal S } \mathbb { R }$ and $Q _ { h } ^ { \pi }$ : $S \times \mathcal { A } \mathbb { R }$ denote its value functions and Q functions at each time step $h \in [ H ]$ , that is,
+
+$$
+V _ { h } ^ { \pi } ( s ) : = \mathbb { E } _ { \pi } \bigg [ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } ( s _ { h ^ { \prime } } , a _ { h ^ { \prime } } ) \bigg | s _ { h } = s \bigg ] , Q _ { h } ^ { \pi } ( s , a ) : = \mathbb { E } _ { \pi } \bigg [ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } ( s _ { h ^ { \prime } } , a _ { h ^ { \prime } } ) \bigg | s _ { h } = s , a _ { h } = a \bigg ] .
+$$
+
+The operators $\mathbb { P } _ { h }$ and $\mathbb { V } _ { h }$ are defined as $[ \mathbb { P } _ { h } V _ { h + 1 } ] ( s , a ) : = \mathbb { E } [ V _ { h + 1 } ( s ^ { \prime } ) | s _ { h } = s , a _ { h } = a ]$ and $[ \mathbb { V } _ { h } V _ { h + 1 } ] ( s , a ) : = \mathrm { V a r } [ V _ { h + 1 } ( s ^ { \prime } ) | s _ { h } = s , a _ { h } = a ]$ for any value function $V _ { h + 1 }$ at time step $h + 1$
+
+We also use $\widehat { \mathbb { P } } _ { h }$ and $\widehat { V } _ { h }$ to denote empirical versions of these operators building on estimated models (which will be clear in the context).
+
+We use $\pi _ { \star } : = \arg \operatorname* { m a x } _ { \pi } V _ { 1 } ^ { \pi } ( s _ { 1 } )$ to denote any optimal policy, and $V _ { h } ^ { \star } : = V _ { h } ^ { \pi _ { \star } }$ and $Q _ { h } ^ { \star } : = Q _ { h } ^ { \pi _ { \star } }$ to denote the value function and $\mathrm { Q }$ function of $\pi ^ { \star }$ at all $h \in [ H ]$ . Throughout this paper, our learning goal is to find an near-optimal policy $\widehat { \pi }$ such that ${ \cal V } _ { 1 } ^ { \star } ( s _ { 1 } ) \dot { - } \dot { \cal V } _ { 1 } ^ { \widehat \pi } ( s _ { 1 } ) \le \varepsilon$ .
+
+Finally, we let $d _ { h } ^ { \pi }$ denote the state(-action) visitation distributions of $\pi$ at time step $h \in [ H ]$ :
+
+$$
+\begin{array} { r } { d _ { h } ^ { \pi } ( s ) : = \mathbb { P } ( s _ { h } = s | \pi ) , \mathrm { ~ a n d ~ } d _ { h } ^ { \pi } ( s , a ) : = \mathbb { P } ( s _ { h } = s , a _ { h } = a | \pi ) . } \end{array}
+$$
+
+Miscellaneous We use standard $O ( \cdot )$ and $\Omega ( \cdot )$ notation: $A = O ( B )$ is defined as $A \leq C B$ for some absolute constant $C > 0$ (and similarly for $\Omega$ ). The tilded notation $A = { \widetilde { O } } ( B )$ denotes $A \leq C L \cdot B$ where $L$ is a poly-logarithmic factor of problem parameters.
+
+# 2.1 Policy Finetuning
+
+We now introduce the setting of policy finetuning. A policy finetuning problem consists of an MDP $M$ and a reference policy $\mu$ . During the learning stage, the learner can perform the following two types of moves:
+
+(a) Play an episode in the MDP $M$ using any policy (i.e. learner has online interactive access to $M$ ). (b) Access the values of the reference policy $\mu _ { h } ( a | s )$ for all $( h , s , a )$ . For example, the learner can use it to sample actions $a \sim \mu _ { h } ( \cdot | s )$ for any $h , s$ for arbitrarily many times during learning.
+
+The goal of the learner is to output $\varepsilon$ near-optimal policy $\widehat { \pi }$ within as few episodes of play (within the MDP) as possible.
+
+A unique feature about the policy finetuning setting is that it allows both online interactive plays via any online RL algorithm (not necessarily using $\mu$ ), as well as offline reduction which simply collects data by executing the reference policy $\mu$ and do anything with the collected dataset. In particular, this means that any algorithm for offline policy optimization (based on offline datasets) also gives an algorithm for policy finetuning via this offline reduction. Therefore, policy finetuning offers a common playground for both online and offline type algorithms with a unified learning goal.
+
+Assumption on reference policy Throughout most of this paper (except for Section 5), we consider the following assumption on the reference policy $\mu$ .
+
+Assumption A (Single-policy concentrability). The reference policy $\mu$ satisfies that
+
+$$
+\operatorname* { m a x } _ { h \in [ H ] , ( s , a ) \in S \times A } \frac { d _ { h } ^ { \pi _ { \star } } ( s , a ) } { d _ { h } ^ { \mu } ( s , a ) } \leq C ^ { \star }
+$$
+
+(with the convention $0 / 0 = 0 ,$ ) for some deterministic optimal policy $\pi _ { \star }$ and constant $C ^ { \star } \geq 1$
+
+The single-policy concentrability characterizes the distance between the visitation distributions of the reference policy $\mu$ and some optimal policy $\pi ^ { \star }$ . This assumption is considered in the recent work of Rashidinejad et al. [42] on offline RL and is more relaxed than previously assumed concentrability assumptions which typically requires the supremum concentrability against all possible $\pi$ ’s to be bounded [10]. We consider this assumption as it both allows efficient offline RL algorithms [42], and is perhaps also a sensible measure of quality for the reference policy in policy finetuning.
+
+# 3 Sharp offline learning via reference-advantage decomposition
+
+We begin by investigating the sharpest sample complexity for policy finetuning via the offline reduction approach. This requires us to design sharp offline RL algorithms that run on the dataset $\mathcal { D }$ collected by executing $\mu$ . We emphasize that this is both an interesting offline RL question on its own right, and also important for our later discussions on lower bounds and other algorithms for policy finetuning, as the sharpest sample complexity via offline reduction provides a solid baseline.
+
+Warm-up: VI-LCB As a warm-up, we first show that a finite-horizon variant of the VILCB (Value Iteration with Lower Confidence Bounds) algorithm of Rashidinejad et al. [42] achieves sample complexity $\widetilde { O } ( H ^ { 5 } S C ^ { \star } / \varepsilon ^ { 2 } )$ for finding an $\varepsilon$ near-optimal policy. This result is similar to the $\widetilde { O } ( S C ^ { \star } / ( 1 - \gamma ) ^ { 5 } \varepsilon ^ { 2 } )$ guarantee3 for the original VI-LCB in infinite-horizon discounted MDPs [42, Theorem 6]. The main ingredients of our VI-LCB algorithm is a pessimistic value iteration procedure in which we perform value iteration on the empirical model estimated from the dataset $\mathcal { D }$ , along with a negative Hoeffding bonus term to impose pessimism. Due to space constraints, the algorithm description (Algorithm 3) and the proof of Theorem 1 are deferred to Appendix B.
+
+Theorem 1 (VI-LCB for finite-horizon MDPs). Suppose the reference policy $\mu$ satisfies the singlepolicy concentrability (Assumption $A$ ). Then with probability at least $1 - \delta$ , VI-LCB (Algorithm 3) outputs a policy $\widehat { \pi }$ and value estimate $\widehat { V }$ such that
+
+$$
+\begin{array} { r l } & { ) \operatorname* { m a x } _ { h \in [ H ] } \sum _ { s \in { \mathcal { S } } } d _ { h } ^ { \pi _ { \star } } ( s ) ( V _ { h } ^ { \star } ( s ) - \widehat { V } _ { h } ( s ) ) \leq \varepsilon , } \\ & { } \\ & { V _ { 1 } ^ { \star } ( s _ { 1 } ) - V _ { 1 } ^ { \widehat { \pi } } ( s _ { 1 } ) \leq \varepsilon , } \end{array}
+$$
+
+within $n = \widetilde O \bigl ( H ^ { 5 } S C ^ { \star } / \varepsilon ^ { 2 } \bigr )$ episodes.
+
+Theorem 1 serves two main purposes. First, the $\widetilde { O } ( H ^ { 5 } S C ^ { \star } / \varepsilon ^ { 2 } )$ sample complexity asserted in Theorem 1(b) provides a first result for offline RL (and offline reduction for policy finetuning) under single-policy concentrability in finite-horizon MDPs. Second, the value estimation bound in Theorem 1(a) shows that the estimated value function $\widehat { V } _ { h } ( s )$ provided by VI-LCB is close to the optimal value ${ V } _ { h } ^ { \star } ( s )$ at every step $h \in [ H ]$ , in terms of the weighted average with $d _ { h } ^ { \pi _ { \star } } ( s )$ . Our next algorithm PEVI-ADV builds on this property so that VI-LCB can be used as a “warm-up” learning procedure that provides a high-quality value estimate.
+
+Sharp offline learning via reference-advantage decomposition We now design a new sharp algorithm PEVI-ADV which achieves an improved $\widetilde { O } ( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } )$ sample complexity (for small enough $\varepsilon$ ). This improves over VI-LCB by $\widetilde O ( H ^ { 2 } )$ and is the first algorithm that matches the sample complexity lower bound. PEVI-ADV adds two new ingredients over VI-LCB in order to achieve the $\tilde { O } ( \bar { H } ^ { 2 } )$ improvement:
+
+1. We replace the Hoeffding-style bonus in VI-LCB with a Bernstein-style bonus. This shaves off one $H$ factor in the sample complexity via the total variance property (Lemma C.4).
+2. Both VI-LCB and our PEVI-ADV use data splitting to make sure that the estimated value $\widehat { V } _ { h + 1 }$ and empirical transitions $\widehat { \mathbb { P } } _ { h }$ are estimated using different subsets of $\mathcal { D }$ , this yields conditional independence that is required in bounding concentration terms of the form $( \widehat { \mathbb { P } } _ { h } - \mathbb { P } _ { h } ) \widehat { V } _ { h + 1 }$ . However, applied naively, this data splitting induces one undesired $H$ factor in the sample complexity as we need to split $\mathcal { D }$ into $H$ folds and thus each $\mathbb { P } _ { h }$ is estimated using only $n / H$ episodes of data. As a technical crux of this algorithm, we overcome this issue by adapting the reference-advantage decomposition technique of Zhang et al. [63]. This technique proposes to learn an initial reference value function $\widehat { V } ^ { \mathrm { r e f } }$ of good quality in a certain sense, and then performing the following type of approximate value iteration (using the right-hand side as the algorithm update):
+
+$$
+\mathbb { P } _ { h } \widehat { V } _ { h + 1 } \approx \widehat { \mathbb { P } } _ { h , 0 } \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } + \widehat { \mathbb { P } } _ { h , 1 } \Big ( \widehat { V } _ { h + 1 } - \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } \Big ) .
+$$
+
+Above, $\widehat { V } _ { h + 1 } , \widehat { \mathbb { P } } _ { h , 0 }$ , and $\widehat { \mathbb { P } } _ { h , 1 }$ are estimated on three disjoint subsets of the data. The advantage of this approach is that, due to this new independence structure, $\widehat { \mathbb { P } } _ { h , 0 }$ for different $h \in [ H ]$ can be estimated on the same set of trajectories without $H$ -fold splitting, which shaves off the $H$ factor within this part. On the other hand, estimating $\widehat { \mathbb { P } } _ { h , 1 }$ still requires $H$ -fold splitting, yet this would not hurt the sample complexity if the magnitude of $( \widehat { V } _ { h + 1 } - \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } )$ is much smaller than its naive upper bound $O ( H )$ —we show this can be achieved by using VI-LCB to learn $\widehat { V } ^ { \mathrm { r e f } }$ .
+
+Require: Dataset $\mathcal { D } = \left\{ ( s _ { 1 } ^ { ( i ) } , a _ { 1 } ^ { ( i ) } , r _ { 1 } ^ { ( i ) } , \dotsc , s _ { H } ^ { ( i ) } , a _ { H } ^ { ( i ) } , r _ { H } ^ { ( i ) } ) \right\} _ { i = 1 } ^ { n }$ collected by executing $\mu$ in $M$ .
+
+1: Split the dataset $\mathcal { D }$ into ${ \mathcal { D } } _ { \mathrm { r e f } }$ , $\mathcal { D } _ { 0 }$ and $\left\{ \mathcal { D } _ { h , 1 } \right\} _ { h = 1 } ^ { H }$ uniformly at random:
+
+$$
+n _ { \mathrm { r e f } } : = \left| \mathcal { D } _ { \mathrm { r e f } } \right| = n / 3 , n _ { 0 } : = \left| \mathcal { D } _ { 0 } \right| = n / 3 , n _ { 1 , h } : = \left| \mathcal { D } _ { h , 1 } \right| : = n / ( 3 H ) ( n _ { 1 } : = n / 3 ) .
+$$
+
+2: Learn a reference value function $\widehat { V } ^ { \mathrm { r e f } } \gets \mathrm { V I - L C B } ( \mathcal { D } _ { \mathrm { r e f } } )$ via VI-LCB (Algorithm 3).
+
+3: Let $N _ { h , 0 } ( s , a )$ and $N _ { h , 0 } ( s , a , s ^ { \prime } )$ denote the visitation count of $( s , a )$ and $( s , a , s ^ { \prime } )$ at step $h$ within dataset $\mathcal { D } _ { 0 }$ . Construct empirical model estimates:
+
+$$
+\widehat { \mathbb { P } } _ { h , 0 } ( s ^ { \prime } | s , a ) \gets \frac { N _ { h , 0 } ( s , a , s ^ { \prime } ) } { N _ { h , 0 } ( s , a ) \vee 1 } , \quad \mathrm { a n d } \quad \widehat { r } _ { h , 0 } ( s , a ) \gets r _ { h } ( s , a ) \mathbb { 1 } \left\{ N _ { h , 0 } ( s , a ) \geq 1 \right\} .
+$$
+
+Similarly define $N _ { h , 1 } ( s , a ) , N _ { h , 1 } ( s , a , s ^ { \prime } ) ,$ $( \widehat { r } _ { h , 1 } , \widehat { \mathbb { P } } _ { h , 1 } )$ for all $h \in [ H ]$ based on dataset $\mathcal { D } _ { h , 1 }$
+
+4: Set $\begin{array} { r } { b _ { h , 0 } ( s , a ) \gets c \cdot \left( \sqrt { \frac { [ \widehat { \Psi } _ { h , 0 } \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } ] ( s , a ) \iota } { N _ { h , 0 } ( s , a ) \vee 1 } } + \frac { H \iota } { N _ { h , 0 } ( s , a ) \vee 1 } \right) } \end{array}$ for all $( h , s , a )$ , where $\iota : = \log ( H S A / \delta )$
+
+5: Set $\widehat { V } _ { H + 1 } ( s ) \gets 0$ for all $s \in S$ .
+
+6: for $h = H , \ldots , 1$ do
+
+8: Perform pessimistic value update for all $( s , a )$
+
+$$
+\begin{array} { r l } & { \widehat { Q } _ { h } ( s , a ) \gets \widehat { r } _ { h , 0 } ( s , a ) + \left[ \widehat { \mathbb { P } } _ { h , 0 } \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } \right] ( s , a ) - b _ { h , 0 } ( s , a ) + \left[ \widehat { \mathbb { P } } _ { h , 1 } ( \widehat { V } _ { h + 1 } - \widehat { V } _ { h + 1 } ^ { \mathrm { r e f } } ) \right] ( s , a ) - b _ { h , 1 } ( s , a ) } \\ & { \widehat { V } _ { h } ( s ) \gets \left[ \operatorname* { m a x } _ { a } \widehat { Q } _ { h } ( s , a ) \right] \vee 0 . } \\ & { \mathrm { S e t } \widehat { \pi } _ { h } ( s ) \gets \arg \operatorname* { m a x } _ { a } \widehat { Q } _ { h } ( s , a ) \mathrm { f o r } \mathrm { a l l } s \in S . } \end{array}
+$$
+
+b10: end for
+
+11: return Policy $\widehat { \pi } = \{ \widehat { \pi } _ { h } \} _ { h \in [ H ] }$
+
+We instantiate this plan by carefully using VI-LCB to learn the reference value function $\widehat { V } ^ { \mathrm { r e f } }$ , combined with tight Bernstein bonuses, to shave off another $H$ factor in the sample complexity. The full PEVI-ADV algorithm is provided in Algorithm 1. We now present its guarantee in the following theorem. The proof can be found in Appendix C.
+
+Theorem 2 (Sharp offline learning via PEVI-ADV). Suppose the reference policy $\mu$ satisfies the single-policy concentrability (Assumption $A$ ). Then with probability at least $1 - \delta$ , PEVI-ADV (Algorithm 1) outputs a policy $\widehat { \pi }$ and value estimate $\widehat { V }$ such that
+
+$$
+\begin{array} { r l } & { \operatorname* { m a x } _ { h \in [ H ] } \sum _ { s \in { { \mathcal { S } } } } d _ { h } ^ { \pi _ { \star } } ( s ) ( V _ { h } ^ { \star } ( s ) - \widehat { V } _ { h } ( s ) ) \leq \varepsilon , } \\ & { } \\ & { V _ { 1 } ^ { \star } ( s _ { 1 } ) - V _ { 1 } ^ { \widehat { \pi } } ( s _ { 1 } ) \leq \varepsilon , } \end{array}
+$$
+
+within $n = \widetilde O \left( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } + H ^ { 5 . 5 } S C ^ { \star } / \varepsilon \right)$ episodes.
+
+Near-optimal offline RL under single-policy concentrability For small enough $\varepsilon \le H ^ { - 2 . 5 }$ , Theorem 2 achieves $\widetilde { O } ( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } )$ sample complexity for finding the $\varepsilon$ near-optimal policy from the offlien dataset $\mathcal { D }$ . This is the first cubic horizon dependence for offline RL under single-policy concentrability, which improves over recent works [25, 42] in this setting and resolves the open question of [42]. For $C ^ { \star } \geq 2$ , our sample complexity further matches the information-theoretical lower bound $\Omega ( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } )$ up to log factors4. We remark that tight hoziron dependence has also been achieved in several recent works offline RL [58, 59, 43] which are however quite different from (and do not imply) ours in both the assumptions (on the behavior policy) and the analyses.
+
+# 4 Lower bound for policy finetuning
+
+We now switch gears to considering the policy finetuning problem with any algorithm, not necessarily restricted to the offline reduction approach.
+
+Two baselines: offline reduction $\pmb { \& }$ purely online RL A first observation is that naive offline reduction is already a strong baseline for policy finetuning, by our Theorem 2: Our PEVI-ADV algorithm only collects data with $\mu$ and does not do any online exploration, yet achieves a sharp $\bar { \tilde { O } } ( H ^ { 3 } S C ^ { \star } / \bar { \varepsilon } ^ { 2 } )$ sample complexity for finding a near-optimal policy.
+
+On the other hand, as the policy finetuning setting allows online interaction, purely online $R L$ is another baseline algorithm: Simply run any sample-efficient online RL algorithm (which typically uses optimism to encourage exploration) from scratch, and disregard the reference policy $\mu$ . Using any sharp online RL algorithm such as UCBVI [5], this approach can find an $\varepsilon$ near-optimal policy within $\widetilde { \cal O } ( H ^ { 3 } S A / \varepsilon ^ { 2 } )$ episodes of play. Note that whether this is advantageous over the offline reduction boils down to the comparison between $C ^ { \star }$ and $A$ , which makes sense intuitively. For example, $C ^ { \star } \leq o ( A )$ means that $\mu$ is perhaps close enough to $\pi _ { \star }$ so that collecting data from $\mu$ and run offline policy optimization is a stronger algorithm than exploring from scratch.
+
+Given these two baselines, it is natural to ask whether there exists an algorithm that improves over both — Can we design an algorithm that performs some amount of optimistic exploration, yet also utilizes the knowledge of $\mu$ , so as to achieve a better rate than both offline reduction and purely online RL? In this section, we provide an information-theoretic lower bound showing that, perhaps surprisingly, the answer is negative: there is an $\Omega ( H ^ { 3 } S \operatorname* { m i n } { \{ C ^ { \star } , A \} } / \varepsilon ^ { 2 } )$ sample complexity lower bound for any policy finetuning algorithm, if we still assume that $\mu$ satisfies $C ^ { \star }$ single-policy concentrability.
+
+Lower bound To formally state our lower bound, we define the class of problems
+
+$$
+\mathcal { M } _ { C ^ { \star } } : = \Bigg \{ ( M , \mu ) : ~ \mathrm { E x i s t s ~ d e t e r m i n i s t i c } ~ \pi _ { \star } ~ \mathrm { o f } ~ M \mathrm { ~ s u c h ~ t h a t ~ } \operatorname* { s u p } _ { h , s , a } \frac { d _ { h } ^ { \pi _ { \star } } ( s , a ) } { d _ { h } ^ { \mu } ( s , a ) } \leq C ^ { \star } \Bigg \} .
+$$
+
+We recall that a policy finetuning algorithm for problem $( M , \mu )$ is defined as any algorithm that can play in the MDP $M$ for $n$ episodes, has full knowledge of the reference policy $\mu$ , and outputs a policy $\widehat { \pi }$ after playing in the MDP.
+
+With these definitions ready, we now state our lower bound for policy finetuning. The proof of Theorem 3 can be found in Appendix D.
+
+Theorem 3 (Lower bound for policy finetuning). Suppose $S , H \geq 3 , A \geq 2 , C ^ { \star } \geq 2 .$ . Then, there exists an absolute constant $c _ { 0 } > 0$ such that for any $\varepsilon \le 1 / 1 2$ and any online finetuning algorithm that outputs a policy $\widehat { \pi }$ , if the number of episodes
+
+$$
+n \leq c _ { 0 } \cdot H ^ { 3 } S \operatorname* { m i n } { \{ C ^ { \star } , A \} } / \varepsilon ^ { 2 } ,
+$$
+
+then there exists a problem instance $( M , \mu ) \ \in \ { \mathcal { M } } _ { C ^ { \star } }$ on which the algorithm suffers from $\varepsilon$ - suboptimality:
+
+$$
+\mathbb { E } _ { M } \left[ V _ { 1 , M } ^ { \star } - V _ { 1 , M } ^ { \widehat { \pi } } \right] \geq \varepsilon ,
+$$
+
+where the expectation $\mathbb { E } _ { M }$ is w.r.t. the randomness during the algorithm execution within MDP M .
+
+Either offline reduction or purely online is optimal Theroem 3 shows that any policy finetuning algorithm needs to play at least $\Omega ( H ^ { 3 } S \operatorname* { m i n } \{ C ^ { \star } , A \} / \varepsilon ^ { 2 } )$ episodes in order to find an $\varepsilon$ near-optimal policy. Crucially, this implies that either a sharp offline reduction (e.g. our PEVI-ADV algorithm) or purely online RL matches the lower bound (up to log), depending on whether $C ^ { \star } \lesssim A$ . In other words, if we have the knowledge of whether $C ^ { \star } \leq A$ , choosing the right one of these two baseline algorithms will yield the optimal sample complexity. Perhaps surprisingly, this rules out the possibility of designing any algorithm “in between” that combines online exploration and knowledge of $\mu$ to improve the sample complexity, at least in the worst-case over all problems in $\mathcal { M } _ { C ^ { \star } }$ . We argue that this “no algorithm in between” phenomenon may be due to the single-policy concentrability assumption being too strong such that offline reduction already achieves a rather competitive sample
+
+Require: MDP $M$ , reference policy $\mu$
+
+6: Denote the final output of UCBVI-UPLOW as
+
+$$
+\begin{array} { r } { ( \overline { { V } } _ { h _ { \star } + 1 } , \underline { { V } } _ { h _ { \star } + 1 } , \widehat { \pi } _ { ( h _ { \star } + 1 ) : H } ^ { \mathrm { U C B } } ) \gets \mathbf { U C B V I - U P L O W } ( n _ { \mathrm { U C B } } ) . } \end{array}
+$$
+
+7: # Stage 2: Learn step $1 : h _ { \star }$ via executing $\mu +$ pessimistic offline policy optimization 8: Collect 9: Learn p $\mathcal { D } \{ n - n _ { \mathrm { U C B } }$ episodes of data using policy he TRUNCATED-PEVI-ADV( $\mu$ up to step lgorithm 5 $h _ { \star } \}$ . $\hat { \pi } _ { 1 : h _ { \star } } ^ { \mathrm { P E V I } }$
+
+$$
+\widehat { \pi } _ { 1 : h _ { \star } } ^ { \mathrm { P E V I } } \mathrm { T R U N C A T E D - P E V I - A D V } ( \mathcal { D } , h _ { \star } , \underline { { V } } _ { h _ { \star } + 1 } ) .
+$$
+
+$\widehat { \pi } = ( \widehat { \pi } _ { 1 : h _ { \star } } ^ { \mathrm { P E V I } } , \widehat { \pi } _ { ( h _ { \star } + 1 ) : H } ^ { \mathrm { U C B } } )$
+
+complexity $\widetilde { O } ( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } )$ . We investigate policy finetuning beyond the single-policy concentrability assumption in Section 5.
+
+We also remark that Theorem 3 generalizes both the $\Omega ( H ^ { 3 } S A / \varepsilon ^ { 2 } )$ lower bound for online RL [11, 58, 13] into the policy finetuning problem, as well as the $\Omega ( \dot { H } ^ { 3 } S C ^ { \star } / \varepsilon ^ { 2 } )$ lower bound for offline RL under single-policy concentrability with $C ^ { \star } \geq 2 [ 4 2 ] ^ { 5 }$ . Further, Theorem 3 directly implies an $\Omega ( H ^ { 3 } S C ^ { \star } / \varepsilon ^ { \star } )$ lower bound for offline RL with $2 \leq C ^ { \star } \leq O ( A )$ , as any algorithm for offline policy optimization is also an algorithm for policy finetuning via the offline reduction.
+
+Proof intuition; Construction of hard instance The proof of Theorem 3 constructs a family of hard MDPs that requires solving $H S$ “independent” bandit problems with $A$ arms, similar as in existing $\Omega ( H ^ { 3 } S A / \bar { \varepsilon } ^ { 2 } )$ lower bounds for online RL [11, 58]. However, our key modification is that we let the optimal arms to be always within the first $K : = \operatorname* { m i n } \left\{ C ^ { \star } , A \right\}$ actions instead of all $A$ actions, and we define our reference policy $\mu$ to play uniformly within $[ K ]$ . This $\mu$ has the following properties:
+
+• $\mu$ satisfies $C ^ { \star }$ single-policy concentrability for any MDP in this family (Lemma D.1). • $\mu$ provides the knowledge that the optimal actions are within $[ K ]$ , but no other knowledge about the optimal actions.
+
+Therefore, with $\mu$ at hand, any policy finetuning algorithm can “gain the knowledge” that the optimal actions are within $[ K ]$ , but still needs to try all $K$ actions in order to solve each bandit problem— rigorizing this information-theoretically gives the $\Omega ( H ^ { 3 } S K / \varepsilon ^ { 2 } ) = \Omega ( H ^ { 3 } S \operatorname* { m i n } { \{ C ^ { \star } , A \} } \mathbf { \hat { / } } \varepsilon ^ { 2 } )$ lower bound.
+
+# 5 Hybrid offline/online algorithm for policy finetuning
+
+Towards circumventing the lower bound in Theorem 3, in this section, we study policy finetuning under more relaxed assumptions on the reference policy $\mu$ . A weaker $\mu$ will induce a higher sample complexity for naive offline reduction approaches, and thus yields opportunities for designing new algorithms that can potentially better utilize $\mu$ .
+
+More concretely, we consider the following relaxation: We assume $\mu$ satisfies partial concentrability only up to a certain time-step $h _ { \star } \leq H$ , and may not have any bounded concentrability at steps $h > h _ { \star }$ . We formalize this in the following
+
+Assumption B ( $h _ { \star }$ -partial concentrability). The reference policy $\mu$ satisfies the single-policy concentrability with respect to $\pi _ { \star }$ up to step $h _ { \star }$ only:
+
+$$
+\operatorname* { m a x } _ { h \leq h _ { \star } } \operatorname* { m a x } _ { s , a \in { \mathcal { S } } \times { \mathcal { A } } } { \frac { d _ { h } ^ { \pi _ { \star } } ( s , a ) } { d _ { h } ^ { \mu } ( s , a ) } } \leq C ^ { \mathrm { p a r t i a l } }
+$$
+
+(with the convention $0 / 0 = 0 ,$ ), where $\pi _ { \star }$ is some deterministic optimal policy of the MDP, and constant Cpartial .
+
+Algorithm description We design a hybrid offline/online algorithm HOOVI (presented in Algorithm 2) for policy finetuning under the partial concentrability assumption. At a high-level, the algorithm consists of two main stages:
+
+• In the first stage, it runs an online algorithm UCBVI-UPLOW which uses optimistic exploration to find a near-optimal policy ${ \widehat { \pi } } ^ { \mathrm { U C B } }$ and an accurate value estimate for steps $( h _ { \star } + 1 ) : H$ . • In the second stage, we run a TRUNCATED-PEVI-ADV algorithm, which collects data from $\mu$ and runs offline policy optimization to find a near-optimal policy $\widehat { \pi } ^ { \mathrm { { P E V I } } }$ for steps $1 : h _ { \star }$ , building on the lower value estimate $\underline { { V } } _ { h _ { \star } + 1 }$ from the first stage.
+
+This strategy makes sense intuitively as the reference policy $\mu$ does not have guarantees for steps $h _ { \star } + 1 : H$ and thus the algorithm is required to perform optimistic exploration first to get a good policy. However, additional technical cares are needed in order to make the above algorithm provably sample-efficient. The analysis of the second stage requires the online algorithm in the first stage to not only perform fast exploration (e.g. by using upper confidence bounds), but also output a lower value estimate for step $h _ { \star } + 1$ , and in addition output a final output policy that achieves at least the value of the lower value estimate at every state $s \in S$ . Such lower bounds are not directly available in standard online RL algorithms such as UCBVI [5].
+
+We resolve this by designing the UCBVI-UPLOW algorithm (detailed description in Algorithm 4), which is a modification of the Nash-VI Algorithm of Liu et al. [34] (for two-player Markov games) into the single-player case. This algorithm is particularly suitable for our purpose since it maintains both upper bounds of $V ^ { \star }$ and lower bounds for the value function of the deployed policies. Our UCBVI-UPLOW further integrates the certified policy technique of Bai et al. [7] to make sure that its output policy achieves value greater or equal than the lower bound at every state (similar guarantees can also be obtained by the policy certificate technique of Dann et al. [12]).
+
+We now state our main theoretical guarantee for the HOOVI algorithm. The proof can be found in Appendix E.
+
+Theorem 4 (Hybrid online $/$ offline learning for policy finetuning). Suppose the reference policy $\mu$ satisfies the partial concentrability (Assumption $B$ ) up to some step $h _ { \star } \leq H$ . Then for small enough $\varepsilon \le \operatorname* { m i n } \left\{ h _ { \star } ^ { - 2 . 5 } , C ^ { \mathrm { p a r t i a l } } / S \right\}$ , HOOVI (Algorithm 2) outputs a policy $\widehat { \pi }$ such that ${ \cal V } _ { 1 } ^ { \star } ( s _ { 1 } ) -$ $V _ { 1 } ^ { \widehat { \pi } } ( s _ { 1 } ) \leq \varepsilon$ with probability at least $1 - \delta$ , within
+
+$$
+n = { \tilde { O } } \left( { \frac { H ^ { 2 } h _ { \star } S C ^ { \mathrm { p a r t i a l } } + ( H - h _ { \star } ) ^ { 3 } S A ( C ^ { \mathrm { p a r t i a l } } ) ^ { 2 } } { \varepsilon ^ { 2 } } } \right)
+$$
+
+episodes of play.
+
+Comparison against offline reduction and purely online algorithms The sample complexity in Theorem 4 compares favorably against both naive offline reduction as well as purely online algorithms in certain situations. First, naive offline reduction with $\mu$ does not have any guarantee since $\mu$ is not assumed to have a finite single-policy concentrability at $h \geq h _ { \star } + 1$ . We can modify $\mu$ into $\mu ^ { \prime }$ that plays uniformly within $\mathcal { A }$ at steps $h \geq h _ { \star } + 1$ ; the single-policy concentrability coefficient of $\mu ^ { \prime }$ is guaranteed to be finite but scales exponentially as $O ( \breve { A } ^ { H - \mathbf { \breve { h } _ { \star } } } )$ in the worst case, leading to a sample complexity much worse than ours (which is polynomial in $H , S , A )$ .
+
+On the other hand, a sharp online algorithm can still achieve $\widetilde { \cal O } ( H ^ { 3 } S A / \varepsilon ^ { 2 } )$ in this setting (by optimistic exploration from scratch). Our Theorem 4 is in general incomparable with this, but can be better in cases when both $C ^ { \mathrm { p a r t i a l } }$ and $H \mathrm { ~ - ~ } h _ { \star }$ are small, e.g., if $\ { \dot { C } } ^ { \mathrm { p a r t i a l } } = o ( A )$ and $( H - h _ { \star } ) / H = o ( ( C ^ { \mathrm { p a r t i a l } } ) ^ { - 2 / 3 } )$ . This makes sense intuitively as our hybrid offline/online algorithm benefits the most if the length requiring exploration $( H - h _ { \star } )$ is small, and the partial concentrability $C ^ { \mathrm { p a r t i a l } }$ is small so that $\mu$ still has a high-quality for the first $h _ { \star }$ steps. To best of our knowledge, this is first result that characterizes when the sample complexity of such hybrid algorithms can be beneficial over purely online or offline algorithms.
+
+# 6 Conclusion & discussions
+
+This paper studies policy finetuning, a new reinforcement learning setting that allows us to compare and connect sample-efficient online and offline reinforcement learning. We establish sharp upper and lower bounds for policy finetuning under various assumptions on the reference policy. Our bounds show that the optimal policy finetuning algorithm is either offline reduction or a purely online algorithm in the specific setting where the reference policy satisfies single-policy concentrability, and we also show that a hybrid online/offline algorithm can be advantageous over both in more relaxed settings. Many directions could be of interest for future research, such as alternative assumptions on the reference policy, or policy finetuning with function approximation.
+
+Also, while our contributions are mainly theoretical, implementing or extending our policy finetuning algorithms on real-world RL tasks would be a compelling future direction. When the environment is a tabular MDP, our Algorithm 1 (offline reduction) and Algorithm 2 (hybrid offline / online RL) are readily implementable. When there is large state/action space and potentially function approximation, we believe our algorithm can be adapted, for example, by replacing all the optimistic/pessimistic value iteration steps by DQN-type algorithms [38] with positive/negative bonus functions [50]. Experimental evaluation of such algorithms would be a good direction for future work.
+
+# Acknowledgment
+
+The authors would like to thank Ming Yin, Chi Jin and David Forsyth for the many insightful discussions. NJ acknowledges funding support from the ARL Cooperative Agreement W911NF17-2-0196, NSF IIS-2112471, and Adobe Data Science Research Award. HW, CX, YB are funded through employment with Salesforce.
+
+# References
+
+[1] A. Agarwal, S. Kakade, A. Krishnamurthy, and W. Sun. Flambe: Structural complexity and representation learning of low rank mdps. arXiv preprint arXiv:2006.10814, 2020.
+[2] S. Agrawal and R. Jia. Optimistic posterior sampling for reinforcement learning: worst-case regret bounds. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 1184–1194, 2017.
+[3] I. Akkaya, M. Andrychowicz, M. Chociej, M. Litwin, B. McGrew, A. Petron, A. Paino, M. Plappert, G. Powell, R. Ribas, et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
+[4] A. Antos, C. Szepesvári, and R. 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.
+[5] M. G. Azar, I. Osband, and R. Munos. Minimax regret bounds for reinforcement learning. In International Conference on Machine Learning, pages 263–272. PMLR, 2017.
+[6] Y. Bai, T. Xie, N. Jiang, and Y.-X. Wang. Provably efficient q-learning with low switching cost. arXiv preprint arXiv:1905.12849, 2019.
+[7] Y. Bai, C. Jin, and T. Yu. Near-optimal reinforcement learning with self-play. Advances in Neural Information Processing Systems, 33, 2020.
+[8] B. Baker, I. Kanitscheider, T. Markov, Y. Wu, G. Powell, B. McGrew, and I. Mordatch. Emergent tool use from multi-agent autocurricula. arXiv preprint arXiv:1909.07528, 2019.
+[9] R. I. Brafman and M. Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research, 3(Oct):213–231, 2002.
+[10] J. Chen and N. Jiang. Information-theoretic considerations in batch reinforcement learning. In International Conference on Machine Learning, pages 1042–1051. PMLR, 2019.
+[11] C. Dann, T. Lattimore, and E. Brunskill. Unifying pac and regret: uniform pac bounds for episodic reinforcement learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 5717–5727, 2017.
+[12] C. Dann, L. Li, W. Wei, and E. Brunskill. Policy certificates: Towards accountable reinforcement learning. In International Conference on Machine Learning, pages 1507–1516. PMLR, 2019.
+[13] O. D. Domingues, P. Ménard, E. Kaufmann, and M. Valko. Episodic reinforcement learning in finite mdps: Minimax lower bounds revisited. In Algorithmic Learning Theory, pages 578–598. PMLR, 2021.
+[14] S. S. Du, S. M. Kakade, J. D. Lee, S. Lovett, G. Mahajan, W. Sun, and R. Wang. Bilinear classes: A structural framework for provable generalization in rl. arXiv preprint arXiv:2103.10897, 2021.
+[15] A. M. Farahmand, R. Munos, and C. Szepesvári. Error propagation for approximate policy and value iteration. In Advances in Neural Information Processing Systems, 2010.
+[16] S. Fujimoto, D. Meger, and D. Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pages 2052–2062. PMLR, 2019.
+[17] M. Gao, T. Xie, S. S. Du, and L. F. Yang. A provably efficient algorithm for linear markov decision process with low switching cost. arXiv preprint arXiv:2101.00494, 2021.
+[18] M. Hessel, J. Modayil, H. Van Hasselt, T. Schaul, G. Ostrovski, W. Dabney, D. Horgan, B. Piot, M. Azar, and D. Silver. Rainbow: Combining improvements in deep reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
+[19] T. Jaksch, R. Ortner, and P. Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(4), 2010.
+[20] M. Janner, J. Fu, M. Zhang, and S. Levine. When to trust your model: Model-based policy optimization. arXiv preprint arXiv:1906.08253, 2019.
+[21] N. Jiang, A. Krishnamurthy, A. Agarwal, J. Langford, and R. E. Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pages 1704–1713. PMLR, 2017.
+[22] C. Jin, Z. Allen-Zhu, S. Bubeck, and M. I. Jordan. Is q-learning provably efficient? In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 4868–4878, 2018.
+[23] C. Jin, Z. Yang, Z. Wang, and M. I. Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pages 2137–2143. PMLR, 2020.
+[24] C. Jin, Q. Liu, and S. Miryoosefi. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. arXiv preprint arXiv:2102.00815, 2021.
+[25] Y. Jin, Z. Yang, and Z. Wang. Is pessimism provably efficient for offline rl? arXiv preprint arXiv:2012.15085, 2020.
+[26] D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, E. Jang, D. Quillen, E. Holly, M. Kalakrishnan, V. Vanhoucke, et al. Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, pages 651–673. PMLR, 2018.
+[27] M. Kearns and S. Singh. Near-optimal reinforcement learning in polynomial time. Machine learning, 49(2):209–232, 2002.
+[28] R. Kidambi, A. Rajeswaran, P. Netrapalli, and T. Joachims. Morel: Model-based offline reinforcement learning. arXiv preprint arXiv:2005.05951, 2020.
+[29] A. Kumar, J. Fu, G. Tucker, and S. Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. arXiv preprint arXiv:1906.00949, 2019.
+[30] A. Kumar, A. Zhou, G. Tucker, and S. Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
+[31] T. Lattimore and C. Szepesvári. Bandit algorithms. Cambridge University Press, 2020.
+[32] J. Lee, J. Hwangbo, L. Wellhausen, V. Koltun, and M. Hutter. Learning quadrupedal locomotion over challenging terrain. Science robotics, 5(47), 2020.
+[33] E. L. Lehmann and G. Casella. Theory of point estimation. Springer Science & Business Media, 2006.
+[34] Q. Liu, T. Yu, Y. Bai, and C. Jin. A sharp analysis of model-based reinforcement learning with self-play. arXiv preprint arXiv:2010.01604, 2020.
+[35] Y. Liu, A. Swaminathan, A. Agarwal, and E. Brunskill. Provably good batch reinforcement learning without great exploration. arXiv preprint arXiv:2007.08202, 2020.
+[36] T. Matsushima, H. Furuta, Y. Matsuo, O. Nachum, and S. Gu. Deployment-efficient reinforcement learning via model-based offline optimization. arXiv preprint arXiv:2006.03647, 2020.
+[37] A. Maurer and M. Pontil. Empirical bernstein bounds and sample variance penalization. arXiv preprint arXiv:0907.3740, 2009.
+[38] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015.
+[39] R. Munos. Error bounds for approximate policy iteration. In ICML, volume 3, pages 560–567, 2003.
+[40] R. Munos and C. Szepesvári. Finite-time bounds for fitted value iteration. Journal of Machine Learning Research, 9(5), 2008.
+[41] I. Osband and B. V. Roy. Model-based reinforcement learning and the eluder dimension. In Proceedings of the 27th International Conference on Neural Information Processing SystemsVolume 1, pages 1466–1474, 2014.
+[42] P. Rashidinejad, B. Zhu, C. Ma, J. Jiao, and S. Russell. Bridging offline reinforcement learning and imitation learning: A tale of pessimism. arXiv preprint arXiv:2103.12021, 2021.
+[43] T. Ren, J. Li, B. Dai, S. S. Du, and S. Sanghavi. Nearly horizon-free offline reinforcement learning. arXiv preprint arXiv:2103.14077, 2021.
+[44] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
+[45] D. Silver, J. Schrittwieser, K. Simonyan, I. Antonoglou, A. Huang, A. Guez, T. Hubert, L. Baker, M. Lai, A. Bolton, et al. Mastering the game of go without human knowledge. nature, 550 (7676):354–359, 2017.
+[46] D. Su, J. D. Lee, J. M. Mulvey, and H. V. Poor. Musbo: Model-based uncertainty regularized and sample efficient batch optimization for deployment constrained reinforcement learning. arXiv preprint arXiv:2102.11448, 2021.
+[47] W. Sun, N. Jiang, A. Krishnamurthy, A. Agarwal, and J. Langford. Model-based rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on Learning Theory, pages 2898–2933. PMLR, 2019.
+[48] C. Szepesvári and R. Munos. Finite time bounds for sampling based fitted value iteration. In Proceedings of the 22nd international conference on Machine learning, pages 880–887, 2005.
+[49] A. A. Taïga, W. Fedus, M. C. Machado, A. Courville, and M. G. Bellemare. Benchmarking bonus-based exploration methods on the arcade learning environment. arXiv preprint arXiv:1908.02388, 2019.
+[50] A. A. Taiga, W. Fedus, M. C. Machado, A. Courville, and M. G. Bellemare. On bonus based exploration methods in the arcade learning environment. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=BJewlyStDr.
+[51] S. Tosatto, M. Pirotta, C. d’Eramo, and M. Restelli. Boosted fitted q-iteration. In International Conference on Machine Learning, pages 3434–3443. PMLR, 2017.
+[52] O. Vinyals, I. Babuschkin, W. M. Czarnecki, M. Mathieu, A. Dudzik, J. Chung, D. H. Choi, R. Powell, T. Ewalds, P. Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
+[53] R. Wang, R. R. Salakhutdinov, and L. Yang. Reinforcement learning with general value function approximation: Provably efficient approach via bounded eluder dimension. Advances in Neural Information Processing Systems, 33:6123–6135, 2020.
+[54] T. Wang, D. Zhou, and Q. Gu. Provably efficient reinforcement learning with linear function approximation under adaptivity constraints. arXiv preprint arXiv:2101.02195, 2021.
+[55] Y. Wu, G. Tucker, and O. Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
+[56] T. Xie and N. Jiang. $\mathrm { Q ^ { * } }$ approximation schemes for batch reinforcement learning: A theoretical comparison. In Conference on Uncertainty in Artificial Intelligence, pages 550–559. PMLR, 2020.
+[57] Z. Yang, C. Jin, Z. Wang, M. Wang, and M. I. Jordan. Bridging exploration and general function approximation in reinforcement learning: Provably efficient kernel and neural value iterations. arXiv preprint arXiv:2011.04622, 2020.
+[58] M. Yin, Y. Bai, and Y.-X. Wang. Near optimal provable uniform convergence in off-policy evaluation for reinforcement learning. arXiv preprint arXiv:2007.03760, 2020.
+[59] M. Yin, Y. Bai, and Y.-X. Wang. Near-optimal offline reinforcement learning via double variance reduction. arXiv preprint arXiv:2102.01748, 2021.
+[60] T. Yu, G. Thomas, L. Yu, S. Ermon, J. Zou, S. Levine, C. Finn, and T. Ma. Mopo: Model-based offline policy optimization. arXiv preprint arXiv:2005.13239, 2020.
+[61] A. Zanette, A. Lazaric, M. Kochenderfer, and E. Brunskill. Learning near optimal policies with low inherent bellman error. In International Conference on Machine Learning, pages 10978–10989. PMLR, 2020.
+[62] A. Zanette, A. Lazaric, M. J. Kochenderfer, and E. Brunskill. Provably efficient reward-agnostic navigation with linear value iteration. arXiv preprint arXiv:2008.07737, 2020.
+[63] Z. Zhang, Y. Zhou, and X. Ji. Almost optimal model-free reinforcement learningvia referenceadvantage decomposition. Advances in Neural Information Processing Systems, 33, 2020.
\ No newline at end of file
diff --git a/md/train/MmCRswl1UYl/MmCRswl1UYl.md b/md/train/MmCRswl1UYl/MmCRswl1UYl.md
new file mode 100644
index 0000000000000000000000000000000000000000..fb28f0d92a474ab9f1c7a3c394fc48609c8ce3b6
--- /dev/null
+++ b/md/train/MmCRswl1UYl/MmCRswl1UYl.md
@@ -0,0 +1,325 @@
+# OPEN QUESTION ANSWERING OVER TABLES AND TEXT
+
+Wenhu Chen1 ∗, Ming-Wei Chang2, Eva Schlinger2, William Wang1, William W. Cohen2
+
+1University of California, Santa Barbara 2Google Research {wenhuchen, william}@cs.ucsb.edu {mingweichang, eschling, wcohen}@google.com
+
+# ABSTRACT
+
+In open question answering (QA), the answer to a question is produced by retrieving and then analyzing documents that might contain answers to the question. Most open QA systems have considered only retrieving information from unstructured text. Here we consider for the first time open QA over both tabular and textual data and present a new large-scale dataset Open Table-and-Text Question Answering (OTT-QA) to evaluate performance on this task1. Most questions in OTT-QA require multi-hop inference across tabular data and unstructured text, and the evidence required to answer a question can be distributed in different ways over these two types of input, making evidence retrieval challenging—our baseline model using an iterative retriever and BERT-based reader achieves an exact match score less than $10 \%$ . We then propose two novel techniques to address the challenge of retrieving and aggregating evidence for OTT-QA. The first technique is to use “early fusion” to group multiple highly relevant tabular and textual units into a fused block, which provides more context for the retriever to search for. The second technique is to use a cross-block reader to model the cross-dependency between multiple retrieved evidence with global-local sparse attention. Combining these two techniques improves the score significantly, to above $27 \%$ .
+
+# 1 INTRODUCTION
+
+Open question answering considers the problem of retrieving documents from a fixed corpus with a retriever, and then analyzes retrieved evidence to provide answers to a given question with a reader. Prior open question answering systems focused only on retrieving and reading free-form passages or documents. However, a significant amount of real-world information is stored in other forms, such as semi-structured web tables due to its compact representation to aggregate related information. For example, tables are often used to hold large quantities of related facts, especially numeric facts, such as ‘Career Statistics for Lebron James’. This type of detailed information is found much less frequently in unstructured text. Tables are also commonly used for collections of homogeneous entities or recurring events, like ‘List of Periodic Comets’ or ‘List of Champions League Winners since $\exists \in 6 6 ^ { \prime }$ . Hence tabular information serves as an excellent complement to textual data, especially in the open setting. Despite these advantages, no previous studies have exploited the millions of web tables to augment their open QA system.
+
+In this paper, we describe the first study to jointly exploit tables and text for open-domain question answering. For this purpose, we construct a new dataset, Open Table-and-Text Question Answering (OTT-QA). OTT-QA is built on the HybridQA dataset (Chen et al., 2020), and like HybridQA, OTTQA questions are multi-hop questions which require aggregating information from both tables and text to answer. However, unlike HybridQA, OTT-QA requires the system to retrieve relevant tables and text — in contrast, in HybridQA, the ground truth tables and textual passages required for each question are given. To produce OTT-QA’s questions, we begin by re-annotating the questions from HybridQA to ‘decontextualize’ them—i.e., we make questions suitable for the open-domain setting so that unique answers can be determined from the question alone, without needing context from the provided text and tables. We then add new questions to remove potential biases. After these steps, OTT-QA contains $4 5 K$ human-annotated questions that require retrieving and aggregating information over tables and text from the whole Wikipedia. Examples from OTT-QA are depicted in Figure 1. Note the table and passages contain non-overlapping information, and both of them must be understood to answer the question. For example, the question has a low lexical overlap with the passage about the ‘Lakers’, and it needs the table as the bridge to retrieve this passage. Such cross-modality multi-hop retrieval features OTT-QA. More examples are displayed in Appendix.
+
+
+Figure 1: The problem setting: A OTT-QA model needs to retrieve from two candidate pools and then perform multi-hop reasoning to find answers.
+
+OTT-QA is distinguished from the existing QA datasets in two aspects. Existing table-based QA datasets (Pasupat & Liang, 2015; Yu et al., 2018; Chen et al., 2020) operates in the closed setting without requiring any retrieval, whereas most existing open QA datasets (Joshi et al., 2017; Yang et al., 2018) require only text retrieval, not table retrieval. One dataset, Natural Questions (NQ) (Kwiatkowski et al., 2019) includes some tabular information in its corpus, but the tables are nearly always of a restricted type (infobox tables with only a single row). In contrast, OTT-QA models require retrieving both tabular data and text, and unlike the NQ dataset, requires information fusion from text and tables in non-trivial ways. OTT-QA poses novel and realistic challenges to both the retriever and reader in open QA though the questions are less natural than the real queries from NQ (Kwiatkowski et al., 2019). Retrievers for OTT-QA need to consider two information formats, making the search space larger. Even worse, as questions in OTT-QA often require multi-hop inference, one round of retrieval is often not enough. Readers for OTT-QA also need to aggregate a significant amount of knowledge-intensive information, compared to other reader models: a single table in OTT-QA has an average length of over 300 words. Moreover, readers are often expected to process multiple retrieved units due to the uncertainty in retrieval, which makes it difficult to design strong reader models (Devlin et al., 2019; Liu et al., 2019) with a length limit of 512 tokens.
+
+The baseline system that we propose to address these challenges uses an iterative retriever (Sun et al., 2019; Qi et al., 2019; Min et al., 2019; Ding et al., 2019; Asai et al., 2019) and a BERT reader (Devlin et al., 2019). The iterative retriever explores multiple evidence documents iteratively, interacting with the candidate pool to gradually reformulate the query. Beam search is used to find multiple subsets of documents that may contain all the required evidence, and each subset is then fed to the BERT reader to predict the answer span. The highest-scored prediction is chosen as the answer. The iterative retriever needs to re-encode the query with a big transformer and re-search over the candidate pool, such a procedure (especially dense) can be computationally expensive. Furthermore, the BERT reader fails to capture a global overview of the retrieved documents, which leads to bad local optimum in the model prediction.
+
+We propose a more sophisticated system that addresses these challenges with two novel strategies: namely fusion retrieval and cross-block reading. The fusion retriever first pre-aligns the table segments to their highly related passages, using entity linking. Then, the aligned table segments and passages are grouped as a fused block, which contains aggregated information from two modalities; hence, compared to the previous documents, it contains richer context to benefit the following retrieval. We view the fused block as the basic unit to be retrieved, and instead of performing multiple runs of retrieval iteratively, the fusion retriever is used once to retrieve the top $K$ fused blocks; however, due to errors in fusion and retrieval, the retrieved top-1 fused block might not contain the necessary information. We thus also propose a cross-block reader based on a sparse-attention based transformer architecture (Ainslie et al., 2020; Zaheer et al., 2020), which can process extremely long sequences efficiently. We use the cross-block reader to read all the top-K retrieved fused blocks jointly. Both strategies have proven effective compared to the baseline system: the best model combining the two strategies improves the accuracy of the baseline system by a huge margin.
+
+# 2 BACKGROUND
+
+The aim of an open QA system is to extract an answer to a question $q$ from a given large corpus. Most open QA models are retriever-reader models, which extract answers in two steps: retrieval and reading. In the retrieval step, a retrieval model $f$ is used to retrieve a set of passages from the text corpus. In the reading step, the reader is then used to extract the answer from them.
+
+Retrieval Function There are two commonly-used types of retrieval function $f$ : sparse retrievers and dense retrievers. Our sparse retriever uses a unigram-based BM-25 score to retrieve an evidence unit $b$ from the candidate pool $\mathbb { B }$ . Our dense retrieval function is a dual-encoder model (Bromley et al., 1994), and we follow (Lee et al., 2019; Guu et al., 2020) for the dual encoder design. The query and the passage are encoded with separate Transformers. As in (Devlin et al., 2019), the vector corresponding to the first token, [CLS], is used as a “pooled” representation of the sequence. The dense retrieval function is the dot product between $h _ { q } = \mathtt { B E R T } _ { \mathbb { Q } } ( q ) [ \mathrm { C L S } ]$ and $h _ { b } = \mathtt { B E R T _ { B } } ( b ) [ \mathrm { C L S } ]$ for each evidence block $b$ in the candidate corpus—i.e., the scoring function is $f ( q , b ) = h _ { q } ^ { T } h _ { b }$ , which can viewed as finding the nearest neighbor in vector space. In the multi-hop open QA setting (Yang et al., 2018), an iterative retrieval function (Sun et al., 2019; Min et al., 2019; Ding et al., 2019) is proposed, which defines the retrieval process as an auto-regressive formula. Our iterative retriever function is denoted as $f ( [ q , b _ { 1 } , \cdots , b _ { j - 1 } ] , b _ { j } )$ , which appends the previous $j - 1$ rounds of retrieval to the original $q$ in in the $j$ -th round of retrieval. Beam search is used in test time.
+
+Single-Block Reader Due to the uncertainty in retrieval, the top-1 document might not always contain the answer. Existing models normally retrieve the top- $k$ documents and feed them to the reader for span selection. The standard reader (Chen et al., 2017; Joshi et al., 2017) aims to extract a span from each of the retrieved blocks $b _ { i }$ and assign a confidence $f ( q , b _ { i } ) f _ { r e a d } ( a | q , b _ { i } )$ to it, with $f ( \boldsymbol { q } , \boldsymbol { b } _ { i } )$ indicating the retrieval probability and $f _ { r e a d } ( a | q , b _ { i } )$ denoting the span selection probability by reader. Multiple answers $\{ \bar { a } _ { 1 } , \cdots , \bar { a } _ { k } \}$ are ranked with this confidence score and the highest scored answer span $\hat { a }$ is the final answer. Note that the reader needs to run $k$ times, once for each of the top- $k$ retrievals. We refer to this model as the single-block reader and use it as our baseline.
+
+HybridQA HybridQA (Chen et al., 2020), a closed-domain QA dataset, is the most related to ours. During the annotation of HybridQA, a table $T$ and its relevant passages $\{ P _ { 1 } , \cdots , P _ { N } \}$ (surrounding text and hyperlinked passage) are given to a crowd worker to write questions which necessarily require both the passage and table information to answer. The original dataset contains 72K multi-hop questions paired with 13K tables with their paired passages. During training/testing time, the ground-truth tables and passages are given to a model, HYBRIDER, to find the final answer. HYBRIDER also serves as an important baseline in our paper.
+
+# 3 TASK AND DATASET
+
+In OTT-QA, the retrieval corpus consists of a set of table candidates $\mathbb { B } _ { T }$ and a set of passage candidates $\mathbb { B } _ { P }$ . The task is to answer question $q$ by extracting answer strings from blocks $b \in \mathbb { B } _ { T } \cup \mathbb { B } _ { P }$ , where $b$ can be either textual and tabular data. We adopt the standard exact match (EM) and F1 scores (Yang et al., 2018) for evaluation. Different from HybridQA, OTT-QA’s table candidates are web tables without hyperlinks provided. This decision was made to make the problem setting more general, as otherwise systems that solve OTT-QA could only be applied to high-quality data in Wikipedia. However, in OTT-QA, we provide hyperlinks in the training subset, but not dev/test set. Removing hyperlinks in tables makes the overall task much more challenging, but makes the final systems applicable to more general domains. Thus, an OTT-QA model needs to jointly retrieve both tables and text, without abusing gold hyperlinks, and then aggregate them to find the answer.
+
+Candidate Pool For our table collection $\mathbb { B } _ { T }$ , we extracted all Wikipedia regular tables with their metadata including page title, page section title, and section text. The metadata, denoted $T _ { M }$ , is essential for de-contextualization. We obtain a table corpus containing over $4 0 0 k$ high-quality tables with an average length of 320 words including metadata. For the text passage collection $\mathbb { B } _ { P }$ , we crawl English Wikipedia dump pages and filter out noisy pages. We follow HybridQA (Chen et al., 2020) and only keep a maximum of 12 sentences in the introduction section as the passage. We obtain a corpus containing over 5 million passages, with an average of 94 words.
+
+Notation We define each table as a matrix $T$ , which consists of cells $T _ { i , j }$ with $i$ specifying the row, and $j$ specifying the column. Each cell $T _ { i , j }$ could be a number, date, phrase or even sentence due to its semi-structured nature. However, a single complete table with structured representation (Herzig et al., 2020) can easily exceed the 512-token limit, which poses great challenges to the downstream reader to process top- $K$ retrieval. Hence we propose to decompose each table $T$ into multiple rows $R _ { i }$ , which are combined with the headers, metadata, and global max/min information from the original table as a table segment. The table segment is used as the basic retrieval block in our paper. This decomposition procedure increases candidate $\mathbb { B } _ { T }$ from $4 0 0 k$ to 5 million, making the retrieval problems even more fine-grained and more challenging. Our table segment representation is described in Appendix subsection B.1. In summary, we build a candidate pool of 5 million table segments $\mathbb { B } _ { T }$ and a pool of 5 million passages $\mathbb { B } _ { P }$ . We denote as $\mathbb { B }$ as our full candidate pool, which our model needs to find the block $b$ (a table segment or a passage) containing the answer span.
+
+# 3.1 QUESTION AND ANSWER ANNOTATIONS
+
+Our question and answer pairs are built upon the existing HybridQA (Chen et al., 2020) dataset, with several significant changes. First, crowd workers ‘decontextualize’ the questions so that they are not under-specified or context-dependent, and thus suitable for the open setting. Second, we add more questions to the development/test set to remove possible annotation bias. During annotation, we adopt strict quality control2 and more details are described in Appendix section A.1.
+
+Decontextualization Most questions in HybridQA are contextualized with a given table and several passages, with corresponding questions written by crowd workers. Often, the crowdsourced questions assume the context. For example, the questions might contain the words "the players" because the given table is about "Netherlands players". We thus needed ‘decontextualize’ (Parikh et al., 2020) the original context-dependent questions, so they could serve as standalone questions, specific enough to imply a unique answer relative to the corpus. To discourage excessive unwanted modification, we enforce a two-step annotation procedure, as depicted in Figure 2. In the first phase, the worker is only allowed to insert minimum words or phrases (or replace pronouns) into the questions based on the information presented by Wikipedia Title, Section Title, and Section Text to make the question have a unique answer. After this step, we often potentially obtain overly-complicated questions that are artificial and unnatural. Therefore, we manually selected the worst $2 5 \%$ questions and sent them back to make them more concise and natural.
+
+OTT-QA Annotation
+
+
Page Title:Netherlandsatthe European Track Championships Section Title: European Track Championships (elite) 2010-current
schema
Medal
Championship
Name
Event
Ranking
content
Silver
2010 Pruszk6w
Tim Veldt
Men'somnium
2nd
Bronze
2011 Apeldoorn
Kirsten Wild
Women'somnium
3rd
+
+Figure 2: The ‘de-contextualization’ annotation phase of OTT-QA. In the first step, the annotator is restricted to add phrases from the context. In the second step, the annotator is specifically requested to make the sentence more concise and natural.
+
+
0. Original
Which city does the player winning the silver medal in Men's Omnium come from?
1. Insertion
Which citydoes the Netherlands player winning the Men's Omnium silver medalin ETCafter 2010 come from?
2. Naturalize
Which city does the Netherlands Men's Omnium silver medalist after 2010 in ETC come from?
+
+Additional Evaluation Examples As all the questions from HybridQA are based on the $1 3 k$ tables from the HybridQA set, no questions are asked about the newly crawled $4 0 0 k$ tables. This potentially generates unwanted statistical biases or artifacts for the model to exploit, and potentially biases the final evaluation results. Therefore, we randomly sampled another 1100 tables from the newly crawled tables, and follow the original annotation process used by HybridQA to re-collect 2200 new questions. These new questions were mainly used in the dev/test set. Below we refer to the subset of tables used by original HybridQA as the in-domain tables.
+
+Distant Supervision Signals For the in-domain tables $( \approx 8 k )$ , the cell-wise hyperlinks are provided in OTT-QA as a potential signal for supervision. We use $H _ { i , j } = \left\{ b _ { 1 } , b _ { 2 } , . . . \in \mathbb { B } _ { P } \right\}$ to denote the hyperlinks in cell $T _ { i , j }$ . Since in HybridQA the oracle fine-grained answer span is not explicitly annotated, we approximate this by traversing the table and hyperlinked pasasages to find all exact matches. This process contains some noise—a manual study reveals that it roughly contains $15 \%$ error. We use this ‘weakly-supervised’ fine-grained information to train our models. We denote the ‘approximate’ block of the answer span for answer $a$ as $b _ { a }$ , and use it to train our model.
+
+# 3.2 DATASET STATISTICS
+
+After annotation, we sampled roughly 2K questions from the in-domain HybridQA dataset, and then mix them with the newly collected out-domain questions to construct our dev and test sets. Finally, we have 41,469 questions in the training set, 2,214 questions in the dev set, and 2,158 questions in the test set. We conduct more in-detailed analysis over the reasoning types and show them in the Appendix A.3, a remarkable difference from original HybridQA is that a proportion of questions actually have multiple plausible inference chains in the open-domain setting.
+
+# 4 MODEL
+
+Our model for OTT-QA is a retriever-reader model with new designs for both retriever and reader. As discussed briefly above, we propose to use a fusion retriever instead of using a standard iterative retrieve, and we also propose to use cross-block readers to replace a standard single-block reader.
+
+
+Figure 3: Left: Iterative 3-step retrieval over individual blocks (baseline). Right: Fusion 1-step retrieval over fused groups, which greatly lowers the cost of iterative encoding and retrieving.
+
+# 4.1 FUSION RETRIEVER
+
+Iterative retrieval (Figure 3, Left) has the following issues. First, iterative retrieval training often requires having supervision signals for every retrieval step to reach good performance, which is not available in OTT-QA. The iterative retrieval also suffers from the problem of error propagation, as early mistakes can propagate to later retrieval stages. Finally, the computation cost for applying a dual-encoder for iterative retrieval is very high, as for every stage, the query embedding has to be re-encoded to include the entire retrieval history.
+
+We propose an alternative strategy to replace multi-step retrieval, namely fusion retrieval (Figure 3, Right). In the fusion retriever, we first use an ‘early fusion’ strategy to group relevant heterogeneous data before retrieval. The fusion procedure groups several highly-relevant blocks from different modalities as a self-contained group (fused block), which provides more clues for the retriever to utilize. Early fusion is very important for retrieving table segments, which often have incomplete context by themselves. The early fusion process aims to fuse a table segment and relevant passages into a group. Here we propose to fuse entities mentioned in a table segment to the appropriate passages for those entities; this is similar to document expansion based on a traditional entity linking step. The problem is challenging due to the mismatch between the lexical forms from the
+
+How many points per game did Lebron James get in the NBA Season suspended by COVID?
+
+
+Figure 4: Left: Single-block reader with input shorter than 512 tokens (baseline). Right: Crossblock reader with length over 4K tokens, and $\bar { A }$ denotes the global state assigned to local block A. The single-block reader is stuck at local optimum, while cross-block reader outputs global optimum.
+
+table (which for brevity are often abbreviated) and the relevant passage titles. For example, a cell in the table of "NCAA Division I Men’s Football Tournament" contains the term "Penn State". Directly matching "Penn State" against the passage corpus will lead to "Penn State University" rather than the ground-truth hyperlinked entity, named "Penn State Nittany Lions football". Therefore, we propose an additional augmentation step, which takes in a table segment block $b _ { T }$ and generates a sequence of augmented queries $q _ { 1 } , q _ { 2 } , \cdots , q _ { n }$ token by token to make the queries more similar to the passage title. The augmented queries are then used to search for nearest neighbors in the passage corpus $\mathbb { B } _ { P }$ using BM25 as the final entity linking step, which is depicted in Appendix. The query augmentation is implemented with a GPT-2 model (Radford et al., 2019), fine-tuned on the supervised pairs of (table segment, hyperlink) from the in-domain tables. Each $b _ { T }$ is fed to find its companions $b _ { P } ^ { 1 } , \cdots , b _ { P } ^ { n }$ , they are collectively called $b _ { F }$ .
+
+We follow the standard dual-encoder setting (section 2) and the only difference is that we replace the input of the block encoder with $h _ { b } = \mathtt { B E R T _ B } ( [ b _ { T } , b _ { P } ^ { 1 } , \cdot \cdot \cdot , b _ { P } ^ { n } ] )$ ., which captures the cross-attention between the table and the text within a block. The fused embedding contains richer context from both modalities to complement each other. The retriever only needs to retrieve once from the candidate pool, which dramatically decreases the complexity compared to the existing iterative retrievers.
+
+To enhance the neural retrieval system to retrieve fused blocks, we apply the Inverse Cloze Task (ICT) (Lee et al., 2019) pretraining task on the corpus of fused blocks. ICT is a way to generate pseudo-training data for dense retrieval. Unlike standard document-wise ICT, our fused block contains both table segments and multiple passages. Given a fused block $b _ { F }$ , we generate the pseudoquery in the following way: 1) we first corrupt the table segment by randomly dropping half of the words from the table metadata and cells to obtain a partial table segment $\hat { b } _ { T }$ . 2) We then randomly sample a sentence $\hat { b } _ { P }$ from the fused passage. We combine $\hat { b } _ { T }$ and $\bar { \boldsymbol { b } } _ { P }$ as a pseudo query $\hat { q }$ and pair it with the original fused block $b _ { F }$ as pre-training data. The pre-training data is applied to enhance the dual encoder’s ability to select lexically matched documents. After pre-training, the retriever is fine-tuned on OTT-QA. Finally, at inference time, the retriever is used to retrieve the top $K$ fused blocks for a question, which are then passed to the reader for answer prediction.
+
+# 4.2 CROSS-BLOCK READER
+
+The reader typically needs to process the top- $k$ retrieved blocks returned by the retriever to extract the best answer, as the top-1 block might not contain enough evidence to answer the question. As demonstrated in Figure 4, the cross-block reader aims to address this issue by using cross attention between different blocks to model their dependencies. To obtain the cross-block reader, we take the pre-trained long-range sparse attention transformer (ETC) (Ainslie et al., 2020), which can accept up to 4096 tokens as input, and then fine-tune the model on the distant supervision data. During training, the ground truth (fused) blocks are mixed with hard negative blocks from the retriever. We take the top- $k$ retrieval results to fill the 4096 token space (roughly 15 fused blocks).
+
+Cross-attention between blocks allows a much more powerful way to aggregate information across the $k$ retrieved blocks compared to the single-block reader, especially when the blocks are fused. This is feasible because of the design of the sparse attention structure in ETC, which can constrain the attention of each token to its neighboring tokens within a local radius in its local block. Such sparse attention can decrease the attention computation complexity from quadratic $\mathcal { O } ( N ^ { 2 } )$ to linear $\mathcal { O } ( N | R | )$ , where $| R |$ is the local radius (where $N = 4 0 9 6$ and $| R | = 8 4$ in our experiments). To allow cross-block interaction, ETC assigns a global state for each local block in the long sequence, and blocks can attention to each other through multiple layers of such global-local structures.
+
+Table 1: Main Results. We conduct experiments with both sparse and dense retrievers using the dev set, and then select the best setting to report the test set results (as indicated by the word ”Best”). Fusion-Retriever and Cross-Block Reader are combined to obtain the highest score. $\dagger$ are ablations.
+
+
Retriever
Dev-Sparse
Dev-Dense
Test-Best
Model
EM
F1
EM
F1
EM
F1
HYBRIDER(Top-1) (Chen et al., 2020)
8.7
10.9
8.9
11.3
8.4
10.6
HYBRIDER (best Top-K) (Chen et al.,2020)
9.9
12.2
10.3
13.0
9.7
12.8
Iterative-Retrieval + Single-Block Reader
9.8
13.3
7.9
11.1
9.6
13.1
Fusion-Retrieval + Single-Block Reader
14.3
17.8
13.8
17.2
13.4
16.9
Iterative-Retrieval + Cross-Block Reader
17.1
20.7
14.4
18.5
16.9
20.9
Fusion-Retrieval + Cross-Block Reader
27.7
31.8
28.1
32.5
27.2
31.5
† Table-only Retrieval + Cross-Block Reader
4.6
6.9
4.9
7.2
4.4
7.0
† Text-only Retrieval + Cross-Block Reader
8.2
12.4
8.9
12.8
8.8
12.1
† Oracle Link + Fusion-Retrieval + Cross-Block Reader
35.8
40.1
35.2
39.9
35.0
39.5
† Oracle Table + Link (w/o Retrieval) + HYBRIDER
44.1
50.8
44.1
50.8
43.0
49.8
+
+# 5 EXPERIMENTS
+
+All of our code is based on Tensorflow (Abadi et al., 2016). For the retriever part, the sparse retriever is built on top of DrQA (Chen et al., 2017) with unigram features, and the dense retriever is built with BERT. The single-block retriever is based on BERT-uncased, and the cross-block reader is based on ETC (Ainslie et al., 2020). Both of them consist of 12 layers with a hidden size of 768, the minor differences in the relative positional embedding used in ETC. All the models are trained with a learning rate of 1e-5 optimized by AdamW (Loshchilov & Hutter, 2019). We use in-batch negatives (Lee et al., 2019) to train our dense retrievers. A more detailed implementation of the baseline iterative retriever is described in Appendix subsection B.2. In fusion retriever, we use the ‘fused’ block containing the ‘approximate’ answer block $b _ { a }$ as the positive instance. In iterative retriever, since the auto-regressive model $f ( b _ { j } | q , b _ { 1 } , \cdot \cdot \cdot , b _ { j - 1 } )$ requires fine-grained inference chain for step-wise supervision, which is not given in OTT-QA. We apply lexical match based heuristics to synthesize inference chains as weakly supervised training data (described in Appendix). For all the dense retrievers, we pre-train with 10K steps using the generated pseudo query and then fine-tune them another 10K step using a batch size of 2048. For the cross-block reader, we fine-tune with a batch size of 64. Both are using 16 cloud TPUs.
+
+Main Results In our experiments, we experiment with different types of retriever and reader models under both sparse and dense setting, the details are described as follows:
+
+• HYBRIDER: this model, designed for closed domain HybridQA questions, is one baseline. Since this model requires a ground truth table with its hyperlinks to do modularized reasoning, we use BM25 to retrieve the most relevant table and passages to reconstruct an ‘approximated’ input for this model. We experiment with top-1,2,3,4 cases where we use the answer with the highest confidence as the final result. We also directly feed the ground-truth table and hyperlinks to HYBRIDER, which roughly estimates an upper limit of this task.
+
+• Iterative-Retriever (Sparse): We use a 2-step iterative retriever: in the first step, we apply the question to retrieve the top-10 table segments and top-10 passages. In the second step, we use each retrieved table segment to retrieve its related top-5 passages and concatenate each retrieved passage title with the original question to retrieve the top-5 table segments. We merge and calculate the retrieval score of each unique block and rank them by their score. For the single-block reader, we split the retrieved blocks into 512-token chunks and feed them to the BERT reader. For the cross-block reader, we truncate the top 4096 subword tokens and only feed these tokens to reader.
+
+• Iterative-Retriever (Dense): We use a 3-step iterative retriever. In the first step, we encode the question and retrieve the top-8 blocks (either table segment or passage); in the second step, we concatenate the previous retrieved block and the question to re-encode the query vector to further retrieve top-4 blocks; similarly, the last step retrieves top-2 blocks.
+
+• Fusion Retriever (Iterative): We use a sparse retriever to directly retrieve the top-15 fused blocks based on bag-of-words BM25 score, and then split it into individual table segments and passage blocks. Since passage could be associated with multiple fused blocks, we merge duplicate blocks and use their summed score. Finally, we rank each block based on its merged retrieval score and truncate the first 4096 subword tokens for the next step.
+
+• Fusion Retriever (Iterative): We use a dual-encoder dense retriever to directly retrieve the top-15 fused blocks, and then follow the same procedure as above. Without specifying the dense retriever uses ICT for pre-training by default.
+
+• Fusion Retriever w/o ICT and w/o GPT-2: these two ablation studies are aimed to show the effectiveness of our proposed ICT pre-training and query augmentation.
+
+The main results are presented in Table 1. First, we can observe that best HYBRIDER top-2 can only achieve a comprised exact match of $9 . 9 \%$ while the oracle HYBRIDER can obtain a score of $44 \%$ , which reflects the difficulties of the hybrid retrieval in our dataset. We restrain the retriever to only retrieve table and text to answer the questions and report their results in Table 1, even with the strong cross-block reader, the model only obtains $10 \%$ EM. These experiments demonstrate the necessity to integrate information from both forms in OTT-QA.
+
+By combining the standard iterative retriever and single-block reader, we can slightly improve the score can to roughly $10 \%$ . By replacing the iterative retriever with the proposed sparse fusion retriever, the EM score can reach $14 \%$ , a $4 . 5 \%$ absolute improvement. By replacing the single-block with the proposed cross-block reader, the EM score can reach $17 \%$ , a $7 \%$ absolute improvement. However, by combining the two strategies, the final EM score can reach $28 \%$ , with an $18 \%$ absolute improvement, which is greater than the sum of individual improvements. The observation suggests the two components can affect each other in a positive way. We conjecture that the fusion retriever is more likely to retrieve mutually-supportive blocks in a group, which makes the multi-hop reasoning across different blocks easier for the following cross-block reader. In comparison, the iterative retriever retrieves isolated table segments and passages separately, which can easily miss out on the bridging evidence for building the complete reasoning chain. Thus, the cross-block reader cannot maximize its advantage in reasoning across blocks.
+
+By removing the ICT pre-training and query augmentation, we observe that the Dev-EM score drops to $2 4 . 6 \%$ . By removing the GPT-2 query augmentation, the Dev-EM performance drops to $2 2 . 1 \%$ . These two results indicate the effectiveness of the proposed two strategies. By replacing the predicted hyperlinks with the oracle links, the fusion model performance can increase by $7 \%$ EM. This indicates that there is still plenty of room to improve for the table-passage fusion model.
+
+Linker/Retriever Results To understand the results more, we evaluate the standalone tablepassage entity linking accuracy and retriever recall.
+
+
+Figure 5: Entity linker performance (F1).
+
+
+Figure 6: Retriever performance $( \mathrm { H I T S } @ 4 \mathrm { K } )$
+
+We consider the following linking models: a) BM25 model, which directly uses the cell value to retrieve passages based on their titles without query augmentation, b) a Dual-Encoder model, which encodes the cell value and meta information into a query vector to compute dot-product over all the passage candidate to retrieve, c) a GPT-2 model, which first augments the cell value by the context and then uses BM25. We demonstrate our findings in Figure 5, and evaluate with table-segment-wise
+
+F1 score. We observe that directly using BM25 leads to compromised precision of $3 0 . 3 \%$ , which is mainly due to the lack of context information. By using a dual-encoder retriever, the precision can be improved to $42 \%$ . However, many table segments have either zero or multiple linked passages and can be better modeled by an auto-regressive retrieval process.
+
+We use $\mathrm { H I T S } @ 4 \mathrm { K }$ is used to measure the retriever performance, which indicates the chance of ground truth block existing in the retrieved 4096 subword tokens. The results are reported in Figure 6. We vary the steps of iterative retrievers to show the necessity of multi-hop retrieval in OTTQA. We observe that the 1-step retrieval has the lowest recall because the answer block in OTT-QA normally has a lower lexical overlap with the query. Adding the second retrieval step can greatly improve the recall, but adding the third retrieval hop has very little impact. In contrast to the iterative retriever, the fusion retriever can consistently improve the performance over the iterative setting for both sparse and dense setting. The sparse setting can rise from $3 5 . 8 \%$ to $4 8 . 1 \%$ indicating the advantage of ‘early’ fusion. The dense retriever’s improvement is more dramatic (from $2 7 . 2 \%$ to $5 2 . 4 \% )$ . We believe this is because the iterative retriever heavily relies on noisy synthetic inference chain data, while the fusion retriever does not require such a fine-grained supervision signal, thus less prone to noise. To better understand the retriever, we conduct detailed error analysis in Appendix C.
+
+# 6 RELATED WORK
+
+Table Retrieval: Tables are pervasive on the Web, there have been some studies on mining web tables to answer open-domain questions (Sun et al., 2016; Chakrabarti et al., 2020). In Sun et al. (2016), the authors have proposed a pipeline framework to first detect the topic entity and then generate a candidate chain, finally ranking chains to predict the answer cell. In Chakrabarti et al. (2020), the authors investigate different similarity matching features to retrieve tables from the web. Our paper is significantly different from these two studies in two aspects: 1) the previous papers use private small-scale datasets while we collect a large-scale dataset and release it for public use, 2) the previous studies are restricted to only using tables as evidence, while our paper considers a more realistic and challenging setting with both table and text corpus. Tables have been a ubiquitous information representation form to express semi-structured information. There has been a long-standing effort to utilize tables in natural language processing applications (Pasupat & Liang, 2015; Zhong et al., 2017; Yu et al., 2018; Parikh et al., 2020; Chen et al., 2019). However, these existing tasks are restricted to in-domain cases without requiring any retrieval, and our paper is the first to investigate retrieving web tables for downstream tasks. Another pair of related works are TAPAS (Herzig et al., 2020) and TABERT (Yin et al., 2020), which investigate joint pre-training over textual and tabular data. Our method draws inspiration from these models, and also uses special tokens and embeddings to encode spatial and logical operations inside tables.
+
+Long Range Transformer: Recently, many transformer variants to resolve the $\mathcal { O } ( n ^ { 2 } )$ attention cost have been proposed including Sparse Attention (Child et al., 2019), Reformer (Kitaev et al., 2020), Routing Transformer (Roy et al., 2020), Longformer (Beltagy et al., 2020) and ETC (Ainslie et al., 2020). These different transformer models apply hierarchical architecture, local-sensitive hashing, global-local state to decrease the attention complexity to nearly linear. Our cross-block reader is based on ETC (Ainslie et al., 2020), but unlike prior works that process one long document for QA, our task requires reading multiple blocks containing both structured and unstructured data. To handle the long sequence of retrieved documents in open-domain question answering, Fusionin-Decoder (Izacard & Grave, 2020) has been proposed to replace the extractive model with an encoder-decoder generative model. The long sequence of passages are split and encoded independently to decrease the computation complexity, but the decoder still uses full attention over the tens of thousands of encoded vectors to generate the answer token by token. Such full-attention can decrease the decoding speed by an order of magnitude, while our sparse-attention-based cross-block reader can still maintain the same speed as the standard BERT model.
+
+# 7 CONCLUSION
+
+We focus on the problem of performing open question answering over tables and text in this paper. By proposing the fusion retriever and sparse reader, we manage the increase the model’s effectiveness and efficiency by a large margin. One interesting question we would like to ask in the future is: can we extend open question answering system to more modalities like images or audios, etc?
+
+# 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 largescale machine learning. In 12th {USENIX} symposium on operating systems design and implementation $\left( \left\{ O S D I \right\} \ I \bar { 6 } \right)$ , pp. 265–283, 2016.
+
+Joshua Ainslie, Santiago Ontanon, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. Etc: Encoding long and structured data in transformers. Proceedings of EMNLP 2020, 2020.
+
+Akari Asai, Kazuma Hashimoto, Hannaneh Hajishirzi, Richard Socher, and Caiming Xiong. Learning to retrieve reasoning paths over wikipedia graph for question answering. In International Conference on Learning Representations, 2019.
+
+Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
+
+Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verifi- ¨ cation using a” siamese” time delay neural network. In Advances in neural information processing systems, pp. 737–744, 1994.
+
+Kaushik Chakrabarti, Zhimin Chen, Siamak Shakeri, and Guihong Cao. Open domain question answering using web tables. arXiv preprint arXiv:2001.03272, 2020.
+
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading wikipedia to answer opendomain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1870–1879, 2017.
+
+Wenhu Chen, Hongmin Wang, Jianshu Chen, Yunkai Zhang, Hong Wang, Shiyang Li, Xiyou Zhou, and William Yang Wang. Tabfact: A large-scale dataset for table-based fact verification. In International Conference on Learning Representations, 2019.
+
+Wenhu Chen, Hanwen Zha, Zhiyu Chen, Wenhan Xiong, Hong Wang, and William Wang. Hybridqa: A dataset of multi-hop question answering over tabular and textual data. Proceedings of Findings of EMNLP 2020, 2020.
+
+Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
+
+Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. Autoregressive entity retrieval. arXiv preprint arXiv:2010.00904, 2020.
+
+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.
+
+Bhuwan Dhingra, Manzil Zaheer, Vidhisha Balachandran, Graham Neubig, Ruslan Salakhutdinov, and William W Cohen. Differentiable reasoning over a virtual knowledge base. In International Conference on Learning Representations, 2019.
+
+Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2694–2703, 2019.
+
+Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. Proceedings of ICML 2020, 2020.
+
+Jonathan Herzig, Paweł Krzysztof Nowak, Thomas Muller, Francesco Piccinno, and Julian Martin ¨ Eisenschlos. Tapas: Weakly supervised table parsing via pre-training. ACL 2020, 2020.
+
+Gautier Izacard and Edouard Grave. Leveraging passage retrieval with generative models for open domain question answering. arXiv preprint arXiv:2007.01282, 2020.
+
+Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1601–1611, 2017.
+
+Vladimir Karpukhin, Barlas Oguz, Sewon Min, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen- ˘ tau Yih. Dense passage retrieval for open-domain question answering. EMNLP 2020, 2020.
+
+Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. ICLR, 2020.
+
+Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453–466, 2019.
+
+Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 6086–6096, 2019.
+
+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.
+
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. ICLR 2019, 2019.
+
+Sewon Min, Danqi Chen, Luke Zettlemoyer, and Hannaneh Hajishirzi. Knowledge guided text retrieval and reading for open domain question answering. arXiv preprint arXiv:1911.03868, 2019.
+
+Ankur P Parikh, Xuezhi Wang, Sebastian Gehrmann, Manaal Faruqui, Bhuwan Dhingra, Diyi Yang, and Dipanjan Das. Totto: A controlled table-to-text generation dataset. arXiv preprint arXiv:2004.14373, 2020.
+
+Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1470–1480, 2015.
+
+Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vassilis Plachouras, Tim Rocktaschel, et al. Kilt: a benchmark for knowl-¨ edge intensive language tasks. arXiv preprint arXiv:2009.02252, 2020.
+
+Peng Qi, Xiaowen Lin, Leo Mehr, Zijian Wang, and Christopher D Manning. Answering complex open-domain questions through iterative query generation. 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. 2590–2602, 2019.
+
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
+
+Stephen Robertson and Hugo Zaragoza. The probabilistic relevance framework: BM25 and beyond. Now Publishers Inc, 2009.
+
+Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers. arXiv preprint arXiv:2003.05997, 2020.
+
+Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William Cohen. Open domain question answering using early fusion of knowledge bases and text. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4231–4242, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1455. URL https://www.aclweb.org/anthology/ D18-1455.
+
+Haitian Sun, Tania Bedrax-Weiss, and William Cohen. PullNet: Open domain question answering with iterative retrieval on knowledge bases and text. 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. 2380–2390, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1242. URL https://www.aclweb.org/anthology/D19-1242.
+
+Huan Sun, Hao Ma, Xiaodong He, Wen-tau Yih, Yu Su, and Xifeng Yan. Table cell search for question answering. In Proceedings of the 25th International Conference on World Wide Web, pp. 771–782, 2016.
+
+Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D Manning. Hotpotqa: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2369–2380, 2018.
+
+Wen-tau Yih, Kristina Toutanova, John C Platt, and Christopher Meek. Learning discriminative projections for text similarity measures. In Proceedings of the fifteenth conference on computational natural language learning, pp. 247–256, 2011.
+
+Pengcheng Yin, Graham Neubig, Wen-tau Yih, and Sebastian Riedel. Tabert: Pretraining for joint understanding of textual and tabular data. ACL 2020, 2020.
+
+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 Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3911–3921, 2018.
+
+Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
+
+Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103, 2017.
+
+# A DATASET COLLECTION
+
+# A.1 DATASET ANNOTATION
+
+Filtering The original HybridQA dataset contains over $7 2 k$ questions paired with $1 3 k$ hyperlinked tables. We adopt two filtering heuristics to make the decontextualization easier. First, we filter out tables without enough meta-information or containing too much non-textual information3. Second, we filter out overly-long questions, i.e., questions longer than 30 words. These two filtering heuristics result in a cleaner subset of $4 6 k$ questions paired with $9 k$ in-domain tables.
+
+Quality Control During annotation, we conduct strict manual quality evaluation over the decontextualized questions, with the following criteria: 1) the annotated question retains the same semantics and answer as before, 2) the annotated question still requires multi-hop reasoning over both table and passages, and 3) the annotated question is concise and fluent. The manual quality checking was performed over batches distributed to the same annotator. Each batch consists of six questions, one of which will be sampled to decide the acceptance/rejection of the whole batch. The overall acceptance rate for the crowd-sourcing job is $71 \%$ , and a rejected job was re-distributed until it was accepted.
+
+# A.2 DATASET EXAMPLES
+
+We demonstrate more examples in Figure 7, which includes more diverse inference chains, like table text; text table text; text $^ +$ text comparative table. Our model is able to perform these reasoning types quite well by jointly matching a query against a fused table-text block.
+
+
+Figure 7: More examples from OTT-QA
+
+# A.3 QUESTION TYPES
+
+We randomly sampled 100 questions from the dataset to manually analyze the kinds of inference chains seen in OTT-QA and divide the major types into the following categories:
+
+1. Single hop questions $( 1 3 \% )$ require reading one table or one passage to answer. 2. Two hop questions $( 5 7 \% )$ require reading one passage and one table to answer. These can be subclassified as ‘table bridge’ ‘answer text’4 or ‘text bridge’ ‘answer table’.
+
+3. Multi-hop questions $( 3 0 \% )$ require reading two passages and one table to answer. These mainly following the reasoning chain of ‘text bridge’ ‘table bridge’ ‘answer text’.
+
+4. Questions with multiple reasoning paths: Due to information redundancy in Wikipedia, similar information can appear in both tables and text. We find that $9 \%$ of questions are answerable by reading one text passage, $18 \%$ of questions are answerable by reading two text passages and $4 \%$ of questions are answerable by reading two tables.
+
+# B MODEL DETAILS
+
+# B.1 RETRIEVAL BLOCK REPRESENTATION
+
+The table decomposition is visualized in Figure 8. The title/section title are prefixed to the table segment. We add the row position token ‘1st’ and a max/min special token over the column to infuse global table information into the segmented unit. The column embedding is added as another vector to the representation. The table segment representation is relatively small and easy to deal with in the following reader model. After the table-passage alignment, we group the highly related units together and represent them as the lower part demonstrated in Figure 8. We add [SEP] tokens to separate different passages and set their type id to 0. Such a flattened representation for fused block $b _ { F }$ will be used throughout our experiments for both sparse/dense retriever and ETC reader.
+
+
+Figure 8: The decomposition of the original table into segments.
+
+# B.2 ITERATIVE RETRIEVER
+
+Iterative retrieval has been used in recent graph-based multi-hop retrieval models to gradually retrieve documents to find the correct supporting evidence. Specifically, the retriever conditions the $i$ -th round retrieval on the previous round of retrieval results.
+
+Sparse Retriever The sparse retriever uses uni-gram lexical feature to compute the BM-25 score between the $q , . . , b _ { 1 . . j - 1 }$ over $b _ { j } \in \mathbb { B }$ to get the top candidates. Here we describe a two-step retrieval procedure, called here the LxM procedure. In the first step, the model calculates the BM25 score between question over all the candidates in $\mathbb { B }$ to select top $_ { \textrm { L } / 2 }$ table segments $b _ { T }$ , and $_ { \textrm { L } / 2 }$ passages $b _ { P }$ . In the second step, the question is concatenated with the retrieved table segment to form $_ { \textrm { L } / 2 }$ new queries $[ q ; b _ { T } ]$ which are used to retrieve LM/2 passages from $\mathbb { B }$ . The question is also concatenated with the retrieved passage titles to form another $\mathrm { \ K } / 2$ queries $[ q ; b _ { P } ]$ to retrieve LM/2 table segments. The retrieval procedure results in at most $_ { \mathrm { L M + L } }$ unique blocks. Each unique block aggregates its score from two rounds, denoted as $f ( \boldsymbol { q } , \boldsymbol { b } )$ , which is used to rank the top-K candidates for the next step. We truncate the top-K candidate by thresholding their combined length.
+
+Dual-Encoder Retriever The dual encoder uses a BERT-based encoder to compress each question, table segment, and passage into a fixed-length vector and then computes the dot product between fixed vectors to obtain the highest scored candidates from pool $\mathbb { B }$ . However, since the dataset does not provide an explicit supervision signal for the iterative retrieval, we heuristically synthesize some noisy retrieval chains using lexical matching. The retrieval inference chain is depicted as $b _ { 1 } b _ { 2 } b _ { K }$ , which is used to train the model $f ( b _ { k } | q , b _ { 1 \dots k - 1 } )$ in a supervised manner. At inference time, the dual encoder retriever will encode a query $q$ into a fixed vector and retrieve the first $L$ blocks from $\mathbb { B }$ . The blocks are appended to query $q$ to form $L$ new queries $[ q ; b _ { i } ]$ , which is re-encoded and search for $L M$ new neighbors. We experiment with a maximum of 3-step retrieval of $\mathbf { L x M x N }$ to obtain a maximum of $_ \mathrm { L + L x M + L M N }$ unique blocks. Similarly, each unique block aggregates its score from different rounds to select the top-K candidates for the next step.
+
+# B.3 SPARSE FUSED RETRIEVER
+
+The sparse fused retriever uses the uni-gram lexical feature to compute the BM-25 score between $q$ over $b _ { F } \in \mathbb { B } _ { F }$ . The uni-gram feature of $b _ { F }$ is based on the representation depicted in subsection B.1. Note that this BM25 feature will be much more abundant than the BM25 feature in iterative sparse retriever because it encloses more uni-grams. Instead of doing multiple rounds of retrieval, the fused retrieval once retrieve once over the candidate pool and treat all the units inside the block as the same retrieval score. Finally, We truncate the top- $\mathbf { \nabla } \cdot \mathbf { K }$ candidate by thresholding their combined length.
+
+# B.4 QUERY AUGMENTATION
+
+The query augmentation procedure is depicted in Figure 9.
+
+
+Figure 9: Fusion: 1) GPT-2 query augmentation, 2) nearest neighbor search over passages.
+
+# B.5 DENSE RETRIEVAL/IN-BATCH NEGATIVE
+
+Recently, different dense-retrieval methods (Lee et al., 2019; Guu et al., 2020; Karpukhin et al., 2020) based on dual-encoders (Bromley et al., 1994) have been shown to surpass traditional sparse retrieval in open-QA models. The query and the passage are both encoded using a Transformer, which produces a vector for every token. As in (Devlin et al., 2019), the vector corresponding to the first token, [CLS], which is used as a “pooled” representation of the sequence (denoted $\mathtt { B E R T } _ { \mathtt { C L S } } ,$ ). The dense retrieval function can be represented as the dot product between $\mathtt { B E R T } _ { \mathtt { C L S } } ( q )$ and $\mathtt { B E R T } _ { \mathtt { C L S } } ( p )$ for each document in the text collection, much like TF-IDF (Chen et al., 2017) and BM25 (Robertson & Zaragoza, 2009) on some Open QA datasets. To train the dual-encoder, the in-batch negative trick (Yih et al., 2011; Karpukhin et al., 2020) plays an important role, which uses B training instances in each batch and views the other B-1 instances inside the batch as the negatives. In this way, the model reuses computation and effectively trains on $B ^ { 2 }$ question/document pairs in each batch.
+
+# C PERFORMANCE ANALYSIS
+
+# C.1 QUESTION TYPE BREAKDOWN PERFORMANCE
+
+We measure our best model’s performance (dense fusion retriever $^ +$ cross-block reader) and baseline model (dense Iterative-Retriever $^ +$ single-block reader) on different question types (subsection A.3) to show the breakdown statistics in Figure 10 and Figure 11. As we can observe, the gap between our model vs. baseline in 1-hop question is less significant as 2-hop and 3-hop questions. The iterative retriever’s performance is sensitive to the number of hops in the question, which is the largely due to the error propagation in the beam search stage. If the retriever fails to include the golden block in the earlier stage beam, the retrieval in later stage cannot recover from such failure. In contrast, our fusion retriever can group the related information prior to retrieval to retrieve all the blocks at once, which makes the model less prone to the error propagation issue. Another reason is due to the cross-block reader, which can reason over different blocks in the latent space, such implicit reasoning can also decrease the error propagation issue. To sum up, our model is more powerful to deal with complex multi-hop open questions with much less performance drop.
+
+
+Figure 10: Breakdown for iterative retriever Figure 11: Breakdown for fusion retriever $^ +$ $^ +$ sing-block reader. cross-block reader.
+Figure 12: The main error types in the retriever.
+
+# C.2 RETRIEVER ERROR ANALYSIS
+
+We conduct error analysis to see what are the major issues with the retriever and conclude the following types in Figure 12. The major issues causing the system to retrieve unrelated evidence are low lexical overlap, fusion errors, numerical reasoning and distracting passages or tables. In the
+
+
Reason
Example
Groundtruth Block
Low Lexical Overlap
Where is the NYU Alumni from 1980 who now serves as.
Table: New York University Alumni in Politics and Science....
Error in Fusion
Who is the coach of Pittsburgh team in NCAA division I football team in 1980?
Table: List of NCAA Division I Cell: Pittsburgh
Fail to link to the passage: Pitsburgh Panthers
Numerical Reasoning
Who achieves the highest score in the Grand Prix 1980s Men's..
Table: List of Grand Prix 1980s Men’'s.
The time is not in regular format, SQL operation
Distraction
Where of 1990 Grammy Award winner for ... .come from in?
cannot select the max/min row. Table: Grammy Lifetime Achievement Award
Many tables from are about general "Grammy Awards",the groundtruth table only differentiate
Retriever Error Breakdown
from the others a little bit. Breakdown of Errors
40% 36% 32%
30% 24%
20%
28% 49%
10% 8%
23%
0% Retriever
+
+Low-Lexical-Overlap case, the errors are mainly coming from the abbreviation, rephrasing of the table metadata, for example, ‘New York University’ is shortened as ‘NYU’, etc. In the Fusion-Error case, the issue is mainly because the entity-linking model fails to fuse all the hyperlinked passages, the error $( \mathrm { F 1 } { = } 5 0 \%$ ) is quantitatively reflected in the entity-linker-performance figure. NumericalReasoning error is mainly related to the failure to find max/min/earliest/latest row in the table. The distraction error is mainly caused by some distracting passages or tables having very similar information. We sample 50 error samples from the dev-set and attribute their errors to the above categories. As shown in the left part, we found that the numerical reasoning error is not as severe as the other three types because the proportion of questions requiring it is relatively small. Besides the low-lexical overlap error, which is general across other open QA datasets like NQ and HoptpotQA, we found the fusion and distraction errors quite specific in our dataset.
+
+• (Fusion) Questions which ask about tables which are linked to too many linked passages. For example, a question over table “Team Record” in https://en.wikipedia.org/ wiki/Sevens_Grand_Prix_Series is hard because some table rows associate with over 10 passages, it’s hard to link them and fuse all of them into a fused block. (Distraction) Questions which ask about topics which are contained by too many similar tables, it’s hard to differentiate the true one. For example, there are over ten tables in https://en.wikipedia.org/wiki/List_of_RMIT_University_ people, these similar tables can easily distract the attention of the retriever to select the wrong one from the same page.
+
+From our quantitative results, we can attribute the errors to retriever and reader, among all the examples, $49 \%$ of examples cannot find the correct supporting block. For the rest $51 \%$ examples with correct block retrieved, the reader fails to select the correct span for $23 \%$ of them.
+
+# C.3 LENGTH SENSITIVITY ANALYSIS OF RETRIEVAL/READER
+
+
+We perform sensitivity analysis for both retriever and reader in Figure 13. We gradually increase
+Figure 13: Analyzing retriever performance.
+
+the length limit of retrieved evidence from 400 to 4096 to first visualize its impact on the sparse iterative and dense fusion retriever. For both fusion and iterative retriever, we can observe that both of their recall $@ \mathrm { K }$ significantly improves as the length limit increases. With a low budget of token limit, their performance is gap is smaller because its performance is dominated by the singlehop questions in the dataset. As the length limit increases, the improvement for fusion retriever is steeper than iterative retriever because the contextualized fusion block becomes easier to retrieve than standalone table segment or passage.
+
+We also visualize the input length’s impact on the single-block The performance of single vs crossblock reader. With a low budget of token limit, both single-block and cross-block readers are comparable. However, as the limit increases to 4000, the cross-block reader can digest long input with its sparse attention mechanism to achieve better scores, while the single-block reader needs to truncate the information to read independently, which leads to a even lower EM score due to introduced noise. This observation reveals the importance of modeling cross-attention between different retrieved evidence units to reach a consistent answer. In single-block reader, dealing with different blocks independently can lead to suboptimal prediction in our dataset.
+
+# D CONNECTION TO EXISTING WORK
+
+KB and Text The problem combining structured and unstructured data has been studied in question answering. The previous approaches are mainly divided into two categories: 1) FusionNet and PullNet (Sun et al., 2018; 2019) simulate a KB-incomplete setting by masking out some triples from a knowledge graph and use textual information to complete the masked KB triples; these experiments are conducted on KB-based QA datasets. 2) DrKIT (Dhingra et al., 2019) and KnowledgeGuided Retrieval (Min et al., 2019) propose to use entity mentions and relations to guide the retrieval from the web. However, the KB is mainly used as an assisting tool, rather than a necessary information source. In OTT-QA, the structured data is used as necessary information in a realistic setting. The two information forms are combined in a non-trivial way, which makes the problem much harder than the other structure-unstructured QA settings.
+
+Entity Linking Our generative entity linker is related to knowledge-enhanced language understanding (Petroni et al., 2020), which proposes a seq2seq model to deal with different knowledge-intensive tasks like slot filling, entity linking, etc. There is a concurrent related work on auto-regressive entity linking (De Cao et al., 2020), which also demonstrates the advantages of using an autoregressive generation model for entity retrieval.
\ No newline at end of file
diff --git a/md/train/NGPmH3vbAA_/NGPmH3vbAA_.md b/md/train/NGPmH3vbAA_/NGPmH3vbAA_.md
new file mode 100644
index 0000000000000000000000000000000000000000..3755a830d667a83a900dc1889c00efa00295f94e
--- /dev/null
+++ b/md/train/NGPmH3vbAA_/NGPmH3vbAA_.md
@@ -0,0 +1,281 @@
+# Scaling Vision with Sparse Mixture of Experts
+
+Carlos Riquelme ∗ Google Brain
+
+Joan Puigcerver \* Google Brain
+
+Basil Mustafa \* Google Brain
+
+Maxim Neumann Google Brain
+
+Rodolphe Jenatton Google Brain
+
+André Susano Pinto Google Brain
+
+Daniel Keysers Google Brain
+
+Neil Houlsby Google Brain
+
+# Abstract
+
+Sparsely-gated Mixture of Experts networks (MoEs) have demonstrated excellent scalability in Natural Language Processing. In Computer Vision, however, almost all performant networks are “dense”, that is, every input is processed by every parameter. We present a Vision MoE (V-MoE), a sparse version of the Vision Transformer, that is scalable and competitive with the largest dense networks. When applied to image recognition, V-MoE matches the performance of state-ofthe-art networks, while requiring as little as half of the compute at inference time. Further, we propose an extension to the routing algorithm that can prioritize subsets of each input across the entire batch, leading to adaptive per-image compute. This allows V-MoE to trade-off performance and compute smoothly at test-time. Finally, we demonstrate the potential of V-MoE to scale vision models, and train a 15B parameter model that attains $9 0 . 3 5 \%$ on ImageNet.
+
+# 1 Introduction
+
+Deep learning historically shows that increasing network capacity and dataset size generally improves performance. In computer vision, large models pre-trained on large datasets often achieve the state of the art [57, 50, 36, 20, 3]. This approach has had even more success in Natural Language Processing (NLP), where large pre-trained models are ubiquitous, and perform very well on many tasks [48, 18]. Text Transformers [61] are the largest models to date, some with over 100B parameters [9]. However, training and serving such models is expensive [56, 46]. This is partially because these deep networks are typically “dense”– every example is processed using every parameter –thus, scale comes at high computational cost. In contrast, conditional computation [5] aims to increase model capacity while keeping the training and inference cost roughly constant by applying only a subset of parameters to each example. In NLP, sparse Mixture of Experts (MoEs) are gaining popularity [54, 39, 22], enabling training and inference with fewer resources while unlocking trillion parameter models.
+
+In this work, we explore conditional computation for vision at scale. We introduce the Vision MoE (V-MoE), a sparse variant of the recent Vision Transformer (ViT) architecture [20] for image classification. The V-MoE replaces a subset of the dense feedforward layers in ViT with sparse MoE layers, where each image patch is “routed” to a subset of “experts” (MLPs). Due to unique failure modes and non-differentiability, routing in deep sparse models is challenging. We explore various design choices, and present an effective recipe for the pre-training and transfer of V-MoE, notably outperforming their dense counterparts. We further show that V-MoE models are remarkably flexible. The performance vs. inference-cost trade-off of already trained models can be smoothly adjusted during inference by modulating the sparsity level with respect to the input and/or the model weights. Also, we open-source our implementation and a number of V-MoE models trained on ImageNet-21k.2
+
+
+Figure 1: Overview of the architecture. V-MoE is composed of $L$ ViT blocks. In some, we replace the MLP with a sparsely activated mixture of MLPs. Each MLP (the expert) is stored on a separate device, and processes a fixed number of tokens. The communication of these tokens between devices = expert uses a capacity ratio C = 43 : the sparse MoE layer receives 12 tokens per device, but each is shown in this example, which depicts the case when $k = 1$ expert is selected per token. Here each expert has capacity for 16 ( $\textstyle \frac { 1 6 \cdot 1 } { 1 2 } = \frac { 4 } { 3 }$ ; see Section 2.4). Non-expert components of V-MoE such as routers, attention layers and normal MLP blocks are replicated identically across devices.
+
+With V-MoE, we can scale to model sizes of 15B parameters, the largest vision models to date. We match the performance of state-of-the-art dense models, while requiring fewer time to train. Alternatively, V-MoE can match the cost of ViT while achieving better performance. To help control this tradeoff, we propose Batch Prioritized Routing, a routing algorithm that repurposes model sparsity to skip the computation of some patches, reducing compute on uninformative image regions.
+
+We summarize our main contributions as follows:
+
+Vision models at scale. We present the Vision Mixture of Experts, a distributed sparsely-activated Transformer model for vision. We train models with up to $2 4 \mathrm { M o E }$ layers, 32 experts per layer, and almost 15B parameters. We show that these models can be stably trained, seamlessly used for transfer, and successfully fine-tuned with as few as 1 000 datapoints. Moreover, our largest model achieves $9 0 . 3 5 \%$ test accuracy on ImageNet when fine-tuned.
+
+Performance and inference. We show V-MoEs strongly outperform their dense counterparts on upstream, few-shot and full fine-tuning metrics in absolute terms. Moreover, at inference time, the V-MoE models can be adjusted to either (i) match the largest dense model’s performance while using as little as half the compute, or actual runtime, or (ii) significantly outperform it at the same cost.
+
+Batch Prioritized Routing. We propose a new priority-based routing algorithm that allows V-MoEs to discard the least useful patches. Thus, we devote less compute to each image. In particular, we show V-MoEs match the performance of the dense models while saving $20 \%$ of the training FLOPs. Analysis. We provide some visualization of the routing decisions, revealing patterns and conclusions which helped motivate design decisions and may further improve understanding in the field.
+
+# 2 The Vision Mixture of Experts
+
+We first describe MoEs and sparse MoEs. We then present how we apply this methodology to vision, before explaining our design choices for the routing algorithm and the implementation of V-MoEs.
+
+# 2.1 Conditional Computation with MoEs
+
+Conditional computation aims at activating different subsets of a network for different inputs [5]. A mixture-of-experts model is a specific instantiation whereby different model “experts” are responsible for different regions of the input space [31].
+
+We follow the setting of [54], who present for deep learning a mixture of experts layer with $E$ experts as $\begin{array} { r } { \mathrm { M o E } ( \mathbf { x } ) = \sum _ { i = 1 } ^ { E } g ( \mathbf { x } ) _ { i } e _ { i } ( \mathbf { x } ) } \end{array}$ where $\mathbf { x } \in \mathbb { R } ^ { D }$ is the input to the layer, $\boldsymbol { e } _ { i } : \mathbb { R } ^ { \boldsymbol { \bar { D } } } \mapsto \mathbb { R } ^ { D }$ the function computed by expert $i$ , and $g : \mathbb { R } ^ { D } \mapsto \mathbb { R } ^ { E }$ is the “routing” function which prescribes the input-conditioned weight for the experts. Both $e _ { i }$ and $g$ are parameterized by neural networks. As defined, this is still a dense network. However, if $g$ is sparse, i.e., restricted to assign only $k \ll E$ non-zero weights, then unused experts need not be computed. This unlocks super-linear scaling of the number of model parameters with respect to inference and training compute.
+
+# 2.2 MoEs for Vision
+
+We explore the application of sparsity to vision in the context of the Vision Transformer (ViT) [20]. ViT has been shown to scale well in the transfer learning setting, attaining better accuracies than CNNs with less pre-training compute. ViT processes images as a sequence of patches. An input image is first divided into a grid of equal-sized patches. These are linearly projected to the Transformer’s [61] hidden size. After adding positional embeddings, the patch embeddings (tokens) are processed by a Transformer, which consists predominately of alternating self-attention and MLP layers.
+
+The MLPs have two layers and a GeLU [29] non-linearity: $\mathrm { M L P } ( \mathbf { x } ) = \mathbf { W } _ { \mathrm { 2 } } \ \sigma _ { \mathrm { g e l u } } ( \mathbf { W } _ { \mathrm { 1 } } \mathbf { x } )$ . For Vision MoE, we replace a subset of these with MoE layers, where each expert is an MLP; see Figure 1. The experts have the same architecture $e _ { i } ( { \bf x } ) = \mathrm { M L P } _ { \theta _ { i } } ( { \bf x } )$ but with different weights $\theta _ { i } = \left( \mathbf { W } _ { 1 } ^ { i } , \mathbf { W } _ { 2 } ^ { i } \right)$ . =This follows a similar design pattern as the M4 machine translation model [39].
+
+# 2.3 Routing
+
+For each MoE layer in V-MoE, we use the routing function $g ( \mathbf { x } ) \mathbf { \Psi } = \mathrm { T O P } _ { k }$ softmax $\left( \mathbf { W } \mathbf { x } + \epsilon \right)$ , where $\mathrm { T O P } _ { k }$ is an operation that sets all elements of the vector to zero except the elements with the largest $k$ values, and $\epsilon$ is sampled independently $\epsilon \sim \mathcal { N } ( 0 , \frac { 1 } { E ^ { 2 } } )$ entry-wise. In practice, we use $k = 1$ or $k = 2$ . In the context of the Vision Transformer, $\mathbf { x }$ =is a representation of an image token at some =layer of the network. Therefore, V-MoE routes patch representations, not entire images.
+
+The difference between previous formulations [54] is that we apply $\mathrm { T O P } _ { k }$ after the softmax over experts weights [39], instead of before. This allows us to train with $k = 1$ (otherwise gradients with respect to routings are zero almost everywhere) and also performs better for $k > 1$ (see Appendix A).
+
+Finally, we add a small amount of noise with standard deviation $\frac { 1 } { E }$ to the activations $\mathbf { W } \mathbf { x }$ . We empirically found this performed well but that the setup was robust to this parameter. The noise typically altered routing decisions ${ \sim } 1 5 \%$ of the time in earlier layers, and ${ \sim } 2 { - } 3 \%$ in deeper layers.
+
+# 2.4 Expert’s Buffer Capacity
+
+During training, sparse models may favor only a small set of experts [26, 52]. This common failure mode can cause two problems. First, statistical inefficiency: in the limit of collapse to a single expert, the model is no more powerful than a dense model. Second, computational inefficiency: imbalanced assignment of items to experts may lead to a poor hardware utilization.
+
+To combat imbalance and simplify our implementation, we fix the buffer capacity of each expert (i.e. the number of tokens that each expert processes), and train our model with auxiliary losses that encourage load balancing. This is essentially the same approach as followed by [54, 39, 22]. In our case, we use slight variants of two of the auxiliary losses proposed in [54], as described in Appendix A.
+
+We define the buffer capacity of an expert $( B _ { e } )$ as a function of the number of images in the batch number of experts $( N )$ , the number of tokens per image $( E )$ , and the capacity ratio $( P )$ , the number of selected experts per token $( C )$ : $B _ { e } =$ round $\textstyle \left( { \frac { k N P C } { E } } \right)$ . $( k )$ , the total
+
+If the router assigns more than $B _ { e }$ tokens to a given expert, only $B _ { e }$ of them are processed. The remaining tokens are not entirely ‘lost’ as their information is preserved by residual connections (the top diagram of Figure 1). Also, if $k > 1$ , several experts try to process each token. Tokens are never >fully discarded. If an expert is assigned fewer than $B _ { e }$ tokens, the rest of its buffer is zero-padded.
+
+We use the capacity ratio to adjust the capacity of the experts. With $C > 1$ , a slack capacity is added to account for a potential routing imbalance. This is typically useful for fine-tuning when the new data might come from a very different distribution than during upstream training. With $C < 1$ , the router is forced to ignore some assignments. In Section 4 we propose a new algorithm that takes advantage of setting $C \ll 1$ to discard the least useful tokens and save compute during inference.
+
+# 3 Transfer Learning
+
+In this section, we first present training different variants of V-MoE on a large dataset (Section 3.2) in order to be used for Transfer Learning afterwards. The ability to easily adapt our massive models to new tasks, using a small amount of data from the new task, is extremely valuable: it allows to amortize the cost of pre-training across multiple tasks. We consider two different approaches to Transfer Learning: linear few-shot learning on fixed representations and full fine-tuning of the model.
+
+# 3.1 Models
+
+We build V-MoE on different variants of ViT [20]: ViT-S(mall), ViT-B(ase), ViT-L(arge) and ViTH(uge), the hyperparameters of which are described in Appendix B.5. There are three additional major design decisions that affect the cost (and potentially the quality) of our model:
+
+Number of MoE layers. Following [39], we place the MoEs on every other layer (we refer to these as V-MoE Every-2). In addition, we experimented with using fewer MoE layers, by placing them on the last- $\boldsymbol { n }$ even blocks (thus we dub these V-MoE Last-n). In Appendix E.1 we observe that, although using fewer MoE layers decreases the number of parameters of the model, it has typically little impact on quality and can speed-up the models significantly, since less communication overhead is incurred.
+
+Number of selected experts $k$ : The cost of our model does not depend on the total number of experts but the number of selected ones per token. Concurrent works in NLP fix $k = 1$ [22] or $k = 2$ [54, 39]. In our case, we use by default $k = 2$ (see Figure 10 in Appendix B for the exploration of different values of $k$ ), while we found the total number of experts $E = 3 2$ to be the sweet spot in our setting.
+
+Buffer capacity $C$ : As mentioned in Section 2.4, we use a fixed buffer capacity. While this is typically regarded as a downside or engineering difficulty to implement these models, we can adjust the capacity ratio to control different trade-offs. We can intentionally set it to a low ratio to save compute, using Batch Prioritized Routing (see Section 4). During upstream training, we set $C = 1 . 0 5$ by default to give a small amount of slack without increasing the cost noticeably.
+
+Note that for a given trained model, the latter two— $k$ and $C$ —can be adjusted without further training, whereas the positioning and quantity of expert layers is effectively fixed to match pre-training.
+
+# 3.2 Data
+
+We pre-train our models on JFT-300M [57], a semi-automatically noisy-labeled dataset. It has $\sim 3 0 5 \mathrm { M }$ training and 50 000 validation images, organised in a hierarchy of 18 291 classes (average 1.89 labels per image). We deduplicate it with respect to all our validation/test sets as in previous efforts [36].3
+
+Our few-shot experiments on ImageNet (i.e. ILSVRC2012) use only 1, 5, or 10 shots per class to adapt the upstream model, evaluating the resulting model on the validation set.
+
+We also fine-tuned the pre-trained models on the full training set (ca. 1M images). We report performance in a similar regime for four other datasets in Appendix B.5. Lastly, we explore the ability to fine-tune our large models in the low-data regime by evaluating them on the Visual Task Adaptation Benchmark (VTAB) [69], a diverse suite of 19 tasks with only 1 000 data points per task. As well as natural image classification, VTAB includes specialized tasks (e.g. medical or satellite imagery) and structured tasks (e.g. counting or assessing rotation/distance).
+
+# 3.3 Upstream results
+
+JFT is a multilabel dataset, so we measure model performance via precision $@ 1$ (see Appendix B.6 for details). Note that as in previous works [20], hyperparameters were tuned for transfer performance, and JFT precision could be improved at the expense of downstream tasks e.g. by reducing weight decay. Figure 2a shows the quality of different V-MoE and ViT variants with respect to total training compute and time. It shows models that select $k = 2$ experts and place MoEs in the last $n$ even blocks $\hslash = 5$ for V-MoE-H, $n = 2$ otherwise), but the best results are achieved by V-MoE-H/14 Every-2 (see Table 2, 14 is the patch size). L/16’s are trained for 7 or 14 epochs. See Appendix B.5 for all results.
+
+
+Figure 2: JFT-300M Precision $@ 1$ and ImageNet 5-shot accuracy. Colors represent different ViT variants, markers represent either standard ViT or V-MoEs on the last $n$ even blocks. The lines represent the Pareto frontier of ViT (dashed) and V-MoE (solid) variants.
+
+
+Figure 3: ImageNet Fine-Tuning Accuracy. Colors represent different VIT variants, markers represent either standard ViT or V-MoEs on the last $n$ even blocks. Lines show the Pareto frontier of VIT (dashed) and V-MoE (solid).
+
+Table 1: VTAB. Scores and $9 5 \%$ confidence intervals for ViT and V-MoE.
+
+
ViT
V-MoE
L/16 76.3±0.5
77.2±0.4
H/14 77.6±0.2
77.8±0.4
+
+Expert models provide notable gains across all model sizes, for only a mild increase in FLOPs, establishing a new Pareto frontier (gray lines). Alternatively, we can match or improve performance of ViT models at lower cost (e.g. V-MoE-L/16 improves upon ViT-H/14). Similar conclusions hold for training time, which includes communication overhead of dispatching data across devices.
+
+# 3.4 Linear few-shot results
+
+We evaluate the quality of the representations learned using few-shot linear transfer. Given training examples from the new dataset $\{ ( X , Y ) _ { i } \}$ , we use the pre-trained model $\mathcal { M }$ to extract a fixed representation $\mathcal { M } ( x _ { i } )$ of each image. We fit a linear regression model mapping $\mathcal { M } ( x _ { i } )$ to the one-hot encoding of the target labels $Y _ { i }$ , following [20] (see [27, Chapter 5] for background).
+
+Figure 2b shows that the upstream gains are preserved under 5-shot ImageNet evaluation, considering both compute and time; in other words, the quality of the representations learned by V-MoE also outperforms ViT models when looking at a new task. Table 2 further shows the results on $\{ 1 , 1 0 \}$ -shot for some selected models, and the full detailed results are available in Appendix B.5.
+
+# 3.5 Full fine-tuning results
+
+The typically most performant approach for Transfer Learning [19] consists of replacing the upstream classification head with a new task-specific one and fine-tuning the whole model. Though one may expect that massive models like V-MoEs require special handling for fine-tuning, we broadly follow the standard fine-tuning protocol for Vision Transformers. We use the auxiliary loss during fine-tuning as well, although we observe that it is often not needed in this step, as the router is already well trained. We explore the two sets of tasks considered therein:
+
+
+Figure 4: White patches are discarded tokens in the first layer of experts, for different capacities, using Batch Prioritized Routing (Section 4.1) with a V-MoE-H/14. See Appendix D for more examples.
+
+Full data. We follow the setup of [20], except that we apply a dropout rate of 0.1 on the expert MLPs (as done in [22]), and we halve the number of fine-tuning steps for all datasets other than ImageNet. Figure 3 shows the results on ImageNet (averaged over three runs). Here, V-MoE also performs better than dense counterparts, though we suspect the fine-tuning protocol could be further improved and tailored to the sparse models. See Table 8 for all details, including results on other datasets.
+
+Low-data regime. On the VTAB benchmark, we use a similar setup and hyperparameter budget as [20] (but fine-tune with half the schedule length). Table 1 shows that, while performance is similar for V-MoE-H/14, experts provide significant gains at the ViT-L/16 level, indicating that despite the large size of these models, they can still be fine-tuned with small amounts of data and no further tricks.
+
+# 3.6 Scaling up V-MoE
+
+Finally, we test how well V-MoE can scale vision models to a very large number of parameters, while continuing to improve performance. For this, we increase the size of the model and use a larger pre-training dataset: JFT-3B is a larger version of JFT-300M, it contains almost 3B images and is noisily annotated with 30k classes. Inspired by [68], we apply the changes detailed in Appendix B.3, and train a 48-block V-MoE model, with every-2 expert placement (32 experts and $k = 2$ ), resulting in a model with 14.7B parameters, which we denote by V-MoE-15B.
+
+We successfully train V-MoE-15B, which is, as far as we are aware, the largest vision model to date. It has an impressive $8 2 . 7 8 \%$ accuracy on 5-shot ImageNet and $9 0 . 3 5 \%$ when fully fine-tuned, as shown in Appendix B.5, which also includes more details about the model. Training this model required $1 6 . 8 \mathrm { k }$ TPUv3-core-days. To contextualize this result, the current state of the art on ImageNet is Meta Pseudo-Labelling (MPL) [49]. MPL trains an EfficientNet-based model on unlabelled JFT-300M using ImageNet pseudo-labelling, achieving $9 0 . 2 \%$ while requiring $2 2 . 5 \mathrm { k }$ TPUv3-core-days.
+
+# 4 Skipping Tokens with Batch Prioritized Routing
+
+We present a new routing algorithm that allows the model to prioritize important tokens (corresp. patches). By simultaneously reducing the capacity of each expert, we can discard the least useful tokens. Intuitively, not every patch is equally important to classify a given image, e.g., most background patches can be dropped to let the model only focus on the ones with the relevant entities.
+
+# 4.1 From Vanilla Routing to Batch Prioritized Routing
+
+With the notation from Section 2, the routing function $\mathbf { X } \in \mathbb { R } ^ { N \cdot P \times D }$ . A batch contains $N$ images composed of $P$ $g$ is applied row-wise to a batch of inputs tokens each; each row of $\mathbf { X }$ corresponds to the $D$ -dimensional representation of a particular token of an image. Accordingly, $g ( \mathbf { X } ) _ { t , i } \in \mathbb { R }$ denotes the routing weight for the $t$ -th token and the $i$ -th expert.
+
+
+Figure 5: Reducing compute with priority routing. Performance vs. inference FLOPs for large models. V-MoEs with the original vanilla routing are represented by $\bullet$ , while $\mid$ shows V-MoEs where BPR and a mix of $C \in \{ 0 . 6 , 0 . 7 , 0 . 8 \}$ and $k \in \{ 1 , 2 \}$ are used to reduce compute. ViT models shown as $\mathbf { x }$ .
+
+
+Figure 6: Priority routing works where vanilla fails. Performance vs. inference capacity ratio for a V-MoE-H/14 model with $k = 2$ . Even for large $C$ ’s BPR outperforms vanilla; at low $C$ the difference is stark. BPR is competitive with dense by processing only $1 5 { - } 3 0 \%$ of the tokens.
+
+In all routing algorithms considered, for $i < j$ , every TOP- $i$ assignment has priority over any TOP- $j$ 0$ is the stepsize and $\nabla f ( x ^ { k } ; \xi ^ { k } )$ is the stochastic gradient at the iterate $x ^ { k }$ and the sample $\xi ^ { k }$ . However, many problems in machine learning today, such as meta learning, deep learning, hyper-parameter optimization, and reinforcement learning, go beyond the above simple minimization structure (termed the non-nested problem thereafter). For example, the objective function may be the compositions of multiple functions, where each composition may introduce an additional expectation [2]; and, the objective function may depend on the solution of another optimization problem [3]. In these problems, how to apply SGD and the efficiency of running SGD are not fully understood.
+
+To answer these questions, in this paper, we consider the following form of stochastic nested optimization problems, which is a generalization of the non-nested problems, given by
+
+$$
+\begin{array} { r l } { \underset { x \in \mathbb { R } ^ { d } } { \operatorname* { m i n } } } & { F ( x ) : = \mathbb { E } _ { \xi } \left[ f \left( x , y ^ { * } ( x ) ; \xi \right) \right] } \\ { \mathrm { s . t . ~ } } & { y ^ { * } ( x ) = \underset { y \in \mathbb { R } ^ { d ^ { \prime } } } { \operatorname { a r g m i n } } \ \mathbb { E } _ { \phi } [ g ( x , y ; \phi ) ] } \end{array}
+$$
+
+where $f$ and $g$ are differentiable functions; and, $\xi$ and $\phi$ are random variables. In the optimization literature [4–6], the problem (1) is referred to as the stochastic bilevel problem, where the upper-level optimization problem depends on the solution of the lower-level optimization over $y \in \mathbb { R } ^ { d ^ { \prime } }$ , denoted as $y ^ { \ast } ( x )$ , which depends on the value of upper-level variable $\boldsymbol { x } \in \mathbb { R } ^ { d }$ .
+
+The stochastic bilevel nested problem (1) encompasses two popular formulations with the nested structure: stochastic min-max problems and stochastic compositional problems. Therefore, results on the general nested problem (1) will also imply the results in the special cases. For example, if the lower-level objective $g$ is the negative of the upper-level objective $f$ , i.e., $g ( x , y ; \phi ) : = - \bar { f } ( x , y ; \xi )$ , the stochastic bilevel problem (1) reduces to the stochastic min-max problem
+
+$$
+\operatorname { I f } g ( x , y ; \phi ) : = - f ( x , y ; \xi ) \quad \Rightarrow \quad \operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } F ( x ) : = \operatorname* { m a x } _ { y \in \mathbb { R } ^ { d ^ { \prime } } } \mathbb { E } _ { \xi } \left[ f ( x , y ; \xi ) \right] .
+$$
+
+Motivated by applications in zero-sum games, adversarial learning and training GANs, significant efforts have been recently made for solving the stochastic min-max problem; see e.g., [7–11].
+
+For example, if the upper-level objective $f$ is only a function of $y$ , i.e., $f ( x , y ; \xi ) : = f ( y ; \xi )$ , and the lower-level objective $g$ is a quadratic function of $y$ , i.e., $g ( x , y ; \phi ) : = \| y - h ( x ; \phi ) \| ^ { 2 }$ with a smooth function $h$ of $x$ , then the variable $y ^ { * } ( x )$ admits a closed-form solution, and thus the stochastic bilevel problem (1) reduces to the stochastic compositional problem [12–14]
+
+$$
+\mathrm { I f } \ g ( x , y ; \phi ) : = \| y - h ( x ; \phi ) \| ^ { 2 } \quad \Rightarrow \quad \operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } \ F ( x ) : = \mathbb { E } _ { \xi } \left[ f \big ( \mathbb { E } _ { \phi } [ h ( x ; \phi ) ] ; \xi \big ) \right] .
+$$
+
+Stochastic compositional problems in the form of (3) have been studied in the applications in model-agnostic meta learning and policy evaluation in reinforcement learning; see e.g., [2, 15].
+
+To solve the nested problem (1) by SGD, one natural solution is to apply alternating SGD updates on $x$ and $y$ based on their stochastic gradients
+
+$$
+y ^ { k + 1 } = y ^ { k } - \beta _ { k } h _ { g } ^ { k } ~ \mathrm { a n d } ~ x ^ { k + 1 } = x ^ { k } - \alpha _ { k } h _ { f } ^ { k }
+$$
+
+where $h _ { g } ^ { k }$ is the unbiased stochastic gradient of $\mathbb { E } _ { \phi } [ g ( x ^ { k } , y ^ { k } ; \phi ) ]$ and $h _ { f } ^ { k }$ is the (possibly biased) stochastic gradient of $F ( x ^ { k } )$ ; and, $\beta _ { k }$ and $\alpha _ { k }$ are the stepsizes. A key challenge of running (4) for the nested problem is that (stochastic) gradient of the upper-level variable $x$ is prohibitively expensive to compute. As we will show later, computing an unbiased stochastic gradient of $F ( x )$ requires solving the lower-level problem exactly to obtain $y ^ { * } ( x )$ .
+
+An accurate stochastic gradient $h _ { f } ^ { k }$ can be obtained in roughly three ways. One way is to run SGD updates on $y ^ { k }$ multiple times before updating $x ^ { k }$ , which yields a double-loop algorithm. To guarantee convergence, it typically requires either the increasing number of lower-level $y$ -update or the growing number of batch size to estimate $h _ { g } ^ { k }$ ; see e.g., [16, 17]. The second way is to update $y ^ { k }$ in a timescale faster than that of $x ^ { k }$ so that $x ^ { k }$ is relatively static with respect to $y ^ { k }$ ; i.e., $\scriptstyle \operatorname* { l i m } _ { k \to \infty } \alpha _ { k } / \beta _ { k } = 0$ ; see e.g., [18]. The third way is to modify the direction $h _ { g } ^ { k }$ of $y ^ { k }$ by incorporating additional correction term, which adds extra computation burden; see e.g., [19]. At a high level, these modifications either deviate from the lightweight implementation of SGD or sacrifice the sample complexity of SGD.
+
+To this end, the main goal of this paper is to study the efficiency of running the vanilla alternating SGD (4) for the nested problem (1) and its implications on the special problem classes (2)-(3).
+
+# 1.1 Main results
+
+This paper analyzes a unifying algorithm for the stochastic bilevel problems that runs SGD on each variable alternatingly. We provide sample complexity that matches the complexity of SGD for single-level stochastic problems. Our results explain why SGD-type algorithms in stochastic bilevel, min-max, and compositional problems work very well in practice without modifications, including correction, increasing batch size, and two-timescale stepsizes.
+
+In the context of existing methods, our contributions can be summarized as follows.
+
+C1) We connect three different classes of stochastic nested optimization problems (stochastic compositional, min-max, and bilevel optimization), and unify three popular SGD-type updates for the respective problems into a single SGD-type method. We call it the ALternating Stochastic gradient dEscenT (ALSET) method.
+
+
ALSET
BSA
TTSA
stocBiO
STABLE
SUSTAIN/RSVRB
batch size
0(1)
0(1)
0(1)
0(c-1)
0(1)
0(1)
y-update
SGD
O(c-))SGD steps
SGD
SGD
correction
momentum
samples in gsamples in
(5∈-2)(-2)
(k-2)(-3)
O(KPe-(P-
(5∈-2)(-2)
O(KPe-2)O(KPe-2)
O(KP-2)(P
+
+Table 1: Sample complexity of stochastic bilevel algorithms (BSA in [16], TTSA in [18], stocBiO in [17], STABLE in [19], SUSTAIN in [25], RSVRB in [26]) to achieve an $\epsilon$ -stationary point of $F ( x )$ ; the notation $\widetilde { \mathcal { O } } ( \cdot )$ hides the terms of $\log \epsilon ^ { - 1 }$ ; the notation $\kappa ^ { p }$ denotes a polynomial function of $\kappa$ since the dependence on $\kappa$ is not explicit in [18, 19, 25, 26].
+
+C2) Under the same assumptions made in most of the previous work, we discover that the solution of the lower-level problem is smooth – a property that is overlooked by the previous analyses. By leveraging the hidden smoothness, we present a tighter analysis of ALSET for the stochastic bilevel problems. Under the new analysis, to achieve an $\epsilon$ -stationary point of the nested problem, ALSET requires $\mathcal { O } ( \epsilon ^ { - 2 } )$ samples in total, rather than the $\mathcal { O } \dot { ( \epsilon ^ { - 5 / 2 } ) }$ sample complexity in the existing literature.
+C3) We further customize the analysis to the two special cases – the compositional and min-max problems, and establish the improved sample complexity relative to that in the literature. We apply a new analysis to the celebrated actor-critic method for reinforcement learning problems. Under some regularity conditions, we show that, to achieve an $\epsilon$ -stationary point, the single-loop actor-critic method requires $\mathcal { O } ( \epsilon ^ { - 2 } )$ samples with i.i.d. sampling, which improves the best-known result of $\mathcal { O } ( \epsilon ^ { - 5 / 2 } )$ in the literature.
+
+# 1.2 Other related works
+
+To put our work in context, we review prior art that we group in the following three categories.
+
+Stochastic bilevel optimization. We can trace the study of bilevel optimization to the 1950s [20]. Many recent efforts have been made to solve the bilevel problems. One successful approach is to reformulate the bilevel problem as a single-level problem by replacing the lower-level problem by its optimality conditions [4, 5]. Recently, gradient-based methods for bilevel optimization have gained popularity. They iteratively approximate the (stochastic) gradient of the upper-level problem either in a forward or backward manner [21, 3, 22, 23]. Recent work has also studied the case where the lower-level problem does not have a unique solution [24].
+
+The non-asymptotic analysis of bilevel optimization algorithms has been recently studied in some pioneering works, e.g., [16, 18, 17], just to name a few. In both [16, 17], bilevel stochastic optimization algorithms have been developed that run in a double-loop manner. To achieve an $\epsilon$ -stationary point, they only need the sample complexities $\mathcal { O } ( \epsilon ^ { - 3 } )$ and $\mathcal { O } ( \epsilon ^ { - 2 } )$ , respectively, comparable to that of SGD for the single-level case. Recently, a single-loop two-timescale stochastic approximation algorithm has been developed in [18] for the bilevel problem (1). Due to the nature of the two-timescale update, it incurs the sub-optimal sample complexity $\mathcal { O } ( \epsilon ^ { - 5 / 2 } )$ . A single-loop single-timescale stochastic bilevel optimization method has been recently developed in [19]. While the method can achieve the sample complexity $\mathcal { O } ( \epsilon ^ { - 2 } )$ , the resultant update on $y$ needs extra matrix projection, which can be costly. Very recently, the momentum-based acceleration has been incorporated into both the $x$ - and $y$ -updates in [25, 26] and also in [27] after our submission to the conference, where the new algorithms therein enjoy an improved sample complexity $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ . However, these results cannot imply the $\mathcal { O } ( \epsilon ^ { - 2 } )$ sample complexity of the alternating SGD update (4), and are orthogonal to our results. A comparison of our results with prior work can be found in Table 1.
+
+Stochastic min-max optimization. In the context of min-max problems, the alternating version of the stochastic gradient descent ascent (GDA) method can be viewed as the alternating SGD updates (4) for the special nested problem (2). To mitigate the cycling behavior of GDA for convex-concave min-max problems, several variants have been developed by incorporating the idea of optimism; see e.g., [7, 8, 11, 29]. The analysis of stochastic GDA in the nonconvex-strongly concave setting is closely related to this paper; e.g., [9, 10, 30, 28]. Specifically, for stochastic GDA (SGDA), the $\mathcal { O } ( \epsilon ^ { - 2 } )$ sample complexity has been established in [28] under an increasing batch size $\mathcal { O } ( \epsilon ^ { - 1 } )$ . As highlighted in [28], how to achieve the $\mathcal { O } ( \epsilon ^ { - 2 } )$ sample complexity under an $\mathcal { O } ( 1 )$ constant batch size remains open. The reduction of our results to the min-max setting will provide an answer to this open question. In the same setting, accelerated GDA algorithms have been developed in [31–33]. Going beyond the one-side concave settings, algorithms and their convergence analysis have been studied for nonconvex-nonconcave min-max problems with certain benign structure; see e.g., [8, 34–36]. A comparison of our results with prior work can be found in Table 2.
+
+Stochastic compositional optimization. Stochastic compositional gradient algorithms developed in [12, 37] can be viewed as the alternating SGD updates (4) for the special compositional problem (3). However, to ensure convergence, the algorithms [12, 37] use two sequences of variables being updated in two different time scales, and thus the complexity of [12] and [37] is worse than $\mathcal { O } ( \epsilon ^ { - 2 } )$ of SGD for the non-compositional case. While most of existing algorithms rely on either two-timescale updates, the single-timescale single-loop approaches have been recently developed in [14, 38, 39], which achieve the sample complexity $\bar { \mathcal { O } } \bar { ( } \epsilon ^ { - 2 } \bar { ) }$ , same as SGD for the non-nested problems. However, the algorithms proposed therein are not the vanilla alternating SGD update in the sense of (4). Other related compositional algorithms also include [40–42]. A comparison can be found in Table 3.
+
+Organization. The basic background of bilevel optimization is reviewed, and the tighter analysis of the unifying ALSET method is presented in Section 2. The reduction of the main results to the special stochastic nested problems is provided in Section 3, and its applications to the actor-critic method are discussed in Section 4, followed by the conclusions in Section 5.
+
+# 2 Improved Analysis of Alternating Stochastic Gradient Method
+
+In this section, we will first provide background of bilevel problems and then introduce ALSET for stochastic nested problems.
+
+# 2.1 Preliminaries
+
+We use $\| \cdot \|$ to denote the $\ell _ { 2 }$ norm for vectors and Frobenius norm for matrices. For convenience, we define the deterministic functions as $g ( x , y ) : = \mathbb { E } _ { \phi } [ g ( x , y ; \phi ) ]$ and $f ( x , y ) : = \mathbb { E } _ { \xi } [ f ( x , y ; \xi ) ]$ .
+
+We also define $\nabla _ { y y } ^ { 2 } g \big ( x , y \big )$ as the Hessian matrix of $g$ with respect to $y$ and define $\nabla _ { x y } ^ { 2 } g \left( x , y \right)$ as
+
+$$
+\nabla _ { x y } ^ { 2 } g ( x , y ) : = \left[ \begin{array} { l l l } { \frac { \partial ^ { 2 } } { \partial x _ { 1 } \partial y _ { 1 } } g ( x , y ) } & { \cdot \cdot \cdot } & { \frac { \partial ^ { 2 } } { \partial x _ { 1 } \partial y _ { d ^ { \prime } } } g ( x , y ) } \\ & { \cdot \cdot \cdot } \\ { \frac { \partial ^ { 2 } } { \partial x _ { d } \partial y _ { 1 } } g ( x , y ) } & { \cdot \cdot \cdot } & { \frac { \partial ^ { 2 } } { \partial x _ { d } \partial y _ { d ^ { \prime } } } g ( x , y ) } \end{array} \right] .
+$$
+
+We make the following assumptions, which are common in the bilevel optimization literature [16– 18, 26].
+
+Assumption 1 (Lipschitz continuity). Assume that $f , \nabla f , \nabla g , \nabla ^ { 2 } g$ are respectively $\ell _ { f , 0 } .$ , $\ell _ { f , 1 } , \ell _ { g , 1 } , \ell _ { g , 2 }$ -Lipschitz continuous; that is, for $z _ { 1 } : = [ x _ { 1 } ; y _ { 1 } ]$ , $z _ { 2 } : = [ x _ { 2 } ; y _ { 2 } ]$ , we have $\parallel f ( x _ { 1 } , y _ { 1 } ) -$ $\begin{array} { r c l } { f ( x _ { 2 } , y _ { 2 } ) \| ^ { - } \le } & { \ell _ { f , 0 } \| z _ { 1 } - z _ { 2 } \| , \| \nabla f ( x _ { 1 } , y _ { 1 } ) - \nabla f ( x _ { 2 } , y _ { 2 } ) \| } & { \le } & { \ell _ { f , 1 } \| z _ { 1 } - x _ { 2 } \| , } \end{array}$ $\nabla g ( x _ { 2 } , y _ { 2 } ) \| \leq \ell _ { g , 1 } \| z _ { 1 } - z _ { 2 } \|$ , $\begin{array} { r } { \| \nabla ^ { 2 } g ( x _ { 1 } , y _ { 1 } ) - \nabla ^ { 2 } g ( x _ { 2 } , y _ { 2 } ) \| \le \ell _ { g , 2 } \| z _ { 1 } - z _ { 2 } \| . } \end{array}$ .
+
+Assumption 2 (Strong convexity of $g$ in $y$ ). For any fixed $x$ , $g ( x , y )$ is $\mu _ { g }$ -strongly convex in $y$
+
+Assumptions 1 and 2 together ensure that the first- and second-order derivations of $f ( x , y ) , g ( x , y )$ as well as the solution mapping $y ^ { \ast } ( x )$ , are well-behaved. Define the condition number $\kappa : = \ell _ { g , 1 } / \mu _ { g }$
+
+Assumption 3 (Stochastic derivatives). The stochastic derivatives $\nabla f ( x , y ; \xi )$ , $\nabla g ( x , y ; \phi )$ , $\nabla ^ { 2 } g ( x , \mathbf { \bar { y } } , \phi )$ are unbiased estimators of $\nabla f ( x , y )$ , $\nabla g ( x , y )$ , $\nabla ^ { 2 } g ( x , y )$ , respectively; and their variances are bounded by $\sigma _ { f } ^ { 2 } , \sigma _ { g , 1 } ^ { 2 }$ , $\sigma _ { g , 2 } ^ { 2 }$ , respectively.
+
+
ALSET
SCGD
NASA
batch size
0(1)
0(1)
0(1)
y-update
SGD
SGD
correction
samples
O(c-²)
0(c-4)
O(c-2)
+
+Table 2: Sample complexity of stochastic minmax algorithms (BSA in [16], GDA in [28], SMD in [9]) to achieve an $\epsilon$ -stationary point of $F ( x )$ .
+
+
ALSET
SGDA
SMD
batch size
0(1)
0(e-1)
1
y-update
SGD
SGD
subproblem
samples
O(kc-2)
O(κ³-²)
O(k³-2)
+
+Table 3: Sample complexity of stochastic compositional algorithms (SCGD in [12], NASA in [14]) to achieve an $\epsilon$ -stationary point of $F ( x )$ .
+
+Assumptions 2 and 3 together imply that the second moments are bounded by
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { \xi } [ \| \nabla f ( x , y ; \xi ) \| ^ { 2 } ] \le \ell _ { f , 0 } ^ { 2 } + \sigma _ { f } ^ { 2 } : = C _ { f } ^ { 2 } } \\ & { \mathbb { E } _ { \phi } [ \| \nabla ^ { 2 } g ( x , y ; \phi ) \| ^ { 2 } ] \le \ell _ { g , 1 } ^ { 2 } + \sigma _ { g , 2 } ^ { 2 } : = C _ { g } ^ { 2 } . } \end{array}
+$$
+
+Assumption 3 is the counterpart of the unbiasedness and bounded variance assumption in the singlelevel stochastic optimization. In addition, the bounded moments in Assumption 3 ensure the Lipschitz continuity of the upper-level gradient $\nabla F ( x )$ .
+
+We first highlight the inherent challenge of directly applying the alternating SGD method to the bilevel problem (1). To illustrate this point, we derive the gradient of the upper-level function $F ( x )$ in the next proposition; see the proof in the supplementary document.
+
+Proposition 1. Under Assumptions $_ { I - 3 }$ , we have the gradients
+
+$$
+\begin{array} { r } { \nabla F ( x ) = \nabla _ { x } f ( x , y ^ { * } ( x ) ) - \nabla _ { x y } ^ { 2 } g ( x , y ^ { * } ( x ) ) \left[ \nabla _ { y y } ^ { 2 } g ( x , y ^ { * } ( x ) ) \right] ^ { - 1 } \nabla _ { y } f ( x , y ^ { * } ( x ) ) . } \end{array}
+$$
+
+urthermore, $\nabla F ( x )$ and $y ^ { * } ( x )$ are Lipschitz continuous with constants $L _ { F } , L _ { y }$ , respectively.
+
+Notice that obtaining an unbiased stochastic estimate of $\nabla F ( x )$ and applying SGD on $x$ face two main difficulties: i) the gradient $\nabla F ( x )$ at $x$ depends on the minimizer of the lower-level problem $y ^ { \ast } ( x )$ ; ii) even if $y ^ { * } ( x )$ is known, it is hard to apply the stochastic approximation to obtain an unbiased estimate of $\dot { \nabla } F ( { \boldsymbol { x } } )$ since $\nabla F ( x )$ is nonlinear in $\nabla _ { y y } ^ { 2 } g ( x , y ^ { * } ( x ) )$ .
+
+Similar to some existing stochastic bilevel algorithms [16, 18, 17], we evaluate $\nabla F ( x )$ on a certain vector $y$ in place of $y ^ { * } ( x )$ . Replacing the $y ^ { * } ( x )$ in definition (6) by $y$ , we define
+
+$$
+\overline { { \nabla } } _ { x } f \big ( x , y \big ) : = \nabla _ { x } f \big ( x , y \big ) - \nabla _ { x y } ^ { 2 } g \big ( x , y \big ) \left[ \nabla _ { y y } ^ { 2 } g \big ( x , y \big ) \right] ^ { - 1 } \nabla _ { y } f \big ( x , y \big ) .
+$$
+
+And to reduce the bias in (7), we estimate $\left[ \nabla _ { y y } ^ { 2 } g ( x , y ) \right] ^ { - 1 }$ via
+
+$$
+\left[ \nabla _ { y y } ^ { 2 } g ( x , y ) \right] ^ { - 1 } \approx \Big [ \frac { N } { \ell _ { g , 1 } } \prod _ { n = 1 } ^ { N ^ { \prime } } \Big ( I - \frac { 1 } { \ell _ { g , 1 } } \nabla _ { y y } ^ { 2 } g ( x , y ; \phi _ { ( n ) } ) \Big ) \Big ]
+$$
+
+where $N ^ { \prime }$ is drawn from $\{ 1 , 2 , \ldots , N \}$ uniformly at random and $\{ \phi ^ { ( 1 ) } , \dots , \phi ^ { ( N ^ { \prime } ) } \}$ are i.i.d. samples. It has been shown in [16] that using (8), the estimation bias of $\left[ \nabla _ { y y } ^ { 2 } g ( x , y ) \right] ^ { - 1 }$ exponentially decreases with the number of samples $N$ .
+
+# 2.2 Main results: Tighter analysis of ALSET
+
+In this subsection, we first describe the general ALSET algorithm for the stochastic bilevel problem, and then present its new convergence result.
+
+This algorithm is very simple to implement. At each iteration $k$ , ALSET alternates between the stochastic gradient update on $y ^ { k }$ and that on $x ^ { k }$ . Although it is possible that $T = 1$ , for generality, we run $T$ steps of SGD on
+
+# Algorithm 1 ALSET for the stochastic bilevel problem (1)
+
+1: initialize: $x ^ { 0 } , y ^ { 0 }$ , stepsizes $\{ \alpha _ { k } , \beta _ { k } \}$ .
+2: for $k = 0 , 1 , \ldots , K - 1$ do
+3: for $t = 0 , 1 , \dots , T - 1$ do
+4: update $y ^ { k , t + 1 } = y ^ { k , t } - \beta _ { k } h _ { g } ^ { k , t }$ . set $y ^ { k , 0 } = y ^ { k }$
+5: end for
+6: update $x ^ { k + 1 } = x ^ { k } - \alpha _ { k } h _ { f } ^ { k } \qquad \Join$
+7: end for
+
+the lower-level variable $y ^ { k }$ before updating upper-level variable $x ^ { k }$ . With $\alpha _ { k }$ and $\beta _ { k }$ denoting the stepsizes of $x ^ { k }$ and $y ^ { k }$ that decrease at the same rate as SGD, the ALSET update is
+
+$$
+\begin{array} { r l } & { y ^ { k , t + 1 } = y ^ { k , t } - \beta _ { k } h _ { g } ^ { k , t } , t = 0 , \ldots , T \quad \mathrm { w i t h } y ^ { k , 0 } : = y ^ { k } ; y ^ { k + 1 } : = y ^ { k , T } } \\ & { x ^ { k + 1 } = x ^ { k } - \alpha _ { k } h _ { f } ^ { k } } \end{array}
+$$
+
+where the update direction of $y$ is the stochastic gradient $h _ { g } ^ { k , t } : = \nabla _ { y } g ( x ^ { k } , y ^ { k , t } ; \phi ^ { k , t } )$ ; and, with the Hessian inverse estimator (8), the update direction of $x$ is the slightly biased gradient
+
+$$
+\begin{array} { r l } & { \boldsymbol { h } _ { f } ^ { k } : = \nabla _ { \boldsymbol { x } } f ( \boldsymbol { x } ^ { k } , \boldsymbol { y } ^ { k + 1 } ; \boldsymbol { \xi } ^ { k } ) } \\ & { \qquad - \nabla _ { \boldsymbol { x } \boldsymbol { y } } ^ { 2 } g ( \boldsymbol { x } ^ { k } , \boldsymbol { y } ; \phi _ { ( 0 ) } ^ { k } ) \Bigl [ \frac { N } { \ell _ { g , 1 } } \displaystyle \prod _ { n = 1 } ^ { N ^ { \prime } } \left( I - \frac { 1 } { \ell _ { g , 1 } } \nabla _ { \boldsymbol { y } \boldsymbol { y } } ^ { 2 } g ( \boldsymbol { x } ^ { k } , \boldsymbol { y } ^ { k + 1 } ; \phi _ { ( n ) } ^ { k } ) \right) \Bigr ] \nabla _ { \boldsymbol { y } } f ( \boldsymbol { x } ^ { k } , \boldsymbol { y } ^ { k + 1 } ; \boldsymbol { \xi } ^ { k } ) . } \end{array}
+$$
+
+The alternating update (9) serves as a template for running SGD on stochastic nested problems. As we will show in the subsequent sections, we can generate stochastic algorithms for min-max, compositional, and even reinforcement learning problems following (9) as a template, but they differ in the particular forms of the stochastic gradients $h _ { g } ^ { k } , h _ { f } ^ { k }$ for the specific upper- and lower-level objective functions. See Algorithm 1 for a summary of ALSET for the bilevel problem.
+
+Comparison between ALSET with existing works. Readers who are familiar with recent developments on stochastic optimization for bilevel problems may readily recognize the similarities between the general ALSET update (1) that we will analyze and the SGD-based updates in BSA [16], TTSA [18] and stocBiO [17]. However, the update (1) is different from BSA in that the number of $y$ -update, denoted as $T$ , is a constant in (1) that does not grow with the accuracy $\epsilon ^ { - 1 }$ ; the update (1) is different from stocBiO in that the stochastic gradient $h _ { g } ^ { k , \bar { t } }$ used in the $y$ -update (9a) is obtained by a fixed batch size that does not depend on the accuracy $\epsilon ^ { - 1 }$ ; and, the update (1) is different from TTSA in that the stepsizes $\alpha _ { k }$ and $\beta _ { k }$ in (9) decrease at the same timescale.
+
+We next present the convergence result of ALSET.
+
+Theorem 1 (Bilevel problems). Suppose Assumptions $_ { I - 3 }$ hold. Define the constants as
+
+$$
+\bar { \alpha } _ { 1 } = \frac { 1 } { 2 L _ { F } + 4 L _ { f } L _ { y } + \frac { 2 L _ { f } L _ { y x } } { L _ { y } \eta } } , \bar { \alpha } _ { 2 } = \frac { 1 6 T \mu _ { g } \ell _ { g , 1 } } { ( \mu _ { g } + \ell _ { g , 1 } ) ^ { 2 } ( 8 L _ { f } L _ { y } + 2 \eta L _ { y x } \tilde { C } _ { f } ^ { 2 } \bar { \alpha } _ { 1 } ) }
+$$
+
+where $\eta > 0$ is a control constant that will be specified in each special case to achieve the best sample complexity. With $\alpha > 0$ being a control constant that will be specified later, choose the stepsizes as
+
+$$
+\alpha _ { k } = \operatorname* { m i n } \left\{ \bar { \alpha } _ { 1 } , \bar { \alpha } _ { 2 } , \frac { \alpha } { \sqrt { K } } \right\} \mathrm { a n d } \beta _ { k } = \frac { 8 L _ { f } L _ { y } + 2 \eta L _ { y x } \tilde { C } _ { f } ^ { 2 } \bar { \alpha } _ { 1 } } { 4 T \mu _ { g } } \alpha _ { k } .
+$$
+
+For any $T \geq 1$ and $N = \mathcal { O } ( \log K )$ , the iterates $\{ x ^ { k } , y ^ { k } \}$ generated by Algorithm $I$ satisfy
+
+$$
+\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left[ \left. \nabla F ( x ^ { k } ) \right. ^ { 2 } \right] = \mathcal { O } \Big ( \frac { 1 } { \sqrt { K } } \Big ) \ \mathrm { ~ a n d ~ } \ \mathbb { E } \left[ \left. y ^ { K } - y ^ { * } ( x ^ { K } ) \right. ^ { 2 } \right] = \mathcal { O } \Big ( \frac { 1 } { \sqrt { K } } \Big )
+$$
+
+where $y ^ { * } ( x ^ { K } )$ is the minimizer of the lower-level problem in (1b).
+
+Proposition 2. Under the same assumptions and the choice of parameters of Theorem $^ { l }$ , with $\begin{array} { r } { \kappa : = { \frac { \ell _ { g , 1 } } { \mu _ { g } } } } \end{array}$ \`g,1µg being the condition number, select α = Θ(κ−5/2), T = Θ(κ4), η = O(κ) in (12), and then
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } [ \| \nabla F ( x ^ { k } ) \| ^ { 2 } ] = \mathcal { O } \left( \frac { \kappa ^ { 3 } } { K } + \frac { \kappa ^ { \frac { 5 } { 2 } } } { \sqrt { K } } \right) .
+$$
+
+Discussion of Theorem 1. To achieve $\epsilon$ -stationary point, we need $K = \mathcal { O } ( \kappa ^ { 5 } \epsilon ^ { - 2 } )$ , and the number of evaluations of $h _ { f } ^ { k } , h _ { g } ^ { k , t }$ are $\mathcal { O } ( \kappa ^ { 5 } \epsilon ^ { - 2 } )$ and $\mathcal { O } ( \kappa ^ { 9 } \epsilon ^ { - 2 } )$ , respectively. Therefore, the sample complexity is on the same order of SGD’s sample complexity for the single-level nonconvex problems [43], and improves the state-of-the-art single-loop TTSA’s sample complexity $\mathcal { O } ( \epsilon ^ { - 5 / 2 } )$ [18]. Compared to [17], ALSET achieves the same sample complexity in terms of both $\epsilon$ and $\kappa$ , without using a growing batch size. Importantly, we obtain this tighter bound without introducing additional assumptions.
+
+# 2.3 Proof sketch
+
+In this subsection, we highlight the key steps of the proof towards Theorem 1, and highlight the differences between our analysis and the existing ones.
+
+For simplicity, we define the following Lyapunov function as $\begin{array} { r } { \mathbb { V } ^ { k } : = F ( x ^ { k } ) + \frac { L _ { f } } { L _ { y } } \| y ^ { k } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } . } \end{array}$ We first quantify the difference between two Lyapunov functions as
+
+$$
+\mathbb { V } ^ { k + 1 } - \mathbb { V } ^ { k } = \underbrace { F ( x ^ { k + 1 } ) - F ( x ^ { k } ) } _ { \mathrm { L e m m a ~ 1 } } + \ \frac { L _ { f } } { L _ { y } } ( \| y ^ { k + 1 } - y ^ { * } ( x ^ { k + 1 } ) \| ^ { 2 } - \| y ^ { k } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ) .
+$$
+
+The difference in (15) consists of two difference terms: the first term quantifies the descent of the overall objective functions; the second term characterizes the descent of the lower-level errors.
+
+We will first analyze the descent of the upper-level objective in the next lemma.
+
+Lemma 1 (Descent of upper level). Suppose Assumptions $_ { I - 3 }$ hold. Define $\bar { h } _ { f } ^ { k } : = \mathbb { E } [ h _ { f } ^ { k } | x ^ { k } , y ^ { k + 1 } ]$ and $\| \bar { h } _ { f } ^ { k } - \overline { { \nabla } } f ( x ^ { k } , y ^ { k + 1 } ) \| \leq b _ { k }$ . The sequence of $x ^ { k }$ generated by Algorithm $I$ satisfies
+
+$$
+\begin{array} { r } { \mathbb { E } [ F ( { x } ^ { k + 1 } ) ] - \mathbb { E } [ F ( { x } ^ { k } ) ] \le - \frac { \alpha _ { k } } { 2 } \mathbb { E } [ \| \nabla F ( { x } ^ { k } ) \| ^ { 2 } ] - \left( \frac { \alpha _ { k } } { 2 } - \frac { L _ { F } \alpha _ { k } ^ { 2 } } { 2 } \right) \mathbb { E } [ \| \bar { h } _ { f } ^ { k } \| ^ { 2 } ] } \\ { + L _ { f } ^ { 2 } \alpha _ { k } \mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( { x } ^ { k } ) \| ^ { 2 } ] + \alpha _ { k } b _ { k } ^ { 2 } + \frac { L _ { F } \alpha _ { k } ^ { 2 } } { 2 } \tilde { \sigma } _ { f } ^ { 2 } } \end{array}
+$$
+
+where constants $L _ { f } , L _ { F } , \sigma _ { f } ^ { 2 }$ are defined in Lemma 4 of the supplementary document.
+
+Lemma 1 implies that the descent of the upper-level objective functions depends on the error of the lower-level variable $y ^ { k }$ . We will next analyze the error of the lower-level variable, which is the key step to improving the existing results.
+
+Before we analyze the error of $y ^ { k }$ , we introduce a lemma that characterizes the smoothness of $y ^ { \ast } ( x )$ and the bounded moments of $h _ { f } ^ { k }$ . The smoothness and the bounded moments have not been explored by previous analysis such as [16–18], and they play an essential role in our improved analysis of $y ^ { k }$ .
+
+Lemma 2 (Smoothness and boundedness). Under Assumptions $^ { l }$ and 2, we have
+
+$$
+\begin{array} { r } { \| \nabla y ^ { * } ( x _ { 1 } ) - \nabla y ^ { * } ( x _ { 2 } ) \| \leq L _ { y x } \| x _ { 1 } - x _ { 2 } \| ; \quad \mathbb { E } [ \| h _ { f } ^ { k } \| ^ { 2 } | x ^ { k } , y ^ { k + 1 } ] \leq \tilde { C } _ { f } ^ { 2 } } \end{array}
+$$
+
+where $L _ { y x }$ and $\tilde { C } _ { f } ^ { 2 }$ depend on the constants defined in Assumptions 1-2.
+
+Building upon Lemma 2, we establish the progress of the lower-level update.
+
+Lemma 3 (Error of lower level). Suppose that Assumptions 1–3 hold, and $y ^ { k + 1 }$ is generated by running iteration (9) given $x ^ { k }$ . If we choose $\begin{array} { r } { \beta _ { k } \le \frac { 2 ^ { \binom { - } { q } } } { \mu _ { g } + \ell _ { g , 1 } } } \end{array}$ , then $y ^ { k + 1 }$ satisfies
+
+$$
+\begin{array} { r l } & { \mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ] \leq ( 1 - \mu _ { g } \beta _ { k } ) ^ { T } \mathbb { E } [ \| y ^ { k } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ] + T \beta _ { k } ^ { 2 } \sigma _ { g , 1 } ^ { 2 } } \\ & { \mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( x ^ { k + 1 } ) \| ^ { 2 } ] \leq \Big ( 1 + 4 L _ { f } L _ { y } \alpha _ { k } + \frac { \eta L _ { y x } \tilde { C } _ { f } ^ { 2 } } { 2 } \alpha _ { k } ^ { 2 } \Big ) \mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ] } \\ & { \qquad + \Big ( L _ { y } ^ { 2 } + \frac { L _ { y } } { 4 L _ { f } \alpha _ { k } } + \frac { L _ { y x } } { 2 \eta } \Big ) \alpha _ { k } ^ { 2 } \mathbb { E } [ \| \bar { h } _ { f } ^ { k } \| ^ { 2 } ] + \Big ( L _ { y } ^ { 2 } + \frac { L _ { y x } } { 2 \eta } \Big ) \alpha _ { k } ^ { 2 } \tilde { \sigma } _ { f } ^ { 2 } } \end{array}
+$$
+
+where $\eta > 0$ is a fixed constant that will be chosen to obtain the tighter complexity bound.
+
+The improved analysis of the lower-level problem. Next we explain where we can obtain improved analysis. Plugging (18a) into (18b), and selecting stepsizes $\alpha _ { k } , \beta _ { k }$ properly, we can show that
+
+$$
+\begin{array} { r } { \mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( x ^ { k + 1 } ) \| ^ { 2 } ] \leq ( 1 - \delta _ { 1 } ) \mathbb { E } [ \| y ^ { k } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ] + \delta _ { 2 } \mathbb { E } [ \| \bar { h } _ { f } ^ { k } \| ^ { 2 } ] + \delta _ { 3 } T \sigma _ { g , 1 } ^ { 2 } + \delta _ { 4 } \tilde { \sigma } _ { f } ^ { 2 } } \end{array}
+$$
+
+where the constants are $\delta _ { 1 } \in [ 0 , 1 ) , \delta _ { 2 } = \mathcal { O } ( \alpha _ { k } ) , \delta _ { 3 } = \mathcal { O } ( \beta _ { k } ^ { 2 } ) , \delta _ { 4 } = \mathcal { O } ( \alpha _ { k } ^ { 2 } )$ . As we will show in our supplementary material, the term $\mathbb { E } [ \| \bar { h } _ { f } ^ { k } \| ^ { 2 } ]$ will be canceled when combined with (16) in our analysis. Hence, choosing $\alpha _ { k } = \mathcal { O } ( k ^ { - 1 / 2 } )$ and $\beta _ { k } = \mathcal { O } ( k ^ { - 1 / 2 } )$ makes the variance terms in (19) decrease at the same $\mathcal { O } ( k ^ { - 1 / 2 } )$ rate as the vanilla SGD for stochastic non-nested problems.
+
+As a comparison, the progress of the lower-level problem in [18, 17] can be summarized as
+
+$$
+\mathbb { E } [ \| y ^ { k + 1 } - y ^ { * } ( x ^ { k + 1 } ) \| ^ { 2 } ] \leq ( 1 - \delta _ { 1 } ) \mathbb { E } [ \| y ^ { k } - y ^ { * } ( x ^ { k } ) \| ^ { 2 } ] + \delta _ { 5 } \sigma ^ { 2 }
+$$
+
+where $\sigma ^ { 2 }$ is some variance term, and the constant is $\delta _ { 5 } = \mathcal { O } ( \beta _ { k } ^ { 2 } + \alpha _ { k } ^ { 2 } / \beta _ { k } )$ or $\mathcal { O } ( 1 / B _ { k } )$ with $B _ { k }$ being the batch size at iteration $k$ . To balance the two terms in $\delta _ { 5 } = \mathcal { O } ( \beta _ { k } ^ { 2 } + \alpha _ { k } ^ { 2 } / \beta _ { k } )$ , two timescales of stepsizes $\begin{array} { r } { \operatorname* { l i m } _ { k \to \infty } \alpha _ { k } / \beta _ { k } = 0 } \end{array}$ are needed, which will make the variance term of the $y$ -update in (20) and that of the $x$ -update in (16) decrease at two different rates, slower than that of SGD; and to reduce $\delta _ { 5 } = \mathcal { O } ( 1 / B _ { k } )$ , a growing batch size $B _ { k } = \mathcal { O } ( k )$ is needed for the $y$ -update.
+
+# 3 Applications to Stochastic Min-Max and Compositional Problems
+
+Building upon the general results for the bilevel problems in Section 2, this section will identify special features of the stochastic min-max and stochastic compositional problems, and customize the general results to yield state-of-the-art convergence results for two special nested problems.
+
+# 3.1 Stochastic min-max problems
+
+We first apply our results to the stochastic min-max problem (2). In this special case, the lower-level function is $\bar { g ( x , y ; \phi ) } = - f ( x , y ; \xi )$ , and the bilevel gradient in (6) reduces to
+
+$$
+\nabla F ( x ) : = \nabla _ { x } f { \big ( } x , y ^ { * } ( x ) { \big ) } + \nabla _ { x } y ^ { * } ( x ) ^ { \top } \nabla _ { y } f { \big ( } x , y ^ { * } ( x ) { \big ) } = \nabla _ { x } f { \big ( } x , y ^ { * } ( x ) { \big ) }
+$$
+
+where the second equality follows from the optimality condition of the lower-level problem, i.e., $\nabla _ { y } f ( x , y ^ { * } ( x ) ) = 0$ . Similar to Section 2, we again approximate $\nabla F ( x )$ on a certain vector $y$ in place of $y ^ { * } ( x )$ . Therefore, the alternating stochastic gradients for this special case are given by
+
+$$
+\begin{array} { r } { h _ { g } ^ { k , t } = - \nabla _ { y } f ( x ^ { k } , y ^ { k , t } ; \xi _ { 1 } ^ { k , t } ) ~ \mathrm { a n d } ~ h _ { f } ^ { k } = \nabla _ { x } f ( x ^ { k } , y ^ { k + 1 } ; \xi _ { 2 } ^ { k } ) . } \end{array}
+$$
+
+Plugging the stochastic gradient into the general update (9), we summarize the update in Algorithm 2.
+When the number of $y$ -update is $T = 1$ , the ALSET algorithm reduces to the SGDA method in [28].
+
+Proposition 3 (Min-max problems). Choose the same choice of parameters as those in Theorem $I$ , and follow the same assumption as those in Theorem $^ { l }$ except that $f ( \cdot , y )$ is only Lipchitz over $x \in \mathbb { R } ^ { d }$ but not that $f ( x , \cdot )$ is Lipschitz continuous over $y \in \mathbb { R } ^ { d ^ { \prime } }$ . If we select $\alpha = \Theta ( \kappa ^ { - 1 } )$ , $T = \Theta ( \kappa )$ , $\eta = 1$ in (12), the iterates generated by Algorithm 2 satisfy
+
+$$
+\frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } \left[ \left. \nabla F ( x ^ { k } ) \right. ^ { 2 } \right] = \mathcal { O } \left( \frac { \kappa ^ { 2 } } { K } + \frac { \kappa } { \sqrt { K } } \right) .
+$$
+
+Proposition 3 implies that for the minmax problem, the convergence rate of ALSET to the stationary point of $\begin{array} { r } { F ( x ) \ \mathrel { \mathop : } = \ \operatorname* { m a x } _ { y \in \mathbb { R } ^ { d ^ { \prime } } } \mathbb { E } _ { \xi } \left[ f ( x , y ; \xi ) \right] } \end{array}$ is $\mathcal { O } ( K ^ { - 1 / 2 } )$ . To achieve $\epsilon$ -stationary point, we need $K = \mathcal { O } ( \kappa ^ { 2 } \epsilon ^ { - 2 } )$ . And the number of gradient evaluations for $h _ { f } ^ { k } , h _ { g } ^ { k , t }$ are $\mathcal { O } \bar { ( \kappa ^ { 2 } \epsilon ^ { - 2 } ) }$ and $\mathcal { O } ( \kappa ^ { 3 } \epsilon ^ { - 2 } )$ , respectively. Comparing with the results in [28], we achieve the same sample complexity without an increasing batch size $\mathsf { \bar { \mathcal { O } } } ( \epsilon ^ { - 1 } )$ , and improve their sample complexity $\mathcal { O } ( \epsilon ^ { - 5 / 2 } )$ under a fixed batch size.
+
+Algorithm 2 ALSET for the min-max problem (2)
+
+1: initialize: $x ^ { 0 } , y ^ { 0 }$ , stepsizes $\{ \alpha _ { k } , \beta _ { k } \}$ .
+2: for $k = 0 , 1 , \ldots , K - 1$ do
+3: set $y ^ { k , 0 } = y ^ { k }$
+4: for $t = 0 , 1 , \dots , T - 1$ do
+5: update $y ^ { k , t + 1 } = y ^ { k , t } - \beta _ { k } \nabla _ { y } f ( x ^ { k } , y ^ { k , t } ; \xi _ { 1 } ^ { k , t } )$
+6: end for
+7: set $y ^ { k + 1 } = y ^ { k , T }$
+8: update $\boldsymbol { x } ^ { k + \mathrm { i } } = x ^ { k } - \alpha _ { k } \nabla _ { x } f ( x ^ { k } , y ^ { k + 1 } ; \xi _ { 2 } ^ { k } )$
+9: end for
+
+However, it is also worth mentioning that compared with [28], our analysis requires the additional Lipschitz continuity assumption of $f ( \cdot , y )$ over $x \in \mathbb { R } ^ { d }$ , which inherits from the analysis for the general bilevel problem. Therefore, our result complements, rather than improves, the analysis in [28]. We view our contribution in min-max problems as a supplementary of existing results.
+
+# 3.2 Stochastic compositional problems
+
+In this section, we apply our results to the stochastic compositional problem (3). In this special case, the upper-level function is $f ( x , y ; \xi ) : = f ( y ; \xi )$ , and the lower-level function is $g ( x , y ; \phi ) =$ $\| y - h ( x ; \phi ) \| ^ { 2 }$ , and the bilevel gradient in (6) reduces to
+
+$$
+\begin{array} { r l } & { \nabla F ( x ) : = \nabla _ { x } f \big ( x , y ^ { * } ( x ) \big ) - \nabla _ { x y } ^ { 2 } g ( x , y ^ { * } ( x ) ) \big [ \nabla _ { y y } ^ { 2 } g ( x , y ^ { * } ( x ) ) \big ] ^ { - 1 } \nabla _ { y } f ( x , y ^ { * } ( x ) ) } \\ & { \qquad = \nabla h ( x ; \phi ) ^ { \top } \nabla _ { y } f ( y ^ { * } ( x ) ) } \end{array}
+$$
+
+where we use the fact that $\nabla _ { y y } ^ { 2 } g ( x , y ; \phi ) = \mathbf { I } _ { d ^ { \prime } \times d ^ { \prime } } , \nabla _ { x y } ^ { 2 } g ( x , y ; \phi ) = - \nabla h ( x ; \phi ) ^ { \top }$ . Similar to Section 2, we again evaluate $\nabla F ( x )$ on a certain vector $y$ in place of $y ^ { \ast } ( x )$ . Therefore, by choosing $T = 1$ , the alternating stochastic gradients $h _ { f } ^ { k } , h _ { g } ^ { k , t }$ for this special case are much simpler, given by
+
+$$
+h _ { g } ^ { k , t } = h _ { g } ^ { k } = y ^ { k } - h ( x ^ { k } ; \phi ^ { k } ) ~ \mathrm { a n d } ~ h _ { f } ^ { k } = \nabla h ( x ^ { k } ; \phi ^ { k } ) \nabla f ( y ^ { k + 1 } ; \xi ^ { k } ) .
+$$
+
+Plugging the stochastic gradient into the general update (9), we summarize the update in Algorithm 3.
+When $T = 1$ , the ALSET algorithm reduces to SCGD proposed in [12].
+
+In the supplementary document, we have verified that the standard assumptions of stochastic compositional optimization in [12, 37, 14, 41, 38] are sufficient for Assumptions 1–3 to hold.
+
+Proposition 4 (Compositional problems). Under the same assumptions and the parameters as those in Theorem $I$ , if we select $\begin{array} { r } { T ^ { } = 1 , \alpha = 1 , \eta = \frac { 1 } { L _ { y x } } } \end{array}$ in (12), the iterates of Algorithm 3 satisfy
+
+$$
+\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left[ \left\| \nabla F ( x ^ { k } ) \right\| ^ { 2 } \right] = \mathcal { O } \Big ( \frac { 1 } { \sqrt { K } } \Big ) .
+$$
+
+Since each iteration of ALSET only uses $\mathcal { O } ( 1 )$ samples (see Algorithm 3), Proposition 4 implies that the sample complexity to achieve an $\epsilon$ -stationary point of (3) is $\mathcal { O } ( \epsilon ^ { - 2 } )$ . Comparing with the results
+
+Algorithm 3 ALSET for the compositional problem (3)
+
+1: initialize: $x ^ { 0 } , y ^ { 0 }$ , stepsizes $\{ \alpha _ { k } , \beta _ { k } \}$ .
+2: for $k = 0 , 1 , \ldots , K - 1$ do
+3: update $y ^ { k + 1 } = y ^ { k } - \beta _ { k } ( y ^ { k } - h ( x ^ { k } ; \phi ^ { k } ) )$
+4: update $x ^ { k + 1 } = x ^ { k } - \alpha _ { k } \nabla f ( y ^ { k + 1 } ; \xi ^ { k } ) \nabla h ( x ^ { k } ; \phi ^ { k } )$
+5: end for
+
+of the SCGD method in [12], our result improves the sample complexity $\mathcal { O } ( \epsilon ^ { - 4 } )$ under a fixed batch size. Importantly, our analysis does not introduce additional assumption compared to [12].
+
+# 4 Applications to Actor-Critic Methods
+
+In this section, we apply our tighter analysis to the actor-critic (AC) method with linear value function approximation [44], which can be viewed as a special case of the stochastic bilevel algorithm [45, 46].
+
+Consider a Markov decision process described by $\mathcal { M } = \{ { \cal S } , \mathcal { A } , \mathcal { P } , { \cal R } , \gamma \}$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $\mathcal { P } ( s ^ { \prime } | s , a )$ is the probability of transitioning to $s ^ { \prime } \in \mathcal { S }$ given state $s \in S$ and action $a \in { \mathcal { A } }$ , and $R ( s , a , s ^ { \prime } )$ is the reward associated with $( s , a , s ^ { \prime } )$ , and $\gamma \in [ 0 , 1 )$ is a discount factor. For a policy $\pi _ { \theta }$ , define the value function $V _ { \pi _ { \theta } } ( s )$ that satisfies the Bellman equation [47]
+
+$$
+\begin{array} { r } { V _ { \pi _ { \theta } } ( s ) = \mathbb { E } _ { a \sim \pi _ { \theta } ( . | s ) , s ^ { \prime } \sim \mathcal { P } ( \cdot | s , a ) } \left[ r ( s , a , s ^ { \prime } ) + \gamma V _ { \pi _ { \theta } } ( s ^ { \prime } ) \right] . } \end{array}
+$$
+
+Given the state feature mapping $\phi ( \cdot ) : \mathcal { S } \mathbb { R } ^ { d _ { y } }$ , we approximate the value function linearly as $V _ { \pi _ { \boldsymbol { \theta } } } ( s ) \approx \hat { V } _ { y } ( s ) : = \boldsymbol { \phi } ( s ) ^ { \top } \boldsymbol { y }$ , where $\boldsymbol { y } \in \mathbb { R } ^ { d _ { y } }$ is the critic parameter. The task of finding the best $y$ such that $V _ { \pi _ { \theta } } ( s ) \approx \hat { V } _ { y } ( s )$ is usually addressed by TD learning [48].
+
+Defining the stationary distribution induced by the policy parameter $\theta _ { k }$ as $\mu _ { \theta _ { k } }$ and the $k$ th transition as $\xi _ { k } : = ( s _ { k } , a _ { k } , s _ { k + 1 } )$ , which is sampled from $s _ { k } \sim \mu _ { \theta _ { k } } , a \sim \pi _ { \theta _ { k } } , s _ { k + 1 } \sim \mathcal { P }$ , the TD-error is
+
+$$
+\hat { \delta } ( \xi _ { k } , y _ { k } ) : = r ( s _ { k } , a _ { k } , s _ { k + 1 } ) + \gamma \phi ( s _ { k + 1 } ) ^ { \top } y _ { k } - \phi ( s _ { k } ) ^ { \top } y _ { k }
+$$
+
+and the critic gradient $h _ { g } ( \xi _ { k } , y _ { k } ) : = \hat { \delta } ( \xi _ { k } , y _ { k } ) \nabla \hat { V } _ { y _ { k } } ( s _ { k } )$ . We update the parameter $y$ via
+
+$$
+y _ { k + 1 } = \Pi _ { R _ { y } } \big ( y _ { k } + \beta _ { k } h _ { g } ( \xi _ { k } , y _ { k } ) \big ) ,
+$$
+
+where $\beta _ { k }$ is the critic stepsize, and $\Pi _ { R _ { y } }$ is the projection to control the norm of the gradient. A pre-defined constant $R _ { y }$ will be specified in the supplementary document.
+
+The goal of policy optimization is to solve ${ \mathrm { m a x } } _ { \theta \in \mathbb { R } ^ { d } } F ( \theta )$ with $F ( \theta ) : = \mathbb { E } _ { s \sim \eta } [ V _ { \pi _ { \theta } } ( s ) ]$ , where $\eta$ is the initial distribution. Leveraging the value function approximation and the policy gradient theorem [49], we have the policy gradient $h _ { f } ( \xi , \theta , y ) : = \hat { \delta } ( \xi , \bar { y ) \psi } _ { \theta } ( s , a )$ , which gives the policy update
+
+$$
+\theta _ { k + 1 } = \theta _ { k } + \alpha _ { k } h _ { f } ( \xi _ { k } ^ { \prime } , \theta _ { k } , y _ { k + 1 } ) ,
+$$
+
+where $\alpha _ { k }$ is the stepsize and $\psi _ { \boldsymbol \theta } ( s , a ) : = \nabla \log \pi _ { \boldsymbol \theta } ( a | s )$ . Note that the sample $\xi _ { k } ^ { \prime } : = ( s _ { k } ^ { \prime } , a _ { k } ^ { \prime } , s _ { k + 1 } ^ { \prime } )$ used in (30) is independent from $\xi _ { k }$ in (29). Specifically, $\xi _ { k } ^ { \prime }$ is sampled from $s _ { k } ^ { \prime } \sim d _ { \theta _ { k } } , a _ { k } ^ { \prime } \sim$ $\pi _ { \boldsymbol { \theta } _ { k } } , s _ { k + 1 } ^ { \prime } \sim \mathcal { P }$ with $d _ { \theta _ { k } }$ being the discounted state action visitation measure under $\theta _ { k }$ .
+
+The alternating AC update (29)-(30) is a special case of ALSET, where the critic update is the lower-level update, and the actor update is the upper-level update.
+
+Due to space limitation, we will directly present the results of the alternating AC next, and defer presentation of the proof and the corresponding assumptions, which are the counterparts of Assumptions 1–3 in the context of AC, to the supplementary document.
+
+Theorem 2 (Actor-critic). Under the some regularity conditions that are specified in the supplementary document, selecting step size $\begin{array} { r } { \alpha _ { k } = \alpha = \overset { \cdot } { \mathcal { O } } ( \frac { 1 } { \sqrt { K } } ) } \end{array}$ , $\begin{array} { r } { \beta _ { k } = \beta = \mathcal { O } ( \frac { 1 } { \sqrt { K } } ) } \end{array}$ , it holds
+
+$$
+\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left[ \| \nabla F ( \theta _ { k } ) \| ^ { 2 } \right] = \mathcal { O } \left( \frac { 1 } { \sqrt { K } } \right) + \epsilon _ { \mathrm { a p p } }
+$$
+
+where $\epsilon _ { \mathrm { a p p } }$ , defined in the supplementary document, captures the richness of the linear function class.
+
+Both sides of Theorem 2. As an application of our tighter analysis, Theorem 2 establishes for the first time that the sample complexity of the single-loop alternating actor-critic method is $\mathcal { O } ( \epsilon ^ { - 2 } )$ . On the positive side, this new result improves the previous complexity $\mathcal { O } ( \epsilon ^ { - 5 / 2 } )$ for the single-loop AC [50], and $\mathcal { O } ( \epsilon ^ { - 2 } \log \epsilon ^ { - 1 } )$ for the nested-loop AC [51], and matches $\mathcal { O } ( \epsilon ^ { - 2 } )$ for AC with an exact critic oracle [52]. In addition to using two independent samples, one limitation of our result is that inheriting from the analysis for the general bilevel case, our analysis of AC requires the smoothness of the critic fixed-point $y ^ { * } ( \theta )$ . As shown in the supplementary document, this implicitly requires the additional bounded and Lipschitz continuity assumption on the stationary distribution $\mu _ { \theta }$ . The removal of this assumption and the extension to Markovian sampling are left for future research.
+
+# 5 Preliminary Experiments
+
+To validate our new theoretical results, we have conducted the simple experiment using the riskaverse portfolio management task on a benchmark dataset - 100 Book-to-Market. This is a typical application of stochastic compositional optimization (3) that is used in [40, 41]. We compared the popular two-timescale SCGD approach [12] with our single-timescale ALSET approach.
+
+We use the same initialization of $x ^ { 0 } , y ^ { 0 }$ for both SCGD and ALSET, and tune the stepsizes $\alpha _ { k } , \beta _ { k }$ by following the suggested order in the original SCGD paper and then using a grid search for the multiplicative constant $c$ , that is
+
+
Iter k
ln k
SCGD
ALSET
ALSET-const
10
2.30
5.32
5.31
5.63
100
4.61
3.78
3.49
3.63
200
5.30
3.40
2.94
3.06
400
5.99
3.04
2.40
2.55
1000
6.91
2.57
1.65
2.06
+
+The constant $c$ is chosen from the searching
+
+Table 4: Comparison of $\begin{array} { r l } { { \ln ( \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \| \nabla F ( x ^ { k } ) \| ^ { 2 } ) } \quad } & { { } } \end{array}$ among the two-timescale and single-timescale algorithms.
+
+grid $\{ 1 0 ^ { - 3 } , 5 \times 1 0 ^ { - 4 } , 1 0 ^ { - 4 } \}$ and is optimized for each algorithm in terms of ergodic average gradient norm versus the number of iterations. In Table 4, we report the logarithmic value of the average gradient norm performance of SCGD, ALSET with both the above decreasing stepsizes and ALSETconst with the constant stepsizes (replacing $k$ with $K = 1 0 0 0$ ). Since SCGD and ALSET use the same number of samples and gradient evaluations per iteration, we report the progress in terms of iterations. By calculating the decay rate, we can observe that the empirical convergence rate of ALSET is no worse than the theoretical rate $\mathcal { O } ( k ^ { - 1 / 2 } )$ , and ALSET outperforms SCGD thanks to its single-timescale stepsizes. We will pursue more comprehensive experiments in our future work.
+
+# 6 Conclusions
+
+This paper unifies several SGD-type updates for stochastic nested problems into a single nested SGD approach that we term ALternating Stochastic gradient dEscenT (ALSET) method. ALSET runs in the single-timescale and uses a fixed batch size. This paper presents a tighter analysis for using ALSET to solve stochastic nested problems. Under the new analysis, to achieve an $\epsilon$ -stationary point of the nested problem, ALSET requires $\mathcal { O } ( \epsilon ^ { - 2 } )$ samples in total. As a by-product, this general result also improves the existing sample complexity of the min-max and compositional cases. It matches the sample complexity of SGD for single-level stochastic problems. Applying our analysis to an alternating version of the actor-critic algorithm also yields a state-of-the-art sample complexity.
+
+Potential limitations of our results include additional assumptions in the min-max and actor-critic cases, which inherit from the assumptions of general bilevel problems. Nevertheless, our work can also lead to promising future research in understanding the theoretical performance of many successful empirical nested optimization algorithms. To this end, our future work consists of relaxing the regularity conditions needed to achieve our theoretical results and Possible extensions include applying our the tighter analysis in this paper to the existing two-timescale Hessian-free bilevel optimization algorithms and decentralized stochastic nested optimization algorithms.
+
+# Acknowledgements
+
+The work of T. Chen was partially supported by NSF Grant 2047177 and the RPI-IBM Artificial Intelligence Research Collaboration (AIRC). The work of Y. Sun was partially supported by ONR
+
+Grant N000141712162 and AFOSR MURI FA9550-18-1-0502. We thank anonymous reviewers for their valuable feedback on improving the current paper.
+
+References
+[1] H. Robbins and S. Monro, “A stochastic approximation method,” Annals of Mathematical Statistics, vol. 22, no. 3, pp. 400–407, Sep. 1951.
+[2] C. Finn, P. Abbeel, and S. Levine, “Model-agnostic meta-learning for fast adaptation of deep networks,” in Proc. Intl. Conf. Machine Learn., Sydney, Australia, Jun. 2017, pp. 1126–1135.
+[3] L. Franceschi, P. Frasconi, S. Salzo, R. Grazzi, and M. Pontil, “Bilevel programming for hyperparameter optimization and meta-learning,” in Proc. Intl. Conf. Machine Learn., Vienna, Austria, Jun. 2018, pp. 1568–1577.
+[4] B. Colson, P. Marcotte, and G. Savard, “An overview of bilevel optimization,” Annals of operations research, vol. 153, no. 1, pp. 235–256, 2007.
+[5] G. Kunapuli, K. P. Bennett, J. Hu, and J.-S. Pang, “Classification model selection via bilevel programming,” Optimization Methods & Software, vol. 23, no. 4, pp. 475–489, 2008.
+[6] S. Dempe and A. Zemkoho, Bilevel Optimization. Springer, 2020.
+[7] C. Daskalakis and I. Panageas, “The limit points of (optimistic) gradient descent in min-max optimization,” in Proc. Advances in Neural Info. Process. Syst., Montreal, Canada, Dec. 2018, pp. 9256–9266.
+[8] G. Gidel, H. Berard, G. Vignoud, P. Vincent, and S. Lacoste-Julien, “A variational inequality perspective on generative adversarial networks,” in Proc. Intl. Conf. Learn. Representations, Vancouver, Canada, Apr. 2018.
+[9] H. Rafique, M. Liu, Q. Lin, and T. Yang, “Non-convex min-max optimization: Provable algorithms and applications in machine learning,” Optimization Methods and Software, Mar. 2021.
+[10] K. K. Thekumparampil, P. Jain, P. Netrapalli, and S. Oh, “Efficient algorithms for smooth minimax optimization,” in NeurIPS, Vancouver, Canada, Dec. 2019.
+[11] A. Mokhtari, A. Ozdaglar, and S. Pattathil, “A unified analysis of extra-gradient and optimistic gradient methods for saddle point problems: Proximal point approach,” in Proc. Intl. Conf. on Artif. Intell. and Stat., Palermo, Italy, Aug. 2020, pp. 1497–1507.
+[12] M. Wang, E. X. Fang, and H. Liu, “Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions,” Mathematical Programming, vol. 161, no. 1-2, pp. 419–449, Jan. 2017.
+[13] B. Dai, N. He, Y. Pan, B. Boots, and L. Song, “Learning from conditional distributions via dual embeddings,” in Proc. Intl. Conf. on Artif. Intell. and Stat., Fort Lauderdale, FL, Apr. 2017, pp. 1458–1467.
+[14] S. Ghadimi, A. Ruszczynski, and M. Wang, “A single timescale stochastic approximation method for nested stochastic optimization,” SIAM Journal on Optimization, vol. 30, no. 1, pp. 960–979, Mar. 2020.
+[15] K. Ji, J. Yang, and Y. Liang, “Multi-step model-agnostic meta-learning: Convergence and improved algorithms,” arXiv preprint:2002.07836, Feb. 2020.
+[16] S. Ghadimi and M. Wang, “Approximation methods for bilevel programming,” arXiv preprint:1802.02246, 2018.
+[17] K. Ji, J. Yang, and Y. Liang, “Provably faster algorithms for bilevel optimization and applications to meta-learning,” in Proc. Intl. Conf. Machine Learn., Virtual, Jul. 2021.
+[18] M. Hong, H.-T. Wai, Z. Wang, and Z. Yang, “A two-timescale framework for bilevel optimization: Complexity analysis and application to actor-critic,” arXiv preprint:2007.05170, 2020.
+[19] T. Chen, Y. Sun, and W. Yin, “A single-timescale stochastic bilevel optimization method,” arXiv preprint arXiv:2102.04671, 2021.
+[20] H. V. Stackelberg, The Theory of Market Economy. Oxford University Press, 1952.
+[21] S. Sabach and S. Shtern, “A first order method for solving convex bilevel optimization problems,” SIAM Journal on Optimization, vol. 27, no. 2, pp. 640–660, 2017.
+[22] A. Shaban, C.-A. Cheng, N. Hatch, and B. Boots, “Truncated back-propagation for bilevel optimization,” in Proc. Intl. Conf. on Artif. Intell. and Stat., Naha, Okinawa, Japan, Apr. 2019, pp. 1723–1732.
+[23] R. Grazzi, L. Franceschi, M. Pontil, and S. Salzo, “On the iteration complexity of hypergradient computation,” in Proc. Intl. Conf. Machine Learn., virtual, Jul. 2020, pp. 3748–3758.
+[24] R. Liu, P. Mu, X. Yuan, S. Zeng, and J. Zhang, “A generic first-order algorithmic framework for bi-level programming beyond lower-level singleton,” in Proc. of International Conference on Machine Learning, Virtual, July 2020, pp. 6305–6315.
+[25] P. Khanduri, S. Zeng, M. Hong, H.-T. Wai, Z. Wang, and Z. Yang, “A momentum-assisted single-timescale stochastic approximation algorithm for bilevel optimization,” arXiv preprint arXiv:2102.07367, Feb. 2021.
+[26] Z. Guo and T. Yang, “Randomized stochastic variance-reduced methods for stochastic bilevel optimization,” arXiv preprint arXiv:2105.02266, May 2021.
+[27] J. Yang, K. Ji, and Y. Liang, “Provably faster algorithms for bilevel optimization,” arXiv preprint arXiv:2106.04692, Jun. 2021.
+[28] T. Lin, C. Jin, and M. Jordan, “On gradient descent ascent for nonconvex-concave minimax problems,” in Proc. Intl. Conf. Machine Learn., virtual, Jul. 2020, pp. 6083–6093.
+[29] T. Yoon and E. K. Ryu, “Accelerated algorithms for smooth convex-concave minimax problems with $O ( 1 / k ^ { 2 } )$ rate on squared gradient norm,” in Proc. Intl. Conf. Machine Learn., Virtual, Jul. 2021.
+[30] M. Nouiehed, M. Sanjabi, T. Huang, J. D. Lee, and M. Razaviyayn, “Solving a class of nonconvex min-max games using iterative first order methods,” in Proc. Advances in Neural Info. Process. Syst., Vancouver, Canada, Dec. 2019, pp. 14 934–14 942.
+[31] L. Luo, H. Ye, Z. Huang, and T. Zhang, “Stochastic recursive gradient descent ascent for stochastic nonconvex-strongly-concave minimax problems,” in Proc. Advances in Neural Info. Process. Syst., Virtual, Dec. 2020.
+[32] Y. Yan, Y. Xu, Q. Lin, W. Liu, and T. Yang, “Optimal epoch stochastic gradient descent ascent methods for min-max optimization,” Proc. Advances in Neural Info. Process. Syst., vol. 33, Dec. 2020.
+[33] Q. Tran Dinh, D. Liu, and L. Nguyen, “Hybrid variance-reduced sgd algorithms for minimax problems with nonconvex-linear function,” in Proc. Advances in Neural Info. Process. Syst., Virtual, Dec. 2020.
+[34] M. Liu, Y. Mroueh, J. Ross, W. Zhang, X. Cui, P. Das, and T. Yang, “Towards better understanding of adaptive gradient algorithms in generative adversarial nets,” in Proc. Intl. Conf. Learn. Representations, Virtual, Apr. 2020.
+[35] J. Yang, N. Kiyavash, and N. He, “Global convergence and variance reduction for a class of nonconvex-nonconcave minimax problems,” in Proc. Advances in Neural Info. Process. Syst., Virtual, Dec. 2020.
+[36] J. Diakonikolas, C. Daskalakis, and M. Jordan, “Efficient methods for structured nonconvexnonconcave min-max optimization,” in Proc. Intl. Conf. on Artif. Intell. and Stat., Virtual, Apr. 2021.
+[37] M. Wang, J. Liu, and E. Fang, “Accelerating stochastic composition optimization,” Journal Machine Learning Research, vol. 18, no. 1, pp. 3721–3743, 2017.
+[38] T. Chen, Y. Sun, and W. Yin, “Solving stochastic compositional optimization is nearly as easy as solving stochastic optimization,” IEEE Trans. Sig. Proc., vol. 69, Aug. 2021.
+[39] A. Ruszczynski, “A stochastic subgradient method for nonsmooth nonconvex multi-level composition optimization,” arXiv preprint:2001.10669, Jan. 2020.
+[40] X. Lian, M. Wang, and J. Liu, “Finite-sum composition optimization via variance reduced gradient descent,” in Proc. Intl. Conf. on Artif. Intell. and Stat., Fort Lauderdale, FL, Apr. 2017.
+[41] J. Zhang and L. Xiao, “A stochastic composite gradient method with incremental variance reduction,” in Proc. Advances in Neural Info. Process. Syst., Vancouver, Canada, Dec. 2019.
+[42] Q. Tran-Dinh, N. Pham, and L. Nguyen, “Stochastic gauss-newton algorithms for nonconvex compositional optimization,” in Proc. Intl. Conf. Machine Learn., Virtual, Jul. 2020.
+[43] S. Ghadimi and G. Lan, “Stochastic first-and zeroth-order methods for nonconvex stochastic programming,” SIAM Journal on Optimization, vol. 23, no. 4, pp. 2341–2368, 2013.
+[44] V. Konda and V. Borkar, “Actor-critic-type learning algorithms for markov decision processes,” SIAM Journal on Control and Optimization, vol. 38, no. 1, pp. 94–123, 1999.
+[45] J. Wen, S. Kumar, R. Gummadi, and D. Schuurmans, “Characterizing the gap between actorcritic and policy gradient,” in Proc. Intl. Conf. Machine Learn., Virtual, 2021.
+[46] L. Zheng, T. Fiez, Z. Alumbaugh, B. Chasnov, and L. J. Ratliff, “Stackelberg actor-critic: Game-theoretic reinforcement learning algorithms,” arXiv preprint arXiv:2109.12286, 2021.
+[47] R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction. MIT Press, 2018.
+[48] R. Sutton, “Learning to predict by the methods of temporal differences,” Machine Learning, vol. 3, pp. 9–44, 1988.
+[49] R. Sutton, D. McAllester, S. Singh, and Y. Mansour, “Policy gradient methods for reinforcement learning with function approximation.” in Proc. Advances in Neural Info. Process. Syst., 2000.
+[50] Y. Wu, W. Zhang, P. Xu, and Q. Gu, “A finite time analysis of two time-scale actor critic methods,” in Proc. Advances in Neural Info. Process. Syst., 2020.
+[51] T. Xu, Z. Wang, and Y. Liang, “Improving sample complexity bounds for (natural) actor-critic algorithms,” in Proc. Advances in Neural Info. Process. Syst., 2020.
+[52] Z. Fu, Z. Yang, and Z. Wang, “Single-timescale actor-critic provably finds globally optimal policy,” in Proc. Intl. Conf. Learn. Representations, 2020.
+[53] Y. Nesterov, Introductory Lectures on Convex Optimization: A basic course. Berlin, Germany: Springer, 2013, vol. 87.
+[54] J. Bhandari, D. Russo, and R. Singal, “A finite time analysis of temporal difference learning with linear function approximation.” in COLT, 2018.
+[55] T. Xu, Z. Wang, Y. Zhou, and Y. Liang, “Reanalysis of variance reduced temporal difference learning,” in Proc. Intl. Conf. Learn. Representations, 2020.
+[56] K. Zhang, A. Koppel, H. Zhu, and T. Ba¸sar, “Global convergence of policy gradient methods to (almost) locally optimal policies,” arXiv preprint:1906.08383, 2019.
+[57] A. Agarwal, S. M. Kakade, J. D. Lee, and G. Mahajan, “Optimality and approximation with policy gradient methods in markov decision processes.” in Proc. of Thirty Third Conference on Learning Theory, 2020.
+[58] K. Doya, “Reinforcement learning in continuous time and space,” Neural Computation, vol. 12, no. 1, pp. 219–245, 2000.
+[59] J. Baxter and P. L. Bartlett, “Infinite-horizon policy-gradient estimation,” J. Artificial Intelligence Res., vol. 15, pp. 319–350, 2001.
+[60] A. Y. Mitrophanov, “Sensitivity and convergence of uniformly ergodic markov chains,” Journal of Applied Probability, vol. 42, no. 4, pp. 1003–1014, 2005.
+[61] S. Qiu, Z. Yang, J. Ye, and Z. Wang, “On the finite-time convergence of actor-critic algorithm,” in Optimization Foundations for Reinforcement Learning Workshop at Advances in Neural Information Processing Systems, 2019.
\ No newline at end of file
diff --git a/md/train/OJLaKwiXSbx/OJLaKwiXSbx.md b/md/train/OJLaKwiXSbx/OJLaKwiXSbx.md
new file mode 100644
index 0000000000000000000000000000000000000000..d9433accbf72a29efc09f635669b1b37f5323ea9
--- /dev/null
+++ b/md/train/OJLaKwiXSbx/OJLaKwiXSbx.md
@@ -0,0 +1,318 @@
+# Align before Fuse: Vision and Language Representation Learning with Momentum Distillation
+
+Junnan Li, Ramprasaath R. Selvaraju, Akhilesh D. Gotmare Shafiq Joty, Caiming Xiong, Steven C.H. Hoi Salesforce Research {junnan.li,rselvaraju,akhilesh.gotmare,sjoty,shoi}@salesforce.com
+
+# Abstract
+
+Large-scale vision and language representation learning has shown promising improvements on various vision-language tasks. Most existing methods employ a transformer-based multimodal encoder to jointly model visual tokens (region-based image features) and word tokens. Because the visual tokens and word tokens are unaligned, it is challenging for the multimodal encoder to learn image-text interactions. In this paper, we introduce a contrastive loss to ALign the image and text representations BEfore Fusing (ALBEF) them through cross-modal attention, which enables more grounded vision and language representation learning. Unlike most existing methods, our method does not require bounding box annotations nor high-resolution images. To improve learning from noisy web data, we propose momentum distillation, a self-training method which learns from pseudo-targets produced by a momentum model. We provide a theoretical analysis of ALBEF from a mutual information maximization perspective, showing that different training tasks can be interpreted as different ways to generate views for an image-text pair. ALBEF achieves state-of-the-art performance on multiple downstream visionlanguage tasks. On image-text retrieval, ALBEF outperforms methods that are pre-trained on orders of magnitude larger datasets. On VQA and $\mathrm { \Delta N L V R ^ { 2 } }$ , ALBEF achieves absolute improvements of $2 . 3 7 \%$ and $3 . 8 4 \%$ compared to the state-ofthe-art, while enjoying faster inference speed. Code and models are available at https://github.com/salesforce/ALBEF.
+
+# 1 Introduction
+
+Vision-and-Language Pre-training (VLP) aims to learn multimodal representations from large-scale image-text pairs that can improve downstream Vision-and-Language $( \mathrm { V } { + } \mathrm { L } )$ tasks. Most existing VLP methods (e.g. LXMERT [1], UNITER [2], OSCAR $\pmb { \| 3 \| }$ ) rely on pre-trained object detectors to extract region-based image features, and employ a multimodal encoder to fuse the image features with word tokens. The multimodal encoder is trained to solve tasks that require joint understanding of image and text, such as masked language modeling (MLM) and image-text matching (ITM).
+
+While effective, this VLP framework suffers from several key limitations: (1) The image features and the word token embeddings reside in their own spaces, which makes it challenging for the multimodal encoder to learn to model their interactions; (2) The object detector is both annotation-expensive and compute-expensive, because it requires bounding box annotations during pre-training, and highresolution (e.g. $6 0 0 \times 1 0 0 0 )$ images during inference; (3) The widely used image-text datasets [4, 5] are collected from the web and are inherently noisy, and existing pre-training objectives such as MLM may overfit to the noisy text and degrade the model’s generalization performance.
+
+We propose ALign BEfore Fuse (ALBEF), a new VLP framework to address these limitations. We first encode the image and text independently with a detector-free image encoder and a text encoder. Then we use a multimodal encoder to fuse the image features with the text features through crossmodal attention. We introduce an intermediate image-text contrastive (ITC) loss on representations from the unimodal encoders, which serves three purposes: (1) it aligns the image features and the text features, making it easier for the multimodal encoder to perform cross-modal learning; (2) it improves the unimodal encoders to better understand the semantic meaning of images and texts; (3) it learns a common low-dimensional space to embed images and texts, which enables the image-text matching objective to find more informative samples through our contrastive hard negative mining.
+
+To improve learning under noisy supervision, we propose Momentum Distillation (MoD), a simple method which enables the model to leverage a larger uncurated web dataset. During training, we keep a momentum version of the model by taking the moving-average of its parameters, and use the momentum model to generate pseudo-targets as additional supervision. With MoD, the model is not penalized for producing other reasonable outputs that are different from the web annotation. We show that MoD not only improves pre-training, but also downstream tasks with clean annotations.
+
+We provide theoretical justifications on ALBEF from the perspective of mutual information maximization. Specifically, we show that ITC and MLM maximize a lower bound on the mutual information between different views of an image-text pair, where the views are generated by taking partial information from each pair. From this perspective, our momentum distillation can be interpreted as generating new views with semantically similar samples. Therefore, ALBEF learns vision-language representations that are invariant to semantic-preserving transformations.
+
+We demonstrate the effectiveness of ALBEF on various downstream $_ { \mathrm { V + L } }$ tasks including image-text retrieval, visual question answering, visual reasoning, visual entailment, and weakly-supervised visual grounding. ALBEF achieves substantial improvements over existing state-of-the-art methods. On image-text retrieval, it outperforms methods that are pre-trained on orders of magnitude larger datasets (CLIP $\pmb { \Vert 6 \Vert }$ and ALIGN $\bar { \mathbb { Z } } \bar { \mathbb { I } }$ ). On VQA and $\mathrm { \Delta N L V R ^ { 2 } }$ , it achieves absolute improvements of $\mathrm { \bar { 2 . 3 7 \% } }$ and $3 . 8 4 \%$ compared to the state-of-the-art method VILLA $\textcircled { 8 }$ , while enjoying much faster inference speed. We also provide quantitative and qualitative analysis on ALBEF using Grad-CAM $\bigstar \bigstar$ , which reveals its ability to perform accurate object, attribute and relationship grounding implicitly.
+
+# 2 Related Work
+
+# 2.1 Vision-Language Representation Learning
+
+Most existing work on vision-language representation learning fall into two categories. The first category focuses on modelling the interactions between image and text features with transformerbased multimodal encoders [10, 11, 12, 13, 1, 14, 15, 2, 3, 16, 8, 17, 18]. Methods in this category achieve superior performance on downstream $_ { \mathrm { V + L } }$ tasks that require complex reasoning over image and text (e.g. NLVR2 [19], VQA $\pmb { \mathbb { D } } \pmb { \mathbb { O } } \Vert$ ), but most of them require high-resolution input images and pre-trained object detectors. A recent method $\mathbb { \left| \mathbb { Z } \right\| }$ improves inference speed by removing the object detector, but results in lower performance. The second category focuses on learning separate unimodal encoders for image and text [22, 23, 6, 7]. The recent CLIP $\boxed { 6 }$ and ALIGN [7] perform pre-training on massive noisy web data using a contrastive loss, one of the most effective loss for representation learning [24, 25, 26, 27]. They achieve remarkable performance on image-text retrieval tasks, but lack the ability to model more complex interactions between image and text for other $_ { \mathrm { V + L } }$ tasks $\scriptstyle { \left[ \left[ 2 1 \right] \right] }$ .
+
+ALBEF unifies the two categories, leading to strong unimodal and multimodal representations with superior performance on both retrieval and reasoning tasks. Furthermore, ALBEF does not require object detectors, a major computation bottleneck for many existing methods [1, 2, 3, 8, 17].
+
+# 2.2 Knowledge Distillation
+
+Knowledge distillation $\pmb { \left[ \widetilde { \left| 2 8 \right| } \right] }$ aims to improve a student model’s performance by distilling knowledge from a teacher model, usually through matching the student’s prediction with the teacher’s. While most methods focus on distilling knowledge from a pre-trained teacher model [28, 29, 30, 31, 32], online distillation [33, 34] simultaneously trains multiple models and use their ensemble as the teacher. Our momentum distillation can be interpreted as a form of online self-distillation, where a temporal ensemble of the student model is used as the teacher. Similar ideas have been explored in semi-supervised learning $\pmb { \Vert 3 5 \Vert }$ , label noise learning $\textcircled { \left| 3 6 \right| }$ , and very recently in contrastive learning $\pmb { \mathbb { B 7 } }$ . Different from existing studies, we theoretically and experimentally show that momentum distillation is a generic learning algorithm that can improve the model’s performance on many $_ { \mathrm { V + L } }$ tasks.
+
+# 3 ALBEF Pre-training
+
+In this section, we first introduce the model architecture (Section $\textcircled { 3 . 1 }$ . Then we delineate the pretraining objectives (Section $\boxed { 3 . 2 }$ , followed by the proposed momentum distillation (Section $\bar { 3 } . 3 )$ Lastly we describe the pre-training datasets (Section $3 . { \overset { \cdot } { 4 } } )$ and implementation details (Section $\underline { { \vert 3 . 5 \vert } }$
+
+
+Figure 1: Illustration of ALBEF. It consists of an image encoder, a text encoder, and a multimodal encoder. We propose an image-text contrastive loss to align the unimodal representations of an image-text pair before fusion. An image-text matching loss (using in-batch hard negatives mined through contrastive similarity) and a masked-language-modeling loss are applied to learn multimodal interactions between image and text. In order to improve learning with noisy data, we generate pseudo-targets using the momentum model (a moving-average version of the base model) as additional supervision during training.
+
+# 3.1 Model Architecture
+
+As illustrated in Figure $\mathbb { L } ,$ ALBEF contains an image encoder, a text encoder, and a multimodal encoder. We use a 12-layer visual transformer ViT-B/16 $\mathbb { \left. 3 8 \right. }$ as the image encoder, and initialize it with weights pre-trained on ImageNet-1k from $\pmb { \mathbb { B } } \mathbf { \mathbb { 1 } }$ . An input image $I$ is encoded into a sequence of embeddings: $\{ \pmb { v } _ { \mathrm { c l s } } , \pmb { v } _ { 1 } , . . . , \pmb { v } _ { N } \}$ , where $v _ { \mathrm { c l s } }$ is the embedding of the [CLS] token. We use a 6-layer transformer $\textcircled { \ 3 9 } \textcircled { }$ for both the text encoder and the multimodal encoder. The text encoder is initialized using the first 6 layers of the $\mathbf { B E R T _ { b a s e } }$ $\textcircled { | 4 0 | }$ model, and the multimodal encoder is initialized using the last 6 layers of the $\mathbf { B E R T _ { b a s e } }$ . The text encoder transforms an input text $T$ into a sequence of embeddings $\{ \boldsymbol { w } _ { \mathrm { c l s } } , \boldsymbol { w } _ { 1 } , . . . , \boldsymbol { w } _ { N } \}$ , which is fed to the multimodal encoder. The image features are fused with the text features through cross attention at each layer of the multimodal encoder.
+
+# 3.2 Pre-training Objectives
+
+We pre-train ALBEF with three objectives: image-text contrastive learning (ITC) on the unimodal encoders, masked language modeling (MLM) and image-text matching (ITM) on the multimodal encoder. We improve ITM with online contrastive hard negative mining.
+
+Image-Text Contrastive Learning aims to learn better unimodal representations before fusion. It learns a similarity function $\boldsymbol { s } = \boldsymbol { g _ { v } } \big ( \boldsymbol { v } _ { \mathrm { c l s } } \big ) ^ { \top } \boldsymbol { g _ { w } } \big ( \boldsymbol { w } _ { \mathrm { c l s } } \big )$ , such that parallel image-text pairs have higher similarity scores. $g _ { v }$ and $g _ { w }$ are linear transformations that map the [CLS] embeddings to normalized lower-dimensional (256-d) representations. Inspired by MoCo $\pmb { \Vert 2 4 \Vert }$ , we maintain two queues to store the most recent $M$ image-text representations from the momentum unimodal encoders. The normalized features from the momentum encoders are denoted as $g _ { v } ^ { \prime } ( v _ { \mathrm { c l s } } ^ { \prime } )$ and $g _ { w } ^ { \prime } ( w _ { \mathrm { c l s } } ^ { \prime } )$ . We define $s ( I , T ) = g _ { v } ( \pmb { v } _ { \mathrm { c l s } } ) ^ { \top } g _ { w } ^ { \prime } ( \pmb { w } _ { \mathrm { c l s } } ^ { \prime } )$ and $s ( T , I ) = g _ { w } ( \pmb { w } _ { \mathrm { c l s } } ) ^ { \top } g _ { v } ^ { \prime } ( \pmb { v } _ { \mathrm { c l s } } ^ { \prime } )$ .
+
+For each image and text, we calculate the softmax-normalized image-to-text and text-to-image similarity as:
+
+$$
+p _ { m } ^ { \mathrm { i 2 t } } ( I ) = \frac { \exp ( s ( I , T _ { m } ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ( I , T _ { m } ) / \tau ) } , ~ p _ { m } ^ { \mathrm { t 2 i } } ( T ) = \frac { \exp ( s ( T , I _ { m } ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ( T , I _ { m } ) / \tau ) }
+$$
+
+where $\tau$ is a learnable temperature parameter. Let ${ \boldsymbol { y } } ^ { \mathrm { i 2 t } } ( I )$ and $\boldsymbol { y } ^ { \mathrm { t 2 i } } ( \boldsymbol { T } )$ denote the ground-truth one-hot similarity, where negative pairs have a probability of 0 and the positive pair has a probability of 1. The image-text contrastive loss is defined as the cross-entropy $\mathrm { H }$ between $\pmb { p }$ and $\textbf { { y } }$ :
+
+$$
+\mathcal { L } _ { \mathrm { i t c } } = \frac { 1 } { 2 } \mathbb { E } _ { ( I , T ) \sim D } \big [ \mathrm { H } ( y ^ { \mathrm { i 2 t } } ( I ) , p ^ { \mathrm { i 2 t } } ( I ) ) + \mathrm { H } ( y ^ { \mathrm { t 2 i } } ( T ) , p ^ { \mathrm { t 2 i } } ( T ) ) \big ]
+$$
+
+
+Figure 2: Examples of the pseudo-targets for MLM (1st row) and ITC (2nd row). The pseudo-targets can capture visual concepts that are not described by the ground-truth text (e.g. “beautiful waterfall”, “young woman”).
+
+Masked Language Modeling utilizes both the image and the contextual text to predict the masked words. We randomly mask out the input tokens with a probability of $15 \%$ and replace them with the special token [MASK]1. Let $\hat { T }$ denote a masked text, and $p ^ { \mathrm { m s k } } ( I , \hat { T } )$ denote the model’s predicted probability for a masked token. MLM minimizes a cross-entropy loss:
+
+$$
+\mathcal { L } _ { \mathrm { m l m } } = \mathbb { E } _ { ( I , \hat { T } ) \sim D } \mathrm { H } ( \pmb { y } ^ { \mathrm { m s k } } , \pmb { p } ^ { \mathrm { m s k } } ( I , \hat { T } ) )
+$$
+
+where $y ^ { \mathrm { m s k } }$ is a one-hot vocabulary distribution where the ground-truth token has a probability of 1.
+
+Image-Text Matching predicts whether a pair of image and text is positive (matched) or negative (not matched). We use the multimodal encoder’s output embedding of the [CLS] token as the joint representation of the image-text pair, and append a fully-connected (FC) layer followed by softmax to predict a two-class probability $p ^ { \mathrm { i t m } }$ . The ITM loss is:
+
+$$
+\mathcal { L } _ { \mathrm { i t m } } = \mathbb { E } _ { ( I , T ) \sim D } \mathrm { H } ( \pmb { y } ^ { \mathrm { i t m } } , \pmb { p } ^ { \mathrm { i t m } } ( I , T ) )
+$$
+
+where ${ \boldsymbol { y } } ^ { \mathrm { i t m } }$ is a 2-dimensional one-hot vector representing the ground-truth label.
+
+We propose a strategy to sample hard negatives for the ITM task with zero computational overhead. A negative image-text pair is hard if they share similar semantics but differ in fine-grained details. We use the contrastive similarity from Equation $\bigstar$ to find in-batch hard negatives. For each image in a mini-batch, we sample one negative text from the same batch following the contrastive similarity distribution, where texts that are more similar to the image have a higher chance to be sampled. Likewise, we also sample one hard negative image for each text.
+
+The full pre-training objective of ALBEF is:
+
+$$
+\mathcal { L } = \mathcal { L } _ { \mathrm { i t c } } + \mathcal { L } _ { \mathrm { m l m } } + \mathcal { L } _ { \mathrm { i t m } }
+$$
+
+# 3.3 Momentum Distillation
+
+The image-text pairs used for pre-training are mostly collected from the web and they tend to be noisy. Positive pairs are usually weakly-correlated: the text may contain words that are unrelated to the image, or the image may contain entities that are not described in the text. For ITC learning, negative texts for an image may also match the image’s content. For MLM, there may exist other words different from the annotation that describes the image equally well (or better). However, the one-hot labels for ITC and MLM penalize all negative predictions regardless of their correctness.
+
+To address this, we propose to learn from pseudo-targets generated by the momentum model. The momentum model is a continuously-evolving teacher which consists of exponential-moving-average versions of the unimodal and multimodal encoders. During training, we train the base model such that its predictions match the ones from the momentum model. Specifically, for ITC, we first compute the image-text similarity using features from the momentum unimodal encoders as $s ^ { \prime } ( I , T ) \stackrel { \cdot } { = } g _ { v } ^ { \prime } ( { \pmb v } _ { \mathrm { c l s } } ^ { \prime } ) ^ { \top } \breve { g } _ { w } ^ { \prime } ( { \pmb w } _ { \mathrm { c l s } } ^ { \prime } )$ and $s ^ { \prime } ( T , I ) \stackrel { \mathrm { ~ \tiny ~ = ~ } } { = } g _ { w } ^ { \prime } ( { \pmb w } _ { \mathrm { c l s } } ) ^ { \top } g _ { v } ^ { \prime } ( { \pmb v } _ { \mathrm { c l s } } ^ { \prime } )$ . Then we compute soft pseudotargets $q ^ { \mathrm { i 2 t } }$ and $q ^ { \mathrm { t 2 i } }$ by replacing $s$ with $s ^ { \prime }$ in Equation 1. The $\mathrm { I T C } _ { \mathrm { M o D } }$ loss is defined as:
+
+$$
+{ \mathcal { L } } _ { \mathrm { i t c } } ^ { \mathrm { m o d } } = ( 1 - \alpha ) { \mathcal { L } } _ { \mathrm { i t c } } + { \frac { \alpha } { 2 } } { \mathbb { E } } _ { ( I , T ) \sim D } \left[ \mathrm { K L } ( q ^ { \mathrm { i } 2 \mathrm { t } } ( I ) \parallel p ^ { \mathrm { i } 2 \mathrm { t } } ( I ) ) + \mathrm { K L } ( q ^ { \mathrm { t } 2 \mathrm { i } } ( T ) \parallel p ^ { \mathrm { t } 2 \mathrm { i } } ( T ) ) \right]
+$$
+
+Similarly, for MLM, let $\pmb q ^ { \mathrm { m s k } } ( I , \hat { T } )$ denote the momentum model’s prediction probability for the masked token, the $\mathbf { M L M } _ { \mathrm { M o D } }$ loss is:
+
+$$
+\mathcal { L } _ { \mathrm { m l m } } ^ { \mathrm { m o d } } = ( 1 - \alpha ) \mathcal { L } _ { \mathrm { m l m } } + \alpha \mathbb { E } _ { ( I , \hat { T } ) \sim D } \mathrm { K L } ( \pmb { q } ^ { \mathrm { m s k } } ( I , \hat { T } ) \parallel p ^ { \mathrm { m s k } } ( I , \hat { T } ) )
+$$
+
+In Figure $\bigstar$ we show examples of the top-5 candidates from the pseudo-targets, which effectively capture relevant words/texts for an image. More examples can be found in Appendix.
+
+We also apply MoD to the downstream tasks. The final loss for each task is a weighted combination of the original task’s loss and the KL-divergence between the model’s prediction and the pseudo-targets. For simplicity, we set the weight $\alpha = 0 . 4$ for all pre-training and downstream tasks 2.
+
+# 3.4 Pre-training Datasets
+
+Following UNITER [2], we construct our pre-training data using two web datasets (Conceptual Captions [4], SBU Captions $\pmb { \mathbb { B } } \mathbf { \| }$ ) and two in-domain datasets (COCO [41] and Visual Genome [42]). The total number of unique images is $4 . 0 \mathbf { M }$ , and the number of image-text pairs is 5.1M. To show that our method is scalable with larger-scale web data, we also include the much noisier Conceptual 12M dataset $\mathbb { \lVert \rVert 3 \rVert }$ , increasing the total number of images to $1 4 . 1 \mathrm { M } \big \sharp$ Details are in Appendix.
+
+# 3.5 Implementation Details
+
+Our model consists of a $\mathbf { B E R T _ { b a s e } }$ with 123.7M parameters and a ViT-B/16 with $8 5 . 8 \mathbf { M }$ parameters. We pre-train the model for 30 epochs using a batch size of 512 on 8 NVIDIA A100 GPUs. We use the AdamW $\pm \boxed { \boxed { 4 4 } }$ optimizer with a weight decay of 0.02. The learning rate is warmed-up to $1 e ^ { - 4 }$ in the first 1000 iterations, and decayed to $1 e ^ { - 5 }$ following a cosine schedule. During pre-training, we take random image crops of resolution $2 5 6 \times 2 5 6$ as input, and also apply RandAugment4 [45]. During fine-tuning, we increase the image resolution to $3 8 4 \times 3 8 4$ and interpolate the positional encoding of image patches following $\left[ \left[ 3 8 \right] \right]$ . The momentum parameter for updating the momentum model is set as 0.995, and the size of the queue used for image-text contrastive learning is set as 65,536. We linearly ramp-up the distillation weight $\alpha$ from 0 to 0.4 within the 1st epoch.
+
+# 4 A Mutual Information Maximization Perspective
+
+In this section, we provide an alternative perspective of ALBEF and show that it maximizes a lower bound on the mutual information (MI) between different “views” of an image-text pair. ITC, MLM, and MoD can be interpreted as different ways to generate the views.
+
+Formally, we define two random variables $a$ and $b$ as two different views of a data point. In selfsupervised learning $[ 1 2 4 , 1 2 5 , | 4 6 |$ , $a$ and $b$ are two augmentations of the same image. In vision-language representation learning, we consider $a$ and $b$ as different variations of an image-text pair that capture its semantic meaning. We aim to learn representations invariant to the change of view. This can be achieved by maximizing the MI between $a$ and $b$ . In practice, we maximize a lower bound on $\textstyle \mathbf { M } ( a , b )$ by minimizing the InfoNCE loss [47] defined as:
+
+$$
+\mathcal { L } _ { \mathrm { N C E } } = - \mathbb { E } _ { p ( a , b ) } \left[ \log \frac { \exp ( s ( a , b ) ) } { \sum _ { \hat { b } \in \hat { B } } \exp ( s ( a , \hat { b } ) ) } \right]
+$$
+
+where $s ( a , b )$ is a scoring function (e.g., a dot product between two representations), and $\hat { B }$ contains the positive sample $b$ and $| \hat { B } | - 1$ negative samples drawn from a proposal distribution.
+
+Our ITC loss with one-hot labels (Equation $^ { 2 ) }$ can be re-written as:
+
+$$
+\mathcal { L } _ { \mathrm { i t c } } = - \frac { 1 } { 2 } \mathbb { E } _ { p ( I , T ) } \big [ \log \frac { \exp ( s ( I , T ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ( I , T _ { m } ) / \tau ) } + \log \frac { \exp ( s ( T , I ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ( T , I _ { m } ) / \tau ) } \big ]
+$$
+
+Minimizing $\mathcal { L } _ { \mathrm { i t c } }$ can be seen as maximizing a symmetric version of InfoNCE. Hence, ITC considers the two individual modalities (i.e., $I$ and $T$ ) as the two views of an image-text pair, and trains the unimodal encoders to maximize the MI between the image and text views for the positive pairs.
+
+As shown in $[ \overline { { | 4 8 | } }$ , we can also interpret MLM as maximizing the MI between a masked word token and its masked context (i.e. image $^ +$ masked text). Specifically, we can re-write the MLM loss with one-hot labels (Equation $\textcircled { 3 }$ as
+
+$$
+\mathcal { L } _ { \mathrm { m l m } } = - \mathbb { E } _ { p ( I , \hat { T } ) } \big [ \log \frac { \exp ( \psi ( y ^ { \mathrm { m s k } } ) ^ { \top } f ( I , \hat { T } ) ) } { \sum _ { y \in \mathcal { V } } \exp ( \psi ( y ) ^ { \top } f ( I , \hat { T } ) ) } \big ]
+$$
+
+where $\psi ( y ) : \mathcal { V } \to \mathbb { R } ^ { d }$ is a lookup function in the multimodal encoder’s output layer that maps a word token $y$ into a vector and $\nu$ is the full vocabulary set, and $f ( I , { \hat { T } } )$ is a function that returns the final hidden state of the multimodal encoder corresponding to the masked context. Hence, MLM considers the two views of an image-text pair to be: (1) a randomly selected word token, and (2) the image $^ +$ the contextual text with that word masked.
+
+Both ITC and MLM generate views by taking partial information from an image-text pair, through either modality separation or word masking. Our momentum distillation can be considered as generating alternative views from the entire proposal distribution. Take $\mathrm { I T C } _ { \mathrm { M o D } }$ in Equation $6$ as an example, minimizing $\mathrm { K L } ( p ^ { \mathrm { i 2 t } } ( I ) , q ^ { \mathrm { i 2 t } } ( I ) )$ is equivalent to minimizing the following objective:
+
+$$
+- \sum _ { m } q _ { m } ^ { \mathrm { i } 2 \mathrm { t } } ( I ) \log p _ { m } ^ { \mathrm { i } 2 \mathrm { t } } ( I ) = - \sum _ { m } \frac { \exp ( s ^ { \prime } ( I , T _ { m } ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ^ { \prime } ( I , T _ { m } ) / \tau ) } \log \frac { \exp ( s ( I , T _ { m } ) / \tau ) } { \sum _ { m = 1 } ^ { M } \exp ( s ( I , T _ { m } ) / \tau ) }
+$$
+
+It maximizes $\mathbf { M I } ( I , T _ { m } )$ for texts that share similar semantic meaning with the image $I$ because those texts would have larger $q _ { m } ^ { \mathrm { i 2 t } } ( I )$ . Similarly, $\mathrm { I T C } _ { \mathrm { M o D } }$ also maximizes $\mathbf { M } \mathbf { I } ( I _ { m } , T )$ for images that are similar to $T$ . We can follow the same method to show that $\mathbf { M L M } _ { \mathrm { M o D } }$ generates alternative views $y ^ { \prime } \in \mathcal { V }$ for the masked word $y ^ { \mathrm { m s k } }$ , and maximizes the MI between $y ^ { \prime }$ and $( I , { \hat { T } } )$ . Therefore, our momentum distillation can be considered as performing data augmentation to the original views. The momentum model generates a diverse set of views that are absent in the original image-text pairs, and encourages the base model to learn representations that capture view-invariant semantic information.
+
+# 5 Downstream $\mathbf { V } { + } \mathbf { L }$ Tasks
+
+We adapt the pre-trained model to five downstream $_ { \mathrm { V + L } }$ tasks. We introduce each task and our fine-tuning strategy below. Details of the datasets and fine-tuning hyperparameters are in Appendix.
+
+Image-Text Retrieval contains two subtasks: image-to-text retrieval (TR) and text-to-image retrieval (IR). We evaluate ALBEF on the Flickr30K $\bar { \mathbb { E 9 } } \bar { \mathbb { I } }$ and COCO benchmarks, and fine-tune the pretrained model using the training samples from each dataset. For zero-shot retrieval on Flickr30K, we evaluate with the model fine-tuned on COCO. During fine-tuning, we jointly optimize the ITC loss (Equation $2 )$ and the ITM loss (Equation $\textcircled{4}$ . ITC learns an image-text scoring function based on similarity of unimodal features, whereas ITM models the fine-grained interaction between image and text to predict a matching score. Since the downstream datasets contain multiple texts for each image, we change the ground-truth label of ITC to consider multiple positives in the queue, where each positive has a ground-truth probability of 1/#positives. During inference, we first compute the feature similarity score $s _ { \mathrm { i t c } }$ for all image-text pairs. Then we take the top- $k$ candidates and calculate their ITM score $s _ { \mathrm { i t m } }$ for ranking. Because $k$ can be set to be very small, our inference speed is much faster than methods that require computing the ITM score for all image-text pairs [2, 3, 8].
+
+Visual Entailment (SNLI-VE5 [51]) is a fine-grained visual reasoning task to predict whether the relationship between an image and a text is entailment, neutral, or contradictory. We follow UNITER $\left[ \left[ 2 \right] \right]$ and consider VE as a three-way classification problem, and predict the class probabilities using a multi-layer perceptron (MLP) on the multimodal encoder’s representation of the [CLS] token.
+
+Visual Question Answering (VQA $\pmb { \mathbb { B } 2 } \mathbf { l }$ ) requires the model to predict an answer given an image and a question. Different from existing methods that formulate VQA as a multi-answer classification problem [53, 2], we consider VQA as an answer generation problem, similar to [54]. Specifically, we use a 6-layer transformer decoder to generate the answer. As shown in Figure 3a, the auto-regressive answer decoder receives the multimodal embeddings through cross attention, and a start-of-sequence token ([CLS]) is used as the decoder’s initial input token. Likewise, an end-of-sequence token ([SEP]) is appended to the end of decoder outputs which indicates the completion of generation.
+
+
+Figure 3: The model architecture for VQA and $\mathrm { \tt N L V R } ^ { 2 }$ . For VQA, we append an auto-regressive decoder to generate the answer given the image-question embeddings. For $\mathrm { \dot { N L V R } ^ { 2 } }$ , we replicate the transformer block within each layer of multimodal encoder to enable reasoning over two images.
+
+The answer decoder is initialized using the pre-trained weights from the multimodal encoder, and finetuned with a conditional language-modeling loss. For a fair comparison with existing methods, we constrain the decoder to only generate from the 3,128 candidate answers $ { \Vert 5 5 \Vert }$ during inference.
+
+Natural Language for Visual Reasoning (NLVR2 [19]) requires the model to predict whether a text describes a pair of images. We extend our multimodal encoder to enable reasoning over two images. As shown in Figure $3 { \mathrm { b } }$ , each layer of the multimodal encoder is replicated to have two consecutive transformer blocks, where each block contains a self-attention layer, a cross-attention layer, and a feed-forward layer (see Figure 1). The two blocks within each layer are initialized using the same pre-trained weights, and the two cross-attention layers share the same linear projection weights for the keys and values. During training, the two blocks receive two sets of image embeddings for the image pair. We append a MLP classifier on the multimodal encoder’s [CLS] representation for prediction.
+
+For $\mathrm { \Delta N L V R ^ { 2 } }$ , we perform an additional pre-training step to prepare the new multimodal encoder for encoding an image-pair. We design a text-assignment (TA) task as follows: given a pair of images and a text, the model needs to assign the text to either the first image, the second image, or none of them. We consider it as a three-way classification problem, and use a FC layer on the [CLS] representation to predict the assignment. We pre-train with TA for only 1 epoch using the 4M images (Section 3.4).
+
+Visual Grounding aims to localize the region in an image that corresponds to a specific textual description. We study the weakly-supervised setting, where no bounding box annotations are available. We perform experiments on the $\operatorname { R e f C O C O + } \mathbb { I }$ 56] dataset, and fine-tune the model using only imagetext supervision following the same strategy as image-text retrieval. During inference, we extend Grad-CAM $\pmb { \mathbb { Q } } \mathbf { \| }$ to acquire heatmaps, and use them to rank the detected proposals provided by $\mathbb { \lVert 5 3 \rVert }$
+
+# 6 Experiments
+
+# 6.1 Evaluation on the Proposed Methods
+
+First, we evaluate the effectiveness of the proposed methods (i.e. image-text contrastive learning, contrastive hard negative mining, and momentum distillation). Table $\bar { \mathbb { \perp } }$ shows the performance of the downstream tasks with different variants of our method. Compared to the baseline pre-training tasks $( \mathbf { M L M + I T M } )$ ), adding ITC substantially improves the pre-trained model’s performance across all tasks. The proposed hard negative mining improves ITM by finding more informative training samples. Furthermore, adding momentum distillation improves learning for both ITC (row 4), MLM (row 5), and on all downstream tasks (row 6). In the last row, we show that ALBEF can effectively leverage more noisy web data to improve the pre-training performance.
+
+Table 1: Evaluation of the proposed methods on four downstream $_ { \mathrm { V + L } }$ tasks. For text-retrieval (TR) and image-retrieval (IR), we report the average of $\mathbf { R } \ @ 1$ , $\mathbf { R } @ 5$ and $\mathrm { R @ 1 0 }$ . ITC: image-text contrastive learning. MLM: masked language modeling. $\mathrm { I T M } _ { \mathrm { h a r d } }$ : image-text matching with contrastive hard negative mining. MoD: momentum distillation. MoDDownstream: momentum distillation on downstream tasks.
+
+
#Pre-train Images
Training tasks
TR IR (flickr test)
SNLI-VE (test)
NLVR² (test-P)
VQA (test-dev)
4M
MLM+ ITM
93.96 88.55
77.06
77.51
71.40
ITC +MLM+ ITM
96.55 91.69
79.15
79.88
73.29
ITC + MLM + ITMhard
97.01 92.16
79.77
80.35
73.81
ITCMoD +MLM+ ITMhard
97.33 92.43
79.99
80.34
74.06
Full (ITCMoD + MLMMoD + ITMhard)
97.47 92.58
80.12
80.44
74.42
ALBEF (Full + MoDDownstream)
97.83 92.65
80.30
80.50
74.54
14M
ALBEF
98.70 94.07
80.91
83.14
75.84
+
+Table 2: Fine-tuned image-text retrieval results on Flickr30K and COCO datasets.
+
+
+
+Table 4: Comparison with state-of-the-art methods on downstream vision-language tasks.
+
+# 6.2 Evaluation on Image-Text Retrieval
+
+Table 2 and Table 3 report results on fine-tuned and zero-shot image-text retrieval, respectively. Our ALBEF achieves state-of-the-art performance, outperforming CLIP $\pmb { \Vert 6 \Vert }$ and ALIGN $[ [ 7 ]$ which are trained on orders of magnitude larger datasets. Given the considerable amount of improvement of ALBEF when the number of training images increases from 4M to 14M, we hypothesize that it has potential to further grow by training on larger-scale web image-text pairs.
+
+# 6.3 Evaluation on VQA, NLVR, and VE
+
+Table $\sharp$ reports the comparison with existing methods on other $_ { \mathrm { V + L } }$ understanding tasks. With 4M pre-training images, ALBEF already achieves state-of-the-art performance. With 14M pre-training images, ALBEF substantially outperforms existing methods, including methods that additionally use object tags $\pmb { \mathbb { B } } \|$ or adversarial data augmentation $\pmb { \mathbb { B } } ] \mathbf l$ . Compared to VILLA $\pmb { \mathbb { B } } ] \mathbf l$ , ALBEF achieves absolute improvements of $2 . 3 7 \%$ on VQA test-std, $3 . 8 4 \%$ on $\mathrm { \bar { N L V R ^ { 2 } } }$ test-P, and $1 . 8 8 \%$ on SNLI-VE test. Because ALBEF is detector-free and requires lower resolution images, it also enjoys much faster inference speed compared to most existing methods ${ \tt > } 1 0$ times faster than VILLA on ${ \mathrm { N L V R } } ^ { 2 }$ ).
+
+# 6.4 Weakly-supervised Visual Grounding
+
+Table 5 shows the results on $\operatorname { R e f C O C O + }$ , where ALBEF substantially outperforms existing methods [57, 58] (which use weaker text embeddings). The $\mathbf { A L B E F _ { i t c } }$ variant computes Grad-CAM
+
+
Method
Val
TestA
TestB
ARN 四
32.78
34.35
32.13
CCL[ 国
34.29
36.91
33.56
ALBEFitc
51.58
60.09
40.19
ALBEFitm
58.46
65.89
46.25
+
+Table 5: Weakly-supervised visual grounding on $\mathrm { R e f C O C O + }$ [56] dataset.
+
+
+Figure 4: Grad-CAM visualization on the cross-attention maps in the 3rd layer of the multimodal encoder.
+
+Q: is this rice noodle soup? Q: what is to the right of A: yes the soup? A: chopsticks
+
+Q: what does the truck on Q: what is the man doing in the street? A: walking the left sell? A: ice cream
+
+
+
+
+Figure 5: Grad-CAM visualizations on the cross-attention maps of the multimodal encoder for the VQA model. “a little girl holding a kitten next to a blue fence”
+Figure 6: Grad-CAM visualizations on the cross-attention maps corresponding to individual words.
+
+visualizations on the self-attention maps in the last layer of the image encoder, where the gradients are acquired by maximizing the image-text similarity $s _ { \mathrm { i t c } }$ . The $\mathbf { A L B E F _ { i t m } }$ variant computes Grad-CAM on the cross-attention maps in the 3rd layer of the multimodal encoder (which is a layer specialized in grounding), where the gradients are acquired by maximizing the image-text matching score $s _ { \mathrm { i t m } }$ Figure 4 provides a few visualizations. More analysis is in Appendix.
+
+We provide the Grad-CAM visualizations for VQA in Figure $\textcircled{5}$ As can be seen in Appendix, the Grad-CAM visualizations from ALBEF are highly correlated with where humans would look when making decisions. In Figure $6 ,$ we show per-word visualizations for COCO. Notice how our model not only grounds objects, but also their attributes and relationships.
+
+# 6.5 Ablation Study
+
+Table $\boxed { 6 }$ studies the effect of various design choices on image-text retrieval. Since we use $s _ { \mathrm { i t c } }$ to filter top- $k$ candidates during inference, we vary $k$ and report its effect. In general, the ranking result acquired by $s _ { \mathrm { i t m } }$ is not sensitive to changes
+
+
Flickr30K
w/ hard negs
w/o hard negs k =128
Sitc
k =16
k =128
k=256
TR
97.30
98.60
98.57
98.57
98.22 (-0.35)
IR
90.95
93.64
93.99
93.95
93.68 (-0.31)
+
+Table 6: Ablation study on fine-tuned image-text retrieval. The average recall on the test set is reported. We use $s _ { \mathrm { i t c } }$ to filter top- $k$ candidates and calculate their $s _ { \mathrm { i t m } }$ score for ranking.
+
+in $k$ . We also validate the effect of hard negative mining in the last column.
+
+Table $^ { 7 }$ studies the effect of textassignment (TA) pre-training and parameter sharing on $\mathrm { \tt N L V R } ^ { \mathrm { \bar { 2 } } }$ . We examine three strategies: (1) the two mutimodal blocks share all parameters, (2) only the cross
+
+
NLVR²
w/TA share all share CA
w/o TA share all share CA
dev
82.13
82.55
no share 81.93
80.52
80.28
no share 77.84
test-P
82.36
83.14
82.85
81.29
80.45
77.58
+
+Table 7: Ablation study on NLVR2.
+
+attention (CA) layers are shared, (3) no sharing. Without TA, sharing the entire block has better performance. With TA to pre-train the model for image-pair, sharing CA leads to the best performance.
+
+# 7 Conclusion and Social Impacts
+
+This paper proposes ALBEF, a new framework for vision-language representation learning. ALBEF first aligns the unimodal image representation and text representation before fusing them with a multimodal encoder. We theoretically and experimentally verify the effectiveness of the proposed image-text contrastive learning and momentum distillation. Compared to existing methods, ALBEF offers better performance and faster inference speed on multiple downstream $_ { \mathrm { V + L } }$ tasks.
+
+While our paper shows promising results on vision-language representation learning, additional analysis on the data and the model is necessary before deploying it in practice, because web data may contain unintended private information, unsuitable images, or harmful texts, and only optimizing accuracy may have unwanted social implications.
+
+# References
+
+[1] Tan, H., M. Bansal. LXMERT: learning cross-modality encoder representations from transformers. In K. Inui, J. Jiang, V. Ng, X. Wan, eds., EMNLP, pages 5099–5110. 2019.
+[2] Chen, Y., L. Li, L. Yu, et al. UNITER: universal image-text representation learning. In ECCV, vol. 12375, pages 104–120. 2020.
+[3] Li, X., X. Yin, C. Li, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, pages 121–137. 2020.
+[4] Sharma, P., N. Ding, S. Goodman, et al. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In I. Gurevych, Y. Miyao, eds., ACL, pages 2556–2565. 2018.
+[5] Ordonez, V., G. Kulkarni, T. L. Berg. Im2text: Describing images using 1 million captioned photographs. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. C. N. Pereira, K. Q. Weinberger, eds., NIPS, pages 1143–1151. 2011.
+[6] Radford, A., J. W. Kim, C. Hallacy, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
+[7] Jia, C., Y. Yang, Y. Xia, et al. Scaling up visual and vision-language representation learning with noisy text supervision. arXiv preprint arXiv:2102.05918, 2021.
+[8] Gan, Z., Y. Chen, L. Li, et al. Large-scale adversarial training for vision-and-language representation learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, H. Lin, eds., NeurIPS. 2020.
+[9] Selvaraju, R. R., M. Cogswell, A. Das, et al. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV, pages 618–626. 2017.
+[10] Su, W., X. Zhu, Y. Cao, et al. Vl-bert: Pre-training of generic visual-linguistic representations. In ICLR. 2020.
+[11] Lu, J., D. Batra, D. Parikh, et al. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In H. M. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. B. Fox, R. Garnett, eds., NeurIPS, pages 13–23. 2019.
+[12] Lu, J., V. Goswami, M. Rohrbach, et al. 12-in-1: Multi-task vision and language representation learning. In CVPR, pages 10434–10443. 2020.
+[13] Li, L. H., M. Yatskar, D. Yin, et al. Visualbert: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, abs/1908.03557, 2019.
+[14] Qi, D., L. Su, J. Song, et al. Imagebert: Cross-modal pre-training with large-scale weaksupervised image-text data. arXiv preprint arXiv:2001.07966, 2020.
+[15] Li, G., N. Duan, Y. Fang, et al. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In AAAI, pages 11336–11344. 2020.
+[16] Yu, F., J. Tang, W. Yin, et al. Ernie-vil: Knowledge enhanced vision-language representations through scene graph. arXiv preprint arXiv:2006.16934, 2020.
+[17] Zhang, P., X. Li, X. Hu, et al. Vinvl: Making visual representations matter in vision-language models. arXiv preprint arXiv:2101.00529, 2021.
+[18] Huang, Z., Z. Zeng, Y. Huang, et al. Seeing out of the box: End-to-end pre-training for vision-language representation learning. arXiv preprint arXiv:2104.03135, 2021.
+[19] Suhr, A., S. Zhou, A. Zhang, et al. A corpus for reasoning about natural language grounded in photographs. In A. Korhonen, D. R. Traum, L. Màrquez, eds., ACL, pages 6418–6428. 2019. 2015. 9 g. Dag
+[21] Kim, W., B. Son, I. Kim. Vilt: Vision-and-language transformer without convolution or region supervision. arXiv preprint arXiv:2102.03334, 2021.
+[22] Faghri, F., D. J. Fleet, J. R. Kiros, et al. VSE $^ { + + }$ : improving visual-semantic embeddings with hard negatives. In BMVC, page 12. 2018.
+[23] Li, K., Y. Zhang, K. Li, et al. Visual semantic reasoning for image-text matching. In ICCV, pages 4653–4661. 2019.
+[24] He, K., H. Fan, Y. Wu, et al. Momentum contrast for unsupervised visual representation learning. In CVPR. 2020.
+[25] Chen, T., S. Kornblith, M. Norouzi, et al. A simple framework for contrastive learning of visual representations. In ICML. 2020.
+[26] Li, J., P. Zhou, C. Xiong, et al. Prototypical contrastive learning of unsupervised representations. In ICLR. 2021.
+[27] Li, J., C. Xiong, S. C. Hoi. Mopro: Webly supervised learning with momentum prototypes. In ICLR. 2021.
+[28] Hinton, G., O. Vinyals, J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+[29] Zagoruyko, S., N. Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In ICLR. 2017.
+[30] Furlanello, T., Z. C. Lipton, M. Tschannen, et al. Born-again neural networks. In J. G. Dy, A. Krause, eds., ICML, pages 1602–1611. 2018.
+[31] Touvron, H., M. Cord, M. Douze, et al. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
+[32] Sanh, V., L. Debut, J. Chaumond, et al. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
+[33] Zhang, Y., T. Xiang, T. M. Hospedales, et al. Deep mutual learning. In CVPR, pages 4320–4328. 2018.
+[34] Anil, R., G. Pereyra, A. Passos, et al. Large scale distributed neural network training through online distillation. In ICLR. 2018.
+[35] Tarvainen, A., H. Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NIPS, pages 1195–1204. 2017.
+[36] Li, J., R. Socher, S. C. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In ICLR. 2020.
+[37] Cheng, R., B. Wu, P. Zhang, et al. Data-efficient language-supervised zero-shot learning with self-distillation. arXiv preprint arXiv:2104.08945, 2021.
+[38] Dosovitskiy, A., L. Beyer, A. Kolesnikov, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR. 2021.
+[39] Vaswani, A., N. Shazeer, N. Parmar, et al. Attention is all you need. In I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, R. Garnett, eds., NIPS, pages 5998–6008. 2017.
+[40] Devlin, J., M. Chang, K. Lee, et al. BERT: pre-training of deep bidirectional transformers for language understanding. In J. Burstein, C. Doran, T. Solorio, eds., NAACL, pages 4171–4186. 2019.
+[41] Lin, T., M. Maire, S. J. Belongie, et al. Microsoft COCO: common objects in context. In D. J. Fleet, T. Pajdla, B. Schiele, T. Tuytelaars, eds., ECCV, vol. 8693, pages 740–755. 2014.
+[42] Krishna, R., Y. Zhu, O. Groth, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32–73, 2017.
+[43] Changpinyo, S., P. Sharma, N. Ding, et al. Conceptual 12M: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In CVPR. 2021.
+[44] Loshchilov, I., F. Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+[45] Cubuk, E. D., B. Zoph, J. Shlens, et al. Randaugment: Practical automated data augmentation with a reduced search space. In CVPR Workshops, pages 702–703. 2020.
+[46] Tian, Y., C. Sun, B. Poole, et al. What makes for good views for contrastive learning? In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, H. Lin, eds., NeurIPS. 2020.
+[47] Oord, A. v. d., Y. Li, O. Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+[48] Kong, L., C. de Masson d’Autume, L. Yu, et al. A mutual information maximization perspective of language representation learning. In ICLR. OpenReview.net, 2020.
+[49] Plummer, B. A., L. Wang, C. M. Cervantes, et al. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In ICCV, pages 2641–2649. 2015.
+[50] Do, V., O.-M. Camburu, Z. Akata, et al. e-snli-ve: Corrected visual-textual entailment with natural language explanations. arXiv preprint arXiv:2004.03744, 2020.
+[51] Xie, N., F. Lai, D. Doran, et al. Visual entailment: A novel task for fine-grained image understanding. arXiv preprint arXiv:1901.06706, 2019.
+[52] Goyal, Y., T. Khot, D. Summers-Stay, et al. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. In CVPR, pages 6325–6334. 2017.
+[53] Yu, L., Z. Lin, X. Shen, et al. Mattnet: Modular attention network for referring expression comprehension. In CVPR, pages 1307–1315. 2018.
+[54] Cho, J., J. Lei, H. Tan, et al. Unifying vision-and-language tasks via text generation. arXiv preprint arXiv:2102.02779, 2021.
+[55] Kim, J., J. Jun, B. Zhang. Bilinear attention networks. In S. Bengio, H. M. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, R. Garnett, eds., NIPS, pages 1571–1581. 2018.
+[56] Yu, L., P. Poirson, S. Yang, et al. Modeling context in referring expressions. In B. Leibe, J. Matas, N. Sebe, M. Welling, eds., ECCV, pages 69–85. 2016.
+[57] Liu, X., L. Li, S. Wang, et al. Adaptive reconstruction network for weakly supervised referring expression grounding. In ICCV, pages 2611–2620. 2019.
+[58] Zhang, Z., Z. Zhao, Z. Lin, et al. Counterfactual contrastive learning fo weakly-supervised vision-language grounding. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, H. Lin, eds., NeurIPS. 2020.
+[59] Karpathy, A., F. Li. Deep visual-semantic alignments for generating image descriptions. In CVPR, pages 3128–3137. 2015.
+[60] Bowman, S. R., G. Angeli, C. Potts, et al. A large annotated corpus for learning natural language inference. In L. Màrquez, C. Callison-Burch, J. Su, D. Pighin, Y. Marton, eds., EMNLP, pages 632–642. 2015.
+[61] Yu, Z., J. Yu, Y. Cui, et al. Deep modular co-attention networks for visual question answering. In CVPR, pages 6281–6290. 2019.
+[62] Kazemzadeh, S., V. Ordonez, M. Matten, et al. Referitgame: Referring to objects in photographs of natural scenes. In A. Moschitti, B. Pang, W. Daelemans, eds., EMNLP. 2014.
+[63] Das, A., H. Agrawal, C. L. Zitnick, et al. Human Attention in Visual Question Answering: Do Humans and Deep Networks Look at the Same Regions? 2016.
\ No newline at end of file
diff --git a/md/train/Ovp8dvB8IBH/Ovp8dvB8IBH.md b/md/train/Ovp8dvB8IBH/Ovp8dvB8IBH.md
new file mode 100644
index 0000000000000000000000000000000000000000..11e6cb38f2060bbed5c5130ef587bc0728169f40
--- /dev/null
+++ b/md/train/Ovp8dvB8IBH/Ovp8dvB8IBH.md
@@ -0,0 +1,479 @@
+# NEGATIVE DATA AUGMENTATION
+
+Abhishek Sinha1∗ Kumar Ayush1∗ Jiaming Song1∗ Burak Uzkent1 Hongxia Jin2
+
+# Stefano Ermon1
+
+Department of Computer Science1
+Stanford University
+{a7b23, kayush, tsong, buzkent, ermon}@stanford.edu
+
+Samsung Research America2
+
+# ABSTRACT
+
+Data augmentation is often used to enlarge datasets with synthetic samples generated in accordance with the underlying data distribution. To enable a wider range of augmentations, we explore negative data augmentation strategies (NDA) that intentionally create out-of-distribution samples. We show that such negative out-of-distribution samples provide information on the support of the data distribution, and can be leveraged for generative modeling and representation learning. We introduce a new GAN training objective where we use NDA as an additional source of synthetic data for the discriminator. We prove that under suitable conditions, optimizing the resulting objective still recovers the true data distribution but can directly bias the generator towards avoiding samples that lack the desired structure. Empirically, models trained with our method achieve improved conditional/unconditional image generation along with improved anomaly detection capabilities. Further, we incorporate the same negative data augmentation strategy in a contrastive learning framework for self-supervised representation learning on images and videos, achieving improved performance on downstream image classification, object detection, and action recognition tasks. These results suggest that prior knowledge on what does not constitute valid data is an effective form of weak supervision across a range of unsupervised learning tasks.
+
+# 1 INTRODUCTION
+
+Data augmentation strategies for synthesizing new data in a way that is consistent with an underlying task are extremely effective in both supervised and unsupervised learning (Oord et al., 2018; Zhang et al., 2016; Noroozi & Favaro, 2016; Asano et al., 2019). Because they operate at the level of samples, they can be combined with most learning algorithms. They allow for the incorporation of prior knowledge (inductive bias) about properties of typical samples from the underlying data distribution (Jaiswal et al., 2018; Antoniou et al., 2017), e.g., by leveraging invariances to produce additional “positive” examples of how a task should be solved.
+
+To enable users to specify an even wider range of inductive biases, we propose to leverage an alternative and complementary source of prior knowledge that specifies how a task should not be solved. We formalize this intuition by assuming access to a way of generating samples that are guaranteed to be out-of-support for the data distribution, which we call a Negative Data Augmentation (NDA). Intuitively, negative out-of-distribution (OOD) samples can be leveraged as a useful inductive bias because they provide information about the support of the data distribution to be learned by the model. For example, in a density estimation problem we can bias the model to avoid putting any probability mass in regions which we know a-priori should have zero probability. This can be an effective prior if the negative samples cover a sufficiently large area. The best NDA candidates are ones that expose common pitfalls of existing models, such as prioritizing local structure over global structure (Geirhos et al., 2018); this motivates us to consider known transformations from the literature that intentionally destroy the spatial coherence of an image (Noroozi & Favaro, 2016; DeVries & Taylor, 2017; Yun et al., 2019), such as Jigsaw transforms.
+
+Building on this intuition, we introduce a new GAN training objective where we use NDA as an additional source of fake data for the discriminator as shown in Fig. 1. Theoretically, we can show that if the NDA assumption is valid, optimizing this objective will still recover the data distribution in the limit of infinite data. However, in the finite data regime, there is a need to generalize beyond the empirical distribution (Zhao et al., 2018). By explicitly providing the discriminator with samples we want to avoid, we are able to bias the generator towards avoiding undesirable samples thus improving generation quality.
+
+Furthermore, we propose a way of leveraging NDA for unsupervised representation learning. We propose a new contrastive predictive coding (He et al., 2019; Han et al., 2019) (CPC) objective that encourages the distribution of representations corresponding to in-support data to become disjoint from that of NDA data. Empirically, we show that applying NDA with our proposed transformations (e.g., forcing the representation of normal and jigsaw images to be disjoint) improves performance in downstream tasks.
+
+With appropriately chosen NDA strategies, we obtain superior empirical performance on a variety of tasks, with almost no cost in computation. For generative modeling, models trained with NDA achieve better image generation, image translation and anomaly detection performance compared with the same model trained without NDA. Similar gains are observed on representation learning for images and videos over downstream tasks such as image classification, object detection and action recognition.
+
+
+Figure 1: Negative Data Augmentation for GANs.
+
+These results suggest that NDA has much potential to improve a variety of self-supervised learning techniques.
+
+# 2 NEGATIVE DATA AUGMENTATION
+
+The input to most learning algorithms is a dataset of samples from an underlying data distribution $p _ { d a t a }$ . While $p _ { d a t a }$ is unknown, learning algorithms always rely on prior knowledge about its properties (inductive biases (Wolpert & Macready, 1997)), e.g., by using specific functional forms such as neural networks. Similarly, data augmentation strategies exploit known invariances of $p _ { d a t a }$ , such as the conditional label distribution being invariant to semantic-preserving transformations.
+
+While typical data augmentation strategies exploit prior knowledge about what is in support of $p _ { \mathrm { d a t a } }$ , in this paper, we propose to exploit prior knowledge about what is not in the support of $p _ { \mathrm { d a t a } }$ . This information is often available for common data modalities (e.g., natural images and videos) and is under-exploited by existing approaches. Specifically, we assume: (1) there exists an alternative distribution $\overline { { p } }$ such that its support is disjoint from that of $p _ { d a t a }$ ; and (2) access to a procedure to efficiently sample from $\overline { { p } }$ . We emphasize $\overline { { p } }$ need not be explicitly defined (e.g., through an explicit density) – it may be implicitly defined by a dataset or by a procedure that transforms samples from $p _ { \mathrm { d a t a } }$ into ones from $\overline { { p } }$ by suitably altering their structure.
+
+
+Figure 2: Negative augmentations produce out-of-distribution samples lacking the typical structure of natural images; these negative samples can be used to inform a model on what it should not learn.
+
+Analogous to typical data augmentations, NDA strategies are by definition domain and task specific. In this paper, we focus on natural images and videos, and leave the application to other domains (such as natural language processing) as future work. How do we select a good NDA strategy? According to the manifold hypothesis (Fefferman et al., 2016), natural images lie on low-dimensional manifolds: $p _ { d a t a }$ is supported on a low-dimensional manifold of the ambient (pixel) space. This suggests that many negative data augmentation strategies exist. Indeed, sampling random noise is in most cases a valid NDA. However, while this prior is generic, it is not very informative, and this NDA will likely be ineffective for most learning problems. Intuitively, NDA is informative if its support is close (in a suitable metric) to that of $p _ { d a t a }$ , while being disjoint. These negative samples will provide information on the “boundary” of the support of $p _ { d a t a }$ , which we will show is helpful in several learning problems. In most of our tasks, the images are processed by convolutional neural networks (CNNs) that are good at processing local features but not necessarily global features (Geirhos et al., 2018). Therefore, we may consider NDA examples to be ones that preserve local features (“informative”) and break global features, so that it forces the CNNs to learn global features (by realizing NDAs are different from real data).
+
+Leveraging this intuition, we show several image transformations from the literature that can be viewed as generic NDAs over natural images in Figure 2, that we will use for generative modeling and representation learning in the following sections. Details about these transformations can be found in Appendix B.
+
+# 3 NDA FOR GENERATIVE ADVERSARIAL NETWORKS
+
+
+Figure 3: Schematic overview of our NDA framework. Left: In the absence of NDA, the support of a generative model $P _ { \theta }$ (blue oval) learned from samples (green dots) may “over-generalize” and include samples from $\overline { { P _ { 1 } } }$ or $\overline { { P _ { 2 } } }$ . Right: With NDA, the learned distribution $P _ { \theta }$ becomes disjoint from NDA distributions $\overline { { P _ { 1 } } }$ and $\overline { { P _ { 2 } } }$ , thus pushing $P _ { \theta }$ closer to the true data distribution $p _ { d a t a }$ (green oval). As long as the prior is consistent, i.e. the supports of $\overline { { P _ { 1 } } }$ and $\overline { { P _ { 2 } } }$ are truly disjoint from $p _ { d a t a }$ , the best fit distribution in the infinite data regime does not change.
+
+In GANs, we are interested in learning a generative model $G _ { \theta }$ from samples drawn from some data distribution $p _ { \mathrm { d a t a } }$ (Goodfellow et al., 2014). GANs use a binary classifier, the so-called discriminator $D _ { \phi }$ , to distinguish real data from generated (fake) samples. The generator $G _ { \theta }$ is trained via the following mini-max objective that performs variational Jensen-Shannon divergence minimization:
+
+$$
+\begin{array} { c } { { \displaystyle \operatorname* { m i n } _ { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } \operatorname* { m a x } _ { D _ { \phi } } L _ { \mathrm { J S } } ( G _ { \theta } , D _ { \phi } ) \quad \mathrm { w h e r e } } } \\ { { \displaystyle L _ { \mathrm { J S } } ( G _ { \theta } , D _ { \phi } ) = \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a t a } } } \left[ \log ( D _ { \phi } ( \pmb { x } ) ) \right] + \mathbb { E } _ { \mathbf { x } \sim G _ { \theta } } \left[ \log ( 1 - D _ { \phi } ( \pmb { x } ) ) \right] } } \end{array}
+$$
+
+This is a special case to the more general variational $f$ -divergence minimization objective (Nowozin et al., 2016). The optimal $D _ { \phi }$ for any $G _ { \theta }$ is $( p _ { \mathrm { d a t a } } / G _ { \theta } ) / ( 1 + p _ { \mathrm { d a t a } } / G _ { \theta } )$ , so the discriminator can serve as a density ratio estimator between $p _ { \mathrm { d a t a } }$ and $G _ { \theta }$ .
+
+With sufficiently expressive models and infinite capacity, $G _ { \theta }$ will match $p _ { \mathrm { d a t a } }$ . In practice, however, we have access to finite datasets and limited model capacity. This means that the generator needs to generalize beyond the empirical distribution, which is challenging because the number of possible discrete distributions scale doubly exponentially w.r.t. to the data dimension. Hence, as studied in (Zhao et al., 2018), the role of the inductive bias is critical. For example, Zhao et al. (2018) report that when trained on images containing 2 objects only, GANs and other generative models can sometimes “generalize” by generating images with 1 or 3 objects (which were never seen in the training set). The generalization behavior – which may or may not be desirable – is determined by factors such as network architectures, hyperparameters, etc., and is difficult to characterize analytically.
+
+Here we propose to bias the learning process by directly specifying what the generator should not generate through NDA. We consider an adversarial game based on the following objective:
+
+$$
+\operatorname* { m i n } _ { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } \operatorname* { m a x } _ { D _ { \phi } } L _ { \mathrm { J S } } ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } , D _ { \phi } )
+$$
+
+where the negative samples are generated from a mixture of $G _ { \theta }$ (the generator distribution) and $\overline { { P } }$ (the NDA distribution); the mixture weights are controlled by the hyperparameter $\lambda$ . Intuitively, this can help addresses the above “over-generalization” issue, as we can directly provide supervision on what should not be generated and thus guide the support of $G _ { \theta }$ (see Figure 3) . For instance, in the object count example above, we can empirically prevent the model from generating images with an undesired number of objects (see Appendix Section A for experimental results on this task).
+
+In addition, the introduction of NDA samples will not affect the solution of the original GAN objective in the limit. In the following theorem, we show that given infinite training data and infinite capacity discriminators and generators, using NDA will not affect the optimal solution to the generator, i.e. the generator will still recover the true data distribution.
+
+Theorem 1. Let $\overline { { P } } \in \mathcal { P } ( \mathcal { X } )$ be any distribution over $\mathcal { X }$ with disjoint support than $p _ { \mathrm { d a t a } } ,$ , i.e., such that $\operatorname { s u p p } ( p _ { \mathrm { d a t a } } ) \cap \operatorname { s u p p } ( { \overline { { P } } } ) = \emptyset$ . Let $D _ { \phi } : \mathcal { X } \mathbb { R }$ be the set of all discriminators over $\mathcal { X }$ , $f : \mathbb { R } _ { \geq 0 } \to \mathbb { R }$ be a convex, semi-continuous function such that $f ( 1 ) = { \dot { 0 } }$ , $f ^ { \star }$ be the convex conjugate of $f$ , ${ \overline { { f } } } ^ { \prime }$ its derivative, and $G _ { \theta }$ be a distribution with sample space $\mathcal { X }$ . Then $\forall \lambda \in ( 0 , 1 ]$ , we have:
+
+$$
+\underset { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } { \arg \operatorname* { m i n } } \ \underset { D _ { \phi } : \mathcal { X } \to \mathbb { R } } { \operatorname* { m a x } } L _ { f } \big ( G _ { \theta } , D _ { \phi } \big ) = \underset { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } { \arg \operatorname* { m i n } } \ \underset { D _ { \phi } : \mathcal { X } \to \mathbb { R } } { \operatorname* { m a x } } L _ { f } \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } , D _ { \phi } \big ) = p _ { \mathrm { d a t a } }
+$$
+
+where $L _ { f } ( Q , D _ { \phi } ) = \mathbb { E } _ { \pmb { x } \sim p _ { \mathrm { d a t a } } } [ D _ { \phi } ( \pmb { x } ) ] - \mathbb { E } _ { \pmb { x } \sim Q } [ f ^ { \star } ( D _ { \phi } ( \pmb { x } ) ) ]$ is the objective for $f$ -GAN (Nowozin et al., 2016). However, the optimal discriminators are different for the two objectives:
+
+$$
+\begin{array} { c } { \underset { D _ { \phi } : \mathcal { X } \mathbb { R } } { \arg \operatorname* { m a x } } L _ { f } ( G _ { \theta } , D _ { \phi } ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / G _ { \theta } \big ) } \\ { \underset { \mathrm { a r g } \operatorname* { m a x } } { \arg \operatorname* { m a x } } L _ { f } \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } , D _ { \phi } \big ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } \big ) \big ) } \end{array}
+$$
+
+Proof. See Appendix C.
+
+The above theorem shows that in the limit of infinite data and computation, adding NDA changes the optimal discriminator solution but not the optimal generator. In practice, when dealing with finite data, existing regularization techniques such as weight decay and spectral normalization (Miyato et al., 2018) allow potentially many solutions that achieve the same objective value. The introduction of NDA samples allows us to filter out certain solutions by providing additional inductive bias through OOD samples. In fact, the optimal discriminator will reflect the density ratio between $p _ { \mathrm { d a t a } }$ and $\bar { \lambda ( \bar { G } _ { \theta } + ( 1 - \lambda ) \bar { P } }$ (see Eq.(6)), and its values will be higher for samples from $p _ { \mathrm { d a t a } }$ compared to those from $\overline { { P } }$ . As we will show in Section 5, a discriminator trained with this objective and suitable NDA performs better than relevant baselines for other downstream tasks such as anomaly detection.
+
+# 4 NDA FOR CONSTRASTIVE REPRESENTATION LEARNING
+
+Using a classifier to estimate a density ratio is useful not only for estimating $f$ -divergences (as in the previous section) but also for estimating mutual information between two random variables. In representation learning, mutual information (MI) maximization is often employed to learn compact yet useful representations of the data, allowing one to perform downstream tasks efficiently (Tishby & Zaslavsky, 2015; Nguyen et al., 2008; Poole et al., 2019b; Oord et al., 2018). Here, we show that NDA samples are also beneficial for representation learning.
+
+In contrastive representation learning (such as CPC (Oord et al., 2018)), the goal is to learn a mapping $h _ { \theta } ( \pmb { x } ) : \mathcal { X } \overset { \mathbf { \bar { \alpha } } } { } \mathcal { P } ( \mathcal { Z } )$ that maps a datapoint $_ { x }$ to some distribution over the representation space $\mathcal { Z }$ ; once the network $h _ { \theta }$ is learned, representations are obtained by sampling from $z \sim h _ { \theta } ( x )$ . CPC maximizes the following objective:
+
+$$
+I _ { \mathrm { C P C } } ( h _ { \theta } , g _ { \phi } ) : = \mathbb { E } _ { x \sim p _ { \mathrm { d a t a } } ( x ) , z \sim h _ { \theta } ( x ) , \widehat { z } _ { i } \sim p _ { \theta } ( z ) } \left[ \log \frac { n g _ { \phi } ( x , z ) } { g _ { \phi } ( x , z ) + \sum _ { j = 1 } ^ { n - 1 } g _ { \phi } ( x , \widehat { z _ { j } } ) } \right]
+$$
+
+where $\begin{array} { r } { p _ { \theta } ( z ) = \int h _ { \theta } ( z | \boldsymbol x ) p _ { \mathrm { d a t a } } ( \boldsymbol x ) \mathrm d \boldsymbol x } \end{array}$ is the marginal distribution of the representations associated with $p _ { \mathrm { d a t a } }$ . Intuitively, the CPC objective involves an $n$ -class classification problem where $g _ { \phi }$ attempts to identify a matching pair (i.e. $( { \pmb x } , z ) )$ sampled from the joint distribution from the $( n - 1 )$ non-matching pairs (i.e. $( \pmb { x } , \widehat { \pmb { z } } _ { j } ) )$ sampled from the product of marginals distribution. Note that $g _ { \phi }$ bplays the role of a discriminator/critic, and is implicitly estimating a density ratio. As $n \infty$ , the optimal $g _ { \phi }$ corresponds to an un-normalized density ratio between the joint distribution and the product of marginals, and the CPC objective matches its upper bound which is the mutual information between $X$ and $Z$ (Poole et al., 2019a; Song & Ermon, 2019). However, this objective is no longer able to control the representations for data that are out of support of $p _ { \mathrm { d a t a } }$ , so there is a risk that the representations are similar between $p _ { \mathrm { d a t a } }$ samples and out-of-distribution ones.
+
+To mitigate this issue, we propose to use NDA in the CPC objective, where we additionally introduce a batch of NDA samples, for each positive sample:
+
+$$
+\overline { { I _ { \mathrm { C P C } } } } ( h _ { \theta } , g _ { \phi } ) : = { \mathbb E } \left[ \log \frac { ( n + m ) g _ { \phi } ( { \pmb x } , { \pmb z } ) } { g _ { \phi } ( { \pmb x } , { \pmb z } ) + \sum _ { j = 1 } ^ { n - 1 } g _ { \phi } ( { \pmb x } , \widehat { { \pmb z _ { j } } } ) + \sum _ { k = 1 } ^ { m } g _ { \phi } ( { \pmb x } , \overline { { { \pmb z _ { k } } } } ) } \right]
+$$
+
+where the expectation is taken over $\pmb { x } \sim p _ { \mathrm { d a t a } } ( \pmb { x } ) , z \sim h _ { \theta } ( \pmb { x } ) , \widehat { z } _ { i } \sim p _ { \theta } ( z )$ , $\overline { { \mathbf { x } } } _ { k } \sim \overline { { p } }$ (NDA distribution), $\overline { { \boldsymbol { z } } } _ { k } \sim h _ { \theta } ( \overline { { \boldsymbol { x } } } _ { k } )$ for all $k \in [ m ]$ b. Here, the behavior of $h _ { \theta } ( { \pmb x } )$ when $_ { \textbf { \em x } }$ is NDA is optimized explicitly, allowing us to impose additional constraints to the NDA representations. This corresponds to a more challenging classification problem (compared to basic CPC) that encourages learning more informative representations. In the following theorem, we show that the proposed objective encourages the representations for NDA samples to become disjoint from the representations for $p _ { \mathrm { d a t a } }$ samples, i.e. NDA samples and $p _ { \mathrm { d a t a } }$ samples do not map to the same representation.
+
+Theorem 2. (Informal) The optimal solution to $h _ { \theta }$ in the NDA-CPC objective maps the representations of data samples and NDA samples to disjoint regions.
+
+Proof. See Appendix D for a detailed statement and proof.
+
+# 5 NDA-GAN EXPERIMENTS
+
+In this section we report experiments with different types of NDA for image generation. Additional details about the network architectures and hyperparameters can be found in Appendix K.
+
+Unconditional Image Generation. We conduct experiments on various datasets using the BigGAN architecture (Brock et al., 2018) for unconditional image generation1. We first explore various image transformations from the literature to evaluate which ones are effective as NDA. For each transformation, we evaluate its performance as NDA (training as in Eq. 3) and as a traditional data augmentation strategy, where we enlarge the training set by applying the transformation to real images (denoted PDA for positive data augmentation). Table 1 shows the FID scores for different types of transformations as PDA/NDA. The results suggest that transformations that spatially corrupt the image are strong NDA candidates. It can be seen that Random Horizontal Flip is not effective as an NDA; this is because flipping does not spatially corrupt the image but is rather a semantic preserving transformation, hence the NDA distribution $\overline { { P } }$ is not disjoint from $p _ { d a t a }$ . On the contrary, it is reasonable to assume that if an image is likely under $p _ { d a t a }$ , its flipped variant should also be likely. This is confirmed by the effectiveness of this strategy as PDA.
+
+
+Figure 4: Histogram of difference in the discriminator output for a real image and it’s Jigsaw version.
+
+Table 1: FID scores over CIFAR-10 using different transformations as PDA and NDA in BigGAN. The results indicate that some transformations yield better results when used as NDA. The common feature of such transformations is they all spatially corrupt the images.
+
+
w/o Aug.
Jigsaw
Cutout
Stitch
Mixup
Cutmix
Random Crop
Random Flip
Gaussian
PDA
NDA
PDA
NDA
PDA
NDA
PDA
NDA
PDA
NDA
PDA
NDA
PDA
NDA
PDA
NDA
18.64
98.09
12.61
79.72
14.69
108.69
13.97
70.64
17.29
90.81
15.01
20.02
15.05
16.65
124.32
44.41
18.72
+
+Table 2: Comparison of FID scores of different types of NDA for unconditional image generation on various datasets. The numbers in bracket represent the corresponding image resolution in pixels. Jigsaw consistently achieves the best or second best result.
+
+
BigGAN
Jigsaw
Stitching
Mixup
Cutout
Cutmix
CR-BigGAN
CIFAR-10 (32)
18.64
12.61
13.97
17.29
14.69
15.01
14.56
CIFAR-100 (32)
22.19
19.72
20.99
22.21
22.08
20.78
1
CelebA (64)
38.14
37.24
37.17
37.51
37.39
37.46
1
STL10 (32)
26.80
23.94
26.08
24.45
24.91
25.34
1
+
+We believe spatially corrupted negatives perform well as NDA in that they push the discriminator to focus on global features instead of local ones (e.g., texture). We confirm this by plotting the histogram of differences in the discriminator output for a real image and it’s Jigsaw version as shown in Fig. 4. We show that the difference is (a) centered close to zero for normal BigGAN (so without NDA training, the discriminator cannot distinguish real and Jigsaw samples well), and (b) centered at a positive number (logit 10) for our method (NDA-BigGAN). Following our findings, in our remaining experiments we use Jigsaw, Cutout, Stitch, Mixup and Cutmix as they achieve significant improvements when used as NDA for unconditional image generation on CIFAR-10.
+
+Table 2 shows the FID scores for BigGAN when trained with five types of negative data augmentation on four different benchmarks. Almost all the NDA augmentations improve the baseline across datasets. For all the datasets except CIFAR-100, $\lambda = 0 . 2 5$ , whereas for CIFAR-100 it is 0.5. We show the effect of $\lambda$ on CIFAR-10 performance in Appendix H. We additionally performed an experiment using a mixture of augmentation policy. The results (FID 16.24) were better than the baseline method (18.64) but not as good as using a single strategy.
+
+Conditional Image Generation. We also investigate the benefits of NDA in conditional image generation using BigGAN. The results are shown in Table 3. In this setting as well, NDA gives a significant boost over the baseline model. We again use $\lambda = 0 . 2 5$ for CIFAR-10 and $\lambda = 0 . 5$ for CIFAR-100. For both unconditional and conditional setups we find the Jigsaw and Stitching augmentations to achieve a better FID score than the other augmentations.
+
+Table 3: FID scores for conditional image generation using different NDAs.2
+
+
BigGAN
Jigsaw
Stitching
Mixup
Cutout
Cutmix
CR-BigGAN
C-10
11.51
9.42
9.47
13.87
10.52
10.3
11.48
C-100
15.04
14.12
13.90
15.27
14.21
13.99
1
+
+Image Translation. Next, we apply the NDA method to image translation. In particular, we use the Pix2Pix model (Isola et al., 2017) that can perform image-to-image translation using GANs provided paired training data. Here, the generator is conditioned on an image $\mathcal { T }$ , and the discriminator takes as input the concatenation of generated/real image and $\mathcal { T }$ . We use $\mathrm { P i x 2 P i x }$ for semantic segmentation on Cityscapes dataset (Cordts et al., 2016) (i.e. photos labels). Table 4 shows the quantitative gains obtained by using Jigsaw NDA3 while Figure 7 in Appendix F highlights the qualitative improvements. The NDA-Pix2Pix model avoids noisy segmentation on objects including buildings and trees.
+
+Table 4: Results on CityScapes, using per pixel accuracy $( { \mathrm { P p . } } )$ , per class accuracy (Pc.) and mean Intersection over Union (mIOU). We compare Pix2Pix and its NDA version.
+
+
Metric
Pp.
Pc.
mIOU
Pix2Pix (cGAN)
0.80
0.24
0.27
NDA (cGAN)
0.84
0.34
0.28
Pix2Pix (L1+cGAN)
0.72
0.23
0.18
NDA (L1+cGAN)
0.75
0.28
0.22
+
+Table 5: AUROC scores for different OOD datasets. OOD-1 contains different datasets, while OOD-2 contains the set of 19 different corruptions in CIFAR-10-C (Hendrycks & Dietterich, 2018) (the average score is reported).
+
+
BigGAN
Jigsaw
EBM
00D-1
DTD
0.70
0.69
0.48
SVHN
0.75
0.61
0.63
Places-365
0.35
0.58
0.68
TinyImageNet
0.40
0.62
0.67
CIFAR-100
0.63
0.64
0.50
Average
0.57
0.63
0.59
00D-2
CIFAR-10-C
0.56
0.63
0.60
+
+Anomaly Detection. As another added benefit of NDA for GANs, we utilize the output scores of the BigGAN discriminator for anomaly detection. We experiment with 2 different types of OOD datasets. The first set consists of SVHN (Netzer et al., 2011), DTD (Cimpoi et al., 2014), Places365 (Zhou et al., 2017), TinyImageNet, and CIFAR-100 as the OOD datapoints following the protocol in (Du & Mordatch, 2019; Hendrycks et al., 2018). We train BigGAN w/ and w/o Jigsaw NDA on the train set of CIFAR-10 and then use the output value of discriminator to classify the test set of CIFAR-10 (not anomalous) and different OOD datapoints (anomalous) as anomalous or not. We use the AUROC metric as proposed in (Hendrycks & Gimpel, 2016) to evaluate the anomaly detection performance. Table 5 compares the performance of NDA with a likelihood based model (Energy Based Models (EBM (Du & Mordatch, 2019)). Results show that Jigsaw NDA performs much better than baseline BigGAN and other generative models. We did not include other NDAs as Jigsaw achieved the best results.
+
+We consider the extreme corruptions in CIFAR-10-C (Hendrycks & Dietterich, 2018) as the second set of OOD datasets. It consists of 19 different corruptions, each having 5 different levels of severity. We only consider the corruption of highest severity for our experiment, as these constitute a significant shift from the true data distribution. Averaged over all the 19 different corruptions, the AUROC score for the normal BigGAN is 0.56, whereas the BigGAN trained with Jigsaw NDA achieves 0.63. The histogram of difference in discriminator’s output for clean and OOD samples are shown in Figure 8 in the appendix. High difference values imply that the Jigsaw NDA is better at distinguishing OOD samples than the normal BigGAN.
+
+# 6 REPRESENTATION LEARNING USING CONTRASTIVE LOSS AND NDA
+
+Unsupervised Learning on Images. In this section, we perform experiments on three benchmarks: (a) CIFAR10 (C10), (b) CIFAR100 (C100), and (c) ImageNet-100 (Deng et al., 2009) to show the benefits of NDA on representation learning with the contrastive loss function. In our experiments, we use the momentum contrast method (He et al., 2019), MoCo-V2, as it is currently the state-of-theart model on unsupervised learning on ImageNet. For C10 and C100, we train the MoCo-V2 model for unsupervised learning (w/ and w/o NDA) for 1000 epochs. On the other hand, for ImageNet-100, we train the MoCo-V2 model (w/ and w/o NDA) for 200 epochs. Additional hyperparameter details can be found in the appendix. To evaluate the representations, we train a linear classifier on the representations on the same dataset with labels. Table 6 shows the top-1 accuracy of the classifier. We find that across all the three datasets, different NDA approaches outperform MoCo-V2. While Cutout NDA performs the best for C10, the best performing NDA for C100 and ImageNet-100 are Jigsaw and Mixup respectively. Figure 9 compares the cosine distance of the representations learned w/ and w/o NDA (jigsaw) and shows that jigsaw and normal images are projected far apart from each other when trained using NDA whereas with original MoCo-v2 they are projected close to each other.
+
+Transfer Learning for Object Detection. We transfer the network pre-trained over ImageNet-100 for the task of Pascal-VOC object detection using a Faster R-CNN detector (C4 backbone) Ren et al. (2015). We fine-tune the network on Pascal VOC $2 0 0 7 + 2 0 1 2$ trainval set and test it on the 2007 test set. The baseline MoCo achieves 38.47 AP, 65.99 AP50, 38.81 AP75 whereas the MoCo trained with mixup NDA gets 38.72 AP, 66.23 AP50, 39.16 AP75 (an improvement of $\approx 0 . 3$ ).
+
+Table 6: Top-1 accuracy results on image recognition w/ and w/o NDA on MoCo-V2.
+
+
MoCo-V2
Jigsaw
Stitching
Cutout
Cutmix
Mixup
CIFAR-10
91.20
91.66
91.59
92.26
91.51
91.36
CIFAR-100
69.63
70.17
69.21
69.81
69.83
69.99
ImageNet-100
69.41
69.95
69.54
69.77
69.61
70.01
+
+Unsupervised Learning on Videos. In this section, we investigate the benefits of NDA in selfsupervised learning of spatio-temporal embeddings from video, suitable for human action recognition. We apply NDA to Dense Predictive Coding (Han et al., 2019), which is a single stream (RGB only) method for self-supervised representation learning on videos. For videos, we create NDA samples by performing the same transformation on all frames of the video (e.g. the same jigsaw permutation is applied to all the frames of a video). We evaluate the approach by first training the DPC model with NDA on a large-scale dataset (UCF101), and then evaluate the representations by training a supervised action classifier on UCF101 and HMDB51 datasets. As shown in Table 7, Jigsaw and Cutmix NDA improve downstream task accuracy on UCF-101 and HMDB-51, achieving new state-of-the-art performance among single stream (RGB only) methods for self-supervised representation learning (when pre-trained using UCF-101).
+
+Table 7: Top-1 accuracy results on action recognition in videos w/ and w/o NDA in DPC.
+
+
DPC
Jigsaw
Stitching
Cutout
Cutmix
Mixup
UCF-101 (Pre-trained on UCF-101)
61.35
64.54
66.07
64.52
63.52
63.65
HMDB51 (Pre-trained on UCF-101)
45.31
46.88
45.31
45.31
48.43
43.75
+
+# 7 RELATED WORK
+
+In several machine learning settings, negative samples are produced from a statistical generative model. Sung et al. (2019) aim to generate negative data using GANs for semi-supervised learning and novelty detection while we are concerned with efficiently creating negative data to improve generative models and self-supervised representation learning. Hanneke et al. (2018) also propose an alternative theoretical framework that relies on access to an oracle which classifies a sample as valid or not, but do not provide any practical implementation. Bose et al. (2018) use adversarial training to generate hard negatives that fool the discriminator for NLP tasks whereas we obtain NDA data from positive data to improve image generation and representation learning. Hou et al. (2018) use a GAN to learn the negative data distribution with the aim of classifying positive-unlabeled (PU) data whereas we do not have access to a mixture data but rather generate negatives by transforming the positive data.
+
+In contrastive unsupervised learning, common negative examples are ones that are assumed to be further than the positive samples semantically. Word2Vec (Mikolov et al., 2013) considers negative samples to be ones from a different context and CPC-based methods (Oord et al., 2018) such as momentum contrast (He et al., 2019), the negative samples are data augmentations from a different image. Our work considers a new aspect of “negative samples” that are neither generated from some model, nor samples from the data distribution. Instead, by applying negative data augmentation (NDA) to existing samples, we are able to incorporate useful inductive biases that might be difficult to capture otherwise (Zhao et al., 2018).
+
+# 8 CONCLUSION
+
+We proposed negative data augmentation as a method to incorporate prior knowledge through out-ofdistribution (OOD) samples. NDAs are complementary to traditional data augmentation strategies, which are typically focused on in-distribution samples. Using the NDA framework, we interpret existing image transformations (e.g., jigsaw) as producing OOD samples and develop new learning algorithms to leverage them. Owing to rigorous mathematical characterization of the NDA assumption, we are able to theoretically analyze their properties. As an example, we bias the generator of a GAN to avoid the support of negative samples, improving results on conditional/unconditional image generation tasks. Finally, we leverage NDA for unsupervised representation learning in images and videos. By integrating NDA into MoCo-v2 and DPC, we improve results on image and action recognition on CIFAR10, CIFAR100, ImageNet-100, UCF-101, and HMDB-51 datasets. Future work include exploring other augmentation strategies as well as NDAs for other modalities.
+
+# 9 ACKNOWLEDGEMENT
+
+The authors would like to thank Shengjia Zhao and Kristy Choi for reviewing an earlier draft of the paper. This research was supprted by NSF (#1651565, #1522054, #1733686), ONR (N00014-19-1- 2145), AFOSR (FA9550-19-1-0024), ARO, and Amazon AWS.
+
+# REFERENCES
+
+Antreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. arXiv preprint arXiv:1711.04340, 2017.
+
+Yuki M Asano, Christian Rupprecht, and Andrea Vedaldi. A critical analysis of self-supervision, or what we can learn from a single image. arXiv preprint arXiv:1904.13132, 2019.
+
+Avishek Joey Bose, Huan Ling, and Yanshuai Cao. Adversarial contrastive estimation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1021–1032, 2018.
+
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
+
+M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014.
+
+Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3213–3223, 2016.
+
+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.
+
+Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
+
+Yilun Du and Igor Mordatch. Implicit generation and generalization in energy-based models. arXiv preprint arXiv:1903.08689, 2019.
+
+Charles Fefferman, Sanjoy Mitter, and Hariharan Narayanan. Testing the manifold hypothesis. Journal of the American Mathematical Society, 29(4):983–1049, 2016.
+
+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.
+
+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.
+
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
+
+Tengda Han, Weidi Xie, and Andrew Zisserman. Video representation learning by dense predictive coding. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 0–0, 2019.
+
+Steve Hanneke, Adam Tauman Kalai, Gautam Kamath, and Christos Tzamos. Actively avoiding nonsense in generative models. In Conference On Learning Theory, pp. 209–227, 2018.
+
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
+
+Dan Hendrycks and Thomas G Dietterich. Benchmarking neural network robustness to common corruptions and surface variations. arXiv preprint arXiv:1807.01697, 2018.
+
+Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016.
+
+Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. arXiv preprint arXiv:1812.04606, 2018.
+
+Ming Hou, Brahim Chaib-Draa, Chao Li, and Qibin Zhao. Generative adversarial positive-unlabeled learning. In Proceedings of the 27th International Joint Conference on Artificial Intelligence, pp. 2255–2261, 2018.
+
+Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1125–1134, 2017.
+
+Ayush Jaiswal, Rex Yue Wu, Wael Abd-Almageed, and Prem Natarajan. Unsupervised adversarial invariance. In Advances in Neural Information Processing Systems, pp. 5092–5102, 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, pp. 3111–3119, 2013.
+
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018.
+
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
+
+Xuanlong Nguyen, Martin J Wainwright, and Michael I Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. arXiv preprint arXiv:0809.0853, (11):5847– 5861, September 2008. doi: 10.1109/TIT.2010.2068870.
+
+Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 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.
+
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+
+Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A Alemi, and George Tucker. On variational bounds of mutual information. arXiv preprint arXiv:1905.06922, 2019a.
+
+Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A Alemi, and George Tucker. On variational bounds of mutual information. arXiv preprint arXiv:1905.06922, May 2019b.
+
+Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
+
+Jiaming Song and Stefano Ermon. Understanding the limitations of variational mutual information estimators. arXiv preprint arXiv:1910.06222, October 2019.
+
+Yi Lin Sung, Sung-Hsien Hsieh, Soo-Chang Pei, and Chun-Shien Lu. Difference-seeking generative adversarial network–unseen sample generation. In International Conference on Learning Representations, 2019.
+
+Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. arXiv preprint arXiv:1503.02406, March 2015.
+
+David H Wolpert and William G Macready. No free lunch theorems for optimization. IEEE transactions on evolutionary computation, 1(1):67–82, 1997.
+
+Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6023–6032, 2019.
+
+Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
+
+Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016.
+
+Shengjia Zhao, Hongyu Ren, Arianna Yuan, Jiaming Song, Noah Goodman, and Stefano Ermon. Bias and generalization in deep generative models: An empirical study. In Advances in Neural Information Processing Systems, pp. 10792–10801, 2018.
+
+Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452–1464, 2017.
+
+# A NUMEROSITY CONTAINMENT
+
+Zhao et al. (2018) systematically investigate generalization in deep generative models using two different datasets: (a) a toy dataset where there are $k$ non-overlapping dots (with random color and location) in the image (see Figure 5a), and (b) the CLEVR dataset where ther are $k$ objects (with random shape, color, location, and size) in the images (see Figure 5b). They train a GAN model (WGAN-GP Gulrajani et al. (2017)) with (either) dataset and observe that the learned distribution does not produce the same number of objects as in the dataset it was trained on. The distribution of the numerosity in the generated images is centered at the numerosity from the dataset, with a slightbias towards over-estimation. For, example when trained on images with six dots, the generated images contain anywhere from two to eight dots (see Figure 6a). The observation is similar when trained on images with two CLEVR objects. The generated images contain anywhere from one to three dots (see Figure 6b).
+
+In order to remove samples with numerosity different from the train dataset, we use such samples as negative data during training. For example, while training on images with six dots we use images with four, five and seven dots as negative data for the GAN. The resulting distribution of the numerosity in the generated images is constrained to six. We observe similar behaviour when training a GAN with images containing two CLEVR objects as positive data and images with one or three objects as negative data.
+
+# B IMAGE TRANSFORMATIONS
+
+Given an image of size $H \times W$ , the different image transformations that we used are described below.
+
+
+Figure 5: Toy Datasets used in Numerosity experiments.
+
+
+Figure 6: Left: Distribution over number of dots. The arrows are the number of dots the learning algorithm is trained on, and the solid line is the distribution over the number of dots the model generates. Right: Distribution over number of CLEVR objects the model generates. Generating CLEVR is harder so we explore only one, but the behaviour with NDA is similar to dots.
+
+Jigsaw- $K$ (Noroozi & Favaro, 2016) We partition the image into a grid of $K \times K$ patches of size $( H / K ) \times ( W / K )$ , indexed by $[ 1 , \ldots , K \times K ]$ . Then we shuffle the image patches according to a random permutation (different from the original order) to produce the NDA image. Empirically, we find $K = 2$ to work the best for Jigsaw- $K$ NDA.
+
+Stitching We stitch two equal-sized patches of two different images, either horizontally $( H / 2 \times W )$ or vertically $( H \times W / 2 )$ , chosen uniformly at random, to produce the NDA image.
+
+Cutout / Cutmix We select a random patch in the image with its height and width lying between one-third and one-half of the image height and width respectively. To construct NDA images, this patch is replaced with the mean pixel value of the patch (like cutout (DeVries & Taylor, 2017) with the only difference that they use zero-masking), or the pixel values of another image at the same location (cutmix (Yun et al., 2019)).
+
+Mixup- $\alpha$ NDA image is constructed from a linear interpolation between two images $_ { \textbf { \em x } }$ and $\textbf { { y } }$ (Zhang et al., 2017), $\gamma { \pmb x } + ( 1 - \gamma ) { \pmb y }$ ; $\gamma \sim \mathrm { B e t a } ( \alpha , \alpha )$ . $\alpha$ is chosen so that the distribution has high density at 0.5.
+
+Other classes NDA images are sampled from other classes in the same dataset. See Appendix A.
+
+# C NDA FOR GANS
+
+Theorem 1. Let $\overline { { P } } \in \mathcal { P } ( \mathcal { X } )$ be any distribution over $\mathcal { X }$ with disjoint support than $p _ { \mathrm { d a t a } } ,$ , i.e., such that $\operatorname { s u p p } ( p _ { \mathrm { d a t a } } ) \cap \operatorname { s u p p } ( { \overline { { P } } } ) = \emptyset$ . Let $D _ { \phi } : \mathcal { X } \mathbb { R }$ be the set of all discriminators over $\mathcal { X }$ ,
+
+$f : \mathbb { R } _ { \geq 0 } \to \mathbb { R }$ be a convex, semi-continuous function such that $f ( 1 ) = 0 { \mathrm { ; } }$ , $f ^ { \star }$ be the convex conjugate of $\cdot _ { f } , \bar { f } ^ { \prime }$ its derivative, and $G _ { \theta }$ be a distribution with sample space $\mathcal { X }$ . Then $\forall \lambda \in ( 0 , 1 ]$ , we have:
+
+$$
+\underset { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } { \arg \operatorname* { m i n } } \ \underset { D _ { \phi } : \mathcal { X } \to \mathbb { R } } { \operatorname* { m a x } } L _ { f } \big ( G _ { \theta } , D _ { \phi } \big ) = \underset { G _ { \theta } \in \mathcal { P } ( \mathcal { X } ) } { \arg \operatorname* { m i n } } \ \underset { D _ { \phi } : \mathcal { X } \to \mathbb { R } } { \operatorname* { m a x } } L _ { f } \big ( \lambda G _ { \theta } + \big ( 1 - \lambda \big ) \overline { { P } } , D _ { \phi } \big ) = p _ { \mathrm { d a t a } }
+$$
+
+where $L _ { f } ( Q , D _ { \phi } ) = \mathbb { E } _ { \pmb { x } \sim p _ { \mathrm { d a t a } } } [ D _ { \phi } ( \pmb { x } ) ] - \mathbb { E } _ { \pmb { x } \sim Q } [ f ^ { \star } ( D _ { \phi } ( \pmb { x } ) ) ]$ is the objective for $f$ -GAN (Nowozin et al., 2016). However, the optimal discriminators are different for the two objectives:
+
+$$
+\begin{array} { c } { \underset { D _ { \phi } : \mathcal { X } \mathbb { R } } { \arg \operatorname* { m a x } } L _ { f } ( G _ { \theta } , D _ { \phi } ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / G _ { \theta } \big ) } \\ { \underset { \mathrm { a r g } \operatorname* { m a x } } { \arg \operatorname* { m a x } } L _ { f } \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } , D _ { \phi } \big ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } \big ) \big ) } \end{array}
+$$
+
+Proof. Let us use $p ( x ) , { \bar { p } } ( x ) , q ( x )$ to denote the density functions of $p _ { \mathrm { d a t a } } , \overline { { P } }$ and $G _ { \theta }$ respectively (and $P , { \overline { { P } } } , Q$ for the respective distributions). First, from Lemma 1 in Nguyen et al. (2008), we have that
+
+$$
+\begin{array} { c } { { \displaystyle \operatorname* { m a x } _ { D _ { \phi } : \mathcal { X } \to \mathbb { R } } L _ { f } ( G _ { \theta } , D _ { \phi } ) = D _ { f } ( P \| G _ { \theta } ) } } \\ { { \displaystyle \operatorname* { m a x } _ { D _ { \phi } : \mathcal { X } \to \mathbb { R } } L _ { f } ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { { P } } } , D _ { \phi } ) = D _ { f } ( P \| \lambda Q + ( 1 - \lambda ) \overline { { { P } } } ) } } \end{array}
+$$
+
+where $D _ { f }$ refers to the $f$ -divergence. Then, we have
+
+$$
+\begin{array} { r l } & { \quad B _ { 2 } ( F ) [ M \otimes { \bf { j } } + ( 1 - \lambda ) F ] } \\ & { = \int _ { \gamma } \langle \partial _ { t } ( x ) + ( 1 - \lambda ) \widetilde { \partial } _ { t } ( x ) \rangle \qquad \left( \frac { p ( x ) } { M ( \sigma ) } \right) [ 1 \quad \lambda ] \widehat { \partial } _ { t } ( x ) \rangle } \\ & { = \int _ { \gamma } \lambda \widehat { \mu } _ { 0 } ( x ) \Big { \Big [ \displaystyle \frac { p ( x ) } { M ( \sigma ) + ( 1 - \lambda ) \widehat { \partial } _ { t } ( x ) } \Big ] } + ( 1 - \lambda ) f ( 0 ) 1 } \\ & { \quad \mathrm { s . a . j ~ } \left( \int _ { \gamma } \psi ( \sigma ) \frac { p ( x ) } { M ( \sigma ) + ( 1 - \lambda ) \widehat { \partial } _ { t } ( x ) } \right) - ( 1 - \lambda ) f ( 0 ) } \\ & { \quad \mathrm { ~ } } \\ & { \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad } \\ & { \quad \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \quad \mathrm { ~ } \quad \quad \mathrm { ~ } \quad \quad \mathrm { ~ } \quad \quad \mathrm { ~ } \quad p _ { G } ^ { ( 1 ) } [ M \otimes { \bf { j } } ] } \\ & { = \mathrm { ~ \mathcal { A } ~ } \left( \frac { 1 } { \lambda } \int _ { x } \lambda \widehat { \mu } ( x ) \right) \ \ \mathrm { ~ ( ~ \widehat { \mu } _ { 0 } ( x ) ) ~ } \ \mathrm { ~ ( ~ \widehat { \mu } _ { 0 } ( x ) ) ~ } \ \mathrm { ~ ( ~ \widehat { \mu } _ { 0 } ( x ) ) ~ } \ \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \mathrm { ~ } \quad p _ { G } ^ { ( 2 ) } [ x ] } \\ & \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \mathrm { ~ } \quad \ \end{array}
+$$
+
+where we use the fact that $f$ is convex with Jensen’s inequality in Eq.(11) and the fact that $p ( x ) { \overline { { p } } } ( x ) = 0 , \forall x \in \mathcal { X }$ in Eq.(12) since $P$ and $\overline { { P } }$ has disjoint support.
+
+We also have
+
+$$
+\begin{array} { l } { \displaystyle D _ { f } ( P | | \lambda P + ( 1 - \lambda ) \overline { { P } } ) = \int _ { \chi } \left( \lambda p ( x ) + ( 1 - \lambda ) \overline { { p } } ( x ) \right) f \left( \frac { p ( x ) } { \lambda p ( x ) + ( 1 - \lambda ) \overline { { p } } ( x ) } \right) } \\ { \displaystyle \qquad = \int _ { \chi } \left( \lambda p ( x ) \right) f \left( \frac { p ( x ) } { \lambda p ( x ) + ( 1 - \lambda ) \overline { { p } } ( x ) } \right) + ( 1 - \lambda ) f ( 0 ) } \\ { \displaystyle \qquad = \int _ { \chi } \left( \lambda p ( x ) \right) f \left( \frac { p ( x ) } { \lambda p ( x ) + 0 } \right) + ( 1 - \lambda ) f ( 0 ) } \\ { \displaystyle \qquad = \lambda f \left( \frac { 1 } { \lambda } \right) + ( 1 - \lambda ) f ( 0 ) } \end{array}
+$$
+
+Therefore, in order for the inequality in Equation 11 to be an equality, we must have that $q ( { \pmb x } ) =$ $p ( { \pmb x } )$ for all $\textbf { \textit { x } } \in \textbf { \textit { X } }$ . Therefore, the generator distribution recovers the data distribution at the equlibrium posed by the NDA-GAN objective, which is also the case for the original GAN objective.
+
+Moreover, from Lemma 1 in Nguyen et al. (2008), we have that:
+
+$$
+\underset { D _ { \phi } } { \arg \operatorname* { m a x } } L _ { f } ( Q , D _ { \phi } ) = f ^ { \prime } ( p _ { \mathrm { d a t a } } / Q )
+$$
+
+Therefore, by replacing $Q$ with $G _ { \theta }$ and $( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { { P } } } )$ , we have:
+
+$$
+\begin{array} { c } { \underset { D _ { \phi } : \mathcal { X } \mathbb { R } } { \arg \operatorname* { m a x } } L _ { f } ( G _ { \theta } , D _ { \phi } ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / G _ { \theta } \big ) } \\ { \underset { \mathrm { a r g } \ \mathrm { m a x } } { \arg \operatorname* { m a x } } L _ { f } \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } , D _ { \phi } \big ) = f ^ { \prime } \big ( p _ { \mathrm { d a t a } } / \big ( \lambda G _ { \theta } + ( 1 - \lambda ) \overline { { P } } \big ) \big ) } \end{array}
+$$
+
+which shows that the optimal discriminators are indeed different for the two objectives.
+
+# D NDA FOR CONTRASTIVE REPRESENTATION LEARNING
+
+We describe the detailed statement of Theorem 2 and proof as follows.
+
+Theorem 3. For some distribution $\overline { { p } }$ over $\mathcal { X }$ such that $\mathrm { s u p p } ( \overline { { p } } ) \cap \mathrm { s u p p } ( p _ { \mathrm { d a t a } } ) = \emptyset$ , and for any maximizer of the NDA-CPC objective
+
+$$
+\hat { h } \in \underset { h _ { \theta } } { \arg \operatorname* { m a x } } \underset { g _ { \phi } } { \operatorname* { m a x } } \overline { { I _ { \mathrm { C P C } } } } ( h _ { \theta } , g _ { \phi } )
+$$
+
+the representations of negative samples are disjoint from that of positive samples for $\hat { h }$ ; i.e., $\forall { \mathbf { } } x \in$ $\operatorname { s u p p } ( p _ { \mathrm { d a t a } } ) , \bar { \pmb { x } } \in \operatorname { s u p p } ( \overline { { p } } )$ ,
+
+$$
+\mathrm { s u p p } ( \hat { h } ( \bar { \pmb x } ) ) \cap \mathrm { s u p p } ( \hat { h } ( \pmb x ) ) = \emptyset
+$$
+
+Proof. We use a contradiction argument to establish the proof. For any representation mapping that maximizes the NDA-CPC objective,
+
+$$
+\hat { h } \in \underset { h _ { \theta } } { \arg \operatorname* { m a x } } \underset { g _ { \phi } } { \operatorname* { m a x } } \overline { { I _ { \mathrm { C P C } } } } ( h _ { \theta } , g _ { \phi } )
+$$
+
+suppose that the positive and NDA samples share some support, i.e., $\exists x \ \in \ \operatorname { s u p p } ( p _ { \mathrm { d a t a } } ) , { \bar { x } } \ \in$ $\operatorname { s u p p } ( { \overline { { p } } } )$ ,
+
+$$
+\operatorname { s u p p } ( { \hat { h } } ( { \bar { x } } ) ) \cap \operatorname { s u p p } ( { \hat { h } } ( \mathbf { x } ) ) \neq \emptyset
+$$
+
+We can always construct $\hat { h } ^ { \prime }$ that shares the same representation with $\hat { h }$ for $p _ { \mathrm { d a t a } }$ but have disjoint representations for NDA samples; i.e., $\forall x \in \mathrm { s u p p } ( \bar { p _ { \mathrm { d a t a } } } ) , \bar { x } \in \mathrm { s u p p } ( \bar { p } )$ , the following two statements are true:
+
+1. $\hat { h } ( \pmb { x } ) = \hat { h } ^ { \prime } ( \pmb { x } )$ ;$2 . \ \operatorname { s u p p } ( { \hat { h } } ^ { \prime } ( { \bar { x } } ) ) \cap \operatorname { s u p p } ( { \hat { h } } ^ { \prime } ( x ) ) = \varnothing .$
+
+Our goal is to prove that:
+
+$$
+\operatorname* { m a x } _ { g _ { \phi } } \overline { { I _ { \mathrm { C P C } } } } ( \hat { h } ^ { \prime } , g _ { \phi } ) > \operatorname* { m a x } _ { g _ { \phi } } \overline { { I _ { \mathrm { C P C } } } } ( \hat { h } , g _ { \phi } )
+$$
+
+which shows a contradiction.
+
+For ease of exposition, let us allow zero values for the output of $g$ , and define $0 / 0 = 0$ (in this case, if $g$ assigns zero to positive values, then the CPC objective becomes $- \infty$ , so it cannot be a maximizer to the objective).
+
+Let $\hat { g } \in \arg \operatorname* { m a x } _ { } \overline { { I _ { \mathrm { C P C } } } } ( \hat { h } , g _ { \phi } )$ be an optimal critic to the representation model $\hat { h _ { \theta } }$ . We then define a following critic function:
+
+$$
+\hat { g } ^ { \prime } ( \pmb { x } , z ) = \left\{ \begin{array} { l l } { \hat { g } ( \pmb { x } , z ) } & { \mathrm { i f } \ \exists \pmb { x } \in \mathrm { s u p p } ( p _ { \mathrm { d a t a } } ) \quad s . t . \quad z \in \mathrm { s u p p } ( \hat { h } ^ { \prime } ( \pmb { x } ) ) } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
+$$
+
+In other words, the critic assigns the same value for data-representation pairs over the support of $p _ { \mathrm { d a t a } }$ and zero otherwise. From the assumption over $\hat { h }$ $, \exists x \in \mathrm { s u p p } ( p _ { \mathrm { d a t a } } ) , \bar { x } \in \mathrm { s u p p } ( \bar { p } )$ , and $\overline { { z } } \in \operatorname { s u p p } ( \hat { h } ( \bar { \pmb x } ) )$ ,
+
+$$
+\overline { { z } } \in \operatorname { s u p p } ( \hat { h } ( \pmb { x } ) )
+$$
+
+so $( { \pmb x } , \overline { { { \pmb z } } } )$ can be sampled as a positive pair and $\hat { g } ( \pmb { x } , \overline { { \pmb { z } } } ) > 0$ .
+
+Therefore,
+
+$$
+\begin{array} { r l } & { \quad \underset { g _ { \phi } } { \operatorname* { m a x } } \bar { I } _ { \mathrm { C P C } } ( \hat { h } ^ { \prime } , g _ { \phi } ) \geq \bar { I } _ { \mathrm { C P C } } ( \hat { h } ^ { \prime } , \hat { g } ^ { \prime } ) } \\ & { = \mathbb { E } \Bigg [ \log \frac { ( n + m ) \hat { g } ^ { \prime } ( { \pmb x } , z ) } { \hat { g } ^ { \prime } ( { \pmb x } , z ) + \sum _ { j = 1 } ^ { n - 1 } \hat { g } ^ { \prime } ( { \pmb x } , \hat { z _ { j } } ) + \sum _ { k = 1 } ^ { m } \underbrace { \hat { g } ^ { \prime } ( { \pmb x } , \overline { { z _ { k } } } ) } _ { = 0 } } \Bigg ] } \\ & { \geq \mathbb { E } \Bigg [ \log \frac { ( n + m ) \hat { g } ( { \pmb x } , z ) } { \hat { g } ( { \pmb x } , z ) + \sum _ { j = 1 } ^ { n - 1 } \hat { g } ( { \pmb x } , \hat { z _ { j } } ) + \sum _ { k = 1 } ^ { m } \hat { g } ( { \pmb x } , \overline { { z _ { k } } } ) } \Bigg ] } \\ & { = \underset { g _ { \phi } } { \operatorname* { m a x } } \bar { I } _ { \mathrm { C P C } } ( \hat { h } , g _ { \phi } ) } \end{array}
+$$
+
+which proves the theorem via contradiction.
+
+(plug in definition for NDA-CPC)
+
+(Assumption that $\hat { g }$ is optimal critic)
+
+# E WHAT DOES THE THEORY OVER GANS ENTAIL?
+
+Our goal is to show that NDA GAN objectives are principled in the sense that with infinite computation, data, and modeling capacity, NDA GAN will recover the same optimal generator as a regular GAN. In other words, under these assumptions, NDA will not bias the solution in an undesirable way. We note that the NDA GAN objective is as stable as regular GAN in practice since both methods estimate a lower bound to the divergence with the discriminator, and then minimize that lower bound w.r.t. the generator. The estimated divergences are slightly different, but they have the same minimizer (which is the ground truth data distribution). Intuitively, while GAN and NDA GAN will give the same solution asymptotically, NDA GAN might get there faster (with less data) because it leverages a stronger prior over what the support should (not) be.
+
+# F PIX2PIX
+
+
+Figure 7 highlights the qualitative improvements when we apply the NDA method to Pix2Pix model (Isola et al., 2017).
+Figure 7: Qualitative results on Cityscapes.
+
+# G ANOMALY DETECTION
+
+Here, we show the histogram of difference in discriminator’s output for clean and OOD samples in Figure 8. High difference values imply that the Jigsaw NDA is better at distinguishing OOD samples than the normal BigGAN.
+
+
+Figure 8: Histogram of D(clean) - D(corrupt) for 3 different corruptions.
+
+H EFFECT OF HYPERPARAMETER ON UNCONDITIONAL IMAGE GENERATION
+
+Here, we show the effect of $\lambda$ for unconditional image generation on CIFAR-10 dataset.
+
+Table 8: Effect of $\lambda$ on the FID score for unconditional image generation on CIFAR-10 using Jigsaw as NDA.
+
+
入
1.0
0.75
0.5
0.25
0.15
FID
18.64
16.61
14.95
12.61
13.01
+
+# I UNSUPERVISED LEARNING ON IMAGES
+
+
+Figure 9: Comparing the cosine distance of the representations learned with Jigsaw NDA and MocoV2 (shaded blue), and original Moco-V2 (white). With NDA, we project normal and its jigsaw image representations further away from each other than the one without NDA.
+
+# J DATASET PREPARATION FOR FID EVALUATION
+
+For dataset preparation, we follow the the following procedures: (a) CIFAR-10 contains 60K $3 2 \times 3 2$ images with 10 labels, out of which 50K are used for training and 10K are used for testing, (b)
+
+CIFAR-100 contains 60K $3 2 \times 3 2$ images with 100 labels, out of which 50K are used for training and 10K are used for testing, (c) CelebA contains 162,770 train images and 19,962 test images (we resize the images to $6 4 \times 6 4 \mathrm { p x } ,$ ), (d) STL-10 contains 100K (unlabeled) train images and 8K (labeled) test images (we resize the images to $3 2 \times 3 2 \mathrm { p x }$ ). In our experiments the FID is calculated on the test dataset. In particular, we use 10K generated images vs. 10K test images for CIFAR-10, 10K vs. 10K for CIFAR-100, 19,962 vs. 19,962 for CelebA, and 8K vs 8K for STL-10.
+
+# K HYPERPARAMETERS AND NETWORK ARCHITECTURE
+
+Generative Modeling. We use the same network architecture in BigGAN Brock et al. (2018) for our experiments. The code used for our experiments is based over the author’s PyTorch code. For CIFAR-10, CIFAR-100, and CelebA we train for 500 epochs whereas for STL-10 we train for 300 epochs. For all the datasets we use the following hyperparameters: batch-size $= 6 4$ , generator learning rate $= 2 \mathrm { e } { - } 4$ , discriminator learning rate $= 2 \mathrm { e } { - 4 }$ , discriminator update steps per generator update step $= 4$ . The best model was selected on the basis of FID scores on the test set (as explained above).
+
+Momentum Contrastive Learning. We use the official PyTorch implementation for our experiments. For CIFAR-10 and CIFAR-100, we perform unsupervised pre-training for 1000 epochs and supervised training (linear classifier) for 100 epochs. For Imagenet-100, we perform unsupervised pre-training for 200 epochs and supervised training (linear classifier) for 100 epochs. For CIFAR10 and CIFAR-100, we use the following hyperparameters during pre-training: batch-size $= 2 5 6$ , learning-date $= 0 . 3$ , temperature $= 0 . 0 7$ , feature dimensionality $= 2 0 4 8$ . For ImageNet-100 pretraining we have the following: batch-size $= 1 2 8$ , learning-date $= 0 . 0 1 5$ , temperature $= 0 . 2$ , feature dimensionality $= 1 2 8$ . During linear classification we use a batch size of 256 for all the datasets and learning rate of 10 for CIFAR-10, CIFAR-100, whereas for ImageNet-100 we use learning rate of 30.
+
+Dense Predictive Coding. We use the same network architecture and hyper-parameters in DPC Han et al. (2019) for our experiments and use the official PyTorch implementation. We perform self-supervised training on UCF-101 for 200 epochs and supervised training (action classifier) for 200 epochs on both UCF-101 and HMDB51 datasets.
+
+# L CODE
+
+The code to reproduce our experiments is given here.
+
+# M IMPLEMENTATION DETAILS
+
+For our experiment over GAN, we augment the batch of real samples with a negative augmentation of the same batch, and we treat the augmented images as fake images for the discriminator. Similarly, for the contrastive learning experiments, we consider negative augmentation of the query image batch as negatives for that batch.
+
+For all our experiments we used existing open-source models. For experiments over GAN, we use the open-source implementations of BigGAN and Pix2Pix models, and for contrastive learning, we use the open-source implementation of the MoCo-v2 model and Dense Predictive Coding. Hence, we did not explain in detail each of the models. Implementing NDA is quite simple as we only need to generate NDA samples from the images in a mini-batch which only takes several lines of code.
+
+# N DOES THE GAIN OF NDA FOR REPRESENTATION LEARNING COME FROM THE FACT THAT MORE NEGATIVE SAMPLES ARE USED?
+
+We perform the experiments over MoCo-v2 which maintains a queue of negative samples. The number of negatives is around 65,536. With our approach, we use the augmented versions of images in the same batch as negative. We transform both the key and query images to create NDA samples.
+
+Thus, the number of negatives for our approach is $^ { 6 5 , 5 3 6 + 2 }$ (one NDA sample created using query image and other using key image), only 0.00003051664 times more than the original number of negatives samples in MoCo-v2. Thus our experiments are comparable to the baseline MoCo-v2. In terms of computation, we need an additional forward pass in each batch to get the representations of the NDA samples. The normal MoCo-v2 requires 1.09 secs for entire forward computation, which includes forward pass through the network, momentum update of the key encoder and dot product between the positive and negative samples. With NDA, 1 forward computation requires 1.36 secs.
+
+O WHAT HAPPENS WHEN NEGATIVE DATA AUGMENTATIONS ARE NOISY?
+
+Regarding the performance of negative data augmentation, we perform 2 different experiments:
+
+a) When the noise is low - When using jigsaw as our NDA strategy with a $2 \times 2$ grid, one out of the 24 permutations will be the original image. We find that when this special permutation is not removed, or there is $4 \%$ “noise”, the FID score is 12.61, but when it is removed the FID score is 12.59. So, we find that when the noise is low, the performance of our approach is not greatly affected and is robust in such scenarios.
+
+b) When the noise is large - We use random vertical flipping as our NDA strategy, where with $50 \%$ probability the image is vertically flipped during NDA. In this case, the “noise” is large, as $50 \%$ of the time, the negative sample is actually the original image. We contrast this with the “noisefree” NDA strategy where the NDA image is always vertically flipped. We find that for the random vertical flipping NDA, the FID score of BigGAN is 15.84, whereas, with vertical flipping NDA, the FID score of BigGAN is 14.74. So performance degrades with larger amounts of noise.
\ No newline at end of file
diff --git a/md/train/PQlC91XxqK5/PQlC91XxqK5.md b/md/train/PQlC91XxqK5/PQlC91XxqK5.md
new file mode 100644
index 0000000000000000000000000000000000000000..e69e60664ab569a502d1b259925b96253f21d01d
--- /dev/null
+++ b/md/train/PQlC91XxqK5/PQlC91XxqK5.md
@@ -0,0 +1,331 @@
+# SEGMENTING NATURAL LANGUAGE SENTENCES VIA LEXICAL UNIT ANALYSIS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+In this work, we present Lexical Unit Analysis (LUA), a framework for general sequence segmentation tasks. Given a natural language sentence, LUA scores all the valid segmentation candidates and utilizes dynamic programming (DP) to extract the maximum scoring one. LUA enjoys a number of appealing properties such as inherently guaranteeing the predicted segmentation to be valid and facilitating globally optimal training and inference. Besides, the practical time complexity of LUA can be reduced to linear time, which is very efficient. We have conducted extensive experiments on 5 tasks, including syntactic chunking, named entity recognition (NER), slot filling, Chinese word segmentation, and Chinese part-of-speech (POS) tagging, across 15 datasets. Our models have achieved the state-of-the-art performances on 13 of them. The results also show that the F1 score of identifying long-length segments is notably improved.
+
+# 1 INTRODUCTION
+
+Sequence segmentation is essentially the process of partitioning a sequence of fine-grained lexical units into a sequence of coarse-grained ones. In some scenarios, each composed unit is assigned a categorical label. For example, Chinese word segmentation splits a character sequence into a word sequence (Xue, 2003). Syntactic chunking segments a word sequence into a sequence of labeled groups of words (i.e., constituents) (Sang & Buchholz, 2000).
+
+There are currently two mainstream approaches to sequence segmentation. The most common is to regard it as a sequence labeling problem by using IOB tagging scheme (Mesnil et al., 2014; Ma & Hovy, 2016; Liu et al., 2019b; Chen et al., 2019a; Luo et al., 2020). A representative work is Bidirectional LSTM-CRF (Huang et al., 2015), which adopts LSTM (Hochreiter & Schmidhuber, 1997) to read an input sentence and CRF (Lafferty et al., 2001) to decode the label sequence. This type of method is very effective, providing tons of state-of-the-art performances. However, it is vulnerable to producing invalid labels, for instance, “O, I-tag, I-tag”. This problem is very severe in low resource settings (Peng et al., 2017). In experiments (see section 4.6), we also find that it performs poorly in recognizing long-length segments.
+
+Recently, there is a growing interest in span-based models (Zhai et al., 2017; Li et al., 2019; Yu et al., 2020). They treat a span rather than a token as the basic unit for labeling. Li et al. (2019) cast named entity recognition (NER) to a machine reading comprehension (MRC) task, where entities are extracted as retrieving answer spans. Yu et al. (2020) rank all the spans in terms of the scores predicted by a bi-affine model (Dozat & Manning, 2016). In NER, span-based models have significantly outperformed their sequence labeling based counterparts. While these methods circumvent the use of IOB tagging scheme, they still rely on post-processing rules to guarantee the extracted span set to be valid. Moreover, since span-based models are locally normalized at span level, they potentially suffer from the label bias problem (Lafferty et al., 2001).
+
+This paper seeks to provide a new framework which infers the segmentation of a unit sequence by directly selecting from all valid segmentation candidates, instead of manipulating tokens or spans. To this end, we propose Lexical Unit Analysis (LUA) in this paper. LUA assigns a score to every valid segmentation candidate and leverages dynamic programming (DP) (Bellman, 1966) to search for the maximum scoring one. The score of a segmentation is computed by using the scores of its all segments. Besides, we adopt neural networks to score every segment of the input sentence.
+
+
+Figure 1: A toy example to show LUA and how it differs from prior methods. The items in blue and red respectively denote valid and invalid predictions.
+
+The purpose of using DP is to solve the intractability of extracting the maximum scoring segmentation candidate by brute-force search. The time complexity of LUA is quadratic time, yet it can be optimized to linear time in practice by performing parallel matrix computations. For training criterion, we incur a hinge loss between the ground truth and the predictions. We also extend LUA to unlabeled segmentation and capturing label correlations.
+
+Figure 1 illustrates the comparison between previous methods and the proposed LUA. Prior models at token level and span level are vulnerable to generating invalid predictions, and hence rely on heuristic rules to fix them. For example, in the middle part of Figure 1, the spans of two inferred named entities, [Word $\mathrm { C u p } \mathrm { _ { M I S C } }$ and $[ \mathrm { C u p } ] _ { \mathrm { M I S C } }$ , conflicts, which is mitigated by comparing the predicted scores. LUA scores all possible segmentation candidates and uses DP to extract the maximum scoring one. In this way, our models guarantee the predictions to be valid. Moreover, the globality of DP addresses the label bias problem.
+
+Extensive experiments are conducted on syntactic chunking, NER, slot filling, Chinese word segmentation, and Chinese part-of-speech (POS) tagging across 15 tasks. We have obtained new stateof-the-art results on 13 of them and performed competitively on the others. In particular, we observe that LUA is expert at identifying long-length segments.
+
+# 2 METHODOLOGY
+
+We denote an input sequence (i.e., fine-grained lexical units) as $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \cdot \cdot \cdot , x _ { n } ]$ , where $n$ is the sequence length. An output sequence (i.e., coarse-grained lexical units) is represented as the segmentation $\mathbf { y } = [ y _ { 1 } , y _ { 2 } , \cdots , y _ { m } ]$ with each segment $y _ { k }$ being a triple $( i _ { k } , j _ { k } , t _ { k } )$ . $m$ denotes its length. $( i _ { k } , j _ { k } )$ specifies a span that corresponds to the phrase $\mathbf { x } _ { i _ { k } , j _ { k } } = [ x _ { i _ { k } } , x _ { i _ { k } + 1 } , \cdot \cdot \cdot , x _ { j _ { k } } ]$ . $t _ { k }$ is a label from the label space $\mathcal { L }$ . We define a valid segmentation candidate as its segments are non-overlapping and fully cover the input sequence.
+
+A case extracted from CoNLL-2003 dataset (Sang & De Meulder, 2003):
+
+$$
+\begin{array} { r } { \mathbf { x } = [ [ \mathrm { S O S } ] , \mathrm { S a n g t h a i } , \mathrm { G l o r y } , 2 2 / 1 1 / 9 6 , 3 0 0 0 , \mathrm { S i n g a p o r e } ] } \\ { \mathbf { y } = [ ( 1 , 1 , 0 ) , ( 2 , 3 , \mathrm { M I S C } ) , ( 4 , 4 , 0 ) , ( 5 , 5 , 0 ) , ( 6 , 6 , \mathrm { L O C } ) ] } \end{array} .
+$$
+
+Start-of-sentence symbol [SOS] is added in the pre-processing stage.
+
+# 2.1 MODEL: SCORING SEGMENTATION CANDIDATES
+
+We denote $\mathcal { V }$ as the universal set that contains all valid segmentation candidates. Given one of its members $\mathbf { y } \in \mathcal { V }$ , we compute the score $f ( \mathbf { y } )$ as
+
+$$
+f ( \mathbf { y } ) = \sum _ { ( i , j , t ) \in \mathbf { y } } \Big ( s _ { i , j } ^ { c } + s _ { i , j , t } ^ { l } \Big ) ,
+$$
+
+Input: Composition score $s _ { i , j } ^ { c }$ and label score $s _ { i , j , t } ^ { l }$ for every possible segment $( i , j , t )$ .
+
+utput: The maximum segmentation scoring candidate $\hat { \mathbf { y } }$ and its score $f ( \hat { \mathbf { y } } )$ .
+
+1 Set two $n \times n$ shaped matrices, $\mathbf { c } ^ { L }$ and ${ \bf b } ^ { c }$ , for computing maximum scoring labels.
+
+2 Set two $n$ -length vectors, $\mathbf { g }$ and $\mathbf { b } ^ { g }$ , for computing maximum scoring segmentation.
+
+4 Compute the maximum label score for each span $( i , j ) \colon s _ { i , j } ^ { L } = \operatorname* { m a x } _ { t \in \mathcal { L } } s _ { i , j , t } ^ { l }$
+5 Record the backtracking index: $b _ { i , j } ^ { c } = \arg \operatorname* { m a x } _ { t \in \mathcal { L } } s _ { i , j , t } ^ { l }$ .
+
+6 Initialize the value of the base case $\mathbf { x } _ { 1 , 1 } \colon g _ { 1 } = s _ { 1 , 1 } ^ { c } + s _ { 1 , 1 } ^ { L }$
+
+8 Compute the value of the prefix $\begin{array} { r } { \mathbf { x } _ { 1 , i } { \mathrm { : ~ } } g _ { i } = \operatorname* { m a x } _ { 1 \leq j \leq i - 1 } \left( g _ { i - j } + \left( s _ { i - j + 1 , i } ^ { c } + s _ { i - j + 1 , i } ^ { L } \right) \right) } \end{array}$
+9 Record the backtracking index: $b _ { i } ^ { g } = \arg \operatorname* { m a x } _ { 1 \leq j \leq i - 1 } \left( g _ { i - j } + ( s _ { i - j + 1 , i } ^ { c } + s _ { i - j + 1 , i } ^ { L } ) \right) .$ .
+10 Get the maximum scoring candidate $\hat { \mathbf { y } }$ by back tracing the tables $\mathbf { b } ^ { g }$ and $\mathbf { b } ^ { c }$ .
+11 Get the maximum segmentation score: $f ( \hat { \mathbf { y } } ) = g _ { n }$ .
+
+where $s _ { i , j } ^ { c }$ is the composition score to estimate the feasibility of merging several fine-grained units $[ x _ { i } , x _ { i + 1 } , \cdot \cdot \cdot , x _ { j } ]$ into a coarse-grained unit and $s _ { i , j , t } ^ { l }$ is the label score to measure how likely the label of this segment is $t$ . Both scores are obtained by a scoring model.
+
+Scoring Model. a scoring model scores all possible segments $( i , j , t )$ for an input sentence $\mathbf { x }$ . Firstly, we get the representation for each fine-grained unit. Following prior works (Li et al., 2019; Luo et al., 2020; Yu et al., 2020), we adopt BERT (Devlin et al., 2018), a powerful pre-trained language model, as the sentence encoder. Specifically, we have
+
+$$
+[ \mathbf { h } _ { 1 } ^ { w } , \mathbf { h } _ { 2 } ^ { w } \cdot \cdot \cdot \mathbf { \epsilon } , \mathbf { h } _ { n } ^ { w } ] = \mathrm { B E R T } ( \mathbf { x } ) ,
+$$
+
+Then, we compute the representation for a coarse-grained unit $\mathbf { x } _ { i , j } , 1 \leq i \leq j \leq n$ as
+
+$$
+\mathbf { h } _ { i , j } ^ { p } = \mathbf { h } _ { i } ^ { w } \oplus \mathbf { h } _ { j } ^ { w } \oplus \left( \mathbf { h } _ { i } ^ { w } - \mathbf { h } _ { j } ^ { w } \right) \oplus \big ( \mathbf { h } _ { i } ^ { w } \odot \mathbf { h } _ { j } ^ { w } \big ) ,
+$$
+
+where $\oplus$ is vector concatenation and $\odot$ is element-wise product.
+
+Eventually, we employ two non-linear feedforward networks to score a segment $( i , j , t )$ :
+
+$$
+\begin{array} { r } { \boldsymbol { s } _ { i , j } ^ { c } = \left( \mathbf { v } ^ { c } \right) ^ { T } \operatorname { t a n h } ( \mathbf { W } ^ { c } \mathbf { h } _ { i , j } ^ { p } ) , \boldsymbol { s } _ { i , j , t } ^ { l } = \left( \mathbf { v } _ { t } ^ { l } \right) ^ { T } \operatorname { t a n h } ( \mathbf { W } ^ { l } \mathbf { h } _ { i , j } ^ { p } ) , } \end{array}
+$$
+
+where $\mathbf { v } _ { } ^ { c }$ , $\mathbf { W } ^ { c }$ , $\mathbf { v } _ { t } ^ { l } , t \in \mathcal { L }$ , and $\mathbf { W } ^ { l }$ are all learnable parameters. Besides, the scoring model used here can be flexibly replaced by any regression method.
+
+# 2.2 INFERENCE VIA DYNAMIC PROGRAMMING
+
+The prediction of the maximum scoring segmentation candidate can be formulated as
+
+$$
+{ \hat { \mathbf { y } } } = \operatorname * { a r g m a x } _ { \mathbf { y } \in \mathcal { Y } } f ( \mathbf { y } ) .
+$$
+
+Because the size of search space $| \mathcal { V } |$ increases exponentially with respect to the sequence length $n$ , brute-force search to solve Equation 5 is computationally infeasible. LUA uses DP to address this issue, which is facilitated by the decomposable nature of Equation 1.
+
+DP is a well-known optimization method which solves a complicated problem by breaking it down into simpler sub-problems in a recursive manner. The relation between the value of the larger problem and the values of its sub-problems is called the Bellman equation.
+
+Sub-problem. In the context of LUA, the sub-problem of segmenting an input unit sequence $\mathbf { x }$ is segmenting its prefixes $\mathbf { x } _ { 1 , i } , 1 \leq i \leq n$ . We define $g _ { i }$ as the maximum segmentation score of the prefix $\mathbf { x } _ { 1 , i }$ . Under this scheme, we have $\textstyle \operatorname* { m a x } _ { \mathbf { y } \in { \mathcal { y } } } f ( \mathbf { y } ) = g _ { n }$ .
+
+The Bellman Equation. The relatinship between segmenting a sequence $\mathbf { x } _ { 1 , i } , i > 1$ and segmenting its prefixes $x _ { 1 , i - j } , 1 \leq j \leq i - 1$ is built by the last segments $( i - j + 1 , i , t )$ :
+
+$$
+g _ { i } = \operatorname* { m a x } _ { 1 \leq j \leq i - 1 } \big ( g _ { i - j } + \big ( s _ { i - j + 1 , i } ^ { c } + \operatorname* { m a x } _ { t \in \mathcal { L } } s _ { i - j + 1 , i , t } ^ { l } \big ) \big ) .
+$$
+
+In practice, to reduce the time complexity of above equation, the last term is computed beforehand as $\begin{array} { r } { \dot { s } _ { i , j } ^ { L } = \operatorname* { m a x } _ { t \in \mathcal { L } } s _ { i , j , t } ^ { l } , 1 \leq i \leq j \dot { \leq } n } \end{array}$ . Hence, Equation 6 is reformulated as
+
+$$
+g _ { i } = \operatorname* { m a x } _ { 1 \leq j \leq i - 1 } \big ( g _ { i - j } + ( s _ { i - j + 1 , i } ^ { c } + s _ { i - j + 1 , i } ^ { L } ) \big ) .
+$$
+
+The base case is the first token $\mathbf { x } _ { 1 , 1 } = [ [ \mathrm { S O S } ] ]$ . We get its score $g _ { 1 }$ as $s _ { 1 , 1 } ^ { c } + s _ { 1 , 1 } ^ { L }$
+
+Algorithm 1 shows how DP is applied in inference. Firstly, we set two matrices and two vectors to store the solutions to the sub-problems (1-st to 2-nd lines). Secondly, we get the maximum label scores for all the spans (3-rd to 5-th lines). Then, we initialize the trivial case $g _ { 1 }$ and recursively calculate the values for prefixes $\mathbf { x } _ { 1 , i } , i > 1$ (6-th to 9-th lines). Finally, we get the predicted segmentation $\hat { \mathbf { y } }$ and its score $f ( \hat { \mathbf { y } } )$ (10-th to 11-th lines).
+
+The time complexity of Algorithm 1 is $\mathcal { O } ( n ^ { 2 } )$ . By performing the max operation of Equation 7 in parallel on GPU, it can be optimized to only ${ \mathcal { O } } ( n )$ , which is highly efficient. Besides, DP, as the backbone of the proposed model, is non-parametric. The trainable parameters only exist in the scoring model part. These show LUA is a very light-weight algorithm.
+
+# 2.3 TRAINING CRITERION
+
+We adopt max-margin penalty as the loss function for training. Given the predicted segmentation $\hat { \mathbf { y } }$ and the ground truth segmentation $\mathbf { y } ^ { * }$ , we have
+
+$$
+\mathcal { T } = \operatorname* { m a x } \big ( 0 , 1 - f ( \mathbf { y } ^ { * } ) + f ( \hat { \mathbf { y } } ) \big ) .
+$$
+
+# 3 EXTENSIONS OF LUA
+
+We propose two extensions of LUA for generalizing it to different scenarios.
+
+Unlabeled Segmentation. In some tasks (e.g., Chinese word segmentation), the segments are unlabeled. Under this scheme, the Equation 1 and Equation 7 are reformulated as
+
+$$
+f ( \mathbf { y } ) = \sum _ { ( i , j ) \in \mathbf { y } } s _ { i , j } ^ { c } , ~ g _ { i } = \operatorname* { m a x } _ { 1 \leq j \leq i - 1 } ( g _ { i - j } + s _ { i - j + 1 , i } ^ { c } ) .
+$$
+
+Capturing Label Correlations. In some tasks (e.g., syntactic chunking), the labels of segments are strongly correlated. To incorporate this information, we redefine $f ( \mathbf { y } )$ as
+
+$$
+f ( { \bf { y } } ) = \sum _ { 1 \le k \le m } \left( s _ { i _ { k } , j _ { k } } ^ { c } + s _ { i _ { k } , j _ { k } , t _ { k } } ^ { l } \right) + \sum _ { 1 \le k \le m } s _ { t _ { k - q + 1 } , t _ { k - q + 2 } , \cdots , t _ { k } } ^ { d } .
+$$
+
+Score In pra $s _ { t _ { k - q + 1 } , t _ { k - q + 2 } , \cdots , t _ { k } } ^ { d }$ models the label dependencies among balances the efficiency and the effecti $q$ successive segments, ness well, and thus pa $_ { \mathbf { y } _ { k - q + 1 , k } }$ $q = 2$
+a learnable matrix $\mathbf { W } ^ { d } \in \mathbb { R } ^ { | \nu | \times | \nu | }$ to implement it.
+
+The corresponding Bellman equation to above scoring function is
+
+$$
+g _ { i , t } = \underset { 1 \leq j \leq i - 1 } { \operatorname* { m a x } } \big ( \underset { t ^ { \prime } \in \mathcal { L } } { \operatorname* { m a x } } ( g _ { i - j , t ^ { \prime } } + s _ { t ^ { \prime } , t } ^ { d } ) + ( s _ { i - j + 1 , i } ^ { c } + s _ { i - j + 1 , i , t } ^ { l } ) \big ) ,
+$$
+
+where $g _ { i , t }$ is the maximum score of labeling the last segment of the prefix $\mathbf { x } _ { 1 , i }$ with $t$ . For initialization, we set the value of $g _ { . 1 , \mathrm { O } } ^ { d }$ as 0 and the others as $- \infty$ . By performing the inner loops of two max operations in parallel, the practical time complexity for computing $g _ { i , t } , 1 \leq i \leq n , t \in \mathcal { L }$ is also ${ \mathcal { O } } ( n )$ . Ultimately, the segmentation score $f ( \hat { \mathbf { y } } )$ is obtained by $\operatorname* { m a x } _ { t \in \mathcal { L } } g _ { n , t }$ .
+
+This extension further improves the results on syntactic chunking and Chinese POS tagging, as both tasks have rich sequential features among the labels of segments.
+
+Table 1: Experiment results on Chinese word segmentation.
+
+
+
+Table 2: Experiment results on the four datasets of Chinese POS tagging.
+
+
Model
CTB5
CTB6
CTB9
UD1
Bi-RNN+ CRF (Single) (Shao et al., 2017) Bi-RNN + CRF (Ensemble) (Shao et al.,2017)
94.07
90.81
91.89
89.41
Lattice-LSTM(Meng et al.,2019)
94.38
-
92.34
89.75
Glyce + Lattice-LSTM (Meng et al., 2019)
95.14
91.43
92.13
90.09
BERT (Meng et al.,2019)
95.61
91.92
92.38
90.87
Glyce +BERT (Meng et al., 2019)
96.06
94.77
92.29
94.79
96.61
95.41
93.15
96.14
This Work
LUA
96.79
95.39
93.22
96.01
LUA w/Label Correlations
97.96
96.63
93.95
97.08
+
+# 4 EXPERIMENTS
+
+We have conducted extensive studies on 5 tasks, including Chinese word segmentation, Chinese POS tagging, syntactic chunking, NER, and slot filling, across 15 datasets. Firstly, Our models have achieved new state-of-the-art performances on 13 of them. Secondly, the results demonstrate that the F1 score of identifying long-length segments has been notably improved. Lastly, we show that LUA is a very efficient algorithm concerning the running time.
+
+# 4.1 SETTINGS
+
+We use the same configurations for all 15 datasets. L2 regularization and dropout ratio are respectively set as $1 \times 1 0 ^ { - 6 }$ and 0.2 for reducing overfit. We use Adam (Kingma & Ba, 2014) to optimize our model. Following prior works, BERTBASE is adopted as the sentence encoder. We use uncased BERTBASE for slot filling, Chinese BERTBASE for Chinese tasks (e.g., Chinese POS tagging), and cased BERTBASE for others (e.g., syntactic chunking). In addition, the improvements of our model over baselines are statistically significant with $p < 0 . 0 5$ under t-test.
+
+# 4.2 CHINESE WORD SEGMENTATION
+
+Chinese word segmentation splits a Chinese character sequence into a sequence of Chinese words. We use SIGHAN 2005 bake-off (Emerson, 2005) and Chinese Treebank 6.0 (CTB6) (Xue et al., 2005). SIGHAN 2005 back-off consists of 5 datasets, namely AS, MSR, CITYU, and PKU. Following Ma et al. (2018), we randomly select $1 0 \%$ training data as development set. We convert all digits, punctuation, and Latin letters to half-width for handling full/half-width mismatch between training and test set. We also convert AS and CITYU to simplified Chinese. For CTB6, we follow the same format and partition as in Yang et al. (2017); Ma et al. (2018).
+
+Table 1 depicts the experiment results. All the results of baselines are from Yang et al. (2017); Ma et al. (2018); Huang et al. (2019); Meng et al. (2019). We have achieved new state-of-the-art performance on all datasets except MSR. Our model improves the F1 score by $0 . 2 5 \%$ on AS, $0 . 3 2 \%$ on CITYU, $0 . 1 9 \%$ on PKU, and $0 . 5 4 \%$ on CTB6. Note that our model doesn’t use any external resources, such as glyph information (Meng et al., 2019) or POS tags (Yang et al., 2017). Despite this, our model is still competitive with Glyce $^ +$ BERT on MSR.
+
+# 4.3 CHINESE POS TAGGING
+
+Chinese POS tagging jointly segments a Chinese character sequence and assigns a POS tag to each segmented unit. We use Chinese Treebank 5.0 (CTB5), CTB6, Chinese Treebank 9.0 (CTB9) (Xue et al., 2005), and the Chinese section of Universal Dependencies 1.4 (UD1) (Nivre et al., 2016). CTB5 is comprised of newswire data. CTB9 consists of source texts in various genres, which cover CTB5. we convert the texts in UD1 from traditional Chinese into simplified Chinese. We follow the same train/dev/test split for above datasets as in Shao et al. (2017).
+
+Table 3: Experiment results on syntactic chunking and NER.
+
+
Model
Chunking
NER
CoNLL-2000
CoNLL-2003
OntoNotes5.0
Bi-LSTM + CRF (Huang et al., 2015)
94.46
90.10
1
Flair Embeddings (Akbik et al., 2018)
96.72
93.09
89.3
GCDT w/BERT (Liu et al., 2019b)
96.81
93.23
1
BERT-MRC (Li et al., 2019)
-
93.04
91.11
HCR w/BERT (Luo et al., 2020)
=
93.37
90.30
BERT-Biaffine Model (Yu et al., 2020) LUA
-
93.5
91.3
This Work
96.95
93.46
92.09
LUA w/Label Correlations
97.23
-
-
+
+Table 2 shows the experiment results. The performances of all baselines are reported from Meng et al. (2019). Our model LUA w/ Label Correlations has yielded new state-of-the-art results on all the datasets: it improves the F1 scores by $1 . 3 5 \%$ on CTB5, $1 . 2 2 \%$ on CTB6, $0 . 8 \%$ on CTB9, and $0 . 9 4 \%$ on UD1. Moreover, the basic LUA without capturing the label correlations also outperforms the strongest baseline, Glyce $^ +$ BERT, by $0 . 1 8 \%$ on CTB5 and $0 . 0 7 \%$ on CTB9. All these facts further verify the effectiveness of LUA and its extension.
+
+# 4.4 SYNTACTIC CHUNKING AND NER
+
+Syntactic chunking aims to find phrases related to syntatic category for a sentence. We use CoNLL2000 dataset (Sang & Buchholz, 2000), which defines 11 syntactic chunk types (NP, VP, PP, etc.) and follow the standard splittings of training and test datasets as previous work. NER locates the named entities mentioned in unstructured text and meanwhile classifies them into predefined categories. We use CoNLL-2003 dataset (Sang & De Meulder, 2003) and OntoNotes 5.0 dataset (Pradhan et al., 2013). CoNLL-2003 dataset consists of 22137 sentences totally and is split into 14987, 3466, and 3684 sentences for the training set, development set, and test set, respectively. It is tagged with four linguistic entity types (PER, LOC, ORG, MISC). OntoNotes 5.0 dataset contains 76714 sentences from a wide variety of sources (e.g., magazine and newswire). It includes 18 types of named entity, which consists of 11 types (Person, Organization, etc.) and 7 values (Date, Percent, etc.). We follow the same format and partition as in Li et al. (2019); Luo et al. (2020); Yu et al. (2020). In order to fairly compare with previous reported results, we convert the predicted segments into IOB format and utilize conlleval script1 to compute the F1 score at test time.
+
+Table 3 shows the results. Most of baselines are directly taken from Akbik et al. (2018); Li et al. (2019); Luo et al. (2020); Yu et al. (2020). Besides, following Luo et al. (2020), we rerun the source code2 of GCDT and report its result on CoNLL-2000 with standard evaluation method. Generally, our proposed models LUA w/o Label Correlations yield competitive performance over state-of-theart models on both Chunking and NER tasks. Specifically, regarding to the NER task, on CoNLL2003 dataset our model LUA outperforms several strong baselines including Flair Embedding, and it is comparable to the state-of-the-art model (i.e., BERT-Biaffine Model). In particular, on OntoNotes dataset, LUA outperforms it by $0 . 7 9 \%$ points and establishes a new state-of-the-art result. Regarding to the Chunking task, LUA advances the best model (GCDT) and the improvements are further enlarged to $0 . 4 \hat { 2 } \%$ points by LUA w/ Label Correlations.
+
+# 4.5 SLOT FILLING
+
+Slot filling, as an important task in spoken language understanding (SLU), extracts semantic constituents from an utterance. We use ATIS dataset (Hemphill et al., 1990), SNIPS dataset (Coucke et al., 2018), and MTOD dataset (Schuster et al., 2018). ATIS dataset consists of audio recordings of
+
+Table 4: Experiment results on the three datasets of slot filling.
+
+
Model
ATIS
SNIPS
MTOD
Slot-Gated SLU (Goo et al.,2018) Bi-LSTM + EMLo (Siddhant et al., 2019)
95.20
88.30
95.12
95.42
93.90
-
Joint BERT (Chen et al., 2019b) CM-Net (Liu et al.,2019c)
96.10 96.20
97.00
96.48
96.15
97.15
-
This Work
LUA LUA w/ Intent Detection
96.27
97.10
97.53
97.20
97.55
+
+
Model
1-3(8695)
4-7(2380)
8-11(151)
12-24(31)
Overall
HCRw/BERT
91.15
85.22
50.43
20.67
90.27
BERT-Biaffine Model
91.67
87.23
70.24
40.55
91.26
LUA
92.31
88.52
77.34
57.27
92.09
+
+Table 5: The F1 scores for NER models on different segment lengths. $A - B ( N )$ denotes that there are $N$ entities whose span lengths are between $A$ and $B$ .
+
+people making flight reservations. The training set contains 4478 utterances and the test set contains 893 utterances. SNIPS dataset is collected by Snips personal voice assistant. The training set contains 13084 utterances and the test set contains 700 utterances. MTOD dataset has three domains, including Alarm, Reminder, and Weather. We use the English part of MTOD dataset, where training set, dev set, and test set respectively contain 30521, 4181, and 8621 utterances. We follow the same partition of above datasets as in Goo et al. (2018); Schuster et al. (2018).
+
+Table 4 summarizes the experiment results for slot filling. On ATIS and SNIPS, we take the results of all baselines as reported in Liu et al. (2019c) for comparison. On MTOD, we rerun the open source toolkits, Slot-gated $\mathrm { S L U } ^ { 3 }$ and Joint BERT4. As all previous approaches jointly model slot filling and intent detection (a classification task in SLU), we follow them to augment LUA with intent detection for a fair comparison. As shown in Table 4, the augmented LUA has surpassed all baselines and obtained state-of-the-art results on the three datasets: it increases the F1 scores by around $0 . 0 5 \%$ on ATIS and SNIPS, and delivers a substantial gain of $1 . 1 1 \%$ on MTOD. It’s worth mentioning that LUA even outperforms the strong baseline Joint BERT with a margin of $0 . 1 8 \%$ and $0 . 2 1 \%$ on ATIS and SNIPS without modeling intent detection.
+
+# 4.6 LONG-LENGTH SEGMENT IDENTIFICATION
+
+Since LUA doesn’t resort to IOB tagging scheme, it should be more accurate in recognizing longlength segments than prior methods. To verify this intuition, we evaluate different models on the segments of different lengths. This study is investigated on OntoNotes 5.0 dataset. Two strong models are adopted as the baselines: one is the best sequence labeling model (i.e., HCR) and the other is the best span-based model (i.e., BERT-Biaffine Model). Both baselines are reproduced by rerunning their open source codes, biaffine-ner5 and Hire-NER6.
+
+The results are shown in Table 5. On the one hand, both LUA and Biaffine Model obtain much higher scores of extracting long-length entities than HCR. For example, LUA outperforms HCR w/ BERT by almost twofold on range $1 2 - 2 4$ . On the other hand, LUA achieves even better results than BERT-Biaffine Model. For instance, the F1 score improvements of LUA over it are $1 0 . 1 1 \%$ on range $8 - 1 1$ and $4 1 . 2 3 \%$ on range $1 2 - 2 4$ .
+
+# 4.7 RUNNING TIME ANALYSIS
+
+Table 6 shows the running time comparison among different models. The middle two columns are the time complexity of decoding a label sequence. The last column is the time cost of one epoch in training. We set the batch size as 16 and run all the models on 1 GPU. The results indicate that
+
+Table 6: Running time comparison on the syntactic chunking dataset.
+
+
Model
Theoretical Complexity
Practical Complexity
Running Time
BERT BERT+CRF
O(n) O(n|C|2)
0(1)
5m11s 7m33s
LUA
O(n²)
O(n) O(n)
6m25s
LUA w/Label Correlations
O(n²|C1²)
0(n)
7m09s
+
+the success of our models in performances does not lead to serious side-effects on efficiency. For example, with the same practical time complexity, BERT $^ +$ CRF is slower than the proposed LUA by $1 5 . 0 1 \%$ and LUA w/ Label Correlations by $5 . \dot { 3 } 0 \%$ .
+
+# 5 RELATED WORK
+
+Sequence segmentation aims to partition a fine-grained unit sequence into multiple labeled coarsegrained units. Traditionally, there are two types of methods. The most common is to cast it into a sequence labeling task (Mesnil et al., 2014; Ma & Hovy, 2016; Chen et al., 2019a) by using IOB tagging scheme. This method is simple and effective, providing a number of state-of-the-art results. Akbik et al. (2018) present Flair Embeddings that pretrain character embedding in a large corpus and directly use it, instead of word representation, to encode a sentence. Liu et al. (2019b) introduce GCDT that deepens the state transition path at each position in a sentence, and further assigns each word with global representation. Luo et al. (2020) use hierarchical contextualized representations to incorporate both sentence-level and document-level information. Nevertheless, these models are vulnerable to producing invalid labels and perform poorly in identifying longlength segments. This problem is very severe in low-resource setting. Ye & Ling (2018); Liu et al. (2019a) adopt Semi-Markov CRF (Sarawagi & Cohen, 2005) that improves CRF at phrase level. However, the computation of CRF loss is costly in practice and the potential to model the label dependencies among segments is limited. An alternative approach that is less studied uses a transition-based system to incrementally segment and label an input sequence (Zhang et al., 2016; Lample et al., 2016). For instance, Qian et al. (2015) present a transition-based model for joint word segmentation, POS tagging, and text normalization. Wang et al. (2017) employ a transitionbased model to disfluency detection task, which helps capture non-local chunk-level features. These models have many advantages like theoretically lower time complexity and labeling the extracted mentions at span level. However, to our best knowledge, no recent transition-based models surpass their sequence labeling based counterparts.
+
+More recently, there is a surge of interests in span-based models. They treat a segment, instead of a fine-grained token, as the basic unit for labeling. For example, Li et al. (2019) regard NER as a MRC task, where entities are recognized as retrieving answer spans. Since these methods are locally normalized at span level rather than sequence level, they potentially suffer from the label bias problem. Additionally, they rely on rules to ensure the extracted span set to be valid. Spanbased methods also emerge in other fields of NLP. In dependency parsing, Wang & Chang (2016) propose a LSTM-based sentence segment embedding method named LSTM-Minus. Stern et al. (2017) integrate LSTM-minus feature into constituent parsing models. In coreference resolution, Lee et al. (2018) consider all spans in a document as the potential mentions and learn distributions over all the possible antecedents for each other.
+
+# 6 CONCLUSION
+
+This work proposes a novel LUA for general sequence segmentation tasks. LUA directly scores all the valid segmentation candidates and uses dynamic programming to extract the maximum scoring one. Compared with previous models, LUA naturally guarantees the predicted segmentation to be valid and circumvents the label bias problem. Extensive studies are conducted on 5 tasks across 15 datasets. We have achieved the state-of-the-art performances on 13 of them. Importantly, the F1 score of identifying long-length segments is significantly improved.
+
+# REFERENCES
+
+Alan Akbik, Duncan Blythe, and Roland Vollgraf. Contextual string embeddings for sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pp. 1638–1649, 2018.
+
+Richard Bellman. Dynamic programming. Science, 153(3731):34–37, 1966.
+
+Hui Chen, Zijia Lin, Guiguang Ding, Jianguang Lou, Yusen Zhang, and Borje Karlsson. Grn: Gated relation network to enhance convolutional neural network for named entity recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 6236–6243, 2019a.
+
+Qian Chen, Zhu Zhuo, and Wen Wang. Bert for joint intent classification and slot filling. arXiv preprint arXiv:1902.10909, 2019b.
+
+Alice Coucke, Alaa Saade, Adrien Ball, Theodore Bluche, Alexandre Caulier, David Leroy, Cl ´ ement ´ Doumouro, Thibault Gisselbrecht, Francesco Caltagirone, Thibaut Lavril, et al. Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces. arXiv preprint arXiv:1805.10190, 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.
+
+Timothy Dozat and Christopher D Manning. Deep biaffine attention for neural dependency parsing. arXiv preprint arXiv:1611.01734, 2016.
+
+Thomas Emerson. The second international chinese word segmentation bakeoff. In Proceedings of the fourth SIGHAN workshop on Chinese language Processing, 2005.
+
+Chih-Wen Goo, Guang Gao, Yun-Kai Hsu, Chih-Li Huo, Tsung-Chieh Chen, Keng-Wei Hsu, and Yun-Nung Chen. Slot-gated modeling for joint slot filling and intent prediction. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 753–757, 2018.
+
+Charles T Hemphill, John J Godfrey, and George R Doddington. The atis spoken language systems pilot corpus. In Speech and Natural Language: Proceedings of a Workshop Held at Hidden Valley, Pennsylvania, June 24-27, 1990, 1990.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
+
+Weipeng Huang, Xingyi Cheng, Kunlong Chen, Taifeng Wang, and Wei Chu. Toward fast and accurate neural chinese word segmentation with multi-criteria learning. arXiv preprint arXiv:1903.04190, 2019.
+
+Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+John Lafferty, Andrew McCallum, and Fernando CN Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. 2001.
+
+Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360, 2016.
+
+Kenton Lee, Luheng He, and Luke Zettlemoyer. Higher-order coreference resolution with coarseto-fine inference. arXiv preprint arXiv:1804.05392, 2018.
+
+Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. A unified mrc framework for named entity recognition. arXiv preprint arXiv:1910.11476, 2019.
+
+Tianyu Liu, Jin-Ge Yao, and Chin-Yew Lin. Towards improving neural named entity recognition with gazetteers. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 5301–5307, 2019a.
+
+Yijin Liu, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. Gcdt: A global context enhanced deep transition architecture for sequence labeling. arXiv preprint arXiv:1906.02437, 2019b.
+
+Yijin Liu, Fandong Meng, Jinchao Zhang, Jie Zhou, Yufeng Chen, and Jinan Xu. Cm-net: A novel collaborative memory network for spoken language understanding. arXiv preprint arXiv:1909.06937, 2019c.
+
+Ying Luo, Fengshun Xiao, and Hai Zhao. Hierarchical contextualized representation for named entity recognition. In AAAI, pp. 8441–8448, 2020.
+
+Ji Ma, Kuzman Ganchev, and David Weiss. State-of-the-art chinese word segmentation with bilstms. arXiv preprint arXiv:1808.06511, 2018.
+
+Xuezhe Ma and Eduard Hovy. End-to-end sequence labeling via bi-directional lstm-cnns-crf. arXiv preprint arXiv:1603.01354, 2016.
+
+Yuxian Meng, Wei Wu, Fei Wang, Xiaoya Li, Ping Nie, Fan Yin, Muyu Li, Qinghong Han, Xiaofei Sun, and Jiwei Li. Glyce: Glyph-vectors for chinese character representations. In Advances in Neural Information Processing Systems, pp. 2746–2757, 2019.
+
+Gregoire Mesnil, Yann Dauphin, Kaisheng Yao, Yoshua Bengio, Li Deng, Dilek Hakkani-Tur, Xi-´ aodong He, Larry Heck, Gokhan Tur, Dong Yu, et al. Using recurrent neural networks for slot filling in spoken language understanding. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 23(3):530–539, 2014.
+
+Joakim Nivre, Marie-Catherine De Marneffe, Filip Ginter, Yoav Goldberg, Jan Hajic, Christopher D Manning, Ryan McDonald, Slav Petrov, Sampo Pyysalo, Natalia Silveira, et al. Universal dependencies v1: A multilingual treebank collection. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC’16), pp. 1659–1666, 2016.
+
+Nanyun Peng et al. Jointly Learning Representations for Low-Resource Information Extraction. PhD thesis, Ph. D. thesis, Johns Hopkins University, 2017.
+
+Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Hwee Tou Ng, Anders Bjorkelund, Olga ¨ Uryupina, Yuchen Zhang, and Zhi Zhong. Towards robust linguistic analysis using ontonotes. In Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pp. 143–152, 2013.
+
+Tao Qian, Yue Zhang, Meishan Zhang, Yafeng Ren, and Donghong Ji. A transition-based model for joint segmentation, pos-tagging and normalization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1837–1846, 2015.
+
+Erik F Sang and Sabine Buchholz. Introduction to the conll-2000 shared task: Chunking. arXiv preprint cs/0009008, 2000.
+
+Erik F Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Languageindependent named entity recognition. arXiv preprint cs/0306050, 2003.
+
+Sunita Sarawagi and William W Cohen. Semi-markov conditional random fields for information extraction. In Advances in neural information processing systems, pp. 1185–1192, 2005.
+
+Sebastian Schuster, Sonal Gupta, Rushin Shah, and Mike Lewis. Cross-lingual transfer learning for multilingual task oriented dialog. arXiv preprint arXiv:1810.13327, 2018.
+
+Yan Shao, Christian Hardmeier, Jorg Tiedemann, and Joakim Nivre. Character-based joint segmen- ¨ tation and pos tagging for chinese using bidirectional rnn-crf. arXiv preprint arXiv:1704.01314, 2017.
+
+Aditya Siddhant, Anuj Goyal, and Angeliki Metallinou. Unsupervised transfer learning for spoken language understanding in intelligent agents. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pp. 4959–4966, 2019.
+
+Mitchell Stern, Jacob Andreas, and Dan Klein. A minimal span-based neural constituency parser. arXiv preprint arXiv:1705.03919, 2017.
+
+Shaolei Wang, Wanxiang Che, Yue Zhang, Meishan Zhang, and Ting Liu. Transition-based disfluency detection using lstms. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2785–2794, 2017.
+
+Wenhui Wang and Baobao Chang. Graph-based dependency parsing with bidirectional lstm. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2306–2315, 2016.
+
+Naiwen Xue, Fei Xia, Fu-Dong Chiou, and Marta Palmer. The penn chinese treebank: Phrase structure annotation of a large corpus. Natural language engineering, 11(2):207, 2005.
+
+Nianwen Xue. Chinese word segmentation as character tagging. In International Journal of Computational Linguistics & Chinese Language Processing, Volume 8, Number 1, February 2003: Special Issue on Word Formation and Chinese Language Processing, pp. 29–48, 2003.
+
+Jie Yang, Yue Zhang, and Fei Dong. Neural word segmentation with rich pretraining. arXiv preprint arXiv:1704.08960, 2017.
+
+Zhi-Xiu Ye and Zhen-Hua Ling. Hybrid semi-markov crf for neural sequence labeling. arXiv preprint arXiv:1805.03838, 2018.
+
+Juntao Yu, Bernd Bohnet, and Massimo Poesio. Named entity recognition as dependency parsing. arXiv preprint arXiv:2005.07150, 2020.
+
+Feifei Zhai, Saloni Potdar, Bing Xiang, and Bowen Zhou. Neural models for sequence chunking. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
+
+Meishan Zhang, Yue Zhang, and Guohong Fu. Transition-based neural word segmentation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 421–431, 2016.
\ No newline at end of file
diff --git a/md/train/Q_64PF6XNut/Q_64PF6XNut.md b/md/train/Q_64PF6XNut/Q_64PF6XNut.md
new file mode 100644
index 0000000000000000000000000000000000000000..15b02a68be8f19547f2a1428623818a6d767c184
--- /dev/null
+++ b/md/train/Q_64PF6XNut/Q_64PF6XNut.md
@@ -0,0 +1,349 @@
+# Stochastic Optimization of Areas Under Precision-Recall Curves with Provable Convergence
+
+Qi Qi †∗, Youzhi Luo‡∗, Zhao $\mathbf { X } \mathbf { u } ^ { \ddag * }$ , Shuiwang $\mathbf { J } \mathbf { i } ^ { \ddag }$ , Tianbao Yang† †Department of Computer Science, The University of Iowa ‡Department of Computer Science & Engineering, Texas A&M University {qi-qi,tianbao-yang} $@$ uiowa.edu, {yzluo,zhaoxu,sji} $@$ tamu.edu
+
+# Abstract
+
+Areas under ROC (AUROC) and precision-recall curves (AUPRC) are common metrics for evaluating classification performance for imbalanced problems. Compared with AUROC, AUPRC is a more appropriate metric for highly imbalanced datasets. While stochastic optimization of AUROC has been studied extensively, principled stochastic optimization of AUPRC has been rarely explored. In this work, we propose a principled technical method to optimize AUPRC for deep learning. Our approach is based on maximizing the averaged precision (AP), which is an unbiased point estimator of AUPRC. We cast the objective into a sum of coupled compositional functions with inner functions dependent on random variables of the outer level. We propose efficient adaptive and non-adaptive stochastic algorithms named SOAP with provable convergence guarantee under mild conditions by leveraging recent advances in stochastic compositional optimization. Extensive experimental results on image and graph datasets demonstrate that our proposed method outperforms prior methods on imbalanced problems in terms of AUPRC. To the best of our knowledge, our work represents the first attempt to optimize AUPRC with provable convergence. The SOAP has been implemented in the libAUC library at https://libauc.org/.
+
+# 1 Introduction
+
+Although deep learning (DL) has achieved tremendous success in various domains, the standard DL methods have reached a plateau as the traditional objective functions in DL are no longer sufficient to model all requirements in new applications, which slows down the democratization of AI. For instance, in healthcare applications, data is often highly imbalanced, e.g., patients suffering from rare diseases are much less than those suffering from common diseases. In these applications, accuracy (the proportion of correctly predicted examples) is deemed as an inappropriate metric for evaluating the performance of a classifier. Instead, area under the curve (AUC), including area under ROC curve (AUROC) and area under the Precision-Recall curve (AUPRC), is widely used for assessing the performance of a model. However, optimizing accuracy on training data does not necessarily lead to a satisfactory solution to maximizing AUC [12].
+
+To break the bottleneck for further advancement, DL must be empowered with the capability of efficiently handling novel objectives such as AUC. Recent studies have demonstrated great success along this direction by maximizing AUROC [60]. For example, Yuan et al. [60] proposed a robust deep AUROC maximization method with provable convergence and achieved great success for classification of medical image data. However, to the best of our knowledge, novel DL by maximizing AUPRC has not yet been studied thoroughly. Previous studies [14, 20] have found that when dealing with highly skewed datasets, Precision-Recall (PR) curves could give a more informative picture of an algorithm’s performance, which entails the development of efficient stochastic optimization algorithms for DL by maximizing AUPRC.
+
+Compared with maximizing AUROC, maximizing AUPRC is more challenging. The challenges for optimization of AUPRC are two-fold. First, the analytical form of AUPRC by definition involves a complicated integral that is not readily estimated from model predictions of training examples. In practice, AUPRC is usually computed based on some point estimators, e.g., trapezoidal estimators and interpolation estimators of empirical curves, non-parametric average precision estimator, and parametric binomial estimator [3]. Among these estimators, non-parametric average precision (AP) is an unbiased estimate in the limit and can be directly computed based on the prediction scores of samples, which lends itself well to the task of model parameters optimization. Second, a surrogate function for AP is highly complicated and non-convex. In particular, an unbiased stochastic gradient is not readily computed, which makes existing stochastic algorithms such as SGD provide no convergence guarantee. Most existing works for maximizing AP-like function focus on how to compute an (approximate) gradient of the objective function [4, 6, 8, 11, 24, 38, 40, 43, 47, 48], which leave stochastic optimization of AP with provable convergence as an open question.
+
+Can we design direct stochastic optimization algorithms both in SGD-style and Adam-style for maximizing AP with provable convergence guarantee?
+
+In this paper, we propose a systematic and principled solution for addressing this question towards maximizing AUPRC for DL. By using a surrogate loss in lieu of the indicator function in the definition of AP, we cast the objective into a sum of non-convex compositional functions, which resembles a two-level stochastic compositional optimization problem studied in the literature [52, 53]. However, different from existing two-level stochastic compositional functions, the inner functions in our problem are dependent on the random variable of the outer level, which requires us developing a tailored stochastic update for computing an error-controlled stochastic gradient estimator. Specifically, a key feature of the proposed method is to maintain and update two scalar quantities associated with each positive example for estimating the stochastic gradient of the individual precision score at the threshold specified by its prediction score. By leveraging recent advances in stochastic compositional optimization, we propose both adaptive (Adam-style) and non-adaptive (SGD-style) algorithms, and establish their convergence under mild conditions. We conduct comprehensive empirical studies on class imbalanced graph and image datasets for learning graph neural networks and deep convolutional neural networks, respectively. We demonstrate that the proposed method can consistently outperform prior approaches in terms of AUPRC. In addition, we show that our method achieves better results when the sample distribution is highly imbalanced between classes and is insensitive to mini-batch size.
+
+# 2 Related Work
+
+AUROC Optimization. AUROC optimization 2 has attracted significant attention in the literature. Recent success of DL by optimizing AUROC on large-scale medical image data has demonstrated the importance of large-scale stochastic optimization algorithms and the necessity of accurate surrogate function [60]. Earlier papers [25, 28] focus on learning a linear model based on the pairwise surrogate loss and could suffer from a high computational cost, which could be as high as quadratic of the size of training data. To address the computational challenge, online and stochastic optimization algorithms have been proposed [18, 35, 42, 58, 63]. Recently, [21, 22, 36, 57] proposed stochastic deep AUC maximization algorithms by formulating the problem as non-convex strongly-concave minmax optimization problem, and derived fast convergence rate under PL condition, and in federated learning setting as well [21]. More recently, Yuan et al. [60] demonstrated the success of their methods on medical image classification tasks, e.g., X-ray image classification, melanoma classification based on skin images. However, an algorithm that maximizes the AUROC might not necessarily maximize AUPRC, which entails the development of efficient algorithms for DL by maximizing AUPRC.
+
+AUPRC Optimization. AUPRC optimization is much more challenging than AUROC optimization since the objective is even not decomposable over pairs of examples. Although AUPRC optimization has been considered in the literature (cf. [15, 47, 41] and references therein), efficient scalable algorithms for DL with provable convergence guarantee is still lacking. Some earlier works tackled this problem by using traditional optimization techniques, e.g., hill climbing search [37], cuttingplane method [61], dynamic programming [50], and by developing acceleration techniques in the framework of SVM [39]. These approaches are not scalable to big data for DL. There is a long list of studies in information retrieval [5, 11, 38, 47] and computer vision [4, 6, 8, 9, 24, 40, 48, 43], which have made efforts towards maximizing the AP score. However, most of them focus on how to compute an approximate gradient of the AP function or its smooth approximation, and provide no convergence guarantee for stochastic optimization based on mini-batch averaging. Due to lack of principled design, these previous methods when applied to deep learning are sensitive to the mini-batch size [6, 47, 48] and usually require a large mini-batch size in order to achieve good performance. In contrast, our stochastic algorithms are designed in a principled way to guarantee convergence without requiring a large mini-batch size as confirmed by our studies as well. Recently, [15] formulates the objective function as a constrained optimization problem using a surrogate function, and then casts it into a min-max saddle-point problem, which facilitates the use of stochastic min-max algorithms. However, they do not provide any convergence analysis for AUPRC maximization. In contrast, this is the first work that directly optimizes a surrogate function of AP (an unbaised estimator of AUPRC in the limit) and provides theoretical convergence guarantee for the proposed stochastic algorithms.
+
+Stochastic Compositional Optimization. Optimization of a two-level compositional function in the form of $\mathbb { E } _ { \xi } [ \bar { f } ( \mathbb { E } _ { \zeta } [ g ( \mathbf { w } ; \zeta ) ] ; \xi ) ]$ where $\xi$ and $\zeta$ are independent random variables, or its finite-sum variant has been studied extensively in the literature [1, 10, 52, 27, 30, 31, 33, 34, 46, 53, 59, 62, 45]. In this paper, we formulate the surrogate function of AP into a similar but more complicated two-level compositional function of the form $\mathbb { E } _ { \xi } [ f ( \mathbb { E } _ { \zeta } g ( { \mathbf w } ; \zeta , \xi ) ) ]$ , where $\xi$ and $\zeta$ are independent and $\xi$ has a finite support. The key difference between our formulated compositional function and the ones considered in previous work is that the inner function $g ( \mathbf { w } ; \zeta , \xi )$ also depends on the random variable $\xi$ of the outer level. Such subtle difference will complicate the algorithm design and the convergence analysis as well. Nevertheless, the proposed algorithm and its convergence analysis are built on previous studies of stochastic two-level compositional optimization.
+
+# 3 The Proposed Method
+
+Notations. We consider binary classification problem. Denote by $\left( \mathbf { x } , y \right)$ a data pair, where $\mathbf { x } \in \mathbb { R } ^ { d }$ denotes the input data and $y \in \{ 1 , - 1 \}$ denotes its class label. Let $h ( \mathbf { x } ) = h _ { \mathbf { w } } ( \mathbf { x } )$ denote the predictive function parameterized by a parameter vector $\mathbf { w } \in \mathbb { R } ^ { D }$ (e.g., a deep neural network). Denote by $\mathbf { I } ( \cdot )$ an indicator function that outputs 1 if the argument is true and zero otherwise. To facilitate the presentation, denote by $X$ a random data, by $Y$ its label and by $F = h ( X )$ its prediction score. Let $\mathcal { D } = \{ ( \mathbf { x } _ { 1 } , y _ { 1 } ) , : . . , ( \mathbf { x } _ { n } , y _ { n } ) \}$ denote the set of all training examples and $\mathbf { \bar { \mathcal { D } } } _ { + } = \{ \mathbf { x } _ { i } : y _ { i } = 1 \}$ denote the set of all positive examples. Let $n _ { + } = | \mathcal { D } _ { + } |$ denote the number of positive examples. $\mathbf { x } _ { i } \sim \mathcal { D }$ means that $\mathbf { x } _ { i }$ is randomly sampled from $\mathcal { D }$ .
+
+# 3.1 Background on AUPRC and its estimator AP
+
+Following the work of Bamber [2], AUPRC is an average of the precision weighted by the probability of a given threshold, which can be expressed as
+
+$$
+A = \int _ { - \infty } ^ { \infty } \dot { \operatorname* { P r } } ( Y = 1 | F \geq c ) d \operatorname* { P r } ( F \leq c | Y = 1 ) ,
+$$
+
+where $\operatorname* { P r } ( Y = 1 | F \geq c )$ is the precision at the threshold value of $c$ . The above integral is an importance-sampled Monte Carlo integral, by which we may interpret AUPRC as the fraction of positive examples among those examples whose output values exceed a randomly selected threshold $c \sim F ( X ) | Y = 1$ .
+
+For a finite set of examples $\mathcal { D } = \{ ( \mathbf { x } _ { i } , y _ { i } ) , i = 1 , \dots , n \}$ with the prediction score for each example $\mathbf { x } _ { i }$ given by $h _ { \mathbf { w } } ( \mathbf { x } _ { i } )$ , we consider to use AP to approximate AUPRC, which is given by
+
+$$
+\mathrm { A P } = \frac { 1 } { n _ { + } } \sum _ { i = 1 } ^ { n } \mathbf { I } ( y _ { i } = 1 ) \frac { \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { \hat { I } } ( y _ { s } = 1 ) \mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) ) } { \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) ) } ,
+$$
+
+where $n _ { + }$ denotes the number of positive examples. It can be shown that AP is an unbiased estimator in the limit $n \to \infty$ [3].
+
+However, the non-continuous indicator function $\mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) )$ in both numerator and denominator in (1) makes the optimization non-tractable. To tackle this, we use a loss function $\ell ( \mathbf { w } ; \mathbf { x } _ { s } , \mathbf { x } _ { i } )$ as a surrogate function of $\mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) )$ . One can consider different surrogate losses, e.g., hinge loss, squared hinge loss, and smoothed hinge loss, and exponential loss. In this paper, we will consider a smooth surrogate loss function to facilitate the development of an optimization algorithm, e.g., a squared hinge loss $\ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) = ( \mathrm { m a x } \{ m - ( h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) - \dot { h } _ { \mathbf { w } } ( \mathbf { x } _ { s } ) ) , 0 \} ) ^ { \dot { 2 } }$ , where $m$ is a margin parameter. Note that we do not require $\ell$ to be a convex function, hence one can also consider non-convex surrogate loss such as ramp loss. As a result, our problem becomes
+
+$$
+\operatorname* { m i n } _ { \mathbf { w } } P ( \mathbf { w } ) = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \frac { - \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { I } ( y _ { s } = \mathrm { 1 } ) \ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) } { \displaystyle \sum _ { s = 1 } ^ { n } \ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) } .
+$$
+
+# 3.2 Stochastic Optimization of AP (SOAP)
+
+We cast the problem into a finite-sum of compositional functions. To this end, let us define a few notations:
+
+$\begin{array} { r l } & { \operatornamewithlimits { m a x } _ { j } \operatorname { m a x } _ { j } , } \\ & { g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) = [ g _ { 1 } ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) , g _ { 2 } ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ] ^ { \top } = [ \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) \mathbf { I } ( y _ { j } = 1 ) , \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ] ^ { \top } } \end{array}$ $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ]$ ,
+
+where $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) : \mathbb { R } ^ { d } \mathbb { R } ^ { 2 }$ . Let $\begin{array} { r } { f ( \mathbf { s } ) = - \frac { s _ { 1 } } { s _ { 2 } } : \mathbb { R } ^ { 2 } \mathbb { R } } \end{array}$ . Then, we can write the objective function for maximizing AP as a sum of compositional functions:
+
+$$
+P ( \mathbf { w } ) = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } ^ { } f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim \mathcal { D } _ { + } } [ f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) ] .
+$$
+
+We refer to the above problem as an instance of two-level stochastic coupled compositional functions. It is similar to the two-level stochastic compositional functions considered in literature [52, 53] but with a subtle difference. The difference is that in our formulation the inner function $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ]$ depends on the random variable $\mathbf { x } _ { i }$ of the outer level. This difference makes the proposed algorithm slightly complicated by estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ separately for each positive example. It also complicates the analysis of the proposed algorithms. Nevertheless, we can still employ the techniques developed for optimizing stochastic compositional functions to design the algorithms and develop the analysis for optimizing the objective (4).
+
+In order to motivate the proposed method, let us consider how to compute the gradient of $P ( \mathbf { w } )$ . Let the gradient of $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ be denoted by $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } = ( \nabla _ { \mathbf { w } } [ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 1 } , \nabla _ { \mathbf { w } } [ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 2 } )$ . Then we have
+
+$$
+\begin{array} { l } { \displaystyle { \boldsymbol { \mathbf { \mathit { v } } } } ) \mathrm { ~ b e ~ d e n o t e d ~ t o y ~ V _ w } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \prime } = ( \nabla _ { \mathbf { w } } | g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) | _ { 1 } , \nabla _ { \mathbf { w } } | g _ { \mathbf { x } _ { i } } ( \mathbf { w } } \\ { { \nabla _ { \mathbf { w } } } P ( \mathbf { w } ) = \displaystyle \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } \nabla f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) } \\ { { \displaystyle ~ = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } \left( \frac { - 1 } { \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 2 } } , \frac { \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 1 } } { \left( \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 2 } \right) ^ { 2 } } \right) ^ { \top } } . } \end{array}
+$$
+
+The major cost for computing $\nabla _ { \mathbf { w } } P ( \mathbf { w } )$ lies at evaluating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ and its gradient $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ , which involves passing through all examples in $\mathcal { D }$ .
+
+To this end, we will approximate these quantities by stochastic samples. The gradient $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ can be simply approximated by the stochastic gradient, i.e.,
+
+$$
+\begin{array} { r } { \hat { \nabla } _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \left( \begin{array} { c } { \frac { 1 } { B } \breve { \sum } _ { \mathbf { x } _ { j } \in B } \mathbf { I } ( y _ { j } = 1 ) \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } \\ { \frac { 1 } { B } \sum _ { \mathbf { x } _ { j } \in B } \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } \end{array} \right) , } \end{array}
+$$
+
+where $\boldsymbol { B }$ denote a set of $B$ random samples from $\mathcal { D }$ . For estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )$ , however, we need to ensure its approximation error is controllable due to the compositional structure such that the convergence can be guaranteed. We borrow a technique from the literature of stochastic compositional optimization [52] by using moving average estimator for estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ for all positive examples. To this end, we will maintain a matrix $\mathbf { u } = [ \mathbf { u } ^ { 1 } , \mathbf { u } ^ { 2 } ]$ with each column indexable by any positive example, i.e., $\mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } , \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 }$ correspond to the moving average estimator of $[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 1 }$ and $[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 2 }$ , respectively. The matrix $\mathbf { u }$ is updated by the subroutine UG in Algorithm 2, where $\gamma \in ( 0 , 1 )$ is a parameter. It is notable that in Step 3 of Algorithm 2, we clip the moving average update of $\mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 }$ by a lower bound $u _ { 0 }$ , which is a given parameter. This step can ensure the division in computing the stochastic gradient estimator in (7) always valid and is also important for convergence
+
+# Algorithm 1: SOAP
+
+1: Input: $\gamma , \alpha , u _ { 0 }$ , and other parameters for SGD-stype update or Adam-stype update.
+2: Initialize w1 ∈ Rd, u ∈ R|n+|×2
+3: for $t = 1 , \dots , T$ do
+4: Draw a batch of $B _ { + }$ positive samples denoted by $B _ { + }$ .
+5: Draw a batch of $B$ samples denoted by $\boldsymbol { B }$ .
+6: ${ \bf u } = { \bf U } { \bf G } ( B , B _ { + } , { \bf u } , { \bf w } _ { t } , \gamma , u _ { 0 } )$
+7: Compute (biased) Stochastic Gradient Estimator
+
+$$
+G ( \mathbf { w } _ { t } ) = \frac { 1 } { B _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { B } _ { + } } \sum _ { \mathbf { x } _ { j } \in B } \frac { ( \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } - \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } \mathbf { I } ( \mathbf { y } _ { j } = 1 ) ) \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } { B ( \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } ) ^ { 2 } }
+$$
+
+8: Update $\mathbf { w } _ { t + 1 }$ by a SGD-style method or by a Adam-style method
+
+$$
+\mathbf { w } _ { t + 1 } = \mathbf { U } \mathbf { W } ( \mathbf { w } _ { t } , G ( \mathbf { w } _ { t } ) )
+$$
+
+9: end for
+10: Return: last solution.
+
+analysis. With these stochastic estimators, we can compute an estimate of $\nabla P ( \mathbf { w } )$ by equation (7), where $B _ { + }$ includes a batch of sampled positive data. With this stochastic gradient estimator, we can employ SGD-style method and Adam-style shown in Algorithm 3 to update the model parameter w. The final algorithm named as SOAP is presented in Algorithm 1.
+
+$$
+\overline { { \mathrm { A l g o r i t h m ~ 2 : ~ U G } ( \mathcal { B } , \mathcal { B } _ { + } , \mathbf { u } , \mathbf { w } _ { t } , \gamma , u _ { 0 } ) } }
+$$
+
+$$
+\overline { { \mathbf { A l g o r i t h m 3 : U W } ( \mathbf { w } _ { t } , G ( \mathbf { w } _ { t } ) ) } }
+$$
+
+1: for each positive $\mathbf { x } _ { i } \in B _ { + }$ do
+
+$$
+[ \overset { \mathbf { \hat { g } } } { \mathbf { x } } _ { i } ( \mathbf { w } _ { t } ) ] _ { 1 } = \frac { 1 } { | \mathcal { B } | } \sum _ { \underset { y _ { j } = 1 } { x _ { j } \in \mathcal { B } } } \ell ( \mathbf { w } _ { t } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )
+$$
+
+$$
+\mathbf { w } _ { t + 1 } = \mathbf { w } _ { t } - \alpha G ( \mathbf { w } _ { t } )
+$$
+
+$$
+[ \tilde { g } _ { { \bf x } _ { i } } ( { \bf w } _ { t } ) ] _ { 2 } = \frac { 1 } { | B | } \sum _ { { \bf x } _ { j } \in B } \ell ( { \bf w } _ { t } ; { \bf x } _ { j } , { \bf x } _ { i } )
+$$
+
+$$
+\begin{array} { r l } & { \mathbf { \tau } , \epsilon , \eta _ { 1 } , \eta _ { 2 } ) } \\ & { \quad h _ { t + 1 } = \eta _ { 1 } h _ { t } + ( 1 - \eta _ { 1 } ) G ( \mathbf { w } _ { t } ) } \\ & { \quad v _ { t + 1 } = \eta _ { 2 } \hat { v } _ { t } + ( 1 - \eta _ { 2 } ) ( G ( \mathbf { w } _ { t } ) ) ^ { 2 } } \\ & { \quad \mathbf { w } _ { t + 1 } = \mathbf { w } _ { t } - \alpha \frac { h _ { t + 1 } } { \sqrt { \epsilon + \hat { v } _ { t + 1 } } } } \end{array}
+$$
+
+# 3: Compute
+
+$$
+\begin{array} { r l } & { \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } = ( 1 - \gamma ) \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } + \gamma [ \tilde { g } _ { \mathbf { x } _ { i } } ( \mathbf { w } _ { t } ) ] _ { 1 } } \\ & { \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } = \operatorname* { m a x } ( ( 1 - \gamma ) \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } + \gamma [ \tilde { g } _ { \mathbf { x } _ { i } } ( \mathbf { w } _ { t } ) ] _ { 2 } , u _ { 0 } ) } \end{array}
+$$
+
+4: end for
+5: Return u
+
+# 3.3 Convergence Analysis
+
+In this subsection, we present the convergence results of SOAP and also highlight its convergence analysis. To this end, we first present the following assumption.
+
+Assumption 1. Assume that (a) there exists $\Delta _ { 1 }$ such that $P ( \mathbf { w } _ { 1 } ) - \operatorname* { m i n } _ { \mathbf { w } } P ( \mathbf { w } ) \leq \Delta _ { 1 }$ ; $( b )$ there exist $C , M > 0$ such that $\ell ( \mathbf { w } ; \mathbf { x } _ { i } , \mathbf { x } _ { i } ) \geq C$ for any $\mathbf { x } _ { i } \in \mathcal { D } _ { + }$ , $\ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) \le M$ , and $\ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )$ is Lipscthiz continuous and smooth with respect to w for any $\mathbf { x } _ { i } \in \mathcal { D } _ { + } , \mathbf { x } _ { j } \in \mathcal { D } ,$ ; (c) there exists $V > 0$ such that $\begin{array} { r } { \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ \| g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) - g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \| ^ { 2 } ] \leq V } \end{array}$ , and $\begin{array} { r } { \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ \| \nabla g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) - \nabla g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \| ^ { 2 } ] \leq V } \end{array}$ for any $\mathbf { x } _ { i }$ .
+
+With a bounded score function $h _ { \mathbf { w } } ( \mathbf { x } )$ the above assumption can be easily satisfied. Based on the above assumption, we can prove that the objective function $P ( \mathbf { w } )$ is smooth.
+
+Lemma 1. Suppose Assumption $^ { l }$ holds, then there exists $L > 0$ such that $P ( \cdot )$ is $L$ -smooth. In addition, there exists $u _ { 0 } \geq C / n$ such that gxi(w $\begin{array} { r } { v ) \in \Omega = \{ \mathbf { u } \in \mathbb { R } ^ { 2 } , 0 \leq [ \mathbf { u } ] _ { 1 } \leq M , u _ { 0 } \leq [ \mathbf { u } ] _ { 2 } \leq } \end{array}$ $M \}$ , $\forall \mathbf { x } _ { i } \in \mathcal { D } _ { + }$ .
+
+Next, we highlight the convergence analysis of SOAP employing the SGD-stype update and include that for employing Adam-style update in the supplement. Without loss of generality, we assume $| \boldsymbol { B } _ { + } | = 1$ and the positive sample in $B _ { + }$ is randomly selected from $\mathcal { D } _ { + }$ with replacement. When the context is clear, we abuse the notations $g _ { i } ( \mathbf { w } )$ and $\mathbf { u } _ { i }$ to denote $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ and $\mathbf { u } _ { \mathbf { x } _ { i } }$ below, respectively. We first establish the following lemma following the analysis of non-convex optimization.
+
+Lemma 2. With $\alpha \leq 1 / 2$ , running $T$ iterations of $S O A P$ (SGD-style) updates, we have $\frac { \alpha } { 2 } \mathbb { E } [ \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } ] \leq \mathbb { E } [ \sum _ { t } ( P ( \mathbf { w } _ { t } ) - P ( \mathbf { w } _ { t + 1 } ) ) ] + \frac { \alpha C _ { 1 } } { 2 } \mathbb { E } [ \sum _ { t = 1 } ^ { T } \| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 } ] + \alpha ^ { 2 } T C _ { 2 } ,$ where $i _ { t }$ denotes the index of the sampled positive data at iteration $t$ , $C _ { 1 }$ and $C _ { 2 }$ are proper constants.
+
+Our key contribution is the following lemma that bounds the second term in the above upper bound.
+
+Lemma 3. Suppose Assumption 1 holds, with u initialized by (6) for every $\mathbf { x } _ { i } \in \mathcal { D } _ { + }$ we have
+
+$$
+\mathbb { E } [ \sum _ { t = 1 } ^ { T } \| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 } ] \leq \frac { n _ { + } V } { \gamma } + \gamma V T + 2 \frac { n _ { + } ^ { 2 } \alpha ^ { 2 } T C _ { 3 } } { \gamma ^ { 2 } } ,
+$$
+
+where $C _ { 3 }$ is a proper constant.
+
+Remark: The innovation of proving the above lemma is by grouping $\mathbf { u } _ { i _ { t } } , t = 1 , \dots , T$ into $n _ { + }$ groups corresponding to the $n _ { + }$ positive examples, and then establishing the recursion of the error $\| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 }$ within each group, and then summing up these recursions together.
+
+Based on the two lemmas above, we establish the following convergence of SOAP with a SGD-style update.
+
+Theorem 1. Suppose Assumption 1 holds, let the parameters be $\begin{array} { r } { \alpha = \frac { 1 } { n _ { + } ^ { 2 / 5 } T ^ { 3 / 5 } } , \gamma = \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } } \end{array}$ , $\forall t \in$ $1 , \cdots , T _ { \mathrm { { \scriptsize ~ 2 } } }$ , and $T > n _ { + }$ . Then after running $T$ iterations, SOAP with a $S G D$ -style update satisfies $\begin{array} { r } { \mathbb { E } \left[ \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } \right] \leq O ( \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } ) } \end{array}$ $O$
+
+Remark: To the best of our knowledge, this is the first time a stochastic algorithm was proved to converge for AP maximization.
+
+Similarly, we can establish the following convergence of SOAP by employing an Adam-style update, specifically the AMSGrad update.
+
+Theorem 2. Suppose Assumption $^ { l }$ holds, let the parameters $\eta _ { 1 } \leq \sqrt { \eta _ { 2 } } \leq 1$ , $\begin{array} { r } { \alpha = \frac { 1 } { n _ { + } ^ { 2 / 5 } T ^ { 3 / 5 } } , \gamma = } \end{array}$ n2/5+ $\frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } }$ , $\forall t \in 1 , \cdots , T$ , and $T > n _ { + }$ . Then after running $T$ iterations, SOAP with an AMSGRAD update satisfies $\widehat { \sf z } \left[ \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } \right] \leq O ( \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } )$ , where $O$ suppresses constant numbers.
+
+# 4 Experiments
+
+In this section, we evaluate the proposed method through comprehensive experiments on imbalanced datasets. We show that the proposed method can outperform prior state-of-the-art methods for imbalanced classification problems. In addition, we conduct experiments on (i) the effects of imbalance ratio; (ii) the insensitivity to batch size and (iii) the convergence speed on testing data; and observe that our method (i) is more advantageous when data is more imbalanced, (ii) is not sensitive to batch size, and (iii) converges faster than baseline methods.
+
+Our proposed optimization algorithm is independent of specific datasets and tasks. Therefore, we perform experiments on both graph and image prediction tasks. In particular, the graph prediction tasks in the contexts of molecular property prediction and drug discovery suffer from very severe imbalance problems as positive labels are very rare while negative samples are abundantly available. Thus, we choose to use graph data intensively in our experiments. Additionally, the graph data we use allow us to vary the imbalance ratio to observe the performance change of different methods.
+
+In all experiments, we compare our method with the following baseline methods. CB-CE refers to a method using a class-balanced weighed cross entropy loss function, in which the weights for positive and negative samples are adjusted with the strategy proposed by Cui et al. [13]. Focal is to up-weight the penalty on hard examples using focal loss [32]. LDAM refers to training with labeldistribution-aware margin loss [7]. AUC-M is an AUROC maximization method using a surrogate loss [60]. In addition, we compare with three methods for optimizing AUPRC or AP, namely, the MinMax method [15] - a method for optimizing a discrete approximation of AUPRC, SmoothAP [4] - a method that optimizes a smoothed approximation of AP, and FastAP - a method that uses soft histogram binning to approximate the gradient of AP [6]. For all of these methods, we use the
+
+Table 1: The test AUPRC on the image datasets with two ResNet models. We report the average AUPRC and standard deviation (within brackets) over 5 runs.
+
+
Datasets
CIFAR-10
CIFAR-100
Networks
ResNet18
ResNet34
ResNet18
ResNet34
CE
0.7155 (± 0.0058)
0.6844(± 0.0031)
0.5946 (± 0.0031)
0.5792 (± 0.0028)
CB-CE
0.7325 (± 0.0039)
0.6936(±0.0021)
0.6165 (± 0.0096)
0.5632(± 0.0129)
Focal
0.7183(± 0.0082)
0.6943(± 0.0007)
0.6107(± 0.0093)
0.5585(± 0.0285)
LDAM
0.7346 (± 0.0125)
0.6745(± 0.0043)
0.6153 (± 0.0100)
0.5662(± 0.0212)
AUC-M
0.7399(± 0.0013)
0.6825(± 0.0089)
0.6103 (± 0.0075)
0.5306(± 0.0230)
SmoothAP
0.7365 (± 0.0088)
0.6909 (± 0.0049)
0.6071(± 0.0143)
0.5208 (± 0.0505)
FastAP
0.7028 (± 0.0341)
0.6798 (± 0.0032)
0.5618(± 0.0351)
0.5151(± 0.0450)
MinMax
0.7228 (± 0.0118)
0.6806(± 0.0027)
0.6071(± 0.0064)
0.5518(± 0.0030)
SOAP
0.7629(± 0.0014)
0.7012(± 0.0056)
0.6251 (± 0.0053)
0.6001(± 0.0060)
+
+SGD-style with momentum optimization for image prediction tasks and the Adam-style optimization algorithms for graph prediction tasks and unless specified otherwise. We refer to imbalance ratio as the number of positive samples over the total number of examples of a considered set. The hyper-parameters of all methods are fine tuned using cross-validation with training/validation splits mentioned below. For AP maximization methods, we use a sigmoid function to produce the prediction score. For simplicity, we set $u _ { 0 } = 0$ for SOAP and encounter no numerical problems in experiments. As SOAP requires positive samples for updating u to approximate the gradient of surrogate objective, we use a data sampler which samples a few positive examples (e.g., 2) and some negative examples per iteration. The same sampler applies to all methods for fair comparison. The code for reproducing the results is released here [44].
+
+# 4.1 Image Classification
+
+Data. We first conduct experiments on three image datasets: CIFAR10, CIFAR100 and Melanoma dataset [49]. We construct imbalanced version of CIFAR10 and CIFAR100 for binary classification. In particular, for each dataset we manually take the last half of classes as positive class and first half of classes as negative class. To construct highly imbalanced data, we remove $98 \%$ of the positive images from the training data and keep the test data unchanged (i.e., the testing data is still balanced). And we split the training dataset into train/validation set at $80 \% / 2 0 \%$ ratio. The Melanoma dataset is from a medical image Kaggle competition, which serves as a natural real imbalanced image dataset. It contains 33,126 labeled medical images, among which 584 images are related to malignant melanoma and labelled as positive samples. Since the test set used by Kaggle organization is not available, we manually split the training data into train/validation/test set at $8 0 \% / 1 0 \% / 1 0 \%$ ratio and report the achieved AUPRC on the test set by our method and baselines. The images of Melanoma dataset are always resized to have a resolution of $3 8 4 \times 3 8 4$ in our experiments.
+
+Setup. We use two ResNet [23] models, i.e., ResNet18 and ResNet34, as the backbone networks for image classification. For all methods except for CE, the ResNet models are initialized with a model pre-trained by CE with a SGD optimizer. We tune the learning rate in a range $\{ 1 \mathrm { e } \mathrm { - } 5 $ , 1e-4, 1e-3, 1e-2} and the weight decay parameter in a range $\{ 1 \mathrm { e } { - } 6 , 1 \mathrm { e } { - } 5 , 1 \mathrm { e } { - } 4 \}$ . Then the last fully connected layer is randomly re-initialized and the network is trained by different methods with the same weight decay parameter but other hyper-parameters individually tuned for fair comparison, e.g., we tune $\gamma$ of SOAP in a range $\{ 0 . 9 , 0 . 9 9 , 0 . 9 9 9 \}$ , and tune $m$ in $\{ 0 . 5 , 1 , 2 , 5 , 1 0 \}$ . We refer to this scheme as two-stage training, which is widely used for imbalanced data [60]. We consistently observe that this strategy can bring the model to a good initialization state and improve the final performance of our method and baselines.
+
+Results. Table 1 shows the AUPRC on testing sets of CIFAR-10 and CIFAR-100. We report the results on Melanoma in Table 3. We can observe that the proposed method SOAP outperforms all baselines. It is also striking to see that on Melanoma dataset, our proposed SOAP can outperform all baselines by a large margin, and all other methods have very poor performance. The reason is that the testing set of Melanoma is also imbalanced (imbalanced ratio $\mathrm { \Omega } = 1 . 7 2 \%$ ), while the testing sets of CIFAR-10 and CIFAR-100 are balanced. We also observe that the AUROC maximization (AUC-M) does not necessarily optimize AUPRC. We also plot the final PR curves in Figure 3 in the supplement.
+
+Table 2: The test AUPRC values on the HIV and MUV datasets with three graph neural network models. We report the average AUPRC and standard deviation (within brackets) over 3 runs.
+
+
Dataset
Method
GINE
MPNN
ML-MPNN
HIV
CE CB-CE
0.2774 (± 0.0101) 0.3082 (± 0.0101)
0.3197 (± 0.0050) 0.3056 (± 0.0018)
0.2988 (± 0.0076) 0.3291 (± 0.0189)
Focal
0.3136 (± 0.0197)
0.3279 (± 0.0173)
LDAM
0.3179 (± 0.0068)
AUC-M
0.2904 (± 0.0008)
0.2994 (± 0.0128)
0.3044 (± 0.0116)
SmothAP
0.2998 (± 0.0010)
0.2786 (± 0.0456)
0.3305 (± 0.0165)
FastAP
0.2686 (± 0.0007)
0.3276 (± 0.0063)
0.3235 (± 0.0092)
MinMax
0.0169 (± 0.0031) 0.2874(± 0.0073)
0.0826 (± 0.0112) 0.3119 (± 0.0075)
0.0202 (± 0.0002) 0.3098 (± 0.0167)
SOAP
0.3385 (± 0.0024)
0.3401 (± 0.0045)
0.3547 (± 0.0077)
CE
0.0017 (±0.0001)
0.0021 (±0.0002)
0.0025 (±0.0004)
CB-CE
0.0055 (±0.0011)
0.0483 (±0.0083)
0.0121 (±0.0016)
Focal
0.0041 (±0.0007)
0.0281 (±0.0141)
0.0122 (±0.0001)
MUV
LDAM
0.0044(±0.0022)
0.0118 (±0.0098)
0.0059 (±0.0021)
AUC-M
0.0026 (±0.0001)
0.0040 (±0.0012)
0.0028 (±0.0012)
SmoothAP
0.0073 (±0.0012)
0.0068(±0.0038)
0.0029 (±0.0005)
FastAP
0.0016 (±0.0000)
0.0023 (±0.0021)
0.0022 (±0.0012)
MinMax
0.0028 (±0.0008)
0.0027 (±0.0005)
0.0043 (±0.0015)
SOAP
0.0254 (±0.0261)
0.3352 (±0.0008)
0.0236 (±0.0038)
+
+# 4.2 Graph Classification for Molecular Property Prediction
+
+Data. To further demonstrate the advantages of our method, we conduct experiments on two graph classification datasets. We use the datasets HIV and MUV from the MoleculeNet [55], which is a benchmark for molecular property prediction. The HIV dataset has 41,913 molecules from the Drug Therapeutics Program (DTP), and the positive samples are molecules tested to have inhibition ability to HIV. The MUV dataset has 93,127 molecules from the PubChem library, and molecules are labelled by whether a bioassay property exists or not. Note that the MUV dataset provides labels of 17 properties in total and we only conduct experiments to predict the third property as this property is more imbalanced. The percentage of positive samples in HIV and MUV datasets are $3 . 5 1 \%$ and $0 . 2 0 \%$ , respectively. We use the split of train/validation/test set provided by MoleculeNet. Molecules are treated as 2D graphs in our experiments, and we use the feature extraction procedure of MoleculeKit [54] to obtain node features of graphs. The same data preprocessing is used for all of our experiments on graph data.
+
+Setup. Many recent studies have shown that graph neural networks (GNNs) are powerful models for graph data analysis [29, 17, 16]. Hence, we use three different GNNs as the backbone network for graph classification, including the message passing neural network (MPNN) [19], an invariant of graph isomorphism network [56] named by GINE [26], and the multi-level message passing neural network (ML-MPNN) proposed by Wang et al. [54]. We use the same two-stage training scheme with a similar hyper-parameter tuning. We pre-train the networks by Adam with 100 epochs and a tuned initial learning rate 0.0005, which is decayed by half after 50 epochs.
+
+Results. The achieved AUPRC on the test set by all methods are presented in Table 2. Results show that our method can outperform all baselines by a large margin in terms of AUPRC, regardless of which model structure is used. These results clearly demonstrate that our method is effective for classification problems in which the sample distribution is highly imbalanced between classes.
+
+# 4.3 Graph Classification for Drug Discovery
+
+Data. In addition to molecular property prediction, we explore applying our method to drug discovery. Recent studies have shown that GNNs are effective in drug discovery through predicting the antibacterial property of chemical compounds [51]. Such application scenarios involves training a GNN model on labeled datasets and making predictions on a large library of chemical compounds so as to discover new antibiotic. However, because the positive samples in the training data, i.e., compounds known to have antibacterial property, are very rare, there exists very severe class imbalance.
+
+We show that our method can serve as a useful solution to the above problem. We conduct experiments on the MIT AICURES dataset from an open challenge (https://www.aicures.mit.edu/tasks)
+
+Table 3: The test AUPRC values on the MIT AICURES dataset with two graph neural networks, and on the Kaggle Melanoma dataset with two CNN models. We report the average AUPRC and standard deviation (within brackets) from 3 independent runs over 3 different train/validation/test splits.
+
+
Data
MITAICURES
Kaggle Melanoma
Networks
GINE
MPNN
ResNet18
ResNet34
CE
0.5037 (± 0.0718)
0.6282 (± 0.0634)
0.0701 (± 0.0031)
0.0582 (± 0.0016)
CB-CE
0.5655 (± 0.0453)
0.6308 (± 0.0263)
0.0631 (± 0.0065)
0.0721 (± 0.0054)
Focal
0.5143 (± 0.1062)
0.5875 (± 0.0774)
0.0549 (± 0.0083)
0.0663 (± 0.0034)
LDAM
0.5236 (± 0.0551)
0.6489 (± 0.0556)
0.0547 (± 0.0046)
0.0539 (± 0.0069)
AUC-M
0.5149 (± 0.0748)
0.5542 (± 0.0474)
0.1013 (± 0.0071)
0.0972 (± 0.0035)
SmothAP
0.2899 (± 0.0220)
0.4081 (± 0.0352)
0.1981 (± 0.0527)
0.2787 (± 0.0232)
FastAP
0.4777 (± 0.0896)
0.4518 (± 0.1495)
0.0324 (± 0.0087)
0.0359 (± 0.0062)
MinMax
0.5292 (± 0.0330)
0.5774 (± 0.0468)
0.0593 (± 0.0037)
0.0663 (± 0.0084)
SOAP
0.6639 (± 0.0515)
0.6547 (± 0.0616)
0.2624 (± 0.0410)
0.3152 (± 0.0337)
+
+
+Figure 1: Comparison of convergence of different methods in terms of test AUPRC scores on CIFAR-10, CIFAR100 and MIT AICURES data.
+
+in drug discovery. The dataset consists of 2097 molecules. There are 48 positive samples that have antibacterial activity to Pseudomonas aeruginosa, which is the pathogen leading to secondary lungs infections of COVID-19 patients. We conduct experiments on three random train/validation/test splits at $8 0 \% / 1 0 \% / 1 0 \%$ ratio, and report the average AUPRC on the test set over three splits.
+
+Setup. Following the setup in Sec. 4.2, we use three GNNs: MPNN, GINE and ML-MPNN. We use the same two-stage training scheme with a similar hyper-parameter tuning. We pre-train GNNs by the Adam method for 100 epochs with a batch size of 64 and a tuned learning rate of 0.0005, which is decayed by half at the 50th epoch. Due to the limit of space, Table 3 only reports GINE and MPNN results. Please refer to Table 6 in the supplement for the full results of all three GNNs.
+
+Results. The average test AUPRC from three independent runs over three splits are summarized in Table 3, Table 6. We can see that our SOAP can consistently outperform all baselines on all three GNN models. Our proposed optimization method can significantly improve the achieved AUPRC of GNN models, indicating that models tend to assign higher confidence scores to molecules with antibacterial activity. This can help identify a larger number of candidate drugs.
+
+We have employed the proposed AUPRC maximization method for improving the testing performance on MIT AICures Challenge and achieved the 1st place. For details, please refer to [54].
+
+# 4.4 Ablation Studies
+
+Effects of Imbalance Ratio. We now study the effects of imbalance ratio on the performance improvements of our method. We use two datasets Tox21 and ToxCast from the MoleculeNet [55]. The Tox21 and ToxCast contain 8014 and 8589 molecules, respectively. There are 12 property prediction tasks in Tox21, and we conduct experiments on Task 0 and Task 2. Similarly, we select Task 12 and Task 8 of ToxCast for experiments. We use the split of train/validation/test set provided by MoleculeNet. The imbalanced ratios on the training sets are $4 . 1 4 \%$ for Task 0 of Tox21, $1 2 . 0 0 \%$ for Task 2 of Tox21, $2 . 9 7 \%$ for Task 12 of ToxCast, $8 . 6 7 \%$ for Task 8 of ToxCast.
+
+Following Sec. 4.2, we test three neural network models MPNN, GINE and ML-MPNN. The hyperparameters for training models are also the same as those in Sec. 4.2. We present the results of Tox21 and ToxCast in Table 5 in the supplement. Our SOAP can consistently achieve improved performance when the data is extremely imbalanced. However, it sometimes fails to do so if the imbalance ratio is not too low. Clearly, the improvements from our method are higher when the imbalance ratio of labels is lower. In other words, our method is more advantageous for data with extreme class imbalance.
+
+
+Figure 2: Left most: insensitivity to batch size of SOAP. Right two: consistency between AP and Surrogate Objective $\mathbf { \nabla } _ { - } P ( \mathbf { w } )$ vs Iterations on CIFAR10 and CIFAR100.
+
+Table 4: The test AUPRC over 3 independent runs by SOAP with different surrogate functions.
+
+
Data
CIFAR10
CIFAR100
Networks
ResNet18
ResNet34
ResNet18
ResNet34
Squared Hinge
0.7629 (±0.0014)
0.7012 (±0.0056)
0.6251 (±0.0053)
0.6001(±0.0060)
Logistic
0.7542 (±0.0024)
0.6968 (±0.0121)
0.6378 (±0.0031)
0.5923 (±0.0101)
Sigmoid
0.7652 (±0.0035)
0.6983 (±0.0084)
0.6271 (±0.0043)
0.5832 (±0.0054)
Data
HIV
MUV
Networks
GINE
MPNN
GINE
MPNN
Squared Hinge
0.3485(±0.0083)
0.3401(±0.0045)
0.0354(±0.0025)
0.3365 (±0.0008)
Logistic
0.3436 (±0.0043)
0.3617 (±0.0031)
0.0493 (±0.0261)
0.3352 (±0.0008)
Sigmoid
0.3387 (±0.0051)
0.3629 (±0.0063)
0.0298 (±0.0043)
0.3362 (±0.0009)
+
+Insensitivity to Batch Size. We conduct experiments on CIFAR-10 and CIFAR-100 data by varying the mini-batch size for the SOAP algorithm and report results in Figure 2 (Left most). We can see that SOAP is not sensitive to the mini-batch size. This is consistent with our theory. In contrast, many previous methods for AP maximization are sensitive to the mini-batch size [47, 48, 6].
+
+Convergence Speed. We report the convergence curves of different methods for maximizing AUPRC or AP in Figure 1 on different datasets. We can see that the proposed SOAP algorithms converge much faster than other baseline methods.
+
+More Surrogate Losses. To verify the generality of SOAP, we evaluate the performance of SOAP with two more different surrogate loss functions $\ell ( \mathbf { w } ; \mathbf { x } _ { s } , \mathbf { x } _ { i } )$ as a surrogate function of the indicator I(hw(xs) ≥ hw(xi)), namely, the logistic loss, \`(w; xs, xi) = − log 11+exp(−c(\`(hw(xi)−hw(xs))) , and the sigmoid loss, \`(w; xs, xi) = 11+exp(c(\`(hw(xi)−hw(xs))) where $c$ is a hyperparameter. We tune $c \in \{ 1 , 2 \}$ in our experiments. We conduct experiments on CIFAR10, CIFAR100 following the experimental setting in Section 4.1 for the image data. For the graph data, we conduct experiments on HIV, MUV data following the experimental setting in Section 4.2. We report the results in Table 4. We can observe that SOAP has similar results with different surrogate loss functions.
+
+Consistency. Finally, we show the consistency between the Surrogate Objective - $\mathbf { \nabla } \cdot P ( \mathbf { w } )$ and AP by plotting the convergence curves on different datasets in Figure 2 (Right two). It is obvious two see the consistency between our surrogate objective and the true AP.
+
+# 5 Conclusions and Outlook
+
+In this work, we have proposed a stochastic method to optimize AUPRC that can be used in deep learning for tackling highly imbalanced data. Our approach is based on maximizing the averaged precision, and we cast the objective into a sum of coupled compositional functions. We proposed efficient adaptive and non-adaptive stochastic algorithms with provable convergence guarantee to compute the solutions. Extensive experimental results on graph and image datasets demonstrate that our proposed method can achieve promising results, especially when the class distribution is highly imbalanced. One limitation of SOAP is its convergence rate is still slow. In the future, we will consider to improve the convergence rate to address the limitation of the present work.
+
+# Acknowledgments
+
+We thank Bokun Wang for discussing the proofs, and thank anonymous reviewers for constructive comments. Q.Q contributed to the algorithm design, analysis, and experiments under supervision of T.Y. Y.L and Z.X contributed to the experiments under supervision of S.J. Q.Q and T.Y were partially supported by NSF Career Award #1844403, NSF Award #2110545 and NSF Award #1933212. Y.L, Z.X and S.J were partially supported by NSF IIS-1955189.
+
+# References
+
+[1] Balasubramanian, K., Ghadimi, S., and Nguyen, A. Stochastic multi-level composition optimization algorithms with level-independent convergence rates. CoRR, abs/2008.10526, 2020.
+[2] Bamber, D. The area above the ordinal dominance graph and the area below the receiver operating characteristic graph. Journal of Mathematical Psychology, 12:387–415, 1975.
+[3] Boyd, K., Eng, K. H., and Page, C. D. Area under the precision-recall curve: Point estimates and confidence intervals. In Blockeel, H., Kersting, K., Nijssen, S., and Zelezny, F. (eds.), Machine Learning and Knowledge Discovery in Databases, pp. 451–466, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.
+[4] Brown, A., Xie, W., Kalogeiton, V., and Zisserman, A. Smooth-ap: Smoothing the path towards large-scale image retrieval. In European Conference on Computer Vision, pp. 677–694. Springer, 2020.
+[5] Burges, C., Ragno, R., and Le, Q. Learning to rank with nonsmooth cost functions. In Schölkopf, B., Platt, J., and Hoffman, T. (eds.), Advances in Neural Information Processing Systems, volume 19. MIT Press, 2007.
+[6] Cakir, F., He, K., Xia, X., Kulis, B., and Sclaroff, S. Deep metric learning to rank. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
+[7] Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, pp. 1567–1578, 2019.
+[8] Chen, K., Li, J., Lin, W., See, J., Wang, J., Duan, L., Chen, Z., He, C., and Zou, J. Towards accurate one-stage object detection with ap-loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
+[9] Chen, K., Lin, W., See, J., Wang, J., Zou, J., et al. Ap-loss for accurate one-stage object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
+[10] Chen, T., Sun, Y., and Yin, W. Solving stochastic compositional optimization is nearly as easy as solving stochastic optimization. IEEE Transactions on Signal Processing, 69:4937–4948, 2021.
+[11] Chen, W., Liu, T.-Y., Lan, Y., Ma, Z., and Li, H. Ranking measures and loss functions in learning to rank. In Proceedings of the 22nd International Conference on Neural Information Processing Systems, NIPS’09, pp. 315–323, Red Hook, NY, USA, 2009. Curran Associates Inc. ISBN 9781615679119.
+[12] Cortes, C. and Mohri, M. Auc optimization vs. error rate minimization. In Thrun, S., Saul, L. K., and Schölkopf, B. (eds.), Advances in Neural Information Processing Systems 16, pp. 313–320. 2004.
+[13] Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9268–9277, 2019.
+
+[14] Davis, J. and Goadrich, M. The Relationship Between Precision-Recall and ROC Curves. In ICML ’06: Proceedings of the 23rd international conference on Machine learning, pp. 233–240, New York, NY, USA, 2006. ACM. ISBN 1-59593-383-2.
+
+[15] Eban, E., Schain, M., Mackey, A., Gordon, A., Saurous, R. A., and Elidan, G. Scalable learning of non-decomposable objectives. In International Conference on Arti cial Intelligence and Statistics (AISTATS), 2017.
+
+[16] Gao, H. and Ji, S. Graph u-nets. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2083–2092. PMLR, 09–15 Jun 2019.
+
+[17] Gao, H., Wang, Z., and Ji, S. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’18, pp. 1416–1424, New York, NY, USA, 2018. Association for Computing Machinery.
+
+[18] Gao, W., Jin, R., Zhu, S., and Zhou, Z.-H. One-pass auc optimization. In ICML (3), pp. 906–914, 2013.
+
+[19] Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., and Dahl, G. E. Neural message passing for quantum chemistry. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1263–1272, International Convention Centre, Sydney, Australia, 2017.
+
+[20] Goadrich, M., Oliphant, L., and Shavlik, J. Gleaner: Creating ensembles of firstorder clauses to improve recall-precision curves. In Machine Learning, pp. 2006, 2006.
+
+[21] Guo, Z., Liu, M., Yuan, Z., Shen, L., Liu, W., and Yang, T. Communication-efficient distributed stochastic auc maximization with deep neural networks. In Proceedings of the 37th International Conference on Machine Learning (ICML), pp. 3864–3874, 2020.
+
+[22] Guo, Z., Yuan, Z., Yan, Y., and Yang, T. Fast objective and duality gap convergence for non-convex strongly-concave min-max problems. arXiv preprint arXiv:2006.06889, 2020.
+
+[23] He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
+
+[24] Henderson, P. and Ferrari, V. End-to-end training of object class detectors for mean average precision. In Computer Vision – ACCV 2016, pp. 198–213. Springer International Publishing, 2017. doi: 10.1007/978-3-319-54193-8_13. URL https://doi.org/10.1007% 2F978-3-319-54193-8_13.
+
+[25] Herschtal, A. and Raskutti, B. Optimising area under the ROC curve using gradient descent. In Proceedings of the 21st International Conference on Machine Learning (ICML), pp. 49, 2004.
+
+[26] Hu, W., Liu, B., Gomes, J., Zitnik, M., Liang, P., Pande, V., and Leskovec, J. Strategies for pre-training graph neural networks. In Proceddings of the 7th international conference on learning representations, 2019.
+
+[27] Huo, Z., Gu, B., Liu, J., and Huang, H. Accelerated method for stochastic composition optimization with nonsmooth regularization. In McIlraith, S. A. and Weinberger, K. Q. (eds.), Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), pp. 3287–3294, 2018.
+
+[28] Joachims, T. A support vector method for multivariate performance measures. In Proceedings of the 22nd International Conference on Machine learning, pp. 377–384, 2005.
+
+[29] Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, 2017.
+
+[30] Lian, X., Wang, M., and Liu, J. Finite-sum composition optimization via variance reduced gradient descent. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1159–1167, 2017.
+
+[31] Lin, T., Fan, C., Wang, M., and Jordan, M. I. Improved oracle complexity for stochastic compositional variance reduced gradient. CoRR, abs/1806.00458, 2018.
+[32] Lin, T.-Y., Goyal, P., Girshick, R., He, K., and Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017.
+[33] Liu, L., Liu, J., Hsieh, C., and Tao, D. Stochastically controlled stochastic gradient for the convex and non-convex composition problem. CoRR, abs/1809.02505, 2018.
+[34] Liu, L., Liu, J., and Tao, D. Dualityfree methods for stochastic composition optimization. IEEE Transactions on Neural Networks and Learning Systems, 30(4):1205–1217, 2019.
+[35] Liu, M., Zhang, X., Chen, Z., Wang, X., and Yang, T. Fast stochastic auc maximization with $o ( 1 / n )$ -convergence rate. In Proceedings of the 35th International Conference on Machine Learning, pp. 3189–3197. PMLR, 2018.
+[36] Liu, M., Yuan, Z., Ying, Y., and Yang, T. Stochastic auc maximization with deep neural networks. In International Conference on Learning Representations, 2020.
+[37] Metzler, D. and Croft, W. B. A markov random field model for term dependencies. In Proceedings of the 28th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR, 2005.
+[38] Metzler, D. and Croft, W. B. A markov random field model for term dependencies. In Proceedings of the 28th annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 472–479, 2005.
+[39] Mohapatra, P., Jawahar, C., and Kumar, M. P. Efficient optimization for average precision svm. In Advances in Neural Information Processing Systems, 2014.
+[40] Mohapatra, P., Rolinek, M., Jawahar, C. V., Kolmogorov, V., and Kumar, M. Efficient optimization for rank-based loss functions. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3693–3701, 2018.
+[41] Narasimhan, H., Cotter, A., and Gupta, M. Optimizing generalized rate metrics with three players. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/ 3ce257b311e5acf849992f5a675188e8-Paper.pdf.
+[42] Natole, M., Ying, Y., and Lyu, S. Stochastic proximal algorithms for auc maximization. In Proceedings of the 35th International Conference on Machine Learning, pp. 3710–3719. PMLR, 2018.
+[43] Oksuz, K., Cam, B. C., Akbas, E., and Kalkan, S. A ranking-based, balanced loss function unifying classification and localisation in object detection. In Advances in Neural Information Processing Systems, 2020.
+[44] Qi, Q. Soap code for reproducing results. https://github.com/Optimization-AI, 2021.
+[45] Qi, Q., Xu, Y., Jin, R., Yin, W., and Yang, T. Attentional biased stochastic gradient for imbalanced classification. arXiv preprint arXiv:2012.06951, 2020.
+[46] Qi, Q., Guo, Z., Xu, Y., Jin, R., and Yang, T. An online method for a class of distributionally robust optimization with non-convex objectives. In Proceedings of Thirty-fifth Conference on Neural Information Processing Systems (NeurIPS), 2021.
+[47] Qin, T., Liu, T.-Y., and Li, H. A general approximation framework for direct optimization of information retrieval measures. Technical Report MSR-TR-2008-164, November 2008.
+[48] Rolinek, M., Musil, V., Paulus, A., Vlastelica, M., Michaelis, C., and Martius, G. Optimizing rank-based metrics with blackbox differentiation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
+[49] Rotemberg, V., Kurtansky, N., Betz-Stablein, B., Caffery, L., Chousakos, E., Codella, N., Combalia, M., Dusza, S., Guitera, P., Gutman, D., et al. A patient-centric dataset of images and metadata for identifying melanomas using clinical context. arXiv preprint arXiv:2008.07360, 2020.
+[50] Song, Y., Schwing, A., Richard, and Urtasun, R. Training deep neural networks via direct loss minimization. In Balcan, M. F. and Weinberger, K. Q. (eds.), Proceedings of The $3 3 r d$ International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2169–2177, New York, New York, USA, 20–22 Jun 2016. PMLR.
+[51] Stokes, J. M., Yang, K., Swanson, K., Jin, W., Cubillos-Ruiz, A., Donghia, N. M., MacNair, C. R., French, S., Carfrae, L. A., Bloom-Ackerman, Z., et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
+[52] Wang, M., Fang, E. X., and Liu, H. Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions. Mathematical Programming, 161(1-2): 419–449, 2017.
+[53] Wang, M., Liu, J., and Fang, E. X. Accelerating stochastic composition optimization. Journal Machine Learning Research, 18:105:1–105:23, 2017.
+[54] Wang, Z., Liu, M., Luo, Y., Xu, Z., Xie, Y., Wang, L., Cai, L., Qi, Q., Yuan, Z., Yang, T., and Ji, S. Advanced graph and sequence neural networks for molecular property prediction and drug discovery, 2021.
+[55] Wu, Z., Ramsundar, B., Feinberg, E. N., Gomes, J., Geniesse, C., Pappu, A. S., Leswing, K., and Pande, V. MoleculeNet: a benchmark for molecular machine learning. Chemical science, 9 (2):513–530, 2018.
+[56] Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In 7th International Conference on Learning Representations, 2019.
+[57] Yan, Y., Xu, Y., Lin, Q., Liu, W., and Yang, T. Optimal epoch stochastic gradient descent ascent methods for min-max optimization. In Advances in Neural Information Processing Systems 33 (NeurIPS), 2020.
+[58] Ying, Y., Wen, L., and Lyu, S. Stochastic online auc maximization. In Advances in Neural Information Processing Systems, pp. 451–459, 2016.
+[59] Yu, Y. and Huang, L. Fast stochastic variance reduced ADMM for stochastic composition optimization. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence (IJCAI), pp. 3364–3370, 2017.
+[60] Yuan, Z., Yan, Y., Sonka, M., and Yang, T. Robust deep auc maximization: A new surrogate loss and empirical studies on medical image classification. arXiv preprint arXiv:2012.03173, 2020.
+[61] Yue, Y., Finley, T., Radlinski, F., and Joachims, T. A support vector method for optimizing average precision. In Proceedings of the 30th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’07, pp. 271–278, New York, NY, USA, 2007. Association for Computing Machinery.
+[62] Zhang, J. and Xiao, L. A composite randomized incremental gradient method. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning (ICML), volume 97, pp. 7454–7462, 2019.
+[63] Zhao, P., Hoi, S. C. H., Jin, R., and Yang, T. Online auc maximization. In ICML, pp. 233–240, 2011.
\ No newline at end of file
diff --git a/md/train/S1Dh8Tg0-/S1Dh8Tg0-.md b/md/train/S1Dh8Tg0-/S1Dh8Tg0-.md
new file mode 100644
index 0000000000000000000000000000000000000000..a928e485ec6be8f28c4359b713ba91957af46d2d
--- /dev/null
+++ b/md/train/S1Dh8Tg0-/S1Dh8Tg0-.md
@@ -0,0 +1,318 @@
+# FIX YOUR CLASSIFIER: THE MARGINAL VALUE OFTRAINING THE LAST WEIGHT LAYER
+
+Elad Hoffer, Itay Hubara, Daniel Soudry
+Department of Electrical Engineering
+Technion
+Haifa, 320003, Israel
+elad.hoffer, itay.hubara, daniel.soudry@gmail.com
+
+# ABSTRACT
+
+Neural networks are commonly used as models for classification for a wide variety of tasks. Typically, a learned affine transformation is placed at the end of such models, yielding a per-class value used for classification. This classifier can have a vast number of parameters, which grows linearly with the number of possible classes, thus requiring increasingly more resources.
+
+In this work we argue that this classifier can be fixed, up to a global scale constant, with little or no loss of accuracy for most tasks, allowing memory and computational benefits. Moreover, we show that by initializing the classifier with a Hadamard matrix we can speed up inference as well. We discuss the implications for current understanding of neural network models.
+
+# 1 INTRODUCTION
+
+Deep neural network have become a widely used model for machine learning, achieving state-ofthe-art results on many tasks. The most common task these models are used for is to perform classification, as in the case of convolutional neural networks (CNNs) used to classify images to a semantic category. CNN models are currently considered the standard for visual tasks, allowing far better accuracy than preceding approaches (Krizhevsky et al., 2012; He et al., 2016; Szegedy et al., 2015).
+
+Training NN models and using them for inference requires large amounts of memory and computational resources, thus, extensive amount of research has been done lately to reduce the size of networks. Han et al. (2015) used weight sharing and specification, Micikevicius et al. (2017) used mixed precision to reduce the size of the neural networks by half. Tai et al. (2015) and Jaderberg et al. (2014) used low rank approximations to speed up NNs.
+
+Hubara et al. (2016b), Li et al. (2016) and Zhou et al. (2016), used a more aggressive approach, in which weights, activations and gradients were quantized to further reduce computation during training. Although aggressive quantization benefits from smaller model size, the extreme compression rate comes with a loss of accuracy.
+
+Past work noted the fact that predefined (Park & Sandberg, 1991) and random (Huang et al., 2006) projections can be used together with a learned affine transformation to achieve competitive results on several tasks. In this study suggest the reversed proposal - that common NN models used can learn useful representation even without modifying the final output layer, which often holds a large number of parameters that grows linearly with number of classes.
+
+# 1.1 CLASSIFIERS IN CONVOLUTIONAL NEURAL NETWORKS
+
+Convolutional neural networks (CNNs) are commonly used to solve a variety of spatial and temporal tasks. CNNs are usually composed of a stack of convolutional parameterized layers, spatial pooling layers and fully connected layers, separated by non-linear activation functions. Earlier architectures of CNNs (LeCun et al., 1998; Krizhevsky et al., 2012) used a set of fully-connected layers at later stage of the network, presumably to allow classification based on global features of an image. The final classifier can also be replaced with a convolutional layer with output feature maps matching the number of classes, as demonstrated by Springenberg et al. (2014).
+
+Despite the enormous number of trainable parameters these layers added to the model, they are known to have a rather marginal impact on the final performance of the network (Zeiler & Fergus, 2014) and are easily compressed and reduced after a model was trained by simple means such as matrix decomposition and sparsification (Han et al., 2015). Further more, modern architecture choices are characterized with the removal of most of the fully connected layers (Lin et al., 2013; Szegedy et al., 2015; He et al., 2016), which was found to lead to better generalization and overall accuracy, together with a huge decrease in the number of trainable parameters.
+
+Additionally, numerous works showed that CNNs can be trained in a metric learning regime (Bromley et al., 1994; Schroff et al., 2015; Hoffer & Ailon, 2015), where no explicit classification layer was introduced and the objective regarded only distance measures between intermediate representations. Hardt & Ma (2017) suggested an all-convolutional network variant, where they kept the original initialization of the classification layer fixed with no negative impact on performance on the Cifar10 dataset. All of these properties provide evidence that fully-connected layers are in fact redundant and play a small role in learning and generalization.
+
+Despite the apparent minor role they play, fully-connected layers are still commonly used as classification layers, transforming from the dimension of network features $N$ to the number of required class categories $C$ . Therefore, each classification model must hold $N \cdot C$ number of trainable parameters that grows in a linear manner with the number of classes. This property still holds when the fully-connected layer is replaced with a convolutional classifier as shown by Springenberg et al. (2014).
+
+In this work we claim that for common use-cases of convolutional network, the parameters used for the final classification transform are completely redundant, and can be replaced with a predetermined linear transform. As we will show for the first time, this property holds even in largescale models and classification tasks, such as recent architectures trained on the ImageNet benchmark (Deng et al., 2009).
+
+The use of a fixed transform can, in many cases, allow a huge decrease in model parameters, and a possible computational benefit. We suggest that existing models can, with no other modification, devoid their classifier weights, which can help the deployment of those models in devices with low computation ability and smaller memory capacity. Moreover, as we keep the classifier fixed, less parameters need to be updated, reducing the communication cost for models deployed in distributed systems. The use of a fixed transform which does not depend on the number classes can allow models to scale to a large number of possible outputs, without a linear cost in the number of parameters. We also suggest that these finding might shed light on the importance of the preceding non-linear layers to learning and generalization.
+
+# 2 USING A FIXED CLASSIFIER
+
+# 2.1 FULLY-CONNECTED CLASSIFIERS
+
+We focus our attention on the final representation obtained by the network (the last hidden layer), before the classifier. We denote these representation as $x = F ( z ; \theta )$ where $F$ is assumed to be a deep neural network with input $z$ and parameters $\theta$ , e.g., a convolutional network, trained by backpropagation.
+
+In common NN models, this representation is followed by an additional affine transformation
+
+$$
+\boldsymbol { y } = \boldsymbol { W } ^ { T } \boldsymbol { x } + \boldsymbol { b }
+$$
+
+where $W$ and $b$ are also trained by back-propagation.
+
+For input $x$ of $N$ length, and $C$ different possible outputs, $W$ is required to be a matrix of $N \times$ $C$ . Training is done using cross-entropy loss, by feeding the network outputs through a softmax activation
+
+$$
+v _ { i } = \frac { e ^ { y _ { i } } } { \sum _ { j } ^ { C } e ^ { y _ { j } } } , i \in \{ 1 , \ldots , C \}
+$$
+
+and reducing the expected negative log likelihood with respect to ground-truth target $t \in \{ 1 , \ldots , C \}$ , by minimizing
+
+$$
+\mathcal { L } ( \boldsymbol { x } , t ) = - \log \boldsymbol { v _ { t } } = - \boldsymbol { w _ { t } } \cdot \boldsymbol { x } - b _ { t } + \log \left( \sum _ { j } ^ { C } e ^ { \boldsymbol { w _ { j } } \cdot \boldsymbol { x } + b _ { j } } \right)
+$$
+
+where $w _ { i }$ is the $i$ -th column of $W$ .
+
+# 2.2 CHOOSING THE PROJECTION MATRIX
+
+To evaluate our conjecture regarding the importance of the final classification transformation, we replaced the trainable parameter matrix $W$ with a fixed orthonormal projection $Q \in \mathbb { R } ^ { N \times C }$ , such that $\forall i \neq j : q _ { i } \cdot q _ { j } = 0$ and $\| q _ { i } \| _ { 2 } = 1$ , where $q _ { i }$ is the ith column of $Q$ . This can be ensured by a simple random sampling and singular-value decomposition
+
+As the rows of classifier weight matrix are fixed with an equally valued $L _ { 2 }$ norm, we find it beneficial to also restrict the representation of $x$ by normalizing it to reside on the $n$ -dimensional sphere
+
+$$
+{ \hat { x } } = { \frac { x } { \| x \| _ { 2 } } }
+$$
+
+This allows faster training and convergence, as the network does not need to account for changes in the scale of its weights.
+
+We now face the problem that $q _ { i } \cdot { \hat { x } }$ is bounded between $- 1$ and 1. This causes convergence issues, as the softmax function is scale sensitive, and the network is affected by the inability to re-scale its input. This is similar to the phenomenon described by Vaswani et al. (2017) with respect to softmax function used for attention mechanisms. In the same spirit, we can amend this issue with a fixed scale $T$ applied to softmax inputs $\begin{array} { r } { f ( y ) = \mathrm { s o f t m a x } ( \frac { 1 } { T } y ) } \end{array}$ , also known as a softmax temperature. However, this introduces an additional hyper-parameter which may differ between networks and datasets. Instead, we suggest to introduce a single scalar parameter $\alpha$ to learn the softmax scale, effectively functioning as an inverse of the softmax temperature $\textstyle { \frac { 1 } { T } }$ .
+
+Using normalized weights and an additional scale coefficient is similar in spirit to weightnormalization (Salimans $\&$ Kingma, 2016), with the difference that we use a single scale for all entries in the weight matrix, in contrast to a scale for each row that Salimans & Kingma (2016) uses.
+
+We keep the additional vector of bias parameters $b \in \mathbb { R } ^ { C }$ , and train using the same negative-loglikelihood criterion. More explicitly, our classifier output is now
+
+$$
+v _ { i } = \frac { e ^ { \alpha q _ { i } \cdot \hat { x } + b _ { i } } } { \sum _ { j } ^ { C } e ^ { \alpha q _ { j } \cdot \hat { x } + b _ { j } } } , ~ i \in \{ 1 , \dots , C \}
+$$
+
+and we minimize the loss:
+
+$$
+\mathcal { L } ( x , t ) = - \alpha q _ { t } \cdot \frac { x } { \| x \| _ { 2 } } + b _ { t } + \log \left( \sum _ { i = 1 } ^ { C } \exp \left( \alpha q _ { i } \cdot \frac { x } { \| x \| _ { 2 } } + b _ { i } \right) \right)
+$$
+
+where we recall $x$ is the final representation obtained by the network for a specific sample, and $t \in \{ 1 , \ldots , C \}$ is the ground-truth label for that sample.
+
+Observing the behavior of the $\alpha$ parameter over time revealed a logarithmic growth depicted in graph 1. Interestingly, this is the same behavior exhibited by the norm of a learned classifier, first described by Hoffer et al. (2017) and linked to the generalization of the network. This was recently explained by the under-review work of Soudry et al. (2018) as convergence to a max margin classifier. We suggest that using a single parameter will enable a simpler examination and possible further exploration of this phenomenon and its implications.
+
+We note that as $- 1 \leq q _ { i } \cdot \hat { x } \leq 1$ , we also found it possible to train the network with a simple cosine angle loss:
+
+$$
+\begin{array} { r } { \mathcal { L } ( \hat { x } , t ) = \left\{ \begin{array} { l l } { q _ { i } \cdot \hat { x } - 1 , } & { \mathrm { i f ~ } i = t , } \\ { q _ { i } \cdot \hat { x } + 1 , } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \end{array}
+$$
+
+allowing to discard the softmax function and its scale altogether, but resulting in a slight decrease in final validation accuracy compared to original models.
+
+
+Figure 1: The softmax scale coefficient $\alpha$ was observed to follow a logarithmic growth over the course of training.
+
+# 2.3 USING A FIXED HADMARD MATRIX
+
+We further suggest the use of a Hadamard matrix (Hedayat et al., 1978) as the final classification transform. Hadamard matrix $H$ is an $n \times n$ matrix, where all of its entries are either $+ 1$ or $- 1$ . Further more, $H$ is orthogonal, such that $H H ^ { T } = n I _ { n }$ where $I _ { n }$ is the identity matrix.
+
+We can use a truncated Hadamard matrix $\hat { H } \in \{ - 1 , 1 \} ^ { C \times N }$ where all $C$ rows are orthogonal as our final classification layer such that
+
+$$
+\boldsymbol { y } = \hat { H } \hat { \boldsymbol { x } } + \boldsymbol { b }
+$$
+
+This usage allows two main benefits:
+
+• A deterministic, low-memory and easily generated matrix that can be used to classify. • Removal of the need to perform a full matrix-matrix multiplication - as multiplying by a Hadamard matrix can be done by simple sign manipulation and addition.
+
+We note that $n$ must be a multiple of 4, but it can be easily truncated to fit normally defined networks.
+
+We also note the similarity of using a Hadamard matrix as a final classifier to methods of weight binarization such as the one suggested by Courbariaux et al. (2015). As the classifier weights are fixed to need only 1-bit precision, it is now possible to focus our attention on the features preceding it.
+
+# 3 EXPERIMENTAL RESULTS
+
+Table 1: Validation accuracy results on learned vs. fixed classifier
+
+
Network
Dataset
Learned
Fixed
#Params
% Fixed params
Resnet56 (He et al., 2016)
Cifar10
93.03%
93.14%
855,770
0.07%
DenseNet(k=12)(Huang et al.,2017)
Cifar100
77.73%
77.67%
800,032
4.2%
Resnet50 (He et al.,2016)
ImageNet
75.3%
75.3%
25,557,032
8.01%
DenseNeti69(Huang et al.,2017)
ImageNet
76.2%
76%
14,149,480
11.76%
ShuffleNet(Zhang et al.,2017b)
ImageNet
65.9%
65.4%
1,826,555
52.56%
+
+# 3.1 CIFAR10/100
+
+We used the well known Cifar10 and Cifar100 datasets by Krizhevsky (2009) as an initial test-bed to explore the idea of a fixed classifier. Cifar10 is an image classification benchmark dataset containing 50, 000 training images and 10, 000 test images. The images are in color and contain $3 2 \times 3 2$ pixels. There are 10 possible classes of various animals and vehicles. Cifar100 holds the same number of images of same size, but contains 100 different classes.
+
+
+Figure 2: Comparing training and validation error of fixed and learned classifier (ResNet56, Cifar10)
+
+
+Figure 3: Comparing fixed vs. trained variable scale $\alpha$ (ResNet56, Cifar10)
+
+We trained a residual network of He et al. (2016) on the Cifar10 dataset. We used a network of depth 56 and the same hyper-parameters used in the original work. We compared two variants: the original model with a learned classifier, and our version, where a fixed transformation is used. The results shown in figure 2 demonstrate that although the training error is considerably lower for the network with learned classifier, both models achieve the same classification accuracy on the validation set. Our conjecture is that with our new fixed parameterization, the network can no longer increase the norm of a given sample’s representation - thus learning its label requires more effort. As this may happen for specific seen samples - it affects only training error.
+
+We also compared using a fixed scale variable $\alpha$ at different values vs. a learned parameter. Results for $\alpha = \{ 0 . 1 , 1 , 1 0 \}$ are depicted in figure 3 for both training and validation error. As can be seen, similar validation accuracy can be obtained using a fixed scale value (in this case $\alpha = 1$ or 10 will suffice) at the expense of another hyper-parameter to seek. In all our experiments we opted to train this parameter instead. In all experiments the $\alpha$ scale parameter was regularized with the same weight decay coefficient used on original classifier.
+
+We then followed to train a model on the Cifar100 dataset. We used the DenseNet-BC model of Huang et al. (2017) with depth of 100 layers and $k = 1 2$ . We continued to train according to the original regime and setting described for this network and dataset. Naturally, the higher number of classes caused the number of parameters to grow and encompass about $4 \%$ of the whole model. Validation accuracy for the fixed-classifier model remained equally good as the original model, and we continued to observe the same training curve.
+
+# 3.2 IMAGENET
+
+In order to validate our results on a more challenging dataset, we used the Imagenet dataset introduced by Deng et al. (2009). The Imagenet dataset spans over 1000 visual classes, and over 1.2 million samples. CNNs used to classify Imagenet such as Krizhevsky et al. (2012), He et al. (2016),
+
+Szegedy et al. (2016) usually have a hidden representation leading to the final classifier of at least 1024 dimensions. This architectural choice, together with the large number of classes, causes the size of classifier to exceed millions of parameters and taking a sizable share from the entire model size.
+
+We evaluated our fixed classifier method on Imagenet using Resnet50 by He et al. (2016) with the same training regime and hyper-parameters. By using a fixed classifier, approximately 2-million parameters were removed from the model, accounting for about $8 \%$ of the model parameters. Following the same procedure, we trained a Densenet169 model (Huang et al., 2017) for which a fixed classifier reduced about $1 2 \%$ of the parameters. Similarly to results on Cifar10 dataset, we observed the same convergence speed and approximately the same final accuracy on both the validation and training sets.
+
+Furthermore, we were interested in evaluating more challenging models where the classifier parameters constitutes the majority amount. For this reason we chose the Shufflenet architecture (Zhang et al., 2017b), which was designed to be used in low memory and limited computing platforms. The Shufflenet network contains about 1.8 million parameters, out of which 0.96 million are part of the final classifier. Fixing the classifier resulted with a model with only 0.86 million parameters. This model was trained and found, again, to converge to similar validation accuracy as the original.
+
+Interestingly, this method allowed Imagenet training in an under-specified regime, where there are more training samples than number of parameters. This is an unconventional regime for modern deep networks, which are usually over-specified to have many more parameters than training samples (Zhang et al., 2017a). Moreover, many recent theoretical results related to neural network training (Soudry & Hoffer, 2017; Xie et al., 2016; Safran & Shamir, 2016; Soltanolkotabi et al., 2017; Soudry & Carmon, 2016) and even generalization (Gunasekar et al., 2017; Advani & Saxe, 2017; Wilson et al., 2017) usually assume over-specification.
+
+Table 1 summarizes our fixed-classifier results on convolutional networks, comparing to originally reported results. We offer our drop-in replacement for learned classifier that can be used to train models with fixed classifiers and replicate our results1.
+
+# 3.3 LANGUAGE MODELING
+
+As language modeling requires classification of all possible tokens available in the task vocabulary, we were interested to see if a fixed classifier can be used, possible saving a very large number of trainable parameters (vocabulary size can have tens or even hundreds of thousands of different words). Recent works have already found empirically that using the same weights for both word embedding and classifier can yield equal or better results than using a separate pair of weights (Inan et al., 2016; Press & Wolf, 2017; Vaswani et al., 2017). This is compliant with our findings that the linear classifier is largely redundant. To examine further reduction in the number of parameters, we removed both classifier and embedding weights and replaced them with a fixed transform.
+
+We trained a language model on the WikiText2 dataset described in Merity et al. (2016), using the same setting in Merity et al. (2017). We used a recurrent model with 2-layers of LSTM (Hochreiter & Schmidhuber, 1997) and embedding $^ +$ hidden size of 512. As the vocabulary of WikiText2 holds about $3 3 K$ different words, the expected number of parameters in embedding and classifier is about 34-million. This number makes for about $8 9 \%$ from the $3 8 M$ parameters used for the whole model.
+
+We found that using a random orthogonal transform yielded poor results compared to learned embedding. We suspect that, in oppose to image classification benchmarks, the embedding layer in language models holds information of the words similarities and relations, thus requiring a fine initialization. To test our intuition, we opted to use pre-trained embeddings using word2vec algorithm by Mikolov et al. (2013) or PMI factorization as suggested by Levy & Goldberg (2014). We find that using fixed word2vec embeddings, we achieve much better results. Specifically, we use $8 9 \%$ less parameters than the fully learned model, and obtain only somewhat worse perplexity.
+
+We argue that this implies a required structure in word embedding that stems from semantic relatedness between words and the natural imbalance between classes. However, we suggest that with a much more cost effective ways to train word embeddings (e.g., Mikolov et al. (2013)), we can narrow the gap and avoid their cost when training bigger models.
+
+Table 2: Validation perplexity results
+
+
Network
Dataset
Learned
Fixed
#Params
% Fixed params
2-layer LSTM (h=512)
WikiText-2
74.1
81.2
38,312,446
88.94%
+
+# 4 DISCUSSION
+
+# 4.1 IMPLICATIONS TO FUTURE DNN MODELS AND USE CASES
+
+In the last couple of years a we observe a rapid growth in the number of classes benchmark datasets contain, for example: Cifar100 (Krizhevsky, 2009), ImageNet1K, ImageNet22k (Deng et al., 2009) and language modeling (Merity et al., 2016). Therefore the computational demands of the final classifier will increase as well and should be considered no less than the architecture chosen. We use the work by Sun et al. (2017) as our use case, which introduced JFT-300M - an internal Google dataset with over 18K different classes. Using a Resnet50 (He et al., 2016), with a 2048 sized representation, this led to a model with over 36M parameters. This means that over $6 0 \%$ of the model parameters reside in the final classification layer.
+
+Sun et al. (2017) further describes the difficulty in distributing this amount of parameters between the training servers, and the need to split them between 50 sub-layers. We also note the fact that the training procedure needs to account for synchronization after each parameter update - which must incur a non-trivial overhead.
+
+Our work can help considerably in this kind of scenario - where using a fixed classifier removes the need to do any gradient synchronization for the final layer. Furthermore, using a Hadamard matrix, we can remove the need to save the transformation altogether, and make it more efficient, allowing considerable memory and computational savings.
+
+# 4.2 POSSIBLE CAVEATS
+
+We argue that our method works due to the ability of preceding layers in the network to learn separable representations that are easily classified even when the classifier itself is fixed. This property can be affected when the ratio between learned features and number of classes is small – that is, when $C > N$ . We’ve been experimenting with such cases, for example Imagenet classification $C = 1 0 0 0 ^ { \circ } ,$ ) using mobilenet-0.5 (Howard et al., 2017) where $N = 5 1 2$ , or reduced version of ResNet (He et al., 2016) where $N = 2 5 6$ . In both scenarios, our method converged similarly to a fully learned classifier reaching the same final validation accuracy. This is strengthening our finding, showing that even in cases in which $C > N$ , fixed classifier can provide equally good results.
+
+Another possible issue may appear when the possible classes are highly correlated. As a fixed orthogonal classifier does not account for this kind of correlation, it may prove hard for the network to learn in this case. This may suggest another reason for the difficulties we experienced in training a language model using an orthogonal fixed classifier, as word classes tend to have highly correlated instances.
+
+# 4.3 FUTURE WORK
+
+Understanding that linear classifiers used in NN models are largely redundant allows us to consider new approaches in training and understanding these models.
+
+Recent works (Neyshabur et al., 2017; Bartlett et al., 2017) suggested a connection between generalization capabilities of models and various norm-related quantities of their weights. Such results might be potentially simplified in our model, since we have a single scalar variable (i.e., scale), which seems to be the only relevant parameter in the model (since we normalize the last hidden layer, and fix the last weight layer).
+
+The use of fixed classifiers might be further simplified in Binarized Neural Networks (Hubara et al., 2016a), where the activations and weights are restricted to $\pm 1$ during propagations. In this case the norm of the last hidden layer is constant for all samples (equal to the square root of the hidden layer width). This constant can be absorbed into the scale constant $\alpha$ , and there is no need in a per-sample normalization as in eq. 1.
+
+We also plan to further explore more efficient ways to learn word embedding, where similar redundancy in classifier weights may suggest simpler forms of token representations - such as low-rank or sparse versions, allowing similar benefits to the fixed transformations we suggested.
+
+# 5 CONCLUSION
+
+In this work we suggested removing the parameters from the classification layer used in deep neural networks. We showed empirical results suggesting that keeping the classifier fixed cause little or no decline in classification performance for common balanced datasets such as Cifar and Imagenet, while allowing a noticeable reduction in trainable parameters. We argue that fixing the last layer can reduce the computational complexity for training as well as the communication cost in distributed learning. Furthermore, using a Hadamard matrix as classifier might lead to some computational benefits when properly implemented, and save memory otherwise spent on large amount of transformation coefficients. As datasets tend to become more complex by time (e.g., Cifar100, ImageNet1K, ImageNet22k, JFT-300M, and language modeling) we believe that resource hungry affine transformation should remain fixed during training, at least partially.
+
+We also found that new efficient methods to create pre-defined word embeddings should be explored, as they require huge amount of parameters that can possibly be avoided when learning a new task. Based on these findings, we recommend future research to focus on representations learned by the non-linear part of neural networks - up to the final classifier, as it seems to be highly redundant.
+
+# ACKNOWLEDGMENTS
+
+The research leading to these results has received funding from the Taub Foundation, and the European Research Council under European Unions Horizon 2020 Program, ERC Grant agreement no. 682203 SpeedInfTradeoff.
+
+# REFERENCES
+
+Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
+
+Peter Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1706.08498, 2017.
+
+Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verifi- ¨ cation using a” siamese” time delay neural network. In Advances in Neural Information Processing Systems, pp. 737–744, 1994.
+
+Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015.
+
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
+
+Suriya Gunasekar, Blake Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nathan Srebro. Implicit regularization in matrix factorization. arXiv preprint arXiv:1705.09280, 2017.
+
+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.
+
+Moritz Hardt and Tengyu Ma. Identity matters in deep learning. 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.
+
+A Hedayat, WD Wallis, et al. Hadamard matrices and their applications. The Annals of Statistics, 6 (6):1184–1238, 1978.
+
+Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
+
+Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In International Workshop on Similarity-Based Pattern Recognition, pp. 84–92. Springer, 2015.
+
+Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. 2017.
+
+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 Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
+
+Guang-Bin Huang, Qin-Yu Zhu, and Chee-Kheong Siew. Extreme learning machine: theory and applications. Neurocomputing, 70(1):489–501, 2006.
+
+Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Advances in Neural Information Processing Systems 29 (NIPS’16), 2016a.
+
+Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016b.
+
+Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. arXiv preprint arXiv:1611.01462, 2016.
+
+Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
+
+Alex Krizhevsky. Learning multiple layers of features from tiny images. 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, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. In Advances in neural information processing systems, pp. 2177–2185, 2014.
+
+Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
+
+Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
+
+Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
+
+Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. arXiv preprint arXiv:1708.02182, 2017.
+
+Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaev, 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 tations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
+
+Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. arXiv preprint arXiv:1706.08947, 2017.
+
+Jooyoung Park and Irwin W Sandberg. Universal approximation using radial-basis-function networks. Neural computation, 3(2):246–257, 1991.
+
+Ofir Press and Lior Wolf. Using the output embedding to improve language models. EACL 2017, pp. 157, 2017.
+
+Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pp. 774–782, 2016.
+
+Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
+
+Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 815–823, 2015.
+
+Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv preprint arXiv:1707.04926, 2017.
+
+Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv preprint arXiv:1605.08361, 2016.
+
+Daniel Soudry and Elad Hoffer. Exponentially vanishing sub-optimal local minima in multilayer neural networks. arXiv preprint arXiv:1702.05777, 2017.
+
+Daniel Soudry, Elad Hoffer, and Nathan Srebro. The implicit bias of gradient descent on separable data. 2018.
+
+Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
+
+Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. arXiv preprint arXiv:1707.02968, 2017.
+
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015.
+
+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.
+
+Cheng Tai, Tong Xiao, Yi Zhang, Xiaogang Wang, et al. Convolutional neural networks with lowrank regularization. arXiv preprint arXiv:1511.06067, 2015.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. 2017.
+
+Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nathan Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. arXiv preprint arXiv:1705.08292, 2017.
+
+Bo Xie, Yingyu Liang, and Le Song. Diversity leads to generalization in neural networks. arXiv preprint arXiv:1611.03131, 2016.
+
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014.
+
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017a. URL https://arxiv. org/abs/1611.03530.
+
+Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. arXiv preprint arXiv:1707.01083, 2017b.
+
+Shuchang Zhou, Zekun Ni, Xinyu Zhou, He Wen, Yuxin Wu, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
\ No newline at end of file
diff --git a/md/train/S1lEX04tPr/S1lEX04tPr.md b/md/train/S1lEX04tPr/S1lEX04tPr.md
new file mode 100644
index 0000000000000000000000000000000000000000..3393357b94f9f6ef8071f94678d80fc5146d66eb
--- /dev/null
+++ b/md/train/S1lEX04tPr/S1lEX04tPr.md
@@ -0,0 +1,525 @@
+# CM3: COOPERATIVE MULTI-GOAL MULTI-STAGEMULTI-AGENT REINFORCEMENT LEARNING
+
+Jiachen Yang∗1, Alireza Nakhaei†3, David Isele2, Kikuo Fujimura2 & Hongyuan Zha1
+
+1Georgia Institute of Technology
+2Honda Research Institute
+3Toyota Research Institute
+
+# ABSTRACT
+
+A variety of cooperative multi-agent control problems require agents to achieve individual goals while contributing to collective success. This multi-goal multiagent setting poses difficulties for recent algorithms, which primarily target settings with a single global reward, due to two new challenges: efficient exploration for learning both individual goal attainment and cooperation for others’ success, and credit-assignment for interactions between actions and goals of different agents. To address both challenges, we restructure the problem into a novel two-stage curriculum, in which single-agent goal attainment is learned prior to learning multi-agent cooperation, and we derive a new multi-goal multi-agent policy gradient with a credit function for localized credit assignment. We use a function augmentation scheme to bridge value and policy functions across the curriculum. The complete architecture, called CM3, learns significantly faster than direct adaptations of existing algorithms on three challenging multi-goal multi-agent problems: cooperative navigation in difficult formations, negotiating multi-vehicle lane changes in the SUMO traffic simulator, and strategic cooperation in a Checkers environment.
+
+# 1 INTRODUCTION
+
+Many real-world scenarios that require cooperation among multiple autonomous agents are multi-goal multi-agent control problems: each agent needs to achieve its own individual goal, but the global optimum where all agents succeed is only attained when agents cooperate to allow the success of other agents. In autonomous driving, multiple vehicles must execute cooperative maneuvers when their individual goal locations and nominal trajectories are in conflict (e.g., double lane merges) (Cao et al., 2013). In social dilemmas, mutual cooperation has higher global payoff but agents’ individual goals may lead to defection out of fear or greed (Van Lange et al., 2013). Even settings with a global objective that seem unfactorizable can be formulated as multi-goal problems: in Starcraft II micromanagement, a unit that gathers resources must not accidentally jeopardize a teammate’s attempt to scout the opponent base (Blizzard Entertainment, 2019); in traffic flow optimization, different intersection controllers may have local throughput goals but must cooperate for high global performance (Zhang et al., 2019). While the framework of multi-agent reinforcement learning (MARL) (Littman, 1994; Stone and Veloso, 2000; Shoham et al., 2003) has been equipped with methods in deep reinforcement learning (RL) (Mnih et al., 2015; Lillicrap et al., 2016) and shown promise on high-dimensional problems with complex agent interactions (Lowe et al., 2017; Mordatch and Abbeel, 2018; Foerster et al., 2018; Lin et al., 2018; Srinivasan et al., 2018), learning multi-agent cooperation in the multi-goal scenario involves significant open challenges.
+
+First, given that exploration is crucial for RL (Thrun, 1992) and even more so in MARL with larger state and joint action spaces, how should agents explore to learn both individual goal attainment and cooperation for others’ success? Uniform random exploration is common in deep MARL (Hernandez-Leal et al., 2018) but can be highly inefficient as the value of cooperative actions may be discoverable only in small regions of state space where cooperation is needed. Furthermore, the conceptual difference between attaining one’s own goal and cooperating for others’ success calls for more modularized and targeted approaches. Second, while there are methods for multi-agent credit assignment when all agents share a single goal (i.e., a global reward) (Chang et al., 2004; Foerster et al., 2018; Nguyen et al., 2018), and while one could treat the cooperative multi-goal scenario as a problem with a single joint goal, this coarse approach makes it extremely difficult to evaluate the impact of an agent’s action on another agent’s success. Instead, the multi-goal scenario can benefit from fine-grained credit assignment that leverages available structure in action-goal interactions, such as local interactions where only few agents affect another agent’s goal attainment at any time.
+
+Given these open challenges, our paper focuses on the cooperative multi-goal multi-agent setting where each agent is assigned a goal1 and must learn to cooperate with other agents with possibly different goals. To tackle the problems of efficient exploration and credit assignment in this complex problem setting, we develop CM3, a novel general framework involving three synergistic components:
+
+1. We approach the difficulty of multi-agent exploration from a novel curriculum learning perspective, by first training an actor-critic pair to achieve different goals in an induced single-agent setting (Stage 1), then using them to initialize all agents in the multi-agent environment (Stage 2). The key insight is that agents who can already act toward individual objectives are better prepared for discovery of cooperative solutions with additional exploration once other agents are introduced. In contrast to hierarchical learning where sub-goals are selected sequentially in time (Sutton et al., 1999), all agents act toward their goals simultaneously in Stage 2 of our curriculum. 2. Observing that a wide array of complex MARL problems permit a decomposition of agents’ observations and state vectors into components of self, others, and non-agent specific environment information (Hernandez-Leal et al., 2018), we employ function augmentation to bridge Stages 1-2: we reduce the number of trainable parameters of the actor-critic in Stage 1 by limiting their input space to the part that is sufficient for single-agent training, then augment the architecture in Stage 2 with additional inputs and trainable parameters for learning in the multi-agent environment. 3. We propose a credit function, which is an action-value function that specifically evaluates actiongoal pairs, for localized credit assignment in multi-goal MARL. We use it to derive a multi-goal multi-agent policy gradient for Stage 2. In synergy with the curriculum, the credit function is constructed via function augmentation from the critic in Stage 1.
+
+We evaluate our method on challenging multi-goal multi-agent environments with high-dimensional state spaces: cooperative navigation with difficult formations, double lane merges in the SUMO simulator (Lopez et al., 2018), and strategic teamwork in a Checkers game. CM3 solved all domains significantly faster than IAC and COMA (Tan, 1993; Foerster et al., 2018), and solved four out of five environments significantly faster than QMIX (Rashid et al., 2018). Exhaustive ablation experiments show that the combination of all three components is crucial for CM3’s overall high performance.
+
+# 2 RELATED WORK
+
+While early theoretical work analyzed Markov games in discrete state and action spaces (Tan, 1993; Littman, 1994; Hu and Wellman, 2003), recent literature have leveraged techniques from deep RL to develop general algorithms for high dimensional environments with complex agent interactions (Tampuu et al., 2017; Mordatch and Abbeel, 2018; Lowe et al., 2017), which pose difficulty for traditional methods that do not generalize by learning interactions (Bhattacharya et al., 2010).
+
+Cooperative multi-agent learning is important since many real-world problems can be formulated as distributed systems in which decentralized agents must coordinate to achieve shared objectives (Panait and Luke, 2005). The multi-agent credit assignment problem arises when agents share a global reward (Chang et al., 2004). While credit assignment be resolved when independent individual rewards are available (Singh et al., 2019), this may not be suitable for the fully cooperative setting: Austerweil et al. (2016) showed that agents whose rewards depend on the success of other agents can cooperate better than agents who optimize for their own success. In the special case when all agents have a single goal and share a global reward, COMA (Foerster et al., 2018) uses a counterfactual baseline, while Nguyen et al. (2018) employs count-based variance reduction limited to discrete-state environments. However, their centralized critic does not evaluate the specific impact of an agent’s action on another’s success in the general multi-goal setting. When a global objective is the sum of agents’ individual objectives, value-decomposition methods optimize a centralized Q-function while preserving scalable decentralized execution (Sunehag et al., 2018; Rashid et al., 2018; Son et al., 2019), but do not address credit assignment. While MADDPG (Lowe et al., 2017) and M3DDPG (Li et al., 2019) apply to agents with different rewards, they do not address multi-goal cooperation as they do not distinguish between cooperation and competition, despite the fundamental difference.
+
+Multi-goal MARL was considered in Zhang et al. (2018), who analyzed convergence in a special networked setting restricted to fully-decentralized training, while we conduct centralized training with decentralized execution (Oliehoek et al., 2008). In contrast to multi-task MARL, which aims for generalization among non-simultaneous tasks (Omidshafiei et al., 2017), and in contrast to hierarchical methods that sequentially select subtasks (Vezhnevets et al., 2017; Shu and Tian, 2019), our decentralized agents must cooperate concurrently to attain all goals. Methods for optimizing high-level agent-task assignment policies in a hierarchical framework (Carion et al., 2019) are complementary to our work, as we focus on learning low-level cooperation after goals are assigned. Prior application of curriculum learning (Bengio et al., 2009) to MARL include a single cooperative task defined by the number of agents (Gupta et al., 2017) and the probability of agent appearance (Sukhbaatar et al., 2016), without explicit individual goals. Rusu et al. (2016) instantiate new neural network columns for task transfer in single-agent RL. Techniques in transfer learning (Pan and Yang, 2010) are complementary to our novel curriculum approach to MARL.
+
+# 3 PRELIMINARIES
+
+In multi-goal MARL, each agent should achieve a goal drawn from a finite set, cooperate with other agents for collective success, and act independently with limited local observations. We formalize the problem as an episodic multi-goal Markov game, review an actor-critic approach to centralized training of decentralized policies, and summarize counterfactual-based multi-agent credit assignment.
+
+Multi-goal Markov games. A multi-goal Markov game is a tuple $\langle \mathcal { S } , \{ \mathcal { O } ^ { n } \} , \{ \mathcal { A } ^ { n } \} , P , R , \mathcal { G } , N , \gamma \rangle$ with $N$ agents labeled by $n \in [ N ]$ . In each episode, each agent $n$ has one fixed goal $g ^ { n } \in { \mathcal { G } }$ that is known only to itself. At time $t$ and global state $s _ { t } \in S$ , each agent $n$ receives an observation $o _ { t } ^ { n } : = o ^ { n } ( s _ { t } ) \in { \mathcal { O } } ^ { n }$ and chooses an action $a _ { t } ^ { n } \in { \mathcal { A } } ^ { n }$ . The environment moves to $s _ { t + 1 }$ due to joint action $\mathbf { \dot { a } } _ { t } : = \{ a _ { t } ^ { 1 } , \dots , a _ { t } ^ { N } \}$ , according to transition probability $P ( s _ { t + 1 } | s _ { t } , \mathbf { a } _ { t } )$ . Each agent receives a reward $R _ { t } ^ { n } : = R ( s _ { t } , \mathbf { a } _ { t } , g ^ { n } )$ , and the learning task is to find stochastic decentralized policies $\pi ^ { n } \colon { \mathcal { O } } ^ { n } \times { \mathcal { G } } \times { \mathcal { A } } ^ { n } \to [ 0 , 1 ]$ , conditioned only on local observations and goals, to maximize $\begin{array} { r } { J ( \pmb { \pi } ) : = \mathbb { E } _ { \pmb { \pi } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \sum _ { n = 1 } ^ { N } R ( s _ { t } , \mathbf { a } _ { t } , g ^ { n } ) \right] } \end{array}$ , where $\gamma \in \mathsf { \Gamma } ( 0 , 1 )$ and joint policy $\pi$ factorizes as $\begin{array} { r } { \pi ( \mathbf { a } | s , \mathbf { g } ) : = \prod _ { n = 1 } ^ { N } \pi ^ { n } ( a ^ { n } | o ^ { n } , g ^ { n } ) } \end{array}$ due to decentralization. Let $\boldsymbol { a } ^ { - n }$ and $g ^ { - n }$ denote all agents’ actions and goals, respectively, except that of agent . Let boldface a and g denote the joint action and joint goals, respectively. For brevity, let $\pi ( a ^ { n } ) : = \pi ^ { n } ( a ^ { n } | o ^ { n } , g ^ { n } ) \quad$ . This model covers a diverse set of cooperation problems in the literature (Hernandez-Leal et al., 2018), without constraining how the attainability of a goal depends on other agents: at a traffic intersection, each vehicle can easily reach its target location if not for the presence of other vehicles; in contrast, agents in a strategic game may not be able to maximize their rewards in the absence of cooperators (Sunehag et al., 2018).
+
+Centralized learning of decentralized policies. A centralized critic that receives full state-action information can speed up training of decentralized actors that receive only local information (Lowe et al., 2017; Foerster et al., 2018). Directly extending the single-goal case, for each $n \in [ 1 . . N ]$ in a multigoal Markov game, critics are represented by the value function $V _ { n } ^ { \pi } ( s ) : = \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R _ { t } ^ { n } \mid s _ { 0 } = s \right]$ and the action-value function $\begin{array} { r } { Q _ { n } ^ { \pi } ( s , \mathbf { a } ) : = \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R _ { t } ^ { n } \ \middle | \ s _ { 0 } = s , \mathbf { a } _ { 0 } = \mathbf { \bar { a } } \right] } \end{array}$ , which evaluate the joint policy against the reward $R ^ { n }$ for each goal $g ^ { n }$ .
+
+Multi-agent credit assignment. In MARL with a single team objective, COMA addresses credit assignment by using a counterfactual baseline in an advantage function $A ^ { n } ( s , \mathbf { a } ) : = Q ^ { \pi } ( s , \mathbf { a } ) -$ $\begin{array} { r } { \sum _ { \hat { a } ^ { n } } \pi ^ { n } ( \hat { a } ^ { n } | \boldsymbol { \dot { o } ^ { n } } ) Q ^ { \pi } \bar { ( } s , ( \hat { a } ^ { n } , a ^ { - n } ) ) } \end{array}$ (Foerster et al., 2018, Lemma 1) , which evaluates the contribution of a chosen action $a ^ { n }$ versus the average of all possible counterfactuals ${ \hat { a } } ^ { n }$ , keeping $a ^ { - n }$ fixed. The analysis in $\mathrm { { W u } }$ et al. (2018) for a formally equivalent action-dependent baseline in RL suggests that COMA is a low-variance estimator for single-goal MARL. We derive its variance in Appendix C.1. However, COMA is unsuitable for credit assignment in multi-goal MARL, as it would treat the collection of goals g as a global goal and only learn from total reward, making it extremely difficult to disentangle each agent’s impact on other agents’ goal attainment. Furthermore, a global Q-function does not explicitly capture structure in agents’ interactions, such as local interactions involving a limited number of agents. We substantiate these arguments by experimental results in Section 6.
+
+# 4 METHODS
+
+We describe the complete CM3 learning framework as follows. First we define a credit function as a mechanism for credit assignment in multi-goal MARL, then derive a new cooperative multi-goal policy gradient with localized credit assignment. Next we motivate the possibility of significant training speedup via a curriculum for multi-goal MARL. We describe function augmentation as a mechanism for efficiently bridging policy and value functions across the curriculum stages, and finally synthesize all three components into a synergistic learning framework.
+
+# 4.1 CREDIT ASSIGNMENT IN MULTI-GOAL MARL
+
+If all agents take greedy goal-directed actions that are individually optimal in the absence of other agents, the joint action can be sub-optimal (e.g. straight-line trajectory towards target in traffic). Instead rewarding agents for both individual and collective success can avoid such bad local optima. A naïve approach based on previous works (Foerster et al., 2018; Lowe et al., 2017) would evaluate the joint action a via a global Q-function $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ for each agent’s goal $g ^ { n }$ , but this does not precisely capture each agent’s contribution to another agent’s attainment of its goal. Instead, we propose an explicit mechanism for credit assignment by learning an additional function $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ that evaluates pairs of action $a ^ { m }$ and goal $g ^ { n }$ , for use in a multi-goal actor-critic algorithm. We define this function and show that it satisfies the classical relation needed for sample-based model-free learning.
+
+Definition 1. For $n , m \in [ N ]$ , $s \in S$ , the credit function for goal $g ^ { n }$ and $a ^ { m } \in { \mathcal { A } } ^ { m }$ by agent $m$ is:
+
+$$
+Q _ { n } ^ { \pi } ( s , a ^ { m } ) : = \mathbb { E } _ { \pi } \Bigl [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R _ { t } ^ { n } \ \big | \ s _ { 0 } = s , a _ { 0 } ^ { m } = a ^ { m } \Bigr ]
+$$
+
+Proposition 1. For all $m , n \in [ N ]$ , the credit function (1) satisfies the following relations:
+
+$$
+\begin{array} { c } { { Q _ { n } ^ { \pi } ( s , a ^ { m } ) = \mathbb { E } _ { \pi } \left[ R _ { t } ^ { n } + \gamma Q _ { n } ^ { \pi } ( s _ { t + 1 } , a _ { t + 1 } ^ { m } ) \ \middle \vert \ s _ { t } = s , a _ { t } ^ { m } = a ^ { m } \right] } } \\ { { V _ { n } ^ { \pi } ( s ) = \displaystyle \sum _ { a ^ { m } } \pi ^ { m } ( a ^ { m } | o ^ { m } , g ^ { m } ) Q _ { n } ^ { \pi } ( s , a ^ { m } ) } } \end{array}
+$$
+
+Derivations are given in Appendix B.1, including the relation between $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ and $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ . Equation (2) takes the form of the Bellman expectation equation, which justifies learning the credit function, parameterized by $\theta _ { Q _ { c } }$ , by optimizing the standard loss function in deep RL:
+
+$$
+L ( \theta _ { Q _ { c } } ) = \mathbb { E } _ { \boldsymbol { \pi } } \Big [ \big ( R _ { t } ^ { n } + \gamma Q _ { n } ^ { \boldsymbol { \pi } } ( s _ { t + 1 } , a _ { t + 1 } ^ { m } ; \theta _ { Q _ { c } } ) - Q _ { n } ^ { \boldsymbol { \pi } } ( s _ { t } , a _ { t } ^ { m } ; \theta _ { Q _ { c } } ) \big ) ^ { 2 } \Big ]
+$$
+
+While centralized training means the input space scales linearly with agent count, many practical environments involving only local interactions between agents allows centralized training with few agents while retaining decentralized performance when deployed at scale (evidenced in Appendix E).
+
+# 4.2 COOPERATIVE MULTI-GOAL MULTI-AGENT POLICY GRADIENT
+
+We use the credit function as a critic within a policy gradient for multi-goal MARL. Letting $\theta$ parameterize $\pi$ , the overall objective $J ( \pi )$ is maximized by ascending the following gradient:
+
+Proposition 2. The cooperative multi-goal credit function based MARL policy gradient is
+
+$$
+\begin{array} { r l } & { \displaystyle \nabla _ { \theta } J ( \pi ) = \mathbb { E } _ { \pi } \Big [ \sum _ { m , n = 1 } ^ { N } \big ( \nabla _ { \theta } \log \pi ^ { m } ( a ^ { m } | o ^ { m } , g ^ { m } ) \big ) A _ { n , m } ^ { \pi } ( s , \mathbf { a } ) \Big ] } \\ & { \displaystyle A _ { n , m } ^ { \pi } ( s , \mathbf { a } ) : = Q _ { n } ^ { \pi } ( s , \mathbf { a } ) - \sum _ { \hat { a } ^ { m } } \pi ^ { m } ( \hat { a } ^ { m } | o ^ { m } , g ^ { m } ) Q _ { n } ^ { \pi } ( s , \hat { a } ^ { m } ) } \end{array}
+$$
+
+This is derived in Appendix B.2. For a fixed agent $m$ , the inner summation over $n$ considers all agents’ goals $g ^ { n }$ and updates $m$ ’s policy based on the advantage of $a ^ { m }$ over all counterfactual actions $\hat { a } ^ { m }$ , as measured by the credit function for $g ^ { n }$ . The strength of interaction between action-goal pairs is captured by the extent to which $Q _ { n } ^ { \pi } ( s , { \hat { a } } ^ { m } )$ varies with $\hat { a } ^ { m }$ , which directly impacts the magnitude of the gradient on agent $m$ ’s policy. For example, strong interaction results in non-constant $Q _ { n } ^ { \pi } ( s , \cdot )$ which implies larger magnitude of $A _ { n , m } ^ { \pi }$ and larger weight on $\nabla _ { \boldsymbol { \theta } } \log \pi ( a ^ { m } )$ . The double summation accounts for first-order interaction between all action-goal pairs, but complexity can be reduced by omitting terms when interactions are known to be sparse, and our empirical runtimes are on par with other methods due to efficient batch computation (Appendix F). As the second term in $A _ { n , m } ^ { \pi }$ is a baseline, the reduction of variance can be analyzed similarly to that for COMA, given in Appendix C.2. While $A _ { n , m } ^ { \pi } = Q _ { n } ^ { \pi } ( s , \mathbf { a } ) - V _ { n } ^ { \pi } ( s )$ (due to (3)), ablation results show stability improvement due to the credit function (Section 6). As the credit function takes in a single agent’s action, it synergizes with both CM3’s curriculum and function augmentation as described in Section 4.5.
+
+# 4.3 CURRICULUM FOR MULTI-GOAL MARL
+
+Multi-goal MARL poses a significant challenge for exploration. Random exploration can be highly inefficient for concurrently learning both individual task completion and cooperative behavior. Agents who cannot make progress toward individual goals may rarely encounter the region of state space where cooperation is needed, rendering any exploration useless for learning cooperative behavior. On the other extreme, exploratory actions taken in situations that require precise coordination can easily lead to penalties that cause agents to avoid the coordination problem and fail to achieve individual goals. Instead, we hypothesize and confirm in experiments that agents who can achieve individual goals in the absence of other agents can more reliably produce state configurations where cooperative solutions are easily discovered with additional exploration in the multi-agent environment2.
+
+We propose a MARL curriculum that first solves a single-agent Markov decision process (MDP), as preparation for subsequent exploration speedup. Given a cooperative multi-goal Markov game MG, we induce an MDP M to be the tuple $\langle \bar { S } ^ { n } , \bar { O ^ { n } } , A ^ { n } , P ^ { n } , R , \bar { \gamma } \rangle$ , where an agent $n$ is selected to be the single agent in M. Entities $S ^ { n }$ , $P ^ { n }$ , and $R$ are defined by removing all dependencies on agent interactions, so that only components depending on agent $n$ remain. This reduction to $\mathbf { M }$ is possible in almost all fully cooperative multi-agent environments used in a large body of work3 (Hernandez-Leal et al., 2018), precisely because they support a variable number of agents, including $N = 1$ . Important real-world settings that allow this reduction include autonomous driving, multi traffic light control, and warehouse commissioning (removing all but one car/controller/robot, respectively, from the environment). Given a full Markov game implementation, the reduction involves only deletion of components associated with all other agents from state vectors (since an agent is uniquely defined by its attributes), deletion of if-else conditions from the reward function corresponding to agent interactions, and likewise from the transition function if a simulation is used. Appendix G provides practical guidelines for the reduction. Based on M, we define a greedy policy for MG.
+
+Definition 2. A greedy policy $\pi ^ { n }$ by agent $n$ for cooperative multi-goal MG is defined as the optimal policy $\pi ^ { * }$ for the induced MDP M where only agent $n$ is present.
+
+This naturally leads to our proposed curriculum: Stage 1 trains a single agent in M to achieve a greedy policy, which is then used for initialization in MG in Stage 2. Next we explain in detail how to leverage the structure of decentralized MARL to bridge the two curriculum stages.
+
+# 4.4 FUNCTION AUGMENTATION FOR MULTI-GOAL CURRICULUM
+
+In Markov games with decentralized execution, an agent’s observation space decomposes into $\mathcal { O } ^ { n } = \mathcal { O } _ { \mathrm { s e l f } } ^ { n } \cup \mathcal { O } _ { \mathrm { o t h e r s } } ^ { n }$ , where $o _ { \mathrm { s e l f } } ^ { n } \in \mathcal { O } _ { \mathrm { s e l f } } ^ { n }$ captures the agent’s own properties, which must be observable by the agent for closed-loop control, while other agents. In our work, egocentric obse $o _ { \mathrm { o t h e r s } } ^ { n } \in \mathcal { O } _ { \mathrm { o t h e r s } } ^ { n }$ is the agent’s egocentric observation ofvate and not accessible by other agents (Pynadath and Tambe, 2002). Similarly, global state $s$ decomposes into $s : = ( s _ { \mathrm { e n v } } , s ^ { \bar { n } } , s ^ { - n } )$ , where $s _ { \mathrm { e n v } }$ is environment information not specific to any agent (e.g., position of a landmark), and $s ^ { n }$ captures agent $n$ ’s information. While this decomposition is implicitly available in a wide range of complex multi-agent environments (Bansal et al., 2018; Foerster et al., 2018; Lowe et al., 2017; Rashid et al., 2018; Liu et al., 2019; Jaderberg curriculum. In Stage 1, as the ability to process $o _ { \mathrm { o t h e r s } } ^ { n }$ 201and $s ^ { - n }$ e explicitly use it to implement ouris unnecessary, we reduce the input space of policy and value functions, thereby reducing the number of trainable parameters and lowering the computation cost. In Stage 2, we restore Stage 1 parameters and activate new modules to process additional inputs $o _ { \mathrm { o t h e r s } } ^ { n }$ and $s ^ { - n }$ . This augmentation is especially suitable for efficiently learning the credit function (1) and global Q-function, since $Q ( s , a )$ can be augmented into both $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ and $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ , as explained below.
+
+
+Figure 1: In Stage 1, $Q ^ { 1 }$ and $\pi ^ { 1 }$ learn to achieve multiple goals in a single-agent environment. Between Stage 1 and 2, $\pi$ is constructed from the trained $\pi ^ { 1 }$ and a new module $\overline { { \pi } } ^ { 2 }$ according to ( same construction is done for $Q _ { n } ( s , \mathbf { a } )$ and $Q _ { n } ( s , a ^ { m } )$ , not shown). In the multi-agent environment of Stage 2, these augmented functions are instantiated for each of $N$ agents (with parameter-sharing).
+
+# 4.5 A COMPLETE INSTANTIATION OF CM3
+
+We combine the preceding components to create CM3, using deep neural networks for function approximation (Figure 1 and Algorithm 1). Without loss of generality, we assume parameter-sharing (Foerster et al., 2018) among homogeneous agents with goals as input (Schaul et al., 2015). The inhomogeneous case can be addressed by $N$ actor-critics. Drawing from multi-task learning (Taylor and Stone, 2009), we sample goal(s) in each episode for the agent(s), to train one model for all goals.
+
+Stage 1. We train an actor $\pi ^ { 1 } ( a | o , g )$ and critic $Q ^ { 1 } ( s ^ { 1 } , a , g )$ to convergence according to (4) and (5) in the induced MDP with $N = 1$ and random goal sampling (see Appendix J). This uses orders of magnitude fewer samples than for the full multi-agent environment—compare Figure 6 with Figure 5.
+
+Stage 2. The Markov game is instantiated with all $N$ agents. We restore the trained $\pi ^ { 1 }$ parameters, instantiate a second neural network $\pi ^ { 2 }$ for agents to process $o _ { \mathrm { o t h e r s } } ^ { n }$ , and connect the output of $\pi ^ { 2 }$ to a selected hidden layer of $\pi ^ { 1 }$ . Concretely, let $h _ { i } ^ { \bar { 1 } } \in \mathbb { R } ^ { m _ { i } }$ denote hidden layer $i \leq L$ with $m _ { i }$ units in an $L$ - layer network $\pi ^ { 1 }$ , connected to layer $i - 1$ via $h _ { i } ^ { 1 } = f ( W _ { i } ^ { 1 } h _ { i - 1 } ^ { 1 } )$ with $W _ { i } ^ { 1 } \in \mathbb { R } ^ { m _ { i } \times m _ { i - 1 } }$ and nonlinear activation $f$ . Stage 2 introduces a $K$ -layer network $\pi ^ { 2 } ( o _ { \mathrm { o t h e r s } } ^ { n } )$ with outputs $h _ { K } ^ { 2 } \in \mathbb { R } ^ { m _ { K } }$ , chooses a layer4 $i ^ { * }$ of $\pi ^ { 1 }$ , and augments $h _ { i ^ { * } } ^ { 1 }$ to be $h _ { i ^ { * } } ^ { 1 } = f ( W _ { i ^ { * } } ^ { 1 } h _ { i ^ { * } - 1 } ^ { 1 } + W ^ { 1 : 2 } h _ { K } ^ { 2 } )$ with $W ^ { 1 : 2 } \in \mathbb { R } ^ { m _ { i ^ { * } } \times m _ { K } }$ . Being restored from Stage 1, not re-initialized, hidden layers $i < i ^ { * }$ begin with the ability to process $( o _ { \mathrm { s e l f } } ^ { n } , g ^ { n } )$ , while the new weights in $\pi ^ { 2 }$ and $W ^ { 1 : 2 }$ specifically learn the effect of surrounding agents. Higher layers $i \geq i ^ { * }$ that already take greedy actions to achieve goals in Stage 1 must now do so while cooperating to allow other agents’ success. This augmentation scheme is simplest for deep policy and value networks using fully-connected or convolutional layers.
+
+The middle panel of Figure 1 depicts the construction of $\pi$ from $\pi ^ { 1 }$ and $\pi ^ { 2 }$ . The global $Q ^ { \pi } ( s , \mathbf { a } , g ^ { n } )$ is constructed from $Q ^ { \bar { 1 } }$ similarly: when the input to $Q ^ { 1 }$ is $( s _ { \mathrm { e n v } } , s ^ { n } , a ^ { n } , g ^ { n } )$ , a new module takes input $( s ^ { - n } , a ^ { - n } )$ and connects to a chosen hidden layer of $Q ^ { 1 }$ . Credit function $Q ^ { \pi } ( s , a ^ { m } , g ^ { n } )$ is augmented from a copy of $Q ^ { 1 }$ , such that when $Q ^ { 1 }$ inputs are $( s _ { \mathrm { e n v } } , s ^ { n } , a ^ { m } , g ^ { n } )$ , the new module’s inputs are $\left( { s ^ { m } , s ^ { - n } } \right)$ .5 We train the policy using (5), train the credit function with loss (4), and train the global Q-function with the joint-action analogue of (4).
+
+
+
+
+Figure 2: Checkers
+Figure 3: Cooperative navigation
+Figure 4: Agent sedans must perform double lane merge to reach goal lanes. SUMO controls yellow sedans and trucks. Policy generalization was tested on such traffic conditions.
+
+
+
+# 5 EXPERIMENTAL SETUP
+
+We investigated the performance and robustness of CM3 versus existing methods on diverse and challenging multi-goal MARL environments: cooperative navigation in difficult formations, double lane merge in autonomous driving, and strategic cooperation in a Checkers game. We evaluated ablations of CM3 on all domains. We describe key setup here, with full details in Appendices $\mathbf { G }$ to $\mathrm { J } ^ { 6 }$ .
+
+Cooperative navigation: We created three variants of the cooperative navigation scenario in Lowe et al. (2017), where $N$ agents cooperate to reach a set of targets. We increased the difficulty by giving each agent only an individual reward based on distance to its designated target, not a global team reward, but initial and target positions require complex cooperative maneuvers to avoid collision penalties (Figure 3). Agents observe relative positions and velocities (details in Appendix G.1). SUMO: Previous work modeled autonomous driving tasks as MDPs in which all other vehicles do not learn to respond to a single learning agent (Isele et al., 2018; Kuefler et al., 2017). However, real-world driving requires cooperation among different drivers’ with personal goals. Built in the SUMO traffic simulator with sublane resolution (Lopez et al., 2018), this experiment requires agent vehicles to learn double-merge maneuvers to reach goal lane assignments (Figure 4). Agents have limited field of view and receive sparse rewards (Appendix G.2). Checkers: We implemented a challenging strategic game (Appendix G.3, an extension of Sunehag et al. (2018)), to investigate whether CM3 is beneficial even when an agent cannot maximize its reward in the absence of another agent. In a gridworld with red and yellow squares that disappear when collected (Figure 2), Agent A receives $+ 1$ for red and -0.5 for yellow; Agent B receives -0.5 for red and $+ 1$ for yellow. Both have a limited 5x5 field of view. The global optimum requires each agent to clear the path for the other.
+
+Algorithm implementations. We describe key points here, leaving complete architecture details and hyperparameter tables to Appendices H and I. CM3: Stage 1 is defined for each environment as follows (Appendix G): in cooperative navigation, a single particle learns to reach any specified landmark; in SUMO, a car learns to reach any specified goal lane; in Checkers, we alternate between training one agent as A and B. Appendix $_ \mathrm { H }$ describes function augmentation in Stage 2 of CM3. COMA (Foerster et al., 2018): the joint goal $\mathbf { g }$ and total reward $\textstyle \sum _ { n } R ^ { n }$ can be used to train COMA’s global $Q$ function, which receives input $( s , o ^ { n } , g ^ { n } , n , a ^ { - n } , g ^ { - n } )$ . Each output node represents $Q ( s , a ^ { n } = i , a ^ { - n } , \mathbf { g } )$ . IAC (Tan, 1993; Foerster et al., 2018): IAC trains each agent’s actor and critic independently, using the agent’s own observation. The TD error of value function $V ( o ^ { n } , g ^ { n } )$ is used in a standard policy gradient (Sutton et al., 2000). QMIX (Rashid et al., 2018): we used the original hypernetwork, giving all goals to the mixer and individual goals to each agent network. We used a manual coordinate descent on exploration and learning rate hyperparameters, including values reported in the original works. We ensured the number of trainable parameters are similar among all methods, up to method-specific architecture requirements for COMA and QMIX.
+
+
+Figure 5: a-e: Comparison against baselines in cooperative navigation (a-c), SUMO (d), Checkers (e). f-j: Comparison against ablations. Average and standard deviation (shaded) of 10 evaluation episodes conducted every 100 training episodes, across 3 independent runs.
+
+Ablations. We conducted ablation experiments in all domains. To discover the speedup from the curriculum with function augmentation, we trained the full Stage 2 architecture of CM3 (labeled as Direct) without first training components $\pi ^ { 1 }$ and $Q ^ { 1 }$ in an induced MDP. To investigate the benefit of the new credit function and multi-goal policy gradient, we trained an ablation (labeled QV) with advantage function $A _ { n } ^ { \pi } ( s , \mathbf { a } ) : = Q _ { n } ^ { \pi } ( s , \mathbf { a } ) - V _ { n } ^ { \pi } ( s )$ , where credit assignment between action-goal pairs is lost. QV uses the same $\pi ^ { 1 }$ , $Q ^ { 1 }$ , and function augmentation as CM3.
+
+# 6 RESULTS AND DISCUSSIONS
+
+CM3 finds optimal or near-optimal policies significantly faster than IAC and COMA on all domains, and performs significantly higher than QMIX in four out of five. We report absolute runtime in Appendix F and account for CM3’s Stage 1 episodes (Appendix J) when comparing sample efficiency.
+
+Main comparison. Over all cooperative navigation scenarios (Figures 5a to 5c), CM3 (with 1k episodes in Stage 1) converged more than $1 5 \mathrm { k }$ episodes faster than IAC. IAC reached the same final performance as CM3 because dense individual rewards simplifies the learning problem for IAC’s fully decentralized approach, but CM3 benefited significantly from curriculum learning, as evidenced by comparison to “Direct” in Figure 5f. QMIX and COMA settled at suboptimal behavior. Both learn global critics that use all goals as input, in contrast to CM3 and IAC that process each goal separately. This indicates the difficulty of training agents for individual goals under a purely global approach. While COMA was shown to outperform IAC in SC2 micromanagement where IAC must learn from a single team reward (Foerster et al., 2018), our IAC agents have access to individual rewards that resolve the credit assignment issue and improve performance (Singh et al., 2019). In SUMO (Figure 5d), CM3 and QMIX found cooperative solutions with performances within the margin of error, while COMA and IAC could not break out of local optima where vehicles move straight but do not perform merge maneuvers. Since initial states force agents into the region of state space requiring cooperation, credit assignment rather than exploration is the dominant challenge, which CM3 addressed via the credit function, as evidenced in Figure 5i. IAC underperformed because SUMO requires a longer sequence of cooperative actions and gave much sparser rewards than the “Merge” scenario in cooperative navigation. We also show that centralized training of merely two decentralized agents allows them to generalize to settings with much heavier traffic (Appendix E). In Checkers (Figure 5e), CM3 (with $5 \mathrm { k }$ episodes in Stage 1) converged $1 0 \mathrm { k }$ episodes faster than COMA and QMIX to the global optimum with score 24. Both exploration of the combinatorially large joint trajectory space and credit assignment for path clearing are challenges that CM3 successfully addressed. COMA only solved Checkers among all domains, possibly because the small bounded environment alleviates COMA’s difficulty with individual goals in large state spaces. IAC underperformed all centralized learning methods because cooperative actions that give no instantaneous reward are hard for selfish agents to discover in Checkers. These results demonstrate CM3’s ability to attain individual goals and find cooperative solutions in diverse multi-agent systems.
+
+Ablations. The significantly better performance of CM3 versus “Direct” (Figures 5f to 5j) shows that learning individual goal attainment prior to learning multi-agent cooperation, and initializing Stage 2 with Stage 1 parameters, are crucial for improving learning speed and stability. It gives evidence that while global action-value and credit functions may be difficult to train from scratch, function augmentation significantly eases the learning problem. While “QV” initially learns quickly to attain individual goals, it does so at the cost of frequent collisions, higher variance, and inability to maintain a cooperative solution, giving clear evidence for the necessity of the credit function.
+
+# 7 CONCLUSION
+
+We presented CM3, a general framework for cooperative multi-goal MARL. CM3 addresses the need for efficient exploration to learn both individual goal attainment and cooperation, via a two-stage curriculum bridged by function augmentation. It achieves local credit assignment between action and goals using a credit function in a multi-goal policy gradient. In diverse experimental domains, CM3 attains significantly higher performance, faster learning, and overall robustness than existing MARL methods, displaying strengths of both independent learning and centralized credit assignment while avoiding shortcomings of existing methods. Ablations demonstrate each component is crucial to the whole framework. Our results motivate future work on analyzing CM3’s theoretical properties and generalizing to inhomogeneous systems or settings without known goal assignments.
+
+# ACKNOWLEDGMENTS
+
+JY thanks Rakshit Trivedi (Georgia Institute of Technology), Ahmad Beirami (Facebook AI), and Peter Sunehag (DeepMind) for detailed and helpful feedback on this work.
+
+# REFERENCES
+
+Austerweil, J. L., Brawner, S., Greenwald, A., Hilliard, E., Ho, M., Littman, M. L., MacGlashan, J., and Trimbach, C. (2016). How other-regarding preferences can promote cooperation in nonzero-sum grid games. In Proceedings of the AAAI Symposium on Challenges and Opportunities in Multiagent Learning for the Real World.
+Bansal, T., Pachocki, J., Sidor, S., Sutskever, I., and Mordatch, I. (2018). Emergent complexity via multi-agent competition. In International Conference on Learning Representations.
+Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48. ACM.
+Bhattacharya, S., Likhachev, M., and Kumar, V. (2010). Multi-agent path planning with multiple tasks and distance constraints. In Robotics and Automation (ICRA), 2010 IEEE International Conference on, pages 953–959. IEEE.
+Blizzard Entertainment (2019). Starcraft ii. https://starcraft2.com/en-us/, Last accessed on 2019-09-07.
+Cao, Y., Yu, W., Ren, W., and Chen, G. (2013). An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics, 9(1), 427–438.
+Carion, N., Synnaeve, G., Lazaric, A., and Usunier, N. (2019). A structured prediction approach for generalization in cooperative multi-agent reinforcement learning. In Advances in neural information processing systems.
+Chang, Y.-H., Ho, T., and Kaelbling, L. P. (2004). All learning is local: Multi-agent learning in global reward games. In Advances in neural information processing systems, pages 807–814.
+Foerster, J. N., Farquhar, G., Afouras, T., Nardelli, N., and Whiteson, S. (2018). Counterfactual multi-agent policy gradients. In Thirty-Second AAAI Conference on Artificial Intelligence.
+Gupta, J. K., Egorov, M., and Kochenderfer, M. (2017). Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pages 66–83. Springer.
+
+Hernandez-Leal, P., Kartal, B., and Taylor, M. E. (2018). Is multiagent deep reinforcement learning the answer or the question? a brief survey. arXiv preprint arXiv:1810.05587.
+
+Hu, J. and Wellman, M. P. (2003). Nash q-learning for general-sum stochastic games. Journal of machine learning research, 4(Nov), 1039–1069.
+
+Isele, D., Rahimi, R., Cosgun, A., Subramanian, K., and Fujimura, K. (2018). Navigating occluded intersections with autonomous vehicles using deep reinforcement learning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 2034–2039. IEEE.
+
+Jaderberg, M., Czarnecki, W. M., Dunning, I., Marris, L., Lever, G., Castaneda, A. G., Beattie, C., Rabinowitz, N. C., Morcos, A. S., Ruderman, A., et al. (2019). Human-level performance in 3d multiplayer games with population-based reinforcement learning. Science, 364(6443), 859.
+
+Kuefler, A., Morton, J., Wheeler, T., and Kochenderfer, M. (2017). Imitating driver behavior with generative adversarial networks. In 2017 IEEE Intelligent Vehicles Symposium (IV), pages 204–211. IEEE.
+
+Li, S., Wu, Y., Cui, X., Dong, H., Fang, F., and Russell, S. (2019). Robust multi-agent reinforcement learning via minimax deep deterministic policy gradient. In AAAI Conference on Artificial Intelligence (AAAI).
+
+Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D., and Wierstra, D. (2016). Continuous control with deep reinforcement learning. In International Conference on Learning Representations.
+
+Lin, K., Zhao, R., Xu, Z., and Zhou, J. (2018). Efficient large-scale fleet management via multi-agent deep reinforcement learning. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1774–1783. ACM.
+
+Littman, M. L. (1994). Markov games as a framework for multi-agent reinforcement learning. In Machine Learning Proceedings 1994, pages 157–163. Elsevier.
+
+Liu, S., Lever, G., Merel, J., Tunyasuvunakool, S., Heess, N., and Graepel, T. (2019). Emergent coordination through competition. In International Conference on Learning Representations.
+
+Lopez, P. A., Behrisch, M., Bieker-Walz, L., Erdmann, J., Flötteröd, Y.-P., Hilbrich, R., Lücken, L., Rummel, J., Wagner, P., and Wießner, E. (2018). Microscopic traffic simulation using SUMO. In The 21st IEEE International Conference on Intelligent Transportation Systems. IEEE.
+
+Lowe, R., Wu, Y., Tamar, A., Harb, J., Abbeel, O. P., and Mordatch, I. (2017). Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pages 6382–6393.
+
+Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. (2015). Human-level control through deep reinforcement learning. Nature, 518(7540), 529.
+
+Mordatch, I. and Abbeel, P. (2018). Emergence of grounded compositional language in multi-agent populations. In Thirty-Second AAAI Conference on Artificial Intelligence.
+
+Nguyen, D. T., Kumar, A., and Lau, H. C. (2018). Credit assignment for collective multiagent rl with global rewards. In Advances in Neural Information Processing Systems, pages 8112–8123.
+
+Oliehoek, F. A., Spaan, M. T., and Vlassis, N. (2008). Optimal and approximate q-value functions for decentralized pomdps. Journal of Artificial Intelligence Research, 32, 289–353.
+
+Omidshafiei, S., Pazis, J., Amato, C., How, J. P., and Vian, J. (2017). Deep decentralized multi-task multi-agent reinforcement learning under partial observability. In International Conference on Machine Learning, pages 2681–2690.
+
+Pan, S. J. and Yang, Q. (2010). A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10), 1345–1359.
+
+Panait, L. and Luke, S. (2005). Cooperative multi-agent learning: The state of the art. Autonomous agents and multi-agent systems, 11(3), 387–434.
+
+Pynadath, D. V. and Tambe, M. (2002). The communicative multiagent team decision problem: Analyzing teamwork theories and models. Journal of artificial intelligence research, 16, 389–423.
+
+Rashid, T., Samvelyan, M., Schroeder, C., Farquhar, G., Foerster, J., and Whiteson, S. (2018). QMIX: Monotonic value function factorisation for deep multi-agent reinforcement learning. In Proceedings of the 35th International Conference on Machine Learning, pages 4295–4304.
+
+Rusu, A. A., Rabinowitz, N. C., Desjardins, G., Soyer, H., Kirkpatrick, J., Kavukcuoglu, K., Pascanu, R., and Hadsell, R. (2016). Progressive neural networks. arXiv preprint arXiv:1606.04671.
+
+Schaul, T., Horgan, D., Gregor, K., and Silver, D. (2015). Universal value function approximators. In International Conference on Machine Learning, pages 1312–1320.
+
+Shoham, Y., Powers, R., and Grenager, T. (2003). Multi-agent reinforcement learning: a critical survey. Technical report, Technical report, Stanford University.
+
+Shu, T. and Tian, Y. (2019). M3rl: Mind-aware multi-agent management reinforcement learning. In International Conference on Learning Representations.
+
+Silver, D., Lever, G., Heess, N., Degris, T., Wierstra, D., and Riedmiller, M. (2014). Deterministic policy gradient algorithms. In ICML.
+
+Singh, A., Jain, T., and Sukhbaatar, S. (2019). Learning when to communicate at scale in multiagent cooperative and competitive tasks. In International Conference on Learning Representations.
+
+Son, K., Kim, D., Kang, W. J., Hostallero, D., and Yi, Y. (2019). Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning.
+
+Srinivasan, S., Lanctot, M., Zambaldi, V., Pérolat, J., Tuyls, K., Munos, R., and Bowling, M. (2018). Actor-critic policy optimization in partially observable multiagent environments. In Advances in Neural Information Processing Systems, pages 3426–3439.
+
+Stone, P. and Veloso, M. (2000). Multiagent systems: A survey from a machine learning perspective. Autonomous Robots, 8(3), 345–383.
+
+Sukhbaatar, S., Fergus, R., et al. (2016). Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems, pages 2244–2252.
+
+Sunehag, P., Lever, G., Gruslys, A., Czarnecki, W. M., Zambaldi, V., Jaderberg, M., Lanctot, M., Sonnerat, N., Leibo, J. Z., Tuyls, K., et al. (2018). Value-decomposition networks for cooperative multi-agent learning based on team reward. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pages 2085–2087. International Foundation for Autonomous Agents and Multiagent Systems.
+
+Sutton, R. S., Precup, D., and Singh, S. (1999). Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2), 181–211.
+
+Sutton, R. S., McAllester, D. A., Singh, S. P., and Mansour, Y. (2000). Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pages 1057–1063.
+
+Tampuu, A., Matiisen, T., Kodelja, D., Kuzovkin, I., Korjus, K., Aru, J., Aru, J., and Vicente, R. (2017). Multiagent cooperation and competition with deep reinforcement learning. PloS one, 12(4), e0172395.
+
+Tan, M. (1993). Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pages 330–337.
+
+Taylor, M. E. and Stone, P. (2009). Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10(Jul), 1633–1685.
+
+Thrun, S. B. (1992). Efficient exploration in reinforcement learning. Technical report, Carnegie Mellon University, Pittsburgh, PA, USA.
+Van Lange, P. A., Joireman, J., Parks, C. D., and Van Dijk, E. (2013). The psychology of social dilemmas: A review. Organizational Behavior and Human Decision Processes, 120(2), 125–141.
+Vezhnevets, A. S., Osindero, S., Schaul, T., Heess, N., Jaderberg, M., Silver, D., and Kavukcuoglu, K. (2017). Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 3540–3549. JMLR. org.
+Wu, C., Rajeswaran, A., Duan, Y., Kumar, V., Bayen, A. M., Kakade, S., Mordatch, I., and Abbeel, P. (2018). Variance reduction for policy gradient with action-dependent factorized baselines. In International Conference on Learning Representations.
+Zhang, K., Yang, Z., Liu, H., Zhang, T., and Basar, T. (2018). Fully decentralized multi-agent reinforcement learning with networked agents. In Proceedings of the 35th International Conference on Machine Learning, pages 5872–5881.
+Zhang, Z., Yang, J., and Zha, H. (2019). Integrating independent and centralized multi-agent reinforcement learning for traffic signal network optimization. arXiv preprint arXiv:1909.10651.
+
+Algorithm 1 Cooperative multi-goal multi-stage multi-agent reinforcement learning (CM3)
+
+
1: for curriculum stage c = 1 to 2 do
2:
if c=1 then
3:
Set number of agents N = 1
4:
Initialize Stage 1 main networks Qg := Q = Q1,π := π1 with parameters 0Q1,0π1
5:
Initialize target networks with 0'π1, 0Q1
6:
else if c= 2 then
7:
Instantiate N >1 agents
8:
Construct global Qg := Qπ(s,a) = {Q1,Q²},credit function Qc := Qπ(s,am) =
{Q1,Q²} and π := {π1,π²} using function augmentation with parameters 0Qg,0Q.,0π
9:
Initialize target networks with 0Q,0Q,0
10:
Restore values of trained parameters 0Q1,0π1 into the respective subsets of 0Qg, 0Qc, 0π
11:
end if
12:
Set all target network weights to equal main networks weights
13:
Initialize exploration parameter é =_ Estart and empty replay buffer B
14:
for each training episode e = 1 to E do
15:
Assign goal(s) g to agent(s) according to given distribution
16:
Get initial state S1 and observation(s) 01
17:
fort=1 to T do// execute policies in environment
18:
Sample action at ~ π(atlo;0π,∈) for each agent.
19:
Execute action(s) at,receive {rn}n, St+1,and Ot+1
20:
Store(St,Ot,ge,at,{r}n,Rg,St+1,Ot+1) into B
21:
St ← St+1,Ot ←Ot+1
22: 23:
end for
if e mod Etrain = O then
24:
for epochs 1...K do// conduct training
25:
Sample minibatch of S transitions (Si,Oi, gi, ai,{r²}n, Si+1,Oi+1) from B
26:
Compute global target for all n: xn = r + γQ(Si+1, ai+1, g²;0Qg)lai+1~π'
+
+Off-policy training with a large replay buffer allows RL algorithms to benefit from less correlated transitions (Silver et al., 2014; Lillicrap et al., 2016). The algorithmic modification for off-policy training is to maintain a circular replay buffer that does not reset (i.e. remove line 38), and conduct training (lines 24-41) while executing policies in the environment (lines 17-22). Despite introducing bias in MARL, we found that off-policy training benefited CM3 in SUMO and Checkers.
+
+# B DERIVATIONS
+
+# B.1 PROPOSITION 1
+
+By stationarity and relabeling $t$ , the credit function can be written:
+
+$$
+\partial _ { n } ^ { \pi } ( s , a ^ { m } ) : = \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R ( s _ { t } , \mathbf { a } _ { t } , g ^ { n } ) \ \middle | \ s _ { 0 } = s , a _ { 0 } ^ { m } = a ^ { m } \right] = \mathbb { E } _ { \pi } \left[ \sum _ { t = 1 } ^ { \infty } \gamma ^ { t - 1 } R ( s _ { t } , \mathbf { a } _ { t } , g ^ { n } ) \ \middle | \ s _ { 1 } = s , a _ { 1 } ^ { m } = s , a _ { 2 } ^ { m } = a ^ { m } \right]
+$$
+
+Using the law of iterated expectation, the credit function satisfies the Bellman expectation equation (2):
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { \hat { \mathbf { x } } } ^ { ( 1 ) } ( \mathbf { x } , \mathbf { x } ^ { * } ) - \boldsymbol { \epsilon } _ { \hat { \mathbf { x } } } ^ { ( 2 ) } \frac { \mathcal { S } } { \epsilon _ { \hat { \mathbf { x } } } ^ { ( 3 ) } } \mathcal { S } ( \hat { \mathbf { x } } , \mathbf { x } , \theta ^ { * } ) ^ { 2 } \quad \forall \boldsymbol { \mathcal { S } } _ { \hat { \mathbf { x } } } - \boldsymbol { \mathcal { S } } _ { \hat { \mathbf { x } } } \boldsymbol { \mathcal { S } } _ { \hat { \mathbf { x } } } ^ { ( 5 ) } = \boldsymbol { \mathcal { M } } ^ { * } \bigg ] } \\ & { = - \mathbf { E } _ { \hat { \mathbf { x } } } \Bigg [ \prod ( \hat { \mathbf { x } } ) \alpha _ { \hat { \mathbf { x } } } \hat { \mathbf { x } } ^ { ( 3 ) } \boldsymbol { \mathcal { S } } \Bigg ] + \frac { \mathcal { S } } { \epsilon _ { \hat { \mathbf { x } } } ^ { ( 3 ) } } \frac { \mathcal { S } } { \epsilon _ { \hat { \mathbf { x } } } ^ { ( 4 ) } } \mathbb { E } ( \hat { \mathbf { x } } , \theta _ { 0 } , \boldsymbol { \mathcal { S } } _ { \hat { \mathbf { x } } } ^ { ( 5 ) } \Bigg ] \cdot \boldsymbol { \hat { \mathbf { x } } } _ { \hat { \mathbf { x } } } - \boldsymbol { \hat { \mathbf { x } } } _ { \hat { \mathbf { x } } } \hat { \mathbf { x } } _ { \hat { \mathbf { x } } } ^ { ( 5 ) } = \boldsymbol { \mathcal { B } } ^ { * } \Bigg ] } \\ & = \mathbf { E } _ { \hat { \mathbf { x } } , \hat { \mathbf { x } } ^ { * } } \Bigg [ \exp \Bigg [ \mathrm { i } \Bigg [ \prod ( \hat { \mathbf { x } } ) \alpha _ { \hat { \mathbf { x } } } \hat { \mathbf { x } } _ { \hat { \mathbf { x } } } ^ { ( 2 ) } \Bigg ] + \sum _ { \hat { \mathbf { x } } ^ { \prime } } ^ { \infty } \Bigg [ \prod ( \hat { \mathbf { x } } ) \alpha _ { \hat { \mathbf { x } } } \hat { \mathbf { x } } _ { \hat { \mathbf { x } } ^ { \prime } } \Bigg ] \cdot \boldsymbol { \hat { \mathbf { x } } } _ { \hat { \mathbf { x } } } ^ { ( 3 ) } \Bigg ] \cdot \boldsymbol { \hat { \mathbf { x } } } \\ & \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \quad + \mathbb { E } _ { x } \cdot \frac { \sum _ { i = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } { \sum _ { j = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } \Bigg [ \ln _ { i } \left( \theta _ { i } - \theta _ { i } ^ { n } \right) - \exp ^ { - \alpha \epsilon } - \alpha ^ { \alpha \epsilon } - \alpha ^ { \alpha \epsilon } - \mathcal { E } _ { i } ^ { n } \Bigg ( \frac { \theta _ { i } ^ { n } } { \epsilon } - \alpha ^ { \alpha \epsilon } - \alpha ^ { \alpha \epsilon } \Bigg ) \Bigg ] \ , \ \kappa _ { 1 } = - \kappa _ { 2 } \times \beta - \alpha ^ { \alpha } } \\ & { = \frac { \sum _ { i = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } { \sum _ { j = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } \Bigg [ \exp ^ { - \alpha \epsilon } - \gamma _ { i } \Bigg ( \theta _ { i } ^ { n } \exp ^ { - \alpha \epsilon } - \alpha ^ { \alpha \epsilon } \Bigg ) \Bigg ] \ , \quad \kappa _ { 2 } = - \kappa _ { 2 } \times \beta - \kappa _ { 1 } = - \kappa _ { 2 } ^ { \alpha \epsilon } } \\ & { \quad + \mathbb { E } _ { x } \Bigg ( \alpha ^ { \alpha } - \alpha ^ { \alpha } - \kappa _ { 1 } \Bigg [ \exp ^ { - \alpha \epsilon } - \gamma _ { 1 } \Bigg ( \theta _ { i } ^ { n } \exp ^ { - \alpha \epsilon } - \alpha ^ { \alpha \epsilon } \Bigg ) \Bigg ] \ \Bigg ) \ , \ \kappa _ { 3 } = - \kappa _ { 2 } \times \alpha ^ { \alpha } - \kappa _ { 1 } - \beta \exp ^ { - \alpha \epsilon } - \alpha ^ { \alpha } \Bigg ] \ \ \sin ^ { \alpha - \alpha } } \\ & { = \frac { \sum _ { i = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } { \sum _ { j = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } \Bigg [ \exp ^ { - \alpha \epsilon } - \gamma _ { 1 } \Bigg ( \theta _ { i } ^ { \alpha } - \alpha ^ { \alpha } - \alpha ^ { \alpha } - \beta \exp ^ { - \alpha \epsilon } - \alpha ^ { \alpha } \Bigg ) \Bigg ] \ , \quad \kappa _ { 2 } = \kappa _ { 2 } \times \beta - \kappa _ { 1 } } \\ & \quad + \frac { \sum _ { i = 1 } ^ { n } \mathcal { E } _ { i } ^ { n } } \sum \end{array}
+$$
+
+The goal-specific joint value function is the marginal of the credit function:
+
+$$
+\begin{array} { c } { { V _ { n } ^ { \pi } ( s ) = \mathbb { E } _ { \pi } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R ( s _ { t } , { \mathbf a } _ { t } , g ^ { n } ) \mid s _ { 0 } = s \right] } } \\ { { { } } } \\ { { = \mathbb { E } _ { a _ { 0 } ^ { m } \mid s _ { 0 } , \pi } \left[ \mathbb { E } _ { \pi } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R ( s _ { t } , { \mathbf a } _ { t } , g ^ { n } ) \mid s _ { 0 } = s , a _ { 0 } ^ { m } = a ^ { m } \right] \Bigm | s _ { 0 } = s \right] } } \\ { { { } } } \\ { { { } = \displaystyle \sum _ { a ^ { m } } \pi ( a ^ { m } | o ^ { m } ( s ) , g ^ { m } ) Q _ { n } ^ { \pi } ( s , a ^ { m } ) } } \end{array}
+$$
+
+The credit function can be expressed in terms of the goal-specific action-value function:
+
+$$
+\begin{array} { c } { { { \displaystyle V _ { n } ^ { \pi } ( s ) = \sum _ { a ^ { \prime \prime } } \pi ( a ^ { \prime \prime } \vert o ^ { m } , g ^ { m } ) Q _ { n } ^ { \pi } ( s , a ^ { m } ) } } } \\ { { { \displaystyle V _ { n } ^ { \pi } ( s ) = \sum _ { \bf a } \pi ( { \bf a } \vert s , { \bf g } ) Q _ { n } ^ { \pi } ( s , { \bf a } ) } } } \\ { { { \displaystyle = \sum _ { a ^ { \prime \prime } } \sum _ { a ^ { - \prime \prime } } \pi ( a ^ { m } \vert o ^ { m } , g ^ { m } ) \pi ( a ^ { - m } \vert s , g ^ { - m } ) Q _ { n } ^ { \pi } ( s , ( a ^ { m } , a ^ { - m } ) ) } } } \\ { { { \displaystyle \Rightarrow Q _ { n } ^ { \pi } ( s , a ^ { m } ) = \sum _ { a ^ { - m } } \pi ( a ^ { - m } \vert s , g ^ { - m } ) Q _ { n } ^ { \pi } ( s , { \bf a } ) } } } \end{array}
+$$
+
+# B.2 PROPOSITION 2
+
+First we state some elementary relations between global functions $V _ { n } ^ { \pi } ( s )$ and $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ . These carry over directly from the case of an MDP, by treating the joint policy $\pi$ as as an effective “single-agent” policy and restricting attention to a single goal $g ^ { n }$ (standard derivations are included at the end of this section).
+
+$$
+\begin{array} { c } { { Q _ { n } ^ { \pi } ( s , \mathbf { a } ) = R ( s , \mathbf { a } , g ^ { n } ) + \gamma \displaystyle \sum _ { s ^ { \prime } } P ( s ^ { \prime } | s , \mathbf { a } ) V _ { n } ^ { \pi } ( s ^ { \prime } ) } } \\ { { { \cal V } _ { n } ^ { \pi } ( s ) = \displaystyle \sum _ { \mathbf { a } } \pi ( \mathbf { a } | s , \mathbf { g } ) Q _ { n } ^ { \pi } ( s , \mathbf { a } ) } } \end{array}
+$$
+
+We follow the proof of the policy gradient theorem (Sutton et al., 2000):
+
+$$
+\begin{array} { r l r } { \nabla _ { \phi } V _ { n } ^ { \prime \prime } ( s ) } & { = \nabla _ { s } \sum _ { \phi } \pi ( s | s , \phi , g | ^ { 2 } s , \theta ) , } \\ & { } & { = \displaystyle \sum _ { u = 1 } ^ { N } [ \nabla _ { \phi } \pi ( s , s , \phi ) | Q _ { u } ^ { \top \prime } ( s , a ) + \pi ( s , s , g ) \nabla _ { \phi } Q _ { u } ^ { \top \prime } ( s , a ) } \\ & { } & { \displaystyle - \sum _ { u = 1 } ^ { N } [ \nabla _ { \phi } \pi ( s , s , e ) | Q _ { u } ^ { \top \prime } ( s , a ) + \pi ( s , s , g ) \nabla _ { \phi } \pi ( B _ { u } ^ { \top } , a ) + \gamma \sum _ { u = 1 } ^ { N } P _ { u } ^ { \top \prime } ( s , a ) V _ { n } ^ { \top \prime } ( s ^ { \top } ) } \\ & { } & { \displaystyle - \sum _ { u = 1 } ^ { N } [ \nabla _ { \phi } \pi ( s , s , e ) | Q _ { u } ^ { \top \prime } ( s , a ) + \pi ( s , g ) \mathbb { E } _ { \phi } ^ { \top \prime } \pi } \\ & { } & { \displaystyle - \sum _ { u = 1 } ^ { N } [ \nabla _ { \phi } \pi ( s , s , e ) | Q _ { u } ^ { \top \prime } ( s , a ) + \pi ( s , g ) \mathbb { E } _ { \phi } ^ { \top \prime } \pi } \\ & { } & { \displaystyle - \sum _ { u = 1 } ^ { N } \frac { s } { s } ] \sum _ { u = 1 } ^ { N } \gamma _ { u } \mathcal { E } _ { u } ^ { \top \prime } ( s , a ) , \quad \mathrm { ~ o ~ y ~ } \theta ^ { \top } ( s , a ) \mathrm { ~ ( ~ s ~ p r o s s i v e ~ y r o ~ a n d i n g ) ~ } } \\ & { } & \displaystyle \sum _ { u = 1 } ^ { N } \frac { s } { s } \sum _ { u = 1 } ^ { N } \gamma _ { u } \mathcal { E } _ { u } ^ { \top } ( s , a ) \times ( \nabla _ { \phi } \pi ( s , e ) | Q _ { u } ^ { \top } ( s , a ) | Q _ { u } ^ \top \prime \end{array}
+$$
+
+We can replace $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ by the advantage function $A _ { n } ^ { \pi } ( s , \mathbf { a } ) : = Q _ { n } ^ { \pi } ( s , \mathbf { a } ) - V _ { n } ^ { \pi } ( s )$ , which does not change the expectation in Equation (9) because:
+
+$$
+\begin{array} { l } { { \displaystyle \mathbb { E } _ { \boldsymbol \pi } \left[ \nabla _ { \boldsymbol \theta } \log \boldsymbol \pi ( { \bf a } | s , { \bf g } ) V _ { n } ^ { \boldsymbol \pi } ( s ) \right] = \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) \sum _ { \bf a } \boldsymbol \pi ( { \bf a } | s , { \bf g } ) \nabla _ { \boldsymbol \theta } \log \boldsymbol \pi ( { \bf a } | s , { \bf g } ) V _ { n } ^ { \boldsymbol \pi } ( s ) } } \\ { { \displaystyle \qquad = \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) V _ { n } ^ { \boldsymbol \pi } ( s ) \nabla _ { \boldsymbol \theta } \sum _ { \bf a } \boldsymbol \pi ( { \bf a } | s , { \bf g } ) = 0 } } \end{array}
+$$
+
+So the gradient (9) can be written
+
+$$
+\nabla _ { \theta } J _ { n } ( \pi ) = \mathbb { E } _ { \pi } \Big [ \big ( \nabla _ { \theta } \sum _ { m = 1 } ^ { N } \log \pi ( a ^ { m } | o ^ { m } , g ^ { m } ) \big ) \left( Q _ { n } ^ { \pi } ( s , \mathbf { a } ) - V _ { n } ^ { \pi } ( s ) \right) \Big ]
+$$
+
+Recall that from (3), for any choice of agent label $k \in [ 1 . . N ]$ :
+
+$$
+V _ { n } ^ { \pi } ( s ) = \sum _ { a ^ { k } } \pi ( a ^ { k } | o ^ { k } , g ^ { k } ) Q _ { n } ^ { \pi } ( s , a ^ { k } )
+$$
+
+Then substituting (3) into (10):
+
+$$
+\begin{array} { r l } & { \nabla _ { \theta } J _ { n } ( \boldsymbol { \pi } ) = \mathbb { E } _ { \boldsymbol { \pi } } \left[ \left( \nabla _ { \theta } \displaystyle \sum _ { m = 1 } ^ { N } \log \pi ( a ^ { m } | o ^ { m } , g ^ { m } ) \right) A _ { n , k } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) \right] } \\ & { A _ { n , k } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) : = Q _ { n } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) - \displaystyle \sum _ { \hat { a } ^ { k } } \pi ( \hat { a } ^ { k } | o ^ { k } , g ^ { k } ) Q _ { n } ^ { \boldsymbol { \pi } } ( s , \hat { a } ^ { k } ) } \end{array}
+$$
+
+Now notice that the choice of $k$ in (13) is completely arbitrary, since (3) holds for any $k \in [ 1 . . N ]$ Therefore, it is valid to distribute $A _ { n , k } ^ { \pi } ( s , \mathbf { a } )$ into the summation in (12) using the summation index $m$ instead of $k$ . Further summing (12) over all $n$ , we arrive at the result of Proposition 2:
+
+$$
+\begin{array} { c l } { { } } & { { \displaystyle \nabla _ { \theta } J ( \boldsymbol { \pi } ) = \mathbb { E } _ { \boldsymbol { \pi } } \Big [ \sum _ { m = 1 } ^ { N } \sum _ { n = 1 } ^ { N } \Big ( \nabla _ { \theta } \log \pi ( a ^ { m } | o ^ { m } , g ^ { m } ) \Big ) A _ { n , m } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) \Big ] } } \\ { { } } & { { \displaystyle A _ { n , m } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) : = Q _ { n } ^ { \boldsymbol { \pi } } ( s , \mathbf { a } ) - \sum _ { \hat { a } ^ { m } } \pi ( \hat { a } ^ { m } | o ^ { m } , g ^ { m } ) Q _ { n } ^ { \boldsymbol { \pi } } ( s , \hat { a } ^ { m } ) } } \end{array}
+$$
+
+The relation between $V _ { n } ^ { \pi } ( s )$ and $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ in (7) and (8) are derived as follows:
+
+$$
+\begin{array} { r l } & { \frac { \gamma } { \mu _ { 1 } } ( x _ { 1 } ) = - \mathbb { E } _ { \mu _ { 1 } } \left[ \sum _ { j = 1 } ^ { n } y _ { 1 } ( x _ { 1 } , x _ { j + 1 } , y _ { 1 } ) \right] \left[ \mu _ { 1 } - \lambda _ { 1 } - x _ { 2 } - \lambda _ { 1 } \right] } \\ & { \quad - \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 1 } ( x _ { 1 } , x _ { 1 } ) \right] \left[ \sum _ { j = 1 } ^ { n } y _ { 1 } ( x _ { 1 } , x _ { j } ) \right] \left[ \lambda _ { 1 } - x _ { 2 } - x _ { 1 } \right] } \\ & { \quad - \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 1 } ( x _ { 1 } , x _ { 2 } ) \right] + \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] \left[ \lambda _ { 1 } - x _ { 2 } - x _ { 1 } \right] } \\ & { \quad - \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] + \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 1 } - x _ { 2 } \right] \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] \left[ \mu _ { 1 } - x _ { 2 } \right] \lambda _ { 2 } - \lambda _ { 1 } - x _ { 2 } \right] \left[ \mu _ { 1 } - \lambda _ { 2 } \lambda _ { 1 } \right] } \\ & { \quad - \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 1 } ( x _ { 1 } , x _ { 2 } ) \right] + \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] \mathbb { E } _ { \lambda } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] \left[ \lambda _ { 1 } - x _ { 2 } \right] } \\ & \quad - \mathbb { E } _ { \mu _ { 1 } } \lambda _ { 1 } - x _ { 2 } \lambda _ { 1 } ^ { \prime } + \mathbb { E } _ { \mu _ { 1 } } \left[ \lambda _ { 2 } ( x _ { 1 } , x _ { 2 } ) \right] \mathbb { E } _ { \lambda } \left[ \lambda _ { 1 } ( x _ { 1 } , \end{array}
+$$
+
+# C VARIANCE
+
+C.1 VARIANCE OF COMA GRADIENT.
+
+Let $Q : = Q ^ { \pi } ( s , \mathbf { a } , \mathbf { g } )$ denote the centralized Q function, let $\pi ( a ^ { n } ) : = \pi ( a ^ { n } | o ^ { n } , g ^ { n } ) \quad$ denote a single agent’s policy, and let $\pi ( a ^ { - n } ) : = \pi ( a ^ { - n } | o ^ { - n } , g ^ { - n } ) $ denote the other agents’ joint policy.
+
+In cooperative multi-goal MARL, the direct application of COMA has the following gradient.
+
+$$
+\begin{array} { c } { { \displaystyle \nabla _ { \theta } J = \mathbb E \Big [ \sum _ { n } \nabla _ { \theta } \log \pi ( a ^ { n } | o ^ { n } , g ^ { n } ) \big ( Q - b _ { n } ( s , a ^ { - n } , \mathbf { g } ) \big ) \Big ] } } \\ { { \displaystyle b _ { n } \big ( s , a ^ { - n } , \mathbf { g } \big ) : = \sum _ { \hat { a } ^ { n } } \pi \big ( \hat { a } ^ { n } | o ^ { n } , g ^ { n } \big ) Q ^ { \pi } \big ( s , \hat { a } ^ { n } , a ^ { - n } , \mathbf { g } \big ) } } \end{array}
+$$
+
+Define the following:
+
+$$
+\begin{array} { r l } & { z _ { n } : = \nabla _ { \theta } \log \pi ( a ^ { n } | o ^ { n } , g ^ { n } ) } \\ & { f _ { n } : = \nabla _ { \theta } \log \pi ( a ^ { n } | o ^ { n } , g ^ { n } ) \big ( Q - b _ { n } ( s , a ^ { - n } ) \big ) = z _ { n } \big ( Q - b _ { n } ( s , a ^ { - n } , \mathbf { g } ) \big ) } \end{array}
+$$
+
+Define $\begin{array} { r } { M _ { n m } \ \mathrel { \mathop : } = \ \mathbb { E } _ { \pi } [ f _ { n } ] ^ { T } \mathbb { E } _ { \pi } [ f _ { m } ] } \end{array}$ and let $\begin{array} { r c l } { { M } } & { { : = } } & { { \sum _ { n , m } M _ { n m } } } \end{array}$ . Then we have $\begin{array} { r l } { M _ { n m } } & { { } = } \end{array}$ $\mathbb { E } _ { \pmb { \pi } } [ z _ { n } Q ] ^ { T } \mathbb { E } _ { \pmb { \pi } } [ z _ { m } Q ]$ since
+
+$$
+\begin{array} { l } { { \displaystyle { \mathbb E } _ { \boldsymbol \pi } [ z _ { n } b _ { n } ] = { \mathbb E } _ { \boldsymbol \pi } \Big [ \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) \sum _ { \mathbf { a } } \boldsymbol \pi ( \mathbf a | s , \mathbf g ) \nabla _ { \boldsymbol \theta } \log \boldsymbol \pi ( a ^ { n } | \boldsymbol \sigma ^ { n } , \boldsymbol g ^ { n } ) b _ { n } ( s , a ^ { - n } , \mathbf g ) \Big ] } } \\ { ~ = \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) \sum _ { a ^ { - n } } \boldsymbol \pi ^ { - n } ( a ^ { - n } | \boldsymbol \sigma ^ { - n } , \boldsymbol g ^ { - n } ) \sum _ { a ^ { n } } \boldsymbol \pi ( a ^ { n } | \boldsymbol \sigma ^ { n } , \boldsymbol g ^ { n } ) \nabla _ { \boldsymbol \theta } \log \boldsymbol \pi ( a ^ { n } | \boldsymbol \sigma ^ { n } , \boldsymbol g ^ { n } ) b _ { n } ( s , a ^ { - n } , \mathbf g ) } \\ { ~ = \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) \sum _ { a ^ { - n } } \boldsymbol \pi ^ { - n } ( a ^ { - n } | \boldsymbol \sigma ^ { - n } , \boldsymbol g ^ { - n } ) \sum _ { a ^ { n } } \nabla _ { \boldsymbol \theta } \boldsymbol \pi ( a ^ { n } | \boldsymbol \sigma ^ { n } , \boldsymbol g ^ { n } ) b _ { n } ( s , a ^ { - n } , \mathbf g ) } \\ { ~ = \sum _ { s } \rho ^ { \boldsymbol \pi } ( s ) \sum _ { a ^ { - n } } \boldsymbol \pi ^ { - n } ( a ^ { - n } | \boldsymbol \sigma ^ { - n } , \boldsymbol g ^ { - n } ) b _ { n } ( s , a ^ { - n } , \mathbf g ) \nabla _ { \boldsymbol \theta } \sum _ { a ^ { n } } \boldsymbol \pi ( a ^ { n } | \boldsymbol \sigma ^ { n } , \boldsymbol g ^ { n } ) = \boldsymbol 0 } \end{array}
+$$
+
+Since the COMA gradient is $\mathbb { E } _ { \pi } [ \sum _ { n = 1 } ^ { N } f _ { n } ]$ . its variance can be derived to be (Wu et al., 2018):
+
+$$
+\begin{array} { r l } { { \mathrm { V a r } ( \sum _ { n = 1 } ^ { N } f _ { n } ) = \sum _ { n } \mathbb { E } _ { \boldsymbol \pi } [ z _ { n } ^ { T } z _ { n } Q ^ { 2 } - 2 b _ { n } z _ { n } ^ { T } z _ { n } Q + b _ { n } ^ { 2 } z _ { n } ^ { T } z _ { n } ] } \quad } & { { } } \\ { + \sum _ { n } \sum _ { m \neq n } \mathbb { E } _ { \boldsymbol \pi } [ z _ { n } ^ { T } z _ { m } ( Q - b _ { n } ) ( Q - b _ { m } ) ] - M } \end{array}
+$$
+
+# C.2 VARIANCE OF THE CM3 GRADIENT
+
+For convenience, let $Q _ { n } : = Q _ { n } ^ { \pi } ( s , \mathbf { a } ) = Q ^ { \pi } ( s , \mathbf { a } , g ^ { n } )$ denote the global Q function for goal $g ^ { n }$ , and let $\pi ( a ^ { m } ) : = \pi ( a ^ { m } | o ^ { m } , g ^ { m } )$ . The CM3 gradient can be rewritten as
+
+$$
+\begin{array} { r l } & { \nabla _ { \theta } J ( \pmb { \pi } ) = \mathbb { E } _ { \pmb { \pi } } \Big [ \displaystyle \sum _ { n = 1 } ^ { N } \displaystyle \sum _ { m = 1 } ^ { N } \nabla _ { \theta } \log \pi ( a ^ { m } ) \big ( Q _ { n } - b _ { n m } ( s ) \big ) \Big ] } \\ & { b _ { n m } ( s ) : = \displaystyle \sum _ { \hat { a } ^ { m } } \pi ( \hat { a } ^ { m } ) Q _ { n } ^ { \pmb { \pi } } ( s , \hat { a } ^ { m } ) } \end{array}
+$$
+
+As before, $z _ { m } : = \nabla _ { \boldsymbol { \theta } } \log \pi ( a ^ { m } )$ . Define $h _ { n m } : = z _ { m } ( Q _ { n } - b _ { n m } ( s ) )$ and let $\begin{array} { r } { h _ { n } : = \sum _ { m } h _ { n m } } \end{array}$ . Then the variance is
+
+$$
+\begin{array} { l } { \displaystyle \mathrm { V a r } ( \sum _ { n } h _ { n } ) = \sum _ { n } \mathrm { V a r } ( h _ { n } ) + \sum _ { n } \sum _ { m \neq n } \mathrm { C o v } ( h _ { n } , h _ { m } ) } \\ { \displaystyle = \sum _ { n } \biggl ( \sum _ { m } \mathrm { V a r } ( h _ { n m } ) + \sum _ { m } \sum _ { k \neq m } \mathrm { C o v } ( h _ { n m } , h _ { n k } ) \biggr ) + \sum _ { n } \sum _ { m \neq n } \mathrm { C o v } ( h _ { n } , h _ { m } ) } \end{array}
+$$
+
+# D EXAMPLE OF GREEDY INITIALIZATION FOR MARL EXPLORATION
+
+A greedy initialization can provide significant improvement in multi-agent exploration versus naïve random exploration, as shown by a simple thought experiment. Consider a two-player MG defined by a $4 \times 3$ gridworld with unit actions (up, down, left, right). Agent $A$ starts at (1,2) with goal (4,2), while agent $B$ starts at (4,2) with goal (1,2). The greedy policy for each agent in MG is to move horizontally toward its target, since this is optimal in the induced $\mathbf { M }$ (when the other agent is absent). Case 1: Suppose that for $\epsilon \in ( 0 , 1 )$ , $A$ and $B$ follow greedy policies with probability $1 - \epsilon$ , and take random actions $( p ( a ) = 1 / 4 )$ ) with probability $\epsilon$ . Then the probability of a symmetric optimal trajectory is $P ( \mathrm { c o o p e r a t e } ) = 2 \epsilon ^ { 2 } ( ( 1 - \epsilon ) + \epsilon / 4 ) ^ { 8 }$ . For $\epsilon = 0 . 5$ , $P$ (cooperate) $\approx 0 . 0 1$ . Case 2: If agents execute uniform random exploration, then $P ( { \mathrm { c o o p e r a t e } } ) = 3 . 0 5 { \mathrm { e } } - 5 \ll 0 . 0 1$ .
+
+# E GENERALIZATION
+
+Table 1: Test performance with heavy traffic on difficult initial and goal lanes configurations
+
+
Config
Initial lanes
Goal lanes
CM3
IAC
COMA
C1
[1,2]
[3,0]
16.17
11.40
10.00
C2
Unif. random
Unif. random
14.93
12.20
12.93
C3
[1,2]
[2,1]
15.85
14.32
15.00
C4
[0,1]
[3,2]
16.35
9.73
8.1
+
+We investigated whether policies trained with few agent vehicles $N = 2$ ) on an empty road can generalize to situations with heavy SUMO-controlled traffic. We also tested on initial and goal lane configurations (C3 and C4) which occur with low probability when training with configurations C1 and C2. Table 1 shows the sum of agents’ reward, averaged over 100 test episodes, on these configurations that require cooperation with each other and with minimally-interactive SUMOcontrolled vehicles for success. CM3’s higher performance than IAC and COMA in training is reflected by better generalization performance on these test configurations. There is almost negligible decrase in performance from train Figure 5d to test, giving evidence to our hypothesis that centralized training with few agents is feasible even for deployment in situations with many agents, for certain applications where local interactions are dominant.
+
+# F ABSOLUTE RUNTIME
+
+CM3’s higher sample efficiency does not come at greater computational cost, as all methods’ runtimes are within an order of magnitude of one another. Test times have no significant difference as all neural networks were similar.
+
+Table 2: Absolute training runtime of all algorithms in seconds
+
+
Environment
CM3
IAC
COMA
QMIX
Antipodal
1.1e4±348
0.9e4±20
1.9e4±238
1.0e4±19
Cross
1.9e4±256
1.5e4±26
1.3e4±12
1.1e4±34
Merge
8.5e3±21
6.8e3±105
9.6e3±294
1.2e4±61
SUMO
9.6e3±278
7.0e3±1.5e3
8.7e3±1.3e3
6.3e3±21
Checkers
9.2e3±880
8.5e3±568
7.7e3±2.2e3
11e3±1.4e3
+
+# G ENVIRONMENT DETAILS
+
+The full Markov game for each experimental domain, along with the single-agent MDP induced from the Markov game, are defined in this section. In all domains, each agent’s observation in the Markov game consists of two components, ${ \cal O } _ { \mathrm { s e l f } }$ and $O _ { \mathrm { o t h e r s } }$ . CM3 leverages this decomposition for faster training, while IAC, COMA and QMIX do not.
+
+# G.1 COOPERATIVE NAVIGATION
+
+This domain is adapted from the multi-agent particle environment in Lowe et al. (2017). Movable agents and static landmarks are represented as circular objects located in a 2D unbounded world with real-valued position and velocity. Agents experience contact forces during collisions. A simple model of inertia and friction is involved.
+
+State. The global state vector is the concatenation of all agents’ absolute position $( x , y ) \in \mathbb { R } ^ { 2 }$ and velocity $( v _ { x } , v _ { y } ) \in \mathbb { R } ^ { 2 }$ .
+
+Observation. Each agent’s observation of itself, ${ \cal O } _ { \mathrm { s e l f } }$ , is its own absolute position and velocity. Each agent’s observation of others, $O _ { \mathrm { o t h e r s } }$ , is the concatenation of the relative positions and velocities of all other agents with respect to itself.
+
+Actions. Agents take actions from the discrete set do nothing, up, down, left, right, where the movement actions produce an instantaneous velocity (with inertia effects).
+
+Goals and initial state assignment. With probability 0.2, landmarks are given uniform random locations in the set $( - 1 , 1 ) ^ { 2 }$ , and agents are assigned initial positions uniformly at random within the set $( - 1 , 1 ) ^ { 2 }$ . With probability 0.8, they are predefined as follows (see Figure 3). In “Antipodal”, landmarks for agents 1 to 4 have $( x , y )$ coordinates [(0.9,0.9), (-0.9,-0.9), (0.9,-0.9), (-0.9,0.9)], while agents 1 to 4 are placed at [(-0.9,-0.9), (0.9,0.9), (-0.9,0.9), (0.9,-0.9)]. In “Intersection”, landmark coordinates are [(0.9,-0.15), (-0.9,0.15), (0.15,0.9), (-0.15,-0.9)], while agents are placed at [(-0.9,- 0.15), (0.9,0.15), (0.15,-0.9), (-0.15,0.9)]. In “Merge”, landmark coordinates are [(0.9,-0.2), (0.9,0.2)], while agents are [(-0.9,0.2), (-0.9,-0.2)]. Each agent’s goal is the assigned landmark position vector.
+
+Reward. At each time step, each agent’s individual reward is the negative distance between its position and the position of its assigned landmark. If a collision occurs between any pair of agents, both agents receive an additional -1 penalty. A collision occurs when two agents’ distance is less than the sum of their radius.
+
+Termination. Episode terminates when all agents are less than 0.05 distance from assigned landmarks.
+
+Induced MDP. This is the $N = 1$ case of the Markov game, used by Stage 1 of CM3. The single agent only receives ${ \cal O } _ { \mathrm { s e l f } }$ . In each episode, its initial position and the assigned landmark’s initial position are both uniform randomly chosen from $( - 1 , \bar { 1 } ) ^ { 2 }$ .
+
+# G.2 SUMO
+
+We constructed a straight road of total length $2 0 0 \mathrm { m }$ and width $1 2 . 8 \mathrm { m }$ , consisting of four lanes. All lanes have width $3 . 2 \mathrm { m }$ , and vehicles can be aligned along any of four sub-lanes within a lane, with lateral spacing $0 . 8 m$ . Vehicles are emitted at average speed $3 0 \mathrm { m / s }$ with small deviation. Simulation time resolution was $0 . 2 s$ per step. SUMO file merge_stage3_dense.rou.xml contains all vehicle parameters, and merge.net. $\mathrm { x m 1 }$ defines the complete road architecture.
+
+State. The global state vector $s$ is the concatenation of all agents’ absolute position $( x , y )$ , normalized respectively by the total length and width of the road, and horizontal speed $v$ normalized by $2 9 \mathrm { m } / \mathrm { s }$ .
+
+Observation. Each agent observation of itself $o _ { \mathrm { s e l f } } ^ { n }$ is a vector consisting of: agent speed normalized by $2 9 \mathrm { m } / \mathrm { s }$ , normalized number of sub-lanes between agent’s current sub-lane and center sub-lane of goal lane, and normalized longitudinal distance to goal position. Each agent’s observation of others $o _ { \mathrm { o t h e r s } } ^ { n }$ is a discretized observation tensor of shape [13,9,2] centered on the agent, with two channels: binary indicator of vehicle occupancy, and normalized relative speed between agent and other vehicles. Each channel is a matrix with shape [13,9], corresponding to visibility of $1 5 m$ forward and backward (with resolution $2 . 5 m \mathrm { \Omega }$ ) and four sub-lanes to the left and right.
+
+Actions. All agents have the same discrete action space, consisting of five options: no-op (maintain current speed and lane), accelerate $( 2 . 5 m / s ^ { 2 } )$ , decelerate $( - 2 . 5 m \overline { { / } } s ^ { 2 } )$ , shift one sub-lane to the left, shift one sub-lane to the right. Each agent’s action $a ^ { n }$ is represented as a one-hot vector of length 5.
+
+Goals and initial state assignment. Each goal vector $g ^ { n }$ is a one-hot vector of length 4, indicating the goal lane at which agent $n$ should arrive once it crosses position $\scriptstyle x = 1 9 0 { \mathrm { m } }$ . With probability 0.2, agents are assigned goals uniformly at random, and agents are assigned initial lanes uniformly at random at position $\scriptstyle x = 0$ . With probability 0.8, agent 1’s goal is lane 2 and agent 2’s goal is lane 1, while agent 1 is initialized at lane 1 and agent 2 is initialized at lane 2 (see Figure 4). Departure times were drawn from a normal distribution with mean 0s and standard deviation 0.5s for each agent.
+
+Reward. The reward $R ( s _ { t } , \mathbf { a } _ { t } , g ^ { n } )$ for agent $n$ with goal $g ^ { n }$ is given according to the conditions: -1 for a collision; $^ { - 1 0 }$ for time-out (exceed 33 simulation steps during an episode); $1 0 ( 1 - \Delta )$ for reaching the end of the road and having a normalized sub-lane difference of $\Delta$ from the center of the goal lane; and -0.1 if current speed exceeds $3 5 . 7 \mathrm { m / s }$ .
+
+Termination. Episode terminates when 33 simulation steps have elapsed or all agents have $x > 1 9 0 \mathrm { m }$
+
+Induced MDP. This is the $N = 1$ case of the Markov game defined above, used by Stage 1 of CM3. The single agent receives only ${ \cal O } _ { \mathrm { s e l f } }$ . For each episode, agent initial and goal lanes are assigned uniformly at random from the available lanes.
+
+# G.3 CHECKERS
+
+This domain is adapted from the Checkers environment in Sunehag et al. (2018). It is a gridworld with 5 rows and 13 columns (Figure 2). Agents cannot move to the two highest and lowest rows and the two highest and lowest columns, which are placed for agents’ finite observation grid to be well-defined. Agents cannot be in the same grid location. Red and yellow collectible reward are placed in a checkered pattern in the middle $3 { \mathrm { x } } 8$ region, and they disappear when any agent moves to their location.
+
+State. The global state $s$ consists of two components. The first is $s _ { T }$ , a tensor of shape [3,9,2], where the two “channels” in the last dimension represents the presence/absence of red and yellow rewards as 1-hot matrices. The second is $s _ { V }$ , the concatenation of all agents’ $( x , y )$ location (integer-valued) and the number of red and yellow each agent has collected so far.
+
+Observation. Each agent’s obsevation of others, normalized coordinates (normalized by total size $o _ { \mathrm { o t h e r s } } ^ { n }$ , is the concatenation of all other agd). An agent’s observation of itself, $o _ { \mathrm { s e l f } } ^ { n }$ consists of two components. First, $o _ { \mathrm { s e l f } , V } ^ { n }$ is a vector concatenation of agent $n$ ’s normalized coordinate and the number of red and yellow it has collected so far. Second, $O _ { \mathrm { s e l f } , T } ^ { n }$ is a tensor of shape [5,5,3], centered on its current location in the grid. The tensor has three “channels”, where the first two represent presence/absence of red and yellow rewards as 1-hot matrices, and the last channel indicates the invalid locations as a 1-hot matrix. The agent’s own grid location is a valid location, while other agents’ locations are invalid.
+
+Actions. Agents choose from a discrete set of actions do-nothing, up, down, left, right. Movement actions transport the agent one grid cell in the chosen direction.
+
+Goals. Agent A’s goal is to collect all red rewards without touching yellow. Agent B’s goal is to collect all yellow without touching red. The goal is represented as a 1-hot vector of length 2.
+
+Reward. Agent A gets $+ 1$ for red, -0.5 for yellow. Agent B gets -0.5 for red, $+ 1$ for yellow.
+
+Initial state distribution. Agent A is initialized at (2,8), Agent B is initialized at (4,8). (0,0) is the top-left cell (Figure 2).
+
+Termination. Each episode finishes when either 75 time steps have elapsed, or when all rewards have been collected.
+
+Induced MDP. For Stage 1 of CM3, the single agent is randomly assigned the role of either Agent A or Agent B in each episode. Everything else is defined as above.
+
+# H ARCHITECTURE
+
+For all experiment domains, ReLU nonlinearity was used for all neural network layers unless otherwise specified. All layers are fully-connected feedforward layers, unless otherwise specified. All experiment domains have a discrete action space (with $| . A | \ = \ 5$ actions), and action probabilities were computed by lower-bounding softmax outputs of all policy networks by $P ( a ^ { \bar { n } } = i ) = ( 1 - \epsilon ) \mathrm { s o f t m a x } ( i ) + \bar { \epsilon } / | A |$ , where $\epsilon$ is a decaying exploration parameter. To keep neural network architectures as similar as possible among all algorithms, our neural networks for
+
+COMA differ from those of Foerster et al. (2018) in that we do not use recurrent networks, and we do not feed previous actions into the Q function. For the Q network in all implementations of COMA, the value of each output node $i$ is interpreted as the action-value $Q ( s , a ^ { - n } , a ^ { n } = i , \mathbf { g } )$ for agent $n$ taking action $i$ and all other agents taking action $a ^ { - n }$ . Also for COMA, agent $n$ ’s label vector (one-hot indicator vector) and observation ${ \cal O } _ { \mathrm { s e l f } }$ were used as input to COMA’s global Q function, to differentiate between evaluations of the Q-function for different agents. These were choices in Foerster et al. (2018) that we retain.
+
+# H.1 COOPERATIVE NAVIGATION
+
+CM3. The policy network $\pi ^ { 1 }$ in Stage 1 feeds the concatenation of ${ \cal O } _ { \mathrm { s e l f } }$ and goal $g$ to one layer with 64 units, which is connected to the special layer $h _ { * } ^ { 1 }$ with 64 units, then connected to the softmax output layer with 5 units, each corresponding to one discrete action. In Stage 2, $O _ { \mathrm { o t h e r s } }$ is connected to a new layer with 128 units, then connected to $h _ { * } ^ { 1 }$ .
+
+The $Q ^ { 1 }$ function in Stage 1 feeds the concatenation of state $s$ , goal $g$ , and 1-hot action $a$ to one layer with 64 units, which is connected to the special layer $h _ { * } ^ { 1 }$ with 64 units, then to a single linear output unit. In Stage 2, $Q ^ { 1 }$ is augmented into both $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ and $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ as separate networks. For $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ , $s ^ { - n }$ (part of state $s$ excluding agent $n$ ) and $\boldsymbol { a } ^ { - n }$ are concatenated and connected to a layer with 128 units, then connected to $h _ { * } ^ { 1 }$ . For $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ , $s ^ { m }$ (agent $m$ portion of state $s$ ) and $s ^ { - n }$ are concatenated and connected to a layer with 128 units, then connected to $h _ { * } ^ { 1 }$ .
+
+IAC. IAC uses the same policy network as Stage 2 of CM3. The value function of IAC concatenates $o _ { \mathrm { s e l f } } ^ { n }$ and goal $g ^ { n }$ , connects to a layer with 64 units, which connects to a second layer $h _ { 2 }$ with 64 units, then to a single linear output unit. $o _ { \mathrm { o t h e r s } } ^ { n }$ is connected to a layer with 128 units, then connected to $h _ { 2 }$
+
+COMA. COMA uses the same policy network as Stage 2 of CM3. The global Q function of COMA computes $Q { \big ( } s , ( a ^ { n } , a ^ { - n } ) { \big ) }$ for each agent $n$ as follows. Input is the concatenation of state $s$ , all other agents’ 1-hot actions $\boldsymbol { a } ^ { - n }$ , agent n’s goal $g ^ { n }$ , all other agent goals $g ^ { - n }$ , agent label $n$ , and agent $n$ ’s observation $o _ { \mathrm { s e l f } } ^ { n }$ . This is passed through two layers of 128 units each, then connected to a linear output layer with 5 units.
+
+QMIX. Individual value functions take input $\left( o _ { \mathrm { s e l f } } ^ { n } , o _ { \mathrm { o t h e r s } } ^ { n } , g ^ { n } \right)$ and connects to one hidden layer with 64 units, which connects to the output layer. The mixing network follows the exact architecture of Rashid et al. (2018) with embedding dimension 64.
+
+# H.2 SUMO
+
+CM3. The policy network $\pi ^ { 1 }$ during Stage 1 feeds each of the inputs ${ \cal O } _ { \mathrm { s e l f } }$ and goal $g ^ { n }$ to a layer with 32 units. The concatenation is then connected to the layer $h _ { * } ^ { 1 }$ with 64 units, and connected to a softmax output layer with 5 units, each corresponding to one discrete action. In Stage 2, the input observation grid $o _ { \mathrm { o t h e r s } } ^ { n }$ is processed by a convolutional layer with 4 filters of size 5x3 and stride 1x1, flattened and connected to a layer with 64 units, then connected to the layer of .
+
+The $Q ^ { 1 }$ function in Stage 1 feeds the concatenation of state $s$ , goal $g$ , and 1-hot action $a$ to one layer with 256 units, which is connected to the special layer $h _ { * } ^ { 1 }$ with 256 units, then to a single linear output unit. In Stage 2, $Q ^ { 1 }$ is augmented into both $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ and $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ as separate networks. For $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ , $s ^ { - n }$ (part of state $s$ excluding agent $n$ ), $\boldsymbol { a } ^ { - n }$ , and $g ^ { - n }$ are concatenated and connected to a layer with 128 units, then connected to $h _ { * } ^ { 1 }$ . For $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ , $s ^ { m }$ (agent $m$ portion of state $s$ ), $s ^ { - n }$ , and $g ^ { - n }$ are concatenated and connected to a layer with 128 units, then connected to $h _ { * } ^ { 1 }$ .
+
+IAC. IAC uses the same policy network as Stage 2 of CM3. The value function of IAC concatenates $o _ { \mathrm { s e l f } } ^ { n }$ and $g ^ { n }$ , feeds it into a layer with 64 units, which connects to a layer $h _ { 2 }$ with 64 units, which connects to one linear output unit. $o _ { \mathrm { o t h e r s } } ^ { n }$ is processed by a convolutional layer with 4 filters of size $5 \mathrm { x } 3$ and stride 1x1, flattened and connected to a layer with 128 units, then connected to $h _ { 2 }$ .
+
+COMA. COMA uses the same policy network as Stage 2 of CM3. The Q function of COMA is exactly the same as the one in COMA for cooperative navigation defined above.
+
+QMIX. Individual value functions take input $( o _ { \mathrm { s e l f } } ^ { n } , g ^ { n } )$ and connects to one hidden layer with 64 units, which connects to layer $h _ { 2 }$ with 64 units. $o _ { \mathrm { o t h e r s } } ^ { n }$ is passed through the same convolutional layer as above and connected to $h _ { 2 }$ . $h _ { 2 }$ is fully-connected to an output layer. The mixing network follows the exact architecture of Rashid et al. (2018) with embedding dimension 64.
+
+# H.3 CHECKERS
+
+CM3. The policy network $\pi ^ { 1 }$ during Stage 1 feeds $o _ { \mathrm { s e l f } , T } ^ { n }$ to a convolution layer with 6 filters of size $3 { \tt X } 3$ and stride 1x1, which is flattened and connected to a layer with 32 units, which is concatenated with $o _ { \mathrm { s e l f } , V } ^ { n }$ , previous action, and its goal vector. The concatenation is connected to a layer with 256 units, then to the special layer $h _ { * } ^ { 1 }$ with 256 units, finally to a softmax output layer with 5 units. In Stage 2, $o _ { \mathrm { o t h e r s } } ^ { n }$ is connected to a layer with 256 units, then to the layer $h _ { * } ^ { 1 }$ of $\pi ^ { 1 }$ .
+
+The $Q ^ { 1 }$ function in Stage 1 is defined as: state tensor $s _ { T }$ is fed to a convolutional layer with 4 filters ize 3x5 and stride 1x1 and flattened. and stride 1x1 and flattened. Both $o _ { \mathrm { s e l f } , T } ^ { n }$ is given to a concatenated with lution l(agent er with 6 fipart of the s of sizevector), $3 { \tt X } 3$ $s ^ { n }$ $n$ $s _ { V }$ goal $g ^ { n }$ , action $a ^ { n }$ and $o _ { \mathrm { s e l f } , V } ^ { n }$ . The concatenation is fed to a layer with 256 units, then to the special layer $h _ { * } ^ { 1 }$ with 256 units, then to a single linear output unit. In Stage 2, $Q ^ { 1 }$ is augmented into both $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ and $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ as separate networks. For $Q _ { n } ^ { \pi } ( s , \mathbf { a } )$ , $s ^ { - n }$ (part of state vector $s _ { V }$ excluding agent $n$ ) and $a ^ { - n }$ are concatenated and connected to a layer with 32 units, then connected to $h _ { * } ^ { 1 }$ . For $Q _ { n } ^ { \pi } ( s , a ^ { m } )$ , $s ^ { m }$ (agent $m$ portion of state $s _ { V }$ ) and $s ^ { - n }$ are concatenated and connected to a layer with 32 units, then connected to $h _ { * } ^ { 1 }$ .
+
+IAC. IAC uses the same policy network as Stage 2 of CM3. The value function of IAC feeds $o _ { \mathrm { s e l f } , T } ^ { n }$
+to a convolutional layer with 6 filters of size 3x3 and stride 1x1, which is flattened and concatenated
+with withthe l $o _ { \mathrm { s e l f } , V } ^ { n }$ and goal its, then . $g ^ { n }$ . The concatenation is co single linear output unit. d to a layer with 256 units, then to a layer is connected to a layer with 32 units, then $h _ { 2 }$ $o _ { \mathrm { o t h e r s } } ^ { n }$ $h _ { 2 }$
+
+COMA. COMA uses the same policy network as Stage 2 of CM3. The global $Q { \big ( } s , ( a ^ { n } , a ^ { - n } ) { \big ) }$ function of COMA is defined as follows for each agent $n$ . Tensor part of global state $s _ { T }$ is given to a convolutional layer with 4 filters of size 3x5 and stride 1x1. Tensor part of agent $n$ ’s observation $o _ { \mathrm { s e l f } , T } ^ { n }$ is given to a convolutional layer with 6 filters of size 3x3 and stride 1x1. Outputs of both convolutional layers are flattened, then concatenated with $s _ { V }$ , all other agents’ actions $\boldsymbol { a } ^ { - n }$ , agent $n$ ’s goal $g ^ { n }$ , other agents’ goals $g ^ { - n }$ , agent $n$ ’s label vector, and agent $n$ ’s vector observation $o _ { \mathrm { s e l f } , V } ^ { n }$ . The concatenation is passed through two layers with 256 units each, then to a linear output layer with 5 units.
+
+QMIX. Individual value functions are defined as: $o _ { \mathrm { s e l f } , T } ^ { n }$ is passed through the same convolutional layer as above, connected to hidden layer with 32 units, then concatenated with $o _ { \mathrm { s e l f } , V } ^ { n }$ , $a _ { t - 1 } ^ { n }$ , and $g ^ { n }$ . This is connected to layer $h _ { 2 }$ with 64 units. $o _ { \mathrm { o t h e r s } } ^ { n }$ self is connected to a layer with 64 units then connectd to $h _ { 2 }$ . $h _ { 2 }$ is fully-connected to an output layer. The mixing network feeds $s _ { T }$ into the same convolutional network as above and follows the exact architecture of Rashid et al. (2018) with embedding dimension 128.
+
+# I PARAMETERS
+
+We used the Adam optimizer in Tensorflow with hyperparameters in Tables 3 to 5. $\epsilon _ { \mathrm { d i v } }$ is used to compute the exploration decrement $\epsilon _ { \mathrm { s t e p } } : = ( \epsilon _ { \mathrm { s t a r t } } - \epsilon _ { \mathrm { e n d } } ) / \epsilon _ { \mathrm { d i v } }$ .
+
+Table 3: Parameters used for CM3, ablations, and baselines in cooperative navigation
+
+
CM3
Parameter
Stage 1
Stage 2
QV
Direct
IAC
COMA
QMIX
Episodes
1e3
8e4
8e4
8e4
8e4
8e4
8e4
Estart
1.0
0.5
0.5
1.0
1.0
1.0
1.0
Eend
0.01
0.05
0.05
0.05
0.05
0.05
0.05
Ediv
1e3
2e4
2e4
8e4
8e4
2e4
8e4
Replay buffer
1e4
1e4
1e4
1e4
1e4
1e4
1e4
Minibatch size
256
128
128
128
128
128
128
Episodes per train
10
10
10
10
10
10
N/A
Learning rate π
1e-4
1e-4
1e-4
1e-4
1e-4
1e-5
N/A
Learning rate Q
1e-3
1e-3
1e-3
1e-3
N/A
1e-4
1e-3
Learning rate V
N/A
N/A
1e-3
N/A
1e-3
N/A
N/A
Epochs
24
24
24
24
24
24
NA
Steps per train
N/A
N/A
N/A
N/A
N/A
N/A
10
Max env steps
25
50
50
50
50
50
50
+
+Table 4: Parameters used for CM3 and baselines in SUMO
+
+
CM3
Parameter
Stage 1
Stage 2
QV
Direct
IAC
COMA
QMIX
Episodes
2.5e3
5e4
5e4
5e4
5e4
5e4
5e4
Estart
0.5
0.5
0.5
0.5
0.5
0.5
0.5
Eend
0.05
0.05
0.05
0.05
0.05
0.05
0.05
Estep
2e3
1e3
4e4
4e4
1e3
1e4
4e4
Replay buffer
1e4
2e4
2e4
2e4
2e4
2e4
2e4
Minibatch size
128
128
128
128
128
128
128
Steps per train
10
10
10
10
N/A
N/A
10
Episodes per train
N/A
N/A
N/A
N/A
10
10
N/A
Learning rate π
1e-4
1e-4
1e-4
1e-4
1e-4
1e-4
N/A
Learning rate Q
1e-3
1e-3
1e-3
1e-3
N/A
1e-3
1e-3
Learning rate V
N/A
N/A
1e-3
N/A
1e-3
N/A
N/A
Epochs
N/A
N/A
N/A
N/A
33
33
N/A
Max env steps
33
33
33
33
33
33
33
+
+Table 5: Parameters used for CM3 and baselines in Checkers
+
+
CM3
Parameter
Stage 1
Stage 2
QV
Direct
IAC
COMA
QMIX
Episodes
5e3
5e4
5e4
5e4
5e4
5e4
5e4
Estart
1.0
0.5
0.5
1.0
1.0
1.0
1.0
Eend
0.1
0.1
0.1
0.1
0.1
0.1
0.1
Estep
5e2
1e3
1e3
1e4
2e4
1e4
1e4
Replay buffer
1e4
1e4
1e4
1e4
1e4
1e4
1e4
Minibatch size
128
128
128
128
128
128
128
Steps per train
N/A
10
10
10
N/A
N/A
10
Episodes per train
10
N/A
N/A
N/A
10
10
N/A
Learning rate π
1e-4
1e-4
1e-4
1e-4
1e-4
1e-4
N/A
Learning rate Q
1e-3
1e-3
1e-3
1e-3
N/A
1e-3
1e-5
Learning rate V
N/A
N/A
1e-3
N/A
1e-3
N/A
N/A
Epochs
10
N/A
N/A
N/A
33
33
N/A
Max env steps
75
75
75
75
75
75
75
+
+# J STAGE 1
+
+The Stage 1 functions $Q ^ { 1 }$ and $\pi ^ { 1 }$ for a single agent are trained with the $N = 1$ equivalents of (4) and (5):
+
+$$
+\begin{array} { r l } & { \qquad L ( \theta _ { Q } ) = \mathbb { E } _ { \boldsymbol \pi } \Big [ \big ( y _ { i } - Q _ { \theta _ { Q } } ^ { 1 } ( s _ { i } , a _ { i } ) \big ) ^ { 2 } \Big ] } \\ & { \qquad y _ { i } : = R ( s _ { i } , \mathbf { a } _ { i } , g ^ { n } ) + \gamma Q _ { \theta _ { Q } } ^ { 1 } ( s _ { i + 1 } , a _ { i + 1 } ) } \\ & { \qquad \nabla _ { \theta } J ( \boldsymbol \pi ^ { 1 } ) = \mathbb { E } _ { \boldsymbol \pi ^ { 1 } } \Big [ \nabla _ { \theta } \log \boldsymbol \pi ( a ) \big ( Q ^ { \boldsymbol \pi ^ { 1 } } ( s , a ) - \sum _ { \hat { a } } \pi ^ { 1 } ( \hat { a } ) { Q ^ { \boldsymbol \pi } } ^ { 1 } ( s , \hat { a } ) \big ) \Big ] } \end{array}
+$$
+
+Stage 1 training curves for all three experimental domains are shown in Figure 6.
+
+
+Figure 6: Stage 1 reward curves for CM3 in cooperative navigation, SUMO and Checkers.
\ No newline at end of file
diff --git a/md/train/S1vyujVye/S1vyujVye.md b/md/train/S1vyujVye/S1vyujVye.md
new file mode 100644
index 0000000000000000000000000000000000000000..13c21e0e9a64fffa2bea8feb62bb98ce4785a24a
--- /dev/null
+++ b/md/train/S1vyujVye/S1vyujVye.md
@@ -0,0 +1,273 @@
+# DEEP UNSUPERVISED LEARNING THROUGH SPATIAL CONTRASTING
+
+Elad Hoffer
+Technion - Israel Institute of Technology
+Haifa, Israel
+ehoffer@tx.technion.ac.il
+Itay Hubara
+Technion - Israel Institute of Technology
+Haifa, Israel
+itayh@tx.technion.ac.il
+Nir Ailon
+Technion - Israel Institute of Technology
+Haifa, Israel
+nailon@cs.technion.ac.il
+
+# ABSTRACT
+
+Convolutional networks have marked their place over the last few years as the best performing model for various visual tasks. They are, however, most suited for supervised learning from large amounts of labeled data. Previous attempts have been made to use unlabeled data to improve model performance by applying unsupervised techniques. These attempts require different architectures and training methods. In this work we present a novel approach for unsupervised training of Convolutional networks that is based on contrasting between spatial regions within images. This criterion can be employed within conventional neural networks and optimized using standard techniques such as SGD and backpropagation, thus complementing supervised methods.
+
+# 1 INTRODUCTION
+
+For the past few years convolutional networks (ConvNets, CNNs) LeCun et al. (1998) have proven themselves as a successful model for vision related tasks Krizhevsky et al. (2012) Mnih et al. (2015) Pinheiro et al. (2015) Razavian et al. (2014). A convolutional network is composed of multiple convolutional and pooling layers, followed by a fully-connected affine transformations. As with other neural network models, each layer is typically followed by a non-linearity transformation such as a rectified-linear unit (ReLU).
+
+A convolutional layer is applied by cross correlating an image with a trainable weight filter. This stems from the assumption of stationarity in natural images, which means that parameters learned for one local region in an image can be shared for other regions and images.
+
+Deep learning models, including convolutional networks, are usually trained in a supervised manner, requiring large amounts of labeled data (ranging between thousands to millions of examples per-class for classification tasks) in almost all modern applications. These models are optimized using a variant of stochastic-gradient-descent (SGD) over batches of images sampled from the whole training dataset and their ground truth-labels. Gradient estimation for each one of the optimized parameters is done by back propagating the objective error from the final layer towards the input. This is commonly known as ”backpropagation” Rumelhart et al..
+
+In early works, unsupervised training was used as a part of pre-training procedure to obtain an effective initial state of the model. The network was later fine-tuned in a supervised manner as displayed by Hinton (2007). Such unsupervised pre-training procedures were later abandoned, since they provided no apparent benefit over other initialization heuristics in more careful fully supervised training regimes. This led to the de-facto almost exclusive usage of neural networks in supervised environments.
+
+In this work we will present a novel unsupervised learning criterion for convolutional network based on comparison of features extracted from regions within images. Our experiments indicate that by using this criterion to pre-train networks we can improve their performance and achieve state-ofthe-art results.
+
+# 2 PREVIOUS WORKS
+
+Using unsupervised methods to improve performance have been the holy grail of deep learning for the last couple of years and vast research efforts have been focused on that. We hereby give a short overview of the most popular and recent methods that tried to tackle this problem.
+
+AutoEncoders and reconstruction loss These are probably the most popular models for unsupervised learning using neural networks, and ConvNets in particular. Autoencoders are NNs which aim to transform inputs into outputs with the least possible amount of distortion. An Autoencoder is constructed using an encoder $G ( x ; w _ { 1 } )$ that maps an input to a hidden compressed representation, followed by a decoder $F ( y ; w _ { 2 } )$ , that maps the representation back into the input space. Mathematically, this can be written in the following general form:
+
+$$
+\hat { x } = F ( G ( x ; w _ { 1 } ) ; w _ { 2 } )
+$$
+
+The underlying encoder and decoder contain a set of trainable parameters that can be tied together and optimized for a predefined criterion. The encoder and decoder can have different architectures, including fully-connected neural networks, ConvNets and others. The criterion used for training is the reconstruction loss, usually the mean squared error (MSE) between the original input and its reconstruction Zeiler et al. (2010)
+
+$$
+m i n \lVert x - { \hat { x } } \rVert ^ { 2 }
+$$
+
+This allows an efficient training procedure using the aforementioned backpropagation and SGD techniques. Over the years autoencoders gained fundamental role in unsupervised learning and many modification to the classic architecture were made. $\mathrm { N g }$ (2011) regularized the latent representation to be sparse, Vincent et al. (2008) substituted the input with a noisy version thereof, requiring the model to denoise while reconstructing. Kingma et al. (2014) obtained very promising results with variational autoencoders (VAE). A variational autoencoder model inherits typical autoencoder architecture, but makes strong assumptions concerning the distribution of latent variables. They use variational approach for latent representation learning, which results in an additional loss component which required a new training algorithm called Stochastic Gradient Variational Bayes (SGVB). VAE assumes that the data is generated by a directed graphical model $p ( x | z )$ and require the encoder to learn an approximation $q _ { w _ { 1 } } ( z | x )$ to the posterior distribution $p _ { w _ { 2 } } ( z | x )$ where $w _ { 1 }$ and $w _ { 2 }$ denote the parameters of the encoder and decoder. The objective of the variational autoencoder in that case has the following form:
+
+$$
+\mathcal { L } ( w _ { 1 } , w _ { 2 } , x ) = - D _ { K L } \big ( q _ { w _ { 1 } } ( z | x ) | | p _ { w _ { 2 } } ( z ) \big ) + \mathbb { E } _ { q _ { w _ { 1 } } ( z | x ) } \big ( \log p _ { w _ { 2 } } ( x | z ) \big )
+$$
+
+Recently, a stacked set of denoising autoencoders architectures showed promising results in both semi-supervised and unsupervised tasks. A stacked what-where autoencoder by Zhao et al. (2015) computes a set of complementary variables that enable reconstruction whenever a layer implements a many-to-one mapping. Ladder networks by Rasmus et al. (2015) - use lateral connections and layer-wise cost functions to allow the higher levels of an autoencoder to focus on invariant abstract features.
+
+Exemplar Networks: The unsupervised method introduced byDosovitskiy et al. (2014) takes a different approach to this task and trains the network to discriminate between a set of pseudo-classes. Each pseudo-class is formed by applying multiple transformations to a randomly sampled image patch. The number of pseudo-classes can be as big as the size of the input samples. This criterion ensures that different input samples would be distinguished while providing robustness to the applied transformations. In this work we will explore an alternative method with a similar motivation.
+
+Context prediction Another method for unsupervised learning by context was introduced by Doersch et al. (2015). This method uses an auxiliary criterion of predicting the location of an image patch given another from the same image. This is done by classification to 1 of 9 possible locations. Although the work of Doersch et al. (2015) and ours both use patches from an image to perform unsupervised learning, the methods are quite different. Whereas the former used a classification criterion over the spatial location of each patch within a single image, our work is concerned with comparing patches from several images to each other. We claim that this encourages discriminability between images (which we feel to be important aspect of feature learning), and was not an explicit goal in previous work.
+
+Adversarial Generative Models: This a recently introduced model that can be used in an unsupervised fashion Goodfellow et al. (2014). Adversarial Generative Models uses a set of networks, one trained to discriminate between data sampled from the true underlying distribution (e.g., a set of images), and a separate generative network trained to be an adversary trying to confuse the first network. By propagating the gradient through the paired networks, the model learns to generate samples that are distributed similarly to the source data. As shown by Radford et al. (2015),this model can create useful latent representations for subsequent classification tasks.
+
+Sampling Methods: Methods for training models to discriminate between a very large number of classes often use a noise contrasting criterion. In these methods, roughly speaking, the posterior probability $P ( t | y _ { t } )$ of the ground-truth target $t$ given the model output on an input sampled from the true distribution $y _ { t } = F ( x )$ is maximized, while the probability $P ( t | y _ { n } )$ given a noise measurement $y = F ( n )$ is minimized. This was successfully used in a language domain to learn unsupervised representation of words. The most noteworthy case is the word2vec model introduced by Mikolov et al. (2013). When using this setting in language applications, a natural contrasting noise is a smooth approximation of the Unigram distribution. A suitable contrasting distribution is less obvious when data points are sampled from a high dimensional continuous space, such as the case of image patches.
+
+# 2.1 PROBLEMS WITH CURRENT APPROACHES
+
+Only recently the potential of ConvNets in an unsupervised environment began to bear fruit, still we believe it is not fully uncovered.
+
+The majority of unsupervised optimization criteria currently used are based on variations of reconstruction losses. One limitation of this fact is that a pixel level reconstruction is non-compliant with the idea of a discriminative objective, which is expected to be agnostic to low level information in the input. In addition, it is evident that MSE is not best suited as a measurement to compare images, for example, viewing the possibly large square-error between an image and a single pixel shifted copy of it. Another problem with recent approaches such as Rasmus et al. (2015); Zeiler et al. (2010) is their need to extensively modify the original convolutional network model. This leads to a gap between unsupervised method and the state-of-the-art, supervised, models for classification - which can hurt future attempt to reconcile them in a unified framework, as well as efficiently leverage unlabeled data with otherwise supervised regimes.
+
+# 3 LEARNING BY COMPARISONS
+
+The most common way to train NN is by defining a loss function between the target values and the network output. Learning by comparison approaches the supervised task from a different angle. The main idea is to use distance comparisons between samples to learn useful representations. For example, we consider relative and qualitative examples of the form $X _ { 1 }$ is closer to $X _ { 2 }$ than $X _ { 1 }$ is to $X _ { 3 }$ . Using a comparative measure with neural network to learn embedding space was introduced in the “Siamese network” framework by Bromley et al. (1993) and later used in the works of Chopra et al. (2005). One use for this methods is when the number of classes is too large or expected to vary over time, as in the case of face verification, where a face contained in an image has to compared against another image of a face. This problem was recently tackled by Schroff et al. (2015) for training a convolutional network model on triplets of examples. There, one image served as an anchor $x$ , and an additional pair of images served as a positive example $x _ { + }$ (containing an instance of the face of the same person) together with a negative example $x _ { - }$ , containing a face of a different person. The training objective was on the embedded distance of the input faces, where the distance between the anchor and positive example is adjusted to be smaller by at least some constant $\alpha$ from the negative distance. More precisely, the loss function used in this case was defined as
+
+$$
+L ( x , x _ { + } , x _ { - } ) = \operatorname* { m a x } \left\{ \| F ( x ) - F ( x _ { + } ) \| _ { 2 } - \| F ( x ) - F ( x _ { - } ) \| _ { 2 } + \alpha , 0 \right\}
+$$
+
+where $F ( x )$ is the embedding (the output of a convolutional neural network), and $\alpha$ is a predefined margin constant. Another similar model used by Hoffer & Ailon (2015) with triplets comparisons for classification, where examples from the same class were trained to have a lower embedded distance than that of two images from distinct classes. This work introduced a concept of a distance ratio loss, where the defined measure amounted to:
+
+$$
+L ( x , x _ { + } , x _ { - } ) = \frac { e ^ { - \| F ( x ) - F ( x _ { + } ) \| _ { 2 } } } { e ^ { - \| F ( x ) - F ( x _ { + } ) \| _ { 2 } } + e ^ { - \| F ( x ) - F ( x _ { - } ) \| _ { 2 } } }
+$$
+
+This loss has a flavor of a probability of a biased coin flip. By ‘pushing’ this probability to zero, we express the objective that pairs of samples coming from distinct classes should be less similar to each other, compared to pairs of samples coming from the same class. It was shown empirical by Balntas et al. (2016) to provide better feature embeddings than the margin based distance loss 1
+
+# 4 OUR CONTRIBUTION: SPATIAL CONTRASTING
+
+One implicit assumption in convolutional networks, is that features are gradually learned hierarchically, each level in the hierarchy corresponding to a layer in the network. Each spatial location within a layer corresponds to a region in the original image. It is empirically observed that deeper layers tend to contain more ‘abstract’ information from the image. Intuitively, features describing different regions within the same image are likely to be semantically similar (e.g. different parts of an animal), and indeed the corresponding deep representations tend to be similar. Conversely, regions from two probably unrelated images (say, two images chosen at random) tend to be far from each other in the deep representation. This logic is commonly used in modern deep networks such as Szegedy et al. (2015) Lin et al. (2013) He et al. (2015), where a global average pooling is used to aggregate spatial features in the final layer used for classification.
+
+Our suggestion is that this property, often observed as a side effect of supervised applications, can be used as a desired objective when learning deep representations in an unsupervised task. Later, the resulting representation can be used, as typically done, as a starting point or a supervised learning task. We call this idea which we formalize below Spatial contrasting. The spatial contrasting criterion is similar to noise contrasting estimation Gutmann & Hyvarinen (2010) Mnih & Kavukcuoglu ¨ (2013), in trying to train a model by maximizing the expected probability on desired inputs, while minimizing it on contrasting sampled measurements.
+
+# 4.1 FORMULATION
+
+We will concern ourselves with samples of images patches $\tilde { x } ^ { ( m ) }$ taken from an image $x$ . Our convolutional network model, denoted by $F ( x )$ , extracts spatial features $f$ so that $f ^ { ( m ) } = F ( \tilde { x } ^ { ( m ) } )$ for an image patch $\tilde { x } ^ { ( m ) }$ . We will also define $P ( f _ { 1 } | f _ { 2 } )$ as the probability for two features $f _ { 1 } , f _ { 2 }$ to occur together in the same image.
+
+We wish to optimize our model such that for two features representing patches taken from the same image x˜(1)i , x˜ $\tilde { x } _ { i } ^ { ( 1 ) } , \bar { x _ { i } ^ { ( 2 ) } } \in x _ { i }$ for which $f _ { i } ^ { ( 1 ) } = F ( \tilde { x } _ { i } ^ { ( 1 ) } )$ and $f _ { i } ^ { ( 2 ) } \stackrel { - } { = } F ( \tilde { x } _ { i } ^ { ( 2 ) } )$ , $P ( f _ { i } ^ { ( 1 ) } | f _ { i } ^ { ( 2 ) } )$ will be maxi
+
+This means that features from a patch taken from a specific image can effectively predict, under our model, features extracted from other patches in the same image. Conversely, we want our model to minimize $P ( f _ { i } | f _ { j } )$ for $i , j$ being two patches taken from distinct images. Following the logic presented before, we will need to sample contrasting patch $\tilde { x } _ { j } ^ { ( 1 ) }$ from a different image $x _ { j }$ such that $P ( f _ { i } ^ { ( 1 ) } | f _ { i } ^ { ( 2 ) } ) > P ( f _ { j } ^ { ( 1 ) } | f _ { i } ^ { ( 2 ) } )$ , where $\underset { . } { f _ { j } ^ { ( 1 ) } } = F ( \tilde { x } _ { j } ^ { ( 1 ) } )$ . In order to obtain contrasting samples, we use regions from two random images in the training set. We will use a distance ratio, described earlier in Eq. (2) for the supervised case, to represent the probability two feature vectors were taken from the same image. The resulting training loss for a pair of images will be defined as
+
+$$
+L _ { S C } ( x _ { 1 } , x _ { 2 } ) = - \log \frac { e ^ { - \| f _ { 1 } ^ { ( 1 ) } - f _ { 1 } ^ { ( 2 ) } \| _ { 2 } } } { e ^ { - \| f _ { 1 } ^ { ( 1 ) } - f _ { 1 } ^ { ( 2 ) } \| _ { 2 } } + e ^ { - \| f _ { 1 } ^ { ( 1 ) } - f _ { 2 } ^ { ( 1 ) } \| _ { 2 } } }
+$$
+
+Effectively minimizing a log-probability under the SoftMax measure. This formulation is portrayed in figure 4.1. Since we sample our contrasting sample from the same underlying distribution, we can evaluate this loss considering the image patch as both patch compared (anchor) and contrast symmetrically. The final loss will be the average between these estimations:
+
+$$
+\widehat { L } _ { S C } ( x _ { 1 } , x _ { 2 } ) = \frac { 1 } { 2 } \left[ L _ { S C } ( x _ { 1 } , x _ { 2 } ) + L _ { S C } ( x _ { 2 } , x _ { 1 } ) \right]
+$$
+
+
+Figure 1: Spatial contrasting depiction.
+
+# 4.2 METHOD
+
+Convolutional network are usually trained using SGD over mini-batch of samples, therefore we can extract patches and contrasting patches without changing the network architecture. Each image serves as both anchor and positive patches, for which the corresponding features should be closer, as well as contrasting samples for other images in that batch. For a batch of $N$ images, two samples from each image are taken, and $N ^ { 2 }$ different distance comparisons are made. The final loss is defined as the average distance ratio for all images in the batch:
+
+$$
+\overline { { L } } _ { S C } ( \{ x \} _ { i = 1 } ^ { N } ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } L _ { S C } ( x _ { i } , \{ x \} _ { j \neq i } ) = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \frac { e ^ { - \| f _ { i } ^ { ( 1 ) } - f _ { i } ^ { ( 2 ) } \| _ { 2 } } } { \sum _ { j = 1 } ^ { N } e ^ { - \| f _ { i } ^ { ( 1 ) } - f _ { j } ^ { ( 2 ) } \| _ { 2 } } }
+$$
+
+Since the criterion is differentiable with respect to its inputs, it is fully compliant with standard methods for training convolutional network and specifically using backpropagation and gradient descent. Furthermore, SC can be applied to any layer in the network hierarchy. In fact, SC can be used at multiple layers within the same convolutional network. The spatial properties of the features means that we can sample directly from feature space $\tilde { f } ^ { ( m ) } \in f$ instead of from the original image. Therefore SC has a simple implementation which doesn’t require substation amount of computation. The complete algorithm for batch training is described in Algorithm (1). Similar to the batch normalization (BN) layer Ioffe & Szegedy (2015), a recent usage for batch statistics in neural networks, SC also uses the batch statistics. While BN normalize the input based on the batch statistics, SC sample from it. This can be viewed as a simple sampling from the space of possible features describing a patch of image.
+
+Algorithm 1 Calculation the spatial contrasting loss
+
+Require: $X = \{ x \} _ { i = 1 } ^ { N }$ # Training on batches of images
+
+# Get the spatial features for the whole batch of images
+# Size: $N \times W _ { f } \times H _ { f } \times C$
+$\{ f \} _ { i = 1 } ^ { N } \mathsf { C o n v N e t } ( X )$
+
+$$
+\begin{array} { r } { d _ { i } \gets - \log \frac { \bar { e } ^ { - D i s t ( i , i ) } } { \sum _ { k = 1 } ^ { N } e ^ { - D i s t ( i , k ) } } } \end{array}
+$$
+
+# Spatial contrasting loss is the mean of distance ratios return $\textstyle { \frac { 1 } { N } } \sum _ { i = 1 } ^ { N } d _ { i }$ g
+
+# 5 EXPERIMENTS
+
+In this section we report empirical results showing that using SC loss as an unsupervised pretraining procedure can improve state-of-the-art performance on subsequent classification. We experimented with MNIST, CIFAR-10 and STL10 datasets. We used modified versions of well studied networks such as those of Lin et al. (2013) and Rasmus et al. (2015). A detailed description of our architecture can be found in 4.
+
+In each one of the experiments, we used the spatial contrasting criterion to train the network on the unlabeled images. In each usage of SC criterion, patch features were sampled from the preceding layer in uniform. We note that spatial size of sampled patches ranged between datasets, where on STL10 and Cifar10 it covered about $3 0 \%$ of the image, MNIST required the use of larger patches covering almost the entire image.Training was done by using SGD with an initial learning rate of 0.1 that was decreased by a factor of 10 whenever the measured loss stopped decreasing. After convergence, we used the trained model as an initialization for a supervised training on the complete labeled dataset. The supervised training was done following the same regime, only starting with a lower initial learning rate of 0.01. We used mild data augmentations, such as small translations and horizontal mirroring.
+
+The datasets we used are:
+
+• STL10 (Coates et al. (2011)). This dataset consists of $1 0 0 , 0 0 0 9 6 \times 9 6$ colored, unlabeled images, together with another set of 5, 000 labeled training images and 8, 000 test images . The label space consists of 10 object classes. • Cifar10 (Krizhevsky & Hinton (2009)). The well known CIFAR-10 is an image classification benchmark dataset containing 50, 000 training images and 10, 000 test images. The image sizes $3 2 \times 3 2$ pixels, with color. The classes are airplanes, automobiles, birds, cats, deer, dogs, frogs, horses, ships and trucks.
+
+Table 1: State of the art results on STL-10 dataset
+
+
Model
STL-10 test accuracy
Zero-bias Convnets - Paine et al. (2014)
70.2%
Triplet network -Hoffer & Ailon (2015)
70.7%
Exemplar Convnets - Dosovitskiy et al. (2014)
72.8%
Target Coding - Yang et al. (2015)
73.15%
Stacked what-where AE - Zhao et al. (2015)
74.33%
Spatial contrasting initialization (this work)
81.34% ± 0.1
The same model without initialization
72.6%±0.1
+
+• MNIST (LeCun et al. (1998)). The MNIST database of handwritten digits is one of the most studied dataset benchmark for image classification. The dataset contains 60,000 examples of handwritten digits from 0 to 9 for training and 10,000 additional examples for testing. Each sample is a $2 8 \times 2 8$ pixel gray level image.
+
+All experiments were conducted using the Torch7 framework by Collobert et al. (2011). Code reproducing these results will by available at https://github.com/eladhoffer/ SpatialContrasting.
+
+# 5.1 RESULTS ON STL10
+
+Since STL10 dataset is comprised of mostly unlabeled data, it is most suitable to highlight the benefits of the spatial contrasting criterion. The initial training was unsupervised, as described earlier, using the entire set of 105, 000 samples (union of the original unlabeled set and labeled training set). The representation outputted by the training, was used to initialize supervised training on the 5, 000 labeled images. Evaluation was done on a separate test set of 8, 000 samples. Comparing with state of the art results, we see an improvement of $7 \%$ in test accuracy over the best model by Zhao et al. (2015), setting the SC as best model at $8 1 . 3 \%$ test classification accuracy (see Table (1)). We note that the results of Dosovitskiy et al. (2014) are achieved with no fine-tuning over labeled examples, which may be unfair to this work. We also compare with the same network, but without SC initialization, which achieves a lower classification of $7 2 . 6 \%$ . This is an indication that indeed SC managed to leverage unlabeled examples to provide a better initialization point for the supervised model.
+
+# 5.2 RESULTS ON CIFAR10
+
+For Cifar10 dataset, we use the same setting as Coates & $\mathrm { N g } \left( 2 0 1 2 \right)$ and Hui (2013) to test a model’s ability to learn from unlabeled images. Here, only 4, 000 samples out of 50, 000 are used with their label annotation, and the rest of the samples can be used only in an unsupervised manner. The final test accuracy is measured on the entire 10, 000 test set.
+
+In our experiments, we trained our model using SC criterion on the entire dataset, and then used only 400 labeled samples per class (for a total of 4000) in a supervised regime over the initialized network. The results are compared with previous efforts in Table (2). Using the SC criterion allowed an improvement of $6 . 8 \%$ over a non-initialized model, and achieved a final test accuracy of $7 9 . 2 \%$ . This is a competitive result with current state-of-the-art models.
+
+# 5.3 RESULTS ON MNIST
+
+The MNIST dataset is very different in nature from the Cifar10 and STL10 datasets, we experimented earlier. The biggest difference, relevant to this work, is that spatial regions sampled from MNIST images usually provide very little, or no information. Thus, SC is much less suited for MNIST dataset, and was conjured to have little benefit. We still, however, experimented with initializing a model with SC criterion and continuing with a fully-supervised regime over all labeled examples. We found again that this provided benefit over training the same network without preinitialization, improving results from ${ \bar { 0 } } . 6 3 \%$ to $0 . 3 4 \%$ error on test set. As mentioned previously, the effective compared patches of MNIST covered almost the entire image area. This can be attributed to the fact that MNIST requires global features to differentiate between digits. The results, compared with previous attempts are included in Table (3).
+
+Table 2: State of the art results on Cifar10 dataset with only 4000 labeled samples
+
+
Model
Cifar10 (400 per class) test accuracy
Convolutional K-means Network - Coates & Ng (2012)
70.7%
View-Invariant K-means -Hui (2013)
72.6%
DCGAN - Radford et al. (2015)
73.8%
Exemplar Convnets - Dosovitskiy et al. (2014)
76.6%
Ladder networks - Rasmus et al. (2015)
79.6%
Conv-CatGan Springenberg (2016)
80.42% (± 0.58)
ImprovedGan Salimans et al. (2016)
81.37% (± 2.32)
Spatial contrasting initialization (this work)
79.2%(±0.3)
The same model without initialization
72.4%(±0.1)
+
+Table 3: results on MNIST dataset
+
+
Model
MNIST test error
Stacked what-where AE - Zhao et al. (2015)
0.71%
Triplet network - Hoffer & Ailon (2015)
0.56%
Jarrett et al. (2009)
0.53%
Ladder networks - Rasmus et al. (2015)
0.36%
DropConnect - Wan et al. (2013)
0.21%
Spatial contrasting initialization (this work)
0.34%± 0.02
The same model without initialization
0.63%± 0.02
+
+# 6 CONCLUSIONS AND FUTURE WORK
+
+In this work we presented spatial contrasting - a novel unsupervised criterion for training convolutional networks on unlabeled data. Its is based on comparison between spatial features sampled from a number of images. We’ve shown empirically that using spatial contrasting as a pretraining technique to initialize a ConvNet, can improve its performance on a subsequent supervised training. In cases where a lot of unlabeled data is available, such as the STL10 dataset, this translates to state-of-the-art classification accuracy in the final model.
+
+Since the spatial contrasting loss is a differentiable estimation that can be computed within a network parallel to supervised losses, in future work we plan to embed it as a semi-supervised model. This usage will allow to create models that can leverage both labeled an unlabeled data, and can be compared to similar semi-supervised models such as the ladder network Rasmus et al. (2015). It is is also apparent that contrasting can occur in dimensions other than the spatial, the most straightforward is the temporal dimension. This suggests that similar training procedure can be applied on segments of sequences to learn useful representation without explicit supervision.
+
+# REFERENCES
+
+Vassileios Balntas, Edward Johns, Lilian Tang, and Krystian Mikolajczyk. Pn-net: Conjoined triple deep network for learning local image descriptors. arXiv preprint arXiv:1601.05030, 2016.
+
+Jane Bromley, James W Bentz, Leon Bottou, Isabelle Guyon, Yann LeCun, Cliff Moore, Eduard ´ Sackinger, and Roopak Shah. Signature verification using a siamese time delay neural network.¨ International Journal of Pattern Recognition and Artificial Intelligence, 7(04):669–688, 1993.
+
+Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, volume 1, pp. 539–546. IEEE, 2005.
+
+Adam Coates and Andrew Y Ng. Learning feature representations with k-means. In Neural Networks: Tricks of the Trade, pp. 561–580. Springer, 2012.
+
+Adam Coates, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In International Conference on Artificial Intelligence and Statistics, pp. 215–223, 2011.
+
+Ronan Collobert, Koray Kavukcuoglu, and Clement Farabet. Torch7: A matlab-like environment ´ for machine learning. In BigLearn, NIPS Workshop, number EPFL-CONF-192376, 2011.
+
+Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1422–1430, 2015.
+
+Alexey Dosovitskiy, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 766–774, 2014.
+
+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.
+
+Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In International Conference on Artificial Intelligence and Statistics, pp. 297–304, 2010.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
+
+Geoffrey E Hinton. To recognize shapes, first learn to generate images. Progress in brain research, 165:535–547, 2007.
+
+Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In Similarity-Based Pattern Recognition, pp. 84–92. Springer, 2015.
+
+Ka Y Hui. Direct modeling of complex invariances for visual object features. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 352–360, 2013.
+
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of The 32nd International Conference on Machine Learning, pp. 448–456, 2015.
+
+Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multistage architecture for object recognition? In Computer Vision, 2009 IEEE 12th International Conference on, pp. 2146–2153. IEEE, 2009.
+
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 2009.
+
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet Classification with Deep Convolutional Neural Networks. Advances In Neural Information Processing Systems, pp. 1–9, 2012.
+
+Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
+
+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.
+
+Andriy Mnih and Koray Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estimation. In Advances in Neural Information Processing Systems, pp. 2265–2273, 2013.
+
+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–533, 2015.
+
+Andrew Ng. Sparse autoencoder. 2011.
+
+Tom Le Paine, Pooya Khorrami, Wei Han, and Thomas S Huang. An analysis of unsupervised pre-training in light of recent advances. arXiv preprint arXiv:1412.6597, 2014.
+
+Pedro O Pinheiro, Ronan Collobert, and Piotr Dollar. Learning to segment object candidates. In Advances in Neural Information Processing Systems, pp. 1981–1989, 2015.
+
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
+
+Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semisupervised learning with ladder networks. In Advances in Neural Information Processing Systems, pp. 3532–3540, 2015.
+
+Ali Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-theshelf: an astounding baseline for recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 806–813, 2014.
+
+David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1.
+
+Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016.
+
+Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 815–823, 2015.
+
+Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. In International Conference on Learning Representations (ICLR). 2016. URL https://arxiv.org/abs/1511.06390.
+
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015.
+
+Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008.
+
+Li Wan, Matthew Zeiler, Sixin Zhang, Yann L Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 1058–1066, 2013.
+
+Shuo Yang, Ping Luo, Chen Change Loy, Kenneth W Shum, and Xiaoou Tang. Deep representation learning with target coding. 2015.
+
+Matthew D Zeiler, Dilip Krishnan, Graham W Taylor, and Rob Fergus. Deconvolutional networks. In Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, pp. 2528–2535. IEEE, 2010.
+
+Junbo Zhao, Michael Mathieu, Ross Goroshin, and Yann Lecun. Stacked what-where auto-encoders. arXiv preprint arXiv:1506.02351, 2015.
+
+# 7 APPENDIX
+
+Table 4: Convolutional models used, based on Lin et al. (2013), Rasmus et al. (2015)
+
+
+
+
+10-way softmax
+
+
+Figure 2: First layer convolutional filters after spatial-contrasting training
\ No newline at end of file
diff --git a/md/train/S1xjdoC9Fm/S1xjdoC9Fm.md b/md/train/S1xjdoC9Fm/S1xjdoC9Fm.md
new file mode 100644
index 0000000000000000000000000000000000000000..be924380be4ae1bcccbbd2d46bcf18f1a6038489
--- /dev/null
+++ b/md/train/S1xjdoC9Fm/S1xjdoC9Fm.md
@@ -0,0 +1,284 @@
+# OFFLINE DEEP MODELS CALIBRATION WITH BAYESIAN NEURAL NETWORKS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+In this work the authors show that Bayesian Neural Networks (BNNs) can be efficiently applied to calibrate state-of-the-art Deep Neural Networks (DNN). Our approach acts offline, i.e., it is decoupled from the training of the DNN to be calibrated. This offline approach allow us to apply our BNN calibration to any model regardless of the limitations that the model may present during training. Note that this offline setting is also appropriate in order to deal with privacy concerns of DNN training data or implementation, among others. We show that our approach clearly outperforms other simple maximum likelihood based solutions that have recently shown very good performance, as temperature scaling (Guo et al., 2017). As an example, we reduce the Expected Calibration Error $( \mathrm { E C E } \% )$ from 0.52 to 0.24 on CIFAR-10 and from 4.28 to 2.46 on CIFAR-100 on two Wide ResNet with $9 6 . 1 3 \%$ and $8 0 . 3 9 \%$ accuracy respectively, which are among the best results published for these tasks. Moreover, we show that our approach improves the performance of online methods directly applied to the DNN, e.g. Gaussian processes or Bayesian Convolutional Neural Networks. Finally, this decoupled approach allows us to apply any further improvement to the BNN without considering the computational restrictions imposed by the deep model. In this sense, this offline setting is a practical application where BNNs can be considered, which is one of the main criticisms to these techniques. In terms of reproducibility, we provide all the implementation details in https://github.com/2019submission/bnn.2019.
+
+# 1 INTRODUCTION
+
+Deep Neural Networks (DNNs) have achieved state of art performance in many task such as Image Recognition (Huang et al., 2017; Szegedy et al., 2017; Zagoruyko & Komodakis, 2016), language modeling (Mikolov et al., 2013a;b), machine translation (Vaswani et al., 2017) or speech (Hinton et al., 2012). For that reason, neural networks are now used in many applications. However, this state-of-theart performance is measured in terms of accuracy, but there are many tasks in which the probabilistic information must be also reliable. For example, a probabilistic classifier can be incorporated into a more complex model considering multiple sources of information, by the use of e.g., probabilistic graphical models (Koller & Friedman, 2009), or by combining neural networks with language models in natural language processing tasks (Gulcehre et al., 2017). In addition, probabilistic outputs of classifiers have proven to be useful in many areas apart from classical machine learning tasks, such as language recognition (Brümmer & van Leeuwen, 2006), language models for speech recognition (Tüske et al., 2018) or medical diagnosis (Caruana et al., 2015).
+
+In Bayesian statistics, the reliability of probabilities is measured by their calibration. As a consequence, the machine learning community has been exploring methods to calibrate the output of classifiers to achieve the many beneficial properties of well-calibrated probabilities (Zadrozny & Elkan, 2002a; Cohen & Goldszmidt, 2004; Niculescu-Mizil & Caruana, 2005). Nowadays, there is an increasing interest in obtaining reliable probabilities in the deep learning community. In the past, neural networks trained with a cross-entropy criterion tended to present relatively good calibration. However, a relevant recent work in Guo et al. (2017) has evidenced that modern state-of-the-art neural networks are badly calibrated in general. Moreover, the same work shows that calibration can be dramatically improved by very simple maximum-likelihood parametric techniques, among which Temperature Scaling (TS) is highlighted as the preferred choice, due to its extreme simplicity, very good behavior in general and computational efficiency. In fact, TS outperforms more complex techniques in most cases, leading to the conclusion that good calibration can be better achieved with simpler techniques. This conclusion follows the hypothesis that the space configured by the outputs of a deep model is relatively simple, and therefore good performance, measured as Expected Calibration Error (ECE), can be achieved with very simple models. In fact, TS is a technique that performs nicely in complex multiclass tasks (Guo et al., 2017).
+
+
+ResNet-101: $9 3 . 4 6 \%$ accuracy (CIFAR10)
+Figure 1: Reliability diagrams (Guo et al., 2017) for two networks trained on CIFAR-10 and CIFAR100. The red line represents perfect calibration. We plot the Expected Calibration Error (ECE $\%$ ) for 15 bins (see section 5 for a description). The lower the better.
+
+In general, there are two main approaches to reduce overconfidence: implicit or online and explicit or offline. An implicit method aims at obtaining calibrated distributions directly at the output of the model, while explicit methods post-process the output of the model to be calibrated. In this paper we propose an offline method based on a Bayesian Neural Networks (BNNs) to obtain calibrated probabilities, see figure 2. We use BNNs as we aim at being benefited from two key properties of Bayesian statistics and neural networks: the high expressiveness of neural network models and the capabilities of the Bayesian statistics to model the uncertainty. We assume the hypothesis that as long as the uncertainty is correctly modelled, we can use high expressive function approximators for the task of calibration. These high expressive models are required since we assume that the calibration space is not simple. However, the generalization capability of these models are achieved through proper uncertainty consideration. Figure 1 shows reliability diagrams comparing our BNN method to TS.
+
+This work is organized as follows. We first provide an insight on why Bayesian Statistics and neural networks are suitable to adjust confidence in output probabilities. We then describe our offline calibration approach based on BNNs. We end up comparing our method to TS and reporting clear performance improvements. Finally, we discuss our approach against recent published techniques, enumerate some beneficial properties and propose possible improvements over this contribution.
+
+# 2 BAYESIAN MODELLING AND CALIBRATION
+
+In a classification scenario, calibration can be interpreted as the agreement between the probabilities of a class assigned by a model to a set of samples, and the proportion of those samples where that class is actually the true one.
+
+One way of achieving calibration is to reliably modelling the probabilistic distributions of the data from the classes involved. This is the main strength of Bayesian models, which manage uncertainty properly, in contrast to point-estimate approaches (i.e. Maximum Likelihood or Maximum Posterior). In the former, the uncertainty is incorporated by taking an average of all the likelihood models under the posterior distribution on the parameters, given an observed set of data:
+
+$$
+p ( t | x ) = \mathbb { E } _ { p ( \theta | \mathcal { O } ) } \{ p ( t | x , \theta ) \} ,
+$$
+
+where $\theta$ are model parameters, $x$ represent a sample for which we want to predict a label $t$ and $\mathcal { O } = \{ ( x _ { i } , t _ { i } ) \} _ { i = 1 } ^ { N }$ is the set of observed samples1. In Bayesian approaches, it is indeed the observed data what model how representative a likelihood model is for a particular task, and thus how it influences the predictions. On the other hand, in point-estimate models all the decision is based on a choice of the parameter once the model is trained.
+
+For instance, consider the case of a MAP network (e.g., a typical deep convolutional model trained with cross-entropy loss and $L _ { 2 }$ regularization). This model explains the data based on a point-estimate training, i.e., by representing what is more likely to appear. Nowadays, this gives outstanding accuracy in classification tasks, but it is easy to train an over/under-confident model, i.e., the one that outputs too extreme probabilities, even for unfavourable cases like e.g. when data that has conditions not unseen in the training set, or not explained by the expressiveness of the model itself. This could happen if the true distribution does not lie in the family of parametric models $p ( t | x , \theta )$ . We will refer to both conditions as mismatch. This is very harmful for the calibration, because in those mismatch cases, the model should yield more moderate probabilities, otherwise the classification errors will be more catastrophic. In other words, in tasks where calibration matters, a classification error has unequal consequences if the probabilities are moderate or extreme. Thus, for example, if there exists such mismatching conditions, what is likely to happen, a point estimate will not represent the data (i.e. the probability assigned) in the way it should, possibly leading to over-or under-estimation of probabilities. On the other hand, in the Bayesian framework, a posterior distribution on the parameters could consider networks explaining these mismatching conditions. By averaging different contributions, the model ideally moderates probabilities on unfavourable data. For the sake of illustration, we provide a simple example in appendix A. We encourage unfamiliar readers with Bayesian statistics and calibration to read this appendix.
+
+Regarding the accuracy of Bayesian models, in Bayesian decision theory, if the model used to generate the data is known, the optimal error can be achieved, which also means optimal accuracy if all decision costs are equal. This suggests that a proper way of assigning probabilities is also paramount for the accuracy. Thus, by choosing appropriate densities for the class-conditional probabilities $p ( t | x )$ , such as factorized multivariate Bernoulli distributions like in point estimate models, the accuracy will also be correctly modelled. Moreover, it is well known that Bayesian models asymptotically tend to point estimate models as the data increases in size, see Duda et al. (2000) section 3.4. Therefore, it is expected that good accuracy performance achieved by point-estimate models should be also achievable by Bayesian models, at least for sufficient amounts of data.
+
+# 3 OFFLINE CALIBRATION WITH BAYESIAN NEURAL NETWORKS
+
+The architecture proposed in this work is shown in Figure 2. We apply a BNN to the potentially uncalibrated outputs of a DNN model. The goal is to improve the calibration minimizing the accuracy degradation of the original DNN model. Our approach works offline, meaning that given a DNN model, we project the available data to the space defined by the outputs of the model in the form of logit, i.e. pre-softmax values. This new representation is then the input to our BNN. The BNN aims at taking this uncalibrated so-called logit space and project it to a new calibrated one. The same procedure is applied for the TS method.
+
+
+Figure 2: Exemplary representation of the architecture of our proposed model. On the left, an expensive pretrained DNN on ImageNet is trained on a specific dataset (transfer learning). Then, the (uncalibrated) output of such DNN is the input to the BNN calibration stage. This stage is trained by the maximization of the Expected Lower Bound (ELBO) and predictions are done using Monte Carlo integration. The inputs and outputs of the Bayesian stage have same dimension (given by the number of classes), and lie in the so-called logit space. Orange Gaussians on each arrow represent variational distributions on parameters. We do not plot all the arrows for clarity. This Bayesian stage is independent of the previous one as we only require access to the logits of an already trained model.
+
+This off-line set-up presents clear advantages. First, the approach is efficient, since the DNN model does not need to be re-trained for re-calibration. Furthermore, we can incorporate future improvements to the BNN calibration stage without affecting the previous DNN model. Second, our proposal is extremely flexible, as the proposed BNN calibration stage will work with any probabilistic model, even implicitly-calibrated models, with potential benefits on calibration performance. And finally, our proposal preserves privacy, because there is no need to access the original data used to train the DNN model, or even the DNN topology: to be trained, the BNN only needs the data projected to the outputs of the DNN on the logit space, and the original targets $t$ .
+
+For these Bayesian approaches one has to compute the posterior distribution $p ( \theta | \mathcal { O } )$ and the expectation in equation 1. Using configurations that yield to analytic solutions to both problems result in low-expression models for this task. We solve this problem by choosing Neural Networks to parameterize the likelihood $p ( t | x , \theta )$ of our BNN, and therefore taking advantage of the high expressiveness of these models. In this case, several intractabilities arise that must be addressed.
+
+In this work we approximate expectations on equation 1 with Monte Carlo integration, and the posterior is approximated by a variational distribution in terms of the Kulback-Lieber Divergence. This is done by the maximization the Evidence Lower Bound (ELBO). We use stochastic optimization based on the reparameterization trick (Kingma & Welling, 2014; Rezende et al., 2014) to approximate the expectation under the variational distribution, and also mini-batch stochastic optimization for expectations under data distribution. Thus, our training criteria is given by:
+
+$$
+E L B O = \frac { 1 } { N } \sum _ { ( x , t ) \sim p _ { d } ( x , t ) } \Bigl [ \frac { 1 } { K } \sum _ { \theta \sim q _ { \phi } ( \theta ) } [ \log p ( t | x , \theta ) ] - \beta \cdot D _ { K L } \{ q _ { \phi } ( \theta ) / / p ( \theta ) \} \Bigr ] ,
+$$
+
+where we introduce $\beta$ following Blundell et al. (2015).
+
+Our variational distribution is a factorized Gaussian distribution and for that reason we refer to our BNN approach as a basic approach, as we do not incorporate any improvement recently proposed for BNN models, such as normalizing flows, local reparameterization, and so on. Also, we use a standard normal density for the prior. We choose this simple approximation to demonstrate our starting hypothesis: that BNNs can be applied to improve the calibration of state-of-the-art DNN in a very efficient way. Our basic BNN model can be improved by using normalizing flows (Rezende & Mohamed, 2015; Kingma et al., 2016; Huang et al., 2018; van den Berg et al., 2018), auxiliary variables (Agakov & Barber, 2004; Ranganath et al., 2016; Maaløe et al., 2016), local reparameterization (Kingma et al., 2015), combinations of all of them (Louizos & Welling, 2017) or deterministic models (Wu et al., 2018). Also, Cremer et al. (2018) has recently pointed out that amortized inference leads to an additional gap in the bound, in addition to the $D _ { K L }$ gap between the true and variational posteriors; and we can also use other proposals to mitigate this effect (Shu et al., 2018; Kim et al., 2018).
+
+Finally, class predictions are assigned by first computing the logits of a test sample using the first DNN stage $\boldsymbol { B }$ , and then using them as inputs of our BNN to yield calibrated probabilities, which can be formalized as follows:
+
+$$
+\begin{array} { c } { l = { } } \\ { { } } \\ { { p ( t | x , \mathcal { O } ) \approx \displaystyle \frac { 1 } { M } \sum _ { i = 1 } ^ { M } p ( t | l , \theta _ { i } ) ; \theta _ { i } \sim q _ { \phi } ( \theta ) , } } \end{array}
+$$
+
+where $M$ is a value chosen on validation. Note that our proposed BNN is not as efficient as TS for calibration. However, the contributions to the weighted average can be fully parallelized computationally, as predictions do not depend on each other. Thus, we can use modern GPU libraries such as CUBLAS and batch-based operations to dramatically speed-up the process.
+
+# 4 RELATED WORK
+
+To our knowledge, TS (Guo et al., 2017) has been consistently reported as the best technique to improve calibration over a list of classical ways of improving calibration, such as histogram binning (Zadrozny & Elkan, 2001), isotonic regression (Zadrozny & Elkan, 2002b), Platt scaling (Platt, 1999) or Bayesian binning into quantiles (Naeini et al., 2015) among others. For a recent description and performance comparison with modern neural networks, see Guo et al. (2017). On the other hand, there are several works that study overconfident predictions and model uncertainty in different contexts, but without reporting an explicit measurement of calibration performance in deep neural models. For instance, Gal & Ghahramani (2015) connect Bernoulli dropout with BNNs, and Gal & Ghahramani (2016) links Gaussian processes with classical dropout regularized networks, showing how uncertainty estimates can be obtained from this networks. In the latter, the authors state that these Bayesian outputs are not calibrated. In Pereyra et al. (2017), an entropy term is added to the log-likelihood to relax overconfidence. Lakshminarayanan et al. (2017) propose training network ensembles with adversarial noise samples to output confident scores. Chen et al. (2018) propose a model that uses probes of the individual layers of the neural network classifier to create a confidence score for the network output. DeVries & Taylor (2018) train a second output obtained from the penultimate layer of the classifier to be confident by interpolation of the softmax output and the true value, scaled by this score. Lee et al. (2018) proposed a generative approach for detecting outof-distribution samples but evaluates calibration performance comparing their method with normal cross-entropy minimization, using TS as the calibration technique.
+
+On the side of BNNs, Kingma et al. (2015) formalize Gaussian dropout as a Bayesian approach. In Louizos & Welling (2017), novel BNNs are proposed, mixing inverse autoregressive flows (Kingma et al., 2016), auxiliary variables (Maaløe et al., 2016) and local reparameretization (Kingma et al., 2015). None of these approaches measure calibration explicitly on deep neural models, as we do. For instance, Louizos & Welling (2017) and Lakshminarayanan et al. (2017) evaluate uncertainty by training on one dataset and use it on another, expecting a maximum entropy output distribution. More recently, Zhang et al. (2018) propose an scalable inference algorithm that is also asymptotically accurate as MCMC algorithms.
+
+We compare our proposed BNN approach against TS, as to our knowledge it is the state of the art in calibration tasks involving deep neural models, according to the reviewed previous work. TS widely improves calibration without affecting the accuracy, and can be efficiently applied to any model. Formally, given $\mathcal { O }$ , TS maximizes the log-likelihood of the conditional distribution $p ( t | x / T )$ w.r.t. the parameter $T$ . In this case, $x$ also represents the output logits of the deep convolutional model.
+
+In Section 6, we will comparatively discuss the properties and results of our proposal with other works recently found in the literature for calibration on deep models, some of them based on implicit and explicit models.
+
+# 5 EXPERIMENTS
+
+We demonstrate calibration performance on several computer vision models on several datasets. We have used CIFAR10 and CIFAR100 databases (Krizhevsky et al., a;b); SVHN (Netzer et al., 2011); and a GENDER recognition task (Eidinger et al., 2014). We use a validation set randomly taken from the training set with 5000 samples for CIFAR10 and CIFAR100, 10000 samples for SVHN and 4005 for GENDER. This validation set is used to train the TS parameter and to choose the number of Monte Carlo samples, $M$ in equation 2. We report results for the best model on validation for all the tested configurations. We optimize the ELBO using adam optimization (Kingma & Ba, 2014), since it performed better than stochastic gradient descent on our previous experiments. We used $\beta = 0 . 1$ from the set $\lbrace 1 , 0 . 1 , 0 . 0 1 \rbrace$ as it behaves better on validation.
+
+In order to compare our experiments with uncalibrated and TS calibrated probabilities, we used an unbiased estimator of the Expected Calibration Error (ECE) computed as in Guo et al. (2017), with 15 bins. The ECE measures the expected value of the difference between accuracy and confidence:
+
+$$
+\mathrm { E C E } = \sum _ { i = 1 } ^ { 1 5 } \frac { | B _ { i } | } { N } | \mathrm { a c c } ( B _ { i } ) - \mathrm { c o n f } ( B _ { i } ) |
+$$
+
+where $N$ is the number of total samples; $B _ { i }$ represents the set of samples whose predictions $t$ confidence lie in bin $i$ ; $\mathrm { c o n f } ( B _ { i } )$ is the average confidence and $\operatorname { a c c } ( B _ { i } )$ is the accuracy of that bin. We also report the accuracy of our models. This is because a classifier can be perfectly calibrated, but useless from a classification point of view.
+
+Note that we evaluate our proposed method on several state of art configurations of computer vision neural networks over the mentioned datasets: Wide Residual Networks (Zagoruyko & Komodakis, 2016), Residual Networks (He et al., 2016b), Densely Connected Neural Networks (Huang et al., 2017), Pre-Activation Residual Networks (He et al., 2016a), Dual Path Networks (Chen et al., 2017), VGG (Simonyan & Zisserman, 2014) and ResNext (Xie et al., 2017). The results reported in this work are obtained from some pretrained neural networks.
+
+# 5.1 RESULTS
+
+Table 1 shows the results for the different datasets, original DNNs and calibration approaches. We presents results in $\%$ , i.e. multiplying by 100 the result obtained in equation 4. The most important point is that calibration is improved by a wide margin in every model except for two models in CIFAR100 and one model in SVHN. Table 1 shows that in average our proposed calibration method outperforms TS with an insignificant accuracy loss. This means that high expressive models can cope with the calibration task as long as uncertainty is correctly modelled. Therefore, we propose an alternative hypothesis to the one given in Guo et al. (2017) where the authors argued that the calibration space is simple. We argue that if highly complex models outperform simple ones is because the distribution of the calibration space is also complex but the low dimensionality of the logit space makes high expressive models overfit.
+
+We realized that more expressive models are needed by more complex tasks, like CIFAR100. For instance, ResNet-18 GENDER uses BNNs of two layers with two neurons per layer, while WideResNet 40x10 on CIFAR100 uses two layers of 2000 neurons. This reflects that, when dimensionality increases, more expressiveness is needed. Another important point observed in SVHN (see Densenet169, ResNet-50 and WideResNet 16x8) is that TS has degraded calibration by a factor of three in the worst case. In general BNNs do not degrade the calibration.
+
+One drawback of our basic approach is that in some cases we obtain slight accuracy degradation. Accuracy degradation is more relevant only for CIFAR100, however our BNN method reduces ECE15 by a factor of two in some experiments in this task. Moreover, in some cases we are able to improve both, accuracy and calibration, see WideResNet $4 0 \mathrm { x } 1 0$ for CIFAR10 or ResNet-18 for GENDER dataset. Thus, we cannot conclude that BNNs are calibrating at the cost of losing accuracy. This motivates us towards further research on this accuracy degradation, as we expect to solve it with more sophisticated approximations in future work. Possible hypothesis for this degradation are that either the gap between the variational and the true posterior is still large, the variance of the ELBO estimator is large and does not allow us to converge to a better optimal, or the expressiveness of the likelihood model is not enough to deal with the particular logit space distribution. We found that for more complex logit space distribution (100 dimensional in CIFAR100) we could get better accuracy and better ECE increasing the expressiveness of the model. On the other hand in simpler logit space distribution (2 dimensional in GENDER) we found that the expressiveness must be reduced.
+
+Table 1: ECE $1 5 ( \% )$ and Accuracy $( \% )$ comparing model uncalibrated, calibrated with TS and with BNN
+
+
uncalibrated
CIFAR10 Temp Scal
BNN
Acc
ECE
Acc
ECE
Acc
ECE
WideResNet28x10
96.13
1.835
96.13
0.518
96.08
0.243
DenseNet 121
95.49
2.643
95.49
1.011
95.26
0.600
DenseNet 169
95.49
2.664
95.49
0.826
95.29
0.511
Dual Path Network 92
95.18
2.995
95.18
1.072
95.03
0.730
ResNet 101
93.46
4.268
93.46
1.196
93.38
0.776
VGG 19
93.68
4.412
93.68
1.708
93.67
0.843
Preactivation ResNet 18
94.93
3.155
94.93
0.570
94.73
0.455
Preactivation ResNet 164
93.91
4.102
93.91
0.437
93.82
0.331
ResNext29_8x16
94.79
2.833
94.79
0.741
94.61
0.728
Wide ResNet 40x10
95.01
3.001
95.01
0.921
95.08
0.594
average
94.81
3.191
94.81
0.9
94.70
0.581
+
+
uncalibrated
SVHN Temp Scal
BNN
Acc
ECE
Acc
ECE
Acc
ECE
WideResNet 40x10
96.95
1.26
96.95
1.17
96.90
1.15
Densenet-121
96.76
2.021
96.76
1.092
96.69
0.716
Densenet-169
96.70
0.363
96.70
1.016
96.59
0.453
ResNet 50
96.47
0.886
96.47
1.030
96.33
0.857
Preactivation ResNet 164
96.20
2.539
96.20
1.079
96.08
0.921
Wide ResNet 16x8
96.88
0.710
96.88
1.318
96.82
0.739
Preactivation ResNet 18
96.15
1.574
96.15
0.645
96.05
1.096
average
96,587
1,336
96,587
1.05
96,494
0.847
+
+CIFAR100
+
+
uncalibrated
Temp Scal
BNN
Acc
ECE
Acc
ECE
Acc
ECE
WideResNet 28x10
80.39
4.853
80.39
4.276
77.59
2.456
DenseNet 121
78.8
8.724
78.8
3.476
75.9
2.534
ResNet 101
72
11.413
72
1.533
68.7
1.612
VGG 19
72.7
17.631
72.7
4.798
71.94
6
Preactivation ResNet 18
76.6
10.780
76.9
3.152
74.3
1.763
Preactivation ResNet 164
73.28
15.754
73.28
2.046
70.77
1.461
ResNext29_8x16
77.88
9.678
77.88
2.811
73.97
2.581
DenseNet 169
79.05
8.883
79.05
3.758
75.58
2.393
WideResNet 40x10
76.74
14.767
76.74
3.765
76.17
1.876
average
76,36
11,387
76,36
3,291
73,88
2,520
+
+
uncalibrated
GENDER Temp Scal
BNN
Acc
ECE
Acc
ECE
Acc
ECE
VGG-19
90.60
8.08
90.60
3.96
90.50
2.70
DenseNet 121
90.035
8.803
90.035
3.077
89.961
1.547
ResNet 18
90.42
8.45
90.42
3.8
90.44
3.082
average
90.352
8.444
90.352
3.612
90.30
2.443
+
+
+Figure 3: This figures compares the ECE performance for TS and BNN in test and validation. On the left (CIFAR10) we show the performance of different training parameters. For example 30MC_500 means that the ELBO was optimized using $3 0 \mathrm { M C }$ steps to estimate the expectation and 500 epochs of Adam optimization. On the right (CIFAR100) we show the performance of a BNN trained with different number of epochs up to 2000, showing the robustness against the course of learning.
+
+Finally, we realized that the BNNs are suitable and robust in the experiments carried out. In many experiments we found that all the tested configurations clearly outperform TS, as an example see figure 3.
+
+# 6 DISCUSSION AND CONTRIBUTIONS
+
+There is an increasing interest in adjusting confidence in deep learning, as this models are now becoming part of complex decision systems and critical applications. In the machine learning community there are two main approaches for reducing over-confidence, each one with its own pros and cons: implicit/online and explicit/offline. An implicit method aim at obtaining calibrated distributions directly at the output of the model, while explicit methods post-process the output of the model to be calibrated. Moreover both approaches can use either point estimate or Bayesian probabilistic models.
+
+Explicit approaches have several advantages. First, one can calibrate pre-softmax values provided by other practitioners. Therefore, privacy concerns regarding the model or the original data used to train that model are considered. Second, explicit approaches can be combined with implicit ones (Lakshminarayanan et al., 2017; Seo et al., 2018; Kumar et al., 2018; Chen et al., 2018; DeVries & Taylor, 2018) to further improve calibration, as example see (Kumar et al., 2018; Lee et al., 2018), where TS is used within implicit approaches. Third, one can use impractical models applied directly to a deep model in this offline stage, e.g Bayesian Neural or Gaussian Processed. Fourth, we do not need deep architectures for the Bayesian stage as the input includes the already learned representation of the DNN. This stage only focus on adjusting probabilities. A two layer BNN is unable to reach the same accuracy as a deep convolutional model by its own, however, combined with it, can yield to state-of-the-art accuracy and calibration results, as we showed. Fifth, models to be calibrated does not need to be retrained. This easily let us calibrate, as example, models that make use of pretrained DNN (transfer learning applications). Sixth, any probabilistic model can be calibrated: CNN, LSTM-RNN, BLSTM-RNN, SVM, network ensembles... Seventh, some implicit methods, such as Gal & Ghahramani (2016); Seo et al. (2018) require us to train our deep models with Dropout or stochastic depth, respectively, while ours is totally independent on how the deep model is trained. On the other hand, implicit approaches are less sensible to overfitting. Guo et al. (2017) shows that more complex models yield worse calibration performance. However, we have demonstrated that correctly managing uncertainty allow us using complex models for post-processing, improving state-of-the-art explicit approaches, and getting competitive results with the most recent published implicit ones.
+
+Regarding the calibration performance applied to deep learning models. Our method reaches competitive results with state-of-the-art implicit approaches on deep learning models (Seo et al., 2018; Kumar et al., 2018), and outperforms other proposed explicit (Guo et al., 2017) and implicit (Tran et al., 2018) techniques. In fact, Kumar et al. (2018) obtain competitive results when combining their implicit method with TS, which again shows that offline calibration is a desirable and flexible choice to be combined with implicit models. In fact, we have been able to apply BNNs to a task of interest for the machine learning community, which is the main criticism to these techniques. Kuleshov et al. (2018), which propose a procedure for calibrating Bayesian algorithms only for regression problems, and Lakshminarayanan et al. (2017) argue that a Bayesian treatment do not output calibrated distributions, as the Bayesian deep learning has several restrictions that the machine learning community is trying to overcome. However, this work demonstrates that if we let the major complexity of the task to a deep model, a simple Bayesian approach can adjust probabilities in an efficient way. As shown in our github, 2-layers Bayesian neural nets are enough to adjust probabilities.
+
+In terms of efficiency our BNN method presents several benefits in comparison to other Bayesian or point estimate methods. Although making predictions is more expensive than with TS, this predictions can be fully parallelized, as noted above, computing predictions in only one step. Moreover, a forward through a deep model and a shallow BNN is less computational expensive than a forward through a deep Bayesian convolutional model that requires several forward (and backward) for test (and training). For instance we have models based on BNNs (Gal & Ghahramani, 2015) and based on Gaussian processes (Tran et al., 2018; Milios et al., 2018). Network ensembles (Lakshminarayanan et al., 2017) reduce overconfidence and output calibrated distributions, but it is not measure in a deep model application, and only compared to Monte Carlo Dropout and to the number of ensembles. Ensembles can be also paralellized but in case of deep learning models, which is our field of study, the performance is compromised by the deepness of the different ensembles. As the authors state, computation restriction arises when evaluation of ensembles is done on ImageNet with the Inception network. Our model not only uses shallow neural nets but is only compromised by the number of classes of the task to be performed, and not by the complexity of the task at hand, as once we are able to reach a good accuracy we only focus on adjusting probabilities. Other implicit approaches such as Seo et al. (2018), that compute the cost to be optimized based on several predictions of the model, require to perform as many forwards per training samples as samples we want to estimate the cost parameter. This also compromise performance in deep models.
+
+Finally, Lakshminarayanan et al. (2017) propose to train models with proper scoring rules, such as negative log-likelihood. However, as demonstrated by Guo et al. (2017) it is not clear if deep generative models trained with this criteria presents uncalibrated distributions, at least in implicit approaches.
+
+# 7 CONCLUSION AND FUTURE WORK
+
+This work has shown the many beneficial properties of offline calibration with a Bayesian reasoning. We open future perspectives which include: incorporate Bayesian improvements on the variational posterior with the objective of reducing topologies (efficiency in training and test time), better calibration and accuracy; be able to analyze how the logit dimension influences the expressiveness needed by the likelihood model and which key factors of Bayesian algorithms are critical for good performance; how can we model prior information on the parameters to yield better results; other offline approaches based on Gaussian processes, as example; incorporate training based on different proper scoring rules; measure robustness against adversarial examples; and implement these models in task where having good calibration is critical.
+
+# REFERENCES
+
+Felix V. Agakov and David Barber. An auxiliary variational method. In Neural Information Processing, 11th International Conference, ICONIP 2004, Calcutta, India, November 22-25, 2004, Proceedings, pp. 561–566, 2004. doi: 10.1007/978-3-540-30499-9_86. URL https: //doi.org/10.1007/978-3-540-30499-9_86.
+
+Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. In Proceedings of the 32Nd International Conference on Machine Learning - Volume 37, ICML’15, pp. 1613–1622. JMLR.org, 2015. URL http://dl.acm.org/ citation.cfm?id=3045118.3045290.
+
+N. Brümmer and D. van Leeuwen. On calibration of language recognition scores. In Proc. of Odyssey, San Juan, Puerto Rico, 2006.
+
+Rich Caruana, Yin Lou, Johannes Gehrke, Paul Koch, Marc Sturm, and Noemie Elhadad. Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’15, pp. 1721–1730, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3664-2. doi: 10.1145/2783258.2788613. URL http://doi.acm.org/10.1145/2783258.2788613.
+
+Tongfei Chen, Jirí Navrátil, Vijay Iyengar, and Karthikeyan Shanmugam. Confidence scoring using whitebox meta-models with linear classifier probes. CoRR, abs/1805.05396, 2018. URL http://arxiv.org/abs/1805.05396.
+
+Yunpeng Chen, Jianan Li, Huaxin Xiao, Xiaojie Jin, Shuicheng Yan, and Jiashi Feng. Dual path networks. 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. 4467–4475. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7033-dual-path-networks.pdf.
+
+I. Cohen and M. Goldszmidt. Properties and benefits of calibrated classifiers. In Knowledge Discovery in Databases: PKDD 2004, volume 3202 of Lecture Notes in Computer Science, Heidelberg - Berlin, 2004. Springer. doi: https://doi.org/10.1007/978-3-540-30116-5_14.
+
+Chris Cremer, Xuechen Li, and David Duvenaud. Inference suboptimality in variational autoencoders. 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. 1086–1094, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings. mlr.press/v80/cremer18a.html.
+
+Terrance DeVries and Graham W. Taylor. Learning confidence for out-of-distribution detection in neural networks. CoRR, abs/1802.04865, 2018.
+
+Richard O. Duda, Peter E. Hart, and David G. Stork. Pattern Classification (2Nd Edition). WileyInterscience, New York, NY, USA, 2000. ISBN 0471056693.
+
+Eran Eidinger, Roee Enbar, and Tal Hassner. Age and gender estimation of unfiltered faces. Trans. Info. For. Sec., 9(12):2170–2179, December 2014. ISSN 1556-6013. doi: 10.1109/TIFS.2014.2359646. URL https://doi.org/10.1109/TIFS.2014.2359646.
+
+Yarin Gal and Zoubin Ghahramani. Bayesian convolutional neural networks with bernoulli approximate variational inference. CoRR, abs/1506.02158, 2015. URL http://arxiv.org/abs/ 1506.02158.
+
+Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In Proceedings of the 33rd International Conference on Machine Learning - Volume 48, ICML’16, pp. 1050–1059. JMLR.org, 2016. URL http://dl.acm. org/citation.cfm?id=3045390.3045502.
+
+Caglar Gulcehre, Orhan Firat, Kelvin Xu, Kyunghyun Cho, and Yoshua Bengio. On integrating a language model into neural machine translation. Comput. Speech Lang., 45(C):137–148, September 2017. ISSN 0885-2308. doi: 10.1016/j.csl.2017.01.014. URL https://doi.org/10.1016/ j.csl.2017.01.014.
+
+Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1321–1330, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/guo17a.html.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016a.
+
+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 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778, 2016b. doi: 10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90.
+
+Geoffrey Hinton, Li Deng, Dong Yu, George E. Dahl, Abdel rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N. Sainath, , and Brian Kingsbury. Deep neural networks for acoustic modelling in speech recognition. the shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012. doi: 10.1109/MSP.2012.2205597.
+
+Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron C. Courville. Neural autoregressive flows. In ICML, 2018.
+
+Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2261–2269, 2017.
+
+Yoon Kim, Sam Wiseman, Andrew Miller, David Sontag, and Alexander Rush. Semi-amortized variational autoencoders. 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. 2683–2692, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/kim18e.html.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014.
+
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes, 2014.
+
+Diederik P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2575– 2583. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5666-variational-dropout-and-the-local-reparameterization-trick. pdf.
+
+Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4743–4751. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/ 6581-improved-variational-inference-with-inverse-autoregressive-flow. pdf.
+
+Daphne Koller and Nir Friedman. Probabilistic Graphical Models: Principles and Techniques - Adaptive Computation and Machine Learning. The MIT Press, Cambridge, MA, USA, 2009. ISBN 0262013193, 9780262013192.
+
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 (canadian institute for advanced research). a. URL http://www.cs.toronto.edu/\~kriz/cifar.html.
+
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-100 (canadian institute for advanced research). b. URL http://www.cs.toronto.edu/\~kriz/cifar.html.
+
+Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. In ICML, volume 80 of JMLR Workshop and Conference Proceedings, pp. 2801–2809. JMLR.org, 2018.
+
+Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. 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. 2805–2814, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/kumar18a.html.
+
+Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. 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. 6402– 6413. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7219-simple-and-scalable-predictive-uncertainty-estimation-using-deep-ensembles. pdf.
+
+Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. International Conference On Learning Representations, abs/1711.09325, 2018.
+
+Christos Louizos and Max Welling. Multiplicative normalizing flows for variational Bayesian neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2218–2227, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/louizos17a.html.
+
+Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1445–1454. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id=3045390.3045543.
+
+Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013a. URL http://arxiv.org/abs/1301. 3781.
+
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Proceedings of the 26th International Conference on Neural Information Processing Systems - Volume 2, NIPS’13, pp. 3111–3119, USA, 2013b. Curran Associates Inc. URL http://dl.acm.org/citation.cfm?id= 2999792.2999959.
+
+Dimitrios Milios, Raffaello Camoriano, Pietro Michiardi, Lorenzo Rosasco, and Maurizio Filippone. Dirichlet-based gaussian processes for large-scale calibrated classification, 2018.
+
+Tom Minka. Inferring a Gaussian distribution, http://www.stat.cmu.edu/ $\sim$ minka/papers/gaussian.html.
+
+Mahdi Pakdaman Naeini, Gregory F. Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, AAAI’15, pp. 2901–2907. AAAI Press, 2015. ISBN 0-262-51129-0. URL http://dl.acm.org/citation.cfm?id=2888116.2888120.
+
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. 2011. URL https://www-cs. stanford.edu/\~twangcat/papers/nips2011_housenumbers.pdf.
+
+Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In Proceedings of the 22nd International Conference on Machine Learning, pp. 625–632, Bonn, Germany, 2005. doi: 10.1145/1102351.1102430.
+
+Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey E. Hinton. Regularizing neural networks by penalizing confident output distributions. CoRR, abs/1701.06548, 2017.
+
+John C. Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In ADVANCES IN LARGE MARGIN CLASSIFIERS, pp. 61–74. MIT Press, 1999.
+
+Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 324–333, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/ v48/ranganath16.html.
+
+Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. In Proceedings of the 32Nd International Conference on Machine Learning - Volume 37, ICML’15, pp. 1530–1538. JMLR.org, 2015. URL http://dl.acm.org/citation.cfm?id=3045118. 3045281.
+
+Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1278–1286, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/rezende14.html.
+
+Seonguk Seo, Paul Hongsuck Seo, and Bohyung Han. Confidence calibration in deep neural networks through stochastic inferences, 2018.
+
+Rui Shu, Hung H. Bui, Shengjia Zhao, Mykel J. Kochenderfer, and Stefano Ermon. Amortized inference regularization. CoRR, abs/1805.08913, 2018. URL http://arxiv.org/abs/ 1805.08913.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition, 2014.
+
+Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A. Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA., pp. 4278–4284, 2017. URL http://aaai.org/ocs/index.php/AAAI/ AAAI17/paper/view/14806.
+
+Gia-Lac Tran, Edwin V. Bonilla, John P. Cunningham, Pietro Michiardi, and Maurizio Filippone. Calibrating deep convolutional gaussian processes, 2018.
+
+Zoltán Tüske, Ralf Schlüter, and Hermann Ney. Investigation on LSTM recurrent n-gram language models for speech recognition. In Interspeech, pp. 3358–3362. ISCA, 2018.
+
+Rianne van den Berg, Leonard Hasenclever, Jakub M. Tomczak, and Max Welling. Sylvester normalizing flows for variational inference. CoRR, abs/1803.05649, 2018.
+
+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. Curran Associates, Inc., 2017. URL http: //papers.nips.cc/paper/7181-attention-is-all-you-need.pdf.
+
+Anqi Wu, Sebastian Nowozin, Edward Meeds, Richard E. Turner, José Miguel Hernández-Lobato, and Alexander L. Gaunt. Fixing variational bayes: Deterministic variational inference for bayesian neural networks, 2018.
+
+Saining Xie, Ross B. Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5987–5995, 2017.
+
+B. Zadrozny and C. Elkan. Transforming classifier scores into accurate multiclass probability estimates. Proceeding of the Eight International Conference on Knowledge Discovery and Data Mining (KDD’02), 2002a. doi: 10.1145/775047.775151.
+
+Bianca Zadrozny and Charles Elkan. Obtaining calibrated probability estimates from decision trees and naive bayesian classifiers. In Proceedings of the Eighteenth International Conference on Machine Learning, ICML ’01, pp. 609–616, San Francisco, CA, USA, 2001. Morgan Kaufmann Publishers Inc. ISBN 1-55860-778-1. URL http://dl.acm.org/citation.cfm?id= 645530.655658.
+
+Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In Proceedings of the Eighth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’02, pp. 694–699, New York, NY, USA, 2002b. ACM. ISBN 1-58113-567-X. doi: 10.1145/775047.775151. URL http://doi.acm.org/10.1145/ 775047.775151.
+
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Edwin R. Hancock Richard C. Wilson and William A. P. Smith (eds.), Proceedings of the British Machine Vision Conference (BMVC), pp. 87.1–87.12. BMVA Press, September 2016. ISBN 1-901725-59-6. doi: 10.5244/C. 30.87. URL https://dx.doi.org/10.5244/C.30.87.
+
+Yichuan Zhang, José Miguel Hernández-Lobato, and Zoubin Ghahramani. Variational measure preserving flows. CoRR, abs/1805.10377, 2018. URL http://arxiv.org/abs/1805. 10377.
+
+# APPENDIX A: TOY EXAMPLE ON BAYESIAN CALIBRATION
+
+In this case we consider a problem of density assignment. Formally, we have a set of data $\mathcal { O } =$ $\{ x _ { i } \} _ { i = 1 } ^ { N } , x \in \mathbb { R } ^ { 2 }$ belonging to class $c _ { 1 }$ , where its true distribution belongs to the family of bimodal Gaussian distributions. We want to assign a unimodal Gaussian parametric model $p ( x | \theta )$ where $\theta =$ $( \mu , \Sigma )$ . Note that in this case the parametric model would be unable to recover the true distribution, which is likely to happen in deep learning models due to the complexity of the distributions these models cope with.
+
+In the Bayesian framework the density is computed by averaging each possible model parameterized by $\theta$ , using the posterior distribution computed from the observed data as the distribution over which we take the expectation:
+
+$$
+p ( x | \mathcal { O } , c _ { 1 } ) = \int d \theta _ { 1 } p ( x | \theta _ { 1 } ) \cdot p ( \theta _ { 1 } | \mathcal { O } )
+$$
+
+On the other hand, maximum likelihood would represent the data using the ML estimator $\theta ^ { M L }$ . In this setting, it can be computed uniquely as the loss function has a global optimum.
+
+Figure 4 shows an example of how model averaging improves the assignments of probabilities, and therefore model calibration, contrary to ML. The figure shows some data points generated by our training distribution, where the color of each point is different for each of the Gaussian mixtures. A point-estimate maximum likelihood (ML) model $p ( x | \theta _ { 1 } ^ { M L } )$ (we use $\theta _ { 1 } ^ { M L }$ to refer to the model assigned to $c _ { 1 }$ datapoints) is fitted and represented as red contour lines. It can be seen that the ML model fails to accurately represent the true data distribution, although it can represent one of the two clusters of data moderately well. Two samples not observed in the training set are shown as a black and a gray dot. Also, different plausible likelihood models are represented in dashed contour plots.
+
+We now assume that we have another set of data belonging to class $c _ { 2 }$ , but not represented in this figure as it is far in the data space. We fit $p ( x | \theta _ { 2 } ^ { M L } )$ for this dataset. We assume the prior distribution over the classes to be equal for both classes, and based on Bayes theory decision, our decision rule is given by:
+
+
+Figure 4: Bimodal distribution of 2-dimensional training data (orange and blue points) with Maximum Likelihood estimation of a Gaussian distribution (red contour) and other possible likelihood models explaining the data (dashed plots). Green and black dots represent data not seen in the training data, for which densities are to be assigned. Best viewed in color.
+
+$$
+{ \frac { P ( c _ { 1 } | x ) } { P ( c _ { 2 } | x ) } } = { \frac { p ( x | c _ { 1 } ) } { p ( x | c _ { 2 } ) } } ,
+$$
+
+where for generality we do not explicitly indicate if the model $p ( x | c )$ is computed in the ML or Bayesian setting. As long as $p ( x | c _ { 1 } ) > \dot { p } ( x | c _ { 2 } )$ we will assign $c _ { 1 }$ to a given sample $x$ . It is clearly seen that for both the black and gray test samples, the density assigned by $p ( x | c _ { 1 } )$ is greater and thus these samples are assigned to class $c _ { 1 }$ . In fact, if both samples belong to this class we will have a perfect performance in terms of accuracy.
+
+However, although the black dot is correctly assigned to $c _ { 1 }$ , the red ML model assigns extremely low density to it which is undesirable, as it has been actually generated like the rest of the data. This is not a desired behaviour, since it is in fact likely to belong to the blue component of the distribution as it is close to blue training samples in the data space. For that reason, if we compute probabilities under this model, the ultimate confidence would not reflect the true underlying process, and the calibration of the model will be affected. This effect is what we argue is happening in a classification framework: although we correctly choose the class (the cluster $c _ { 1 }$ ) the ML model does not assign a correct probability.
+
+On the other hand, if we take average of all the different models parameterized by $\theta = ( \mu , \Sigma ) ; \mu \in$ $\mathbb { R } ^ { 2 } , \Sigma \in \mathbb { R } ^ { 2 \mathrm { x 2 } }$ (see dashed plots in the figure), the density assigned to the black dot would be raised by some of the models that explain the blue data points. The importance given to each likelihood is given by the posterior $p ( \theta | \mathcal { O } )$ . Therefore, other possibilities apart from the ML density will be considered, and thus we will be better modelling the probabilistic information. For an exact theoretical example on this same density estimation problem see (Minka, 2001). There you can find the exact posterior distribution using non-informative priors on the parameters.
\ No newline at end of file
diff --git a/md/train/SJHRf5nW93/SJHRf5nW93.md b/md/train/SJHRf5nW93/SJHRf5nW93.md
new file mode 100644
index 0000000000000000000000000000000000000000..b97dab6aca0d41573a64ffc5b999a6cef99cc9c0
--- /dev/null
+++ b/md/train/SJHRf5nW93/SJHRf5nW93.md
@@ -0,0 +1,291 @@
+# Subgraph Federated Learning with Missing Neighbor Generation
+
+Ke Zhang1,4, Carl Yang1∗, Xiaoxiao $\mathbf { L i } ^ { 2 }$ , Lichao $\mathbf { S u n ^ { 3 } }$ , Siu Ming $\mathbf { Y i u ^ { 4 } }$
+
+1Emory University, 2University of British Columbia, 3Lehigh University, 4University of Hong Kon kzhang2@cs.hku.hk, j.carlyang@emory.edu, xiaoxiao.li@ece.ubc.ca, lis221@lehigh.edu, smyiu@cs.hku.hk
+
+# Abstract
+
+Graphs have been widely used in data mining and machine learning due to their unique representation of real-world objects and their interactions. As graphs are getting bigger and bigger nowadays, it is common to see their subgraphs separately collected and stored in multiple local systems. Therefore, it is natural to consider the subgraph federated learning setting, where each local system holds a small subgraph that may be biased from the distribution of the whole graph. Hence, the subgraph federated learning aims to collaboratively train a powerful and generalizable graph mining model without directly sharing their graph data. In this work, towards the novel yet realistic setting of subgraph federated learning, we propose two major techniques: (1) FedSage, which trains a GraphSage model based on FedAvg to integrate node features, link structures, and task labels on multiple local subgraphs; (2) FedSage+, which trains a missing neighbor generator along FedSage to deal with missing links across local subgraphs. Empirical results on four real-world graph datasets with synthesized subgraph federated learning settings demonstrate the effectiveness and efficiency of our proposed techniques. At the same time, consistent theoretical implications are made towards their generalization ability on the global graphs.
+
+# 1 Introduction
+
+Graph mining leverages links among connected nodes in graphs to conduct inference. Recently, graph neural networks (GNNs) have gained applause with impressing performance and generalizability in many graph mining tasks [29, 11, 16, 20, 32]. Similar to machine learning tasks in other domains, attaining a well-performed GNN model requires its training data to not only be sufficient but also follow the similar distribution as general queries. While in reality, data owners often collect limited and biased graphs and cannot observe the global distribution. With heterogeneous subgraphs separately stored in local data owners, accomplishing a globally applicable GNN requires collaboration.
+
+Federated learning (FL) [17, 35], targeting at training machine learning models with data distributed in multiple local systems to resolve the information-silo problem, has shown its advantage in enhancing the performance and generalizability of the collaboratively trained models without the need of sharing any actual data. For example, FL has been devised in computer vision (CV) and natural language processing (NLP) to allow the joint training of powerful and generalizable deep convolutional neural networks and language models on separately stored datasets of images and texts [19, 6, 18, 39, 13].
+
+Motivating Scenario. Taking the healthcare system as an example, as shown in Fig. 1, residents of a city may go to different hospitals for various reasons. As a result, their healthcare data, such as demographics and living conditions, as well as patient interactions, such as co-staying in a sickroom and co-diagnosis of a disease, are stored only within the hospitals they visit. When any healthcare problem is to be studied in the whole city, e.g., the prediction of infections when a pandemic occurs, a single powerful graph mining model is needed to conduct effective inference over the entire global patient network, which contains all subgraphs from different hospitals. However, it is rather difficult to let all hospitals share their patient networks with others to train the graph mining model due to conflicts of interests and privacy concerns.
+
+
+Figure 1: A toy example of the distributed subgraph storage system: In this example, there are four hospitals and a medical administration center. The global graph records, for a certain period, the city’s patients (nodes), their information (attributes), and interactions (links). Specifically, the left part of the figure shows how the global graph is stored in each hospital, where the grey solid lines are the links explicitly stored in each hospital, and the red dashed lines are the cross-hospital links that may exist but are not stored in any hospital. The right part of the figure indicates our goal that without sharing actual data, the system obtains a globally powerful graph mining model.
+
+In such scenarios, it is desirable to train a powerful and generalizable graph mining model over multiple distributed subgraphs without actual data sharing. However, this novel yet realistic setting brings two unique technical challenges, which have never been explored so far.
+
+Challenge 1: How to jointly learn from multiple local subgraphs? In our considered scenario, the global graph is distributed into a set of small subgraphs with heterogeneous feature and structure distributions. Training a separate graph mining model on each subgraph may not capture the global data distribution and is also prone to overfitting. Moreover, it is unclear how to integrate multiple graph mining models into a universally applicable one that can handle any queries from the underlying global graph.
+
+Solution 1: FedSage: Training GraphSage with FedAvg. To attain a powerful and generalizable graph mining model from small and biased subgraphs distributed in multiple local owners, we develop a framework of subgraph federated learning, specifically, with the vanilla mechanism of FedAvg [21]. As for the graph mining model, we resort to GraphSage [11], due to its advantages of inductiveness and scalability. We term this framework as FedSage.
+
+Challenge 2: How to deal with missing links across local subgraphs? Unlike distributed systems in other domains such as CV and NLP, whose data samples of images and texts are isolated and independent, data samples in graphs are connected and correlated. Most importantly, in a subgraph federated learning system, data samples in each subgraph can potentially have connections to those in other subgraphs. These connections carrying important information of node neighborhoods and serving as bridges among the data owners, however, are never directly captured by any data owner.
+
+Solution 2: FedSage+: Generating missing neighbors along FedSage. To deal with crosssubgraph missing links, we add a missing neighbor generator on top of FedSage and propose a novel FedSage+ model. Specifically, for each data owner, instead of training the GraphSage model on the original subgraph, it first mends the subgraph with generated cross-subgraph missing neighbors and then applies FedSage on the mended subgraph. To obtain the missing neighbor generator, each data owner impairs the subgraph by randomly holding out some nodes and related links and then trains the generator based on the held-out neighbors. Training the generator on an individual local subgraph enables it to generate potential missing links within the subgraph. Further training the generator in our subgraph FL setting allows it to generate missing neighbors across distributed subgraphs.
+
+We conduct experiments on four real-world datasets with different numbers of data owners to better simulate the application scenarios. According to our results, both of our models outperform locally trained classifiers in all scenarios. Compared to FedSage, FedSage+ further promotes the performance of the outcome classifier. Further in-depth model analysis shows the convergence and generalization ability of our frameworks, which is corroborated by our theoretical analysis in the end.
+
+# 2 Related works
+
+Graph mining. Graph mining emerges its significance in analyzing the informative graph data, which range from social networks to gene interaction networks [31, 33, 34, 24]. One of the most frequently applied tasks on graph data is node classification. Recently, graph neural networks (GNNs), e.g., graph convolutional networks (GCN) [16] and GraphSage [11], improved the state-of-the-art in node classification with their elegant yet powerful designs. However, as GNNs leverage the homophily of nodes in both node features and link structures to conduct the inference, they are vulnerable to the perturbation on graphs [4, 40, 41]. Robust GNNs, aiming at reducing the degeneration in GNNs caused by graph perturbation, are gaining attention these days. Current robust GNNs focus on the sensitivity towards modifications on node features [3, 42, 15] or adding/removing edges on the graph [37]. However, neither of these two types recapitulates the missing neighbor problem, which affects both the feature distribution and structure distribution.
+
+To obtain a node classifier with good generalizability, the development of domain adaptive GNN sheds light on adapting a GNN model trained on the source domain to the target domain by leveraging underlying structural consistency [38, 36, 28]. However, in the distributed system we consider, data owners have subgraphs with heterogeneous feature and structure distributions. Moreover, direct information exchanges among subgraphs, such as message passing, are fully blocked due to the missing cross-subgraph links. The violation of the domain adaptive GNNs’ assumptions on alignable nodes and cross-domain structural consistency denies their usage in the distributed subgraph system.
+
+Federated learning. FL is proposed for cross-institutional collaborative learning without sharing raw data [17, 35, 21]. FedAvg [21] is an efficient and well-studied FL method. Similar to most FL methods, it is originally proposed for traditional machine learning problems [35] to allow collaborative training on silo data through local updating and global aggregation. The ecently proposed meta-learning framework [9, 23, 14] that exploits information from different data sources to obtain a general model attracts FL researchers [8]. However, meta-learning aims to learn general models that easily adapt to different local tasks, while we learn a generalizable model from diverse data owners to assist in solving a global task. In the distributed subgraph system, to obtain a globally applicable model without sharing local graph data, we borrow the idea of FL to collaboratively train GNNs.
+
+Federated graph learning. Recent researchers have made some progress in federated graph learning. There are existing FL frameworks designed for the graph data learning task [12, 27, 30]. [12] design graph-level FL schemes with graph datasets dispersed over multiple data owners, which are inapplicable to our distributed subgraph system construction. [27] proposes an FL method for the recommendation problem with each data owner learning on a subgraph of the whole recommendation user-item graph. It considers a different scenario assuming subgraphs have overlapped items (nodes), and the user-item interactions (edges) are distributed but completely stored in the system, which ignores the possible cross-subgraph information lost in real-world scenarios. However, we study a more challenging yet realistic case in the distributed subgraph system, where cross-subgraph edges are totally missing.
+
+In this work, we consider the commonly existing yet not studied scenario, i.e., distributed subgraph system with missing cross-subgraph edges. Under this scenario, we focus on obtaining a globally applicable node classifier through FL on distributed subgraphs.
+
+# 3 FedSage
+
+In this section, we first illustrate the definition of the distributed subgraph system derived from real-world application scenarios. Based on this system, we then formulate our novel subgraph FL framework and a vanilla solution called FedSage.
+
+# 3.1 Subgraphs Distributed in Local Systems
+
+Notation. We denote a global graph as $G = \{ V , E , X \}$ , where $V$ is the node set, $X$ is the respective node feature set, and $E$ is the edge set. In the FL system, we have the central server $S$ , and $M$ data owners with distributed subgraphs. $G _ { i } = \{ V _ { i } , E _ { i } , X _ { i } \}$ is the subgraph owned by $D _ { i }$ , for $i \in [ M ]$ .
+
+Problem setup. For the whole system, we assume $V = V _ { 1 } \cup \cdots \cup V _ { M }$ . To simulate the scenario with most missing links, we assume no overlapping nodes shared across data owners, namely $V _ { i } \cap V _ { j } = \emptyset$ for $\forall i , j \in [ M ]$ and $i \neq j$ . Note that the central server $S$ only maintains a graph mining model with no actual graph data stored. Any data owner $D _ { i }$ cannot directly retrieve $u \in V _ { j }$ from another data owner $D _ { j }$ . Therefore, for an edge $e _ { v , u } \in E$ , where $v \in V _ { i }$ and $u \in V _ { j }$ , $e _ { v , u } \notin E _ { i } \cup E _ { j }$ , that is, $e _ { v , u }$ might exist in reality but is not stored anywhere in the whole system.
+
+For the global graph $G = \{ V , E , X \}$ , every node $v \in V$ has its features $x _ { v } \in X$ and one label $y _ { v } \in Y$ for the downstream task, e.g., node classification. Note that for $v \in V$ , $v$ ’s feature $x _ { v } \in \mathbb { R } ^ { d _ { x } }$ and respective label $y _ { v }$ is a $d _ { y }$ -dimensional one-hot vector. In a typical GNN, predicting a node’s label requires an ego-graph of the queried node. For a node $v$ from graph $G$ , we denote the queried ego-graph of $v$ as $G ( v )$ , and $( G ( v ) , y _ { v } ) \sim \mathcal { D } _ { G }$ .
+
+With subgraphs distributed in the system defined above, we formulate our goal as follows.
+
+Goal. The system exploits an $\mathrm { F L }$ framework to collaboratively learn on isolated subgraphs in all data owners, without raw graph data sharing, to obtain a global node classifier $F$ . The learnable weights $\phi$ in $F$ is optimized for queried ego-graphs following the distribution of ones drawn from the global graph $G$ . We formalize the problem as finding $\phi ^ { * }$ that minimizes the aggregated risk
+
+$$
+\boldsymbol { \phi } ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { \phi } } \mathcal { R } ( \boldsymbol { F } ( \boldsymbol { \phi } ) ) = \frac { 1 } { M } \sum _ { i } ^ { M } \mathcal { R } _ { i } ( F _ { i } ( \boldsymbol { \phi } ) ) ) ,
+$$
+
+where $\mathcal { R } _ { i }$ is the local empirical risk defined as
+
+$$
+\begin{array} { r } { \mathcal { R } _ { i } \big ( F _ { i } ( \phi ) \big ) : = \mathbb { E } _ { ( G _ { i } , Y _ { i } ) \sim \mathcal { D } _ { G _ { i } } } [ \ell ( F _ { i } ( \phi ; G _ { i } ) , Y _ { i } ) ) ] , } \end{array}
+$$
+
+where $\ell$ is a task-specific loss function
+
+$$
+\ell : = \frac { 1 } { | V _ { i } | } \sum _ { v \in V _ { i } } l ( \phi ; G _ { i } ( v ) , y _ { v } ) .
+$$
+
+# 3.2 Collaborative Learning on Isolated Subgraphs
+
+To fulfill the system’s goal illustrated above, we leverage the simple and efficient FedAvg framework [21] and fix the node classifier $F$ as a GraphSage model. The inductiveness and scalability of the GraphSage model facilitate both the training on diverse subgraphs with heterogeneous query distributions and the later inference upon the global graph. We term the GraphSage model trained with the FedAvg framework as FedSage.
+
+r a queried node -hop neighborho $v \in V$ , a glraph ally shared to conduct $K$ -layer GraphSage classifier ediction with learnable par $F$ integeters $v$ $K$ $G$ $\phi = \{ \phi ^ { k } \} _ { k = 1 } ^ { K }$ Taking a subgraph $G _ { i }$ as an example, for $v \in V _ { i }$ with features as $h _ { v } ^ { 0 } = x _ { v }$ , at each layer $k \in [ K ]$ , $F$ computes $v$ ’s representation $h _ { v } ^ { k }$ as
+
+$$
+h _ { v } ^ { k } = \sigma \left( \phi ^ { k } \cdot \left( h _ { v } ^ { k - 1 } | | A g g \left( \left\{ h _ { u } ^ { k - 1 } , \forall u \in \mathcal { N } _ { G _ { i } } ( v ) \right\} \right) \right) \right) ,
+$$
+
+where $\mathcal { N } _ { G _ { i } } ( v )$ is the set of $v$ ’s neighbors on graph $G _ { i } , | |$ is the concatenation operation, $A g g ( \cdot )$ is the aggregator (e.g., mean pooling) and $\sigma$ is the activation function (e.g., ReLU).
+
+With $F$ outputting the inference label $\widetilde { y } _ { v } = \mathrm { S o f t m a x } ( h _ { v } ^ { K } )$ for $v \in V _ { i }$ , the supervised loss function $l ( \phi | \cdot )$ is defined as follows
+
+$$
+\mathcal { L } ^ { c } = l ( \phi | G _ { i } ( v ) , y _ { v } ) = C E ( \widetilde { y } _ { v } , y _ { v } ) = - \left[ y _ { v } \log \widetilde { y } _ { v } + ( 1 - y _ { v } ) \log \left( 1 - \widetilde { y } _ { v } \right) \right] ,
+$$
+
+where $C E ( \cdot )$ is the cross entropy function, $G _ { i } ( v )$ is $v$ ’s K-hop ego-graph on $G _ { i }$ , which contains the information of $v$ and its K-hop neighbors on $G _ { i }$ .
+
+In FedSage, the distributed subgraph system obtains a shared global node classifier $F$ parameterized by $\phi$ through $e _ { c }$ epochs of training. During each epoch $t$ , every $D _ { i }$ first locally computes $\phi _ { i } \gets$ $\phi - \eta \nabla \ell ( \phi | \{ ( G _ { i } ( v ) , y _ { v } ) | v \in V _ { i } ^ { t } \} )$ , where $V _ { i } ^ { t } \subseteq V _ { i }$ contains the sampled training nodes for epoch $t$ , and $\eta$ is the learning rate; then the central server $S$ collects the latest $\{ \phi _ { i } | i \in [ \bar { M } ] \}$ ; next, through averaging over $\{ \phi _ { i } | \bar { i } \in [ M ] \}$ , $S$ sets $\phi$ as the averaged value; finally, $S$ broadcasts $\phi$ to data owners and finishes one round of training $F$ . After $e _ { c }$ epochs, the entire system retrieves $F$ as the outcome global classifier, which is not limited to or biased towards the queries in any specific data owner.
+
+Unlike FL on Euclidean data, nodes in the distributed subgraph system can have potential interactions with each other across subgraphs. However, as the cross-subgraph links cannot be captured by any data owner in the system, incomplete neighborhoods, compared to those on the global graph, commonly exist therein. Thus, directly aggregating incomplete queried ego-graph information through FedSage restricts the outcome $F$ from achieving the desideratum of capturing the global query distribution.
+
+
+Figure 2: Joint training of missing neighbor generation and node classification.
+
+# 4 FedSage+
+
+In this section, we propose a novel framework of FedSage $^ +$ , i.e., subgraph FL with missing neighbor generation. We first design a missing neighbor generator (NeighGen) and its training schema via graph mending. Then, we describe the joint training of NeighGen and GraphSage to better achieve the goal in Section 3.1. Without loss of generality, in the following demonstration, we take NeighGeni, i.e., the missing neighbor generator of $D _ { i }$ , as an example, where $i \in [ M ]$ .
+
+# 4.1 Missing Neighbor Generator (NeighGen)
+
+Neural architecture of NeighGen. As shown in Fig. 2, NeighGen consists of two modules, i.e., an encoder $H ^ { e }$ and a generator $H ^ { g }$ . We describe their designs in details in the following.
+
+$H ^ { e }$ : A GNN model, i.e., a K-layer GraphSage encoder, with parameters $\theta ^ { e }$ . For node $v \in V _ { i }$ on the input graph $G _ { i }$ , $H ^ { e }$ computes node embeddings $Z _ { i } = \{ z _ { v } | z _ { v } \stackrel { \cdot } { = } h _ { v } ^ { K } , z _ { v } \in \mathbb { R } ^ { d _ { z } } , v \in V _ { i } \}$ according to Eq. (1) by substituting $\phi$ , $G$ with $\theta ^ { e }$ and $G _ { i }$ .
+
+$H ^ { g }$ : A generative model recovering missing neighbors for the input graph based on the node embedding. $H ^ { g }$ contains dGen and fGen, where dGen is a linear regression model parameterized by $\theta ^ { d }$ that predicts the numbers of missing neighbors $\widetilde { N } _ { i } = \{ \widetilde { n } _ { v } | \widetilde { n } _ { v } \in \mathbb { N } , v \in V _ { i } \}$ , and fGen is a feature generator parameterized by $\theta ^ { f }$ that generates a set of $\widetilde { N } _ { i }$ feature vectors $\widetilde { X } _ { i } = \{ \widetilde { x } _ { v } | \widetilde { x } _ { v } \in$ $\mathbb { R } ^ { \widetilde { n } _ { v } \times d _ { x } } , \widetilde { n } _ { v } \in \widetilde { N } _ { i } , v \in V _ { i } \}$ e e. Both dGen and fGen are constructed as fully connected neural networks e(FNNs), while fGen is further equipped with a Gaussian noise generator $\mathbf { N } ( 0 , 1 )$ that generates $d _ { z }$ -dimensional noise vectors and a random sampler $R$ . For node $v \in V _ { i }$ , fGen is variational, which generates the missing neighbors’ features for $v$ after inserting noises into the embedding $z _ { v }$ , while $R$ ensures fGen to output the features of a specific number of neighbors by sampling $\widetilde { n } _ { v }$ feature vectors from the feature generator’s output. Mathematically, we have
+
+$$
+\widetilde { n } _ { v } = \sigma ( ( { \boldsymbol { \theta } } ^ { d } ) ^ { T } \cdot { \boldsymbol { n } } _ { v } ) , \operatorname { a n d } \widetilde { x } _ { v } = R \left( \sigma \left( ( { \boldsymbol { \theta } } ^ { f } ) ^ { T } \cdot ( z _ { v } + \mathbf { N } ( 0 , 1 ) ) \right) , \widetilde { { \boldsymbol { n } } } _ { v } \right) .
+$$
+
+Graph mending simulation. For each data owner in our system, we assume that only a particular set of nodes have cross-subgraph missing neighbors. The assumption is realistic yet non-trivial for it both seizing the quiddity of the distributed subgraph system, and allowing us to locally simulate the missing neighbor situation through a graph impairing and mending process. Specifically, to simulate a graph mending process during the training of NeighGen, in each local subgraph $G _ { i }$ , we randomly hold out $h \%$ of its nodes $V _ { i } ^ { h } \subset V _ { i }$ and all links involving them $E _ { i _ { - } } ^ { h } = \{ e _ { u v } | u \stackrel { - } { \in } \bar { V } _ { i } ^ { h }$ or $v \in V _ { i } ^ { h } \} \subset \mathsf { \bar { E } } _ { i }$ , to form an impaired subgraph, denoted as $\bar { G } _ { i }$ . $\bar { G } _ { i } = \mathsf { \bar { \{ V } } _ { i } , \bar { E } _ { i } , \bar { X } _ { i } \}$ contains the impaired set of nodes $\bar { V } _ { i } = V _ { i } \setminus V _ { i } ^ { h }$ , the corresponding nodes features ${ \bar { X } } _ { i } = X _ { i } \setminus X _ { i } ^ { h }$ and edges $\bar { E } _ { i } = E _ { i } \setminus E _ { i } ^ { h }$ .
+
+Accordingly, based on the ground-truth missing nodes $V _ { i } ^ { h }$ and links $E _ { i } ^ { h }$ , the training of NeighGen on the impaired graph $\bar { G } _ { i }$ boils down to jointly training dGen and fGen as below.
+
+$$
+\mathcal { L } ^ { n } = \lambda ^ { d } \mathcal { L } ^ { d } + \lambda ^ { f } \mathcal { L } ^ { f } = \lambda ^ { d } \frac { 1 } { | \bar { V } _ { i } | } \sum _ { v \in \bar { V } _ { i } } L _ { 1 } ^ { S } \big ( \widetilde { n } _ { v } - n _ { v } \big ) + \lambda ^ { f } \frac { 1 } { | \bar { V } _ { i } | } \sum _ { v \in \bar { V } _ { i } } \sum _ { p \in \{ \widetilde { n } _ { v } \} } \operatorname* { m i n } _ { u \in \mathcal { N } _ { G _ { i } } ( v ) \cap V _ { i } ^ { h } } ( | | \widetilde { x } _ { v } ^ { p } - x _ { u } | | _ { 2 } ^ { 2 } ) ,
+$$
+
+where $L _ { 1 } ^ { S }$ is the smooth L1 distance [10] and $\mathcal { \widetilde { x } } _ { v } ^ { p } \in \mathbb { R } ^ { d _ { x } }$ is the $p$ -th predicted feature in $\widetilde { x } _ { v }$ . Note that, $\mathcal { N } _ { G _ { i } } ( v ) \cap V _ { i } ^ { h }$ contains $n _ { v }$ nodes that are $v$ e’s neighbors on $G _ { i }$ missing into $V _ { i } ^ { h }$ . $\mathcal { N } _ { G _ { i } } ( v ) \cap V _ { i } ^ { h }$ , which can be retrieved from $V _ { i } ^ { h }$ and $E _ { i } ^ { h }$ , provides ground-truth for training NeighGen.
+
+Neighbor Generation. To retrieve $G _ { i } ^ { \prime }$ from $G _ { i }$ , data owner $D _ { i }$ performs two steps, which are also shown in Fig. 2: 1) $D _ { i }$ trains NeighGen on the impaired graph $\bar { G } _ { i }$ w.r.t. the ground-true hidden neighbors ${ \bar { V } } _ { i } ^ { \breve { h } }$ ; 2) $D _ { i }$ exploits NeighGen to generate missing neighbors for nodes on $G _ { i }$ and then mends $G _ { i }$ into $G _ { i } ^ { \prime }$ with generated neighbors. On the local graph $G _ { i }$ alone, this process can be understood as a data augmentation that further generates potential missing neighbors within $G _ { i }$ . However, the actual goal is to allow NeighGen to generate the cross-subgraph missing neighbors, which can be achieved via training NeighGen with FL and will be discussed in Section 4.3.
+
+# 4.2 Local Joint Training of GraphSage and NeighGen
+
+While NeighGen is designed to recover missing neighbors, the final goal of our system is to train a node classifier. Therefore, we design the joint training of GraphSage and NeighGen, which leverages neighbors generated by NeighGen to assist the node classification by GraphSage. We term the integration of GraphSage and NeighGen on the local graphs as LocSage+.
+
+After NeighGen mends the graph $G _ { i }$ into $G _ { i } ^ { \prime }$ , the GraphSage classifier $F$ is applied on $G _ { i } ^ { \prime }$ , according to Eq. (1) (with $G _ { i }$ replaced by $G _ { i } ^ { \prime }$ ). Thus, the joint training of NeighGen and GraphSage is done by optimizing the following loss function
+
+$$
+\mathcal { L } = \mathcal { L } ^ { n } + \lambda ^ { c } \mathcal { L } ^ { c } = \lambda ^ { d } \mathcal { L } ^ { d } + \lambda ^ { f } \mathcal { L } ^ { f } + \lambda ^ { c } \mathcal { L } ^ { c } ,
+$$
+
+where ${ \mathcal { L } } ^ { d }$ and $\mathcal { L } ^ { f }$ are defined in Eq. (4), and $\mathcal { L } ^ { c }$ is defined in Eq. (2) (with $G _ { i }$ substituted by $G _ { i } ^ { \prime }$
+
+The local joint training of GraphSage and NeighGen allows NeighGen to generate missing neighbors in the local graph that are helpful for the classifications made by GraphSage. However, like GraphSage, the information encoded in the local NeighGen is limited to and biased towards the local graph, which does not enable it to really generate neighbors belonging to other data owners connected by the missing cross-subgraph links. To this end, it is natural to train NeighGen with $\mathrm { F L }$ as well.
+
+# 4.3 Federated Learning of GraphSage and NeighGen
+
+Similarly to GraphSage alone, as described in Section 3.2, we can apply FedAvg to the joint training of GraphSage and NeighGen, by setting the loss function to $\mathcal { L }$ and learnable parameters to $\{ \theta ^ { e } , \theta ^ { d } , \theta ^ { f } , \phi \}$ . However, we observe that cooperation through directly averaging weights of NeighGen across the system can negatively affect its performance, i.e., averaging the weights of a single NeighGen model does not really allow it to generate diverse neighbors from different subgraphs. Recalling our goal of constructing NeighGen, which is to facilitate the training of a centralized GraphSage classifier by generating diverse missing neighbors in each subgraph, we do not necessarily need a centralized NeighGen. Therefore, instead of training a single centralized NeighGen, we train a local NeighGeni for each data owner $D _ { i }$ . In order to allow each NeighGeni to generate diverse neighbors similar to those missed into other subgraphs $G _ { j } , j \in [ M ] \backslash \{ i \}$ , we add a cross-subgraph feature reconstruction loss into $\mathrm { f G e n } _ { i }$ as follows:
+
+$$
+\mathcal { L } _ { i } ^ { f } = \frac { 1 } { \lvert \overline { { V _ { i } } } \rvert } \sum _ { v \in \bar { V } _ { i } } \sum _ { p \in [ \tilde { n } _ { v } ] } \left( \operatorname* { m i n } _ { u \in N _ { G _ { i } } ( v ) \cap V _ { i } ^ { h } } ( \lvert | \widetilde { x } _ { v } ^ { p } - x _ { u } \rvert | _ { 2 } ^ { 2 } ) + \alpha \sum _ { j \in [ M ] / i } \operatorname* { m i n } _ { u \in V _ { j } } ( \lvert | H _ { i } ^ { g } ( z _ { v } ) ^ { p } - x _ { u } \rvert | _ { 2 } ^ { 2 } ) \right) ,
+$$
+
+where $u \in V _ { j } , \forall j \in [ M ] \setminus \{ i \}$ is picked as the closest node from $G _ { j }$ other than $G _ { i }$ to simulate the neighbor of $v \in { \bar { V } } _ { i }$ missed into $G _ { j }$ .
+
+As shown above, to optimize Eq. (6), $D _ { i }$ needs to pick the closest $u$ from $G _ { j }$ . However, directly transmitting node features $X _ { j }$ in $D _ { j }$ to $D _ { i }$ not only violates our subgraph FL system constraints on no direct data sharing but also is impractical in reality, as it requires each $D _ { i }$ to hold the entire global graph’s node features throughout training ${ \mathrm { N e i g h G e n } } _ { i }$ . Therefore, to allow $D _ { i }$ to update ${ \mathrm { N e i g h G e n } } _ { i }$ using Eq. (6) without direct access to $X _ { j }$ , for $v \in { \bar { V } } _ { i }$ , $D _ { j }$ locally computes $\begin{array} { r } { \sum _ { p \in [ \widetilde { n } _ { v } ] } \operatorname* { m i n } _ { u \in V _ { j } } ( | | H _ { i } ^ { g } ( z _ { v } ) ^ { p } - x _ { u } | | _ { 2 } ^ { 2 } ) } \end{array}$ and sends the respective gradient back to $D _ { i }$ .
+
+During this process, for $v \in \bar { V } _ { i }$ , to federated optimize Eq. (6), only $H _ { i } ^ { g }$ , $H _ { i } ^ { g }$ ’s input $z _ { v }$ , and the $D _ { j }$ ’s locally computed model gradients of loss term $\begin{array} { r } { \sum _ { p \in [ \tilde { n } _ { v } ] } \operatorname* { m i n } _ { u \in V _ { j } } ( | | H _ { i } ^ { g } ( z _ { v } ) ^ { p } - x _ { u } | | _ { 2 } ^ { 2 } ) } \end{array}$ are transmitted among the system via the server $S$ e. For data owner $D _ { i }$ , the gradients received from $D _ { j }$ are then weighted by $\alpha$ and combined with the local gradients as in Eq. (6) to update the parameters of $H _ { i } ^ { g }$ of NeighGeni In this way, $D _ { i }$ achieves the federate training of ${ \mathrm { N e i g h G e n } } _ { i }$ without raw graph data sharing. Note that, due to NeighGen’s architecture of a concatenation of $H ^ { e }$ and $H ^ { g }$ , the locally preserved GNN $H _ { i } ^ { e }$ can prevent other data owners from inferring $x _ { v }$ by only seeing $z _ { v }$ . Through Eq. (6), NeighGen $_ { \cdot i }$ is expected to perceive diverse neighborhood information from all data owners, so as to generate more realistic cross-subgraph missing neighbors. The expectedly diverse and unbiased neighbors further assist the FedSage in training a globally applicable classifier that satisfies our goal in Section 3.1.
+
+Note that, to reduce communications and computation time incurred by Eq. (6), batch training can be applied. Appendix A shows the pseudo code of FedSage+.
+
+# 5 Experiments
+
+We conduct experiments on four datasets to verify the effectiveness of FedSage and FedSage+ under different testing scenarios. We further conduct case studies to visualize how FedSage and FedSage+ assist local data owners in accommodating queries from the global distribution. Finally, we also provide more in-depth studies on the effectiveness of NeighGen in Appendix D.
+
+# 5.1 Datasets and experimental settings
+
+We synthesize the distributed subgraph system with four widely used real-world graph datasets, i.e., Cora [25], Citeseer [25], PubMed [22], and MSAcademic [26]. To synthesize the distributed subgraph system, we find hierarchical graph clusters on each dataset with the Louvain algorithm [2] and use the clustering results with 3, 5, and 10 clusters of similar sizes to obtain subgraphs for data owners. The statistics of these datasets are presented in Table 1.
+
+Table 1: Statistics of the datasets and the synthesized distributed subgraph systems with $M = 3$ , 5, and $1 0 . \# \mathrm { C }$ row shows the number of classes, $| V _ { i } |$ and $| E _ { i } |$ rows show the averaged numbers of nodes and links in all subgraphs, and $\Delta E$ shows the total number of missing cross-subgraph links.
+
+
Data
Cora
Citeseer
PubMed
MSAcademic
#C |V
6
3
15
3312
19717
18333
|E
5429
4715
44338
81894
M
3
5
10
3
5
10
3
5
10
3
5
10
Vil
903
542
271
1104
662
331
6572
3943
1972
6111
3667
1833
E
1675
968
450
1518
902
442
12932
7630
3789
23584
13949
5915
△E
403
589
929
161
206
300
5543
6189
6445
11141
12151
22743
+
+We implement GraphSage with two layers using the mean aggregator [5]. The number of nodes sampled in each layer of GraphSage is 5. We use batch size 64 and set training epochs to 50. The training-validation-testing ratio is $6 0 \% - 2 0 \% - 2 0 \%$ due to limited sizes of local subgraphs. Based on our observations in hyper-parameter studies for $\alpha$ and the graph impairing ratio $h$ , we set $h \% \in [ 3 . 4 \% , 2 7 . 8 \% ]$ and $\alpha { = } 1$ . All $\lambda s$ are simply set to 1. Optimization is done with Adam with a learning rate of 0.001. We implement FedSage and FedSage $^ +$ in Python and execute all experiments on a server with 8 NVIDIA GeForce GTX 1080 Ti GPUs.
+
+Since we are the first to study the novel yet important setting of subgraph federated learning, there are no existing baselines. We conduct comprehensive ablation evaluation by comparing FedSage and FedSage+ with three models, i.e., 1) GlobSage: the GraphSage model trained on the original global graph without missing links (as an upper bound for FL framework with GraphSage model alone), 2) LocSage: one GraphSage model trained solely on each subgraph, 3) LocSage+: the GraphSage plus NeighGen model jointly trained solely on each subgraph.
+
+The metric used in our experiments is the node classification accuracy on the queries sampled from the testing nodes on the global graph. For globally shared models of GlobSage, FedSage, and FedSage+, we report the average accuracy over five random repetitions, while for locally possessed models of LocSage and LocSage+, the scores are further averaged across local models.
+
+# 5.2 Experimental results
+
+Overall performance. We conduct comprehensive ablation experiments to verify the significant promotion brought by FedSage and FedSage $^ +$ for local owners in global node classification, as
+
+Table 2: Node classification results on four datasets with $M = 3 , 5$ , and 10. Besides averaged accuracy, we also provide the corresponding std.
+
+
Model
Cora
Citesser
M=3
M=5
M=10
M=3
M=5
M=10
LocSage
0.5762 (±0.0302)
0.4431 (±0.0847)
0.2798 (±0.0080)
0.6789 (±0.054)
0.5612 (±0.086)
0.4240 (±0.0859)
LocSage+
0.5644 (±0.0219)
0.4533 (±0.047)
0.2851 (±0.0080)
0.6848 (±0.0517)
0.5676 (±0.0714)
0.4323 (±0.0715)
FedSage
0.8656 (±0.0043)
0.8645 (±0.0050)
0.8626 (±0.0103)
0.7241 (±0.0022)
0.7226 ±0.0066)
0.7158 (±0.0053)
FedSage+
0.8686 (±0.0054)
0.8648 (±0.0051)
0.8632 (±0.0034)
0.7454 (±0.0038)
0.7440 (±0.0025)
0.7392 (±0.0041)
GlobSage
0.8701 (±0.0042)
0.7561 (±0.0031)
PubMed
MSAcademic
Model LocSage
M=3 0.8447
M=5 0.8039
M=10 0.7148
M=3 0.8188
M=5 0.7426
M=10 0.5918
LocSage+
(±0.0047) 0.8481
(±0.0337) 0.8046
(±0.0951) 0.7039
(±0.0331) 0.8393
(±0.0790) 0.7480
(±0.1005) 0.5927
FedSage
(±0.0041) 0.8708
(±0.0318) 0.8696
(±0.0925) 0.8692
(±0.0330) 0.9327
(±0.0810) 0.9391
(±0.1094) 0.9262
FedSage+
(±0.0014) 0.8775
(±0.0035) 0.8755
(±0.0010) 0.8749 (±0.0013)
(±0.0005) 0.9359
(±0.0007) 0.9414
(±0.0009) 0.9314
GlobSage
(±0.0012) (±0.0047) 0.8776(±0.0011)
(±0.0005) (±0.0006) (±0.0009) 0.9681(±0.0006)
+
+
+Figure 3: Node classification results on four datasets under different $\alpha$ and $h$ values with $M { = } 3$
+
+
+(b) Hyper-parameter study for $h$ with $\alpha = 1$
+
+(a) Hyper-parameter study for $\alpha$ with $h = 1 5 \%$ .
+
+shown in Table 2. The most important observation emerging from the results is that FedSage+ not only clearly outperforms LocSage by an average of $2 3 . 1 8 \%$ , but also distinctly overcomes the cross-subgraph missing neighbor problem by reducing the average accuracy drop from the $2 . 1 1 \%$ of FedSage to $1 . 2 8 \%$ , when compared with GlobSage (absolute accuracy difference).
+
+The significant gaps between a locally obtained classifier, i.e., LocSage or LocSage+, and a federated trained classifier, i.e., FedSage or FedSage+, assay the benefits brought by the collaboration across data owners in our distributed subgraph system. Compared to FedSage, the further elevation brought by FedSage+ corroborates the assumed degeneration brought by missing cross-subgraph links and the effectiveness of our innovatively designed NeighGen module. Notably, when the graph is relatively sparse (e.g., see Citeseer in Table 1), FedSage $^ +$ significantly exhibits its robustness in resisting the cross-subgraph information loss compared to FedSage. Note that the gaps between LocSage and LocSage $^ +$ are comparatively smaller, indicating that our NeighGen serves more than a robust GNN trainer, but is rather uniquely crucial in the subgraph FL setting.
+
+
+Figure 4: Label distributions on the PubMed dataset with $M { = } 5$ .
+
+
+Figure 5: Training curves of different frameworks (GlobSage provides an upper bound).
+
+Hyper-parameter studies. We compare the downstream task performance under different $\alpha$ and $h$ values with three data owners. Results are shown in Fig. 3, where Fig. 3 (a) shows results when $h$ is fixed as $15 \%$ , and Fig. 3 (b) shows results under $\alpha { = } 1$ .
+
+Fig. 3 (a) indicates that choosing a proper $\alpha$ , which brings the information from other subgraphs in the system, can constantly elevate the final testing accuracy. Across different datasets, the optimal $\alpha$ is constantly around 1, and the performance is not influenced much unless $\alpha$ is set to extreme values like 0.1 or 10. Referring to Fig. 3 (b), we can observe that either a too-small $( 1 \% )$ or a too-large $( 3 0 \% )$ hiding portion can degrade the learning process. A too-small $h$ can not provide sufficient data for training NeighGen, while a too-large $h$ can result in sparse local subgraphs that harm the effective training of GraphSage. Referring back to the graph statistics in Table 1 in the paper, the portion of actual missing edges compared to the global graph is within the range of $[ 3 . 4 \%$ , $2 7 . 8 \% ]$ , which explains why a value like $15 \%$ can mostly boost the performance of FedSage+.
+
+Case studies. To further understand how FedSage and ${ \mathrm { F e d S a g e } } +$ improve the global classifier over LocSage, we provide case study results on PubMed with five data owners in Fig. 4. For the studied scenario, each data owner only possesses about $20 \%$ of the nodes with rather biased label distributions, as shown in Fig. 4 (a). Such bias is due to the way we synthesize the distributed subgraph system with Louvain clustering, which is also realistic in real scenarios. Local bias essentially makes it hard for any local data owner with limited training samples to obtain a generalized classifier that is globally useful. Although with $1 3 . 9 \%$ of the links missing among the system, both FedSage and FedSage+ empower local data owners in predicting labels that closely follow the ground-true global label distribution as shown in Fig. 4 (b). The figure clearly evidences that our FL models exhibit their advantages in learning a more realistic label distribution as our goal in Section 3.1, which is consistent with the observed performances in Table 2 and our theoretical implications in Section 6.
+
+For Cora dataset with five data owners, we visualize testing accuracy, loss convergence, and runtime along 100 epochs in obtaining $F$ with FedSage, FedSage+, GlobSage, LocSage and LocSage+. The results are presented in Fig. 5. Both FedSage and FedSage+ can consistently achieve convergence with rapidly improved testing accuracy. Regarding runtime, even though the classifier from FedSage+ learns from distributed mended subgraphs, FedSage+ does not consume observable more training time compared to FedSage. Due to the additional communications and computations in subgraph FL, both FedSage and FedSage $^ +$ consume slightly more training time compared to GlobSage.
+
+# 6 Implications on Generalization Bound
+
+In this section, we provide a theoretical implication for the generalization error associated with number of training samples, i.e., nodes in the distributed subgraph system, following Graph Neural Tangent Kernel (GNTK) [7] on universal graph neural networks. Thus, we are motivated to promote the FedSage and FedSage+ algorithms that include more nodes in the global graph through collaborative training with FL.
+
+Setting. Our explanation builds on a generalized setting, where we assume a GNN $F$ with layerwise aggregation operations and fully-connected layers with ReLU activation functions, which includes GraphSage as a special case. The weights of $F$ , $\phi$ , is i.i.d. sampled from a multivariate Gaussian distribution $\mathbf { N } ( 0 , I )$ . For Graph $G = \{ \bar { V } , E , X \}$ , we define the kernel matrix of two nodes $u , v \in V$ as follows. Here we consider $F$ is in the GNTK format.
+
+Definition 6.1 (Informal version of GNTK on node classification (Definition B.2)) Considering in the overparameterized regime for an GNN $F$ , $F$ is trained using gradient descent with infinite small learning rate. Given n nodes with corresponding labels as training samples, we denote $\boldsymbol { \Theta } \in \mathbb { R } ^ { n \times n }$ as the the kernel matrix of GNTK. $\mathbf { \Theta } _ { \mathbf { \Theta } } \Theta _ { u v }$ is defined as
+
+$$
+\Theta _ { u v } = \mathbb { E } _ { \phi \sim { \bf N } ( 0 , I ) } \left[ \left. \frac { \partial F ( \phi , G , u ) } { \partial \phi } , \frac { F ( \phi , G , v ) } { \partial \phi } \right. \right] \in \mathbb { R } .
+$$
+
+Full expression of $\Theta$ is shown in the Appendix B. The generalization ability in the GNTK regime depends on the kernel matrix $\Theta$ . We present the generalization bound associated with the number of training samples $n$ in Theorem 6.2.
+
+Theorem 6.2 (Generalization bound) Given n training samples of nodes $\left( u _ { i } , y _ { i } \right) _ { i = 1 } ^ { n }$ drawn i.i.d. from the global graph $G$ , consider any loss function $l : \mathbb { R } \times \mathbb { R } \mapsto [ 0 , 1 ]$ that is $^ { l }$ -Lipschitz in the first argument such that $l ( y , y ) = 0$ . With probability at least $1 - \sigma$ and constant $c \in ( 0 , 1 )$ , the generalization error of GNTK for node classification can be upper-bounded by
+
+$$
+L _ { { \mathcal { D } } ( F ) } = \mathbb { E } _ { ( u ^ { \prime } , y ) \sim G } [ l ( F ( G , u ^ { \prime } ) , y ) ] \lesssim O ( 1 / n ^ { c } ) .
+$$
+
+Following the generalization bound analysis in [7], we use a standard generalization bound of kernel methods of [1], which shows the upper bound of our GNTK formation error depends on that of $\mathbf { y } ^ { \top } \Theta ^ { ( - 1 ) } \mathbf { y }$ and $\operatorname { t r } ( \Theta )$ , where $\mathbf { y }$ is the label vector. Appendix C shows the full version of the proofs.
+
+Implications. We show the error bound of GNTK on node classification corresponding to the number of training samples. Under the assumptions in Definition 6.1, our theoretical result indicates that more training samples bring down the generalization error , which provides plausible support for our goal of building a globally useful classifier through FL in Eq. (3.1). Such implications are also consistent with our experimental findings in Fig. 4 where our FedSage and FedSage+ models can learn more generalizable classifiers that follow the label distributions of the global graph through involving more training nodes across different subgraphs.
+
+# 7 Conclusion
+
+This work aims at obtaining a generalized node classification model in a distributed subgraph system without direct data sharing. To tackle the realistic yet unexplored issue of missing cross-subgraph links, we design a novel missing neighbor generator NeighGen with the corresponding local and federated training processes. Experimental results evidence the distinguished elevation brought by our FedSage and FedSage $^ +$ frameworks , which is consistent with our theoretical implications.
+
+Though FedSage manifests advantageous performance, it confronts additional communication cost and potential privacy concerns. As communications are vital for federated learning, properly reducing communication and rigorously guaranteeing privacy protection in the distributed subgraph system can both be promising future directions.
+
+# Acknowledgments and Disclosure of Funding
+
+This work is partially supported by the internal funding and GPU servers provided by the Computer Science Department of Emory University. We thank Dr. Pan Li from Purdue University for the suggestions on the design of our NeighGen mechanism.
+
+References
+[1] Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. JMLR, 3:463–482, 2002.
+[2] Vincent D Blondel, Jean-Loup Guillaume, Renaud Lambiotte, and Etienne Lefebvre. Fast unfolding of communities in large networks. JSTAT, 2008(10):P10008, 2008.
+[3] Liang Chen, Jintang Li, Qibiao Peng, Yang Liu, Zibin Zheng, and Carl Yang. Understanding structural vulnerability in graph convolutional networks. In IJCAI, 2021.
+[4] Hanjun Dai, Hui Li, Tian Tian, Xin Huang, Lin Wang, Jun Zhu, and Le Song. Adversarial attack on graph structured data. In ICML, 2018.
+[5] CSIRO’s Data61. Stellargraph machine learning library. https://github.com/ stellargraph/stellargraph, 2018.
+[6] Qi Dou, Tiffany Y So, Meirui Jiang, Quande Liu, Varut Vardhanabhuti, Georgios Kaissis, Zeju Li, Weixin Si, Heather HC Lee, Kevin Yu, et al. Federated deep learning for detecting covid-19 lung abnormalities in ct: a privacy-preserving multinational validation study. NPJ digital medicine, 4:1–11, 2021.
+[7] Simon S. Du, Kangcheng Hou, Ruslan Salakhutdinov, Barnabás Póczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In NeurIPS, 2019.
+[8] Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. Personalized federated learning: A meta-learning approach. NeurIPS, 2020.
+[9] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
+[10] Ross Girshick. Fast r-cnn. In ICCV, 2015.
+[11] William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, 2017.
+[12] Chaoyang He, Keshav Balasubramanian, Emir Ceyani, Carl Yang, Han Xie, Lichao Sun, Lifang He, Liangwei Yang, Philip S Yu, Yu Rong, Peilin Zhao, Junzhou Huang, Murali Annavaram, and Salman Avestimehr. Fedgraphnn: A federated learning system and benchmark for graph neural networks. arXiv preprint arXiv:2104.07145, 2021.
+[13] Chaoyang He, Shen Li, Mahdi Soltanolkotabi, and Salman Avestimehr. Pipetransformer: Automated elastic pipelining for distributed training of transformers. arXiv preprint arXiv:2102.03161, 2021.
+[14] Timothy M Hospedales, Antreas Antoniou, Paul Micaelli, and Amos J Storkey. Meta-learning in neural networks: A survey. TPAMI, 2021.
+[15] Wei Jin, Yao Ma, Xiaorui Liu, Xianfeng Tang, Suhang Wang, and Jiliang Tang. Graph structure learning for robust graph neural networks. In SIGKDD, 2020.
+[16] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
+[17] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE SPM, 37:50–60, 2020.
+[18] Xinle Liang, Yang Liu, Tianjian Chen, Ming Liu, and Qiang Yang. Federated transfer reinforcement learning for autonomous driving. arXiv preprint arXiv:1910.06001, 2019.
+[19] Quande Liu, Cheng Chen, Jing Qin, Qi Dou, and Pheng-Ann Heng. Feddg: Federated domain generalization on medical image segmentation via episodic learning in continuous frequency space. arXiv preprint arXiv:2103.06030, 2021.
+[20] Gongxu Luo, Jianxin Li, Hao Peng, Carl Yang, Lichao Sun, Philip Yu, and Lifang He. Graph entropy guided node embedding dimension selection for graph neural networks. In IJCAI, 2021.
+[21] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In AISTATS, 2017.
+[22] Galileo Namata, Ben London, Lise Getoor, and Bert Huang. Query-driven active surveying for collective classification. In MLG workshop, 2012.
+[23] Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
+[24] Saif Ur Rehman, Asmat Ullah Khan, and Simon Fong. Graph mining: A survey of graph mining techniques. In ICDIM, 2012.
+[25] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
+[26] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
+[27] Chuhan Wu, Fangzhao Wu, Yang Cao, Yongfeng Huang, and Xing Xie. Fedgnn: Federated graph neural network for privacy-preserving recommendation. arXiv preprint arXiv:2102.04925, 2021.
+[28] Man Wu, Shirui Pan, Chuan Zhou, Xiaojun Chang, and Xingquan Zhu. Unsupervised domain adaptive graph convolutional networks. In WWW, 2020.
+[29] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. TNNLS, 2020.
+[30] Han Xie, Jing Ma, Li Xiong, and Carl Yang. Federated graph classification over non-iid graphs. In NeurIPS, 2021.
+[31] Carl Yang, Haonan Wang, Ke Zhang, Liang Chen, and Lichao Sun. Secure deep graph generation with link differential privacy. In IJCAI, 2021.
+[32] Carl Yang, Yuxin Xiao, Yu Zhang, Yizhou Sun, and Jiawei Han. Heterogeneous network representation learning: A unified framework with survey and benchmark. In TKDE, 2020.
+[33] Carl Yang, Jieyu Zhang, and Jiawei Han. Co-embedding network nodes and hierarchical labels with taxonomy based generative adversarial nets. In ICDM, 2020.
+[34] Carl Yang, Peiye Zhuang, Wenhan Shi, Alan Luu, and Pan Li. Conditional structure generation through graph variational generative adversarial nets. In NeurIPS, 2019.
+[35] Qiang Yang, Yang Liu, Tianjian Chen, and Yongxin Tong. Federated machine learning: Concept and applications. TIST, 10(2):1–19, 2019.
+[36] Yizhou Zhang, Guojie Song, Lun Du, Shuwen Yang, and Yilun Jin. DANE: domain adaptive network embedding. In IJCAI, 2019.
+[37] Dingyuan Zhu, Ziwei Zhang, Peng Cui, and Wenwu Zhu. Robust graph convolutional networks against adversarial attacks. In SIGKDD, 2019.
+[38] Qi Zhu, Yidan Xu, Haonan Wang, Chao Zhang, Jiawei Han, and Carl Yang. Transfer learning of graph neural networks with ego-graph information maximization. In NeurIPS, 2021.
+[39] Xinghua Zhu, Jianzong Wang, Zhenhou Hong, and Jing Xiao. Empirical studies of institutional federated learning for natural language processing. In EMNLP, 2020.
+[40] Daniel Zügner, Amir Akbarnejad, and Stephan Günnemann. Adversarial attacks on neural networks for graph data. In SIGKDD, 2018.
+[41] Daniel Zügner and Stephan Günnemann. Adversarial attacks on graph neural networks via meta learning. In ICLR, 2019.
+[42] Daniel Zügner and Stephan Günnemann. Certifiable robustness and robust training for graph convolutional networks. In SIGKDD, 2019.
\ No newline at end of file
diff --git a/md/train/SJfZKiC5FX/SJfZKiC5FX.md b/md/train/SJfZKiC5FX/SJfZKiC5FX.md
new file mode 100644
index 0000000000000000000000000000000000000000..c17011fd21db7d11ca3a0811b7b341fd905f81bc
--- /dev/null
+++ b/md/train/SJfZKiC5FX/SJfZKiC5FX.md
@@ -0,0 +1,272 @@
+# DYNAMICALLY UNFOLDING RECURRENT RESTORER:A MOVING ENDPOINT CONTROL METHOD FOR IMAGERESTORATION
+
+Xiaoshuai Zhang∗
+Institute of Computer Science and Technology,
+Peking University
+jet@pku.edu.cn Yiping Lu∗
+School Of Mathmatical Science, Peking university
+luyiping9712@pku.edu.cn
+Jiaying Liu
+Institute of Computer Science and Technology,
+Peking University
+liujiaying@pku.edu.cn
+Bin Dong
+Beijing International Center for Mathematical Research, Peking University
+Center for Data Science, Peking University
+Beijing Institute of Big Data Research,
+Beijing, China
+dongbin@math.pku.edu.cn
+
+# ABSTRACT
+
+In this paper, we propose a new control framework called the moving endpoint control to restore images corrupted by different degradation levels using a single model. The proposed control problem contains an image restoration dynamic which is modeled by a convolutional RNN. The moving endpoint, which is essentially the terminal time of the associated dynamic, is determined by a policy network. We call the proposed model the dynamically unfolding recurrent restorer (DURR). Numerical experiments show that DURR is able to achieve state-of-the-art performances on blind image denoising and JPEG image deblocking. Furthermore, DURR can well generalize to images with higher degradation levels that are not included in the training stage.1
+
+# 1 INTRODUCTION
+
+Image restoration, including image denoising, deblurring, inpainting, etc., is one of the most important areas in imaging science. Its major purpose is to obtain high quality reconstructions of images corrupted in various ways during imaging, acquisiting, and storing, and enable us to see crucial but subtle objects that reside in the images. Image restoration has been an active research area. Numerous models and algorithms have been developed for the past few decades. Before the uprise of deep learning methods, there were two classes of image restoration approaches that were widely adopted in the field: transformation based approach and PDE approach. The transformation based approach includes wavelet and wavelet frame based methods (Elad et al., 2005; Starck et al., 2005; Daubechies et al., 2007; Cai et al., 2009), dictionary learning based methods (Aharon et al., 2006), similarity based methods (Buades et al., 2005; Dabov et al., 2007), low-rank models (Ji et al., 2010; Gu et al., 2014), etc. The PDE approach includes variational models (Mumford & Shah, 1989; Rudin et al., 1992; Bredies et al., 2010), nonlinear diffusions (Perona & Malik, 1990; Catté et al., 1992; Weickert, 1998), nonlinear hyperbolic equations (Osher & Rudin, 1990), etc. More recently, deep connections
+
+between wavelet frame based methods and PDE approach were established (Cai et al., 2012; 2016;
+Dong et al., 2017).
+
+One of the greatest challenge for image restoration is to properly handle image degradations of different levels. In the existing transformation based or PDE based methods, there is always at least one tuning parameter (e.g. the regularization parameter for variational models and terminal time for nonlinear diffusions) that needs to be manually selected. The choice of the parameter heavily relies on the degradation level.
+
+Recent years, deep learning models for image restoration tasks have significantly advanced the state-of-the-art of the field. Jain & Seung (2009) proposed a convolutional neural network (CNN) for image denoising which has better expressive power than the MRF models by Lan et al. (2006). Inspired by nonlinear diffusions, Chen & Pock (2017) designed a deep neural network for image denoising and Zhang et al. (2017a) improves the capacity by introducing a deeper neural network with residual connections. Chen et al. (2017) use the CNN to simulate a wide variety of image processing operators, achieving high efficiencies with little accuracy drop. However, these models cannot gracefully handle images with varied degradation levels. Although one may train different models for images with different levels, this may limit the application of these models in practice due to lack of flexibility.
+
+Taking blind image denoising for example. Zhang et al. (2017a) designed a 20-layer neural network for the task, called DnCNN-B, which had a huge number of parameters. To reduce number of parameters, Lefkimmiatis (2017) proposed the UNLNet5, by unrolling a projection gradient algorithm for a constrained optimization model. However, Lefkimmiatis (2017) also observed a drop in PSNR comparing to DnCNN. Therefore, the design of a light-weighted and yet effective model for blind image denoising remains a challenge. Moreover, deep learning based models trained on simulated gaussian noise images usually fail to handle real world noise, as will be illustrated in later sections.
+
+Another example is JPEG image deblocking. JPEG is the most commonly used lossy image compression method. However, this method tend to introduce undesired artifacts as the compression rate increases. JPEG image deblocking aims to eliminate the artifacts and improve the image quality. Recently, deep learning based methods were proposed for JPEG deblocking (Dong et al., 2015; Zhang et al., 2017a; 2018). However, most of their models are trained and evaluated on a given quality factor. Thus it would be hard for these methods to apply to Internet images, where the quality factors are usually unknown.
+
+In this paper, we propose a single image restoration model that can robustly restore images with varied degradation levels even when the degradation level is well outside of that of the training set. Our proposed model for image restoration is inspired by the recent development on the relation between deep learning and optimal control. The relation between supervised deep learning methods and optimal control has been discovered and exploited by Weinan (2017); Lu et al. (2018); Chang et al. (2017); Fang et al. (2017). The key idea is to consider the residual block $x _ { n + 1 } = x _ { n } + f ( x _ { n } )$ as an approximation to the continuous dynamics ${ \dot { X } } = f ( X )$ . In particular, Lu et al. (2018); Fang et al. (2017) demonstrated that the training process of a class of deep models (e.g. ResNet by He et al. (2016), PolyNet by Zhang et al. (2017b), etc.) can be understood as solving the following control problem:
+
+$$
+\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { w } \bigg ( L ( X ( T ) , y ) + \int _ { 0 } ^ { \tau } R ( w ( t ) , t ) d t \bigg ) } \\ { \displaystyle s . t . \dot { X } = f ( X ( t ) , w ( t ) ) , t \in ( 0 , \tau ) } \\ { \displaystyle X ( 0 ) = x _ { 0 } . } \end{array}
+$$
+
+Here $x _ { 0 }$ is the input, $y$ is the regression target or label, $\dot { \boldsymbol X } = f ( \boldsymbol X , \boldsymbol w )$ is the deep neural network with parameter $w ( t )$ , $R$ is the regularization term and $L$ can be any loss function to measure the difference between the reconstructed images and the ground truths.
+
+In the context of image restoration, the control dynamic $\dot { X } = f ( X ( t ) , \omega ( t ) ) , t \in ( 0 , \tau )$ can be, for example, a diffusion process learned using a deep neural network. The terminal time $\tau$ of the diffusion corresponds to the depth of the neural network. Previous works simply fixed the depth of the network, i.e. the terminal time, as a fixed hyper-parameter. However Mrázek & Navara (2003) showed that the optimal terminal time of diffusion differs from image to image. Furthermore, when an image is corrupted by higher noise levels, the optimal terminal time for a typical noise removal diffusion should be greater than when a less noisy image is being processed. This is the main reason why current deep models are not robust enough to handle images with varied noise levels. In this paper, we no longer treat the terminal time as a hyper-parameter. Instead, we design a new architecture (see Fig. 3) that contains both a deep diffusion-like network and another network that determines the optimal terminal time for each input image. We propose a novel moving endpoint control model to train the aforementioned architecture. We call the proposed architecture the dynamically unfolding recurrent restorer (DURR).
+
+We first cast the model in the continuum setting. Let $x _ { 0 }$ be an observed degraded image and $y$ be its corresponding damage-free counterpart. We want to learn a time-independent dynamic system $\dot { X } = f ( X ( t ) , w )$ with parameters $w$ so that $X ( 0 ) = x$ and $X ( \tau ) \approx y$ for some $\tau > 0$ . See Fig. 2 for an illustration of our idea. The reason that we do not require $X ( \tau ) = y$ is to avoid over-fitting. For varied degradation levels and different images, the optimal terminal time $\tau$ of the dynamics may vary. Therefore, we need to include the variable $\tau$ in the learning process as well. The learning of the dynamic system and the terminal time can be gracefully casted as the following moving endpoint control problem:
+
+$$
+\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { w , \tau ( x ) } L ( X ( \tau ) , y ) + \int _ { 0 } ^ { \tau ( x ) } R ( w ( t ) , t ) d t } \\ { \displaystyle s . t . \dot { X } = f ( X ( t ) , w ( t ) ) , t \in ( 0 , \tau ( x ) ) } \\ { \displaystyle X ( 0 ) = x . } \end{array}
+$$
+
+Different from the previous control problem, in our model the terminal time $\tau$ is also a parameter to be optimized and it depends on the data $x$ . The dynamic system $\dot { X } = f ( X ( t ) , w )$ is modeled by a recurrent neural network (RNN) with a residual connection, which can be understood as a residual network with shared weights (Liao & Poggio, 2016). We shall refer to this RNN as the restoration unit. In order to learn the terminal time of the dynamics, we adopt a policy network to adaptively determine an optimal stopping time. Our learning framework is demonstrated in Fig. 3. We note that the above moving endpoint control problem can be regarded as the penalized version of the well-known fixed endpoint control problem in optimal control (Evans, 2005), where instead of penalizing the difference between $X ( \tau )$ and $y$ , the constraint $X ( \tau ) = y$ is strictly enforced.
+
+In short, we summarize our contribution as following:
+
+• We are the first to use convolutional RNN for image restoration with unknown degradation levels, where the unfolding time of the RNN is determined dynamically at run-time by a policy unit (could be either handcrafted or RL-based).
+• The proposed model achieves state-of-the-art performances with significantly less parameters and better running efficiencies than some of the state-of-the-art models.
+We reveal the relationship between the generalization power and unfolding time of the RNN by extensive experiments. The proposed model, DURR, has strong generalization to images with varied degradation levels and even to the degradation level that is unseen by the model during training (Fig. 1).
+The DURR is able to well handle real image denoising without further modification. Qualitative results have shown that our processed images have better visual quality, especially sharper details compared to others.
+
+# 2 METHOD
+
+The proposed architecture, i.e. DURR, contains an RNN (called the restoration unit) imitating a nonlinear diffusion for image restoration, and a deep policy network (policy unit) to determine the terminal time of the RNN. In this section, we discuss the training of the two components based on our moving endpoint control formulation. As will be elaborated, we first train the restoration unit to determine $\omega$ , and then train the policy unit to estimate $\tau ( x )$ .
+
+
+Figure 1: Denoising results of images from BSD68 under extreme noise conditions not seen in training data $( \sigma = 9 5 $ ).
+
+
+Figure 2: The proposed moving endpoint control model: evolving a learned reconstruction dynamics and ending at high-quality images.
+
+# 2.1 TRAINING THE RESTORATION UNIT
+
+If the terminal time $\tau$ for every input $x _ { i }$ is given (i.e. given a certain policy), the restoration unit can be optimized accordingly. We would like to show in this section that the policy used during training greatly influences the performance and the generalization ability of the restoration unit. More specifically, a restoration unit can be better trained by a good policy.
+
+The simplest policy is to fix the loop time $\tau$ as a constant for every input. We name such policy as “naive policy”. A more reasonable policy is to manually assign an unfolding time for each degradation level during training. We shall call this policy the “refined policy”. Since we have not trained the policy unit yet, to evaluate the performance of the trained restoration units, we manually pick the output image with the highest PSNR (i.e. the peak PSNR).
+
+We take denoising as an example here. The peak PSNRs of the restoration unit trained with different policies are listed in Table. 1. Fig. 4 illustrates the average loop times when the peak PSNRs appear. The training is done on both single noise level $\sigma = 4 0$ ) and multiple noise levels $( \sigma = 3 5 , 4 5 $ ). For the refined policy, the noise levels and the associated loop times are (35, 6), (45, 9). For the naive policy, we always fix the loop times to 8.
+
+
+Figure 3: Pipeline of the dynamically unfolding recurrent restorer (DURR).
+
+Table 1: Average peak PSNR on BSD68 with different training strategies.
+
+
Strategy
Noise Level
Training Noise
Policy
25
30
35
40
45
50
55
40
Naive
28.61
28.13
27.62
27.19
26.57
26.17
24.00
35,45
Naive
27.74
27.17
26.66
26.24
26.75
25.61
24.75
35,45
Refined
29.14
28.33
27.67
27.19
27.69
26.61
25.88
+
+As we can see, the refined policy brings the best performance on all the noise levels including 40. The restoration unit trained for specific noise level (i.e. $\sigma = 4 0 ^ { \cdot }$ ) is only comparable to the one with refined policy on noise level 40. The restoration unit trained on multiple noise levels with naive policy has the worst performance.
+
+These results indicate that the restoration unit has the potential to generalize on unseen degradation levels when trained with good policies. According to Fig. 4, the generalization reflects on the loop times of the restoration unit. It can be observed that the model with steeper slopes have stronger ability to generalize as well as better performances.
+
+According to these results, the restoration unit we used in DURR is trained using the refined policy. More specifically, for image denoising, the noise level and the associated loop times are set to (25, 4), (35, 6), (45, 9), and (55, 12). For JPEG image deblocking, the quality factor (QF) and the associated loop times are set to (20, 6) and (30, 4).
+
+
+Figure 4: Average peak time on BSD68 with different training strategies.
+
+# 2.2 TRAINING THE POLICY UNIT
+
+We discuss two approaches that can be used as policy unit:
+
+Handcraft policy: Previous work (Mrázek & Navara, 2003) has proposed a handcraft policy that selects a terminal time which optimizes the correlation of the signal and noise in the filtered image. This criterion can be used directly as our policy unit, but the independency of signal and noise may not hold for some restoration tasks such as real image denoising, which has higher noise level in the low-light regions, and JPEG image deblocking, in which artifacts are highly related to the original image. Another potential stopping criterion of the diffusion is no-reference image quality assessment (Mittal et al., 2012), which can provide quality assessment to a processed image without the ground truth image. However, to the best of our knowledge, the performances of these assessments are still far from satisfactory. Because of the limitations of the handcraft policies, we will not include them in our experiments.
+
+Reinforcement learning based policy: We start with a discretization of the moving endpoint problem (1) on the dataset $\{ ( x _ { i } , \bar { y _ { i } } ) | i = 1 , 2 , \cdot \cdot \cdot , d \}$ , where $\{ x _ { i } \}$ are degraded observations of the damage-free images $\{ y _ { i } \}$ . The discrete moving endpoint control problem is given as follows:
+
+$$
+\begin{array} { r l r } { { \operatorname* { m i n } _ { w , \{ N _ { i } \} _ { i = 1 } ^ { d } } r ( w ) + \sum _ { i = 1 } ^ { d } L ( X _ { N _ { i } } ^ { i } , y _ { i } ) } } \\ & { } & { s . t . X _ { n } ^ { i } = X _ { n - 1 } ^ { i } + \Delta t f ( X _ { n - 1 } ^ { i } , w ) , n = 1 , 2 , \cdots , N _ { i } , ( i = 1 , 2 , \cdots , d ) } \\ & { } & { X _ { 0 } ^ { i } = x _ { i } , i = 1 , 2 , \cdots , d . } \end{array}
+$$
+
+Here, $X _ { n } ^ { i } = X _ { n - 1 } ^ { i } + \Delta t f ( X _ { n - 1 } ^ { i } , w )$ is the forward Euler approximation of the dynamics $\dot { X } =$ $f ( X ( t ) , w )$ . The terminal time $\{ N _ { i } \}$ is determined by a policy network $P ( x , \theta )$ , where $x$ is the output of the restoration unit at each iteration and $\theta$ the set of weights. In our experiment, we simply set $r = 0$ , i.e. doesn’t introduce any regularization which might bring further benefit but is beyond this paper’s scope of discussion. In other words, the role of the policy network is to stop the iteration of the restoration unit when an ideal image restoration result is achieved. The reward function of the policy unit can be naturally defined by
+
+$$
+r ( \{ X _ { n } ^ { i } \} ) = { \left\{ \begin{array} { l l } { \lambda \left( L ( x _ { n - 1 } , y _ { i } ) - L ( x _ { n } , y _ { i } ) \right) } & { { \mathrm { I f ~ c h o o s e ~ t o ~ c o n t i n u e } } } \\ { 0 } & { { \mathrm { O t h e r w i s e } } } \end{array} \right. }
+$$
+
+In order to solve the problem (2.2), we need to optimize two networks simultaneously, i.e. the restoration unit and the policy unit. The first is an restoration unit which approximates the controlled dynamics and the other is the policy unit to give the optimized terminating conditions. The objective function we use to optimize the policy network can be written as
+
+$$
+J = \mathbb { E } _ { X \sim \pi _ { \theta } } \sum _ { n } ^ { N _ { i } } [ r ( \{ X _ { n } ^ { i } , w \} ) ] ,
+$$
+
+where $\pi _ { \theta }$ denotes the distribution of the trajectories $X = \{ X _ { n } ^ { i } , n = 1 , \ldots , N _ { i } , i = 1 , \ldots , d \}$ under the policy network $P ( \cdot , \theta )$ . Thus, reinforcement learning techniques can be used here to learn a neural network to work as a policy unit. We utilize Deep Q-learning (Mnih et al., 2015) as our learning strategy and denote this approach simply as DURR. However, different learning strategies can be used (e.g. the Policy Gradient).
+
+# 3 EXPERIMENTS
+
+# 3.1 EXPERIMENT SETTINGS
+
+In all denoising experiments, we follow the same settings as in Chen & Pock (2017); Zhang et al. (2017a); Lefkimmiatis (2017). All models are evaluated using the mean PSNR as the quantitative metric on the BSD68 (Martin et al., 2001). The training set and test set of BSD500 (400 images) are used for training. Six gaussian noise levels are evaluated, namely $\sigma = 2 5$ , 35, 45, 55, 65 and 75. Additive noise are applied to the image on the fly during training and testing. Both the training and evaluation process are done on gray-scale images.
+
+The restoration unit is a simple U-Net (Ronneberger et al., 2015) style fully convolutional neural network. For the training process of the restoration unit, the noise levels of 25, 35, 45 and 55 are used. Images are cut into $6 4 \times 6 4$ patches, and the batch-size is set to 24. The Adam optimizer with the learning rate 1e-3 is adopted and the learning rate is scaled down by a factor of 10 on training plateaux.
+
+The policy unit is composed of two ResUnit and an LSTM cell. For the policy unit training, we utilize the reward function in Eq.4. For training the policy unit, an RMSprop optimizer with learning rate 1e-4 is adopted. We’ve also tested other network structures, these tests and the detailed network structures of our model are demonstrated in the supplementary materials.
+
+In all JPEG deblocking experiments, we follow the settings as in Zhang et al. (2017a; 2018). All models are evaluated using the mean PSNR as the quantitative metric on the LIVE1 dataset (Sheikh, 2005). Both the training and evaluation processes are done on the Y channel (the luminance channel) of the YCbCr color space. The PIL module of python is applied to generate JPEG-compressed images. The module produces numerically identical images as the commonly used MATLAB JPEG encoder after setting the quantization tables manually. The images with quality factors 20 and 30 are used during training. De-blocking performances are evaluated on four quality factors, namely $\mathrm { Q F = 1 0 }$ , 20, 30, and 40. All other parameter settings are the same as in the denoising experiments.
+
+# 3.2 IMAGE DENOISING
+
+We select DnCNN-B(Zhang et al., 2017a) and UNLNet5 (Lefkimmiatis, 2017) for comparisons since these models are designed for blind image denoising. Moreover, we also compare our model with non-learning-based algorithms BM3D (Dabov et al., 2007) and WNNM (Gu et al., 2014). The noise levels are assumed known for BM3D and WNNM due to their requirements. Comparison results are shown in Table 2.
+
+Despite the fact that the parameters of our model $( 1 . 8 \times 1 0 ^ { 5 }$ for the restoration unit and $1 . 0 \times 1 0 ^ { 5 }$ for the policy unit) is less than the DnCNN (approximately $7 . 0 \times 1 0 ^ { 5 }$ ), one can see that DURR outperforms DnCNN on most of the noise-levels. More interestingly, DURR does not degrade too much when the the noise level goes beyond the level we used during training. The noise level $\sigma = 6 5$ , 75 is not included in the training set of both DnCNN and DURR. DnCNN reports notable drops of PSNR when evaluated on the images with such noise levels, while DURR only reports small drops of PSNR (see the last row of Table 2 and Fig. 6). Note that the reason we do not provide the results of UNLNet5 in Table 2 is because the authors of Lefkimmiatis (2017) has not released their codes yet, and they only reported the noise levels from 15 to 55 in their paper. We also want to emphasize that they trained two networks, one for the low noise level $( 5 \leq \sigma \leq 2 9 )$ and one for higher noise level $3 0 \leq \sigma \leq 5 5$ ). The reason is that due to the use of the constraint $| | y - x | | _ { 2 } \leq \epsilon$ by Lefkimmiatis (2017), we should not expect the model generalizes well to the noise levels surpasses the noise level of the training set.
+
+For qualitative comparisons, some restored images of different models on the BSD68 dataset are presented in Fig. 5 and Fig. 6. As can be seen, more details are preserved in DURR than other models. It is worth noting that the noise level of the input image in Fig. 6 is 65, which is unseen by both DnCNN and DURR during training. Nonetheless, DURR achieves a significant gain of nearly 1 dB than DnCNN. Moreover, the texture on the cameo is very well restored by DURR. These results clearly indicate the strong generalization ability of our model.
+
+More interestingly, due to the generalization ability in denoising, DURR is able to handle the problem of real image denoising without additional training. For testing, we test the images obtained from Lebrun et al. (2015). We present the representative results in Fig. 7 and more results are listed in the supplementary materials.
+
+We also train our model for blind color image denoising, please refer to the supplementary materials for more details.
+
+# 3.3 JPEG IMAGE DEBLOCKING
+
+For deep learning based models, we select DnCNN-3 (Zhang et al., 2017a) for comparisons since it is the only known deep model for multiple QFs deblocking. As the AR-CNN (Dong et al., 2015) is a commonly used baseline, we re-train the AR-CNN on a training set with mixed QFs and denote this model as AR-CNN-B. Original AR-CNN as well as a non-learning-based method SA-DCT (Foi et al., 2007) are also tested. The quality factors are assumed known for these models.
+
+Table 2: Average PSNR (dB) results for gray image denoising on the BSD68 dataset. Values with ∗ means the corresponding noise level is not present in the training data of the model. The best results are indicated in red.
+
+
BM3D
WNNM
DnCNN-B
UNLNet5
DURR
σ=25
28.55
28.73
29.16
28.96
29.16
9 二 35
27.07
27.28
27.66
27.50
27.72
g= 45
25.99
26.26
26.62
26.48
26.71
0 = :55
25.26
25.49
25.80
25.64
25.91
g= 65
24.69
24.51
23.40*
1
25.26*
σ=75
22.63
22.71
18.73*
=
24.71*
+
+
+Figure 5: Denoising results of an image from BSD68 with noise level 35.
+
+
+Figure 6: Denoising results of an image from BSD68 with noise level 65 (unseen by both DnCNN and DURR in their training sets).
+
+Quantitative results are shown in Table 3. Though the number of parameters of DURR is significantly less than the DnCNN-3, the proposed DURR outperforms DnCNN-3 in most cases. Specifically, considerable gains can be observed for our model on seen QFs, and the performances are comparable on unseen QFs. A representative result on the LIVE1 dataset is presented in Fig. 8. Our model generates the most clean and accurate details. More experiment details are given in the supplementary materials.
+
+Table 3: The average PSNR(dB) on the LIVE1 dataset. Values with ∗ means the corresponding QF is not present in the training data of the model. The best results are indicated in red and the second best results are indicated in blue.
+
+
QF
JPEG
SA-DCT
AR-CNN
AR-CNN-B
DnCNN-3
DURR
10
27.77
28.65
28.98
28.53
29.40
29.23*
20
30.07
30.81
31.29
30.88
31.59
31.68
30
31.41
32.08
32.69
32.31
32.98
33.05
40
32.45
32.99
33.63
33.39
33.96
34.01*
+
+
+Figure 7: Denoising results on a real image from Lebrun et al. (2015).
+
+# 3.4 OTHER APPLICATIONS
+
+Our model can be easily extended to other applications such as deraining, dehazing and deblurring. In all these applications, there are images corrupted at different levels. Rainfall intensity, haze density and different blur kernels will all effect the image quality.
+
+# 4 CONCLUSIONS
+
+In this paper, we proposed a novel image restoration model based on the moving endpoint control in order to handle varied noise levels using a single model. The problem was solved by jointly optimizing two units: restoration unit and policy unit. The restoration unit used an RNN to realize the dynamics in the control problem. A policy unit was proposed for the policy unit to determine the loop times of the restoration unit for optimal results. Our model achieved the state-of-the-art results in blind image denoising and JPEG deblocking. Moreover, thanks to the flexibility of the given policy, DURR has shown strong abilities of generalization in our experiments.
+
+# ACKNOWLEDGMENTS
+
+Bin Dong is supported in part by Beijing Natural Science Foundation (Z180001).Yiping Lu is supported by the Elite Undergraduate Training Program of the School of Mathematical Sciences at Peking University.
+
+# REFERENCES
+
+Michal Aharon, Michael Elad, and Alfred Bruckstein. $k$ -svd: An algorithm for designing overcomplete dictionaries for sparse representation. IEEE Transactions on signal processing, 54(11):4311–4322, 2006.
+
+
+Figure 8: JPEG deblocking results of an image from the LIVE1 dataset, compressed using QF 10.
+
+K. Bredies, K. Kunisch, and T. Pock. Total Generalized Variation. SIAM Journal on Imaging Sciences, 3:492, 2010.
+
+Antoni Buades, Bartomeu Coll, and J-M Morel. A non-local algorithm for image denoising. In Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, volume 2, pp. 60–65. IEEE, 2005.
+
+J.F. Cai, S. Osher, and Z. Shen. Split Bregman methods and frame based image restoration. Multiscale Modeling and Simulation: A SIAM Interdisciplinary Journal, 8(2):337–369, 2009.
+
+Jian-Feng Cai, Bin Dong, Stanley Osher, and Zuowei Shen. Image restoration: total variation, wavelet frames, and beyond. Journal of the American Mathematical Society, 25(4):1033–1089, 2012.
+
+Jian-Feng Cai, Bin Dong, and Zuowei Shen. Image restoration: a wavelet frame based model for piecewise smooth functions and beyond. Applied and Computational Harmonic Analysis, 41(1):94–138, 2016.
+
+Francine Catté, Pierre-Louis Lions, Jean-Michel Morel, and Tomeu Coll. Image selective smoothing and edge detection by nonlinear diffusion. SIAM Journal on Numerical analysis, 29(1):182–193, 1992.
+
+Bo Chang, Lili Meng, Eldad Haber, Lars Ruthotto, David Begert, and Elliot Holtham. Reversible architectures for arbitrarily deep residual neural networks. AAAI2018, 2017.
+
+Qifeng Chen, Jia Xu, and Vladlen Koltun. Fast image processing with fully-convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2497–2506, 2017.
+
+Y. Chen and T Pock. Trainable nonlinear reaction diffusion: A flexible framework for fast and effective image restoration. IEEE Transactions on Pattern Analysis & Machine Intelligence, 39(6):1256–1272, 2017.
+
+Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Image denoising by sparse 3-d transform-domain collaborative filtering. IEEE Transactions on image processing, 16(8):2080–2095, 2007.
+
+I. Daubechies, G. Teschke, and L. Vese. Iteratively solving linear inverse problems under general convex constraints. Inverse Problems and Imaging, 1(1):29, 2007.
+
+Bin Dong, Qingtang Jiang, and Zuowei Shen. Image restoration: Wavelet frame shrinkage, nonlinear evolution pdes, and beyond. Multiscale Modeling & Simulation, 15(1):606–660, 2017.
+
+Chao Dong, Yubin Deng, Chen Change Loy, and Xiaoou Tang. Compression artifacts reduction by a deep convolutional network. In Proceedings of the IEEE International Conference on Computer Vision, pp. 576–584, 2015.
+
+M. Elad, J.L. Starck, P. Querre, and D.L. Donoho. Simultaneous cartoon and texture image inpainting using morphological component analysis (MCA). Applied and Computational Harmonic Analysis, 19(3):340–358, 2005.
+
+Lawrence C Evans. An introduction to mathematical optimal control theory version 0.2. Tailieu Vn, 2005.
+
+Cong Fang, Zhenyu Zhao, Pan Zhou, and Zhouchen Lin. Feature learning via partial differential equation with applications to face recognition. Pattern Recognition, 69:14–25, 2017.
+
+Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Pointwise shape-adaptive dct for high-quality denoising and deblocking of grayscale and color images. IEEE Transactions on Image Processing, 16(5): 1395–1411, 2007.
+
+Shuhang Gu, Lei Zhang, Wangmeng Zuo, and Xiangchu Feng. Weighted nuclear norm minimization with application to image denoising. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2862–2869, 2014.
+
+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.
+
+Viren Jain and Sebastian Seung. Natural image denoising with convolutional networks. In Advances in Neural Information Processing Systems, pp. 769–776, 2009.
+
+H. Ji, C. Liu, Z. Shen, and Y. Xu. Robust video denoising using low rank matrix completion. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010.
+
+Xiangyang Lan, Stefan Roth, Daniel Huttenlocher, and Michael J Black. Efficient belief propagation with learned higher-order markov random fields. In European conference on computer vision, pp. 269–282. Springer, 2006.
+
+Marc Lebrun, Miguel Colom, and Jean-Michel Morel. The noise clinic: a blind image denoising algorithm. Image Processing On Line, 5:1–54, 2015.
+
+Stamatios Lefkimmiatis. Universal denoising networks: A novel cnn-based network architecture for image denoising. arXiv preprint arXiv:1711.07807, 2017.
+
+Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint, 2016.
+
+Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. Thirty-fifth International Conference on Machine Learning (ICML), 2018.
+
+D. Martin, C. Fowlkes, D. Tal, and J. Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proc. 8th Int’l Conf. Computer Vision, volume 2, pp. 416–423, July 2001.
+
+Anish Mittal, Anush Krishna Moorthy, and Alan Conrad Bovik. No-reference image quality assessment in the spatial domain. IEEE Transactions on Image Processing, 21(12):4695–4708, 2012.
+
+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.
+
+Pavel Mrázek and Mirko Navara. Selection of optimal stopping time for nonlinear diffusion filtering. International Journal of Computer Vision, 52(2-3):189–203, 2003.
+
+D. Mumford and J. Shah. Optimal approximations by piecewise smooth functions and associated variational problems. Communications on pure and applied mathematics, 42(5):577–685, 1989.
+
+Stanley Osher and Leonid Rudin. Feature-oriented image enhancement using shock filters. SIAM Journal on Numerical Analysis, 27(4):919–940, Aug 1990. URL http://www.jstor.org/stable/2157689.
+
+Pietro Perona and Jitendra Malik. Scale-space and edge detection using anisotropic diffusion. IEEE Transactions on pattern analysis and machine intelligence, 12(7):629–639, 1990.
+
+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.
+
+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.
+
+HR Sheikh. Live image quality assessment database release 2. http://live.ece.utexas.edu/research/quality, 2005.
+
+J.L. Starck, M. Elad, and D.L. Donoho. Image decomposition via the combination of sparse representations and a variational approach. IEEE transactions on image processing, 14(10):1570–1582, 2005.
+
+Joachim Weickert. Anisotropic diffusion in image processing, volume 1. Teubner Stuttgart, 1998.
+
+E Weinan. A proposal on machine learning via dynamical systems. Communications in Mathematics & Statistics, 5(1):1–11, 2017.
+
+Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Transactions on Image Processing, 26(7):3142–3155, 2017a.
+
+Xiaoshuai Zhang, Wenhan Yang, Yueyu Hu, and Jiaying Liu. Dmcnn: Dual-domain multi-scale convolutional neural network for compression artifacts removal. In Proceedings of the 25th IEEE International Conference on Image Processing, 2018.
+
+Xingcheng Zhang, Zhizhong Li, Chen Change Loy, and Dahua Lin. Polynet: A pursuit of structural diversity in very deep networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3900–3908. IEEE, 2017b.
\ No newline at end of file
diff --git a/md/train/SJgwNerKvB/SJgwNerKvB.md b/md/train/SJgwNerKvB/SJgwNerKvB.md
new file mode 100644
index 0000000000000000000000000000000000000000..81cebff36ba43103affcba7e1eef2dcead8e22d2
--- /dev/null
+++ b/md/train/SJgwNerKvB/SJgwNerKvB.md
@@ -0,0 +1,529 @@
+# CONTINUAL LEARNING WITH HYPERNETWORKS
+
+Johannes von Oswald\*, Christian Henning\*, Benjamin F. Grewe, João Sacramento \*Equal contribution
+
+Institute of Neuroinformatics
+University of Zürich and ETH Zürich
+Zürich, Switzerland
+{voswaldj,henningc,bgrewe,rjoao}@ethz.ch
+
+# ABSTRACT
+
+Artificial neural networks suffer from catastrophic forgetting when they are sequentially trained on multiple tasks. To overcome this problem, we present a novel approach based on task-conditioned hypernetworks, i.e., networks that generate the weights of a target model based on task identity. Continual learning (CL) is less difficult for this class of models thanks to a simple key feature: instead of recalling the input-output relations of all previously seen data, task-conditioned hypernetworks only require rehearsing task-specific weight realizations, which can be maintained in memory using a simple regularizer. Besides achieving state-ofthe-art performance on standard CL benchmarks, additional experiments on long task sequences reveal that task-conditioned hypernetworks display a very large capacity to retain previous memories. Notably, such long memory lifetimes are achieved in a compressive regime, when the number of trainable hypernetwork weights is comparable or smaller than target network size. We provide insight into the structure of low-dimensional task embedding spaces (the input space of the hypernetwork) and show that task-conditioned hypernetworks demonstrate transfer learning. Finally, forward information transfer is further supported by empirical results on a challenging CL benchmark based on the CIFAR-10/100 image datasets.
+
+# 1 INTRODUCTION
+
+We assume that a neural network $f ( \mathbf { x } , \Theta )$ with trainable weights $\Theta$ is given data from a set of tasks $\{ ( \mathbf { X } ^ { ( 1 ) } , \mathbf { Y } ^ { ( 1 ) } ) , \dotsc , ( \mathbf { X } ^ { ( T ) } , \mathbf { Y } ^ { ( T ) } ) \}$ , with input samples $\mathbf { X } ^ { ( t ) } = \{ \mathbf { x } ^ { ( t , i ) } \} _ { i = 1 } ^ { n _ { t } }$ and output samples $\mathbf { Y } ^ { ( t ) } = \{ \mathbf { y } ^ { ( t , i ) } \} _ { i = 1 } ^ { n _ { t } }$ , where ce. How $n _ { t } \equiv | \mathbf { X } ^ { ( t ) } |$ . A standard training approach learns the model using data not always possible in real-world problems, nor desirable in an online learning setting. Continual learning (CL) refers to an online learning setup in which tasks are presented sequentially (see van de Ven $\&$ Tolias, 2019, for a recent review on CL). In CL, when learning a new task $t$ , starting with weights $\Theta ^ { ( t - 1 ) }$ and observing only $( \mathbf { X } ^ { ( t ) } , \mathbf { Y } ^ { ( t ) } )$ , the goal is to find a new set of parameters $\Theta ^ { ( t ) }$ that (1) retains (no catastrophic forgetting) or (2) improves (positive backward transfer) performance on previous tasks compared to $\Theta ^ { ( t - 1 ) }$ and (3) solves the new task $t$ potentially utilizing previously acquired knowledge (positive forward transfer). Achieving these goals is non-trivial, and a longstanding issue in neural networks research.
+
+Here, we propose addressing catastrophic forgetting at the meta level: instead of directly attempting to retain $f ( \mathbf { x } , \Theta )$ for previous tasks, we fix the outputs of a metamodel $f _ { \mathrm { h } } ( \mathbf { e } , \Theta _ { \mathrm { h } } )$ termed task-conditioned hypernetwork which maps a task embedding $\mathbf { e }$ to weights $\Theta$ . Now, a single point has to be memorized per task. To motivate such approach, we perform a thought experiment: we assume that we are allowed to store all inputs $\{ \mathbf { X } ^ { ( 1 ) } , \ldots , \mathbf { X } ^ { ( T ) } \}$ seen so far, and to use these data to compute model outputs corresponding to $\Theta ^ { ( T - 1 ) }$ . In this idealized setting, one can avoid forgetting by simply mixing data from the current task with data from the past, $\{ ( \mathbf { X } ^ { ( 1 ) } , \hat { \mathbf { Y } } ^ { ( 1 ) } ) , \dotsc , ( \mathbf { X } ^ { ( T - 1 ) } , \hat { \mathbf { Y } } ^ { ( T - 1 ) } ) , ( \mathbf { X } ^ { ( T ) } , \mathbf { Y } ^ { ( T ) } ) \} .$ where $\hat { \mathbf { Y } } ^ { ( t ) }$ refers to a set of synthetic targets generated using the model itself $f ( \cdot , \Theta ^ { ( t - 1 ) } )$ . Hence, by training to retain previously acquired input-output mappings, one can obtain a sequential algorithm in principle as powerful as multi-task learning. Multi-task learning, where all tasks are learned simultaneously, can be seen as a CL upper-bound. The strategy described above has been termed rehearsal (Robins, 1995). However, storing previous task data violates our CL desiderata.
+
+Therefore, we introduce a change in perspective and move from the challenge of maintaining individual input-output data points to the problem of maintaining sets of parameters $\{ \Theta ^ { ( t ) } \}$ , without explicitly storing them. To achieve this, we train the metamodel parameters $\Theta _ { \mathrm { h } }$ analogous to the above outlined learning scheme, where synthetic targets now correspond to weight configurations that are suitable for previous tasks. This exchanges the storage of an entire dataset by a single low-dimensional task descriptor, yielding a massive memory saving in all but the simplest of tasks. Despite relying on regularization, our approach is a conceptual departure from previous algorithms based on regularization in weight (e.g., Kirkpatrick et al., 2017; Zenke et al., 2017) or activation space (e.g., He & Jaeger, 2018).
+
+Our experimental results show that task-conditioned hypernetworks do not suffer from catastrophic forgetting on a set of standard CL benchmarks. Remarkably, they are capable of retaining memories with practically no decrease in performance, when presented with very long sequences of tasks. Thanks to the expressive power of neural networks, task-conditioned hypernetworks exploit task-totask similarities and transfer information forward in time to future tasks. Finally, the task-conditional metamodelling perspective that we put forth is generic, as it does not depend on the specifics of the target network architecture. We exploit this key principle and show that the very same metamodelling framework extends to, and can improve, an important class of CL methods known as generative replay methods, which are current state-of-the-art performers in many practical problems (Shin et al., 2017; Wu et al., 2018; van de Ven & Tolias, 2018).
+
+# 2 MODEL
+
+# 2.1 TASK-CONDITIONED HYPERNETWORKS
+
+Hypernetworks parameterize target models. The centerpiece of our approach to continual learning is the hypernetwork, Fig. 1a. Instead of learning the parameters $\Theta _ { \mathrm { t r g t } }$ of a particular function $f _ { \mathrm { t r g t } }$ directly (the target model), we learn the parameters $\Theta _ { \mathrm { h } }$ of a metamodel. The output of such metamodel, the hypernetwork, is $\Theta _ { \mathrm { t r g t } }$ . Hypernetworks can therefore be thought of as weight generators, which were originally introduced to dynamically parameterize models in a compressed form (Ha et al., 2017; Schmidhuber, 1992; Bertinetto et al., 2016; Jia et al., 2016).
+
+
+Figure 1: Task-conditioned hypernetworks for continual learning. (a) Commonly, the parameters of a neural network are directly adjusted from data to solve a task. Here, a weight generator termed hypernetwork is learned instead. Hypernetworks map embedding vectors to weights, which parameterize a target neural network. In a continual learning scenario, a set of task-specific embeddings is learned via backpropagation. Embedding vectors provide task-dependent context and bias the hypernetwork to particular solutions. (b) A smaller, chunked hypernetwork can be used iteratively, producing a chunk of target network weights at a time (e.g., one layer at a time). Chunked hypernetworks can achieve model compression: the effective number of trainable parameters can be smaller than the number of target network weights.
+
+Continual learning with hypernetwork output regularization. One approach to avoid catastrophic forgetting is to store data from previous tasks and corresponding model outputs, and then fix such outputs. This can be achieved using an output regularizer of the following form, where past outputs play the role of pseudo-targets (Robins, 1995; Li & Hoiem, 2018; Benjamin et al., 2018):
+
+$$
+\mathcal { L } _ { \mathrm { o u t p u t } } = \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { | \mathbf { X } ^ { ( t ) } | } \| f ( \mathbf { x } ^ { ( t , i ) } , \boldsymbol { \Theta } ^ { * } ) - f ( \mathbf { x } ^ { ( t , i ) } , \boldsymbol { \Theta } ) \| ^ { 2 } ,
+$$
+
+In the equation above, $\Theta ^ { * }$ is the set of parameters before attempting to learn task $T$ , and $f$ is the learner. This approach, however, requires storing and iterating over previous data, a process that is known as rehearsing. This is potentially expensive memory-wise and not strictly online learning. A possible workaround is to generate the pseudo-targets by evaluating $f$ on random patterns (Robins, 1995) or on the current task dataset (Li & Hoiem, 2018). However, this does not necessarily fix the behavior of the function $f$ in the regions of interest.
+
+Hypernetworks sidestep this problem naturally. In target network weight space, a single point (i.e., one set of weights) has to be fixed per task. This can be efficiently achieved with task-conditioned hypernetworks, by fixing the hypernetwork output on the appropriate task embedding.
+
+Similar to Benjamin et al. (2018), we use a two-step optimization procedure to introduce memorypreserving hypernetwork output constraints. First, we compute a candidate change $\Delta \Theta _ { \mathrm { h } }$ which minimizes the current task loss $\mathcal { L } _ { \mathrm { t a s k } } ^ { ( T ) } = \mathcal { L } _ { \mathrm { t a s k } } \big ( \Theta _ { \mathrm { h } } , \mathbf { e } ^ { ( T ) } , \mathbf { X } ^ { ( T ) } , \mathbf { Y } ^ { ( T ) } \big )$ with respect to $\Theta$ . The candidate $\Delta \Theta _ { \mathrm { h } }$ is obtained with an optimizer of choice (we use Adam throughout; Kingma & Ba, 2015). The actual parameter change is then computed by minimizing the following total loss:
+
+$$
+\begin{array} { l } { \mathcal { L } _ { \mathrm { t o t a l } } = \mathcal { L } _ { \mathrm { t a s k } } \big ( \Theta _ { \mathrm { h } } , { \bf e } ^ { ( T ) } , { \bf X } ^ { ( T ) } , { \bf Y } ^ { ( T ) } \big ) + \mathcal { L } _ { \mathrm { o u p u t } } \big ( \Theta _ { \mathrm { h } } ^ { * } , \Theta _ { \mathrm { h } } , \Delta \Theta _ { \mathrm { h } } , \{ { \bf e } ^ { ( t ) } \} \big ) } \\ { \quad \quad \quad = \mathcal { L } _ { \mathrm { t a s k } } \big ( \Theta _ { \mathrm { h } } , { \bf e } ^ { ( T ) } , { \bf X } ^ { ( T ) } , { \bf Y } ^ { ( T ) } \big ) + \frac { \beta _ { \mathrm { o u p u t } } } { T - 1 } \displaystyle \sum _ { t = 1 } ^ { T - 1 } \| f _ { \mathrm { h } } \big ( { \bf e } ^ { ( t ) } , \Theta _ { \mathrm { h } } ^ { * } \big ) - f _ { \mathrm { h } } \big ( { \bf e } ^ { ( t ) } , \Theta _ { \mathrm { h } } + \Delta \Theta _ { \mathrm { h } } \big ) ) \| ^ { 2 } , } \end{array}
+$$
+
+where $\Theta _ { \mathrm { h } } ^ { * }$ is the set of hypernetwork parameters before attempting to learn task $T$ , $\Delta \Theta _ { \mathrm { h } }$ is considered fixed and $\beta _ { \mathrm { o u t p u t } }$ is a hyperparameter that controls the strength of the regularizer. On Appendix $\mathrm { D }$ , we run a sensitivity analysis on $\beta _ { \mathrm { o u t p u t } }$ and experiment with a more efficient stochastic regularizer where the averaging is performed over a random subset of past tasks.
+
+More computationally-intensive algorithms that involve a full inner-loop refinement, or use secondorder gradient information by backpropagating through $\Delta \Theta _ { \mathrm { h } }$ could be applied. However, we found empirically that our one-step correction worked well. Exploratory hyperparameter scans revealed that the inclusion of the lookahead $\Delta \Theta _ { h }$ in (2) brought a minor increase in performance, even when computed with a cheap one-step procedure. Note that unlike in Eq. 1, the memory-preserving term $\mathcal { L } _ { \mathrm { o u t p u t } }$ does not depend on past data. Memory of previous tasks enters only through the collection of task embeddings {e(t)}T −1t=1 .
+
+Learned task embeddings. Task embeddings are differentiable deterministic parameters that can be learned, just like $\Theta _ { \mathrm { h } }$ . At every learning step of our algorithm, we also update the current task embedding $\mathbf { e } ^ { ( T ) }$ to minimize the task loss $\bar { \mathcal { L } } _ { \mathrm { t a s k } } ^ { ( T ) }$ . After learning the task, the final embedding is saved and added to the collection $\{ \mathbf { e } ^ { ( t ) } \}$ .
+
+# 2.2 MODEL COMPRESSION WITH CHUNKED HYPERNETWORKS
+
+Chunking. In a straightforward implementation, a hypernetwork produces the entire set of weights of a target neural network. For modern deep neural networks, this is a very high-dimensional output. However, hypernetworks can be invoked iteratively, filling in only part of the target model at each step, in chunks (Ha et al., 2017; Pawlowski et al., 2017). This strategy allows applying smaller hypernetworks that are reusable. Interestingly, with chunked hypernetworks it is possible to solve tasks in a compressive regime, where the number of learned parameters (those of the hypernetwork) is effectively smaller than the number of target network parameters.
+
+Chunk embeddings and network partitioning. Reapplying the same hypernetwork multiple times introduces weight sharing across partitions of the target network, which is usually not desirable.
+
+To allow for a flexible parameterization of the target network, we introduce a set ${ \mathcal C } = \{ { \bf c } _ { i } \} _ { i = 1 } ^ { N _ { \mathrm { C } } }$ of chunk embeddings, which are used as an additional input to the hypernetwork, Fig. 1b. Thus, the full set of target network parameters $\Theta _ { \mathrm { t r g t } } = [ f _ { \mathrm { h } } ( \mathbf { e } , \mathbf { c } _ { 1 } ^ { \top } ) , \dots , f _ { \mathrm { h } } ( \mathbf { e } , \mathbf { \bar { c } } _ { N _ { \mathrm { C } } } ) ]$ is produced by iteration over $\mathcal { C }$ , keeping the task embedding e fixed. This way, the hypernetwork can produce distinct weights for each chunk. Furthermore, chunk embeddings, just like task embeddings, are ordinary deterministic parameters that we learn via backpropagation. For simplicity, we use a shared set of chunk embeddings for all tasks and we do not explore special target network partitioning strategies.
+
+How flexible is our approach? Chunked neural networks can in principle approximate any target weight configuration arbitrarily well. For completeness, we state this formally in Appendix E.
+
+# 2.3 CONTEXT-FREE INFERENCE: UNKNOWN TASK IDENTITY
+
+Determining which task to solve from input data. Our hypernetwork requires a task embedding input to generate target model weights. In certain CL applications, an appropriate embedding can be immediately selected as task identity is unambiguous, or can be readily inferred from contextual clues. In other cases, knowledge of the task at hand is not explicitly available during inference. In the following, we show that our metamodelling framework generalizes to such situations. In particular, we consider the problem of inferring which task to solve from a given input pattern, a noted benchmark challenge (Farquhar & Gal, 2018; van de Ven & Tolias, 2019). Below, we explore two different strategies that leverage task-conditioned hypernetworks in this CL setting.
+
+Task-dependent predictive uncertainty. Neural network models are increasingly reliable in signalling novelty and appropriately handling out-of-distribution data. For categorical target distributions, the network ideally produces a flat, high entropy output for unseen data and, conversely, a peaked, low-entropy response for in-distribution data (Hendrycks & Gimpel, 2016; Liang et al., 2017). This suggests a first, simple method for task inference (HNET $+$ ENT). Given an input pattern for which task identity is unknown, we pick the task embedding which yields lowest predictive uncertainty, as quantified by output distribution entropy. While this method relies on accurate novelty detection, which is in itself a far from solved research problem, it is otherwise straightforward to implement and no additional learning or model is required to infer task identity.
+
+Hypernetwork-protected synthetic replay. When a generative model is available, catastrophic forgetting can be circumvented by mixing current task data with replayed past synthetic data (for recent work see Shin et al., 2017; Wu et al., 2018). Besides protecting the generative model itself, synthetic data can protect another model of interest, for example, another discriminative model. This conceptually simple strategy is in practice often the state-of-the-art solution to CL (van de Ven & Tolias, 2019). Inspired by these successes, we explore augmenting our system with a replay network, here a standard variational autoencoder (VAE; Kingma & Welling, 2014) (but see Appendix F for experiments with a generative adversarial network, Goodfellow et al., 2014).
+
+Synthetic replay is a strong, but not perfect, CL mechanism as the generative model is subject to drift, and errors tend to accumulate and amplify with time. Here, we build upon the following key observation: just like the target network, the generator of the replay model can be specified by a hypernetwork. This allows protecting it with the output regularizer, Eq. 2, rather than with the model’s own replay data, as done in related work. Thus, in this combined approach, both synthetic replay and task-conditional metamodelling act in tandem to reduce forgetting.
+
+We explore hypernetwork-protected replay in two distinct setups. First, we consider a minimalist architecture $( \mathrm { H N E T + R } )$ ), where only the replay model, and not the target classifier, is parameterized by a hypernetwork. Here, forgetting in the target network is obviated by mixing current data with synthetic data. Synthetic target output values for previous tasks are generated using a soft targets method, i.e., by simply evaluating the target function before learning the new task on synthetic input data. Second (HNET+TIR), we introduce an auxiliary task inference classifier, protected using synthetic replay data and trained to predict task identity from input patterns. This architecture requires additional modelling, but it is likely to work well when tasks are strongly dissimilar. Furthermore, the task inference subsystem can be readily applied to process more general forms of contextual information, beyond the current input pattern. We provide additional details, including network architectures and the loss functions that are optimized, in Appendices B and C.
+
+# 3 RESULTS
+
+We evaluate our method on a set of standard image classification benchmarks on the MNIST, CIFAR10 and CIFAR-100 public datasets1. Our main aims are to (1) study the memory retention capabilities of task-conditioned hypernetworks across three continual learning settings, and (2) investigate information transfer across tasks that are learned sequentially.
+
+Continual learning scenarios. In our experiments we consider three different CL scenarios (van de Ven & Tolias, 2019). In CL1, the task identity is given to the system. This is arguably the standard sequential learning scenario, and the one we consider unless noted otherwise. In CL2, task identity is unknown to the system, but it does not need to be explicitly determined. A target network with a fixed head is required to solve multiple tasks. In CL3, task identity has to be explicitly inferred. It has been argued that this scenario is the most natural, and the one that tends to be harder for neural networks (Farquhar & Gal, 2018; van de Ven & Tolias, 2019).
+
+Experimental details. Aiming at comparability, for the experiments on the MNIST dataset we model the target network as a fully-connected network and set all hyperparameters after van de Ven & Tolias (2019), who recently reviewed and compared a large set of CL algorithms. For our CIFAR experiments, we opt for a ResNet-32 target neural network (He et al., 2016) to assess the scalability of our method. A summary description of the architectures and particular hyperparameter choices, as well as additional experimental details, is provided in Appendix C. We emphasize that, on all our experiments, the number of hypernetwork parameters is always smaller or equal than the number of parameters of the models we compare with.
+
+
+Figure 2: 1D nonlinear regression. (a) Task-conditioned hypernetworks with output regularization can easily model a sequence of polynomials of increasing degree, while learning in a continual fashion. (b) The solution found by a target network which is trained directly on all tasks simultaneously is similar. (c) Fine-tuning, i.e., learning sequentially, leads to forgetting of past tasks. Dashed lines depict ground truth, markers show model predictions.
+
+Nonlinear regression toy problem. To illustrate our approach, we first consider a simple nonlinear regression problem, where the function to be approximated is scalar-valued, Fig. 2. Here, a sequence of polynomial functions of increasing degree has to be inferred from noisy data. This motivates the continual learning problem: when learning each task in succession by modifying $\Theta _ { \mathrm { h } }$ with the memory-preserving regularizer turned off $\beta _ { \mathrm { o u t p u t } } = 0$ , see Eq. 2) the network learns the last task but forgets previous ones, Fig. 2c. The regularizer protects old solutions, Fig. 2a, and performance is comparable to an offline non-continual learner, Fig. 2b.
+
+Permuted MNIST benchmark. Next, we study the permuted MNIST benchmark. This problem is set as follows. First, the learner is presented with the full MNIST dataset. Subsequently, novel tasks are obtained by applying a random permutation to the input image pixels. This process can be repeated to yield a long task sequence, with a typical length of $T = 1 0$ tasks. Given the low similarity of the generated tasks, permuted MNIST is well suited to study the memory capacity of a continual learner. For $T = 1 0$ , we find that task-conditioned hypernetworks are state-of-the-art on CL1, Table 1. Interestingly, inferring tasks through the predictive distribution entropy (HNET+ENT) works well on the permuted MNIST benchmark. Despite the simplicity of the method, both synaptic intelligence (SI; Zenke et al., 2017) and online elastic weight consolidation (EWC; Schwarz et al., 2018) are overperformed on CL3 by a large margin. When complemented with generative replay methods, task-conditioned hypernetworks (HNET $+ \prime$ TIR and HNET $+ \mathbf { R }$ ) are the best performers on all three CL scenarios.
+
+
+Figure 3: Experiments on the permuted MNIST benchmark. (a) Final test set classification accuracy on the $t$ -th task after learning one hundred permutations (PermutedMNIST-100). Taskconditioned hypernetworks (hnet, in red) achieve very large memory lifetimes on the permuted MNIST benchmark. Synaptic intelligence (SI, in blue; Zenke et al., 2017), online EWC (in orange; Schwarz et al., 2018) and deep generative replay (DGR $^ +$ distill, in green; Shin et al., 2017) methods are shown for comparison. Memory retention in SI and $\mathrm { D G R } +$ distill degrade gracefully, whereas EWC suffers from rigidity and can never reach very high accuracy, even though memories persist for the entire experiment duration. (b) Compression ratio $\frac { | \Theta _ { \mathrm { h } } \cup \{ \mathbf e ^ { ( t ) } \} | } { | \Theta _ { \mathrm { t g t } } | }$ versus task-averaged test set accuracy after learning all tasks (labelled ‘final’, in red) and immediately after learning a task (labelled ‘during’, in purple) for the PermutedMNIST-10 benchmark. Hypernetworks allow for model compression and perform well even when the number of target model parameters exceeds their own. Performance decays nonlinearly: accuracies stay approximately constant for a wide range of compression ratios below unity. Hyperparameters were tuned once for compression ratio $\approx 1$ and were then used for all compression ratios. Shaded areas denote STD (a) resp. SEM (b) across 5 random seeds.
+
+Performance differences become larger in the long sequence limit, Fig. 3a. For longer task sequences $( T = 1 0 0$ ), SI and DGR $^ +$ distill (Shin et al., 2017; van de Ven & Tolias, 2018) degrade gracefully, while the regularization strength of online EWC prevents the method from achieving high accuracy (see Fig. A6 for a hyperparameter search on related work). Notably, task-conditioned hypernetworks show minimal memory decay and find high performance solutions. Because the hypernetwork operates in a compressive regime (see Fig. 3b and Fig. A7 for an exploration of compression ratios), our results do not naively rely on an increase in the number of parameters. Rather, they suggest that previous methods are not yet capable of making full use of target model capacity in a CL setting. We report a set of extended results on this benchmark on Appendix D, including a study of $\mathtt { C L 2 } / 3$ $T = 1 0 0$ ), where HNET $^ { \cdot } +$ TIR strongly outperforms the related work.
+
+Split MNIST benchmark. Split MNIST is another popular CL benchmark, designed to introduce task overlap. In this problem, the various digits are sequentially paired and used to form five binary classification tasks. Here, we find that task-conditioned hypernetworks are the best overall performers. In particular, $\mathrm { H N E T + R }$ improves the previous state-of-the-art method DGR $^ +$ distill on both CL2 and CL3, almost saturating the CL2 upper bound for replay models (Appendix D). Since $\mathrm { H N E T + R }$ i s essentially hypernetwork-protected DGR, these results demonstrate the generality of task-conditioned hypernetworks as effective memory protectors. To further support this, in Appendix F we show that our replay models (we experiment with both a VAE and a GAN) can learn in a class-incremental manner the full MNIST dataset. Finally, HNET $+$ ENT again outperforms both EWC and SI, without any generative modelling.
+
+On the split MNIST problem, tasks overlap and therefore continual learners can transfer information across tasks. To analyze such effects, we study task-conditioned hypernetworks with two-dimensional task embedding spaces, which can be easily visualized. Despite learning happening continually, we
+
+Table 1: Task-averaged test accuracy ( $\pm$ SEM, $n = 2 0 $ ) on the permuted (‘P10’) and split $( \ ' \mathbf { S } ^ { \prime } )$ MNIST experiments. In the table, EWC refers to online EWC and DGR refers to DGR $+$ distill (results reproduced from van de Ven & Tolias, 2019). We tested three hypernetwork-based models: for HNET $+$ ENT (HNET alone for CL1), we inferred task identity based on the entropy of the predictive distribution; for $\mathrm { H N E T + T I R }$ , we trained a hypernetwork-protected recognition-replay network (based on a VAE, cf. Fig. A1) to infer the task from input patterns; for $\mathrm { H N E T + R }$ the main classifier was trained by mixing current task data with synthetic data generated from a hypernetwork-protected VAE.
+
+
EWC
SI
DGR
HNET+ENT
HNET+TIR
HNET+R
P10-CL1
95.96 ± 0.06
94.75 ± 0.14
97.51 ± 0.01
97.57 ± 0.02
97.57 ± 0.02
97.87 ± 0.01
P10-CL2
94.42 ± 0.13
95.33 ± 0.11
97.35 ± 0.02
92.80 ± 0.15
97.58±0.02
97.60 ± 0.01
P10-CL3
33.88 ± 0.49
29.31± 0.62
96.38 ± 0.03
91.75 ± 0.21
97.59 ± 0.01
97.76 ± 0.01
S-CL1
99.12 ± 0.11
99.09 ± 0.15
99.61 ± 0.02
99.79 ± 0.01
99.79 ± 0.01
99.83 ± 0.01
S-CL2
64.32 ± 1.90
65.36 ± 1.57
96.83 ± 0.20
87.01 ± 0.47
94.43 ± 0.28
98.00 ± 0.03
S-CL3
19.96 ± 0.07
19.99 ± 0.06
91.79 ± 0.32
69.48 ± 0.80
89.59 ± 0.59
95.30 ± 0.13
+
+
+Figure 4: Two-dimensional task embedding space for the split MNIST benchmark. Colorcoded test set classification accuracies after learning the five splits, shown as the embedding vector components are varied. Markers denote the position of final task embeddings. (a) High classification performance with virtually no forgetting is achieved even when e-space is low-dimensional. The model shows information transfer in embedding space: the first task is solved in a large volume that includes embeddings for subsequently learned tasks. (b) Competition in embedding space: the last task occupies a finite high performance region, with graceful degradation away from the embedding vector. Previously learned task embeddings still lead to moderate, above-chance performance.
+
+find that the algorithm converges to a hypernetwork configuration that can produce target model parameters that simultaneously solve old and new tasks, Fig. 4, given the appropriate task embedding.
+
+Split CIFAR-10/100 benchmark. Finally, we study a more challenging benchmark, where the learner is first asked to solve the full CIFAR-10 classification task and is then presented with sets of ten classes from the CIFAR-100 dataset. We perform experiments both with a high-performance ResNet-32 target network architecture (Fig. 5) and with a shallower model (Fig. A3) that we exactly reproduced from previous work (Zenke et al., 2017). Remarkably, on the ResNet-32 model, we find that task-conditioned hypernetworks essentially eliminate altogether forgetting. Furthermore, forward information transfer takes place; knowledge from previous tasks allows the network to find better solutions than when learning each task individually from initial conditions. Interestingly, forward transfer is stronger on the shallow model experiments (Fig. A3), where we otherwise find that our method performs comparably to SI.
+
+# 4 DISCUSSION
+
+Bayesian accounts of continual learning. According to the standard Bayesian CL perspective, a posterior parameter distribution is recursively updated using Bayes’ rule as tasks arrive (Kirkpatrick et al., 2017; Huszár, 2018; Nguyen et al., 2018). While this approach is theoretically sound, in practice, the approximate inference methods that are typically preferred can lead to stiff models, as a compromise solution that suits all tasks has to be found within the mode determined by the first task. Such restriction does not apply to hypernetworks, which can in principle model complex multimodal distributions (Louizos & Welling, 2017; Pawlowski et al., 2017; Henning et al., 2018). Thus, rich, hypernetwork-modelled priors are one avenue of improvement for Bayesian CL methods. Interestingly, task-conditioning offers an alternative possibility: instead of consolidating every task onto a single distribution, a shared task-conditioned hypernetwork could be leveraged to model a set of parameter posterior distributions. This conditional metamodel naturally extends our framework to the Bayesian learning setting. Such approach will likely benefit from additional flexibility, compared to conventional recursive Bayesian updating.
+
+
+Figure 5: Split CIFAR-10/100 CL benchmark. Test set accuracies (mean $\pm$ STD, $n = 5$ ) on the entire CIFAR10 dataset and subsequent CIFAR-100 splits of ten classes. Our hypernetworkprotected ResNet-32 displays virtually no forgetting; final averaged performance (hnet, in red) matches the immediate one (hnet-during, in blue). Furthermore, information is transferred across tasks, as performance is higher than when training each task from scratch (purple). Disabling our regularizer leads to strong forgetting (in yellow).
+
+Related approaches that rely on task-conditioning. Our model fits within, and in certain ways generalizes, previous CL methods that condition network computation on task descriptors. Taskconditioning is commonly implemented using multiplicative masks at the level of modules (Rusu et al., 2016; Fernando et al., 2017), neurons (Serra et al., 2018; Masse et al., 2018) or weights (Mallya & Lazebnik, 2018). Such methods work best with large networks and come with a significant storage overhead, which typically scales with the number of tasks. Our approach differs by explicitly modelling the full parameter space using a metamodel, the hypernetwork. Thanks to this metamodel, generalization in parameter and task space is possible, and task-to-task dependencies can be exploited to efficiently represent solutions and transfer present knowledge to future problems. Interestingly, similar arguments have been drawn in work developed concurrently to ours (Lampinen & McClelland, 2019), where task embedding spaces are further explored in the context of few-shot learning. In the same vein, and like the approach developed here, recent work in CL generates last-layer network parameters as part of a pipeline to avoid catastrophic forgetting (Hu et al., 2019) or distills parameters onto a contractive auto-encoding model (Camp et al., 2018).
+
+Positive backwards transfer. In its current form, the hypernetwork output regularizer protects previously learned solutions from changing, such that only weak backwards transfer of information can occur. Given the role of selective forgetting and refinement of past memories in achieving intelligent behavior (Brea et al., 2014; Richards & Frankland, 2017), investigating and improving backwards transfer stands as an important direction for future research.
+
+Relevance to systems neuroscience. Uncovering the mechanisms that support continual learning in both brains and artificial neural networks is a long-standing question (McCloskey & Cohen, 1989; French, 1999; Parisi et al., 2019). We close with a speculative systems interpretation (Kumaran et al., 2016; Hassabis et al., 2017) of our work as a model for modulatory top-down signals in cortex. Task embeddings can be seen as low-dimensional context switches, which determine the behavior of a modulatory system, the hypernetwork in our case. According to our model, the hypernetwork would in turn regulate the activity of a target cortical network.
+
+As it stands, implementing a hypernetwork would entail dynamically changing the entire connectivity of a target network, or cortical area. Such a process seems difficult to conceive in the brain. However, this strict literal interpretation can be relaxed. For example, a hypernetwork can output lowerdimensional modulatory signals (Marder, 2012), instead of a full set of weights. This interpretation is consistent with a growing body of work which suggests the involvement of modulatory inputs in implementing context- or task-dependent network mode-switching (Mante et al., 2013; Jaeger, 2014; Stroud et al., 2018; Masse et al., 2018).
+
+# 5 CONCLUSION
+
+We introduced a novel neural network model, the task-conditioned hypernetwork, that is well-suited for CL problems. A task-conditioned hypernetwork is a metamodel that learns to parameterize target functions, that are specified and identified in a compressed form using a task embedding vector. Past tasks are kept in memory using a hypernetwork output regularizer, which penalizes changes in previously found target weight configurations. This approach is scalable and generic, being applicable as a standalone CL method or in combination with generative replay. Our results are state-of-the-art on standard benchmarks and suggest that task-conditioned hypernetworks can achieve long memory lifetimes, as well as transfer information to future tasks, two essential properties of a continual learner.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by the Swiss National Science Foundation (B.F.G. CRSII5-173721), ETH project funding (B.F.G. ETH-20 19-01) and funding from the Swiss Data Science Center (B.F.G, C17-18, J. v. O. P18-03). Special thanks to Simone Carlo Surace, Adrian Huber, Xu He, Markus Marks, Maria R. Cervera and Jannes Jegminat for discussions, helpful pointers to the CL literature and for feedback on our paper draft.
+
+# REFERENCES
+
+Ari S. Benjamin, David Rolnick, and Konrad Kording. Measuring and regularizing networks in function space. arXiv preprint arXiv:1805.08289, 2018.
+
+Luca Bertinetto, João F. Henriques, Jack Valmadre, Philip Torr, and Andrea Vedaldi. Learning feedforward one-shot learners. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 523–531. Curran Associates, Inc., 2016.
+
+Johanni Brea, Robert Urbanczik, and Walter Senn. A Normative Theory of Forgetting: Lessons from the Fruit Fly. PLOS Computational Biology, 10(6):e1003640, 2014.
+
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019.
+
+Blake Camp, Jaya Krishna Mandivarapu, and Rolando Estrada. Self-net: Lifelong learning via continual self-modeling. arXiv preprint arXiv:1805.10354, 2018.
+
+Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. arXiv preprint arXiv:1907.02544, 2019.
+
+Sebastian Farquhar and Yarin Gal. Towards robust evaluations of continual learning. arXiv preprint arXiv:1805.09733, 2018.
+
+Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
+
+Robert M. French. Catastrophic forgetting in connectionist networks. Trends in Cognitive Sciences, 3 (4):128–135, April 1999.
+
+Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014.
+
+David Ha, Andrew M. Dai, and Quoc V. Le. HyperNetworks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
+
+Boris Hanin. Universal Function Approximation by Deep Neural Nets with Bounded Width and ReLU Activations. arXiv preprint: arXiv:1708.02691, 2017.
+
+Demis Hassabis, Dharshan Kumaran, Christopher Summerfield, and Matthew Botvinick. Neuroscience-Inspired Artificial Intelligence. Neuron, 95(2):245–258, July 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.
+
+Xu He and Herbert Jaeger. Overcoming catastrophic interference using conceptor-aided backpropagation. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, 2018.
+
+Xu He, Jakub Sygnowski, Alexandre Galashov, Andrei A Rusu, Yee Whye Teh, and Razvan Pascanu. Task agnostic continual learning via meta learning. arXiv preprint arXiv:1906.05201, 2019.
+
+Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016.
+
+Christian Henning, Johannes von Oswald, João Sacramento, Simone Carlo Surace, Jean-Pascal Pfister, and Benjamin F Grewe. Approximating the predictive distribution via adversarially-trained hypernetworks. In NeurIPS Bayesian Deep Learning Workshop, 2018.
+
+Wenpeng Hu, Zhou Lin, Bing Liu, Chongyang Tao, Zhengwei Tao, Jinwen Ma, Dongyan Zhao, and Rui Yan. Overcoming catastrophic forgetting for continual learning via model adaptation. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+
+Ferenc Huszár. Note on the quadratic penalties in elastic weight consolidation. Proceedings of the National Academy of Sciences, 115(11):E2496–E2497, March 2018.
+
+Herbert Jaeger. Controlling Recurrent Neural Networks by Conceptors. arXiv preprint: arXiv:1403.3369, 2014.
+
+Xu Jia, Bert De Brabandere, Tinne Tuytelaars, and Luc V Gool. Dynamic Filter Networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 667–675. Curran Associates, Inc., 2016.
+
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4401–4410, 2019.
+
+Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
+
+Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
+
+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, March 2017.
+
+Dharshan Kumaran, Demis Hassabis, and James L. McClelland. What Learning Systems do Intelligent Agents Need? Complementary Learning Systems Theory Updated. Trends in Cognitive Sciences, 20(7):512–534, July 2016.
+
+Andrew K Lampinen and James L McClelland. Embedded meta-learning: Toward more flexible deep-learning models. arXiv preprint arXiv:1905.09950, 2019.
+
+Moshe Leshno and Shimon Schocken. Multilayer feedforward networks with a nonpolynomial activation function can approximate any function. Neural Networks, 6:861–867, 1993.
+
+Z. Li and D. Hoiem. Learning without Forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(12):2935–2947, 2018.
+
+Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. arXiv preprint arXiv:1706.02690, 2017.
+
+Christos Louizos and Max Welling. Multiplicative Normalizing Flows for Variational Bayesian Neural Networks. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 2218–2227. JMLR.org, 2017.
+
+Mario Luciˇ c, Michael Tschannen, Marvin Ritter, Xiaohua Zhai, Olivier Bachem, and Sylvain ´ Gelly. High-fidelity image generation with fewer labels. In International Conference on Machine Learning, pp. 4183–4192, 2019.
+
+Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7765–7773, 2018.
+
+Valerio Mante, David Sussillo, Krishna V. Shenoy, and William T. Newsome. Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature, 503(7474):78–84, 2013.
+
+Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2813–2821. IEEE, 2017.
+
+Eve Marder. Neuromodulation of Neuronal Circuits: Back to the Future. Neuron, 76(1):1–11, October 2012.
+
+Nicolas Y Masse, Gregory D Grant, and David J Freedman. Alleviating catastrophic forgetting using context-dependent gating and synaptic stabilization. Proceedings of the National Academy of Sciences, 115(44):E10467–E10475, 2018.
+
+Michael McCloskey and Neal J. Cohen. Catastrophic Interference in Connectionist Networks: The Sequential Learning Problem. volume 24, pp. 109–165. Academic Press, 1989.
+
+Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
+
+Cuong V. Nguyen, Yingzhen Li, Thang D. Bui, and Richard E. Turner. Variational continual learning. 2018.
+
+German I. Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, May 2019.
+
+Nick Pawlowski, Andrew Brock, Matthew C. H. Lee, Martin Rajchl, and Ben Glocker. Implicit Weight Uncertainty in Neural Networks. arXiv preprint arXiv:1711.01297, 2017.
+
+Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML’14, pp. II–1278– II–1286. JMLR.org, 2014.
+
+Blake A. Richards and Paul W. Frankland. The Persistence and Transience of Memory. Neuron, 94 (6):1071–1084, June 2017.
+
+Hippolyt Ritter, Aleksandar Botev, and David Barber. Online structured laplace approximations for overcoming catastrophic forgetting. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 3738–3748. Curran Associates, Inc., 2018.
+
+Anthony Robins. Catastrophic Forgetting, Rehearsal and Pseudorehearsal. Connection Science, 7(2): 123–146, June 1995.
+
+David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy P Lillicrap, and Greg Wayne. Experience replay for continual learning. arXiv preprint arXiv:1811.11682, 2018.
+
+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.
+
+Jürgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992.
+
+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 Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4528–4537, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
+
+Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. 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. 4548–4557, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
+
+Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual Learning with Deep Generative Replay. 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. 2990–2999. Curran Associates, Inc., 2017.
+
+Jake P. Stroud, Mason A. Porter, Guillaume Hennequin, and Tim P. Vogels. Motor primitives in space and time via targeted gain modulation in cortical networks. Nature Neuroscience, 21(12):1774, December 2018.
+
+Siddharth Swaroop, Cuong V Nguyen, Thang D Bui, and Richard E Turner. Improving and understanding variational continual learning. Continual Learning Workshop at NeurIPS, 2018.
+
+Gido M. van de Ven and Andreas S. Tolias. Generative replay with feedback connections as a general strategy for continual learning. arXiv preprint arXiv:1809.10635, 2018.
+
+Gido M. van de Ven and Andreas S. Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019.
+
+Chenshen Wu, Luis Herranz, Xialei Liu, yaxing wang, Joost van de Weijer, and Bogdan Raducanu. Memory Replay GANs: Learning to Generate New Categories without Forgetting. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 5962–5972. Curran Associates, Inc., 2018.
+
+Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual Learning Through Synaptic Intelligence. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 3987–3995. JMLR.org, 2017.
+
+# A TASK-CONDITIONED HYPERNETWORKS: MODEL SUMMARY
+
+In our model, a task-conditioned hypernetwork produces the parameters $\Theta _ { \mathrm { t r g t } } = f _ { \mathrm { h } } ( \mathbf { e } , \Theta _ { \mathrm { h } } )$ of a target neural network. Given one such parameterization, the target model then computes predictions $\hat { \mathbf { y } } \doteq f _ { \mathrm { t r g t } } ( \mathbf { x } , \Theta _ { \mathrm { t r g t } } )$ based on input data. Learning amounts to adapting the parameters $\Theta _ { \mathrm { h } }$ of the hypernetwork, including a set of task embeddings $\{ { \bf e } ^ { ( t ) } \} _ { t = 1 } ^ { T }$ , as well as a set of chunk embeddings $\{ { \mathbf { c } } _ { i } \} _ { i = 1 } ^ { N _ { \mathrm { C } } }$ in case compression is sought or if the full hypernetwork is too large to be handled directly. To avoid castastrophic forgetting, we introduce an output regularizer which fixes the behavior of the hypernetwork by penalizing changes in target model parameters that are produced for previously learned tasks.
+
+Variables that need to be stored while learning new tasks. What are the storage requirements of our model, when learning continually?
+
+1. Memory retention relies on saving one embedding per task. This collection $\{ { \bf e } ^ { ( t ) } \} _ { t = 1 } ^ { T }$ therefore grows linearly with $T$ . Such linear scaling is undesirable asymptotically, but it turns out to be essentially negligible in practice, as each embedding is a single lowdimensional vector (e.g., see Fig. 4 for a run with 2D embeddings). 2. A frozen snapshot of the hypernetwork parameters $\Theta _ { \mathrm { h } } ^ { * }$ , taken before learning a new task, needs to be kept, to evaluate the output regularizer in Eq. 2.
+
+# B ADDITIONAL DETAILS ON HYPERNETWORK-PROTECTED REPLAY MODELS
+
+Variational autoencoders. For all HNET $^ +$ TIR and $\mathrm { H N E T + R }$ experiments reported on the main text we use VAEs as our replay models (Fig. A1a, Kingma & Welling, 2014). Briefly, a VAE consists of an encoder-decoder network pair, where the encoder network processes some input pattern $\mathbf { x }$ and its outputs $f _ { \mathrm { e n c } } ( \mathbf { x } ) = ( \pmb { \mu } , \pmb { \sigma } ^ { 2 } )$ comprise the parameters $\pmb { \mu }$ and $\sigma ^ { 2 }$ (encoded in log domain, to enforce nonnegativity) of a diagonal multivariate Gaussian $p _ { Z } ( \mathbf { z } ; \pmb { \mu } , \pmb { \sigma } ^ { 2 } )$ , which governs the distribution of latent samples $\mathbf { z }$ . On the other side of the circuit, the decoder network processes a latent sample $\mathbf { z }$ and a one-hot-encoded task identity vector and returns an input pattern reconstruction, $f _ { \mathrm { d e c } } ( \mathbf { z } , \mathbf { 1 } _ { t } ) = \hat { \mathbf { x } }$ .
+
+VAEs can preserve memories using a technique called generative replay: when training task $T$ , input samples are generated from the current replay network for old tasks $t < T$ , by varying $\mathbf { 1 } _ { t }$ and drawing latent space samples $\mathbf { z }$ . Generated data can be mixed with the current dataset, yielding an augmented dataset $\tilde { \mathcal X }$ used to relearn model parameters. When protecting a discriminative model, synthetic ‘soft’ targets can be generated by evaluating the network on $\tilde { \mathcal X }$ . We use this strategy to protect an auxiliary task inference classifier in HNET $+ { \bf \Phi }$ TIR, and to protect the main target model in $\mathrm { H N E T + R }$ .
+
+Hypernetwork-protected replay. In our HNET+TIR and $\mathrm { H N E T + R }$ experiments, we parameterize the decoder network through a task-conditioned hypernetwork, $f _ { \mathrm { h , d e c } } ( \mathbf { e } , \Theta _ { \mathrm { h , d e c } } )$ . In combination with our output regularizer, this allows us to take advantage of the memory retention capacity of hypernetworks, now on a generative model.
+
+The replay model (encoder, decoder and decoder hypernetwork) is a separate subsystem that is optimized independently from the target network. Its parameters $\Theta _ { \mathrm { e n c } }$ and $\Theta _ { \mathrm { h , d e c } }$ are learned by minimizing our regularized loss function, Eq. 2, here with the task-specific term set to the standard VAE objective function,
+
+$$
+\begin{array} { r } { \mathcal { L } _ { \mathrm { V A E } } \big ( \mathbf { X } , \boldsymbol { \Theta } _ { \mathrm { e n c } } , \boldsymbol { \Theta } _ { \mathrm { h , d e c } } \big ) = \mathcal { L } _ { \mathrm { r e c } } ( \mathbf { X } , \boldsymbol { \Theta } _ { \mathrm { e n c } } , \boldsymbol { \Theta } _ { \mathrm { d e c } } ) + \mathcal { L } _ { \mathrm { p r i o r } } ( \mathbf { X } , \boldsymbol { \Theta } _ { \mathrm { e n c } } , \boldsymbol { \Theta } _ { \mathrm { d e c } } ) , } \end{array}
+$$
+
+with $\Theta _ { \mathrm { d e c } } = f _ { \mathrm { h , d e c } } ( \mathbf { e } , \Theta _ { \mathrm { h , d e c } } )$ introducing the dependence on $\Theta _ { \mathrm { h , d e c } }$ . ${ \mathcal { L } } _ { \mathrm { V A E } }$ balances a reconstruction $\mathcal { L } _ { \mathrm { r e c } }$ and a prior-matching ${ \mathcal { L } } _ { \mathrm { p r i o r } }$ penalties. For our MNIST experiments, we choose binary crossentropy (in pixel space) as the reconstruction loss, that we write below for a single example $\mathbf { x }$
+
+$$
+\mathcal { L } _ { \mathrm { r e c } } ( \mathbf { x } , \Theta _ { \mathrm { e n c } } , \Theta _ { \mathrm { d e c } } ) = \mathcal { L } _ { \mathrm { x e n t } } \big ( \mathbf { x } , f _ { \mathrm { d e c } } \big ( \mathbf { z } , \mathbf { 1 } _ { t ( \mathbf { x } ) } , \Theta _ { \mathrm { d e c } } \big ) \big ) ,
+$$
+
+where $\begin{array} { r } { \mathcal { L } _ { \mathrm { x e n t } } ( t , y ) = - \sum _ { k } t _ { k } \log y _ { k } } \end{array}$ is the cross entropy. For a diagonal Gaussian $p _ { Z }$ , the priormatching term can be evaluated analytically,
+
+$$
+\mathcal { L } _ { \mathrm { p r i o r } } = - \frac { 1 } { 2 } \sum _ { i = 1 } ^ { | \mathbf { z } | } \left( 1 + \log \sigma _ { i } ^ { 2 } - \sigma _ { i } ^ { 2 } - \mu _ { i } ^ { 2 } \right) .
+$$
+
+Above, $\mathbf { z }$ is a sample from $p _ { Z } ( \mathbf { z } ; \pmb { \mu } ( \tilde { \mathbf { x } } ) , \pmb { \sigma } ^ { 2 } ( \tilde { \mathbf { x } } ) )$ obtained via the reparameterization trick (Kingma & Welling, 2014; Rezende et al., 2014). This introduces the dependency of $\mathcal { L } _ { \mathrm { r e c } }$ on $\Theta _ { \mathrm { e n c } }$ .
+
+Task inference network $\mathbf { \left( H N E T + T I R \right) }$ ). In the HNET $^ +$ TIR setup, we extend our system to include a task inference neural network classifier $\alpha ( \mathbf { x } )$ parameterized by $\Theta _ { \mathrm { T I } }$ , where tasks are encoded with a $T$ -dimensional softmax output layer. In both CL2 and CL3 scenarios we use a growing single-head setup for $_ { \pmb { \alpha } }$ , and increase the dimensionality of the softmax layer as tasks arrive.
+
+This network is prone to catastrophic forgetting when tasks are learned continually. To prevent this from happening we resort to replay data generated from a hypernetwork-protected VAE, described above. More specifically, we introduce a task inference loss,
+
+$$
+\mathcal { L } _ { \mathrm { T I } } ( \tilde { \mathbf { x } } , \boldsymbol { \Theta } _ { \mathrm { T I } } ) = \mathcal { L } _ { \mathrm { x e n t } } \big ( \mathbf { 1 } _ { t ( \tilde { \mathbf { x } } ) } , \alpha ( \tilde { \mathbf { x } } , \boldsymbol { \Theta } _ { \mathrm { e n c } } ) \big ) ,
+$$
+
+where $t ( \tilde { { \bf x } } )$ denotes the correct task identity for a sample $\tilde { \bf x }$ from the augmented dataset $\tilde { \mathcal { X } } =$ $\{ \tilde { \mathbf { X } } ^ { ( 1 ) } , . . . \tilde { \mathbf { X } } ^ { ( T - 1 ) } , \tilde { \mathbf { X } } ^ { ( T ) } \}$ with $\tilde { \mathbf { X } } ^ { ( t ) }$ being synthetic data $f _ { \mathrm { d e c } } ( \mathbf { z } , \mathbf { 1 } _ { t } , \Theta _ { \mathrm { d e c } } )$ for $t = 1 \ldots T - 1$ and $\tilde { \mathbf { X } } ^ { ( T ) } = \mathbf { X } ^ { ( T ) }$ is the current task data. Importantly, synthetic data is essential to obtain a well defined objective function for task inference; the cross-entropy loss ${ \mathcal { L } } _ { \mathrm { T I } }$ requires at least two groundtruth classes to be optimized. Note that replayed data can be generated online by drawing samples $z$ from the prior.
+
+
+Figure A1: Hypernetwork-protected replay model setups. (a) A hypernetwork-protected VAE, that we used for $\mathrm { H N E T + R }$ and HNET $^ +$ TIR main text experiments. (b) A hypernetwork-protected GAN, that we used for our class-incremental learning Appendix F experiments. (c) A task inference classifier protected with synthetic replay data, used on HNET $\because$ TIR experiments.
+
+Hypernetwork-protected GANs. Generative adversarial networks (Goodfellow et al., 2014) have become an established method for generative modelling and tend to produce higher quality images compared to VAEs, even at the scale of datasets as complex as ImageNet (Brock et al., 2019; Luciˇ c´ et al., 2019; Donahue & Simonyan, 2019). This makes GANs perfect candidates for powerful replay models. A suitable GAN instantiation for CL is the conditional GAN (Mirza & Osindero, 2014) as studied by Wu et al. (2018). Recent developments in the GAN literature already allude towards the potential of using hypernetwork-like structures, e.g., when injecting the latent noise (Karras et al., 2019) or when using class-conditional batch-normalization as in (Brock et al., 2019). We propose to go one step further and use a hypernetwork that maps the condition to the full set of generator parameters $\Theta _ { \mathrm { g e n } } ^ { * }$ . Our framework allows training a conditional GAN one condition at the time. This is potentially of general interest, and goes beyond the scope of replay models, since conditional GANs trained in a mutli-task fashion as in Brock et al. (2019) require very large computational resources.
+
+For our showcase experiment on class-incremental MNIST learning, Fig. A8, we did not aim to compare to related work and therefore did not tune to have less weights in the hypernetwork than on the target network (for the VAE experiments, we use the same compressive setup as in the main text, see Appendix C). The GAN hypernetwork is a fully-connected chunked hypernetwork with 2 hidden layers of size 25 and 25 followed by an output size of 75,000. We used learning rates for both discriminator and the generator hypernetwork of 0.0001, as well as dropout of 0.4 in the discriminator and the system is trained for 10000 iterations per task. We use the Pearson $\mathrm { C h i ^ { 2 } }$ Least-Squares GAN loss from Mao et al. (2017) in our experiments.
+
+# C ADDITIONAL EXPERIMENTAL DETAILS
+
+All experiments are conducted using 16 NVIDIA GeForce RTX 2080 TI graphics cards.
+
+For simplicity, we decided to always keep the previous task embeddings $\mathbf { e } ^ { ( t ) }$ , $t = 1 , \dots , T - 1$ , fixed and only learn the current task embedding ${ \bf e } ^ { ( \bar { T } ) }$ . In general, performance should be improved if the regularizer in Eq. 2 has a separate copy of the task embeddings $\mathbf { e } ^ { ( t , * ) }$ from before learning the current task, such that $\bar { \mathbf e } ^ { ( t ) }$ can be adapted. Hence, the targets become $f _ { \mathrm { h } } ( \mathbf { e } ^ { ( t , * ) } , \Theta _ { \mathrm { h } } ^ { * } )$ and remain constant while learning task $T$ . This would give the hypernetwork the flexibility to adjust the embeddings i.e. the preimage of the targets and therefore represent any function that includes all desired targets in its image.
+
+Nonlinear regression toy problem. The nonlinear toy regression from Fig. 2 is an illustrative example for a continual learning problem where a set of ground-truth functions $\{ g ^ { ( 1 ) } , \ldots , g ^ { ( T ) } \}$ is given from which we collect 100 noisy training samples per task $\{ ( \mathbf { x } , \mathbf { y } ) ~ | ~ \mathbf { y } = g ^ { ( t ) } ( \mathbf { x } ) + \epsilon$ with $\epsilon \sim$ $\mathcal { N } ( 0 , \sigma ^ { 2 } I ) , \mathbf { x } \sim \mathcal { U } ( \mathcal { X } ^ { ( t ) } ) \}$ , where $\chi ^ { ( t ) }$ denotes the input domain of task $t$ . We set $\sigma = 0 . 0 5$ in this experiment.
+
+We perform 1D regression and choose the following set of tasks:
+
+$$
+\begin{array} { l l } { { g ^ { ( 1 ) } ( x ) = x + 3 } } & { { \qquad \chi ^ { ( 1 ) } = [ - 4 , - 2 ] } } \\ { { g ^ { ( 2 ) } ( x ) = 2 x ^ { 2 } - 1 } } & { { \qquad \chi ^ { ( 2 ) } = [ - 1 , 1 ] } } \\ { { g ^ { ( 3 ) } ( x ) = ( x - 3 ) ^ { 3 } } } & { { \qquad \chi ^ { ( 3 ) } = [ 2 , 4 ] } } \end{array}
+$$
+
+The target network $f _ { \mathrm { t r g t } }$ consists of two fully-connected hidden layers using 10 neurons each. For illustrative purposes we use a full hypernetwork $f _ { \mathrm { h } }$ that generates all 141 weights of $f _ { \mathrm { t r g t } }$ at once, also being a fully-connected network with two hidden-layers of size 10. Hence, this is the only setup where we did not explore the possibility of a chunked hypernetwork. We use sigmoid activation functions in both networks. The task embedding dimension was set to 2.
+
+We train each task for 4000 iterations using the Adam optimizer with a learning rate of 0.01 (and otherwise default PyTorch options) and a batch size of 32.
+
+To test our regularizer in Fig. 2a we set $\beta _ { \mathrm { o u t p u t } }$ to 0.005, while it is set to 0 for the fine-tuning experiment in Fig. 2c.
+
+For the multi-task learner in Fig. 2b we trained only the target network (no hypernetwork) for 12000 iterations with a learning rate of 0.05. Comparable performance could be obtained when training the task-conditioned hypernetwork in this multi-task regime (data not shown).
+
+It is worth noting that the multi-task learner from Fig. 2b that uses no hypernetwork is only able to learn the task since we choose the input domains to be non-overlapping.
+
+Permuted MNIST benchmark. For our experiments conducted on MNIST we replicated the experimental setup proposed by van de Ven & Tolias (2019) whenever applicable. We therefore use the same number of training iterations, the same or a lower number of weights in the hypernetwork than in the target network, the same learning rates and the same optimizer. For the replay model, i.e., the hypernetwork-empowered VAE, as well as for the standard classifier we used 5000 training iterations per task and learning rate is set to 0.0001 for the Adam optimizer (otherwise PyTorch default values). The batchsize is set to 128 for the VAE whereas the classifier is simultaneously trained on a batch of 128 samples of replayed data (evenly distributed over all past tasks) and a batch of 128 images from the currently available dataset. MNIST images are padded with zeros, which results in network inputs of size $3 2 \times 3 2$ , again strictly following the implementation of the compared work. We experienced better performance when we condition our replay model on a specific task input. We therefore construct for every task a specific input namely a sample from a standard multivariate normal of dimension 100. In practice we found the dimension to be not important. This input stays constant throughout the experiment and is not learned. Note that we use the same hyperparameters for all learning scenarios, which is not true for the reported related work since they have tuned special hyperparameters for all scenarios and all methods.
+
+• Details of hypernetwork for the VAE. We use one hypernetwork configuration to generate weights for all variational autoencoders used for our PermutedMNIST-10 experiments namely a fully-connected chunked hypernetwork with 2 hidden layers of size 25 and 25 followed by an output size of 85,000. We use ELU nonlinearities in the hidden layers of the hypernetwork. The size of task embeddings e has been set to 24 and the size of chunk embeddings c to 8. The parameter $\beta _ { \mathrm { o u t p u t } }$ is 0.05 . The number of weights in this hypernetwork is 2,211,907 (2,211,691 network weights $+ 2 1 6$ task embedding weights). The corresponding target network (and therefore output of the chunked hypernetwork), as taken from related work, has 2,227,024 weights.
+
+
+Figure A2: Additional experiments on the PermutedMNIST-100 benchmark. (a) Final test set classification accuracy on the $t$ -th task after learning one hundred permutations (PermutedMNIST100). All runs use exactly the same hyperparameter configuration except for varying values of $\beta _ { \mathrm { o u t p u t } }$ . The final accuracies are robust for a wide range of regularization strengths. If $\beta _ { \mathrm { o u t p u t } }$ is too weak, forgetting will occur. However, there is no severe disadvantage of choosing $\beta _ { \mathrm { o u t p u t } }$ too high (cmp. (c)). A too high $\beta _ { \mathrm { o u t p u t } }$ simply shifts the attention of the optimizer away from the current task, leading to lower baseline accuracies when the training time is not increased. (b) Due to an increased number of output neurons, the target network for PermutedMNIST-100 has more weights than for PermutedMNIST-10 (this is only the case for CL1 and CL3). This plot shows that the performance drop is minor when choosing a hypernetwork with a comparable number of weights as the target network in CL2 (orange) compared to one that has a similar number of weights as the target network for CL1 in PermutedMNIST-100 (red). (c) Task-averaged test set accuracy after learning all tasks (labelled ‘final’, in red) and immediately after learning a task (labelled ‘during’, in purple) for the runs depicted in (a). For low values of $\beta _ { \mathrm { o u t p u t } }$ final accuracies are worse than immediate once (forgetting occurs). If $\beta _ { \mathrm { o u t p u t } }$ is too high, baseline accuracies decrease since the optimizer puts less emphasis on the current task (note that the training time per task is not increased). Shaded areas in (a) and (b) denote STD, whereas error bars in (c) denote SEM (always across 5 random seeds).
+
+• Details of the VAE for $\mathbf { H N E T + T I R }$ . For this variational autoencoder, we use two fullyconnected neural networks with layers of size 1000, 1000 for the encoder and 1000, 1000 for the decoder and a latent space of 100. This setup is again copied from work we compare against.
+
+• Details of the VAE for $\mathbf { H N E T + R }$ . For this variational autoencoder, we use two fullyconnected neural networks with layers of size 400, 400 for the encoder and 400, 400 for the decoder (both 1000, 1000 in the related work) and a latent space of dimension 100. Here, we departure from related work by choosing a smaller architecture for the autoencoder. Note that we still use a hypernetwork with less trainable parameters than the target network (in this case the decoder) that is used in related work.
+
+• Details of the hypernetwork for the target classifier in PermutedMNIST-10 (HNET+TIR & HNET $^ +$ ENT). We use the same setup for the hypernetwork as used for the VAEs above, but since the target network is smaller we reduce the output of the hypernetwork to 78,000. We also adjust the parameter $\beta _ { \mathrm { o u t p u t } }$ to 0.01, consistent with our PermutedMNIST-100 experiments. The number of weights in this hypernetwork is therefore 2,029,931 parameters (2,029,691 network weights $+ 2 4 0$ task embedding weights). The corresponding target network (from related work) would have 2,126,100 weights for CL1 and CL3 and 2,036,010 for CL2 (only one output head).
+
+• Details of the hypernetwork for the target classifier for PermutedMNIST-100. For these experiments we chose an architecture that worked well on the PermutedMNIST-10 benchmark and did not conduct any more search for new architectures. For PermutedMNIST100, the reported results were obtained by using a chunked hypernetwork with 3 hidden layers of size 200, 250 and 350 (300 for CL2) and an output size of 7500 (6000 for CL2) (such that we approximately match the corresponding target network size for CL1/CL2/CL3). Interestingly, Fig. A2b shows that even if we don’t adjust the number of hypernetwork weights to the increased number of target network weights, the superiority of our method is evident. Aside from this, the plots in Fig. 3 have been generated using the PermutedMNIST-10 HNET $+$ TIR setup (note that this includes the conditions set by related work for PermutedMNIST-10, e.g., target network sizes, the number of training iterations, learning rates, etc.).
+
+• Details of the VAE and the hypernetwork for the VAE in PermutedMNIST-100 for CL2/CL3. We use a very similar setup for the VAE and it’s hypernetwork used in HNET+TIR for PermutedMNIST-10 as described above. We only applied the following changes: Fully-connected hypernetwork with one hidden layer of size 100; chunk embedding sizes are set to 12; task embedding sizes are set two 128 and the hidden layer sizes of the VAE its generator are 400, 600. Also we increased the regularisation strength $\beta _ { \mathrm { o u t p u t } } = 0 . 1$ for the VAE its generator hypernetwork.
+
+• Details of the target classifier for HNET $^ +$ TIR & HNET $+$ ENT. For this classifier, we use the same setup as in the study we compare to (van de Ven & Tolias, 2019), i.e., a fully-connected network with layers of size 1000, 1000. Note that if the classifier is used as a task inference model, it is trained on replay data and the corresponding hard targets, i.e., the argmax of the soft targets.
+
+Below, we report the specifications for our automatic hyperparameter search (if not noted otherwise, these specifications apply for the split MNIST and split CIFAR experiments as well):
+
+• Hidden layer sizes of the hypernetwork: (no hidden layer), "5,5" "10,10", "25,25", "50,50", "100,100", "10", "50", "100"
+• Output size of the hypernetwork: fitted such that we obtain less parameters then the target network which we compare against
+• Embedding sizes (for e and c): 8, 12, 24, 36, 62, 96, 128
+• $\beta _ { \mathrm { o u t p u t } }$ : 0.0005, 0.001, 0.005, 0.01, 0.005, 0.1, 0.5, 1.0
+
+• Hypernetwork transfer functions: linear, ReLU, ELU, Leaky-ReLU
+
+Note that only a random subset of all possible combinations of hyperparameters has been explored.
+
+After we found a configuration with promising accuracies and a similar number of weights compared to the original target network, we manually fine-tuned the architecture to increase/decrease the number of hypernetwork weights to approximately match the number of target network weights.
+
+The choice of hypernetwork architecture seems to have a strong influence on the performance. It might be worth exploring alternatives, e.g., an architecture inspired by those used in typical generative models. We note that in addition to the above specifications we explored manually some hyperparameter configurations to gain a better understanding of our method.
+
+Split MNIST benchmark. Again, whenever applicable we reproduce the setup from van de Ven & Tolias (2019). Differences to the PermutedMNIST-10 experiments are just the learning rate (0.001) and the number of training iterations (set to 2000).
+
+• Details of hypernetwork for the VAE. We use one hypernetwork configuration to generate weights for all variational autoencoders used for our split MNIST experiments, namely a fully-connected chunked hypernetwork with 2 hidden layers of size 10, 10 followed by an output size of 50,000. We use ELU nonlinearities in the hidden layers of the hypernetwork. The size of task embeddings $\mathbf { e }$ has been set to 96 and the size of chunk embeddings c to 96. The parameter $\beta _ { \mathrm { o u t p u t } }$ is 0.01 for HNET $+ \mathbf { R }$ and 0.05 for $\mathrm { H N E T + T I R }$ . The number of weights in this hypernetwork is 553,576 (553,192 network weights $+ 3 8 4$ task embedding weights). The corresponding target network (and therefore output of the chunked hypernetwork), as taken from related work, has 555,184 weights. For a qualitative analyses of the replay data of this VAE (class incrementally learned), see A8.
+
+• Details of the VAE for $\mathbf { H N E T + T I R }$ . For this variational autoencoder, we use two fullyconnected neural networks with layers of size 400, 400 for the encoder and 50, 150 for the decoder (both 400, 400 in the related work) and a latent space of dimension 100.
+
+• Details of the VAE for $\mathbf { H N E T + R }$ . For this variational autoencoder, we use two fullyconnected neural networks with layers of size 400, 400 for the encoder and 250, 350 for the decoder (both 400, 400 in the related work) and a latent space of dimension 100.
+
+• Details of the hypernetwork for the target classifier in split MNIST $\mathbf { H } \mathbf { N } \mathbf { E } \mathbf { T } { + } \mathbf { T } \mathbf { I } \mathbf { R }$ & HNET+ENT). We use the same setup for the hypernetwork as used for the VAE above, but since the target network is smaller we reduce the output of the hypernetwork to 42,000. We also adjust the $\beta _ { \mathrm { o u t p u t } }$ to 0.01 although this parameter seems to not have a strong effect on the performance. The number of weights in this hypernetwork is therefore 465,672 parameters (465,192 network weights $+ 4 8 0$ task embedding weights). The corresponding target network (from related work) would have 478,410 weights for CL1 and CL3 and 475,202 for CL2 (only one output head).
+
+• Details of the target classifier for HNET+TIR & HNET $+$ ENT. For this classifier, we again use the same setup as in the study we compare to (van de Ven & Tolias, 2019), i.e., a fully-connected neural networks with layers of size 400, 400. Note that if the classifier is used as a task inference model, it is trained on replay data and the corresponding hard targets, i.e., the argmax the soft targets.
+
+Split CIFAR-10/100 benchmark. For these experiments, we used as a target network a ResNet-32 network (He et al. (2016)) and again produce the weights of this target network by a hypernetwork in a compressive manner. The hypernetwork in this experiment directly maps from the joint task and chunk embedding space (both dimension 32) to the output space of the hypernetwork, which is of dimension 7,000. This hypernetwork has 457,336 parameters (457,144 network weights $+ \ 1 9 2$ task embedding weights). The corresponding target network, the ResNet-32, has 468.540 weights (including batch-norm weights). We train for 200 epochs per task using the Adam optimizer with an initial learning rate of 0.001 (and otherwise default PyTorch values) and a batch size of 32. In addition, we apply the two learning rate schedules suggested in the Keras CIFAR-10 example2.
+
+Due to the use of batch normalization, we have to find an appropriate way to handle the running statistics which are estimated during training. Note, these are not parameters which are trained through backpropagation. There are different ways how the running statistics could be treated:
+
+1. One could ignore the running statistics altogether and simply compute statistics based on the current batch during evaluation.
+2. The statistics could be part of the hypernetwork output. Therefore, one would have to manipulate the target hypernetwork output of the previous task, such that the estimated running statistics of the previous task will be distilled into the hypernetwork.
+3. The running statistics can simply be checkpointed and stored after every task. Note, this method would lead to a linear memory growth in the number of tasks that scales with the number of units in the target network.
+
+For simplicity, we chose the last option and simply checkpointed the running statistics after every task.
+
+For the fine-tuning results in Fig. 5 we just continually updated the running statistics (thus, we applied no checkpointing).
+
+# D ADDITIONAL EXPERIMENTS AND NOTES
+
+Split CIFAR-10/100 benchmark using the model of Zenke et al. (2017). We re-run the split CIFAR-10/100 experiment reported on the main text while reproducing the setup from Zenke et al. (2017). Our overall classification performance is comparable to synaptic intelligence, which achieves $7 3 . 8 5 \%$ task-averaged test set accuracy, while our method reaches $7 1 . 2 9 \% \pm 0 . 3 2 \%$ , with initial baseline performance being slightly worse in our approach, Fig. A3.
+
+
+Figure A3: Replication of the split CIFAR-10/100 experiment of Zenke et al. (2017). Test set accuracies on the entire CIFAR-10 dataset and subsequent CIFAR-100 splits. Both task-conditioned hypernetworks (hnet, in red) and synaptic intelligence (SI, in green) transfer information forward and are protected from catastrophic forgetting. The performance of the two methods is comparable. For completeness, we report our test set accuracies achieved immediately after training (hnet-during, in blue), when training from scratch (purple), and with our regularizer turned off (fine-tuning, yellow).
+
+To obtain our results, we use a hypernetwork with 3 hidden-layers of sizes 100, 150, 200 and output size 5500. The size of task embeddings e has been set to 48 and the size of chunk embeddings c to 80. The parameter $\beta _ { \mathrm { o u t p u t } }$ is 0.01 and the learning rate is set to 0.0001.
+
+The number of weights in this hypernetwork is 1,182,678 (1,182,390 network weights $+ 2 8 8$ task embedding weights). The corresponding target network would have 1,276,508 weights.
+
+In addition to the above specified hyperparameter search configuration we also included the following learning rates: 0.0001, 0.0005, 0.001 and manually tuned some architectural parameters.
+
+
+Figure A4: Context-free inference using hypernetwork-protected replay $\mathbf { \left( H N E T + T I R \right. }$ ) on long task sequences. Final test set classification accuracy on the $t$ -th task after learning one hundred permutations of the MNIST dataset (PermutedMNIST-100) for the CL2 (a) and CL3 (b) scenarios, where task identity is not explicitly provided to the system. As before, the number of hypernetwork parameters is not larger than that of the related work we compare to. (a) HNET+TIR displays almost perfect memory retention. We used a stochastic regularizer (cf. Appendix D note below) which evaluates the output regularizer in Eq. 2 only for a random subset of previous tasks (here, twenty). (b) HNET+TIR is the only method that is capable of learning PermutedMNIST-100 in this learning scenario. For this benchmark, the input data domains are easily separable and the task inference system achieves virtually perfect $( \sim 1 0 0 \% )$ task inference accuracy throughout, even for this long experiment. HNET $+$ TIR uses a divide-and-conquer strategy: if task inference is done right, CL3 becomes just CL1. Furthermore, once task identity is predicted, the final softmax computation only needs to consider the corresponding task outputs in isolation (here, of size 10). Curiously, for HNET+TIR, CL2 can be harder than CL3 as the single output layer (of size 10, shared by all tasks) introduces a capacity bottleneck. The related methods, on the other hand, have to consider the entire output layer (here, of size $1 0 ^ { * } 1 0 0 $ ) at once, which is known to be harder to train sequentially. This leads to overwhelming error rates on long problems such as PermutedMNIST-100. Shaded areas in (a) and (b) denote STD $( n = 5$ ).
+
+Upper bound for replay models. We obtain an upper bound for the replay-based experiments (Table 2) by sequentially training a classifier, in the same way as for $\mathrm { H N E T + R }$ and DGR, now using true input data from past tasks and a synthetic, self-generated target. This corresponds to the rehearsal thought experiment delineated in Sect. 1.
+
+Table 2: Task-averaged test accuracy $( \pm \mathrm { \ S E M }$ , $n = 2 0$ ) on the permuted $( \mathbf { \hat { P } } 1 0 ^ { \circ } )$ and split $( \ ' \mathbf { S } ^ { \prime } )$ MNIST experiments. For $\mathrm { H N E T + R }$ and $\mathrm { D G R } +$ distill (van de Ven & Tolias, 2019) the classification network is trained sequentially on data from the current task and replayed data from all previous tasks. Our $\mathrm { H N E T + R }$ comes close to saturating the corresponding replay upper bound RPL-UB.
+
+
DGR
HNET+R
RPL-UB
P10-CL1
97.51 ± 0.01
97.85 ± 0.02 97.89 ± 0.02
P10-CL2
97.35 ±0.02
97.60 ± 0.02 97.72 ± 0.01
P10-CL3
96.38 ± 0.03
97.71± 0.06 97.91 ± 0.01
S-CL1
99.61± 0.02
99.81± 0.01 99.83 ± 0.01
S-CL2
96.83 ±0.20
97.88 ± 0.05 98.96 ± 0.03
S-CL3
91.79 ± 0.32
94.97 ± 0.18 98.38 ± 0.02
+
+Quantification of forgetting in our continual learning experiments. In order to quantify forgetting of our approach, we compare test set accuracies of every single task directly after training with it’s test set accuracy after training on all tasks.
+
+Only CL1 is shown since other scenarios i.e. CL2 and CL3 depend on task inference which only is measurable after training on all tasks.
+
+Table 3: Task-averaged test accuracy $\pm$ SEM, $n = 2 0$ ) on the permutedMNIST-10 (‘P10’) and splitMNIST (‘S’) experiments during and after training.
+
+
HNET+TIR during
HNET+TIR after
HNET+R during
HNET+R after
S-CL1
99.79 ± 0.01
99.79 ± 0.01
99.82 ± 0.01
99.83 ± 0.01
P10-CL1
97.58 ± 0.02
97.57± 0.02
98.03 ±0.01
97.87 ± 0.01
+
+Table 4: Task-averaged test accuracy $\pm$ SEM, $n \ : = \ : 5$ ) on the permutedMNIST-100 (‘P100’) experiments during and after training.
+
+
HNET+TIR during
HNET+TIR after
P100-CL1
96.12 ± 0.08
96.18 ± 0.09
P100-CL2
95.97 ± 0.05
P100-CL3
=
96.00 ± 0.03
+
+Table 5: Task-averaged test accuracy $\pm$ SEM, $n = 5$ ) on split CIFAR-10/100 on CL1 on two different target network architectures.
+
+
during
after
ZenkeNet
74.75± 0.09
71.29 ± 0.32
ResNet-32
82.36±0.44
82.34 ± 0.44
+
+Robustness of $\beta _ { \mathbf { o u t p u t } }$ -choice. In Fig. A2a and Fig. A2c we provide additional experiments for our method on PermutedMNIST-100. We show that our method performs comparable for a wide range of $\beta _ { \mathrm { o u t p u t } }$ -values (including the one depicted in Fig. 3a).
+
+
+Figure A5: Additional experiments with online EWC and fine-tuning on the PermutedMNIST100 benchmark. (a) Final test set classification accuracy on the $t$ -th task after learning one hundred permutations (PermutedMNIST-100) using the online EWC algorithm (Schwarz et al., 2018) to prevent forgetting. All runs use exactly the same hyperparameter configuration except for varying values of the regularization strength $\lambda$ . Our method (hnet, in red) and the online EWC run $\lambda = 1 0 0$ , in orange) from Fig. 3a are shown for comparison. It can be seen that even when tuning the regularization strength one cannot attain similar performance as with our approach (cmp. Fig. A2a). Too strong regularization prevents the learning of new tasks whereas too weak regularization doesn’t prevent forgetting. However, a middle ground (e.g., using $\lambda = 1 0 0$ ) does not reach acceptable per-task performances. (b) Task-averaged test set accuracy after learning all tasks (labelled ‘final’, in red) and immediately after learning a task (labelled ‘during’, in purple) for a range of regularization strengths $\lambda$ when using the online EWC algorithm. Results are complementary to those shown in (a). (c) Final test set classification accuracy on the $t$ -th task after learning one hundred permutations (PermutedMNIST-100) when applying fine-tuning to the hypernetwork (labelled ‘hnet fine-tuning’, in blue) or target network (labelled ‘fine-tuning’, in green). Our method (hnet, in red) from Fig. 3a is shown for comparison. It can be seen that without protection the hypernetwork suffers much more severely from catastrophic forgetting as when training a target network only. (d) This plot is complementary to (c). See description of (b) for an explanation of the labels. Shaded areas in (a) and (c) denote STD, whereas error bars in (b) and (d) denote SEM (always across 5 random seeds).
+
+
+Figure A6: Hyperparameter search for online EWC and SI on the PermutedMNIST-100 benchmark. We conduct the same hyperparameter search as performed in van de Ven & Tolias (2018). We did not compute different random seeds for this search. (a) Hyperparameter search on the regularisation strength $c$ for the SI algorithm. Accuracies during and after the experiment are shown. (b) Hyperparameter search for parameters $\lambda$ and $\gamma$ of the online EWC algorithm. Only accuracies after the experiment are shown.
+
+Varying the regularization strength for online EWC. The performance of online EWC in Fig. 3a is closest to our method (labelled hnet, in red) compared to the other methods. Therefore, we take a closer look at this method and show that further adjustments of the regularization strength $\lambda$ do not lead to better performance. Results for a wide range of regularization strengths can be seen in Fig. A5a and Fig. A5b. As shown, online EWC cannot attain a performance comparable to our method when tuning the regularization strength only.
+
+The impact of catastrophic forgetting on the hypernetwork and target network. We have successfully shown that by shifting the continual learning problem from the target network to the hypernetwork we can successfully overcome forgetting due to the introduction of our regularizer in Eq. 2. We motivated this success by claiming that it is an inherently simpler task to remember a few input-output mappings in the hypernetwork (namely the weight realizations of each task) rather than the massive number of input-output mappings $\{ ( \mathbf { x } ^ { ( t , i ) } , \mathbf { y } ^ { ( t , i ) } ) \} _ { i = 1 } ^ { n _ { t } }$ associated with the remembering of each task by the target network.
+
+Further evidence of this claim is provided by fine-tuning experiments in Fig. A5c and Fig. A5d. Fine-tuning refers to sequentially learning a neural network on a set of tasks without any mechanism in place to prevent forgetting. It is shown that fine-tuning a target network (no hypernetwork in this setup) has no catastrophic influence on the performance of previous tasks. Instead there is a graceful decline in performance. On the contrary, catastrophic forgetting has an almost immediate affect when training a hypernetwork without protection (i.e., training our method with $\beta _ { \mathrm { o u t p u t } } = 0$ . The performance quickly drops to chance level, suggesting that if we weren’t solving a simpler task then preventing forgetting in the hypernetwork rather than in the target network might not be beneficial.
+
+Chunking and hypernetwork architecture sensitivity. In this note we investigate the performance sensitivity for different (fully-connected) hypernetwork architectures on split MNIST and PermutedMNIST-10, Fig. A7. We trained thousands of randomly drawn architectures from the following grid (the same training hyperparameters as reported for for CL1, see Appendix C, were used throughout): possible number of hidden layers 1, 2, possible layer size $5 , 1 0 , 2 0 , \ldots , 9 0 , 1 0 0$ , possible chunk embedding size 8, 12, 24, 56, 96 and hypernetwork output size in $\{ 1 0 , 5 0 , 1 0 0 , 2 0 0 , 3 0 0 , 4 0 0 , 5 0 0 , 7 5 0 , 1 k , 2 k , \ldots , 9 k , 1 0 k , 2 0 k , 3 0 k , 4 0 k \}$ . Since we realize compression through chunking, we sort our hypernetwork architectures by compression ratio, and consider only architectures with small compression ratios.
+
+Performance of split MNIST stays in the high 90 percentages even when reaching compression ratios close to $1 \%$ whereas for PermutedMNIST-10 accuracies decline in a non-linear fashion. For both experiments, the choice of the chunked hypernetwork archicture is robust and high performing even in the compressive regime. Note that the discussed compression ratio compares the amount of trainable parameters in the hypernetwork to its output size, i.e. the parameters of the target network.
+
+
+Figure A7: Robustness to hypernetwork architecture choice for a large range of compression ratios. Performance vs. compression for random hypernetwork architecture choices, for split MNIST and PermutedMNIST-10 (mean $\pm$ STD, $n = 5 0 0$ architectures per bin). Every model was trained with the same setup (including all hyperparameters) used to obtain results reported in Table 1 (CL1). We considered architectures yielding compression ratios $| \Theta _ { \mathrm { h } } \cup \{ { \bf e } ^ { ( t ) } \} | / | \Theta _ { \mathrm { t r g t } } | \in [ 0 . 0 1 , 2 . 0 ]$ (a) split MNIST performance for CL1 stays high even for compression ratios $\approx 1 \%$ . (b) PermutedMNIST-10 accuracies degrade gracefully when compression ratios decline to $1 \%$ . Notably, for both benchmarks, performance remained stable across a large pool of hypernetwork configurations.
+
+Small capacity target networks for the permuted MNIST benchmark. Swaroop et al. (2018) argue for using only small capacity target networks for this benchmark. Specifically, they propose to use hidden layer sizes [100, 100]. Again, we replicated the setup of van de Ven & Tolias (2019) wherever applicable, except for the now smaller hidden layer sizes of [100, 100] in the target network. We use a fully-connected chunked hypernetwork with chunk embeddings c having size 12, hidden layers having size 100, 75, 50 and an output size of 2000, resulting in a total number of hypernetwork weights of 122,459 (including $1 0 \times 6 4$ task embedding weights) compared to 122,700 weights that are generated for the target network. $\beta _ { \mathrm { o u t p u t } }$ is set to 0.05. The experiments performed here correspond to CL1.
+
+We achieve an average accuracy of $9 3 . 9 1 \pm 0 . 0 4$ for PermutedMNIST-10 after having trained on all tasks. In general, we saw that the hypernetwork training can benefit from noise injection. For instance, when training with soft-targets (i.e., we modified the 1-hot target to be 0.95 for the correct class and $\frac { 1 - 0 . 9 5 } { \# \mathrm { c l a s s e s } - 1 }$ for the remaining classes), we could improve the average accuracy to $9 4 . 2 4 \pm$ 0.03.
+
+We also checked the challenging PermutedMNIST-50 benchmark with this small target network as previously investigated by Ritter et al. (2018). Therefore, we slightly adapted the above setup by using a hypernetwork with hidden layer sizes [100, 100] and a regularization strength of $\beta _ { \mathrm { o u t p u t } } = 0 . 1$
+
+This hypernetwork is slightly bigger than the corresponding target network |Θh∪{e(t)}| = 1.37. With this configuration, we obtain an average accuracy of $9 0 . 9 1 \pm 0 . 0 7$ .
+
+Comparison to HAT. Serra et al. (2018) proposed the hard attention to the task (HAT) algorithm, a strong CL1 method which relies on learning a per-task, per-neuron mask. Since the masks are pushed to become binary, HAT can be viewed as an algorithm for allocating subnetworks (or modules) within the target network, which become specialized to solve a given task. Thus, the method is similar to ours in the sense that the computation of the target network is task-dependent, but different in spirit, as it relies on network modularity.
+
+In HAT, task identity is assumed to be provided, so that the appropriate mask can be picked during inference (scenario CL1). HAT requires explicitly storing a neural mask for each task, whose size scales with the number of neurons in the target network. In contrast, our method allows solving tasks in a compressive regime. Thanks to the hypernetwork, whose input dimension can be freely chosen, only a low-dimensional embedding needs to be stored per task (cf. Fig. 4), and through chunking it is possible to learn to parameterize large target models with a small number of plastic weights (cf. Fig. 3b).
+
+Here, we compare our task-conditioned hypernetworks to HAT on the permuted MNIST benchmarks $( T = 1 0$ and $T = 1 0 0$ ), cf. Table 6. For large target networks, both methods perform strongly, reaching comparable final task-averaged accuracies. For small target network sizes, task-conditioned hypernetworks perform better, the difference becoming more apparent on PermutedMNIST-100.
+
+We note that the two algorithms use different training setups. In particular, HAT uses 200 epochs (batch size set to 64) and applies a learning rate scheduler that acts on a held out validation set. Furthermore, HAT uses differently tuned forgetting hyperparameters when target network sizes change. This is important to control for the target network capacity used per task and assumes knowledge of the (number of) tasks at hand. Using the code freely made available by the authors, we were able to rerun HAT for our target network size and longer task sequences. Here, we used the setup provided by the author’s code for HAT-Large for PermutedMNIST-10 and PermutedMNIST-100. To draw a fairer comparison, when changing our usual target network size to match the ones reported in Serra et al. (2018), we trained for 50 epochs per task (no training loss improvements afterwards observed) and also changed the batch size to 64 but did not changed our training scheme otherwise; in particular, we did not use a learning rate scheduler.
+
+Table 6: Comparison of HNET and HAT, Serra et al. (2018). Task-averaged test accuracy on the PermutedMNIST experiment with $T = 1 0$ and $T = 1 0 0$ tasks (’P10’, ’P100’) with three different target network sizes, i.e., three fully connected neural networks with hidden layer sizes of (100, 100) or (500, 500) or (2000, 2000) are shown. For these architectures, a single accuracy was reported by Serra et al. (2018) without statistics provided. We reran HAT for PermutedMNIST-100 with code provided at https://github.com/joansj/hat, and for PermutedMNIST-10 with hidden layer size (1000, 1000) to match our setup. HAT and HNET perform similarly on large target networks for PermutedMNIST-10, while HNET is able to achieve larger performances with smaller target networks as well as for long task sequences.
+
+
HAT
HNET
P10-100,100 91.6
95.92 ± 0.02
P10-500,500 97.4
97.35 ± 0.02
P10-2000,2000 98.6
98.06±0.02
P10-1000,1000
97.67 ± 0.02 97.56± 0.02
P100-1000,1000
86.04±0.26 94.98 ± 0.07
+
+Efficient PermutedMNIST-250 experiments with a stochastic regularizer on subsets of previous tasks. An apparent drawback of Eq. 2 is that the runtime complexity of the regularizer grows linearly with the number of tasks. To overcome this obstacle, we show here that it is sufficient to consider a small random subset of previous tasks.
+
+In particular, we consider the PermutedMNIST-250 benchmark (250 tasks) on CL1 using the hyperparameter setup from our PermutedMNIST-100 experiments except for a hypernetwork output size of 12000 (to adjust to the bigger multi-head target network) and a regularization strength $\beta _ { \mathrm { o u t p u t } } = 0 . 1$ Per training iteration, we choose maximally 32 random previous tasks to estimate the regularizer from Eq. 2. With this setup, we achieve a final average accuracy of $9 4 . 1 9 \pm 0 . 1 6$ (compared to an average during accuracy (i.e., the accuracies achieved right after training on the corresponding task) of $9 5 . 5 4 \pm 0 . 0 5 )$ ). All results are across 5 random seeds. These results indicate that a full evaluation of the regularizer at every training iteration is not necessary such that the linear runtime complexity can be cropped to a constant one.
+
+Combining hypernetwork output regularizers with weight importance. Our hypernetwork regularizer pulls uniformly in every direction, but it is possible to introduce anisotropy using an EWC-like approach (Kirkpatrick et al., 2017). Instead of weighting parameters, hypernetwork outputs can be weighted. This would allow for a more flexible regularizer, at the expense of additional storage.
+
+Task inference through predictive entropy $( \mathbf { H } \mathbf { N } \mathbf { E } \mathbf { T } { + } \mathbf { E } \mathbf { N } \mathbf { T } )$ ). In this setup, we rely on the capability of neural networks to separate in- from out-of-distribution data. Although this is a difficult research problem on its own, for continual learning, we face a potentially simpler problem, namely to detect and distinguish between the tasks our network was trained on. We here take the first minimal step exploiting this insight and compare the predictive uncertainty, as quantified by output distribution entropy, of the different models given an input. Hence, during test time we iterate over all embeddings and therefore the models our metamodel can generate and compare the predictive entropies which results in making a prediction with the model of lowest entropy. For future work, we wish to explore the possibility of improving our predictive uncertainty by taking parameter uncertainty into account through the generation of approximate, task-specific weight posterior distributions.
+
+Learning without task boundaries with hypernetworks. An interesting problem we did not address in this paper is that of learning without task boundaries. For most CL methods, it is crucial to know when learning one task ends and training of a new tasks begins. This is no exception for the methods introduced in this paper. However, this is not necessarily a realistic or desirable assumption; often, one desires to learn in an online fashion without task boundary supervision, which is particularly relevant for reinforcement learning scenarios where incoming data distributions are frequently subject to change (Rolnick et al., 2018). At least for discrete changes, with our hypernetwork setup, this boils down to a detection mechanism that activates the saving of the current model, i.e., the embedding $\mathbf { e } ^ { ( T ) }$ , and its storage to the collection of embeddings $\{ { \bf e } ^ { ( t ) } \}$ . We leave the integration of our model with such a hypernetwork-specific switching detection mechanism for future work. Interestingly, our task-conditioned hypernetworks would fit very well with methods that rely on fast remembering (a recently proposed approach which appeared in parallel to our paper, He et al., 2019).
+
+# E UNIVERSAL FUNCTION APPROXIMATION WITH CHUNKED NEURAL NETWORKS
+
+Proposition 1. Given a compact subset $K \subset \mathbb { R } ^ { m }$ and a continuous function on $K$ i.e. $f \in C ( K )$ , more specifically, $f : K \mathbb { R } ^ { n }$ with $n = r \cdot N _ { C }$ . Now $\forall \epsilon > 0 .$ , there exists a chunked neural network $f _ { \mathrm { h } } ^ { \mathbf { c } } : \mathbb { R } ^ { m } \times \mathcal { C } \mathbb { R } ^ { r }$ with parameters $\Theta _ { \mathrm { h } }$ , discrete set $\mathcal { C } = \{ \mathbf { c } _ { 1 } , \ldots , \mathbf { c } _ { N _ { C } } \}$ and $\mathbf { c } _ { i } \in \mathbb { R } ^ { s }$ such that $| \bar { f } _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } ) - f ( \mathbf { x } ) | < \epsilon , \quad \forall \mathbf { x } \in K$ and with $\bar { f } _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } ) = [ f _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } , \mathbf { c } _ { 1 } ) , \dots , f _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } , \mathbf { c } _ { N _ { c } } ) ]$ .
+
+For the following proof, we assume the existence of one form of the universal approximation theorem (UAT) for neural networks (Leshno & Schocken, 1993; Hanin, 2017). Note that we will not restrict ourselves to a specific architecture, nonlinearity, input or output dimension. Any neural network that is proven to be a universal function approximator is sufficient.
+
+Proof. Given any $\epsilon > 0$ , we assume the existence of a neural network $f _ { \mathrm { h } } : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ that approximates function $f$ on $K$ :
+
+$$
+| f _ { \mathrm { h } } ( \mathbf { x } ) - f ( \mathbf { x } ) | < \frac { \epsilon } { 2 } , \quad \forall x \in K .
+$$
+
+We will in the following show that we can always find a chunked neural network $f _ { \mathrm { h } } ^ { \mathbf { c } } : \mathbb { R } ^ { m } \times \mathcal { C } \mathbb { R } ^ { r }$ approximating the neural network $f _ { \mathrm { h } }$ on $K$ and conclude with the triangle inequality
+
+$$
+\left. \bar { f } _ { \mathrm { h } } ^ { \mathrm { c } } ( \mathbf { x } ) - f ( \mathbf { x } ) \right. \leq \left. \bar { f } _ { \mathrm { h } } ^ { \mathrm { c } } ( \mathbf { x } ) - f _ { \mathrm { h } } ( \mathbf { x } ) \right. + \left. f _ { \mathrm { h } } ( \mathbf { x } ) - f ( \mathbf { x } ) \right. < \epsilon , \quad \forall x \in K .
+$$
+
+Indeed, given the neural network $f _ { \mathrm { h } }$ such that (10) holds true, we construct
+
+$$
+{ \hat { f } } _ { \mathrm { h } } ( \mathbf { x } , \mathbf { c } ) = { \left\{ \begin{array} { l l } { f _ { \mathrm { h } } ^ { \mathbf { c } _ { i } } ( \mathbf { x } ) } & { \mathbf { c } = \mathbf { c } _ { i } } \\ { 0 } & { { \mathrm { e l s e } } } \end{array} \right. }
+$$
+
+by splitting the full neural network $f _ { \mathrm { h } } ( \mathbf { x } ) = [ f _ { \mathrm { h } } ^ { \mathbf { c } _ { 1 } } ( \mathbf { x } ) , f _ { \mathrm { h } } ^ { \mathbf { c } _ { 2 } } ( \mathbf { x } ) , \hdots , f _ { \mathrm { h } } ^ { \mathbf { c } _ { N _ { \mathrm { C } } } } ( \mathbf { x } ) ]$ with $\hat { f } _ { \mathrm { h } } : \mathbb { R } ^ { m } \times \mathcal { C } \mathbb { R } ^ { r }$
+
+Note that $\hat { f } _ { \mathrm { h } }$ is continuous on $\mathbb { R } ^ { m } \times \mathcal { C }$ with the product topology composed of the topology on $\mathbb { R } ^ { m }$ induced by the metric $| \cdot - \cdot | : \mathbb { R } ^ { m } \times \mathbb { R } ^ { m } \to \mathbb { R }$ and the discrete topology on $\mathcal { C }$ . Now we can make use
+
+of the UAT again: Given the compact $K \subset \mathbb { R } ^ { n }$ , the discrete set $\mathcal { C } = \{ \mathbf { c } _ { 1 } , \ldots , \mathbf { c } _ { N _ { \mathrm { C } } } \}$ and any $\frac { \epsilon } { 2 N _ { \mathrm { C } } } > 0$ , there exists a neural network function $f _ { \mathrm { h } } ^ { \mathbf { c } } : \mathbb { R } ^ { m } \times \mathbb { R } ^ { s } \mathbb { R } ^ { r }$ such that
+
+$$
+| f _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } , \mathbf { c } ) - \hat { f } _ { \mathrm { h } } ( \mathbf { x } , \mathbf { c } ) | < \frac { \epsilon } { 2 N _ { \mathrm { C } } } , \quad \forall \mathbf { x } \in K , \forall \mathbf { c } \in \mathcal { C } .
+$$
+
+It follows that
+
+$$
+\sum _ { i } | f _ { \mathrm { h } } ^ { \mathbf { c } } ( \mathbf { x } , \mathbf { c } _ { i } ) - \hat { f } _ { \mathrm { h } } ( \mathbf { x } , \mathbf { c } _ { i } ) | < \sum _ { i } \frac { \epsilon } { 2 N _ { \mathrm { C } } } = \frac { \epsilon } { 2 } , \quad \forall \mathbf { x } \in K ,
+$$
+
+which is equivalent to
+
+$$
+| \left[ \begin{array} { c } { f _ { \mathrm { h } } ^ { \mathrm { c } } ( \mathbf { x } , \mathbf { c _ { 1 } } ) } \\ { \vdots } \\ { f _ { \mathrm { h } } ^ { c } ( \mathbf { x } , \mathbf { c _ { N _ { \mathrm { c } } } } ) } \end{array} \right] - \left[ \begin{array} { c } { \hat { f } _ { \mathrm { h } } ( \mathbf { x } , \mathbf { c _ { 1 } } ) } \\ { \vdots } \\ { \hat { f } _ { \mathrm { h } } ( \mathbf { x } , \mathbf { c _ { N _ { \mathrm { c } } } } ) } \end{array} \right] | = | \bar { f } _ { \mathrm { h } } ^ { \mathrm { c } } ( \mathbf { x } ) - f _ { \mathrm { h } } ( \mathbf { x } ) | < \frac { \epsilon } { 2 } , \quad \forall \mathbf { x } \in K .
+$$
+
+We have shown (11) which concludes the proof.
+
+Note that we did not specify the number of chunks $N _ { \mathrm { C } }$ , $r$ or the dimension $s$ of the embeddings $\mathbf { c } _ { i }$ Despite this theoretical result, we emphasize that we are not aware of a constructive procedure to define a chunked hypernetwork that comes with a useful bound on the achievable performance and/or compression rate. We evaluate such aspects empirically in our experimental section.
+
+
a
b
0
。
0
。
。
0
。
。 0
0
0
0
0
0 0
0
0
0
0
0
0
0
0 0
0
0
0
。
0
0
。
0
0
0
。
0
0
0。
。 。
0
。
0 。
。
0 0
。
0 0
0
0
0
,
1
1
!
1
1
!
1
1
1
/
!
1
1
1
1
1
!
!
!
、 !
1
/
1
/
1
/
1
1
1
1
!
1
! !
1
1
1
/
2
包
2
2
A
2
2
4 ?
2 2
2
2 2
2
2
2
2
a
2
2
a
L
2
8
22
222
2
2 2
2
2
2
&
2
2
多
2
2
22
2
2
2
2 2
2
2
2
2
3
3
3
3
3
3
33
33
3
3 3
3
3
3
3
L
3
3
L
3
3 L
3
3 3
3
3
3 3
333
3
3
3
3
3
E
3
3
33
33
3
3 3
”
3
3
4
4
8
49
5
5
s
5 s
5
5
44
4
4
4
555
s
5 ”
s
4
4
4
5
5 5
5 5
5
5
S
5
5
5
ss
5
5sg
444
4
4 4
4
4
5
55
85
595
444
4
44
4
4
4
6
55
8
55
444
4 4
4
4
4
6
06
66
6
66
6
6
6 6
6
6
6
66
6
666
6
6 6
6
6
6
6
6
66
6
66
666
6 6
6
6
6
6
7
号
7
程
7 7
7
7
7
7
3 2
2 7
7
7 心
7
7 2
3 9
9 2
771 777
7 7
7
7
\ No newline at end of file
diff --git a/md/train/SJl2niR9KQ/SJl2niR9KQ.md b/md/train/SJl2niR9KQ/SJl2niR9KQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..5c335eca199c8292455592ba5a9f6951d2febbb5
--- /dev/null
+++ b/md/train/SJl2niR9KQ/SJl2niR9KQ.md
@@ -0,0 +1,629 @@
+# BEYOND PIXEL NORM-BALLS: PARAMETRIC ADVERSARIES USING AN ANALYTICALLY DIFFERENTIABLE RENDERER
+
+Hsueh-Ti Derek Liu University of Toronto hsuehtil@cs.toronto.edu
+
+Michael Tao University of Toronto mtao@dgp.toronto.edu
+
+Chun-Liang Li Carnegie Mellon University chunlial@cs.cmu.edu
+
+Derek Nowrouzezahrai McGill University derek@cim.mcgill.ca
+
+Alec Jacobson University of Toronto jacobson@cs.toronto.edu
+
+# ABSTRACT
+
+Many machine learning image classifiers are vulnerable to adversarial attacks, inputs with perturbations designed to intentionally trigger misclassification. Current adversarial methods directly alter pixel colors and evaluate against pixel norm-balls: pixel perturbations smaller than a specified magnitude, according to a measurement norm. This evaluation, however, has limited practical utility since perturbations in the pixel space do not correspond to underlying real-world phenomena of image formation that lead to them and has no security motivation attached. Pixels in natural images are measurements of light that has interacted with the geometry of a physical scene. As such, we propose a novel evaluation measure, parametric normballs, by directly perturbing physical parameters that underly image formation. One enabling contribution we present is a physically-based differentiable renderer that allows us to propagate pixel gradients to the parametric space of lighting and geometry. Our approach enables physically-based adversarial attacks, and our differentiable renderer leverages models from the interactive rendering literature to balance the performance and accuracy trade-offs necessary for a memory-efficient and scalable adversarial data augmentation workflow.
+
+# 1 INTRODUCTION
+
+Research in adversarial examples continues to contribute to the development of robust (semi-)supervised learning (Miyato et al., 2018), data augmentation (Goodfellow et al., 2015; Sun et al., 2018), and machine learning understanding (Kanbak et al., 2018). One important caveat of the approach pursued by much of the literature in adversarial machine learning, as discussed recently (Goodfellow,
+
+
+Figure 1: Traditional pixel-based adversarial attacks yield unrealistic images under a larger perturbation $( L ^ { \infty } \mathrm { - n o r m \approx 0 . 8 2 } )$ , however our parametric lighting and geometry perturbations output more realistic images under the same norm (more results in Appendix A).
+
+
+Figure 2: Parametrically-perturbed images remain natural, whereas pixel-perturbed ones do not.
+
+2018; Gilmer et al., 2018), is the reliance on overly simplified attack metrics: namely, the use of pixel value differences between an adversary and an input image, also referred to as the pixel norm-balls.
+
+The pixel norm-balls game considers pixel perturbations of norm-constrained magnitude (Goodfellow et al., 2015), and is used to develop adversarial attackers, defenders and training strategies. The pixel norm-ball game is attractive from a research perspective due to its simplicity and well-posedness: no knowledge of image formation is required and any arbitrary pixel perturbation remains eligible (so long as it is “small”, in the perceptual sense). Although the pixel norm-ball is useful for research purposes, it only captures limited real-world security scenarios.
+
+Despite the ability to devise effective adversarial methods through the direct employment of optimizations using the pixel norm-balls measure, the pixel manipulations they promote are divorced from the types of variations present in the real world, limiting their usefulness “in the wild”. Moreover, this methodology leads to defenders that are only effective when defending against unrealistic images/attacks, not generalizing outside of the space constrained by pixel norm-balls. In order to consider conditions that enable adversarial attacks in the real world, we advocate for a new measurement norm that is rooted in the physical processes that underly realistic image synthesis, moving away from overly simplified metrics, e.g., pixel norm-balls.
+
+Our proposed solution – parametric norm-balls – rely on perturbations of physical parameters of a synthetic image formation model, instead of pixel color perturbations (Figure 2). To achieve this, we use a physically-based differentiable renderer which allows us to perturb the underlying parameters of the image formation process. Since these parameters indirectly control pixel colors, perturbations in this parametric space implicitly span the space of natural images. We will demonstrate two advantages that fall from considering perturbations in this parametric space: (1) they enable adversarial approaches that more readily apply to real-world applications, and (2) they permit the use of much more significant perturbations (compared to pixel norms), without invalidating the realism of the resulting image (Figure 1). We validate that parametric norm-balls game playing is critical for a variety of important adversarial tasks, such as building defenders robust to perturbations that can occur naturally in the real world.
+
+We perform perturbations in the underlying image formation parameter space using a novel physicallybased differentiable renderer. Our renderer analytically computes the derivatives of pixel color with respect to these physical parameters, allowing us to extend traditional pixel norm-balls to physicallyvalid parametric norm-balls. Notably, we demonstrate perturbations on an environment’s lighting and on the shape of the 3D geometry it shades. Our differentiable renderer achieves state-of-the-art performance in speed and scalability (Section 3) and is fast enough for rendered adversarial data augmentation (Section 5): training augmented with adversarial images generated with a renderer.
+
+Existing differentiable renders are slow and do not scalable to the volume of high-quality, highresolutions images needed to make adversarial data augmentation tractable (Section 2). Given our analytically-differentiable renderer (Section 3), we are able to demonstrate the efficacy of parametric space perturbations for generating adversarial examples. These adversaries are based on a substantially different phenomenology than their pixel norm-balls counterparts (Section 4). Ours is among the first steps towards the deployment of rendered adversarial data augmentation in real-world applications: we train a classifier with computer-generated adversarial images, evaluating the performance of the training against real photographs (i.e., captured using cameras; Section 5). We test on real photos to show the parametric adversarial data augmentation increases the classifier’s robustness to “deformations” happened in the real world. Our evaluation differs from the majority of existing literature which evaluates against computer-generated adversarial images, since our parametric space perturbation is no-longer a wholly idealized representation of the image formation model but, instead, modeled against of theory of realistic image generation.
+
+# 2 RELATED WORK
+
+Our work is built upon the fact that simulated or rendered images can participate in computer vision and machine learning on real-world tasks. Many previous works use rendered (simulated) data to train deep networks, and those networks can be deployed to real-world or even outperform the state-of-the-art networks trained on real photos (Movshovitz-Attias et al., 2016; Chen et al., 2016; Varol et al., 2017; Su et al., 2015; Johnson-Roberson et al., 2017; Veeravasarapu et al., 2017b; Sadeghi & Levine, 2016; James & Johns, 2016). For instance, Veeravasarapu et al. (2017a) show that training with $1 0 \%$ real-world data and $9 0 \%$ simulation data can reach the level of training with full real data. Tremblay et al. (2018) even demonstrate that the network trained on synthetic data yields a better performance than using real data alone. As rendering can cheaply provide a theoretically infinite supply of annotated input data, it can generate data which is orders of magnitude larger than existing datasets. This emerging trend of training on synthetic data provides an exciting direction for future machine learning development. Our work complements these works. We demonstrate the utility of rendering can be used to study the potential danger lurking in misclassification due to subtle changes to geometry and lighting. This provides a future direction of combining with synthetic data generation pipelines to perform physically based adversarial training on synthetic data.
+
+Adversarial Examples Szegedy et al. (2014) expose the vulnerability of modern deep neural nets using purposefully-manipulated images with human-imperceptible misclassification-inducing noise. Goodfellow et al. (2015) introduce a fast method to harness adversarial examples, leading to the idea of pixel norm-balls for evaluating adversarial attackers/defenders. Since then, many significant developments in adversarial techniques have been proposed (Akhtar & Mian, 2018; Szegedy et al., 2014; Rozsa et al., 2016; Kurakin et al., 2017; Moosavi Dezfooli et al., 2016; Dong et al., 2018; Papernot et al., 2017; Moosavi-Dezfooli et al., 2017; Chen et al., 2017; Su et al., 2017). Our work extends this progression in constructing adversarial examples, a problem that lies at the foundation of adversarial machine learning. Kurakin et al. (2016) study the transferability of attacks to the physical world by printing then photographing adversarial images. Athalye et al. (2017) and Eykholt et al. (2018) propose extensions to non-planar (yet, still fixed) geometry and multiple viewing angles. These works still rely fundamentally on the direct pixel or texture manipulation on physical objects. Since these methods assume independence between pixels in the image or texture space they remain variants of pixel norm-balls. This leads to unrealistic attack images that cannot model real-world scenarios (Goodfellow, 2018; Hendrycks & Dietterich, 2018; Gilmer et al., 2018). Zeng et al. (2017) generate adversarial examples by altering physical parameters using a rendering network (Liu et al., 2017) trained to approximate the physics of realistic image formation. This data-driven approach leads to an image formation model biased towards the rendering style present in the training data. This method also relies on differentiation through the rendering network in order to compute adversaries, which requires high-quality training on a large amount of data. Even with perfect training, in their reported performance, it still requires 12 minutes on average to find new adversaries, we only take a few seconds Section 4.1. Our approach is based on a differentiable physically-based renderer that directly (and, so, more convincingly) models the image formation process, allowing us to alter physical parameters – like geometry and lighting – and compute
+
+derivatives (and adversarial examples) much more rapidly compared to the (Zeng et al., 2017). We summarize the difference between our approach and the previous non-image adversarial attacks in Table 1.
+
+Table 1: Previous non-pixel attacks fall short in either the parameter range they can take derivatives or the performance.
+
+
Methods
Perf.
Color
Normal
Material
Light
Geo.
Athalye 17
√
√
Zeng 17
√
√
Ours
√
√
√
√
+
+Differentiable Renderer Applying parametric norm-balls requires that we differentiate the image formation model with respect to the physical parameters of the image formation model. Modern realistic computer graphics models do not expose facilities to directly accommodate the computation of derivatives or automatic differentiation of pixel colors with respect to geometry and lighting variables. A physically-based
+
+Table 2: Previous differentiable renderers fall short in one way or another among Performance, Bias, or Accuracy.
+
+
Methods
Perf.
Unbias
Accu.
NN proxy (Liu 17)
Approx. (Kato 18)
?
√
Autodiff (Loper 14)
<
Analytical (Ours)
√
<
+
+differentiable renderer is fundamental to computing derivative of pixel colors with respect to scene parameters and can benefit machine learning in several ways, including promoting the development of novel network architectures (Liu et al., 2017), in computing adversarial examples (Athalye et al., 2017; Zeng et al., 2017), and in generalizing neural style transfer to a 3D context (Kato et al., 2018; Liu et al., 2018). Recently, various techniques have been proposed to obtain these derivatives: Wu et al. (2017); Liu et al. (2017); Eslami et al. (2016) use neural networks to learn the image formation process provided a large amount of input/output pairs. This introduces unnecessary bias in favor of the training data distribution, leading to inaccurate derivatives due to imperfect learning. Kato et al. (2018) propose a differentiable renderer based on a simplified image formation model and an underlying linear approximation. Their approach requires no training and is unbiased, but their approximation of the image formation and the derivatives introduce more errors. Loper & Black (2014); Genova et al. (2018) use automatic differentiation to build fully differentiable renderers. These renderers, however, are expensive to evaluate, requiring orders of magnitude more computation and much larger memory footprints compared to our method.
+
+Our novel differentiable renderer overcomes these limitations by efficiently computing analytical derivatives of a physically-based image formation model. The key idea is that the non-differentiable visibility change can be ignored when considering infinitesimal perturbations. We model image variations by changing geometry and realistic lighting conditions in an analytically differentiable manner, relying on an accurate model of diffuse image formation that extend spherical harmonicsbased shading methods (Appendix C). Our analytic derivatives are efficient to evaluate, have scalable memory consumption, are unbiased, and are accurate by construction (Table 2). Our renderer explicitly models the physics of the image formation processes, and so the images it generates are realistic enough to illicit correct classifications from networks trained on real-world photographs.
+
+# 3 ADVERSARIAL ATTACKS IN PARAMETRIC SPACES
+
+Adversarial attacks based on pixel norm-balls typically generate adversarial examples by defining a cost function over the space of images $\mathcal { C } : I \mathbb { R }$ that enforces some intuition of what failure should look like, typically using variants of gradient descent where the gradient $\partial { \mathcal { C } } / \partial I$ is accessible by differentiating through networks (Szegedy et al., 2014; Goodfellow et al., 2015; Rozsa et al., 2016; Kurakin et al., 2017; Moosavi Dezfooli et al., 2016; Dong et al., 2018).
+
+The choices for $\mathcal { C }$ include increasing the cross-entropy loss of the correct class (Goodfellow et al., 2015), decreasing the cross-entropy loss of the least-likely class (Kurakin et al., 2017), using a combination of cross-entropies (Moosavi Dezfooli et al., 2016), and more (Szegedy et al., 2014; Rozsa et al., 2016; Dong et al., 2018; Tramèr et al., 2017). We combine of cross-entropies to provide flexibility for choosing untargeted and targeted attacks by specifying a different set of labels:
+
+$$
+\mathcal { C } \big ( I ( U , V ) \big ) = - \mathrm { C r o s s E n t r o p y } \big ( f ( I ( U , V ) ) , L _ { d } \big ) + \mathrm { C r o s s E n t r o p y } \big ( f ( I ( U , V ) ) , L _ { i } \big ) ,
+$$
+
+where $I$ is the image, $f ( I )$ is the output of the classifier, $L _ { d } , L _ { i }$ are labels which a user wants to decrease and increase the predicted confidences respectively. In our experiments, $L _ { d }$ is the correct class and $L _ { i }$ is either ignored or chosen according to user preference. Our adversarial attacks in the parametric space consider an image $I ( U , V )$ is the function of physical parameters of the image formation model, including the lighting $U$ and the geometry $V$ . Adversarial examples constructed by perturbing physical parameters can then be computed via the chain rule
+
+$$
+\frac { \partial \mathcal { C } } { \partial U } = \frac { \partial \mathcal { C } } { \partial I } \frac { \partial I } { \partial U } \qquad \frac { \partial \mathcal { C } } { \partial V } = \frac { \partial \mathcal { C } } { \partial I } \frac { \partial U } { \partial V } ,
+$$
+
+where $\partial I / \partial U , \partial I / \partial V$ are derivatives with respect to the physical parameters and we evaluate using our physically based differentiable renderer. In our experiments, we use gradient descent for finding parametric adversarial examples where the gradient is the direction of ${ \partial \bar { I } } / { \partial U } , { \partial I } / { \partial V }$ .
+
+# 3.1 PHYSICALLY BASED DIFFERENTIABLE RENDERER
+
+Rendering is the process of generating a 2D image from a 3D scene by simulating the physics of light. Light sources in the scene emit photons that then interact with objects in the scene. At each interaction, photons are either reflected, transmitted or absorbed, changing trajectory and repeating until arriving at a sensor such as a camera. A physically based renderer models the interactions mathematically (Pharr et al., 2016), and our task is to analytically differentiate the physical process.
+
+Top 5:
+miniskirt $2 8 \%$ t-shirt $21 \%$
+boot $6 \%$
+crutch $5 \%$
+sweatshirt $5 \%$
+
+
+Figure 4: By changing the lighting, we fool the classifier into seeing miniskirt and water tower, demonstrating the existence of adversarial lighting.
+
+
+street sign $5 7 \%$
+Top 5: water tower $4 8 \%$ street sign $1 8 \%$ mailbox $9 \%$ gas pump $3 \%$ barn $3 \%$
+
+
+Figure 5: We construct a single lighting condition that can simultaneously fool the classifier viewing from different angles.
+
+We develop our differentiable renderer with common assumptions in real-time rendering (AkenineMoller et al., 2008) – diffuse material, local illumination, and distant light sources. Our diffuse material assumption considers materials which reflect lights uniformly for all directions, equivalent to considering non-specular objects. We assume that variations in the material (texture) are piece-wise constant with respect to our triangle mesh discretization. The local illumination assumption only considers lights that bounce directly from the light source to the camera. Lastly, we assume light sources are far away from the scene, allowing us to represent lighting with one spherical function. For a more detailed rationale of our assumptions, we refer readers to Appendix B).
+
+These assumptions simplify the complicated integral required for rendering (Kajiya, 1986) and allow us to represent lighting in terms of spherical harmonics, an orthonormal basis for spherical functions analogous to Fourier transformation. Thus, we can analytically differentiate the rendering equation to acquire derivatives with respect to lighting, geometry, and texture (derivations found in Appendix C).
+
+Using analytical derivatives avoids pitfalls of previous differentiable renderers (see Section 2) and make our differentiable renderer orders of magnitude faster than the previous fully differentiable renderer OPENDR (Loper & Black, 2014) (see Figure 3). Our approach is scalable to handle problems with more than
+
+
+Figure 3: Our differentiable renderer based on analytical derivatives is faster and more scalable than the previous method.
+
+100,000 variables, while OPENDR runs out of memory for problems with more than 3,500 variables.
+
+# 3.2 ADVERSARIAL LIGHTING AND GEOMETRY
+
+Adversarial lighting denotes adversarial examples generated by changing the spherical harmonics lighting coefficients $U$ (Green, 2003). As our differentiable renderer allows us to compute $\partial I / \partial U$ analytically (derivation is provided in Appendix C.4), we can simply apply the chain rule:
+
+$$
+U U - \gamma \frac { \partial \mathcal { C } } { \partial I } \frac { \partial I } { \partial U } ,
+$$
+
+where $\partial { \mathcal { C } } / \partial I$ is the derivative of the cost function with respect to pixel colors and can be obtained by differentiating through the network. Spherical harmonics act as an implicit constraint to prevent unrealistic lighting because natural lighting environments everyday life are dominated by lowfrequency signals. For instance, rendering of diffuse materials can be approximated with only $1 \%$ pixel intensity error by the first 2 orders of spherical harmonics (Ramamoorthi & Hanrahan, 2001). As computers can only represent a finite number of coefficients, using spherical harmonics for lighting implicitly filters out high-frequency, unrealistic lightings. Thus, perturbing the parametric space of spherical harmonics lighting gives us more realistic compared to image-pixel perturbations Figure 1.
+
+
+Figure 6: By specifying different target labels, we can create an optical illusion: a jaguar is classified as cat and dog from two different views after geometry perturbations.
+
+Adversarial geometry is an adversarial example computed by changes the position of the shape’s surface. The shape is encoded as a triangle mesh with $| V |$ vertices and $| F |$ faces, surface points are vertex positions $V \in \mathbb { R } ^ { | V | \times 3 }$ which determine per-face normals $N \in \mathbb { R } ^ { | F | \times 3 }$ which in turn determine the shading of the surface. We can compute adversarial shapes by applying the chain rule:
+
+$$
+V V - \gamma \frac { \partial \mathcal { C } } { \partial I } \frac { \partial I } { \partial N } \frac { \partial N } { \partial V } ,
+$$
+
+where $\partial I / \partial N$ is computed via a derivation in Appendix E. Each triangle only has one normal on its face, making $\partial N / \partial V$ computable analytically. In particular, the $3 \times 3$ Jacobian of a unit face normal vector $\mathbf { n } _ { i } \in \mathbb { R } ^ { 3 }$ of the $j \mathrm { t h }$ face of the triangle mesh $V$ with respect to one of its corner vertices $\mathbf { v } _ { j } \in \mathbb { R } ^ { 3 }$ is
+
+
+
+$$
+\frac { \partial { \mathbf n } _ { i } } { \partial { \mathbf v } _ { j } } = \frac { \mathbf h _ { i j } \mathbf n _ { i } ^ { \top } } { \| \mathbf h _ { i j } \| ^ { 2 } } ,
+$$
+
+where $\mathbf { h } _ { i j } \in \mathbb { R } ^ { 3 }$ is the height vector: the shortest vector to the corner $\mathbf { v } _ { j }$ from the opposite edge.
+
+# 4 RESULTS AND EVALUATION
+
+We have described how to compute adversarial examples by parametric perturbations, including lighting and geometry. In this section, we show that adversarial examples exist in the parametric spaces, then we analyze the characteristics of those adversaries and parametric norm-balls.
+
+We use $4 9 \times 3$ spherical harmonics coefficients to represent environment lighting, with an initial realworld lighting condition (Ramamoorthi & Hanrahan, 2001). Camera parameters and the background images are empirically chosen to have correct initial classifications and avoid synonym sets. In Figure 4 we show that single-view adversarial lighting attack can fool the classifier (pre-trained ResNet-101 on ImageNet (He et al., 2016)). Figure 5 shows multi-view adversarial lighting, which optimizes the summation of the cost functions for each view, thus the gradient is computed as the summation over all camera views:
+
+$$
+U U - \sum _ { i \in \mathrm { c a m e r a s } } \gamma \frac { \partial \mathcal { C } } { \partial I _ { i } } \frac { \partial I _ { i } } { \partial U } .
+$$
+
+If one is interested in a more specific subspace, such as outdoor lighting conditions governed by sunlight and weather, our adversarial lighting can adapt to it. In Figure 7, we compute adversarial lights over the space of skylights by applying one more chain rule to the Preetham skylight parameters (Preetham et al., 1999; Habel et al., 2008). Details about taking these derivatives are provided in Appendix D. Although adversarial skylight exists, its low degrees of freedom (only three parameters) makes it more difficult to find adversaries.
+
+
+Figure 7: Even if we further constrain to a lighting subspace, skylight, we can still find adversaries.
+
+In Figure 8 and Figure 9 we show the existence of adversarial geometry in both single-view and multi-view cases. Note that we upsample meshes to have ${ \displaystyle > 1 0 \mathrm { K } }$ vertices as a preprocessing step to increase the degrees of freedom available for perturbations. Multiview adversarial geometry enables us to perturb the same 3D shape from different viewing directions, which enables us to construct a deep optical illusion: The same 3D shape are classified differently from different angles. To create the optical illusion in Figure 6, we only need to specify the $L _ { i }$ in Equation (1) to be a dog and a cat for two different views.
+
+
+Top 3: assault rifleloggerhead $8 7 \%$ , military turtle $67 \%$ uniform $6 \%$ , six-gun $1 \%$
+
+
+
+Top 3: slug $91 \%$ , roundworm $3 \%$ , banana $1 \%$
+
+
+Figure 8: Perturbing points on 3D shapes fools the classifier into seeing rifle/slug.
+Figure 9: We construct a single adversarial geometry that fools the classifier seeing a mailbox from different angles.
+
+# 4.1 PROPERTIES OF PARAMETRIC NORM-BALLS AND ADVERSARIES
+
+To further understand parametric adversaries, we analyze how do parametric adversarial examples generalize to black-box models. In Table 3, we test 5,000 ResNet parametric adversaries on unseen networks including AlexNet (Krizhevsky et al., 2012), DenseNet (Huang et al., 2017), SqueezeNet (Iandola et al., 2016), and VGG (Simonyan & Zisserman, 2014). Our result shows that parametric adversarial examples also share across models.
+
+In addition to different models, we evaluate parametric adversaries on black-box viewing directions. This evaluation mimics the real-world scenario that a self-driving car would “see” a stop sign from different angles while driving. In Table 4, we randomly sample 500 correctly classified views for a given shape and perform adversarial lighting and geometry algorithms only on a subset of views, then evaluate the resulting adversarial lights/shapes on all the views. The results show that adversarial lights are more generalizable to fool unseen views; adversarial shapes, yet, are less generalizable.
+
+Switching from pixel norm-balls to parametric norm-balls only requires to change the normconstraint from the pixel color space to the parametric space. For instance, we can perform a quantitative comparison between parametric adversarial and random perturbations in Figure 10. We use $L ^ { \infty } – n o r m \ = \ 0 . 1$ to constraint the perturbed magnitude of each lighting coefficient, and $L ^ { \infty } \mathbf { - } n o r m = 0 . 0 0 2$ to constrain the maximum displacement of surface points along each axis. The results show how many parametric adversaries can fool the classifier out of 10,000 adversarial lights and shapes respectively. Not only do the
+
+
+
+parametric norm-balls show the effectiveness of adversarial perturbation, evaluating robustness using parametric norm-balls has real-world implications.
+
+Table 3: We evaluate ResNet adversaries on unseen models and show that parametric adversarial examples also share across models. The table shows the success rate of attacks $( \% )$ .
+
+
Alex
VGG
Squeeze
Dense
Lighting
81.2%
65.0%
78.6%
43.5%
Geometry
70.3%
58.9%
71.1%
40.1%
+
+Figure 10: A quantitative comparison using parametric norm-balls shows the fact that adversarial lighting/geometry perturbations have a higher success rate $( \% )$ in fooling classifiers comparing to random perturbations in the parametric spaces.
+Table 4: We compute parametric adversaries using a subset of views (#Views) and evaluate the success rates $( \% )$ of attacks on unseen views.
+
+
#Views
0
1
5
Lighting
0.0%
29.4%
64.2%
Geometry
0.0%
0.6%
3.6%
+
+Runtime The inset presents our runtime per iteration for computing derivatives. An adversary normally requires less than 10 iterations, thus takes a few seconds. We evaluate our CPU PYTHON implementation and the OPENGL rendering, on an Intel Xeon 3.5GHz CPU with 64GB of RAM and an NVIDIA
+
+
+
+GeForce GTX 1080. Our runtime depends on the number of pixels requiring derivatives.
+
+# 5 RENDERED ADVERSARIAL DATA AUGMENTATION AGAINST REAL PHOTOS
+
+We inject adversarial examples, generated using our differentiable renderer, into the training process of modern image classifiers. Our goal is to increase the robustness of these classifiers to real-world perturbations. Traditionally, adversarial training is evaluated against computer-generated adversarial images (Kurakin et al., 2017; Madry et al., 2018; Tramèr et al., 2017). In contrast, our evaluation differs from the majority of the literature, as we evaluate performance against real photos (i.e., images captured using a camera), and not computer-generated images. This evaluation method is motivated by our goal of increasing a classifier’s robustness to “perturbations” that occur in the real world and result from the physical processes underlying real-world image formation. We present preliminary steps towards this objective, resolving the lack of realism of pixel norm-balls and evaluating our augmented classifiers (i.e., those trained using our rendered adversaries) against real photographs.
+
+Training We train the WideResNet (16 layers, 4 wide factor) (Zagoruyko & Komodakis, 2016) on CIFAR-100 (Krizhevsky & Hinton, 2009) augmented with adversarial lighting examples. We apply a common adversarial training method that adds a fixed number of adversarial examples each epoch (Goodfellow et al., 2015; Kurakin et al., 2017). We refer readers to Appendix F for the training detail. In our experiments, we compare three training scenarios: (1) CIFAR-100, (2) CIFAR-100 $+ ~ 1 0 0$ images under random lighting, and (3) CIFAR- $1 0 0 + 1 0 0$ images under adversarial lighting. Comparing to the accuracy reported in (Zagoruyko & Komodakis, 2016), WideResNets trained on these three cases all have comparable performance $( \approx 7 7 \% )$ ) on the CIFAR-100 test set.
+
+Testing We create a test set of real photos, captured in a laboratory setting with controlled lighting and camera parameters: we photographed oranges using a calibrated Prosilica GT 1920 camera under different lighting conditions, each generated by projecting different lighting patterns using an LG PH550 projector. This hardware lighting setup projects lighting patterns from a fixed solid angle of directions onto the scene objects. Figure 11 illustrates samples from the 500 real photographs of our dataset. We evaluate the robustness of our classifier models according to test accuracy. Of note, average prediction accuracies over five trained WideResNets on our test data under the three training cases are (1) $4 . 6 \%$ , (2) $4 0 . 4 \%$ , and (3) ${ \bf 6 5 . 8 \% }$ . This result supports the fact that training on rendered images can improve the networks’ performance on real photographs. Our preliminary experiments motivate the potential of relying on rendered adversarial training to increase the robustness to visual phenomena present in the real-world inputs.
+
+
+Figure 11: Unlike much of the literature on adversarial training, we evaluate against real photos (captured by a camera), not computergenerated images. This figure illustrates a subset of our test data.
+
+# 6 LIMITATIONS & FUTURE WORK
+
+Using parametric norm-balls to remove the lack of realism of pixel norm-balls is only the first step to bring adversarial machine learning to real-world. More evaluations beyond the lab experimental data could uncover the potential of the rendered adversarial data augmentation. Coupling the differentiable renderer with methods for reconstructing 3D scenes, such as (Veeravasarapu et al., 2017b; Tremblay et al., 2018), has the potential to develop a complete pipeline for rendered adversarial training. We can take a small set of real images, constructing 3D virtual scenes which have real image statistics, using our approach to manipulate the predicted parameters to construct the parametric adversarial examples, then perform rendered adversarial training. This direction has the potential to produce limitless simulated adversarial data augmentation for real-world tasks.
+
+Our differentiable renderer models the change of realistic environment lighting and geometry. Incorporating real-time rendering techniques from the graphics community could further improve the quality of rendering. Removing the locally constant texture assumption could improve our results. Extending the derivative computation to materials could enable “adversarial materials”. Incorporating derivatives of the visibility change and propagating gradient information to shape skeleton could also create “adversarial poses”. These extensions offer a set of tools for modeling real security scenarios. For instance, we can train a self-driving car classifier that can robustly recognize pedestrians under different poses, lightings, and cloth deformations.
+
+# ACKNOWLEDGMENTS
+
+This work is funded in part by NSERC Discovery Grants (RGPIN–2017–05235 & RGPAS–2017–507938), Connaught Funds (NR2016–17), the Canada Research Chairs Program, the Fields Institute, and gifts by Adobe Systems Inc., Autodesk Inc., MESH Inc. We thank members of Dynamic Graphics Project for feedback and draft reviews; Wenzheng Chen for photography equipments; Colin Raffel and David Duvenaud for discussions and feedback.
+
+# REFERENCES
+
+Tomas Akenine-Moller, Eric Haines, and Naty Hoffman. Real-time rendering. AK Peters/CRC Press, 2008.
+
+Naveed Akhtar and Ajmal S. Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. IEEE Access, 6:14410–14430, 2018.
+
+Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples, 2017.
+
+Ronen Basri and David W Jacobs. Lambertian reflectance and linear subspaces. IEEE transactions on pattern analysis and machine intelligence, 25(2):218–233, 2003.
+
+Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. ShapeNet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
+
+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.
+
+Wenzheng Chen, Huan Wang, Yangyan Li, Hao Su, Zhenhua Wang, Changhe Tu, Dani Lischinski, Daniel Cohen-Or, and Baoquan Chen. Synthesizing training images for boosting human 3d pose estimation. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 479–488. IEEE, 2016.
+
+Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018.
+
+TM Dunster. Legendre and related functions. NIST handbook of mathematical functions, pp. 351–381, 2010.
+
+SM Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, Geoffrey E Hinton, et al. Attend, infer, repeat: Fast scene understanding with generative models. In Advances in Neural Information Processing Systems, pp. 3225–3233, 2016.
+
+Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Chaowei Xiao, Atul Prakash, Tadayoshi Kohno, and Dawn Song. Robust Physical-World Attacks on Deep Learning Visual Classification. In Computer Vision and Pattern Recognition (CVPR), 2018.
+
+Kyle Genova, Forrester Cole, Aaron Maschinot, Aaron Sarna, Daniel Vlasic, and William T. Freeman. Unsupervised training for 3d morphable model regression. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
+
+Justin Gilmer, Ryan P Adams, Ian Goodfellow, David Andersen, and George E Dahl. Motivating the rules of the game for adversarial example research. arXiv preprint arXiv:1807.06732, 2018.
+
+Ian Goodfellow. Defense against the dark arts: An overview of adversarial example security research and future research directions. arXiv preprint arXiv:1806.04169, 2018.
+
+Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. URL http:// arxiv.org/abs/1412.6572.
+
+Robin Green. Spherical harmonic lighting: The gritty details. In Archives of the Game Developers Conference, volume 56, pp. 4, 2003.
+
+Ralf Habel, Bogdan Mustata, and Michael Wimmer. Efficient spherical harmonics lighting with the preetham skylight model. In Eurographics (Short Papers), pp. 119–122, 2008.
+
+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.
+
+Dan Hendrycks and Thomas G Dietterich. Benchmarking neural network robustness to common corruptions and surface variations. arXiv preprint arXiv:1807.01697, 2018.
+
+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 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 2261–2269, 2017. doi: 10.1109/CVPR. 2017.243. URL https://doi.org/10.1109/CVPR.2017.243.
+
+Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with $5 0 \mathrm { x }$ fewer parameters and< 0.5 mb model size. arXiv preprint arXiv:1602.07360, 2016.
+
+Stephen James and Edward Johns. 3d simulation for robot arm control with deep q-learning. arXiv preprint arXiv:1609.03759, 2016.
+
+Matthew Johnson-Roberson, Charles Barto, Rounak Mehta, Sharath Nittur Sridhar, Karl Rosaen, and Ram Vasudevan. Driving in the matrix: Can virtual worlds replace human-generated annotations for real world tasks? In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 746–753. IEEE, 2017.
+
+James T Kajiya. The rendering equation. In ACM Siggraph Computer Graphics, volume 20, pp. 143–150. ACM, 1986.
+
+Can Kanbak, Seyed Mohsen Moosavi Dezfooli, and Pascal Frossard. Geometric robustness of deep networks: analysis and improvement. Proceedings of IEEE CVPR, 2018.
+
+Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3907–3916, 2018.
+
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 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.
+
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In Proc. ICLR, 2016.
+
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. 2017.
+
+Guilin Liu, Duygu Ceylan, Ersin Yumer, Jimei Yang, and Jyh-Ming Lien. Material editing using a physically based rendering network. In 2017 IEEE International Conference on Computer Vision (ICCV), pp. 2280–2288. IEEE, 2017.
+
+Hsueh-Ti Derek Liu, Michael Tao, and Alec Jacobson. Paparazzi: Surface editing by way of multi-view image processing. 2018.
+
+Matthew M Loper and Michael J Black. OpenDR: An approximate differentiable renderer. In European Conference on Computer Vision, pp. 154–169. Springer, 2014.
+
+Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. International Conference on Learning Representations, 2018.
+
+Gavin Miller. Efficient algorithms for local and global accessibility shading. In Proceedings of the 21st Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’94, pp. 319–326, New York, NY, USA, 1994. ACM. ISBN 0-89791-667-0. doi: 10.1145/192161.192244. URL http://doi.acm.org/10.1145/192161.192244.
+
+Takeru Miyato, Shin-ichi Maeda, Shin Ishii, and Masanori Koyama. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 2018.
+
+Seyed Mohsen Moosavi Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), number EPFL-CONF-218057, 2016.
+
+Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 86–94, 2017.
+
+Yair Movshovitz-Attias, Takeo Kanade, and Yaser Sheikh. How useful is photo-realistic rendering for visual learning? In European Conference on Computer Vision, pp. 202–217. Springer, 2016.
+
+Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pp. 506–519. ACM, 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. 2017.
+
+Matt Pharr, Wenzel Jakob, and Greg Humphreys. Physically based rendering: From theory to implementation. Morgan Kaufmann, 2016.
+
+Arcot J Preetham, Peter Shirley, and Brian Smits. A practical analytic model for daylight. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques, pp. 91–100. ACM Press/Addison-Wesley Publishing Co., 1999.
+
+Ravi Ramamoorthi and Pat Hanrahan. An efficient representation for irradiance environment maps. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pp. 497–500. ACM, 2001.
+
+Andras Rozsa, Ethan M Rudd, and Terrance E Boult. Adversarial diversity and hard positive generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 25–32, 2016.
+
+Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. arXiv preprint arXiv:1611.04201, 2016.
+
+Dave Shreiner and The Khronos OpenGL ARB Working Group. OpenGL Programming Guide: The Official Guide to Learning OpenGL, Versions 3.0 and 3.1. Addison-Wesley Professional, 7th edition, 2009. ISBN 0321552628, 9780321552624.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Peter-Pike Sloan, Ben Luna, and John Snyder. Local, deformable precomputed radiance transfer. In ACM Transactions on Graphics (TOG), volume 24, pp. 1216–1224. ACM, 2005.
+Hao Su, Charles R Qi, Yangyan Li, and Leonidas J Guibas. Render for CNN: Viewpoint estimation in images using CNNs trained with rendered 3d model views. In Proc. ICCV, pp. 2686–2694, 2015.
+Jiawei Su, Danilo Vasconcellos Vargas, and Sakurai Kouichi. One pixel attack for fooling deep neural networks. arXiv preprint arXiv:1710.08864, 2017.
+Sining Sun, Ching-Feng Yeh, Mari Ostendorf, Mei-Yuh Hwang, and Lei Xie. Training augmentation with adversarial examples for robust speech recognition. arXiv preprint arXiv:1806.02782, 2018.
+Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. 2014.
+Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
+Jonathan Tremblay, Aayush Prakash, David Acuna, Mark Brophy, Varun Jampani, Cem Anil, Thang To, Eric Cameracci, Shaad Boochoon, and Stan Birchfield. Training deep networks with synthetic data: Bridging the reality gap by domain randomization. 2018.
+Gül Varol, Javier Romero, Xavier Martin, Naureen Mahmood, Michael J Black, Ivan Laptev, and Cordelia Schmid. Learning from synthetic humans. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2017), 2017.
+VSR Veeravasarapu, Constantin Rothkopf, and Ramesh Visvanathan. Model-driven simulations for computer vision. In Applications of Computer Vision (WACV), 2017 IEEE Winter Conference on, pp. 1063–1071. IEEE, 2017a.
+VSR Veeravasarapu, Constantin A Rothkopf, and Visvanathan Ramesh. Adversarially tuned scene generation. In CVPR, pp. 6441–6449, 2017b.
+Lance Williams. Casting curved shadows on curved surfaces. In ACM Siggraph Computer Graphics, volume 12, pp. 270–274. ACM, 1978.
+Jiajun Wu, Joshua B Tenenbaum, and Pushmeet Kohli. Neural scene de-rendering. In Proc. CVPR, volume 2, 2017.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference 2016, BMVC 2016, York, UK, September 19-22, 2016, 2016.
+Xiaohui Zeng, Chenxi Liu, Weichao Qiu, Lingxi Xie, Yu-Wing Tai, Chi Keung Tang, and Alan L Yuille. Adversarial attacks beyond the image space. arXiv preprint arXiv:1711.07183, 2017.
+
+# Supplementary Material
+
+# A COMPARISON BETWEEN PERTURBATION SPACES
+
+We extend our comparisons against pixel norm-balls methods (Figure 1) by visualizing the results and the generated perturbations (Figure 12). We hope this figure elucidates that our parametric perturbation are more realistic several scales of perturbations.
+
+
+Figure 12: We compare our parametric perturbations (the first two columns) with pixel/color perturbations under the same $L ^ { \infty }$ pixel norm (small: 0.12, medium: 0.53, large: 0.82). As changing physical parameters corresponds to real-world phenomena, our parametric perturbation are more realistic.
+
+# B PHYSICALLY BASED RENDERING
+
+Physically based rendering (PBR) seeks to model the flow of light, typically the assumption that there exists a collection of light sources that generate light; a camera that receives this light; and a scene that modulates the flow light between the light sources and camera (Pharr et al., 2016). What follows is a brief discussion of the general task of rendering an image from a scene description and the approximations we take in order to make our renderer efficient yet differentiable.
+
+Computer graphics has dedicated decades of effort into developing methods and technologies to enable PBR to synthesize of photorealistic images under a large gamut of performance requirements. Much of this work is focused around taking approximations of the cherished Rendering equation (Kajiya, 1986), which describes the propagation of light through a point in space. If we let $u _ { o }$ be the output radiance, $p$ be the point in space, $\omega _ { o }$ be the output direction, $u _ { e }$ be the emitted radiance, $u _ { i }$ be incoming radiance, $\omega _ { i }$ be the incoming angle, $f _ { r }$ be the way light be reflected off the material at that given point in space we have:
+
+
+Figure 13: PBR models the physics of light that emitted from the light source, interact with the scene, then arrive a camera.
+
+$$
+u _ { o } ( p , \omega _ { o } ) = u _ { e } ( p , \omega _ { o } ) + \int _ { S ^ { 2 } } f _ { r } ( p , \omega _ { i } , \omega _ { o } ) u _ { i } ( p , \omega _ { i } ) ( \omega _ { i } \cdot \mathbf { n } ) d \omega _ { i } .
+$$
+
+From now on we will ignore the emission term $u _ { e }$ as it is not pertinent to our discussion. Furthermore, because the speed of light is substantially faster than the exposure time of our eyes, what we perceive is not the propagation of light at an instant, but the steady state solution to the rendering equation evaluated at every point in space. Explicitly computing this steady state is intractable for our applications and will mainly serve as a reference for which to place a plethora of assumptions and simplifications we will make for the sake of tractability. Many of these methods focus on ignoring light with nominal effects on the final rendered image vis a vis assumptions on the way light travels. For instance, light is usually assumed to have nominal interacts with air, which is described as the assumption that the space between objects is a vacuum, which constrains the interactions of light to the objects in a scene. Another common assumption is that light does not penetrate objects, which makes it difficult to render objects like milk and human $\mathrm { s k i n } ^ { \mathrm { 1 } }$ . This constrains the complexity of light propagation to the behavior of light bouncing off of object surfaces.
+
+# B.1 LOCAL ILLUMINATION
+
+It is common to see assumptions that limit number of bounces light is allowed.In our case we chose to assume that the steady state is sufficiently approximated by an extremely low number of iterations: one. This means that it seems sufficient to model the lighting of a point in space by the light sent to it directly by light sources. Working with such a strong simplification does, of course, lead to a few artifacts. For instance, light occluded by other objects is ignored so shadows disappear and auxiliary techniques are usually employed to evaluate shadows (Williams, 1978; Miller, 1994).
+
+
+Figure 14: Rasterization converts a 3D scene into pixels.
+
+When this assumption is coupled with a camera we approach what is used in standard rasterization systems such as OPENGL (Shreiner & Group, 2009), which is what we use. These systems compute the illumination of a single pixel by determining the fragment of an object visible through that pixel and only computing the light that traverses directly from the light sources, through that fragment, to that pixel. The lighting of a fragment is therefore determined by a point and the surface normal at that point, so we write the fragment’s radiance as $R ( p , { \bf n } , \omega _ { o } ) = \dot { u } _ { o } ( { p , \omega _ { o } } )$ :
+
+$$
+R ( p , \mathbf { n } , \omega _ { o } ) = \int _ { S ^ { 2 } } f _ { r } ( p , \omega _ { i } , \omega _ { o } ) u _ { i } ( p , \omega _ { i } ) ( \omega _ { i } \cdot \mathbf { n } ) d \omega _ { i } .
+$$
+
+# B.2 LAMBERTIAN MATERIAL
+
+Each point on an object has a model approximating the transfer of incoming light to a given output direction $f _ { r }$ , which is usually called the material. On a single object the material parameters may vary quite a bit and the correspondence between points and material parameters is usually called the texture map which forms the texture of an object. There exists a wide gamut of material models, from mirror materials that transport light from a single input direction to a single output direction, to materials that reflect light evenly in all directions, to materials liked brushed metal that reflect differently along different angles. For the sake f document we only consider diffuse materials, also called Lambertian materials, where we assume that incoming light is reflected uniformly, i.e $f _ { r }$ is a constant function with respect to angle, which we denote $f _ { r } ( p , \omega _ { i } , \omega _ { o } ) = \rho ( p )$ :
+
+
+Figure 15: We consider the Lambertian material (left) where lights get reflected uniformly in every direction.
+
+$$
+R ( p , { \bf n } ) = \rho ( p ) \int _ { \Omega ( { \bf n } ) } u ( p , \omega ) ( \omega \cdot { \bf n } ) d \omega .
+$$
+
+This function $\rho$ is usually called the albedo, which can be perceived as color on the surface for diffuse material, and we reduce our integration domain to the upper hemisphere $\Omega ( \mathbf { n } )$ in order to model light not bouncing through objects. Furthermore, since only the only $\omega$ and $u$ are the incoming ones we can now suppress the “incoming” in our notation and just use $\omega$ and $u$ respectively.
+
+# B.3 ENVIRONMENT MAPPING
+
+The illumination of static, distant objects such as the ground, the sky, or mountains do not change in any noticeable fashion when objects in a scene are moved around, so $u$ can be written entirely in terms of $\omega$ , $u ( p , \omega ) = u ( \omega )$ . If their illumination forms a constant it seems prudent to pre-compute or cache their contributions to the illumination of a scene. This is what is usually called environment mapping and they fit in the rendering equation as a representation for the total lighting of a scene, i.e the total incoming radiance $u _ { i }$ . Because the environment is distant, it is common to also assume that the position of the object receiving light from an environment map does not matter so this simplifies $u _ { i }$ to be independent of position:
+
+$$
+R ( p , \mathbf { n } ) = \rho ( p ) \int _ { \Omega ( \mathbf { n } ) } u ( \omega ) \left( { \boldsymbol { \omega } } \cdot \mathbf { n } \right) d \omega .
+$$
+
+# B.4 SPHERICAL HARMONICS
+
+Despite all of our simplifications, the inner integral is still a fairly generic function over $S ^ { 2 }$ . Many techniques for numerically integrating the rendering equation have emerged in the graphics community and we choose one which enables us to perform pre-computation and select a desired spectral accuracy: spherical harmonics. Spherical harmonics are a basis on $S ^ { 2 }$ so, given a spherical harmonics expansion of the integrand, the evaluation of the above integral can be reduced to a weighted product of coefficients. This particular basis is chosen because it acts as a sort of Fourier basis for functions on the sphere and so the bases are each associated with a frequency, which leads to a convenient multi-resolution structure. In fact, the rendering of diffuse objects under distant lighting can be $9 9 \%$ approximated by just the first few spherical harmonics bases (Ramamoorthi & Hanrahan, 2001).
+
+We will only need to note that the spherical harmonics bases $Y _ { l } ^ { m }$ are denoted with the subscript with $l$ as the frequency and that there are $2 l + 1$ functions per frequency, denoted by superscripts $m$ between $- l$ to $l$ inclusively. For further details on them please take a glance at Appendix C.
+
+If we approximate a function $f$ in terms of spherical harmonics coefficients $\begin{array} { r } { f \approx \sum _ { l m } f _ { l , m } Y _ { l } ^ { m } } \end{array}$ the integral can be precomputed as
+
+$$
+\int _ { S ^ { 2 } } { f } \approx \int _ { S ^ { 2 } } \sum _ { l m } f _ { l , m } Y _ { l } ^ { m } = \sum _ { l m } f _ { l , m } \int _ { S ^ { 2 } } Y _ { l } ^ { m } ,
+$$
+
+Thus we have defined a reduced rendering equation that can be efficiently evaluated using OPENGL while maintaining differentiability with respect to lighting and vertices. In the following appendix we will derive the derivatives necessary to implement our system.
+
+# C DIFFERENTIABLE RENDERER
+
+Rendering computes an image of a 3D shape given lighting conditions and the prescribed material properties on the surface of the shape. Our differentiable renderer assumes Lambertian reflectance, distant light sources, local illumination, and piece-wise constant textures. We will discuss how to explicitly compute the derivatives used in the main body of this text. Here we give a detailed discussion about spherical harmonics and their advantages.
+
+# C.1 SPHERICAL HARMONICS
+
+Spherical harmonics are usually defined in terms of the Legendre polynomials, which are a class of orthogonal polynomials defined by the recurrence relation
+
+$$
+\begin{array} { c } { { P _ { 0 } = 1 } } \\ { { P _ { 1 } = x } } \\ { { ( l + 1 ) P _ { l + 1 } ( x ) = ( 2 l + 1 ) x P _ { l } ( x ) - l P _ { l - 1 } ( x ) . } } \end{array}
+$$
+
+The associated Legendre polynomials are a generalization of the Legendre polynomials and can be fully defined by the relations
+
+$$
+\begin{array} { c } { { P _ { l } ^ { 0 } = P _ { l } } } \\ { { \ } } \\ { { ( l - m + 1 ) P _ { l + 1 } ^ { m } ( x ) = ( 2 l + 1 ) x P _ { l } ^ { m } ( x ) - ( l + m ) P _ { l - 1 } ^ { m } ( x ) } } \\ { { 2 m x P _ { l } ^ { m } ( x ) = - \sqrt { 1 - x ^ { 2 } } \left[ P _ { l } ^ { m + 1 } ( x ) + ( l + m ) ( l - m + 1 ) P _ { l } ^ { m - 1 } ( x ) \right] . } } \end{array}
+$$
+
+Using the associated Legendre polynomials $P _ { l } ^ { m }$ we can define the spherical harmonics basis as
+
+$$
+Y _ { l } ^ { m } ( \theta , \phi ) = K _ { l } ^ { m } \left\{ \begin{array} { l l } { ( - 1 ) ^ { m } \sqrt { 2 } P _ { l } ^ { - m } ( \cos \theta ) \sin ( - m \phi ) } & { \quad m < 0 } \\ { ( - 1 ) ^ { m } \sqrt { 2 } P _ { l } ^ { m } ( \cos \theta ) \cos ( m \phi ) } & { \quad m > 0 \ . } \\ { P _ { l } ^ { 0 } ( \cos \theta ) } & { \quad m = 0 } \end{array} \right.
+$$
+
+$$
+\mathrm { w h e r e } K _ { l } ^ { m } = \sqrt { \frac { ( 2 l + 1 ) ( l - | m | ) ! } { 4 \pi ( l + | m | ) ! } } .
+$$
+
+We will use the fact that the associated Legendre polynomials correspond to the spherical harmonics bases that are rotationally symmetric along the $z$ axis $( m = 0$ ).
+
+In order to incorporate spherical harmonics into Equation 8, we change the integral domain from the upper hemisphere $\Omega ( \mathbf { n } )$ back to $S ^ { 2 }$ via a max operation
+
+$$
+\begin{array} { l } { \displaystyle R ( p , { \bf n } ) = \rho ( p ) \int _ { \Omega ( { \bf n } ) } u ( \omega ) ( \omega \cdot { \bf n } ) d \omega } \\ { \displaystyle \quad = \rho ( p ) \int _ { S ^ { 2 } } u ( \omega ) \operatorname* { m a x } ( \omega \cdot { \bf n } , 0 ) d \omega . } \end{array}
+$$
+
+We see that the integral is comprised of two components: a lighting component $u ( \omega )$ and a component that depends on the normal $\operatorname* { m a x } ( \omega \cdot \mathbf n , 0 )$ . The strategy is to pre-compute the two components by projecting onto spherical harmonics, and evaluating the integral via a dot product at runtime, as we will now derive.
+
+# C.2 LIGHTING IN SPHERICAL HARMONICS
+
+Approximating the lighting component $u ( \omega )$ in Equation 19 using spherical harmonics $Y _ { l } ^ { m }$ up to band $n$ can be written as
+
+$$
+u ( \omega ) \approx \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } Y _ { l } ^ { m } ( \omega ) ,
+$$
+
+where $U _ { l , m } \in \mathbb { R }$ are coefficients. By using the orthogonality of spherical harmonics we can use evaluate these coefficients as an integral between $u ( \omega )$ and $Y _ { l } ^ { m } ( \omega )$
+
+$$
+U _ { l , m } = \langle u , Y _ { l } ^ { m } \rangle _ { S ^ { 2 } } = \int _ { S ^ { 2 } } u ( \omega ) Y _ { l } ^ { m } ( \omega ) d \omega ,
+$$
+
+which can be evaluated via quadrature.
+
+# C.3 CLAMPED COSINE IN SPHERICAL HARMONICS
+
+So far, we have projected the lighting term $u ( \omega )$ onto the spherical harmonics basis. To complete evaluating Equation 19 we also need to approximate the second component $\operatorname* { m a x } ( \omega \cdot \mathbf { n } , 0 )$ in spherical
+
+harmonics. This is the so-called the clamped cosine function.
+
+$$
+g ( \omega , { \bf n } ) = \mathrm { m a x } ( \omega \cdot { \bf n } , 0 ) = \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } G _ { l , m } ( { \bf n } ) Y _ { l } ^ { m } ( \omega ) ,
+$$
+
+where $G _ { l , m } ( { \mathbf n } ) \in \mathbb { R }$ can be computed by projecting $g ( \omega , \mathbf { n } )$ onto $Y _ { l } ^ { m } ( \omega )$
+
+$$
+G _ { l , m } ( \mathbf { n } ) = \int _ { S ^ { 2 } } \mathrm { m a x } ( \omega \cdot \mathbf { n } , 0 ) Y _ { l } ^ { m } ( \omega ) d \omega .
+$$
+
+Unfortunately, this formulation turns out to be tricky to compute. Instead, the common practice is to analytically compute the coefficients for unit $z$ direction $\tilde { G } _ { l , m } = G _ { l , m } ( \mathbf { n } _ { z } ) = G _ { l , m } ( [ 0 , 0 , 1 ] ^ { \boldsymbol { \mathsf { T } } } )$ and evaluate the coefficients for different normals $G _ { l , m } ( \mathbf { n } )$ by rotating $\tilde { G } _ { l , m }$ . This rotation, $\tilde { G } _ { l , m }$ , can be computed analytically:
+
+$$
+\begin{array} { r l } & { \tilde { G } _ { l , m } = \displaystyle \int _ { S ^ { 2 } } \operatorname* { m a x } ( \omega \cdot \mathbf { n } _ { z } , 0 ) Y _ { l } ^ { m } ( \omega ) d \omega } \\ & { \quad \quad = \displaystyle \int _ { 0 } ^ { 2 \pi } \int _ { 0 } ^ { \pi } \operatorname* { m a x } ( [ \sin \theta \cos \phi , \sin \theta \sin \phi , \cos \theta ] [ 0 , 0 , 1 ] ^ { \tau } , 0 ) Y _ { l } ^ { m } ( \theta , \phi ) \sin \theta d \theta d \phi } \\ & { \quad \quad = \displaystyle \int _ { 0 } ^ { 2 \pi } \int _ { 0 } ^ { \pi } \operatorname* { m a x } ( \cos \theta , 0 ) Y _ { l } ^ { m } ( \theta , \phi ) \sin \theta d \theta d \phi } \\ & { \quad \quad = \displaystyle \int _ { 0 } ^ { 2 \pi } \int _ { 0 } ^ { \pi / 2 } \cos \theta Y _ { l } ^ { m } ( \theta , \phi ) \sin \theta d \theta d \phi . } \end{array}
+$$
+
+In fact, because $\operatorname* { m a x } ( \omega \cdot \mathbf { n } _ { z } , 0 )$ is rotationally symmetric around the $z$ -axis, its projection onto $Y _ { l } ^ { m } ( \omega )$ will have many zeros except the rotationally symmetric spherical harmonics $\bar { Y } _ { l } ^ { 0 }$ . In other words, $\tilde { G } _ { l , m }$ is non-zero only when $m = 0$ . So we can simplify Equation 20 to
+
+$$
+\tilde { G } _ { l } = \tilde { G } _ { l , 0 } = 2 \pi \int _ { 0 } ^ { \pi / 2 } \cos \theta Y _ { l } ^ { 0 } ( \theta ) \sin \theta d \theta .
+$$
+
+The evaluation of this integral can be found in Appendix A in (Basri & Jacobs, 2003). We provide this here as well:
+
+$$
+\tilde { G } _ { l } = \left\{ \begin{array} { l l } { \frac { \sqrt { \pi } } { 2 } } & { l = 0 } \\ { \sqrt { \frac { \pi } { 3 } } } & { l = 1 } \\ { ( - 1 ) ^ { \frac { l } { 2 } + 1 } \frac { ( l - 2 ) ! \sqrt { ( 2 l + 1 ) \pi } } { 2 ^ { l } ( \frac { l } { 2 } - 1 ) ! ( \frac { l } { 2 } + 1 ) ! } } & { l \geq 2 , \mathrm { e v e n } } \\ { 0 } & { l \geq 2 , \mathrm { o d d } } \end{array} \right. .
+$$
+
+The spherical harmonics coefficients $G _ { l , m } ( \mathbf { n } )$ of the clamped cosine function $g ( \omega , \mathbf { n } )$ can be computed by rotating $\tilde { G } _ { l }$ (Sloan et al., 2005) using this formula
+
+$$
+G _ { l , m } ( \mathbf { n } ) = \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } Y _ { l } ^ { m } ( \mathbf { n } ) .
+$$
+
+So far we have projected the two terms in Equation 19 into the spherical harmonics basis. Orthogonality of spherical harmonics makes the evaluation of this integral straightforward:
+
+$$
+\begin{array} { l } { \displaystyle \int _ { { \mathcal { S } } ^ { 2 } } u ( \boldsymbol { \omega } ) \operatorname* { m a x } ( \boldsymbol { \omega } \cdot { \bf n } , 0 ) d \boldsymbol { \omega } = \int _ { { \mathcal { S } } ^ { 2 } } \left[ \sum _ { l , m } U _ { l , m } Y _ { l } ^ { m } ( \boldsymbol { \omega } ) \right] \left[ \sum _ { j , k } G _ { j , k } ( { \bf n } ) Y _ { j } ^ { k } ( \boldsymbol { \omega } ) \right] d \boldsymbol { \omega } } \\ { \displaystyle = \sum _ { j , k , l , m } U _ { l , m } G _ { j , k } ( { \bf n } ) \delta _ { j } ^ { l } \delta _ { k } ^ { m } } \\ { \displaystyle = \sum _ { l , m } U _ { l , m } G _ { l , m } ( { \bf n } ) . } \end{array}
+$$
+
+This, in conjunction with Equation 21allows us to derive the rendering equation using spherical harmonics lighting for Lambertian objects:
+
+$$
+R ( { \boldsymbol { p } } , \mathbf { n } ) = \rho ( { \boldsymbol { p } } ) \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } { \sqrt { \frac { 4 \pi } { 2 l + 1 } } } { \tilde { G } } _ { l } Y _ { l } ^ { m } ( \mathbf { n } ) .
+$$
+
+So far we have only considered the shading of a specific point $p$ with surface normal $\mathbf { n }$ . If we consider the rendered image $I$ given a shape $V$ , lighting $U$ , and camera parameters $\eta$ , the image $I$ is the evaluation of the rendering equation $R$ of each point in $V$ visible through each pixel in the image. This pixel to point mapping is determined by $\eta$ . Therefore, we can write $I$ as
+
+$$
+I ( V , U , \eta ) = \rho ( V , \eta ) \underbrace { \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } Y _ { l } ^ { m } ( N ( V ) ) } _ { F ( V , U ) } ,
+$$
+
+where $N ( V )$ is the surface normal. We exploit the notation and use $\rho ( V , \eta )$ to represent the texture of $V$ mapped to the image space through $\eta$ .
+
+# C.4 LIGHTING AND TEXTURE DERIVATIVES
+
+For our applications we must differentiate Equation 25 with respect to lighting and material parameters. The derivative with respect to the lighting coefficients $U$ can be obtained by
+
+$$
+\begin{array} { c } { \displaystyle \frac { \partial I } { \partial U } = \frac { \partial \rho } { \partial U } F + \rho \frac { \partial F } { \partial U } } \\ { = 0 + \rho \displaystyle \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } \frac { \partial F } { \partial U _ { l , m } } . } \end{array}
+$$
+
+This is the Jacobian matrix that maps from spherical harmonics coefficients to pixels. The term $\partial F / \partial U _ { l , m }$ can then be computed as
+
+$$
+\frac { \partial F } { \partial U _ { l , m } } = \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } Y _ { l } ^ { m } ( N ( V ) ) .
+$$
+
+The derivative with respect to texture is defined by
+
+$$
+\frac { \partial I } { \partial \rho } = \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } Y _ { l } ^ { m } ( N ( V ) ) .
+$$
+
+Note that we assume texture variations are piece-wise constant with respect to our triangle mesh discretization.
+
+# D DIFFERENTIATING SKYLIGHT PARAMETERS
+
+To model possible outdoor daylight conditions, we use the analytical Preetham skylight model (Preetham et al., 1999). This model is calibrated by atmospheric data and parameterized by two intuitive parameters: turbidity $\tau$ , which describes the cloudiness of the atmosphere, and two polar angles $\theta _ { s } \in [ 0 , \pi / 2 ] , \phi _ { s } \in [ 0 , 2 \pi ]$ , which are encode the direction of the sun. Note that $\theta _ { s } , \phi _ { s }$ are not the polar angles $\theta , \phi$ for representing incoming light direction $\omega$ in $u ( \omega )$ . The spherical harmonics representation of the Preetham skylight is presented in (Habel et al., 2008) as
+
+$$
+u ( \omega ) = \sum _ { l = 0 } ^ { 6 } \sum _ { m = - l } ^ { l } U _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau ) Y _ { l } ^ { m } ( \omega ) .
+$$
+
+This is derived by first performing a non-linear least squares fit to write $U _ { l , m }$ as a polynomial of $\theta _ { s }$ and $\tau$ which lets them solve for $\tilde { U } _ { l , m } ( \theta _ { s } , \tau ) = U _ { l , m } ( \theta _ { s } , 0 , \tau )$
+
+$$
+\tilde { U } _ { l , m } ( \theta _ { s } , \tau ) = \sum _ { i = 0 } ^ { 1 3 } \sum _ { j = 0 } ^ { 7 } ( p _ { l , m } ) _ { i , j } \theta _ { s } ^ { i } \tau ^ { j } ,
+$$
+
+where $( p _ { l , m } ) _ { i , j }$ are scalar coefficients, then $U _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau )$ can be computed by applying a spherical harmonics rotation with $\phi _ { s }$ using
+
+$$
+U _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau ) = \tilde { U } _ { l , m } ( \theta _ { s } , \tau ) \cos ( m \phi _ { s } ) + \tilde { U } _ { l , - m } ( \theta _ { s } , \tau ) \sin ( m \phi _ { s } ) .
+$$
+
+We refer the reader to (Preetham et al., 1999) for more detail. For the purposes of this article we just need the above form to compute the derivatives.
+
+# D.1 DERIVATIVES
+
+The derivatives of the lighting with respect to the skylight parameters $( \theta _ { s } , \phi _ { s } , \tau )$ are
+
+$$
+\begin{array} { l } { \displaystyle \frac { \partial \tilde { U } _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau ) } { \partial \phi _ { s } } = - m \tilde { U } _ { l , m } ( \theta _ { s } , \tau ) \sin ( m \phi _ { s } ) + m \tilde { U } _ { l , - m } ( \theta _ { s } , \tau ) \cos ( m \phi _ { s } ) } \\ { \displaystyle \frac { \partial \tilde { U } _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau ) } { \partial \theta _ { s } } = \frac { \partial \tilde { U } _ { l , m } ( \theta _ { s } , \tau ) \cos ( m \phi _ { s } ) + \tilde { U } _ { l , - m } ( \theta _ { s } , \tau ) \sin ( m \phi _ { s } ) } { \partial \theta _ { s } } } \\ { \displaystyle \qquad = \sum _ { i j } i \theta _ { s } ^ { i - 1 } \tau ^ { j } ( p _ { l , m } ) _ { i , j } \cos ( m \phi _ { s } ) + \sum _ { i j } i \theta _ { s } ^ { i - 1 } ( p _ { l , - m } ) _ { i , j } \sin ( m \phi _ { s } ) } \\ { \displaystyle \frac { \partial \tilde { U } _ { l , m } ( \theta _ { s } , \phi _ { s } , \tau ) } { \partial \tau } = \sum _ { i j } j \theta _ { s } ^ { i } \tau ^ { j - 1 } ( p _ { l , m } ) _ { i , j } \cos ( m \phi _ { s } ) + \sum _ { i j } j \theta _ { s } ^ { i } \tau ^ { j - 1 } ( p _ { l , - m } ) _ { i , j } \sin ( m \phi _ { s } ) } \end{array}
+$$
+
+# E DERIVATIVES OF SURFACE NORMALS
+
+Taking the derivative of the rendered image $I$ with respect to surface normals $N$ is an essential task for computing the derivative of $I$ with respect to the geometry $V$ . Specifically, the derivative of the rendering equation Equation 25 with respect to $V$ is
+
+$$
+\begin{array} { c } { \displaystyle { \frac { \partial I } { \partial V } = \frac { \partial \rho } { \partial V } F + \rho \frac { \partial F } { \partial V } } } \\ { \displaystyle { = \frac { \partial \rho } { \partial V } F + \rho \frac { \partial F } { \partial N } \frac { \partial N } { \partial V } } } \end{array}
+$$
+
+We assume the texture variations are piece-wise constant with respect to our triangle mesh discretization and omit the first term $\partial \rho / \partial V$ as the magnitude is zero. Computing ${ \partial \bar { N _ { \big / { \partial V } } } }$ is provided in Section 3.2. Computing $\partial F / \partial N _ { i }$ on face $i$ is
+
+$$
+\frac { \partial F } { \partial N _ { i } } = \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } \frac { \partial Y _ { l } ^ { m } } { \partial N _ { i } } ,
+$$
+
+where the ${ \partial Y _ { l } ^ { m } } / { \partial N _ { i } }$ is the derivative of the spherical harmonics with respect to the face normal $N _ { i }$ .
+
+To begin this derivation recall the relationship between a unit normal vector $\mathbf { n } = ( n _ { x } , n _ { y } , n _ { z } )$ and its corresponding polar angles $\theta , \phi$
+
+$$
+\theta = \cos ^ { - 1 } \bigg ( \frac { n _ { z } } { \sqrt { n _ { x } ^ { 2 } + n _ { y } ^ { 2 } + n _ { z } ^ { 2 } } } \bigg ) \qquad \phi = \tan ^ { - 1 } \bigg ( \frac { n _ { y } } { n _ { x } } \bigg ) ,
+$$
+
+we can compute the derivative of spherical harmonics with respect to the normal vector through
+
+$$
+\begin{array} { r l r } { \frac { \partial Y _ { i } ^ { n } ( t , \theta , \phi ) } { \partial \mathbf { n } } } & { } & { = 0 } \\ & { } & { \left[ ( 1 - 1 ) ^ { n } \sqrt { 2 } \left[ \frac { \partial P _ { i } ^ { n - 1 } ( c \times \theta ) \tilde { \theta } } { \partial \theta } \frac { \partial \theta } { \partial \mathbf { n } } \sin ( - m \phi ) + P _ { i } ^ { - n } ( c \times \theta ) \frac { \partial \sin ( - m \phi ) } { \partial \phi } \frac { \partial \phi } { \partial \mathbf { n } } \right] \right. \qquad m < 0 } \\ & { } & { = K _ { i } ^ { n } \left( \cdots \right) ^ { n } \sqrt { 2 } \left[ \frac { \partial P _ { i } ^ { n } ( c \times \theta ) } { \partial \theta } \frac { \partial \theta } { \partial \mathbf { n } } \cos ( m \phi ) + P _ { i } ^ { n } ( c \times ( \cos \theta ) \frac { \partial \cos ( \theta ) \phi } { \partial \phi } ) \frac { \partial \phi } { \partial \mathbf { n } } \right] \qquad m > 0 } \\ & { } & { \left. \qquad \left[ \frac { \partial P _ { i } ^ { n } ( c \times \theta ) } { \partial \theta } \frac { \partial \theta } { \partial \mathbf { n } } \right. \qquad \partial \qquad \left. \partial \qquad \sin ( - m \phi ) - m P _ { i } ^ { n - 1 } ( c \times \theta ) \cos ( - m \phi ) \frac { \partial \theta } { \partial \mathbf { n } } \right] \right. \qquad m = 0 } \\ & { } & { \left. \qquad \left( \cdots \right) ^ { n } \sqrt { 2 } \left[ \frac { \partial P _ { i } ^ { n - 1 } ( c \times \theta ) \tilde { \theta } } { \partial \theta } \frac { \partial \theta } { \partial \mathbf { n } } \sin ( - m \phi ) - m P _ { i } ^ { n - 1 } ( c \times \theta ) \cos ( - m \phi ) \frac { \partial \theta } { \partial \mathbf { n } } \right] \right. \qquad m < 0 } \\ & { } & { = K _ { i } ^ { n } \left( \cdots \right) ^ { n } \sqrt { 2 } \left[ \frac { \partial P _ { i } ^ { n } ( c \times \theta ) } { \partial \theta } \frac { \partial \theta } { \partial \mathbf { n } } \cos ( m \phi ) - m P _ { i } ^ { n } ( c \times \theta ) \sin ( m \phi ) \frac { \partial \theta } { \partial \mathbf { n } } \right] \qquad m > 0 } \\ & { } & \qquad \left. \partial P _ { i } ^ { n } ( c \times \theta ) \right) \frac \end{array}
+$$
+
+Note that the derivative of the associated Legendre polynomials $P _ { l } ^ { m } ( \cos \theta )$ can be computed by applying the recurrence formula Dunster (2010)
+
+$$
+\begin{array} { r l } & { \frac { \partial P _ { l } ^ { m } ( \cos \theta ) } { \partial \theta } = \frac { - \cos \theta ( l + 1 ) P _ { l } ^ { m } ( \cos \theta ) + ( l - m + 1 ) P _ { l + 1 } ^ { m } ( \cos \theta ) } { \cos ^ { 2 } \theta - 1 } \times ( - \sin \theta ) } \\ & { \qquad = \frac { - \cos \theta ( l + 1 ) P _ { l } ^ { m } ( \cos \theta ) + ( l - m + 1 ) P _ { l + 1 } ^ { m } ( \cos \theta ) } { \sin \theta } . } \end{array}
+$$
+
+Thus the derivatives of polar angles $( \theta , \phi )$ with respect to surface normals $\mathbf { n } = [ n _ { x } , n _ { y } , n _ { z } ]$ are
+
+$$
+\begin{array} { l } { \displaystyle \frac { \partial \theta } { \partial \mathbf { n } } = \Big [ \frac { \partial \theta } { \partial n _ { x } } , \frac { \partial \theta } { \partial n _ { y } } , \frac { \partial \theta } { \partial n _ { z } } \Big ] = \frac { \big [ n _ { x } n _ { z } , n _ { y } n _ { z } , - ( n _ { x } ^ { 2 } + n _ { y } ^ { 2 } ) \big ] } { ( n _ { x } ^ { 2 } + n _ { y } ^ { 2 } + n _ { z } ^ { 2 } ) \sqrt { n _ { x } ^ { 2 } + n _ { y } ^ { 2 } } } , } \\ { \displaystyle \frac { \partial \phi } { \partial \mathbf { n } } = \Big [ \frac { \partial \phi } { \partial n _ { x } } , \frac { \partial \phi } { \partial n _ { y } } , \frac { \partial \phi } { \partial n _ { z } } \Big ] = \Big [ \frac { - n _ { y } } { n _ { x } ^ { 2 } + n _ { y } ^ { 2 } } , \frac { n _ { x } } { n _ { x } ^ { 2 } + n _ { y } ^ { 2 } } , 0 \Big ] . } \end{array}
+$$
+
+In summary, the results of Equation 37, Equation 38, Equation 39, and Equation 40 tell us how to compute ${ \partial { Y _ { l } } ^ { m } } / { \partial { N _ { i } } }$ . Then the derivative of the pixel $j$ with respect to vertex $p$ which belongs to face $i$ can be computed as
+
+$$
+\begin{array} { r l r } { { \frac { \partial I _ { j } } { \partial V _ { p } } \approx \rho _ { j } \frac { \partial F } { \partial N _ { i } } \frac { \partial N _ { i } } { \partial V _ { p } } } } \\ & { } & { = \rho _ { j } \sum _ { l = 0 } ^ { n } \sum _ { m = - l } ^ { l } U _ { l , m } \sqrt { \frac { 4 \pi } { 2 l + 1 } } \tilde { G } _ { l } \frac { \partial Y _ { l } ^ { m } ( \theta , \phi ) } { \partial N _ { i } } \frac { \partial N _ { i } } { \partial V _ { p } } . } \end{array}
+$$
+
+# F ADVERSARIAL TRAINING IMPLEMENTATION DETAIL
+
+Our adversarial training is based on the basic idea of injecting adversarial examples into the training set at each step and continuously updating the adversaries according to the current model parameters (Goodfellow et al., 2015; Kurakin et al., 2017). Our experiments inject 100 adversarial lighting examples to the CIFAR-100 data $( \approx 0 . 1 7 \%$ of the training set) and keep updating these adversaries at each epoch.
+
+We compute the adversarial lighting examples using the orange models collected from cgtrader.com and turbosquid.com. We uses five gray-scale background colors with intensities 0.0, 0.25, 0.5, 0.75, 1.0 to mimic images in the CIFAR-100 which contains many pure color backgrounds. Our orthographic cameras are placed at polar angle $\theta = \pi / 3$ with 10 uniformly sampled azimuthal angles ranging from $\phi = 0$ to $2 \pi$ . Our initial spherical harmonics lighting is the same as other experiments, using the real-world lighting data provided in (Ramamoorthi & Hanrahan, 2001). Our stepsize for computing adversaries is 0.05 along the direction of lighting gradients. We run our adversarial lighting iterations until fooling the network or reaching the maximum 30 iterations to avoid too extreme lighting conditions, such as turning the lights off.
+
+
+Figure 16: This figure visualizes the images of oranges from CIFAR-100, random lighting, and adversarial lighting. In early training stage, small changes in lighting are sufficient to construct adversarial examples. In late training stage, we require more dramatic changes as the model is becoming robust to differ lightings.
+
+Our random lighting examples are constructed at each epoch by randomly perturb the lighting coefficients ranging from -0.5 to 0.5.
+
+When training the 16-layers WideResNet (Zagoruyko & Komodakis, 2016) with wide-factor 4, we use batch size 128, learning rate 0.125, dropout rate 0.3, and the standard cross entropy loss. We implement the training using PYTORCH (Paszke et al., 2017), with the SGD optimizer and set the Nesterov momentum 0.9, weight decay 5e-4. We train the model for 150 epochs and use the one with best accuracy on the validation set. Figure 16 shows examples of our adversarial lights at different training stages. In the early stages, the model is not robust to different lighting conditions, thus small lighting perturbations are sufficient to fool the model. In the late stages, the network becomes more robust to different lightings. Thus it requires dramatic changes to fool a model or even fail to fool the model within 30 iterations.
+
+# G EVALUATE RENDERING QUALITY
+
+We evaluated our rendering quality by whether our rendered images are recognizable by models trained on real photographs. Although large 3D shape datasets, such as ShapeNet (Chang et al., 2015), are available, they do not have have geometries or textures at the resolutions necessary to create realistic renderings. We collected 75 high-quality textured 3D shapes from cgtrader.com and turbosquid.com to evaluate our rendering quality. We augmented the shapes by changing the field of view, backgrounds, and viewing directions, then keep the configurations that were correctly classified by a pre-trained ResNet-101 on ImageNet. Specifically, we place the centroid, calculated as the weighted average of the mesh vertices where the weights are the vertex areas, at the origin and normalize shapes to range $^ { - 1 }$ to 1; the field of view is chosen to be 2 and 3 in the same unit with the normalized shape; background images include plain colors and real photos, which have small influence on model predictions; viewing directions are chosen to be 60 degree zenith and uniformly sampled 16 views from 0 to $2 \pi$ azimuthal angle. In Figure 17, we show that the histogram of model confidence on the correct labels over 10,000 correctly classified rendered images from our differentiable renderer. The confidence is computed using softmax function and the results show that our rendering quality is faithful enough to be recognized by models trained on natural images.
+
+
+Figure 17: Prediction confidence on rendered images, showing our rendering quality is faithful enough to be confidently recognized by ImageNet models.
\ No newline at end of file
diff --git a/md/train/SJxzPsAqFQ/SJxzPsAqFQ.md b/md/train/SJxzPsAqFQ/SJxzPsAqFQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..37d2aba928f69c42c9ca1e82e950b027b6367188
--- /dev/null
+++ b/md/train/SJxzPsAqFQ/SJxzPsAqFQ.md
@@ -0,0 +1,298 @@
+# MULTI-TURN DIALOGUE RESPONSE GENERATION IN AN ADVERSARIAL LEARNING FRAMEWORK
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We propose an adversarial learning approach to the generation of multi-turn dialogue responses. Our proposed framework, hredGAN, is based on conditional generative adversarial networks (GANs). The GAN’s generator is a modified hierarchical recurrent encoder-decoder network (HRED) and the discriminator is a word-level bidirectional RNN that shares context and word embedding with the generator. During inference, noise samples conditioned on the dialogue history are used to perturb the generator’s latent space to generate several possible responses. The final response is the one ranked best by the discriminator. The hredGAN shows major advantages over existing methods: (1) it generalizes better than networks trained using only the log-likelihood criterion, and (2) it generates longer, more informative and more diverse responses with high utterance and topic relevance even with limited training data. This superiority is demonstrated on the Movie triples and Ubuntu dialogue datasets with both the automatic and human evaluations.
+
+# 1 INTRODUCTION
+
+Recent advances in deep neural network architectures have enabled tremendous success on a number of difficult machine learning problems. While these results are impressive, producing a deployable neural network–based conversation model that can engage in open domain discussion still remains elusive. A dialogue system needs to be able to generate meaningful and diverse responses that are simultaneously coherent with the input utterance and the overall dialogue topic. Unfortunately, earlier conversation models trained with naturalistic dialogue data suffered greatly from limited contextual information (Sutskever et al., 2014; Vinyals & Le, 2015), and lack diversity (Li et al., 2016a). These problems often leads to generic and safe utterance in response to varieties of input utterance.
+
+Serban et al. (2016) and Xing et al. (2017) proposed the Hierarchical Recurrent Encoder-Decoder (HRED) network to capture long temporal dependencies in multi-turn conversations to address the limited contextual information but the diversity problem remained. On the other hand, some HRED variants such as variational (Serban et al., 2017b) and multi-resolution (Serban et al., 2017a) HREDs attempt to alleviate the diversity problem by injecting noise at the utterance level and by extracting additional context to condition the generator on. While these approaches achieve certain measures of success over the basic HRED, generated responses are still mostly generic since they do not control the generator’s output as the output conditional distribution is not calibrated. Li et al. (2016a), on the other hand, consider diversity promoting training objective but their model is for single turn conversations, cannot not be trained end-to-end and therefore achieves little.
+
+The generative adversarial network (GAN) (Goodfellow et al., 2014) seems to be an appropriate solution to the diversity problem. GAN matches data from two different distributions by introducing an adversarial game between a generator and a discriminator. We explore hredGAN: conditional GANs for multi-turn dialogue models with HRED generator and discriminator. hredGAN combines both generative and retrieval-based multi-turn dialogue systems to improve their individual performances. This is achieved by sharing the context and word embedding between the generator and the discriminator allowing for joint end-to-end training using back-propagation. To the best of our knowledge, no existing work has applied conditional GANs to multi-turn dialogue models and especially with HRED generators and discriminators. We demonstrate the effectiveness of hredGAN over the VHRED for dialogue modeling with evaluations on the Movie triples and Ubuntu technical support datasets.
+
+# 2 ADVERSARIAL FRAMEWORK FOR MULTI-TURN DIALOGUE
+
+Consider a dialogue consisting of a sequence of $N$ utterances, $\pmb { X } = \left( X _ { 1 } , X _ { 2 } , \cdots , X _ { N } \right)$ , where each utterance $X _ { i } ~ = ~ \left( X _ { i } ^ { 1 } , X _ { i } ^ { 2 } , \cdot \cdot \cdot , X _ { i } ^ { M _ { i } } \right)$ contains a variable-length sequence of $M _ { i }$ word tokens such that $X _ { i } ^ { \mathcal { j } } ~ \in ~ V$ for vocabulary $V$ . At any time step $i$ , the dialogue history is given by $\boldsymbol { X _ { i } } = \left( X _ { 1 } , X _ { 2 } , \cdot \cdot \cdot , X _ { i } \right)$ . The dialogue response generation task can be defined as follows: Given a dialogue history $X _ { i }$ , generate a response $Y _ { i } = \left( Y _ { i } ^ { 1 } , Y _ { i } ^ { 2 } , \cdots , Y _ { i } ^ { T _ { i } } \right)$ , where $T _ { i }$ is the number of generated tokens. We also want the distribution of the generated response $P ( Y _ { i } )$ to be indistinguishable from that of the ground truth $P ( X _ { i + 1 } )$ and $T _ { i } = M _ { i + 1 }$ . Conditional GAN learns a mapping from an observed dialogue history, $X _ { i }$ , and a sequence of random noise vectors, $Z _ { i }$ to a sequence of output tokens, $Y _ { i }$ , $G : \{ X _ { i } , Z _ { i } \} Y _ { i }$ . The generator $G$ is trained to produce output sequences that cannot be distinguished from the ground truth sequence by an adversarially trained discriminator $D$ that is trained to do well at detecting generator’s fakes. The distribution of the generator output sequence can be factored by the product rule:
+
+$$
+\begin{array} { r } { P ( Y _ { i } | \boldsymbol { X _ { i } } ) = P ( Y _ { i } ^ { 1 } ) \displaystyle \prod _ { j = 2 } ^ { T _ { i } } P \big ( Y _ { i } ^ { j } | Y _ { i } ^ { 1 } , \cdot \cdot \cdot , Y _ { i } ^ { j - 1 } , \pmb { X _ { i } } \big ) } \\ { P \big ( Y _ { i } ^ { j } | Y _ { i } ^ { 1 } , \cdot \cdot \cdot , Y _ { i } ^ { j - 1 } , \pmb { X _ { i } } \big ) = P _ { \theta _ { G } } \big ( Y _ { i } ^ { 1 : j - 1 } , \pmb { X _ { i } } \big ) } \end{array}
+$$
+
+where Y i:j−1 $\begin{array} { r c l } { Y _ { i } ^ { i : j - 1 } } & { = } & { ( Y _ { i } ^ { 1 } , \cdot \cdot \cdot , Y _ { i } ^ { j - 1 } ) } \end{array}$ and $\theta _ { G }$ are the parameters of the generator model. $P _ { \theta _ { G } } \left( Y _ { i } ^ { i : j - 1 } , X _ { i } \right)$ is an autoregressive generative model where the probability of the current token depends on the past generated sequence. Training the generator $G$ with the log-likelihood criterion is unstable in practice, and therefore the past generated sequence is substituted with the ground truth, a method known as teacher forcing (Williams & Zipser, 1989), i.e.,
+
+$$
+P \left( Y _ { i } ^ { j } | Y _ { i } ^ { 1 } , \cdot \cdot \cdot , Y _ { i } ^ { j - 1 } , \pmb { X } _ { i } \right) \approx P _ { \theta _ { G } } \left( X _ { i + 1 } ^ { 1 : j - 1 } , \pmb { X } _ { i } \right)
+$$
+
+Using equation 3 in relation to GAN, we define our fake sample as the teacher forcing output with some input noise $Z _ { i }$
+
+$$
+Y _ { i } ^ { j } \sim P _ { \theta _ { G } } ( X _ { i + 1 } ^ { 1 : j - 1 } , X _ { i } , Z _ { i } )
+$$
+
+and the corresponding real sample as ground truth $X _ { i + 1 } ^ { j }$
+
+With the GAN objective, we can match the noise distribution, $P ( Z _ { i } )$ to the distribution of the ground truth response, $P ( X _ { i + 1 } | X _ { i } )$ . Varying the noise input then allows us to generate diverse responses to the same dialogue history. Furthermore, the discriminator, since it is calibrated, is used during inference to rank the generated responses, providing a means of controlling the generator output.
+
+# 2.1 OBJECTIVES
+
+The objective of a conditional GAN can be expressed as
+
+$$
+\begin{array} { r l } { \mathcal { L } _ { c G A N } ( G , D ) } & { = \ \mathbb { E } _ { X _ { i } , X _ { i + 1 } } [ \log \ D ( X _ { i + 1 } , X _ { i } ) ] + \mathbb { E } _ { X _ { i } , Z _ { i } } [ 1 - \log D ( G ( X _ { i } , Z _ { i } ) , X _ { i } ) ] } \end{array}
+$$
+
+where $G$ tries to minimize this objective against an adversarial $D$ that tries to maximize it:
+
+$$
+G ^ { * } , D ^ { * } = a r g m i n m a x \mathcal { L } _ { c G A N } ( G , D ) .
+$$
+
+Previous approaches have shown that it is beneficial to mix the GAN objective with a more traditional loss such as cross-entropy loss (Lamb et al., 2016; Li et al., 2017). The discriminator’s job remains unchanged, but the generator is tasked not only to fool the discriminator but also to be near the ground truth $X _ { i + 1 }$ in the cross-entropy sense:
+
+$$
+\mathcal { L } _ { M L E } ( G ) = \mathbb { E } _ { X _ { i } , X _ { i + 1 } , Z _ { i } } [ - l o g ~ P _ { \theta _ { G } } \left( X _ { i + 1 } , X _ { i } , Z _ { i } \right) ] .
+$$
+
+Our final objective is,
+
+$$
+G ^ { * } , D ^ { * } = a r g m i n m a x \left( \lambda _ { G } \mathcal { L } _ { c G A N } ( G , D ) + \lambda _ { M } \mathcal { L } _ { M L E } ( G ) \right) .
+$$
+
+
+Figure 1: Left: The hredGAN architecture - The generator makes predictions conditioned on the dialogue history, $\boldsymbol { h } _ { i }$ , attention, $A _ { i } ^ { j }$ , noise sample, $Z _ { i } ^ { j }$ , and ground truth, $X _ { i + 1 } ^ { j - 1 }$ . Right: RNN-based discriminator that discriminates bidirectionally at the word level.
+
+It is worth mentioning that, without $Z _ { i }$ , the net could still learn a mapping from $X _ { i }$ to $Y _ { i }$ , but would produce deterministic outputs and fail to match any distribution other than a delta function (Isola et al., 2017). This is one key area where our work is different from Lamb et al.’s and Li et al.’s. The schematic of the proposed hredGAN is depicted at the right hand side of Figure 1.
+
+# 2.2 GENERATOR
+
+We adopted an HRED dialogue generator similar to (Serban et al., 2016; 2017a;b; Xing et al., 2017). The HRED contains three recurrent structures, i.e. the encoder $( e R N N )$ , context $( c R N N )$ , and decoder $( d R N N )$ RNN. The conditional probability modeled by the HRED per output word token is given by
+
+$$
+P _ { \theta _ { G } } \left( Y _ { i } ^ { j } | X _ { i + 1 } ^ { 1 : j - 1 } , \pmb { X } _ { i } \right) = d R N N \left( E ( X _ { i + 1 } ^ { j - 1 } ) , h _ { i } ^ { j - 1 } , { h _ { i } } \right)
+$$
+
+where $E ( . )$ is the embedding lookup, $h _ { i } \ = \ c R N N ( e R N N ( E ( X _ { i } ) , h _ { i - 1 } )$ , $e R N N ( . )$ maps a sequence of input symbols into fixed-length vector, and $h$ and $^ { h }$ are the hidden states of the decoder and context RNN, respectively.
+
+In the multi-resolution HRED, (Serban et al., 2017a), high-level tokens are extracted and processed by another RNN to improve performance. We circumvent the need for this extra processing by allowing the decoder to attend to different parts of the input utterance during response generation (Bahdanau et al., 2015; Luong et al., 2015). We introduce a local attention into equation 9 and encode the attention memory differently from the context through an attention encoder RNN $( a R N N )$ , yielding:
+
+$$
+P _ { \theta _ { G } } \left( Y _ { i } ^ { j } | X _ { i + 1 } ^ { 1 : j - 1 } , X _ { i } \right) = d R N N \big ( E ( X _ { i + 1 } ^ { j - 1 } ) , h _ { i } ^ { j - 1 } , A _ { i } ^ { j } , h _ { i } \big )
+$$
+
+where $\begin{array} { r } { A _ { i } ^ { j } = \sum _ { m = 1 } ^ { M _ { i } } \frac { e x p ( \alpha _ { m } ) } { \sum _ { m = 1 } ^ { M _ { i } } e x p ( \alpha _ { m } ) } h _ { i } ^ { ' m } } \end{array}$ h 0 m , $h _ { i } ^ { ' m } = a R N N ( E ( X _ { i } ^ { m } ) , h _ { i } ^ { ' m - 1 } ) , h ^ { ' }$ is the hidden state of the attention RNN and $\alpha _ { k }$ is either a logit projection of $( h _ { i } ^ { j - 1 } , h _ { i } ^ { ' m } )$ in the case of Bahdanau et al. (2015) or $( h _ { i } ^ { j - 1 } ) ^ { T } \cdot h _ { i } ^ { ' m }$ in the case of Luong et al. (2015). The modified HRED architecture is shown in Figure 2.
+
+Noise Injection: We inject Gaussian noise at the input of the decoder RNN. Noise samples could be injected at the utterance or word level. With noise injection, the conditional probability of the decoder output becomes
+
+$$
+P _ { \theta _ { G } } \left( Y _ { i } ^ { j } | X _ { i + 1 } ^ { 1 : j - 1 } , Z _ { i } ^ { j } , \boldsymbol { X } _ { i } \right) = d R N N \left( E ( X _ { i + 1 } ^ { j - 1 } ) , h _ { i } ^ { j - 1 } , A _ { i } ^ { j } , Z _ { i } ^ { j } , h _ { i } \right)
+$$
+
+where $Z _ { i } ^ { j } \sim \mathcal { N } _ { i } ( 0 , I )$ , for utterance-level noise and $Z _ { i } ^ { j } \sim \mathcal { N } _ { i } ^ { j } ( 0 , I )$ , for word-level noise.
+
+# 2.3 DISCRIMINATOR
+
+The discriminator shares context and word embedding with the generator and can discriminate at the word level (Lamb et al., 2016). The word-level discrimination is achieved through a bidirectional RNN and is able to capture both syntactic and conceptual differences between the generator output
+
+
+Figure 2: The HRED generator with local attention - The attention RNN ensures local relevance while the context RNN ensures global relevance. Their states are combined to initialize the decoder RNN and the discriminator BiRNN.
+
+and the ground truth. The aggregate classification of an input sequence, $\chi$ can be factored over word-level discrimination and expressed as
+
+$$
+D ( X _ { i } , \chi ) = D ( h _ { i } , \chi ) = \bigg [ \prod _ { j = 1 } ^ { J } D _ { R N N } ( h _ { i } , E ( \chi ^ { j } ) ) \bigg ] ^ { \frac { 1 } { J } }
+$$
+
+where $D _ { R N N } ( . )$ is the word discriminator RNN, $\boldsymbol { h } _ { i }$ is an encoded vector of the dialogue history $X _ { i }$ obtained from the generator’s $c R N N ( . )$ output, and $\chi ^ { j }$ is the jth word or token of the input sequence $\chi$ . $\chi = Y _ { i }$ and $J = T _ { i }$ for the case of generator’s decoder output, $\chi = X _ { i + 1 }$ and $J = M _ { i + 1 }$ for the case of ground truth. The discriminator architecture is depicted on the left hand side of Figure 1.
+
+2.4 ADVERSARIAL GENERATION OF MULTI-TURN DIALOGUE RESPONSE
+
+In this section, we describe the generation process during inference. The generation objective can be mathematically described as
+
+$$
+Y _ { i } ^ { * } = a r g m a x \left\{ P ( Y _ { i , l } | X _ { i } ) + D ^ { * } ( X _ { i } , Y _ { i , l } ) \right\} _ { l = 1 } ^ { L }
+$$
+
+where $Y _ { i , l } = G ^ { * } ( X _ { i } , Z _ { i , l } )$ , $Z _ { i , l }$ is the lth noise samples at dialogue step $i$ , and $L$ is the number of response samples. Equation 13 shows that our inference objective is the same as the training objective (8), combining both the MLE and adversarial criteria. This is in contrast to existing work where the discriminator is usually discarded during inference.
+
+The inference described by equation 13 is intractable due to the enormous search space of $Y _ { i , l }$ . Therefore, we turn to an approximate solution where we use greedy decoding (MLE) on the first part of the objective function to generate $L$ lists of responses based on noise samples $\{ Z _ { i , l } \} _ { l = 1 } ^ { L }$ . In order to facilitate the exploration of the generator’s latent space, we sample a modified noise distribution, $Z _ { i , l } ^ { j } \sim \mathcal { N } _ { i , l } ( 0 , \alpha I )$ , or $Z _ { i , l } ^ { j } \sim \mathcal { N } _ { i , l } ^ { j } ( 0 , \alpha I )$ where $\alpha > 1 . 0$ , is the exploration factor that increases the noise variance. We then rank the $L$ lists using the discriminator score, $\left\{ D _ { . } ^ { * } ( X _ { i } , Y _ { i , l } ) \right\} _ { l = 1 } ^ { L } .$ . The response with the highest discriminator ranking is the optimum response for the dialogue context.
+
+# 3 TRAINING OF HREDGAN
+
+We trained both the generator and the discriminator simultaneously as highlighted in Algorithm 1 with $\lambda _ { G } = \lambda _ { M } = 1$ . GAN training is prone to instability due to competition between the generator and the discriminator. Therefore, parameter updates are conditioned on the discriminator performance (Lamb et al., 2016).
+
+The generator consists of four RNNs with different parameters, that is, $a R N N , e R N N , c R N N$ and dRNN. aRNN and eRNN are both bidirectional, while $c R N N$ and dRNN are unidirec
+
+# Algorithm 1 Adversarial Learning of hredGAN
+
+Require: A generator $G$ with parameters $\theta _ { G }$ .
+Require: A discriminator $D$ with parameters $\theta _ { D }$ . for number of training iterations do Initialize $c R N N$ to zero state, $\scriptstyle h _ { 0 }$ 0Sample a mini-batch of conversations, $\pmb { X } = \{ X _ { i } \} _ { i = 1 } ^ { N }$ , $\pmb { X _ { i } } = \left( X _ { 1 } , X _ { 2 } , \cdot \cdot \cdot , X _ { i } \right)$ with $N$ utterances. Each utterance mini batch $_ i$ contains $M _ { i }$ word tokens. for $i = 1$ to $N - 1$ do Update the context state. $\begin{array} { r } { \dot { \pmb { h _ { i } } } = c R N N ( e R N N ( E ( X _ { i } ) ) , \pmb { h _ { i - 1 } } ) } \end{array}$ $P _ { \theta _ { G } } \left( Y _ { i } | , Z _ { i } , \boldsymbol { X } _ { i } \right) = \left\{ P _ { \theta _ { G } } \left( Y _ { i } ^ { j } | \boldsymbol { X } _ { i + 1 } ^ { 1 : j - 1 } , Z _ { i } ^ { j } , \boldsymbol { X } _ { i } \right) \right\} _ { j = 1 } ^ { M _ { i + 1 } }$ $Y _ { i }$ $Y _ { i } \stackrel { \cdot } { \sim } P _ { \theta _ { G } } ( Y _ { i } | , Z _ { i } , \stackrel { \cdot } { X } _ { i } )$ end forCompute the discriminator accuracy $D _ { a c c }$ over $N - 1$ utterances $\{ Y _ { i } \} _ { i = 1 } ^ { N - 1 }$ 1 nd {Xi+1}N−1i=1 a Update $\theta _ { D }$ with gradient of the discriminator loss. $\underset { i } { \overset { \cdot } { \sum } } [ \nabla _ { \theta _ { D } } \log \bar { D ( } h _ { i } , X _ { i + 1 } ) + \nabla _ { \theta _ { D } } l o g \big ( 1 - D ( h _ { i } , Y _ { i } ) \big ) ]$ end if if $D _ { a c c } < a c c _ { G _ { t h } }$ Update $\begin{array} { r } { { \prec } \ { a c c } _ { G _ { t } } } \\ { \ \mathrm { e } \ \theta _ { G } \ \mathrm { w i t } } \end{array}$ with the generator’s MLE loss only. then $\underset { i } { \mathop { \sum } } [ \nabla _ { \theta _ { G } } \log P _ { \theta _ { G } } ( Y _ { i } | , Z _ { i } , \mathbf { X } _ { i } ) ]$ else Update $\theta _ { G }$ with both adversarial and MLE losses. $\sum _ { i } [ \lambda _ { G } \nabla _ { \theta _ { G } }$ log $D ( h _ { i } , Y _ { i } ) + \lambda _ { M } \nabla _ { \theta _ { G } }$ l $\arg P _ { \theta _ { G } } ( Y _ { i } | , Z _ { i } , X _ { i } ) ]$ end if end for
+
+tional. Each RNN has 3 layers, and the hidden state size is 512. The dRNN and $a R N N$ are connected using an additive attention mechanism (Bahdanau et al., 2015).
+
+The discriminator shares $a R N N , e R N N$ , and $c R N N$ with the generator. $D _ { R N N }$ , is a stacked bidirectional RNN with 3 layers and a hidden state size of 512. The $c R N N$ states are used to initialize the states of $D _ { R N N }$ . The output of both the forward and the backward cells for each word are concatenated and passed to a fully-connected layer with binary output. The output is the probability that the word is from the ground truth given the past and future words of the sequence.
+
+Others: All RNNs used are gated recurrent unit (GRU) cells (Cho et al., 2014). The word embedding size is 512 and shared between the generator and the discriminator. The initial learning rate is 0.5 with decay rate factor of 0.99, applied when the adversarial loss has increased over two iterations. We use a batch size of 64 and clip gradients around 5.0. As in Lamb et al. (2016), we find $a c c _ { D _ { t h } } = 0 . 9 9$ and $a c c _ { G _ { t h } } = 0 . 7 5$ to be good enough. All parameters are initialized with Xavier uniform random initialization (Glorot & Bengio, 2010). The vocabulary size $V$ is 50, 000. Due to the large vocabulary size, we use sampled softmax loss (Jean et al., 2015) for MLE loss to expedite the training process. However, we use full softmax for evaluation. The model is trained end-to-end using the stochastic gradient descent algorithm.
+
+# 4 EXPERIMENTS AND RESULTS
+
+We consider the task of generating dialogue responses conditioned on the dialogue history and the current input utterance. We compare the proposed hredGAN model against some alternatives on publicly available datasets.
+
+# 4.1 DATASETS
+
+Movie Triples Corpus, (MTC) dataset (Serban et al., 2016). This dataset was derived from the Movie-DiC dataset by Banchs (2012). Although this dataset spans a wide range of topics with few spelling mistakes, its small size of only about 240,000 dialogue triples makes it difficult to train a dialogue model, as pointed out by Serban et al. (2016). We thought that this scenario would really benefit from the proposed adversarial generation.
+
+Ubuntu Dialogue Corpus, (UDC) dataset (Serban et al., 2017b). This dataset was extracted from the Ubuntu Relay Chat Channel. Although the topics in the dataset are not as diverse as in the MTC, the dataset is very large, containing about 1.85 million conversations with an average of 5 utterances per conversation.
+
+We split both MTC and UDC into training, validation, and test sets, using $90 \%$ , $5 \%$ , and $5 \%$ proportions, respectively. We performed minimal preprocessing of the datasets by replacing all words except the top 50,000 most frequent words by an UNK symbol.
+
+# 4.2 EVALUATION METRICS
+
+Accurate evaluation of dialogue models is still an open challenge. In this paper, we employ both automatic and human evaluations.
+
+# 4.2.1 AUTOMATIC EVALUATION
+
+We employed some of the automatic evaluation metrics that are used in probabilistic language and dialogue models, and statistical machine translation. Although these metrics may not correlate well with human judgment of dialogue responses (Liu et al., 2016), they provide a good baseline for comparing dialogue model performance.
+
+Perplexity - For a model with parameter $\theta$ , we define perplexity as:
+
+$$
+e x p \bigg [ - \frac { 1 } { N _ { W } } \sum _ { k = 1 } ^ { K } l o g P _ { \theta } ( Y _ { 1 } , Y _ { 2 } , \ldots , Y _ { N _ { k } - 1 } ) \bigg ]
+$$
+
+where $K$ is the number of conversations in the dataset, $N _ { k }$ is the number of utterances in conversation $k$ , and $N _ { W }$ is the total number of word tokens in the entire dataset. The lower the perplexity, the better. The perplexity measures the likelihood of generating the ground truth given the model parameters. While a generative model can generate a diversity of responses, it should still assign a high probability to the ground truth utterance.
+
+BLEU - The BLEU score, (Papineni et al., 2002) provides a measure of overlap between the generated response (candidate) and the ground truth (reference) using a modified n-gram precision. According to Liu et. al. (Liu et al., 2016), BLEU-2 score is fairly correlated with human judgment for non-technical dialogue (such as MTC).
+
+ROUGE - The ROUGE score, (Lin, 2014) is similar to BLEU but it is recall oriented instead. It is used for automatic evaluation of text summarization and machine translation. To compliment the BLEU score, we use ROUGE-N with $N = 2$ for our evaluation.
+
+Distinct n-gram - This is the fraction of unique n-grams in the generated responses. It provides a measure of diversity. Models with higher number of distinct n-grams tend to produce more diverse responses (Li et al., 2016a). For our evaluation, we use 1- and 2- grams.
+
+Normalized Average Sequence Length (NASL) - This measures the average number of words in model generated responses normalized by the average number of words in the groundtruth.
+
+# 4.2.2 HUMAN EVALUATION
+
+For human evaluation, we follow a similar setup as Li et al. (2016a), employing crowd-sourced judges to evaluate a random selection of 200 samples. We present both the multi-turn context and the generated responses from the models to 3 judges and asked them to rank the general response quality in terms of relevance and informativeness. For $N$ models, the model with the lowest quality is assigned a score 0 and the highest is assigned a score N-1. Ties are not allowed. The scores are normalized between 0 and 1 and averaged over the total number of samples and judges.
+
+# 4.3 BASELINE
+
+We compare the performance of our model to (V)HRED (Serban et al., 2016; 2017b), since they are the closest to our approach in implementation and are the current state of the art in open-domain dialogue models. HRED is very similar to our proposed generator, but without the input utterance attention and noise samples. VHRED introduces a latent variable to the HRED between the $c R N N$ and the dRNN and was trained using the variational lower bound on the log-likelihood.
+
+Table 1: Generator Performance Evaluation
+
+
Model
Teacher Forcing
Autoregression
Human Evaluation
Perplexity
-logD(G(.))
BLEU-2
ROUGE-2
DISTINCT-1/2
NASL1
MTC
HRED
31.92/36.00
NA
0.0474
0.0384
0.0026/0.0056
0.535
0.2560
VHRED
42.61/44.97
NA
0.0606
0.1181
0.0048/0.0163
0.831
0.3909
hredGAN_u
23.57/23.54
23.57/23.54
0.0493
0.2416
0.0167/0.1306
0.884
0.5582
hredGAN_w
24.20/24.14
13.35/13.40
0.0613
0.3244
0.0179/0.1720
1.540
0.7869
UDC
HRED
69.39/86.40
NA
0.0177
0.0483
0.0203/0.0466
0.892
0.3475
VHRED
98.50/105.20
NA
0.0171
0.0855
0.0297/0.0890
0.873
0.4046
hredGAN_u
56.82/57.32
10.09/10.08
0.0137
0.0716
0.0260/0.0847
1.379
0.6133
hredGAN_w
47.73/48.18
8.37/8.36
0.0216
0.1168
0.0516/0.1821
1.098
0.6905
+
+The VHRED can generate multiple responses per context like hredGAN, but has no specific criteria for selecting the best response.
+
+The HRED and VHRED models are both trained using the Theano-based implementation obtained from https://github.com/julianser/hed-dlg-truncated. The training and validation sets used for UDC and MTC dataset were obtained directly from the authors1 of (V)HRED. For model comparison, we use a test set that is disjoint from the training and validation sets.
+
+# 4.4 RESULTS
+
+We have two variants of hredGAN based on the noise injection approach, i.e., hredGAN with utterance-level (hredGAN u) and word-level (hredGAN w) noise injections.
+
+We compare the performance of these two variants with HRED and VHRED models.
+
+Perplexity: The average perplexity per word performance of all the four models on MTC and UDC datasets (validation/test) are reported in the first column on Table 1. The table indicates that both variants of the hredGAN model perform better than the HRED and VHRED models in terms of the perplexity measure. However, using the adversarial loss criterion (Eq. equation 8), the hredGAN u model performs better on MTC and worse on UDC. Note that, for this experiment, we run all models in teacher forcing mode.
+
+Generation Hyperparameter: For adversarial generation, we perform a linear search for $\alpha$ between 1 and 20 at an increment of 1 using Eq. equation 13, with sample size $L = 6 4$ , on validation sets with models run in autoregression. The optimum values of $\alpha$ for hredGAN u and hredGAN w for UDC are 7.0 and 9.0 respectively. The values for MTC are not convex, probably due to small size of the dataset, so we use the same $\alpha$ values as UDC. We however note that for both datasets, any integer value between 3 and 10 (inclusive) works well in practice.
+
+Quantitative Generator Performance: We run autoregressive inference for all the models (using optimum $\alpha$ values for hredGAN models and selecting the best of $L = 6 4$ responses using a discriminator) with dialogue contexts from a unique test set. Also, we compute the average BLEU-2, ROUGE-2(f1), Distinct(1/2) and normalized average sequence length (NASL) scores for each model and summarize the results in the middle of Table 1. Distinct(1/2) largely agrees with the perplexity score. Most scores, similar to the perplexity, indicate that hredGAN models perform better than (V)HRED on both datasets. However, on the UDC and MTC, ROUGE and BLUE, respectively scores VHRED slightly better than hredGAN u but still worse than hredGAN w.
+
+A good dialogue model should find the right balance between precision (BLEU) and diversity. We strongly believe that our adversarial approach is better suited to solving this problem. As hredGAN generators explore diversity, the discriminator ranking gives hredGAN an edge over (V)HRED because it helps detect responses that are out of context and the natural language structure (Table 2). Also, the ROGUE(f1) performance indicates that hredGAN w strikes a better balance between precision (BLEU) and diversity than the rest of the models. This is also obvious from the quality of generated responses.
+
+Table 2: Example of Discriminator Ranking with hredGAN w
+
+
Item
D(G(.))
Utterance
MTC
Context_0
NA
perhaps <person> had a word with the man upstairs.
Context_1
NA
a word ?i’m sure by now he’s engineered a hostile takeover .
Response_0 0.996
<person>,i know what you’re saying, <person>,that’s not whati’m saying.
Response-1 0.991
<person>,i know .i was just about to help
Response_2 0.315
the guy. <person>,i'm sorry.
Response_3
0.203
<person>,i’ma litle out .
Context_0
NA
says he wanted food.<person>.he wanted the gold .
Context_1
NA
how’s he going to want the gold ? he couldn ' t even know we had it.
Response_0 0.998
<person>,i know .but it’s not him,it’s the only way he’s got it all figured
Response_1 0.981
<person>,i know.but i have to tell you . these things are really stupid and you think i
Response_2 0.690
was wrong ? <person>,i'm sure he did.
Response-3 0.314
<person>,i'm not sure
UDC
Context_0
NA
The netboot one is suppose to download pack-
Context_1
NA
ages from the net. like the ones to be installed? or the installed to be run?
Response_O 0.993
you don ’t need to install the whole system , just install the ubuntu installer
Response-1 0.952
you can install the ubuntu installer from the
Response_2 0.749
ubuntu menu I'm not sure ,I don ’t know .
Response_3
0.184
you can
Response_4
0.003
youa. 1.
Context_0
NA
DJones: update manager won't detect 12.04.1 as a new version if you are already running 12.04, because 12.04.1 = 12.04 + lots of pack-
Response_0 0.991
age updates did you try a clean install of the latest version ?
Response_1 0.981
try installing the latest_UNK and see if it works
Response_2 0.615
I’m not sure you have a problem..
Response_3 0.191
try sudo apt-get remove the package that is not
Response_4 0.002
installed try the-UNK.1.1.1.1.1.-UNK.deb
+
+Table 3: Sample responses of HRED, VHRED and hredGAN.
+
+
Movie
Context_0 HRED VHRED
perhaps <person> had a word with the man upstairs . i'm sorry,<person>. <person<'tdo it. hredGAN_w<person>,i’m not gon na be okay.i just don ’t think it’s a
Context_1 HRED VHRED
good idea. hredGAN.u <person>,icause it was allthe way to you. a word ?i'm sure by now he’s engineered a hostile takeover . i'm sorry,<person>. <person>'tdo it.
hredGAN_w<person>,i know what you ’re saying,<person>,that’s not whati’m saying. hredGAN_u <person>,i have to tell youi’m not the same.
Context_0 HRED VHRED
<person>’s. i'm sorry,<person>.
<person>'tdo it . hredGAN_w <person>,i’m sure it’s the only thing i ever imagined .
hredGAN_u <person>,i'l be right there .
Context_1
can i ask you something about her ?
HRED
idon'tknow .
VHRED:
you’re not going to be here .
hredGAN_widon’tknow.i thinki’ve heard of it.
hredGAN-ui’m sorry,ican 't.
Ubuntu
Context_0
this is Dacs i am in i used 'sudo statx and it let me in
HRED
what's the problem ?
VHRED
I don't know what you want to do .if you want to do it,you need to
do it to do it in the terminal ?
hredGAN-w you don’t have to do anything,just type in the terminal and it
should be to find the right device
hredGAN_u you can have a look at the output of the command .
Context.1
good deal... cat /etc/X11/default-display-manager
HRED
what's the problem ?
VHRED
do you know what you want to do ?
hredGAN_w I’m trying to figure a command that I can find to find out the file
that Ican find in the file"
hredGAN-u Idon 't see the point,but I’m not sure how to do that .
Context_2
/usr/sbin/lightdmhttp://paste.ubuntu.com/1286224/
/etc/X1/xorg.conf
HRED
what 's the problem ?
VHRED
is there a way to do that in the terminal ?
hredGAN_w did you just type\”sudo mount -a\”?
hredGAN-u i have no idea,i just installed ubuntu and i have no idea how to do
that
+
+Qualitative Generator Performance: The results of the human evaluation is reported in the last column of Table 1. The human evaluation agrees largely with the automatic evaluation. The hredGAN w performs best on both datasets although the gap is more on the MTC than on the UTC. This implies that the improvement of HRED with adversarial generation is better than with variational generation (VHRED). In addition, looking at the actual samples from the generator outputs in Table 6 shows that hredGAN especially hredGAN w performs better than (V)HRED. While other models produce short and generic utterances, hredGAN w mostly yields informative responses. For example, in the first dialogue in Table 6, when the speaker is sarcastic about ”the man upstairs”, hredGAN w responds with the most coherent utterance with respect to the dialogue history. We see similar behavior across other samples. We also note that although hredGAN u’s responses are the longest on Ubuntu (in line with the NASL score), the responses are less informative compared to hredGAN w resulting into a lower human evaluation score. We reckon this might be due to a mismatch between utterance-level noise and word-level discrimination or lack of capacity to capture the data distribution using single noise distribution. We hope to investigate this further in the future.
+
+Discriminator Performance: Although only hredGAN uses a discriminator, the observed discriminator behavior is interesting. We observe that the discriminator score is generally reasonable with longer, more informative and more persona-related responses receiving higher scores as shown in Table 2. It worth to note that this behavior, although similar to the behavior of a human judge is learned without supervision. Moreover, the discriminator seems to have learned to assign average score to more frequent or generic responses such as “I don’t know”, “I’m not sure” and so on, and high score to rearer answers. That’s why we sample a modified noise distribution during inference so that the generator can produce rearer utterances that will be scored high by the discriminator.
+
+# 5 CONCLUSION AND FUTURE WORK
+
+In this paper, we have introduced an adversarial learning approach that addresses response diversity and control of generator outputs, using an HRED-derived generator and discriminator. The proposed system outperforms existing state-of-the-art (V)HRED models for generating responses in multiturn dialogue with respect to automatic and human evaluations. The superiority of the adversarial generation (hredGAN) over the variational generation (VHRED) is in line with other generative models employing these approaches. Our analysis also concludes that the word-level noise injection seems to perform better in general.
+
+While this is a good starting point, we recognize the need to explore further improvements to the proposed adversarial framework: In the future, we hope to: explore which noise level works with which discrimination level; consider a multi-resolution discriminator with combined word- and utterancelevel discriminations; and explore further tuning of the generator and discriminator models.
+
+# REFERENCES
+
+D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of International Conference of Learning Representation (ICLR 2015), 2015.
+R. E. Banchs. Movie-dic: A movie dialogue corpus for research and development. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics, pp. 203–207, 2012.
+E. Bruni and R. Fernndez. Adversarial evaluation for open-domain dialogue generation. In Proceedings of the 18th Annual SIGdial Meeting, 2018.
+T. Che, Y. Li, R. Zhang, R. D. Hjelm, W. Li, Y. Song, and Y. Bengio. Maximum-likelihood augmented discrete generative adversarial networks. In arXiv preprint arXiv:1702.07983, 2017.
+K. Cho, B. Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In Proceedings of International Conference of Learning Representation (ICLR 2015), pp. 1724– 1734, 2014.
+X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. In International conference on artificial intelligence and statistics, 2010.
+I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Proceedings of Advances in Neural Information Processing Systems (NIPS 2014), 2014.
+P. Isola, J. Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In Conference on Computer Vision and Pattern Recognition (CVPR, 2017), 2017.
+S. Jean, K. Cho, R. Memisevic, and Y. Bengio. On using very large target vocabulary for neural machine translation. In arXiv preprint arXiv:1412.2007, 2015.
+A. Kannan and O. Vinyals. Adversarial evaluation of dialogue models. In arXiv preprint arXiv:1701.08198v1, 2017.
+A. Lamb, A. Goyah, Y. Zhang, S. Zhang, A. Courville, and Y. Bengio. Professor forcing: A new algorithm for training recurrent networks. In Proceedings of Advances in Neural Information Processing Systems (NIPS 2016), 2016.
+J. Li, M. Galley, C. Brockett, J. Gao, and B. Dolan. A diversity-promoting objective function for neural conversation models. In Proceedings of NAACL-HLT, 2016a.
+J. Li, W. Monroe, A. Ritter, M. Galley, J. Gao, and D. Jurafsky. Deep reinforcement learning for dialogue generation. In arXiv preprint arXiv:arXiv:arXiv:1606.01541v4, 2016b.
+J. Li, W. Monroe, T. Shi, A. Ritter, and D. Jurafsky. Adversarial learning for neural dialogue generation. In arXiv preprint arXiv:1701.06547, 2017.
+C. Y. Lin. Rouge: a package for automatic evaluation of summaries. In Proceedings of the Workshop on Text Summarization Branches Out, 2014.
+C. Liu, R. Lowe, I. V. Serban, M. Noseworthy, L. Charlin, and J. Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. In Proceedings of EMNLP, pp. 2122–2132, 2016.
+M. T. Luong, I. Sutskever, Q. V. Le, O. Vinyals, and W. Zaremba. Addressing the rare word problem in neural machine translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics, 2015.
+K. Papineni, S. Roukos, T. Ward, and W. Zhu. Bleu: A method for automatic evalution of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pp. 311–318, 2002.
+I. Serban, A. Sordoni, Y. Bengio, A. Courville, and J. Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In Proceedings of The Thirtieth AAAI Conference on Artificial Intelligence (AAAI 2016), pp. 3776–3784, 2016.
+I. V. Serban, T. Klinger, G. Tesauro, K. Talamadupula, B. Zhou, Y. Bengio, and A. Courville. Multiresolution recurrent neural networks: An application to dialogue response generation. In Proceedings of The Thirty-first AAAI Conference on Artificial Intelligence (AAAI 2017), 2017a.
+I. V. Serban, A. Sordoni, R. Lowe, L. Charlin, J. Pineau, A. Courville, and Y. Bengio. A hierarchical latent variable encoder-decoder model for generating dialogue. In Proceedings of The Thirty-first AAAI Conference on Artificial Intelligence (AAAI 2017), 2017b.
+I. Sutskever, O. Vinyals, and Q. Le. Sequence to sequence learning with neural networks. In Proceedings of Advances in Neural Information Processing Systems (NIPS), pp. 3104–3112, 2014.
+O. Vinyals and Q. Le. A neural conversational model. In Proceedings of ICML Deep Learning Workshop, 2015.
+R. J. Williams and D. Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280, 1989.
+C. Xing, W. Wu, Y. Wu, M. Zhou, Y. Huang, and W. Ma. Hierarchical recurrent attention network for response generation. In arXiv preprint arXiv:1701.07149, 2017.
+Z. Xu, B. Liu, B. Wang, S. Chengjie, X. Wang, Z. Wang, and C. Qi. Neural response generation via gan with an approximate embedding layer. In EMNLP, 2017.
+L. Yu, W. Zhang, J. Wang, and Y. Yu. Seqgan: sequence generative adversarial nets with policy gradient. In Proceedings of The Thirty-first AAAI Conference on Artificial Intelligence (AAAI 2017), 2017.
+Y. Zhang, Z. Gan, K. Fan, Z. Chen, R. Henao, D. Shen, and L. Carin. Adversarial feature matching for text generation. In arXiv preprint arXiv:1706.03850, 2017.
+Y. Zhang, M. Galley, J. Gao, Z. Gan, X. Li, C. Brockett, and B. Dolan. Generating informative and diverse conversational responses via adversarial information maximization. In arXiv preprint arXiv:arXiv:1809.05972v5, 2018.
+
+# APPENDIX
+
+# 6 RELATED WORK
+
+Our work is related to end-to-end neural network–based open domain dialogue models. Most neural dialogue models use transduction frameworks adapted from neural machine translations (Sutskever et al., 2014; Bahdanau et al., 2015). These $\mathtt { S e q 2 S e q }$ networks are trained end-to-end with MLE criteria using large corpora of human-to-human conversation data. Others use GAN’s discriminator as a reward function in a reinforcement learning framework (Yu et al., 2017) and in conjunction with MLE (Li et al., 2017; Che et al., 2017). Zhang et al. (2017) explored the idea of GAN with a feature matching criterion. Xu et al. (2017) and Zhang et al. (2018) employed GAN with an approximate embedding layer as well as with adversarial information maximization respectively to improve Seq2Seq’s diversity performance.
+
+Still, $\mathtt { S e q 2 S e q }$ models are limited in their ability to capture long temporal dependencies in multiturn conversation. Although, Li et al. (2016b) attempted to optimize a pair Seq2Seq models for multi-turn dialogue, the multi-turn objective is only applied at inference and not used for actual model training. Hence, the introduction of HRED models (Serban et al., 2016; 2017a;b; Xing et al., 2017) for modeling dialogue response in multi-turn conversations. However, these HRED models suffer from lack of diversity since they are trained with only MLE criteria. On other hand, adversarial system has been used for evaluating open domain dialogue models (Bruni & Fernndez, 2018; Kannan & Vinyals, 2017). Our work, hredGAN is closest to the combination of HRED generation models (Serban et al., 2016) and adversarial evaluation (Kannan & Vinyals, 2017).
+
+Table 4: Generator Performance: HRED vs. HRED $^ +$ Attn
+
+
Model
Teacher Forcing Perplexity
Autoregression
BLEU-2
ROUGE-2
DISTINCT-1/2
NASL
MTC HRED
31.92/36.00
HRED+Attn
26.09/26.41
0.0474 0.0425
0.0384
0.0026/0.0056
0.535
0.2239
0.0397/0.1567
0.527
UDC
HRED
69.39/86.40
0.0177
0.0483
0.0203/0.0466
0.892
HRED+Attn
50.82/51.31
0.0140
0.0720
0.0473/0.1262
0.760
+
+# 7 ABLATION EXPERIMENTS
+
+Before proposing the above adversarial learning framework for multi-turn dialogue, we carried out some experiments that are highlighted here.
+
+# 7.1 GENERATOR:
+
+First, we noted that by adding an additional attention memory to the HRED generator, we improved the test set perplexity score by more than 8 and 20 points on the MTC and UDC respectively as shown in Table 4. The addition of attention also shows a strong performance at autoregressive inference across multiple metrics as well as observed improvement in response quality. Hence, the decision for the modified HRED generator.
+
+The adversarial training, however helps to address the lack diversity observed in the generated responses.
+
+# 7.2 DISCRIMINATOR:
+
+Before deciding on the word-level discrimination, we experimented with utterance-level discrimination. The utterance-level discriminator trains very quickly but it leads to mostly generic responses from the generator. We also note that utterance-level discriminator scores are mostly extreme (i.e.,
+
+either low or high). Since we had used convolutional neural network discriminator (Yu et al., 2017) in our experiments, we hope to investigate this further with other architectures.
+
+# 7.3 ADVERSARIAL TRAINING:
+
+Lastly, we also tried a basic policy gradient approach (Li et al., 2017), where word-level discriminator score is used as a reward for each generated word token, but this leads to training instability. This is probably due to the instability of Monte Carlo sampling over large vocabulary size. We believe this might improve with other sampling methods such as importance sampling and hope to investigate further in the future.
+
+# 8 OTHER GENERATED SAMPLES
+
+Table 5: Additional sample responses of HRED, VHRED and hredGAN on Movie.
+
+
Movie
Context.0 HRED
<person>i've raised my rate.imight even cut my sessions to forty minutes
what 's the problem ? I don't know what you want to do
hredGAN_w
I have no idea,I’m just trying to get the ip address from the router to the router"
hredGAN_u
I'm not sure if that’sthe case,butI’m not sure if it’sa good idea to have a look at the output .
Context_0
The netboot one is suppose to download packages from the net.
HRED
I don't know what you want to do .
VHRED
how do I do that ? I'm not sure of a command to do so Ican just install the ubuntu .iso and burn a new iso
hredGAN_w hredGAN_u
you can 't have a look at the man page ...
Context_0
The netboot one is suppose to download packages from the net.
Context_1
like the ones to be installed? or the installed to be run?
HRED
I don't know what the problem is .
VHRED
is there a way to install the package manager ?
hredGAN_w hredGAN_u
you don ’t need to install the whole system, just install the ubuntu installer I'm trying to installa -UNK version of ubuntu,butI'm trying to install it on my laptop
Context_0
You trying to mount it open with the password?
HRED
Ihave to do that,butI have a problem with the same problem. is there a way to do ?
VHRED
yes,I'm not sure if it’s mounted or not
hredGAN_w
I'm trying to install the latest version of Ubuntu,butI'm running on a -UNK
hredGAN-u
Context_0
are you using lvm for your root partition?
HRED
yes,but I have a problem with a new user,butI don't want to do that.
VHRED
what is the best way to do that ?what is that ?
hredGAN_w
yes,I'm on alive system,I’m trying to use the partition to boot from windows
hredGAN_u
I'm not sure if it’s a good idea to have a backup of the system..
Context.0
are you using lvm for your root partition?
Context_1
ihavethesameofgorkigoa04box.Itppearsin2.04lvisonustartandutipathisnotidouselforyootderifty is thereanywaytworkarounditaveyuhardofayonepostingaugabouthistohaveitookedtdar.welliopethycanfiis
yes,becauseicantsupply itatboottime,i wantthe truecrypt drive to come up by itself without manual intervention
Context_3
Kinda defeats the use of it anyone could get in don't you think?
HRED
what is the problem ?
VHRED
is there a way to mount the file ?if you want to do it ?
hredGAN_w
I have no idea,I just want to get the data from the other computer
I'm trying to getthe latest driver from the nvidia driver,butI’m trying to get the nvidia driver working
hredGAN_u
\ No newline at end of file
diff --git a/md/train/SSnY462CYz1Cu/SSnY462CYz1Cu.md b/md/train/SSnY462CYz1Cu/SSnY462CYz1Cu.md
new file mode 100644
index 0000000000000000000000000000000000000000..c01c27312bed5a91c5e0697e183b54ca22d0faf0
--- /dev/null
+++ b/md/train/SSnY462CYz1Cu/SSnY462CYz1Cu.md
@@ -0,0 +1,558 @@
+# Knowledge Matters: Importance of Prior Information for Optimization
+
+C¸ a˘glar G¨ul¸cehre D´epartement d’informatique et de recherche op´erationnelle Universit´e de Montr´eal, Montr´eal, QC, Canada
+
+gulcehrc@iro.umontreal.ca
+
+Yoshua Bengio D´epartement d’informatique et de recherche op´erationnelle Universit´e de Montr´eal, Montr´eal, QC, Canada
+
+bengioy@iro.umontreal.ca
+
+Editor: Not Assigned
+
+# Abstract
+
+We explore the effect of introducing prior information into the intermediate level of deep supervised neural networks for a learning task on which all the black-box state-of-the-art machine learning algorithms tested have failed to learn. We motivate our work from the hypothesis that there is an optimization obstacle involved in the nature of such tasks, and that humans learn useful intermediate concepts from other individuals via a form of supervision or guidance using a curriculum. The experiments we have conducted provide positive evidence in favor of this hypothesis. In our experiments, a two-tiered MLP architecture is trained on a dataset for which each image input contains three sprites, and the binary target class is 1 if all three have the same shape. Black-box machine learning algorithms only got chance on this task. Standard deep supervised neural networks also failed. However, using a particular structure and guiding the learner by providing intermediate targets in the form of intermediate concepts (the presence of each object) allows to nail the task. Much better than chance but imperfect results are also obtained by exploring architecture and optimization variants, pointing towards a difficult optimization task. We hypothesize that the learning difficulty is due to the composition of two highly non-linear tasks. Our findings are also consistent with hypotheses on cultural learning inspired by the observations of effective local minima (possibly due to ill-conditioning and the training procedure not being able to escape what appears like a local minimum).
+
+Keywords: Deep Learning, Neural Networks, Optimization, Evolution of Culture, Curriculum Learning, Training with Hints
+
+# 1. Introduction
+
+There is a recent emerging interest in different fields of science for cultural learning (Henrich and McElreath, 2003) and how groups of individuals exchanging information can learn in ways superior to individual learning. This is also witnessed by the emergence of new research fields such as ”Social Neuroscience”. Learning from other agents in an environment by the means of cultural transmission of knowledge with a peer-to-peer communication is an efficient and natural way of acquiring or propagating common knowledge. The most popular belief on how the information is transmitted between individuals is that bits of information are transmitted by small units, called memes, which share some characteristics of genes, such as self-replication, mutation and response to selective pressures (Dawkins, 1976).
+
+This paper is based on the hypothesis (which is further elaborated in Bengio (2013a)) that human culture and the evolution of ideas have been crucial to counter an optimization issue: this difficulty would otherwise make it difficult for human brains to capture high level knowledge of the world without the help of other educated humans. In this paper machine learning experiments are used to investigate some elements of this hypothesis by seeking answers for the following questions: are there machine learning tasks which are intrinsically hard for a lone learning agent but that may become very easy when intermediate concepts are provided by another agent as additional intermediate learning cues, in the spirit of Curriculum Learning (Bengio et al., 2009b)? What makes such learning tasks more difficult? Can specific initial values of the neural network parameters yield success when random initialization yield complete failure? Is it possible to verify that the problem being faced is an optimization problem or with a regularization problem? These are the questions discussed (if not completely addressed) here, which relate to the following broader question: how can humans (and potentially one day, machines) learn complex concepts?
+
+In this paper, results of different machine learning algorithms on an artificial learning task involving binary 64 $\times$ 64 images are presented. In that task, each image in the dataset contains 3 Pentomino tetris sprites (simple shapes). The task is to figure out if all the sprites in the image are the same or if there are different sprite shapes in the image. Several state-of-the-art machine learning algorithms have been tested and none of them could perform better than a random predictor on the test set. Nevertheless by providing hints about the intermediate concepts (the presence and location of particular sprite classes), the problem can easily be solved where the same-architecture neural network without the intermediate concepts guidance fails. Surprisingly, our attempts at solving this problem with unsupervised pre-training algorithms failed solve this problem. However, with specific variations in the network architecture or training procedure, it is found that one can make a big dent in the problem. For showing the impact of intermediate level guidance, we experimented with a two-tiered neural network, with supervised pre-training of the first part to recognize the category of sprites independently of their orientation and scale, at different locations, while the second part learns from the output of the first part and predicts the binary task of interest.
+
+The objective of this paper is not to propose a novel learning algorithm or architecture, but rather to refine our understanding of the learning difficulties involved with composed tasks (here a logical formula composed with the detection of object classes), in particular the training difficulties involved for deep neural networks. The results also bring empirical evidence in favor of some of the hypotheses from Bengio (2013a), discussed below, as well as introducing a particular form of curriculum learning (Bengio et al., 2009b).
+
+Building difficult AI problems has a long history in computer science. Specifically hard AI problems have been studied to create CAPTCHA’s that are easy to solve for humans, but hard to solve for machines (Von Ahn et al., 2003). In this paper we are investigating a difficult problem for the off-the-shelf black-box machine learning algorithms.1
+
+# 1.1 Curriculum Learning and Cultural Evolution Against Effective Local Minima
+
+What Bengio (2013a) calls an effective local minimum is a point where iterative training stalls, either because of an actual local minimum or because the optimization algorithm is unable (in reasonable time) to find a descent path (e.g., because of serious ill-conditioning). In this paper, it is hypothesized that some more abstract learning tasks such as those obtained by composing simpler tasks are more likely to yield effective local minima for neural networks, and are generally hard for general-purpose machine learning algorithms.
+
+The idea that learning can be enhanced by guiding the learner through intermediate easier tasks is old, starting with animal training by shaping (Skinner, 1958; Peterson, 2004; Krueger and Dayan, 2009). Bengio et al. (2009b) introduce a computational hypothesis related to a presumed issue with effective local minima when directly learning the target task: the good solutions correspond to hard-to-find-by-chance effective local minima, and intermediate tasks prepare the learner’s internal configuration (parameters) in a way similar to continuation methods in global optimization (which go through a sequence of intermediate optimization problems, starting with a convex one where local minima are no issue, and gradually morphing into the target task of interest).
+
+In a related vein, Bengio (2013a) makes the following inferences based on experimental observations of deep learning and neural network learning:
+
+Point 1: Training deep architectures is easier when some hints are given about the function that the intermediate levels should compute (Hinton et al., 2006; Weston et al., 2008; Salakhutdinov and Hinton, 2009; Bengio, 2009). The experiments performed here expand in particular on this point.
+
+Point 2: It is much easier to train a neural network with supervision (where examples ar provided to it of when a concept is present and when it is not present in a variety of examples) than to expect unsupervised learning to discover the concept (which may also happen but usually leads to poorer renditions of the concept). The poor results obtained with unsupervised pre-training reinforce that hypothesis.
+
+Point 3: Directly training all the layers of a deep network together not only makes it difficult to exploit all the extra modeling power of a deeper architecture but in many cases it actually yields worse results as the number of required layers is increased (Larochelle et al., 2009; Erhan et al., 2010). The experiments performed here also reinforce that hypothesis.
+
+Point 4: Erhan et al. (2010) observed that no two training trajectories ended up in the same effective local minimum, out of hundreds of runs, even when comparing solutions as functions from input to output, rather than in parameter space (thus eliminating from the picture the presence of symmetries and multiple local minima due to relabeling and other reparametrizations). This suggests that the number of different effective local minima (even when considering them only in function space) must be huge.
+
+Point 5: Unsupervised pre-training, which changes the initial conditions of the descent procedure, sometimes allows to reach substantially better effective local minima (in terms of generalization error!), and these better local minima do not appear to be reachable by chance alone (Erhan et al., 2010). The experiments performed here provide another piece of evidence in favor of the hypothesis that where random initialization can yield rather poor results, specifically targeted initialization can have a drastic impact, i.e., that effective local minima are not just numerous but that some small subset of them are much better and hard to reach by chance.2
+
+Based on the above points, Bengio (2013a) then proposed the following hypotheses regarding learning of high-level abstractions.
+
+• Optimization Hypothesis: When it learns, a biological agent performs an approximate optimization with respect to some implicit objective function.
+
+• Deep Abstractions Hypothesis: Higher level abstractions represented in brains require deeper computations (involving the composition of more non-linearities).
+
+• Local Descent Hypothesis: The brain of a biological agent relies on approximate local descent and gradually improves itself while learning.
+
+• Effective Local Minima Hypothesis: The learning process of a single human learner (not helped by others) is limited by effective local minima.
+
+• Deeper Harder Hypothesis: Effective local minima are more likely to hamper learning as the required depth of the architecture increases.
+
+• Abstractions Harder Hypothesis: High-level abstractions are unlikely to be discovered by a single human learner by chance, because these abstractions are represented by a deep subnetwork of the brain, which learns by local descent.
+
+• Guided Learning Hypothesis: A human brain can learn high level abstractions if guided by the signals produced by other agents that act as hints or indirect supervision for these high-level abstractions.
+
+• Memes Divide-and-Conquer Hypothesis: Linguistic exchange, individual learning and the recombination of memes constitute an efficient evolutionary recombination operator in the meme-space. This helps human learners to collectively build better internal representations of their environment, including fairly high-level abstractions.
+
+This paper is focused on “Point 1 ” and testing the “Guided Learning Hypothesis”, using machine learning algorithms to provide experimental evidence. The experiments performed also provide evidence in favor of the “Deeper Harder Hypothesis” and associated “Abstractions Harder Hypothesis”. Machine Learning is still far beyond the current capabilities of humans, and it is important to tackle the remaining obstacles to approach AI. For this purpose, the question to be answered is why tasks that humans learn effortlessly from very few examples, while machine learning algorithms fail miserably?
+
+# 2. Culture and Optimization Difficulty
+
+As hypothesized in the “Local Descent Hypothesis”, human brains would rely on a local approximate descent, just like a Multi-Layer Perceptron trained by a gradient-based iterative optimization. The main argument in favor of this hypothesis relies on the biologically-grounded assumption that although firing patterns in the brain change rapidly, synaptic strengths underlying these neural activities change only gradually, making sure that behaviors are generally consistent across time. If a learning algorithm is based on a form of local (e.g. gradient-based) descent, it can be sensitive to effective local minima (Bengio, 2013a).
+
+When one trains a neural network, at some point in the training phase the evaluation of error seems to saturate, even if new examples are introduced. In particular Erhan et al. (2010) find that early examples have a much larger weight in the final solution. It looks like the learner is stuck in or near a local minimum. But since it is difficult to verify if this is near a true local minimum or simply an effect of strong ill-conditioning, we call such a “stuck” configuration an effective local minimum, whose definition depends not just on the optimization objective but also on the limitations of the optimization algorithm.
+
+Erhan et al. (2010) highlighted both the issue of effective local minima and a regularization effect when initializing a deep network with unsupervised pre-training. Interestingly, as the network gets deeper the difficulty due to effective local minima seems to be get more pronounced. That might be because of the number of effective local minima increases (more like an actual local minima issue), or maybe because the good ones are harder to reach (more like an ill-conditioning issue) and more work will be needed to clarify this question.
+
+As a result of Point 4 we hypothesize that it is very difficult for an individual’s brain to discover some higher level abstractions by chance only. As mentioned in the “Guided Learning Hypothesis” humans get hints from other humans and learn high-level concepts with the guidance of other humans3. Curriculum learning (Bengio et al., 2009a) and incremental learning (Solomonoff, 1989), are examples of this. This is done by properly choosing the sequence of examples seen by the learner, where simpler examples are introduced first and more complex examples shown when the learner is ready for them. One of the hypothesis on why curriculum works states that curriculum learning acts as a continuation method that allows one to discover a good minimum, by first finding a good minimum of a smoother error function. Recent experiments on human subjects also indicates that humans teach by using a curriculum strategy (Khan et al., 2011).
+
+Some parts of the human brain are known to have a hierarchical organization (i.e. visual cortex) consistent with the deep architecture studied in machine learning papers. As we go from the sensory level to higher levels of the visual cortex, we find higher level areas corresponding to more abstract concepts. This is consistent with the Deep Abstractions Hypothesis.
+
+Training neural networks and machine learning algorithms by decomposing the learning task into sub-tasks and exploiting prior information about the task is well-established and in fact constitutes the main approach to solving industrial problems with machine learning. The contribution of this paper is rather on rendering explicit the effective local minima issue and providing evidence on the type of problems for which this difficulty arises. This prior information and hints given to the learner can be viewed as inductive bias for a particular task, an important ingredient to obtain a good generalization error (Mitchell, 1980). An interesting earlier finding in that line of research was done with Explanation Based Neural Networks (EBNN) in which a neural network transfers knowledge across multiple learning tasks. An EBNN uses previously learned domain knowledge as an initialization or search bias (i.e. to constrain the learner in the parameter space) (O’Sullivan, 1996; Mitchell and Thrun, 1993).
+
+Another related work in machine learning is mainly focused on reinforcement learning algorithms, based on incorporating prior knowledge in terms of logical rules to the learning algorithm as a prior knowledge to speed up and bias learning (Kunapuli et al., 2010; Towell and Shavlik, 1994).
+
+As discussed in “Memes Divide and Conquer Hypothesis“ societies can be viewed as a distributed computational processing systems. In civilized societies knowledge is distributed across different individuals, this yields a space efficiency. Moreover computation, i.e. each individual can specialize on a particular task/topic, is also divided across the individuals in the society and hence this will yield a computational efficiency. Considering the limitations of the human brain, the whole processing can not be done just by a single agent in an efficient manner. A recent study in paleoantropology states that there is a substantial decline in endocranial volume of the brain in the last 30000 years Henneberg (1988). The volume of the brain shrunk to 1241 ml from 1502 ml (Henneberg and Steyn, 1993). One of the hypothesis on the reduction of the volume of skull claims that, decline in the volume of the brain might be related to the functional changes in brain that arose as a result of cultural development and emergence of societies given that this time period overlaps with the transition from hunter-gatherer lifestyle to agricultural societies.
+
+# 3. Experimental Setup
+
+Some tasks, which seem reasonably easy for humans to learn4, are nonetheless appearing almost impossible to learn for current generic state-of-art machine learning algorithms.
+
+Here we study more closely such a task, which becomes learnable if one provides hints to the learner about appropriate intermediate concepts. Interestingly, the task we used in our experiments is not only hard for deep neural networks but also for non-parametric machine learning algorithms such as SVM’s, boosting and decision trees.
+
+The result of the experiments for varying size of dataset with several off-the-shelf black box machine learning algorithms and some popular deep learning algorithms are provided in Table 1. The detailed explanations about the algorithms and the hyperparameters used for those algorithms are given in the Appendix Section 5.2. We also provide some explanations about the methodologies conducted for the experiments at Section 3.2.
+
+# 3.1 Pentomino Dataset
+
+In order to test our hypothesis, an artificial dataset for object recognition using 64 $\times$ 64 binary images is designed5. If the task is two tiered (i.e., with guidance provided), the task in the first part is to recognize and locate each Pentomino object class $_ 6$ in the image. The second part/final binary classification task is to figure out if all the Pentominos in the image are of the same shape class or not. If a neural network learned to detect the categories of each object at each location in an image, the remaining task becomes an XOR-like operation between the detected object categories. The types of Pentomino objects that is used for generating the dataset are as follows:
+
+
+Figure 1: Left (a): An example image from the dataset which has a different sprite type in it. Right (b): An example image from the dataset that has only one type of Pentomino object in it, but with different orientations and scales.
+
+Pentomino sprites N, P, F, Y, J, and Q, along with the Pentomino N2 sprite (mirror of “Pentomino N” sprite), the Pentomino F2 sprite (mirror of “Pentomino F” sprite), and the Pentomino Y2 sprite (mirror of “Pentomino Y” sprite).
+
+
+Figure 2: Different classes of Pentomino shapes used in our dataset.
+
+As shown in Figures 1(a) and 1(b), the synthesized images are fairly simple and do not have any texture. Foreground pixels are “1” and background pixels are “0”. Images of the training and test sets are generated iid. For notational convenience, assume that the domain of raw input images is $X$ , the set of sprites is $S$ , the set of intermediate object categories is $Y$ for each possible location in the image and the set of final binary task outcomes is $Z = \{ 0 , 1 \}$ . Two different types of rigid body transformation is performed: sprite rotation $r o t ( X , \gamma )$ where $\Gamma = \{ \gamma \colon ( \gamma = 9 0 \times \phi ) \wedge [ ( \phi \in \mathbb { N } ) , ( 0 \leq \phi \leq 3 ) ] \}$ and scaling $s c a l e ( X , \alpha )$ where $\alpha \in \{ 1 , 2 \}$ is the scaling factor. The data generating procedure is summarized below.
+
+Sprite transformations: Before placing the sprites in an empty image, for each image $x \in X$ , a value for $z \in Z$ is randomly sampled which is to have (or not) the same three sprite shapes in the image. Conditioned on the constraint given by $z$ , three sprites are randomly selected $s _ { i j }$ from $S$ without replacement. Using a uniform probability distribution over all possible scales, a scale is chosen and accordingly each sprite image is scaled. Then rotate each sprite is randomly rotated by a multiple of 90 degrees.
+
+Sprite placement: Upon completion of sprite transformations, a 64 $\times$ 64 uniform grid is generated which is divided into 8 $\times$ 8 blocks, each block being of size 8 $\times$ 8 pixels, and randomly select three different blocks from the 64=8 $\times$ 8 on the grid and place the transformed objects into different blocks (so they cannot overlap, by construction).
+
+Each sprite is centered in the block in which it is located. Thus there is no object translation inside the blocks. The only translation invariance is due to the location of the block inside the image.
+
+A Pentomino sprite is guaranteed to not overflow the block in which it is located, and there are no collisions or overlaps between sprites, making the task simpler. The largest possible Pentomino sprite can be fit into an 8 $\times$ 4 mask.
+
+# 3.2 Learning Algorithms Evaluated
+
+Initially the models are cross-validated by using 5-fold cross-validation. With 40,000 examples, this gives 32,000 examples for training and 8,000 examples for testing. For neural network algorithms, stochastic gradient descent (SGD) is used for training. The following standard learning algorithms were first evaluated: decision trees, SVMs with Gaussian kernel, ordinary fully-connected Multi-Layer Perceptrons, Random Forests, k-Nearest Neighbors, Convolutional Neural Networks, and Stacked Denoising Auto-Encoders with supervised fine-tuning. More details of the configurations and hyper-parameters for each of them are given in Appendix Section 5.2. The only better than chance results were obtained with variations of the Structured Multi-Layer Perceptron described below.
+
+# 3.2.1 Structured Multi-Layer Perceptron (SMLP)
+
+The neural network architecture that is used to solve this task is called the SMLP (Structured Multi-Layer Perceptron), a deep neural network with two parts as illustrated in Figure 5 and 7:
+
+The lower part, P1NN (Part 1 Neural Network, as it is called in the rest of the paper), has shared weights and local connectivity, with one identical MLP instance of the P1NN for each patch of the image, and typically an 11-element output vector per patch (unless otherwise noted). The idea is that these 11 outputs per patch could represent the detection of the sprite shape category (or the absence of sprite in the patch). The upper part, P2NN (Part 2 Neural Network) is a fully connected one hidden layer MLP that takes the concatenation of the outputs of all patch-wise P1NNs as input. Note that the first layer of P1NN is similar to a convolutional layer but where the stride equals the kernel size, so that windows do not overlap, i.e., P1NN can be decomposed into separate networks sharing the same parameters but applied on different patches of the input image, so that each network can actually be trained patch-wise in the case where a target is provided for the P1NN outputs. The P1NN output for patch $\mathbf { p _ { i } }$ which is extracted from the image $\mathbf { x }$ is computed as follows:
+
+$$
+f _ { \theta } ( \mathbf { p _ { i } } ) = g _ { 2 } ( V g _ { 1 } ( U \mathbf { p _ { i } } + \mathbf { b } ) + \mathbf { c } )
+$$
+
+where $\mathbf { p _ { i } } \in R ^ { d }$ is the input patch/receptive field extracted from location $i$ of a single image. $U \in R ^ { d _ { h } \times d }$ is the weight matrix for the first layer of P1NN and $ { \mathbf { b } } \in R _ { h } ^ { d }$ is the vector of biases for the first layer of P1NN. $g _ { 1 } ( \cdot )$ is the activation function of the first layer and $g _ { 2 } ( \cdot )$ is the activation function of the second layer. In many of the experiments, best results were obtained with $g _ { 1 } ( \cdot )$ a rectifying non-linearity (a.k.a. as RELU), which is $m a x ( 0 , \ X )$ (Jarrett et al., 2009b; Nair and Hinton, 2010; Glorot et al., 2011a; Krizhevsky et al., 2012). $V \in R ^ { d _ { h } \times d _ { o } }$ is the second layer’s weights matrix, such that and $\mathbf { c } \in R _ { d _ { o } }$ are the biases of the second layer of the P1NN, with $d _ { o }$ expected to be smaller than $d _ { h }$ .
+
+In this way, $g _ { 1 } ( U { \bf p } _ { \bf i } + { \bf b } )$ is an overcomplete representation of the input patch that can potentially represent all the possible Pentomino shapes for all factors of variations in the patch (rotation, scaling and Pentomino shape type). On the other hand, when trained with hints, $f _ { \boldsymbol \theta } ( \mathbf { p _ { i } } )$ is expected to be the lower dimensional representation of a Pentomino shape category invariant to scaling and rotation in the given patch.
+
+In the experiments with SMLP trained with hints (targets at the output of P1NN), the P1NN is expected to perform classification of each 8 $\times$ 8 non-overlapping patches of the original 64 $\times$ 64 input image without having any prior knowledge of whether that specific patch contains a Pentomino shape or not. P1NN in SMLP without hints just outputs the local activations for each patch, and gradients on $f _ { \boldsymbol \theta } ( \mathbf { p } _ { i } )$ are backpropagated from the upper layers. In both cases P1NN produces the input representation for the Part 2 Neural Net (P2NN). Thus the input representation of P2NN is the concatenated output of P1NN across all the 64 patch locations:
+
+$\mathbf { h _ { o } } = [ f _ { \theta } ( \mathbf { p _ { 0 } } ) , . . . , f _ { \theta } ( \mathbf { p _ { i } } ) , . . . , f _ { \theta } ( \mathbf { p _ { N } } ) ) ]$ where $N$ is the number of patches and the $h _ { o } \in R ^ { d _ { i } } , d _ { i } =$ $d _ { o } \times N$ . $\mathbf { h _ { 0 } }$ is the concatenated output of the P1NN at each patch.
+
+There is a standardization layer on top of the output of P1NN that centers the activations and performs divisive normalization by dividing by the standard deviation over a minibatch of the activations of that layer. We denote the standardization function $z ( \cdot )$ . Standardization makes use of the mean and standard deviation computed for each hidden unit such that each hidden unit of $\mathbf { h _ { 0 } }$ will have 0 activation and unit standard deviation on average over the minibatch. $X$ is the set of pentomino images in the minibatch, where $X \in R ^ { d _ { i n } \times N }$ is a matrix with $N$ images. $h _ { o } ^ { ( i ) } ( \mathbf { x _ { j } } )$ is the vector of activations of the $i$ -th hidden unit of hidden layer $h _ { o } ( \mathbf { x _ { j } } )$ for the $j$ -th example, with $x _ { j } \in X$ .
+
+$$
+\mu _ { h _ { o } ^ { ( i ) } } = \frac { 1 } { N } \sum _ { \mathbf { x _ { j } } \in X } h _ { o } ^ { ( i ) } ( \mathbf { x _ { j } } )
+$$
+
+$$
+\sigma _ { h _ { o } ^ { ( i ) } } = \sqrt { \frac { \sum _ { j } ^ { N } ( h _ { o } ^ { ( i ) } ( \mathbf { x _ { j } } ) - \mu _ { h _ { o } ^ { ( i ) } } ) ^ { 2 } } { N } + \epsilon }
+$$
+
+$$
+z ( h _ { o } ^ { ( i ) } ( \mathbf { x _ { j } } ) ) = \frac { h _ { o } ^ { ( i ) } ( \mathbf { x _ { j } } ) - \mu _ { h _ { o } ^ { ( i ) } } } { \operatorname* { m a x } ( \boldsymbol { \sigma } _ { h _ { o } ^ { ( i ) } } , \epsilon ) }
+$$
+
+where $\epsilon$ is a very small constant, that is used to prevent numerical underflows in the standard deviation. P1NN is trained on each 8 $\times$ 8 patches extracted from the image.
+
+$\mathbf { h _ { o } }$ is standardized for each training and test sample separately. Different values of $\epsilon$ were used for SMLP-hints and SMLP-nohints.
+
+The concatenated output of P1NN is fed as an input to the P2NN. P2NN is a feedforward MLP with a sigmoid output layer using a single RELU hidden layer. The task of P2NN is to perform a nonlinear logical operation on the representation provided at the output of P1NN.
+
+The SMLP-hints architecture exploits a hint about the presence and category of Pentomino objects, specifying a semantics for the P1NN outputs. P1NN is trained with the intermediate target $Y$ , specifying the type of Pentomino sprite shape present (if any) at each of the 64 patches (8 $\times$ 8 non-overlapping blocks) of the image. Because a possible answer at a given location can be “none of the object types” i.e., an empty patch, $y _ { p }$ (for patch $p$ ) can take one of the 11 possible values, 1 for rejection and the rest is for the Pentomino shape classes, illustrated in Figure 2:
+
+$$
+y _ { p } = { \left\{ \begin{array} { l l } { 0 } & { { \mathrm { i f ~ p a t c h ~ } } p { \mathrm { ~ i s ~ e m p t y } } } \\ { s \in S } & { { \mathrm { i f ~ t h e ~ p a t c h ~ } } p { \mathrm { ~ c o n t a i n s ~ a ~ P e n t o m i n o ~ s p r i t e ~ } } . } \end{array} \right. }
+$$
+
+A similar task has been studied by Fleuret et al. (2011) (at SI appendix Problem 17), who compared the performance of humans vs computers.
+
+The SMLP-hints architecture takes advantage of dividing the task into two subtasks during training with prior information about intermediate-level relevant factors. Because the sum of the training losses decomposes into the loss on each patch, the P1NN can be pre-trained patchwise. Each patch-specific component of the P1NN is a fully connected MLP with 8 $\times$ 8 inputs and 11 outputs with a softmax output layer. SMLP-hints uses the the standardization given in Equation 3 but with $\epsilon = 0$ .
+
+The standardization is a crucial step for training the SMLP on the Pentomino dataset, and yields much sparser outputs, as seen on Figures 3 and 4. If the standardization is not used, even SMLP-hints could not solve the Pentomino task. In general, the standardization step dampens the small activations and augments larger ones(reducing the noise). Centering the activations of each feature detector in a neural network has been studied in (Raiko et al., 2012) and (Vatanen et al., 2013). They proposed that transforming the outputs of each hidden neuron in a multi-layer perceptron network to have zero output and zero slope on average makes first order optimization methods closer to the second order techniques.
+
+By default, the SMLP uses rectifier hidden units as activation function, we found a significant boost by using rectification compared to hyperbolic tangent and sigmoid activation functions. The P1NN has a highly overcomplete architecture with 1024 hidden units per patch, and L1 and L2 weight decay regularization coefficients on the weights (not the biases) are respectively 1e-6 and 1e-5. The learning rate for the P1NN is 0.75. 1 training epoch was enough for the P1NN to learn the features of Pentomino shapes perfectly on the 40000 training examples. The P2NN has 2048 hidden units. L1 and L2 penalty coefficients for the P2NN are 1e-6, and the learning rate is 0.1. These were selected by trial and error based on validation set error. Both P1NN (for each patch) and P2NN are fully-connected neural networks, even though P1NN globally is a special kind of convolutional neural network.
+
+Filters of the first layer of SMLP are shown in Figure 6. These are the examples of the filters obtained with the SLMP-hints trained with 40k examples, whose results are given in Table 1. Those filters look very noisy but they work perfectly on the Pentomino task.
+
+# 3.2.3 Deep and Structured Supervised MLP without Hints (SMLP-nohints)
+
+SMLP-nohints uses the same connectivity pattern (and deep architecture) that is also used in the SMLP-hints architecture, but without using the intermediate targets ( $Y$ ). It directly predicts the final outcome of the task ( $Z$ ), using the same number of hidden units, the same connectivity and the same activation function for the hidden units as SMLP-hints. 120 hyperparameter values have been evaluated by randomly selecting the number of hidden units from [64, 128, 256, 512, 1024, 1200, 2048] and randomly sampling 20 learning rates uniformly in the log-domain within the interval of [0.008, 0.8]. Two fully connected hidden layers with 1024 hidden units (same as P1NN) per patch is used and 2048 (same as P2NN) for the last hidden layer, with twenty training epochs. For this network the best results are obtained with a learning rate of 0.05.7
+
+
+Figure 3: Bar chart of concatenated softmax output activations $\mathbf { h _ { o } }$ of P1NN ( $1 1 \times 6 4 = 7 0 4$ outputs) in SMLP-hints before standardization, for a selected example. There are very large spikes at each location for one of the possible 11 outcome (1 of K representation).
+
+
+Figure 4: Softmax output activations $\mathbf { h _ { 0 } }$ of P1NN at SMLP-hints before standardization. There are positive spiked outputs at the locations where there is a Pentomino shape. Positive and negative spikes arise because most of the outputs are near an average value. Activations are higher at the locations where there is a pentomino shape.
+
+
+Figure 5: Structured MLP architecture, used with hints (trained in two phases, first P1NN, bottom two layers, then P2NN, top two layers). In SMLP-hints, P1NN is trained on each 8x8 patch extracted from the image and the softmax output probabilities of all 64 patches are concatenated into a 64 $\times$ 11 vector that forms the input of P2NN. Only $U$ and $V$ are learned in the P1NN and its output on each patch is fed into P2NN. The first level and the second level neural networks are trained separately, not jointly.
+
+
+Figure 6: Filters of Structured MLP architecture, trained with hints on 40k examples.
+
+
+Figure 7: Structured MLP architecture, used without hints (SMLP-nohints). It is the same architecture as SMLP-hints (Figure 5) but with both parts (P1NN and P2NN) trained jointly with respect to the final binary classification task.
+
+We chose to experiment with various SMLP-nohint architectures and optimization procedures, trying unsuccessfully to achieve as good results with SMLP-nohint as with SMLP-hints.
+
+Rectifier Non-Linearity A rectifier nonlinearity is used for the activations of MLP hidden layers. We observed that using piecewise linear nonlinearity activation function such as the rectifier can make the optimization more tractable.
+
+
+Figure 8: First layer filters learned by the Structured MLP architecture, trained without using hints on 447600 examples with online SGD and a sigmoid intermediate layer activation.
+
+Intermediate Layer The output of the P1NN is considered as an intermediate layer of the SMLP. For the SMLP-hints, only softmax output activations have been tried at the intermediate layer, and that sufficed to learn the task. Since things did not work nearly as well with the SMLP-nohints, several different activation functions have been tried: softmax $( \cdot )$ , $\operatorname { t a n h } ( { \cdot } )$ , sigmoid $( \cdot )$ and linear activation functions.
+
+Standardization Layer Normalization at the last layer of the convolutional neural networks has been used occasionaly to encourage the competition between the hidden units. (Jarrett et al., 2009a) used a local contrast normalization layer in their architecture which performs subtractive and divisive normalization. A local contrast normalization layer enforces a local competition between adjacent features in the feature map and between features at the same spatial location in different feature maps. Similarly (Krizhevsky et al., 2012) observed that using a local response layer that enjoys the benefit of using local normalization scheme aids generalization.
+
+Standardization has been observed to be crucial for both SMLP trained with or without hints. In both SMLP-hints and SMLP-nohints experiments, the neural network was not able to generalize or even learn the training set without using standardization in the SMLP intermediate layer, doing just chance performance. More specifically, in the SMLP-nohints architecture, standardization is part of the computational graph, hence the gradients are being backpropagated through it. The mean and the standard deviation is computed for each hidden unit separately at the intermediate layer as in Equation 4. But in order to prevent numerical underflows or overflows during the backpropagation we have used $\epsilon = 1 e - 8$ (Equation 3).
+
+The benefit of having sparse activations may be specifically important for the ill-conditioned problems, for the following reasons. When a hidden unit is “off”, its gradient (the derivative of the loss with respect to its output) is usually close to 0 as well, as seen here. That means that all off-diagonal second derivatives involving that hidden unit (e.g. its input weights) are also near 0. This is basically like removing some columns and rows from the Hessian matrix associated with a particular example. It has been observed that the condition number of the Hessian matrix (specifically, its largest eigenvalue) increases as the size of the network increases (Dauphin and Bengio, 2013), making training considerably slower and inefficient (Dauphin and Bengio, 2013). Hence one would expect that as sparsity of the gradients (obtained because of sparsity of the activations) increases, training would become more efficient, as if we were training a smaller sub-network for each example, with shared weights across examples, as in dropouts (Hinton et al., 2012).
+
+In Figure 9, the activation of each hidden unit in a bar chart is shown: the effect of standardization is significant, making the activations sparser.
+
+
+Figure 9: Activations of the intermediate-level hidden units of an SLMP-nohints for a particular examples (x-axis: hidden unit number, y-axis: activation value). Left (a): before standardization. Right (b): after standardization.
+
+In Figure 10, one can see the activation histogram of the SMLP-nohints intermediate layer, showing the distribution of activation values, before and after standardization. Again the sparsifying effect of standardization is very apparent.
+
+
+Figure 10: Distribution histogram of activation values of SMLP-nohints intermediate layer. Left (a): before standardization. Right (b): after standardization.
+
+In Figures 10 and 9, the intermediate level activations of SMLP-nohints are shown before and after standardization. These are for the same SMLP-nohints architecture whose results are presented on Table 1. For that same SMLP, the Adadelta (Zeiler, 2012) adaptive learning rate scheme has been used, with 512 hidden units for the hidden layer of P1NN and rectifier activation function. For the output of the P1NN, 11 sigmoidal units have been used while P2NN had 1200 hidden units with rectifier activation function. The output nonlinearity of the P2NN is a sigmoid and the training objective is the binary crossentropy.
+
+Adaptive Learning Rates We have experimented with several different adaptive learning rate algorithms. We tried rmsprop 8, Adadelta (Zeiler, 2012), Adagrad (Duchi et al., 2010) and a linearly $\left( 1 / \mathrm { t } \right)$ decaying learning rate (Bengio, 2013b). For the SMLP-nohints with sigmoid activation function we have found Adadelta(Zeiler, 2012) converging faster to an effective local minima and usually yielding better generalization error compared to the others.
+
+# 3.2.4 Deep and Structured MLP with Unsupervised Pre-Training
+
+Several experiments have been conducted using an architecture similar to the SMLP-nohints, but by using unsupervised pre-training of P1NN, with Denoising Auto-Encoder (DAE) and/or Contractive Auto-Encoders (CAE). Supervised fine-tuning proceeds as in the deep and structured MLP without hints. Because an unsupervised learner may not focus the representation just on the shapes, a larger number of intermediate-level units at the output of P1NN has been explored: previous work on unsupervised pre-training generally found that larger hidden layers were optimal when using unsupervised pre-training, because not all unsupervised features will be relevant to the task at hand. Instead of limiting to 11 units per patch, we experimented with networks with up to 20 hidden (i.e., code) units per patch in the second-layer patch-wise auto-encoder.
+
+In Appendix 5.1 we also provided the result of some experiments with binary-binary RBMs trained on 8 $\times$ 8 patches from the 40k training dataset.
+
+In unsupervised pretraining experiments in this paper, both contractive auto-encoder (CAE) with sigmoid nonlinearity and binary cross entropy cost function and denoising auto-encoder (DAE) have been used. In the second layer, experiments were performed with a DAE with rectifier hidden units utilizing L1 sparsity and weight decay on the weights of the auto-encoder. Greedy layerwise unsupervised training procedure is used to train the deep auto-encoder architecture (Bengio et al., 2007). In unsupervised pretraining experiments, tied weights have been used. Different combinations of CAE and DAE for unsupervised pretraining have been tested, but none of the configurations tested managed to learn the Pentomino task, as shown in Table 1.
+
+# 3.3 Experiments with 1 of $\mathbf { K }$ representation
+
+To explore the effect of changing the complexity of the input representation on the difficulty of the task, a set of experiments have been designed with symbolic representations of the information in each patch. In all cases an empty patch is represented with a 0 vector. These representation can be seen as an alternative input for a P2NN-like network, i.e., they were fed as input to an MLP or another black-box classifier.
+
+The following four experiments have been conducted, each one using one using a different input representation for each patch:
+
+
Algorithm
20kdataset
40kdataset
80kdataset
TrainingError
TestError
TrainingError
TestError
TrainingError
TestError
SVMRBF
26.2
50.2
28.2
50.2
30.2
49.6
KNearest Neighbors
24.7
50.0
25.3
49.5
25.6
49.0
Decision Tree
5.8
48.6
6.3
49.4
6.9
49.9
Randomized Trees
3.2
49.8
3.4
50.5
3.5
49.1
MLP
26.5
49.3
33.2
49.9
27.2
50.1
Convnet/Lenet5
50.6
49.8
49.4
49.8
50.2
49.8
Maxout Convnet
14.5
49.5
0.0
50.1
0.0
44.6
2 layer sDA
49.4
50.3
50.2
50.3
49.7
50.3
Struct.Supervised MLPw/ohints
0.0
48.6
0.0
36.0
0.0
12.4
Struct. MLP+CAE Supervised Finetuning
50.5
49.7
49.8
49.7
50.3
49.7
Struct.MLP+CAE+DAE,Supervised Finetuning
49.1
49.7
49.4
49.7
50.1
49.7
Struct.MLP+DAE+DAE, Supervised Finetuning
49.5
50.3
49.7
49.8
50.3
49.7
Struct.MLPwith Hints
0.21
30.7
0
3.1
0
0.01
+
+Table 1: The error percentages with different learning algorithms on Pentomino dataset with different number of training examples.
+
+Experiment 1-Onehot representation without transformations: In this experiment several trials have been done with a 10-input one-hot vector per patch. Each input corresponds to an object category given in clear, i.e., the ideal input for P2NN if a supervised P1NN perfectly did its job.
+
+Experiment 2-Disentangled representations: In this experiment, we did trials with 16 binary inputs per patch, 10 one-hot bits for representing each object category, 4 for rotations and 2 for scaling, i.e., the whole information about the input is given, but it is perfectly disentangled. This would be the ideal input for P2NN if an unsupervised P1NN perfectly did its job.
+
+Experiment 3-Onehot representation with transformations: For each of the ten object types there are 8 = 4 $\times$ 2 possible transformations. Two objects in two different patches are the considered “the same” (for the final task) if their category is the same regardless of the transformations. The one-hot representation of a patch corresponds to the crossproduct between the 10 object shape classes and the 4 $\times$ 2 transformations, i.e., one out of 80=10 $\times$ 4 × 2 possibilities represented in an 80-bit one-hot vector. This also contains all the information about the input image patch, but spread out in a kind of non-parametric and non-informative (not disentangled) way, like a perfect memory-based unsupervised learner (like clustering) could produce. Nevertheless, the shape class would be easier to read out from this representation than from the image representation (it would be an OR over 8 of the bits).
+
+Experiment 4-Onehot representation with 80 choices: This representation has the same 1 of 80 one-hot representation per patch but the target task is defined differently. Two objects in two different patches are considered the same iff they have exactly the same 80-bit onehot representation (i.e., are of the same object category with the same transformation applied).
+
+The first experiment is a sanity check. It was conducted with single hidden-layered MLP’s with rectifier and tanh nonlinearity, and the task was learned perfectly (0 error on both training and test dataset) with very few training epochs.
+
+
+Figure 11: Tanh MLP training curves. Left (a): The training and test errors of Experiment 3 over 800 training epochs with 100k training examples using Tanh MLP. Right (b):The training and test errors of Experiment 4 over 700 training epochs with 100k training examples using Tanh MLP.
+
+
+(b) Training and Test Errors for Experiment 3
+
+The results of Experiment 2 are given in Table 2. To improve results, we experimented with the Maxout non-linearity in a feedforward MLP (Goodfellow et al., 2013) with two hidden layers. Unlike the typical Maxout network mentioned in the original paper, regularizers have been deliberately avoided in order to focus on the optimization issue, i.e: no weight decay, norm constraint on the weights, or dropout. Although learning from a disentangled representation is more difficult than learning from perfect object detectors, it is feasible with some architectures such as the Maxout network. Note that this representation is the kind of representation that one could hope an unsupervised learning algorithm could discover, at best, as argued in Bengio et al. (2012).
+
+The only results obtained on the validation set for Experiment 3 and Experiment 4 are shown respectively in Table 3 and Table 4. In these experiments a tanh MLP with two hidden layers have been tested with the same hyperparameters. In experiment 3 the complexity of the problem comes from the transformations (8=4 $\times$ 2) and the number of object types.
+
+But in experiment 4, the only source of complexity of the task comes from the number of different object types. These results are in between the complete failure and complete success observed with other experiments, suggesting that the task could become solvable with better training or more training examples. Figure 11 illustrates the progress of training a tanh MLP, on both the training and test error, for Experiments 3 and 4. Clearly, something has been learned, but the task is not nailed yet. On experiment 3 for both maxout and tanh the maxout there was a long plateau where the training error and objective stays almost same. Maxout did just chance on the experiment for about 120 iterations on the training and the test set. But after 120th iteration the training and test error started decline and eventually it was able to solve the task. Moreover as seen from the curves in Figure 11(a) and 11(b), the training and test error curves are almost the same for both tasks. This implies that for onehot inputs, whether you increase the number of possible transformations for each object or the number of
+
+Table 2: Performance of different learning algorithms on disentangled representation in Experiment 2.
+
+
Learning Algorithm
Training Error
Test Error
SVM
0.0
35.6
RANDOM FORESTS
1.29
40.475
TANH MLP
0.0
0.0
MAXOUT MLP
0.0
0.0
+
+
Learning Algorithm
Training Error
Test Error
SVM
11.212
32.37
RANDOM FORESTS
24.839
48.915
TANH MLP
0.0
22.475
MAXOUT MLP
0.0
0.0
+
+Table 3: Performance of different learning algorithms using a dataset with onehot vector and 80 inputs as discussed for Experiment 3.
+
+object categories, as soon as the number of possible configurations is same, the complexity of the problem is almost the same for the MLP.
+
+# 3.4 Does the Effect Persist with Larger Training Set Sizes?
+
+The results shown in this section indicate that the problem in the Pentomino task clearly is not just a regularization problem, but rather basically hinges on an optimization problem. Otherwise, we would expect test error to decrease as the number of training examples increases. This is shown first by studying the online case and then by studying the ordinary training case with a fixed size training set but considering increasing training set sizes. In the online minibatch setting, parameter updates are performed as follows:
+
+$$
+\theta _ { t + 1 } = \theta _ { t } - \Delta _ { \theta _ { t } }
+$$
+
+$$
+\Delta _ { \theta _ { t } } = \epsilon \frac { \sum _ { i } ^ { N } \nabla _ { \theta _ { t } } L ( x _ { t } , \theta _ { t } ) } { N }
+$$
+
+where $L ( x _ { t } , \theta _ { t } )$ is the loss incurred on example $x _ { t }$ with parameters $\theta _ { t }$ , where $t \in \mathcal { Z } ^ { + }$ and $\epsilon$ is the learning rate.
+
+Ordinary batch algorithms converge linearly to the optimum $\theta ^ { * }$ , however the noisy gradient estimates in the online SGD will cause parameter $\theta$ to fluctuate near the local optima. However, online SGD directly optimizes the expected risk, because the examples are drawn iid from the ground-truth distribution (Bottou, 2010). Thus:
+
+$$
+L _ { \infty } = E [ L ( x , \theta ) ] = \int _ { x } L ( x , \theta ) p ( x ) d _ { x }
+$$
+
+
Learning Algorithm
Learning Algorithm
Training Error
SVMRANDOM FORESTSTANH MLP
4.346
STS
TS
23.4560
47.34525.8
0
+
+Table 4: Performance of different algorithms using a dataset with onehot vector and 80 binary inputs as discussed in Experiment 4.
+
+where $L _ { \infty }$ is the generalization error. Therefore online SGD is trying to minimize the expected risk with noisy updates. Those noisy updates have the effect of regularizer:
+
+$$
+\Delta _ { \theta _ { t } } = \epsilon \frac { \sum _ { i } ^ { N } \nabla _ { \theta _ { t } } L ( x _ { t } , \theta _ { t } ) } { N } = \epsilon \nabla _ { \theta _ { t } } L ( x , \theta _ { t } ) + \epsilon \xi _ { t }
+$$
+
+where $\nabla _ { \theta _ { t } } L ( x , \theta _ { t } )$ is the true gradient and $\xi _ { t }$ is the zero-mean stochastic gradient “noise” due to computing the gradient over a finite-size minibatch sample.
+
+We would like to know if the problem with the Pentomino dataset is more a regularization or an optimization problem. An SMLP-nohints model was trained by online SGD with the randomly generated online Pentomino stream. The learning rate was adaptive, with the Adadelta procedure (Zeiler, 2012) on minibatches of 100 examples. In the online SGD experiments, two SMLP-nohints that is trained with and without standardization at the intermediate layer with exactly the same hyperparameters are tested. The SMLP-nohints P1NN patch-wise submodel has 2048 hidden units and the SMLP intermediate layer has $1 1 5 2 = 6 4 \times 1 8$ hidden units. The nonlinearity that is used for the intermediate layer is the sigmoid. P2NN has 2048 hidden units.
+
+SMLP-nohints has been trained either with or without standardization on top of the output units of the P1NN. The experiments illustrated in Figures 12 and 13 are with the same SMLP without hints architecture for which results are given in Table 1. In those graphs only the results for the training on the randomly generated 545400 Pentomino samples have been presented. As shown in the plots SMLP-nohints was not able to generalize without standardization. Although without standardization the training loss seems to decrease initially, it eventually gets stuck in a plateau where training loss doesn’t change much.
+
+Training of SMLP-nohints online minibatch SGD is performed using standardization in the intermediate layer and Adadelta learning rate adaptation, on 1046000 training examples from the randomly generated Pentomino stream. At the end of the training, test error is down to $2 7 . 5 \%$ , which is much better than chance but from from the score obtained with SMLP-hints of near 0 error.
+
+In another SMLP-nohints experiment without standardization the model is trained with the 1580000 Pentomino examples using online minibatch SGD. P1NN has 2048 hidden units and 16 sigmoidal outputs per patch. for the P1NN hidden layer. P2NN has 1024 hidden units for the hidden layer. Adadelta is used to adapt the learning rate. At the end of training this SMLP, the test error remained stuck, at $5 0 . 1 \%$ .
+
+
+Figure 12: Test errors of SMLP-nohints with and without standardization in the intermediate layer. Sigmoid as an intermediate layer activation has been used. Each tick (batch no) in the x-axis represents 400 examples.
+
+
+Figure 13: Training errors of SMLP-nohints with and without standardization in the intermediate layer. Sigmoid nonlinearity has been used as an intermediate layer activation function. The x-axis is in units of blocks of 400 examples in the training set.
+
+Here we consider the effect of training different learners with different numbers of training examples. For the experimental results shown in Table 1, 3 training set sizes (20k, 40k and 80k examples) had been used. Each dataset was generated with different random seeds (so they do not overlap). Figure 14 also shows the error bars for an ordinary MLP with three hidden layers, for a larger range of training set sizes, between 40k and 320k examples. The number of training epochs is 8 (more did not help), and there are three hidden layers with 2048 feature detectors. The learning rate we used in our experiments is 0.01. The activation function of the MLP is a tanh nonlinearity, while the L1, L2 penalty coefficients are both 1e-6.
+
+Table 1 shows that, without guiding hints, none of the state-of-art learning algorithms could perform noticeably better than a random predictor on the test set. This shows the importance of intermediate hints introduced in the SMLP. The decision trees and SVMs can overfit the training set but they could not generalize on the test set. Note that the numbers reported in the table are for hyper-parameters selected based on validation set error, hence lower training errors are possible if avoiding all regularization and taking large enough models. On the training set, the MLP with two large hidden layers (several thousands) could reach nearly $0 \%$ training error, but still did not manage to achieve good test error.
+
+In the experiment results shown in Figure 14, we evaluate the impact of adding more training data for the fully-connected MLP. As mentioned before for these experiments we have used a MLP with three hidden layers where each layer has 2048 hidden units. The $\operatorname { t a n h } ( { \cdot } )$ activation function is used with 0.05 learning rate and minibatches of size 200.
+
+As can be seen from the figure, adding more training examples did not help either training or test error (both are near $5 0 \%$ , with training error slightly lower and test error slightly higher), reinforcing the hypothesis that the difficult encountered is one of optimization, not of regularization.
+
+
+Figure 14: Training and test error bar charts for a regular MLP with 3 hidden layers. There is no significant improvement on the generalization error of the MLP as the new training examples are introduced.
+
+# 3.5 Experiments on Effect of Initializing with Hints
+
+Initialization of the parameters in a neural network can have a big impact on the learning and generalization (Glorot and Bengio, 2010). Previously Erhan et al. (2010) showed that initializing the parameters of a neural network with unsupervised pretraining guides the learning towards basins of attraction of local minima that provides better generalization from the training dataset. In this section we analyze the effect of initializing the SMLP with hints and then continuing without hints at the rest of the training. For experimental analysis of hints based initialization, SMLP is trained for 1 training epoch using the hints and for 60 epochs it is trained without hints on the 40k examples training set. We also compared the same architecture with the same hyperparameters, against to SMLP-nohints trained for 61 iterations on the same dataset. After one iteration of hint-based training SMLP obtained 9% training error and 39% test error. Following the hint based training, SMLP is trained without hints for 60 epochs, but at epoch 18, it already got 0% training and 0% test error. The hyperparameters for this experiment and the experiment that the results shown for the SMLP-hints in Table 1 are the same. The test results for initialization with and without hints are shown on Figure 15. This figure suggests that initializing with hints can give the same generalization performance but training takes longer.
+
+
+Figure 15: Plots showing the test error of SMLP with random initialization vs initializing with hint based training.
+
+# 3.5.1 Further Experiments on Optimization for Pentomino Dataset
+
+With extensive hyperparameter optimization and using standardization in the intermediate level of the SMLP with softmax nonlinearity, SMLP-nohints was able to get $5 . 3 \%$ training and
+
+6.7% test error on the 80k Pentomino training dataset. We used the 2050 hidden units for the hidden layer of P1NN and 11 softmax output per patch. For the P2NN, we used 1024 hidden units with sigmoid and learning rate 0.1 without using any adaptive learning rate method. This SMLP uses a rectifier nonlinearity for hidden layers of both P1NN and P2NN. Considering that architecture uses softmax as the intermediate activation function of SMLP-nohints. It is very likely that P1NN is trying to learn the presence of specific Pentomino shape in a given patch. This architecture has a very large capacity in the P1NN, that probably provides it enough capacity to learn the presence of Pentomino shapes at each patch effortlessly.
+
+An MLP with 2 hidden layers, each 1024 rectifier units, was trained using LBFGS (the implementation from the scipy.optimize library) on 40k training examples, with gradients computed on batches of 10000 examples at each iteration. However, after convergence of training, the MLP was still doing chance on the test dataset.
+
+We also observed that using linear units for the intermediate layer yields better generalization error without standardization compared to using activation functions such as sigmoid, tanh and RELU for the intermediate layer. SMLP-nohints was able to get 25% generalization error with linear units without standardization whereas all the other activation functions that has been tested failed to generalize with the same number of training iterations without standardization and hints. This suggests that using non-linear intermediate-level activation functions without standardization introduces an optimization difficulty for the SMLP-nohints, maybe because the intermediate level acts like a bottleneck in this architecture.
+
+# 4. Conclusion and Discussion
+
+In this paper we have shown an example of task which seems almost impossible to solve by standard black-box machine learning algorithms, but can be almost perfectly solved when one encourages a semantics for the intermediate-level representation that is guided by prior knowledge. The task has the particularity that it is defined by the composition of two nonlinear sub-tasks (object detection on one hand, and a non-linear logical operation similar to XOR on the other hand).
+
+What is interesting is that in the case of the neural network, we can compare two networks with exactly the same architecture but a different pre-training, one of which uses the known intermediate concepts to teach an intermediate representation to the network. With enough capacity and training time they can overfit but did not not capture the essence of the task, as seen by test set performance.
+
+We know that a structured deep network can learn the task, if it is initialized in the right place, and do it from very few training examples. Furthermore we have shown that if one pre-trains SMLP with hints for only one epoch, it can nail the task. But the exactly same architecture which started training from random initialization, failed to generalize.
+
+Consider the fact that even SMLP-nohints with standardization after being trained using online SGD on 1046000 generated examples and still gets $2 7 . 5 \%$ test error. This is an indication that the problem is not a regularization problem but possibly an inability to find a good effective local minima of generalization error.
+
+What we hypothesize is that for most initializations and architectures (in particular the fully-connected ones), although it is possible to find a good effective local minimum of training error when enough capacity is provided, it is difficult (without the proper initialization) to find a good local minimum of generalization error. On the other hand, when the network architecture is constrained enough but still allows it to represent a good solution (such as the structured MLP of our experiments), it seems that the optimization problem can still be difficult and even training error remains stuck high if the standardization isn’t used. Standardization obviously makes the training objective of the SMLP easier to optimize and helps it to find at least a better effective local minimum of training error. This finding suggests that by using specific architectural constraints and sometimes domain specific knowledge about the problem, one can alleviate the optimization difficulty that generic neural network architectures face.
+
+It could be that the combination of the network architecture and training procedure produces a training dynamics that tends to yield into these minima that are poor from the point of view of generalization error, even when they manage to nail training error by providing enough capacity. Of course, as the number of examples increases, we would expect this discrepancy to decrease, but then the optimization problem could still make the task unfeasible in practice. Note however that our preliminary experiments with increasing the training set size (8-fold) for MLPs did not reveal signs of potential improvements in test error yet, as shown in Figure 14. Even using online training on 545400 Pentomino examples, the SMLP-nohints architecture was still doing far from perfect in terms of generalization error (Figure 12).
+
+These findings bring supporting evidence to the “Guided Learning Hypothesis” and “Deeper Harder Hypothesis” from Bengio (2013a): higher level abstractions, which are expressed by composing simpler concepts, are more difficult to learn (with the learner often getting in an effective local minimum ), but that difficulty can be overcome if another agent provides hints of the importance of learning other, intermediate-level abstractions which are relevant to the task.
+
+Many interesting questions remain open. Would a network without any guiding hint eventually find the solution with a enough training time and/or with alternate parametrizations? To what extent is ill-conditioning a core issue? The results with LBFGS were disappointing but changes in the architectures (such as standardization of the intermediate level) seem to make training much easier. Clearly, one can reach good solutions from an appropriate initialization, pointing in the direction of an issue with local minima, but it may be that good solutions are also reachable from other initializations, albeit going through a tortuous ill-conditioned path in parameter space. Why did our attempts at learning the intermediate concepts in an unsupervised way fail? Are these results specific to the task we are testing or a limitation of the unsupervised feature learning algorithm tested? Trying with many more unsupervised variants and exploring explanatory hypotheses for the observed failures could help us answer that. Finally, and most ambitious, can we solve these kinds of problems if we allow a community of learners to collaborate and collectively discover and combine partial solutions in order to obtain solutions to more abstract tasks like the one presented here? Indeed, we would like to discover learning algorithms that can solve such tasks without the use of prior knowledge as specific and strong as the one used in the SMLP here. These experiments could be inspired by and inform us about potential mechanisms for collective learning through cultural evolutions in human societies.
+
+# Acknowledgments
+
+We would like to thank to the ICLR 2013 reviewers for their insightful comments, and NSERC, CIFAR, Compute Canada and Canada Research Chairs for funding.
+
+References
+A. Ben-Hur and J. Weston. A user’s guide to support vector machines. Methods in Molecular Biology, 609:223–239, 2010.
+Y. Bengio, P. Lamblin, D. Popovici, and H. Larochelle. Greedy layer-wise training of deep networks. In NIPS’2006, 2007.
+Yoshua Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2(1):1–127, 2009. Also published as a book. Now Publishers, 2009.
+Yoshua Bengio. Evolving culture vs local minima. In Growing Adaptive Machines: Integrating Development and Learning in Artificial Neural Networks, number also as ArXiv 1203.2990v1, pages T. Kowaliw, N. Bredeche & R. Doursat, eds. Springer-Verlag, March 2013a. URL http://arxiv.org/abs/1203.2990.
+Yoshua Bengio. Practical recommendations for gradient-based training of deep architectures. In K.-R. M¨uller, G. Montavon, and G. B. Orr, editors, Neural Networks: Tricks of the Trade. Springer, 2013b.
+Yoshua Bengio, Jerome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In L´eon Bottou and Michael Littman, editors, Proceedings of the Twenty-sixth International Conference on Machine Learning (ICML’09). ACM, 2009a.
+Yoshua Bengio, Jerome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML’09, 2009b.
+Yoshua Bengio, Aaron Courville, and Pascal Vincent. Unsupervised feature learning and deep learning: A review and new perspectives. Technical Report arXiv:1206.5538, U. Montreal, 2012. URL http://arxiv.org/abs/1206.5538.
+Yoshua Bengio, Aaron Courville, and Pascal Vincent. Unsupervised feature learning and deep learning: A review and new perspectives. IEEE Trans. Pattern Analysis and Machine Intelligence (PAMI), 2013.
+James Bergstra, Olivier Breuleux, Fr´ed´eric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy), 2010.
+L´eon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Springer, 2010.
+Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001.
+D. C. Ciresan, U. Meier, L. M. Gambardella, and J. Schmidhuber. Deep big simple neural nets for handwritten digit recognition. Neural Computation, 22:1–14, 2010.
+Yann Dauphin and Yoshua Bengio. Big neural networks waste capacity. Technical Report arXiv:1301.3583, Universite de Montreal, 2013.
+Richard Dawkins. The Selfish Gene. Oxford University Press, 1976.
+
+J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2010.
+
+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:625–660, February 2010.
+
+Fran¸cois 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.
+
+X. Glorot, A. Bordes, and Y. Bengio. Deep sparse rectifier neural networks. In AISTATS, 2011a.
+
+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, pages 249–256, May 2010.
+
+Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In JMLR W&CP: Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics (AISTATS 2011), April 2011b.
+
+Ian J. Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In ICML, 2013.
+
+Maciej Henneberg. Decrease of human skull size in the holocene. Human biology, pages 395–405, 1988.
+
+Maciej Henneberg and Maryna Steyn. Trends in cranial capacity and cranial index in subsaharan africa during the holocene. American journal of human biology, 5(4):473–479, 1993.
+
+J. Henrich and R. McElreath. The evolution of cultural evolution. Evolutionary Anthropology: Issues, News, and Reviews, 12(3):123–135, 2003.
+
+Geoffrey E. Hinton, Simon Osindero, and Yee Whye Teh. A fast learning algorithm for deep belief nets. Neural Computation, 18:1527–1554, 2006.
+
+Geoffrey E. Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. Technical report, arXiv:1207.0580, 2012.
+
+C.W. Hsu, C.C. Chang, C.J. Lin, et al. A practical guide to support vector classification, 2003.
+
+Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition? In Proc. International Conference on Computer Vision (ICCV’09), pages 2146–2153. IEEE, 2009a.
+
+Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition? In ICCV’09, 2009b.
+
+Faisal Khan, Xiaojin Zhu, and Bilge Mutlu. How do humans teach: On curriculum learning and teaching dimension. In Advances in Neural Information Processing Systems 24 (NIPS’11), pages 1449–1457, 2011.
+
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25 (NIPS’2012). 2012.
+
+Kai A. Krueger and Peter Dayan. Flexible shaping: how learning in small steps helps. Cognition, 110:380–394, 2009.
+
+G. Kunapuli, K.P. Bennett, R. Maclin, and J.W. Shavlik. The adviceptron: Giving advice to the perceptron. Proceedings of the Conference on Artificial Neural Networks In Engineering (ANNIE 2010), 2010.
+
+Hugo Larochelle, Yoshua Bengio, Jerome Louradour, and Pascal Lamblin. Exploring strategies for training deep neural networks. Journal of Machine Learning Research, 10:1–40, 2009.
+
+Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
+
+T.M. Mitchell. The need for biases in learning generalizations. Department of Computer Science, Laboratory for Computer Science Research, Rutgers Univ., 1980.
+
+T.M. Mitchell and S.B. Thrun. Explanation-based neural network learning for robot control. Advances in Neural information processing systems, pages 287–287, 1993.
+
+R. Montague. Universal grammar. Theoria, 36(3):373–398, 1970.
+
+V. Nair and G. E Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML’10, 2010.
+
+L.B.J.H.F.R.A. Olshen and C.J. Stone. Classification and regression trees. Belmont, Calif.: Wadsworth, 1984.
+
+Joseph O’Sullivan. Integrating initialization bias and search bias in neural network learning, 1996.
+
+F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, et al. Scikit-learn: Machine learning in python. The Journal of Machine Learning Research, 12:2825–2830, 2011.
+
+Gail B. Peterson. A day of great illumination: B. F. Skinner’s discovery of shaping. Journal of the Experimental Analysis of Behavior, 82(3):317–328, 2004.
+
+Tapani Raiko, Harri Valpola, and Yann LeCun. Deep learning made easier by linear transformations in perceptrons. In International Conference on Artificial Intelligence and Statistics, pages 924–932, 2012.
+
+Salah Rifai, Pascal Vincent, Xavier Muller, Xavier Glorot, and Yoshua Bengio. Contractive auto-encoders: Explicit invariance during feature extraction. In ICML’2011, 2011.
+
+Salah Rifai, Yoshua Bengio, Yann Dauphin, and Pascal Vincent. A generative process for sampling contractive auto-encoders. In Proceedings of the Twenty-nine International Conference on Machine Learning (ICML’12). ACM, 2012. URL http://icml.cc/discuss/2012/590. html.
+
+R. Salakhutdinov and G.E. Hinton. Deep Boltzmann machines. In Proceedings of the Twelfth International Conference on Artificial Intelligence and Statistics (AISTATS 2009), volume 8, 2009.
+
+Burrhus F. Skinner. Reinforcement today. American Psychologist, 13:94–99, 1958.
+
+R.J. Solomonoff. A system for incremental learning based on algorithmic probability. In Proceedings of the Sixth Israeli Conference on Artificial Intelligence, Computer Vision and Pattern Recognition, pages 515–527. Citeseer, 1989.
+
+G.G. Towell and J.W. Shavlik. Knowledge-based artificial neural networks. Artificial intelligence, 70(1):119–165, 1994.
+
+Tommi Vatanen, Tapani Raiko, Harri Valpola, and Yann LeCun. Pushing stochastic gradient towards second-order methods–backpropagation learning with transformations in nonlinearities. arXiv preprint arXiv:1301.3476, 2013.
+
+Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11:3371–3408, December 2010.
+
+Luis Von Ahn, Manuel Blum, Nicholas J Hopper, and John Langford. Captcha: Using hard ai problems for security. In Advances in CryptologyEUROCRYPT 2003, pages 294–311. Springer, 2003.
+
+Jason Weston, Fr´ed´eric Ratle, and Ronan Collobert. Deep learning via semi-supervised embedding. In William W. Cohen, Andrew McCallum, and Sam T. Roweis, editors, Proceedings of the Twenty-fifth International Conference on Machine Learning (ICML’08), pages 1168–1175, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-205-4. doi: 10.1145/1390156.1390303.
+
+Matthew D Zeiler. Adadelta: An adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
+
+# 5. Appendix
+
+# 5.1 Binary-Binary RBMs on Pentomino Dataset
+
+We trained binary-binary RBMs (both visible and hidden are binary) on 8 $\times$ 8 patches extracted from the Pentomino Dataset using PCD (stochastic maximum likelihood), a weight decay of .0001 and a sparsity penalty9. We used 256 hidden units and trained by SGD with a batch size of 32 and a annealing learning rate (Bengio, 2013b) starting from 1e-3 with annealing rate
+
+1.000015. The RBM is trained with momentum starting from 0.5. The biases are initialized to -2 in order to get a sparse representation. The RBM is trained for 120 epochs (approximately 50 million updates).
+
+After pretraining the RBM, its parameters are used to initialize the first layer of an SMLPnohints network. As in the usual architecture of the SMLP-nohints on top of P1NN, there is an intermediate layer. Both P1NN and the intermediate layer have a sigmoid nonlinearity, and the intermediate layer has 11 units per location. This SMLP-nohints is trained with Adadelta and standardization at the intermediate layer 10.
+
+
+Figure 16: Training and test errors of an SMLP-nohints network whose first layer is pre-trained as an RBM. Training error reduces to $0 \%$ at epoch 42, but test error is still chance.
+
+# 5.2 Experimental Setup and Hyper-parameters
+
+# 5.2.1 Decision Trees
+
+We used the decision tree implementation in the scikit-learn (Pedregosa et al., 2011) python package which is an implementation of the CART (Regression Trees) algorithm. The CART algorithm constructs the decision tree recursively and partitions the input space such that the samples belonging to the same category are grouped together (Olshen and Stone, 1984). We used The Gini index as the impurity criteria. We evaluated the hyper-parameter configurations with a grid-search. We cross-validated the maximum depth (max depth) of the tree (for preventing the algorithm to severely overfit the training set) and minimum number of samples required to create a split (min split). 20 different configurations of hyper-parameter values were evaluated. We obtained the best validation error with $m a x \_ d e p t h = 3 0 0$ and $\begin{array} { r } { m i n \_ s p l i t = 8 } \end{array}$ .
+
+
+Figure 17: Filters learned by the binary-binary RBM after training on the 40k examples. The RBM did learn the edge structure of Pentomino shapes.
+
+
+Figure 18: 100 samples generated from trained RBM. All the generated samples are valid Pentomino shapes.
+
+# 5.2.2 Support Vector Machines
+
+We used the “Support Vector Classifier (SVC)” implementation from the scikit-learn package which in turn uses the libsvm’s Support Vector Machine (SVM) implementation. Kernelbased SVMs are non-parametric models that map the data into a high dimensional space and separate different classes with hyperplane(s) such that the support vectors for each category will be separated by a large margin. We cross-validated three hyper-parameters of the model using grid-search: $C$ , $\gamma$ and the type of $\mathrm { k e r n e l } ( k e r n e l . t y p e )$ . $C$ is the penalty term (weight decay) for the SVM and $\gamma$ is a hyper-parameter that controls the width of the Gaussian for the RBF kernel. For the polynomial kernel, $\gamma$ controls the flexibility of the classifier (degree of the polynomial) as the number of parameters increases (Hsu et al., 2003; Ben-Hur and Weston, 2010). We evaluated forty-two hyper-parameter configurations. That includes, two kernel types: $\{ R B F , \ P o l y n o m i a l \}$ ; three gammas: $\{ 1 e - 2 , ~ 1 e - 3 , ~ 1 e - 4 \}$ for the RBF kernel, $\{ 1 , 2 , 5 \}$ for the polynomial kernel, and seven $C$ values among: $\{ 0 . 1 , 1 , 2 , 4 , 8 , 1 0 , 1 6 \}$ . As a result of the grid search and cross-validation, we have obtained the best test error by using the RBF kernel, with $C = 2$ and $\gamma = 1$ .
+
+# 5.2.3 Multi Layer Perceptron
+
+We have our own implementation of Multi Layer Perceptron based on the Theano (Bergstra et al., 2010) machine learning libraries. We have selected 2 hidden layers, the rectifier activation function, and 2048 hidden units per layer. We cross-validated three hyper-parameters of the model using random-search, sampling the learning rates $\epsilon$ in log-domain, and selecting $L 1$ and $L 2$ regularization penalty coefficients in sets of fixed values, evaluating 64 hyperparameter values. The range of the hyperparameter values are $\epsilon \in [ 0 . 0 0 0 1 , 1 ]$ , $L 1 \in \{ 0 . , 1 e - 6 , 1 e - 5 , 1 e - 4 \}$ and $L 2 \in \{ 0 , 1 e - 6 , 1 e - 5 \}$ . As a result, the following were selected: $L 1 = 1 e - 6$ , $L 2 = 1 e - 5$ and $\epsilon = 0 . 0 5$ .
+
+# 5.2.4 Random Forests
+
+We used scikit-learn’s implementation of “Random Forests” decision tree learning. The Random Forests algorithm creates an ensemble of decision trees by randomly selecting for each tree a subset of features and applying bagging to combine the individual decision trees (Breiman, 2001). We have used grid-search and cross-validated the max depth, min split, and number of trees $( n \_ e s t i m a t o r s )$ . We have done the grid-search on the following hyperparameter values, n estimators $\in \ \{ 5 , 1 0 , 1 5 , 2 5 , 5 0 \}$ , $m a x \_ d e p t h \in \ \{ 1 0 0 , 3 0 0 , 6 0 0 , 9 0 0 \}$ , and min splits ∈ $\{ 1 , 4 , 1 6 \}$ . We obtained the best validation error with max depth = 300, min split = 4 and n estimators = 10.
+
+# 5.2.5 k-Nearest Neighbors
+
+We used scikit-learn’s implementation of k-Nearest Neighbors (k-NN). k-NN is an instancebased, lazy learning algorithm that selects the training examples closest in Euclidean distance to the input query. It assigns a class label to the test example based on the categories of the $k$ closest neighbors. The hyper-parameters we have evaluated in the cross-validation are the number of neighbors ( $k$ ) and weights. The weights hyper-parameter can be either “uniform” or “distance”. With “uniform”, the value assigned to the query point is computed by the majority vote of the nearest neighbors. With “distance”, each value assigned to the query point is computed by weighted majority votes where the weights are computed with the inverse distance between the query point and the neighbors. We have used $n . n e i g h b o u r s \in \{ 1 , 2 , 4 , 6 , 8 , 1 2 \}$ and $w e i g h t s \in \{ " , u n i f o r m " , " d i s t a n c e " \}$ for hyper-parameter search. As a result of cross-validation and grid search, we obtained the best validation error with $k = 2$ and weights=“uniform”.
+
+# 5.2.6 Convolutional Neural Nets
+
+We used a Theano (Bergstra et al., 2010) implementation of Convolutional Neural Networks (CNN) from the deep learning tutorial at deeplearning.net, which is based on a vanilla version of a CNN LeCun et al. (1998). Our CNN has two convolutional layers. Following each convolutional layer, we have a max-pooling layer. On top of the convolution-poolingconvolution-pooling layers there is an MLP with one hidden layer. In the cross-validation we have sampled 36 learning rates in log-domain in the range [0.0001, 1] and the number of filters from the range [10, 20, 30, 40, 50, 60] uniformly. For the first convolutional layer we used 9 $\times$ 9 receptive fields in order to guarantee that each object fits inside the receptive field. As a result of random hyperparameter search and doing manual hyperparameter search on the validation dataset, the following values were selected:
+
+• The number of features used for the first layer is 30 and the second layer is 60.
+• For the second convolutional layer, 7 $\times$ 7 receptive fields. The stride for both convolutional layers is 1.
+• Convolved images are downsampled by a factor of 2 $\times$ 2 at each pooling operation.
+• The learning rate for CNN is 0.01 and it was trained for 8 epochs.
+
+# 5.2.7 Maxout Convolutional Neural Nets
+
+We used the pylearn2 (https://github.com/lisa-lab/pylearn2) implementation of maxout convolutional networks (Goodfellow et al., 2013). There are two convolutional layers in the selected architecture, without any pooling. In the last convolutional layer, there is a maxout non-linearity. The following were selected by cross-validation: learning rate, number of channels for the both convolution layers, number of kernels for the second layer and number of units and pieces per maxout unit in the last layer, a linearly decaying learning rate, momentum starting from 0.5 and saturating to 0.8 at the 200’th epoch. Random search for the hyperparameters was used to evaluate 48 different hyperparameter configurations on the validation dataset. For the first convolutional layer, 8 $\times$ 8 kernels were selected to make sure that each Pentomino shape fits into the kernel. Early stopping was used and test error on the model that has the best validation error is reported. Using norm constraint on the fan-in of the final softmax units yields slightly better result on the validation dataset.
+
+As a result of cross-validation and manually tuning the hyperparameters we used the following hyperparameters:
+
+• 16 channels per convolutional layer. 600 hidden units for the maxout layer.
+
+• 6x6 kernels for the second convolutional layer.
+
+• 5 pieces for the convolution layers and 4 pieces for the maxout layer per maxout units.
+
+• We decayed the learning rate by the factor of 0.001 and the initial learning rate is 0.026367. But we scaled the learning rate of the second convolutional layer by a constant factor of 0.6.
+
+• The norm constraint (on the incoming weights of each unit) is 1.9365.
+
+Figure 19 shows the first layer filters of the maxout convolutional net, after being trained on the 80k training set for 85 epochs.
+
+
+
+Figure 19: Maxout convolutional net first layer filters. Most of the filters were able to learn the basic edge structure of the Pentomino shapes.
+
+# 5.2.8 Stacked Denoising Auto-Encoders
+
+Denoising Auto-Encoders (DAE) are a form of regularized auto-encoder (Bengio et al., 2013). The DAE forces the hidden layer to discover more robust features and prevents it from simply learning the identity by reconstructing the input from a corrupted version of it (Vincent et al., 2010). Two DAEs were stacked, resulting in an unsupervised transformation with two hidden layers of 1024 units each. Parameters of all layers are then fine-tuned with supervised finetuning using logistic regression as the classifier and SGD as the gradient-based optimization algorithm. The stochastic corruption process is binomial ( $0$ or 1 replacing each input value, with probability 0.2). The selected learning rate is $\epsilon _ { 0 } = 0 . 0 1$ for the DAe and $\epsilon _ { 1 } = 0 . 1$ for supervised fine-tuning. Both L1 and L2 penalty for the DAEs and for the logistic regression layer are set to 1e-6.
+
+CAE+MLP with Supervised Finetuning: A regularized auto-encoder which sometimes outperforms the DAE is the Contractive Auto-Encoder (CAE), (Rifai et al., 2012), which penalizes the Frobenius norm of the Jacobian matrix of derivatives of the hidden units with respect to the CAE’s inputs. The CAE serves as pre-training for an MLP, and in the supervised fine-tuning state, the Adagrad method was used to automatically tune the learning rate (Duchi et al., 2010).
+
+After training a CAE with 100 sigmoidal units patch-wise, the features extracted on each patch are concatenated and fed as input to an MLP. The selected Jacobian penalty coefficient is 2, the learning rate for pre-training is 0.082 with batch size of 200 and 200 epochs of unsupervised learning are performed on the training set. For supervised finetuning, the learning rate is 0.12 over 100 epochs, L1 and L2 regularization penalty terms respectively are 1e-4 and 1e-6, and the top-level MLP has 6400 hidden units.
+
+Greedy Layerwise CAE+DAE Supervised Finetuning: For this experiment we stack a CAE with sigmoid non-linearities and then a DAE with rectifier non-linearities during the pretraining phase. As recommended by Glorot et al. (2011b) we have used a softplus nonlinearity for reconstruction, $s o f t p l u s ( x ) = l o g ( 1 + e ^ { x } )$ . We used an L1 penalty on the rectifier outputs to obtain a sparser representation with rectifier non-linearity and L2 regularization to keep the non-zero weights small.
+
+The main difference between the DAE and CAE is that the DAE yields more robust reconstruction whereas the CAE obtains more robust features (Rifai et al., 2011).
+
+As seen on Figure 7 the weights U and V are shared on each patch and we concatenate the outputs of the last auto-encoder on each patch to feed it as an input to an MLP with a large hidden layer.
+
+We used 400 hidden units for the CAE and 100 hidden units for DAE. The learning rate used for the CAE is 0.82 and for DAE it is ${ 9 ^ { * } } 1 { \mathrm { e } } { - 3 }$ . The corruption level for the DAE (binomial noise) is 0.25 and the contraction level for the CAE is 2.0. The L1 regularization penalty for the DAE is 2.25\*1e-4 and the L2 penalty is $9 . 5 ^ { * } 1 \mathrm { e } \mathrm { - } 5$ . For the supervised finetuning phase the learning rate used is 4\*1e-4 with L1 and L2 penalties respectively 1e-5 and 1e-6. The top-level MLP has 6400 hidden units. The auto-encoders are each trained for 150 epochs while the whole MLP is fine-tuned for 50 epochs.
+
+Greedy Layerwise DAE+DAE Supervised Finetuning: For this architecture, we have trained two layers of denoising auto-encoders greedily and performed supervised finetuning after unsupervised pre-training. The motivation for using two denoising auto-encoders is the fact that rectifier nonlinearities work well with the deep networks but it is difficult to train CAEs with the rectifier non-linearity. We have used the same type of denoising auto-encoder that is used for the greedy layerwise CAE+DAE supervised finetuning experiment.
+
+In this experiment we have used 400 hidden units for the first layer DAE and 100 hidden units for the second layer DAE. The other hyperparameters for DAE and supervised finetuning are the same as with the CAE+DAE MLP Supervised Finetuning experiment.
\ No newline at end of file
diff --git a/md/train/SVsLxTfHa1/SVsLxTfHa1.md b/md/train/SVsLxTfHa1/SVsLxTfHa1.md
new file mode 100644
index 0000000000000000000000000000000000000000..dbaf0470b3beb48312bee432afe6def9e95d28a9
--- /dev/null
+++ b/md/train/SVsLxTfHa1/SVsLxTfHa1.md
@@ -0,0 +1,385 @@
+# TOWARDS MULTI-SENSE CROSS-LINGUAL ALIGNMENT OF CONTEXTUAL EMBEDDINGS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Cross-lingual word embeddings (CLWE) have been proven useful in many crosslingual tasks. However, most existing approaches to learn CLWE including the ones with contextual embeddings are sense agnostic. In this work, we propose a novel framework to align contextual embeddings at the sense level by leveraging cross-lingual signal from bilingual dictionaries only. We operationalize our framework by first proposing a novel sense-aware cross entropy loss to model word senses explicitly. The monolingual ELMo and BERT models pretrained with our sense-aware cross entropy loss demonstrate significant performance improvement for word sense disambiguation tasks. We then propose a sense alignment objective on top of the sense-aware cross entropy loss for cross-lingual model pretraining, and pretrain cross-lingual models for several language pairs (English to German/Spanish/Japanese/Chinese). Compared with the best baseline results, our cross-lingual models achieve $0 . 5 2 \%$ , $2 . 0 9 \%$ and $1 . 2 9 \%$ average performance improvements on zero-shot cross-lingual NER, sentiment classification and XNLI tasks, respectively. We will release our code.
+
+# 1 INTRODUCTION
+
+Cross-lingual word embeddings (CLWE) provide a shared representation space for knowledge transfer between languages, yielding state-of-the-art performance in many cross-lingual natural language processing (NLP) tasks. Most of the previous works have focused on aligning static embeddings. To utilize the richer information captured by the pre-trained language model, more recent approaches attempt to extend previous methods to align contextual representations.
+
+Aligning the dynamic and complex contextual spaces poses significant challenges, so most of the existing approaches only perform coarse-grained alignment. Schuster et al. (2019) compute the average of contextual embeddings for each word as an anchor, and then learn to align the static anchors using a bilingual dictionary. In another work, Aldarmaki & Diab (2019) use parallel sentences in their approach, where they compute sentence representations by taking the average of contextual word embeddings, and then they learn a projection matrix to align sentence representations. They find that the learned projection matrix also works well for word-level NLP tasks. Besides, unsupervised multilingual language models (Devlin et al., 2018; Artetxe & Schwenk, 2019; Conneau et al., 2019; Liu et al., 2020) pretrained on multilingual corpora have also demonstrated strong cross-lingual transfer performance. Cao et al. (2020) and Wang et al. (2020) show that unsupervised multilingual language model can be further aligned with parallel sentences.
+
+Though contextual word embeddings are intended to provide different representations of the same word in distinct contexts, Schuster et al. (2019) find that the contextual embeddings of different senses of one word are much closer compared with that of different words. This contributes to the anisomorphic embedding distribution of different languages and causes problems for cross-lingual alignment. For example, it will be difficult to align the English word bank and its Japanese translations 銀行 and 岸 that correspond to its two different senses, since the contextual embeddings of different senses of bank are close to each other while those of 銀行 and 岸 are far. Recently, Zhang et al. (2019) propose two solutions to handle multi-sense words: 1) remove multi-sense words and then align anchors in the same way as Schuster et al. (2019); 2) generate cluster level average anchor for contextual embeddings of multi-sense words and then learn a projection matrix in an unsupervised way with MUSE (Conneau et al., 2017). They do not make good use of the bilingual dictionaries, which are usually easy to obtain, even in low-resource scenarios. Moreover, their projection-based approach still cannot handle the anisomorphic embedding distribution problem.
+
+In this work, we propose a novel sense-aware cross entropy loss to model multiple word senses explicitly, and then leverage a sense level translation task on top of it for cross-lingual model pretraining. The proposed sense level translation task enables our models to provide more isomorphic and better aligned cross-lingual embeddings. We only use the cross-lingual signal from bilingual dictionaries for supervision. Our pretrained models demonstrate consistent performance improvements on zero-shot cross-lingual NER, sentiment classification and XNLI tasks. Though pretrained on less data, our model achieves the state-of-the-art result on zero-shot cross-lingual German NER task. To the best of our knowledge, we are the first to perform sense-level contextual embedding alignment with only bilingual dictionaries.
+
+# 2 BACKGROUND: PREDICTION TASKS OF LANGUAGE MODELS
+
+Next token prediction and masked token prediction are two common tasks in neural language model pretraining. We take two well-known language models, ELMo (Peters et al., 2018) and BERT (Devlin et al., 2018), as examples to illustrate these two tasks (architectures are shown in Appendix A).
+
+Next token prediction ELMo uses next token prediction tasks in a bidirectional language model. Given a sequence of $N$ tokens $( t _ { 1 } , t _ { 2 } , \ldots , t _ { N } )$ , it first prepares a context independent representation for each token by using a convolutional neural network over the characters or by word embedding lookup (a.k.a. input embeddings). These representations are then fed into $L$ layers of LSTMs to generate the contextual representations: $h _ { i , j }$ for token $t _ { i }$ at layer $j$ . The model assigns a learnable output embedding $\pmb { w }$ for each token in the vocabulary, which has the same dimension as $h _ { i , L }$ . Then, the forward language model predicts the token at position $k$ with:
+
+$$
+p ( t _ { k } | t _ { 1 } , t _ { 2 } , \dots , t _ { k - 1 } ) = \mathrm { s o f t m a x } ( h _ { k - 1 , L } ^ { \mathsf { T } } w _ { k ^ { \prime } } ) = \frac { \exp ( h _ { k - 1 , L } ^ { \mathsf { T } } w _ { k ^ { \prime } } ) } { \sum _ { i = 1 } ^ { V } \exp ( h _ { k - 1 , L } ^ { \mathsf { T } } w _ { i } ) }
+$$
+
+where $k ^ { \prime }$ is the index of token $t _ { k }$ in the vocabulary, $V$ is the size of the vocabulary, and $( \pmb { w } _ { 1 } , \dots , \pmb { w } _ { V } )$ are the output embeddings for the tokens in the vocabulary. The backward language model is similar to the forward one, except that tokens are predicted in the reverse order. Since the forward and backward language models are very similar, we will only describe our proposed approach in the context of the forward language model in the subsequent sections.
+
+Masked token prediction The Masked Language Model (MLM) in BERT is a typical example of masked token prediction. Given a sequence $( t _ { 1 } , t _ { 2 } , \ldots , t _ { N } )$ , this approach randomly masks a certain percentage $( 1 5 \% )$ of the tokens and generates a masked sequence $( m _ { 1 } , m _ { 2 } , \ldots , m _ { N } )$ , where $m _ { k } = [ m a s k ]$ if the token at position $k$ is masked, otherwise $m _ { k } = t _ { k }$ . BERT first prepares the context independent representations $( \pmb { x } _ { 1 } , \pmb { x } _ { 2 } , \dots , \pmb { x } _ { N } )$ of the masked sequence via token embeddings. It is then fed into $L$ layers of transformer encoder (Vaswani et al., 2017) to generate “bidirectional” contextual token representations. The final layer representations are then used to predict the masked token at position $k$ as follows:
+
+$$
+p ( m _ { k } = t _ { k } | m _ { 1 } , \dots , m _ { N } ) = \mathrm { s o f t m a x } ( h _ { k , L } ^ { \top } w _ { k ^ { \prime } } ) = \frac { \exp ( h _ { k , L } ^ { \top } w _ { k ^ { \prime } } ) } { \sum _ { i = 1 } ^ { V } \exp ( h _ { k , L } ^ { \top } w _ { i } ) }
+$$
+
+where $k ^ { \prime } , V ,$ $^ { h }$ and $\textbf { \em w }$ are similarly defined as in Eq. 1. Unlike ELMo, BERT ties the input and output embeddings.
+
+# 3 PROPOSED FRAMEWORK
+
+We first describe our proposed sense-aware cross entropy loss to model multiple word senses explicitly in language model pretraining. Then, we present our joint training approach with sense alignment objective for cross-lingual mapping of contextual word embeddings. The proposed framework can be applied to most of the recent neural language models, such as ELMo, BERT and their variants. See Table 1 for a summary of the main notations used in this paper.
+
+# 3.1 SENSE-AWARE CROSS ENTROPY LOSS
+
+Limitations of original training objectives The training tasks with Eq. 1 and 2 maximize the normalized dot product of contextual representations $( h _ { k - 1 , L }$ or $\displaystyle h _ { k , L } )$ ) with a weight vector $\pmb { w } _ { k ^ { \prime } }$ . The only difference is that $h _ { k - 1 , L }$ in Eq. 1 encodes the information of previous tokens in the sequence, while $h _ { k , L }$ in Eq. 2 encodes the information of the masked sequence. Therefore, without loss of generality, we use $h _ { k ^ { * } , L }$ to denote the contextual representation for predicting the next or masked token $t _ { k }$ .
+
+Even though contextual language models like ELMo and BERT provide a different token representation for each distinct context, the learned representations are not guaranteed to be sense separated. For example, Schuster et al. (2019) computed the average of ELMo embeddings for each word as an anchor, and found that the average cosine distance between contextual em
+
+Table 1: Summary of the main notations
+
+
Notation
Description
tk
k-th token in sentence
tk,s
s-th sense of tk
k'
index of token tk in vocabulary
L
number ofLSTM/Transformer layers
V
size of vocabulary
S
maximum number of senses per token
hk,j
contextual representation of token tk in layer j
hk*,L
contextual representation used in softmax function for predicting tk
Ui
i-th word in vocabulary
Ui,s
s-th sense of Ui
Wi
output embedding of Ui
Wi,s
context-dependent output embedding (i.e. sense vector) of Ui,s
Ci,s
sense cluster center of Ui,s
C
sense cluster centers of Ui
d
dimension of contextual representations
P
projection matrix for dimension reduction
+
+beddings of multi-sense words and their corresponding anchors are much smaller than the average distance between anchors, which mean that the embeddings of different senses of one word are relatively near to each other comparing to that of different words. We also observed the same with BERT embeddings. This finding suggests that sense clusters of a multi-sense word’s appearances are not well separated in the embedding space, and the current contextual language models still have room for improvement by considering finer-grained word sense disambiguation.
+
+Notice that there is only one weight vector $\pmb { w } _ { k ^ { \prime } }$ for predicting the token $t _ { k }$ in the original training tasks. Ideally, we should treat the appearances of a multi-sense word in different contexts as different tokens, and train the language models to predict different senses of the word. In the following, we propose a novel sense-aware cross entropy loss to explicitly model different senses of a word in different contexts.
+
+Sense-aware cross entropy loss Given a sequence $( t _ { 1 } , t _ { 2 } , \ldots , t _ { N } )$ , our proposed framework generates contextual representations $( h _ { k , j }$ for token $t _ { k }$ in layer $j \in \{ 1 , \dots , L \} )$ in the same way as the standard LMs. Different from existing methods, our approach maintains multiple context-dependent output embeddings (henceforth, sense vectors) for each token. Specifically, let $S$ be the maximum number of senses per token. Each word $v _ { i }$ in the vocabulary contains $S$ separate sense vectors $( \pmb { w } _ { i , 1 } , \pmb { w } _ { i , 2 } , \ldots , \pmb { w } _ { i , S } )$ , where each $w _ { i , s }$ corresponds to a different sense (see Appendix for some interesting visualization examples). Following the notation in Section 2, we use $k ^ { \prime }$ to denote the index of the output token $t _ { k }$ in the vocabulary. Therefore, the sense vectors of $t _ { k }$ can be represented by $( { \pmb w } _ { k ^ { \prime } , 1 } , { \pmb w } _ { k ^ { \prime } , 2 } , \dots , { \pmb w } _ { k ^ { \prime } , S } )$ , which are randomly initialized and of the same dimension as $h _ { k ^ { * } , L }$ Note that we untie the input and output embeddings in our framework.
+
+We propose a word sense selection method shown in Algorithm 1 to select the most likely sense vector when training with sense-level cross entropy loss. Figure 1 shows the architecture of our proposed models. Assuming sense $s ^ { \prime }$ is selected for token $t _ { k }$ (which means sense vector $_ { w _ { k ^ { \prime } , s ^ { \prime } } }$ should be used), we have the following new prediction task:
+
+$$
+p ( t _ { k , s ^ { \prime } } | c o n t e x t ) = \mathrm { s o f t m a x } ( h _ { k ^ { * } , L } ^ { \top } w _ { k ^ { \prime } , s ^ { \prime } } ) = \frac { \exp ( h _ { k ^ { * } , L } ^ { \top } w _ { k ^ { \prime } , s ^ { \prime } } ) } { \sum _ { i = 1 } ^ { V } \sum _ { s = 1 } ^ { S } \exp ( h _ { k ^ { * } , L } ^ { \top } w _ { i , s } ) }
+$$
+
+The sense-aware cross entropy loss for word sense prediction is defined as follows:
+
+$$
+\mathcal { L } _ { \mathrm { S E N S E } } = - \log ( p ( t _ { k , s ^ { \prime } } | c o n t e x t ) )
+$$
+
+Word sense selection algorithm Word sense selection when training the language model can be handled as a non-stationary data stream clustering problem (Aggarwal et al., 2004; Khalilian & Mustapha, 2010; Abdullatif et al., 2018). The most intuitive way to select the corresponding sense
+
+(a) Sense-aware next token prediction
+
+
+(b) Sense-aware masked token prediction
+(c) Word sense selection
+Figure 1: Our proposed framework for sense-aware next token1and masked token prediction tasks. Figure (c) shows an example of word sense selection, where the two sense clusters of $t _ { k }$ (assume its vocabulary index is $k ^ { \prime }$ ) are shifting in space. Center vectors $\pmb { c } _ { k ^ { \prime } , 1 }$ and $\mathbf { c } _ { k ^ { \prime } , 2 }$ are used to locate cluster centers. Given $h _ { k , L }$ , the algorithm performs dimension reduction on both $h _ { k , L }$ and center vectors, and then finds the most close cluster center $\mathbf { c } _ { k ^ { \prime } , 2 }$ , so we know the output embedding corresponding to sense 2 $( w _ { k ^ { \prime } , 2 } )$ should be used in the loss function. $\mathbf { c } _ { k ^ { \prime } , 2 }$ also makes a small step towards $h _ { k , L }$ .
+
+vector for $h _ { k ^ { * } , L }$ is to select the vector $w _ { k ^ { \prime } , s }$ with the maximum dot product value $h _ { k ^ { * } , L } ^ { \top } w _ { k ^ { \prime } , s }$ , or cosine similarity value $c o s s i m ( h _ { k ^ { * } , L } , { \pmb w } _ { k ^ { \prime } , s } )$ . However, our experiments show that these methods do not work well due to curse of dimensionality, suboptimal learning rate and noisy $h _ { k ^ { * } , L }$ . We apply an online $\mathbf { k }$ -means algorithm to cluster different senses of a word in Algorithm 1. For each sense vector $w _ { i , s }$ , we maintain a cluster center $\mathbf { } _ { c _ { i , s } }$ which is of the same dimension as $_ { w _ { i , s } }$ . Therefore, each token $v _ { i }$ in the vocabulary has $S$ such cluster center vectors, denoted by $\boldsymbol { C } _ { i } = ( c _ { i , 1 } , c _ { i , 2 } , \ldots , c _ { i , S } )$ . When predicting token $t _ { k }$ in a given sequence, we apply Algorithm 1 to select the best sense vector based on $h _ { k , L }$ (see Figure 1). Notice that $h _ { k , L }$ is different from $h _ { k ^ { * } , L }$ for next token prediction (Figure 1a) for which $h _ { k ^ { * } , L } = h _ { k - 1 , L }$ . The cluster centers $C _ { i }$ are not neural network parameters; instead, they are randomly initialized using a normal distribution ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } )$ and updated through Algorithm 1. In addition, we also maintain a projection matrix $_ { P }$ for dimension reduction to facilitate effective sense clustering. $P \in \mathbb { R } ^ { d \times d ^ { \prime } }$ projects $h _ { k , L }$ and $\mathbf { { c } } _ { i , s }$ from dimension $d$ to $d ^ { \prime }$ , and is shared by all tokens in vocabulary. Similar to $C$ , $_ { P }$ is also randomly initialized with normal distribution $\mathcal { N } ( 0 , 1 )$ , and then updated through Algorithm 2. Both Algorithm 1 and 2 run in parallel, and are interrupted when the language model stops training.
+
+Some rationales behind our algorithm design are the following:
+
+# Algorithm 1 Word sense selection
+
+# Algorithm 2 Projection matrix $_ { r }$ update
+
+1: Hyper-parameters: number of senses $S$ , sense learning rate $\alpha$
+2: Initialize the set of all sense cluster centers $_ { C }$
+3: repeat
+4: input: ${ h } _ { k , L }$ , vocabulary index $k ^ { \prime }$ of the token to predict
+5: Lookup sense cluster centers for $k ^ { \prime } \colon C _ { k ^ { \prime } } =$ $\{ c _ { k ^ { \prime } , 1 } , \bar { c } _ { k ^ { \prime } , 2 } , \ldots , c _ { k ^ { \prime } , S } \}$
+6: ${ \pmb P } =$ updated projection matrix from Alg. 2
+7: if cosine similarity between $\pmb { c } _ { k ^ { \prime } , s ^ { \prime } } \pmb { P }$ and $\pmb { h } _ { k } ^ { \prime } \pmb { P }$ is the largest among the vectors in $C _ { k ^ { \prime } }$ then
+8: $\mathbf { c } _ { k ^ { \prime } , s ^ { \prime } } = ( 1 - \alpha ) \mathbf { c } _ { k ^ { \prime } , s ^ { \prime } } + \alpha \mathbf { h } _ { k , L }$
+9: output: $s ^ { \prime } ( \boldsymbol { w } _ { k ^ { \prime } , s ^ { \prime } }$ should be selected)
+10: end if
+11: until interrupted
+
+1: Hyper-parameters: projection dimension $d ^ { \prime }$ , up
+date interval $M$ , queue size $Q$
+2: Initialize $_ { r }$ with $\mathcal { N } ( 0 , 1 )$ , queue $H = \emptyset , m = 0$
+3: repeat
+4: input: ${ h } _ { k , L }$
+5: $m = m + 1$
+6: Add ${ h } _ { k , L }$ to queue $H$
+7: if $s i z e ( H ) > Q$ then
+8: Pop the oldest element from queue $H$ .
+9: end if
+10: if $m > = M$ then
+11: ${ \pmb { P } } =$ the first $d ^ { \prime }$ PCA components of $H$
+12: $m = 0$
+13: end if
+14: output: $_ { r }$
+15: until interrupted
+
+• Directly computing cosine similarity between $\boldsymbol { c } _ { \boldsymbol { k } ^ { \prime } , s }$ and $h _ { k , L }$ suffers from the curse of dimensionality. We maintain $_ { r }$ for dimension reduction. Although many algorithms use random projection for dimension reduction, we find using PCA components can help improve clustering accuracy. Since the neural model parameters keep being updated during training, the sense clusters become non-stationary, i.e., their locations keep changing. Experiments shows that when using $_ { r }$ for dimension reduction, a slightly larger projection dimension $d ^ { \prime }$ will make the clustering algorithm less sensitive to cluster location change. We use $d ^ { \prime } = 1 6$ for ELMo, and $d ^ { \prime } = 1 4$ for BERT. We also notice that the sense clustering works well even if $_ { P }$ is updated sporadically. We can set a relatively large update interval in Algorithm 2 to reduce computation cost. • A separate sense learning rate $\alpha$ should be set for the clustering algorithm. A large $\alpha$ makes the algorithm less robust to noise, while a small $\alpha$ leads to slow convergence. • It is essential to use the current token’s contextual representation $h _ { k , L }$ for sense selection even though we use $h _ { k ^ { * } , L } = h _ { k - 1 , L }$ in the next token prediction task. If we use $h _ { k - 1 , L }$ for sense selection, experiments show that most of the variance comes from input embedding ${ \bf { \mathcal { x } } } _ { k - 1 }$ . This introduces too much noise for word sense clustering.
+
+Dynamic pruning of redundant word senses To make the training more efficient, we keep track of relative sense selection frequency for each token in the vocabulary. Assume token $v _ { i }$ has initial senses $( v _ { i , 1 } , v _ { i , 2 } , \ldots , v _ { i , S } )$ , for which we compute the relative frequency $\rho ( v _ { i , s } )$ such that $0 \leq \rho ( v _ { i , s } ) \leq 1$ and $\begin{array} { r } { \sum _ { s } \rho ( v _ { i , s } ) = 1 } \end{array}$ . A lower $\rho ( v _ { i , s } )$ means the sense is less frequently selected compared with others. We check the relative frequencies after every $E$ training steps, and if $\rho ( v _ { i , s } ) < \beta$ (a threshold hyper-parameter), $v _ { i , s }$ is removed from the list of senses of $v _ { i }$ .
+
+Remark on model size and parameters The sense cluster centers $C$ and the projection matrix $_ { r }$ are only used to facilitate sense selection during model pretraining, which are not neural model parameters. The sense vectors $w _ { i , s }$ will no longer be used after pretraining, which can also be discarded. Therefore, our models and the original models have exactly the same number of parameters when transferred to downstream tasks.
+
+Remark on model complexity The computational complexity of our algorithm is linear with respect to the size of data, so our method is scalable to train on very large datasets.
+
+# 3.2 JOINT TRAINING WITH SENSE LEVEL TRANSLATION
+
+Training language model with sense-aware cross entropy loss helps to learn contextual token representations that are sufficiently distinct for different senses $( \ S 4 . 1 )$ . In this subsection, we extend it to cross-lingual settings and present a novel approach to learn cross-lingual contextual word embeddings at the sense level. Our approach uses a bilingual seed dictionary,2 and can be applied to both next and masked token prediction tasks.
+
+For training the cross-lingual LM, we concatenate the (non-parallel) corpora of two languages, $L _ { 1 }$ and $L _ { 2 }$ , and construct a joint vocabulary $O = O ^ { L _ { 1 } } \cup O ^ { L _ { 2 } }$ , where $O ^ { { \cal L } _ { 1 } }$ and $O ^ { L _ { 2 } }$ are the vocabularies of $L _ { 1 }$ and $L _ { 2 }$ , respectively. Algorithm 1 is used to model the senses of tokens in the joint vocabulary. In addition to predicting the correct monolingual sense $p ( t _ { k , s ^ { \prime } } | c o n t e x t )$ in Eq. 3, we also train the model to predict its sense level translation. Let $v _ { j }$ be the translation of $t _ { k }$ and sense $v _ { j , s ^ { * } }$ of $v _ { j }$ be the best sense level translation under the given context, we add the following sense-level translation prediction task to maximize probability of $v _ { j , s ^ { * } }$ .
+
+$$
+p ( v _ { j , s ^ { * } } | c o n t e x t ) = \mathrm { s o f t m a x } ( h _ { k ^ { * } , L } ^ { \top } w _ { j , s ^ { * } } ) = \frac { \exp ( h _ { k ^ { * } , L } ^ { \top } w _ { j , s ^ { * } } ) } { \sum _ { i = 1 } ^ { V } \sum _ { s = 1 } ^ { S } \exp ( h _ { k ^ { * } , L } ^ { \top } w _ { i , s } ) }
+$$
+
+where ${ \pmb w } _ { j , s ^ { * } }$ is the corresponding sense vector of $v _ { j , s ^ { * } }$
+
+Similar to the previous subsection, we maintain sense cluster centers $C _ { i }$ for each token $v _ { i } \in O$ and the shared projection matrix $_ { r }$ to select the best translation sense. Assume $t _ { k }$ has $T$ translations in dictionary, and each translation has $S$ senses, then there are $T \times S$ possible sense level translations for $t _ { k }$ in the given context. If the $c o s s i m ( h _ { k , L } P , c _ { j , s ^ { * } } P )$ value is the largest among the $T \times S$ sense cluster centers, then we select $v _ { j , s ^ { * } }$ as the closest translation. An example is shown in Figure 2.
+
+
+Figure 2: An example of English-Japanese sense-level joint training, which shows two possible Japanese translations (銀行 and 岸) of the English word bank. $h _ { k , L }$ is a contextual representation of bank in finance context and $\mathbf { c } _ { k ^ { \prime } , 2 }$ is the cluster center for this sense. $c _ { a , 1 } , c _ { a , 2 } , c _ { b , 1 } , c _ { b , 2 }$ are different sense cluster centers of the two Japanese translations, among which $^ { c _ { b , 2 } }$ is the closest to $h _ { k , L }$ after dimension reduction through PCA. Our sense level objective (Eq. 6) moves sense clusters for bank (organization) and 銀行(organization) closer to each other.
+
+If token $t _ { k }$ has at least one translation in the dictionary, the translation cross entropy loss can be computed as:
+
+$$
+\mathcal { L } _ { \mathrm { T R A N } } = - \log ( p ( v _ { j , s ^ { * } } | c o n t e x t ) )
+$$
+
+If token $t _ { k }$ has no translation in the seed dictionary, we use Eq. 4 as the only loss. The joint training loss is defined as follows:
+
+$$
+\mathcal { L } _ { \mathrm { J O I N T } } = \left\{ \begin{array} { l l } { \frac { \mathcal { L } _ { \mathrm { S E N S E } } + \mathcal { L } _ { \mathrm { T R A N } } } { 2 } , } & { \mathrm { i f ~ } t _ { k } \mathrm { ~ h a s ~ t r a n s l a t i o n s } } \\ { \mathcal { L } _ { \mathrm { S E N S E } } , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
+$$
+
+Further alignment (optional) Our sense-aware pretraining tries to move similar senses of two different languages close to each other as illustrated in Figure 2. This process makes the sense distributions of the two languages more isomorphic (some sense vector visualization examples are shown in Appendix C). Applying the linear projection approach proposed by Schuster et al. (2019) on top of the language model pretrained with our framework can further improve cross-lingual transfer on some tasks. See Appendix B for more details of our implementation.
+
+# 4 EXPERIMENTS
+
+# 4.1 EXPERIMENTS USING MONOLINGUAL MODELS
+
+To verify the effectiveness of our proposed sense-aware cross entropy loss, we implement the monolingual models on top of ELMo and BERT with the changes described in $\ S 3 . 1$ , which are named SaELMo (Sense-aware ELMo) and SaBERT (Sense-aware BERT) respectively. The algorithm for dynamic pruning of redundant word senses is optional, which is implemented on SaELMo only.
+
+Pretraining settings We use the one billion word language modeling benchmark data (Chelba et al., 2013) to pretrain all the monolingual models. The corpus is preprocessed with the provided scripts, and then converted to lowercase. We do not apply any subword tokenization. We use similar hyper-parameters as Peters et al. (2018) to train the ELMo and SaELMo models, and similar hyperparameters as Devlin et al. (2018) to train 4-layer BERT-Tiny and SaBERT-Tiny. Next sentence prediction task is disabled in BERT-Tiny and SaBERT-Tiny, since this task is irrelevant to our proposed changes. See Appendix D.1 for a complete list of hyper-parameters.
+
+Word sense disambiguation (WSD) Since our context-aware cross entropy loss is designed to learn word senses better in the context, we first conduct experiments to compare our monolingual model with the original models on the WSD task (Raganato et al., 2017), which is a task to associate words in context with the most suitable entry in a pre-defined sense inventory. We use a similar framework as Peters et al. (2018) to evaluate the monolingual models.3 We use SemCor 3.0 (Miller et al., 1993) as training data, and Senseval/SemEval series (Edmonds & Cotton, 2001; Moro & Navigli, 2015; Navigli et al., 2013; Pradhan et al., 2007; Snyder & Palmer, 2004) as test data. We use the pretrained models to compute the average of contextual representations for each sense in training data, and then classify the senses of the target words in test sentences by finding the nearest neighbour.
+
+WSD results are presented in Table 2. SaELMo shows significant performance improvements over the baseline ELMo model in all of the five test sets. SaBERT-Tiny also outperforms BERT-Tiny except on SE07, which is the smallest among the five test sets.
+
+Table 2: Word sense disambiguation (F1 scores)
+
+
Model
SE2
SE3
SE07
SE13
SE15
ELMo
0.555
0.576
0.446
0.544
0.538
SaELMo (ours)
0.575
0.586
0.470
0.560
0.583
BERT-Tiny
0.596
0.539
0.466
0.536
0.572
SaBERT-Tiny (ours)
0.611
0.546
0.446
0.550
0.579
+
+# 4.2 EXPERIMENTS USING BILINGUAL MODELS
+
+To verify the effectiveness of our cross-lingual framework, we implement the bilingual models on top of ELMo, named Bi-SaELMo that does not use linear projection for further alignment and Bi-SaELMo $^ +$ Proj that uses the linear projection. Sense vectors and cluster center vectors are not shared between the forward and backward language models. We use ELMo+Proj and Joint$\mathbf { E L M o + P r o j }$ as our baseline models, where ELMo+Proj is proposed by Schuster et al. (2019) and Joint-ELMo $^ +$ Proj is implemented following the framework recently proposed by Wang et al. (2020). Wang et al. (2020) combine joint training and projection, and claim their framework is applicable to any projection method, so we implement the same projection method as Schuster et al. (2019) did for Joint-ELMo $+$ Proj. We also report results of ELMo and Joint-ELMo, which are the counterparts of ELMo+Proj and Joint-ELMo $^ +$ Proj without using linear projection.
+
+Pretraining settings To pretrain language models, we sample a 500-million-token corpus for each language from the English, German, Spanish, Japanese and Chinese Wikipedia dump. The dictionaries used for pretraining models and learning the projection matrix were downloaded from the MUSE (Conneau et al., 2017) GitHub page4. We also add JMDict (Breen, 2004) to the en-jp MUSE dictionary. Bilingual models were pretrained on en-de, en-es, en-jp and en-zh concatenated data with similar parameters as the monolingual models. ELMo and ELMo+Proj were pretrained on monolingual data, while the projection matrix of ELMo $+$ Proj was learned using bilingual data. See Appendix D.2 for a complete list of hyper-parameters.
+
+Zero-shot cross-lingual NER A BiLSTM-CRF model implemented with the Flair framework (Akbik et al., 2018) is used for this task. For the CoNLL-2002 (Tjong Kim Sang, 2002) and CoNLL-2003 (Sang & De Meulder, 2003) datasets, the NER model was trained on English data, and evaluated on Spanish and German test data. For the OntoNotes 5.0 (Weischedel et al., 2013) dataset, the NER model was trained on all English data and evaluated on all Chinese data. We report the average F1 of 5 runs in Table 3. The results show that all of the models using linear projection outperform their counterparts (not using linear projection), since minimizing token level distance is more important for cross-lingual
+
+Table 3: Zero-shot cross-lingual NER (F1)
+
+
Model
de
es
zh
ELMo
16.30
16.14
0.28
Joint-ELMo
56.49
58.91
53.47
ELMo+Proj (Schuster et al.,2019)
69.57
60.02
63.15
Joint-ELMo+Proj (Wang et al.,2020)
71.59
65.19
59.08
Bi-SaELMo (ours)
63.83
60.65
55.83
Bi-SaELMo+Proj (ours)
72.19
65.86
63.44
For references, but not our baselines,since they are t trainedon1 1much larger datasets and/or parallel sentences.
XLM Finetune (Conneau & Lample, 2019)
67.55
63.18
-
XLM-R Finetune (Conneau et al.,2019)
71.40
78.64
-
M-BERT Finetune (Pires et al., 2019)
69.74
73.59
-
M-BERT Finetune (Wu & Dredze,2019)
69.56
74.96
-
M-BERT Finetune+Adv (Keung et al., 2019)
71.90
74.30
-
M-BERT Feature+Proj (Wang et al.,2020)
70.54
75.77
-
+
+NER tasks. Our sense-aware pretraining makes sense distributions of two languages more isomorphic, which further improves linear projection performance. Our model Bi-SaELMo+Proj demonstrates consistent performance improvement in all the three languages. Moreover, our model outperforms finetuned XLM/XLM-R and Multilingual BERT on German data, and achieves state of the art even though it is pretrained on less data.
+
+Zero-shot cross-lingual sentiment classification We use the multi-lingual multi-domain Amazon review data (Prettenhofer & Stein, 2010) for evaluation on cross-lingual sentiment classification. The ratings in review data are converted into binary labels. The average of contextual word representations is used as the document/sentence representation for each review text/summary, which is then fed into a two-dense-layer model for sentiment classification. All the models are trained on English, and evaluated on German and Japanese test data in the same domain. We report the average accuracy of 5 runs in Table 4. Different from the NER task, the linear projection approach for cross-lingual alignment does not work for this task, since it may add noise to embedding features. Our model Bi-SaELMo demonstrates consistent improvements in all of the 6 evaluation tasks. The performance of Bi-SaELMo is significantly better than Joint-ELMo, which shows that our sense-level translation pretraining objective improves cross-lingual embedding alignment.
+
+Table 4: Zero-shot sentiment classification accuracy
+
+
Model
de
jp
books
music
dvd
books
music
dvd
ELMo
52.94
63.61
57.78
50.37
51.59
54.32
Joint-ELMo
71.72
75.22
64.25
66.64
68.50
58.54
ELMo+Proj (Schuster et al., 2019)
49.92
50.29
49.94
50.57
49.59
50.65
Joint-ELMo+Proj (Wang et al.,2020)
75.74
72.25
72.25
62.50
59.77
57.65
Bi-SaELMo (ours)
77.46
75.32
74.97
68.16
69.48
64.04
Bi-SaELMo+Proj (ours)
70.84
66.25
68.99
62.17
55.91
61.57
+
+Table 5: Zero-shot XNLI accuracy
+
+
Model
de
es
zh
ELMo
34.07
33.41
35.77
Joint-ELMo
60.12
63.73
57.82
ELMo+Proj (Schuster et al.,2019)
55.51
58.92
53.17
Joint-ELMo+Proj (Wang et al.,2020)
63.33
64.71
58.34
Bi-SaELMo (ours)
60.98
62.75
60.40
Bi-SaELMo+Proj (ours)
64.77
65.05
60.44
+
+Zero-shot cross-lingual natural language inference (XNLI) We use XNLI (Conneau et al., 2018) and MultiNLI (Williams et al., 2018) data for evaluation on this task. The Bi-LSTM baseline model5 was trained on MultiNLI English training data, and then evaluated on XNLI German, Spanish, Chinese test data. We report the average zero-shot XNLI accuracy of 2 runs in Table 5. Our models show consistent improvements over the baselines on all of the three data sets. For zero-shot transfer to Chinese, both of our models outperform the best baseline by more than 2 points, which again demonstrates the effectiveness of our framework on distant language pairs.
+
+# 5 RELATED WORK
+
+Cross-lingual word embedding demonstrates strong performance in many cross-lingual transfer tasks. The projection-based approach has a long line of research on aligning static embeddings (Mikolov et al., 2013; Xing et al., 2015; Smith et al., 2017; Joulin et al., 2018). It assumes that the embedding spaces of different languages have an isomorphic structure, and fit an orthogonal matrix to project multiple monolingual embedding spaces to a shared space. Recent studies (Schuster et al., 2019; Aldarmaki & Diab, 2019) have extended this approach to contextual representation alignment. Besides, there are also many discussions on the limitations of the projection-based approach, arguing that the isomorphic assumption is not true in general (Nakashole & Flauger, 2018; Patra et al., 2018; Søgaard et al., 2018; Ormazabal et al., 2019). Joint training is another line of research and early methods (Gouws et al., 2015; Luong et al., 2015; Ammar et al., 2016) learn static word embeddings of multiple languages simultaneously. Extending joint training to cross- or multi-lingual language model pretraining has gained more attention recently. As discussed above, unsupervised multilingual language models (Devlin et al., 2018; Artetxe & Schwenk, 2019; Conneau & Lample, 2019; Conneau et al., 2019; Liu et al., 2020) also demonstrate strong cross-lingual transfer performance.
+
+There has been some work on sense-aware language models/embeddings (Rothe & Schutze, 2015; ¨ Pilehvar & Collier, 2016; Hedderich et al., 2019), and most of them require WordNet (Miller, 1998) or other additional resource for supervision. Suster et al. (2016) utilize both monolingual and bilingual ˇ information from parallel corpora to learn multi-sense word embeddings. Peters et al. (2019) embed WordNet knowledge into BERT with attention mechanism. Levine et al. (2019) pretrain SenseBERT to predict both the masked words and their WordNet supersenses. Similar to our framework, there are also some unsupervised approaches, but most of them are used to learn static embeddings. Huang et al. (2012) learn word representations with both local and global context, and then apply a clustering algorithm to learn multi-prototype vectors. Neelakantan et al. (2014) propose an extension to the Skip-gram model that leverage $\mathbf { k }$ -means clustering algorithm learns multiple embeddings per word type. Lee & Chen (2017) leverage reinforcement learning for modularized unsupervised sense level embedding learning. Boyd-Graber et al. (2020) use Gumbel softmax for sense disambiguation when learning sense embeddings.
+
+# 6 CONCLUSIONS
+
+In this paper, we have introduced a novel sense-aware cross entropy loss to model word senses explicitly, then we have further proposed a sense-level alignment objective for cross-lingual model pretraining using only bilingual dictionaries. The results of the experiments show the effectiveness of our monolingual and bilingual models on WSD, zero-shot cross-lingual NER, sentiment classification and XNLI tasks. In future work, we will study how to effectively extend our method to multilingual models. In addition, using the sense cluster centers to learn the linear projection matrix would be another promising direction to further improve cross-lingual alignment.
+
+# REFERENCES
+
+Amr Abdullatif, Francesco Masulli, and Stefano Rovetta. Clustering of nonstationary data streams: A survey of fuzzy partitional methods. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 8(4):e1258, 2018.
+
+Charu C Aggarwal, Jiawei Han, Jianyong Wang, and Philip S Yu. A framework for projected clustering of high dimensional data streams. In Proceedings of the Thirtieth international conference on Very large data bases-Volume 30, pp. 852–863, 2004.
+
+Alan Akbik, Duncan Blythe, and Roland Vollgraf. Contextual string embeddings for sequence labeling. In COLING 2018, 27th International Conference on Computational Linguistics, pp. 1638–1649, 2018.
+
+Hanan Aldarmaki and Mona Diab. Context-aware crosslingual mapping. arXiv preprint arXiv:1903.03243, 2019.
+
+Waleed Ammar, George Mulcaire, Yulia Tsvetkov, Guillaume Lample, Chris Dyer, and Noah A Smith. Massively multilingual word embeddings. arXiv preprint arXiv:1602.01925, 2016.
+
+Mikel Artetxe and Holger Schwenk. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. Transactions of the Association for Computational Linguistics, 7:597–610, Mar 2019. ISSN 2307-387X. doi: 10.1162/tacl a 00288. URL http://dx.doi. org/10.1162/tacl_a_00288.
+
+Jordan Boyd-Graber, Fenfei Guo, Leah Findlater, and Mohit Iyyer. Which evaluations uncover sense representations that actually make sense? In Proceedings of the 12th Language Resources and Evaluation Conference, pp. 1727–1738, Marseille, France, May 2020. European Language Resources Association. ISBN 979-10-95546-34-4. URL https://www.aclweb.org/anthology/ 2020.lrec-1.214.
+
+Jim Breen. Jmdict: a japanese-multilingual dictionary. In Proceedings of the workshop on multilingual linguistic resources, pp. 65–72, 2004.
+
+Steven Cao, Nikita Kitaev, and Dan Klein. Multilingual alignment of contextual word representations. arXiv preprint arXiv:2002.03518, 2020.
+
+Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling, 2013.
+
+Alexis Conneau and Guillaume Lample. Cross-lingual language model pretraining. In Advances in Neural Information Processing Systems, pp. 7057–7067, 2019.
+
+Alexis Conneau, Guillaume Lample, Marc’Aurelio Ranzato, Ludovic Denoyer, and Herve J ´ egou. ´ Word translation without parallel data. arXiv preprint arXiv:1710.04087, 2017.
+
+Alexis Conneau, Ruty Rinott, Guillaume Lample, Adina Williams, Samuel R. Bowman, Holger Schwenk, and Veselin Stoyanov. Xnli: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2018.
+
+Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzman, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised ´ cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116, 2019.
+
+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.
+
+Philip Edmonds and Scott Cotton. Senseval-2: overview. In Proceedings of SENSEVAL-2 Second International Workshop on Evaluating Word Sense Disambiguation Systems, pp. 1–5, 2001.
+
+Stephan Gouws, Yoshua Bengio, and Greg Corrado. Bilbowa: Fast bilingual distributed representations without word alignments. In Proceedings of the 32nd International Conference on Machine Learning, 2015.
+
+Michael A. Hedderich, Andrew Yates, Dietrich Klakow, and Gerard de Melo. Using multi-sense vector embeddings for reverse dictionaries. In Proceedings of the 13th International Conference on Computational Semantics - Long Papers, pp. 247–258, Gothenburg, Sweden, May 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-0421. URL https://www. aclweb.org/anthology/W19-0421.
+
+Eric Huang, Richard Socher, Christopher Manning, and Andrew Ng. Improving word representations via global context and multiple word prototypes. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 873–882, Jeju Island, Korea, July 2012. Association for Computational Linguistics. URL https://www.aclweb. org/anthology/P12-1092.
+
+Armand Joulin, Piotr Bojanowski, Tomas Mikolov, Herve J ´ egou, and Edouard Grave. Loss in transla- ´ tion: Learning bilingual word mapping with a retrieval criterion. arXiv preprint arXiv:1804.07745, 2018.
+
+Phillip Keung, Yichao Lu, and Vikas Bhardwaj. Adversarial learning with contextual embeddings for zero-resource cross-lingual classification and ner. arXiv preprint arXiv:1909.00153, 2019.
+
+Madjid Khalilian and Norwati Mustapha. Data stream clustering: Challenges and issues. arXiv preprint arXiv:1006.5261, 2010.
+
+Guang-He Lee and Yun-Nung Chen. MUSE: Modularizing unsupervised sense embeddings. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 327–337, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1034. URL https://www.aclweb.org/anthology/D17-1034.
+
+Yoav Levine, Barak Lenz, Or Dagan, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon Shashua, and Yoav Shoham. Sensebert: Driving some sense into bert. arXiv preprint arXiv:1908.05646, 2019.
+
+Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation, 2020.
+
+Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Bilingual word representations with monolingual quality in mind. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, pp. 151–159, 2015.
+
+Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pp. 55–60, 2014. URL http://www. aclweb.org/anthology/P/P14/P14-5010.
+
+Tomas Mikolov, Quoc V Le, and Ilya Sutskever. Exploiting similarities among languages for machine translation. arXiv preprint arXiv:1309.4168, 2013.
+
+George A Miller. WordNet: An electronic lexical database. MIT press, 1998.
+
+George A Miller, Claudia Leacock, Randee Tengi, and Ross T Bunker. A semantic concordance. In Proceedings of the workshop on Human Language Technology, pp. 303–308. Association for Computational Linguistics, 1993.
+
+Andrea Moro and Roberto Navigli. Semeval-2015 task 13: Multilingual all-words sense disambiguation and entity linking. In Proceedings of the 9th international workshop on semantic evaluation (SemEval 2015), pp. 288–297, 2015.
+
+Ndapa Nakashole and Raphael Flauger. Characterizing departures from linearity in word translation. arXiv preprint arXiv:1806.04508, 2018.
+
+Roberto Navigli, David Jurgens, and Daniele Vannella. Semeval-2013 task 12: Multilingual word sense disambiguation. In Second Joint Conference on Lexical and Computational Semantics (\* SEM), Volume 2: Proceedings of the Seventh International Workshop on Semantic Evaluation (SemEval 2013), pp. 222–231, 2013.
+
+Arvind Neelakantan, Jeevan Shankar, Alexandre Passos, and Andrew McCallum. Efficient nonparametric estimation of multiple embeddings per word in vector space. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1059–1069, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1113. URL https://www.aclweb.org/anthology/D14-1113.
+
+Aitor Ormazabal, Mikel Artetxe, Gorka Labaka, Aitor Soroa, and Eneko Agirre. Analyzing the limitations of cross-lingual word embedding mappings. arXiv preprint arXiv:1906.05407, 2019.
+
+Barun Patra, Joel Ruben Antony Moniz, Sarthak Garg, Matthew R Gormley, and Graham Neubig. Bliss in non-isometric embedding spaces. 2018.
+
+Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proc. of NAACL, 2018.
+
+Matthew E Peters, Mark Neumann, Robert L Logan IV, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A Smith. Knowledge enhanced contextual word representations. arXiv preprint arXiv:1909.04164, 2019.
+
+Mohammad Taher Pilehvar and Nigel Collier. De-conflated semantic representations. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1680–1690, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/ D16-1174. URL https://www.aclweb.org/anthology/D16-1174.
+
+Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual bert? arXiv preprint arXiv:1906.01502, 2019.
+
+Sameer Pradhan, Edward Loper, Dmitriy Dligach, and Martha Palmer. Semeval-2007 task-17: English lexical sample, srl and all words. In Proceedings of the fourth international workshop on semantic evaluations (SemEval-2007), pp. 87–92, 2007.
+
+Peter Prettenhofer and Benno Stein. Cross-language text classification using structural correspondence learning. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, pp. 1118–1127, Uppsala, Sweden, July 2010. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/P10-1114.
+
+Alessandro Raganato, Jose Camacho-Collados, and Roberto Navigli. Word sense disambiguation: A unified evaluation framework and empirical comparison. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pp. 99–110, Valencia, Spain, April 2017. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/E17-1010.
+
+Sascha Rothe and Hinrich Schutze. AutoExtend: Extending word embeddings to embeddings ¨ for synsets and lexemes. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1793–1803, Beijing, China, July 2015. Association for Computational Linguistics. doi: 10.3115/v1/P15-1173. URL https://www.aclweb.org/ anthology/P15-1173.
+
+Erik F Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language-independent named entity recognition. arXiv preprint cs/0306050, 2003.
+
+Tal Schuster, Ori Ram, Regina Barzilay, and Amir Globerson. Cross-lingual alignment of contextual word embeddings, with applications to zero-shot dependency 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. 1599–1613, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1162. URL https://www.aclweb.org/anthology/N19-1162.
+
+Samuel L Smith, David HP Turban, Steven Hamblin, and Nils Y Hammerla. Offline bilingual word vectors, orthogonal transformations and the inverted softmax. arXiv preprint arXiv:1702.03859, 2017.
+
+Benjamin Snyder and Martha Palmer. The english all-words task. In Proceedings of SENSEVAL-3, the Third International Workshop on the Evaluation of Systems for the Semantic Analysis of Text, pp. 41–43, 2004.
+
+Anders Søgaard, Sebastian Ruder, and Ivan Vulic. On the limitations of unsupervised bilingual ´ dictionary induction. arXiv preprint arXiv:1805.03620, 2018.
+
+Simon Suster, Ivan Titov, and Gertjan Van Noord. Bilingual learning of multi-sense embeddings with ˇ discrete autoencoders. arXiv preprint arXiv:1603.09128, 2016.
+
+Erik F. Tjong Kim Sang. Introduction to the CoNLL-2002 shared task: Language-independent named entity recognition. In COLING-02: The 6th Conference on Natural Language Learning 2002 (CoNLL-2002), 2002. URL https://www.aclweb.org/anthology/W02-2024.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
+
+Zirui Wang, Jiateng Xie, Ruochen Xu, Yiming Yang, Graham Neubig, and Jaime G. Carbonell. Cross-lingual alignment vs joint training: A comparative study and a simple unified framework. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id ${ . } = { }$ S1l-C0NtwS.
+
+Ralph Weischedel, Martha Palmer, Mitchell Marcus, Eduard Hovy, Sameer Pradhan, Lance Ramshaw, Nianwen Xue, Ann Taylor, Jeff Kaufman, Michelle Franchini, et al. Ontonotes release 5.0 ldc2013t19. Linguistic Data Consortium, Philadelphia, PA, 23, 2013.
+
+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, Volume 1 (Long Papers), pp. 1112–1122. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/N18-1101.
+
+Shijie Wu and Mark Dredze. Beto, bentz, becas: The surprising cross-lingual effectiveness of bert. arXiv preprint arXiv:1904.09077, 2019.
+
+Chao Xing, Dong Wang, Chao Liu, and Yiye Lin. Normalized word embedding and orthogonal transform for bilingual word translation. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1006–1011, 2015.
+
+Zheng Zhang, Ruiqing Yin, Jun Zhu, and Pierre Zweigenbaum. Cross-lingual contextual word embeddings mapping with multi-sense words in mind. arXiv preprint arXiv:1909.08681, 2019.
+
+# APPENDIX
+
+# A PREDICTION TASKS OF LANGUAGE MODELS
+
+Next token prediction and masked token prediction are two common tasks in neural language model (LM) pretraining. We take two well-known language models, ELMo and BERT, as examples to illustrate these two tasks, which are shown in Figure 3.
+
+
+Figure 3: Next token and masked token prediction tasks of language models. For simplicity, we only show the forward language model in next token prediction.
+
+# B FURTHER ALIGNMENT (OPTIONAL)
+
+Applying the linear projection approach proposed by Schuster et al. (2019) on top of our framework can further improve cross-lingual transfer on some tasks. After our cross-lingual model is finished training on the concatenated corpora of two languages, $L _ { 1 }$ and $L _ { 2 }$ , it is used to generate contextual token embeddings for the word pairs in the seed dictionary $\mathcal { D } = \{ ( t _ { i } ^ { L _ { 1 } } , t _ { i } ^ { L _ { 2 } } ) \} _ { i = 1 } ^ { | \mathcal { D } | }$ 6. Then, we compute the average of all contextual embeddings for each token tLji , denoted by aLji . Finally, a
+
+$$
+W = \underset { W } { \arg \operatorname* { m i n } } \sum _ { i = 1 } ^ { | \mathcal { D } | } | | W \pmb { a } _ { i } ^ { L _ { 1 } } - \pmb { a } _ { i } ^ { L _ { 2 } } | | ^ { 2 }
+$$
+
+# C VISUALIZATION OF SENSE VECTORS
+
+We visualize7 the sense vectors of each model in a two dimensional PCA, and show some examples in Figures 4 to 7. For our English monolingual model (SaELMo), the vectors close to two different sense vectors of the word may are shown in (a) and (b) of Figure 4, respectively. We observe that senses are well clustered in these two subfigures, where cluster (a) corresponds to “month”, and cluster (b) corresponds to “auxiliary verb”.
+
+We do the same for the English-Japanese bilingual model (Bi-SaELMo, without projection), and show the vectors close to two different sense vectors of the English word bank in (c) and (d) of Figure 5. We can see both English and Japanese sense vectors (trade, 銀行, 証券, etc.) in (c), most of which correspond to the sense “organization”, though there are some noises. Similarly, most of the sense vectors in (d) correspond to sense “river bank”.
+
+Another two examples are shown in Figures 6 and 7. Our framework exhibits good sense clustering and sense level cross-lingual alignment behaviour in these examples. All sense vectors are dumped at training step 200,000, which is before pretraining complete.
+
+
+Figure 4: We visualize sense vectors of English monolingual model (SaELMo) in a two dimensional PCA, and show the vectors close to two different sense vectors of word may in (a) and (b).
+
+
+Figure 5: We visualize all sense vectors of en-jp bilingual model (Bi-SaELMo) in a two dimensional PCA, and show the vectors close to two different sense vectors of word bank.
+
+
+Figure 6: We visualize sense vectors of English monolingual model (SaELMo) in a two dimensional PCA, and show the vectors close to two different sense vectors of word us in (a) and (b).
+
+
+Figure 7: We visualize all sense vectors of en-de bilingual model (Bi-SaELMo) in a two dimensional PCA, and show the vectors close to two different sense vectors of word may.
+
+# D PRETRAINING DETAILS
+
+# D.1 MONOLINGUAL MODEL
+
+All the monolingual models were trained for one million steps. For better sense clustering performance, the maximum number of senses $S$ in word sense selection algorithm) was set to 1 for the first 20,000 steps to quickly get a reasonable initial model, and then increased to 5 afterwards when pretraining SaELMo and SaBERT-Tiny, which is controlled by hyperparameter n context in our implementation. For SaELMo, we set n context to 6, so that the model initialize 6 senses for each token, but only use the first sense in the 20,000 steps, and then use the other 5 senses (the first sense will be disabled) afterwards. We implement this for SaBERT-Tiny in a slightly different way, where n context can be set to 5 directly to achieve the same effect. We use two NVIDIA V100 GPUs to pretrain SaELMo, which takes about 15 days to complete training. We use one NVIDIA V100 GPU to pretrain SaBERT-Tiny, which takes about 5 days. See Tables 6 and 7 for the hyperparameters used to pretrain SaELMo and SaBERT-Tiny respectively.
+
+Table 6: Monolingual model hyperparameters: SaELMo
+
+
Hyperparameter
Value
max_word_length
50
batch_size
256
n-gpus
2
bidirectional
True
char_cnn:embedding:dim
16
char_cnn:max_characters-per_token
50
char_cnn:n_characters
261
char_cnn:n_highway
2
dropout
0.1
lstm:cell_clip
3
lstm:dim
4096
lstm:n_layers
2
lstm:proj_clip
3
lstm:projection_dim
512
lstm:use_skip_connections
True
all_clip_norm_val
10.0
n_epochs
10
unroll_steps
16
n_negative_samples_batch
8192
n_context
6
cluster_proj_dim
16
pca_sample
20.000
remove_less_freqent_contexts
0.1
learning_rate
0.2
sense_learning_rate
0.01
+
+Table 7: Monolingual model hyperparameters: SaBERT-Tiny
+
+
Hyperparameter
Value
attention-probs_dropout_prob
50
directionality
bidi
hidden_act
gelu
hidden_dropout_prob
0.1
hidden_size
512
initializer_range
0.02
intermediate_size
2048
max-position_embeddings
512
num_attention_heads
8
num_hidden_layers
4
pooler_fc_size
512
pooler_num_attention_heads
8
pooler_num_fc_layers
3
pooler_size-per_head
128
pooler_type
first_token_transform
type_vocab_size
2
vocab_size
27654
n_context
5
context_rep_lr
0.01
pca_dim
14
contextual_warmup
20.000
+
+# D.2 BILINGUAL MODEL
+
+As metioned in the paper, we use Wikipedia dump to pretrain the bilingual models. The Stanford CoreNLP tokenizer (Manning et al., 2014) is used to tokenize English, German, Spanish and Chinese data. And the spaCy tokenizer is used to tokenize Japanese data. All data are converted to lowercase. We convert Chinese data to simplified font to make it consistent with evaluation task datasets.
+
+All the language models used in cross-lingual experiments were pretrained for 600,000 steps from scratch. Similar to our monolingual models, maximum number of senses $S$ in word sense selection algorithm) was set to 1 for the first 20,000 steps, and the increased to 3 afterwards when pretraining Bi-SaELMo and Bi-SaELMo $+$ Proj.8 We use two NVIDIA V100 GPUs to pretrain each Bi-SaELMo model, which takes about 10 days to complete the training. See Table 8 for the hyperparameters used to pretrain Bi-SaELMo/Bi-SaELMo+Proj.
+
+Table 8: Bilingual model hyperparameters: Bi-SaELMo/Bi-SaELMo+Proj
+
+
Hyperparameter
Value
max_word_length
50
batch_size
256
n-gpus
2
bidirectional
True
char_cnn:embedding:dim
16
char_cnn:max_characters_per_token
50
char_cnn:n_characters
261
char_cnn:n_highway
2
dropout
0.1
lstm:cell_clip
3
lstm:dim
4096
lstm:n_layers
2
lstm:proj_clip
3
lstm:projection_dim
512
lstm:use_skip_connections
True
all_clip_norm_val
10.0
n_epochs
6
unroll_steps
12
n_negative_samples_batch
8192
n_context
4
cluster_proj-dim
16
pca_sample
20,000
remove_less_freqent_contexts
0.1
learning_rate
0.2
sense_learning_rate
0.01
\ No newline at end of file
diff --git a/md/train/SkFqf0lAZ/SkFqf0lAZ.md b/md/train/SkFqf0lAZ/SkFqf0lAZ.md
new file mode 100644
index 0000000000000000000000000000000000000000..ea1e1f535b00dd677b8e7bb63b1483c13bd41548
--- /dev/null
+++ b/md/train/SkFqf0lAZ/SkFqf0lAZ.md
@@ -0,0 +1,222 @@
+# MEMORY ARCHITECTURES IN RECURRENT NEURAL NETWORK LANGUAGE MODELS
+
+Dani Yogatama♣, Yishu Miao♠, Gabor Melis♣, Wang Ling♣, Adhiguna Kuncoro♣♠
+Chris Dyer♣, Phil Blunsom♣♠
+♣DeepMind and ♠University of Oxford
+dyogatama@google.com, yishu.miao@cs.ox.ac.uk
+{melisgl,lingwang,akuncoro,cdyer,pblunsom}@google.com
+
+# ABSTRACT
+
+We compare and analyze sequential, random access, and stack memory architectures for recurrent neural network language models. Our experiments on the Penn Treebank and Wikitext-2 datasets show that stack-based memory architectures consistently achieve the best performance in terms of held out perplexity. We also propose a generalization to existing continuous stack models (Joulin & Mikolov, 2015; Grefenstette et al., 2015) to allow a variable number of pop operations more naturally that further improves performance. We further evaluate these language models in terms of their ability to capture non-local syntactic dependencies on a subject-verb agreement dataset (Linzen et al., 2016) and establish new state of the art results using memory augmented language models. Our results demonstrate the value of stack-structured memory for explaining the distribution of words in natural language, in line with linguistic theories claiming a context-free backbone for natural language.
+
+# 1 INTRODUCTION
+
+Sequential recurrent neural networks such as LSTMs (Hochreiter & Schmidhuber, 1997) are the basis of state-of-the-art models of natural language in various tasks. They effectively learn to capture dependencies between events separated in time by learning to store and retrieve information in a hidden state. However, the ability of these methods to discover long-term dependencies is limited by the capacity of their hidden state and the difficulty of propagating reliable gradients. For example, LSTM language models have been shown to struggle to capture non-sequential syntactic dependencies in complex sentences without explicit supervision (Linzen et al., 2016). As an illustration of the kind of dependencies they have difficulty learning, in the sentence, the loss of basic needs providers emigrating from impoverished countries has a damaging effect, correctly predicting singular has rather than its plural form have requires that the LSTM have learned that it depends on the subject, in this case the first noun (loss) rather than any of the intervening non-subject nouns, such as countries. Linzen et al. (2016) show that LSTM language models fail to capture this kind of dependencies, especially as the number of attractors (underlined) increases.
+
+Attempts to improve language models’ ability to capture non-local dependencies have recently been undertaken by introducing an external memory components. These include (i) a soft attention mechanism (Daniluk et al., 2017) and (ii) an explicit memory block or cache model (Tran et al., 2016; Grave et al., 2017). However, since very local context is often most highly informative for predicting the next word, existing memory-augmented RNN LMs use memory just to store information about local context (Daniluk et al., 2017).
+
+In this work, we compare several memory architectures for recurrent neural network language models. Since our goal is to evaluate how well these types of memory architectures learn long term and syntactic dependencies, we focus on language models that are static as opposed to non-static models such as neural cache (Grave et al., 2017) and dynamic evaluation (Krause et al., 2017) that can update their distribution at test time. We consider increasing the capacity of a purely sequential memory model by increasing the capacity of an LSTM, a random access memory model as typified by an attention-based LSTM, and a new variant of a stack augmented recurrent neural network.
+
+Unlike random access memory models, a stack has a built-in bias to discover hierarchical structures that are important in language. A continuous stack memory has been proposed to improve recurrent neural networks (Joulin & Mikolov, 2015; Grefenstette et al., 2015), although it has never been carefully evaluated in benchmark language modeling experiments. In the only set of results for a stack augmented recurrent language model, Joulin & Mikolov (2015) show that a stack augmented vanilla RNN outperforms a standard RNN and is comparable to an LSTM. We augment an LSTM with a stack memory and perform thorough comparisons to evaluate its efficacy as a language model. In contrast to prior work, our continuous stack allows for push, stay, and a variable number of pop operations at each time step (multiple pop operations are useful in modeling natural language sentences since while only a single new word is presented at each time step, multiple syntactic units may come to an end concurrently).
+
+Our motivating hypothesis is that allowing the memory to dynamically store and retrieve contextual information with a stack will drive the model to use the memory to learn dependencies that are difficult to capture by a sequential model. Sequential memory has an easier time learning local dependencies, but it often fails to capture long term dependencies. Random access memory models capture longer range dependencies (i.e., proportional to the window size), but the learner has to infer these from data without any informative structural bias. We hypothesize that introducing a more appropriate inductive bias will make it easier for the model to learn long range and structurally meaningful dependencies, given that the variance in learning such dependencies can be high. Linguistic insights reveal that one possible inductive bias is in the form of a hierarchical nested structure that captures syntactic dependencies. Stack memory models provide a natural way for capturing hierarchical structures, providing an easier path for gradients to flow to particular locations in the past.
+
+Our main contributions in this paper are as follows:
+
+• We thoroughly evaluate the efficacy of a stack augmented RNN as a language model and propose a more expressive extension to existing stack models (§2.1). We compare how a recurrent neural network uses a stack memory, a sequential memory cell (i.e., an LSTM memory cell), and a random access memory (i.e., an attention mechanism) for language modeling. Experiments on the Penn Treebank and Wikitext-2 datasets (§3.2) show that both the stack model and the attention-based model outperform the LSTM model with a comparable (or even larger) number of parameters, and that the stack model eliminates the need to tune window size to achieve the best perplexity.
+• We assess the ability of these memory models to discover long range structural dependencies commonly encountered in natural language using the subject-verb agreement dataset (Linzen et al., 2016). We achieve new state of the art results and show that the gap in accuracy between a sequential or random access memory model with a stack model gets bigger as the dependencies become more complex (i.e., number of attractors increases; $\ S 3 . 3 )$ . We also analyze the stack and find that the model tends to use it to enhance its sequential memory component in high entropy prediction contexts (§3.4).
+
+# 2 MODEL
+
+We consider a language modeling problem where the goal is to predict the next word $x _ { t }$ given previously seen context words $x _ { 0 } , \ldots , x _ { t - 1 }$ . We represent each input word $x$ by its $D$ -dimensional embedding vector $\mathbf { x } \in \mathbb { R } ^ { D }$ .
+
+Our base model is an LSTM that computes a hidden state at timestep $t$ as follows:
+
+$$
+\begin{array} { r l r l } & { \mathbf i _ { t } = \sigma \big ( \mathbf W _ { i , x } \mathbf x _ { t } + \mathbf W _ { i , h } \mathbf h _ { t - 1 } + \mathbf b _ { i } \big ) \quad } & & { \mathbf f _ { t } = \sigma \big ( \mathbf W _ { f , x } \mathbf x _ { t } + \mathbf W _ { f , h } \mathbf h _ { t - 1 } + \mathbf b _ { f } \big ) } \\ & { \mathbf o _ { t } = \sigma \big ( \mathbf W _ { o , x } \mathbf x _ { t } + \mathbf W _ { o , h } \mathbf h _ { t - 1 } + \mathbf b _ { o } \big ) \quad } & & { \mathbf g _ { t } = \mathrm { t a n h } \big ( \mathbf W _ { g , x } \mathbf x _ { t } + \mathbf W _ { g , h } \mathbf h _ { t - 1 } + \mathbf b _ { g } \big ) } \\ & { \mathbf c _ { t } = \mathbf f _ { t } \odot \mathbf c _ { t - 1 } + \mathbf i _ { t } \odot \mathbf g _ { t } \quad } & & { \mathbf h _ { t } = \mathbf o _ { t } \odot \mathrm { t a n h } \big ( \mathbf c _ { t } \big ) } \end{array}
+$$
+
+Sequential memory. An LSTM has a sequential memory cell c to store and retrieve information that is regulated by the input, output, and forget gates. In order for long-term contextual information to be used in the future, it has to pass through these gates for multiple timesteps.
+
+Random access memory. One common approach to retrieve information from the distant past more reliably is to augment the model with a random access memory block via an attention based
+
+
+Figure 1: Multipop Adaptive Computation Stack Recurrent Neural Network.
+
+method. In this model, we consider the previous $K$ states as the memory block, and construct a memory vector $\mathbf { m } _ { t }$ by a weighted combination of these states:
+
+$$
+\mathbf { m } _ { t } = \sum _ { i = t - K } ^ { t - 1 } a _ { i } \mathbf { h } _ { i } , { \mathrm { w h e r e ~ } } a _ { i } \propto \exp ( \mathbf { w } _ { m , i } \mathbf { h } _ { i } + \mathbf { w } _ { m , h } \mathbf { h } _ { t } )
+$$
+
+Such method can be improved further by partitioning $\mathbf { h }$ into a key, value, and predict subvectors (Daniluk et al., 2017).
+
+Given the LSTM hidden state $\mathbf { h } _ { t }$ and the memory state $\mathbf { m } _ { t }$ , we combine them using a simple function:
+
+$$
+\tilde { \mathbf { h } } _ { t } = \mathbf { W } _ { h , h } \mathbf { h } _ { t } + \mathbf { W } _ { h , m } \mathbf { m } _ { t }
+$$
+
+to get the final representation $\tilde { \mathbf { h } } _ { t }$ . We compute the probability of predicting the next word as $p ( x _ { t } \mid \pmb { x } _ { < t } ) \propto \exp ( \mathbf { x } _ { t } ^ { \top } \tilde { \mathbf { h } } _ { t } + b _ { y , x _ { t } } )$ , where we follow Inan et al. (2017) and reuse the word embedding matrix $\mathbf { X }$ as the softmax parameters.
+
+Stack memory. In this work, we propose to augment a recurrent LSTM language model with a stack memory M that has three basic operations:
+
+• PUSH: Push the current hidden state $\mathbf { h } _ { t }$ onto the stack.
+• POP: Remove the top element of the stack.
+• STAY: Keep the stack unchanged.
+
+Figure 1 shows an illustration of our stack augmented RNN. We describe the stack memory in details in the followings.
+
+# 2.1 MULTIPOP ADAPTIVE COMPUTATION STACK
+
+Our stack is a multipop adaptive computation stack—it learns how many POP operations need to be performed before predicting an output. In previous work (Joulin & Mikolov, 2015; Grefenstette et al., 2015), at every timestep $t$ , the job of the memory (stack) controller is to decide whether (i) to push the current state (either $\mathbf { h } _ { t }$ or $\mathbf { x } _ { t }$ ) onto the stack, (ii) to pop the top element of the stack $\mathbf { m } _ { 0 }$ , or (iii) to stay and keep the stack state unchanged. The stack of Joulin & Mikolov (2015) is primarily designed as a single computation stack that performs one of the available operations at every timestep. In order to capture long-term dependencies, the stack learns to carry the information across multiple timesteps by mainly relying on the LSTM hidden states for predictions in between and keeping the state of the stack the same (i.e., by choosing to stay), or by pushing and popping the same number of times in between these timesteps. While this promotes discoveries of hierarchical dependencies, the kind of hierarchical dependencies that it can discover is limited. A multipop stack, on the other hand, has greater flexibility since there are more ways to manipulate its state at each timestep. The stack of Grefenstette et al. (2015) implicitly allows multiple pop operations in a single timestep by setting the pop weights to be greater than one. However, the controller makes this decision based only on the element at the top of the stack (along with the input and the current hidden state), making it less plausible to know whether more than one pop operations are needed since it does not look at other elements of the stack. Our formulation of the multipop operations is more intuitive and takes inspirations from adaptive computation time (Graves, 2017).
+
+Concretely, consider a stack memory with $K$ elements. In all our experiments, we limit the size of the stack to $K = 1 0$ for computational considerations. If the stack requires more than $K$ elements, the bottom element of the stack is removed to make space for the new element, which is added on the top of the stack. In a single computation stack, a feedforward policy network is used to compute the probability of choosing an action $a \in \{ \mathrm { S T A Y , P U S H , P O P } \}$ .
+
+In our stack, we also use a feedforward policy network, but the number of possible POPs is $k \in$ $\{ 0 , 1 , \ldots , K \}$ . Denote the current top two elements of the stack after performing $k$ pops by $\mathbf { m } _ { k , 0 }$ $\mathbf { m } _ { k , 1 }$ , and the state of the stack after $k$ pops by $\operatorname { S T A Y } _ { k }$ (i.e., do $k$ pops and stay) or $\mathrm { P U S H } _ { k }$ (i.e., do $k$ pops and push the current hidden state $\mathbf { h } _ { t }$ ). We compute the probability of choosing an action recursively:
+
+$$
+\begin{array} { r l } & { p ( { \mathrm { S T A Y } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { M } ) = p ( { \mathrm { P O P } } _ { k - 1 } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k - 1 , 0 } , \mathbf { m } _ { k - 1 , 1 } ) \times p ( { \mathrm { S T A Y } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k , 0 } , \mathbf { m } _ { k , 1 } ) } \\ & { p ( { \mathrm { P U S H } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { M } ) = p ( { \mathrm { P O P } } _ { k - 1 } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k - 1 , 0 } , \mathbf { m } _ { k - 1 , 1 } ) \times p ( { \mathrm { P U S H } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k , 0 } , \mathbf { m } _ { k , 1 } ) } \\ & { p ( { \mathrm { P O P } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { M } ) = p ( { \mathrm { P O P } } _ { k - 1 } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k - 1 , 0 } , \mathbf { m } _ { k - 1 , 1 } ) \times p ( { \mathrm { P O P } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k , 0 } , \mathbf { m } _ { k , 1 } ) . } \end{array}
+$$
+
+As a base case, we have $p ( \mathrm { P O P } _ { - 1 } \mid \mathbf { x } _ { t } , \mathbf { m } _ { k - 1 , 0 } , \mathbf { m } _ { k - 1 , 1 } ) = 1$ . To ensure that the probability sums to one, we set $p \big ( \mathrm { P O P } _ { K + 1 } \mid \mathbf { x } _ { t } , \mathbf { m } _ { K , 0 } , \mathbf { m } _ { K , 1 } \big ) = 0$ .
+
+The final stack state is then computed as:
+
+$$
+\mathbf { M } = \sum _ { k = 0 } ^ { K } p ( { \operatorname { S T A Y } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { M } ) \mathbf { M } _ { \operatorname { S T A Y } _ { k } } + p ( { \operatorname { P U S H } } _ { k } \mid \mathbf { x } _ { t } , \mathbf { M } ) \mathbf { M } _ { \operatorname { P U S H } _ { k } } ,
+$$
+
+where $\mathbf { M } _ { * _ { k } }$ is the stack state after performing $k$ POP and PUSH or STAY. Denote the top of the final stack at timestep $t$ as $\mathbf { m } _ { t }$ . The final representation is
+
+$$
+\tilde { \mathbf { h } } _ { t } = \mathbf { W } _ { h , h } \mathbf { h } _ { t } + \mathbf { W } _ { h , m } \mathbf { m } _ { t } .
+$$
+
+We propose to treat this stack as a fully differentiable continuous stack. Alternatively, our stack can also be treated as a discrete stack and trained with reinforcement learning (e.g., with REINFORCE; Williams, 1992). In this case, instead of summing over all possible stack states, we sample according to the probabilities. However, such methods can have slow convergence due to high variance. We include comparisons to discrete and continuous single computation stacks in our experiments (§3).
+
+Adaptive and Variable Computation Networks Previous work on adaptive computation time (Graves, 2017) consider the number of computations as “thinking time”, where they show that their models use more computation time for more difficult predictions. In our work, the number of computations is related to how further back we need to look back when making a prediction at a given timestep. Note that when we decide to push, we push the current hidden state $\mathbf { h } _ { t }$ onto the stack. Since this operation is performed before making a prediction at every timestep, it is possible to use the stack to increase the number of parameters for some predictions (i.e., by pushing $\mathbf { h } _ { t }$ and immediately use it to compute $\tilde { \mathbf { h } } _ { t } = \mathbf { W } _ { h , h } \mathbf { h } _ { t } + \mathbf { W } _ { h , m } \mathbf { m } _ { t }$ , because immediately after a push $\mathbf { m } _ { t } = \mathbf { h } _ { t }$ ). As a result, our stack is also related to variable computation recurrent networks Jernite et al. (2017) that decide the number of dimensions to be used at each timestep.
+
+# 3 EXPERIMENTS
+
+# 3.1 SETUP
+
+We compare the following methods in our experiments:
+
+• Sequential memory: 650-dimension and 920-dimension vanilla LSTMs (650 or 920 for both the word embedding and the LSTM hidden size).
+• Random access memory: a 650-dimension attention-based LSTM with attention size $K =$ $\{ 1 , 3 , 5 , 1 0 , 1 5 \}$ .
+
+• Stack memory: a single computation discrete or continuous stack, or a multipop adaptive computation continuous stack on top of a 650-dimension LSTM.
+
+Following Inan et al. (2017), we tie word embedding and word classifier layers and apply dropout to these layers with probability 0.6 (value chosen based on preliminary experiment results). We also use recurrent dropout (Semeniuta et al., 2016) and set it to 0.1. We perform non-episodic training with batch size 32 using RMSprop (Hinton, 2012) as our optimization method. We tune the RMSprop learning rate and $\ell _ { 2 }$ regularization parameter for all models on a development set by random search from [0.004, 0.009] and [0.0001, 0.0005] respectively, and use perplexity on the development set to choose the best model.
+
+# 3.2 PERPLEXITY
+
+We use standard language modeling datasets, the Penn TreeBank (PTB) and Wikitext-2 (Wik-2) corpora to evaluate perplexity. Our main results are summarized in Table 1, where we also show comparisons with previous work on these datasets.
+
+Our basic LSTM model is comparable to some of the best LSTM models. The results show that increasing the sequential memory capacity by increasing the hidden size improves performance. However, the improvement is not as significant as adding random access or stack memory. The best attention model is the one with $K = 1 0$ and $K = 1 5$ on PTB and Wik-2 respectively, highlighting the necessity to tune to get the optimal window size. Our results generally agree with Daniluk et al. (2017) that show that increasing the attention size generally improves performance up to a certain threshold.
+
+While both the discrete and continuous single computation stack models perform reasonably well, the discrete model underperforms the continuous model on Wik-2. Recall that we use REINFORCE to learn the optimal discrete stack operations. We leave it to future work to investigate whether better techniques can be used to improve the performance of the discrete stack. The best model on both datasets is consistently the multipop stack.
+
+Overall perplexity on these datasets is strongly dominated by words that require little to no long term dependencies, making it difficult to assess when memory helps. In the next section, we look into a specifically designed linguistic task to get a better understanding of these memory models.
+
+# 3.3 SYNTACTIC DEPENDENCIES
+
+We evaluate these memory models for learning syntax-sensitive dependencies on the number prediction dataset from Linzen et al. (2016). In this dataset, the model is given a sentence up to—but not including—its verb, and the goal is to predict the number of the following verb (singular or plural). For example, given a sentence prefix with different numbers of intervening nouns:
+
+• this robot {is, are}
+• the users he mentioned $\left\{ i s , a r e \right\}$
+• many systems , in addition to VBG a page of free text for each knowledge element , also {permit, permits}
+
+the goal is to predict the correct verb form out of the possible answers in the brackets. In total, there are approximately 1.4 million test examples in this dataset with varying degrees of difficulty. One proxy to assess the difficulty of a test example is through the number of attractors (underlined)— which are defined as intervening nouns of the opposite singular/plural form to the subject. Each of the example above has zero, one, and four attractors, respectively. Naturally, examples with fewer numbers of attractors between the head of the syntactic subject and the predicted verb are easier than those with more. We follow the experimental setup in Linzen et al. (2016) and only use test examples where all the attractors are of contrasting form to the main subject (i.e., all intervening nouns between the subject and the verb must be plural if the subject is singular, and vice versa).
+
+One way to do this task is to train a binary classifier that takes the context and predicts an answer. We approach this task from a language modeling perspective, where we simply train a language model and take the word with the higher probability between the two possible answers as the prediction. Success on this task requires a language model that understands syntactic—and in some cases long term—dependencies in natural language. For a purely sequential memory model to do well on this task, it has to be able to carry dependencies over multiple timesteps and attractors. On the other hand, our memory augmented recurrent models need to use the random access or stack memory component in conjunction with the sequential memory of their LSTM core to capture these dependencies.
+
+Table 1: Perplexity on PTB and Wikitext-2 datasets. The two numbers $( { } ^ { * } { \bf M } / { } ^ { * } { \bf M } )$ in the # of params. column for models that we implemented denote the number of parameters for PTB and Wik-2 respectively.
+
+
Model
LSTMhidden size
#ofparams.
PTB
Wik-2
Dev
Test
Dev
Test
Var LSTM(Gal & Ghahramani, 2016)Var LSTM+REAL (Inan et al.,2017)Pointer LSTM (Merity et al., 2017b)Neural Cache (Grave et al., 2017)Neural Cache (Grave et al., 2017)NAS (Zoph & Le,2017)Optimized LSTM (Melis et al., 2017)AWD LSTM (Merity et al., 2017a)AWD LSTM + Cache (Merity et al., 2017a)
Single Comp.Discrete StackSingle Comp. Continuous StackMultipop Adaptive Continuous Stack
650
11M/26M
66.165.865.9
63.563.863.5
78.176.775.9
74.773.072.4
+
+Linzen et al. (2016) concluded that a vanilla LSTM trained only with a language modeling signal is insufficient for capturing such dependencies. They reported an overall accuracy of 93.22 with a language modeling objective (using a 50 dimension LSTM), and 99.17 with a supervised binary classifier objective.
+
+We train the best vanilla LSTM (920 dimensions), the best attention-based LSTM ( $K = 1 0$ , since the Linzen dataset is derived from Wikipedia articles similar to Wik-2), and the best stack LSTM (multipop stack) on the provided training set that contains sentences of similar structures to the test set. There are approximately 3 million tokens on the training set $( \sim 1 4 0 , 0 0 0$ sentences). We tune the learning rate and $\ell _ { 2 }$ hyperparameter on the development set using perplexity as the tuning criterion.
+
+Our results are shown in Table 2. We report accuracies per number of attractors, as well as the overall accuracy and perplexity. Contrary to the Linzen et al. (2016) results, all of our language models perform surprisingly well on this dataset. Our vanilla LSTM model outperforms Linzen’s best LSTM by a significant margin (99.11 vs. 93.22). One possible reason is that we are able to train a much bigger LSTM than Linzen—almost 20 times bigger in hidden size. The results clearly demonstrate the improvements from adding random access and stack memory. The performance of the attention model slowly degrades to the performance of a vanilla LSTM model as the number of attractors increases, since it becomes more difficult for a random access memory mechanism to attend to the syntactic head in the presence of multiple attractors. For example, when there are five attractors, our attention model performs just as well as our vanilla LSTM model.
+
+
Model
Number of attractors
Acc.
Ppx.
0
1
2
3
4
5
Best LSTM
99.3
97.2
95.0
92.2
90.0
84.2
99.11
23.8
Best attention
99.4
97.7
95.9
92.9
90.7
84.2
99.18
22.7
Best stack
99.4
97.9
96.5
93.5
91.6
88.0
99.23
22.2
+
+Table 2: Accuracies on the Linzen number prediction dataset. 0, 1, 2, 3, 4, and 5 refer to the number of attractors between the subject and the predicted verb (see text for details).
+
+Table 3: Examples of mistakes made by competing models on the Linzen number prediction dataset. $\pmb { \chi }$ indicates an incorrect prediction, whereas $\checkmark$ indicates a correct prediction. In general, we observe that the mistakes made by both the LSTM and attention models that are correctly predicted by the stack model (row 2) typically involve longer sentences regardless of the number of attractors.
+
+
Model
Example
LSTM
attention
stack
X
X
X
the NN notes and front cover title {is,are}
X
X
√
other NNS that in the recent past were part of the JJ parish {is,are}
X
√
X
the class ofall VBN sets with JJ functions as NNS {form,forms}
√
X
X
various brands of JJ compound or NN NN {helps,helpl
X
√
√
score based on penalties forfallen bars,NNS,{falls,fall}
√
X
the loss of basic needs providers VBG from VBN countries {has,havel
√
√
X
the construction of the JJwalls,floors,and VBGwalls {is,are}
+
+The stack model performs best on this dataset, across all numbers of attractors (except zero, tie with attention), Notably, the advantage of the stack model becomes more pronounced as the number of attractors increases. In $\ S 3 . 4$ , we analyze how the model uses its stack. We take this collection of results as evidence that a hierarchical bias introduced by a stack-like data structure helps the language model to learn better syntactic natural language dependencies.
+
+We also investigate whether mistakes are made on the same test examples. Figure 2 shows a Venn diagram of mistakes made by each of the models. Most mistakes (6115) are the same across all three models. It is clear that adding a stack or an attention mechanism improves a vanilla LSTM model, as shown by the significant decrease in the number of mistakes that are made only by LSTM (3942) to 1938 and 2534 respectively. Nonetheless, since there are still a large number of mistakes that are complementary, an interesting future direction is to combine all three kinds of memory models efficiently in a single language model. Table 3 shows examples of mistakes made by each of these models.
+
+
+Figure 2: A Venn diagram of mistakes made on the Linzen dataset.
+
+# 3.4 ANALYSIS
+
+In this section, we analyze how our stack model uses its memory to improve predictions. Recall that our adaptive continuous stack has 22 possible stack states at each timestep— $\mathrm { { S T A Y _ { 0 } } }$ , $\mathrm { P U S H _ { \mathrm { 0 } } }$ , $\mathrm { S T A Y _ { 1 } }$ , $\mathrm { P U S H _ { 1 } , \ldots , S T A Y _ { 1 0 } }$ , $\mathrm { P U S H _ { 1 0 } }$ —where the subscript indicates the number of pops that are performed, limited to $K = 1 0$ in our experiments. In Figure 3, we show the number of times each stack state has the highest probability on the Wik-2 test set (left figure, red denotes STAY and blue denotes PUSH) and the maximum action probability (right figure). The LSTM hidden states are not pushed onto the stack most of the times. We inspect what is pushed and find that the model uses the stack to mostly store hidden states for difficult predictions (more details below). While the overall distribution of the maximum action probability is not very peaky since the stack is not used most of the times, we also observe that the action probability is relatively peaky when the stack is activated.
+
+
+
+
+Figure 3: Statistics of the stack actions on Wik-2 test dataset. The left plot shows the number of times (in log space) each stack state has the highest probability. The $x$ -axis represents the number of pops, and the color represents the last action taken after POP (red represents STAY, blue represents PUSH). We can see that most words are not pushed onto the stack and that the model takes advantage of the flexibility of the stack to pop multiple times. The right plot shows the value of the maximum action probability for all timesteps. We observe that for most words the maximum action probabilities are not peaky (the distribution is roughly uniform across all stack states). They tend to be peaky only when the model wants to use the stack.
+Figure 4: An illustration of how the stack memory is written and read for a correct prediction. We follow Linzen et al. (2016) and convert some words (e.g., emigrating, impoverished) to their part of speech tags–given inside the brackets in the example above—to limit the vocabulary size.
+
+We next investigate how the stack improves accuracy on the Linzen dataset by looking into how it operates when making both a correct prediction and a wrong prediction. In Figure 4, we show a randomly selected test sentence the loss of basic needs providers VBG from VBN countries {has, have}. Similar to Figure 3, the red and blue bars represent STAY and PUSH, while the $x$ -axis denotes the number of POPs. The $y$ -axis, on the other hand, denotes the probability of each action. The green dots above each word shows the magnitude of the norm of the contribution of the memory vector $\mathbf { W } _ { h , m } \mathbf { m } _ { t }$ to the final hidden state $\tilde { \mathbf { h } } _ { t }$ (bigger dots represent higher magnitudes). Interestingly, the model seems to use and push onto the stack when the next word prediction has a high entropy. For example, after the word the, of, or from, the model decides to increase its capacity by pushing the current hidden state onto the stack and activates its memory component (as illustrated by bigger green dots). In $\ S 2 . 1$ , we discuss connections of our stack model to adaptive computation time and variable computation RNN, which are designed to explicitly increase their capacity for difficult predictions. Our analysis shows that our stack model also exhibits this kind of behavior. For the Linzen dataset, we conjecture that the stack model is able to perform the best because it uses the stack as a controller to allow the sequential memory component from its base LSTM to carry longer term dependencies (e.g., tracking the subject of the sentence).
+
+For comparison, we also show how the stack operates when it makes an incorrect prediction in Figure 5. Here, the stack behaves similarly, being mostly active for higher entropy predictions, although the model was unable to predict the correct verb right after walls.
+
+
+Figure 5: An illustration of how the stack memory is written and read for an incorrect prediction.
+
+# 4 CONCLUSION
+
+We proposed a generalization of the continuous stack model that allows a variable number of pop operations, and compared sequential, random access, and stack memory architectures for recurrent neural network language models. Our experiments on PTB and Wik-2 showed that adding the stack memory eliminates the need to tune window size in the random access attention model to achieve the best perplexity. We also evaluated these models on the Linzen syntactic dependencies dataset and demonstrated that the stack augmented model outperforms other methods in terms of both accuracy and perplexity, especially as the number of syntactic attractors increases.
+
+# ACKNOWLEDGEMENTS
+
+The authors thank Edward Grefenstette for valuable feedback on an earlier draft of this paper, Tal Linzen for his assistance with the Linzen dataset, and the DeepMind language group for helpful discussions.
+
+# REFERENCES
+
+Daniluk, Michal, Rocktaschel, Tim, Welbl, Johannes, and Riedel, Sebastian. Frustratingly short attention spans in neural language modeling. In Proc. of ICLR, 2017.
+Gal, Yarin and Ghahramani, Zoubin. A theoretically grounded application of dropout in recurrent neural networks. In Proc. of NIPS, 2016.
+Grave, Edouard, Joulin, Armand, and Usunier, Nicolas. Improving neural language models with a continuous cache. In Proc. of ICLR, 2017.
+
+Graves, Alex. Adaptive computation time for recurrent neural networks. arXiv preprint, 2017.
+
+Grefenstette, Edward, Hermann, Karl Moritz, Suleyman, Mustafa, and Blunsom, Phil. Learning to transduce with unbounded memory. In Proc. of NIPS, 2015.
+
+Hinton, Geoffrey. Neural networks for machine learning, 2012. Lecture 6.5.
+
+Hochreiter, Sepp and Schmidhuber, Jurgen. Long short-term memory. Neural Computation, 9(8): 1735–1780, 1997.
+
+Inan, Hakan, Khosravi, Khashayar, and Socher, Richard. Tying word vectors and word classifiers: A loss framework for language modeling. In Proc. of ICLR, 2017.
+
+Jernite, Yacine, Grave, Edouard, Joulin, Armand, and Mikolov, Tomas. Variable computation in recurrent neural networks. In Proc. of ICLR, 2017.
+
+Joulin, Armand and Mikolov, Tomas. Inferring algorithmic patterns with stack-augmented recurrent nets. arXiv preprint, 2015.
+
+Krause, Ben, Kahembwe, Emmanuel, Murray, Iain, and Renals, Steve. Dynamic evaluation of neural sequence models. arXiv preprint, 2017.
+
+Linzen, Tal, Dupoux, Emmanuel, and Goldberg, Yoav. Assessing the ability of lstms to learn syntaxsensitive dependencies. Transactions of the Association for Computational Linguistics, 4:521–535, 2016.
+
+Melis, Gabor, Dyer, Chris, and Blusom, Phil. On the state of the art of evaluation in neural language models. arXiv preprint, 2017.
+
+Merity, Stephen, Keskar, Nitish Shirish, and Socher, Richard. Regularizing and optimizing lstm language models. arXiv preprint, 2017a.
+
+Merity, Stephen, Xiong, Caiming, and an Richard Socher, James Bradbury. Pointer sentinel mixture models. In Proc. of ICLR, 2017b.
+
+Semeniuta, Stanislau, Severyn, Aliaksei, and Barth, Erhardt. Recurrent dropout without memory loss. In Proc. of COLING, 2016.
+
+Tran, Ke, Bisazza, Arianna, and Monz, Christof. Recurrent memory networks for language modeling. In Proc. of NAACL-HLT, 2016.
+
+Williams, Ronald J. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992.
+
+Zoph, Barret and Le, Quoc V. Neural architecture search with reinforcement learning. In Proc. of ICLR, 2017.
\ No newline at end of file
diff --git a/md/train/SkHkeixAW/SkHkeixAW.md b/md/train/SkHkeixAW/SkHkeixAW.md
new file mode 100644
index 0000000000000000000000000000000000000000..00ee3a41a8755f0a0cf6c00db09961b3e1c129e1
--- /dev/null
+++ b/md/train/SkHkeixAW/SkHkeixAW.md
@@ -0,0 +1,506 @@
+# Regularization for Deep Learning: A Taxonomy
+
+Anonymous authors
+
+Paper under double-blind review
+
+# Abstract
+
+Regularization is one of the crucial ingredients of deep learning, yet the term regularization has various definitions, and regularization methods are often studied separately from each other. In our work we present a novel, systematic, unifying taxonomy to categorize existing methods. We distinguish methods that affect data, network architectures, error terms, regularization terms, and optimization procedures. We identify the atomic building blocks of existing methods, and decouple the assumptions they enforce from the mathematical tools they rely on. We do not provide all details about the listed methods; instead, we present an overview of how the methods can be sorted into meaningful categories and sub-categories. This helps revealing links and fundamental similarities between them. Finally, we include practical recommendations both for users and for developers of new regularization methods.
+
+# 1 Introduction
+
+Regularization is one of the key elements of machine learning, particularly of deep learning (Goodfellow et al., 2016), allowing to generalize well to unseen data even when training on a finite training set or with an imperfect optimization procedure. In the traditional sense of optimization and also in older neural networks literature, the term “regularization” is reserved solely for a penalty term in the loss function (Bishop, 1995a). Recently, the term has adopted a broader meaning: Goodfellow et al. (2016, Chap. 5) loosely define it as “any modification we make to a learning algorithm that is intended to reduce its test error but not its training error”. We find this definition slightly restrictive and present our working definition of regularization, since many techniques considered as regularization do reduce the training error (e.g. weight decay in AlexNet (Krizhevsky et al., 2012)).
+
+Definition 1. Regularization is any supplementary technique that aims at making the model generalize better, i.e. produce better results on the test set.
+
+This can include various properties of the loss function, the loss optimization algorithm, or other techniques. Note that this definition is more in line with machine learning literature than with inverse problems literature, the latter using a more restrictive definition.
+
+In this work, we create a novel, systematic, unifying taxonomy of regularization methods for deep learning. We analyze existing methods and identify their atomic building blocks. This leads to decoupling of two important concepts: Which assumptions the methods rely on (and try to enforce), and which mathematical and algorithmic tools they use. In turn, this enables better understanding of existing methods and speeds up development of new ones: The researchers can focus either on finding new, better ways of enforcing existing assumptions, or focus on discovery of new assumptions that can be enforced in some existing way.
+
+Before we proceed to the presentation of our taxonomy, we revisit some basic machine learning theory in Section 2. This will provide a justification of the top level of the taxonomy. In Sections 3–7, we continue with a finer division of the individual classes of the regularization techniques, aiming at separating as many clearly separable concepts as possible and isolating atomic building blocks of individual methods. Finally, in Section 8 we present our practical recommendations for using existing methods and designing new methods. We are aware that the many research works discussed in this taxonomy cannot be summarized in a single sentence. For the sake of structuring the multitude of papers, we decided to merely describe a certain subset of their properties according to the focus of our taxonomy.
+
+# 2 Theoretical framework
+
+The central task of our interest is model fitting: finding a function $f$ that can well approximate a desired mapping from inputs $x$ to desired outputs $f ( x )$ . A given input $x$ can have an associated target $t$ which dictates the desired output $f ( x )$ directly (or in some applications indirectly (Ulyanov et al., 2016; Johnson et al., 2016)). A typical example of having available targets $t$ is supervised learning. Data samples $( x , t )$ then follow a ground truth probability distribution $P$ .
+
+In many applications, neural networks have proven to be a good family of functions to choose $f$ from. A neural network is a function $f _ { w } : x \mapsto y$ with trainable weights $w \in W$ . Training the network means finding a weight configuration $w ^ { * }$ , which is a result of performing a minimization procedure of a loss function $\mathcal { L } : W \to \mathbb { R }$ as follows:
+
+$$
+w ^ { * } = \mathrm { m i n i m i z e } ~ { \mathcal { L } } ( w ) .
+$$
+
+Usually the loss function takes the form of expected risk :
+
+$$
+\mathcal { L } = \mathbb { E } _ { ( x , t ) \sim P } \Big [ E \big ( f _ { w } ( x ) , t \big ) + R ( . . . ) \Big ] ,
+$$
+
+where we identify two parts, an error function $E$ and a regularization term $R$ . The error function depends on the targets and assigns a penalty to model predictions according to their consistency with the targets. The regularization term assigns a penalty to the model based on other criteria. It may depend on anything except the targets, for example on the weights (see Section 6).
+
+The expected risk cannot be minimized directly since the data distribution $P$ is unknown. Instead, a training set $\mathcal { D }$ sampled from the distribution is given. The minimization of the expected risk can be then approximated by (approximately) minimizing the empirical risk $\hat { \mathcal { L } }$ :
+
+$$
+\underset { w } { \mathrm { m i n i m i z e } } \frac { 1 } { | \mathscr { D } | } \sum _ { ( x _ { i } , t _ { i } ) \in \mathcal { D } } E \big ( f _ { w } ( x _ { i } ) , t _ { i } \big ) + R ( . . . )
+$$
+
+where $( x _ { i } , t _ { i } )$ are samples from $\mathcal { D }$ .
+
+Now we have the minimal background to formalize the division of regularization methods into a systematic taxonomy. In the minimization of the empirical risk, Eq. (3), we can identify the following elements that are responsible for the value of the learned weights, and thus can contribute to regularization:
+
+$\mathcal { D }$ : The training set, discussed in Section 3
+$f$ : The selected model family, discussed in Section 4
+$E$ : The error function, briefly discussed in Section 5
+$R$ : The regularization term, discussed in Section 6
+The optimization procedure itself, discussed in Section 7
+
+Ambiguity regarding the splitting of methods into these categories and their subcategories is discussed in Appendix A using notation from Section 3.
+
+# 3 Regularization via data
+
+The quality of a trained model depends largely on the training data. Apart from acquisition/selection of appropriate training data, it is possible to employ regularization via data. This is done by applying some transformation to the training set $\mathcal { D }$ , resulting in a new set $\mathcal { D } _ { R }$ . Some transformations perform feature extraction or pre-processing, modifying the feature space or the distribution of the data to some representation simplifying the learning task. Other methods allow generating new samples to create a larger, possibly infinite, augmented dataset. These two principles are somewhat independent and may be combined. The goal of regularization via data is either one of them, or the other, or both. They both rely on transformations with (stochastic) parameters:
+
+Definition 2. Transformation with stochastic parameters is a function $\tau _ { \theta }$ with parameters $\theta$ which follow some probability distribution.
+
+In this context we consider $^ Ḋ \prime \theta Ḍ$ which can operate on network inputs, activations in hidden layers, or targets. An example of a transformation with stochastic parameters is the corruption of inputs by Gaussian noise (Bishop, 1995b; An, 1996):
+
+$$
+\tau _ { \theta } ( x ) = x + \theta , \quad \theta \sim \mathcal { N } ( \mathbf { 0 } , \Sigma ) .
+$$
+
+The stochasticity of the transformation parameters is responsible for generating new samples, i.e. data augmentation. Note that the term data augmentation often refers specifically to transformations of inputs or hidden activations, but here we also list transformations of targets for completeness. The exception to the stochasticity is when $\theta$ follows a delta distribution, in which case the transformation parameters become deterministic and the dataset size is not augmented.
+
+We can categorize the data-based methods according to the properties of the used transformation and of the distribution of its parameters. We identify the following criteria for categorization (some of them later serve as columns in Tables 1–2):
+
+# Stochasticity of the transformation parameters $\theta$
+
+∙ Deterministic parameters: Parameters $\theta$ follow a delta distribution, size of the dataset remains unchanged
+
+∙ Stochastic parameters: Allow generation of a larger, possibly infinite, dataset. Various strategies for sampling of $\theta$ exist:
+
+– Random: Draw a random $\theta$ from the specified distribution
+– Adaptive: Value of $\theta$ is the result of an optimization procedure, usually with the objective of maximizing the network error on the transformed sample (such “challenging” sample is considered to be the most informative one at current training stage), or minimizing the difference between the network prediction and a predefined fake target $t ^ { \prime }$ $^ *$ Constrained optimization: $\theta$ found by maximizing error under hard constraints (support of the distribution of $\theta$ controls the strongest allowed transformation) $^ *$ Unconstrained optimization: $\theta$ found by maximizing modified error function, using the distribution of $\theta$ as weighting (proposed herein for completeness, not yet tested) $^ *$ Stochastic: $\theta$ found by taking a fixed number of samples of $\theta$ and using the one yielding the highest error
+
+# Effect on the data representation
+
+∙ Representation-preserving transformations: Preserve the feature space and attempt to preserve the data distribution
+∙ Representation-modifying transformations: Map the data to a different representation (different distribution or even new feature space) that may disentangle the underlying factors of the original representation and make the learning problem easier
+
+# Transformation space
+
+∙ Input: Transformation is applied to $x$
+
+∙ Hidden-feature space: Transformation is applied to some deep-layer representation of samples (this also uses parts of $f$ and $w$ to map the input into the hidden-feature space; such transformations act inside the network $f _ { w }$ and thus can be considered part of the architecture, additionally fitting Section 4)
+∙ Target: Transformation is applied to $t$ (can only be used during the training phase since labels are not shown to the model at test time)
+
+# Universality
+
+∙ Generic: Applicable to all data domains
+∙ Domain-specific: Specific (handcrafted) for the problem at hand, for example image rotations
+
+# Dependence of the distribution of $\theta$
+
+∙ $p ( \theta )$ : distribution of $\theta$ is the same for all samples
+∙ $p ( \theta | t )$ : distribution of $\theta$ can be different for each target (class)
+∙ $p ( \theta | t ^ { \prime } )$ : distribution of $\theta$ depends on desired (fake) target $t ^ { \prime }$
+∙ $p ( \theta | x )$ : distribution of $\theta$ can be different for each input vector (with implicit dependence on $f$ and $w$ if the transformation is in hidden-feature space)
+∙ $p ( \boldsymbol { \theta } | \mathcal { D } )$ : distribution of $\theta$ depends on the whole training dataset
+∙ $p ( \boldsymbol { \theta } | \mathbf { x } )$ : distribution of $\theta$ depends on a batch of training inputs (for example (parts of) the current mini-batch, or also previous mini-batches)
+∙ $p ( \theta | \mathrm { t i m e } )$ : distribution of $\theta$ depends on time (current training iteration)
+∙ $p ( \theta | \pi )$ : distribution of $\theta$ depends on some trainable parameters $\pi$ subject to loss minimization (i.e. the parameters $\pi$ evolve during training along with the network weights $w$ )
+∙ Combinations of the above, e.g. $p ( \theta | x , t )$ , $p ( \theta | x , \pi )$ , ??(??|??, ??′), ??(??|??, ??), ??(??|??, ??), $p ( \boldsymbol { \theta } | \boldsymbol { x } , t , \mathcal { D } )$
+
+# Phase
+
+∙ Training: Transformation of training samples ∙ Test: Transformation of test samples, for example multiple augmented variants of a sample are classified and the result is aggregated over them
+
+A review of existing methods that use generic transformations can be found in Table 1. Dropout in its original form (Hinton et al., 2012; Srivastava et al., 2014) is one of the most popular methods from the generic group, but also several variants of Dropout have been proposed that provide additional theoretical motivation and improved empirical results (Standout (Ba and Frey, 2013), Random dropout probability (Bouthillier et al., 2015), Bayesian dropout (Maeda, 2014), Test-time dropout (Gal and Ghahramani, 2016)).
+
+Table 2 contains a list of some domain-specific methods focused especially on the image domain. Here the most used method is rigid and elastic image deformation.
+
+Target-preserving data augmentation In the following, we discuss an important group of methods: target-preserving data augmentation. These methods use stochastic transformations in input and hidden-feature spaces, while preserving the original target $t$ . As can be seen in the respective two columns in Tables 1–2, most of the listed methods have exactly these properties. These methods transform the training set to a distribution $Q$ , which is used for training instead. In other words, the training samples $( x _ { i } , t _ { i } ) \in \mathcal { D }$ are replaced in the empirical risk loss function (Eq. (3)) by augmented training samples $( \tau _ { \theta } ( x _ { i } ) , t _ { i } ) \sim Q$ . By randomly sampling the transformation parameters $\theta$ and thus creating many new samples $( \tau _ { \theta } ( x _ { i } ) , t _ { i } )$ from each original training sample $( x _ { i } , t _ { i } )$ , data augmentation attempts to bridge the limited-data gap between the expected and the empirical risk, Eqs. (2)–(3). While unlimited sampling from $Q$ provides more data than the original dataset $\mathcal { D }$ , both of them usually are merely approximations of the ground truth data distribution or of an ideal training dataset; both $\mathcal { D }$ and $Q$ have their own distinct biases, advantages and disadvantages. For example, elastic image deformations result in images that are not perfectly realistic; this is not necessarily a disadvantage, but it is a bias compared to the ground truth data distribution; in any case, the advantages (having more training data) often prevail. In some cases, it may be even desired for $Q$ to be deliberately different from the ground truth data distribution. For example, in case of class imbalance (unbalanced abundance or importance of classes), a common regularization strategy is to undersample or oversample the data, sometimes leading to a less realistic $Q$ but better models. This is how an ideal training dataset may be different from the ground truth data distribution.
+
+Table 1: Existing generic data-based methods classified according to our taxonomy. Table columns are described in Section 3.
+
+
Method
Dependence
Transformationspace
Stochasticity(0 sampling)
Phase
Gaussian noise on input(Bishop,1995a; An,1996)
p()
Input
Random
Training
Gaussian noise on hidden units(DeVries and Taylor, 2017)
p(0)
Hidden features
Random
Training
Dropout (Hinton et al., 2012; Srivastavaet al., 2014)
p()
Input andhidden features
Random
Training
Random dropout probability(Bouthillier et al., 2015, Sec. 4)
p()
Input andhidden features
Random
Training
Curriculum dropout(Morerio et al., 2017)
p(0|time)
Input andhidden features
Random
Training
Bayesian dropout(Maeda,2014)
p(0|π)
Input andhidden features
Random
Training
Standout (adaptive dropout)(Ba and Frey, 2013)
p(0|x,π)
Input andhidden features
Random
Training
"Projection” of dropout noise into inputspace (Bouthillier et al., 2015, Sec. 3)
p(0lx,f,w)
InputUses auxiliary Tin hidden-featurespace.
Random
Training
Approximation of Gaussian process bytest-time dropout(Gal and Ghahramani, 2016)
p(0)
Input andhidden features
Random
Test
Stochastic depth (Huang et al., 2016b)
p()
Hidden features
Random
Training
Noisy activation functions(Nair and Hinton, 2010; Xu et al., 2015;Gülcehre et al., 2016a)
p(0x)
Hidden features
Random
Training
Training with adversarial examples(Szegedy et al., 2014)
p(0|x,t')
Input
AdaptiveConstrained
Training
Network fooling (adversarial examples)(Szegedy et al., 2014)(Not for regularization)
p(0lx,t)
Input
AdaptiveConstrained
Test
Synthetic minority oversampling inhidden-feature space (Wong et al., 2016)
p(0x,t,D)
Hidden features
Random
Training
Inter-and extrapolation in hidden-featurespace (DeVries and Taylor, 2017)
p(0|x,t,D)
Hidden features
Random
Training
Batch normalization (Ioffe and Szegedy,2015),Ghost batch normalization (Hofferet al., 2017)
p(0|x)
Hidden features
Deterministic
Trainingand test
Layer normalization(Ba et al., 2016)
p(0|x)
Hidden features
Deterministic
Trainingand test
Annealed noise on targets(Wang and Principe, 1999)
p(0|time)
Target
Random
Training
Label smoothing (Szegedy et al., 2016,Sec. 7; Goodfellow et al.,2016, Chap.7)
p()
Target
Deterministic
Training
Model compression (mimic models,distilled models) (Bucila et al., 2006; Baand Caruana,2014; Hinton et al., 2015)
p(0|x,D)
Target
Deterministic
Training
+
+Table 2: Existing domain-specific data-based methods classified according to our taxonomy. Table columns are described in Section 3. Note that these methods are never applied on the hidden features, because domain knowledge cannot be applied on them.
+
+
Method
Dependence
Transformationspace
Stochasticity(0 sampling)
Phase
Rigid and elastic image transformation(Baird,1990; Yaegger et al., 1996; Simardet al.,2003; Ciresan et al., 2010)
p(0)
Input
Random
Training
Test-time image transformations(Simonyan and Zisserman, 2015;Dielemanet al., 2015)
p(0)
Input
Random
Test
Sound transformations(Salamon and Bello, 2017)
p()
Input
Random
Training
Error-maximizing rigid imagetransformations(Loosli et al., 2007; Fawzi et al., 2016)
p()
Input
Adaptivestochastic&constrained,respectively
Training
Learning class-specific elasticimage-deformation fields(Hauberg et al., 2016)
p(0|t,D)
Input
Random
Training
Any handcrafted data preprocessing, forexample scale-invariant feature transform(SIFT) for images (Lowe,1999)
p()
Input
Deterministic
Trainingand test
Overfeat (Sermanet et al., 2013)
p(0)
Input
Deterministic
Trainingand test
+
+If the transformation is additionally representation-preserving, then the distribution $Q$ created by the transformation $\tau _ { \theta }$ attempts to mimic the ground truth data distribution $P$ . Otherwise, the notion of a “ground truth data distribution” in the modified representation may be vague. We provide more details about the transition from $\mathcal { D }$ to $Q$ in Appendix B.
+
+Summary of data-based methods Data-based regularization is a popular and very useful way to improve the results of deep learning. In this section we formalized this group of methods and showed that seemingly unrelated techniques such as Target-preserving data augmentation, Dropout, or Batch normalization are methodologically surprisingly close to each other. In Section 8 we discuss future directions that we find promising.
+
+# 4 Regularization via the network architecture
+
+A network architecture $f$ can be selected to have certain properties or match certain assumptions in order to have a regularizing effect.1
+
+Table 3: Methods based on network architecture, and rough description of assumptions that they encode. There are partial overlaps between some listed methods. For example, Residual learning uses Skip-connections. Many noise-based methods also fit Table 1 (cf. Appendix A).
+
+
Method
Method class
Assumptions about an appropriate learnable input-output mapping
Any chosen (not overlycomplex) architecture
*
Mapping can be well approximated by functions from the chosen familywhich are easily accessible by optimization.
Small network
*
Mapping is simple (complexity of the mapping depends on the number ofnetwork units and layers).
Deep network
*
The mapping is complex,but can be decomposed into a composition (orgenerally into a directed acyclic graph) of simple nonlinear transformations,e.g.affine transformation followed by simple nonlinearity(fully-connectedlayer),“multi-channel convolution”followed by simple nonlinearity (convo-lutional layer),etc.
Data concentrates around a lower-dimensional manifold; has few factors ofvariation.
Convolutional networks(Fukushima and Miyake,1982;Rumelhart et al.,1986,Pp.348-352; LeCun et al.,1989;Simard et al., 2003)
Layer operation
Spatially local and shift-equivariant feature extraction is all we need.
Dilated convolutions(Yu and Koltun,2015)
Layer operation
Like convolutional networks.Additionally:Sparse sampling of wide localneighborhoods provides relevant information,and better preserves rele-vant high-resolution information than architectures with downscaling andupsampling.
Strided convolutions (seeDumoulin and Visin,2016)
Layer operation
The mapping is reliable at reacting to features that do not vary tooabruptly in space,i.e.which are present in several neighboring pixels andcan be detected even if the filter center skips some of the pixels.The out-put is robust towards slight changes of the location of features,and changesof strength/presence of spatially strongly varying features.
Pooling
Layer operation
The output is invariant to slight spatial distortions of the input (slightchanges of the location of (deep) features).Features that are sensitive tosuch distortions can be discarded.
Stochastic pooling(Zeiler and Fergus,2013)
Layer operation
The output is robust towards slight changes of the location (like pooling)but also of the strength/presence of (deep) features.
Training with different kindsof noise (including Dropout;see Section 3)
Noise
The mapping is robust to noise:the given class of perturbations of theinput or deep features should not affect the output too much.
Dropout (Hinton et al., 2012;Srivastava etal.,2014),DropConnect (Wan et al.,2013),and related methods
Noise
Extracting complementary (non-coadapted) features is helpful.Non-coadapted features are more informative,better disentangle factors of vari-ation.(We want to disentangle factors of variation because they are en-tangled in different ways in inputs vs.in outputs.)When interpreted as ensemble learning:usual assumptions of ensemblelearning (predictions of weak learners have complementary info and can becombined to strong prediction).
Maxout units(Goodfellow et al., 2013)
Layer operation
Assumptions similar to Dropout,with more accurate approximation ofmodel averaging (when interpreted as ensemble learning)
Skip-connections (Long et al.,2015;Huang et al.,2016a)
Connections be-tween layers
Certain lower-level features can directly be reused in a meaningful way at(several) higher levels of abstraction
Linearly augmentedfeed-forward network (van derSmagt and Hirzinger,1998)
Connections be-tween layers
Skip-connections that share weights with the non-skip-connections.Helpsagainst vanishing gradients. Rather changes the learning algorithm thanthe network mapping.
Residual learning(He et al., 2016)
Connections be-tween layers
Learning additive difference of a mapping f (or its compositional parts)from the identity mapping is easier than learning f itself. Meaningful deepfeatures can be composed asa sum of lower-level and intermediate-levelfeatures.
Stochastic depth(Huang et al.,2016b),DropIn(Smith et al., 2015)
Connectionsbetween layers;noise
Similar to Dropout:extracting complementary (non-coadapted) featuresacross different levels of abstraction is helpful; implicit model ensem-ble.Similar to Residual learning: meaningful deep features can be com-posed as a sum of lower-level and intermediate-level features,with theintermediate-level ones being optional,and leaving them out beingmeaningful data augmentation. Similar to Mollifying networks: simpli-fying random parts of the mapping improves training.
Mollifying networks(Gülcehre et al., 2016b)
Connectionsbetweenlayers;noise
The mapping can be easier approximated by estimating its decreasinglylinear simplified version
Network information criterion(Murata et al.,1994),Networkgrowing and network pruning(see Bishop,1995a, Sec. 9.5)
Model selection
Optimal generalization is reached by a network that has the right numberof units (not too few,not too many)
Multi-task learning (seeCaruana,1998;Ruder,2017)
*
Several tasks can help each other to learn mutually useful feature extrac-tors,as long as the tasks do not compete for resources (network capacity)
+
+Assumptions about the mapping An input-output mapping $f _ { w }$ must have certain properties in order to fit the data $P$ well. Although it may be intractable to enforce the precise properties of an ideal mapping, it may be possible to approximate them by simplified assumptions about the mapping. These properties and assumptions can then be imposed upon model fitting in a hard or soft manner. This limits the search space of models and allows finding better solutions. An example is the decision about the number of layers and units, which allows the mapping to be neither too simple nor too complex (thus avoiding underfitting and overfitting). Another example are certain invariances of the mapping, such as locality and shift-equivariance of feature extraction hardwired in convolutional layers. Overall, the approach of imposing assumptions about the input-output mapping discussed in this section is the selection of the network architecture $f$ . The choice of architecture $f$ on the one hand hardwires certain properties of the mapping; additionally, in an interplay between $f$ and the optimization algorithm (Section 7), certain weight configurations are more likely accessible by optimization than others, further limiting the likely search space in a soft way. A complementary way of imposing certain assumptions about the mapping are regularization terms (Section 6), as well as invariances present in the (augmented) data set (Section 3).
+
+Assumptions can be hardwired into the definition of the operation performed by certain layers, and/or into the connections between layers. This distinction is made in Table 3, where these and other methods are listed.
+
+In Section 3 about data, we mentioned regularization methods that transform data in the hidden-feature space. They can be considered part of the architecture. In other words, they fit both Sections 3 (data) and 4 (architecture). These methods are listed in Table 1 with hidden features as their transformation space.
+
+Weight sharing Reusing a certain trainable parameter in several parts of the network is referred to as weight sharing. This usually makes the model less complex than using separately trainable parameters. An example are convolutional networks (LeCun et al., 1989). Here the weight sharing does not merely reduce the number of weights that need to be learned; it also encodes the prior knowledge about the shift-equivariance and locality of feature extraction. Another example is weight sharing in autoencoders.
+
+Activation functions Choosing the right activation function is quite important; for example, using Rectified linear units (ReLUs) improved the performance of many deep architectures both in the sense of training times and accuracy as well as overcoming the need for greedy layer-wise pre-training (Hahnloser et al., 2000; Jarrett et al., 2009; Nair and Hinton, 2010; Glorot et al., 2011). The success of ReLUs can be partially attributed to the fact that they provide more expressive families of mappings compared to sigmoid activations (in the sense that the classical sigmoid nonlinearity can be approximated very well $^ 2$ with only two ReLUs, but it takes an infinite number of sigmoid units to approximate a ReLU) and their affine extrapolation to unknown regions of data space seems to provide better generalization in practice than the “stagnating” extrapolation of sigmoid units. However, their hard negative cut-off and unbounded positive part are not always desired properties. Some activation functions were designed explicitly for regularization. For Dropout, Maxout units (Goodfellow et al., 2013) allow a more precise approximation of the geometric mean of the model ensemble predictions at test time. Stochastic pooling (Zeiler and Fergus, 2013), on the other hand, is a noisy version of max-pooling. The authors claim that this allows modelling distributions of activations instead of taking just the maximum.
+
+Noisy models Stochastic pooling was one example of a stochastic generalization of a deterministic model. Some models are stochastic by injecting random noise into various parts of the model. The most frequently used noisy model is Dropout (Hinton et al., 2012; Srivastava et al., 2014).
+
+Multi-task learning A special type of regularization is multi-task learning (see Caruana, 1998; Ruder, 2017), where the network is modified to predict targets for several tasks at once. It can be combined with semi-supervised learning to utilize unlabeled data on an auxiliary task (Rasmus et al., 2015). A similar concept of sharing knowledge between tasks is also utilized in meta-learning, where multiple tasks from the same domain are learned sequentially, using previously gained knowledge as bias for new tasks (Baxter, 2000); and transfer learning, where knowledge from one domain is transferred into another domain (Pan and Yang, 2010). These approaches differ from other methods in the sense that they require some additional target data, which are not always available.
+
+Model selection The best among several trained models (e.g. with different architectures) can be selected by evaluating the predictions on a validation set. It should be noted that this holds for selecting the best combination of all techniques (Sections 3–7), not just architecture; and that the validation set used for model selection in the “outer loop” should be different from the validation set used e.g. for Early stopping (Section 7), and different from the test set (Cawley and Talbot, 2010). However, there are also model selection methods that specifically target the selection of the number of units in a specific network architecture, e.g. using network growing and network pruning (see Bishop, 1995a, Sec. 9.5), or additionally do not require a validation set, e.g. the Network information criterion to compare models based on the training error and second derivatives of the loss function (Murata et al., 1994).
+
+# 5 Regularization via the error function
+
+Ideally, the error function $E$ reflects an appropriate notion of quality, and in some cases some assumptions about the data distribution. Typical examples are mean squared error or cross-entropy. The error function $E$ can also have a regularizing effect. An example is Dice coefficient optimization (Milletari et al., 2016) which is robust to class imbalance. Moreover, the overall form of the loss function can be different than Eq. (3). For example, in certain loss functions that are robust to class imbalance, the sum is taken over pairwise combinations $\mathcal { D } \times \mathcal { D }$ of training samples (Yan et al., 2003), rather than over training samples. But such alternatives to Eq. (3) are rather rare, and similar principles apply. If additional tasks are added for a regularizing effect (multi-task learning (see Caruana, 1998; Ruder, 2017)), then targets $t$ are modified to consist of several tasks, the mapping $f _ { w }$ is modified to produce an according output $y$ , and $E$ is modified to account for the modified $t$ and $y$ . Besides, there are regularization terms that depend on $\partial E / \partial x$ . They depend on $t$ and thus in our definition are considered part of $E$ rather than of $R$ , but they are listed in Section 6 among $R$ (rather than here) for a better overview.
+
+# 6 Regularization via the regularization term
+
+Regularization can be achieved by adding a regularizer $R$ into the loss function. Unlike the error function $E$ (which expresses consistency of outputs with targets), the regularization term is independent of the targets. Instead, it is used to encode other properties of the desired model, to provide inductive bias (i.e. assumptions about the mapping other than consistency of outputs with targets). The value of $R$ can thus be computed for an unlabeled test sample, whereas the value of $E$ cannot.
+
+The independence of $R$ from $t$ has an important implication: it allows additionally using unlabeled samples (semi-supervised learning) to improve the learned model based on its compliance with some desired properties (Sajjadi et al., 2016). For example, semi-supervised learning with ladder networks (Rasmus et al., 2015) combines a supervised task with an unsupervised auxiliary denoising task in a “multi-task” learning fashion. (For alternative interpretations, see Appendix A.) Unlabeled samples are extremely useful when labeled samples are scarce. A Bayesian perspective on the combination of labeled and unlabeled data in a semi-supervised manner is offered by Lasserre et al. (2006).
+
+A classical regularizer is weight decay (see Plaut et al., 1986; Lang and Hinton, 1990; Goodfellow et al., 2016, Chap. 7):
+
+$$
+R ( w ) = \lambda \frac 1 2 \| w \| _ { 2 } ^ { 2 } ,
+$$
+
+where $\lambda$ is a weighting term controlling the importance of the regularization over the consistency. From the Bayesian perspective, weight decay corresponds to using a symmetric multivariate normal distribution as prior for the weights: $p ( w ) = \mathcal { N } ( w | \mathbf { 0 } , \lambda ^ { - 1 } \mathbf { I } )$ (Nowlan and Hinton, 1992). Indeed, $\begin{array} { r } { - \log \mathcal { N } ( w | \mathbf { 0 } , \lambda _ { \cdot } ^ { - 1 } \mathbf { I } ) \propto - \log \exp \left( - \frac { \lambda } { 2 } \| w \| _ { 2 } ^ { 2 } \right) = \frac { \lambda } { 2 } \| w \| _ { 2 } ^ { 2 } = R ( w ) } \end{array}$ . Weight decay has gained big popularity, and it is being successfully used; Krizhevsky et al. (2012) even observe reduction of the error on the training set.
+
+Another common prior assumption that can be expressed via the regularization term is “smoothness” of the learned mapping (see Bengio et al., 2013, Section 3.2): if $x _ { 1 } \approx x _ { 2 }$ , then $f _ { w } ( x _ { 1 } ) \approx f _ { w } ( x _ { 2 } )$ . It can be expressed by the following loss term:
+
+$$
+R ( f _ { w } , x ) = \left. J _ { f _ { w } } ( x ) \right. _ { F } ^ { 2 } ,
+$$
+
+where $\left\| \cdot \right\| _ { F }$ denotes the Frobenius norm, and $J _ { f _ { w } } ( x )$ is the Jacobian of the neural network input-to-output mapping $f _ { w }$ for some fixed network weights $w$ . This term penalizes mappings with large derivatives, and is used in contractive autoencoders (Rifai et al., 2011c).
+
+The domain of loss regularizers is very heterogeneous. We propose a natural way to categorize them by their dependence. We saw in Eq. (5) that weight decay depends on $w$ only, whereas the Jacobian penalty in Eq. (6) depends on $w$ , $f$ , and $x$ . More precisely, the Jacobian penalty uses the derivative $\partial y / \partial x$ of output $y = f _ { w } ( x )$ w.r.t. input $x$ . (We use vector-by-vector derivative notation from matrix calculus, i.e. $\partial y / \partial x = \partial f _ { w } ( x ) / \partial x = J _ { f _ { w } }$ is the Jacobian of $f _ { w }$ with fixed weights $w$ .) We identify the following dependencies of $R$ :
+
+∙ Dependence on the weights $w$
+∙ Dependence on the network output $y = f _ { w } ( x )$
+∙ Dependence on the derivative $\partial y / \partial w$ of the output $y = f _ { w } ( x )$ w.r.t. the weights $w$
+∙ Dependence on the derivative $\partial y / \partial x$ of the output $y = f _ { w } ( x )$ w.r.t. the input $x$
+∙ Dependence on the derivative $\partial E / \partial x$ of the error term $E$ w.r.t. the input $x$ ( $E$ depends on $t$ , and according to our definition such methods belong to Section 5, but they are listed here for overview)
+
+A review of existing methods can be found in Table 4. Weight decay seems to be still the most popular of the regularization terms. Some of the methods are equivalent or nearly equivalent to other methods from different taxonomy branches. For example, Tangent prop simulates minimal data augmentation (Simard et al., 1992); Injection of small-variance Gaussian noise (Bishop, 1995b; An, 1996) is an approximation of Jacobian penalty (Rifai et al., 2011c); and Fast dropout (Wang and Manning, 2013) is (in shallow networks) a deterministic approximation of Dropout. This is indicated in the Equivalence column in Table 4.
+
+# 7 Regularization via optimization
+
+The last class of the regularization methods according to our taxonomy is the regularization through optimization. While this may sound unusual, optimization and regularization cannot be clearly separated in the context of deep learning where it is not so crucial what the optimum of the empirical risk is (because it cannot be found exactly, and the ultimate goal is minimizing the expected risk anyway). Instead, the shape of the loss function and the optimization procedure play together to dictate how the training proceeds in the weight space and where it ends up. To demonstrate the overlap of regularization and optimization, we show in Figure 1 how one of the most prominent regularization methods, Dropout, can be seen as a modification of the optimization procedure.
+
+Stochastic gradient descent (SGD) (see Bottou, 1998) (along with its derivations) is the most frequently used optimization algorithm in the context of deep neural networks and is the center of our attention. We also list some alternative methods below.
+
+
Method
Description
Dependency
Equivalence
w
y
Weight decay (see Plaut et al.,1986;Lang and Hinton,1990;Goodfellow et al.,2016,Chap.7)
L² norm on network weights (notbiases). Favors smaller weights,thus for usual architectures tendsto make the mapping less“extreme",more robust to noise in the input.
×
Early stopping (seeCollobert and Bengio,2004;Goodfellow et al., 2016,Chap.7)
Weight smoothing(Lang and Hinton,1990)
Penalizes L²norm of gradientsof learned filters,making themsmooth. Not beneficial in practice.
×
Weight elimination(Weigend et al.,1991)
Similar to weight decay but favorsfew stronger connections over manyweak ones.
×
Goal similar to Narrow andbroad Gaussians
Soft weight-sharing(Nowlan and Hinton,1992)
Mixture-of-Gaussians prior onweights.Generalization of weightdecay.Weights are pushed to forma predefined number of groups withsimilar values.
X
Narrow and broad Gaussians(Nowlan and Hinton,1992;Blundell et al., 2015)
Weights come from two Gaussians,a narrow and a broad one.Specialcase of Soft weight-sharing.
X
Goal similar to Weightelimination
Fast dropout approximation(Wang and Manning,2013)
Approximates the loss that dropoutminimizes. Weighted L2weightpenalty. Only for shallow networks.
X
x
Dropout
Mutual exclusivity(Sajjadi et al., 2016)
Unlabeled samples push decisionboundaries to low-density regions ininput space,promoting sharp (con-fident) predictions.
X
Segmentation with binarypotentials (BenTaieb andHamarneh,2016)
Penalty on anatomically implausi-ble image segmentations.
X
Flat minima search(Hochreiter and Schmidhuber,1995)
Penalty for sharp minima,i.e. forweight configurations where smallweight perturbation leads to higherror increase.Flat minima havelow Minimum description length(i.e.exhibit ideal balance betweentraining error and model complex-ity)and thus should generalize bet-ter (Rissanen,1986).
×
X
Tangent prop(Simard et al.,1992)
L² penalty on directional derivativeof mapping in the predefined tan-gent directions that correspond toknown input-space transformations.
X
Simple data augmentation
Jacobian penalty(Rifai et al., 2011c)
L2penalty on the Jacobian of(partsof) the network mapping-smoothness prior.
X
Noise on inputs injection(not exact (see An,1996))
Manifold tangent classifier(Rifai et al., 2011a)
Like tangent prop,but the input“tangent” directions are extractedfrom manifold learned by a stack ofcontractive autoencoders and thenperforming SVD of the Jacobian ateach input sample.
×
Hessian penalty(Rifai et al.,2011b)
Fast waytoapproximateL²penalty of thepenalizingJacobianwithnoisyinput.
X
Tikhonov regularizers(Bishop,1995b)
L² penalty on (up to) n-th deriva-tive of the learned mapping w.r.t.input.
×
Forpenalty on firstderivative: noise on inputsinjection (not exact (see An,1996))
Loss-invariant backpropagation(Demyanov et al., 2015, Sec. 3.1;Lyu et al., 2015)
(L²)norm of gradient of loss w.r.t.input.Changes the mapping suchthat the loss becomes rather invari-ant to changes of the input.
×
Adversarial training
Prediction-invariantbackpropagation(Demyanov et al.,2015, Sec. 3.2)
(L2) norm of directional derivativeof mapping w.r.t.input in the di-rection of x causing the largest in-crease in loss.
×
×
Adversarial training
+
+Table 4: Regularization terms, with dependencies marked by $\pmb { * }$ . Methods that depend on $\partial E / \partial x$ implicitly depend on targets $t$ and thus can be considered part of the error function (Section 5) rather than regularization term (Section 6).
+
+Stochastic gradient descent is an iterative optimization algorithm using the following update rule:
+
+$$
+w _ { t + 1 } = w _ { t } - \eta _ { t } \nabla _ { w } \mathcal { L } ( w _ { t } , d _ { t } ) ,
+$$
+
+where $\nabla \mathcal { L } ( w _ { t } , d _ { t } )$ is the gradient of the loss $\mathcal { L }$ evaluated on a mini-batch $d _ { t }$ from the training set $\mathcal { D }$ . It is frequently used in combination with momentum and other tweaks improving the convergence speed (see Wilson et al., 2017). Moreover, the noise induced by the varying mini-batches helps the algorithm escape saddle points (Ge et al., 2015); this can be further reinforced by adding supplementary gradient noise (Neelakantan et al., 2015; Chaudhari and Soatto, 2015).
+
+If the algorithm reaches a low training error in a reasonable time (linear in the size of the training set, allowing multiple passes through $\mathcal { D }$ ), the solution generalizes well under certain mild assumptions; in that sense SGD works as an implicit regularizer : a short training time prevents overfitting even without any additional regularizer used (Hardt et al., 2016). This is in line with (Zhang et al., 2017) who find in a series of experiments that regularization (such as Dropout, data augmentation, and weight decay) is by itself neither necessary nor sufficient for good generalization.
+
+We divide the methods into three groups: initialization/warm-start methods, update methods, and termination methods, discussed in the following.
+
+Initialization and warm-start methods These methods affect the initial selection of the model weights. Currently the most frequently used method is sampling the initial weights from a carefully tuned distribution. There are multiple strategies based on the architecture choice, aiming at keeping the variance of activations in all layers around 1, thus preventing vanishing or exploding activations (and gradients) in deeper layers (Glorot and Bengio, 2010, Sec. 4.2; He et al., 2015).
+
+Another (complementary) option is pre-training on different data, or with a different objective, or with partially different architecture. This can prime the learning algorithm towards a good solution before the fine-tuning on the actual objective starts. Pre-training the model on a different task in the same domain may lead to learning useful features, making the primary task easier. However, pre-trained models are also often misused as a lazy approach to problems where training from scratch or using thorough domain adaptation, transfer learning, or multi-task learning methods would be worth trying. On the other hand, pre-training or similar techniques may be a useful part of such methods.
+
+Finally, with some methods such as Curriculum learning (Bengio et al., 2009), the transition between pre-training and fine-tuning is smooth. We refer to them as warm-start methods.
+
+∙ Initialization without pre-training
+
+– Random weight initialization (Rumelhart et al., 1986, p. 330; Glorot and Bengio, 2010; He et al., 2015; Hendrycks and Gimpel, 2016)
+– Orthogonal weight matrices (Saxe et al., 2013)
+– Data-dependent weight initialization (Krähenbühl et al., 2015)
+
+∙ Initialization with pre-training
+
+– Greedy layer-wise pre-training (Hinton et al., 2006; Bengio et al., 2007; Erhan et al., 2010) (has become less important due to advances (e.g. ReLUs) in effective end-to-end training that optimizes all parameters simultaneously)
+– Curriculum learning (Bengio et al., 2009)
+– Spatial contrasting (Hoffer et al., 2016)
+– Subtask splitting (Gülçehre and Bengio, 2016)
+
+Update methods This class of methods affects individual weight updates. There are two complementary subgroups: Update rules modify the form of the update formula; Weight and gradient filters are methods that affect the value of the gradient or weights, which are used in the update formula, e.g. by injecting noise into the gradient (Neelakantan et al., 2015).
+
+
+Figure 1: Effect of Dropout on weight optimization. Starting from the current weight configuration (red dot), all weights of certain neurons are set to zero (black arrow), descent step is performed in that subspace (teal arrow), and then the discarded weight-space coordinates are restored (blue arrow).
+
+Again, it is not entirely clear which of the methods only speed up the optimization and which actually help the generalization. Wilson et al. (2017) show that some of the methods such as AdaGrad or Adam even lose the regularization abilities of SGD.
+
+∙ Update rules
+
+– Momentum, Nesterov’s accelerated gradient method, AdaGrad, AdaDelta, RMSProp, Adam—overview in (Wilson et al., 2017) Learning rate schedules (Girosi et al., 1995; Hoffer et al., 2017)
+Online batch selection (Loshchilov and Hutter, 2015) SGD alternatives: L-BFGS (Liu and Nocedal, 1989; Le et al., 2011), Hessianfree methods (Martens, 2010), Sum-of-functions optimizer (Sohl-Dickstein et al., 2014), ProxProp (Frerix et al., 2017)
+
+∙ Gradient and weight filters
+
+– Annealed Langevin noise (Neelakantan et al., 2015)
+– AnnealSGD (Chaudhari and Soatto, 2015) Dropout (Hinton et al., 2012; Srivastava et al., 2014) corresponds to optimization steps in subspaces of weight space, see Figure 1
+Annealed noise on targets (Wang and Principe, 1999) (works as noise on gradient, but belongs rather to data-based methods, Section 3)
+
+Termination methods There are numerous possible stopping criteria and selecting the right moment to stop the optimization procedure may improve the generalization by reducing the error caused by the discrepancy between the minimizers of expected and empirical risk: The network first learns general concepts that work for all samples from the ground truth distribution $P$ before fitting the specific sample $\mathcal { D }$ and its noise (Krueger et al., 2017).
+
+The most successful and popular termination methods put a portion of the labeled data aside as a validation set and use it to evaluate performance (validation error ). The most prominent example is Early stopping (see Prechelt, 1998). Collobert and Bengio (2004) show that Early stopping has the same effect as Weight decay regularization penalty term in multi-layered perceptrons with linear output units; however, its hyperparameters are easier to tune.
+
+In scenarios where the training data are scarce it is possible to resort to termination methods that do not use a validation set. The simplest case is fixing the number of passes through the training set.
+
+∙ Termination using a validation set – Early stopping (see Morgan and Bourlard, 1990; Prechelt, 1998) – Choice of validation set size based on test set size (Amari et al., 1997)
+∙ Termination without using a validation set – Fixed number of iterations – Optimized approximation algorithm (Liu et al., 2008)
+
+# 8 Recommendations, discussion, conclusions
+
+We see the main benefits of our taxonomy to be two-fold: Firstly, it provides an overview of the existing techniques to the users of regularization methods and gives them a better idea of how to choose the ideal combination of regularization techniques for their problem. Secondly, it is useful for development of new methods, as it gives a comprehensive overview of the main principles that can be exploited to regularize the models. We summarize our recommendations $^ 3$ in the following paragraphs:
+
+Recommendations for users of existing regularization methods Overall, using the information contained in data as well as prior knowledge as much as possible, and primarily starting with popular methods, the following procedure can be helpful:
+
+∙ Common recommendations for the first steps:
+
+– Deep learning is about disentangling the factors of variation. An appropriate data representation should be chosen; known meaningful data transformations should not be outsourced to the learning. Redundantly providing the same information in several representations is okay. Output nonlinearity and error function should reflect the learning goals.
+– A good starting point are techniques that usually work well (e.g. ReLU, successful architectures). Hyperparameters (and architecture) can be tuned jointly, but “lazily” (interpolating/extrapolating from experience instead of trying too many combinations). Often it is helpful to start with a simplified dataset (e.g. fewer and/or easier samples) and a simple network, and after obtaining promising results gradually increasing the complexity of both data and network while tuning hyperparameters and trying regularization methods.
+
+∙ Regularization via data:
+
+– When not working with nearly infinite/abundant data: $^ *$ Gathering more real data (and using methods that take its properties into account) is advisable if possible: · Labeled samples are best, but unlabeled ones can also be helpful (compatible with semi-supervised learning). Samples from the same domain are best, but samples from similar domains can also be helpful (compatible with domain adaptation and transfer learning). · Reliable high-quality samples are best, but lower-quality ones can also be helpful (their confidence/importance can be adjusted accordingly). · Labels for an additional task can be helpful (compatible with multi-task learning). · Additional input features (from additional information sources) and/or data preprocessing (i.e. domain-specific data transformations) can be helpful (the network architecture needs to be adjusted accordingly).
+
+$^ *$ Data augmentation (e.g. target-preserving handcrafted domain-specific transformations) can well compensate for limited data. If natural ways to augment data (to mimic natural transformations sufficiently well) are known, they can be tried (and combined). \* If natural ways to augment data are unknown or turn out to be insufficient, it may be possible to infer the transformation from data (e.g. learning imagedeformation fields) if a sufficient amount of data is available for that.
+
+– Popular generic methods (e.g. advanced variants of Dropout) often also help.
+
+∙ Architecture and regularization terms:
+
+– Knowledge about possible meaningful properties of the mapping can be used to e.g. hardwire invariances (to certain transformations) into the architecture, or be formulated as regularization terms.
+
+– Popular methods may help as well (see Tables 3–4), but should be chosen to match the assumptions about the mapping (e.g. convolutional layers are fully appropriate only if local and shift-equivariant feature extraction on regular-grid data is desired).
+
+∙ Optimization:
+
+Initialization: Even though pre-trained ready-made models greatly speed up prototyping, training from a good random initialization should also be considered. – Optimizers: Trying a few different ones, including advanced ones (e.g. Nesterov momentum, Adam, ProxProp), may lead to improved results. Correctly chosen parameters, such as learning rate, usually make a big difference.
+
+Recommendations for developers of novel regularization methods Getting an overview and understanding the reasons for the success of the best methods is a great foundation. Promising empty niches (certain combinations of taxonomy properties) exist that can be addressed. The assumptions to be imposed upon the model can have a strong impact on most elements of the taxonomy. Data augmentation is more expressive than loss terms (loss terms enforce properties only in infinitesimally small neighborhood of the training samples; data augmentation can use rich transformation parameter distributions). Data and loss terms impose assumptions and invariances in a rather soft manner, and their influence can be tuned, whereas hardwiring the network architecture is a harsher way to impose assumptions. Different assumptions and options to impose them have different advantages and disadvantages.
+
+Future directions for data-based methods There are several promising directions that in our opinion require more investigation: Adaptive sampling of $\theta$ might lead to lower errors and shorter training times (Fawzi et al., 2016) (in turn, shorter training times may additionally work as implicit regularization (Hardt et al., 2016), see also Section 7). Secondly, learning class-dependent transformations (i.e. $p ( \theta | t )$ ) in our opinion might lead to more plausible samples. Furthermore, the field of adversarial examples (and network robustness to them) is gaining increased attention after the recently sparked discussion on real-world adversarial examples and their robustness/invariance to transformations such as the change of camera position (Lu et al., 2017; Athalye and Sutskever, 2017). Countering strong adversarial examples may require better regularization techniques.
+
+Summary In this work we proposed a broad definition of regularization for deep learning, identified five main elements of neural network training (data, architecture, error term, regularization term, optimization procedure), described regularization via each of them, including a further, finer taxonomy for each, and presented example methods from these subcategories. Instead of attempting to explain referenced works in detail, we merely pinpointed their properties relevant to our categorization. Our work demonstrates some links between existing methods. Moreover, our systematic approach enables the discovery of new, improved regularization methods by combining the best properties of the existing ones.
+
+# References
+
+Amari, S., Murata, N., Muller, K.-R., Finke, M., and Yang, H. H. (1997). Asymptotic statistical theory of overtraining and cross-validation. IEEE Transactions on Neural Networks, 8(5):985–996. (ˆ13)
+
+An, G. (1996). The effects of adding noise during backpropagation training on a generalization performance. Neural Computation, 8(3):643–674. ( $\hat { }$ 3, 5, 10, 11)
+
+Athalye, A. and Sutskever, I. (2017). Synthesizing robust adversarial examples. arXiv prerint arXiv:1707.07397. ( $\hat { \bf \Phi }$ 15)
+
+Ba, J. L., Kiros, J. R., and Hinton, G. (2016). Layer normalization. arXiv preprint arXiv:1607.06450. (ˆ5) Ba, L. J. and Caruana, R. (2014). Do deep nets really need to be deep? In Advances in Neural Information Processing Systems (NIPS). (ˆ5) Ba, L. J. and Frey, B. (2013). Adaptive dropout for training deep neural networks. In Advances in Neural Information Processing Systems (NIPS), pages 3084–3092. (ˆ4, 5) Baird, H. S. (1990). Document image defect models. In Proceedings of the IAPR Workshop on Syntactic and Structural Pattern Recognition (SSPR), pages 38–46. (ˆ6) Baxter, J. (2000). A model of inductive bias learning. Journal of Artificial Intelligence Research, 12(149-198):3. (ˆ9) Bengio, Y., Courville, A., and Vincent, P. (2013). Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence,
+35(8). (ˆ10) Bengio, Y., Lamblin, P., Popovici, D., and Larochelle, H. (2007). Greedy layer-wise training of deep networks. In Advances in Neural Information Processing Systems (NIPS), pages
+153–160. (ˆ12) Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In Proceedings of the International Conference on Machine Learning (ICML), pages 41–48. ACM. ( $\hat { }$ 12) BenTaieb, A. and Hamarneh, G. (2016). Topology aware fully convolutional networks for histology gland segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), pages 460–468. Springer International Publishing. ( $\hat { \ }$ 11) Bishop, C. M. (1995a). Neural Networks for Pattern Recognition. Oxford University Press. (ˆ1, 5, 7, 9, 24) Bishop, C. M. (1995b). Training with noise is equivalent to Tikhonov regularization. Neural Computation, 7(1):108–116. ( $\hat { \ }$ 3, 10, 11) Blundell, C., Cornebise, J., Kavukcuoglu, K., and Wierstra, D. (2015). Weight uncertainty in neural networks. In Proceedings of the International Conference on Machine Learning (ICML), pages 1613–1622. (ˆ11) Bottou, L. (1998). Online algorithms and stochastic approximations. In Saad, D., editor, Online Learning and Neural Networks. Cambridge University Press, Cambridge, UK. (ˆ10) Bouthillier, X., Konda, K., Vincent, P., and Memisevic, R. (2015). Dropout as data augmentation. arXiv preprint arXiv:1506.08700. ( $\hat { \mathbf { \alpha } }$ 4, 5, 23) Bucilă, C., Caruana, R., and Niculescu-Mizil, A. (2006). Model compression. In Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), pages 535–541. ACM. (ˆ5) Caruana, R. (1998). Multitask learning. In Learning to Learn, pages 95–133. Springer. (ˆ7,
+9) Cawley, G. C. and Talbot, N. L. (2010). On over-fitting in model selection and subsequent selection bias in performance evaluation. Journal of Machine Learning Research,
+11(Jul):2079–2107. ( $\hat { }$ 9) Chaudhari, P. and Soatto, S. (2015). The effect of gradient noise on the energy landscape of deep networks. arXiv preprint arXiv:1511.06485. (ˆ12, 13) Ciresan, D. C., Meier, U., Gambardella, L. M., and Schmidhuber, J. (2010). Deep big simple neural nets excel on handwritten digit recognition. Neural Computation, 22(12):1–14. ( $\hat { \mathbf { \alpha } }$ 6)
+Collobert, R. and Bengio, S. (2004). Links between perceptrons, mlps and svms. In Proceedings of the International Conference on Machine learning (ICML). ( $\hat { \ }$ 11, 13)
+Demyanov, S., Bailey, J., Kotagiri, R., and Leckie, C. (2015). Invariant backpropagation: how to train a transformation-invariant neural network. arXiv preprint arXiv:1502.04434. (ˆ11)
+DeVries, T. and Taylor, G. W. (2017). Dataset augmentation in feature space. In Proceedings of the International Conference on Machine Learning (ICML), Workshop Track. (ˆ5)
+Dieleman, S., Van den Oord, A., Korshunova, I., Burms, J., Degrave, J., Pigou, L., and Buteneers, P. (2015). Classifying plankton with deep neural networks. Technical report, Reservoir Lab, Ghent University, Belgium. http://benanne.github.io/2015/03/17/ plankton.html. (ˆ6)
+Dumoulin, V. and Visin, F. (2016). A guide to convolution arithmetic for deep learning. arXiv preprint arXiv:1603.07285. (ˆ7)
+Erhan, D., Bengio, Y., Courville, A., Manzagol, P.-A., Vincent, P., and Bengio, S. (2010). Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11:625–660. ( $\hat { }$ 12)
+Fawzi, A., Horst, S., Turaga, D., and Frossard, P. (2016). Adaptive data augmentation for image classification. In Proceedings of the IEEE International Conference on Image Processing (ICIP), pages 3688–3692. (ˆ6, 15)
+Frerix, T., Möllenhoff, T., Moeller, M., and Cremers, D. (2017). Proximal backpropagation. arXiv preprint arXiv:1706.04638. (ˆ13)
+Fukushima, K. and Miyake, S. (1982). Neocognitron: A self-organizing neural network model for a mechanism of visual pattern recognition. In Competition and Cooperation in Neural Nets, pages 267–285. Springer. (ˆ7)
+Gal, Y. and Ghahramani, Z. (2016). Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In Proceedings of the International Conference on Machine Learning (ICML), volume 48, pages 1050–1059. (ˆ4, 5)
+Ge, R., Huang, F., Jin, C., and Yuan, Y. (2015). Escaping from saddle points—online stochastic gradient for tensor decomposition. In Proceedings of the Conference on Learning Theory (COLT), pages 797–842. (ˆ12)
+Girosi, F., Jones, M., and Poggio, T. (1995). Regularization theory and neural networks architectures. Neural Computation, 7(2):219–269. (ˆ13)
+Glorot, X. and Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), pages 249–256. ( $\hat { }$ 12)
+Glorot, X., Bordes, A., and Bengio, Y. (2011). Deep sparse rectifier neural networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), pages 315–323. (ˆ8)
+Goodfellow, I., Warde-Farley, D., Mirza, M., Courville, A., and Bengio, Y. (2013). Maxout networks. In Proceedings of the International Conference on Machine Learning (ICML), volume 28, pages 1319–1327. (ˆ7, 8)
+Goodfellow, I. J., Bengio, Y., and Courville, A. (2016). Deep Learning. MIT Press. (ˆ1, 5, 10, 11)
+Gülçehre, Ç. and Bengio, Y. (2016). Knowledge matters: Importance of prior information for optimization. Journal of Machine Learning Research, 17(8):1–32. ( $\hat { \ }$ 12)
+Gülçehre, Ç., Moczulski, M., Denil, M., and Bengio, Y. (2016a). Noisy activation functions. In Proceedings of the International Conference on Machine Learning (ICML), pages 3059– 3068. (ˆ5)
+
+Gülçehre, Ç., Moczulski, M., Visin, F., and Bengio, Y. (2016b). Mollifying networks. arXiv preprint arXiv:1608.04980. (ˆ7)
+
+Hahnloser, R. H. R., Sarpeshkar, R., Mahowald, M. A., Douglas, R. J., and Seung, H. S. (2000). Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit. Nature, 405:947––951. ( $\hat { }$ 8)
+
+Hardt, M., Recht, B., and Singer, Y. (2016). Train faster, generalize better: stability of stochastic gradient descent. In Balcan, M. F. and Weinberger, K. Q., editors, Proceedings of the International Conference on Machine Learning (ICML), volume 48, pages 1225– 1234. ( $\hat { }$ 12, 15)
+
+Hauberg, S., Freifeld, O., Larsen, A. B. L., Fisher III, J. W., and Hansen, L. K. (2016). Dreaming more data: Class-dependent distributions over diffeomorphisms for learned data augmentation. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), pages 342–350. (ˆ6)
+
+He, K., Zhang, X., Ren, S., and Sun, J. (2015). Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1026–1034. (ˆ12)
+
+He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778. (ˆ7)
+
+Hendrycks, D. and Gimpel, K. (2016). Generalizing and improving weight initialization. arXiv preprint arXiv:1607.02488. (ˆ12)
+
+Hinton, G., Srivastava, N., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2012). Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580. (ˆ4, 5, 7, 8, 13)
+
+Hinton, G., Vinyals, O., and Dean, J. (2015). Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531. ( $\hat { \ }$ 5)
+
+Hinton, G. E., Osindero, S., and Teh, Y.-W. (2006). A fast learning algorithm for deep belief nets. Neural Computation, 18(7):1527–1554. ( $\hat { \ }$ 12)
+
+Hochreiter, S. and Schmidhuber, J. (1995). Simplifying neural nets by discovering flat minima. In Advances in Neural Information Processing Systems (NIPS), pages 529–536. (ˆ11)
+
+Hoffer, E., Hubara, I., and Ailon, N. (2016). Deep unsupervised learning through spatial contrasting. arXiv preprint arXiv:1610.00243. ( $\hat { \ }$ 12)
+
+Hoffer, E., Hubara, I., and Soudry, D. (2017). Train longer, generalize better: closing the generalization gap in large batch training of neural networks. arXiv preprint arXiv:1705.08741. ( $\hat { }$ 5, 13)
+
+Huang, G., Liu, Z., Weinberger, K. Q., and van der Maaten, L. (2016a). Densely connected convolutional networks. arXiv preprint arXiv:1608.06993. (ˆ7)
+
+Huang, G., Sun, Y., Liu, Z., Sedra, D., and Weinberger, K. Q. (2016b). Deep networks with stochastic depth. In Proceedings of the European Conference on Computer Vision (ECCV), pages 646–661. Springer. ( $\hat { \bf \Phi }$ 5, 7, 22)
+
+Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning (ICML), pages 448–456. (ˆ5)
+
+Jarrett, K., Kavukcuoglu, K., LeCun, Y., et al. (2009). What is the best multi-stage architecture for object recognition? In Proceedings of the International Conference on Computer Vision (ICCV), pages 2146–2153. IEEE. (ˆ8)
+
+Johnson, J., Alahi, A., and Fei-Fei, L. (2016). Perceptual losses for real-time style transfer and super-resolution. In Proceedings of the European Conference on Computer Vision (ECCV), pages 694–711. Springer. (ˆ2)
+
+Krähenbühl, P., Doersch, C., Donahue, J., and Darrell, T. (2015). Data-dependent initializations of convolutional neural networks. arXiv preprint arXiv:1511.06856. (ˆ12)
+
+Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), pages 1097–1105. (ˆ1, 10)
+
+Krueger, D., Ballas, N., Jastrzebski, S., Arpit, D., Kanwal, M. S., Maharaj, T., Bengio, E., Fischer, A., and Courville, A. (2017). Deep nets don’t learn via memorization. In Proceedings of the International Conference on Learning Representations (ICLR), Workshop Track. (ˆ13)
+
+Lang, K. J. and Hinton, G. E. (1990). Dimensionality reduction and prior knowledge in E-set recognition. In Advances in Neural Information Processing Systems (NIPS), pages 178–185. ( $\hat { \ }$ 10, 11)
+
+Lasserre, J. A., Bishop, C. M., and Minka, T. P. (2006). Principled hybrids of generative and discriminative models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pages 87–94. (ˆ9)
+
+Le, Q. V., Ngiam, J., Coates, A., Lahiri, A., Prochnow, B., and Ng, A. Y. (2011). On optimization methods for deep learning. In Proceedings of the International Conference on Machine Learning (ICML), pages 265–272. ( $\hat { \ }$ 13)
+
+LeCun, Y., Boser, B., Denker, J. S., Henderson, D., Howard, R. E., Hubbard, W., and Jackel, L. D. (1989). Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4):541–551. (ˆ7, 8)
+
+Liu, D. C. and Nocedal, J. (1989). On the limited memory BFGS method for large scale optimization. Mathematical Programming, 45(1):503–528. ( $\hat { \bf \Phi }$ 13)
+
+Liu, Y., Starzyk, J. A., and Zhu, Z. (2008). Optimized approximation algorithm in neural networks without overfitting. IEEE Transactions on Neural Networks, 19(6):983–995. (ˆ13)
+
+Long, J., Shelhamer, E., and Darrell, T. (2015). Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3431–3440. (ˆ7)
+
+Loosli, G., Canu, S., and Bottou, L. (2007). Training invariant support vector machines using selective sampling. In Bottou, L., Chapelle, O., DeCoste, D., and Weston, J., editors, Large-Scale Kernel Machines, pages 301–320. MIT Press, Cambridge, MA. (ˆ6)
+
+Loshchilov, I. and Hutter, F. (2015). Online batch selection for faster training of neural networks. arXiv preprint arXiv:1511.06343. (ˆ13)
+
+Lowe, D. G. (1999). Object recognition from local scale-invariant features. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), volume 2, pages 1150– 1157. ( $\hat { }$ 6)
+
+Lu, J., Sibai, H., Fabry, E., and Forsyth, D. (2017). No need to worry about adversarial examples in object detection in autonomous vehicles. arXiv preprint arXiv:1707.03501. (ˆ15)
+
+Lyu, C., Huang, K., and Liang, H.-N. (2015). A unified gradient regularization family for adversarial examples. In Proceedings of the IEEE International Conference on Data Mining (ICDM), pages 301–309. IEEE. (ˆ11)
+
+Maeda, S. (2014). A Bayesian encourages dropout. arXiv preprint arXiv:1412.7003. (ˆ4, 5)
+
+Martens, J. (2010). Deep learning via Hessian-free optimization. In Proceedings of the International Conference on Machine Learning (ICML), pages 735–742. (ˆ13)
+Milletari, F., Navab, N., and Ahmadi, S. A. (2016). V-net: Fully convolutional neural networks for volumetric medical image segmentation. In Proceedings of the International Conference on 3D Vision (3DV), pages 565––571. IEEE. (ˆ9)
+Morerio, P., Cavazza, J., Volpi, R., Vidal, R., and Murino, V. (2017). Curriculum dropout. arXiv preprint arXiv:1703.06229. (ˆ5)
+Morgan, N. and Bourlard, H. (1990). Generalization and parameter estimation in feedforward nets: Some experiments. In Advances in Neural Information Processing Systems (NIPS), pages 630–637. (ˆ13)
+Murata, N., Yoshizawa, S., and Amari, S. (1994). Network information criterion— determining the number of hidden units for an artificial neural network model. IEEE Transactions on Neural Networks, 5(6):865–872. (ˆ7, 9)
+Nair, V. and Hinton, G. E. (2010). Rectified linear units improve restricted Boltzmann machines. In Proceedings of the International Conference on Machine Learning (ICML), pages 807–814. ( $\hat { }$ 5, 8)
+Neelakantan, A., Vilnis, L., Le, Q. V., Sutskever, I., Kaiser, L., Kurach, K., and Martens, J. (2015). Adding gradient noise improves learning for very deep networks. arXiv preprint arXiv:1511.06807. ( $\hat { }$ 12, 13)
+Nowlan, S. J. and Hinton, G. E. (1992). Simplifying neural networks by soft weight-sharing. Neural Computation, 4(4):473–493. ( $^ { * * }$ 10, 11)
+Pan, S. J. and Yang, Q. (2010). A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345–1359. (ˆ9)
+Plaut, D. C., Nowlan, S. J., and Hinton, G. E. (1986). Experiments on learning by back propagation. Technical report, Carnegie-Mellon Univ., Pittsburgh, Pa. Dept. of Computer Science. ( $\hat { \ }$ 10, 11)
+Prechelt, L. (1998). Automatic early stopping using cross validation: quantifying the criteria. Neural Networks, 11(4):761–767. (ˆ13)
+Rasmus, A., Berglund, M., Honkala, M., Valpola, H., and Raiko, T. (2015). Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems (NIPS), pages 3546–3554. (ˆ9, 23)
+Rifai, S., Dauphin, Y. N., Vincent, P., Bengio, Y., and Muller, X. (2011a). The manifold tangent classifier. In Advances in Neural Information Processing Systems (NIPS), pages 2294–2302. (ˆ11)
+Rifai, S., Glorot, X., Bengio, Y., and Vincent, P. (2011b). Adding noise to the input of a model trained with a regularized objective. arXiv preprint arXiv:1104.3250. (ˆ11)
+Rifai, S., Vincent, P., Muller, X., Glorot, X., and Bengio, Y. (2011c). Contractive autoencoders: Explicit invariance during feature extraction. In Proceedings of the International Conference on Machine Learning (ICML), pages 833–840. (ˆ7, 10, 11)
+Rissanen, J. (1986). Stochastic complexity and modeling. The Annals of Statistics, 14:1080– 1100. ( $\hat { }$ 11)
+Ruder, S. (2017). An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098. (ˆ7, 9)
+Rumelhart, D. E., McClelland, J. L., and Group, P. R. (1986). Parallel distributed processing: Explorations in the microstructures of cognition. Volume 1: Foundations. MIT Press. (ˆ7, 12)
+Sajjadi, M., Javanmardi, M., and Tasdizen, T. (2016). Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Advances in Neural Information Processing Systems (NIPS), pages 1163–1171. ( $\hat { \ }$ 9, 11)
+Salamon, J. and Bello, J. P. (2017). Deep convolutional neural networks and data augmentation for environmental sound classification. IEEE Signal Processing Letters, 24(3):279– 283. (ˆ6)
+Saxe, A. M., McClelland, J. L., and Ganguli, S. (2013). Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120. (ˆ12)
+Sermanet, P., Eigen, D., Zhang, X., Mathieu, M., Fergus, R., and LeCun, Y. (2013). Overfeat: Integrated recognition, localization and detection using convolutional networks. arXiv preprint arXiv:1312.6229. ( $\hat { }$ 6)
+Simard, P., Le Cun, Y., Denker, J., and Victorri, B. (1992). An efficient algorithm for learning invariance in adaptive classifiers. In Proceedings of the International Conference on Pattern Recognition (ICPR), pages 651–655. IEEE. ( $\hat { }$ 10, 11)
+Simard, P. Y., Steinkraus, D., and Platt, J. C. (2003). Best practices for convolutional neural networks. In Proceedings of the International Conference on Document Analysis and Recognition (ICDAR), volume 3, pages 958–962. (ˆ6, 7)
+Simonyan, K. and Zisserman, A. (2015). Very deep convolutional networks for large-scale image recognition. In Proceedings of the International Conference on Learning Representations (ICLR). (ˆ6)
+Smith, L. N., Hand, E. M., and Doster, T. (2015). Gradual DropIn of layers to train very deep neural networks. arXiv preprint arXiv:1511.06951. (ˆ7)
+Sohl-Dickstein, J., Poole, B., and Ganguli, S. (2014). Fast large-scale optimization by unifying stochastic gradient and quasi-Newton methods. In Proceedings of the International Conference on Machine Learning (ICML), pages 604–612. (ˆ13)
+Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2014). Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958. ( $\hat { \mathbf { \Omega } }$ 4, 5, 7, 8, 13)
+Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. (2016). Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2818–2826. (ˆ5)
+Szegedy, C., Zaremba, W., Sutskever, I., Bruna, J., Erhan, D., Goodfellow, I., and Fergus, R. (2014). Intriguing properties of neural networks. In Proceedings of the International Conference on Machine Learning (ICML). (ˆ5)
+Ulyanov, D., Lebedev, V., Vedaldi, A., and Lempitsky, V. S. (2016). Texture networks: Feed-forward synthesis of textures and stylized images. In Proceedings of the International Conference on Machine Learning (ICML), pages 1349–1357. (ˆ2)
+van der Smagt, P. and Hirzinger, G. (1998). Solving the ill-conditioning in neural network learning. In Neural Networks: Tricks of the Trade, pages 193–206. Springer. (ˆ7)
+Wan, L., Zeiler, M., Zhang, S., LeCun, Y., and Fergus, R. (2013). Regularization of neural networks using DropConnect. In Proceedings of the International Conference on Machine Learning (ICML), pages 1058–1066. (ˆ7)
+Wang, C. and Principe, J. C. (1999). Training neural networks with additive noise in the desired signal. IEEE Transactions on Neural Networks, 10(6):1511–1517. ( $\hat { }$ 5, 13)
+Wang, S. and Manning, C. (2013). Fast dropout training. In Proceedings of the International Conference on Machine Learning (ICML), pages 118–126. ( $\hat { \mathbf { \alpha } }$ 10, 11)
+Weigend, A. S., Rumelhart, D. E., and Huberman, B. A. (1991). Generalization by weightelimination with application to forecasting. In Advances in Neural Information Processing Systems (NIPS), pages 875–882. ( $\hat { }$ 11)
+Wilson, A. C., Roelofs, R., Stern, M., Srebro, N., and Recht, B. (2017). The marginal value of adaptive gradient methods in machine learning. arXiv preprint arXiv:1705.08292. ( $\hat { }$ 12, 13)
+Wong, S. C., Gatt, A., Stamatescu, V., and McDonnell, M. D. (2016). Understanding data augmentation for classification: When to warp? In Proceedings of the International Conference on Digital Image Computing: Techniques and Applications (DICTA). (ˆ5)
+Xu, B., Wang, N., Chen, T., and Li, M. (2015). Empirical evaluation of rectified activations in convolutional network. arXiv preprint arXiv:1505.00853. (ˆ5)
+Yaegger, L., Lyon, R., and Webb, B. (1996). Effective training of a neural network character classifier for word recognition. In Advances in Neural Information Processing Systems (NIPS), volume 9, pages 807–813. ( $^ { * * }$ 6)
+Yan, L., Dodier, R. H., Mozer, M., and Wolniewicz, R. H. (2003). Optimizing classifier performance via an approximation to the Wilcoxon-Mann-Whitney statistic. In Proceedings of the International Conference on Machine Learning (ICML), pages 848–855. (ˆ9)
+Yu, F. and Koltun, V. (2015). Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122. (ˆ7)
+Zeiler, M. and Fergus, R. (2013). Stochastic pooling for regularization of deep convolutional neural networks. In Proceedings of the International Conference on Learning Representations (ICLR). (ˆ7, 8)
+Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. (2017). Understanding deep learning requires rethinking generalization. In Proceedings of the International Conference on Learning Representations (ICLR). ( $\hat { \ }$ 12)
+
+# A Ambiguities in the taxonomy
+
+Although our proposed taxonomy seems intuitive, there are some ambiguities: Certain methods have multiple interpretations matching various categories. Viewed from the exterior, a neural network maps inputs $x$ to outputs $y$ . We formulate this as $y = f _ { w } ( \tau _ { \theta } ( x ) )$ for transformations $\tau _ { \theta }$ in input space (and similarly for hidden-feature space, where $^ Ḋ \prime \theta Ḍ$ is applied in between layers of the network $f _ { w }$ ). However, how to split this $x$ -to- $y$ mapping into “the $\tau _ { \theta }$ part” and “the $f _ { w }$ part”, and thus into Section 3 vs. Section 4, is ambiguous and up to one’s taste and goals. In our choices (marked with “ ” below), we attempt to use common notions and Occam’s razor.
+
+Ambiguity of attributing noise to $f$ , or to $w$ , or to data transformations $\tau _ { \theta }$ : – Stochastic methods such as Stochastic depth (Huang et al., 2016b) can have several interpretations if stochastic transformations are allowed for $f$ or $w$ : Stochastic transformation of the architecture $f$ (randomly dropping some connections), Table 3 $\sqcup$ Stochastic transformation of the weights $w$ (setting some weights to $0$ in a certain random pattern) $\sqcup$ Stochastic transformation $\tau _ { \theta }$ of data in hidden-feature space; dependence is $p ( \theta )$ , described in Table 1 for completeness
+
+∙ Ambiguity of splitting $^ Ḋ \prime \theta Ḍ$ into $\tau$ and $\theta$ :
+
+– Dropout:
+
+Parameters $\theta$ are the dropout mask; dependence is $p ( \theta )$ ; transformation $\tau$ applies the dropout mask to the hidden features
+
+$\sqcup$ Parameters $\theta$ are the seed state of a pseudorandom number generator; dependence is $p ( \theta )$ ; transformation $\tau$ internally generates the random dropout mask from the random seed and applies it to the hidden features
+
+– Projecting dropout noise into input space (Bouthillier et al., 2015, Sec. 3) can fit our taxonomy in different ways by defining $\tau$ and $\theta$ accordingly. It can have similar interpretations as Dropout above (if $\tau$ is generalized to allow for dependence on $x , f , w )$ , but we prefer the third interpretation without such generalizations:
+
+$\sqcup$ Parameters $\theta$ are the dropout mask (to be applied in a hidden layer); dependence is $p ( \theta )$ ; transformation $\gamma$ transforms the input to mimic the effect of the mask
+$\sqcup$ Parameters $\theta$ are the seed state of a pseudorandom number generator; dependence is $p ( \theta )$ ; transformation $\tau$ internally generates the random dropout mask from the random seed and transforms the input to mimic the effect of the mask
+V Parameters $\theta$ describe the transformation of the input in any formulation; dependence is $p ( \theta | x , f , w )$ ; transformation $\tau$ merely applies the transformation in input space
+
+∙ Ambiguity of splitting the network operation $f _ { w }$ into layers: There are several possibilities to represent a function (neural network) as a composition (or directed acyclic graph) of functions (layers).
+
+∙ Many of the input and hidden-feature transformations (Section 3) can be considered layers of the network (Section 4). In fact, the term “layer” is not uncommon for Dropout or Batch normalization.
+
+∙ The usage of a trainable parameter in several parts of the network is called weight sharing. However, some mappings can be expressed with two equivalent formulas such that a parameter appears only once in one formulation, and several times in the other.
+
+∙ Ambiguity of $E$ vs. $R$ : Auxiliary denoising task in ladder networks (Rasmus et al., 2015) and similar autoencoder-style loss terms can be interpreted in different ways:
+
+V Regularization term $R$ without given auxiliary targets $t$
+$\sqcup$ The ideal reconstructions can be considered as targets $t$ (if the definition of “targets” is slightly modified) and thus the denoising task becomes part of the error term $E$
+
+# B Data-augmented loss function
+
+To understand the success of target-preserving data augmentation methods, we consider the data-augmented loss function, which we obtain by replacing the training samples $( x _ { i } , t _ { i } ) \in \mathcal { D }$ in the empirical risk loss function (Eq. (3)) by augmented training samples $( \tau _ { \theta } ( x _ { i } ) , t _ { i } )$ :
+
+$$
+\begin{array} { r l } & { \hat { \mathcal { L } } _ { A } = \displaystyle \frac { 1 } { | \mathcal { D } | } \sum _ { ( x _ { i } , t _ { i } ) \in \mathcal { D } } \mathbb { E } _ { \theta } \Big [ \ell \big ( \tau _ { \theta } ( x _ { i } ) , t _ { i } \big ) \Big ] } \\ & { \quad \quad = \displaystyle \frac { 1 } { | \mathcal { D } | } \sum _ { ( x _ { i } , t _ { i } ) \in \mathcal { D } } \int \Big ( \ell \big ( \tau _ { \theta } ( x _ { i } ) , t _ { i } \big ) \Big ) p ( \theta ) \mathrm { d } \theta , } \end{array}
+$$
+
+where we have replaced the inner part ( $E$ and $R$ ) of the loss function by $\ell$ to simplify the notation. Moreover, $\hat { \mathcal { L } } _ { A }$ can be rewritten as
+
+$$
+\begin{array} { r l } & { \hat { \mathcal { L } } _ { A } = \displaystyle \iint \frac { 1 } { X , T } \displaystyle \sum _ { ( x , t _ { i } ) \in \mathcal { D } _ { \Theta } } \int \ell ( x , t ) \ p ( \theta ) \ \delta \big ( x - \tau _ { \theta } ( x _ { i } ) \big ) \ \delta ( t - t _ { i } ) \ \mathrm { d } \theta \mathrm { d } t \mathrm { d } x } \\ & { \quad = \displaystyle \iint \ell ( x , t ) \Bigg [ \frac { 1 } { | \mathcal { D } | } \sum _ { ( x _ { i } , t _ { i } ) \in \mathcal { D } _ { \Theta } } \int \delta \big ( x - \tau _ { \theta } ( x _ { i } ) \big ) \ \delta ( t - t _ { i } ) \ p ( \theta ) \mathrm { d } \theta \Bigg ] \mathrm { d } t \mathrm { d } x } \\ & { \quad = \displaystyle \iint \ell ( x , t ) \ q ( x , t ) \ \mathrm { d } t \mathrm { d } x , } \end{array}
+$$
+
+where $\delta ( x )$ is the Dirac delta function: $\delta ( x ) = 0 \forall x \neq 0$ and $\textstyle \int \delta ( x ) \mathrm { d } x = 1$ ; and $\boldsymbol { q } ( \boldsymbol { x } , t )$ is defined as
+
+$$
+q ( x , t ) = \frac { 1 } { | \mathcal { D } | } \sum _ { ( x _ { i } , t _ { i } ) \in \mathcal { D } } \int _ { \Theta } \delta \big ( x - \tau _ { \theta } ( x _ { i } ) \big ) \delta ( t - t _ { i } ) p ( \theta ) \mathrm { d } \theta .
+$$
+
+Since $q$ is non-negative and $\int _ { \ a } ^ { \cdot } \int q ( x , t ) \mathrm { d } x \mathrm { d } t = 1$ , it is a valid probability density function inducing the distribution $Q$ of augmented data. Therefore,
+
+$$
+\begin{array} { r } { \hat { \mathcal { L } } _ { A } = \mathbb { E } _ { ( x , t ) \sim Q } \big [ \ell ( x , t ) \big ] . } \end{array}
+$$
+
+When $Q = P$ , Eq. (11) becomes the expected risk (2). We can show how this is related to importance sampling:
+
+$$
+\begin{array} { l } { \displaystyle \mathcal { L } = \mathbb { E } _ { ( x , t ) \sim P } \big [ \ell ( x , t ) \big ] } \\ { \displaystyle = \int _ { X , T } \ell ( x , t ) p ( x , t ) \mathrm { d } t \mathrm { d } x } \\ { \displaystyle \quad \times \int _ { X , T } \ell ( x , \ell ) \frac { p ( x , t ) } { q ( x , t ) } q ( x , \ell ) \mathrm { d } t \mathrm { d } x } \\ { \displaystyle \quad \times _ { X , T } } \\ { \displaystyle = \mathbb { E } _ { ( x , t ) \sim Q } \Big [ \ell ( x , t ) \frac { p ( x , t ) } { q ( x , t ) } \Big ] } \\ { \displaystyle \quad \neq \mathbb { E } _ { ( x , t ) \sim Q } \big [ \ell ( x , t ) \big ] } \\ { \displaystyle \quad = \hat { \ell } _ { A + } } \end{array}
+$$
+
+The difference between $\mathcal { L }$ and $\hat { \mathcal { L } } _ { A }$ is the re-weighting term $p ( x , t ) / q ( x , t )$ identical to the one known from importance sampling (see Bishop, 1995a). The more similar $Q$ is to $P$ (i.e. the closer $Q$ models the ground truth distribution $P$ ), the more similar the augmented-data loss $\hat { \mathcal { L } } _ { A }$ is to the expected loss $\mathcal { L }$ . We see that data augmentation tries to simulate the real distribution $P$ by creating new samples from the training set $\mathcal { D }$ , bridging the gap between the expected and the empirical risk.
\ No newline at end of file
diff --git a/md/train/SkeWc2EKPH/SkeWc2EKPH.md b/md/train/SkeWc2EKPH/SkeWc2EKPH.md
new file mode 100644
index 0000000000000000000000000000000000000000..26d0929622f34992da33b8358bc67f47b48589fd
--- /dev/null
+++ b/md/train/SkeWc2EKPH/SkeWc2EKPH.md
@@ -0,0 +1,546 @@
+# MODEL-FREE CONTROL OF NONLINEAR STOCHASTIC SYSTEMS WITH STABILITY GUARANTEE
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+Reinforcement learning (RL) offers a principled way to achieve the optimal cumulative performance index in discrete-time nonlinear stochastic systems, which are modeled as Markov decision processes. Its integration with deep learning techniques has promoted the field of deep RL with an impressive performance in complicated continuous control tasks. However, from a control-theoretic perspective, the first and most important property of a system to be guaranteed is stability. Unfortunately, stability is rarely assured in RL and remains an open question. In this paper, we propose a stability guaranteed RL framework which simultaneously learns a Lyapunov function along with the controller or policy, both of which are parameterized by deep neural networks, by borrowing the concept of Lyapunov function from control theory. Our framework can not only offer comparable or superior control performance over the state-of-the-art RL algorithms, but also construct a Lyapunov function to validate the closed-loop stability. In the simulated experiments, our approach is evaluated on several well-known examples including classic CartPole balancing, 3-dimensional robot control and control of synthetic biology gene regulatory networks. Compared with RL algorithms without stability guarantee, our approach can enable the system to recover to the operating point when interfered by uncertainties such as unseen disturbances and system parametric variations to a certain extent. (Anonymous code is available to reproduce the experimental results1.)
+
+# 1 INTRODUCTION
+
+Control of discrete-time nonlinear stochastic systems is an important topic in both control theory and reinforcement learning. In the past decades, the advancement of nonlinear control theory in the control community has been successfully applied in aircraft, automobiles, advanced robots and space systems (Slotine et al., 1991; Isidori, 1995). Concurrently, reinforcement learning was developed in the machine learning community to address similar nonlinear control problems (Sutton et al., 1992; Tesauro, 1995; Bertsekas & Tsitsiklis, 1996). Until recently, significant progress has been made by combining advances in deep learning (LeCun et al., 2015) with reinforcement learning. Impressive results are obtained in a series of high-dimensional continuous nonlinear control problems (Duan et al., 2016; Zhang et al., 2016; Zhu et al., 2017; Gu et al., 2017) in which control-theoretic approach is typically difficult to apply.
+
+Given a control system, regardless of which controller design method is used, control theory or reinforcement learning, the first and most important property of a system needs to be guaranteed is stability, because an unstable control system is typically useless and potentially dangerous (Slotine et al., 1991). Qualitatively, a system is described as stable if starting the system in the neighborhood of its desired operating point implies that it will stay around the point ever after. For aircraft control systems, a typical stability problem is intuitively related to the following question: will a trajectory perturbation caused by a gust result in a significant deviation in the later flight trajectory? Here, the desired operating point of the system is the flight trajectory in the absence of disturbance. Every control system, whether linear or nonlinear, involves a stability problem which should be carefully studied.
+
+The most useful and general approach for studying the stability of control systems is Lyapunov method (Lyapunov, 1892), which is dominant in control engineering (Astr ˚ om & Wittenmark, 1989; ¨ Mayne et al., 2000). In Lyapunov method, a scalar “energy-like” function called Lyapunov function is constructed to analyze the stability of the system. For a linear dynamical system, a quadratic function is typically chosen as Lyapunov function in some classic controller design method, such as linear quadratic regulator (LQR) and model predictive control (MPC). Unfortunately, there is no universal method for constructing Lyapunov functions.
+
+In this paper, we propose a stability guaranteed reinforcement learning framework to jointly learn the controller or policy2 and a Lyapunov function both of which are parameterized by deep neural networks, with a focus on stabilization and tracking problems in discrete-time nonlinear stochastic systems modeled by Markov decision process. The contribution of our paper can be summarized as follows: 1) a novel data-based approach for analyzing the stability of the closed-loop system is proposed by constructing a Lyapunov function parameterized by deep neural network; 2) a practical learning algorithm is designed to search the stability guaranteed controller; 3) the learned controller is able to stabilize the system when interfered by uncertainties such as unseen disturbance and system parameters variations of certain extent. In our experiment, we can show that the stability guaranteed controller is more capable of handling uncertainties compared to those without such guarantees in nonlinear control problems including classic CartPole stabilization tasks, control of 3D legged robots and manipulator and reference tracking tasks for synthetic biology gene regulatory networks.
+
+# 1.1 RELATED WORKS
+
+In model-free reinforcement learning (RL), stability is rarely addressed due to the formidable challenge of analyzing and designing the closed-loop system dynamics in a model-free manner (Bus¸oniu et al., 2018), and the associated stability theory in model-free RL remains as an open problem (Bus¸oniu et al., 2018; Gorges, 2017).
+
+Recently, Lyapunov analysis is used in model-free RL to solve control problems with safety constraints (Chow et al., 2018; 2019). In Chow et al. (2018), Lyapunov-based approach for solving constrained Markov decision process is proposed with a novel way of constructing the Lyapunov function through linear programming. In Chow et al. (2019), the above results were further generalized to continuous control tasks. Even though Lyapunov-based methods were adopted in these results, neither of them addressed the stability of the system.
+
+As a basic tool in control theory, the construction/learning of Lyapunov function is not a trivial issue and many works are devoted to this problem. In Perkins & Barto (2002), the RL agent controls the switch between controllers designed using Lyapunov domain knowledge, so that any policy is safe and reliable. Petridis & Petridis (2006) proposes a straightforward approach for constructing Lyapunov function for nonlinear systems using neural networks. Richards et al. (2018) proposes a learning-based approach for constructing Lyapunov neural networks with maximized region of attraction. Results on learning and construction of Lyapunov functions are referred to Noroozi et al. (2008); Prokhorov (1994); Serpen (2005); Prokhorov & Feldkamp (1999).
+
+Other interesting results on the stability of learning-based control systems are reported in recent years. In Postoyan et al. (2017), an initial result is proposed for the stability analysis of deterministic nonlinear systems with optimal controller for infinite-horizon discounted cost, based on the assumption that discount is sufficiently close to 1. In Berkenkamp et al. (2017), a learning model-based safe RL approach with safety guarantee during exploration is introduced but limited to Lipschitz continuous nonlinear systems such as Gaussian process model. In addition, the verification of stability condition requires the discretization of state space, which limits its application to tasks with low-dimensional finite state space.
+
+# 2 PROBLEM STATEMENT
+
+We consider discrete-time nonlinear stochastic systems modeled by the Markov decision process (MDP). A MDP is defined by the tuple $( S , { \mathcal { A } } , c , P , \rho )$ , where $S \subseteq \mathbb { R } ^ { n }$ is the set of states, $\mathcal { A } \subseteq \mathbb { R } ^ { m }$ is the set of actions, $c ( s , a ) : S \times \mathcal { A } \to \mathbb { R } _ { + }$ is the cost function, $P ( s ^ { \prime } | s , a )$ is the transition probability function, and $\rho ( s )$ is the starting state distribution.
+
+In this paper, we focus on the stabilization and tracking problems for discrete-time nonlinear stochastic systems modeled by MDP. For both problems, the goal is to find a policy $\pi$ which can bring the cost $c$ to zero. In stabilization problems, the cost function is defined as the norm of states $\| s \|$ where $\| \cdot \|$ denotes the Euclidean norm. In tracking problems, we divide the state $s$ into two vectors, $s ^ { 1 }$ and $s ^ { 2 }$ , where $s ^ { 1 }$ is composed of elements of $s$ that are aimed at tracking the reference signal $r$ while $s ^ { 2 }$ contains the rest. For tracking, $\| s ^ { 1 } - r \|$ is chosen to be the cost function.
+
+From a control theoretic perspective, the task of stabilization and tracking could be addressed as ensuring the closed-loop system or error system to be asymptotically stable, i.e., starting from an initial point, the trajectories of state always converge to a single point or the reference trajectory. Let $c _ { \pi } ( s ) \triangleq \mathbb { E } _ { a \sim \pi } c ( s , a )$ denote the cost function under policy $\pi$ , the definition of stability studied in this paper is given as follows.
+
+Definition 1 The stochastic system is said to be stable in mean cost if $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { s _ { t } } c _ { \pi } ( s _ { t } ) = 0 } \end{array}$ holds for any initial condition $s _ { 0 } \in \{ s _ { 0 } | c _ { \pi } ( s _ { 0 } ) \leq b \}$ . If $b$ is arbitrarily large then the stochastic system is globally stable in mean cost.
+
+Remark 1 Form of the cost is strictly ruled as the Euclidean norm of state or partial state, while other forms are not considered in this paper. The stability studied in this paper is a type of local asymptotic stochastic stability, which is different to the definition of mean square stability (MSS) that extensively studied on stochastic systems in control theory (Shaikhet, 1997; Huang, 2012).
+
+Before proceeding, some notations are to be defined. The closed-loop transition probability is denoted as $\begin{array} { r } { P _ { \pi } ( s ^ { \prime } | s ) \triangleq \int _ { \cal A } \pi ( a | s ) P ( s ^ { \prime } | s , a ) \mathrm { d } a } \end{array}$ . We also introduce the closed-loop state distribution at certain instant $t$ as $P ( s | \rho , \pi , t )$ , which could be defined in an iterative way: $P ( s ^ { \prime } | \rho , \pi , t + 1 ) =$ $\begin{array} { r } { \int _ { S } P _ { \pi } ( s ^ { \prime } | s ) P ( s | \rho , \pi , t ) \mathrm { d } s , \forall t \ } \end{array}$ $\forall t \in \mathbb { Z } _ { + }$ and $P ( s | \rho , \pi , 0 ) = \rho ( s )$ .
+
+# 3 MAIN RESULTS
+
+In this section, we propose the main assumptions and a new theorem.
+
+Assumption 1 The stationary distribution of state $q _ { \pi } ( s ) \triangleq \operatorname* { l i m } _ { t \infty } P ( s | \rho , \pi , t )$ exists.
+
+Assumption 2 There exists a positive constant b such that $\rho ( s ) > 0 , \forall s \in \{ s | c _ { \pi } ( s ) \leq b \} .$
+
+Our approach is to construct/find a Lyapunov function which can be used to analyze the stability of the closed-loop system. The Lyapunov method has long been used for stability analysis and controller design in control theory (Boukas & Liu, 2000), but mostly exploited along with a known model, whether deterministic or probabilistic (Corless & Leitmann, 1981; Thowsen, 1983; Huang et al., 2011).
+
+The Lyapunov function is a class of semi-positive definite functions $L : S \to \mathbb { R } _ { + }$ . The general idea of exploiting Lyapunov function is to ensure that the difference (or derivative, if the system is in continuous time) of Lyapunov function along the state trajectory is semi-negative definite, so that the state goes in the direction of decreasing the value of Lyapunov function and eventually converges to the origin or a sub-level set of Lyapunov function. Next, we give sufficient conditions for a system to be stable in mean cost in the following.
+
+Theorem 1 The stochastic system is stable in mean cost if there exists a function $L : S \to \mathbb { R _ { + } }$ and positive constants $\alpha _ { 1 } , \alpha _ { 2 }$ and $\alpha _ { 3 }$ , such that
+
+$$
+\begin{array} { c } { { \alpha _ { 1 } c _ { \pi } \left( s \right) \leq L ( s ) \leq \alpha _ { 2 } c _ { \pi } \left( s \right) } } \\ { { { \mathbb E } _ { s \sim \mu _ { \pi } } ( { \mathbb E } _ { s ^ { \prime } \sim P _ { \pi } } L ( s ^ { \prime } ) - L ( s ) ) \leq - \alpha _ { 3 } { \mathbb E } _ { s \sim \mu _ { \pi } } c _ { \pi } \left( s \right) } } \end{array}
+$$
+
+where $\begin{array} { r } { \mu _ { \pi } ( s ) \triangleq \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s _ { t } = s | \rho , \pi , t ) } \end{array}$ is the sampling distribution.
+
+Due to space limitations, we will include the detailed proof in Appendix A. Eq. (2) is called the energy decreasing condition, i.e., requiring the expectation of Lyapunov function to be decreasing between two consecutive instants. Eq. (1) is the constraint for Lyapunov function, though a rather broad range of parameterization is covered. The sum of quadratic polynomials, e.g., $L ( s ) { \stackrel { \smile } { = } } s ^ { T } Q s$ where $Q$ is a positive definite matrix, are extensively used in the control theory. Such Lyapunov functions can be efficiently discovered by the semi-definite programming solvers and bring in limited conservatism for the control tasks where the cost are also of a quadratic form. In (Richards et al., 2018), a neural network $\phi _ { \theta } ( \cdot )$ is designed to construct the Lyapunov function, $L ( s ) = \phi _ { \theta } ( s ) ^ { T } \phi _ { \theta } ( s )$ . As explored in (Chow et al., 2018) and (Berkenkamp et al., 2017), the value function could be exploited as a Lyapunov function as well. Additionally, the sum of cost over a limited time horizon could also be employed as Lyapunov function, i.e., $\begin{array} { r } { \dot { L ( s ) } = \sum _ { t } ^ { t + N } \mathbb { E } c _ { \pi } ( s _ { t } ) } \end{array}$ , which is a valid Lyapunov candidate in model predictive control literature (Mayne & Michalska, 1990; Mayne et al., 2000).
+
+The choice of Lyapunov function candidate plays an important role in learning a policy. Value function evaluates the infinite time horizon and thus offers a better performance in general, but is rather difficult to approximate because of significant variance and bias (Schulman et al., 2015). On the other hand, the finite horizon sum of cost provides an explicit target for learning a Lyapunov function, thus inherently reduces the bias and enhances the learning process. However, as the model is unknown, predicting the future costs based on the current state and action inevitably introduces variance, which grows as the prediction horizon extends. In principle, for tasks with simple dynamics, the sum-of-cost choice enhances the convergence of learning and robustness of the trained policies, while for complicated systems the choice of value function generally produces better performance. In this paper, we use both value function and sum-of-cost over various horizons as Lyapunov function candidates in different tasks and compare their strength and weakness respectively. Now we would like to give the following two remarks.
+
+Remark 2 This remark is on Assumption 1 and sampling distribution $\mu _ { \pi }$ . If an MDP is ergodic then the existence of $q _ { \pi }$ is naturally assured, but all states have to be positive recurrent and aperiodic (Papoulis & Pillai, 2002). The existence of sampling distribution $\mu _ { \pi } ( s )$ is guaranteed by the existence of $q _ { \pi } ( s )$ . Since the sequence $\{ P ( s | \rho , \pi , t ) , t \in \mathbb { Z } _ { + } \}$ converges to $q _ { \pi } ( s )$ as $t$ approaches $\infty _ { \astrosun }$ , then by the Abelian theoThus we use , the sequence to approximat $\begin{array} { r } { \{ \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s | \rho , \pi , t ) , N \in \mathbb { Z } _ { + } \} } \end{array}$ also converges and requires data to b $\mu _ { \pi } ( s ) = q _ { \pi } ( s )$ $\mu _ { \pi }$ $q _ { \pi }$ $q _ { \pi }$
+infinite instants the episode begins. Even if the sampling period $N < < \infty$ , one can still assure that $c _ { \pi }$ converges to a neighborhood of zero, which is related to the initial state distribution and length of $N _ { i }$ , i.e., $\begin{array} { r } { \mathbb { E } _ { s _ { N } } c _ { \pi } ( s _ { N } ) \le \frac { \alpha _ { 2 } } { \alpha _ { 1 } + \alpha _ { 3 } } \mathbb { E } _ { \rho } c _ { \pi } ( s _ { 0 } ) - \frac { \alpha _ { 3 } } { \alpha _ { 1 } + \alpha _ { 3 } } \sum _ { t = 0 } ^ { N - 1 } \mathbb { E } _ { s _ { t } } c _ { \pi } ( s _ { t } ) . } \end{array}$ .
+
+Remark 3 This remark is on the connection to previous results concerning the stability of stochastic systems. It should be noted that the stability conditions of Markov chains have been reported in (Shaikhet, 1997; Meyn & Tweedie, 2012), however, of which the validation requires the full knowledge of the model, i.e., the transition probability $P ( s ^ { \prime } | s , a )$ . On the contrary, our approach solely depends on data to analyze the stability of the closed-loop system, which further enables the model-free learning algorithms with stability guarantee. However, the validation of stability through a sample-based approach theoretically requires tremendous, if not infinite, amount of samples to thoroughly estimate the distributions, which is the drawback of our approach. We would demonstrate empirically that the algorithm built upon this theorem is reliable though only limited sample is collected.
+
+# 4 ALGORITHM
+
+In this section, we propose an off-policy RL algorithm to learn stability guaranteed policies for discrete-time nonlinear stochastic system modeled by MDP. First, based on the maximum entropy actor-critic framework, we use the Lyapunov function as the critic in the policy gradient formulation. In this algorithm, a Lyapunov critic function $L _ { c }$ is needed, which satisfies $\bar { L } ( \bar { s } ) = \mathbb { E } _ { a \sim \pi } L _ { c } ( s , a )$ . The objective function $J ( \pi )$ is given as follows
+
+$$
+J ( \pi ) = \mathbb { E } _ { ( s , a , s ^ { \prime } , c ) \sim \mathcal { D } } [ \beta ( \log ( \pi _ { \theta } ( f _ { \theta } ( \epsilon , s ) | s ) ) + \mathcal { H } _ { t } ) + \lambda ( L _ { c } ( s ^ { \prime } , f _ { \theta } ( \epsilon , s ^ { \prime } ) ) - L _ { c } ( s , a ) + \alpha _ { 3 } c ) ]
+$$
+
+where the policy $\pi _ { \theta }$ is parameterized by a deep neural network $f _ { \theta } , \epsilon$ is an input vector consisted of Gaussian noise. It should be noted that the Lyapunov critic $L _ { c } ( s , a )$ will be parameterized by the square of a neural network to ensure the semi-positive definiteness of Lyapunov function required in Eq.(1), inspired by the structure explored in Richards et al. (2018). More specifically, $\overset { \cdot } { L _ { c } ( s , a ) } = \phi ^ { \hat { T } } ( s , a ) \phi ( \overset { \cdot } { s } , a )$ , where $\phi ( s , a )$ is a multi-layer fully connected neural network. $\mathcal { D }$ is the distribution of previously sampled states and actions, or a replay buffer. In the above objective, $\beta$ and $\lambda$ are Lagrange multipliers which control the relative importance of policy entropy versus energy decreasing constraint derived from Eq.(2). Similar to Haarnoja et al. (2018), the entropy of policy is expected to remain above the target entropy $\mathcal { H } _ { t }$ . The parameters of policy network are updated through gradient descent, where the gradient of Eq.(3) is approximated by
+
+$$
+\nabla _ { \theta } J ( \pi ) = \nabla _ { \theta } \beta \log ( \pi _ { \theta } ( a | s ) ) + \nabla _ { a } \beta \log ( \pi _ { \theta } ( a | s ) ) \nabla _ { \theta } f _ { \theta } ( \epsilon , s ) + \lambda \nabla _ { a ^ { \prime } } L _ { c } ( s ^ { \prime } , a ^ { \prime } ) \nabla _ { \theta } f _ { \theta } ( \epsilon , s ^ { \prime } )
+$$
+
+We use $J ( L _ { c } )$ in the following equation as the objective function to update the Lyapunov critic,
+
+$$
+J ( L _ { c } ) = \mathbb { E } _ { \mathcal { D } } \left[ \frac { 1 } { 2 } ( L _ { c } ( s , a ) - L _ { \mathrm { t a r g e t } } ( s , a ) ) ^ { 2 } \right]
+$$
+
+where $L _ { \mathrm { t a r g e t } }$ is the approximation target for $L _ { c }$
+
+If the sum of cost is chosen as Lyapunov function candidate, we have
+
+$$
+L _ { \mathrm { t a r g e t } } ( s , a ) = \Sigma _ { t } ^ { t + N } c _ { t }
+$$
+
+Here, the time horizon $N$ is a hyperparameter to be tuned, of which the influence will be demonstrated in the experiment in Section 5.5. If the value function is chosen as Lyapunov function candidate,
+
+$$
+L _ { \mathrm { t a r g e t } } ( s , a ) = c + \gamma L _ { c } ^ { \prime } ( s ^ { \prime } , f ( \epsilon , s ^ { \prime } ) )
+$$
+
+where $L _ { c } ^ { \prime }$ is the target network parameterized by $\overline { { \theta } }$ as typically used in the actor-critic methods (Haarnoja et al., 2018; Lillicrap et al., 2015b). $L _ { c } ^ { \prime }$ has the same structure with $L _ { c }$ , but the parameter is updated through exponentially moving average of weights of $L _ { c }$ controlled by a hyperparameter $\tau$ . In fact, the value function is the discounted sum of cost over infinite time horizon. Later in Section 5, we will show the influence of choosing different Lyapunov function candidates.
+
+The value of Lagrange multipliers $\lambda$ and $\beta$ are adjusted by the gradient method maximizing the following two objectives respectively,
+
+$$
+\begin{array} { r l } & { J ( \beta ) = \mathbb { E } _ { \mathcal { D } } \beta \big [ \log ( \pi _ { \theta } ( a \vert s ) ) + \mathcal { H } _ { t } \big ] } \\ & { J ( \lambda ) = \mathbb { E } _ { \mathcal { D } } \lambda \big [ L _ { c } ( s ^ { \prime } , f _ { \theta } ( \epsilon , s ^ { \prime } ) ) - L _ { c } ( s , a ) + \alpha _ { 3 } c \big ] } \end{array}
+$$
+
+It should be noted that the value of $\lambda$ and $\beta$ are clipped to be positive. In addition, to prevent $\lambda$ from growing unlimitedly causing the algorithm to diverge, we set an upper bound for $\lambda$ . In our experiments, we found that 1 is a suitable value without much further tuning. Pseudo code of the proposed algorithm is shown in Algorithm 1 in Appendix B.
+
+Remark 4 The convergence of the algorithm is composed of the convergence of Lyapunov critic $L _ { c }$ and policy $\pi _ { \theta }$ respectively. Empirically, the convergence can be judged by the error of Lyapunov function approximation and value of the Lagrange multiplier (close to zero at convergence). In practice, we found that the algorithm converges well in different experiments without much tuning.
+
+# 5 EXPERIMENT
+
+In this section, we illustrate four simulated examples to demonstrate the general applicability of the proposed method. First of all, the classic control problem of CartPole balancing from control and RL literature (Barto et al., 1983) is illustrated. Then, we consider more complicated high-dimensional continuous control problem of 3D robots, e.g., HalfCheetah and FetchReach, using MuJoCo physics engine (Todorov et al., 2012). Last, we extend our approach to control robots in nanoscale, i.e., molecular robots. Specifically, we consider the problem of reference tracking for a synthetic biology gene regulatory network known as the Repressilator (Elowitz & Leibler, 2000).
+
+The proposed method is evaluated for the following aspects:
+
+• Convergence: does the proposed training algorithm converge with random parameter initialization and does the stability condition (2) hold for the learned policies; • Performance: can the goal of the task be achieved or the cumulative cost be minimized; • Robustness: how do the trained policies perform when faced with uncertainties unseen during training, such as parametric variation and external disturbances;
+
+• Generalization: can the trained policies generalize to follow reference signals that are different from the one seen during training.
+
+We compare our approach with soft actor-critic (SAC) (Haarnoja et al., 2018), one of the stateof-the-art off-policy actor-critic algorithms that outperform a series of off-policy and on-policy methods such as DDPG (Lillicrap et al., 2015a), PPO (Schulman et al., 2017) on the continuous control benchmarks. The variant of safe proximal policy optimization (SPPO) (Chow et al., 2019), a Lyapunov-based method, is also included in the comparison. The original SPPO is developed to deal with constrained MDP, where safety constraints exist. In our experiments, we modify it to apply the Lyapunov constraints on the MDP tasks and see whether it can achieve the same stability guarantee as LAC. In CartPole example, we also compare with linear quadratic regulator (LQR), a classical model-based optimal control method for stabilization.
+
+The outline of this section is as follows. In Section 5.1, a brief introduction will be given on the background and problem description of each example. Then in Section 5.2, the convergence, and performance of the proposed method is demonstrated and compared with SAC. In Section 5.4, the ability of generalization and robustness of the trained policies are evaluated and analyzed. Finally, in Section 5.5, we show the influence of choosing different Lyapunov function candidates upon the performance and robustness of trained policies.
+
+# 5.1 BACKGROUND AND PROBLEM DESCRIPTION
+
+In this section, we will give a brief introduction to the examples considered in this paper. Detailed setup information of the first three examples can be found in Appendix C.
+
+# 5.1.1 CARTPOLE
+
+This is a classical control problem. The controller is to stabilize the pole vertically at a given position. The cost is determined by the norm of the angular position of the pole and the horizontal position of the cart. The control input is the horizontal force $F \in [ - 2 0 , 2 0 ]$ applied in the cart. The agent is dead if the angle $\theta$ between pole and vertical position exceeds a threshold, and the episode ends.
+
+# 5.1.2 HALFCHEETAH
+
+The goal is to control a 17-dimensional 2-legged robot simulated in the MuJoCo simulator. The control task belongs to the reference tracking problem, i.e., to enable the robot to run at the speed of $1 \mathrm { m / s }$ in the $\mathbf { X }$ -axis direction. The cost is determined by the Euclidean difference between current speed and target speed. The control input is the torque implemented at each joint.
+
+# 5.1.3 FETCHREACH
+
+The agent is to control a simulated manipulator to track a randomly generated goal position with its end effector. The cost is determined by the Euclidean distance between end effector and goal. The control input is the torque implemented at each joint. The manipulator is also simulated in the MuJoCo simulator.
+
+# 5.1.4 REPRESSILATOR
+
+The repressilator is a synthetic biology gene regulatory network with a ring structure pioneered in Elowitz & Leibler (2000), in which each gene represses the other gene cyclically. The dynamics of temporal gene expression exhibit periodic oscillatory behavior. The dynamics of repressilator can be quantitatively described by a set of discrete-time nonlinear difference equations consisting of six states, three mRNAs for transcription and three proteins for translation, based on biochemical kinetic laws. We also include a complicated repressilator example with 4 genes to be controlled, which exhibits an unstable oscillation and is even harder to control.
+
+The objective is to force one protein concentrations to follow a priori defined reference trajectories using partially observed states. Detailed setup information of these examples are in Appendix D.
+
+# 5.1.5 MARKOVIAN JUMP SYSTEMS
+
+In addition to the systems described above, we introduce two Markovian jump systems (MJS), named MJS1 and MJS2, which contain both discrete switchings (or jumps) and continuous dynamics (Shi &
+
+Li, 2015), as test beds for the proposed and baseline methods. The objective is to force the full state to zero. Both MJSs contain unstable subsystems and the dynamics change abruptly and randomly according to the switching signal, and thus are difficult to tackle for the model-free algorithms. Moreover, MJS2 contains an unstable subsystem that is not controllable, which makes it even harder to stabilize. More details on the examples could be found in Appendix E.
+
+# 5.2 PERFORMANCE
+
+We parameterize the policy and Lyapunov critic using deep neural networks. For each example,the hyperparameters including time horizon $N$ and DNN architectures selected to construct Lyapunov functions and DNN training parameters can be found in Appendix J. For both algorithms, the hyperparameters are tuned to reach their best performance. In each task, both LAC and SAC are trained for 10 times with random initialization, average total cost and its variance during training are demonstrated in Figure 1.
+
+In the first three examples (see Figure 1(a)-(c)), SAC and LAC perform comparably in terms of the total cost at convergence and speed of convergence, while SPPO could converge in Cartpole and FetcheReach. In the Repressilator and MJS examples (see Figure 1(d,e,f)), SAC is not always able to find a policy that is capable of completing control objective, resulting in the bad average performance. On the contrary, LAC performs stably regardless of the random initialization.
+
+
+Figure 1: Cumulative control performance comparison. The Y-axis indicates the total cost during one episode and the $\mathbf { X }$ -axis indicates the total time steps in thousand. The shadowed region shows the 1-SD confidence interval over 10 random seeds. Across all trials of training, LAC converges to stabilizing solution with comparable or superior performance compared with SAC and SPPO. The experiment on Complicated-Repressilator is deferred to Appendix F.
+
+A distinguishing feature of stability assured policy is that it can force and sustain the state or tracking error to zero. This could be intuitively demonstrated by the state trajectories of closed-loop system. We evaluated this property of trained policies in the Repressilator, Complicated-Repressilator and two MJS examples. In our experiments, we found that the LAC agents stabilize the systems well in all tasks. All the state trajectories converge to the reference signal or equilibrium eventually (see Figure 11 (a,c) and Figure 12 (a,c)). On the contrary, without stability guarantee, the state trajectories either diverge (see Figure 11 b and Figure 12 d), or continuously oscillate around the reference trajectory or equilibrium (see Figure 11 d and Figure 12 b). Empirical results are deferred to Appendix F due to space limit.
+
+# 5.3 CONVERGENCE
+
+As shown in Figure 1, LAC converges stably in all experiments. Moreover, the convergence and validation of stability guarantee could also be checked by observing the value of Lagrange multipliers. When (2) is satisfied, $\lambda$ will continuously decrease until it becomes zero. Thus by checking the value and variation of $\lambda$ , the satisfaction of stability condition during training and at convergence could be validated. In Figure 2, the value of $\lambda$ during training is demonstrated. Across all training trials in the experiments, $\lambda$ converges to zero eventually, which implies that the stability guarantee is valid. A detailed discussion on this is referred to Appendix G.
+
+
+Figure 2: Value of Lagrange multiplier $\lambda$ during the training of LAC policies. The Y-axis indicates the value of $\lambda$ and the X-axis indicates the total time steps in thousand. The shadowed region shows the 1-SD confidence interval over 10 random seeds. The value of $\lambda$ gradually drops and becomes zero at convergence, which implies the satisfaction of stability condition.
+
+# 5.4 EVALUATION ON ROBUSTNESS AND GENERALIZATION
+
+It is well-known that over-parameterized policies are prone to become overfitted to a specific training environment. The ability of generalization is the key to the successful implementation of the algorithm in an uncertain real-world environment. In this part, we first evaluate the robustness of policies in the presence of system parametric uncertainties and process noise. Then, we test the robustness of controllers against external disturbances. Finally, we evaluate whether the policy is generalizable by setting different reference signals. To make a fair comparison, we removed the policies that did not converge in SAC and only evaluate the ones that perform well during training. During testing, we found that SPPO appears to be prone to variation in the environment, thus the evaluation results are referred to Appendix H.
+
+# 5.4.1 ROBUSTNESS TO DYNAMIC UNCERTAINTY
+
+In this part, during the inference, we vary the system parameters in the model/simulator to evaluate the algorithm’s robustness against dynamic uncertainty. In the example of CartPole, we vary the length of pole $l$ . In the example of repressilator, we vary the promoter strength $a _ { i }$ and dissociation rate $K _ { i }$ . Due to stochastic nature in gene expression, we also introduce uniformly distributed noise ranging from $[ - \delta , \delta ]$ (we indicate the noise level by $\delta$ ) to the dynamic of repressilator. The stabilization performance of CartPole and tracking performance of Repressilator by LAC and SAC in the varied environment is demonstrated in Figure 3.
+
+
+Figure 3: State trajectories over time under policies trained by LAC and SAC and tested in the presence of parametric uncertainties and process noise, for CartPole and Repressilator. Solid line indicates the average trajectory and shadowed region for the 1-SD confidence interval. In (a) and (b), the pole length is varied during the inference. In (c) and (d), three parameters are selected to reflect the uncertainties in gene expression. The X-axis indicates the time and Y-axis shows the angle of pole in (a,b) and concentration of protein to be controlled in (c,d), respectively. Dashed line indicates the reference signal. The line in orange indicates the dynamic in original environment. For each curve, only the noted parameter is different with the original setting. We also show the curves in separate zoom-in view in Appendix I.1.
+
+As shown in Figure 3(a) and (c), the policies trained by LAC are very robust to parametric uncertainties of different values and achieve high tracking precision in each case. On the other hand, though SAC performs well in the original environment (Figure 3(b) and (d)), it fails to track the reference signal in all of the varied environment.
+
+# 5.4.2 ROBUSTNESS TO DISTURBANCES
+
+An inherent property of a controller for stabilization is to enable the system to recover to the normal status from perturbations such as external forces and wind. To show this, we introduce persistent external disturbances with different magnitudes in each environment and observe the performance difference between policies trained by LAC and SAC. We also include LQR as the model-based baseline. In CartPole, the agent may fall over when interfered by an external force, ending the episode in advance. Thus in this task, we measure the robustness of controller through the death-rate, i.e., the probability of falling over after being disturbed. For other tasks where the episodes are always of the same length, we measure the robustness of controller by the variation in total cost. Under each disturbance magnitude, the policies are tested for 100 trials and the performance are shown in Figure 4.
+
+
+Figure 4: Performance of policies trained by LAC, SAC and SPPO, along with controllers designed by LQR in the presence of persistent disturbances with different magnitudes. $\mathbf { X } \cdot$ -axis indicates the magnitude of the applied disturbance. For CartPole (a) the Y-axis indicates the probability of falling over and in other three examples (b)-(d) it indicates the total cost. Both policies are evaluated for 100 trials in each setting.
+
+As shown in the Figure 4, the controller trained by LAC outperforms SAC and LQR by great extent when faced with external disturbances in CartPole and repressilator (lower death rate and total cost). In the repressilator example, the policies trained by SAC are extremely vulnerable to disturbances, this is potentially due to the existence of an unstable limit cycle in the uncontrolled dynamic (Strelkowa & Barahona, 2010). In HalfCheetah, SAC and LAC are both robust to small external disturbances while LAC is more reliable to larger ones. In FetchReach, SAC and LAC are comparable with maintaining a low cost in a great range of external disturbances. This is perhaps due to the manipulator’s inherent robust mechanical design.
+
+# 5.4.3 GENERALIZATION OVER DIFFERENT TRACKING REFERENCES
+
+In this part, we introduce four different reference signals that are unseen during training in the repressilator example: sinusoids with periods of 150 (brown) and 400 (blue), and the constant reference of 8 (red) and 16 (green). We also show the original reference signal used for training (skyblue) as a benchmark. Reference signals are indicated in Figure 5 by the dashed line in respective colors. Both trained policies are evaluated to track each reference signal for 10 times, and the average dynamics of the target protein concentration are shown in Figure 5 with the solid line, while the variance of dynamic is indicated by the shadowed area.
+
+As shown in Figure 5, the policies trained by LAC could generalize well to follow previously unseen reference signals with low deviation (dynamics are very close to the dashed lines), regardless of whether they are in the same mathematical form with the one used for training or not. On the other hand, though SAC tracks the original reference signal well after the unconverged training trials being removed (see the skyblue lines), it is still unable to follow some of the reference signals (see the brown line) and possesses larger variance than LAC when following others.
+
+# 5.5 INFLUENCE OF DIFFERENT LYAPUNOV FUNCTION CANDIDATES AND STRUCTURES
+
+In this part, we evaluate the influence of choosing different Lyapunov function candidates and network structures. First, we adopt candidates of different time horizon $N \in \{ 5 , 1 0 , 1 5 , 2 0 , \infty \}$ to train policies in the CartPole example, and compare their performance in terms of total cost and robustness. Both of the Lyapunov critics are parameterized by $\begin{array} { r } { L ( s ) = \phi ( s ) ^ { T } \phi ( s ) } \end{array}$ where $\phi ( s )$ is a neural network with $m$ dimensional output. Here, $N = \infty$ implies using value function as Lyapunov candidate. For evaluation of robustness, we apply an impulsive force $F$ at $1 0 0 _ { \mathrm { t h } }$ instant and observe the death-rate of trained policies. The results are demonstrated in Figure 6 (a,b). Then we fix the horizon of candidates to be $N = 5$ but vary the structures of Lyapunov critic, and compare their perfare: $\begin{array} { r } { L ( s ) = \sum _ { j = 1 } ^ { m ^ { - } } \phi _ { j } ^ { 4 } ( s ) } \end{array}$ me metric as de(LAC-biquad); $\begin{array} { r } { L ( s ) = \sum _ { j = 1 } ^ { m } \left| \phi ( s ) \right| } \end{array}$ specifically, (LAC-abs); $\begin{array} { r } { L ( s ) = \phi ( s ) ^ { T } \phi ( s ) } \end{array}$ ctures(LACquad).
+
+
+Figure 5: State trajectories under policies trained by LAC and SAC when tracking different reference signals. Solid line indicates the average trajectory and shadowed region for the 1-SD confidence interval. The $\mathrm { X }$ -axis indicates the time and Y-axis shows the concentration of protein to be controlled. Dashed lines in different colors are the different reference signals: sinusoid with period of 150 (brown); sinusoid with period of 200 (skyblue);sinusoid with period of 400 (blue); constant reference of 8 (red); constant reference of 16 (green). We also show the curves in separate zoom-in view in Appendix I.2 .
+
+
+Figure 6: Influence of different Lyapunov function candidates and network structures. In (a) and (c), the Y-axis indicates total cost of policies during training by LAC with Lyapunov function candidates of different length of horizon $N$ and structures, and the $\mathbf { X }$ -axis indicates the total time steps in thousand. (b) and (d) shows the death-rate of policies in the presence of instant impulsive force $F$ ranging from 80 to 150 Newton.
+
+As shown in Figure 6, in the CartPole environment, both choices of Lyapunov candidates converge fast and achieve comparable total cost at convergence. However, in terms of robustness, the different choices of $N$ play an important role. As observed in Figure 6 (b), the robustness of controller decreases as the time horizon $N$ increases. On the other hand, LAC with different structures converge well and possesses similar robustness to impulsive forces. This further proves that our framework allows for a general class of Lyapunov functions, as long as the function is semi-positive definite. Besides, it is interesting to observe that LQR is more robust than SAC when faced with instant impulsive disturbance.
+
+# 6 CONCLUSIONS
+
+In this paper, we proposed a model-free approach for analyzing the stability of discrete-time nonlinear stochastic systems modeled by Markov decision process, by employing the Lyapunov function from control theory. Based on the theoretical result, a practical algorithm for designing stability assured controllers for the stabilization and tracking problems. We evaluated the proposed method in various examples and show that our method achieves not only comparable or superior performance compared with the state-of-the-art RL algorithm but also outperforms impressively in terms of robustness to uncertainties and disturbances.
+
+# REFERENCES
+
+Karl J Astr ˚ om and Bj ¨ orn Wittenmark. ¨ Adaptive control. Courier Corporation, 1989.
+
+Andrew G Barto, Richard S Sutton, and Charles W Anderson. Neuronlike adaptive elements that can solve difficult learning control problems. IEEE transactions on systems, man, and cybernetics, (5): 834–846, 1983.
+
+Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V Le. Neural optimizer search with reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 459–468. JMLR. org, 2017.
+
+Yoshua Bengio, Nicolas Boulanger-Lewandowski, and Razvan Pascanu. Advances in optimizing recurrent networks. In 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 8624–8628. IEEE, 2013.
+
+Felix Berkenkamp, Matteo Turchetta, Angela Schoellig, and Andreas Krause. Safe model-based reinforcement learning with stability guarantees. In Advances in neural information processing systems, pp. 908–918, 2017.
+
+Dimitri P Bertsekas and John N Tsitsiklis. Neuro-dynamic programming, volume 5. Athena Scientific Belmont, MA, 1996.
+
+EK Boukas and ZK Liu. Robust stability and h/sub/spl infin//control of discrete-time jump linear systems with time-delay: an lmi approach. In Decision and Control, 2000. Proceedings of the 39th IEEE Conference on, volume 2, pp. 1527–1532. IEEE, 2000.
+
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
+
+Lucian Bus¸oniu, Tim de Bruin, Domagoj Tolic, Jens Kober, and Ivana Palunko. Reinforcement ´ learning for control: Performance, stability, and deep approximators. Annual Reviews in Control, 2018.
+
+Yinlam Chow, Ofir Nachum, Edgar Duenez-Guzman, and Mohammad Ghavamzadeh. A lyapunovbased approach to safe reinforcement learning. arXiv preprint arXiv:1805.07708, 2018.
+
+Yinlam Chow, Ofir Nachum, Aleksandra Faust, Mohammad Ghavamzadeh, and Edgar DuenezGuzman. Lyapunov-based safe policy optimization for continuous control. arXiv preprint arXiv:1901.10031, 2019.
+
+Martin Corless and George Leitmann. Continuous state feedback guaranteeing uniform ultimate boundedness for uncertain dynamic systems. IEEE Transactions on Automatic Control, 26(5): 1139–1144, 1981.
+
+Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pp. 1329–1338, 2016.
+
+Michael B Elowitz and Stanislas Leibler. A synthetic oscillatory network of transcriptional regulators. Nature, 403(6767):335, 2000.
+
+Daniel Gorges. Relations between model predictive control and reinforcement learning. IFACPapersOnLine, 50(1):4920–4928, 2017.
+
+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.
+
+Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018.
+
+Chengming Huang. Exponential mean square stability of numerical methods for systems of stochastic differential equations. Journal of Computational and Applied Mathematics, 236(16):4016–4026, 2012.
+
+Jun Huang, Zhengzhi Han, Xiushan Cai, and Leipo Liu. Uniformly ultimately bounded tracking control of linear differential inclusions with stochastic disturbance. Mathematics and Computers in Simulation, 81(12):2662–2672, 2011.
+
+Alberto Isidori. Nonlinear control systems. Springer Science & Business Media, 1995.
+
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
+
+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, 2015a.
+
+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, 2015b.
+
+Aleksandr Mikhailovich Lyapunov. The general problem of the stability of motion (in Russian). PhD Dissertation, Univ. Kharkov, 1892.
+
+David Q Mayne and Hannah Michalska. Receding horizon control of nonlinear systems. IEEE Transactions on automatic control, 35(7):814–824, 1990.
+
+David Q Mayne, James B Rawlings, Christopher V Rao, and Pierre OM Scokaert. Constrained model predictive control: Stability and optimality. Automatica, 36(6):789–814, 2000.
+
+Sean P Meyn and Richard L Tweedie. Markov chains and stochastic stability. Springer Science & Business Media, 2012.
+
+Navid Noroozi, Paknoosh Karimaghaee, Fatemeh Safaei, and Hamed Javadi. Generation of lyapunov functions by neural networks. In Proceedings of the World Congress on Engineering, volume 2008, 2008.
+
+Athanasios Papoulis and S Unnikrishna Pillai. Probability, random variables, and stochastic processes. Tata McGraw-Hill Education, 2002.
+
+Theodore J Perkins and Andrew G Barto. Lyapunov design for safe reinforcement learning. Journal of Machine Learning Research, 3(Dec):803–832, 2002.
+
+Vassilios Petridis and Stavros Petridis. Construction of neural network based lyapunov functions. In The 2006 IEEE International Joint Conference on Neural Network Proceedings, pp. 5059–5065. IEEE, 2006.
+
+Romain Postoyan, Lucian Bus¸oniu, Dragan Nesiˇ c, and Jamal Daafouz. Stability analysis of discrete- ´ time infinite-horizon optimal control with discounted cost. IEEE Transactions on Automatic Control, 62(6):2736–2749, 2017.
+
+Danil V Prokhorov. A lyapunov machine for stability analysis of nonlinear systems. In Proceedings of 1994 IEEE International Conference on Neural Networks (ICNN’94), volume 2, pp. 1028–1031. IEEE, 1994.
+
+Danil V Prokhorov and Lee A Feldkamp. Application of svm to lyapunov function approximation. In IJCNN’99. International Joint Conference on Neural Networks. Proceedings (Cat. No. 99CH36339), volume 1, pp. 383–387. IEEE, 1999.
+
+Spencer M Richards, Felix Berkenkamp, and Andreas Krause. The lyapunov neural network: Adaptive stability certification for safe learning of dynamical systems. In Conference on Robot Learning, pp. 466–476, 2018.
+
+Halsey Lawrence Royden. Real analysis. Krishna Prakashan Media, 1968.
+
+John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+
+Gursel Serpen. Empirical approximation for lyapunov functions with artificial neural nets. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pp. 735–740. IEEE, 2005.
+
+L Shaikhet. Necessary and sufficient conditions of asymptotic mean square stability for stochastic linear difference equations. Applied Mathematics Letters, 10(3):111–115, 1997.
+
+Peng Shi and Fanbiao Li. A survey on markovian jump systems: modeling and design. International Journal of Control, Automation and Systems, 13(1):1–16, 2015.
+
+Jean-Jacques E Slotine, Weiping Li, et al. Applied nonlinear control, volume 199. Prentice hall Englewood Cliffs, NJ, 1991.
+
+Aivar Sootla, Natalja Strelkowa, Damien Ernst, Mauricio Barahona, and Guy-Bart Stan. On periodic reference tracking using batch-mode reinforcement learning with application to gene regulatory network control. In 52nd IEEE conference on decision and control, pp. 4086–4091. IEEE, 2013.
+
+Natalja Strelkowa and Mauricio Barahona. Switchable genetic oscillator operating in quasi-stable mode. Journal of The Royal Society Interface, 7(48):1071–1082, 2010.
+
+Richard S Sutton, Andrew G Barto, and Ronald J Williams. Reinforcement learning is direct adaptive optimal control. IEEE Control Systems Magazine, 12(2):19–22, 1992.
+
+Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3): 58–68, 1995.
+
+Arild Thowsen. Uniform ultimate boundedness of the solutions of uncertain dynamic delay systems with state-dependent and memoryless feedback control. International Journal of control, 37(5): 1135–1143, 1983.
+
+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.
+
+Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Van Hasselt, Marc Lanctot, and Nando De Freitas. Dueling network architectures for deep reinforcement learning. arXiv preprint arXiv:1511.06581, 2015.
+
+Tianhao Zhang, Gregory Kahn, Sergey Levine, and Pieter Abbeel. Learning deep control policies for autonomous aerial vehicles with mpc-guided policy search. In 2016 IEEE international conference on robotics and automation (ICRA), pp. 528–535. IEEE, 2016.
+
+Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In 2017 IEEE international conference on robotics and automation (ICRA), pp. 3357–3364. IEEE, 2017.
+
+# Appendix
+
+# A PROOF OF THEOREM 1
+
+The existence of sampling distribution $\mu _ { \pi } ( s )$ is guaranteed by the existence of $q _ { \pi } ( s )$ (Assumption 1). Since the sequence Abelian theorem, the $\{ P ( s | \rho , \pi , t ) , t \in \mathbb { Z } _ { + } \}$ $q _ { \pi } ( s )$ as also $t$ approaches onverges an $\infty$ $\begin{array} { r } { \{ \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s | \rho , \pi , t ) , N \in \mathbb { Z } _ { + } \} } \end{array}$ $\mu _ { \pi } ( s ) = q _ { \pi } ( s )$ Combined with the form of $\mu _ { \pi }$ , Eq.(2) infers that
+
+$$
+\int _ { S } \operatorname* { l i m } _ { N \infty } \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s | \rho , \pi , t ) ( \mathbb { E } _ { P _ { \pi } ( s ^ { \prime } | s ) } L ( s ^ { \prime } ) - L ( s ) ) \mathrm { d } s \leq - \alpha _ { 3 } \mathbb { E } _ { s \sim q _ { \pi } c _ { \pi } } ( s )
+$$
+
+First, on the left hand-side, according to Eq.(1), $L ( s ) \leq \alpha _ { 2 } c _ { \pi } ( s )$ for all $s \in S$ and consider that $P ( s | \rho , \pi , t ) \le 1$ ,
+
+$$
+P ( s | \rho , \pi , t ) L ( s ) \leq \alpha _ { 2 } c _ { \pi } \left( s \right) , \forall s \in \mathcal { S } , \forall t \in \mathbb { Z } _ { + }
+$$
+
+On the ofunction the sequence . According to $\begin{array} { r } { \{ \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s | \rho , \pi , t ) L ( s ) , N \in \mathbb { Z } _ { + } \} } \end{array}$ converges pointwise to thee theorem(Royden, 1968), if $q _ { \pi } ( s ) L ( s )$
+a sequence $f _ { n } ( s )$ converges pointwise to a function $f$ and is dominated by some integrable function
+$g$ in the sense that,
+
+$$
+| f _ { n } ( s ) | \leq g ( s ) , \forall s \in S , \forall n
+$$
+
+Then
+
+$$
+\operatorname* { l i m } _ { n \to \infty } \int _ { S } f _ { n } ( s ) \mathrm { d } s = \int _ { S } \operatorname* { l i m } _ { n \to \infty } f _ { n } ( s ) \mathrm { d } s
+$$
+
+Thus the left hand side of Eq.(A.1)
+
+$$
+\begin{array} { r l } & { \displaystyle \int _ { S } \displaystyle \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \sum _ { t = 0 } ^ { N } P ( s | \rho , \pi , t ) ( \displaystyle \int _ { S } P _ { \pi } ( s ^ { \prime } | s ) L ( s ^ { \prime } ) \mathrm { d } s ^ { \prime } - L ( s ) ) \mathrm { d } s } \\ & { = \displaystyle \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } ( \sum _ { t = 1 } ^ { N + 1 } \mathbb { E } _ { P ( s | \rho , \pi , t ) } L ( s ) - \sum _ { t = 0 } ^ { N } \mathbb { E } _ { P ( s | \rho , \pi , t ) } L ( s ) ) } \\ & { = \displaystyle \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \left( \mathbb { E } _ { P ( s | \rho , \pi , N + 1 ) } L ( s ) - \mathbb { E } _ { \rho ( s ) } L ( s ) \right) } \end{array}
+$$
+
+Thus taking the relations above into consideration, Eq.(A.1) infers
+
+$$
+\operatorname* { l i m } _ { N \infty } \frac { 1 } { N } ( \mathbb { E } _ { P ( s | \rho , \pi , N + 1 ) } L ( s ) - \mathbb { E } _ { \rho ( s ) } L ( s ) ) \leq - \alpha _ { 3 } \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { P ( s | \rho , \pi , t ) } c _ { \pi } ( s )
+$$
+
+Since $\mathbb { E } _ { \rho ( s ) } L ( s )$ is a finite value and $L$ is semi-positive definite, it follows that
+
+$$
+\operatorname* { l i m } _ { t \infty } \mathbb { E } _ { P ( s | \rho , \pi , t ) } c _ { \pi } ( s ) \leq \operatorname* { l i m } _ { N \infty } \frac { 1 } { N } ( \frac { 1 } { \alpha _ { 3 } } \mathbb { E } _ { \rho ( s ) } L ( s ) ) = 0
+$$
+
+Suppose that there exists a state $s _ { 0 } \in \{ s _ { 0 } | c _ { \pi } ( s _ { 0 } ) \leq b \}$ such $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { P ( s | s _ { 0 } , \pi , t ) } c _ { \pi } ( s ) = c . } \end{array}$ , $c > 0$ or $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { P ( s | s _ { 0 } , \pi , t ) } c _ { \pi } ( s ) = \infty } \end{array}$ . Consider that $\rho ( s _ { 0 } ) > 0$ for all starting states in $\{ s _ { 0 } | c _ { \pi } ( s _ { 0 } ) \leq b \}$ (Assumption 2), then $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { s _ { t } \sim P ( \cdot | \pi , \rho ) } c _ { \pi } ( s _ { t } ) > 0 } \end{array}$ , which is contradictory with Eq.(A.3). Thus $\forall s _ { 0 } \in \{ s _ { 0 } | c _ { \pi } ( s _ { 0 } ) \leq b \}$ , $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \mathbb { E } _ { P ( s | s _ { 0 } , \pi , t ) } c _ { \pi } ( s ) = 0 } \end{array}$ . Thus the system is stable in mean cost by Definition 1.
+
+# B PSEUDO CODE OF ALGORITHM
+
+# Algorithm 1 Lyapunov-based Actor-Critic (LAC)
+
+
Initialize replay buffer D and Lagrange multiplier 入, β; Randomly initialize Lyapunov critic network Lc(s,a),actor π(a|s) with parameters ΦL., 0; Initialize the parameters of target network with θ ←0; for each iteration do
Sample so according to p; for each time step do
Sample at from π(s) and step forward;
Observe St+1, Ct and store (st,at,Ct, St+1) in D; end for
for each update step do
Sample minibatches of transitions from D and update Lc,π,Lagrange multipliers with gradients;
Update the target networks:
θ←τθ+(1-τ)θ
end for
end for
+
+# C FURTHER EXPERIMENT SETUP
+
+We setup the experiment using OpenAi Gym (Brockman et al., 2016). A snapshot of environments can be found in Figure 7.
+
+
+Figure 7: Snapshot of environments using OpenAI Gym.
+
+# C.1 CARTPOLE
+
+In this experiment, the controller is to sustain the pole vertically at a target position $x = 0$ . This is modified version of CartPole in Brockman et al. (2016) with continuous action space. The action is the horizontal force applied on the cart $( a \in [ - 2 0 , 2 0 ] )$ ). $x _ { \mathrm { { t h r e s h o l d } } }$ and $\theta _ { \mathrm { t h r e s h o l d } }$ represents the maximum of position and angle, respectively, $x _ { \mathrm { t h r e s h o l d } } = 1 0$ and $\theta _ { \mathrm { t h r e s h o l d } } = 2 0 ^ { \circ }$ . The controller dies if $| x | > x _ { \mathrm { t h r e s h o l d } }$ or $| \theta | > \theta _ { \mathrm { t h r e s h o l d } }$ and the episodes end in advance. Cost function $r =$ $\begin{array} { r } { ( \frac { x } { x _ { \mathrm { t h r e s h o l d } } } ) ^ { 2 } + 2 0 * ( \frac { \theta } { \theta _ { \mathrm { t h r e s h o l d } } } ) ^ { 2 } } \end{array}$ . The episodes are of length 250. For robustness evaluation in Section 5.4, we apply an impulsive disturbance force $F$ on the cart every 20 seconds, of which the magnitude ranges from 80 to 150 and the direction is opposite to the direction of control input. In Section 5.5, the impulsive disturbance has the same magnitude range and direction with that in Section 5.4, but only applied once at instant $t = 1 0 0$ .
+
+# C.2 HALFCHEETAH
+
+HalfCheetah is a modified version of that in Gym’s robotics environment (Brockman et al., 2016). The task is to control a HalfCheetah (a 2-legged simulated robot) to run at the speed of $. m / s$ . The reward is $r = ( v - 1 ) ^ { 2 }$ where $v$ is the forward speed of the HalfCheetah. The control input is the torque applied on each joint, ranging from -1 to 1. The episodes are of length 200.
+
+For robustness evaluation in Section 5.4, we apply an impulsive disturbance torque on each joint every 20 seconds, of which the magnitude ranges from 0.2 to 2.0 and the direction is opposite to the direction of control input.
+
+# C.3 FETCHREACH-V1
+
+We modify the FetchReach in Gym’s robotics environment (Brockman et al., 2016) to a cost version, where the controller is expected to control manipulator’s end effector to reach a random goal position. The cost is designed as $c = d$ , where $d$ is the distance between goal and end-effector. The control input is the torque applied on each joint, ranging from -1 to 1. The episodes are of length 200.
+
+For robustness evaluation in Section 5.4, we apply an impulsive disturbance torque on each joint every 20 seconds, of which the magnitude ranges from 0.2 to 2.0 and the direction is opposite to the direction of control input.
+
+# D SYNTHETIC BIOLOGY GENE REGULATORY NETWORKS
+
+Since this system considered here is in nano-scale whose physical property is different from the ones considered in Section C and the system exhibit interesting oscillatory behavior, we illustrate this example separately in this section.
+
+# D.1 MATHEMATICAL MODEL OF REPRESSILATOR
+
+In this example, we consider a classical dynamical system in systems/synthetic biology, the repressilator, which we use to illustrate the reference tracking problem at hand. The repressilator is a synthetic three-gene regulatory network where the dynamics of mRNAs and proteins follow an oscillatory behavior (Elowitz & Leibler, 2000). A discrete-time mathematical description of the repressilator, which includes both transcription and translation dynamics, is given by the following set of discrete-time equations:
+
+$$
+\begin{array} { r l } & { x _ { 1 } ( t + 1 ) = x _ { 1 } ( t ) + d t \cdot \bigg [ - \gamma _ { 1 } x _ { 1 } ( t ) + \frac { a _ { 1 } } { K _ { 1 } + x _ { 6 } ^ { 2 } ( t ) } + u _ { 1 } ( t ) \bigg ] + \xi _ { 1 } ( t ) , } \\ & { x _ { 2 } ( t + 1 ) = x _ { 2 } ( t ) + d t \cdot \bigg [ - \gamma _ { 2 } x _ { 2 } ( t ) + \frac { a _ { 2 } } { K _ { 2 } + x _ { 4 } ^ { 2 } ( t ) } + u _ { 2 } ( t ) \bigg ] + \xi _ { 2 } ( t ) , } \\ & { x _ { 3 } ( t + 1 ) = x _ { 3 } ( t ) + d t \cdot \bigg [ - \gamma _ { 3 } x _ { 3 } ( t ) + \frac { a _ { 3 } } { K _ { 3 } + x _ { 5 } ^ { 2 } ( t ) } + u _ { 3 } ( t ) \bigg ] + \xi _ { 3 } ( t ) , } \\ & { x _ { 4 } ( t + 1 ) = x _ { 4 } ( t ) + d t \cdot \big [ - c _ { 1 } x _ { 4 } ( t ) + \beta _ { 1 } x _ { 1 } ( t ) \big ] + \xi _ { 4 } ( t ) , } \\ & { x _ { 5 } ( t + 1 ) = x _ { 5 } ( t ) + d t \cdot \big [ - c _ { 2 } x _ { 5 } ( k ) + \beta _ { 2 } x _ { 2 } ( t ) \big ] + \xi _ { 5 } ( t ) , } \\ & { x _ { 6 } ( t + 1 ) = x _ { 6 } ( t ) + d t \cdot \big [ - c _ { 3 } x _ { 6 } ( t ) + \beta _ { 3 } x _ { 3 } ( t ) \big ] + \xi _ { 6 } ( t ) . } \end{array}
+$$
+
+Here, $x _ { 1 } , x _ { 2 } , x _ { 3 }$ (resp. $x _ { 4 } , x _ { 5 } , x _ { 6 } )$ denote the concentrations of the mRNA transcripts (resp. proteins) of genes 1, 2, and 3, respectively. $\xi _ { i } , \forall i$ are i.i.d. uniform noise ranging from $[ - \delta , \delta ]$ , i.e., $\xi _ { i } \sim$ $\mathcal { U } ( - \delta , \delta )$ . During training, $\delta = 0$ and for evaluation $\delta$ is set to 0.5 and 1 respectively in Section 5.4. $a _ { 1 } , a _ { 2 } , a _ { 3 }$ denote the maximum promoter strength for their corresponding gene, $\gamma _ { 1 } , \gamma _ { 2 } , \gamma _ { 3 }$ denote the mRNA degradation rates, $c _ { 1 } , c _ { 2 } , c _ { 3 }$ denote the protein degradation rates, $\beta _ { 1 } , \beta _ { 2 } , \beta _ { 3 }$ denote the protein production rates, and $K _ { 1 } , K _ { 2 } , K _ { 3 }$ are the dissociation constants. The set of equations in Eq.(D.1) corresponds to a topology where gene 1 is repressed by gene 2, gene 2 is repressed by gene 3, and gene 3 is repressed by gene 1. dt is the discretization time step.
+
+In practice, only the protein concentrations are observed and given as readouts,for instance via fluorescent markers (e.g., green fluorescent protein, GFP or red fluorescent protein, mCherry). The control scheme $u _ { i }$ will be implemented by light control signals which can induce the expression of genes through the activation of their photo-sensitive promoters. To simplify the system dynamics and as it is usually done for the repressilator model (Elowitz & Leibler, 2000), we consider the corresponding parameters of the mRNA and protein dynamics for different genes to be equal. More background on mathematical modeling and control of synthetic biology gene regulatory networks can be referred to Strelkowa & Barahona (2010); Sootla et al. (2013). In this example, the parameters are as follows:
+
+$$
+\forall i : \ K _ { i } = 1 , a _ { i } = 1 . 6 , \gamma _ { i } = 0 . 1 6 , \beta _ { i } = 0 . 1 6 , c _ { i } = 0 . 0 6 , d t = 1
+$$
+
+In Fig8, a single snapshot of the state temporal evolution without $\xi$ is depicted. We uniformly initialized between 0 to 5, i.e., $x _ { i } ( 0 ) \sim \mathcal { U } ( 0 , 5 )$ , which is the range we train the policy in Section 5, persistent oscillatory behavior are also exhibiting similar to the snapshot in $\mathrm { F i g } 8$ .
+
+
+Figure 8: A snapshot of natural oscillatory behaviour of a repressilator system consisting of 3 genes. The oscillations have a period of approximately 150 arbitrary time units. The X-axis denotes time and Y-axis denotes value/concentration of each state.
+
+# D.2 COMPLICATED REPRESSILATOR
+
+To further evaluate the performance of different algorithms, we additionally include a more complicated gene regulatory network, which is composed of 4 genes instead of 3. Such a network with 4 genes would posses an unstable oscillatory behaviour, as shown in Figure 9, making it even harder to stabilize. The discrete-time mathematical description of the complicated repressilator is given by the following set of discrete-time equations:
+
+$$
+\begin{array} { r l } & { x _ { 1 } ( t + 1 ) = x _ { 1 } ( t ) + d t \cdot \left[ - \gamma _ { 1 } x _ { 1 } ( t ) + \frac { \alpha _ { 1 } } { K _ { 1 } + x _ { 2 } ^ { 2 } ( t ) } + u _ { 1 } ( t ) \right] + \xi _ { 1 } ( t ) , } \\ & { x _ { 2 } ( t + 1 ) = x _ { 2 } ( t ) + d t \cdot \left[ - \gamma _ { 2 } x _ { 2 } ( t ) + \frac { \alpha _ { 2 } } { K _ { 2 } + x _ { 3 } ^ { 2 } ( t ) } + u _ { 2 } ( t ) \right] + \xi _ { 2 } ( t ) , } \\ & { x _ { 3 } ( t + 1 ) = x _ { 3 } ( t ) + d t \cdot \left[ - \gamma _ { 3 } x _ { 3 } ( t ) + \frac { \alpha _ { 3 } } { K _ { 3 } + x _ { 4 } ^ { 2 } ( t ) } + u _ { 3 } ( t ) \right] + \xi _ { 3 } ( t ) , } \\ & { x _ { 4 } ( t + 1 ) = x _ { 4 } ( t ) + d t \cdot \left[ - \gamma _ { 4 } x _ { 4 } ( t ) + \frac { \alpha _ { 4 } } { K _ { 4 } + x _ { 2 } ^ { 2 } ( t ) } + u _ { 4 } ( t ) \right] + \xi _ { 4 } ( t ) , } \\ & { x _ { 5 } ( t + 1 ) = x _ { 5 } ( t ) + d t \cdot \left[ - \gamma _ { 4 } x _ { 5 } ( t ) + \beta _ { 1 } x _ { 1 } ( t ) \right] + \xi _ { 5 } ( t ) , } \\ & { x _ { 6 } ( t + 1 ) = x _ { 6 } ( t ) + d t \cdot \left[ - \sigma _ { 2 } x _ { 6 } ( t ) + \beta _ { 2 } x _ { 2 } ( t ) \right] + \xi _ { 6 } ( t ) , } \\ & { x _ { 7 } ( t + 1 ) = x _ { 7 } ( t ) + d t \cdot \left[ - \gamma _ { 3 } x _ { 7 } ( t ) + \beta _ { 3 } x _ { 3 } ( t ) \right] + \xi _ { 7 } ( t ) . } \\ & { x _ { 8 } ( t + 1 ) = x _ { 8 } ( t ) + d t \cdot \left[ - \sigma _ { 4 } x _ { 2 } ( t ) + \beta _ { 4 } x _ { 4 } ( t ) \right] + \xi _ { 8 } ( t ) . } \end{array}
+$$
+
+Here, $x _ { 1 } , x _ { 2 } , x _ { 3 } , x _ { 4 }$ (resp. $x _ { 5 } , x _ { 6 } , x _ { 7 } , x _ { 8 } )$ denote the concentrations of the mRNA transcripts (resp.
+proteins) of genes 1, 2, 3 and 4, respectively.
+
+The parameters are as follows,
+
+$$
+\forall i \in \{ 1 , 2 , 3 , 4 \} : \ K _ { i } = 1 , a _ { i } = 1 . 6 , \gamma _ { i } = 0 . 1 6 , \beta _ { i } = 0 . 1 6 , c _ { i } = 0 . 0 6 , d t = 1
+$$
+
+
+Figure 9: A snapshot of natural behaviour of a repressilator system consisting of 4 genes. The X-axis denotes time and Y-axis denotes value/concentration of each state.
+
+# E MARKOVIAN JUMP SYSTEMS
+
+In addition to the systems described in Section C and Section D, we introduce two Markovian jump systems (MJS), which contain both discrete switchings (or jumps) and continuous dynamics (Shi & Li, 2015), as test beds for the proposed and baseline methods. Specifically, we borrow two simple examples from the linear case of MJS, i.e. Markovian jump linear systems (MJLS). The dynamic of the MJLS could be described by the following state space model,
+
+$$
+x _ { k + 1 } = A _ { \sigma _ { k } } x _ { k } + B _ { \sigma _ { k } } u _ { k }
+$$
+
+where $x _ { k }$ and $u _ { k }$ are the state and control inputs respectively; $A _ { \sigma _ { k } }$ and $B _ { \sigma _ { k } }$ are the parameter matrices. $O _ { k }$ is the switching signal governing the switching of subsystems, which takes value in a finite set $\{ 1 , \ldots , N \}$ where $N$ is the number of subsystems. In MJS, the value of $\sigma$ is governed by a Markov process, $\sigma _ { k + 1 } \sim P ( \sigma _ { k + 1 } | \sigma _ { k } )$ . The task of the agent is to stabilize the system and cost function is $c ( x ) = \| x \| _ { 2 }$ .
+
+For the first MJS named MJS1, the parameter matrices are given as follow,
+
+$$
+\begin{array} { r l } & { A _ { 1 } = \rho \left[ - 0 . 3 6 7 2 \quad 0 . 7 0 3 8 \right] , \quad B _ { 1 } = \left[ \frac { - 1 } { 1 } \right] , } \\ & { A _ { 2 } = \rho \left[ \begin{array} { l l } { 0 . 3 4 6 8 \quad } & { 0 . 6 3 2 4 } \\ { - 0 . 7 7 7 4 \quad } & { 1 . 1 8 7 2 } \end{array} \right] , \quad B _ { 2 } = \left[ \frac { - 1 } { 1 } \right] , } \\ & { A _ { 3 } = \rho \left[ \frac { - 0 . 3 4 6 8 \quad } { - 0 . 7 7 7 4 } \quad 0 . 6 3 2 4 \right] , \quad B _ { 3 } = \left[ \begin{array} { l } { 0 } \\ { 1 } \end{array} \right] } \end{array}
+$$
+
+where $\rho = 1 . 3$ and the transition probability of switching signal at each instant is uniformly distributed across all three modes. Among the three subsystems, subsystem 1 and 2 are unstable without control input.
+
+To further make the task more difficult, we include a second MJS system, MJS2, of which the parameter is given as
+
+$$
+{ \begin{array} { r l } { A _ { 1 } = \rho \left[ { - 0 . 4 2 2 7 \quad { 0 . 7 7 1 0 } } \right] , } & { B _ { 1 } = { \binom { 1 } { 2 } } , } \\ { A _ { 2 } = \rho \left[ { - 0 . 5 0 8 4 \quad 0 . 4 5 3 6 } \right] , } & { B _ { 2 } = { \binom { 0 } { 0 } } , } \\ { A _ { 3 } = \rho \left[ { - 0 . 4 7 7 2 \quad { 0 . 7 3 1 3 } } \right] , } & { B _ { 3 } = { \binom { 1 } { 2 } } } \end{array} }
+$$
+
+where $\rho = 0 . 8 5 9$ and the switching signal is also uniformly distributed. Note that the subsystem 2 and 3 are unstable without control input. Moreover, subsystem 2 in uncontrollable, since the control input cannot effect the system dynamic under this mode.
+
+# F FURTHER VALIDATION OF STABILITY GUARANTEE
+
+In this part, a further comparison between the stability-assured method (LAC) and that without such guarantee (SAC) is made, by demonstrating the closed-loop system dynamic with the trained policies (in the two Repressilator and two MJS examples).
+
+
+Figure 10: Cumulative control performance comparison. The Y-axis indicates the total cost during one episode and the X-axis indicates the total time steps in thousand. The shadowed region shows the 1-SD confidence interval over 10 random seeds. Across all trials of training, LAC converges to stable solution with comparable or superior performance compared with SAC.
+
+
+Figure 11: State trajectories over time under policies trained by LAC and SAC in the Repressilator and Complicated Repressilator. In each experiment, the policies are tested over 20 random initial states and all the resulting trajectories are displayed above. The $\mathrm { X }$ -axis indicates the time and Y-axis shows the concentration of Protein 1.
+
+As shown in the figures, without stability guarantee, the state trajectories either diverge (see Figure 11 b and Figure $1 2 { \mathrm { ~ d ~ } }$ ), or continuously oscillate around the reference trajectory or equilibrium (see
+
+
+Figure 11 d and Figure 12 b). In the MJS examples, the trajectories even diverge to or oscillate in unacceptable magnitude (1e7 and 1e10). Contrarily, the stability assured method stabilizes the system well in all tasks (i.e. the state trajectories converge to the reference signal or equilibrium). In the MJS examples, though temporal oscillation occurs in some of the trials due to the existence of unstable uncontrollable subsystems, eventually all of the trajectories are stabilized.
+Figure 12: State trajectories over time under policies trained by LAC and SAC in the two Markovian jump systems. In each experiment, the policies are tested over 20 random initial states and all the resulting trajectories are displayed above. The $\mathbf { X }$ -axis indicates the time and Y-axis shows the value of states.
+
+# G FURTHER VALIDATION OF STABILITY GUARANTEE
+
+In addition to the evaluation of stability in terms of system dynamic in previous sections, this part presents a more direct approach for validating the satisfaction of stability condition (2). The Algorithm 1 aims to solve the dual problem of the original policy optimization problem, i.e. solving the following min-max problem,
+
+$$
+\operatorname* { m a x } _ { \lambda , \beta } \operatorname* { m i n } _ { \theta } J ( \pi )
+$$
+
+where $\lambda$ and $\beta$ are positive Lagrange multipliers and updated by gradient ascent. When (2) is satisfied, $\lambda$ will continuously decrease until it becomes zero. Thus by checking the value and variation of $\lambda$ , the satisfaction of stability condition during training and at convergence could be validated. More specifically, the decline of $\lambda$ implies the satisfaction of stability condition at that update; $\lambda$ only converges to zero if the stability condition is assured.
+
+Clipping the maximum value of $\lambda$ is necessary, in case that $\lambda$ grows too much due to the violation of stability condition during the early training stage, resulting in the inappropriate step length for the policy update. Clipping is a useful technique to prevent instability of optimization, especially in gradient-based methods, see Schulman et al. (2017); Bengio et al. (2013); Bello et al. (2017); Wang et al. (2015). Conversely, when the stability condition is satisfied, $\lambda$ quickly drops and helps convergence of the algorithm, which inherently prevents overfitting and enhances robustness and generalization.
+
+# H ROBUSTNESS AND GENERALIZATION EVALUATION OF SPPO
+
+In this part, we evaluate the robustness and generalization ability of policies trained by SPPO in the same. First, the robustness of the policies is tested by perturbing the parameters and adding noise in the Cartpole and Repressilator environment, as described in Section 5.4.1. Generalization of the policies is evaluated by setting reference signals that are unseen during training. State trajectories of the above experiments are demonstrated in Figure 13 and Figure 14, respectively. As demonstrated in the figures, the SPPO policies could hardly deal with previously unseen uncertainty or reference signals, and failed in all of the Repressilator experiments.
+
+The SPPO algorithm is originally developed for the control tasks with safety constraints, i.e. keeping the expectation of discounted cumulative safety cost below a certain threshold. Though Lyapunov method is exploited, the approach is not aimed at providing stability guarantee.
+
+
+
+
+Figure 13: State trajectories over time under policies trained by SPPO and tested in the presence of parametric uncertainties and process noise, for CartPole and Repressilator. The setting of the uncertainty is the same as in Section 5.4.1.
+Figure 14: State trajectories under policies trained by SPPO when tracking different reference signals. The setting of the uncertainty is the same as in Section 5.4.3.
+
+# I ZOOM-IN VIEWS
+
+# I.1 ZOOM-IN VIEW OF FIGURE 3
+
+
+Figure 15: Zoom-in view of Figure 3 (a)
+
+
+Figure 16: Zoom-in view of Figure 3 (b)
+
+
+Figure 17: Zoom-in view of Figure 3 (c)
+
+
+Figure 18: Zoom-in view of Figure 3 (d)
+
+# I.2 ZOOM-IN VIEW OF FIGURE 5
+
+
+Figure 19: Zoom-in view of Figure 5 (a)
+
+
+Figure 20: Zoom-in view of Figure 5 (b)
+
+# J HYPERPARAMETERS
+
+Table 1: Hyperparameters of LAC
+
+
Hyperparameters
Repressilator
CartPole
FetchReach
HalfCheetah
Time horizon N
5
5
5
8
Minibatch size
256
256
256
256
Actor learning rate
1e-4
1e-4
1e-4
1e-4
Critic learning rate
3e-4
3e-4
3e-4
3e-4
Lyapunov learning rate
3e-4
3e-4
3e-4
3e-4
Target entropy
-3
-1
-5
-6
Soft replacement(T)
0.005
0.005
0.005
0.005
Discount(γ)
0.75
1.0
1.0
0.995
Q3
1.0
1.0
1.0
1.0
Lyapunov critic network structure
(256,256,16)
(64,64,16)
(64,64,16)
(256,256,16)
+
+For LAC, there are two networks: the policy network and the Lyapunov critic network. For the policy network, we use a fully-connected MLP with two hidden layers of 256 units, outputting the mean and standard deviations of a Gaussian distribution. As mentioned in section 4, it should be noted that the output of the Lyapunov critic network is a square term, which is always non-negative. More specifically, we use a fully-connected MLP with two hidden layers and one output layer with different units as in Table 1, outputting the feature vector $\phi ( s , a )$ . The Lyapunov value is obtained by $L _ { c } ( s , a ) = \phi ^ { T } ( s , a ) \phi ( s , a )$ . All the hidden layers use Relu activation function and we adopt the same invertible squashing function technique as Haarnoja et al. (2018) to the output layer of the policy network.
\ No newline at end of file
diff --git a/md/train/SkmiegW0b/SkmiegW0b.md b/md/train/SkmiegW0b/SkmiegW0b.md
new file mode 100644
index 0000000000000000000000000000000000000000..b8680fe089b9ad62aaacbadc0a348a7290c24ad5
--- /dev/null
+++ b/md/train/SkmiegW0b/SkmiegW0b.md
@@ -0,0 +1,250 @@
+# CHALLENGES IN DISENTANGLING INDEPENDENT FAC-TORS OF VARIATION
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We study the problem of building models that disentangle independent factors of variation. Such models encode features that can efficiently be used for classification and to transfer attributes between different images in image synthesis. As data we use a weakly labeled training set, where labels indicate what single factor has changed between two data samples, although the relative value of the change is unknown. This labeling is of particular interest as it may be readily available without annotation costs. We introduce an autoencoder model and train it through constraints on image pairs and triplets. We show the role of feature dimensionality and adversarial training theoretically and experimentally. We formally prove the existence of the reference ambiguity, which is inherently present in the disentangling task when weakly labeled data is used. The numerical value of a factor has different meaning in different reference frames. When the reference depends on other factors, transferring that factor becomes ambiguous. We demonstrate experimentally that the proposed model can successfully transfer attributes on several datasets, but show also cases when the reference ambiguity occurs.
+
+# 1 INTRODUCTION
+
+One way to simplify the problem of classifying or regressing attributes of interest from data is to build an intermediate representation, a feature, where the information about the attributes is better separated than in the input data. Better separation means that some entries of the feature vary only with respect to one and only one attribute. In this way, classifiers and regressors would not need to build invariance to many nuisance attributes. Instead, they could devote more capacity to discriminating the attributes of interest, and possibly achieve better performance. We call this task disentangling factors of variation, and we identify attributes with the factors. In addition to facilitating classification and regression, this task is beneficial to image synthesis. One could build a model to render images, where each input varies only one attribute of the output, and to transfer attributes between images.
+
+When labeling is possible and available, supervised learning can be used to solve this task. In general, however, some attributes may not be easily quantifiable (e.g., style). Therefore, we consider using weak labeling, where we only know what attribute has changed between two images, although we do not know by how much. This type of labeling may be readily available in many cases without manual annotation. For example, image pairs from a stereo system are automatically labeled with a viewpoint change, albeit unknown. A practical model that can learn from these labels is an encoder-decoder pair subject to a reconstruction constraint. In this model the weak labels can be used to define similarities between subsets of the feature obtained from two input images.
+
+We introduce a novel adversarial training of autoencoders to solve the disentangling task when only weak labels are available. Compared to previous methods, our discriminator is not conditioned on class labels, but takes image pairs as inputs. This way the number of parameters can be kept constant.
+
+We describe the shortcut problem, where all the the information is encoded only in one part of the feature, while other part is completely ignored, as fig. 1 illustrates. We prove our method solves this problem and demonstrate it experimentally.
+
+We formally prove existence of the reference ambiguity, that is inherently present in the disentangling task when weak labels are used. Thus no algorithm can provably learn disentangling. As fig. 1 shows, the reference ambiguity means that a factor (for example viewpoint) can have different meaning when using a different reference frame that depends on another factor (for example car type). We show experimentally that this ambiguity rarely arise, we can observe it only when the data is complex.
+
+
+Figure 1: Challenges of disentangling. We disentangle the feature into two parts, one representing the viewpoint, the other the car type. We use the features for attribute transfer. For all subfigures the viewpoint feature is taken from the leftmost column and the car type feature is taken from the topmost row. (a) ideal solution: the viewpoint and the car type are transferred correctly. (b) shortcut problem: the car type is not transferred. (c) reference ambiguity: compared to the others the viewpoint orientation is flipped for the blue car.
+
+# 2 RELATED WORK
+
+Autoencoders. Autoencoders in Bourlard & Kamp (1988), Hinton & Salakhutdinov (2006), Bengio et al. (2013) learn to reconstruct the input data as $\mathbf { x } = \mathrm { D e c } ( \mathrm { E n c } ( \mathbf { x } ) )$ , where $\operatorname { E n c } ( \mathbf { x } )$ is the internal image representation (the encoder) and Dec (the decoder) reconstructs the input of the encoder. Variational autoencoders in Kingma & Welling (2014) use a generative model; $p ( \bar { \mathbf { x } } , \mathbf { z } ) = p ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } )$ , where $\mathbf { x }$ is the observed data (images), and $\mathbf { z }$ are latent variables. The encoder estimates the parameters of the posterior, $\operatorname { E n c } ( \mathbf { x } ) = p ( \mathbf { z } | \mathbf { x } )$ , and the decoder estimates the conditional likelihood, $\mathrm { D e c } ( \mathbf { z } ) = p ( \mathbf { x } | \mathbf { z } )$ . In Hinton et al. (2011) autoencoders are trained with transformed image input pairs. The relative transformation parameters are also fed to the network. Because the internal representation explicitly represents the objects presence and location, the network can learn their absolute position. One important aspect of the autoencoders is that they encourage latent representations to keep as much information about the input as possible.
+
+GAN. Generative Adversarial Nets Goodfellow et al. (2014) learn to sample realistic images with two competing neural networks. The generator Dec creates images $\mathbf { x } = \mathrm { D e c } ( \mathbf { z } )$ from a random noise sample $\mathbf { z }$ and tries to fool a discriminator Dsc, which has to decide whether the image is sampled from the generator $p _ { g }$ or from real images $p _ { r e a l }$ . After a successful training the discriminator cannot distinguish the real from the generated samples. Adversarial training is often used to enforce constraints on random variables. BIGAN, Donahue et al. (2016) learns a feature representation with adversarial nets by training an encoder Enc, such that $\operatorname { E n c } ( \mathbf { x } )$ is Gaussian, when $\mathbf { x } \sim p _ { r e a l }$ . CoGAN, Liu & Tuzel (2016) learns the joint distribution of multi-domain images by having generators and discriminators in each domain, and sharing their weights. They can transform images between domains without being given correspondences. InfoGan, Chen et al. (2016) learns a subset of factors of variation by reproducing parts of the input vector with the discriminator.
+
+Disentangling and independence. Many recent methods use neural networks for disentangling features, with various degrees of supervision. In Xi Peng (2017) multi-task learning is used with full supervision for pose invariant face recognition. Using both identity and pose labels Tran et al. (2017) can learn pose invariant features and synthesize frontalized faces from any pose. In Yang et al. (2015) autoencoders are used to generate novel viewpoints of objects. They disentangle the object category factor from the viewpoint factor by using as explicit supervision signals: the relative viewpoint transformations between image pairs. In Cheung et al. (2014) the output of the encoder is split in two parts: one represents the class label and the other represents the nuisance factors. Their objective function has a penalty term for misclassification and a cross-covariance cost to disentangle class from nuisance factors. Hierarchical Boltzmann Machines are used in Reed et al. (2014) for disentangling. A subset of hidden units are trained to be sensitive to a specific factor of variation, while being invariant to others. Variational Fair Autoencoders Louizos et al. (2016) learn a representation that is invariant to specific nuisance factors, while retaining as much information as possible. Autoencoders can also be used for visual analogy Reed et al. (2015). GAN is used for disentangling intrinsic image factors (albedo and normal map) in Shu et al. (2017) without using ground truth labeling. They achieve this by explicitly modeling the physics of the image formation in their network.
+
+The work most related to ours is Mathieu et al. (2016), where an autoencoder restores an image from another by swapping parts of the internal image representation. Their main improvement over Reed et al. (2015) is the use of adversarial training, which allows for learning with image pairs instead of image triplets. Therefore, expensive labels like viewpoint alignment between different car types are no longer needed. One of the differences between this method and ours is that it trains a discriminator for each of the given labels. A benefit of this approach is the higher selectivity of the discriminator, but a drawback is that the number of model parameters grows linearly with the number of labels. In contrast, we work with image pairs and use a single discriminator so that our method is uninfluenced by the number of labels. Moreover, we show formally and experimentally the difficulties of disentangling factors of variation.
+
+# 3 DISENTANGLING FACTORS OF VARIATION
+
+We are interested in the design and training of two models. One should map a data sample (e.g., an image) to a feature that is explicitly partitioned into subvectors, each associated to a specific factor of variation. The other model should map this feature back to an image. We call the first model the encoder and the second model the decoder. For example, given the image of a car we would like the encoder to yield a feature with two subvectors: one related to the car viewpoint, and the other related to the car type. The subvectors of the feature obtained from the encoder should be useful for classification or regression of the corresponding factor that they depend on (the car viewpoint and type in the example). This separation would also be very useful to the decoder. It would enable advanced editing of images, for example, the transfer of the viewpoint or car types from an image to another, by swapping the corresponding subvectors. Next, we introduce our model of the data and formal definitions of our encoder and decoder.
+
+Data model. We assume that our observed data $\mathbf { x }$ is generated through some unknown deterministic invertible and smooth process $f$ that depends on the factors $\mathbf { v }$ and $\mathbf { c }$ , so that $\mathbf { x } = f ( \mathbf { v } , \mathbf { c } )$ . In our earlier example, $\mathbf { x }$ is an image, $\mathbf { v }$ is a viewpoint, c is a car type, and $f$ is the rendering engine. It is reasonable to assume that $f$ is invertible, as for most cases the factors are readily apparent form the image. We assume $f$ is smooth, because a small change in the factors should only result in a small change in the image and vice versa. We denote the inverse of the rendering engine as $f ^ { - 1 } = [ f _ { \mathbf { v } } ^ { - 1 } , f _ { \mathbf { c } } ^ { - 1 } ]$ , where the subscript refers to the recovered factor.
+
+Weak labeling. In the training we are given pairs of images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ , where they differ in $\mathbf { v }$ (varying factor), but they have the same c (common factor). We also assume that the two varying factors and the common factor are sampled independently, $\mathbf { v } _ { 1 } \sim p _ { \mathbf { v } }$ , $\mathbf { v } _ { 2 } \sim p _ { \mathbf { v } }$ and $\mathbf { c } \sim p _ { \mathbf { c } }$ . The images are generated as $\mathbf { x } _ { 1 } = f ( \mathbf { v } _ { 1 } , \mathbf { c } )$ and $\mathbf { x } _ { 1 } = f ( \mathbf { v } _ { 2 } , \mathbf { c } )$ . We call this labeling weak, because we do not know the absolute values of either the $\mathbf { v }$ or c factors or even relative changes between $\mathbf { v } _ { 1 }$ and $\mathbf { v } _ { 2 }$ . All we know is that the image pairs share the same common factor.
+
+The encoder. Let Enc be the encoder mapping images to features. For simplicity, we consider features split into only two column subvectors, $N _ { \mathbf { v } }$ and $N _ { \mathbf { c } }$ , one associated to the varying factor $\mathbf { v }$ and the other associated to the common factor c. Then, we have that $\mathrm { E n c } ( \mathbf { x } ) = [ N _ { \mathbf { v } } ( \mathbf { x } ) , \bar { N _ { \mathbf { c } } } ( \mathbf { x } ) ]$ . Ideally, we would like to find the inverse of the image formation function, $[ N _ { \bf v } , N _ { \bf c } ] = f ^ { - 1 }$ , which separates and recovers the factors $\mathbf { v }$ and $\mathbf { c }$ from data samples $\mathbf { x }$ , i.e.,
+
+$$
+N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } ) ) = \mathbf { v } \qquad N _ { \mathbf { c } } ( f ( \mathbf { v } , \mathbf { c } ) ) = \mathbf { c } .
+$$
+
+In practice, this is not possible because any bijective transformation of $\mathbf { v }$ and c could be undone by $f$ and produce the same output $\mathbf { x }$ . Therefore, we aim for $N _ { \mathbf { v } }$ and $N _ { \mathbf { c } }$ that satisfy the following feature disentangling properties
+
+$$
+R _ { \mathbf { v } } ( N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } ) ) ) = \mathbf { v } \qquad R _ { \mathbf { c } } ( N _ { \mathbf { c } } ( f ( \mathbf { v } , \mathbf { c } ) ) ) = \mathbf { c }
+$$
+
+for all $\mathbf { v } , \mathbf { c }$ , and for some bijective functions $R _ { \mathbf { v } }$ and $R _ { \mathbf { c } }$ , so that $N _ { \mathbf { v } }$ is invariant to $\mathbf { c }$ and $N _ { \mathbf { c } }$ is invariant to $\mathbf { v }$ .
+
+The decoder. Let Dec be the decoder mapping features to images. The sequence encoder-decoder is constrained to form an autoencoder, so
+
+$$
+\mathrm { D e c } ( N _ { \mathbf { v } } ( { \mathbf { x } } ) , N _ { \mathbf { c } } ( { \mathbf { x } } ) ) = { \mathbf { x } } , \qquad \forall { \mathbf { x } } .
+$$
+
+To use the decoder for image synthesis, so that each input subvector affects only one factor in the rendered image, the ideal decoder should satisfy the data disentangling property
+
+$$
+\mathrm { D e c } ( N _ { \mathbf { v } } ( f ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } ) ) , N _ { \mathbf { c } } ( f ( \mathbf { v } _ { 2 } , \mathbf { c } _ { 2 } ) ) ) = f ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 2 } )
+$$
+
+for any $\mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { c } _ { 1 }$ , and $\mathbf { c } _ { 2 }$ . The equation above describes the transfer of the varying factor $\mathbf { v } _ { 1 }$ of $\mathbf { x } _ { 1 }$ and the common factor $\mathbf { c } _ { 2 }$ of $\mathbf { x } _ { 2 }$ to a new image ${ \bf x } _ { 1 \oplus 2 } = f ( { \bf v } _ { 1 } , { \bf c } _ { 2 } )$ .
+
+In the next section we describe our training method for disentangling. We introduce a novel adversarial term, that does not need to be conditioned on the common factor, rather it uses only image pairs, that keeps the model parameters constant. Then we address the two main challenges of disentangling, the shortcut problem and the reference ambiguity. We discuss which disentanglement properties can be (provably) achieved by our (or any) method.
+
+# 3.1 MODEL TRAINING
+
+In our training procedure we use two terms in the objective function: an autoencoder loss and an adversarial loss. We describe these losses in functional form, however the components are implemented using neural networks. In all our terms we use the following sampling of independent factors
+
+$$
+\mathbf { c } _ { 1 } , \mathbf { c } _ { 3 } \sim p _ { \mathbf { c } } , \quad \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { v } _ { 3 } \sim p _ { \mathbf { v } } .
+$$
+
+The images are formed as $\mathbf { x } _ { 1 } = f ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } )$ , $\mathbf { x } _ { 2 } = f ( \mathbf { v } _ { 2 } , \mathbf { c } _ { 1 } )$ and $\mathbf { x } _ { 3 } = f ( \mathbf { v } _ { 3 } , \mathbf { c } _ { 3 } )$ . The images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ share the same common factor, and $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 3 }$ are independent. In our objective functions, we use either pairs or triplets of the above images.
+
+Autoencoder loss. In this term, we use images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ with the same common factor $\mathbf { c } _ { 1 }$ . We feed both images to the encoder. Since both images share the same $\mathbf { c } _ { 1 }$ , we impose that the decoder should reconstruct $\mathbf { x } _ { 1 }$ from the encoder subvector $N _ { \mathbf { v } } ( \mathbf { x } _ { 1 } )$ and the encoder subvector $N _ { \mathbf { c } } ( \mathbf { x } _ { 2 } )$ , and similarly for the reconstruction of $\mathbf { x } _ { 2 }$ . The autoencoder objective is thus defined as
+
+$$
+\mathcal { L } _ { A E } \doteq E _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } } \left[ \left| \mathbf { x } _ { 1 } - \mathrm { D e c } ( N _ { \mathbf { v } } ( \mathbf { x } _ { 1 } ) , N _ { \mathbf { c } } ( \mathbf { x } _ { 2 } ) ) \right| ^ { 2 } + \left| \mathbf { x } _ { 2 } - \mathrm { D e c } ( N _ { \mathbf { v } } ( \mathbf { x } _ { 2 } ) , N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } ) ) \right| ^ { 2 } \right] .
+$$
+
+Adversarial loss. We introduce an adversarial training where the generator is our encoder-decoder pair and the discriminator Dsc is a neural network, which takes image pairs as input. The discriminator learns to distinguish between real image pairs $[ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ]$ and fake ones $[ \mathbf { x } _ { 1 } , \mathbf { x } _ { 3 \oplus 1 } ]$ , where $\mathbf { x } _ { 3 \oplus 1 } \doteq$ $\mathrm { D e c } ( N _ { \mathbf { v } } ( \mathbf { x } _ { 3 } ) , N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } ) )$ . If the encoder were ideal, the image $\mathbf { x } _ { \mathrm { 3 \oplus 1 } }$ would be the result of taking the common factor from $\mathbf { x } _ { 1 }$ and the varying factor from $\mathbf { x } _ { 3 }$ . The generator learns to fool the discriminator, so that $\mathbf { x } _ { 3 \oplus 1 }$ looks like the random variable $\mathbf { x } _ { 2 }$ (the common factor is $\mathbf { c } _ { 1 }$ and the varying factor is independent of $\mathbf { v } _ { 1 }$ ). To this purpose, the decoder must make use of $N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } )$ , since $\mathbf { x } _ { 3 }$ does not carry any information about $\mathbf { c } _ { 1 }$ . The objective function is thus defined as
+
+$$
+\mathcal { L } _ { G A N } \doteq E _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } } \Big [ \log ( \mathrm { D s c } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) ) \Big ] + E _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 3 } } \Big [ \log ( 1 - \mathrm { D s c } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 3 \oplus 1 } ) ) \Big ] .
+$$
+
+Composite loss. Finally, we optimize the weighted sum of the two losses $\mathcal { L } = \mathcal { L } _ { A E } + \lambda \mathcal { L } _ { G A N }$
+
+$$
+\operatorname* { m i n } _ { \mathrm { D e c , E n c } } \operatorname* { m a x } _ { \mathrm { D s c } } \mathcal { L } _ { A E } ( \mathrm { D e c , E n c } ) + \lambda \mathcal { L } _ { G A N } ( \mathrm { D e c , E n c , D s c } )
+$$
+
+where $\lambda$ regulates the relative importance of the two losses.
+
+# 3.2 SHORTCUT PROBLEM.
+
+Ideally, at the global minimum of $\mathcal { L } _ { A E }$ , $N _ { \mathbf { v } }$ relates only to the factor $\mathbf { v }$ and $N _ { \mathbf { c } }$ only to c. However, the encoder may map a complete description of its input into $N _ { \mathbf { v } }$ and the decoder may completely ignore $N _ { \mathbf { c } }$ . We call this challenge the shortcut problem. When the shortcut problem occurs, the decoder is invariant to its second input, so it does not transfer the $\mathbf { c }$ factor correctly,
+
+$$
+\mathrm { D e c } ( N _ { \mathbf { v } } ( { \mathbf { x } } _ { 3 } ) , N _ { \mathbf { c } } ( { \mathbf { x } } _ { 1 } ) ) = { \mathbf { x } } _ { 3 } .
+$$
+
+The shortcut problem can be addressed by reducing the dimensionality of $N _ { \mathbf { v } }$ , so it cannot build a complete representation of all input images. This also forces the encoder and decoder to make use of $N _ { \mathbf { c } }$ for the common factor. However, this strategy may not be convenient as it leads to a time consuming trial-and-error procedure to find the correct dimensionality. A better way to address the shortcut problem is to use adversarial training (7) (8).
+
+Proposition 1. Let $\mathbf { x } _ { 1 }$ , $\mathbf { x } _ { 2 }$ and $\mathbf { x } _ { 3 }$ data samples generated according to (5), where the factors $\mathbf { c } _ { 1 } , \mathbf { c } _ { 3 } , \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { v } _ { 3 }$ are jointly independent, and $\mathbf { x } _ { 3 \oplus 1 } \doteq D e c ( N _ { \mathbf { v } } ( \mathbf { x } _ { 3 } ) , N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } ) )$ . When the global optimum of the composite loss (8) is reached, the c factor is transferred to $\mathbf { x } _ { \mathrm { 3 \oplus 1 } }$ , i.e. $f _ { \mathbf { c } } ^ { - 1 } ( \mathbf { x } _ { 3 \oplus 1 } ) = \mathbf { c } _ { 1 }$
+
+Proof. When the global optimum of (8) is reached, the distribution of real $\left[ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } \right]$ and fake $[ \mathbf { x } _ { 1 } , \mathbf { x } _ { 3 \oplus 1 } ]$ image pairs are identical. We compute statistics of the inverse of the rendering engine of the common factor $\bar { f } _ { \mathbf { c } } ^ { - 1 }$ on the data. For the images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ we obtain
+
+$$
+\begin{array} { r } { { E } _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } } \Big [ | f _ { \mathbf { c } } ^ { - 1 } ( \mathbf { x } _ { 1 } ) - f _ { \mathbf { c } } ^ { - 1 } ( \mathbf { x } _ { 2 } ) | ^ { 2 } \Big ] = { E } _ { \mathbf { c } _ { 1 } } \Big [ | \mathbf { c } _ { 1 } - \mathbf { c } _ { 1 } | ^ { 2 } \Big ] = 0 } \end{array}
+$$
+
+by construction (of $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ ). For the images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { \mathrm { 3 \oplus 1 } }$ we obtain
+
+$$
+\begin{array} { r } { E _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 3 } } \Big [ | f _ { \mathbf { c } } ^ { - 1 } ( \mathbf { x } _ { 1 } ) - f _ { \mathbf { c } } ^ { - 1 } ( \mathbf { x } _ { 3 \oplus 1 } ) | ^ { 2 } \Big ] = E _ { \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } , \mathbf { v } _ { 3 } , \mathbf { c } _ { 3 } } \Big [ | \mathbf { c } _ { 1 } - \mathbf { c } _ { 3 \oplus 1 } | ^ { 2 } \Big ] \geq 0 , } \end{array}
+$$
+
+where ${ \bf c } _ { 3 \oplus 1 } = f _ { \bf c } ^ { - 1 } ( { \bf x } _ { 3 \oplus 1 } )$ . We achieve equality if and only if $\mathbf { c } _ { 1 } = \mathbf { c } _ { 3 \oplus 1 }$ everywhere.
+
+# 3.3 REFERENCE AMBIGUITY
+
+Let us consider the ideal case where we observe the space of all images. When weak labels are made available to us, we also know what images $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ share the same c factor (for example, which images have the same car). This labeling is equivalent to defining the probability density function $p _ { \mathbf { c } }$ and the joint conditional $\displaystyle p _ { { \mathbf { x } } _ { 1 } , { \mathbf { x } } _ { 2 } | { \mathbf { c } } }$ , where
+
+$$
+p _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } | \mathbf { c } } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } | \mathbf { c } ) = \int \delta ( \mathbf { x } _ { 1 } - f ( \mathbf { v } _ { 1 } , \mathbf { c } ) ) \delta ( \mathbf { x } _ { 2 } - f ( \mathbf { v } _ { 2 } , \mathbf { c } ) ) p ( \mathbf { v } _ { 1 } ) p ( \mathbf { v } _ { 2 } ) d \mathbf { v } _ { 1 } d \mathbf { v } _ { 2 } .
+$$
+
+Firstly, we show that the labeling allows us to satisfy the feature disentangling property for $\mathbf { c }$ (2). For any $[ \mathbf { \dot { x } } _ { 1 } , \mathbf { x } _ { 2 } ] \sim p _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } | \mathbf { c } }$ we impose $N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } ) = N _ { \mathbf { c } } ( \mathbf { x } _ { 2 } )$ . In particular, this equation is true for pairs when one of the two images is held fixed. Thus, a function $C ( \mathbf { c } ) = N _ { \mathbf { c } } ( \mathbf { x } _ { 1 } )$ can be defined, where the $C$ only depends on c, because $N _ { \mathbf { c } }$ is invariant to $\mathbf { v }$ . Lastly, images with the same $\mathbf { v }$ , but different c must also result in different features, $C ( \mathbf { c } _ { 1 } ) = N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } _ { 1 } ) ) \neq N _ { \mathbf { v } } ( \mathbf { v } , \mathbf { c } _ { 2 } ) = C ( \mathbf { c } _ { 2 } )$ , otherwise the autoencoder constraint (3) cannot be satisfied. Then, there exists a bijective function $\dot { R } _ { \bf c } = { C } ^ { - 1 }$ such that property (2) is satisfied for c. Unfortunately the other disentangling properties can not provably be satisfied.
+
+Definition 1. A function $g$ reproduces the data distribution, when it generates samples $\mathbf { y } _ { 1 } = g ( \mathbf { v } _ { 1 } , \mathbf { c } )$ and $\mathbf { y } _ { 2 } = g ( \mathbf { v } _ { 2 } , \mathbf { c } )$ that have the same distribution as the data. Formally, $[ \mathbf { y } _ { 1 } , \mathbf { y } _ { 2 } ] \sim p _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } }$ , where the latent factors are independent, $\mathbf { v } _ { 1 } \sim p _ { \mathbf { v } }$ , $\mathbf { v } _ { 2 } \sim p _ { \mathbf { v } }$ and $\mathbf { c } \sim p _ { \mathbf { c } }$ .
+
+The reference ambiguity occurs, when a decoder reproduces the data without satisfying the disentangling properties.
+
+Proposition 2. Let $p _ { \mathbf { v } }$ assign the same probability value to at least two different instances of v. Then, we can find encoders that reproduce the data distribution, but do not satisfy the disentangling properties for v in (2) and (4).
+
+Proof. We already saw that $N _ { \mathbf { c } }$ satisfies (2), so we can choose $N _ { \mathbf { c } } = f _ { \mathbf { c } } ^ { - 1 }$ , the inverse of the rendering engine. Now we look at defining $N _ { \mathbf { v } }$ and the decoder. The iso-probability property of $p _ { \mathbf { v } }$ implies that there exists a mapping $T ( \mathbf { v } , \mathbf { c } )$ , such that $T ( \mathbf { v } , \mathbf { c } ) \sim p _ { \mathbf { v } }$ and $T ( \mathbf { v } , \bar { \mathbf { c } _ { 1 } } ) \bar { \neq } T ( \bar { \mathbf { v } } , \bar { \mathbf { c } _ { 2 } } )$ for some $\mathbf { v }$ and $\mathbf { c } _ { 1 } \neq \mathbf { c } _ { 2 }$ . For example, let us denote with $\mathbf { v } _ { 1 } \neq \mathbf { v } _ { 2 }$ two varying components such that $p _ { \mathbf { v } } ( \mathbf { v } _ { 1 } ) = p _ { \mathbf { v } } ( \mathbf { v } _ { 2 } )$ . Then, let
+
+$$
+T ( \mathbf { v } , \mathbf { c } ) \dot { = } \left\{ \begin{array} { l l } { \mathbf { v } } & { \mathrm { i f } \ \mathbf { v } \neq \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } } \\ { \mathbf { v } _ { 1 } } & { \mathrm { i f } \ \mathbf { v } = \mathbf { v } _ { 1 } \lor \mathbf { v } _ { 2 } \mathrm { a n d } \mathbf { c } \in \mathcal { C } } \\ { \mathbf { v } _ { 2 } } & { \mathrm { i f } \ \mathbf { v } = \mathbf { v } _ { 1 } \lor \mathbf { v } _ { 2 } \mathrm { a n d } \mathbf { c } \not \in \mathcal { C } } \end{array} \right.
+$$
+
+and $\mathcal { C }$ is a subset of the domain of $\mathbf { c }$ , where $\begin{array} { r } { \int _ { \mathcal { C } } p _ { \mathbf { c } } ( \mathbf { c } ) d \mathbf { c } = 1 / 2 } \end{array}$ . Now, let us define the encoder as $N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } ) ) = T ( \mathbf { v } , \mathbf { c } )$ . By using the autoencoder constraint, the decoder satisfies
+
+$$
+\operatorname { D e c } ( N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } ) ) , N _ { \mathbf { c } } ( f ( \mathbf { v } , \mathbf { c } ) ) ) = \operatorname { D e c } ( T ( \mathbf { v } , \mathbf { c } ) , \mathbf { c } ) = f ( \mathbf { v } , \mathbf { c } ) .
+$$
+
+Even though $T ( \mathbf { v } , \mathbf { c } )$ depends on $\mathbf { c }$ functionally, they are statistically independent. Because $T ( \mathbf { v } , \mathbf { c } ) \sim$ $p _ { \mathbf { v } }$ and $\mathbf { c } \sim p _ { \mathbf { c } }$ by construction, our encoder-decoder pair defines a data distribution identical to that given as training set
+
+$$
+\left[ \operatorname { D e c } ( T ( \mathbf { v } _ { 1 } , \mathbf { c } ) , \mathbf { c } ) , \operatorname { D e c } ( T ( \mathbf { v } _ { 2 } , \mathbf { c } ) , \mathbf { c } ) \right] \sim p _ { \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } } .
+$$
+
+The feature disentanglement property is not satisfied because $N _ { \mathbf { v } } ( f ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } ) ) ~ = ~ T ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } ) ~ \neq$ $T ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 2 } ) \ = \ N _ { \mathbf { v } } ( f ( { \bar { \mathbf { v } } } _ { 1 } , \mathbf { c } _ { 2 } ) )$ , when $\mathbf { c } _ { 1 } ~ \in ~ { \mathcal { C } }$ and $\mathbf { c } _ { 2 } \notin \mathcal { C }$ . Similarly, the data disentanglement property does not hold, because $\mathrm { D e c } ( T ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 1 } ) , \mathbf { c } _ { 1 } ) \neq \mathrm { D e c } ( T ( \mathbf { v } _ { 1 } , \mathbf { c } _ { 2 } ) , \mathbf { c } _ { 2 } )$ . □
+
+The above proposition implies that we cannot provably disentangle all the factors of variation from weakly labeled data, even if we had access to all the data and knew the distributions $p _ { \mathbf { v } }$ and $p _ { \mathbf { c } }$ .
+
+To better understand it, let us consider a practical example. Let $\mathbf { v } \sim \mathcal { U } [ - \pi , \pi ]$ be the (continuous) viewpoint (the azimuth angle) and $\mathbf { c } \sim B ( 0 . 5 )$ the car type, where $\mathcal { U }$ denotes the uniform distribution and $B ( 0 . 5 )$ the Bernoulli distribution with probability $p _ { \mathbf { c } } ( \mathbf { c } = 0 ) = p _ { \mathbf { c } } ( \mathbf { c } = 1 ) = 0 . 5$ (i.e., there are only 2 car types). In this case, every instance of $\mathbf { v }$ is iso-probable in $p _ { \mathbf { v } }$ so we have the worst scenario for the reference ambiguity. We can define the function $T ( \mathbf { v } , \mathbf { c } ) = \mathbf { v } ( 2 \mathbf { c } - 1 )$ so that the mapping of $\mathbf { v }$ is mirrored as we change the car type. By construction $T ( \mathbf { v } , \mathbf { c } ) \sim \mathcal { U } [ - \pi , \pi ]$ for any $\mathbf { c }$ and $T ( \mathbf { v } , \mathbf { c } _ { 1 } ) \neq T ( \mathbf { v } , \mathbf { c } _ { 2 } )$ for $\mathbf { v } \neq 0$ and $\mathbf { c } _ { 1 } \neq \mathbf { c } _ { 2 }$ . So we cannot tell the difference between $T$ and the ideal correct mapping to the viewpoint factor. This is equivalent to an encoder $N _ { \mathbf { v } } ( f ( \mathbf { v } , \mathbf { c } ) ) = T ( \mathbf { v } , \mathbf { c } )$ that reverses the ordering of the azimuth of car 1 with respect to car 0. Each car has its own reference system, and thus it is not possible to transfer the viewpoint from one system to the other, as it is illustrated in fig. 1.
+
+# 3.4 IMPLEMENTATION
+
+In our implementation we use convolutional neural networks for all the models. We denote with $\theta$ the parameters associated to each network. Then, the optimization of the composite loss can be written as
+
+$$
+\hat { \theta } _ { \mathrm { { D e c } } } , \hat { \theta } _ { \mathrm { { E n c } } } , \hat { \theta } _ { \mathrm { { D s c } } } = \arg \operatorname* { m i n } _ { \theta _ { \mathrm { { D e c } } } , \theta _ { \mathrm { { E n c } } } } \operatorname* { m a x } _ { \theta _ { \mathrm { { D s c } } } } \mathcal { L } ( \theta _ { \mathrm { { D e c } } } , \theta _ { \mathrm { { E n c } } } , \theta _ { \mathrm { { D s c } } } ) .
+$$
+
+We choose $\lambda = 1$ and also add regularization to the adversarial loss so that each logarithm has a minimum value. We define $\log _ { \epsilon } \bar { \mathrm { D s c } } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) = \log ( \epsilon + \mathrm { D s c } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) )$ (and similarly for the other logarithmic term) and use $\epsilon = 1 0 ^ { - 1 2 }$ . The main components of our neural network are shown in Fig. 2. The architecture of the encoder and the decoder were taken from DCGAN Radford et al. (2015), with slight modifications. We added fully connected layers at the output of the encoder and to the input of the decoder. For the discriminator we used a simplified version of the VGG Simonyan & Zisserman (2014) network. As the input to the discriminator is an image pair, we concatenate them along the color channels.
+
+Normalization. In our architecture both the encoder and the decoder networks use blocks with a convolutional layer, a nonlinear activation function (ReLU/leaky ReLU) and a normalization layer, typically, batch normalization (BN). As an alternative to BN we consider the recently introduced instance normalization (IN) Ulyanov et al. (2017). The main difference between BN and IN is that the latter just computes the mean and standard deviation across the spatial domain of the input and not along the batch dimension. Thus, the shift and scaling for the output of each layer is the same at every iteration for the same input image. In practice, we find that IN improves the performance.
+
+# 4 EXPERIMENTS
+
+We tested our method on the MNIST, Sprites and ShapeNet datasets. We performed ablation studies on the shortcut problem using ShapeNet cars. We focused on the effect of the feature dimensionality and having the adversarial term $( \mathcal { L } _ { A E } + \mathcal { L } _ { G A N } )$ or not $( \mathcal { L } _ { A E } )$ . We also show that in most cases the reference ambiguity does not arise in practice (MNIST, Sprites, ShapeNet cars), we can only observe it when the data is more complex (ShapeNet chairs).
+
+
+Figure 2: Learning to disentangle factors of variation. The scheme above shows how the encoder (Enc), the decoder (Dec) and the discriminator (Dsc) are trained with input triplets. The components with the same name share weights.
+
+# 4.1 SHORTCUT PROBLEM
+
+ShapeNet cars. The ShapeNet dataset Chang et al. (2015) contains 3D objects than we can render from different viewpoints. We consider only one category (cars) for a set of fixed viewpoints. Cars have high intraclass variability and they do not have rotational symmetries. We used approximately 3K car types for training and 300 for testing. We rendered 24 possible viewpoints around each object in a full circle, resulting in 80K images in total. The elevation was fixed to 15 degrees and azimuth angles were spaced 15 degrees apart. We normalized the size of the objects to fit in a $1 0 0 \times 1 0 0$ pixel bounding box, and placed it in the middle of a $1 2 8 \times 1 2 8$ pixel image.
+
+Fig. 3 shows the attribute transfer on the Shapenet cars. We compare the methods $\mathcal { L } _ { A E }$ and $\mathcal { L } _ { A E } +$ $\mathcal { L } _ { G A N }$ with different feature dimension of $N _ { \mathbf { v } }$ . The size of the common feature $N _ { \mathbf { c } }$ was fixed to 1024 dimensions. We can observe that the transferring performance degrades for $\mathcal { L } _ { A E }$ , when we increase the feature size of $N _ { \mathbf { v } }$ . As expected, the autoencoder takes the shortcut and tries to store all information into $N _ { \mathbf { v } }$ . The model $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ instead renders images without loss of quality, independently of the feature dimension.
+
+
+Figure 3: Feature transfer on Shapenet. (a) synthesized images with $\mathcal { L } _ { A E }$ , where the top row shows images from which the car type is taken. The second, third and fourth row show the decoder renderings using 2, 16 and 128 dimensions for the feature $N _ { \mathbf { v } }$ . (b) images synthesized with $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ . The setting for the inputs and feature dimensions are the same as in (a).
+
+In Fig. 4 we visualize the t-SNE embeddings of the $N _ { \mathbf { v } }$ features for several models using different feature sizes. For the $2 D$ case, we do not modify the data. We can see that both $\mathcal { L } _ { A E }$ with 2 dimensions and $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ with 128 separate the viewpoints well, but $\mathcal { L } _ { A E }$ with 128 dimensions does not due to the shortcut problem. We investigate the effect of dimensionality of the $N _ { \mathbf { v } }$ features on the nearest neighbor classification task. The performance is measured by the mean average precision. For $N _ { \mathbf { v } }$ we use the viewpoint as ground truth. Fig. 4 also shows the results on $\mathcal { L } _ { A E }$ and $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ models with different $N _ { \mathbf { v } }$ feature dimensions. The dimension of $N _ { \mathbf { c } }$ was fixed to 1024 for this experiment. One can now see quantitatively that $\mathcal { L } _ { A E }$ is sensitive to the size of $N _ { \mathbf { v } }$ , while $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ is not. $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ also achieves a better performance.
+
+
+Figure 4: The effect of dimensions and objective function on $N _ { v }$ features. (a), (b), (c) t-SNE embeddings on $N _ { \mathbf { v } }$ features. Colors correspond to the ground truth viewpoint. The objective functions and the $N _ { \mathbf { v } }$ dimensions are: (a) $\mathcal { L } _ { A E }$ 2 dim, (b) $\mathcal { L } _ { A E }$ 128 dim, (c) $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N } \mathrm { ~ 1 ~ }$ 128 dim. (d) Mean average precision curves for the viewpoint prediction from the viewpoint feature using different models and dimensions for $N _ { \mathbf { v } }$ .
+
+Table 1: Nearest neighbor classification on $N _ { \mathbf { v } }$ and $N _ { \mathbf { c } }$ features using different normalization techniques on ShapeNet cars.
+
+
Normalization
Nv mAP
Nc mAP
None
0.47
0.13
Batch
0.50
0.08
Instance
0.50
0.20
+
+We compare the different normalization choices in Table 1. We evaluate the case when batch, instance and no normalization are used and compute the performance on the nearest neighbor classification task. We fixed the feature dimensions at 1024 for both $N _ { \mathbf { v } }$ and $N _ { \mathbf { c } }$ features in all normalization cases. We can see that both batch and instance normalization perform equally well on viewpoint classification and no normalization is slightly worse. For the car type classification instance normalization is clearly better.
+
+# 4.2 REFERENCE AMBIGUITY
+
+MNIST. The MNIST dataset LeCun et al. (1998) contains handwritten grayscale digits of size $2 8 \times 2 8$ pixel. There are 60K images of 10 classes for training and 10K for testing. The common factor is the digit class and the varying factor is the intraclass variation. We take image pairs that have the same digit for training, and use our full model $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ with dimensions 64 for $N _ { \mathbf { v } }$ and 64 for $N _ { \mathbf { c } }$ . In Fig. 5 (a) and (b) we show the transfer of varying factors. Qualitatively, both our method and Mathieu et al. (2016) perform well. We observe neither the reference ambiguity nor the shortcut problem in this case.
+
+
+Figure 5: Renderings of transferred features. In all figures the variable factor is transferred from the left column and the common factor from the top row. (a) MNIST Mathieu et al. (2016); (b) MNIST (ours); (c) Sprites Mathieu et al. (2016); (d) Sprites (ours).
+
+
+Figure 6: Attribute transfer on ShapeNet. For both subfigures the viewpoint is taken from the leftmost column and the car/chair type is taken from the first row. (a) Cars: the factors are transferred correctly. (b) Chairs: in the bottom three rows the viewpoint is not transferred correctly due to the reference ambiguity.
+
+Sprites. The Sprites dataset Reed et al. (2015) contains 60 pixel color images of animated characters (sprites). There are 672 sprites, 500 for training, 100 for testing and 72 for validation. Each sprite has 20 animations and 178 images, so the full dataset has 120K images in total. There are many changes in the appearance of the sprites, they differ in their body shape, gender, hair, armour, arm type, greaves, and weapon. We consider character identity as the common factor and the pose as the varying factor. We train our system using image pairs of the same sprite and do not exploit labels on their pose. We train the $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ model with dimensions 64 for $N _ { \mathbf { v } }$ and 448 for $N _ { \mathbf { c } }$ . Fig. 5 (c) and (d) show results on the attribute transfer task. Both our method and Mathieu et al. (2016)’s transfer the identity of the sprites correctly, the reference ambiguity does not arise.
+
+ShapeNet chairs. We render the ShapeNet chairs with the same settings (viewpoints, image size) as the cars. There are 3500 chair types for training and 3200 for testing, so the dataset contains 160K images. We trained $\mathcal { L } _ { A E } + \mathcal { L } _ { G A N }$ , and set the feature dimensions to 1024 for both $N _ { \mathbf { v } }$ and $N _ { \mathbf { c } }$ . In Fig. 6 we show results on attribute transfer and compare it with ShapeNet cars. We found that the reference ambiguity does not emerge for cars, but it does for chairs, possibly due to the higher complexity, as cars have much less variability than chairs.
+
+# 5 CONCLUSIONS
+
+In this paper we studied the challenges of disentangling factors of variation, mainly the shortcut problem and the reference ambiguity. The shortcut problem occurs when all information is stored in only one feature chunk, while the other is ignored. The reference ambiguity means that the reference in which a factor is interpreted, may depend on other factors. This makes the attribute transfer ambiguous. We introduced a novel training of autoencoders to solve disentangling using image triplets. We showed theoretically and experimentally how to keep the shortcut problem under control through adversarial training, and enable to use large feature dimensions. We proved that the reference ambiguity is inherently present in the disentangling task when weak labels are used. Most importantly this can be stated independently of the learning algorithm. We demonstrated that training and transfer of factors of variation may not be guaranteed. However, in practice we observe that our trained model works well on many datasets and exhibits good generalization capabilities.
+
+# REFERENCES
+
+Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013.
+
+Hervé Bourlard and Yves Kamp. Auto-association by multilayer perceptrons and singular value decomposition. Biological cybernetics, 59(4):291–294, 1988.
+Angel X. Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: An Information-Rich 3D Model Repository. Technical Report arXiv:1512.03012 [cs.GR], 2015.
+Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2016.
+Brian Cheung, Jesse A Livezey, Arjun K Bansal, and Bruno A Olshausen. Discovering hidden factors of variation in deep networks. arXiv:1412.6583, 2014.
+Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. arXiv:1605.09782, 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, 2014.
+Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006.
+Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
+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.
+Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in Neural Information Processing Systems, pp. 469–477, 2016.
+Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zemel. The variational fair autoencoder. In ICLR, 2016.
+Michael F Mathieu, Junbo Jake Zhao, Junbo Zhao, Aditya Ramesh, Pablo Sprechmann, and Yann LeCun. Disentangling factors of variation in deep representation using adversarial training. In Advances in Neural Information Processing Systems, pp. 5041–5049, 2016.
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv:1511.06434, 2015.
+Scott Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1431–1439, 2014.
+Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In Advances in Neural Information Processing Systems, pp. 1252–1260, 2015.
+Zhixin Shu, Ersin Yumer, Sunil Hadap, Kalyan Sunkavalli, Eli Shechtman, and Dimitris Samaras. Neural face editing with intrinsic image disentangling. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning gan for pose-invariant face recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
+Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Improved texture networks: Maximizing quality and diversity in feed-forward stylization and texture synthesis. In CVPR, 2017.
+Kihyuk Sohn Dimitris Metaxas Manmohan Chandraker Xi Peng, Xiang Yu. Reconstruction for feature disentanglement in pose-invariant face recognition. arXiv:1702.03041, 2017.
+Jimei Yang, Scott E Reed, Ming-Hsuan Yang, and Honglak Lee. Weakly-supervised disentangling with recurrent transformations for 3d view synthesis. In NIPS, 2015.
\ No newline at end of file
diff --git a/md/train/Syx9ET4YPB/Syx9ET4YPB.md b/md/train/Syx9ET4YPB/Syx9ET4YPB.md
new file mode 100644
index 0000000000000000000000000000000000000000..6cc5e6583dccf3e7253190451da7c6628297a217
--- /dev/null
+++ b/md/train/Syx9ET4YPB/Syx9ET4YPB.md
@@ -0,0 +1,333 @@
+# DO IMAGE CLASSIFIERS GENERALIZE ACROSS TIME?
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+We study the robustness of image classifiers to temporal perturbations derived from videos. As part of this study, we construct ImageNet-Vid-Robust and YTBB-Robust, containing a total 57,897 images grouped into 3,139 sets of perceptually similar images. Our datasets were derived from ImageNet-Vid and Youtube-BB respectively and thoroughly re-annotated by human experts for image similarity. We evaluate a diverse array of classifiers pre-trained on ImageNet and show a median classification accuracy drop of 16 and 10 percent on our two datasets. Additionally, we evaluate three detection models and show that natural perturbations induce both classification as well as localization errors, leading to a median drop in detection mAP of 14 points. Our analysis demonstrates that perturbations occurring naturally in videos pose a substantial and realistic challenge to deploying convolutional neural networks in environments that require both reliable and low-latency predictions.
+
+# 1 INTRODUCTION
+
+Convolutional neural networks (CNNs) still exhibit many troubling failure modes. At one extreme, $\ell _ { p }$ -adversarial examples cause large drops in accuracy for state-of-the-art models while relying only on visually imperceptible changes to the input image (Goodfellow et al., 2014; Biggio and Roli, 2018). However, this failure mode usually does not pose a problem outside a fully adversarial context because carefully crafted $\ell _ { p }$ -perturbations are unlikely to occur naturally in the real world.
+
+To study more realistic failure modes, researchers have investigated benign image perturbations such as rotations & translations, colorspace changes, and various image corruptions (Fawzi and Frossard, 2015; Engstrom et al., 2017; Fawzi and Frossard, 2015; Hendrycks and Dietterich, 2019). However, it is still unclear whether these perturbations reflect the robustness challenges arising in real data since the perturbations also rely on synthetic image modifications.
+
+Recent work has therefore turned to videos as a source of naturally occurring perturbations of images (Zheng et al., 2016; Azulay and Weiss, 2018; Gu et al., 2019). In contrast to other failure modes, the perturbed images are taken from existing image data without further modifications that make the task more difficult. As a result, robustness to such perturbations directly corresponds to performance improvements on real data.
+
+However, it is currently unclear to what extent such video perturbations pose a significant robustness challenge. Azulay and Weiss (2018) and Zheng et al. (2016) only provide anecdotal evidence from a small number of videos. Gu et al. (2019) go beyond individual videos and utilize a large video dataset (Real et al., 2017) in order to measure the effect of video perturbations more quantitatively. In their evaluation, the best image classifiers lose about $3 \%$ accuracy for video frames up to 0.3 seconds away. However, the authors did not employ humans to review the frames in their videos. Hence the accuracy drop could also be caused by significant changes in the video frames (e.g., due to fast camera or object motion). Since the $3 \%$ accuracy drop is small to begin with, it remains unclear whether video perturbations are a robustness challenge for current image classifiers.
+
+We address these issues by conducting a thorough evaluation of robustness to natural perturbations arising in videos. As a cornerstone of our investigation, we introduce two test sets for evaluating model robustness: ImageNet-Vid-Robust and YTBB-Robust, carefully curated from the ImageNet-Vid and Youtube-BB datasets, respectively (Russakovsky et al., 2015; Real et al., 2017). All images in the two datasets were screened by a set of expert labelers to ensure high annotation quality and minimize selection biases that arise when filtering a dataset with CNNs. To the best of our knowledge these are the first datasets of their kind, containing tens of thousands of images that are human reviewed and grouped into thousands of perceptually similar sets. In total, our datasets contain 3,139 sets of temporally adjacent and visually similar images (57,897 images total).
+
+We then utilize these datasets to measure the accuracy of current CNNs to small, naturally occurring perturbations. Our testbed contains over 45 different models, varying both architecture and training methodology (adversarial training, data augmentation, etc.). To better understand the drop in accuracy due to natural perturbations, we also introduce a robustness metric that is more stringent than those employed in prior work. Under this metric, we find that natural perturbations from ImageNet-Vid-Robust and YTBB-Robust induce a median accuracy drop of $16 \%$ and $10 \%$ respectively for classification tasks and a median 14 point drop in mAP for detection tasks.1 Even for the best-performing classification models, we observe an accuracy drop of $14 \%$ for ImageNet-Vid-Robust and $8 \%$ for YTBB-Robust.
+
+Our results show that robustness to natural perturbations in videos is indeed a significant challenge for current CNNs. As these models are increasingly deployed in safety-critical environments that require both high accuracy and low latency (e.g., autonomous vehicles), ensuring reliable predictions on every frame of a video is an important direction for future work.
+
+
+Figure 1: Three examples of natural perturbations from nearby video frames and resulting classifier confidences from a ResNet-152 model fine-tuned on ImageNet-Vid. While the images appear almost identical to the human eye, the classifier confidence changes substantially.
+
+# 2 CONSTRUCTING A TEST SET FOR ROBUSTNESS
+
+ImageNet-Vid-Robust and YTBB-Robust are sourced from videos in the ImageNet-Vid and Youtube-BB datasets (Russakovsky et al., 2015; Real et al., 2017). All object classes in ImageNet-Vid and Youtube-BB are from the WordNet hierarchy (Miller, 1995) and direct ancestors of ILSVRC-2012 classes. Using the WordNet hierarchy, we construct a canonical mapping from ILSVRC-2012 classes to ImageNet-Vid and Youtube-BB classes, which allows us to evaluate off-the-shelf ILSVRC-2012 models on ImageNet-Vid-Robust and YTBB-Robust. We provide more background on the source datsets in Appendix A.
+
+2.1 CONSTRUCTING IM A G ENE T-VI D-RO B U S T AND YTBB-RO B U S T
+
+Next, we describe how we extracted sets of naturally perturbed frames from ImageNet-Vid and Youtube-BB to create ImageNet-Vid-Robust and YTBB-Robust. A straightforward approach would be to select a set of anchor frames and use temporally adjacent frames in the video with the assumption that such frames contain only small perturbations from the anchor. However, as Fig. 2 illustrates, this assumption is frequently violated, especially due to fast camera or object motion.
+
+Instead, we first collect preliminary datasets of natural perturbations following the same approach, and then manually review each of the frame sets. For each video, we randomly sample an anchor frame and take $k = 1 0$ frames before and after the anchor frame as candidate perturbation images.2 This results in two datasets containing one anchor frame each from 3,139 videos, with approximately 20 candidate perturbation per anchor frame.3
+
+
+Figure 2: Temporally adjacent frames may not be visually similar. We show three randomly sampled frame pairs where the nearby frame was marked as “dissimilar” to the anchor frame during human review and then discarded from our dataset.
+
+Table 1: Statistics of ImageNet-Vid-Robust and YTBB-Robust. For YTBB-Robust, we updated the labels from for $41 \%$ (834) of the accepted anchors due to labeling errors in Youtube-BB.
+
+
ImageNet-Vid-Robust
YTBB-Robust
Anchor frames
Reviewed
1,314
2,467
Accepted
1,109 (84%)
2,030 (82%)
Labels updated
1
834 (41%)
Frame pairs
Reviewed
26,029
45,631
Accepted
21,070 (80.9%)
36,827 (80.7%)
+
+Next, we curate the dataset with the help of four expert human annotators. The goal of the curation step is to ensure that each anchor frame and its nearby frames are correctly labeled with the same ground truth class, and that the anchor frame and the nearby frames are visually similar.
+
+Denser labels for Youtube-BB. As Youtube-BB contains only a single category label per frame at 1 frame per second, annotators first viewed each anchor frame individually and marked any missing labels. In total, annotators corrected the labels for 834 frames, adding an average of 0.5 labels per anchor frame. These labels are then propagated to nearby, unlabeled frames at the native frame rate and verified in the next step. ImageNet-Vid densely labels all classes per frame, so we skip this step.
+
+Frame pairs review. Next, for each pair of anchor and candidate perturbation frames, a human annotates (i) whether the pair is correctly labeled in the dataset, and (ii) whether the pair is similar. We took several steps to mitigate the subjectivity of this task and ensure high annotation quality. First, we trained reviewers to mark frames as dissimilar if the scene undergoes any of the following transformations: significant motion, significant background change, or significant blur change. We asked reviewers to mark each dissimilar frame with one of these transformations, or “other”, and to mark a pair of images as dissimilar if a distinctive feature of the object is only visible in one of the two frames (such as the face of a dog). If an annotator was unsure about the correct label, she could mark the pair as “unsure”. Second, we present only a single pair of frames at a time to reviewers because presenting videos or groups of frames could cause them to miss large changes due to the phenomenon of change blindness (Pashler, 1988).
+
+Verification. In the previous stage, all annotators were given identical labeling instructions and individually reviewed a total of 71,660 images pairs. To increase consistency in annotation, annotators jointly reviewed all frames marked as dissimilar, incorrectly labeled, or “unsure”. A frame was only considered similar to its anchor if a strict majority of the annotators marked the pair as such.
+
+After the reviewing was complete, we discarded all anchor frames and candidate perturbations that annotators marked as dissimilar or incorrectly labeled. The final datasets contain a combined total of 3,139 anchor frames with a median of 20 similar frames each.
+
+# 2.2 THE P M-K EVALUATION METRIC
+
+Given the datasets introduced above, we propose a metric to measure a model’s robustness to natural perturbations. In particular, let $A = \{ a _ { 1 } , . . . , a _ { n } \}$ be the set of valid anchor frames in our dataset. Let $Y = \{ y _ { 1 } , . . . , y _ { n } \}$ be the set of labels for $A$ . We let $\textstyle { \mathcal { N } } _ { k } ( a _ { i } )$ be the set of frames marked as similar to anchor frame $a _ { i }$ . In our setting, $\mathcal { N } _ { k }$ is a subset of the $2 k$ temporally adjacent frames (plus/minus $\mathbf { k }$ frames from the anchor).
+
+Classification. Classification accuracy is defined as $\begin{array} { r } { \mathrm { a c c } _ { \mathrm { o r i g } } = 1 - \frac { 1 } { N } \sum _ { i = 0 } ^ { N } \mathcal { L } _ { 0 / 1 } ( f ( a _ { i } ) , y _ { i } ) } \end{array}$ , where $\mathcal { L } _ { 0 / 1 }$ is the standard 0-1 loss function. We define the $\mathrm { p m - k }$ analog of accuracy as
+
+$$
+\mathrm { a c c } _ { \mathrm { p m k } } = 1 - \frac { 1 } { N } \sum _ { i = 0 } ^ { N } \operatorname* { m a x } _ { b \in \mathcal { N } _ { k } ( a _ { i } ) } \mathcal { L } _ { 0 / 1 } ( f ( b ) , y _ { i } ) ,
+$$
+
+which corresponds to picking the worst frame from each set $\textstyle { \mathcal { N } } _ { k } ( a _ { i } )$ before computing accuracy.
+
+Detection. The standard metric for detection is mean average precision (mAP) of the predictions at a fixed intersection-over-union (IoU) threshold Lin et al. (2014). We define the $\mathrm { p m - k }$ metric analogous to that for classification: We replace each anchor frame with the nearest frame that minimizes the average precision (AP, averaged over recall thresholds) of the predictions, and compute $\mathrm { p m - k }$ as the mAP on these worst-case neighboring frames.
+
+# 3 MAIN RESULTS
+
+
+Figure 3: Model accuracy on original vs. perturbed images. Each data point corresponds to one model in our testbed (shown with $9 5 \%$ Clopper-Pearson confidence intervals). Each perturbed frame was taken from a ten frame neighborhood of the original frame (approximately 0.3 seconds). All frames were reviewed by humans to confirm visual similarity to the original frames.
+
+We evaluate a testbed of 45 classification and three detection models on ImageNet-Vid-Robust and YTBB-Robust. We first discuss the various types of classification models evaluated with the $\mathrm { p m - k }$ classification metric. Second, we evaluate the performance of detection models on ImageNet-Vid-Robust using use the bounding box annotations inherited from ImageNet-Vid using a variant of $\mathrm { p m - k }$ for detection. We then analyze the errors made on the detection adversarial examples to isolate the effects of localization errors vs. classification errors.
+
+# 3.1 CLASSIFICATION
+
+The classification robustness metric is $\mathrm { a c c } _ { \mathrm { p m k } }$ defined in Equation (1). For frames with multiple labels, we count a prediction as correct if the model predicts any of the correct classes for a frame. In Figure 3, we plot the benign accuracy, $\operatorname { a c c } _ { \mathrm { o r i g } }$ , versus the robust accuracy, $\mathrm { a c c } _ { \mathrm { p m k } }$ , for all classification models in our test bed and find that the relationship between $\operatorname { a c c } _ { \mathrm { o r i g } }$ and $\mathrm { a c c } _ { \mathrm { p m k } }$ is approximately linear. This relationship indicates that improvements in the benign accuracy do result in improvements in the worst-case accuracy, but do not suffice to resolve the accuracy drop due to natural perturbations.
+
+Our test bed consists of five model types with increasing levels of supervision. We present results for representative models from each model type in Table 2 and defer the full classification results table to Appendix B.2.
+
+Table 2: Accuracies of five different model types and the best performing model. The model architecture is ResNet-50 unless noted otherwise. ‘FT’ is ‘fine-tuning.’ See Section 3.1 for details.
+
+
Model Type Accuracy Accuracy △PerturbedOriginal
ImageNet-Vid-Robust
Trained on ILSVRC 67.5 [64.7, 70.3] 52.5 [49.5, 55.5] 15.0
+ FT on ImageNet- Vid 80.8 [78.3, 83.1] 65.7 [62.9, 68.5] 15.1
+ FT on ImageNet-Vid (ResNet-152) 84.8 [82.5, 86.8]
70.2 [67.4, 72.8] 14.6
+ FT on ImageNet-Vid-Det 77.6 [75.1, 80.0] 65.4 [62.5, 68.1] 12.3
YTBB-Robust
Trained on ILSVRC 57.0 [54.9, 59.2]
43.8 [41.7, 46.0] 13.2
+Noise Augmentation 62.3 [60.2, 64.4]
45.7 [43.5, 47.9]
16.6
+ l robustness (ResNext-101) 53.6 [51.4, 55.8]
43.2 [41.0, 45.3]
10.4
+ FT on Youtube-BB 91.4 [90.1, 92.6]
82.0 [80.3, 83.7]
9.4
+ FT on Youtube-BB (ResNet-152) 92.9 [91.6, 93.9]
84.7 [83.0, 86.2]
8.2
+
+ILSVRC Trained The WordNet hierarchy enables us to repurpose models trained for the 1,000 class ILSVRC dataset on ImageNet-Vid-Robust and YTBB-Robust (see Appendix A.1). We evaluate a wide array of ILSVRC-2012 models (available from Cadene) against our natural perturbations. Since these datasets present a substantial distribution shift from the original ILSVRC2012 validation, we expect the benign accuracy $\operatorname { a c c } _ { \mathrm { o r i g } }$ to be lower than the comparable accuracy on the ILSVRC-2012 validation set. However, our main interest here is in the difference between the original and perturbed accuracies $\operatorname { a c c } _ { \mathrm { o r i g } } - \operatorname { a c c } _ { \mathrm { p m k } }$ . A small drop in accuracy would indicate that the model is robust to small changes that occur naturally in videos. Instead, we find significant drops of $1 5 . 0 \%$ and $1 3 . 2 \%$ in accuracy on our two datasets, indicating sensitivity to such changes.
+
+Noise augmentation One hypothesis for the accuracy drop from original to perturbed accuracy is that subtle artifacts and corruptions introduced by video compression schemes could degrade performance when evaluating on these corrupted frames. The worst-case nature of the $\mathrm { p m - k }$ metric could then be focusing on these corrupted frames. One model for these corruptions are the perturbations introduced in Hendrycks and Dietterich (2019). To test this hypothesis, we evaluate models augmented with a subset of the perturbations (exactly one of: Gaussian noise, Gaussian blur, shot noise, contrast change, impulse noise, or JPEG compression). We found that these augmentation schemes did not improve robustness against our perturbations substantially, and still result in accuracy drop of $1 5 . 6 \%$ and $1 6 . 6 \%$ on the two datasets.
+
+$\ell _ { \infty }$ robustness. We evaluate the model from Xie et al. (2018), which currently performs best against $\ell _ { \infty }$ attacks on ImageNet. We find that this model has a smaller accuracy drop than the two aforementioned model types on both datasets. However, we note that the robust model achieves significantly lower original and perturbed accuracy than either of the two model types above, and the robustness gain is modest $3 \%$ compared to models of similar benign accuracy).
+
+Fine-tuning on video frames. To adapt to the new class vocabulary and the video domain, we fine-tune several network architectures on the ImageNet-Vid and Youtube-BB training sets. For Youtube-BB, we train on the anchor frames used for training in Gu et al. (2019), and for ImageNet-Vid we use all frames in the training set. We provide hyperparameters for all models in Appendix K.
+
+The resulting models significantly improve in accuracy over their ILSVRC pre-trained counterparts (e.g., $13 \%$ on ImageNet-Vid-Robust and $34 \%$ on YTBB-Robust for ResNet-50). This improvement in accuracy results in a modest improvement in the accuracy drop for YTBB-Robust, but a finetuned ResNet-50 still suffers from a significant $9 . 4 \%$ drop. On ImageNet-Vid-Robust, there is almost no change in the accuracy drop from $1 5 . 0 \%$ to $1 5 . 1 \%$ .
+
+Fine-tuning for detection on video frames. We further analyze whether additional supervision in the form of bounding box annotations improves robustness. To this end, we train the Faster R-CNN detection model Ren et al. (2015) with a ResNet-50 backbone on ImageNet-Vid. Following standard practice, the detection backbone is pre-trained on ILSVRC-2012. To evaluate this detector for classification, we assign the class with the most confident bounding box as label to the image. We find that this transformation reduces accuracy compared to the model trained for classification $( 7 7 . 6 \%$ vs. $8 0 . 8 \%$ ). While there is a slight reduction in the accuracy drop caused by natural perturbations, the reduction is well within the error bars for this test set.
+
+# 3.2 DETECTION
+
+We further study the impact of natural perturbations on object detection. Specifically, we report results for two related tasks: object localization and detection. Object detection is the standard computer vision task of correctly classifying an object and finding the coordinates of a tight bounding box containing the object. “Object localization”, meanwhile, refers to only the subtask of finding the bounding box, without attempting to correctly classify the object.
+
+We present our results on ImageNet-Vid-Robust, which contains dense bounding box labels unlike Youtube-BB, which only labels boxes at 1 frame per second. We use the popular Faster R-CNN Ren et al. (2015) and R-FCN Dai et al. (2016); Xiao and Jae Lee (2018) architectures for object detection and localization and report results in Table 3. For the R-FCN architecture, we use the model from Xiao and Jae Lee $( 2 0 1 8 ) ^ { 4 }$ . We first note the significant drop in mAP of 12 – 15 points for object detection due to perturbed frames for both the Faster R-CNN and R-FCN architectures. Next, we show that localization is indeed easier than detection, as the mAP is higher for localization than for detection (e.g., 76.6 vs 62.8 for Faster R-CNN with a ResNet-50 backbone). Perhaps surprisingly, however, switching to the localization task does not improve the drop between original and perturbed frames, indicating that natural perturbations induce both classification and localization errors. We show examples of detection failures in Figure 4.
+
+
+Figure 4: Naturally perturbed examples for detection. Red boxes indicate false positives; green boxes indicate true positives; white boxes are ground truth. Classification errors are common failures, such as the fox on the left, which is classified correctly in the anchor frame, and misclassified as a sheep in a nearby frame. However, detection models also have localization errors, where the object of interest is not correctly localized in addition to being misclassified, such as the airplane (middle) and the motorcycle (right). All visualizations show predictions with confidence greater than 0.5.
+
+# 3.3 IMPACT OF DATASET REVIEW
+
+We analyze the impact of our human review, described in Section 2.1, on the classifiers in our test bed. First, we compare the original and perturbed accuracies of a representative classifier (ResNet152 finetuned) with and without review in Table 4. Our review improves the original accuracy by $3- 4 \%$ by throwing away mislabeled or blurry anchor frames, and improves perturbed accuracy by $5- 6 \%$ by discarding pairs of dissimilar frames. Our review reduces the accuracy drop by $1 . 8 \%$ on
+
+Table 3: Detection and localization mAP for two Faster R-CNN backbones. Both detection and localization suffer from significant drops in mAP due to the perturbations. (\*Model trained on ILSVRC Det and VID 2015 datasets, and evaluated on the 2015 subset of ILSVRC-VID 2017.)
+
+
Task
Model
mAP Original
mAP Perturbed
mAP △
Detection
FRCNN,ResNet5
62.8
48.8
14.0
FRCNN,ResNet 101
63.1
50.6
12.5
R-FCN, ResNet 101 Xiao and Jae Lee (2018)*
79.4*
63.7*
15.7*
Localization
FRCNN,ResNet50
76.6
64.2
12.4
FRCNN, ResNet 101
77.8
66.3
11.5
R-FCN, ResNet 101*
80.9*
70.3*
10.6*
+
+ImageNet-Vid-Robust and $1 . 1 \%$ on YTBB-Robust, but still results in large accuracy drops. These results indicate that the changes in model predictions are indeed due to a lack of robustness, rather than due to significant differences between adjacent frames.
+
+To further analyze the impact of our review on model errors, we plot how frequently each offset distance from the anchor frame results in a model error across all model types in Figure 5. For both datasets, larger offsets (indicating pairs of frames further apart in time) lead to more frequent model errors. Our review reduces the fraction of errors across offsets, and especially for large offsets, which are more likely to display large changes from the anchor frame.
+
+
+Figure 5: We plot the fraction of times each offset caused an error, across all evaluated models, for frames with and without review. Frames further away more frequently cause classifiers to misfire. Our review process reduces the number of errors, especially for frames further in time, by removing dissimilar frames.
+
+Table 4: Impact of human review on original and perturbed accuracies for ImageNet-Vid-Robust and YTBB-Robust, using a ResNet-152 fine-tuned on ImageNet-Vid and Youtube-BB, respectively.
+
+
Accuracy
Reviewed
Original
Perturbed
Drop
ImageNet-Vid-Robust
80.3
64.1
16.2
X
84.8
70.2
14.4
YTBB-Robust
88.1
78.1
10.0
X
92.9
84.7
8.9
+
+# 4 RELATED WORK
+
+Adversarial examples. While various forms of adversarial examples have been studied, the majority of research focuses on $\ell _ { p }$ robustness Goodfellow et al. (2014); Biggio and Roli (2018). However, it is unclear whether adversarial examples pose a problem for classifier robustness outside of a truly worst case context. It is an open question whether perfect robustness against a $\ell _ { p }$ adversary will induce robustness to realistic image distortions such as those studied in this paper. Recent work has proposed more realistic image modifications such as small rotations $\&$ translations Engstrom et al.
+
+(2017); Azulay and Weiss (2018); Fawzi and Frossard (2015); Kanbak et al. (2017), hue and color changes Hosseini and Poovendran (2018), image stylization Geirhos et al. (2018a) and synthetic image corruptions such as Gaussian blur and JPEG compression Hendrycks and Dietterich (2019); Geirhos et al. (2018b). Even though the above examples are more realistic than the $\ell _ { p }$ model, they still synthetically modify the input images to generate perturbed versions. In contrast, our work performs no synthetic modification and instead uses images that naturally occur in videos.
+
+Utilizing videos to study robustness. In work concurrent to ours, Gu et al. (2019) exploit the temporal structure in videos to study robustness. However, their experiments suggest a substantially smaller drop in classification accuracy. The primary reason for this is a less stringent metric used in Gu et al. (2019). By contrast, our “pm-k” metric is inspired by the “worst-of-k” metric used in prior work Engstrom et al. (2017), highlighting the sensitivity of models to natural perturbations. In Appendix E we study the differences between the two metrics in more detail. Furthermore, the lack of human review and the high label error-rate we discovered in Youtube-BB(Table 1) presents a troubling confounding factor that we resolve in our work.
+
+Distribution shift. Small, benign changes in the test distribution are often referred to as distribution shift. Recht et al. (2019) explore this phenomenon by constructing new test sets for CIFAR-10 and ImageNet and observe performance drops for a large suite of models on the newly constructed test sets. Similar to our Figure 3, the relationship between original and new test set accuracy is also approximately linear. However, the images in their test set bear little visual similarity to images in the original test set, while all of our failure cases in ImageNet-Vid-Robust and YTBB-Robust are on perceptually similar images. In a similar vein of study, Torralba et al. (2011) studies distribution shift across different computer vision data sets such as Caltech-101, PASCAL, and ImageNet.
+
+Computer vision. A common issue when applying image based models to videos is flickering, where object detectors spuriously produce false-positives or false-negatives in isolated frames or groups of frames. Jin et al. (2018) explicitly identify such failures and use a technique reminiscent of adversarially robust training to improve image-based models. A similar line of work focuses on improving object detection in videos as objects become occluded or move quickly Kang et al. (2017); Feichtenhofer et al. (2017); Zhu et al. (2017); Xiao and Jae Lee (2018). The focus in this line of work has generally been on improving object detection when objects transform in a way that makes recognition difficult from a single frame, such as fast motion or occlusion. In this work, we document a broader set of failure cases for image-based classifiers and detectors and show that failures occur when the neighboring frames are imperceptibly different.
+
+# 5 CONCLUSION
+
+Our study quantifies the sensitivity of image classifiers to naturally occuring temporal perturbations. We show that these perturbations can cause significant drops in accuracy for a wide range of models for both classification and detection. Our work on analyzing this failure mode opens multiple avenues for future research:
+
+Building more robust models. Our ImageNet-Vid-Robust and YTBB-Robust datasets provide a standard measure for robustness that can be applied to any classification or detection model. In Table 2, we evaluated several commonly used models and found that all of them suffer from substantial accuracy drops due to natural perturbations. In particular, we found that model improvements with respect to artificial perturbations (such as image corruptions or $\ell _ { \infty }$ adversaries) induce at best modest improvements in robustness. We hope that our standardized datasets and evaluation metric will enable future work to quantify improvements in natural robustness directly.
+
+Further natural perturbations. Videos provide a straightforward method for collecting natural perturbations of images, admitting the study of realistic forms of robustness for machine learning methods. Other methods for generating these natural perturbations are likely to provide additional insights into model robustness. As an example, photo sharing websites contain a large number of near-duplicate images: pairs of images of the same scene captured at different times, viewpoints, or from a different camera Recht et al. (2019). More generally, devising similar, domain-specific strategies to collect, verify, and measure robustness to natural perturbations in domains such as natural language processing or speech recognition is a promising direction for future work.
+
+# REFERENCES
+
+Aharon Azulay and Yair Weiss. Why do deep convolutional networks generalize so poorly to small image transformations? arXiv preprint arXiv:1805.12177, 2018.
+
+Luca Bertinetto, Jack Valmadre, Joao F Henriques, Andrea Vedaldi, and Philip HS Torr. Fullyconvolutional siamese networks for object tracking. In European conference on computer vision, pages 850–865. Springer, 2016.
+
+Battista Biggio and Fabio Roli. Wild patterns: Ten years after the rise of adversarial machine learning. Pattern Recognition, 2018. https://arxiv.org/abs/1712.03141.
+
+Remi Cadene. Pretrained models for pytorch. https://github.com/Cadene/pretrain ed-models.pytorch. Accessed: 2019-05-20.
+
+Jifeng Dai, Yi Li, Kaiming He, and Jian Sun. R-fcn: Object detection via region-based fully convolutional networks. In Advances in neural information processing systems, pages 379–387, 2016.
+
+Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A rotation and a translation suffice: Fooling cnns with simple transformations. arXiv preprint arXiv:1712.02779, 2017.
+
+Alhussein Fawzi and Pascal Frossard. Manitest: Are classifiers really invariant? In British Machine Vision Conference (BMVC), 2015.
+
+Christoph Feichtenhofer, Axel Pinz, and Andrew Zisserman. Detect to track and track to detect. In Proceedings of the IEEE International Conference on Computer Vision, pages 3038–3046, 2017.
+
+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, 2018a.
+
+Robert Geirhos, Carlos RM Temme, Jonas Rauber, Heiko H Schütt, Matthias Bethge, and Felix A Wichmann. Generalisation in humans and deep neural networks. In Advances in Neural Information Processing Systems, pages 7538–7550, 2018b.
+
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
+
+Keren Gu, Brandon Yang, Jiquan Ngiam, Quoc Le, and Jonathan Shlens. Using videos to evaluate image model robustness. arXiv preprint arXiv:1904.10076, 2019.
+
+Wei Han, Pooya Khorrami, Tom Le Paine, Prajit Ramachandran, Mohammad Babaeizadeh, Honghui Shi, Jianan Li, Shuicheng Yan, and Thomas S Huang. Seq-nms for video object detection. arXiv preprint arXiv:1602.08465, 2016.
+
+Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019.
+
+Hossein Hosseini and Radha Poovendran. Semantic adversarial examples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1614–1619, 2018.
+
+SouYoung Jin, Aruni RoyChowdhury, Huaizu Jiang, Ashish Singh, Aditya Prasad, Deep Chakraborty, and Erik Learned-Miller. Unsupervised hard example mining from videos for improved object detection. In ECCV, 2018.
+
+Can Kanbak, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Geometric robustness of deep networks: analysis and improvement. arXiv preprint arXiv:1711.09115, 2017.
+
+Kai Kang, Hongsheng Li, Tong Xiao, Wanli Ouyang, Junjie Yan, Xihui Liu, and Xiaogang Wang. Object detection in videos with tubelet proposal networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 727–735, 2017.
+
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. MS COCO detection evaluation. http://cocodataset.or g/#detection-eval. Accessed: 2019-05-16.
+
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014.
+
+Francisco Massa and Ross Girshick. maskrcnn-benchmark: Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch. https://github.c om/facebookresearch/maskrcnn-benchmark, 2018. Accessed: 2019-05-20.
+
+George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39–41, 1995.
+
+Harold Pashler. Familiarity and visual change detection. Perception & psychophysics, 44(4):369–378, 1988.
+
+Esteban Real, Jonathon Shlens, Stefano Mazzocchi, Xin Pan, and Vincent Vanhoucke. Youtubeboundingboxes: A large high-precision human-annotated data set for object detection in video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5296–5305, 2017.
+
+Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? arXiv preprint arXiv:1902.10811, 2019.
+
+Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91–99, 2015.
+
+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 FeiFei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
+
+Antonio Torralba, Alexei A Efros, et al. Unbiased look at dataset bias. In CVPR, volume 1, page 7. Citeseer, 2011.
+
+Fanyi Xiao and Yong Jae Lee. Video object detection with an aligned spatial-temporal memory. In Proceedings of the European Conference on Computer Vision (ECCV), pages 485–501, 2018.
+
+Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. arXiv preprint arXiv:1812.03411, 2018.
+
+Stephan Zheng, Yang Song, Thomas Leung, and Ian Goodfellow. Improving the robustness of deep neural networks via stability training. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2016. doi: 10.1109/cvpr.2016.485. URL http://dx.doi.org/10. 1109/cvpr.2016.485.
+
+Xizhou Zhu, Yujie Wang, Jifeng Dai, Lu Yuan, and Yichen Wei. Flow-guided feature aggregation for video object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 408–417, 2017.
+
+# A SOURCE DATASET OVERVIEW
+
+# A.1 IMAGENET-VID
+
+The 2015 ImageNet-Vid dataset is widely used for training video object detectors Han et al. (2016) as well as trackers Bertinetto et al. (2016). We chose to work with the 2017 ImageNet-Vid dataset because it is a superset of the 2015 dataset. In total, the 2017 ImageNet-Vid dataset consists of 1,181,113 training frames from 4,000 videos and 512,360 validation frames from 1,314 videos. The videos have frame rates ranging from 9 to 59 frames per second (fps), with a median fps of 29. The videos range from 0.44 to 96 seconds in duration with a median duration of 12 seconds. Each frame is annotated with labels indicating the presence or absence of 30 object classes and corresponding bounding boxes for any label present in the frame. The 30 classes are ancestors of 293 of the 1,000 ILSVRC-2012 classes.
+
+# A.2 YOUTUBE-BB
+
+The 2017 Youtube-BB is a a large scale dataset with 8,146,143 annotated training frames 253,569 unique videos and with 1,013,246 validation frames from 31,829 videos. The video segments are approximately 19 seconds long on average. Each frame is annotated with exactly one label indicating the presence of 22 object classes, all of which are ancestors of 229 out of the ILSVRC-2012 classes.
+
+# B FULL ORIGINAL VS PERTURBED ACCURACIES
+
+B.1 IM A G ENE T-VI D-RO B U S T
+
+
Model
Accuracy Original
Accuracy Perturbed
△
resnet152_finetuned
84.8 [82.5, 86.8]
70.2 [67.4, 72.8]
14.6
resnet50_finetuned
80.8 [78.3, 83.1]
65.7 [62.9, 68.5]
15.1
vgg16bn_finetuned
78.0 [75.4, 80.4]
61.0 [58.1, 63.9]
17.0
nasnetalarge_imagenet_pretrained
77.6 [75.1, 80.1]
62.1 [59.2, 65.0]
15.5
resnet50_detection
77.6 [75.1, 80.1]
65.0 [62.1, 67.8]
12.6
inceptionresnetv2_imagenet_pretrained
75.7 [73.1, 78.2]
58.7 [55.7, 61.6]
17.0
dpn107_imagenet_pretrained
75.6 [72.9, 78.1]
59.1 [56.1, 62.0]
16.5
inceptionv4_imagenet_pretrained
75.3 [72.6, 77.8]
59.0 [56.0, 61.9]
16.3
dpn92_imagenet_pretrained
74.4 [71.7, 76.9]
56.8 [53.8, 59.7]
17.6
dpn131_imagenet_pretrained
74.0 [71.3, 76.6]
59.9 [56.9, 62.8]
14.1
dpn68b_imagenet_pretrained
73.7 [71.0, 76.2]
54.0 [51.0, 57.0]
19.7
resnext101_32x4d_imagenet_pretrained
73.3 [70.6, 75.9]
57.2 [54.2, 60.1]
16.1
resnext101_64x4d_imagenet_pretrained
72.9 [70.1, 75.5]
56.6 [53.7, 59.6]
16.3
resnet152_imagenet_pretrained
72.8 [70.0, 75.4]
57.0 [54.0, 59.9]
15.8
resnet1O1_imagenet_pretrained
71.5 [68.7, 74.1]
53.7 [50.8, 56.7]
17.8
fbresnet152_imagenet_pretrained
71.5 [68.7, 74.1]
54.5 [51.5, 57.4]
17.0
densenet161_imagenet_pretrained
71.4 [68.7, 74.1]
55.1 [52.1, 58.1]
16.3
densenet169_imagenet_pretrained
70.2 [67.5, 72.9]
53.1 [50.1, 56.1]
17.1
densenet2O1_imagenet_pretrained
70.2 [67.5, 72.9]
53.4 [50.4, 56.4]
16.8
dpn68_imagenet_pretrained
69.4 [66.6, 72.1]
53.3 [50.3, 56.3]
16.1
bninception_imagenet_pretrained
69.0 [66.2, 71.7]
49.0 [46.0, 51.9]
20.0
densenet121_imagenet_pretrained
69.0 [66.2, 71.7]
50.9 [47.9, 53.8]
18.1
nasnetamobile_imagenet_pretrained
68.8 [66.0, 71.5]
48.4 [45.4, 51.4]
20.4
resnet50_augment_ jpeg_compression
68.8 [66.0, 71.5]
53.2 [50.2, 56.2]
15.6
resnet34_imagenet_pretrained
68.0 [65.2, 70.7]
48.0 [45.0, 51.0]
20.0
resnet50_augment impulse_noise
67.7 [64.9, 70.5]
50.2 [47.2, 53.2]
17.5
resnet50_augment_gaussian_blur
67.7 [64.9, 70.5]
52.5 [49.5, 55.5]
15.2
resnet5O_imagenet_pretrained
67.5 [64.7, 70.3]
52.5 [49.5, 55.5]
15.0
resnet50_augment gaussian_noise
67.4 [64.5, 70.1]
50.6 [47.6, 53.6]
16.8
resnet50_augment shot_noise
66.5 [63.6, 69.2]
51.1 [48.1, 54.1]
15.4
vgg16_bn_imagenet_pretrained
66.4 [63.5, 69.1]
47.4 [44.5, 50.4]
19.0
resnet50_augment_ _defocus_blur
66.3 [63.4, 69.1]
47.6 [44.6, 50.6]
18.7
vgg19_bn_imagenet_pretrained
65.6 [62.7, 68.4]
46.6 [43.6, 49.6]
19.0
+
+Table 5: Classification model perturbed and original accuracies for all models in our test bed evaluated on the ImageNet-Vid-Robust dataset.
+
+
vgg19_imagenet_pretrained
63.2 [60.3, 66.1]
45.4 [42.4, 48.3]
17.8
resnet18_imagenet_pretrained
61.9 [59.0, 64.8]
41.5 [38.6, 44.4]
20.4
vgg13_bn_imagenet_pretrained
61.9 [59.0, 64.8]
43.3 [40.3, 46.3]
18.6
vgg16_imagenet_pretrained
61.4 [58.5, 64.3]
43.1 [40.2, 46.1]
18.3
vgg11_bn_imagenet_pretrained
60.9 [57.9, 63.8]
43.2 [40.3, 46.2]
17.7
vgg13_imagenet_pretrained
59.6 [56.6, 62.5]
41.1 [38.2, 44.1]
18.5
vgg11_imagenet_pretrained
57.3 [54.4, 60.3]
41.3 [38.4, 44.3]
16.0
alexnet_finetuned
57.3 [54.3, 60.2]
43.6 [40.7, 46.6]
13.7
ResNeXtDenoiseAll-101_robust_pgd
54.3 [51.3, 57.2]
40.8 [37.8, 43.7]
13.5
squeezenet1_1_imagenet_pretrained
49.8 [46.8, 52.8]
31.7 [28.9, 34.5]
18.1
alexnet_imagenet_pretrained
49.4 [46.4, 52.4]
32.0 [29.3, 34.8]
17.4
resnet50_augment contrast_change
38.3 [35.5, 41.3]
23.3 [20.8, 25.9]
15.0
+
+# B.2 YTBB-RO B U S T
+
+
Model
Accuracy Original
Accuracy Perturbed
△
resnet152_finetuned
92.9 [91.2, 94.3]
84.7 [82.4, 86.8]
8.2
resnet50_finetuned
91.4 [89.6, 93.0]
82.0 [79.6, 84.2]
9.4
inceptionresnetv2_finetuned
91.3 [89.5, 92.9]
79.0 [76.4, 81.3]
12.3
vgg19_finetuned
90.5 [88.6, 92.2]
79.1 [76.5, 81.4]
11.4
vgg16_finetuned
89.1 [87.1, 90.8]
78.0 [75.4, 80.4]
11.1
inceptionv4_finetuned
88.5 [86.5, 90.3]
76.3 [73.6, 78.7]
12.2
resnet18_finetuned
88.0 [85.9, 89.8]
76.2 [73.6, 78.7]
11.8
alexnet_finetuned
80.6 [78.2, 82.9]
64.4 [61.5, 67.3]
16.2
pnasnet5large_imagenet_pretrained
65.2 [62.3, 68.0]
51.0 [48.0, 54.0]
14.2
nasnetalarge_imagenet_pretrained
64.9 [62.0, 67.7]
51.4 [48.4, 54.4]
13.5
inceptionresnetv2_imagenet_pretrained
64.5 [61.6, 67.4]
50.4 [47.5, 53.4]
14.1
dpn98_imagenet_pretrained
64.1 [61.2, 66.9]
49.0 [46.0, 52.0]
15.1
dpn107_imagenet_pretrained
64.1 [61.2, 66.9]
50.1 [47.2, 53.1]
14.0
dpn131_imagenet_pretrained
64.0 [61.1, 66.8]
49.9 [46.9, 52.9]
14.1
inceptionv4_imagenet_pretrained
63.6 [60.7, 66.4]
48.8 [45.8, 51.8]
14.8
Xception_imagenet_pretrained
63.2 [60.2, 66.0]
47.6 [44.6, 50.6]
15.6
dpn92_imagenet_pretrained
62.3 [59.3, 65.1]
47.7 [44.8, 50.7]
14.6
resnet50_augment_jpeg_compressioon
62.3 [59.4, 65.2]
45.7 [42.8, 48.7]
16.6
polynet_imagenet_pretrained
61.4 [58.4, 64.3]
47.3 [44.4, 50.3]
14.1
nasnetamobile_imagenet_pretrained
61.4 [58.4, 64.3]
43.0 [40.1, 46.0]
18.4
resnet50_augment__shot_noise
61.3 [58.3, 64.2]
46.4 [43.4, 49.3]
14.9
dpn68_imagenet_pretrained
61.2 [58.3, 64.1]
44.2 [41.2, 47.2]
17.0
fbresnet152_imagenet_pretrained
61.1 [58.1, 64.0]
45.9 [42.9, 48.8]
15.2
resnet152_imagenet_pretrained
60.8 [57.8, 63.7]
46.5 [43.5, 49.5]
14.3
resnet101_imagenet_pretrained
60.8 [57.8, 63.7]
45.2 [42.2, 48.2]
15.6
senet154_imagenet_pretrained
60.7 [57.7, 63.6]
47.2 [44.3, 50.2]
13.5
resnet50_augment__impulse_noise
60.6 [57.7, 63.5]
45.5 [42.6, 48.5]
15.1
se_resnet101_imagenet_pretrained
60.5 [57.6, 63.4]
45.6 [42.6, 48.6]
14.9
bninception_imagenet_pretrained
60.4 [57.4, 63.3]
41.8 [38.9, 44.7]
18.6
densenetl61_imagenet_pretrained
60.2 [57.3, 63.1]
46.4 [43.4, 49.4]
13.8
resnet50_augment_gaussian_noise
60.2 [57.3, 63.1]
45.7 [42.8, 48.7]
14.5
se_resnext50_32x4d_imagenet_pretrained
59.9 [56.9, 62.8]
45.7 [42.7, 48.6]
14.2
dpn68b_imagenet_pretrained
59.7 [56.7, 62.6]
45.9 [42.9, 48.8]
13.8
inceptionv3_imagenet_pretrained
59.6 [56.6, 62.5]
43.8 [40.8, 46.8]
15.8
densenet121_imagenet_pretrained
59.5 [56.5, 62.4]
43.1 [40.1, 46.0]
16.4
se_resnext101_32x4d_imagenet_pretrained
59.2 [56.3, 62.1]
45.2 [42.3, 48.2]
14.0
densenet2O1_imagenet_pretrained
59.2 [56.2, 62.1]
44.8 [41.8, 47.8]
14.4
densenet169_imagenet_pretrained
59.2 [56.2, 62.1]
44.6 [41.7, 47.6]
14.6
+
+Table 6: Classification model perturbed and original accuracies for all models in our test bed evaluated on the YTBB-robust dataset..
+
+
resnet50_augment__brightness_change
58.9 [56.0, 61.8]
42.6 [39.6, 45.5]
16.3
se_resnet50_imagenet_pretrained
58.8 [55.9, 61.7]
44.1 [41.1, 47.1]
14.7
se_resnet152_imagenet_pretrained
58.8 [55.9, 61.7]
44.8 [41.9, 47.8]
14.0
cafferesnetlO1_imagenet_pretrained
58.2 [55.2, 61.1]
44.3 [41.3, 47.3]
13.9
resnet50_augment__regular
58.0 [55.1, 61.0]
42.9 [39.9, 45.8]
15.1
resnet34_imagenet_pretrained
57.9 [55.0, 60.9]
42.8 [39.8, 45.7]
15.1
vgg19_imagenet_pretrained
57.5 [54.6, 60.5]
40.1 [37.2, 43.1]
17.4
resnet50_augment t_gaussian_blur
57.5 [54.5, 60.4]
41.8 [38.9, 44.7]
15.7
vgg16_bn_imagenet_pretrained
57.2 [54.2, 60.1]
39.6 [36.7, 42.6]
17.6
resnet5O_imagenet_pretrained
57.0 [54.1, 60.0]
43.8 [40.9, 46.8]
13.2
vgg19_bn_imagenet_pretrained
56.8 [53.9, 59.8]
40.6 [37.7, 43.5]
16.2
vgg16_imagenet_pretrained
55.4 [52.4, 58.4]
40.1 [37.2, 43.1]
15.3
vgg13_bn_imagenet_pretrained
54.8 [51.8, 57.7]
38.6 [35.7, 41.6]
16.2
vgg11_bn_imagenet_pretrained
54.8 [51.8, 57.7]
38.8 [35.9, 41.8]
16.0
vgg11_imagenet_pretrained
54.7 [51.7, 57.6]
38.4 [35.5, 41.3]
16.3
resnetl8_imagenet_pretrained
54.4 [51.4, 57.4]
38.1 [35.2, 41.0]
16.3
vgg13_imagenet_pretrained
54.2 [51.3, 57.2]
37.7 [34.9, 40.7]
16.5
ResNeXtDenoiseAll-101_robust_pgd
53.6 [50.7, 56.6]
43.2 [40.2, 46.1]
10.4
squeezenet1_O_imagenet_pretrained
51.1 [48.1, 54.1]
33.1 [30.3, 36.0]
18.0
squeezenetl_1_imagenet_pretrained
48.6 [45.6, 51.6]
31.3 [28.6, 34.2]
17.3
resnet50_augment__defocus_blur
48.4 [45.4, 51.4]
29.1 [26.4, 31.8]
19.3
alexnet_imagenet_pretrained
45.3 [42.4, 48.3]
30.5 [27.8, 33.3]
14.8
+
+# C MODEL INDEPENDENT DISTRIBUTION SHIFT
+
+Though the distribution shift we induced in our study were model dependent because we found the worst neighbor frame for each model, we could study the same problem but impose a static set of perturbed frames across all models. In Figure 6 we study this static set of perturbations across all models and see a substantial (but smaller) drop in accuracy for both models. The static set of perturbations were chosen by choosing the neighbor frame that the largest number of models classified incorrectly.
+
+
+Figure 6: Model accuracy on original vs. perturbed images for a static set of perturbed frames across all models. The grey points and grey linear fit correspond to the perturbed accuracies of models evaluated on per model perturbations studied in Figure 3
+
+# D PER CLASS ANALYSIS
+
+We study the effect of our perturbations on the 30 classes in ImageNet-Vid-Robust and YTBB-Robust to determine whether the performance drop was concentrated in a few “hard” classes.
+
+
+Figure 7: Per-class accuracy statistics for our best performing classification model (fine-tuned ResNet152) on ImageNet-Vid-Robust and YTBB-Robust. For Youtube-BB, note that ‘zebra’ is the least common label, present in only 24 anchor frames sampled by Gu et al. (2019), of which 4 are included in our dataset.
+
+Figure 7 shows the original and perturbed accuracies across classes for our best performing model (a fine-tuned ResNet-152). Although there are a few particularly difficult classes for perturbed accuracy (e.g., lion or monkey on ImageNet-Vid-Robust), the accuracy drop is spread across most classes. On ImageNet-Vid-Robust, this model saw a total drop of $1 4 . 4 \%$ between original and perturbed images and a median drop of $1 4 . 0 \%$ in per-class accuracy. On YTBB-Robust, the total drop was $8 . 9 \%$ and the median drop was $6 . 7 \%$ .
+
+# E PER-FRAME CONDITIONAL ROBUSTNESS METRIC INTRODUCED IN GU ET AL. (2019)
+
+
+Figure 8: Conditional robustness metric from Gu et al. (2019) on perturbed frames as a function of perturbation distance on ImageNet-Vid-Robust and YTBB-Robust. Model accuracies from five different model types and the best performing model are shown. The model architecture is ResNet-50 unless otherwise mentioned.
+
+In concurrent work, the authors of Gu et al. (2019) considered a different metric of robustness. In this section, we compute this metric on all models in our test bed to compare our findings to $\mathrm { G u }$ et al. (2019). There are two main differences between PM- $\mathbf { \nabla } \cdot \mathbf { k }$ and the robustness metric in Gu et al. (2019).
+
+1. For two visually similar “neighbor” frames $I _ { 0 }$ and $I _ { 1 }$ with true label $Y$ and classifier $f$ , Gu et al. (2019) studies the conditional probability $P ( f ( I _ { 1 } ) = y | f ( I _ { 0 } ) = y )$ 2. While PM-k looks for errors in all neighbor frames in a neighborhood of $k$ frames away from the anchor frame (so this would include frames $1 , 2 , \ldots , \mathbf { k }$ frames away), Gu et al. (2019) only considers errors from exactly $\mathbf { k }$ frames away.
+
+In Fig. 9 we illustrate simple example where two videos can have the same behavior for the metric introduced by Gu et al. (2019) but drastically different behavior for the PM-kmetric.
+
+
+Figure 9: For the two example videos above the score from Gu et al. (2019) metric (Accuracy $\ @ \mathrm { ~ K ~ }$ ) is identical, but the PM- $\mathbf { \nabla } \cdot \mathbf { k }$ metric behaves substantially differently when the errors are spread across many independent videos, as shown in the right example
+
+# F $\ell _ { \infty }$ DISTANCE VS PM-K ACCURACY
+
+$\ell _ { \infty }$ adversarial examples are well studied in the robustness community, yet the connection between $\ell _ { \infty }$ and other forms of more “natural” robustness is unclear. Here, we plot the cumulative distribution of the $\ell _ { \infty }$ distance between pairs of nearby frames in our datasets. In Figure 10, we show the CDF of $\ell _ { \infty }$ distance for all pairs, all reviewed pairs, and mistakes made by 3 indicative models. Note the fbrobust model is trained specifically to be robust to $\ell _ { \infty }$ adversaries.
+
+
+Figure 10: CDF showing the $\ell _ { \infty }$ distance between pairs of frames from different distributions.
+
+Table 7: Analyzing results based on frame-type in video compression. See Appendix H.1 for details.
+
+
Original Acc.
Perturbed Acc.
A
# anchor frames
All frames
84.8
70.2
14.6
1109
w/o‘i-frames'
84.7
70.3
14.4
1104
w/o ‘ ‘p-frames'
83.9
73.7
10.2
415
w/o ‘b-frames'
85.4
73.2
12.2
699
+
+# G PM-K ACCURACY WITH VARYING K
+
+G.1 IM A G ENE T-VI D-RO B U S T
+
+
+Figure 11: Model classification accuracy on perturbed frames as a function of perturbation distance (shown with $9 5 \%$ Clopper-Pearson confidence intervals). Model accuracies from five different model types and the best performing model are shown. The model architecture is ResNet-50 unless otherwise mentioned.
+
+In Figure 11, we plot the relationship between $\mathrm { a c c } _ { \mathrm { p m k } }$ and perturbation distance (i.e., the $\mathrm { k }$ in the $\mathrm { p m - k }$ metric). The entire $\mathbf { X }$ -axis in Figure 11 corresponds to a temporal distance of at most 0.3 seconds between the original and perturbed frames.
+
+# H I-FRAMES AND P-FRAMES
+
+# H.1 IM A G ENE T-VI D-RO B U S T
+
+One possible concern with analyzing performance on video frames is the impact of video compression on model robustness. In particular, the videos in ImageNet-Vid-Robust contain 3 different frame types: ‘i-frames’, ‘p-frames’, and ‘b-frames’. ‘p-frames’ are compressed by referencing pixel content from previous frames, while ‘b-frames’ are compressed via references to previous and future frames. ‘i-frames’ are stored without references to other frames.
+
+We compute the original and perturbed accuracies, and the drop in accuracy for a subset of the dataset without ‘i-frames’, a subset without ‘p-frames’, and a subset without ‘b-frames’ in Table 7. While there are modest differences in accuracy due to compression, this analysis suggests that the sensitivity of models is not significantly due to the differences in quality of frames due to video compression.
+
+# I FPS ANALYSIS
+
+# I.1 IM A G ENE T-VI D-RO B U S T
+
+To analyze the impact of frame-rate on accuracy, we show results on subsets of videos with fixed fps (25, 29, and 30, which cover $89 \%$ of the dataset) using a fine-tuned ResNet-152 model in Table 8. The accuracy drop is similar across the subsets, and similar to the drop for the whole dataset.
+
+
FPS
Acc. Orig.
Acc.Perturbed
Drop
# Videos
25
87.3 [83.0, 90.9]
73.3
[67.8, 78.3]
14.0
292
29
87.7 [84.0, 90.8]
74.9
[70.3, 79.2]
12.8
383
30
78.3 [73.3, 82.7]
61.7 [56.0, 67.1]
16.6
313
+
+Table 8: Results on subsets of ImageNet-Vid-Robust with fixed FPS.
+
+# J ILSVRC TRAINING WITH IM A G ENE T-VI D-RO B U S T CLASSES
+
+We trained ResNet-50 from scratch on ILSVRC using the 30 ImageNet-Vid classes. We also finetuned the model on ImageNet-Vid. In Table 9, we show the accuracy drops are consistent with models in our submission. We hypothesize that the lower accuracy is due to coarser supervision on ILSVRC.
+
+
Model
Acc. Orig.
Acc. Perturbed
Drop
ILSVRC-30
61.0
44.9
15.1
ILSVRC-30 + FT
77.8
59.9
17.9
+
+Table 9: Results of training ResNet-50 on ILSVRC with 30 classes from ImageNet-Vid-Robust.
+
+# K EXPERIMENTAL DETAILS & HYPERPARAMETERS
+
+All classification experiments were carried out using PyTorch version 1.0.1 on an AWS p3.2xlarge with the NVIDIA V100 GPU. All pretrained models were downloaded from Cadene at commit hash $0 2 1 \mathtt { d } 9 7 8 9 7 \mathtt { c } 9 \mathtt { a } \mathtt { a } 7 6 \mathtt { e } \mathtt { c } 7 5 9 \mathtt { d } \mathtt { e } \mathtt { f } \mathtt { f } 4 3 \mathtt { d } 3 4 1 \mathtt { c } 4 \mathtt { f } \mathtt { d } 4 5 \mathtt { d } 7 \mathtt { b } \mathtt { a } .$ Evaluations in Table ?? all use the default settings for evaluation. The hyperparameters for the fine-tuned models are presented in Table 10. We searched for learning rates between $1 0 ^ { - 3 }$ and $1 0 ^ { - 5 }$ for all models.
+
+We additionally detail hyperparameters for detection models in Table 11. Detection experiments were conducted with PyTorch version 1.0.1 on a machine with 4 Titan X GPUs, using the Mask R-CNN benchmark repositoryMassa and Girshick (2018). We used the default learning rate provided in Massa and Girshick (2018). For R-FCN, we used the model trained by Xiao and Jae Lee (2018).
+
+Table 10: Hyperparameters for models finetuned on ImageNet-Vid,
+Table 11: Hyperparameters for detection models.
+
+
Model
Base Learning Rate
Learning Rate Schedule
Batch Size
Epochs
resnet152
10-4
Reduce
LR On Plateau
32
10
resnet50
10-4
Reduce
LR On Plateau
32
10
alexnet
10-5
Reduce
LR On Plateau
32
10
vgg16
10-5
Reduce
LR On Plateau
32
10
+
+
Model
Base Learning Rate
Learning Rate Schedule
Batch Size
Iterations
F-RCNN ResNet-50
10-2
Step 20k,30k
8
40k
F-RCNN ResNet-101
10-2
Step 20k,30k
8
40k
+
+# L DETECTION PM-K
+
+We briefly introduce the mAP metric for detection here and refer the reader to Lin et al. for further details. The standard detection metric proceeds by first determining whether each predicted bounding box in an image is a true or false positive, based on the intersection over union (IoU) of the predicted and ground truth bounding boxes. The metric then computes the per-category average precision (AP, averaged over recall thresholds) of the predictions across all images. The final metric is reported as the mean of these per-category APs (mAP).
+
+We define the $\mathrm { p m - k }$ analog of mAP by replacing each anchor frame in the dataset with a nearby frame that minimizes the per-image average precision. Since the category-specific average precision is undefined for categories not present in an image, we minimize the average precision across categories present in each frame rather than the mAP.
\ No newline at end of file
diff --git a/md/train/TmLqkYn71gV/TmLqkYn71gV.md b/md/train/TmLqkYn71gV/TmLqkYn71gV.md
new file mode 100644
index 0000000000000000000000000000000000000000..b974914743416a2c57af554ecaa1d907be9277e7
--- /dev/null
+++ b/md/train/TmLqkYn71gV/TmLqkYn71gV.md
@@ -0,0 +1,263 @@
+# Learning to Iteratively Solve Routing Problems with Dual-Aspect Collaborative Transformer
+
+Yining $\mathbf { M } \mathbf { a } ^ { 1 }$ , Jingwen $\mathbf { L i } ^ { 1 }$ , Zhiguang $\mathbf { C a o ^ { 2 , * } }$ , Wen Song3,∗, Le Zhang4, Zhenghua Chen5, Jing Tang6
+
+1National University of Singapore 2Singapore Institute of Manufacturing Technology, A\*STAR 3Institute of Marine Science and Technology, Shandong University 4University of Electronic Science and Technology of China 5Institute for Infocomm Research, A\*STAR 6The Hong Kong University of Science and Technology {yiningma, lijingwen}@u.nus.edu, zhiguangcao@outlook.com, wensong@email.sdu.edu.cn, zhangleuestc@gmail.com, chen0832@e.ntu.edu.sg, jingtang@ust.hk
+
+# Abstract
+
+Recently, Transformer has become a prevailing deep architecture for solving vehicle routing problems (VRPs). However, it is less effective in learning improvement models for VRP because its positional encoding (PE) method is not suitable in representing VRP solutions. This paper presents a novel Dual-Aspect Collaborative Transformer (DACT) to learn embeddings for the node and positional features separately, instead of fusing them together as done in existing ones, so as to avoid potential noises and incompatible correlations. Moreover, the positional features are embedded through a novel cyclic positional encoding (CPE) method to allow Transformer to effectively capture the circularity and symmetry of VRP solutions (i.e., cyclic sequences). We train DACT using Proximal Policy Optimization and design a curriculum learning strategy for better sample efficiency. We apply DACT to solve the traveling salesman problem (TSP) and capacitated vehicle routing problem (CVRP). Results show that our DACT outperforms existing Transformer based improvement models, and exhibits much better generalization performance across different problem sizes on synthetic and benchmark instances, respectively.
+
+# 1 Introduction
+
+Vehicle Routing problems (VRPs), such as the Traveling Salesman Problem (TSP) and the Capacitated Vehicle Routing Problem (CVRP) which consider finding the optimal route for a single or fleet of vehicles to serve a set of customers, have ubiquitous real-world applications [1, 2]. Despite being intensively studied in the Operations Research (OR) community, VRPs still remain challenging due to their NP-hard nature [3]. Recent studies on learning neural heuristics are gathering attention as promising extensions to traditional hand-crafted ones (e.g., [4–14]), where reinforcement learning (RL) [15] is usually exploited to train a deep neural network as an efficient solver without hand-crafted rules. A salient motivation is that deep neural networks may learn better heuristics by identifying useful patterns in an end-to-end and data-driven fashion.
+
+Solutions to VRPs, i.e., routes, are sequences of nodes (customer and depot locations). Naturally, deep models for Natural Language Processing (NLP), which deal with sequence data as well, are ideal choices for encoding VRP solutions. Given its remarkable performance in NLP tasks, Transformer [16] is standing at the forefront in the learning based methods for VRPs (e.g., [5, 7, 8, 11–13, 17]). The original Transformer encodes a sentence, i.e., a sequence of words, into a unified set of embeddings by injecting word positional information into its word embeddings through positional encoding (PE). When it comes to VRPs, while is not required in construction models, positional information is critical for deep models that learn improvement heuristics since the input are solutions to be improved.
+
+
+Figure 1: Transformer frameworks for VRPs. (a) $\mathrm { W u }$ et al. [11] (the original one); (b) DACT (ours).
+
+Although some success has been achieved, learning improvement heuristics for VRPs based on the original Transformer encoder is yet lacking from our perspective. Firstly, directly applying addition operation on PE vectors and the embeddings in absolute PE method (i.e., Figure 1(a)) could limit the representation of the model [18], as the mixed correlations2 existing in the self-attention can bring unreasonable noises and random biases to the encoder (details in Appendix A). Secondly, existing PE methods tend to fuse the node and positional information into one unified representation. NLP tasks such as translation may benefit from this owing to the deterministic and instructive nature of the positional information. However, such design may not be optimal for routing tasks because the positional information therein can be non-deterministic and sometimes even random. This may cause disharmony or disturbance in the encoder and may thus deteriorate the performance. Finally, most VRPs seek the shortest loop of the nodes, making their solutions to be cyclic sequences. However, existing PE methods are only designated to encode linear sequences3, which may fail to identify such circular input. As will be shown in our experiments, this could severely damage the generalization performance, since the cyclic feature of VRP solutions is not correctly reflected by the encoder.
+
+In this paper, we address the above issues and contribute to the line of using RL to learn neural improvement heuristics for VRPs. We introduce the Dual-Aspect Collaborative Transformer (DACT), where we revisit the solution representations and propose to learn separated groups of embeddings for the node and positional features of a VRP solution as shown in Figure 1(b). Our DACT follows the encoder-decoder structure. In the encoder, each set of embeddings encodes the solution mainly from its own aspect, and at the same time exploits a cross-aspect referential attention mechanism for better perceiving the consistence and differentiation with respect to the other aspect. The decoder then collects action distribution proposals from the two aspects and synthesizes them to output the final one. Meanwhile, we design a novel cyclic positional encoding (CPE) method to capture the circularity and symmetry of VRP solutions, which allows Transformer to encode cyclic inputs, and also boost the generalization performance for solving VRPs. As the last contribution, we design a simple yet effective curriculum learning strategy to improve the sample efficiency. This further leads to faster and more stable convergence of RL training. Extensive experiments show that our DACT can outperform existing Transformer based improvement models with fewer parameters, and also generalizes well across different sizes of synthetic and benchmark instances, respectively.
+
+# 2 Related work
+
+# 2.1 Positional encoding (PE) in Transformer.
+
+The original Transformer adopted the absolute PE method to describe the absolute position of elements in the sequence [16], especially for NLP. As formulated in Eq. (1), each generated positional embedding $p _ { i } \in \mathbb { R } ^ { d }$ is added together with the $i$ -th word embedding $x _ { i }$ in the first layer of the encoder,
+
+$$
+\alpha _ { i , j } ^ { \mathrm { A b s } } = \frac { 1 } { \sqrt { d } } ( ( x _ { i } + p _ { i } ) W ^ { Q } ) ( ( x _ { j } + p _ { j } ) W ^ { K } ) ^ { T } .
+$$
+
+The relative PE method was further proposed in Shaw et al. [19] to better capture the relative order information. On the basis of absolute PE, it introduces an inductive bias to the attention as follows,
+
+$$
+\alpha _ { i , j } ^ { \mathrm { R e l } } = \frac { 1 } { \sqrt { d } } ( ( x _ { i } + p _ { i } ) W ^ { Q } ) ( ( x _ { j } + p _ { j } ) W ^ { K } + a _ { j - i } ) ^ { T } ,
+$$
+
+where $a _ { j - i } \in \mathbb { R } ^ { d }$ is learnable parameters for encoding the relative position $j - i$ . To avoid the mixed and noisy correlations between word semantics and positional information in the above two PEs, the Transformer with United Positional Encoding (TUPE) [18] was proposed for NLP which utilizes separated projection metrics $W _ { x }$ and $W _ { p }$ for each information as follows,
+
+$$
+\alpha _ { i , j } ^ { \mathrm { T U P E } } = \frac { 1 } { \sqrt { 2 d } } ( x _ { i } W _ { x } ^ { Q } ) ( x _ { j } W _ { x } ^ { K } ) ^ { T } + \frac { 1 } { \sqrt { 2 d } } ( p _ { i } W _ { p } ^ { Q } ) ( p _ { j } W _ { p } ^ { K } ) ^ { T } + b _ { j - i } .
+$$
+
+However, as mentioned previously, existing PE methods are less effective for VRPs since they simply fuse the node and positional information into one unified set of embeddings during or after the calculation of the attention correlation $\alpha _ { i , j }$ . Meanwhile, they are also unable to properly encode and handle cyclic input sequences as in VRP solutions.
+
+# 2.2 Deep models for VRP.
+
+Various deep architectures such as Recurrent Neural Network (RNN), Graph Neural Network (GNN), and Transformer have been employed in solving VRPs.
+
+RNN based models. As the pioneering work of neural VRP solvers, Pointer Network adopted RNN and supervised learning to solve TSP [20] (extended to RL in Bello et al. [21] and CVRP in Nazari et al. [22]). While the models in [20–23] learn construction heuristics, NeuRewriter [4] learns improvement heuristic for CVRP using LSTM to encode the positional information of a solution. In Hottung et al. [13], the conditional variational autoencoder was adopted to learn a continuous and latent search space for VRP, where high-quality solutions were taken as input and encoded by RNNs. However, recurrence structures in RNN are less efficient in both representation and computation [5].
+
+GNN based models. In Dai et al. [24], GNN was combined with Q-learning for solving TSP. Based on supervised learning, Joshi et al. [6] used GNN to learn heatmaps that prescribe the probability of each edge appearing in the optimal TSP tour. This idea was extended in Fu et al. [25] with additional components such as graph sampling and heatmap merging to enable generalization to larger TSP instances. These models often require post-processing to construct feasible solutions from heatmaps (e.g., beam search [6], Monte-Carlo tree search [25], and dynamic programming [26]).
+
+Transformer based models. The Attention Model (AM) by Kool et al. [5] was recognized as the first success of Transformer based models for VRPs. Based on AM, Xin et al. [7] proposed a MultiDecoder AM that learns multiple diverse policies for better performance. In Kwon et al. [8], the RL algorithm of AM was improved which leaded to a new solver, i.e., POMO (Policy Optimization with Multiple Optima), and achieved the state-of-the-art performance. However, POMO is still lacking in generalization. Besides these construction models, Transformer was also explored to learn improvement heuristics. Hottung and Tierney [27] learned first neural large neighborhood search algorithm for VRPs. Lu et al. [12] proposed the L2I model that learns to select local search operators from a pool of traditional ones. Both methods used a Transformer-style encoder, but the positional information is captured in the node features (information of previous and next nodes) instead of using PE methods. Though L2I was shown to outperform LKH3 [28], it is limited to CVRP and the required time is considerably long. Wu et al. [11] proposed a Transformer model which learns to pick node pair in each step to perform a pairwise local operator (e.g., 2-opt). However, it suffers from the inaccurate representation of positional information given the original Transformer encoder.
+
+
+Figure 3: Architecture of our policy network, dual-aspect collaborative Transformer (DACT).
+
+# 3 Problem formulation
+
+We define a VRP instance as a group of $N$ nodes to visit, where the node feature $x _ { i }$ of node $i$ contains 2-dim coordinates and other problem-specific features (e.g., customer demand). A solution $\delta$ consists of a sequence of nodes visited in order where we denote $p _ { i }$ to be the position (indices) of node $i$ in the solution which is deemed as the positional feature of node $i$ . The objective is to minimize the total travel distance $D ( \delta )$ under certain problem-specific constraints.
+
+Starting with an initial yet complete solution, our neural RL policy tries to improve the solution iteratively. At each step, the policy automatically selects a pair of nodes and locally adjusts the solution using a preset pairwise operator such as 2-opt, insert, or swap. As illustrated in Figure 2, given a node pair $( i , j )$ , the 2-opt operator adjusts a solution by reversing the segment between node $i$ and node $j$ ; the insert operator adjusts a solution by placing node $i$ after node $j$ ; and the swap operator adjusts a solution by exchanging the position of node $i$ and node $j$ . Such operation is repeated until reaching the step limit $T$ and we model it in the form of Markov Decision Process (MDP) as follows.
+
+
+Figure 2: Illustration examples of three pairwise operators for routing problems when node pair $( i = 2 , j = 1 )$ ) is specified for operating. From left to right: 2-opt, insert, and swap.
+
+State. For an instance with $N$ nodes, a state describes current solution $\delta _ { t }$ using its node and positional features of each node, i.e., $s _ { t } = \Psi ( \delta _ { t } ) = \{ x _ { 1 } ^ { t } , . . . , x _ { N } ^ { t } , p _ { 1 } ^ { t } , . . . , p _ { N } ^ { t } \}$ .
+
+Action. The action $a _ { t } = ( i , j )$ specifies a node pair $( i , j )$ for the pairwise operator.
+
+Reward. The reward function is defined as, $r _ { t } = D ( \delta _ { t } ^ { * } ) - m i n \left[ D ( \delta _ { t + 1 } ) , D ( \delta _ { t } ^ { * } ) \right]$ where $\delta _ { t } ^ { * }$ is the best incumbent solution found until time $t$ . It refers to the immediate reduced cost at each step with respects to the best incumbent solution, which ensures the cumulative reward equal to the total reduced cost over the initial solution. Hence the reward $r _ { t } > 0$ if and only if a better solution is found. Policy. The policy $\pi _ { \theta }$ is parameterized by the proposed DACT model with parameters $\theta$ . At each time step, the action $( i , j )$ is obtained by sampling the stochastic policy for both training and inference.
+
+Transition. The next state $s _ { t + 1 }$ is originated from $s _ { t }$ by performing the preset pairwise operator on the given node pair (action). Our state transient is deterministic, in the sense that it always accepts the next solution as the next state (infeasible solutions will be masked), regardless of its objective value. With such simple rule, the RL agent is expected to automatically learn how to combine multiple steps of simple local movements to achieve better solutions, even if some of them may worsen the current solution. Note that the step limit $T$ can be any user-specified value according to the allowed time budget. Hence, our MDP can have infinite horizon and we consider the reward discount factor $\gamma < 1$ .
+
+# 4 Dual-aspect collaborative Transformer model
+
+We now present the details of our Dual-Aspect Collaborative Transformer (DACT). The concrete architecture of DACT is presented in Figure 3, where we take the TSP with $N$ nodes as an illustration example. Our DACT leverages separate aspects of embeddings to encode a VRP solution. In the DAC encoder, the self-attention correlations are computed individually for each aspect, and a cross-aspect referential attention mechanism is proposed to enable one aspect to effectively exploit attention correlations from the other aspect as optional references. The DAC decoder then collects action distribution proposals from both aspects and synthesize them to the final one.
+
+
+Figure 5: Comparison of our CPE method with absolute PE method on a TSP instance with 20 nodes. (a) the embedding vectors, (b) the correlations (dot products) between every two embeddings, and (c) the top two principal components after PCA (principal component analysis) projection.
+Figure 4: An example of cyclic Gray code where 4 digits are used to encode $N { = } 1 6$ nodes. The top left shows the base symmetry pattern $\cdot _ { 1 0 0 1 }$ ’ in Gray code, and the top right plots its representation in our method.
+
+# 4.1 Dual-aspect solution representation
+
+Specifically, we propose to learn two sets of embeddings, i.e., the node feature embeddings (NFEs) for node representation and the positional feature embeddings (PFEs) for positional representation.
+
+NFEs. Following [5, 11], the NFE $h _ { i }$ of node $i$ is initialized as the linear projection of its node feature $x _ { i }$ with output dimension4 $d i m = 6 4$ .
+
+PFEs. The PFE $g _ { i }$ of the positional feature $p _ { i }$ is initialized as a real-valued vector $( d i m = 6 4 )$ by applying our cyclic positional encoding (CPE), which is designed based on cyclic Gray codes [29].
+
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
11
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
+
+As illustrated in Figure 4, the cyclic Gray codes present a cyclic property (‘1110’ in the last column is adjacent to ‘1111’ in the first column) and an adjacency similarity property (any codes in adjacent columns only differ in one digit), both of which are desirable for cyclic sequences. To preserve these properties in designing our CPE, we follow two observed patterns: 1) each numerical digit contains a periodic cycle with reflectional symmetry, e.g., the $\mathbf { \dot { \rho } } _ { 1 0 | 0 1 } ,$ in the lowest digit; and 2) the higher the numerical digit, the longer the period. Accordingly, we create similar patterns based on the sinusoidal functions in Eq. (4), where a periodic function with period $\frac { 4 \pi } { \omega _ { d } }$ (induced by modulus) is used to generate one base symmetry pattern (the top right in Figure 4),
+
+$$
+\begin{array} { r } { \overrightarrow { g _ { i } ^ { \prime } } ^ { ( d ) } : = \left\{ \begin{array} { l l } { s i n ( \omega _ { d } \cdot \mathrm { \Gamma } ( z ( i ) \bmod \frac { 4 \pi } { \omega _ { d } } ) - \frac { 2 \pi } { \omega _ { d } } \mathrm { \Gamma } ) , \mathrm { ~ i f ~ } d \mathrm { ~ i s ~ e v e n } } \\ { c o s ( \omega _ { d } \cdot \mathrm { \Gamma } ( z ( i ) \bmod \frac { 4 \pi } { \omega _ { d } } ) - \frac { 2 \pi } { \omega _ { d } } \mathrm { \Gamma } ) , \mathrm { ~ i f ~ } d \mathrm { ~ i s ~ o d d } } \end{array} \right. } \end{array}
+$$
+
+$\begin{array} { r } { z ( i ) = \frac { i - 1 } { N } \frac { 2 \pi } { \omega _ { d } } \left\lceil \frac { N + 1 } { 2 \pi / \omega _ { d } } \right\rceil } \end{array}$ is to make $N$ nodes linearly spaced in the generated pattern; the angular frequency $\omega _ { d }$ is decreasing along the dimension to make the wavelength longer within the range $[ N ^ { \frac { 1 } { [ d i m / 2 ] } } , N ]$ (see Appendix B for details). In Figure 5, we visualize the comparison between the absolute PE and our CPE for encoding a TSP instance of 20 nodes. Figure 5(a) demonstrates that our real-valued base symmetry pattern has a longer cyclic period as the digit grows. Figure 5(b) indicates that our method (blue) is able to correctly reflect the adjacency between the head and tail of the cyclic sequence whereas the PE method (red) fails to do so. Figure 5(c) verifies that our CPE vectors are well distributed in space with desired cyclic and adjacency similarity properties.
+
+# 4.2 The encoder
+
+The encoder consists of $L = 3$ stacked DAC encoders. In each DAC encoder, we retain relatively independent encoding stream for NFEs and PFEs as in Eq. (5) and Eq. (6), respectively, each of which consists of a shared Dual-Aspect Collaborative Attention (DAC-Att) sub-layer and an independent feed-forward network (FFN) sub-layer. DAC-Att takes both sets of embeddings as input and then outputs their respective enhanced embeddings, i.e., NFEs $\{ \tilde { h } \} _ { i = 1 } ^ { N }$ and PFEs $\{ \tilde { g } \} _ { i = 1 } ^ { N }$ . Each sub-layer is followed by skip connection [30] and layer normalization [31] as same as the original Transformer.
+
+$$
+\begin{array} { r } { h _ { i } ^ { ( l ) } = \mathbf { L N } \Big ( h _ { i } ^ { \prime } + \mathbf { F F N } _ { h } ^ { ( l ) } ( h _ { i } ^ { \prime } ) \Big ) , h _ { i } ^ { \prime } = \mathbf { L N } \Big ( h _ { i } ^ { ( l - 1 ) } + \tilde { h } _ { i } ^ { ( l ) } \Big ) , } \\ { g _ { i } ^ { ( l ) } = \mathbf { L N } \Big ( g _ { i } ^ { \prime } + \mathbf { F F N } _ { g } ^ { ( l ) } ( g _ { i } ^ { \prime } ) \Big ) , g _ { i } ^ { \prime } = \mathbf { L N } \Big ( g _ { i } ^ { ( l - 1 ) } + \tilde { g } _ { i } ^ { ( l ) } \Big ) . } \end{array}
+$$
+
+DAC-Att. The DAC-Att sub-layer enhances each set of embedding from its own aspect, while leveraging attention correlations from the other aspect to achieve the synergy. Given the two sets of embeddings5, $\{ h _ { i } \} _ { i = 1 } ^ { N }$ and $\{ g _ { i } \} _ { i = 1 } ^ { N }$ , we first compute the self-attention correlation from both aspects,
+
+$$
+\alpha _ { i , j } ^ { h } = \frac { 1 } { \sqrt { d _ { k } } } \left( h _ { i } W _ { h } ^ { Q } \right) \left( h _ { j } W _ { h } ^ { K } \right) ^ { T } , \quad \alpha _ { i , j } ^ { g } = \frac { 1 } { \sqrt { d _ { k } } } \left( g _ { i } W _ { g } ^ { Q } \right) \left( g _ { j } W _ { g } ^ { K } \right) ^ { T } ,
+$$
+
+where independent matrices $W _ { h } ^ { Q } , W _ { h } ^ { K } , W _ { g } ^ { Q }$ and $W _ { g } ^ { K } \in \mathbb { R } ^ { d i m \times d _ { k } }$ are used to calculate queries and keys. The obtained correlations are further normalized to $\tilde { \alpha } _ { i , j } ^ { h }$ and $\tilde { \alpha } _ { i , j } ^ { g }$ via Softmax. Note that the correlations are computed from their own aspect, which eliminates possible noises and conduces to correctly describe the incompatible node pair relationships in different aspects of VRP solutions.
+
+We then exploit a cross-aspect referential attention mechanism, which allows computed correlations to be shared between each other, as additional references for both contradistinction and collaboration,
+
+$$
+\mathrm { o u t } _ { i } ^ { h } = \mathrm { C o n c a t } \left[ \sum _ { j = 1 } ^ { N } \tilde { \alpha } _ { i , j } ^ { h } \left( h _ { j } W _ { h } ^ { V } \right) , \sum _ { j = 1 } ^ { N } \tilde { \alpha } _ { i , j } ^ { g } \left( h _ { j } W _ { h } ^ { V r e f } \right) \right] ,
+$$
+
+$$
+\mathrm { o u t } _ { i } ^ { g } = \mathrm { C o n c a t } \left[ \sum _ { j = 1 } ^ { N } { \tilde { \alpha } } _ { i , j } ^ { g } \left( g _ { j } W _ { g } ^ { V } \right) , \sum _ { j = 1 } ^ { N } { \tilde { \alpha } } _ { i , j } ^ { h } \left( g _ { j } W _ { g } ^ { V r e f } \right) \right] ,
+$$
+
+wheand $W _ { h } ^ { V } , W _ { g } ^ { V } \in \mathbb R ^ { d i m \times d _ { v } }$ are trainable parameter matrices for formulating values in each aspect; are parameter matrices for each aspect to generate referential values. $W _ { h } ^ { V r e f } , W _ { g } ^ { V r e f } \in \mathbb R ^ { d i m \times d _ { v } }$ We finally use the multi-head attention to get NFEs $\tilde { h } _ { i }$ and PFEs $\tilde { g } _ { i }$ as follows,
+
+$$
+\begin{array} { r } { \begin{array} { c } { \tilde { h } _ { i } , \tilde { g } _ { i } = \mathbf { D A C - A t t } \left( W ^ { Q } , ~ W ^ { K } , W ^ { V } , W ^ { V _ { r e f } } , W ^ { O } \right) , } \\ { \tilde { h } _ { i } = \mathbf { C o n c a t } \left[ \mathrm { h e a d } _ { i , 1 } ^ { h } , . . . , \mathrm { h e a d } _ { i , m } ^ { h } \right] W _ { h } ^ { O } , ~ \tilde { g } _ { i } = \mathbf { C o n c a t } \left[ \mathrm { h e a d } _ { i , 1 } ^ { g } , . . . , \mathrm { h e a d } _ { i , m } ^ { g } \right] W _ { g } ^ { O } , } \end{array} } \end{array}
+$$
+
+where h $\mathbf { e a d } _ { i , k } ^ { h } = o u t _ { i , k } ^ { h }$ , $\mathbf { h e a d } _ { i , k } ^ { g } = o u t _ { i , k } ^ { g }$ , and $W _ { h } ^ { O } , W _ { g } ^ { O } \ \in \ \mathbb { R } ^ { 2 m d _ { v } \times d i m }$ are trainable parameter matrices. In our model, we adopt $m = 4$ and $d _ { k } = d _ { v } = 1 6$ .
+
+FFN. Our FFN sub-layer has only one hidden layer with 64 hidden unites and adopts the ReLU activation function. The parameters of $\mathbf { F F N } _ { h }$ and $\mathbf { F F N } _ { g }$ are different for each group of embeddings.
+
+# 4.3 The decoder
+
+In the DAC decoder, the two sets of embeddings $\{ h _ { i } ^ { ( L ) } \} _ { i = 1 } ^ { N }$ and $\{ g _ { i } ^ { ( L ) } \} _ { i = 1 } ^ { N }$ are first passed through a Max-pooling sub-layer and a multi-head compatibility (MHC) sub-layer to independently generate diversified node-pair selection proposals from their own aspect, which are then aggregated through a feed-forward aggregation (FFA) sub-layer for output.
+
+Max-pooling. For each set of embeddings, we adopt the max-pooling sub-layer in Wu et al. [11] to aggregate the global representation of all $N$ embeddings into each respective one6.
+
+MHC. The compatibility sub-layer computes the attention correlations for each embedding pair, where the obtained correlations with size $N \times N$ will be deemed as a proposal distribution for node pair selection. Our correlations are computed based on multiple heads for diversity. And we calculate separated attention score matrices $\boldsymbol { Y } _ { k } ^ { h } , \boldsymbol { \dot { Y } } _ { k } ^ { g } \in \mathbb { R } ^ { N \times N }$ (of head $k$ ) from the two aspects independently. Accordingly, the action distribution proposals would be different due to their aspect-specific focus and cognitions of the current solution, which will provide the subsequent FFA layer with a rich pool of proposals and allow our model to be more flexible and robust.
+
+FFA. Once all proposals from two aspects are collected, a FFN with four layers (dimensions are $2 m$ , 32, 32 and 1, respectively) and ReLU activation is used to aggregate them,
+
+$$
+\tilde { Y } _ { i , j } = \mathbf { F } \mathbf { F } \mathbf { A } \left( Y _ { i , j , 1 } ^ { g } , . . . , Y _ { i , j , m } ^ { g } , Y _ { i , j , 1 } ^ { h } , . . . Y _ { i , j , m } ^ { h } \right) ,
+$$
+
+where $m = 4$ is the number of heads; and the output $\tilde { Y } _ { i , j }$ is a scalar indicating the likelihood of selecting node pair $( i , j )$ as an action. Afterwards, we apply $\hat { Y } _ { i j } = C \cdot \mathrm { T a n h } ( \tilde { Y } _ { i , j } )$ with $C = 6$ to control the entropy, and mask 7 the infeasible node pairs $( i ^ { \prime } , j ^ { \prime } )$ as $\hat { Y } _ { i ^ { \prime } j ^ { \prime } } = - \infty$ . Lastly, the likelihoods are normalized using Softmax function to obtain the final action distribution $P _ { i , j }$ .
+
+# 4.4 Reinforcement learning algorithm
+
+We adopt the proximal policy optimization [32] with $n$ -step return estimation for training (details are given in Appendix C), and design a curriculum learning (CL) strategy for better sample efficiency.
+
+Curriculum learning strategy. The strategy in Wu et al. [11] sets a maximum of $T _ { t r a i n }$ steps for training and estimates future returns by bootstrapping [33]. However, due to the concern of training cost, $T _ { t r a i n }$ is usually much smaller than actual $T$ for inference (e.g., 200 v.s. 10k), which may leave the agent a poor chance of observing high-quality solutions (states) during training. Consequently, it may cause high variance for bootstrapping because the value function is mostly fitted on low-quality solutions and may render it less knowledgeable in estimating long-term future returns accurately. In this paper, we tackle this issue by a simple yet efficient strategy which gradually prescribes higher-quality solutions as the initial states for training. In doing so, 1) it increases the probability for the agent to observe better solutions and thus reduce the variance of the value function; 2) it increases the difficulty of the learning task (higher-quality solutions are harder to improve) in a gradual manner and achieves better sample efficiency [34]. In practice, those higher-quality solutions can be easily achieved by improving the randomly generated ones using the current policy for a few $T _ { i n i t }$ steps, where $T _ { i n i t }$ could be slightly increased as the epoch grows.
+
+# 5 Experiments
+
+We evaluate our DACT model on two representative routing problems, i.e., TSP and CVRP [5, 8, 11]. For each problem, we abide by existing conventions to randomly generate instances on the fly for three sizes, i.e., $N = 2 0$ , 50 and 100. Initial experiments with three operators including 2-opt, swap and insert show that 2-opt performs best for both TSP and CVRP (with insert better than swap), hence we report results of our method based on 2-opt. Following [4, 11, 27] we use randomly generated initial solutions for training and the solutions generated by the greedy algorithm for inference. Since each problem has its own constraints and node features, we adjust the input, feasibility masks, and problem-dependent hyperparameters for each problem, the details of which are provided in Appendix D and E. The DACT is trained and tested on a server equipped with TITAN RTX GPU cards and Intel i9-10940X CPU at $3 . 3 0 \mathrm { G H z }$ . Our code in PyTorch are available here8.
+
+Table 1: Comparison with various baselines on TSP and CVRP.
+
+
Method
N=20
N=50
N=100
Obj.
Gap
Time
Obj.
Gap
Time
Obj.
Gap
Time
LKH P
Concorde
3.83
=
(3m)
5.70
(10m)
7.76
(1h)
3.83
0.00%
(38s)
5.70
0.00%
(5m)
7.76
0.00%
(20m)
OR-Tools
3.86
0.94%
(42s)
5.85
2.87%
(5m)
8.06
3.86%
(23m)
Neural-2-Opt [23]
3.84
0.00%
(15m)
5.70
0.12%
(29m)
7.83
0.87%
(41m)
Wu et al. [11] (T=5k)
3.83
0.00%
(1h)
5.70
0.20%
(1.5h)
7.87
1.42%
(2h)
DACT (T=1k)
3.83
0.04%
{7s}(24s)
5.70
0.14%
{16s}(1m)
7.89
1.62%
{48s}(4m)
DACT (T=5k)
3.83
0.00%
{32s}(2m)
5.70
0.02%
{2m}(6m)
7.81
0.61%
{4m}(18m)
DACT (T=10k)
3.83
0.00%
{1m}(5m)
5.70
0.01%
{3m}(13m)
7.79
0.37%
{8m}(40m)
DACT×4 augment
3.83
0.00%
{3m}(10m)
5.70
0.00%
{10m}(1h)
7.77
0.09%
{29m}(2.5h)
GCN-BS [6]
3.84
0.01%
(12m)
5.70
0.01%
(18m)
7.87
1.39%
(40m)
AM-sampling [5]
3.84
0.08%
(5m)
5.73
0.52%
(24m)
7.94
2.26%
(1h)
MDAM-BS[7]
3.84t
0.00%
(3m)
5.70
0.03%
(14m)
7.79
0.38%
(44m)
POMO [8]
3.83
0.04%
(1s)
5.70
0.21%
(2s)
7.80
0.46%
(11s)
POMO×8 augment [8]
3.83
0.00%
(3s)
5.69t
0.03%
(16s)
7.78
0.15%
(1m)
DPDP(100k) [26]
-
-
=
7.77+
0.00%
(3h)
LKH OR-Tools NeuRewriter [4] NLNS [27]
CVAE-Opt-DE [13]
1
0.00%#
11m#
-
0.02%#
22m#
-
0.34%#
55m#
0.00%
4h
15.68
6.14 6.46
5.68%
1h 2m
10.38 11.27
0.00% 8.61%
13m
17.12
0.00% 9.54%
8h 46m
6.15#
6m#
10.51#
11m#
16.10#
6.19#
=
6m#
10.54#
11m#
15.99#
=
17m# 16m#
Wu et al. [11] (T=5k) 6.12
0.39%
(2h)
10.45
0.70%
(4h)
16.03t
= 2.47%
DACT (T=1k)
0.28%
{16s}(33s)
10.61
2.13%
{43s}(2m)
16.17
3.18%
(5h) {2m}(5m)
DACT (T=5k)
6.15 6.13 -0.00%
{1m}(3m)
10.48
1.01%
{3m}(8m)
15.92
1.55%
{8m}(23m)
DACT (T=10k)
-0.04%
{2m}(6m)
10.46
0.79%
{6m}(16m)
15.85
1.12%
{16m}(45m)
DACT×6 augment
6.13 6.13
-0.08%
{11m}(35m)
10.39
0.14%
{32m}(1.5h)
15.71
0.19%
{1.5h}(4.5h)
AM-sampling [5]
1.87%
(6m)
10.62
2.40%
(28m)
MDAM-BS[7]
6.25 6.14
0.18%
(5m)
10.48
0.98%
(15m)
16.23 15.99#
3.72% 2.23%
(2h)
0.82%
(1s)
10.49
1.14%
(4s)
15.83
0.98%
(1h) (19s)
POMO [8] POMO×8 augment [8]
6.17 6.14
0.21%
(5s)
10.42
0.45%
(26s)
15.73
0.32%
(2m)
DPDP(100k)[26]
15.69
0.31%
CVAE-Opt-DE [13]
= 6.14#
= 21m#
= 10.40#
41m#
15.75#
(6h) 1.5h#
+
+# the obj. values, gaps or time are obtained based on 2,000 instances in their original papers, and not directly comparable to ours. ‡ the obj. values obtained by Concorde or LKH may be slightly different from ours since the 10,000 instances are randomly generated. E.g., for TSP50, the optimal values according to our running of Concorde is 5.70, while 5.69 in POMO and Wu et al.. We thus focus more on gaps.
+
+# 5.1 Comparison studies
+
+In Table 1, we compare our DACT with, (1) learning based improvement methods, including Wu et al. [11], Neural-2-Opt [23] (TSP only), NeuRewriter [4] (CVRP only), NLNS [27] (CVRP only), (2) learning based construction methods, including AM-sampling [5], GCN-BS [6] (TSP only), MDAM-BS [7], POMO [8], (3) conventional optimization algorithms equipped with learning based component(s), including DPDP [26], CVAE-Opt-DE [13], and (4) strong conventional solvers including Concorde [35], LKH [28, 36], and OR-Tools [37]. Though L2I [12] can outstrip LKH on CVRP, we do not inlude it as a baseline since it requires a prohibitively longer inference time than others9. All results are averaged over 10,000 randomly generated instances unless specified otherwise (e.g., the ones marked with # only infer 2,000 instances), and we report the metrics of objective values, (optimality) gaps and run time. Regarding baselines, we follow the results reported in their original papers, which may not include all the three metrics. For TSP, Concorde is adopted to get the optimal solutions, based on which the optimality gaps of other methods are calculated. CVRP is harder to be solved optimally, and the gaps are calculated based on solutions of LKH. Note that even for the baselines which infer 10,000 random instances, their objective values might be slightly different from ours (e.g., the ones marked with $\ddagger .$ ), therefore we focus more on gaps for fair comparison. The run time is also hard to compare due to various factors (e.g., GPU/CPU models, batch sizes, Python v.s. $\mathrm { C } { + + }$ ). For DACT, we report the time for inferring all 10,000 instances with multiple GPU cards in $^ { 6 6 } ( ) "$ , and a small batch (512 instances) with one single GPU card in “{}".
+
+Pertaining to TSP, our DACT with inference step limit of 5,000 $\mathrm { ( T = 5 k }$ ) outperforms the traditional solver OR-Tools and all improvement models in terms of optimality gap, including Wu et al. [11] which directly adopted the original Transformer encoder. It also outstrips construction methods
+
+Table 2: Generalization performance. (a) DACT v.s. baselines on benchmark datasets (up to 200 customers, see Appendix E.4 for detailed results and discussion); (b) PE v.s. CPE on different sizes.
+
+
+
+including AM-sampling and GCN-BS on TSP100. With larger step limit $\mathrm { T } { = } 1 0 \mathrm { k }$ , our DACT further boosts the solution qualities and outperforms other construction methods including MDAM-BS (beam search), and POMO (the current state-of-the-art). To further reduce the gaps, we also leverage the data augmentation technique in POMO (which considers flipping node coordinates without changing the optimal solution) to solve same instances multiple times in different ways. Although the inference time increases (we run data augmentation in serial on the same GPUs), our DACT with 4 augments not only outstrips POMO with 8 augments but also achieves the lowest objective values and gaps among all purely learning based models. In particular, our method almost optimally solved TSP20 and TSP50 with gap lower than $0 . 0 0 5 \%$ , and $0 . 0 9 \%$ on TSP100, which is superior to most of the recent neural solvers. Pertaining to CVRP, our DACT with $\mathrm { T } { = } 5 \mathrm { k }$ produces lower gaps than that of improvement models including NeuRewriter and NLNS. It also performs much better than Wu et al. [11] except on CVRP50. With $\mathrm { T } { = } 1 0 \mathrm { k }$ and 6 augments10, our DACT exhibits even better performance than the highly specialized heuristic solver LKH on CVRP20 and delivers the smallest gap of $0 . 1 9 \%$ on CVRP100 against other neural solvers including POMO with 8 augments. Besides, our DACT is also competitive to DPDP which leverages learnt heatmap and dynamic programming to search solutions. Though DPDP (100k) can solve TSP100 instances almost optimally, our DACT is more efficient than DPDP on CVRP100. Compared with CVAE-Opt-DE, despite that it is averaged over fewer instances and integrated with differential evolution, our objective values are still lower.
+
+In terms of the inference time, our DACT is highly competitive against all neural solvers except POMO which learns a construction model by sampling diverse trajectories. However, when it comes to the generalization performance on benchmark datasets, i.e., TSPLIB [38] and CVRPLIB [39] in Table 2(a), DACT produces significantly lower average gaps than the POMO with 8 augments, which indicates that our DACT is more advantageous in practice despite its longer inference time. On the other hand, it is possible to adopt a similar diverse rollout strategy for DACT to find better solutions earlier, or explore other model compression techniques such as the knowledge distillation [40] to learn a lighter DACT model for faster inference. Since our focus is to ameliorate Transformer for neural improvement solvers, we will investigate these possibilities in the future.
+
+# 5.2 Ablation studies
+
+Dual-aspect representation. In Table 3, we evaluate the effectiveness of our dual-aspect representation against the single-aspect one (SA-T) on TSP50 and TSP100, where SA-T mainly follows the Transformer in $\mathbf { W } \mathbf { u }$ et al. [11] but equipped with the CPE, multi-head attentions and CL strategy for fair comparison. We observe that our DACT with fewer parameters consistently outperforms SA-T, which verifies the effectiveness of the dual-aspect representation.
+
+
+Figure 6: Visualization of the attention scores for the encoder when a trained model is used to solve instances with a larger size. (a) using PE method; (b) using CPE method (ours).
+
+Cyclic positional encoding. Here we show that CPE significantly improves the generalization performance across different problem sizes. In Table 2(b), we record the results of our DACT with PE and CPE, and Wu et al. [11], when the model trained on TSP50 is directly used to solve instances from TSP20 and TSP100 with $\mathrm { T } { = } 5 \mathrm { k }$ . We see that even with PE, our DACT outperforms Wu et al. [11]. Further equipped with CPE, DACT outstrips DACT-PE and OR-Tools on TSP100. We continue to compare the two DACT variants by visualizing their attention scores. As depicted in Figure 6(a), although the absolute PE is designed for linear sequences, it did attempt to capture the circularity of
+
+
+Figure 7: Training curves of PPO with and without CL on CVRP20 (random seeds 1-5).
+
+VRP solutions (as highlighted in the green boxes) after training. However, the ability to perceive such properties significantly drops when generalizing over different problem size, which instead engenders random attention scores when generalizing to larger size (see right side of Figure 6(a)). In contrast, our DACT with CPE is able to capture the circularity as depicted in Figure 6(b), which verifies the effectiveness of CPE in representing cyclic sequences (i.e., VRP solutions).
+
+Curriculum learning (CL) strategy. In Figure 7, we plot the training curves of PPO algorithm with and without our CL strategy, where the results are averaged over 5 independent runs with $90 \%$ confidence intervals. It shows that our CL strategy significantly improves the sample efficiency while reducing the variance of training, which aligns with our analysis in Section 4.4.
+
+# 6 Conclusions and future work
+
+In this paper, we present a novel DACT model for routing problems. It learns separate groups of embeddings for the node and positional features, and is equipped with cyclic positional encoding (CPE) to capture the circularity and symmetry of VRP solutions. A curriculum learning (CL) strategy is also exploited to improve the RL training efficiency. Extensive experiments on both synthetic and benchmark datasets justified the effectiveness of DACT in terms of both inference and generalization. A potential limitation is that DACT is more useful for learning improvement models at present. In the future, we will investigate how to extend DACT to construction models, and how to speed up the DACT through diverse rollouts or model compression techniques. It is also interesting to apply the proposed CPE to develop Transformer based model for other tasks where the cyclic property is also important, e.g., encoding circular DNA/RNA structures in computational biology [41, 42].
+
+# Acknowledgments and Disclosure of Funding
+
+This work was supported in part by the National Natural Science Foundation of China under Grant 61803104 and Grant 62102228, in part by the Young Scholar Future Plan of Shandong University under Grant 62420089964188, and in part by the A\*STAR CyberPhysical Production System (CPPS) - Towards Contextual and Intelligent Response Research Program, under the RIE2020 IAF-PP Grant A19C1a0018, and Model Factory $@$ SIMTech.
+
+References
+[1] Paolo Toth and Daniele Vigo. Vehicle routing: problems, methods, and applications. SIAM press, 2014.
+[2] Michael Schneider, Andreas Stenger, and Dominik Goeke. The electric vehicle-routing problem with time windows and recharging stations. Transportation Science, 48(4):500–520, 2014.
+[3] Jan Karel Lenstra and AHG Rinnooy Kan. Complexity of vehicle routing and scheduling problems. Networks, 11(2):221–227, 1981.
+[4] Xinyun Chen and Yuandong Tian. Learning to perform local rewriting for combinatorial optimization. In Advances in Neural Information Processing Systems, volume 32, pages 6281–6292, 2019.
+[5] Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! In International Conference on Learning Representations, 2018.
+[6] Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional network technique for the travelling salesman problem. arxiv preprint arxiv:1906.01227, ArXiV, 2019.
+[7] Liang Xin, Wen Song, Zhiguang Cao, and Jie Zhang. Multi-decoder attention model with embedding glimpse for solving vehicle routing problems. In Proceedings of 35th AAAI Conference on Artificial Intelligence, pages 12042–12049, 2021.
+[8] Yeong-Dae Kwon, Jinho Choo, Byoungjip Kim, Iljoo Yoon, Youngjune Gwon, and Seungjai Min. POMO: Policy optimization with multiple optima for reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 21188–21198, 2020.
+[9] Liang Xin, Wen Song, Zhiguang Cao, and Jie Zhang. Step-wise deep learning models for solving routing problems. IEEE Transactions on Industrial Informatics, 17(7):4861–4871, 2020.
+[10] Cong Zhang, Wen Song, Zhiguang Cao, Jie Zhang, Puay Siew Tan, and Xu Chi. Learning to dispatch for job shop scheduling via deep reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 1621–1632, 2020.
+[11] Yaoxin Wu, Wen Song, Zhiguang Cao, Jie Zhang, and Andrew Lim. Learning improvement heuristics for solving routing problems. IEEE Transactions on Neural Networks and Learning Systems, 2021.
+[12] Hao Lu, Xingwen Zhang, and Shuang Yang. A learning-based iterative method for solving vehicle routing problems. In International Conference on Learning Representations, 2019.
+[13] André Hottung, Bhanu Bhandari, and Kevin Tierney. Learning a latent search space for routing problems using variational autoencoders. In International Conference on Learning Representations, 2021.
+[14] Jingwen Li, Yining Ma, Ruize Gao, Zhiguang Cao, Andrew Lim, Wen Song, and Jie Zhang. Deep reinforcement learning for solving the heterogeneous capacitated vehicle routing problem. IEEE Transactions on Cybernetics, 2021.
+[15] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+[16] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pages 6000–6010, 2017.
+[17] Jingwen Li, Liang Xin, Zhiguang Cao, Andrew Lim, Wen Song, and Jie Zhang. Heterogeneous attentions for solving pickup and delivery problem via deep reinforcement learning. IEEE Transactions on Intelligent Transportation Systems, 2021.
+[18] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. In International Conference on Learning Representations, 2020.
+[19] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 464–468, 2018.
+[20] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, volume 28, pages 2692–2700, 2015.
+[21] Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. In International Conference on Machine Learning (Workshop), 2017.
+[22] Mohammadreza Nazari, Afshin Oroojlooy, Martin Takác, and Lawrence V Snyder. Reinforcement learning ˇ for solving the vehicle routing problem. In Advances in Neural Information Processing Systems, pages 9861–9871, 2018.
+[23] Paulo R d O Costa, Jason Rhuggenaath, Yingqian Zhang, and Alp Akcay. Learning 2-opt heuristics for the traveling salesman problem via deep reinforcement learning. In Asian Conference on Machine Learning, pages 465–480, 2020.
+[24] Hanjun Dai, Elias B Khalil, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems, pages 6351–6361, 2017.
+[25] Zhang-Hua Fu, Kai-Bin Qiu, and Hongyuan Zha. Generalize a small pre-trained model to arbitrarily large TSP instances. In AAAI Conference on Artificial Intelligence, 2021.
+[26] Wouter Kool, Herke van Hoof, Joaquim Gromicho, and Max Welling. Deep policy dynamic programming for vehicle routing problems. arXiv preprint arXiv:2102.11756, 2021.
+[27] André Hottung and Kevin Tierney. Neural large neighborhood search for the capacitated vehicle routing problem. In European Conference on Artificial Intelligence, 2020.
+[28] Keld Helsgaun. LKH-3 (version 3.0.6), 2019. URL http://webhotel4.ruc.dk/\~keld/research/ LKH-3/.
+[29] Wikipedia. Gray code, 2021. URL: https://en.wikipedia.org/wiki/Gray_code. Last visited on 2020/05/19.
+[30] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
+[31] Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. Corr: abs/1607.06450, ArXiV, 2016.
+[32] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arxiv preprint arxiv:1707.06347, ArXiV, 2017.
+[33] Fabio Pardo, Arash Tavakoli, Vitaly Levdik, and Petar Kormushev. Time limits in reinforcement learning. In International Conference on Machine Learning, pages 4045–4054, 2018.
+[34] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In International Conference on Machine Learning, pages 41–48, 2009.
+[35] David L Applegate, Robert E Bixby, Vašek Chvátal, and William J Cook. Concorde TSP Solver, 2020. URL http://www.math.uwaterloo.ca/tsp/concorde/.
+[36] Keld Helsgaun. LKH (version 2.0.9), 2018. URL http://webhotel4.ruc.dk/\~keld/research/ LKH/.
+[37] Laurent Perron and Vincent Furnon. OR-Tools (version 7.2), 2019. URL https://developers.google. com/optimization/.
+[38] Gerhard Reinelt. TSPLIB-A traveling salesman problem library. ORSA journal on computing, 3(4): 376–384, 1991.
+[39] Eduardo Uchoa, Diego Pecin, Artur Pessoa, Marcus Poggi, Thibaut Vidal, and Anand Subramanian. New benchmark instances for the capacitated vehicle routing problem. European Journal of Operational Research, 257(3):845–858, 2017.
+[40] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+[41] Chun-Ying Yu, Tung-Cheng Li, Yi-Ying Wu, Chan-Hsien Yeh, Wei Chiang, Ching-Yu Chuang, and Hung-Chih Kuo. The circular rna circbirc6 participates in the molecular circuitry controlling human pluripotency. Nature communications, 8(1):1–15, 2017.
+[42] Chengyu Liu, Yu-Chen Liu, Hsien-Da Huang, and Wei Wang. Biogenesis mechanisms of circular rna can be categorized through feature extraction of a machine learning model. Bioinformatics, 35(23):4867–4870, 2019.
+[43] Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep policy gradients: A case study on PPO and TRPO. In International Conference on Learning Representations, 2020.
\ No newline at end of file
diff --git a/md/train/ToWi1RjuEr8/ToWi1RjuEr8.md b/md/train/ToWi1RjuEr8/ToWi1RjuEr8.md
new file mode 100644
index 0000000000000000000000000000000000000000..f24a2c0b204430f67adce24bd7bbf1e5706460fd
--- /dev/null
+++ b/md/train/ToWi1RjuEr8/ToWi1RjuEr8.md
@@ -0,0 +1,271 @@
+# ADVANTAGE-WEIGHTED REGRESSION: SIMPLE ANDSCALABLE OFF-POLICY REINFORCEMENT LEARNING
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+In this work, we aim to develop a simple and scalable reinforcement learning algorithm that uses standard supervised learning methods as subroutines, while also being able to leverage off-policy data. Our proposed approach, which we refer to as advantage-weighted regression (AWR), consists of two standard supervised learning steps: one to regress onto target values for a value function, and another to regress onto weighted target actions for the policy. The method is simple and general, can accommodate continuous and discrete actions, and can be implemented in just a few lines of code on top of standard supervised learning methods. We provide a theoretical motivation for AWR and analyze its properties when incorporating off-policy data from experience replay. We evaluate AWR on a suite of standard OpenAI Gym benchmark tasks, and show that it achieves competitive performance compared to a number of well-established state-of-the-art RL algorithms. AWR is also able to acquire more effective policies than most off-policy algorithms when learning from purely static datasets with no additional environmental interactions. Furthermore, we demonstrate our algorithm on challenging continuous control tasks with highly complex simulated characters. (Video1)
+
+# 1 INTRODUCTION
+
+Model-free reinforcement learning can be a general and effective methodology for training agents to acquire sophisticated behaviors with minimal assumptions on the underlying task. However, RL algorithms can be substantially more complex to implement and tune than standard supervised learning methods. Arguably the simplest reinforcement learning methods are policy gradient algorithms (Sutton et al., 2000), which directly differentiate the expected return and perform gradient ascent. Unfortunately, these methods can be notoriously unstable and are typically on-policy, often requiring a substantial number of samples to learn effective behaviors. Our goal is to develop an RL algorithm that is simple, easy to implement, and can readily incorporate off-policy data.
+
+In this work, we propose advantage-weighted regression (AWR), a simple off-policy algorithm for model-free RL. Each iteration of the AWR algorithm simply consists of two supervised regression steps: one for training a value function baseline via regression onto cumulative rewards, and another for training the policy via weighted regression. The complete algorithm is shown in Algorithm 1. AWR can accommodate continuous and discrete actions, and can be implemented in just a few lines of code on top of standard supervised learning methods. Despite its simplicity, we find that AWR achieves competitive results when compared to commonly used on-policy and off-policy RL algorithms, and can effectively incorporate fully off-policy data, which has been a challenge for other RL algorithms. Our derivation presents an interpretation of AWR as a constrained policy optimization procedure, and provides a theoretical analysis of the use of off-policy data with experience replay.
+
+We first revisit the original formulation of reward-weighted regression (RWR) (Peters & Schaal, 2007), an on-policy RL method that utilizes supervised learning to perform policy updates, and then propose a number of new design decisions that significantly improve performance on a suite of standard control benchmark tasks. We then provide a theoretical analysis of AWR, including the capability to incorporate off-policy data with experience replay. Although the design of AWR involves only a few simple design decisions, we show experimentally that these additions provide for a large improvement over previous methods for regression-based policy search, such as RWR, while also being substantially simpler than more modern methods, such as MPO (Abdolmaleki et al., 2018b). We show that AWR achieves competitive performance when compared to several well-established state-of-the-art on-policy and off-policy algorithms.
+
+# 2 PRELIMINARIES
+
+In reinforcement learning, the objective is to learn a policy that maximizes an agent’s expected return. At each time step $t$ , the agent observes the state of the environment $\mathbf { s } _ { t }$ , and samples an action from a policy $\mathbf { a } _ { t } \sim \pi ( \mathbf { a } _ { t } | \mathbf { s } _ { t } )$ . The agent then applies that action, which results in a new state $\mathbf { s } _ { t + 1 }$ and a scalar reward $r _ { t } = r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . The goal is to learn a policy that maximizes the expected return $J ( \pi )$ ,
+
+$$
+J ( \pi ) = \mathbb { E } _ { \tau \sim p _ { \pi } ( \tau ) } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \right] = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) , a \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ r ( \mathbf { s } , \mathbf { a } ) \right] ,
+$$
+
+where $p _ { \pi } ( \tau )$ represents the likelihood of a trajectory $\tau = \{ ( \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , r _ { 0 } ) , ( \mathbf { s } _ { 1 } , \mathbf { a } _ { 1 } , r _ { 1 } ) , \ldots \}$ under a policy $\pi$ , and $\gamma \in \ [ 0 , 1 )$ is the discount factor. $\begin{array} { r } { d _ { \pi } ( \mathbf { s } ) \ = \ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } p ( \mathbf { s } _ { t } \ = \ \mathbf { s } | \pi ) } \end{array}$ represents the unnormalized discounted state distribution induced by the policy $\pi$ (Sutton & Barto, 1998), and $p ( \mathbf { s } _ { t } = \mathbf { s } | \boldsymbol { \pi } )$ is the likelihood of the agent being in state s after following $\pi$ for $t$ timesteps.
+
+Our proposed AWR algorithm builds on ideas from reward-weighted regression (RWR) (Peters & Schaal, 2007), a policy search algorithm based on an expectation-maximization framework. At each iteration, the E-step constructs an estimate of the optimal policy according to $\pi ^ { * } ( \mathbf { a } | \mathbf { s } ) \ \propto $ $\pi _ { k } ( \mathbf { a } | \mathbf { s } ) \mathrm { e x p } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } / \beta \right)$ , where $\pi _ { k }$ represents the policy at the $k$ th iteration, $\begin{array} { r } { \mathcal { R } _ { { \bf s } , { \bf a } } \stackrel { - } { = } \sum _ { t = 0 } ^ { \infty } \dot { \gamma } ^ { t } r _ { t } } \end{array}$ is the return, and $\beta > 0$ is a temperature parameter. Then the M-step projects $\pi ^ { * }$ onto the space of parameterized policies by solving a supervised regression problem:
+
+$$
+\pi _ { k + 1 } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { k } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi _ { k } ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \mathcal { R } _ { \mathbf { s } , \mathbf { a } } \right) \right] .
+$$
+
+The RWR update can be interpreted as fitting a new policy $\pi _ { k + 1 }$ to samples from the current policy $\pi _ { k }$ , where the likelihood of each action is weighted by the exponentiated return for that action.
+
+# 3 ADVANTAGE-WEIGHTED REGRESSION
+
+In this work, we present advantage-weighted regression (AWR), a simple off-policy RL algorithm based on reward-weighted regression. We first provide an overview of the AWR algorithm, and then describe its theoretical motivation and analyze its properties. The AWR algorithm is summarized in Algorithm 1. Each iteration $k$ of AWR consists of the following simple steps. First, the current policy $\pi _ { k } ( \mathbf { a } | \mathbf { s } )$ is used to sample a batch of trajectories $\{ \tau _ { i } \}$ that are then stored in the replay buffer $\mathcal { D }$ , which is structured as a first-in first-out (FIFO) queue (Mnih et al., 2015). Then, a value function $V _ { k } ^ { { \mathcal { D } } } ( { \mathbf s } )$ is fitted to all eturn estimates eplay buffer . Finally, the $\mathcal { D }$ , which can be done with simple Monteme buffer is used to fit a new policy using $\begin{array} { r } { \mathcal { R } _ { { \bf s } , { \bf a } } ^ { D } = \sum _ { t = 0 } ^ { T } \gamma ^ { t } r _ { t } } \end{array}$ advantage-weighted regreexponentiated advantage $\begin{array} { r } { \exp ( \frac { 1 } { \beta } A ^ { D } ( { \bf s } , { \bf a } ) ) } \end{array}$ state-action pair in the buffer , with the advantage given by $A ^ { \mathcal { D } } ( \mathbf { { s } } , \mathbf { { a } } ) = \mathcal { R } _ { { \mathbf { s } } , \mathbf { { a } } } ^ { \mathcal { D } } - \mathbf { \mathcal { V } } ^ { \mathcal { D } } ( \mathbf { { s } } )$ and $\beta$ is a hyperparameter. In the following subsections, we first motivate AWR as a constrained policy search problem, and then extend our analysis to incorporate experience replay.
+
+# 3.1 DERIVATION
+
+In this section, we derive the AWR algorithm as an approximate optimization of a constrained policy search problem. Our goal is to find a policy that maximizes the expected improvement $\mathsf { \bar { \eta } } ( \pi ) \mathsf { \bar { = } } J ( \pi ) \bar { - } J ( \mu )$ over a sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ . We first derive AWR for the setting where the sampling policy is a single Markovian policy. Then, in the next section, we extend our result to data from multiple policies, as in the case of experience replay. The expected improvement $\eta ( \pi )$ can be expressed in terms of the advantage ${ \mathbf { } } A ^ { \mu } ( \mathbf { { \bar { s } } } , \mathbf { { a } } ) = { \mathbf { } } { \mathcal { R } } _ { { \mathbf { s } } , \mathbf { { a } } } ^ { \mu } - { \mathbf { \bar { \psi } } } V ^ { \mu } ( \mathbf { s } )$ with respect to $\mu$ (Kakade & Langford, 2002; Schulman et al., 2015):
+
+$$
+\eta ( \pi ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] ,
+$$
+
+where $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu }$ denotes the return obtained by performing action a in state s and following $\mu$ for the following timesteps, and $\begin{array} { r } { V ^ { \mu } ( \mathbf { s } ) = \int _ { a . } \mu ( \mathbf { a } | \mathbf { s } ) \mathcal { R } _ { \mathbf { s } } ^ { \mathbf { a } } } \end{array}$ $d \mathbf { a }$ corresponds to the value function of $\mu$ . This objective differs from the ones used in the derivations of related algorithms, such as RWR and
+
+# Algorithm 1 Advantage-Weighted Regression
+
+
1:π1 ← random policy 2:D←0
3: for iteration k =1,..., kmax do
4:
add trajectories {Ti} sampled via πk to D
5:
V ← arg minv Es,a~D [|IRa - V(s)ll2]
7: end for
6:πk+1 ←arg maxEs,a~D[ogπ(a|s)exp((a-V(s))]
+
+REPS (Peters & Schaal, 2007; Peters et al., 2010; Abdolmaleki et al., 2018b), which maximize the expected return $J ( \pi )$ instead of the expected improvement. The expected improvement directly gives rise to an objective that involves the advantage. We will see later that this yields a policy update that differ in a subtle but important way from standard RWR. As we show in our experiments, this difference results in a large empirical improvement.
+
+The objective in Equation 3 can be difficult to optimize due to the dependency between $d _ { \pi } ( \mathbf { s } )$ and $\pi$ , as well as the need to collect samples from $\pi$ . Following Schulman et al. (2015), we can instead optimize an approximation $\hat { \eta } ( \pi )$ of $\eta ( \pi )$ using the state distribution of $\mu$ :
+
+$$
+\hat { \eta } ( \pi ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] .
+$$
+
+Here, $\hat { \eta } ( \pi )$ matches $\eta ( \pi )$ to first order (Kakade & Langford, 2002), and provides a good estimate of $\eta$ if $\pi$ and $\mu$ are close in terms of the KL-divergence (Schulman et al., 2015). Using this objective, we can formulate the following constrained policy search problem:
+
+$$
+\begin{array} { r l } { \underset { \pi } { \arg \operatorname* { m a x } } } & { \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } } \\ { \mathrm { s . t . } } & { \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) d \mathbf { s } \leq \epsilon . } \end{array}
+$$
+
+The constraint in Equation 6 ensures that the new policy $\pi$ is close to the data distribution of $\mu$ , and therefore the surrogate objective $\hat { \eta } ( \pi )$ remains a reasonable approximation to $\eta ( \pi )$ . We refer the reader to Schulman et al. (2015) for a detailed derivation and an error bound.
+
+We can derive AWR as an approximate solution to this constrained optimization. This derivation follows a similar procedure as Peters et al. (2010), and begins by forming the Lagrangian of the optimization problem presented above,
+
+$$
+\mathcal { L } ( \pi , \beta ) = \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } + \beta \left( \epsilon - \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) d \mathbf { s } \right) ,
+$$
+
+where $\beta$ is a Lagrange multiplier. Differentiating ${ \mathcal { L } } ( \pi , \beta )$ with respect to $\pi ( \mathbf { a } | \mathbf { s } )$ and solving for the optimal policy $\pi ^ { * }$ results in the following expression for the optimal policy
+
+$$
+\pi ^ { * } ( \mathbf { a } | \mathbf { s } ) = \frac { 1 } { Z ( \mathbf { s } ) } \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) ,
+$$
+
+with $Z ( \mathbf { s } )$ being the partition function. A detailed derivation is available in Appendix A. If $\pi$ is represented by a function approximator (e.g., a neural network), a new policy can be obtained by projecting $\pi ^ { * }$ onto the manifold of parameterized policies,
+
+$$
+\begin{array} { r l } { \underset { \pi } { \mathrm { a r g \ m i n } } \ : \ : \ : \ : } & { \mathbb { E } _ { \mathbf { s } \sim \mathcal { D } } \left[ \mathrm { D } _ { \mathbf { K L } } \left( \pi ^ { * } ( \cdot | \mathbf { s } ) | | \pi ( \cdot | \mathbf { s } ) \right) \right] } \\ { = \underset { \pi } { \mathrm { a r g \ m a x } } \ : \ : \ : \ : } & { \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \mu ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \mathrm { e x p } \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) \right] . } \end{array}
+$$
+
+While this derivation for AWR largely follows the derivations used in prior work (Peters et al., 2010; Abdolmaleki et al., 2018b), our expected improvement objective introduces a baseline $V ^ { \mu } ( \mathbf { s } )$ to the policy update, which as we show in our experiments, is a crucial component for an effective algorithm. A similar advantage-weighting scheme has been previously used for fitted Q-iteration (Neumann & Peters, 2009), where the policy is given by $\begin{array} { r } { \pi ( \mathbf { a } | \mathbf { s } ) ^ { \cdot } = \frac { 1 } { Z ( \mathbf { s } ) } \mathrm { e x p } \left( \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \grave { \mathbf { s } } ) \right) / \beta \right) } \end{array}$ . In this definition, the likelihood of an action does not depend on the sampling distribution, and therefore does not enforce a trust region with respect to $\mu$ .
+
+# 3.2 EXPERIENCE REPLAY AND OFF-POLICY LEARNING
+
+A crucial design decision of AWR is the choice of sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ . Standard implementations of RWR are typically on-policy, where the sampling policy is selected to be the current policy $\mu ( \mathbf { a } | \mathbf { s } ) = \pi _ { k } ( \mathbf { a } | \mathbf { s } )$ at iteration $k$ . This can be sample inefficient, as data collected at each iteration are discarded after a single update iteration. Importance sampling can be incorporated into RWR to reuse data from previous iterations, but at the cost of larger variance (Kober & Peters, 2009). Instead, we can improve sample efficiency of AWR by incorporating experience replay and explicitly accounting for training data from a mixture of multiple past policies. As described in Algorithm 1, at each iteration, AWR collects a batch of data using the latest policy $\pi _ { k }$ , and then stores this data in a replay buffer $\mathcal { D }$ , which also contains data collected from previous policies $\{ \pi _ { 1 } , \cdots , \pi _ { k } \}$ . The value function and policy are then updated using samples drawn from $\mathcal { D }$ . This replay strategy is analogous to modeling the sampling policy as a mixture of policies from previous iterations $\begin{array} { r } { \mu _ { k } ( \tau ) = \sum _ { i = 1 } ^ { k } w _ { i } \pi _ { i } ( \tau ) } \end{array}$ , where $\pi _ { i } ( \tau ) = p ( \tau | \pi _ { i } )$ represents the likelihood of a trajectory $\tau$ under a policy $\pi _ { i }$ from the ith iteration, and the weight $w _ { i }$ specify the probability of selecting $\pi _ { i }$ .
+
+We now extend the derivation from the previous section to the off-policy setting with experience replay, and show that Algorithm 1 indeed optimizes the expected improvement over a sampling policy modeled by the replay buffer. Given a replay buffer consisting of trajectories from past policies, the joint state-action distribution of $\mu$ is given by $\begin{array} { r } { \mu ( \mathbf { s } , \mathbf { a } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } \end{array}$ , and similarly for the marginal state distribution $\begin{array} { r } { d _ { \mu } ( \mathbf { s } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) } \end{array}$ . The expected improvement can now be expressed with respect to the set of sampling policies in the replay buffer,
+
+$$
+\eta ( \pi ) = J ( \pi ) - \sum _ { i } w _ { i } J ( \pi _ { i } ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \sum _ { i } w _ { i } A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] ,
+$$
+
+where $A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) = \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( \mathbf { s } )$ is the advantage with respect to each sampling policy. In Appendix $\mathbf { B }$ , we show that the update procedure in Algorithm 1 optimizes the following objective:
+
+$$
+\begin{array} { r l } & { \underset { \pi } { \arg \operatorname* { m a x } } \sum _ { i = 1 } ^ { k } w _ { i } \left( \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] \right) } \\ & { \quad \mathbf { s } . \mathbf { t } . \quad \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \left[ \operatorname { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) \right] \leq \epsilon , } \end{array}
+$$
+
+where µ(a|s) = µ(s,a) = Pi widπi (s)πi(a|s) represents the conditional action distribution defined by the replay buffer. This objective can be solved via the Lagrangian to yield the following update:
+
+$$
+\arg \operatorname* { m a x } _ { \pi } \sum _ { i = 1 } ^ { k } w _ { i } \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \mathrm { e x p } \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - \frac { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) V ^ { \pi _ { j } } ( \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right) \right) \right] ,
+$$
+
+where the expectations can be approximated by simply sampling from $\mathcal { D }$ following Line 6 of Algorithm 1. A detailed derivation is available in Appendix B. Note, the baseline in the exponent now consists of an average of the value functions of the different policies. This mean value function $\bar { V } ( \mathbf { s } )$ can be fitted by simply sampling from the replay buffer following Line 5 of Algorithm 1,
+
+$$
+\bar { V } = \underset { V } { \arg \operatorname* { m i n } } \sum _ { i } w _ { i } \mathbb { E } _ { { \mathbf s } , \sim d _ { \pi _ { i } } ( { \mathbf s } ) , { \mathbf a } \sim \pi _ { i } ( { \mathbf a } | { \mathbf s } ) } \left[ | | \mathcal { R } _ { { \mathbf s } , { \mathbf a } } ^ { \pi _ { i } } - V ( { \mathbf s } ) | | ^ { 2 } \right] .
+$$
+
+The optimal solution $\begin{array} { r } { \bar { V } ( \mathbf { s } ) = \frac { \sum _ { i } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) V ^ { \pi _ { i } } ( \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } } \end{array}$ is exactly the baseline in Equation 14.
+
+# 3.3 IMPLEMENTATION DETAILS
+
+Finally, we discuss several important design decisions for a practical implementation of AWR. Monte Carlo estimates can be used to approximate the expected return $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } }$ , but this can result in a highvariance estimate. Instead, we approximate $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } }$ using $\mathrm { T D } ( \lambda )$ to obtain a lower-variance estimate (Sutton & Barto, 1998). $\mathrm { T D } ( \lambda )$ is applied by bootstrapping with the value function $V _ { k - 1 } ^ { \mathcal { D } }$ (s) from the previous iteration. To set the value of the Lagrange multiplier $\beta$ , we found that a simple adaptive heuristic of setting $\beta$ to the standard deviation of all advantage values $\sigma _ { A }$ in the replay buffer works well in practice. This is akin to the advantage normalization technique commonly used in implementations of algorithms such as PPO (Dhariwal et al., 2017). Details are available in Appendix C.
+
+
+Figure 1: Snapshots of AWR policies trained on OpenAI Gym and motion imitation tasks. Our simple algorithm learns effective policies for a diverse suite of control tasks.
+
+The weights $\begin{array} { r } { \omega _ { \mathbf { s } , \mathbf { a } } ^ { D } = \exp \Big ( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { D } - V ^ { \mathcal { D } } ( \mathbf { s } ) \right) \Big ) } \end{array}$ used to update the policy can occasionally assume excessively large values, which causes gradients to explode. Therefore, we apply weight clipping $\hat { \omega } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } } = \operatorname* { m i n } \left( \omega _ { \mathbf { s } , \mathbf { a } } ^ { \mathbf { \breve { D } } } , \omega _ { \operatorname* { m a x } } \right)$ with a threshold $\omega _ { \mathrm { m a x } }$ to prevent exploding weights.
+
+# 4 RELATED WORK
+
+Existing RL methods can be broadly categorized into on-policy and off-policy algorithms (Sutton & Barto, 1998). On-policy algorithms generally update the policy using data collected from the same policy. A popular class of on-policy algorithms is policy gradient methods (Williams, 1992; Sutton et al., 2000), which can be effective for a diverse array of complex tasks (Heess et al., 2017; Pathak et al., 2017; Peng et al., 2018; Rajeswaran et al., 2018). However, on-policy algorithms are typically data inefficient. Off-policy algorithms improve sample efficiency by enabling training using data from other sources, such as data from different agents or data from previous iterations of the algorithm. Importance sampling is a simple strategy for off-policy learning (Sutton & Barto, 1998; Meuleau et al., 2000; Hachiya et al., 2009), but can introduce optimization instabilities due to the large variance of the importance sampling estimator. Dynamic programming methods based on Q-function learning can also leverage off-policy data (Precup et al., 2001; Mnih et al., 2015; Lillicrap et al., 2016; Gu et al., 2016; Haarnoja et al., 2018b). But these methods can be notoriously unstable, and in practice, require a variety of stabilization techniques (Hasselt et al., 2016; Wang et al., 2016; Munos et al., 2016; Hessel et al., 2017; Fujimoto et al., 2018; Fu et al., 2019). Furthermore, it can be difficult to apply these methods to fully off-policy data, where an agent is unable to collect additional environmental interactions (Fujimoto et al., 2019; Kumar et al., 2019).
+
+Policy search can also be formulated under an expectation-maximization framework (Peters et al., 2010; Neumann, 2011; Abdolmaleki et al., 2018b), an early example of which is reward-weighted regression (RWR) (Peters & Schaal, 2007). RWR presents a simple on-policy RL algorithm that casts policy search as a supervised regression problem. A similar algorithm, relative entropy policy search (REPS) (Peters et al., 2010), can also be derived from the dual formulation of a constrained policy search problem. RWR has a number appealing properties: it has a very simple update rule, and since each iteration corresponds to supervised learning, it can be more stable and easier to implement than many of the previously mentioned RL methods. Despite these advantages, RWR has not been shown to be an effective when combined with neural networks (Schulman et al., 2015; Duan et al., 2016). In this work, we propose a number of modifications to the formulation of RWR to produce an effective off-policy deep RL algorithm, while still retaining much of the simplicity of RWR.
+
+The optimization problem being solved in AWR is similar to REPS (Peters et al., 2010), but REPS optimizes the expected return instead of the expected improvement. The weights in REPS also contains a Bellman error term that resembles advantages, but are computed using a linear value function derived from a feature matching constraint. Learning the REPS value function involves minimization of a dual function, which is a complex function of the Bellman error, while the value function in AWR can be learned with simple supervised regression. More recently, Abdolmaleki et al. (2018b) proposed MPO, a deep RL variant of REPS, which applies a partial EM algorithm for policy optimization. The method first fits a Q-function of the current policy via bootstrapping, and then performs a policy improvement step with respect to this Q-function. MPO uses off-policy data for training a Q-function and employs Retrace(λ) for off-policy correction (Munos et al., 2016). In
+
+
+
+Figure 2: Learning curves of the various algorithms when applied to OpenAI Gym tasks. Results are averaged across 10 random seeds. AWR is generally competitive with the best current methods.
+
+
Task
TRPO
PPO
DDPG
TD3
SAC
LAWER
RWR
AWR (Ours)
Ant-v2
2901 ± 85
4884± 1249
72 ± 1550
5997 ± 765
7500±353
2240± 497
1183± 176
5372± 163
HalfCheetah-v2
3302 ± 428
7617 ± 185
10563 ± 382
12324 ± 1549
16223 ± 964
4596± 2331
2075±370
9192 ± 157
Hopper-v2
1880±337
2514± 726
855±282
2794± 15
2757±658
1830± 553
605± 114
3498±167
Humanoid-v2
552±9
4668 ± 1153
4382 ± 423
4738±93
6296±332
108±386
509±18
6159 ± 274
LunarLander-v2
104± 94
121 ± 49
185±23
229±2
Walker2d-v2
2765±168
5036± 934
401± 470
4779± 803
6210±511
2502±388
406±64
5813± 483
+
+Table 1: Final returns for different algorithms on the OpenAI Gym tasks, with $\pm$ corresponding to one standard deviation of the average return across 10 random seeds. In terms of final performance, AWR is generally competitive with prior methods.
+
+contrast, AWR is simpler, as it can simply fit a value function to the observed returns in a replay buffer, and performs weighted supervised regression on the actions to fit the policy. Oh et al. (2018) proposed self-imitation learning (SIL), which augments policy gradient algorithms with an auxiliary behaviour cloning loss to reuse samples from past experiences. Unlike SIL, AWR is a standalone algorithm, and does not need to be combined with an auxiliary RL algorithm. Neumann & Peters (2009) proposed LAWER, a kernel-based fitted Q-iteration algorithm where the Bellman error is weighted by the normalized advantage of each state-action pair. This was then followed by a soft-policy improvement step. Similar to Neumann & Peters (2009), AWR also uses exponentiated advantages, but LAWER’s definition of the policy is different from the one in AWR and does not enforce a trust region constraint. Furthermore, AWR does not perform fitted Q-iteration, and instead utilizes off-policy data in a simple constrained policy search procedure. Wang et al. (2018) applied a similar advantage-weighting scheme for imitation learning, but the method was not demonstrated for the RL setting. In this work, we propose several design decisions that are vital for an effective RL algorithm. We also provide a theoretical analysis of AWR when combined with experience replay, and show that the algorithm optimizes the expected improvement with respect to a mixture of policies modeled by a replay buffer.
+
+# 5 EXPERIMENTS
+
+Our experiments aim to comparatively evaluate the performance of AWR with commonly used on-policy and off-policy deep RL algorithms. We evaluate our method on the OpenAI Gym benchmarks (Brockman et al., 2016), consisting of discrete and continuous control tasks. We also evaluate our method on complex motion imitation tasks with high-dimensional simulated characters. We then demonstrate the effectiveness of AWR on fully off-policy learning, by training on static datasets of demonstrations from demo policies. Behaviors learned by the policies are best seen in the supplementary video1. Code for our implementation of AWR is available at sites.google.com/view/awr-supp/. Detailed hyperparameter settings are provided in Appendix C.
+
+# 5.1 BENCHMARKS
+
+We compare AWR to a number of state-of-the-art RL algorithms, including on-policy algorithms, such as TRPO (Schulman et al., 2015) and PPO (Schulman et al., 2017), off-policy algorithms, such as DDPG (Lillicrap et al., 2016), TD3 (Fujimoto et al., 2018), and SAC (Haarnoja et al., 2018a), as well as RWR (Peters & Schaal, 2007) and LAWER (Neumann & Peters, 2009).2 TRPO, PPO, and DDPG use the implementations from OpenAI baselines (Dhariwal et al., 2017). TD3 and SAC use the implementations from Fujimoto et al. (2018) and Haarnoja et al. (2018a). RWR and LAWER are implemented following the descriptions in Peters & Schaal (2007) and Neumann & Peters (2009), but neural networks are used instead of kernel-based approximators.
+
+
+Figure 3: Left: Learning curves comparing AWR with various components removed. Each component contributes to performance improvements. Right: Learning curves comparing AWR with different capacity replay buffers. AWR remains stable with large buffers containing primarily off-policy data from past iterations.
+
+Snapshots of the AWR policies are shown in Figure 1. Figure 2 shows learning curves comparing the different algorithms, and Table 1 summarizes the average returns of the final policies across 10 training runs initialized with different random seeds. Due to the slow wall-clock times of TD3 and SAC, some training runs did not have sufficient time to collect as many samples as other algorithms. Overall, AWR shows competitive performance with the state-of-the-art deep RL algorithms. It is competitive with on-policy methods, such as TRPO and PPO, in both sample efficiency and asymptotic performance. While it is not yet as sample efficient as current state-of-the-art off-policy methods, such SAC and TD3, it is able to achieve a comparable asymptotic performance on most tasks. RWR tends to perform poorly on these tasks, which suggests that, the particular modifications from AWR are critical. AWR also significantly outperforms LAWER across the various tasks. Though both methods use a similar advantaged-weighting scheme, our design decisions for AWR produce a simpler and more effective algorithm.
+
+# 5.2 ABLATION EXPERIMENTS
+
+To determine the effects of various design decisions, we evaluate the performance of AWR when key components have been removed. The experiments include: an on-policy version of AWR (On-Policy), where updates use only data from the latest policy, a version of AWR without the baseline $V ( \mathbf { s } )$ (No Baseline), and a version that uses Monte Carlo return estimates instead of $\mathrm { T D } ( \lambda )$ (No $\mathrm { T D } ( \lambda ) ,$ ). The effects of these components are illustrated in Figure 3. Overall, these design decisions appear to be vital for an effective algorithm, with the most crucial components being the use of experience replay and a baseline. Updates using only on-policy data can lead to instabilities and noticeable degradation in performance, which may be due to overfitting on a smaller dataset. Removing the baseline also noticeably hampers performance. Using simple Monte Carlo return estimates instead of $\mathrm { T D } ( \lambda )$ seems to be a viable alternative, and the algorithm still achieves competitive performance on some tasks. When combined, these different components yield substantial performance gains over standard RWR.
+
+To further evaluate the effect of experience replay, we compare policies trained using replay buffer with different capacities. Figure 3 illustrates the learning curves for buffers of size 5k, 20k, 50k, 100k, and $5 0 0 \mathrm { k }$ , with 50k being the default buffer size in our experiments. The size of the replay buffer appears to have a significant impact on overall performance. Smaller buffer sizes can result in instabilities during training, which again may be an effect of overfitting to a smaller dataset. As the buffer size increases, AWR remains stable even when the dataset is dominated by off-policy data from previous iterations. In fact, AWR appears more stable with larger replay buffers, but progress can also become slower. Since the sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ is modeled by the replay buffer, a larger buffer can limit the rate at which $\mu$ changes by maintaining older data for more iterations.
+
+# 5.3 MOTION IMITATION
+
+In this section, we show that AWR can also solve high-dimensional tasks with complex simulated characters, including a $3 4 \mathrm { D o F }$ humanoid and 64 DoF dog. The objective of the tasks is to imitate reference motion clips recorded using mocap. The experimental setup follows the framework proposed by Peng et al. (2018). The motions include walking and running (e.g. canter), as well as acrobatic skills, such as cartwheels and spinkicks. Figure 1 shows snapshots of the behaviors learned by the AWR. Table 2 and Figure 4 compare the performance of AWR to RWR and PPO. AWR performs well across the set of challenging skills, consistently achieving comparable or better performance than PPO. RWR struggles with controlling the humanoid, but exhibits stronger performance on the dog. This difference may be due to the more dynamic and acrobatic skills of the humanoid.
+
+Table 2: Performance of algorithms on the motion imitation tasks. Returns are normalized between the minimum and maximum possible returns.
+
+
Task
PPO
RWR
AWR (Ours)
Humanoid:Cartwheel
0.76 ±0.02
0.03±0.01
0.78±0.07
Humanoid:Spinkick
0.70±0.02
0.05± 0.03
0.77± 0.04
Dog:Canter
0.76±0.03
0.78±0.04
0.86± 0.01
Dog:Trot
0.86±0.01
0.86±0.01
0.86±0.03
Dog:Turn
0.75±0.02
0.75±0.03
0.82±0.03
+
+
+Figure 4: Learning curves on motion imitation tasks. On these challenging tasks, AWR generally learns faster than PPO and RWR.
+
+
+Figure 5: Performance of various algorithms on off-policy learning tasks with static datasets. AWR is able to learn policies that are comparable or better than the original demo policies.
+
+# 5.4 OFF-POLICY LEARNING WITH STATIC DATASETS
+
+Next, we evaluate AWR in a fully off-policy setting, where the algorithm is provided with a static dataset of experiences, and then tasked with learning the best possible policy without collecting any additional data. To evaluate our method, we use the off-policy tasks proposed by Kumar et al. (2019). The dataset consists of trajectories $\tau = \{ ( \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , r _ { 0 } ) , ( \mathbf { s } _ { 1 } , \mathbf { a } _ { 1 } , r _ { 1 } ) , \ldots \}$ from rollouts of a demo policy. Unlike standard imitation learning tasks, which only observes the states and actions from the demo policy, the dataset also records the reward at each step. The demo policies are trained using SAC on various OpenAI Gym tasks. A dataset of 1 million timesteps is collected for each task.
+
+For AWR, we simply treat the dataset as the replay buffer $\mathcal { D }$ and directly apply the algorithm without any modifications. Figure 5 compares AWR to the original demo policy (Demo) and a behavioral cloning policy (BC). We also include comparisons to recent off-policy methods: batch-constrained Q-learning (BCQ) (Fujimoto et al., 2019) and bootstrapping error accumulation reduction (BEAR) (Kumar et al., 2019), which have shown strong performance on off-policy learning with static datasets. Note that both of these prior methods are modifications to existing off-policy RL methods, such as TD3 and SAC, which are already quite complex. In contrast, AWR is simple and requires no modifications for the fully off-policy setting. Despite not collecting any additional data, AWR is able to learn effective policies from these fully off-policy datasets, achieving comparable or better performance than the original demo policies. On-policy methods, such as PPO performs poorly in this off-policy setting. Q-function based methods, such as TD3 and SAC, can in principle handle off-policy data but tend to struggle in practice (Fujimoto et al., 2019; Kumar et al., 2019). Unlike Q-function based methods, AWR is less susceptible to issues from out-of-distribution actions as the policy is always trained on observed actions from the behaviour data (Kumar et al., 2019). AWR also shows comparable performance to BEAR and BCQ, which are specifically designed for this off-policy setting and introduce considerable algorithmic overhead.
+
+# 6 DISCUSSION AND FUTURE WORK
+
+We presented advantage-weighted regression, a simple off-policy reinforcement learning algorithm, where policy updates are performed using standard supervised learning methods. Despite its simplicity, our algorithm is able to solve challenging control tasks with complex simulated agents, and achieve competitive performance on standard benchmarks compared to a number of well-established RL algorithms. Our derivation introduces several new design decisions, and our experiments verify the importance of these components. AWR is also able to learn from fully off-policy datasets, demonstrating comparable performance to state-of-the-art off-policy methods. While AWR is effective for a diverse suite of tasks, it is not yet as sample efficient as the most efficient off-policy algorithms. We believe that exploring techniques for improving sample efficiency and performance on fully off-policy learning can open opportunities to deploy these methods in real world domains. A better theoretical understanding of the convergence properties of these algorithms, especially when combined with experience replay, could also be valuable for the development of future algorithms.
+
+# REFERENCES
+
+Abbas Abdolmaleki, Jost Tobias Springenberg, Jonas Degrave, Steven Bohez, Yuval Tassa, Dan Belov, Nicolas Manfred Otto Heess, and Martin A. Riedmiller. Relative entropy regularized policy iteration. ArXiv, abs/1812.02256, 2018a.
+
+Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations, 2018b. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ S1ANxQW0b.
+
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
+
+Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https: //github.com/openai/baselines, 2017.
+
+Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In ICML, pp. 1329–1338, 2016. URL http: //proceedings.mlr.press/v48/duan16.html.
+
+Justin Fu, Aviral Kumar, Matthew Soh, and Sergey Levine. Diagnosing bottlenecks in deep qlearning algorithms. 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. 2021–2030, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/fu19a.html.
+
+Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. 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. 1587–1596, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL¨ http://proceedings.mlr.press/ $\mathtt { v 8 0 }$ /fujimoto18a.html.
+
+Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. 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. 2052–2062, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http: //proceedings.mlr.press/v97/fujimoto19a.html.
+
+Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2829–2838, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/v48/gu16.html.
+
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. 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. 1861–1870, Stockholmsmassan, ¨ Stockholm Sweden, 10–15 Jul 2018a. PMLR. URL http://proceedings.mlr.press/ v80/haarnoja18b.html.
+
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. 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. 1861–1870, Stockholmsmassan, ¨ Stockholm Sweden, 10–15 Jul 2018b. PMLR. URL http://proceedings.mlr.press/ v80/haarnoja18b.html.
+
+Hirotaka Hachiya, Takayuki Akiyama, Masashi Sugiayma, and Jan Peters. Adaptive importance sampling for value function approximation in off-policy reinforcement learning. Neural Netw., 22(10):1399–1410, December 2009. ISSN 0893-6080. doi: 10.1016/j.neunet.2009.01.002. URL http://dx.doi.org/10.1016/j.neunet.2009.01.002.
+
+Danijar Hafner, James Davidson, and Vincent Vanhoucke. Tensorflow agents: Efficient batched reinforcement learning in tensorflow. CoRR, abs/1709.02878, 2017. URL http://arxiv. org/abs/1709.02878.
+
+Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI’16, pp. 2094– 2100. AAAI Press, 2016. URL http://dl.acm.org/citation.cfm?id=3016100. 3016191.
+
+Nicolas Heess, Dhruva TB, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, S. M. Ali Eslami, Martin A. Riedmiller, and David Silver. Emergence of locomotion behaviours in rich environments. CoRR, abs/1707.02286, 2017. URL http: //arxiv.org/abs/1707.02286.
+
+Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Daniel Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. CoRR, abs/1710.02298, 2017. URL http: //arxiv.org/abs/1710.02298.
+
+Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the Nineteenth International Conference on Machine Learning, ICML ’02, pp. 267–274, San Francisco, CA, USA, 2002. Morgan Kaufmann Publishers Inc. ISBN 1-55860-873-7. URL http://dl.acm.org/citation.cfm?id=645531.656005.
+
+Jens Kober and Jan R. Peters. Policy search for motor primitives in robotics. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 849–856. Curran Associates, Inc., 2009.
+
+Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. CoRR, abs/1906.00949, 2019. URL http://arxiv.org/abs/ 1906.00949.
+
+Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Manfred Otto Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. ICLR, 2016.
+
+Nicolas Meuleau, Leonid Peshkin, Leslie P. Kaelbling, and Kee eung Kim. Off-policy policy search. Technical report, 2000.
+
+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 00280836. URL http://dx.doi.org/10.1038/nature14236.
+
+Remi Munos, Thomas Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient ´ off-policy reinforcement learning. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS’16, pp. 1054–1062, USA, 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3157096. 3157214.
+
+Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML’10, pp. 807–814, USA, 2010. Omnipress. ISBN 978-1-60558-907-7. URL http://dl.acm.org/citation.cfm?id $\equiv$ 3104322.3104425.
+
+Gerhard Neumann. Variational inference for policy search in changing situations. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML’11, pp. 817–824, USA, 2011. Omnipress. ISBN 978-1-4503-0619-5. URL http://dl.acm.org/ citation.cfm?id=3104482.3104585.
+
+Gerhard Neumann and Jan R. Peters. Fitted q-iteration by advantage weighted regression. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 1177–1184. Curran Associates, Inc., 2009.
+
+Junhyuk Oh, Yijie Guo, Satinder Singh, and Honglak Lee. Self-imitation learning. 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. 3878–3887, Stockholmsmassan, ¨ Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/oh18b.html.
+
+Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, July 2017.
+
+Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Exampleguided deep reinforcement learning of physics-based character skills. ACM Trans. Graph., 37 (4):143:1–143:14, July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201311. URL http: //doi.acm.org/10.1145/3197517.3201311.
+
+Jan Peters and Stefan Schaal. Reinforcement learning by reward-weighted regression for operational space control. In Proceedings of the 24th International Conference on Machine Learning, ICML ’07, pp. 745–750, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-793-3. doi: 10.1145/ 1273496.1273590. URL http://doi.acm.org/10.1145/1273496.1273590.
+
+Jan Peters, Katharina Mulling, and Yasemin Alt ¨ un. Relative entropy policy search. In ¨ Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, AAAI’10, pp. 1607–1612. AAAI Press, 2010. URL http://dl.acm.org/citation.cfm?id=2898607.2898863.
+
+Vitchyr Pong. Rlkit. https://github.com/vitchyr/rlkit, 2019.
+
+Doina Precup, Richard S. Sutton, and Sanjoy Dasgupta. Off-policy temporal difference learning with function approximation. In Proceedings of the Eighteenth International Conference on Machine Learning, ICML ’01, pp. 417–424, San Francisco, CA, USA, 2001. Morgan Kaufmann Publishers Inc. ISBN 1-55860-778-1. URL http://dl.acm.org/citation.cfm?id $=$ 645530.655817.
+
+Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. In Proceedings of Robotics: Science and Systems (RSS), 2018.
+
+John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1889–1897, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr. press/v37/schulman15.html.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/ 1707.06347.
+
+Richard S. Sutton and Andrew G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981.
+
+Richard S Sutton, David A. McAllester, Satinder P. Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In S. A. Solla, T. K. Leen, and K. Muller (eds.), ¨ Advances in Neural Information Processing Systems 12, pp. 1057–1063. MIT Press, 2000.
+
+Qing Wang, Jiechao Xiong, Lei Han, peng sun, Han Liu, and Tong Zhang. Exponentially weighted imitation learning for batched historical data. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 6288–6297. Curran Associates, Inc., 2018.
+
+Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and ´ Nando de Freitas. Sample efficient actor-critic with experience replay. CoRR, abs/1611.01224, 2016. URL http://arxiv.org/abs/1611.01224.
+
+Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8(3-4):229–256, May 1992. ISSN 0885-6125. doi: 10.1007/BF00992696. URL https://doi.org/10.1007/BF00992696.
\ No newline at end of file
diff --git a/md/train/V5V1vGrI2z/V5V1vGrI2z.md b/md/train/V5V1vGrI2z/V5V1vGrI2z.md
new file mode 100644
index 0000000000000000000000000000000000000000..abd851ece63ad74367fa348f9e76b4138c4f4807
--- /dev/null
+++ b/md/train/V5V1vGrI2z/V5V1vGrI2z.md
@@ -0,0 +1,234 @@
+# Exploring Cross-Video and Cross-Modality Signals for Weakly-Supervised Audio-Visual Video Parsing
+
+Yan-Bo Lin1,2 Hung-Yu Tseng3 Hsin-Ying Lee4 Yen-Yu Lin1 Ming-Hsuan Yang3,5,6
+
+1National Yang Ming Chiao Tung University 2UNC Chapel Hill 3UC Merc 4Snap Research 5Google Research 6Yonsei University yblin@unc.edu htseng6@ucmerced.edu hlee5@snap.com lin@cs.nctu.edu.tw mhyang@ucmerced.edu
+
+# Abstract
+
+The audio-visual video parsing task aims to temporally parse a video into audio or visual event categories. However, it is labor-intensive to temporally annotate audio and visual events and thus hampers the learning of a parsing model. To this end, we propose to explore additional cross-video and cross-modality supervisory signals to facilitate weakly-supervised audio-visual video parsing. The proposed method exploits both the common and diverse event semantics across videos to identify audio or visual events. In addition, our method explores event co-occurrence across audio, visual, and audio-visual streams. We leverage the explored cross-modality co-occurrence to localize segments of target events while excluding irrelevant ones. The discovered supervisory signals across different videos and modalities can greatly facilitate the training with only video-level annotations. Quantitative and qualitative results demonstrate that the proposed method performs favorably against existing methods on weakly-supervised audio-visual video parsing.
+
+# 1 Introduction
+
+Humans perceive multisensory signals via seeing, hearing, touching, etc., and obtain multimodal information while exploring the surrounding environments. Visual and audio signals, the most common modalities, motivate researchers to jointly comprehend audio-visual events (e.g., see people singing and hear their sounds) [1, 2, 3, 4, 5, 6, 7]. Events visible in images while hearable in audio are referred to as audio-visual events. However, learning-based models tend to recognize a particular audio-visual event by using the data from the dominant modality with richer information and overlook clues from either audio only or visual only events which still contribute to holistic video understanding. Therefore, the resultant models can generalize well on audio-visual events only instead of comprehensively understanding all kinds of video events. To address this issue, we target at audio-visual video parsing [4, 6] where predictions for audio, visual, and audio-visual events with temporal boundaries are all required but separately evaluated.
+
+The time-consuming and labor-intensive annotation process poses a major challenge for the audiovisual video parsing task. To address this issue, Tian et al. [4] handle this task in a weakly-supervised manner given only video-level labels, which indicate events of presence without temporal boundaries and detailed modalities. They develop an audio-visual co-attention mechanism to assemble discriminative multimodal representations and use multiple instance learning to aggregate frame-level predictions into video-level ones. However, video-level labels alone cannot identify which modality events are from. Wu et al. [6] then propose to perform label refinement by swapping the audio and visual tracks of different videos to estimate and remove irrelevant event categories for each modality. They further adopt temporal contrastive learning to align audio and visual representations from the same frame. However, the contrastive learning is based on the assumption that audio and visual signals are synchronized, which may not hold in practical scenarios with complex events. Furthermore, these methods [4, 6] only consider audio and visual tracks of a single video without exploiting the relationship across categories and videos, which also provide rich shared semantics regarding event categories.
+
+In this work, we propose to leverage audio and visual data across different videos to explore shared information of each category. For example, videos with singing events may have similar patterns whatever in an audio or a visual modality. By observing all videos in a training batch, we can not only explore the shared semantics among audio-visual data but also exclude unrelated events. In addition to the relationship across different videos, we exploit the dependency between event categories. For example, when people are singing, there is usually a music accompaniment. Therefore, we propose to treat audio, visual, and audio-visual streams separately and adopt an audio-visual class co-occurrence module that jointly explores the relationship of different categories among all streams. By measuring the similarity of event categories from audio, visual, and audio-visual events, the correlated events are more likely to be correctly determined as the presence or absence of event categories. Such a strategy can robustly learn the correlation of categories within/across modality and fully exploit video data. The proposed strategy can be applied to existing methods on video parsing.
+
+We evaluate the proposed method on the LLP [4] dataset. Videos are parsed into audio, visual, and audio-visual events under both segment and event levels, and evaluated with F-scores metrics. Both qualitative and quantitative results demonstrate the effectiveness of the proposed method on the audio-visual video parsing task. The main contributions of this work are summarized as follows:
+
+• We leverage audio and visual data across different videos and tracks, which can learn common semantics of the same events and discern unrelated clues. • We develop an audio-visual event co-occurrence module that jointly considers the relationship of categories in audio, visual, and audio-visual modalities, which can prevent models from differentiating the representations of the related events. • Qualitative and quantitative experimental results on the benchmark dataset demonstrate that the proposed method performs favorably against the state-of-the-arts in various settings.
+
+# 2 Related Work
+
+Audio-Visual Representation Learning. Implicit correlation between audio and visual data from videos provides rich information for audio-visual representation learning. First, the audio-visual pairs from the same video clip [8, 9, 10, 11, 12, 13, 14, 15, 16, 17] are strongly correlated based on the assumption that audio and visual data from a video are synchronized and highly correlated. Moreover, features extracted from unpaired video clips tend to be more diverse than those from the same clips. Second, by exploring audio-visual temporal synchronization [18, 19], temporal information can be served as a training guidance. Given a video sequence, existing methods [18, 19] distinguish audio and visual features from different frames while correlating features from the same frames. Such an idea enhances robust audio-visual representation learning that is essential to several tasks such as audio-visual event localization/parsing/recognition [1, 2, 3, 4, 5, 6, 7, 20], sound separation [21, 22, 23, 24, 25, 26, 27, 28, 29, 30], audio spatialization [31, 32, 33, 34, 35, 36, 37, 38], and sound localization [39, 40, 41, 42, 43, 44]. Instead of random sampling sound and images, our method selects both related and irreverent videos to explore common semantics and discern dissimilar events.
+
+Audio-Visual Video Event Localization and Parsing. Audio-visual video parsing aims to detect events in videos and identify audio, visual, and audio-visual events (e.g., seeing the event and hearing its sound) and activities. Videos can be parsed with event categories and boundaries in both audio and visual modalities. Early researches [5, 7, 2, 3] aim to jointly derive audiovisual information in each local segment of the input video for audio-visual event localization, which emphasizes to detect only audio-visual events. However, due to the inconsistent information observed from audio and visual signals, data from either modality with insufficient clues may degrade the performance of prediction. Therefore, the work [7] focuses on audio/visual data with relevant categorical events to tackle this issue. Although methods of this category present favorable results, they are applicable to audio-visual event localization, which considers only synchronous audio-visual events or not. Recently, multi-modal multiple instance learning (MMIL) based methods with hybrid attention [4] carry out weakly-supervised audio-visual video parsing. These methods aggregate segment-level predictions into video-level ones, with which optimizing a model by using video-level or weak labels is enabled. Since video-level labels are typically insufficient to identify either audio or visual events, Wu et al. [6] generate pseudo labels for each modality by exchanging audio and visual tracks between unrelated videos. However, we notice that videos with replaced sounds or images may share some common semantics. Our method can exploit videos in a training batch to extract their common semantics for a categorical event and discern unrelated clues. Furthermore, we can leverage the relationship between event classes to find out related events (e.g., singing may accompany music).
+
+
+Figure 1: Algorithmic overview. Our framework consists of a visual feature extractor, an audio feature extractor, a feature aggregation module, MMIL pooling, shared cross-modality semantics, and an cross-modality co-occurrence module. Given $n$ videos of $T$ seconds, the visual and audio feature extractors compute their visual and audio features. The feature aggregation module [4] conducts self- and cross-modality attention to aggregate segment-wise audio $\bar { \hat { \mathbf { f } ^ { a } } }$ and visual $\hat { \mathbf { f } ^ { v } }$ representations. We map segment-wise aggregated features to class-specific features by exploring cross-modality co-occurrence. By performing self- and cross-modality attention for class features, we identify within and cross modalities relationship between classes for event predictions. Note that $\otimes$ denotes matrix multiplication with the softmax operation performing on each row, and the green block only shows the example for segment-wise visual prediction at time $t$ . We also leverage the aggregated features of all $n$ videos to figure out common semantics regrading events by maximizing the similarities between related videos while minimizing those between unrelated videos with Eq. 8. The MMIL Pooling [4] is an attention-based pooling function that aggregates segment-wise results to produce video-level ones, which are optimized by the binary cross entropy loss described in Eq. 3 and Eq. 6.
+
+# 3 Proposed Method
+
+In this paper, we propose a novel framework for weakly-supervised audio-visual video parsing. In order to explore common semantics across videos and dependency across event categories, the proposed model leverages all audio and visual signals across videos in a training batch and the correlation between classes for each training instance. In Section 3.1, we first define the notations and settings considered in this paper and revisit the common backbone [4, 6] for weakly-supervised audio-visual video parsing, which consists of feature aggregation and multi-modal multiple instance learning (MMIL) pooling. Then in Section 3.2 and Section 3.3, we detail the modules we propose to capture dependency across different events and information across different videos, respectively.
+
+# 3.1 Preliminaries
+
+Problem Formulation and Notations. Given a video sequence $S$ with $T$ seconds long, we obtain $T$ non-overlapping audio and visual segments where each segment is one-second long. Models are aiming to predict the event labels for each segment, which may contain several or no events. At time $t$ , there are three targets for audio, visual, and audio-visual events: $\mathbf { y } _ { t } ^ { a } \in \mathbb { R } ^ { 1 \times C } , \mathbf { y } _ { t } ^ { v } \in \mathbb { R } ^ { 1 \times C }$ and $\mathbf { y } _ { t } ^ { a v } \in \mathbb { R } ^ { 1 \times C }$ are multi-class event label with $C$ event categories. $\mathbf { y } _ { t } ^ { a } , \mathbf { y } _ { t } ^ { v }$ , and ${ \bf y } _ { t } ^ { a v }$ denote audio, visual, and audio-visual event labels, respectively. We note that detailed annotations (e.g., $\mathbf { y } _ { t } ^ { a }$ , $\mathbf { y } _ { t } ^ { a }$ , and ${ \bf y } _ { t } ^ { a v }$ ) are not accessible during training and only available during evaluation. As for training, only video-level annotations are available during training. Video-level annotations only contain action event categories without indicating specific times slots or modalities (e.g., audio and visual event).
+
+Revisit of Weakly-Supervised Audio-Visual Video Parsing. The previous method [4] presents promising results with feature aggregation based on transformers and multimodal multiple instance learning (MMIL) pooling. Given a video sequence $S$ of $T$ frames, we denote its audio and visual feature sets by ${ \bf F } ^ { a ^ { * } } = \{ { \bf f } _ { 1 } ^ { a ^ { * } } , . . . , { \bf f } _ { T } ^ { a } \} \in \mathbb { R } ^ { T \times d }$ and $\mathbf { F } ^ { v } = \{ \mathbf { f } _ { 1 } ^ { v } , . . . , \mathbf { f } _ { T } ^ { v } \} \in \mathbb { R } ^ { T \times d }$ , respectively, where $d$ is the feature dimension. The transformer encoder [45] is employed to aggregate both within-modality and cross-modality information using multi-head attention blocks:
+
+$$
+\begin{array} { l } { { \phi _ { s e l f } ( { \bf f } _ { t } ^ { a } , { \bf F } ^ { a } , { \bf F } ^ { a } ) = \mathrm { S o f t m a x } ( \frac { { \bf f } _ { t } ^ { a } { \bf F } ^ { a } ^ { \top } } { \sqrt { d } } ) { \bf F } ^ { a } , } } \\ { { \phi _ { c r o s s } ( { \bf f } _ { t } ^ { a } , { \bf F } ^ { v } , { \bf F } ^ { v } ) = \mathrm { S o f t m a x } ( \frac { { \bf f } _ { t } ^ { a } { \bf F } ^ { v } ^ { \top } } { \sqrt { d } } ) { \bf F } ^ { v } , } } \end{array}
+$$
+
+where $\phi _ { s e l f } ( \cdot )$ and $\phi _ { c r o s s } ( \cdot )$ are self-attention and cross-modality attention functions respectively. They perform dot-product on features across time stamps by using non-shared MLPs. Then the jointly aggregated representations are described as follows:
+
+$$
+\begin{array} { r } { \hat { \mathbf { f } } _ { t } ^ { a } = \mathbf { f } _ { t } ^ { a } + \phi _ { s e l f } ( \mathbf { f } _ { t } ^ { a } , \mathbf { F } ^ { a } , \mathbf { F } ^ { a } ) + \phi _ { c r o s s } ( \mathbf { f } _ { t } ^ { a } , \mathbf { F } ^ { v } , \mathbf { F } ^ { v } ) , } \\ { \hat { \mathbf { f } } _ { t } ^ { v } = \mathbf { f } _ { t } ^ { v } + \phi _ { s e l f } ( \mathbf { f } _ { t } ^ { v } , \mathbf { F } ^ { v } , \mathbf { F } ^ { v } ) + \phi _ { c r o s s } ( \mathbf { f } _ { t } ^ { v } , \mathbf { F } ^ { a } , \mathbf { F } ^ { a } ) , } \end{array}
+$$
+
+With the aggregated audio and visual features $\hat { \mathbf { f } } _ { t } ^ { a }$ and $\hat { \mathbf { f } } _ { t } ^ { v }$ , we can obtain the frame-wise event prediction $\hat { \mathbf { p } } _ { t } ^ { a } \in \mathbb { R } ^ { 1 \times \widetilde { C } }$ and $\hat { \mathbf { p } } _ { t } ^ { v } \in \mathbb { R } ^ { 1 \times C }$ , and the attention weights computed by MLPs and normalized by a softmax function for audio, visual, and audio-visual streams (i.e., $\mathbf { w } _ { t } ^ { a } \in \mathbb { R } ^ { 1 \times C }$ , $\mathbf { w } _ { t } ^ { v } \in \mathbb { R } ^ { 1 \times C }$ , and $\mathbf { w } _ { t } ^ { a v } \in \mathbb { R } ^ { 2 \times C } ,$ ). Then the video-level prediction is gathered with the MMIL pooling:
+
+$$
+\bar { \mathbf { p } } ^ { a } = \sum _ { t = 1 } ^ { T } \mathbf { w } _ { t } ^ { a } \hat { \mathbf { p } } _ { t } ^ { a } , \bar { \mathbf { p } } ^ { v } = \sum _ { t = 1 } ^ { T } \mathbf { w } _ { t } ^ { v } \hat { \mathbf { p } } _ { t } ^ { v } , \mathrm { a n d } \bar { \mathbf { p } } ^ { a v } = \sum _ { t = 1 } ^ { T } \mathbf { w } _ { t } ^ { a v } [ 0 ] \mathbf { w } _ { t } ^ { a } \hat { \mathbf { p } } _ { t } ^ { a } + \mathbf { w } _ { t } ^ { a v } [ 1 ] \mathbf { w } _ { t } ^ { v } \hat { \mathbf { p } } _ { t } ^ { v } .
+$$
+
+The model can then be optimized using the binary cross-entropy loss function between $\bar { \bf p }$ and a video-level weak label $\bar { \mathbf { y } } \in \mathbb { R } ^ { 1 \times C }$ , which does not indicate time boundaries and modalities for events.
+
+# 3.2 Cross-Modality Co-Occurrence
+
+Videos with multi-label events contain rich information among event categories because the related events are likely to present at the same time. The correlation is useful for models to robustly predict the presence or absence of events.
+
+Similar to [46], to explicitly model the relationship between event categories in different modalities, we first obtain the representations for each class and then measure the correlation. We note that the class relationships may be different in audio and visual modalities. That is why the work [46] cannot be directly applied to audio-visual video parsing since audio or visual events can be partially or jointly presented at a single frame. Thus, jointly understanding the class relationship within a modality and across two modalities can benefit the audio-visual video parsing task.
+
+In order to map the frame-wise audio and visual features into class-level ones, the nonlinear transformation with MLPs is formulated as follows:
+
+$$
+\begin{array} { r } { \mathbf { a } _ { t , c } = \operatorname { R e L U } ( \hat { \mathbf { f } } _ { t } ^ { a } \mathbf { M } _ { c } ^ { a } + \mathbf { b } _ { c } ^ { a } ) , } \\ { \mathbf { v } _ { t , c } = \operatorname { R e L U } ( \hat { \mathbf { f } } _ { t } ^ { v } \mathbf { M } _ { c } ^ { v } + \mathbf { b } _ { c } ^ { v } ) , } \end{array}
+$$
+
+where $\mathbf { a } _ { t , c }$ and $\mathbf { v } _ { t , c }$ are audio and visual class-level features for class $c$ at time $t$ with dimension $1 \times d _ { c }$ , respectively. The weights and biases for class $c$ for audio and visual features are denoted as $\mathbf { M } _ { c } ^ { a }$ $\mathbf { \Psi } _ { : } ^ { i } , \mathbf { M } _ { c } ^ { i } \in \mathbb { R } ^ { d \times } \mathbf { \tilde { { d } } } _ { c }$ and ${ \bf b } _ { c } ^ { a }$ $\mathbf { \bar { b } } _ { c } ^ { v } \in \mathbb { R } ^ { 1 \times d _ { c } }$ . With class-level representations, we can further model the relationship between event categories within and across modalities by self-attention and crossmodality co-attention mechanism:
+
+$$
+\begin{array} { r } { \hat { \mathbf { a } } _ { t , c } = \mathbf { a } _ { t , c } + \phi _ { s e l f } ( \mathbf { a } _ { t , c } , \mathbf { A } _ { t } , \mathbf { A } _ { t } ) + \phi _ { c r o s s } ( \mathbf { a } _ { t , c } , \mathbf { V } _ { t } , \mathbf { V } _ { t } ) , } \\ { \hat { \mathbf { v } } _ { t , c } = \mathbf { v } _ { t , c } + \phi _ { s e l f } ( \mathbf { v } _ { t , c } , \mathbf { V } _ { t } , \mathbf { V } _ { t } ) + \phi _ { c r o s s } ( \mathbf { v } _ { t , c } , \mathbf { A } _ { t } , \mathbf { A } _ { t } ) , } \end{array}
+$$
+
+where $\mathbf { A } _ { t } = \{ \mathbf { a } _ { t , 1 } , \dotsc , \mathbf { a } _ { t , C } \}$ and $\mathbf { V } _ { t } = \{ \mathbf { v } _ { t , 1 } , \dots , \mathbf { v } _ { t , C } \}$ are sets of audio and visual class features at time $t$ . $\hat { \mathbf { a } } _ { t , c }$ and $\hat { \mathbf { v } } _ { t , c }$ are now co-occcurence features that consider the relationships between categories within and across modalities. We can then predict the probability for each event at time $t$ by MLPs and aggregate every segment-wise predictions into video-level ones i.e.,
+
+$$
+\begin{array} { r l } & { \hat { \mathbf { p } } _ { t } ^ { a } = \sigma ( \mathrm { M L P } _ { a } ( \{ \hat { \mathbf { a } } _ { t , 1 } , \dots , \hat { \mathbf { a } } _ { t , C } \} ) ) , \quad \hat { \mathbf { p } } _ { t } ^ { v } = \sigma ( \mathrm { M L P } _ { v } ( \{ \hat { \mathbf { v } } _ { t , 1 } , \dots , \hat { \mathbf { v } } _ { t , C } \} ) ) , } \\ & { \bar { \mathbf { p } } ^ { a } , \bar { \mathbf { p } } ^ { v } , \bar { \mathbf { p } } ^ { a v } = \mathrm { M M I L } ( \{ \hat { \mathbf { p } } _ { 1 } ^ { a } , \dots , \hat { \mathbf { p } } _ { T } ^ { a } \} , \{ \hat { \mathbf { p } } _ { 1 } ^ { v } , \dots , \hat { \mathbf { p } } _ { T } ^ { v } \} ) } \end{array}
+$$
+
+where $\sigma$ is the sigmoid function, and $\mathrm { M M L } ( \cdot )$ is the multi-modal multiple instance learning pooling described in Eq. 3 taking all segment-wise predictions as inputs. The video-level prediction can be optimized by the binary cross-entropy loss function with a video-level weak label $\bar { \mathbf { y } }$ .
+
+# 3.3 Shared Cross-Modality Semantics across Videos
+
+The information across different videos provides rich supervisory signals that benefit the training of weakly-supervised audio-visual video parsing. By observing videos in a training batch, we can discover both the common and diverse event semantics. With video-level labels, we can initially associate related and irrelevant videos. In order to obtain a discriminative categorical representation, we would like to encourage audio and visual representations from related events to be similar and differentiate those from irrelevant videos. However, targeting at segment-wise representations with specific events is difficult due to the lack of temporal annotations. Therefore, we seek event-related frames through the weights from MMIL pooling in Eq. 3:
+
+$$
+\tilde { \mathbf { f } } ^ { a } = \sum _ { t = 1 } ^ { T } \Big [ \frac { \exp \bigl ( g \bigl ( \bar { \mathbf { y } } \odot \mathbf { w } _ { t } ^ { a } \bigr ) \bigr ) } { \sum _ { t ^ { \prime } = 1 } ^ { T } \exp \bigl ( g \bigl ( \bar { \mathbf { y } } \odot \mathbf { w } _ { t ^ { \prime } } ^ { a } \bigr ) \bigr ) } \hat { \mathbf { f } } _ { t } ^ { a } \Big ] , \quad \tilde { \mathbf { f } } ^ { v } = \sum _ { t = 1 } ^ { T } \Big [ \frac { \exp \bigl ( g \bigl ( \bar { \mathbf { y } } \odot \mathbf { w } _ { t } ^ { v } \bigr ) \bigr ) } { \sum _ { t ^ { \prime } = 1 } ^ { T } \exp \bigl ( g \bigl ( \bar { \mathbf { y } } \odot \mathbf { w } _ { t ^ { \prime } } ^ { v } \bigr ) \bigr ) } \hat { \mathbf { f } } _ { t } ^ { v } \Big ] ,
+$$
+
+where $\odot$ and $g ( . )$ are element-wise dot product and summation function over all elements respectively.
+
+With video-level labels and features ${ \tilde { \mathbf { f } } } ^ { a }$ and $\tilde { \mathbf { f } } ^ { v }$ ), we adopt contrastive learning [47, 48, 49] to encourage features across modalities with the same event category (at least one) to be close and those with different events to be far away from each other. We leverage all $n$ videos in a batch to explore diverse semantics, where the sets of audio and visual features are denoted as $\{ \widetilde { \bf f } _ { ( 0 ) } ^ { a } , . . . , \widetilde { \bf f } _ { ( n ) } ^ { a } \}$ and $\{ \tilde { \mathbf { f } } _ { ( 0 ) } ^ { v } , . . . , \tilde { \mathbf { f } } _ { ( n ) } ^ { v } \}$ respectively with video-level labels $\left\{ \bar { \mathbf { y } } _ { ( 0 ) } , . . . , \bar { \mathbf { y } } _ { ( n ) } \right\}$ . The relationship across videos can be optimized by the proposed training objective as follows:
+
+$$
+\mathcal { L } _ { \mathrm { c o n t r a s t } } = - \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \Big [ \log \frac { \sum _ { j = 1 } ^ { n } f ( \bar { \bf y } _ { i } \cdot \bar { \bf y } _ { j } ) \exp ( \tilde { \bf f } _ { ( i ) } ^ { a } \cdot \tilde { \bf f } _ { ( j ) } ^ { v } / \tau ) } { \sum _ { j = 1 } ^ { n } \exp ( \tilde { \bf f } _ { ( i ) } ^ { a } \cdot \tilde { \bf f } _ { ( j ) } ^ { v } / \tau ) } \Big ] ,
+$$
+
+where $f ( \cdot )$ is a clipping function that clips values over 1, and $\tau$ denotes a hyper-parameter controlling the temperature. Thus, the proposed method can be optimized by joint the binary cross-entropy loss mentioned in Section 3.1 and the contrastive learning loss in Eq. 8. Our training strategy can exploit cross-modality information across videos and event categories to understand common semantics while ignoring irrelevant ones.
+
+# 4 Experimental Results
+
+Datasets. We use the Look, Listen and Parse (LLP) Dataset [4] for all experiments. The LLP dataset consists of 11, 849 10-seconds video clips annotated with 25 event categories. It covers various real-life scenes such as speech, music performances, car, cheering, dog, etc. Particularly, there are 7202 video clips labeled with more than one event category. We use the 10000 video clips with only video-level event annotations for model training. The detailed annotations (e.g., individual audio and visual events per second) are available for the remaining 1849 validation and test videos. For all experiments, we use the official data splits from the LLP dataset.
+
+Evaluation Metrics. Following previous work [4, 6], we adopt F-scores as the evaluation metrics. Note that all types of events (audio, visual, and audio-visual) are measured under both segmentlevel and event-level metrics. The segment-level metrics can evaluate snippet-wise prediction results. As for the event-level metrics, the clips are extracted by concatenating positive consecutive segments in the same events. Then, we compute the event-level F-scores with $\mathrm { m I o U } = 0 . 5$ as the threshold. Furthermore, the overall Type $\ @ \mathbf { A V }$ performance on audio-visual scene is also considered by computing the averaged audio, visual, and audio-visual event evaluation results. Instead of directly averaging results from different event types, Event@AV considers all audio and visual event categories for each sample.
+
+Table 1: Quantitative results of weakly-supervised audio-visual video parsing. We evaluate all methods on the LLP dataset [4] with F-scores in five different event types and two kinds of segments. The first row indicates five different event types (audio, visual, audio-visual, Type@AV, and Event@AV). In the second row, two kinds of segments are shown: Seg. and Event are segmentlevel and event-level; and $^ *$ indicates only label refinement is utilized for fair comparisons.
+
+
Method
Audio
Visual
Audio-visual
Type@AV
Event@AV
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
AVE [5]
47.2
40.4
37.1
34.7
35.4
31.6
39.9
35.5
41.6
36.5
AVSDN [2]
47.8
34.1
52.0
46.3
37.1
26.5
45.7
35.6
50.8
37.7
AVSDN + Ours
48.3
41.2
52.4
48.5
46.9
40.0
49.2
43.2
53.2
40.1
HAN [4]
60.1
51.3
52.9
48.9
48.9
43.0
54.0
47.7
55.4
48.0
HAN + Ours
59.2
51.3
59.9
55.5
53.4
46.2
57.5
51.0
58.1
49.7
MA [6]
60.3
53.6
60.0
56.4
55.1
49.0
58.9
53.0
57.9
50.6
MA*
59.8
52.1
57.5
54.4
52.6
45.8
56.6
50.8
56.6
49.4
MA*+Ours
60.8
53.8
63.5
58.9
57.0
49.5
60.5
54.0
59.5
52.1
+
+Implementation Details. We implement the proposed method using PyTorch [50], and conduct the training and evaluation processes on a single NVIDIA GTX 1080 Ti GPU with 11 GB memory. Following [4, 6], we use the same visual and audio encoders for fair comparisons. We adopt both ResNet-152 [51] pre-trained on ImageNet [52] and 3D ResNet [53] pre-trained on Kinetics-400 [54] as visual feature extractors. Visual frames are sampled at 8 fps and their 2D and 3D visual features are extracted. The 2D and 3D visual features are concatenated and then processed by an MLP as the segment-wise representations. As for audio data, we utilize VGGish [55] pre-trained on AudioSet [56] to extract 128-dimensional audio features. The code and models are publicly available.
+
+Evaluated methods. We compare the proposed method based on several baselines to the following weakly-unsupervised approaches to the audio-visual video parsing task:
+
+• AVE [5] consists of an audio-guided co-attention mechanism to adaptively learn the sounding regions. We note that AVE [5] deals with the audio-visual event localization task. Thus, we follow [4] and add additional audio and visual parsing branches for the weakly-supervised audio-visual video parsing task as a baseline.
+• AVSDN [2] is a sequence-to-sequence-based model to integrate global audio and visual features to local ones. Since AVSDN [2] also deals with the audio-visual event localization task, we make the same modifications to AVSDN as those to AVE.
+• HAN [4] is a multi-modal multiple instance learning-based method with a hybrid attention network.
+• MA [6] reports the state-of-the-art performance on the weakly-supervised audio-visual video parsing task. It is a method based on HAN with the label refinement and the audio-visual contrastive learning differentiating temporal segments.
+
+# 4.1 Quantitative Evaluation
+
+Table 1 shows the quantitative comparisons on the LLP dataset [4]. The proposed method performs favorably against the competing approaches on the weakly-supervised audio-visual video parsing task. Since our method can be easily extended to existing methods, we extend the proposed on three baselines. The third, fifth, and last rows in Table 1 indicate that the proposed method generally benefits three baselines on several metrics of the audio-visual video parsing task by a large margin. We note that $\mathbf { M A } ^ { * }$ [6] only utilizes label refinement to refine labels for each modality, and temporal difference audio-visual contrastive learning [6] is not implemented.
+
+Table 2: Ablation study. We investigate the effect of using different design components in the proposed method. We show how proposed cross-modality co-occurrence (CM-Co) in Section 3.3 and shared cross-modality semantics across videos (CM-S) module in Section 3.2 improve the baselines.
+
+
Method
Audio
Visual
Audio-visual
Type@AV
Event@AV
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
HAN [4]
60.1
51.3
52.9
48.9
48.9
43.0
54.0
47.7
55.4
48.0
HAN + CM-S
58.1
49.6
58.3
53.6
53.2
46.3
56.5
49.8
55.9
47.5
HAN + CM-Co
59.7
51.4
57.4
52.4
51.9
44.2
56.3
49.3
57.4
48.5
HAN + Ours
59.2
51.3
59.9
55.5
53.4
46.2
57.5
51.0
58.1
49.7
MA [28]
60.3
53.6
60.0
56.4
55.1
49.0
58.9
53.0
57.9
50.6
MA + CM-Co
61.1
53.3
61.7
57.3
56.3
49.0
59.7
53.0
58.9
51.2
MA*
59.8
52.1
57.5
54.4
52.6
45.8
56.6
50.8
56.6
49.4
MA* + CM-S
60.4
53.5
60.7
56.5
55.8
47.5
58.9
52.5
58.6
51.0
MA* + CM-Co
60.5
53.6
61.3
56.5
54.9
46.7
58.9
52.3
59.1
51.4
MA* +Ours
60.8
53.8
63.5
58.9
57.0
49.5
60.5
54.0
59.5
52.1
+
+We notice that our method significantly improves baselines in the metrics of visual, audio-visual, Type $@ \mathrm { A V } ,$ and Event $@$ AV. By observing the class distribution of training sets, we find that $3 1 \%$ , $7 \%$ , and $9 \%$ training videos contain speech, singing, and violin events. These events are more likely to present in the audio modality. Therefore, the video-level labels would limit the performance regarding visual events. The proposed method can leverage additional cross-video and cross-modality supervisory signals to explore common semantics, which can improve results in vision-related metrics.
+
+# 4.2 Ablation Study
+
+Cross-Modality Co-Occurrence and Semantics across Video. We conduct the ablation study to analyze the individual impact of each developed component in the proposed method. The results are presented in Table 2. CM-Co represents the usage of the cross-modality co-occurrence module described in Section 3.2, which leverages the relationship between categories within and cross modalities. CM-S indicates the shared cross-modality semantics across videos module described in Section 3.3, which considers all audio and visual information across videos in a batch.
+
+In Table 2, we note that both CM-S and CM-Co can improve baselines in several metrics. By exploring common semantics among training videos (CM-S), we improve the performance on visual and audio-visual evaluation by a large margin. Such a strategy can exploit additional information from videos to address the potential drawback of video-level labels described in Section 4.1. Furthermore, the proposed cross-modality co-occurrence module (CM-Co) also presents favorable results. We note that the significant improvement in Event@AV evaluation with the usage of CM-Co can verify the efficacy of considering the relationship between categories within and across modalities. Since Event $@$ AV considers all audio and visual events for the F-score (e.g., truth positive from both audio and visual events), the improvement of Event@AV indicates our cross-modality co-occurrence can perform well on video parsing when events present in an audio or a visual modality.
+
+In the second group of the evaluated methods in Table 2, we verify if the proposed CM-S works better than the contrastive learning method in MA. We perform our CM-S on the MA model. The CM-S exploits information across different videos to address the issue that audio and visual tracks may not be synchronized. Instead, the contrastive learning method in MA is developed based on the assumption of synchronization to associate the audio-visual representation in a single video. Since our CM-S learns diverse and common semantics, it is effective and complementary to the contrastive learning approach in MA performing on a single video. We note that our CM-S generally improves the performance over all segment-level metrics, which supports our claim.
+
+Self-attention and Cross-Modality Co-attention in Co-Occurrence. Since our cross-modality co-occurrence module exploits self-attention among class-level features in the same modality and cross-modality co-attention on cross-modality class-level representations to model the relationship between categories in the same and different modalities. Taking class-level audio features in Eq. 5 as an example, the class-level self-attention and cross-modality co-attention are $\mathrm { a t t n } ( \mathbf { a } _ { t , c } , \mathbf { A } _ { t } , \mathbf { A } _ { t } )$ and $\operatorname { a t t n } ( \mathbf { a } _ { t , c } , \mathbf { V } _ { t } , \mathbf { V } _ { t } ) .$ , respectively.
+
+Table 3: Ablation study. We investigate the effect of different developed mechanisms in the proposed cross-modality co-occurrence (CM-Co) module in Section 3.2. In Eq. 5, class-level features are processed by self-attention and cross-modality co-attention mechanisms. A Only and $\mathbf { V }$ Only indicate only self-attention performs for individual audio and visual events respectively. AV denotes performing self-attention for audio and visual events. CM-Co is the proposed method that considers relationship between categories within and cross modalities by both self-attention and cross-modality co-attention mechanisms.
+
+
Method
Audio
Visual
Audio-visual
Type@AV
Event@ AV
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
Seg.
Event
HAN [4]
60.1
51.3
52.9
48.9
48.9
43.0
54.0
47.7
55.4
48.0
HAN + A Only
60.5
52.3
49.8
43.9
45.6
38.3
52.0
44.8
55.7
45.9
HAN + V Only
56.1
44.5
56.8
53.2
49.7
40.7
54.2
46.1
54.1
44.6
HAN + AV
59.5
50.3
55.1
50.5
48.6
40.3
54.4
47.0
56.0
47.4
HAN + CM-Co
59.7
51.4
57.4
52.4
51.9
44.2
56.3
49.3
57.4
48.5
MA*[6]
59.8
52.1
57.5
54.4
52.6
45.8
56.6
50.8
56.6
49.4
MA*+ A Only
60.7
52.7
53.9
47.9
50.1
42.2
54.9
47.6
57.0
47.1
MA* + V Only
46.8
34.4
60.8
57.0
42.8
31.1
50.1
40.9
52.6
40.4
MA*+ AV
58.3
50.4
59.4
55.2
53.9
46.9
57.2
50.8
56.7
48.5
MA*+ CM-Co
60.5
53.6
61.3
56.5
54.9
46.7
58.9
52.3
59.1
51.4
+
+Table 4: Ablation study. We evaluate the proposed method in accuracy, efficiency, and model sizes. We show the numbers of parameters and FLOPs for the proposed cross-modality co-occurrence (CM-Co) and HAN [4] with a few layers.
+Note that the results are all in the segment level.
+
+
Method
Audio
Visual
Audio-visual
Type@AV
Event@AV
GFLOPs
Params
HAN 1 Layer
60.1
52.9
48.9
54.0
55.4
6.63
2.4M
HAN 2 Layers
58.2
55.4
50.6
54.7
54.9
7.28
2.9M
HAN 3 Layers
58.1
55.2
50.3
54.5
54.6
7.97
3.5M
HAN + CM-Co
59.7
57.4
51.9
56.3
57.4
6.99
2.8M
+
+Table 3 presents the results in various modifications of the cross-modality co-occurrence module. We note that the design of co-occurrence in the same and cross modalities can generally improve the results in several metrics. We also evaluate the co-occurrence module in a single modality. The results are shown in the second, third, seventh, and eighth rows in Table 3, where A Only and $\mathbf { V }$ Only indicate the co-occurrence module only leverages the relationship between categories in audio or visual data respectively. As the results shown in the second and seventh rows, training with co-occurrence in audio events only (i.e., A Only) can slightly improve the performance on audio events. Similarly, considering visual event only (i.e., V Only) can benefit the results regarding visual events. Furthermore, the co-occurrence for both audio and visual categories (AV) in the fourth and ninth rows can contribute to the results in general metrics such as Type $@$ AV and Event $@ \mathrm { A V } .$ . We then further consider the correlation between events across modalities. That is the cross-modality co-occurrence module (CM-Co) in the fifth and tenth rows. The results can confirm the efficacy of the proposed cross-modality co-occurrence module in all metrics except segment-level audio events caused by similar reasons discussed in Section 4.1.
+
+Model Capacity. Since our cross-modality co-occurrence module leverages class-level representations, it would increase the capability of models on capturing information. For fair comparisons, we add extra parameters to HAN [4] to analyze whether more parameters can contribute to performance gain. Specifically, we increase the number of layers in its transformer-based feature aggregation to 2 and 3, respectively.
+
+In Table 4, we report the results in accuracy, computational costs, and model sizes. The first three rows show the performance of HAN with different numbers of layers. We note that HAN with one extra layer has more parameters than the proposed co-occurrence module. However, the results of HAN with extra layers indicate that using more parameters/layers for HAN does not improve the performance. The proposed cross-modality co-occurrence module enhances HAN more effectively.
+
+
+Figure 2: Qualitative comparisons. We compare the proposed method with the state-of-the-art weakly-supervised audio-visual video parsing method on the LLP dataset [4]. The frame-wise annotations are shown in gray and purple bars. The gray bar denotes visual events, and the purple bar represents audio events. GT_V and GT_A are the ground-truth visual and audio events respectively. Our results are shown in the green block, and the results by the competing method, MA [6], are present in the blue block.
+
+
+Figure 3: Audio feature distribution by using t-SNE. The upper figure shows the distribution by our method. The lower figure presents that by $\mathbf { M A } ^ { * }$ . The legend lists all event combinations.
+
+# 4.3 Qualitative Evaluation
+
+Qualitative Results. We present the qualitative results of the evaluated methods in Figure 2. GT_V and GT_A show the ground-truth annotations for visual and audio events, respectively. Pred_V and Pred_A present the predictions made by our method and the state-of-the-art competing method, MA [6], respectively. Our results are shown in the green block, while the results of MA are present in the blue block. In general, our method presents more accurate predictions in both audio and visual events than MA. We note that the whole violin is shown after 7 seconds. That would hamper models for understanding visual events e.g., MA predicts wrong results on violin visual events before 6 seconds. Since our method leverages the relationship between categories, it can still predict correct temporal boundaries for guitar events by jointly considering cello events in the videos.
+
+
+Figure 4: Visual feature distribution by using t-SNE. The upper figure shows the distribution by our method. The lower figure presents that by MA∗. The legend lists all event combinations.
+
+Feature Distribution Visualized by t-SNE. We apply t-SNE to the aggregated audio and visual features from each segment described in Eq. 2. The visualization results are present in Figure 3 and Figure 4, respectively. The legends list all the combinations of multiple labels. For example, in Figure 3, audio events of singing are present as blue spots, and the mixed sounds of singing and violin are shown as purple spots. We note that the related events including multiple events are shown in similar colors. In Figure 4, the proposed method achieves better performance in the sense that similar color spots are closer than the spots in $\mathbf { M A } ^ { * }$ .
+
+# 5 Conclusions
+
+In this paper, we present a novel audio-visual video parsing framework in a weakly-supervised manner that can be applied to existing methods. We propose two modules to exploit the relationship across videos, modalities, and event categories, and explore additional supervisory signals that can benefit audio-visual video parsing. The shared cross-modality semantics module leverages common and diverse event semantics across videos to learn robust cross-modality representations that facilitate models to identify audio, visual, and audio-visual events. Furthermore, the cross-modality co-occurrence module aims to learn the relationship between event categories. It helps localize segments of target events and can exclude irrelevant ones by performing self-attention and crossmodality co-attention on class-wise features, Extensive experimental results show that our approach substantially improves several baselines and performs favorably against the state-of-the-art methods.
+
+Acknowledgments. This work was supported in part by the Ministry of Science and Technology under grants 109- 2221-E-009-113-MY3, 110-2628-E-A49-008, and 110-2634-F007-015. It was also funded in part by Qualcomm through a Taiwan University Research Collaboration Project, the Higher Education Sprout Project of the National Yang Ming Chiao Tung University, and Ministry of Education.
+
+References
+[1] Jun-Tae Lee, Mihir Jain, Hyoungwoo Park, and Sungrack Yun. Cross-attentional audio-visual fusion for weakly-supervised action localization. In ICLR, 2021. 1, 2 [2] Yan-Bo Lin, Yu-Jhe Li, and Yu-Chiang Frank Wang. Dual-modality seq2seq network for audio-visual event localization. In ICASSP, 2019. 1, 2, 6
+[3] Yan-Bo Lin and Yu-Chiang Frank Wang. Audiovisual transformer with instance attention for audio-visual event localization. In ACCV, 2020. 1, 2
+[4] Yapeng Tian, Dingzeyu Li, and Chenliang Xu. Unified multisensory perception: Weaklysupervised audio-visual video parsing. In ECCV, 2020. 1, 2, 3, 4, 5, 6, 7, 8, 9
+[5] Yapeng Tian, Jing Shi, Bochen Li, Zhiyao Duan, and Chenliang Xu. Audio-visual event localization in unconstrained videos. In ECCV, 2018. 1, 2, 6
+[6] Yu Wu and Yi Yang. Exploring heterogeneous clues for weakly-supervised audio-visual video parsing. In CVPR, 2021. 1, 2, 3, 5, 6, 8, 9
+[7] Yu Wu, Linchao Zhu, Yan Yan, and Yi Yang. Dual attention matching for audio-visual event localization. In ICCV, 2019. 1, 2
+[8] Relja Arandjelovic and Andrew Zisserman. Look, listen and learn. In ICCV, 2017. 2
+[9] Relja Arandjelovic and Andrew Zisserman. Objects that sound. In ´ ECCV, 2018. 2
+[10] Yusuf Aytar, Carl Vondrick, and Antonio Torralba. Soundnet: Learning sound representations from unlabeled video. In NeurIPS, 2016. 2
+[11] Andrew Owens, Jiajun Wu, Josh H McDermott, William T Freeman, and Antonio Torralba. Ambient sound provides supervision for visual learning. In ECCV, 2016. 2
+[12] Jean-Baptiste Alayrac, Adrià Recasens, Rosalia Schneider, Relja Arandjelovic, Jason Ramapu- ´ ram, Jeffrey De Fauw, Lucas Smaira, Sander Dieleman, and Andrew Zisserman. Self-supervised multimodal versatile networks. In NeurIPS, 2020. 2
+[13] Humam Alwassel, Dhruv Mahajan, Lorenzo Torresani, Bernard Ghanem, and Du Tran. Selfsupervised learning by cross-modal audio-video clustering. In NeurIPS, 2020. 2
+[14] Yuki M Asano, Mandela Patrick, Christian Rupprecht, and Andrea Vedaldi. Labelling unlabelled videos from scratch with multi-modal self-supervision. In NeurIPS, 2020. 2
+[15] Shuang Ma, Zhaoyang Zeng, Daniel McDuff, and Yale Song. Active contrastive learning of audio-visual video representations. In ICLR, 2021. 2
+[16] Pedro Morgado, Nuno Vasconcelos, and Ishan Misra. Audio-visual instance discrimination with cross-modal agreement. In CVPR, 2021. 2
+[17] Pedro Morgado, Ishan Misra, and Nuno Vasconcelos. Robust audio-visual instance discrimination. In CVPR, 2021. 2
+[18] Andrew Owens and Alexei A. Efros. Audio-visual scene analysis with self-supervised multisensory features. In ECCV, 2018. 2
+[19] Bruno Korbar, Du Tran, and Lorenzo Torresani. Cooperative learning of audio and video models from self-supervised synchronization. In NeurIPS, 2018. 2
+[20] Jinxing Zhou, Liang Zheng, Yiran Zhong, Shijie Hao, and Meng Wang. Positive sample propagation along the audio-visual event line. In CVPR, 2021. 2
+[21] Chuang Gan, Deng Huang, Hang Zhao, Joshua B Tenenbaum, and Antonio Torralba. Music gesture for visual sound separation. In CVPR, 2020. 2
+[22] Ruohan Gao, Rogerio Feris, and Kristen Grauman. Learning to separate object sounds by watching unlabeled video. In ECCV, 2018. 2
+[23] Ruohan Gao and Kristen Grauman. Co-separating sounds of visual objects. In ICCV, 2019. 2
+[24] Xudong Xu, Bo Dai, and Dahua Lin. Recursive visual sound separation using minus-plus net. In ICCV, 2019. 2
+[25] Hang Zhao, Chuang Gan, Wei-Chiu Ma, and Antonio Torralba. The sound of motions. In ICCV, 2019. 2
+[26] Hang Zhao, Chuang Gan, Andrew Rouditchenko, Carl Vondrick, Josh McDermott, and Antonio Torralba. The sound of pixels. In ECCV, 2018. 2
+[27] Efthymios Tzinis, Scott Wisdom, Aren Jansen, Shawn Hershey, Tal Remez, Dan Ellis, and John R. Hershey. Into the wild with audioscope: Unsupervised audio-visual separation of on-screen sounds. In ICLR, 2021. 2
+[28] Yapeng Tian, Di Hu, and Chenliang Xu. Cyclic co-learning of sounding object visual grounding and sound separation. In CVPR, 2021. 2, 7
+[29] Ruohan Gao and Kristen Grauman. Visualvoice: Audio-visual speech separation with crossmodal consistency. In CVPR, 2021. 2
+[30] Ruohan Gao, Tae-Hyun Oh, Kristen Grauman, and Lorenzo Torresani. Listen to look: Action recognition by previewing audio. In CVPR, 2020. 2
+[31] Ruohan Gao and Kristen Grauman. 2.5d-visual-sound. In CVPR, 2019. 2
+[32] Pedro Morgado, Yi Li, and Nuno Vasconcelos. Learning representations from audio-visual spatial alignment. In NeurIPS, 2020. 2
+[33] Pedro Morgado, Nuno Nvasconcelos, Timothy Langlois, and Oliver Wang. Self-supervised generation of spatial audio for 360 video. In NeurIPS, 2018. 2
+[34] Karren Yang, Bryan Russell, and Justin Salamon. Telling left from right: Learning spatial correspondence of sight and sound. In CVPR, 2020. 2
+[35] Hang Zhou, Xudong Xu, Dahua Lin, Xiaogang Wang, and Ziwei Liu. Sep-stereo: Visually guided stereophonic audio generation by associating source separation. In ECCV, 2020. 2
+[36] Yan-Bo Lin and Yu-Chiang Frank Wang. Exploiting audio-visual consistency with partial supervision for spatial audio generation. In AAAI, 2021. 2
+[37] Xudong Xu, Hang Zhou, Ziwei Liu, Bo Dai, Xiaogang Wang, and Dahua Lin. Visually informed binaural audio generation without binaural audios. In CVPR, 2021. 2
+[38] Yu-Ding Lu, Hsin-Ying Lee, Hung-Yu Tseng, and Ming-Hsuan Yang. Self-supervised audio spatialization with correspondence classifier. In ICIP, 2019. 2
+[39] Triantafyllos Afouras, Andrew Owens, Joon Son Chung, and Andrew Zisserman. Selfsupervised learning of audio-visual objects from video. In ECCV, 2020. 2
+[40] Arda Senocak, Tae-Hyun Oh, Junsik Kim, Ming-Hsuan Yang, and In So Kweon. Learning to localize sound source in visual scenes. In CVPR, 2018. 2
+[41] Arda Senocak, Tae-Hyun Oh, Junsik Kim, Ming-Hsuan Yang, and In So Kweon. Learning to localize sound sources in visual scenes: Analysis and applications. TPAMI, 2019. 2
+[42] Rui Qian, Di Hu, Heinrich Dinkel, Mengyue Wu, Ning Xu, and Weiyao Lin. Multiple sound sources localization from coarse to fine. In ECCV, 2020. 2
+[43] Di Hu, Feiping Nie, and Xuelong Li. Deep multimodal clustering for unsupervised audiovisual learning. In CVPR, 2019. 2
+[44] Di Hu, Rui Qian, Minyue Jiang, Xiao Tan, Shilei Wen, Errui Ding, Weiyao Lin, and Dejing Dou. Discriminative sounding objects localization via self-supervised audiovisual matching. In NeurIPS, 2020. 2
+[45] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 4
+[46] Praveen Tirupattur, Kevin Duarte, Yogesh Rawat, and Mubarak Shah. Modeling multi-label action dependencies for temporal action localization. In CVPR, 2021. 4
+[47] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv Preprint, 2018. 5
+[48] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018. 5
+[49] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 5
+[50] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019. 6
+[51] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6
+[52] 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. 6
+[53] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In CVPR, 2018. 6
+[54] João Carreira and Andrew Zisserman. Quo vadis, action recognition? A new model and the kinetics dataset. In CVPR, 2017. 6
+[55] Shawn Hershey, Sourish Chaudhuri, Daniel P. W. Ellis, Jort F. Gemmeke, Aren Jansen, Channing Moore, Manoj Plakal, Devin Platt, Rif A. Saurous, Bryan Seybold, Malcolm Slaney, Ron Weiss, and Kevin Wilson. Cnn architectures for large-scale audio classification. In ICASSP, 2017. 6
+[56] Jort F Gemmeke, Daniel PW Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R Channing Moore, Manoj Plakal, and Marvin Ritter. Audio set: An ontology and human-labeled dataset for audio events. In ICASSP, 2017. 6
\ No newline at end of file
diff --git a/md/train/V69LGwJ0lIN/V69LGwJ0lIN.md b/md/train/V69LGwJ0lIN/V69LGwJ0lIN.md
new file mode 100644
index 0000000000000000000000000000000000000000..27543d43e2432ecc35ad65b6b5a9f9dd63592aa9
--- /dev/null
+++ b/md/train/V69LGwJ0lIN/V69LGwJ0lIN.md
@@ -0,0 +1,647 @@
+# OPAL: OFFLINE PRIMITIVE DISCOVERY FOR ACCELERATING OFFLINE REINFORCEMENT LEARNING
+
+Anurag Ajay∗1, Aviral Kumar3, Pulkit Agrawal1, Sergey Levine2,3, Ofir Nachum2 1MIT, 2Google Research, 3UC Berkeley
+
+# ABSTRACT
+
+Reinforcement learning (RL) has achieved impressive performance in a variety of online settings in which an agent’s ability to query the environment for transitions and rewards is effectively unlimited. However, in many practical applications, the situation is reversed: an agent may have access to large amounts of undirected offline experience data, while access to the online environment is severely limited. In this work, we focus on this offline setting. Our main insight is that, when presented with offline data composed of a variety of behaviors, an effective way to leverage this data is to extract a continuous space of recurring and temporally extended primitive behaviors before using these primitives for downstream task learning. Primitives extracted in this way serve two purposes: they delineate the behaviors that are supported by the data from those that are not, making them useful for avoiding distributional shift in offline RL; and they provide a degree of temporal abstraction, which reduces the effective horizon yielding better learning in theory, and improved offline RL in practice. In addition to benefiting offline policy optimization, we show that performing offline primitive learning in this way can also be leveraged for improving few-shot imitation learning as well as exploration and transfer in online RL on a variety of benchmark domains. Visualizations and code are available at https://sites.google.com/view/opal-iclr
+
+# 1 INTRODUCTION
+
+Reinforcement Learning (RL) systems have achieved impressive performance in a variety of online settings such as games (Silver et al., 2016; Tesauro, 1995; Brown & Sandholm, 2019) and robotics (Levine et al., 2016; Dasari et al., 2019; Peters et al., 2010; Parmas et al., 2019; Pinto & Gupta, 2016; Nachum et al., 2019a), where the agent can act in the environment and sample as many transitions and rewards as needed. However, in many practical applications the agent’s ability to continuously act in the environment may be severely limited due to practical concerns (DulacArnold et al., 2019). For example, a robot learning through trial and error in the real world requires costly human supervision, safety checks, and resets (Atkeson et al., 2015), rendering many standard online RL algorithms inapplicable (Matsushima et al., 2020). However, in such settings we might instead have access to large amounts of previously logged data, which could be logged from a baseline hand-engineered policy or even from other related tasks. For example, in self-driving applications, one may have access to large amounts of human driving behavior; in robotic applications, one might have data of either humans or robots performing similar tasks. While these offline datasets are often undirected (generic human driving data on various routes in various cities may not be directly relevant to navigation of a specific route within a specific city) and unlabelled (generic human driving data is often not labelled with the human’s intended route or destination), this data is still useful in that it can inform the algorithm about what is possible to do in the real world, without the need for active exploration.
+
+In this paper, we study how, in this offline setting, an effective strategy to leveraging unlabeled and undirected past data is to utilize unsupervised learning to extract potentially useful and temporally extended primitive skills to learn what types of behaviors are possible. For example, consider a dataset of an agent performing undirected navigation in a maze environment (Figure 1). While the dataset does not provide demonstrations of exclusively one specific point-to-point navigation task, it nevertheless presents clear indications of which temporally extended behaviors are useful and natural in this environment (e.g., moving forward, left, right, and backward), and our unsupervised learning objective aims to distill these behaviors into temporally extended primitives. Once these locomotive primitive behaviors are extracted, we can use them as a compact constrained temporallyextended action space for learning a task policy with offline RL, which only needs to focus on task relevant navigation, thereby making task learning easier. For example, once a specific point-to-point navigation is commanded, the agent can leverage the learned primitives for locomotion and only focus on the task of navigation, as opposed to learning locomotion and navigation from scratch.
+
+
+Figure 1: Visualization of (a subset of) diverse datasets for (a) antmaze medium and (c) antmaze large, along with trajectories sampled from $\mathbf { C Q L + O P A L }$ trained on diverse datasets of (b) antmaze medium and (d) antmaze large.
+
+We refer to our proposed unsupervised learning method as Offline Primitives for Accelerating offline reinforcement Learning (OPAL), and apply this basic paradigm to offline RL, where the agent is given a single offline dataset to use for both the initial unsupervised learning phase and then a subsequent task-directed offline policy optimization phase. Despite the fact that no additional data is used, we find that our proposed unsupervised learning technique can dramatically improve offline policy optimization compared to performing offline policy optimization on the raw dataset directly. To the best of our knowledge, ours is the first work to theoretically justify and experimentally verify the benefits of primitive learning in offline RL settings, showing that hierarchies can provide temporal abstraction that allows us to reduce the effect of compounding errors issue in offline RL. These theoretical and empirical results are notably in contrast to previous related work in online hierarchical RL (Nachum et al., 2019b), which found that improved exploration is the main benefit afforded by hierarchically learned primitives. We instead show significant benefits in the offline RL setting, where exploration is irrelevant.
+
+Beyond offline RL, and although this isn’t the main focus of the work, we also show the applicability of our method for accelerating RL by incorporating OPAL as a preprocessing step to standard online RL, few-shot imitation learning, and multi-task transfer learning. In all settings, we demonstrate that the use of OPAL can improve the speed and quality of downstream task learning.
+
+# 2 RELATED WORK
+
+Offline RL. Offline RL presents the problem of learning a policy from a fixed prior dataset of transitions and rewards. Recent works in offline RL (Kumar et al., 2019; Levine et al., 2020; Wu et al., 2019; Ghasemipour et al., 2020; Jaques et al., 2019; Fujimoto et al., 2018) constrain the policy to be close to the data distribution to avoid the use of out-of-distribution actions (Kumar et al., 2019; Levine et al., 2020). To constrain the policy, some methods use distributional penalties, as measured by KL divergence (Levine et al., 2020; Jaques et al., 2019), MMD (Kumar et al., 2019), or Wasserstein distance (Wu et al., 2019). Other methods first sample actions from the behavior policy and then either clip the maximum deviation from those actions (Fujimoto et al., 2018) or just use those actions (Ghasemipour et al., 2020) during the value backup to stay within the support of the offline data. In contrast to these works, OPAL uses an offline dataset for unsupervised learning of a continuous space of primitives. The use of these primitives for downstream tasks implicitly constrains a learned primitive-directing policy to stay close to the offline data distribution. As we demonstrate in our experiments, the use of OPAL in conjunction with an off-the-shelf offline RL algorithm in this way can yield significant improvement compared to applying offline RL to the dataset directly.
+
+Online skill discovery. There are a number of recent works (Eysenbach et al., 2018; Nachum et al., 2018a; Sharma et al., 2019) which use unsupervised objectives to discover skills and use the discovered skills for planning (Sharma et al., 2019), few-shot imitation learning, or online RL (Eysenbach et al., 2018; Nachum et al., 2018a). However, these works focus on online settings and assume access to the environment. In contrast, OPAL focuses on settings where a large dataset of diverse behaviors is provided but access to the environment is restricted. It leverages these static offline datasets to discover primitive skills with better state coverage and avoids the exploration issue of learning primitives from scratch.
+
+Hierarchical policy learning. Hierarchical policy learning involves learning a hierarchy of policies where a low-level policy acts as primitive skills and a high-level policy directs the low-level policy to solve a task. While some works (Bacon et al., 2017; Stolle & Precup, 2002; Peng et al., 2019) learn a discrete set of lower-level policies, each behaving as a primitive skill, other works (Vezhnevets et al., 2017; Nachum et al., 2018b; 2019a; Hausman et al., 2018) learn a continuous space of primitive skills representing the lower-level policy. These methods have mostly been applied in online settings. However, there have been some recent variants of the above works (Lynch et al., 2020; Shankar & Gupta, 2020; Krishnan et al., 2017; Merel et al., 2018) which extract skills from a prior dataset and using it for either performing tasks directly (Lynch et al., 2020) or learning downstream tasks (Shankar & Gupta, 2020; Krishnan et al., 2017; Merel et al., 2018) with online RL. While OPAL is related to these works, we mainly focus on leveraging the learned primitives for asymptotically improving the performance of offline RL; i.e., both the primitive learning and the downstream task must be solved using a single static dataset. Furthermore, we provide performance bounds for OPAL and enumerate the specific properties an offline dataset should possess to guarantee improved downstream task learning, while such theoretical guarantees are largely absent from existing work.
+
+# 3 PRELIMINARIES
+
+We consider the standard Markov decision process (MDP) setting (Puterman, 1994), specified by a tuple $\mathcal { M } = ( S , \mathcal { A } , \mathcal { P } , \mu , r , \gamma )$ where $s$ represents the state space, $\mathcal { A }$ represents the action space, $\mathcal { P } ( s ^ { \prime } | s , a )$ represents the transition probability, $\mu ( s )$ represents the initial state distribution, $r ( s , a ) \in$ $\left( - \mathrm { R } _ { \mathrm { m a x } } , \mathrm { R } _ { \mathrm { m a x } } \right)$ represents the reward function, and $\gamma \in \mathsf { \Gamma } ( 0 , 1 )$ represents the discount factor. A policy in this MDP corresponds to a function $s \to \Delta ( \mathcal { A } )$ , where $\Delta ( \mathcal { A } )$ is the simplex over $\mathcal { A }$ . It induces a discounted future state distribution $d ^ { \pi }$ → A, defined by $\begin{array} { r } { d ^ { \pi } ( s ) \stackrel { } { = } ( 1 - \gamma ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathcal P ( s _ { t } = } \end{array}$ $s | \pi )$ , where $\mathcal { P } ( s _ { t } = s | \pi )$ is the probability of reaching the state $s$ at time $t$ by running $\pi$ on $\mathcal { M }$ . | P For a positive integer $k$ , we use $\begin{array} { r } { d _ { k } ^ { \pi } ( s ) \stackrel { \textstyle - } { = } \left( 1 - \gamma ^ { k } \right) \stackrel { \textstyle \mathbf { \bar { \ o } } } { \mathop { \sum } _ { t = 0 } ^ { \infty } } \gamma ^ { t k } \mathcal { P } ( s _ { t k } = s | \pi ) } \end{array}$ Mto denote the every$\begin{array} { r l } { { } } & { { } \frac { 1 } { 1 - \gamma } \bar { \mathbb { E } } _ { s \sim d ^ { \pi } , a \sim \pi ( a | s ) } [ r ( s , a ) ] } \end{array}$ -step state distribution of . We represent the reward- and discount-agnostic environment as a tuple $\pi$ . The return of policy in MDP $\mathcal { M }$ is defined as $J _ { \mathrm { R L } } ( \pi , \mathcal { M } ) \stackrel { \cdot } { = }$ $\mathcal { E } = ( \mathcal { S } , \mathcal { A } , \mathcal { P } , \mu )$
+
+We aim to use aassociated with arge, unlabeled, and undirected experience dataset to extract primitives and improve offline RL for $\mathcal { D } : = \{ \tau _ { i } ^ { r } : = ( s _ { t } , a _ { t } ) _ { t = 0 } ^ { c - 1 } \} _ { i = 1 } ^ { N }$ $\mathcal { E }$ account for the fact that the dataset $\mathcal { D }$ may be generated by a mixture of diverse policies starting at diverse initial states, we assume $\mathcal { D }$ is generated by first sampling a behavior policy $\pi \sim \Pi$ along with an initial state $s \sim \kappa$ , where $\Pi , \kappa$ represent some (unknown) distributions over policies and states, respectively, and then running $\pi$ on $\mathcal { E }$ for $c$ time steps starting at $\ s _ { 0 } \ = \ s$ . We define the probability of a sub-trajectory $\tau : = ( s _ { 0 } , a _ { 0 } , \ldots , s _ { c - 1 } , a _ { c - 1 } ) $ in $\mathcal { D }$ under a policy $\pi$ as $\begin{array} { r } { \pi ( \tau ) = \kappa ( s _ { 0 } ) \prod _ { t = 1 } ^ { c - 1 } \mathcal { P } ( s _ { t } | s _ { t - 1 } , a _ { t - 1 } ) \prod _ { t = 0 } ^ { c - 1 } \pi ( a _ { t } | s _ { t } ) } \end{array}$ ), and the conditional probability as $\begin{array} { r } { \pi ( \tau | s ) = 1 [ s = s _ { 0 } ] \prod _ { t = 1 } ^ { c - 1 } \mathcal { P } ( s _ { t } | s _ { t - 1 } , a _ { t - 1 } ) \prod _ { t = 0 } ^ { c - 1 } \pi ( a _ { t } | s _ { t } ) . } \end{array}$ In this work, we will show how to apply unsupervised learning techniques to $\mathcal { D }$ to extract a continuous space of primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ , where $z \in { \mathcal { Z } }$ , the latent space inferred by unsupervised learning. We intend to use the learned $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ to asymptotically improve the performance of offline RL for downstream task learning. For offline RL, we assume the existence of a dataset $\mathcal { D } ^ { r } : = \{ \tau _ { i } ^ { r } : = ( s _ { t } , a _ { t } , r _ { t } ) _ { t = 0 } ^ { c - 1 } \} _ { i = 1 } ^ { N }$ , corresponding to the same sub-trajectories in $\mathcal { D }$ labelled with MDP rewards. Additionally, we can use the extracted primitives for other applications such as few-shot imitation learning, online RL, and online multi-task transfer learning. We review the additional assumptions for these applications in Appendix A.
+
+
+Figure 2: Overview of offline RL with OPAL. OPAL is trained on unlabelled data $\mathcal { D }$ using autoencoding objective. For offline RL, the encoder first labels the reward-labelled data $\mathcal { D } ^ { r }$ with latents, and divides it into $\mathcal { D } _ { \mathrm { h i } } ^ { r }$ and $\mathcal { D } _ { \mathrm { l o } } ^ { r }$ . The task policy $\pi _ { \psi }$ is trained on $\mathcal { D } _ { \mathrm { h i } } ^ { r }$ using offline RL while the primitive policy $\pi _ { \theta }$ is finetuned on $\mathcal { D } ^ { \mathrm { l o } }$ using behavioral cloning (BC).
+
+# 4 OFFLINE RL WITH OPAL
+
+In this section, we elaborate on OPAL, our proposed method for extracting primitives from $\mathcal { D }$ and then leveraging these primitives to learn downstream tasks with offline RL. We begin by describing our unsupervised objective, which distills $\mathcal { D }$ into a continuous space of latent-conditioned and temporally-extended primitive policies $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ . For learning downstream tasks with offline RL, we first label ${ \mathcal { D } } ^ { r }$ with appropriate latents using the OPAL encoder $q _ { \phi } ( z | \tau )$ and then learn a policy $\pi _ { \psi } ( z | s )$ which is trained to sample an appropriate primitive every $c$ steps to optimize a specific task, using any off-the-shelf offline RL algorithm. A graphical overview of offline RL with OPAL is shown in Figure 2. While we mainly focus on offline RL, we briefly discuss how to use the learned primitives for few-shot imitation learning, online RL, and multi-task online transfer learning in section 5 and provide more details in Appendix A.
+
+# 4.1 EXTRACTING TEMPORALLY-EXTENDED PRIMITIVES FROM DATA
+
+We would like to extract a continuous space of temporally-extended primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ from $\mathcal { D }$ which we can later use as an action space for learning downstream tasks with offline RL. This would reduce our effective task horizon, thereby making the downstream learning easier, as well as allow the downstream policy to stay close to the offline data distribution, thereby bringing stability to the downstream learning. We propose the following objective for learning $\pi _ { \theta }$ , incorporating an auto-encoding loss function with a KL constraint to encourage better generalization:
+
+$$
+\operatorname* { m i n } _ { \theta , \phi , \omega } J ( \theta , \phi , \omega ) = \hat { \mathbb { E } } _ { \tau \sim \mathcal { D } , z \sim q _ { \phi } ( z | \tau ) } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right]
+$$
+
+$$
+\mathrm { ; . t . } \ \hat { \mathbb { E } } _ { \tau \sim \mathcal { D } } [ \mathrm { D } _ { \mathrm { K L } } ( q _ { \phi } ( z | \tau ) | | \rho _ { \omega } ( z | s _ { 0 } ) ) ] \leq \epsilon _ { \mathrm { K L } }
+$$
+
+where $\hat { \mathbb { E } }$ indicates empirical expectation. The learned components of this objective may be interpreted as encoder, decoder, and prior:
+
+Encoder: $q _ { \phi } ( z | \tau )$ encodes the trajectory $\tau$ of state-action pairs into a distribution in latent space and gives out parameters of that distribution. In our case, we represent $q _ { \phi }$ with a bidirectional GRU which takes in $\tau$ and gives out parameters of a Gaussian distribution $( \mu _ { z } ^ { e n c } , \sigma _ { z } ^ { e n c } )$ .
+
+Decoder (aka Primitive Policy): $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ is the latent-conditioned policy. It maximizes the conditional log-likelihood of actions in $\tau$ given the state and the latent vector. In our implementation, we parameterize it as a feed-forward neural network which takes in current state and latent vector and gives out parameters of a Gaussian distribution for the action $( \mu _ { a } , \sigma _ { a } )$ .
+
+Prior/Primitive Predictor: $\rho _ { \omega } ( z | s _ { 0 } )$ tries to predict the encoded distribution of the sub-trajectory $\tau$ from its initial state. Our implementation uses a feed-forward neural network which takes in the initial state and gives out parameters of a Gaussian distribution $( \mu _ { z } ^ { p r } , \sigma _ { z } ^ { p r } )$ .
+
+KL-constraint (Equation 2). As an additional component of the algorithm, we enforce consistency in the latent variables predicted by the encoder $q _ { \phi } ( z | \tau )$ and the prior $\rho _ { \omega } ( z | s _ { 0 } )$ . Since our goal is to obtain a primitive $z$ that captures a temporal sequence of actions for a given sub-trajectory $\tau = ( s _ { 0 } , a _ { 0 } , \cdot \cdot \cdot , s _ { c - 1 } , a _ { c - 1 } )$ (as defined in Section 3), we utilize a regularization that enforces the distribution, $q _ { \phi } ( z | \tau )$ to be close to just predicting the primitive or the latent variable $z$ given the start state of this sub-trajectory, $s _ { 0 }$ (i.e. $\rho _ { \omega } ( z | s _ { 0 } ) )$ . This conditioning on the initial state regularizes the distribution $q _ { \phi } ( z | \tau )$ to not overfit to the the complete sub-trajectory $\tau$ as the same $z$ should also be predictable only given $s _ { 0 }$ . The above form of KL constraint is inspired from past works (Lynch et al., 2020; Kumar et al., 2020a). In particular Lynch et al. (2020) add a KL-constraint (Equation 2, “Plan prior matching” in Lynch et al. (2020)) that constrains the distribution over latent variables computed only given the initial state and the goal state to the distribution over latent variables computed using the entire trajectory. Our form in Equation 2 is similar to this prior except that we do not operate in a goal-conditioned RL setting and hence only condition $\rho _ { \omega }$ on the initial state $s _ { 0 }$ .
+
+In practice, rather than solving the constrained optimization directly, we implement the KL constraint as a penalty, weighted by an appropriately chosen coefficient $\beta$ . Thus, one may interpret our unsupervised objective as using a sequential $\beta$ -VAE (Higgins et al., 2016). However, as mentioned above, our prior is conditioned on $s _ { 0 }$ and learned as part of the optimization because the set of primitives active in $\mathcal { D }$ depends on $s _ { 0 }$ . If $\beta = 1$ , OPAL is equivalent to a conditional VAE maximizing log probability of $\tau$ conditioned on its initial state $s _ { 0 }$ ; see Appendix D for more details. Despite the similarities between our proposed objective and VAEs, our presentation of OPAL as a constrained auto-encoding objective is deliberate. As we will show in Section 4.3, our theoretical guarantees depend on a well-optimized auto-encoding loss to provide benefits of using learned primitives $\pi _ { \theta }$ for downstream tasks. In contrast, a VAE loss, which simply maximizes the likelihood of observed data, may not necessarily provide a benefit for downstream tasks. For example, if the data can be generated by a single stationary policy, a VAE-optimal policy $\pi _ { \theta }$ can simply ignore the latent $z$ , thus producing a degenerate space of primitives. In contrast, when the KL constraint in our objective is weak (i.e., $\epsilon _ { \mathrm { K L } } \gg 0$ or $\beta < 1 \AA$ ), the auto-encoding loss is encouraged to find a unique $z$ for distinct $\tau$ to optimize reconstruction loss.
+
+# 4.2 OFFLINE RL WITH PRIMITIVES FOR DOWNSTREAM TASKS
+
+After distilling learned primitives from $\mathcal { D }$ in terms of an encoder $q _ { \phi } ( z | \tau )$ , a latent primitive policy (or decoder) $\bar { \pi } _ { \boldsymbol { \theta } } ( a | s , z )$ , and a prior $\rho _ { \omega } ( z | s _ { 0 } )$ , OPAL then applies these learned models to improve offline RL for downstream tasks.
+
+As shown in Figure 2, our goal is to use a dataset with reward labeled sub-trajectories $\mathcal { D } ^ { r } = \{ \tau _ { i } : =$ $( s _ { t } ^ { i } , a _ { t } ^ { i } , r _ { t } ^ { i } ) _ { t = 0 } ^ { c - 1 } \} _ { i = 1 } ^ { N }$ to lear r policy $\pi$ D { that maximizes cumulative reward. With OPAL, we use the learned primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ $\pi _ { \psi } ( z | s )$ . To do so, we relabel the dataset ${ \mathcal { D } } ^ { r }$ in terms of temporally extended transitions using the learned encoder $q _ { \phi } ( z | \tau )$ . Specifically, we create a dataset $\begin{array} { r } { \mathcal { D } _ { \mathrm { h i } } ^ { r } = \{ ( s _ { 0 } ^ { i } , z _ { i } , \sum _ { t = 0 } ^ { c - 1 } \gamma ^ { t } r _ { t } ^ { i } , s _ { c } ^ { i } ) \} _ { i = 1 ; } ^ { N } } \end{array}$ where $z _ { i } \sim q _ { \phi } ( \cdot | \tau _ { i } )$ . Given $\mathcal { D } _ { \mathrm { h i } } ^ { r }$ , any off-the-shelf offline RL algorithm can be used to learn $\pi _ { \psi } ( z | s )$ (in our experiments we use CQL (Kumar et al., 2020b)). As a way to ensure that the $\dot { \tau } _ { i } : = ( s _ { t } ^ { i } , a _ { t } ^ { i } , r _ { t } ^ { i } ) _ { t = 0 } ^ { c - 1 }$ remain consistent with the labelled latent action $z _ { i }$ , we finetune $c$ -step transitions $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ on $\mathcal { D } _ { \mathrm { l o } } ^ { r } = \{ ( ( s _ { t } ^ { i } , a _ { t } ^ { i } ) _ { t = 0 } ^ { c - 1 } , z _ { i } ) \} _ { i = 1 } ^ { N }$ with a simple latent-conditioned behavioral cloning loss:
+
+$$
+\underset { \theta } { \operatorname* { m i n } } \hat { \mathbb { E } } _ { ( \tau , z ) \sim \mathcal { D } _ { \mathrm { l o } } ^ { r } } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] .
+$$
+
+# 4.3 SUBOPTIMALITY AND PERFORMANCE BOUNDS FOR OPAL
+
+Now, we will analyze OPAL and derive performance bounds for it in the context of offline RL, formally examining the benefit of the temporal abstraction afforded by OPAL as well as studying what properties $\mathcal { D }$ should possess so that OPAL can improve downstream task performance.
+
+As explained above, when applying OPAL to offline RL, we first learn the primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ using $\mathcal { D }$ , and then learn a high-level task policy $\pi _ { \psi } ( z | s )$ in the space of the primitives. Let $\pi _ { \psi ^ { * } } ( z | s )$ be the optimal task policy. Thus the low-level $\pi _ { \theta }$ and high-level $\pi _ { \psi ^ { * } }$ together comprise a hierarchical policy, which we denote as $\pi _ { \boldsymbol { \theta } , \psi } *$ . To quantify the performance of policies obtained from OPAL, we define the notion of suboptimality of the learned primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ in an MDP $\mathcal { M }$ with an associated optimal policy $\pi ^ { * }$ as
+
+$$
+\mathrm { S u b O p t } ( \theta ) : = | J _ { \mathrm { R L } } ( \pi ^ { * } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { \theta , \psi ^ { * } } , \mathcal { M } ) | .
+$$
+
+To relate $\operatorname { S u b O p t } ( \theta )$ with some notion of divergence between $\pi ^ { * }$ and $\pi _ { \boldsymbol { \theta } , \psi } *$ , we introduce the following performance difference lemma.
+
+Lemma 4.0.1. If $\pi _ { 1 }$ and $\pi _ { 2 }$ are two policies in $\mathcal { M }$ , then
+
+$$
+| J _ { \mathrm { R L } } ( \pi _ { 1 } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { 2 } , \mathcal { M } ) | \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim d _ { c } ^ { \pi _ { 1 } } } [ { \mathrm { D } } _ { \mathrm { T V } } ( \pi _ { 1 } ( \tau | s ) | | \pi _ { 2 } ( \tau | s ) ) ] ,
+$$
+
+where $\mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( \tau | s ) | | \pi _ { 2 } ( \tau | s ) )$ denotes the TV divergence over $c$ -length sub-trajectories $\tau$ sampled from $\pi _ { 1 }$ vs. $\pi _ { 2 }$ (see section 3). Furthermore,
+
+$$
+\mathrm { S u b O p t } ( \theta ) \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim d _ { c } ^ { \pi ^ { * } } } \big [ \mathrm { D } _ { \mathrm { T V } } \big ( \pi ^ { * } ( \tau | s ) | | \pi _ { \theta , \psi ^ { * } } ( \tau | s ) \big ) \big ] .
+$$
+
+The proof of the above lemma and all the following results are provided in Appendix B.1.
+
+Through above lemma, we showed that the suboptimality of the learned primitives can be bounded by the total variation divergence between the optimal policy $\pi ^ { * }$ in $\mathcal { M }$ and the optimal policy acting through the learned primitives $\pi _ { \boldsymbol { \theta } , \psi } *$ . We now continue to bound the divergence between $\pi ^ { * }$ and $\pi _ { \boldsymbol { \theta } , \psi } *$ in terms of how representative $\mathcal { D }$ is of $\pi ^ { * }$ and how optimal the primitives $\pi _ { \theta }$ are with respect to the auto-encoding objective (equation 1). We begin with a definition of how often an arbitrary policy appears in $\Pi$ , the distribution generating $\mathcal { D }$ :
+
+Definition 1. We say a policy $\overline { { \pi } }$ in $\mathcal { M }$ is $\zeta$ -common in $\Pi \ i f \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ( \tau | s ) | | \overline { { \pi } } ( \tau | s ) ) ] \le \zeta .$ . Theorem 4.1. Let $\theta , \phi , \omega$ be the outputs of solving equation $^ { l }$ , such that $J ( \theta , \phi , \omega ) = \epsilon _ { c } .$ . Then, with high probability $1 - \delta$ , for any $\overline { { \pi } }$ that is $\zeta$ -common in $\Pi$ , there exists a distribution $H$ over $z$ such that for $\pi _ { \boldsymbol { \theta } } ^ { H } ( \tau | \boldsymbol { s } ) : = \mathbb { E } _ { \boldsymbol { z } \sim H } [ \pi _ { \boldsymbol { \theta } } ( \tau | \boldsymbol { z } , \boldsymbol { s } ) ]$ ,
+
+$$
+\mathbb { E } _ { s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau | s ) | | \pi _ { \theta } ^ { H } ( \tau | s ) ) ] \leq \zeta + \sqrt { \frac { 1 } { 2 } \left( \epsilon _ { c } + \sqrt { \frac { S _ { J } } { \delta } } + \mathcal { H } _ { c } \right) }
+$$
+
+where $\begin{array} { r } { \mathcal { H } _ { c } = \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , s _ { 0 } \sim \kappa } [ \sum _ { t = 0 } ^ { c - 1 } \log \pi ( a _ { t } | s _ { t } ) ] } \end{array}$ (i.e. a constant and property of $\mathcal { D }$ ) and $S _ { J }$ is $a$ positive constant incurred due to sampling error in $J ( \theta , \phi , \omega )$ and depends on concentration properties of $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ and $q _ { \phi } ( z | \tau )$ .
+
+Corollary 4.1.1. If the optimal policy $\pi ^ { * }$ of $\mathcal { M }$ is $\zeta$ -common in $\Pi$ , and $\begin{array} { r } { \left\| \frac { d _ { c } ^ { \pi ^ { * } } } { \kappa } \right\| _ { \infty } \leq \xi } \end{array}$ , then, with high probability $1 - \delta$ ,
+
+$$
+\mathrm { S u b O p t } ( \theta ) \leq \frac { 2 \xi } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \left( \zeta + \sqrt { \frac { 1 } { 2 } \left( \epsilon _ { c } + \sqrt { \frac { S _ { J } } { \delta } } + \mathcal { H } _ { c } \right) } \right) .
+$$
+
+As we can see, $\operatorname { S u b O p t } ( \theta )$ will reduce as $\mathcal { D }$ gets closer to $\pi ^ { * }$ (i.e. $\zeta$ approaches 0) and better primitives are learned (i.e. $\epsilon _ { c }$ decreases). While it might be tempting to increase $c$ (i.e. the length of sub-trajectories) to reduce the suboptimality, a larger $c$ will inevitably make it practically harder to control the autoencoding loss $\epsilon _ { c }$ , thereby leading to an increase in overall suboptimality and inducing a trade-off in determining the best value of $c$ . In our experiments we treat $c$ as a hyperparameter and set it to $c = 1 0$ , although more sophisticated ways to determine $c$ can be an interesting avenue for future work.
+
+Till now, we have argued that there exists some near-optimal task policy $\pi _ { \psi ^ { * } }$ if $\theta$ is sufficiently learned and $\pi ^ { * }$ is sufficiently well-represented in $\mathcal { D }$ . Now, we will show how primitive learning can improve downstream learning, by considering the benefits of using OPAL with offline RL. Building on the policy performance analysis from Kumar et al. (2020b), we now present theoretical results bounding the performance of the policy obtained when offline RL is performed with OPAL.
+
+Table 1: Average success rate $( \% )$ (over 4 seeds) of offline RL methods: BC, BEAR (Kumar et al., 2019), EMAQ (Ghasemipour et al., 2020), CQL (Kumar et al., 2020b) and $\mathrm { C Q L + O P A L }$ (ours).
+
+
Environment
BC
BEAR
EMAQ
CQL
CQL+OPAL (ours)
antmaze medium (diverse)
0.0
8.0
0.0
53.7 ± 6.1
81.1 ± 3.1
antmaze large (diverse)
0.0
0.0
0.0
14.9 ± 3.2
70.3 ± 2.9
kitchen mixed
47.5
47.2
70.8 ± 2.3
52.4 ± 2.5
69.3 ± 2.7
kitchen partial
33.8
13.1
74.6 ± 0.6
50.1 ± 1.0
80.2 ± 2.4
+
+Theorem 4.2. Let $\pi _ { \psi ^ { * } } ( z | s )$ be the policy obtained by CQL and let $\pi _ { \psi ^ { * } , \theta } ( a | s )$ refer to the policy when $\pi _ { \psi ^ { * } } ( z | s )$ is used together with $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ . Le $\cdot \pi _ { \beta } \equiv \{ \pi ; \pi \sim \Pi \}$ refer to the policy generating ${ \mathcal { D } } ^ { r }$ in MDP $\mathcal { M }$ and $z \sim \pi _ { \beta } ^ { H } ( z | s ) \equiv \tau \sim \pi _ { \beta , s _ { 0 } = s } , z \sim q _ { \phi } ( z | \tau )$ . Then, $J ( \pi _ { \psi ^ { * } , \theta } , M ) \geq J ( \pi _ { \beta } , M ) - \kappa$ with high probability $1 - \delta$ where
+
+$$
+\begin{array} { r } { \kappa = \mathcal { O } \Bigg ( \displaystyle \frac { 1 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathbb { E } _ { s \sim d _ { M _ { H } } ^ { \pi _ { \psi ^ { * } , \theta } } ( s ) } \left[ \sqrt { | \mathcal { Z } | ( \operatorname { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s ) + 1 ) } \right] \Bigg ) } \\ { - \displaystyle \frac { \alpha } { 1 - \gamma ^ { c } } E _ { s \sim d _ { M _ { H } } ^ { \pi _ { \psi ^ { * } } } ( s ) } \left[ \operatorname { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } , \theta } , \pi _ { \beta } ^ { H } ) ( s ) \right] , } \end{array}
+$$
+
+where $\mathrm { D _ { C Q L } }$ is a measure of the divergence between two policies; see the appendix for a formal statement.
+
+The precise bound along with a proof is described in Appendix B.1. Intuitively, this bound suggests that the worst-case deterioration over the learned policy depends on the divergence between the learned latent-space policy $\mathrm { D _ { C Q L } }$ and the actual primitive distribution, which is controlled via any conservative offline RL algorithm (Kumar et al. (2020b) in our experiments) and the size of the latent space $| { \mathcal { Z } } |$ . Crucially, note that comparing Equation 9 to the performance bound for CQL (Equation 6 in Kumar et al. (2020b)) reveals several benefits pertaining to (1) temporal abstraction – a reduction in the factor of horizon by virtue of $\gamma ^ { c }$ , and (2) reduction in the amount of worst-case error propagation due to a reduced action space $| \mathcal { Z } |$ vs. $| { \cal A } |$ . Thus, as evident from the above bound, the total error induced due to a combination of distributional shift and sampling is significantly reduced when OPAL is used as compared to the standard RL counterpart of this bound which is affected by the size of the entire action space for each and every timestep in the horizon. This formalizes our intuition that OPAL helps to partly mitigate distributional shift and sampling error. One downside of using a latent space policy is that we incur unsupervised learning error while learning primitives. However, empirically, this unsupervised learning error gets dominated by other error terms pertaining to offline RL. That is, it is much easier to control unsupervised loss than errors arising in offline RL.
+
+# 5 EVALUATION
+
+In this section, we will empirically show that OPAL improves learning of downstream tasks with offline RL, and then briefly show the same with few-shot imitation learning, online RL, and online multi-task transfer learning. Unless otherwise stated, we use $c = 1 0$ and $\mathrm { d i m } ( \mathcal { Z } ) = 8$ . See Appendix C for further implementation and experimental details. Visualizations and code are available at https://sites.google.com/view/opal-iclr
+
+# 5.1 OFFLINE RL WITH OPAL
+
+Description: We use environments and datasets provided in D4RL (Fu et al., 2020). Since the aim of our method is specifically to perform offline RL in settings where the offline data comprises varied and undirected multi-task behavior, we focus on Antmaze medium (diverse dataset), Antmaze large (diverse dataset), and Franka kitchen (mixed and partial datasets). The Antmaze datasets involve a simulated ant robot performing undirected navigation in a maze. The task is to use this undirected dataset to solve a specific point-to-point navigation problem, traversing the maze from one corner to the opposite corner, with only sparse 0-1 completion reward for reaching the goal. The kitchen datasets involves a franka robot manipulating multiple objects (microwave, kettle, etc.) either in an undirected manner (mixed dataset) or in a partially task directed manner (partial dataset). The task is to use the datasets to arrange objects in a desired configuration, with only sparse 0-1 completion reward for every object that attains the target configuration.
+
+
+
+Figure 3: State visitation heatmaps for antmaze medium policies learned using (1) CQL and (2) $\mathrm { C Q L + O P A L }$ , and antmaze large policies learned using (3) CQL and (4) $\mathrm { C Q L + O P A L }$ .
+Table 2: Average success rate $( \% )$ (over 4 seeds) of few-shot IL methods: BC, $_ { \mathrm { B C + O P A L } }$ , and $\mathrm { B C + S V A E }$ (Wang et al., 2017).
+
+
Environment
BC
BC+OPAL (ours)
BC+SVAE
antmaze medium (diverse)
30.1 ± 3.2
81.5 ± 2.7
72.8 ± 2.3
antmaze large (diverse)
9.2 ± 2.5
63.5 ± 2.3
49.4 ± 2.2
+
+Baseline: We use Behavior cloning (BC), BEAR (Kumar et al., 2019), EMAQ (Ghasemipour et al., 2020), and CQL (Kumar et al., 2020b) as baselines. We compare it to $\mathrm { C Q L + O P A L }$ , which first uses OPAL to distill primitives from the offline dataset before applying CQL to learn a primitive-directing high-level policy.
+
+Results: As shown in Table 1, CQL $^ +$ OPAL outperforms nearly all the baselines on antmaze (see Figure 1 and Figure 3 for visualization) and kitchen tasks, with the exception of EMAQ having similar performance on kitchen mixed. To ensure fair comparison with EMAQ, we use an autoregressive primitive policy. With the exception of EMAQ on kitchen mixed, we are not aware of any existing offline RL algorithms that achieves similarly good performance on these tasks; moreover, we are not aware of any existing online RL algorithms which solve these tasks (see Table 3 for some comparisons), highlighting the benefit of using offline datasets to circumvent exploration challenges. There are two potential reasons for OPAL’s success. First, temporally-extended primitives could make the reward propagation learning problem easier. Second, the primitives may provide a better latent action space than the atomic actions of the environment. To understand the relative importance of these factors, we experimented with an ablation of $\mathrm { C Q L + O P A L }$ that uses $c = 1$ to remove temporal abstraction. In this case, we find the method’s performance to be similar to standard CQL. This implies that the temporal abstraction provided by OPAL is one of the main contributing factors to its good performance. This observation also agrees with our theoretical analysis. See Appendix E for detailed discussion.
+
+# 5.2 FEW-SHOT IMITATION LEARNING WITH OPAL
+
+Description: Previously, we assumed that we have access to a task reward function, but only undirected data that performs other tasks. Now, we will study the opposite case, where we are not provided with a reward function for the new task either, but instead receive a small number of taskspecific demonstrations that illustrate optimal behavior. Simply imitating these few demonstrations is insufficient to obtain a good policy, and our experiments evaluate whether OPAL can effectively incorporate the prior data to enable few-shot adaptation in this setting. We use the Antmaze environments (diverse datasets) to evaluate our method and use an expert policy for these environments to sample $n = 1 0$ successful trajectories.
+
+Baseline and Results: For baselines, we use Behavior cloning (BC) and the model from Wang et al. (2017), which prescribes using a sequential VAE (SVAE) over state trajectories in conjunction with imitation learning. As shown in Table 2, BC+OPAL clearly outperforms other baselines, showing the importance of temporal abstraction and ascertaining the quality of learned primitives. See Appendix A for detailed discussion.
+
+
Environment
HIRO
SAC+BC
SAC+OPAL(ours)
DDQN+DDCO
antmaze medium sparse (diverse)
0.0
0.0
81.6 ± 3.7
0.0
antmaze large sparse (diverse)
0.0
0.0
0.0
0.0
antmaze medium dense (diverse)
0.0
0.0
81.3 ± 3.3
0.0
antmaze large dense (diverse)
12
0.0
81.5 ± 3.9
0.0
+
+Table 3: Average success rate $( \% )$ (over 4 seeds) of online RL methods: HIRO (Nachum et al., 2018a), $\mathrm { S A C + B C }$ , $\mathrm { S A C + O P A L }$ , and $\mathrm { D D Q N + D D C O }$ (Krishnan et al., 2017). These methods were ran for 2.5e6 steps for antmaze medium environments and 17.5e6 steps for antmaze large environments.
+Table 4: Due to improved exploration, $_ { \mathrm { P P O + O P A L } }$ outperforms PPO and SAC on MT10 and MT50 in terms of average success rate $( \% )$ (over 4 seeds).
+
+
Models
MT10
MT50
PPO
15.2 ± 4.8
5.1 ± 2.2
PPO+OPAL(ours)
70.1 ± 4.3
45.3 ± 3.1
SAC
39.5
28.8
+
+# 5.3 ONLINE RL AND MULTI-TASK TRANSFER WITH OPAL
+
+Description: For online RL and multi-task transfer learning, we learn a task policy in space of primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ while keeping it fixed. For multi-task transfer, the task policy also takes in the task id and we use $c = 5$ and $\mathcal { Z } = 8$ . Since the primitives need to transfer to a different state distribution for multi-task transfer, it only learns the action sub-trajectory distribution and doesn’t take in the state feedback. See Appendix A for a detailed description of models. For online RL, we use the Antmaze environments (diverse datasets) with sparse and dense rewards for evaluating our method. For online multi-task transfer learning, we learn primitives with expert data from pick-andplace task and then use it to learn multi-task policy for MT10 and MT50 (from metaworld (Yu et al., 2020)), containing 10 and 50 robotic manipulation tasks which needs to be solved simultaneously.
+
+Baseline and Results: For online RL, we use HIRO (Nachum et al., 2018b), a state-of-the-art hierarchical RL method, SAC (Haarnoja et al., 2018) with Behavior cloning (BC) pre-training on $\mathcal { D }$ , and Discovery of Continuous Options (DDCO) (Krishnan et al., 2017) which uses $\mathcal { D }$ to learn a discrete set of primitives and then learns a task policy in space of those primitives with online RL (Double DQN (DDQN) (Van Hasselt et al., 2015)). For online multi-task transfer learning, we use PPO (Schulman et al., 2017) and SAC (Haarnoja et al., 2018) as baselines. As shown in Table 3 and Table 4, OPAL uses temporal abstraction to improve exploration and thus accelerate online RL and multi-task transfer learning. See Appendix A for detailed discussion.
+
+# 6 DISCUSSION
+
+We proposed Offline Primitives for Accelerating offline RL (OPAL) as a preproccesing step for extracting recurring primitive behaviors from undirected and unlabelled dataset of diverse behaviors. We derived theoretical statements which describe under what conditions OPAL can improve learning of downstream offline RL tasks and showed how these improvements manifest in practice, leading to significant improvements in complex manipulation tasks. We further showed empirical demonstrations of OPAL’s application to few-shot imitation learning, online RL, and online multi-task transfer learning. In this work, we focused on simple auto-encoding models for representing OPAL, and an interesting avenue for future work is scaling up this basic paradigm to image-based tasks.
+
+# 7 ACKNOWLEDGEMENTS
+
+We would like to thank Ben Eysenbach and Kamyar Ghasemipour for valuable discussions at different points over the course of this work. This work was supported by Google, DARPA Machine Common Sense grant and MIT-IBM grant.
+
+# REFERENCES
+
+Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 22–31. JMLR. org, 2017.
+
+Christopher G Atkeson, Benzun P Wisely Babu, Nandan Banerjee, Dmitry Berenson, Christoper P Bove, Xiongyi Cui, Mathew DeDonato, Ruixiang Du, Siyuan Feng, Perry Franklin, et al. No falls, no resets: Reliable humanoid behavior in the darpa robotics challenge. In 2015 IEEE-RAS 15th International Conference on Humanoid Robots (Humanoids), pp. 623–630. IEEE, 2015.
+
+Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
+
+Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456): 885–890, 2019. ISSN 0036-8075. doi: 10.1126/science.aay2400. URL https://science. sciencemag.org/content/365/6456/885.
+
+Sudeep Dasari, Frederik Ebert, Stephen Tian, Suraj Nair, Bernadette Bucher, Karl Schmeckpeper, Siddharth Singh, Sergey Levine, and Chelsea Finn. Robonet: Large-scale multi-robot learning. arXiv preprint arXiv:1910.11215, 2019.
+
+Gabriel Dulac-Arnold, Daniel Mankowitz, and Todd Hester. Challenges of real-world reinforcement learning. arXiv preprint arXiv:1904.12901, 2019.
+
+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.
+
+J. Fu, A. Kumar, O. Nachum, G. Tucker, and S. Levine. D4rl: Datasets for deep data-driven reinforcement learning. In arXiv, 2020. URL https://arxiv.org/pdf/2004.07219.
+
+Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv preprint arXiv:1812.02900, 2018.
+
+Seyed Kamyar Seyed Ghasemipour, Dale Schuurmans, and Shixiang Shane Gu. Emaq: Expectedmax q-learning operator for simple yet effective offline and online rl. arXiv preprint arXiv:2007.11091, 2020.
+
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
+
+K. Hausman, J. T. Springenberg, Z. Wang, N. Heess, and M. Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations (ICLR), 2018.
+
+Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
+
+Allan Jabri, Kyle Hsu, Abhishek Gupta, Ben Eysenbach, Sergey Levine, and Chelsea Finn. Unsupervised curricula for visual meta-reinforcement learning. In Advances in Neural Information Processing Systems, pp. 10519–10531, 2019.
+
+Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Sanjay Krishnan, Roy Fox, Ion Stoica, and Ken Goldberg. Ddco: Discovery of deep continuous options for robot learning from demonstrations. arXiv preprint arXiv:1710.05421, 2017.
+
+Ashish Kumar, Saurabh Gupta, and Jitendra Malik. Learning navigation subroutines from egocentric videos. In Conference on Robot Learning, pp. 617–626. PMLR, 2020a.
+
+Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy qlearning via bootstrapping error reduction. In Neural Information Processing Systems (NeurIPS), 2019.
+
+Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020b.
+
+Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
+
+Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
+
+Corey Lynch, Mohi Khansari, Ted Xiao, Vikash Kumar, Jonathan Tompson, Sergey Levine, and Pierre Sermanet. Learning latent plans from play. In Conference on Robot Learning, pp. 1113– 1132, 2020.
+
+Tatsuya Matsushima, Hiroki Furuta, Yutaka Matsuo, Ofir Nachum, and Shixiang Gu. Deploymentefficient reinforcement learning via model-based offline optimization. arXiv preprint arXiv:2006.03647, 2020.
+
+Josh Merel, Leonard Hasenclever, Alexandre Galashov, Arun Ahuja, Vu Pham, Greg Wayne, Yee Whye Teh, and Nicolas Heess. Neural probabilistic motor primitives for humanoid control. arXiv preprint arXiv:1811.11711, 2018.
+
+Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Near-optimal representation learning for hierarchical reinforcement learning. arXiv preprint arXiv:1810.01257, 2018a.
+
+Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3303–3313, 2018b.
+
+Ofir Nachum, Michael Ahn, Hugo Ponte, Shixiang Gu, and Vikash Kumar. Multi-agent manipulation via locomotion using hierarchical sim2real. arXiv preprint arXiv:1908.05224, 2019a.
+
+Ofir Nachum, Haoran Tang, Xingyu Lu, Shixiang Gu, Honglak Lee, and Sergey Levine. Why does hierarchy (sometimes) work so well in reinforcement learning? arXiv preprint arXiv:1909.10618, 2019b.
+
+Paavo Parmas, Carl Edward Rasmussen, Jan Peters, and Kenji Doya. Pipps: Flexible model-based policy search robust to the curse of chaos. arXiv preprint arXiv:1902.01240, 2019.
+
+Xue Bin Peng, Michael Chang, Grace Zhang, Pieter Abbeel, and Sergey Levine. Mcp: Learning composable hierarchical control with multiplicative compositional policies. In Advances in Neural Information Processing Systems, pp. 3686–3697, 2019.
+
+Jan Peters, Katharina Mulling, and Yasemin Altun. Relative entropy policy search. In Twenty-Fourth AAAI Conference on Artificial Intelligence, 2010.
+
+Lerrel Pinto and Abhinav Gupta. Supersizing self-supervision: Learning to grasp from 50k tries and 700 robot hours. In 2016 IEEE international conference on robotics and automation (ICRA), pp. 3406–3413. IEEE, 2016.
+
+Martin L Puterman. Markov decision processes: Discrete stochastic dynamic programming. 1994.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+
+Tanmay Shankar and Abhinav Gupta. Learning robot skills with temporal variational inference. arXiv preprint arXiv:2006.16232, 2020.
+
+Archit Sharma, Shixiang Gu, Sergey Levine, Vikash Kumar, and Karol Hausman. Dynamics-aware unsupervised discovery of skills. arXiv preprint arXiv:1907.01657, 2019.
+
+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.
+
+Martin Stolle and Doina Precup. Learning options in reinforcement learning. volume 2371, pp. 212–223, 08 2002. doi: 10.1007/3-540-45622-8 16.
+
+G. Tesauro. Temporal difference learning and td-gammon. J. Int. Comput. Games Assoc., 18:88, 1995.
+
+Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. arXiv preprint arXiv:1509.06461, 2015.
+
+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.
+
+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, pp. 5320–5329, 2017.
+
+Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
+
+Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on Robot Learning, pp. 1094–1100, 2020.
+
+# Appendices
+
+A OTHER APPLICATIONS OF OPAL
+
+A.1 FEW-SHOT IMITATION LEARNING WITH OPAL
+
+Additionstrations $\mathcal { D }$ , wehere access to a small number of expert demon-. $\mathcal { D } ^ { \mathrm { e x p } } = \bar { \{ \tau _ { i } : = ( s _ { t } , a _ { t } ) _ { t = 0 } ^ { T - 1 } \} } _ { i = 1 } ^ { n }$ $n \ll N$
+
+How to use with OPAL? In imitation learning, the aim is to recover an expert policy given a small number of stochastically sampled expert demonstrations $\mathcal { D } ^ { \mathrm { e x p } } = \{ \tau _ { i } : = ( s _ { t } , a _ { t } ) _ { t = 0 } ^ { T - 1 } \} _ { i = 1 } ^ { n }$ . As in the offline RL setting, we use the primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ learned by OPAL as a low-level controller and learn a high-level policy $\pi _ { \psi } ( z | s )$ . We first partition the expert demonstrations into sub-trajectories $\mathcal { D } _ { \mathrm { p a r } } ^ { \mathrm { e x p } } = \{ \tau _ { i , k } : = ( s _ { k + t } , a _ { k + t } ) _ { t = 0 } ^ { c - 1 }$ for $k = 0 , \ldots , T - c \} _ { i = 1 } ^ { n }$ of length $c$ . We then use the learned encoder $q _ { \phi } ( z | \tau )$ to label these sub-trajectories with latent actions $z _ { i , k } \sim q _ { \phi } ( z | \tau _ { i , k } )$ and thus create a dataset $\mathcal { D } _ { \mathrm { h i } } ^ { \mathrm { e x p } } = \{ ( s _ { k + t } ^ { i } , z _ { i , k } )$ for $k = 0 , \ldots , T - c \} _ { i = 1 } ^ { n }$ . We use $\mathcal { D } _ { \mathrm { h i } } ^ { \mathrm { e x p } }$ to learn the high-level policy $\pi _ { \psi } ( z | s )$ using behavioral cloning. As in the offline RL setting, we also finetune $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ with latent-conditioned behavioral cloning to ensure consistency of the labelled latents.
+
+Evaluation Description: We receive a small number of task-specific demonstrations that illustrate optimal behavior. Simply imitating these few demonstrations is insufficient to obtain a good policy, and our experiments evaluate whether OPAL can effectively incorporate the prior data to enable fewshot adaptation in this setting. We use the Antmaze environments (diverse datasets) to evaluate our method and use an expert policy for these environments to sample $n = 1 0$ successful trajectories.
+
+Baseline: We evaluate two baselines. First, we test a simple behavioral cloning (BC) baseline, which trains using a max-likelihood loss on the expert data. In order to make the comparison fair to OPAL (which uses the offline dataset $\mathcal { D }$ in addition to the expert dataset), we pretrain the BC agent on the undirected dataset using the same max-likelihood loss. As a second baseline and to test the quality of OPAL-extracted primitives, we experiment with an alternative unsupervised objective from Wang et al. (2017), which prescribes using a sequential VAE (SVAE) over state trajectories in conjunction with imitation learning.
+
+Results: As shown in Table 2, $_ { \mathrm { B C + O P A L } }$ clearly outperforms other baselines, showing the importance of temporal abstraction and ascertaining the quality of learned primitives. SVAE’s slightly worse performance suggests that decoding the state trajectory directly is more difficult than simply predicting the actions, as OPAL does, and that this degrades downstream task learning.
+
+# A.2 ONLINE RL WITH OPAL
+
+Additional Assumptions: We assume online access to $\mathcal { M }$ ; i.e., access to Monte Carlo samples of episodes from $\mathcal { M }$ given an arbitrary policy $\pi$ .
+
+How to use with OPAL? To apply OPAL to standard online RL, we fix the learned primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ and learn a high-level policy $\pi _ { \psi } ( z | s )$ in an online fashion using the latents $z$ as temporally-extended actions. Specifically, when interacting the environment, $\pi _ { \psi } ( z | s )$ chooses an appropriate primitive every $c$ steps, and this primitive acts on the environment directly for $c$ timesteps. Any off-the-shelf online RL algorithm can be used to learn $\psi$ . In our experiments, we use SAC (Haarnoja et al., 2018). To ensure that $\pi _ { \psi } ( z | s )$ stays close to the data distribution and avoid generalization issues associated with the fixed $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ , we add an additional KL penalty to the reward of the form $\mathrm { D } _ { \mathrm { K L } } ( \pi _ { \psi } ( z | s ) | | \rho _ { \omega } ( z | s _ { 0 } ) )$ .
+
+Evaluation Description: We use Antmaze medium (diverse dataset) and Antmaze large (diverse dataset) from the D4RL task suite (Fu et al., 2020) to evaluate our method. We evaluate using both a dense distance-based reward $- \| g - \mathrm { a n t } _ { \mathrm { x y } } \|$ and a sparse success-based reward $1 [ \lVert g - \mathrm { a n t } _ { \mathrm { x y } } \rVert \leq 0 . 5 ]$ (the typical default for this task), where $\mathrm { a n t } _ { \mathrm { x y } }$ is the 2d position of the ant in the maze.
+
+Baseline: To solve these tasks through online RL, we need both (i) hierarchy (i.e. learning a policy on top of primitives) which improves exploration (Nachum et al., 2019b) and (ii) unlabelled (i.e. no task reward) offline dataset which allows us to bootstrap the primitives. This informed our choice of these three baselines. First, to test the role of $\mathcal { D }$ in exploration, we use HIRO (Nachum et al., 2018b), a state-of-the-art hierarchical RL method, as a baseline. Second, to test the role of temporal abstraction, we pre-train a flat policy on $\mathcal { D }$ using behavioral cloning (BC) and then finetune the policy on downstream tasks with SAC. Third, to test the quality of extracted primitives for online RL, we extract a discrete set of primitives with Deep Discovery of Continuous Options (DDCO) (Krishnan et al., 2017) and use Double DQN (DDQN) (Van Hasselt et al., 2015) to learn a task policy in the space of learned discrete primitives.
+
+Results: As shown in Table 3, SAC+OPAL outperforms all the baselines, showing (1) the importance of $\mathcal { D }$ in exploration, (2) the role of temporal abstraction, and (3) the good quality of learned primitives. Except for HIRO on Antmaze large with dense rewards, all other baselines fail to make any progress at all. In contrast, $\mathrm { S A C + O P A L }$ only fails to make progress on Antmaze large with sparse rewards.
+
+# A.3 ONLINE MULTI-TASK TRANSFER LEARNING WITH OPAL
+
+Additional Assumption: We assume the existence of $M$ additional MDPs $\begin{array} { r l } { \{ \mathcal { M } _ { i } } & { { } = } \end{array}$ $( S _ { i } , \mathcal { A } , \mathcal { P } _ { i } , r _ { i } , \gamma ) \} _ { i = 1 } ^ { M }$ where the action space $\mathcal { A }$ , and the discount factor $\gamma$ are same as those of $\mathcal { M }$ .
+
+How to use it with OPAL? In the multi-task setting, we aim to learn near-optimal behavior policies on $M$ MDPs $\{ \mathcal { M } _ { i } = ( S _ { i } , \mathcal { A } , \mathcal { P } _ { i } , r _ { i } , \gamma ) \} _ { i = 1 } ^ { M }$ . As in the previous applications of OPAL, we learn a set of high-level policies $\pi _ { \psi } ( z | s , i )$ which will direct pretrained primitives $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ to maximize cumulative rewards. Since the state space in the $M$ MDPs is potentially distinct from that in the offline dataset $\mathcal { D }$ , we cannot transfer the state distribution and can only hope to transfer the action sub-trajectory distribution. Therefore, during the unsupervised training phase for learning $\pi _ { \theta }$ , we make the encoder and the decoder blind to the states in sub-trajectory. Specifically, the encoder becomes $( \mu _ { z } ^ { e n c } , \sigma _ { z } ^ { e n c } ) = q _ { \phi } ( z _ { t } | s _ { t } , \{ a _ { t + i } \} _ { i = 0 } ^ { c - 1 } )$ and is represented by a bidirectional GRU. The decoder becomes $\pi _ { \boldsymbol { \theta } } \big ( \{ a _ { t } , \dots , a _ { t + c - 1 } \} | z _ { t } \big )$ which decodes the entire action sub-trajectory from the latent vector and is represented by a GRU. With these state-agnostic primitives in hand, we then learn a policy $\pi _ { \psi } ( z | s , \bar { i } )$ using any off-the-shelf online RL method. In our experiments, we use Proximal Policy Optimization (PPO) (Schulman et al., 2017).
+
+Evaluation Description: We use the Metaworld task suite (Yu et al., 2020) to evaluate our method. The dataset $\mathcal { D }$ for learning primitives consists of trajectories generated by an expert policy for a goal-conditioned pick-and-place task. The pick-and-place task is suitable for unsupervised primitive learning because it contains all the basic operations (eg: move, grasp, place) required for performing more complex manipulation tasks in the Metaworld. Once we have learned the primitives, we learn a policy $\pi _ { \psi } ( z | s , i )$ for the MT10 and MT50 benchmarks, where MT10 and MT50 contain 10 and 50 robotic manipulation tasks, respectively, which we need to be solved simultaneously. In these experiments we use $c = 5$ and $\mathrm { d i m } \mathbf { \bar { ( } } \mathcal { Z ) } = \mathbf { \bar { 8 } }$ .
+
+Baseline: We use SAC (Haarnoja et al., 2018) and PPO (Schulman et al., 2017) as baselines.
+
+Results: As shown in Table 4, PPO $^ +$ OPAL clearly outperforms both PPO and SAC, showing the importance of temporal abstraction in online multi-task transfer.
+
+# B PROOF OF THEOREMS
+
+# B.1 BOUNDING THE SUBOPTIMALITY OF THE LEARNED PRIMITIVES
+
+We will begin by proving the following lemma which bounds the sampling error incurred by $J ( \phi , \theta , \omega )$ .
+
+Lemma B.0.1. With high probability $1 - \delta$ ,
+
+$$
+\left| J ( \theta , \phi , \omega ) - \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , z \sim q _ { \phi } ( z | \tau ) } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] \right| \leq \sqrt { \frac { S _ { J } } { \delta } }
+$$
+
+where $S _ { J }$ is a constant dependent on concentration properties of $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ and $q _ { \phi } ( z | \tau )$ .
+
+Proof. To be concise, let us denote the sampling error in $J ( \phi , \theta , \omega )$ by
+
+$$
+\Delta _ { J } = \left| J ( \theta , \phi , \omega ) - \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , z \sim q _ { \phi } ( z | \tau ) } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] \right|
+$$
+
+Applying Chebyshev’s inequality to $\Delta _ { J }$ , we get that, with high probability $1 - \delta$ ,
+
+$$
+\Delta _ { J } \leq \sqrt { \frac { \mathrm { V a r } _ { \pi \sim \Pi , \tau \sim \pi , z \sim q _ { \phi } ( z | \tau ) } ( - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) ) } { \delta } } = \sqrt { \frac { S _ { J } } { \delta } }
+$$
+
+Therefore, combining all the equations, we have
+
+$$
+\mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , z \sim q _ { \phi } ( z | \tau ) } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] \leq J ( \theta , \phi , \omega ) + \sqrt { \frac { S _ { J } } { \delta } }
+$$
+
+We present a general performance difference lemma that will help in our proof of Lemma 4.0.1.
+
+Lemma B.0.2. If $\pi _ { 1 }$ and $\pi _ { 2 }$ are two policies in $\mathcal { M }$ , then
+
+$$
+| J _ { \mathrm { R L } } ( \pi _ { 1 } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { 2 } , \mathcal { M } ) | \leq \frac { 2 } { ( 1 - \gamma ) ^ { 2 } } \mathrm { R } _ { \mathrm { m a x } } \mathbb { E } _ { s \sim d ^ { \pi _ { 1 } } } [ \mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( a | s ) | | \pi _ { 2 } ( a | s ) ) ] .
+$$
+
+Proof. Following the derivations in Achiam et al. (2017) and Nachum et al. (2018a), we express the performance of a policy $\pi$ in $\mathcal { M }$ in terms of linear opterators:
+
+$$
+J _ { \mathrm { R L } } ( \pi , { \mathcal M } ) = ( 1 - \gamma ) ^ { - 1 } R ^ { \top } ( I - \gamma \Pi _ { \pi } { \mathcal P } ) ^ { - 1 } \Pi _ { \pi } \mu ,
+$$
+
+where $R$ is a vector representation of the rewards of $\mathcal { M } , \Pi _ { \pi }$ is a linear operator mapping state distributions to state-action distributions according to $\pi$ , and $\mu$ is a vector representation of the initial state distribution of $\mathcal { M }$ . Accordingly, we express the performance difference of $\pi _ { 1 } , \pi _ { 2 }$ as,
+
+$$
+\begin{array} { r l } & { \mathrm { \Phi _ { 1 } } , \boldsymbol { \mathcal { M } } ) - J _ { \mathrm { R L } } ( \pi _ { 2 } , \boldsymbol { \mathcal { M } } ) | = | R ^ { \top } ( ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu - ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } \Pi _ { 2 } \mu } \\ & { \quad \quad \quad \leq \mathrm { R } _ { \operatorname* { m a x } } | ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu - ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } \Pi _ { 2 } \mu | . } \end{array}
+$$
+
+By the triangle inequality, we may bound equation 18 by
+
+$$
+\begin{array} { r l } & { \mathrm { R } _ { \mathrm { m a x } } \big ( | ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu - ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu | \big . + } \\ & { \left. | ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu - ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } \Pi _ { 2 } \mu | \right) . } \end{array}
+$$
+
+We begin by approaching the first term inside the parentheses of equation 19. That first term may be expressed as
+
+$$
+\begin{array} { r l } & { \displaystyle | ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } ( I - \gamma \Pi _ { 2 } \mathcal { P } - ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ) ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu | } \\ & { \quad \quad \quad = | \gamma ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } ( \Pi _ { 1 } - \Pi _ { 2 } ) \mathcal { P } ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu | } \\ & { \quad \quad \quad \le \frac { \gamma } { 1 - \gamma } | ( \Pi _ { 1 } - \Pi _ { 2 } ) \mathcal { P } ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu | } \\ & { \quad \quad \quad = \frac { 2 \gamma } { ( 1 - \gamma ) ^ { 2 } } \mathbb { E } _ { s \sim ( 1 - \gamma ) \mathcal { P } ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu } [ \mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( a | s ) | | \pi _ { 2 } ( a | s ) ) ] . } \end{array}
+$$
+
+Now we continue to the second term inside the parentheses of equation 19. This second term may be expressed as
+
+$$
+\begin{array} { r l } & { \displaystyle | ( I - \gamma \Pi _ { 2 } \mathcal { P } ) ^ { - 1 } ( \Pi _ { 1 } - \Pi _ { 2 } ) \boldsymbol { \mu } | \leq \frac { 1 } { 1 - \gamma } | ( \Pi _ { 1 } - \Pi _ { 2 } ) \boldsymbol { \mu } | } \\ & { \quad \quad \quad \quad \quad \quad = \displaystyle \frac { 2 } { 1 - \gamma } \mathbb { E } _ { s \sim \boldsymbol { \mu } } [ \mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( a \vert s ) \| \pi _ { 2 } ( a \vert s ) ) ] . } \end{array}
+$$
+
+To combine equations 23 and 25, we note that
+
+$$
+d ^ { \pi _ { 1 } } = \gamma \cdot ( 1 - \gamma ) \mathcal { P } ( I - \gamma \Pi _ { 1 } \mathcal { P } ) ^ { - 1 } \Pi _ { 1 } \mu + ( 1 - \gamma ) \cdot \mu .
+$$
+
+Thus, we have
+
+$$
+| J _ { \mathrm { R L } } ( \pi _ { 1 } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { 2 } , \mathcal { M } ) | \leq \frac { 2 } { ( 1 - \gamma ) ^ { 2 } } \mathrm { R } _ { \mathrm { m a x } } \mathbb { E } _ { s \sim d ^ { \pi _ { 1 } } } [ \mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( a | s ) | | \pi _ { 2 } ( a | s ) ) ] ,
+$$
+
+as desired.
+
+Lemma 4.0.1. If $\pi _ { 1 }$ and $\pi _ { 2 }$ are two policies in $\mathcal { M }$ , then
+
+$$
+| J _ { \mathrm { R L } } ( \pi _ { 1 } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { 2 } , \mathcal { M } ) | \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim d _ { c } ^ { \pi _ { 1 } } } [ { \mathrm { D } } _ { \mathrm { T V } } ( \pi _ { 1 } ( \tau | s ) | | \pi _ { 2 } ( \tau | s ) ) ] ,
+$$
+
+where $\mathrm { D } _ { \mathrm { T V } } ( \pi _ { 1 } ( \tau | s ) | | \pi _ { 2 } ( \tau | s ) )$ denotes the TV divergence over $c$ -length sub-trajectories $\tau$ sampled from $\pi _ { 1 }$ vs. $\pi _ { 2 }$ (see section 3). Furthermore,
+
+$$
+\mathrm { S u b O p t } ( \theta ) \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim d _ { c } ^ { \pi ^ { * } } } \big [ \mathrm { D } _ { \mathrm { T V } } \big ( \pi ^ { * } ( \tau | s ) | | \pi _ { \theta , \psi ^ { * } } ( \tau | s ) \big ) \big ] .
+$$
+
+Proof. We focus on proving equation 28, as the subsequent derivation of equation 29 is straightforward by definition of SubOpt.
+
+To derive equation 28, we may simply consider $\pi _ { 1 }$ and $\pi _ { 2 }$ acting in an “every- $c$ -steps” version of $\mathcal { M }$ , where the action space is now $\tau$ and reward are accumulated over $c$ steps using $\gamma$ -discounting. Note that in this abstracted version of $\mathcal { M }$ , the max reward is $\frac { 1 - \gamma ^ { c } } { 1 - \gamma } \mathrm { R } _ { \operatorname* { m a x } }$ and the MDP discount is $\gamma ^ { c }$ . Plugging this into the result of Lemma B.0.2 immediately yields the desired claim. □
+
+Theorem 4.1. Let $\theta , \phi , \omega$ be the outputs of solving equation $^ { l }$ , such that $J ( \theta , \phi , \omega ) = \epsilon _ { c }$ . Then, with high probability $1 - \delta$ , for any $\overline { { \pi } }$ that is $\zeta$ -common in $\Pi$ , there exists a distribution $H$ over $z$ such that for $\pi _ { \boldsymbol { \theta } } ^ { H } ( \tau | \boldsymbol { s } ) : = \mathbb { E } _ { \boldsymbol { z } \sim H } [ \pi _ { \boldsymbol { \theta } } ( \tau | \boldsymbol { z } , \boldsymbol { s } ) ]$ ,
+
+$$
+\mathbb { E } _ { s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau | s ) | | \pi _ { \theta } ^ { H } ( \tau | s ) ) ] \leq \zeta + \sqrt { \frac { 1 } { 2 } \left( \epsilon _ { c } + \sqrt { \frac { S _ { J } } { \delta } } + \mathcal { H } _ { c } \right) } ,
+$$
+
+where $\begin{array} { r } { \mathcal { H } _ { c } = \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa , \tau \sim \pi } [ \sum _ { t = 0 } ^ { c - 1 } \log \pi ( a _ { t } | s _ { t } ) ] } \end{array}$ (i.e. a constant and property of $\mathcal { D }$ ) and $S _ { J }$ is a positive constant incurred due to sampling error in $J ( \theta , \phi , \omega )$ and depends on concentration properties of $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ and $q _ { \phi } ( z | \tau )$ .
+
+Proof. We start with application of the triangle inequality:
+
+$$
+\begin{array} { r } { \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau \vert s ) \vert \vert \pi _ { \theta } ^ { H } ( \tau \vert s ) ) \leq \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau \vert s ) \vert \vert \pi ( \tau \vert s ) ) + \mathrm { D } _ { \mathrm { T V } } ( \pi ( \tau \vert s ) \vert \vert \pi _ { \theta } ^ { H } ( \tau \vert s ) ) . } \end{array}
+$$
+
+Taking expectation with respect to $\pi \sim \Pi , s \sim \kappa$ on both the sides, we get
+
+$$
+\begin{array} { r l } { \mathbb { E } _ { s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau ) | | \pi _ { \theta } ^ { H } ( \tau ) ) ] \leq \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau ) | | \pi ( \tau ) ) ] + \mathbb { E } _ { \pi \sim \Pi , s \sim \mu } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ( \tau ) | | \pi _ { \theta } ^ { H } ( \tau ) ) ] } & { } \\ { \leq \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \overline { { \pi } } ( \tau ) | | \pi ( \tau ) ) ] } & { } \\ { \quad \quad \quad \quad \quad \quad + \mathbb { E } _ { \pi \sim \Pi , s \sim \mu } [ \sqrt { \frac { 1 } { 2 } \mathrm { D } _ { \mathrm { K L } } ( \pi ( \tau ) | | \pi _ { \theta } ^ { H } ( \tau ) ) ] } } & { } \\ { \leq \zeta + \sqrt { \frac { 1 } { 2 } \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , s \sim \kappa } [ \mathrm { l o g } \pi ( \tau ) - \log \mathbb { E } _ { z \sim H } [ \pi _ { \theta } ( \tau | z ) ] ] } } & { } \\ { \leq \zeta + \sqrt { \frac { 1 } { 2 } \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa , \tau \sim \pi , z \sim H } [ \log \pi ( \tau ) - \log \pi _ { \theta } ( \tau | z ) ] } . } & { } \end{array}
+$$
+
+The last two inequality used Jensen’s inequality. Let $H ( z ) = \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi } [ q _ { \phi } ( z | \tau ) ]$ . Cancelling out the dynamics and using equation 14 we get,
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { s \sim k } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ( \tau ) | | \pi _ { \theta } ^ { H } ( \tau ) ) ] } \\ & { \le \zeta + \sqrt { \frac { 1 } { 2 } \mathbb { E } _ { \pi \sim \Pi , s \sim \kappa , \tau \sim \pi , z \sim q _ { \theta } ( z | \tau ) } \left[ \displaystyle \sum _ { t = 0 } ^ { \tau - 1 } ( \log \pi ( a _ { t } | s _ { t } ) - \log \pi \theta ( a _ { t } | s _ { t } , z ) ) \right] } } \\ & { \le \zeta + \sqrt { \frac { 1 } { 2 } \left( \mathcal { H } _ { c } + \sqrt { \frac { S _ { J } } { \delta } } + J ( \theta , \phi , \omega ) \right) } } \\ & { = \zeta + \sqrt { \frac { 1 } { 2 } \left( \mathcal { H } _ { c } + \epsilon _ { c } + \sqrt { \frac { S _ { J } } { \delta } } \right) } } \end{array}
+$$
+
+Corollary 4.1.1. If the optimal policy $\pi ^ { * }$ of $\mathcal { M }$ is $\zeta$ -common in $\Pi$ , and $\begin{array} { r } { \left\| \frac { d _ { c } ^ { \pi ^ { * } } } { \kappa } \right\| _ { \infty } \leq \xi } \end{array}$ , then, with high probability $1 - \delta$ ,
+
+$$
+\mathrm { S u b O p t } ( \theta ) \leq \frac { 2 \xi } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \left( \zeta + \sqrt { \frac { 1 } { 2 } \left( \epsilon _ { c } + \sqrt { \frac { S _ { J } } { \delta } } + \mathcal { H } _ { c } \right) } \right)
+$$
+
+Proof. Expanding lemma 4.0.1 using the above assumption, we have
+
+$$
+\begin{array} { r l } & { \mathrm { S u b O p t } ( \theta ) \leq | J _ { \mathrm { R L } } ( \pi ^ { * } , \mathcal { M } ) - J _ { \mathrm { R L } } ( \pi _ { \theta } ^ { H } , \mathcal { M } ) | } \\ & { \qquad \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim d _ { c } ^ { * } } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ^ { * } ( \tau | s ) | | \pi _ { \theta } ^ { H } ( \tau | s ) ) ] } \\ & { \qquad \leq \frac { 2 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \left\| \frac { d _ { c } ^ { \pi ^ { * } } } { \kappa } \right\| _ { \infty } \mathbb { E } _ { s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ^ { * } ( \tau | s ) | | \pi _ { \theta } ^ { H } ( \tau | s ) ) ] } \\ & { \qquad \leq \frac { 2 \xi } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathrm { R } _ { \operatorname* { m a x } } \mathbb { E } _ { s \sim \kappa } [ \mathrm { D } _ { \mathrm { T V } } ( \pi ^ { * } ( \tau | s ) | | \pi _ { \theta } ^ { H } ( \tau | s ) ) ] } \end{array}
+$$
+
+Now, we can use theorem 4.1 to prove the corollary.
+
+# B.2 PERFORMANCE BOUNDS FOR OPAL
+
+Theorem 4.2. Let $\pi _ { \psi ^ { * } } ( z | s )$ be the policy obtained by CQL and let $\pi _ { \psi ^ { * } , \theta } ( a | s )$ refer to the policy when $\pi _ { \psi ^ { * } } ( z | s )$ is used together with $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ . $L e t \pi _ { \beta } \equiv \{ \pi ; \pi \sim \Pi \}$ refer to the policy generating ${ \mathcal { D } } ^ { r }$ in MDP $\mathcal { M }$ and $z \sim \pi _ { \beta } ^ { H } ( z | s ) \equiv \tau \sim \pi _ { \beta , s _ { 0 } = s } , z \sim q _ { \phi } ( z | \tau ) .$ . Then, $J ( \pi _ { \psi ^ { * } , \theta } , M ) \geq J ( \pi _ { \beta } , M ) - \kappa$ with high probability $1 - \delta$ where
+
+$$
+\begin{array} { r } { \kappa = \mathcal { O } \Bigg ( \frac { 1 } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathbb { E } _ { s \sim d _ { \dot { M } _ { H } } ^ { \pi _ { \psi } * , \theta } ( s ) } \left[ \sqrt { | \mathcal { Z } | ( \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s ) + 1 ) } \right] \Bigg ) } \\ { - \frac { \alpha } { 1 - \gamma ^ { c } } E _ { s \sim d _ { \dot { M } _ { H } } ^ { \pi _ { \psi ^ { * } } } ( s ) } \left[ \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } , \theta } , \pi _ { \beta } ^ { H } ) ( s ) \right] } \end{array}
+$$
+
+Proof. We assume that the variational posterior $q _ { \phi } ( z | \tau )$ obtained after learning OPAL from $\mathcal { D }$ is same (or nearly same) as the true posterior $p ( z | \tau )$ . $q _ { \phi }$ can be used to define $\pi _ { \beta } ^ { H } ( z | s )$ as $z \sim \pi _ { \beta } ^ { H } \equiv \tau \sim \pi _ { \beta } , z \sim q _ { \phi } ( z | \tau )$ . This induces an MDP $\mathcal { M } _ { H } = ( \mathcal { S } , \mathcal { Z } , \mathcal { P } _ { z } , r _ { z } , \gamma ^ { c } )$ where $\mathcal { Z }$ is the inferred latent space for choosing primitives, $\mathcal { P } _ { z }$ and $r _ { z }$ are the latent dynamics and reward function such that $s _ { t + c } \sim \mathcal { P } _ { z } ( s _ { t + c } | s _ { t } , z _ { t } ) \equiv s _ { t + i + 1 } \sim \mathcal { P } ( s _ { t + i + 1 } | s _ { t + i } , a _ { t + i } ) , a _ { t + i } \sim \pi ( a _ { t + i } | s _ { t + i } , z _ { t } ) \ \forall i \in \mathcal { U } .$ $\{ 0 , 1 , \ldots , c - 1 \}$ and g the $\begin{array} { r } { r _ { z } ( s _ { t } , z _ { t } ) = \sum _ { i = 0 } ^ { c - 1 } \gamma ^ { i } r ( s _ { t + i } , a _ { t + i } ) } \end{array}$ d i $\gamma ^ { c }$ is the new discount fahe primitive induced by r ef-and $c$ $\pi ( a | s , z )$ $q _ { \phi }$ $\pi _ { \beta }$ . Since $q _ { \phi }$ captures the true posterior, $\pi ( a | s , z )$ is the optimal primitive you can learn and its autoencoding loss, under true expectation, is $\begin{array} { r } { \epsilon _ { c } ^ { * } = \mathbb { E } _ { \pi \sim \Pi , \tau \sim \pi , z \sim q _ { \phi } ( z | \tau ) } \left[ - \sum _ { t = 0 } ^ { c - 1 } \log \pi ( a _ { t } | s _ { t } , z ) \right] } \end{array}$ . Therefore, $\tau \sim \pi _ { \beta } \equiv z \sim \pi _ { \beta } ^ { H } , \tau \sim \pi ( \cdot | \cdot , z )$ . $\pi _ { \beta }$ is used to collect the data ${ \mathcal { D } } ^ { r }$ which induces an empirical MDP. We refer to the empirical MDP induced by ${ \mathcal { D } } ^ { r }$ as $\hat { \mathcal { M } } = ( S , A , \hat { \mathcal { P } } , \hat { \mu } , r , \gamma )$ where $\begin{array} { r } { \mathcal { \hat { P } } ( \hat { s ^ { \prime } } | \hat { s } , \hat { a } ) = \frac { \sum _ { ( s , a , s ^ { \prime } ) \sim \mathcal { D } } 1 [ s = \hat { s } , a = \hat { a } , s ^ { \prime } = \hat { s ^ { \prime } } ] } { \sum _ { ( s , a ) \sim \mathcal { D } } 1 [ s = \hat { s } , a = \hat { a } ] } } \end{array}$ and µˆ(ˆs) = Ps0∼D 1[s0=ˆs] . We use $q _ { \phi }$ to get $\mathcal { D } _ { \mathrm { h i } } ^ { r }$ from ${ \mathcal { D } } ^ { r }$ which induces another empirical MDP $\hat { \mathcal { M } } _ { H }$ . Using these definitions, we will try to bound $| J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \beta } , \mathcal { M } ) |$ .
+
+Let’s break $| J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \beta } , \mathcal { M } ) |$ into
+
+$$
+\begin{array} { r l } & { | J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \beta } , \mathcal { M } ) | \leq | J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \psi ^ { * } } , \mathcal { M } _ { H } ) | } \\ & { ~ + | J ( \pi _ { \psi ^ { * } } , \mathcal { M } _ { H } - J ( \pi _ { \beta } ^ { H } , \mathcal { M } _ { H } ) | } \\ & { ~ + | J ( \pi _ { \beta } ^ { H } , \mathcal { M } _ { H } ) - J ( \pi _ { \beta } , \mathcal { M } ) | } \end{array}
+$$
+
+Since $q _ { \phi }$ captures the true variational posterior, $\tau \sim \pi _ { \beta } \equiv z \sim \pi _ { \beta } ^ { H } , \tau \sim \pi ( \cdot | \cdot , z )$ and therefore, $| J ( \pi _ { \beta } ^ { H } , \mathcal { M } _ { H } ) - J ( \pi _ { \beta } , \mathcal { M } ) | = 0$ . For bounding, $| J ( \pi _ { \psi ^ { * } } , \mathcal { M } _ { H } - J ( \pi _ { \beta } ^ { H } , \mathcal { M } _ { H } ) |$ , we use theorem 3.6 from Kumar et al. (2020b) and apply it to $\mathcal { M } _ { H }$ to get
+
+$$
+\begin{array} { r l } & { | J ( \pi _ { \psi ^ { \star } } , \mathcal { M } _ { H } ) - J ( \pi _ { \beta } ^ { H } , \mathcal { M } _ { H } ) | } \\ & { \leq 2 \left( \displaystyle \frac { C _ { r , \delta } } { 1 - \gamma ^ { c } } + \displaystyle \frac { \gamma ^ { c } \mathrm { R } _ { \operatorname* { m a x } } C _ { \mathcal { P } , \delta } } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \right) \mathbb { E } _ { s \sim d _ { \mathcal { M } _ { H } } ^ { \pi _ { \psi ^ { \star } , \theta } } ( s ) } \left[ \sqrt { \displaystyle \frac { | \mathcal { Z } | } { | \mathcal { D } ( s ) | } \mathrm { D c o L } ( \pi _ { \psi ^ { \star } } , \pi _ { \beta } ^ { H } ) ( s ) + 1 } \right] } \\ & { - \displaystyle \frac { \alpha } { 1 - \gamma ^ { c } } E _ { s \sim d _ { \mathcal { M } _ { H } } ^ { \pi _ { \psi ^ { \star } } } ( s ) } \left[ \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { \star } , \theta } , \pi _ { \beta } ^ { H } ) ( s ) \right] = \kappa _ { 2 } } \end{array}
+$$
+
+Now, we will try to bound $| J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \psi ^ { * } } , \mathcal { M } _ { H } ) |$ . The only difference between the two is that the primitive $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ is used in $\mathcal { M }$ and the primitive $\pi ( a | s , z )$ is used in $\mathcal { M } _ { H }$ . Therefore, we can write the above bound as $| J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \psi ^ { * } , \pi ( \cdot | \cdot , z ) } , \mathcal { M } ) |$ . Let’s first bound their value function at a particular state $s$ . Using Lemma 4.0.1, we get
+
+$$
+\begin{array} { r l } & { | J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \psi ^ { * } , \pi ( \cdot \cdot \cdot ) , z } , \mathcal { M } ) | } \\ & { \leq \frac { 2 \mathrm { R } _ { \operatorname* { m a x } } } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } \mathbb { E } _ { s \sim d _ { c } ^ { \pi _ { \psi ^ { * } , \pi ( \cdot \cdot \cdot , z ) } } } \left[ \mathrm { D } _ { \mathrm { T V } } ( \pi _ { \psi ^ { * } , \pi ( \cdot \cdot \cdot , z ) } ( \tau | s ) | | \pi _ { \psi ^ { * } , \theta } ( \tau | s ) ) \right] } \\ & { \leq \frac { 2 \mathrm { R } _ { \operatorname* { m a x } } } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } E _ { s \sim d _ { c } ^ { \pi _ { \psi ^ { * } , \pi ( \cdot \cdot , \cdot , z ) } } } \left[ \sqrt { \frac { 1 } { 2 } \mathrm { D } _ { \mathrm { K L } } ( \pi _ { \psi ^ { * } , \pi ( \cdot \cdot , z ) } ( \tau | s ) | | \pi _ { \psi ^ { * } , \theta } ( \tau | s ) ) } \right] } \end{array}
+$$
+
+Now, we will try to bound $\mathrm { D } _ { \mathrm { K L } } \big ( \pi _ { \psi ^ { * } , \pi ( \cdot | \cdot , z ) } ( \tau | s ) \big | \big | \pi _ { \psi ^ { * } , \theta } ( \tau | s ) \big )$ . We have
+
+$$
+\begin{array} { r l } & { \mathbb { E } _ { z \sim \pi _ { \psi ^ { * } } ( z | s ) , \tau \sim \pi ( \tau | s , z ) } \left[ \log \frac { \pi _ { \psi ^ { * } } ( z | s ) \prod _ { t = 1 } ^ { c - 1 } \mathcal { P } ( s _ { t } | s _ { t - 1 } , a _ { t - 1 } ) \prod _ { t = 0 } ^ { c - 1 } \pi \big ( a _ { t } | s _ { t } , z \big ) } { \pi _ { \psi ^ { * } } ( z | s ) \prod _ { t = 1 } ^ { c - 1 } \mathcal { P } \big ( s _ { t } | s _ { t - 1 } , a _ { t - 1 } \big ) \prod _ { t = 0 } ^ { c - 1 } \pi _ { \theta } \big ( a _ { t } | s _ { t } , z \big ) } \right] } \\ & { = \mathbb { E } _ { z \sim \pi _ { \psi ^ { * } } ( z | s ) , \tau \sim \pi ( \tau | s , z ) } \left[ \displaystyle \sum _ { t = 0 } ^ { c - 1 } \log \pi \big ( a _ { t } | s _ { t } , z \big ) - \log \pi _ { \theta } \big ( a _ { t } | s _ { t } , z \big ) \right] } \\ & { = \mathbb { E } _ { z \sim \pi _ { \beta } ( z | s ) , \tau \sim \pi ( \tau | s , z ) } \left[ \left( \frac { \pi _ { \psi ^ { * } } ( z | s ) } { \pi _ { \beta } ^ { H } ( z | s ) } \right) \displaystyle \sum _ { t = 0 } ^ { c - 1 } \log \pi \big ( a _ { t } | s _ { t } , z \big ) - \log \pi _ { \theta } \big ( a _ { t } | s _ { t } , z \big ) \right] } \end{array}
+$$
+
+$$
+\begin{array} { r l } & { \le \left| \frac { \pi _ { \psi ^ { * } } \left( z | s \right) } { \pi _ { \beta } ^ { H } \left( z | s \right) } \right| _ { \infty } \mathbb { E } _ { z \sim \pi _ { \beta } \left( z | s \right) , \tau \sim \pi \left( \tau | s , z \right) } \left[ \overset { c - 1 } { \underset { t = 0 } { \sum } } \log \pi ( a _ { t } | s _ { t } , z ) - \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] } \\ & { \le \left| \frac { \pi _ { \psi ^ { * } } \left( z | s \right) } { \pi _ { \beta } ^ { H } \left( z | s \right) } \right| _ { \infty } \left( \epsilon _ { c } - \epsilon _ { c } ^ { * } + \sqrt { \frac { S _ { J } } { \delta } } \right) } \end{array}
+$$
+
+The last equation comes from above definition of $\epsilon _ { c } ^ { * }$ and equation 14. We will now try to bound $\left| \frac { \pi _ { \psi ^ { * } } ( z | s ) } { \pi _ { \beta } ^ { H } ( z | s ) } \right| _ { \circ }$ using $\mathrm { D } _ { \mathrm { C Q L } } \big ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } \big ) \big ( s \big ) .$ . Using definition of $\mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s )$ , we have
+
+$$
+\begin{array} { r l } & { \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s ) = \displaystyle \sum _ { z } \pi _ { \psi ^ { * } } ( z | s ) \left( \frac { \pi _ { \psi ^ { * } } ( z | s ) } { \pi _ { \beta } ^ { H } ( z | s ) } - 1 \right) } \\ & { \displaystyle \Rightarrow \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s ) + 1 = \displaystyle \sum _ { z } \pi _ { \beta } ^ { H } ( z | s ) \left( \frac { \pi _ { \psi ^ { * } } ( z | s ) } { \pi _ { \beta } ^ { H } ( z | s ) } \right) ^ { 2 } \leq \left| \frac { \pi _ { \psi ^ { * } } ( z | s ) } { \pi _ { \beta } ^ { H } ( z | s ) } \right| _ { \infty } ^ { 2 } \pi _ { \beta } ^ { H } ( \bar { z } | s ) } \end{array}
+$$
+
+$\begin{array} { r } { \bar { z } = \arg \operatorname* { m a x } _ { z } \left( \frac { \pi _ { \psi ^ { * } } \left( z | s \right) } { \pi _ { \beta } ^ { H } \left( z | s \right) } \right) } \end{array}$ . To be concise, let
+
+$$
+\Delta _ { c } = \left( \epsilon _ { c } - \epsilon _ { c } ^ { * } + \sqrt { \frac { S _ { J } } { \delta } } \right)
+$$
+
+Combining above equations, we have
+
+$$
+\mathrm { D } _ { \mathrm { K L } } \big ( \pi _ { \psi ^ { * } } ( z | s ) \pi ( \tau | s , z ) \big | | \pi _ { \psi ^ { * } } ( z | s ) \pi _ { \theta } ( \tau | s , z ) \big ) \leq \Delta _ { c } \sqrt { \frac { \mathrm { D } _ { \mathrm { C Q L } } \big ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } \big ) \big ( s \big ) + 1 } { \pi _ { \beta } ^ { H } \big ( \bar { z } | s \big ) } }
+$$
+
+Using this to bound the returns, we get
+
+$$
+\begin{array} { r l } & { \quad | J ( \pi _ { \psi ^ { * } , \theta } , \mathcal { M } ) - J ( \pi _ { \psi ^ { * } , \pi ( \cdot \vert \cdot , z ) } , \mathcal { M } ) | } \\ & { \le \frac { 2 \mathrm { R } _ { \operatorname* { m a x } } } { ( 1 - \gamma ^ { c } ) ( 1 - \gamma ) } E _ { s \sim d _ { c } ^ { \pi _ { \psi ^ { * } , \pi ( \cdot \vert \cdot , z ) } } } \left[ \left( \frac { \mathrm { D } _ { \mathrm { C Q L } } ( \pi _ { \psi ^ { * } } , \pi _ { \beta } ^ { H } ) ( s ) + 1 } { \pi _ { \beta } ^ { H } ( \bar { z } \vert s ) } \right) ^ { \frac { 1 } { 4 } } \sqrt { \frac { 1 } { 2 } \Delta _ { c } } \right] } \\ & { = \kappa _ { 1 } } \end{array}
+$$
+
+We get $\kappa = \kappa _ { 1 } + \kappa _ { 2 }$ . We apply $\mathcal { O }$ to get the notation in the theorem.
+
+# C EXPERIMENT DETAILS
+
+# C.1 OPAL EXPERIMENT DETAILS
+
+Encoder The encoder $q _ { \phi } ( z | \tau )$ takes in state-action trajectory $\tau$ of length $c$ . It first passes the individual states through a fully connected network with 2 hidden layers of size $H$ and ReLU activation. Then it concatenates the proccessed states with actions and passes it through a bidirectional GRU with hidden dimension of $H$ and 4 GRU layers. It projects the output of GRU to mean and log standard deviation of the latent vector through linear layers.
+
+Prior The prior $\rho _ { \omega } ( z | s )$ takes in the current state $s$ and passes it through a fully connected network with 2 hidden layers of size $H$ and ReLU activation. It then projects the output of the hidden layers to mean and log standard deviation of the latent vector through linear layers.
+
+Primitive Policy The primitive (i.e. decoder) $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ has same architecture as the Prior but it takes in state and latent vector and produces mean and log standard deviation of the action. For kitchen environments, we use an autoregressive primitive policy with same architecture as used by EMAQ (Ghasemipour et al., 2020).
+
+We use $H = 2 0 0$ for antmaze environments and $H = 2 5 6$ for kitchen environments. In both cases, OPAL was trained for 100 epochs with a fixed learning rate of $1 e - 3$ , $\beta = 0 . 1$ (Lynch et al., 2020), Adam optimizer (Kingma & Ba, 2014) and a batch size of 50.
+
+# C.2 TASK POLICY ARCHITECTURE
+
+In all environments, for task policy, we used a fully connected network with 3 hidden layers of size 256 and ReLU activation. It then projects the output of the hidden layers to mean and log standard deviation of the latent vector through linear layers.
+
+
Environment
dim(2)=4
dim(z)=8
dim(2)=16
antmaze medium (diverse)
68.7 ± 2.3
81.1 ± 3.1
81.3 ± 1.8
+
+Table 5: Average success rate $( \% )$ (over 4 seeds) of $\mathrm { C Q L + O P A L }$ for different values of $\dim ( { \mathcal { Z } } )$ . We fix $c = 1 0$ .
+
+# C.3 SAC HYPERPARAMETERS
+
+We used SAC (Haarnoja et al., 2018) for online RL experiments in learning a task policy either in action space $\mathcal { A }$ or latent space $\mathcal { Z }$ . For the discrete primitives extracted from DDCO (Krishnan et al., 2017), we used Double DQN Van Hasselt et al. (2015). We used the standard hyperparameters for SAC and Double DQN as provided in rlkit code base (https://github.com/vitchyr/ rlkit) with both policy learning rate and q value learning rate as $3 e - 4$ .
+
+# C.4 CQL HYPERPARAMETERS
+
+We used CQL (Kumar et al., 2020b) for offline RL experiments in learning a task policy either in action space $\mathcal { A }$ or latent space $\mathcal { Z }$ . We used the standard hyperparameters, as mentioned in Kumar et al. (2020b)., with minor differences. We used policy learning rate of $3 e - 5$ , q value learning rate of $3 e - 4$ , and primitive learning rate of $3 e - 4$ . For antmaze tasks, we used $\operatorname { C Q L } ( { \mathcal { H } } )$ variant with $\tau = 5$ and learned $\alpha$ . For kitchen tasks we used $\operatorname { C Q L } ( \rho )$ variant with fixed $\alpha = 1 0$ . In both cases, we ensured $\alpha$ never dropped below 0.001.
+
+# D CONNECTION BETWEEN OPAL AND VAE OBJECTIVES
+
+We are given an undirected, unlabelled and diverse dataset $\mathcal { D }$ of sub-trajectories of length $c$ . We would like to fit a sequential VAE model to $\mathcal { D }$ which maximizes
+
+$$
+\operatorname* { m a x } _ { \theta } \mathbb { E } _ { \tau \sim \mathcal { D } } [ \log p _ { \theta } ( \tau | s _ { 0 } ) ]
+$$
+
+where $s _ { 0 }$ is initial state of the sub-trajectory. Let’s consider
+
+$$
+\log p _ { \theta } ( \tau \vert s _ { 0 } ) = \log \int p _ { \theta } ( \tau , z \vert s _ { 0 } ) d z = \log \int \frac { p _ { \theta } ( \tau , z \vert s _ { 0 } ) q _ { \phi } ( z \vert \tau ) } { q _ { \phi } ( z \vert \tau ) } d z
+$$
+
+(using Jensen’s inequality)
+
+$$
+\ge \int q _ { \phi } ( z | \tau ) \big [ \log p _ { \theta } ( \tau , z | s _ { 0 } ) - \log q _ { \phi } ( z | \tau ) \big ] d z = \mathbb { E } _ { z \sim q _ { \phi } ( z | \tau ) } \left[ \log p _ { \theta } ( \tau | z , s _ { 0 } ) - \log \frac { q _ { \phi } ( z | \tau ) } { p _ { \theta } ( z | s _ { 0 } ) } \right] .
+$$
+
+Using the above equation, we have the following lower-bound for our objective function
+
+$$
+\begin{array} { r l } & { \underset { \theta , \phi } { \operatorname* { m a x } } \mathbb { E } _ { \tau \sim \mathcal { D } } [ \log p _ { \theta } ( \tau | s _ { 0 } ) ] \geq \underset { \theta , \phi } { \operatorname* { m a x } } \mathbb { E } _ { \tau \sim \bar { D } , z \sim q _ { \phi } ( z | \tau ) } \left[ \log p _ { \theta } ( \tau | z , s _ { 0 } ) - \log \frac { q _ { \phi } ( z | \tau ) } { p _ { \theta } ( z | s _ { 0 } ) } \right] } \\ & { = \underset { \theta , \phi } { \operatorname* { m a x } } \mathbb { E } _ { \tau \sim \mathcal { D } , z \sim q _ { \phi } ( z | \tau ) } [ \log p _ { \theta } ( \tau | z , s _ { 0 } ) ] - \operatorname { D } _ { \mathrm { K L } } ( q _ { \phi } ( z | \tau ) | | p _ { \theta } ( z | s _ { 0 } ) ) } \end{array}
+$$
+
+We separate the parameters of decoder from prior and hence write $p _ { \theta } ( z | s _ { 0 } ) = \rho _ { \omega } ( z | s _ { 0 } )$ . We can expand can be $\begin{array} { r } { \log p _ { \theta } ( \tau | z , s _ { 0 } ) = \sum _ { t = 1 } ^ { c - 1 } \log \mathcal { P } ( s _ { t } | s _ { t - 1 } , a _ { t - 1 } ) + \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) } \end{array}$ . Since ive fun $\mathcal { P }$ is fixed iton as
+
+$$
+\operatorname* { m a x } _ { \theta , \phi } \mathbb { E } _ { \tau \sim \mathcal { D } , z \sim q _ { \phi } ( z | \tau ) } \left[ \sum _ { t = 0 } ^ { c - 1 } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z ) \right] - \beta \mathrm { D } _ { \mathrm { K L } } ( q _ { \phi } ( z | \tau ) | | \rho _ { \omega } ( z | s _ { 0 } ) )
+$$
+
+where $\beta = 1$ . This is similar to the autoencoding loss function we described in section 4.
+
+# E ABLATION STUDIES
+
+As shown in Table 5, we experimented with different choices of $\dim ( { \mathcal { Z } } )$ on antmaze-medium (diverse). Using the hyperparameters from Nachum et al. (2018a), we fixed $c ~ = ~ 1 0 $ . While $\dim ( { \mathcal { Z } } ) = 8 , 1 6$ gave similar performances, $\mathrm { d i m } ( \mathcal { Z } ) = 4$ performed slightly worse. Therefore, we selected $\mathrm { d i m } ( \mathcal { Z } ) = 8$ for our final model as it was simpler.
+
+Temporal abstraction actually helps: To empirically verify that the gain in performance was due to temporal abstraction and not better action space learned through latent space, we tried $c = 1$ $( \mathrm { d i m } ( \bar { \mathcal { Z } } ) = 8 )$ and found the performance to be similar to that of CQL (i.e. $5 5 . 3 \pm 3 . 8 )$ thereby empirically supporting the theoretical benefits of temporal abstraction.
+
+We found $\dim ( { \mathcal { Z } } ) = 8$ and $c = 1 0$ to work well with other environments as well. However, we acknowledge that the performance of $\mathrm { C Q L + O P A L }$ can be further improved by carefully choosing better hyperparameters for each environment or by using other offline hyperparameter selection methods for offline RL, which is a subject of future work.
+
+# F ALTERNATIVE METHODS FOR EXTRACTING PRIMITIVES FROM OFFLINE DATA
+
+We describe alternative methods for extracting a primitive policy from offline data. These methods are offline variants of CARML (Jabri et al., 2019) and DADS (Sharma et al., 2019). We tried these techniques in an early phase of our project and used the environment antmaze-medium (diverse) to evaluate these methods.
+
+Let’s consider an offline undirected, unlabelled and diverse dataset $\boldsymbol { \mathcal { D } } \ : = \ : \{ ( s _ { t } ^ { i } , a _ { t } ^ { i } ) _ { t = 0 } ^ { c - 1 } \} _ { i = 1 } ^ { N }$ . Let ${ \tau } = ( s _ { t } ) _ { t = 0 } ^ { c - 1 }$ represent the state trajectory. To extract primitives, we first cluster the trajectories by maximizing the mutual information between the state trajectory $\tau$ and latent variable $z$ (indicating cluster index) with respect to the parameters of joint distribution $p _ { \phi , \omega } ( \tau , z ) = p _ { \omega } ( z ) p _ { \phi } ( \tau | z )$ . For now, we consider $p _ { \omega } ( z ) = \mathrm { C a t } ( p _ { 1 } , . . . , p _ { k } )$ (i.e. discrete latent variables sampled from a Categorical distribution) and represent $z$ as one-hot vector of dimension $k$ . The choice of $p _ { \omega } ( z )$ is consistent with the choices made in Jabri et al. (2019) and Sharma et al. (2019). Since $z$ is discrete, we can use Bayes rule to calculate $p _ { \phi , \omega } ( z | \tau )$ as
+
+$$
+p _ { \phi , \omega } ( z | \tau ) = \frac { p _ { \omega } ( z ) p _ { \phi } ( \tau | z ) } { \sum _ { i = 1 } ^ { k } p _ { \omega } ( z _ { i } ) p _ { \phi } ( \tau | z _ { i } ) } .
+$$
+
+Our objective function becomes
+
+$$
+\operatorname* { m a x } _ { \phi , \omega } I ( \tau ; z ) = \operatorname* { m a x } _ { \phi , \omega } \mathbb { E } _ { \tau \sim \mathcal { D } , z \sim p _ { \phi , \omega } ( z | \tau ) } \left[ \log \frac { p _ { \phi } ( \tau | z ) } { p ( \tau ) } \right] .
+$$
+
+Offline CARML and offline DADS differ only in how they model $p _ { \phi } ( \tau | z )$ :
+
+• Offline CARML We model $\begin{array} { r } { p _ { \phi } ( \tau | z ) = \prod _ { t = 0 } ^ { c - 1 } p _ { \phi } ( s _ { t } | z ) } \end{array}$ and hence, $\begin{array} { r l } { \log p _ { \phi } ( \tau | z ) } & { { } = } \end{array}$ $\scriptstyle \sum _ { t = 0 } ^ { c - 1 } \log p _ { \phi } ( s _ { t } | z )$ . • Offline DADS We model $\begin{array} { r } { p _ { \phi } ( \tau \vert z ) = p ( s _ { 0 } ) \prod _ { t = 1 } ^ { c - 1 } p _ { \phi } ( s _ { t } \vert s _ { t - 1 } , z ) } \end{array}$ and hence, $\begin{array} { r l } { \log p _ { \phi } ( \tau | z ) = } \end{array}$ $\begin{array} { r } { \log p ( s _ { 0 } ) + \sum _ { t = 0 } ^ { c - 1 } \log p _ { \phi } ( s _ { t } | s _ { t - 1 } , z ) } \end{array}$ . Here, we only model $p _ { \phi } ( s _ { t } | s _ { t - 1 } , z )$ and not $p ( s _ { 0 } )$ . Since, log is additive in nature, $p ( s _ { 0 } )$ will be ignored while calculating gradient.
+
+To optimize equation 72, we use Algorithm 2 from Jabri et al. (2019). Once we have clustered the state trajectories $\tau$ with labels $z$ by maximizing $I ( \tau ; z )$ , we can use behavioral cloning (BC) to learn $\pi _ { \boldsymbol { \theta } } ( a | s , \bar { z } )$ .
+
+Finally, we use $p _ { \phi , \omega } ( z | \tau )$ to label the reward-labelled data $\mathcal { D } ^ { r } = \{ ( s _ { t } ^ { i } , a _ { t } ^ { i } , r _ { t } ^ { i } ) _ { t = 0 } ^ { c - 1 } \} _ { i = 1 } ^ { N }$ with latents, and transform it into $\begin{array} { r } { \mathcal { D } _ { \mathrm { h i } } ^ { r } = \{ ( s _ { 0 } ^ { i } , z _ { i } , \sum _ { t = 0 } ^ { c - 1 } \gamma ^ { i } r _ { t } ^ { i } , s _ { c } ) _ { i = 1 } ^ { N } \} } \end{array}$ . The task policy $\pi _ { \psi }$ is trained on $\mathcal { D } _ { \mathrm { h i } } ^ { r }$ using Conservative Q Learning (CQL) (Kumar et al., 2020b). Since the primitive policy $\pi _ { \theta }$ is trained after $p _ { \phi , \omega } ( z | \tau )$ is fully trained, it doesn’t need any additional finetuning.
+
+# F.1 RESULTS
+
+Using the hyperparameters from Nachum et al. (2018a), we used $c = 1 0$ . We experimented with different values of $k = 5 , 1 0 , 2 0$ and found that $k = 1 0 , 2 0$ works the best (see Table 6 for more details). We went with $k = 1 0$ as our final model since it’s simpler. Offline CARML effectively uses only 6 skills as the other 4 skills had $p _ { \omega } ( z ) = 0$ . Offline DADS uses all the skills. The results are described in Table 7. In addition to calculating the average success rate, we also calculate the average cumulative dense rewards for entire trajectory and the average cumulative dense rewards for the last 5 time steps. Here, the dense reward is negative $l _ { 2 }$ distance to the goal. The resulting trajectory clusters (using a subset of the dataset) from discrete skills are also visualized in Figure 4 where different colors represent different clusters.
+
+Table 6: Average success rate on antmaze medium (diverse) $( \% )$ (over 4 seeds) of CQL combined with offline DADS and offline CARML for different values of $k$ .
+
+
Models
k=5
k=10
k=20
CQL+Offline DADS
31.4± 5.7
59.1 ± 3.1
59.6± 2.9
CQL+Offline CARML
13.3 ± 4.7
15.1 ± 2.6
14.9 ± 3.8
+
+Table 7: Average success rate $( \% )$ , cumulative dense reward, and cumulative dense reward (last 5 steps) (over 4 seeds) of CQL combined with different offline skill discovery methods on antmaze medium (diverse). For $\mathrm { C Q L + }$ (Offline) DADS and $\mathrm { C Q L + }$ (Offline) CARML, we use $k = 1 0$ . Note that $\mathrm { C Q L + O P A L }$ outperforms both other methods for unsupervised skill discovery on all of these different evaluation metrics.
+
+
Environment
CQL
CQL+OPAL
CQL+ DADS
CQL+ CARML
successrate
53.7 ± 6.1
81.1 ± 3.1
59.1 ± 3.1
15.1 ± 2.6
cumulativedense reward
-12138.6 ± 720.3
-7795.7 ± 535.4
-11184.7 ± 610.1
-13387.3 ± 710
cumulative densereward (last 5 steps)
-45.1 ± 9.2
-7.8 ± 4.6
-33.1 ± 8.1
-51.6 ± 5.6
+
+Since offline CARML treats the states in the trajectory conditionally independent of each other given $z$ , the clustering mainly focuses on the spatial location. Therefore, offline CARML isn’t able to separate out different control modes starting around the same spatial locations which explains its poor performance when combined with CQL. As we can see from Figure 5, offline CARML is able to make progress towards the goal, but gets stuck along the way due to poor separation of control modes. On the other hand, offline DADS treats the state transitions in the trajectory conditionally independent of each other given $z$ and thus clusters trajectories with similar state transitions together. This allows it to more effectively separate out the control modes. Therefore, CQL $^ +$ offline DADS slightly improves upon CQL but is still limited by discrete number of skills. Furthermore, increasing the number of skills from 10 to 20 gives similar performance. Moreover, in these methods, it’s intractable to use continuous skill space since we use Bayes rule to calculate $p _ { \phi , \omega } ( z | \tau )$ . Therefore, we decided to switch to learning a $\beta$ -VAE (Higgins et al., 2016) style generative model with continuous skill space i.e. OPAL.
+
+
+Figure 4: Visualization of (a subset of) dataset trajectories colored according to their assigned cluster using (a) Offline DADS and (b) Offline CARML. We use $k = 1 0$ .
+
+
+Figure 5: State visitation heatmaps for antmaze medium policies learned using (1) CQL, (2) $\mathrm { C Q L + O P A L }$ , (2) $\mathrm { C Q L + O }$ ffline DADS and (4) $\mathrm { C Q L + O }$ ffline CARML. Note that while offline CARML and offline DADS get stuck at various corners of the maze, OPAL is able to find its path through the maze to the goal location on the top right.
+
+# F.2 TRAINING DETAILS
+
+For clustering by optimizing equation 72, both offline CARML and offline DADS only considers the global $\mathbf { X }$ -y pose of the ant and ignores other dimensions of the state space. These methods fail to work when considering the full state space.
+
+Offline CARML $p _ { \phi } ( s | z )$ takes in the latent one-hot vector $z$ and passes it through a fully connected network with 2 hidden layers of size $H = 2 0 0$ and ReLU activation. It then projects the output of the hidden layers to mean and log standard deviation of the reduced state $s$ (only global $\mathbf { X } ^ { \prime }$ -y pose considered) through linear layers.
+
+Offline DADS $p _ { \phi } ( s _ { t } | s _ { t - 1 } , z )$ has the same architecture as $p _ { \phi } ( s | z )$ but also takes in the reduced state from the previous timestep.
+
+Primitive Policy The primitive policy $\pi _ { \boldsymbol { \theta } } ( a | s , z )$ takes in the current state $s$ and latent one-hot vector $z$ and passes it through a fully connected network with 2 hidden layers of size $H = 2 0 0$ and ReLU activation. It then projects the output of the hidden layers to mean and log standard deviation of action through linear layers.
+
+We perform the clustering for 25 epochs with a fixed learning rate of $1 e \mathrm { ~ - ~ } 3$ , Adam optimizer (Kingma & Ba, 2014) and a batch size of 50 using the Algorithm 2 from Jabri et al. (2019).
+
+Task Policy For task policy $\pi _ { \psi } ( s )$ , we used a fully connected network with 3 hidden layers of size 256 and ReLU activation. It then projects the output of the hidden layers to the logits (corresponding to the components of discrete latent space) through linear layers.
+
+CQL Hyperparameters We used the standard hyperparameters for $\operatorname { C Q L } ( { \mathcal { H } } )$ with discrete action space, as mentioned in Kumar et al. (2020b).
\ No newline at end of file
diff --git a/md/train/VqzVhqxkjH1/VqzVhqxkjH1.md b/md/train/VqzVhqxkjH1/VqzVhqxkjH1.md
new file mode 100644
index 0000000000000000000000000000000000000000..9a56306766a5fb3897c4682b4fb86b0d08f9ae5b
--- /dev/null
+++ b/md/train/VqzVhqxkjH1/VqzVhqxkjH1.md
@@ -0,0 +1,403 @@
+# DEEP NEURAL NETWORK FINGERPRINTING BYCONFERRABLE ADVERSARIAL EXAMPLES
+
+Nils Lukas, Yuxuan Zhang, Florian Kerschbaum
+University of Waterloo
+{nlukas, y2536zhang, florian.kerschbaum}@uwaterloo.ca
+
+# ABSTRACT
+
+In Machine Learning as a Service, a provider trains a deep neural network and gives many users access. The hosted (source) model is susceptible to model stealing attacks, where an adversary derives a surrogate model from API access to the source model. For post hoc detection of such attacks, the provider needs a robust method to determine whether a suspect model is a surrogate of their model. We propose a fingerprinting method for deep neural network classifiers that extracts a set of inputs from the source model so that only surrogates agree with the source model on the classification of such inputs. These inputs are a subclass of transferable adversarial examples which we call conferrable adversarial examples that exclusively transfer with a target label from a source model to its surrogates. We propose a new method to generate these conferrable adversarial examples. We present an extensive study on the irremovability of our fingerprint against finetuning, weight pruning, retraining, retraining with different architectures, three model extraction attacks from related work, transfer learning, adversarial training, and two new adaptive attacks. Our fingerprint is robust against distillation, related model extraction attacks, and even transfer learning when the attacker has no access to the model provider’s dataset. Our fingerprint is the first method that reaches a ROC AUC of 1.0 in verifying surrogates, compared to a ROC AUC of 0.63 by previous fingerprints.
+
+# 1 INTRODUCTION
+
+Deep neural network (DNN) classifiers have become indispensable tools for addressing practically relevant problems, such as autonomous driving (Tian et al., 2018), natural language processing (Young et al., 2018) and health care predictions (Esteva et al., 2019). While a DNN provides substantial utility, training a DNN is costly because of data preparation (collection, organization, and cleaning) and computational resources required for validation of a model (Press, 2016). For this reason,
+
+
+Figure 1: A set of conferrable adversarial examples used as a fingerprint to identify surrogate models.
+
+DNNs are often provided by a single entity and consumed by many, such as in the context of Machine Learning as a Service (MLaaS). A threat to the provider is model stealing, in which an adversary derives a surrogate model from only API access to a source model. We refer to an independently trained model for the same task as a reference model.
+
+Consider a MLaaS provider that wants to protect their service and hence restrict its redistribution, e.g., through a contractual usage agreement because trained models constitute their intellectual property. A threat to the model provider is an attacker who derives surrogate models and publicly deploys them. Since access to the source model has to be provided, users cannot be prevented from deriving surrogate models. Krishna et al. (2019) have shown that model stealing is (i) effective, because even high-fidelity surrogates of large models like BERT can be stolen, and (ii) efficient, because surrogate models can be derived for a fraction of the costs with limited access to domain data.
+
+This paper proposes a DNN fingerprinting method to predict whether a model is a (stolen) surrogate or a (benign) reference model relative to a source model. DNN fingerprinting is a new area of research that extracts a persistent, identifying code (fingerprint) from an already trained model. Model stealing can be categorized into model modification, such as weight pruning (Zhu & Gupta, 2017), or model extraction that uses some form of knowledge distillation (Hinton et al., 2015) to derive a surrogate from scratch. Claimed security properties of existing defenses ((Adi et al., 2018; Zhang et al., 2018)), have been broken by model extraction attacks (Shafieinejad et al., 2019). Our fingerprinting method is the first passive defense that is specifically designed towards withstanding model extraction attacks, which extends to robustness against model modification attacks.
+
+Our research provides new insight into the transferability of adversarial examples. In this paper, we hypothesize that there exists a subclass of targeted, transferable, adversarial examples that transfer exclusively to surrogate models, but not to reference models. We call this subclass conferrable. Any conferrable example found in the source model should have the same misclassification in a surrogate model, but a different one in reference models. We propose a metric to measure conferrability and an ensemble adversarial attack that optimizes this new metric. We generate conferrable examples as the source model’s fingerprint.
+
+Retrained CIFAR-10 surrogate models can be verified with a perfect ROC AUC of 1.0 using our fingerprint, compared to an ROC AUC of 0.63 for related work (Cao et al., 2019). While our fingerprinting scheme is robust to almost all derivation and extraction attacks, we show that some adapted attacks may remove our fingerprint. Specifically, our fingerprint is not robust to transfer learning when the attacker has access to a model pre-trained on ImageNet32 and access to CIFAR-10 domain data. Our fingerprint is also not robust against adversarial training (Madry et al., 2017) from scratch. Adversarial training is an adapted model extraction attack specifically designed to limit the transferability of adversarial examples. We hypothesize that incorporating adversarial training into the generation process of conferrable adversarial examples may lead to higher robustness against this attack.
+
+# 2 RELATED WORK
+
+In black-box adversarial attacks (Papernot et al., 2017; Tramer et al., 2016; Madry et al., 2017), \` access to the target model is limited, meaning that the target architecture is unknown and computing gradients directly is not possible. Transfer-based adversarial attacks (Papernot et al., 2016; 2017) exploit the ability of an adversarial example to transfer across models with similar decision boundaries. Targeted transferability additionally specifies the target class of the adversarial example. Our proposed adversarial attack is a targeted, transfer-based attack with white-box access to a source model (that should be defended), but black-box access to the stolen model derived by the attacker.
+
+Liu et al. (2016) and Tramer et al. (2017a) show that (targeted) transferability can be boosted by \` optimizing over an ensemble of models. Our attack also optimizes over an ensemble of models to maximize transferability to stolen surrogate models, while minimizing transferability to independently trained models, called reference models. We refer to this special subclass of targeted transferability as conferrable. Tramer et al. (2017a) empirically study transferability and find that \` transferable adversarial examples are located in the intersection of high-dimensional ”adversarial subspaces” across models. We further their studies and show that (i) stolen models apprehend adversarial vulnerabilities from the source model and (ii) parts of these subspaces, in which conferrable examples are located, can be used in practice to predict whether a model has been stolen.
+
+Watermarking of DNNs is a related method to DNN fingerprinting where an identifying code is embedded into a DNN, thereby potentially impacting the model’s utility. Uchida et al. (2017) embed a secret message into the source model’s weight parameters, but require white-box access to the model’s parameters for the watermark verification. Adi et al. (2018) and Zhang et al. (2018) propose backdooring the source model on a set of unrelated or slightly modified images. Their approaches allow black-box verification that only requires API access to the watermarked model. Frontier-Stitching (Merrer et al., 2017) and BlackMarks (Dong et al., 2018) use (targeted) adversarial examples as watermarks. These watermarks have been evaluated only against model modification attacks, but not against model extraction attacks that train a surrogate model from scratch. At least two of these watermarking schemes (Adi et al., 2018; Zhang et al., 2018) are not robust to model extraction attacks (Shafieinejad et al., 2019). Cao et al. (2019) recently proposed a fingerprinting method with adversarial examples close to the source model’s decision boundary. We show that their fingerprint does not withstand retraining as a model extraction attack and propose a fingerprint with improved robustness to model extraction attacks.
+
+# 3 DNN FINGERPRINTING
+
+Threat Model. The attacker’s goal is to derive a surrogate model from access to the defender’s source model that (i) has a similar performance (measured by test accuracy) and (ii) is not verified as a surrogate of the source model by the defender. We protect against an informed attacker that can have (i) white-box access to the source model, (ii) unbounded computational capacity and (iii) access to domain data from the same distribution. A more informed attacker can drop information and invoke all attacks of a less informed attacker. Robustness against a more informed attacker implies robustness against a less informed attacker. Our attacker is limited in their access to groundtruth labeled data, otherwise they could train their own model and there would be no need to steal a model. In our evaluation, we experiment with attackers that have up to $80 \%$ of ground-truth labels for CIFAR-10 (Krizhevsky et al.). A practical explanation for the limited accessibility of ground truth labels could be that attackers do not have access to a reliable oracle (e.g., for medical applications), or acquiring labels may be associated with high expenses (e.g., Amazon Mechanical Turk1).
+
+The defender’s goal is to identify stolen surrogate models that are remotely deployed by the attacker. Their capabilities are (i) white-box access to the source model, (ii) black-box access to the target model deployed by the attacker and (iii) a limited set of $n$ queries to verify a remotely deployed surrogate model. Black-box access to the suspect model excludes knowledge of the suspect model’s architecture or attack used to distill the model. The defender also does not have knowledge of, nor control over the attacker’s dataset used to steal the model.
+
+Fingerprinting Definitions. A fingerprinting method for DNNs consists of two algorithms: (i) A fingerprint generation algorithm that generates a secret fingerprint ${ \mathcal { F } } \subseteq { \mathcal { X } } ^ { n }$ of size $n$ , and a fingerprint verification key $\mathcal { F } _ { y } \subseteq \mathcal { V } ^ { n }$ ; (ii) A fingerprint verification algorithm that verifies surrogates of the source model. These algorithms can be summarized as follows.
+
+• Generate $( M , D )$ : Given white-box access to a source model $M$ and training data $D \in \mathcal { D }$ . Outputs a fingerprint $\mathcal { F }$ and the verification keys $\mathcal { F } _ { y } = \{ M ( x ) | x \in \mathcal { F } \}$ . • Verify $( \hat { M } ( \mathcal { F } ) , \mathcal { F } _ { y } )$ : Given black-box access to a suspect model $\hat { M }$ , a fingerprint $\mathcal { F }$ and a verification key $\mathcal { F } _ { y }$ . Outputs 1 if $\hat { M }$ is verified by the fingerprint and 0 otherwise.
+
+The verification algorithm computes an error rate between the outputs of the source and target model on the fingerprint. We empirically measure the error rate separately for surrogate and reference models, which allows to choose a decision threshold $\rho \in [ 0 , 1 ]$ . If the error-rate of a target model exceeds $1 - \rho$ , the verification predicts the target model to be a reference model, otherwise the prediction is a surrogate model. We define that a fingerprint must be irremovable, i.e., surrogate and reference models are correctly verified, despite an attacker’s removal attempt. It must also be non-evasive, meaning that an attacker cannot evade black-box verification by detecting fingerprint queries. We refer to Appendix A.3 for security games of DNN fingerprinting.
+
+# 4 CONFERRABLE ADVERSARIAL EXAMPLES
+
+Motivating Conferrability Conferrability is a new property for adversarial examples, in which targeted transferability occurs only from a source model to its surrogates, but not to independently trained reference models. Intuitively, surrogate models are expected to be more similar to the source model than any reference model, but quantifying this similarity is non-trivial. Conferrable examples are an attempt to quantify this similarity by shared adversarial vulnerabilities of the source model and its surrogates. Surrogate models differ from reference models in the objective function which they optimize. Reference models maximize fidelity to the ground truth labels, whereas surrogate models maximize fidelity to the source model’s labels, which do not always coincide.
+
+
+Figure 2: (a) A summary of the relationship between transferability and conferrability as intersections between the set of all adversarial examples per model type. (b) A representation of transferable and conferrable examples in the decision space, relative to the ground-truth provided by an oracle.
+
+Fig. 2a shows the relation between targeted adversarial, transferable, and conferrable examples for the source model, its surrogates, and all reference models. An example is transferable if it is adversarial to any model. It is conferrable when it is adversarial only to surrogate and source models. In that sense, conferrable adversarial examples are a subclass of targeted transferable adversarial examples. Fig. 2b shows the relation between transferable and conferrable adversarial examples in the decision space, simplified for illustrative purposes to binary classification. Transferable adversarial examples occur in those adversarial subspaces where the decision boundary of surrogate and reference models coincide (Tramer et al., 2017b). Conferrable adversarial examples occur in those \` adversarial subspaces where the decision boundary of surrogate and reference models differ.
+
+Targeted transferability for a class $t$ and a set of models $\mathcal { M }$ can be computed as follows.
+
+$$
+\mathrm { T r a n s f e r } ( \mathcal { M } , x ; t ) = \mathit { P r } _ { \mathit { M } \in \mathcal { M } } [ M ( x ) = t ]
+$$
+
+Objective We want to find adversarial examples that maximize the output activation difference between surrogate models $s$ and reference models $\mathcal { R }$ . This difference is quantified by our conferrability score, which measures the example’s transferability to surrogate and reference models.
+
+$$
+\mathrm { C o n f e r } ( \mathcal { S } , \mathcal { R } , x ; t ) = \mathrm { T r a n s f e r } ( \mathcal { S } , x ; t ) ( 1 - \mathrm { T r a n s f e r } ( \mathcal { R } , x ; t ) )
+$$
+
+The central challenge for optimizing conferrability directly is that we require access to a differentiable function Transfer that estimates an example’s transferability score. To the best of our knowledge, the only known method to evaluate transferability is to train a representative set of DNNs and estimating the example’s transferability itself. We use this method to evaluate transferability. In the case of conferrable examples, we evaluate transferability on a set of surrogate and reference models trained locally by the defender and use Equation 2 to obtain the conferrability score. Our hypothesis is that conferrability generalizes, i.e., examples that are conferrable to a representative set of surrogate and reference DNNs are also conferrable to other, unseen DNNs.
+
+Conferrable Ensemble Method. In this section, we describe our adversarial attack that generates conferrable adversarial examples, called the Conferrable Ensemble Method (CEM). CEM operates on the source model $M$ , a set of its surrogates $\boldsymbol { \mathcal { S } } _ { M }$ , and a set of reference models $\mathcal { R }$ . The attack constructs an ensemble model $M _ { E }$ with a single shared input that outputs conferrability scores for all output classes $y \in \mathcal { V }$ . CEM generates highly conferrable adversarial examples by finding a perturbation $\delta$ so that $x ^ { \prime } = x _ { 0 } + \delta$ maximizes the output of the ensemble model for a target class $t$ .
+
+We now present the construction of the ensemble model $M _ { E }$ . The ensemble model produces two intermediate outputs for an input $x \in \mathcal { X }$ , representing the average predictions of all surrogate and all reference models on $x$ . We use Dropout (Srivastava et al., 2014) with a drop ratio of $d = 0 . 3$
+
+$$
+\begin{array} { c } { \displaystyle \mathrm { S u r r } ( \mathcal S _ { M } , x ) = \frac 1 { | \mathcal S _ { M } | } \sum _ { S \in \mathcal S _ { M } } \mathrm { D r o p o u t } ( S ( x ) ; d ) } \\ { \displaystyle \mathrm { R e f } ( \mathcal R , x ) = \frac 1 { | \mathcal R | } \sum _ { R \in \mathcal R } \mathrm { D r o p o u t } ( R ( x ) ; d ) } \end{array}
+$$
+
+The output of the ensemble model is the conferrability score of the input for each class. The Softmax activation function is denoted by $\sigma$ . We refer to Appendix A.4 for details about the optimization.
+
+$$
+M _ { E } ( x ; \mathcal { S } _ { M } , \mathcal { R } ) = \sigma ( \mathrm { S u r r } ( \mathcal { S } _ { M } , x ) ( { \bf 1 } - \mathrm { R e f } ( \mathcal { R } , x ) ) )
+$$
+
+The loss function consists of three summands and is computed over the benign, initial example $x _ { 0 }$ , and the example at an intermediate iteration step $x ^ { \prime } = { x _ { 0 } } + \delta$ . We denote the cross-entropy loss by $H ( \cdot , \cdot )$ . The first summand function maximizes the output of the ensemble model for some target class $t$ . The second summand maximizes the categorical cross-entropy between the current and initial prediction for the source model. The third summand minimizes the categorical cross-entropy between the source model’s prediction and the predictions of its surrogates. The total loss $\mathcal { L }$ is the weighted sum over all individual losses.
+
+$$
+\mathcal { L } ( x _ { 0 } , x ^ { \prime } ) = \alpha H ( 1 , \operatorname* { m a x } _ { t } [ M _ { E } ( x ^ { \prime } ) _ { t } ] ) - \beta H ( M ( x _ { 0 } ) , M ( x ^ { \prime } ) ) + \gamma H ( M ( x ^ { \prime } ) , \mathrm { S u r r } ( \mathcal { S } _ { M } , x ^ { \prime } ) )
+$$
+
+In all our experiments, we use weights $\alpha = \beta = \gamma = 1$ and refer to Appendix A.6 for an empirical sensitivity analysis of the hyperparameters. We address the box constraint, i.e., $| | \delta | | \leq \epsilon$ , similarly to PGD (Madry et al., 2017) by clipping intermediate outputs around the $\epsilon$ ball of the original input $x _ { 0 }$ . For the optimization of an input with respect to the loss we use the Adam optimizer (Kingma $\&$ Ba, 2014). Note that we use an untargeted attack to generate targeted adversarial examples. Targeted attacks are harder to optimize than their untargeted counterparts (Wu & Fu, 2019). We assign the source model’s predicted label for the generated adversarial example as the target label and ensure that target classes are balanced in the fingerprint verification key.
+
+Fingerprinting Algorithms. We now describe our fingerprinting generation and verification algorithms. For the generation, the defender locally trains a set of $c _ { 1 }$ surrogate and $c _ { 2 }$ reference models $( c _ { 1 } = c _ { 2 } = 1 8 )$ on their training data prior to executing CEM. Surrogate models are trained on data labeled by the source model, whereas reference models are trained on ground-truth labels. The defender composes the ensemble model $M _ { E }$ as described in the previous paragraph and optimizes for a perturbation $\delta$ given an input $x _ { 0 }$ , so that $\mathcal { L } ( x _ { 0 } , x _ { 0 } + \delta )$ is minimized. The optimization returns a set of adversarial examples that are filtered by their conferrability scores on the locally trained models. If their conferrability score (see Equation 2) exceeds a minimum threshold $\mathit { \tau } _ { \tau } \geq 0 . 9 5 )$ , they are added to the fingerprint. For the fingerprint verification, we compute the error rate between the source model’s prediction on the fingerprint and a target model’s predictions. If the error rate is greater than $1 - \rho$ , which we refer to as the decision threshold, the target model is predicted to be a reference model and a surrogate model otherwise.
+
+# 5 EXPERIMENTAL SETUP
+
+Experimental Procedure. We evaluate the irremovability and non-evasiveness of our fingerprint. We show that our proposed adversarial attack CEM improves upon the mean conferrability scores compared to other adversarial attacks, such as FGM (Goodfellow et al., 2014), BIM (Kurakin et al., 2016), PGD (Madry et al., 2017), and CW- $L _ { \infty }$ (Carlini & Wagner, 2017b). We demonstrate the nonevasiveness of our fingerprint by evaluating against the evasion algorithm proposed by Hitaj et al. (2019). Our study on irremovability is the most extensive study conducted on DNN fingerprints or DNN watermarks compared to related work (Cao et al., 2019; Uchida et al., 2017; Zhang et al., 2018; Adi et al., 2018; Merrer et al., 2017; Dong et al., 2018; Szyller et al., 2019). We compare our DNN fingerprinting to another proposed DNN fingerprint called IPGuard (Cao et al., 2019). We refer to Appendix A.1 for more details on the CIFAR-10 experiments and to Appendix A.2 for results on ImageNet32.
+
+Evaluation Metrics. We measure the fingerprint retention as the success rate of conferrable examples in a target model $\hat { M }$ . An example is successful if the target model predicts the target label given in $\mathcal { F } _ { y }$ . We refer to this metric as the Conferrable Adversarial Example Accuracy (CAEAcc).
+
+Table 1: Experimentally derived values for the decision threshold $\theta _ { \epsilon }$ for CIFAR-10.
+
+
E
0.01
0.025
0.05
0.075
0.1
0.125
0.15
0
63.00%
75.00%
84.00%
86.00%
87.00%
87.00%
87.00%
+
+$$
+\mathbf { C A E A c c } ( \hat { M } ( \mathcal { F } ) , \mathcal { F } _ { y } ) = \underset { ( y , y ^ { * } ) \in \hat { M } ( \mathcal { F } ) , \mathcal { F } _ { y } } { P r } [ \mathbf { 1 } _ { \mathrm { y } = \mathbf { y } ^ { * } } ]
+$$
+
+CIFAR-10 models. We train popular CNN architectures on CIFAR-10 without any modification to the standard training process2. The defender’s source model has a ResNet20 (He et al., 2016) architecture. All surrogate and reference models required by the defender for CEM are ResNet20 models trained on CIFAR-10 using retraining. The attacker has access to various model architectures, such as DenseNet (Iandola et al., 2014), VGG-16/VGG-19 (Simonyan & Zisserman, 2014) and ResNet20 (He et al., 2016), to show that conferrability is maintained across model architectures.
+
+Removal Attacks. Removal attacks are successful if (i) the surrogate model has a high test accuracy (at least $8 5 . 5 5 \%$ for CIFAR-10, see Fig. 4e) and (ii) the stolen surrogate’s CAEAcc is lower than the verification threshold $\rho$ . Stolen models are derived with a wide range of fingerprint removal attacks, which we categorize into (i) model modification, (ii) model extraction and (iii) adapted model extraction attacks. Model modification attacks modify the source model directly, such as fine-tuning or parameter pruning. Model extraction distills knowledge from a source model into a fresh surrogate model, such as retraining or model extraction attacks from related work (Papernot et al., 2017; Jagielski et al., 2019; Orekondy et al., 2019). A defense against model extraction attacks is to restrict the source model’s output to the top-1 predicted label. We refer to an extraction attack that retrains on the top-1 predicted label by the source model as Black-Box attack. We also evaluate transfer learning as a model extraction attack, where a pre-trained model from a different domain (ImageNet32) is transfer learned onto the source model’s domain using the source model’s labels.
+
+Adapted model extraction attacks limit the transferability of adversarial examples in the surrogate model, such as adversarial training (Madry et al., 2017). In our experiment, we use multi-step adversarial training with PGD. We design another adapted attacks against our fingerprint called the Ground-Truth attack, where the attacker has a fraction of $p \in [ 0 . 6 , 0 . 7 , 0 . 8 ]$ ground-truth labels. We trained surrogate models with Differential Privacy (DP), using DP-SGD (Abadi et al., 2016), but even for large $\epsilon$ the surrogate models had unacceptably low CIFAR-10 test accuracy of about $7 6 \%$ . The test accuracies of all surrogate models can be seen in Table 2. We repeat all removal attacks three times and report the mean values and the standard deviation as error bars. Our empirically chosen CIFAR-10 decision thresholds $\theta _ { \epsilon }$ (see Table 1) are chosen relative to the perturbation threshold $\epsilon$ with which our adversarial attacks are instantiated.
+
+Evasiveness Attack. Hitaj et al. (2019) present an evasion attack against black-box watermark verification. Their evasion attack trains a binary DNN classifier to distinguish between benign and out-of-distribution images and reject queries by the defender. Our attacker trains a binary classifier to classify benign images and adversarial examples generated by FGM, CW- $L _ { \infty }$ , and PGD adversarial attacks. The evasion attack is evaluated by the area under the curve (AUC) of the receiver operating characteristic (ROC) curve for varying perturbation thresholds.
+
+Attacker Datasets. We distinguish between attackers with access to different datasets, which are CIFAR-10 (Krizhevsky et al.), CINIC (Darlow et al., 2018) and ImageNet32 (Chrabaszcz et al., 2017). CINIC is an extension of CIFAR-10 with downsampled images from ImageNet (Deng et al., 2009), for classes that are also defined in CIFAR-10. ImageNet32 is a downsampled version of images from all classes defined in ImageNet, i.e., ImageNet32 is most dissimilar to CIFAR-10. We observe that the similarity of the attacker’s to the defender’s dataset positively correlates with the surrogate model’s test accuracy and thus boosts the effectiveness of the model stealing attack.
+
+
+Figure 3: Results for the (a) conferrability scores, (b) non-evasiveness and (c-d) irremovability to model modification attacks. Figures (e,f) show results against model extraction attacks.
+
+# 6 EMPIRICAL RESULTS
+
+Conferrability Scores. Our empirical results show support in favor of the existence of conferrable adversarial examples. CEM produces adversarial example with the highest conferrability scores compared to classical adversarial attacks such as FGM, PGD and CW- $L _ { \infty }$ . We generate $n = 1 0 0$ adversarial examples from the same set of CIFAR-10 test samples, filter those that are non-successful to the source model and evaluate conferrability scores as specified by Equation 2 across five unseen CIFAR-10 surrogate and reference models trained from scratch. The results in Fig. 3a show that CEM outputs adversarial examples with significantly higher conferrability scores than other attacks for small perturbation thresholds $\epsilon$ , which worsen as $\epsilon$ increases. For $\epsilon = 0 . 0 1$ we measure a mean conferrability score of 0.49, which amounts to a mean CAEAcc of 0.42 in reference models and 0.85 in surrogate models (see Fig. 3d). For $\epsilon = 0 . 1 5$ we measure a conferrability score of only 0.24, which translates to a mean CAEAcc of 0.98 in surrogate models and 0.75 in reference models. These results show that with increasing $\epsilon$ , the transferability of generated adversarial examples improves at the expense of lower conferrability. We observed that the conferrability scores measured on surrogate and reference models used in CEM are nearly perfect. This indicates that CEM could benefit from access to an even larger ensemble of models.
+
+Non-Evasiveness. We evaluate non-evasiveness against the attack proposed by Hitaj et al. (2019). The results in Fig. 3b show that (i) detectability increases with larger perturbation thresholds $\epsilon$ and (ii) for small perturbation thresholds $\epsilon \leq 0 . 0 2 5$ we measure a ROC AUC of only 0.67. This method of detection is too unreliable for the attacker to deploy in practice considering that only a fraction of requests would contain the fingerprint. Sufficiently high recall against our fingerprint comes at the cost of more false positives, which diminishes the utility of the attacker’s model to other users.
+
+Model Modification Attacks. Fig. 3c and 3d show that our fingerprint is robust against model modification attacks. We show irremovability against four different types of fine-tuning attacks tried by Uchida et al. (2017), which are implemented as follows.
+
+1. Fine-Tune Last Layer (FTLL): Freezes all layers except for the penultimate layer.
+
+2. Fine-Tune All Layers (FTAL): Fine-tuning of all layers.
+
+
+Figure 4: Fig. (a-d) show the robustness of our fingerprint against (adapted) model extraction attacks. Fig. (e) shows the test accuracy in relation to the CAEAcc for surrogate and reference models during training. Fig. (f) shows the ROC curve of our fingerprint compared to IPGuard (Cao et al., 2019).
+
+3. Retrain Last Layer (RTLL): Re-initializes the penultimate layer’s weights and updates only the penultimate layer, while all other layers are frozen.
+4. Retrain All Layers (RTAL): Re-initializes the penultimate layer’s weights, but all layers are updated during fine-tuning.
+
+Our results for iterative weight pruning (Zhu & Gupta, 2017) show that larger pruning rates $p \in [ 0 . 7 , 0 . 8 , 0 . 9 ]$ have greater impact on the CAEAcc, but the surrogate test accuracy also deteriorates significantly (see Table 2). Note that we show robustness to much higher pruning rates than related work (Cao et al., 2019). The attack for $p = 0 . 9$ is unsuccessful because the surrogate test accuracy is lower than $8 5 . 5 5 \%$ , as described in Section 5. For all remaining pruning configurations the fingerprint is not removable.
+
+Model Extraction Attacks. Fig. 3 and 4 show that our fingerprint is robust to model extraction attacks, except for transfer learning when the attacker has CIFAR-10 data. Surprisingly, we find that surrogates extracted using CINIC have higher mean CAEAcc values than CIFAR-10 surrogates at a lower test accuracy $( - 2 . 1 6 \% )$ . Similarly, we measure significantly lower CAEAcc values for reference models trained on CINIC compared to reference models trained on CIFAR-10. This means that it is increasingly difficult for the attacker to remove our fingerprint the more dissimilar the attacker’s and defender’s datasets become. In Fig. 3f, we show that our fingerprint is not removable even across different surrogate model architectures. Fig. 4b shows that transfer learning removes our fingerprint when the attacker has access to the defender’s dataset, but our fingerprint is not removable when the attacker only has access to CINIC data. We observed that the pre-trained ImageNet32 model exceeds $80 \%$ test accuracy after only a single epoch with CIFAR-10, which may be too few updates for our fingerprint to transfer to the surrogate. The irremovability of our fingerprint to a wide range of model extraction attacks shows that certain adversarial vulnerabilities (that enable conferrable examples) are consistently carried over from the source model to its surrogates. Our data supports that the class of transferable examples can be broken down further into conferrable examples and that known findings for transferable examples extend to conferrable examples.
+
+Adapted Model Extraction Attacks. We now show limitations of our fingerprint against defenses that specifically limit the transferability of adversarial examples. Fig. 4c shows that adversarial
+
+
Fine-Tuning
Pruning
Source
FTLL
FTAL
RTLL
RTAL
p=0.7
p=0.8
p=0.9
89.30
89.59
89.57
87.90
87.25
88.00
86.97
83.36
Retrain
Extraction
ResNet20
Densenet
VGG16
VGG19
CINIC
Jagielski
Papernot
Knockoff
89.22
90.88
90.91
90.05
87.06
88.74
87.34
84.55
AdvTrain
rain
Transfer Learning
Ground-Truth
CIFAR-10
CINIC
CIFAR-10
CINIC
p=0.5
p=0.6
p=0.7
p=0.8
89.75
88.15
89.59
88.15
89.54
89.13
89.43
89.33
+
+Table 2: Mean CIFAR-10 test accuracies for surrogate models obtained by running the attacks with threefold repetition. Unless stated otherwise, all surrogates are trained on CIFAR-10 images.
+
+training from scratch removes our fingerprint. In CIFAR-10 surrogates, we measure a mean CAEAcc of only $1 5 \%$ for $\epsilon = 0 . 0 2 5$ , which supports the claims by Madry et al. (2017) that adversarial training increases robustness to transfer attacks. We hypothesize that incorporating adversarial training into the generation process of conferrable adversarial examples leads to higher robustness against this removal attack. The results from our Ground-Truth attack shown in Fig. 4d show that access to more ground-truth labels decreases the CAEAcc in surrogate models. The results show that our fingerprint is not removable for attackers with up to $5 0 \%$ ground-truth labels for CIFAR-10.
+
+Confidence Analysis. In Fig. 4f we show the ROC curve (false positive vs true positive rate) of our fingerprint verification on ten unseen, retrained CIFAR-10 surrogate and reference models. We compare our work with IPGuard (Cao et al., 2019) and generate $n = 1 0 0$ fingerprints in both cases. Our ROC AUC is 1.0, whereas IPGuard has a ROC AUC of only 0.63. These results show that IPGuard is not robust to retraining as a model extraction attack. Inspecting adversarial examples generated by IPGuard further, we measure a mean adversarial success rate of $1 7 . 6 1 \%$ for surrogate and $1 6 . 2 9 \%$ for reference models. For our fingerprint, Fig. 4e visualizes the difference in CAEAcc for well-trained surrogate and reference models at $\epsilon = 0 . 0 2 5$ . The plot shows that CAEAcc positively correlates with the surrogate’s test accuracy. We measure a mean difference in CAEAcc of about $3 0 \%$ between well-trained surrogate and reference models with our fingerprint.
+
+# 7 CONCLUSION
+
+We empirically show the existence of conferrable adversarial examples. Our ensemble adversarial attack CEM outperforms existing adversarial attacks such as FGM (Goodfellow et al., 2014), PGD (Madry et al., 2017) and CW- $L _ { \infty }$ (Carlini & Wagner, 2017b) in producing highly conferrable adversarial examples. We formally define fingerprinting for DNN classifiers and use the generated conferrable adversarial examples as our fingerprint. Our experiments on the robustness of our fingerprint show increased robustness to model modification attacks and model extraction extraction attacks. Transfer learning is a successful removal attack when the attacker has access to CIFAR-10 data, but not when the attacker only has access to CINIC. Adversarial training from scratch is the most effective removal attack and successfully removes our fingerprint. We hypothesize that adding adversarial training into the generation process of conferrable adversarial examples may increase robustness against adversarial training. Our experiments confirm the non-evasiveness of our fingerprint against a detection method proposed by Hitaj et al. (2019). We empirically find that our fingerprint is the first to perfectly verify retrained CIFAR-10 surrogates with a ROC AUC of 1.0.
+
+# 8 ACKNOWLEDGEMENTS
+
+We gratefully acknowledge the support of NSERC for grants RGPIN-05849, CRDPJ-531191, IRC537591, and the Royal Bank of Canada for funding this research.
+
+# REFERENCES
+
+Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 308–318, 2016.
+
+Yossi Adi, Carsten Baum, Moustapha Cisse, Benny Pinkas, and Joseph Keshet. Turning your weakness into a strength: Watermarking deep neural networks by backdooring. In 27th {USENIX} Security Symposium ({USENIX} Security 18), pp. 1615–1631, 2018.
+
+Xiaoyu Cao, Jinyuan Jia, and Neil Zhenqiang Gong. Ipguard: Protecting the intellectual property of deep neural networks via fingerprinting the classification boundary. arXiv preprint arXiv:1910.12903, 2019.
+
+Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14, 2017a.
+
+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, 2017b.
+
+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.
+
+Luke N Darlow, Elliot J Crowley, Antreas Antoniou, and Amos J Storkey. Cinic-10 is not imagenet or cifar-10. arXiv preprint arXiv:1810.03505, 2018.
+
+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.
+
+Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 9185–9193, 2018.
+
+Andre Esteva, Alexandre Robicquet, Bharath Ramsundar, Volodymyr Kuleshov, Mark DePristo, Katherine Chou, Claire Cui, Greg Corrado, Sebastian Thrun, and Jeff Dean. A guide to deep learning in healthcare. Nature medicine, 25(1):24–29, 2019.
+
+Galen Andrew, Steve Chien, and Nicolas Papernot. Tensorflow privacy. 2019. URL https: //github.com/tensorflow/privacy. (accessed July 5, 2020).
+
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
+
+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.
+
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+
+Dorjan Hitaj and Luigi V Mancini. Have you stolen my model? evasion attacks against deep neural network watermarking techniques. arXiv preprint arXiv:1809.00615, 2018.
+
+Dorjan Hitaj, Briland Hitaj, and Luigi V Mancini. Evasion attacks against watermarking techniques found in mlaas systems. In 2019 Sixth International Conference on Software Defined Systems (SDS), pp. 55–63. IEEE, 2019.
+
+Forrest Iandola, Matt Moskewicz, Sergey Karayev, Ross Girshick, Trevor Darrell, and Kurt Keutzer. Densenet: Implementing efficient convnet descriptor pyramids. arXiv preprint arXiv:1404.1869, 2014.
+
+Matthew Jagielski, Nicholas Carlini, David Berthelot, Alex Kurakin, and Nicolas Papernot. Highfidelity extraction of neural network models. arXiv preprint arXiv:1909.01838, 2019.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Kalpesh Krishna, Gaurav Singh Tomar, Ankur P Parikh, Nicolas Papernot, and Mohit Iyyer. Thieves on sesame street! model extraction of bert-based apis. arXiv preprint arXiv:1910.12366, 2019.
+
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 (canadian institute for advanced research). URL http://www.cs.toronto.edu/˜kriz/cifar.html.
+
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
+
+Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
+
+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.
+
+Erwan Le Merrer, Patrick Perez, and Gilles Tredan. Adversarial frontier stitching for remote neural ´ network watermarking. arXiv preprint arXiv:1711.01894, 2017.
+
+Maria-Irina Nicolae, Mathieu Sinn, Minh Ngoc Tran, Ambrish Rawat, Martin Wistuba, Valentina Zantedeschi, Nathalie Baracaldo, Bryant Chen, Heiko Ludwig, Ian M Molloy, et al. Adversarial robustness toolbox v0. 4.0. arXiv preprint arXiv:1807.01069, 2018.
+
+Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Knockoff nets: Stealing functionality of black-box models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4954–4963, 2019.
+
+Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
+
+Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pp. 506–519. ACM, 2017.
+
+Gil Press. Cleaning big data: Most time-consuming, least enjoyable data science task, survey says. 2016. URL https://www.forbes.com/sites/gilpress/2016/03/23/datapreparation-most-time-consuming-least-enjoyable-data-sciencetask-survey-says/. Accessed: 2020-07-05.
+
+Masoumeh Shafieinejad, Jiaqi Wang, Nils Lukas, and Florian Kerschbaum. On the robustness of the backdoor-based watermarking in deep neural networks. arXiv preprint arXiv:1906.07745, 2019.
+
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+
+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.
+
+Sebastian Szyller, Buse Gul Atli, Samuel Marchal, and N Asokan. Dawn: Dynamic adversarial watermarking of neural networks. arXiv preprint arXiv:1906.00830, 2019.
+
+Yuchi Tian, Kexin Pei, Suman Jana, and Baishakhi Ray. Deeptest: Automated testing of deepneural-network-driven autonomous cars. In Proceedings of the 40th international conference on software engineering, pp. 303–314. ACM, 2018.
+
+Florian Tramer, Fan Zhang, Ari Juels, Michael K Reiter, and Thomas Ristenpart. Stealing machine \` learning models via prediction apis. In 25th {USENIX} Security Symposium ({USENIX} Security 16), pp. 601–618, 2016.
+
+Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- \` Daniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017a.
+
+Florian Tramer, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space \` of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017b.
+
+Yusuke Uchida, Yuki Nagai, Shigeyuki Sakazawa, and Shin’ichi Satoh. Embedding watermarks into deep neural networks. In Proceedings of the 2017 ACM on International Conference on Multimedia Retrieval, pp. 269–277. ACM, 2017.
+
+Junde Wu and Rao Fu. Universal, transferable and targeted adversarial attacks. arXiv preprint arXiv:1908.11332, 2019.
+
+Tom Young, Devamanyu Hazarika, Soujanya Poria, and Erik Cambria. Recent trends in deep learning based natural language processing. ieee Computational intelligenCe magazine, 13(3):55–75, 2018.
+
+Jialong Zhang, Zhongshu Gu, Jiyong Jang, Hui Wu, Marc Ph Stoecklin, Heqing Huang, and Ian Molloy. Protecting intellectual property of deep neural networks with watermarking. In Proceedings of the 2018 on Asia Conference on Computer and Communications Security, pp. 159–172, 2018.
+
+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 APPENDIX
+
+# A.1 SUPPLEMENTARY MATERIAL FOR CIFAR-10 EXPERIMENTS
+
+Setup. We train all models on a server running Ubuntu 18.04 in 64-bit mode using four Tesla P100 GPUs and 128 cores of an IBM POWER8 CPU (2.4GHz) with up to 1TB of accessible RAM. The machine learning is implemented in Keras using the Tensorflow $\mathbf { v } 2 . 2$ backend, and datasets are loaded using Tensorflow Dataset3. We re-use implementations of existing adversarial attacks from the Adversarial Robustness Toolbox v1.3.1 (Nicolae et al., 2018). DP-SGD (Abadi et al., 2016) is implemented through Tensorflow Privacy (Galen Andrew, Steve Chien, and Nicolas Papernot, 2019). All remaining attacks and IPGuard (Cao et al., 2019) are re-implemented from scratch.
+
+For the generated adversarial examples using attacks like FGM, PGD and CW- $L _ { \infty }$ , we use the following parametrization. We limit the maximum number of iterations in PGD to 10 and use a stepsize of 0.01. For FGM, we use a step-size of $\epsilon$ and for CW- $L _ { \infty }$ we limit the number of iterations to 50, use a confidence parameter $k = 0 . 5$ , a learning rate of 0.01 and a step-size of 0.01. Fingerprints generated by CEM for CIFAR-10 can be seen in Fig. 5a.
+
+
+Figure 5: Fig. (a) shows conferrable examples generated with CEM on CIFAR-10 with $\epsilon = 0 . 0 2 5$ . Fig. (b) shows conferrable examples generated with CEM on ImageNet32 with $\epsilon = 0 . 1$ .
+
+Analyzing Conferrable Examples. We further examine our fingerprint to find an explanation for the large mean CAE accuracy in all reference models of more than $5 0 \%$ , even though the baseline for random guessing is just $1 0 \%$ . For this, we plot the confusion matrix for our fingerprint at $\epsilon = 0 . 0 2 5$ in Fig. 6.
+
+
+Figure 6: Confusion matrix for our CIFAR-10 fingerprint at $\epsilon = 0 . 0 2 5$ with the initial label on the vertical axis and the target label on the horizontal axis. Depicted values are normalized and represent percentages.
+
+The confusion matrix shows that all classes are represented in the fingerprint and the target class distribution is balanced. We notice a symmetry in the confusion matrix along the diagonal line. A source-target class pair appears more often in our fingerprint if the classes are more similar to each other, e.g. classes ’dog’ and ’cat’ or ’automobile’ and ’truck’. We hypothesize that this partially explains why reference models have large CAE accuracies of over $5 0 \%$ , even though the baseline for random guessing would be at $1 0 \%$ . A reference model is more likely to misclassify the class ’cat’ as the class ’dog’ than any other class, which moves the baseline closer to $5 0 \%$ for many cases. The similarity of the reference model to the source model is another important aspect to explaining the high CAE accuracy in the reference model. Our experiments show that reference models trained on the same dataset are also more likely to share the same adversarial vulnerabilities.
+
+# A.2 EXPERIMENTS ON IMAGENET32
+
+We select images from the following 100 classes of ImageNet32:
+
+’kit fox’, ’Persian cat’, ’gazelle’, ’porcupine’, ’sea lion’, ’killer whale’, ’African elephant’, ’jaguar’, ’otterhound’, ’hyena’, ’sorrel’, ’dalmatian’, ’fox squirrel’, ’tiger’, ’zebra’, ’ram’, ’orangutan’, ’squirrel monkey’, ’komondor’, ’guinea pig’, ’golden retriever’, ’macaque’, ’pug’, ’water buffalo’, ’American black bear’, ’giant panda’, ’armadillo’, ’gibbon’, ’German shepherd’, ’koala’, ’umbrella’, ’soccer ball’, ’starfish’, ’grand piano’, ’laptop’, ’strawberry’, ’airliner’, ’balloon’, ’space shuttle’, ’aircraft carrier’, ’tank’, ’missile’, ’mountain bike’, ’steam locomotive’, ’cab’, ’snowplow’, ’bookcase’, ’toilet seat’, ’pool table’, ’orange’, ’lemon’, ’violin’, ’sax’, ’volcano’, ’coral reef’, ’lakeside’, ’hammer’, ’vulture’, ’hummingbird’, ’flamingo’, ’great white shark’, ’hammerhead’, ’stingray’, ’barracouta’, ’goldfish’, ’American chameleon’, ’green snake’, ’European fire salamander’, ’loudspeaker’, ’microphone’, ’digital clock’, ’sunglass’, ’combination lock’, ’nail’, ’altar’, ’mountain tent’, ’scoreboard’, ’mashed potato’, ’head cabbage’, ’cucumber’, ’plate’, ’necklace’, ’sandal’, ’ski mask’, ’teddy’, ’golf ball’, ’red wine’, ’sunscreen’, ’beer glass’, ’cup’, ’traffic light’, ’lipstick’, ’hotdog’, ’toilet tissue’, ’cassette’, ’lotion’, ’barrel’, ’basketball’, ’barbell’, ’pole’
+
+We train a ResNet20 source model and locally retrain $c _ { 1 } = 1 4$ surrogate and $c _ { 2 } = 1 5$ reference models. In contrast to the experiments on CIFAR-10, we allow the defender access to various model architectures, such as ResNet56, Densenet, VGG19 and MobilenetV2. We want to verify if the generation of conferrable adversarial examples is feasible when the defender trains a set of models with larger variety in model architecture. In practice, it may be the case that the defender locally searches for the best model architecture and in the process obtains multiple surrogate and reference models with various model architectures.
+
+Table 3 and 4 show the test accuracies and CAEAcc values of ImageNet32 surrogate and reference models. Values in the brackets denote the lowest and highest value measured. Our results for ImageNet32 are comparable to the results obtained with models trained on CIFAR-10. We even measure a lower CAE accuracy in reference models than we did in reference models trained on CIFAR-10. Note that the experiments conducted on ImageNet32 are results reported for $\epsilon = 0 . 1 5$ and the results for CIFAR-10 were generated with a perturbation threshold of $\epsilon = 0 . 0 2 5$ .
+
+# A.3 FINGERPRINTING DEFINITIONS
+
+
+Figure 7: A schematic illustration of the source model and the two types of models, the surrogate $S$ and the reference model $R$ , that a fingerprint verification should distinguish. ’Distill’ is any distillation attack that results in a surrogate model with similar performance as the source model and ’Classify’ returns the output of a model on a set of inputs.
+
+In this section, we formally define the term ’surrogate’ and provide security games for irremovability and non-evasiveness of DNN fingerprinting. For ease of notation, we define an auxiliary function to
+
+
Fine-Tuning
Attack
Source
FTLL
FTAL
RTLL
RTAL
Test Acc
55.70
57.30
61.30
59.00
45.00
CAEAcc
100.00
100.00
100.00
100.00
82.00
Retrain
Attack
ResNet20
ResNet56
Densenet
VGG19
MobileNetV2
Test Acc
53.10
54.50
50.95
52.50
52.87
CAEAcc
97.00
99.00
90.00
76.00
97.00
Extraction
Attack
Jagielski
Papernot
Knockoff
Test Acc
53.20
50.90
47.40
CAEAcc
98.00
90.00
98.00
+
+Table 3: Surrogate model accuracies for ImageNet32.
+Table 4: Reference model accuracies for ImageNet32.
+
+
ResNet20
ResNet56
Densenet
VGG19
MobileNetV2
Test Acc
55.00
59.10
55.95
54.10
62.90
CAEAcc
47.00
50.00
47.00
34.00
61.00
+
+generate a fingerprint for a source model.
+
+FModel():
+
+1. Compute $M \gets \operatorname { T r a i n } ( \mathcal { O } , D )$
+2. Sample $( { \mathcal { F } } , { \mathcal { F } } _ { y } ) \gets { \mathrm { G e n e r a t e } } ( M , D )$
+3. Output $( M , \mathcal { F } , \mathcal { F } _ { y } )$
+
+Definition of Surrogates. We define the randomized process ’distill’ that on the input of a source model $M$ and a dataset $D \in \mathcal { D }$ , returns a distilled surrogate $S$ of the source model. Note that other common methods of derivation, such as retraining, fine-tuning, and pruning on labels provided by the source model, can be expressed in terms of knowledge distillation (Hinton et al., 2015).
+
+For a given source model $M$ we recursively define the set $\boldsymbol { \mathcal { S } } _ { M }$ of its surrogate models as follows.
+
+$$
+S _ { M } \gets \{ \mathrm { d i s t i l l } ( S , D ) | S \in S _ { M } \cup \{ M \} \}
+$$
+
+If a model $R \in { \mathcal { M } }$ is trained from a labeled dataset without access to $s$ and hence is not contained in the set of surrogate models for source model $M$ , we refer to that model as reference model relative to $M$ . The goal of this paper is to find a method that verifies whether a surrogate model is in $\boldsymbol { S _ { M } }$ .
+
+Irremovability. The attacker accesses the source model $M$ to derive a surrogate $\hat { M } \gets \mathcal { A } ( M )$ . We say fingerprinting is not removable if the adversary has a low probability of winning the following security game.
+
+1. Defender computes $( M , { \mathcal { F } } , { \mathcal { F } } _ { y } ) \gets \mathrm { F M o d e l ( ) }$
+2. Obtain $\hat { M } _ { 0 } \gets \operatorname { T r a i n } ( \boldsymbol { \mathcal { O } } , \mathcal { D } )$ and $\hat { M } _ { 1 } \gets \mathcal { A } ( M )$
+3. Sample $b \gets \{ 0 , 1 \}$ and send $\hat { M } _ { b }$ to the Defender
+4. Adversary wins if:
+
+$$
+P r [ \mathrm { V e r i f y } ( \hat { M } _ { b } ( \mathcal { F } ) , \mathcal { F } _ { y } ) = b ] \approx 0 . 5
+$$
+
+Note that our definition of a robust fingerprint differs from related work (Cao et al., 2019) because we include in the set of removal attacks $\mathcal { A }$ also model extraction attacks. Fig. 7 schematically shows the types of models that a fingerprint verification should distinguish.
+
+Non-Evasiveness. Hitaj & Mancini (2018) show that an attacker can evade the black-box verification by rejecting queries or returning random labels when the verification process is detectable. We specify a non-evasiveness property, which makes it hard to separate members of the fingerprint to benign data samples. A fingerprinting method is non-evasive, if for some $\varepsilon \in \mathbb { R } ^ { + }$ , the adversary has a low probability of winning the following security game. Let $\operatorname { A d v } ( \mathcal { D } , \epsilon )$ be an adversarial attack with maximum perturbation $\epsilon \in \mathbb { R } ^ { + }$ performed on the dataset $D$ . An adversarial example with a perturbation smaller than $\epsilon$ can be hard to detect (Carlini & Wagner, 2017a). The security game is defined as follows.
+
+1. Compute $( M , { \mathcal { F } } , { \mathcal { F } } _ { y } ) \gets \mathrm { F M o d e l ( ) }$
+2. Adversary trains detector $\hat { M } \gets \mathcal { A } ( M )$
+3. Sample $b \gets \{ 0 , 1 \}$
+4. Set $X _ { 0 } \xleftarrow \{ \frac { \mathfrak { s } } { \mathrm { ~ A d v } ( D , \epsilon ) } $ and $X _ { 1 } \stackrel { \mathfrak { S } } { } \mathcal { F }$ and send $X _ { b }$ to the adversary
+5. Adversary wins if
+
+$$
+P r [ \hat { M } ( X _ { b } ) = b ] > 0 . 5 + \varepsilon
+$$
+
+Note that $\varepsilon$ bounds the trade-off between evasiveness and the suspect model’s performance. When $\varepsilon$ becomes smaller, more queries from benign users are falsely rejected, or a random label is returned at the same level of evasiveness. The goal of the attacker is to find a model that maximizes evasiveness while also maximizing model performance.
+
+# A.4 OPTIMIZING CONFERRABILITY
+
+In this section, we formally present the optimization problem that has to be solved to find highly conferrable adversarial examples. We denote the set of surrogate models for a source model $M$ by $\boldsymbol { \mathcal { S } } _ { M }$ and the set of reference models as $\mathcal { R }$ .
+
+Conferrability scores should be minimal when all reference and surrogate models assign the same target label (perfect transferability), or none of them assign the target label (non-transferability). An adversarial example that is perfectly transferable to surrogate models and non-transferable to reference models should have the maximum conferrability score. The following formula satisfies these constraints for a target class $t \in \mathcal { V }$ .
+
+$$
+\mathrm { C o n f e r } ( \mathcal { S } , \mathcal { R } , x ; t ) = \mathrm { T r a n s f e r } ( \mathcal { S } , x ; t ) ( 1 - \mathrm { T r a n s f e r } ( \mathcal { R } , x ; t ) )
+$$
+
+Note that Equation 9 does not have weight factors, as it is equally important to transfer to surrogate models as it is to not transfer to reference models.
+
+The optimization constraints to find adversarial examples with high conferrability scores can be formalized as follows for a benign input $x \in \mathcal { X }$ and a perturbation $\delta$ in the infinity norm.
+
+# Minimize $\delta$ s.t.
+
+$$
+\begin{array} { r l } & { \frac { 1 . \ \dotsc \ \dotsc \ } { R } ( x + \upsilon ) - \iota } \\ & { 2 . \ \dotsc \ \dotsc } \\ & { 3 . \ \dotsc \ } \\ & { 3 . \ P r \left[ R ( x + \delta ) \neq t \right] \approx 1 } \\ & { { \cal R } \in { \cal R } } \end{array}
+$$
+
+subject to $| | \delta | | _ { \infty } \leq \epsilon$
+
+The challenge of generating conferrable examples is to find a good optimization strategy that (i) finds local minima close to the global minimum and (ii) uses the least amount of surrogate and reference models to find those conferrable examples. Obtaining many surrogate and reference models that allow optimizing for conferrability is a one-time effort, but may be a practical limitation for datasets where training even a single model is prohibitively expensive.
+
+# A.5 REMOVAL ATTACKS
+
+In this section, we provide more details on the removal attacks and their parametrization.
+
+Table 5: An empirical sensitivity analysis of the hyperparameters in Eq. 6. Confer measures the mean conferrability score over five surrogate and five reference models trained on CIFAR-10.
+
+
a
β
2
Confer
a
β
2
Confer
0.1
0.1
0.5
0.20
0.5
1.0
0.1
0.44
0.1
0.1
1.0
0.20
0.5
1.0
0.5
0.37
0.1
0.5
0.1
0.20
0.5
1.0
1.0
0.29
0.1
0.5
0.5
0.20
1.0
0.1
0.1
0.49
0.1
0.5
1.0
0.20
1.0
0.1
0.5
0.42
0.1
1.0
0.1
0.20
1.0
0.1
1.0
0.40
0.1
1.0
0.5
0.20
1.0
0.5
0.1
0.45
0.1
1.0
1.0
0.20
1.0
0.5
0.5
0.37
0.5
0.1
0.1
0.20
1.0
0.5
1.0
0.37
0.5
0.1
0.5
0.20
1.0
1.0
0.1
0.41
0.5
0.1
1.0
0.20
1.0
1.0
0.5
0.42
0.5
0.5
0.1
0.20
1.0
1.0
1.0
0.40
0.5
0.5
1.0
0.20
+
+# A.5.1 MODEL EXTRACTION
+
+Retraining uses the source model $M$ to provide labels to the training data $D$ and then uses these labels to train the surrogate model $S$ .
+
+$$
+S \gets \operatorname { T r a i n } ( M , D )
+$$
+
+Jagielski et al. (2019) post-process the labels received from the source model by a distillation parameter $T ^ { \prime }$ to obtain soft labels. For an input $x \in \mathcal { D }$ and a source model $M$ , the soft labels $M ^ { \prime } ( x )$ can be computed as follows.
+
+$$
+M ^ { \prime } ( x ) _ { i } = \frac { \exp ( M ( x ) _ { i } ^ { 1 / T ^ { \prime } } ) } { \sum _ { j } \exp ( M ( x ) _ { j } ^ { 1 / T ^ { \prime } } ) }
+$$
+
+The surrogate model is trained on the soft labels.
+
+$$
+S \gets \operatorname { T r a i n } ( M ^ { \prime } , D )
+$$
+
+Papernot et al. (2017) propose training the surrogate model iteratively starting with an initial dataset $D _ { 0 }$ that is concatenated after each round with a set of the surrogate model’s adversarial examples.
+
+$$
+\begin{array} { r l } & { \quad S _ { 0 } \gets \mathrm { T r a i n } ( M , D _ { 0 } ) } \\ & { \quad D _ { i + 1 } \gets \{ x + \lambda \cdot \mathrm { s i g n } ( J _ { S } [ M ( x ) ] ) | x \in D _ { i } \} \cup D _ { i } } \\ & { \quad S _ { i } \gets \mathrm { T r a i n } ( M , D _ { i + 1 } ) } \end{array}
+$$
+
+$J _ { S }$ denotes the Jacobian matrix computed on the surrogate model $S$ for the labels assigned by the source model $M$ . We use the FGM adversarial attack to generate adversarial examples, as described by the authors.
+
+Knockoff (Orekondy et al., 2019) uses cross-domain transferability to derive a surrogate model. They construct a transfer set, which is cross-domain data, used to derive the surrogate model. We implement the random selection approach presented by the authors
+
+# A.6 EMPIRICAL SENSITIVITY ANALYSIS
+
+We perform a grid-search to understand the sensitivity of the choice of hyperparameters in Eq. 6 on the mean conferrability score over $n = 5 0$ inputs. Mean conferrability is evaluated over five surrogate and five reference models trained on CIFAR-10, which have not been used in the generation process of the conferrable examples. We evaluate all parameters in the range [0.1, 0.5, 1.0] and leave out all combinations where $\alpha = \beta = \gamma$ , except for the baseline used in this paper ( $\alpha = \beta = \gamma = 1$ ). The examples are generated for $\epsilon = 0 . 0 2 5$ with an Adam optimizer (Kingma & Ba, 2014) with a learning rate $5 \mathrm { e } { - 4 }$ and we optimize for 300 iterations.
+
+The results are illustrated in Table 5. We find that when $\alpha$ is small, the optimization does not converge and the source model does not predict the target label. When $\alpha$ is large relative to the other parameters, we measure the highest mean conferrability. For $\alpha = 1 . 0$ and $\beta = \gamma = 0 . 1$ we measure a mean conferrability of 0.49, which improves over the paper’s baseline.
\ No newline at end of file
diff --git a/md/train/X3TdREzbZN/X3TdREzbZN.md b/md/train/X3TdREzbZN/X3TdREzbZN.md
new file mode 100644
index 0000000000000000000000000000000000000000..eecea81c8f2f7ec103e0ce97a155fb5b67314819
--- /dev/null
+++ b/md/train/X3TdREzbZN/X3TdREzbZN.md
@@ -0,0 +1,391 @@
+# From Canonical Correlation Analysis to Self-supervised Graph Neural Networks
+
+Hengrui Zhang1⇤ , Qitian $\mathbf { W } \mathbf { u } ^ { 2 }$ , Junchi $\mathbf { Y a n } ^ { 2 }$ , David Wipf3, Philip S. $\mathbf { V } \mathbf { u } ^ { 1 }$
+
+1 Department of Computer Science, University of Illinois at Chicago 2 Department of Computer Science and Engineering, Shanghai Jiao Tong University 3AWS Shanghai AI Lab hzhan55@uic.edu, {echo740, yanjunchi}@sjtu.edu.cn daviwipf@amazon.com, psyu@uic.edu
+
+# Abstract
+
+We introduce a conceptually simple yet effective model for self-supervised representation learning with graph data. It follows the previous methods that generate two views of an input graph through data augmentation. However, unlike contrastive methods that focus on instance-level discrimination, we optimize an innovative feature-level objective inspired by classical Canonical Correlation Analysis. Compared with other works, our approach requires none of the parameterized mutual information estimator, additional projector, asymmetric structures, and most importantly, negative samples which can be costly. We show that the new objective essentially 1) aims at discarding augmentation-variant information by learning invariant representations, and 2) can prevent degenerated solutions by decorrelating features in different dimensions. Our theoretical analysis further provides an understanding for the new objective which can be equivalently seen as an instantiation of the Information Bottleneck Principle under the self-supervised setting. Despite its simplicity, our method performs competitively on seven public graph datasets.
+
+The code is available at: https://github.com/hengruizhang98/CCA-SSG.
+
+# 1 Introduction
+
+Self-supervised learning (SSL) has been a promising paradigm for learning useful representations without costly labels $\textcircled { 7 } , \textcircled { 4 6 } , \textcircled { 5 }$ . In general, it learns representations via a proxy objective between inputs and self-defined signals, among which contrastive methods [46, 40, 16, 5, 12] have achieved impressive performance on learning image representations by maximizing the mutual information of two views (or augmentations) of the same input. Such methods can be interpreted as a discrimination of a joint distribution (positive pairs) from the product of two marginal ones (negative pairs) $ { \mathbb { B } } 5 0 { \mathbb { I } }$ .
+
+Inspired by the success of contrastive learning in vision [17, 46, 40, 5, 16, 12, 6], similar methods have been adapted to learning graph neural networks [48, 15, 33, 57, 58]. Although these models have achieved impressive performance, they require complex designs and architectures. For example, DGI [48] and MVGRL $\dot { \mathbb { I } } \dot { \Sigma } \mathbb { I }$ rely on a parameterized mutual information estimator to discriminate positive node-graph pairs from negative ones; GRACE $\mathbb { \lVert \Xi \rVert }$ and GCA $\left[ \left[ 5 8 \right] \right]$ harness an additional MLP-projector to guarantee sufficient capacity. Moreover, negative pairs sampled or constructed from data often play an indispensable role in providing effective contrastive signals and have a large impact on performance. Selecting proper negative samples is often nontrivial for graph-structured data, not to mention the extra storage cost for prohibitively large graphs. BGRL $\textcircled { 1 3 9 } \textcircled { 1 }$ is a recent endeavor on targeting a negative-sample-free approach for GNN learning through asymmetric architectures [12, 6]. However, it requires additional components, e.g., an exponential moving average (EMA) and StopGradient, to empirically avoid degenerated solutions, leading to a more intricate architecture.
+
+Table 1: Technical comparison of self-supervised node representation learning methods. We provide a conceptual comparison with more self-supervised methods in Appendix $\boxed { \mathbf { G } }$ Target denotes the comparison pair, N/G/F denotes node/graph/feature respectively. MI-Estimator: parameterized mutual information estimator. Proj/Pred: additional (MLP) projector or predictor. Asymmetric: asymmetric architectures such as EMA and Stop-Gradient, or two separate encoders for two branches. Neg examples: requiring negative examples to prevent trivial solutions. Space denotes space requirement for storing all the pairs. Our method is simple without any listed component and memory-efficient.
+
+
Methods
Target
MI-Estimator
Proj/Pred
Asymmetric
Neg examples
Space
DGI 4
N-G
?
O(N)
[rrrereeiter
MVGRL [15]
N-G
?
√
O(N)
GRACE[ 国
N-N
√
√
O(N2)
GCA 8
N-N
O(N2)
BGRL ③9
N-N
√
O(N)
CCA-SSG (Ours)
F-F
-
-
=
0(D²)
+
+Deviating from the large body of previous works on contrastive learning, in this paper we take a new perspective to address SSL on graphs. We introduce Canonical Correlation Analysis inspired Self-Supervised Learning on Graphs (CCA-SSG), a simple yet effective approach that opens the way to a new SSL objective and frees the model from intricate designs. It follows the common practice of prior arts, generating two views of an input graph through random augmentation and acquiring node representations through a shared GNN encoder. Differently, we propose to harness a non-contrastive and non-discriminative feature-level objective, which is inspired by the well-studied Canonical Correlation Analysis (CCA) methods [18, 10, 11, 14, 2, 4]. More specifically, the new objective aims at maximizing the correlation between two augmented views of the same input and meanwhile decorrelating different (feature) dimensions of a single view’s representation. We show that the objective 1) essentially pursuits discarding augmentation-variant information and preserving augmentation-invariant information, and 2) can prevent dimensional collapse $\mathbb { \ m }$ (i.e., different dimensions capture the same information) in nature. Furthermore, our theoretical analysis sheds more lights that under mild assumptions, our model is an instantiation of Information Bottleneck Principle [43, 44, 37] under SSL settings [53, 9, 45].
+
+To sum up, as shown in Table $^ { 1 , }$ our new objective induces a simple and light model without reliance on negative pairs [48, 15, 57, 58], a parameterized mutual information estimator [48, 15], an additional projector or predictor [57, 58, 39] or asymmetric architectures $\mathbb { \lVert 3 9 , \rVert 5 \rVert }$ . We provide a thorough evaluation for the model on seven node classification benchmarks. The empirical results demonstrate that despite its simplicity, CCA-SSG can achieve very competitive performance in general and even superior test accuracy in five datasets. It is worth noting that our approach is agnostic to the input data format, which means that it can potentially be applied to other scenarios beyond graph-structured data (such as vision, language, etc.). We leave such a technical extension for future works.
+
+# Our contributions are as follows:
+
+1) We introduce a non-contrastive and non-discriminative objective for self-supervised learning, which is inspired by Canonical Correlation Analysis methods. It does not rely on negative samples, and can naturally remove the complicated components. Based on it we propose CCA-SSG, a simple yet effective framework for learning node representations without supervision (see Section 3).
+
+2) We theoretically prove that the proposed objective aims at keeping augmentation-invariant information while discarding augmentation-variant one, and possesses an inherent relationship to an embodiment of Information Bottleneck Principle under self-supervised settings (see Section 4).
+
+3) Experimental results show that without complex designs, our method outperforms state-of-the-art self-supervised methods MVGRL $\mathbb { \lVert 1 5 \rVert }$ and GCA $\left[ \left[ 5 8 \right] \right]$ on 5 out of 7 benchmarks. We also provide thorough ablation studies on the effectiveness of the key components of CCA-SSG (see Section $\bigtriangledown$
+
+# 2 Related Works and Background
+
+Contrastive Learning on Graphs. Contrastive methods [46, 40, 17, 16, 5, 12] have been shown to be effective for unsupervised learning in vision, which have also been adapted to graphs. Inspired by the local-global mutual information maximization viewpoints [17], DGI $\boxed { \boxed { 4 8 } } \vert$ and InfoGraph $\mathbf { \widehat { \left[ \left. 3 8 \right. \right] } }$ put forward unsupervised schemes for node and graph representation learning, respectively. MVGRL [15] generalizes CMC $\textcircled { | 4 0 | }$ to graph-structured data by introducing graph diffusion $\mathbb { \left[ \left[ 2 3 \right] \right] }$ to create another view for a graph. GCC $\pmb { \mathbb { B 3 } } ] |$ adopts InfoNCE loss $\lVert \overline { { 4 6 } } \rVert$ and MoCo-based negative pool $\mathbb { \left[ \left[ 1 6 \right] \right] }$ for largescale GNN pretraining. GRACE [57], GCA $\pmb { \Vert 5 8 \Vert }$ and GraphCL [52] follow the spirit of SimCLR [5] and learn node/graph representations by directly treating other nodes/graphs as negative samples. BGRL $\textcircled { \ 3 9 } \textcircled { }$ targets a negative-sample-free model, inspired by BYOL [12], on node representation learning. But it still requires complex asymmetric architectures.
+
+Feature-level Self-supervised Objectives. The above-mentioned methods all focus on instancelevel contrastive learning. To address their drawbacks, some recent works have been turning to feature-level objectives. For example, Contrastive Clustering $\mathbb { \left. 2 5 \right. }$ regards different feature dimensions as different clusters, thus combining the cluster-level discrimination with instance-level discrimination. W-MSE $\pmb { \mathbb { B } } ] \mathbf { l }$ performs a differentiable whitening operation on learned embeddings, which implicitly scatters data points in embedding space. Barlow Twins $\mathbb { \left[ \left. 5 3 \right] \right. }$ borrows the idea of redundancy reduction and adopts a soft decorrelation term that makes the cross-correlation matrix of two views’ representations close to an identity matrix. By contrast, our method is based on the classical Canonical Correlation Analysis, working by correlating the representations of two views from data augmentation and meanwhile decorrelating different feature dimensions of each view’s representation.
+
+Canonical Correlation Analysis. CCA is a classical multivariate analysis method, which is first introduced in $\mathbb { \lVert \rVert }$ . For two random variables $X \in \mathbb { R } ^ { m }$ and $Y \in \mathbb { R } ^ { n }$ , their covariance matrix is $\Sigma _ { X Y } = C o v ( X , Y )$ . CCA aims at seeking two vectors $a \in \mathbb { R } ^ { m }$ and $b \in \mathbb { R } ^ { n }$ such that the correlation $\begin{array} { r } { \rho = \operatorname { c o r r } ( a ^ { \top } X , b ^ { \top } Y ) = \frac { a ^ { \top } \Sigma _ { X Y } b } { \sqrt { a ^ { \top } \Sigma _ { X X } a } \sqrt { b ^ { \top } \Sigma _ { Y Y } b } } } \end{array}$ is maximized. Formally, the objective is
+
+$$
+\operatorname* { m a x } _ { a , b } a ^ { \top } \Sigma _ { X Y } b , \ \mathrm { s . t . } \ a ^ { \top } \Sigma _ { X X } a = b ^ { \top } \Sigma _ { Y Y } b = 1 .
+$$
+
+For multi-dimensional cases, CCA seeks two sets of vectors maximizing their correlation and subjected to the constraint that they are uncorrelated with each other $\mathbb { \ m }$ . Later studies apply CCA to multi-view learning with deep models $\scriptstyle \left\| 2 \right\| , \scriptstyle \left\| 1 \right\| , \scriptstyle \left\| 4 \right\|$ , by replacing the linear transformation with neural networks. Concretely, assuming $X _ { 1 } , X _ { 2 }$ as two views of an input data, it optimizes
+
+$$
+\operatorname* { m a x } _ { \theta _ { 1 } , \theta _ { 2 } } { \mathrm { T r } } \left( P _ { \theta _ { 1 } } ^ { \top } ( X _ { 1 } ) P _ { \theta _ { 2 } } ( X _ { 2 } ) \right) { \mathrm { ~ s . t . ~ } } P _ { \theta _ { 1 } } ^ { \top } ( X _ { 1 } ) P _ { \theta _ { 1 } } ( X _ { 1 } ) = P _ { \theta _ { 2 } } ^ { \top } ( X _ { 2 } ) P _ { \theta _ { 2 } } ( X _ { 2 } ) = I .
+$$
+
+where $P _ { \theta _ { 1 } }$ and $P _ { \theta _ { 2 } }$ are two feedforward neural networks and $I$ is an identity matrix. Despite its preciseness, such computation is really expensive $\mathbb { H }$ . Fortunately, soft CCA $\boxed { \boxed { 4 } }$ removes the hard decorrelation constraint by adopting the following Lagrangian relaxation:
+
+$$
+\operatorname* { m i n } _ { \theta _ { 1 } , \theta _ { 2 } } \mathcal { L } _ { d i s t } \left( P _ { \theta _ { 1 } } ( X _ { 1 } ) , P _ { \theta _ { 2 } } ( X _ { 2 } ) \right) + \lambda \left( \mathcal { L } _ { S D L } ( P _ { \theta _ { 1 } } ( X _ { 1 } ) ) + \mathcal { L } _ { S D L } ( P _ { \theta _ { 2 } } ( X _ { 2 } ) ) \right) ,
+$$
+
+where $\mathcal { L } _ { d i s t }$ measures correlation between two views’ representations and $\mathcal { L } _ { S D L }$ (called stochastic decorrelation loss) computes an $L _ { 1 }$ distance between $P _ { \theta _ { i } } ( X _ { i } )$ and an identity matrix, for $i = 1 , 2$ .
+
+# 3 Approach
+
+# 3.1 Model Framework
+
+In this paper we focus on self-supervised node representation learning, where we consider a single graph $\mathbf { G } = ( \mathbf { X } , \mathbf { A } )$ . $\mathbf { X } \in \mathbb { R } ^ { N \times F }$ and $\mathbf { A } \in \mathbb { R } ^ { \hat { N } \times N }$ denote node features and adjacency matrix respectively. Here $N$ is the number of nodes within the graph and $F$ denotes feature dimension.
+
+Our model simply consists of three parts: 1) a random graph augmentation generator $\tau$ . 2) a GNNbased graph encoder $f _ { \theta }$ where $\theta$ denotes its parameters. 3) a novel feature-level objective function based on Canonical Correlation Analysis. Fig. $\bigstar$ is an illustration of the proposed model.
+
+
+Figure 1: Illustration of the proposed model: given an input graph, we first generate two views through random augmentations: edge dropping and node feature masking. The two views are subsequently put into a shared GNN encoder to generate representations. The loss function is applied on the column-normalized embedding matrix of the two views. Note that this simple yet effective pipeline can also be conceptually applied for other data like vision and texts, which we leave for future works.
+
+# Algorithm 1: PyTorch-style code for CCA-SSG
+
+# f: encoder network # lambda: trade-off # D: embedding dimension # g: input graph # feat: node features
+
+# generate two views through random augmentation
+g1, feat1 $=$ augment(g, feat)
+$\mathtt { g 2 }$ , feat2 $=$ augment(g, feat)
+$\mathsf { \bar { z } 1 } \ = \ \pounds ( \mathsf { g 1 }$ , feat1) # embedding of the 1st view
+$\mathsf { z } 2 \ = \ \pounds ( \mathsf { g } 2$ , feat2) $\#$ embedding of the 2st view
+
+# batch normalization z1_norm $=$ ((z1 - z1.mean(0)) / z1.std(0))/ sqrt(N) z2_norm $=$ ((z2 - z2.mean(0)) / z2.std(0))/ sqrt(N)
+
+# covariance matrix of each view $\mathtt { c 1 \_ = }$ torch.mm(z1_norm.T(), z1_norm) $c 2 \ =$ torch.mm(z2_norm.T(), z2_norm)
+
+iden $=$ torch.eye(D) loss_inv $=$ (z1_norm - z2_norm).pow(2).sum() loss_dec_1 $=$ (c1 - iden).pow(2).sum() loss_dec_2 $=$ (c2 - iden).pow(2).sum() loss_dec $=$ loss_dec_1 $^ +$ loss_dec_2 loss $=$ loss_inv $^ +$ lambda \* loss_dec
+
+Graph augmentations. We consider the standard pipeline for random graph augmentation that has been commonly used in previous works $1 5 7 , 1 3 9 \parallel$ . To be specific, we harness two ways for augmentation: edge dropping and node feature masking. Edge dropping randomly drops a fraction of edges from the original graph, while node feature masking randomly masks a fraction of features for all the nodes. In this way, $\tau$ is composed of all the possible graph transformation operations and each $t \sim \tau$ denotes a specific graph transformation for graph $G$ . Note that we use commonly adopted augmentation methods to stay our focus on the design of objective function and conduct fair comparison with existing approaches. More complicated random augmentations $ { \mathbb { B } } 2 { \mathbb { I } } 5 8 { \mathbb { I } }$ can also be readily plugged into our model. Details for the used augmentation functions are in Appendix E.
+
+Training. In each training iteration, we first randomly sample two graph transformations $t _ { A }$ and $t _ { B }$ from $\tau$ , and then generate two views $\tilde { \mathbf { G } } _ { A } = ( \tilde { \mathbf { X } } _ { A } , \tilde { \mathbf { A } } _ { A } )$ and $\tilde { \mathbf { G } } _ { B } = ( \bar { \mathbf { X } } _ { B } , \tilde { \mathbf { A } } _ { B } )$ according to the transformations. The two views are subsequently fed into a shared GNN encoder to generate the node embeddings of the two views: $\mathbf { Z } _ { A } = f _ { \theta } ( \mathbf { \bar { X } } _ { A } , \mathbf { \bar { A } } _ { A } )$ , $\mathbf { Z } _ { B } = f _ { \theta } ( \tilde { \mathbf { X } } _ { B } , \tilde { \mathbf { A } } _ { B } )$ , where $\mathbf { Z } _ { A } , \mathbf { Z } _ { B } \in \mathbb { R } ^ { N \times D }$ and $D$ denotes embedding dimension. We further normalize the node embeddings along instance dimension so that each feature dimension has a 0-mean and $1 / \sqrt { N }$ -standard deviation distribution:
+
+$$
+\tilde { \mathbf { Z } } = \frac { \mathbf { Z } - \mu ( \mathbf { Z } ) } { \sigma ( \mathbf { Z } ) * \sqrt { N } }
+$$
+
+The normalized $\tilde { \mathbf { Z } } _ { A }$ , $\tilde { \mathbf { Z } } _ { B }$ will be used to compute a feature-level objective in Section $3 . 2 .$ To help better understand the proposed framework, we provide the PyTorch-style pseudocode for training CCA-SSG in Algorithm 1.
+
+Inference. To generate node embeddings for downstream tasks, we put the original graph ${ \bf G } =$ $( \mathbf { X } , \mathbf { A } )$ into the trained graph neural network $f _ { \theta }$ and obtain node embeddings $\mathbf { Z } = f _ { \theta } ( \mathbf { X } , \mathbf { A } )$ .
+
+# 3.2 Learning Objective
+
+Canonical Correlation Analysis has shown its great power in multi-view learning like instance recognition $\pmb { \Vert 4 \Vert }$ . However, it still remains unexplored to leverage CCA for self-supervised learning. Note that in SSL, one generates two sets of data from the same input through transformation or random data augmentation, which could be regraded as two views of the input data. This inspires us to introduce the following objective for self-supervised representation learning:
+
+$$
+\mathcal { L } = \underbrace { \left\| \tilde { \mathbf { Z } } _ { A } - \tilde { \mathbf { Z } } _ { B } \right\| _ { F } ^ { 2 } } _ { \mathrm { i n v a r i a n c e ~ t e r m } } + \lambda \underbrace { \left( \left\| \tilde { \mathbf { Z } } _ { A } ^ { \top } \tilde { \mathbf { Z } } _ { A } - \mathbf { I } \right\| _ { F } ^ { 2 } + \left\| \tilde { \mathbf { Z } } _ { B } ^ { \top } \tilde { \mathbf { Z } } _ { B } - \mathbf { I } \right\| _ { F } ^ { 2 } \right) } _ { \mathrm { d e c o r r e l a t i o n ~ t e r m } }
+$$
+
+where $\lambda$ is a non-negative hyperparameter trading off two terms. Note that minimizing the invariance term is essentially maximizing the correlation between two views as their representations are already normalized. In SSL, as the two augmented views come randomly from the same distribution, we can adopt one encoder $f _ { \theta }$ that is shared across two branches and seek for a regularization that encourages different feature dimensions to capture distinct semantics via the decorrelation term.
+
+We next provide a variance-covariance perspective to the new objective, following similar lines of reasoning in [41, 42]. Assume that input data come from a distribution $\begin{array} { r } { \pmb { x } \sim p ( \pmb { x } ) } \end{array}$ and $\pmb { s }$ is a view of $_ { \textbf { \em x } }$ through random augmentation $\pmb { s } \sim p _ { a u g } ( \cdot | \pmb { x } )$ . Denote $z _ { s }$ as the representation of $\pmb { s }$ , then minimizing the invariance term, by expectation, is to minimize the variance of the normalized representation $\tilde { z } _ { s }$ , conditioned on $_ { \textbf { \em x } }$ . Also, minimizing the decorrelation term is to push the off-diagonal elements of the covariance matrix (given by two $\tilde { z } _ { s }$ ’s) close to 0. Formally, we have
+
+$$
+\mathcal { L } _ { i n v } = \Big | \Big | \tilde { \mathbf { Z } } _ { A } - \tilde { \mathbf { Z } } _ { B } \Big | \Big | _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { N } \sum _ { k = 1 } ^ { D } ( \tilde { z } _ { i , j } ^ { A } - \tilde { z } _ { i , j } ^ { B } ) ^ { 2 } \cong \mathbb { E } _ { x } \left[ \sum _ { k = 1 } ^ { D } \mathbb { V } _ { s | x } [ \tilde { z } _ { s , k } ] \right] * 2 N ,
+$$
+
+$$
+\mathcal { L } _ { d e c } = \Big \| \tilde { \mathbf { Z } } _ { S } ^ { \top } \tilde { \mathbf { Z } } _ { S } - \mathbf { I } \Big \| _ { F } ^ { 2 } = \| \mathbf { C o v } _ { s } [ \tilde { z } ] - I \| _ { F } ^ { 2 } \cong \sum _ { i \neq j } \big ( \rho _ { i , j } ^ { z _ { s } } \big ) ^ { 2 } , \mathrm { ~ f o r ~ } \tilde { \mathbf { Z } } _ { S } \in \{ \tilde { \mathbf { Z } } _ { A } , \tilde { \mathbf { Z } } _ { B } \} ,
+$$
+
+where $\rho$ is the Pearson correlation coefficient.
+
+# 3.3 Advantages over Contrastive Methods
+
+In this subsection we provide a systematic comparison with previous self-supervised methods for node representation learning, including DGI $\lVert \overline { { 4 8 } } \rVert$ , MVGRL $\mathbb { \left. \overline { { \Omega } } \right. }$ , GRACE [57], GCA [58] and BGRL $\mathbb { B } 9 ]$ , and highlight the merits of CCA-SSG. A quick overview is presented in Table 1.
+
+No reliance on negative samples. Most of previous works highly rely on negative pairs to avoid collapse or interchangeable, trivial/degenerated solutions [48, 15, 57, 58]. E.g., DGI and MVGRL generate negative examples by corrupting the graph structure severely, and GRACE/GCA treats all the other nodes within a graph as negative examples. However, for self-supervised learning on graphs, it is non-trivial to construct informative negative examples since nodes are structurally connected, and selecting negative examples in an arbitrary manner may lead to large variance for stochastic gradients and slow training convergence [51]. The recently proposed BGRL model adopts asymmetric encoder architectures for SSL on graphs without the use of negative samples. However, though BGRL could avoid collapse empirically, it still remains as an open problem concerning its theoretical guarantee for preventing trivial solutions [41]. Compared with these methods, our model does not rely on negative pairs and asymmetric encoders. The feature decorrelation term can naturally prevent trivial solutions caused by the invariance term. We discuss the collapse issue detailedly in Appendix B.
+
+No MI estimator, projector network nor asymmetric architectures. Most previous works rely on additional components besides the GNN encoder to estimate some score functions in final objectives. DGI and MVGRL require a parameterized estimator to approximate mutual information between two views, and GRACE leverages a MLP projector followed by an InfoNCE estimator. BGRL harnesses asymmetric encoder architecture which consists of EMA (Exponential Moving Average), Stop-Gradient and an additional projector. MVGRL also induces asymmetric architectures as it adopts two different GNNs for the input graph and the diffusion graph respectively. In contrast, our approach requires no additional components except a single GNN encoder.
+
+Better efficiency and scalability to large graphs. Consider a graph with $N$ nodes. DGI and MVGRL contrast node embeddings with graph embedding, which would require $O ( N )$ space cost.
+
+GRACE treats two views of the same node as positive pairs and treat views of different nodes as negative pairs, which would take $O ( N ^ { 2 } )$ space. BGRL focuses only on positive pairs, which will also take $O ( N )$ space. By contrast, our method works on feature dimension. If we embed each node into a $D$ -dimensional vector, the computation of the loss function would require $O ( D ^ { 2 } )$ space. This indicates that the memory cost does not grow consistently as the size of graph increases. As a result, our method is promising for handling large-scale graphs without prohibitively large space costs.
+
+# 4 Theoretical Insights with Connection to Information Theory
+
+In this section we provide some analysis of the proposed objective function: 1) Interpretation of the loss function with entropy and mutual information. 2) The connection between the proposed objective and the Information Bottleneck principle. 3) Why the learned representations would be informative to downstream tasks. The proofs of propositions, theorems and corollaries are in Appendix D.
+
+Notations. Denote the random variable of input data as $X$ and the downstream task as $T$ (it could be the label $Y$ if the downstream task is classification). Note that in SSL, we have no access to $T$ in training and here we introduce the notation for our analysis. Define $S$ as the self-supervised signal (i.e., an augmented view of $X$ ), and $S$ shares the same space as $X$ . Our model learns a representation for the input, denoted by $Z _ { X }$ and its views, denoted by $Z _ { S }$ . $Z _ { X } = f _ { \theta } ( X ) , Z _ { S } = f _ { \theta } ( S ) , f _ { \theta } ( . )$ is a encoder shared by the original data and its views, which is parameterized by $\theta$ . The target of representation learning is to learn a optimal encoder parameter $\theta$ . Furthermore, for random variable $A , B , C$ , we use $I ( A , B )$ to denote the mutual information between $A$ and $B$ , $I ( A , B | C )$ to denote conditional mutual information of $A$ and $B$ on a given $C$ , $H ( A )$ for the entropy, and ${ \dot { H } } ( A | B )$ for conditional entropy. The proofs of propositions, theorems and corollaries are in Appendix D.
+
+# 4.1 An Entropy and Mutual Information Interpretation of the Objective
+
+We first introduce an assumption about the distributions of $P ( Z _ { S } )$ and $P ( Z _ { S } | X )$ .
+
+Assumption 1. (Gaussian assumption of $P ( Z _ { S } | X )$ and $P ( Z _ { S } ) _ { . }$ ):
+
+$$
+P ( Z _ { S } | X ) = \mathcal { N } ( \mu _ { X } , \Sigma _ { X } ) , P ( Z _ { S } ) = \mathcal { N } ( \mu , \Sigma ) .
+$$
+
+With Assumption $^ { 1 , }$ we can arrive at the following propositions:
+
+Proposition 1. In expectation, minimizing Eq. $\textcircled{6}$ is equivalent to minimizing the entropy of $Z _ { S }$ conditioned on input $X$ , i.e.,
+
+$$
+\operatorname* { m i n } _ { \theta } \mathcal { L } _ { i n v } \cong \operatorname* { m i n } _ { \theta } H ( Z _ { S } | X ) .
+$$
+
+Proposition 2. Minimizing Eq. $( 7 )$ is equivalent to maximizing the entropy of $Z _ { S }$ , i.e.,
+
+$$
+\operatorname* { m i n } _ { \theta } \mathcal { L } _ { d e c } \cong \operatorname* { m a x } _ { \theta } H ( Z _ { S } ) .
+$$
+
+The two propositions unveil the effects of two terms in our objective. Combining two propositions, we can further interpret Eq. $\textcircled{5}$ from an information-theoretic perspective.
+
+Theorem 1. By optimizing $E q \ ( \mathbb { 5 } )$ , we maximize the mutual information between the augmented view’s embedding $Z _ { S }$ and the input data $X$ , and minimize the mutual information between $Z _ { S }$ and the view itself $S$ , conditioned on the input data $X$ . Formally we have
+
+$$
+\operatorname* { m i n } _ { \theta } \mathcal { L } \Rightarrow \operatorname* { m a x } _ { \theta } I ( Z _ { S } , X ) a n d \operatorname* { m i n } _ { \theta } I ( Z _ { S } , S | X ) .
+$$
+
+The proof is based on the facts $I ( Z _ { S } , X ) = H ( Z _ { S } ) - H ( Z _ { S } | X )$ and $I ( Z _ { S } , S | X ) = H ( Z _ { S } | X ) +$ $H ( \bar { Z _ { S } } | S ) = H ( Z _ { S } | X )$ . Theorem $^ 1 .$ indicates that our objective Eq. $( 5 )$ learns representations that maximize the information of the input data, i.e., $I ( Z _ { S } , X )$ , and meanwhile minimize the lost information during augmentation, i.e., $I ( Z _ { S } , S | X )$ .
+
+# 4.2 Connection with the Information Bottleneck Principle
+
+The analysis in Section $\boxed { 4 . 1 }$ enables us to further build a connection between our objective Eq. $\textcircled{5}$ and the well-studied Information Bottleneck Principle [43, 44, 37, 1] under SSL settings. Recall that the supervised Information Bottleneck (IB) is defined as follows:
+
+Definition 1. The supervised $I B$ aims at maximizing an Information Bottleneck Lagrangian:
+
+$$
+\mathcal { T B } _ { s u p } = I ( Y , Z _ { X } ) - \beta I ( X , Z _ { X } ) , w h e r e \beta > 0 .
+$$
+
+As we can see, $\mathcal { T } \mathcal { B } _ { s u p }$ attempts to maximize the information between the data representation $Z _ { X }$ and its corresponding label $Y$ , and concurrently minimize the information between $Z _ { X }$ and the input data $X$ (i.e., exploiting compression of $Z _ { X }$ from $X$ ). The intuition of IB principle is that $Z _ { X }$ is expected to contain only the information that is useful for predicting $Y$ .
+
+Several recent works [9, 45, 53] propose various forms of IB under self-supervised settings. The most relevant one names Self-supervised Information Bottleneck:
+
+Definition 2. (Self-supervised Information Bottleneck $I ^ { \langle \bar { 5 } 3 | \jmath \rangle }$ . The Self-supervised IB aims at maximizing the following Lagrangian:
+
+$$
+\mathcal { T B } _ { s s l } = I ( X , Z _ { S } ) - \beta I ( S , Z _ { S } ) , \ w h e r e \ \beta > 0 .
+$$
+
+Intuitively, $\boldsymbol { \mathcal { T } } \boldsymbol { B } _ { s s l }$ posits that a desirable representation is expected to be informative to augmentation invariant features, and to be a maximally compressed representation of the input.
+
+Our objective Eq. $\textcircled{5}$ is essentially an embodiment of $\boldsymbol { \mathcal { T } } \boldsymbol { B } _ { s s l }$ :
+
+Theorem 2. Assume $0 ~ < ~ \beta ~ \leq ~ 1$ , then by minimizing Eq. $( 5 )$ , the self-supervised Information Bottleneck objective is maximized, formally:
+
+$$
+\operatorname* { m i n } _ { \theta } \mathcal { L } \Rightarrow \operatorname* { m a x } _ { \theta } \mathcal { L } B _ { s s l }
+$$
+
+Theorem $\bigtriangledown$ also shows that Eq. $( 5 )$ implicitly follows the same spirit of IB principle under selfsupervised settings. As further enlightenment, we can relate Eq. $\textcircled{5}$ with the multi-view Information Bottleneck $\pmb { \mathbb { Q } } \|$ and the minimal and sufficient representations for self-supervision [45]:
+
+Corollary 1. Let $X _ { 1 } = S$ , $X _ { 2 } = X$ and assume $0 < \beta \leq 1$ , then minimizing Eq. $\textcircled{5}$ is equivalent to minimizing the Multi-view Information Bottleneck Loss in $\pmb { \mathcal { D } } \pmb { \mathcal { J } }$ :
+
+$$
+\mathcal { L } _ { M I B } = I ( Z _ { 1 } , X _ { 1 } | X _ { 2 } ) - \beta I ( X _ { 2 } , Z _ { 1 } ) , w h e r e 0 < \beta \leq 1 .
+$$
+
+Corollary 2. When the data augmentation process is reversible, minimizing Eq. $\textcircled{5}$ is equivalent to learning the Minimal and Sufficient Representations for Self-supervision in $\pm \varTheta$ :
+
+$$
+Z _ { X } ^ { s s l } = \underset { Z _ { X } } { \operatorname { a r g m a x } } I ( Z _ { X } , S ) , Z _ { X } ^ { s s l _ { m i n } } = \underset { Z _ { X } } { \operatorname { a r g m i n } } H ( Z _ { X } | S ) ~ s . t . ~ I ( Z _ { X } , S ) ~ i s ~ m a x i m i z e d .
+$$
+
+# 4.3 Influence on Downstream Tasks
+
+We have provided a principled understanding for our new objective. Next, we discuss its effect on downstream tasks $T$ . The rationality of data augmentations in SSL is rooted in a conjecture that an ideal data augmentation approach would not change the information related to its label. We formulate this hypothesis as a building block for analysis on downstream tasks [36, 9].
+
+Assumption 2. (Task-relevant information and data augmentation). All the task-relevant information is shared across the input data $X$ and its augmentations $S$ , i.e., $I ( X , T ) = I ( S , T ) = \bar { I ( X , S , T ) }$ , or equivalently, $I ( X , T | S ) = I ( S , T | X ) = 0$ .
+
+This indicates that all the task-relevant information is contained in augmentation invariant features. We proceed to derive the following theorem which reveals the efficacy of the learned representations by our objective with respect to downstream tasks.
+
+Theorem 3. (Task-relevant/irrelevant information). By optimizing Eq. $( 5 )$ , the task-relevant information $I ( Z _ { S } , T )$ is maximized, and the task-irrelevant information $H ( Z _ { S } | \overline { { { T } } } )$ is minimized. Formally,
+
+$$
+\operatorname* { m i n } _ { \theta } \mathcal { L } \Rightarrow \operatorname* { m a x } _ { \theta } I ( Z _ { S } , T ) \ : a n d \ : \operatorname* { m i n } _ { \theta } H ( Z _ { S } | T ) .
+$$
+
+Therefore, the learned representation $Z _ { S }$ is expected to contain minimal and sufficient information about downstream tasks $\overline { { [ 4 5 ] } } , \overline { { 9 } } \overline { { ] } }$ , which further illuminates the reason why the embeddings given by SSL approaches have superior performance on various downstream tasks.
+
+Table 2: Test accuracy on citation networks. The input column highlights the data used for training. $\mathbf { X }$ for node features, A for adjacency matrix, S for diffusion matrix, and $\mathbf { Y }$ for node labels).
+
+
Methods
Input
Cora
Citeseer
Pubmed
Supervised
MLP [47 LP [56
X,Y A,Y
55.1
46.5 45.3
71.4 63.0
GCN [22]
X,A,Y
68.0 81.5
70.3
79.0
GAT 图
X,A,Y
83.0±0.7
72.5 ± 0.7
79.0 ± 0.3
Unsupervised
Raw Features [48]
X
47.9 ± 0.4
49.3 ± 0.2
69.1 ± 0.3
Linear CCA [18]
X
58.9 ± 1.5
27.5 ±1.3
75.8 ± 0.4
Deep Walk [32]
A
70.7 ± 0.6
51.4 ± 0.5
74.3 ± 0.9
GAE 21
X,A
71.5 ± 0.4
65.8 ± 0.4
72.1 ± 0.5
DGI 4
X,A
82.3 ± 0.6
71.8 ± 0.7
76.8 ± 0.6
MVGRL1 园
X,S,A
83.5 ± 0.4
73.3 ± 0.5
80.1 ± 0.7
GRACE² 回 CCA-SSG (Ours)
X,A X,A
81.9 ± 0.4 84.2 ± 0.4
71.2 ± 0.5 73.1 ± 0.3
80.6 ± 0.4 81.6 ± 0.4
+
+1 Results on Cora with authors’ code is inconsistent with [15]. We adopt the results with authors’ code. 2 Results are from our reproducing with authors’ code, as [57] did not use the public splits.
+
+# 5 Experiments
+
+We assess the quality of representations after self-supervised pretraining on seven node classification benchmarks: Cora, Citeseer, Pubmed, Coauthor CS, Coauthor Physics and Amazon Computer, Amazon-Photo. We adopt the public splits for Cora, Citeseer, Pubmed, and a 1:1:9 training/validation/testing splits for the other 4 datasets. Details of the datasets are in Appendix E.
+
+Evaluation protocol. We follow the linear evaluation scheme as introduced in $\lVert \rVert \bigstar \ 8 \rVert$ : i) We first train the model on all the nodes in a graph without supervision, by optimizing the objective in Eq. $\textcircled{5}$ . ii) After that, we freeze the parameters of the encoder and obtain all the nodes’ embeddings, which are subsequently fed into a linear classifier (i.e., a logistic regression model) to generate a predicted label for each node. In the second stage, only nodes in training set are used for training the classifier, and we report the classification accuracy on testing nodes.
+
+We implement the model with PyTorch. All experiments are conducted on a NVIDIA V100 GPU with 16 GB memory. We use the Adam optimizer $\mathbb { B }$ for both stages. The graph encoder $f _ { \theta }$ is specified as a standard two-layer GCN model $\pmb { \mathbb { Z } } 2 \mathbf { l }$ for all the datasets except citeseer (where we empirically find that a one-layer GCN is better). We report the mean accuracy with a standard deviation through 20 random initialization (on Coauthor CS, Coauthor Physics and Amazon Computer, Amazon-Photo, the split is also randomly generated). Detailed hyperparameter settings are in Appendix E.
+
+# 5.1 Comparison with Peer Methods
+
+We compare CCA-SSG with classical unsupervised models, Deepwalk $\mathbb { \lVert 3 2 \rVert }$ and GAE $\left[ \left[ 2 1 \right] \right]$ , and self-supervised models, DGI [48], MVGRL [15], GRACE [57] and GCA [58]. We also compare with supervised learning models, including MLP, Label Propagation (LP) [56], and supervised baselines GCN $[ [ 2 2 ] ]$ and GAT [47]3. The results of baselines are quoted from [15, 57, 58] if not specified.
+
+We report the node classification results of citation networks and other datasets in Table 2 and Table 3 respectively. As we can see, CCA-SSG outperforms both the unsupervised competitors and the fully supervised baselines on Cora and Pubmed, despite its simple architecture. On Citeseer, CCA-SSG achieves competitive results as of the most powerful baseline MVGRL. On four larger benchmarks, CCA-SSG also achieves the best performance in four datasets except Coauther-Physics. It is worth mentioning that we empirically find that on Coauthor-CS a pure 2-layer-MLP encoder is better than GNN models. This might because the graph-structured information is much less informative than the node features, presumably providing harmful signals for classification (in fact, on Coauthor-CS, linear models using merely node features can greatly outperform DeepWalk/DeepWalk+features).
+
+Table 3: Test accuracy on co-author and co-purchase networks. We report both mean accuracy and standard deviation. Results of baseline models are from [58].
+
+
Methods
Input
Computer
Photo
CS
Physics
Supervised GCN 22] Supervised GAT [47]
X,A,Y X,A,Y
86.51 ± 0.54 86.93 ± 0.29
92.42 ± 0.22 92.56 ± 0.35
93.03 ± 0.31 92.31 ± 0.24
95.65 ± 0.16 95.47 ± 0.15
prrrrssnren
Raw Features 4 Linear CCA [18] DeepWalk [32 DeepWalk + features GAE [21 DGI MVGRL [15] GRACE1 四 GCA1 [58] X,A
+
+1 GCA is essentially an enhanced version of GRACE by adopting adaptive augmentations. Both GRACE and GCA would suffer from out of memory on Coauthor-Physics using a GPU wth 16GB memory. The reported results are from authors’ papers using a 32GB GPU.
+
+# 5.2 Ablation Study and Scalability Comparison
+
+Effectiveness of invariance/decorrelation terms. We alter our loss by removing the invariance/decorrelation term respectively to study the effects of each component, with results reported in Table 4. We find that only using the invariance term will lead to merely performance drop instead of completely collapsed solutions. This is because node embeddings are normalized along the instance dimension to have a zero-mean and fixed-standard deviation, and the worst solution is no worse than dimensional collapse (i.e., all the embeddings lie in an line, and our decorrelation term can help to prevent it) instead of complete collapse (i.e., all the embeddings degenerate into a single point). As expected, only optimizing the decorrelation term will lead to poor result, as the model learns nothing meaningful but disentangled representation. In Appendix $\bigtriangledown$ we discuss the relationship between complete/dimensional collapse, when the two cases happen and how to avoid them.
+
+Effect of decorrelation intensity. We study how the intensity of feature decorrelation improves/degrades the performance by increasing the trade-off hyper-parameter $\lambda$ . Fig. $2$ shows test accuracy w.r.t. different $\lambda$ ’s on Cora, Citeseer and Pubmed. The performance benefits from a proper selection of $\lambda$ $( \mathrm { f r o m 0 . 0 0 0 5 }$ to 0.001 in our experiments). When $\lambda$ is too small, the decorrelation term does not work; if it is too large, the invariance term would be neglected, leading to serious performance degrade. An interesting finding is that even when $\lambda$ is very small or even equals to 0 (w/o $\mathcal { L } _ { d e c }$ in Table $\textcircled{4}$ , the test accuracy on Citeseer does not degrade as much as that on Cora and Citeseer. The reason is that node embeddings of Citeseer is already highly uncorrelated even without the decorrelation term. Appendix F visualizes the correlation matrices without/with decorrelations.
+
+Effect of embedding dimension. Fig. 3 shows the effect of the embedding dimension. Similar to contrastive methods [48, 15, 57, 58], CCA-SSG benefits from a large embedding dimension (compared with supervised learning), while the optimal embedding dimension of CCA-SSG (512 on most benchmarks) is a bit larger than other methods (usually 128 or 256). Yet, we notice a performance drop as the embedding dimension increases. We conjecture that the CCA is essentially a dimension-reduction method, the ideal embedding dimension ought to be smaller than the dimension of input. Hence we do not apply it on well-compressed datasets (e.g. ogbn-arXiv and ogbn-product).
+
+Scalability Comparison. Table 5 compares model size, training time (till the epoch that gives the highest evaluation accuracy) and memory cost of CCA-SSG with other methods, on Cora, Pubmed and Amazon-Computers. Overall, our method has fewer parameters, shorter training time, and fewer memory cost than MVGRL, GRACE and GCA in most cases. DGI is another simple and efficient model, but it yields much poorer performance. The results show that despite its simplicity and efficiency, our method achieves even better (or competitive) performance.
+
+Table 4: Ablation study of node classification accuracy $( \% )$ on the key components of CCA-SSG.
+
+
Variants
Cora Citeseer Pubmed
Baseline
84.2
73.1
81.6
w/o Ldec
79.1
72.2
75.3
w/o Linv
40.1
28.9
46.5
+
+
+Figure 2: Effect of $\lambda$ .
+
+
+Figure 3: Effect of $D$ .
+
+Table 5: Comparison of the number of parameters, training time for achieving the best performance, and the memory cost of different methods on Cora, Pubmed and Amazon-Computer. MVGRL on Pubmed and Computer requires subgraph sampling with graph size 4000. Others are full-graph.
+
+
Methods
Cora (N: 2,708)
Pubmed (N: 19,717)
Computer (N: 13,752)
#Paras
Time
Mem
#Paras
Time
Mem
#Paras
Time
Mem
DGI
1260K
6.4s
1.4G
782K
5.9s
1.9G
919K
14.1s
1.9G
MVGRL
1731K
26.9s
4.6G
775K
29s
5.4G
1049K
31.5s
5.5G
GRACE/GCA
997K
8.3s
1.7G
520K
756s
12.6G
273K
314s
7.6G
CCA-SSG(Ours)
997K
3.8s
1.6G
519K
9.6s
2.7G
656K
14.8s
2.5G
+
+# 6 Conclusion and Discussions
+
+In this paper, we have introduced CCA-SSG, a conceptually simple, efficient yet effective method for self-supervised representation learning on graphs, based on the idea of Canonical Correlation Analysis. Compared with contrastive methods, our model does not require additional components except random augmentations and a GNN encoder, whose effectiveness is justified in experiments.
+
+Limitations of the work. Despite the theoretical grounds and the promising experimental justifications, our method would suffer from several limitations. 1) The objective Eq. $\bar { ( 5 ) }$ is essentially performing dimension reduction, while SSL approach usually requires a large embedding dimension. As a result, our method might not work well on datasets where input data does not have a large feature dimension. 2) Like other augmentation based methods, CCA-SSG highly relies on a high-quality, informative and especially, label-invariant augmentations. However, the augmentations used in our model might not perfectly meet these requirements, and it remains an open problem how to generate informative graph augmentations that have non-negative impacts on the downstream tasks.
+
+Potential negative societal impacts. This work explores a simple pipeline for representation learning without large amount of labeled data. However, in industry there are many career workers whose responsibility is to label or annotate data. The proposed method might reduce the need for labeling data manually, and thus makes a few individuals unemployed (especially for developing countries and remote areas). Furthermore, our model might be biased, as it tends to pay more attention to the majority and dominant features (shared information across most of the data). The minority group whose features are scare are likely to be downplayed by the algorithm.
+
+# Acknowledgments and Disclosure of Funding
+
+This work was supported in part by NSF under grants III-1763325, III-1909323, III-2106758, and SaTC-1930941. Qitian Wu and Junchi Yan were partly supported by Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102). We thank Amazon Web Services for sponsoring computation resources for this work.
+
+# References
+
+[1] Rana Ali Amjad and Bernhard C. Geiger. Learning representations for neural network-based classification using the information bottleneck principle. IEEE Trans. Pattern Anal. Mach.
+
+Intell., 42(9):2225–2239, 2020.
+[2] Galen Andrew, Raman Arora, Jeff A. Bilmes, and Karen Livescu. Deep canonical correlation analysis. In ICML, volume 28, pages 1247–1255, 2013.
+[3] Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In International Conference on Machine Learning, pages 531–540, 2018.
+[4] Xiaobin Chang, Tao Xiang, and Timothy M. Hospedales. Scalable and effective deep CCA via soft decorrelation. In CVPR, pages 1488–1497, 2018.
+[5] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, Proceedings of Machine Learning Research, pages 1597–1607, 2020.
+[6] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566, 2020.
+[7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL, pages 4171–4186, 2019.
+[8] Aleksandr Ermolov, Aliaksandr Siarohin, Enver Sangineto, and Nicu Sebe. Whitening for self-supervised representation learning. arXiv preprint arXiv:2007.06346, 2020.
+[9] Marco Federici, Anjan Dutta, Patrick Forré, Nate Kushman, and Zeynep Akata. Learning robust representations via multi-view information bottleneck. In ICLR, 2020.
+[10] Gene H Golub and Hongyuan Zha. The canonical correlations of matrix pairs and their numerical computation. Linear algebra for signal processing, pages 27–29, 1995.
+[11] Yunchao Gong, Qifa Ke, Michael Isard, and Svetlana Lazebnik. A multi-view embedding space for modeling internet images, tags, and their semantics. Int. J. Comput. Vis., 106(2):210–233, 2014.
+[12] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Ávila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent - A new approach to self-supervised learning. In NeurIPS, 2020.
+[13] Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010.
+[14] David R. Hardoon, Sándor Szedmák, and John Shawe-Taylor. Canonical correlation analysis: An overview with application to learning methods. Neural Comput., 16(12):2639–2664, 2004.
+[15] Kaveh Hassani and Amir Hosein Khas Ahmadi. Contrastive multi-view representation learning on graphs. In ICML, volume 119 of Proceedings of Machine Learning Research, pages 4116– 4126. PMLR, 2020.
+[16] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, pages 9726–9735, 2020.
+[17] R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019.
+[18] Harold Hotelling. Relations between two sets of variates. Biometrika, 28:322–377, 1936.
+[19] Tianyu Hua, Wenxiao Wang, Zihui Xue, Yue Wang, Sucheng Ren, and Hang Zhao. On feature decorrelation in self-supervised learning. arXiv preprint arXiv:2105.00470, 2021.
+[20] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+[21] Thomas N. Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016.
+[22] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
+[23] Johannes Klicpera, Stefan Weißenberger, and Stephan Günnemann. Diffusion improves graph learning. In NeurIPS, pages 13333–13345, 2019.
+[24] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In AAAI, volume 32, 2018.
+[25] Yunfan Li, Peng Hu, Jerry Zitao Liu, Dezhong Peng, Joey Tianyi Zhou, and Xi Peng. Contrastive clustering. arXiv preprint arXiv:2009.09687, 2020.
+[26] Julian J. McAuley, Christopher Targett, Qinfeng Shi, and Anton van den Hengel. Image-based recommendations on styles and substitutes. In SIGIR, pages 43–52, 2015.
+[27] Jin Ming, Zheng Yizhen, Li Yuan-Fang, Gong Chen, Zhou Chuan, and Pan Shirui. Multiscalecontrastive siamese networks for self-supervised graph representation learning. In IJCAI, 2021.
+[28] Xu Minghao, Wang Hang, Ni Bingbing, Guo Hongyu, and Tang Jian. Self-supervised graphlevelrepresentation learning with local and global structure. In ICML, 2021.
+[29] Galileo Namata, Ben London, Lise Getoor, Bert Huang, and UMD EDU. Query-driven active surveying for collective classification. In 10th International Workshop on Mining and Learning with Graphs, volume 8, 2012.
+[30] Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In NIPS, pages 271–279, 2016.
+[31] Zhen Peng, Wenbing Huang, Minnan Luo, Qinghua Zheng, Yu Rong, Tingyang Xu, and Junzhou Huang. Graph representation learning via graphical mutual information maximization. In WWW, pages 259–270, 2020.
+[32] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: online learning of social representations. In KDD, pages 701–710. ACM, 2014.
+[33] Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, and Jie Tang. GCC: graph contrastive coding for graph neural network pre-training. In KDD, pages 1150–1160, 2020.
+[34] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
+[35] Arnab Sinha, Zhihong Shen, Yang Song, Hao Ma, Darrin Eide, Bo-June Paul Hsu, and Kuansan Wang. An overview of microsoft academic service (MAS) and applications. In WWW, pages 243–246, 2015.
+[36] Karthik Sridharan and Sham M. Kakade. An information theoretic framework for multi-view learning. In COLR, pages 403–414. Omnipress, 2008.
+[37] DJ Strouse and David J. Schwab. The deterministic information bottleneck. In UAI, 2016.
+[38] Fan-Yun Sun, Jordan Hoffmann, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In ICLR, 2020.
+[39] Shantanu Thakoor, Corentin Tallec, Mohammad Gheshlaghi Azar, Rémi Munos, Petar Velickovic, and Michal Valko. Bootstrapped representation learning on graphs. arXiv preprint arXiv:2102.06514, 2021.
+[40] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, pages 776–794, 2020.
+[41] Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. arXiv preprint arXiv:2102.06810, 2021.
+[42] Yuandong Tian, Lantao Yu, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020.
+[43] Naftali Tishby, Fernando C. N. Pereira, and William Bialek. The information bottleneck method. arXiv preprint physics/0004057, 2000.
+[44] Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In ITW, pages 1–5, 2015.
+[45] Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Selfsupervised learning from a multi-view perspective. In ICLR, 2021.
+[46] Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+[47] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In ICLR, 2018.
+[48] Petar Velickovic, William Fedus, William L. Hamilton, Pietro Liò, Yoshua Bengio, and R. Devon Hjelm. Deep graph infomax. In ICLR, 2019.
+[49] Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, Ziyue Huang, Qipeng Guo, Hao Zhang, Haibin Lin, Junbo Zhao, Jinyang Li, Alexander J. Smola, and Zheng Zhang. Deep graph library: Towards efficient and scalable deep learning on graphs. arXiv, 1909.01315, 2019.
+[50] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, pages 9929–9939, 2020.
+[51] Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In ICLR, 2021.
+[52] Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In NeurIPS, 2020.
+[53] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Selfsupervised learning via redundancy reduction. In ICML, 2021.
+[54] Jiaqi Zeng and Pengtao Xie. Contrastive self-supervised learning for graph classification. arXiv preprint arXiv:2009.05923, 2020.
+[55] Hanlin Zhang, Shuai Lin, Weiyang Liu, Pan Zhou, Jian Tang, Xiaodan Liang, and Eric P Xing. Iterative graph self-distillation. arXiv preprint arXiv:2010.12609, 2020.
+[56] Xiaojin Zhu, Zoubin Ghahramani, and John D. Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In ICML, pages 912–919, 2003.
+[57] Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, and Liang Wang. Deep graph contrastive representation learning. arXiv preprint arXiv:2006.04131, 2020.
+[58] Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, and Liang Wang. Graph contrastive learning with adaptive augmentation. In WWW, 2021.
+
+# Checklist
+
+1. For all authors...
+
+(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
+(b) Did you describe the limitations of your work? [Yes] See Section 6.
+(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
+(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
+
+2. If you are including theoretical results...
+
+(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Assumption 1 and Assumption 2. (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix D.
+
+3. If you ran experiments...
+
+(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental material.
+(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix E.
+(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 5.
+(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 5.
+
+4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
+
+(a) If your work uses existing assets, did you cite the creators? [Yes] See Appendix E.3.
+(b) Did you mention the license of the assets? [Yes] See Appendix E.3.
+(c) Did you include any new assets either in the supplemental material or as a URL? [No]
+(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] The data used for experiments are all publicly available.
+(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] The data we used contain no personally indentifiable information nor offensive content.
+
+5. If you used crowdsourcing or conducted research with human subjects...
+
+(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
+(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
+(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
\ No newline at end of file
diff --git a/md/train/YCqx6zhEzRp/YCqx6zhEzRp.md b/md/train/YCqx6zhEzRp/YCqx6zhEzRp.md
new file mode 100644
index 0000000000000000000000000000000000000000..d8d1c72ead35fb97f50891424f2ac78faccb010a
--- /dev/null
+++ b/md/train/YCqx6zhEzRp/YCqx6zhEzRp.md
@@ -0,0 +1,332 @@
+# Federated Multi-Task Learning under a Mixture of Distributions
+
+Othmane Marfoq1,3, Giovanni Neglia1, Aurélien Bellet2, Laetitia Kameni3, and Richard Vidal3
+
+1Inria, Université Côte d’Azur, France, {othmane.marfoq, giovanni.neglia} $@$ inria.fr 2Inria, Université de Lille, France, aurelien.bellet $@$ inria.fr 3Accenture Labs, France, {richard.vidal, laetitia.kameni} $@$ accenture.com
+
+# Abstract
+
+The increasing size of data generated by smartphones and IoT devices motivated the development of Federated Learning (FL), a framework for on-device collaborative training of machine learning models. First efforts in FL focused on learning a single global model with good average performance across clients, but the global model may be arbitrarily bad for a given client, due to the inherent heterogeneity of local data distributions. Federated multi-task learning (MTL) approaches can learn personalized models by formulating an opportune penalized optimization problem. The penalization term can capture complex relations among personalized models, but eschews clear statistical assumptions about local data distributions.
+
+In this work, we propose to study federated MTL under the flexible assumption that each local data distribution is a mixture of unknown underlying distributions. This assumption encompasses most of the existing personalized FL approaches and leads to federated EM-like algorithms for both client-server and fully decentralized settings. Moreover, it provides a principled way to serve personalized models to clients not seen at training time. The algorithms’ convergence is analyzed through a novel federated surrogate optimization framework, which can be of general interest. Experimental results on FL benchmarks show that our approach provides models with higher accuracy and fairness than state-of-the-art methods.
+
+# 1 Introduction
+
+Federated Learning (FL) [28] allows a set of clients to collaboratively train models without sharing their local data. Standard FL approaches train a unique model for all clients [47, 32, 38, 29, 48]. However, as discussed in [56], the existence of such a global model suited for all clients is at odds with the statistical heterogeneity observed across different clients [37, 28]. Indeed, clients can have non-iid data and varying preferences. Consider for example a language modeling task: given the sequence of tokens $^ { 6 6 } I$ love eating,” the next word can be arbitrarily different from one client to another. Thus, having personalized models for each client is a necessity in many FL applications.
+
+Previous work on personalized FL. A naive approach for FL personalization consists in learning first a global model and then fine-tuning its parameters at each client via a few iterations of stochastic gradient descent [58]. In this case, the global model plays the role of a meta-model to be used as initialization for few-shot adaptation at each client. In particular, the connection between FL and Model Agnostic Meta Learning (MAML) [27] has been studied in [19, 30, 1] in order to build a more suitable meta-model for local personalization. Unfortunately, these methods can fail to build a model with low generalization error (as exemplified by LEAF synthetic dataset [7, App. 1]). An alternative approach is to jointly train a global model and one local model per client and then let each client build a personalized model by interpolating them [14, 9, 44]. However, if local distributions are far from the average distribution, a relevant global model does not exist and this approach boils down to every client learning only on its own local data. This issue is formally captured by the generalization bound in [14, Theorem 1].
+
+Clustered FL [56, 20, 44] addresses the potential lack of a global model by assuming that clients can be partitioned into several clusters. Clients belonging to the same cluster share the same optimal model, but those models can be arbitrarily different across clusters (see [56, Assumption 2] for a rigorous formulation). During training, clients learn the cluster to which they belong as well as the cluster model. The Clustered FL assumption is also quite limiting, as no knowledge transfer is possible across clusters. In the extreme case where each client has its own optimal local model (recall the example on language modeling), the number of clusters coincides with the number of clients and no federated learning is possible.
+
+Multi-Task Learning (MTL) has recently emerged as an alternative approach to learn personalized models in the federated setting and allows for more nuanced relations among clients’ models [59, 63, 67, 24, 16]. The authors of [59, 63] were the first to frame FL personalization as a MTL problem. In particular, they defined federated MTL as a penalized optimization problem, where the penalization term models relationships among tasks (clients). The work [59] proposed the MOCHA algorithm for the client-server scenario, while [63, 67] presented decentralized algorithms for the same problem. Unfortunately, these algorithms can only learn simple models (linear models or linear combination of pre-trained models), because of the complex penalization term. Other MTL-based approaches [24, 23, 16, 26, 36] are able to train more general models at the cost of considering simpler penalization terms (e.g., the distance to the average model), thereby losing the capability to capture complex relations among tasks. Moreover, a general limitation of this line of work is that the penalization term is justified qualitatively and not on the basis of clear statistical assumptions on local data distributions.
+
+More recently, [57] proposed pFedHN. pFedHN feeds local clients’ representations to a global (across clients) hypernetwork, which can output personalized heterogeneous models. Unfortunately, the hypernetwork has a large memory footprint already for small clients’ models (e.g., the hypernetwork in the experiments in [57] has 100 more parameters than the output model). Hence, it is not clear if pFedHN can scale to more complex models. Moreover, pFedHN requires each client to communicate multiple times for the server to learn meaningful representations. Therefore, its performance is likely to deteriorate when clients participate only once (or few times) to training, as it is the case for large-scale cross-device FL training. Furthermore, even once the hypernetwork parameters have been learned, training personalized models for new clients still requires multiple client-server communication rounds. More similar to our approach, FedFOMO [68] lets each client interpolate other clients’ local models with opportune weights learned during training. However, this method lacks both theoretical justifications for such linear combinations and convergence guarantees. Moreover, FedFOMO requires the presence of a powerful server able to 1) store all individual local models and 2) learn for each client—through repeated interactions—which other clients’ local models may be useful. Therefore, FedFOMO is not suited for cross-device FL where the number of clients may be very large (e.g., $\mathrm { 1 0 ^ { 5 } - 1 0 ^ { 7 } }$ participating clients [28, Table 2]) and a given client may only participate in a single training round.
+
+Overall, although current personalization approaches can lead to superior empirical performance in comparison to a shared global model or individually trained local models, it is still not well understood whether and under which conditions clients are guaranteed to benefit from collaboration.
+
+Our contributions. In this work, we first show that federated learning is impossible without assumptions on local data distributions. Motivated by this negative result, we formulate a general and flexible assumption: the data distribution of each client is a mixture of $M$ underlying distributions. The proposed formulation has the advantage that each client can benefit from knowledge distilled from all other clients’ datasets (even if any two clients can be arbitrarily different from each other). We also show that this assumption encompasses most of the personalized FL approaches previously proposed in the literature.
+
+In our framework, a personalized model is a linear combination of $M$ shared component models. All clients jointly learn the $M$ components, while each client learns its personalized mixture weights. We show that federated EM-like algorithms can be used for training. In particular, we propose FedEM and D-FedEM for the client-server and the fully decentralized settings, respectively, and we prove convergence guarantees. Our approach also provides a principled and efficient way to infer personalized models for clients unseen at training time. Our algorithms can easily be adapted to solve more general problems in a novel framework, which can be seen as a federated extension of the centralized surrogate optimization approach in [43]. To the best of our knowledge, our paper is the first work to propose federated surrogate optimization algorithms with convergence guarantees.
+
+Through extensive experiments on FL benchmark datasets, we show that our approach generally yields models that 1) are on average more accurate, 2) are fairer across clients, and 3) generalize better to unseen clients than state-of-the-art personalized and non-personalized FL approaches.
+
+Paper outline. The rest of the paper is organized as follows. In Section 2 we provide our impossibility result, introduce our main assumptions, and show that several popular personalization approaches can be obtained as special cases of our framework. Section 3 describes our algorithms, states their convergence results, and presents our general federated surrogate optimization framework. Finally, we provide experimental results in Section 4 before concluding in Section 5.
+
+# 2 Problem Formulation
+
+We consider a (countable) set $\tau$ of classification (or regression) tasks which represent the set of possible clients. We will use the terms task and client interchangeably. Data at client $t \in \mathcal { T }$ is generated according to a local distribution $\mathcal { D } _ { t }$ over $\mathcal { X } \times \mathcal { V }$ . Local data distributions $\{ \mathcal { D } _ { t } \} _ { t \in \mathcal { T } }$ are in general different, thus it is natural to fit a separate model (hypothesis) $h _ { t } \in { \mathcal { H } }$ to each data distribution $\mathcal { D } _ { t }$ . The goal is then to solve (in parallel) the following optimization problems
+
+$$
+\forall t \in { \mathcal { T } } , \quad \operatorname* { m i n i m i z e } _ { h _ { t } \in { \mathcal { H } } } { \mathcal { L } } _ { { \mathcal { D } } _ { t } } ( h _ { t } ) ,
+$$
+
+where $h _ { t } : \mathcal { X } \mapsto \Delta ^ { | \mathcal { V } | }$ $\Delta ^ { D }$ denoting the unitary simplex of dimension $D$ ), $l : \Delta ^ { | y | } \times \mathcal { Y } \mapsto \mathbb { R } ^ { + }$ is a loss function,1 and $\mathcal { L } _ { \mathcal { D } _ { t } } ( h _ { t } ) = \mathbb { E } _ { ( \mathbf { x } , y ) \sim \mathcal { D } _ { t } } ^ { - } \left[ l ( \bar { h } _ { t } ( \mathbf { x } ) , \bar { y } ) \right]$ is the true risk of a model $h _ { t }$ under data distribution $\mathcal { D } _ { t }$ . For $( \mathbf { x } , y ) \in \mathcal { X } \times \mathcal { Y }$ , we will denote the joint distribution density associated to $\mathcal { D } _ { t }$ by $p _ { t } ( \mathbf { x } , y )$ , and the marginal densities by $p _ { t } ( \mathbf { x } )$ and $p _ { t } ( y )$ .
+
+A set of $T$ clients $[ T ] \triangleq \{ 1 , 2 , . . . T \} \subseteq \mathcal { T }$ participate to the initial training phase; other clients may e system in a late drawn i.i.d. from age. We, and by $S _ { t } = \{ s _ { t } ^ { ( i ) } = ( \mathbf { x } _ { t } ^ { ( i ) } , \ y _ { t } ^ { ( i ) } ) \} _ { i = 1 } ^ { n _ { t } }$ the dataset at client $t \in [ T ]$ $\mathcal { D } _ { t }$ $\begin{array} { r } { n = \sum _ { t = 1 } ^ { T } n _ { t } } \end{array}$
+
+The idea of federated learning is to enable each client to benefit from data samples available at other clients in order to get a better estimation of $\mathcal { L } _ { \mathcal { D } _ { t } }$ , and therefore get a model with a better generalization ability to unseen examples.
+
+# 2.1 An Impossibility Result
+
+We start by showing that some assumptions on the local distributions $p _ { t } ( \mathbf x , y ) , t \in \mathcal T$ are needed for federated learning to be possible, i.e., for each client to be able to take advantage of the data at other clients. This holds even if all clients participate to the initial training phase (i.e., $\mathcal { T } = [ T ] )$ .
+
+We consider the classic PAC learning framework where we fix a class of models $\mathcal { H }$ and seek a learning algorithm which is guaranteed, for all possible data distributions over $\mathcal { X } \times \mathcal { V }$ , to return with high probability a model with expected error $\epsilon$ -close to the best possible error in the class $\mathcal { H }$ . The worst-case sample complexity then refers to the minimum amount of labeled data required by any algorithm to reach a given $\epsilon$ -approximation.
+
+Our impossibility result for FL is based on a reduction to an impossibility result for Semi-Supervised Learning (SSL), which is the problem of learning from a training set with only a small amount of labeled data. The authors of [4] conjectured that, when the quantity of unlabeled data goes to infinity, the worst-case sample complexity of SSL improves over supervised learning at most by a constant factor that only depends on the hypothesis class [4, Conjecture 4]. This conjecture was later proved for the realizable case and hypothesis classes of finite VC dimension [13, Theorem 1], even when the marginal distribution over the domain set $\mathcal { X }$ is known [21, Theorem 2]. 2
+
+In the context of $\mathrm { F L }$ , if the marginal distributions $p _ { t } \left( \mathbf { x } \right)$ are identical, but the conditional distributions $p _ { t } \left( y | \mathbf { x } \right)$ can be arbitrarily different, then each client $t$ can learn using: 1) its own local labeled dataset, and 2) the other clients’ datasets, but only as unlabeled ones (because their labels have no relevance for $t$ ). The FL problem, with $T$ clients, then reduces to $T$ parallel SSL problems, or more precisely, it is at least as difficult as $T$ parallel SSL problems (because client $t$ has no direct access to the other local datasets but can only learn through the communication exchanges allowed by the FL algorithm). The SSL impossibility result implies that, without any additional assumption on the local distributions $p _ { t } \left( \mathbf { x } , y \right)$ , $t \in [ T ]$ , any FL algorithm can reduce the sample complexity of client- $\mathbf { \nabla } \cdot t$ ’s problem in (1) only by a constant in comparison to local learning, independently of how many other clients participate to training and how large their datasets’ sizes are.
+
+# 2.2 Learning under a Mixture Model
+
+Motivated by the above impossibility result, in this work we propose to consider that each local data distribution $\mathcal { D } _ { t }$ is a mixture of $M$ underlying distributions $\tilde { \mathcal { D } } _ { m }$ , $1 \leq m \leq M$ , as formalized below.
+
+Assumption 1. There exist $M$ underlying (independent) distributions $\tilde { \mathcal { D } } _ { m }$ , $1 \leq m \leq M$ , such that for $t \in \tau$ , $\mathcal { D } _ { t }$ is mixture of the distributions $\{ \tilde { \mathcal { D } } _ { m } \} _ { m = 1 } ^ { M }$ with weights $\pi _ { t } ^ { * } = [ \pi _ { t 1 } ^ { * } , \ldots , \pi _ { t M } ^ { * } ] \in \Delta ^ { M }$ , i.e.
+
+$$
+z _ { t } \sim \mathcal { M } ( \pi _ { t } ^ { * } ) , \quad ( ( \mathbf { x } _ { t } , y _ { t } ) | z _ { t } = m ) \sim \tilde { \mathcal { D } } _ { m } , \quad \forall t \in \mathcal { T } ,
+$$
+
+where $\mathcal { M } ( \pi )$ is a multinomial (categorical) distribution with parameters $\pi$ .
+
+Similarly to what was done above, we use $p _ { m } ( \mathbf { x } , y )$ , $p _ { m } ( \mathbf { x } )$ , and $p _ { m } ( y )$ to denote the probability distribution densities associated to $\tilde { \mathcal { D } } _ { m }$ . We further assume that marginals over $\mathcal { X }$ are identical.
+
+Assumption 2. For all $m \in [ M ]$ , we have $p _ { m } ( \mathbf { x } ) = p ( \mathbf { x } )$ .
+
+Assumption 2 is not strictly required for our analysis to hold, but, in the most general case, solving Problem (1) requires to learn generative models. Instead, under Assumption 2 we can restrict our attention to discriminative models (e.g., neural networks). 3 More specifically, we consider a parameterized set of models $\tilde { \mathcal { H } }$ with the following properties.
+
+Assumption 3. $\tilde { \mathcal { H } } = \{ h _ { \theta } \} _ { \theta \in \mathbb { R } ^ { d } }$ is a set of hypotheses parameterized by $\theta \in \mathbb { R } ^ { d }$ , whose convex hull is in $\mathcal { H }$ . For each distribution $\tilde { \mathcal { D } } _ { m }$ with $m \in [ M ]$ , there exists a hypothesis $h _ { \theta _ { m } ^ { * } }$ , such that
+
+$$
+\begin{array} { r } { l \left( h _ { \theta _ { m } ^ { * } } ( \mathbf { x } ) , y \right) = - \log p _ { m } ( y | \mathbf { x } ) + c , } \end{array}
+$$
+
+where $c \in \mathbb { R }$ is a normalization constant. The function $l ( \cdot , \cdot )$ is then the log-loss associated to $p _ { m } ( y | \mathbf { x } )$ .
+
+We refer to the hypotheses in $\tilde { \mathcal { H } }$ as component models or simply components. We denote by $\Theta ^ { * } \in \mathbb { R } ^ { M \times d }$ the matrix whose $m$ -th row is $\theta _ { m } ^ { * }$ , and by $\Pi ^ { * } \in \Delta ^ { T \times } { \bar { M } }$ the matrix whose $t$ -th row is $\pi _ { t } ^ { * } \in \Delta ^ { M }$ . Similarly, we will use $\Theta$ and $\Pi$ to denote arbitrary parameters.
+
+Remark 1. Assumptions 2–3 are mainly technical and are not required for our approach to work in practice. Experiments in Section 4 show that our algorithms perform well on standard $F L$ benchmark datasets, for which these assumptions do not hold in general.
+
+Note that, under the above assumptions, $p _ { t } ( \mathbf { x } , y )$ depends on $\Theta ^ { * }$ and $\pi _ { t } ^ { * }$ . Moreover, we can prove (see App. A) that the optimal local model $h _ { t } ^ { * } \in \mathcal { H }$ for client $t$ is a weighted average of models in $\tilde { \mathcal { H } }$ . Proposition 2.1. Let $l ( \cdot , \cdot )$ be the mean squared error loss, the logistic loss or the cross-entropy loss, and $\breve { \Theta }$ and $\breve { \Pi }$ be a solution of the following optimization problem:
+
+$$
+\underset { \Theta , \Pi } { \mathrm { m i n i m i z e } } \underset { t \sim D _ { T } } { \mathbb { E } } \underset { ( \mathbf { x } , y ) \sim D _ { t } } { \mathbb { E } } \left[ - \log p _ { t } ( \mathbf { x } , y | \Theta , \pi _ { t } ) \right] ,
+$$
+
+where $D _ { \mathcal { T } }$ is any distribution with support $\tau$ . Under Assumptions $^ { l }$ , 2, and $^ 3$ , the predictors
+
+$$
+h _ { t } ^ { * } = \sum _ { m = 1 } ^ { M } \breve { \pi } _ { t m } h _ { { \breve { \theta } } _ { m } } \left( \mathbf { x } \right) , \quad \forall t \in \mathcal { T }
+$$
+
+minimize $\mathbb { E } _ { ( \mathbf { x } , y ) \sim \mathcal { D } _ { t } } \left[ l ( h _ { t } ( \mathbf { x } ) , y ) \right]$ and thus solve Problem (1).
+
+Proposition 2.1 suggests the following approach to solve Problem (1). First, we estimate the parameters $\breve { \Theta }$ and $\breve { \pi } _ { t }$ , $1 \leq t \leq T$ , by minimizing the empirical version of Problem (4) on the training data, i.e., minimizing:
+
+$$
+f ( \Theta , \Pi ) \triangleq - \frac { \log p ( \mathcal { S } _ { 1 : T } | \Theta , \Pi ) } { n } \triangleq - \frac { 1 } { n } \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { n _ { t } } \log p ( s _ { t } ^ { ( i ) } | \Theta , \pi _ { t } ) ,
+$$
+
+which is the (negative) likelihood of the probabilistic model (2). 4 Second, we use (5) to get the client predictor for the $T$ clients present at training time. Finally, to deal with a client $t _ { \mathrm { n e w } } \notin [ T ]$ not seen during training, we keep the mixture component models fixed and simply choose the weights $\pi _ { t _ { \mathrm { n e w } } }$ that maximize the likelihood of the client data and get the client predictor via (5).
+
+# 2.3 Generalizing Existing Frameworks
+
+Before presenting our federated learning algorithms in Section 3, we show that the generative model in Assumption 1 extends some popular multi-task/personalized FL formulations in the literature.
+
+Clustered Federated Learning [56, 20] assumes that each client belongs to one among $C$ clusters and proposes that all clients in the same cluster learn the same model. Our framework recovers this scenario considering $M = C$ and $\pi _ { t c } ^ { * } = 1$ if task (client) $t$ is in cluster $c$ and $\pi _ { t c } ^ { * } = 0$ otherwise.
+
+Personalization via model interpolation [44, 14] relies on learning a global model $h _ { \mathrm { g l o b } }$ and $T$ local models $h _ { \mathrm { l o c } , t }$ , and then using at each client the linear interpolation $h _ { t } = \alpha _ { t } h _ { \mathrm { l o c } , t } + ( 1 - \alpha _ { t } ) h _ { \mathrm { g l o b } }$ . Each client model can thus be seen as a linear combination of $M = T + 1$ models $h _ { m } = h _ { { \mathrm { l o c } } , m }$ for $m \in [ T ]$ and $h _ { 0 } = h _ { \mathrm { g l o b } }$ with specific weights $\pi _ { t t } ^ { * } = \alpha _ { t }$ , $\pi _ { t 0 } ^ { * } = 1 - \alpha _ { t }$ , and $\pi _ { t t ^ { \prime } } ^ { * } = 0$ for $t ^ { \prime } \in [ T ] \backslash \{ t \}$ .
+
+Federated MTL via task relationships. The authors of [59] proposed to learn personalized models by solving the following optimization problem inspired from classic MTL formulations:
+
+$$
+\operatorname* { m i n } _ { W , \Omega } \ \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { n _ { t } } l ( h _ { w _ { t } } ( \mathbf { x } _ { t } ^ { ( i ) } ) , y _ { t } ^ { ( i ) } ) + \lambda \mathrm { t r } \left( W \Omega W ^ { \intercal } \right) ,
+$$
+
+where $h _ { w _ { t } }$ are linear predictors parameterized by the rows of matrix $W$ and the matrix $\Omega$ captures task relationships (similarity). This formulation is motivated by the alternating structure optimization method (ASO) [2, 70]. In App. B, we show that, when predictors $h _ { \theta _ { m } ^ { * } }$ are linear and have bounded norm, our framework leads to the same ASO formulation that motivated Problem (7). Problem (7) can also be justified by probabilistic priors [69] or graphical models [35] (see [59, App. B.1]). Similar considerations hold for our framework (see again App. B). Reference [67] extends the approach in [59] by letting each client learn a personalized model as a weighted combination of $M$ known hypotheses. Our approach is more general and flexible as clients learn both the weights and the hypotheses. Finally, other personalized FL algorithms, like pFedMe [16], FedU [17], and those studied in [24] and in [23], can be framed as special cases of formulation (7). Their assumptions can thus also be seen as a particular case of our framework.
+
+# 3 Federated Expectation-Maximization
+
+# 3.1 Centralized Expectation-Maximization
+
+Our goal is to estimate the optimal components’ parameters $\Theta ^ { * } \ = \ ( \theta _ { m } ^ { * } ) _ { 1 \leq m \leq M }$ and mixture weights $\Pi ^ { * } = ( \pi _ { t } ^ { * } ) _ { 1 \leq t \leq T }$ by minimizing the negative log-likelihood $f ( \Theta , \bar { \Pi } )$ in (6). A natural approach to solve such non-convex problems is the Expectation-Maximization algorithm (EM), which alternates between two steps. Expectation steps update the distribution (denoted by $q _ { t }$ ) over the latent variables $\boldsymbol { z } _ { t } ^ { ( i ) }$ for every data point $s _ { t } ^ { ( i ) } = ( \mathbf { x } _ { t } ^ { ( i ) } , y _ { t } ^ { ( i ) } )$ given the current estimates of the parameters $\{ \Theta , \Pi \}$ . Maximization steps update the parameters $\{ \Theta , \Pi \}$ by maximizing the expected log-likelihood, where the expectation is computed according to the current latent variables’ distributions.
+
+The following proposition provides the EM updates for our problem (proof in App. C).
+
+Proposition 3.1. Under Assumptions $I$ and 2, at the $k$ -th iteration the EM algorithm updates parameter estimates through the following steps:
+
+$$
+\begin{array} { r l r } { { q _ { t } ^ { k + 1 } ( z _ { t } ^ { ( i ) } = m ) \propto \pi _ { t m } ^ { k } \cdot \exp ( - l ( h _ { \theta _ { m } ^ { k } } ( \mathbf { x } _ { t } ^ { ( i ) } ) , y _ { t } ^ { ( i ) } ) ) , } } & { t \in [ T ] , m \in [ M ] , i \in [ n _ { t } ] } \\ & { } & \\ & { \pi _ { t m } ^ { k + 1 } = \frac { \sum _ { i = 1 } ^ { n _ { t } } q _ { t } ^ { k + 1 } ( z _ { t } ^ { ( i ) } = m ) } { n _ { t } } , } & { t \in [ T ] , m \in [ M ] } \\ & { } & \\ & { \theta _ { m } ^ { k + 1 } \in \arg \operatorname* { m i n } _ { \theta \in \mathbb { R } ^ { d } } \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { n _ { t } } q _ { t } ^ { k + 1 } ( z _ { t } ^ { ( i ) } = m ) l \big ( h _ { \theta } ( \mathbf { x } _ { t } ^ { ( i ) } ) , y _ { t } ^ { ( i ) } \big ) , } & { m \in [ M ] } \end{array}
+$$
+
+The EM updates in Proposition 3.1 have a natural interpretation. In the $\mathrm { E }$ -step, given current component models $\Theta ^ { k }$ and mixture weights $\Pi ^ { k }$ , (8) updates the a-posteriori probability $q _ { t } ^ { k + 1 } ( z _ { t } ^ { ( i ) } =$ $m$ ) that point $s _ { t } ^ { ( i ) }$ of client $t$ was drawn from the $m$ -th distribution based on the current mixture weight $\pi _ { t m } ^ { k }$ and on how well the corresponding component $\theta _ { m } ^ { k }$ classifies $s _ { t } ^ { ( i ) }$ . The M-step consists of two updates under fixed probabilities $q _ { t } ^ { k + 1 }$ . First, (9) updates the mixture weights $\pi _ { t } ^ { k + 1 }$ to reflect the prominence of each distribution $\tilde { \mathcal { D } } _ { m }$ in $S _ { t }$ as given by $q _ { t } ^ { k + 1 }$ . Finally, (10) updates the components’ parameters $\Theta ^ { k + 1 }$ by solving $M$ independent, weighted empirical risk minimization problems with weights given by $q _ { t } ^ { k + 1 }$ . These weights aim to construct an unbiased estimate of the true risk over each underlying distribution $\tilde { \mathcal { D } } _ { m }$ using only points sampled from the client mixtures, similarly to importance sampling strategies used to learn from data with sample selection bias [61, 11, 10, 64].
+
+# 3.2 Client-Server Algorithm
+
+Federated learning aims to train machine learning models directly on the clients, without exchanging raw data, and thus we should run EM while assuming that only client $t$ has access to dataset $S _ { t }$ . The E-step (8) and the $\Pi$ update (9) in the M-step operate separately on each local dataset $S _ { t }$ and can thus be performed locally at each client $t$ . On the contrary, the $\Theta$ update (10) requires interaction with other clients, since the computation spans all data samples $\mathcal { S } _ { 1 : T }$ .
+
+In this section, we consider a client-server setting, in which each client $t$ can communicate only with a centralized server (the orchestrator) and wants to learn components’ parameters $\Theta ^ { * } = \left( \theta _ { m } ^ { * } \right) _ { 1 \leq m \leq M }$ and its own mixture weights $\pi _ { t } ^ { * }$ .
+
+We propose the algorithm FedEM for Federated Expectation-Maximization (Alg. 1). FedEM proceeds through communication rounds similarly to most FL algorithms including FedAvg [47], FedProx [38], SCAFFOLD [29], and pFedMe [16]. At each round, 1) the central server broadcasts the (shared) component models to the clients, 2) each client locally updates components and its personalized mixture weights, and 3) sends the updated components back to the server, 4) the server aggregates the updates. The local update performed at client $t$ consists in performing the steps in (8) and (9) and updating the local estimates of $\theta _ { m }$ through a solver which approximates the exact minimization in (10) using only the local dataset $S _ { t }$ (see line 7). FedEM can operate with different local solvers—even different across clients—as far as they satisfy some local improvement guarantees (see the discussion in App. H). In what follows, we restrict our focus on the practically important case where the local solver performs multiple stochastic gradient descent updates (local SGD [60]). Under the following standard assumptions (see e.g., [66]), FedEM converges to a stationary point of $f$ . Below, we use the more compact notation $l ( \boldsymbol { \theta } ; s _ { t } ^ { ( i ) } ) \triangleq l ( h _ { \boldsymbol { \theta } } ( \mathbf { x } _ { t } ^ { ( i ) } ) , y _ { t } ^ { ( i ) } )$ .
+
+Assumption 4. The negative log-likelihood $f$ is bounded below by $f ^ { * } \in \mathbb { R }$ .
+
+Assumption 5. (Smoothness) For all $t \in [ T ]$ and $i \in [ n _ { t } ]$ , the function $\theta \mapsto l ( \theta ; s _ { t } ^ { ( i ) } )$ is $L$ -smooth and twice continuously differentiable.
+
+Assumption 6. (Unbiased gradients and bounded variance) Each client $t \in [ T ]$ can sample a random batch $\xi$ from $S _ { t }$ and compute an unbiased estimator $g _ { t } ( \theta , \xi )$ of the local gradient with bounded variance, i.e., $\begin{array} { r } { \mathbb { E } _ { \xi } [ g _ { t } ( \theta , \xi ) ] = \frac { 1 } { n _ { t } } \sum _ { i = 1 } ^ { n _ { t } } \nabla _ { \theta } l ( \theta ; s _ { t } ^ { ( i ) } ) } \end{array}$ and $\begin{array} { r } { \mathbb { E } _ { \xi } \| g _ { t } ( \theta , \xi ) - \frac { 1 } { n _ { t } } \sum _ { i = 1 } ^ { n _ { t } } \nabla _ { \theta } l ( \theta ; s _ { t } ^ { ( i ) } ) \| ^ { 2 } \leq \sigma ^ { 2 } } \end{array}$
+
+Assumption 7. (Bounded dissimilarity) There exist $\beta$ and $G$ such that for any set of weights $\alpha \in \Delta ^ { M }$ :
+
+$$
+\sum _ { t = 1 } ^ { T } \frac { n _ { t } } { n } \Big \| \frac { 1 } { n _ { t } } \sum _ { i = 1 } ^ { n _ { t } } \sum _ { m = 1 } ^ { M } \alpha _ { m } \cdot l ( \theta ; s _ { t } ^ { ( i ) } ) \Big \| ^ { 2 } \leq G ^ { 2 } + \beta ^ { 2 } \Big \| \frac { 1 } { n } \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { n _ { t } } \sum _ { m = 1 } ^ { M } \alpha _ { m } \cdot l ( \theta ; s _ { t } ^ { ( i ) } ) \Big \| ^ { 2 } .
+$$
+
+Input : Data $\overline { { S _ { 1 : T } } }$ ; number of mixture distributions $M$ ; number of communication rounds $K$
+Output : $\theta _ { m } ^ { K }$ , $m \in [ M ]$
+1 for iterations $k = 1 , \ldots , K$ do
+2 server broadcasts $\theta _ { m } ^ { k - 1 }$ , $1 \leq m \leq M$ , to the $T$ clients;
+3 for tasks $t = 1 , \dots , T$ in parallel over $T$ clients do
+4 for component $m = 1 , \ldots , M$ do
+5 update $q _ { t } ^ { k } ( z _ { t } ^ { ( i ) } = m )$ as in (8), $\forall i \in \left\{ 1 , \ldots , n _ { t } \right\}$ ;
+6 update $\pi _ { t m } ^ { k }$ as in (9);
+7 $\theta _ { m , t } ^ { k } \gets \mathtt { L o c a l S o l v e r } ( m , \theta _ { m } ^ { k - 1 } , q _ { t } ^ { k } , S _ { t } )$ ;
+8 client $t$ sends $\theta _ { m , t } ^ { k }$ , $1 \leq m \leq M$ , to the server;
+9 for component $m = 1 , \ldots , M$ do
+10 $\begin{array} { r } { \theta _ { m } ^ { k } \sum _ { t = 1 } ^ { T } \frac { n _ { t } } { n } \times \theta _ { m , t } ^ { k } } \end{array}$ ;
+
+Assumption 7 limits the level of dissimilarity of the different tasks, similarly to what is done in [66].
+
+Theorem 3.2. Under Assumptions $^ { 1 - 7 , }$ , when clients use $S G D$ as local solver with learning rate $\begin{array} { r } { \eta = \frac { a _ { 0 } } { \sqrt { K } } } \end{array}$ , after a large enough number of communication rounds $K$ , FedEM’s iterates satisfy:
+
+$$
+\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \nabla _ { \Theta } f \left( \Theta ^ { k } , \Pi ^ { k } \right) \right\| _ { F } ^ { 2 } \leq \mathcal { O } \bigg ( \frac { 1 } { \sqrt { K } } \bigg ) , \qquad \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \Delta _ { \Pi } f ( \Theta ^ { k } , \Pi ^ { k } ) \leq \mathcal { O } \bigg ( \frac { 1 } { K ^ { 3 / 4 } } \bigg ) ,
+$$
+
+where the expectation is over the random batches samples, and $\Delta _ { \Pi } f ( \Theta ^ { k } , \Pi ^ { k } ) \triangleq f \left( \Theta ^ { k } , \Pi ^ { k } \right) -$ $f \left( \Theta ^ { k } , \Pi ^ { k + 1 } \right) \ge 0$ .
+
+Theorem 3.2 (proof in App. G.1) expresses the convergence of both sets of parameters $\Theta$ and $\Pi$ ) to a stationary point of $f$ . Indeed, the gradient of $f$ with respect to $\Theta$ becomes arbitrarily small (left inequality in (11)) and the update in Eq. (9) leads to arbitrarily small improvements of $f$ (right inequality in (11)).
+
+We conclude this section observing that FedEM allows an unseen client, i.e., a client $t _ { \mathrm { n e w } } \notin [ T ]$ arriving after the distributed training procedure, to learn its personalized model. The client simply retrieves the learned components’ parameters $\Theta ^ { K }$ and computes its personalized weights $\pi _ { t _ { \mathrm { n e w } } }$ (starting for example from a uniform initialization) through one $\mathrm { E }$ -step (8) and the first update in the M-step (9).
+
+# 3.3 Fully Decentralized Algorithm
+
+In some cases, clients may want to communicate directly in a peer-to-peer fashion instead of relying on the central server mediation [see 28, Section 2.1]. In fact, fully decentralized schemes may provide stronger privacy guarantees [12] and speed-up training as they better use communication resources [41, 46] and reduce the effect of stragglers [50]. For these reasons, they have attracted significant interest recently in the machine learning community [41, 63, 42, 62, 3, 51, 46, 31]. We refer to [49] for a comprehensive survey of fully decentralized optimization (also known as consensus-based optimization), and to [31] for a unified theoretical analysis of decentralized SGD.
+
+We propose D-FedEM (Alg. 4 in App. D.2), a fully decentralized version of our federated expectation maximization algorithm. As in FedEM, the M-step for $\Theta$ update is replaced by an approximate maximization step consisting of local updates. The global aggregation step in FedEM (Alg. 1, line 10) is replaced by a partial aggregation step, where each client computes a weighted average of its current components and those of a subset of clients (its neighborhood), which may vary over time. The convergence of decentralized optimization schemes requires certain assumptions to guarantee that each client can influence the estimates of other clients over time. In our paper, we consider the general assumption in [31, Assumption 4] (restated as Assumption 8 in App. E for completeness). For instance, this assumption is satisfied if the graph of clients’ communications is strongly connected every $\tau$ rounds.
+
+D-FedEM converges to a stationary point of $f$ (formal statement in App. E and proof in App. G.2).
+
+Theorem 3.3 (Informal). In the same setting of Theorem 3.2 and under the additional Assumption 8, D-FedEM’s individual estimates $( \Theta _ { t } ^ { k } ) _ { 1 \leq t \leq T }$ converge to a common value $\bar { \Theta } ^ { k }$ . Moreover, $\bar { \Theta } ^ { k }$ and $\Pi ^ { k }$ converge to a stationary point of $f$ .
+
+# 3.4 Federated Surrogate Optimization
+
+FedEM and D-FedEM can be seen as particular instances of a more general framework—of potential interest for other applications—that we call federated surrogate optimization.
+
+The standard majorization-minimization principle [34] iteratively minimizes, at each iteration $k$ , a surrogate function $g ^ { k }$ majorizing the objective function $f$ . The work [43] studied this approach when each $\mathbf { \bar { \boldsymbol { g } } ^ { k } }$ is a first-order surrogate of $f$ (the formal definition from [43] is given in App. F.1).
+
+Our novel federated surrogate optimization framework considers that the objective function $f$ is a weighted sum $\begin{array} { r } { f = \sum _ { t = 1 } ^ { T } \hat { \omega } _ { t } f _ { t } } \end{array}$ of $T$ functions and iteratively minimizes $f$ in a distributed fashion using partial first-order surrogates $g _ { t } ^ { k }$ for each function $f _ { t }$ . “Partial” refers to the fact that $g _ { t } ^ { k }$ is not required to be a first order surrogate wrt the whole set of parameters, as defined formally below.
+
+Definition 1 (Partial first-order surrogate). A function $g ( \mathbf { u } , \mathbf { v } ) : \mathbb { R } ^ { d _ { u } } \times \mathcal { V } \mathbb { R }$ is a partial-first-order surrogate of $f ( { \bf u } , { \bf v } )$ wrt u near $( { \bf u } _ { 0 } , { \bf v } _ { 0 } ) \in R ^ { d _ { u } } \times \mathcal { V }$ when the following conditions are satisfied:
+
+1. $g ( \mathbf { u } , \mathbf { v } ) \geq f ( \mathbf { u } , \mathbf { v } ) .$ for all $\mathbf { u } \in \mathbb { R } ^ { d _ { u } }$ and $\mathbf { v } \in \mathcal { V }$ ;
+2. $r ( \mathbf { u } , \mathbf { v } ) \triangleq g ( \mathbf { u } , \mathbf { v } ) - f ( \mathbf { u } , \mathbf { v } )$ is differentiable and $L$ -smooth with respect to u. Moreover, we have $r ( { \bf u } _ { 0 } , { \bf v } _ { 0 } ) = 0$ and $\begin{array} { r } { \nabla _ { \mathbf { u } } r ( \mathbf { u } _ { 0 } , \mathbf { v } _ { 0 } ) = 0 . } \end{array}$ .
+3. $g ( \mathbf { u } , \mathbf { v } _ { 0 } ) - g ( \mathbf { u } , \mathbf { v } ) = d _ { \mathcal { V } } ( \mathbf { v } _ { 0 } , \mathbf { v } ) .$ for all $\mathbf { u } \in \mathbb { R } ^ { d _ { u } }$ and $\begin{array} { r } { \mathbf { v } \in \arg \operatorname* { m i n } _ { \mathbf { v } ^ { \prime } \in \mathcal { V } } g ( \mathbf { u } , \mathbf { v } ^ { \prime } ) } \end{array}$ , where $d _ { \nu }$ is non-negative and $d _ { \mathcal { V } } ( \mathbf { v } , \mathbf { v } ^ { \prime } ) = 0 \iff \mathbf { v } = \mathbf { v } ^ { \prime }$ .
+
+Under the assumption that each client $t$ can compute a partial first-order surrogate of $f _ { t }$ , we propose algorithms for federated surrogate optimization in both the client-server setting (Alg. 3) and the fully decentralized one (Alg. 5) and prove their convergence under mild conditions (App. G.1 and G.2). FedEM and D-FedEM can be seen as particular instances of these algorithms and Theorem. 3.2 and Theorem. 3.3 follow from the more general convergence results for federated surrogate optimization. We can also use our framework to analyze the convergence of other FL algorithms such as pFedMe [16], as we illustrate in App. F.3.
+
+# 4 Experiments
+
+Datasets and models. We evaluated our method on five federated benchmark datasets spanning a wide range of machine learning tasks: image classification (CIFAR10 and CIFAR100 [33]), handwritten character recognition (EMNIST [8] and FEMNIST [7]),5 and language modeling (Shakespeare [7, 47]). Shakespeare dataset (resp. FEMNIST) was naturally partitioned by assigning all lines from the same characters (resp. all images from the same writer) to the same client. We created federated versions of CIFAR10 and EMNIST by distributing samples with the same label across the clients according to a symmetric Dirichlet distribution with parameter 0.4, as in [65]. For CIFAR100, we exploited the availability of “coarse” and “fine” labels, using a two-stage Pachinko allocation method [39] to assign 600 sample to each of the 100 clients, as in [54]. We also evaluated our method on a synthetic dataset verifying Assumptions 1–3. For all tasks, we randomly split each local dataset into training $( 6 0 \% )$ , validation $( 2 0 \% )$ and test $( 2 0 \% )$ sets. Table 1 summarizes datasets, models, and number of clients (more details can be found in App. I.1). Code is available at https://github.com/omarfoq/FedEM.
+
+Other FL approaches. We compared our algorithms with global models trained with FedAvg [47] and FedProx [38] as well as different personalization approaches: a personalized model trained only on the local dataset, FedAvg with local tuning $( \mathtt { F e d A v g } + )$ [27], Clustered FL [56] and pFedMe [16]. For each method and each task, the learning rate and the other hyperparameters were tuned via grid search (details in App. I.2). FedAvg+ updated the local model through a single pass on the local dataset. Unless otherwise stated, the number of components considered by FedEM was $M = 3$ , training occurred over 80 communication rounds for Shakespeare and 200 rounds for all other datasets.
+
+Table 1: Datasets and models (details in App. I.1).
+
+
Dataset
Task
Clients
Total samples
Model
FEMNIST[7]
Handwriten character recognition
539
120,772
2-layer CNN + 2-layer FFN
EMNIST[8]
Handwritten character recognition
100
81,425
2-layer CNN + 2-layer FFN
CIFAR10 [33]
Image classification
80
60,000
MobileNet-v2 [55]
CIFAR100 [33]
Image classification
100
60,000
MobileNet-v2 [55]
Shakespeare [7,47]
Next-Character Prediction
778
4,226,158
Stacked-LSTM[25]
Synthetic
Binary Classification
300
1,570,507
Linear model
+
+Table 2: Test accuracy: average across clients / bottom decile.
+
+
Dataset
Local
FedAvg[47]
FedProx [38]
FedAvg+ [27]
Clustered FL [56]
pFedMe [16]
FedEM (Ours)
FEMNIST
71.0/57.5
78.6/63.9
78.9 /64.0
75.3/53.0
73.5/55.1
74.9/57.6
79.9/64.8
EMNIST
71.9/64.3
82.6/75.0
83.0/75.4
83.1/75.8
82.7/75.0
83.3/76.4
83.5/76.6
CIFAR10
70.2/48.7
78.2/72.4
78.0/70.8
82.3/70.6
78.6/71.2
81.7/73.6
84.3 /78.1
CIFAR100
31.5/19.9
40.9/33.2
41.0/33.2
39.0/28.3
41.5/34.1
41.8/32.5
44.1/35.0
Shakespeare
32.0/16.6
46.7/42.8
45.7/41.9
40.0/25.5
46.6/42.7
41.2/36.8
46.7/43.0
Synthetic
65.7/58.4
68.2/58.9
68.2/59.0
68.9/60.2
69.1/59.0
69.2/61.2
74.7/66.7
+
+At each round, clients train for one epoch. Results for D-FedEM are in App. J.1. A comparison with MOCHA [59], which can only train linear models, is presented in App. J.2.
+
+Average performance of personalized models. The performance of each personalized model (which is the same for all clients in the case of FedAvg and FedProx) is evaluated on the local test dataset (unseen at training). Table 2 shows the average weighted accuracy with weights proportional to local dataset sizes. We observe that FedEM obtains the best performance across all datasets.
+
+Fairness across clients. FedEM’s improvement in terms of average accuracy could be the result of learning particularly good models for some clients at the expense of bad models for other clients. Table 2 shows the bottom decile of the accuracy of local models, i.e., the $( T / 1 0 )$ -th worst accuracy (the minimum accuracy is particularly noisy, notably because some local test datasets are very small). Even clients with the worst personalized models are still better off when FedEM is used for training.
+
+Clients sampling. In cross-device federated learning, only a subset of clients may be available at each round. We ran CIFAR10 experiments with different levels of participation: at each round a given fraction of all clients were sampled uniformly without replacement. We restrict the comparison to FedEM and ${ \mathrm { F e d A v g } } +$ , as 1) ${ \mathrm { F e d A v g } } +$ performed better than FedProx and FedAvg in the previous CIFAR10 experiments, 2) it is not clear how to extend pFedMe and Clustered FL to handle client sampling. Results in Fig. 1 (left) show that FedEM is more robust to low clients’ participation levels. We provide additional results on client sampling, including a comparison with APFL [14], in App. J.6.
+
+Generalization to unseen clients. As discussed in Section 3.2, FedEM allows new clients arriving after the distributed training to easily learn their personalized models. With the exception of ${ \mathrm { F e d A v g } } +$ , it is not clear how the other personalized FL algorithms should be extended to tackle the same goal (see discussion in App. J.3). In order to evaluate the quality of new clients’ personalized models, we performed an experiment where only $80 \%$ of the clients (“old” clients) participate to the training. The remaining $20 \%$ join the system in a second phase and use their local training datasets to learn their personalized weights. Table 3 shows that FedEM allows new clients to learn a personalized model at least as good as FedAvg’s global one and always better than FedAvg+’s one. Unexpectedly, new clients achieve sometimes a significantly higher test accuracy than old clients (e.g., $4 7 . 5 \%$ against $4 4 . 1 \%$ on CIFAR100). Our investigation in App. J.3 suggests that, by selecting their mixture weights on local datasets that were not used to train the components, new clients can compensate for potential overfitting in the initial training phase. We also investigate in App. J.3 the effect of the local dataset size on the accuracy achieved by unseen clients, showing that personalization is effective even when unseen clients have small datasets.
+
+Effect of $M$ . A limitation of FedEM is that each client needs to update and transmit $M$ components at each round, requiring roughly $M$ times more computation and $M$ times larger messages. Nevertheless, the number of components to consider in practice is quite limited. We used $M = 3$ in our previous experiments, and Fig. 1 (right) shows that larger values do not yield much improvement and $M = 2$ already provides a significant level of personalization. In all experiments above, the number of communication rounds allowed all approaches to converge. As a consequence, even if other methods trained over $M = 3$ times more rounds—in order to have as much computation and communication as FedEM—the conclusions would not change. As a final experiment, we considered a time-constrained setting, where FedEM is limited to run one third $( = 1 / M )$ ) of the rounds (Table 7 in App. J.5). Even if FedEM does not reach its maximum accuracy, it still outperforms the other methods on 3 datasets.
+
+Table 3: Average test accuracy across clients unseen at training (train accuracy in parenthesis).
+
+
Dataset
FedAvg [47]
FedAvg+[27]
FedEM (Ours)
FEMNIST
78.3(80.9)
74.2 (84.2)
79.1 (81.5)
EMNIST
83.4(82.7)
83.7(92.9)
84.0(83.3)
CIFAR10
77.3(77.5)
80.4 (80.5)
85.9 (90.7)
CIFAR100
41.1 (42.1)
36.5 (55.3)
47.5 (46.6)
Shakespeare
46.7 (47.1)
40.2 (93.0)
46.7 (46.6)
Synthetic
68.6(70.0)
69.1(72.1)
73.0 (74.1)
+
+
+Figure 1: Effect of client sampling rate (left) and FedEM number of mixture components $M$ (right) on the test accuracy for CIFAR10 [33].
+
+# 5 Conclusion
+
+In this paper, we proposed a novel federated MTL approach based on the flexible assumption that local data distributions are mixtures of underlying distributions. Our EM-like algorithms allow clients to jointly learn shared component models and personalized mixture weights in client-server and fully decentralized settings. We proved convergence guarantees for our algorithms through a general federated surrogate optimization framework which can be used to analyze other FL formulations. Extensive empirical evaluation shows that our approach learns models with higher accuracy and fairness than state-of-the-art FL algorithms, even for clients not present at training time.
+
+In future work, we aim to reduce the local computation and communication of our algorithms. Aside from standard compression schemes [22], a promising direction is to limit the number of component models that a client updates/transmits at each step. This could be done in an adaptive manner based on the client’s current mixture weights. A simultaneously published work [15] proposes a federated EM algorithm (also called FedEM), which does not address personalization but reduces communication requirements by compressing appropriately defined complete data sufficient statistics.
+
+A second interesting research direction is to study personalized FL approaches under privacy constraints (quite unexplored until now with the notable exception of [3]). Some features of our algorithms may be beneficial for privacy (e.g., the fact that personalized weights are kept locally and that all users contribute to all shared models). We hope to design differentially private versions of our algorithms and characterize their privacy-utility trade-offs.
+
+# 6 Acknowledgements
+
+This work has been supported by the French government, through the 3IA Côte d’Azur Investments in the Future project managed by the National Research Agency (ANR) with the reference number ANR-19-P3IA-0002, and through grants ANR-16-CE23-0016 (Project PAMELA) and ANR-20- CE23-0015 (Project PRIDE). The authors are grateful to the OPAL infrastructure from Université Côte d’Azur for providing computational resources and technical support.
+
+# References
+
+Training”. In: Proceedings of the 38th International Conference on Machine Learning. Ed. by Marina Meila and Tong Zhang. Vol. 139. Proceedings of Machine Learning Research. PMLR, July 2021, pp. 21–31. URL: https://proceedings.mlr.press/v139/acar21a.html.
+[2] Rie Kubota Ando and Tong Zhang. “A Framework for Learning Predictive Structures from Multiple Tasks and Unlabeled Data”. In: Journal of Machine Learning Research 6.61 (2005), pp. 1817–1853.
+[3] Aurélien Bellet, Rachid Guerraoui, Mahsa Taziki, and Marc Tommasi. “Personalized and Private Peer-to-Peer Machine Learning”. In: AISTATS. 2018.
+[4] Shai Ben-David, Tyler Lu, and D. Pál. “Does Unlabeled Data Provably Help? Worst-case Analysis of the Sample Complexity of Semi-Supervised Learning”. In: COLT. 2008.
+[5] Stephen Boyd, Persi Diaconis, and Lin Xiao. “Fastest Mixing Markov Chain on A Graph”. In: SIAM REVIEW 46 (2003), pp. 667–689.
+[6] Sébastien Bubeck. Convex Optimization: Algorithms and Complexity. 2015. arXiv: 1405.4980 [math.OC].
+[7] Sebastian Caldas et al. “Leaf: A benchmark for federated settings”. In: arXiv preprint arXiv:1812.01097 (2018). Presented at the 2nd International Workshop on Federated Learning for Data Privacy and Confidentiality (in conjunction with NeurIPS 2019).
+[8] Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre Van Schaik. “EMNIST: Extending MNIST to handwritten letters”. In: 2017 International Joint Conference on Neural Networks (IJCNN). IEEE. 2017, pp. 2921–2926.
+[9] Luca Corinzia and Joachim M. Buhmann. Variational Federated Multi-Task Learning. 2019. arXiv: 1906.06268 [cs.LG].
+[10] Corinna Cortes, Yishay Mansour, and Mehryar Mohri. “Learning Bounds for Importance Weighting”. In: Advances in Neural Information Processing Systems. Ed. by J. Lafferty, C. Williams, J. Shawe-Taylor, R. Zemel, and A. Culotta. Vol. 23. Curran Associates, Inc., 2010. URL: https : / / proceedings . neurips . cc / paper / 2010 / file / 59c33016884a62116be975a9bb8257e3-Paper.pdf.
+[11] Corinna Cortes, Mehryar Mohri, Michael Riley, and Afshin Rostamizadeh. “Sample Selection Bias Correction Theory”. In: ALT. 2008.
+[12] Edwige Cyffers and Aurélien Bellet. Privacy Amplification by Decentralization. Presented at the Privacy Preserving Machine Learning workshop (in conjunction with NeurIPS 2020). 2021. arXiv: 2012.05326 [cs.LG].
+[13] Malte Darnstädt, H. U. Simon, and Balázs Szörényi. “Unlabeled Data Does Provably Help”. In: STACS. 2013.
+[14] Yuyang Deng, Mohammad Mahdi Kamani, and Mehrdad Mahdavi. “Adaptive Personalized Federated Learning”. In: arXiv preprint arXiv:2003.13461 (2020).
+[15] Aymeric Dieuleveut, Gersende Fort, Eric Moulines, and Geneviève Robin. “Federated Expectation Maximization with heterogeneity mitigation and variance reduction”. In: Advances in Neural Information Processing Systems. Vol. 34. 2021.
+[16] Canh T Dinh, Nguyen H Tran, and Tuan Dung Nguyen. “Personalized Federated Learning with Moreau Envelopes”. In: 34th Conference on Neural Information Processing Systems (NeurIPS 2020). 2020.
+[17] Canh T Dinh, Tung T Vu, Nguyen H Tran, Minh N Dao, and Hongyu Zhang. “FedU: A Unified Framework for Federated Multi-Task Learning with Laplacian Regularization”. In: arXiv preprint arXiv:2102.07148 (2021).
+[18] P. Erdös and A. Rényi. “On Random Graphs I”. In: Publicationes Mathematicae Debrecen 6 (1959), p. 290.
+[19] Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. “Personalized federated learning: A meta-learning approach”. In: 34th Conference on Neural Information Processing Systems (NeurIPS 2020). 2020.
+[20] Avishek Ghosh, Jichan Chung, Dong Yin, and Kannan Ramchandran. “An Efficient Framework for Clustered Federated Learning”. In: NeurIPS. 2020.
+[21] Christina Göpfert, Shai Ben-David, Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, and Ruth Urner. “When can unlabeled data improve the learning rate?” In: Conference on Learning Theory. PMLR. 2019, pp. 1500–1518.
+[22] Farzin Haddadpour, Mohammad Mahdi Kamani, Aryan Mokhtari, and Mehrdad Mahdavi. “Federated Learning with Compression: Unified Analysis and Sharp Guarantees”. In: ICML. 2021.
+[23] Filip Hanzely, Slavomıér Hanzely, Samuel Horváth, and Peter Richtárik. “Lower bounds and optimal algorithms for personalized federated learning”. In: 34th Conference on Neural Information Processing Systems (NeurIPS 2020). 2020.
+[24] Filip Hanzely and Peter Richtárik. “Federated Learning of a Mixture of Global and Local Models”. In: (2020). arXiv: 2002.05516 [cs.LG].
+[25] Sepp Hochreiter and Jürgen Schmidhuber. “Long Short-Term Memory”. In: Neural Computation 9.8 (1997), pp. 1735–1780.
+[26] Yutao Huang et al. “Personalized cross-silo federated learning on non-iid data”. In: Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 35. 9. 2021, pp. 7865–7873.
+[27] Yihan Jiang, Jakub Konecný, Keith Rush, and Sreeram Kannan. “Improving federated learning ˇ personalization via model agnostic meta learning”. In: arXiv preprint arXiv:1909.12488 (2019). Presented at NeurIPS FL workshop 2019.
+[28] Peter Kairouz et al. “Advances and Open Problems in Federated Learning”. In: Foundations and Trends® in Machine Learning 14.1–2 (2021), pp. 1–210. ISSN: 1935-8237. DOI: 10. 1561/2200000083. URL: http://dx.doi.org/10.1561/2200000083.
+[29] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. “SCAFFOLD: Stochastic controlled averaging for federated learning”. In: International Conference on Machine Learning. PMLR. 2020, pp. 5132–5143.
+[30] Mikhail Khodak, Maria-Florina F Balcan, and Ameet S Talwalkar. “Adaptive gradient-based meta-learning methods”. In: Advances in Neural Information Processing Systems. 2019, pp. 5917–5928.
+[31] Anastasia Koloskova, N. Loizou, Sadra Boreiri, M. Jaggi, and S. Stich. “A Unified Theory of Decentralized SGD with Changing Topology and Local Updates”. In: ICML. 2020.
+[32] Jakub Konecný, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, ˇ and Dave Bacon. “Federated learning: Strategies for improving communication efficiency”. In: arXiv preprint arXiv:1610.05492 (2016). Presented at NIPS 2016 Workshop on Private Multi-Party Machine Learning.
+[33] Alex Krizhevsky. “Learning multiple layers of features from tiny images”. MSc thesis. 2009.
+[34] Kenneth Lange, David R. Hunter, and Ilsoon Yang. “Optimization Transfer Using Surrogate Objective Functions”. In: Journal of Computational and Graphical Statistics 9.1 (2000), pp. 1– 20. ISSN: 10618600. URL: http://www.jstor.org/stable/1390605.
+[35] Steffen L. Lauritzen. Graphical models. English. Oxford Statistical Science Series 17. Clarendon Press, 1996. ISBN: 0198522193.
+[36] Tian Li, Shengyuan Hu, Ahmad Beirami, and Virginia Smith. “Ditto: Fair and robust federated learning through personalization”. In: International Conference on Machine Learning. PMLR. 2021, pp. 6357–6368.
+[37] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. “Federated learning: Challenges, methods, and future directions”. In: IEEE Signal Processing Magazine 37.3 (2020), pp. 50–60.
+[38] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. “Federated Optimization in Heterogeneous Networks”. In: Third MLSys Conference. 2020.
+[39] Wei Li and Andrew McCallum. “Pachinko Allocation: DAG-Structured Mixture Models of Topic Correlations”. In: Proceedings of the 23rd International Conference on Machine Learning. ICML ’06. Pittsburgh, Pennsylvania, USA: Association for Computing Machinery, 2006, pp. 577–584. ISBN: 1595933832. DOI: 10.1145/1143844.1143917. URL: https: //doi.org/10.1145/1143844.1143917.
+[40] Xiaoxiao Li, Meirui JIANG, Xiaofei Zhang, Michael Kamp, and Qi Dou. “FedBN: Federated Learning on Non-IID Features via Local Batch Normalization”. In: International Conference on Learning Representations. 2020.
+[41] Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang, and Ji Liu. “Can Decentralized Algorithms Outperform Centralized Algorithms? A Case Study for Decentralized Parallel Stochastic Gradient Descent”. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. NIPS’17. Long Beach, California, USA: Curran Associates Inc., 2017, pp. 5336–5346. ISBN: 9781510860964.
+[42] Xiangru Lian, Wei Zhang, Ce Zhang, and Ji Liu. “Asynchronous Decentralized Parallel Stochastic Gradient Descent”. In: ICML. 2018.
+[43] Julien Mairal. “Optimization with first-order surrogate functions”. In: International Conference on Machine Learning. 2013, pp. 783–791.
+[44] Yishay Mansour, Mehryar Mohri, Jae Ro, and Ananda Theertha Suresh. “Three approaches for personalization with applications to federated learning”. In: arXiv preprint arXiv:2002.10619 (2020).
+[45] Sébastien Marcel and Yann Rodriguez. “Torchvision the Machine-Vision Package of Torch”. In: Proceedings of the 18th ACM International Conference on Multimedia. MM ’10. Firenze, Italy: Association for Computing Machinery, 2010, pp. 1485–1488. ISBN: 9781605589336. DOI: 10.1145/1873951.1874254. URL: https://doi.org/10.1145/1873951.1874254.
+[46] Othmane Marfoq, Chuan Xu, Giovanni Neglia, and Richard Vidal. “Throughput-Optimal Topology Design for Cross-Silo Federated Learning”. In: Advances in Neural Information Processing Systems. Ed. by H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin. Vol. 33. Curran Associates, Inc., 2020, pp. 19478–19487. URL: https://proceedings. neurips.cc/paper/2020/file/e29b722e35040b88678e25a1ec032a21-Paper.pdf.
+[47] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. “Communication-efficient learning of deep networks from decentralized data”. In: Artificial Intelligence and Statistics. PMLR. 2017, pp. 1273–1282.
+[48] Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. “Agnostic Federated Learning”. In: International Conference on Machine Learning. 2019, pp. 4615–4625.
+[49] A. Nedic, A. Olshevsky, and M. G. Rabbat. “Network Topology and Communication- ´ Computation Tradeoffs in Decentralized Optimization”. In: Proceedings of the IEEE 106.5 (2018), pp. 953–976. DOI: 10.1109/JPROC.2018.2817461.
+[50] Giovanni Neglia, Gianmarco Calbi, Don Towsley, and Gayane Vardoyan. “The Role of Network Topology for Distributed Machine Learning”. In: IEEE INFOCOM 2019 - IEEE Conference on Computer Communications. 2019, pp. 2350–2358. DOI: 10.1109/INFOCOM.2019.8737602.
+[51] Giovanni Neglia, Chuan Xu, Don Towsley, and Gianmarco Calbi. “Decentralized gradient methods: does topology matter?” In: AISTATS. 2020.
+[52] Y. Nesterov. Introductory Lectures on Convex Optimization: A Basic Course. 1st ed. Applied Optimization. Springer, 2003. URL: http://gen.lib.rus.ec/book/index.php?md5 $=$ 488d3c36f629a6e021fc011675df02ef.
+[53] Adam Paszke et al. “PyTorch: An Imperative Style, High-Performance Deep Learning Library”. In: Advances in Neural Information Processing Systems 32. Ed. by H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. Fox, and R. Garnett. Curran Associates, Inc., 2019, pp. 8024–8035. URL: http://papers.neurips.cc/paper/9015-pytorch-animperative-style-high-performance-deep-learning-library.pdf.
+[54] Sashank J. Reddi et al. “Adaptive Federated Optimization”. In: International Conference on Learning Representations. 2021. URL: https : / / openreview . net / forum ? id $=$ LkFG3lB13U5.
+[55] 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. 2018, pp. 4510–4520.
+[56] Felix Sattler, Klaus-Robert Müller, and Wojciech Samek. “Clustered Federated Learning: Model-Agnostic Distributed Multitask Optimization Under Privacy Constraints”. In: IEEE Transactions on Neural Networks and Learning Systems (2020).
+[57] Aviv Shamsian, Aviv Navon, Ethan Fetaya, and Gal Chechik. “Personalized Federated Learning using Hypernetworks”. In: Proceedings of the 38th International Conference on Machine Learning. Ed. by Marina Meila and Tong Zhang. Vol. 139. Proceedings of Machine Learning Research. PMLR, July 2021, pp. 9489–9502. URL: https://proceedings.mlr.press/ v139/shamsian21a.html.
+[58] Khe Chai Sim, Petr Zadrazil, and Françoise Beaufays. “An Investigation Into On-device Personalization of End-to-end Automatic Speech Recognition Models”. In: INTERSPEECH. 2019.
+[59] Virginia Smith, Chao-Kai Chiang, Maziar Sanjabi, and Ameet Talwalkar. “Federated MultiTask Learning”. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. NIPS’17. Long Beach, California, USA: Curran Associates Inc., 2017, pp. 4427–4437. ISBN: 9781510860964.
+[60] Sebastian U Stich. “Local SGD Converges Fast and Communicates Little”. In: International Conference on Learning Representations. 2018.
+[61] Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul Buenau, and Motoaki Kawanabe. “Direct Importance Estimation with Model Selection and Its Application to Covariate Shift Adaptation”. In: NIPS. 2008.
+[62] Hanlin Tang, Xiangru Lian, Ming Yan, Ce Zhang, and Ji Liu. “ $D ^ { 2 }$ : Decentralized Training over Decentralized Data”. In: ICML. 2018.
+[63] Paul Vanhaesebrouck, Aurélien Bellet, and Marc Tommasi. “Decentralized Collaborative Learning of Personalized Models over Networks”. In: AISTATS. 2017.
+[64] Robin Vogel, Mastane Achab, Stéphan Clémençon, and Charles Tillier. “Weighted Emprirical Risk Minimization: Transfer Learning based on Importance Sampling”. In: ESANN. 2020.
+[65] Hongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris Papailiopoulos, and Yasaman Khazaeni. “Federated Learning with Matched Averaging”. In: International Conference on Learning Representations. 2020. URL: https://openreview.net/forum?id $\ c =$ BkluqlSFDS.
+[66] Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. “Tackling the objective inconsistency problem in heterogeneous federated optimization”. In: 34th Conference on Neural Information Processing Systems (NeurIPS 2020). 2020.
+[67] Valentina Zantedeschi, Aurélien Bellet, and Marc Tommasi. “Fully Decentralized Joint Learning of Personalized Models and Collaboration Graphs”. In: ed. by Silvia Chiappa and Roberto Calandra. Vol. 108. Proceedings of Machine Learning Research. Online: PMLR, Aug. 2020, pp. 864–874. URL: http://proceedings.mlr.press/v108/zantedeschi20a.html.
+[68] Michael Zhang, Karan Sapra, Sanja Fidler, Serena Yeung, and Jose M Alvarez. “Personalized Federated Learning with First Order Model Optimization”. In: International Conference on Learning Representations. 2020.
+[69] Yu Zhang and Dit Yan Yeung. “A Convex Formulation for Learning Task Relationships in Multi-task Learning”. In: Proceedings of the 26th Conference on Uncertainty in Artificial Intelligence, UAI 2010. 2010, p. 733.
+[70] Jiayu Zhou, Jianhui Chen, and Jieping Ye. “Clustered Multi-Task Learning Via Alternating Structure Optimization”. In: Advances in Neural Information Processing Systems. Ed. by J. Shawe-Taylor, R. Zemel, P. Bartlett, F. Pereira, and K. Q. Weinberger. Vol. 24. Curran Associates, Inc., 2011. URL: https://proceedings.neurips.cc/paper/2011/file/ a516a87cfcaef229b342c437fe2b95f7-Paper.pdf.
\ No newline at end of file
diff --git a/md/train/ZzwDy_wiWv/ZzwDy_wiWv.md b/md/train/ZzwDy_wiWv/ZzwDy_wiWv.md
new file mode 100644
index 0000000000000000000000000000000000000000..9458812651ddf92eb0d6d9d76ff2dfc2a2708fbb
--- /dev/null
+++ b/md/train/ZzwDy_wiWv/ZzwDy_wiWv.md
@@ -0,0 +1,346 @@
+# KNOWLEDGE DISTILLATION VIA SOFTMAX REGRESSION REPRESENTATION LEARNING
+
+Jing Yang
+University of Nottingham
+Nottingham, UK
+jing.yang2@nottingham.ac.uk
+Brais Marinez
+Samsung AI Center
+Cambridge, UK
+brais.mart@gmail.com
+Adrian Bulat
+Samsung AI Center
+Cambridge, UK
+adrian@adrianbulat.com,
+Georgios Tzimiropoulos
+Samsung AI Center
+Cambridge, UK
+Queen Mary University of London
+London, UK
+g.tzimiropoulos@qmul.ac.uk
+
+# ABSTRACT
+
+This paper addresses the problem of model compression via knowledge distillation. We advocate for a method that optimizes the output feature of the penultimate layer of the student network and hence is directly related to representation learning. To this end, we firstly propose a direct feature matching approach which focuses on optimizing the student’s penultimate layer only. Secondly and more importantly, because feature matching does not take into account the classification problem at hand, we propose a second approach that decouples representation learning and classification and utilizes the teacher’s pre-trained classifier to train the student’s penultimate layer feature. In particular, for the same input image, we wish the teacher’s and student’s feature to produce the same output when passed through the teacher’s classifier, which is achieved with a simple $L _ { 2 }$ loss. Our method is extremely simple to implement and straightforward to train and is shown to consistently outperform previous state-of-the-art methods over a large set of experimental settings including different (a) network architectures, (b) teacher-student capacities, (c) datasets, and (d) domains. The code is available at https://github.com/jingyang2017/KD_SRRL.
+
+# 1 INTRODUCTION
+
+Recently, there has been a great amount of research effort to make Convolutional Neural Networks (CNNs) lightweight so that they can be deployed in devices with limited resources. To this end, several approaches for model compression have been proposed, including network pruning (Han et al., 2016; Lebedev & Lempitsky, 2016), network quantization (Rastegari et al., 2016; Wu et al., 2016), knowledge transfer/distillation (Hinton et al., 2015; Zagoruyko & Komodakis, 2017), and neural architecture search (Zoph & Le, 2017; Liu et al., 2018). Knowledge distillation (Bucilua et al., ˇ 2006; Hinton et al., 2015) aims to transfer knowledge from one network (the so-called “teacher”) to another (the so-called “student”). Typically, the teacher is a high-capacity model capable of achieving high accuracy, while the student is a compact model with much fewer parameters, thus also requiring much less computation. The goal of knowledge distillation is to use the teacher to improve the training of the student and push its accuracy closer to that of the teacher.
+
+The rationale behind knowledge distillation can be explained from an optimization perspective: there is evidence that high capacity models (i.e. the teacher) can find good local minima due to over-parameterization (Du & Lee, 2018; Soltanolkotabi et al., 2018). In knowledge distillation, such models are used to facilitate the optimization of lower capacity models (i.e. the student) during training. For example, in the seminal work of (Hinton et al., 2015), the softmax outputs of the teacher provide extra supervisory signals of inter-class similarities which facilitate the training of the student. In other influential works, intermediate representations extracted from the teacher such as feature tensors (Romero et al., 2015) or attention maps (Zagoruyko & Komodakis, 2017) have been used to define auxiliary loss functions used in the optimization of the student.
+
+
+Figure 1: Our method performs knowledge distillation by minimizing the discrepancy between the penultimate feature representations $h _ { T }$ and $h _ { S }$ of the teacher and the student, respectively. To this end, we propose to use two losses: (a) the Feature Matching loss $L _ { F M }$ , and (b) the so-called Softmax Regression loss $L _ { S R }$ . In contrary to $L _ { F M }$ , our main contribution, $L _ { S R }$ , is designed to take into account the classification task at hand. To this end, $L _ { S R }$ imposes that for the same input image, the teacher’s and student’s feature produce the same output when passed through the teacher’s pre-trained and frozen classifier. Note that, for simplicity, the function for making the feature dimensionality of $h _ { T }$ and $h _ { S }$ the same is not shown.
+
+Training a network whose output feature representation is rich and powerful has been shown crucial for achieving high accuracy for the subsequent classification task in recent works in both unsupervised and supervised learning, see for example (Chen et al., 2020; He et al., 2020) and (Kang et al., 2020). Hence, in this paper, we are advocating for representation learning-based knowledge distillation by optimizing the student’s penultimate layer output feature. If we are able to do this effectively, we expect (and show experimentally) to end up with a student network which can generalize better than one trained with logit matching as in the KD paper of (Hinton et al., 2015).
+
+Main contributions: To accomplish the aforementioned goal we propose two loss functions: The first loss function, akin to (Romero et al., 2015; Zagoruyko & Komodakis, 2017), is based on direct feature matching but focuses on optimizing the student’s penultimate layer feature only. Because direct feature matching might be difficult due to the lower representation capacity of the student and, more importantly, is detached from the classification task at hand, we also propose a second loss function: we propose to decouple representation learning and classification and utilize the teacher’s pre-trained classifier to train the student’s penultimate layer feature. In particular, for the same input image, we wish the teacher’s and student’s feature to produce the same output when passed through the teacher’s classifier, which is achieved with a simple $L _ { 2 }$ loss (see Fig. 1). This softmax regression projection is used to retain from the student’s feature the information that is relevant to classification, but since the projection matrix is pre-trained (learned during the teacher’s training phase) this does not compromise the representational power of the student’s feature.
+
+Main results: Our method has two advantages: (1) It is simple and straightforward to implement. (2) It consistently outperforms state-of-the-art methods over a large set of experimental settings including different (a) network architectures (WideResNets, ResNets, MobileNets), (b) teacherstudent capacities, (c) datasets (CIFAR-10/100, ImageNet), and (d) domains (real-to-binary).
+
+# 2 RELATED WORK
+
+Knowledge transfer: In the work of (Hinton et al., 2015), knowledge is defined as the teacher’s outputs after the final softmax layer. The softmax outputs carry richer information than one-hot labels because they provide extra supervision signals in terms of the inter-class similarities learned by the teacher. In a similar fashion to (Hinton et al., 2015), intermediate representations extracted from the teacher such as feature tensors (Romero et al., 2015) or attention maps (Zagoruyko & Komodakis, 2017) have been used to define loss functions used to facilitate the optimization of the student. Trying to match the whole feature tensor, as in FitNets (Romero et al., 2015), is hard and, in certain circumstances, such an approach may adversely affect the performance and convergence of the student. To relax the assumption of FitNet, Attention Transfer (AT) was proposed in (Zagoruyko & Komodakis, 2017) where knowledge takes the form of attention maps which are summaries of the energies of the feature tensors over the channel dimension. An extension of (Zagoruyko & Komodakis, 2017) using Maximum Mean Discrepancy of the network activations as a loss term for distillation was proposed in (Huang & Wang, 2017). Cho & Hariharan (2019) showed that very accurate networks are “too good” to be good teachers and proposed to mitigate this with early stopping of the teacher’s training. Recently, the work of (Heo et al., 2019a) studied the location within the network at which feature distillation should be applied and proposed margin ReLU and a specifically designed distance function that transfers only the useful (positive) information from the teacher to the student. More recently, Li et al. (Li et al., 2020a) proposed to supervise the blockwise architecture search by the architecture knowledge distilled from a teacher model. Another NAS based method was proposed in (Guan et al., 2020), in which a student-to-teacher loss is used to find the aggregation weights that match the learning ability of the student. Passalis et al. (2020) claimed that traditional KD ignores information plasticity during the training process, and proposed to model the information flow through the various layers of the teacher.
+
+Feature relationship transfer: Another line of knowledge distillation methods focus on exploring transferring the relationship between features, rather than the actual features themselves. In (Yim et al., 2017), feature correlations are captured by computing the Gram matrix of features across layers for both teacher and student and then applying an $L _ { 2 }$ loss on pairs of teacher-student Gram matrices. The limitation of this work is the high computational cost, which is addressed to some extent in (Lee et al., 2018) by compressing the feature maps by singular value decomposition. Park et al. (2019) proposed a relational knowledge distillation method which computes distance-wise and angle-wise relations of each embedded feature vector. This idea is further explored in (Peng et al., 2019) and (Liu et al., 2019). In (Peng et al., 2019), Taylor series expansion is proposed to better capture the correlation between multiple instances. In (Liu et al., 2019), the instance feature and relationships are considered as vertexes and edges respectively in a graph and instance relationship graph is proposed to model the feature space transformation across layers. Inspired by the observation that semantically similar inputs should have similar activation patterns, (Tung & Mori, 2019) proposed a similarity-preserving knowledge distillation method which guides the student to mimic the teacher with respect to generating similar or dissimilar activations. More recently, (Jain et al., 2020) proposed to matching the student output with the teacher’s by distilling the knowledge through a quantized visual words space. Li et al. (2020b) proposed the local correlation exploration framework to represent the relationships of local regions in the feature space which contains more details and discriminative patterns.
+
+Finally, a similar connection between distillation and representation learning was very recently made in (Tian et al., 2020) which uses contrastive learning for knowledge distillation. We note that our loss is not related to the one used in (Tian et al., 2020), is simpler, and as shown in Section 5, outperforms it for all of our experiments, often by a significant margin.
+
+# 3 METHOD
+
+We denote by $T$ and $S$ the teacher and student networks respectively. We split these networks into two parts: (i) A convolutional feature extractor $f _ { N e t } , N e t = \{ T , S \}$ , the output of which at the $i$ -th layer is a feature tensor $F _ { N e t } ^ { i } \in \mathbb { R } ^ { C _ { N e t } ^ { i } \times H ^ { i } \times W ^ { i } }$ , where $C _ { N e t } ^ { i }$ is the output feature dimensionality, and $H ^ { i } , W ^ { i }$ the output spatial dimensions. We also denote by $\begin{array} { r } { h _ { N e t } = \sum _ { h = 1 } ^ { { H } ^ { L } } \sum _ { w = 1 } ^ { { W } ^ { L } } F _ { N e t } ^ { L } \in \mathbb { R } ^ { C _ { N e t } ^ { L } } } \end{array}$ the last layer feature representation learned by $f _ { N e t }$ . (ii) A projection matrix $W _ { N e t } \in \mathbb { R } ^ { C _ { N e t } ^ { L } \times K }$ which projects the feature representation $h _ { N e t }$ into $K$ class logits $z _ { N e t } ^ { i } , i = 1 , \dots , K$ , followed by the softmax function $\begin{array} { r } { s ( z _ { N e t } ^ { i } ) = \frac { \exp ( z _ { N e t } ^ { i } / \tau ) } { \sum _ { j } \exp ( z _ { N e t } ^ { j } / \tau ) } } \end{array}$ with temperature $\tau$ $\mathit { \Pi } _ { \tau } = 1$ for Cross Entropy loss) which put together form a softmax regression classifier into $K$ classes.
+
+Knowledge Distillation (KD) (Hinton et al., 2015) trains the student with the following loss:
+
+$$
+L _ { K D } = - \sum _ { k = 1 } ^ { K } s ( z _ { T } ^ { k } ) \log s ( z _ { S } ^ { k } ) ,
+$$
+
+so that the discrepancy between the teacher’s and student’s classifiers is directly minimized.
+
+FitNets (Romero et al., 2015) match intermediate feature representations. For the $i$ -th layer, the following loss is defined:
+
+$$
+L _ { F i t } = \left\| F _ { T } ^ { i } - r ( F _ { S } ^ { i } ) \right\| ^ { 2 } ,
+$$
+
+where $r ( . )$ is a function for matching the feature tensor dimensions.
+
+In our work, we propose to minimize the discrepancy between the representations $h _ { T }$ and $h _ { S }$ . To accomplish this goal, we propose to use two losses. The first one is an $L _ { 2 }$ feature matching loss:
+
+$$
+L _ { F M } = \left\| h _ { T } - h _ { S } \right\| ^ { 2 } ,
+$$
+
+where for notational simplicity we dropped the dependency on $r ( . )$ . Hence, $L _ { F M }$ loss is a simplified FitNet loss which focuses only on the final representation learned. The intuition for this is that this feature is directly connected to the classifier and hence imposing the student’s feature to be similar to that of the teacher could have more impact on classification accuracy. Moreover, it might be questionable why one should optimize for other intermediate representations as in (Romero et al., 2015) especially when the student is a network of lower representational capacity. In Section 4: Where should the losses be applied?, we confirm that $L _ { F M }$ alone has a positive impact but feature matching in other layers is not helpful.
+
+We found $L _ { F M }$ to be effective but only to limited extent. One disadvantage of $L _ { F M }$ and, in general, of all feature matching losses e.g. (Romero et al., 2015; Zagoruyko & Komodakis, 2017), is that it treats each channel dimension in the feature space independently, and ignores the inter-channel dependencies of the feature representations $h _ { S }$ and $h _ { T }$ for the final classification. This is in contrast to the original logit matching loss proposed by Hinton et al. in (Hinton et al., 2015) which directly targets classification accuracy. To alleviate the aforementioned problem, in this work, we propose a second loss for optimizing $h _ { S }$ which is directly linked with classification accuracy. To this end, we will use the teacher’s pre-trained Softmax Regression (SR) classifier.
+
+Let us denote by $p$ the output of the teacher network when fed with some input image $x$ . Let us also feed the same image through the student network to obtain feature $h _ { S } ( x )$ . Finally let us pass $h _ { S } ( x )$ through the teacher’s SR classifier to obtain output $q$ . See also Fig. 1. Our loss is defined as:
+
+$$
+L _ { S R } = - p \log q .
+$$
+
+At this point, we make the following two observations: (1) If $p = q$ (and since the teacher’s classifier is frozen), then this implies that $\bar { h _ { S } } ( x ) = h _ { T } ( x )$ which shows that indeed Eq. (4) optimizes the student’s feature representation $h _ { S }$ ( $h _ { T }$ is also frozen). (2) The loss of Eq.(4) can be written as:
+
+$$
+\begin{array} { r } { L _ { S R } = - s ( W _ { T } ^ { \prime } h _ { T } ) \log s ( W _ { T } ^ { \prime } h _ { S } ) . } \end{array}
+$$
+
+Now let us now write KD loss in a similar way:
+
+$$
+\begin{array} { r } { L _ { K D } = - s ( W _ { T } ^ { \prime } h _ { T } ) \log s ( W _ { s } ^ { \prime } h _ { S } ) . } \end{array}
+$$
+
+By comparing Eq. (5) with Eq. (6), we see that the only difference in our method is that the frozen, pre-trained teacher’s classifier is used for both teacher and the student. On the contrary, in KD, $W _ { S }$ is also optimized. This gives more degrees of freedom to the optimization algorithm, in particular, to adjust the weights of both the student’s feature extractor $f _ { S }$ and the student’s classifier $W _ { S }$ in order to minimize the loss. This has an impact on the learning of the student’s feature representation $h _ { S }$ which, in turn, hinders the generalization capability of the student on the test set. We confirm this hypothesis with the experiment of Section 4: Transferability of representations.
+
+Finally, we note that we found that, in practice, an $L _ { 2 }$ loss between the logits:
+
+$$
+L _ { K D } = \left\| \boldsymbol { W _ { T } ^ { \prime } } \boldsymbol { h _ { T } } - \boldsymbol { W _ { T } ^ { \prime } } \boldsymbol { h _ { S } } \right\| ^ { 2 } = \left\| \boldsymbol { h _ { T } } - \boldsymbol { h _ { S } } \right\| _ { W _ { T } } ^ { 2 } ,
+$$
+
+works slightly better than the cross-entropy loss. The comparison between different types of losses for $L _ { S R }$ is given in the appendix.
+
+Table 1: Effect of proposed losses ( ${ \cal L } _ { F M }$ and $L _ { S R }$ ) and position of distillation on the test set of CIFAR-100.
+
+
Method
Layer
Top-1 (%)
Top-5 (%)
Student (WRN-16-4)
76.97
93.89
Teacher (WRN-40-4) LFM
79.50 78.05
94.57 94.45
LSR
conv4 conv4
79.10
94.99
LFM+LSR
conv4
79.58
95.21
LFM+LsR
conv2
77.03
93.94
LFM+LsR
conv3
77.34
94.22
conv2+3+4
LFM+LsR
79.43
94.80
+
+Overall, in our method, we train the student network using three losses:
+
+$$
+{ \cal L } = { \cal L } _ { C E } + \alpha { \cal L } _ { F M } + \beta { \cal L } _ { S R } ,
+$$
+
+where $\alpha$ and $\beta$ are the weights used to scale the losses. The teacher network is pretrained and fixed during training the student. $L _ { C E }$ is the standard loss based on ground truth labels for the task in hand (e.g. cross-entropy loss for image classification). Note that this results in a very simple algorithm for training the student, summarized in Algorithm 1.
+
+# Algorithm 1 Knowledge distillation via Softmax Regression Representation Learning
+
+Input: Teacher network $T$ , Student network $S$ , input image x, ground truth label $y$ , weights $\alpha$ , $\beta$ . 1. Input $\mathbf { x }$ to $S$ to obtain feature $h _ { S }$ and class prediction $\hat { y }$ . Calculate cross entropy loss $\boldsymbol { L _ { C E } } = \mathcal { H } ( \boldsymbol { \hat { y } } , \boldsymbol { y } )$ ; 2. Input $\mathbf { x }$ to $T$ to obtain feature $h _ { T }$ . Calculate distillation losses from Eqs. (3) and (7); 3. Update $S$ by optimizing Eq. (8)
+
+Output: the updated $S$
+
+# 4 ABLATION STUDIES
+
+We conducted a set of ablation studies on CIFAR-100 (see Section 5.1) using a Wide ResNet (WRN) for both teacher (WRN-40-4) and student (WRN-16-4) (for network definitions, see Section 5).
+
+Are both $L _ { F M }$ and $L _ { S R }$ useful? To answer this question, we ran 3 experiments: using $L _ { F M }$ alone, $L _ { S R }$ alone, and combining them together ${ \cal L } _ { F M } + { \cal L } _ { S R }$ . The results of Table 1 (first 3 rows) clearly show that all proposed variants offer significant gains: when using $L _ { F M }$ and $L _ { S R }$ alone, $\sim 1 \%$ and $\sim 2 \%$ improvements in Top-1 accuracy were obtained. Moreover, when combining them together, an additional $\sim 0 . 4 \%$ improvement was gained. Importantly, the results show that $L _ { S R }$ is significantly more effective than $L _ { F M }$ . We further note at this point that we found that $L _ { F M }$ offers diminishing gains on ImageNet experiments.
+
+Where should the losses be applied? The proposed losses can be applied at other layers of the networks too. This is straightforward for $L _ { F M }$ . We can also extend $L _ { S R }$ to more layers, by transferring the mean feature of the student at each layer to the corresponding layer of the teacher using an AdaIN layer (Huang & Belongie, 2017). On one hand, applying the losses early in the network could ensure that the subsequent layers receive “better” features. On the other hand, features produced by early layers are not specialised to a particular class. Thus, applying the distillation losses towards the end of the network, where the activations encode discriminative, task-related features should lead to potentially stronger models. The results from Table 1 (last 3 rows) confirm our hypothesis: Applying the loss at multiple points in the network actually rather hurts accuracy.
+
+Teacher-student similarity: The overall aim of knowledge distillation is to make the student mimic the teacher’s output, so that the student is able to obtain similar performance to that of the teacher. Therefore, to see how well the student mimics the teacher, we measured the similarity between the teacher’s and student’s outputs using (a) the KL divergence between the teacher’s and student’s outputs, and (b) the cross-entropy loss between the student’s predictions and the ground truth labels.
+
+Table 2: KL divergence between teacher and student, and cross-entropy between student and ground truth on the test set of CIFAR-100. Teacher’s top-1 accuracy is $7 9 . 5 0 \%$ .
+
+
Method
KL div.with teacher
Cross-entropy with label
Top-1 (%)
Student KD AT
0.5964
0.9383
76.97
0.5818
0.9492
78.35
0.5406
0.9049
78.06
LFM LsR LFM+LSR
0.5701
0.8980
78.05
0.4828
0.8418
79.10
0.4597
0.8247
79.58
+
+Table 3: $L _ { 2 }$ Distance $\left\| h _ { T } - h _ { S } \right\| ^ { 2 }$ , and NMI calculated on the test set of CIFAR-100.
+
+
Method
Student
LFM
LsR
LFM+LSR
L2Distance
1.48
1.33
1.07
1.01
NMI (%).
77.20
78.31
79.35
79.85
Top-1(%).
76.97
78.05
79.10
79.58
+
+From Table 2, it can be observed that KD (Hinton et al., 2015) reduces the KL divergence with the teacher’s output offering $\sim 1 . 5 \%$ accuracy gain. AT (Zagoruyko & Komodakis, 2017) also decreases the KL divergence with the teacher’s output offering a smaller accuracy gain of $\sim 1 . 0 \%$ . Moreover, both proposed losses $L _ { F M }$ and $L _ { S R }$ and their combination ${ \cal L } _ { F M } + { \cal L } _ { S R }$ show considerably high similarity compared to the KD and AT. This similarity is one of the main reasons for the improved student’s accuracy offered by our method.
+
+
+Figure 2: Visualization of $h _ { S }$ and $h _ { T }$ on the test set of CIFAR-100. Better viewed in color.
+
+Representations distance: Table 3 shows the $L _ { 2 }$ distance between the teacher and student representations $h _ { T }$ and $h _ { S }$ . The results, presented in Table 3, clearly show that both $L _ { F M }$ and $L _ { S R }$ narrow the distance, with their combination being the closest to the teacher.
+
+Normalized Mutual Information (NMI): Moreover, we calculated the NMI (Manning et al., 2008) which is a balanced metric that can be used to determine the quality of feature clustering. The results, presented in Table 3, show that ${ \cal L } _ { F M } + { \cal L } _ { S R }$ has the highest NMI score, meaning that the features are better clustered. Qualitative results are shown in Figure 2, which visualizes the features $h _ { S }$ and $h _ { T }$ . It can be observed that ${ \cal L } _ { F M } + { \cal L } _ { S R }$ is able to learn more discriminative features, which also correlates with quantitative accuracy gains.
+
+Transferability of representations: Following (Tian et al., 2020), this section aims to compare the representational power of the learned student’s representation $h _ { S }$ . To this end, we trained the student on CIFAR100, and then used it as a frozen feature extractor on top of which we train a linear classifier for 2 datasets: STL10 Coates et al. (2011) and CIFAR100. We compare the transfer ability of KD, CRD, $L _ { F M }$ , $L _ { S R }$ , and ${ \cal L } _ { F M } + { \cal L } _ { S R }$ . The superiority of the proposed losses over KD on STL is evident. Importantly, $L _ { S R }$ largely outperforms KD which confirms our analysis of Eqs. (5) and (6). The best results on STL are obtained by CRD. However, on CIFAR100, which is the target distillation dataset our method outperforms CRD.
+
+# 5 COMPARISON WITH STATE-OF-THE-ART
+
+We thoroughly evaluated the effectiveness of our method across multiple (a) network architectures (ResNet (He et al., 2016), Wide ResNet (Zagoruyko & Komodakis, 2016), MobileNetV2 (Sandler et al., 2018), MobileNet (Howard et al., 2017)) with different teacher-student capacities, (b) datasets (CIFAR10/100, ImageNet), and (c) domains (real-valued and binary networks). The training details for all experiments are provided in the appendix. We denote with ResNet-N a Residual Network with N convolutional layers (He et al., 2016). We denote with WRN-D- $k$ a WRN architecture with $D$ layers and an expansion rate of $k$ (Zagoruyko & Komodakis, 2017).
+
+Table 4: Transferability of representations from CIFAR100 to STL-10 and CIFAR100 by freezing $f ^ { S }$ and training a linear classifier on top. Top 1 $( \% )$ accuracy is provided.
+
+
Student
Dataset
KD
CRD
LFM
LSR
LFM+LsR
WRN16-4
STL10
68.75
72.45
69.3
71.44
72.17
WRN16-4
CIFAR100
78.28
78.46
77.95
79.03
79.34
MobileNetV2
STL10
62.17
69.74
66.12
68.23
68.95
MobileNetV2
CIFAR100
69.17
70.68
70.66
71.00
71.63
+
+Table 5: Top-1 accuracy $( \% )$ of various knowledge distillation methods on CIFAR-10.
+
+
Student(Params)
Teacher(Params)
Student
KD AT
OFD
RKD
Ours
Teacher
WRN-16-1 (0.18M)
WRN-16-2 (0.69M)
91.04
92.57 92.15
92.28
92.51
92.95
93.98
WRN-16-2 (0.69M)
WRN-40-2 (2.2M)
93.98
94.46 94.39
94.30
94.41
94.66
95.07
ResNet-8 (0.08M)
ResNet-26 (0.37M)
87.78
88.75 88.15
87.49
88.50
89.02
93.58
ResNet-14 (0.17M)
ResNet-26 (0.37M)
91.59
92.57 92.11
92.51
92.36
92.70
93.58
ResNet-18 (0.7M)
ResNet-34 (1.4M)
93.35
93.74 93.52
93.80
92.95
93.92
94.11
WRN-16-1 (0.18M)
ResNet-26 (0.37M)
91.04
92.42 91.32
92.47
92.08
92.94
93.58
+
+For the above mentioned settings, we compare our method with KD (Hinton et al., 2015) and AT (Zagoruyko & Komodakis, 2017), and the more recent methods of OFD (Heo et al., 2019a), RKD (Park et al., 2019), CRD (Tian et al., 2020).
+
+Overview of results: From our experiments, we conclude that our approach offers consistent gains across all of the above scenarios, outperforming all methods considered for all settings. Notably, our method is particularly effective for the most difficult datasets (i.e. CIFAR-100 and ImageNet).
+
+# 5.1 CIFAR-10/100
+
+For CIFAR-10, Top-1 performance of our method is shown in Table 5. We tested three cases representing different network architectures for student and teacher networks: the first two experiments are with WRNs. The following three experiments are with ResNets. In the last experiment, teacher and student have different network architectures. Overall, our method achieves the best results for all cases, with KD (Hinton et al., 2015) closely following.
+
+For CIFAR-100 (Krizhevsky & Hinton, 2009), we experimented with several student-teacher network pairs using different structures. Experiments are grouped in three sets. The first shows performance for different teacher and student capacities using WRNs: poor student - good teacher (WRN-16-2; WRN-40-4), descent student - good teacher (WRN-10-10; WRN-16-10); good student - good teacher (WRN-16-4; WRN-40-4). In the second set, we show that these results hold when using a different architecture, ResNet in this case. The final set is designed to show performance when teacher and student have different architectures (MobileNetV2, ResNet and WRN).
+
+Top-1 performance of our method is shown in Table 11. We observe that for almost all configurations, our method achieves consistent and significant accuracy gains over prior work. Furthermore, it is hard to tell which is the second best method as the remaining methods have their own advantages for different configurations. For WRN experiments, OFD ranks second. For ResNet and mixed structure experiments, CRD ranks second. More comparisons with other methods and results obtained by combining our method with KD and AT are provided in the supplementary material. Further improvements could be obtained by combining our method with others but this requires a comprehensive investigation which goes beyond the scope of this paper.
+
+Table 6: Top-1 accuracy $( \% )$ of various knowledge distillation methods on CIFAR-100.
+
+
Student (Params)
Teacher (Params)
Student
KD
AT
OFD
RKD
CRD
Ours
Teacher
WRN-16-2 (0.70M)
WRN-40-4 (8.97M)
72.70
74.52
74.33
75.57
74.23
75.27
75.96
79.50
WRN-16-4 (2.77M)
WRN-40-4 (8.97M)
76.97
78.35
78.06
79.29
78.38
78.83
79.58
79.50
WRN-10-10 (7.49M)
WRN-16-10 (17.2M)
76.27
78.20
76.44
78.72
77.84
78.35
79.17
79.77
ResNet-10 (0.34M)
ResNet-34(1.39M)
68.42
69.18
68.49
68.94
68.70
70.24
69.91
72.05
ResNet-18 (0.75M)
ResNet-50 (1.99M)
71.07
73.41
71.90
72.79
70.93
73.23
73.47
73.31
ResNet-10 (4.95M)
ResNet-34 (21.33M)
75.01
77.35
76.87
77.35
77.46
77.37
77.90
78.44
WRN-16-2 (0.70M)
ResNet-34 (21.33M)
72.70
73.95
72.32
74.78
73.91
74.88
75.38
78.44
MobileNetV2 (2.37M)
ResNet-34 (21.33M)
68.42
69.36
68.60
69.45
68.75
71.36
71.58
78.44
MobileNetV2 (2.37M)
WRN-40-4 (8.97M)
68.42
69.15
68.95
70.08
68.19
71.46
71.82
79.50
+
+Table 7: Comparison with state-of-the-art on ImageNet.
+
+
Student (Params)
Teacher (Params)
Student
KD
AT
OFD
RKD
CRD
Ours
Teacher
ResNet18 (11.69M)
ResNet34 (21.80M)
Top-1 Top-5
70.04 89.48
70.68 90.16
70.59 89.73
71.08 90.07
71.34 90.37
71.17 90.13
71.73 90.60
73.31 91.42
MobileNet (4.23M))]
ResNet50 (25.56M)
Top-1 Top-5
70.13 89.49
70.68 90.30
70.72 90.03
71.25 90.34
71.32 90.62
71.40 90.42
72.49 90.92
76.16 92.86
+
+# 5.2 IMAGENET-1K
+
+Our experiments include two pairs of networks which are popular settings for ImageNet (Russakovsky et al., 2015). The first is distillation from ResNet-34 to ResNet-18 and the second one is distillation from ResNet-50 to MobileNet (Howard et al., 2017). Note that, following (Tian et al., 2020) on ImageNet, for KD, we set the weight for the KL loss to 0.9, the weight for cross-entropy loss to 0.5 which helps to obtain better accuracy.
+
+Our results are presented in Table 7. Again, we observe that our method achieves significant improvements over all competing methods. Moreover, there is no method which is consistently second: for ResNet-34 to ResNet-18 experiment, RKD is the second best while for ResNet-50 to MobileNet, CRD is the second best. Notably, for the latter experiment, CRD reduces the gap between the teacher and the student by $1 . 2 7 \%$ , while our method narrows it by $2 . 3 6 \%$ . Overall, our results on ImageNet validate the scalability of our method, and show that, when applied to a large-scale dataset, we achieve an even more favourable performance compared against competing methods.
+
+Table 8: Real-to-binary distillation results on CIFAR-100: a real-valued teacher ResNet-34 is used to distill a binary student. Real-to-binary distillation results on ImageNet-1K: a real-valued ResNet-18 is used to distill a binary student. OFD result might be suboptimal.
+
+
Dataset
Method
Binary
KD
AT
OFD
RKD
CRD
Ours
Real
CIFAR-100
ResNet34
65.34
68.65
68.54
66.84
68.61
68.78
70.50
75.08
ImageNet-1K
ResNet18
56.70
57.39
58.45
55.74
58.84
58.25
59.57
70.20
+
+# 5.3 BINARY NETWORKS DISTILLATION
+
+Training highly accurate binary neural networks (i.e. the most extreme case of quantization) is a very challenging task (Rastegari et al., 2016; Bulat & Tzimiropoulos, 2019), and to this end, knowledge distillation appears to be a promising direction. In this section, we present results by applying distillation for the task of training binary student networks guided by real-valued teacher networks. The network architecture is kept the same for both the student and the teacher in this case: specifically we used a ResNet using the modifications described in (Bulat & Tzimiropoulos, 2019).
+
+Table 8 presents our results. Again, we observe that our method outperforms all methods considerably, showing that it can effectively transfer knowledge between different domains. Note that it was not clear to us where to place the distillation position for OFD, so although we included our result for this method, we emphasize that this result might be suboptimal.
+
+# 5.4 FACIAL LANDMARK DETECTION
+
+Given a face image, the task is to localise a set of facial landmarks in terms of their (x,y) coordinates. This is often solved by using a CNN to directly regress the (x,y) coordinates of the facial landmarks. In order to show the suitability of our method for this problem, we use the WFLW Wu et al. (2018) dataset, which is one of the hardest benchmarks for this task. Performance is measured in terms of Normalised Mean Error (lower is better), which is the standard metric for the problem. In our experiment, we use a ResNet50 as the teacher and a ResNet8 as the student. The results, shown in Table 9, confirm the superior performance of our method when compared to other state-of-the-art methods.
+
+Table 9: Facial landmark detection with ResNet50 as teacher and ResNet8 as student. KD is adapted by using an L2 loss instead of a KL loss to measure the discrepancy between the teach and student predictions.
+
+
Student(Params)
Teacher(Params)
1
Student
KD
RKD
PKT
LFM
AT
Ours
Teacher
ResNet8(7.25M) ResNet50(26.25M)
NME
7.43
7.32
6.94
7.09
7.14
6.96
6.81
6.38
+
+# 6 CONCLUSION
+
+We presented a method for knowledge distillation that optimizes the output feature of the penultimate layer of the student network and hence is directly related to representation learning. A key to our method is the newly proposed Softmax Regression Loss which was found necessary for effective representation learning. We showed that our method consistently outperforms other stateof-the-art distillation methods for a wide range of experimental settings including multiple network architectures (ResNet, Wide ResNet, MobileNet) with different teacher-student capacities, datasets (CIFAR10/100, ImageNet), and domains (real-valued and binary networks).
+
+# REFERENCES
+
+Sungsoo Ahn, Shell Xu Hu, Andreas Damianou, Neil D Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In CVPR, 2019.
+Cristian Bucilua, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In ˇ KDD, 2006.
+Adrian Bulat and Georgios Tzimiropoulos. XNOR-Net $^ { + + }$ : Improved binary neural networks. In BMVC, 2019.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. ICML, 2020.
+Jang Hyun Cho and Bharath Hariharan. On the efficacy of knowledge distillation. In ICCV, 2019.
+Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In International conference on artificial intelligence and statistics, 2011.
+Simon S Du and Jason D Lee. On the power of over-parametrization in neural networks with quadratic activation. In ICML, 2018.
+Yushuo Guan, Pengyu Zhao, Bingxuan Wang, Yuanxing Zhang, Cong Yao, Kaigui Bian, and Jian Tang. Differentiable feature aggregation search for knowledge distillation. In ECCV, 2020.
+Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. ICLR, 2016.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
+
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
+
+Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, and Jin Young Choi. A comprehensive overhaul of feature distillation. In ICCV, 2019a.
+
+Byeongho Heo, Minsik Lee, Sangdoo Yun, and Jin Young Choi. Knowledge transfer via distillation of activation boundaries formed by hidden neurons. In AAAI, 2019b.
+
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv:1503.02531, 2015.
+
+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:1704.04861, 2017.
+
+Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017.
+
+Zehao Huang and Naiyan Wang. Like what you like: Knowledge distill via neuron selectivity transfer. arXiv:1707.01219, 2017.
+
+Himalaya Jain, Spyros Gidaris, Nikos Komodakis, Patrick Perez, and Matthieu Cord. QUEST: ´ Quantized embedding space for transferring knowledge. In ECCV, 2020.
+
+Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In ICLR, 2020.
+
+Jangho Kim, SeongUk Park, and Nojun Kwak. Paraphrasing complex network: Network compression via factor transfer. In NeurIPS, 2018.
+
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, 2009.
+
+Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In CVPR, 2016.
+
+Seung Hyun Lee, Dae Ha Kim, and Byung Cheol Song. Self-supervised knowledge distillation using singular value decomposition. In ECCV, 2018.
+
+Changlin Li, Jiefeng Peng, Liuchun Yuan, Guangrun Wang, Xiaodan Liang, Liang Lin, and Xiaojun Chang. Block-wisely supervised neural architecture search with knowledge distillation. In CVPR, 2020a.
+
+Xiaojie Li, Jianlong Wu, Hongyu Fang, Yue Liao, Fei Wang, and Chen Qian. Local correlation consistency for knowledge distillation. In ECCV, 2020b.
+
+Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. arXiv, 2018.
+
+Yufan Liu, Jiajiong Cao, Bing Li, Chunfeng Yuan, Weiming Hu, Yangxi Li, and Yunqiang Duan. Knowledge distillation via instance relationship graph. In CVPR, 2019.
+
+Christopher D Manning, Prabhakar Raghavan, and Hinrich Schutze. ¨ Introduction to information retrieval (chapter 16). Cambridge university press, 2008.
+
+Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In CVPR, 2019.
+
+Nikolaos Passalis, Maria Tzelepi, and Anastasios Tefas. Heterogeneous knowledge distillation using information flow modeling. In CVPR, 2020.
+
+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.
+
+Baoyun Peng, Xiao Jin, Jiaheng Liu, Shunfeng Zhou, Yichao Wu, Yu Liu, Dongsheng Li, and Zhaoning Zhang. Correlation congruence for knowledge distillation. In ICCV, 2019.
+
+Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: ImageNet classification using binary convolutional neural networks. In ECCV, 2016.
+
+Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. ICLR, 2015.
+
+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. IJCV, 2015.
+
+Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. MobileNetV2: Inverted residuals and linear bottlenecks. In CVPR, 2018.
+
+Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. TIT, 2018.
+
+Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In ICLR, 2020.
+
+Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In ICCV, 2019.
+
+Jiaxiang Wu, Cong Leng, Yuhang Wang, Qinghao Hu, and Jian Cheng. Quantized convolutional neural networks for mobile devices. In CVPR, 2016.
+
+Wayne Wu, Chen Qian, Shuo Yang, Quan Wang, Yici Cai, and Qiang Zhou. Look at boundary: A boundary-aware face alignment algorithm. In CVPR, 2018.
+
+Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In CVPR, 2017.
+
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
+
+Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the perfor mance of convolutional neural networks via attention transfer. In ICLR, 2017.
+
+Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. ICLR, 2017.
+
+# A APPENDIX
+
+# A.1 STUDY OF THE HYPER-PARAMETERS $\alpha$ AND $\beta$
+
+We only performed a very basic search to find the best hyper-parameters. First, we fix $\alpha$ and search for the best $\beta$ . Then, we used the best $\beta$ , and search for the best $\alpha$ . This is sub-optimal compared to a full grid search over $\alpha$ and $\beta$ . Furthermore, after some preliminary experimentation, we considered only for 2 values: 1 and 5. Notably, we found that for all teacher-student pairs but (T:WRN40 4, S:MV2) alpha $^ { = 1 }$ is the optimal value. Furthermore, on ImageNet, the optimal values were $\alpha = 1$ , $\beta = 1$ for all teacher-student pairs considered.
+
+# A.2 DATASETS AND TRAINING DETAILS
+
+CIFAR-10 CIFAR-10 is a popular image classification dataset consisting of 50,000 training and 10,000 testing images equally distributed across 10 classes. All images are of resolution $3 2 \times 3 2 \mathrm { p x }$ . Following (Zagoruyko & Komodakis, 2017), during training, we randomly cropped and horizontally flipped the images. The ResNet models were trained for 350 epochs using SGD. The initial learning rate was set to 0.1, and then it was reduced by a factor of 10 at epochs 150, 250 and 320. Similarly, the WRN models were trained for 200 epochs with a learning rate of 0.1 that was subsequently reduced by 5 at epochs 60, 120 and 160. In all experiments, we set the dropout rate to 0.
+
+For traditional KD (Hinton et al., 2015), we set $\alpha \ : = \ : 0 . 9$ and $T \ = \ 4$ . For AT (Zagoruyko & Komodakis, 2017), as in (Zagoruyko & Komodakis, 2017; Tung & Mori, 2019), we set the weight of distillation loss to 1000. We note that, in our experiments, the AT loss is added after each layer group for WRN and the last two groups for ResNet as in (Zagoruyko & Komodakis, 2017). Following OFD (Heo et al., 2019a), we set the weight of distillation loss to $1 0 ^ { - 3 }$ . For RKD (Park et al., 2019), we set $\beta _ { 1 } = 2 5$ for distance, and $\beta _ { 2 } = 5 0$ for angle, as described in (Park et al., 2019; Tian et al., 2020). We did not compare with CRD (Tian et al., 2020) on CIFAR-10 because, in our experiments, we found that their parameter setting (used in their paper for CIFAR-100 and ImageNet-1K) does not obtain good performance on CIFAR-10.
+
+CIFAR-100 For CIFAR-100 (Krizhevsky & Hinton, 2009), we used a standard data augmentation scheme (Zagoruyko & Komodakis, 2017) including padding 4 pixels prior to random cropping and horizontal flipping. We used SGD with weight decay 5e-4 and momentum 0.9. Batch size was set to 128. Learning rate was set to 0.1; then decayed by 0.1 at epochs 100, 150, until training reached 200 epochs (Heo et al., 2019a).
+
+ImageNet-1K Images are cropped to $2 2 4 \times 2 2 4$ pixels for both training and evaluation. We used SGD with Nesterov momentum 0.9, weight decay $1 e - 4$ , initial learning rate 0.2 which was then dropped by a factor of 10 every 30 epochs, training in total for 100 epochs (for CRD we trained with 10 more epochs as suggested by the authors). Batch size was set to 512. For simplicity and to enable a fair comparison, we used pretrained PyTorch models Paszke et al. (2017) as teacher networks Heo et al. (2019a); Tian et al. (2020). For binary experiments, we used Adam as the optimizer with initial learning 0.002 which was then reduced by a factor of 10 every 30 epochs, training in total for 100 epochs.
+
+# A.3 ADDITIONAL ABLATION STUDIES
+
+Different losses for $L _ { S R }$ : This part expands Section 4 of our paper by evaluating different losses for $L _ { S R }$ . The following loss functions are compared:
+
+1. L2 loss: $L _ { S R - L 2 } ( p , q ) = \left\| p - q \right\| ^ { 2 }$ . This is the loss used in Section 4 of our paper
+2. Cross Entropy loss (CE) with label $y$ $: L _ { S R - C E } ( q , y ) = \mathcal { H } ( q , y )$ .
+3. KL loss with temperature $\tau$ Hinton et al. (2015): $L _ { S R - K L } ( p , q ) = K L ( q / \tau , p / \tau ) .$
+
+The results, presented in Table 10, show that all loss functions offer significant improvement gains while $L _ { F M } + L _ { S R - L 2 }$ achieves the best accuracy. Therefore, in our paper, $L _ { S R - L 2 }$ is used in all cases.
+
+Table 10: Evaluation of different loss functions for $L _ { S R }$ in terms of Top-1 accuracy on CIFAR-100.
+
+
Method
Top-1(%)
Top-5(%)
Student: WRN-16-4
76.97
93.89
Teacher:WRN-40-4
79.50
94.57
LFM+LSR-L2
79.58
95.21
LFM+LSR-CE
78.80
95.13
LFM+LSR-KL
79.04
95.12
+
+Combining our method with KD and AT: Table 11 shows additional comparisons on CIFAR100 by combining our method with AT Zagoruyko & Komodakis (2017) and KD Hinton et al. (2015), respectively. The results show that a straightforward combination did not provide satisfactory results, however it could be possible that a more comprehensive investigation might prove to be beneficial.
+
+# A.4 ADDITIONAL COMPARISONS
+
+This section provides additional comparisons using the evaluation framework of CRD Tian et al. (2020). Comparisons include distillation between models with the same architecture (e.g. ResNet56 to ResNet20) and between different architectures (e.g. ResNet50 to MobileNetV2). In order to maximize the fairness of the comparison, we followed their experimental setting. Thus, we did not choose the training parameters, teacher-student architecture pairs or methods to compare against. The competing methods included are:
+
+Table 11: Top-1 accuracy $( \% )$ of combining our method with KD and AT on CIFAR-100.
+
+
Student (Params)
Teacher (Params)
Student
KD
AT
KD+Ours
AT+Ours
Ours
Teacher
WRN-16-2 (0.70M)
WRN-40-4 (8.97M)
72.70
74.52
74.33
74.97
75.01
75.96
79.50
WRN-16-4 (2.77M)
WRN-40-4 (8.97M)
76.97
78.35
78.06
79.00
79.09
79.58
79.50
WRN-10-10 (7.49M)
WRN-16-10 (17.2M)
76.27
78.20
76.44
78.84
77.79
79.17
79.77
ResNet-10 (0.34M)
ResNet-34 (1.39M)
68.42
69.18
68.49
70.41
69.41
69.91
72.05
ResNet-18 (0.75M)
ResNet-50 (1.99M)
71.07
73.41
71.90
73.46
73.17
73.47
72.83
ResNet-10 (4.95M)
ResNet-34 (21.33M)
75.01
77.35
76.87
77.64
77.48
77.90
78.44
WRN-16-2 (0.70M)
ResNet-34 (21.33M)
72.70
73.95
72.32
74.90
74.71
75.38
78.44
MobileNetV2 (2.37M)
ResNet-34(21.33M)
68.42
69.36
68.60
71.08
70.70
71.58
78.44
MobileNetV2 (2.37M)
WRN-40-4 (8.97M)
68.42
69.15
68.95
70.85
70.63
71.82
79.50
+
+• Classic: Knowledge Distillation (KD) Hinton et al. (2015), FitNet Romero et al. (2015), Attention Transfer (AT) Zagoruyko & Komodakis (2017).
+Most recent: Similarity-Preserving KD (SP) (Tung & Mori, 2019), Correlation Congruence (CC) (Peng et al., 2019), Variational Information Distillation (VID) (Ahn et al., 2019), Relational Knowledge Distillation (RKD) (Park et al., 2019), Distillation of Activation Boundaries (AB) (Heo et al., 2019b), Factor Transfer (FT) (Kim et al., 2018), Flow of Solution (FSP) (Yim et al., 2017) and Contrastive Representation Distillation (CRD) (Tian et al., 2020).
+
+Table 12: Distillation experiment with the same architectures (Tian et al., 2020): Top-1 accuracy $( \% )$ on CIFAR-100. The student models were trained with a teacher of the same architecture. We report average over 3 runs as in (Tian et al., 2020).
+
+
Teacher Student
wrn-40-2 wrn-16-2 75.61 73.26
wrn-40-2 wrn-40-1 75.61 71.98
resnet56 resnet20 72.34 69.06
resnet110 resnet20 74.31 69.06
resnet110 resnet32 74.31 71.14
resnet32x4 resnet8x4 79.42 72.50
vgg13 vgg8 74.64 70.36
KD
74.92
73.54
70.66
70.67
73.08
73.33
72.98
FitNet
73.58
72.24
69.21
68.99
71.06
73.50
71.02
AT
74.08
72.77
70.55
70.22
72.31
73.44
71.43
SP
73.83
72.43
69.67
70.04
72.69
72.94
72.68
CC
73.56
72.21
69.63
69.48
71.48
72.97
70.71
VID
74.11
73.30
70.38
70.16
72.61
73.09
71.23
RKD
73.35
72.22
69.61
69.25
71.82
71.90
71.48
PKT
74.54
73.45
70.34
70.25
72.61
73.64
72.88
AB
72.50
72.38
69.47
69.53
70.98
73.17
70.94
FT
73.25
71.59
69.84
70.22
72.37
72.86
70.58
FSP
72.91
0.00
69.95
70.11
71.89
72.62
70.23
NST
73.68
72.24
69.60
69.53
71.96
73.30
71.53
CRD
75.48
74.14
71.16
71.46
73.48
75.51
73.94
Ours
75.96
74.75
71.44
71.51
73.80
75.92
74.40
+
+Table 13: Distillation experiment with different architectures (Tian et al., 2020): Top-1 accuracy $( \% )$ on CIFAR-100. The student models were trained with a teacher of different architecture. We report average over 3 runs as in (Tian et al., 2020).
+
+
Teacher
vgg13 MobileNetV2 74.64
ResNet50 MobileNetV2 79.34
ResNet50 vgg8 79.34
resnet32x4 ShuffleNetV1 79.42
resnet32x4 ShuffleNetV2 79.42
wrn-40-2 ShuffleNetV1 75.61
Student
64.60
64.60 67.35
70.36 73.81
70.50 74.07
71.82 74.45
70.50 74.83
KD FitNet
67.37 64.14
63.16
70.69
73.59
73.54
73.73
AT
59.40
58.58
71.84
71.73
72.73
73.32
SP
66.30
68.08
73.34
73.48
74.56
74.52
CC
64.86
65.43
70.25
71.14
71.29
71.38
VID
65.56
67.57
70.30
73.38
73.40
73.61
RKD
64.52
64.43
71.50
72.28
73.21
72.21
PKT
67.13
66.52
73.01
74.10
74.69
73.89
AB
66.06
67.20
70.65
73.55
74.31
73.34
FT
61.78
60.99
70.29
71.75
72.50
72.03
NST
58.16
64.96
71.28
74.12
74.68
74.89
CRD
69.73
69.11
74.30
75.11
75.65
76.05
Ours
69.14
69.45
74.46
75.66
76.40
76.61
\ No newline at end of file
diff --git a/md/train/a1wQOh27zcy/a1wQOh27zcy.md b/md/train/a1wQOh27zcy/a1wQOh27zcy.md
new file mode 100644
index 0000000000000000000000000000000000000000..1d092532cb89f8a45872e82b4db9eca996a6f660
--- /dev/null
+++ b/md/train/a1wQOh27zcy/a1wQOh27zcy.md
@@ -0,0 +1,285 @@
+# Contrast and Mix: Temporal Contrastive Video Domain Adaptation with Background Mixing
+
+Aadarsh Sahoo1 Rutav Shah1 Rameswar Panda2 Kate Saenko2,3 Abir Das1 1 IIT Kharagpur, 2 MIT-IBM Watson AI Lab, 3 Boston University {sahoo_aadarsh@, rutavms@, abir@cse.}iitkgp.ac.in, rpanda@ibm.com, saenko@bu.edu
+
+# Abstract
+
+Unsupervised domain adaptation which aims to adapt models trained on a labeled source domain to a completely unlabeled target domain has attracted much attention in recent years. While many domain adaptation techniques have been proposed for images, the problem of unsupervised domain adaptation in videos remains largely underexplored. In this paper, we introduce Contrast and Mix (CoMix), a new contrastive learning framework that aims to learn discriminative invariant feature representations for unsupervised video domain adaptation. First, unlike existing methods that rely on adversarial learning for feature alignment, we utilize temporal contrastive learning to bridge the domain gap by maximizing the similarity between encoded representations of an unlabeled video at two different speeds as well as minimizing the similarity between different videos played at different speeds. Second, we propose a novel extension to the temporal contrastive loss by using background mixing that allows additional positives per anchor, thus adapting contrastive learning to leverage action semantics shared across both domains. Moreover, we also integrate a supervised contrastive learning objective using target pseudo-labels to enhance discriminability of the latent space for video domain adaptation. Extensive experiments on several benchmark datasets demonstrate the superiority of our proposed approach over state-of-the-art methods. Project page: https://cvir.github.io/projects/comix.
+
+# 1 Introduction
+
+Unsupervised domain adaptation (UDA), which alleviates the requirement of large amounts of annotated data by adapting a model learned on a labelled source domain to an unlabelled target domain, has drawn a great deal of attention in the last few years [12, 80]. Much progress has been made in developing deep UDA methods by minimizing the cross-domain divergence [39, 70], adding adversarial domain discriminators [20, 74], and image-to-image translation techniques [26, 51]. However, despite impressive results on commonly used benchmark datasets (e.g., [61, 75, 57]), most of the methods have been developed only for images and not for videos, where the annotation task is often more complicated requiring tedious human labor in comparison to images.
+
+More recently, very few works have attempted deep UDA for video action recognition by directly matching segment-level features [8, 27, 50, 42] or with attention weights [11, 53]. However, (1) trivially matching segment-level feature distributions by extending the image-specific approaches, without considering the rich temporal information may not alone be sufficient for video domain adaptation; (2) prior methods often focus on aligning target features with source, rather than exploiting any action semantics shared across both domains (e.g., difference in background with the same action: videos in the top row of Figure 1 are from the source and target domain respectively, but both capture the same action walking); (3) existing methods often rely on complex adversarial learning which is unwieldy to train, resulting in very fragile convergence.
+
+Meanwhile, self-supervised pretext tasks like predicting rotation and translation have recently emerged as an alternative to adversarial learning for unsupervised domain adaptation in images [38, 71]. While these works show the promising potential of self-supervised learning in aligning source and target domains, the more recent very successful contrastive representation learning [9, 23, 52] has never been used to adapt video action recognition models to target domains. Motivated by this, in this paper, we explore the following natural, yet important question: whether and how contrastive learning could be exploited for the challenging and practically important task of unsupervised video domain adaptation for human action recognition?
+
+To this end, we introduce Contrast and Mix (CoMix), a simple yet effective approach based on contrastive learning to adapt video action recognition models trained on a labeled source domain to unlabelled target domains. First, we propose to represent video as a graph and then utilize temporal contrastive self-supervised learning over the graph representations as a nexus between source and target domains to align features, without requiring any additional adversarial learning, as most prior works do in video domain adaptation [8, 11, 53]. Specifically, we maximize the similarity between encoded representations of the same video at two different speeds as well as minimize the similarity between different videos played at different speeds, leveraging the fact that changing video speed does not change an action on both domains. While minimization of contrastive self-supervised losses in both domains simultaneously helps in domain alignment, it ignores
+
+
+Figure 1: Background Mixing. Top row shows two representative videos from the source and target domain respectively. Both videos capture the same action “walking” with different backgrounds. Bottom row shows videos obtained after mixing target background with source video and vice versa.
+
+action semantics shared across them as the loss treats each domain individually. To alleviate this, we incorporate new synthetic videos into the temporal contrastive objective, which are obtained by mixing background of a video from one domain to a video from another domain, as shown in Figure 1 (bottom). Importantly, since mixing background doesn’t change the temporal dynamics, we introduce pseudo-labels for the mixed videos to be same as the label of the original videos and consider additional positives per anchor (see Figure 2), which encourages the model to generalize to new samples that may not be covered by temporal contrastive learning in hand. In other words, mixed background video of an input sample in the embedding space act as small semantic perturbations that are not imaginary, i.e., they are representative of the action semantics shared across source and target domains. Finally, rather than relying only on the supervision of source categories to learn a discriminative representation, we generate pseudo-labels for the target samples in every batch and then harness the label information using a temporal supervised contrastive term, that pushes the examples from the same class close and the examples from different classes further apart (Figure 2: right). While our modified contrastive losses are motivated by the supervised contrastive learning [30], we use pseudo labels for exploiting shared action semantics and discriminative information from target domain, instead of using true labels as an alternative to supervised cross-entropy loss (which is not present for target samples). To the best of our knowledge, ours is the first work that successfully leverages contrastive learning in an unified framework to align cross-domain features while enhancing discriminabilty of the latent space for unsupervised video domain adaptation.
+
+To summarize, the main contributions of our work are as follows:
+
+• We introduce Contrast and Mix (CoMix), a new contrastive learning framework to learn discriminative invariant feature representations for unsupervised video domain adaptation. Overall, CoMix is simple and easy to implement which perfectly fits into modern mini-batch end-to-end training.
+
+• We propose a novel extension to temporal contrastive loss by using background mixing that allows additional positives per anchor, thus adapting contrastive learning to leverage action semantics shared across both domains. We also integrate a supervised contrastive learning objective using pseudo label information from the target domain to enhance discriminabilty of the latent space.
+
+
+Figure 2: Temporal Contrastive Learning with Background Mixing and Target Pseudo-labels. Temporal contrastive loss (left) contrasts a single temporally augmented positive (same video, different speed) per anchor against rest of the videos in a mini-batch as negatives. Incorporating background mixing (middle) provides additional positives per anchor possessing same action semantics with a different background alleviating background shift across domains. Incorporating target pseudo-labels (right) additionally enhances the discriminabilty by contrasting the target videos with the same pseudo-label as positives against rest of the videos as negatives.
+
+• We conduct extensive experiments on several challenging benchmarks (UCF-HMDB [8], Jester [53], and Epic-Kitchens [50]) for video domain adaptation to demonstrate the superiority of our approach over state-of-the-art methods. Our experiments show that CoMix delivers a significant performance increase over the compared methods, e.g., CoMix outperforms SAVA [11] (ECCV’20) by $3 . 6 \%$ on UCF-HMDB [8] and $\mathrm { \bar { T } A ^ { 3 } N }$ [8] (ICCV’19) by $9 . 2 \%$ on Jester [45] benchmark respectively).
+
+# 2 Related Work
+
+Action Recognition. Much progress has been made in developing a variety of ways to recognize video actions, by either applying 2D-CNNs [6, 37, 47, 79] or 3D-CNNs [4, 17, 22, 73]. Many successful architectures are usually based on the two-stream model [67], processing RGB frames and optical-flow in two separate CNNs with a late fusion in the upper layers [29]. SlowFast network [18] employs two pathways for recognizing actions by processing a video at different frame rates. Mitigating background bias in action recognition has also been presented in [10, 36]. Despite remarkable progress, these models critically depend on large labeled datasets which impose challenges for cross-domain action recognition. In contrast, our work focuses on unsupervised domain adaptation for action recognition, with labeled data in source domain, but only unlabeled data in target domain.
+
+Unsupervised Domain Adaptation. Unsupervised domain adaptation has been studied from multiple perspectives (see reviews [12, 80]). Representative works minimize some measurement of distributional discrepancy [21, 39, 65, 70] or adopt adversarial learning [5, 20, 40, 56, 74] to generate domain-invariant features. Leveraging image translation [25, 26, 51] or style transfer [15, 91] is also another popular trend in domain adaptation. Deep self-training that focus on iteratively training the model using both labeled source data and generated target pseudo labels have been proposed in [46, 90]. Semi-supervised domain adaptation leveraging a few labeled samples from the target domain has also been proposed for many applications [14, 33, 63]. A very few methods have recently attempted video domain adaptation, using adversarial learning combined with temporal attention [8, 42, 53], multi-modal cues [50], and clip order prediction [11]. While existing video DA methods mainly rely on adversarial learning (which is often complicated and hard to train) in some form or other, they do not take any action semantics shared across domains into consideration. Our approach on the other hand, successfully leverages temporal contrastive learning to learn domain-invariant features while exploiting shared action semantics through background mixing for video domain adaptation. Recently, self-supervised tasks like predicting rotation and translation have been used for unsupervised domain adaptation and generalization, mainly for images [3, 38, 71]. By contrast, we focus on the more challenging problem of domain adaptation for human action recognition, where our goal is to align domains by learning consistent features representing different speeds of unlabeled videos. We further propose a temporal supervised contrastive loss to ensure discriminabilty by considering pseudo-labeling in an unified framework for video domain adaptation.
+
+Contrastive Learning. Contrastive representation learning is becoming increasingly attractive due to its great potential to leverage large amount of unlabeled images [9, 16, 23, 48, 24, 52] and videos [19, 31, 54, 60, 59, 78]. Speed of a video is investigated for self-supervised [1, 28, 77, 86] and semi-supervised learning [68, 94] unlike the problem we consider in this paper. Recent works [84, 87] utilize contrastive learning with different augmentations for learning unsupervised representations of graph data. Contrastive learning has also been recently used in supervised settings, where labels are used to guide the choice of positive and negative pairs [30]. While our approach is inspired by these, we propose a novel temporal contrastive learning framework with background mixing for video domain adaptation, which to our best knowledge has not been explored in the literature.
+
+Image Mixtures. Mixup regularization [89] and its variants [2, 76, 88] that train models on virtual examples constructed as convex combinations of pairs of images and labels have been used to improve the generalization of neural networks. Very few methods apply Mixup in domain adaptation, but mainly to stabilize the domain discriminator [62, 83, 85] or to smoothen the predictions [44]. Several works have recently leveraged the idea of different image mixtures [34, 66] for improving contrastive representation learning. Our proposed background mixing can be regarded as an extension of this line of research by adding background of a video from one domain to a video from another domain, to explore shared semantics while learning domain-invariant features for action recognition.
+
+# 3 Proposed Method
+
+Unsupervised video domain adaptation aims to improve the model generalization performance by transferring knowledge from a labeled source domain to an unlabeled target domain. Formally, we have a set of labelled source videos $\mathcal { D } _ { s o u r c e } = \{ ( \mathbf { V } ^ { i \{ s \} } , y ^ { i } ) \} _ { i = 1 } ^ { N _ { S } }$ and a set of unlabelled target videos $\mathcal { D } _ { t a r g e t } = \{ { \bf V } ^ { i \{ t \} } \} _ { i = 1 } ^ { N _ { T } }$ , with a common label space n recognition that performs w $\mathcal { L }$ . Given these data sets, our goal is to learn al on previously unseen target domain videos.
+
+Approach Overview. Figure 3 illustrates an overview of CoMix. Our action recognition model consists of a feature encoder $\mathcal { F }$ with a temporal graph encoder $\mathcal { G }$ . Given a video, the feature encoder $\mathcal { F }$ first extracts clip-level features, and then a graph encoder $\mathcal { G }$ utilizes those features to model intrinsic temporal relations for providing a robust encoded representation for action recognition. CoMix adopts supervised learning on the source videos, as the labels are available, jointly with two novel temporal contrastive learning loss terms to align the features for domain adaptation. Specifically, we maximize the similarity of the encoded representation of the fast version of a video (represented by $f$ clips) with that of the slow version of the same video (represented by $s$ clips, where $s < f .$ ) as well as minimize the similarity of the representations of different videos within each of the two domains. However, as temporal contrastive loss treats each domain individually, we further add
+
+
+Figure 3: An Overview of our Approach. Given labeled videos in source domain and only unlabeled videos in target domain, CoMix adopts supervised learning on source videos, jointly with temporal contrastive learning on both domains to align features. Additional crossdomain contrastive supervision is obtained using background mixing across domains and using target pseudolabels for enhancing discriminability of the latent space. CoMix provides a more simpler yet effective approach than adversarial learning for aligning both domains.
+
+two new sets of synthetic videos that contain source videos mixed with target background and vice versa, respectively for introducing the background variations among the videos while keeping the action semantics intact. Finally, we generate pseudo-labels for the target videos in every mini-batch and utilize them using another temporal supervised contrastive term. This term contrasts target videos with the same pseudo-label as positives to learn features discriminative for the target domain. We now describe each of our proposed components individually in detail in the following subsections.
+
+Video Representation. Capturing long-range temporal structure in videos is crucial for action recognition, which in turn affects the overall generalization performance of a model when adapting across domains. Thus, we adopt a graph convolutional neural network $( \mathcal G )$ on top of a 3D convolutional neural network $( \mathcal { F } )$ as our video feature encoder. Specifically, for a video $\mathbf { V }$ with $n$ clips, the feature extractor $\mathcal { F }$ maps the clips into the corresponding sequence of features, which alone do not incorporate the rich temporal structure of the video. Therefore, we use the temporal graph encoder which constructs a fully connected graph on top of the clip-level features, with learnable edge weights through a parameterized adjacency matrix, as in [81]. With these graph representations, we apply a graph convolutional neural network with three layers and finally perform average pooling over all the node features to output the encoded representation of the video V. In summary, the end-to-end network $\mathcal { G } ( \mathcal { F } ( . ) ) : \mathbf { V } \overset { \cdot } { } \mathbb { R } ^ { c }$ takes a sequence of clips from a video as input and outputs confidence scores (logits) over the number of classes $c$ for recognizing actions.
+
+Temporal Contrastive Learning. Given video representations, our goal is to leverage contrastive self-supervised learning in both domains for unsupervised domain adaptation. To this end, we use temporal speed invariance in videos as a proxy task and enforce this with a pairwise contrastive loss. Specifically, our key idea is to represent videos in two different temporal speeds (fast and slow) to obtain their encoded representations and then consider the fast and slow version representations of the same video to constitute positive pairs, while versions from different videos constitute negative pairs. Formally, let us consider a mini-batch of $B$ videos $\{ \mathbf { V } _ { n } ^ { 1 } , \mathbf { V } _ { n } ^ { 2 } , . . . , \mathbf { V } _ { n } ^ { B } \}$ with corresponding feature representations $\{ \mathbf { z } _ { n } ^ { 1 } , \mathbf { z } _ { n } ^ { 2 } , . . . , \mathbf { z } _ { n } ^ { B } \}$ , where each of the videos $\mathbf { V } _ { n } ^ { i }$ is represented using $n$ number of sampled clips. Let $f$ be the number of clips used to represent the fast version of the videos (forwarded through the base branch), and $s$ be that used for the slow version (forwarded through the auxiliary branch), with $s < f$ , as shown in Figure 4. Given positive and negative pairs, the model is trained such that it learns to maximize agreement between positive pairs, while minimizing agreement between negative pairs. This is achieved by employing a temporal contrastive loss $( \mathcal { L } _ { t c l } )$ as
+
+$$
+\mathcal { L } _ { t c l } ( \mathbf { V } _ { f } ^ { i } , \mathbf { V } _ { s } ^ { i } ) = - \log \frac { h ( \mathbf { z } _ { f } ^ { i } , \mathbf { z } _ { s } ^ { i } ) } { h ( \mathbf { z } _ { f } ^ { i } , \mathbf { z } _ { s } ^ { i } ) + \displaystyle \sum _ { j = 1 , j \neq i \atop v \in \{ s , f \} } ^ { B } h ( \mathbf { z } _ { f } ^ { i } , \mathbf { z } _ { v } ^ { j } ) }
+$$
+
+where, h(u, v) = exp( u vkuk kvk / is the exponential of cosine similarity measure and $\tau$ is the temperature hyperparameter [9]. We use $f ~ = ~ 1 6$ , and choose $s$ from $\{ 1 2 , 8 , 4 \}$ following a random uniform distribution in every training iteration where randomness encourages the model to learn from a variety of temporal speed variations to learn robust representations.
+
+Background Mixing. As temporal contrastive loss treats each domain individually, it ignores shared action semantics which is vital for domain alignment. Thus, we propose a new perspective of temporal contrastive loss through background mixing, specifically to alleviate the crossdomain background shift, as seen in Figure 1. The basic idea is to obtain the background frames for the videos in one domain and mix it with the frames of the videos from the other domain. More details on how we extract the backgrounds are provided in supplementary material. This introduces variation in each of the domains by adding new synthetic videos with the same action semantics as earlier, but possessing background from the other domain. Given two videos $\bar { \mathbf { V } } ^ { i \{ s \} } \bar { \in } \mathcal { D } _ { s o u r c e }$ and $\mathbf { V } ^ { i \{ t \} } \in \mathcal { D } _ { t a r g e t }$ with corresponding background frames (single image per video) as BGi{s} and $\mathbf { B } \mathbf { G } ^ { i \left\{ t \right\} }$ , we obtain the synthetic videos in both domains by a convex combination of the background with each of the frames in the videos as follows.
+
+$$
+\begin{array} { r } { \hat { \mathbf { V } } ^ { i \{ s \} } = ( 1 - \lambda ) \cdot \mathbf { V } ^ { i \{ s \} } + \lambda \cdot \mathbf { B } \mathbf { G } ^ { i \{ t \} } } \\ { \hat { \mathbf { V } } ^ { i \{ t \} } = ( 1 - \lambda ) \cdot \mathbf { V } ^ { i \{ t \} } + \lambda \cdot \mathbf { B } \mathbf { G } ^ { i \{ s \} } } \end{array}
+$$
+
+
+Figure 4: Temporal Contrastive Loss. Given unlabeled videos, we maximize similarity between encoded representations of the same video at two different speeds (fast and slow) as well as minimize similarity between different videos played at different speeds.
+
+where, $\lambda$ is sampled from the uniform distribution $[ 0 , \gamma ]$ , $\hat { \textbf { V } } ^ { i \{ s \} }$ and $\hat { \textbf { V } } ^ { i \{ t \} }$ correspond to the video from source domain with target background and vice versa, respectively. The main operation in our proposed background mixing is to generate a synthetic video with background from the other domain while retaining the temporal action semantics intact. Since mixing background doesn’t change the motion pattern of a video which actually defines an action, we assume both the original and mixed video to be of the same action class and go beyond single instance positives in Eq. 1 by adding additional positives per anchor, as in supervised contrastive learning [30] (see Figure 2 for an illustrative example). The modified temporal contrastive loss with background mixing $( \mathcal { L } _ { b g m } )$ is defined as below:
+
+$$
+\mathcal { L } _ { b g m } ( \mathbf { V } _ { f } ^ { i } , \mathbf { V } _ { s } ^ { i } ) = - \frac { 1 } { | \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) | } \sum _ { \mathbf { p } \in \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) } \log \frac { h ( \mathbf { z } _ { f } ^ { i } , \mathbf { p } ) } { \displaystyle \sum _ { \mathbf { p } \in \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) } h ( \mathbf { z } _ { f } ^ { i } , \mathbf { p } ) + \sum _ { \substack { i = 1 , j \neq i } } ^ { B } \left\{ h ( \mathbf { z } _ { f } ^ { i } , \mathbf { z } _ { v } ^ { j } ) + h ( \mathbf { z } _ { f } ^ { i } , \hat { \mathbf { z } } _ { v } ^ { j } ) \right\} }
+$$
+
+where, $\mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) \equiv \{ \mathbf { z } _ { s } ^ { i } , \hat { \mathbf { z } } _ { s } ^ { i } , \hat { \mathbf { z } } _ { f } ^ { i } \}$ is the set of positives for the anchor $\mathbf { z } _ { f } ^ { i }$ , and ˆzis/f represent the feature representation of the corresponding background-mixed video depending on the domain to which $\mathbf { V } ^ { \bar { i } }$ belongs. Note that for anchor $\mathbf { z } _ { f } ^ { i }$ , there are 3 positive pairs: (a) slow version of the mixed video $( \hat { \mathbf { z } } _ { s } ^ { i } )$ , (b) fast version of the mixed video $( \hat { \mathbf { z } } _ { f } ^ { i } )$ , and (c) slow version of the original video $( \mathbf { z } _ { s } ^ { i } )$ . Also, the loss is computed for all positive pairs in the mini-batch, i.e., $( { \bf V } _ { f } ^ { i } , { \bf V } _ { s } ^ { i } ) , ( { \bf V } _ { s } ^ { i } , { \bf V } _ { f } ^ { i } ) , ( \hat { \bf V } _ { f } ^ { i } , \hat { \bf V } _ { s } ^ { i } )$ , and $( \hat { \mathbf { V } } _ { s } ^ { i } , \hat { \mathbf { V } } _ { f } ^ { i } )$ . Simultaneous minimization of $\mathcal { L } _ { b g m }$ in both source and target domains not only learns temporal dynamics but also helps to better align the features for video domain adaptation by leveraging action semantics shared across both domains. Our background mixing is especially effective in video domain adaptation as it enforces the model to be robust to domain changes (i.e., difference in background as shown in Figure 1) while leaving the action semantics intact. Further, it can also be adopted as a data augmentation strategy for improved generalization in standard video action recognition: we leave this as an interesting future work.
+
+Incorporating Target Pseudo Labels. While temporal contrastive loss with background mixing helps in aligning the learned representations across the two domains, we cannot fully rely on source categories to learn features discriminative for target domain. Therefore, we propose to use a supervised contrastive loss [30] over pseudo-labeled target samples, an extended version of temporal contrastive loss in Eqn. 1 to enhance discriminabilty by allowing many samples per anchor to be positive, so that videos of the same pseudo-label can be attracted to each other in the embedding space. Let $A$ be the subset of videos assigned pseudo-labels using a confidence threshold, from a mini-batch of $B$ videos, the supervised temporal contrastive loss for incorporating target pseudo-labels $( \mathcal { L } _ { t p l } )$ is defined as
+
+$$
+\mathcal { L } _ { t p l } ( \mathbf { V } _ { f } ^ { i } , \mathbf { V } _ { s } ^ { i } ) = - \frac { 1 } { | \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) | } \sum _ { \mathbf { p } \in \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) } \log \frac { h ( \mathbf { z } _ { f } ^ { i } , \mathbf { p } ) } { \mathbf { p } \in \mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) } h ( \mathbf { z } _ { f } ^ { i } , \mathbf { p } ) + \sum _ { \substack { a \in A , a \neq i } } h ( \mathbf { z } _ { f } ^ { i } , \mathbf { z } _ { v } ^ { a } ) ,
+$$
+
+where, $\mathbf { P } ( \mathbf { z } _ { f } ^ { i } ) \equiv \{ \mathbf { z } _ { s } ^ { p } , \mathbf { z } _ { f } ^ { p } : p \in A \ \& \ \tilde { y } ^ { p } = \tilde { y } ^ { i } \} \setminus \{ \mathbf { z } _ { f } ^ { i } \}$ is the set of all positives for video $\mathbf { V } _ { \boldsymbol { f } } ^ { i }$ and $\tilde { y } ^ { i }$ represent the pseudo-label for target video $\mathbf { V } ^ { i }$ . Note that the set of positives $( \mathbf { P } ( . ) )$ includes all the target domain samples (fast and slow) classified as the same action class as that of the anchor $( \mathbf { z } _ { f } ^ { i } )$ through the pseudo labels. Following [95], we leverage a temporal ensemble prediction for a given video $\mathbf { \widetilde { V } } ^ { i }$ from the target domain to produce robust and better-calibrated version of pseudo-labels. Specifically, we obtain the encoded (logits) representations $\mathbf { z } _ { f } ^ { i }$ and $\mathbf { z } _ { s } ^ { i }$ from the base and auxiliary branch respectively and then compute the pseudo-label as $\tilde { y } ^ { i } = \mathrm { a r g } \operatorname* { m a x } _ { k }$ $\mathrm { s o f t m a x } ( \mathbf { z } _ { f u s e d } ^ { i } )$ , where $\mathbf { z } _ { f u s e d } ^ { i }$ representent among he mean of both logits. We consider the class index classes, provided it is higher than a confidence thre $k$ on which the model is mosthold. $c$
+
+Optimization. Besides the losses $\mathcal { L } _ { b g m }$ and $\mathcal { L } _ { t p l }$ , we minimize the standard supervised cross-entropy loss $( \mathcal { L } _ { c e } )$ on the labelled source videos as follows.
+
+$$
+\mathcal { L } _ { c e } ( \mathbf { V } ^ { i \{ s \} } , y ^ { i } ) = - \sum _ { k = 1 } ^ { c } ( y ^ { i } ) _ { k } \log ( \mathcal { G } ( \mathcal { F } ( \mathbf { V } ^ { i \{ s \} } ) ) ) _ { k }
+$$
+
+Overall, the loss function for training our model involving both source and target domain data is,
+
+$$
+\mathcal { L } _ { C o M i x } = \mathcal { L } _ { c e } ^ { \{ s \} } + \lambda _ { b g m } ( \mathcal { L } _ { b g m } ^ { \{ s \} } + \mathcal { L } _ { b g m } ^ { \{ t \} } ) + \lambda _ { t p l } \mathcal { L } _ { t p l } ^ { \{ t \} }
+$$
+
+where $\lambda _ { b g m }$ and $\lambda _ { t p l }$ are weights to balance the impact of individual loss terms. To reduce the number of hyper-parameters, we use the same weight $\lambda _ { b g m }$ for both $\mathcal { L } _ { b g m } ^ { \{ s \} }$ and $\mathcal { L } _ { b g m } ^ { \{ t \} }$ . Notably, for the semi-supervised domain adaptation setting, we also use supervised cross-entropy loss for the few labeled target domain videos in addition to the source domain videos.
+
+# 4 Experiments
+
+Datasets. We evaluate the performance of our approach using several publicly available benchmark datasets for video domain adaptation, namely UCF-HMDB [7], Jester [53], and Epic-Kitchens [50]. UCF-HMDB (assembled by authors in [7]) is an overlapped subset of the original UCF [69] and HMDB datasets [32], containing 3, 209 videos across 12 classes. Jester (assembled by authors in [53]) is a large-scale cross-domain dataset that contains videos of humans performing hand gestures [45] from two domains, namely Source and Target that contain 51, 498 and 51, 415 video clips respectively across 7 classes. Epic-Kitchens (assembled by authors in [50]) is a challenging egocentric dataset that consists of videos across 8 largest action classes from three domains, namely D1, D2 and D3, corresponding to P08, P01 and P22 kitchens on the full Epic-Kitchens dataset [13]. We use the standard training and testing splits provided by the authors in [7, 53, 50] to conduct our experiments on each dataset. More details about the datasets can be found in the supplementary material.
+
+Baselines. We compare our approach with the following baselines. (1) source only (a lower bound) and supervised target only (an upper bound) baselines that trains the network using labeled source data and labeled target data respectively, (2) popular UDA methods based on adversarial learning (e.g., DANN [20], and ADDA [74]), (3) existing video domain adaptation methods, including SAVA [11], $\mathrm { T A ^ { 3 } N }$ [8], ABG [42] and TCoN [53]. We also compare with Source $^ +$ Target (which simply uses all labelled data available to it to train the network) and ENT [63] in semi-supervised domain adaptation experiments. We directly quote the numbers reported in published papers when possible and use source code made publicly available by the authors of $\mathrm { T A ^ { 3 } N }$ [8] on both Jester and Epic-Kitchens.
+
+Implementation Details. Following [11], we use I3D [4] as the backbone feature encoder network, initialized with Kinetics pre-trained weights. For the temporal graph encoder, we use a 3-layer GCN similar to [81]. We follow the standard ‘pre-train then adapt’ procedure used in prior works [74, 11] and train the model with only source data to provide a warmstart before the proposed approach is employed. The dimension of the features extracted from the I3D encoder is 1024 which is the same as the node-feature dimension of the initial layer of the GCN. The final layer of the GCN has its node-feature dimension same as the number of action classes in a dataset and uses a mean aggregation strategy to output the logits. We use a clip-length of 8-frames and train all the models end-to-end using SGD with a momentum of 0.9 and a weight decay of 1e-7. We use an initial learning rate of 0.001 for the I3D and 0.01 for the GCN in all our experiments. We use a batch size of 40 equally split over the two domains, where each batch consists of $n$ clips from the same video, where $n$ is 16 for the fast version $( f )$ and 12, 8, or 4 for the slow version (s). For inference, we use 16 uniformly sampled clips per video and use the base branch of the model to recognize the action. The temperature parameter is set to $\tau = 0 . 5$ . We extract backgrounds from videos using temporal median filtering [58] and empirically set $\gamma = 0 . 5$ for background mixing. We use a pseudo-label threshold of 0.7 in all our experiments and smooth the cross-entropy loss with $\epsilon = 0 . 1$ , following [72, 49]. We set $\lambda _ { b g m }$ and $\lambda _ { t p l }$ from $\lbrace 0 . 0 1 , 0 . 1 \rbrace$ depending on the dataset. We report the average action recognition accuracy over 3 random trials. We use 6 NVIDIA Tesla V100 GPUs for training all our models.
+
+Results on UCF-HMDB. Table 1 shows results of our method and other competing approaches on UCFHMDB dataset. Our CoMix framework achieves the best average performance of $9 0 . 3 \%$ , which is about $2 . 2 \%$ more than the previous state-of-the-art performance on this dataset. While comparing with the recent method, SAVA [11] using the same I3D backbone, CoMix obtains $4 . 5 \%$ and $2 . 7 \%$ improvement on $\mathrm { U C F { } H M D B }$ and HMDB UCF task respectively, without relying on frame attention or adversarial learning.
+
+Table 1: Results on UCF-HMDB Dataset. CoMix establishes new state-of-the-art for unsupervised video domain adaptation on UCF-HMDB, by significantly outperforming existing methods.
+
+
Method
Backbone
UCF→HMDB
HMDB→UCF
Average
DANN [20]JAN [41]AdaBN [35]MCD [64]TAN[8]ABG[42]TCoN[53]
ResNet-101ResNet-101ResNet-101
75.3
76.4
74.7
79.3
75.877.076.476.880.182.188.1
75.5
77.4
ResNet-101
74.4
79.3
ResNet-101ResNet-101ResNet-101
78.3
81.8
79.187.2
85.189.1
Source OnlyDANN[20]ADDA [74]TAN[8]SAVA [11]
I3DI3DI3DI3DI3D
80.3
88.8
80.7
88.0
84.584.383.785.9
79.1
88.4
81.4
90.5
82.2
91.2
86.7
CoMix
I3D
86.7
93.9
90.3
Supervised Target
I3D
95.0
96.8
95.9
+
+These improvements clearly show that our temporal graph contrastive learning with background mixing is not only able to better leverage the temporal information but also shared action semantics, essential for effective video domain adaptation. In summary, CoMix outperforms all the existing video
+
+Table 2: Results on Jester and Epic-Kitchens Datasets. CoMix outperforms $\mathrm { T A ^ { 3 } N }$ [8] by $9 . 2 \%$ on the challenging Jester dataset. On Epic-Kitchens, CoMix achieves the best performance on 5 out of 6 transfer tasks including the best average performance among all compared methods.
+
+
Method
Backbone
Jester
Epic-Kitchens
Average
Source→Target
D2-→D1D3→D1
D1→D2 D3-→D2 D1-→D3 D2-→D3
Source Only
I3D
51.5
35.4
34.6
32.8
35.8
34.1
39.1
35.3
DANN [20]
I3D
55.4
38.3
38.8
37.7
42.1
36.6
41.9
39.2
ADDA [74]
I3D
52.3
36.3
36.1
35.4
41.4
34.9
40.8
37.4
TAN[8]
I3D
55.5
40.9
39.9
34.2
44.2
37.4
42.8
39.9
CoMix
I3D
64.7
38.6
42.3
42.9
49.2
40.9
45.2
43.2
Supervised Target
I3D
95.6
57.0
57.0
64.0
64.0
63.7
63.7
61.5
+
+DA methods on UCF-HMDB, showing the efficacy of our approach in learning more transferable features for cross-domain action recognition without using any target labels.
+
+Results on Jester and Epic-Kitchens. On the large-scale Jester dataset, our proposed approach, CoMix also outperforms other DA approaches by increasing the Source Only (no adaptation) accuracy from ${ \bf 5 1 . 5 \% }$ to $6 4 . 7 \%$ , as shown in Table 2 (left). In particular, our approach achieves an absolute improvement of $9 . 2 \%$ over $\mathrm { T A ^ { 3 } N }$ [8], which corroborates the fact that CoMix can well handle not only the appearance gap but also the action gap present on this dataset (e.g., for the action class “rolling hand”, source domain contains videos of “rolling hand forward”, while the target domain only consists of videos of “rolling hand backward”). Table 2 (right) summarizes the results on Epic-Kitchens, which is another challenging dataset consisting of total 6 transfer tasks with a large imbalance across different action classes. Overall, CoMix obtains the best on 5 tasks including the best average performance of $4 3 . 2 \%$ , compared to only $3 5 . 3 \%$ and $3 9 . 9 \%$ achieved by the source only and $\mathrm { \bar { T A } ^ { 3 } N }$ [8] respectively. While the improvements achieved by our approach are encouraging on both Jester and Epic-Kitchens, the accuracy gap between CoMix and supervised target is still significant $( \mathbf { 3 0 . 9 \% }$ on Jester and $1 8 . 3 \%$ on Epic-Kitchens), which highlights the great potential for improvement in future for unsupervised video domain adaptation.
+
+Comparison with MM-SADA [50]. MM-SADA[50] is another state-of-the-art approach for video domain adaptation that leverages the idea of using multi-modal (RGB and Optical flow) data to learn better domain invariant representations. The approach has two main components: adversarial learning and multi-modal supervision. While CoMix does not use optical flow features anywhere, the RGB-only version of MM-SADA still uses optical flow features for the multi-modal self-supervision. Interestingly, CoMix $( 4 3 . 2 \% )$ shows very competitive performance using only RGB features when compared to the above $( 4 3 . 9 \% )$ on the Epic-Kitchens dataset. Additionally, we train MM-SADA (RGB-only) (but perform multimodal supervision using both RGB and flow following the original paper [50]) on UCF-HMDB dataset and notice that CoMix outperforms it by a margin of $3 \%$ on an average $( \mathrm { U C F } \to \mathrm { H M D B }$ : $8 2 . 2 \%$ vs $8 6 . 7 \%$ , H $\mathsf { M D B } \to \mathsf { U C F }$ : $9 1 . 2 \%$ vs $9 3 . 9 \%$ , Avg: $8 6 . 7 \%$ vs $9 0 . 3 \%$ , showing its effectiveness in unsupervised video domain adaptation.
+
+Semi-supervised Domain Adaptation. To further study the robustness of our proposed approach, we extend the unsupervised domain adaptation to a semi-supervised setting, where one (1-shot) and three target labels (3- shot) per class are available for training. Table 3 shows that our simple approach consistently outperforms the adversarial DA methods (DANN [20],
+
+Table 3: Semi-Supervised Domain Adaptation on UCF-HMDB and Jester Datasets. CoMix significantly outperforms all the compared methods in both one-shot and three-shot settings.
+
+
Method
UCF→HMDB
HMDB→UCF
Jester(S)→Jester(T)
1-shot 3-shot
1-shot 3-shot
1-shot 3-shot
Source+Target
83.2 85.8
90.3 93.7
53.8 55.0
DANN [20]
85.4 86.9
92.1 93.1
55.1 59.9
ADDA [74]
83.6 86.3
91.2 93.0
59.5 61.3
ENT [63]
85.6 88.6
92.8 95.8
58.6 61.5
CoMix
88.4 93.1
95.4 96.6
65.3 69.6
+
+and ADDA [74]) including the semi-supervised method, ENT [63], on both UCF-HMDB and Jester datasets. Remarkably, CoMix with three target labels per class improves the performance of Source $^ +$ Target baseline from $9 3 . 7 \%$ to $9 6 . 6 \%$ , which is only ${ \bf 0 . 2 \% }$ lower than the supervised target upper bound (in Table 1) on HM $) \mathrm { B } \to \mathrm { U C F }$ task $( \mathbf { 9 6 . 6 \% }$ vs $9 6 . 8 \%$ ). These results well demonstrate the utility of our proposed approach in many practical applications where annotating a few videos per class is typically possible and therefore worth doing given the boost it provides.
+
+Effectiveness of Individual Components. As seen from Table 4, the vanilla temporal contrastive learning (TCL) achieves an average accuracy of $8 5 . 8 \%$ on UCF-HMDB while $5 7 . 5 \%$ on Jester $1 ^ { \mathrm { s t } }$ row), which is already better than DANN [20], and ADDA [74] (ref. Table 1,2), showing its effectiveness over adversarial learning in aligning features. While both background mixing (BGM) and incorporation of target pseudo-labels (TPL) individually improves the performance over TCL $( + 2 . 9 \%$ , $+ 5 . 6 \%$ using BGM and $+ 1 . 9 \%$ , $+ 5 . 4 \%$ using TPL, respectively), addition of both of them leads to the best average performance of $9 0 . 3 \%$ on UCF-HMDB dataset and $6 4 . 7 \%$ on the Jester dataset. This corroborates the fact that both cross-domain action semantics (through BGM) and discriminabilty (through TPL) of the latent space play crucial roles in video domain adaptation in addition to the vanilla contrastive learning for aligning features.
+
+Table 4: Ablation Study on UCF-HMDB and Jester. TCL: Temporal Contrastive Learning, BGM: Background Mixing, TPL: Target Pseudo-Labels.
+
+
TCL BGM
TPL
U→H
H→U
Average
Jester(S)→Jester(R)
√
x<
X
83.3
88.4
85.8
57.5
√
X
86.2
91.2
88.7
63.1
√
X
√
83.5
91.9
87.7
62.9
√
√
86.7
93.9
90.3
64.7
+
+Table 5: Comparison with MixUp Strategies. Background mixing outperforms other alternatives in leveraging shared action semantics on UCF-HMDB.
+
+
Method
U→H
H→U
Average
Jester(S)→Jester(R)
Gaussian Noise
84.7
90.6
87.6
54.3
Video MixUp
85.1
91.7
88.4
62.2
Video CutMix
84.6
92.1
88.3
58.6
Background Mixing
86.7
93.9
90.3
64.7
+
+Comparison with Different MixUp Strategies. We explore the effectiveness of background mixing by comparing with different MixUp strategies (Table 5): (a) Gaussian Noise: adding White Gaussian Noise to videos in both domains; (b) Video MixUp [89]: directly mixing one video with another from a different domain, as in images; (c) Video CutMix [88]: randomly replacing a region of a video with another region from the other domain. The proposed way of generating synthetic videos by mixing background of a video from one domain to a video from another domain, outperforms all three alternatives on UCF-HMDB as well as on the more challenging Jester dataset. Note that while both MixUp and CutMix destroy motion pattern of original video, background mixing keeps semantic consistency without changing the temporal dynamics.
+
+Effect of Background Pseudo-labels. We investigate the effect of pseudo-labels on background mixed videos (i.e., both videos considered to be of same action class while creating positives) by simply adding them as unlabeled videos without any modification to the contrastive objective in Eq. 1. CoMix without background pseudo-labels decreases the performance from $9 0 . 3 \%$ to $8 9 . 0 \%$ $( - 1 . 3 \%$ : Table 6), showing its effectiveness in leveraging action semantics shared across both domains.
+
+Effect of Source Contrastive Learning. CoMix adopts contrastive learning on both source and target domains, although we already have supervised cross-entropy loss on source videos. We observe $\mathcal { L } _ { b g m } ^ { \{ s \} }$ pplying contrastive learning on target domain onfrom Eq. 6, lowers down the performance from $9 0 . 3 \%$ em to $8 8 . 4 \%$ s $\left( - \mathbf { 1 . 9 \% } \right)$ trastive objective on UCF-HMDB objective on both domains simultaneously to achieve effective alignment across domains.
+
+Effect of Random Speed Invariance. We remove randomness in video speed from the auxiliary branch of our temporal contrastive learning framework and observe that CoMix (with 16 clips in the base branch and only 8 clips in the auxiliary branch) leads to an average top-1 accuracy of $8 9 . 6 \%$ compared to $9 0 . 3 \%$ ( $- 0 . 7 \%$ :
+
+Table 6: Ablation Study on Contrastive Learning.
+
+
Method
U→H
H→U
Average
CoMix
86.7
93.7
90.3
- w/o Background Pseudo-labels
85.8
92.2
89.0
- w/o Source Contrastive Learning
85.1
91.8
88.4
- w/o Random Speed Invariance
86.4
92.8
89.6
+
+Table 6), showing the importance of random speed invariance in learning robust features.
+
+Self-Training vs Supervised Contrastive Learning. We directly use self-training that uses crossentropy loss on target pseudo labels instead of $\mathcal { L } _ { t p l } ^ { \{ t \} }$ and find that the average performance drops to $8 8 . 7 \%$ on UCF-HMDB, indicating the advantage of supervised contrastive objective in enhancing discriminability of the latent space by successfully leveraging label information from target domain.
+
+Effect of Graph Representation. (a) Removal of Graph Representation from CoMix: We examine the effect of graph representation for videos and find that by removing GCN from our framework lowers down the performance from $9 0 . 3 \%$ to $8 8 . 1 \%$ on UCF-HMDB dataset, which shows that graph contrastive learning is more useful in
+
+Table 7: Baseline Comparisons w/ GCN Representations on UCF-HMDB and Jester Datasets.
+
+
Method (w/ GCN)
U→H
H→U
Average
Jester(S)→Jester(R)
Source Only
82.5
87.7
85.1
54.0
DANN[20]
80.0
86.3
83.2
62.9
TAN[8]
52.5
72.4
62.3
51.7
CoMix
86.7
93.9
90.3
64.7
+
+capturing the temporal dependencies, essential for video domain adaptation. (b) Effect of Graph
+
+
+Figure 5: Feature Visualizations using t-SNE. Plots show visualization of our approach with different components on $\mathrm { U C F { } H M D B }$ task. Blue and red dots represent source and target data respectively. Features for both target and source domain become progressively discriminative and improve from left to right by adoption of our novel components within a temporal contrastive learning framework. Best viewed in color.
+
+Representation on Baseline Methods: Additionally, in Table 7 we compare with domain adversarial adaptation methods DANN [20] and TA3N [8] including the Source only baseline with GCN feature representation on both UCF-HMDB and Jester datasets. CoMix improves the Source only accuracy by $5 . 2 \%$ and $1 0 . 7 \%$ respectively on UCF-HMDB and Jester datasets. Furthermore, CoMix outperforms DANN [20] with the same GCN equipped as ours, on both datasets $( + 7 . 1 \%$ , $+ 1 . 8 \%$ , respectively) showing its effectiveness over adversarial learning in aligning features for video domain adaptation. TA3N [8] performs very poorly $6 2 . 3 \%$ and $5 1 . 7 \%$ ) when equipped additionally with graph representations. We believe this is because TA3N already utilizes Temporal Relational Network [92] for modeling temporal relations, which probably hinders in learning GCN features for successful domain adaptation in videos. (c) Alternatives for Graph Representation: We replace GCN using MLP/LSTM of similar complexity and notice that both alternatives are inferior to GCN on UCF-HMDB (MLP: $8 8 . 1 \%$ , LSTM: $8 4 . 3 \%$ , GCN: $9 0 . 3 \%$ ), which shows the effectiveness of GCN in our contrastive learning framework for capturing the temporal dependencies, essential for video domain adaptation.
+
+Effect of Background Extraction Method. We experiment with a different background extraction strategy [93] that uses Gaussian Mixture Models (GMM) to extract the backgrounds and observe that the very simple and fast strategy based on temporal median filtering [58] outperforms GMM by $2 . 3 \%$ on average on UCF-HMDB $\mathrm { U C F { } H M D B }$ : $8 5 . 3 \%$ vs $8 6 . 7 \%$ , HMDB UCF: $9 0 . 7 \%$ vs $9 3 . 9 \%$ , Avg: $8 8 . 0 \%$ vs $9 0 . 3 \%$ ). Note that our CoMix framework is agnostic to the method used for background extraction and can be incorporated with any other background extraction techniques for videos, e.g., learnable background segmentation strategies such as [82, 55].
+
+Feature Visualizations. We use t-SNE [43] to visualize the features learned using different components of our CoMix framework. As seen from Figure 5, alignment of domains including discriminability improves as we adopt “TCL” and “BGM” to the vanilla Source only model. The best results are obtained when all the three components “TCL”, “BGM” and “TPL” i.e., CoMix are added and trained using an unified framework (Eq. 6) for unsupervised video domain adaptation. Additional results and analysis including more qualitative examples are included in the supplementary material.
+
+# 5 Conclusions
+
+In this paper, we introduce a new end-to-end temporal contrastive learning framework to bridge the domain gap by learning consistent features representing two different speeds of the unlabeled videos. We also propose two novel extension to temporal contrastive loss by using background mixing and target pseudo-labels, that allows additional positive(s) per anchor, thus adapting contrastive learning to leverage cross-domain action semantics and label information from the target domain respectively in an unified framework, for learning discriminative invariant features. We demonstrate the effectiveness of our approach on three standard datasets, outperforming several competing methods.
+
+Broader Impact. Our research can help reduce burden of collecting large-scale supervised data in many real-world applications of human action recognition by transferring knowledge from auxiliary datasets. The positive impact that our work could have on society is in making technology more accessible for institutions and individuals that do not have rich resources for collecting and annotating large-scale video datasets. Negative impacts of our research are difficult to predict, however, it shares many of the pitfalls associated with standard deep learning models such as susceptibility to adversarial attacks and lack of interpretablity. Other adverse effects could be potential attrition in jobs in certain sectors of economy where fewer employees (security guards, nurses, etc.) are needed to monitor human activities as a result of wider adoption of automated video recognition systems.
+
+Acknowledgements. This work was partially supported by the ISIRD Grant EEE.
+
+References
+[1] Sagie Benaim, Ariel Ephrat, Oran Lang, Inbar Mosseri, William T Freeman, Michael Rubinstein, Michal Irani, and Tali Dekel. Speednet: Learning the Speediness in Videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9922–9931, 2020.
+[2] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A Holistic Approach to Semi-Supervised Learning. In Advances in Neural Information Processing Systems, pages 5049–5059, 2019.
+[3] Fabio M Carlucci, Antonio D’Innocente, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. Domain Generalization by Solving Jigsaw Puzzles. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2229–2238, 2019.
+[4] Joao Carreira and Andrew Zisserman. Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017.
+[5] Chao Chen, Zhihong Chen, Boyuan Jiang, and Xinyu Jin. Joint Domain Alignment and Discriminative Feature Learning for Unsupervised Deep Domain Adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3296–3303, 2019.
+[6] Chun-Fu Richard Chen, Rameswar Panda, Kandan Ramakrishnan, Rogerio Feris, John Cohn, Aude Oliva, and Quanfu Fan. Deep Analysis of CNN-Based Spatio-Temporal Representations for Action Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6165–6175, June 2021.
+[7] Jin Chen, Xinxiao Wu, Lixin Duan, and Shenghua Gao. Domain Adversarial Reinforcement Learning for Partial Domain Adaptation. IEEE Transactions on Neural Networks and Learning Systems, pages 1–15, 2020.
+[8] Min-Hung Chen, Zsolt Kira, Ghassan AlRegib, Jaekwon Yoo, Ruxin Chen, and Jian Zheng. Temporal Attentive Alignment for Large-Scale Video Domain Adaptation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6321–6330, 2019.
+[9] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A Simple Framework for Contrastive Learning of Visual Representations. In International conference on machine learning, pages 1597–1607, 2020.
+[10] Jinwoo Choi, Chen Gao, Joseph CE Messou, and Jia-Bin Huang. Why Can’t I Dance in the Mall? Learning to Mitigate Scene Bias in Action Recognition. Advances in Neural Information Processing Systems, 32:853–865, 2019.
+[11] Jinwoo Choi, Gaurav Sharma, Samuel Schulter, and Jia-Bin Huang. Shuffle and Attend: Video Domain Adaptation. In European Conference on Computer Vision, pages 678–695, 2020.
+[12] Gabriela Csurka. A Comprehensive Survey on Domain Adaptation for Visual Applications, pages 1–35. Springer International Publishing, Cham, 2017.
+[13] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling Egocentric Vision: The Epic-Kitchens Dataset. In Proceedings of the European Conference on Computer Vision (ECCV), pages 720–736, 2018.
+[14] Hal Daumé III, Abhishek Kumar, and Avishek Saha. Frustratingly Easy Semi-Supervised Domain Adaptation. In Proceedings of the 2010 Workshop on Domain Adaptation for Natural Language Processing, pages 53–59, 2010.
+[15] Aysegul Dundar, Ming-Yu Liu, Ting-Chun Wang, John Zedlewski, and Jan Kautz. Domain Stylization: A Strong, Simple Baseline for Synthetic to Real Image Domain Adaptation. arXiv preprint arXiv:1807.09384, 2018.
+[16] Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet, and Andrew Zisserman. With a Little Help From My Friends: Nearest-Neighbor Contrastive Learning of Visual Representations. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9588–9597, October 2021.
+[17] Christoph Feichtenhofer. X3d: Expanding Architectures for Efficient Video Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 203–213, 2020.
+[18] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast Networks for Video Recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6202–6211, 2019.
+[19] Christoph Feichtenhofer, Haoqi Fan, Bo Xiong, Ross Girshick, and Kaiming He. A Large-Scale Study on Unsupervised Spatiotemporal Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3299–3309, 2021.
+[20] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-Adversarial Training of Neural Networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
+[21] Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. A Kernel Two-Sample Test. The Journal of Machine Learning Research, 13(1):723–773, 2012.
+[22] Kensho Hara, Hirokatsu Kataoka, and Yutaka Satoh. Learning Spatio-Temporal Features with 3D Residual Networks for Action Recognition. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 3154–3160, 2017.
+[23] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum Contrast for Unsupervised Visual Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729–9738, 2020.
+[24] 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, 2018.
+[25] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. Cycada: Cycle-Consistent Adversarial Domain Adaptation. In International conference on machine learning, pages 1989–1998. PMLR, 2018.
+[26] Lanqing Hu, Meina Kan, Shiguang Shan, and Xilin Chen. Duplex Generative Adversarial Network for Unsupervised Domain Adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1498–1507, 2018.
+[27] Arshad Jamal, Vinay P Namboodiri, Dipti Deodhare, and KS Venkatesh. Deep Domain Adaptation in Action Space. In BMVC, volume 2, page 4, 2018.
+[28] Simon Jenni, Givi Meishvili, and Paolo Favaro. Video Representation Learning by Recognizing Temporal Transformations. In Proceedings of the European Conference on Computer Vision (ECCV), pages 425–442. Springer, 2020.
+[29] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-Scale Video Classification with Convolutional Neural Networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014.
+[30] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised Contrastive Learning. Advances in Neural Information Processing Systems, 33, 2020.
+[31] Bruno Korbar, Du Tran, and Lorenzo Torresani. Cooperative Learning of Audio and Video Models From Self-Supervised Synchronization. arXiv preprint arXiv:1807.00230, 2018.
+[32] Hildegard Kuehne, Hueihan Jhuang, Estíbaliz Garrote, Tomaso Poggio, and Thomas Serre. HMDB: A Large Video Database for Human Motion Recognition. In 2011 International conference on computer vision, pages 2556–2563. IEEE, 2011.
+[33] Abhishek Kumar, Avishek Saha, and Hal Daume. Co-Regularization Based Semi-Supervised Domain Adaptation. Advances in neural information processing systems, 23:478–486, 2010.
+[34] Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, and Honglak Lee. I-Mix: A DomainAgnostic Strategy for Contrastive Representation Learning. arXiv preprint arXiv:2010.08887, 2021.
+[35] Yanghao Li, Naiyan Wang, Jianping Shi, Xiaodi Hou, and Jiaying Liu. Adaptive Batch Normalization for Practical Domain Adaptation. Pattern Recognition, 80:109–117, 2018.
+[36] Yingwei Li, Yi Li, and Nuno Vasconcelos. Resound: Towards Action Recognition Without Representation Bias. In Proceedings of the European Conference on Computer Vision (ECCV), pages 513–528, 2018.
+[37] Ji Lin, Chuang Gan, and Song Han. Temporal Shift Module for Efficient Video Understanding. In CVF International Conference on Computer Vision (ICCV), pages 7082–7092, 2019.
+[38] Weizhe Liu, David Ferstl, Samuel Schulter, Lukas Zebedin, Pascal Fua, and Christian Leistner. Domain Adaptation for Semantic Segmentation via Patch-Wise Contrastive Learning. arXiv preprint arXiv:2104.11056, 2021.
+[39] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning Transferable Features with Deep Adaptation Networks. In International conference on machine learning, pages 97–105, 2015.
+[40] Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional Adversarial Domain Adaptation. In Advances in Neural Information Processing Systems, pages 1640–1650, 2018.
+[41] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep Transfer Learning With Joint Adaptation Networks. In International conference on machine learning, pages 2208–2217. PMLR, 2017.
+[42] Yadan Luo, Zi Huang, Zijian Wang, Zheng Zhang, and Mahsa Baktashmotlagh. Adversarial Bipartite Graph Learning for Video Domain Adaptation. In Proceedings of the 28th ACM International Conference on Multimedia, pages 19–27, 2020.
+[43] Laurens van der Maaten and Geoffrey Hinton. Visualizing Data Using t-SNE. Journal of machine learning research, 9(Nov):2579–2605, 2008.
+[44] Xudong Mao, Yun Ma, Zhenguo Yang, Yangbin Chen, and Qing Li. Virtual Mixup Training for Unsupervised Domain Adaptation. arXiv preprint arXiv:1905.04215, 2019.
+[45] Joanna Materzynska, Guillaume Berger, Ingo Bax, and Roland Memisevic. The Jester Dataset: A LargeScale Video Dataset of Human Gestures. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019.
+[46] Ke Mei, Chuang Zhu, Jiaqi Zou, and Shanghang Zhang. Instance Adaptive Self-Training for Unsupervised Domain Adaptation. In European Conference on Computer Vision. Springer, 2020.
+[47] Yue Meng, Chung-Ching Lin, Rameswar Panda, Prasanna Sattigeri, Leonid Karlinsky, Aude Oliva, Kate Saenko, and Rogerio Feris. AR-Net: Adaptive Frame Resolution for Efficient Action Recognition. In European Conference on Computer Vision, pages 86–104, 2020.
+[48] Ishan Misra and Laurens van der Maaten. Self-Supervised Learning of Pretext-Invariant Representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707–6717, 2020.
+[49] Rafael Müller, Simon Kornblith, and Geoffrey E Hinton. When Does Label Smoothing Help? In Advances in Neural Information Processing Systems, pages 4694–4703, 2019.
+[50] Jonathan Munro and Dima Damen. Multi-Modal Domain Adaptation for Fine-Grained Action Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 122–132, 2020.
+[51] Zak Murez, Soheil Kolouri, David Kriegman, Ravi Ramamoorthi, and Kyungnam Kim. Image to Image Translation for Domain Adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4500–4509, 2018.
+[52] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation Learning With Contrastive Predictive Coding. arXiv preprint arXiv:1807.03748, 2018.
+[53] Boxiao Pan, Zhangjie Cao, Ehsan Adeli, and Juan Carlos Niebles. Adversarial Cross-Domain Action Recognition With Co-Attention. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11815–11822, 2020.
+[54] Tian Pan, Yibing Song, Tianyu Yang, Wenhao Jiang, and Wei Liu. Videomoco: Contrastive Video Representation Learning With Temporally Adversarial Examples. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11205–11214, 2021.
+[55] Prashant W Patil, Akshay Dudhane, and Subrahmanyam Murala. Multi-frame Recurrent Adversarial Network for Moving Object Segmentation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2302–2311, 2021.
+[56] Zhongyi Pei, Zhangjie Cao, Mingsheng Long, and Jianmin Wang. Multi-Adversarial Domain Adaptation. Thirty-second AAAI conference on artificial intelligence, 2018.
+[57] Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. VisDA: The Visual Domain Adaptation Challenge. arXiv preprint arXiv:1710.06924, 2017.
+[58] Massimo Piccardi. Background Subtraction Techniques: A Review. In 2004 IEEE International Conference on Systems, Man and Cybernetics, volume 4, pages 3099–3104. IEEE, 2004.
+[59] Rui Qian, Tianjian Meng, Boqing Gong, Ming-Hsuan Yang, Huisheng Wang, Serge Belongie, and Yin Cui. Spatiotemporal Contrastive Video Representation Learning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6964–6974, 2021.
+[60] Adrià Recasens, Pauline Luc, Jean-Baptiste Alayrac, Luyu Wang, Florian Strub, Corentin Tallec, Mateusz Malinowski, Viorica Patraucean, Florent Altché, Michal Valko, et al. Broaden Your Views for SelfSupervised Video Learning. arXiv preprint arXiv:2103.16559, 2021.
+[61] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting Visual Category Models to New Domains. In European conference on computer vision, pages 213–226. Springer, 2010.
+[62] Aadarsh Sahoo, Rameswar Panda, Rogerio Feris, Kate Saenko, and Abir Das. Select, Label, and Mix: Learning Discriminative Invariant Feature Representations for Partial Domain Adaptation. arXiv preprint arXiv:2012.03358, 2020.
+[63] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, and Kate Saenko. Semi-Supervised Domain Adaptation via Minimax Entropy. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8050–8058, 2019.
+[64] Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum Classifier Discrepancy for Unsupervised Domain Adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3723–3732, 2018.
+[65] Jian Shen, Yanru Qu, Weinan Zhang, and Yong Yu. Wasserstein Distance Guided Representation Learning for Domain Adaptation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+[66] Zhiqiang Shen, Zechun Liu, Zhuang Liu, Marios Savvides, Trevor Darrell, and Eric Xing. Un-Mix: Rethinking Image Mixtures for Unsupervised Visual Representation Learning. arXiv preprint arXiv:2003.05438, 3(7), 2020.
+[67] Karen Simonyan and Andrew Zisserman. Two-Stream Convolutional Networks for Action Recognition in Videos. In Advances in Neural Information Processing Systems, pages 568–576, 2014.
+[68] Ankit Singh, Omprakash Chakraborty, Ashutosh Varshney, Rameswar Panda, Rogerio Feris, Kate Saenko, and Abir Das. Semi-Supervised Action Recognition with Temporal Contrastive Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10389–10399, 2021.
+[69] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A Dataset of 101 Human Actions Classes From Videos in the Wild. arXiv preprint arXiv:1212.0402, 2012.
+[70] Baochen Sun and Kate Saenko. Deep Coral: Correlation Alignment for Deep Domain Adaptation. In European conference on computer vision, pages 443–450. Springer, 2016.
+[71] Yu Sun, Eric Tzeng, Trevor Darrell, and Alexei A Efros. Unsupervised Domain Adaptation Through Self-Supervision. arXiv preprint arXiv:1909.11825, 2019.
+[72] 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, pages 2818–2826, 2016.
+[73] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning Spatiotemporal Features With 3D Convolutional Networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015.
+[74] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial Discriminative Domain Adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7167–7176, 2017.
+[75] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep Hashing Network for Unsupervised Domain Adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5018–5027, 2017.
+[76] Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. Manifold Mixup: Better Representations by Interpolating Hidden States. In International Conference on Machine Learning, pages 6438–6447. PMLR, 2019.
+[77] Jiangliu Wang, Jianbo Jiao, and Yun-Hui Liu. Self-Supervised Video Representation Learning by Pace Prediction. In European Conference on Computer Vision, pages 504–521, 2020.
+[78] Jinpeng Wang, Yuting Gao, Ke Li, Yiqi Lin, Andy J Ma, Hao Cheng, Pai Peng, Feiyue Huang, Rongrong Ji, and Xing Sun. Removing the Background by Adding the Background: Towards Background Robust Self-supervised Video Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11804–11813, 2021.
+[79] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal Segment Networks: Towards Good Practices for Deep Action Recognition. In European conference on computer vision, pages 20–36, 2016.
+[80] Mei Wang and Weihong Deng. Deep Visual Domain Adaptation: A Survey. Neurocomputing, 312:135–153, 2018.
+[81] Xiaolong Wang and Abhinav Gupta. Videos as Space-Time Region Graphs. In Proceedings of the European conference on computer vision (ECCV), pages 399–417, 2018.
+[82] Xueying Wang, Lei Liu, Guangli Li, Xiao Dong, Peng Zhao, and Xiaobing Feng. Background Subtraction on Depth Videos With Convolutional Neural Networks. In 2018 International Joint Conference on Neural Networks (IJCNN), pages 1–7. IEEE, 2018.
+[83] Yuan Wu, Diana Inkpen, and Ahmed El-Roby. Dual Mixup Regularized Learning for Adversarial Domain Adaptation. In European Conference on Computer Vision, pages 540–555. Springer, 2020.
+[84] Yaochen Xie, Zhao Xu, Zhengyang Wang, and Shuiwang Ji. Self-Supervised Learning of Graph Neural Networks: A Unified Review. arXiv preprint arXiv:2102.10757, 2021.
+[85] Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial Domain Adaptation with Domain Mixup. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 6502–6509, 2020.
+[86] Yuan Yao, Chang Liu, Dezhao Luo, Yu Zhou, and Qixiang Ye. Video Playback Rate Perception for Self-Supervised Spatio-Temporal Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6548–6557, 2020.
+[87] Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph Contrastive Learning With Augmentations. Advances in Neural Information Processing Systems, 33, 2020.
+[88] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization Strategy To Train Strong Classifiers With Localizable Features. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6023–6032, 2019.
+[89] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. Mixup: Beyond Empirical Risk Minimization. arXiv preprint arXiv:1710.09412, 2017.
+[90] Yabin Zhang, Bin Deng, Kui Jia, and Lei Zhang. Label Propagation with Augmented Anchors: A Simple Semi-Supervised Learning baseline for Unsupervised Domain Adaptation. In European Conference on Computer Vision, pages 781–797. Springer, 2020.
+[91] Yiheng Zhang, Zhaofan Qiu, Ting Yao, Dong Liu, and Tao Mei. Fully Convolutional Adaptation Networks for Semantic Segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6810–6818, 2018.
+[92] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal Relational Reasoning in Videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803–818, 2018.
+[93] Zoran Zivkovic. Improved Adaptive Gaussian Mixture Model for Background Subtraction. In Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004., volume 2, pages 28–31. IEEE, 2004.
+[94] Yuliang Zou, Jinwoo Choi, Qitong Wang, and Jia-Bin Huang. Learning Representational Invariances for Data-Efficient Action Recognition. arXiv preprint arXiv:2103.16565, 2021.
+[95] Yuliang Zou, Zizhao Zhang, Han Zhang, Chun-Liang Li, Xiao Bian, Jia-Bin Huang, and Tomas Pfister. PseudoSeg: Designing Pseudo Labels for Semantic Segmentation. arXiv preprint arXiv:2010.09713, 2020.
\ No newline at end of file
diff --git a/md/train/aRTRjVPkm-/aRTRjVPkm-.md b/md/train/aRTRjVPkm-/aRTRjVPkm-.md
new file mode 100644
index 0000000000000000000000000000000000000000..9ee82473a808ee3d06719475e172a4eab548e030
--- /dev/null
+++ b/md/train/aRTRjVPkm-/aRTRjVPkm-.md
@@ -0,0 +1,462 @@
+# LANGUAGE MODELS ARE OPEN KNOWLEDGE GRAPHS
+
+Anonymous authors Paper under double-blind review
+
+# ABSTRACT
+
+This paper shows how to construct knowledge graphs (KGs) from pre-trained language models (e.g., BERT, GPT-2/3), without human supervision. Popular KGs (e.g, Wikidata, NELL) are built in either a supervised or semi-supervised manner, requiring humans to create knowledge. Recent deep language models automatically acquire knowledge from large-scale corpora via pre-training. The stored knowledge has enabled the language models to improve downstream NLP tasks, e.g., answering questions, and writing code and articles. In this paper, we propose an unsupervised method to cast the knowledge contained within language models into KGs. We show that KGs are constructed with a single forward pass of the pretrained language models (without fine-tuning) over the corpora. We demonstrate the quality of the constructed KGs by comparing to two KGs (Wikidata, TAC KBP) created by humans. Our KGs also provide open factual knowledge that is new in the existing KGs. Our code and KGs will be made publicly available.
+
+# 1 INTRODUCTION
+
+Knowledge graphs (KGs) are an important resource for both humans and machines. Factual knowledge in KGs is injected into AI applications to imitate important skills possessed by humans, e.g., reasoning and understanding. KG construction is mainly supervised, requiring humans to handwrite every fact, such as Freebase $\{ { \mathrm { B o l l a c k e r ~ e t ~ a l . } } \} [ 2 0 0 8 \} )$ and Wikidata. KGs can also be constructed in a semi-supervised way, in which a semi-automatic extractor is used to obtain the facts from web corpora (e.g., NELL (Carlson et al., 2010) and Knowledge Vault $\textcircled { \mathrm { D o n g e t a l . } } \textcircled { 2 0 1 4 } )$ . Humans however still need to interact with the extractor to improve the quality of the discovered facts. Therefore, human supervision, which is often expensive, is required in constructing KGs.
+
+Recent progress in language models (LMs), such as BERT (Devlin et al., 2018) and GPT-2/3 (Radford et al., 2019; Brown et al., 2020), has led to superior results even outperforming humans in a wide range of tasks, e.g., sentence classification $\mathrm { ( \overline { { W a n g ~ e t ~ a l . } } ) } \mathrm { \textmu { 2 0 1 8 } } \mathrm { ) }$ question answering $\mathbf { \textregistered } \mathbf { \textmu } \mathbf { B r o w n } \mathbf { \Psi }$ et al., 2020). Pre-trained LMs are also capable to write poetry, music, and code, while such tasks often require we human to spend a significant amount of time in learning the relevant knowledge to work well. In fact, these pre-trained LMs automatically acquire factual knowledge from large-scale corpora (e.g., BookCorpus $\mathbb { ( Z h u e t a l . } ) \index { [ 2 0 1 5 ] }$ , Common Crawl $\mathrm { ( B r o w n e t a l . ] } \mathrm { \Omega } \mathrm { \stackrel { \sim } { \Sigma } } \mathrm { ) }$ via pre-training. The learned knowledge in pre-trained LMs is the key to the current success. We therefore consider the following question: instead of using the manually created knowledge, can we use the knowledge stored in pre-trained LMs to construct KGs?
+
+In this paper, we design an unsupervised approach called MAMA that successfully recovers the factual knowledge stored in LMs to build KGs from scratch. MAMA constructs a KG with a single forward pass of a pre-trained LM (without fine-tuning) over a textual corpus. As illustrated in Figure 1, MAMA has two stages: Match and Map. Match stage generates a set of candidate facts by matching the facts in the textual corpus with the knowledge in the pre-trained LM. General or world knowledge from large-scale corpora is embedded in the LM, thus candidate facts in the target corpus are often covered by the knowledge in the LM. The candidate facts are matched through an efficient beam search in the attention weight matrices of the pre-trained LM without fine-tuning. Map stage produces an open KG via mapping the matched candidate facts from Match stage to both fixed KG schema and open schema. If the schema of candidate facts exists in the KG schema, we map the candidate facts directly to the fixed KG schema. Otherwise, we reserve the unmapped candidate facts in the open schema. This results in a new type of KG, open KG, with a mixture of mapped facts in fixed KG schema and unmapped facts in the open schema.
+
+
+Figure 1: Overview of the proposed approach MAMA. MAMA constructs an open knowledge graph (KG) with a single forward pass of the pre-trained language model (LM) (without fine-tuning) over the corpus. Given the input: a textual corpus containing passages and sentences, e.g., English Wikipedia, and a pre-trained LM, e.g., BERT, GPT-2/3, MAMA (1) generates a set of candidate facts via matching the knowledge in the pretrained LM with facts in the textual corpus, e.g., a candidate fact (Dylan, is, songwriter) from the sentence “Dylan is a songwriter.”, and (2) produces an open KG by mapping the matched candidate facts to both an existing KG schema, e.g., (Bob Dylan.Q392, occupation.P106, Songwriter.Q753110) in Wikidata schema, and an open schema, e.g., (Bob Dylan.Q392, sign, Albert Grossman.Q708584).
+
+Our contributions are as follows:
+
+1. We show how to construct KGs from pre-trained LMs. The KGs are constructed with a single forward pass of the pre-trained LMs without fine-tuning over the textual corpora. This helps researchers explicitly understand what the language models learn, bridging the deep LM and KG communities through enhanced model transparency.
+2. We propose an unsupervised two-stage approach, MAMA, to first match the candidate facts in the corpora with the knowledge stored in LMs, then map the matched candidate facts to both fixed and open schema to produce a KG.
+3. We generate a new type of KG, namely open KG, consists of mapped facts in the fixed KG schema of existing KGs (Wikidata and TAC KBP) annotated by humans; and unmapped facts in the open schema that are new in the reference KG schema. The reach of this result is broad and has downstream utility for knowledge graph construction, deep neural network interpretation, and information extraction.
+
+# 2 MAMA
+
+We introduce an unsupervised end-to-end approach Match and Map (MAMA) as illustrated in Figure 1 to construct open knowledge graphs (KGs) from language models (LMs). MAMA constructs the KGs with a single forward pass of the pre-trained LMs (without fine-tuning) over the corpora. The two stages of MAMA are:
+
+Match generates a set of candidate facts from a textual corpus. LMs contain global or world knowledge learned from large-scale corpora, which often does not perfectly match the knowledge in the target corpus. The goal of this stage is to match the knowledge stored in pre-trained LMs with facts in the corpus. Each fact is represented as a triplet (head, relation, tail) 1, in short, $( h , r , t )$ , and passed to Map stage. Match procedure is detailed in Sec. 2.1.
+
+Map produces an open KG using the matched candidate facts from Match stage. The constructed open KG has two portions: (a) mapped candidate facts that are in a fixed KG schema, e.g., (Dylan, is, songwriter) is mapped to (Bob Dylan.Q392, occupation.P106, Songwriter.Q753110) according to Wikidata schema; and (b) unmapped candidate facts that are in an open schema, e.g., a candidate fact (Dylan, signed, Albert Grossman) is partially mapped to (Bob Dylan.Q392, sign, Albert Grossman.Q708584) in the open schema. This stage is described in Sec. 2.2.
+
+
+
+(b) Attention matrix for matching degree calculation.
+
+
Step
Action
Intermediatecandidates
Matchingdegrees
0
START
(Dylan,
0
1
YIELD
(Dylan, is
0.3
2
YIELD
(Dylan, is songwriter
0.7
3
STOP
(Dylan,is,songwriter)
0.7
+
+
Key:
Query:
Dylan
is
a
songwrite
Dylan
X
×
×
×
is
0.3
X
X
X
a
0.1
0.2
X
X
songwriter
0.1
0.4
0.2
×
+
+(a) Matching example.
+
+Figure 2: Illustration of Match stage. The upper part of (a) represents the general matching steps of generating the best matched candidate fact (Dylan, is, songwriter) from the sentence “Dylan is a songwriter.” The lower portion shows the corresponding step-by-step process. Given a head-tail pair (Dylan, songwriter), at each step, the search chooses one of the actions, i.e., START, YIELD, STOP to produce an intermediate candidate fact. The search starts by adding the head “Dylan” as an initial candidate (step 0). The matching degree of the candidate is initialized as 0. Next, a new candidate is yielded if the candidate has not reached the tail “songwriter” (step 1 and step 2), by appending the next largest attended token (with the largest score from the attention matrix (b) of the sentence) to the end of the current candidate, and the corresponding matching degrees are increased by the associated attention scores (0.3 and 0.4) to 0.3 $\left( 0 { + } 0 . 3 \right)$ and 0.7 $( 0 . 3 \substack { + 0 . 4 } )$ respectively. Otherwise, the search stops, and the candidate fact with the best matching degree is returned for the head-tail pair (step 3). The attention matrix (b) is from the forward pass of the LM without fine-tuning over the sentence. “x” marks the tokens to prevent searching backward.
+
+# 2.1 MATCH
+
+We frame the matching procedure as a search problem. To obtain the best matched candidate facts of an input sentence, the candidates with the top matching degrees are returned from a search process. The matching degree is derived from the search in the attention weight matrices of the pre-trained LM, since the attention weight matrices are one of the main containers of the knowledge in the pre-trained LM. The attention weight matrices are simply from the forward pass of the LM without fine-tuning over the sentence.
+
+# 2.1.1 BEAM SEARCH
+
+We design a simple-yet-effective beam search to find the best matched candidate facts. For every head-tail pair $( h , t )$ in a sentence, the search maintains the $k$ -best matched candidate facts of the pair. Let’s first consider the search from left to right with beam size equals to 1. An example search process is shown in Figure $\bigtriangledown$ Given a head-tail pair (Dylan, songwriter), at each step, the search performs one of the following actions:
+
+START the search from the head. The head $h$ is added as an initial candidate into the beam. For simplicity, we use ${ \mathrm { S T A R T } } ( h )$ to denote the action, which returns a candidate ( $h .$ . In Figure $\mathbf { \bar { \rho } } _ { 2 ( \mathbf { a } ) }$ , at step 0, the head “Dylan” is added as (Dylan, into the beam. The matching degree is initialized to 0.
+
+YIELD a new intermediate candidate in the beam if the current candidate has not reached the tail. The next largest attended token (with the largest score from the attention matrix) is appended to the end of the current candidate to yield the new candidate. The corresponding matching degrees are increased by the associated attention scores. At step 1 (orange arrow in Figure $2 ( \bar { \mathbf { a } } ) ,$ ), “is” is appended to the current candidate to yield (Dylan, is, , since “is” has the largest attention score with “Dylan” in the attention matrix. The attention score is 0.3 as highlighted in orange in Figure $2 ( \mathbf { b } )$ . The matching degree becomes 0.3 (i.e. $0 { + } 0 . 3$ ). The multi-head attention is reduced to a single head so that every two tokens of the sentence are associated with one attention weight. We experiment with different reduction
+
+# Algorithm 1 Beam search for matching candidate facts.
+
+Input: Head-tail pair $\overline { { ( h , t ) } }$ , sentence $s$ , attention matrix $\overline { { \mathbf { A } _ { \mathbf { s } } } }$ , action manager $\mathcal { O } = \{ \mathrm { S T A R T } , \mathrm { Y T E L D } , \mathrm { S T O P } \}$ ,
+beam size $k$
+Output: Candidate facts T(h,t)
+1: $\mathbb { T } _ { ( h , t ) } \gets \{ \mathtt { S T A R T } ( h ) \}$ . Start by adding the head as a candidate in the beam
+2: while $\exists c \in \mathbb { T } _ { ( h , t ) } [ \mathcal { O } ( c ) = \mathrm { Y } \mathrm { I } \mathrm { E } \mathrm { L } \mathrm { D } ] \ : \mathbf { d }$ o
+3: $\widetilde { \mathbb { T } } _ { ( h , t ) } \gets \emptyset$ . Initialize a new beam
+4: for each $c \in \mathbb { T } _ { ( h , t ) }$ do
+5: if $\mathcal { O } ( c ) = \mathtt { Y I E L D }$ then
+6: $\widetilde { \mathbb { T } } _ { ( h , t ) } \gets \widetilde { \mathbb { T } } _ { ( h , t ) } \cup \{ \mathrm { { Y I E L D } } ( c , s , \mathbf { A } _ { s } ) \}$ . Yield a new candidate if not reached the tail
+7: else
+8: $\widetilde { \mathbb { T } } _ { ( h , t ) } \gets \widetilde { \mathbb { T } } _ { ( h , t ) } \cup \{ \mathrm { S T O P } ( c , t ) \}$ . Stop then produce a valid fact if reached the tail
+9: end if
+10: end for
+11: $\mathbb { T } _ { ( h , t ) } \gets \mathrm { T O P } ( k , \widetilde { \mathbb { T } } _ { ( h , t ) } )$ . Maintain $k$ -best candidates in the beam
+12: end while
+13: return T(h,t)
+
+setups in Sec. A.3. “x” marks the tokens (prior to the current token) that are not considered in the search to prevent searching backward. Step 2 similarly takes YIELD action to produce (Dylan, is songwriter, . The matching degree is now 0.7 (i.e. $0 . 3 \substack { + 0 . 4 ) }$ . We use YIELD $\left( c , s , \mathbf { A } _ { s } \right)$ to denote the action, where $c$ is a current candidate, $s$ represents the sentence, and ${ \bf A } _ { s }$ is the attention matrix from the forward pass of the pre-trained LM over $s$ which yields a new candidate.
+
+STOP the search step if the candidate has reached the tail, then add the candidate as a valid candidate fact into the beam. As beam size equals to 1, (Dylan, is, songwriter) is the only returned candidate fact for the given pair. The final matching degree of the candidate is 0.7. We denote this step using $\boldsymbol { \mathrm { S T O P } } ( \boldsymbol { c } , t )$ , which returns a valid fact.
+
+The details of the proposed beam search are in Algorithm 1. The inputs of the search algorithm are a head-tail pair $( h , t )$ , a sentence $s$ , an attention matrix $\mathbf { \bar { A } } _ { s }$ of $s$ . Both $h$ and $t$ are identified by the noun chunk in $s$ . ${ \bf A } _ { s }$ is the attention matrix associated with $s$ from the forward pass of LM without fine-tuning. The search gets started by adding the head $h$ as the initial candidate in the beam (line 1). While there are still new candidates waiting to be yielded (line 2), the search continues, and the top $k$ candidates sorted by the matching degrees are maintained (line 3-11) in the beam. In practice, we implement an action manager $\mathcal { O }$ to decide which action to take at each step. Given a candidate $c$ in the beam, $\begin{array} { r } { \mathcal { O } ( c ) = \bar { \mathrm { S T A R T } } } \end{array}$ always happens at the beginning of the search. If $c$ has not reached the tail $t$ yet, $\mathcal { O } ( c ) = \mathtt { Y I E L D }$ . Otherwise, $\mathcal { O } ( c ) = \mathtt { S T O P }$ . We convert the subwords to the corresponding full words. We also notice some facts are in reverse order in the sentence, e.g., said Jason Forcier , a vice president at battery maker A123 Systems Inc.” for facts of relation “org:top members employees”, thus enable bidirectionality by running the algorithm in both directions (left to right and right to left). The beam search is implemented by the breadth-first search, which is efficient as the time complexity is $O ( k \cdot d )$ , where $d$ is the maximum depth of the search tree.
+
+# 2.1.2 FILTER
+
+Although the basic functionality provided by beam search is sufficient for finding useful candidate facts, we have found a few constraints useful. Given a candidate fact $( h , r , t )$ from beam search result $\mathbb { T } _ { ( h , t ) }$ , it remains as a fact if satisfying all the following constraints.
+
+Constraint #1 The matching degree of $( h , r , t )$ is above a threshold. We compare the matching degrees corpus-wide to only reserve the facts that are matched better with the knowledge in LMs. For example, MAMA extracts a fact (Rolling Stone, wrote, pop song) from “Rolling Stone wrote: “No other pop song has so thoroughly challenged artistic conventions””, which is not an accurate fact based on the sentence. We observe the associated matching degree is below a proper threshold, while the matching degrees of high-quality facts from the same documents, e.g., (Dylan, is, songwriter), or confident facts from the other documents are beyond the threshold.
+
+Constraint #2 The distinct frequency of $r$ is above a threshold. To avoid facts to be over-specified, e.g., (Dylan, signed to Sam Peckinpah’s film, Pat Garrett and Billy the Kid), we require $r$ should take many distinct head-tail pairs in the corpus.
+
+Constraint #3 Relation $r$ is a contiguous sequence in the sentence. We can avoid $r$ that has no meaningful interpretation (Fader et al., 2011), e.g., (Rolling Stone, wrote challenged, conventions) from the above sentence.
+
+# 2.2 MAP
+
+The objective of Map stage is to generate an open KG. The open KG contains (a) mapped facts in a KG schema (Sec. 2.2.1), e.g., Wikidata schema, if the schema of the candidate facts is within the existing KG schema; and (b) unmapped facts from (a) in an open schema (Sec. 2.2.2)
+
+# 2.2.1 MAPPED FACTS IN KG SCHEMA
+
+The goal is to map a candidate fact $( h , r , t )$ to a fact $\left( h _ { k } , r _ { k } , t _ { k } \right)$ in the KG schema. The reason for mapping to an existing KG schema is to make use of the high-quality schema designed by experts (to avoid duplicated efforts of building from scratch) and enable evaluating the candidate facts with oracle KG facts contributed by human volunteers. We first map both entities $h , t$ to $h _ { k } , t _ { k }$ , then map the relation $r$ to $r _ { k }$ in the reference KG schema. Additional details are presented in Sec. A.1.
+
+Entity linking to KG schema We adapt an unsupervised entity linker based on a mention-to-entity dictionary $\left( \mathrm { S p i t k o v s k y ~ \& ~ C h a n g } \right) \left[ 2 0 1 2 \right)$ to link the entities for scalability consideration. Besides, contextual information is crucial to link the entities correctly, we use the word embedding of the context to disambiguate the entities, which means we only link the entities with high contextual similarities based on the word embedding. We adopt the entity linker to map $h , t$ to $h _ { k } , t _ { k }$ .
+
+Relation mapping with KG schema We largely follow the relation mapping method proposed by Angeli et al. (2015) to construct an offline relation map between KG relation and relation phrases of the candidate facts. The basic idea is that the more often linked head-tail pairs (i.e., entities are with type information from the entity linking step) co-occur between the candidate facts and KG facts, the more likely the corresponding relations are mapped to each other. In addition, we normalize each relation phrase of the candidate facts by lemmatization, and removing inflection, auxiliary verbs, adjectives, adverbs. After the relation mapping is constructed, one author manually checks whether the top 15 relation phrases are true mappings for each KG relation. We only reserve the true ones in the final relation mapping. This process takes approximately one day. Later, $r$ is mapped to $r _ { k }$ with an efficient look-up operation in the relation mapping.
+
+# 2.2.2 UNMAPPED FACTS IN OPEN SCHEMA
+
+An unmapped candidate fact $( h , r , t )$ means at least one of $h , r$ , and $t$ is not mapped to the KG schema based on the method in Sec. 2.2.1. There are two types of unmapped candidate facts:
+
+Partially unmapped facts represent at least one of $h , r .$ , and $t$ are mapped to the KG schema. It can be $h$ or $t$ mapped to $h _ { k }$ or $t _ { k }$ based on the entity linker in $\sec . { \boxed { 2 . 2 . 1 } }$ It can also be $r$ that mapped to $r _ { k }$ using the relation mapping in $\mathrm { S e c . } 2 . 2 . 1 .$ This actually results in unmapped facts that are in a mixture of the KG schema and the open schema. As the overall schema of the unmapped facts is not in the KG schema, we use open schema to denote such unmapped facts in the rest of the paper for simplicity. An example is (Dylan, signed, Albert Grossman) in Figure $^ { 1 , }$ where both head and tail are linked to Wikidata schema based on the entity linker in Sec. 2.2.1, but the relation cannot be mapped since there is no relation mapping from “signed” to a KG relation in Wikidata schema.
+
+Completely unmapped facts indicate all $h , r$ , and $t$ are not mapped to the KG schema. This means neither the entity linker nor the relation mapping is able to map $h , r .$ , and $t$ to $h _ { k }$ , $r _ { k }$ , $t _ { k }$ respectively. The resulting unmapped candidate facts stay in the open schema, e.g., a candidate fact (Jacob, was, A Registered Mennonite) stays the same in the open schema from a sentence “Jacob was a registered Mennonite in Amsterdam.”.
+
+The resulting open KG is a new type of KG that mixes the fixed KG schema with the flexible open schema, suggesting new directions for the next generation of KGs. The open KG not only contains existing knowledge in the reference KGs, but also extends the fixed KG schema with an additional open schema to improve the coverage of the KGs, that benefits the downstream KG based applications, e.g., QA and commonsense reasoning (Wang et al., 2019; Brown et al., 2020).
+
+
KG
#of oracle facts
|#of documents
TACKBP
27,655 □
3,877,207
Wikidata
27,368,562
6,047,494
+
+Table 1: Dataset statistics of two knowledge graphs: TAC KBP and Wikidata. TAC KBP refers to TAC KBP Slot Filling 2013 challenge. # of oracle facts for TAC KBP is the number of oracle facts in the 2013 task. # of documents for TAC KBP is the number of the documents in the 2013 task. # of oracle facts for Wikidata is the total number of oracle facts in Wikidata. # of documents for Wikidata is the size of English Wikipedia.
+
+# 3 EXPERIMENTS
+
+How well can language models generate knowledge graphs? We experimentally explore how well can MAMA answer the question in the section. To measure the ability of LMs in generating KGs, we directly measure the quality of resulting open KGs. The open KG contains two types of facts: mapped facts in the fixed KG schema; and unmapped facts in the open schema. We first quantitatively evaluate MAMA by comparing the mapped facts to oracle KGs annotated by humans in Sec. 3.1, then conduct an in-depth analysis of the unmapped facts in Sec. 3.2.
+
+# 3.1 RESULTS ON MAPPED FACTS
+
+We first study the quality of the mapped facts. As the candidate facts have been mapped to the schema of oracle KGs, we are able to quantitively compare the candidate facts with the oracle facts in the reference KGs.
+
+# 3.1.1 DATASETS
+
+We compare the mapped facts from MAMA with the facts in two KGs:
+
+TAC KBP TAC Knowledge Base Population (KBP) Slot Filling is a task to search a document collection to fill in the tail/object entity for predefined relations (slots) for a given head/subject entity in a reference KG. We experiment with the reference KG in the 2013 challenge. We use the document collection and oracle facts of the 2013 task. The statistic of the dataset is shown in Table 1.
+
+Wikidata We use popular Wikidata as another KG. We use all the oracle facts in Wikidata. We use the English Wikipedia as the text corpus, since a large amount of facts in Wikidata is from English Wikipedia. The statistic is in Table 1.
+
+To evaluate the mapped facts, we first use Match stage of MAMA to run over the corresponding documents to generate the candidate facts. Then Map stage is leveraged to map the candidate facts to the schema of TAC KBP and Wikidata respectively. The parameter settings, such as beam size in Algorithm $\bigstar \bigstar$ are shared across TAC KBP and Wikidata based on the parameter study in Sec. A.3.
+
+# 3.1.2 TAC KBP
+
+To verify the ability to produce correct facts, we compare candidate facts from MAMA to the outputs of two open information systems, which also produce triplets in the form of $( h , r , t )$ . After collecting the triplets from the corresponding system, we use the same Map procedure with MAMA (Sec. 2.2.1) to map the triplets to the corresponding KG schema.
+
+Stanford OpenIE leverages POS tag and dependency parser, and generates self-contained clauses from long sentences to extract the triplets, which is the best open information extraction system (Angeli et al., 2015) on TAC KBP (Surdeanu, 2013).
+
+OpenIE 5.1 2 is one of the state-of-the-art open information extraction systems, which is the successor to Ollie (Schmitz et al., 2012), and it improves extractions from noun relations, numerical sentences, and conjunctive sentences depending on the linguistic patterns.
+
+We use two families of pre-trained LMs with MAMA. We use BERTBASE and BERTLARGE from Devlin et al. (2018) with MAMA, namely MAMA-BERTBASE and MAMA-BERTLARGE. Besides, GPT-2s from Radford et al. (2019) are used, i.e., MAMA-GPT-2, MAMA-GPT-2MEDIUM, MAMA-GPT-2LARGE, and MAMA-GPT- $2 _ { \mathrm { X L } }$ .
+
+
Method
#ParamsofLM
Precision%
Recall%
F1%
OpenIE5.1 □
56.98
14.54
23.16
Stanford OpenIE Angeli et al.2015)
61.55
17.35
27.07
MAMA-BERTBASE (OUrS)
109M
61.57
18.79
28.79
MAMA-BERTLARGE (Ours)
335M
61.69
18.99
29.05
MAMA-GPT-2 (ours)
117M
61.62
18.17
28.07
MAMA-GPT-2MEDIUM (ours)
345M
62.10
18.65
28.69
MAMA-GPT-2LARGE (ours)
774M
62.38
19.00
29.12
MAMA-GPT-2xL (ours)
1558M
62.69
19.47
29.72 (+2.65)
+
+Table 2: Compare the quality of mapped facts on TAC KBP. #Params of LM refers to the number of parameters of the pre-trained LM.
+
+Table 2 shows the results on TAC KBP. We use the official scorer of TAC KBP Slot Filling 2013 to evaluate precision, recall, and F1 on TAC KBP 3.
+
+MAMA constructs improved KGs compared to open IE. From the results, we find that all our methods achieve competitive precision, which is greater than $60 \%$ , given the unsupervised nature of MAMA. All the proposed methods outperform the two open IE systems. This shows that MAMA is able to produce high-quality knowledge directly from pre-trained LMs by a single forward pass without human supervision. The results show the effectiveness of MAMA in generating candidate facts from Match stage, and producing high-quality KGs through Map stage. We also find that MAMA-GPT- $2 _ { \mathrm { X L } }$ performs the best. MAMA-GPT- $2 _ { \mathrm { X L } }$ outperforms the previous state-of-the-art Stanford OpenIE by over $2 . 6 \%$ in F1. This shows the proposed end-to-end MAMA is able to recover the knowledge stored in pre-trained LMs without relying on any extra linguistic features, such as POS tag and dependency parser used in open IE systems. The main reason leading to the moderate results of OpenIE 5.1 is that the system generates objects of the triplets with extraneous words, which hurt the performance in slot filling tasks. Even though the proposed methods all outperform the two open IE systems in the recall, however improving recall is clearly the future direction to further improve the performance of MAMA. We find that the main cause of the moderate recall is the incorrect entities caused by spaCy noun chunk as summarized in Sec. A.2.
+
+Larger/deeper LMs produce KGs of higher quality. BERTLARGE outperforms BERTBASE since the doubling parameter size. GPT-2s share similar trends, where we observe performance increases when the model size increases. This complies with our intuition on more knowledge is stored in deeper and larger models. Such increases in performance seem subtle on TAC KBP, we find this might due to the relatively small number of oracle facts by noticing a more significant improvement on Wikidata in Sec. 3.1.3. We plan to further improve the results with larger pre-trained LMs, e.g., GPT-3 (Brown et al., 2020), Megatron-LM (Shoeybi et al., 2019)
+
+BERT LMs outperform GPT-2 LMs under similar model sizes. More specifically, BERTBASE performs better than MAMA-GPT-2 in F1, and MAMA-BERTLARGE outperforms MAMA-GPT2MEDIUM in F1. BERTBASE and MAMA-GPT-2 are similar in size, while MAMA-BERTLARGE and MAMA-GPT-2MEDIUM are similar in model size as well. This is mainly because that the recall of BERT LMs is higher than that of corresponding GPT-2 LMs. The result indicates that the Cloze-style loss function (i.e., masked language model) of BERT is more effective and flexible in recovering more knowledge than the autoregressive LM objective. We also notice that the precision of GPT-2 LMs is higher than that of according BERT LMs. The reason is that the autoregressive LM objective captures more accurate knowledge than Cloze-style loss does by not introducing extra noise (e.g., masked tokens) during pre-training.
+
+# 3.1.3 WIKIDATA
+
+We select our best BERT based method MAMA-BERTLARGE, and GPT-2 based method MAMA$\mathrm { G P T } { \cdot } 2 _ { \mathrm { X L } }$ on TAC KBP to compare with Stanford OpenIE (the best open IE system on TAC KBP) for scalability experiments on Wikidata. We follow the same definition as the slot filling task to calculate precision, recall, and F1 on Wikidata. Table 3 summarizes the results.
+
+MAMA is scalable to larger corpora. Similar to the trends on TAC KBP, MAMA-GPT- $2 _ { \mathrm { X L } }$ performs the best in precision, recall, and F1. The results show the effectiveness of MAMA in generating candidate facts and high-quality KGs. We also find that MAMA-GPT- $2 _ { \mathrm { X L } }$ outperforms MAMA-BERTLARGE by over $1 \%$ in F1. This shows that the larger model $( \mathrm { G P T - } 2 _ { \mathrm { X L } }$ has $5 \mathbf { x }$ more parameters compared to BERTLARGE) contains more knowledge, and MAMA is able to restore the knowledge. When larger or deeper models (e.g., GPT-3) are used with MAMA, we can expect more gains of the KG quality. Thanks to the efficient nature of MAMA, which relies only on the forward pass of the LMs without fine-tuning, the results suggest that MAMA is scalable to large KGs.
+
+
Method
#Params ofLM
Precision%
Recall%
F1%
Stanford OpenIE Angeli et al.2015
=
23.32
13.09
16.77
MAMA-BERTLARGE (ours)
335M
29.52
16.56
21.22
MAMA-GPT-2xL (ours)
1558M
31.32
17.42
22.39 (+5.62)
+
+Table 3: Compare the quality of mapped facts on Wikidata. #Params of LM refers to the number of parameters of the pre-trained LM.
+
+Larger corpora embed more complete KGs. In particular, MAMA-GPT- $2 _ { \mathrm { X L } }$ outperforms Stanford OpenIE by $5 . 6 \%$ in F1. MAMA-BERTLARGE outperforms Stanford OpenIE by approximately $4 . 4 \%$ in F1. Both F1 gains are larger compared to that on TAC KBP. This is because that the LMs contain world knowledge from pre-training corpora, e.g. Wikipedia and Common Crawl. The larger the textual corpora are, the more knowledge our method is able to recover and match to the knowledge stored in LMs. The finding is particularly important, since we are now able to construct larger KGs of high quality from scratch when larger datasets are used, such as WebText2 and Common Crawl (Raffel et al., 2019; Brown et al., 2020). Similar to the observations on TAC KBP, the precision is higher compared to recall. Wikidata is not fully built from Wikipedia, MAMA could improve the recall by running on those larger corpora to collect more facts.
+
+# 3.2 ANALYSIS OF UNMAPPED FACTS
+
+The open KG constructed by MAMA is a new type of KG combining the fixed KG schema with the flexible open schema. We turn to study the quality of the candidate facts that are not mapped to the above reference KG schema, but are in the open schema generated by MAMA. We manually judge such unmapped facts generated by our best method MAMA-GPT- $2 _ { \mathrm { X L } }$ from 100 sampled documents in Wikidata and TAC KBP respectively.
+
+The quality of unmapped facts is verified by human annotators. We find $3 5 . 3 \%$ of the unmapped facts are true on Wikidata. We find $8 3 . 2 \%$ of those true facts are partially unmapped facts as defined in Sec. 2.2.2, e.g., (Bob Dylan.Q392, tour with, the Grateful Dead.Q212533), whose relation is not within the schema of Wikidata, while both head and tail are in the schema. The remaining true facts are completely unmapped facts $( \mathrm { S e c . } \bigstar . \bigstar . 2 . 2 )$ e.g., a candidate fact (Jacob, was, A Registered Mennonite) stays the same in the open schema.
+
+Accurate entity detection is desired. We also notice $4 5 . 5 \%$ of the untrue unmapped facts on Wikidata are due to the incorrect entities detected by the spaCy. Incorrect or missing entity linking (to either head or tail) in Sec. 2.2.1 causes additional $9 . 1 \%$ errors in the unmapped facts. $4 . 5 \%$ o f the untrue unmapped facts are caused by the missing relation mapping in Sec. 2.2.1. The rest errors made by MAMA-GPT- $2 _ { \mathrm { X L } }$ are incorrect relation phrases, such as uninformative relation phrases, e.g., (Dylan, made, his breakthrough), which is similar to the errors made by open IE systems (Fader et al., 2011). Both entity linking and relation mapping of Map stage rely heavily on the accuracy of entity detection from the spaCy noun chunk. We conclude that the main root cause of the untrue unmapped facts is due to the errors made by the spaCy noun chunk.
+
+We observe similar trends on TAC KBP. We plan to leverage crowdsourcing platforms, e.g., Mechanical Turk, to conduct quantitative evaluations over the unmapped facts to better understand the strengths and shortage of MAMA. We plan to identify more accurate entities by relying on attention weights in LMs (Clark et al., 2019; Hewitt & Manning, 2019) instead of using extra resources. We will also investigate stronger entity linkers (Kolitsas et al., 2018) and learn a more robust relation mapping through weak or distant supervision (Mintz et al., 2009; Ratner et al., 2017). We will investigate more sophisticated approaches, such as graph neural networks (Kipf & Welling, 2016), to generate more accurate relation phrases from the attention weight matrices by considering structural information.
+
+# 4 RELATED WORK
+
+Knowledge graph construction can be generally categorized into two groups, 1) supervised approaches. Wikidata, Freebase (Bollacker et al., 2008), YAGO (Suchanek et al., 2007), YAGO2 (Hoffart et al., 2013), DBpedia (Auer et al., 2007) are built based on human supervision from Wikipedia infoboxes and other structured data sources; 2) semi-supervised approaches. Open information extraction systems, e.g., OLLIE (Schmitz et al., 2012), Reverb $\{ { \overline { { \mathrm { F a d e r ~ e t ~ a l . } } } } \} \ @ 1 1 \}$ , Stanford OpenIE (Angeli et al., 2015), and OpenIE 5.1 2 aim to leverage carefully-designed patterns based on linguistic features (e.g., dependencies and POS tags), to extract triplets from web corpora for open schema KG. Besides, NELL $\lVert \overline { { \mathbb { C } \mathrm { a r l s o n ~ e t ~ a l . } } } \rVert \overline { { 2 0 1 0 } } \rVert$ , DeepDive $\mathbb { \left( \vec { N i u \ e t \ a l . } \vec { 2 0 1 2 } \right) }$ , Knowledge Vault $\textcircled { \mathrm { D o n g ~ e t ~ a l . } } \textcircled { 2 0 1 4 }$ extract information based on a fixed schema or ontology, where humans help improve the accuracy of the extractions. Probase $\boxed { \mathrm { W u e t a l . } } \boxed { 2 0 1 2 }$ produces taxonomies instead of rich typed relations in general KGs. MAMA instead uses learned knowledge stored in pre-trained LMs without human supervision to construct an open KG, which is a mixture of fixed schema and open schema. Different from commonsense knowledge construction using Transformers (Davison et al., 2019; Bosselut et al., 2019), the proposed method is unsupervised and end-to-end, and constructs general-purpose KGs instead of commonsense knowledge.
+
+Language models, e.g., BERT (Devlin et al., 2018), GPT (Radford et al., 2018), GPT-2/3 (Radford et al., 2019; Brown et al., 2020), ELMo (Peters et al., 2018), Transformer-XL (Dai et al., 2019), ALBERT (Lan et al., 2019), RoBERTa (Liu et al., 2019), XLNet (Yang et al., 2019) and MegatronLM (Shoeybi et al., 2019) contain factual knowledge obtained via pre-training on large-scale corpora such as Wikipedia and BookCorpus (Zhu et al., 2015). Studies have leveraged the pre-trained LMs as virtual KGs, and show reasonable performance in QA tasks (Dhingra et al., 2020; Guu et al., 2020), and language modeling (Khandelwal et al., 2019). LMs are further enhanced by KGs (Peters et al., $\boxed { 2 0 1 9 }$ to improve knowledge-driven tasks. While the existing work utilizes knowledge in an implicit way, the main difference is that our approach explicitly extracts knowledgeable facts from the LMs. Compare to the joint training with knowledge base to improve shallow word embedding (Wang et al., 2014), we show that the knowledge is already stored in the deep LMs. We plan to incorporate domain knowledge into language models to construct domain-specific KGs. The main difference between LAMA $\ [ \mathrm { P e t r o n i ~ e t ~ a l . } \ ] [ 2 0 1 9 ] [ 2 0 2 0 ]$ and MAMA is mainly two-fold: (1) LAMA aims to complete Cloze-style statement, e.g., given “Dylan is a ”, LAMA predicts which words/phrases should fill the blank “ ”, which has no direct connection to KGs. There are several fundamental limitations when adapting LAMA to construct KGs, e.g., additional queries must be constructed first, and the answers for the queries must be linked to KGs. MAMA aims to solve a reasoning problem, e.g., given a passage, MAMA directly matches the fact in the form of a triplet (Dylan, is, songwriter) at the first step, then maps the fact to produce a KG. (2) The benchmark datasets used with MAMA are larger compared to the LAMA benchmark, e.g., Wikidata is 3 orders of magnitude larger compared to the largest dataset in the LAMA benchmark.
+
+Neural network interpretation here specifically refers to pre-trained deep language model analysis. There has been a lot of work to understand what the neural networks learn (Linzen et al., 2016; Adi et al., 2016; Tenney et al., 2019). With regards to analyzing Transformer (Vaswani et al., 2017) based language models (e.g., BERT and GPT-3), substantial recent work focuses on both visualizing and analyzing the attention (Vig, 2019; Jain & Wallace, 2019; Clark et al., 2019; Michel et al., 2019; Vig et al., 2020; Ramsauer et al., 2020; Hendrycks et al., 2020). Instead of analyzing or visualizing, we use LMs to generate structured KGs to directly recover what LMs learn from the corpora.
+
+# 5 CONCLUSION
+
+We show that the knowledge graphs can be constructed by a single forward pass of the language models over textual corpora. We propose a two-stage unsupervised approach MAMA to first match the facts in the corpus with the internal knowledge of the language model, and then map the matched facts to produce a knowledge graph. We demonstrate the quality of the resultant open knowledge graphs by comparing to two knowledge graphs (Wikidata and TAC KBP). The open knowledge graph also features new facts in the open schema, which could have broad implications for knowledge graphs and their downstream applications. The results also suggest that larger language models store richer knowledge than existing knowledge graphs, and generating on even larger high-quality text corpora could continue improving knowledge graphs. Additionally, the knowledge graphs generated by our approach can help researchers to look into what the language models learn, so our interpretable knowledge graphs establish a bridge between the deep learning and knowledge graph communities.
+
+# REFERENCES
+
+Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. arXiv preprint arXiv:1608.04207, 2016.
+
+Gabor Angeli, Melvin Jose Johnson Premkumar, and Christopher D Manning. Leveraging linguistic structure for open domain information extraction. In ACL, pp. 344–354, 2015.
+
+Soren Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, and Zachary Ives. ¨ Dbpedia: A nucleus for a web of open data. In The semantic web, pp. 722–735. 2007.
+
+Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In SIGMOD, pp. 1247–1250, 2008.
+
+Antoine Bosselut, Hannah Rashkin, Maarten Sap, Chaitanya Malaviya, Asli Celikyilmaz, and Yejin Choi. Comet: Commonsense transformers for automatic knowledge graph construction. arXiv preprint arXiv:1906.05317, 2019.
+
+Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
+
+Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka Jr, and Tom M Mitchell. Toward an architecture for never-ending language learning. In AAAI, number 3, 2010.
+
+Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D Manning. What does bert look at? an analysis of bert’s attention. arXiv preprint arXiv:1906.04341, 2019.
+
+Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
+
+Joe Davison, Joshua Feldman, and Alexander M Rush. Commonsense knowledge mining from pretrained models. In EMNLP, pp. 1173–1178, 2019.
+
+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.
+
+Bhuwan Dhingra, Manzil Zaheer, Vidhisha Balachandran, Graham Neubig, Ruslan Salakhutdinov, and William W Cohen. Differentiable reasoning over a virtual knowledge base. arXiv preprint arXiv:2002.10640, 2020.
+
+Xin Dong, Evgeniy Gabrilovich, Geremy Heitz, Wilko Horn, Ni Lao, Kevin Murphy, Thomas Strohmann, Shaohua Sun, and Wei Zhang. Knowledge vault: A web-scale approach to probabilistic knowledge fusion. In KDD, pp. 601–610, 2014.
+
+Anthony Fader, Stephen Soderland, and Oren Etzioni. Identifying relations for open information extraction. In EMNLP, pp. 1535–1545, 2011.
+
+Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
+
+Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020.
+
+John Hewitt and Christopher D Manning. A structural probe for finding syntax in word representations. In NAACL, pp. 4129–4138, 2019.
+
+Johannes Hoffart, Fabian M Suchanek, Klaus Berberich, and Gerhard Weikum. Yago2: A spatially and temporally enhanced knowledge base from wikipedia. Artificial Intelligence, pp. 28–61, 2013.
+
+Sarthak Jain and Byron C Wallace. Attention is not explanation. arXiv preprint arXiv:1902.10186, 2019.
+
+Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor language models. arXiv preprint arXiv:1911.00172, 2019.
+
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
+
+Nikolaos Kolitsas, Octavian-Eugen Ganea, and Thomas Hofmann. End-to-end neural entity linking. arXiv preprint arXiv:1808.07699, 2018.
+
+Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. CoRR, abs/1909.11942, 2019.
+
+Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntaxsensitive dependencies. TACL, pp. 521–535, 2016.
+
+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.
+
+Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? In NIPS, pp. 14014–14024, 2019.
+
+Mike Mintz, Steven Bills, Rion Snow, and Dan Jurafsky. Distant supervision for relation extraction without labeled data. In ACL, pp. 1003–1011, 2009.
+
+Feng Niu, Ce Zhang, Christopher Re, and Jude Shavlik. Elementary: Large-scale knowledge-base ´ construction via machine learning and statistical inference. International Journal on Semantic Web and Information Systems (IJSWIS), 8(3):42–73, 2012.
+
+Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In 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.
+
+Matthew E Peters, Mark Neumann, Robert L Logan IV, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A Smith. Knowledge enhanced contextual word representations. arXiv preprint arXiv:1909.04164, 2019.
+
+Fabio Petroni, Tim Rocktaschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, ¨ and Sebastian Riedel. Language models as knowledge bases? arXiv preprint arXiv:1909.01066, 2019.
+
+Fabio Petroni, Patrick Lewis, Aleksandra Piktus, Tim Rocktaschel, Yuxiang Wu, Alexander H ¨ Miller, and Sebastian Riedel. How context affects language models’ factual predictions. arXiv preprint arXiv:2005.04611, 2020.
+
+Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
+
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, (8):9, 2019.
+
+Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. CoRR, abs/1910.10683, 2019.
+
+Hubert Ramsauer, Bernhard Schafl, Johannes Lehner, Philipp Seidl, Michael Widrich, Lukas Gru- ¨ ber, Markus Holzleitner, Milena Pavlovic, Geir Kjetil Sandve, Victor Greiff, et al. Hopfield ´ networks is all you need. arXiv preprint arXiv:2008.02217, 2020.
+
+Alexander Ratner, Stephen H Bach, Henry Ehrenberg, Jason Fries, Sen Wu, and Christopher Re.´ Snorkel: Rapid training data creation with weak supervision. In VLDB, volume 11, pp. 269, 2017.
+
+Michael Schmitz, Stephen Soderland, Robert Bart, Oren Etzioni, et al. Open language learning for information extraction. In EMNLP, pp. 523–534, 2012.
+
+Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv, pp. arXiv–1909, 2019.
+
+Valentin I Spitkovsky and Angel X Chang. A cross-lingual dictionary for english wikipedia concepts. 2012.
+
+Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. Yago: a core of semantic knowledge. In WWW, pp. 697–706, 2007.
+
+Mihai Surdeanu. Overview of the tac2013 knowledge base population evaluation: English slot filling and temporal slot filling. TAC, pp. 2, 2013.
+
+Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R Bowman, Dipanjan Das, et al. What do you learn from context? probing for sentence structure in contextualized word representations. arXiv preprint arXiv:1905.06316, 2019.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pp. 5998–6008, 2017.
+
+Jesse Vig. Visualizing attention in transformerbased language models. arXiv preprint arXiv:1904.02679, 2019.
+
+Jesse Vig, Ali Madani, Lav R Varshney, Caiming Xiong, Richard Socher, and Nazneen Fatema Rajani. Bertology meets biology: Interpreting attention in protein language models. arXiv preprint arXiv:2006.15222, 2020.
+
+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. arXiv preprint arXiv:1804.07461, 2018.
+
+Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems. In NIPS, pp. 3266–3280, 2019.
+
+Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph and text jointly embedding. In EMNLP, pp. 1591–1601, 2014.
+
+Wentao Wu, Hongsong Li, Haixun Wang, and Kenny Q Zhu. Probase: A probabilistic taxonomy for text understanding. In Proceedings of the 2012 ACM SIGMOD International Conference on Management of Data, pp. 481–492, 2012.
+
+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.
+
+Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In ICCV, pp. 19–27, 2015.
+
+# A ADDITIONAL DETAILS AND ANALYSIS OF MAMA
+
+# A.1 METHOD DETAILS
+
+Map stage details To evaluate the mapped facts, we first use Match stage of MAMA to run over the corresponding documents to generate the candidate facts. For Map stage on TAC KBP, we link to the oracle annotation of the entities or spans in the TAC KBP corpus. On Wikidata, the entity linking method described in $\mathrm { S e c . } [ \underline { { 2 . 2 . 1 } } ]$ is first leveraged to link entities in the candidate facts to Wikipedia anchors. We build an enhanced mention-to-entity dictionary based on Spitkovsky & Chang (2012). In particular, we add new Wikipedia anchors to the dictionary which results in 26 million entries comparing to 21 million entries in $\mathbf { \overline { { S p i t k o v s k y \ \& \ C h a n g } } } \mathbf { \bar { \Psi } } ( \mathbf { \bar { 2 0 i 2 } } )$ . Then a Wikipedia anchor to the Wikidata item dictionary is constructed and used to further link the entities to Wikidata. If the head or tail is a pronoun, we further use neuralcoref $^ { \cdot 4 }$ for coreference resolution. We use GloVe (Pennington et al., 2014) embedding for disambiguation. The relation mapping is constructed offline for TAC KBP and Wikidata respectively using the method in Sec. 2.2.1. Besides the automatic relation mapping method proposed in Angeli et al. (2015), we manually check whether the top relation phrases are true as described in Sec. 2.2.1. For relation mapping, we randomly sampled a hold-out dataset including 2,000 documents from the TAC KBP corpus and English Wikipedia for the relation mapping construction on TAC KBP and Wikidata respectively. For oracle facts in Wikidata, we only preserve those facts describing relations between entities that could be linked to corresponding Wikipedia anchors. We rule out facts of attributes about entities and facts of auxiliary relations (such as topic’s main category.P901) and finally results in 27,368,562 oracle facts.
+
+Implementation details For Wikidata, at Match stage, we randomly split the English Wikipedia data into 20 partitions, and map the data partitions to 20 distributed servers to run. Each server is configured with four Tesla K80 12Gs. We set the max sequence length to 256, and batch size as 32 for MAMA-BERTLARGE and 4 for MAMA-GPT- $2 _ { \mathrm { X L } }$ . We use implementations of pre-trained LMs in Transformers package 5. We use spaCy sentencizer 6 to segment the documents into sentences. MAMA-BERTLARGE takes approximately 48 hours, and MAMA-GPT- $2 _ { \mathrm { X L } }$ costs around 96 hours. The resulting candidate facts of Match stage from the 20 servers are then reduced a data server, where a MongoDB database is maintained to store the oracle Wikidata and entity linking results to enable the efficient Map stage. To produce the open KGs, Map stage takes around 18 hours. The setup is similar to TAC KBP. Match stage is done within 48 hours for all the settings. The batch sizes of MAMA-BERTBASE, MAMA-GPT-2, MAMA-GPT-2MEDIUM, MAMA-GPT- $2 _ { \mathrm { L } }$ ARGE are 64, 32, 16, 8 respectively.
+
+Parameter settings The parameter settings are shared across TAC KBP and Wikidata. All the choices are based on the parameter study in Sec. A.3. The beam size of Algorithm 1 is set to 6. The matching degree threshold of Constraint #1 (Sec. 2.1.2) is set to 0.005, and the number of distinct head-tail pairs of Constraint # $2 ( \mathrm { S e c } . 2 . 1 . 2 )$ is set to 10. To generate the attention weight matrix ${ \bf A } _ { s }$ of a sentence, we reduce the weights of every attention head in the last layer of pre-trained LMs using the mean operator.
+
+# A.2 ERROR ANALYSIS
+
+There is still significant room to improve MAMA. To further understand the shortage of MAMA, we conduct an error analysis of the errors in precision (i.e., incorrect facts returned by MAMA) of Table 2 and Table 3. We choose our best method MAMA-GPT- $2 _ { \mathrm { X L } }$ for the study. We sample 100 documents from the Wikidata dataset, and manually check the reasons for the errors. We find $3 3 . 1 \%$ of the errors are caused by incorrect entities, while the relation phrases are correct. The errors are due to the incorrect noun chunk detected by the spaCy 7. $1 8 . 3 \%$ of the errors are due to the missing relation mapping created in Sec. 2.2.1. Note that we find approximately $2 3 . 8 \%$ of the errors are actually correct facts that are new in the reference KGs. e.g., (Bob Dylan.Q392, residence.P551, Nashville.Q23197) (in Figure $\boxed { 1 6 }$ is not an existing fact in Wikidata, but it is a correct mapped fact based on our annotation. The rest errors made by MAMA-GPT- $2 _ { \mathrm { X L } }$ are incorrect relation phrases, such as uninformative relation phrases. We find similar errors are made by MAMA-GPT- $2 _ { \mathrm { X L } }$ on TAC KBP. Similar to Sec. 3.2, enhancing the entity detection, entity linker, relation mapping, and relation generation are helpful. We also plan to leverage lifelong learning (Carlson et al., $\boxed { 2 0 1 0 }$ to add true facts to the reference KGs to improve the evaluation.
+
+
+Figure 3: Parameter study with MAMA-BERTBASE on TAC KBP hold-out subset.
+
+# A.3 PARAMETER STUDY
+
+We study the effects of the parameters using MAMA-BERTBASE on TAC KBP. We randomly sample $20 \%$ of the oracle query entities as a hold-out dataset to tune the parameters, and use the best parameter setting achieved for both TAC KBP and Wikidata experiments. When studying the effect of a certain parameter, we keep the remaining parameters as default described in Sec. A.1. We use F1 to measure the effects.
+
+Effects of beam size Figure $3 ( \mathbf { a } )$ illustrates the effects of various beam sizes in Algorithm 1. We find that in general, the larger the beam size is, the better F1 the setting achieves. This is because that MAMA is able to reserve more potentially correct facts when more candidates are allowed in the Match stage. However, F1 improvement gradually becomes subtle, while the computation costs increase more significantly. For sake of the efficiency, we do not explore larger beam sizes. We set the beam size as 6.
+
+Effects of search constraints Figure 3(b) compares the effect of different thresholds of the matching degree of Constraint #1 in Sec. 2.1.2. We set the threshold as 0.005 since it achieves the best result. Note that the summed attention score is normalized by the length of the fact to penalize the cumbersome facts. The matching degree threshold is effective, which is mainly because of the knowledge contained in the self-attention matrix. The score in the attention matrix is representing the chance of the facts to be the true facts based on the stored knowledge. Figure $\boxed { 3 } ( \mathrm { c } )$ shows the impact of the number of distinct head-tail pairs in identifying common relations of Constraint #2 in Sec. 2.1.2. The best result is achieved when it equals 10. This shows that while MAMA mostly identifies frequent relations, it is also able to capture some rare relations for the open schema.
+
+Effects of attention weights Figure $\textcircled { 3 } ( \textcircled { \mathrm { d } } )$ shows the comparison between attention weights of the last layer and the mean of all layers. The attention weights of the last layer perform better. This is due to the attention weights in lower layers are low-level linguistic knowledge according to (Clark et al., 2019; Ramsauer et al., 2020), which are less relevant to the factual knowledge for the KG construction. Figure $\sum \limits _ { i = 1 } ^ { 3 ( \overline { { \mathbf { e } } } ) }$ compares the impact of different attention reduction, i.e., mean, max, over the attention heads of the last layer. We find the “mean” perform better. The reason is that the token often intensively attends to several specific tokens in the sequence (Michel et al., 2019), and the “mean” operator is more sensitive to such information.
+
+# B SAMPLES FROM MAMA ON TAC KBP
+
+# B.1 MAPPED FACTS
+
+We randomly sample 100 documents from TAC KBP corpus, then randomly sample sentences from those documents. The uncurated candidate facts and the corresponding mapped facts of the sampled sentences based on our best methods MAMA-BERTLARGE and MAMA-GPT- $2 _ { \mathrm { X L } }$ are shown in Figur e 4 and Figure 5 respectively. We also randomly sample several sentences in which MAMABERTLARGE differs from MAMA-GPT- $2 _ { \mathrm { X L } }$ in the resulting facts for comparison, which is illustrated in Figure $6 .$ In each table, “ID” represents the document ID of a sampled sentence in TAC KBP corpus. “Sentence” indicates the sampled sentence. “Candidate facts to mapped facts” column contains the candidate facts (on the left side of $^ { 6 6 } \to ^ { 5 9 }$ ) and their corresponding mapped facts (on the right side of $^ { 6 6 } \to ^ { 5 9 }$ ).
+
+# B.2 UNMAPPED FACTS
+
+We randomly sample 100 documents from TAC KBP corpus. From those documents, we show unmapped facts from the sampled sentences from those documents. We manually check the correctness of the unmapped facts according to $\mathrm { S e c . } \big [ 3 . 2 \big ]$ and show the correct ones. The original candidate facts with the corresponding unmapped facts of the sampled sentences generated by MAMABERTLARGE and MAMA-GPT- $2 _ { \mathrm { X L } }$ are shown in Figure 7 and Figure 8. A further comparison of the unmapped candidate facts is illustrated in Figure 9. In each table, “ID” represents the document ID of a sampled sentence in TAC KBP corpus. “Sentence” indicates the sampled sentence. “Candidate facts to unmapped facts” column contains the candidate facts (on the left side of $^ { 6 6 } \to ^ { 5 9 }$ ) and their corresponding unmapped facts (on the right side of $\ddot { \cdot } \xrightarrow { } \dot { \mathbf { \rho } }$ ).
+
+# C SAMPLES FROM MAMA ON WIKIDATA
+
+# C.1 MAPPED FACTS
+
+Similar to TAC KBP, we randomly sample 100 documents from the Wikidata corpus (i.e., English Wikipedia), then randomly sample sentences from those documents. The uncurated candidate facts and the corresponding mapped facts of the sampled sentences based on our best methods MAMABERTLARGE and MAMA-GPT- $2 _ { \mathrm { X L } }$ are shown in Figure $1 0$ and Figure $\boxed { 1 1 }$ respectively. We also randomly sample several sentences in which MAMA-BERTLARGE differs from MAMA-GPT- $2 _ { \mathrm { X L } }$ in the resulting facts for comparison, which is illustrated in Figure $\boxed { 1 2 }$ In each table, “ID” represents the Wikipedia page’s title of a sampled sentence. “Sentence” indicates the sampled sentence. “Candidate facts to mapped facts” column contains the candidate facts (on the left side of $^ { 6 6 } \to ^ { 5 9 }$ ) and their corresponding mapped facts (on the right side of $^ { 6 6 } \to ^ { 5 9 }$ ).
+
+# C.2 UNMAPPED FACTS
+
+Similar to TAC KBP, we randomly sample 100 documents from the Wikidata corpus. From those documents, we show unmapped facts from several sampled sentences from those documents. We manually check the correctness of the unmapped facts according to Sec. $\boxed { 3 . 2 }$ and show the correct ones. The original candidate facts with the corresponding unmapped facts of the sampled sentences generated by MAMA-BERTLARGE and MAMA-GPT- $2 _ { \mathrm { X L } }$ are shown in Figure 13 and Figure 14. A further comparison of the unmapped candidate facts is illustrated in Figure 15. In each table, “ID” represents the Wikipedia page’s title of a sampled sentence. “Sentence” indicates the sampled sentence. “Candidate facts to unmapped facts” column contains the candidate facts (on the left side of $^ { 6 6 } \to ^ { 5 9 }$ ) and their corresponding unmapped facts (on the right side of $^ { 6 6 } \to ^ { 5 9 }$ ).
+
+# D ADDITIONAL OPEN KG SUBGRAPHS FROM MAMA ON WIKIDATA
+
+We sample several documents from the Wikidata corpus. We visualize the mapped facts and unmapped facts from those documents as examples of subgraphs in the resulting open KGs. We show the snapshots of the subgraphs generated by MAMA-BERTLARGE from Figure 16 to Figure 24. We similarly illustrate the snapshots of the subgraphs constructed by MAMA-GPT- $2 _ { \mathrm { X L } }$ from Figure 25 to Figure $\boxed { 3 2 }$ In each figure, the blue node and arrow represent the mapped facts in the Wikidata schema, while the yellow node and arrow denote the unmapped facts in the open schema. We additionally visualize the correct facts that are new in Wikidata according to Sec. A.2 in yellow.
+
+
+Figure 4: Mapped facts: MAMA-BERTLARGE on TAC KBP.
+
+
+Figure 5: Mapped facts: MAMA-GPT- $2 \mathrm { x L }$ on TAC KBP.
+
+
+Figure 6: Mapped facts: MAMA-BERTLARGE vs. MAMA-GPT- $2 _ { \mathrm { X L } }$ on TAC KBP.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 14: Unmapped facts: MAMA-GPT- $2 \mathrm { x L }$ on Wikidata.
+
+
+Figure 15: Unmapped facts: MAMA-BERTLARGE vs. MAMA-GPT- $2 _ { \mathrm { X L } }$ on Wikidata.
+
+
+Figure 16: A snapshot subgraph of the open KG generated by MAMA using BERTLARGE from Wikipedia pages neighboring “Bob Dylan”. The blue node and arrow represent the mapped facts in the Wikidata schema, while the yellow node and arrow denote the unmapped facts in the open schema. We also visualize the correct facts that are new in Wikidata in yellow.
+
+
+Figure 17: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Douglas Bader”.
+
+
+Figure 18: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Helen Storrow”.
+
+
+Figure 19: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Jacob van Ruisdael”.
+
+
+Figure 20: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “John Maynard Keynes”.
+
+
+Figure 21: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Liaquat Ali Khan”.
+
+
+Figure 22: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Neville Southall”.
+
+
+Figure 23: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Pauline Baynes”.
+
+
+Figure 24: A snapshot subgraph of the open KG generated by MAMA-BERTLARGE from the Wikipedia page “Thor Heyerdahl’.
+
+
+Figure 25: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 \mathrm { x L }$ from the Wikipedia page “Douglas Bader”.
+
+
+Figure 26: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 _ { \mathrm { X L } }$ from the Wikipedia page “Helen Storrow”.
+
+
+Figure 27: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 _ { \mathrm { X L } }$ from the Wikipedia page “Jacob van Ruisdael”.
+
+
+Figure 28: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 _ { \mathrm { X L } }$ from the Wikipedia page “John Maynard Keynes”.
+
+
+Figure 29: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 _ { \mathrm { X L } }$ from the Wikipedia page “Liaquat Ali Khan”.
+
+
+Figure 30: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 \mathrm { x L }$ from the Wikipedia page “Neville Southall”.
+
+
+Figure 31: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 _ { \mathrm { X L } }$ from the Wikipedia page “Pauline Baynes”.
+
+
+Figure 32: A snapshot subgraph of the open KG generated by MAMA-GPT- $2 \mathrm { x L }$ from the Wikipedia page “Thor Heyerdahl”.
+
+
+
+
+
+#
+
+
+
+
+
+#
+
+
+
+
+
+#
+
+#
+
+
+
+
+
+#
+
+#
+
+
+
+#
\ No newline at end of file
diff --git a/md/train/bhCDO_cEGCz/bhCDO_cEGCz.md b/md/train/bhCDO_cEGCz/bhCDO_cEGCz.md
new file mode 100644
index 0000000000000000000000000000000000000000..1b6eb2116dfe662e18dec3b1bfeff8d0bea39f0a
--- /dev/null
+++ b/md/train/bhCDO_cEGCz/bhCDO_cEGCz.md
@@ -0,0 +1,456 @@
+# GROUNDING PHYSICAL CONCEPTS OF OBJECTS AND EVENTS THROUGH DYNAMIC VISUAL REASONING
+
+Zhenfang Chen The University of Hong Kong
+
+Jiayuan Mao MIT CSAIL
+
+Jiajun Wu Stanford University
+
+Kwan-Yee K. Wong The University of Hong Kong
+
+Joshua B. Tenenbaum MIT BCS, CBMM, CSAIL
+
+Chuang Gan MIT-IBM Watson AI Lab
+
+# ABSTRACT
+
+We study the problem of dynamic visual reasoning on raw videos. This is a challenging problem; currently, state-of-the-art models often require dense supervision on physical object properties and events from simulation, which are impractical to obtain in real life. In this paper, we present the Dynamic Concept Learner (DCL), a unified framework that grounds physical objects and events from dynamic scenes and language. DCL first adopts a trajectory extractor to track each object over time and to represent it as a latent, object-centric feature vector. Building upon this object-centric representation, DCL learns to approximate the dynamic interaction among objects using graph networks. DCL further incorporates a semantic parser to parse question into semantic programs and, finally, a program executor to run the program to answer the question, levering the learned dynamics model. After training, DCL can detect and associate objects across the frames, ground visual properties and physical events, understand the causal relationship between events, make future and counterfactual predictions, and leverage these extracted presentations for answering queries. DCL achieves state-of-the-art performance on CLEVRER, a challenging causal video reasoning dataset, even without using ground-truth attributes and collision labels from simulations for training. We further test DCL on a newly proposed video-retrieval and event localization dataset derived from CLEVRER, showing its strong generalization capacity.
+
+# 1 INTRODUCTION
+
+Visual reasoning in dynamic scenes involves both the understanding of compositional properties, relationships, and events of objects, and the inference and prediction of their temporal and causal structures. As depicted in Fig. 1, to answer the question “What will happen next?” based on the observed video frames, one needs to detect the object trajectories, predict their dynamics, analyze the temporal structures, and ground visual objects and events to get the answer “The blue sphere and the yellow object collide”.
+
+Recently, various end-to-end neural network-based approaches have been proposed for joint understanding of video and language (Lei et al., 2018; Fan et al., 2019). While these methods have shown great success in learning to recognize visually complex concepts, such as human activities $\mathrm { { X u } }$ et al., 2017; Ye et al., 2017), they typically fail on benchmarks that require the understanding of compositional and causal structures in the videos and text (Yi et al., 2020). Another line of research has been focusing on building modular neural networks that can represent the compositional structures in scenes and questions, such as object-centric scene structures and multi-hop reasoning (Andreas et al., 2016; Johnson et al., 2017b; Hudson & Manning, 2019). However, these methods are designed for static images and do not handle the temporal and causal structure in dynamic scenes well, leading to inferior performance on video causal reasoning benchmark CLEVRER (Yi et al., 2020).
+
+To model the temporal and causal structures in dynamic scenes, Yi et al. (2020) proposed an oracle model to combine symbolic representation with video dynamics modeling and achieved state-ofthe-art performance on CLEVRER. However, this model requires videos with dense annotations for visual attributes and physical events, which are impractical or extremely labor-intensive in real scenes.
+
+
+Question: What will happen next? Answer: The blue sphere and the yellow object collide.
+Figure 1: The process to handle visual reasoning in dynamic scenes. The trajectories of the target blue and yellow spheres are marked by the sequences of bounding boxes. Object attributes of the blue sphere and yellow sphere and the collision event are marked by blue, yellow and purple colors. Stroboscopic imaging is applied for motion visualization.
+
+We argue that such dense explicit video annotations are unnecessary for video reasoning, since they are naturally encoded in the question answer pairs associated with the videos. For example, the question answer pair and the video in Fig. 1 can implicitly inform a model what the concepts “sphere”, “blue”, “yellow” and “collide” really mean. However, a video may contain multiple fast-moving occluded objects and complex object interactions, and the questions and answers have diverse forms. It remains an open and challenging problem to simultaneously represent objects over time, train an accurate dynamic model from raw videos, and align objects with visual properties and events for accurate temporal and causal reasoning, using vision and language as the only supervision.
+
+Our main ideas are to factorize video perception and reasoning into several modules: object tracking, object and event concept grounding, and dynamics prediction. We first detect objects in the video, associating them into object tracks across the frames. We can then ground various object and event concepts from language, train a dynamic model on top of object tracks for future and counterfactual predictions, analyze relationships between events, and answer queries based on these extracted representations. All these modules can be trained jointly by watching videos and reading paired questions and answers.
+
+To achieve this goal, we introduce Dynamic Concept Learner (DCL), a unified neural-symbolic framework for recognizing objects and events in videos and analyzing their temporal and causal structures, without explicit annotations on visual attributes and physical events such as collisions during training. To facilitate model training, a multi-step training paradigm has been proposed. We first run an object detector on individual frames and associate objects across frames based on a motion-based correspondence. Next, our model learns concepts about object properties, relationships, and events by reading paired questions and answers that describe or explain the events in the video. Then, we leverage the acquired visual concepts in the previous steps to refine the object association across frames. Finally, we train a dynamics prediction network (Li et al., 2019b) based on the refined object trajectories and optimize it jointly with other learning parts in this unified framework. Such a training paradigm ensures that all neural modules share the same latent space for representing concepts and they can bootstrap the learning of each other.
+
+We evaluate DCL’s performance on CLEVRER, a video reasoning benchmark that includes descriptive, explanatory, predictive, and counterfactual reasoning with a uniform language interface. DCL achieves state-of-the-art performance on all question categories and requires no scene supervision such as object properties and collision events. To further examine the grounding accuracy and transferability of the acquired concepts, we introduce two new benchmarks for video-text retrieval and spatial-temporal grounding and localization on the CLEVRER videos, namely CLEVRERRetrieval and CLEVRER-Grounding. Without any further training, our model generalizes well to these benchmarks, surpassing the baseline by a noticeable margin.
+
+# 2 RELATED WORK
+
+Our work is related to reasoning and answering questions about visual content. Early studies like (Wu et al., 2016; Zhu et al., 2016; Gan et al., 2017) typically adopted monolithic network architectures and mainly focused on visual understanding. To perform deeper visual reasoning, neural module networks were extensively studied in recent works (Johnson et al., 2017a; Hu et al., 2018; Hudson & Manning, 2018; Amizadeh et al., 2020), where they represent symbolic operations with small neural networks and perform multi-hop reasoning. Some previous research has also attempted to learn visual concepts through visual question answering (Mao et al., 2019). However, it mainly focused on learning static concepts in images, while our DCL aims at learning dynamic concepts like moving and collision in videos and at making use of these concepts for temporal and causal reasoning.
+
+
+Figure 2: DCL’s architecture for counterfactual questions during inference. Given an input video and its corresponding question and choice, we first use a program parser to parse the question and the choice into executable programs. We adopt an object trajectory detector to detect trajectories of all objects. Then, the extracted objects are sent to a dynamic predictor to predict their dynamics. Next, the extracted objects are sent to the feature extractor to extract latent representations for objects and events. Finally, we feed the parsed programs and latent representation to the symbolic executor to answer the question and optimize concept learning.
+
+Later, visual reasoning was extended to more complex dynamic videos (Lei et al., 2018; Fan et al., 2019; Li et al., 2020; 2019a; Huang et al., 2020). Recently, Yi et al. (2020) proposed CLEVRER, a new video reasoning benchmark for evaluating computational models’ comprehension of the causal structure behind physical object interaction. They also developed an oracle model, combining the neuro-symbolic visual question-answering model (Yi et al., 2018) with the dynamics prediction model (Li et al., 2019b), showing competitive performance. However, this model requires explicit labels for object attributes, masks, and spatio-temporal localization of events during training. Instead, our DCL has no reliance on any labels for objects and events and can learn these concepts through natural supervision (i.e., videos and question-answer pairs).
+
+Our work is also related to temporal and relational reasoning in videos via neural networks (Wang & Gupta, 2018; Materzynska et al., 2020; Ji et al., 2020). These works typically rely on specific action annotations, while our DCL learns to ground object and event concepts and analyze their temporal relations through question answering. Recently, various benchmarks (Riochet et al., 2018; Bakhtin et al., 2019; Girdhar & Ramanan, 2020; Baradel et al., 2020; Gan et al., 2020) have been proposed to study dynamics and reasoning in physical scenes. However, these datasets mainly target at pure video understanding and do not contain natural language question answering. Much research has been studying dynamic modeling for physical scenes (Lerer et al., 2016; Battaglia et al., 2013; Mottaghi et al., 2016; Finn et al., 2016; Shao et al., 2014; Fire & Zhu, 2015; Ye et al., 2018; Li et al., 2019b). We adopt PropNet (Li et al., 2019b) for dynamics prediction and feed the predicted scenes to the video feature extractor and the neuro-symbolic executor for event prediction and question answering.
+
+While many works (Zhou et al., 2019; 2018; Gan et al., 2015) have been studying on the problems of understanding human actions and activities (e.g., running, cooking, cleaning) in videos, our work’s primary goal is to design a unified framework for learning physical object and event concepts (e.g., collision, falling, stability). These tasks are of great importance in practical applications such as industrial robot manipulation which requires AI systems with human-like physical common sense.
+
+# 3 DYNAMIC CONCEPT LEARNER
+
+In this section, we introduce a new video reasoning model, Dynamic Concept Learner (DCL), which learns to recognize video attributes, events, and dynamics and to analyze their temporal and causal structures, all through watching videos and answering corresponding questions. DCL contains five modules, 1) an object trajectory detector, 2) video feature extractor, 3) a dynamic predictor, 4) a language program parser, and 5) a neural symbolic executor. As shown in Fig. 2, given an input video, the trajectory detector detects objects in each frame and associates them into trajectories; the feature extractor then represents them as latent feature vectors. After that, DCL quantizes the objects’ static concepts (i.e., color, shape, and material) by matching the latent object features with the corresponding concept embeddings in the executor. As these static concepts are motion-independent, they can be adopted as an additional criteria to refine the object trajectories. Based on the refined trajectories, the dynamics predictor predicts the objects’ movement and interactions in future and counterfactual scenes. The language parser parses the question and choices into functional programs, which are executed by the program executor on the latent representation space to get answers.
+
+The object and event concept embeddings and the object-centric representation share the same latent space; answering questions associated with videos can directly optimize them through backpropagation. The object trajectories and dynamics can be refined by the object static attributes predicted by DCL. Our framework enjoys the advantages of both transparency and efficiency, since it enables step-by-step investigations of the whole reasoning process and has no requirements for explicit annotations of visual attributes, events, and object masks.
+
+# 3.1 MODEL DETAILS
+
+Object Detection and Tracking. Given a video, the object trajectory detector detects object proposals in each frame and connects them into object trajectories $O \doteq \{ o ^ { n } \} _ { n = 1 } ^ { N }$ n}Nn=1, where on $o ^ { n } =$ $\{ b _ { t } ^ { n } \} _ { t = 1 } ^ { T }$ and $N$ is the number of objects in the video. $b _ { t } = [ x _ { t } ^ { n } , y _ { t } ^ { n } , w _ { t } ^ { n } , h _ { t } ^ { n } ]$ is an object proposal at frame $t$ and $T$ is the frame number, where $( x _ { t } ^ { n } , y _ { t } ^ { n } )$ denotes the normalized proposal coordinate center and $w _ { t } ^ { n }$ and $h _ { t } ^ { n }$ denote the normalized width and height, respectively.
+
+The object detector first uses a pre-trained region proposal network (Ren et al., 2015) to generate object proposals in all frames, which are further linked across connective frames to get all objects’ trajectories. Let $\{ b _ { t } ^ { i } \} _ { i = 1 } ^ { N }$ and $\{ b _ { t + 1 } ^ { j } \} _ { j = 1 } ^ { N }$ to be two sets of proposals in two connective frames. Inspired by Gkioxari & Malik (2015), we define a connection score $s _ { l }$ between $b _ { t } ^ { i }$ and $b _ { t + 1 } ^ { j }$ to be
+
+$$
+s _ { l } ( b _ { t } ^ { i } , b _ { t + 1 } ^ { j } ) = s _ { c } ( b _ { t } ^ { i } ) + s _ { c } ( b _ { t + 1 } ^ { j } ) + \lambda _ { 1 } \cdot I o U ( b _ { t } ^ { i } , b _ { t + 1 } ^ { j } ) ,
+$$
+
+where $s _ { c } ( b _ { t } ^ { i } )$ is the confidence score of the proposal $b _ { t } ^ { i }$ , $I o U$ is the intersection over union and $\lambda _ { 1 }$ is a scalar. Gkioxari $\&$ Malik (2015) adopts a greedy algorithm to connect the proposals without global optimization. Instead, we assign boxes $\{ b _ { t + 1 } ^ { j } \} _ { j = 1 } ^ { N }$ at the $t + 1$ frame to $\{ b _ { t } ^ { i } \} _ { i = 1 } ^ { N }$ by a linear sum assignment.
+
+Video Feature Extraction. Given an input video and its detected object trajectories, we extract three kinds of latent features for grounding object and event concepts. It includes 1) the average visual feature $f ^ { v } \in \mathbb { R } ^ { N \times D _ { 1 } }$ for static attribute prediction, 2) temporal sequence feature $\bar { f } ^ { s } \in \mathbb { R } ^ { N \times \breve { 4 } T }$ for dynamic attribute and unary event prediction, and 3) interactive feature $f ^ { c } \in \mathbb { R } ^ { K \times N \times N \times D _ { 2 } }$ for collision event prediction, where $D _ { 1 }$ and $D _ { 2 }$ denote dimensions of the features and $K$ is the number of sampled frames. We give more details on how to extract these features in Appendix B.
+
+Grounding Object and Event Concepts. Video Reasoning requires a model to ground object and event concepts in videos. DCL achieves this by matching object and event representation with object and event embeddings in the symbolic executor. Specifically, DCL calculates the confidence score that the $n$ -th object is moving by $\left[ \cos ( s ^ { \mathrm { m o v i n g } } , m _ { d a } ( f _ { n } ^ { s } ) ) - \stackrel { . } { \delta } \right] / \lambda .$ , where $f _ { n } ^ { s }$ denotes the temporal sequence feature for the $n$ -th object, $s ^ { \mathrm { m o v i n g } }$ denotes a vector embedding for concept moving, and $m _ { d a }$ denotes a linear transformation, mapping $f _ { n } ^ { s }$ into the dynamic concept representation space. $\delta$ and $\lambda$ are the shifting and scaling scalars, and $\cos ( )$ calculates the cosine similarity between two vectors. DCL grounds static attributes and the collision event similarly, matching average visual features and interactive features with their corresponding concept embeddings in the latent space. We give more details on the concept and event quantization in Appendix E.
+
+Trajectory Refinement. The connection score in Eq. 1 ensures the continuity of the detected object trajectories. However, it does not consider the objects’ visual appearance; therefore, it may fail to track the objects and may connect inconsistent objects when different objects are close to each other and moving rapidly. To detect better object trajectories and to ensure the consistency of visual appearance along the track, we add a new term to Eq. 1 and re-define the connection score to be
+
+$$
+s _ { l } ( \{ b _ { m } ^ { i } \} _ { m = 0 } ^ { t } , b _ { t + 1 } ^ { j } ) = s _ { c } ( b _ { t } ^ { i } ) + s _ { c } ( b _ { t + 1 } ^ { j } ) + \lambda _ { 1 } \cdot I o U ( b _ { t } ^ { i } , b _ { t + 1 } ^ { j } ) + \lambda _ { 2 } \cdot f _ { \mathrm { a p p e a r } } ( \{ b _ { m } ^ { i } \} _ { m = 0 } ^ { t } , b _ { t + 1 } ^ { j } ) ,
+$$
+
+where $f _ { \mathrm { a p p e a r } } \big ( \{ b _ { m } ^ { i } \} _ { m = 0 } ^ { t } , b _ { t + 1 } ^ { j } \big )$ measures the attribute similarity between the newly added proposal $b _ { t + 1 } ^ { j }$ and all proposals $( \{ b _ { m } ^ { i } \} _ { m = 0 } ^ { t }$ in previous frames. We define $f _ { \mathrm { a p p e a r } }$ as
+
+$$
+f _ { \mathrm { a p p e a r } } \bigl ( \bigl \{ b _ { m } ^ { i } \bigr \} _ { m = 0 } ^ { t } , b _ { t + 1 } ^ { j } \bigr ) = \frac { 1 } { 3 \times t } \sum _ { a t t r } \sum _ { m = 0 } ^ { t } f _ { \mathrm { a t t r } } \bigl ( b _ { m } ^ { i } , b _ { t + 1 } ^ { j } \bigr ) ,
+$$
+
+where attr $\in \{ \mathrm { c o l o r }$ , material, shape}. $f _ { \mathrm { a t t r } } ( \boldsymbol { b } _ { m } , \boldsymbol { b } _ { t + 1 } )$ equals to 1 when $b _ { m } ^ { i }$ and $b _ { t + 1 } ^ { j }$ have the same attribute, and 0 otherwise. In Eq. 2, $f _ { \mathrm { a p p e a r } }$ ensures that the detected trajectories have consistent visual appearance and helps to distinguish the correct object when different objects are close to each other in the same frame. These additional static attributes, including color, material, and shape, are extracted without explicit annotation during training. Specifically, we quantize the attributes by choosing the concept whose concept embedding has the best cosine similarity with the object feature. We iteratively connect proposals at the $t + 1$ frame to proposals at the $t$ frame and get a set of object trajectories $O = \{ o ^ { \bar { n } } \} _ { n = 1 } ^ { \bar { N } }$ , where $o ^ { n } = \{ b _ { t } ^ { n } \} _ { t = 1 } ^ { T }$ .
+
+Dynamic Prediction. Given an input video and the refined trajectories of objects, we predict the locations and RGB patches of the objects in future or counterfactual scenes with a Propagation Network (Li et al., 2019b). We then generate the predicted scenes by pasting RGB patches into the predicted locations. The generated scenes are fed to the feature extractor to extract the corresponding features. Such a design enables the question answer pairs associated with the predicted scenes to optimize the concept embeddings and requires no explicit labels for collision prediction, leading to better optimization. This is different from Yi et al. (2020), which requires dense collision event labels to train a collision classifier.
+
+To predict the locations and RGB patches, the dynamic predictor maintains a directed graph $\left. V , D \right. =$ $\left. \{ v _ { n } \} _ { n = 1 } ^ { N } , \{ d _ { n _ { 1 } , n _ { 2 } } \} _ { n _ { 1 } = 1 , n _ { 2 } = 1 } ^ { N , N } \right.$ . The $n$ -th vertex $v _ { n }$ is represented by a concatenation of tuple $\langle b _ { t } ^ { n } , p _ { t } ^ { n } \rangle$ over a small time window $w$ , where $b _ { t } ^ { n } = [ x _ { t } ^ { n } , y _ { t } ^ { n } , w _ { t } ^ { n } , h _ { t } ^ { n } ]$ is the $n$ -th object’s normalized coordinates and $p _ { t } ^ { n }$ is a cropped RGB patch centering at $( x _ { t } ^ { n } , y _ { t } ^ { n } )$ . The edge $d _ { n _ { 1 } , n _ { 2 } }$ denotes the relation between the $n _ { 1 }$ -th and $n _ { 2 }$ -th objects and is represented by the concatenation of the normalized coordinate difference $b _ { t } ^ { n _ { 1 } } - b _ { t } ^ { n _ { 2 } }$ . The dynamic predictor performs multi-step message passing to simulate instantaneous propagation effects.
+
+During inference, the dynamics predictor predicts the locations and patches at frame $k + 1$ using the features of the last $w$ observed frames in the original video. We get the predictions at frame $k + 2$ by autoregressively feeding the predicted results at frame $k + 1$ as the input to the predictor. To get the counterfactual scenes where the $n$ -th object is removed, we remove the $n$ -th vertex and its associated edges from thnormalized coordinates $\{ \hat { b } _ { k ^ { \prime } } ^ { n } \} _ { n = 1 , k ^ { \prime } = 1 } ^ { N , K ^ { \prime } ^ { - } }$ ict counterfactual and RGB patches $\{ \hat { p } _ { k ^ { \prime } } ^ { n } \} _ { n = 1 , k ^ { \prime } = 1 } ^ { N , K }$ tively, we get that all predicted $K ^ { \prime }$ redictedframes. We give more details on the dynamic predictor at Appendix C.
+
+Language Program Parsing. The language program parser aims to translate the questions and choices into executable symbolic programs. Each executable program consists of a series of operations like selecting objects with certain properties, filtering events happening at a specific moment, finding the causes of an event, and eventually enabling transparent and step-by-step visual reasoning. Moreover, these operations are compositional and can be combined to represent questions with various compositionality and complexity. We adopt a seq2seq model (Bahdanau et al., 2015) with an attention mechanism to translate word sequences into a set of symbolic programs and treat questions and choices, separately. We give detailed implementation of the program parser in Appendix D.
+
+Symbolic Execution. Given a parsed program, the symbolic executor explicitly runs it on the latent features extracted from the observed and predicted scenes to answer the question. The executor consists of a series of functional modules to realize the operators in symbolic programs. The last operator’s output is the answer to the question. Similar to Mao et al. (2019), we represent all object states, events, and results of all operators in a probabilistic manner during training. This makes the whole execution process differential w.r.t. the latent representations from the observed and predicted scenes. It enables the optimization of the feature extractor and concept embeddings in the symbolic executor. We provide the implementation of all the operators in Appendix E.
+
+# 3.2 TRAINING AND INFERENCE
+
+Training. We follow a multi-step training paradigm to optimize the model: 1) We first extract object trajectories with the scoring function in Eq. 1 and optimize the video feature extractor and concept embeddings in the symbolic executor with only descriptive and explanatory questions; 2) We quantize the static attributes for all objects with the feature extractor and the concept embeddings learned in Step 1) and refine object trajectories with the scoring function Eq. 2; 3) Based on the refined trajectories, we train the dynamic predictor and predict dynamics for future and counterfactual scenes; 4) We train the full DCL with all the question answer pairs and get the final model. The program executor is fully differentiable w.r.t. the feature extractor and concept embeddings. We use cross-entropy loss to supervise open-ended questions and use mean square error loss to supervise counting questions. We provide specific loss functions for each module in Appendix H.
+
+
Methods
Extra Labels, Attr. Prog.
Descriptive
Explanatory
Predictive
Counterfactual
per opt. per ques. per opt. per ques. per opt. per ques.
CNN+MLP CNN+LSTM Memory HCRN
No
No
48.4 51.8 54.7 55.7
54.9 62.0 53.7 63.3
18.3 17.5 13.9 21.0
50.5 57.9 50.0 54.1
13.2 31.6 33.1. 21.0
55.2 61.2 54.2 57.1
9.0 14.7 7.0 11.5
TVQA+ MAC (V+)
Yes
No
72.0 86.4
63.3 70.5
23.7 22.3
70.3 59.7
48.9 42.9
53.9 63.5
4.1 25.1
IEP (V) TbD-net (V) DCL (Ours)
No
Yes
52.8 79.5 90.7
52.6 61.6 89.6
14.5 3.8 82.8
50.0 50.3 90.5
9.7 6.5 82.0
53.4 56.1 80.4
3.8 4.4 46.5
NS-DR NS-DR (NE) DCL-Oracle (Ours)
Yes
Yes
88.1 85.8 91.4
87.6 85.9 89.8
79.6 74.3 82.0
82.9 75.4 90.6
68.7 54.1 82.1
74.1 76.1 80.7
42.4 42.0 46.9
+
+Table 1: Question-answering accuracy on CLEVRER. The first and the second parts of the table show the models without and with visual attribute and event labels during training, respectively. Best performance is highlighted in boldface. DCL and DCL-Oracle denote our models trained without and with labels of visual attributes and events, respectively.
+
+Inference. During inference, given an input video and a question, we first detect the object trajectories and predict their motions and interactions in future and counterfactual scenes. We then extract object and event features for both the observed and predicted scenes with the feature extractor. We parse the questions and choices into executable symbolic programs. We finally execute the programs on the latent feature space and get the answer to the question.
+
+# 4 EXPERIMENTS
+
+To show the proposed DCL’s advantages, we conduct extensive experiments on the video reasoning benchmark CLEVRER. Existing other video datasets either ask questions about the complex visual context (Tapaswi et al., 2016; Lei et al., 2018) or study dynamics and reasoning without question answering (Girdhar & Ramanan, 2020; Baradel et al., 2020). Thus, they are unsuitable for evaluating video causal reasoning and learning object and event concepts through question answering. We first show its strong performance on video causal reasoning. Then, we show DCL’s ability on concept learning, predicting object visual attributes and events happening in videos. We show DCL’s generalization capacity to new applications, including CLEVRER-Grounding and CLEVRERRetrieval. We finally extend DCL to a real block tower video dataset (Lerer et al., 2016).
+
+# 4.1 IMPLEMENTATION DETAILS
+
+Following the experimental setting in Yi et al. (2020), we train the language program parser with 1000 programs for all question types. We train all our models without attribute and event labels. Our models for video question answering are trained on the training set, tuned on the validation set, and evaluated in the test set. To show DCL’s generalization capacity, we build CLEVRER-Grounding and CLEVRER-Retrieval datasets from the original CLEVRER videos and their associated video annotations. We provide more implementation details in Appendix A.
+
+# 4.2 COMPARISONS ON TEMPORAL AND CAUSAL REASONING
+
+We compare our DCL with previous methods on CLEVRER, including Memory (Fan et al., 2019), IEP (Johnson et al., 2017b), TbD-net (Mascharka et al., 2018), TVQA $^ +$ (Lei et al., 2018), NS
+
+
Methods
Static Attributes
Dynamic Attributes
Events
Color
Shape
Material
Moving
Stationary
In
Out
Collision
DCL
99.7
99.2
99.6
89.7
93.3
99.2
98.9
96.9
+
+Table 2: Evaluation of video concept learning on the validation set.
+
+DR (Yi et al., 2020), MAC (V) (Hudson & Manning, 2018) and its attribute-aware variant, MAC $\mathbf { \left( V + \right) }$ . We refer interested readers to CLEVRER (Yi et al., 2020) for more details. Additionally, we also include a recent state-of-the-art VQA model HCRN (Le et al., 2020) for performance comparison, which adopts a conditional relation network for representation and reasoning over videos. To provide more extensive analysis, we introduce DCL-Oracle by adding object attribute and collision supervisions into DCL’s training. We summarize their requirement for visual labels and language programs in the second and third columns of Table 1.
+
+According to the results in Table 1, we have the following observations. Although HCRN achieves state-of-the-art performance on human-centric action datasets (Jang et al., 2017; Xu et al., 2017; 2016), it only performs slightly better than Memory and much worse than NS-DR on CLEVRER. We believe the reason is that HCRN mainly focuses on motion modeling across frames while CLEVRER requires models to perform dynamic visual reasoning on videos and analyze its temporal and causal structures. NS-DR performs best among all the baseline models, showing the power of combining symbolic representation with dynamics modeling. Our model achieves the state-of-the-art question answering performance on all kinds of questions even without visual attributes and event labels from simulations during training, showing its effectiveness and label-efficiency. Compared with NS-DR, our model achieves more significant gains on predictive and counterfactual questions than that on the descriptive questions. This shows DCL’s effectiveness in modeling for temporal and causal reasoning. Unlike NS-DR, which directly predicts collision event labels with its dynamic model, DCL quantizes concepts and executes symbolic programs in an end-to-end training manner, leading to better predictions for dynamic concepts. DCL-Oracle shows the upper-bound performance of the proposed model to ground physical object and event concepts through question answering.
+
+# 4.3 EVALUATION OF OBJECT AND EVENT CONCEPT GROUNDING IN VIDEOS
+
+Previous methods like MAC (V) and TbD-net (V) did not learn explicit concepts during training, and NS-DR required intrinsic attribute and event labels as input. Instead, DCL can directly quantize video concepts, including static visual attributes (i.e. color, shape, and material), dynamic attributes (i.e. moving and stationary) and events (i.e. in, out, and collision). Specifically, DCL quantizes the concepts by mapping the latent object features into the concept space by linear transformation and calculating their cosine similarities with the concept embeddings in the neural-symbolic executor.
+
+We predict the static attributes of each object by averaging the visual object features at each sampled frame. We regard an object to be moving if it moves at any frame, and otherwise stationary. We consider there is a collision happening between a pair of objects if they collide at any frame of the video. We get the ground-truth labels from the provided video annotation and report the accuracy in table 2 on the validation set.
+
+We observe that DCL can learn to recognize different kinds of concepts without explicit concept labels during training. This shows DCL’s effectiveness to learn object and event concepts through natural question answering. We also find that DCL recognizes static attributes and events better than dynamic attributes. We further find that DCL may misclassify objects to be “stationary” if they are missing for most frames and only move slowly at specific frames. We suspect the reason is that we only learn the dynamic attributes through question answering and question answering pairs for such slow-moving objects rarely appear in the training set.
+
+# 4.4 GENERALIZATION
+
+We further apply DCL to two new applications, including CLEVRER-Grounding, spatio-temporal localization of objects or events in a video, and CLEVRER-Retrieval, finding semantic-related videos for the query expressions and vice versa.
+
+We first build datasets for video grounding and video-text retrieval by synthesizing language expressions for videos in CLEVRER. We generate the expressions by filling visual contents from the video annotations into a set of pre-defined templates. For example, given the text template, “The $ that is $<$ dynamic attribute>