ZHANGYUXUAN-zR commited on
Commit
d8e6491
·
verified ·
1 Parent(s): 8050c8b

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. md/train/-TwO99rbVRu/-TwO99rbVRu.md +331 -0
  2. md/train/04cII6MumYV/04cII6MumYV.md +311 -0
  3. md/train/1Fqg133qRaI/1Fqg133qRaI.md +289 -0
  4. md/train/1FvkSpWosOl/1FvkSpWosOl.md +575 -0
  5. md/train/1NRMmEUyXMu/1NRMmEUyXMu.md +346 -0
  6. md/train/4ADnf1HqIw/4ADnf1HqIw.md +276 -0
  7. md/train/4G2dEuRZ7eO/4G2dEuRZ7eO.md +290 -0
  8. md/train/5FRJWsiLRmA/5FRJWsiLRmA.md +416 -0
  9. md/train/B12Js_yRb/B12Js_yRb.md +342 -0
  10. md/train/B1spAqUp-/B1spAqUp-.md +195 -0
  11. md/train/B1x5KiCcFX/B1x5KiCcFX.md +689 -0
  12. md/train/BJ6oOfqge/BJ6oOfqge.md +257 -0
  13. md/train/BJ8c3f-0b/BJ8c3f-0b.md +494 -0
  14. md/train/BJfguoAcFm/BJfguoAcFm.md +398 -0
  15. md/train/BJgVaG-Ab/BJgVaG-Ab.md +358 -0
  16. md/train/BJxh2j0qYm/BJxh2j0qYm.md +283 -0
  17. md/train/BkG8sjR5Km/BkG8sjR5Km.md +395 -0
  18. md/train/BkS3fnl0W/BkS3fnl0W.md +264 -0
  19. md/train/BkbY4psgg/BkbY4psgg.md +623 -0
  20. md/train/BkgtDsCcKQ/BkgtDsCcKQ.md +0 -0
  21. md/train/Bkxonh4Ywr/Bkxonh4Ywr.md +284 -0
  22. md/train/ByeSYa4KPS/ByeSYa4KPS.md +237 -0
  23. md/train/BygdyxHFDS/BygdyxHFDS.md +367 -0
  24. md/train/ByqFhGZCW/ByqFhGZCW.md +359 -0
  25. md/train/ByxCrerKvS/ByxCrerKvS.md +271 -0
  26. md/train/ByxdUySKvS/ByxdUySKvS.md +310 -0
  27. md/train/H1Dy---0Z/H1Dy---0Z.md +340 -0
  28. md/train/H1W1UN9gg/H1W1UN9gg.md +547 -0
  29. md/train/H1eqviAqYX/H1eqviAqYX.md +452 -0
  30. md/train/H1lmhaVtvr/H1lmhaVtvr.md +323 -0
  31. md/train/H1xaJn05FQ/H1xaJn05FQ.md +469 -0
  32. md/train/H38f_9b90BO/H38f_9b90BO.md +604 -0
  33. md/train/HCSgyPUfeDj/HCSgyPUfeDj.md +0 -0
  34. md/train/HJOQ7MgAW/HJOQ7MgAW.md +226 -0
  35. md/train/HJf9ZhC9FX/HJf9ZhC9FX.md +697 -0
  36. md/train/HJgBA2VYwH/HJgBA2VYwH.md +426 -0
  37. md/train/HJgVisRqtX/HJgVisRqtX.md +369 -0
  38. md/train/HJgXsjA5tQ/HJgXsjA5tQ.md +549 -0
  39. md/train/HJgeEh09KQ/HJgeEh09KQ.md +337 -0
  40. md/train/HJguLo0cKQ/HJguLo0cKQ.md +255 -0
  41. md/train/Hk5elxbRW/Hk5elxbRW.md +878 -0
  42. md/train/HkGmDsR9YQ/HkGmDsR9YQ.md +288 -0
  43. md/train/Hkfmn5n6W/Hkfmn5n6W.md +0 -0
  44. md/train/Hkg4TI9xl/Hkg4TI9xl.md +246 -0
  45. md/train/HkxAAvcxx/HkxAAvcxx.md +179 -0
  46. md/train/Hyfg5o0qtm/Hyfg5o0qtm.md +356 -0
  47. md/train/HyxhqhVKPB/HyxhqhVKPB.md +0 -0
  48. md/train/I55UqU-M11y/I55UqU-M11y.md +231 -0
  49. md/train/I6NRcao1w-X/I6NRcao1w-X.md +405 -0
  50. md/train/IQgbmaoDDjd/IQgbmaoDDjd.md +455 -0
md/train/-TwO99rbVRu/-TwO99rbVRu.md ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PSEUDOSEG: DESIGNING PSEUDO LABELS FOR SEMANTIC SEGMENTATION
2
+
3
+ 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
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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:
20
+
21
+ • 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.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ ![](images/55439202eaf26b71f27a6328f988f0027a61cd98c089773b1b8032b98ac5ec58.jpg)
32
+ 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.
33
+
34
+ # 3 THE PROPOSED METHOD
35
+
36
+ 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:
37
+
38
+ $$
39
+ \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) ,
40
+ $$
41
+
42
+ 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).
43
+
44
+ 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:
45
+
46
+ $$
47
+ \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) ,
48
+ $$
49
+
50
+ where $\beta ( \cdot )$ denotes a stronger data augmentation operation, which will be described in Section 3.2.
51
+ We illustrate the unlabeled data training branch in Figure 1.
52
+
53
+ # 3.1 THE DESIGN OF STRUCTURED PSEUDO LABELS
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ 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
64
+
65
+ $$
66
+ \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 } .
67
+ $$
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ 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
74
+
75
+ $$
76
+ \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) .
77
+ $$
78
+
79
+ 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.
80
+
81
+ ![](images/da24262064ec7dc7f8d685b2d6566bc0dcda547c410ce0f2f99758c6eebe8bf2.jpg)
82
+ 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.
83
+
84
+ 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.
85
+
86
+ # 3.2 INCORPORATING IMAGE-LEVEL LABELS AND AUGMENTATION
87
+
88
+ 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.
89
+
90
+ 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).
91
+
92
+ # 4 EXPERIMENTAL RESULTS
93
+
94
+ 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.
95
+
96
+ 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.
97
+
98
+ ![](images/97a7070768c40a2ee90f5b98acf7964c79ffade7edbbd0d82e10f3742a8ab33c.jpg)
99
+ Figure 3: Improvement over the strong supervised baseline, in a semi-supervised setting (w/ unlabeled data) on VOC12 val (left) and COCO val (right).
100
+
101
+ # 4.1 EXPERIMENTS USING PIXEL-LEVEL LABELED DATA AND UNLABELED DATA
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ 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.
108
+
109
+ <table><tr><td>Method</td><td>Network</td><td>mIoU (%)</td></tr><tr><td>GANSeg (Souly et al., 2017)</td><td>VGG16</td><td>64.10</td></tr><tr><td>AdvSemSeg (Hung et al., 2018)</td><td>ResNet-101</td><td>68.40</td></tr><tr><td>CCT (Ouali et al., 2020)</td><td>ResNet-50</td><td>69.40</td></tr><tr><td>PseudoSeg (Ours)</td><td>ResNet-50</td><td>71.00</td></tr><tr><td>PseudoSeg (Ours)</td><td>ResNet-101</td><td>73.23</td></tr></table>
110
+
111
+ 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).
112
+
113
+ <table><tr><td>Method</td><td>1/2 (732)</td><td>1/4 (366)</td><td>1/8 (183)</td><td>1/16 (92)</td></tr><tr><td>AdvSemSeg (Hung et al., 2018)</td><td>65.27</td><td>59.97</td><td>47.58</td><td>39.69</td></tr><tr><td>CCT (Ouali et al., 2020)</td><td>62.10</td><td>58.80</td><td>47.60</td><td>33.10</td></tr><tr><td>*MT (Tarvainen &amp; Valpola, 2017)</td><td>69.16</td><td>63.01</td><td>55.81</td><td>48.70</td></tr><tr><td>GCT (Ke et al., 2020)</td><td>70.67</td><td>64.71</td><td>54.98</td><td>46.04</td></tr><tr><td> **VAT (Miyato et al., 2018)</td><td>63.34</td><td>56.88</td><td>49.35</td><td>36.92</td></tr><tr><td>CutMix (French et al., 2020)</td><td>69.84</td><td>68.36</td><td>63.20</td><td>55.58</td></tr><tr><td>PseudoSeg (Ours)</td><td>72.41</td><td>69.14</td><td>65.50</td><td>57.60</td></tr></table>
114
+
115
+ ![](images/e591d5f2246b80ae34e3f3b7d110f34c16cf3c68f8df57d4c593602c1b0a3fc4.jpg)
116
+ 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).
117
+
118
+ 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.
119
+
120
+ <table><tr><td>Method</td><td>Model</td><td>Network</td><td>mIoU (%)</td></tr><tr><td>WSSN (Papandreou et al., 2015)</td><td>DeepLab-CRF</td><td>VGG16</td><td>64.60</td></tr><tr><td>GAIN (Li et al., 2018)</td><td>DeepLab-CRF-LFOV</td><td>VGG16</td><td>60.50</td></tr><tr><td>MDC (Wei et al.,2018)</td><td>DeepLab-CRF-LFOV</td><td>VGG16</td><td>65.70</td></tr><tr><td>DSRG (Huang et al.,2018)</td><td>DeepLabv2</td><td>VGG16</td><td>64.30</td></tr><tr><td>GANSeg (Souly et al.,2017)</td><td>FCN</td><td>VGG16</td><td>65.80</td></tr><tr><td>FickleNet (Lee et al.,2019)</td><td>DeepLabv2</td><td>ResNet-101</td><td>65.80</td></tr><tr><td>CCT (Ouali et al., 2020)</td><td>PSP-Net</td><td>ResNet-50</td><td>73.20</td></tr><tr><td>PseudoSeg (Ours)</td><td>DeepLabv3+</td><td>ResNet-50</td><td>73.80</td></tr></table>
121
+
122
+ 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.
123
+
124
+ <table><tr><td>Split</td><td>CCT</td><td>PseudoSeg</td></tr><tr><td>1/2</td><td>66.80</td><td>73.51</td></tr><tr><td>1/4</td><td>67.60</td><td>71.79</td></tr><tr><td>1/8</td><td>62.50</td><td>69.15</td></tr><tr><td>1/16</td><td>51.80</td><td>65.44</td></tr></table>
125
+
126
+ 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.
127
+
128
+ # 4.3 ABLATION STUDY
129
+
130
+ In this section, we conduct extensive ablation experiments on VOC12 to validate our design choices.
131
+
132
+ 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.
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ <table><tr><td>Source</td><td>Using image-level labels</td><td>1/4 (366)</td><td>1/8 (183)</td><td>1/16 (92)</td></tr><tr><td>Decoder only</td><td></td><td>70.22</td><td>69.35</td><td>53.20</td></tr><tr><td>SGC only</td><td></td><td>67.07</td><td>62.61</td><td>53.42</td></tr><tr><td>Calibrated fusion</td><td></td><td>73.79</td><td>73.13</td><td>67.06</td></tr><tr><td>Decoder only</td><td></td><td>73.95</td><td>73.05</td><td>67.54</td></tr><tr><td>SGC only</td><td></td><td>71.73</td><td>67.57</td><td>64.26</td></tr><tr><td>Calibrated fusion</td><td></td><td>75.29</td><td>74.70</td><td>71.22</td></tr></table>
141
+
142
+ ![](images/22e308dca704e89de560810e1f3d6d1ababe29fdb06d4ffaa1dc2fe834ea9bc0.jpg)
143
+ Figure 5: Ablation studies on different factors. See Section 4.3 for complete details.
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ # 4.4 COMPARISON WITH SELF-TRAINING
152
+
153
+ 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).
154
+
155
+ 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).
156
+
157
+ <table><tr><td>Method</td><td>Using image-level labels</td><td>1/4 (366)</td><td>1/8 (183)</td><td>1/16 (92)</td></tr><tr><td>Supervised (Teacher)</td><td></td><td>70.20</td><td>64.00</td><td>56.03</td></tr><tr><td>Self-training (Student)</td><td>1</td><td>72.85</td><td>69.88</td><td>64.20</td></tr><tr><td>PseudoSeg (Ours)</td><td>-</td><td>73.79</td><td>73.13</td><td>67.06</td></tr><tr><td>PseudoSeg (Ours)</td><td>√</td><td>75.29</td><td>74.70</td><td>71.22</td></tr></table>
158
+
159
+ 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.
160
+
161
+ # 5 IMPROVING THE FULLY-SUPERVISED METHOD WITH ADDITIONAL DAT
162
+
163
+ 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.
164
+
165
+ Table 7: Improving fully supervised model with extra data. No test-time augmentation is used.
166
+
167
+ <table><tr><td>Method</td><td></td><td colspan="2">Baseline丨PseudoSeg (w/o image-level labels)丨PseudoSeg (w/image-level labels)</td><td colspan="2"></td></tr><tr><td>Extra data</td><td>1</td><td>Ctr+Cu</td><td>Ctr + Cu + V9k</td><td>Ctr</td><td>Ctr +Vgk</td></tr><tr><td>mIoU (%)</td><td>76.96</td><td>77.40 (+0.44)</td><td>78.20 (+1.24)</td><td>77.80 (+0.84)</td><td>79.28 (+2.32)</td></tr></table>
168
+
169
+ # 5 DISCUSSION AND CONCLUSION
170
+
171
+ 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.
172
+
173
+ # ACKNOWLEDGEMENT
174
+
175
+ We thank Liang-Chieh Chen and Barret Zoph for their valuable comments.
176
+
177
+ # REFERENCES
178
+
179
+ Jiwoon Ahn and Suha Kwak. Learning pixel-level semantic affinity with image-level supervision for weakly supervised semantic segmentation. In CVPR, 2018. 3, 4
180
+
181
+ Jiwoon Ahn, Sunghyun Cho, and Suha Kwak. Weakly supervised learning of instance segmentation with inter-pixel relations. In CVPR, 2019. 4, 14
182
+
183
+ 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
184
+
185
+ 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
186
+
187
+ 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
188
+
189
+ 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
190
+
191
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020b. 5, 8
192
+
193
+ Franc¸ois Chollet. Xception: Deep learning with depthwise separable convolutions. In CVPR, 2017. 13
194
+
195
+ 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
196
+
197
+ Jifeng Dai, Kaiming He, and Jian Sun. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In ICCV, 2015. 2
198
+
199
+ Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 5
200
+
201
+ 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
202
+
203
+ 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
204
+
205
+ Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In NeurIPS, 2005. 2
206
+
207
+ Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. ICML, 2017. 7
208
+
209
+ Bharath Hariharan, Pablo Arbelaez, Lubomir Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours ´ from inverse detectors. In ICCV, 2011. 5
210
+
211
+ Bharath Hariharan, Pablo Arbelaez, Ross Girshick, and Jitendra Malik. Hypercolumns for object segmentation ´ and fine-grained localization. In CVPR, 2015. 4
212
+
213
+ Qibin Hou, PengTao Jiang, Yunchao Wei, and Ming-Ming Cheng. Self-erasing network for integral object attention. In NeurIPS, 2018. 3, 4
214
+
215
+ 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
216
+
217
+ 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
218
+
219
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In NeurIPS, 2015. 9
220
+
221
+ 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
222
+
223
+ 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
224
+
225
+ Jongmok Kim, Jooyoung Jang, and Hyunwoo Park. Structured consistency loss for semi-supervised semantic segmentation. arXiv preprint arXiv:2001.04647, 2020. 2
226
+ Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, 2020. 9
227
+ Philipp Krahenb ¨ uhl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge poten- ¨ tials. In NeurIPS, 2011. 3, 4
228
+ Chia-Wen Kuo, Chih-Yao Ma, Jia-Bin Huang, and Zsolt Kira. Featmatch: Feature-based augmentation for semi-supervised learning. In ECCV, 2020. 1
229
+ Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In ICLR, 2016. 2
230
+ Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In ICML Workshop, 2013. 2
231
+ 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
232
+ 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
233
+ Di Lin, Jifeng Dai, Jiaya Jia, Kaiming He, and Jian Sun. Scribblesup: Scribble-supervised convolutional networks for semantic segmentation. In CVPR, 2016. 2
234
+ 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
235
+ Wenfeng Luo and Meng Yang. Semi-supervised semantic segmentation via strong-weak dual-branch network. In ECCV, 2020. 2
236
+ Sudhanshu Mittal, Maxim Tatarchenko, and Thomas Brox. Semi-supervised semantic segmentation with highand low-level consistency. TPAMI, 2019. 2
237
+ 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
238
+ 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
239
+ Yassine Ouali, Celine Hudelot, and Myriam Tami. Semi-supervised semantic segmentation with cross- ´ consistency training. In CVPR, 2020. 2, 6, 7
240
+ 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
241
+ 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
242
+ Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In NeurIPS, 2016. 2
243
+ 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
244
+ 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
245
+ 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
246
+ Nasim Souly, Concetto Spampinato, and Mubarak Shah. Semi supervised semantic segmentation using generative adversarial network. In ICCV, 2017. 2, 6, 7
247
+ 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
248
+ 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
249
+ 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
250
+ 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
251
+ 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
252
+ 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
253
+ 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
254
+ Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In CVPR, 2020. 4
255
+ 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
256
+ Xiaolin Zhang, Yunchao Wei, and Yi Yang. Inter-image communication for weakly supervised localization. In ECCV, 2020b. 3
257
+ Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016. 2, 4
258
+ 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
259
+ 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
260
+
261
+ # APPENDIX
262
+
263
+ # A SELF-ATTENTION GRAD-CAM
264
+
265
+ 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.
266
+
267
+ ![](images/e601a68b369dd2bea5df204593cc86e5c58bb436da07925d9f96859b296a94ec.jpg)
268
+ Figure 6: Diagram of Self-attention Grad-CAM (SGC) .
269
+
270
+ # B IMPLEMENTATION DETAILS
271
+
272
+ 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.
273
+
274
+ # C LOW-DATA SAMPLING IN PASCAL VOC 2012
275
+
276
+ 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.
277
+
278
+ ![](images/43b7ca0d025624a2b1b4a19d13c29bcfbb2a797f53df2327a7d1cf85d90a40e5.jpg)
279
+ Figure 7: Training. For each network component, we show the loss supervision and the corresponding data.
280
+
281
+ Table 8: Full results of 1/16 split in VOC12.
282
+
283
+ <table><tr><td>Method</td><td>Using image-level labels</td><td>Split 1</td><td>Split 2</td><td>Split 3</td></tr><tr><td>Supervised</td><td>■</td><td>56.03</td><td>56.87</td><td>55.92</td></tr><tr><td>PseudoSeg (Ours)</td><td>1</td><td>67.06</td><td>64.12</td><td>66.09</td></tr><tr><td>PseudoSeg (Ours)</td><td>√</td><td>71.22</td><td>68.11</td><td>69.72</td></tr></table>
284
+
285
+ # D HIGH-DATA EXPERIMENTAL SETTINGS
286
+
287
+ 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$ .
288
+
289
+ # E COMPARISON WITH WEAKLY-SUPERVISED APPROACHES
290
+
291
+ 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.
292
+
293
+ 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.
294
+
295
+ <table><tr><td>Method</td><td>Pixel-level labeled data</td><td>mIoU (%)</td></tr><tr><td>FickleNet (Lee et al., 2019)</td><td></td><td>64.9</td></tr><tr><td>IRNet (Ahn et al., 2019)</td><td></td><td>63.5</td></tr><tr><td>OAA+ (Jiang et al., 2019)</td><td></td><td>65.2</td></tr><tr><td>SEAM (Wang et al., 2020)</td><td></td><td>64.5</td></tr><tr><td>MCIS (Sun et al., 2020)</td><td></td><td>66.2</td></tr><tr><td>PseudoSeg (Ours)</td><td>1/16 (92)</td><td>71.22</td></tr></table>
296
+
297
+ # F PERFORMANCE ANALYSIS FOR TEMPERATURE SHARPENING
298
+
299
+ 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.
300
+
301
+ Table 10: Performance analysis over T.
302
+
303
+ <table><tr><td>Temperature (T)</td><td>mIoU (%)</td></tr><tr><td>0.1</td><td>71.11</td></tr><tr><td>0.3</td><td>70.11</td></tr><tr><td>0.5 (default)</td><td>71.22</td></tr><tr><td>0.7</td><td>72.37</td></tr><tr><td>1.0 (no sharpening)</td><td>68.15</td></tr></table>
304
+
305
+ # G EXPERIMENTS ON CITYSCAPES
306
+
307
+ 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.
308
+
309
+ 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.
310
+
311
+ Table 11: Experiments on Cityscapes (w/ pixel-level labeled data and unlabeled data).
312
+
313
+ <table><tr><td>Method</td><td>1/4 (744)</td><td>1/8 (372)</td><td>1/30 (100)</td></tr><tr><td>CutMix (French et al., 2020)</td><td>68.33</td><td>65.82</td><td>55.71</td></tr><tr><td>PseudoSeg (Ours)</td><td>72.36</td><td>69.81</td><td>60.96</td></tr></table>
314
+
315
+ 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”).
316
+
317
+ Table 12: Per-class performance analysis on Cityscapes (w/ pixel-level labeled data and unlabeled data).
318
+
319
+ <table><tr><td>Class Pixel ratio (%)</td><td>Road 36.36</td><td>Sidewalk 5.61</td><td>Building 20.99</td><td>Wall 0.53</td><td>Fence 0.98</td><td>Pole 1.19</td><td>Traffic light 0.14</td><td>Traffic sign 0.51</td><td>Vegetation 19.61</td><td>Terrain 1.29</td></tr><tr><td>Supervised PseudoSeg (Ours)</td><td>96.03</td><td>71.26</td><td>87.53</td><td>19.75</td><td>29.11</td><td>52.19</td><td>50.19</td><td>68.09</td><td>89.93</td><td>45.79</td></tr><tr><td></td><td>96.64</td><td>75.06</td><td>88.63</td><td>19.67</td><td>34.09</td><td>51.75</td><td>58.19</td><td>69.95</td><td>90.43</td><td>50.48</td></tr><tr><td>Class</td><td>Sky</td><td>Person</td><td>Rider</td><td>Car</td><td>Truck</td><td>Bus</td><td>Train</td><td>Motorcycle</td><td>Bicycle</td><td></td></tr><tr><td>Pixel ratio (%)</td><td>3.70</td><td>1.10</td><td>0.16</td><td>6.49</td><td>0.38</td><td>0.13</td><td>0.23</td><td>0.06</td><td>0.54</td><td></td></tr><tr><td>Supervised</td><td>91.01</td><td>74.12</td><td>43.91</td><td>89.91</td><td>7.68</td><td>14.19</td><td>17.78</td><td>25.86</td><td>69.88</td><td></td></tr><tr><td>PseudoSeg (Ours)</td><td>92.99</td><td>75.16</td><td>46.09</td><td>91.60</td><td>20.39</td><td>26.30</td><td>22.13</td><td>43.96</td><td>71.30</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
320
+
321
+ 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.
322
+
323
+ # H QUALITATIVE RESULTS
324
+
325
+ 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.
326
+
327
+ ![](images/135161c6e5516766b8441d8a505a601aedeabfbaf045d2d39d9f58370fe109db.jpg)
328
+ Figure 8: Qualitative results of PASCAL VOC 2012. Models are trained with 1/16 pixel-level labeled data in the training set.
329
+
330
+ ![](images/bb1c575e94a6e95b23b16542a8e7720bafb4f0dec7ccae56a226c86d7f8ac3c3.jpg)
331
+ 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.
md/train/04cII6MumYV/04cII6MumYV.md ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A UNIVERSAL REPRESENTATION TRANSFORMER LAYER FOR FEW-SHOT IMAGE CLASSIFICATION
2
+
3
+ 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
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 2 FEW-SHOT CLASSIFICATION
24
+
25
+ # 2.1 PROBLEM SETTING
26
+
27
+ 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.
28
+
29
+ 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$ .
30
+
31
+ The meta-learning problem can then be formulated by the following optimization:
32
+
33
+ $$
34
+ \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 ) ,
35
+ $$
36
+
37
+ 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$ .
38
+
39
+ 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.
40
+
41
+ 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.
42
+
43
+ # 2.2 BACKGROUND AND RELATED WORK
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ 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.
50
+
51
+ 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.
52
+
53
+ # 3 UNIVERSAL REPRESENTATION TRANSFORMER LAYER
54
+
55
+ 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.
56
+
57
+ ![](images/b8ec3fe34a1bbf140191b9bf5722ec5773c3834b441b3d9391ea604b4b89789b.jpg)
58
+ 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.
59
+
60
+ 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.
61
+
62
+ 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.
63
+
64
+ 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 \}$ .
65
+
66
+ # 3.1 SINGLE-HEAD URT LAYER
67
+
68
+ 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
69
+
70
+ $$
71
+ r ( \mathbf x ) = \mathrm { c o n c a t } ( r _ { 1 } ( \mathbf x ) , \hdots , r _ { m } ( \mathbf x ) ) .
72
+ $$
73
+
74
+ This representation provides a natural starting point to obtain a representation of a support set class. Specifically, we will note
75
+
76
+ $$
77
+ r ( S _ { c } ) = \frac { 1 } { \left| S _ { c } \right| } \sum _ { { \pmb x } \in S _ { c } } r ( { \pmb x } )
78
+ $$
79
+
80
+ 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:
81
+
82
+ 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 }$ .
83
+
84
+ 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 } )$ .
85
+
86
+ # Algorithm 1 Training of URT layer
87
+
88
+ Input: Number of tasks $\tau _ { t o t a l }$ , $m$ pre-trained backbones ;
89
+
90
+ 1: for $\tau \in \{ 1 , \cdots , \tau _ { t o t a l } \}$ do
91
+ 2: Sample a few-shot task $T$ with support set $S$ and query set $Q$ ;
92
+ 3: # Infer adapted representation for task from $S$
93
+ 4: For each class, obtain representation using $m$ pre-trained backbones as in Eq. (3);
94
+ 5: Obtain attention scores using Eq. (4,5) for each head using support set $S$ ;
95
+ 6: # Use adapted representation to predict labels in $Q$ from support set $S$
96
+ 7: Compute adapted representation of examples in $S$ and $Q$ as in Eq. (6,7);
97
+ 8: Compute probabilities of label of examples in $Q$ using Prototypical Network as in Eq. (9);
98
+ 9: Compute loss as in Eq. (1,8) and perform gradient descent step on URT parameters $\Theta$ ;
99
+
100
+ 10: end for
101
+
102
+ Attention scores $\alpha _ { i }$ : as for regular Transformer layers, we use scaled dot-product attention
103
+
104
+ $$
105
+ \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 } } ,
106
+ $$
107
+
108
+ 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
109
+
110
+ $$
111
+ \alpha _ { i } = \frac { \sum _ { c } \alpha _ { i , c } } { N } .
112
+ $$
113
+
114
+ 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
115
+
116
+ $$
117
+ \phi ( { \bf x } ) = \sum _ { i } \alpha _ { i } r _ { i } ( { \bf x } ) .
118
+ $$
119
+
120
+ 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).
121
+
122
+ # 3.2 MULTI-HEAD URT LAYER
123
+
124
+ 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.
125
+
126
+ 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:
127
+
128
+ $$
129
+ \phi ( { \bf x } ) = \mathrm { c o n c a t } ( \phi _ { 1 } ( { \bf x } ) , \ldots , \phi _ { \mathrm { H } } ( { \bf x } ) ) .
130
+ $$
131
+
132
+ 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:
133
+
134
+ $$
135
+ \Omega ( \Theta ) = \| ( \mathbf { A } \mathbf { A } ^ { \top } - \mathbf { I } ) \| _ { F } ^ { 2 } ,
136
+ $$
137
+
138
+ 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.
139
+
140
+ # 3.3 TRAINING STRATEGY
141
+
142
+ 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
143
+
144
+ 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.
145
+
146
+ <table><tr><td></td><td>ILSVRC</td><td>Omniglot</td><td>Aircraft</td><td>Birds</td><td>Textures</td><td>QuickDraw</td><td>Fungi</td><td>VGGFlower</td><td>TrafficSigns</td><td></td><td>MSCOCO</td><td>avg.rank</td></tr><tr><td>MAML</td><td></td><td>37.8±1.0 83.9±1.0 76.4±0.7 62.4±1.1(</td><td></td><td></td><td></td><td>64.1±0.8</td><td>59.7±1.1</td><td>33.5±1.1</td><td>79.9±0.8</td><td>42.9±1.3</td><td>29.4±1.1</td><td>6.4</td></tr><tr><td>ProtoNet</td><td></td><td>44.5±1.1 79.6±1.1 71.1±0.9 67.0±1.0 65.2±0.8</td><td></td><td></td><td></td><td></td><td>64.9±0.9</td><td>40.3±1.1</td><td>86.9±0.7</td><td>46.5±1.0</td><td>39.9±1.1</td><td>5.7</td></tr><tr><td>ProtoMAML</td><td></td><td>46.5±1.1 82.7±1.0 75.2±0.8 69.9±1.0 68.3±0.8</td><td></td><td></td><td></td><td></td><td>66.8±0.9</td><td>42.0±1.2</td><td>88.7±0.7</td><td>52.4±1.1</td><td>41.7±1.1</td><td>4.1</td></tr><tr><td>CNAPs</td><td>50.8±1.1</td><td>91.7±0.5 83.7±0.6 73.6±0.9</td><td></td><td></td><td>59.5±0.7</td><td></td><td>74.7±0.8</td><td>50.2±1.1</td><td>88.9±0.5</td><td>56.5±1.1</td><td>39.4±1.1</td><td>3.6</td></tr><tr><td>SUR</td><td>56.1±1.1 </td><td>93.1±0.5 84.6±0.7 70.6±1.0 71.0±0.8</td><td></td><td></td><td></td><td></td><td>81.3±0.6</td><td>64.2±1.0</td><td>82.8±0.7</td><td>53.4±1.0</td><td>50.1±1.0</td><td>2.3</td></tr><tr><td>SimpleCNAPS 56.5±1.1 91.9±0.6 83.8±0.7 76.1±0.870.0±0.8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>78.3±0.7</td><td>49.1±1.2</td><td>91.3±0.6</td><td>59.2±1.0</td><td>42.4±1.1</td><td>2.2</td></tr><tr><td>URT (Ours)</td><td></td><td>55.7±1.0 94.4±0.4 85.8±0.6 76.3±0.871.8±0.7</td><td></td><td></td><td></td><td></td><td>82.5±0.6</td><td>63.5±1.0</td><td>88.2±0.6</td><td>51.1±1.1</td><td>52.2±1.1</td><td>1.5</td></tr></table>
147
+
148
+ support set of a task is modeled as:
149
+
150
+ $$
151
+ 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 } } } ) ) } ,
152
+ $$
153
+
154
+ 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.
155
+
156
+ # 4 EXPERIMENTS
157
+
158
+ In this section, we seek to answer three key experimental questions:
159
+
160
+ Q1 How does URT compare with previous state-of-the-art on Meta-Dataset for multi-domain fewshot classification?
161
+ Q2 Do the URT attention heads generate interpretable and meaningful attention scores?
162
+ Q3 Does the URT layer provide consistent benefits, even when pre-trained backbones are trained in different ways?
163
+
164
+ 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.
165
+
166
+ # 4.1 DATASETS AND SETUP
167
+
168
+ 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).
169
+
170
+ 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.
171
+
172
+ ![](images/c10077fb200921d3bb6bc7d24d0c40b0a826b01959da838218a14b2d49389f42.jpg)
173
+ 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.
174
+
175
+ # 4.2 COMPARISON WITH PREVIOUS APPROACHES
176
+
177
+ 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).
178
+
179
+ 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.
180
+
181
+ # 4.3 INTERPRETING AND VISUALIZING ATTENTION BY URT
182
+
183
+ 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.
184
+
185
+ 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.
186
+
187
+ Table 2: Test accuracy (mean $\pm \mathrm { C I } \% 9 5$ ) over 600 few-shot tasks. All methods use parametric network family (pf) backbones.
188
+
189
+ <table><tr><td></td><td> SUR-pf</td><td>URT-pf</td><td>VS.</td></tr><tr><td>ILSVRC</td><td>56.0 ± 1.1</td><td>55.5 ± 1.1</td><td>二</td></tr><tr><td>Omniglot</td><td>90.0 ± 0.8</td><td>90.2 ± 0.6</td><td>二</td></tr><tr><td>Aircraft</td><td>79.7 ± 0.8</td><td>79.8 ± 0.7</td><td>=</td></tr><tr><td>Birds</td><td>75.9 ± 0.9</td><td>77.5 ± 0.8</td><td>三</td></tr><tr><td>Textures</td><td>72.5 ± 0.7</td><td>73.5 ± 0.7</td><td></td></tr><tr><td>Quick Draw</td><td>76.7 ± 0.7</td><td>75.8 ± 0.7</td><td>三 二</td></tr><tr><td>Fungi</td><td>49.8 ± 1.1</td><td>48.1 ± 0.9</td><td>+</td></tr><tr><td>VGG Flower</td><td>90.0 ± 0.6</td><td>91.9 ± 0.5</td><td>二</td></tr><tr><td>Traffic Signs</td><td>52.2 ± 0.8</td><td>52.0 ± 1.4</td><td></td></tr><tr><td>MSCOCO</td><td>50.2 ± 1.1</td><td>52.1 ± 1.0</td><td></td></tr><tr><td>MNIST</td><td>93.2 ± 0.4</td><td>93.9 ± 0.4</td><td>=</td></tr><tr><td>CIFAR10</td><td>66.4 ± 0.8</td><td>66.1 ± 0.8</td><td>三</td></tr><tr><td>CIFAR100</td><td>57.1 ± 1.0</td><td>57.3 ± 1.0</td><td>二</td></tr></table>
190
+
191
+ # 4.4 URT USING FILM MODULATED BACKBONES
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ # 4.5 HYPER-PARAMETER AND ABLATION STUDIES
198
+
199
+ 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.
200
+
201
+ Table 3: Meta-Dataset performance variation on ablations of elements of the URT layer.
202
+
203
+ <table><tr><td colspan="11">ILSVRC Omniglot Aircraft Birds Textures Draw Fungi Flower Signs MSCOCO</td></tr><tr><td>w/o Wq</td><td>+0.2</td><td>-0.2</td><td>-0.6</td><td>-0.1</td><td>-0.3</td><td>-0.2</td><td>0.0</td><td>-0.2</td><td>-0.8</td><td>-0.1</td></tr><tr><td>w/o Wk</td><td>-14.2</td><td>-2.8</td><td>-10.7</td><td>-18.1</td><td>-7.6</td><td>-9.3</td><td>-22.4</td><td>-3.6</td><td>-0.26</td><td>-10.9</td></tr><tr><td>w/or(Sc)</td><td>-14.2</td><td>-2.8</td><td>-10.7</td><td>-18.1</td><td>-7.6</td><td>-9.2</td><td>-22.4</td><td>-3.6</td><td>-0.26</td><td>-10.9</td></tr><tr><td>w/0 Ω(0)</td><td>0.0</td><td>-0.9</td><td>-0.4</td><td>-3.3</td><td>-1.2</td><td>-0.2</td><td>+0.3</td><td>-9.0</td><td>-2.0</td><td>0.0</td></tr></table>
204
+
205
+ 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.
206
+
207
+ Table 4: Validation performance on Meta-Dataset using different number of heads
208
+
209
+ <table><tr><td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td></tr><tr><td>Average Accuracy</td><td>74.605</td><td>77.145</td><td>76.943</td><td>76.984</td><td>76.602</td><td>75.906</td><td>75.454</td><td>74.473</td></tr><tr><td>Average Rank</td><td>2.875</td><td>1.000</td><td>1.000</td><td>1.000</td><td>2.250</td><td>2.250</td><td>2.25</td><td>2.50</td></tr></table>
210
+
211
+ 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.
212
+
213
+ # 5 CONCLUSION
214
+
215
+ 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.
216
+
217
+ # REFERENCES
218
+
219
+ Ferran Alet, Tomas Lozano-P ´ erez, and Leslie P Kaelbling. Modular meta-learning. In ´ Conference on Robot Learning (CoRL), 2018.
220
+
221
+ 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.
222
+
223
+ Hakan Bilen and Andrea Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. arXiv preprint arXiv:1701.07275, 2017.
224
+
225
+ 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.
226
+
227
+ 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.
228
+
229
+ 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.
230
+
231
+ Nikita Dvornik, Cordelia Schmid, and Julien Mairal. Selecting relevant features from a universal representation for few-shot classification. arXiv preprint arXiv:2003.09338, 2020.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
238
+
239
+ Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ Tonmoy Saikia, Thomas Brox, and Cordelia Schmid. Optimized generic feature learning for fewshot classification across domains. arXiv preprint arXiv:2001.07926, 2020.
266
+
267
+ Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In The Conference on Neural Information Processing Systems (NeurIPS), 2017.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ 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.
276
+
277
+ 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.
278
+
279
+ 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.
280
+
281
+ 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.
282
+
283
+ # A EXPERIMENTS ON MORE DATASETS
284
+
285
+ 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.
286
+
287
+ Table 5: Test performance (mean $1 { + } \mathrm { C I } \% 9 5$ ) over 600 few-shot tasks on additional datasets.
288
+
289
+ <table><tr><td></td><td>MNIST CIFAR10</td><td>CIFAR100</td><td> avg. rank</td></tr><tr><td>CNAPs</td><td>92.7 ± 0.4 61.5 ± 0.7</td><td>50.1 ± 1.0</td><td>4.7</td></tr><tr><td>TaskNorm</td><td>92.3 ± 0.4 69.3 ± 0.8</td><td>54.6 ± 1.1</td><td>3.3</td></tr><tr><td>SUR</td><td>94.3 ± 0.4 66.8 ± 0.9</td><td>56.6 ± 1.0</td><td>2.3</td></tr><tr><td>SimpleCNAPS</td><td>93.9 ± 0.4 74.3± 0.7</td><td>60.5 ± 1.0</td><td>1.7</td></tr><tr><td>URT (Ours)</td><td>94.8 ± 0.4 67.3 ± 0.8</td><td>56.9 ± 1.0</td><td>2.0</td></tr></table>
290
+
291
+ # B MORE RELATED WORKS
292
+
293
+ 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.
294
+
295
+ # C STRUCTURES AND TRAINING STRATEGY OF BACKBONES
296
+
297
+ 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.
298
+
299
+ 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.
300
+
301
+ # D RESULTS ON TRAFFIC SIGNS
302
+
303
+ 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.
304
+
305
+ 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.
306
+
307
+ <table><tr><td></td><td>ILSVRC</td><td>Omniglot</td><td>Aircraft</td><td>Birds</td><td>Textures</td><td>QuickDraw</td><td>Fungi</td><td>VGGFlower</td><td>TrafficSigns</td><td>MSCOCO</td><td>avg.rank</td></tr><tr><td>MAML</td><td>37.8±1.0</td><td>83.9±1.0 76.4±0.7</td><td></td><td>62.4±1.1</td><td>64.1±0.8</td><td>59.7±1.1</td><td>33.5±1.1</td><td>79.9±0.8</td><td>42.9±1.3</td><td>29.4±1.1</td><td>8.0</td></tr><tr><td>ProtoNet</td><td>44.5±1.1</td><td>79.6±1.1</td><td>71.1±0.9 67.0±1.0 65.2±0.8</td><td></td><td></td><td>64.9±0.9</td><td>40.3±1.1</td><td>86.9±0.7</td><td>46.5±1.0</td><td>39.9±1.1</td><td>7.3</td></tr><tr><td>ProtoMAML</td><td>46.5±1.1</td><td>82.7±1.0 75.2±0.8 69.9±1.0 68.3±0.8</td><td></td><td></td><td></td><td>66.8±0.9</td><td>42.0±1.2</td><td>88.7±0.7</td><td>52.4±1.1</td><td>41.7±1.1</td><td>5.4</td></tr><tr><td>CNAPs</td><td>52.3±1.0</td><td>88.4±0.7 80.5±0.6 72.2±0.9 58.3±0.7</td><td></td><td></td><td></td><td>72.5±0.8</td><td>47.4±1.0</td><td>86.0±0.5</td><td>60.2±0.9</td><td>42.6±1.1</td><td>5.1</td></tr><tr><td>BOHB-E</td><td>55.4±1.1</td><td>77.5±1.1</td><td>60.9±0.9</td><td>73.6±0.8</td><td>72.8±0.7</td><td>61.2±0.9</td><td>44.5±1.1</td><td>90.6±0.6</td><td>57.5±1.0</td><td>51.9±1.0</td><td>4.4</td></tr><tr><td>TaskNorm</td><td>50.6±1.1</td><td>90.7±0.6 83.8±0.6</td><td></td><td>574.6±0.8</td><td>62.1±0.7</td><td>74.8±0.7</td><td>48.7±1.0</td><td>89.6±0.6</td><td>67.0±0.7</td><td>43.4±1.0</td><td>3.8</td></tr><tr><td>SUR</td><td>56.3±1.1</td><td>93.1±0.5 85.4±0.7 71.4±1.0 71.5±0.8</td><td></td><td></td><td></td><td>81.3±0.6</td><td>63.1±1.0</td><td>82.8±0.7</td><td>70.4±0.8</td><td>52.4±1.1</td><td>2.5</td></tr><tr><td>SimpleCNAPS 58.6±1.1 9</td><td></td><td>91.7±0.6 82.4±0.7 74.9±0.8 67.8±0.8</td><td></td><td></td><td></td><td>77.7±0.7</td><td>46.9±1.0</td><td>90.7±0.5</td><td>73.5±0.7</td><td>46.2±1.1</td><td>2.4</td></tr><tr><td>URT(Ours)</td><td>55.7±1.0</td><td>94.4±0.4 85.8±0.6 76.3±0.8 71.8±0.7</td><td></td><td></td><td></td><td>82.5±0.6</td><td>63.5±1.0</td><td>88.2±0.6</td><td>69.4±0.8</td><td>52.2±1.1</td><td>1.6</td></tr></table>
308
+
309
+ Table 7: Test accuracy (mean $\pm \mathrm { C I } \% 9 5 $ ) over 600 few-shot tasks. All methods use parametric network family (pf) backbones.
310
+
311
+ <table><tr><td></td><td>SUR-pf</td><td>URT-pf</td><td>VS.</td></tr><tr><td>ILSVRC</td><td>56.4 ± 1.2</td><td>55.5 ± 1.1</td><td>=</td></tr><tr><td>Omniglot</td><td>88.5±0.8</td><td>90.2 ± 0.6</td><td>+</td></tr><tr><td>Aircraft</td><td>79.5 ± 0.8</td><td>79.8 ± 0.7</td><td>=</td></tr><tr><td>Birds</td><td>76.4 ± 0.9</td><td>77.5 ± 0.8</td><td>=</td></tr><tr><td>Textures</td><td>73.1 ± 0.7</td><td>73.5± 0.7</td><td>=</td></tr><tr><td>Quick Draw</td><td>75.7 ± 0.7</td><td>75.8 ± 0.7</td><td>=</td></tr><tr><td>Fungi</td><td>48.2 ± 0.9</td><td>48.1 ± 0.9</td><td>=</td></tr><tr><td>VGG Flower</td><td>90.6 ± 0.5</td><td>91.9 ± 0.5</td><td>+</td></tr><tr><td>Traffic Signs</td><td>65.1 ± 0.8</td><td>67.5 ± 0.8</td><td>+</td></tr><tr><td>MSCOCO</td><td>52.1 ± 1.0</td><td>52.1 ± 1.0</td><td>=</td></tr><tr><td>MNIST</td><td>93.2 ± 0.4</td><td>93.9 ± 0.4</td><td>=</td></tr><tr><td>CIFAR10</td><td>66.4 ± 0.8</td><td>66.1 ± 0.8</td><td>=</td></tr><tr><td>CIFAR100</td><td>57.1 ± 1.0</td><td>57.3 ±1.0</td><td>=</td></tr></table>
md/train/1Fqg133qRaI/1Fqg133qRaI.md ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TOWARDS FASTER AND STABILIZED GAN TRAINING FOR HIGH-FIDELITY FEW-SHOT IMAGE SYNTHESIS
2
+
3
+ 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
4
+
5
+ 1Playform - Artrendex Inc., USA
6
+ 2Department of Computer Science, Rutgers University
7
+ {bingchen.liu,yizhe.zhu,kunpeng.song}@rutgers.edu
8
+ elgammal@artrendex.com
9
+
10
+ # ABSTRACT
11
+
12
+ 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.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ 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.
17
+
18
+ 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).
19
+
20
+ ![](images/c37c9377cee1982078f16f7aeac8dc9e249edcaffd3edd4fe7ccab56d907150e.jpg)
21
+ 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.
22
+
23
+ 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
24
+
25
+ 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$ .
26
+
27
+ 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:
28
+
29
+ • 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.
30
+
31
+ # 2 RELATED WORKS
32
+
33
+ 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
34
+
35
+ ![](images/313531434cd1b23c89a559cfbb37e6abac9a1c7b9c963941b18d551e5aa6330a.jpg)
36
+ Figure 2: The causes and challenges for training GAN in our studied conditions.
37
+
38
+ training speed. Moreover, the synthesis quality is not advanced within the shortened training time.
39
+
40
+ 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.
41
+
42
+ 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).
43
+
44
+ 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.
45
+
46
+ 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.
47
+
48
+ # 3 METHOD
49
+
50
+ 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.
51
+
52
+ ![](images/77e9d791f8976014c759d5c16143c8185e618fe9385c486e187b8086d323338f.jpg)
53
+ 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.
54
+
55
+ # 3.1 SKIP-LAYER CHANNEL-WISE EXCITATION
56
+
57
+ 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.
58
+
59
+ 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.
60
+
61
+ Formally, we define the Skip-Layer Excitation module as:
62
+
63
+ $$
64
+ \mathbf { y } = \mathcal { F } ( \mathbf { x } _ { l o w } , \{ \mathbf { W } _ { i } \} ) \cdot \mathbf { x } _ { h i g h }
65
+ $$
66
+
67
+ 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 }$ .
68
+
69
+ 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.
70
+
71
+ # 3.2 SELF-SUPERVISED DISCRIMINATOR
72
+
73
+ 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:
74
+
75
+ $$
76
+ \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 ) | | ] ,
77
+ $$
78
+
79
+ 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 }$ .
80
+
81
+ ![](images/9a306a457d02094cd3f62aa4073b58f603ba66c103909121121ac6ad9df1aca9.jpg)
82
+ 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.
83
+
84
+ 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$ .
85
+
86
+ 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.
87
+
88
+ 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;
89
+
90
+ 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.
91
+
92
+ 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:
93
+
94
+ $$
95
+ \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}
96
+ $$
97
+
98
+ # 4 EXPERIMENT
99
+
100
+ 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.
101
+
102
+ 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.
103
+
104
+ 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.
105
+
106
+ 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.
107
+
108
+ Table 1: Computational cost comparison of the models.
109
+
110
+ <table><tr><td></td><td></td><td>StyleGAN2@0.25</td><td>StyleGAN2@0.5</td><td>StyleGAN2</td><td>Baseline</td><td>Ours</td></tr><tr><td rowspan="2">Resolution: 2562 Batch-size: 8</td><td>Training time (hour/10k iter) Training vram (GB)</td><td>1</td><td>1.8</td><td>3.8</td><td>0.7</td><td>1</td></tr><tr><td>Model parameters (million)</td><td>7 27.557</td><td>16 45.029</td><td>18 108.843</td><td>5</td><td>6.5 47.363</td></tr><tr><td rowspan="2">Resolution: 10242</td><td>Training time (hour/10k iter)</td><td></td><td></td><td></td><td>44.359</td><td></td></tr><tr><td>Training vram (GB)</td><td>3.6</td><td>5</td><td>7</td><td>1.3</td><td>1.7</td></tr><tr><td rowspan="2">Batch-size: 8</td><td>Model parameters (million)</td><td>12</td><td>23</td><td>36</td><td>9</td><td>10</td></tr><tr><td></td><td>27.591</td><td>45.15</td><td>109.229</td><td>44.377</td><td>47.413</td></tr></table>
111
+
112
+ 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.
113
+
114
+ # 4.1 IMAGE SYNTHESIS PERFORMANCE
115
+
116
+ 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.
117
+
118
+ 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.
119
+
120
+ Table 2: FID comparison at $2 5 6 ^ { 2 }$ resolution on few-sample datasets.
121
+
122
+ <table><tr><td colspan="4">Animal Face- Dog</td><td>Animal Face - Cat</td><td>Obama</td><td>Panda</td><td>Grumpy-cat</td></tr><tr><td colspan="3">Image number</td><td>389</td><td>160</td><td>100</td><td>100</td><td>100</td></tr><tr><td rowspan="5">Training time on one RTX 2080-Ti</td><td rowspan="5">20 hour</td><td>StyleGAN2</td><td>58.85</td><td>42.44</td><td>46.87</td><td>12.06</td><td>27.08</td></tr><tr><td>StyleGAN2 finetune</td><td>61.03</td><td>46.07</td><td>35.75</td><td>14.5</td><td>29.34</td></tr><tr><td>Baseline 5 hour</td><td>108.19</td><td>150.3</td><td>62.74</td><td>15.4</td><td>42.13</td></tr><tr><td>Baseline+Skip</td><td>94.21</td><td>72.97</td><td>52.50</td><td>14.39</td><td>38.17</td></tr><tr><td>Baseline+decode Ours (B+Skip+decode)</td><td>56.25 50.66</td><td>36.74 35.11</td><td>44.34 41.05</td><td>10.12 10.03</td><td>29.38 26.65</td></tr></table>
123
+
124
+ 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.
125
+
126
+ 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.
127
+
128
+ Table 3: FID comparison at $1 0 2 4 ^ { 2 }$ resolution on few-sample datasets.
129
+
130
+ <table><tr><td></td><td></td><td></td><td>Art Paintings</td><td>FFHQ</td><td>Flower</td><td>Pokemon</td><td>Anime Face</td><td>Skull</td><td>Shell</td></tr><tr><td colspan="3">Image number</td><td>1000</td><td>1000</td><td>1000</td><td>800</td><td>120</td><td>100</td><td>60</td></tr><tr><td rowspan="2">Training time on one RTX TITAN</td><td>24 hour</td><td>StyleGAN2 StyleGAN2 finetune</td><td>74.56 N/A</td><td>25.66 N/A</td><td>45.23 36.72</td><td>190.23 60.12</td><td>152.73 61.23</td><td>127.98 107.68</td><td>241.37</td></tr><tr><td>8 hour</td><td>Baseline Ours</td><td>62.27 45.08</td><td>38.35 24.45</td><td>42.25</td><td>67.86</td><td>101.23</td><td>186.45</td><td>220.45 202.32</td></tr></table>
131
+
132
+ Table 4: FID comparison at $1 0 2 4 ^ { 2 }$ resolution on datasets with more images.
133
+
134
+ <table><tr><td rowspan="2">Model</td><td>Dataset</td><td colspan="3">Art Paintings</td><td colspan="3">FFHQ</td><td colspan="3">Nature Photograph</td></tr><tr><td>Image number</td><td>2k 5k</td><td>10k</td><td>2k</td><td>5k</td><td>10k</td><td>70k</td><td>2k</td><td>5k</td><td>10k</td></tr><tr><td colspan="2">StyleGAN2</td><td>70.02</td><td>48.36</td><td>41.23</td><td>18.38</td><td>10.45</td><td>7.86</td><td>4.4</td><td>67.12</td><td>41.47 39.05</td></tr><tr><td colspan="2">Baseline</td><td>60.02</td><td>51.23</td><td>49.38</td><td>36.45</td><td>27.86</td><td>25.12</td><td>17.62 71.47</td><td>66.05</td><td>62.28</td></tr><tr><td colspan="2">Ours</td><td>44.57</td><td>43.27</td><td>42.53</td><td>19.01</td><td>17.93</td><td>16.45</td><td>12.38 52.47</td><td>45.07</td><td>43.65</td></tr></table>
135
+
136
+ Table 5: LPIPS of back-tracking with $G$
137
+
138
+ <table><tr><td></td><td>Cat</td><td>Dog</td><td>FFHQ</td><td>Art</td></tr><tr><td>Resolution</td><td colspan="2">256</td><td colspan="2">1024</td></tr><tr><td>Baseline @ 20k iter</td><td>2.113</td><td>2.073</td><td>2.589</td><td>2.916</td></tr><tr><td>Baseline @ 40k iter</td><td>2.513</td><td>2.171</td><td>2.583</td><td>2.812</td></tr><tr><td>Ours @ 40k iter</td><td>1.821</td><td>1.918</td><td>2.425</td><td>2.624</td></tr><tr><td>Ours @ 80k iter</td><td>1.897</td><td>1.986</td><td>2.342</td><td>2.601</td></tr></table>
139
+
140
+ ![](images/40e031b55ed0a6c6e2c80f2d7f05dbf26a14fdda2891f0c61671d35dead85d5f.jpg)
141
+ Figure 6: Latent space back-tracking and interpolation.
142
+
143
+ Table 6: FID of self-supervisions for $D$
144
+
145
+ <table><tr><td></td><td>Art paintings</td><td>Nature photos</td></tr><tr><td>a. contrastive loss</td><td>47.14</td><td>57.04</td></tr><tr><td>b. predict aspect ratio</td><td>49.21</td><td>59.22</td></tr><tr><td>c.auto-encoding</td><td>42.53</td><td>43.65</td></tr><tr><td>d.a+b</td><td>46.02</td><td>54.23</td></tr><tr><td>e.a+b+c</td><td>44.21</td><td>47.65</td></tr></table>
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ 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.
152
+
153
+ # 4.2 MORE ANALYSIS AND APPLICATIONS
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ ![](images/1b089ab672f80d73a3e1097e0c357e7475d1d83e616607b8144ca506fa52e69d.jpg)
160
+ 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.
161
+
162
+ 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).
163
+
164
+ In addition, we show qualitative comparisons in appendix D, where our model maintains a good generation while StyleGAN2 and baseline are model-collapsed.
165
+
166
+ 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.
167
+
168
+ ![](images/2da992c184746b333c41d52b16369f17b9f833b9e36850835fc27919e5604135.jpg)
169
+ Figure 7: Style-mixing results from our model trained for only 5 hours on single GPU.
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ # 5 CONCLUSION
176
+
177
+ 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.
178
+
179
+ # REFERENCES
180
+
181
+ 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.
182
+
183
+ Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. In International Conference on Learning Representations, 2017.
184
+
185
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International conference on machine learning, pp. 214–223. PMLR, 2017.
186
+
187
+ David Berthelot, Thomas Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
188
+
189
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019.
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ Ahmed Elgammal, Marian Mazzone, et al. Artists, artificial intelligence and machine-based creativity in playform. Artnodes, (26):1–8, 2020.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ 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.
204
+
205
+ 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.
206
+
207
+ 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.
208
+
209
+ 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.
210
+
211
+ 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.
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ 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.
228
+
229
+ 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.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ Jae Hyun Lim and Jong Chul Ye. Geometric gan. arXiv preprint arXiv:1705.02894, 2017.
236
+
237
+ Zachary C. Lipton and Subarna Tripathi. Precise recovery of latent vectors from generative adversarial networks. ICLR workshop, 2017.
238
+
239
+ 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.
240
+
241
+ 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.
242
+
243
+ Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018.
244
+
245
+ Sangwoo Mo, Minsu Cho, and Jinwoo Shin. Freeze discriminator: A simple baseline for fine-tuning gans. arXiv preprint arXiv:2002.10964, 2020.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
256
+
257
+ Esther Robb, Wen-Sheng Chu, Abhishek Kumar, and Jia-Bin Huang. Few-shot adaptation of generative adversarial networks. arXiv preprint arXiv:2010.11943, 2020.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 7(3):13, 2017.
264
+
265
+ 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.
266
+
267
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ Dan Zhang and Anna Khoreva. Pa-gan: Improving gan training by progressive augmentation. 2018.
276
+
277
+ 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.
278
+
279
+ 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.
280
+
281
+ Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
282
+
283
+ 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.
284
+
285
+ Jiachen Zhong, Xuanqing Liu, and Cho-Jui Hsieh. Improving the speed and quality of gan by adversarial training. arXiv preprint arXiv:2008.03364, 2020.
286
+
287
+ Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. arXiv preprint arXiv:2004.00049, 2020.
288
+
289
+ 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.
md/train/1FvkSpWosOl/1FvkSpWosOl.md ADDED
@@ -0,0 +1,575 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IS ATTENTION BETTER THAN MATRIX DECOMPOSITION?
2
+
3
+ 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
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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?
12
+
13
+ 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.
14
+
15
+ 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).
16
+
17
+ The contributions of this paper are listed as follows:
18
+
19
+ • 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.
20
+
21
+ # 2 METHODOLOGY
22
+
23
+ # 2.1 WARM UP
24
+
25
+ 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.
26
+
27
+ 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
28
+
29
+ $$
30
+ X = \overbrace { \bar { X } + E = D C } ^ { g e n e r a t i o n } + E ,
31
+ $$
32
+
33
+ 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
34
+
35
+ $$
36
+ \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 ) .
37
+ $$
38
+
39
+ 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).
40
+
41
+ # 2.2 PROPOSED METHOD
42
+
43
+ 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.
44
+
45
+ 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,
46
+
47
+ $$
48
+ { \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 ,
49
+ $$
50
+
51
+ 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.
52
+
53
+ ![](images/f4b8507f6011e66a2d30ba95d9361b6126ed0a6cc21d7971535b8e125c610ec2.jpg)
54
+ Figure 1: Overview of Hamburger
55
+
56
+ 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.
57
+
58
+ 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
59
+
60
+ $$
61
+ \operatorname* { m i n } _ { D , C } \mathcal { L } ( X , D C ) + \mathcal { R } _ { 1 } ( D ) + \mathcal { R } _ { 2 } ( C )
62
+ $$
63
+
64
+ 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.
65
+
66
+ 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.
67
+
68
+ # 2.2.1 HAMBURGER
69
+
70
+ 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”,
71
+
72
+ $$
73
+ \begin{array} { r } { \mathcal { H } ( Z ) = W _ { u } \mathcal { M } ( W _ { l } Z ) , } \end{array}
74
+ $$
75
+
76
+ 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 }$ ,
77
+
78
+ $$
79
+ \begin{array} { r } { Y = Z + \mathrm { B N } ( \mathcal { H } ( Z ) ) . } \end{array}
80
+ $$
81
+
82
+ # 2.2.2 HAMS
83
+
84
+ 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.
85
+
86
+ $$
87
+ \mathcal { M } ( X ) = \bar { X } = D C .
88
+ $$
89
+
90
+ 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.
91
+
92
+ 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:
93
+
94
+ $$
95
+ \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 } \} ,
96
+ $$
97
+
98
+ where $e _ { i }$ is the canonical basis vector, $\mathbf { e } _ { i } = [ 0 , \cdots , 1 , \cdots , 0 ] ^ { \top }$ . The solution to minimize the ith
99
+ 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$ .
100
+
101
+ <table><tr><td>Algorithm 1 Ham: Soft VQ</td></tr><tr><td>Input X. Initialize D, C.</td></tr><tr><td>for k from 1 to K do</td></tr><tr><td>C ← softmax(⊥cosine(D,X))</td></tr><tr><td>D ← XCTdiag(C1n)-1</td></tr><tr><td>end for</td></tr><tr><td>Output X = DC.</td></tr></table>
102
+
103
+ <table><tr><td>Algorithm2Ham:NMF with MU</td></tr><tr><td>Input X. Initialize non-negative D, C</td></tr><tr><td>for k from 1 to K do (DTX)ij</td></tr><tr><td>Cij←Cij (DT DC)ij</td></tr><tr><td>(xCT)ij Dij←Dij</td></tr><tr><td>(DCCT)ij end for</td></tr><tr><td>Output X = DC.</td></tr></table>
104
+
105
+ 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):
106
+
107
+ $$
108
+ \operatorname* { m i n } _ { D , C } \| X - D C \| _ { F } \quad \mathrm { s . t . } D _ { i j } \geq 0 , C _ { j k } \geq 0 .
109
+ $$
110
+
111
+ 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.
112
+
113
+ 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.
114
+
115
+ # 2.3 ONE-STEP GRADIENT
116
+
117
+ 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.
118
+
119
+ 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.
120
+
121
+ $$
122
+ \begin{array} { r } { \mathbf { h } ^ { t + 1 } = \mathcal { F } ( \mathbf { h } ^ { t } , \mathbf { x } ) . } \end{array}
123
+ $$
124
+
125
+ 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 }$ ,
126
+
127
+ $$
128
+ \mathbf { y } = \mathcal { G } ( \mathbf { h } ^ { t } ) .
129
+ $$
130
+
131
+ In the BPPT algorithm, the gradient from output $\mathbf { y }$ to input $\mathbf { x }$ is given, according to the Chain rule:
132
+
133
+ $$
134
+ \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 } } .
135
+ $$
136
+
137
+ ![](images/5ab6d727f0cd57f41588f1cd83d1aa6d9c71c62cfac4892ef03dfa8bdeb4c6b9.jpg)
138
+ Figure 2: One-step Gradient
139
+
140
+ 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
141
+
142
+ 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:
143
+
144
+ Proposition 1 $\{ \mathbf { h } ^ { i } \} _ { t }$ has linear convergence.
145
+
146
+ Proposition 2
147
+
148
+ Table 1: One-step Gradient & BPTT
149
+
150
+ <table><tr><td>Method</td><td>One-step</td><td>BPTT</td></tr><tr><td>VQ</td><td>77.7(77.4)</td><td>76.6(76.3)</td></tr><tr><td>CD</td><td>78.1(77.5)</td><td>75.0(74.6)</td></tr><tr><td>NMF</td><td>78.3(77.8)</td><td>77.4(77.0)</td></tr></table>
151
+
152
+ $$
153
+ \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}
154
+ $$
155
+
156
+ Proposition 3
157
+
158
+ 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.
159
+
160
+ 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,
161
+
162
+ $$
163
+ \widehat { \frac { \partial \mathbf { y } } { \partial \mathbf { x } } } = \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { t } } \frac { \partial \mathbf { h } ^ { t } } { \partial \mathbf { x } } .
164
+ $$
165
+
166
+ 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.
167
+
168
+ Table 2: Ablation on components of Hamburger with NMF Ham.
169
+
170
+ <table><tr><td>Method</td><td>mIoU(%)</td><td>Params</td></tr><tr><td>baseline</td><td>75.9(75.7)</td><td>32.67M</td></tr><tr><td>basic</td><td>78.3(77.8)</td><td>+0.50M</td></tr><tr><td> - ham</td><td>75.8(75.6)</td><td>+0.50M</td></tr><tr><td>- upper bread</td><td>77.0(76.8)</td><td>+0.25M</td></tr><tr><td>- lower bread</td><td>77.3(77.2)</td><td>+0.25M</td></tr><tr><td>only ham</td><td>77.0(76.8)</td><td>+0M</td></tr></table>
171
+
172
+ # 3 EXPERIMENTS
173
+
174
+ 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.
175
+
176
+ # 3.1 ABLATION EXPERIMENTS
177
+
178
+ 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.
179
+
180
+ ![](images/24419391ec90442015c0b287b0277f4cc7ec68ebb6455c8e2d42b50f8207a791.jpg)
181
+ Figure 3: Ablation on $d$ and $r$
182
+
183
+ 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.
184
+
185
+ 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.
186
+
187
+ ![](images/56fcdfe0681b4e23dc01a7fc1b5dd2f92c91af7f0ab029fc8d3476e531ab88aa.jpg)
188
+ Figure 4: Ablation on $K$
189
+
190
+ 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.
191
+
192
+ # 3.2 A CLOSE LOOK AT HAMBURGER
193
+
194
+ 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.
195
+
196
+ ![](images/f95a516bc0b67b123fc10b829a93b9a88723b677beefb69a3c882a275803e995.jpg)
197
+ Figure 5: Accumulative Ratio
198
+
199
+ ![](images/de1972c49d4bb1cb288ed917e599d9f10e60ec02432255c0fb5ea6f5af8b179a.jpg)
200
+ Figure 6: Visualization of feature maps
201
+
202
+ # 3.3 A COMPARISON WITH ATTENTION
203
+
204
+ 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.
205
+
206
+ Table 3: Comparisons between Hamburger and context modules.
207
+
208
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Params</td><td rowspan="2">MACs</td><td colspan="2">GPU Load</td><td colspan="2">GPU Time</td></tr><tr><td>Train</td><td>Infer</td><td>Train</td><td>Infer</td></tr><tr><td>SA</td><td>1.00M</td><td>292G</td><td>5253MB</td><td>2148MB</td><td>242.0ms</td><td>82.2ms</td></tr><tr><td>DA</td><td>4.82M</td><td>79.5G</td><td>2395MB</td><td>2203MB</td><td>72.6ms</td><td>64.4ms</td></tr><tr><td>A2</td><td>1.01M</td><td>25.7G</td><td>326MB</td><td>165MB</td><td>22.9ms</td><td>8.0ms</td></tr><tr><td>APC</td><td>2.03M</td><td>17.6G</td><td>458MB</td><td>264MB</td><td>26.5ms</td><td>11.6ms</td></tr><tr><td>DM</td><td>3.00M</td><td>35.1G</td><td>557MB</td><td>268MB</td><td>65.7ms</td><td>23.3ms</td></tr><tr><td>ACF</td><td>0.75M</td><td>79.5G</td><td>1380MB</td><td>627MB</td><td>71.0ms</td><td>22.6ms</td></tr><tr><td>Ham (CD)</td><td>0.50M</td><td>16.2G</td><td>162MB</td><td>102MB</td><td>20.0ms</td><td>13.0ms</td></tr><tr><td>Ham (NMF)</td><td>0.50M</td><td>17.6G</td><td>202MB</td><td>98MB</td><td>15.6ms</td><td>7.7ms</td></tr></table>
209
+
210
+ # 3.4 SEMANTIC SEGMENTATION
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ Table 4: Comparisons with state-of-the-art on the PASCAL VOC test set w/o COCO pretraining.
217
+
218
+ <table><tr><td>Method</td><td>mIoU(%)</td></tr><tr><td>PSPNet (Zhao et al., 2017)</td><td>82.6</td></tr><tr><td>DFN* (Yu et al., 2018)</td><td>82.7</td></tr><tr><td>EncNet (Zhang et al., 2018)</td><td>82.9</td></tr><tr><td>DANet* (Fu et al., 2019)</td><td>82.6</td></tr><tr><td>DMNet* (He et al., 2019a)</td><td>84.4</td></tr><tr><td>APCNet* (He et al., 2019b)</td><td>84.2</td></tr><tr><td>CFNet* (Zhang et al., 2019b)</td><td>84.2</td></tr><tr><td>SpyGR* (Li et al., 2020)</td><td>84.2</td></tr><tr><td>SANet* (Zhong et al., 2020)</td><td>83.2</td></tr><tr><td>OCR* (Yuan et al., 2020)</td><td>84.3</td></tr><tr><td>HamNet</td><td>85.9</td></tr></table>
219
+
220
+ Table 5: Results on the PASCAL-Context Val set.
221
+
222
+ <table><tr><td>Method</td><td>mIoU(%)</td></tr><tr><td>PSPNet (Zhao et al., 2017)</td><td>47.8</td></tr><tr><td>SGR* (Liang et al., 2018)</td><td>50.8</td></tr><tr><td>EncNet (Zhang et al., 2018)</td><td>51.7</td></tr><tr><td>DANet* (Fu et al., 2019)</td><td>52.6</td></tr><tr><td>EMANet* (Li et al., 2019)</td><td>53.1</td></tr><tr><td>DMNet* (He et al., 2019a)</td><td>54.4</td></tr><tr><td>APCNet* (He et al., 2019b)</td><td>54.7</td></tr><tr><td>CFNet* (Zhang et al., 2019b)</td><td>54.0</td></tr><tr><td>SpyGR* (Li et al., 2020)</td><td>52.8</td></tr><tr><td>SANet* (Zhong et al., 2020)</td><td>53.0</td></tr><tr><td>OCR*(Yuan et al., 2020)</td><td>54.8</td></tr><tr><td>HamNet</td><td>55.2</td></tr></table>
223
+
224
+ # 3.5 IMAGE GENERATION
225
+
226
+ 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).
227
+
228
+ Table 6: Results on ImageNet $1 2 8 \times 1 2 8$ . ∗ are from Tab. 1 and Tab. 2 of Zhang et al. (2019a).
229
+
230
+ <table><tr><td>Method</td><td>FID↓</td></tr><tr><td>SNGAN-projection*</td><td>27.62</td></tr><tr><td>SAGAN*</td><td>18.28</td></tr><tr><td>HamGAN-baby</td><td>16.05</td></tr><tr><td>YLG</td><td>15.94</td></tr><tr><td>HamGAN-strong</td><td>14.77</td></tr></table>
231
+
232
+ 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.
233
+
234
+ # 4 RELATED WORK
235
+
236
+ 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).
237
+
238
+ 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.
239
+
240
+ 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.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ # 5 CONCLUSION
247
+
248
+ 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.
249
+
250
+ # ACKNOWLEDGMENTS
251
+
252
+ 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.
253
+
254
+ # REFERENCES
255
+
256
+ 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
257
+
258
+ 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
259
+
260
+ 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
261
+
262
+ Yoshua Bengio. The consciousness prior. arXiv preprint arXiv:1709.08568, 2017. 2
263
+
264
+ 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
265
+
266
+ 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
267
+
268
+ 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
269
+
270
+ 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
271
+
272
+ 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
273
+
274
+ 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
275
+
276
+ 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
277
+
278
+ 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
279
+
280
+ 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
281
+
282
+ 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
283
+
284
+ 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
285
+
286
+ 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
287
+
288
+ 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
289
+
290
+ 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
291
+
292
+ 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
293
+
294
+ 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
295
+
296
+ 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
297
+
298
+ 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
299
+
300
+ 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
301
+
302
+ Geoffrey E Hinton, Sara Sabour, and Nicholas Frosst. Matrix capsules with EM routing. In International Conference on Learning Representations, 2018. 9
303
+
304
+ 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
305
+
306
+ 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
307
+
308
+ Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franccois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. ArXiv, abs/2006.16236, 2020. 9
309
+
310
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015. 18
311
+
312
+ Tamara G. Kolda and Brett W. Bader. Tensor decompositions and applications. SIAM Review, 51(3): 455–500, 2009. doi: 10.1137/07070111X. 2
313
+
314
+ 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
315
+
316
+ 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
317
+
318
+ 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
319
+
320
+ Daniel D Lee and H Sebastian Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755):788, 1999. 1, 4
321
+
322
+ 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
323
+
324
+ 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
325
+
326
+ 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
327
+
328
+ 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
329
+
330
+ 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
331
+
332
+ 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
333
+
334
+ 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
335
+
336
+ 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
337
+
338
+ 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
339
+
340
+ 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
341
+
342
+ 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
343
+
344
+ Sneha Mehta, H. Rangwala, and N. Ramakrishnan. Low rank factorization for compact multi-head self-attention. ArXiv, abs/1912.00835, 2019. 9
345
+
346
+ Takeru Miyato and Masanori Koyama. cGANs with projection discriminator. In International Conference on Learning Representations, 2018. 17, 18
347
+
348
+ Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. 18
349
+
350
+ 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
351
+
352
+ 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
353
+
354
+ 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
355
+
356
+ 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
357
+
358
+ 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
359
+
360
+ 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
361
+
362
+ Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in neural information processing systems, pp. 3856–3866, 2017. 9
363
+
364
+ 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
365
+
366
+ 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
367
+
368
+ Kyungwoo Song, Yohan Jung, Dong-Jun Kim, and I. Moon. Implicit kernel attention. ArXiv, abs/2006.06147, 2020. 9
369
+
370
+ 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
371
+
372
+ Snigdha Tariyal, A. Majumdar, R. Singh, and Mayank Vatsa. Deep dictionary learning. IEEE Access, 4:10096–10109, 2016. 9
373
+
374
+ 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
375
+
376
+ 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
377
+
378
+ 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
379
+
380
+ Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. ArXiv, abs/2006.04768, 2020. 9
381
+
382
+ 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
383
+
384
+ 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
385
+
386
+ 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
387
+
388
+ 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
389
+
390
+ 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
391
+
392
+ 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
393
+
394
+ 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
395
+
396
+ Yuhui Yuan and Jingdong Wang. Ocnet: Object context network for scene parsing. arXiv preprint arXiv:1809.00916, 2018. 17
397
+
398
+ Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. arXiv preprint arXiv:1909.11065, 2020. 8, 17
399
+
400
+ Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. ICML, 2019a. 1, 3, 6, 8, 9, 17, 18
401
+
402
+ Han Zhang, Zizhao Zhang, Augustus Odena, and Honglak Lee. Consistency regularization for generative adversarial networks. ArXiv, abs/1910.12027, 2020. 18
403
+
404
+ 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
405
+
406
+ 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
407
+
408
+ 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
409
+
410
+ 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
411
+
412
+ 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
413
+
414
+ 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
415
+
416
+ 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
417
+
418
+ 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
419
+
420
+ # A TABLE OF NOTION
421
+
422
+ Table 7: Summary of notations in this paper
423
+
424
+ <table><tr><td rowspan=1 colspan=2>βXXZ</td><td rowspan=1 colspan=1>A scalar.A vector.A matrix.A tensor.</td></tr><tr><td rowspan=1 colspan=2>1nXiht8</td><td rowspan=1 colspan=1>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.</td></tr><tr><td rowspan=1 colspan=1>XX||F</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Operator norm.Frobenius norm.</td></tr><tr><td rowspan=1 colspan=2>diagcosinesoftmaxnormalize</td><td rowspan=1 colspan=1>Map a vector to a diagonal matrix.Cosine similarity used in Alg.1.Column-wise softmax function.Column-wise normalization by L2 norm.</td></tr></table>
425
+
426
+ # B HAMS
427
+
428
+ Additionally, we introduce another type of ham adopted by Hamburger, Concept Decomposition.
429
+
430
+ Concept Decomposition We first enhance Concept Decomposition (Dhillon & Modha, 2001) to the following form:
431
+
432
+ $$
433
+ \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}
434
+ $$
435
+
436
+ 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$ .
437
+
438
+ <table><tr><td>Algorithm 3 Ham: Soft CD</td></tr><tr><td>Input X. Initialize D, C</td></tr><tr><td>for k from 1 to K do</td></tr><tr><td>C ← softmax(Tcosine(D,X))</td></tr><tr><td>D ← normalize(XCT)</td></tr><tr><td>end for</td></tr><tr><td>C ← (DD+ βI)-1DTX</td></tr><tr><td>Output X = DC.</td></tr></table>
439
+
440
+ 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).
441
+
442
+ $$
443
+ \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}
444
+ $$
445
+
446
+ 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.
447
+
448
+ # C PROOF OF PROPOSITIONS
449
+
450
+ 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.
451
+
452
+ Proposition 1 The iterations of $\mathcal { F }$ have linear convergence.
453
+
454
+ 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.
455
+
456
+ $$
457
+ \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}
458
+ $$
459
+
460
+ Eq. (16) shows the linear convergence.
461
+
462
+ 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}$
463
+
464
+ Proof. Note that $\mathcal { F } ( \ast , { \mathbf { x } } )$ admits a unique fixed point $\mathbf { h } ^ { * }$ under arbitrary given $\mathbf { x }$ , i.e.,
465
+
466
+ $$
467
+ \mathbf { h } ^ { * } = \mathcal { F } ( \mathbf { h } ^ { * } , \mathbf { x } ) \quad \Longrightarrow \quad \mathbf { h } ^ { * } - \mathcal { F } ( \mathbf { h } ^ { * } , \mathbf { x } ) = \mathbf { 0 }
468
+ $$
469
+
470
+ By differentiating the above equation, we can obtain
471
+
472
+ $$
473
+ ( I - \frac { \partial \mathcal { F } } { \partial \mathbf { h } ^ { * } } ) \frac { \partial \mathbf { h } ^ { * } } { \partial \mathbf { x } } = \frac { \partial \mathcal { F } } { \partial \mathbf { x } }
474
+ $$
475
+
476
+ 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
477
+
478
+ $$
479
+ \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 } } ,
480
+ $$
481
+
482
+ which completes the proof.
483
+
484
+ 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}$
485
+
486
+ Proof.
487
+
488
+ $$
489
+ \| \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 }
490
+ $$
491
+
492
+ Then we have:
493
+
494
+ $$
495
+ \operatorname* { l i m } _ { t \infty } \lVert \frac { \partial \mathbf { y } } { \partial \mathbf { h } ^ { 0 } } \rVert = 0 .
496
+ $$
497
+
498
+ $$
499
+ \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}
500
+ $$
501
+
502
+ Then we have:
503
+
504
+ $$
505
+ \operatorname* { l i m } _ { t \to \infty } \| \frac { \partial \mathbf { y } } { \partial \mathbf { x } } \| \leq \frac { L _ { \mathcal { G } } L _ { x } } { 1 - L _ { h } } .
506
+ $$
507
+
508
+ # D DATASETS
509
+
510
+ 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.
511
+
512
+ 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.
513
+
514
+ 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).
515
+
516
+ # E DETAILS OF EXPERIMENTS
517
+
518
+ # E.1 ABALATION EXPERIMENTS
519
+
520
+ 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.
521
+
522
+ # E.2 A COMPARISON WITH ATTENTION MECHANISM
523
+
524
+ 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.
525
+
526
+ # E.3 SEMANTIC SEGMENTATION
527
+
528
+ 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.
529
+
530
+ 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).
531
+
532
+ 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.
533
+
534
+ # E.4 IMAGE GENERATION
535
+
536
+ We use the official GAN codebase2 from Tensorflow (Abadi et al., 2016) and TF-GAN to train HamGAN and evaluate FID.
537
+
538
+ 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.
539
+
540
+ 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.
541
+
542
+ 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.
543
+
544
+ # F FURTHER RESULTS FROM ABLATION EXPERIMENTS
545
+
546
+ Table 8: Ablation on initializations.
547
+
548
+ <table><tr><td>Init</td><td>NMF</td><td>CD</td><td>VQ</td></tr><tr><td>fixed</td><td>77.4(77.3)</td><td>77.7(77.4)</td><td>77.3(76.9)</td></tr><tr><td>learned</td><td>76.8(76.5)</td><td>75.0(73.7)</td><td>75.9(75.8)</td></tr><tr><td>random</td><td>78.3(77.8)</td><td>77.9(77.3)</td><td>77.7(77.4)</td></tr><tr><td>online</td><td>77.8(77.5)</td><td>78.1(77.5)</td><td>78.0(77.2)</td></tr></table>
549
+
550
+ 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.
551
+
552
+ 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$ .
553
+
554
+ Table 9: Influence of temperature $T$ with CD ham.
555
+
556
+ <table><tr><td>Temperature T</td><td>mIoU(%)</td></tr><tr><td>1</td><td>77.1(77.0)</td></tr><tr><td>0.1</td><td>78.2(77.5)</td></tr><tr><td>0.01</td><td>78.1(77.5)</td></tr></table>
557
+
558
+ 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.
559
+
560
+ ![](images/ee93b30769d5d4762b9066b623172a18833ce1847f0d1ae8d6a1d369d1da547a.jpg)
561
+ Figure 7: Impacts of $K$ on NMF
562
+
563
+ ![](images/914e4316a63ddbfbb8243122ca075bd60a7f09d19f7433ae36ae010d149f63ee.jpg)
564
+ Figure 8: Impacts of $K$ on CD
565
+
566
+ ![](images/f53bad29ad9f09cc2f2d4a29c77f9f785dc4c10e87d76b8c8c8480e7eb9930bb.jpg)
567
+ Figure 9: Impacts of $K$ on VQ
568
+
569
+ # G AN INTUITIVE ILLUSTRATION
570
+
571
+ 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.
572
+
573
+ 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.
574
+
575
+ 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.
md/train/1NRMmEUyXMu/1NRMmEUyXMu.md ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WORLD MODEL AS A GRAPH: LEARNING LATENT LANDMARKS FOR PLANNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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.
14
+
15
+ ![](images/fc89e2710a4a54f0265190691ecc10f0fb1f19e49d0f207212d299f8609bb3b3.jpg)
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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 )$ .
21
+
22
+ 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/.
23
+
24
+ # 2 RELATED WORKS
25
+
26
+ 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.
27
+
28
+ 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.
29
+
30
+ 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.
31
+
32
+ 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.
33
+
34
+ # 3 BACKGROUND
35
+
36
+ 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$ .
37
+
38
+ 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:
39
+
40
+ $$
41
+ \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}
42
+ $$
43
+
44
+ ![](images/0a41fb1435dbfa5edad54c79fe7a3109308ca9fe4d3d4f7764111a5c7235c938.jpg)
45
+ 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.
46
+
47
+ # 4 THE $L ^ { 3 } P$ ALGORITHM
48
+
49
+ 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.
50
+
51
+ # 4.1 LEARNING A LATENT SPACE
52
+
53
+ 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:
54
+
55
+ $$
56
+ \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 }
57
+ $$
58
+
59
+ 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.
60
+
61
+ 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:
62
+
63
+ $$
64
+ 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 }
65
+ $$
66
+
67
+ 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
68
+
69
+ 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.
70
+
71
+ 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
72
+
73
+ $$
74
+ \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 }
75
+ $$
76
+
77
+ 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.
78
+
79
+ The estimates $D$ and $V$ will prove useful beyond helping to optimize the auto-encoder in Equation 2.
80
+ They will prove essential in weighting and planning over latent landmark nodes in Section 4.3.
81
+
82
+ # 4.2 LEARNING LATENT LANDMARKS
83
+
84
+ 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.
85
+
86
+ 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 } )$ :
87
+
88
+ $$
89
+ \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 )
90
+ $$
91
+
92
+ 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.
93
+
94
+ # 4.3 PLANNING WITH LATENT LANDMARKS
95
+
96
+ 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).
97
+
98
+ 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 }$ :
99
+
100
+ $$
101
+ 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)
102
+ $$
103
+
104
+ ![](images/e20f37d59080eae85d0785eca9e35e6ecc1b649a502f71dd657b20f2dfd3e839.jpg)
105
+ 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.
106
+
107
+ # Algorithm 1 Online Planning in $L ^ { 3 } P$
108
+
109
+ Given: Environment env, initial state $s$ , goal $g$
110
+
111
+ 1: $\mathrm { { C n t } = 0 }$ . Sub $\Game = \mathbb { N } \mathrm { o n e }$ .
112
+ 2: Solve for $d _ { c g }$ with graph search.
113
+ 3: for $t = 1$ to $T$ do $\triangleright$ One episode
114
+ 4: if Cnt $\geq 1 . 0$ then
115
+ 5: $\mathtt { C n t } = \mathtt { C n t } - 1$
116
+ 6: else . We do not re-plan at every step
117
+ 7: Calculate ds→c.
118
+ 8: d ← ds→c + dc→g
119
+ 9: if SubG 6= None then
120
+ 10: $d [ \mathrm { { S u b G } ] - \infty }$
121
+ 11: end if . Remove the immediate
122
+ previous landmark
123
+ 12: SubG, Cnt ← arg max d, − max d
124
+ 13: end if
125
+ 14: $a \sim \pi ( s , \mathtt { S u b G } )$ ; $s \gets \in \mathrm { n v }$ .step(a).
126
+ 15: end for
127
+
128
+ 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 }$ :
129
+
130
+ $$
131
+ \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}
132
+ $$
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ # 5 EXPERIMENTS AND EVALUATION
141
+
142
+ 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/.
143
+
144
+ # 5.1 BASELINES
145
+
146
+ 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
147
+
148
+ ![](images/bec23b0313e19e55e85b3079d8367c149af772360022bd08c196c5aab0b4b36b.jpg)
149
+ 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.
150
+
151
+ ![](images/d52222af0cdce0ccad0418ef8fcfd06994f1e7eb1314d998812057ab5fc30789.jpg)
152
+ 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.
153
+
154
+ ![](images/aa4fc5de2e28f82b4caabbd147494c37f7e6fc86d1397c5c8078564fb1e8e331.jpg)
155
+ 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.
156
+
157
+ 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.
158
+
159
+ # 5.2 GENERALIZATION TO LONGER HORIZONS
160
+
161
+ 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.
162
+
163
+ 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.
164
+
165
+ # 5.3 ROBOTIC MANIPULATION TASKS
166
+
167
+ 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.
168
+
169
+ # 5.4 UNDERSTANDING MODEL CHOICES IN $L ^ { 3 } P$
170
+
171
+ 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).
172
+
173
+ 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.
174
+
175
+ ![](images/2e1eef2cccff8c3c18dd0eea9a85e82139b362cdc85639a6eb0c9e6466adbac7.jpg)
176
+
177
+ ![](images/5bdde49e76890351e2b87757f303eea29eb216f9b954e0a9f8a05f5646d92ec8.jpg)
178
+
179
+ 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
180
+
181
+ 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$ .
182
+
183
+ 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
184
+
185
+ ![](images/372919bab33755431b83ce4c989a6cc32cd38f0f1fe2defd8cbb3210e10bc306.jpg)
186
+
187
+ Equation 7 improves robustness. We therefore use soft relaxation in our graph search module.
188
+
189
+ ![](images/d520da3f3efcfe0c5b00628b12ce50a1ef52c72206097bc4528762e31eb9622f.jpg)
190
+
191
+ 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
192
+
193
+ 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.
194
+
195
+ # 6 CLOSING REMARKS
196
+
197
+ 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.
198
+
199
+ # REFERENCES
200
+
201
+ 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.
202
+
203
+ David Arthur and Sergei Vassilvitskii. k-means $^ { + + }$ : The advantages of careful seeding. Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 2007.
204
+
205
+ Dane Corneil, Wulfram Gerstner, and Johanni Brea. Efficient model-based deep reinforcement learning with variational state tabulation. arXiv preprint arXiv:1802.04325, 2018.
206
+
207
+ Remi Coulom. Efficient selectivity and backup operators in monte-carlo tree search. In ´ International conference on computers and games, pp. 72–83. Springer, 2006.
208
+
209
+ Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in neural information processing systems, pp. 271–278, 1993.
210
+
211
+ Edsger W Dijkstra et al. A note on two problems in connexion with graphs. Numerische mathematik, 1(1):269–271, 1959.
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ Hugh Durrant-Whyte and Tim Bailey. Simultaneous localization and mapping: part i. IEEE robotics & automation magazine, 13(2):99–110, 2006.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems, pp. 2450–2462, 2018.
226
+
227
+ 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.
228
+
229
+ Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ 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.
238
+
239
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
240
+
241
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
242
+
243
+ Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. arXiv preprint arXiv:1802.10592, 2018.
244
+
245
+ 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.
246
+
247
+ Steven M LaValle. Rapidly-exploring random trees: A new tool for path planning. 1998.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ 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.
266
+
267
+ 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.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ 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.
276
+
277
+ Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. arXiv preprint arXiv:1803.00653, 2018a.
278
+
279
+ 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.
280
+
281
+ 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.
282
+
283
+ 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.
284
+
285
+ Aravind Srinivas, Allan Jabri, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Universal planning networks. April 2018. URL http://arxiv.org/abs/1804.00645.
286
+
287
+ Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160–163, 1991.
288
+
289
+ Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. February 2016. URL http://arxiv.org/abs/1602.02867.
290
+
291
+ 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.
292
+
293
+ Ranxiao Frances Wang and Elizabeth S Spelke. Human spatial representation: Insights from animals. Trends in cognitive sciences, 6(9):376–382, 2002.
294
+
295
+ Tingwu Wang and Jimmy Ba. Exploring model-based planning with policy networks. arXiv preprint arXiv:1906.08649, 2019.
296
+
297
+ Yang Wang, David Mulvaney, Ian Sillitoe, and Erick Swere. Robot navigation by waypoints. Journal of Intelligent and Robotic Systems, 52(2):175–207, 2008.
298
+
299
+ 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.
300
+
301
+ Rui Zhao, Xudong Sun, and Volker Tresp. Maximum entropy-regularized multi-goal reinforcement learning. arXiv preprint arXiv:1905.08786, 2019.
302
+
303
+ # A APPENDIX
304
+
305
+ A.1 GREEDY LATENT SPARSIFICATION
306
+
307
+ Algorithm 2 Greedy Latent Sparsification (GLS) for Latent Cluster Training Given: Replay Buffer $B$ , Encoder $f _ { E }$ .
308
+ Initialize: LatentEmbeds $= \{ \}$ . $\triangleright$ Set of embeddings selected. 1: Sample $K$ achieved goals from $B$ .
309
+ 2: Sample $k \sim \{ 0 \cdots K - 1 \}$ .
310
+ 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 } ]$
311
+ 4: for $\mathrm { i } = 1$ to $M$ do . Sub-sampling 5: $k $ arg max dist $[ k ]$
312
+ 6: Add $f _ { E } ( g _ { k } )$ to LatentEmbeds.
313
+ 7: NEWdist = [kfE(g1) − fE(gk)k22, · · · , kfE(gK ) − fE(gk)k22] 8: dist = ElementwiseMin(dist, NEWdist)
314
+ 9: end for
315
+ 10: Optimize equation 5 on LatentEmbeds.
316
+
317
+ 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.
318
+
319
+ # A.2 GRAPH SEARCH VIA SOFT VALUE ITERATIONS
320
+
321
+ 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$ :
322
+
323
+ $$
324
+ 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 )
325
+ $$
326
+
327
+ 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$ .
328
+
329
+ # A.3 HYPER-PARAMETERS
330
+
331
+ Table 1 lists the common hyper-parameters across all environments. Table 2 lists the hyper-parameters that differ across the environments.
332
+
333
+ Table 1: Hyper-parameters in Common
334
+
335
+ <table><tr><td rowspan=1 colspan=2>Parameter</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=2 colspan=2>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</td><td rowspan=2 colspan=1>Adam (Kingma &amp; Ba, 2014)3256ReLU0.9951020.21000.85</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=2>LatentLandmarks&amp;Auto-encodernumber of hidden layersnumber of hidden units per layernonlinearityembedding size入 for reachability constraint losslearning rate</td><td rowspan=1 colspan=1>2128ReLU161.03e-4</td></tr><tr><td rowspan=1 colspan=2>Graph Searchprobability of using search during trainS (number of soft value iterations)β (temperature)</td><td rowspan=1 colspan=1>0.5201.1</td></tr></table>
336
+
337
+ Table 2: Hyper-parameters for Each Environment
338
+
339
+ <table><tr><td colspan="4">Point-Maze Ant-Maze</td></tr><tr><td colspan="4">DDPG</td></tr><tr><td>Learning rate</td><td>2e-4</td><td>2e-4</td><td>1e-3 12</td></tr><tr><td>Number of workers Batch size</td><td>1 512</td><td>3 1024</td><td>1024</td></tr><tr><td>Action L2</td><td>0.5</td><td>0.05</td><td>0.01</td></tr><tr><td>Gamma</td><td>0.98</td><td>0.98</td><td>0.99</td></tr><tr><td>Action noise</td><td>0.2</td><td>0.2</td><td>0.1</td></tr><tr><td>Hindsight relabelling range</td><td>80</td><td>100</td><td>50</td></tr><tr><td colspan="4">LatentLandmarks&amp;Auto-encoder</td></tr><tr><td>Number of latent landmarks</td><td>50</td><td>50</td><td>80</td></tr><tr><td>Number of warm-up trajectories</td><td>500</td><td>500</td><td>6000</td></tr><tr><td>Batch size</td><td>256</td><td>256</td><td>150</td></tr><tr><td colspan="4">Graph Search</td></tr><tr><td>d_max (clipping threshold for distances)</td><td>20.0</td><td>20.0</td><td>15.0</td></tr><tr><td>Random landmarks added during train</td><td>150</td><td>150</td><td>20</td></tr></table>
340
+
341
+ • 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.
342
+ • 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.
343
+ • 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.
344
+ • 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.
345
+ • 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.
346
+ • 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.
md/train/4ADnf1HqIw/4ADnf1HqIw.md ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RECOVERING GEOMETRIC INFORMATION WITH LEARNED TEXTURE PERTURBATIONS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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,
14
+
15
+ ![](images/79a804f0124468ef4e6a9fe55b18317d99f7b14de605f58baf6dd5a08c1976fa.jpg)
16
+ Figure 1: Texture coordinate perturbations (texture sliding) reduce shape inference errors: ground truth (blue), prediction (orange).
17
+
18
+ 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.
19
+
20
+ # 2 RELATED WORK
21
+
22
+ 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.
23
+
24
+ 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.
25
+
26
+ 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.
27
+
28
+ # 3 METHODS
29
+
30
+ 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).
31
+
32
+ # 3.1 PER-VERTEX DISCRETIZATION
33
+
34
+ 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.
35
+
36
+ # 3.2 OCCLUSION BOUNDARIES
37
+
38
+ 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.
39
+
40
+ 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.
41
+
42
+ 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.
43
+
44
+ ![](images/47a196c273e9aa682c6bee758706eb32492fd79cda3ce96a6ba88b4407d280ae.jpg)
45
+ 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.
46
+
47
+ ![](images/de59135574e088fa0afd885bee8ce13fa02c2e074e0351ccbf2d00d5016e0b30.jpg)
48
+ 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.
49
+
50
+ # 4 DATASET GENERATION
51
+
52
+ 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 }$ .
53
+
54
+ # 4.1 TEXTURE COORDINATE PROJECTION
55
+
56
+ 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
57
+
58
+ ![](images/56fb176a45fa938a8c55767c489f14b57097f75ef4cdd2462651d56eb3a9bcb8.jpg)
59
+ 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).
60
+
61
+ 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.
62
+
63
+ # 4.2 OCCLUSION HANDLING
64
+
65
+ 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.
66
+
67
+ # 5 NETWORK ARCHITECTURE
68
+
69
+ 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
70
+
71
+ $$
72
+ \mathcal { L } = \sum _ { \theta _ { k } } \left\| d ( \theta _ { k } ) - \hat { d } ( \theta _ { k } ) \right\| _ { 2 }
73
+ $$
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ ![](images/9e306de003140dc465ee4ae95d94c09aebd5118620d5916eaf92ba8e415c2f03.jpg)
80
+ Figure 5: Texture sliding neural network (TSNN) architecture.
81
+
82
+ # 6 EXPERIMENTS
83
+
84
+ 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.
85
+
86
+ # 6.1 DATASET GENERATION AND EVALUATION
87
+
88
+ 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.
89
+
90
+ 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.
91
+
92
+ ![](images/bdd09486dc99aa9180b7c90a45ea0c7367cf5b4131aaea3c4a01b760381931f3.jpg)
93
+ 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$ .
94
+ 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.
95
+
96
+ 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.
97
+
98
+ Table 1: Per-pixel square root of mean squared error (SqrtMSE) for the entire dataset.
99
+
100
+ <table><tr><td>Method</td><td>SqrtMSE(×10 3)</td></tr><tr><td>Jin et al. (2020) TS</td><td>24.496± 6.9536 5.2662 士 2.2320</td></tr><tr><td>TS + subdivision</td><td>3.5645 士 1.6617</td></tr></table>
101
+
102
+ ![](images/0c3c4b1bd921cf9107768c114ae5a65533824ad221bea6329562849531e22d37.jpg)
103
+ 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).
104
+
105
+ # 6.2 NETWORK TRAINING AND INFERENCE
106
+
107
+ 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.
108
+
109
+ ![](images/3a7a92b8f85c7a579b5b089b076f55866819350f15679609d4739df824a608be.jpg)
110
+ 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 )$
111
+
112
+ 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).
113
+
114
+ <table><tr><td>Network</td><td>SqrtMSE(×10 3)</td></tr><tr><td>Jin et al. (2020) TSNN TSNN + subdivision</td><td>24.871 士 7.0613 13.335 士 4.2924 13.591 士 4.5194</td></tr></table>
115
+
116
+ ![](images/c8dae848133996a47f9138c35e7c50979ab6241bc33e5f1d4e0947dbb64791fd.jpg)
117
+ 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).
118
+
119
+ # 6.3 INTERPOLATING TO NOVEL VIEWS
120
+
121
+ 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.
122
+
123
+ ![](images/6de0acdd83fbc9e7759da7754f67ab8526571b785efab23be4d0a91a51b9dfa5.jpg)
124
+ 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.
125
+
126
+ # 6.4 3D RECONSTRUCTION
127
+
128
+ 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.
129
+
130
+ 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.
131
+
132
+ ![](images/1281c26ee6e0281e4d9b474c8b6765b996c4823aae8ad5d1bba5d24e400f3018.jpg)
133
+ Figure 12: The ground truth (a) and inferred cloth (b) compared to the 3D reconstructions obtained using texture sliding (c) and the TSNN (d).
134
+ Figure 13: Per-pixel errors (top) and local compression/extension energies (bottom) for Figure $1 2 \mathrm { c }$ (a) and Figure 12d (b).
135
+
136
+ # 7 DISCUSSION AND FUTURE WORK
137
+
138
+ 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)).
139
+
140
+ 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.
141
+
142
+ 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).
143
+
144
+ # REFERENCES
145
+
146
+ 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.
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ 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.
153
+
154
+ 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.
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ David Baraff, Andrew Witkin, and Michael Kass. Untangling cloth. In ACM Transactions on Graphics (TOG), volume 22, pp. 862–870. ACM, 2003.
161
+
162
+ 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.
163
+
164
+ 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.
165
+
166
+ 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.
167
+
168
+ 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.
169
+
170
+ 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.
171
+
172
+ 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.
173
+
174
+ 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.
175
+
176
+ 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.
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ Zhenglin Geng, Daniel Johnson, and Ronald Fedkiw. Coercing machine learning to output physically accurate results. Journal of Computational Physics, 406:109099, 2020.
183
+
184
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ 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.
193
+
194
+ Richard I Hartley and Peter Sturm. Triangulation. Computer vision and image understanding, 68(2): 146–157, 1997.
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ Ron Kimmel and James A Sethian. Computing geodesic paths on manifolds. Proceedings of the national academy of Sciences, 95(15):8431–8435, 1998.
201
+
202
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ 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.
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
215
+
216
+ 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.
217
+
218
+ 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.
219
+
220
+ 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.
221
+
222
+ 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.
223
+
224
+ 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.
225
+
226
+ Stanley Osher and Ronald Fedkiw. Level Set Methods and Dynamic Implicit Surfaces. Springer, New York, 2002.
227
+
228
+ 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.
229
+
230
+ 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.
231
+
232
+ 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.
233
+
234
+ 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.
235
+
236
+ 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.
237
+
238
+ 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.
239
+
240
+ 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.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ 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.
247
+
248
+ 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.
249
+
250
+ Bernhard Scholkopf and Alexander J Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2001.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ 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.
265
+
266
+ 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.
267
+
268
+ 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.
269
+
270
+ 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.
271
+
272
+ 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.
273
+
274
+ 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.
275
+
276
+ 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.
md/train/4G2dEuRZ7eO/4G2dEuRZ7eO.md ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Progressive Coordinate Transforms for Monocular 3D Object Detection
2
+
3
+ Li Wang1∗ Li Zhang1† Yi Zhu2 Zhi Zhang2 Tong He2 Mu Li2 Xiangyang Xue1 1Fudan University 2Amazon Inc.
4
+
5
+ # Abstract
6
+
7
+ 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.
8
+
9
+ # 1 Introduction
10
+
11
+ 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.
12
+
13
+ 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?
14
+
15
+ 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.
16
+
17
+ <table><tr><td rowspan="2">Factor</td><td colspan="3">PatchNet*[AP3D/APBEV]</td><td colspan="3">Pseudo-LiDAR*[AP3D/APBEv]</td></tr><tr><td>Mod.</td><td>Easy</td><td>Hard</td><td>Mod.</td><td>Easy</td><td>Hard</td></tr><tr><td>Baseline</td><td>26.31/34.14</td><td>36.40/46.80</td><td>21.07/28.04</td><td>23.04/31.06</td><td>32.27/42.45</td><td>19.67/25.67</td></tr><tr><td>dimension</td><td>27.26/34.62</td><td>40.32/47.24</td><td>24.29/28.38</td><td>25.88/31.97</td><td>36.09/44.35</td><td>20.88/26.60</td></tr><tr><td>rotation</td><td>26.25/34.04</td><td>36.09/46.25</td><td>23.49/27.99</td><td>23.88/31.31</td><td>32.42/42.74</td><td>19.85/26.07</td></tr><tr><td>X</td><td>32.80/41.43</td><td>45.60/56.22</td><td>27.38/34.63</td><td>28.36/36.77</td><td>39.69/50.78</td><td>25.08/29.92</td></tr><tr><td>y</td><td>30.16/34.14</td><td>40.94/46.80</td><td>24.58/28.04</td><td>25.53/31.06</td><td>35.19/42.45</td><td>20.69/25.67</td></tr><tr><td>Z</td><td>42.42/53.48</td><td>55.42/68.29</td><td>35.54/45.60</td><td>38.37/50.81</td><td>50.04/63.96</td><td>32.24/43.32</td></tr><tr><td>location(xyz)</td><td>72.58/75.27</td><td>81.41/85.14</td><td>57.69/66.10</td><td>64.36/73.37</td><td>79.13/83.77</td><td>55.64/58.27</td></tr></table>
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ # 2 Related work
26
+
27
+ # 2.1 Monocular 3D object detection
28
+
29
+ Existing paradigms for monocular 3D object detection can be categorized into two types: image-only methods and depth-assisted methods.
30
+
31
+ 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.
32
+
33
+ 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.
34
+
35
+ # 2.2 Gradient boosting
36
+
37
+ 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].
38
+
39
+ 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.
40
+
41
+ # 3 Background
42
+
43
+ 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:
44
+
45
+ 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 )$ .
46
+
47
+ ![](images/7300362b1ae21126e252898156e0cc2a3864d52b7ebabd1472089dd56a29c819.jpg)
48
+ 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.
49
+
50
+ 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 )$ .
51
+
52
+ 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
53
+
54
+ $$
55
+ 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
56
+ $$
57
+
58
+ 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.
59
+
60
+ 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.
61
+
62
+ 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.
63
+
64
+ # 4 Method
65
+
66
+ 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).
67
+
68
+ # 4.1 Confidence-aware localization boosting
69
+
70
+ 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?
71
+
72
+ 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
73
+
74
+ ![](images/9523a01cc930e55907dce22cf2a7d99cd0709e1b67369f64a9b03e5aa9e5b4bd.jpg)
75
+ 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.
76
+
77
+ optimization can be formulated as
78
+
79
+ $$
80
+ \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}
81
+ $$
82
+
83
+ 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,
84
+
85
+ $$
86
+ \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 } ) .
87
+ $$
88
+
89
+ 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.
90
+
91
+ Thus the risk at stage $t$ can be written as,
92
+
93
+ $$
94
+ \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 } ) )
95
+ $$
96
+
97
+ 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 } )$ .
98
+
99
+ 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.
100
+
101
+ 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
102
+
103
+ $$
104
+ \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 } ) ,
105
+ $$
106
+
107
+ 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.
108
+
109
+ # 4.2 Global context encoding
110
+
111
+ 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.
112
+
113
+ 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 }$ .
114
+
115
+ 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.
116
+
117
+ # 5 Experiments
118
+
119
+ 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.
120
+
121
+ # 5.1 KITTI setup
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ <table><tr><td rowspan="2">Group</td><td rowspan="2">Localization Boosting</td><td rowspan="2">Uncertainty</td><td rowspan="2">GCE</td><td colspan="3">AP3D</td><td colspan="3">APBEV</td></tr><tr><td>Mod.</td><td>Easy</td><td>Hard</td><td>Mod.</td><td>Easy</td><td>Hard</td></tr><tr><td>I</td><td>-</td><td>-</td><td>1</td><td>25.88</td><td>36.07</td><td>20.99</td><td>33.34</td><td>46.39</td><td>27.54</td></tr><tr><td>Ⅱ</td><td>√</td><td></td><td>1</td><td>26.78</td><td>37.29</td><td>24.11</td><td>34.39</td><td>47.08</td><td>28.28</td></tr><tr><td>Ⅲ</td><td>√</td><td>√</td><td>=</td><td>27.24</td><td>38.32</td><td>24.39</td><td>33.92</td><td>46.77</td><td>27.98</td></tr><tr><td>IV</td><td>√</td><td></td><td></td><td>27.12</td><td>37.38</td><td>24.11</td><td>34.46</td><td>46.70</td><td>28.32</td></tr><tr><td>V</td><td>√</td><td>√</td><td></td><td>27.53</td><td>38.39</td><td>24.44</td><td>34.65</td><td>47.16</td><td>28.47</td></tr></table>
128
+
129
+ 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.
130
+
131
+ # 5.2 Waymo setup
132
+
133
+ 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.
134
+
135
+ 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.
136
+
137
+ # 5.3 Implementation details
138
+
139
+ 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
140
+
141
+ ![](images/e1d29ed86083cfdcecf02e52932d516313e169150f98e7200986c3955e7caf75.jpg)
142
+ 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.
143
+
144
+ GPU with 16G memory. The training criterion for network $F$ and $G$ and other training settings follow the corresponding base methods for fair comparison.
145
+
146
+ # 5.4 Method analysis on KITTI dataset
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ Table 3: Comparison of different boosting iteration settings on KITTI validation split set.
153
+
154
+ <table><tr><td rowspan="2">Localization Boost (T)</td><td colspan="3">AP3D/APBEV</td></tr><tr><td>Mod.</td><td>Easy</td><td>Hard</td></tr><tr><td>1</td><td>25.88/33.34</td><td>36.07/46.39</td><td>20.99/27.54</td></tr><tr><td>1</td><td>26.31/34.14</td><td>36.40/46.80</td><td>21.07/28.04</td></tr><tr><td>2</td><td>26.69/34.06</td><td>37.17/46.42</td><td>24.04/28.03</td></tr><tr><td>3</td><td>26.78/34.39</td><td>37.29/47.08</td><td>24.11/28.28</td></tr><tr><td>4</td><td>26.77/34.21</td><td>37.12/47.00</td><td>23.48/28.23</td></tr><tr><td>5</td><td>26.64/34.43</td><td>37.24/47.04</td><td>23.89/28.27</td></tr></table>
155
+
156
+ Table 4: Evaluation of different coordinate feature fusion with GCE on KITTI validation set. Baseline is the Group (II) in Table 2.
157
+
158
+ <table><tr><td>Method</td><td colspan="3">AP3D</td></tr><tr><td>Baseline</td><td>Mod. 26.78</td><td>Easy 37.29</td><td>Hard 24.11</td></tr><tr><td>F+GCE</td><td>27.08</td><td>37.33</td><td>24.07</td></tr><tr><td>G+GCE</td><td>27.12</td><td>37.38</td><td>24.11</td></tr><tr><td>All + GCE</td><td>27.07</td><td>37.43</td><td>24.18</td></tr></table>
159
+
160
+ 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.
161
+
162
+ 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.
163
+
164
+ ![](images/c1f84afe258a114f12040dbc85530e9d69baa6299bc5ce42f2def65beeebaa14.jpg)
165
+ 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.
166
+
167
+ Table 5: Comparison of generalization on KITTI validation set. $^ *$ denotes that the method is reproduced by ourselves.
168
+
169
+ <table><tr><td rowspan="2">Method</td><td colspan="3">AP3D</td><td colspan="3">APBEV</td></tr><tr><td>Mod.</td><td>Easy</td><td>Hard</td><td>Mod.</td><td>Easy</td><td>Hard</td></tr><tr><td>Pseudo-LiDAR*[42]</td><td>23.04</td><td>32.27</td><td>19.67</td><td>31.06</td><td>42.45</td><td>25.67</td></tr><tr><td>Pseudo-LiDAR+ CLB</td><td>24.14</td><td>34.46</td><td>20.16</td><td>32.41</td><td>44.98</td><td>26.82</td></tr><tr><td>Pseudo-LiDAR + CLB +GCE</td><td>24.43</td><td>34.34</td><td>20.18</td><td>32.50</td><td>45.35</td><td>26.91</td></tr></table>
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Depth</td><td rowspan="2">Type</td><td colspan="3">AP3D</td><td colspan="3">APBEV</td></tr><tr><td>Mod.</td><td>Easy</td><td>Hard</td><td>Mod.</td><td>Easy</td><td>Hard</td></tr><tr><td>AM3D [29]</td><td>yes</td><td>Coordinate</td><td>10.74</td><td>16.50</td><td>9.52</td><td>17.32</td><td>25.30</td><td>14.91</td></tr><tr><td>PatchNet [27]</td><td>yes</td><td>Coordinate</td><td>11.12</td><td>15.68</td><td>10.17</td><td>16.86</td><td>22.97</td><td>14.97</td></tr><tr><td>GrooMeD-NMS[20]</td><td>no</td><td>Pixel</td><td>12.32</td><td>18.10</td><td>9.65</td><td>18.27</td><td>26.19</td><td>14.05</td></tr><tr><td>Kinematic3D[3]</td><td>yes</td><td>Pixel</td><td>12.72</td><td>19.07</td><td>9.17</td><td>17.52</td><td>26.69</td><td>13.10</td></tr><tr><td>DDMP-3D[41]</td><td>yes</td><td>Pixel</td><td>12.78</td><td>19.71</td><td>9.80</td><td>17.89</td><td>28.08</td><td>13.44</td></tr><tr><td>Liu et al. [26]</td><td>yes</td><td>Pixel</td><td>13.25</td><td>21.65</td><td>9.91</td><td>17.98</td><td>29.81</td><td>13.08</td></tr><tr><td>PCT</td><td>yes</td><td>Coordinate</td><td>13.37</td><td>21.00</td><td>11.31</td><td>19.03</td><td>29.65</td><td>15.92</td></tr></table>
182
+
183
+ # 5.5 Results on Waymo Open Dataset
184
+
185
+ 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.
186
+
187
+ 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.
188
+
189
+ <table><tr><td rowspan="2">Difficulty</td><td rowspan="2">Threshold</td><td rowspan="2">Method</td><td colspan="4">3D mAP/3D mAPH</td></tr><tr><td>Overall</td><td>0-30m</td><td>30-50m</td><td>50-8</td></tr><tr><td rowspan="3">LEVEL_1</td><td>IoU=0.7</td><td>PatchNet PCT</td><td>0.39/0.37 0.89 / 0.88</td><td>1.67 / 1.63 3.18 / 3.15</td><td>0.13/0.12</td><td>0.03/0.03 0.07 /0.07</td></tr><tr><td rowspan="2">IoU=0.5</td><td>PatchNet</td><td>2.92/2.74</td><td>10.03/9.75</td><td>0.27 / 0.27 1.09/ 0.96</td><td>0.23/0.18</td></tr><tr><td>PCT</td><td>4.20 /4.15</td><td>14.70 / 14.54</td><td>1.78 / 1.75</td><td>0.39 / 0.39</td></tr><tr><td rowspan="3">LEVEL_2</td><td>IoU=0.7</td><td>PatchNet</td><td>0.38/0.36</td><td>1.67 / 1.63</td><td>0.13/0.11</td><td>0.03/0.03</td></tr><tr><td rowspan="2">IoU=0.5</td><td>PCT PatchNet</td><td>0.66 / 0.66</td><td>3.18 /3.15</td><td>0.27 /0.26</td><td>0.07 /0.07</td></tr><tr><td></td><td>2.42/2.28</td><td>10.01/9.73</td><td>1.07 /0.94</td><td>0.22/0.16</td></tr><tr><td></td><td></td><td>PCT</td><td>4.03 /3.99</td><td>14.67 / 14.51</td><td>1.74 / 1.71</td><td>0.36 / 0.35</td></tr></table>
190
+
191
+ # 6 Conclusions
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ 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.
198
+
199
+ # Acknowledgments
200
+
201
+ This work was supported by Shanghai Municipal Science and Technology Major Projects (No.2021SHZDZX0103 and No.2018SHZDZX01).
202
+
203
+ # References
204
+
205
+ [1] Shariq Farooq Bhat, Ibraheem Alhashim, and Peter Wonka. Adabins: Depth estimation using adaptive bins. In CVPR, 2021.
206
+ [2] Garrick Brazil and Xiaoming Liu. M3d-rpn: Monocular 3d region proposal network for object detection. In ICCV, 2019.
207
+ [3] Garrick Brazil, Gerard Pons-Moll, Xiaoming Liu, and Bernt Schiele. Kinematic 3d object detection in monocular video. arXiv preprint, 2020.
208
+ [4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
209
+ [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.
210
+ [6] Yongjian Chen, Lei Tai, Kai Sun, and Mingyang Li. Monopair: Monocular 3d object detection using pairwise spatial relationships. In CVPR, 2020.
211
+ [7] Corinna Cortes, Mehryar Mohri, and Umar Syed. Deep boosting. In ICML, 2014.
212
+ [8] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017.
213
+ [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.
214
+ [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.
215
+ [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.
216
+ [12] Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, 2001.
217
+ [13] Jerome H Friedman. Stochastic gradient boosting. Computational statistics & data analysis, 2002.
218
+ [14] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In CVPR, 2018.
219
+ [15] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. http://www.cvlibs. net/datasets/kitti/eval_object.php?obj_benchmark $\cdot ^ { = }$ 3d. 2013.
220
+ [16] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. IJRR, 2013.
221
+ [17] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, 2012.
222
+ [18] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017.
223
+ [19] Nikolaos Karianakis, Thomas J Fuchs, and Stefano Soatto. Boosting convolutional features for robust object proposals. arXiv preprint, 2015.
224
+ [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.
225
+ [21] Haoxiang Li, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Gang Hua. Efficient boosted exemplar-based face detection. In CVPR, 2014.
226
+ [22] Haoxiang Li, Zhe Lin, Xiaohui Shen, Jonathan Brandt, and Gang Hua. A convolutional neural network cascade for face detection. In CVPR, 2015.
227
+ [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.
228
+ [24] Xuchun Li, Lei Wang, and Eric Sung. A study of adaboost with svm based weak learners. In IJCNN, 2005.
229
+ [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.
230
+ [26] Y. Liu, Y. Yuan, and M. Liu. Ground-aware monocular 3d object detection for autonomous driving. IEEE Robotics and Automation Letters, 2021.
231
+ [27] Xinzhu Ma, Shinan Liu, Zhiyi Xia, Hongwen Zhang, Xingyu Zeng, and Wanli Ouyang. Rethinking pseudo-lidar representation. In ECCV, 2020.
232
+ [28] Xinzhu Ma, Shinan Liu, Zhiyi Xia, Hongwen Zhang, Xingyu Zeng, and Wanli Ouyang. https: //github.com/xinzhuma/patchnet. 2020.
233
+ [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.
234
+ [30] Arsalan Mousavian, Dragomir Anguelov, John Flynn, and Jana Kosecka. 3d bounding box estimation using deep learning and geometry. In CVPR, 2017.
235
+ [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.
236
+ [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.
237
+ [33] Cody Reading, Ali Harakeh, Julia Chae, and Steven L. Waslander. Categorical depth distributionnetwork for monocular 3d object detection. In CVPR, 2021.
238
+ [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.
239
+ [35] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. In CVPR, 2019.
240
+ [36] Xuepeng Shi, Zhixiang Chen, and Tae-Kyun Kim. Distance-normalized unified representation for monocular 3d object detection. In ECCV, 2020.
241
+ [37] Jeany Son, Ilchae Jung, Kayoung Park, and Bohyung Han. Tracking-by-segmentation with online gradient boosting decision tree. In ICCV, 2015.
242
+ [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.
243
+ [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.
244
+ [40] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In ICCV, 2019.
245
+ [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.
246
+ [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.
247
+ [43] Xinshuo Weng and Kris Kitani. Monocular 3d object detection with pseudo-lidar point cloud. In ICCV workshops, 2019.
248
+ [44] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 2018.
249
+ [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.
250
+ [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.
251
+ [47] Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. In CVPR, 2018.
252
+ [48] Yunpeng Zhang, Jiwen Lu, and Jie Zhou. Objects are different: Flexible monocular 3d object detection. In CVPR, 2021.
253
+ [49] Xingyi Zhou, Dequan Wang, and Philipp Krähenbühl. Objects as points. arXiv preprint, 2019.
254
+ [50] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In CVPR, 2018.
255
+ [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.
256
+
257
+ # Checklist
258
+
259
+ 1. For all authors...
260
+
261
+ (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.
262
+ (b) Did you describe the limitations of your work? [Yes] See Sec. 6.
263
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Sec. 6.
264
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
265
+
266
+ 2. If you are including theoretical results...
267
+
268
+ (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]
269
+
270
+ 3. If you ran experiments...
271
+
272
+ (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.
273
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Sec. 5.3.
274
+ (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.
275
+
276
+ (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).
277
+
278
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
279
+
280
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See Sec. 5
281
+ (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)).
282
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
283
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
284
+ (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.
285
+
286
+ 5. If you used crowdsourcing or conducted research with human subjects...
287
+
288
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
289
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
290
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/5FRJWsiLRmA/5FRJWsiLRmA.md ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RESERVOIR TRANSFORMERS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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).
18
+
19
+ 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.
20
+
21
+ 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:
22
+
23
+ • 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.
24
+ • 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.
25
+ 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.
26
+ • 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.
27
+
28
+ # 2 APPROACH
29
+
30
+ 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.,
31
+
32
+ $$
33
+ \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 }
34
+ $$
35
+
36
+ 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.,
37
+
38
+ $$
39
+ \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}
40
+ $$
41
+
42
+ 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.
43
+
44
+ # 2.1 BACKGROUND
45
+
46
+ 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?
47
+
48
+ 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.
49
+
50
+ 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.
51
+
52
+ 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.
53
+
54
+ # 2.2 RESERVOIR TRANSFORMERS
55
+
56
+ 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:
57
+
58
+ • Transformer Reservoir: The standard transformer layer as described above, but with all parameters fixed after initialization, including the self-attention module.
59
+ • FFN Reservoir: A transformer-style fixed feed-forward layer without any self-attention, i.e., FFN(LayerNorm(Previous layer)) $^ +$ Previous layer.
60
+ • 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.
61
+
62
+ 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.
63
+
64
+ 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).
65
+
66
+ # 3 EVALUATION
67
+
68
+ 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.
69
+
70
+ 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:
71
+
72
+ ![](images/f12829b70f6d779da8d13c4ab6c635efbc557e9a0d0480b52615b7795f025ea3.jpg)
73
+ 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.
74
+
75
+ $$
76
+ \int _ { t = 0 } ^ { \hat { T } } \sum _ { x , y \in \mathcal { D } } g _ { t } ( f ( x ) , y )
77
+ $$
78
+
79
+ 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.
80
+
81
+ 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.
82
+
83
+ # 3.1 EXPERIMENTAL SETTINGS AND IMPLEMENTATION DETAILS
84
+
85
+ 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).
86
+
87
+ 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].
88
+
89
+ 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.
90
+
91
+ <table><tr><td>Model</td><td>#Layers</td><td>Frozen</td><td>Max BLEU</td><td>Train time until max (in hours)</td><td>Ratio</td><td># Params Trainable (Total)</td><td>Train Time each epoch (in seconds)</td></tr><tr><td rowspan="4">Transformer</td><td>6</td><td>0</td><td>34.52 ± 0.07</td><td>2.548 ± 0.06</td><td>1</td><td>26.8M</td><td>122.73 ± 1.16</td></tr><tr><td>8</td><td>0</td><td>34.59 ± 0.11</td><td>2.557 ± 0.05</td><td>1</td><td>31.1M</td><td>142.28 ± 1.87</td></tr><tr><td>10</td><td>0</td><td>34.56 ± 0.05</td><td>3.173 ± 0.04</td><td>1</td><td>35.3M</td><td>161.66 ± 1.54</td></tr><tr><td>12</td><td>0</td><td>34.29 ± 0.12</td><td>3.521 ± 0.09</td><td>1</td><td>39.5M</td><td>172.45 ± 1.98</td></tr><tr><td rowspan="4">TReservoir</td><td>6</td><td>2</td><td>34.37 ± 0.12</td><td>2.422 ± 0.03</td><td>0.95</td><td>22.6M (26.8M)</td><td>120.59 ± 1.32</td></tr><tr><td>8</td><td>2</td><td>34.80 ± 0.07</td><td>2.450 ± 0.06</td><td>0.96</td><td>26.8M (31.1M)</td><td>134.49 ± 1.76</td></tr><tr><td>10</td><td>2</td><td>34.70 ± 0.03</td><td>2.831 ± 0.05</td><td>0.89</td><td>31.1M (35.3M)</td><td>144.42 ± 1.98</td></tr><tr><td>12</td><td>2</td><td>34.78 ± 0.04</td><td>3.476 ± 0.04</td><td>0.98</td><td>35.3M (39.5M)</td><td>159.43 ± 1.67</td></tr><tr><td rowspan="4">FFN Reservoir</td><td>6</td><td>2</td><td>34.43 ± 0.15</td><td>2.120 ± 0.04</td><td>0.83</td><td>22.6M (25.8M)</td><td>107.71 ± 1.73</td></tr><tr><td>8</td><td>2</td><td>34.56 ± 0.16</td><td>2.203 ± 0.06</td><td>0.86</td><td>26.8M (29.1M)</td><td>120.07 ± 1.65</td></tr><tr><td>10</td><td>2</td><td>34.66 ± 0.02</td><td>2.493 ± 0.05</td><td>0.79</td><td>31.1M (33.3M)</td><td>130.11 ± 1.43</td></tr><tr><td>12</td><td>2</td><td>34.76 ± 0.03</td><td>3.241 ± 0.04</td><td>0.92</td><td>35.3M (37.5M)</td><td>156.32 ± 1.87</td></tr><tr><td rowspan="4">LayerDrop</td><td>6</td><td>2</td><td>34.59 ± 0.15</td><td>2.364 ± 0.08</td><td>0.92</td><td>22.6M (26.8M)</td><td>119.30 ± 1.36</td></tr><tr><td>8</td><td>2</td><td>34.58 ± 0.16</td><td>2.554 ± 0.05</td><td>0.99</td><td>26.8M (31.1M)</td><td>138.62 ± 1.44</td></tr><tr><td>10</td><td>2</td><td>34.57 ± 0.07</td><td>3.404 ± 0.06</td><td>1.07</td><td>31.1M (35.3M)</td><td>140.88 ± 1.62</td></tr><tr><td>12</td><td>2</td><td>33.65 ± 0.24</td><td>3.251 ± 0.04</td><td>0.92</td><td>35.3M (39.5M)</td><td>160.85 ± 1.49</td></tr></table>
92
+
93
+ 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.
94
+
95
+ 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).
96
+
97
+ 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).
98
+
99
+ # 4 EXPERIMENTS
100
+
101
+ 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.
102
+
103
+ # 4.1 MACHINE TRANSLATION
104
+
105
+ 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.
106
+
107
+ 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.
108
+
109
+ ![](images/90e2f338200568e105b601ef0f6d470de812574f5e1411facb2387a68f64cf2e.jpg)
110
+ 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.
111
+
112
+ ![](images/fbf8f8b964d88c1ee463d7c528fdd11742523e63086217892f8a7d6bfafcc93f.jpg)
113
+ 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.
114
+
115
+ 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).
116
+
117
+ 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.
118
+
119
+ ![](images/d4ae168b422fd5b5699ef8859159ebcc355c0e8a55b9feb4da847e6f8b55cace.jpg)
120
+ Figure 4: Downstream RoBERTa performance on SST-2 (left) and MultiNLI-matched (right).
121
+
122
+ 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.
123
+
124
+ # 4.2 LANGUAGE MODELLING
125
+
126
+ 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.
127
+
128
+ # 4.3 MASKED LANGUAGE MODEL PRETRAINING
129
+
130
+ 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).
131
+
132
+ 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.
133
+
134
+ 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.
135
+
136
+ ![](images/8dc191b8c7100f587adeeeb66439469b208ef40391084c7b050f44a7cb3a4cb5.jpg)
137
+ Figure 5: IWSLT comparison of normal v frozen v backskipped
138
+
139
+ # 4.4 BACKSKIPPING
140
+
141
+ 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.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ # 5 RELATED WORK
148
+
149
+ 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.
150
+
151
+ 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.
152
+
153
+ # 6 CONCLUSION
154
+
155
+ 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.
156
+
157
+ # REFERENCES
158
+
159
+ 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.
160
+ Alexei Baevski, Steffen Schneider, and Michael Auli. vq-wav2vec: Self-supervised learning of discrete speech representations. arXiv preprint arXiv:1910.05453, 2019.
161
+ Eric B Baum. On the capabilities of multilayer perceptrons. Journal of complexity, 4(3):193–215, 1988.
162
+ Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
163
+ Hans-Dieter Block. The perceptron: A model for brain functioning. i. Reviews of Modern Physics, 34(1):123, 1962.
164
+ 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.
165
+ A Borsellino and A Gamba. An outline of a mathematical theory of papa. Il Nuovo Cimento (1955- 1965), 20(2):221–231, 1961.
166
+ 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.
167
+ Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Freezeout: Accelerate training by progressively freezing layers. arXiv preprint arXiv:1706.04983, 2017.
168
+ 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.
169
+
170
+ 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.
171
+
172
+ 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.
173
+
174
+ 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.
175
+
176
+ 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.
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ 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.
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ 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.
193
+
194
+ Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli. Depth-adaptive transformer. arXiv preprint arXiv:1910.10073, 2019.
195
+
196
+ Joseph Enguehard, Dan Busbridge, Vitalii Zhelezniak, and Nils Hammerla. Neural language priors. arXiv preprint arXiv:1910.03492, 2019.
197
+
198
+ Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019.
199
+
200
+ Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
201
+
202
+ 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.
203
+
204
+ Claudio Gallicchio and Alessio Micheli. Echo state property of deep reservoir computing networks. Cognitive Computation, 9(3):337–350, 2017.
205
+
206
+ Claudio Gallicchio and Simone Scardapane. Deep randomized neural networks. In Recent Trends in Learning From Data, pp. 43–68. Springer, 2020.
207
+
208
+ A. Gamba, L. Gamberini, G. Palmieri, and R. Sanna. Further experiments with papa. Il Nuovo Cimento (1955-1965), 20(2):112–115, 1961.
209
+
210
+ Ankush Garg, Yuan Cao, and Qi Ge. Echo state neural machine translation. arXiv preprint arXiv:2002.11847, 2020.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. Noisy activation functions. In International conference on machine learning, pp. 3059–3068, 2016.
217
+
218
+ Fatemeh Hadaeghi, Xu He, and Herbert Jaeger. Unconventional Information Processing Systems, Novel Hardware: A Tour D’Horizon. 2017.
219
+
220
+ 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.
221
+
222
+ Guang-Bin Huang, Qin-Yu Zhu, and Chee-Kheong Siew. Extreme learning machine: theory and applications. Neurocomputing, 70(1-3):489–501, 2006.
223
+
224
+ 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.
225
+
226
+ Herbert Jaeger. Adaptive nonlinear system identification with echo state networks. In Advances in neural information processing systems, 2003.
227
+
228
+ 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.
229
+
230
+ 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.
231
+
232
+ 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.
233
+
234
+ William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
235
+
236
+ 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.
237
+
238
+ 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.
239
+
240
+ 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.
241
+
242
+ Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
243
+
244
+ Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
245
+
246
+ 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.
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ MultiMedia LLC. Large text compression benchmark. 2009.
255
+
256
+ Mantas Lukosevi ˇ cius and Herbert Jaeger. Reservoir computing approaches to recurrent neural net- ˇ work training. Computer Science Review, 3(3), 2009.
257
+
258
+ 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.
259
+
260
+ Marvin Minsky and Seymour A Papert. Perceptrons: An introduction to computational geometry. MIT press, 2017.
261
+
262
+ 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.
263
+
264
+ 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.
265
+
266
+ Deniz Oktay, Nick McGreivy, Joshua Aduol, Alex Beatson, and Ryan P Adams. Randomized automatic differentiation. arXiv preprint arXiv:2007.10412, 2020.
267
+
268
+ Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. arXiv preprint arXiv:1806.00187, 2018.
269
+
270
+ 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.
271
+
272
+ 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.
273
+
274
+ Jonathan Pilault, Jaehong Park, and Christopher Pal. On the impressive performance of randomly weighted encoders in summarization tasks. arXiv preprint arXiv:2002.09084, 2020.
275
+
276
+ 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.
277
+
278
+ Ofir Press, Noah A Smith, and Omer Levy. Improving transformer models by reordering their sublayers. arXiv preprint arXiv:1911.03864, 2019.
279
+
280
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2018.
281
+
282
+ Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pp. 1177–1184, 2008.
283
+
284
+ 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.
285
+
286
+ 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.
287
+
288
+ Anna Rogers, Olga Kovaleva, and Anna Rumshisky. A primer in bertology: What we know about how bert works. arXiv preprint arXiv:2002.12327, 2020.
289
+
290
+ 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.
291
+
292
+ 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.
293
+
294
+ 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.
295
+
296
+ Simone Scardapane and Dianhui Wang. Randomness in neural networks: an overview. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 7(2):e1200, 2017.
297
+
298
+ 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.
299
+
300
+ 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.
301
+
302
+ Roy Schwartz, Jesse Dodge, Noah A Smith, and Oren Etzioni. Green ai. arXiv preprint arXiv:1907.10597, 2019.
303
+
304
+ 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.
305
+
306
+ Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
307
+
308
+ 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.
309
+
310
+ 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.
311
+
312
+ Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv preprint arXiv:2009.06732, 2020b.
313
+
314
+ Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. arXiv preprint arXiv:1905.05950, 2019.
315
+
316
+ 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.
317
+
318
+ 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.
319
+
320
+ 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.
321
+
322
+ Sinong Wang, Belinda Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020.
323
+
324
+ John Wieting and Douwe Kiela. No training required: Exploring random encoders for sentence classification. arXiv preprint arXiv:1901.10444, 2019.
325
+
326
+ Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017.
327
+
328
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
329
+
330
+ 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.
331
+
332
+ 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.
333
+
334
+ Chiyuan Zhang, Samy Bengio, and Yoram Singer. Are all layers created equal? arXiv preprint arXiv:1902.01996, 2019.
335
+
336
+ 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.
337
+
338
+ 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.
339
+
340
+ ![](images/b02380450760b4c0b3afd0aed260a881b2948fde2eb7140d57dab6c452cac15a.jpg)
341
+ Figure 6: IWSLT comparison of different hybrid architectures with different reservoir layers.
342
+
343
+ ![](images/91e3cdb50285f6e0d0f5645a8f28b599dc264c710e34a17c857f20ebe2df2ca1.jpg)
344
+ Figure 7: IWSLT validation AUCC and test BLEU with 6-layer decoder.
345
+
346
+ A HYBRID NETWORKS AND NON-TRANSFORMER RESERVOIRS
347
+
348
+ 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.
349
+
350
+ # B DEEP DECODERS
351
+
352
+ 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.
353
+
354
+ # C FREEZING STRATEGY
355
+
356
+ 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.
357
+
358
+ 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.
359
+
360
+ <table><tr><td>Model</td><td>#Layers</td><td>Frozen</td><td>Max BLEU</td><td>Train time until max (in hours)</td><td>Ratio</td><td># Params Trainable (Total)</td><td>Train Time each epoch (in seconds)</td></tr><tr><td rowspan="4">Transformer</td><td>6</td><td>0</td><td>34.97 ± 0.05</td><td>1.984 ± 0.02</td><td>1</td><td>39.5M</td><td>177.84 ± 2.98</td></tr><tr><td>8</td><td>0</td><td>34.99 ± 0.08</td><td>2.161 ± 0.03</td><td>1</td><td>43.7M</td><td>206.59 ± 3.47</td></tr><tr><td>10</td><td>0</td><td>34.98 ± 0.04</td><td>2.345± 0.02</td><td>1</td><td>47.9M</td><td>236.72 ± 3.52</td></tr><tr><td>12</td><td>0</td><td>34.78 ± 0.11</td><td>2.535 ± 0.05</td><td>1</td><td>52.0M</td><td>265.90 ± 4.97</td></tr><tr><td rowspan="4">TReservoir</td><td>6</td><td>2</td><td>34.73 ± 0.11</td><td>1.838 ± 0.01</td><td>0.92</td><td>35.3M (39.5M)</td><td>166.11 ± 2.21</td></tr><tr><td>8</td><td>2</td><td>35.07 ± 0.05</td><td>1.912 ± 0.03</td><td>0.88</td><td>39.5M (43.7M)</td><td>190.08 ± 3.73</td></tr><tr><td>10</td><td>2</td><td>35.02 ± 0.01</td><td>1.970 ± 0.04</td><td>0.84</td><td>43.7M (47.9M)</td><td>204.42 ± 2.89</td></tr><tr><td>12</td><td>2</td><td>35.06 ± 0.02</td><td>2.429 ± 0.02</td><td>0.95</td><td>47.8M (52.0M)</td><td>236.41 ± 4.35</td></tr><tr><td rowspan="4">FFN Reservoir</td><td>6</td><td>2</td><td>34.85 ± 0.10</td><td>1.729 ± 0.03</td><td>0.87</td><td>35.3M (37.4M)</td><td>161.72 ± 2.32</td></tr><tr><td>8</td><td>2</td><td>34.99 ± 0.11</td><td>1.751 ± 0.02</td><td>0.81</td><td>39.5M (41.6M)</td><td>180.21 ± 2.68</td></tr><tr><td>10</td><td>2</td><td>34.92 ± 0.03</td><td>1.907 ± 0.02</td><td>0.81</td><td>43.7M (45.8M)</td><td>191.40 ± 2.49</td></tr><tr><td>12</td><td>2</td><td>35.16 ± 0.04</td><td>2.395 ± 0.01</td><td>0.94</td><td>47.8M (49.9M)</td><td>216.08 ± 2.57</td></tr><tr><td rowspan="4">LayerDrop</td><td>6</td><td>22</td><td>34.51 ± 0.12</td><td>1.908 ± 0.04</td><td>0.96</td><td>35.3M (39.5M)</td><td>169.62 ± 3.16</td></tr><tr><td>8</td><td></td><td>34.77 ± 0.11</td><td>2.023 ± 0.02</td><td>0.94</td><td>39.5M (43.7M)</td><td>186.71 ± 2.17</td></tr><tr><td>10</td><td>2</td><td>34.06 ± 0.05</td><td>1.912 ± 0.02</td><td>0.97</td><td>43.7M (47.9M)</td><td>205.52 ± 3.31</td></tr><tr><td>12</td><td>2</td><td>34.08 ± 0.13</td><td>2.524 ± 0.01</td><td>0.99</td><td>47.8M (52.0M)</td><td>222.45 ± 2.21</td></tr></table>
361
+
362
+ <table><tr><td>Model</td><td> # Layers</td><td>Frozen</td><td>Max BLEU</td><td>Train time until max (in hours)</td><td>Ratio</td><td># Params Trainable (Total)</td><td>Train Time each epoch (in hours)</td></tr><tr><td rowspan="4">Transformer</td><td>12</td><td>0</td><td>24.46 ± 0.04</td><td>15.15 ± 0.15</td><td>1</td><td>75.6M</td><td>0.505 ± 0.005</td></tr><tr><td>16</td><td>0</td><td>24.52 ± 0.03</td><td>16.05 ± 0.18</td><td></td><td>88.2M</td><td>0.643 ± 0.006</td></tr><tr><td>24</td><td>0</td><td>24.69 ± 0.05</td><td>17.61 ± 0.85</td><td>1</td><td>113.4M</td><td>0.877 ± 0.029</td></tr><tr><td>32</td><td>0</td><td>24.83 ± 0.04</td><td>18.42 ± 0.28</td><td>1</td><td>138.6M</td><td>1.036 ± 0.010</td></tr><tr><td rowspan="4">TReservoir</td><td>12</td><td>4</td><td>24.26 ± 0.08</td><td>14.11 ± 0.21</td><td>0.93</td><td>72.4M (75.6M)</td><td>0.472 ± 0.007</td></tr><tr><td>16</td><td>4</td><td>24.50 ± 0.05</td><td>15.25 ± 0.28</td><td>0.95</td><td>75.6M (88.2M)</td><td>0.596 ± 0.009</td></tr><tr><td>24</td><td>4</td><td>25.11 ± 0.07</td><td>15.89 ± 0.74</td><td>0.90</td><td>100.8M (113.4M)</td><td>0.776 ± 0.024</td></tr><tr><td>32</td><td>4</td><td>24.66 ± 0.04</td><td>16.38 ± 0.24</td><td>0.88</td><td>126.0M (138.6M)</td><td>0.998 ± 0.009</td></tr><tr><td rowspan="4">FFN Reservoir</td><td>12</td><td>4</td><td>24.42 ± 0.05</td><td>14.01 ± 0.09</td><td>0.92</td><td>72.4M (71.4M)</td><td>0.441 ± 0.003</td></tr><tr><td>16</td><td>4</td><td>24.65 ± 0.07</td><td>14.53 ± 0.17</td><td>0.91</td><td>75.6M (83.9M)</td><td>0.524 ± 0.006</td></tr><tr><td>24</td><td>4</td><td>24.93 ± 0.04</td><td>12.62 ± 1.53</td><td>0.71</td><td>100.8M (109.2M)</td><td>0.743 ± 0.018</td></tr><tr><td>32</td><td>4</td><td>24.98 ± 0.03</td><td>13.96 ± 0.19</td><td>0.73</td><td>126.0M (134.4M)</td><td>0.964 ± 0.007</td></tr><tr><td rowspan="4">LayerDrop</td><td>12</td><td>4</td><td>24.27 ± 0.03</td><td>14.61 ± 0.14</td><td>0.96</td><td>72.4M (75.6M)</td><td>0.489 ± 0.006</td></tr><tr><td>16</td><td>4</td><td>24.15 ± 0.06</td><td>15.55 ± 0.54</td><td>0.97</td><td>75.6M (88.2M)</td><td>0.597 ± 0.017</td></tr><tr><td>24</td><td>4</td><td>24.37 ± 0.05</td><td>16.25 ± 0.36</td><td>0.92</td><td>100.8M (113.4M)</td><td>0.823 ± 0.013</td></tr><tr><td>32</td><td>4</td><td>23.84 ± 0.03</td><td>15.27 ± 0.38</td><td>0.83</td><td>126.0M (138.6M)</td><td>1.028 ± 0.012</td></tr></table>
363
+
364
+ 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.
365
+
366
+ # D ROBERTA RESULTS
367
+
368
+ 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.
369
+
370
+ # E RESERVOIR RESULTS FOR TOTAL LAYERS
371
+
372
+ 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.
373
+
374
+ 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.
375
+
376
+ <table><tr><td>Mode1</td><td>#Layers</td><td>IWSLT-Dec2 Train time until 95% max (in hours)</td><td>Max BLEU (95%)</td><td>#Layers</td><td>IWSLT-Dec6 Train time until 95% max (in hours)</td><td>Max BLEU (95%)</td><td>#Layers</td><td>WMT-Dec1 Train time until 95% max (in hours)</td><td>Max BLEU (95%)</td></tr><tr><td rowspan="6">Transformer</td><td>6</td><td>0.647 ± 0.03</td><td>32.89 ± 0.04</td><td>6</td><td>0.642 ± 0.02</td><td>33.36 ± 0.03</td><td>16</td><td>3.788 ± 0.053</td><td>23.36 ± 0.06</td></tr><tr><td></td><td>0.711 ± 0.05</td><td>33.04 ± 0.03</td><td>8</td><td>0.765 ± 0.03</td><td>33.41 ± 0.08</td><td></td><td>3.820 ± 0.072</td><td>23.41 ± 0.05</td></tr><tr><td></td><td>0.808 ± 0.02</td><td>33.96 ± 0.08</td><td>10</td><td>0.898 ± 0.04</td><td>33.32 ± 0.07</td><td></td><td>5.262 ± 0.607</td><td>23.50 ± 0.03</td></tr><tr><td>12</td><td>1.037 ± 0.03</td><td>33.07 ± 0.09</td><td>12</td><td>1.037 ± 0.03</td><td>33.07 ± 0.11</td><td>五</td><td>6.212 ± 0.232</td><td>23.81 ±0.04</td></tr><tr><td></td><td>0.569 ± 0.02</td><td>32.78 ±0.03</td><td>6</td><td>0.599 ± 0.01</td><td>33.09 ± 0.05</td><td></td><td>3.563 ± 0.061</td><td>23.21 ± 0.04</td></tr><tr><td>8</td><td>0.619 ± 0.04</td><td>33.12 ± 0.05</td><td>8</td><td>0.726 ± 0.02</td><td>33.38 ± 0.09</td><td>1</td><td>3.603 ± 0.056</td><td>23.80 ± 0.06</td></tr><tr><td rowspan="5">T Reservoir</td><td></td><td>0.729 ± 0.04</td><td>33.13 ± 0.07</td><td>10</td><td>0.738 ± 0.03</td><td>33.37 ± 0.04</td><td>24</td><td>4.923 ± 0.771</td><td>23.75 ± 0.02</td></tr><tr><td>12</td><td>0.982 ± 0.02</td><td>33.03 ± 0.11</td><td>12</td><td>0.958 ± 0.01</td><td>33.46± 0.09</td><td>32</td><td>5.780 ± 0.214</td><td>23.71 ±0.03</td></tr><tr><td>6</td><td>0.521 ± 0.05</td><td>32.85 ± 0.02</td><td>6</td><td>0.594 ± 0.03</td><td>33.13 ± 0.04</td><td>12</td><td>3.417 ± 0.046</td><td>23.22 ± 0.07</td></tr><tr><td>8</td><td>0.533 ± 0.03</td><td>33.84 ± 0.04</td><td>8</td><td>0.651 ± 0.04</td><td>33.36 ± 0.06</td><td>16</td><td>3.527 ± 0.063</td><td>23.54 ± 0.05</td></tr><tr><td>10</td><td>0.614 ± 0.01</td><td>33.05 ± 0.08</td><td>10</td><td>0.627 ± 0.05</td><td>33.26 ± 0.03</td><td>24</td><td>4.197 ± 0.697</td><td>23.74 ± 0.06</td></tr><tr><td rowspan="5">LayerDrop</td><td>12</td><td>0.811 ± 0.02</td><td>33.26 ± 0.10</td><td>12</td><td>0.780 ± 0.02</td><td>33.46 ± 0.08</td><td>32</td><td>4.984 ± 0.321</td><td>23.82 ± 0.02</td></tr><tr><td></td><td>0.837 ±0.08</td><td>32.87 ± 0.05</td><td>6</td><td>0.706 ±0.01</td><td>33.08 ± 0.03</td><td>12</td><td>3.912 ± 0.068</td><td>23.33 ± 0.08</td></tr><tr><td>6</td><td>0.934 ± 0.07</td><td>33.12 ± 0.03</td><td>8</td><td>0.753 ± 0.04</td><td>33.14 ± 0.05</td><td>16</td><td>3.581 ± 0.076</td><td>23.17 ± 0.04</td></tr><tr><td>10</td><td>0.901 ± 0.06</td><td>33.18 ±0.02</td><td>10</td><td>0.691 ± 0.03</td><td>32.39 ± 0.05</td><td>3</td><td>4.875 ± 0.728</td><td>23.43 ± 0.07</td></tr><tr><td>12</td><td>0.914 ± 0.01</td><td>32.33 ± 0.06</td><td>12</td><td>0.803 ± 0.02</td><td>32.94 ± 0.10</td><td></td><td>5.980 ± 0.219</td><td>22.97 ± 0.08</td></tr></table>
377
+
378
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">#Layers</td><td colspan="3">IWSLT-Dec2 Train time</td><td colspan="3">IWSLT-Dec6</td><td rowspan="2"></td><td colspan="2">WMT-Dec1</td></tr><tr><td>until 99 % max (in hours)</td><td>Max BLEU (99%)</td><td>#Layers</td><td>Train time until 99 % max (in hours)</td><td>Max BLEU (99%)</td><td>#Layers</td><td>Train time until 99 % max (in hours)</td><td>Max BLEU (99%)</td></tr><tr><td rowspan="5">Transformer</td><td></td><td>1.454 ± 0.06</td><td>34.24 ± 0.05</td><td>6</td><td>1.297 ± 0.03</td><td>34.69 ± 0.05</td><td>1</td><td>9.961 ± 0.053</td><td></td><td>24.27 ± 0.04</td></tr><tr><td></td><td>1.475 ± 0.09</td><td>34.32 ± 0.09</td><td>8</td><td>1.390 ± 0.02</td><td></td><td></td><td></td><td>12.623 ± 0.072</td><td>24.35 ± 0.06</td></tr><tr><td>10</td><td>1.526 ± 0.04</td><td>34.25 ± 0.04</td><td></td><td></td><td>1.622 ± 0.05</td><td>34.75 ± 0.09 34.64 ± 0.03</td><td>3</td><td>13.412 ± 0.837</td><td>24.49 ± 0.07</td></tr><tr><td>12</td><td>2.259 ± 0.07</td><td>34.24 ± 0.11</td><td>10 12</td><td></td><td>1.748 ± 0.01</td><td>34.66 ± 0.08</td><td></td><td>15.117 ± 0.232</td><td>24.56 ± 0.02</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="5">TReservoir</td><td></td><td>1.257 ± 0.04</td><td>34.05 ± 0.09</td><td>6</td><td>1.291 ± 0.03</td><td>34.51 ± 0.10</td><td>1</td><td>8.314 ± 0.062</td><td></td><td>24.15 ± 0.06</td></tr><tr><td>10</td><td>1.472 ± 0.06</td><td>34.47 ± 0.05</td><td></td><td>1.339 ± 0.03</td><td>34.80 ± 0.04</td><td></td><td></td><td>9.221 ± 0.073</td><td>24.41 ± 0.05</td></tr><tr><td>12</td><td>1.530 ± 0.03</td><td>34.36 ± 0.02</td><td>10</td><td>1.419 ± 0.04</td><td></td><td>34.72 ± 0.03</td><td></td><td>10.413 ± 0.580</td><td>24.56 ± 0.03</td></tr><tr><td></td><td>2.043 ± 0.05</td><td>34.53 ± 0.07</td><td>12</td><td>1.642 ± 0.02</td><td></td><td>34.87 ± 0.02</td><td>3</td><td>11.465 ± 0.227</td><td>24.49 ±0.01</td></tr><tr><td>680</td><td>1.138 ± 0.03</td><td>34.10 ± 0.13</td><td>6</td><td>1.169 ± 0.02</td><td></td><td>34.71 ± 0.09</td><td></td><td>7.407 ± 0.087</td><td>24.33 ± 0.08</td></tr><tr><td rowspan="5">FFN Reservoir</td><td></td><td>1.101 ± 0.07</td><td>34.32 ± 0.11 34.36 ± 0.03</td><td>8 10</td><td>1.201 ± 0.03 1.276 ± 0.03</td><td>34.79 ±0.08 34.63 ± 0.03</td><td></td><td></td><td>9.336 ± 0.036</td><td>24.42 ± 0.05</td></tr><tr><td>12</td><td>1.281 ± 0.01</td><td></td><td></td><td></td><td></td><td></td><td></td><td>9.978 ± 0.546</td><td>24.91 ± 0.07</td></tr><tr><td></td><td>1.785 ± 0.03</td><td>34.42 ± 0.06</td><td>12</td><td>1.440 ± 0.01</td><td>34.87 ± 0.02</td><td></td><td></td><td>10.524 ± 0.341</td><td>24.96 ± 0.01</td></tr><tr><td>8</td><td>1.363 ± 0.05</td><td>34.58 ± 0.14</td><td>6</td><td>1.253 ± 0.01</td><td></td><td>34.42 ± 0.10</td><td></td><td>8.372 ± 0.059</td><td>24.17 ± 0.04</td></tr><tr><td></td><td>1.468 ± 0.03</td><td>34.50 ± 0.12</td><td>8</td><td>1.244 ± 0.04</td><td>34.44 ± 0.09</td><td></td><td></td><td>9.741 ± 0.043</td><td>23.93 ± 0.08</td></tr><tr><td rowspan="4">LayerDrop</td><td>10</td><td>1.678 ± 0.04</td><td>34.52 ± 0.07</td><td>10</td><td></td><td></td><td>33.83 ±0.06</td><td>16 3</td><td>10.145 ± 0.628</td><td>24.07 ± 0.09</td></tr><tr><td>12</td><td>2.071 ± 0.02</td><td>33.45 ± 0.23</td><td>12</td><td>1.343 ± 0.04 1.423 ± 0.02</td><td>33.97 ± 0.12</td><td></td><td></td><td>10.168 ± 0.329</td><td>23.81 ± 0.03</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
379
+
380
+ 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.
381
+
382
+ # F VALIDATION PLOTS
383
+
384
+ 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.
385
+
386
+ # G ROBERTA PROBING
387
+
388
+ 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.
389
+
390
+ ![](images/bdd1e0f5437432a0076b1c35076cc1e6057826414f43599a327bf57236d29faf.jpg)
391
+ Figure 8: IWSLT with 2-layer decoder using different freezing strategy.
392
+
393
+ ![](images/8efb8273099ff74135796331759c0532b0ccf7448a7b83e8c437cb3b5dc2a6fb.jpg)
394
+ Figure 9: RoBERTa Reservoir Results, Pre-training versus downstream task plot for 12 layer RoBERTa. MNLI-m (left). SST-2 (right).
395
+
396
+ ![](images/16c67d74e5743eb685c5b29836cc09d4540ceae3fe880d614d534330288bb088.jpg)
397
+ Figure 10: RoBERTa Reservoir Results, Training plot for 12 layer RoBERTa (left). AUCC result (right).
398
+
399
+ ![](images/e38bef769826f1e91e25614fc341e46647bcb6ea7bc3f2a9aafc23ea160c51d5.jpg)
400
+ 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.
401
+
402
+ ![](images/a79c4059de5d7c1e244e50c3037c5c3ba9d32882a35b29d942cc4721a4bbab54.jpg)
403
+ 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.
404
+
405
+ ![](images/341111a25bde86caccbfa885e06e66acf9b016afdcaeecdf8630ea4dc0291102.jpg)
406
+ 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.
407
+
408
+ ![](images/dbab4e8809ef2a132617f00c1dc1acd380a0973768e0196c29742da904ec4002.jpg)
409
+ Figure 14: Downstream RoBERTa performance on SST-2 (left) and MultiNLI-matched (right).
410
+
411
+ ![](images/41ebdc6849103e9713e0791384d38890f3c671a95f174869f62c2c94346167cf.jpg)
412
+ 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).
413
+
414
+ <table><tr><td>Model</td><td>Layer</td><td>SentLen (Surface)</td><td>TreeDepth (Syntactic)</td><td>TopConst (Syntactic)</td><td>BShift (Syntactic)</td><td>Tense (Semantic)</td><td>SubjNum (Semantic)</td><td>ObjNum (Semantic)</td><td>SOMO (Semantic)</td><td>CoordInv (Semantic)</td></tr><tr><td rowspan="14">Transformer</td><td></td><td>84.56 ± 0.54</td><td>32.30 ± 0.41</td><td>54.40 ± 0.33</td><td>49.99 ± 0.01</td><td>80.98 ± 0.32</td><td>76.26 ± 0.09</td><td>50.01 ± 0.19</td><td>76.38 ± 0.61</td><td>54.33 ± 0.47</td></tr><tr><td></td><td>87.22 ± 0.07</td><td>33.63 ± 0.57</td><td>58.38 ± 0.20</td><td>50.12 ± 0.17</td><td>82.84 ± 0.68</td><td>78.65 ± 0.19</td><td>51.47 ± 0.53</td><td>78.00 ± 1.12</td><td>54.66 ± 0.55</td></tr><tr><td></td><td>84.25 ± 0.16</td><td>32.60 ± 0.17</td><td>54.41 ± 0.10</td><td>50.02 ± 0.01</td><td>81.72 ± 0.59</td><td>77.00 ± 0.13</td><td>51.32 ± 0.64</td><td>76.57 ± 1.13</td><td>54.13 ± 0.51</td></tr><tr><td></td><td>87.37 ± 0.20</td><td>32.59 ± 0.29</td><td>50.06 ± 0.21</td><td>69.76 ± 0.26</td><td>81.63 ± 1.17</td><td>76.47 ± 0.09</td><td>52.41 ± 1.49</td><td>76.15 ± 0.84</td><td>52.62 ± 1.34</td></tr><tr><td>5</td><td>84.61 ± 0.24</td><td>31.14 ± 0.48</td><td>44.76 ± 0.38</td><td>74.82 ± 0.11</td><td>80.16 ± 0.19</td><td>73.66 ± 0.16</td><td>52.95 ± 1.77</td><td>72.90 ± 0.21</td><td>51.26 ± 1.14</td></tr><tr><td>6</td><td>82.56 ± 0.25</td><td>30.31 ± 0.40</td><td>39.30 ± 0.40</td><td>78.80 ±0.38</td><td>81.88 ± 0.47</td><td>75.30 ± 0.07</td><td>56.21 ± 1.26</td><td>74.37 ± 0.16</td><td>51.44 ± 1.04</td></tr><tr><td></td><td>70.85 ± 0.13</td><td>26.65 ± 0.72</td><td>40.70 ± 0.13</td><td>78.98 ± 0.32</td><td>85.11 ± 0.31</td><td>72.03 ± 0.46</td><td>58.15 ± 0.46</td><td>68.71 ± 0.91</td><td>55.39 ± 0.27</td></tr><tr><td>8</td><td>66.23 ± 1.33</td><td>23.46 ± 0.44</td><td>25.19 ± 1.02</td><td>77.42 ± 0.27</td><td>80.35 ± 0.45</td><td>67.55 ± 0.99</td><td>54.94 ± 2.04</td><td>63.69 ± 2.32</td><td>50.58 ± 0.83</td></tr><tr><td>9</td><td>71.17 ± 0.29</td><td>31.21 ± 0.31</td><td>58.42 ± 0.29</td><td>85.55 ± 0.44</td><td>86.77 ± 0.19</td><td>80.30 ± 0.08</td><td>64.36 ± 1.20</td><td>81.68 ± 0.45</td><td>66.90 ± 0.49</td></tr><tr><td>10</td><td>73.19 ± 0.50</td><td>27.74 ± 0.53</td><td>41.01 ± 0.22</td><td>83.56 ± 0.96</td><td>86.13 ± 0.35</td><td>83.04 ± 0.04</td><td>62.01 ± 0.59</td><td>79.73 ± 0.21</td><td>62.60 ± 1.04</td></tr><tr><td>11</td><td>71.37 ± 0.42</td><td>30.22 ± 0.28</td><td>48.58 ± 0.35</td><td>84.40 ± 0.44</td><td>87.28 ± 0.59</td><td>82.34 ± 0.15</td><td>61.10 ± 0.14</td><td>80.00 ± 0.40</td><td>64.44 ± 0.38</td></tr><tr><td>12</td><td>71.66 ± 0.12</td><td>33.43 ± 0.18</td><td>64.38 ± 0.20</td><td>87.38 ± 0.02</td><td>88.41 ± 0.09</td><td>84.46 ± 0.25</td><td>63.01 ± 0.05</td><td>81.80 ± 0.27</td><td>65.72 ± 0.16</td></tr><tr><td></td><td>87.75 ± 0.10</td><td>31.60 ± 0.21</td><td>50.38 ± 0.23</td><td>50.00 ± 0.00</td><td>80.40 ± 0.18</td><td>76.47 ± 0.20</td><td>50.53 ± 0.14</td><td>73.48 ± 0.15</td><td></td></tr><tr><td rowspan="14">TReservoir</td><td>2</td><td>81.28 ± 0.23</td><td>34.20 ± 0.41</td><td></td><td>60.64 ± 0.65</td><td></td><td></td><td></td><td></td><td>53.55 ± 0.70</td></tr><tr><td></td><td></td><td></td><td>61.41 ± 0.42</td><td></td><td>81.50 ± 0.77</td><td>76.33 ± 0.08</td><td>50.73 ± 0.34</td><td>74.28 ± 0.67</td><td>56.82 ± 0.10</td></tr><tr><td>3</td><td>89.28 ± 0.09</td><td>36.42 ± 0.11</td><td>67.36 ± 0.45</td><td>75.64 ± 0.52</td><td>85.42 ± 0.18</td><td>80.53 ± 0.02</td><td>52.50 ± 1.80</td><td>78.47 ± 1.81</td><td>57.16 ± 0.27</td></tr><tr><td></td><td>74.31 ± 0.32</td><td>32.42 ± 0.83</td><td>55.19 ± 0.33</td><td>73.41 ± 0.00</td><td>79.56 ± 0.00</td><td>75.15 ± 0.08</td><td>53.68 ± 0.66</td><td>75.02 ± 0.19</td><td>56.89 ± 0.08</td></tr><tr><td></td><td>88.03 ± 0.22 74.55 ± 0.37</td><td>38.34 ± 0.64 33.13 ± 0.29</td><td>68.65 ± 0.29</td><td>82.25 ± 0.12</td><td>86.80 ± 0.02</td><td>82.27 ± 0.33</td><td>57.95 ± 0.24</td><td>80.82 ± 0.91</td><td>58.05 ± 0.10</td></tr><tr><td></td><td></td><td></td><td>52.70 ± 0.81</td><td>79.21 ± 0.13</td><td>85.70 ± 0.36</td><td>77.43 ± 0.03</td><td>57.26 ± 0.19</td><td>75.38 ± 0.66</td><td>51.95 ± 1.30</td></tr><tr><td></td><td>85.82 ± 0.37 71.69 ± 0.71</td><td>37.63 ± 0.13 30.32 ± 0.01</td><td>70.43 ± 0.05 48.44 ± 0.30</td><td>84.12 ± 0.35 79.12 ± 0.12</td><td>86.88 ± 0.07</td><td>82.86 ± 0.30</td><td>61.17 ± 0.21</td><td>80.79 ± 0.17</td><td>61.83 ± 0.95</td></tr><tr><td>8 9</td><td>85.86 ± 0.12</td><td>37.89 ± 0.03</td><td>69.53 ± 0.37</td><td>85.55 ± 0.12</td><td>84.75 ± 0.09 87.98 ± 0.22</td><td>79.23 ± 0.11 84.13 ± 0.01</td><td>59.53 ± 0.16</td><td>76.80 ± 0.41</td><td>57.34 ± 0.14</td></tr><tr><td></td><td>69.22 ± 0.23</td><td>25.58 ± 0.35</td><td>29.20 ± 0.58</td><td>78.57 ± 0.09</td><td></td><td></td><td>63.06± 0.01</td><td>82.55 ± 0.31</td><td>66.07 ± 0.05</td></tr><tr><td>10</td><td></td><td></td><td>47.56 ± 0.02</td><td></td><td>85.02 ± 0.03</td><td>75.68 ± 0.16</td><td>57.55 ± 1.57</td><td>74.70 ± 0.02</td><td>55.02 ± 0.64</td></tr><tr><td>11</td><td>65.70 ± 0.05</td><td>30.57 ± 0.03</td><td></td><td>81.20 ± 0.00</td><td>86.78 ± 0.02</td><td>83.73 ± 0.05</td><td>60.38 ± 0.17</td><td>80.59 ± 0.15</td><td>62.50 ± 0.11</td></tr><tr><td>12</td><td>70.61 ± 0.18</td><td>34.45± 0.20</td><td>64.19 ± 0.10</td><td>84.53 ± 0.03</td><td>87.48 ± 0.16</td><td>84.86 ± 0.14</td><td>62.75 ± 0.14</td><td>82.08 ± 0.03</td><td>64.73 ± 0.06</td></tr></table>
415
+
416
+ Table 6: RoBERTa Probing Results. The line in bold text are the the frozen layers in the T Reservoir.
md/train/B12Js_yRb/B12Js_yRb.md ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO COUNT OBJECTS IN NATURAL IMAGES FOR VISUAL QUESTION ANSWERING
2
+
3
+ Yan Zhang & Jonathon Hare & Adam Prugel-Bennett ¨
4
+
5
+ Department of Electronics and Computer Science University of Southampton {yz5n12,jsh2,apb}@ecs.soton.ac.uk
6
+
7
+ # ABSTRACT
8
+
9
+ 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 \%$ .
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ 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).
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ # 3 PROBLEMS WITH SOFT ATTENTION
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ ![](images/01c2c43239e5530d6490c14c6c93b92ad5fef0ff207f0d931d1ff4b6596146b9.jpg)
42
+ 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.
43
+
44
+ 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.
45
+
46
+ 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.
47
+
48
+ 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.
49
+
50
+ # 4 COUNTING COMPONENT
51
+
52
+ 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.
53
+
54
+ 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.
55
+
56
+ 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.
57
+
58
+ These parameters are responsible for handling variations in attention weights and partial bounding box overlaps in a manner suitable for a given dataset.
59
+
60
+ 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.
61
+
62
+ # 4.1 INPUT
63
+
64
+ 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.
65
+
66
+ 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.
67
+
68
+ Instead of partially overlapping proposals, the problem now becomes the handling of exact duplicate proposals of underlying objects in a differentiable manner.
69
+
70
+ # 4.2 DEDUPLICATION
71
+
72
+ 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.
73
+
74
+ $$
75
+ \mathbf { A } = \mathbf { a } \mathbf { a } ^ { \mathsf { T } }
76
+ $$
77
+
78
+ $\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.
79
+
80
+ 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.
81
+
82
+ There are two types of duplicate edges to eliminate to achieve our objective: intra-object edges and inter-object edges.
83
+
84
+ # 4.2.1 INTRA-OBJECT EDGES
85
+
86
+ First, we eliminate intra-object edges between duplicate proposals of a single underlying object.
87
+
88
+ ![](images/ebf111b774761b74e228aac07c7d7d09a9fdfade0a9ad743d7521aa694abb69f.jpg)
89
+
90
+ ![](images/afc38c727db1f3d829ce09537e6ec8c8c604979b7eca9b190e7296a9afa5152c.jpg)
91
+ 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.
92
+ 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.
93
+
94
+ 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
95
+
96
+ $$
97
+ D _ { i j } = 1 - \mathrm { I o U } ( b _ { i } , b _ { j } )
98
+ $$
99
+
100
+ $\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.
101
+
102
+ Intra-object edges are removed by elementwise multiplying $( \odot )$ the distance matrix with the attention matrix (Figure 2).
103
+
104
+ $$
105
+ \tilde { \mathbf { A } } = f _ { 1 } ( \mathbf { A } ) \odot f _ { 2 } ( \mathbf { D } )
106
+ $$
107
+
108
+ $\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.
109
+
110
+ # 4.2.2 INTER-OBJECT EDGES
111
+
112
+ Second, we eliminate inter-object edges between duplicate proposals of different underlying objects.
113
+
114
+ 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.
115
+
116
+ 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
117
+
118
+ $$
119
+ \mathrm { S i m } _ { i j } = f _ { 3 } ( 1 - | a _ { i } - a _ { j } | ) \prod _ { k } f _ { 3 } ( 1 - | X _ { i k } - X _ { j k } | )
120
+ $$
121
+
122
+ 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.
123
+
124
+ 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.
125
+
126
+ 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$ .
127
+
128
+ $$
129
+ s _ { i } = 1 / \sum _ { j } \mathrm { S i m } _ { i j }
130
+ $$
131
+
132
+ 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.
133
+
134
+ 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
135
+
136
+ $$
137
+ \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 } ) )
138
+ $$
139
+
140
+ where $\mathrm { d i a g ( \cdot ) }$ expands a vector into a diagonal matrix with the vector on the diagonal.
141
+
142
+ 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.
143
+
144
+ # 4.3 OUTPUT
145
+
146
+ 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.
147
+
148
+ 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
149
+
150
+ $$
151
+ c = | V | = \sqrt { | E | }
152
+ $$
153
+
154
+ 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.
155
+
156
+ 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
157
+
158
+ $$
159
+ o _ { i } = \operatorname* { m a x } ( 0 , 1 - | c - i | )
160
+ $$
161
+
162
+ 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.
163
+
164
+ # 4.3.1 OUTPUT CONFIDENCE
165
+
166
+ 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 ]$ .
167
+
168
+ 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$ .
169
+
170
+ $$
171
+ \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}
172
+ $$
173
+
174
+ Then, the output of the component with confidence scaling is
175
+
176
+ $$
177
+ \tilde { \mathbf { o } } = f _ { 8 } ( p _ { \mathbf { a } } + p _ { \mathbf { D } } ) \cdot \mathbf { o }
178
+ $$
179
+
180
+ 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.
181
+
182
+ # 5 EXPERIMENTS
183
+
184
+ # 5.1 TOY TASK
185
+
186
+ 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
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ # 5.1.1 RESULTS
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ ![](images/3fb48560d3ebed9fd32e0c830572ff36757f872f81d3938700678967ef165a4e.jpg)
199
+ Figure 4: Accuracies on the toy task as side length $l$ and noise $q$ are varied in 0.01 step sizes.
200
+
201
+ ![](images/21e53377d411fcb31ec0d56dc4ccce342dbc7c34ca06a323a7b0659898b842de.jpg)
202
+ 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.
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ # 5.2 VQA
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ <table><tr><td></td><td colspan="4">VQA v2 test-dev</td><td colspan="4">VQA v2 test</td></tr><tr><td>Model</td><td>Yes/No</td><td>Number</td><td>Other</td><td>All</td><td>Yes/No</td><td>Number</td><td>Other</td><td>All</td></tr><tr><td>Teney et al. (2017)</td><td>81.82</td><td>44.21</td><td>56.05</td><td>65.32</td><td>82.20</td><td>43.90</td><td>56.26</td><td>65.67</td></tr><tr><td>Teney et al. (2017) (Ens.)</td><td>86.08</td><td>48.99</td><td>60.80</td><td>69.87</td><td>86.60</td><td>48.64</td><td>61.15</td><td>70.34</td></tr><tr><td>Zhou et al. (2017)</td><td>84.27</td><td>49.56</td><td>59.89</td><td>68.76</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Zhou et al. (2017) (Ens.)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>86.65</td><td>51.13</td><td>61.75</td><td>70.92</td></tr><tr><td>Baseline</td><td>82.98</td><td>46.88</td><td>58.99</td><td>67.50</td><td>83.21</td><td>46.60</td><td>59.20</td><td>67.78</td></tr><tr><td>+ counting module</td><td>83.14</td><td>51.62</td><td>58.97</td><td>68.09</td><td>83.56</td><td>51.39</td><td>59.11</td><td>68.41</td></tr></table>
217
+
218
+ 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.
219
+
220
+ <table><tr><td></td><td colspan="3">VQA accuracy</td><td colspan="3">Balanced pair accuracy</td></tr><tr><td>Model</td><td>Number</td><td>Count</td><td>All</td><td>Number</td><td>Count</td><td>All</td></tr><tr><td>Baseline</td><td>44.83±0.2</td><td>51.69±0.2</td><td>64.80±0.0</td><td>17.34±0.2</td><td>20.02±0.2</td><td>36.44±0.1</td></tr><tr><td>+ NMS</td><td>44.60±0.1</td><td>51.41±0.1</td><td>64.80±0.1</td><td>17.06±0.1</td><td>19.72±0.1</td><td>36.44±0.2</td></tr><tr><td> + counting module</td><td>49.36±0.1</td><td>57.03±0.0</td><td>65.42±0.1</td><td>23.10±0.2</td><td>26.63±0.2</td><td>37.19±0.1</td></tr></table>
221
+
222
+ # 5.2.1 RESULTS
223
+
224
+ 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.
225
+
226
+ 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.
227
+
228
+ 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.
229
+
230
+ 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.
231
+
232
+ # 6 CONCLUSION
233
+
234
+ 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.
235
+
236
+ 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.
237
+
238
+ # REFERENCES
239
+
240
+ 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.
241
+ Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: Visual Question Answering. In ICCV, 2015.
242
+ Samaneh Azadi, Jiashi Feng, and Trevor Darrell. Learning detection with diverse proposals. In CVPR, 2017.
243
+ Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. In ICLR, 2015.
244
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
245
+ Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju, Dhruv Batra, and Devi Parikh. Counting everyday objects in everyday scenes. In CVPR, 2017.
246
+ Kyunghyun Cho, B van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. In SSST@EMNLP, 2014.
247
+ Joseph Paul Cohen, Henry Z. Lo, and Yoshua Bengio. Count-ception: Counting by fully convolutional redundant counting. CoRR, arXiv:1703.08710, 2017.
248
+ 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.
249
+
250
+ Paul Henderson and Vittorio Ferrari. End-to-end training of object class detectors for mean average precision. In ACCV, 2017.
251
+
252
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 1997.
253
+
254
+ Jan Hosang, Rodrigo Benenson, and Bernt Schiele. Learning non-maximum suppression. In CVPR, 2017.
255
+
256
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
257
+
258
+ Allan Jabri, Armand Joulin, and Laurens van der Maaten. Revisiting visual question answering baselines. In ECCV, 2016.
259
+
260
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In NIPS, 2015.
261
+
262
+ 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.
263
+
264
+ Vahid Kazemi and Ali Elqursh. Show, ask, attend, and answer: A strong baseline for visual question answering. CoRR, arXiv:1704.03162, 2017.
265
+
266
+ Yoon Kim, Carl Denton, Luong Hoang, and Alexander M. Rush. Structured attention networks. In ICLR, 2017.
267
+
268
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
269
+
270
+ Hugo Larochelle and Geoffrey E Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In NIPS, 2010.
271
+
272
+ Victor Lempitsky and Andrew Zisserman. Learning to count objects in images. In NIPS, 2010.
273
+
274
+ Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In NIPS, 2016.
275
+
276
+ Dmytro Mishkin and Jiri Matas. All you need is a good init. In ICLR, 2016.
277
+
278
+ Volodymyr Mnih, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. Recurrent models of visual attention. In NIPS, 2014.
279
+
280
+ 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.
281
+
282
+ Mengye Ren and Richard S. Zemel. End-to-end instance segmentation with recurrent attention. In CVPR, 2017.
283
+
284
+ 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.
285
+
286
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 2014.
287
+
288
+ 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.
289
+
290
+ Alexander Trott, Caiming Xiong, and Richard Socher. Interpretable counting for visual question answering. In ICLR, 2018.
291
+
292
+ Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alexander J. Smola. Stacked attention networks for image question answering. In CVPR, 2016.
293
+
294
+ Seungil You, David Ding, Kevin Canini, Jan Pfeifer, and Maya Gupta. Deep Lattice Networks and Partial Monotonic Functions. In NIPS, 2017.
295
+
296
+ 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.
297
+
298
+ Chen Zhu, Yanpeng Zhao, Shuaiyi Huang, Kewei Tu, and Yi Ma. Structured attentions for visual question answering. CoRR, arXiv:1708.02071, 2017.
299
+
300
+ # A PIECEWISE LINEAR ACTIVATION FUNCTION
301
+
302
+ 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.
303
+
304
+ 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
305
+
306
+ $$
307
+ 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 } | }
308
+ $$
309
+
310
+ 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.
311
+
312
+ 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.
313
+
314
+ # B BASELINE ARCHITECTURE
315
+
316
+ 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.
317
+
318
+ 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.
319
+
320
+ 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 }$ .
321
+
322
+ 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.
323
+
324
+ 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).
325
+
326
+ ![](images/490c1f6c072e0a062d39ff4d6cc97980d0cf6261d8fcaf1d9d6a6f9cad6001a1.jpg)
327
+ 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.
328
+
329
+ ![](images/07d2e4d6eedacaf38bf7ab5fb51fab2d11a25b373c83069db69f688b7b40cae0.jpg)
330
+ 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.
331
+
332
+ ![](images/e630ceffcd3a5654e3eb6233016450532e537c9e33e24a644459ee0f3beb38ae.jpg)
333
+ 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.
334
+
335
+ ![](images/0c0fbd90d5fdb814b3a5f433d4b3e097fa2287a734697d8678539536c723c7d2.jpg)
336
+ 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.
337
+
338
+ ![](images/82a95f366fb3f29067d4526bec9b7457d9cdecee732615090ede2cab04ee24a8.jpg)
339
+ 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.
340
+
341
+ ![](images/2f649731cb7ae201b34fb60357ccbb8c13f0f0e0a6906d1cd4d0372f1be0a82e.jpg)
342
+ 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$ .
md/train/B1spAqUp-/B1spAqUp-.md ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PIXEL DECONVOLUTIONAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ ![](images/b44296fc85f5cc1eeeaa2aa411f8622043d07ea2af0e076b7b708ee6deae1a2a.jpg)
16
+ 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.
17
+
18
+ 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.
19
+
20
+ # 2 PIXEL DECONVOLUTIONAL LAYERS AND NETWORKS
21
+
22
+ We introduce deconvolutional layers and analyze the cause of checkerboard artifacts in this section.
23
+ We then propose the pixel deconvolutional layers and the implementation trick to improve efficiency.
24
+
25
+ # 2.1 DECONVOLUTIONAL LAYERS
26
+
27
+ 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).
28
+
29
+ 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
30
+
31
+ ![](images/a51e55da2b7369e34f3fe235df941640b3af45bc8a933d453e2d1d45957bf008.jpg)
32
+ 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.
33
+
34
+ ![](images/5f650341a38f0d16d4c3370961ea09638966f197620bd80c371446431eebdbeb.jpg)
35
+ 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.
36
+
37
+ an up-sampled output $F _ { o u t }$ as follows:
38
+
39
+ $$
40
+ \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}
41
+ $$
42
+
43
+ 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$ .
44
+
45
+ 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.
46
+
47
+ ![](images/762cb8ae161dd72dc7c0572298ea7bf353828e3ff303437b38933f826b6c4315.jpg)
48
+ 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.
49
+
50
+ # 2.2 PIXEL DECONVOLUTIONAL LAYERS
51
+
52
+ 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:
53
+
54
+ $$
55
+ \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}
56
+ $$
57
+
58
+ 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.
59
+
60
+ 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.
61
+
62
+ 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:
63
+
64
+ ![](images/31e8e6947e326ebc3feec87f504e0f23532cc92eb8a15d945c10de8a1cbe6b5c.jpg)
65
+ 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).
66
+
67
+ $$
68
+ \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}
69
+ $$
70
+
71
+ 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.
72
+
73
+ # 2.3 PIXEL DECONVOLUTIONAL NETWORKS
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ ![](images/b94a1da339603d00a848f0b312577316f83eb96ba5a1698fdd6036ef85b466bb.jpg)
80
+ 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).
81
+
82
+ 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.
83
+
84
+ # 3 EXPERIMENTAL STUDIES
85
+
86
+ 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.
87
+
88
+ # 3.1 SEMANTIC SEGMENTATION
89
+
90
+ 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.
91
+
92
+ 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.
93
+
94
+ ![](images/46fa08fd11a936c4e67d3ff19292ecf64c037a572245fad13e8a91c816ad3d78.jpg)
95
+ 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.
96
+
97
+ 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.
98
+
99
+ 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.
100
+
101
+ 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.
102
+
103
+ 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.
104
+
105
+ ![](images/134761f4b336f5068fbe4cc58fa41f61857a1ce9596592eff10c5820df1e35dd.jpg)
106
+ 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.
107
+
108
+ 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.
109
+
110
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Pixel Accuracy</td><td rowspan=1 colspan=1>Mean IOU</td></tr><tr><td rowspan=1 colspan=1>PASCAL 2012</td><td rowspan=1 colspan=1>U-Net + DCLU-Net+iPixelDCLU-Net + PixelDCL</td><td rowspan=1 colspan=1>0.8161610.8171290.822591</td><td rowspan=1 colspan=1>0.4151780.4488170.455972</td></tr><tr><td rowspan=1 colspan=1>MSCOCO 2015</td><td rowspan=1 colspan=1>U-Net + DCLU-Net+iPixelDCLU-Net + PixelDCL</td><td rowspan=1 colspan=1>0.8093270.8092390.811575</td><td rowspan=1 colspan=1>0.3497690.3602160.371805</td></tr><tr><td rowspan=1 colspan=1>PASCAL 2012</td><td rowspan=1 colspan=1>DeepLab-ResNet + DCLDeepLab-ResNet+iPixelDCLDeepLab-ResNet + PixelDCL</td><td rowspan=1 colspan=1>0.9295620.9344930.931287</td><td rowspan=1 colspan=1>0.7270360.7385520.735585</td></tr></table>
111
+
112
+ # 3.2 IMAGE GENERATION
113
+
114
+ 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.
115
+
116
+ 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.
117
+
118
+ ![](images/7a9c90132ce123b556bcdd87c63e4cf7f93988ccf6daf1cca1509e1a5564b2f1.jpg)
119
+ 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.
120
+
121
+ 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.
122
+
123
+ <table><tr><td>Model</td><td>Training time</td><td>Prediction time</td></tr><tr><td>U-Net + DCL</td><td>365m26s</td><td>2m42s</td></tr><tr><td>U-Net+iPixelDCL</td><td>511m19s</td><td>4m13s</td></tr><tr><td>U-Net + PixelDCL</td><td>464m31s</td><td>3m27s</td></tr></table>
124
+
125
+ # 3.3 TIMING COMPARISON
126
+
127
+ 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.
128
+
129
+ # 4 CONCLUSION
130
+
131
+ 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).
132
+
133
+ # REFERENCES
134
+
135
+ 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.
136
+
137
+ 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.
138
+
139
+ 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.
140
+
141
+ 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.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
150
+
151
+ Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, 2014.
152
+
153
+ 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.
154
+
155
+ Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In International Conference on Artificial Intelligence and Statistics, pp. 29–37, 2011.
156
+
157
+ 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.
158
+
159
+ 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.
160
+
161
+ 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.
162
+
163
+ 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.
164
+
165
+ Alireza Makhzani and Brendan J Frey. Winner-take-all autoencoders. In Advances in Neural Information Processing Systems, pp. 2791–2799, 2015.
166
+
167
+ Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. Learning deconvolution network for semantic segmentation. In IEEE International Conference on Computer Vision, 2015.
168
+
169
+ 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.
170
+
171
+ 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.
172
+
173
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ Evan Shelhamer, Jonathon Long, and Trevor Darrell. Fully convolutional networks for semantic segmentation. IEEE transactions on pattern analysis and machine intelligence, 2016.
184
+
185
+ 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.
186
+
187
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ 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.
md/train/B1x5KiCcFX/B1x5KiCcFX.md ADDED
@@ -0,0 +1,689 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UNDERSTANDING GANS VIA GENERALIZATION ANALYSIS FOR DISCONNECTED SUPPORT
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ The contributions of this paper are summarized as follows:
22
+
23
+ 1. We show that GANs perform better than other standard methods of estimating probability measures when the measure satisfies the disconnected support property.
24
+ 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.
25
+ 3. Based on the generalization bound, we provide a theoretical guideline for selecting architectures of generators and discriminators.
26
+
27
+ All the proofs are given in Supplementary materials.
28
+
29
+ # 2 PRELIMINARIES
30
+
31
+ # 2.1 NOTATION
32
+
33
+ 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.
34
+
35
+ # 2.2 GENERAL FRAMEWORK OF GANS
36
+
37
+ 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$ .
38
+
39
+ 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.
40
+
41
+ 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),
42
+
43
+ $$
44
+ 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 ) ] ,
45
+ $$
46
+
47
+ between probability measures $P$ and $P ^ { \prime }$ .
48
+
49
+ 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
50
+
51
+ $$
52
+ { \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) .
53
+ $$
54
+
55
+ 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.
56
+
57
+ We assume that $\mathcal { F }$ is large enough to contain functions which can work as a discriminator, namely, we assume that the following holds:
58
+
59
+ $$
60
+ d _ { \mathcal { F } } ( P , P ^ { \prime } ) = 0 \Leftrightarrow P = P ^ { \prime } .
61
+ $$
62
+
63
+ A sufficient condition for (3) is investigated in Zhang et al. (2018).
64
+
65
+ # 2.3 DEEP NEURAL NETWORKS FOR GENERATORS AND DISCRIMINATORS
66
+
67
+ 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.
68
+
69
+ 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 } ] }$ .
70
+
71
+ We define functions of DNNs with an architecture $\Theta$ as $\xi [ \Theta ] : \mathbb { R } ^ { D ^ { \prime } } \mathbb { R } ^ { D ^ { \prime \prime } }$ by
72
+
73
+ $$
74
+ \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 ] .
75
+ $$
76
+
77
+ The function class of DNNs is thus given by
78
+
79
+ $$
80
+ \Xi ( S , B , L ) : = \Big \{ \xi [ \Theta ] : I ^ { D } \to \mathbb { R } \ | \ \| \Theta \| _ { 0 } \leqslant S , \| \Theta \| _ { \infty } \leqslant B , | \Theta | \leqslant L \Big \} ,
81
+ $$
82
+
83
+ 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.
84
+
85
+ # 3 DISCONNECTED SUPPORT PROPERTY
86
+
87
+ # 3.1 INTRODUCTION AND EXAMPLE
88
+
89
+ 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.
90
+
91
+ ![](images/fe32edfd04a7a392e42a9668e55374015bbdbbcd473787ac6a8e24e86e9e385a.jpg)
92
+ Figure 1: Plot of the MNIST data.
93
+
94
+ ![](images/9e1bdfe866576746ea80f727f2a4ff3e3c05341c6ba33fc8c5e775ffcb4bc9c3.jpg)
95
+ Figure 2: Plot of the animal data.
96
+
97
+ # 3.2 MATHEMATICAL FORMULATION OF DISCONNECTED SUPPORTS
98
+
99
+ 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.
100
+
101
+ We first prepare a family of subsets as a component in the disconnected supports:
102
+
103
+ $\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 .
104
+
105
+ The supplementary material will provide a more rigorous definition.
106
+
107
+ 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.
108
+
109
+ Definition 1. (Disconnected Supports / Global Support)
110
+ Let $M \geqslant 2$ . A probability measure $P$ on $( I ^ { D } , \bar { \Sigma } )$ has $M$ disconnected supports, if there exist
111
+ nonempty disjoint sets ${ \cal S } _ { 1 } , . . . , { \cal S } _ { M } \in { \cal S } _ { \alpha , J }$ such that
112
+
113
+ $$
114
+ \operatorname { S u p p } ( P ) = \bigcup _ { m \in [ M ] } S _ { m } .
115
+ $$
116
+
117
+ A probability measure $P$ on $( I ^ { D } , \Sigma )$ has a global support, if $\operatorname { S u p p } ( P ) = I ^ { D }$ .
118
+
119
+ Figure 3 illustrates the disconnected support property.
120
+
121
+ 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$ .
122
+
123
+ Definition 2. (Local Smoothness)
124
+
125
+ 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
126
+
127
+ $$
128
+ P ( B ) = P _ { Z } ( \gamma _ { m } ^ { - 1 } ( B ) ) , \forall B \in \sigma ( S _ { m } ) ,
129
+ $$
130
+
131
+ for $m \in [ M ]$
132
+
133
+ 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 }$ .
134
+
135
+ Lemma 1. (Locally Smooth Density Functions)
136
+ If a probability measure $P$ with $M$ disconnected support is locally $\beta$ -smooth, then there exists a
137
+ function $p _ { m } : S _ { m } \to \mathbb { R } _ { + }$ such that
138
+
139
+ $$
140
+ P ( B ) = \int _ { B } p _ { m } ( x ) d \lambda , B \in \sigma ( S _ { m } ) ,
141
+ $$
142
+
143
+ where $\lambda$ is the Lebesgue measure, and $p _ { m }$ is $\beta$ -smooth for all $m \in [ M ]$ .
144
+
145
+ We call $p _ { m }$ as a local density function.
146
+
147
+ 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.
148
+
149
+ ![](images/c3dfa9a97b096a21af5f6a1718c1eb7930b940550b40573c085a60e6e567de44.jpg)
150
+ 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 }$ .
151
+
152
+ ![](images/cfd77cfd712870f7426ee318b45107ce716b4b22206e74bddb9e99ccc7ae3428.jpg)
153
+ Figure 4: Illustration of a generator $g$ . To represent discontinuous $S _ { 1 }$ and $S _ { 2 }$ , $g$ should be discontinuous.
154
+
155
+ # 3.3 DIFFICULTY WITH DISCONNECTED SUPPORTS
156
+
157
+ 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 }$ .
158
+
159
+ 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
160
+
161
+ $$
162
+ d _ { 2 } ( P ^ { * } , \widehat { P } ) = O \left( n ^ { - \beta / ( 2 \beta + D ) } \right) .
163
+ $$
164
+
165
+ 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$ ).
166
+
167
+ On the other hand, we consider a case in which $P ^ { * }$ has the disconnected support property.
168
+
169
+ Proposition 1. (Deterioration of other standard methods) There exists $P ^ { * }$ of the disconnected support property and locally $\beta$ -smooth such that
170
+
171
+ $$
172
+ d _ { 2 } ( P ^ { * } , \widehat { P } ) = { \cal O } \left( n ^ { - 1 / ( 2 + D ) } \right) .
173
+ $$
174
+
175
+ 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).
176
+
177
+ 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.
178
+
179
+ Lemma 2. (Discontinuous Generators for Disconnected Supports)
180
+ If $P ^ { * }$ has disconnected supports and $P ^ { * } = P _ { g ^ { * } }$ with a generator $g ^ { * }$ , then $g ^ { * }$ is not uniformly continuous.
181
+
182
+ 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.
183
+
184
+ # 4 GENERALIZATION BY GANS
185
+
186
+ 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 }$ .
187
+
188
+ A standard line of discussing generalization, we should consider statistical errors and approximation errors. We define a measure of the complexity of $\mathcal { F }$
189
+
190
+ $$
191
+ \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 ,
192
+ $$
193
+
194
+ 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
195
+
196
+ $$
197
+ \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] ,
198
+ $$
199
+
200
+ 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
201
+
202
+ $$
203
+ \Upsilon _ { n } ( \mathcal { F } ) \leqslant C _ { \mathcal { F } } n ^ { - 1 / \kappa } ,
204
+ $$
205
+
206
+ with some constants $C _ { \mathcal { F } } > 0$ and $\kappa \geqslant 2$ .
207
+
208
+ Regarding approximation errors, we need to consider approximation of a discontinuous function;
209
+ since Lemma 2 shows that a discontinuous generator is necessary to represent disconnected supports.
210
+ To approximate such generators, DNNs in GANs has an advantage.
211
+
212
+ 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
213
+
214
+ $$
215
+ \lVert \dot { \boldsymbol g } _ { d } - \boldsymbol g _ { d } ^ { * } \rVert _ { L ^ { 2 } } \leqslant c _ { g } M S _ { g } ^ { - \beta / D } , \forall d \in [ D ] .
216
+ $$
217
+
218
+ Furthermore, if $P ^ { * } = P _ { g ^ { * } }$ has a global support and it is $\beta$ -smooth, (4) holds with $M = 1$
219
+
220
+ 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).
221
+
222
+ Based on Lemma 3, we obtain the main theorem for generalization analysis.
223
+
224
+ 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,
225
+
226
+ $$
227
+ 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 } .
228
+ $$
229
+
230
+ Furthermore, $i f P ^ { * }$ has a global support and it is $\beta$ -smooth, (5) holds with $M = 1$
231
+
232
+ 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.
233
+
234
+ Proof Outline: By the definition of $P _ { \hat { g } }$ in (2) and standard calculation, we obtain the inequality
235
+
236
+ $$
237
+ 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 } .
238
+ $$
239
+
240
+ 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. □
241
+
242
+ 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
243
+
244
+ $$
245
+ S _ { g } = c _ { g } m ^ { D / ( 2 \beta + D ) } , ~ \mathrm { a n d } ~ S _ { f } = c _ { f } n ^ { ( \kappa - 2 ) / \kappa } ,
246
+ $$
247
+
248
+ for optimizing the bound (5). We then obtain the following corollary.
249
+
250
+ Corollary 1. (Convergence Rate of GANs)
251
+ Make the same assumptions as Theorem $^ { l }$ , and set $S _ { f }$ and $S _ { g }$ as in (6). Then, with high probability
252
+ converging to 1, we obtain
253
+
254
+ $$
255
+ 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) .
256
+ $$
257
+
258
+ 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).
259
+
260
+ Remark 1. (Heterogeneous Smoothness)
261
+
262
+ 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.
263
+
264
+ $$
265
+ 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) ,
266
+ $$
267
+
268
+ where $\widetilde { \beta } : = \operatorname* { m i n } _ { m \in \left[ M \right] } \beta _ { m }$
269
+
270
+ # 5 DISCUSSION
271
+
272
+ 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.
273
+
274
+ 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.
275
+
276
+ # 5.1 RELATED WORKS
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ 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.
283
+
284
+ # 6 NUMERICAL EXPERIMENTS
285
+
286
+ 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.
287
+
288
+ 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.
289
+
290
+ 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.
291
+
292
+ ![](images/b7802bb8ea485d4b37d7f38150a4da78b2af66548ec317a150627253f99cdfd2.jpg)
293
+
294
+ ![](images/fdfdd8b80275cb2384c0f8e41eeca8edf4984999a69ba9efe06b8bc5ead17296.jpg)
295
+ Figure 5: Generalization errors.
296
+ Figure 6: Estimated density functions with the case (B).
297
+
298
+ # 7 CONCLUSION
299
+
300
+ 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.
301
+
302
+ # REFERENCES
303
+
304
+ Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
305
+ Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
306
+ 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.
307
+ Sanjeev Arora, Andrej Risteski, and Yi Zhang. Do gans learn the distribution? some theory and empirics. 2018.
308
+ Peter L Bartlett, Olivier Bousquet, Shahar Mendelson, et al. Local rademacher complexities. The Annals of Statistics, 33(4):1497–1537, 2005.
309
+ G Biau, B Cadre, M Sangnier, and U Tanielian. Some theoretical properties of gans. arXiv preprint arXiv:1803.07819, 2018.
310
+ Austin Animal Center. Shelter animal outcomes. http://www.austintexas.gov/ department/aac.
311
+ 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.
312
+ 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.
313
+ Sam Efromovich. Orthogonal series density estimation. Wiley Interdisciplinary Reviews: Computational Statistics, 2(4):467–476, 2010.
314
+
315
+ 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.
316
+
317
+ Thomas S Ferguson. A bayesian analysis of some nonparametric problems. The annals of statistics, pp. 209–230, 1973.
318
+
319
+ 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.
320
+
321
+ 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.
322
+
323
+ Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
324
+
325
+ 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.
326
+
327
+ 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.
328
+
329
+ 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.
330
+
331
+ Masaaki Imaizumi and Kenji Fukumizu. Deep neural networks learn non-smooth functions effectively. arXiv preprint arXiv:1802.04474, 2018.
332
+
333
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
334
+
335
+ Daphne Koller, Nir Friedman, and Francis Bach. Probabilistic graphical models: principles and techniques. MIT press, 2009.
336
+
337
+ 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.
338
+
339
+ Tom Leonard. Density estimation, stochastic processes and prior information. Journal of the Royal Statistical Society. Series B (Methodological), pp. 113–146, 1978.
340
+
341
+ 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.
342
+
343
+ Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In International Conference on Machine Learning, pp. 1718–1727, 2015.
344
+
345
+ Tengyuan Liang. How well can generative adversarial networks (gan) learn densities: A nonparametric view. arXiv preprint arXiv:1712.08244, 2017.
346
+
347
+ 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.
348
+
349
+ William Lotter, Gabriel Kreiman, and David Cox. Unsupervised learning of visual structure using predictive generative networks. arXiv preprint arXiv:1511.06380, 2015.
350
+
351
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
352
+
353
+ 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.
354
+
355
+ Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. The numerics of gans. In Advances in Neural Information Processing Systems, pp. 1823–1833, 2017.
356
+
357
+ James R Munkres. Topology. Prentice Hall, 2000.
358
+
359
+ Elizbar A Nadaraya. On estimating regression. Theory of Probability & Its Applications, 9(1): 141–142, 1964.
360
+
361
+ 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.
362
+
363
+ Philipp Petersen and Felix Voigtlaender. Optimal approximation of piecewise smooth functions using deep relu neural networks. arXiv preprint arXiv:1709.05289, 2017.
364
+
365
+ 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.
366
+
367
+ Johannes Schmidt-Hieber. Nonparametric regression using deep neural networks with relu activation function. arXiv preprint arXiv:1708.06633, 2017.
368
+
369
+ 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.
370
+
371
+ 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.
372
+
373
+ Elias M Stein. Singular integrals and differentiability properties of functions (PMS-30), volume 30. Princeton university press, 2016.
374
+
375
+ Ingo Steinwart and Andreas Christmann. Support vector machines. Springer Science & Business Media, 2008.
376
+
377
+ CJ Stone. Optimal global rates of convergence for nonparametric regression. The Annals of Statistics, 10:1040–1053, 1982.
378
+
379
+ 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.
380
+
381
+ Alexandre B Tsybakov. Introduction to nonparametric estimation, 2009.
382
+
383
+ 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.
384
+
385
+ AW van der Vaart and Jon Wellner. Weak Convergence and Empirical Processes: With Applications to Statistics. Springer Science & Business Media, 1996.
386
+
387
+ Dmitry Yarotsky. Error bounds for approximations with deep relu networks. Neural Networks, 94: 103–114, 2017.
388
+
389
+ 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.
390
+
391
+ Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
392
+
393
+ 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.
394
+
395
+ # Supplementary Materials for “Understanding GANs via disconnected Support Detection”
396
+
397
+ 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$ .
398
+
399
+ # A SOME ADDITIONAL INFORMATION
400
+
401
+ # A Rigorous Definition of $S _ { \alpha , J }$
402
+
403
+ 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
404
+
405
+ $$
406
+ \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 } ) ,
407
+ $$
408
+
409
+ 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
410
+
411
+ $$
412
+ 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\} .
413
+ $$
414
+
415
+ 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 } }$ .
416
+
417
+ # A Support of Probability Measures
418
+
419
+ 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
420
+
421
+ $$
422
+ \mathrm { S u p p } ( P ) : = \bigg \{ x \in I ^ { D } \ | \ P ( N _ { x } ) > 0 , \forall N _ { x } \in \Sigma \bigg \} .
423
+ $$
424
+
425
+ # B PROOFS
426
+
427
+ # B.1 PROOF OF LEMMA 1
428
+
429
+ 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
430
+
431
+ $$
432
+ P _ { X } ( B ) = P _ { Z } ( \gamma _ { m } ^ { - 1 } ( B ) ) = \int _ { \gamma _ { m } ^ { - 1 } ( B ) } p _ { Z } ( z ) d z ,
433
+ $$
434
+
435
+ where $p _ { Z }$ is a density function of a uniform measure $P _ { Z }$ . By changing variables $x = \gamma _ { m } ( z )$ , we have
436
+
437
+ $$
438
+ \int _ { \gamma _ { m } ^ { - 1 } ( B ) } p _ { Z } ( z ) d z = \int _ { B } p _ { Z } ( \gamma _ { m } ^ { - 1 } ( x ) ) J _ { \gamma _ { m } } ( x ) d x ,
439
+ $$
440
+
441
+ 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
442
+
443
+ $$
444
+ P _ { X } ( B ) = \int _ { B } J _ { g _ { m } } ( x ) d x = : \int _ { B } p _ { m } ( x ) d x ,
445
+ $$
446
+
447
+ and $p _ { m }$ is $\beta$ -smooth since $\gamma _ { m }$ is $\beta + 1$ -smooth and bijective.
448
+
449
+ # B.2 PROOF OF LEMMA 2
450
+
451
+ 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. □
452
+
453
+ 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.
454
+
455
+ 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
456
+
457
+ $$
458
+ \widetilde { \boldsymbol { g } } _ { m } ( \boldsymbol { x } ) = ( \gamma _ { m , 1 } ( \boldsymbol { x } ) , . . . , \gamma _ { m , D } ( \boldsymbol { x } ) ) ^ { \top } ,
459
+ $$
460
+
461
+ where $\gamma _ { m , d } \in H ^ { \beta } ( I ^ { D } )$ . Then, we obtain the form of $g ^ { * }$ as
462
+
463
+ $$
464
+ g ^ { * } = \sum _ { m \in [ M ] } \widetilde { g } _ { m } \otimes \pmb { I } _ { \widetilde { S } _ { m } } .
465
+ $$
466
+
467
+ Also, by the definition of $\mathcal { S } _ { 2 \beta , J }$ which contains $\widetilde { S } _ { m }$ , we obtain the form
468
+
469
+ $$
470
+ { \cal I } _ { { \widetilde { \cal S } } _ { m } } = \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } ,
471
+ $$
472
+
473
+ with existing $\psi _ { h _ { m , j } }$ . Then, we have
474
+
475
+ $$
476
+ g ^ { * } = \sum _ { m \in [ M ] } \widetilde { g } _ { m } \bigotimes _ { j \in [ J ] } \psi _ { h _ { m , j } } .
477
+ $$
478
+
479
+ 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)).
480
+
481
+ 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 ) } )$ .
482
+
483
+ We consider a neural network
484
+
485
+ $$
486
+ \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 ) ) ) .
487
+ $$
488
+
489
+ Then, an approximation error is evaluated as
490
+
491
+ $$
492
+ \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}
493
+ $$
494
+
495
+ where the last inequality follows the Hölder’s inequality.
496
+
497
+ About $T _ { 1 , m }$ , there exists a corresponding $\zeta [ \Theta _ { \gamma , d , m } ]$ such that
498
+
499
+ $$
500
+ \begin{array} { r } { \| \gamma _ { m , d } - \zeta [ \Theta _ { \gamma , d , m } ] \| _ { L ^ { 2 } } \lesssim \| \Theta _ { \gamma , d , m } \| _ { 1 } ^ { - ( \beta + 1 ) / D } , } \end{array}
501
+ $$
502
+
503
+ 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
504
+
505
+ $$
506
+ T _ { 1 , m } \lesssim \| \Theta _ { \gamma , d , m } \| _ { 1 } ^ { - ( \beta + 1 ) / D } .
507
+ $$
508
+
509
+ 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
510
+
511
+ $$
512
+ \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}
513
+ $$
514
+
515
+ 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
516
+
517
+ $$
518
+ \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}
519
+ $$
520
+
521
+ We apply the boundedness of $\zeta [ \Theta _ { h , m , j } ]$ , we have
522
+
523
+ $$
524
+ T _ { 2 , m } \lesssim \sum _ { j \in [ J ] } \| \Theta _ { h , m , j } \| _ { 1 } ^ { - \beta / ( D - 1 ) } + \epsilon _ { \times } .
525
+ $$
526
+
527
+ Combining the bounds for $T _ { 1 , m }$ and $T _ { 2 , m }$ , we bound
528
+
529
+ $$
530
+ \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}
531
+ $$
532
+
533
+ 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
534
+
535
+ $$
536
+ \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 } .
537
+ $$
538
+
539
+ Since $J$ is finite, we obtain the result.
540
+
541
+ # B.4 PROOF OF THEOREM 1
542
+
543
+ By the definition of $\widehat g$ in (2), the following inequality holds
544
+
545
+ $$
546
+ 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 ) ,
547
+ $$
548
+
549
+ for arbitrary $g \in { \mathcal { G } }$ .
550
+
551
+ We consider a bound for $d _ { \mathcal { F } } ( P ^ { \ast } , P _ { \hat { g } } )$ as
552
+
553
+ $$
554
+ \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}
555
+ $$
556
+
557
+ 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
558
+
559
+ $$
560
+ \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}
561
+ $$
562
+
563
+ Here, $i$ denotes an effect from $m$ samplings, $\romannumeral 2$ denotes an approximation error, and iii denotes an uncertainty with the $n$ observations.
564
+
565
+ 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.
566
+
567
+ 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
568
+
569
+ $$
570
+ \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}
571
+ $$
572
+
573
+ with probability at least $1 - 2 \exp ( - \tau )$ for all $\tau > 0$ .
574
+
575
+ 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.
576
+
577
+ By applying the symmetrization and concentration techniques (Proposition 7.10 in Steinwart & Christmann (2008)), we obtain
578
+
579
+ $$
580
+ \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] ,
581
+ $$
582
+
583
+ 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
584
+
585
+ $$
586
+ \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}
587
+ $$
588
+
589
+ with probability at least $1 - \exp ( - \tau )$ for all $\tau > 0$ and $\theta > 0$ .
590
+
591
+ About the term with the Rademacher variable, we also apply a similar strategy (Lemma A.4 in Bartlett et al. (2005)), then obtain
592
+
593
+ $$
594
+ \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 } ) } ,
595
+ $$
596
+
597
+ with probability at least $1 - \exp ( - \tau ^ { \prime } )$ for all $\tau ^ { \prime } > 0$ and $\theta ^ { \prime } > 0$ .
598
+
599
+ 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
600
+
601
+ $$
602
+ \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}
603
+ $$
604
+
605
+ where the last inequality follows a bound for an empirical norm and the boundedness of $\mathcal { H }$ .
606
+
607
+ Combining (10), (11) and (12) and changing variables, we obtain the result.
608
+
609
+ To bound $I$ with $\widetilde { X } _ { 1 } , . . . , \widetilde { X } _ { m } \sim P _ { g }$ , we consider the following value
610
+
611
+ $$
612
+ \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}
613
+ $$
614
+
615
+ 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 } } )$ .
616
+
617
+ Lemma 5. Assume that $f \in { \mathcal { F } }$ is $L _ { 1 }$ -Lipschitz continuous. We obtain
618
+
619
+ $$
620
+ \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 } } )
621
+ $$
622
+
623
+ 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
624
+
625
+ $$
626
+ H : = \left\{ h = f \circ g \vert g \in G , h \in F \right\} \subset \mathcal { H } ,
627
+ $$
628
+
629
+ and we known $| H | = | G | \times | F |$ .
630
+
631
+ 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
632
+
633
+ $$
634
+ \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}
635
+ $$
636
+
637
+ 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. □
638
+
639
+ Now, we have the following entropy bound
640
+
641
+ $$
642
+ \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}
643
+ $$
644
+
645
+ 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
646
+
647
+ $$
648
+ \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}
649
+ $$
650
+
651
+ 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
652
+
653
+ $$
654
+ 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 } .
655
+ $$
656
+
657
+ About $I$ , we define $\Gamma _ { g } : = 2 ( L _ { f } + 1 ) D _ { g } B _ { g }$ and obtain a similar bound as
658
+
659
+ $$
660
+ \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}
661
+ $$
662
+
663
+ where and $A _ { 3 } \stackrel { - } { = } 2 \tau C _ { h } ( 2 / 3 + \check { C } _ { \theta } )$ .
664
+
665
+ 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.
666
+
667
+ $$
668
+ \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}
669
+ $$
670
+
671
+ 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
672
+
673
+ $$
674
+ \begin{array} { r } { i i \leqslant c _ { 2 } M D S _ { g } ^ { - \beta / D } . } \end{array}
675
+ $$
676
+
677
+ Combining the result, we obtain the result of Theorem 1.
678
+
679
+ # B.5 PROOF OF PROPOSITION 1
680
+
681
+ 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.
682
+
683
+ 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
684
+
685
+ $$
686
+ g _ { 2 } ( z ) = ( g _ { 2 , 1 } ( z _ { 1 } ) , . . . , g _ { 2 , D } ( z _ { D } ) ) ^ { \top } ,
687
+ $$
688
+
689
+ 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$ .
md/train/BJ6oOfqge/BJ6oOfqge.md ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TEMPORAL ENSEMBLING FOR SEMI-SUPERVISEDLEARNING
2
+
3
+ Samuli Laine
4
+ NVIDIA
5
+ slaine@nvidia.com
6
+ Timo Aila
7
+ NVIDIA
8
+ taila@nvidia.com
9
+
10
+ # ABSTRACT
11
+
12
+ 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.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ #
25
+
26
+ ![](images/38b18d0d71eb6b1fae203f213789e3b0c907608ab1ec327ffa9fe9198efc68c4.jpg)
27
+ 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.
28
+
29
+ # Algorithm 1 Π-model pseudocode.
30
+
31
+ <table><tr><td colspan="2">Require: xi = training stimuli</td></tr><tr><td colspan="2">Require: L = set of training input indices with known labels Require:yi =labels for labeled inputs i∈L</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">Require: w(t) = unsupervised weight ramp-up function</td></tr><tr><td colspan="2">Require: J fe(x)= stochastic neural network with trainable parameters 0</td></tr><tr><td colspan="2">Require: g(x) = stochastic input augmentation function</td></tr><tr><td colspan="2">for t in [1, num_epochs] do</td></tr><tr><td colspan="2">for each minibatch B do</td></tr><tr><td>Zi∈B←fe(g(xi∈B))</td><td>&gt; evaluate network outputs for augmented inputs</td></tr><tr><td>ZieB←fo(g(xi∈B))</td><td>V again,with different dropout and augmentation</td></tr><tr><td>loss ←-∑ie(BnL)log Zilyi]</td><td> supervised loss component</td></tr><tr><td>+w(t)oB∑ieBllzi-zll2</td><td>&gt; unsupervised loss component</td></tr><tr><td></td><td></td></tr><tr><td>update θ using, e.g., ADAM</td><td>D update network parameters</td></tr><tr><td>end for</td><td></td></tr><tr><td>end for</td><td></td></tr><tr><td>return θ</td><td></td></tr></table>
32
+
33
+ # 2 SELF-ENSEMBLING DURING TRAINING
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ # 2.1 Π-MODEL
40
+
41
+ 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.
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ 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.
50
+
51
+ # 2.2 TEMPORAL ENSEMBLING
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ 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.
60
+
61
+ <table><tr><td>Require: xi = training stimuli</td><td></td></tr><tr><td></td><td>Require: L = set of training input indices with known labels</td></tr><tr><td></td><td></td></tr><tr><td></td><td>Require: Yi = labels for labeled inputs i ∈ L</td></tr><tr><td></td><td>Require: α =ensembling momentum, O ≤α&lt;1</td></tr><tr><td></td><td>Require: w(t) = unsupervised weight ramp-up function Require: fe(x) = stochastic neural network with trainable parameters 0</td></tr><tr><td></td><td>Require: g(x) = stochastic input augmentation function</td></tr><tr><td>Z←O[N×C]</td><td>Dinitialize ensemble predictions</td></tr><tr><td>←O[N×C]</td><td>&gt;initialize target vectors</td></tr><tr><td>for t in&#x27;[1, num-epochs] do</td><td></td></tr><tr><td>for each minibatch B do</td><td></td></tr><tr><td>Zi∈B←fe(g(xi∈B,t))</td><td>&gt; evaluate network outputs for augmented inputs</td></tr><tr><td>loss ←-∑ie(BnL)log zi[yi]</td><td> supervised loss component</td></tr><tr><td>+ w(t)B∑ieBllzi -ill2</td><td>unsupervised loss component</td></tr><tr><td>update 0 using, e.g.,ADAM</td><td>update network parameters</td></tr><tr><td>end for Z←αZ+(1-α)z</td><td></td></tr><tr><td></td><td>&gt;accumulate ensemble predictions</td></tr><tr><td>←Z/(1-at)</td><td>V construct target vectors by bias correction</td></tr><tr><td>end for</td><td></td></tr><tr><td>return θ</td><td></td></tr></table>
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ # 3 RESULTS
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ Table 1: CIFAR-10 results with 4000 labels, averages of 10 runs (4 runs for all labels).
74
+
75
+ <table><tr><td></td><td colspan="2">Errorrate(%)with#labels</td></tr><tr><td>Supervised-only</td><td>4000 35.56 ±1.59</td><td>All (50000) 7.33 ± 0.04</td></tr><tr><td>with augmentation Conv-Large, I-model (Rasmus et al., 2015)</td><td>34.85 ± 1.65 20.40 ± 0.47</td><td>6.05 ± 0.15</td></tr><tr><td>CatGAN (Springenberg,2016) GAN of Salimans et al. (2016)</td><td>19.58 ± 0.58</td><td></td></tr><tr><td>II-model</td><td>18.63 ± 2.32</td><td></td></tr><tr><td>II-model with augmentation</td><td>16.55 ± 0.29</td><td>6.90±0.07</td></tr><tr><td>Temporal ensembling with augmentation</td><td>12.36 ± 0.31 12.16 ± 0.24</td><td>5.56 ± 0.10 5.60 ± 0.10</td></tr></table>
76
+
77
+ Table 2: SVHN results for 500 and 1000 labels, averages of 10 runs (4 runs for all labels).
78
+
79
+ <table><tr><td rowspan="2">Model</td><td colspan="3">Error rate(%)with # labels</td></tr><tr><td>500</td><td>1000</td><td>All (73257)</td></tr><tr><td>Supervised-only with augmentation</td><td>35.18 ± 5.61 31.59 ± 3.60</td><td>20.47± 2.64 19.30 ± 3.89</td><td>3.05± 0.07 2.88 ±0.03</td></tr><tr><td>DGN (Kingma et al., 2014) Virtual Adversarial (Miyato et al., 2016)</td><td></td><td>36.02 ± 0.10</td><td></td></tr><tr><td>ADGM (Maalge et al., 2016)</td><td></td><td>24.63 22.86</td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>SDGM (Maalge et al., 2016)</td><td></td><td>16.61 ± 0.24</td><td></td></tr><tr><td>GAN of Salimans et al. (2016)</td><td>18.44 ± 4.8</td><td>8.11 ± 1.3</td><td></td></tr><tr><td>II-model</td><td>7.05 ± 0.30</td><td>5.43 ± 0.25</td><td>2.78 ± 0.03</td></tr><tr><td>II-model with augmentation</td><td>6.65 ± 0.53</td><td></td><td></td></tr><tr><td></td><td></td><td>4.82 ± 0.17</td><td>2.54 ± 0.04</td></tr><tr><td>Temporal ensembling with augmentation</td><td>5.12 ± 0.13</td><td>4.42 ± 0.16</td><td>2.74± 0.06</td></tr></table>
80
+
81
+ # 3.1 CIFAR-10
82
+
83
+ 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.
84
+
85
+ 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.
86
+
87
+ 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 \%$ ).
88
+
89
+ # 3.2 SVHN
90
+
91
+ 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.
92
+
93
+ Table 3: CIFAR-100 results with 10000 labels, averages of 10 runs (4 runs for all labels).
94
+
95
+ <table><tr><td></td><td colspan="2">Error rate(%)with#labels</td></tr><tr><td>Supervised-only</td><td>10000 51.21 ± 0.33</td><td>All (50000) 29.14±0.25</td></tr><tr><td>with augmentation</td><td>44.56 ± 0.30</td><td>26.42 ± 0.17</td></tr><tr><td>II-model II-model with augmentation Temporal ensembling with augmentation</td><td>43.43± 0.54 39.19 ± 0.36 38.65 ± 0.51</td><td>29.06 ± 0.21 26.32 ± 0.04 26.30 ± 0.15</td></tr></table>
96
+
97
+ Table 4: CIFAR- $1 0 0 +$ Tiny Images results, averages of 10 runs.
98
+
99
+ <table><tr><td rowspan="2"></td><td colspan="2">Error rate(%) with # unlabeled auxiliary inputs from Tiny Images</td></tr><tr><td>Random 500k</td><td>Restricted 237k</td></tr><tr><td>I-model with augmentation</td><td>25.79 ± 0.17</td><td>25.43 ± 0.32</td></tr><tr><td>Temporal ensembling with augmentation</td><td>23.62 ± 0.23</td><td>23.79 ± 0.24</td></tr></table>
100
+
101
+ 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.
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ # 3.3 CIFAR-100 AND TINY IMAGES
108
+
109
+ 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.
110
+
111
+ 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.
112
+
113
+ ![](images/89b98315ac994464061b0cc8451375aaa1eed7b2c0327627a552438d55a9870e.jpg)
114
+ 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.
115
+
116
+ 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.
117
+
118
+ # 3.4 SUPERVISED LEARNING
119
+
120
+ 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.
121
+
122
+ 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.
123
+
124
+ # 3.5 TOLERANCE TO INCORRECT LABELS
125
+
126
+ 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.
127
+
128
+ 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).
129
+
130
+ # 4 RELATED WORK
131
+
132
+ 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.
133
+
134
+ $\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.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ 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.
141
+
142
+ 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.
143
+
144
+ 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
145
+
146
+ Table 5: The network architecture used in all of our tests.
147
+
148
+ <table><tr><td>NAME input</td><td>DESCRIPTION 32×32 RGB image</td></tr><tr><td>noise convla conv1b conv1c pool1 drop1 conv2a conv2b conv2c pool2 drop2 conv3a conv3b conv3c pool3 dense output</td><td>Additive Gaussian noise g = 0.15 128 filters,3 × 3,pad = &#x27;same&#x27;,LReLU(α = 0.1) 128 filters,3 × 3,pad= &#x27;same&#x27;,LReLU(α = 0.1) 128 filters,3 × 3,pad = &#x27;same&#x27;,LReLU(α = 0.1) Maxpool 2 × 2 pixels Dropout, p = 0.5 256 filters,3 × 3,pad= &#x27;same&#x27;,LReLU(α = 0.1) 256 filters,3 × 3,pad = &#x27;same&#x27;,LReLU(α = 0.1) 256 filters,3 × 3,pad=&#x27;same&#x27;,LReLU(α = 0.1) Maxpool 2 × 2 pixels Dropout, p = 0.5 512 filters,3 × 3,pad =&#x27;valid,LReLU(α = 0.1) 256 filters,1 × 1,LReLU(α = 0.1) 128 filters,1 × 1,LReLU(α = 0.1) Global average pool (6 × 6 -→ 1×1 pixels) Fully connected 128 →10 Softmax</td></tr></table>
149
+
150
+ could be an interesting avenue for future work to incorporate a generative component to our solution.
151
+ We also envision that our methods could be applied to regression-type learning tasks.
152
+
153
+ # 5 ACKNOWLEDGEMENTS
154
+
155
+ 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.
156
+
157
+ # REFERENCES
158
+
159
+ Philip Bachman, Ouais Alsharif, and Doina Precup. Learning with pseudo-ensembles. In Advances in Neural Information Processing Systems 27 (NIPS). 2014.
160
+
161
+ Leo Breiman. Bagging predictors. Machine Learning, 24(2), 1996.
162
+
163
+ Sander Dieleman, Jan Schluter, Colin Raffel, Eben Olson, Søren Kaae Sønderby, et al. Lasagne: ¨ First release., 2015.
164
+
165
+ Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. CoRR, abs/1506.02142, 2016.
166
+
167
+ Benjamin Graham. Fractional max-pooling. CoRR, abs/1412.6071, 2014.
168
+
169
+ 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.
170
+
171
+ G. E. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015.
172
+
173
+ Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q. Weinberger. Deep networks with stochastic depth. CoRR, abs/1603.09382, 2016.
174
+
175
+ 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.
176
+
177
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. CoRR, abs/1602.05473, 2016.
184
+
185
+ 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.
186
+
187
+ Dmytro Mishkin and Jiri Matas. All you need is a good init. In Proc. International Conference on Learning Representations (ICLR), 2016.
188
+
189
+ 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.
190
+
191
+ Augustus Odena. Semi-supervised learning with generative adversarial networks. Data Efficient Machine Learning workshop at ICML 2016, 2016.
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. CoRR, abs/1602.07868, 2016.
204
+
205
+ Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. CoRR, abs/1606.03498, 2016.
206
+
207
+ 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.
208
+
209
+ Saurabh Singh, Derek Hoiem, and David A. Forsyth. Swapout: Learning an ensemble of deep architectures. CoRR, abs/1605.06465, 2016.
210
+
211
+ Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. In Proc. International Conference on Learning Representations (ICLR), 2016.
212
+
213
+ Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806, 2014.
214
+
215
+ 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.
216
+
217
+ Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. CoRR, abs/1406.2080, 2014.
218
+
219
+ Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. CoRR, abs/1605.02688, May 2016.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ David Yarowsky. Unsupervised word sense disambiguation rivaling supervised methods. In Proceedings of the 33rd Annual Meeting on Association for Computational Linguistics, ACL ’95, 1995.
228
+
229
+ Xiaojin Zhu. Semi-supervised learning literature survey. Technical Report 1530, Computer Sciences, University of Wisconsin-Madison, 2005.
230
+
231
+ Xiaojin Zhu and Zoubin Ghahramani. Learning from labeled and unlabeled data with label propagation. Technical Report CMU-CALD-02-107, Carnegie Mellon University, 2002.
232
+
233
+ A NETWORK ARCHITECTURE, TEST SETUP, AND TRAINING PARAMETERS
234
+
235
+ 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.
236
+
237
+ 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.
238
+
239
+ 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.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ <table><tr><td>Label</td><td>#</td><td>Label #</td><td>Label</td><td>#</td><td>Label #</td></tr><tr><td>apple</td><td>2242</td><td>baby 2771</td><td>bear</td><td>2242</td><td>beaver 2116</td></tr><tr><td>bed</td><td>2767</td><td>bee 2193</td><td>beetle</td><td>2173</td><td>bicycle 2599</td></tr><tr><td>bottle</td><td>2212</td><td>bowl 2707</td><td>boy</td><td>2234</td><td>bridge 2274</td></tr><tr><td>bus</td><td>3068</td><td>butterfly 3036</td><td>camel</td><td>2121 can</td><td>2461</td></tr><tr><td>castle</td><td>3094</td><td>caterpillar 2382</td><td>cattle</td><td>2089</td><td>chair 2552</td></tr><tr><td>chimpanzee</td><td>1706</td><td>clock 2375</td><td>cloud</td><td>2390</td><td>cockroach 2318</td></tr><tr><td>couch</td><td>2171</td><td>crab 2735</td><td>crocodile</td><td>2712 cup</td><td>2287</td></tr><tr><td>dinosaur</td><td>2045</td><td>dolphin 2504</td><td>elephant</td><td>2794 fish*</td><td>3082</td></tr><tr><td>flatfish</td><td>1504</td><td>forest 2244</td><td>fox</td><td>2684 girl</td><td>2204</td></tr><tr><td>hamster</td><td>2294</td><td>house 2320</td><td>kangaroo</td><td>2563</td><td>keyboard 1948</td></tr><tr><td>lamp</td><td>2242</td><td>lawn_mower 1929</td><td>leopard</td><td>2139 lion</td><td>3045</td></tr><tr><td>lizard</td><td>2130</td><td>lobster 2136</td><td>man</td><td>2248</td><td>maple* 2149</td></tr><tr><td>motorcycle</td><td>2168</td><td>mountain 2249</td><td>mouse</td><td>2128</td><td>mushroom 2390</td></tr><tr><td>oak_tree</td><td>1995</td><td>orange 2650</td><td>orchid</td><td>1902</td><td>otter 2073</td></tr><tr><td>palm_tree</td><td>2107</td><td>pear 2120</td><td>pickup_truck</td><td>2478</td><td>pine_tree 2341</td></tr><tr><td>plain</td><td>2198</td><td>plate 3109</td><td>poppy</td><td>2730</td><td>porcupine 1900</td></tr><tr><td>possum</td><td>2008</td><td>rabbit 2408</td><td>raccoon</td><td>2587 ray</td><td>2564</td></tr><tr><td>road</td><td>2862</td><td>rocket 2180</td><td>rose</td><td>2237 sea</td><td>2122</td></tr><tr><td>seal</td><td>2159</td><td>shark 2157</td><td>shrew</td><td>1826</td><td>skunk 2450</td></tr><tr><td>skyscraper</td><td>2298</td><td>snail 2369</td><td>snake</td><td>2989</td><td>spider 3024</td></tr><tr><td>squirrel</td><td>2374</td><td>streetcar 1905</td><td>sunflower</td><td>2761</td><td>sweet-pepper 1983</td></tr><tr><td>table</td><td>3137</td><td>tank 1897</td><td>telephone</td><td>1889</td><td>television 2973</td></tr><tr><td>tiger</td><td>2603</td><td>tractor 1848</td><td>train</td><td>3020</td><td>trout 2726</td></tr><tr><td>tulip</td><td>2160</td><td>turtle 2438</td><td>wardrobe</td><td>2029</td><td>whale 2597</td></tr><tr><td>willow_tree</td><td>2040</td><td>wolf 2423</td><td>woman</td><td>2446</td><td>worm 2945</td></tr></table>
md/train/BJ8c3f-0b/BJ8c3f-0b.md ADDED
@@ -0,0 +1,494 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTO-ENCODING SEQUENTIAL MONTE CARLO
2
+
3
+ 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,
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ # 2 BACKGROUND
16
+
17
+ # 2.1 STATE-SPACE MODELS
18
+
19
+ 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}$ .
20
+
21
+ 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).
22
+
23
+ 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$ .
24
+
25
+ # 2.2 SEQUENTIAL MONTE CARLO
26
+
27
+ 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.
28
+
29
+ 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:
30
+
31
+ $$
32
+ \hat { Z } _ { \mathrm { S M C } } : = \prod _ { t = 1 } ^ { T } \left[ \frac { 1 } { K } \sum _ { k = 1 } ^ { K } w _ { t } ^ { k } \right] .
33
+ $$
34
+
35
+ # Algorithm 1: Sequential Monte Carlo
36
+
37
+ Data: observed values $y _ { 1 : T }$ , model parameters $\theta$ , proposal parameters $\phi$ begin
38
+
39
+ Sample initial particle values $x _ { 1 } ^ { k } \sim q _ { 1 , \phi } ( \cdot | y _ { 1 } )$
40
+
41
+ Compute and normalize weights:
42
+
43
+ $$
44
+ 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 } } .
45
+ $$
46
+
47
+ Initialize particle set: $\tilde { x } _ { 1 } ^ { k } \gets x _ { 1 } ^ { k }$ for $t = 2 , 3 , \dots , T$ do
48
+
49
+ 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 } )$
50
+
51
+ $x _ { t } ^ { k } \sim q _ { t , \phi } ( \cdot | y _ { 1 : t } , \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } )$
52
+
53
+ $\tilde { x } _ { 1 : t } ^ { k } \gets ( \tilde { x } _ { 1 : t - 1 } ^ { a _ { t - 1 } ^ { k } } , x _ { t } ^ { k } )$
54
+
55
+ Compute and normalize weights:
56
+
57
+ $$
58
+ 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 } } ) } ,
59
+ $$
60
+
61
+ $$
62
+ \bar { w } _ { t } ^ { k } = \frac { w _ { t } ^ { k } } { \sum _ { \ell = 1 } ^ { K } w _ { t } ^ { \ell } } .
63
+ $$
64
+
65
+ 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 }$
66
+
67
+ 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.
68
+
69
+ # 2.3 IMPORTANCE WEIGHTED AUTO-ENCODERS
70
+
71
+ 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:
72
+
73
+ $$
74
+ \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}
75
+ $$
76
+
77
+ 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
78
+
79
+ $$
80
+ \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 .
81
+ $$
82
+
83
+ 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.
84
+
85
+ # 3 AUTO-ENCODING SEQUENTIAL MONTE CARLO
86
+
87
+ 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.
88
+
89
+ # 3.1 OBJECTIVE FUNCTION
90
+
91
+ 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
92
+
93
+ $$
94
+ \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 } ,
95
+ $$
96
+
97
+ 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,
98
+
99
+ $$
100
+ 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) .
101
+ $$
102
+
103
+ 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
104
+
105
+ $$
106
+ \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 ) .
107
+ $$
108
+
109
+ 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.
110
+
111
+ # 3.2 GRADIENT ESTIMATION
112
+
113
+ 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
114
+
115
+ 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 } )$ .
116
+
117
+ 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.
118
+
119
+ # 3.3 BIAS & IMPLICATIONS ON THE PROPOSALS
120
+
121
+ 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.
122
+
123
+ 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
124
+
125
+ $$
126
+ \mathtt { E L B O } : = \int Q ( x ) \log \frac { \tilde { P } ( x ) } { Q ( x ) } \mathrm { d } x ,
127
+ $$
128
+
129
+ is a lower bound on $\log Z _ { P }$ and satisfies
130
+
131
+ $$
132
+ \begin{array} { r } { { \bf E L B O } = \log Z _ { P } - { \bf K L } \left( { Q } \vert \vert { P } \right) . } \end{array}
133
+ $$
134
+
135
+ 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}$ .
136
+
137
+ 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.
138
+
139
+ 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:
140
+
141
+ $$
142
+ \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}
143
+ $$
144
+
145
+ is the implied normalized target density.
146
+
147
+ 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
148
+
149
+ $$
150
+ \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}
151
+ $$
152
+
153
+ Similarly, in the case of AESMC, we obtain
154
+
155
+ $$
156
+ \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}
157
+ $$
158
+
159
+ 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.
160
+
161
+ 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$
162
+
163
+ 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
164
+
165
+ $\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 }$ ,
166
+
167
+ where $\pi _ { t } ( x _ { 1 : t } )$ are the intermediate targets used by SMC.
168
+
169
+ 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.
170
+
171
+ # 4 IMPROVING PROPOSAL LEARNING
172
+
173
+ 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.
174
+
175
+ 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$ .
176
+
177
+ ![](images/dc720098a89d8d55535151b2c0ef5881c24c5c1b5a0a6cce9e1a02a6cc76accc.jpg)
178
+ Figure 1: Density estimate of $\nabla _ { \phi }$ ELBO for different $K$
179
+
180
+ 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):
181
+
182
+ $$
183
+ \mathrm { { s N R } } : = { \frac { \mathbb { E } [ I _ { K } ] } { \sqrt { \operatorname { V a r } [ I _ { K } ] } } } = O \left( { \sqrt { \frac { 1 } { K } } } \right) .
184
+ $$
185
+
186
+ 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.
187
+
188
+ # 4.1 ALTERNATING ELBOS
189
+
190
+ 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.
191
+
192
+ # 5 EXPERIMENTS
193
+
194
+ 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?
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ # 5.1 LINEAR GAUSSIAN STATE SPACE MODEL
201
+
202
+ Given the following LGSSM
203
+
204
+ $$
205
+ \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}
206
+ $$
207
+
208
+ 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.
209
+
210
+ 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$ .
211
+
212
+ 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.
213
+
214
+ ![](images/4cd5d1e323125f8a90dc905ddcae3f5ed2ac35f13715438c65c2ccf53be6a952.jpg)
215
+ 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.
216
+
217
+ # 5.2 PROPOSAL LEARNING
218
+
219
+ We now investigate how learning $\phi$ , i.e. the proposal, is affected by the the choice of ELBO and the number of particles.
220
+
221
+ 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$ .
222
+
223
+ 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.
224
+
225
+ ![](images/6567c0e04eeda2547bf9fe3ac06bde6dad865fe2d992c5a353320bfb93dfefc2.jpg)
226
+ 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.
227
+
228
+ # 5.3 MOVING AGENTS
229
+
230
+ 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.
231
+
232
+ 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
233
+
234
+ $$
235
+ \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}
236
+ $$
237
+
238
+ 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.
239
+
240
+ 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.
241
+
242
+ 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.
243
+
244
+ ![](images/52f5b5eec90c2bbb3afee37e2e76ddda12709627513fbf853433318be013de1c.jpg)
245
+ 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.
246
+
247
+ <table><tr><td>Particles</td><td>Method</td><td> Moving Agents</td></tr><tr><td rowspan="2">10</td><td>IWAE</td><td>-357.3</td></tr><tr><td>AESMC</td><td>-356.7</td></tr><tr><td rowspan="2">20</td><td>IWAE</td><td>-356.6</td></tr><tr><td>AESMC</td><td>-356.1</td></tr><tr><td rowspan="2">40</td><td>IWAE</td><td>-356.2</td></tr><tr><td>AESMC</td><td>-356.1</td></tr></table>
248
+
249
+ # 6 CONCLUSIONS
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ # ACKNOWLEDGMENTS
256
+
257
+ 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.
258
+
259
+ # REFERENCES
260
+
261
+ Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016.
262
+
263
+ 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.
264
+
265
+ P Del Moral. Feynman-Kac formulae: genealogical and interacting particle systems with applications. Probability and its applications, 2004.
266
+
267
+ 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.
268
+
269
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In ICLR, 2014.
270
+
271
+ Tuan Anh Le, Maximilian Igl, Tom Jin, Tom Rainforth, and Frank Wood. Auto-encoding sequential Monte Carlo. arXiv preprint arXiv:1705.10306v1, 2017.
272
+
273
+ 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.
274
+
275
+ Christian A Naesseth, Scott W Linderman, Rajesh Ranganath, and David M Blei. Variational sequential Monte Carlo. arXiv preprint arXiv:1705.11140, 2017.
276
+
277
+ Peter Ondrúška and Ingmar Posner. Deep tracking: Seeing beyond seeing using recurrent neural networks. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
278
+
279
+ 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.
280
+
281
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014.
282
+
283
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
284
+
285
+ # A GRADIENTS
286
+
287
+ The goal is to obtain an unbiased estimator for the gradient
288
+
289
+ $$
290
+ \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 } .
291
+ $$
292
+
293
+ # A.1 FULL REINFORCE
294
+
295
+ We express the required quantity as
296
+
297
+ $$
298
+ \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}
299
+ $$
300
+
301
+ 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}$
302
+
303
+ # A.2 REINFORCE & REPARAMETERIZATION
304
+
305
+ We express the required quantity as
306
+
307
+ $$
308
+ \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}
309
+ $$
310
+
311
+ $$
312
+ \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}
313
+ $$
314
+
315
+ 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.
316
+
317
+ ![](images/0c001503f0d836262d90538133c5249f1a071c7502d45f41a58ca2188780866e.jpg)
318
+ 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.
319
+
320
+ # B PROOFS FOR BIAS & IMPLICATIONS ON THE PROPOSALS
321
+
322
+ Derivation of (9).
323
+
324
+ $$
325
+ \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}
326
+ $$
327
+
328
+ 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). □
329
+
330
+ Proof of Proposition $^ { l }$ . $( \implies$ ) Substituting for $Q _ { \mathrm { I S } } ( x ^ { 1 : K } ) = P _ { \mathrm { I S } } ( x ^ { 1 : K } )$ , we obtain
331
+
332
+ $$
333
+ \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}
334
+ $$
335
+
336
+ 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:
337
+
338
+ $$
339
+ q ( x ^ { 1 } | y ) = { \frac { 1 } { K } } \left[ p ( x ^ { 1 } | y ) + \sum _ { k = 2 } ^ { K } q ( x ^ { 1 } | y ) \right] .
340
+ $$
341
+
342
+ Rearranging gives us $q ( x ^ { 1 } | y ) = p ( x ^ { 1 } | y )$ for all $x ^ { 1 }$ .
343
+
344
+ ( $\Longleftarrow )$ Substituting $p ( x ^ { k } | y ) = q ( x ^ { k } | y )$ , we obtain
345
+
346
+ $$
347
+ \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}
348
+ $$
349
+
350
+ 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 } )$ .
351
+
352
+ $( \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).
353
+
354
+ 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
355
+
356
+ $$
357
+ \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}
358
+ $$
359
+
360
+ are constant with respect to $x _ { 1 : t }$
361
+
362
+ 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 } )$
363
+
364
+ $$
365
+ \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.
366
+ $$
367
+
368
+ $$
369
+ \mathrm { f o r } \tau = 1 , \dots , T , \kappa = 1 , \dots , K ,
370
+ $$
371
+
372
+ $$
373
+ { \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.
374
+ $$
375
+
376
+ $$
377
+ \mathrm { f o r } \tau = 1 , \dots , T - 1 , \kappa = 1 , \dots , K ,
378
+ $$
379
+
380
+ $$
381
+ \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.
382
+ $$
383
+
384
+ $$
385
+ \mathfrak { r } \tau = 1 , \dots , T , \kappa = 1 , \dots , K ,
386
+ $$
387
+
388
+ $$
389
+ \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.
390
+ $$
391
+
392
+ ![](images/cbc9d6aef4f0538975d17e50bd337d59a91912fa48e35dc25c8adc563cb38272.jpg)
393
+ 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.
394
+
395
+ 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
396
+
397
+ $$
398
+ \begin{array} { r } { \bar { w } _ { t } ^ { k } = w _ { t } ( x _ { 1 : t } ^ { \prime } ) , } \\ { \tilde { w } _ { t } ^ { k } = w _ { t } ( x _ { 1 : t } ) . } \end{array}
399
+ $$
400
+
401
+ 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$ .
402
+
403
+ Now, for $x _ { 1 : t }$ , consider the implied proposal by rearranging (41) and (42)
404
+
405
+ $$
406
+ \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}
407
+ $$
408
+
409
+ 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
410
+
411
+ $$
412
+ w _ { 1 } = \int \gamma _ { 1 } ( x _ { 1 } ) \mathrm { d } x _ { 1 } = Z _ { 1 } ,
413
+ $$
414
+
415
+ and for $t = 2 , \ldots , T$ :
416
+
417
+ $$
418
+ \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}
419
+ $$
420
+
421
+ 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
422
+
423
+ $$
424
+ \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 } ,
425
+ $$
426
+
427
+ such that each $\pi _ { t } ( x _ { 1 : t } )$ must be the corresponding marginal of the final target. We also have
428
+
429
+ $$
430
+ \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}
431
+ $$
432
+
433
+ ( $\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$ . □
434
+
435
+ # C EXPERIMENTS
436
+
437
+ # C.1 VRNN
438
+
439
+ In the following we give the details of our VRNN architecture. The generative model is given by:
440
+
441
+ $$
442
+ 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 } )
443
+ $$
444
+
445
+ where
446
+
447
+ $$
448
+ \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}
449
+ $$
450
+
451
+ and the proposal distribution is given by
452
+
453
+ $$
454
+ 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 } ) )
455
+ $$
456
+
457
+ 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.
458
+
459
+ 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.
460
+
461
+ A Gated Recurrent Unit (GRU) is used as RNN and if not stated otherwise ReLUs are used in between fully connected layers.
462
+
463
+ 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.
464
+
465
+ For the moving agents dataset we use ADAM with a learning rate of $1 0 ^ { - 3 }$ .
466
+
467
+ 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$ .
468
+
469
+ # C.2 MOVING AGENTS
470
+
471
+ 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.
472
+
473
+ 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.
474
+
475
+ 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.
476
+
477
+ 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.
478
+
479
+ # C.3 OPTIMIZING ONLY PROPOSAL PARAMETERS
480
+
481
+ 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 \}$ .
482
+
483
+ 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$ .
484
+
485
+ ![](images/269f80b047a4394ac71489e5f10122aa501860f582c01f8976d6789295004845.jpg)
486
+ 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.
487
+
488
+ 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:
489
+
490
+ • 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$ .
491
+
492
+ ![](images/15fd0276bd085fdac6d0ab0bfddbc173a09234825ea542df3a9280db0f6344e6.jpg)
493
+
494
+ 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.
md/train/BJfguoAcFm/BJfguoAcFm.md ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING KOLMOGOROV MODELS FOR BINARY RANDOM VARIABLES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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).
18
+
19
+ # 2 SYSTEM MODEL
20
+
21
+ 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 \}$ .
22
+
23
+ # 2.1 PROBLEM FORMULATION
24
+
25
+ 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
26
+
27
+ $$
28
+ \mathrm { K M : } \quad \mathbb { P } [ X _ { u , i } = 1 ] = \pmb { \theta } _ { u } ^ { T } \pmb { \psi } _ { i } .
29
+ $$
30
+
31
+ 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$ .
32
+
33
+ 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
34
+
35
+ $$
36
+ \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}
37
+ $$
38
+
39
+ 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).
40
+
41
+ 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.
42
+
43
+ # 2.2 ILLUSTRATIVE EXAMPLE: RECOMMENDATION SYSTEMS
44
+
45
+ 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.
46
+
47
+ 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:
48
+
49
+ $$
50
+ \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]
51
+ $$
52
+
53
+ 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.
54
+
55
+ # 3 PROPOSED ALGORITHM
56
+
57
+ 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
58
+
59
+ $$
60
+ \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}
61
+ $$
62
+
63
+ We then pose the indicator vector refinement, $\psi$ -step, as
64
+
65
+ $$
66
+ \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}
67
+ $$
68
+
69
+ Table 1: $\theta$ -step solution using FW
70
+
71
+ <table><tr><td>function[0*]=FW(Qu,ru,∈) for k=1,2,...,IFw do dk) = ej*, j*=argmin[Vf(0(k)]j</td></tr><tr><td>1≤j≤D 0(k+1)=(1-ak��� ()0() +a(dk</td></tr><tr><td>Stopif|/(+1)-/≤e end for</td></tr></table>
72
+
73
+ Table 2: $\psi$ -step solution using SDR
74
+
75
+ 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$
76
+ end function
77
+
78
+ 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)$ .
79
+
80
+ # 3.1 $\theta$ -STEP: REFINE PMF ESTIMATE
81
+
82
+ 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.
83
+
84
+ # 3.2 $\psi$ -STEP: REFINE INDICATOR ESTIMATE
85
+
86
+ 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):
87
+
88
+ $\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,
89
+
90
+ $$
91
+ { \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
92
+ $$
93
+
94
+ 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)$ .
95
+
96
+ 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.
97
+
98
+ # 3.3 ALGORITHM DESCRIPTION
99
+
100
+ The BCD-based algorithm alternates between refining the indicator and PMF vectors; see Algorithm 1.
101
+ Lemma 2 (Appendix A.6) shows its convergence to a stationary point of $( Q )$ .
102
+
103
+ # Algorithm 1 Iterative computation of KMs
104
+
105
+ // Randomly Initialize $\{ \pmb { \theta } _ { u } ^ { ( 1 ) } \in \mathcal { P } \}$
106
+ 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 }$
107
+ end for
108
+
109
+ # 4 INTERPRETABILITY VIA CAUSAL RELATION
110
+
111
+ # 4.1 CAUSAL RELATIONS
112
+
113
+ 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.
114
+
115
+ 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:
116
+
117
+ $$
118
+ 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 .
119
+ $$
120
+
121
+ Proof: See Authors (Oct 2017) for the proof.
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ 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 }$ .
128
+
129
+ 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 } \}$ .
130
+
131
+ 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.
132
+
133
+ ![](images/0e5b07bb57eb77f772a30b2b495ccf1d66a6716b55c7b035522d6516e6d70e04.jpg)
134
+ Figure 1: Algorithm for CRM (toy example)
135
+
136
+ 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.
137
+
138
+ # 4.2 CAUSAL RELATIONS MINING (CRM)
139
+
140
+ 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
141
+
142
+ $$
143
+ -
144
+ $$
145
+
146
+ 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.
147
+
148
+ # Algorithm 2 Causal Relations Mining (CRM)
149
+
150
+ 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.,
151
+
152
+ $$
153
+ 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
154
+ $$
155
+
156
+ 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 }$
157
+
158
+ # 5 SPECIAL CASES AND APPLICATIONS
159
+
160
+ We highlight relevant special cases and applications of our approach.
161
+
162
+ 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.
163
+
164
+ 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.
165
+
166
+ ![](images/b3e2c13f452e4903e238d2e08ab8210a40e3a9a422abd960d36129b6d066ff89.jpg)
167
+ (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)
168
+ Figure 2: Performance of proposed method
169
+
170
+ # 6 PRACTICAL CONSIDERATIONS
171
+
172
+ 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.
173
+
174
+ 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.
175
+
176
+ # 6.1 LIMITATIONS
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ # 7 NUMERICAL RESULTS
183
+
184
+ # 7.1 APPLICATION TO RECOMMENDATION SYSTEMS
185
+
186
+ 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.
187
+
188
+ 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].
189
+
190
+ 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).
191
+
192
+ 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).
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ # 7.2 APPLICATION TO GENE EXPRESSION
199
+
200
+ Experimental Setup: Following the problem statement in Section 5, we show the usefulness Algorithm 2 for gene expression. We first define another setting.
201
+
202
+ 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.
203
+
204
+ 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
205
+
206
+ ![](images/3e83c5a67ffabb4094d3619e1df9aae239b1f9798a580549fe995875f4c4b261.jpg)
207
+ Figure 3: Training performance of proposed method for REGED0 dataset
208
+
209
+ ![](images/4670ba6b2a70da6e536498971de70458294cf4e6bab45606e0c5bff87a144913.jpg)
210
+ (b) Influence score for each DNA location (Setting 3)
211
+
212
+ (a) Normalized Training RMSE as a function of iterations (Setting 3)
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ # 8 CONCLUSION
219
+
220
+ 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))
221
+
222
+ # REFERENCES
223
+
224
+ Anonymous Authors. Learning elementary representations of random variables. Technical Report, Oct 2017. URL https://tinyurl.com/y7gpu4dc.
225
+
226
+ 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.
227
+
228
+ 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.
229
+
230
+ Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv, 2017.
231
+
232
+ Marguerite Frank and Philip Wolfe. An algorithm for quadratic programming. Naval Research Logistics Quarterly, 3(1-2):95–110, 1956. ISSN 1931-9193.
233
+
234
+ Xiao Fu, Kejun Huang, and Nicholas D. Sidiropoulos. On identifiability of nonnegative matrix factorization. CoRR, abs/1709.00614, 2017.
235
+
236
+ 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.
237
+
238
+ Robert M. Gray. Probability, Random Processes, and Ergodic Properties. Springer, 2nd edition, 2009. ISBN 1441910891, 9781441910899.
239
+
240
+ Patrik O. Hoyer. Non-negative matrix factorization with sparseness constraints. CoRR, cs.LG/0408058, 2004.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ 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.
247
+
248
+ 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.
249
+
250
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521, 2015. doi: 10.1038/nature14539.
251
+
252
+ 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.
253
+
254
+ Zachary Chase Lipton. The mythos of model interpretability. CoRR, abs/1606.03490, 2016.
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ 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.
261
+
262
+ Bill Marr. The top 10 AI and machine learning use cases everyone should know about. Forbes Magazine, Sept 2016.
263
+
264
+ Judea Pearl. Causality: Models, Reasoning and Inference. Cambridge University Press, New York, NY, USA, 2nd edition, 2009. ISBN 052189560X, 9780521895606.
265
+
266
+ Martin Slawski, Matthias Hein, and Pavlo Lutsik. Matrix factorization with binary components. In Advances in Neural Information Processing Systems (NIPS), pp. 3210–3218, 2013.
267
+
268
+ Cyril J. Stark. Expressive recommender systems through normalized nonnegative models. CoRR, abs/1511.04775, 2015.
269
+
270
+ Cyril J. Stark. Expressive recommender systems through normalized nonnegative models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, pp. 1081–1087, 2016a.
271
+
272
+ Cyril J. Stark. Recommender systems inspired by the structure of quantum theory. CoRR, abs/1601.06035, 2016b.
273
+
274
+ 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.
275
+
276
+ 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.
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ # A SUPPLEMENTARY MATERIAL FORLEARNING KOLMOGOROV MODELS FOR BINARY RANDOM VARIABLES
283
+
284
+ A.1 DEFINITIONS
285
+
286
+ A.2 KOLMOGOROV MODEL FOR A RANDOM VARIABLE
287
+
288
+ 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,
289
+
290
+ $$
291
+ \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}
292
+ $$
293
+
294
+ 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,
295
+
296
+ $$
297
+ \mathbb { P } [ X _ { u , i } = 1 ] = \pmb { \theta } _ { u } ^ { T } \psi _ { i } ,
298
+ $$
299
+
300
+ # A.3 RELATED WORK
301
+
302
+ 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.
303
+
304
+ 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.
305
+
306
+ 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.
307
+
308
+ 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,
309
+
310
+ 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.
311
+
312
+ 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.
313
+
314
+ # A.4 KNOWN CONTEXT-DEPENDENT MAP
315
+
316
+ 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$ :
317
+
318
+ $$
319
+ \operatorname* { m i n } _ { \theta _ { u } \in \mathcal { P } } \mathcal { E } ( \{ t _ { i } \} , \{ \theta _ { u } \} )
320
+ $$
321
+
322
+ 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
323
+
324
+ <table><tr><td>TrainingRMSE</td><td>Test RMSE</td></tr><tr><td>0.4468</td><td>0.4468</td></tr></table>
325
+
326
+ Table 3: Normalized errors metrics when the context-dependent map is known (ML100K)
327
+
328
+ 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.
329
+
330
+ # A.5 PROBLEM FORMULATION IN MATRIX FORM
331
+
332
+ 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,
333
+
334
+ $$
335
+ \{ \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 } \ .
336
+ $$
337
+
338
+ 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$ .
339
+
340
+ # A.6 MAIN RESULTS
341
+
342
+ Below, we summarized the results used in the paper; see Authors (Oct 2017) for the proofs.
343
+
344
+ We use following known result to find the descent direction for the FW method (the proof is known).
345
+
346
+ Proposition 2 Consider the following Linear Program $( L P )$ ,
347
+
348
+ $$
349
+ \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 }
350
+ $$
351
+
352
+ Its optimal solution is given by
353
+
354
+ $$
355
+ { \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 }
356
+ $$
357
+
358
+ Thus, the solution reduces to searching over the vector $^ c$ .
359
+
360
+ We show the convergence of the FW algorithm (Table 1).
361
+
362
+ 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 ,$
363
+
364
+ $$
365
+ \| f ( \pmb \theta _ { u } ^ { ( k + 1 ) } ) - f ( \pmb \theta _ { u } ^ { \star } ) \| _ { 2 } \leq \mathcal { O } ( 1 / k ) , k = 1 , 2 , \cdots \boxed { }
366
+ $$
367
+
368
+ Proof: The linear convergence rate for all FW variants, was proved in Jaggi (2013)[Theorem 1].
369
+
370
+ 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.
371
+
372
+ 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),
373
+
374
+ $$
375
+ \eta \leq g ( \psi _ { i } ^ { \star } ) / g ( \hat { \psi } _ { i } ) \leq 1 .
376
+ $$
377
+
378
+ It holds that $\eta = 1$ , with probability $1 - \exp ^ { - \mathcal { O } ( D ) }$ , asymptotically in $D$ . Thus, the relaxation is quasi-optimal.
379
+
380
+ Proof: See (Authors, Oct 2017).
381
+
382
+ 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. 
383
+
384
+ Proof: The convergence is shown in (Authors, Oct 2017).
385
+
386
+ # A.7 ADDITIONAL NUMERICAL RESULTS
387
+
388
+ 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.
389
+
390
+ 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).
391
+
392
+ 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.
393
+
394
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>D=4</td><td rowspan=1 colspan=1>D=8</td><td rowspan=1 colspan=1>D=16</td><td rowspan=1 colspan=1>D=24</td></tr><tr><td rowspan=2 colspan=1>KMNNMMFSVD++K-MNMF</td><td rowspan=1 colspan=1>0.199</td><td rowspan=1 colspan=1>0.2013</td><td rowspan=1 colspan=1>0.1900</td><td rowspan=2 colspan=1>0.18610.21180.226(k = 40)0.226(k = 50)0.21050.192(k = 100)</td></tr><tr><td rowspan=1 colspan=1>0.1940.2290.2280.210一</td><td rowspan=1 colspan=1>0.22550.228(k = 10)0.227(k = 10).2096</td><td rowspan=1 colspan=1>0.20570.227(k = 20)0.2105</td></tr></table>
395
+
396
+ Table 5: Error rate for SDR (Artificial Dataset, $U = 2 0 , I = 4 0 )$ .
397
+
398
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>D=4</td><td rowspan=1 colspan=1>D=8</td><td rowspan=1 colspan=1>D=10</td></tr><tr><td rowspan=1 colspan=1>SDR Accuracy ×10-3</td><td rowspan=1 colspan=1>7.5</td><td rowspan=1 colspan=1>4.4</td><td rowspan=1 colspan=1>4.0</td></tr></table>
md/train/BJgVaG-Ab/BJgVaG-Ab.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOMATA GUIDED HIERARCHICAL REINFORCEMENT LEARNING FOR ZERO-SHOT SKILL COMPOSITION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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:
20
+
21
+ • 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.
22
+
23
+ # 2 PRELIMINARIES
24
+
25
+ 2.1 THE OPTIONS FRAMEWORK IN HIERARCHICAL REINFORCEMENT LEARNING
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ $$
32
+ \pi ^ { \star } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } ^ { \pi } [ R ( \tau _ { T } ) ]
33
+ $$
34
+
35
+ where $\tau _ { T } = ( s _ { 0 } , a _ { 0 } , . . . , s _ { T } , )$ denotes the state-action trajectory from time 0 to $T$
36
+
37
+ 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 } )$ .
38
+
39
+ We consider tasks specified with Truncated Linear Temporal Logic (TLTL). We restrict the set of allowed operators to be
40
+
41
+ $$
42
+ \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}
43
+ $$
44
+
45
+ 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.
46
+
47
+ Any scTLTL formula can be translated into a finite state automata (FSA) with the following definition:
48
+
49
+ 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
50
+
51
+ $$
52
+ 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.
53
+ $$
54
+
55
+ In addition, given an MDP state $s$ , we can calculate the transition in automata states at $s$ by
56
+
57
+ $$
58
+ 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.
59
+ $$
60
+
61
+ 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.
62
+
63
+ The translation from TLTL formula to FSA to can be done automatically with available packages like Lomap Ulusoy (2017).
64
+
65
+ 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.
66
+
67
+ # 3 PROBLEM FORMULATION AND APPROACH
68
+
69
+ We start with the following problem definition:
70
+
71
+ 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
72
+
73
+ $$
74
+ \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 ] .
75
+ $$
76
+
77
+ 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.
78
+
79
+ Problem 1 defines a policy search problem where the trajectories resulting from following the optimal policy should satisfy the given scTLTL formula in expectation.
80
+
81
+ 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 }$ .
82
+
83
+ 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.
84
+
85
+ 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.
86
+
87
+ 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.
88
+
89
+ # 4 FSA AUGMENTED MDP
90
+
91
+ 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
92
+
93
+ 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
94
+
95
+ $$
96
+ \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}
97
+ $$
98
+
99
+ 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
100
+
101
+ $$
102
+ \tilde { R } ( \tilde { s } , \tilde { s } ^ { \prime } ) = \mathbb { 1 } \big ( \rho ( s ^ { \prime } , \mathrm { D } _ { \phi } ^ { q } ) > 0 \big ) ^ { 1 }
103
+ $$
104
+
105
+ 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.
106
+
107
+ $$
108
+ \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] ,
109
+ $$
110
+
111
+ where $\gamma < 1$ is the discount factor, $T$ is the time horizon.
112
+
113
+ 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$ .
114
+
115
+ ![](images/3c903d2c08c52725339b362f483b256fe388c66bbd920a4daefd19076fa0653c.jpg)
116
+ 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 } }$ .
117
+
118
+ 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
119
+
120
+ $$
121
+ \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] .
122
+ $$
123
+
124
+ 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 }$ .
125
+
126
+ 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$ .
127
+
128
+ 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.
129
+
130
+ # 5 AUTOMATA GUIDED TASK COMPOSITION
131
+
132
+ 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.
133
+
134
+ 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
135
+
136
+ $$
137
+ 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.
138
+ $$
139
+
140
+ 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.
141
+
142
+ 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),
143
+
144
+ $$
145
+ \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 ] ,
146
+ $$
147
+
148
+ 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
149
+
150
+ $$
151
+ 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 } } .
152
+ $$
153
+
154
+ Therefore,
155
+
156
+ $$
157
+ \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}
158
+ $$
159
+
160
+ The second step in Equation (13) follows the robustness definition. Recall that the optimal options policies for $q _ { 1 }$ and $q _ { 2 }$ satisfy
161
+
162
+ $$
163
+ \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 .
164
+ $$
165
+
166
+ 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
167
+
168
+ $$
169
+ \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.
170
+ $$
171
+
172
+ We show empirically the use of this switching policy for skill composition and discuss its limitations in the following sections.
173
+
174
+ # 6 EXPERIMENTS AND DISCUSSION
175
+
176
+ # 6.1 GRID WORLD SIMULATION
177
+
178
+ 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
179
+
180
+ ![](images/1eb3c949d61764629b98b19b208991932f17c8a985b85b9cc77beb4410417605.jpg)
181
+ 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.
182
+
183
+ 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.
184
+
185
+ 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 .
186
+
187
+ 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.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ 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$ .
194
+
195
+ ![](images/53ab141929785dc731b4e11f7700c4008e8589cb68e3456f7eb36a824237a826.jpg)
196
+ 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
197
+
198
+ # 6.2 SIMULATED BAXTER
199
+
200
+ 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).
201
+
202
+ 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.
203
+
204
+ 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
205
+
206
+ $$
207
+ 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.
208
+ $$
209
+
210
+ Heuristic rewards for other tasks are defined in a similar manner and are not presented explicitly.
211
+
212
+ ![](images/3bc32d0a570f27a069b6de311bccaed7ad185bd6348e093b1bc05be8cca3e355.jpg)
213
+ 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 }$
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ # 7 CONCLUSION
222
+
223
+ 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.
224
+
225
+ 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
226
+
227
+ # REFERENCES
228
+
229
+ 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.
230
+
231
+ Christel Baier and Joost-Pieter Katoen. Principles Of Model Checking, volume 950. 2008.
232
+
233
+ Calin Belta, Boyan Yordanov, and Ebru Aydin Gol. Formal methods for discrete-time dynamical systems, 2017.
234
+
235
+ 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.
236
+
237
+ 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.
238
+
239
+ 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.
240
+
241
+ Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. arXiv preprint arXiv:1702.08165, 2017.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ Orna Kupferman and Moshe Y Vardi. Model checking of safety properties. Formal Methods in System Design, 19(3):291–314, 2001.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ Xiao Li, Cristian-Ioan Vasile, and Calin Belta. Reinforcement learning with temporal logic rewards. arXiv preprint arXiv:1612.03471, 2016.
260
+
261
+ 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/.
262
+
263
+ 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.
264
+
265
+ Junhyuk Oh, Satinder Singh, Honglak Lee, and Pushmeet Kohli. Zero-Shot Task Generalization with Multi-Task Deep Reinforcement Learning. 2017.
266
+
267
+ Sadra Sadraddini and Calin Belta. Robust Temporal Logic Model Predictive Control. 53rd Annual Conference on Communication, Control, and Computing (Allerton), 2015.
268
+
269
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ 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.
276
+
277
+ 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/.
278
+
279
+ Emanuel Todorov. Compositionality of optimal control laws. In Advances in Neural Information Processing Systems, pp. 1856–1864, 2009.
280
+
281
+ A Ulusoy. Ltl optimal multi-agent planner (lomap). Github repository, 2017.
282
+
283
+ 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.
284
+
285
+ Christopher John Cornish Hellaby Watkins. Learning From Delayed Rewards. PhD thesis, King’s College, Cambridge, England, 1989.
286
+
287
+ # Appendix
288
+
289
+ # A TASK SPECIFICATIONS
290
+
291
+ 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
292
+ $\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
293
+ $\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
294
+ $\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,
295
+ $\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,
296
+ $\phi _ { 5 }$ then eventually blue box in red square
297
+ $\phi _ { 6 }$ Conjunction of task 2 and 3
298
+ $\phi _ { 7 }$ Conjunction of tasks 2, 3, 4, 5
299
+
300
+ B HYPERPARAMETERS FOR PROXIMAL POLICY OPTIMIZATION
301
+
302
+ <table><tr><td rowspan=1 colspan=1>Hyperparameter Value</td></tr><tr><td rowspan=1 colspan=1>Num.Hidden Layers 2Num.Units per layer 64Activation Relu</td></tr><tr><td rowspan=1 colspan=1>Policy Learning Rate 0.009</td></tr><tr><td rowspan=1 colspan=1>Value Learning Rate 0.009</td></tr><tr><td rowspan=1 colspan=1>Discount 0.99</td></tr><tr><td rowspan=1 colspan=1>Batch Size 60</td></tr><tr><td rowspan=1 colspan=1>GAE parameter 0.99</td></tr><tr><td rowspan=1 colspan=1>Num.Iterations 100</td></tr><tr><td rowspan=1 colspan=1>Num. Epochs 20</td></tr><tr><td rowspan=1 colspan=1>Clipping Parameter E 0.2</td></tr><tr><td rowspan=1 colspan=1>Horizon 20</td></tr></table>
303
+
304
+ # C STATE AND ACTION SPACES
305
+
306
+ 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.
307
+
308
+ <table><tr><td>Task</td><td> State Space</td><td>Action Space</td></tr><tr><td colspan="3"></td></tr><tr><td>1</td><td>S M = (Pball, Ppredbox) SM = (pball,Predbox,q)</td><td>aM/M = (predbox)target</td></tr><tr><td>2</td><td>SM=(Pball,Predbox) SM = (Pball,Predbox,q)</td><td>aM/M = (predbox)target</td></tr><tr><td>3</td><td>SM= (pball,Pbluebox) SM = (Pball, Pbluebox,q)</td><td>aM/M = (pbluebox)target</td></tr><tr><td>4</td><td>SM=(pball,Predbox) SM = (Pball, Predbox,q)</td><td>aM/M = (predbox)target</td></tr><tr><td>5</td><td>SM = (Pball, Pbluebox) SM = (Pball, Pbluebox, q)</td><td>aM/M = (pbluebox)target</td></tr><tr><td>6</td><td>S M = (pball, Predbox, Pbluebox) SM = (Pbal,Predbox,Pbluebox,qΦ2,qΦ3)</td><td>aM/M = (p,d)target</td></tr><tr><td colspan="3">SM= (Pball,Predbox,Pbluebox) 7 SM = (Pball,Predbox, Pbluebox,qΦ2,qΦ3,q,5)</td></tr></table>
309
+
310
+ 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 }$ .
311
+
312
+ # Algorithm 1 Automata Guided RL (off-policy version)
313
+
314
+ 1: Inputs: Episode horizon $T$ , $\tilde { M } _ { \phi }$ (consisting of an MDP and FSA $\mathcal { A } _ { \phi }$ ), maximum size for replay
315
+ pool $N$
316
+ 2: Initialize parameterized policy $\pi ^ { \theta }$ $\triangleright \theta$ is the policy parameters
317
+ 3: Initialize replay pool $B \gets \{ \}$
318
+ 4: for $n = 1$ to number of training episodes do
319
+ 5: Select initial state $\tilde { s } _ { 0 } = ( s _ { 0 } , q _ { 0 } )$ $\triangleright \ s _ { 0 }$ can be randomly selected, $q _ { 0 }$ is always the initial
320
+ automaton state $q ^ { 0 }$
321
+ 6: for $\mathrm { { t } = 0 }$ to T do $a _ { t } = \pi ( \tilde { s } _ { t } )$
322
+ 7: $\tilde { s } _ { t + 1 } = \mathrm { G e t N e x t S t a t e } ( \tilde { s } _ { t } , a _ { t } )$
323
+ 8: if $q _ { t + 1 } = = q _ { f }$ then
324
+ 9: r˜t = 2 . terminal reward for satisfying $\phi$
325
+ 10: break . $\phi$ is satisfied, restart episode
326
+ 11: else if $q _ { t + 1 } = = t r a p$ then
327
+ 12: $\tilde { r } _ { t } = - 2$ $\triangleright$ terminal reward for violating $\phi$
328
+ 13: break . $\phi$ is violated, restart episode
329
+ 14: else
330
+ 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
331
+ 16:
332
+ 17: end if
333
+ 18: $\boldsymbol { B } \gets ( \tilde { s } _ { t } , a _ { t } , \tilde { s } _ { t + 1 } , \tilde { r } _ { t } )$ . store experience in replay pool
334
+ 19: if $s i z e ( B ) > N$ then
335
+ 20: $\boldsymbol { \mathrm { p o p } } ( B [ 0 ] )$
336
+ 21: end if
337
+ 22: $\theta \gets$ UpdatePolicy $( B )$ . this can be any RL update rule and doesn’t necessarily have to
338
+ occur at this location
339
+ 23: end for
340
+ 24: end for
341
+
342
+ # E SEMANTICS FOR SCTLTL
343
+
344
+ 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:
345
+
346
+ $$
347
+ \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}
348
+ $$
349
+
350
+ A trajectory $s$ of horizon $T$ is said to satisfy formula $\phi$ if $s _ { 0 : T } \models \phi$ .
351
+
352
+ 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:
353
+
354
+ $$
355
+ \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}
356
+ $$
357
+
358
+ 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).
md/train/BJxh2j0qYm/BJxh2j0qYm.md ADDED
@@ -0,0 +1,283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dynamic Channel Pruning: Feature Boosting and Suppression
2
+
3
+ Xitong Gao $\bot$ ∗, Yiren Zhao $^ 2$ ∗, Lukasz Dudziak $^ 3$ , Robert Mullins4, Cheng-zhong $\mathbf { X u } ^ { \mathrm { 5 } }$
4
+
5
+ 1 Shenzhen Institutes of Advanced Technology, Shenzhen, China
6
+ 2,3,4 University of Cambridge, Cambridge, UK
7
+ 5 University of Macau, Macau, China
8
+ 1 xt.gao@siat.ac.cn, 2 yaz21@cam.ac.uk
9
+
10
+ # Abstract
11
+
12
+ 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.
13
+
14
+ # 1 Introduction
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ 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.
25
+
26
+ 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.
27
+
28
+ ![](images/ec163895e99a91029cb698a9a91ed95b476b1369b23dfb25f76e0587a202b687.jpg)
29
+ 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.
30
+
31
+ # 2 Related Work
32
+
33
+ # 2.1 Structured Sparsity
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ # 2.2 Dynamic Execution
40
+
41
+ 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.
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ # 3 Feature Boosting and Suppression
48
+
49
+ 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.
50
+
51
+ ![](images/00841c99e6441664d8e5cf5e76ee9ffd57468d400db2d18166279b67b9b3218e.jpg)
52
+ 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.
53
+
54
+ # 3.1 Preliminaries
55
+
56
+ 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:
57
+
58
+ $$
59
+ 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 } ) _ { + } .
60
+ $$
61
+
62
+ 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:
63
+
64
+ $$
65
+ \mathsf { n o r m } \left( \mathbf { z } \right) = \frac { \mathbf { z } - \mu _ { \mathbf { z } } } { \sqrt { \pmb { \sigma } _ { \mathbf { z } } ^ { 2 } + \epsilon } } .
66
+ $$
67
+
68
+ 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
69
+
70
+ 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.
71
+
72
+ # 3.2 Designing a Dynamic Layer
73
+
74
+ Consider the following generalization of a layer with dynamic execution:
75
+
76
+ $$
77
+ \hat { f } \left( \mathbf { x } , \cdots \right) = f \left( \mathbf { x } , \pmb { \theta } , \cdots \right) \cdot \pi \left( \mathbf { x } , \pmb { \phi } , \cdots \right) ,
78
+ $$
79
+
80
+ 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 }$ :
81
+
82
+ $$
83
+ \mathcal { R } \left( \mathbf { x } \right) = \mathbb { E } _ { \mathbf { x } } \left[ \left. \pi \left( \mathbf { x } , \phi , \cdot \cdot \cdot \right) \right. _ { 1 } \right] ,
84
+ $$
85
+
86
+ 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.
87
+
88
+ # 3.3 Feature Boosting and Suppression with Channel Saliencies
89
+
90
+ 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:
91
+
92
+ $$
93
+ \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) _ { + } ,
94
+ $$
95
+
96
+ 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)$ :
97
+
98
+ $$
99
+ \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) .
100
+ $$
101
+
102
+ 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.
103
+
104
+ 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.
105
+
106
+ 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.
107
+
108
+ # 3.4 Learning to Predict Channel Saliencies
109
+
110
+ 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 }$ :
111
+
112
+ $$
113
+ \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] ,
114
+ $$
115
+
116
+ 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:
117
+
118
+ $$
119
+ g _ { l } \left( \mathbf { x } _ { l - 1 } \right) = \left( \mathsf { s s } \left( \mathbf { x } _ { l - 1 } \right) \phi _ { l } + \pmb { \rho } _ { l } \right) _ { + } .
120
+ $$
121
+
122
+ 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.
123
+
124
+ # 4 Experiments
125
+
126
+ 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.
127
+
128
+ 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.
129
+
130
+ # 4.1 CIFAR-10
131
+
132
+ ![](images/bf0b69083c0580f998d0a893355ef98d28a82ea3f6269d64ac066bec0980aa44.jpg)
133
+ 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$ .
134
+
135
+ 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 \%$ .
136
+
137
+ 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.
138
+
139
+ # 4.2 ImageNet ILSVRC2012 Classification
140
+
141
+ 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.
142
+
143
+ 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 \%$ .
144
+
145
+ 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.
146
+
147
+ Table 1: Comparisons of error rates of the baseline and accelerated ResNet-18 models.
148
+
149
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Dynamic</td><td colspan="2">Baseline</td><td colspan="2">Accelerated</td><td rowspan="2">MAC saving</td></tr><tr><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td>Soft Filter Pruning (He et al., 2018a)</td><td></td><td>29.72</td><td>10.37</td><td>32.90</td><td>12.22</td><td>1.72×</td></tr><tr><td>Network Slimming (Liu et al. (20l7),our implementation)</td><td></td><td>31.02</td><td>11.32</td><td>32.79</td><td>12.61</td><td>1.39×</td></tr><tr><td>Discrimination-aware Channel Pruning (Zhuang et al., 2018)</td><td></td><td>30.36</td><td>11.02</td><td>32.65</td><td>12.40</td><td>1.89×</td></tr><tr><td>Low-cost Collaborative Layers (Dong et al., 2017)</td><td></td><td>30.02</td><td>10.76</td><td>33.67</td><td>13.06</td><td>1.53×</td></tr><tr><td>Channel Gating Neural Networks (Hua et al., 2018)</td><td>广</td><td>30.98</td><td>11.16</td><td>32.60</td><td>12.19</td><td>1.61×</td></tr><tr><td>Feature Boosting and Suppression (FBS)</td><td>√</td><td>29.29</td><td>10.32</td><td>31.83</td><td>11.78</td><td>1.98×</td></tr></table>
150
+
151
+ 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.
152
+
153
+ <table><tr><td>Method</td><td>Dynamic</td><td>△ top-5 errors 3× 4×</td><td></td><td>(%) 5×</td></tr><tr><td>Filter Pruning (Li et al. (20l7),reproduced by He et al. (2017))</td><td rowspan="10"></td><td></td><td>8.6</td><td>14.6</td></tr><tr><td>Perforated CNNs (Figurnov et al., 2016)</td><td>3.7</td><td>5.5</td><td></td></tr><tr><td>Network Slimming (Liu et al. (20i7),our implementation)</td><td>1.37</td><td>3.26</td><td>5.18</td></tr><tr><td>Runtime Neural Pruning (Lin et al., 2017)</td><td>2.32</td><td>3.23</td><td>3.58</td></tr><tr><td>Channel Pruning (He et al., 2017)</td><td>0.0</td><td>1.0</td><td>1.7</td></tr><tr><td>AutoML for Model Compression (He et al., 2018b)</td><td></td><td></td><td>1.4</td></tr><tr><td>ThiNet-Conv (Luo et al., 2017)</td><td>0.37</td><td></td><td></td></tr><tr><td>Feature Boosting and Suppression (FBS)</td><td></td><td>0.04 0.52</td><td>0.59</td></tr></table>
154
+
155
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Total Memory Accesses</td><td colspan="2">PeakMemory Usage</td></tr><tr><td>Weights</td><td>Activations</td><td>Edge (1 image)</td><td>Cloud (128 images)</td></tr><tr><td>VGG-16</td><td>56.2MB</td><td>86.5MB</td><td>24.6MB</td><td>3.09GB</td></tr><tr><td>VGG-16 3×</td><td>23.9 MB (2.35x)</td><td>40.8MB (2.12×)</td><td>9.97MB (2.47×)</td><td>1.24 GB (2.47×)</td></tr><tr><td>ResNet-18</td><td>44.6MB</td><td>17.8MB</td><td>9.19MB</td><td>0.47 GB</td></tr><tr><td>ResNet-18 2×</td><td>20.5MB (2.18×)</td><td>12.3 MB (1.45×)</td><td>4.68MB (1.96x)</td><td>0.31GB (1.49×)</td></tr></table>
156
+
157
+ 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.
158
+
159
+ # 5 Conclusion
160
+
161
+ 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.
162
+
163
+ # Acknowledgements
164
+
165
+ This work is supported in part by the National Key R&D Program of China (No.
166
+ 2018YFB1004804), the National Natural Science Foundation of China (No. 61806192).
167
+ We thank EPSRC for providing Yiren Zhao his doctoral scholarship.
168
+
169
+ # References
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ 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.
184
+
185
+ Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient DNNs. In Advances in Neural Information Processing Systems (NIPS), 2016.
186
+
187
+ 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.
188
+
189
+ 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.
190
+
191
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the 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.
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ 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.
204
+
205
+ 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.
206
+
207
+ 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.
208
+
209
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS). 2012.
210
+
211
+ Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The CIFAR-10 and CIFAR-100 datasets. http://www.cs.toronto.edu/ kriz/cifar.html, 2014.
212
+
213
+ Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In Advances in Neural Information Processing Systems (NIPS), pp. 598–605. 1990.
214
+
215
+ Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. 2017.
216
+
217
+ Ji Lin, Yongming Rao, Jiwen Lu, and Jie Zhou. Runtime neural pruning. In Advances in Neural Information Processing Systems (NIPS), pp. 2181–2191. 2017.
218
+
219
+ Lanlan Liu and Jia Deng. Dynamic deep neural networks: Optimizing accuracy-efficiency trade-offs by selective execution. 2018.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ Augustus Odena, Dieterich Lawson, and Christopher Olah. Changing model behavior at test-time using reinforcement learning. 2017.
228
+
229
+ 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.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
238
+
239
+ Rupesh Kumar Srivastava, Jonathan Masci, Faustino J. Gomez, and J¨urgen Schmidhuber. Understanding locally competitive networks. In International Conference on Learning Representations (ICLR), 2015.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ # A Details of M-CifarNet on CIFAR-10
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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 \%$ .
264
+
265
+ <table><tr><td>Layer</td><td>Shape</td><td colspan="4">Number of MACs (Output Channels) Original NS FBS</td></tr><tr><td>convo</td><td>30 × 30</td><td></td><td></td><td>893k</td><td>NS+FBS</td></tr><tr><td>conv1</td><td>30 × 30</td><td>1.5 M (64)</td><td>1.3M (52) 27.0M (64)</td><td>(32/62) 8.4M (32/42)</td><td>860k (32) 10.2M (39)</td></tr><tr><td>conv2</td><td>15 ×15</td><td>33.2M (64)</td><td></td><td>4.2M</td><td>5.9M</td></tr><tr><td></td><td>15×15</td><td>16.6M (128)</td><td>15.9 M (123)</td><td>(64/67) 8.3M</td><td>(74 11.6 M</td></tr><tr><td>conv3</td><td>15 ×15</td><td>33.2M (128)</td><td>31.9M (128)</td><td>(64/79)</td><td>(77)</td></tr><tr><td>conv4 conv5</td><td>8×8</td><td>33.2M (128) 14.1M</td><td>33.1M (128) 13.4M (182)</td><td>8.3M (64/83)</td><td>12.1M (77)</td></tr><tr><td>conv6</td><td>8×8</td><td>(192) (192)</td><td>11.6 M (111)</td><td>3.6 M (96/128)</td><td>4.9M (110) 4.3M (67)</td></tr><tr><td>conv7</td><td>8×8</td><td>21.2M 21.2M</td><td>12.3 M</td><td>5.4M (96/152)</td><td></td></tr><tr><td>pool7</td><td></td><td>(192)</td><td>(192)</td><td>5.4 M (96/96)</td><td>4.5M (116)</td></tr><tr><td>fc</td><td>1×1 1×1</td><td>1.9k (10)</td><td>1.9k (10)</td><td>960 (10)</td><td>1.1k (10)</td></tr><tr><td></td><td></td><td>174.3M</td><td>146.5M</td><td></td><td></td></tr><tr><td>Total Saving</td><td></td><td>1</td><td>1.19×</td><td>44.3M 3.93×</td><td>54.2M 3.21×</td></tr></table>
266
+
267
+ 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.
268
+
269
+ ![](images/0ac2dbb3a50aafe67f3efd4e38811dfbcd9c7c0d1019acfb820610f3f0cc6d8a.jpg)
270
+ 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.
271
+
272
+ # B Details of the ILSVRC2012 classifiers
273
+
274
+ 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).
275
+
276
+ 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.
277
+
278
+ 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.
279
+
280
+ Figure 5 compares the accuracy/performance trade-off curves between FBS and NS for ResNet-18.
281
+
282
+ ![](images/03cc25e4465c9126a92eedc919885878b989aaaa077f60070dd89df8fb2e157e.jpg)
283
+ Figure 5: The accuracy/performance trade-off comparison between NS and FBS for ResNet18 on the ImageNet ILSVRC2012 validation set.
md/train/BkG8sjR5Km/BkG8sjR5Km.md ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EMERGENT COORDINATION THROUGH COMPETITION
2
+
3
+ Siqi Liu∗, Guy Lever∗, Josh Merel, Saran Tunyasuvunakool, Nicolas Heess, Thore Graepel
4
+ DeepMind
5
+ London, United Kingdom
6
+ {liusiqi,guylever,jsmerel,stunya,heess,thore}@google.com
7
+
8
+ # ABSTRACT
9
+
10
+ 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.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ 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.
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ # 2 PRELIMINARIES
23
+
24
+ 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.
25
+
26
+ # 3 METHODS
27
+
28
+ 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.
29
+
30
+ # 3.1 POPULATION BASED TRAINING
31
+
32
+ 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
33
+
34
+ Algorithm 1 Population-based Training for Multi-Agent RL.
35
+
36
+ <table><tr><td colspan="2">1: procedure PBT-MARL</td></tr><tr><td>2: 3:</td><td>{Ai}i∈[1.,N] N independent agents forming a population. for agent Ai in {Ai}i∈[1.,N] do</td></tr><tr><td>4:</td><td>Initialize agent network parameters 0i and agent rating ri to fixed initial rating Rinit.</td></tr><tr><td>5: 6:</td><td>Sample initial hyper-parameter 0&#x27; from the initial hyper-parameter distribution.</td></tr><tr><td>end for</td><td></td></tr><tr><td>7: while true do</td><td></td></tr><tr><td>8:</td><td>Agents play TrainingMatches and update network parameters by Retrace-SVG0.</td></tr><tr><td>9:</td><td>for match result (si,sj) ∈ TrainingMatches do</td></tr><tr><td>10:</td><td>UpdateRating(ri,rj,Si,Sj) See Appendix B.1</td></tr><tr><td>11: 12:</td><td>end for</td></tr><tr><td>13:</td><td>for agent Ai E {Ai}ie[1,., N] do Evolution Procedure</td></tr><tr><td>14:</td><td>if Eligible(Ai) then &gt; See Appendix B.2</td></tr><tr><td>15:</td><td>Aj←Select(Ai,{Ai}iε∈[1..,N];i≠j) See Appendix B.3</td></tr><tr><td>16:</td><td>if Aj ≠ NULL then</td></tr><tr><td>17:</td><td>Inherit(0,0,,) &gt;Ai inherits from Aj,See Appendix B.4</td></tr><tr><td>18:</td><td>←Mutate(0) See Appendix B.5</td></tr><tr><td>19:</td><td>end if</td></tr><tr><td>20:</td><td>end if</td></tr><tr><td>21:</td><td>end for</td></tr><tr><td>22:</td><td>end while</td></tr><tr><td>end procedure</td><td></td></tr></table>
37
+
38
+ $$
39
+ 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]
40
+ $$
41
+
42
+ 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.
43
+
44
+ # 3.2 RETRACE-SVG0
45
+
46
+ 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.
47
+
48
+ 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.
49
+
50
+ # 3.3 DECOMPOSED DISCOUNTS AND ACTION-VALUE ESTIMATION FOR REWARD SHAPING
51
+
52
+ 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.
53
+
54
+ 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.
55
+
56
+ # 4 EXPERIMENTAL SETUP
57
+
58
+ # 4.1 MUJOCO SOCCER ENVIRONMENT
59
+
60
+ 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.
61
+
62
+ ![](images/50acb3cfbdda00625ba84599c0a09a388125769951c0381ff089b359731e8069.jpg)
63
+ Figure 1: Top-down view with individual camera views of 2v2 multi-agent soccer environment.
64
+
65
+ # 4.2 PBT SETTINGS
66
+
67
+ 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.
68
+
69
+ # 4.3 EVALUATION
70
+
71
+ 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).
72
+
73
+ 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).
74
+
75
+ 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.
76
+
77
+ ![](images/f7a57e9e23c3bbfaddef37522b052dd4a06938a16fb71fcbad4bed823f464f33.jpg)
78
+ 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.
79
+
80
+ # 5 RESULTS
81
+
82
+ 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.
83
+
84
+ # 5.1 ABLATION STUDY
85
+
86
+ 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.
87
+
88
+ 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.
89
+
90
+ 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.
91
+
92
+ ![](images/e2abd47b84cd54f31327412ef39020a73467dc7c6eaaccaceac0efe0c7d54041.jpg)
93
+ 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.
94
+
95
+ ![](images/9b71d2e575eb9704c44a96a5cdd8b99a24605d450da5f4218056df50f29b5016.jpg)
96
+ Figure 4: Evolution of hyper-parameters. Hyperparameters of individual agents within the population in gray.
97
+
98
+ 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.
99
+
100
+ 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.
101
+
102
+ 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.
103
+
104
+ ![](images/dbb3eaf31169013d0de35066a2cc6cee107a56e4332a15525131c3e94f23d939.jpg)
105
+ Figure 5: Evolution of relative importance of dense shaping rewards over the course of training. Hyperparameters of individual agents within the population in gray.
106
+
107
+ ![](images/65d4ffdb7f67af686ef2edb1425d564273c34058e1deb962227bd2d4cb9661dc.jpg)
108
+ Figure 6: Evolution of discount factor for each reward component. We show hyperparameters of individual agents within the population in gray.
109
+
110
+ # 5.2 EMERGENT MULTI-AGENT BEHAVIORS
111
+
112
+ 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.
113
+
114
+ 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.
115
+
116
+ # 5.2.1 BEHAVIOR STATISTICS
117
+
118
+ 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.
119
+
120
+ ![](images/e66535565f9a6452ad1ce504d8b90d99ac366d67b1a7f928be56eaa72831852f.jpg)
121
+ Figure 7: Behavior statistics evolution.
122
+
123
+ ![](images/ad96f6d0a717f3627684c647f0153896a317fd1af01676ab48222dcf288a914a.jpg)
124
+ 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.
125
+
126
+ # 5.2.2 COUNTERFACTUAL POLICY DIVERGENCE
127
+
128
+ 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.
129
+
130
+ 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.
131
+
132
+ # 5.2.3 MULTI-AGENT BEHAVIOR PROBING
133
+
134
+ 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.
135
+
136
+ ![](images/19e60a0d6822bfb1eae43f85f4fa4204a6627db1a9ce98d0f67d483b4174f966.jpg)
137
+ 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.
138
+
139
+ <table><tr><td></td><td>pass</td><td>intercept</td></tr><tr><td>5B_left</td><td>0</td><td>100</td></tr><tr><td>5B_right</td><td>31</td><td>90</td></tr><tr><td>80B_left</td><td>76</td><td>24</td></tr><tr><td>80B_right</td><td>56</td><td>27</td></tr></table>
140
+
141
+ # 6 RELATED WORK
142
+
143
+ 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).
144
+
145
+ # 7 CONCLUSIONS AND FUTURE WORK
146
+
147
+ 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.
148
+
149
+ # REFERENCES
150
+
151
+ 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.
152
+
153
+ 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.
154
+
155
+ David Balduzzi, Karl Tuyls, Julien Perolat, and Thore Graepel. Re-evaluating evaluation. arXiv preprint arXiv:1806.02643, 2018.
156
+
157
+ Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. arXiv preprint arXiv:1710.03748, 2017.
158
+
159
+ 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.
160
+
161
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016.
162
+
163
+ Murray Campbell, A. Joseph Hoane Jr., and Feng-hsiung Hsu. Deep blue. Artif. Intell., 134(1-2): 57–83, 2002.
164
+
165
+ Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). CoRR, abs/1511.07289, 2015.
166
+
167
+ 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.
168
+
169
+ 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.
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ Matthew John Hausknecht. Cooperation and communication in multiagent deep reinforcement learning. PhD thesis, University of Texas at Austin, Austin, USA, 2016.
176
+
177
+ 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.
178
+
179
+ Nicolas Heess, Jonathan J. Hunt, Timothy P. Lillicrap, and David Silver. Memory-based control with recurrent neural networks. CoRR, abs/1512.04455, 2015a.
180
+
181
+ 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.
182
+
183
+ 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.
184
+
185
+ 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.
186
+
187
+ Johannes Heinrich and David Silver. Deep reinforcement learning from self-play in imperfectinformation games. CoRR, abs/1603.01121, 2016.
188
+
189
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
196
+
197
+ Hiroaki Kitano, Minoru Asada, Yasuo Kuniyoshi, Itsuki Noda, and Eiichi Osawa. Robocup: The robot world cup initiative. In Agents, pp. 340–347, 1997.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ 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.
204
+
205
+ 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.
206
+
207
+ 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.
208
+
209
+ 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.
210
+
211
+ 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.
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ Martin A. Riedmiller, Thomas Gabel, Roland Hafner, and Sascha Lange. Reinforcement learning for robot soccer. Auton. Robots, 27(1):55–73, 2009.
224
+
225
+ 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.
226
+
227
+ L. S. Shapley. Stochastic games. Proceedings of the National Academy of Sciences of the United States of America, 39(10):1095–1100, 1953.
228
+
229
+ 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.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ R. Sutton and A. Barto. Reinforcement Learning: An Introduction. MIT Press, 1998.
236
+
237
+ 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.
238
+
239
+ G. Tesauro. Temporal difference learning and td-gammon. Commun. ACM, 38(3):58–68, March 1995.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ # A OFF-POLICY SVG0 ALGORITHM
248
+
249
+ # A.1 POLICY UPDATES
250
+
251
+ 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.
252
+
253
+ 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,
254
+
255
+ $$
256
+ \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}
257
+ $$
258
+
259
+ from which we obtain a recursion for $\frac { \partial Q ^ { \pi _ { \theta } } ( s , a ) } { \partial \theta }$ . Expanding the recursion we obtain the policy gradient
260
+
261
+ $$
262
+ \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}
263
+ $$
264
+
265
+ 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).
266
+
267
+ # Algorithm 2 Off-policy SVG0 algorithm (Heess et al., 2015b).
268
+
269
+ 1: initialize replay buffer $B = \varnothing$
270
+ 2: sample initial state $s _ { 0 }$ from environment
271
+ 3: for t $\scriptstyle \mathbf { d o } = 0$ to $\infty$ do
272
+ 4: sample action from current policy $a _ { t } = \mu _ { \theta } ( \cdot | s _ { t } , \eta )$ , $\eta \sim \rho$
273
+ 5: observe reward and state observation $r _ { t } , s _ { t }$
274
+ 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 }$ )
275
+ 8: end for
276
+
277
+ # A.2 Q-VALUE UPDATES
278
+
279
+ 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$ :
280
+
281
+ $$
282
+ 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 ]
283
+ $$
284
+
285
+ In our soccer environment the reward is invariant over player and we can drop the dependence on $i$
286
+
287
+ 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:
288
+
289
+ $$
290
+ 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]
291
+ $$
292
+
293
+ 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:
294
+
295
+ $$
296
+ \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}
297
+ $$
298
+
299
+ 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.
300
+
301
+ 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.
302
+
303
+ # B POPULATION-BASED TRAINING PROCEDURE
304
+
305
+ # B.1 FITNESS
306
+
307
+ 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.
308
+
309
+ 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.
310
+
311
+ 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.
312
+
313
+ # Algorithm 3 Iterative Elo rating update.
314
+
315
+ 1: Initialize rating $r _ { i }$ for each agent in the agent population.
316
+ 2: $K$ : step size of Elo rating update given one match result.
317
+ 3: $s _ { i } , s _ { j }$ : score for agent $i , j$ in a given match.
318
+ 4: procedure UPDATERATIN $\mathsf { I G } ( r _ { i } , r _ { j } , s _ { i } , s _ { j } )$
319
+ 5: $s \gets ( \mathrm { s i g n } ( s _ { i } - s _ { j } ) + 1 ) / 2$
320
+ 6: selo ← 1/(1 + 10(rj−ri)/400)
321
+ 7: $r _ { i } r _ { i } + K ( s - s _ { e l o } )$
322
+ 8: $r _ { j } r _ { j } - K ( s - s _ { e l o } )$
323
+ 9: end procedure
324
+
325
+ # B.2 EVOLUTION ELIGIBILITY
326
+
327
+ 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:
328
+
329
+ 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.
330
+
331
+ # B.3 SELECTION
332
+
333
+ 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.
334
+
335
+ Algorithm 4 Given agent $i$ , select an agent $j$ to evolve to.
336
+
337
+ 1: $T _ { s e l e c t }$ : win rate selection threshold below which $A _ { i }$ should evolve to $A _ { j }$ .
338
+ 2: $r _ { i } , r _ { j }$ : Elo ratings of agents $i , j$ .
339
+ 3: procedure $\operatorname { S E L E C T } ( A _ { i } , \{ A _ { i } \} _ { i \in [ 1 , \dots , N ] ; i \neq j } )$
340
+ 4: Choose $A _ { j }$ uniformly at random from $\{ A _ { i } \} _ { i \in [ 1 , . . , N ] ; i \neq j }$ .
341
+ 5: selo ← 1/(1 + 10(rj−ri)/400)
342
+ 6: if $s _ { e l o } < T _ { s e l e c t }$ then
343
+ 7: return $A _ { j }$
344
+ 8: else
345
+ 9: return NULL
346
+ 10: end if
347
+ 11: end procedure
348
+
349
+ # B.4 INHERITANCE
350
+
351
+ 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:
352
+
353
+ # B.5 MUTATION
354
+
355
+ 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.
356
+
357
+ Algorithm 5 Agent $i$ inherits from agent $j$ by cross-over.
358
+
359
+ 1: Agent $i , j$ with respective network parameters $\theta _ { i } , \theta _ { j }$ and hyper-parameters $\theta _ { i } ^ { h } , \theta _ { j } ^ { h }$ .
360
+ 2: procedure INHERIT $\cdot ( \theta _ { i } , \theta _ { j } , \theta _ { i } ^ { h } , \theta _ { j } ^ { h } )$
361
+ 3: ${ \theta _ { i } \theta _ { j } }$
362
+ 4: $m = ( m _ { k } ) _ { k }$ , mk ∼ bernouilli(0.5)
363
+ 5: $\theta _ { i } ^ { h } m \theta _ { i } ^ { h } + ( 1 - m ) \theta _ { j } ^ { h }$
364
+ 6: end procedure
365
+
366
+ # C FURTHER ENVIRONMENT DETAILS AND AGENT PARAMETERIZATION
367
+
368
+ # C.1 POLICY PARAMETRIZATION AND OPTIMIZATION
369
+
370
+ 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.
371
+
372
+ 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.
373
+
374
+ 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.
375
+
376
+ # D HEAD-TO-HEAD TOURNAMENT OF TRAINED AGENTS
377
+
378
+ 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.
379
+
380
+ # E HYPERPARAMETER EVOLUTION
381
+
382
+ 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.
383
+
384
+ ![](images/77d51430c8cb207b6028fedf551cf1f26979cdff58ea0b5021c9e6e336fb8055.jpg)
385
+ 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.
386
+
387
+ ![](images/fb6610ac1c81db2a266fc36abe548d4a086e516ac6683209bee3e1861f7ef684.jpg)
388
+ Figure 11: Hyperparameter evolution for three separate seeds, displayed over three separate rows.
389
+
390
+ # F BEHAVIOR VISUALIZATIONS
391
+
392
+ 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.
393
+
394
+ ![](images/ec08619e84f50972cbb0397967b3d801201b7f4a2b445deeb011c37ae31d7285.jpg)
395
+ 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.
md/train/BkS3fnl0W/BkS3fnl0W.md ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEMI-SUPERVISED OUTLIER DETECTION USING GEN-ERATIVE AND ADVERSARY FRAMEWORK
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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).
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ (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.
12
+
13
+ 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).
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ 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). ¨
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ # 3 OUTLIER DETECTION USING CORGAN
30
+
31
+ 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:
32
+
33
+ 1. Training Step: Training the CorGAN with the improved techniques;
34
+ 2. Inference Step: Detecting outliers using the resulting $D$ of the trained CorGAN
35
+
36
+ # 3.1 GENERATIVE ADVERSARY NETWORK
37
+
38
+ 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.
39
+
40
+ # 3.2 STEP1: TRAINING THE CORGAN
41
+
42
+ 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.
43
+
44
+ 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):
45
+
46
+ $$
47
+ \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 } } ) ) }
48
+ $$
49
+
50
+ 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
51
+
52
+ ![](images/b0691fb608dbcbacd24c0cc26dcae649d23a97aefb6b0fa4cc6e96ced0eede19.jpg)
53
+ Figure 1: The basic architecture of the CorGAN
54
+
55
+ is trained to minimise the cost U(G):
56
+
57
+ $$
58
+ \operatorname* { m i n } _ { G } U ( G ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( | a _ { n e w } - D ( G ( z ) ) | )
59
+ $$
60
+
61
+ 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.
62
+
63
+ 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).
64
+
65
+ # 3.3 STEP2: DETECTING OUTLIERS USING DISCRIMINATOR
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ # 4 IMPROVED TECHNIQUES FOR GAN IN OCC
74
+
75
+ 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.
76
+
77
+ ![](images/b282e3949b137bb05b809ba6630e74990cf02e792104df3e154b5d11dd8c22d5.jpg)
78
+ 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.
79
+
80
+ # 4.1 EARLY STOPPING
81
+
82
+ 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.
83
+
84
+ 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:
85
+
86
+ $$
87
+ \operatorname* { m a x } _ { D } A U C _ { b i a s e d } = \int _ { 0 } ^ { 1 } f _ { T + } ( t ) d t
88
+ $$
89
+
90
+ where $t$ is the threshold and $f _ { T + } ( t )$ is inlier accepted fraction of the Discriminator given the specific threshold $t$ .
91
+
92
+ ![](images/a9528f61872dc2205ff7dd657ee76cbca461c73439f091c6ab5769fdab4e713f.jpg)
93
+ 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.
94
+
95
+ Table 1: The behavior of the $G$ and the performance of the $D$ are presented in case of different new target values.
96
+
97
+ <table><tr><td rowspan=1 colspan=1>new target value anew</td></tr><tr><td rowspan=1 colspan=1>anew = 1: The objective of G is the exact same as that of the convergent GAN(Goodfellow et al., 2014). The training will converge.</td></tr><tr><td rowspan=1 colspan=1>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.</td></tr><tr><td rowspan=1 colspan=1>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.</td></tr><tr><td rowspan=1 colspan=1>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·</td></tr></table>
98
+
99
+ # 4.2 SPECIFYING A NEW OBJECTIVE FOR THE GENERATOR
100
+
101
+ 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 }$ .
102
+
103
+ 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$ :
104
+
105
+ $$
106
+ \operatorname* { m i n } _ { G } U ( G ) = \mathbb { E } _ { z \sim p _ { z } ( z ) } \log ( | 0 . 9 - D ( G ( z ) ) | )
107
+ $$
108
+
109
+ 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.
110
+
111
+ # 4.3 ATTACHING MORE IMPORTANCE TO GENERATED DATA
112
+
113
+ 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:
114
+
115
+ $$
116
+ \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 } ) )
117
+ $$
118
+
119
+ , 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.
120
+
121
+ # 4.4 COMBINING PREVIOUSLY GENERATED DATA
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ 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.
128
+
129
+ $$
130
+ P ( X _ { i } \in R ) = \frac { 1 } { t - ( s / 2 ) }
131
+ $$
132
+
133
+ , 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:
134
+
135
+ $$
136
+ B = \left\{ R , X _ { t - ( s / 2 ) + 1 } , X _ { t - ( s / 2 ) + 2 } , \ldots , X _ { t } \right\}
137
+ $$
138
+
139
+ , 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.
140
+
141
+ # 5 EXPERIMENTS AND ANALYSIS
142
+
143
+ 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.
144
+
145
+ Table 2: Training -, validation - and test datasets of experiments setting.
146
+
147
+ <table><tr><td>Datasets:</td><td>Source of images:</td><td>The Number of images:</td></tr><tr><td>Training dataset</td><td>digit of 9 in MNIST</td><td>4967</td></tr><tr><td>Validation dataset</td><td>digit of 9 in MNIST</td><td>900</td></tr><tr><td rowspan="4">Test dataset</td><td>Inliers: digit of 9 in MNIST</td><td>900</td></tr><tr><td>1.Outliers: digits of O-8 in MNIST</td><td>900</td></tr><tr><td>2.Outliers: CIFAR10</td><td>900</td></tr><tr><td>3.Outliers: Images composed of noise</td><td>900</td></tr></table>
148
+
149
+ # 5.1 DATASETS AND EVALUATION:
150
+
151
+ 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).
152
+
153
+ # 5.2 EXPERIMENTS SETTING:
154
+
155
+ 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).
156
+
157
+ 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.
158
+
159
+ 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.
160
+
161
+ # 5.3 RESULTS AND ANALYSIS:
162
+
163
+ 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.
164
+
165
+ ![](images/596ea6ac1282ab797e6dc3c1a138bfb8fc3bae75d6216625d1ecd5e9bda53ae6.jpg)
166
+ 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.
167
+
168
+ 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.
169
+
170
+ <table><tr><td rowspan=3 colspan=1></td><td rowspan=1 colspan=3>AUC score:</td></tr><tr><td rowspan=1 colspan=3>MNIST(9)</td></tr><tr><td rowspan=1 colspan=1>MNIST(0-8)</td><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>Noise</td></tr><tr><td rowspan=1 colspan=1>PCA+PSVM</td><td rowspan=1 colspan=1>0.8623</td><td rowspan=1 colspan=1>0.9720</td><td rowspan=1 colspan=1>0.9302</td></tr><tr><td rowspan=1 colspan=1>Autoencoder</td><td rowspan=1 colspan=1>0.8943</td><td rowspan=1 colspan=1>0.6785</td><td rowspan=1 colspan=1>0.9704</td></tr><tr><td rowspan=1 colspan=1>CorGAN</td><td rowspan=1 colspan=1>0.8974</td><td rowspan=1 colspan=1>0.9739</td><td rowspan=1 colspan=1>0.9995</td></tr><tr><td rowspan=1 colspan=1>CorGAN2</td><td rowspan=1 colspan=1>0.8343</td><td rowspan=1 colspan=1>0.9937</td><td rowspan=1 colspan=1>0.9999</td></tr><tr><td rowspan=1 colspan=1>CorGAN3</td><td rowspan=1 colspan=1>0.9253</td><td rowspan=1 colspan=1>0.9943</td><td rowspan=1 colspan=1>0.9999</td></tr></table>
171
+
172
+ 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).
173
+
174
+ # 6 CONCLUSION AND FUTURE WORK
175
+
176
+ 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.
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ # REFERENCES
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ 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.
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ Yoshua Bengio, Hugo Larochelle, and Pascal Vincent. Non-local manifold parzen windows. In Advances in neural information processing systems, pp. 115–122, 2006.
199
+
200
+ Christopher M Bishop. Novelty detection and neural network validation. IEE Proceedings-Vision, Image and Signal processing, 141(4):217–222, 1994.
201
+
202
+ Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ 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.
209
+
210
+ Zengyou He, Xiaofei Xu, and Shengchun Deng. Discovering cluster-based local outliers. Pattern Recognition Letters, 24(9):1641–1650, 2003.
211
+
212
+ 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.
213
+
214
+ Victoria Hodge and Jim Austin. A survey of outlier detection methodologies. Artificial intelligence review, 22(2):85–126, 2004.
215
+
216
+ 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.
217
+
218
+ A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
219
+
220
+ 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.
221
+
222
+ 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.
223
+
224
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
225
+
226
+ Yann LeCun et al. Generalization and network design strategies. Connectionism in perspective, pp. 143–155, 1989.
227
+
228
+ 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.
229
+
230
+ Markos Markou and Sameer Singh. Novelty detection: a reviewpart 2:: neural network based approaches. Signal processing, 83(12):2499–2521, 2003.
231
+
232
+ 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.
233
+
234
+ Augustus Odena. Semi-supervised learning with generative adversarial networks. arXiv preprint arXiv:1606.01583, 2016.
235
+
236
+ Emanuel Parzen. On estimation of a probability density function and mode. The annals of mathematical statistics, 33(3):1065–1076, 1962.
237
+
238
+ 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.
239
+
240
+ Marco AF Pimentel, David A Clifton, Lei Clifton, and Lionel Tarassenko. A review of novelty detection. Signal Processing, 99:215–249, 2014.
241
+
242
+ 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.
243
+
244
+ David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1, 1988.
245
+
246
+ 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.
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015.
253
+
254
+ David MJ Tax and Robert PW Duin. Support vector domain description. Pattern recognition letters, 20(11):1191–1199, 1999.
255
+
256
+ 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.
257
+
258
+ David MJ Tax and Klaus-Robert Muller. Feature extraction for one-class classification. ¨ Lecture notes in computer science, pp. 342–349, 2003.
259
+
260
+ 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.
261
+
262
+ Pascal Vincent and Yoshua Bengio. Manifold parzen windows. In Advances in neural information processing systems, pp. 849–856, 2003.
263
+
264
+ Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37–57, 1985.
md/train/BkbY4psgg/BkbY4psgg.md ADDED
@@ -0,0 +1,623 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MAKING NEURAL PROGRAMMING ARCHITECTURES GENERALIZE VIA RECURSION
2
+
3
+ Jonathon Cai, Richard Shin, Dawn Song
4
+ Department of Computer Science
5
+ University of California, Berkeley
6
+ Berkeley, CA 94720, USA
7
+ {jonathon,ricshin,dawnsong}@cs.berkeley.edu
8
+
9
+ # ABSTRACT
10
+
11
+ 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.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 2 THE PROBLEM AND OUR APPROACH
24
+
25
+ # 2.1 THE PROBLEM OF GENERALIZATION
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ 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.
34
+
35
+ # 2.2 OUR APPROACH USING RECURSION
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ 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).
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ # 3 APPLICATION TO LEARNING RECURSIVE NEURAL PROGRAMS WITH NPI
50
+
51
+ # 3.1 BACKGROUND: NPI ARCHITECTURE
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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:
58
+
59
+ $$
60
+ \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}
61
+ $$
62
+
63
+ $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 ) )$ .
64
+
65
+ Algorithm 1 Neural programming inference
66
+
67
+ <table><tr><td>1:</td><td>Inputs: Environment observation e, program p,arguments a, stop threshold α</td></tr><tr><td>2:</td><td>function RUN(e,p, a)</td></tr><tr><td>3:</td><td>h↑0,r←0</td></tr><tr><td>4:</td><td>whiler&lt;αdo</td></tr><tr><td>5:</td><td>s ←fenc(e,a),h ←fistm(s,p,h)</td></tr><tr><td>6:</td><td>r ←fend(h),p2 ← fprog(h),a2 ← farg(h)</td></tr><tr><td>7:</td><td>if p is a primitive function then</td></tr><tr><td>8:</td><td>e ← fenv(e,p,a).</td></tr><tr><td>9:</td><td>else</td></tr><tr><td>10:</td><td>function RUN(e,P2, a2)</td></tr></table>
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ 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.
74
+
75
+ ![](images/400738f1bb6ec680e00398081df8b91a36e097048042ec5fdd599e1e2221cb5f.jpg)
76
+ 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).
77
+
78
+ # 3.2 RECURSIVE FORMULATIONS FOR NPI PROGRAMS
79
+
80
+ 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.
81
+
82
+ 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.
83
+
84
+ 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.
85
+
86
+ Grade School Addition. For grade-school addition, the domain-specific encoder is
87
+
88
+ $$
89
+ \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}
90
+ $$
91
+
92
+ 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 } )$ .
93
+
94
+ 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.
95
+
96
+ 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,
97
+
98
+ # Full Recursive
99
+
100
+ ![](images/54ac005719045e00f6d938466b5b91cbc2d9b186869b92dd8c3b93eb2423cdb1.jpg)
101
+ 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.
102
+
103
+ 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.
104
+
105
+ Bubble Sort. For bubble sort, the domain-specific encoder is
106
+
107
+ $$
108
+ 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 ) ] ) ,
109
+ $$
110
+
111
+ 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 .
112
+
113
+ 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.
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ # Algorithm 2 Depth First Search Topological Sort
120
+
121
+ 1: Color all vertices white.
122
+ 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
123
+ 9: if $v _ { a c t i v e }$ has a white child $v$ then
124
+ 10: $\operatorname { c o l o r } [ v ] = \operatorname { g r e y }$
125
+ 11: push $v _ { a c t i v e }$ onto $S$
126
+ 12: $v _ { a c t i v e } = v$
127
+ 13: else
128
+ 14: $\mathrm { c o l o r } [ v _ { a c t i v e } ] = \mathrm { b l a c k }$
129
+ 15: Write $v _ { a c t i v e }$ to result
130
+ 16: if $S$ is empty then pass
131
+ 17: else pop the top vertex off $S$ and set it to $v _ { a c t i v e }$
132
+ 18: while $S$ is not empty
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ For topological sort, the domain-specific encoder is
141
+
142
+ $$
143
+ \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}
144
+ $$
145
+
146
+ 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.
147
+
148
+ 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$ .
149
+
150
+ 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.
151
+
152
+ 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.
153
+
154
+ 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.
155
+
156
+ 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.
157
+
158
+ # Algorithm 3 Recursive Quicksort
159
+
160
+ 1: Initialize an array $A$ to sort.
161
+ 2: Initialize $l o$ and $h i$ to be 1 and $n$ , where $n$ is the length of $A$ .
162
+ 3:
163
+ 4: function QUICKSORT $( A , l o , h i )$
164
+ 5: if $l o < h i$ : then
165
+ 6: $\mathsf { p } = \mathsf { P A R T I T I O N } ( A , l o , h i )$
166
+ 7: $\mathrm { Q U I C K S O R T } ( A , l o , p - 1 )$
167
+ 8: $\operatorname { Q U I C K S O R T } ( A , p + 1 , h i )$
168
+ 9:
169
+ 10: function PARTITION $( A , l o , h i )$
170
+ 11: $p i v o t = l o$
171
+ 12: for $j \in [ l o , h i - 1 ] : \mathbf { d o }$
172
+ 13: if $A [ j ] \leq A [ h i ]$ then
173
+ 14: swap A[pivot] with $A [ j ]$
174
+ 15: pivot = pivot + 1
175
+ 16: swap A[pivot] with A[hi]
176
+ 17: return pivot
177
+
178
+ For quicksort, the domain-specific encoder is
179
+
180
+ $$
181
+ \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}
182
+ $$
183
+
184
+ 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
185
+
186
+ $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 }$ .
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ # 3.3 PROVABLY PERFECT GENERALIZATION
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ Formally, verification consists of proving the following theorem:
199
+
200
+ $$
201
+ \forall i \in V , M ( i ) \downdownarrows P ( i )
202
+ $$
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ 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.
209
+
210
+ 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).
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ Note that $V$ should also contain the necessary reductions, which corresponds to making the recursive calls at the correct time, as indicated by $P$ .
217
+
218
+ 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 }$ .
219
+
220
+ 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.
221
+
222
+ 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.
223
+
224
+ # 4 EXPERIMENTS
225
+
226
+ 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.
227
+
228
+ 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. } }$ ).
229
+
230
+ 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]).
231
+
232
+ 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.
233
+
234
+ The training set for quicksort contains 4 traces, synthesized from arrays of length 5.
235
+
236
+ The same set of problems was used to generate the training traces for all formulations of the task, for non-recursive and recursive versions.
237
+
238
+ Table 1: Accuracy on Randomly Generated Problems for Bubble Sort
239
+
240
+ <table><tr><td>Length of Array</td><td>Non-Recursive</td><td>PartiallyRecursive</td><td>FullRecursive</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>23</td><td>100%</td><td>100%</td><td>100%</td></tr><tr><td></td><td>6.7%</td><td>23%</td><td>100%</td></tr><tr><td>4</td><td>10%</td><td>10%</td><td>100%</td></tr><tr><td>8</td><td>0% 0%</td><td>0% 0%</td><td>100% 100%</td></tr><tr><td>20</td><td></td><td></td><td>100%</td></tr><tr><td>90</td><td>0%</td><td>0%</td><td></td></tr></table>
241
+
242
+ 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).
243
+
244
+ 4.1 RESULTS ON GENERALIZATION OF RECURSIVE NEURAL PROGRAMS
245
+
246
+ We now report on generalization for the varying tasks.
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ Table 2: Accuracy on Randomly Generated Problems for Topological Sort
261
+
262
+ <table><tr><td>NumberofVertices</td><td>Non-Recursive</td><td>Recursive</td></tr><tr><td></td><td></td><td></td></tr><tr><td>5</td><td>6.7%</td><td>100%</td></tr><tr><td>6</td><td>6.7%</td><td>100%</td></tr><tr><td>7</td><td>3.3%</td><td>100%</td></tr><tr><td>8</td><td>0%</td><td>100%</td></tr><tr><td>70</td><td>0%</td><td>100%</td></tr></table>
263
+
264
+ Table 3: Accuracy on Randomly Generated Problems for Quicksort
265
+
266
+ <table><tr><td>LengthofArray</td><td>Non-Recursive</td><td>Recursive</td></tr><tr><td>3</td><td>100%</td><td>100%</td></tr><tr><td>5</td><td>100%</td><td>100%</td></tr><tr><td>7</td><td>100%</td><td>100%</td></tr><tr><td>11</td><td>73.3%</td><td>100%</td></tr><tr><td>15</td><td>60%</td><td>100%</td></tr><tr><td>20</td><td>30%</td><td></td></tr><tr><td>22</td><td>20%</td><td>100%</td></tr><tr><td>25</td><td>3.33%</td><td>100%</td></tr><tr><td>30</td><td>3.33%</td><td>100%</td></tr><tr><td></td><td></td><td>100%</td></tr><tr><td>70</td><td>0%</td><td>100%</td></tr></table>
267
+
268
+ 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.
269
+
270
+ # 4.2 VERIFICATION OF PROVABLY PERFECT GENERALIZATION
271
+
272
+ 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.
273
+
274
+ 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.
275
+
276
+ 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.
277
+
278
+ # 5 CONCLUSION
279
+
280
+ 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.
281
+
282
+ # ACKNOWLEDGMENTS
283
+
284
+ 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.
285
+
286
+ # REFERENCES
287
+
288
+ Marcin Andrychowicz and Karol Kurach. Learning efficient algorithms with hierarchical attentive memory. CoRR, abs/1602.03218, 2016. URL http://arxiv.org/abs/1602.03218.
289
+
290
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
291
+
292
+ 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.
293
+
294
+ Lukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. CoRR, abs/1511.08228, 2015. URL http://arxiv.org/abs/1511.08228.
295
+
296
+ 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.
297
+
298
+ Arvind Neelakantan, Quoc V. Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent, 2015.
299
+
300
+ Scott Reed and Nando de Freitas. Neural programmer-interpreters. ICLR, 2016.
301
+
302
+ 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.
303
+
304
+ 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.
305
+
306
+ A APPENDIX
307
+
308
+ A.1 PROGRAM SET FOR NON-RECURSIVE TOPOLOGICAL SORT
309
+
310
+ <table><tr><td rowspan=1 colspan=1>Program</td><td rowspan=1 colspan=1>Descriptions</td><td rowspan=1 colspan=1>Calls</td><td rowspan=1 colspan=1>Arguments</td></tr><tr><td rowspan=1 colspan=1>TOPOSORT</td><td rowspan=1 colspan=1>Perform topologicalsort on graph</td><td rowspan=1 colspan=1>TRAVERSE,NEXT_START,WRITE,MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>TRAVERSE</td><td rowspan=1 colspan=1>Traverse graph untilstack is empty</td><td rowspan=1 colspan=1>CHECK_CHILD,EX-PLORE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>CHECK_CHILD</td><td rowspan=1 colspan=1>Check ifawhitechild exists; if so, setchildList[Uactive] topoint to it</td><td rowspan=1 colspan=1>MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>EXPLORE</td><td rowspan=1 colspan=1>Repeatedlytraversesubgraphs until stackis empty</td><td rowspan=1 colspan=1>STACK,CHECK_CHILD,WRITE,MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>STACK</td><td rowspan=1 colspan=1>Interactwith stack,either pushing orpopping</td><td rowspan=1 colspan=1>WRITE,MOVE</td><td rowspan=1 colspan=1>PUSH,POP</td></tr><tr><td rowspan=1 colspan=1>NEXT_START</td><td rowspan=1 colspan=1>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</td><td rowspan=1 colspan=1>MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>WRITE</td><td rowspan=1 colspan=1>Write a value eitherto environment (e.g.,to color a vertex)or variable (e.g., tochange the value ofUactive)</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>Described below</td></tr><tr><td rowspan=1 colspan=1>MOVE</td><td rowspan=1 colspan=1>Move a pointer(e.g, Pstart orchildList[vactive])up or down</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>Described below</td></tr></table>
311
+
312
+ # Argument Sets for WRITE and MOVE.
313
+
314
+ WRITE. The WRITE operation has the following arguments:
315
+
316
+ # ARG 1 (Main Action): COLOR CURR, COLOR NEXT, ACTIVE START, ACTIVE NEIGHB, ACTIVE STACK, SAVE, STACK PUSH, STACK POP, RESULT
317
+
318
+ 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 } )$ .
319
+
320
+ ARG 2 (Auxiliary Variable): COLOR GREY, COLOR BLACK
321
+
322
+ COLOR GREY and COLOR BLACK color the given vertex grey and black, respectively.
323
+
324
+ MOVE. The MOVE operation has the following arguments:
325
+
326
+ 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 } ]$
327
+
328
+ 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.
329
+
330
+ ARG 2 (Increment or Decrement): UP, DOWN
331
+
332
+ # A.2 TRACE-GENERATING FUNCTIONS FOR TOPOLOGICAL SORT
333
+
334
+ # A.2.1 NON-RECURSIVE TRACE-GENERATING FUNCTIONS
335
+
336
+ 1 // Top level topological sort call
337
+ 2 TOPOSORT() {
338
+ 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
339
+ 4 WRITE(ACTIVE_START)
340
+ 5 WRITE(COLOR_CURR, COLOR_GREY)
341
+ 6 TRAVERSE()
342
+ 7 MOVE(pstart, UP)
343
+ 8 NEXT_START()
344
+ 9 }
345
+ 10
346
+ 11 TRAVERSE() {
347
+ 12 CHECK_CHILD()
348
+ 13 EXPLORE()
349
+ 14 }
350
+ 15
351
+ 16 CHECK_CHILD() {
352
+ 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
353
+ 18 MOVE(childList[vactive], UP)
354
+ 19 }
355
+ 20
356
+ 21 EXPLORE() {
357
+ 22 do
358
+ 23 if (Qcolor(DAG[vactive][childList[vactive]]) is white):
359
+ 24 WRITE(COLOR_NEXT, COLOR_GREY)
360
+ 25 STACK(PUSH)
361
+ 26 WRITE(SAVE)
362
+ 27 WRITE(ACTIVE_NEIGHB)
363
+ 28 MOVE(childList[vsave], UP)
364
+ 29 else:
365
+ 30 WRITE(COLOR_CURR, COLOR_BLACK)
366
+ 31 WRITE(RESULT)
367
+ 32 MOVE(presult, UP)
368
+ 33 if(pstack == 1):
369
+ 34 break
370
+ 35 else:
371
+ 36 STACK(POP)
372
+ 37 CHECK_CHILD()
373
+ 38 while (true)
374
+ 39
375
+ 40
376
+ 41 STACK(op) {
377
+ 42 if (op == PUSH):
378
+ 43 WRITE(STACK_PUSH)
379
+ 44 MOVE(pstack, UP)
380
+ 45
381
+ 46 if (op == POP):
382
+ 47 WRITE(ACTIVE_STACK)
383
+ 48 WRITE(STACK_POP)
384
+ 49 MOVE(pstack, DOWN)
385
+ 50 }
386
+ 51
387
+ 52 NEXT_START() {
388
+ 53 while(Qcolor(pstart) is not white and is not invalid): // color invalid when all vertices explored
389
+ 54 MOVE(pstart, UP)
390
+ 55 }
391
+
392
+ # A.2.2 RECURSIVE TRACE-GENERATING FUNCTIONS
393
+
394
+ # Altered Recursive Functions
395
+
396
+ 1 // Top level topological sort call
397
+ 2 TOPOSORT() {
398
+ 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
399
+ 4 WRITE(ACTIVE_START)
400
+ 5 WRITE(COLOR_CURR, COLOR_GREY)
401
+ 6 TRAVERSE()
402
+ 7 MOVE(pstart, UP)
403
+ 8 NEXT_START()
404
+ 9 TOPOSORT() // Recursive Call
405
+ 10 }
406
+ 11
407
+ 12 CHECK_CHILD() {
408
+ 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
409
+ 14 MOVE(childList[vactive], UP)
410
+ 15 CHECK_CHILD() // Recursive Call
411
+ 16 }
412
+ 17
413
+ 18 EXPLORE() {
414
+ 19 if (Qcolor(DAG[vactive][childList[vactive]]) is white):
415
+ 20 WRITE(COLOR_NEXT, COLOR_GREY)
416
+ 21 STACK(PUSH)
417
+ 22 WRITE(SAVE)
418
+ 23 WRITE(ACTIVE_NEIGHB)
419
+ 24 MOVE(childList[vsave], UP)
420
+ 25 else:
421
+ 26 WRITE(COLOR_CURR, COLOR_BLACK)
422
+ 27 WRITE(RESULT)
423
+ 28 MOVE(presult, UP)
424
+ 29 if $( p _ { s t a c k } = = 1$ ):
425
+ 30 return
426
+ 31 else:
427
+ 32 STACK(POP)
428
+ 33 CHECK_CHILD()
429
+ 34 EXPLORE() // Recursive Call
430
+ 35 }
431
+ 36
432
+ 37 NEXT_START() {
433
+ 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
434
+ 39 MOVE $( p _ { s t a r t }$ , UP)
435
+ 40 NEXT_START() // Recursive Call
436
+ 41 }
437
+
438
+ # Algorithm 4 Iterative Quicksort
439
+
440
+ 1: Initialize an array $A$ to sort and two empty stacks $S _ { l o }$ and $S _ { h i }$ .
441
+ 2: Initialize lo and $h i$ to be 1 and $n$ , where $n$ is the length of $A$ .
442
+ 3:
443
+ 4: function PARTITION $( A , l o , h i )$
444
+ 5: $p i v o t = l o$
445
+ 6: for $j \in [ l o , h i - 1 ] : \mathbf { d o }$
446
+ 7: if $A [ j ] \leq A [ h i ]$ then
447
+ 8: swap A[pivot] with $A [ j ]$
448
+ 9: pivot = pivot + 1
449
+ 10: swap A[pivot] with $A [ h i ]$
450
+ 11: return pivot
451
+ 12:
452
+ 13: function QUICK ${ \mathrm { : } } \operatorname { S o R T } ( A , l o , h i )$
453
+ 14: while $S _ { l o }$ and $S _ { h i }$ are not empty: do
454
+ 15: Pop states off $S _ { l o }$ and $S _ { h i }$ , writing them to $l o$ and $h i$ .
455
+ 16: $\mathsf { p } = \mathsf { P A R T I T I O N } ( A , l o , h i )$
456
+ 17: Push $p + 1$ and $h i$ to $S _ { l o }$ and $S _ { h i }$ .
457
+ 18: Push lo and $p - 1$ to $S _ { l o }$ and $S _ { h i }$ .
458
+
459
+ A.4 PROGRAM SET FOR QUICKSORT
460
+
461
+ <table><tr><td rowspan=1 colspan=1>Program</td><td rowspan=1 colspan=1>Descriptions</td><td rowspan=1 colspan=1>Calls</td><td rowspan=1 colspan=1> Arguments</td></tr><tr><td rowspan=1 colspan=1>QUICKSORT</td><td rowspan=1 colspan=1>Runthequicksortroutine in place forthearrayA,forindices from lo to hi</td><td rowspan=1 colspan=1>Non-Recursive: PAR-TITION, STACK,WRITERecursive: same asnon-recursiveversion,alongwithQUICK-SORT</td><td rowspan=1 colspan=1>Implicitly:arrayA to sort, lo, hi</td></tr><tr><td rowspan=1 colspan=1>PARTITION</td><td rowspan=1 colspan=1>Runsthepartitionfunction. At end,pointer Ppivot ismoved to the pivot</td><td rowspan=1 colspan=1>COMPSWAP_LOOP,MOVE_PIVOT_LO,MOVE_JLO, SWAP</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>COMPSWAPLOOP</td><td rowspan=1 colspan=1>Runs the FOR loopinside the partitionfunction</td><td rowspan=1 colspan=1>COMPSWAP, MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>COMPSWAP</td><td rowspan=1 colspan=1>ComparesA[pivot] ≤ A[j]; ifso,perform a swapand increment Ppivot</td><td rowspan=1 colspan=1>SWAP, MOVE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>SET_PIVOTLO</td><td rowspan=1 colspan=1>Sets Ppivot to lo in-dex</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>SETJLO</td><td rowspan=1 colspan=1>Sets pj to lo index</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>SET_J_NULL</td><td rowspan=1 colspan=1>Sets pj to-00</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>NONE</td></tr><tr><td rowspan=1 colspan=1>STACK</td><td rowspan=1 colspan=1>Pushes lo/hi statesonto stacks Sto andShi according to argument(describedbelow)</td><td rowspan=1 colspan=1>WRITE, MOVE</td><td rowspan=1 colspan=1>Described below</td></tr><tr><td rowspan=1 colspan=1>MOVE</td><td rowspan=1 colspan=1>Movespointerone unit up or down</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>Described below</td></tr><tr><td rowspan=1 colspan=1>SWAP</td><td rowspan=1 colspan=1>Swapselementsatgiven array indices</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>Described below</td></tr><tr><td rowspan=1 colspan=1>WRITE</td><td rowspan=1 colspan=1>Write a valueeither to stack(e.g QstackLoorQstackHi) or topointer (e.g tochangethe value ofPhi)</td><td rowspan=1 colspan=1>NONE</td><td rowspan=1 colspan=1>Described below</td></tr></table>
462
+
463
+ Argument Sets for STACK, MOVE, SWAP, WRITE.
464
+
465
+ STACK. The STACK operation has the following arguments:
466
+
467
+ ARG 1 (Operation): STACK PUSH CALL1, STACK PUSH CALL2, STACK POP
468
+
469
+ 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 }$ .
470
+
471
+ MOVE. The MOVE operation has the following arguments:
472
+
473
+ ARG 1 (Pointer): pstackLo, pstackHi, pj , ppivot
474
+
475
+ 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.
476
+
477
+ ARG 2 (Increment or Decrement): UP, DOWN
478
+
479
+ SWAP. The SWAP operation has the following arguments:
480
+
481
+ ARG 1 (Swap Object 1): ppivot
482
+
483
+ ARG 2 (Swap Object 2): $p _ { h i } , p _ { j }$
484
+
485
+ WRITE. The WRITE operation has the following arguments:
486
+
487
+ ARG 1 (Object to Write): ENV STACK LO, ENV STACK HI, $p _ { h i } , p _ { l o }$
488
+
489
+ 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.
490
+
491
+ 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
492
+
493
+ 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.
494
+
495
+ 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.
496
+
497
+ # A.5 TRACE-GENERATING FUNCTIONS FOR QUICKSORT
498
+
499
+ # A.5.1 NON-RECURSIVE TRACE-GENERATING FUNCTIONS
500
+
501
+ 1 Initialize $p _ { l o }$ to 1 and $p _ { h i } \ t \circ \ n$ (length of array)
502
+ 2 Initialize $p _ { j } ~ \mathsf { t o } ~ - \infty$
503
+ 3
504
+ 4 QUICKSORT() {
505
+ 5 while $( p _ { s t a c k L o } \neq 1 )$ :
506
+ 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 ) ) :$
507
+ 7 STACK(STACK_POP)
508
+ 8 else:
509
+ 9 WRITE $( \boldsymbol { p } _ { h i }$ , ENV_STACK_HI_PEEK)
510
+ 10 WRITE(plo, ENV_STACK_LO_PEEK)
511
+ 11 STACK(STACK_POP)
512
+ 12 PARTITION()
513
+ 13 STACK(STACK_PUSH_CALL2)
514
+ 14 STACK(STACK_PUSH_CALL1)
515
+ 15 }
516
+ 16
517
+ 17 PARTITION() {
518
+ 18 SET_PIVOT_LO()
519
+ 19 SET_J_LO()
520
+ 20 COMPSWAP_LOOP()
521
+ 24 SWAP(ppivot, phi)
522
+ SET_J_NULL()
523
+ }
524
+ COMPSWAP_LOOP() {
525
+ while $( p _ { j } \neq p _ { h i } )$ :
526
+ COMPSWAP()
527
+ MOVE $( p _ { j }$ , UP)
528
+ }
529
+ 30
530
+ 31 COMPSWAP() {
531
+ 32 if (A[pj ] ≤ A[phi]):
532
+ 33 SWAP(ppivot, pj)
533
+ 34 MOVE(ppivot, UP)
534
+ 35 }
535
+ 36
536
+ 37 STACK(op) {
537
+ 38 if (op == STACK_PUSH_CALL1):
538
+ 39 WRITE(ENV_STACK_LO, plo)
539
+ 40 WRITE(ENV_STACK_HI, ppivot − 1)
540
+ 41 MOVE(pstackLo, UP)
541
+ 42 MOVE(pstackHi, UP)
542
+ 43
543
+ 44 if (op $= =$ STACK_PUSH_CALL2):
544
+ 45 WRITE(ENV_STACK_LO, ppivot $^ { + 1 1 }$ )
545
+ 46 WRITE(ENV_STACK_HI, $p _ { h i }$ )
546
+ 47 MOVE(pstackLo, UP)
547
+ 48 MOVE(pstackHi, UP)
548
+ 49
549
+ 50 if (op $= =$ STACK_POP):
550
+ 51 WRITE(ENV_STACK_LO, RESET)
551
+ 52 WRITE(ENV_STACK_HI, RESET)
552
+ 53 MOVE(pstackLo, DOWN)
553
+ 54 MOVE(pstackHi, DOWN)
554
+ 55 }
555
+
556
+ # A.5.2 RECURSIVE TRACE-GENERATING FUNCTIONS
557
+
558
+ # Altered Recursive Functions
559
+
560
+ Initialize to 1 and $p _ { h i } \ t \circ \ n$ (length of array)
561
+
562
+ 1 $p _ { l o }$
563
+ 2 Initialize $p _ { j }$ to −∞
564
+ 3
565
+ 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}$
566
+ 5 if
567
+ 6
568
+ 7 STACK(STACK_PUSH_CALL2)
569
+ 8 STACK(STACK_PUSH_CALL1)
570
+ 9 WRITE $( p _ { h i }$ , ENV_STACK_HI_PEEK)
571
+ 10 WRITE $( p _ { l o }$ , ENV_STACK_LO_PEEK)
572
+ 11 QUICKSORT() // Recursive Call
573
+ 12 STACK(STACK_POP)
574
+ 13 WRITE $( p _ { h i }$ , ENV_STACK_HI_PEEK)
575
+ 14 WRITE $( p _ { l o }$ , ENV_STACK_LO_PEEK)
576
+ 15 QUICKSORT() // Recursive Call
577
+ 16 STACK(STACK_POP)
578
+ 17 }
579
+ 18
580
+ 19 COMPSWAP_LOOP() {
581
+ 20 if $( p _ { j } \neq p _ { h i } )$ :
582
+ 21 COMPSWAP()
583
+ 22 MOVE $( p _ { j }$ , UP)
584
+ 23 COMPSWAP_LOOP() // Recursive Call
585
+ 24 }
586
+
587
+ A.6 BASE CASES, REDUCTION RULES, AND VERIFICATION SETS
588
+
589
+ 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.
590
+
591
+ 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.
592
+
593
+ 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.
594
+
595
+ 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.
596
+
597
+ 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).
598
+
599
+ 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.
600
+
601
+ 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.
602
+
603
+ 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:
604
+
605
+ $$
606
+ \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}
607
+ $$
608
+
609
+ Table 4: Accuracy on Randomly Generated Problems for Variant of Bubble Sort
610
+
611
+ <table><tr><td>Length of Array</td><td>Non-Recursive</td><td>Recursive</td></tr><tr><td></td><td>100%</td><td>100%</td></tr><tr><td>23</td><td>100%</td><td>100%</td></tr><tr><td>4</td><td>100%</td><td>100%</td></tr><tr><td>5</td><td>100%</td><td>100%</td></tr><tr><td>6</td><td>90%</td><td>100%</td></tr><tr><td>7</td><td>86.7%</td><td>100%</td></tr><tr><td>8</td><td>6.7%</td><td>100%</td></tr><tr><td>9</td><td>0%</td><td>100%</td></tr><tr><td>10</td><td>0%</td><td></td></tr><tr><td>12</td><td>0%</td><td>100%</td></tr><tr><td>15</td><td>0%</td><td>100%</td></tr><tr><td></td><td></td><td>100%</td></tr><tr><td>70</td><td>0%</td><td>100%</td></tr></table>
612
+
613
+ which directly exposes which of the two values pointed to is larger. This modification also enables us to sort arrays containing arbitrary comparable elements.
614
+
615
+ 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.
616
+
617
+ 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.
618
+
619
+ 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.
620
+
621
+ 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.
622
+
623
+ 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.
md/train/BkgtDsCcKQ/BkgtDsCcKQ.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/Bkxonh4Ywr/Bkxonh4Ywr.md ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LOCALIZING AND AMORTIZING: EFFICIENT INFERENCE FOR GAUSSIAN PROCESSES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 2 BACKGROUND
24
+
25
+ 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.
26
+
27
+ 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$ .
28
+
29
+ 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.
30
+
31
+ 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 } )$
32
+
33
+ ![](images/14ddfde5436b3c8fabab96a6fd00f543492efb6a505615591341ebaa4874b1ef.jpg)
34
+ 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.
35
+
36
+ The inference is carried out by maximizing the Evidence Lower BOund (ELBO) with respect to $q ( \mathbf { f } )$ (Blei et al., 2017).
37
+
38
+ $$
39
+ \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 } }
40
+ $$
41
+
42
+ 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$ .
43
+
44
+ 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.
45
+
46
+ 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.
47
+
48
+ # 3 METHOD
49
+
50
+ # 3.1 THE VARIATIONAL DISTRIBUTION
51
+
52
+ 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).
53
+
54
+ 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.
55
+
56
+ $$
57
+ 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 } ) .
58
+ $$
59
+
60
+ 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 }$ .
61
+
62
+ # 3.2 OPTIMIZATION OF THE ELBO
63
+
64
+ 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.
65
+
66
+ 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.
67
+
68
+ 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
69
+
70
+ $$
71
+ 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 ) .
72
+ $$
73
+
74
+ Here $S$ is a random batch of data points.
75
+
76
+ 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
77
+
78
+ $$
79
+ \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 ] .
80
+ $$
81
+
82
+ 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$ .
83
+
84
+ 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
85
+
86
+ $$
87
+ 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] .
88
+ $$
89
+
90
+ 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.
91
+
92
+ $$
93
+ 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 .
94
+ $$
95
+
96
+ 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.
97
+
98
+ $$
99
+ 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 } ) .
100
+ $$
101
+
102
+ 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).
103
+
104
+ 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.
105
+
106
+ # 3.3 AMORTIZED INFERENCE
107
+
108
+ 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.
109
+
110
+ 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 ) }$ :
111
+
112
+ $$
113
+ \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}
114
+ $$
115
+
116
+ 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.
117
+
118
+ 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”.
119
+
120
+ 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.
121
+
122
+ # 3.4 PREDICTION
123
+
124
+ For a new data point $\mathbf { x } _ { \star }$ with its $K$ nearest neighbors $n ( \star )$ in the prior, the predictive distribution is
125
+
126
+ $$
127
+ 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 } ) .
128
+ $$
129
+
130
+ ![](images/d66507f0b5b95720272e2d3439961525cb73c16e79e9c1099008221c027b8159.jpg)
131
+ 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.
132
+
133
+ 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,
134
+
135
+ $$
136
+ \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}
137
+ $$
138
+
139
+ 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
140
+
141
+ # 4 EXPERIMENT
142
+
143
+ 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.
144
+
145
+ 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$ ).
146
+
147
+ # 4.1 A TOY EXAMPLE
148
+
149
+ 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.
150
+
151
+ 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.
152
+
153
+ 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.
154
+
155
+ Table 1: Comparison on the eBird dataset.
156
+
157
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Config</td><td rowspan=1 colspan=1>Pred NLL</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>SVGP</td><td rowspan=1 colspan=1>M=2004M=1000√</td><td rowspan=1 colspan=1>1.90±.031.88±.02</td><td rowspan=1 colspan=1>107s4.5ks</td></tr><tr><td rowspan=1 colspan=1>SAVIGP</td><td rowspan=1 colspan=1>M=2004M=2000√</td><td rowspan=1 colspan=1>2.04±.031.99±.03</td><td rowspan=1 colspan=1>167s50ks</td></tr><tr><td rowspan=1 colspan=1>VFF</td><td rowspan=1 colspan=1>M=200HM=2000</td><td rowspan=1 colspan=1>1.91±.021.91±.02</td><td rowspan=1 colspan=1>1.3ks13ks</td></tr><tr><td rowspan=1 colspan=1>DGP</td><td rowspan=1 colspan=1>M=2004M=2000</td><td rowspan=1 colspan=1>1.82±.021.80±.02</td><td rowspan=1 colspan=1>96s213s</td></tr><tr><td rowspan=1 colspan=1>AIGP</td><td rowspan=1 colspan=1>K=10 MK=20 √</td><td rowspan=1 colspan=1>1.79±.051.71±.05</td><td rowspan=1 colspan=1>45s125s</td></tr><tr><td rowspan=1 colspan=1>LAIN</td><td rowspan=1 colspan=1>K=10K=20K=40</td><td rowspan=1 colspan=1>1.69±.031.65±.031.60±.02</td><td rowspan=1 colspan=1>55s384s1.3ks</td></tr></table>
158
+
159
+ Table 2: Comparison on the precipitation dataset.
160
+
161
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Config</td><td rowspan=1 colspan=1>Pred NLL</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>SVGP</td><td rowspan=1 colspan=1>M=200HM=2000</td><td rowspan=1 colspan=1>1.57±.031.28±.03</td><td rowspan=1 colspan=1>2.5ks42ks</td></tr><tr><td rowspan=1 colspan=1>SAVIGP</td><td rowspan=1 colspan=1>M=2004M=2000</td><td rowspan=1 colspan=1>1.70±.021.58±.02</td><td rowspan=1 colspan=1>2.8ks50ks</td></tr><tr><td rowspan=1 colspan=1>VFF</td><td rowspan=1 colspan=1>M=2004M=2000</td><td rowspan=1 colspan=1>1.54±.031.53±.03</td><td rowspan=1 colspan=1>9.1ks32ks</td></tr><tr><td rowspan=1 colspan=1>DGP</td><td rowspan=1 colspan=1>M=200HM=2000</td><td rowspan=1 colspan=1>1.07±.051.00±.05</td><td rowspan=1 colspan=1>402s889s</td></tr><tr><td rowspan=1 colspan=1>AIGP</td><td rowspan=1 colspan=1>K=10 4K=10 √</td><td rowspan=1 colspan=1>0.96±.030.96±.03</td><td rowspan=1 colspan=1>155s155s</td></tr><tr><td rowspan=1 colspan=1>LAIN</td><td rowspan=1 colspan=1>K=10K=20K=40</td><td rowspan=1 colspan=1>0.74±.050.72±.050.69±.04</td><td rowspan=1 colspan=1>129s903s2.3ks</td></tr></table>
162
+
163
+ ![](images/4e7a03685eb2a699e7d27c999ce631f8d156786ab9745e1016d46a92fbe32fdc.jpg)
164
+ Figure 3: ELBO trajectories of LAIN with and without inference networks.
165
+
166
+ Table 3: Comparison on the MNIST dataset.
167
+
168
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Config</td><td rowspan=1 colspan=1>Pred NLL</td><td rowspan=1 colspan=1>Accuracy</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>SVGP</td><td rowspan=1 colspan=1>M=200王M=1000√</td><td rowspan=1 colspan=1>0.053±.0040.051±.004</td><td rowspan=1 colspan=1>98.498.5</td><td rowspan=1 colspan=1>623s23ks</td></tr><tr><td rowspan=1 colspan=1>SAVIGP</td><td rowspan=1 colspan=1>M=200HM=200√</td><td rowspan=1 colspan=1>0.339±.0080.339±.008</td><td rowspan=1 colspan=1>51.751.7</td><td rowspan=1 colspan=1>6.5ks6.5ks</td></tr><tr><td rowspan=1 colspan=1>DGP</td><td rowspan=1 colspan=1>M=2004M=2000</td><td rowspan=1 colspan=1>0.059±.0050.052±.005</td><td rowspan=1 colspan=1>98.198.3</td><td rowspan=1 colspan=1>292s2.1ks</td></tr><tr><td rowspan=1 colspan=1>AIGP</td><td rowspan=1 colspan=1>K=10 4K=40 √</td><td rowspan=1 colspan=1>0.293±.0020.215±.003</td><td rowspan=1 colspan=1>98.098.2</td><td rowspan=1 colspan=1>3.9ks24ks</td></tr><tr><td rowspan=1 colspan=1>LAIN</td><td rowspan=1 colspan=1>K=10K=20K=40</td><td rowspan=1 colspan=1>0.053±.0030.050±.0030.051±.003</td><td rowspan=1 colspan=1>98.999.099.1</td><td rowspan=1 colspan=1>128s632s2.9ks</td></tr><tr><td rowspan=1 colspan=1>KNN</td><td rowspan=1 colspan=1>K=9K=19K=39</td><td rowspan=1 colspan=1>N.A.N.A.N.A.</td><td rowspan=1 colspan=1>98.698.397.6</td><td rowspan=1 colspan=1>24s26s28s</td></tr></table>
169
+
170
+ # 4.2 BIRD ABUNDANCE ESTIMATION
171
+
172
+ 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 } )$ .
173
+
174
+ 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.
175
+
176
+ 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.
177
+
178
+ # 4.3 PRECIPITATION LEVEL ESTIMATION
179
+
180
+ 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.
181
+
182
+ Table 2 summaries the experimental results. LAIN has better predictive performance, and its running speed is comparable to or faster than other methods.
183
+
184
+ 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.
185
+
186
+ # 4.4 HAND-WRITTEN DIGIT CLASSIFICATION
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ 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.
193
+
194
+ # 5 CONCLUSION
195
+
196
+ 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.
197
+
198
+ # REFERENCES
199
+
200
+ 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.
201
+
202
+ Sudipto Banerjee, Bradley P Carlin, and Alan E Gelfand. Hierarchical modeling and analysis for spatial data. Chapman and Hall/CRC, 2014.
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ 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.
209
+
210
+ Climate Data Online. https://www.ncdc.noaa.gov/cdo-web/datasets.
211
+
212
+ Zhenwen Dai, Andreas Damianou, Javier Gonzalez, and Neil Lawrence. Variational auto-encoded´ deep gaussian processes. arXiv preprint arXiv:1511.06455, 2015.
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ 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.
219
+
220
+ Aleksandra Faust. Decoupled gaussian process (github implementation). https://github. com/google/decoupled_gaussian_process, 2018.
221
+
222
+ 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.
223
+
224
+ 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.
225
+
226
+ 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.
227
+
228
+ Joseph Guinness. Permutation and grouping methods for sharpening gaussian process approximations. Technometrics, 60(4):415–429, 2018.
229
+
230
+ James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013.
231
+
232
+ 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.
233
+
234
+ James Hensman, Nicolas Durrande, and Arno Solin. Variational fourier features for gaussian processes. The Journal of Machine Learning Research, 18(1):5537–5588, 2017.
235
+
236
+ 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.
237
+
238
+ 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.
239
+
240
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the 2nd International Conference on Learning Representations (ICLR), number 2014, 2013.
241
+
242
+ Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
243
+
244
+ 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.
245
+
246
+ Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ A. Panos, P. Dellaportas, and M. K. Titsias. Fully Scalable Gaussian Processes using Subspace Inducing Inputs. ArXiv e-prints, July 2018.
265
+
266
+ Chiwoo Park and Daniel Apley. Patchwork kriging for large-scale gaussian process regression. The Journal of Machine Learning Research, 19(1):269–311, 2018.
267
+
268
+ 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.
269
+
270
+ Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In International Conference on Machine Learning, pp. 324–333, 2016.
271
+
272
+ Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. The MIT Press, 2006.
273
+
274
+ H. Salimbeni, C.-A. Cheng, B. Boots, and M. Deisenroth. Orthogonally Decoupled Variational Gaussian Processes. ArXiv e-prints, September 2018.
275
+
276
+ 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.
277
+
278
+ Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Advances in neural information processing systems, pp. 1257–1264, 2006.
279
+
280
+ 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.
281
+
282
+ 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.
283
+
284
+ 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.
md/train/ByeSYa4KPS/ByeSYa4KPS.md ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPARSE NETWORKS FROM SCRATCH: FASTER TRAINING WITHOUT LOSING PERFORMANCE
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ # 2 RELATED WORK
18
+
19
+ 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).
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ # 3 SPARSE LEARNING
26
+
27
+ 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.
28
+
29
+ ![](images/975651e113bf641bb08fd14d8ca3b02bff573688fd39a93af9523d766b61ae3c.jpg)
30
+ 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$ .
31
+
32
+ # 3.1 SPARSE MOMENTUM
33
+
34
+ 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.
35
+
36
+ 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 }$ :
37
+
38
+ $$
39
+ \mathbf { M } _ { i } ^ { t + 1 } = \alpha \mathbf { M } _ { i } ^ { t } + ( 1 - \alpha ) \frac { \partial \mathbf { E } } { \partial \mathbf { W } _ { i } } ^ { t } ,
40
+ $$
41
+
42
+ 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.
43
+
44
+ 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.
45
+
46
+ 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.
47
+
48
+ Algorithm 1: Sparse momentum algorithm.
49
+
50
+ <table><tr><td colspan="2">Data: Layer i to k with: Momentum Mi,Weight Wi, binary Maski prune rate pi, density d 1 fori←O to k do</td></tr><tr><td colspan="2">Wi ← xavierInit(Wi)</td></tr><tr><td>2 3</td><td>Maski ← createMaskForWeight(Wi,d)</td></tr><tr><td>4</td><td>applyMask(Wi,Maski)</td></tr><tr><td>5 end</td><td></td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">6 for epoch ← O to numEpochs do</td></tr><tr><td>7</td><td>for j←O to numBatches do</td></tr><tr><td>8</td><td>batch ← getBatch(j) E</td></tr><tr><td>9</td><td>W = computeGradients(W, batch)</td></tr><tr><td>10</td><td>UpdateMomentum( 器)</td></tr><tr><td>11</td><td>UpdateWeights(M)</td></tr><tr><td>12</td><td>fori←O to k do</td></tr><tr><td>13</td><td>applyMask(Wi,Maski) end</td></tr><tr><td>14</td><td>end</td></tr><tr><td>15</td><td></td></tr><tr><td>16</td><td>totalMomentum ← getTotalMomentum(M)</td></tr><tr><td>17</td><td>totalPruned ← getTotalPrunedWeights(W, p)</td></tr><tr><td>18</td><td>fori←O to k do</td></tr><tr><td>19</td><td>mi ← getMomentumContribution(Mi,Maski,totalMomentum)</td></tr><tr><td>20</td><td>magnitudePruneWeight(Wi,Maski, Pi)</td></tr><tr><td>21</td><td>regrowWeights(Wi,Maski,mi · totalPruned)</td></tr><tr><td>22</td><td>Pi←decayPrunerate(pi)</td></tr><tr><td>23</td><td>applyMask(Wi,Maski)</td></tr><tr><td>24</td><td>end</td></tr><tr><td colspan="2">25 end</td></tr></table>
51
+
52
+ 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 }$
53
+ 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.
54
+
55
+ 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 } )$ .
56
+
57
+ 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.
58
+
59
+ # 4 EXPERIMENTAL SETUP
60
+
61
+ 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.
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ ImageNet experiments were run on $4 \mathbf { x }$ RTX 2080 Ti and all other experiments on individual GPUs.
70
+
71
+ 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
72
+
73
+ # 5 RESULTS
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ ![](images/9e005205b0e6994a85124aca20160b59043af33e15e75edf770b4775ce008edb.jpg)
80
+ Figure 2: Comparisons against compression methods on MNIST with $9 5 \%$ confidence intervals.
81
+
82
+ 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.
83
+
84
+ ![](images/9dd88284b32d232481d4be4d6a060b725bbcbf77df1fa6d28d3b3fe0b839a50c.jpg)
85
+ 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.
86
+
87
+ # 5.1 SPEEDUPS AND WEIGHTS NEEDED FOR DENSE PERFORMANCE LEVELS
88
+
89
+ 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.
90
+
91
+ 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.
92
+
93
+ Table 1: CIFAR-10 test set error ( $\pm$ standard error) for dense baselines, Sparse Momentum and SNIP.
94
+
95
+ <table><tr><td rowspan="2"></td><td colspan="3">Sparse Error (%)</td><td rowspan="2">Weights (%)</td></tr><tr><td>Dense Error (%)</td><td>SNIP</td><td>Momentum</td></tr><tr><td>Model AlexNet-s</td><td>12.95±0.056</td><td>14.99</td><td>14.27±0.123</td><td>10</td></tr><tr><td>AlexNet-b</td><td>12.85±0.068</td><td>14.50</td><td>13.56±0.094</td><td>10</td></tr><tr><td>VGG16-C</td><td>6.49±0.038</td><td>7.27</td><td>7.00±0.054</td><td>5</td></tr><tr><td>VGG16-D</td><td>6.59±0.050</td><td>7.09</td><td>6.69±0.049*</td><td>5</td></tr><tr><td>VGG16-like</td><td>6.50±0.054</td><td>8.00</td><td>7.00±0.077</td><td>3</td></tr><tr><td>WRN-16-8</td><td>4.57±0.022</td><td>6.63</td><td>5.62±0.056</td><td>5</td></tr><tr><td>WRN-16-10</td><td>4.45±0.040</td><td>6.43</td><td>5.24±0.052</td><td>5</td></tr><tr><td>WRN-22-8</td><td>4.26±0.032</td><td>5.85</td><td>4.93±0.056</td><td>5</td></tr></table>
96
+
97
+ \* $9 5 \%$ confidence intervals overlap with dense model. Table 2: Results for ResNet-50 on ImageNet.
98
+
99
+ <table><tr><td colspan="3"></td><td colspan="3">Accuracy (%)</td></tr><tr><td colspan="2">Model</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td colspan="2">Dense ResNet-50 (He et al., 2016)</td><td>74.9</td><td>92.4</td><td>74.9</td><td>92.4</td></tr><tr><td colspan="2">Fully Sparse</td><td>10%</td><td>weights</td><td>20%</td><td>Weights</td></tr><tr><td rowspan="3">DeepR (Bellec et al., 2018) SET (Mocanu et al., 2018)</td><td>X</td><td>70.2</td><td>90.0</td><td>71.7</td><td>90.6</td></tr><tr><td>X</td><td>70.4</td><td>90.1</td><td>72.6</td><td>91.2</td></tr><tr><td>Dynamic Sparse (Mostafa and Wang,2019) X</td><td>71.6</td><td>90.5</td><td>73.3</td><td>92.4</td></tr><tr><td rowspan="2">Sparse momentum</td><td></td><td>72.3</td><td>91.0</td><td>74.2</td><td>91.9</td></tr><tr><td>×</td><td>72.3</td><td>91.0</td><td>73.8</td><td>91.8</td></tr></table>
100
+
101
+ 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.
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ Table 3: Dense performance equivalents and speedups for sparse networks on CIFAR-10.
108
+
109
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Weights (%)</td><td rowspan="2">Error(%)</td><td colspan="2"> Speedups</td></tr><tr><td>Dense Convolution (Empty Channels)</td><td>Sparse Convolution (FLOPS Reduction)</td></tr><tr><td>AlexNet-s</td><td>50</td><td>13.15±0.065</td><td>1.31x</td><td>3.01x</td></tr><tr><td>AlexNet-b</td><td>35</td><td>13.00±0.065</td><td>1.21x</td><td>2.74x</td></tr><tr><td>VGG16-C</td><td>10</td><td>6.64±0.040</td><td>1.32x</td><td>3.85x</td></tr><tr><td>VGG16-D</td><td>5</td><td>6.49±0.045</td><td>1.36x</td><td>3.51x</td></tr><tr><td>VGG16-like</td><td>5</td><td>6.46±0.036</td><td>1.32x</td><td>3.48x</td></tr><tr><td>WRN 16-8</td><td>30</td><td>4.72±0.051</td><td>1.07x</td><td>4.59x</td></tr><tr><td>WRN 16-10</td><td>25</td><td>4.56±0.037</td><td>1.07x</td><td>4.41x</td></tr><tr><td>WRN 22-8</td><td>20</td><td>4.40±0.037</td><td>1.21x</td><td>5.61x</td></tr></table>
110
+
111
+ # 6 ANALYSIS
112
+
113
+ # 6.1 ABLATION ANALYSIS
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ 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.
120
+
121
+ 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.
122
+
123
+ <table><tr><td rowspan="2">Redistribution</td><td rowspan="2">Growth</td><td colspan="4">Test error in %</td></tr><tr><td>LeNet 300-100</td><td>LeNet-5 Caffe</td><td>VGG16-D</td><td>ResNet-50</td></tr><tr><td>momentum</td><td>momentum</td><td>1.53±0.020</td><td>0.69±0.021</td><td>6.69±0.049</td><td>27.07</td></tr><tr><td>momentum</td><td>random</td><td>+0.07±0.022</td><td>-0.05±0.011</td><td>-0.19±0.040</td><td>+7.29</td></tr><tr><td>None</td><td> momentum</td><td>+0.01±0.018</td><td>+0.32±0.071</td><td>+1.54±0.101</td><td>+3.42</td></tr><tr><td>None</td><td>random</td><td>+0.11±0.020</td><td>+0.13±0.013</td><td>+1.49±0.147</td><td>+9.71</td></tr></table>
124
+
125
+ # 7 CONCLUSION AND FUTURE WORK
126
+
127
+ 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.
128
+
129
+ # REFERENCES
130
+
131
+ Bellec, G., Kappel, D., Maass, W., and Legenstein, R. A. (2018). Deep rewiring: Training very sparse deep networks. CoRR, abs/1711.05136.
132
+
133
+ 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.
134
+
135
+ Chauvin, Y. (1988). A back-propagation algorithm with optimal use of hidden units. In NIPS.
136
+
137
+ Child, R., Gray, S., Radford, A., and Sutskever, I. (2019). Generating long sequences with sparse transformers. CoRR, abs/1904.10509.
138
+
139
+ 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.
140
+
141
+ Dai, X., Yin, H., and Jha, N. K. (2018). Grow and prune compact, fast, and accurate lstms. CoRR, abs/1805.11797.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ Dong, X., Chen, S., and Pan, S. J. (2017). Learning to prune deep neural networks via layer-wise optimal brain surgeon. In NIPS.
148
+
149
+ Frankle, J. and Carbin, M. (2019). The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR 2019.
150
+
151
+ Frankle, J., Dziugaite, G. K., Roy, D. M., and Carbin, M. (2019). The lottery ticket hypothesis at scale. CoRR, abs/1903.01611.
152
+
153
+ Gale, T., Elsen, E., and Hooker, S. (2019). The state of sparsity in deep neural networks. CoRR, abs/1902.09574.
154
+
155
+ Gray, S., Radford, A., and Kingma, D. P. (2017). Gpu kernels for block-sparse weights.
156
+
157
+ Guo, Y., Yao, A., and Chen, Y. (2016). Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, pages 1379–1387.
158
+
159
+ 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.
160
+
161
+ Hassibi, B. and Stork, D. G. (1992). Second order derivatives for network pruning: Optimal brain surgeon. In NIPS.
162
+
163
+ 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.
164
+
165
+ 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.
166
+
167
+ Ishikawa, M. (1996). Structural learning with forgetting. Neural Networks, 9:509–521.
168
+
169
+ Karnin, E. D. (1990). A simple procedure for pruning back-propagation trained neural networks. IEEE transactions on neural networks, 1 2:239–42.
170
+
171
+ Krizhevsky, A. and Hinton, G. (2009). Learning multiple layers of features from tiny images. Technical report, Citeseer.
172
+
173
+ LeCun, Y. (1998). Gradient-based learning applied to document recognition.
174
+ LeCun, Y., Denker, J. S., and Solla, S. A. (1989). Optimal brain damage. In NIPS.
175
+ Lee, N., Ajanthan, T., and Torr, P. H. S. (2019). Snip: Single-shot network pruning based on connection sensitivity. In ICLR 2019.
176
+ Louizos, C., Ullrich, K., and Welling, M. (2017). Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pages 3288–3298.
177
+ Louizos, C., Welling, M., and Kingma, D. P. (2018). Learning sparse neural networks through $l _ { 0 }$ regularization. CoRR, abs/1712.01312.
178
+ 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.
179
+ Molchanov, D., Ashukha, A., and Vetrov, D. P. (2017). Variational dropout sparsifies deep neural networks. In International Conference on MachineLearning (ICML).
180
+ 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).
181
+ Mozer, M. C. and Smolensky, P. (1988). Skeletonization: A technique for trimming the fat from a network via relevance assessment. In NIPS.
182
+ Narang, S., Diamos, G. F., Sengupta, S., and Elsen, E. (2017). Exploring sparsity in recurrent neural networks. CoRR, abs/1704.05119.
183
+ 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.
184
+ 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.
185
+ Simonyan, K., Vedaldi, A., and Zisserman, A. (2013). Deep inside convolutional networks: Visualising image classification models and saliency maps. CoRR, abs/1312.6034.
186
+ Springenberg, J. T., Dosovitskiy, A., Brox, T., and Riedmiller, M. A. (2014). Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806.
187
+ Ullrich, K., Meeds, E., and Welling, M. (2017). Soft weight-sharing for neural network compression. CoRR, abs/1702.04008.
188
+ 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.
189
+ Zeiler, M. D. and Fergus, R. (2014). Visualizing and understanding convolutional networks. In ECCV.
190
+ Zhou, H., Lan, J., Liu, R., and Yosinski, J. (2019). Deconstructing lottery tickets: Zeros, signs, and the supermask. arXiv preprint arXiv:1905.01067.
191
+ Zhu, M. and Gupta, S. (2018). To prune, or not to prune: Exploring the efficacy of pruning for model compression. CoRR, abs/1710.01878.
192
+
193
+ # A APPENDIX
194
+
195
+ # A.1 SENSITIVITY ANALYSIS
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ ![](images/7117fc64f9af6e4603deca5ce68e941dd833601ab85ffdf8166fe5180fae3c84.jpg)
202
+ Figure 4: Parameter sensitivity analysis for prune rate and momentum with $9 5 \%$ confidence intervals.
203
+
204
+ B ADDITIONAL ANALYSIS
205
+
206
+ # B.1 DENSE VS SPARSE FEATURES
207
+
208
+ 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.
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ Overall, we conclude that sparse networks might be able to rival dense networks by learning more general features that have lower class specialization.
219
+
220
+ # C FURTHER RESULTS
221
+
222
+ # C.1 TUNED RESNET-50 ON IMAGENET
223
+
224
+ 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.
225
+
226
+ Table 5: Fully sparse ImageNet results.
227
+
228
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Accuracy (%)</td></tr><tr><td>Weights (%) Top-1</td><td>Top-5</td></tr><tr><td>Tuned ResNet-50</td><td>100</td><td>77.0 93.5</td></tr><tr><td rowspan="3">Sparse momentum</td><td>10</td><td>72.9 91.5</td></tr><tr><td>20</td><td>74.9 92.5</td></tr><tr><td>30</td><td>75.9 92.9</td></tr></table>
229
+
230
+ # D DETAILED SPARSE MOMENTUM ALGORITHM
231
+
232
+ For a detailed NumPy-style algorithmic description of sparse momentum see Algorithm 2.
233
+
234
+ ![](images/3f901c2978fb2659c764fa4bb466027b202c3cf82103c11c60169e22f18339dd.jpg)
235
+ 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.
236
+
237
+ 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()
md/train/BygdyxHFDS/BygdyxHFDS.md ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # META-LEARNING CURIOSITY ALGORITHMS
2
+
3
+ Ferran Alet∗, Martin F. Schneider∗, Tomas Lozano-P ´ erez & Leslie Pack Kaelbling ´
4
+
5
+ Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02139, USA {alet,martinfs,tlp,lpk}@mit.edu
6
+
7
+ # ABSTRACT
8
+
9
+ 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.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ 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.
14
+
15
+ We take inspiration from the curious behavior observed in young humans and other animals
16
+
17
+ ![](images/cef77ccc92b7d5d7ce1872f70326e7f1af5e39bc3832f0fe30c74bab4580472b.jpg)
18
+ 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.
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ This paper makes three novel contributions.
25
+
26
+ 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.
27
+
28
+ 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.
29
+
30
+ 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.
31
+
32
+ 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.
33
+
34
+ # 2 PROBLEM FORMULATION
35
+
36
+ # 2.1 META-LEARNING PROBLEM
37
+
38
+ 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 }$ ;
39
+
40
+ 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.
41
+
42
+ 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.
43
+
44
+ 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$
45
+ 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:
46
+
47
+ $$
48
+ \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] \ .
49
+ $$
50
+
51
+ # 2.2 PROGRAMS FOR CURIOSITY
52
+
53
+ 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 }$ .
54
+
55
+ 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$ .
56
+
57
+ 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:
58
+
59
+ • 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.
60
+ • Functional modules (shown in white), which compute output values given the inputs from their parent modules.
61
+
62
+ ![](images/0a0c4e6a4bd6852b56d0df731e28f96775adc6b10506ef1c8a6dbe02b4eb42aa.jpg)
63
+ 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.
64
+
65
+ • 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.
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ 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).
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ 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.
82
+
83
+ # 3 IMPROVING THE EFFICIENCY OF OUR SEARCH
84
+
85
+ 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).
86
+
87
+ 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.
88
+
89
+ # 3.1 PRUNING INVALID ALGORITHMS WITHOUT RUNNING THEM
90
+
91
+ Many programs are obviously bad curiosity programs. We have developed two heuristics to immediately prune these programs without an expensive evaluation.
92
+
93
+ • 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.
94
+
95
+ # 3.2 PRUNING ALGORITHMS IN CHEAP ENVIRONMENTS
96
+
97
+ 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).
98
+
99
+ 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.
100
+
101
+ # 3.3 PREDICTING ALGORITHM PERFORMANCE
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ # 4 EXPERIMENTS
108
+
109
+ 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$ .
110
+
111
+ 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.
112
+
113
+ # 4.1 FIRST SEARCH PHASE IN SIMPLE ENVIRONMENT
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ 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.
120
+
121
+ 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.
122
+
123
+ ![](images/b553da7ff7105014e117ad7a78c9f8a55c2196b065b5491fecdfc7d901275e12.jpg)
124
+ Figure 3: Fast Action-Space Transition(FAST): top-performing intrinsic curiosity algorithm discovered in our phase 1 search.
125
+
126
+ 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.
127
+
128
+ 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.
129
+
130
+ # 4.2 TRANSFERRING TO NEW ENVIRONMENTS
131
+
132
+ 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.
133
+
134
+ ![](images/552033e508c214ab3ef95cd0920da9ca6592eef4b36621777c13c1f263d582fc.jpg)
135
+ 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).
136
+
137
+ 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.
138
+
139
+ 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.
140
+
141
+ 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
142
+
143
+ <table><tr><td>Class</td><td>Ant</td><td>Hopper</td></tr><tr><td>Baseline algorithms</td><td>[-95.3, -39.9]</td><td>[318.5, 525.0]</td></tr><tr><td>Meta-learned algorithms</td><td>[+67.5, +80.0]</td><td>[589.2, 650.6]</td></tr><tr><td>Published algorithms</td><td>[+67.4, +98.8]</td><td>[627.7, 692.6]</td></tr></table>
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ # 5 RELATED WORK
150
+
151
+ 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.
152
+
153
+ 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.
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ 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.
160
+
161
+ # 6 CONCLUSIONS
162
+
163
+ 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.
164
+
165
+ # ACKNOWLEDGMENTS
166
+
167
+ 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.
168
+
169
+ 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.
170
+
171
+ # REFERENCES
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ Samy Bengio, Yoshua Bengio, and Jocelyn Cloutier. On the search for new learning rules for anns. Neural Processing Letters, 2(4):26–30, 1995.
182
+
183
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
184
+
185
+ Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
186
+
187
+ Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. Minimalistic gridworld environment for openai gym. https://github.com/maximecb/gym-minigrid, 2018.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ Jeff Clune. Ai-gas: Ai-generating algorithms, an alternate paradigm for producing general artificial intelligence. arXiv preprint arXiv:1905.10985, 2019.
194
+
195
+ 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.
196
+
197
+ Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. arXiv preprint arXiv:1808.05377, 2018.
198
+
199
+ 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.
200
+
201
+ Aleksandra Faust, Anthony Francis, and Dar Mehta. Evolving rewards to automate reinforcement learning. arXiv preprint arXiv:1905.07628, 2019.
202
+
203
+ 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.
204
+
205
+ 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.
206
+
207
+ 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.
208
+
209
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
210
+
211
+ Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ Adam Gaier and David Ha. Weight agnostic neural networks. arXiv preprint arXiv:1906.04358, 2019.
222
+
223
+ Santiago Gonzalez and Risto Miikkulainen. Improved training speed, accuracy, and data utilization through loss function optimization. arXiv preprint arXiv:1905.11528, 2019.
224
+
225
+ Santiago Gonzalez and Risto Miikkulainen. Evolving loss functions with multivariate taylor polynomial parameterizations, 2020.
226
+
227
+ 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.
228
+
229
+ 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.
230
+
231
+ Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren (eds.). Automated Machine Learning: Methods, Systems, Challenges. Springer, 2018. In press, available at http://automl.org/book.
232
+
233
+ Kevin Jamieson and Ameet Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Artificial Intelligence and Statistics, pp. 240–248, 2016.
234
+
235
+ Zohar Karnin, Tomer Koren, and Oren Somekh. Almost optimal exploration in multi-armed bandits. In International Conference on Machine Learning, pp. 1238–1246, 2013.
236
+
237
+ 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.
238
+
239
+ 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.
240
+
241
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
242
+
243
+ Louis Kirsch, Sjoerd van Steenkiste, and Jurgen Schmidhuber. Improving generalization in meta ¨ reinforcement learning using learned objectives. arXiv preprint arXiv:1910.04098, 2019.
244
+
245
+ Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https:// github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
246
+ 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.
247
+ Joel Lehman and Kenneth O Stanley. Exploiting open-endedness to solve problems through the search for novelty. In ALIFE, pp. 329–336, 2008.
248
+ 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.
249
+ 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.
250
+ 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.
251
+ Pierre-Yves Oudeyer. Computational theories of curiosity-driven learning. arXiv preprint arXiv:1802.10546, 2018.
252
+ 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.
253
+ Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015.
254
+ Adam Paszke, Sam Gross, and Adam Lerer. Automatic differentiation in PyTorch. In International Conference on Learning Representations, 2017.
255
+ 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.
256
+ Deepak Pathak, Dhiraj Gandhi, and Abhinav Gupta. Self-supervised exploration via disagreement. arXiv preprint arXiv:1906.04161, 2019.
257
+ 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.
258
+ 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.
259
+ Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017.
260
+ Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
261
+ 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.
262
+ 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. ¨
263
+ 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.
264
+
265
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
266
+
267
+ 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.
268
+
269
+ Rupesh Kumar Srivastava, Bas R Steunebrink, and Jurgen Schmidhuber. First experiments with ¨ powerplay. Neural Networks, 41:130–136, 2013.
270
+
271
+ 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.
272
+
273
+ Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
274
+
275
+ 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.
276
+
277
+ 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.
278
+
279
+ Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 1998.
280
+
281
+ 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.
282
+
283
+ Leslie Valiant. Probably Approximately Correct: NatureOs Algorithms for Learning and Prospering ˜ in a Complex World. Basic Books (AZ), 2013.
284
+
285
+ 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.
286
+
287
+ 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.
288
+
289
+ 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.
290
+
291
+ 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.
292
+
293
+ Zhongwen Xu, Hado P van Hasselt, and David Silver. Meta-gradient reinforcement learning. In Advances in neural information processing systems, pp. 2396–2407, 2018.
294
+
295
+ 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.
296
+
297
+ 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.
298
+
299
+ 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.
300
+
301
+ Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
302
+
303
+ 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.
304
+
305
+ # A DETAILS OF OUR DOMAIN-SPECIFIC LANGUAGE FOR CURIOSITYALGORITHMS
306
+
307
+ We have the following types. Note that $\mathbb { S }$ and $\mathbb { A }$ get defined differently for every environment.
308
+
309
+ • $\mathbb { R }$ : real numbers such as $r _ { t }$ or the dot-product between two vectors.
310
+ • $\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.
311
+ • 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.
312
+ • 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.
313
+ • 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.
314
+ • 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.
315
+
316
+ A.1 CURIOSITY OPERATIONS
317
+
318
+ <table><tr><td rowspan=1 colspan=1>Operation</td><td rowspan=1 colspan=3>Input type(s)</td><td rowspan=1 colspan=2>State</td><td rowspan=1 colspan=2>Output type</td></tr><tr><td rowspan=1 colspan=1>Add</td><td rowspan=1 colspan=3>R,R</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>RunningNorm</td><td rowspan=1 colspan=3>R</td><td rowspan=1 colspan=2>R</td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>VariableAsBuffer</td><td rowspan=1 colspan=3>X</td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>List[X]</td></tr><tr><td rowspan=1 colspan=1>NearestNeighborRegressor</td><td rowspan=1 colspan=3>F,F</td><td rowspan=1 colspan=1>List[F]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>F</td></tr><tr><td rowspan=1 colspan=1>SubtractOneTenth</td><td rowspan=1 colspan=3>R</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>NormalDistribution</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>Subtract</td><td rowspan=1 colspan=3>R,R</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>Sqrt(Abs(x))</td><td rowspan=1 colspan=3>R</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R+</td></tr><tr><td rowspan=1 colspan=1>NN F,F → F</td><td rowspan=1 colspan=3>F,F</td><td rowspan=1 colspan=2>OF,F→F</td><td rowspan=1 colspan=2>F</td></tr><tr><td rowspan=1 colspan=1>NNF,F→A</td><td rowspan=1 colspan=3>F,F</td><td rowspan=1 colspan=2>OF,F→A</td><td rowspan=1 colspan=2>A</td></tr><tr><td rowspan=1 colspan=1>NNF→A</td><td rowspan=1 colspan=3>F</td><td rowspan=1 colspan=2>OF→A</td><td rowspan=1 colspan=2>A</td></tr><tr><td rowspan=1 colspan=1>NN A→F</td><td rowspan=1 colspan=3>A</td><td rowspan=1 colspan=2>OA→F</td><td rowspan=1 colspan=2>F</td></tr><tr><td rowspan=1 colspan=1>(C)NN</td><td rowspan=1 colspan=3>S</td><td rowspan=1 colspan=2>Os→F</td><td rowspan=1 colspan=2>F</td></tr><tr><td rowspan=1 colspan=1>(C)NN, Detach</td><td rowspan=1 colspan=3>S</td><td rowspan=1 colspan=2>Os→F</td><td rowspan=1 colspan=2>F</td></tr><tr><td rowspan=1 colspan=1>(C)NNEnsemble</td><td rowspan=1 colspan=3>S</td><td rowspan=1 colspan=2>5xOs-→F</td><td rowspan=1 colspan=1>List[F]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>NN Ensemble F→F</td><td rowspan=1 colspan=3>F</td><td rowspan=1 colspan=2>5xOF→F</td><td rowspan=1 colspan=1>List[F]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>NN Ensemble F,F → F</td><td rowspan=1 colspan=3>F,F</td><td rowspan=1 colspan=2>5xOF,F→F</td><td rowspan=1 colspan=1>List[F]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>NN Ensemble F,A →F</td><td rowspan=1 colspan=3>F,A</td><td rowspan=1 colspan=2>5xOA,F→F</td><td rowspan=1 colspan=1>List[F]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>MinimizeValue</td><td rowspan=1 colspan=3>R</td><td rowspan=1 colspan=2>Adam</td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>L2Norm</td><td rowspan=1 colspan=3>X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R+</td></tr><tr><td rowspan=1 colspan=1>L2Distance</td><td rowspan=1 colspan=3>X, X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>ActionSpaceLoss</td><td rowspan=1 colspan=3>X,A</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R+</td></tr><tr><td rowspan=1 colspan=1>DotProduct</td><td rowspan=1 colspan=3>X, X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>Add</td><td rowspan=1 colspan=3>X, X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>X</td></tr><tr><td rowspan=1 colspan=1>Detach</td><td rowspan=1 colspan=3>X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>X</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=2>List[R]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R</td></tr><tr><td rowspan=1 colspan=1>Variance</td><td rowspan=1 colspan=2>List[X]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>R+</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>X</td></tr><tr><td rowspan=1 colspan=1>Mapped L2 Norm</td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Average Distance</td><td rowspan=1 colspan=1>List</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>,X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>R</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Minus</td><td rowspan=1 colspan=1>List</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>,X</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1></td></tr></table>
319
+
320
+ 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.
321
+
322
+ A.2 REWARD COMBINER OPERATIONS
323
+
324
+ <table><tr><td rowspan=1 colspan=1>Operation</td><td rowspan=1 colspan=2>Input type(s)</td><td rowspan=1 colspan=1>State</td><td rowspan=1 colspan=1>Output type</td></tr><tr><td rowspan=1 colspan=1>Constant {0.01,0.1,0.5,1]</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>NormalDistribution</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Add</td><td rowspan=1 colspan=2>R,R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=2>R,R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Min</td><td rowspan=1 colspan=2>R,R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>WeightedNormalizedSum</td><td rowspan=1 colspan=2>R, R, R, R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>RunningNorm</td><td rowspan=1 colspan=2>R</td><td rowspan=1 colspan=1>R</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>VariableAsBuffer</td><td rowspan=1 colspan=2>R</td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1>List[R]</td></tr><tr><td rowspan=1 colspan=1>Subtract</td><td rowspan=1 colspan=2>R,R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Multiply</td><td rowspan=1 colspan=2>R,R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Sqrt(Abs(x))</td><td rowspan=1 colspan=2>R</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R+</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr></table>
325
+
326
+ 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.
327
+
328
+ # A.3 TWO OTHER PUBLISHED ALGORITHMS COVERED BY OUR DSL
329
+
330
+ ![](images/b4cc34407c965592a423660e66969c6e87cad82e11880ebcfb4d6d75a22388fc.jpg)
331
+ 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.
332
+
333
+ ![](images/f85208832013cc57f31c9b9fa0280d7d355f5ed53f429fdfa9865b1864521ed9.jpg)
334
+ Figure 6: Curiosity by ensemble predictive variance Pathak et al. (2019). In pink, paths and networks where gradients flow back from the minimizer.
335
+
336
+ # B RELATED WORK ON META-RL AND GENERALIZATION
337
+
338
+ 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.
339
+
340
+ # C PREDICTING ALGORITHM PERFORMANCE
341
+
342
+ ![](images/9fbd5530cd73dffdf09f1a91c62ababc4d138fed0b39aab5576c1922197146bc.jpg)
343
+ 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.
344
+
345
+ ![](images/153b3a788ffb7f48d93db180f61630a8be94107849ad3322edd2a6a72d37e025.jpg)
346
+ 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.
347
+
348
+ ![](images/d24148dd967ff4158d9e4bab9070cfef40799a69bf62f4671f0e8561668ef5d6.jpg)
349
+ 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.
350
+
351
+ ![](images/2cbb2b0db2b07eb57741a7d3006980c4c6a3c7a2faa959745bb458fb9c064012.jpg)
352
+ 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.
353
+
354
+ 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:
355
+
356
+ $$
357
+ 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.
358
+ $$
359
+
360
+ $$
361
+ \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}
362
+ $$
363
+
364
+ 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.
365
+
366
+ ![](images/4c51720083f85eb941721494621924294fc86ad54d62196f5ac81f66b3351227.jpg)
367
+ 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.
md/train/ByqFhGZCW/ByqFhGZCW.md ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MACHINE VS MACHINE: MINIMAX-OPTIMAL DEFENSE AGAINST ADVERSARIAL EXAMPLES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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). \`
12
+
13
+ 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.)
14
+
15
+ 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.
16
+
17
+ • 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.
18
+ We demonstrate the difficulty of defending against multiple attack types and present the minimax defense as the best worst-case defense methods.
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ # 3 CAT-AND-MOUSE GAME
34
+
35
+ 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.
36
+
37
+ # 3.1 A NAIVE APPROACH
38
+
39
+ 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:
40
+
41
+ $$
42
+ z ( x ) = x + \eta \mathrm { s i g n } ( \nabla _ { x } l ( g ( x ) , y ) ) .
43
+ $$
44
+
45
+ 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
46
+
47
+ $$
48
+ \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}
49
+ $$
50
+
51
+ 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}$
52
+
53
+ 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.)
54
+
55
+ 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.
56
+
57
+ <table><tr><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="4">FGSM</td><td colspan="4">IFGSM</td></tr><tr><td>n=0.3</td><td>m=0.4</td><td>m=0.5</td><td>n=0.6</td><td>m=0.3</td><td>m=0.4</td><td>n=0.5</td><td>n=0.6</td></tr><tr><td>No defense</td><td>0.006</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr></table>
58
+
59
+ 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$ .
60
+
61
+ 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.
62
+
63
+ 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.
64
+
65
+ <table><tr><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="4">FGSM</td><td colspan="4">IFGSM</td></tr><tr><td>n=0.3</td><td>n=0.4</td><td>m=0.5</td><td>n=0.6</td><td>n=0.3</td><td>n=0.4</td><td>m=0.5</td><td>n=0.6</td></tr><tr><td>Adv train</td><td>n/a</td><td>0.004</td><td>0.003</td><td>0.003</td><td>0.005</td><td>0.003</td><td>0.003</td><td>0.004</td><td>0.010</td></tr></table>
66
+
67
+ 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.
68
+
69
+ ![](images/da60f7db9bd6b022adc7b3bbf142be95b5b59cdb173c6d20c6bf19032f4ee2e7.jpg)
70
+ 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.
71
+
72
+ # 3.2 GRADIENT-BASED ATTACKS AND SENSITIVITY PENALTY
73
+
74
+ 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
75
+
76
+ $$
77
+ f ( u , Z ) \triangleq \frac { 1 } { N } \sum _ { i = 1 } ^ { N } l ( g ( z ( x _ { i } ) ; u ) , y _ { i } ) ,
78
+ $$
79
+
80
+ where $z ( x )$ denote an FGSM-like attack based on the loss gradient
81
+
82
+ $$
83
+ \begin{array} { r } { z ( { \boldsymbol x } ) \gets { \boldsymbol x } + \eta \nabla _ { z } l ( g ( z ( { \boldsymbol x } ) ; { \boldsymbol u } ) , y ) , } \end{array}
84
+ $$
85
+
86
+ 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
87
+
88
+ $$
89
+ u u - \lambda \frac { d f ( u , Z ) } { d u } ,
90
+ $$
91
+
92
+ then from the chain rule, the total derivative $\textstyle { \frac { d f } { d u } }$ is
93
+
94
+ $$
95
+ { \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 } } }
96
+ $$
97
+
98
+ from (3) and (4).
99
+
100
+ Interestingly, this total derivative (6) at the current state coincides with the gradient $\nabla _ { u }$ of the following cost
101
+
102
+ $$
103
+ 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 }
104
+ $$
105
+
106
+ 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.
107
+
108
+ ![](images/7d60a9f66246467edbdc5b42d1f2c5b63e1328b9fe50e235eff32588b2fd4e1a.jpg)
109
+ Figure 2: Convergence of test error rates for sensitivity-penalized optimization (7) with MNIST.
110
+
111
+ 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.
112
+
113
+ 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.
114
+
115
+ 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.
116
+
117
+ <table><tr><td rowspan="2"></td><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="3">FGSM</td><td rowspan="2">FGSM-curr</td></tr><tr><td>FGSM1</td><td>FGSM2 :</td><td>FGSM80</td></tr><tr><td rowspan="5">n=0.3</td><td>No defense Adv FGSM1</td><td>0.026 0.012</td><td>1.000 0.004</td><td>0.881 0.995</td><td>:</td><td>0.355 1.000</td></tr><tr><td></td><td></td><td>0.999</td><td>:</td><td>0.499</td><td>0.995</td></tr><tr><td>Adv FGSM2</td><td>0.012</td><td></td><td>0.002 :</td><td>0.505</td><td>0.995</td></tr><tr><td>AdvFGSM80</td><td>0.009</td><td>0.335</td><td>0.273 :</td><td>0.009</td><td>0.442</td></tr><tr><td>LWAFGSM Sens FGSM</td><td>0.008</td><td>0.121</td><td>0.188 :</td><td>0.210 0.194</td><td>0.048 0.048</td></tr><tr><td rowspan="6">m=0.4</td><td>No defense</td><td>0.009 0.026</td><td>0.104 1.000</td><td>0.176 0.944</td><td>: :</td><td>0.528 1.000</td></tr><tr><td>AdvFGSM1</td><td>0.013</td><td>0.003</td><td>0.984</td><td>0.589 :</td><td>0.984</td></tr><tr><td>AdvFGSM2</td><td>0.017</td><td>0.999</td><td>0.005 :</td><td>0.549</td><td>0.999</td></tr><tr><td>AdvFGSM80</td><td>0.009</td><td>0.509</td><td>0.525</td><td>: 0.024</td><td>0.131</td></tr><tr><td>LWAFGSM</td><td>0.009</td><td>0.204</td><td>0.284</td><td>: 0.336</td><td>0.043</td></tr><tr><td>Sens FGSM</td><td>0.009</td><td>0.128</td><td>0.234</td><td>· 0.296</td><td>0.038</td></tr><tr><td rowspan="6">m=0.5</td><td>No defense</td><td>0.026</td><td>1.000</td><td>0.931</td><td>:</td><td>0.662</td><td>1.000</td></tr><tr><td>AdvFGSM1</td><td>0.010</td><td>0.002</td><td>0.970</td><td>:</td><td>0.724</td><td>0.970</td></tr><tr><td>Adv FGSM2</td><td>0.010</td><td>0.866</td><td>0.006</td><td>:</td><td>0.604</td><td>0.871</td></tr><tr><td>AdvFGSM80</td><td>0.008</td><td>0.653</td><td>0.559</td><td>:</td><td>0.023</td><td>0.089</td></tr><tr><td>LWAFGSM</td><td>0.009</td><td>0.248</td><td>0.260</td><td>:</td><td>0.432</td><td>0.035</td></tr><tr><td>Sens FGSM</td><td>0.009</td><td>0.266</td><td>0.285</td><td>:</td><td>0.365</td><td>0.039</td></tr><tr><td rowspan="6">n=0.6</td><td>No defense</td><td>0.026</td><td>1.000</td><td>0.963</td><td>:</td><td>0.803</td><td>1.000</td></tr><tr><td>AdvFGSM1</td><td>0.012</td><td>0.003</td><td>0.889</td><td>:</td><td>0.790</td><td>0.889</td></tr><tr><td>Adv FGSM2</td><td>0.008</td><td>0.649</td><td>0.007</td><td>:</td><td>0.687</td><td>0.767</td></tr><tr><td>AdvFGSM80</td><td>0.009</td><td>0.439</td><td>0.426</td><td>:</td><td>0.020</td><td>0.021</td></tr><tr><td>LWAFGSM</td><td>0.011</td><td>0.317</td><td>0.315</td><td>:</td><td>0.488</td><td>0.034</td></tr><tr><td>Sens FGSM</td><td>0.010</td><td>0.264</td><td>0.244</td><td>:</td><td>0.465</td><td>0.033</td></tr></table>
118
+
119
+ # 4 GAME FORMULATION
120
+
121
+ 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.
122
+
123
+ # 4.1 LEARNING-BASED ATTACK
124
+
125
+ 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)
126
+
127
+ $$
128
+ \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 } ) ,
129
+ $$
130
+
131
+ 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$ .
132
+
133
+ 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
134
+
135
+ $$
136
+ v v + \sigma { \frac { \partial f ( u , v ) } { \partial v } }
137
+ $$
138
+
139
+ 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.
140
+
141
+ <table><tr><td rowspan="2">Defense\Attack</td><td>FGSM-curr</td><td>AttNet-curr</td><td>FGSM-curr</td><td>AttNet-curr</td></tr><tr><td colspan="2">n=0.3</td><td colspan="2">n=0.4</td></tr><tr><td>No defense</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>AdvFGSM1</td><td>0.996</td><td>1.000</td><td>0.984</td><td>1.000</td></tr><tr><td>AdvFGSM80</td><td>0.473</td><td>0.899</td><td>0.131</td><td>0.903</td></tr><tr><td>Sens FGSM</td><td>0.048</td><td>0.965</td><td>0.038</td><td>0.902</td></tr><tr><td rowspan="4">No defense Adv FGSM1 AdvFGSM80</td><td colspan="2">m=0.5</td><td colspan="2">m=0.6</td></tr><tr><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>0.985</td><td>1.000</td><td>0.966</td><td>1.000</td></tr><tr><td>0.089</td><td>0.897 1.000</td><td>0.021</td><td>0.897</td></tr><tr><td rowspan="2">Sens FGSM</td><td colspan="2">0.039</td><td colspan="2">0.033 0.903</td></tr></table>
142
+
143
+ 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.
144
+
145
+ # 4.2 MINIMAX GAME FOR LEARNING-BASED ATTACKS
146
+
147
+ 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 )$
148
+
149
+ $$
150
+ v ^ { * } ( u ) \triangleq \arg \operatorname* { m a x } _ { v } f ( u , v ) .
151
+ $$
152
+
153
+ Consequently, the defender should choose the classifier parameters $u$ such that the maximum risk is minimized
154
+
155
+ $$
156
+ 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 ) ) .
157
+ $$
158
+
159
+ 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.
160
+
161
+ 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
162
+
163
+ gradient descent
164
+
165
+ $$
166
+ u u - \lambda \frac { d f ( u , v ^ { * } ( u ) ) } { d u } ,
167
+ $$
168
+
169
+ where the total derivative $\textstyle { \frac { d f } { d u } }$ is
170
+
171
+ $$
172
+ \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 } .
173
+ $$
174
+
175
+ Since the exact maximizer $v ^ { * } ( u )$ is difficult to find, we only update $v$ incrementally by one (or more) steps of gradient-ascent update
176
+
177
+ $$
178
+ v v + \sigma \frac { \partial f ( u , v ) } { \partial v } .
179
+ $$
180
+
181
+ 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
182
+
183
+ $$
184
+ \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 } .
185
+ $$
186
+
187
+ 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
188
+
189
+ $$
190
+ f _ { \mathrm { s e n s } } ( u ) \triangleq f ( u , v ) + { \frac { \sigma } { 2 } } \left\| { \frac { \partial f ( u , v ) } { \partial v } } \right\| ^ { 2 } .
191
+ $$
192
+
193
+ 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.
194
+
195
+ # Algorithm 1 Minimax Optimization by Sensitivity Penalization
196
+
197
+ <table><tr><td>Input: risk f(u,v),#of iterations T,learning rates (oi),(入i),(Yi)</td></tr><tr><td>Output: (u*,u*(u*))</td></tr><tr><td>Initialize uo,Uo Begin</td></tr><tr><td>for i=1, ...,T do</td></tr><tr><td>Max step:Ui=Ui-1+Oi af(ui-1,Ui-1) du</td></tr><tr><td>a Yi-1 of(ui-1,Ui-1 Min step: Ui = Ui-1- Xi f(ui-1,Ui-1)+</td></tr><tr><td>du 2 du</td></tr><tr><td>end for Return (UT,UT).</td></tr></table>
198
+
199
+ Note that this algorithm is actually independent of the adversarial example problem, and can be used for other minimax problems as well.
200
+
201
+ # 4.3 MINIMAX VS MAXIMIN PROBLEMS
202
+
203
+ In analogy with the minimax problem, we can also consider the maximin solution defined by
204
+
205
+ $$
206
+ 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 ) .
207
+ $$
208
+
209
+ where
210
+
211
+ $$
212
+ u ^ { * } ( v ) \triangleq \arg \operatorname* { m i n } _ { u } f ( u , v )
213
+ $$
214
+
215
+ 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.
216
+
217
+ To summarize, minimax and maximin defenses and attacks have the following inherent properties.
218
+
219
+ Lemma 1. Let $u ^ { * } , v ^ { * } ( u ) , v ^ { * } , u ^ { * } ( v )$ be the solutions of $( I I ) , ( I O ) , ( I 7 ) , ( I 8 ) .$ .
220
+
221
+ 1. $f ( u , v ^ { * } ( u ) ) \geq f ( u , v )$ : For any given defense $u$ , the max attack $v ^ { * } ( u )$ is the most effective attack.
222
+ 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.
223
+ 3. $f ( u ^ { * } ( v ) , v ) \leq f ( u , v )$ : For any given attack $v$ , the min defense $u ^ { * } ( v )$ is the most effective defense.
224
+ 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.
225
+ 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.
226
+
227
+ 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.
228
+
229
+ # 4.4 EXPERIMENTS
230
+
231
+ 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)
232
+
233
+ $$
234
+ u u - \lambda \frac { \partial f } { \partial u } , \quad v v + \sigma \frac { \partial f } { \partial v } .
235
+ $$
236
+
237
+ 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.
238
+
239
+ ![](images/d6e579cfdb700ba5473f7cc533f56179bcabe9de8be7ad689d37ca03e59cf7fd.jpg)
240
+ Figure 3: Convergence of the test error rates for Minimax optimization (blue), Alternating ascent/descent (green), and Maximin optimization (red) for MNIST.
241
+
242
+ 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.
243
+
244
+ 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).
245
+
246
+ <table><tr><td rowspan="2">Defense\Attack</td><td>FGSM-curr</td><td>AttNet-curr</td><td>FGSM-curr</td><td>AttNet-curr</td></tr><tr><td colspan="2">m=0.3</td><td colspan="2">n=0.4</td></tr><tr><td>Minimax</td><td>0.218</td><td>0.020</td><td>0.238</td><td>0.552</td></tr><tr><td>Alt</td><td>0.244</td><td>0.104</td><td>0.503</td><td>0.873</td></tr><tr><td>Sens FGSM</td><td>0.048</td><td>0.965</td><td>0.038</td><td>0.902</td></tr><tr><td rowspan="3">Minimax Alt</td><td>m=0.5</td><td></td><td>m=0.6</td><td></td></tr><tr><td>0.342</td><td>1.000</td><td>0.299</td><td>1.000</td></tr><tr><td>0.289</td><td>0.902</td><td>0.157</td><td>0.899</td></tr><tr><td>Sens FGSM</td><td>0.039</td><td>1.000</td><td>0.033</td><td>0.903</td></tr></table>
247
+
248
+ Lastly, the adversarial examples generated by various attacks in the paper have diverse patterns and are shown in Fig. 4 of the appendix.
249
+
250
+ # 5 DISCUSSION
251
+
252
+ # 5.1 ROBUSTNESS AGAINST MULTIPLE ATTACK TYPES
253
+
254
+ 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.
255
+
256
+ 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
257
+
258
+ $$
259
+ \operatorname* { m i n } _ { u } \operatorname* { m a x } \{ f ( u , z _ { 1 } ( u ) ) , . . . , f ( u , z _ { m } ( u ) ) \} .
260
+ $$
261
+
262
+ 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
263
+
264
+ $$
265
+ \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 ) ) \} .
266
+ $$
267
+
268
+ Due to the huge computational demand to solve (21), we leave it as a future work.
269
+
270
+ # 5.2 ADVERSARIAL EXAMPLES AND PRIVACY ATTACKS
271
+
272
+ 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.
273
+
274
+ # 6 CONCLUSION
275
+
276
+ 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.
277
+
278
+ # REFERENCES
279
+
280
+ Shumeet Baluja and Ian Fischer. Adversarial transformation networks: Learning to generate adversarial examples. arXiv preprint arXiv:1703.09387, 2017.
281
+ 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.
282
+ 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.
283
+ 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.
284
+ Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Analysis of classifiers’ robustness to adversarial perturbations. arXiv preprint arXiv:1502.02590, 2015.
285
+ 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.
286
+ 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.
287
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014b.
288
+ Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
289
+ Jihun Hamm. Minimax filter: Learning to preserve privacy from inference attacks. arXiv preprint arXiv:1610.03577, 2016.
290
+ Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvari. Learning with a strong adversary. ´ arXiv preprint arXiv:1511.03034, 2015.
291
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016a.
292
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016b.
293
+ 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.
294
+ Jiajun Lu, Theerasit Issaranon, and David Forsyth. Safetynet: Detecting and rejecting adversarial examples robustly. arXiv preprint arXiv:1704.00103, 2017.
295
+ 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.
296
+ Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. arXiv preprint arXiv:1705.09064, 2017.
297
+ Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016.
298
+ Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. arXiv preprint arXiv:1702.04267, 2017.
299
+ Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. arXiv preprint arXiv:1610.08401, 2016.
300
+ Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, Pascal Frossard, and Stefano Soatto. Analysis of universal adversarial perturbations. arXiv preprint arXiv:1705.09554, 2017.
301
+ Linh Nguyen and Arunesh Sinha. A learning approach to secure learning. arXiv preprint arXiv:1709.04447, 2017.
302
+ 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.
303
+ Louis B Rall. Automatic differentiation: Techniques and applications. 1981.
304
+ 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.
305
+ Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble adversarial \` training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
306
+
307
+ # A RESULTS WITH MNIST
308
+
309
+ 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 . \}$
310
+
311
+ The attack network has three hidden fully-connected layers of 300 units, trained with the following hyperparameters:
312
+ {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 . \}$
313
+
314
+ 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.
315
+
316
+ ![](images/46763f54f338dd040d61c182c0c65ee517429ea079f203508ac7da6af10f2095.jpg)
317
+ 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.
318
+
319
+ # B RESULTS WITH CIFAR-10
320
+
321
+ 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:
322
+
323
+ $\{ 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 . \}$
324
+
325
+ The attack network has three hidden fully-connected layers of 300 units, trained with the following hyperparameters:
326
+ $\{ 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 . \}$
327
+
328
+ 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.
329
+
330
+ In the rest of the appendix, we repeat all the experiments with the MNIST dataset using the CIFAR10 dataset.
331
+
332
+ <table><tr><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="4">FGSM</td><td colspan="4">IFGSM</td></tr><tr><td>n=0.1</td><td>n=0.2</td><td>n=0.3</td><td>m=0.4</td><td>n=0.1</td><td>m=0.2</td><td>n=0.3</td><td>m=0.4</td></tr><tr><td>No defense</td><td>0.222</td><td>0.976</td><td>0.825</td><td>0.869</td><td>0.884</td><td>0.668</td><td>0.907</td><td>0.959</td><td>0.971</td></tr></table>
333
+
334
+ 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$ .
335
+
336
+ <table><tr><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="4">FGSM</td><td colspan="4">IFGSM</td></tr><tr><td>n=0.1</td><td>n=0.2</td><td>n=0.3</td><td>n=0.4</td><td>n=0.1</td><td>n=0.2</td><td>m=0.3</td><td>n=0.4</td></tr><tr><td>Adv train</td><td>n/a</td><td>0.196</td><td>0.642</td><td>0.668</td><td>0.702</td><td>0.373</td><td>0.658</td><td>0.741</td><td>0.750</td></tr></table>
337
+
338
+ 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.
339
+
340
+ ![](images/25c2a7b8f76e7f3af510741ee0bca0ba313bdf0750f34346abc872740838414e.jpg)
341
+ 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.
342
+
343
+ ![](images/ab800da7f6508864830e13eb093463215686949fbfe0fc6bc9669047e0667041.jpg)
344
+ Figure 6: Convergence of test error rates for sensitivity-penalized optimization with MNIST.
345
+
346
+ ![](images/b047abf440dc0ad31a90a50bcd45e3e6e00c2c669bbe9a856a56ac7d52ef84d7.jpg)
347
+ Figure 7: Convergence of the test error rates for Minimax optimization (blue), Alternating ascent/descent (green), and Maximin optimization (red) for CIFAR-10.
348
+
349
+ 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.
350
+
351
+ <table><tr><td rowspan="2"></td><td rowspan="2">Defense\Attack</td><td rowspan="2">No attack</td><td colspan="4">FGSM</td><td rowspan="2">FGSM-curr</td></tr><tr><td>FGSM-1</td><td>FGSM-2</td><td>:</td><td>FGSM-80</td></tr><tr><td rowspan="5">n=0.1</td><td>No defense AdvFGSM1</td><td>0.222 0.220</td><td>0.976 0.196</td><td>0.671 0.680</td><td>: :</td><td>0.595 0.616</td><td>0.976 0.245</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Adv FGSM2</td><td>0.258</td><td>0.640</td><td>0.484</td><td>:</td><td>0.612</td><td>0.708</td></tr><tr><td>AdvFGSM80</td><td>0.228</td><td>0.644</td><td>0.529</td><td>:</td><td>0.087</td><td>0.086</td></tr><tr><td>LWAFGSM Sens FGSM</td><td>0.223 0.223</td><td>0.283 0.342</td><td>0.692 0.701</td><td>:</td><td>0.652 0.663</td><td>0.125 0.106</td></tr><tr><td rowspan="6">n=0.2</td><td>No defense</td><td>0.222</td><td>0.825</td><td>0.692</td><td>: :</td><td>0.819</td><td>0.969</td></tr><tr><td>AdvFGSM1</td><td>0.216</td><td>0.642</td><td>0.630</td><td>:</td><td>0.609</td><td>0.264</td></tr><tr><td>Adv FGSM2</td><td>0.305</td><td>0.579</td><td>0.290</td><td>:</td><td>0.599</td><td>0.556</td></tr><tr><td>AdvFGSM80</td><td>0.218</td><td>0.445</td><td>0.502</td><td>·</td><td>0.078</td><td>0.078</td></tr><tr><td>LWAFGSM</td><td>0.209</td><td>0.689</td><td>0.666</td><td>··</td><td>0.615</td><td>0.105</td></tr><tr><td>Sens FGSM</td><td>0.209</td><td>0.713</td><td>0.672</td><td>:</td><td>0.637</td><td>0.073</td></tr><tr><td rowspan="6">n=0.3</td><td>No defense AdvFGSM1</td><td>0.222</td><td>0.869</td><td>0.891</td><td>:</td><td>0.877</td><td>0.955</td></tr><tr><td></td><td>0.214</td><td>0.668</td><td>0.628</td><td>:</td><td>0.642</td><td>0.424</td></tr><tr><td>Adv FGSM2</td><td>0.205</td><td>0.499</td><td>0.407</td><td>:</td><td>0.514</td><td>0.389</td></tr><tr><td>AdvFGSM80</td><td>0.223</td><td>0.471</td><td>0.324</td><td>:</td><td>0.081</td><td>0.084</td></tr><tr><td>LWAFGSM</td><td>0.215</td><td>0.686</td><td>0.634</td><td>:</td><td>0.640</td><td>0.215</td></tr><tr><td>Sens FGSM</td><td>0.213</td><td>0.715</td><td>0.628</td><td>·</td><td>0.652</td><td>0.089</td></tr><tr><td rowspan="6">n=0.4</td><td>No defense AdvFGSM1</td><td>0.222</td><td>0.884</td><td>0.899</td><td>:</td><td>0.892</td><td>0.941</td></tr><tr><td></td><td>0.208</td><td>0.702</td><td>0.687</td><td>:</td><td>0.697</td><td>0.536</td></tr><tr><td>Adv FGSM2</td><td>0.206</td><td>0.592</td><td>0.546</td><td>:</td><td>0.618</td><td>0.545</td></tr><tr><td>AdvFGSM80</td><td>0.225</td><td>0.497</td><td>0.385</td><td>:</td><td>0.121</td><td>0.124</td></tr><tr><td>LWAFGSM</td><td>0.210</td><td>0.693</td><td>0.639</td><td>:</td><td>0.626</td><td>0.173</td></tr><tr><td>Sens FGSM</td><td>0.214</td><td>0.714</td><td>0.635</td><td>·</td><td>0.640</td><td>0.109</td></tr></table>
352
+
353
+ 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.
354
+
355
+ <table><tr><td rowspan="2">Defense\Attack</td><td>FGSM-curr</td><td>AttNet-curr</td><td>FGSM-curr</td><td>AttNet-curr</td></tr><tr><td colspan="2">n=0.1</td><td colspan="2">=0.2</td></tr><tr><td>No defense</td><td>0.976</td><td>0.740</td><td>0.969</td><td>0.905</td></tr><tr><td>Adv FGSM1</td><td>0.245</td><td>0.999</td><td>0.264</td><td>1.000</td></tr><tr><td>Adv FGSM80</td><td>0.086</td><td>1.000</td><td>0.078</td><td>1.000</td></tr><tr><td>Sens FGSM</td><td>0.106</td><td>0.898</td><td>0.073</td><td>0.979</td></tr><tr><td rowspan="4">No defense Adv FGSM1 AdvFGSM80</td><td colspan="2">m=0.3</td><td colspan="2">m=0.4</td></tr><tr><td>0.955</td><td>0.888</td><td>0.941</td><td>0.999</td></tr><tr><td>0.424</td><td>1.000</td><td>0.536</td><td>1.000</td></tr><tr><td>0.084</td><td>1.000</td><td>0.124</td><td>0.900</td></tr><tr><td rowspan="2">Sens FGSM</td><td rowspan="2">0.089</td><td rowspan="2">1.000</td><td rowspan="2">0.109</td></tr><tr><td>1.000</td></tr></table>
356
+
357
+ <table><tr><td rowspan="2">Defense\Attack</td><td>FGSM-curr</td><td>AttNet-curr</td><td>FGSM-curr</td><td>AttNet-curr</td></tr><tr><td colspan="2">n=0.1</td><td colspan="2">m=0.2</td></tr><tr><td>Minimax</td><td>0.967</td><td>0.276</td><td>0.980</td><td>0.418</td></tr><tr><td>Alt</td><td>0.994</td><td>0.264</td><td>0.996</td><td>0.857</td></tr><tr><td>Sens FGSM</td><td>0.106</td><td>0.898</td><td>0.073</td><td>0.979</td></tr><tr><td rowspan="3">Minimax Alt</td><td>n=0.3</td><td></td><td>m=0.4</td><td></td></tr><tr><td>0.967</td><td>0.875</td><td>0.931</td><td>0.994</td></tr><tr><td>0.987</td><td>0.896</td><td>0.958</td><td>1.000</td></tr><tr><td>Sens FGSM</td><td>0.089</td><td>1.000</td><td>0.109</td><td>1.000</td></tr></table>
358
+
359
+ 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$ .
md/train/ByxCrerKvS/ByxCrerKvS.md ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SET FUNCTIONS FOR TIME SERIES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ Furthermore, our method is highly parallelizable and can be readily extended to an online monitoring setup with up to thousands of patients.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ ![](images/99a1ff8e5b7b0ed149a713759f89dce223919083906167cbd08a05c7333a4fb7.jpg)
32
+ 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.
33
+
34
+ # 3 PROPOSED METHOD
35
+
36
+ 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
37
+
38
+ # 3.1 NOTATION & REQUIREMENTS
39
+
40
+ 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
41
+
42
+ $$
43
+ \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}
44
+ $$
45
+
46
+ where for notational convenience we omitted the index $i$ .
47
+
48
+ 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 }$ .
49
+
50
+ 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.
51
+
52
+ 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.
53
+
54
+ 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$ .
55
+
56
+ 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.
57
+
58
+ 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.
59
+
60
+ # 3.2 OUR MODEL
61
+
62
+ 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
63
+
64
+ $$
65
+ f ( S ) = g \left( \frac { 1 } { | S | } \sum _ { s _ { j } \in S } h ( s _ { j } ) \right)
66
+ $$
67
+
68
+ 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$ .
69
+
70
+ 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).
71
+
72
+ 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.
73
+
74
+ 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
75
+
76
+ $$
77
+ \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}
78
+ $$
79
+
80
+ 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 } )$ .
81
+
82
+ 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
83
+
84
+ $$
85
+ \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] ,
86
+ $$
87
+
88
+ 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.
89
+
90
+ # 3.3 ATTENTION-BASED AGGREGATION
91
+
92
+ 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.
93
+
94
+ 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
95
+
96
+ $$
97
+ 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 } ) }
98
+ $$
99
+
100
+ 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.
101
+
102
+ 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).
103
+
104
+ # 4 EXPERIMENTS
105
+
106
+ 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.
107
+
108
+ # 4.1 DATASETS
109
+
110
+ In order to benchmark the proposed method we selected 4 datasets with irregularly-sampled and non-synchronized measurements.
111
+
112
+ 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.
113
+
114
+ 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.
115
+
116
+ 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.
117
+
118
+ # 4.2 COMPETITOR METHODS
119
+
120
+ 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
121
+
122
+ $$
123
+ \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.
124
+ $$
125
+
126
+ where $s _ { t }$ represents the time associated with time step $t$ .
127
+
128
+ 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.
129
+
130
+ 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.
131
+
132
+ 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.
133
+
134
+ 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.
135
+
136
+ ![](images/067d20b9dff90ce2160b9c55a84e97acb5c9306cbf172f64abc03a6a9df16919.jpg)
137
+ 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.
138
+
139
+ # 4.3 EXPERIMENTAL SETUP
140
+
141
+ 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.
142
+
143
+ # 4.4 RESULTS
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ <table><tr><td>DATASET</td><td>MODEL</td><td>MICRO AUC</td><td>MACRO AUC</td><td>WEIGHTED AUC</td><td>RUNTIME</td></tr><tr><td rowspan="6">H-MNIST</td><td>GRU-SIMPLE</td><td>99.09 ± 0.05</td><td>99.01 ± 0.05</td><td>99.03 ± 0.05</td><td>11.43 ± 0.47</td></tr><tr><td>PHASED-LSTM</td><td>98.63 ± 0.13</td><td>98.50 ± 0.15</td><td>98.52 ± 0.14</td><td>33.93 ±1.11</td></tr><tr><td>GRU-D</td><td>99.42 ± 0.01</td><td>99.37 ± 0.02</td><td>99.38 ±0.02</td><td>11.81 ± 0.44</td></tr><tr><td>IP-NETS</td><td>99.06 ± 0.05</td><td>98.96 ± 0.03</td><td>98.98 ± 0.03</td><td>127.76 ± 0.95</td></tr><tr><td>TRANSFORMER</td><td>99.59 ± 0.05</td><td>99.55 ± 0.05</td><td>99.56 ± 0.05</td><td>21.62 ± 0.90</td></tr><tr><td>SEFT*</td><td>99.76 ± 0.01</td><td>99.75 ± 0.01</td><td>99.75 ± 0.01</td><td>4.05 ± 0.35</td></tr><tr><td rowspan="7">M3-Phenotyping</td><td>GRU-SIMPLE</td><td>79.89 ± 0.14</td><td>73.91 ± 0.19</td><td>72.55 ± 0.16</td><td>112.58 ± 2.03</td></tr><tr><td>PHASED-LSTM</td><td>80.00±0.06</td><td>73.91 ± 0.09</td><td>72.65 ± 0.08</td><td>400.41 ± 14.14</td></tr><tr><td>GRU-D</td><td>82.16 ± 0.04</td><td>77.14 ± 0.03</td><td>76.08 ± 0.01</td><td>288.70± 16.66</td></tr><tr><td>IP-NETS</td><td>-OOM—</td><td>-OOM-</td><td>-OOM—</td><td>-0OM-</td></tr><tr><td>TRANSFORMER</td><td>—O0M-</td><td>-00M—</td><td>—00M-</td><td>—00M-</td></tr><tr><td>SEFT</td><td>81.22 ±0.12</td><td>75.95 ± 0.09</td><td>74.90 ± 0.11</td><td>56.27 ± 2.14</td></tr><tr><td>SEFT-ATTN</td><td>82.00 ± 0.06</td><td>76.95 ± 0.09</td><td>75.88 ± 0.09</td><td>52.32 ± 0.74</td></tr><tr><td></td><td></td><td>ACCURACY</td><td>PR AUC</td><td>AUC</td><td>RUNTIME</td></tr><tr><td rowspan="7">M3-Mortality</td><td>GRU-SIMPLE</td><td>88.24±0.38</td><td>36.36 ±1.31</td><td>79.36 ± 0.26</td><td>22.80 ±0.56</td></tr><tr><td>PHASED-LSTM</td><td>88.32 ±0.31</td><td>35.30 ±1.38</td><td>80.16 ±0.22</td><td>25.54 ± 0.26</td></tr><tr><td>GRU-D</td><td>89.56 ± 0.38</td><td>46.76 ± 0.65</td><td>83.73 ± 0.21</td><td>31.85 ± 0.86</td></tr><tr><td>IP-NETS</td><td>89.73 ± 0.16</td><td>45.88 ± 0.87</td><td>83.30 ± 0.56</td><td>101.12 ± 4.52</td></tr><tr><td>TRANSFORMER</td><td>89.14 ± 0.15</td><td>42.32 ± 0.41</td><td>82.60 ± 0.55</td><td>4.79 ± 0.02</td></tr><tr><td>SEFT</td><td>88.65 ± 0.49</td><td>36.18 ± 5.07</td><td>79.15 ± 3.00</td><td>3.72 ± 0.11</td></tr><tr><td>SEFT-ATTN</td><td>89.48 ± 0.16</td><td>45.25 ± 0.96</td><td>83.79 ± 0.59</td><td>16.64 ± 0.20</td></tr><tr><td rowspan="7">P-Mortality</td><td>GRU-SIMPLE</td><td>85.66 ± 0.14</td><td>39.43 ± 0.71</td><td>79.79 ±0.16</td><td>5.16 ± 0.06</td></tr><tr><td>PHASED-LSTM</td><td>85.57 ± 0.11</td><td>39.55 ± 0.62</td><td>78.71 ±0.76</td><td>18.59 ± 1.15</td></tr><tr><td>GRU-D</td><td>87.19 ± 0.30</td><td>54.95 ± 0.54</td><td>86.58 ± 0.32</td><td>14.08 ± 0.38</td></tr><tr><td>IP-NETS</td><td>87.23 ± 0.18</td><td>54.87 ± 0.41</td><td>86.42 ±0.18</td><td>7.21 ± 0.46</td></tr><tr><td>TRANSFORMER</td><td>86.47 ± 0.08</td><td>48.72 ± 0.61</td><td>83.49 ± 0.46</td><td>2.69 ± 0.43</td></tr><tr><td>SEFT</td><td>87.11 ± 0.32</td><td>52.07 ± 0.41</td><td>84.12 ±0.32</td><td>3.07 ± 0.03</td></tr><tr><td>SEFT-ATTN</td><td>87.62 ± 0.16</td><td>54.05 ± 0.27</td><td>85.50 ± 0.13</td><td>7.54 ± 0.08</td></tr></table>
152
+
153
+ \*: 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.
154
+
155
+ # 5 CONCLUSION
156
+
157
+ 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.
158
+
159
+ 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.
160
+
161
+ # REFERENCES
162
+
163
+ 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.
164
+
165
+ 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.
166
+
167
+ 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.
168
+
169
+ 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.
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ Alan G. Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83–90, 1971.
176
+
177
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
178
+
179
+ 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.
180
+
181
+ Rahul G. Krishnan, Uri Shalit, and David Sontag. Deep Kalman Filters. arXiv e-prints, art. arXiv:1511.05121, Nov 2015.
182
+
183
+ 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.
184
+
185
+ 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.
186
+
187
+ 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.
188
+
189
+ Larry S. Liebovitch and Tibor Toth. A fast algorithm to determine fractal dimensions by box counting. Physics Letters A, 141(8):386–390, 1989.
190
+
191
+ Thomas Josef Liniger. Multivariate Hawkes processes. PhD thesis, ETH Zurich, 2009.
192
+
193
+ 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.
194
+
195
+ Roderick JA Little and Donald B Rubin. Statistical analysis with missing data, volume 333. John Wiley & Sons, 2014.
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ 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.
204
+
205
+ 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.
206
+
207
+ Satya Narayan Shukla and Benjamin Marlin. Interpolation-prediction networks for irregularly sampled time series. In International Conference on Learning Representations, 2019.
208
+
209
+ 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.
210
+
211
+ 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.
212
+
213
+ Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
214
+
215
+ Edward Wagstaff, Fabian B. Fuchs, Martin Engelcke, Ingmar Posner, and Michael Osborne. On the Limitations of Representing Functions on Sets. 2019.
216
+
217
+ Christopher K. Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. MIT Press, 2(3):4, 2006.
218
+
219
+ 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.
220
+
221
+ Pranjul Yadav, Michael Steinbach, Vipin Kumar, and Gyorgy Simon. Mining electronic health records (EHRs): a survey. ACM Computing Surveys, 50(6):85, 2018.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ # A APPENDIX
228
+
229
+ Table A.1: M3-Mortality prevalence of labels for the binary classification task
230
+
231
+ <table><tr><td></td><td>Training Prevalence</td><td>Testing Prevalence</td></tr><tr><td>In-hospital deaths</td><td>0.135</td><td>0.116</td></tr></table>
232
+
233
+ Table A.2: P-Mortality prevalence of labels for the binary classification task
234
+
235
+ <table><tr><td></td><td></td><td>Training PrevalenceTesting Prevalence</td></tr><tr><td>In-hospital deaths S</td><td>0.140</td><td>0.146</td></tr></table>
236
+
237
+ # A.1 DATA FILTERING
238
+
239
+ 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.
240
+
241
+ # A.2 IMPLEMENTATIONAL DETAILS
242
+
243
+ 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.
244
+
245
+ # A.3 TRAINING, MODEL ARCHITECTURES AND HYPERPARAMETER SEARCH
246
+
247
+ 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).
248
+
249
+ 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).
250
+
251
+ 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).
252
+
253
+ 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.
254
+
255
+ Table A.3: M3-Phenotyping prevalence of labels for the multi label classification task
256
+
257
+ <table><tr><td>Phenotype</td><td>Training</td><td>Validation</td><td>Testing</td></tr><tr><td>Acute and unspecified renal failure</td><td>0.216</td><td>0.207</td><td>0.211</td></tr><tr><td>Acute cerebrovascular disease</td><td>0.0746</td><td>0.0753</td><td>0.0662</td></tr><tr><td>Acute myocardial infarction</td><td>0.103</td><td>0.103</td><td>0.108</td></tr><tr><td>Cardiac dysrhythmias</td><td>0.322</td><td>0.317</td><td>0.323</td></tr><tr><td>Chronic kidney disease</td><td>0.135</td><td>0.131</td><td>0.132</td></tr><tr><td>Chronic obstructive pulmonary disease and bronchiectasis</td><td>0.132</td><td>0.128</td><td>0.126</td></tr><tr><td>Complications of surgical procedures or</td><td>0.207</td><td>0.201</td><td>0.213</td></tr><tr><td>medical care Conduction disorders</td><td>0.0726</td><td>0.07</td><td>0.0704</td></tr><tr><td>Congestive heart failure; nonhyperten- sive</td><td>0.268</td><td>0.264</td><td>0.268</td></tr><tr><td>Coronary atherosclerosis and other heart disease</td><td>0.323</td><td>0.317</td><td>0.331</td></tr><tr><td>Diabetes mellitus with complications</td><td>0.0955</td><td>0.0945</td><td>0.094</td></tr><tr><td>Diabetes mellitus without complication</td><td>0.194</td><td>0.187</td><td>0.192</td></tr><tr><td>Disorders of lipid metabolism</td><td>0.291</td><td>0.287</td><td>0.289</td></tr><tr><td>Essential hypertension</td><td>0.421</td><td>0.41</td><td>0.424</td></tr><tr><td>Fluid and electrolyte disorders</td><td>0.267</td><td>0.276</td><td>0.265</td></tr><tr><td>Gastrointestinal hemorrhage</td><td>0.0715</td><td>0.0747</td><td>0.0788</td></tr><tr><td>Hypertension with complications and</td><td>0.133</td><td>0.131</td><td>0.13</td></tr><tr><td>secondary hypertension Other liver diseases</td><td>0.0884</td><td>0.0904</td><td>0.0883</td></tr><tr><td>Other lower respiratory disease</td><td>0.0514</td><td>0.0484</td><td>0.0565</td></tr><tr><td> Other upper respiratory disease</td><td>0.0408</td><td>0.0371</td><td>0.0429</td></tr><tr><td>Pleurisy; pneumothorax; pulmonary</td><td>0.0858</td><td>0.09</td><td>0.0905</td></tr><tr><td>collapse Pneumonia (except that caused by tu- berculosis or sexually transmitted dis-</td><td>0.14</td><td>0.135</td><td>0.135</td></tr><tr><td>ease) Respiratory failure; insufficiency; arrest</td><td>0.18</td><td>0.184</td><td>0.177</td></tr><tr><td>(adult) Septicemia (except in labor)</td><td>0.142</td><td>0.145</td><td>0.138</td></tr><tr><td>Shock</td><td>0.0783</td><td>0.0745</td><td>0.0811</td></tr><tr><td>Total samples</td><td>29 208</td><td>6359</td><td>6266</td></tr></table>
258
+
259
+ 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 )$ .
260
+
261
+ 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).
262
+
263
+ 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.
264
+
265
+ <table><tr><td>DATASET</td><td>MODEL</td><td>MICRO AUC</td><td>MACRO AUC</td><td>WEIGHTED AUC</td><td>RUNTIME</td></tr><tr><td>H-MNIST</td><td>SEFT</td><td>99.76 ± 0.01</td><td>99.75 ± 0.01</td><td>99.75 ± 0.01</td><td>4.05 ± 0.35</td></tr><tr><td rowspan="3">M3-Phenotyping</td><td>SEFT (NO ATTENTION)</td><td>81.22 ± 0.12</td><td>75.95 ± 0.09</td><td>74.90 ± 0.11</td><td>56.27 ± 2.14</td></tr><tr><td>SEFT-ATTN (NO TIME ENC.)</td><td>80.46±0.86</td><td>74.70 ± 1.12</td><td>73.48 ± 1.18</td><td>50.17 ± 0.84</td></tr><tr><td>SEFT-ATTN</td><td>82.00 ± 0.06</td><td>76.95 ± 0.09</td><td>75.88 ± 0.09</td><td>52.32 ± 0.74</td></tr><tr><td></td><td></td><td>ACCURACY</td><td>PR AUC</td><td>AUC</td><td>RUNTIME</td></tr><tr><td rowspan="3">M3-Mortality</td><td>SEFT (NO ATTENTION)</td><td>88.65 ± 0.49</td><td>36.18 ± 5.07</td><td>79.15 ± 3.00</td><td>3.72 ± 0.11</td></tr><tr><td>SEFT-ATTN (NO TIME ENC.)</td><td>89.31±0.08</td><td>44.12 ± 0.06</td><td>83.72 ± 0.34</td><td>17.60 ± 0.43</td></tr><tr><td>SEFT-ATTN</td><td>89.48 ± 0.16</td><td>45.25 ± 0.96</td><td>83.79 ± 0.59</td><td>16.64± 0.20</td></tr><tr><td rowspan="3">P-Mortality</td><td>SEFT (NO ATTENTION)</td><td>87.11 ± 0.32</td><td>52.07 ±0.41</td><td>84.12 ± 0.32</td><td>3.07 ± 0.03</td></tr><tr><td>SEFT-ATTN (NO TIME ENC.)</td><td>87.03 ±0.06</td><td>51.86 ± 1.04</td><td>84.91 ± 0.29</td><td>7.04 ± 0.04</td></tr><tr><td>SEFT-ATTN</td><td>87.62 ± 0.16</td><td>54.05± 0.27</td><td>85.50 ± 0.13</td><td>7.54 ± 0.08</td></tr></table>
266
+
267
+ ![](images/5a022c75092c637eed0c7fba11b58915df9fb99274cb37712336626f29f9b3bb.jpg)
268
+ Figure A.1: A visualisation of the runtime of all methods and their AUC for datasets with a binary classification scenario.
269
+
270
+ ![](images/7bfd5f3b99f47c4b2eeb4f901e15232fff222b513a48bd633e440baaacd0c2d9.jpg)
271
+ 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.
md/train/ByxdUySKvS/ByxdUySKvS.md ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ADVERSARIAL AUTOAUGMENT
2
+
3
+ Xinyu Zhang
4
+ Huawei
5
+ zhangxinyu10@huawei.com
6
+ Qiang Wang
7
+ Huawei
8
+ wangqiang168@huawei.com
9
+ Jian Zhang
10
+ Huawei
11
+ zhangjian157@huawei.com
12
+ Zhao Zhong
13
+ Huawei
14
+ zorro.zhongzhao@huawei.com
15
+
16
+ # ABSTRACT
17
+
18
+ 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.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ 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.
23
+
24
+ ![](images/30303714f451b21eaee42acd79567fecfdfac2cdfb67ff8adc6f2486bb4f5ec4.jpg)
25
+ 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.
26
+
27
+ 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.
28
+
29
+ The contributions can be summarized as follows:
30
+
31
+ • 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.
32
+ • 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.
33
+ • 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).
34
+
35
+ # 2 RELATED WORK
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ 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.
42
+
43
+ # 3 METHOD
44
+
45
+ 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.
46
+
47
+ # 3.1 MOTIVATIONS
48
+
49
+ 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.
50
+
51
+ 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.
52
+
53
+ ![](images/cf1281f8bae28f7b31d6aab6d29d8044913d73f1d9a58a90985849e432656219.jpg)
54
+ 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.
55
+
56
+ # 3.2 SEARCH SPACE
57
+
58
+ 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.
59
+
60
+ # 3.3 ADVERSARIAL LEARNING
61
+
62
+ 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.
63
+
64
+ 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
65
+
66
+ $$
67
+ \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 } ] ,
68
+ $$
69
+
70
+ 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
71
+
72
+ $$
73
+ \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 } ] .
74
+ $$
75
+
76
+ 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
77
+
78
+ $$
79
+ \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 } ] ,
80
+ $$
81
+
82
+ 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
83
+
84
+ $$
85
+ \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 } ] ,
86
+ $$
87
+
88
+ 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
89
+
90
+ $$
91
+ \mathcal { L } _ { m } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } [ \mathcal { F } ( \tau _ { m } ( x _ { n } ) , \pmb { w } ) , y _ { n } ] .
92
+ $$
93
+
94
+ Hence, we have an equivalent form of Equation 4
95
+
96
+ $$
97
+ \pmb { w } _ { t + 1 } = \pmb { w } _ { t } - \eta \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \nabla _ { \pmb { w } } \mathcal { L } _ { m } .
98
+ $$
99
+
100
+ 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
101
+
102
+ $$
103
+ \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}
104
+ $$
105
+
106
+ 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.
107
+
108
+ ![](images/d2f4b35084c6e611d6139d1fbef94757f5d6b6d525d6edbd65d47563cffa3f4c.jpg)
109
+ 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.
110
+
111
+ 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
112
+
113
+ $$
114
+ \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}
115
+ $$
116
+
117
+ 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
118
+
119
+ $$
120
+ \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}
121
+ $$
122
+
123
+ The adversarial learning of target network training and augmentation policy search is summarized as Algorithm 1.
124
+
125
+ # 4 EXPERIMENTS AND ANALYSIS
126
+
127
+ 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.
128
+
129
+ Algorithm 1 Joint Training of Target Network and Augmentation Policy Network
130
+
131
+ 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 } }$
132
+
133
+ 1: for $1 \leq e \leq$ epochs do
134
+ 2: Initialize $\widehat { \mathcal { L } } _ { m } = 0 , \forall m \in \{ 1 , 2 , \cdots , M \}$ ;
135
+ 3: Generate $M$ policies with the probabilities $\{ p _ { 1 } , p _ { 2 } , \cdots , p _ { M } \}$ ;
136
+ 4: for $1 \leq t \leq T$ do
137
+ 5: Augment each batch data with $M$ generated policies, respectively;
138
+ 6: Update $w _ { e , t + 1 }$ according to Equation 4;
139
+ 7: Update ${ \widehat { \mathcal { L } } } _ { m }$ through moving average, $\forall m \in \{ 1 , 2 , \cdot \cdot \cdot , M \}$ ;
140
+ 8: Collect $\{ \widehat { \mathcal { L } } _ { 1 } , \widehat { \mathcal { L } } _ { 2 } , \cdots , \widehat { \mathcal { L } } _ { M } \}$ ;
141
+ 9: Normalize ${ \widehat { \mathcal { L } } } _ { m }$ among $M$ instances as $\widetilde { \mathcal { L } } _ { m } , \forall m \in \{ 1 , 2 , \cdots , M \}$ ;
142
+ 10: Update $\pmb { \theta } _ { e + 1 }$ via Equation 9;
143
+ 11: Output $w ^ { \ast } , \theta ^ { \ast }$
144
+
145
+ # 4.1 EXPERIMENT SETTINGS
146
+
147
+ 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.
148
+
149
+ # 4.2 EXPERIMENTS ON CIFAR-10 AND CIFAR-100
150
+
151
+ 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.
152
+
153
+ 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.
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ ![](images/1d9bd1c440b329d4cde0cd4933e8cd51662c730a2c81bacfeed27c2444ff1516.jpg)
160
+ Figure 4: The Comparison of normalized performance between AutoAugment and our method. Please refer to the following tables for more details.
161
+
162
+ ![](images/8f0622955a06ab6ba860d80c3c02ae266fb49a0c8467d420de114247a0cfe754.jpg)
163
+ 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 \}$ .
164
+
165
+ ![](images/969c5da3cca5ba7fe0f9f8865ef328f9131f97876658c78dfb77dd5e89fdd3d5.jpg)
166
+ 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.
167
+
168
+ CIFAR-100 results: We also evaluate our proposed method on CIFAR-100, as shown in Table 2.
169
+ As we can observe from the table, we also achieve the state-of-the-art performance on this dataset.
170
+
171
+ 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.
172
+
173
+ <table><tr><td>Model</td><td>Baseline</td><td>Cutout</td><td>AutoAugment</td><td>PBA</td><td>Our Method</td></tr><tr><td>Wide-ResNet-28-10</td><td>3.87</td><td>3.08</td><td>2.68</td><td>2.58</td><td>1.90±0.15</td></tr><tr><td>Shake-Shake (26 2x32d)</td><td>3.55</td><td>3.02</td><td>2.47</td><td>2.54</td><td>2.36±0.10</td></tr><tr><td>Shake-Shake (26 2x96d)</td><td>2.86</td><td>2.56</td><td>1.99</td><td>2.03</td><td>1.85±0.12</td></tr><tr><td>Shake-Shake (26 2x112d)</td><td>2.82</td><td>2.57</td><td>1.89</td><td>2.03</td><td>1.78±0.05</td></tr><tr><td>PyramidNet+ShakeDrop</td><td>2.67</td><td>2.31</td><td>1.48</td><td>1.46</td><td>1.36±0.06</td></tr></table>
174
+
175
+ # 4.3 EXPERIMENTS ON IMAGENET
176
+
177
+ 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.
178
+
179
+ Table 2: Top-1 test error $( \% )$ on CIFAR-100.
180
+
181
+ <table><tr><td>Model</td><td>Baseline</td><td>Cutout</td><td> AutoAugment</td><td>PBA</td><td>Our Method</td></tr><tr><td>Wide-ResNet-28-10</td><td>18.80</td><td>18.41</td><td>17.09</td><td>16.73</td><td>15.49±0.18</td></tr><tr><td>Shake-Shake (26 2x96d)</td><td>17.05</td><td>16.00</td><td>14.28</td><td>15.31</td><td>14.10±0.15</td></tr><tr><td>PyramidNet+ShakeDrop</td><td>13.99</td><td>12.19</td><td>10.67</td><td>10.94</td><td>10.42±0.20</td></tr></table>
182
+
183
+ 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.
184
+
185
+ 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 \%$ .
186
+
187
+ 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.
188
+
189
+ <table><tr><td>Model</td><td>Baseline</td><td>AutoAugment</td><td>PBA</td><td>Our Method</td></tr><tr><td>ResNet-50</td><td>23.69 / 6.92</td><td>22.37 /6.18</td><td>1</td><td>20.60±0.15 /5.53±0.05</td></tr><tr><td>ResNet-50-D</td><td>22.84 / 6.48</td><td>1</td><td></td><td>20.00±0.12/5.25±0.03</td></tr><tr><td>ResNet-200</td><td>21.52 / 5.85</td><td>20.00 /4.90</td><td>1</td><td>18.68±0.18 /4.70±0.05</td></tr></table>
190
+
191
+ # 4.4 ABLATION STUDY
192
+
193
+ 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.
194
+
195
+ • Baseline: Training regularly with the standard data augmentation and step LR schedule.
196
+ • 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.
197
+
198
+ 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.
199
+
200
+ # 4.5 COMPUTING COST AND TIME OVERHEAD
201
+
202
+ 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.
203
+
204
+ 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.
205
+
206
+ Table 4: Top-1 test error $( \% )$ of ResNet-50 with different augmentation methods on ImageNet.
207
+
208
+ <table><tr><td>Method</td><td>Aug. Policy</td><td>Enlarge Batch</td><td>LR Schedule</td><td>Test Error</td></tr><tr><td>Baseline</td><td>standard</td><td>M=1</td><td>step</td><td>23.69</td></tr><tr><td>Fixed</td><td>standard</td><td>M=8</td><td>cosine</td><td>22.70</td></tr><tr><td>Random</td><td>random</td><td>M=8</td><td>cosine</td><td>21.68</td></tr><tr><td>Ours</td><td>adversarial</td><td>M=8</td><td>cosine</td><td>20.60</td></tr></table>
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ <table><tr><td rowspan="2">Method</td><td colspan="3">Computing Cost</td><td colspan="3">Time Overhead</td></tr><tr><td>Searching</td><td>Training</td><td>Total</td><td>Searching</td><td>Training</td><td>Total</td></tr><tr><td>AutoAugment</td><td>15000</td><td>160</td><td>15160</td><td>10</td><td>1</td><td>11</td></tr><tr><td>Our Method</td><td>~0</td><td>1280</td><td>1280</td><td>~0</td><td>1</td><td>1</td></tr></table>
215
+
216
+ # 4.6 TRANSFERABILITY ACROSS DATASETS AND ARCHITECTURES
217
+
218
+ 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.
219
+
220
+ Table 6: Top-1 test error $( \% )$ of the transfer of the augmentation policies learned with ResNet-50 on ImageNet.
221
+
222
+ <table><tr><td>Method</td><td>Dataset</td><td>AutoAugment</td><td>Our Method</td><td>Policy Transfer</td></tr><tr><td>Wide-ResNet-28-10</td><td>CIFAR-10</td><td>2.68</td><td>1.90</td><td>2.45±0.13</td></tr><tr><td>Wide-ResNet-28-10</td><td>CIFAR-100</td><td>17.09</td><td>15.49</td><td>16.48±0.15</td></tr><tr><td>ResNet-50-D</td><td>ImageNet</td><td>1</td><td>20.00</td><td>20.20±0.05</td></tr><tr><td>ResNet-200</td><td>ImageNet</td><td>20.00</td><td>18.68</td><td>19.05±0.10</td></tr></table>
223
+
224
+ # 5 CONCLUSION
225
+
226
+ 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.
227
+
228
+ # REFERENCES
229
+
230
+ Antreas Antoniou, Amos J. Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. ICLR, 2017.
231
+
232
+ Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: ´ Learning augmentation policies from data. CVPR, 2019.
233
+
234
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. CVPR, 2009.
235
+
236
+ Terrance Devries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. CoRR, abs/1708.04552, 2017.
237
+
238
+ 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.
239
+
240
+ Xavier Gastaldi. Shake-shake regularization. CoRR, abs/1705.07485, 2017.
241
+
242
+ 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.
243
+
244
+ Minghao Guo, Zhao Zhong, Wei Wu, Dahua Lin, and Junjie Yan. IRLAS: inverse reinforcement learning for architecture search. CoRR, abs/1812.05285, 2018.
245
+
246
+ Swaminathan Gurumurthy, Ravi Kiran Sarvadevabhatla, and Venkatesh Babu Radhakrishnan. Deligan : Generative adversarial networks for diverse and limited data. CVPR, 2017.
247
+
248
+ Dongyoon Han, Jiwhan Kim, and Junmo Kim. Deep pyramidal residual networks. CVPR, 2017.
249
+
250
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016.
251
+
252
+ 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.
253
+
254
+ Daniel Ho, Eric Liang, Ion Stoica, Pieter Abbeel, and Xi Chen. Population based augmentation: Efficient learning of augmentation policy schedules. ICML, 2019.
255
+
256
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 1997.
257
+
258
+ 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.
259
+
260
+ Hiroshi Inoue. Data augmentation by pairing samples for images classification. CoRR, abs/1801.02929, 2018.
261
+
262
+ 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.
263
+
264
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR, 2015.
265
+
266
+ Alex Krizhevsky and Geoffrey E. Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
267
+
268
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. NIPS, 2012.
269
+
270
+ Joseph Lemley, Shabab Bazrafkan, and Peter Corcoran. Smart augmentation - learning an optimal data augmentation strategy. CoRR, abs/1703.08383, 2017.
271
+
272
+ 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.
273
+
274
+ 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.
275
+
276
+ Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning. CoRR, abs/1712.04621, 2017.
277
+
278
+ Julian Salazar, Davis Liang, Zhiheng Huang, and Zachary C. Lipton. Invariant representation learning for robust deep networks. NeurIPS Workshop, 2018.
279
+
280
+ 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.
281
+
282
+ Toan Tran, Trung Pham, Gustavo Carneiro, Lyle J. Palmer, and Ian D. Reid. A bayesian data augmentation approach for learning deep models. NIPS, 2017.
283
+
284
+ Li Wan, Matthew Zeiler, Sixin Zhang, Yann LeCun, and Rob Fergus. Regularization of neural networks using dropconnect. ICML, 2013.
285
+
286
+ Xiaolong Wang, Abhinav Shrivastava, and Abhinav Gupta. A-fast-rcnn: Hard positive generation via adversary for object detection. CVPR, 2017.
287
+
288
+ Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 1992.
289
+
290
+ Yoshihiro Yamada, Masakazu Iwamura, and Koichi Kise. Shakedrop regularization. CoRR, abs/1802.02375, 2018.
291
+
292
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. British Machine Vision Conference, 2016.
293
+
294
+ Zhao Zhong, Junjie Yan, and Cheng-Lin Liu. Practical network blocks design with Q-learning. CVPR, 2018a.
295
+
296
+ 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.
297
+
298
+ Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. ICLR, 2016.
299
+
300
+ Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. CVPR, 2017.
301
+
302
+ A APPENDIX
303
+
304
+ # A.1 HYPERPARAMETERS
305
+
306
+ We detail the model hyperparameters on CIFAR-10/CIFAR-100 and ImageNet in Table 7.
307
+
308
+ 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.
309
+
310
+ <table><tr><td>Dataset</td><td>Model</td><td>Batch Size (N · M)</td><td>LR</td><td>WD</td><td>Epoch</td></tr><tr><td>CIFAR-10</td><td>Wide-ResNet-28-10</td><td>128·8</td><td>0.1</td><td>5e-4</td><td>200</td></tr><tr><td>CIFAR-10</td><td>Shake-Shake (26 2x32d)</td><td>128·8</td><td>0.2</td><td>1e-4</td><td>600</td></tr><tr><td>CIFAR-10</td><td>Shake-Shake ( (262x96d)</td><td>128·8</td><td>0.2</td><td>1e-4</td><td>600</td></tr><tr><td>CIFAR-10</td><td>Shake-Shake (26 2x112d)</td><td>128·8</td><td>0.2</td><td>1e-4</td><td>600</td></tr><tr><td>CIFAR-10</td><td>PyramidNet+ShakeDrop</td><td>128·8</td><td>0.1</td><td>1e-4</td><td>600</td></tr><tr><td>CIFAR-100</td><td>Wide-ResNet-28-10</td><td>128·8</td><td>0.1</td><td>5e-4</td><td>200</td></tr><tr><td>CIFAR-100</td><td>Shake-Shake (26 2x96d)</td><td>128·8</td><td>0.1</td><td>5e-4</td><td>1200</td></tr><tr><td>CIFAR-100</td><td>PyramidNet+ShakeDrop</td><td>128·8</td><td>0.5</td><td>1e-4</td><td>1200</td></tr><tr><td>ImageNet</td><td>ResNet-50</td><td>2048·8</td><td>0.8</td><td>1e-4</td><td>120</td></tr><tr><td>ImageNet</td><td>ResNet-50-D</td><td>2048·8</td><td>0.8</td><td>1e-4</td><td>120</td></tr><tr><td>ImageNet</td><td>ResNet-200</td><td>2048·8</td><td>0.8</td><td>1e-4</td><td>120</td></tr></table>
md/train/H1Dy---0Z/H1Dy---0Z.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DISTRIBUTED PRIORITIZED EXPERIENCE REPLAY
2
+
3
+ Dan Horgan
4
+ DeepMind
5
+ horgan@google.com
6
+ John Quan
7
+ DeepMind
8
+ johnquan@google.com
9
+ David Budden
10
+ DeepMind
11
+ budden@google.com
12
+
13
+ Gabriel Barth-Maron DeepMind gabrielbm@google.com
14
+
15
+ Matteo Hessel
16
+ DeepMind
17
+ mtthss@google.com
18
+
19
+ Hado van Hasselt DeepMind hado@google.com
20
+
21
+ David Silver
22
+ DeepMind
23
+ davidsilver@google.com
24
+
25
+ # ABSTRACT
26
+
27
+ 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.
28
+
29
+ # 1 INTRODUCTION
30
+
31
+ 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).
32
+
33
+ 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.
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ # 2 BACKGROUND
42
+
43
+ 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.
44
+
45
+ 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).
46
+
47
+ 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.
48
+
49
+ # 3 OUR CONTRIBUTION: DISTRIBUTED PRIORITIZED EXPERIENCE REPLAY
50
+
51
+ 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.
52
+
53
+ ![](images/296c1e633a240d666b61e3fc734c73d9f50a0a7d3b02cdc0f15e8a24a2000039.jpg)
54
+ 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.
55
+
56
+ <table><tr><td colspan="2">Algorithm1 Actor</td><td></td></tr><tr><td colspan="2">1: procedure ACTOR(B,T)</td><td>&gt;Run agent in environment instance,storing experiences.</td></tr><tr><td>2:</td><td>00←LEARNER.PARAMETERS()</td><td>Remote call to obtain latest network parameters.</td></tr><tr><td>3:</td><td>SO←ENVIRONMENT.INITIALIZE()</td><td>&gt;Get initial state from environment.</td></tr><tr><td>4:</td><td>fort=1toTdo</td><td></td></tr><tr><td>5:</td><td>at-1←π0t-1(St-1)</td><td> Select an action using the current policy.</td></tr><tr><td>6:</td><td>(Tt,t,St) ←ENVIRONMENT.STEP(at-1)</td><td>&gt;Apply the action in the environment.</td></tr><tr><td>7:</td><td>LOCALBUFFER.ADD((St-1,at-1,rt,/t))</td><td>Add data to local buffer.</td></tr><tr><td>8:</td><td></td><td>if LOCALBUFFER.SIzE()≥ B thenIn a background thread, periodically send data to replay.</td></tr><tr><td>9:</td><td>T ←LOCALBUFFER.GET(B)</td><td>Get buffered data (e.g.batch of multi-step transitions).</td></tr><tr><td>10:</td><td></td><td>p ← COMPUTEPRIORITIEs(T)&gt;Calculate priorities for experience (e.g.absolute TD error).</td></tr><tr><td>11:</td><td>REPLAY.ADD(T,p)</td><td>&gt;Remote call to add experience to replay memory.</td></tr><tr><td>12:</td><td>endif</td><td></td></tr><tr><td>13:</td><td>PERIODICALLY(0t ← LEARNER.PARAMETERS())</td><td> Obtain latest network parameters.</td></tr><tr><td>14:</td><td>end for</td><td></td></tr><tr><td>15: end procedure</td><td></td><td></td></tr></table>
57
+
58
+ # Algorithm 2 Learner
59
+
60
+ 1: procedure LEARNER $( T )$ . Update network using batches sampled from memory.
61
+ 2: 3: $\theta _ { 0 } \gets$ INITIALIZENETWORK( )
62
+ for $t = 1$ to $T$ do . Update the parameters $T$ times.
63
+ 4: id, τ ← REPLAY.SAMPLE( ) . Sample a prioritized batch of transitions (in a background thread).
64
+ 5: lt ← COMPUTELOSS $( \tau ; \theta _ { t } )$ . Apply learning rule; e.g. double Q-learning or DDPG
65
+ 6: $\theta _ { t + 1 } \gets$ UPDATEPARAMETERS $\left( l _ { t } ; \theta _ { t } \right)$
66
+ 7: $p $ COMPUTEPRIORITIES( ) $\triangleright$ Calculate priorities for experience, (e.g. absolute TD error).
67
+ 8: REPLAY.SETPRIORITY $( i d , p )$ $\triangleright$ Remote call to update priorities.
68
+ 9: PERIODICALLY(REPLAY.REMOVETOFIT()) . Remove old experience from replay memory.
69
+ 10: end for
70
+ 11: end procedure
71
+
72
+ 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.
73
+
74
+ 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.
75
+
76
+ 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.
77
+
78
+ 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.
79
+
80
+ 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.
81
+
82
+ 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.
83
+
84
+ # 3.1 APE-X DQN
85
+
86
+ 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 )$ .
87
+
88
+ 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
89
+
90
+ $$
91
+ 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 } } ,
92
+ $$
93
+
94
+ 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.
95
+
96
+ 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.
97
+
98
+ # 3.2 APE-X DPG
99
+
100
+ 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).
101
+
102
+ ![](images/522d2edd9c1b2d67e294514c8332509ee6fc49bc75262a06389c9efd7a658ef4.jpg)
103
+ 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.
104
+
105
+ 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
106
+
107
+ $$
108
+ 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 ^ { - } ) .
109
+ $$
110
+
111
+ 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.
112
+
113
+ # 4 EXPERIMENTS
114
+
115
+ # 4.1 ATARI
116
+
117
+ 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.
118
+
119
+ <table><tr><td></td><td>Training Time</td><td>Environment Frames</td><td>Resources (per game)</td><td>Median (no-op starts)</td><td>Median (human starts)</td></tr><tr><td>Ape-X DQN</td><td>5 days</td><td>22800M</td><td>376 cores,1 GPU a</td><td>434%</td><td>358%</td></tr><tr><td>Rainbow</td><td>10 days</td><td>200M</td><td>1 GPU</td><td>223%</td><td>153%</td></tr><tr><td>Distributional (C51)</td><td>10 days</td><td>200M</td><td>1 GPU</td><td>178%</td><td>125%</td></tr><tr><td>A3C</td><td>4 days</td><td></td><td>16 cores</td><td></td><td>117%</td></tr><tr><td>Prioritized Dueling</td><td>9.5 days</td><td>200M</td><td>1 GPU</td><td>172%</td><td>115%</td></tr><tr><td>DQN</td><td>9.5 days</td><td>200M</td><td>1 GPU</td><td>79%</td><td>68%</td></tr><tr><td>GorilaDQN</td><td>~4 days</td><td></td><td>unknown b</td><td>96%</td><td>78%</td></tr><tr><td>UNREAL d</td><td></td><td>250M</td><td>16 cores</td><td>331% d</td><td>250% d</td></tr></table>
120
+
121
+ 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.
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ 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.
128
+
129
+ 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.
130
+
131
+ # 4.2 CONTINUOUS CONTROL
132
+
133
+ 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.
134
+
135
+ 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.
136
+
137
+ ![](images/68ac2839e7130c15b37d2ddc83d85c060709979d5ee6ab32e49a86a218c53bf2.jpg)
138
+ 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.
139
+
140
+ ![](images/51de9b777bf4bcb67084bd1c9e9dcd575aea7ee02b6e8d7faff2298d5f2a16d5.jpg)
141
+ 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.
142
+
143
+ # 5 ANALYSIS
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ ![](images/69f03644849ff9359e2578d49582786ac8806e7d2c50b0cd6b2216fdc48e3eac.jpg)
152
+ 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.
153
+
154
+ 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.
155
+
156
+ # 6 CONCLUSION
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ 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.
163
+
164
+ 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.
165
+
166
+ 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.
167
+
168
+ # ACKNOWLEDGMENTS
169
+
170
+ 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.
171
+
172
+ # REFERENCES
173
+
174
+ 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.
175
+
176
+ 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.
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ Marc G. Bellemare, Will Dabney, and Remi Munos. A distributional perspective on reinforcement ´ learning. In International Conference on Machine Learning, 2017.
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ W Keith Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970.
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ Geoffrey E Hinton. To recognize shapes, first learn to generate images. Prog. Brain Res., 165: 535–547, 2007.
201
+
202
+ 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.
203
+
204
+ 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.
205
+
206
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
207
+
208
+ Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
209
+
210
+ 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.
211
+
212
+ Long-H Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine Learning, 1992.
213
+
214
+ Ilya Loshchilov and Frank Hutter. Online batch selection for faster training of neural networks. arXiv preprint arXiv:1511.06343, 2015.
215
+
216
+ 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.
217
+
218
+ 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.
219
+
220
+ Andrew W Moore and Christopher G Atkeson. Prioritized sweeping: Reinforcement learning with less data and less time. Machine learning, 13(1):103–130, 1993.
221
+
222
+ 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.
223
+
224
+ Danil V Prokhorov and Donald C Wunsch. Adaptive critic designs. IEEE transactions on Neural Networks, 8(5):997–1007, 1997.
225
+
226
+ 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.
227
+
228
+ Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. In International Conference on Learning Representations, 2016.
229
+
230
+ 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.
231
+
232
+ 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.
233
+
234
+ 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.
235
+
236
+ Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9–44, 1988.
237
+
238
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press Cambridge, 1998.
239
+
240
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, 2nd edition. 2017.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ George E Uhlenbeck and Leonard S Ornstein. On the theory of the brownian motion. Physical review, 36(5):823, 1930.
247
+
248
+ Hado van Hasselt. Double Q-learning. In Advances in Neural Information Processing Systems, pp. 2613–2621, 2010.
249
+
250
+ Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double Qlearning. In Advances in Neural Information Processing Systems, 2016.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ Paul J Werbos. A menu of designs for reinforcement learning over time. Neural networks for control, pp. 67–95, 1990.
257
+
258
+ ![](images/0b3b79c13d26d6fed6dca4023299993f982f83e79bbd8e54b2086089ae920475.jpg)
259
+ 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.
260
+
261
+ ![](images/c909664ab5ef543ed7ca2eb3429fdfb0d4b073de41ff640549f61dc8e9cb52a7.jpg)
262
+ 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$ .
263
+
264
+ # A RECENCY OF EXPERIENCE
265
+
266
+ 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.
267
+
268
+ 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.
269
+
270
+ # B VARYING THE DATA-GENERATING POLICIES
271
+
272
+ 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
273
+
274
+ replay as normal, and we find that the results with the full range of $\epsilon$ are overall slightly better.
275
+ However, it is not essential for achieving good results within our distributed framework.
276
+
277
+ # C ATARI: ADDITIONAL DETAILS
278
+
279
+ 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 ]$ .
280
+
281
+ 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.
282
+
283
+ # D CONTINUOUS CONTROL: ADDITIONAL DETAILS
284
+
285
+ 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.
286
+
287
+ 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.
288
+
289
+ 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.
290
+
291
+ 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.
292
+
293
+ ![](images/c04f7fbc75193c4384545a137f0703d706d7c1e0178b4bf3f6ed9b0066f21e1c.jpg)
294
+ 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)).
295
+
296
+ # E TUNING
297
+
298
+ 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.
299
+
300
+ 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).
301
+
302
+ 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.
303
+
304
+ # F IMPLEMENTATION
305
+
306
+ The following section makes explicit some of the more practical details that may be of interest to anyone wishing to implement a similar system.
307
+
308
+ 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.
309
+
310
+ 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.
311
+
312
+ 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.
313
+
314
+ 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).
315
+
316
+ 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.
317
+
318
+ 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.
319
+
320
+ 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.
321
+
322
+ 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.
323
+
324
+ 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.
325
+
326
+ ![](images/f578ecace5631d994bfd6279c4a5b44e57e882eb2f40a5e4adb97fbe30a17601.jpg)
327
+ 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.
328
+
329
+ ![](images/3eb2bc35890285b38016f9dae3b07dda38be8f504cbc44310a8983cea36fcd27.jpg)
330
+ 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.
331
+
332
+ ![](images/9bbe7c32a5e256e54b199dfb3d84b82cfd5bda6cad739084413d788ef824056c.jpg)
333
+ Figure 11: Speed of data generation scales linearly with the number of actors.
334
+
335
+ ![](images/25f8f42a218da06e8d3b75e6b039fd7548d3de2b9965679f63ba47f0781d1ef1.jpg)
336
+ 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.
337
+
338
+ <table><tr><td>Game</td><td>No-op starts</td><td>Human starts</td></tr><tr><td></td><td>40,804.9</td><td>17,731.5</td></tr><tr><td>alien</td><td></td><td>1,047.3</td></tr><tr><td>amidar</td><td>8,659.2</td><td></td></tr><tr><td>assault</td><td>24,559.4</td><td>24,404.6</td></tr><tr><td>asterix</td><td>313,305.0</td><td>283,179.5</td></tr><tr><td>asteroids</td><td>155,495.1</td><td>117,303.4</td></tr><tr><td>atlantis</td><td>944,497.5</td><td>918,714.5</td></tr><tr><td>bank_heist battle_zone</td><td>1,716.4</td><td>1,200.8</td></tr><tr><td>beam_rider</td><td>98,895.0</td><td>92,275.0</td></tr><tr><td>berzerk</td><td>63,305.2 57,196.7</td><td>72,233.7 55,598.9</td></tr><tr><td>bowling</td><td>17.6</td><td>30.2</td></tr><tr><td>boxing</td><td>100.0</td><td>80.9</td></tr><tr><td>breakout</td><td>800.9</td><td>756.5</td></tr><tr><td>centipede</td><td>12,974.0</td><td>5,711.6</td></tr><tr><td>chopper_command</td><td>721,851.0</td><td>576,601.5</td></tr><tr><td>crazy_climber</td><td>320,426.0</td><td>263,953.5</td></tr><tr><td>defender</td><td>411,943.5</td><td>399,865.3</td></tr><tr><td>demon_attack</td><td>133,086.4</td><td>133,002.1</td></tr><tr><td>double_dunk</td><td>23.5</td><td>22.3</td></tr><tr><td>enduro</td><td>2,177.4</td><td>2,042.4</td></tr><tr><td>fishing_derby</td><td>44.4</td><td>22.4</td></tr><tr><td>freeway</td><td>33.7</td><td>29.0</td></tr><tr><td>frostbite</td><td>9,328.6</td><td>6,511.5</td></tr><tr><td>gopher</td><td>120,500.9</td><td>121,168.2</td></tr><tr><td>gravitar</td><td>1,598.5</td><td>662.0</td></tr><tr><td>hero</td><td>31,655.9</td><td>26,345.3</td></tr><tr><td>ice_hockey</td><td>33.0</td><td>24.0</td></tr><tr><td>jamesbond</td><td>21,322.5</td><td>18,992.3</td></tr><tr><td>kangaroo</td><td>1,416.0</td><td>577.5</td></tr><tr><td>krull</td><td>11,741.4</td><td>8,592.0</td></tr><tr><td>kung_fu_master</td><td>97,829.5</td><td>72,068.0</td></tr><tr><td>montezuma_revenge</td><td>2,500.0</td><td>1,079.0</td></tr><tr><td>ms_pacman</td><td>11,255.2</td><td>6,135.4</td></tr><tr><td>name_this-game</td><td>25,783.3</td><td>23,829.9</td></tr><tr><td>phoenix</td><td>224,491.1</td><td>188,788.5</td></tr><tr><td>pitfall</td><td>-0.6</td><td>-273.3</td></tr><tr><td>pong</td><td>20.9</td><td>18.7</td></tr><tr><td>private_eye</td><td>49.8</td><td>864.7</td></tr><tr><td>qbert</td><td>302,391.3</td><td>380,152.1</td></tr><tr><td>riverraid</td><td>63,864.4</td><td></td></tr><tr><td>road_runner</td><td>222,234.5</td><td>49,982.8</td></tr><tr><td>robotank</td><td>73.8</td><td>127,111.5</td></tr><tr><td>seaquest</td><td>392,952.3</td><td>68.5</td></tr><tr><td>skiing</td><td>-10,789.9</td><td>377,179.8</td></tr><tr><td>solaris</td><td>2,892.9</td><td>-11,359.3</td></tr><tr><td>space_invaders</td><td></td><td>3,115.9</td></tr><tr><td></td><td>54,681.0</td><td>50,699.3</td></tr><tr><td>star_gunner</td><td>434,342.5</td><td>432,958.0</td></tr><tr><td>surround</td><td>7.1</td><td>5.5</td></tr><tr><td>tennis</td><td>23.9</td><td>23.0</td></tr><tr><td>time_pilot</td><td>87,085.0</td><td>71,543.0</td></tr><tr><td>tutankham</td><td>272.6</td><td>127.7</td></tr><tr><td>up_n_down</td><td>401,884.3</td><td>347,912.2</td></tr><tr><td>venture</td><td>1,813.0</td><td>935.5</td></tr><tr><td>video_pinball</td><td>565,163.2</td><td>873,988.5</td></tr><tr><td>wizard_of_wor</td><td>46,204.0</td><td>46,897.0</td></tr><tr><td>yars_revenge zaxxon</td><td>148,594.8 42,285.5</td><td>131,701.1 37,672.0</td></tr></table>
339
+
340
+ 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
md/train/H1W1UN9gg/H1W1UN9gg.md ADDED
@@ -0,0 +1,547 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEEP INFORMATION PROPAGATION
2
+
3
+ Samuel S. Schoenholz∗ Google Brain
4
+
5
+ Justin Gilmer∗ Google Brain
6
+
7
+ Surya Ganguli Stanford University
8
+
9
+ Jascha Sohl-Dickstein Google Brain
10
+
11
+ # ABSTRACT
12
+
13
+ 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.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ # 2 BACKGROUND
30
+
31
+ 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,
32
+
33
+ $$
34
+ z _ { i } ^ { l } = \sum _ { j } W _ { i j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l } ~ y _ { i } ^ { l + 1 } = \phi ( z _ { i } ^ { l } ) .
35
+ $$
36
+
37
+ 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.
38
+
39
+ 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,
40
+
41
+ $$
42
+ \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 }
43
+ $$
44
+
45
+ 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,
46
+
47
+ $$
48
+ 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 }
49
+ $$
50
+
51
+ 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 }$ .
52
+
53
+ 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
54
+
55
+ 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,
56
+
57
+ $$
58
+ 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 }
59
+ $$
60
+
61
+ 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.
62
+
63
+ ![](images/47c9c73f7128fa37a106f7cf6b0db68ce60087436f087eae791f03bc88601d0a.jpg)
64
+ 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).
65
+
66
+ 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,
67
+
68
+ $$
69
+ \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 }
70
+ $$
71
+
72
+ 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.
73
+
74
+ # 3 ASYMPTOTIC EXPANSIONS AND DEPTH SCALES
75
+
76
+ 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.
77
+
78
+ 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 }$ .
79
+
80
+ 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),
81
+
82
+ $$
83
+ \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) .
84
+ $$
85
+
86
+ 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
87
+
88
+ $$
89
+ \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] .
90
+ $$
91
+
92
+ This establishes $\xi _ { q }$ as a depth scale that controls how deep information from a single input may penetrate into a random neural network.
93
+
94
+ 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,
95
+
96
+ $$
97
+ \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 } ) .
98
+ $$
99
+
100
+ 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
101
+
102
+ $$
103
+ \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] .
104
+ $$
105
+
106
+ 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.
107
+
108
+ ![](images/bd78147f340ab26b1a1f2acb0fc17928f8eb64a6dd13105e1b40508753885a3b.jpg)
109
+ 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.
110
+
111
+ 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.
112
+
113
+ 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
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ # 3.1 DROPOUT
120
+
121
+ 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,
122
+
123
+ $$
124
+ z _ { i } ^ { l } = \frac { 1 } { \rho } \sum _ { j } W _ { i j } ^ { l } p _ { j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l }
125
+ $$
126
+
127
+ 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.
128
+
129
+ 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),
130
+
131
+ $$
132
+ \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 } .
133
+ $$
134
+
135
+ 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.
136
+
137
+ Computing the off-diagonal term of the covariance matrix similarly (see Appendix 7.4),
138
+
139
+ $$
140
+ \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 }
141
+ $$
142
+
143
+ 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),
144
+
145
+ $$
146
+ \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) .
147
+ $$
148
+
149
+ 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.
150
+
151
+ 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.
152
+
153
+ ![](images/7b7daa50fafe45af9ec15a964570b97fa167a83b974c86d18fbc8dbe598eeab1.jpg)
154
+ 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 }$ .
155
+
156
+ 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 }$ .
157
+
158
+ # 4 GRADIENT BACKPROPAGATION
159
+
160
+ 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$ ,
161
+
162
+ $$
163
+ \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 }
164
+ $$
165
+
166
+ 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.
167
+
168
+ 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),
169
+
170
+ $$
171
+ \tilde { q } _ { a a } ^ { l } = \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l } } \chi _ { 1 } .
172
+ $$
173
+
174
+ 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).
175
+
176
+ 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,
177
+
178
+ $$
179
+ \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}
180
+ $$
181
+
182
+ 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.
183
+
184
+ 1. In the ordered phase, $\chi _ { 1 } < 1$ and so $\xi _ { \nabla } > 0$ . We therefore expect gradients to vanish over a depth $| \xi _ { \nabla } |$ .
185
+ 2. At criticality, $\chi _ { 1 } 1$ and so $\xi _ { \nabla } \infty$ . Here gradients should be stable regardless of depth.
186
+ 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 } |$ .
187
+
188
+ 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.
189
+
190
+ ![](images/0c1889c4433799e51847a7b432b3e40bab9f9e8dce978c3fdd054c3c4618c1c1.jpg)
191
+ 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.
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ It can be shown (see Appendix 7.9) that $\tilde { q } _ { a b } ^ { \ l }$ features the recurrence relation,
198
+
199
+ $$
200
+ \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 } )
201
+ $$
202
+
203
+ 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.
204
+
205
+ # 5 EXPERIMENTAL RESULTS
206
+
207
+ 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.
208
+
209
+ ![](images/df16bc2cc2d397471682d32ab781ab579c37ad37f5e96bd35bbd717233b2c136.jpg)
210
+ 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 }$ .
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ ![](images/b7905c2406fbcbe7bc4ca1cf4ce23925a987a9a05c53736f44721f2c9b723116.jpg)
219
+ 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.
220
+
221
+ 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 }$ .
222
+
223
+ 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.
224
+
225
+ # 6 DISCUSSION
226
+
227
+ 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.
228
+
229
+ 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.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ # ACKNOWLEDGMENTS
238
+
239
+ 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.
240
+
241
+ # REFERENCES
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In AISTATS, 2015.
248
+
249
+ 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.
250
+
251
+ Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010.
252
+
253
+ Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv:1412.6544, 2014.
254
+
255
+ K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. ArXiv e-prints, December 2015.
256
+
257
+ 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.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
264
+
265
+ 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.
266
+
267
+ 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.
268
+
269
+ Benjamin Recht, Moritz Hardt, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. arXiv:1509.01240, 2015.
270
+
271
+ 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.
272
+
273
+ David Sussillo and LF Abbott. Random walks: Training very deep nonlinear feed-forward networks with smart initialization. CoRR, vol. abs/1412.6558, 2014.
274
+
275
+ # 7 APPENDIX
276
+
277
+ Here we present derivations of results from throughout the paper.
278
+
279
+ # 7.1 SINGLE INPUT DEPTH-SCALE
280
+
281
+ # Result:
282
+
283
+ Consider the recurrence relation for the variance of a single input,
284
+
285
+ $$
286
+ 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 }
287
+ $$
288
+
289
+ 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,
290
+
291
+ $$
292
+ \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) .
293
+ $$
294
+
295
+ # Derivation:
296
+
297
+ We begin by first expanding to order $\epsilon ^ { l }$ ,
298
+
299
+ $$
300
+ \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}
301
+ $$
302
+
303
+ We therefore arrive at the approximate reccurence relation,
304
+
305
+ $$
306
+ \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 } ) .
307
+ $$
308
+
309
+ 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,
310
+
311
+ $$
312
+ \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}
313
+ $$
314
+
315
+ as required.
316
+
317
+ # 7.2 TWO INPUT DEPTH-SCALE
318
+
319
+ # Result:
320
+
321
+ Consider the recurrence relation for the co-variance of two input,
322
+
323
+ $$
324
+ 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 } ,
325
+ $$
326
+
327
+ 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,
328
+
329
+ $$
330
+ \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) .
331
+ $$
332
+
333
+ # Derivation:
334
+
335
+ 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,
336
+
337
+ $$
338
+ \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}
339
+ $$
340
+
341
+ 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,
342
+
343
+ $$
344
+ 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 } ) .
345
+ $$
346
+
347
+ This allows us to in turn approximate the recurrence relation,
348
+
349
+ $$
350
+ \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}
351
+ $$
352
+
353
+ where $u _ { 1 } ^ { * }$ and $u _ { 2 } ^ { * }$ are appropriately defined asymptotic random variables. This leads to the asymptotic recurrence relation,
354
+
355
+ $$
356
+ \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 } ^ { * } )
357
+ $$
358
+
359
+ as required.
360
+
361
+ 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,
362
+
363
+ $$
364
+ 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 } )
365
+ $$
366
+
367
+ 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,
368
+
369
+ $$
370
+ \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}
371
+ $$
372
+
373
+ It follows that the asymptotic recurrence relation in this case will be,
374
+
375
+ $$
376
+ \epsilon ^ { l + 1 } = - \epsilon ^ { l } \sigma _ { w } ^ { 2 } \int \mathcal { D } z \left[ \phi ^ { \prime } ( \sqrt { q ^ { * } } z ) \right] ^ { 2 } = - \epsilon ^ { l } \chi _ { 1 } .
377
+ $$
378
+
379
+ 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 ^ { * }$ .
380
+
381
+ # 7.3 VARIANCE OF AN INPUT WITH DROPOUT
382
+
383
+ # Result:
384
+
385
+ 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,
386
+
387
+ $$
388
+ \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 } .
389
+ $$
390
+
391
+ # Derivation:
392
+
393
+ Recall that the recurrence relation for the pre-activations is given by,
394
+
395
+ $$
396
+ z _ { i } ^ { l } = \frac { 1 } { \rho } \sum _ { j } W _ { i j } ^ { l } p _ { j } ^ { l } y _ { j } ^ { l } + b _ { i } ^ { l }
397
+ $$
398
+
399
+ 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,
400
+
401
+ $$
402
+ \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}
403
+ $$
404
+
405
+ where we have used the fact that $\mathbb { E } [ ( p _ { j } ^ { l } ) ^ { 2 } ] = \rho$ .
406
+
407
+ # 7.4 COVARIANCE OF TWO INPUTS WITH DROPOUT
408
+
409
+ # Result:
410
+
411
+ 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,
412
+
413
+ $$
414
+ \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 } .
415
+ $$
416
+
417
+ 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) .$
418
+
419
+ # Derivation:
420
+
421
+ Proceeding directly we find that,
422
+
423
+ $$
424
+ \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}
425
+ $$
426
+
427
+ 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.
428
+
429
+ 7.5 THE LACK OF A $c ^ { * } = 1$ FIXED POINT WITH DROPOUT
430
+
431
+ # Result:
432
+
433
+ $c _ { a b } ^ { l } = 1$ then it follows that,
434
+
435
+ $$
436
+ \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)
437
+ $$
438
+
439
+ subject to the approximation, $q _ { a a } ^ { l } \approx q _ { b b } ^ { l } \approx q ^ { * }$ . This implies that $c _ { a b } ^ { l + 1 } < 1$
440
+
441
+ # Derivation:
442
+
443
+ 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,
444
+
445
+ $$
446
+ \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}
447
+ $$
448
+
449
+ as required. Here we have integrated out $z _ { 2 }$ since nether $\bar { u } _ { 1 }$ nor $\bar { u } _ { 2 }$ depend on it.
450
+
451
+ # 7.6 MEAN FIELD GRADIENT SCALING
452
+
453
+ # Result:
454
+
455
+ 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 } ]$ .
456
+
457
+ # Derivation:
458
+
459
+ We first note that since the $W _ { i j } ^ { l }$ are i.i.d. it follows that,
460
+
461
+ $$
462
+ \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}
463
+ $$
464
+
465
+ 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,
466
+
467
+ $$
468
+ \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 } ) ]
469
+ $$
470
+
471
+ and the result follows.
472
+
473
+ # 7.7 MEAN FIELD BACKPROPAGATION
474
+
475
+ # Result:
476
+
477
+ 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,
478
+
479
+ $$
480
+ \tilde { q } _ { a a } ^ { l } = \tilde { q } _ { a a } ^ { l + 1 } \frac { N _ { l + 1 } } { N _ { l + 2 } } \chi _ { 1 } ( q _ { a a } ^ { l } ) .
481
+ $$
482
+
483
+ # Derivation:
484
+
485
+ Computing the variance directly and using mean field approximation,
486
+
487
+ $$
488
+ \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}
489
+ $$
490
+
491
+ 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.
492
+
493
+ # 7.8 MEAN FIELD GRADIENT COVARIANCE SCALING
494
+
495
+ # Result:
496
+
497
+ In mean field theory we expect the covariance between the gradients of two different inputs to scale as,
498
+
499
+ $$
500
+ \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}
501
+ $$
502
+
503
+ # Derivation:
504
+
505
+ 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
506
+
507
+ $$
508
+ \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}
509
+ $$
510
+
511
+ 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,
512
+
513
+ $$
514
+ \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 } ) ]
515
+ $$
516
+
517
+ and the result follows.
518
+
519
+ # 7.9 MEAN FIELD BACKPROPAGATION OF COVARIANCE
520
+
521
+ # Result:
522
+
523
+ The covariance between the gradients due to two inputs scales as,
524
+
525
+ $$
526
+ \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 } )
527
+ $$
528
+
529
+ under backpropagation.
530
+
531
+ # Derivation
532
+
533
+ As in the analogous derivation for the variance, we compute directly,
534
+
535
+ $$
536
+ \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}
537
+ $$
538
+
539
+ as required.
540
+
541
+ Here we include some more experimental figures that investigate the effects of training time, minimizer, and dataset more closely.
542
+
543
+ ![](images/f92f799cc0a7d6777d5621069f5908cb41a2a8d4fe7047cf7bce009f4b7a4ee4.jpg)
544
+ 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 } }$ .
545
+
546
+ ![](images/bdd7c6274987a163cf2f194a05dae2df2dcbfccbe12c0ecc418ae36a341384d8.jpg)
547
+ 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 }$ .
md/train/H1eqviAqYX/H1eqviAqYX.md ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WHY DO NEURAL RESPONSE GENERATION MODELS PREFER UNIVERSAL REPLIES?
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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).
14
+
15
+ 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.
16
+
17
+ Table 1: Replies and translated version of an example which reveal the different source-target sentence distribution for dialog and translation.
18
+
19
+ <table><tr><td>Query</td><td>I would add Metropolis to the list.</td></tr><tr><td>Replies</td><td>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.</td></tr><tr><td>Translate</td><td>Brigitte cooling off on the set of Metropolis. J&#x27;ajouterais Metropolis ala liste. Je voudrais ajouter Metropolis a la liste.</td></tr></table>
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ # 2 ANALYSIS OF SEQ2SEQ MODELS FOR NRG
26
+
27
+ 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).
28
+
29
+ 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.
30
+
31
+ # 2.1 PROBLEM DECOMPOSITION
32
+
33
+ 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:
34
+
35
+ ![](images/1cea15e9546323fad54b6531ab96375dcbed97d9c7efe4fcc306e99ecabdf3e8.jpg)
36
+ Figure 1: Response Unigram probability distribution in Table 1.
37
+
38
+ $$
39
+ - \log p ( y | x ) = - \log p ( S ( y ) | x ) - \log p ( y | S ( y ) , x )
40
+ $$
41
+
42
+ 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.
43
+
44
+ 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.
45
+
46
+ # 2.2 TARGET WORD SELECTION PROBABILITY
47
+
48
+ 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):
49
+
50
+ $$
51
+ \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}
52
+ $$
53
+
54
+ 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.
55
+
56
+ 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$ :
57
+
58
+ $$
59
+ 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 }
60
+ $$
61
+
62
+ 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
63
+
64
+ 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).
65
+
66
+ 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.
67
+
68
+ # 2.3 WORD ORDERING PROBABILITY
69
+
70
+ # 2.3.1 LEMMAS
71
+
72
+ Before discussing the word ordering probability, we present four lemmas and corresponding proofs.
73
+ Moreover, all these lemmas are only available for the response generation task except Lemma 1.
74
+
75
+ 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:
76
+
77
+ 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.
78
+
79
+ 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$ .
80
+
81
+ 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.
82
+
83
+ 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}$
84
+
85
+ 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.
86
+
87
+ 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.
88
+
89
+ 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}$
90
+
91
+ 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 )$
92
+
93
+ 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.
94
+
95
+ 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:
96
+
97
+ $$
98
+ \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}
99
+ $$
100
+
101
+ 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:
102
+
103
+ $$
104
+ \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}
105
+ $$
106
+
107
+ 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}$ .
108
+
109
+ 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}$ .
110
+
111
+ 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$ .
112
+
113
+ # 2.3.2 DISCUSSION
114
+
115
+ On the basis of Lemma 1, the word ordering probability could be deducted as:
116
+
117
+ $$
118
+ \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}
119
+ $$
120
+
121
+ 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,
122
+
123
+ $$
124
+ \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}
125
+ $$
126
+
127
+ 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:
128
+
129
+ $$
130
+ \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 }
131
+ $$
132
+
133
+ 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.
134
+
135
+ # 2.4 BRIEF SUMMARY
136
+
137
+ 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.
138
+
139
+ # 3 MAX-MARGINAL RANKING REGULARIZATION
140
+
141
+ 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’.
142
+
143
+ 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:
144
+
145
+ $$
146
+ \ell _ { \theta } = - \log p ( y | x ) + \lambda \operatorname* { m a x } \{ 0 , - \log p ( y | x ) + \log p ( y ^ { - } | x ) + \gamma \}
147
+ $$
148
+
149
+ 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$ .
150
+
151
+ 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:
152
+
153
+ $$
154
+ \nabla _ { \boldsymbol { \theta } } \ell _ { \boldsymbol { \theta } } = - \nabla _ { \boldsymbol { \theta } } \log { p ( \boldsymbol { y } | \boldsymbol { x } ) } ,
155
+ $$
156
+
157
+ If $\log p ( y | x ) - \log p ( y ^ { - } | x ) > \gamma$ , then the gradient should be written as:
158
+
159
+ $$
160
+ \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 } ) .
161
+ $$
162
+
163
+ 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.
164
+
165
+ 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.
166
+
167
+ <table><tr><td></td><td># train</td><td># valid</td><td>#test</td></tr><tr><td>QA Pairs</td><td>5,982,868</td><td>315,136</td><td>315,136</td></tr><tr><td>Unique Replies</td><td>4,499,176</td><td>298,723</td><td>287,312</td></tr><tr><td>Multi Replies(%)</td><td>70/24/6</td><td>97/2/1</td><td>96/3/1</td></tr><tr><td>0OV (%)</td><td>.90/.90</td><td>.92/.93</td><td>.91/.92</td></tr><tr><td>Vocab Size</td><td></td><td>29241/27859</td><td></td></tr></table>
168
+
169
+ # 4 EXPERIMENTAL STUDIES
170
+
171
+ 4.1 EXPERIMENTAL SETUPS
172
+
173
+ # 4.1.1 DATASET DESCRIPTION
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ # 4.1.2 BASELINE MODELS
180
+
181
+ To validate the performance of the proposed model, the following baselines were considered:
182
+
183
+ • S2SA: The basic seq2seq model with attention mechanism (Bahdanau et al., 2015) at the target output side.
184
+ • $\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.
185
+ • 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.
186
+ • Ranking- $\mathbf { \nabla \cdot R e g + M M I }$ : Ranking-Reg with MMI during inference procedure.
187
+
188
+ # 4.1.3 EVALUATION METRICS
189
+
190
+ 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).
191
+
192
+ 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):
193
+
194
+ Table 3: Summarized results of testing set with metrics: Human Label, ROGUE-1, ROGUE-L, Distinct-1, Distinct-2 and PPL.
195
+
196
+ <table><tr><td rowspan="2">Methods</td><td colspan="3">Human Label</td><td colspan="2">ROUGE</td><td colspan="2">Distinct</td><td rowspan="2">PPL</td></tr><tr><td>0</td><td>1</td><td>2</td><td>ROUGE-1</td><td>ROUGE-L</td><td>1</td><td>2</td></tr><tr><td>S2SA</td><td>52.46%</td><td>20.52%</td><td>27.02%</td><td>4.97%</td><td>3.13%</td><td>.129</td><td>.285</td><td>110.0</td></tr><tr><td>S2SA +MMI</td><td>51.88%</td><td>19.92%</td><td>28.20%</td><td>3.96%</td><td>2.77%</td><td>.140</td><td>.312</td><td>110.0</td></tr><tr><td>Rank-Reg</td><td>48.20%</td><td>15.38%</td><td>36.42%</td><td>3.45%</td><td>2.55%</td><td>.163</td><td>.358</td><td>85.6</td></tr><tr><td>Rank-Reg + MMI</td><td>47.40%</td><td>18.75%</td><td>33.85%</td><td>3.43%</td><td>2.63%</td><td>.167</td><td>.345</td><td>85.6</td></tr></table>
197
+
198
+ 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).
199
+
200
+ 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”.
201
+
202
+ 2: The response is not only relevant and natural, but also informative and interesting.
203
+
204
+ # 4.1.4 TRAINING PROCEDURES
205
+
206
+ 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.
207
+
208
+ ![](images/8fc8b06cd702efa66c2b2fe0e5839270ac4fee6a86624247e865d2e86d2c501a.jpg)
209
+ Figure 2: Learning curve for the two models.
210
+
211
+ 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.
212
+
213
+ 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.
214
+
215
+ # 4.2 RESULTS AND ANALYSIS
216
+
217
+ # 4.2.1 EXPERIMENTAL RESULTS.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ University are far away, and the city's most famous commercial street are near to me.Query:
224
+
225
+ # Replies from $\mathbf { S } 2 \mathbf { S } + .$ Attention:
226
+
227
+ # Replies from Ranking Loss :
228
+
229
+ 1) Where is your home?
230
+ 2) Where is your city?
231
+ 3) Where is your location?
232
+ 4) Where is your hometown?
233
+ 5) Where is your city, hn?
234
+ 6) Where is your location?
235
+ 7) Where is your home, mine
236
+ 1) Joy City Shopping mall?
237
+ 2) Is shopping mall?
238
+ 3) Joy City Shopping mall!
239
+ 4) Where is your location?
240
+ 5) Where?
241
+ 6) Near that <unk> road.
242
+ 7) That Joy City shopping mall is great.
243
+
244
+ ![](images/3b2e47389a847a796095a8c79881c02c38f1920d30519ec9896cad5bc3effa78.jpg)
245
+
246
+ Most Banks are not reliable.Query:
247
+
248
+ # Replies from $\mathbf { S } 2 \mathbf { S } +$ Attention:
249
+
250
+ # Replies from Ranking Loss :
251
+
252
+ ![](images/e8da83c5892a411d243219eeb0836a90fd8fd134b0a5e006851e31825d17e2cd.jpg)
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ # 4.2.2 RANKING LOSS FOR GENERIC RESPONSES.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ 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.
266
+
267
+ # 5 RELATED WORK
268
+
269
+ 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).
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ # 6 CONCLUSION
276
+
277
+ 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.
278
+
279
+ # REFERENCES
280
+
281
+ Shivani Agarwal and Michael Collins. Maximum margin ranking algorithms for information retrieval. In Proc. of ECIR, pp. 332–343, 2010.
282
+
283
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015.
284
+
285
+ Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. ISBN 0521833787.
286
+
287
+ 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.
288
+
289
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. international conference on learning representations, 2015.
290
+
291
+ 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.
292
+
293
+ 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.
294
+
295
+ 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.
296
+
297
+ Jiwei Li, Will Monroe, and Dan Jurafsky. A simple, fast diverse decoding algorithm for neural generation. CoRR, abs/1611.08562, 2016d.
298
+
299
+ Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Proc. of ACL workshop, volume 8, 2004.
300
+
301
+ Christopher Maning, Prabhaker Raghavan, and Hinrich Schtze. An introduction to information retrieval. 2009.
302
+
303
+ 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.
304
+
305
+ 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.
306
+
307
+ Alan Ritter, Colin Cherry, and William B. Dolan. Data-driven response generation in social media. In Proc. of EMNLP, pp. 583–593, 2011.
308
+
309
+ 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.
310
+
311
+ 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.
312
+
313
+ 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.
314
+
315
+ 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.
316
+
317
+ Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. In Proc. of ACL, pp. 1577–1586, 2015.
318
+
319
+ 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.
320
+
321
+ 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.
322
+
323
+ Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proc. of NIPS, pp. 3104–3112, 2014.
324
+
325
+ Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016.
326
+
327
+ Oriol Vinyals and Quoc V. Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015.
328
+
329
+ Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In Proc. of ICLR, 2016.
330
+
331
+ 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.
332
+
333
+ Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In Proc. of EMNLP, pp. 1296–1306, 2016.
334
+
335
+ Yu Wu, Wei Wu, Zhoujun Li, Can Xu, and Dejian Yang. Neural response generation with dynamic vocabularies. national conference on artificial intelligence, 2018.
336
+
337
+ 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.
338
+
339
+ George Kingsley Zipf. The psychobiology of language. 1935.
340
+
341
+ # A CASES
342
+
343
+ What should I do?Query:
344
+
345
+ # Replies form S2S+Attention:
346
+
347
+ 1) Do nothing.
348
+ 2) Go on.
349
+ 3) Do nothing, hm.
350
+ 4) How?
351
+ 5) Do nothing do nothing.
352
+ 6) Then go ahead.
353
+ 7) So how do you do?
354
+
355
+ # Replies from Ranking Loss :
356
+
357
+ 1) Do nothing.
358
+ 2) Do nothing.
359
+ 3) Go to sleep.
360
+ 4) Don’t worry.
361
+ 5) You should keep on.
362
+ 6) Then go ahead.
363
+ 7) Keep finding.
364
+
365
+ How about the salary?Query:
366
+
367
+ # Replies from S2S+Attention:
368
+
369
+ 1) negotiable
370
+ 2) Salary negotiable.
371
+ 3) Salary negotiable.
372
+ 4) Salary negotiable!
373
+ 5) Salary and payment negotiable.
374
+ 6) Payment is nice.
375
+ 7) Payment is nice, and salary negotiable.
376
+
377
+ # Replies from Ranking Loss :
378
+
379
+ 1) Salary negotiable.
380
+ 2) Salary negotiable.
381
+ 3) High salary.
382
+ 4) Basic salary and plus
383
+ 5) Salary negotiable!
384
+ 6) Salary and payment negotiable.
385
+ 7) Payment is nice, send your CV.
386
+
387
+ I’m 23, why I’m still in growth?Query:
388
+
389
+ # Replies from S2S+Attention:
390
+
391
+ 1) 23
392
+ 2) 22.
393
+ 3) 21.
394
+ 4) 20.
395
+ 5) 25.
396
+ 6) 23 years old.
397
+ 7) 22 years old.
398
+
399
+ # Replies from Ranking Loss :
400
+
401
+ 1) 23.
402
+ 2) 23.
403
+ 3) just 23.
404
+ 4) just 22.
405
+ 5) 23 years old are not
406
+ 6) 23 years old are not old
407
+ 7) 23 years old are not old!
408
+
409
+ Where are you graduate?Query:
410
+
411
+ # Replies from S2S+Attention:
412
+
413
+ 1) Xi’an.
414
+ 2) Wuhan.
415
+ 3) <unk>.
416
+ 4) Nanjing.
417
+ 5) Junior.
418
+ 6) In Junior.
419
+ 7) In junior junior Shanghai.
420
+
421
+ # Replies from Ranking Loss :
422
+
423
+ 1) Peking.
424
+ 2) Chengdu.
425
+ 3) Xi’an.
426
+ 4) In Chengdu.
427
+ 5) I study in Chengdu.
428
+ 6) I study in Shanghai.
429
+ 7) I study in Beijing.
430
+
431
+ My child is born.Query:
432
+
433
+ # Replies from S2S+Attention:
434
+
435
+ # Replies from Ranking Loss :
436
+
437
+ 1) <unk>.
438
+ 2) born.
439
+ 3) born baby.
440
+ 4) children born.
441
+ 5) born born children.
442
+ 6) born born born children.
443
+ 7) born children born children.
444
+ 1) ok
445
+ 2) Cheers!
446
+ 3) Em.
447
+ 4) ok, born child.
448
+ 5) cheers, congulations!
449
+ 6) born born born children.
450
+ 7) born children born children.
451
+
452
+ 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.
md/train/H1lmhaVtvr/H1lmhaVtvr.md ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DYNAMICAL DISTANCE LEARNING FOR SEMI-SUPERVISED AND UNSUPERVISED SKILL DISCOVERY
2
+
3
+ Kristian Hartikainen∗ University of California, Berkeley University of Oxford
4
+
5
+ Xinyang Geng University of California, Berkeley
6
+
7
+ Tuomas Haarnoja†
8
+ University of California, Berkeley
9
+ Google DeepMind
10
+
11
+ Sergey Levine† University of California, Berkeley
12
+
13
+ # ABSTRACT
14
+
15
+ 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.
16
+
17
+ # 1 INTRODUCTION
18
+
19
+ 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.
20
+
21
+ ![](images/47f0104fb94672688f8075e4e1408411ced19042e07825379df049b062940adf.jpg)
22
+ 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.
23
+
24
+ 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.
25
+
26
+ 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.
27
+
28
+ 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.
29
+
30
+ # 2 RELATED WORK
31
+
32
+ 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
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ # 3 PRELIMINARIES
39
+
40
+ 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
41
+
42
+ $$
43
+ \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] ,
44
+ $$
45
+
46
+ 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.
47
+
48
+ # 4 DYNAMICAL DISTANCE LEARNING
49
+
50
+ 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.
51
+
52
+ # 4.1 DYNAMICAL DISTANCE FUNCTIONS
53
+
54
+ 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:
55
+
56
+ $$
57
+ 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] ,
58
+ $$
59
+
60
+ 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$ .
61
+
62
+ # 4.2 DISTANCE EVALUATION
63
+
64
+ 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
65
+
66
+ $$
67
+ \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] .
68
+ $$
69
+
70
+ 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.
71
+
72
+ # 4.3 POLICY IMPROVEMENT
73
+
74
+ 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.
75
+
76
+ 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.
77
+
78
+ ![](images/e9a6ed0cece8d8511f10716fc928dbf9c1345baf3e098e8fd917c3352889a752.jpg)
79
+
80
+ 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:
81
+
82
+ $$
83
+ \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] .
84
+ $$
85
+
86
+ 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.
87
+
88
+ 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.
89
+
90
+ # 4.4 ALGORITHM SUMMARY
91
+
92
+ 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
93
+
94
+ # Algorithm 1 Dynamical Distance Learning
95
+
96
+ 1: Input: φ, ψ . Initial policy and distance parameters
97
+ 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
98
+ 10: $\phi \phi - \dot { \lambda } _ { \pi } \hat { \nabla } \mathcal { L } _ { \pi } ( \phi ; d , \mathbf { g } ) \circ$ . Minimize policy loss
99
+ 11: end for
100
+ 12: until converged
101
+
102
+ 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.
103
+
104
+ # 5 GOAL PROPOSALS
105
+
106
+ 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.
107
+
108
+ 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
109
+
110
+ ![](images/ad3a2c2957db89c38776b94caa2984eebe492828532eba334b8d4af505ff1cd3.jpg)
111
+ 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.
112
+
113
+ left to randomly explore states far from the initial state and this way likely discovering useful states.
114
+ We propose two different strategies for choosing the goals below.
115
+
116
+ # 5.1 SEMI-SUPERVISED LEARNING FROM PREFERENCES
117
+
118
+ 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.
119
+
120
+ 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.
121
+
122
+ # 5.2 UNSUPERVISED EXPLORATION AND SKILL ACQUISITION
123
+
124
+ 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).
125
+
126
+ 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.
127
+
128
+ # 6 EXPERIMENTS
129
+
130
+ 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?
131
+
132
+ 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.
133
+
134
+ 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.
135
+
136
+ # 6.1 VISION-BASED REAL-WORLD MANIPULATION FROM HUMAN PREFERENCES
137
+
138
+ 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.
139
+
140
+ 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
141
+
142
+ ![](images/0e8638fd707890840c834f07574f1f91dee0ea9f7124ec973dd7253b6efddd6f.jpg)
143
+ 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.
144
+
145
+ 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.
146
+
147
+ # 6.2 ABLATIONS, COMPARISONS, AND ANALYSIS
148
+
149
+ 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.
150
+
151
+ ![](images/8cc14e198c178ab985ae1fbee23f574bd912e277d52d63c9b8c36da42d31afb6.jpg)
152
+ 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.
153
+
154
+ 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).
155
+
156
+ ![](images/0b3a0827d435fb404120c1d115f3062e035d2886233bfc9d096b8d61e9c3e894.jpg)
157
+ 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.
158
+
159
+ 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.
160
+
161
+ 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.
162
+
163
+ ![](images/802d9fd3e2568aae649bb0f14a735f9102ce64347008b9a463a07431197fd1e3.jpg)
164
+ 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.
165
+
166
+ # 6.3 ACQUIRING UNSUPERVISED SKILLS
167
+
168
+ 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.
169
+
170
+ # 7 CONCLUSION
171
+
172
+ 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.
173
+
174
+ # ACKNOWLEDGMENTS
175
+
176
+ 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.
177
+
178
+ # REFERENCES
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ 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.
185
+
186
+ 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.
187
+
188
+ Benjamin Eysenbach, Ruslan Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. arXiv preprint arXiv:1906.05253, 2019.
189
+
190
+ Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. In International Conference on Machine Learning (ICML), 2018.
191
+
192
+ 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.
193
+
194
+ S. Fujimoto, H. van Hoof, and D. Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning (ICML), 2018.
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ 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.
201
+
202
+ 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.
203
+
204
+ L. P. Kaelbling, M. L. Littman, and A. W. Moore. Reinforcement learning: A survey. Journal of artificial intelligence research, 4:237–285, 1996.
205
+
206
+ Leslie Pack Kaelbling. Learning to achieve goals. In International Joint Conference on Artificial Intelligence (IJCAI), pp. 1094–1099. Citeseer, 1993.
207
+
208
+ 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.
209
+
210
+ 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.
211
+
212
+ 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.
213
+ 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.
214
+ 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.
215
+ 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.
216
+ 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.
217
+ 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.
218
+ Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference of Learning Representations (ICLR), 2018.
219
+ T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. In International Conference on Machine Learning (ICML), pp. 1312–1320, 2015.
220
+ 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.
221
+ 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.
222
+ David Warde-Farley, Tom Van de Wiele, Tejas Kulkarni, Catalin Ionescu, Steven Hansen, and Volodymyr Mnih. Unsupervised control through non-parametric discriminative rewards. arXiv
223
+
224
+ preprint arXiv:1811.11359, 2018.
225
+
226
+ # Appendices
227
+
228
+ # A CORRECT BEHAVIOR IN THE PATHOLOGICAL MDP
229
+
230
+ 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.
231
+
232
+ 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:
233
+
234
+ $$
235
+ \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] .
236
+ $$
237
+
238
+ 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:
239
+
240
+ $$
241
+ \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] .
242
+ $$
243
+
244
+ 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 } )$ :
245
+
246
+ $$
247
+ \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 } ] ] .
248
+ $$
249
+
250
+ 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
251
+
252
+ $$
253
+ \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}
254
+ $$
255
+
256
+ 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.
257
+
258
+ # B POLICY IMPROVEMENT WHEN USING DISTANCE AS REWARD
259
+
260
+ 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.
261
+
262
+ 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:
263
+
264
+ Theorem 1. Under deterministic dynamics, for any state s and g, we have:
265
+
266
+ 1. $d ^ { \pi ^ { \prime } } ( \mathbf { s } , \mathbf { g } ) \leq d ^ { \pi } ( \mathbf { s } , \mathbf { g } ) .$ .
267
+ 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 } ) .$
268
+
269
+ 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).
270
+
271
+ Proof.
272
+
273
+ 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.
274
+
275
+ 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$ .
276
+
277
+ 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
278
+
279
+ $$
280
+ \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 )
281
+ $$
282
+
283
+ 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.
284
+
285
+ 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.
286
+
287
+ 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 } )$ .
288
+
289
+ $$
290
+ \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}
291
+ $$
292
+
293
+ 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 } )$ .
294
+
295
+ 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.
296
+
297
+ C DIDACTIC EXAMPLE
298
+
299
+ 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.
300
+
301
+ ![](images/0b1a512d4116173ff2294981ff2c4240e5fd3f1a154be461354f90236d4173dd.jpg)
302
+ 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.
303
+
304
+ # D PREFERENCE QUERIES FOR REAL-WORLD DCLAW EXPERIMENT
305
+
306
+ ![](images/1f5b8406ba52b303a00f5db5e76a224ae4a6bbbbe39040a18a95ab863a5b6bfb.jpg)
307
+ 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.
308
+
309
+ # E TECHNICAL DETAILS
310
+
311
+ 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).
312
+
313
+ 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).
314
+
315
+ 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:
316
+
317
+ Table 1: Distance estimator hyperparameters.
318
+
319
+ <table><tr><td>Environment</td><td>gradient steps per environment steps</td><td>on-policy pool size</td></tr><tr><td>InvertedDoublePendulum-v2</td><td>1/64</td><td>100k</td></tr><tr><td>Hopper-v3</td><td>1/64</td><td>16k</td></tr><tr><td>HalfCheetah-v3</td><td>1/16</td><td>16k</td></tr><tr><td>Ant-v3</td><td>1/64</td><td>10k</td></tr><tr><td>DClaw (both state and vision)</td><td>1/16</td><td>100k</td></tr></table>
320
+
321
+ 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.
322
+
323
+ 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).
md/train/H1xaJn05FQ/H1xaJn05FQ.md ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SLICED-WASSERSTEIN AUTO-ENCODERS
2
+
3
+ Soheil Kolouri, Phillip E. Pope, & Charles E. Martin,
4
+
5
+ Gustavo K. Rohde
6
+
7
+ Information and Systems Sciences Laboratory HRL Laboratories, LLC.
8
+ Malibu, CA, USA
9
+ {skolouri,pepope,cemartin}@hrl.com
10
+
11
+ Department of Electrical Engineering University of Virginia Charlottesville, VA, USA gustavo@virginia.edu
12
+
13
+ # ABSTRACT
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 1 NOTATION AND PRELIMINARIES
24
+
25
+ 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:
26
+
27
+ $$
28
+ d \rho _ { X } ( x ) = p _ { X } ( x ) d x
29
+ $$
30
+
31
+ 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:
32
+
33
+ $$
34
+ p _ { Z } ( z ) = \int _ { X } p _ { X } ( x ) \delta ( z - \phi ( x ) ) d x ,
35
+ $$
36
+
37
+ 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
38
+
39
+ $$
40
+ p _ { Y } ( y ) = \int _ { X } p _ { X } ( x ) \delta ( y - \psi ( \phi ( x ) ) ) d x ,
41
+ $$
42
+
43
+ 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.
44
+
45
+ # 1.1 MINIMIZING DISSIMILARITY BETWEEN $p _ { X }$ AND $p _ { Y }$
46
+
47
+ 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).
48
+
49
+ 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.
50
+
51
+ 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):
52
+
53
+ $$
54
+ \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}
55
+ $$
56
+
57
+ 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:
58
+
59
+ $$
60
+ W _ { c } ^ { \ddagger } ( p _ { X } , p _ { Y } ) \approx \frac { 1 } { N } \sum _ { n = 1 } ^ { N } c ( x _ { n } , \psi ( \phi ( x _ { n } ) ) )
61
+ $$
62
+
63
+ 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 }$ .
64
+
65
+ # 1.2 MINIMIZING DISSIMILARITY BETWEEN $p _ { Z }$ AND $q _ { Z }$
66
+
67
+ 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:
68
+
69
+ $$
70
+ s u p _ { \phi } \int _ { X } p _ { X } ( x ) l o g ( q _ { Z } ( \phi ( x ) ) ) d x
71
+ $$
72
+
73
+ 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.
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ # 2 PROPOSED METHOD
82
+
83
+ 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).
84
+
85
+ # 2.1 WASSERSTEIN DISTANCES
86
+
87
+ 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:
88
+
89
+ $$
90
+ 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 )
91
+ $$
92
+
93
+ 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,
94
+
95
+ $$
96
+ 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 ) )
97
+ $$
98
+
99
+ 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:
100
+
101
+ $$
102
+ W _ { c } ( p _ { X } , p _ { Y } ) = m i n _ { f \in M P } \int _ { X } c ( x , f ( x ) ) d \rho _ { X } ( x )
103
+ $$
104
+
105
+ 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):
106
+
107
+ $$
108
+ W _ { c } ( p _ { X } , p _ { Y } ) = \int _ { 0 } ^ { 1 } c ( P _ { X } ^ { - 1 } ( \tau ) , P _ { Y } ^ { - 1 } ( \tau ) ) d \tau ,
109
+ $$
110
+
111
+ This closed-form solution motivates the definition of sliced-Wasserstein distances.
112
+
113
+ # 2.2 SLICED-WASSERSTEIN DISTANCES
114
+
115
+ 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).
116
+
117
+ 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:
118
+
119
+ $$
120
+ \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 }
121
+ $$
122
+
123
+ 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 }$
124
+
125
+ 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:
126
+
127
+ $$
128
+ 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
129
+ $$
130
+
131
+ 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:
132
+
133
+ $$
134
+ S W _ { p } ^ { p } ( p _ { X } , p _ { Y } ) \leq \alpha _ { d , p } W _ { p } ^ { p } ( p _ { X } , p _ { Y } )
135
+ $$
136
+
137
+ 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:
138
+
139
+ $$
140
+ S W _ { 2 } ( p _ { X } , p _ { Y } ) \leq \frac { 1 } { \sqrt { d } } W _ { 2 } ( p _ { X } , p _ { Y } )
141
+ $$
142
+
143
+ In the Numerical Implementation Section, we provide a numerical experiment to compare $W _ { 2 }$ and $S W _ { 2 }$ , that confirms the above equation.
144
+
145
+ # 2.3 SLICED-WASSERSTEIN AUTO-ENCODER (SWAE)
146
+
147
+ Our proposed formulation for the SWAE is as follows:
148
+
149
+ $$
150
+ \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}
151
+ $$
152
+
153
+ 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 }$ .
154
+
155
+ # 3 NUMERICAL IMPLEMENTATION
156
+
157
+ We now describe the numerical details of our approach.
158
+
159
+ # 3.1 NUMERICAL IMPLEMENTATION OF THE WASSERSTEIN DISTANCE IN 1D
160
+
161
+ 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:
162
+
163
+ $$
164
+ 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 ] } )
165
+ $$
166
+
167
+ ![](images/5266c6d524f16b39a9aff45907490862c89a563c87a0039addba6b3f53e17de0.jpg)
168
+ 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).
169
+
170
+ 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).
171
+
172
+ 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):
173
+
174
+ $$
175
+ \mathbb { E } ( W _ { 1 } ( p _ { X } , p _ { Y } ) - W _ { 1 } ( p _ { X , M } , p _ { Y , M } ) ) \leq \frac { C } { \sqrt { M } }
176
+ $$
177
+
178
+ 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 }$ .
179
+
180
+ # 3.2 SLICING EMPIRICAL DISTRIBUTIONS
181
+
182
+ 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:
183
+
184
+ $$
185
+ \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 }
186
+ $$
187
+
188
+ 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 )$ .
189
+
190
+ # 3.3 MINIMIZING SLICED-WASSERSTEIN VIA RANDOM SLICING
191
+
192
+ 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
193
+
194
+ finite-sample average,
195
+
196
+ $$
197
+ 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 } ) )
198
+ $$
199
+
200
+ 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 ) ) )$ .
201
+
202
+ 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
203
+
204
+ ![](images/4791d23632db7a215c95998c6fec92868ca448820cc5b847a1a81ad2422cc4e9.jpg)
205
+ 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$ .
206
+
207
+ 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 }$ .
208
+
209
+ 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 } )$
210
+
211
+ $$
212
+ 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 } } ) ,
213
+ $$
214
+
215
+ 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.
216
+
217
+ # 3.4 PUTTING IT ALL TOGETHER
218
+
219
+ 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:
220
+
221
+ $$
222
+ \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 ] } ) )
223
+ $$
224
+
225
+ 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.
226
+
227
+ # Algorithm 1 Sliced-Wasserstein Auto-Encoder (SWAE)
228
+
229
+ <table><tr><td>Require:Regularization coefficient 入,and number of random projections,L.</td></tr><tr><td>Initialize the parameters of the encoder,Φ,and decoder,</td></tr><tr><td>whileand have not converged do</td></tr><tr><td>Sample{x1,..,xm} from training set(i.e. px)</td></tr><tr><td>Sample{≥1,..,zm} fromqz</td></tr><tr><td>Sample {01,.,} from Sk-1</td></tr><tr><td>Sort0t·zM such that0t· i[m]≤0t·Zi[m+1]</td></tr><tr><td>Sort0t·Φ(xm) such that0t:Φ(xj[m])≤0t·(xj[m+1])</td></tr><tr><td>M</td></tr><tr><td>end while</td></tr></table>
230
+
231
+ # 4 EXPERIMENTS
232
+
233
+ 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).
234
+
235
+ 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.
236
+
237
+ 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 } )$ .
238
+
239
+ ![](images/5e6be26c96cabd0608fd6f39cef37b2fc4837e00b2cd17230bf952c95cf5db93.jpg)
240
+ Figure 5: Interpolation in the latent space, $\psi ( t \phi ( I _ { 0 } ) + ( 1 - t ) \phi ( I _ { 1 } ) )$ for $t \in [ 0 , 1 ]$ .
241
+
242
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Iteration ·10-4</td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>logSW(pz,qz)</td><td rowspan=1 colspan=1>logSW(px,Py)</td><td rowspan=1 colspan=1>NLL(Z|qz)·10</td></tr><tr><td rowspan=12 colspan=1>CelebA</td><td rowspan=4 colspan=1>1</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-0.81±0.05</td><td rowspan=1 colspan=1>-2.19±0.04</td><td rowspan=1 colspan=1>3.14±0.05</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-0.78 ± 0.05</td><td rowspan=1 colspan=1>-2.04±0.05</td><td rowspan=1 colspan=1>3.25 ± 0.15</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-1.44± 0.19</td><td rowspan=1 colspan=1>-2.51 ± 0.05</td><td rowspan=1 colspan=1>3.66±0.12</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.26±0.02</td><td rowspan=1 colspan=1>-2.60±0.02</td><td rowspan=1 colspan=1>2392±89</td></tr><tr><td rowspan=4 colspan=1>5</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-1.80 ±0.03</td><td rowspan=1 colspan=1>-2.63±0.03</td><td rowspan=1 colspan=1>3.22±0.02</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-1.37±0.12</td><td rowspan=1 colspan=1>-2.42±0.05</td><td rowspan=1 colspan=1>3.47±0.13</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-2.15 ±0.02</td><td rowspan=1 colspan=1>-2.86±0.01</td><td rowspan=1 colspan=1>3.51± 0.04</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.28±0.02</td><td rowspan=1 colspan=1>-2.89±0.02</td><td rowspan=1 colspan=1>2469±79</td></tr><tr><td rowspan=4 colspan=1>10</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-2.01 ±0.04</td><td rowspan=1 colspan=1>-2.75 ±0.03</td><td rowspan=1 colspan=1>3.24 ±0.00</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-2.33±0.14</td><td rowspan=1 colspan=1>-2.55 ± 0.06</td><td rowspan=1 colspan=1>3.42 ± 0.04</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-2.23±0.00</td><td rowspan=1 colspan=1>-2.97±0.01</td><td rowspan=1 colspan=1>3.50± 0.01</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.23±0.02</td><td rowspan=1 colspan=1>-2.99±0.02</td><td rowspan=1 colspan=1>2227±88</td></tr><tr><td rowspan=12 colspan=1>LSUNBedroom</td><td rowspan=4 colspan=1>1</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-0.98 ± 0.17</td><td rowspan=1 colspan=1>-1.88 ±0.06</td><td rowspan=1 colspan=1>3.12 ±0.07</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-1.18 ± 0.16</td><td rowspan=1 colspan=1>-1.90±0.07</td><td rowspan=1 colspan=1>3.31±0.16</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-1.72 ±0.07</td><td rowspan=1 colspan=1>-2.13±0.02</td><td rowspan=1 colspan=1>3.61 ±0.04</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.45± 0.02</td><td rowspan=1 colspan=1>-2.16±0.04</td><td rowspan=1 colspan=1>3446±152</td></tr><tr><td rowspan=4 colspan=1>5</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-1.94 ± 0.12</td><td rowspan=1 colspan=1>-2.34 ±0.04</td><td rowspan=1 colspan=1>3.22 ±0.02</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-2.34 ± 0.04</td><td rowspan=1 colspan=1>-2.30 ± 0.04</td><td rowspan=1 colspan=1>3.40±0.08</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-2.21 ±0.02</td><td rowspan=1 colspan=1>-2.47±0.02</td><td rowspan=1 colspan=1>3.48±0.04</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.53±0.03</td><td rowspan=1 colspan=1>-2.47±0.02</td><td rowspan=1 colspan=1>4009±258</td></tr><tr><td rowspan=4 colspan=1>10</td><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>-2.08 ±0.11</td><td rowspan=1 colspan=1>-2.46±0.03</td><td rowspan=1 colspan=1>3.23±0.01</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>-2.49±0.02</td><td rowspan=1 colspan=1>-2.41±0.03</td><td rowspan=1 colspan=1>3.35± 0.05</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>-2.25±0.02</td><td rowspan=1 colspan=1>-2.59±0.02</td><td rowspan=1 colspan=1>3.50±0.01</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>3.48± 0.04</td><td rowspan=1 colspan=1>-2.60±0.02</td><td rowspan=1 colspan=1>3624±282</td></tr></table>
243
+
244
+ 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.
245
+
246
+ 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.
247
+
248
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>FID -CelebA</td><td rowspan=1 colspan=1>FID -LSUN Bedroom</td></tr><tr><td rowspan=1 colspan=1>SWAE</td><td rowspan=1 colspan=1>79±6</td><td rowspan=1 colspan=1>225±7</td></tr><tr><td rowspan=1 colspan=1>WAE-GAN</td><td rowspan=1 colspan=1>53±2</td><td rowspan=1 colspan=1>232±2</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(IMQ)</td><td rowspan=1 colspan=1>55±1</td><td rowspan=1 colspan=1>226±2</td></tr><tr><td rowspan=1 colspan=1>WAE-MMD(RBF)</td><td rowspan=1 colspan=1>363±17</td><td rowspan=1 colspan=1>378±12</td></tr><tr><td rowspan=1 colspan=1>True Data</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td></tr></table>
249
+
250
+ 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.
251
+
252
+ # 5 CONCLUSIONS
253
+
254
+ 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.
255
+
256
+ ![](images/83d849c7d4eb0f5c273451749259784eef2e09c60311c78f5f1f6fde8711cec3.jpg)
257
+ 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 }$ .
258
+
259
+ ![](images/7eab4cbd0a8c3976ee387c8ca0f96c8945d861e231d3c994e1935215bb160160.jpg)
260
+ 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.
261
+
262
+ # REFERENCES
263
+
264
+ Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017.
265
+
266
+ David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
267
+
268
+ Sergey Bobkov and Michel Ledoux. One-dimensional empirical measures, order statistics and kantorovich transport distances. preprint, 2014.
269
+
270
+ 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.
271
+
272
+ Nicolas Bonnotte. Unidimensional and evolution methods for optimal transportation. PhD thesis, Paris 11, 2013.
273
+
274
+ 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.
275
+
276
+ Mathieu Carriere, Marco Cuturi, and Steve Oudot. Sliced wasserstein kernel for persistence diagrams. arXiv preprint arXiv:1706.03358, 2017.
277
+
278
+ Antonia Creswell and Anil Anthony Bharath. Adversarial training for sketch retrieval. In European Conference on Computer Vision, pp. 798–809. Springer, 2016.
279
+
280
+ Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292–2300, 2013.
281
+
282
+ 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.
283
+
284
+ Ishan Deshpande, Ziyu Zhang, and Alexander Schwing. Generative modeling using the sliced wasserstein distance. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
285
+
286
+ 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.
287
+
288
+ Daniel T Gillespie. A theorem for physicists in the theory of random variables. American Journal of Physics, 51(6):520–533, 1983.
289
+
290
+ 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.
291
+
292
+ 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.
293
+
294
+ Sigurdur Helgason. The radon transform on rn. In Integral Geometry and Radon Transforms, pp. 1–62. Springer, 2011.
295
+
296
+ Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint, 2017.
297
+
298
+ 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.
299
+
300
+ Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
301
+
302
+ 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.
303
+
304
+ 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.
305
+
306
+ 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.
307
+
308
+ 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.
309
+
310
+ 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.
311
+
312
+ Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
313
+
314
+ 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.
315
+
316
+ 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.
317
+
318
+ Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
319
+
320
+ Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational Bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
321
+
322
+ 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.
323
+
324
+ 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.
325
+
326
+ Adam M Oberman and Yuanlong Ruan. An efficient linear programming method for optimal transportation. arXiv preprint arXiv:1509.03668, 2015.
327
+
328
+ 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.
329
+
330
+ 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.
331
+
332
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
333
+
334
+ Filippo Santambrogio. Optimal transport for applied mathematicians. Birkäuser, NY, pp. 99–102, 2015.
335
+
336
+ 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.
337
+
338
+ 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.
339
+
340
+ Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. arXiv preprint arXiv:1711.01558, 2017.
341
+
342
+ Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
343
+
344
+ 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.
345
+
346
+ 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.
347
+
348
+ 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.
349
+
350
+ ![](images/e9428ba370cc5219cf8e6d29473c139346dc06ab2c48d3fe482c8f9706f24ef4.jpg)
351
+ 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.
352
+
353
+ # SUPPLEMENTARY MATERIAL
354
+
355
+ COMPARISON OF DIFFERENT DISTANCES
356
+
357
+ 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,
358
+
359
+ $$
360
+ J S ( p , q ) = K L ( p , { \frac { p + q } { 2 } } ) + K L ( q , { \frac { p + q } { 2 } } )
361
+ $$
362
+
363
+ 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.
364
+
365
+ # LOG-LIKELIHOOD
366
+
367
+ To maximize (minimize) the similarity (dissimilarity) between $p _ { Z }$ and $q _ { Z }$ , we can write :
368
+
369
+ $$
370
+ \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}
371
+ $$
372
+
373
+ where we replaced $p _ { Z }$ with equation 1. Furthermore, it is straightforward to show:
374
+
375
+ $$
376
+ \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}
377
+ $$
378
+
379
+ PROOF OF EQUATION 3
380
+
381
+ 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:
382
+
383
+ $$
384
+ 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
385
+ $$
386
+
387
+ 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$ .
388
+
389
+ ![](images/0c587a98a9b2ba0e4e04d80ae51d93adaa98cb6b82f1bdfe164cbcfdc362fb10.jpg)
390
+ 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$ .
391
+
392
+ Therefore we can write:
393
+
394
+ $$
395
+ \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}
396
+ $$
397
+
398
+ which proves equation 3. Finally, taking the infimum of the two sides of the inequality, with respect to $\phi$ and $\psi$ , we have:
399
+
400
+ $$
401
+ \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}
402
+ $$
403
+
404
+ 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 } )$ .
405
+
406
+ # SLICING EMPIRICAL DISTRIBUTIONS
407
+
408
+ Following equation 10 a distribution can be sliced via:
409
+
410
+ $$
411
+ \mathcal { R } p _ { X } ( t , \theta ) = \int _ { X } p _ { X } ( x ) \delta ( t - \theta \cdot x ) d x
412
+ $$
413
+
414
+ 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:
415
+
416
+ $$
417
+ \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}
418
+ $$
419
+
420
+ ![](images/429e9c7831d7ecd943a497fd42137f225d184cf1748e87ec9f6729e01c6451ac.jpg)
421
+ Figure 8: Visualization of the slicing process defined in equation 10
422
+
423
+ ![](images/cabb5ea4b36339a1b5f58e3275886572765e8b0417c6e3618bbf41996510b3f6.jpg)
424
+ Figure 9: Trained SWAE outputs for sample input images with different embedding spaces of size $K = 2$ and $K = 1 2 8$ .
425
+
426
+ DIMENSIONALITY OF THE LATENT SPACE
427
+
428
+ 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.
429
+
430
+ # CALCULATING THE SLICED WASSERSTEIN DISTANCE AS A MEASURE OF GOODNESS OF FIT
431
+
432
+ 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:
433
+
434
+ $$
435
+ \operatorname { a r g m a x } _ { \theta } \quad { \frac { \theta ^ { T } S _ { T } \theta } { \theta ^ { T } ( S _ { W } + \alpha I ) \theta } }
436
+ $$
437
+
438
+ ![](images/94760fa749da093a17f528853e09b8d574db74970245ab6f1cd5e8503ad1ada2.jpg)
439
+ 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.
440
+
441
+ 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).
442
+
443
+ # ERROR ANALYSIS OF WASSERSTEIN DISTANCE
444
+
445
+ For $p \geq 1$ we can use the triangle inequality and write
446
+
447
+ $$
448
+ \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}
449
+ $$
450
+
451
+ which leads to
452
+
453
+ $$
454
+ \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}
455
+ $$
456
+
457
+ 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,
458
+
459
+ $$
460
+ \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}
461
+ $$
462
+
463
+ 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).
464
+
465
+ ![](images/ee6714a1246396876bfdf7e82706671f769b0263c898e7ca94736d5e7cb9441c.jpg)
466
+
467
+ <table><tr><td rowspan=2 colspan=11>WAARJDPPPE 00OT WAARA DPP-PPS 000T(SANN)IISSNAAAAA(SALIIUSSMAA-AAA80ywewvvomzb~z&#x27;xd ~x&#x27;(z)p&#x27;x)ms)b01 zb~z&#x27;Xd ~x&#x27;(z&#x27;(x)Φ)Ms)b0100 0090020200 xd~x&#x27;(x)Φ0 0 ●zb~z26802101210 1 1</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>0000</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=4>:</td><td rowspan=1 colspan=2>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>茶</td></tr><tr><td rowspan=1 colspan=1>rtigen</td><td rowspan=1 colspan=1>o</td><td rowspan=1 colspan=4>MAAAAA</td><td rowspan=1 colspan=2>MAA-MAD</td><td rowspan=1 colspan=1>o</td><td rowspan=1 colspan=1>AAA-AAA</td><td rowspan=1 colspan=1>MAA-MARBBB)</td></tr></table>
468
+
469
+ SWAE provides a superior match between φ(x (i.e. pZ and qZwhile being less computationally expensive a ))
md/train/H38f_9b90BO/H38f_9b90BO.md ADDED
@@ -0,0 +1,604 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TOWARDS ROBUST GRAPH NEURAL NETWORKS AGAINST LABEL NOISE
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ The key contributions of this paper are as follows:
16
+
17
+ • 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.
18
+
19
+ • 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.
20
+
21
+ 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.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ # 2.1 GRAPH NEURAL NETWORKS
26
+
27
+ 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
28
+
29
+ $$
30
+ 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 ) } ) ,
31
+ $$
32
+
33
+ where $h _ { v } ^ { ( k ) }$ is the output for $k$ -th layer of node $v$ , $h _ { v } ^ { ( 0 ) }$ is the input vector of node $v$
34
+
35
+ # 2.2 LABEL PROPAGATION
36
+
37
+ 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.
38
+
39
+ # 2.3 META-LEARNING BASED METHODS AGAINST NOISY LABELS
40
+
41
+ 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.
42
+
43
+ ![](images/88e328481af02f8079b2ba69be71949f441f9d355e551c983965101d2e93aa17.jpg)
44
+ 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.
45
+
46
+ # 3 METHODS
47
+
48
+ # 3.1 PRELIMINARIES
49
+
50
+ 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.
51
+
52
+ # 3.2 LABEL PROPAGATION
53
+
54
+ 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$ :
55
+
56
+ $$
57
+ = \frac { A _ { i , j } } { d ( h _ { i } , h _ { j } ) + \varepsilon } ,
58
+ $$
59
+
60
+ 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$ :
61
+
62
+ $$
63
+ S = D ^ { - 1 / 2 } W D ^ { - 1 / 2 } ,
64
+ $$
65
+
66
+ $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 }$
67
+
68
+ 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:
69
+
70
+ $$
71
+ Y ^ { ( k + 1 ) } = S Y ^ { ( k ) } ,
72
+ $$
73
+
74
+ $$
75
+ y _ { i } ^ { ( k + 1 ) } = y _ { i } ^ { ( 0 ) } , \forall i \in [ s , s + m - 1 ]
76
+ $$
77
+
78
+ 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.
79
+
80
+ 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.
81
+
82
+ # 3.3 META-LEARNING BASED LABEL AGGREGATION
83
+
84
+ ![](images/459eb21005021877ff65bf3593cb8c4eb0cf30cf0af655437c1a8af9d5e2b904.jpg)
85
+ Figure 2: Computation graph of meta-learning based label aggregation.
86
+
87
+ 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.
88
+
89
+ For $\forall ( x _ { j } , y _ { j } ) \in \mathcal { D } _ { l e f t }$ , we can get two loss values:
90
+
91
+ $$
92
+ \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}
93
+ $$
94
+
95
+ 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 }$ :
96
+
97
+ $$
98
+ \overline { { y } } _ { j } = \lambda _ { j } y _ { j } + ( 1 - \lambda _ { j } ) \widetilde { y } _ { j } , \lambda _ { j } \in [ 0 , 1 ]
99
+ $$
100
+
101
+ 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 }$ :
102
+
103
+ $$
104
+ \lambda _ { j } = g ( l _ { 1 } \parallel l _ { 2 } ; \theta ) = \lambda _ { j } ( \theta ; w ) ,
105
+ $$
106
+
107
+ 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$ :
108
+
109
+ $$
110
+ L _ { j } ^ { t r } ( w , \theta ) = l o s s ( \hat { y } _ { j } ( w ) , \overline { { y } } _ { j } ( \theta ) ) ,
111
+ $$
112
+
113
+ Then we can backward on the GNNs:
114
+
115
+ $$
116
+ \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 } } ,
117
+ $$
118
+
119
+ 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 }$
120
+
121
+ $$
122
+ 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 } ) ,
123
+ $$
124
+
125
+ 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:
126
+
127
+ $$
128
+ \theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } } ,
129
+ $$
130
+
131
+ where $\beta$ is the learning rate of aggregation network. Finally, GNNs’ weights can be updated:
132
+
133
+ $$
134
+ 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 } } .
135
+ $$
136
+
137
+ 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.
138
+
139
+ # 3.4 CONVERGENCE OF LPM
140
+
141
+ 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.
142
+
143
+ 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,
144
+
145
+ $$
146
+ \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 } } ) .
147
+ $$
148
+
149
+ Theorem 2 Under the conditions of Theorem $^ { l }$ , with the gradient of loss bounded by $\rho$ , then
150
+
151
+ $$
152
+ \operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } , \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 .
153
+ $$
154
+
155
+ Algorithm 1: LPM. Line 2-12: label propagation; Line 13-22: label aggregation.
156
+ 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
157
+ $\mathcal { X }$ ,GNNs feature extractor $f$ , Aggregation Network $g$ , expanding clean set for LP $\cdot$
158
+ Result: Robust GNNs parameters $w _ { T }$
159
+ 1 Dc = Dclean
160
+ 2 for $t = 0 , 1 , 2 , . . . , T - 1$ do
161
+ 3 for $\forall v \in \mathcal { D }$ do $h _ { v } = f ( x _ { v } ; w _ { t } )$ ;
162
+ 4 for (i, j) ∈ {1, 2, ..., n}2 do Wi,j = Ai,jd(hi,hj )+ε ;
163
+ 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$
164
+ 7 end
165
+ 8 $\mathcal { D } _ { s e l e c t } = \mathcal { D } _ { l e f t } = \emptyset$ ;
166
+ 9 for ∀ node $i \in \mathcal { D } _ { t r a i n }$ do
167
+ 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 }$ ;
168
+ 11 else do $\mathcal { D } _ { l e f t } = \mathrm { n o d }$ e $\{ i \} \cup \mathcal { D } _ { l e f t }$ ;
169
+ 12 end
170
+ 13 $-$
171
+ 14 $w _ { t } \gets$ one-step optimization of $w _ { t }$ with the selected nodes $\mathcal { D } _ { s e l e c t }$ ;
172
+ 15 for $\forall$ node $j \in \mathcal { D } _ { l e f t }$ do
173
+ 16 $\hat { y } _ { j } = f ( x _ { j } ; w _ { t } )$ ;
174
+ 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 } ) ;$ ;
175
+ 18 $\lambda _ { j } = g ( l _ { 1 } \parallel \bar { l } _ { 2 } ; \bar { \theta } _ { t } )$ ;
176
+ 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 ) ) ;$
177
+ 20 end
178
+ 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}$
179
+ 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 ;
180
+ 23 $\theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } ( \theta ) ) | _ { \theta _ { t } }$ ;
181
+ 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}$
182
+
183
+ 25 end
184
+
185
+ # 4 EXPERIMENTS
186
+
187
+ # 4.1 DATASETS AND IMPLEMENTATION DETAILS
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ 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:
194
+
195
+ Table 1: Dataset statistics after removing self-loops and duplicate edges (Wang & Leskovec, 2020)
196
+
197
+ <table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Coauthor-Phy</td></tr><tr><td>#nodes</td><td>2708</td><td>3327</td><td>19717</td><td>34493</td></tr><tr><td>#edges</td><td>5278</td><td>4552</td><td>44324</td><td>247962</td></tr><tr><td>#features</td><td>1433</td><td>3703</td><td>500</td><td>8415</td></tr><tr><td>#classes</td><td>7</td><td>6</td><td>3</td><td>5</td></tr><tr><td>#Intra-class edge rate</td><td>81.0%</td><td>73.6%</td><td>80.2%</td><td>93.1%</td></tr></table>
198
+
199
+ 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.
200
+
201
+ <table><tr><td>Datasets</td><td colspan="5">Cora</td><td colspan="5">Citeseer</td></tr><tr><td>Method/noise rate</td><td>0.0</td><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td><td>0.0</td><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td></tr><tr><td>Basemodel</td><td>87.84 (0.04)</td><td>85.92 (0.10)</td><td>82.42 (0.13)</td><td>75.77 (0.18)</td><td>56.32 (0.19)</td><td>77.67 (0.13)</td><td>76.06 (0.15)</td><td>72.97 (0.09)</td><td>67.98 (0.12)</td><td>55.26 (0.22)</td></tr><tr><td>GCN+FT</td><td>88.05 (0.06)</td><td>86.07 (0.13)</td><td>82.48 (0.14)</td><td>75.88 (0.15)</td><td>58.81(0.22)</td><td>77.86 (0.15)</td><td>76.24 (0.07)</td><td>73.42 (0.21)</td><td>68.13 (0.19)</td><td>56.12 (0.28)</td></tr><tr><td>L2RW</td><td>88.84 (0.19)</td><td>85.10 (0.21)</td><td>80.67 (0.22)</td><td>73.43 (0.42)</td><td>50.09 (0.37)</td><td>76.73 (0.20)</td><td>73.68 (0.14)</td><td>69.93 (0.29)</td><td>62.31(0.32)</td><td>46.55 (0.49)</td></tr><tr><td>Co-teaching plus + FT</td><td>86.76 (0.14)</td><td>83.03 (0.19)</td><td>71.68 (0.21)</td><td>50.05 (0.31)</td><td>36.39 (0.44)</td><td>76.28 (0.19)</td><td>75.49 (0.24)</td><td>72.71 (0.13)</td><td>66.63 (0.41)</td><td>56.27 (0.36)</td></tr><tr><td>MW-Nets</td><td>88.33 (0.16)</td><td>85.93 (0.22)</td><td>82.61 (0.45)</td><td>75.60 (0.41)</td><td>56.37 (0.51)</td><td>78.27 (0.12)</td><td>76.62 (0.14)</td><td>74.25 (0.21)</td><td>68.06 (0.25)</td><td>56.53 (0.45)</td></tr><tr><td>GCEloss+FT</td><td>87.87 (0.13)</td><td>85.10 (0.09)</td><td>82.89 (0.07)</td><td>76.16 (0.15)</td><td>60.43 (0.21)</td><td>78.01 (0.12)</td><td>76.54 (0.09)</td><td>74.06 (0.18)</td><td>69.18 (0.24)</td><td>58.48 (0.31)</td></tr><tr><td>APL+FT</td><td>87.68 (0.08)</td><td>86.26 (0.05)</td><td>82.01 (0.13)</td><td>74.49 (0.19)</td><td>58.72 (0.25)</td><td>76.54 (0.08)</td><td>74.32 (0.17)</td><td>71.77 (0.15)</td><td>66.78 (0.22)</td><td>56.08 (0.34)</td></tr><tr><td>Ours</td><td>88.75 (0.07)</td><td>87.46 (0.11)</td><td>83.95 (0.15)</td><td>79.66 (0.22)</td><td>63.38 (0.27)</td><td>78.12 (0.13)</td><td>77.07 (0.06)</td><td>75.19 (0.15)</td><td>70.05 (0.11)</td><td>61.71 (0.22)</td></tr></table>
202
+
203
+ 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.
204
+
205
+ # 4.2 RESULTS
206
+
207
+ 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.
208
+
209
+ 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.
210
+
211
+ <table><tr><td>Datasets</td><td colspan="3">Cora</td><td colspan="3">Citeseer</td><td colspan="3">Pubmed</td></tr><tr><td>Method/noise rate</td><td>0</td><td>0.2</td><td>0.4</td><td>0</td><td>0.2</td><td>0.4</td><td>0</td><td>0.2</td><td>0.4</td></tr><tr><td>Basemodel</td><td>87.84 (0.04)</td><td>81.64 (0.11)</td><td>61.12 (0.24)</td><td>77.67 (0.13)</td><td>75.91 (0.14)</td><td>52.67 (0.35)</td><td>86.18 (0.08)</td><td>85.30 (0.21)</td><td>74.21 (0.29)</td></tr><tr><td>GCN+FT</td><td>88.05 (0.06)</td><td>82.89 (0.14)</td><td>67.39 (0.42)</td><td>77.86 (0.15)</td><td>75.08 (0.22)</td><td>61.41 (0.23)</td><td>86.21 (0.09)</td><td>85.55 (0.24)</td><td>80.88 (0.32)</td></tr><tr><td>L2RW</td><td>88.84 (0.19)</td><td>80.90 (0.21)</td><td>59.00 (0.34)</td><td>76.73 (0.20)</td><td>71.85 (0.25)</td><td>50.04 (0.44)</td><td>86.34 (0.14)</td><td>84.54 (0.19)</td><td>76.97 (0.31)</td></tr><tr><td>Co-teaching plus+FT</td><td>86.76 (0.14)</td><td>81.37 (0.21)</td><td>53.00 (0.51)</td><td>76.28 (0.19)</td><td>74.66 (0.21)</td><td>60.59 (0.33)</td><td>85.59 (0.09)</td><td>84.61 (0.22)</td><td>73.99 (0.33)</td></tr><tr><td>MW-Nets</td><td>88.33 (0.16)</td><td>85.33 (0.23)</td><td>67.71 (0.43)</td><td>78.27 (0.12)</td><td>76.84 (0.19)</td><td>61.97 (0.33)</td><td>86.02 (0.07)</td><td>84.74 (0.17)</td><td>78.59 (0.28)</td></tr><tr><td>GCEloss+FT</td><td>87.87 (0.13)</td><td>83.21 (0.13)</td><td>67.80 (0.37)</td><td>78.01 (0.12)</td><td>76.36 (0.20)</td><td>63.66 (0.46)</td><td>86.15 (0.11)</td><td>85.47 (0.06)</td><td>80.03 (0.42)</td></tr><tr><td>APL+FT</td><td>87.68 (0.08)</td><td>81.09 (0.14)</td><td>70.07 (0.19)</td><td>76.54 (0.08)</td><td>73.38 (0.13)</td><td>60.81 (0.52)</td><td>86.16 (0.05)</td><td>85.52 (0.06)</td><td>70.08 (0.16)</td></tr><tr><td>Ours</td><td>88.75 (0.07)</td><td>86.95 (0.12)</td><td>78.97 (0.33)</td><td>78.12 (0.13)</td><td>76.39 (0.14)</td><td>69.71 (0.39)</td><td>86.48 (0.05)</td><td>85.58 (0.13)</td><td>83.15 (0.36)</td></tr></table>
212
+
213
+ 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.
214
+
215
+ <table><tr><td>Methods</td><td>Basemodel</td><td>GCN+FT</td><td>L2RW</td><td>MW-Nets</td><td>GCEloss+FT</td><td>JoCoR+FT</td><td>Ours</td></tr><tr><td>Clothing1M</td><td>35.83±0.03</td><td>38.05±0.13</td><td>53.5±0.08</td><td>54.15±0.23</td><td>56.9±0.08</td><td>56.3±0.12</td><td>57.35±0.11</td></tr><tr><td>Webvision</td><td>32.43±0.05</td><td>34.58±0.08</td><td>50.12±0.16</td><td>52.42±0.25</td><td>53.45±0.13</td><td>54.12±0.22</td><td>55.43±0.17</td></tr></table>
216
+
217
+ ![](images/08f88f4348654662facdd2e5ddebef946582e909d05aae0475024c1ae7459de1.jpg)
218
+ 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.
219
+
220
+ Table 5: The performance of LPM without label aggregation and LPM with random $\lambda$ in Citeseer.
221
+
222
+ <table><tr><td>Noise type</td><td colspan="5">Uniform noise</td><td colspan="2">Flip noise</td></tr><tr><td>Method/noise rate</td><td>0</td><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td><td>0.2</td><td>0.4</td></tr><tr><td>Ours w/o label aggregation</td><td>72.07</td><td>68.36</td><td>65.69</td><td>62.16</td><td>54.39</td><td>69.26</td><td>63.14</td></tr><tr><td>Ours with random 入</td><td>76.88</td><td>75.08</td><td>72.07</td><td>68.28</td><td>57.40</td><td>74.89</td><td>68.30</td></tr><tr><td> Ours with tuned 入</td><td>77.22</td><td>76.31</td><td>73.55</td><td>69.17</td><td>58.54</td><td>75.11</td><td>68.72</td></tr><tr><td>Ours</td><td>78.12</td><td>77.07</td><td>75.19</td><td>70.05</td><td>61.71</td><td>76.39</td><td>69.71</td></tr></table>
223
+
224
+ # 4.3 ANALYSIS OF THE NECESSITY AND EFFECTIVENESS OF DIFFERENT PARTS
225
+
226
+ 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.
227
+
228
+ ![](images/03d0ba0eeaf7908606d67d6994c9e324d3478aaaa12f68fe51a7639ae44eb405.jpg)
229
+ Figure 4: $\Delta \lambda$ varies during the training stage on Cora with various uniform noise rate.
230
+
231
+ ![](images/018150531e5b3cc45a63032fb743dfbc7c5e2fde9850f52237b079339ae5ce1d.jpg)
232
+ Figure 5: Test accuracy on Cora and Citeseer across various flip noise rate.
233
+
234
+ # 4.4 IMPACT OF FINETUNING AND NOISE RATE
235
+
236
+ 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.
237
+
238
+ # 4.5 SIZE OF THE CLEAN SET
239
+
240
+ 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.
241
+
242
+ ![](images/8e987b26205d135963820007bc9f624c5916d6a9b90e8d4260014e400b707c59.jpg)
243
+ Figure 6: Test accuracy on Cora and Citeseer across various size of clean set.
244
+
245
+ # 5 CONCLUSION AND FUTURE WORK
246
+
247
+ 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.
248
+
249
+ # REFERENCES
250
+
251
+ 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.
252
+
253
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
254
+
255
+ Luca Franceschi, Mathias Niepert, Massimiliano Pontil, and Xiao He. Learning discrete structures for graph neural networks. arXiv preprint arXiv:1903.11960, 2019.
256
+
257
+ 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.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ 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.
266
+
267
+ 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.
268
+
269
+ Simon Jenni and Paolo Favaro. Deep bilevel learning. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 618–633, 2018.
270
+
271
+ Masayuki Karasuyama and Hiroshi Mamitsuka. Manifold-based similarity adaptation for label propagation. In Advances in neural information processing systems, pp. 1547–1555, 2013.
272
+
273
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
274
+
275
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
276
+
277
+ 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.
278
+
279
+ 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.
280
+
281
+ 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.
282
+
283
+ 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.
284
+
285
+ 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.
286
+
287
+ 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.
288
+
289
+ 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.
290
+
291
+ Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018.
292
+
293
+ 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.
294
+
295
+ Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
296
+
297
+ 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.
298
+
299
+ Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv: Machine Learning, 2017.
300
+
301
+ Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
302
+
303
+ Fei Wang and Changshui Zhang. Label propagation through linear neighborhoods. IEEE Transactions on Knowledge and Data Engineering, 20(1):55–67, 2007.
304
+
305
+ Hongwei Wang and Jure Leskovec. Unifying graph convolutional neural networks and label propagation. arXiv preprint arXiv:2002.06755, 2020.
306
+
307
+ 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.
308
+
309
+ Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. pp. 2691–2699, 2015.
310
+
311
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
312
+
313
+ 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.
314
+
315
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016a.
316
+
317
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016b.
318
+
319
+ 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.
320
+
321
+ 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.
322
+
323
+ 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.
324
+
325
+ Xiaojin Zhu, John Lafferty, and Ronald Rosenfeld. Semi-supervised learning with graphs. PhD thesis, Carnegie Mellon University, language technologies institute, school of . . . , 2005.
326
+
327
+ # A APPENDIX : ADDITIONAL EXPERIMENT RESULTS
328
+
329
+ 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.
330
+
331
+ <table><tr><td>Datasets</td><td colspan="3">Cora</td><td colspan="3">Pubmed</td></tr><tr><td>Methods/Noise rate</td><td>0</td><td>0.2</td><td>0.4</td><td>0</td><td>0.2</td><td>0.4</td></tr><tr><td>GAT</td><td>89.85</td><td>84.13</td><td>67.10</td><td>85.55</td><td>84.57</td><td>74.11</td></tr><tr><td>GAT+FT</td><td>89.85</td><td>84.50</td><td>73.12</td><td>85.55</td><td>84.57</td><td>80.55</td></tr><tr><td>MW-Nets</td><td>87.52</td><td>84.26</td><td>69.99</td><td>85.64</td><td>84.5</td><td>75.82</td></tr><tr><td>Co-teaching plus+FT</td><td>88.56</td><td>85.42</td><td>74.94</td><td>85.56</td><td>84.48</td><td>82.40</td></tr><tr><td>GCEloss+FT</td><td>89.98</td><td>84.38</td><td>74.23</td><td>85.45</td><td>84.54</td><td>80.65</td></tr><tr><td>JoCoR+FT</td><td>90.16</td><td>85.00</td><td>73.74</td><td>85.47</td><td>84.58</td><td>80.95</td></tr><tr><td>Ours</td><td>89.92</td><td>87.20</td><td>75.65</td><td>85.72</td><td>84.62</td><td>83.00</td></tr></table>
332
+
333
+ 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.
334
+
335
+ <table><tr><td>Method/Noise rate</td><td>0.0</td><td>0.1</td><td>0.2</td><td>0.3</td><td>0.4</td></tr><tr><td>Basemodel</td><td>96.92</td><td>96.32</td><td>95.57</td><td>94.91</td><td>86.25</td></tr><tr><td>GCN+FT</td><td>96.96</td><td>96.41</td><td>95.54</td><td>94.46</td><td>92.25</td></tr><tr><td>Co-teaching plus+FT</td><td>96.45</td><td>96.39</td><td>96.10</td><td>95.27</td><td>92.79</td></tr><tr><td>MW-Nets</td><td>96.56</td><td>96.24</td><td>95.62</td><td>95.56</td><td>89.25</td></tr><tr><td>GCEloss+FT</td><td>96.99</td><td>96.58</td><td>95.96</td><td>94.77</td><td>93.64</td></tr><tr><td>JoCoR+FT</td><td>96.83</td><td>96.59</td><td>96.07</td><td>94.95</td><td>94.11</td></tr><tr><td>Ours</td><td>96.75</td><td>96.71</td><td>96.49</td><td>96.14</td><td>95.14</td></tr></table>
336
+
337
+ 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.
338
+
339
+ # B APPENDIX : ADDITIONAL DETAILS OF OUR EXPERIMENTS
340
+
341
+ 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.
342
+
343
+ 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).
344
+
345
+ Table A.8: The hyper-parameters of LPM in different datasets.
346
+
347
+ <table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Coauthor-Phy</td><td>Clothing1M</td></tr><tr><td>Aggregation Net&#x27;s learning rate</td><td>1×10-4</td><td>1×10-4</td><td>1×10-3</td><td>1×10-3</td><td>1×10-3</td></tr><tr><td>Aggregation Net&#x27;s mid-dimension</td><td>64</td><td>100</td><td>100</td><td>64</td><td>50</td></tr><tr><td>Aggregation Net&#x27;s weight decay</td><td>1×10-4</td><td>1×10-4</td><td>1×10-4</td><td>1×10-4</td><td>1×10-4</td></tr><tr><td>LPA iterations</td><td>50</td><td>50</td><td>50</td><td>50</td><td>50</td></tr></table>
348
+
349
+ ![](images/c0bf9ddecf3cf4ad60d9d9ff6ece4751d478fb438d0d72bc491040f95d3ac0c3.jpg)
350
+ 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.
351
+
352
+ # C APPENDIX : CONVERGENCE OF LPM
353
+
354
+ 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:
355
+
356
+ $$
357
+ \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}
358
+ $$
359
+
360
+ $$
361
+ \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}
362
+ $$
363
+
364
+ $( x _ { j } , y _ { j } )$ is node from the final left training set $\mathcal { D } _ { l e f t }$
365
+
366
+ $( x _ { i } , y _ { i } )$ is node from the final clean set $\mathcal { D } _ { c l e a n }$ ;
367
+
368
+ $f$ is the GCN for classification with its weights $w$ ;
369
+ $g$ is the Aggregation Net whose input are the nodes from clean set with its weights $\theta$ ;
370
+ $L ^ { c }$ is the loss on clean sets. $L ^ { t r }$ is the final training loss.
371
+
372
+ $l ( y , \hat { y } )$ is the loss (such as Cross Entropy) which satisfies linearity given by
373
+
374
+ $$
375
+ l ( \lambda y _ { 1 } + ( 1 - \lambda ) y _ { 2 } , \hat { y } ) = \lambda l ( y _ { 1 } , \hat { y } ) + ( 1 - \lambda ) l ( y _ { 2 } , \hat { y } ) .
376
+ $$
377
+
378
+ # Derivation of the equation of updating the weights in Aggregation Net
379
+
380
+ $$
381
+ \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 } } .
382
+ $$
383
+
384
+ According to Equation (20)
385
+
386
+ $$
387
+ \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}
388
+ $$
389
+
390
+ Therefore, Equation (25) can be written as
391
+
392
+ $$
393
+ \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}
394
+ $$
395
+
396
+ where
397
+
398
+ 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.
399
+
400
+ Proof. The supposition is equivalent to the following inequalities,
401
+
402
+ $$
403
+ \| \nabla _ { \hat { w } } L ^ { c } ( \hat { w } ) | _ { w _ { 1 } } - \nabla _ { \hat { w } } L ^ { c } ( \hat { w } ) | _ { w _ { 2 } } \| \leq L \| w _ { 1 } - w _ { 2 } \| ,
404
+ $$
405
+
406
+ for any $w _ { 1 } , w _ { 2 }$ ;
407
+
408
+ $$
409
+ \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}
410
+ $$
411
+
412
+ The gradient of $\theta$ with respect to loss on clean set reads
413
+
414
+ $$
415
+ \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}
416
+ $$
417
+
418
+ Taking the gradient of $\theta$ in both sides of the equation, we have
419
+
420
+ $$
421
+ \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 } } ) .
422
+ $$
423
+
424
+ For the first term in summation,
425
+
426
+ $$
427
+ \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}
428
+ $$
429
+
430
+ And for the second term,
431
+
432
+ $$
433
+ \| ( 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 } .
434
+ $$
435
+
436
+ Therefore,
437
+
438
+ $$
439
+ \| \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 } .
440
+ $$
441
+
442
+ Let $L _ { v } = 4 \alpha ^ { 2 } L \rho ^ { 2 } \delta ^ { 2 } + 2 \alpha \rho ^ { 2 } \beta$ ,Based on Lagrange mean value theorem, we have
443
+
444
+ $$
445
+ \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 ,
446
+ $$
447
+
448
+ for all $\theta _ { 1 } , \theta _ { 2 }$
449
+
450
+ 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,
451
+
452
+ $$
453
+ \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 } } ) .
454
+ $$
455
+
456
+ Proof. The iteration for updating the parameter $\theta$ reads
457
+
458
+ $$
459
+ \theta _ { t + 1 } = \theta _ { t } - \beta \nabla _ { \theta } L ^ { c } ( \hat { w } _ { t } ( \theta ) ) | _ { \theta _ { t } } .
460
+ $$
461
+
462
+ In two successive iteration, observe that
463
+
464
+ $$
465
+ \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}
466
+ $$
467
+
468
+ For the first term, given that loss function on clean set is Lipschitz smooth, we have
469
+
470
+ $$
471
+ \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}
472
+ $$
473
+
474
+ According to Equation (20) and (23),
475
+
476
+ $$
477
+ \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 } } ,
478
+ $$
479
+
480
+ and thus,
481
+
482
+ $$
483
+ \| 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 } ,
484
+ $$
485
+
486
+ since the first gradient of loss function is bounded by $\rho$
487
+
488
+ By the Lipschitz continuity of $L ^ { c } ( \hat { w } _ { t } ( \theta ) )$ according to Lemma 1., it can be obtained that
489
+
490
+ $$
491
+ \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}
492
+ $$
493
+
494
+ Therefore, the Equation (32) satisfies
495
+
496
+ $$
497
+ \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}
498
+ $$
499
+
500
+ Summing up above inequalities from 1 to $T$ , we have
501
+
502
+ $$
503
+ \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}
504
+ $$
505
+
506
+ Furthermore,
507
+
508
+ $$
509
+ \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}
510
+ $$
511
+
512
+ 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.
513
+
514
+ 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.
515
+
516
+ Proof. See the proof of Lemma A.5 in [Stochastic majorization-minimization algorithms for ].
517
+
518
+ 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
519
+
520
+ $$
521
+ \operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 .
522
+ $$
523
+
524
+ 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
525
+
526
+ $$
527
+ \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}
528
+ $$
529
+
530
+ First, we have the difference of the loss function on training set between two iterations,
531
+
532
+ $$
533
+ \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}
534
+ $$
535
+
536
+ 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,
537
+
538
+ $$
539
+ \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}
540
+ $$
541
+
542
+ For the second term in Eq. 33,
543
+
544
+ $$
545
+ \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}
546
+ $$
547
+
548
+ Therefore, we have
549
+
550
+ $$
551
+ \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}
552
+ $$
553
+
554
+ Summing up the inequalities in both sides from $t = 1$ to $\infty$ , we have
555
+
556
+ $$
557
+ \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}
558
+ $$
559
+
560
+ Rearrange the terms of the inequality, we obtain
561
+
562
+ $$
563
+ \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}
564
+ $$
565
+
566
+ 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.
567
+
568
+ In addition, since
569
+
570
+ $$
571
+ \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}
572
+ $$
573
+
574
+ we can obtain that
575
+
576
+ $$
577
+ \sum _ { t = 1 } ^ { \infty } \alpha _ { t } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } \leq \infty .
578
+ $$
579
+
580
+ In the other hand, based on the inequality:
581
+
582
+ $$
583
+ ( \| a \| + \| b \| ) ( \| a \| - \| b \| ) \leq \| a + b \| \| a - b \| ,
584
+ $$
585
+
586
+ we have
587
+
588
+ $$
589
+ \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}
590
+ $$
591
+
592
+ For Eq. 34 which reads
593
+
594
+ $$
595
+ \sum _ { t = 1 } ^ { \infty } \alpha _ { t } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } \leq \infty ,
596
+ $$
597
+
598
+ 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
599
+
600
+ $$
601
+ \operatorname* { l i m } _ { t \to \infty } \| \nabla _ { w _ { t } } L ^ { t r } ( w _ { t } ; \theta _ { t + 1 } ) \| _ { 2 } ^ { 2 } = 0 ,
602
+ $$
603
+
604
+ 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.
md/train/HCSgyPUfeDj/HCSgyPUfeDj.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/HJOQ7MgAW/HJOQ7MgAW.md ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LONG SHORT-TERM MEMORY AS A DYNAMICALLYCOMPUTED ELEMENT-WISE WEIGHTED SUM
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ # 2 THE MEMORY CELL COMPUTES AN ELEMENT-WISE WEIGHTED SUM
18
+
19
+ LSTMs are typically motivated as an augmentation of simple RNNs (S-RNNs), defined as follows:
20
+
21
+ $$
22
+ \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 } )
23
+ $$
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ $$
32
+ \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}
33
+ $$
34
+
35
+ 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.
36
+
37
+ 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 } )$ .
38
+
39
+ 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.
40
+
41
+ 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):
42
+
43
+ $$
44
+ \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}
45
+ $$
46
+
47
+ 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
48
+
49
+ 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.
50
+
51
+ # 3 MEMORY CELLS ARE POWERFUL STANDALONE MODELS
52
+
53
+ 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).
54
+
55
+ # 3.1 SIMPLIFIED MODELS
56
+
57
+ 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).
58
+
59
+ 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:
60
+
61
+ $$
62
+ \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}
63
+ $$
64
+
65
+ 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 )$ :
66
+
67
+ $$
68
+ \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}
69
+ $$
70
+
71
+ After removing the S-RNN and the output gate from the LSTM, the entire ablated model can be written in a modular, compact form:
72
+
73
+ $$
74
+ \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 )
75
+ $$
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ # 3.2 EXPERIMENTS
82
+
83
+ 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
84
+
85
+ # 3.2.1 LANGUAGE MODELING
86
+
87
+ 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.
88
+
89
+ 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.
90
+
91
+ 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.
92
+
93
+ # 3.2.2 QUESTION ANSWERING
94
+
95
+ 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.
96
+
97
+ 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.
98
+
99
+ # 3.2.3 DEPENDENCY PARSING
100
+
101
+ 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.
102
+
103
+ Table 1: The performance of simplified LSTM architectures on language modeling benchmarks, measured by perplexity.
104
+
105
+ <table><tr><td>Configuration</td><td>Model</td><td>Perplexity</td></tr><tr><td rowspan="4">PTB</td><td>LSTM</td><td>83.9 ± 0.3</td></tr><tr><td>- GATES</td><td>140.9</td></tr><tr><td>- S-RNN</td><td>80.5</td></tr><tr><td>- S-RNN-OUT</td><td>81.6</td></tr><tr><td rowspan="4">PTB (Large Model)</td><td>LSTM</td><td>78.8± 0.2</td></tr><tr><td>- GATES</td><td>126.1</td></tr><tr><td>- S-RNN</td><td>76.0</td></tr><tr><td>- S-RNN -OUT</td><td>78.5</td></tr><tr><td rowspan="4">BWB</td><td>LSTM (J6zefowicz et al., 2016)</td><td>47.5</td></tr><tr><td>- GATES</td><td>82.2</td></tr><tr><td>- S-RNN</td><td>45.4</td></tr><tr><td>- S-RNN-OUT</td><td>47.9</td></tr></table>
106
+
107
+ Table 2: The performance of simplified LSTM architectures on the question answering benchmark, SQuAD, measured by exact match (EM) and span overlap (F1).
108
+
109
+ <table><tr><td>System</td><td>Model</td><td>EM</td><td>F1</td></tr><tr><td rowspan="5">BiDAF</td><td>LSTM</td><td>67.9 ± 0.3</td><td>77.5 ± 0.2</td></tr><tr><td>- GATES</td><td>62.9</td><td>73.3</td></tr><tr><td>- S-RNN</td><td>68.4</td><td>78.2</td></tr><tr><td>- S-RNN-OUT</td><td>67.4</td><td>77.2</td></tr><tr><td></td><td></td><td></td></tr><tr><td rowspan="4">DrQA</td><td>LSTM</td><td>68.8 ± 0.2</td><td>78.2 ± 0.2</td></tr><tr><td>- GATES</td><td>56.4</td><td>66.5</td></tr><tr><td>- S-RNN</td><td>67.7</td><td>77.0</td></tr><tr><td>- S-RNN -OUT</td><td>67.0</td><td>76.2</td></tr></table>
110
+
111
+ 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).
112
+
113
+ <table><tr><td>Model</td><td>UAS</td><td>LAS</td></tr><tr><td>LSTM</td><td>90.60 ± 0.21</td><td>88.05 ± 0.33</td></tr><tr><td>- GATES</td><td>87.75</td><td>84.61</td></tr><tr><td>- S-RNN</td><td>90.77</td><td>88.49</td></tr><tr><td>- S-RNN-OUT</td><td>90.70</td><td>88.31</td></tr></table>
114
+
115
+ 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.
116
+
117
+ # 3.2.4 MACHINE TRANSLATION
118
+
119
+ 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
120
+
121
+ <table><tr><td>Model</td><td>BLEU</td></tr><tr><td>LSTM</td><td>35.95</td></tr><tr><td>- GATES</td><td>12.22</td></tr><tr><td>- S-RNN</td><td>36.66</td></tr><tr><td>- S-RNN-OUT</td><td>36.39</td></tr></table>
122
+
123
+ Table 4: The performance of simplified LSTM architectures on the WMT 2016 multi-modal English to German translation benchmark, measured by BLEU.
124
+
125
+ 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.
126
+
127
+ # 3.3 DISCUSSION
128
+
129
+ 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.
130
+
131
+ # 4 WEIGHT VISUALIZATION
132
+
133
+ 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).
134
+
135
+ 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.
136
+
137
+ 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.
138
+
139
+ 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.
140
+
141
+ 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.
142
+
143
+ # 5 RELATED WORK
144
+
145
+ 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).
146
+
147
+ ![](images/116dcdff4d795d2dbda889b8d0af463695037f8ed08b70dd44a413daf868c26c.jpg)
148
+ 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.
149
+
150
+ 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.
151
+
152
+ 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.
153
+
154
+ 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.
155
+
156
+ # 6 CONCLUSION
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ # REFERENCES
163
+
164
+ Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In ICLR, 2017.
165
+
166
+ Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. In ICLR, 2017.
167
+
168
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
169
+
170
+ 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.
171
+
172
+ 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.
173
+
174
+ James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. CoRR, abs/1611.01576, 2016.
175
+
176
+ 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.
177
+
178
+ Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Association for Computational Linguistics (ACL), 2017.
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ Timothy Dozat and Christopher D. Manning. Deep biaffine attention for neural dependency parsing. CoRR, abs/1611.01734, 2016.
185
+
186
+ Jeffrey L. Elman. Finding structure in time. Cognitive Science, 14:179–211, 1990.
187
+
188
+ 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.
189
+
190
+ Felix A. Gers and Jürgen Schmidhuber. Recurrent nets that time and count. In IJCNN, 2000.
191
+
192
+ 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.
193
+
194
+ 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.
195
+
196
+ Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. Diploma, Technische Universität München, 91, 1991.
197
+
198
+ Sepp Hochreiter and Jürgen Schmidhuber. Long Short-term Memory. Neural computation, 9(8): 1735–1780, 1997.
199
+
200
+ Rafal Józefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In ICML, 2015.
201
+
202
+ Rafal Józefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
203
+
204
+ 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.
205
+
206
+ Tao Lei and Yu Zhang. Training rnns as fast as cnns. arXiv preprint arXiv:1709.02755, 2017.
207
+
208
+ Tao Lei, Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Deriving neural architectures from sequence and graph kernels. In ICML, 2017.
209
+
210
+ Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntaxsensitive dependencies. TACL, 4:521–535, 2016.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, $0 0 0 +$ questions for machine comprehension of text. In EMNLP, 2016.
217
+
218
+ Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. CoRR, abs/1611.01603, 2016.
219
+
220
+ 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.
221
+
222
+ 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.
223
+
224
+ Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
225
+
226
+ Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2017.
md/train/HJf9ZhC9FX/HJf9ZhC9FX.md ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STOCHASTIC GRADIENT/MIRROR DESCENT: MINIMAX OPTIMALITY AND IMPLICIT REGULARIZATION
2
+
3
+ Navid Azizan
4
+ California Institute of Technology
5
+ Pasadena, CA 91125
6
+ azizan@caltech.edu
7
+ Babak Hassibi
8
+ California Institute of Technology
9
+ Pasadena, CA 91125
10
+ hassibi@caltech.edu
11
+
12
+ # ABSTRACT
13
+
14
+ 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.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ # 1.1 OUR CONTRIBUTION
25
+
26
+ 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.
27
+
28
+ 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.
29
+
30
+ # 2 PRELIMINARIES
31
+
32
+ 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.).
33
+
34
+ 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
35
+
36
+ $$
37
+ \mathcal { W } = \left\{ w \in \mathbb { R } ^ { m } \mid y _ { i } = f ( x _ { i } , w ) , i = 1 , \ldots , n \right\} .
38
+ $$
39
+
40
+ (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 )$ .
41
+
42
+ 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,
43
+
44
+ $$
45
+ L _ { i } ( w ) = l ( y _ { i } - f ( x _ { i } , w ) ) ,
46
+ $$
47
+
48
+ 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 }$ .
49
+
50
+ # 3 WARM-UP: REVISITING SGD ON SQUARE LOSS OF LINEAR MODELS
51
+
52
+ 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}$ .
53
+
54
+ 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
55
+
56
+ $$
57
+ w _ { i } = w _ { i - 1 } + \eta \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) x _ { i } ,
58
+ $$
59
+
60
+ for $i \geq 1$ (for $i > n$ , we can either cycle through the data, or select them at random).
61
+
62
+ 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.
63
+
64
+ # 3.1 CONSERVATION OF UNCERTAINTY
65
+
66
+ 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.
67
+
68
+ $$
69
+ 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 } .
70
+ $$
71
+
72
+ $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.
73
+
74
+ 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).
75
+
76
+ ![](images/ffefc79710cb5f9f00f08a76b9dce080a12b786c114b24edef4cf913496ff4f4.jpg)
77
+ Figure 1: Illustration of Lemma 1. Each step of SGD can be viewed as a transformation of the uncertainties with the right coefficients.
78
+
79
+ 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)
80
+
81
+ $$
82
+ \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}
83
+ $$
84
+
85
+ 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.
86
+
87
+ 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
88
+
89
+ $$
90
+ \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 } ) .
91
+ $$
92
+
93
+ On the other hand, subtracting both sides of the update rule (3) from $w$ yields
94
+
95
+ $$
96
+ w - w _ { i } = \left( w - w _ { i - 1 } \right) - \eta \left( y _ { i } - x _ { i } ^ { T } w _ { i - 1 } \right) x _ { i } .
97
+ $$
98
+
99
+ Squaring both sides of (6) and (7), and subtracting the results leads to Equation (5).
100
+
101
+ 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.
102
+
103
+ 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)
104
+
105
+ $$
106
+ \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 } . }
107
+ $$
108
+
109
+ 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.
110
+
111
+ # 3.2 MINIMAX OPTIMALITY OF SGD
112
+
113
+ For a given horizon $T$ , consider the following minimax problem:
114
+
115
+ $$
116
+ \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 } } .
117
+ $$
118
+
119
+ 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
120
+
121
+ 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.
122
+
123
+ 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.
124
+
125
+ 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 } \}$ .
126
+
127
+ 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
128
+
129
+ $$
130
+ \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) ,
131
+ $$
132
+
133
+ 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.
134
+
135
+ # 3.3 CONVERGENCE AND IMPLICIT REGULARIZATION
136
+
137
+ 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.
138
+
139
+ 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
140
+
141
+ $$
142
+ \| w - w _ { 0 } \| ^ { 2 } = \| w - w _ { T } \| ^ { 2 } + \eta \sum _ { i = 1 } ^ { T } \left( 2 - \eta \| x _ { i } \| ^ { 2 } \right) e _ { i } ^ { 2 } ,
143
+ $$
144
+
145
+ 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
146
+
147
+ $$
148
+ \boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } \left\| \boldsymbol { w } - \boldsymbol { w } _ { 0 } \right\| .
149
+ $$
150
+
151
+ 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.
152
+
153
+ # 4 MAIN RESULT: GENERAL CHARACTERIZATION OF STOCHASTIC MIRROR DESCENT
154
+
155
+ 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.
156
+
157
+ For any strictly convex and differentiable potential $\psi ( \cdot )$ , the corresponding SMD updates are defined as
158
+
159
+ $$
160
+ \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 } ) ,
161
+ $$
162
+
163
+ where
164
+
165
+ $$
166
+ D _ { \psi } ( w , w _ { i - 1 } ) = \psi ( w ) - \psi ( w _ { i - 1 } ) - \nabla \psi ( w _ { i - 1 } ) ^ { T } ( w - w _ { i - 1 } )
167
+ $$
168
+
169
+ 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
170
+
171
+ $$
172
+ \nabla \psi ( w _ { i } ) = \nabla \psi ( w _ { i - 1 } ) - \eta \nabla L _ { i } ( w _ { i - 1 } ) ,
173
+ $$
174
+
175
+ 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.
176
+
177
+ 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).
178
+
179
+ 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
180
+
181
+ $$
182
+ D _ { L _ { i } } ( w , w ^ { \prime } ) : = L _ { i } ( w ) - L _ { i } ( w ^ { \prime } ) - \nabla L _ { i } ( w ^ { \prime } ) ^ { T } ( w - w ^ { \prime } ) ,
183
+ $$
184
+
185
+ 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.
186
+
187
+ 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)
188
+
189
+ $$
190
+ 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 } ) ,
191
+ $$
192
+
193
+ 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 }$
194
+
195
+ for all $i \geq 1$ , where
196
+
197
+ $$
198
+ \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}
199
+ $$
200
+
201
+ 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.
202
+
203
+ Summing Equation (17) over all $i = 1 , \dots , T$ leads to the following identity, which is the general counterpart of Lemma 2.
204
+
205
+ 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)
206
+
207
+ $$
208
+ \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) . }
209
+ $$
210
+
211
+ We should reiterate that Lemma 5 is a fundamental property of SMD, which allows one to prove many important results, in a direct way.
212
+
213
+ 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.
214
+
215
+ 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
216
+
217
+ $$
218
+ \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 } ) } .
219
+ $$
220
+
221
+ Furthermore, the optimal value (achieved by SMD) is 1.
222
+
223
+ The proof is provided in Appendix B. For the case of square loss and a linear model, the result reduces to the following form.
224
+
225
+ 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
226
+
227
+ $$
228
+ \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 } } .
229
+ $$
230
+
231
+ The optimal value (achieved by SMD) is 1.
232
+
233
+ 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.
234
+
235
+ # 5 CONVERGENCE AND IMPLICIT REGULARIZATION IN OVER-PARAMETERIZED MODELS
236
+
237
+ 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.
238
+
239
+ # 5.1 OVER-PARAMETERIZED LINEAR MODELS
240
+
241
+ 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
242
+
243
+ $$
244
+ 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) ,
245
+ $$
246
+
247
+ for all $w \in \mathcal W$ , where
248
+
249
+ $$
250
+ \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}
251
+ $$
252
+
253
+ 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.
254
+
255
+ 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
256
+
257
+ $$
258
+ \boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
259
+ $$
260
+
261
+ 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
262
+
263
+ $$
264
+ \boldsymbol { w } _ { \infty } = \arg \operatorname* { m i n } _ { \boldsymbol { w } \in \mathcal { W } } \boldsymbol { \psi } ( \boldsymbol { w } ) .
265
+ $$
266
+
267
+ 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.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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:
274
+
275
+ $$
276
+ \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}
277
+ $$
278
+
279
+ 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.
280
+
281
+ ![](images/e84656572e3d5c97b3946f178da69418e9d2fc71bb761c8306618804b9b53a4e.jpg)
282
+ Figure 2: The training loss and actual error of stochastic mirror descent for compressed sensing. SMD recovers the actual sparse signal.
283
+
284
+ Next we establish convergence to the regularized point for the convex case.
285
+
286
+ Proposition 9. Consider the following two cases.
287
+
288
+ (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$ .
289
+ (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)| .
290
+
291
+ If either (i) or (ii) holds, then for any $w _ { 0 }$ , the SMD iterates given in Eq. (15) converge to
292
+
293
+ $$
294
+ \boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
295
+ $$
296
+
297
+ The proof is provided in Appendix C.
298
+
299
+ # 5.2 DISCUSSION OF HIGHLY OVER-PARAMETERIZED NONLINEAR MODELS
300
+
301
+ Let us consider the highly-overparameterized nonlinear model
302
+
303
+ $$
304
+ y _ { i } = f ( x _ { i } , w ) , \quad i = 1 , \ldots , n , \quad w \in \mathbb { R } ^ { m }
305
+ $$
306
+
307
+ 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
308
+
309
+ $$
310
+ 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) ,
311
+ $$
312
+
313
+ 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.
314
+
315
+ 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.)
316
+
317
+ ![](images/49dfe5bb9290172d598f96a653adcf84493e8175f6c79cd627b4d96f5db45ac5.jpg)
318
+ Figure 3: Non-negativity of $D _ { L _ { i } } ( w , w _ { i - 1 } )$ for $w _ { i - 1 }$ “close enough” to $w$ .
319
+
320
+ Now define
321
+
322
+ $$
323
+ w _ { * } = \arg \operatorname* { m i n } _ { w \in \mathcal { W } } D _ { \psi } ( w , w _ { 0 } ) .
324
+ $$
325
+
326
+ Then one can show the following result.
327
+
328
+ Theorem 10. There exists an $\epsilon > 0$ , such that if $\lVert w _ { * } - w _ { 0 } \rVert < \epsilon$ , then for sufficiently small step size $\eta > 0$ :
329
+
330
+ 1. SMD iterates converge to a point $w _ { \infty } \in \mathcal { W }$
331
+
332
+ $$
333
+ \| w _ { \infty } - w _ { * } \| = o ( \epsilon )
334
+ $$
335
+
336
+ 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.
337
+
338
+ 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.
339
+
340
+ 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.
341
+
342
+ 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.
343
+
344
+ # 6 CONCLUDING REMARKS
345
+
346
+ 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
347
+
348
+ $$
349
+ 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) ,
350
+ $$
351
+
352
+ 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
353
+
354
+ $$
355
+ \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 } ) } .
356
+ $$
357
+
358
+ 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).
359
+
360
+ 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.
361
+
362
+ # ACKNOWLEDGMENTS
363
+
364
+ 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.
365
+
366
+ # REFERENCES
367
+
368
+ Alessandro Achille and Stefano Soatto. On the emergence of invariance and disentangling in deep representations. arXiv preprint arXiv:1706.01350, 2017.
369
+
370
+ 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.
371
+
372
+ Tamer Bas¸ar and Pierre Bernhard. H-infinity optimal control and related minimax design problems: a dynamic game approach. Springer Science & Business Media, 2008.
373
+
374
+ Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167–175, 2003.
375
+
376
+ 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.
377
+
378
+ 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.
379
+
380
+ 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.
381
+
382
+ Bruce A Francis. A course in H-infinity control theory. Berlin; New York: Springer-Verlag, 1987.
383
+
384
+ Claudio Gentile. The robustness of the p-norm algorithms. Machine Learning, 53(3):265–299, 2003.
385
+
386
+ Adam J Grove, Nick Littlestone, and Dale Schuurmans. General convergence results for linear discriminant updates. Machine Learning, 43(3):173–210, 2001.
387
+
388
+ 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.
389
+
390
+ Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. arXiv preprint arXiv:1802.08246, 2018a.
391
+
392
+ Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Implicit bias of gradient descent on linear convolutional networks. arXiv preprint arXiv:1806.00468, 2018b.
393
+
394
+ 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.
395
+
396
+ 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.
397
+
398
+ Babak Hassibi, Ali H Sayed, and Thomas Kailath. Hoo optimality of the LMS algorithm. IEEE Transactions on Signal Processing, 44(2):267–280, 1996.
399
+
400
+ 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.
401
+
402
+ Elad Hazan. Introduction to online convex optimization. Foundations and Trends in Optimization, 2(3-4):157–325, 2016. ISSN 2167-3888.
403
+
404
+ Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
405
+
406
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
407
+
408
+ 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.
409
+
410
+ 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.
411
+
412
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436, 2015.
413
+
414
+ 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.
415
+
416
+ 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.
417
+
418
+ 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.
419
+
420
+ 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.
421
+
422
+ Arkadii Nemirovskii, David Borisovich Yudin, and Edgar Ronald Dawson. Problem complexity and method efficiency in optimization. 1983.
423
+
424
+ Behnam Neyshabur, Ryota Tomioka, Ruslan Salakhutdinov, and Nathan Srebro. Geometry of optimization and implicit regularization in deep learning. arXiv preprint arXiv:1705.03071, 2017.
425
+
426
+ Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2012. ISSN 1935-8237.
427
+
428
+ Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
429
+
430
+ 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.
431
+
432
+ Dan Simon. Optimal state estimation: Kalman, H infinity, and nonlinear approaches. John Wiley & Sons, 2006.
433
+
434
+ 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.
435
+
436
+ 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.
437
+
438
+ 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.
439
+
440
+ 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.
441
+
442
+ 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.
443
+
444
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
445
+
446
+ 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.
447
+
448
+ # Supplementary Material
449
+
450
+ # A PROOF OF LEMMA 4
451
+
452
+ Proof. Let us start by expanding the Bregman divergence $D _ { \psi } ( w , w _ { i } )$ based on its definition
453
+
454
+ $$
455
+ D _ { \psi } ( w , w _ { i } ) = \psi ( w ) - \psi ( w _ { i } ) - \nabla \psi ( w _ { i } ) ^ { T } ( w - w _ { i } ) .
456
+ $$
457
+
458
+ 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
459
+
460
+ $$
461
+ 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 } ) .
462
+ $$
463
+
464
+ 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
465
+
466
+ $$
467
+ \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}
468
+ $$
469
+
470
+ 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
471
+
472
+ $$
473
+ \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}
474
+ $$
475
+
476
+ 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
477
+
478
+ $$
479
+ 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) .
480
+ $$
481
+
482
+ 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
483
+
484
+ $$
485
+ 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 } ) ,
486
+ $$
487
+
488
+ which concludes the proof.
489
+
490
+ # B PROOF OF THEOREM 6
491
+
492
+ 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.
493
+
494
+ 1. Consider the maximization problem
495
+
496
+ $$
497
+ \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 } ) } .
498
+ $$
499
+
500
+ 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.
501
+
502
+ $$
503
+ 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 } ) ,
504
+ $$
505
+
506
+ where we have used the fact that $l ( y _ { i } - f _ { i } ( w ) ) = l ( v _ { i } )$ for all consistent $w$ , in the first term.
507
+
508
+ Now, we choose a feasible point as follows
509
+
510
+ $$
511
+ \hat { v } _ { i } = f _ { i } ( w _ { i - 1 } ) - f _ { i } ( \hat { w } ) ,
512
+ $$
513
+
514
+ 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
515
+
516
+ $$
517
+ \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}
518
+ $$
519
+
520
+ 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
521
+
522
+ $$
523
+ \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 } )
524
+ $$
525
+
526
+ which is, in turn, equivalent to
527
+
528
+ $$
529
+ \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 } .
530
+ $$
531
+
532
+ 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
533
+
534
+ $$
535
+ \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.
536
+ $$
537
+
538
+ Choosing the feasible point $\hat { w } , \{ v _ { i } \}$ according to (47) and (45) leads to
539
+
540
+ $$
541
+ \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}
542
+ $$
543
+
544
+ Taking the minimum of both sides with respect to $\{ w _ { i } \}$ , we have
545
+
546
+ $$
547
+ \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}
548
+ $$
549
+
550
+ 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.
551
+
552
+ 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
553
+
554
+ $$
555
+ 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 } ) ,
556
+ $$
557
+
558
+ where
559
+
560
+ $$
561
+ \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}
562
+ $$
563
+
564
+ 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.
565
+
566
+ $$
567
+ 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 } ) .
568
+ $$
569
+
570
+ 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
571
+
572
+ $$
573
+ \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 .
574
+ $$
575
+
576
+ 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.
577
+
578
+ Combining the results of 1 and 2 above concludes the proof.
579
+
580
+ # B.1 PROOF OF THEOREM 3
581
+
582
+ 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} }$
583
+
584
+ # C PROOF OF PROPOSITION 9
585
+
586
+ Proof. To prove convergence, we appeal again to Equation (22), i.e.
587
+
588
+ $$
589
+ 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) ,
590
+ $$
591
+
592
+ for all $w \in \mathcal W$ . We prove the two cases separately.
593
+
594
+ 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 }$ .
595
+
596
+ 2. To prove case (ii), note that we have
597
+
598
+ $$
599
+ \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}
600
+ $$
601
+
602
+ and
603
+
604
+ $$
605
+ \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}
606
+ $$
607
+
608
+ It follows from (55) and (58) that the summand in Equation (52) is
609
+
610
+ $$
611
+ 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 } ) .
612
+ $$
613
+
614
+ 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.
615
+
616
+ Note that by the definition of $\alpha$ -strong convexity of $\psi ( \cdot )$ , we have
617
+
618
+ $$
619
+ \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}
620
+ $$
621
+
622
+ which implies
623
+
624
+ $$
625
+ - \eta \nabla L _ { i } ( w _ { i - 1 } ) ^ { T } ( w _ { i } - w _ { i - 1 } ) \geq \alpha \| w _ { i } - w _ { i - 1 } \| ^ { 2 } ,
626
+ $$
627
+
628
+ 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
629
+
630
+ $$
631
+ \eta \| \nabla L _ { i } ( w _ { i - 1 } ) \| \geq \alpha \| w _ { i } - w _ { i - 1 } \| .
632
+ $$
633
+
634
+ This implies that we have the following bound
635
+
636
+ $$
637
+ | 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 } .
638
+ $$
639
+
640
+ 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.
641
+
642
+ 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 }$ .
643
+
644
+ # D TIME-VARYING STEP-SIZE
645
+
646
+ The update rule for the stochastic mirror descent with time-varying step size is as follows.
647
+
648
+ $$
649
+ \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 } ) ,
650
+ $$
651
+
652
+ 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.
653
+
654
+ 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)
655
+
656
+ $$
657
+ 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) ,
658
+ $$
659
+
660
+ Proof. The proof is straightforward by summing the following equation for all $i = 1 , \dots , T$
661
+
662
+ $$
663
+ 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 } ) ,
664
+ $$
665
+
666
+ which can be easily shown in the same way as in the proof of Lemma 4 in Appendix A.
667
+
668
+ 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
669
+
670
+ $$
671
+ \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 } ) } .
672
+ $$
673
+
674
+ Furthermore, the optimal value (achieved by SMD) is 1.
675
+
676
+ 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
677
+
678
+ $$
679
+ \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
680
+ $$
681
+
682
+ for SMD updates, which concludes the proof.
683
+
684
+ The convergence and implicit regularization results hold similarly, and can be formally stated as follows.
685
+
686
+ Proposition 13. Consider the following two cases.
687
+
688
+ (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.
689
+ (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$ .
690
+
691
+ If either (i) or (ii) holds, then for any initialization $w _ { 0 }$ , the SMD iterates given in Eq. (64) converge to
692
+
693
+ $$
694
+ \boldsymbol { w } _ { \infty } = \underset { \boldsymbol { w } \in \mathcal { W } } { \arg \operatorname* { m i n } } D _ { \psi } ( \boldsymbol { w } , \boldsymbol { w } _ { 0 } ) .
695
+ $$
696
+
697
+ Proof. The proof is similar to that of Proposition 9, as provided in Appendix C.
md/train/HJgBA2VYwH/HJgBA2VYwH.md ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FSPOOL: LEARNING SET REPRESENTATIONS WITH FEATUREWISE SORT POOLING
2
+
3
+ Yan Zhang
4
+ University of Southampton
5
+ Southampton, UK
6
+ yz5n12@ecs.soton.ac.uk Jonathon Hare
7
+ University of Southampton Southampton, UK
8
+ jsh2@ecs.soton.ac.uk
9
+
10
+ Adam Prügel-Bennett University of Southampton Southampton, UK apb@ecs.soton.ac.uk
11
+
12
+ # ABSTRACT
13
+
14
+ 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.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ 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.
19
+
20
+ 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).
21
+
22
+ 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.
23
+
24
+ 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:
25
+
26
+ 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.
27
+
28
+ 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).
29
+
30
+ # 2 BACKGROUND
31
+
32
+ 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.
33
+
34
+ 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.
35
+
36
+ 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:
37
+
38
+ $$
39
+ \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 }
40
+ $$
41
+
42
+ 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.
43
+
44
+ $$
45
+ \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 }
46
+ $$
47
+
48
+ 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.
49
+
50
+ # 3 RESPONSIBILITY PROBLEM
51
+
52
+ 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.
53
+
54
+ 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.
55
+
56
+ ![](images/52a29eb6dbf35fa5e485c9d6529dc637845fb15e7c5cf427eead0f70e20a1c50.jpg)
57
+ 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.
58
+
59
+ 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.
60
+
61
+ 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).
62
+
63
+ # 4 FEATUREWISE SORT POOLING
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ ![](images/28a5304c8b4245a5fdbd8ac5949122c1a86b88409cb7a7bf8efae3c2708eda75.jpg)
72
+ 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.
73
+
74
+ # 4.1 FIXED-SIZE SETS
75
+
76
+ 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.
77
+
78
+ 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 }$ :
79
+
80
+ $$
81
+ \vec { X } _ { i , j } = \mathrm { S o R T } ( X _ { i , : } ) _ { j }
82
+ $$
83
+
84
+ 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.
85
+
86
+ 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.
87
+
88
+ 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).
89
+
90
+ $$
91
+ y _ { i } = \sum _ { j } ^ { n } W _ { i , j } { \vec { X } } _ { i , j }
92
+ $$
93
+
94
+ $\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.
95
+
96
+ # 4.2 VARIABLE-SIZE SETS
97
+
98
+ 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.
99
+
100
+ 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 ]$ ,
101
+
102
+ $$
103
+ f ( r , \bar { w } ) = \sum _ { i = 1 } ^ { k } \operatorname* { m a x } ( 0 , 1 - | r ( k - 1 ) - ( i - 1 ) | ) \bar { w } _ { i }
104
+ $$
105
+
106
+ 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 }$ .
107
+
108
+ 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:
109
+
110
+ $$
111
+ y _ { i } = \sum _ { j = 1 } ^ { n } f ( \frac { j - 1 } { n - 1 } , W _ { i , : } ) \vec { X } _ { i , j }
112
+ $$
113
+
114
+ $\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.
115
+
116
+ # 4.3 AUTO-ENCODER
117
+
118
+ 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.
119
+
120
+ With $\pmb { y } ^ { \prime } \in \mathbb { R } ^ { d }$ as the vector to be unpooled, we define the unpooling similarly to Equation 6 as
121
+
122
+ $$
123
+ \vec { X } _ { i , j } ^ { \prime } = f ( \frac { j - 1 } { n - 1 } , W _ { i , : } ^ { \prime } ) y _ { i } ^ { \prime }
124
+ $$
125
+
126
+ 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.
127
+
128
+ Lastly, we can use the inverse of the permutation from the encoder to restore the original order.
129
+
130
+ $$
131
+ X ^ { \prime } { } _ { i , j } = ( \vec { X } _ { i , : } ^ { \prime } \pmb { P } _ { i } ^ { T } ) _ { j }
132
+ $$
133
+
134
+ where ${ \cal P } _ { i } ^ { T }$ permutes the elements of the ith row in ${ \vec { X } } ^ { \prime }$
135
+
136
+ 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.
137
+
138
+ # 5 RELATED WORK
139
+
140
+ 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.
141
+
142
+ 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.
143
+
144
+ 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.
145
+
146
+ 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).
147
+
148
+ 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.
149
+
150
+ # 6 EXPERIMENTS
151
+
152
+ 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].
153
+
154
+ # 6.1 ROTATING POLYGONS
155
+
156
+ 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.
157
+
158
+ 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)).
159
+
160
+ ![](images/30427f5b66ee38a922802446ffcd3eba3dbe3d8d09219b52d1350714cbda1900.jpg)
161
+ 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.
162
+
163
+ 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.
164
+
165
+ # 6.2 NOISY MNIST SETS
166
+
167
+ 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.
168
+
169
+ 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).
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ <table><tr><td rowspan="3"></td><td colspan="3">1 epoch of training</td><td colspan="3">10 epochs of training</td></tr><tr><td>Frozen</td><td>Unfrozen</td><td>Random init</td><td>Frozen</td><td>Unfrozen</td><td>Random init</td></tr><tr><td>FSPOOL</td><td>82.2%±2.1</td><td>86.9%±1.3</td><td>84.7%±1.9</td><td>84.3%± 1.8</td><td>91.5%±0.5</td><td>91.9%±0.5</td></tr><tr><td>SUM</td><td>76.6%±1.3</td><td>68.7%±3.5</td><td>30.3%±5.6</td><td>79.0%±1.0</td><td>77.7%±2.3</td><td>72.7%±3.4</td></tr><tr><td>MEAN</td><td>25.7%±3.6</td><td>32.2%±10.5</td><td>30.1%±1.6</td><td>36.8%±5.0</td><td>75.0%±2.7</td><td>73.0%±1.7</td></tr><tr><td>MAX</td><td>73.6%±1.3</td><td>73.0%±3.5</td><td>56.1%±5.6</td><td>77.3%±0.9</td><td>80.4%±1.8</td><td>76.9%±1.3</td></tr></table>
176
+
177
+ # 6.2.1 CLASSIFICATION
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ # 6.3 CLEVR
184
+
185
+ 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.
186
+
187
+ 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.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ <table><tr><td colspan="2"></td><td colspan="3">Epochs to reach accuracy</td><td rowspan="2">Time for 350 epochs</td></tr><tr><td>Model</td><td>Accuracy</td><td>98.00%</td><td>98.50%</td><td>99.00%</td></tr><tr><td>FSPOOL</td><td>99.27%±0.18</td><td>141± 5</td><td>166±16</td><td>209±33</td><td>8.8h</td></tr><tr><td>RN</td><td>98.98%±0.25</td><td>144±6</td><td>189±29</td><td>*268±46</td><td>15.5 h</td></tr><tr><td>JANOSSY</td><td>97.00%±0.54</td><td>1</td><td>1</td><td>1</td><td>11.5 h</td></tr><tr><td>SUM</td><td>99.05%±0.17</td><td>146±13</td><td>191±40</td><td>281±56</td><td>8.0h</td></tr><tr><td>MEAN</td><td>98.96%±0.27</td><td>169±6</td><td>225±31</td><td>273±33</td><td>8.0h</td></tr><tr><td>MAX</td><td>96.99%±0.26</td><td>1</td><td>1</td><td>1</td><td>8.0h</td></tr><tr><td>MAC</td><td>99.0 %</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
194
+
195
+ # 6.4 GRAPH CLASSIFICATION
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ # 6.5 CLEVR WITH DEEP SET PREDICTION NETWORKS
204
+
205
+ 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).
206
+
207
+ 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.
208
+
209
+ # 7 DISCUSSION
210
+
211
+ 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).
212
+
213
+ 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.
214
+
215
+ # REFERENCES
216
+
217
+ 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.
218
+ Cem Anil, James Lucas, and Roger Grosse. Sorting out Lipschitz function approximation. arXiv:1811.05381, 2018.
219
+ James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems 29 (NeurIPS), 2016.
220
+ 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.
221
+ 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.
222
+ 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.
223
+ 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.
224
+ Hongyang Gao and Shuiwang Ji. Graph U-Net, 2019. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJePRoAct7.
225
+ 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.
226
+ 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.
227
+ 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.
228
+ Drew A. Hudson and Christopher D. Manning. Compositional Attention Networks for Machine Reasoning. In International Conference on Learning Representations (ICLR), 2018.
229
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems 28 (NeurIPS), 2015.
230
+
231
+ Daniel D. Johnson. Learning graphical state transitions. In International Conference on Learning Representations (ICLR), 2017.
232
+
233
+ 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.
234
+
235
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
236
+
237
+ 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.
238
+
239
+ Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning Latent Permutations with Gumbel-Sinkhorn Networks. In International Conference on Learning Representations (ICLR), 2018.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ Zenglin Shi, Yangdong Ye, and Yunpeng Wu. Rank-based pooling for deep convolutional neural networks. Neural Networks, 83:21 – 31, 2016. ISSN 0893-6080.
260
+
261
+ Russell Stewart and Mykhaylo Andriluka. End-to-end people detection in crowded scenes. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
262
+
263
+ 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.
264
+
265
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
266
+
267
+ 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.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ 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.
276
+
277
+ Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Deep Set Prediction Networks. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
278
+
279
+ Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Learning representations of sets through optimized permutations. In International Conference on Learning Representations (ICLR), 2019b.
280
+
281
+ # A FORMAL RESPONSIBILITY PROBLEM
282
+
283
+ The following theorem is a more formal treatment of the responsibility problem resulting in discontinuities.
284
+
285
+ 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:
286
+
287
+ $$
288
+ 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 .
289
+ $$
290
+
291
+ $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}$ .
292
+
293
+ ![](images/dcc95177012c5a5f9ac7b6e8996219abb3e51cd383adf18c961d25a59669565c.jpg)
294
+ Figure 4: Example of the set with two points.
295
+
296
+ 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.
297
+
298
+ 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$ . □
299
+
300
+ 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 )$ .
301
+
302
+ # B POLYGONS
303
+
304
+ 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.
305
+
306
+ 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.
307
+
308
+ Table 3: Direct mean squared error (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
309
+
310
+ <table><tr><td>Set size</td><td>2</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td></tr><tr><td>FSPOOL</td><td>0.000</td><td>0.001</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.0001</td></tr><tr><td>RANDOM</td><td>100.323</td><td>100.134</td><td>99.367</td><td>99.951</td><td>99.438</td><td>99.523</td></tr></table>
311
+
312
+ Table 4: Chamfer loss (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
313
+
314
+ <table><tr><td>Set size</td><td>2</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td></tr><tr><td>FSPOOL</td><td>0.001</td><td>0.001</td><td>0.001</td><td>0.000</td><td>0.001</td><td>0.002</td></tr><tr><td>MLP+ Chamfer</td><td>1.189</td><td>1.771</td><td>0.274</td><td>1.272</td><td>0.316</td><td>0.085</td></tr><tr><td>MLP +Hungarian</td><td>1.517</td><td>0.400</td><td>0.251</td><td>1.266</td><td>0.326</td><td>0.081</td></tr><tr><td>RANDOM</td><td>72.848</td><td>19.866</td><td>5.112</td><td>1.271</td><td>0.322</td><td>0.081</td></tr></table>
315
+
316
+ Table 5: Linear assignment loss (in hundredths) on Polygon dataset with different number of points in the set. Lower is better.
317
+
318
+ <table><tr><td>Set size</td><td>2</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td></tr><tr><td>FSPOOL</td><td>0.000</td><td>0.001</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.001</td></tr><tr><td>MLP +Chamfer</td><td>0.595</td><td>0.885</td><td>0.137</td><td>0.641</td><td>0.160</td><td>0.285</td></tr><tr><td>MLP + Hungarian</td><td>0.758</td><td>0.200</td><td>0.126</td><td>0.634</td><td>0.163</td><td>0.040</td></tr><tr><td>RANDOM</td><td>36.424</td><td>9.933</td><td>2.556</td><td>0.635</td><td>0.161</td><td>0.041</td></tr></table>
319
+
320
+ # C MNIST RECONSTRUCTION
321
+
322
+ 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.
323
+
324
+ 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.
325
+
326
+ 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.
327
+
328
+ 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.
329
+
330
+ Table 6: Test Chamfer loss (in 10 000ths) for MNIST for different input noise levels $\sigma$ over 6 runs. Lower is better.
331
+
332
+ <table><tr><td>Noise σ</td><td>0.00</td><td>0.01</td><td>0.02</td><td>0.03</td><td>0.04</td><td>0.05</td></tr><tr><td>FSPOOL+FSUNPOOL(</td><td>0.42±0.06</td><td>0.34±0.05</td><td>0.36±0.02</td><td>0.38±0.03</td><td>0.41±0.00</td><td>0.44±0.01</td></tr><tr><td>SUM+MLP</td><td>0.30±0.04</td><td>0.28±0.03</td><td>0.28±0.03</td><td>0.28±0.03</td><td>0.27±0.01</td><td>0.31±0.04</td></tr><tr><td>SUM+RNN</td><td>0.76±0.46</td><td>0.58±0.06</td><td>0.57±0.09</td><td>0.54±0.11</td><td>0.64±0.13</td><td>0.78±0.39</td></tr><tr><td>MAX+MLP</td><td>1.29±0.23</td><td>1.37±0.28</td><td>1.23±0.16</td><td>1.74±0.32</td><td>1.27±0.19</td><td>1.43±0.30</td></tr><tr><td>MEAN+MLP</td><td>1.41±0.12 1.22±0.18 1.33±0.29 1.25±0.09</td><td></td><td></td><td></td><td>)1.31±0.15</td><td>1.49±0.31</td></tr></table>
333
+
334
+ 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.
335
+
336
+ <table><tr><td>Noise σ</td><td>0.00</td><td>0.01</td><td>0.02</td><td>0.03</td><td>0.04</td><td>0.05</td></tr><tr><td>FSPOOL+FSUNPOOL</td><td>0.28±0.03</td><td>0.21±0.01</td><td>0.25±0.03</td><td>0.25±0.01</td><td>0.27±0.01</td><td>0.30±0.01</td></tr><tr><td>SUM+MLP</td><td>0.87±0.43</td><td>0.90±0.39</td><td>0.61±0.40</td><td>0.99±0.84</td><td>0.63±0.27</td><td>0.61±0.24</td></tr><tr><td>SUM +RNN</td><td>0.58±0.13</td><td>0.69±0.16</td><td>0.60±0.18</td><td>1.35±1.53</td><td>0.73±0.12</td><td>0.63±0.13</td></tr><tr><td>MAX+MLP</td><td>5.91±3.10</td><td>4.78±3.05</td><td>7.10±2.40</td><td>5.05±2.87</td><td>5.85±3.11</td><td>4.57±2.08</td></tr><tr><td>MEAN+MLP</td><td>5.92±3.10 4.55±3.17 6.84±2.847</td><td></td><td></td><td>7.11±2.39</td><td></td><td>3.04±0.78 6.34±2.53</td></tr></table>
337
+
338
+ Table 8: Classification accuracy (mean $\pm$ stdev) on MNIST $\sigma = 0 . 0 0$ over 6 runs.
339
+
340
+ <table><tr><td rowspan="3"></td><td colspan="3">1 epoch of training</td><td colspan="3">10 epochs of training</td></tr><tr><td>Frozen</td><td>Unfrozen1</td><td>Random init</td><td>Frozen</td><td></td><td>Unfrozen Random init</td></tr><tr><td>FSPOOL</td><td>86.3%±1.6</td><td>92.3% ±1.1</td><td>90.5%±1.2</td><td>88.2%±1.4</td><td>96.0%±0.3</td><td>96.1%±0.3</td></tr><tr><td>SUM</td><td>82.3%±1.2</td><td>77.9%±3.4</td><td>35.3%±8.3</td><td>85.0%±0.8</td><td>84.2%±2.5</td><td>78.4%±3.9</td></tr><tr><td>MEAN</td><td>27.0%±3.3</td><td>43.5%±7.1</td><td>31.2%±1.0</td><td>42.0%±7.7</td><td>76.7%±2.6</td><td>77.2%±2.2</td></tr><tr><td>MAX</td><td>82.0%±1.8</td><td>84.1%±1.4</td><td>62.9%±3.5</td><td>86.8%±0.9</td><td>91.9%±1.3</td><td>87.7%±1.2</td></tr></table>
341
+
342
+ Table 9: Classification accuracy (mean $\pm$ stdev) on MNIST for 100 epochs over 6 runs.
343
+
344
+ <table><tr><td rowspan="3"></td><td colspan="3">σ = 0.05,100 epochs</td><td colspan="3">σ = 0.00,100 epochs</td></tr><tr><td>Frozen</td><td>Unfrozen</td><td>Random init</td><td>Frozen</td><td>Unfrozen</td><td>Random init</td></tr><tr><td>FSPOOL</td><td>84.9%±1.7</td><td>93.9%±0.4</td><td>94.0%±0.3</td><td>88.6%±1.6</td><td>97.4%±0.3</td><td>97.5%±0.3</td></tr><tr><td>SUM</td><td>79.8%±1.0</td><td>85.3%±1.1</td><td>83.1%±1.9</td><td>85.6%±0.9</td><td>89.5%±2.5</td><td>88.3%±1.4</td></tr><tr><td>MEAN</td><td>48.2%±6.9</td><td>86.5%±0.8</td><td>84.1%±2.3</td><td>57.0%±7.7</td><td>90.3%±1.3</td><td>91.1%±0.8</td></tr><tr><td>MAX</td><td>78.8%±0.8</td><td>84.7%±1.0</td><td>84.6%±0.9</td><td>89.2%±0.8</td><td>95.3%±0.7</td><td>95.1%±1.5</td></tr></table>
345
+
346
+ # D MNIST CLASSIFICATION
347
+
348
+ 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.
349
+
350
+ # E CLEVR
351
+
352
+ ![](images/3b4aed0a012da71e7677084595c424c2be75e6ce44b3ab89b113c1feb9b52015.jpg)
353
+ 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.
354
+
355
+ # F GRAPH CLASSIFICATION
356
+
357
+ 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.
358
+
359
+ 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.
360
+
361
+ <table><tr><td>Social Network</td><td>IMDB-B</td><td>IMDB-M</td><td>RDT-B</td><td>RDT-M5K</td><td>COLLAB</td></tr><tr><td>Num. graphs</td><td>1000</td><td>1500</td><td>2000</td><td>5000</td><td>5000</td></tr><tr><td>Num. classes</td><td>2</td><td>3</td><td>2</td><td>5</td><td>3</td></tr><tr><td>Avg. nodes</td><td>19.8</td><td>13.0</td><td>429.6</td><td>508.5</td><td>74.5</td></tr><tr><td>Max. nodes</td><td>136</td><td>89</td><td>3063</td><td>2012</td><td>492</td></tr><tr><td>DCNN (Atwood &amp; Towsley,2016)</td><td>49.1</td><td>33.5</td><td>1</td><td>1</td><td>52.1</td></tr><tr><td>PATCHY-SAN (Niepert et al.,2016)</td><td>71.0 ±2.3</td><td>45.2 ±2.8</td><td>86.3 ±1.6</td><td>49.1 ±0.7</td><td>72.6 ±2.2</td></tr><tr><td>SORTPoOL (Zhang et al., 2018)</td><td>70.0 ±0.9</td><td>47.8 ±0.9</td><td>1</td><td>1</td><td>73.8 ±0.5</td></tr><tr><td>DIFFPOOL (Ying et al., 2018)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>75.5</td></tr><tr><td>WL* (Xu et al., 2019)</td><td>73.8</td><td>50.9</td><td>81.0</td><td>52.5</td><td>78.9</td></tr><tr><td>GIN-BASE* (Xu et al., 2019)</td><td>75.1</td><td>52.3</td><td>92.4</td><td>57.5</td><td>80.2</td></tr><tr><td>GIN-FSPOOL</td><td>72.1 ±2.0</td><td>49.9 ±1.7</td><td>89.1 ±1.2</td><td>51.8 ±0.9</td><td>80.0 ±0.4</td></tr><tr><td>- epochs</td><td>95±70</td><td>27 ±23</td><td>124 ±64</td><td>66 ±31</td><td>124 ±56</td></tr><tr><td>GIN-BASE</td><td>71.3 ±1.2</td><td>48.8 ±1.7</td><td>84.8 ±1.7</td><td>48.1 ±2.0</td><td>80.3 ±0.4</td></tr><tr><td>- epochs</td><td>83 ±73</td><td>57 ±59</td><td>156 ±58</td><td>211 ±27</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>204 ±26</td></tr></table>
362
+
363
+ <table><tr><td>Bioinformatics</td><td>MUTAG</td><td>PROTEINS</td><td>PTC</td><td>NCI1</td></tr><tr><td>Num. graphs</td><td>188</td><td>1113</td><td>344</td><td>4110</td></tr><tr><td>Num.classes</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Avg. nodes</td><td>17.9</td><td>39.1</td><td>25.5</td><td>29.8</td></tr><tr><td>Max.nodes PK (Neumann et al., 2016)</td><td>28 76.0 ±2.7</td><td>620 73.7 ±0.7</td><td>109 59.5 ±2.4</td><td>111 82.5 ±0.5</td></tr><tr><td>DCNN (Atwood &amp; Towsley,2016)</td><td>67.0</td><td>61.3</td><td>56.6</td><td>62.6</td></tr><tr><td>PATCHY-SAN (Niepert et al., 2016)</td><td>92.6 ±4.2</td><td>75.9 ±2.8</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>60.0 ±4.8</td><td>78.6 ±1.9</td></tr><tr><td>SORTPoOL (Zhang et al.,2018)</td><td>85.8 ±1.7</td><td>75.5 ±0.9</td><td>58.6 ±2.5</td><td>74.4 ±0.5</td></tr><tr><td>DIFFPOOL (Ying et al., 2018)</td><td>1</td><td>76.3</td><td>1</td><td>1</td></tr><tr><td>WL (Shervashidze et al., 2011)</td><td>84.1 ±1.9</td><td>74.7 ±0.5</td><td>58.0 ±2.5</td><td>85.5 ±0.5</td></tr><tr><td>WL* (Xu et al., 2019)</td><td>90.4</td><td>75.0</td><td>59.9</td><td>86.0</td></tr><tr><td>GIN-BASE* (Xu et al., 2019)</td><td>89.4</td><td>76.2</td><td>64.6</td><td>82.7</td></tr><tr><td></td><td>85.9 ±2.4</td><td></td><td></td><td></td></tr><tr><td>GIN-FSPOOL</td><td>299</td><td>73.8 ±0.9</td><td>59.3 ±1.8</td><td>79.2 ±0.6</td></tr><tr><td>- epochs</td><td>±91</td><td>69 ±23</td><td>214 ±110</td><td>361 ±54</td></tr><tr><td>GIN-BASE</td><td>85.0 ±1.5</td><td>73.2 ±1.2</td><td>59.9 ±2.4</td><td>79.4 ±0.6</td></tr><tr><td>- epochs</td><td>244 ±95</td><td>160 ±123</td><td>202 ±100</td><td>412 ±55</td></tr></table>
364
+
365
+ 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 \%$ .
366
+
367
+ 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.
368
+
369
+ 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.
370
+
371
+ 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.
372
+
373
+ 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.
374
+
375
+ # G DEEP SET PREDICTION NETWORKS
376
+
377
+ 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).
378
+
379
+ <table><tr><td>Model</td><td>AP50</td><td>AP90</td><td>AP95</td><td>AP98</td><td>AP99</td></tr><tr><td>DSPN-RN-FSPOOL (10 iters)</td><td>98.8±0.3</td><td>94.3±1.5</td><td>85.7±3.0</td><td>34.5±5.7</td><td>2.9±1.2</td></tr><tr><td>DSPN-RN-FSPOOL (20 iters)</td><td>99.8±0.0</td><td>98.7±1.1</td><td>86.2±7.2</td><td>24.3±8.0</td><td>1.4±0.9</td></tr><tr><td>DSPN-RN-FSPOOL (30 iters)</td><td>99.8±0.1</td><td>96.7±2.4</td><td>75.5±12.3</td><td>17.4±7.7</td><td>0.9±0.7</td></tr><tr><td>DSPN-RN-SUM (10 iters)</td><td>88.3±3.7</td><td>43.4±14.4</td><td>10.0±7.4</td><td></td><td></td></tr><tr><td>DSPN-RN-SUM (20 iters)</td><td>87.2±3.0</td><td>42.9±11.9</td><td>5.7±3.5</td><td>0.1±0.1 0.0±0.0</td><td>0.0±0.0 0.0±0.0</td></tr><tr><td>DSPN-RN-SUM (30 iters)</td><td>79.0±11.9</td><td>32.5±12.4</td><td>3.4±2.2</td><td></td><td></td></tr><tr><td>DSPN-RN-MAX (10 iters)</td><td>68.0±4.3</td><td>4.0±2.2</td><td>0.1±0.1</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0 0.0±0.0</td></tr><tr><td>DSPN-RN-MAX (20 iters)</td><td>66.6±4.5</td><td>3.3±1.8</td><td>0.1±0.0</td><td>0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-MAX (30 iters)</td><td>64.1±5.0</td><td>2.3±1.1</td><td>0.0±0.0</td><td>0.0±0.0</td><td>0.0±0.0</td></tr></table>
380
+
381
+ 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).
382
+
383
+ <table><tr><td>Model</td><td>APo</td><td>AP1</td><td>AP0.5</td><td>AP0.25</td><td>AP0.125</td></tr><tr><td>DSPN-RN-FSPOOL (10 iters)</td><td>72.8±2.3</td><td>59.2±2.8</td><td>39.0±4.4</td><td>12.4±2.5</td><td>1.3±0.4</td></tr><tr><td>DSPN-RN-FSPOOL (20 iters)</td><td>84.0±4.5</td><td>80.0±4.9</td><td>57.0±12.1</td><td>16.6±9.0</td><td>1.6±0.9</td></tr><tr><td>DSPN-RN-FSPOOL (30 iters)</td><td>85.2±4.8</td><td>81.1±5.2</td><td>47.4±17.6</td><td>10.8±9.0</td><td>0.6±0.7</td></tr><tr><td>DSPN-RN-SUM(10 iters)</td><td>44.6±3.8</td><td>21.9±4.8</td><td>7.1±2.7</td><td>1.0±0.5</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-SUM (20 iters)</td><td>39.6±5.4</td><td>15.2±6.4</td><td>3.0±2.2</td><td>0.3±0.3</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-SUM (30 iters)</td><td>30.2±9.2</td><td>7.1±3.8</td><td>0.9±0.8</td><td>0.1±0.1</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-MAX (10 iters)</td><td>3.0±0.2</td><td>0.9±0.1</td><td>0.5±0.2</td><td>0.1±0.1</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-MAX (20 iters)</td><td>3.1±0.1</td><td>1.2±0.1</td><td>0.8±0.2</td><td>0.3±0.2</td><td>0.0±0.0</td></tr><tr><td>DSPN-RN-MAX (30 iters)</td><td>3.1±0.1</td><td>1.2±0.1</td><td>0.9±0.2</td><td>0.3±0.2</td><td>0.0±0.0</td></tr></table>
384
+
385
+ 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.
386
+
387
+ This is especially apparent for the harder dataset of state prediction, where more information has to be compressed into the latent space.
388
+
389
+ # H EXPERIMENTAL DETAILS
390
+
391
+ We provide the code to reproduce all experiments at [redacted].
392
+
393
+ 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.
394
+
395
+ # H.1 POLYGONS
396
+
397
+ 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.
398
+
399
+ # H.2 MNIST RECONSTRUCTION
400
+
401
+ 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.
402
+
403
+ The latent space is increased from 1 to 16 and the size of the hidden layers is increased from 16 to 32.
404
+ All other hyperparameters are the the same as for the Polygons dataset.
405
+
406
+ # H.3 CLEVR
407
+
408
+ 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.
409
+
410
+ 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.
411
+
412
+ Table 13: Average of best hyperparameters over 10 repeats.
413
+
414
+ <table><tr><td></td><td>IMDB-B</td><td>IMDB-M</td><td>RDT-B</td><td>RDT-M5K</td><td>COLLAB</td><td>MUTAG</td><td>PROTEINS</td><td>PTC</td><td>NCI1</td></tr><tr><td>GIN-FSPOOL</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>- dimensionality</td><td>64.0</td><td>64.0</td><td>64.0</td><td>64.0</td><td>64.0</td><td>28.8</td><td>19.2</td><td>28.8</td><td>30.4</td></tr><tr><td>- batch size</td><td>66.0</td><td>100</td><td>45.6</td><td>32.0</td><td>86.4</td><td>89.6</td><td>60.8</td><td>41.6</td><td>128</td></tr><tr><td>- dropout</td><td>0.25</td><td>0.15</td><td>0.35</td><td>0.10</td><td>0.40</td><td>0.15</td><td>0.35</td><td>0.20</td><td>0.50</td></tr><tr><td>GIN-BASE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>- dimensionality</td><td>64.0</td><td>64.0</td><td>64.0</td><td>64.0</td><td>64.0</td><td>27.2</td><td>20.8</td><td>25.6</td><td>28.8</td></tr><tr><td>- batch size</td><td>86.4</td><td>93.2</td><td>72.8</td><td>100</td><td>100</td><td>70.4</td><td>60.8</td><td>60.8</td><td>128</td></tr><tr><td> - dropout</td><td>0.30</td><td>0.15</td><td>0.25</td><td>0.45</td><td>0.40</td><td>0.25</td><td>0.45</td><td>0.20</td><td>0.35</td></tr></table>
415
+
416
+ # H.4 GRAPH CLASSIFICATION
417
+
418
+ 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.
419
+
420
+ 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.
421
+
422
+ # H.5 DEEP SET PREDICTION NETWORKS
423
+
424
+ 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.
425
+
426
+ 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.
md/train/HJgVisRqtX/HJgVisRqtX.md ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEGEN: SAMPLE-ENSEMBLE GENETIC EVOLUTIONARY NETWORK MODEL
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ 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).
26
+
27
+ 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.
28
+
29
+ # 3 PROBLEM FORMULATION
30
+
31
+ In this section, we will provide the definitions of several important terminologies, based on which we will define the network representation learning problem.
32
+
33
+ # 3.1 TERMINOLOGY DEFINITION
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ 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$ .
40
+
41
+ ![](images/4bc423953a52b18d71d07791e5696a4c8bd1c2bc5d0521a82977aff5f401d0d0.jpg)
42
+ Step 1: Network Sampling Step 2: Sub-Network Representation Learning Step 3: Result Ensemble
43
+ Figure 1: The SEGEN Framework.
44
+
45
+ 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 }$ .
46
+
47
+ 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.
48
+
49
+ # 3.2 PROBLEM FORMULATION
50
+
51
+ 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.
52
+
53
+ # 4 PROPOSED METHODS
54
+
55
+ 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.
56
+
57
+ # 4.1 NETWORK SAMPLING
58
+
59
+ 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.
60
+
61
+ # 4.1.1 BFS BASED NETWORK SAMPLING
62
+
63
+ 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).
64
+
65
+ # 4.1.2 DFS BASED NETWORK SAMPLING
66
+
67
+ 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$ ).
68
+
69
+ 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.
70
+
71
+ # 4.1.3 HS BASED NETWORK SAMPLING
72
+
73
+ 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 } }$ .
74
+
75
+ 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.
76
+
77
+ # 4.1.4 BIASED NODE SAMPLING
78
+
79
+ 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 } }$ .
80
+
81
+ # 4.1.5 BIASED EDGE SAMPLING
82
+
83
+ 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 } }$ .
84
+
85
+ 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.
86
+
87
+ # 4.2 GEN MODEL
88
+
89
+ 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.
90
+
91
+ # 4.2.1 UNIT MODEL POPULATION INITIALIZATION
92
+
93
+ 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.
94
+
95
+ # 4.2.2 UNIT MODEL DESCRIPTION
96
+
97
+ 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.
98
+
99
+ 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.
100
+
101
+ Based on each sampled sub-network $g \in { \mathcal { T } }$ , where $g = ( \mathcal { V } _ { g } , \mathcal { E } _ { g } )$ , we can represent
102
+ the sub-network structure as an adjacency matrix $\mathbf { A } _ { g } ~ = ~ \{ 0 , 1 \} ^ { | \mathcal { V } _ { g } | \times | \mathcal { V } _ { g } | }$ , where
103
+ $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
104
+ 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
105
+ representation of $\mathbf { x } _ { i }$ at hidden layers $1 , 2 , \cdots , o$ in the encoder step. The encoding
106
+ result in the objective feature space can be denoted as $\mathbf { z } _ { i } \in \mathbb { R } ^ { d }$ of dimension $d$ . In
107
+ the decoder step, the input will be the latent feature vector $\mathbf { z } _ { i }$ , and the final output
108
+ will be the reconstructed vector $\hat { \mathbf { x } } _ { i }$ (of the same dimension as $\mathbf { x } _ { i }$ ). The latent feature
109
+ 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
110
+ the architecture in Figure 2, the relationships among these variables can be represented with the following equations:
111
+
112
+ ![](images/92696322517e6778d385b19da3e64fc59e730e01c7b81dd72de69f50c33e900a.jpg)
113
+ Figure 2: Autoencoder Model.
114
+
115
+ $$
116
+ \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.
117
+ $$
118
+
119
+ 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:
120
+
121
+ $$
122
+ \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) ,
123
+ $$
124
+
125
+ 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 }$ .
126
+
127
+ # 4.2.3 GENERATION MODEL LEARNING SETTING
128
+
129
+ 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.
130
+
131
+ # 4.2.4 UNIT MODEL FITNESS EVALUATION AND SELECTION
132
+
133
+ 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
134
+
135
+ $$
136
+ \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 } ,
137
+ $$
138
+
139
+ 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.
140
+
141
+ The probability for each unit model to be picked as the parent model for the crossover and mutation operations can be represented as
142
+
143
+ $$
144
+ 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 } ) } } .
145
+ $$
146
+
147
+ 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 }$ .
148
+
149
+ # 4.2.5 UNIT MODEL CROSSOVER AND MUTATION
150
+
151
+ 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.
152
+
153
+ 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.
154
+
155
+ Formally, the chromosome inheritance probability for parent model $M _ { i } ^ { 1 }$ can be represented as
156
+
157
+ $$
158
+ 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 } ) } }
159
+ $$
160
+
161
+ Meanwhile, the chromosome inheritance probability for model $M _ { j } ^ { 1 }$ can be denoted as $p ( M _ { j } ^ { 1 } ) = 1 - p ( M _ { i } ^ { 1 } )$ .
162
+
163
+ 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
164
+
165
+ $$
166
+ \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}
167
+ $$
168
+
169
+ where indicator function $\mathbb { 1 } ( \cdot )$ returns value 1 if the condition is True; otherwise, it returns value 0.
170
+
171
+ 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
172
+
173
+ $$
174
+ \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 ) ,
175
+ $$
176
+
177
+ 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.
178
+
179
+ # 4.3 RESULT ENSEMBLE
180
+
181
+ 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.
182
+
183
+ # 4.3.1 LOCAL ENSEMBLE
184
+
185
+ 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
186
+
187
+ $$
188
+ \mathbf { z } _ { q } = \bigcup _ { g \in \mathcal { G } , M _ { j } \in \mathcal { M } , } \mathbf { z } _ { j , q } ,
189
+ $$
190
+
191
+ where operator t denotes the concatenation operation of feature vectors.
192
+
193
+ 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
194
+
195
+ $$
196
+ \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 } ,
197
+ $$
198
+
199
+ 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 }$ .
200
+
201
+ # 4.3.2 GLOBAL ENSEMBLE
202
+
203
+ 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.
204
+
205
+ 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:
206
+
207
+ $$
208
+ \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 } .
209
+ $$
210
+
211
+ 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.
212
+
213
+ # 4.4 MODEL ANALYSIS
214
+
215
+ 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.
216
+
217
+ # 4.4.1 PERFORMANCE ANALYSIS
218
+
219
+ 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.
220
+
221
+ 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).
222
+
223
+ # 4.4.2 SPACE AND TIME COMPLEXITY ANALYSIS
224
+
225
+ 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.
226
+
227
+ • Sampling: Original data size: $n$ . Sub-instance size: $n ^ { \prime }$ . Pool size: $p$ .
228
+
229
+ • Learning: Generation number: $K$ . Population size: $m$ . Feature vector size: $d$ . Training/Validation batch size: $b$ .
230
+
231
+ Here, we will use network structured data as an example to analyze the space and time complexity of the SEGEN model.
232
+
233
+ 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 } )$ .
234
+
235
+ 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$ .
236
+
237
+ Table 1: Representation Learning Experiment Results Comparison on Foursquare Network Dataset.
238
+
239
+ <table><tr><td rowspan="2">Network Recovery</td><td colspan="3">AUC</td><td colspan="3">Prec@500</td><td rowspan="2">Community Detection</td><td colspan="3">Density</td><td colspan="3">Silhouette</td></tr><tr><td>1</td><td>5</td><td>10</td><td>1</td><td>5</td><td>10</td><td>5</td><td>25</td><td>50</td><td>5</td><td>25</td><td>50</td></tr><tr><td>SEGEN(PS2)</td><td>0.909 (2)</td><td>0.909(2)</td><td>0.909 (2)</td><td>0.872 (2)</td><td>0.642 (3)</td><td>0.530 (3)1</td><td>SEGEN(PS3)</td><td>0.875 (2)</td><td>0.550 (2)</td><td>0.792(3)</td><td>0.353(2)</td><td>0.206 (2)</td><td>0.208 (3)</td></tr><tr><td>SEGEN(PS1)</td><td>0.817(6)</td><td>0.819(6)</td><td>0.818(6)</td><td>0.772 (5)</td><td>0.400(4)</td><td>0.266 (4)|</td><td>SEGEN(PS1)</td><td>0.792(6)</td><td>0.477(4)</td><td>0.742(4)</td><td>0.317(4)</td><td>0.188 (3)</td><td>0.156(5)</td></tr><tr><td>SEGEN-HS(PS2)</td><td>0.935(1)</td><td>0.936 (1)</td><td>0.936(1)</td><td>0.852 (4)</td><td>0.388(5)</td><td>0.000 (-)|</td><td>SEGEN-HS(PS3)</td><td>0.812(5)</td><td>0.385 (11)</td><td>0.705 (5)</td><td>0.252(10)</td><td>0.056(6)</td><td>0.166(4)</td></tr><tr><td>SEGEN-BFS(PS2)</td><td>0.860 (4)</td><td>0.859(4)</td><td>0.858(4)</td><td>0.428(10)</td><td>0.000(-)</td><td>0.000 (-)|</td><td>|SEGEN-BFS(PS3)</td><td>0.746(7)</td><td>0.425((8))</td><td>0.587(6)</td><td>0.206(11)</td><td>0.022(10)</td><td>0.108(6)</td></tr><tr><td>SEGEN-DFS(PS2) 0.881(3) 0.882 (3)</td><td></td><td></td><td>0.881(3)</td><td>0.965 (1)</td><td>0.814(2)</td><td>0.648 (2)|</td><td>| SEGEN-DFS(PS3)</td><td>0.860(4)</td><td>0.532(3)</td><td>0.436 (11)</td><td>0.280(9)</td><td>0.017(11)</td><td>-0.006 (11)</td></tr><tr><td>SEGEN-NS(PS2)</td><td>0.801 (7)</td><td>0.797(7)</td><td>0.797(7)</td><td>0.256(11) </td><td>0.002(10)</td><td>0.002 (9)</td><td>SEGEN-NS(PS3)</td><td>0.871(3)</td><td>0.425 (8)</td><td>0.824 (2)</td><td>0.327(3)</td><td>0.060 (5)</td><td>0.294 (2)</td></tr><tr><td>SEGEN-ES(PS2)</td><td></td><td>0.820 (5) 0.822 (5)</td><td>0.822 (5)</td><td>0.872 (2)</td><td>0.872(1)</td><td>0.872 (1))</td><td>SEGEN-ES(PS3)</td><td>0.948 (1)</td><td>0.933 (1)</td><td>0.924(1)</td><td>0.482 (1)</td><td>0.429 (1)</td><td>0.407(1)</td></tr><tr><td>LINE</td><td>0.536(9)</td><td>0.537(9)</td><td>0.537(9)</td><td>0.712 (6)</td><td>0.268 (9)</td><td>0.172 (7)1</td><td>LINE</td><td>0.695 (8)</td><td>0.443(6)</td><td>0.478(8)</td><td>0.311(5)</td><td>0.046(8)</td><td>0.082(8)</td></tr><tr><td>DEEPWALK</td><td></td><td>0.536(9) 0.537(9)</td><td>)0.537(9)</td><td>0.686 (9)</td><td>0.308(7)</td><td>0.184 (6))</td><td>DEEPWALK</td><td>0.695(8)</td><td>0.449 (5)</td><td>0.485(7)</td><td>0.311(5)</td><td>0.042 (9)</td><td>0.082(8)</td></tr><tr><td>NODE2VEC</td><td>0.538(8)</td><td>0.540(8)</td><td>0.539(8)</td><td>0.692(8)</td><td>0.299(8)</td><td>0.162(8)|</td><td>NODE2VEC</td><td>0.691(11)</td><td>0.419 (10)</td><td>0.469(9)</td><td>0.2978</td><td>0.066(4)</td><td>0.070(10)</td></tr><tr><td>HPE</td><td></td><td>0.536(9) 0.537(9) 0.537(9) 0.708(7)</td><td></td><td></td><td>0.354(6)</td><td>0.188(5))</td><td>HPE</td><td>0.695 (8)</td><td>0.431(7)</td><td>0.465 (10)</td><td>0.311(5)</td><td>0.051(7)</td><td>0.089(7)</td></tr></table>
240
+
241
+ # 4.4.3 ADVANTAGES OVER DEEP LEARNING MODELS
242
+
243
+ Compared with existing deep learning models based on the whole dataset, the advantages of SEGEN are summarized below:
244
+
245
+ • 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.
246
+ • 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.
247
+ • 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.
248
+ • 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.
249
+
250
+ # 5 EXPERIMENTS
251
+
252
+ 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.
253
+
254
+ # 5.1 SOCIAL NETWORK DATASET EXPERIMENTAL SETTINGS
255
+
256
+ # 5.1.1 EXPERIMENTAL SETUP
257
+
258
+ 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.
259
+
260
+ # 5.1.2 COMPARISON METHODS
261
+
262
+ The network representation learning comparison models used in this paper are listed as follows
263
+
264
+ Table 2: Representation Learning Experiment Results Comparison on Twitter Network Dataset.
265
+
266
+ <table><tr><td rowspan="2">Network Recovery</td><td colspan="3">AUC</td><td colspan="3">Prec@500</td><td rowspan="2">Community</td><td colspan="3">Density</td><td colspan="3">Silhouette</td></tr><tr><td>1</td><td>5</td><td>10</td><td>1</td><td>5</td><td>10</td><td>Detection</td><td>5</td><td>25</td><td>50 5</td><td>25</td><td>50</td></tr><tr><td>SEGEN(PS4)</td><td>0.879 (1)</td><td>0.881(1)</td><td></td><td></td><td>0.881 (1) 0.914(3) 0.638(3) 0.370 (3)</td><td></td><td>SEGEN(PS5)</td><td>0.980 (2)</td><td>0.845 (3)</td><td>0.770 (3)</td><td>)0.566(4)</td><td>0.353(3)</td><td>0.341(2)</td></tr><tr><td>SEGEN(PS1)</td><td>0.814 (4)</td><td></td><td></td><td></td><td>0.813 (4) 0.814(4)0.606(4) 0.194 (4) 0.102 (4)</td><td></td><td>SEGEN(PS1)</td><td>0.786 (7)</td><td>0.751(4)</td><td></td><td></td><td>0.753(4) 0.481(10) 0.328(4)</td><td>0.318(4)</td></tr><tr><td>SEGEN-HS(PS4)</td><td>0.862 (2)</td><td></td><td></td><td></td><td></td><td></td><td>)0.863(2).6(2).594(5)(-)0(-)N-(96(6)(1)(.45)(1)(</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SEENS(P4</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EGENDS</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SEGEN-NS(PS)(57(6()8()E57986(</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SEGENES(PS</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LINE</td><td></td><td></td><td></td><td></td><td>0.254 (11)0()0(1)0()18(7)(7)</td><td></td><td>LINE</td><td></td><td></td><td></td><td></td><td></td><td>0.524 (11) 0.324(10) 0.251(9) 0.465 (11) -0.012(9) -0.012 (7)</td></tr><tr><td>DEEPWALK</td><td></td><td></td><td></td><td></td><td>0.533(9)0.531(9)0.532(9)0.524(9) 0.146(6)0.070 (6)</td><td></td><td>DEEPWALK</td><td></td><td></td><td></td><td></td><td></td><td>0.545(10) 0.542(7)0.503(7)0.492(9)0.173(8)0.150(6)</td></tr><tr><td>NODE2VEC</td><td></td><td></td><td></td><td></td><td>0.704(7)0.703(7) 0.704(7)0.528 (8) 0.012(8) 0.000(-)|</td><td></td><td>NODE2VEC</td><td></td><td></td><td></td><td></td><td></td><td>0.697(8) 0.693(5) 0.694(5) 0.530 (8) -0.020 (10) -0.015 (8)</td></tr><tr><td>HPE</td><td></td><td></td><td></td><td></td><td>0.593(8)0.595 (8)0.594 (8)0.534(7) 0.186(5) 0.094 (5)</td><td></td><td>HPE</td><td></td><td></td><td></td><td></td><td></td><td>0.579(9)0.579(6)0.579(6) 0.544(6)0.208(7)0.187(5)</td></tr></table>
267
+
268
+ • 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.
269
+ • 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.
270
+ • 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.
271
+
272
+ # 5.1.3 EVALUATION TASKS AND METRICS
273
+
274
+ 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.
275
+
276
+ # 5.2 SOCIAL NETWORK DATASET EXPERIMENTAL RESULTS
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ 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.
283
+
284
+ Table 3: Experiments on MNIST Dataset.
285
+
286
+ <table><tr><td rowspan=1 colspan=1>Comparison Methods</td><td rowspan=1 colspan=1>Accuracy Rate%</td></tr><tr><td rowspan=1 colspan=1>SEGEN(CNN)</td><td rowspan=1 colspan=1>99.37</td></tr><tr><td rowspan=1 colspan=1>LeNet-5</td><td rowspan=1 colspan=1>99.05 Lecun et al. (1998)</td></tr><tr><td rowspan=1 colspan=1>gcForest</td><td rowspan=1 colspan=1>99.26 Zhou &amp; Feng (2017b)</td></tr><tr><td rowspan=1 colspan=1>Deep Belief Net</td><td rowspan=1 colspan=1>98.75 Hinton et al. (2006)</td></tr><tr><td rowspan=1 colspan=1>Random Forest</td><td rowspan=1 colspan=1>96.8 Zhou &amp; Feng (2017b)</td></tr><tr><td rowspan=1 colspan=1>SVM (rbf)</td><td rowspan=1 colspan=1>98.60 Decoste &amp; Scholkopf (2002)</td></tr></table>
287
+
288
+ Table 4: Experiments on Other Datasets.
289
+
290
+ <table><tr><td rowspan=2 colspan=1>Comparison Methods</td><td rowspan=1 colspan=3>Accuracy/Rate%onDatasets</td></tr><tr><td rowspan=1 colspan=1>YEAST</td><td rowspan=1 colspan=1>ADULT</td><td rowspan=1 colspan=1>LETTER</td></tr><tr><td rowspan=1 colspan=1>SEGEN (MLP)</td><td rowspan=1 colspan=1>63.70</td><td rowspan=1 colspan=1>87.05</td><td rowspan=1 colspan=1>96.90</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=1>62.05</td><td rowspan=1 colspan=1>85.03</td><td rowspan=1 colspan=1>96.70</td></tr><tr><td rowspan=1 colspan=1>gcForest</td><td rowspan=1 colspan=1>63.45</td><td rowspan=1 colspan=1>86.40</td><td rowspan=1 colspan=1>97.40</td></tr><tr><td rowspan=1 colspan=1>Random Forest</td><td rowspan=1 colspan=1>60.44</td><td rowspan=1 colspan=1>85.63</td><td rowspan=1 colspan=1>96.28</td></tr><tr><td rowspan=1 colspan=1>SVM (rbf)</td><td rowspan=1 colspan=1>40.76</td><td rowspan=1 colspan=1>76.41</td><td rowspan=1 colspan=1>97.06</td></tr><tr><td rowspan=1 colspan=1>kNN (k=3)</td><td rowspan=1 colspan=1>48.80</td><td rowspan=1 colspan=1>76.00</td><td rowspan=1 colspan=1>95.23</td></tr></table>
291
+
292
+ 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.
293
+
294
+ # 5.3 EXPERIMENTS ON OTHER DATASETS AND UNIT MODELS
295
+
296
+ 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.
297
+
298
+ 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.
299
+
300
+ # 6 CONCLUSION
301
+
302
+ 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.
303
+
304
+ REFERENCES
305
+ E. Arisoy, T. Sainath, B. Kingsbury, and B. Ramabhadran. Deep neural network language models. In WLM, 2012.
306
+ A. Bordes, N. Usunier, A. Garcia-Duran, J. Weston, and O. Yakhnenko. Translating embeddings for modeling multirelational data. In NIPS. 2013.
307
+ S. Chang, W. Han, J. Tang, G. Qi, C. Aggarwal, and T. Huang. Heterogeneous network embedding via deep architectures. In KDD, 2015.
308
+ C. Chen, M. Tsai, Y. Lin, and Y. Yang. Query-based music recommendations via preference embedding. In RecSys, 2016.
309
+ T. Chen and Y. Sun. Task-guided and path-augmented heterogeneous network embedding for author identification. CoRR, abs/1612.02814, 2016.
310
+ 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.
311
+ D. Decoste and B. Scholkopf. Training invariant support vector machines. ¨ Mach. Learn., 2002.
312
+ 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.
313
+ I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook. org.
314
+ A. Grover and J. Leskovec. Node2vec: Scalable feature learning for networks. In KDD, 2016.
315
+ S. Hill. Elite and upper-class families. In Families: A Social Class Perspective. 2012.
316
+ G. Hinton, S. Osindero, and Y. Teh. A fast learning algorithm for deep belief nets. Neural Comput., 2006.
317
+ 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.
318
+ 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.
319
+ A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
320
+ Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998.
321
+ Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521, 2015. doi: 10.1038/nature14539. http://dx.doi. org/10.1038/nature14539.
322
+ Y. Lin, Z. Liu, M. Sun, Y. Liu, and X. Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI, 2015.
323
+ T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013.
324
+ A. Mnih and G. Hinton. A scalable hierarchical distributed language model. In NIPS. 2009.
325
+ B. Perozzi, R. Al-Rfou, and S. Skiena. Deepwalk: Online learning of social representations. In KDD, 2014.
326
+ G. Rudolph. Convergence analysis of canonical genetic algorithms. IEEE Transactions on Neural Networks, 1994.
327
+ R. Salakhutdinov and G. Hinton. Semantic hashing. International Journal of Approximate Reasoning, 2009.
328
+ J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei. Line: Large-scale information network embedding. In WWW, 2015.
329
+ 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.
330
+ D. Wang, P. Cui, and W. Zhu. Structural deep network embedding. In KDD, 2016.
331
+ Z. Wang, J. Zhang, J. Feng, and Z. Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI, 2014.
332
+
333
+ J. Weston, S. Bengio, and N. Usunier. Large scale image annotation: Learning to rank with joint word-image embeddings. Journal of Machine Learning, 2010.
334
+
335
+ J. Weston, S. Bengio, and N. Usunier. Wsabie: Scaling up to large vocabulary image annotation. In IJCAI, 2011.
336
+
337
+ Z. Zhou and J. Feng. Deep forest: Towards an alternative to deep neural networks. In IJCAI, 2017a.
338
+
339
+ Z. Zhou and J. Feng. Deep forest: Towards an alternative to deep neural networks. In IJCAI, 2017b.
340
+
341
+ Z. Zhou, J. Wu, and W. Tang. Ensembling neural networks: Many could be better than all. Artif. Intell., 2002.
342
+
343
+ # 7 APPENDIX
344
+
345
+ # 7.1 SOCIAL NETWORK DATASET EXPERIMENTAL ANALYSIS
346
+
347
+ 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.
348
+ 7.1.1 CONVERGENCE ANALYSIS
349
+
350
+ ![](images/800d58dbb892c129b545deaac1befd114a0fbcbacaea90a90661e43b31e42af4.jpg)
351
+ Figure 3: Convergence Analysis on Foursquare and Twitter.
352
+
353
+ 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
354
+
355
+ ![](images/daca56841d89d132dda9a04e2596c684f30b2873b1d306a6e6e4216403631e37.jpg)
356
+ Figure 4: Sampling Parameter Analysis on Foursquare and Twitter.
357
+
358
+ 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
359
+
360
+ 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 \}$ .
361
+
362
+ 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.
363
+
364
+ ![](images/a214bddfde5a979a5cf1c8ac1818f382ef231bd094fe7f50000e0e880d625c43.jpg)
365
+ Figure 5: Batch and Generation Size Parameter Analysis on Foursquare and Twitter.
366
+
367
+ 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.
368
+
369
+ 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.
md/train/HJgXsjA5tQ/HJgXsjA5tQ.md ADDED
@@ -0,0 +1,549 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ON THE LOSS LANDSCAPE OF A CLASS OF DEEP NEURAL NETWORKS WITH NO BAD LOCAL VALLEYS
2
+
3
+ Quynh Nguyen Saarland University, Germany
4
+
5
+ Mahesh Chandra Mukkamala Saarland University, Germany
6
+
7
+ Matthias Hein University of Tübingen, Germany
8
+
9
+ # ABSTRACT
10
+
11
+ 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.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ 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.
16
+
17
+ ![](images/39469606f77237c568a7d4dcbaf77f29d8956c9eac32274d06f09e18edc54d4d.jpg)
18
+ Figure 1: An example loss landscape with bad local valleys (left) and without bad local valley (right).
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ # 2 DESCRIPTION OF NETWORK ARCHITECTURE
25
+
26
+ We consider a family of deep neural networks which have $d$ input units, $H$ hidden units, $m$ output units and satisfy the following conditions:
27
+
28
+ 1. Every hidden unit of the first layer can be connected to an arbitrary subset of input units.
29
+ 2. Every hidden unit at higher layers can take as input an arbitrary subset of hidden units from (multiple) lower hidden layers.
30
+ 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.
31
+ 4. There exist $N$ hidden units which are connected to the output nodes with independent weights ( $N$ denotes the number of training samples).
32
+ 5. The output of every hidden unit $j$ in the network, denoted as $f _ { j } : \mathbb { R } ^ { d } \mathbb { R }$ , is given as
33
+
34
+ $$
35
+ f _ { j } ( x ) = \sigma _ { j } \Bigl ( b _ { j } + \sum _ { k : k \to j } f _ { k } ( x ) u _ { k \to j } \Bigr )
36
+ $$
37
+
38
+ 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$ .
39
+
40
+ 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.
41
+
42
+ 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.
43
+
44
+ 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
45
+
46
+ ![](images/d8b5942633c28d84dac3472b71378ffc0e0fa2ecfac8051002037caa31e2bc80.jpg)
47
+ 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.
48
+
49
+ $$
50
+ \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]
51
+ $$
52
+
53
+ 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
54
+
55
+ $$
56
+ 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 ]
57
+ $$
58
+
59
+ 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
60
+
61
+ $$
62
+ \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 )
63
+ $$
64
+
65
+ 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.
66
+
67
+ Lemma 2.1 If $\begin{array} { r } { \Phi ( U , V ) < \frac { \log ( 2 ) } { N } } \end{array}$ , then the training error is zero.
68
+
69
+ 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,
70
+
71
+ $$
72
+ \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 ) .
73
+ $$
74
+
75
+ This implies that for all $i = 1 , \ldots , N$ ,
76
+
77
+ $$
78
+ \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 .
79
+ $$
80
+
81
+ 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. 
82
+
83
+ # 3 MAIN RESULT
84
+
85
+ The following conditions are required for the main result to hold.
86
+
87
+ Assumption 3.1 increasing
88
+
89
+ 1. All activation functions $\{ \sigma _ { d + 1 } , \ldots , \sigma _ { d + H } \}$ are real analytic and strictly
90
+
91
+ 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:
92
+
93
+ • 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.
94
+
95
+ 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 } }$ .
96
+
97
+ 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),
98
+
99
+ $$
100
+ \sigma _ { \gamma } ( t ) = \frac { 1 } { \gamma } \log ( 1 + e ^ { \gamma t } ) , ~ \mathrm { f o r ~ s o m e } \gamma > 0 ,
101
+ $$
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ The following key lemma shows that for almost all $U$ , the matrix $\Psi ( U )$ has full rank.
108
+
109
+ Lemma 3.2 Under Assumption 3.1, the set of $U$ such that $\Psi ( U )$ has not full rank N has Lebesgue measure zero.
110
+
111
+ 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.
112
+
113
+ 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 }$ ,
114
+
115
+ $$
116
+ \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 ]
117
+ $$
118
+
119
+ 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. 
120
+
121
+ 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.
122
+
123
+ 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”.
124
+
125
+ 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.
126
+
127
+ Theorem 3.4 The following holds under Assumption 3.1:
128
+
129
+ 1. There exist uncountably many solutions with zero training error.
130
+
131
+ 2. The loss landscape of $\Phi$ does not have any bad local valley.
132
+
133
+ 3. There exists no suboptimal strict local minimum.
134
+
135
+ 4. There exists no local maximum.
136
+
137
+ # Proof:
138
+
139
+ 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.
140
+
141
+ 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
142
+
143
+ $$
144
+ \Phi ( U , V ^ { * } ) = - \log \Big ( \frac { e ^ { t ^ { * } } } { e ^ { t ^ { * } } + ( m - 1 ) } \Big ) = \log ( 1 + ( m - 1 ) e ^ { - t ^ { * } } ) = \frac { \epsilon } { 2 } .
145
+ $$
146
+
147
+ 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 ]$ ,
148
+
149
+ $$
150
+ \Phi ( U , V ( \lambda ) ) \le \lambda \Phi ( U , V ) + ( 1 - \lambda ) \Phi ( U , V ^ { * } ) < \lambda \alpha + ( 1 - \lambda ) \frac { \epsilon } { 2 } < \alpha .
151
+ $$
152
+
153
+ 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.
154
+
155
+ 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.
156
+
157
+ 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
158
+
159
+ $$
160
+ \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 }
161
+ $$
162
+
163
+ 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.
164
+
165
+ 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.
166
+
167
+ 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).
168
+
169
+ # 4 EXPERIMENTS
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ 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
182
+
183
+ <table><tr><td></td><td>Sigmoid activation function</td><td>Softplus activation function</td></tr><tr><td>CNN13</td><td>11.35</td><td>99.20</td></tr><tr><td>CNN13-skip (SGD)</td><td>98.40 ± 0.07</td><td>99.14 ± 0.04</td></tr></table>
184
+
185
+ 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.
186
+
187
+ 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.
188
+
189
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Sigmoid activation function</td><td rowspan=1 colspan=2>Softplus activation function</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test acc (%)</td><td rowspan=1 colspan=1>Train acc (%)</td><td rowspan=1 colspan=1>Test acc (%)</td><td rowspan=1 colspan=1>Train acc (%)</td></tr><tr><td rowspan=1 colspan=1>VGG11VGG11-skip (rand)VGG11-skip (SGD)</td><td rowspan=1 colspan=1>1062.81 ± 0.3972.51 ± 0.35</td><td rowspan=1 colspan=1>10100100</td><td rowspan=1 colspan=1>78.9264.49 ± 0.3880.57 ± 0.40</td><td rowspan=1 colspan=1>100100100</td></tr><tr><td rowspan=1 colspan=1>VGG13VGG13-skip (rand)VGG13-skip (SGD)</td><td rowspan=1 colspan=1>1061.50 ± 0.3470.24 ± 0.39</td><td rowspan=1 colspan=1>10100100</td><td rowspan=1 colspan=1>80.8461.42 ± 0.4081.94 ± 0.40</td><td rowspan=1 colspan=1>100100100</td></tr><tr><td rowspan=1 colspan=1>VGG16VGG16-skip (rand)VGG16-skip (SGD)</td><td rowspan=1 colspan=1>1061.57 ± 0.4170.61 ± 0.36</td><td rowspan=1 colspan=1>10100100</td><td rowspan=1 colspan=1>81.3361.46 ± 0.3481.91 ± 0.24</td><td rowspan=1 colspan=1>100100100</td></tr><tr><td rowspan=1 colspan=1>Densenet121Densenet121-skip (rand)Densenet121-skip (SGD)</td><td rowspan=1 colspan=1>86.4152.07 ± 0.4881.47 ± 1.03</td><td rowspan=1 colspan=1>100100100</td><td rowspan=1 colspan=1>89.3155.39 ± 0.4886.76 ± 0.49</td><td rowspan=1 colspan=1>100100100</td></tr></table>
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ # 5 RELATED WORK
196
+
197
+ 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.
198
+
199
+ # 6 CONCLUSION
200
+
201
+ 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.
202
+
203
+ # REFERENCES
204
+
205
+ A. Andoni, R. Panigrahy, G. Valiant, and L. Zhang. Learning polynomials with neural networks. ICML, 2014.
206
+ T. M. Apostol. Mathematical analysis. Addison Wesley, 1974.
207
+ P. Auer, M. Herbster, and M. K. Warmuth. Exponentially many local minima for single neurons. NIPS, 1996.
208
+ A. Blum and R. L Rivest. Training a 3-node neural network is np-complete. NIPS, 1989.
209
+ A. Brutzkus and A. Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. ICML, 2017.
210
+ A. Brutzkus, A. Globerson, E. Malach, and S. Shalev-Shwartz. Sgd learns over-parameterized networks that provably generalize on linearly separable data. ICLR, 2018.
211
+ A. Choromanska, M. Hena, M. Mathieu, G. B. Arous, and Y. LeCun. The loss surfaces of multilayer networks. AISTATS, 2015.
212
+ 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.
213
+ 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.
214
+ A. Gautier, Q. Nguyen, and M. Hein. Globally optimal training of generalized polynomial neural networks with nonlinear spectral methods. NIPS, 2016.
215
+ X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. ICML, 2010.
216
+ I. J. Goodfellow, O. Vinyals, and A. M. Saxe. Qualitatively characterizing neural network optimization problems. ICLR, 2015.
217
+ B. D. Haeffele and R. Vidal. Global optimality in neural network training. CVPR, 2017.
218
+ M. Hardt and T. Ma. Identity matters in deep learning. ICLR, 2017.
219
+ K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CVPR, 2016.
220
+ G. Huang, Z. Liu, L. Maaten, and K. Weinberger. Densely connected convolutional networks. CVPR, 2017.
221
+ 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.
222
+ K. Kawaguchi. Deep learning without poor local minima. NIPS, 2016.
223
+ A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. NIPS, 2012.
224
+ 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.
225
+ H. Li, Z. Xu, G. Taylor, C. Studer, and T. Goldstein. Visualizing the loss landscape of neural nets. In ICLR Workshop, 2018.
226
+ S. Liang, R. Sun, J. D. Lee, and R. Srikant. Adding one neuron can eliminate all bad local minima. arXiv:1805.08671, 2018a.
227
+ S. Liang, R. Sun, Y. Li, and R. Srikant. Understanding the loss surface of neural networks for binary classification. In ICML, 2018b.
228
+ R. Livni, S. Shalev-Shwartz, and O. Shamir. On the computational efficiency of training neural networks. NIPS, 2014.
229
+ H. Lu and K. Kawaguchi. Depth creates no bad local minima. arXiv:1702.08580, 2017.
230
+ B. Mityagin. The zero set of a real analytic function. arXiv:1512.07276, 2015.
231
+ B. Neyshabur, S. Bhojanapalli, D. McAllester, and N. Srebro. Exploring generalization in deep learning. NIPS, 2017.
232
+ Q. Nguyen and M. Hein. The loss surface of deep and wide neural networks. ICML, 2017.
233
+ Q. Nguyen and M. Hein. Optimization landscape and expressivity of deep cnns. ICML, 2018.
234
+ V. D. Nguyen. Complex powers of analytic functions and meromorphic renormalization in qft. arXiv:1503.00995, 2015.
235
+ M. Nouiehed and M. Razaviyayn. Learning deep models: Critical points and local openness. ICLR Workshop, 2018.
236
+ I. Safran and O. Shamir. On the quality of the initial basin in overspecified networks. ICML, 2016.
237
+ I. Safran and O. Shamir. Spurious local minima are common in two-layer relu neural networks. ICML, 2018.
238
+ H. Sedghi and A. Anandkumar. Provable methods for training neural networks with sparse connectivity. ICLR Workshop, 2015.
239
+ S. Shalev-Shwartz, O. Shamir, and S. Shammah. Failures of gradient-based deep learning. ICML, 2017.
240
+ J. Sima. Training a single sigmoidal neuron is hard. Neural Computation, 14:2709–2728, 2002.
241
+ K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. ICLR, 2015.
242
+ M. Soltanolkotabi. Learning relus via gradient descent. NIPS, 2017.
243
+ D. Soudry and E. Hoffer. Exponentially vanishing sub-optimal local minima in multilayer neural networks. ICLR Workshop 2018, 2017.
244
+ D. Soudry, E. Hoffer, M. S. Nacson, and N. Srebro. The implicit bias of gradient descent on separable data. ICLR, 2018.
245
+ Y. Tian. An analytical formula of population gradient for two-layered relu network and its applications in convergence and critical point analysis. ICML, 2017.
246
+ L. Venturi, A. S. Bandeira, and J. Bruna. Spurious valleys in two-layer neural network optimization landscapes. arXiv:1802.06384, 2018.
247
+ G. Wang, G. B. Giannakis, and J. Chen. Learning relu networks on linearly separable data: Algorithm, optimality, and generalization. arXiv:1808.04685, 2018.
248
+ X. Yu and G. Chen. On the local minima free condition of backpropagation learning. IEEE Transaction on Neural Networks, 6:1300–1303, 1995.
249
+ C. Yun, S. Sra, and A. Jadbabaie. Global optimality conditions for deep neural networks. ICLR, 2017.
250
+ S. Zagoruyko and N. Komodakis. Wide residual networks. BMCV, 2016.
251
+ C. Zhang, S. Bengio, M. Hardt, B. Recht, and Oriol Vinyals. Understanding deep learning requires re-thinking generalization. ICLR, 2017.
252
+ H. Zhang, J. Shao, and R. Salakhutdinov. Deep neural networks with multi-branch architectures are less non-convex. arXiv:1806.01845, 2018.
253
+ K. Zhong, Z. Song, P. Jain, P. Bartlett, and I. Dhillon. Recovery guarantees for one-hidden-layer neural networks. ICML, 2017.
254
+
255
+ # A MATHEMATICAL TOOLS
256
+
257
+ In the proof of Lemma 3.2 we make use of the following property of analytic functions.
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ # B PROOF OF LEMMA 3.2
266
+
267
+ 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.
268
+
269
+ 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
270
+
271
+ $$
272
+ 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 .
273
+ $$
274
+
275
+ 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,
276
+
277
+ $$
278
+ g _ { j } ( x _ { i } ) = \sum _ { k j } ( x _ { i } ) _ { k } u _ { k } { } j .
279
+ $$
280
+
281
+ 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
282
+
283
+ $$
284
+ \sum _ { k j } f _ { k } ( x ) u _ { k j } = f _ { c ( j ) } ( x ) .
285
+ $$
286
+
287
+ 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
288
+
289
+ $$
290
+ \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}
291
+ $$
292
+
293
+ 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
294
+
295
+ $$
296
+ \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}
297
+ $$
298
+
299
+ 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,
300
+
301
+ $$
302
+ 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 ] .
303
+ $$
304
+
305
+ 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
306
+
307
+ $$
308
+ \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 } )
309
+ $$
310
+
311
+ 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
312
+
313
+ $$
314
+ \delta _ { i j } : = f _ { c ( p _ { j } ) } ( x _ { i } ) - f _ { c ( p _ { j } ) } ( x _ { j } ) < 0 \quad \forall i , j \in [ N ] , i > j
315
+ $$
316
+
317
+ 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:
318
+
319
+ • 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,
320
+
321
+ $$
322
+ \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\}
323
+ $$
324
+
325
+ 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.
326
+
327
+ The main idea of choosing the above values of $\alpha$ is to obtain
328
+
329
+ $$
330
+ \begin{array} { r } { \Psi _ { i j } = f _ { p _ { j } } ( x _ { i } ) \le \epsilon \quad \forall i , j \in [ N ] , i > j . } \end{array}
331
+ $$
332
+
333
+ 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
334
+
335
+ $$
336
+ \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 ]
337
+ $$
338
+
339
+ which combined with (8) leads to
340
+
341
+ $$
342
+ \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}
343
+ $$
344
+
345
+ and thus using (6) we obtain (10).
346
+
347
+ 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
348
+
349
+ $$
350
+ \vert \Psi _ { i j } \vert \le C \quad \forall i , j \in [ N ]
351
+ $$
352
+
353
+ By the Leibniz-formula one has
354
+
355
+ $$
356
+ \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 }
357
+ $$
358
+
359
+ 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
360
+
361
+ $$
362
+ \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
363
+ $$
364
+
365
+ 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
366
+
367
+ $$
368
+ \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
369
+ $$
370
+
371
+ and thus $\Psi$ has full rank.
372
+
373
+ • 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.
374
+
375
+ 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,
376
+
377
+ $$
378
+ \sum _ { k p _ { j } } f _ { k } ( x _ { i } ) u _ { k p _ { j } } = f _ { c ( p _ { j } ) } ( x _ { i } ) .
379
+ $$
380
+
381
+ 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
382
+
383
+ $$
384
+ \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}
385
+ $$
386
+
387
+ 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.
388
+
389
+ 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 ]$
390
+
391
+ $$
392
+ 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 ) ,
393
+ $$
394
+
395
+ where
396
+
397
+ $$
398
+ 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 ] .
399
+ $$
400
+
401
+ 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
402
+
403
+ $$
404
+ | \prod _ { j = 1 } ^ { N } \Psi _ { \pi ( j ) j } | \leq c _ { 1 } e ^ { - \alpha c _ { 2 } } ( c _ { 3 } + \alpha ) ^ { N - 1 } .
405
+ $$
406
+
407
+ This can be made arbitrarily small by increasing $\alpha$ . Thus we get
408
+
409
+ $$
410
+ \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
411
+ $$
412
+
413
+ 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} }$
414
+
415
+ # C EXTENSION OF THEOREM 3.4 TO GENERAL CONVEX LOSSES
416
+
417
+ In this section, we consider a more general training objective, defined as
418
+
419
+ $$
420
+ \Phi ( U , V ) = \varphi ( G ( U , V ) )
421
+ $$
422
+
423
+ 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.
424
+
425
+ Assumption C.1 The loss function $\varphi : \mathbb { R } ^ { N \times m } \mathbb { R }$ is convex and bounded from below.
426
+
427
+ One can easily check that the following loss functions satisfy Assumption C.1 as they are all convex and bounded from below by zero:
428
+
429
+ 1. The cross-entropy loss from Equation 2, in particular:
430
+
431
+ $$
432
+ \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 ) ,
433
+ $$
434
+
435
+ where $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N }$ is the training data with $y _ { i }$ being the ground-truth class of $x _ { i }$
436
+
437
+ 2. The standard square loss (for classification/regression tasks)
438
+
439
+ $$
440
+ \varphi ( G ) = \frac { 1 } { 2 } \left. G - Y \right. _ { F } ^ { 2 } ,
441
+ $$
442
+
443
+ where $Y \in \mathbb { R } ^ { N \times m }$ is the ground-truth matrix.
444
+
445
+ 3. The multi-class Hinge-loss (for classification tasks)
446
+
447
+ $$
448
+ \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 } ) ) ,
449
+ $$
450
+
451
+ where $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N }$ is the training data with $y _ { i }$ being the ground-truth class of $x _ { i }$ .
452
+
453
+ By Assumption C.1, $\varphi$ is bounded from below, thus it attains a finite infimum:
454
+
455
+ $$
456
+ p ^ { * } : = \operatorname* { i n f } _ { G \in \mathbb { R } ^ { N \times m } } \varphi ( G ) < \infty .
457
+ $$
458
+
459
+ 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.
460
+
461
+ 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 ^ { * }$ .
462
+
463
+ 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.
464
+
465
+ Theorem C.3 The following holds under Assumption 3.1 and Assumption $C . I$ :
466
+
467
+ 1. There exist uncountably many solutions with zero training error.
468
+
469
+ 2. The loss landscape of $\Phi$ does not have any bad local valley.
470
+
471
+ 3. There exists no suboptimal strict local minimum.
472
+
473
+ 4. For cross-entropy loss (2) and square loss (14) there exists no local maximum.
474
+
475
+ # Proof:
476
+
477
+ 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.
478
+
479
+ 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 ^ { * }$ .
480
+
481
+ 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 ]$ ,
482
+
483
+ $$
484
+ \Phi ( U , V ( \lambda ) ) \le \lambda \Phi ( U , V ) + ( 1 - \lambda ) \Phi ( U , V ^ { * } ) < \lambda \alpha + ( 1 - \lambda ) \epsilon < \alpha .
485
+ $$
486
+
487
+ 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 )$ .
488
+
489
+ 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.
490
+
491
+ 4. The proof for cross-entropy loss is similar to Theorem 3.4. For square loss, one has
492
+
493
+ $$
494
+ \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 }
495
+ $$
496
+
497
+ 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$
498
+
499
+ 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.
500
+
501
+ D THE ARCHITECTURE OF CNN13 FROM TABLE 1: SEE TABLE 3
502
+
503
+ <table><tr><td rowspan=1 colspan=1>Layer</td><td rowspan=1 colspan=1>Output size</td><td rowspan=1 colspan=1>#neurons</td></tr><tr><td rowspan=1 colspan=1>Input: 28 × 28</td><td rowspan=1 colspan=1>28×28×1</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>3×3conv-64,stride1</td><td rowspan=1 colspan=1>28×28×64</td><td rowspan=1 colspan=1>50176</td></tr><tr><td rowspan=1 colspan=1>3×3conv-64,stride1</td><td rowspan=1 colspan=1>28×28×64</td><td rowspan=1 colspan=1>50176</td></tr><tr><td rowspan=1 colspan=1>3×3conv-64,stride 2</td><td rowspan=1 colspan=1>14×14×64</td><td rowspan=1 colspan=1>12544</td></tr><tr><td rowspan=1 colspan=1>3 ×3conv -128,stride1</td><td rowspan=1 colspan=1>14×14×128</td><td rowspan=1 colspan=1>25088</td></tr><tr><td rowspan=1 colspan=1>3 ×3conv-128,stride1</td><td rowspan=1 colspan=1>14×14×128</td><td rowspan=1 colspan=1>25088</td></tr><tr><td rowspan=1 colspan=1>3 ×3conv-128,stride2</td><td rowspan=1 colspan=1>7×7×128</td><td rowspan=1 colspan=1>6272</td></tr><tr><td rowspan=1 colspan=1>3 ×3conv -256,stride1</td><td rowspan=1 colspan=1>7×7×256</td><td rowspan=1 colspan=1>12544</td></tr><tr><td rowspan=1 colspan=1>1 × 1conv - 256,stride1</td><td rowspan=1 colspan=1>7×7×256</td><td rowspan=1 colspan=1>12544</td></tr><tr><td rowspan=1 colspan=1>3×3conv-256,stride2</td><td rowspan=1 colspan=1>4×4×256</td><td rowspan=1 colspan=1>4096</td></tr><tr><td rowspan=1 colspan=1>3×3conv-256,stride1</td><td rowspan=1 colspan=1>4×4×256</td><td rowspan=1 colspan=1>4096</td></tr><tr><td rowspan=1 colspan=1>3×3conv-256,stride2</td><td rowspan=1 colspan=1>2×2×256</td><td rowspan=1 colspan=1>1024</td></tr><tr><td rowspan=1 colspan=1>3 × 3conv- 256,stride1</td><td rowspan=1 colspan=1>2×2×256</td><td rowspan=1 colspan=1>1024</td></tr><tr><td rowspan=1 colspan=1>3×3conv-256,stride2</td><td rowspan=1 colspan=1>1×1×256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=3>Fully connected,10 output units</td></tr></table>
504
+
505
+ Table 3: The architecture of CNN13 for MNIST dataset. There are in total 179, 840 hidden neurons.
506
+
507
+ # E VISUALIZATION OF THE LOSS LANDSCAPE BEFORE AND AFTER ADDING SKIP-CONNECTIONS TO THE OUTPUT LAYER
508
+
509
+ 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 } )$ .
510
+
511
+ 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.
512
+
513
+ # F DISCUSSION OF TRAINING ERROR IN TABLE 2
514
+
515
+ 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.
516
+
517
+ ![](images/67f0ad64a205e40f6d91db078bdced8be23d0dd2fb47417fc8a78564b9679d34.jpg)
518
+ Figure 3: Loss surface of a two-hidden-layer network on a small MNIST dataset.
519
+
520
+ ![](images/99cc486e2c89f05108ef52cdbb45384c550c70c8a158dc518a8efb2ebf7127e8.jpg)
521
+
522
+ 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.
523
+
524
+ 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.
525
+
526
+ ![](images/e2f8aa5f93b0ade6b31678fc1a12d924e7b7ca999478079dcb0075a6b677c85d.jpg)
527
+ Figure 5: Training progress of a 150-layer neural network with and without skip-connections.
528
+
529
+ # G ADDITIONAL EXPERIMENTS: MAX-POOLING OF VGGS ARE REPLACED BY 2X2 CONVOLUTIONAL LAYERS OF STRIDE 2
530
+
531
+ 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.
532
+
533
+ 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.
534
+
535
+ 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.
536
+
537
+ 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.
538
+
539
+ 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.
540
+
541
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Sigmoid activation function</td><td rowspan=1 colspan=2>Softplus activation function</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>C-10</td><td rowspan=1 colspan=1>C-10+</td><td rowspan=1 colspan=1>C-10</td><td rowspan=1 colspan=1>C-10+</td></tr><tr><td rowspan=1 colspan=1>VGG11-mp2convVGG11-mp2conv-skip (rand)VGG11-mp2conv-skip (SGD)</td><td rowspan=1 colspan=1>1053.65 ± 0.6664.45 ± 0.31</td><td rowspan=1 colspan=1>10-80.15 ± 0.59</td><td rowspan=1 colspan=1>74.5355.51 ± 0.4376.18 ± 0.58</td><td rowspan=1 colspan=1>88.80-89.93 ± 0.19</td></tr><tr><td rowspan=1 colspan=1>VGG13-mp2convVGG13-mp2conv-skip (rand)</td><td rowspan=1 colspan=1>1053.45 ± 0.23</td><td rowspan=2 colspan=1>10-82.40 ± 0.23</td><td rowspan=2 colspan=1>74.0453.33 ± 0.6775.58 ± 0.77</td><td rowspan=2 colspan=1>90.37-91.04 ± 0.20</td></tr><tr><td rowspan=1 colspan=1>VGG13-mp2conv-skip (SGD)</td><td rowspan=1 colspan=1>63.53 ± 0.37</td></tr><tr><td rowspan=1 colspan=1>VGG16-mp2convVGG16-mp2conv-skip (rand)VGG16-mp2conv-skip (SGD)</td><td rowspan=1 colspan=1>1053.83 ± 0.3065.77 ± 0.67</td><td rowspan=1 colspan=1>10-83.06 ± 0.34</td><td rowspan=1 colspan=1>74.0055.34 ± 0.6476.52 ± 0.78</td><td rowspan=1 colspan=1>90.38-91.00 ± 0.23</td></tr></table>
542
+
543
+ # H DATA-AUGMENTATION RESULTS FOR TABLE 2
544
+
545
+ 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.
546
+
547
+ 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).
548
+
549
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Sigmoid activation function</td><td rowspan=1 colspan=2>Softplus activation function</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>C-10</td><td rowspan=1 colspan=1>C-10+</td><td rowspan=1 colspan=1>C-10</td><td rowspan=1 colspan=1>C-10+</td></tr><tr><td rowspan=2 colspan=1>VGG11VGG11-skip (rand)VGG11-skip (SGD)</td><td rowspan=2 colspan=1>1062.81 ± 0.3972.51 ± 0.35</td><td rowspan=2 colspan=1>10-85.55 ± 0.09</td><td rowspan=1 colspan=1>78.92</td><td rowspan=2 colspan=1>88.62-89.32 ± 0.16</td></tr><tr><td rowspan=1 colspan=1>64.49 ± 0.3880.57 ± 0.40</td></tr><tr><td rowspan=1 colspan=1>VGG13VGG13-skip (rand)VGG13-skip (SGD)</td><td rowspan=1 colspan=1>1061.50 ± 0.3470.24 ± 0.39</td><td rowspan=1 colspan=1>10-86.48 ± 0.32</td><td rowspan=1 colspan=1>80.8461.42 ± 0.4081.94 ± 0.40</td><td rowspan=1 colspan=1>90.58-91.06 ± 0.12</td></tr><tr><td rowspan=1 colspan=1>VGG16VGG16-skip (rand)VGG16-skip (SGD)</td><td rowspan=1 colspan=1>1061.57 ± 0.4170.61 ± 0.36</td><td rowspan=1 colspan=1>10-86.42 ± 0.31</td><td rowspan=1 colspan=1>81.3361.46 ± 0.3481.91 ± 0.24</td><td rowspan=1 colspan=1>90.68-91.00 ± 0.22</td></tr><tr><td rowspan=1 colspan=1>Densenet121Densenet121-skip (rand)Densenet121-skip (SGD)</td><td rowspan=1 colspan=1>86.4152.07 ± 0.4881.47 ± 1.03</td><td rowspan=1 colspan=1>90.93-90.32 ± 0.50</td><td rowspan=1 colspan=1>89.3155.39 ± 0.4886.76 ± 0.49</td><td rowspan=1 colspan=1>94.20-93.23 ± 0.42</td></tr></table>
md/train/HJgeEh09KQ/HJgeEh09KQ.md ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BOOSTING ROBUSTNESS CERTIFICATION OF NEURAL NETWORKS
2
+
3
+ Gagandeep Singh, Timon Gehr, Markus Puschel, Martin Vechev ¨
4
+ Department of Computer Science
5
+ ETH Zurich, Switzerland
6
+ {gsingh,timon.gehr,pueschel,martin.vechev}@inf.ethz.ch
7
+
8
+ # ABSTRACT
9
+
10
+ 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.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ 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.
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ ![](images/7a0491d129f7a4873853b23672643797418fbf229fbcf01751b183d9521de53e.jpg)
23
+ 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.
24
+
25
+ Main contributions. Our main contributions are:
26
+
27
+ • A refinement-based approach for certifying neural network robustness that combines the strengths of fast overapproximation methods with MILP solvers and LP relaxations.
28
+ • A novel heuristic for selecting neurons whose bounds should be further refined.
29
+ • A complete end-to-end implementation of our approach in a system called RefineZono, publicly available at https://github.com/eth-sri/eran.
30
+ • 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.
31
+
32
+ # 2 OVERVIEW
33
+
34
+ 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.
35
+
36
+ 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 }$ .
37
+
38
+ 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:
39
+
40
+ ![](images/c7ab12426daaca803a962f4365b2e0e3c8f9d277b034f448b2cf1ce36e4a2ba9.jpg)
41
+ 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.
42
+
43
+ $$
44
+ \hat { x } : = c _ { 0 } + \sum _ { i = 1 } ^ { p } c _ { i } \cdot \eta _ { i }
45
+ $$
46
+
47
+ 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 } ]$ .
48
+
49
+ First layer. Our analysis starts by setting
50
+
51
+ $$
52
+ \hat { x } _ { 1 } = 0 . 5 + 0 . 5 \cdot \eta _ { 1 } , l _ { 1 } = 0 , u _ { 1 } = 1
53
+ $$
54
+
55
+ and
56
+
57
+ $$
58
+ \begin{array} { r } { \hat { x } _ { 2 } = 0 . 5 + 0 . 5 \cdot \eta _ { 2 } , l _ { 2 } = 0 , u _ { 2 } = 1 , } \end{array}
59
+ $$
60
+
61
+ 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
62
+
63
+ $$
64
+ \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
65
+ $$
66
+
67
+ and
68
+
69
+ $$
70
+ \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 .
71
+ $$
72
+
73
+ 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
74
+
75
+ $$
76
+ \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 .
77
+ $$
78
+
79
+ 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.
80
+
81
+ MILP-based refinement at second layer. Next, the analysis handles the second affine transformation and computes
82
+
83
+ $$
84
+ \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
85
+ $$
86
+
87
+ and
88
+
89
+ $$
90
+ \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 .
91
+ $$
92
+
93
+ 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 }$ .
94
+
95
+ 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$ .
96
+
97
+ 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
98
+
99
+ $$
100
+ \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 .
101
+ $$
102
+
103
+ LP-based refinement at final layer. Continuing with the analysis, we now process the final affine transformation, which yields
104
+
105
+ $$
106
+ { \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
107
+ $$
108
+
109
+ and
110
+
111
+ $$
112
+ { \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 .
113
+ $$
114
+
115
+ 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 } .$ .
116
+
117
+ 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
118
+
119
+ $$
120
+ { \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
121
+ $$
122
+
123
+ and
124
+
125
+ $$
126
+ \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 .
127
+ $$
128
+
129
+ As a result, DeepZ fails to prove that $x _ { 1 3 }$ is greater than $x _ { 1 4 }$ , and thus fails to prove robustness.
130
+
131
+ 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.
132
+
133
+ # 3 OUR APPROACH
134
+
135
+ 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.
136
+
137
+ 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:
138
+
139
+ • 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$ .
140
+ • 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.)
141
+ • 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 }$ .
142
+ • 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 )$ .
143
+ • 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 ) )$
144
+
145
+ for all $a \in \mathbb { A } _ { m }$
146
+
147
+ • A ReLU abstract transformer $T _ { \mathrm { R e L U } | _ { \Pi _ { i } [ l _ { i } , u _ { i } ] } } ^ { \# } : \mathbb { A } _ { n } \to \mathbb { A } _ { n }$ , where
148
+
149
+ $$
150
+ \{ \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 )
151
+ $$
152
+
153
+ 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.
154
+
155
+ 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.
156
+
157
+ 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
158
+
159
+ $$
160
+ a _ { \mathrm { i n } } = \alpha _ { m } ( \{ \bar { \pmb { x } } \in \mathbb { R } ^ { m } \ | \ | \bar { \pmb { x } } - \pmb { x } | | _ { \infty } \leq \epsilon \} ) .
161
+ $$
162
+
163
+ 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.
164
+
165
+ 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:
166
+
167
+ $$
168
+ a ^ { \prime \prime } = T _ { \mathrm { R e L U } | } ^ { \# } { } _ { \Pi _ { i } \lbrack l _ { i } , u _ { i } \rbrack } ( a ^ { \prime } ) .
169
+ $$
170
+
171
+ 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$ .
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ 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:
178
+
179
+ $$
180
+ \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}
181
+ $$
182
+
183
+ 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.
184
+
185
+ 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:
186
+
187
+ • 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 }$ .
188
+
189
+ 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.
190
+
191
+ 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 ) } )$
192
+
193
+ 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:
194
+
195
+ $$
196
+ \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}
197
+ $$
198
+
199
+ 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 ) }$ .
200
+
201
+ 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.
202
+
203
+ 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 ) }$ .
204
+
205
+ 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.
206
+
207
+ 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 } } }$ .
208
+
209
+ 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$ .
210
+
211
+ 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.
212
+
213
+ Table 1: Neural network architectures used in our experiments.
214
+
215
+ <table><tr><td>Dataset</td><td>Model</td><td>Type</td><td>#Neurons</td><td>#layers</td><td>Defense</td></tr><tr><td>MNIST</td><td>3×50</td><td>fully connected</td><td>160</td><td>3</td><td>None</td></tr><tr><td></td><td>5×100</td><td>fully connected</td><td>510</td><td>5</td><td>DiffAI</td></tr><tr><td></td><td>6×100</td><td>fully connected</td><td>610</td><td>6</td><td>None</td></tr><tr><td></td><td>9 ×100</td><td>fully connected</td><td>910</td><td>9</td><td>None</td></tr><tr><td></td><td>6 ×200</td><td>fully connected</td><td>1210</td><td>6</td><td>None</td></tr><tr><td></td><td>9 ×200</td><td>fully connected</td><td>1810</td><td>9</td><td>None</td></tr><tr><td></td><td>ConvSmall</td><td>convolutional</td><td>3 604</td><td>3</td><td>None</td></tr><tr><td></td><td>ConvBig</td><td>convolutional</td><td>34688</td><td>6</td><td>DiffAI</td></tr><tr><td></td><td>ConvSuper</td><td>convolutional</td><td>88 500</td><td>6</td><td>DiffAI</td></tr><tr><td>CIFAR10</td><td>6 ×100</td><td>fully connected</td><td>610</td><td>6</td><td>None</td></tr><tr><td></td><td>ConvSmall</td><td>convolutional</td><td>4852</td><td>3</td><td>DiffAI</td></tr><tr><td>ACAS Xu</td><td>6×50</td><td>fully connected</td><td>305</td><td>6</td><td>None</td></tr></table>
216
+
217
+ # 4 EVALUATION
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ 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).
228
+
229
+ 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 }$ .
230
+
231
+ 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.
232
+
233
+ Table 2: Precision and runtime of RefineZono vs. DeepZ and DeepPoly.
234
+
235
+ <table><tr><td>Dataset</td><td>Model</td><td>E</td><td colspan="2">DeepZ</td><td colspan="2">DeepPoly</td><td colspan="2">RefineZono</td></tr><tr><td></td><td></td><td></td><td>precision(%)</td><td>time(s)</td><td>precision(%)</td><td>time(s)</td><td>precision(%)</td><td>time(s)</td></tr><tr><td>MNIST</td><td>5×100</td><td>0.07</td><td>38</td><td>0.6</td><td>53</td><td>0.3</td><td>53</td><td>381</td></tr><tr><td></td><td>6×100</td><td>0.02</td><td>31</td><td>0.6</td><td>47</td><td>0.2</td><td>67</td><td>194</td></tr><tr><td></td><td>9×100</td><td>0.02</td><td>28</td><td>1.0</td><td>44</td><td>0.3</td><td>59</td><td>246</td></tr><tr><td></td><td>6×200</td><td>0.015</td><td>13</td><td>1.8</td><td>32</td><td>0.5</td><td>39</td><td>567</td></tr><tr><td></td><td>9×200</td><td>0.015</td><td>12</td><td>3.7</td><td>30</td><td>0.9</td><td>38</td><td>826</td></tr><tr><td></td><td>ConvSmall</td><td>0.12</td><td>7</td><td>1.4</td><td>13</td><td>6.0</td><td>21</td><td>748</td></tr><tr><td></td><td>ConvBig</td><td>0.2</td><td>79</td><td>7</td><td>78</td><td>61</td><td>80</td><td>193</td></tr><tr><td></td><td>ConvSuper</td><td>0.1</td><td>97</td><td>133</td><td>97</td><td>400</td><td>97</td><td>665</td></tr><tr><td>CIFAR10</td><td>6×100</td><td>0.0012</td><td>31</td><td>4.0</td><td>46</td><td>0.6</td><td>46</td><td>765</td></tr><tr><td></td><td>ConvSmall</td><td>0.03</td><td>17</td><td>5.8</td><td>21</td><td>20</td><td>21</td><td>550</td></tr></table>
236
+
237
+ # 4.1 COMPLETE CERTIFICATION
238
+
239
+ 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).
240
+
241
+ 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).
242
+
243
+ 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.
244
+
245
+ # 4.2 INCOMPLETE CERTIFICATION
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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$ .
258
+
259
+ # 4.3 EFFECT OF NEURON SELECTION HEURISTIC
260
+
261
+ 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.
262
+
263
+ # 5 CONCLUSION
264
+
265
+ 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.
266
+
267
+ 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).
268
+
269
+ 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.
270
+
271
+ # REFERENCES
272
+
273
+ ELINA: ETH Library for Numerical Analysis, 2018. URL http://elina.ethz.ch.
274
+
275
+ 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.
276
+
277
+ 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.
278
+
279
+ 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.
280
+
281
+ Chih-Hong Cheng, Georg Nuhrenberg, and Harald Ruess. Maximum resilience of artificial neural ¨ networks. In Automated Technology for Verification and Analysis (ATVA), 2017.
282
+
283
+ 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.
284
+
285
+ Souradeep Dutta, Susmit Jha, Sriram Sankaranarayanan, and Ashish Tiwari. Output range analysis for deep feedforward neural networks. In NASA Formal Methods (NFM), 2018.
286
+
287
+ 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.
288
+
289
+ Rudiger Ehlers. Formal verification of piece-wise linear feed-forward neural networks. In ¨ Automated Technology for Verification and Analysis (ATVA), 2017.
290
+
291
+ Matteo Fischetti and Jason Jo. Deep neural networks and mixed integer linear optimization. Constraints, 23(3):296–309, 2018.
292
+
293
+ 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.
294
+
295
+ Khalil Ghorbal, Eric Goubault, and Sylvie Putot. The zonotope abstract domain taylor1 $^ +$ . In Proc. Computer Aided Verification (CAV), pp. 627–633, 2009.
296
+
297
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, abs/1706.07351, 2014.
298
+
299
+ Gurobi Optimization, LLC. Gurobi optimizer reference manual, 2018. URL http://www. gurobi.com.
300
+
301
+ 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.
302
+
303
+ Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neural networks. In Computer Aided Verification (CAV), pp. 3–29, 2017.
304
+
305
+ Kyle D. Julian, Mykel J. Kochenderfer, and Michael P. Owen. Deep neural network compression for aircraft collision avoidance systems. CoRR, abs/1810.04240, 2018.
306
+
307
+ 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.
308
+
309
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
310
+
311
+ 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.
312
+
313
+ Alessio Lomuscio and Lalit Maganti. An approach to reachability analysis for feed-forward ReLU neural networks. CoRR, 2017.
314
+
315
+ 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.
316
+
317
+ 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.
318
+
319
+ Gagandeep Singh, Markus Puschel, and Martin Vechev. Fast polyhedra abstract domain. In ¨ Proc. Principles of Programming Languages (POPL), pp. 46–59, 2017.
320
+
321
+ 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.
322
+
323
+ 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.
324
+
325
+ 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.
326
+
327
+ 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.
328
+
329
+ 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.
330
+
331
+ 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.
332
+
333
+ 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.
334
+
335
+ 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.
336
+
337
+ 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.
md/train/HJguLo0cKQ/HJguLo0cKQ.md ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STRENGTH IN NUMBERS: TRADING-OFF ROBUSTNESS AND COMPUTATION VIA ADVERSARIALLY-TRAINED ENSEMBLES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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).
14
+
15
+ 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?
16
+
17
+ 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.
18
+
19
+ 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:
20
+
21
+ • increased computation and/or model size can be used to increase robustness,
22
+ • 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,
23
+ • adversarially trained ensembles are more robust than adversarially trained individual models requiring the same amount of parameters/computation
24
+
25
+ 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.
26
+
27
+ # 2 PRELIMINARIES
28
+
29
+ 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
30
+
31
+ $$
32
+ \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}
33
+ $$
34
+
35
+ 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
36
+
37
+ $$
38
+ \tilde { { \boldsymbol { x } } } ^ { k + 1 } = \Pi _ { { \boldsymbol { \mathcal { B } } } } ( \tilde { { \boldsymbol { x } } } ^ { k } + \eta \nabla _ { x } L ( y , m _ { \theta } ( \tilde { { \boldsymbol { x } } } ^ { k } ) ) ) ,
39
+ $$
40
+
41
+ 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.
42
+
43
+ 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
44
+
45
+ $$
46
+ \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } ( L ( \hat { y } , m _ { \theta } ( x ) ) + \rho L ( \hat { y } , m _ { \theta } ( \tilde { x } ) ) )
47
+ $$
48
+
49
+ 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.
50
+
51
+ # 3 ADVERSARIALLY-TRAINED ENSEMBLES
52
+
53
+ 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
54
+
55
+ $$
56
+ p ( \boldsymbol { y } | \boldsymbol { x } ) = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { \theta } _ { i } ) .
57
+ $$
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ 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).
64
+
65
+ 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
66
+
67
+ $$
68
+ y ^ { \star } = \mathrm { a r g m a x } _ { y } \int _ { \theta } p ( y | x , \theta ) p ( D | \theta ) p ( \theta ) .
69
+ $$
70
+
71
+ 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
72
+
73
+ $$
74
+ y ^ { \star } = \operatorname { a r g m a x } _ { y } \sum _ { i = 1 } ^ { k } p ( y | x , \theta _ { i } ) ,
75
+ $$
76
+
77
+ 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$
78
+
79
+ initialize: neural network parameters $\theta _ { i } ^ { 0 }$ randomly, $i = 1 , \ldots , k$
80
+ 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
81
+
82
+ $$
83
+ \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 )
84
+ $$
85
+
86
+ # end for
87
+
88
+ update parameters for each $i = 1 , \ldots , k$ :
89
+
90
+ $$
91
+ \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)
92
+ $$
93
+
94
+ # end for
95
+
96
+ i.e., the best guess of the ensemble. The role of initialization therefore is that of sampling from our prior over possible model parameters.
97
+
98
+ 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
99
+
100
+ $$
101
+ \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}
102
+ $$
103
+
104
+ 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.
105
+
106
+ # 4 EXPERIMENTAL SETUP
107
+
108
+ # 4.1 MODELS COMPARED
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ ![](images/d0b32f5f21f442b831718d3024e33f4917dfb7e7b43a58ba01d3feaeb82919d0.jpg)
115
+ 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.
116
+
117
+ 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.
118
+
119
+ 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.
120
+
121
+ # 4.2 TRAINING PROCEDURE
122
+
123
+ 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$ ).
124
+
125
+ # 4.3 EVALUATION PROCEDURE
126
+
127
+ 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.
128
+
129
+ 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).
130
+
131
+ 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.
132
+
133
+ # 5 RESULTS AND ANALYSIS
134
+
135
+ 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.
136
+
137
+ 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.
138
+
139
+ 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.
140
+
141
+ Table 1: Evaluation Results
142
+ (a) Average of last 10 evaluation steps
143
+
144
+ <table><tr><td></td><td>clean accuracy</td><td>IFGSM5 accuracy</td><td>PGD5 accuracy</td><td>PGD20 accuracy</td><td>black box accuracy</td></tr><tr><td>Baseline</td><td>0.94</td><td>0.34</td><td>0.15</td><td>0.01</td><td>0.27</td></tr><tr><td>Ensemble2</td><td>0.94</td><td>0.59</td><td>0.44</td><td>0.30</td><td>0.22</td></tr><tr><td>Ensemble4</td><td>0.91</td><td>0.50</td><td>0.40</td><td>0.34</td><td>0.26</td></tr><tr><td>SingleAdv</td><td>0.82</td><td>0.55</td><td>0.44</td><td>0.43</td><td>0.80</td></tr><tr><td>DoubleAdv</td><td>0.83</td><td>0.57</td><td>0.46</td><td>0.44</td><td>0.82</td></tr><tr><td>Ensemble2Adv</td><td>0.85</td><td>0.62</td><td>0.55</td><td>0.52</td><td>0.83</td></tr><tr><td>Ensemble4Adv</td><td>0.87</td><td>0.66</td><td>0.58</td><td>0.53</td><td>0.85</td></tr></table>
145
+
146
+ (b) Evaluation results for model at best IFGSM5 training step
147
+
148
+ <table><tr><td></td><td>clean accuracy</td><td>FGSM5 accuracy</td><td>PGD5 accuracy</td><td>PGD20 accuracy</td><td>black box accuracy</td></tr><tr><td>Baseline</td><td>0.95</td><td>0.57</td><td>0.29</td><td>0.09</td><td>0.26</td></tr><tr><td>Ensemble2</td><td>0.95</td><td>0.65</td><td>0.52</td><td>0.38</td><td>0.22</td></tr><tr><td>Ensemble4</td><td>0.93</td><td>0.60</td><td>0.48</td><td>0.43</td><td>0.24</td></tr><tr><td>SingleAdv</td><td>0.84</td><td>0.57</td><td>0.46</td><td>0.45</td><td>0.81</td></tr><tr><td>DoubleAdv</td><td>0.85</td><td>0.60</td><td>0.48</td><td>0.47</td><td>0.84</td></tr><tr><td>Ensemble2Adv</td><td>0.87</td><td>0.64</td><td>0.56</td><td>0.52</td><td>0.85</td></tr><tr><td>Ensemble4Adv</td><td>0.88</td><td>0.67</td><td>0.58</td><td>0.52</td><td>0.86</td></tr></table>
149
+
150
+ (c) Model accuracy after 500 attack steps.
151
+
152
+ <table><tr><td></td><td></td><td></td><td colspan="4">Ensemble</td></tr><tr><td></td><td>Baseline</td><td>SingleAdv</td><td>DoubleAdv</td><td>-2</td><td>-2Adv</td><td>Separate2Adv</td></tr><tr><td>IFGSM</td><td>0.16</td><td>0.46</td><td>0.47</td><td>0.13</td><td>0.55</td><td>0.49</td></tr><tr><td>PGD</td><td>0.04</td><td>0.44</td><td>0.47</td><td>0.02</td><td>0.52</td><td>0.47</td></tr></table>
153
+
154
+ # 6 DISCUSSION
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ 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”
161
+
162
+ ![](images/5c4b090b6ca456a5dcfd4f927d29c66331eca4de1a9b116061e75e6ef1649367.jpg)
163
+ Figure 2: Evaluation Curves
164
+
165
+ (c) Accuracy under PGD attack as a function of the number of attack steps.
166
+
167
+ ![](images/4055ccb2906a1d043215a15cebe4524d3bf6c21f32ba5a13b0e698208f4bc5dc.jpg)
168
+ 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.
169
+
170
+ (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.
171
+
172
+ 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.
173
+
174
+ 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).
175
+
176
+ ![](images/06b72f963fb9ff1deb22648a64125a6f8bf11253c105f734c872dc3a70301e2e.jpg)
177
+ 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.
178
+
179
+ 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).
180
+
181
+ # 7 CONCLUSIONS AND FURTHER WORK
182
+
183
+ 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.
184
+
185
+ # REFERENCES
186
+
187
+ Mahdieh Abbasi and Christian Gagne. Robustness to adversarial examples through an ensemble of ´ specialists. 2017. URL http://arxiv.org/abs/1702.06856.
188
+
189
+ Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. arXiv preprint arXiv:1801.00553, 2018.
190
+
191
+ 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.
192
+
193
+ Nicholas Carlini and David Wagner. Defensive distillation is not robust to adversarial examples. arXiv preprint arXiv:1607.04311, 2016.
194
+
195
+ 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.
196
+
197
+ 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.
198
+
199
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
200
+
201
+ Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. arXiv preprint arXiv:1711.00117, 2017.
202
+
203
+ Sandy Huang, Nicolas Papernot, Ian Goodfellow, Yan Duan, and Pieter Abbeel. Adversarial attacks on neural network policies. arXiv preprint arXiv:1702.02284, 2017.
204
+
205
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
206
+
207
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328, 2017.
208
+
209
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
210
+
211
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 2009.
212
+
213
+ 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.
214
+
215
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
216
+
217
+ Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. arXiv preprint arXiv:1612.01474, 2016.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
224
+
225
+ 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.
226
+
227
+ 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.
228
+
229
+ David Opitz and Richard Maclin. Popular ensemble methods: An empirical study. Journal of artificial intelligence research, 11:169–198, 1999.
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
238
+
239
+ 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.
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble \` adversarial training: Attacks and defenses. In ICLR, 2018.
246
+
247
+ 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.
248
+
249
+ David Warde-Farley and Ian Goodfellow. Adversarial perturbations of deep neural networks. Perturbations, Optimization, and Statistics, pp. 311, 2016.
250
+
251
+ Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
252
+
253
+ 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.
254
+
255
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
md/train/Hk5elxbRW/Hk5elxbRW.md ADDED
@@ -0,0 +1,878 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SMOOTH LOSS FUNCTIONS FOR DEEP TOP-K CLASSIFICATION
2
+
3
+ Leonard Berrada1, Andrew Zisserman1 and M. Pawan Kumar1,2
4
+
5
+ 1Department of Engineering Science
6
+ University of Oxford
7
+ 2Alan Turing Institute
8
+ {lberrada,az,pawan}@robots.ox.ac.uk
9
+
10
+ # ABSTRACT
11
+
12
+ 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.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
22
+ ![](images/a3940f236dde24cf1845403a83dd5ca51e22331d07c3ce3cbc1d5844c0de522c.jpg)
23
+ 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.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ 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.
34
+
35
+ # 3 TOP-K SVM
36
+
37
+ # 3.1 BACKGROUND: MULTI-CLASS SVM
38
+
39
+ 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).
40
+
41
+ Prediction. The prediction is given by any index with maximal score:
42
+
43
+ $$
44
+ P ( \mathbf { s } ) \in \mathrm { a r g m a x } \mathbf { s } .
45
+ $$
46
+
47
+ 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:
48
+
49
+ $$
50
+ \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 } ) .
51
+ $$
52
+
53
+ 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:
54
+
55
+ $$
56
+ 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\} .
57
+ $$
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ # 3.2 TOP-K CLASSIFICATION
64
+
65
+ 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 }$ .
66
+
67
+ 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:
68
+
69
+ $$
70
+ 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\} .
71
+ $$
72
+
73
+ 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:
74
+
75
+ $$
76
+ \Lambda _ { k } ( \mathbf { s } , y ) \triangleq \mathbb { 1 } ( y \notin P _ { k } ( \mathbf { s } ) ) = \mathbb { 1 } ( s _ { [ k ] } > s _ { y } ) .
77
+ $$
78
+
79
+ Again, such a binary loss is not suitable for optimization. Thus we introduce a surrogate loss.
80
+
81
+ Surrogate. As pointed out in Lapin et al. (2015), there is a natural extension of the previous multi-class case:
82
+
83
+ $$
84
+ l _ { k } ( { \bf s } , y ) \triangleq \operatorname* { m a x } \left\{ \left( { \bf s } _ { \backslash y } + { \bf 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} .
85
+ $$
86
+
87
+ 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$ .
88
+
89
+ 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.
90
+
91
+ 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.
92
+
93
+ # 3.3 SMOOTH SURROGATE LOSS
94
+
95
+ 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:
96
+
97
+ $$
98
+ \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}
99
+ $$
100
+
101
+ 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:
102
+
103
+ $$
104
+ 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\} .
105
+ $$
106
+
107
+ Smoothing. In the form of equation (8), the loss function can be smoothed with a temperature parameter $\tau > 0$ :
108
+
109
+ $$
110
+ \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 ] .
111
+ $$
112
+
113
+ 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 }$ .
114
+
115
+ 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 }$ .
116
+
117
+ 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.
118
+
119
+ 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):
120
+
121
+ ![](images/21859388c8ba3e3c95f5e8f185e4992c468c26f52542ae323581a455ba55a1c2.jpg)
122
+
123
+ (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.
124
+
125
+ (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.
126
+
127
+ 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.
128
+
129
+ 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.
130
+
131
+ # 4 COMPUTATIONAL CHALLENGES AND EFFICIENT ALGORITHMS
132
+
133
+ # 4.1 CHALLENGE
134
+
135
+ 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.
136
+
137
+ 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.
138
+
139
+ 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:
140
+
141
+ $$
142
+ \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}
143
+ $$
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ # 4.2 FORWARD COMPUTATION
150
+
151
+ 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 ] ]$ .
152
+
153
+ The main insight of our approach is the connection of $\sigma _ { i } ( \mathbf { e } )$ to the polynomial:
154
+
155
+ $$
156
+ P \triangleq ( X + e _ { 1 } ) ( X + e _ { 2 } ) . . . ( X + e _ { n } ) .
157
+ $$
158
+
159
+ Indeed, if we expand $P$ to $\alpha _ { 0 } + \alpha _ { 1 } X + \ldots + \alpha _ { n } X ^ { n }$ , Vieta’s formula gives the relationship:
160
+
161
+ $$
162
+ \forall i \in [ [ 0 , n ] ] , \quad \alpha _ { i } = \sigma _ { n - i } ( \mathbf { e } ) .
163
+ $$
164
+
165
+ 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.
166
+
167
+ 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:
168
+
169
+ $$
170
+ Q \triangleq \sigma _ { n } ( \mathbf { e } ) ( X + { \frac { 1 } { e _ { 1 } } } ) ( X + { \frac { 1 } { e _ { 2 } } } ) \ldots ( X + { \frac { 1 } { e _ { n } } } ) .
171
+ $$
172
+
173
+ Then if we expand $Q$ to $\beta _ { 0 } + \beta _ { 1 } X + . . . + \beta _ { n } X ^ { n }$ , we obtain with Vieta’s formula again:
174
+
175
+ $$
176
+ \forall i \in [ [ 0 , n ] ] , \quad \beta _ { i } = \sigma _ { n } ( \mathbf { e } ) \sigma _ { n - i } ( 1 / \mathbf { e } ) = \sigma _ { i } ( \mathbf { e } ) .
177
+ $$
178
+
179
+ 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).
180
+
181
+ 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.
182
+
183
+ # Algorithm 1 Forward Pass
184
+
185
+ Require: $\mathbf { e } \in ( \mathbb { R } _ { + } ^ { * } ) ^ { n }$ , $k \in \mathbb { N } ^ { * }$
186
+
187
+ 1: $t \gets 0$
188
+ 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)
189
+ 3: $p \gets n$ . Number of polynomials
190
+ 4: while $p > 1$ do . Merge branches with polynomial multiplications
191
+ 5: $P _ { 1 } ^ { ( t + 1 ) } P _ { 1 } ^ { ( t ) } * P _ { 2 } ^ { ( t ) }$ . Polynomial multiplication up to degree $k$
192
+ 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$
193
+ 7:
194
+ 8: . Update number of polynomials
195
+ 9: end while
196
+ $\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 } } )$
197
+
198
+ 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.
199
+
200
+ # 4.3 BACKWARD COMPUTATION
201
+
202
+ 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.
203
+
204
+ First, we introduce the notation for derivatives:
205
+
206
+ $$
207
+ \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 } } .
208
+ $$
209
+
210
+ We now observe that:
211
+
212
+ $$
213
+ \delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
214
+ $$
215
+
216
+ 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:
217
+
218
+ $$
219
+ \sigma _ { j } ( \mathbf { e } _ { \backslash i } ) = \sigma _ { j } ( \mathbf { e } ) - e _ { i } \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
220
+ $$
221
+
222
+ Simplifying equation (17) using equation (16), we obtain the following recursive relationship:
223
+
224
+ $$
225
+ \delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
226
+ $$
227
+
228
+ 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.
229
+
230
+ # Algorithm 2 Backward Pass
231
+
232
+ 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
233
+ 1: $\delta _ { 1 , i } = 1$ for $i \in [ [ 1 , n ] ]$
234
+ 2: for $j \in [ [ 1 , k ] ]$ J do
235
+ 3: $\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i }$ for $i \in [ [ 1 , n ] ]$
236
+ 4: end for
237
+
238
+ 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.
239
+
240
+ # 5 EXPERIMENTS
241
+
242
+ 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).
243
+
244
+ 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.
245
+
246
+ # 5.1 CIFAR-100 WITH NOISE
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ <table><tr><td>Noise Level</td><td>Top-1 Accuracy (%) CE</td><td>L5.1 CE</td><td>Top-5 Accuracy (%)</td></tr><tr><td>0.0</td><td>76.68 69.33</td><td>94.34</td><td>L5.1 94.29</td></tr><tr><td>0.2</td><td>68.20 71.30</td><td>87.89</td><td>90.59</td></tr><tr><td>0.4</td><td>61.18 70.02</td><td>83.04</td><td>87.39</td></tr><tr><td>0.6</td><td>52.50 67.97</td><td>79.59</td><td>83.86</td></tr><tr><td>0.8</td><td>35.53 55.85</td><td>74.80</td><td>79.32</td></tr><tr><td>1.0</td><td>14.06 15.28</td><td>67.70</td><td>72.93</td></tr></table>
257
+
258
+ 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 }$ .
259
+
260
+ # 5.2 IMAGENET
261
+
262
+ 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).
263
+
264
+ 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.
265
+
266
+ 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.
267
+
268
+ 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.
269
+
270
+ 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.
271
+
272
+ <table><tr><td>% Data Set</td><td>Number of Images</td><td>CE</td><td>L5,0.1</td></tr><tr><td>100%</td><td>1.23M</td><td>90.67</td><td>90.61</td></tr><tr><td>50%</td><td>640k</td><td>87.57</td><td>87.87</td></tr><tr><td>25%</td><td>320k</td><td>82.62</td><td>83.38</td></tr><tr><td>10%</td><td>128k</td><td>71.06</td><td>73.10</td></tr><tr><td>5%</td><td>64k</td><td>58.31</td><td>60.44</td></tr></table>
273
+
274
+ 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.
275
+
276
+ # 6 CONCLUSION
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ # ACKNOWLEDGMENTS
283
+
284
+ 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.
285
+
286
+ # REFERENCES
287
+
288
+ Amir Beck and Marc Teboulle. Smoothing and first order methods: A unified framework. SIAM Journal on Optimization, 2012.
289
+
290
+ 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.
291
+
292
+ Pratik Chaudhari, Anna Choromanska, Stefano Soatto, and Yann LeCun. Entropy-SGD: Biasing gradient descent into wide valleys. International Conference on Learning Representations, 2017.
293
+
294
+ 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.
295
+
296
+ Koby Crammer and Yoram Singer. On the algorithmic implementation of multiclass kernel-based vector machines. Journal of Machine Learning Research, 2001.
297
+
298
+ 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.
299
+
300
+ Caglar Gulcehre, Marcin Moczulski, Francesco Visin, and Yoshua Bengio. Mollifying networks. International Conference on Learning Representations, 2017.
301
+
302
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Conference on Computer Vision and Pattern Recognition, 2016.
303
+
304
+ Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. Conference on Computer Vision and Pattern Recognition, 2017.
305
+
306
+ 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.
307
+
308
+ Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
309
+
310
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Neural Information Processing Systems, 2012.
311
+
312
+ Maksim Lapin, Matthias Hein, and Bernt Schiele. Top-k multiclass SVM. Neural Information Processing Systems, 2015.
313
+
314
+ 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.
315
+
316
+ 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.
317
+
318
+ Yuh-Jye Lee and Olvi L Mangasarian. SSVM: A smooth support vector machine for classification. Computational optimization and Applications, 2001.
319
+
320
+ Yuncheng Li, Yale Song, and Jiebo Luo. Improving pairwise ranking for multi-label image classification. Conference on Computer Vision and Pattern Recognition, 2017.
321
+
322
+ 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.
323
+
324
+ 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.
325
+
326
+ 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.
327
+
328
+ Caixia Yan, Minnan Luo, Huan Liu, Zhihui Li, and Qinghua Zheng. Top-k multi-class svm using multiple features. Information Sciences, 2017.
329
+
330
+ Alan L. Yuille and Anand Rangarajan. The concave-convex procedure (CCCP). Neural Information Processing Systems, 2002.
331
+
332
+ 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.
333
+
334
+ # APPENDIX
335
+
336
+ # A Surrogate Losses: Properties 14
337
+
338
+ A.1 Reformulation . . 14
339
+ A.2 Point-wise Convergence 14
340
+ A.3 Bound on Non-Smooth Function 15
341
+ A.4 Bound on Prediction Loss . . . 16
342
+
343
+ # B Algorithms: Properties & Performance 18
344
+
345
+ B.1 Time Complexity 18
346
+ B.2 Numerical Stability 19
347
+ B.2.1 Forward Pass . . 19
348
+ B.2.2 Backward Pass 19
349
+ B.3 A Performance Comparison with the Summation Algorithm 20
350
+ B.3.1 Summation Algorithm 20
351
+ B.3.2 Speed . 21
352
+ B.3.3 Stability . . . 21
353
+
354
+ # C Top-k Prediction: Marginalization with the Elementary Symmetric Polynomials 22
355
+
356
+ # D Hyper-Parameters & Experimental Details 23
357
+
358
+ # D.1 The Temperature Parameter . 23
359
+
360
+ D.1.1 Optimization and Learning . 23
361
+ D.1.2 Illustration on CIFAR-100 23
362
+ D.1.3 To Anneal or Not To Anneal 23
363
+ D.1.4 Practical Methodology 23
364
+
365
+ # D.2 The Margin 24
366
+
367
+ D.2.1 Relationship with Squared Norm Regularization 24
368
+ D.2.2 Experiment on ImageNet . . 25
369
+
370
+ D.3 Supplementary Details 25
371
+
372
+ # A SURROGATE LOSSES: PROPERTIES
373
+
374
+ 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):
375
+
376
+ $$
377
+ 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\} .
378
+ $$
379
+
380
+ # A.1 REFORMULATION
381
+
382
+ Proposition 1. We can equivalently re-write $l _ { k }$ as:
383
+
384
+ $$
385
+ 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\} .
386
+ $$
387
+
388
+ Proof.
389
+
390
+ $$
391
+ \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}
392
+ $$
393
+
394
+ # A.2 POINT-WISE CONVERGENCE
395
+
396
+ 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 ] } .$
397
+
398
+ 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:
399
+
400
+ $$
401
+ \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 .
402
+ $$
403
+
404
+ And thus:
405
+
406
+ $$
407
+ \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 .
408
+ $$
409
+
410
+ The result follows by noting that:
411
+
412
+ $$
413
+ \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) .
414
+ $$
415
+
416
+ 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 )$ .
417
+
418
+ 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:
419
+
420
+ $$
421
+ \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}
422
+ $$
423
+
424
+ the result follows by two applications of Lemma 1.
425
+
426
+ # A.3 BOUND ON NON-SMOOTH FUNCTION
427
+
428
+ Proposition 3. $L _ { k , \tau }$ is an upper bound on $l _ { k }$ if and only if $k = 1$ .
429
+
430
+ 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:
431
+
432
+ $$
433
+ \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}
434
+ $$
435
+
436
+ 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:
437
+
438
+ $$
439
+ l _ { k } ( \mathbf { s } , y ) = 1 + \frac { 1 } { k } ( \beta - \alpha ) .
440
+ $$
441
+
442
+ Exploiting the fact that $\exp ( { s _ { i } / \tau } ) = 0$ for $i \geq k + 2$ , we have:
443
+
444
+ $$
445
+ \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) ,
446
+ $$
447
+
448
+ And:
449
+
450
+ $$
451
+ \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) .
452
+ $$
453
+
454
+ This allows us to write $L _ { k , \tau }$ as:
455
+
456
+ $$
457
+ \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}
458
+ $$
459
+
460
+ We introduce $\begin{array} { r } { x = 1 + \frac { 1 } { k } ( \beta - \alpha ) } \end{array}$ . Then we have:
461
+
462
+ $$
463
+ L _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) ,
464
+ $$
465
+
466
+ And:
467
+
468
+ $$
469
+ l _ { k } ( \mathbf { s } , y ) = x .
470
+ $$
471
+
472
+ 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:
473
+
474
+ $$
475
+ \Delta ( x ) \triangleq \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) - x < 0 .
476
+ $$
477
+
478
+ We show that $\operatorname* { l i m } _ { x \to \infty } \Delta ( x ) < 0$ , which will conclude the proof by continuity of $\Delta$ .
479
+
480
+ $$
481
+ \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}
482
+ $$
483
+
484
+ # A.4 BOUND ON PREDICTION LOSS
485
+
486
+ 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 } }$ .
487
+
488
+ Proof.
489
+
490
+ $$
491
+ \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}
492
+ $$
493
+
494
+ This is a monotonically increasing function of $p \leq q - 1$ , therefore it is upper bounded by its maximal value at $p = q - 1$ :
495
+
496
+ $$
497
+ { \frac { { \binom { q } { p } } } { { \binom { q } { p + 1 } } } } = { \frac { ( p + 1 ) } { q - p } } \leq q .
498
+ $$
499
+
500
+ Lemma 3. Assume that $y \notin P _ { k } ( \mathbf { s } )$ . Then we have:
501
+
502
+ $$
503
+ \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) .
504
+ $$
505
+
506
+ 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:
507
+
508
+ $$
509
+ { \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 \} .
510
+ $$
511
+
512
+ 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:
513
+
514
+ $$
515
+ 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 .
516
+ $$
517
+
518
+ Therefore we also have that:
519
+
520
+ $$
521
+ \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 . }
522
+ $$
523
+
524
+ This finally gives us:
525
+
526
+ $$
527
+ \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}
528
+ $$
529
+
530
+ Making the (uniform) probabilities explicit, we obtain:
531
+
532
+ $$
533
+ \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}
534
+ $$
535
+
536
+ To derive the set cardinalities, we rewrite $\mathcal { U } _ { j }$ and $\nu _ { j }$ as:
537
+
538
+ $$
539
+ \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}
540
+ $$
541
+
542
+ Therefore we have that:
543
+
544
+ $$
545
+ \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}
546
+ $$
547
+
548
+ And:
549
+
550
+ $$
551
+ \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}
552
+ $$
553
+
554
+ Therefore:
555
+
556
+ $$
557
+ \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 .
558
+ $$
559
+
560
+ Combining with equation (42), we obtain:
561
+
562
+ $$
563
+ k \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) .
564
+ $$
565
+
566
+ We sum over $j \in [ [ 0 , k - 1 ]$ , which yields:
567
+
568
+ $$
569
+ 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 } ) .
570
+ $$
571
+
572
+ 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:
573
+
574
+ $$
575
+ 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 } ) .
576
+ $$
577
+
578
+ Proposition 4. $L _ { k , \tau }$ is, up to a scaling factor, an upper bound on the prediction loss $\Lambda _ { k }$ :
579
+
580
+ $$
581
+ L _ { k , \tau } ( \mathbf { s } , y ) \geq ( 1 - \tau \log ( k ) ) \Lambda _ { k } ( \mathbf { s } , y ) .
582
+ $$
583
+
584
+ 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:
585
+
586
+ $$
587
+ \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 } .
588
+ $$
589
+
590
+ Thanks to Lemma 3, we have:
591
+
592
+ $$
593
+ \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 } .
594
+ $$
595
+
596
+ Injecting this back into (51):
597
+
598
+ $$
599
+ \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 } ,
600
+ $$
601
+
602
+ And back to the original loss:
603
+
604
+ $$
605
+ \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}
606
+ $$
607
+
608
+ # B ALGORITHMS: PROPERTIES & PERFORMANCE
609
+
610
+ # B.1 TIME COMPLEXITY
611
+
612
+ 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 \} )$ .
613
+
614
+ 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. □
615
+
616
+ Proposition 5. The time complexity of Algorithm $I$ is $\mathcal { O } ( k n )$ .
617
+
618
+ 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:
619
+
620
+ $$
621
+ T ( k , n ) = 2 T ( k , \frac { n } { 2 } ) + \operatorname* { m i n } \{ k , n \} ^ { 2 } .
622
+ $$
623
+
624
+ 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:
625
+
626
+ $$
627
+ \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}
628
+ $$
629
+
630
+ 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:
631
+
632
+ $$
633
+ \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}
634
+ $$
635
+
636
+ Thus finally:
637
+
638
+ $$
639
+ \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}
640
+ $$
641
+
642
+ # B.2 NUMERICAL STABILITY
643
+
644
+ # B.2.1 FORWARD PASS
645
+
646
+ 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.
647
+
648
+ # B.2.2 BACKWARD PASS
649
+
650
+ 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 } \}$
651
+
652
+ 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
653
+
654
+ obtain approximate $\hat { \delta }$ as follows:
655
+
656
+ $$
657
+ \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}
658
+ $$
659
+
660
+ Since $e _ { i } \gg 1$ , we quickly obtain unstable results.
661
+
662
+ Definition 1. For $p \in \{ 0 , . . . , n - k \}$ , we define the $p$ -th order approximation to the gradient as:
663
+
664
+ $$
665
+ \tilde { \delta } _ { k , i } ^ { ( p ) } \triangleq \sum _ { j = 0 } ^ { p } ( - 1 ) ^ { j } \frac { \sigma _ { k + j } ( \mathbf { e } ) } { e _ { i } ^ { j } } .
666
+ $$
667
+
668
+ Proposition 6. If we approximate the gradient by its $p$ -th order approximation as defined in equation (60), the absolute error is:
669
+
670
+ $$
671
+ \Big | \delta _ { k , i } - \tilde { \delta } _ { k , i } ^ { ( p ) } \Big | = \frac { \sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) } { e _ { i } ^ { p + 1 } } .
672
+ $$
673
+
674
+ Proof. We remind equation (18), which gives a recursive relationship for the gradients:
675
+
676
+ $$
677
+ \delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
678
+ $$
679
+
680
+ This can be re-written as:
681
+
682
+ $$
683
+ \delta _ { j - 1 , i } = \frac { 1 } { e _ { i } } \left( \sigma _ { j - 1 } ( \mathbf { e } ) - \delta _ { j , i } \right) .
684
+ $$
685
+
686
+ 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 \}$ . □
687
+
688
+ 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.
689
+
690
+ # B.3 A PERFORMANCE COMPARISON WITH THE SUMMATION ALGORITHM
691
+
692
+ # B.3.1 SUMMATION ALGORITHM
693
+
694
+ 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:
695
+
696
+ 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 }$ .
697
+
698
+ # Algorithm 3 Summation Algorithm
699
+
700
+ Require: $\mathbf { e } \in \mathbb { R } ^ { n }$ , k ∈ N ∗
701
+ 1: $\sigma _ { 0 , i } \gets 1$ for $1 \leq i \leq n$
702
+ 2: $\sigma _ { j , i } \gets 0$ for i < j
703
+ 3: $\sigma _ { 1 , 1 } e _ { 1 }$
704
+ 4: for $i \in [ [ 2 , n ]$ do
705
+ 5: $m \bar { } \operatorname* { m a x } \{ 1 , i + k - n \}$
706
+ 6: M ← min{i, k}
707
+ 7: for i ∈ m, M do
708
+ 8: $\sigma _ { j , i } \sigma _ { j , i - 1 } + e _ { i } \sigma _ { j - 1 , i - 1 }$
709
+ 9: end for
710
+ 10: end for
711
+ 11: return $\sigma _ { k , n }$
712
+
713
+ $\triangleright \sigma _ { j , i } = \sigma _ { j } ( e _ { 1 } , \ldots , e _ { i } )$ . Do not define values for $i < j$ (meaningless) $\triangleright$ Initialize recursion
714
+
715
+ # B.3.2 SPEED
716
+
717
+ 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).
718
+
719
+ 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$ .
720
+
721
+ $$
722
+ \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}
723
+ $$
724
+
725
+ 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 \}$ .
726
+
727
+ Table 4: Execution time $( s )$ of the backward pass. Our Custom Backward (CB) is faster than Automatic Differentiation $( A D )$ .
728
+
729
+ $$
730
+ \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}
731
+ $$
732
+
733
+ 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.
734
+
735
+ # B.3.3 STABILITY
736
+
737
+ 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.
738
+
739
+ 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.
740
+
741
+ 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.
742
+
743
+ Table 5: Stability on forward pass. A setting is considered stable if no overflow has occurred.
744
+
745
+ $$
746
+ { \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| }
747
+ $$
748
+
749
+ 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 }$ .
750
+
751
+ # C TOP-K PREDICTION: MARGINALIZATION WITH THE ELEMENTARY SYMMETRIC POLYNOMIALS
752
+
753
+ 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:
754
+
755
+ $$
756
+ p _ { i } ^ { ( k ) } \propto \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { i } ^ { ( k ) } } \exp ( \sum _ { j \in \bar { \mathbf { y } } } s _ { j } ) .
757
+ $$
758
+
759
+ Proposition 7. The unnormalized probability can be computed as:
760
+
761
+ $$
762
+ p _ { i } ^ { ( k ) } \propto \frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } .
763
+ $$
764
+
765
+ Proof.
766
+
767
+ $$
768
+ \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}
769
+ $$
770
+
771
+ 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:
772
+
773
+ $$
774
+ \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 } } .
775
+ $$
776
+
777
+ 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.
778
+
779
+ # D HYPER-PARAMETERS & EXPERIMENTAL DETAILS
780
+
781
+ # D.1 THE TEMPERATURE PARAMETER
782
+
783
+ 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.
784
+
785
+ # D.1.1 OPTIMIZATION AND LEARNING
786
+
787
+ 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.
788
+
789
+ 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.
790
+
791
+ # D.1.2 ILLUSTRATION ON CIFAR-100
792
+
793
+ 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:
794
+
795
+ Table 6: Influence of the temperature parameter on the training accuracy and testing accuracy.
796
+
797
+ <table><tr><td rowspan=1 colspan=1>Temperature</td><td rowspan=1 colspan=1>Training Accuracy (%)</td><td rowspan=1 colspan=1>Testing Accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>10.01</td><td rowspan=1 colspan=1>10.38</td></tr><tr><td rowspan=1 colspan=1>10-3</td><td rowspan=1 colspan=1>17.40</td><td rowspan=1 colspan=1>18.19</td></tr><tr><td rowspan=1 colspan=1>10-2</td><td rowspan=1 colspan=1>98.95</td><td rowspan=1 colspan=1>91.35</td></tr><tr><td rowspan=1 colspan=1>10-1100</td><td rowspan=1 colspan=1>99.7399.78</td><td rowspan=1 colspan=1>91.7091.52</td></tr><tr><td rowspan=1 colspan=1>101</td><td rowspan=1 colspan=1>99.62</td><td rowspan=1 colspan=1>90.92</td></tr><tr><td rowspan=1 colspan=1>102</td><td rowspan=1 colspan=1>99.42</td><td rowspan=1 colspan=1>90.46</td></tr></table>
798
+
799
+ # D.1.3 TO ANNEAL OR NOT TO ANNEAL
800
+
801
+ 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.
802
+
803
+ 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.
804
+
805
+ # D.1.4 PRACTICAL METHODOLOGY
806
+
807
+ 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).
808
+
809
+ # D.2 THE MARGIN
810
+
811
+ # D.2.1 RELATIONSHIP WITH SQUARED NORM REGULARIZATION
812
+
813
+ 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.
814
+
815
+ First, we make explicit the role of $\alpha$ in $l _ { k }$ with an overload of notation:
816
+
817
+ $$
818
+ 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\} ,
819
+ $$
820
+
821
+ 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$ :
822
+
823
+ $$
824
+ ( 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 ) .
825
+ $$
826
+
827
+ 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:
828
+
829
+ 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.
830
+
831
+ Proposition 8. Let $\lambda , \alpha \geq 0$ .
832
+
833
+ 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)$ .
834
+ 2. If $\alpha = 0$ or $\lambda = 0$ , then problem $( P _ { \lambda , \alpha } )$ is equivalent to problem $( P _ { 0 , 0 } )$ .
835
+
836
+ Proof. Let $\mathbf { w } \in \mathbb { R } ^ { d \times n }$ . We introduce a constant $\beta > 0$ . Then we can successively write:
837
+
838
+ $$
839
+ \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}
840
+ $$
841
+
842
+ This holds for any $\beta > 0$ .
843
+
844
+ 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
845
+
846
+ small.
847
+
848
+ 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.
849
+
850
+ Note that we do not need any hypothesis on the norm $\| \cdot \|$ , the result makes only use of the positive homogeneity property.
851
+
852
+ 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.
853
+
854
+ 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.
855
+
856
+ # D.2.2 EXPERIMENT ON IMAGENET
857
+
858
+ 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.
859
+
860
+ 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:
861
+
862
+ Table 7: Influence of the margin parameter on top-1 performance.
863
+
864
+ <table><tr><td>Margin</td><td>Top-1 Accuracy (%)</td></tr><tr><td>0</td><td>71.03</td></tr><tr><td>1</td><td>71.15</td></tr></table>
865
+
866
+ Top-5 Error. We now compare $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 0 )$ and $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 1 )$ :
867
+
868
+ Table 8: Influence of the margin parameter on top-5 performance.
869
+
870
+ <table><tr><td>Margin</td><td>Top-5 Accuracy (%)</td></tr><tr><td>0</td><td>89.12</td></tr><tr><td>1</td><td>89.45</td></tr></table>
871
+
872
+ # D.3 SUPPLEMENTARY DETAILS
873
+
874
+ 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.
875
+
876
+ 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.
877
+
878
+ <table><tr><td>Noise Level</td><td>Top-1 Accuracy (%) CE L5,1</td><td colspan="2">Top-5 Accuracy (%) CE</td><td></td></tr><tr><td>0.0</td><td>76.68 (0.38)</td><td></td><td></td><td>L5,1 94.29 (0.10)</td></tr><tr><td>0.2</td><td>68.20 (0.50)</td><td>69.33 (0.27) 71.30 (0.79)</td><td>94.34 (0.09) 87.89 (0.08)</td><td></td></tr><tr><td>0.4</td><td></td><td></td><td>83.04 (0.38)</td><td>90.59 (0.08)</td></tr><tr><td>0.6</td><td>61.18 (0.97)</td><td>70.02 (0.40) 67.97 (0.51)</td><td>79.59 (0.36)</td><td>87.39 (0.23)</td></tr><tr><td>0.8</td><td>52.50 (0.27) 35.53 (0.79)</td><td>55.85 (0.80)</td><td>74.80 (0.15)</td><td>83.86 (0.39)</td></tr><tr><td>1.0</td><td></td><td></td><td>67.70 (0.16)</td><td>79.32 (0.25)</td></tr><tr><td></td><td>14.06 (0.13)</td><td>15.28 (0.39)</td><td></td><td>72.93 (0.25)</td></tr></table>
md/train/HkGmDsR9YQ/HkGmDsR9YQ.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GENERALIZATION AND REGULARIZATION IN DQN
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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).
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ # 2 BACKGROUND
20
+
21
+ # 2.1 REINFORCEMENT LEARNING
22
+
23
+ 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.
24
+
25
+ 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
26
+
27
+ $$
28
+ 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 ]
29
+ $$
30
+
31
+ 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 }$ .
32
+
33
+ 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
34
+
35
+ $$
36
+ 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]
37
+ $$
38
+
39
+ 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.
40
+
41
+ # 2.2 SUPERVISED LEARNING
42
+
43
+ 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
44
+
45
+ $$
46
+ \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 ) )
47
+ $$
48
+
49
+ 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.
50
+
51
+ 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.
52
+
53
+ 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).
54
+
55
+ # 3 THE ALE AS A PLATFORM FOR EVALUATING GENERALIZATION
56
+
57
+ 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).
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ # 4 GENERALIZATION OF THE LEARNED POLICIES AND OVERFITTING
64
+
65
+ 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.
66
+
67
+ ![](images/7e16ca4fc99a7529db72180bc5d0a6ac0bac1a6a9f7957b98bd044776a97649b.jpg)
68
+ Figure 1: Each column shows variation between two selected flavours of each game. From left to right: FREEWAY, HERO, BREAKOUT, and SPACE INVADERS.
69
+
70
+ 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.
71
+
72
+ 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.
73
+
74
+ 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.
75
+
76
+ 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.
77
+
78
+ 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.
79
+
80
+ 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.
81
+
82
+ <table><tr><td colspan="2">GAME VARIANT</td><td>EVALUATION</td><td>LEARN SCRATCH</td></tr><tr><td rowspan="3">FREEWAY</td><td>m1d0</td><td>0.2 (0.2)</td><td>4.8 (9.3)</td></tr><tr><td>m1d1</td><td>0.1 (0.1)</td><td>0.0 (0.0)</td></tr><tr><td>m4d0</td><td>15.8 (1.0)</td><td>29.9 (0.7)</td></tr><tr><td rowspan="2">HERO</td><td>m1d0</td><td>82.1 (89.3)</td><td>1425.2 (1755.1)</td></tr><tr><td>m2d0</td><td>33.9 (38.7)</td><td>326.1 (130.4)</td></tr><tr><td>BREAKOUT</td><td>m12d0</td><td>43.4 (11.1)</td><td>67.6 (32.4)</td></tr><tr><td rowspan="3">SPACE INVADERS</td><td>m1d0</td><td>258.9 (88.3)</td><td>753.6 (31.6)</td></tr><tr><td>m1d1</td><td>140.4 (61.4)</td><td>698.5 (31.3)</td></tr><tr><td>m9d0</td><td>179.0 (75.1)</td><td>518.0 (16.7)</td></tr></table>
83
+
84
+ ![](images/e32eeeaacc66511639a1e09440b8ebe1528f57a96c854659d6ffb8b951741981.jpg)
85
+ Freeway Policy Evaluation
86
+ 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.
87
+
88
+ 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.
89
+
90
+ # 5 REGULARIZATION IN DEEP RL
91
+
92
+ 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.
93
+
94
+ 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.
95
+
96
+ 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.
97
+
98
+ 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.
99
+
100
+ 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.
101
+
102
+ <table><tr><td colspan="2">GAME VARIANT</td><td>EVAL. WITH REGULARIZATION</td><td></td><td>EVAL.WITHOUT REGULARIZATION</td><td>LEARN SCRATCH</td><td></td></tr><tr><td rowspan="3">FREEWAY</td><td>m1do</td><td>5.8</td><td>(3.5)</td><td>0.2 (0.2)</td><td>4.8</td><td>(9.3)</td></tr><tr><td>m1d1</td><td>4.4</td><td>(2.3)</td><td>0.1 (0.1)</td><td>0.0</td><td>(0.0)</td></tr><tr><td>m4d0</td><td>20.6</td><td>(0.7)</td><td>15.8 (1.0)</td><td>29.9</td><td>(0.7)</td></tr><tr><td rowspan="2">HERO</td><td>m1d0o</td><td>116.8</td><td>(76.0)</td><td>82.1 (89.3)</td><td>1425.2</td><td>(1755.1)</td></tr><tr><td>m2d0</td><td>30.0</td><td>(36.7)</td><td>33.9 (38.7)</td><td>326.1</td><td>(130.4)</td></tr><tr><td>BREAKOUT</td><td>m12d0</td><td>31.0</td><td>(8.6)</td><td>43.4 (11.1)</td><td>67.6</td><td>(32.4)</td></tr><tr><td rowspan="3">SPACE INVADERS</td><td>m1d0</td><td>456.0</td><td>(221.4)</td><td>258.9 (88.3)</td><td>753.6</td><td>(31.6)</td></tr><tr><td>m1d1</td><td>146.0</td><td>(84.5)</td><td>140.4 (61.4)</td><td>698.5</td><td>(31.3)</td></tr><tr><td>m9d0</td><td>290.0</td><td>(257.8)</td><td>179.0 (75.1)</td><td>518.0</td><td>(16.7)</td></tr></table>
103
+
104
+ ![](images/f5e5f10f47bd42958285ee27360663615f449cc18168450b5ef8d6803a3ade84.jpg)
105
+ Freeway Policy Evaluation w/ Regularization
106
+ 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.
107
+
108
+ 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.
109
+
110
+ 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.
111
+
112
+ # 6 VALUE FUNCTION FINE-TUNING
113
+
114
+ 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).
115
+
116
+ 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.
117
+
118
+ 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.
119
+
120
+ 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.
121
+
122
+ <table><tr><td colspan="2"></td><td colspan="4">FINE-TUNING</td><td colspan="4">REGULARIZED FINE-TUNING</td><td colspan="4">SCRATCH</td></tr><tr><td colspan="2">GAME VARIANT</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">50M</td><td colspan="2">100M</td></tr><tr><td rowspan="3">FREEWAY</td><td>m1d0</td><td>2.9</td><td>(3.7)</td><td>22.5</td><td>(7.5)</td><td>20.2</td><td>(1.9)</td><td>25.4</td><td>(0.2)</td><td>4.8</td><td>(9.3)</td><td>7.5</td><td>(11.5)</td></tr><tr><td>m1d1</td><td>0.1</td><td>(0.2)</td><td>17.4</td><td>(11.4)</td><td>18.5</td><td>(2.8)</td><td>25.4</td><td>(0.4)</td><td>0.0</td><td>(0.0)</td><td>2.5</td><td>(7.3)</td></tr><tr><td>m4d0</td><td>20.8</td><td>(1.1)</td><td>31.4</td><td>(0.5)</td><td>22.6</td><td>(0.7)</td><td>32.2</td><td>(0.5)</td><td>29.9</td><td>(0.7)</td><td>32.8</td><td>(0.2)</td></tr><tr><td rowspan="2">HERO</td><td>m1d0</td><td>220.7</td><td>(98.2)</td><td>496.7</td><td>(362.8)</td><td>322.5</td><td>(39.3)</td><td>4104.6</td><td>(2192.8)</td><td>1425.2</td><td>(1755.1)</td><td>5026.8</td><td>(2174.6)</td></tr><tr><td>m2d0</td><td>74.4</td><td>(31.7)</td><td>92.5</td><td>(26.2)</td><td>84.8</td><td>(56.1)</td><td>211.0</td><td>(100.6)</td><td>326.1</td><td>(130.4)</td><td>323.5</td><td>(76.4)</td></tr><tr><td>BREAKOUT</td><td>m12d0</td><td>11.5</td><td>(10.7)</td><td>69.1</td><td>(14.9)</td><td>48.2</td><td>(4.1)</td><td>96.1</td><td>(11.2)</td><td>67.6</td><td>(32.4)</td><td>55.2</td><td>(37.2)</td></tr><tr><td rowspan="3">SPACE INVADERS</td><td>m1d0</td><td>617.8</td><td>(55.9)</td><td>926.1</td><td>(56.6)</td><td>701.8</td><td>(28.5)</td><td>1033.5</td><td>(89.7)</td><td>753.6</td><td>(31.6)</td><td>979.7</td><td>(39.8)</td></tr><tr><td>m1d1</td><td>482.6</td><td>(63.4)</td><td>799.4</td><td>(52.5)</td><td>656.7</td><td>(25.5)</td><td>920.0</td><td>(83.5)</td><td>698.5</td><td>(31.3)</td><td>906.9</td><td>(56.5)</td></tr><tr><td>m9d0</td><td>354.8</td><td>(59.4)</td><td>574.1</td><td>(37.0)</td><td>519.0</td><td>(31.1)</td><td>583.0</td><td>(17.5)</td><td>518.0</td><td>(16.7)</td><td>567.7</td><td>(40.1)</td></tr></table>
123
+
124
+ 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.
125
+
126
+ 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.
127
+
128
+ 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.
129
+
130
+ # 7 DISCUSSION AND CONCLUSION
131
+
132
+ 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.
133
+
134
+ REGULARIZED FINE-TUNING 3CONV
135
+ REGULARIZED FINE-TUNING REGULARIZED 3CONV+1FC FINE-TUNING
136
+ 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.
137
+
138
+ <table><tr><td colspan="2">GAME VARIANT</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">50M</td></tr><tr><td rowspan="3">FREEWAY</td><td>m1d0</td><td>0.0</td><td>(0.0)</td><td>0.7</td><td>(1.4)</td><td>0.1</td><td>(0.1)</td><td>4.9 (9.9)</td><td></td><td>25.4 (0.2)</td></tr><tr><td>m1d1</td><td>0.0</td><td>(0.0)</td><td>0.0</td><td>(0.0)</td><td>0.1</td><td>(0.1)</td><td>10.0 (12.3)</td><td></td><td>25.4 (0.4)</td></tr><tr><td>m4d0</td><td>7.3</td><td>(3.5)</td><td>30.4</td><td>(0.6)</td><td>4.9</td><td>(4.8)</td><td>30.7 (1.7)</td><td></td><td>32.2 (0.5)</td></tr><tr><td rowspan="2">HERO</td><td>m1d0</td><td>405.1</td><td>(82.0)</td><td>1949.1</td><td>(2076.4)</td><td>350.3</td><td>(52.1)</td><td>3085.3 (2055.6)</td><td></td><td>4104.6 (2192.8)</td></tr><tr><td>m2d0</td><td>232.1</td><td>(30.1)</td><td>455.2</td><td>(170.4)</td><td>150.4</td><td>(38.5)</td><td>307.6 (64.8)</td><td>211.0</td><td>(100.6)</td></tr><tr><td>BREAKOUT</td><td>m12d0</td><td>4.3</td><td>(1.7)</td><td>63.7</td><td>(26.6)</td><td>5.4</td><td>(0.8)</td><td>89.1 (16.7)</td><td></td><td>96.1 (11.2)</td></tr><tr><td rowspan="3">SPACE INVADERS</td><td>m1d0</td><td>669.3</td><td>(29.1)</td><td>998.1</td><td>(78.8)</td><td>681.3</td><td>(17.2) 989.6</td><td>(39.4)</td><td>1033.5</td><td>(89.7)</td></tr><tr><td>m1d1</td><td>609.8</td><td>(16.6)</td><td>836.3</td><td>(55.9)</td><td>638.7</td><td>(19.1)</td><td>883.4 (38.1)</td><td></td><td>920.0 (83.5)</td></tr><tr><td>m9d0</td><td>436.1</td><td>(18.9)</td><td>581.0</td><td>(12.2)</td><td>439.9</td><td>(40.3) 586.7</td><td>(39.7)</td><td>583.0</td><td>(17.5)</td></tr></table>
139
+
140
+ 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).
141
+
142
+ 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).
143
+
144
+ 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.
145
+
146
+ # REFERENCES
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ 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.
153
+
154
+ 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.
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ Jeremy Howard and Sebastian Ruder. Fine-tuned language models for text classification. CoRR, abs/1801.06146, 2018.
163
+
164
+ 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.
165
+
166
+ 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.
167
+
168
+ 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.
169
+
170
+ 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.
171
+
172
+ 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.
173
+
174
+ 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.
175
+
176
+ 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.
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ 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.
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ 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.
193
+
194
+ 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.
195
+
196
+ Christopher J. C. H. Watkins and Peter Dayan. Q-learning. Machine Learning, 8:279–292, 1992.
197
+
198
+ 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.
199
+
200
+ Chiyuan Zhang, Oriol Vinyals, Rémi Munos, and Samy Bengio. A study on overfitting in deep reinforcement learning. CoRR, abs/1804.06893, 2018.
201
+
202
+ # A GAME MODES
203
+
204
+ FREEWAY
205
+
206
+ ![](images/2aa668386109e1d563a4da6e20e0e078eba773211110fae1c133a31561cb8b56.jpg)
207
+
208
+ 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.
209
+
210
+ HERO
211
+
212
+ ![](images/4e1f9a03b118e6622d46725b65ec6b4af8fc78827ef3902caea119a258c29bd2.jpg)
213
+
214
+ 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.
215
+
216
+ # BREAKOUT
217
+
218
+ ![](images/e8ada2c923eaae624bc3f7f54240fb348bfb0e049ff96bc5e858d6e1a93b1886.jpg)
219
+ (a) BREAKOUT m0d0
220
+
221
+ ![](images/643a9a7840f6a9949a8a04cfc9b540c6c0bc1614c1788137620af3ef28b207db.jpg)
222
+ (b) BREAKOUT m12d0
223
+
224
+ 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.
225
+
226
+ ![](images/3e7939fc132f28db015a68af1959cea16ff790ca122e95820d85c1284032ce10.jpg)
227
+
228
+ # SPACE INVADERS
229
+
230
+ 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.
231
+
232
+ # B BASELINE RESULTS
233
+
234
+ 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.
235
+
236
+ # NEURAL NETWORK ARCHITECTURE
237
+
238
+ ![](images/7dfe146f2c0eda06161f62b44568482e8f495d2ebf3fa310b9b75eaeb385bde9.jpg)
239
+ Figure 8: Neural network architecture used by DQN to predict state-action values.
240
+
241
+ # HYPERPARAMETERS
242
+
243
+ Learning rate $\alpha$
244
+ Minibatch size
245
+ Dropout rate convolutions
246
+ Dropout rate fully connected
247
+ Regularization term $\lambda$
248
+
249
+ 0.00025
250
+ 32
251
+ 0.05
252
+ 0.1
253
+ 0.0001
254
+ Replay buffer size 1, 000, 000
255
+ Target update frequency 4
256
+ ϵ decay horizon 1M frames
257
+ $\epsilon$ initial 1.0
258
+ ϵ final 0.01
259
+ Discount factor $\gamma$ 0.99
260
+
261
+ # EVALUATION
262
+
263
+ 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.
264
+
265
+ 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.
266
+
267
+ Table 5: Baselines using vanilla DQN for all tested game variants.
268
+
269
+ <table><tr><td colspan="2">GAME VARIANT</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">100M</td><td colspan="2">BEST ACTION</td></tr><tr><td rowspan="4">PAAAIAA</td><td>m0d0</td><td>3.0</td><td>(1.0)</td><td>31.4</td><td>(0.2)</td><td>32.1</td><td>(0.1)</td><td>23.0</td><td>(1.4)</td></tr><tr><td>m1d0</td><td>0.0</td><td>(0.1)</td><td>4.8</td><td>(9.3)</td><td>7.5</td><td>(11.5)</td><td>5.0</td><td>(1.5)</td></tr><tr><td>m1d1</td><td>0.0</td><td>(0.0)</td><td>0.0</td><td>(0.0)</td><td>2.5</td><td>(7.3)</td><td>4.2</td><td>(1.3)</td></tr><tr><td>m4d0</td><td>4.4</td><td>(1.4)</td><td>29.9</td><td>(0.7)</td><td>32.8</td><td>(0.2)</td><td>7.5</td><td>(2.8)</td></tr><tr><td rowspan="3">HREH</td><td>m0d0</td><td>3187.8</td><td>(78.3)</td><td>9034.4</td><td>(1610.9)</td><td>13961.0</td><td>(181.9)</td><td>150.0</td><td>(0.0)</td></tr><tr><td>m1d0</td><td>326.9</td><td>(40.3)</td><td>1425.2</td><td>(1755.1)</td><td>5026.8</td><td>(2174.6)</td><td>75.8</td><td>(7.5)</td></tr><tr><td>m2d0</td><td>116.3</td><td>(11.0)</td><td>326.1</td><td>(130.4)</td><td>323.5</td><td>(76.4)</td><td>12.0</td><td>(27.5)</td></tr><tr><td rowspan="2">BHARAIRI</td><td>m0d0</td><td>17.5</td><td>(2.0)</td><td>72.5</td><td>(7.7)</td><td>73.4</td><td>(13.5)</td><td>2.3</td><td>(1.3)</td></tr><tr><td>m12d0</td><td>17.7</td><td>(1.3)</td><td>67.6</td><td>(32.4)</td><td>55.2</td><td>(37.2)</td><td>1.8</td><td>(1.1)</td></tr><tr><td rowspan="4">SSIAAAII IIISSS</td><td>m0d0</td><td>250.3</td><td>(16.2)</td><td>698.8</td><td>(32.2)</td><td>927.1</td><td></td><td></td><td></td></tr><tr><td>m1d0</td><td>203.6</td><td></td><td>753.6</td><td></td><td>979.7</td><td>(85.3)</td><td>243.6</td><td>(95.9)</td></tr><tr><td>m1d1</td><td></td><td>(24.3)</td><td>698.5</td><td>(31.6)</td><td></td><td>(39.8)</td><td>192.6</td><td>(65.7)</td></tr><tr><td></td><td>193.6</td><td>(11.0)</td><td></td><td>(31.3)</td><td>906.9</td><td>(56.5)</td><td>180.9</td><td>(101.9)</td></tr><tr><td>m9d0</td><td></td><td>173.0</td><td>(17.8)</td><td>518.0</td><td>(16.7)</td><td>567.7</td><td>(40.1)</td><td>174.6</td><td>(65.9)</td></tr></table>
270
+
271
+ Table 6: Baselines using dropout $+ \ell _ { 2 }$ regularization for each default flavour.
272
+
273
+ <table><tr><td colspan="2">GAME VARIANT</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">100M</td><td colspan="2">BEST ACTION</td></tr><tr><td>FREEWAY</td><td>m0d0</td><td>4.6</td><td>(5.0)</td><td>25.9</td><td>(0.6)</td><td>29.0</td><td>(0.8)</td><td>23.0</td><td>(1.4)</td></tr><tr><td>HERO</td><td>m0d0</td><td>2466.5</td><td>(630.8)</td><td>6505.9</td><td>(1843.0)</td><td>12446.9</td><td>(397.4)</td><td>150.0</td><td>(0.0)</td></tr><tr><td>BREAKOUT</td><td>m0d0</td><td>6.1</td><td>(2.7)</td><td>34.1</td><td>(1.8)</td><td>66.4</td><td>(3.6)</td><td>2.3</td><td>(1.3)</td></tr><tr><td>SPACE INVADERS</td><td>m0d0</td><td>214.6</td><td>(13.8)</td><td>623.1</td><td>(16.3)</td><td>617.4</td><td>(29.6)</td><td>243.6</td><td>(95.9)</td></tr></table>
274
+
275
+ <table><tr><td colspan="2" rowspan="2">GAME VARIANT</td><td colspan="6">BASELINE</td><td colspan="6">BASELINEW/REGULARIZATION</td></tr><tr><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">100M</td><td colspan="2">10M</td><td colspan="2">50M</td><td colspan="2">100M</td></tr><tr><td>FREEWAY</td><td>m0d0</td><td>3.0</td><td>(1.0)</td><td>31.4</td><td>(0.2)</td><td>32.1</td><td>(0.1)</td><td>4.6(5.0)</td><td></td><td>25.9</td><td>(0.6)</td><td>29.0</td><td>(0.8)</td></tr><tr><td>HERO</td><td>m0do</td><td>3187.8</td><td>(78.3)</td><td>9034.4</td><td>(1610.9)</td><td>13961.0</td><td>(181.9)</td><td>2466.5</td><td>(630.8)</td><td>6505.9</td><td>(1843.0)</td><td>12446.9</td><td>(397.4)</td></tr><tr><td>BREAKOUT</td><td>m0do</td><td>17.5</td><td>(2.0)</td><td>72.5</td><td>(7.7)</td><td>73.4</td><td>(13.5)</td><td>6.1</td><td>(2.7)</td><td>34.1</td><td>(1.8)</td><td>66.4</td><td>(3.6)</td></tr><tr><td>SPACE INVADERS</td><td>m0do</td><td>250.3</td><td>(16.2)</td><td>698.8</td><td>(32.2)</td><td>927.1</td><td>(85.3)</td><td>214.6</td><td>(13.8)</td><td>623.1</td><td>(16.3)</td><td>617.4</td><td>(29.6)</td></tr></table>
276
+
277
+ 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.
278
+
279
+ # C POLICY EVALUATION LEARNING CURVES
280
+
281
+ 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.
282
+
283
+ # EVALUATION
284
+
285
+ 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.
286
+
287
+ ![](images/3cba99530b5376f020719509f7d2ca33575814279dd3657daa2501cbe9026204.jpg)
288
+ 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.
md/train/Hkfmn5n6W/Hkfmn5n6W.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/Hkg4TI9xl/Hkg4TI9xl.md ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A BASELINE FOR DETECTING MISCLASSIFIED ANDOUT-OF-DISTRIBUTION EXAMPLESIN NEURAL NETWORKS
2
+
3
+ Dan Hendrycks∗ University of California, Berkeley hendrycks@berkeley.edu
4
+
5
+ Kevin Gimpel
6
+ Toyota Technological Institute at Chicago
7
+ kgimpel@ttic.edu
8
+
9
+ # ABSTRACT
10
+
11
+ 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.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ 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).
16
+
17
+ 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).
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ # 2 PROBLEM FORMULATION AND EVALUATION
28
+
29
+ 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.
30
+
31
+ 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).
32
+
33
+ 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
34
+
35
+ 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
36
+
37
+ 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 )$ .
38
+
39
+ 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.
40
+
41
+ # 3 SOFTMAX PREDICTION PROBABILITY AS A BASELINE
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ # 3.1 COMPUTER VISION
50
+
51
+ 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.
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ <table><tr><td>Dataset</td><td>AUROC /Base</td><td>AUPR Succ/Base</td><td>AUPR Err/Base</td><td>Pred.Prob Wrong(mean)</td><td>Test Set Error</td></tr><tr><td>MNIST</td><td>97/50</td><td>100/98</td><td>48/1.7</td><td>86</td><td>1.69</td></tr><tr><td>CIFAR-10</td><td>93/50</td><td>100/95</td><td>43/5</td><td>80</td><td>4.96</td></tr><tr><td>CIFAR-100</td><td>87/50</td><td>96/79</td><td>62/21</td><td>66</td><td>20.7</td></tr></table>
60
+
61
+ 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.
62
+
63
+ <table><tr><td>In-Distribution / Out-of-Distribution</td><td>AUROC /Base</td><td>AUPR In /Base</td><td>AUPR Out/Base</td><td>Pred.Prob (mean)</td></tr><tr><td>CIFAR-10/SUN</td><td>95/50</td><td>89/33</td><td>97/67</td><td>72</td></tr><tr><td>CIFAR-10/Gaussian</td><td>97/50</td><td>98/49</td><td>95/51</td><td>77</td></tr><tr><td>CIFAR-10/AIl</td><td>96/50</td><td>88/24</td><td>98/76</td><td>74</td></tr><tr><td>CIFAR-100/SUN</td><td>91/50</td><td>83/27</td><td>96/73</td><td>56</td></tr><tr><td>CIFAR-100/Gaussian</td><td>88/50</td><td>92/43</td><td>80/57</td><td>77</td></tr><tr><td>CIFAR-100/AIl</td><td>90/50</td><td>81/21</td><td>96/79</td><td>63</td></tr><tr><td>MNIST/Omniglot</td><td>96/50</td><td>97/52</td><td>96/48</td><td>86</td></tr><tr><td>MNIST/notMNIST</td><td>85/50</td><td>86/50</td><td>88/50</td><td>92</td></tr><tr><td>MNIST/CIFAR-10bw</td><td>95/50</td><td>95/50</td><td>95/50</td><td>87</td></tr><tr><td>MNIST/Gaussian</td><td>90/50</td><td>90/50</td><td>91/50</td><td>91</td></tr><tr><td>MNIST/Uniform</td><td>99/50</td><td>99/50</td><td>98/50</td><td>83</td></tr><tr><td>MNIST/AII</td><td>91/50</td><td>76/20</td><td>98/80</td><td>89</td></tr></table>
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ # 3.2 NATURAL LANGUAGE PROCESSING
70
+
71
+ Let us turn to a variety of tasks and architectures used in natural language processing.
72
+
73
+ # 3.2.1 SENTIMENT CLASSIFICATION
74
+
75
+ 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.
76
+
77
+ Table 3: Detecting correct and incorrect classifications for binary sentiment classification.
78
+
79
+ <table><tr><td>Dataset</td><td>AUROC /Base</td><td>AUPR Succ/Base</td><td>AUPR Err/Base</td><td>Pred.Prob Wrong(mean)</td><td>Test Set Error</td></tr><tr><td>IMDB</td><td>82/50</td><td>97/88</td><td>36/12</td><td>74</td><td>11.9</td></tr></table>
80
+
81
+ 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.
82
+
83
+ <table><tr><td>In-Distribution / Out-of-Distribution</td><td>AUROC /Base</td><td>AUPR In /Base</td><td>AUPR Out/Base</td><td>Pred.Prob (mean)</td></tr><tr><td>IMDB/Customer Reviews</td><td>95/50</td><td>99/89</td><td>60/11</td><td>62</td></tr><tr><td>IMDB/Movie Reviews</td><td>94/50</td><td>98/72</td><td>80/28</td><td>63</td></tr><tr><td>IMDB/All</td><td>94/50</td><td>97/66</td><td>84/34</td><td>63</td></tr></table>
84
+
85
+ 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.
86
+
87
+ # 3.2.2 TEXT CATEGORIZATION
88
+
89
+ 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.
90
+
91
+ 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.
92
+
93
+ Table 5: Detecting correct and incorrect classifications for text categorization.
94
+
95
+ <table><tr><td>Dataset</td><td>AUROC /Base</td><td>AUPR Succ/Base</td><td>AUPR Err/Base</td><td>Pred.Prob Wrong(mean)</td><td>Test Set Error</td></tr><tr><td>15 Newsgroups</td><td>89/50</td><td>99/93</td><td>42/7.3</td><td>53</td><td>7.31</td></tr><tr><td>Reuters 6</td><td>89/50</td><td>100/98</td><td>35/2.5</td><td>77</td><td>2.53</td></tr><tr><td>Reuters 40</td><td>91/50</td><td>99/92</td><td>45/7.6</td><td>62</td><td>7.55</td></tr></table>
96
+
97
+ Table 6: Distinguishing in- and out-of-distribution test set data for text categorization.
98
+
99
+ <table><tr><td>In-Distribution / Out-of-Distribution</td><td>AUROC /Base</td><td>AUPR In/Base</td><td>AUPR Out/Base</td><td>Pred.Prob (mean)</td></tr><tr><td>15/5 Newsgroups</td><td>75/50</td><td>92/84</td><td>45/16</td><td>65</td></tr><tr><td>Reuters6/Reuters2</td><td>92/50</td><td>100/95</td><td>56/4.5</td><td>72</td></tr><tr><td>Reuters40/Reuters12</td><td>95/50</td><td>100/93</td><td>60/7.2</td><td>47</td></tr></table>
100
+
101
+ Table 7: Detecting correct and incorrect classifications for part-of-speech tagging.
102
+
103
+ <table><tr><td>Dataset</td><td>AUROC /Base</td><td>AUPR Succ/Base</td><td>AUPR Err/Base</td><td>Pred.Prob Wrong(mean)</td><td>Test Set Error</td></tr><tr><td>WSJ</td><td>96/50</td><td>100/96</td><td>51/3.7</td><td>71</td><td>3.68</td></tr><tr><td>Twitter</td><td>89/50</td><td>98/87</td><td>53/13</td><td>69</td><td>12.59</td></tr></table>
104
+
105
+ # 3.2.3 PART-OF-SPEECH TAGGING
106
+
107
+ 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.
108
+
109
+ <table><tr><td>In-Distribution/ Out-of-Distribution</td><td>AUROC /Base</td><td>AUPR In/Base</td><td>AUPR Out/Base</td><td>Pred.Prob (mean)</td></tr><tr><td>WSJ/Twitter</td><td>80/50</td><td>98/92</td><td>41/7.7</td><td>81</td></tr><tr><td>WSJ/Weblog*</td><td>61/50</td><td>88/86</td><td>30/14</td><td>93</td></tr></table>
110
+
111
+ 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.
112
+
113
+ # 3.3 AUTOMATIC SPEECH RECOGNITION
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ Table 9: Detecting out-of-distribution distorted speech. All values are percentages.
120
+
121
+ <table><tr><td>In-Distribution / Out-of-Distribution</td><td>AUROC /Base</td><td>AUPR In/Base</td><td>AUPR Out/Base</td><td>Pred.Prob (mean)</td></tr><tr><td>TIMIT/TIMIT+Airport</td><td>99/50</td><td>99/50</td><td>99/50</td><td>59</td></tr><tr><td>TIMIT/TIMIT+Babble</td><td>100/50</td><td>100/50</td><td>100/50</td><td>55</td></tr><tr><td>TIMIT/TIMIT+Car</td><td>98/50</td><td>98/50</td><td>98/50</td><td>59</td></tr><tr><td>TIMIT/TIMIT+Exhibition</td><td>100/50</td><td>100/50</td><td>100/50</td><td>57</td></tr><tr><td>TIMIT/TIMIT+Restaurant</td><td>98/50</td><td>98/50</td><td>98/50</td><td>60</td></tr><tr><td>TIMIT/TIMIT+Street</td><td>100/50</td><td>100/50</td><td>100/50</td><td>52</td></tr><tr><td>TIMIT/TIMIT+Subway</td><td>100/50</td><td>100/50</td><td>100/50</td><td>56</td></tr><tr><td>TIMIT/TIMIT+Train</td><td>100/50</td><td>100/50</td><td>100/50</td><td>58</td></tr><tr><td>TIMIT/Chinese</td><td>85/50</td><td>80/34</td><td>90/66</td><td>64</td></tr><tr><td>TIMIT/AII</td><td>97/50</td><td>79/10</td><td>100/90</td><td>58</td></tr></table>
122
+
123
+ # 4 ABNORMALITY DETECTION WITH AUXILIARY DECODERS
124
+
125
+ 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.
126
+
127
+ # 4.1 TIMIT
128
+
129
+ 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.
130
+
131
+ 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.
132
+
133
+ 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.
134
+
135
+ <table><tr><td>In-Distribution/ Out-of-Distribution</td><td>AUROC /Base Softmax</td><td>AUROC /Base AbMod</td><td>AUPR In/Base Softmax</td><td>AUPR In/Base AbMod</td><td>AUPR Out/Base Softmax</td><td>AUPR Out/Base AbMod</td></tr><tr><td>TIMIT/+Airport</td><td>75/50</td><td>100/50</td><td>77/41</td><td>100/41</td><td>73/59</td><td>100/59</td></tr><tr><td>TIMIT/+Babble TIMIT/+Car</td><td>94/50</td><td>100/50</td><td>95/41</td><td>100/41</td><td>91/59</td><td>100/59</td></tr><tr><td>TIMIT/+Exhib.</td><td>70/50</td><td>98/50</td><td>69/41</td><td>98/41</td><td>70/59</td><td>98/59</td></tr><tr><td>TIMIT/+Rest.</td><td>91/50</td><td>98/50</td><td>92/41</td><td>98/41</td><td>91/59</td><td>98/59</td></tr><tr><td>TIMIT/+Subway</td><td>68/50 76/50</td><td>95/50</td><td>70/41</td><td>96/41</td><td>67/59</td><td>95/59</td></tr><tr><td>TIMIT/+Street</td><td>89/50</td><td>96/50 98/50</td><td>77/41</td><td>96/41</td><td>74/59</td><td>96/59</td></tr><tr><td></td><td>80/50</td><td>100/50</td><td>91/41</td><td>99/41</td><td>85/59</td><td>98/59</td></tr><tr><td>TIMIT/+Train</td><td>79/50</td><td></td><td>82/41</td><td>100/41 66/12</td><td>77/59</td><td>100/59</td></tr><tr><td>TIMIT/Chinese</td><td>80</td><td>90/50 97</td><td>41/12 77</td><td></td><td>96/88</td><td>98/88</td></tr><tr><td>Average</td><td></td><td></td><td></td><td>95</td><td>80</td><td>98</td></tr></table>
136
+
137
+ Table 11: Improved detection using the abnormality module. All values are percentages.
138
+
139
+ <table><tr><td>In-Distribution / Out-of-Distribution</td><td>AUROC /Base Softmax</td><td>AUROC /Base AbMod</td><td>AUPR In/Base Softmax</td><td>AUPR In/Base AbMod</td><td>AUPR Out/Base Softmax</td><td>AUPR Out/Base</td></tr><tr><td>MNIST/Omniglot</td><td>95/50</td><td>100/50</td><td>95/52</td><td>100/52</td><td>95/48</td><td>AbMod 100/48</td></tr><tr><td>MNIST/notMNIST</td><td>87/50</td><td>100/50</td><td>88/50</td><td>100/50</td><td>90/50</td><td>100/50</td></tr><tr><td>MNIST/CIFAR-10bw</td><td>98/50</td><td>100/50</td><td>98/50</td><td>100/50</td><td>98/50</td><td>100/50</td></tr><tr><td>MNIST/Gaussian</td><td>88/50</td><td>100/50</td><td>88/50</td><td>100/50</td><td>90/50</td><td>100/50</td></tr><tr><td>MNIST/Uniform</td><td>99/50</td><td>100/50</td><td>99/50</td><td>100/50</td><td>99/50</td><td>100/50</td></tr><tr><td>Average</td><td>93</td><td>100</td><td>94</td><td>100</td><td>94</td><td>100</td></tr></table>
140
+
141
+ # 4.2 MNIST
142
+
143
+ 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.
144
+
145
+ # 5 DISCUSSION AND FUTURE WORK
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ # 6 CONCLUSION
152
+
153
+ 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.
154
+
155
+ # ACKNOWLEDGMENTS
156
+
157
+ 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.
158
+
159
+ # REFERENCES
160
+
161
+ Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mane. Con- ´ crete problems in ai safety. arXiv, 2016.
162
+
163
+ Ann Bies, Justin Mott, Colin Warner, and Seth Kulick. English Web Treebank, 2012.
164
+
165
+ Yaroslav Bulatov. notMNIST dataset. 2011.
166
+
167
+ Jesse Davis and Mark Goadrich. The relationship between precision-recall and ROC curves. In International Conference on Machine Learning (ICML), 2006.
168
+
169
+ Tom Fawcett. An introduction to ROC analysis. Pattern Recognition Letters, 2005.
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ Raja Giryes, Guillermo Sapiro, and Alex M. Bronstein. Deep neural networks with random gaussian weights: A universal classification strategy? arXiv, 2015.
176
+
177
+ Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
178
+
179
+ 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.
180
+
181
+ Dan Hendrycks and Kevin Gimpel. Methods for detecting adversarial images and a colorful saliency map. arXiv, 2016a.
182
+
183
+ Dan Hendrycks and Kevin Gimpel. Bridging nonlinearities and stochastic regularizers with Gaussian error linear units. arXiv, 2016b.
184
+
185
+ Dan Hendrycks and Kevin Gimpel. Adjusting for dropout variance in batch normalization and weight initialization. arXiv, 2016c.
186
+
187
+ 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.
188
+
189
+ Sepp Hochreiter and Jurgen Schmidhuber. ¨ Long short-term memory. Neural Computation, 1997.
190
+
191
+ Minqing Hu and Bing Liu. Mining and Summarizing Customer Reviews. Knowledge Discovery and Data Mining (KDD), 2004.
192
+
193
+ 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.
194
+
195
+ Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv, 2016.
196
+
197
+ Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. International Conference for Learning Representations (ICLR), 2015.
198
+
199
+ Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images, 2009.
200
+
201
+ Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 2015.
202
+
203
+ Ken Lang. Newsweeder: Learning to filter netnews. In International Conference on Machine Learning (ICML), 1995.
204
+
205
+ 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.
206
+
207
+ Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with restarts. arXiv, 2016.
208
+
209
+ 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.
210
+
211
+ Chris Manning and Hinrich Schutze. ¨ Foundations of Statistical Natural Language Processing. MIT Press, 1999.
212
+
213
+ Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of English: The Penn Treebank. Computational linguistics, 1993.
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. Thumbs up? sentiment classification using machine learning techniques. In Empirical Methods in Natural Language Processing (EMNLP), 2002.
222
+
223
+ Foster Provost, Tom Fawcett, and Ron Kohavi. The case against accuracy estimation for comparing induction algorithms. In International Conference on Machine Learning (ICML), 1998.
224
+
225
+ 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.
226
+
227
+ 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.
228
+
229
+ Jacob Steinhardt and Percy Liang. Unsupervised risk estimation using only conditional independence structure. In Neural Information Processing Systems (NIPS), 2016.
230
+
231
+ Dong Wang and Xuewei Zhang. Thchs-30 : A free chinese speech corpus. In Technical Report, 2015.
232
+
233
+ Gethin Williams and Steve Renals. Confidence measures for hybrid hmm/ann speech recognition. In Proceedings of EuroSpeech, 1997.
234
+
235
+ 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.
236
+
237
+ Dong Yu, Jinyu Li, and Li Deng. Calibration of confidence measures in speech recognition. In IEEE Transactions on Audio, Speech, and Language, 2010.
238
+
239
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. British Machine Vision Conference, 2016.
240
+
241
+ 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.
242
+
243
+ # A ABNORMALITY MODULE EXAMPLE
244
+
245
+ ![](images/4beb57de31bda8242253be43662a1c5fae8e3fd3913d61f222a67c58469a7a8a.jpg)
246
+ 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.
md/train/HkxAAvcxx/HkxAAvcxx.md ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRANSFORMATION-BASED MODELS OF VIDEO SEQUENCES
2
+
3
+ Joost van Amersfoort ∗, Anitha Kannan, Marc’Aurelio Ranzato, Arthur Szlam, Du Tran & Soumith Chintala
4
+
5
+ Facebook AI Research joost@joo.st, {akannan, ranzato, aszlam, trandu, soumith}@fb.com
6
+
7
+ # ABSTRACT
8
+
9
+ 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.
10
+
11
+ 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.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ ![](images/12ee9523c8c7a6b995c4a5f346b3260214950d38e8e359bf96b473cbaa612058.jpg)
22
+ 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.
23
+
24
+ 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).
25
+
26
+ # 1.1 RELATED WORK
27
+
28
+ 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.
29
+
30
+ 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.
31
+
32
+ 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.
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ ![](images/df89c340471c0d73caddfcea4acad4c37effaff1ca0dd8d6869df3386e93421a.jpg)
39
+ 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.
40
+
41
+ # 2 MODEL
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ # 2.1 AFFINE TRANSFORM EXTRACTOR
50
+
51
+ 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.
52
+
53
+ ![](images/81a308020c438f39ad5439f467fe0f3828cc385ad43508393d31c92ed57c46bb.jpg)
54
+ 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
55
+
56
+ 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$ .
57
+
58
+ 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 }$ .
59
+
60
+ 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.
61
+
62
+ 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.
63
+
64
+ # 2.2 AFFINE TRANSFORM PREDICTOR
65
+
66
+ 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$ .
67
+
68
+ 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.
69
+
70
+ 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.
71
+
72
+ # 2.3 MULTI-STEP PREDICTION
73
+
74
+ In the previous section, we described how to predict the set of affine transforms at the next time step.
75
+ In practice, we would like to predict several time steps in the future.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ # 2.4 TESTING
82
+
83
+ 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.
84
+
85
+ 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.
86
+
87
+ 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.
88
+
89
+ # 3 EXPERIMENTS
90
+
91
+ 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.
92
+
93
+ 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.
94
+
95
+ ![](images/7443870679cdf0ab5ac54a3777ad2932377d7e6b13ddb24a80c1973a6c1827d3.jpg)
96
+ 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.
97
+
98
+ 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.
99
+
100
+ # 3.1 MOVING MNIST
101
+
102
+ 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.
103
+
104
+ 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$ .
105
+
106
+ 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.
107
+
108
+ # 3.2 UCF 101 DATA SET
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ ![](images/9bb8e2779df3278f29e753245446f1e87e7f9f6c450239af241f4b76732a3d70.jpg)
115
+ 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)
116
+
117
+ 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.
118
+
119
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1> 4 frames</td><td rowspan=1 colspan=1>8 frames</td></tr><tr><td rowspan=1 colspan=1>Ground truth frames</td><td rowspan=1 colspan=1>72.46</td><td rowspan=1 colspan=1>72.29</td></tr><tr><td rowspan=1 colspan=1>Using ground truth affine transforms</td><td rowspan=1 colspan=1>71.7</td><td rowspan=1 colspan=1>71.28</td></tr><tr><td rowspan=1 colspan=1>Copy last frame</td><td rowspan=1 colspan=1>60.76</td><td rowspan=1 colspan=1>54.27</td></tr><tr><td rowspan=1 colspan=1>Optical Flow</td><td rowspan=1 colspan=1>57.29</td><td rowspan=1 colspan=1>49.37</td></tr><tr><td rowspan=1 colspan=1>Mathieu et al. (2016)</td><td rowspan=1 colspan=1>57.98</td><td rowspan=1 colspan=1>47.01</td></tr><tr><td rowspan=1 colspan=1>ours - one step prediction (not unrolled)</td><td rowspan=1 colspan=1>64.13</td><td rowspan=1 colspan=1>57.63</td></tr><tr><td rowspan=1 colspan=1>ours - four step prediction (unrolled 4 times)</td><td rowspan=1 colspan=1>64.54</td><td rowspan=1 colspan=1>57.88</td></tr></table>
120
+
121
+ 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.
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ 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.
128
+
129
+ 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.
130
+
131
+ 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.
132
+
133
+ 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.
134
+
135
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>4 frames</td><td rowspan=1 colspan=1>8 frames</td></tr><tr><td rowspan=1 colspan=1>reference</td><td rowspan=1 colspan=1>63.57</td><td rowspan=1 colspan=1>57.32</td></tr><tr><td rowspan=1 colspan=1>Varying patch sizefrom 32 × 32 to 16× 16from 16 × 16 to 8 × 8</td><td rowspan=1 colspan=1>61.7363.75</td><td rowspan=1 colspan=1>53.8557.18</td></tr><tr><td rowspan=1 colspan=1>Number of input frames23</td><td rowspan=1 colspan=1>63.663.8</td><td rowspan=1 colspan=1>57.1157.4</td></tr><tr><td rowspan=1 colspan=1>Number of predicted frames24</td><td rowspan=1 colspan=1>64.164.54</td><td rowspan=1 colspan=1>57.557.88</td></tr></table>
136
+
137
+ # 4 CONCLUSIONS
138
+
139
+ 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.
140
+
141
+ 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.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ # ACKNOWLEDGMENTS
150
+
151
+ Authors thank Camille Couprie and Michael Mathieu for discussions and helping with evaluation of their models.
152
+
153
+ # REFERENCES
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. NIPS, 2015.
160
+
161
+ 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.
162
+
163
+ Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016.
164
+
165
+ Vincent Michalski, Roland Memisevic, and Kishore Konda. Modeling deep temporal dependencies with recurrent grammar cells. In NIPS, 2014.
166
+
167
+ Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. NIPS, 2015.
168
+
169
+ 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.
170
+
171
+ 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.
172
+
173
+ Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using lstms. CoRR, abs/1502.04681, 2, 2015.
174
+
175
+ 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.
176
+
177
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. arXiv preprint arXiv:1609.02612, 2016.
178
+
179
+ Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2image: Conditional image generation from visual attributes. arXiv preprint arXiv:1512.00570, 2015.
md/train/Hyfg5o0qtm/Hyfg5o0qtm.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TEMPORAL GAUSSIAN MIXTURE LAYER FOR VIDEOS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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).
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ # 2 RELATED WORKS
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ # 3 APPROACH
32
+
33
+ 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.
34
+
35
+ 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:
36
+
37
+ 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.
38
+ 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.
39
+
40
+ ![](images/bb08fe1098ed6b3ebacab0ba55fa20f4c6eca53bc414048213d86cf9d3f10300.jpg)
41
+ 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.
42
+
43
+ # 3.1 TEMPORAL GAUSSIAN MIXTURE LAYER
44
+
45
+ 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.
46
+
47
+ 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:
48
+
49
+ $$
50
+ \mu = ( L - 1 ) \cdot \frac { \operatorname { t a n h } { ( \hat { \mu } + 1 ) } } { 2 } , \sigma ^ { 2 } = \exp { ( \hat { \sigma } ) } .
51
+ $$
52
+
53
+ 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:
54
+
55
+ $$
56
+ \hat { K } _ { m , l } = \frac { 1 } { Z } \exp { - \frac { ( l - \mu _ { m } ) ^ { 2 } } { 2 \sigma _ { m } ^ { 2 } } }
57
+ $$
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ $$
64
+ a _ { i , m } = \frac { \exp \omega _ { i , m } } { \sum _ { j } \exp \omega _ { i , j } }
65
+ $$
66
+
67
+ Based on temporal Gaussian distributions $\hat { K } _ { i }$ and attention weights $a _ { i , m }$ , the temporal convolution filters our TGM layer is computed as:
68
+
69
+ $$
70
+ K _ { i } = \sum _ { m } a _ { i , m } \hat { K } _ { i } .
71
+ $$
72
+
73
+ 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.
74
+
75
+ # 3.1.1 SINGLE TGM LAYER - DIRECT PER-CLASS ACTIVITY MODELING
76
+
77
+ 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
78
+
79
+ ![](images/1e1b884ad92c56ef857b2a263d6acccb6a7a771dee8413a54c17dfc575c6b884.jpg)
80
+ 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.
81
+
82
+ $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.
83
+
84
+ 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 } \} } }$ :
85
+
86
+ $$
87
+ s _ { i } = v * K _ { i } , \ S = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { C _ { o u t } } ]
88
+ $$
89
+
90
+ 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).
91
+
92
+ # 3.1.2 MULTIPLE TGM LAYERS - GROUPED CONVOLUTION
93
+
94
+ 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.
95
+
96
+ 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 } ]$ ,
97
+
98
+ $$
99
+ s _ { i } = f _ { i } * K _ { i } , ~ S = [ s _ { 1 } , s _ { 2 } , . ~ . ~ . s _ { C _ { o u t } } ]
100
+ $$
101
+
102
+ 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.
103
+
104
+ # 3.1.3 MULTIPLE TGM LAYERS - CHANNEL COMBINATION
105
+
106
+ 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.
107
+
108
+ 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.
109
+
110
+ $$
111
+ G _ { i , j } = ( f _ { j } * K _ { i , j } )
112
+ $$
113
+
114
+ where each $G _ { i , j }$ is a $D \times T$ -dim representation.
115
+
116
+ 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
117
+
118
+ ![](images/aca85f15ca42c4a0cdcd7ee131a3bb28c18e0cc54f9ba616551cbb896c0860e5.jpg)
119
+ 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 }$ .
120
+
121
+ 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.
122
+
123
+ $$
124
+ s _ { i } = G _ { i } * w _ { i } = ( f _ { j } * K _ { i , j } ) * w _ { i } , \ S = [ s _ { 1 } , s _ { 2 } \ldots , s _ { C _ { o u t } } ]
125
+ $$
126
+
127
+ 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.
128
+
129
+ # 3.2 VIDEO CNN MODELS WITH TGM LAYERS
130
+
131
+ 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:
132
+
133
+ $$
134
+ L ( v ) = \sum _ { t , c } z _ { t , c } \log ( p ( c | v _ { t } ) ) + ( 1 - z _ { t , c } ) \log ( 1 - p ( c | v _ { t } ) )
135
+ $$
136
+
137
+ 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.
138
+
139
+ ![](images/cdd6c2d13bb16728b0fe94e3796a0d17a7ed1459c289733ad68ae2e40ee7b924.jpg)
140
+ 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.
141
+
142
+ # 4 EXPERIMENTS
143
+
144
+ # 4.1 IMPLEMENTATION AND BASELINES
145
+
146
+ 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.
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ # 4.2 MULTITHUMOS
153
+
154
+ 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.
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ <table><tr><td rowspan="2"></td><td colspan="3">13D</td><td colspan="3">InceptionV3</td></tr><tr><td>Spatial</td><td>Temporal</td><td>Two-Stream</td><td>Spatial</td><td>Temporal</td><td>Two-Stream</td></tr><tr><td>Baseline</td><td>22.3</td><td>25.0</td><td>29.7</td><td>13.6</td><td>14.1</td><td>15.2</td></tr><tr><td>Temporal Conv</td><td>32.5</td><td>35.5</td><td>38.4</td><td>15.2</td><td>15.5</td><td>15.8</td></tr><tr><td>3 Temporal Conv</td><td>20.4</td><td>23.4</td><td>24.4</td><td>5.3</td><td>6.1</td><td>6.5</td></tr><tr><td colspan="7">TGM layers with grouped convolution</td></tr><tr><td>1 TGM</td><td>35.1</td><td>37.8</td><td>40.5</td><td>16.3</td><td>17.5</td><td>18.0</td></tr><tr><td>3 TGM</td><td>36.4</td><td>42.3</td><td>43.5</td><td>17.5</td><td>18.3</td><td>19.2</td></tr><tr><td colspan="7">TGM layers with channel combination</td></tr><tr><td>1 TGM (soft)</td><td>35.2</td><td>37.9</td><td>40.2</td><td>17.2</td><td>17.6</td><td>18.4</td></tr><tr><td>1 TGM (1x1)</td><td>36.1</td><td>38.2</td><td>40.8</td><td>17.2</td><td>17.7</td><td>18.4</td></tr><tr><td>3 TGM (soft)</td><td>36.2</td><td>40.1</td><td>42.3</td><td>17.5</td><td>19.1</td><td>21.2</td></tr><tr><td>3 TGM (1x1)</td><td>37.2</td><td>42.1</td><td>44.3</td><td>17.9</td><td>19.3</td><td>22.2</td></tr></table>
163
+
164
+ Table 2: Additional number of parameters for models when added to the base architecture (e.g., I3D or Inception V3).
165
+
166
+ <table><tr><td>Model</td><td> # of parameters</td></tr><tr><td>LSTM</td><td>10.5M</td></tr><tr><td>1 Temporal Conv</td><td>10.5M</td></tr><tr><td>3 Temporal Conv</td><td>31.5M</td></tr><tr><td>1 TGM Layer</td><td>10K</td></tr><tr><td>3 TGMLayers</td><td>100K</td></tr></table>
167
+
168
+ Table 3: Comparison of previous methods with comparable number of parameters and random forms of our TGM layer.
169
+
170
+ <table><tr><td>Model</td><td>mAP</td></tr><tr><td>LSTM with 100k parameters</td><td>6.5</td></tr><tr><td>Temporal Conv. with 1OOk parameters</td><td>7.3</td></tr><tr><td>TGM with random temporal filters</td><td>34.5</td></tr><tr><td>TGM with fixed Gaussians</td><td>38.5</td></tr><tr><td>Full TGM</td><td>44.3</td></tr></table>
171
+
172
+ 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.
173
+
174
+ 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).
175
+
176
+ # 4.3 CHARADES
177
+
178
+ 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.
179
+
180
+ 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
181
+
182
+ ![](images/c0d256bcd8222f7ad03ebc79eb263ced37551f8c7850c775d1e2e262f032da84.jpg)
183
+ 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.
184
+
185
+ Table 4: Performances of the state-of-the-art methods and our approach on MultiTHUMOS. Our approach meaningfully outperforms all previous results.
186
+
187
+ <table><tr><td></td><td>mAP</td></tr><tr><td>Two-stream (Yeung et al., 2015)</td><td>27.6</td></tr><tr><td>Two-stream + LSTM (Yeung et al., 2015)</td><td>28.1</td></tr><tr><td>Multi-LSTM (Yeung et al., 2015)</td><td>29.6</td></tr><tr><td>Predictive-corrective (Dave et al., 2017)</td><td>29.7</td></tr><tr><td>I3D baseline</td><td>29.7</td></tr><tr><td>I3D+LSTM</td><td>29.9</td></tr><tr><td>I3D + temporal pyramid</td><td>31.2</td></tr><tr><td>I3D + super-events (Piergiovanni &amp; Ryoo, 2018b)</td><td>36.4</td></tr><tr><td>I3D+our TGMs</td><td>44.3</td></tr><tr><td>I3D + super-events (Piergiovanni &amp; Ryoo,2018b) + our TGMs</td><td>46.4</td></tr></table>
188
+
189
+ 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.
190
+
191
+ 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).
192
+
193
+ # 5 CONCLUSIONS
194
+
195
+ 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.
196
+
197
+ # REFERENCES
198
+
199
+ J. K. Aggarwal and M. S. Ryoo. Human activity analysis: A review. ACM Computing Surveys, 43: 16:1–16:43, April 2011.
200
+
201
+ 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.
202
+
203
+ <table><tr><td></td><td>mAP</td></tr><tr><td>Predictive-corrective (Dave et al., 2017) Two-stream (Sigurdsson et al., 2016a) Two-stream+LSTM (Sigurdsson et al., 2016a)</td><td>8.9 8.94 9.6</td></tr><tr><td>R-C3D (Xu et al., 2017) Sigurdsson et al. (Sigurdsson et al., 2016a)</td><td>12.7 12.8</td></tr><tr><td>I3D baseline</td><td>17.2</td></tr><tr><td>I3D + 3 temporal conv.layers (L = 5) I3D + 3 temporal conv. layers (L = 30)</td><td>17.5</td></tr><tr><td>I3D +LSTM</td><td>12.5</td></tr><tr><td>I3D + fixed temporal pyramid</td><td>18.1</td></tr><tr><td></td><td>18.2</td></tr><tr><td>I3D + super-events (Piergiovanni &amp; Ryoo,2018b)</td><td>19.4</td></tr><tr><td>I3D +3 TGMs (L = 5)</td><td></td></tr><tr><td></td><td>20.6</td></tr><tr><td>I3D +3 TGMs (L = 30)</td><td>21.5</td></tr><tr><td>I3D +3 TGMs (L = 5) + super-events</td><td>21.8</td></tr><tr><td>I3D +3 TGMs (L = 3O) + super-events</td><td>22.3</td></tr></table>
204
+
205
+ 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.
206
+
207
+ Achal Dave, Olga Russakovsky, and Deva Ramanan. Predictive-corrective networks for action detection. arXiv preprint arXiv:1704.03615, 2017.
208
+
209
+ 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.
210
+
211
+ 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.
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ 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.
222
+
223
+ 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.
224
+
225
+ 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.
226
+
227
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
228
+
229
+ 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.
230
+
231
+ AJ Piergiovanni and Michael S. Ryoo. Fine-grained activity recognition in baseball videos. In CVPR Workshop on Computer Vision in Sports, 2018a.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ 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.
238
+
239
+ 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.
240
+
241
+ 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.
242
+
243
+ Gunnar A Sigurdsson, Santosh Divvala, Ali Farhadi, and Abhinav Gupta. Asynchronous temporal fields for action recognition. arXiv preprint arXiv:1612.06371, 2016a.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ 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.
258
+
259
+ Gul Varol, Ivan Laptev, and Cordelia Schmid. Long-term Temporal Convolutions for Action Recog- ¨ nition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
260
+ Huijuan Xu, Abir Das, and Kate Saenko. R-c3d: Region convolutional 3d network for temporal activity detection. arXiv preprint arXiv:1703.07814, 2017.
261
+ 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.
262
+ 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.
263
+ 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.
264
+ 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.
265
+
266
+ # A IMPLEMENTATION DETAILS
267
+
268
+ 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).
269
+
270
+ 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.
271
+
272
+ 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.
273
+
274
+ # B HYPERPARAMETER EXPERIMENTS
275
+
276
+ 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.
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ 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.
283
+
284
+ 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.
285
+
286
+ 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$ .
287
+
288
+ <table><tr><td rowspan="2"></td><td colspan="3">MultiTHUMOS</td><td colspan="3">Charades</td></tr><tr><td>1 Layer</td><td>3 Layers</td><td>1-D Conv</td><td>1 Layer</td><td>3 Layers</td><td>1-D Conv</td></tr><tr><td>I3DBaseline</td><td>22.3</td><td>=</td><td>=</td><td>15.3</td><td>=</td><td>=</td></tr><tr><td>L=3</td><td>30.2</td><td>31.7</td><td>26.6</td><td>15.5</td><td>16.1</td><td>15.5</td></tr><tr><td>L=5</td><td>32.5</td><td>37.2</td><td>28.3</td><td>15.7</td><td>17.8</td><td>16.3</td></tr><tr><td>L=10</td><td>34.5</td><td>35.4</td><td>31.7</td><td>16.1</td><td>18.2</td><td>16.6</td></tr><tr><td>L=15</td><td>36.1</td><td>34.1</td><td>32.5</td><td>17.5</td><td>18.6</td><td>16.8</td></tr><tr><td>L=30</td><td>32.5</td><td>33.9</td><td>26.5</td><td>18.1</td><td>18.9</td><td>12.1</td></tr><tr><td>L= 50</td><td>32.1</td><td>33.7</td><td>15.4</td><td>18.3</td><td>18.8</td><td>6.7</td></tr></table>
289
+
290
+ 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$ .
291
+
292
+ <table><tr><td></td><td>MultiTHUMOS</td><td>Charades</td></tr><tr><td>M=2</td><td>27.8</td><td>15.5</td></tr><tr><td>M=4</td><td>33.1</td><td>16.2</td></tr><tr><td>M=8</td><td>34.8</td><td>17.5</td></tr><tr><td>M=16</td><td>36.1</td><td>17.5</td></tr><tr><td>M= 32</td><td>35.7</td><td>17.1</td></tr><tr><td>M= 64</td><td>35.8</td><td>17.3</td></tr></table>
293
+
294
+ 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$ .
295
+
296
+ <table><tr><td></td><td>MultiTHUMOS</td><td>Charades</td></tr><tr><td>Cout 1</td><td>33.5</td><td>16.2</td></tr><tr><td>Cout 4</td><td>34.2</td><td>17.4</td></tr><tr><td>Cout 8</td><td>35.5</td><td>17.5</td></tr><tr><td>Cout 16</td><td>36.1</td><td>17.5</td></tr><tr><td>Cout 32</td><td>36.0</td><td>17.2</td></tr><tr><td>Cout 64</td><td>36.1</td><td>17.4</td></tr><tr><td>Cout = 80</td><td>36.1</td><td>17.5</td></tr></table>
297
+
298
+ 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.
299
+
300
+ ![](images/744a3159af7040ba3ca43621d47d5b12f250bda0c5cfd68bf678d41847d83116.jpg)
301
+ 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.
302
+
303
+ ![](images/b998f17e5d56ec0eab5405aa1323e9b9a726ecf049f10c25969a91979fea53b8.jpg)
304
+ 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.
305
+
306
+ ![](images/1a1a1342d875bc0c72fde175610ed02c50531ca14855a426d92b84f4adcfae2a.jpg)
307
+ 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.
308
+
309
+ # C COMPARISON OF DIFFERENT LAYER FORMS
310
+
311
+ 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.
312
+
313
+ 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.
314
+
315
+ 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.
316
+
317
+ 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.
318
+
319
+ <table><tr><td></td><td>MultiTHUMOS</td></tr><tr><td>Standard 1-D Convolution (Fig. 7a)</td><td>32.5</td></tr><tr><td>The layer described in Fig.7b</td><td>28.6</td></tr><tr><td>The layer described in Fig. 7c</td><td>33.2</td></tr><tr><td>The layer described in Fig. 8</td><td>32.8</td></tr><tr><td>Our TGM Layer</td><td>36.1</td></tr></table>
320
+
321
+ ![](images/99b2898871e544d67d45bf16b97e65b0e77b16df16b200a2ad0c06f579924c1f.jpg)
322
+ 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.
323
+
324
+ # D EXPERIMENTS ON ADDITIONAL DATASETS
325
+
326
+ # D.1 MLB-YOUTUBE DATASET
327
+
328
+ # D.1.1 DATASET
329
+
330
+ 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.
331
+
332
+ 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.
333
+
334
+ # D.1.2 RESULTS
335
+
336
+ 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.
337
+
338
+ 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.
339
+
340
+ Table 10: Result mAP on the MLB-YouTube dataset using InceptionV3 and I3D to obtain features. Our TGM layers significantly outperform the baseline models.
341
+
342
+ <table><tr><td>Model</td><td>Spatial</td><td>Temporal</td><td>Two-stream</td></tr><tr><td>Random</td><td>13.4</td><td>13.4</td><td>13.4</td></tr><tr><td>InceptionV3</td><td>31.2</td><td>31.8</td><td>31.9</td></tr><tr><td>InceptionV3 +LSTM</td><td>32.1</td><td>33.5</td><td>34.1</td></tr><tr><td>InceptionV3 +1 temporal conv</td><td>32.8</td><td>34.4</td><td>35.2</td></tr><tr><td>InceptionV3 + 3 temporal conv</td><td>28.4</td><td>29.8</td><td>30.1</td></tr><tr><td>InceptionV3 + super-events</td><td>31.5</td><td>36.2</td><td>39.6</td></tr><tr><td>InceptionV3 +1TGM</td><td>32.4</td><td>36.3</td><td>37.4</td></tr><tr><td>InceptionV3+3 TGM</td><td>33.2</td><td>38.2</td><td>38.2</td></tr><tr><td>InceptionV3 + 3 TGM+super-events</td><td>34.6</td><td>42.4</td><td>42.9</td></tr><tr><td>I3D</td><td>33.8</td><td>35.1</td><td>34.2</td></tr><tr><td>I3D + LSTM</td><td>36.2</td><td>37.3</td><td>39.4</td></tr><tr><td>I3D +1 temporal conv</td><td>37.3</td><td>38.6</td><td>39.9</td></tr><tr><td>I3D + 3 temporal conv</td><td>32.4</td><td>34.6</td><td>35.6</td></tr><tr><td>I3D + super-events</td><td>38.7</td><td>38.6</td><td>39.1</td></tr><tr><td>I3D+1TGM</td><td>35.5</td><td>37.5</td><td>38.5</td></tr><tr><td>I3D+3 TGM</td><td>36.5</td><td>38.4</td><td>40.1</td></tr><tr><td>I3D +3 TGM+super-events</td><td>39.4</td><td>46.0</td><td>47.1</td></tr></table>
343
+
344
+ Table 11: Results on AVA dataset with the temporal annotation-only setting (i.e., frame classification without using bounding box training labels).
345
+
346
+ <table><tr><td></td><td>mAP</td></tr><tr><td>Random</td><td>2.65</td></tr><tr><td>I3D baseline</td><td>7.5</td></tr><tr><td>I3D + 3 temporal conv. layers</td><td>7.9</td></tr><tr><td>I3D+LSTM</td><td>7.8</td></tr><tr><td>I3D + super-events(Piergiovanni &amp; Ryoo,2018b)</td><td>9.8</td></tr><tr><td>I3D+1TGMs</td><td>11.2</td></tr><tr><td>I3D +3 TGMs</td><td>14.5</td></tr><tr><td>I3D +3 TGMs + super-events</td><td>14.9</td></tr></table>
347
+
348
+ # D.2 AVA
349
+
350
+ # D.2.1 DATASET
351
+
352
+ 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.
353
+
354
+ # D.2.2 RESULTS
355
+
356
+ 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 \%$ .
md/train/HyxhqhVKPB/HyxhqhVKPB.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/I55UqU-M11y/I55UqU-M11y.md ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting
2
+
3
+ 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
4
+
5
+ # Abstract
6
+
7
+ 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.
8
+
9
+ # 1 Introduction
10
+
11
+ 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].
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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:
18
+
19
+ • 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.
20
+
21
+ # 2 Related Work
22
+
23
+ # 2.1 Models for Time Series Forecasting
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ # 2.2 Decomposition of Time Series
30
+
31
+ 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.
32
+
33
+ # 3 Autoformer
34
+
35
+ 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.
36
+
37
+ # 3.1 Decomposition Architecture
38
+
39
+ 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.
40
+
41
+ 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:
42
+
43
+ $$
44
+ \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}
45
+ $$
46
+
47
+ 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.
48
+
49
+ 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:
50
+
51
+ $$
52
+ \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}
53
+ $$
54
+
55
+ ![](images/1ebb1575216e8696f19f85fe903bb441210d41e8973469f64d31b9ac1d64fa43.jpg)
56
+ 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).
57
+
58
+ 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.
59
+
60
+ 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:
61
+
62
+ $$
63
+ \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}
64
+ $$
65
+
66
+ 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.
67
+
68
+ 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:
69
+
70
+ $$
71
+ \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}
72
+ $$
73
+
74
+ 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 }$ .
75
+
76
+ ![](images/611e264868072bea6977edb6f802f5f63a12c602deabbfe382df58f997963cca.jpg)
77
+ 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 )$ .
78
+
79
+ 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.
80
+
81
+ # 3.2 Auto-Correlation Mechanism
82
+
83
+ 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.
84
+
85
+ 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:
86
+
87
+ $$
88
+ \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 } .
89
+ $$
90
+
91
+ $\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.
92
+
93
+ 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.
94
+
95
+ 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:
96
+
97
+ $$
98
+ \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}
99
+ $$
100
+
101
+ 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.
102
+
103
+ ![](images/b3a1dd188e9913684d89e9998ab12a2c0b4d1275bd0f7f003ea51f10541c2ec2.jpg)
104
+ 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.
105
+
106
+ 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:
107
+
108
+ $$
109
+ \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}
110
+ $$
111
+
112
+ 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]:
113
+
114
+ $$
115
+ \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}
116
+ $$
117
+
118
+ 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.
119
+
120
+ 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.
121
+
122
+ # 4 Experiments
123
+
124
+ We extensively evaluate the proposed Autoformer on six real-world benchmarks, covering five mainstream time series forecasting applications: energy, traffic, economics, weather and disease.
125
+
126
+ 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
127
+
128
+ 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.
129
+
130
+ <table><tr><td colspan="2"></td><td colspan="2">Models Autoformer</td><td colspan="2">Informer[41]</td><td colspan="2">LogTrans[20]</td><td colspan="2">Reformer[17]</td><td colspan="2">LSTNet[19]</td><td colspan="2">LSTM[13]</td><td colspan="2">TCN[3]</td></tr><tr><td colspan="2">Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE MAE</td><td></td><td>MSE MAE</td><td></td><td>MSE</td><td>MAE</td></tr><tr><td rowspan="2">T</td><td rowspan="2">96 192 336</td><td rowspan="2">0.255 0.281 0.339</td><td rowspan="2">0.339 0.340</td><td rowspan="2">0.365 0.533</td><td rowspan="2">0.453 0.563</td><td rowspan="2">0.768 0.989</td><td rowspan="2">0.642 0.757</td><td rowspan="2">0.658</td><td rowspan="2">0.619</td><td rowspan="2">3.142 3.154</td><td rowspan="2">1.365 1.369</td><td rowspan="2">2.041 2.249</td><td rowspan="2">1.073 1.112</td><td rowspan="2">3.041 3.072</td><td rowspan="2"></td><td rowspan="2">1.330 1.339</td></tr><tr><td>1.078 0.827 1.549</td></tr><tr><td></td><td>720 96</td><td>0.422 0.201</td><td>0.372 0.419</td><td>1.363 3.379</td><td>0.887 1.388</td><td>3.048</td><td>1.334</td><td>0.872 1.328</td><td>2.631</td><td>0.972 1.242</td><td>3.160 3.171</td><td>1.369 1.368 2.720</td><td>2.568</td><td>1.238 1.287</td><td>3.105 3.135</td><td>1.348 1.354</td></tr><tr><td>erneera</td><td>192 336</td><td>0.222</td><td>0.317 0.334</td><td>0.274 0.296</td><td>0.368 0.386</td><td>0.258 0.266</td><td>0.357 0.368</td><td></td><td>0.312 0.348</td><td>0.402 0.433</td><td>0.680 0.645 0.725</td><td>0.676</td><td>0.375 0.442</td><td>0.437 0.473</td><td>0.985 0.996</td><td>0.813 0.821</td></tr><tr><td></td><td>720</td><td>0.231 0.254</td><td>0.338 0.361</td><td>0.300 0.373</td><td>0.394 0.439</td><td>0.280 0.283</td><td></td><td>0.380 0.376</td><td>0.350 0.340</td><td>0.433 0.420</td><td>0.828 0.957</td><td>0.727 0.811</td><td>0.439 0.980</td><td>0.473 0.814</td><td>1.000 1.438</td><td>0.824 0.784</td></tr><tr><td>uepeg</td><td>96 192</td><td>0.197</td><td>0.323</td><td>0.847</td><td>0.752</td><td>0.968</td><td>0.812</td><td></td><td>1.065</td><td>0.829</td><td>1.551</td><td>1.058 1.453</td><td></td><td>1.049 3.004</td><td></td><td>1.432</td></tr><tr><td></td><td>336</td><td>0.300 0.509</td><td>0.369 0.524</td><td>1.204</td><td>0.895</td><td>1.040</td><td>0.851</td><td></td><td>1.188</td><td>0.906</td><td>1.477</td><td>1.028</td><td>1.846</td><td>1.179</td><td>3.048</td><td>1.444</td></tr><tr><td></td><td>720</td><td>1.447</td><td>0.941</td><td>1.672 2.478</td><td>1.036 1.310</td><td>1.659 1.941</td><td>1.081 1.127</td><td>1.357 1.510</td><td></td><td>0.976 1.016</td><td>1.507 2.285</td><td>1.031 1.243</td><td>2.136 2.984</td><td>1.231</td><td>3.113</td><td>1.459</td></tr><tr><td></td><td>96</td><td>0.613</td><td>0.388</td><td>0.719</td><td>0.391</td><td>0.684</td><td>0.384</td><td>0.732</td><td></td><td>0.423</td><td></td><td></td><td></td><td>1.427</td><td>3.150</td><td>1.458</td></tr><tr><td>[Tjeee</td><td>192</td><td>0.616</td><td>0.382</td><td>0.696</td><td>0.379</td><td>0.685</td><td>0.390</td><td>0.733</td><td>0.420</td><td></td><td>1.107 1.157</td><td>0.685 0.706</td><td>0.843 0.847</td><td>0.453 0.453</td><td>1.438 1.463</td><td>0.784 0.794</td></tr><tr><td></td><td>336 720</td><td>0.622</td><td>0.337</td><td>0.777</td><td>0.420</td><td>0.733</td><td>0.408</td><td>0.742</td><td>0.420</td><td></td><td>1.216</td><td>0.730</td><td>0.853</td><td>0.455</td><td>1.479</td><td>0.799</td></tr><tr><td></td><td></td><td>0.660</td><td>0.408</td><td>0.864</td><td>0.472</td><td>0.717</td><td>0.396</td><td>0.755</td><td></td><td>0.423</td><td>1.481</td><td>0.805</td><td>1.500</td><td>0.805</td><td>1.499</td><td>0.804</td></tr><tr><td>waaeee</td><td>96</td><td>0.266</td><td>0.336</td><td>0.300</td><td>0.384</td><td>0.458</td><td>0.490</td><td>0.689</td><td></td><td>0.596</td><td>0.594</td><td>0.587</td><td>0.369</td><td>0.406</td><td>0.615</td><td>0.589</td></tr><tr><td></td><td>192 336</td><td>0.307</td><td>0.367</td><td>0.598</td><td>0.544</td><td>0.658</td><td>0.589</td><td>0.752</td><td></td><td>0.638</td><td>0.560</td><td>0.565</td><td>0.416</td><td>0.435</td><td>0.629</td><td>0.600</td></tr><tr><td></td><td>720</td><td>0.359</td><td>0.395</td><td>0.578</td><td>0.523</td><td>0.797</td><td>0.652</td><td>0.639</td><td></td><td>0.596</td><td>0.597</td><td>0.587</td><td>0.455</td><td>0.454</td><td>0.639</td><td>0.608</td></tr><tr><td></td><td></td><td>0.419</td><td>0.428</td><td>1.059</td><td>0.741</td><td>0.869</td><td>0.675</td><td>1.130</td><td></td><td>0.792</td><td>0.618</td><td>0.599</td><td>0.535</td><td>0.520</td><td>0.639</td><td>0.610</td></tr><tr><td></td><td>24</td><td>3.483</td><td></td><td>5.764</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>36</td><td></td><td>1.287</td><td></td><td>1.677</td><td>4.480</td><td>1.444</td><td></td><td>4.400</td><td>1.382</td><td>6.026</td><td>1.770</td><td>5.914</td><td>1.734</td><td>6.624</td><td>1.830</td></tr><tr><td>Ⅱ</td><td>48</td><td>3.103</td><td>1.148</td><td>4.755</td><td>1.467</td><td>4.799</td><td>1.467</td><td></td><td>4.783</td><td>1.448</td><td>5.340</td><td>1.668</td><td>6.631</td><td>1.845</td><td>6.858</td><td>1.879</td></tr><tr><td></td><td></td><td>2.669</td><td>1.085</td><td>4.763</td><td>1.469</td><td>4.800</td><td>1.468</td><td></td><td>4.832</td><td>1.465</td><td>6.080</td><td>1.787</td><td>6.736</td><td>1.857</td><td>6.968</td><td></td></tr><tr><td></td><td>60</td><td></td><td>1.125</td><td>5.264</td><td>1.564</td><td>5.278</td><td></td><td>1.560</td><td>4.882</td><td>1.483</td><td>5.548</td><td>1.720 6.870</td><td></td><td>1.879</td><td>7.127</td><td>1.892 1.918</td></tr><tr><td></td><td></td><td>2.770</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></table>
131
+
132
+ \* ETT means the ETTm2. See supplementary materials for the full benchmark of ETTh1, ETTh2, ETTm1.
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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].
139
+
140
+ 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.
141
+
142
+ <table><tr><td colspan="2">Models Autoformer N-BEATS[23] Informer[41] LogTrans[20] Reformer[17] DeepAR[28] Prophet[33] ARIMA[1]</td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td></tr><tr><td colspan="2">Metric1</td><td>MSE MAE MSE</td><td></td><td>MAE</td><td>MSE MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE MAE</td><td></td><td>MSE MAE MSE MAE</td><td></td></tr><tr><td rowspan="4"></td><td>96</td><td>0.065 0.189</td><td>0.082</td><td>0.219</td><td>0.088 0.225</td><td>0.082</td><td>0.217</td><td>0.131</td><td>0.288</td><td>0.099</td><td>0.237</td><td></td><td>0.287 0.456 0.211 0.362</td></tr><tr><td>192</td><td>0.118 0.256 0.120</td><td></td><td>0.268</td><td>0.132 0.283</td><td>0.133</td><td>0.284</td><td>0.186</td><td>0.354</td><td>0.154</td><td>0.310</td><td>0.312 0.483 0.261 0.406</td><td></td></tr><tr><td>336</td><td>0.1540.305 0.226</td><td>0.370</td><td>0.180</td><td></td><td>0.336 0.201</td><td>0.361</td><td>0.220</td><td>0.381</td><td>0.277</td><td>0.428</td><td>0.331 0.474 0.317 0.448</td><td></td></tr><tr><td>720</td><td>0.182 0.335 0.188</td><td></td><td>0.338 0.300</td><td></td><td>0.435 0.268</td><td>0.407</td><td>0.267</td><td>0.430</td><td></td><td></td><td>0.332 0.468 0.5340.593 0.366 0.487</td><td></td></tr><tr><td>aepeg</td><td>96</td><td>0.241 0.387 0.156</td><td>0.299</td><td>0.591(</td><td></td><td>0.615 0.279</td><td>0.441</td><td>1.327</td><td>0.944</td><td></td><td></td><td></td><td>0.417 0.515 0.828 0.762 0.112 0.245</td></tr><tr><td></td><td>192</td><td>0.273 0.403 0.669</td><td>0.665</td><td>1.183</td><td></td><td>0.912 1.950</td><td>1.048</td><td>1.258</td><td>0.924</td><td></td><td></td><td></td><td>0.813 0.735 0.909 0.974 0.304 0.404</td></tr><tr><td></td><td>336</td><td>0.508 0.539 0.611</td><td>0.605</td><td></td><td>1.367 0.984 2.438</td><td></td><td>1.262</td><td>2.179</td><td>1.296</td><td></td><td></td><td></td><td>1.331 0.962 1.304 0.988 0.736 0.598</td></tr><tr><td></td><td>720</td><td>0.991 0.768 1.111</td><td>0.860</td><td>1.872</td><td></td><td>1.072 2.010</td><td>1.247</td><td>1.280</td><td>0.953</td><td></td><td></td><td>1.894 1.181 3.238 1.566 1.871 0.935</td><td></td></tr></table>
143
+
144
+ # 4.1 Main Results
145
+
146
+ 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.
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ # 4.2 Ablation studies
153
+
154
+ 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.
155
+
156
+ <table><tr><td rowspan="2">Input-96</td><td colspan="3">Transformer[35]</td><td colspan="3">Informer[41]</td><td colspan="3">LogTrans[17]</td><td colspan="3">Reformer[20]</td><td colspan="2">Promotion</td></tr><tr><td>Predict-O| Origin</td><td>Sep</td><td>Ours</td><td>Origin</td><td>Sep</td><td>Ours</td><td>Origin</td><td>Sep</td><td>Ours</td><td></td><td>Origin Sep</td><td>Ours</td><td>Sep</td><td>Ours</td></tr><tr><td>96</td><td>0.604</td><td>0.311</td><td>0.204</td><td>0.365</td><td>0.490</td><td>0.354</td><td>0.768</td><td>0.862</td><td>0.231</td><td>0.658</td><td>0.445</td><td>0.218</td><td>0.069</td><td>0.347</td></tr><tr><td>192</td><td></td><td>1.060 0.760(</td><td>0.266</td><td>0.533</td><td>0.658</td><td>0.432</td><td>0.989</td><td>0.533</td><td>0.378</td><td>1.078</td><td></td><td>0.510 0.336</td><td></td><td>0.300 0.562</td></tr><tr><td>336</td><td>1.413</td><td>0.665</td><td>0.375</td><td>1.363</td><td>1.469</td><td>0.481</td><td>1.334</td><td>0.762</td><td>0.362</td><td>1.549</td><td>1.028</td><td>0.366</td><td>0.434</td><td>1.019</td></tr><tr><td>720</td><td>2.672</td><td>3.200</td><td>0.537</td><td>3.379</td><td>2.766</td><td>0.822</td><td>3.048</td><td>2.601</td><td>0.539</td><td>2.631</td><td>2.845</td><td>0.502</td><td></td><td>0.079 2.332</td></tr></table>
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ 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.
163
+
164
+ <table><tr><td rowspan="2" colspan="2">Input Length I Prediction Length O</td><td colspan="3">96</td><td colspan="3">192</td><td colspan="3">336</td></tr><tr><td>336</td><td>720</td><td>1440</td><td>336</td><td>720</td><td>1440</td><td>336</td><td>720</td><td>1440</td></tr><tr><td>Auto- Correlation</td><td>MSE MAE</td><td>0.339 0.372</td><td>0.422 0.419</td><td>0.555 0.496</td><td>0.355 0.392</td><td>0.429 0.430</td><td>0.503 0.484</td><td>0.361 0.406</td><td>0.425 0.440</td><td>0.574 0.534</td></tr><tr><td>Full Attention[35]</td><td>MSE MAE</td><td>0.375 0.425</td><td>0.537 0.502</td><td>0.667 0.589</td><td>0.450 0.470</td><td>0.554 0.533</td><td>- -</td><td>0.501 0.485</td><td>0.647 0.491</td><td>1 =</td></tr><tr><td>LogSparse Attention[20]</td><td>MSE MAE</td><td>0.362 0.413</td><td>0.539 0.522</td><td>0.582 0.529</td><td>0.420 0.450</td><td>0.552 0.513</td><td>0.958 0.736</td><td>0.474 0.474</td><td>0.601 0.524</td><td>- =</td></tr><tr><td>LSH Attention[17]</td><td>MSE MAE</td><td>0.366 0.404</td><td>0.502 0.475</td><td>0.663 0.567</td><td>0.407 0.421</td><td>0.636 0.571</td><td>1.069 0.756</td><td>0.442 0.476</td><td>0.615 0.532</td><td>1 -</td></tr><tr><td>ProbSparse Attention[41]</td><td>MSE MAE</td><td>0.481 0.472</td><td>0.822 0.559</td><td>0.715 0.586</td><td>0.404 0.425</td><td>1.148 0.654</td><td>0.732 0.602</td><td>0.417 0.434</td><td>0.631 0.528</td><td>1.133 0.691</td></tr></table>
165
+
166
+ # 4.3 Model Analysis
167
+
168
+ 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.
169
+
170
+ ![](images/226af42008cf294d2ad17509100d9847b1a2e1adc1ae3b98a6fc44cc7d5195f9.jpg)
171
+ 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.
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ ![](images/1f8ff11071d73f33cde0d525eb867796c34772cd0e34d9f2c2266d99a710dd8f.jpg)
178
+ 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.
179
+
180
+ ![](images/487dd7c7362dd1bad3b32de704db93d0e84eac245cf0c6717299a42cde5d4a6b.jpg)
181
+ 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.
182
+
183
+ 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.
184
+
185
+ ![](images/9945f941aa3e41c082433f9479d4023d07440ec79228f1bcc87357764c332377.jpg)
186
+ 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.
187
+
188
+ # 5 Conclusions
189
+
190
+ 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.
191
+
192
+ # Acknowledgments and Disclosure of Funding
193
+
194
+ 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.
195
+
196
+ # References
197
+
198
+ [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.
199
+ [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.
200
+ [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.
201
+ [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.
202
+ [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.
203
+ [13] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Comput., 1997.
204
+ [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.
205
+ [15] Rob J Hyndman and George Athanasopoulos. Forecasting: principles and practice. 2018.
206
+ [16] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
207
+ [17] Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In ICLR, 2020.
208
+ [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.
209
+ [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.
210
+ [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.
211
+ [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.
212
+ [22] Danielle C Maddix, Yuyang Wang, and Alex Smola. Deep factors with gaussian processes for forecasting. arXiv preprint arXiv:1812.00098, 2018.
213
+ [23] Boris N Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio. N-BEATS: Neural basis expansion analysis for interpretable time series forecasting. ICLR, 2019.
214
+ [24] Athanasios Papoulis and H Saunders. Probability, random variables and stochastic processes. 1989.
215
+ [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.
216
+ [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.
217
+ [27] Cleveland Robert, C William, and Terpenning Irma. STL: A seasonal-trend decomposition procedure based on loess. J. Off. Stat, 1990.
218
+ [28] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. Int. J. Forecast., 2020.
219
+ [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.
220
+ [30] Shun-Yao Shih, Fan-Keng Sun, and Hung-yi Lee. Temporal pattern attention for multivariate time series forecasting. Mach. Learn., 2019.
221
+ [31] Huan Song, Deepta Rajan, Jayaraman Thiagarajan, and Andreas Spanias. Attend and diagnose: Clinical time series analysis using attention models. In AAAI, 2018.
222
+ [32] Antti Sorjamaa, Jin Hao, Nima Reyhani, Yongnan Ji, and Amaury Lendasse. Methodology for long-term prediction of time series. Neurocomputing, 2007.
223
+ [33] Sean J Taylor and Benjamin Letham. Forecasting at scale. Am. Stat., 2018.
224
+ [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.
225
+ [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.
226
+ [36] Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multi-horizon quantile recurrent forecaster. NeurIPS, 2017.
227
+ [37] Norbert Wiener. Generalized harmonic analysis. Acta Math, 1930.
228
+ [38] Sifan Wu, Xi Xiao, Qianggang Ding, Peilin Zhao, Ying Wei, and Junzhou Huang. Adversarial sparse transformer for time series forecasting. In NeurIPS, 2020.
229
+ [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.
230
+ [40] Rose Yu, Stephan Zheng, Anima Anandkumar, and Yisong Yue. Long-term forecasting using tensor-train rnns. arXiv preprint arXiv:1711.00073, 2017.
231
+ [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.
md/train/I6NRcao1w-X/I6NRcao1w-X.md ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ROBUST REINFORCEMENT LEARNING USING ADVERSARIAL POPULATIONS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ 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.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ 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.
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ Our contributions are as follows:
22
+
23
+ • 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.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ 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).
28
+
29
+ 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.
30
+
31
+ 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).
32
+
33
+ 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.
34
+
35
+ # 3 BACKGROUND
36
+
37
+ 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 } )$ .
38
+
39
+ # 3.1 BASELINES
40
+
41
+ Here we outline prior work and the approaches that will be compared with RAP. Our baselines consist of a single adversary and domain randomization.
42
+
43
+ # 3.1.1 SINGLE MINIMAX ADVERSARY
44
+
45
+ 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
46
+
47
+ $$
48
+ \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}
49
+ $$
50
+
51
+ 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.
52
+
53
+ # 3.1.2 DYNAMICS RANDOMIZATION
54
+
55
+ 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
56
+
57
+ $$
58
+ \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}
59
+ $$
60
+
61
+ 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$ .
62
+
63
+ # 4 RAP: ROBUSTNESS VIA ADVERSARY POPULATIONS
64
+
65
+ 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.
66
+
67
+ 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
68
+
69
+ $$
70
+ \cdot
71
+ $$
72
+
73
+ 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.
74
+
75
+ 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.
76
+
77
+ At the end of a training iteration, we update all our policies using gradient descent. The algorithm is summarized below:
78
+
79
+ Initialize $\theta , \phi _ { 1 } \cdots \phi _ { n }$ using Xavier initialization (Glorot & Bengio, 2010);
80
+ 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 }$ ;
81
+ end
82
+
83
+ # 5 EXPERIMENTS
84
+
85
+ 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:
86
+
87
+ H1. Agents are more likely to overfit to a single adversary than a population of adversaries, leaving them less robust on in-distribution tasks.
88
+ H2. Agents trained against a population of adversaries will generalize better, leading to improved performance on out-of-distribution tasks.
89
+
90
+ 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.
91
+
92
+ # 5.1 EXPERIMENTAL SETUP AND HYPERPARAMETER SELECTION
93
+
94
+ 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.
95
+
96
+ 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.
97
+
98
+ 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.
99
+
100
+ ![](images/b494ff0afc0a87678660ef4893645f71f8a360ad511ce83c8fafe9afd752c6c9.jpg)
101
+ Figure 1: From left to right, the Hopper, Half-Cheetah, and Ant environments we use to test our algorithm.
102
+
103
+ 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.
104
+
105
+ # 6 RESULTS
106
+
107
+ # H1. In-Distribution Tasks: Analysis of Overfitting
108
+
109
+ 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.
110
+
111
+ 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.
112
+
113
+ # H2. Out-of-Distribution Tasks: Robustness and Generalization of Population Training
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ ![](images/c96b3e081478b5903c6ee5742f75eae03ef9bbd7b6d16b82b853e46086c0a4fe.jpg)
120
+ 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.
121
+
122
+ 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
123
+
124
+ ![](images/b8d6b0e6efa073cd552745d8cc34bbeee4f1b9b69edea0045c35dcc5c43cb940.jpg)
125
+ 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.
126
+
127
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=5>Validation</td><td rowspan=1 colspan=5>Test</td></tr><tr><td rowspan=1 colspan=1>Ant</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1 Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td></tr><tr><td rowspan=1 colspan=1>Mean Rew.% Change</td><td rowspan=1 colspan=1>6336</td><td rowspan=1 colspan=1>67436.4</td><td rowspan=1 colspan=1>63490.2</td><td rowspan=1 colspan=1>64321.5</td><td rowspan=1 colspan=1>64381.6</td><td rowspan=1 colspan=1>2908</td><td rowspan=1 colspan=1>361324.3</td><td rowspan=1 colspan=1>320610.2</td><td rowspan=1 colspan=1>327212.5</td><td rowspan=1 colspan=1>320310.2</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=5>Validation</td><td rowspan=1 colspan=5>Test</td></tr><tr><td rowspan=1 colspan=1>Hopper</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1 Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1 Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td></tr><tr><td rowspan=1 colspan=1>Mean Rew.% Change</td><td rowspan=1 colspan=1>1182</td><td rowspan=1 colspan=1>2662125</td><td rowspan=1 colspan=1>1094-7.4</td><td rowspan=1 colspan=1>203972.6</td><td rowspan=1 colspan=1>202171</td><td rowspan=1 colspan=1>472</td><td rowspan=1 colspan=1>1636246</td><td rowspan=1 colspan=1>91393.4</td><td rowspan=1 colspan=1>1598238</td><td rowspan=1 colspan=1>1565231</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>Validation</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=5>Test</td></tr><tr><td rowspan=1 colspan=1>Cheetah</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1 Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td><td rowspan=1 colspan=1>0 Adv</td><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>1 Adv</td><td rowspan=1 colspan=1>3 Adv</td><td rowspan=1 colspan=1>5 Adv</td></tr><tr><td rowspan=1 colspan=1>Mean Rew.% Change</td><td rowspan=1 colspan=1>5659</td><td rowspan=1 colspan=1>3864-32</td><td rowspan=1 colspan=1>5593-1.2</td><td rowspan=1 colspan=1>59124.5</td><td rowspan=1 colspan=1>632311.7</td><td rowspan=1 colspan=1>5592</td><td rowspan=1 colspan=1>3656-35</td><td rowspan=1 colspan=1>56641.3</td><td rowspan=1 colspan=1>60468.1</td><td rowspan=1 colspan=1>640614.6</td></tr></table>
128
+
129
+ 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.
130
+
131
+ validation set. This supports our hypothesis that a single adversary can actually lower the robustness of an agent.
132
+
133
+ # 7 CONCLUSIONS AND FUTURE WORK
134
+
135
+ 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.
136
+
137
+ 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?
138
+
139
+ ![](images/1d84bcf8c92d842243bff8a6f126f55153d7999c585ffce98b27de99a3f315e4.jpg)
140
+ 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.
141
+
142
+ 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.
143
+
144
+ # REFERENCES
145
+
146
+ Rika Antonova, Silvia Cruciani, Christian Smith, and Danica Kragic. Reinforcement learning for pivoting task. arXiv preprint arXiv:1703.00472, 2017.
147
+
148
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
149
+
150
+ Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456): 885–890, 2019.
151
+
152
+ 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.
153
+
154
+ 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.
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ Bhairav Mehta, Manfred Diaz, Florian Golemo, Christopher J Pal, and Liam Paull. Active domain randomization. arXiv preprint arXiv:1904.04762, 2019.
163
+
164
+ 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.
165
+
166
+ Arnab Nilim and Laurent El Ghaoui. Robust control of markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798, 2005.
167
+
168
+ 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.
169
+
170
+ 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.
171
+
172
+ Martin L Puterman. Markov decision processes. Handbooks in operations research and management science, 2:331–434, 1990.
173
+
174
+ Aravind Rajeswaran, Sarvjeet Ghotra, Balaraman Ravindran, and Sergey Levine. Epopt: Learning robust neural network policies using model ensembles. arXiv preprint arXiv:1610.01283, 2016.
175
+
176
+ Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. arXiv preprint arXiv:1611.04201, 2016.
177
+
178
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
179
+
180
+ Aviv Tamar, Shie Mannor, and Huan Xu. Scaling up robust mdps using function approximation. In International Conference on Machine Learning, pp. 181–189, 2014.
181
+
182
+ 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.
183
+
184
+ Chen Tessler, Yonathan Efroni, and Shie Mannor. Action robust reinforcement learning and applications in continuous control. arXiv preprint arXiv:1901.09184, 2019.
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ 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.
191
+
192
+ Kemin Zhou and John Comstock Doyle. Essentials of robust control, volume 104. Prentice hall Upper Saddle River, NJ, 1998.
193
+
194
+ # A FULL DESCRIPTION OF THE CONTINUOUS CONTROL MDPS
195
+
196
+ 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
197
+
198
+ $$
199
+ s _ { k + 1 } = s _ { k } + f ( s _ { k } , a _ { k } ) \Delta t
200
+ $$
201
+
202
+ the system dynamics under the adversary are
203
+
204
+ $$
205
+ s _ { k + 1 } = s _ { k } + f ( s _ { k } , a _ { k } + a _ { k } ^ { \mathrm { a d v } } ) \Delta t
206
+ $$
207
+
208
+ where $a _ { k } ^ { \mathrm { a d v } }$ is the adversary action at time $\mathbf { k }$
209
+
210
+ 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 ]$ .
211
+
212
+ The MDP through which we train the agent policy is characterized by the following states, actions, and rewards:
213
+
214
+ $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.
215
+ 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.
216
+ • $a _ { t } ^ { \mathrm { { a g e n t } } } \in [ a _ { \operatorname* { m i n } } , a _ { \operatorname* { m a x } } ] ^ { n } .$
217
+
218
+ The MDP for adversary $i$ is the following:
219
+
220
+ • 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 } .$
221
+
222
+ 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].
223
+
224
+ ![](images/5cd1da6df69e9225fe80e79a6c24582fcadaed14ae55d52a0794e39e182a76bf.jpg)
225
+ Figure 5: Average reward for Hopper across varying adversary number.
226
+
227
+ # B INCREASING ADVERSARY POOL SIZE
228
+
229
+ 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.
230
+
231
+ ![](images/2b6de1d61200577190acbce8d0f96638451a60257d0c7994ae5d91b9ac0d29f6.jpg)
232
+ 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.
233
+
234
+ # C HOLDOUT TESTS
235
+
236
+ In this section we describe in detail all of the holdout tests used.
237
+
238
+ ![](images/605f064acbf9c68e211b615e6c737becefbfb0068c3648433e24bda6d93bfae9.jpg)
239
+ Figure 7: Labelled Body Segments of Hopper Table 2: Hopper Holdout Test Descriptions
240
+
241
+ <table><tr><td>Test</td><td>Body with Friction Coeff 1.3</td><td>Body with Friction Coeff 0.7</td></tr><tr><td>A</td><td>Torso,Leg</td><td>Floor, Thigh,Foot</td></tr><tr><td>B</td><td>Floor, Thigh</td><td>Torso,Leg,Foot</td></tr><tr><td>C</td><td>Foot,Leg</td><td>Floor, Torso, Thigh</td></tr><tr><td>D</td><td>Torso,Thigh,Floor</td><td>Foot,Leg</td></tr><tr><td>E</td><td>Torso,Foot</td><td>Floor, Thigh,Leg</td></tr><tr><td>F</td><td>Floor, Thigh,Leg</td><td>Torso,Foot</td></tr><tr><td>G</td><td>Floor, Foot</td><td>Torso, Thigh,Leg</td></tr><tr><td>H</td><td>Thigh,Leg</td><td>Floor, Torso,Foot</td></tr></table>
242
+
243
+ # C.1 HOPPER
244
+
245
+ 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.
246
+
247
+ The exact combinations and the corresponding test name are indicated in Table 2 for Hopper.
248
+
249
+ # C.2 CHEETAH
250
+
251
+ 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
252
+
253
+ ![](images/5abdb47e4a61c933625a47906afaeff5f7fe5e303e78cc6764643c2582e6fc57.jpg)
254
+ Figure 8: Labelled Body Segments of Cheetah
255
+
256
+ 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
257
+
258
+ <table><tr><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>Geom with Friction Coeff 0.9</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=6 colspan=1>Torso,Head,FthighFloor,Head,FshinBthigh,Bshin,BfootFloor, Torso,HeadFloor,Bshin,FfootBthigh,Bfoot,Ffoot</td></tr><tr><td rowspan=1 colspan=1>B</td></tr><tr><td rowspan=1 colspan=1>C</td></tr><tr><td rowspan=1 colspan=1>D</td><td rowspan=1 colspan=1>Floor, Torso,Head</td></tr><tr><td rowspan=1 colspan=1>E</td><td rowspan=1 colspan=1>Floor,Bshin,Ffoot</td></tr><tr><td rowspan=1 colspan=1>F</td></tr><tr><td rowspan=1 colspan=1>G</td><td rowspan=1 colspan=1>Bthigh,Fthigh,Fshin</td></tr><tr><td rowspan=1 colspan=1>H</td><td rowspan=1 colspan=1>Head,Fshin,Ffoot</td></tr></table>
259
+
260
+ ![](images/36982b9c4d7582f019aad9a49a156d939d5e9e0b25126dee03e2d775d2099388.jpg)
261
+ Figure 9: Labelled Body Segments of Ant
262
+
263
+ 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.
264
+
265
+ The exact combinations and the corresponding test name are indicated in Table 4 for Hopper.
266
+
267
+ # C.3 ANT
268
+
269
+ 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.
270
+
271
+ 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
272
+
273
+ <table><tr><td>Test</td><td>GeomwithFriction Coeff 0.9</td></tr><tr><td>A B C D</td><td>Front-Leg-Left,Aux-Front-Left,Aux-Back-Left Torso,Aux-Front-Left,Back-Leg-Right Front-Leg-Right, Aux-Front-Right,Back-Leg-Left</td></tr><tr><td>E F</td><td>Torso,Front-Leg-Left,Aux-Front-Left Front-Leg-Left, Aux-Front-Right, Aux-Back-Right Front-Leg-Right, Back-Leg-Left,Aux-Back-Right</td></tr><tr><td>G H</td><td>Front-Leg-Left,Aux-Back-Left,Back-Leg-Right Aux-Front-Left,Back-Leg-Right,Aux-Back-Right</td></tr></table>
274
+
275
+ Table 5: Results on holdout tests for each of the tested approaches for Hopper. Bolded values have the highest mean
276
+
277
+ <table><tr><td>Test Name</td><td>0 Adv</td><td>1 Adv</td><td>3 Adv</td><td>Five Adv</td><td>Domain Rand</td></tr><tr><td>Test A</td><td>410±140</td><td>1170 ± 570</td><td>2210±630</td><td>2090±920</td><td>1610±310</td></tr><tr><td>Test B</td><td>430 ± 150</td><td>1160 ± 540</td><td>2240 ± 730</td><td>2200 ± 880</td><td>1610 ± 290</td></tr><tr><td>Test C</td><td>560 ±120</td><td>490 ± 150</td><td>610± 250</td><td>580 ±120</td><td>1660 ± 260</td></tr><tr><td>Test D</td><td>420 ±150</td><td>1140 ± 560</td><td>2220 ±680</td><td>2130 ± 890</td><td>1612 ± 360</td></tr><tr><td>TestE</td><td>550 ±120</td><td>500 ± 150</td><td>600 ± 240</td><td>590 ±120</td><td>1680 ± 280</td></tr><tr><td>Test F</td><td>420 ±150</td><td>1200 ± 620</td><td>2080 ± 750</td><td>2160 ± 890</td><td>1650 ± 360</td></tr><tr><td>Test H</td><td>560 ± 130</td><td>500 ±140</td><td>600 ± 230</td><td>600 ±140</td><td>1710 ± 370</td></tr><tr><td>Test G</td><td>420 ±150</td><td>1160 ± 590</td><td>2210 ±680</td><td>2160 ± 920</td><td>1560 ± 340</td></tr></table>
278
+
279
+ <table><tr><td>Test Name</td><td>0 Adv</td><td>1 Adv</td><td>3 Adv</td><td>Five Adv</td><td>Domain Rand</td></tr><tr><td>Test A</td><td>4400±2160</td><td>5110± 730</td><td>4960±1280</td><td>5560±1060</td><td>2800±1540</td></tr><tr><td>Test B</td><td>6020 ± 880</td><td>5980 ± 290</td><td>6440 ± 1620</td><td>6880±1090</td><td>3340 ± 600</td></tr><tr><td>Test C</td><td>5880 ± 1030</td><td>5730 ± 640</td><td>6740±1190</td><td>6410 ± 790</td><td>4280± 240</td></tr><tr><td>Test D</td><td>5990 ± 940</td><td>5960 ± 260</td><td>6430 ± 1610</td><td>6880±1090</td><td>3360 ± 570</td></tr><tr><td>TestE</td><td>5570± 570</td><td>5670 ± 290</td><td>5800 ± 1316</td><td>6530±1250</td><td>3720 ± 540</td></tr><tr><td>TestF</td><td>5870± 750</td><td>5800 ± 350</td><td>6500 ± 1100</td><td>6770±1070</td><td>3810 ± 330</td></tr><tr><td>Test H</td><td>5310 ± 1060</td><td>5270 ± 700</td><td>5610 ± 720</td><td>5660 ± 980</td><td>4560 ± 560</td></tr><tr><td>Test G</td><td>5710 ± 650</td><td>5790 ± 300</td><td>5890 ± 1240</td><td>6560±1240</td><td>3380 ± 720</td></tr></table>
280
+
281
+ Table 6: Results on holdout tests for each of the tested approaches for Half Cheetah. Bolded values have the highest mean
282
+
283
+ The exact combinations and the corresponding test name are indicated in Table 4 for Hopper.
284
+
285
+ # D RESULTS
286
+
287
+ Here we recompute the values of all the results and display them with appropriate standard deviations in tabular form.
288
+
289
+ There was not space for the ant validation set results so they are reproduced here.
290
+
291
+ <table><tr><td>Test Name</td><td>0 Adv</td><td>1 Adv</td><td>3 Adv</td><td>Five Adv</td><td>Domain Rand</td></tr><tr><td>Test A</td><td>590± 650</td><td>730± 630</td><td>600±440</td><td>560± 580</td><td>900±580</td></tr><tr><td>Test B</td><td>5240 ± 280</td><td>5530 ± 200</td><td>5770 ± 100</td><td>5710 ±180</td><td>6150 ±180</td></tr><tr><td>Test C</td><td>750± 820</td><td>1090 ± 660</td><td>1160 ± 540</td><td>1040 ± 760</td><td>1370 ± 800</td></tr><tr><td>Test D</td><td>5220 ± 300</td><td>5560 ± 220</td><td>5770 ± 90</td><td>5660 ± 190</td><td>6120 ±180</td></tr><tr><td>TestE</td><td>5270± 290</td><td>5570 ± 210</td><td>5770±100</td><td>5660± 220</td><td>6140 ±150</td></tr><tr><td>TestF</td><td>780 ±860</td><td>1160 ± 570</td><td>1120 ± 580</td><td>1140 ± 870</td><td>1390 ± 750</td></tr><tr><td>Test H</td><td>130 ± 290</td><td>420 ± 300</td><td>210 ± 220</td><td>160 ± 270</td><td>700 ± 560</td></tr><tr><td>Test G</td><td>5290± 280</td><td>5560 ± 220</td><td>5770 ±100</td><td>5700 ± 190</td><td>6150 ±160</td></tr></table>
292
+
293
+ Table 7: Results on holdout tests for each of the tested approaches for Ant. Bolded values have the highest mean
294
+
295
+ ![](images/93aba988bfcf02e081e4bfb58ca181b5da25988c41f8aa7a646b3f519db5b5c1.jpg)
296
+ Figure 10: Ant Heatmap: Average reward across 10 seeds on each validation set (mass, friction) parametrization.
297
+
298
+ # E CHALLENGES OF DOMAIN RANDOMIZATION
299
+
300
+ 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.
301
+
302
+ # Effect of Domain Randomization Parametrization
303
+
304
+ 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.
305
+
306
+ 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.
307
+
308
+ # Alternative DR policy architecture
309
+
310
+ 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.
311
+
312
+ ![](images/2f1466b54cca32e75f2c948eed73043d00c81b16f9d9b66ac593ede7c721b0c6.jpg)
313
+ 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.
314
+
315
+ ![](images/1fa1062e557af107893e21857ca71a2f5d7e1bad3d8dc6f58531dbab9efe0af1.jpg)
316
+ 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.
317
+
318
+ # F ADDITIONAL EXPERIMENTS
319
+
320
+ Here we outline a few more experiments we ran that demonstrate the value of additional adversaries. We run the following tasks:
321
+
322
+ # F.1 DEEPMIND CONTROL CATCH
323
+
324
+ 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.
325
+
326
+ ![](images/a8e5c4561daeb917f6e01096b4089b4c897d463f6833626f2061f4df4636da14.jpg)
327
+ Figure 13: The DeepMind Control catch task. The cup moves around and attempts to get the ball to fall inside.
328
+
329
+ ![](images/7c402a3092d0eab85f3b65d86519a11163a99cdd8467dfa1e78a0f709a9b4b44.jpg)
330
+ 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.
331
+
332
+ # F.2 MULTI-ARMED BERNOULLI BANDITS
333
+
334
+ 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
335
+
336
+ 1. The goal of the agent is to minimize total cumulative regret $R _ { n }$ over a horizon of $n$ steps:
337
+
338
+ $$
339
+ R _ { n } = n \operatorname* { m a x } _ { i } \mu _ { i } - \mathbb { E } \left[ \sum _ { t = 0 } ^ { n } a _ { t } \right]
340
+ $$
341
+
342
+ 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:
343
+
344
+ $$
345
+ \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}
346
+ $$
347
+
348
+ 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.
349
+
350
+ $$
351
+ \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}
352
+ $$
353
+
354
+ 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.
355
+
356
+ 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.
357
+
358
+ # G COST AND HYPERPARAMETERS
359
+
360
+ 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.
361
+
362
+ # G.1 HYPERPARAMETERS
363
+
364
+ For Mujoco the hyperparameters are:
365
+
366
+ • Learning rate:
367
+
368
+ ![](images/10c84f08a455e0438147360746f5db876a7b38a5bd0dc152fb9959898e8e7f21.jpg)
369
+ 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.
370
+
371
+ – $- \ \{ . 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.
372
+
373
+ 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
374
+
375
+ # G.2 COST
376
+
377
+ 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.
378
+
379
+ • 0 adversaries
380
+ • 1 adversary
381
+ • 3 adversaries
382
+ • 5 adversaries
383
+ • Domain randomization
384
+
385
+ 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$
386
+
387
+ ![](images/51784079b613fc70140ca432558c816b83581d3fff49c302e361b4ae698adc77.jpg)
388
+ 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.
389
+
390
+ 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.
391
+
392
+ # G.3 RUN TIME AND SAMPLE COMPLEXITY
393
+
394
+ 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.
395
+
396
+ # G.4 CODE
397
+
398
+ 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.
399
+
400
+ # H PURE NASH EQUILIBRIA DO NOT NECESSARILY EXIST
401
+
402
+ 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.
403
+
404
+ ![](images/76db3eab1b17aa1cf53f71a7a86b4799a3cb4c6122af7d4b17aaedda341e44ed.jpg)
405
+ 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.
md/train/IQgbmaoDDjd/IQgbmaoDDjd.md ADDED
@@ -0,0 +1,455 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Cooperative Multi-Agent Reinforcement Learning with Sequential Credit Assignment
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 Centralized training with decentralized execution is a standard paradigm for coop
11
+ 2 erative multi-agent reinforcement learning (MARL), with credit assignment being
12
+ 3 a major challenge. In this paper, we propose a cooperative MARL method with
13
+ 4 sequential credit assignment (SeCA) that deduces each agent’s contribution to the
14
+ 5 team’s success one by one to learn better cooperation. We first present a sequential
15
+ 6 MARL framework, under which we introduce a new counterfactual advantage to
16
+ 7 evaluate each agent based on its preceding agents’ actions in a specific sequence.
17
+ 8 As this credit assignment sequence tremendously impacts the performance, we
18
+ 9 further present a sequence adjustment algorithm utilizing integrated gradients. It
19
+ 10 dynamically modifies the sequence among agents according to their contribution
20
+ 11 to the team. SeCA employs a network which either estimates the Q value for
21
+ 12 training the centralized critic or deduces the proposed advantage of each agent for
22
+ 13 decentralized policy learning. Our method is evaluated on a challenging set of
23
+ 14 StarCraft II micromanagement tasks and achieves state-of-the-art performance.
24
+
25
+ # 15 1 Introduction
26
+
27
+ 16 Cooperative multi-agent reinforcement learning (MARL) is a helpful tool in numerous applications
28
+ 17 such as robot swarm control [9], autonomous vehicle coordination [3], network routing [36], and
29
+ 18 productivity optimization [37]. This kind of problem where agents learn coordinated policies to
30
+ 19 optimize the global reward has been extensively studied in recent years [7, 19, 18, 38, 8].
31
+ 20 One natural way of addressing the cooperative MARL problem is the centralized approach, which
32
+ 21 treats the team as a single actor with a joint action space. Although we can trivially apply single-agent
33
+ 22 reinforcement learning algorithms to such settings, it usually does not scale well because the size of
34
+ 23 the joint action space grows exponentially with the number of agents. Besides, it is not applicable
35
+ 24 in real-world settings due to the inherent constraints on agent observability and communication.
36
+ 25 An alternative approach is to learn decentralized policies by independently training agents based
37
+ 26 on their local observations, but simultaneous exploration often brings non-stationarity that causes
38
+ 27 unstable learning and difficulties in convergence. As a result, the majority of work on MARL
39
+ 28 follows the centralized training with decentralized execution (CTDE) paradigm [17, 10, 22, 6], where
40
+ 29 decentralized policies can access extra state information during training.
41
+ 30 A crucial challenge of the CTDE paradigm in cooperative settings is to correctly deduce each agent’s
42
+ 31 contribution to the team’s success, also known as the multi-agent credit assignment problem [4].
43
+ 32 Existing methods can be classified as implicit and explicit credit assignment [39]. Previous implicit
44
+ 33 methods often deduce all agents’ contributions by representing the global state-action value as an
45
+ 34 aggregation of each agent’s state-action value [26, 22, 12, 24, 21, 29] and assigning the shared rewards
46
+ 35 to each agent according to the joint action at one time. In this way, these methods avoid the complex
47
+ 36 interaction analysis and instead fit these cooperation relationships by neural networks. However,
48
+ 37 implicit methods often face limitations in expressiveness, and their extensions to continuous action
49
+ 38 spaces may require additional strategies [39].
50
+ 39 On the other hand, recognized explicit approaches calculate difference rewards [34] against a certain
51
+ 40 reward baseline [28, 20, 6]. However, in cooperative MARL, evaluating any agent’s action requires
52
+ 41 considering the actions of all agents, so it is often difficult to determine the impact a particular agent’s
53
+ 42 behavior has on the team when we have not assessed other agents’ actions. In other words, we can
54
+ 43 not say that a single agent’s action is bad if the team receives a small reward because the shared
55
+ 44 reward is not decided only by this agent’s behavior. Maybe its action is actually good in that state.
56
+ 45 This paper presents a sequential credit assignment SeCA to evaluate individual agent actions explicitly
57
+ 46 and sequentially. Our motivation is to address the drawbacks of implicit methods that neglect the
58
+ 47 cooperation between agents or simply leave it to neural networks and further improve explicit credit
59
+ 48 assignment. In summary, we face two main challenges to learn a better explicit credit assignment: (1)
60
+ 49 how to alleviate the problem that it is hard to accurately deduce the contribution of one agent without
61
+ 50 previously assessing all the others’ action, and (2) how to evaluate agents better in an explicit way.
62
+ 51 To deal with (1), we introduce a sequential MARL framework. As mentioned above, without assessing
63
+ 52 the behaviors of other agents, we would never be able to evaluate a given agent’s action accurately.
64
+ 53 However, we point out in this paper that some agents are less affected by such influences than others,
65
+ 54 and we can first assign credit to them. For instance, evaluating a staff’s action needs to take the
66
+ 55 CEO’s command or action into consideration, while the former has little importance in assessing the
67
+ 56 CEO. Thus, we could evaluate the CEO first without considering the staff’s behavior and then analyze
68
+ 57 the staff based on the CEO’s action. We fully consider the action coordination between agents and
69
+ 58 explicitly deduce contribution to them one by one according to a particular order, so as to make up
70
+ 59 for the disadvantage of implicit methods that the cooperation is only inexplicably fitted by neural
71
+ 60 networks. Intuitively, the order significantly impacts the overall performance, so we further propose
72
+ 61 an algorithm to adjust the sequence dynamically through integrated gradients [25].
73
+ 62 As for (2), we compute an advantage function for each agent to attribute agent contributions explicitly.
74
+ 63 COMA [6] is a representative method that computes a baseline for each agent to reason about
75
+ 64 counterfactuals in which only one agent $a$ ’s action changes, so its evaluation of $a$ ’s action is based on
76
+ 65 the joint action $\mathbf { u } ^ { - a }$ of other agents. In other words, the policy gradient of COMA only encourages
77
+ 66 agent $a$ to learn in the direction that benefits the team while other agents are acting $\mathbf { u } ^ { - a }$ , but the
78
+ 67 others’ actions are not necessarily $\mathbf { u } ^ { - a }$ when executing. Unlike COMA, we focus more on the action
79
+ 68 coordination among agents and propose a new advantage under the proposed sequential framework.
80
+ 69 We summarize the contributions of this paper as follows: (1) We propose a sequential MARL
81
+ 70 framework in Section 3.2; (2) Under this framework, we introduce a sequential advantage function
82
+ 71 for each agent to guide their learning explicitly in Section 3.3. We further prove that the sequential
83
+ 72 credit assignment we proposed achieves additive advantage-decomposition. (3) We present a sequence
84
+ 73 adjustment algorithm based on integrated gradients to modify the credit assignment order dynamically
85
+ 74 in Section 3.4. This algorithm alleviates the impact caused by the sequence’s randomness and helps
86
+ 75 achieve competitive performance on a challenging set of StarCraft II micromanagement tasks [23].
87
+
88
+ # 76 2 Related Work
89
+
90
+ 77 Explicit credit assignment gives valuable insights into agent actions’ contributions to the shared
91
+ 78 team reward and substantially promotes policy optimization. The representative method COMA [6]
92
+ 79 utilizes a counterfactual baseline that marginalizes out a single agent’s action while keeping the other
93
+ 80 agents’ actions fixed to calculate the advantage function. However, the advantage evaluates a single
94
+ 81 agent’s action based on the other agents’ current behaviors and ignores different action combinations.
95
+ 82 SQDDPG [30] distributes the global reward reflecting each agent’s contribution through Shapley
96
+ 83 Value. Although SQDDPG provides a theoretically justified framework, its assumption on the
97
+ 84 observability and convex game makes it impractical and performs poorly in complex environments.
98
+ 85 Implicit methods are a more common way when addressing the credit assignment challenge. Among
99
+ 86 them, LICA [39] is a policy-based method, which learns an end-to-end differentiable optimization
100
+ 87 where it trains a hypernetwork that maps the state into a set of weights which, in turn, maps the
101
+ 88 action policies into the Q estimate. On the other hand, value-based methods often represent the
102
+ 89 global state-action value as an aggregation of the individual values. The value decomposition is linear
103
+ 90 in the earlier work VDN [26], and it ignores the state information. QMIX [22] learns a non-linear
104
+ 91 mixing network with the global state and maps the individual state-action values into the joint Q value
105
+ 92 estimate. Although QMIX performs well in various environments, it still faces the mixing network’s
106
+ 93 monotonicity constraint limitation. QTRAN [24] further avoids the representation limitations by
107
+ 94 using linear constraints between individual utilities and the global state-action value. It guarantees
108
+ 95 optimal decentralization, but its constraints are computationally intractable, and the relaxations often
109
+ 96 lead to unsatisfied performance. QPLEX [29] decomposes Q values following the dueling structure,
110
+ 97 transferring the monotonicity condition from Q values to advantage values. QPD [35] leverages the
111
+ 98 integrated gradient attribution technique to decompose global Q values along trajectory paths based
112
+ 99 on the assumption that an agent’s local reward is linearly correlated with its contribution to the team.
113
+
114
+ # 3 Methods
115
+
116
+ # 3.1 Preliminaries
117
+
118
+ 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$ .
119
+
120
+ 112 Integrated Gradients. Many works aim to attribute the predictions of deep networks to their input
121
+ 113 features [1, 15, 2]. As one of them, integrated gradients [25] aggregates the gradients along the inputs
122
+ 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
123
+ 115 much one feature affects the deep network output $F$ while changing from $F ( \vec { b } )$ to $F ( \vec { x } )$ along a
124
+ 116 path between $\vec { b }$ and $\vec { x }$ . Given a path function $\tau ( \alpha )$ with $\alpha \in [ 0 , 1 ]$ specifying a path from baseline
125
+ 117 $\tau ( 0 ) = \vec { b }$ to the input $\tau ( 1 ) = \vec { x }$ , then integrated gradients along the $j ^ { t h }$ dimension is acquired by:
126
+
127
+ $$
128
+ 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 ,
129
+ $$
130
+
131
+ 118 where $c _ { j }$ represents $x _ { j }$ ’s contribution to the difference between baseline prediction $F ( \vec { b } )$ and $F ( \vec { x } )$ .
132
+ 119 In this work, we leverage the integrated gradients technique to dynamically adjust the order of our
133
+ 120 proposed sequential credit assignment according to each agent’s contribution to the team.
134
+
135
+ # 3.2 Sequential MARL Framework
136
+
137
+ 122 The relationship in a multi-agent system is complicated, as every agent makes decisions based on
138
+ 123 the environment interfered with by the other agents. If we model each agent as a node and model
139
+ 124 the cooperations between them as edges, the cooperative relationship will be built as a complicated
140
+ 125 web-like graph shown in Figure 1(a). Evaluating the actions of any agent should take into account
141
+ 126 the behaviors of other agents in this situation. It is hard to judge whether an agent’s current action is
142
+ 127 beneficial to the team when we have not evaluated other agents’ actions. If we cannot determine an
143
+ 128 analysis order, we can only analyze all the agents implicitly as most existing methods did, and the
144
+ 129 cooperation is often fitted only by deep neural networks, leading to unsatisfactory results.
145
+ 130 This section presents a sequential framework for cooperative MARL, which aims to analyze agents’
146
+ 131 actions one by one. Our key assumption is that evaluations of some agents in a team are less affected
147
+ 132 than others. Thus we can study these less-affected agents first and then analyze the others based on
148
+ 133 the actions of these already-studied agents. For instance, when evaluating a staff’s action, the CEO’s
149
+ 134 decision plays a vital role because we have to judge whether the staff obeys the command or not. On
150
+ 135 the contrary, the staff intuitively has little impact on evaluating the CEO’s decision. In assessing the
151
+ 136 CEO, we often consider external factors such as market situation, modeled as state $s$ in MARL.
152
+ 137 We introduce a variable $\mathcal { O } _ { i }$ to help model this sequential MARL framework. This additional variable
153
+ 138 represents a random event that our cooperation study (e.g., credit assignment) on agent $a _ { i }$ is optimal or
154
+ 139 precise. Then the probability $p ( \mathcal { O } _ { i } )$ denotes the accuracy of our research on agent $a _ { i }$ . For illustration
155
+ 140 and understanding convenience, we discuss a simple multi-agent system with three agents as an
156
+ 141 example, in which agents are identified by $a _ { i } ( i \in \mathsf { \bar { \{ 1 , 2 , 3 \} } } )$ . In original MARL, the evaluation of
157
+ 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
158
+ 143 dependent, as shown in Figure 1(b). We calculate the probability of studying the system accurately
159
+ 144 by computing conditional probabilities:
160
+
161
+ ![](images/c855a712f9bbbfe89c2550cc1247e89d58da7b449b5632a9d8b3b4879f2e6264.jpg)
162
+ 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.
163
+
164
+ $$
165
+ \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}
166
+ $$
167
+
168
+ 145 where $p ( \mathcal { O } _ { j } | \mathcal { O } _ { i } )$ denotes the probability of agent $a _ { j }$ ’s accurate analysis under the condition of
169
+ 146 conducting a precise study on agent $a _ { i }$ . It also indicates the accuracy of $a _ { j }$ ’s analysis conditions on
170
+ 147 precisely assess $a _ { i }$ . We then conclude that:
171
+
172
+ 148 where $i , j , k \in \{ 1 , 2 , 3 \} , i \neq j , k \neq i , j$
173
+
174
+ $$
175
+ \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}
176
+ $$
177
+
178
+ 149 We take Equ.(2a) as an example. To study the cooperation of this multi-agent system precisely (i.e.,
179
+ 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
180
+ 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
181
+ 152 $p ( \mathcal { O } _ { 3 } | \mathcal { O } _ { 1 } , \mathcal { O } _ { 2 } ) )$ under the condition of preceding agents’ precise analysis.
182
+ 153 The sequential MARL framework reduces the complexity of the model with six dotted arrows that
183
+ 154 indicate correlations between agents’ evaluations in Figure 1(b) by half, as those three dotted lines in
184
+ 155 Figure 1(c) show. Equ.(3) suggests that we can analyze the cooperation of a multi-agent system in
185
+ 156 any order, but from the CEO-Staff example, we can see that the difficulty of analyzing in various
186
+ 157 orders is not the same. Further discussion on the sequence will show in Section 3.4.
187
+ 158 In general, we specify an order to analyze the cooperation in the sequential MARL framework. We
188
+ 159 fix an agent’s actions after assessing it and study a particular agent based on the fixed actions of its
189
+ 160 preceding agents, reflecting the intuition that a CEO’s decision has a strong influence on evaluating
190
+ 161 the staff in the example mentioned earlier. This sequential MARL framework significantly alleviates
191
+ 162 the correlations in studying agents and helps us assess their cooperation more directly.
192
+
193
+ # 3.3 Sequential Credit Assignment
194
+
195
+ 64 Following the CTDE paradigm, we utilize a centralized critic for each actor to follow a gradient
196
+ 165 based on an advantage function $A$ estimated from this critic:
197
+
198
+ $$
199
+ g = \nabla _ { \theta ^ { \pi } } \log \pi \left( u | \tau _ { t } ^ { a } \right) A .
200
+ $$
201
+
202
+ ![](images/1a7321a0ed108bed657b77946907348e4522b7b34d52af5ce5ec1f220e47d2ab.jpg)
203
+ 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.
204
+
205
+ 166 The advantage function $A$ for each actor explicitly deduces how that particular agent contributes to
206
+ 167 the team. COMA [6] introduced a counterfactual baseline inspired by difference rewards [34]. For
207
+ 168 each agent $a$ , COMA computes an advantage function that compares the Q-value for the action $u ^ { a }$ to
208
+ 169 a counterfactual baseline that marginalizes out $u ^ { a }$ while keeping the others’ actions $\mathbf { u } ^ { - a }$ fixed:
209
+
210
+ $$
211
+ 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) .
212
+ $$
213
+
214
+ 170 COMA avoids expensive calculations through careful network design. However, each agent’s
215
+ 171 contribution deduced by COMA is still imperfect. The evaluation of $u ^ { a }$ is based on the fixed $\mathbf { u } ^ { - a }$
216
+ 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
217
+ 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 }$ .
218
+ 174 To analyze each agent $a$ ’s contribution more objectively, we consider the influence of all joint actions
219
+ 175 with $u ^ { a }$ . Considering all potential action combinations, we calculate a counterfactual advantage for
220
+ 176 each agent’s action, derived by computing the expectation on all the actions of other agents:
221
+
222
+ $$
223
+ 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] .
224
+ $$
225
+
226
+ 177 Under our proposed sequential MARL framework, we carry out credit assignment according to a
227
+ 178 specific order, and there is no need to consider all the possible joint actions. After assessing agent $a$ ,
228
+ 179 we fix its action and evaluate agents after it based on $a$ ’s fixed action, so the following agents’ credit
229
+ 180 assignments do not have to compute the expectation on $u ^ { a }$ anymore.
230
+
231
+ 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 )$ .
232
+
233
+ 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
234
+ 186 there is no need to calculate the expectations on $[ u ^ { a _ { 1 } } , u ^ { a _ { 2 } } , . . . , u ^ { a _ { i - 1 } } ]$ , simplifying Equ.(6) to:
235
+
236
+ $$
237
+ \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}
238
+ $$
239
+
240
+ 187 Then the first agent $a _ { 1 }$ ’s advantage is:
241
+
242
+ $$
243
+ \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}
244
+ $$
245
+
246
+ ![](images/c668245e9dcfbddf169779735f299af2d0adc516e3253450dc16771d4ff9007d.jpg)
247
+ 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.
248
+
249
+ 188 To illustrate the effectiveness of our sequential counterfactual advantage, we conduct a simple
250
+ 189 but illuminating test in two common multi-agent particle environments [11], Predator-Prey and
251
+ 190 Cooperative Navigation. We train both methods with 5 random seeds, and agents are trained for 5000
252
+ 191 episodes. We provide detailed information on the environments and experiments in the Appendix. As
253
+ 192 shown in Figure 2, our sequential advantage functions help agents handle the task faster and better.
254
+ 93 Our sequential advantage for each agent achieves an additive decomposition of the total advantage
255
+ 94 function, which to some extent explains the soundness and superiority of our advantage over COMA’s.
256
+
257
+ 95 Claim 1. The proposed sequential credit assignment achieves additive advantage-decomposition.
258
+
259
+ 196 Proof. See Appendix A.
260
+
261
+ 97 Facing the same problem as COMA that those evaluations are expensive, we model the first term
262
+ 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
263
+ 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:
264
+
265
+ $$
266
+ 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) .
267
+ $$
268
+
269
+ 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.
270
+
271
+ 202 Critic Learning. We train critic $f _ { \phi }$ on-policy to estimate $Q$ , utilizing a practical variant of $\mathrm { T D } ( \lambda )$ [27]
272
+ 203 adapted for use with deep neural networks. In particular, the critic parameter $\phi$ is updated by minibatch
273
+ 204 gradient descent to minimize the following loss:
274
+
275
+ $$
276
+ \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) .
277
+ $$
278
+
279
+ 205 We utilize a target critic $f _ { \phi ^ { - } }$ [14] to improve learning stability and update ${ \phi } ^ { - } \phi$ periodically. The
280
+ 206 critic learning flow is shown at the top of Figure 3(c). The input for critic training is the state $s$ and
281
+ 207 the action vector $\mathbf { u } = \left[ u ^ { 1 } , u ^ { 2 } , . . . , u ^ { n } \right]$ denoted as $\mathbf { v } ^ { 1 : n }$ .
282
+ 208 Policy Learning. We optimize each agent $a$ ’s policy parameter $\theta _ { a }$ by maximizing the following
283
+ 209 objective, which contains our proposed advantage function and an entropy regularization term $\mathcal { H }$ :
284
+
285
+ $$
286
+ 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] ,
287
+ $$
288
+
289
+ 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:
290
+
291
+ $$
292
+ \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}
293
+ $$
294
+
295
+ 212 We share parameters among agents, and the gradient we use to train the actor shared by all agents is:
296
+
297
+ $$
298
+ 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] .
299
+ $$
300
+
301
+ 213 The inputs of the centralized critic $f _ { \phi }$ to compute the advantage function are the state $s$ and two
302
+ 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
303
+ 215 bottom of Figure 3(c) demonstrates the policy learning flow.
304
+
305
+ # 3.4 Sequence Adjustment Through Integrated Gradients
306
+
307
+ 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.
308
+
309
+ 225 We generalize the CEO-Staff example to propose a universal model. Instead of focusing on the roles
310
+ 226 among the agents as in [31, 32], we are more interested in agents’ contributions. Although the CEO
311
+ 227 and the staff have a superior-subordinate relationship, they are essentially employees of an enterprise.
312
+ 228 The staff plays an auxiliary role and acts based on the CEO’s decision. The staff’s work is meaningful
313
+ 229 only if the CEO’s decision is correct. Therefore, we often intuitively assume that an enterprise’s
314
+ 230 leader is paid more and contributes more. Based on this, we transform the roles of the CEO and staff
315
+ 231 into employees with different contributions to the enterprise. In the sequential MARL framework, we
316
+ 232 first assign credit to the agent with a higher contribution to the team.
317
+ 233 The attribution method is a powerful way to determine the influence of input features’ each component
318
+ 234 on the network output value [2]. Among them, integrated gradients [25] leverages path integral to
319
+ 235 aggregate gradients along the inputs that fall on the lines between the baseline and the input, which
320
+ 236 is a natural tool for measuring each agent’s contribution. QPD [35] utilizes the integrated gradient
321
+ 237 attribution technique to decompose shared rewards along trajectory paths, revealing how much each
322
+ 238 agent’s observation and action contributes to the global Q value. However, it remains unclear whether
323
+ 239 individual Q value should be linearly correlated to or approximated by the agent’s contribution, as in
324
+ 240 the case of QPD. The proper connection between agents’ contributions and their individual Q values
325
+ 241 in a cooperative team is worth well studied for the community.
326
+
327
+ 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 }$ :
328
+
329
+ $$
330
+ c ^ { a } = \sum _ { x _ { j } \in \pi ^ { a } } \mathrm { P a t h I G } _ { j } ^ { \tau _ { t _ { 1 } } ^ { t _ { 2 } } } ( \pi ^ { a } ) ,
331
+ $$
332
+
333
+ 246 where $x _ { j }$ is $j$ -th dimension of the policy vector $\pi ^ { a }$ . The computation for PathIG is shown in Equ.(1).
334
+ 247 We compute each agent’s contribution $c$ to the state transition from $s _ { t _ { 1 } }$ to $s _ { t _ { 2 } }$ and analyze the agent
335
+ 248 with higher $c$ first. We further study the adjustment frequency and its effectiveness in Section 4.2
336
+
337
+ # 4 Experiments and Analysis
338
+
339
+ # 4.1 Experimental Setup
340
+
341
+ 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.
342
+
343
+ ![](images/1136df9f6bcfaf9c4dc17813aee3a729a186de53396fdc91896a637a666edaf4.jpg)
344
+ 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.
345
+
346
+ # 4.2 Ablation Studies
347
+
348
+ # We first carry out ablation experiments on a Super Hard map MMM2 to validate key elements of SeCA.
349
+
350
+ 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.
351
+
352
+ 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.
353
+
354
+ 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.
355
+
356
+ # 94 4.3 Comparisons with State-of-the-arts
357
+
358
+ 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]
359
+
360
+ ![](images/38587f1c30280214c4c2e9ac29dc02023f61d16f0bacb03b84a7241ac6bc2863.jpg)
361
+ Figure 5: The comparison of SeCA against various baseline algorithms on six SMAC maps.
362
+
363
+ 302 utilizing SC2.4.10. Performance is not always comparable between versions, so the results may be
364
+ 303 subtly different from the original papers.
365
+ 304 As we can see in Figure 5, SeCA demonstrates its robustness by achieving good performances in
366
+ 305 scenarios with various characteristics. All methods except COMA and QTRAN solve two Easy
367
+ 306 scenarios, and SeCA performs better in convergence speed and stability. SeCA’s advantage is further
368
+ 307 extended in the Hard map $\mathsf { 2 c _ { - } v s _ { - } 6 4 z g }$ , and it converges significantly faster than other methods.
369
+ 308 Although classified only as Hard, $ { 3 \mathrm { s } } _ { - } { \mathrm { v } } { \mathrm { s } } _ { - } { 5 z }$ invalidates most algorithms except QMIX and SeCA, as
370
+ 309 Stalkers have to learn dispersing and making enemies give chase while maintaining enough distance
371
+ 310 ("kiting" technique) in this map. SeCA has a higher variance than QMIX. This is possibly because
372
+ 311 the Stalkers’ scattering prioritizes individual performance over cooperation which is more in line
373
+ 312 with QMIX’s monotonicity constraint. Nevertheless, SeCA’s performance improvements on the
374
+ 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
375
+ 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
376
+ 315 this map are obtained by using a different entropy coefficient, which is explained in its open-source
377
+ 316 implementation.1 This parameter tuning is unfair when comparing methods, so all experiments in this
378
+ 317 paper use the fixed entropy coefficient. We also visualize the learned sequences in different battles of
379
+ 318 $3 { \bf s } _ { - } \mathtt { v } { \bf s } _ { - } 5 z$ to provide insights into our sequence adjustment in the Appendix.
380
+ 19 We are supposed to compare our method with QPD that also utilizes integrated gradients to show
381
+ 320 our improvement. However, QPD modifies the original SMAC environment to acquire additional
382
+ 321 information for policy training, which is mentioned in its open-source implementation.2 Therefore, it
383
+ 322 is unfair to compare QPD’s learning curves in the modified environment with other methods, and
384
+ 323 QPD’s authors did not provide methods’ learning curves comparison in the original paper. We follow
385
+ 324 them, providing a win rate table in the Appendix to show our superiority over QPD.
386
+
387
+ # 5 Conclusions and Future Work
388
+
389
+ 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.
390
+
391
+ References
392
+ [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.
393
+ [2] Guillem Brasó Andilla. Attribution methods for deep convolutional networks.
394
+ [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.
395
+ [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.
396
+ [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.
397
+ [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.
398
+ [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.
399
+ [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.
400
+ [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.
401
+ [10] Landon Kraemer and Bikramjit Banerjee. Multi-agent reinforcement learning as a rehearsal for decentralized planning. Neurocomputing, 190:82–94, 2016.
402
+ [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.
403
+ [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.
404
+ [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.
405
+ [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.
406
+ [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.
407
+ [16] Frans A Oliehoek and Christopher Amato. A concise introduction to decentralized POMDPs. Springer, 2016.
408
+ [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.
409
+ 380 [18] Afshin OroojlooyJadid and Davood Hajinezhad. A review of cooperative multi-agent deep reinforcement learning. arXiv preprint arXiv:1908.03963, 2019.
410
+ 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.
411
+ 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.
412
+ 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.
413
+ 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.
414
+ [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.
415
+ [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.
416
+ [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.
417
+ [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.
418
+ [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.
419
+
420
+ # Checklist
421
+
422
+ 1. For all authors...
423
+
424
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
425
+ (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.
426
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A]
427
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
428
+
429
+ 2. If you are including theoretical results...
430
+
431
+ (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.
432
+
433
+ 3. If you ran experiments...
434
+
435
+ (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.
436
+ (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.
437
+ (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.
438
+ (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.
439
+
440
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
441
+
442
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
443
+ (b) Did you mention the license of the assets? [Yes]
444
+ (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.
445
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
446
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
447
+
448
+ 5. If you used crowdsourcing or conducted research with human subjects...
449
+
450
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
451
+
452
+ 476 (b) Did you describe any potential participant risks, with links to Institutional Review
453
+ 477 Board (IRB) approvals, if applicable? [N/A]
454
+ 478 (c) Did you include the estimated hourly wage paid to participants and the total amount
455
+ 479 spent on participant compensation? [N/A]