Datasets:
Add files using upload-large-folder tool
Browse files- md/train/-4IA4WgNAy4Wx/-4IA4WgNAy4Wx.md +0 -0
- md/train/-QxT4mJdijq/-QxT4mJdijq.md +439 -0
- md/train/0XXpJ4OtjW/0XXpJ4OtjW.md +330 -0
- md/train/5-GXHFNbq_U/5-GXHFNbq_U.md +278 -0
- md/train/5NA1PinlGFu/5NA1PinlGFu.md +421 -0
- md/train/8VXvj1QNRl1/8VXvj1QNRl1.md +320 -0
- md/train/8jFiomKUnaT/8jFiomKUnaT.md +542 -0
- md/train/B1gdkxHFDH/B1gdkxHFDH.md +628 -0
- md/train/BklEF3VFPB/BklEF3VFPB.md +256 -0
- md/train/D51irFX8UOG/D51irFX8UOG.md +0 -0
- md/train/H139Q_gAW/H139Q_gAW.md +287 -0
- md/train/H178hw9ex/H178hw9ex.md +341 -0
- md/train/H1MW72AcK7/H1MW72AcK7.md +412 -0
- md/train/H1bM1fZCW/H1bM1fZCW.md +205 -0
- md/train/H1gdF34FvS/H1gdF34FvS.md +471 -0
- md/train/HJ94fqApW/HJ94fqApW.md +288 -0
- md/train/HJGwcKclx/HJGwcKclx.md +334 -0
- md/train/HJgLZR4KvH/HJgLZR4KvH.md +489 -0
- md/train/HJxDugSFDB/HJxDugSFDB.md +415 -0
- md/train/HkuVu3ige/HkuVu3ige.md +253 -0
- md/train/HygaikBKvS/HygaikBKvS.md +512 -0
- md/train/HyxnnnVtwB/HyxnnnVtwB.md +474 -0
- md/train/Ig-VyQc-MLK/Ig-VyQc-MLK.md +0 -0
- md/train/JbuYF437WB6/JbuYF437WB6.md +366 -0
- md/train/P7GUAXxS3ym/P7GUAXxS3ym.md +242 -0
- md/train/SJgw51HFDr/SJgw51HFDr.md +455 -0
- md/train/SJzR2iRcK7/SJzR2iRcK7.md +338 -0
- md/train/SkA-IE06W/SkA-IE06W.md +595 -0
- md/train/SkZxCk-0Z/SkZxCk-0Z.md +452 -0
- md/train/SygKyeHKDH/SygKyeHKDH.md +404 -0
- md/train/SygcCnNKwr/SygcCnNKwr.md +0 -0
- md/train/Syxt5oC5YQ/Syxt5oC5YQ.md +566 -0
- md/train/UcoXdfrORC/UcoXdfrORC.md +413 -0
- md/train/WA39qkJvLi/WA39qkJvLi.md +249 -0
- md/train/ZEoMBPtvqey/ZEoMBPtvqey.md +232 -0
- md/train/gEzN9bBbLt8/gEzN9bBbLt8.md +294 -0
- md/train/goEdyJ_nVQI/goEdyJ_nVQI.md +393 -0
- md/train/hqDb8d65Vfh/hqDb8d65Vfh.md +284 -0
- md/train/iEEAPq3TUEZ/iEEAPq3TUEZ.md +244 -0
- md/train/jpm1AfJucwt/jpm1AfJucwt.md +397 -0
- md/train/lMgDDWb1ULW/lMgDDWb1ULW.md +253 -0
- md/train/lo7GKwmakFZ/lo7GKwmakFZ.md +349 -0
- md/train/n6jl7fLxrP/n6jl7fLxrP.md +0 -0
- md/train/r1VPNiA5Fm/r1VPNiA5Fm.md +779 -0
- md/train/rJx1Na4Fwr/rJx1Na4Fwr.md +574 -0
- md/train/rYhBGWYm6AU/rYhBGWYm6AU.md +223 -0
- md/train/rkgdYhVtvH/rkgdYhVtvH.md +426 -0
- md/train/w_7JMpGZRh0/w_7JMpGZRh0.md +448 -0
- md/train/wta_8Hx2KD/wta_8Hx2KD.md +617 -0
- md/train/xboZWqM_ELA/xboZWqM_ELA.md +357 -0
md/train/-4IA4WgNAy4Wx/-4IA4WgNAy4Wx.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/-QxT4mJdijq/-QxT4mJdijq.md
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# META-LEARNING SYMMETRIES BY REPARAMETERIZATION
|
| 2 |
+
|
| 3 |
+
Allan Zhou, Tom Knowles, Chelsea Finn Dept of Computer Science, Stanford University {ayz,tknowles,cbfinn}@stanford.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Many successful deep learning architectures are equivariant to certain transformations in order to conserve parameters and improve generalization: most famously, convolution layers are equivariant to shifts of the input. This approach only works when practitioners know the symmetries of the task and can manually construct an architecture with the corresponding equivariances. Our goal is an approach for learning equivariances from data, without needing to design custom task-specific architectures. We present a method for learning and encoding equivariances into networks by learning corresponding parameter sharing patterns from data. Our method can provably represent equivariance-inducing parameter sharing for any finite group of symmetry transformations. Our experiments suggest that it can automatically learn to encode equivariances to common transformations used in image processing tasks. We provide our experiment code at https: //github.com/AllanYangZhou/metalearning-symmetries.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In deep learning, the convolutional neural network (CNN) (LeCun et al., 1998) is a prime example of exploiting equivariance to a symmetry transformation to conserve parameters and improve generalization. In image classification (Russakovsky et al., 2015; Krizhevsky et al., 2012) and audio processing (Graves and Jaitly, 2014; Hannun et al., 2014) tasks, we may expect the layers of a deep network to learn feature detectors that are translation equivariant: if we translate the input, the output feature map is also translated. Convolution layers satisfy translation equivariance by definition, and produce remarkable results on these tasks. The success of convolution’s “built in” inductive bias suggests that we can similarly exploit other equivariances to solve machine learning problems.
|
| 12 |
+
|
| 13 |
+
However, there are substantial challenges with building in inductive biases. Identifying the correct biases to build in is challenging, and even if we do know the correct biases, it is often difficult to build them into a neural network. Practitioners commonly avoid this issue by “training in” desired equivariances (usually the special case of invariances) using data augmentation. However, data augmentation can be challenging in many problem settings and we would prefer to build the equivariance into the network itself. For example, robotics sim2real transfer approaches train agents that are robust to varying conditions by varying the simulated environment dynamics (Song et al., 2020). But this type of augmentation is not possible once the agent leaves the simulator and is trying to learn or adapt to a new task in the real world. Additionally, building in incorrect biases may actually be detrimental to final performance (Liu et al., 2018b).
|
| 14 |
+
|
| 15 |
+
In this work we aim for an approach that can automatically learn and encode equivariances into a neural network. This would free practitioners from having to design custom equivariant architectures for each task, and allow them to transfer any learned equivariances to new tasks. Neural network layers can achieve various equivariances through parameter sharing patterns, such as the spatial parameter sharing of standard convolutions. In this paper we reparameterize network layers to learnably represent sharing patterns. We leverage meta-learning to learn the sharing patterns that help a model generalize on new tasks.
|
| 16 |
+
|
| 17 |
+
The primary contribution of this paper is an approach to automatically learn equivariance-inducing parameter sharing, instead of using custom designed equivariant architectures. We show theoretically that reparameterization can represent networks equivariant to any finite symmetry group. Our experiments show that meta-learning can recover various convolutional architectures from data, and learn invariances to common data augmentation transformations.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
A number of works have studied designing layers with equivariances to certain transformations such as permutation, rotation, reflection, and scaling (Gens and Domingos, 2014; Cohen and Welling, 2016; Zaheer et al., 2017; Worrall et al., 2017; Cohen et al., 2019; Weiler and Cesa, 2019; Worrall and Welling, 2019). These approaches focus on manually constructing layers analagous to standard convolution, but for other symmetry groups. Rather than building symmetries into the architecture, data augmentation (Beymer and Poggio, 1995; Niyogi et al., 1998) trains a network to satisfy them. Diaconu and Worrall (2019) use a hybrid approach that pre-trains a basis of rotated filters in order to define roto-translation equivariant convolution. Unlike these works, we aim to automatically build in symmetries by acquiring them from data.
|
| 22 |
+
|
| 23 |
+
Our approach is motivated in part by theoretical work characterizing the nature of equivariant layers for various symmetry groups. In particular, the analysis of our method as learning a certain kind of convolution is inspired by Kondor and Trivedi (2018), who show that under certain conditions all linear equivariant layers are (generalized) convolutions. Shawe-Taylor (1989) and Ravanbakhsh et al. (2017) analyze the relationship between desired symmetries in a layer and symmetries of the weight matrix. Ravanbakhsh et al. (2017) show that we can make a layer equivariant to the permutation representation of any discrete group through a corresponding parameter sharing pattern in the weight matrix. From this perspective, our reparameterization is a way of representing possible parameter sharing patterns, and the training procedure aims to learn the correct parameter sharing pattern that achieves a desired equivariance.
|
| 24 |
+
|
| 25 |
+
Prior work on automatically learning symmetries include methods for learning invariances in Gaussian processes (van der Wilk et al., 2018) and learning symmetries of physical systems (Greydanus et al., 2019; Cranmer et al., 2020). Another very recent line of work has shown that more general Transformer (Vaswani et al., 2017) style architectures can match or outperform traditional CNNs on image tasks, without baking in translation symmetry (Dosovitskiy et al., 2020). Their results suggest that Transformer architectures can automatically learn symmetries and other inductive biases from data, but typically only with very large training datasets. One can also consider automatic data augmentation strategies (Cubuk et al., 2018; Lorraine et al., 2019) as a way of learning symmetries, though the symmetries are not embedded into the network in a transferable way. Concurrent work by Benton et al. (2020) aims to learn invariances from data by learning distributions over transformations of the input, similar to learned data augmentation. Our method aims to learn parameter sharing of the layer weights which induces equivariance. Additionally, our objective for learning symmetries is driven directly by generalization error (in a meta-learning framework), while the objective in Benton et al. (2020) adds a regularizer to the training loss to encourage symmetry learning.
|
| 26 |
+
|
| 27 |
+
Our work is related to neural architecture search (Zoph and Le, 2016; Brock et al., 2017; Liu et al., 2018a; Elsken et al., 2018), which also aims to automate part of the model design process. Although architecture search methods are varied, they are generally not designed to exploit symmetry or learn equivariances. Evolutionary methods for learning both network weights and topology (Stanley and Miikkulainen, 2002; Stanley et al., 2009) are also not motivated by symmetry considerations.
|
| 28 |
+
|
| 29 |
+
Our method learns to exploit symmetries that are shared by a collection of tasks, a form of metalearning (Thrun and Pratt, 2012; Schmidhuber, 1987; Bengio et al., 1992; Hochreiter et al., 2001). We extend gradient based meta-learning (Finn et al., 2017; Li et al., 2017; Antoniou et al., 2018) to separately learn parameter sharing patterns (which enforce equivariance) and actual parameter values. Separately representing network weights in terms of a sharing pattern and parameter values is a form of reparameterization. Prior work has used weight reparameterization in order to “warp” the loss surface (Lee and Choi, 2018; Flennerhag et al., 2019) and to learn good latent spaces (Rusu et al., 2018) for optimization, rather than to encode equivariance. HyperNetworks (Ha et al., 2016; Schmidhuber, 1992) generate network layer weights using a separate smaller network, which can be viewed as a nonlinear reparameterization, albeit not one that encourages learning equivariances. Modular meta-learning (Alet et al., 2018) is a related technique that aims to achieve combinatorial generalization on new tasks by stacking meta-learned “modules,” each of which is a neural network.
|
| 30 |
+
|
| 31 |
+
This can be seen as parameter sharing by re-using and combining modules, rather than using our layerwise reparameterization.
|
| 32 |
+
|
| 33 |
+
# 3 PRELIMINARIES
|
| 34 |
+
|
| 35 |
+
In Sec. 3.1, we review gradient based meta-learning, which underlies our algorithm. Sections 3.2 and 3.3 build up a formal definition of equivariance and group convolution (Cohen and Welling, 2016), a generalization of standard convolution which defines equivariant operations for other groups such as rotation and reflection. These concepts are important for a theoretical understanding of our work as a method for learning group convolutions in Sec. 4.2.
|
| 36 |
+
|
| 37 |
+
# 3.1 GRADIENT BASED META-LEARNING
|
| 38 |
+
|
| 39 |
+
Our method is a gradient-based meta-learning algorithm that extends MAML (Finn et al., 2017), which we briefly review here. Suppose we have some task distribution $p ( \mathcal { T } )$ , where each task dataset is split into training and validation datasets $\{ \mathcal { D } _ { i } ^ { t r } , \mathcal { D } _ { i } ^ { v a l } \}$ . For a model with parameters $\theta$ , loss $\mathcal { L }$ , and learning rate $\alpha$ , the “inner loop” updates $\theta$ on the task’s training data: $\theta ^ { \prime } = \theta - \alpha \nabla _ { \theta } \mathcal { L } ( \theta , \mathcal { D } ^ { t r } )$ . In the “outer loop,” MAML meta-learns a good initialization $\theta$ by minimizing the loss of $\theta ^ { \prime }$ on the task’s validation data, with updates of the form meta-learning the inner loop initialization $\theta \gets \theta - \eta \frac { \mathrm { d } } { \mathrm { d } \theta } \mathcal { L } ( \theta ^ { \prime } , \mathcal { D } ^ { v a l } )$ . Although MAML focuses ona to meta-learning other things $\theta$
|
| 40 |
+
such as the inner learning rate $\alpha$ . In our method, we meta-learn a parameter sharing pattern at each layer that maximizes performance across the task distribution.
|
| 41 |
+
|
| 42 |
+
# 3.2 GROUPS AND GROUP ACTIONS
|
| 43 |
+
|
| 44 |
+
Symmetry and equivariance is usually studied in the context of groups and their actions on sets; refer to Dummit and Foote (2004) for more comprehensive coverage. A group $G$ is a set closed under some associative binary operation, where there is an identity element and each element has an inverse. Consider the group $( \mathbb { Z } , + )$ (the set of integers with addition): we can add any two integers to obtain another, each integer has an additive inverse, and 0 is the additive identity.
|
| 45 |
+
|
| 46 |
+
A group $G$ can act on a set $X$ through some action $\rho : G \to \operatorname { A u t } ( X )$ which maps each $g \in G$ to some transformation on $X$ . $\rho$ must be a homomorphism, i.e. $\rho ( g h ) ~ = ~ \rho ( g ) \rho ( h )$ for all $g , h \in G$ , and $\operatorname { A u t } ( X )$ is the set of automorphisms on $X$ (bijective homomorphisms from $X$ to itself). As a shorthand we write $g x : = \rho ( g ) ( x )$ for any $x \in X$ . Any group can act on itself by letting $X = G$ : for $( \mathbb { Z } , + )$ , we define the action $g x = g + x$ for any $g , x \in \mathbb { Z }$ .
|
| 47 |
+
|
| 48 |
+
The action of a group $G$ on a vector space $V$ is called a representation, which we denote $\pi : G \to G L ( V )$ . Recall $G L ( V )$ is the set of invertible linear maps on $V$ . Assume the vectors $v \in V$ are discrete, with components $v [ i ]$ . If we already have $G$ ’s action on the indices, a natural corresponding representation is defined $( \pi ( g ) v ) [ i ] : = { \overset { } { v } } [ g ^ { - 1 } i ]$ . As a concrete example,
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 1: Convolution as translating filters. Left: Standard 1-D convolution slides a filter $w$ along the length of input $x$ . This operation is translation equivariant: translating $x$ will translate $y$ . Right: Standard convolution is equivalent to a fully connected layer with a parameter sharing pattern: each row contains translated copies of the filter. Other equivariant layers will have their own sharing patterns.
|
| 52 |
+
|
| 53 |
+
consider the representation of $G = ( \mathbb { Z } , + )$ for infinite length vectors. The indices are also integers, so the group is acting on itself as defined above. Then $\tilde { ( \pi ( g ) v ) } [ i ] = v [ g ^ { - 1 } i ] = v [ i - g ]$ for any $g , i \in \mathbb { Z }$ . Hence this representation of $\mathbb { Z }$ shifts vectors by translating their indices by $g$ spaces.
|
| 54 |
+
|
| 55 |
+
# 3.3 EQUIVARIANCE AND CONVOLUTION
|
| 56 |
+
|
| 57 |
+
A function (like a neural network layer) is equivariant to some transformation if transforming the function’s input is the same as transforming its output. To be more precise, we must define what those transformations of the input and output are. Consider a neural network layer $\phi : \mathbb { R } ^ { n } \mathbb { R } ^ { m }$ .
|
| 58 |
+
|
| 59 |
+
Assume we have two representations $\pi _ { 1 } , \pi _ { 2 }$ of group $G$ on $\mathbb { R } ^ { n }$ and $\mathbb { R } ^ { m }$ , respectively. For each $g \in G$ , $\pi _ { 1 } ( g )$ transforms the input vectors, while $\pi _ { 2 } ( g )$ transforms the output vectors. The layer $\phi$ is $G$ -equivariant with respect to these transformations if $\phi ( \pi _ { 1 } ( g ) v ) = \bar { \pi _ { 2 } } ( g ) \phi ( v )$ , for any $g \in$ $G , v \in \mathbb { R } ^ { n }$ . If we choose $\pi _ { 2 } \equiv i d$ we get $\phi ( \pi _ { 1 } ( g ) v ) = \phi ( v )$ , showing that invariance is a type of equivariance.
|
| 60 |
+
|
| 61 |
+
Deep networks contain many layers, but function composition preserves equivariance. So if we achieve equivariance in each individual layer, the whole network will be equivariant. Pointwise nonlinearities such as ReLU and sigmoid are already equivariant to any permutation of the input and output indices, which includes translation, reflection, and rotation. Hence we are primarily focused on enforcing equivariance in the linear layers.
|
| 62 |
+
|
| 63 |
+
Prior work (Kondor and Trivedi, 2018) has shown that a linear layer $\phi$ is equivariant to the action of some group if and only if it is a group convolution, which generalizes standard convolutions to arbitrary groups. For a specific $G$ , we call the corresponding group convolution “ $G$ -convolution” to distinguish it from standard convolution. Intuitively, $G$ -convolution transforms a filter according to each $g ~ \in ~ G$ , then computes a dot product between the transformed filter and the input. In standard convolution, the filter transformations correspond to translation (Fig. 1). $G$ -equivariant layers convolve an input $v \in \mathbb { R } ^ { n }$ with a filter $\psi \in \mathbb { R } ^ { n }$ . Assume the group $G = \{ g _ { 1 } , \cdots , g _ { m } \}$ is finite:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\phi ( v ) [ j ] = ( v \star \psi ) [ j ] = \sum _ { i } v [ i ] ( \pi ( g _ { j } ) \psi ) [ i ] = \sum _ { i } v [ i ] \psi [ g _ { j } ^ { - 1 } i ]
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
In this work, we present a method that represents and learns parameter sharing patterns for existing layers, such as fully connected layers. These sharing patterns can force the layer to implement various group convolutions, and hence equivariant layers.
|
| 70 |
+
|
| 71 |
+
# 4 ENCODING AND LEARNING EQUIVARIANCE
|
| 72 |
+
|
| 73 |
+
To learn equivariances automatically, our method introduces a flexible representation that can encode possible equivariances, and an algorithm for learning which equivariances to encode. Here we describe this method, which we call Meta-learning Symmetries by Reparameterization (MSR).
|
| 74 |
+
|
| 75 |
+
# 4.1 LEARNABLE PARAMETER SHARING
|
| 76 |
+
|
| 77 |
+
As Fig. 1 shows, a fully connected layer can implement standard convolution if its weight matrix is constrained with a particular sharing pattern, where each row contains a translated copy of the same underlying filter parameters. This idea generalizes to equivariant layers for other transformations like rotation and reflection, but the sharing pattern depends on the transformation. Since we do not know the sharing pattern a priori, we “reparameterize” fully connected weight matrices to represent them in a general and flexible fashion. A fully connected layer $\phi : \mathbb { R } ^ { n } \mathbb { R } ^ { m }$ with weight matrix $W \in \mathbb { R } ^ { m \times n }$ is defined for input $x$ by $\phi ( x ) \ : = \ : W x$ . We can optionally incorporate biases by appending a dimension with value “1” to the input $x$ . We factorize $W$ as the product of a “symmetry matrix” $U$ and a vector $v$ of $k$ “filter parameters”:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\operatorname { v e c } ( W ) = U v , \quad v \in \mathbb { R } ^ { k } , U \in \mathbb { R } ^ { m n \times k }
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
For fully connected layers, we reshape1 the vector $\operatorname { v e c } ( W ) \in \mathbb { R } ^ { m n }$ into a weight matrix $W \in \mathbb { R } ^ { m \times n }$ . Intuitively, $U$ encodes the pattern by which the weights $W$ will “share” the filter parameters $v$ . Crucially, we can now separate the problem of learning the sharing pattern (learning $U$ ) from the problem of learning the filter parameters $v$ . In Sec. 4.3, we discuss how to learn $U$ from data.
|
| 84 |
+
|
| 85 |
+
The symmetry matrix for each layer has mnk entries, which can become too expensive in larger layers. Kronecker factorization is a common approach for approximating a very large matrix with smaller ones (Martens and Grosse, 2015; Park and Oliva, 2019). In Appendix A we describe how we apply Kronecker approximation to Eq. 2, and analyze memory and computation efficiency.
|
| 86 |
+
|
| 87 |
+
In practice, there are certain equivariances that are expensive to meta-learn, but that we know to be useful: for example, standard 2D convolutions for image data. However, there may be still other symmetries of the data (i.e., rotation, scaling, reflection, etc.) that we still wish to learn
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\underbrace { \left( \begin{array} { l } { \pi ( \mathrm { e } ) } \\ { \pi ( \mathrm { g } ) } \\ { \rho ^ { \prime } } \\ { \sigma ^ { \prime } } \end{array} \right) } _ { \mathrm { g r o u p } } \underbrace { \left( \begin{array} { l } { 1 } \\ { 0 } \\ { 0 } \\ { 1 } \\ { 1 } \end{array} \right) } _ { \mathrm { s y m m e t r y } } \underbrace { \left( \begin{array} { l } { \equiv } \\ { \left\{ \begin{array} { l } { \overline { { \mathbf { \ } } } } \\ { \overline { { \mathbf { \ } } } } \\ { \mathbf { \mu } } \end{array} \right\} } \\ { \mathrm { p a r a m e t e r s } } \end{array} \right) } _ { \mathrm { m a t r i x } } = \underbrace { \left( \begin{array} { l } { \overline { { \mathbf { \mu } } } } \\ { \overline { { \mathbf { \mu } } } } \\ { \overline { { \mathbf { \mu } } } } \end{array} \right) } _ { \mathrm { m ~ \mu } } \xrightarrow { \mathrm { r e s h a p e } } \underbrace { \left( \underbrace { \left\{ \begin{array} { l } { \mathbf { \mu } } \\ { \mathbf { \mu } } \\ { \mathbf { \mu } } \\ { \mathrm { \mu } } \end{array} \right\} } _ { \mathrm { l o y e r } } \right) } _ { \mathrm { w e i g h t s } }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Figure 2: We reparameterize the weights of each layer in terms of a symmetry matrix $U$ that can enforce equivariant sharing patterns of the filter parameters $v$ . Here we show a $U$ that enforces permutation equivariance. More technically, the layer implements group convolution on the permutation group $S _ { 2 }$ : $U$ ’s block submatrices $\pi ( e ) , \pi ( g )$ define the action of each permutation on filter $v$ . Note that $U$ need not be binary in general.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: For each task, the inner loop updates the filter parameters $v$ to the task using the inner loop loss. Note that the symmetry matrix $U$ does not change in the inner loop, and is only updated by the outer loop.
|
| 97 |
+
|
| 98 |
+
# Algorithm 1: MSR: Meta-Training
|
| 99 |
+
|
| 100 |
+
input: $\{ \mathcal { T } _ { j } \} _ { j = 1 } ^ { N } \sim p ( \mathcal { T } )$ : Meta-training tasks
|
| 101 |
+
input: $\{ \mathbf { U } , { \dot { \mathbf { v } } } \}$ : Randomly initialized symmetry matrices and filters.
|
| 102 |
+
input: $\alpha , \eta$ : Inner and outer loop step sizes.
|
| 103 |
+
while not done do sample minibatch $\{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { n } \sim \{ \mathcal { T } _ { j } \} _ { j = 1 } ^ { N }$ ; forall $\mathcal { T } _ { i } \in \{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { n } \mathbf { d }$ o $\{ \mathcal { D } _ { i } ^ { t r } , \mathcal { D } _ { i } ^ { v a l } \} \mathcal { T } _ { i }$ ; // task data $\pmb { \delta } _ { i } \gets \nabla _ { \mathbf { v } } \mathcal { L } ( \mathbf { U } , \mathbf { v } , \mathcal { D } _ { i } ^ { t r } ) ;$ $\mathbf { v } ^ { \prime } \mathbf { v } - \alpha \pmb { \delta } _ { i }$ ; // inner step /\* outer gradient $\star /$ $\begin{array} { r } { \mathbf { G } _ { i } \frac { \mathrm { d } } { \mathrm { d } \mathbf { U } } \mathcal { L } ( \mathbf { U } , \mathbf { v } ^ { \prime } , \mathcal { D } _ { i } ^ { v a l } ) } \end{array}$ ; /\* outer step \*/ U ← U − η P G i ; i
|
| 104 |
+
|
| 105 |
+
automatically. This suggests a “hybrid” approach, where we bake-in equivariances we know to be useful, and learn the others. Indeed, we can directly reparameterize a standard convolution layer by reshaping $\mathrm { v e c } ( W )$ into a convolution filter bank rather than a weight matrix. By doing so we bake in translational equivariance, but we can still learn things like rotation equivariance from data.
|
| 106 |
+
|
| 107 |
+
# 4.2 PARAMETER SHARING AND GROUP CONVOLUTION
|
| 108 |
+
|
| 109 |
+
By properly choosing the symmetry matrix $U$ of Eq. 2, we can force the layer to implement arbitrary group convolutions (Eq. 1) by filter $v$ . Recall that group convolutions generalize standard convolution to define operations that are equivariant to other transformations, such as rotation. Hence by choosing $U$ properly we can enforce various equivariances, which will be preserved regardless of the value of $v$ .
|
| 110 |
+
|
| 111 |
+
Proposition 1 Suppose $G$ is a finite group $\{ g _ { 1 } , \dotsc , g _ { m } \}$ . There exists a $U ^ { G } \in \mathbb { R } ^ { m n \times n }$ such that for any $v \in \mathbb { R } ^ { n }$ , the layer with weights $\nu e c ( W ) = U ^ { G } v$ implements $G$ -convolution on input $x \in \mathbb { R } ^ { n }$ . Moreover, with this fixed choice of $U ^ { G }$ , any $G$ -convolution can be represented by a weight matrix $\nu e c ( W ) = U ^ { G } v$ for some $v \in \mathbb { R } ^ { n }$ .
|
| 112 |
+
|
| 113 |
+
Intuitively, $U$ can store the symmetry transformations $\pi ( g )$ for each $g \in G$ , thus capturing how the filters should transform during $G$ -convolution. For example, Fig. 2 shows how $U$ can implement convolution on the permutation group $S _ { 2 }$ . We present a proof in Appendix B.
|
| 114 |
+
|
| 115 |
+
Subject to having a correct $U ^ { G }$ , $v$ is precisely the convolution filter in a $G$ -convolution. This will motivate the notion of separately learning the convolution filter $v$ and the symmetry structure $U$ in the inner and outer loops of a meta-learning process, respectively.
|
| 116 |
+
|
| 117 |
+
<table><tr><td colspan="8">Synthetic Problems MSE (lower is better)</td></tr><tr><td rowspan="2">Method</td><td colspan="3">Small train dataset</td><td colspan="4">Large train dataset</td></tr><tr><td>k=1</td><td>k=2</td><td>k=5</td><td>k=1</td><td></td><td>k=2</td><td>k=5</td></tr><tr><td>MAML-FC</td><td>3.4±.60</td><td>2.1± .35</td><td>1.0±.10</td><td>3.4±.49</td><td>2.0±.27</td><td></td><td>1.1 ± .11</td></tr><tr><td>MAML-LC</td><td>2.9 ± .53</td><td>1.8 ± .24</td><td>.87±.08</td><td>2.9 ±.42</td><td>1.6 ± .23</td><td></td><td>.89±.08</td></tr><tr><td>MAML-Conv</td><td>.00± .00</td><td>.43 ± .09</td><td>.41 ± .04</td><td>.00 ± .00</td><td>.53 ± .08</td><td></td><td>.49 ± .04</td></tr><tr><td>MTSR-FC (Ours)</td><td>3.2±.49</td><td>1.4 ± .17</td><td>.86± .06</td><td>.12 ± .03</td><td>.07 ± .02</td><td></td><td>.07 ± .01</td></tr><tr><td>MSR-Joint-FC (Ours)</td><td>.25± .16</td><td>.12 ± .04</td><td>.21 ± .03</td><td>.01± .00</td><td>.08±.02</td><td></td><td>.12 ± .02</td></tr><tr><td>MSR-FC (Ours)</td><td>.07±.02</td><td>.07± .02</td><td>.16 ± .02</td><td>.00± .00</td><td>.05 ± .01</td><td></td><td>.09 ±.01</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 1: Meta-test MSE of different methods on synthetic data with (partial) translation symmetry. “Small” vs “large” train dataset refers to the number of examples per training task. Among methods with non-convolutional architectures, MSR-FC is closest to matching actual convolution (MAML-Conv) performance on translation equivariant $k = 1 \mathrm { \cdot }$ ) data. On data with less symmetry $k = 2 , 5$ ), MSR-FC outperforms MAML-Conv and other MAML approaches. MSR-Joint is an ablation of MSR where both $U$ and $v$ of Eq. 2 are updated on task train data, rather than just $v$ . MTSR is an ablation of MSR where we train the reparameterization using multi-task learning, rather than meta-learning. Results are shown with $9 5 \%$ confidence intervals over test tasks.
|
| 120 |
+
|
| 121 |
+
# 4.3 META-LEARNING EQUIVARIANCES
|
| 122 |
+
|
| 123 |
+
Meta-learning generally applies when we want to learn and exploit some shared structure in a distribution of tasks $p ( \mathcal T )$ . In this case, we assume the task distribution has some common underlying symmetry: i.e., models trained for each task should satisfy some set of shared equivariances. We extend gradient based meta-learning to automatically learn those equivariances.
|
| 124 |
+
|
| 125 |
+
Suppose we have an $L$ -layer network. We collect each layer’s symmetry matrix and filter parameters: $\mathbf { U } , { \bf { \dot { v } } } \gets \{ U ^ { 1 } , \cdots , U ^ { L } \} , \{ v ^ { 1 } , \cdot \cdot \cdot , v ^ { L } \}$ . Since we aim to learn equivariances that are shared across $p ( \mathcal { T } )$ ,the symmetry matrices should not change with the task. Hence, for any $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ the inner loop fixes $\mathbf { U }$ and only updates $\mathbf { v }$ using the task training data:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbf { v } ^ { \prime } \mathbf { v } - \alpha \nabla _ { \mathbf { v } } \mathcal { L } ( \mathbf { U } , \mathbf { v } , \mathcal { D } _ { i } ^ { t r } )
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
where $\mathcal { L }$ is simply the supervised learning loss, and $\alpha$ is the inner loop step size. During metatraining, the outer loop updates $\mathbf { U }$ by computing the loss on the task’s validation data using $\mathbf { v } ^ { \prime }$ :
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathbf { U } \gets \mathbf { U } - \eta \frac { \mathrm { d } } { \mathrm { d } \mathbf { U } } \mathcal { L } ( \mathbf { U } , \mathbf { v } ^ { \prime } , \mathcal { D } _ { i } ^ { v a l } )
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
We illustrate the inner and outer loop updates in Fig. 3. Note that in addition to meta-learning the symmetry matrices, we can also still meta-learn the filter initialization $\mathbf { v }$ as in prior work. In practice we also take outer updates averaged over mini-batches of tasks, as we describe in Alg. 1.
|
| 138 |
+
|
| 139 |
+
After meta-training is complete, we freeze the symmetry matrices U. On a new test task $\mathcal { T } _ { k } \sim p ( \mathcal { T } )$ , we use the inner loop (Eq. 3) to update only the filter $\mathbf { v }$ . The frozen $\mathbf { U }$ enforces meta-learned parameter sharing in each layer, which improves generalization by reducing the number of taskspecific inner loop parameters. For example, the sharing pattern of standard convolution makes the weight matrix constant along any diagonal, reducing the number of per-task parameters (see Fig. 1).
|
| 140 |
+
|
| 141 |
+
# 5 CAN WE RECOVER CONVOLUTIONAL STRUCTURE?
|
| 142 |
+
|
| 143 |
+
We now introduce a series of synthetic meta-learning problems, where each problem contains regression tasks that are guaranteed to have some symmetries, such as translation, rotation, or reflection. We combine meta-learning methods with general architectures not designed with these symmetries in mind to see whether each method can automatically meta-learn these equivariances.
|
| 144 |
+
|
| 145 |
+
# 5.1 LEARNING (PARTIAL) TRANSLATION SYMMETRY
|
| 146 |
+
|
| 147 |
+
Our first batch of synthetic problems contains tasks with translational symmetry: we generate outputs by feeding random input vectors through a 1-D locally connected (LC) layer with filter size 3 and no bias. Each task corresponds to different values of the LC filter, and the meta-learner must minimize mean squared error (MSE) after observing a single input-output pair. For each problem we constrain the LC filter weights with a rank $\bar { k \in \ \{ 1 , 2 , 5 \} }$ factorization, resulting in partial translation symmetry (Elsayed et al., 2020). In the case where rank $k = 1$ , the LC layer is equivalent to convolution (ignoring the biases) and thus generates exactly translation equivariant task data. We apply both MSR and MAML to this problem using a single fully connected layer (MSR-FC and MAML-FC), so these models have no translation equivariance built in and must meta-learn it to solve the tasks efficiently. For comparison, we also train convolutional and locally connected models with MAML (MAML-Conv and MAML-LC). Since MAML-Conv has built in translation equivariance, we expect it to at least perform well on the rank $k = 1$ problem.
|
| 148 |
+
|
| 149 |
+
We also ran two ablations of MSR that use the same reparameterization (Eq. 2) but vary the training procedure. In MSRJoint, we allow $U$ and $v$ to be jointly updated in the inner loop, instead of only updating $v$ in the inner loop. Hence MSRJoint is trained identically to MAML, but with reparameterized weights. MTSR is an ablation of MSR that trains using multi-task learning instead of meta-learning. Given data from training task $\mathcal { T } _ { i }$ , MTSR jointly optimizes $U$ (shared symmetry matrix) and $v ^ { ( i ) }$ (task specific filter parameters) using the MSE loss. For a new test task we freeze the optimized $U$ and optimize a newly initialized filter $v$ using the test task’s training data, then evaluate MSE on held out data. Even though the true filter that generates the data has width 3, for MSR and MTSR we initialize the learned filter $v$ to be the same size as the input, per Prop. 1. In principle, these methods should automatically meta-learn that the true filter is sparse, and to ignore the extra dimensions in $v$ . Appendix D.1 further explains the experimental setup.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 4: After observing translation equivariant data, MSR enforces convolutional parameter sharing on the weight matrix. An example weight matrix is shown above.
|
| 153 |
+
|
| 154 |
+
Table 1 shows how each method performs on each of the synthetic problems, with columns denoting the rank $k$ of the problem’s data. The “small vs large train dataset” results differ only in that the latter contains 5 or 10 times more examples per training task, depending on $k$ . On fully translation equivariant data $k = 1$ ), MAML-Conv performs best due to its architecture having built in translation equivariance. MSR-FC is the only non-convolutional architecture to perform comparably to MAML-Conv for $k = 1$ . Fig. 4 shows that MSR-FC has learned to produce weight matrices with convolutional parameter sharing structure, indicating it has “learned convolution” from the data. Appendix C.1 visualizes the meta-learned $U$ , which we find implements convolution as Sec. 4.2 predicted. Meanwhile, MAML-FC and MAML-LC perform significantly worse as they are unable to meta-learn this structure. On partially symmetric data $k = 2$ , $k = 5$ ), MSR-FC performs well due to its ability to flexibly meta-learn even partial symmetries. MAML-Conv performs worse here since the convolution assumption is overly restrictive, while MAML-FC and MAML-LC are not able to meta-learn much structure. MSR-Joint-FC performs comparably to or worse than MSR-FC across the board. Note that following prior work (Li et al., 2017), all methods use meta-learned inner learning rates on parameters that change in the inner loop. For MSR-Joint-FC we observe that the meta-learned inner loop learning rates corresponding to $U$ are significantly smaller than the inner learning rates corresponding to $v$ , suggesting that $U$ is changing relatively little in the inner loop (see Appendix Table 4). MTSR-FC performs significantly worse than MSR-FC with small training datasets, but performs comparably with large datasets. This indicates that although our reparameterization can be trained by either multi-task learning or meta-learning, the meta-learning approach (Alg. 1) is more efficient at learning from less data.
|
| 155 |
+
|
| 156 |
+
# 5.2 LEARNING EQUIVARIANCE TO ROTATIONS AND FLIPS
|
| 157 |
+
|
| 158 |
+
We also created synthetic problems with 2-D synthetic image inputs and outputs, in order to study rotation and flip equivariance. We generate task data by passing randomly generated inputs through a single layer E(2)-equivariant steerable CNN (Weiler and Cesa, 2019) configured to be equivariant to combinations of translations, discrete rotations by increments of $4 5 ^ { \circ }$ , and reflections. Hence our synthetic task data contains rotation and reflection in addition to translation symmetry. Each task corresponds to different values of the data-generating network’s weights. We apply MSR and MAML to a single standard con
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan=1 colspan=3>Rotation/Flip Equivariance MSE</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Rot</td><td rowspan=1 colspan=1>Rot+Flip</td></tr><tr><td rowspan=1 colspan=1>MAML-ConvMSR-Conv (Ours)</td><td rowspan=1 colspan=1>.504.004</td><td rowspan=1 colspan=1>.507.001</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 2: MSR learns rotation and flip equivariant parameter sharing on top of a standard convolution model, and thus achieves much better generalization error on meta-test tasks compared to MAML on rotation and flip equivariant data.
|
| 163 |
+
|
| 164 |
+
volution layer, which guarantees translation equivariance.
|
| 165 |
+
|
| 166 |
+
Each method must still meta-learn rotation and reflection (flip) equivariance from the data. Table 2 shows that MSR easily learns rotation and rotation+reflection equivariance on top of the convolutional model’s built in translational equivariance. Appendix C.2 visualizes the filters MSR produces, which we see are rotated and/or flipped versions of the same filter.
|
| 167 |
+
|
| 168 |
+
# 6 CAN WE LEARN INVARIANCES FROM AUGMENTED DATA?
|
| 169 |
+
|
| 170 |
+
Practitioners commonly use data augmentation to train their models to have certain invariances. Since invariance is a special case of equivariance, we can also view data augmentation as a way of learning equivariant models. The downside is that we need augmented data for each task. While augmentation is often possible during meta-training, there are many situations where it is impractical at meta-test time. For example, in robotics we may meta-train a robot in simulation and then deploy (meta-test) in the real world, a kind of sim2real transfer strategy (Song et al., 2020). During meta-training we can augment data using the simulated environ
|
| 171 |
+
|
| 172 |
+
# Algorithm 2: Augmentation Meta-Training
|
| 173 |
+
|
| 174 |
+
input: $\{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { N }$ : Meta-training tasks
|
| 175 |
+
input: META-TRAIN: Any meta-learner
|
| 176 |
+
input: AUGMENT: Data augmenter
|
| 177 |
+
forall $\mathcal { T } _ { i } \in \{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { N }$ do $\{ \mathcal { D } _ { i } ^ { t r } , \mathcal { D } _ { i } ^ { v a l } \} \mathcal { T } _ { i }$ ; // task data split
|
| 178 |
+
$\begin{array} { r l } & { \hat { \mathcal { D } } _ { i } ^ { v a l } \gets \mathrm { A U G M E N T } \big ( \mathcal { D } ^ { v a l } \big ) ; } \\ & { \hat { \mathcal { T } } _ { i } \gets \{ \mathcal { D } ^ { t r } , \hat { \mathcal { D } } _ { i } ^ { v a l } \} } \\ & { \mathbf { M } \mathrm { E T A - T R A I N } \Big ( \{ \hat { \mathcal { T } } _ { i } \} _ { i = 1 } ^ { N } \Big ) } \end{array}$
|
| 179 |
+
|
| 180 |
+
ment, but we cannot do the same at meta-test time in the real world. Can we instead use MSR to learn equivariances from data augmentation at training time, and encode those learned equivariances into the network itself? This way, the network would preserve learned equivariances on new meta-test tasks without needing any additional data augmentation.
|
| 181 |
+
|
| 182 |
+
Alg. 2 describes our approach for meta-learning invariances from data augmentation, which wraps around any meta-learning algorithm using generic data augmentation procedures. Recall that each task is split into training and validation data $\mathcal { T } _ { i } = \{ \mathcal { D } _ { i } ^ { t r } , \mathcal { D } _ { i } ^ { v a l } \}$ . We use the data augmentation procedure to only modify the validation data, producing a new validation dataset $\hat { \mathcal { D } } _ { i } ^ { v a l }$ for each task. We re-assemble each modified task $\hat { \mathcal { T } } _ { i } \gets \{ \mathcal { D } _ { i } ^ { t r } , \hat { \mathcal { D } } _ { i } ^ { v a l } \}$ . So for each task, the meta-learner observes unaugmented training data, but must generalize to augmented validation data. This forces the model to be invariant to the augmentation transforms without actually seeing any augmented training data.
|
| 183 |
+
|
| 184 |
+
We apply this augmentation strategy to Omniglot (Lake et al., 2015) and MiniImagenet (Vinyals et al., 2016) few shot classification to create the Aug-Omniglot and Aug-MiniImagenet benchmarks. Our data augmentation function contains a combination of random rotations, flips, and resizes (rescaling), which we only apply to task validation data as described above. The problem is set up analogous to (Finn et al., 2017): for each task, the model must classify images into one of either 5 or 20 classes ( $\cdot n$ -way) and receives either 1 or 5 examples of each class in the task training data ( $k$ -shot). Unlike Finn et al. (2017) our Aug-Omniglot and Aug-MiniImagenet benchmarks contain transformed task validation data.
|
| 185 |
+
|
| 186 |
+
We tried combining Alg. 2 with our MSR method and three other meta-learning algorithms: MAML (Finn et al., 2017), ANIL (Raghu et al., 2019), and Prototypical Networks (ProtoNets) (Snell et al., 2017). While the latter three methods all have the potential to learn equivariant features through Alg. 2, we hypothesize that since MSR enforces learned equivariance through its symmetry matrices it should outperform these feature-metalearning methods. We also paired MAML with a model that has built in equivariance to the group D8 $4 5 ^ { \circ }$ -increment rotation and reflections) using the E2-CNN library (Weiler and Cesa, 2019). We call this baseline “MAML $+ \mathrm { D } 8 ^ { \circ }$ . Appendix D.3 describes the experimental setup and methods implementations in more detail.
|
| 187 |
+
|
| 188 |
+
Table 3 shows each method’s meta-test accuracies on both benchmarks. Across different settings MSR performs either comparably to the best method, or the best. MAML and ANIL perform similarly to each other, and usually worse than MSR, suggesting that learning equivariant or invariant features is not as helpful as learning equivariant layer structures. ProtoNets perform well on the easier Aug-Omniglot benchmark, but evidently struggle with learning a transformation invariant metric space on the harder Aug-MiniImagenet problems. MSR even outperforms the architecture with built in rotation and reflection symmetry (MAML $+ \mathrm { D 8 }$ ) across the board. MSR’s advantage may be due to the additional presence of scaling transformations in the image data; we are not aware of architectures that build in rotation, reflection, and scaling equivariance at the time of writing. Note that MSR’s reparameterization increases the number of meta-learned parameters at each layer, so MSR models contain more total parameters than corresponding MAML models. The “MAML (Big)” results show MAML performance with very large models containing more total parameters than the corresponding MSR models. The results show that MSR also outperforms these larger MAML models despite having fewer total parameters.
|
| 189 |
+
|
| 190 |
+
Table 3: Meta-test accuracies on Aug-Omniglot and Aug-MiniImagenet few-shot classification. These benchmarks test generalization to augmented validation data from un-augmented training data. MSR performs comparably to or better than other methods under this augmented regime. Results are shown with $9 5 \%$ confidence intervals over test tasks.
|
| 191 |
+
|
| 192 |
+
<table><tr><td></td><td colspan="4">Aug-Omniglot</td><td colspan="2">Aug-MiniImagenet</td></tr><tr><td>Method</td><td colspan="2">5 way</td><td colspan="2">20 way</td><td colspan="2">5 way</td></tr><tr><td></td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MAML</td><td>87.3± 0.5</td><td>93.6± 0.3</td><td>67.0± 0.4</td><td>79.9 ± 0.3</td><td>42.5 ± 1.1</td><td>61.5 ± 1.0</td></tr><tr><td>MAML (Big)</td><td>89.3 ±0.4</td><td>94.8± 0.3</td><td>69.6±0.4</td><td>83.2 ± 0.3</td><td>37.2 ± 1.1</td><td>63.2 ± 1.0</td></tr><tr><td>ANIL</td><td>86.4±0.5</td><td>93.2 ± 0.3</td><td>67.5 ± 3.5</td><td>79.8 ± 0.3</td><td>43.0 ± 1.1</td><td>62.3 ±1.0</td></tr><tr><td>ProtoNets</td><td>92.9 ± 0.4</td><td>97.4±0.2</td><td>85.1 ± 0.3</td><td>94.3 ± 0.2</td><td>34.6± 0.5</td><td>54.5 ± 0.6</td></tr><tr><td>MAML + D8</td><td>94.6± 0.4</td><td>96.4± 0.3</td><td>82.6 ± 0.3</td><td>85.1 ± 0.3</td><td>44.9 ± 1.2</td><td>56.8 ±1.1</td></tr><tr><td>MSR (Ours)</td><td>95.3 ± 0.3</td><td>97.7 ± 0.2</td><td>84.3± 0.2</td><td>92.6± 0.2</td><td>45.5 ± 1.1</td><td>65.2 ± 1.0</td></tr></table>
|
| 193 |
+
|
| 194 |
+
# 7 DISCUSSION AND FUTURE WORK
|
| 195 |
+
|
| 196 |
+
We introduce a method for automatically meta-learning equivariances in neural network models, by encoding learned equivariance-inducing parameter sharing patterns in each layer. On new tasks, these sharing patterns reduce the number of task-specific parameters and improve generalization. Our experiments show that this method can improve few-shot generalization on task distributions with shared underlying symmetries. We also introduce a strategy for meta-training invariances into networks using data augmentation, and show that it works well with our method. By encoding equivariances into the network as a parameter sharing pattern, our method has the benefit of preserving learned equivariances on new tasks so it can learn more efficiently.
|
| 197 |
+
|
| 198 |
+
Machine learning thus far has benefited from exploiting human knowledge of problem symmetries, and we believe this work presents a step towards learning and exploiting symmetries automatically. This work leads to numerous directions for future investigation. In addition to generalization benefits, standard convolution is practical since it exploits the parameter sharing structure to improve computational efficiency, relative to a fully connected layer of the same input/output dimensions. While MSR we can improve computational efficiency by reparameterizing standard convolution layers, it does not exploit learned structure to further optimize its computation. Can we automatically learn or find efficient implementations of these more structured operations? Additionally, MSR is focused on learning finite symmetry groups, while approximating infinite ones (e.g., learning $4 5 ^ { \circ }$ - increment rotation symmetry as an approximation to continuous rotation symmetry). Unfortunately, the number of parameters increases with the resolution of the approximation, so further research would be useful in discovering more scalable methods of approximating and learning continuous symmetries. Finally, our method is best for learning symmetries which are shared across a distribution of tasks. Further research on quickly discovering symmetries which are particular to a single task would make deep learning methods significantly more useful on many difficult real world problems.
|
| 199 |
+
|
| 200 |
+
# ACKNOWLEDGEMENTS
|
| 201 |
+
|
| 202 |
+
We would like to thank Sam Greydanus, Archit Sharma, and Yiding Jiang for reviewing and critiquing earlier drafts of this paper. This work was supported in part by Google. CF is a CIFAR Fellow.
|
| 203 |
+
|
| 204 |
+
REFERENCES
|
| 205 |
+
F. Alet, T. Lozano-Perez, and L. P. Kaelbling. Modular meta-learning. ´ arXiv preprint arXiv:1806.10166, 2018.
|
| 206 |
+
A. Antoniou, H. Edwards, and A. Storkey. How to train your maml. arXiv preprint arXiv:1810.09502, 2018.
|
| 207 |
+
S. Bengio, Y. Bengio, J. Cloutier, and J. Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, volume 2. Univ. of Texas, 1992.
|
| 208 |
+
G. Benton, M. Finzi, P. Izmailov, and A. G. Wilson. Learning invariances in neural networks. arXiv preprint arXiv:2010.11882, 2020.
|
| 209 |
+
D. Beymer and T. Poggio. Face recognition from one example view. In Proceedings of IEEE International Conference on Computer Vision, pages 500–507. IEEE, 1995.
|
| 210 |
+
A. Brock, T. Lim, J. M. Ritchie, and N. Weston. Smash: one-shot model architecture search through hypernetworks. arXiv preprint arXiv:1708.05344, 2017.
|
| 211 |
+
T. Cohen and M. Welling. Group equivariant convolutional networks. In International conference on machine learning, pages 2990–2999, 2016.
|
| 212 |
+
T. S. Cohen, M. Weiler, B. Kicanaoglu, and M. Welling. Gauge equivariant convolutional networks and the icosahedral cnn. arXiv preprint arXiv:1902.04615, 2019.
|
| 213 |
+
M. Cranmer, S. Greydanus, S. Hoyer, P. Battaglia, D. Spergel, and S. Ho. Lagrangian neural networks. arXiv preprint arXiv:2003.04630, 2020.
|
| 214 |
+
E. D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q. V. Le. Autoaugment: Learning augmentation ´ policies from data. corr abs/1805.09501 (2018). arXiv preprint arXiv:1805.09501, 2018.
|
| 215 |
+
T. Deleu, T. Wurfl, M. Samiei, J. P. Cohen, and Y. Bengio. Torchmeta: A Meta-Learning li- ¨ brary for PyTorch, 2019. URL https://arxiv.org/abs/1909.06576. Available at: https://github.com/tristandeleu/pytorch-meta.
|
| 216 |
+
N. Diaconu and D. E. Worrall. Learning to convolve: A generalized weight-tying approach. arXiv preprint arXiv:1905.04663, 2019.
|
| 217 |
+
A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 218 |
+
D. S. Dummit and R. M. Foote. Abstract algebra, volume 3. Wiley Hoboken, 2004.
|
| 219 |
+
G. F. Elsayed, P. Ramachandran, J. Shlens, and S. Kornblith. Revisiting spatial invariance with low-rank local connectivity. arXiv preprint arXiv:2002.02959, 2020.
|
| 220 |
+
T. Elsken, J. H. Metzen, and F. Hutter. Neural architecture search: A survey. arXiv preprint arXiv:1808.05377, 2018.
|
| 221 |
+
C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1126–1135. JMLR. org, 2017.
|
| 222 |
+
S. Flennerhag, A. A. Rusu, R. Pascanu, H. Yin, and R. Hadsell. Meta-learning with warped gradient descent. arXiv preprint arXiv:1909.00025, 2019.
|
| 223 |
+
R. Gens and P. M. Domingos. Deep symmetry networks. In Advances in neural information processing systems, pages 2537–2545, 2014.
|
| 224 |
+
A. Graves and N. Jaitly. Towards end-to-end speech recognition with recurrent neural networks. In International conference on machine learning, pages 1764–1772, 2014.
|
| 225 |
+
E. Grefenstette, B. Amos, D. Yarats, P. M. Htut, A. Molchanov, F. Meier, D. Kiela, K. Cho, and S. Chintala. Generalized inner loop meta-learning. arXiv preprint arXiv:1910.01727, 2019.
|
| 226 |
+
S. Greydanus, M. Dzamba, and J. Yosinski. Hamiltonian neural networks. In Advances in Neural Information Processing Systems, pages 15353–15363, 2019.
|
| 227 |
+
D. Ha, A. Dai, and Q. V. Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 228 |
+
A. Hannun, C. Case, J. Casper, B. Catanzaro, G. Diamos, E. Elsen, R. Prenger, S. Satheesh, S. Sengupta, A. Coates, et al. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014.
|
| 229 |
+
S. Hochreiter, A. S. Younger, and P. R. Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pages 87–94. Springer, 2001.
|
| 230 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 231 |
+
T. G. Kolda and B. W. Bader. Tensor decompositions and applications. SIAM review, 51(3):455–500, 2009.
|
| 232 |
+
R. Kondor and S. Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups, 2018.
|
| 233 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012.
|
| 234 |
+
B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 235 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 236 |
+
Y. Lee and S. Choi. Gradient-based meta-learning with learned layerwise metric and subspace. arXiv preprint arXiv:1801.05558, 2018.
|
| 237 |
+
Z. Li, F. Zhou, F. Chen, and H. Li. Meta-sgd: Learning to learn quickly for few-shot learning. arXiv preprint arXiv:1707.09835, 2017.
|
| 238 |
+
H. Liu, K. Simonyan, and Y. Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018a.
|
| 239 |
+
R. Liu, J. Lehman, P. Molino, F. P. Such, E. Frank, A. Sergeev, and J. Yosinski. An intriguing failing of convolutional neural networks and the coordconv solution. In Advances in Neural Information Processing Systems, pages 9605–9616, 2018b.
|
| 240 |
+
J. Lorraine, P. Vicol, and D. Duvenaud. Optimizing millions of hyperparameters by implicit differentiation. arXiv preprint arXiv:1911.02590, 2019.
|
| 241 |
+
J. Martens and R. Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In International conference on machine learning, pages 2408–2417, 2015.
|
| 242 |
+
P. Niyogi, F. Girosi, and T. Poggio. Incorporating prior information in machine learning by creating virtual examples. Proceedings of the IEEE, 86(11):2196–2209, 1998.
|
| 243 |
+
E. Park and J. B. Oliva. Meta-curvature. In Advances in Neural Information Processing Systems, pages 3309–3319, 2019.
|
| 244 |
+
A. Raghu, M. Raghu, S. Bengio, and O. Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. arXiv preprint arXiv:1909.09157, 2019.
|
| 245 |
+
S. Ravanbakhsh, J. Schneider, and B. Poczos. Equivariance through parameter-sharing. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 2892–2901. JMLR. org, 2017.
|
| 246 |
+
O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 247 |
+
A. A. Rusu, D. Rao, J. Sygnowski, O. Vinyals, R. Pascanu, S. Osindero, and R. Hadsell. Metalearning with latent embedding optimization. arXiv preprint arXiv:1807.05960, 2018.
|
| 248 |
+
J. Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The meta-meta-... hook.) Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1:2, 1987.
|
| 249 |
+
J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992.
|
| 250 |
+
J. Shawe-Taylor. Building symmetries into feedforward networks. In 1989 First IEE International Conference on Artificial Neural Networks,(Conf. Publ. No. 313), pages 158–162. IET, 1989.
|
| 251 |
+
J. Snell, K. Swersky, and R. Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pages 4077–4087, 2017.
|
| 252 |
+
X. Song, Y. Yang, K. Choromanski, K. Caluwaerts, W. Gao, C. Finn, and J. Tan. Rapidly adaptable legged robots via evolutionary meta-learning. arXiv preprint arXiv:2003.01239, 2020.
|
| 253 |
+
K. O. Stanley and R. Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
|
| 254 |
+
K. O. Stanley, D. B. D’Ambrosio, and J. Gauci. A hypercube-based encoding for evolving largescale neural networks. Artificial life, 15(2):185–212, 2009.
|
| 255 |
+
S. Thrun and L. Pratt. Learning to learn. Springer Science & Business Media, 2012.
|
| 256 |
+
M. van der Wilk, M. Bauer, S. John, and J. Hensman. Learning invariances using the marginal likelihood. In Advances in Neural Information Processing Systems, pages 9938–9948, 2018.
|
| 257 |
+
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998–6008, 2017.
|
| 258 |
+
O. Vinyals, C. Blundell, T. Lillicrap, D. Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pages 3630–3638, 2016.
|
| 259 |
+
M. Weiler and G. Cesa. General e (2)-equivariant steerable cnns. In Advances in Neural Information Processing Systems, pages 14334–14345, 2019.
|
| 260 |
+
D. Worrall and M. Welling. Deep scale-spaces: Equivariance over scale. In Advances in Neural Information Processing Systems, pages 7364–7376, 2019.
|
| 261 |
+
D. E. Worrall, S. J. Garbin, D. Turmukhambetov, and G. J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5028–5037, 2017.
|
| 262 |
+
M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola. Deep sets. In Advances in neural information processing systems, pages 3391–3401, 2017.
|
| 263 |
+
B. Zoph and Q. V. Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 264 |
+
|
| 265 |
+
# A APPROXIMATION AND TRACTABILITY
|
| 266 |
+
|
| 267 |
+
# A.1 FULLY CONNECTED
|
| 268 |
+
|
| 269 |
+
From Eq. 2 we see that for a layer with $m$ output units, $n$ input units, and $k$ filter parameters the symmetry matrix $U$ has mnk entries. This is too expensive for larger layers, so in practice, we need a factorized reparameterization to reduce memory and compute requirements when $k$ is larger.
|
| 270 |
+
|
| 271 |
+
For fully connected layers, we use a Kronecker factorization to scalably reparameterize each layer. First, we assume that the filter parameters $v \in \mathbb { R } ^ { k l }$ can be arranged in a matrix $V \in \mathbb { R } ^ { k \times l }$ . Then we reparameterize each layer’s weight matrix $W$ similar to Eq. 2, but assume the symmetry matrix is the Kronecker product of two smaller matrices:
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\begin{array} { r } { \mathbf { v e c } ( W ) = ( U _ { 1 } \otimes U _ { 2 } ) \mathbf { v e c } ( V ) , \quad U _ { 1 } \in \mathbb { R } ^ { n \times l } , U _ { 2 } \in \mathbb { R } ^ { m \times k } } \end{array}
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
Since we only store the two Kronecker factors $U _ { 1 }$ and $U _ { 2 }$ , we reduce the memory requirements of $U$ from mnkl to $m k + n l$ . In our experiments we generally choose $V \in \mathbb { R } ^ { m \times n }$ so $U _ { 1 } \in \mathbb { R } ^ { n \times n }$ and $U _ { 2 } \in \mathbb { R } ^ { m \times m }$ . Then the actual memory cost of each reparameterized layer (including both $U$ and $v$ ) is $m ^ { 2 } + n ^ { 2 } + m n$ , compared to mn for a standard fully connected layer. So in the case where $m \approx n$ , MSR increases memory cost by roughly a constant factor of 3.
|
| 278 |
+
|
| 279 |
+
After approximation MSR also increases computation time (forward and backward passes) by roughly a constant factor of 3 compared to MAML. A standard fully connected layer requires a single matrix-matrix multiply $Y = W X$ in the forward pass (here $Y$ and $X$ are matrices since inputs and outputs are in batches). Applying the Kronecker-vec trick to Eq. 5 gives:
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
W = U _ { 1 } V U _ { 2 } ^ { T } \iff \operatorname { v e c } ( W ) = ( U _ { 1 } \otimes U _ { 2 } ) \mathbf { v e c } ( V )
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
So rather than actually forming the (possibly large) symmetry matrix $U _ { 1 } \otimes U _ { 2 }$ , we can directly construct $W$ simply using 2 additional matrix-matrix multiplies $W = U _ { 1 } V U _ { 2 } ^ { T }$ . Again assuming $V \in \mathbb { R } ^ { m \times n }$ and $m \approx n$ , each matrix in the preceding expression is approximately the same size as $W$ .
|
| 286 |
+
|
| 287 |
+
# A.2 2D CONVOLUTION
|
| 288 |
+
|
| 289 |
+
When reparameterizing 2-D convolutions, we need to produce a filter (a rank-4 tensor $W \in$ $\mathbb { R } ^ { C _ { o } \times C _ { i } \times \mathbf { \bar { H } } \times W } )$ . We assume the filter parameters are stored in a rank 3 tensor $V \in \mathbb { R } ^ { p \times q \times s }$ , and factorize the symmetry matrix $U$ into three separate matrices $U _ { 1 } \in \mathbb { R } ^ { C _ { o } \times p } , U _ { 2 } \in \mathbb { R } ^ { C _ { i } \times q }$ and $U _ { 3 } \in \mathbb { R } ^ { H W \times s }$ . A similar Kronecker product approximation gives:
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { r } { \tilde { W } = V \times _ { 1 } U _ { 1 } \times _ { 2 } U _ { 2 } \times _ { 3 } U _ { 3 } , \quad \tilde { W } \in \mathbb { R } ^ { C _ { o } \times C _ { i } \times H W } } \\ { W = \mathrm { r e s h a p e } ( \tilde { W } ) , \quad W \in \mathbb { R } ^ { C _ { i } \times C _ { i } \times H \times W } } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
where $\times _ { n }$ represents $n$ -mode tensor multiplication (Kolda and Bader, 2009). Just as in the fully connected case, this convolution reparameterization is equivalent to a Kronecker factorization of the symmetry matrix $U$ .
|
| 296 |
+
|
| 297 |
+
An analysis of the memory and computation requirements of reparameterized convolution layers proceeds similarly to the above analysis for the fully connected case. As we describe below, in our augmented experiments using convolutional models each MSR outer step takes roughly $3 0 \% - 4 0 \%$ longer than a MAML outer step.
|
| 298 |
+
|
| 299 |
+
In practice, for any experiment where we reparameterize a standard 2-D convolution with weights $\boldsymbol { W } ^ { \bullet } \in \mathbb { R } ^ { C _ { o } \times C _ { i } \times H \times W }$ , we choose $p = C _ { o } , q = C _ { i }$ , and $s = H W$ . Equivalently, we choose $V \in$ $\mathbb { R } ^ { C _ { o } \times C _ { i } \times H W }$ . Although not necessary, this choice conveniently makes the matrices $U _ { 1 } , U _ { 2 }$ and $U _ { 3 }$ into square matrices, which we can initialize to identity matrices at the start of meta-learning.
|
| 300 |
+
|
| 301 |
+
# B PROOF OF PROPOSITION 1
|
| 302 |
+
|
| 303 |
+
To show the connection with the existing literature, we first present a slightly generalised definition of $G$ -convolution that is more common in the existing literature. We instead model an input signal as a function $f : X \to \mathbb { R }$ on some underlying space $X$ . We then consider a finite group $G =$ $\{ g _ { 1 } , \ldots , g _ { n } \}$ of symmetries acting transitively on $X$ , over which we desire $G$ -equivariance. Many (but not all) of the groups discussed in (Weiler and Cesa, 2019) are finite groups of this form.
|
| 304 |
+
|
| 305 |
+
It is proven by (Kondor and Trivedi, 2018) that a function $\phi$ is equivariant to $G$ if and only if it is a $G$ -convolution on this space. In the domain of finite groups, we can consider a slight simplification of this notion: a finite “ $\cdot _ { G }$ cross-correlation” of $f$ with a filter $\psi : X \to \mathbb { R }$ . This is defined by (Cohen and Welling, 2016) as:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
[ \phi ( f ) ] ( g ) = ( f \star \psi ) ( g ) = \sum _ { x \in X } f ( x ) \psi ( g ^ { - 1 } x ) . ^ { 2 }
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
We can now connect this notion with the linear layer, as described in our paper. First, in order for a fully connected layer’s weight matrix $W$ to act on function $f$ , we must first assume that $f$ has finite support $\{ x _ { 1 } , \ldots , x _ { s } \}$ —i.e. $f ( x )$ is only non-zero at these $s$ points within $X$ . This means that $f$ can be represented as a “dual” vector $\overline { { f } } \in \mathbb R ^ { s }$ given by ${ \overline { { f } } } _ { i } = f ( x _ { i } )$ , on which $W$ can act.3
|
| 312 |
+
|
| 313 |
+
We aim to show a certain value of $U ^ { G } \in \mathbb { R } ^ { n s \times s }$ allows arbitrary $G$ cross-correlations—and only $G$ cross-correlations—to be represented by fully connected layers with weight matrices of the form
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\mathrm { v e c } ( W ) = U ^ { G } v ,
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
where $v \in \mathbb { R } ^ { s }$ is any arbitrary vector of appropriate dimension. The reshape specifically gives $W \in \mathbb { R } ^ { n \times s }$ , which transforms the vector $\overline { { f } } \in \mathbb R ^ { s }$ .
|
| 320 |
+
|
| 321 |
+
With this in mind, we first use that the action of the group can be represented as a matrix transformation on this vector space, using the matrix representation $\pi$ :
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
[ \pi ( g ) \overline { { f } } ] _ { i } = f ( g ^ { - 1 } x _ { i } )
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where notably $\pi ( g ) \in \mathbb { R } ^ { s \times s }$ .
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 5: The theoretical convolutional weight symmetry matrix for the group $\langle g \rangle \ \cong$ $C _ { 4 }$ , where $g$ is a $\frac { N \pi } { 2 }$ -radian rotation of a 3x3 image $N \in$ $\{ 0 , 1 , 2 , 3 \}$ . Notice that the image is flattened into a length 9 vector. The matrix $\pi ( g )$ describes the action of a $\frac { N \pi } { 2 }$ radian rotation on this image.
|
| 331 |
+
|
| 332 |
+
We consider $U ^ { G } \in \mathbb { R } ^ { n s \times s }$ , and $v \in \mathbb { R } ^ { s }$ . Since $v \in \mathbb { R } ^ { s }$ , we can also treat $v$ as a the “dual” vector of a function ${ \hat { v } } : X \to \mathbb { R }$ with support $\{ x _ { 1 } , \ldots , x _ { s } \}$ , described by $\hat { v } ( x _ { i } ) = v _ { i }$ . We can interpret $\hat { v }$
|
| 333 |
+
|
| 334 |
+
as a convolutional filter, just like $\psi$ in Eq. 9. $W$ then acts on $v$ just as it acts on $\overline { { f } }$ , namely:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
[ \pi ( g ) v ] _ { i } = \hat { v } ( g ^ { - 1 } x _ { i } ) .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Now, we define $U ^ { G }$ by stacking the matrix representations of $g _ { i } \in G$
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
U ^ { G } = \left[ \overbrace { \begin{array} { c } { \vdots } \\ { \pi ( g _ { n } ) } \end{array} } ^ { \pi ( g _ { 1 } ) } \right]
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
which implies the following value of $W$ :
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
W = { \mathrm { r e s h a p e } } ( U ^ { G } v ) = { \mathrm { r e s h a p e } } \left( { \left[ \begin{array} { l } { \qquad | } \\ { \pi ( g _ { 1 } ) v } \\ { \qquad | } \\ { \qquad \vdots } \\ { \pi ( g _ { n } ) v } \\ { \qquad | } \end{array} \right] } \right) = { \left[ \begin{array} { l l l } { \qquad - } & { \pi ( g _ { 1 } ) v } & { - } \\ { \qquad \vdots } & { \qquad \vdots } \\ { \qquad \pi ( g _ { n } ) v } & { - } \end{array} \right] }
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
<table><tr><td colspan="7">Meta-learned LRs on synthetic problems</td></tr><tr><td rowspan="2">Variable</td><td colspan="3">Small traindataset</td><td colspan="3">Large train dataset</td></tr><tr><td>k=1</td><td>k=2</td><td>k=5</td><td>k=1</td><td>k=2</td><td>k=5</td></tr><tr><td>U</td><td>-0.017</td><td>-0.011</td><td>-0.052</td><td>-0.009</td><td>-0.021</td><td>-0.039</td></tr><tr><td>U</td><td>+0.241</td><td>+0.326</td><td>+0.401</td><td>+0.241</td><td>+0.307</td><td>+0.312</td></tr></table>
|
| 353 |
+
|
| 354 |
+
Table 4: In the ablation “MSR-Joint-FC” of Sec. 4 we jointly updated $U$ and $v$ in the inner loop with metalearned inner loop learning rates for each. This is in contrast with standard MSR, where only $v$ is updated in the inner loop (also with a meta-learned learning rate), and $U$ is only updated in the outer loop. The inner learning rates were initialized at 0.02 for all variables. The table shows the inner loop learning rates at the end of training. The relative magnitudes suggest that $v$ is being updated significantly more than $U$ in the inner loop.
|
| 355 |
+
|
| 356 |
+
This then grants that the output of the fully connected layer with weights $W$ is:
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
( W \overline { { { f } } } ) _ { i } = \sum _ { j = 1 } ^ { s } ( \pi ( g _ { i } ) v ) _ { j } \overline { { { f } } } _ { j } .
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
Using that $f$ has finite support $\{ x _ { 1 } , \ldots , x _ { s } \}$ , and that $( \pi ( g _ { i } ) v ) _ { j } = \hat { v } ( g _ { i } ^ { - 1 } x _ { j } )$ , we have that:
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
( W \overline { { { f } } } ) _ { i } = \sum _ { j = 1 } ^ { s } \hat { v } ( g _ { i } ^ { - 1 } x _ { j } ) f ( x _ { j } ) = \sum _ { x \in X } \hat { v } ( g _ { i } ^ { - 1 } x ) f ( x ) .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
Lastly, we can interpret $W _ { G } { \overline { { f } } }$ as a function $\phi ^ { G } ( f )$ mapping each $g _ { i } \in G$ to its $i ^ { \mathrm { { t h } } }$ component:
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
[ \phi ^ { G } ( f ) ] ( g _ { i } ) = ( W \overline { { f } } ) _ { i } = \sum _ { x \in X } \hat { v } ( g _ { i } ^ { - 1 } x ) f ( x )
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
which is precisely the cross-correlation as described in Eq. 9 with filter $\psi = \hat { v }$ . This implies that φG must be equivariant with respect to $G$ . Moreover, all such $G$ -equivariant functions are $G$ crosscorrelations parameterized by $v$ , so with $U ^ { G }$ fixed as in Eq.-13, we have that $W = U ^ { G } v$ can represent all $G$ -equivariant functions.
|
| 375 |
+
|
| 376 |
+
This means that if $v$ is chosen to have the same dimension as the input, and the weight symmetry matrix is sufficiently large, any equivariance to a finite group can be meta-learned using this approach. Moreover, in this case the symmetry matrix has a very natural and interpretable structure, containing a representation of the group in block submatrices—this structure is seen in practice in our synthetic experiments. Lastly, notice that $v$ corresponds (dually) to the convolutional filter, justifying the notion that we learn the convolutional filter in the inner loop, and the group action in the outer group.
|
| 377 |
+
|
| 378 |
+
In the above proof, we’ve used the original definition of group convolution (Cohen and Welling, 2016) for the sake of simplicity. It is useful to note that a slight generalization of the proof applies for more general equivariance between representations, as defined in equation (3.3)—(i.e. the case when $\pi ( g )$ is an arbitrary linear transformation, and not necessarily of the form $\pi ( g ) f ( x ) = f ( g ^ { - 1 } x ) .$ ) This is subject to a unitarity condition on the group representation (Worrall and Welling, 2019).
|
| 379 |
+
|
| 380 |
+
Without any modification to the method, arbitrary linear approximations to group convolution can be learnt when the representation is not a permutation of the indices. For example, non axis-aligned rotations can be easily approximated through both bilinear and bicubic interpolation, whereby the value of a pixel $x$ after rotation is a linear interpolation of the 4 or 16 pixels nearest to the “true” value of this pixel before rotation $g ^ { - 1 } x$ . Practically, this allows us to approximate equivariance to 45 degree rotations of 2D images, for which there don’t exist representations of the form in Eq. 12.
|
| 381 |
+
|
| 382 |
+
# C FURTHER SYNTHETIC EXPERIMENT RESULTS
|
| 383 |
+
|
| 384 |
+
# C.1 VISUALIZING TRANSLATION EQUIVARIANT SYMMETRY MATRICES
|
| 385 |
+
|
| 386 |
+
Fig. 6 visualizes the actual symmetry matrix $U$ that MSR-FC meta-learns from translation equivariant data. Each column is one of the submatrices $\pi ( i )$ corresponding to the action of the discrete translation group element $i \in \mathbb Z$ on the filter $v$ . In other words, MSR automatically meta-learned $U$ to contain these submatrices $\pi ( i )$ such that each $\pi ( i )$ translates the filter by $i$ spaces, effectively meta-learning standard convolution! In the actual symmetry matrix the submatrices are stacked on top of each other as in Eq. 13, but we display each submatrix side-by-side for easy visualization. The figure is also cropped for space: there are a total of 68 submatrices but we show only the first 20, and each submatrix is cropped from $7 0 \times 3$ to $2 2 \times 3$ .
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Meta-learned symmetry matrix representations
|
| 390 |
+
Figure 6: The submatrices of the meta-learned symmetry matrix of MSR-FC on the translation equivariant problem (Sec. 5.1). Intensity corresponds to each entry’s absolute value. We see that the symmetry matrix has been meta-learned to implement standard convolution: each $\pi ( i )$ translates the size filter $v \in \mathbb { R } ^ { 3 }$ by $i$ spaces. Note that in actuality the submatrices are stacked on top of each other in $U$ as in Eq. 13, but we display them side-by-side for visualization.
|
| 391 |
+
|
| 392 |
+
Table 5: The amount of training and test data provided to each method in the synthetic experiments of Table 1 and Table 2. The last row indicates that on the test tasks,, all methods were expected to solve each problem using a single example from that task.
|
| 393 |
+
|
| 394 |
+
<table><tr><td colspan="6">Synthetic problem data quantity</td></tr><tr><td></td><td>k=1</td><td>k=2</td><td>k=5</td><td>Rot</td><td>Rot+flip</td></tr><tr><td>No.train tasks</td><td>400</td><td>800</td><td>800</td><td>8000</td><td>8000</td></tr><tr><td>No. test tasks</td><td>100</td><td>200</td><td>200</td><td>2000</td><td>2000</td></tr><tr><td>Examples/train task (Small)</td><td>2</td><td>2</td><td>4</td><td>20</td><td>20</td></tr><tr><td>Examples/train task (Large)</td><td>20</td><td>20</td><td>20</td><td>1</td><td>1</td></tr><tr><td>Train examples/test task</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
|
| 395 |
+
|
| 396 |
+
# C.2 VISUALIZING ROTATION AND FLIP EQUIVARIANT FILTERS
|
| 397 |
+
|
| 398 |
+
In Sec. 5.2 we ran three experiments reparameterizing convolution layers to meta-learn $9 0 °$ rotation, $4 5 ^ { \circ }$ rotation, and $4 5 ^ { \circ }$ rotation+flip equivariance, respectively. Figure 7 shows that MSR produces rotated and flipped versions of filters in order to make the convolution layers equivariant to the corresponding rotation or flip transformations.
|
| 399 |
+
|
| 400 |
+
# D EXPERIMENTAL DETAILS
|
| 401 |
+
|
| 402 |
+
Throughout this work we implemented all gradient based meta-learning algorithms in PyTorch using the Higher (Grefenstette et al., 2019) library.
|
| 403 |
+
|
| 404 |
+
# D.1 TRANSLATION SYMMETRY SYNTHETIC PROBLEMS
|
| 405 |
+
|
| 406 |
+
For the (partial) translation symmetry problems we generated regression data using a single locally connected layer. Each task corresponds to different weights of the data generating network, whose entries we sample independently from a standard normal distribution. For rank $k$ locally connected filters we sampled $k$ width-3 filters and then set the filter value at each spatial location to be a random linear combination of those $k$ filters. Table 5 shows how many distinct training and test tasks we generated data for. For each particular task, we generated data points by randomly sampling the entries of the input vector from a standard normal distribution, passing the input vector into the data generating network, and saving the input and output as a pair.
|
| 407 |
+
|
| 408 |
+
MSR and MAML training: During meta-training we trained each method for 1, 000 outer steps on task batches of size 32, enough for the training loss to converge for every method in every problem. We used the Adam (Kingma and Ba, 2014) optimizer in the outer loop with learning rate .0005. Like most meta-learning methods, MAML and MSR split each task’s examples into a support set (task training data) and a query set (task validation data). On training tasks MAML and MSR used 3 SGD steps on the support data before computing the meta-training objective on the query data, while using 9 SGD steps on the support data of test tasks. We also used meta-learned per-layer learning rates initialized to 0.02. At meta-test time we evaluated average performance and error bars on held-out tasks.
|
| 409 |
+
|
| 410 |
+
MTSR training: We reparameterize fully connected layers into symmetry matrix $U$ and filter $v$ , similar to MSR. MTSR maintains single shared $U$ , but initializes a separate filter $v ^ { ( i ) }$ for each training task $\mathcal { T } _ { i }$ . Given example data $\mathcal { D } _ { i }$ from $\mathcal { T } _ { i }$ , we jointly optimize $\{ U , v ^ { ( i ) } \}$ using the loss $\mathcal { L } ( U , v ^ { ( i ) } , \mathcal { D } _ { i } )$ . In practice each update step updates $U$ and all $\{ v ^ { ( i ) } \}$ in parallel using the full batch of training tasks. Given a test task we initialize a new filter $v$ alongside our already trained $U$ . We then update $v$ on training examples from the test task before evaluating on held out examples from the test task. We use 500 gradient steps for each task at both training and test time, again using the Adam optimizer with learning rate 0.001.
|
| 411 |
+
|
| 412 |
+
We ran all experiments on a single machine with a single NVidia RTX 2080Ti GPU. Our MSR-FC experiments took about 9.5 (outer loop) steps per second, while our MSR-Conv experiments took about 2.8 (outer loop) steps per second.
|
| 413 |
+
|
| 414 |
+
# D.2 ROTATION $^ +$ FLIP SYMMETRY SYNTHETIC PROBLEMS
|
| 415 |
+
|
| 416 |
+
The setup of the rotation and rotation $^ +$ flip symmetry problems is very similar to that of the translation symmetry problems. Here we generated regression data using a single E(2)-steerable (Weiler and Cesa, 2019) layer. Each task again corresponds to a particular setting of the weights of this data generating network, whose entries are sampled from a standard normal distribution for each task. We generate examples for each task similarly to above, and Table 5 shows the quantity of data available for training and test tasks.
|
| 417 |
+
|
| 418 |
+
MAML and MSR training setups here are similar to the translation setups, but we reparameterize the filter of a standard convolution layer to build in translation symmetry and focus on learning rotation/flip symmetry. Unlike the translation experiments, here we use 1 SGD step in the inner loop for both train and test tasks, and initialize the learned learning rates to 0.1.
|
| 419 |
+
|
| 420 |
+
# D.3 AUGMENTATION EXPERIMENTS
|
| 421 |
+
|
| 422 |
+
To create Aug-Omniglot and Aug-MiniImagenet, we extended the Omniglot and MiniImagenet benchmarks from TorchMeta (Deleu et al., 2019). Each task in these benchmarks is split into support (train) and query (validation) datasets. For the augmented benchmarks we applied data augmentation to only the query dataset of each task, which consisted of randomly resized crops, reflections, and rotations by up to $3 0 ^ { \circ }$ . Using the torchvision library, the augmentation function is:
|
| 423 |
+
|
| 424 |
+
# D a t a a u g m e n t a t i o n a p p l i e d t o ONLY t h e q u e r y s e t . s i z e $\ c = \ 2 8$ # O m n i g l o t i m a g e s i z e . 84 f o r M i n i I m a g e n e t . a u g m e n t f n $=$ Compose (
|
| 425 |
+
|
| 426 |
+
RandomResizedC rop ( 2 8 $, \quad \mathrm { ~ s ~ c ~ a ~ l ~ e ~ = ( ~ 0 ~ . ~ 8 ~ , ~ } \quad 1 . 0 ) )$ , R a n d o m V e r t i c a l F l i p ( $\mathtt { p } = 0 . 5 )$ , R a n d o m H o r i z o n t a l F l i p $\cdot { \bf p } { = } 0 . 5 )$ , R a n d o m R o t a t i o n ( 3 0 , r e s a m p l e $=$ I ma ge . BILINEAR ) , )
|
| 427 |
+
|
| 428 |
+
For the augmented Omniglot and MiniImagenet 1-shot experiments, MAML used exactly the same convolutional architecture (same number of layers, number of channels, filter sizes, etc.) as prior work on Omniglot and MiniImagenet (Vinyals et al., 2016; Finn et al., 2017). For MSR we reparameterize each layer’s weight matrix or convolutional filter using the Kronecker approximation (Appendix A) such that the reparameterized layer has the same number of input and output neurons as the corresponding layer in the MAML model.
|
| 429 |
+
|
| 430 |
+
For MiniImagenet 5-shot, we experimented with increasing architecture size via more channels and/or larger filters, which yielded better accuracies on meta-validation tasks. For MSR, MAML, and ANIL we increased the number of output channels from 32 to 128 and increased the kernel size from 3 to 5 in the first 3 convolution layers. We then inserted a $1 \times 1$ convolution layer with 64 output channels right before the linear output layer. For the ProtoNet architecture we similarly increased the output channels at each layer from 32 to 128, but found that keeping the kernel size at 3 worked best.
|
| 431 |
+
|
| 432 |
+
For “MAML (Big)” experiments we increased the architecture size of the MAML model to exceed the number of meta-parameters (symmetry matrices $^ +$ filter parameters) in the corresponding MSR model. For MiniImagenet 5-Shot we inserted an additional linear layer with 3840 output units before the final linear layer. For MiniImagenet 1-Shot we increased the number of output channels at each of the 3 convolution layers from 32 to 64, then inserted an additional linear layer with 1920 output units before the final linear layer. For the Omniglot experiments we increased the number of output channels at each of the 3 convolution layers to 150.
|
| 433 |
+
|
| 434 |
+
For all experiments and gradient based methods we trained for 60, 000 (outer) steps using the Adam optimizer with learning rate .0005 for MiniImagenet 5-shot and .001 for all other experiments. In the inner loop we used SGD with meta-learned per-layer learning rates initialized to 0.4 for Omniglot and .05 for MiniImagenet. We meta-trained using a single inner loop step in all experiments, and used 3 inner loop steps at meta-test time. Although MAML originally meta-trained with 5 inner loop steps on MiniImagenet, we found that this destabilized meta-training on our augmented version. We hypothesize that this is due to the discrepancy between support and query data in our augmented problems. During meta-training we used a task batch size of 32 for Omniglot and 10 for MiniImagenet. At meta-test time we evaluated average performance and error bars using 1000 held-out meta-test tasks.
|
| 435 |
+
|
| 436 |
+
We ran all experiments on a machine with a single NVidia Titan RTX GPU. For our Aug-Omniglot, we ran two experiments at simultaneously on the same machine, which likely slowed each invididual experiment down. Our MSR method took about 0.6 steps per second, whereas the MAML baseline took about 0.86 steps per second. For Aug-Miniimagenet we ran one experiment per machine. MSR took 4.2 steps per second, while MAML took 5.6 steps per second on these experiments.
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 7: MSR produced convolution filters, after meta-learning $9 0 ^ { \circ }$ rotation, $4 5 ^ { \circ }$ rotation, and $4 5 ^ { \circ }$ rotation+flip equivariance in the Sec. 5.2 experiments. Notice that MSR learns to achieve the corresponding equivariance by producing rotated/flipped versions of the same filter.
|
md/train/0XXpJ4OtjW/0XXpJ4OtjW.md
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVOLVING REINFORCEMENT LEARNING ALGORITHMS
|
| 2 |
+
|
| 3 |
+
John D. Co-Reyes, Yingjie Miao, Daiyi Peng, Esteban Real, Sergey Levine, Quoc V. Le, Honglak Lee, Aleksandra Faust∗ Research at Google, Mountain View, CA 94043, USA
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a method for meta-learning reinforcement learning algorithms by searching over the space of computational graphs which compute the loss function for a value-based model-free RL agent to optimize. The learned algorithms are domain-agnostic and can generalize to new environments not seen during training. Our method can both learn from scratch and bootstrap off known existing algorithms, like DQN, enabling interpretable modifications which improve performance. Learning from scratch on simple classical control and gridworld tasks, our method rediscovers the temporal-difference (TD) algorithm. Bootstrapped from DQN, we highlight two learned algorithms which obtain good generalization performance over other classical control tasks, gridworld type tasks, and Atari games. The analysis of the learned algorithm behavior shows resemblance to recently proposed RL algorithms that address overestimation in value-based methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Designing new deep reinforcement learning algorithms that can efficiently solve across a wide variety of problems generally requires a tremendous amount of manual effort. Learning to design reinforcement learning algorithms or even small sub-components of algorithms would help ease this burden and could result in better algorithms than researchers could design manually. Our work might then shift from designing these algorithms manually into designing the language and optimization methods for developing these algorithms automatically.
|
| 12 |
+
|
| 13 |
+
Reinforcement learning algorithms can be viewed as a procedure that maps an agent’s experience to a policy that obtains high cumulative reward over the course of training. We formulate the problem of training an agent as one of meta-learning: an outer loop searches over the space of computational graphs or programs that compute the objective function for the agent to minimize and an inner loop performs the updates using the learned loss function. The objective of the outer loop is to maximize the training return of the inner loop algorithm.
|
| 14 |
+
|
| 15 |
+
Our learned loss function should generalize across many different environments, instead of being specific to a particular domain. Thus, we design a search language based on genetic programming (Koza, 1993) that can express general symbolic loss functions which can be applied to any environment. Data typing and a generic interface to variables in the MDP allow the learned program to be domain agnostic. This language also supports the use of neural network modules as subcomponents of the program, so that more complex neural network architectures can be realized. Efficiently searching over the space of useful programs is generally difficult. For the outer loop optimization, we use regularized evolution (Real et al., 2019), a recent variant of classic evolutionary algorithms that employ tournament selection (Goldberg & Deb, 1991). This approach can scale with the number of compute nodes and has been shown to work for designing algorithms for supervised learning (Real et al., 2020). We adapt this method to automatically design algorithms for reinforcement learning.
|
| 16 |
+
|
| 17 |
+
While learning from scratch is generally less biased, encoding existing human knowledge into the learning process can speed up the optimization and also make the learned algorithm more interpretable. Because our search language expresses algorithms as a generalized computation graph, we can embed known RL algorithms in the graphs of the starting population of programs. We compare starting from scratch with bootstrapping off existing algorithms and find that while starting from scratch can learn existing algorithms, starting from existing knowledge leads to new RL algorithms which can outperform the initial programs.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Method overview. We use regularized evolution to evolve a population of RL algorithms. A mutator alters top performing algorithms to produce a new algorithm. The performance of the algorithm is evaluated over a set of training environments and the population is updated. Our method can incorporating existing knowledge by starting the population from known RL algorithms instead of purely from scratch.
|
| 21 |
+
|
| 22 |
+
We learn two new RL algorithms which outperform existing algorithms in both sample efficiency and final performance on the training and test environments. The learned algorithms are domain agnostic and generalize to new environments. Importantly, the training environments consist of a suite of discrete action classical control tasks and gridworld style environments while the test environments include Atari games and are unlike anything seen during training.
|
| 23 |
+
|
| 24 |
+
The contribution of this paper is a method for searching over the space of RL algorithms, which we instantiate by developing a formal language that describes a broad class of value-based model-free reinforcement learning methods. Our search language enables us to embed existing algorithms into the starting graphs which leads to faster learning and interpretable algorithms. We highlight two learned algorithms which generalize to completely new environments. Our analysis of the metalearned programs shows that our method automatically discovers algorithms that share structure to recently proposed RL innovations, and empirically attain better performance than deep Q-learning methods.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Learning to learn is an established idea in in supervised learning, including meta-learning with genetic programming (Schmidhuber, 1987; Holland, 1975; Koza, 1993), learning a neural network update rule (Bengio et al., 1991), and self modifying RNNs (Schmidhuber, 1993). Genetic programming has been used to find new loss functions (Bengio et al., 1994; Trujillo & Olague, 2006). More recently, AutoML (Hutter et al., 2018) aims to automate the machine learning training process. Automated neural network architecture search (Stanley & Miikkulainen, 2002; Real et al., 2017; 2019; Liu et al., 2017; Zoph & Le, 2016; Elsken et al., 2018; Pham et al., 2018) has made large improvements in image classification. Instead of learning the architecture, AutoML-Zero (Real et al., 2020) learns the algorithm from scratch using basic mathematical operations. Our work shares similar ideas, but is applied to the RL setting and assumes additional primitives such as neural network modules. In contrast to AutoML-Zero, we learn computational graphs with the goal of automating RL algorithm design. Our learned RL algorithms generalize to new problems, not seen in training.
|
| 29 |
+
|
| 30 |
+
Automating RL. While RL is used for AutoML (Zoph & Le, 2016; Zoph et al., 2018; Cai et al., 2018; Bello et al., 2017), automating RL itself has been somewhat limited. RL requires different design choices compared to supervised learning, including the formulation of reward and policy update rules. All of which affect learning and performance, and are usually chosen through trial and error. AutoRL addresses the gap by applying the AutoML framework from supervised learning to the MDP setting in RL. For example, evolutionary algorithms are used to mutate the value or actor network weights (Whiteson & Stone, 2006; Khadka & Tumer, 2018), learn task reward (Faust et al., 2019), tune hyperparameters (Tang & Choromanski, 2020; Franke et al., 2020), or search for a neural network architecture (Song et al., 2020; Franke et al., 2020). This paper focuses on task-agnostic RL update rules in the value-based RL setting which are both interpretable and generalizable.
|
| 31 |
+
|
| 32 |
+
Meta-learning in RL. Recent work has focused on few-shot task adaptation. Finn et al. (2017); Finn & Levine (2018) meta-learns initial parameters which can quickly adapt to new tasks, while $\mathrm { { R L } ^ { 2 } }$ (Duan et al., 2016) and concurrent work (Wang et al., 2017), formulates RL itself as a learning problem that is learned with an RNN. The meta-learned component of these works is tuned to a particular domain or environment, in the form of NN weights which cannot be used for completely new domains with potentially different sized inputs. Neural Programmer-Interpreters (Reed & De Freitas, 2015; Pierrot et al., 2019) overcome the environment generalization challenge by learning hierarchical neural programs with domain-specific encoders for different environments. Here, the computational graph has a flexible architecture and generalizes across different environments.
|
| 33 |
+
|
| 34 |
+
Learning RL algorithms or their components, such as a reward bonus or value update function, has been studied previously with meta-gradients (Kirsch et al., 2020; Chebotar et al., 2019; Oh et al., 2020), evolutionary strategies (Houthooft et al., 2018), and RNNs (Duan et al., 2016). Although our work also learns RL algorithms, the update rule is represented as a computation graph which includes both neural network modules and symbolic operators. One key benefit is that the resulting graph can be interpreted analytically and can optionally be initialized from known existing algorithms. Prior work that focuses on learning RL losses, generalizes to different goals and initial conditions within a single environment (Houthooft et al., 2018), or learns a domain invariant policy update rule that can generalize to new environments (Kirsch et al., 2020). Another approach searches over the space of curiosity programs using a similar language of DAGs with neural network modules (Alet et al., 2020a) and performs the meta-training on a single environment. In contrast, our method is applied to learn general RL update rules and meta-trained over a diverse set of environments.
|
| 35 |
+
|
| 36 |
+
# 3 LEARNING REINFORCEMENT LEARNING ALGORITHMS
|
| 37 |
+
|
| 38 |
+
In this section, we first describe the problem setup. An inner loop method $\operatorname { E v a l } ( L , { \mathcal { E } } )$ evaluates a learned RL algorithm $L$ on a given environment $\mathcal { E }$ . Given access to this procedure, the goal for the outer loop optimization is to learn a RL algorithm with high training return over a set of training environments. We then describe the search language which enables the learning of general loss functions and the outer loop method which can efficiently search over this space.
|
| 39 |
+
|
| 40 |
+
# 3.1 PROBLEM SETUP
|
| 41 |
+
|
| 42 |
+
We assume that the agent parameterized with policy $\pi _ { \boldsymbol { \theta } } \big ( a _ { t } | \boldsymbol { s } _ { t } \big )$ outputs actions $a _ { t }$ at each time step to an environment $\mathcal { E }$ and receives reward $r _ { t }$ and next state $s _ { t + 1 }$ . Since we are focusing on discrete action value-based RL methods, $\theta$ will be the parameters for a $\mathrm { Q } \mathrm { - }$ value function and the policy is obtained from the $\mathrm { Q }$ -value function using an $\epsilon$ -greedy strategy. The agent saves this stream of transitions $( s _ { t } , s _ { t + 1 } , a _ { t } , r _ { t } )$ to a replay buffer and continually updates the policy by minimizing a loss function $L ( s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } , \theta , \gamma )$ over these transitions with gradient descent. Training will occur for a fixed number of $M$ training episodes where in each episode $m$ , the agent earns episode return $\begin{array} { r } { R _ { m } \ = \ \sum _ { t = 0 } ^ { T } r _ { t } } \end{array}$ . The performance of an algorithm for a given environment is summarized by the normalized average training return, 1M P m=1 Rmax−Rmin Ri−Rmin , where Rmin and $R _ { m a x }$ are the minimum and maximum re
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Visualization of a RL algorithm, DQN, as a computational graph which computes the loss $L ~ = ~ _ { \circ } ( Q ( s _ { t } , a _ { t } ) ~ - ~ ( r _ { t } ~ + ~ \gamma ~ *$ $\mathbf { \bar { m a x } } _ { a } Q _ { t a r g } ( s _ { t + 1 } , a ) ) ^ { 2 }$ . Input nodes are in blue, parameter nodes in gray, operation nodes in orange, and output in green.
|
| 46 |
+
|
| 47 |
+
turn for that environment. We assume these are known ahead of time. This inner loop evaluation procedure $\mathrm { E v a l } ( L , \mathcal { E } )$ is outlined in Algorithm 1. To score an algorithm, we use the normalized average training return instead of the final behavior policy return because the former metric will factor in sample efficiency as well.
|
| 48 |
+
|
| 49 |
+
The goal of the meta-learner is to find the optimal loss function $L ( s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } , \theta , \gamma )$ to optimize $\pi _ { \theta }$ with maximal normalized average training return over the set of training environments. The full objective for the meta-learner is:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
L ^ { * } = \arg \operatorname* { m a x } _ { L } \left[ \sum _ { \varepsilon } \operatorname { E v a l } ( L , \mathcal { E } ) \right]
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
$L$ is represented as a computational graph which we describe in the next section.
|
| 56 |
+
|
| 57 |
+
# 3.2 SEARCH LANGUAGE
|
| 58 |
+
|
| 59 |
+
Our search language for the algorithm $L$ should be expressive enough to represent existing algorithms while enabling the learning of new algorithms which can obtain good generalization performance across a wide range of environments. Similar to Alet et al. (2020a), we describe the RL algorithm as general programs with a domain specific language, but we target updates to the policy rather than reward bonuses for exploration. Algorithms will map transitions $( s _ { t } , a _ { t } , s _ { t + 1 } , r _ { t } )$ , policy parameters $\theta$ , and discount factor $\gamma$ into a scalar loss to be optimized with gradient descent. We express $L$ as a computational graph or directed acyclic graph (DAG) of nodes with typed inputs and outputs. See Figure 2 for a visualization of DQN expressed in this form. Nodes are of several types:
|
| 60 |
+
|
| 61 |
+
Input nodes represent inputs to the program, and include elements from transitions $( s _ { t } , a _ { t } , s _ { t + 1 } , r _ { t } )$ and constants, such as the discount factor $\gamma$ .
|
| 62 |
+
|
| 63 |
+
Parameter nodes are neural network weights, which can map between various data types. For example, the weights for the Q-value network will map an input node with state data type to a list of real numbers for each action.
|
| 64 |
+
|
| 65 |
+
Operation nodes compute outputs given inputs from parent nodes. This includes applying parameter nodes, as well as basic math operators from linear algebra, probability, and statistics. A full list of operation nodes is provided in Appendix A. By default, we set the last node in the graph to compute the output of the program which is the scalar loss function to be optimized. Importantly, the inputs and outputs of nodes are typed among (state, action, vector, float, list, probability). This typing allows for programs to be applied to any domain. It also restricts the space of programs to ones with valid typing which reduces the search space.
|
| 66 |
+
|
| 67 |
+
1: Input: RL Algorithm $L$ , Environment $\varepsilon$ , training episodes $M$
|
| 68 |
+
2: Initialize: Q-value parameters $\theta$ , target parameters $\theta ^ { \prime }$ empty replay
|
| 69 |
+
buffer $\mathcal { D }$
|
| 70 |
+
3: for $i = 1$ to $M$ do
|
| 71 |
+
4: for $t = 0$ to $T$ do
|
| 72 |
+
5: With probability , select a random action $a _ { t }$ ,
|
| 73 |
+
6: otherwise select $a _ { t } =$ arg maxa $Q ( s _ { t } , a )$
|
| 74 |
+
7: Step environmen $\tau s _ { t + 1 } , r _ { t } \sim \mathcal { E } ( a _ { t } , s _ { t } )$
|
| 75 |
+
8: 9: D ← D ∪ {st, at, rt, st+1} Update parameters $\begin{array} { r l } & { r _ { t } , s _ { t + 1 } \big \} } \\ & { \theta \theta - \nabla _ { \theta } L ( s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } , \theta , \gamma ) } \end{array}$
|
| 76 |
+
10: Update target $\theta ^ { \prime } \theta$
|
| 77 |
+
11: 12: end for Compute episode return $\textstyle R _ { m } = \sum _ { t = 0 } ^ { T } r _ { t }$
|
| 78 |
+
13: end for
|
| 79 |
+
14: Output: 15: Normalized training performance $\begin{array} { r } { \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \frac { R _ { m } - R _ { m i n } } { R _ { m a x } - R _ { m i n } } } \end{array}$
|
| 80 |
+
|
| 81 |
+
Algorithm 1 Algorithm Evaluation, $\mathrm { E v a l } ( L , \mathcal { E } )$
|
| 82 |
+
Algorithm 2 Evolving RL Algorithms
|
| 83 |
+
|
| 84 |
+
<table><tr><td></td><td>1:Input: Training environments {ε}, hurdle environment εh,hurdle threshold α,optional existing algorithm A</td></tr><tr><td></td><td>2:Initialize:PopulationPof RL algorithms {L},historyH,random- ized inputs I. If bootstrapping,initialize P with A.</td></tr><tr><td></td><td>3:Score each LinP with H[L].score ←∑εEval(L,ε)</td></tr><tr><td></td><td>4:for c=OtoC do</td></tr><tr><td>5:</td><td>Sample tournament T~ Uniform(P)</td></tr><tr><td>6:</td><td>Parent algorithmL ← highest score algorithm in T</td></tr><tr><td>7:</td><td>Child algorithm L' ← Mutate(L)</td></tr><tr><td>8:</td><td>H[L'].hash←Hash(L'(I))</td></tr><tr><td>9:</td><td>ifH[L'].hash was new and Eval(L',£h) >α then</td></tr><tr><td>10:</td><td>H[L'].score←∑Eval(L',ε)</td></tr><tr><td>11:</td><td>end if</td></tr><tr><td>12:</td><td>Add L'to population P</td></tr><tr><td>13: 14:</td><td>Remove oldest L from population</td></tr><tr><td colspan="2">end for</td></tr><tr><td colspan="2">15: Output:Algorithm L with highest score</td></tr></table>
|
| 85 |
+
|
| 86 |
+
# 3.3 EVOLUTIONARY SEARCH METHOD
|
| 87 |
+
|
| 88 |
+
Evaluating thousands of programs over a range of complex environments is prohibitively expensive, especially if done serially. We adapt a genetic programming (Koza, 1993) method for the search method and use regularized evolution (Real et al., 2019), a variant of classic evolutionary algorithms that employ tournament selection (Goldberg & Deb, 1991). Regularized evolution has been shown to work for learning supervised learning algorithms (Real et al., 2020) and can be parallelized across compute nodes. Tournament selection keeps a population of $P$ algorithms and improves the population through cycles. Each cycle picks a tournament of $T \ < \ P$ algorithms at random and selects the best algorithm in the tournament as a parent. The parent is mutated into a child algorithm which gets added to the population while the oldest algorithm in the population is removed. We use a single type of mutation which first chooses which node in the graph to mutate and then replaces it with a random operation node with inputs drawn uniformly from all possible inputs.
|
| 89 |
+
|
| 90 |
+
There exists a combinatorially large number of graph configurations. Furthermore, evaluating a single graph, which means training the full inner loop RL algorithm, can take up a large amount of time compared to the supervised learning setting. Speeding up the search and avoiding needless computation are needed to make the problem more tractable. We extend regularized evolution with several techniques, detailed below, to make the optimization more efficient. The full training procedure is outlined in Algorithm 2.
|
| 91 |
+
|
| 92 |
+
Functional equivalence check (Real et al., 2020; Alet et al., 2020b). Before evaluating a program, we check if it is functionally equivalent to any previously evaluated program. This check is done by hashing the concatenated output of the program for 10 values of randomized inputs. If a mutated program is functionally equivalent to an older program, we still add it to the population, but use the saved score of the older program. Since some nodes of the graph do not always contribute to the output, parts of the mutated program may eventually contribute to a functionally different program.
|
| 93 |
+
|
| 94 |
+
Early hurdles (So et al., 2019). We want poor performing programs to terminate early so that we can avoid unneeded computation. We use the CartPole environment as an early hurdle environment $\mathcal { E } _ { h }$ by training a program for a fixed number of episodes. If an algorithm performs poorly, then episodes will terminate in a short number of steps (as the pole falls rapidly) which quickly exhausts the number of training episodes. We use $\mathrm { E v a l } ( L , \mathcal { E } _ { h } ) < \alpha$ as the threshold for poor performance with $\alpha$ chosen empirically.
|
| 95 |
+
|
| 96 |
+
Program checks. We perform basic checks to rule out and skip training invalid programs. The loss function needs to be a scalar value so we check if the program output type is a float $( \mathrm { t y p e } ( L ) = \mathbb { R } ,$ ). Additionally, we check if each program is differentiable with respect to the policy parameters by checking if a path exists in the graph between the output and the policy parameter node.
|
| 97 |
+
|
| 98 |
+
Learning from Scratch and Bootstrapping. Our method enables both learning from scratch and learning from existing knowledge by bootstrapping the initial algorithm population with existing algorithms. We learn algorithms from scratch by initializing the population of algorithms randomly. An algorithm is sampled by sampling each operation node sequentially in the DAG. For each node, an operation and valid inputs to that operation are sampled uniformly over all possible options.
|
| 99 |
+
|
| 100 |
+
While learning from scratch might uncover completely new algorithms that differ substantially from the existing methods, this method can take longer to converge to a reasonable algorithm. We would like to incorporate the knowledge we do have of good algorithms to bootstrap our search from a better starting point. We initialize our graph with the loss function of DQN (Mnih et al., 2013) so that the first 7 nodes represent the standard DQN loss, while the remaining nodes are initialized randomly. During regularized evolution, the nodes are not frozen, such that it is possible for the existing sub-graph to be completely replaced if a better solution is found.
|
| 101 |
+
|
| 102 |
+
# 4 LEARNED RL ALGORITHM RESULTS AND ANALYSIS
|
| 103 |
+
|
| 104 |
+
We discuss the training setup and results of our experiments. We highlight two learned algorithms with good generalization performance, DQNClipped and DQNReg, and analyze their structure.
|
| 105 |
+
|
| 106 |
+
# 4.1 TRAINING SETUP
|
| 107 |
+
|
| 108 |
+
Meta-Training details: We search over programs with maximum 20 nodes, not including inputs or parameter nodes. A full list of node types is provided in Appendix A. We use a population size of 300, tournament size of 25, and choose these parameters based on the ones used in (Real et al., 2019). Mutations occur with probability 0.95. Otherwise a new random program is sampled. The search is done over 300 CPUs and run for roughly 72 hours, at which point around 20, 000 programs have been evaluated. The search is distributed such that any free CPU is allocated to a proposed individual such that there are no idle CPUs. Further meta-training details are in Appendix B.
|
| 109 |
+
|
| 110 |
+
Training environments: The choice of training environments greatly affects the learned algorithms and their generalization performance. At the same time, our training environments should be not too computationally expensive to run as we will be evaluating thousands of RL algorithms. We use a range of 4 classical control tasks (CartPole, Acrobat, MountainCar, LunarLander) and a set of 12 multitask gridworld style environments from MiniGrid (Chevalier-Boisvert et al., 2018). These environments are computationally cheap to run but also chosen to cover a diverse set of situations. This includes dense and sparse reward, long time horizon, and tasks requiring solving a sequence of subgoals such as picking up a key and unlocking a door. More details are in Appendix C.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 3: Left: Meta-training performance over different number of environments from scratch, and bootstrapping. Plotted as RL evaluation performance (sum of normalized training return across the training environments) over the number of candidate algorithms. Shaded region represents one standard deviation over 10 random seeds. More training environments leads to better algorithms. Bootstrapping from DQN speeds up convergence and higher final performance. Right: Meta-training performance histogram for bootstrapped training. Many of the top programs have similar structure (Appendix D).
|
| 114 |
+
|
| 115 |
+
The training environments always include CartPole as an initial hurdle. If an algorithm succeeds on CartPole (normalized training performance greater than 0.6), it then proceeds to a harder set of training environments. For our experiments, we choose these training environments by sampling a set of 3 environments and leave the rest as test environments. For learning from scratch we also compare the effect of number of training environments on the learned algorithm by comparing training on just CartPole versus training on CartPole and LunarLander.
|
| 116 |
+
|
| 117 |
+
RL Training details: For training the RL agent, we use the same hyperparameters across all training and test environments except as noted. All neural networks are MLPs of size (256, 256) with ReLU activations. We use the Adam optimizer with a learning rate of 0.0001. $\epsilon$ is decayed linearly from 1 to 0.05 over 1e3 steps for the classical control tasks and over 1e5 steps for the MiniGrid tasks.
|
| 118 |
+
|
| 119 |
+
# 4.2 LEARNING CONVERGENCE
|
| 120 |
+
|
| 121 |
+
Figure 3a shows convergence over several training configurations. We find that at the end of training roughly $7 0 \%$ of proposed algorithms are functionally equivalent to a previously evaluated program, while early hurdles cut roughly another $4 0 \%$ of proposed non-duplicate programs.
|
| 122 |
+
|
| 123 |
+
Varying number of training environments: We compare learning from scratch with a single training environment (CartPole) versus with two training environments (CartPole and LunarLander). While both experiments reach the maximum performance on these environments (Figure 3a), the learned algorithms are different. The two-environment training setup learns the known TD loss
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
L _ { D Q N } = ( Q ( s _ { t } , a _ { t } ) - ( r _ { t } + \gamma * \operatorname* { m a x } _ { a } Q _ { t a r g } ( s _ { t } , a ) ) ) ^ { 2 }
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
while the single-environment training setup learns a slight variation $L ~ = ~ ( Q ( s _ { t } , a _ { t } ) ~ - ~ ( r _ { t } ~ +$ $\begin{array} { r } { \operatorname* { m a x } _ { a } Q _ { t a r g } ( \bar { s _ { t } } , a ) ) ) ^ { 2 } } \end{array}$ that does not use the discount, indicating that the range of difficulty on the training environments is important for learning algorithms which can generalize.
|
| 130 |
+
|
| 131 |
+
Learning from scratch versus bootstrapping: In Figure 3a, we compare training from scratch versus training from bootstrapping on four training environments (CartPole, KeyCorridorS3R1, DynamicObstacle-6x6, DoorKey-5x5). The training performance does not saturate, leaving room for improvement. Bootstrapping from DQN significantly improves both the convergence and performance of the meta-training, resulting in a $4 0 \%$ increase in final training performance.
|
| 132 |
+
|
| 133 |
+
# 4.3 LEARNED RL ALGORITHMS: DQNCLIPPED AND DQNREG
|
| 134 |
+
|
| 135 |
+
In this section, we discuss two particularly interesting loss functions that were learned by our method, and that have good generalization performance on the test environments. Let
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
Y _ { t } = r _ { t } + \gamma * \operatorname* { m a x } _ { a } Q _ { t a r g } ( s _ { t } , a ) , \mathrm { ~ a n d ~ } \delta = Q ( s _ { t } , a _ { t } ) - Y _ { t }
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
The first loss function DQNClipped is
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
L _ { \mathrm { D Q N C l i p p e d } } = \operatorname* { m a x } \left[ Q ( s _ { t } , a _ { t } ) , \delta ^ { 2 } + Y _ { t } \right] + \operatorname* { m a x } \left[ Q ( s _ { t } , a _ { t } ) - Y _ { t } , \gamma ( \operatorname* { m a x } _ { a } Q _ { t a r g } ( s _ { t } , a ) ) ^ { 2 } \right] .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
LDQNClipped was trained from bootstrapping off DQN using three training environments (LunarLander, MiniGrid-Dynamic-Obstacles- ${ . 5 } \mathrm { x } 5$ , MiniGrid-LavaGapS5). It outperforms DQN and doubleDQN, DDQN, (van Hasselt et al., 2015) on both the training and unseen environments (Figure 4). The intuition behind this loss function is that, if the Q-values become too large (when $Q ( s _ { t } , a _ { t } ) > \delta ^ { 2 } + Y _ { t } )$ , the loss will act to minimize $Q ( s _ { t } , a _ { t } )$ instead of the normal $\delta ^ { 2 }$ loss. Alternatively, we can view this condition as $\delta = Q ( s _ { t } , a _ { t } ) - Y _ { t } > \delta ^ { 2 }$ . This means when $\delta$ is small enough then $Q ( s _ { t } , a _ { t } )$ are relatively close and the loss is just to minimize $Q ( s _ { t } , a _ { t } )$ .
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Performance of learned algorithms (DQNClipped and DQNReg) versus baselines (DQN and DDQN) on training and test environments as measured by episode return over 10 training seeds. A dashed line indicates that the algorithm was meta-trained on that environment while a solid line indicates a test environment. DQNReg can match or outperform the baselines on almost all the training and test environments. Shaded regions correspond to 1 standard deviation.
|
| 151 |
+
|
| 152 |
+
The second learned loss function, which we call DQNReg, is given by
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
L _ { \mathrm { D Q N R e g } } = 0 . 1 * Q ( s _ { t } , a _ { t } ) + \delta ^ { 2 } .
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
DQNReg was trained from bootstrapping off DQN using three training environments (KeyCorridorS3R1, Dynamic-Obstacles-6x6, DoorKey-5x5). In comparison to DQNClipped, DQNReg directly regularizes the Q values with a weighted term that is always active. We note that both of these loss functions modify the original DQN loss function to regularize the Q-values to be lower in value. While DQNReg is quite simple, it matches or outperforms the baselines on all training and test environments including from classical control and Minigrid. It does particularly well on a few test environments (SimpleCrossingS9N1, DoorKey-6x6, and Unlock) and solves the tasks when other methods fail to attain any reward. It is also much more stable with lower variance between seeds, and more sample efficient on test environments (LavaGapS5, Empty-6x6, Empty-Random-5x5).
|
| 159 |
+
|
| 160 |
+
In Table 1, we evaluate DQNReg on a set of Atari games. We use the same architecture as in DQN (Mnih et al., 2013) and use the same no-op evaluation procedure which evaluates a trained policy every 1 million training steps over 200 test episodes. Even though meta-training was on computationally simple, non-image based environments, we find that DQNReg can generalize to image-based environments and outperform baselines. The results for the baselines are taken from their respective papers
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Env</td><td>DQN</td><td>DDQN</td><td>PPO</td><td>DQNReg</td></tr><tr><td>Asteroid</td><td>1364.5</td><td>734.7</td><td>2097.5</td><td>2390.4</td></tr><tr><td>Bowling</td><td>50.4</td><td>68.1</td><td>40.1</td><td>80.5</td></tr><tr><td>Boxing</td><td>88.0</td><td>91.6</td><td>94.6</td><td>100.0</td></tr><tr><td>RoadRunner</td><td>39544.0</td><td>44127.0</td><td>35466.0</td><td>65516.0</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 1: Performance of learned algorithm DQNReg against baselines on several Atari games. Baseline numbers taken from reported papers.
|
| 165 |
+
|
| 166 |
+
(Mnih et al., 2013; van Hasselt et al., 2015; Schulman et al., 2017).
|
| 167 |
+
|
| 168 |
+
These algorithms are related to recently proposed RL algorithms, conservative Q-learning (CQL) (Kumar et al., 2020) and M-DQN (Vieillard et al., 2020). CQL learns a conservative Qfunction by augmenting the standard Bellman error objective with a simple Q-value regularizer: $\begin{array} { r } { \log \sum _ { a } \exp \left( \bar { Q ( s _ { t } , a ) } \right) - \bar { Q ( s _ { t } , a _ { t } ) } } \end{array}$ which encourages the agent to stay close to the data distribution while maintaining a maximum entropy policy. DQNReg similarly augments the standard objective with a Q-value regularizer although does so in a different direction by preventing overestimation. M-DQN modifies DQN by adding the scaled log-policy (using the softmax Q-values) to the immediate reward. Both of these methods can be seen as ways to regularize a value-based policy. This resemblance indicates that our method can find useful structures automatically that are currently being explored manually, and could be used to propose new areas for researchers to explore.
|
| 169 |
+
|
| 170 |
+
We discover that the best performing algorithms from the experiment which learned DQNReg are consistent, and in the form ${ \cal L } = \bar { \delta ^ { 2 } } + \bar { k } * { \cal Q } ( s _ { t } , a _ { t } )$ . This loss could use further analysis and investigation, possibly environment-specific tuning of the parameter $k$ . See Appendix 3 for details.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
4.4 ANALYSIS OF LEARNED ALGORITHMS
|
| 174 |
+
Figure 5: Overestimated value estimates is generally problematic in value-based RL. Our method learns algorithms which regularize the Q-values helping with overestimation. We compare the estimated Q-values for our learned algorithms and baselines with the optimal ground truth Q-values across several environments during training. Estimate is for taking action zero from the initial state of the environment. While DQN overestimates the Q-values, our learned algorithms DQNClipped and DQNReg underestimate the Q-values.
|
| 175 |
+
|
| 176 |
+
We analyze the learned algorithms to understand their beneficial effect on performance. In Figure 5, we compare the estimated Q-values for each algorithm. We see that DQN frequently overestimates the Q values while DDQN consistently underestimates the Q values before converging to the ground truth Q value which are computed with a manually designed optimal policy. DQNClipped has similar performance to DDQN, in that it also consistently underestimates the Q values and does so slightly more aggressively than DDQN. DQNReg significantly undershoots the Q values and does not converge to the ground truth. Various works (van Hasselt et al., 2015; Haarnoja et al., 2018; Fujimoto et al., 2018) have shown that overestimated value estimates is problematic and restricting the overestimation improves performance.
|
| 177 |
+
|
| 178 |
+
The loss function in DQNClipped is composed of the sum of two max operations, and so we can analyze when each update rule is active. We interpret DQNClipped as $\operatorname* { m a x } ( v _ { 1 } , v _ { 2 } ) + \operatorname* { m a x } ( v _ { 2 } , v _ { 3 } )$ with four cases: 1) $v _ { 1 } ~ > ~ v _ { 2 }$ and $v _ { 3 } > v _ { 4 } 2$ ) $v _ { 1 } > v _ { 2 }$ and $v _ { 3 } < v _ { 4 } 3$ ) $v _ { 1 } < v _ { 2 }$ and $v _ { 3 } < v _ { 4 } 4 )$ $v _ { 1 } < v _ { 2 }$ and $v _ { 3 } > v _ { 4 }$ . Case 2 corresponds to minimizing the $\mathrm { Q }$ values. Case 3 would correspond to the normal DQN loss of $\delta ^ { 2 }$ since the parameters of $Q _ { t a r g }$ are not updated during gradient descent.
|
| 179 |
+
|
| 180 |
+
In Figure 6, we plot the proportion of when each case is active during training. We see that usually case 3 is generally the most active with a small dip in the beginning but then stays around $9 5 \%$ . Meanwhile, case 2, which regularizes the $\mathrm { Q }$ -values, has a small increase in the beginning and then decreases later, matching with our analysis in Figure 6, which shows that DQNClipped strongly underestimates the $\mathrm { Q }$ -values in the beginning of training. This can be seen as a constrained optimization where the amount of Q-value regularization is tuned accordingly. The regularization is stronger in the beginning of training when overestimation is problematic $( Q ( \bar { s _ { t } } , a _ { t } ) \bar { > } \delta ^ { 2 } + Y _ { t } )$ and gets weaker as $\delta ^ { 2 }$ gets smaller.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 6: Our learned algorithm, DQNClipped, can be broken down into four update rules where each rule is active under certain conditions. Case 3 corresponds to normal TD learning while case 2 corresponds to minimizing the Q-values. Case 2 is more active in the beginning when value overestimation is a problem and then becomes less active as it is no longer needed.
|
| 184 |
+
|
| 185 |
+
# 5 CONCLUSION
|
| 186 |
+
|
| 187 |
+
In this work, we have presented a method for learning reinforcement learning algorithms. We design a general language for representing algorithms which compute the loss function for value-based model-free RL agents to optimize. We highlight two learned algorithms which although relatively simple, can obtain good generalization performance over a wide range of environments. Our analysis of the learned algorithms sheds insight on their benefit as regularization terms which are similar to recently proposed algorithms. Our work is limited to discrete action and value-based RL algorithms that are close to DQN, but could easily be expanded to express more general RL algorithms such as actor-critic or policy gradient methods. How actions are sampled from the policy could also be part of the search space. The set of environments we use for both training and testing could also be expanded to include a more diverse set of problem types. We leave these problems for future work.
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGEMENTS
|
| 190 |
+
|
| 191 |
+
We thank Luke Metz for helpful early discussions and feedback on the paper, Hanjun Dai for early discussions on related research ideas, and Xingyou Song, Krzysztof Choromanski, and Kevin Lee for help with infrastructure. We also thank Jongwook Choi for help with environment selection.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Ferran Alet, M. F. Schneider, Tomas Lozano-Perez, and L. Kaelbling. Meta-learning curiosity algorithms. ArXiv, abs/2003.05325, 2020a.
|
| 196 |
+
Ferran Alet, Martin F. Schneider, Tomas Lozano-Perez, and Leslie Pack Kaelbling. Meta-learning curiosity algorithms. In International Conference on Learning Representations, 2020b. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BygdyxHFDS.
|
| 197 |
+
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.
|
| 198 |
+
S. Bengio, Yoshua Bengio, and J. Cloutier. Use of genetic programming for the search of a new learning rule for neural networks. Proceedings of the First IEEE Conference on Evolutionary Computation. IEEE World Congress on Computational Intelligence, pp. 324–327 vol.1, 1994.
|
| 199 |
+
Yoshua Bengio, S. Bengio, and J. Cloutier. Learning a synaptic learning rule. IJCNN-91-Seattle International Joint Conference on Neural Networks, ii:969 vol.2–, 1991.
|
| 200 |
+
Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pp. 2787–2794, 2018.
|
| 201 |
+
Yevgen Chebotar, Artem Molchanov, Sarah Bechtle, Ludovic Righetti, F. Meier, and Gaurav S. Sukhatme. Meta-learning via learned loss. ArXiv, abs/1906.05374, 2019.
|
| 202 |
+
|
| 203 |
+
Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. Minimalistic gridworld environment for openai gym. https://github.com/maximecb/gym-minigrid, 2018.
|
| 204 |
+
|
| 205 |
+
Yan Duan, John Schulman, Xi Chen, Peter L. Bartlett, Ilya Sutskever, and P. Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. ArXiv, abs/1611.02779, 2016.
|
| 206 |
+
|
| 207 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. arXiv preprint arXiv:1808.05377, 2018.
|
| 208 |
+
|
| 209 |
+
Aleksandra Faust, Anthony Francis, and Dar Mehta. Evolving rewards to automate reinforcement learning. arXiv preprint arXiv:1905.07628, 2019.
|
| 210 |
+
|
| 211 |
+
Chelsea Finn and S. Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. ArXiv, abs/1710.11622, 2018.
|
| 212 |
+
|
| 213 |
+
Chelsea Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. ArXiv, abs/1703.03400, 2017.
|
| 214 |
+
|
| 215 |
+
Jorg K. H. Franke, Gregor K ¨ ohler, Andr ¨ e Biedenkapp, and Frank Hutter. Sample-efficient automated ´ deep reinforcement learning. 2020.
|
| 216 |
+
|
| 217 |
+
Scott Fujimoto, H. V. Hoof, and David Meger. Addressing function approximation error in actorcritic methods. ArXiv, abs/1802.09477, 2018.
|
| 218 |
+
|
| 219 |
+
David E Goldberg and Kalyanmoy Deb. A comparative analysis of selection schemes used in genetic algorithms. FOGA, 1991.
|
| 220 |
+
|
| 221 |
+
Toumas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In ICML, 2018.
|
| 222 |
+
|
| 223 |
+
John H. Holland. Adaptation in Natural and Artificial Systems. University of Michigan Press, Ann Arbor, MI, 1975. second edition, 1992.
|
| 224 |
+
|
| 225 |
+
Rein Houthooft, Richard Y. Chen, Phillip Isola, Bradly C. Stadie, F. Wolski, Jonathan Ho, and P. Abbeel. Evolved policy gradients. ArXiv, abs/1802.04821, 2018.
|
| 226 |
+
|
| 227 |
+
Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren (eds.). Automated Machine Learning: Methods, Systems, Challenges. Springer, 2018. In press, available at http://automl.org/book.
|
| 228 |
+
|
| 229 |
+
Shauharda Khadka and Kagan Tumer. Evolution-guided policy gradient in reinforcement learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 1188–1200. Curran Associates, Inc., 2018.
|
| 230 |
+
|
| 231 |
+
Louis Kirsch, Sjoerd van Steenkiste, and J. Schmidhuber. Improving generalization in meta reinforcement learning using learned objectives. ArXiv, abs/1910.04098, 2020.
|
| 232 |
+
|
| 233 |
+
John Koza. Genetic programming - on the programming of computers by means of natural selection. In Complex adaptive systems, 1993.
|
| 234 |
+
|
| 235 |
+
Aviral Kumar, Aurick Zhou, G. Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. ArXiv, abs/2006.04779, 2020.
|
| 236 |
+
|
| 237 |
+
Chenxi Liu, Barret Zoph, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan L. Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. CoRR, abs/1712.00559, 2017. URL http://arxiv.org/abs/1712.00559.
|
| 238 |
+
|
| 239 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. ArXiv, abs/1312.5602, 2013.
|
| 240 |
+
|
| 241 |
+
Junhyuk Oh, Matteo Hessel, Wojciech Marian Czarnecki, Zhongwen Xu, Hado van Hasselt, Satinder Singh, and David Silver. Discovering reinforcement learning algorithms. ArXiv, abs/2007.08794, 2020.
|
| 242 |
+
|
| 243 |
+
Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In ICML, 2018.
|
| 244 |
+
|
| 245 |
+
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. NeurIPS, 2019.
|
| 246 |
+
|
| 247 |
+
Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V. Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 2902–2911. JMLR.org, 2017.
|
| 248 |
+
|
| 249 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. In AAAI, volume abs/1802.01548, 2019.
|
| 250 |
+
|
| 251 |
+
Esteban Real, Chen Liang, David So, and Quoc V. Le. Automl-zero: Evolving machine learning algorithms from scratch. In ICML, volume abs/2003.03384, 2020.
|
| 252 |
+
|
| 253 |
+
Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
|
| 254 |
+
|
| 255 |
+
Juergen Schmidhuber. Evolutionary principles in self-referential learning. 1987.
|
| 256 |
+
|
| 257 |
+
Juergen Schmidhuber. A self-referential weight matrix. 1993.
|
| 258 |
+
|
| 259 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 260 |
+
|
| 261 |
+
D. So, Chen Liang, and Quoc V. Le. The evolved transformer. ArXiv, abs/1901.11117, 2019.
|
| 262 |
+
|
| 263 |
+
Xingyou Song, Krzysztof Choromanski, Jack Parker-Holder, Yunhao Tang, Wenbo Gao, Aldo Pacchiano, Tamas Sarlos, Deepali Jain, and Yuxiang Yang. Reinforcement learning with chromatic networks for compact architecture search. 2020.
|
| 264 |
+
|
| 265 |
+
Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
|
| 266 |
+
|
| 267 |
+
Yunhao Tang and Krzysztof Choromanski. Online hyper-parameter tuning in off-policy learning via evolutionary strategies, 2020.
|
| 268 |
+
|
| 269 |
+
L. Trujillo and G. Olague. Synthesis of interest point detectors through genetic programming. In GECCO ’06, 2006.
|
| 270 |
+
|
| 271 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. In AAAI, 2015.
|
| 272 |
+
|
| 273 |
+
Nino Vieillard, Olivier Pietquin, and M. Geist. Munchausen reinforcement learning. ArXiv, abs/2007.14430, 2020.
|
| 274 |
+
|
| 275 |
+
Jane X. Wang, Zeb Kurth-Nelson, Hubert Soyer, Joel Z. Leibo, Dhruva Tirumala, Remi Munos, ´ Charles Blundell, D. Kumaran, and Matt M. Botvinick. Learning to reinforcement learn. ArXiv, abs/1611.05763, 2017.
|
| 276 |
+
|
| 277 |
+
S. Whiteson and P. Stone. Evolutionary function approximation for reinforcement learning. J. Mach. Learn. Res., 7:877–917, 2006.
|
| 278 |
+
|
| 279 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2016.
|
| 280 |
+
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+
# A SEARCH LANGUAGE DETAILS
|
| 284 |
+
|
| 285 |
+
Inputs and outputs to nodes in the computational graph have data types which include state $\mathbb { S }$ , action $\mathbb { Z }$ , float $\mathbb { R }$ , list $\boldsymbol { L i s t [ \mathbb { X } ] }$ , probability $\mathbb { P }$ , vector $\mathbb { V }$ . The symbol $\mathbb { X }$ indicates it can be of $\mathbb { S } , \mathbb { R }$ , or $\mathbb { V }$ . We assume that vectors are of fixed length 32 and actions are integers. Operations will broadcast so that for example adding a float variable to a state variable will result in the float being added to each element of the state. This typing allows the learned program to be domain agnostic. The full list of operators is listed below.
|
| 286 |
+
|
| 287 |
+
<table><tr><td rowspan=1 colspan=1>Operation</td><td rowspan=1 colspan=2>Input Types</td><td rowspan=1 colspan=1>Output Type</td></tr><tr><td rowspan=1 colspan=1>Add</td><td rowspan=1 colspan=2>X,X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Subtract</td><td rowspan=1 colspan=2>X, X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=2>X, X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Min</td><td rowspan=1 colspan=2>X,X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>DotProduct</td><td rowspan=1 colspan=2>X,X</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Div</td><td rowspan=1 colspan=2>X,X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>L2Distance</td><td rowspan=1 colspan=2>X,X</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>MaxList</td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>MinList</td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>ArgMaxList</td><td rowspan=1 colspan=1>List[R]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Z</td></tr><tr><td rowspan=1 colspan=1>SelectList</td><td rowspan=1 colspan=1>List[X],Z</td><td rowspan=1 colspan=1>Z</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>MeanList</td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>VarianceList</td><td rowspan=1 colspan=1>List[X]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Log</td><td rowspan=1 colspan=2>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Exp</td><td rowspan=1 colspan=2>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Abs</td><td rowspan=1 colspan=2>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>(C)NN:S → List[R]</td><td rowspan=1 colspan=2>S</td><td rowspan=1 colspan=1>List[R]</td></tr><tr><td rowspan=1 colspan=1>(C)NN:S → R</td><td rowspan=1 colspan=2>S</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>(C)NN:S → V</td><td rowspan=1 colspan=2>V</td><td rowspan=1 colspan=1>V</td></tr><tr><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=2>List[R]</td><td rowspan=1 colspan=1>P</td></tr><tr><td rowspan=1 colspan=1>KLDiv</td><td rowspan=1 colspan=2>P,P</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Entropy</td><td rowspan=1 colspan=2>P</td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Constant</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1, 0.5, 0.2,0.1, 0.01</td></tr><tr><td rowspan=1 colspan=1>MultiplyTenth</td><td rowspan=1 colspan=2>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Normal(0, 1)</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>R</td></tr><tr><td rowspan=1 colspan=1>Uniform(0, 1)</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>R</td></tr></table>
|
| 288 |
+
|
| 289 |
+
# B TRAINING DETAILS
|
| 290 |
+
|
| 291 |
+
We describe the training details and hyperparameters used. For all environments we use the Adam optimzier with a learning rate of 0.0001.
|
| 292 |
+
|
| 293 |
+
Common RL training details. All neural networks are MLPs of size (256, 256) with ReLU activations. For optimizing the Q-function parameters we use the Adam optimizer with a learning rate of 0.0001. Target update period is 100. These settings are used for all training and test environments.
|
| 294 |
+
|
| 295 |
+
Classical control environments. The value of $\epsilon$ is decayed linearly from 1 to 0.05 over 1000 steps. CartPole, Acrobat, and MountainCar are trained for 400 episodes and LunarLander is trained for 1000 episodes.
|
| 296 |
+
|
| 297 |
+
MiniGrid environments. The value of $\epsilon$ is decayed linearly from 1 to 0.05 over $1 0 ^ { 5 }$ steps. During meta-training, MiniGrid environments are trained for $5 * 1 0 ^ { \mathrm { 5 } }$ steps.
|
| 298 |
+
|
| 299 |
+
Atari environments. We use the same neural network architecture as in Mnih et al. (2013). Target update period is $1 , 0 0 0$ . The value of $\epsilon$ is decayed linearly from 1 to 0.1 over $1 0 ^ { 6 }$ steps. For evaluation, we use the no-op start condition as in Mnih et al. (2013) where the agent will output the no-op action for $x$ steps where $x$ is a random integer drawn between [1, 30]. The evaluation policy uses an $\epsilon$ of 0.001 and is evaluated every $1 0 ^ { 6 }$ steps for 100 episodes. The best training snapshot is reported.
|
| 300 |
+
|
| 301 |
+
# C ENVIRONMENT DETAILS
|
| 302 |
+
|
| 303 |
+
We describe the classical control environments below. CartPole and LunarLander are dense reward while Acrobat and MountainCar are sparse reward.
|
| 304 |
+
|
| 305 |
+
<table><tr><td></td><td>Task ID</td><td>Description</td></tr><tr><td></td><td>CartPole-v0</td><td>The agent must balance a pole on top of a cart by applying a force of +l or -1 to the cart. A reward of +1 is provided for each timestep the pole remains upright.</td></tr><tr><td></td><td>LunarLander-v2</td><td>The agent controls a lander by firing one of four thrusters and must land it on the landing pad.</td></tr><tr><td></td><td>Acrobat-v1</td><td>The goal is to swing a 2-link system upright to a given height by applying 1,O,or -1 torque on the join between the two links.</td></tr><tr><td></td><td>MountainCar-vO</td><td>The goal is to drive up the mountain on the right by first driving back and forth to build up momentum.</td></tr></table>
|
| 306 |
+
|
| 307 |
+
We describe the MiniGrid environments below. The input to the agent is a fully observed grid which is encoded as an NxNx3 size array where $_ \mathrm { N }$ is the grid size. The 1st channel contains the index of the object type at that location (out of 11 possible objects), the 2nd channel contains the color of the object (out of 6 possible colors), and the 3rd channel contains the orientation of the agent out of 4 cardinal directions. This encoding is then flattened and fed into an MLP. There are 7 possible actions (turn left, turn right, forward, pickup, drop, toggle, done).
|
| 308 |
+
|
| 309 |
+
Unless stated otherwise, all tasks are sparse reward tasks with a reward of 1 for completing the task. Max steps is set to 100. A size such as 5x5 in the environment name refers to a grid size with width and height of 5 cells.
|
| 310 |
+
|
| 311 |
+
<table><tr><td></td><td>Task ID</td><td>Description</td></tr><tr><td>自V日</td><td>KeyCorridorS3R1-v0</td><td>The agent has to find a key hidden in one room and then use it to pickup an object be- hind a locked door in another room. This tests sequential subgoal completion.</td></tr><tr><td>. 333333 ?</td><td>LavaGapS5-v0</td><td>The agent has to reach the green goal square without touching the lava which will termi- nate the episode with zero reward. This tests safety and safe exploration.</td></tr><tr><td></td><td>MultiRoom-N2-S4-v0</td><td>The agent must open a door to get to the green goal square in the next room.</td></tr></table>
|
| 312 |
+
|
| 313 |
+
<table><tr><td>SimpleCrossingS9N1- v0</td><td>The agent has to reach the green goal square on the other corner of the room and navigate around walls.</td></tr><tr><td>Empty-v0</td><td>The agent has to reach the green goal square in an empty room.</td></tr><tr><td>EmptyRandom-v0</td><td>The agent has to reach the green goal square in an empty room but is initialized to a ran- dom location.</td></tr><tr><td>Dynamic-Obstacles-v0</td><td>The agent has to reach the green goal square without colliding with any blue obstacles which move around randomly. If the agent collides with an obstacle it receives a reward of -1 and the episode terminates.</td></tr><tr><td>FourRooms-v0</td><td>The agent must navigate in a maze com- posed of four rooms. Both the agent and goal square are randomly placed in any of the four rooms.</td></tr><tr><td>DoorKey-v0</td><td>The agent must pick up a key to unlock a door to enter another room and get to the green goal square.</td></tr></table>
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
|
| 317 |
+
# D GRAPH DISTRIBUTION ANALYSIS
|
| 318 |
+
|
| 319 |
+
We look at the distribution of top performing graphs and find similarities in their structure. This is summarized in Table 3 where we describe the equations of learned algorithms for differing ranks (if sorted by score). The best performing algorithms from the experiment which learned DQNReg are all variants of adding $Q ( s _ { t } , a _ { t } )$ to the standard TD loss in some form, $\delta ^ { 2 } + k * Q ( s _ { t } , a _ { t } )$ . We think this kind of loss could use further investigation and that while we did not tune the value of $k$ , this could also be tuned per environment. In Figure 3b, we show the distribution of scores for all nonduplicate programs that have been evaluated. We provide a full list of top performing algorithms from a few of our experiments at https://github.com/jcoreyes/evolvingrl.
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Raw Equation</td><td>Simplified Equation</td><td>Score</td><td>Rank</td></tr><tr><td>δ²+0.1*Q(st,at)+Tt-(γ*Qtarg-0.1*Q(st,at))</td><td>δ²+0.2*Q(st,at)</td><td>3.905</td><td>2</td></tr><tr><td>δ²+0.1*Q(st,at)-γ+Qtarg</td><td>δ²+0.1*Q(st,at)</td><td>3.904</td><td>3</td></tr><tr><td>δ²-(γ *Qtarg-0.1*Q(st,at))</td><td>δ²+0.1*Q(st,at)</td><td>3.903</td><td>4</td></tr><tr><td>δ²+Qtarg+0.1 * Q(st,at)-γ</td><td>δ²+0.1*Q(st,at)</td><td>3.902</td><td>5</td></tr><tr><td>δ²-(0.1*Q(st,at)-Yt)²</td><td>δ²-(0.1*Q(st,at)-Yt)²</td><td>3.898</td><td>6</td></tr><tr><td>δ²+((rt+γ*Qtarg+Q(st,at))*(γ-max(γ,0.1*Q(st,at)) -γ *Qtarg-0.1*Q(st,at))</td><td>NA</td><td>3.846</td><td>11146</td></tr><tr><td>δ²+(δ²+0.1*Q(st,at))²</td><td>NA</td><td>3.65</td><td>12146</td></tr><tr><td>δ²+Q(st,at)</td><td>8²+Q(st,at)</td><td>2.8</td><td>12446</td></tr><tr><td>2</td><td>82</td><td>2.28</td><td>13246</td></tr></table>
|
| 322 |
+
|
| 323 |
+
Table 3: Other programs learned in learning DQNReg which is rank 1 with score 3.907. Rank is if scores are sorted in decreasing order. Score is the sum of normalized RL training performance across four environments. The simplified equations contains only the relevant parts for minimizing the equation output. $Q _ { t a r g }$ refers to $\begin{array} { r } { \operatorname* { m a x } _ { a } Q _ { t a r g } ( s _ { t + 1 } , a ) } \end{array}$ .
|
| 324 |
+
|
| 325 |
+
# E REPEATABILITY OF META TRAINING
|
| 326 |
+
|
| 327 |
+
In Figure 7, we plot the meta-training performance for bootstrapping from DQN with four training environments (CartPole, KeyCorridorS3R1, Dynamic-Obstacles-6x6, DoorKey-5x5) over ten trials. Four out of the ten trials reach the max training performance. Two out of 10 of these trials learns the same algorithm DQNReg while the other top two trials find other less interpretable algorithms.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 7: Meta-training performance for boot-strapping on 4 training environments for 10 random seeds.
|
md/train/5-GXHFNbq_U/5-GXHFNbq_U.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Prototypical Cross-Attention Networks for Multiple Object Tracking and Segmentation
|
| 2 |
+
|
| 3 |
+
Lei $\mathbf { K e } ^ { 1 , 2 }$ Xia Li1 Martin Danelljan1 Yu-Wing Tai3 Chi-Keung Tang2 Fisher ${ \bf { Y } } { \bf { u } } ^ { 1 }$ 1ETH Zürich 2HKUST 3Kuaishou Technology {lkeab,cktang}@cse.ust.hk, {xia.li,martin.danelljan}@vision.ee.ethz.ch yuwing@gmail.com, i@yf.io
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Multiple object tracking and segmentation requires detecting, tracking, and segmenting objects belonging to a set of given classes. Most approaches only exploit the temporal dimension to address the association problem, while relying on single frame predictions for the segmentation mask itself. We propose Prototypical Cross-Attention Network (PCAN), capable of leveraging rich spatio-temporal information for online multiple object tracking and segmentation. PCAN first distills a space-time memory into a set of prototypes and then employs cross-attention to retrieve rich information from the past frames. To segment each object, PCAN adopts a prototypical appearance module to learn a set of contrastive foreground and background prototypes, which are then propagated over time. Extensive experiments demonstrate that PCAN outperforms current video instance tracking and segmentation competition winners on both Youtube-VIS and BDD100K datasets, and shows efficacy to both one-stage and two-stage segmentation frameworks. Code and video resources are available at http://vis.xyz/pub/pcan.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Multiple object tracking and segmentation (MOTS), also known as Video Instance Segmentation (VIS), is an important problem with many real-world applications, including autonomous driving [10, 26] and video analysis [4, 46]. The task involves tracking and segmenting all objects within a video from a given set of semantic classes. We are witnessing rapidly growing research interest on MOTS thanks to the introduction of large scale benchmarks [46, 50, 37]. State-of-the-art methods [46, 5, 37, 29] for MOTS mainly follow the tracking-by-detection paradigm, where objects are first detected and segmented in individual frames and then associated over time.
|
| 12 |
+
|
| 13 |
+
Although methods based on the popular tracking-by-detection philosophy have shown promising results, temporal modeling is limited to the object association phase [46, 5, 22] and only between two adjacent frames [37, 18]. On the other hand, the temporal dimension carries rich information about the scene. The information encoded in multiple temporal views of an object has the potential of improving the quality of predicted segmentation, localization, and categories. However, effectively and efficiently leveraging the rich temporal information remains a challenge. While sequential modeling has been applied for video processing [40, 41, 9, 28, 12], these methods generally operate directly on the high-resolution deep features, requiring large computational and memory consumption, which greatly limits their use.
|
| 14 |
+
|
| 15 |
+
We propose a Prototypical Cross-Attention Module, termed PCAM, to leverage temporal information for multiple object tracking and segmentation. As illustrated in Figure 1, the module first distills spatiotemporal information into condensed prototypes using clustering based on Expectation Maximization. The resulting prototypes, composed of Gaussian Components, yield a rich and generalizable yet compact representation of the past visual features. Given a deep feature embedding of the current frame, PCAM then employs prototypical cross-attention to read relevant information from prior frames.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We propose Prototypical Cross-Attention Network for MOTS, which first condenses the space-time memory and high-resolution frame embeddings into frame-level and instance-level prototypes. These are then employed to retrieve rich temporal information from past frames by our efficient prototypical cross-attention operation.
|
| 19 |
+
|
| 20 |
+
Based on the noise-reduced clustered video features information, we further develop a Prototypical Cross-Attention Network (PCAN) for MOTS, that integrates the general PCAM at two stages in the network: on the frame-level and instance-level. The former reconstructs and aligns temporal past frame features with current frame, while the instance level integrates specific information about each object in the video. For robustness to object appearance change, PCAN represents each object instance by learning sets of contrastive foreground and background prototypes, which are propagated in an online manner. With a limited number of prototypes for each instance or frame, PCAN efficiently performs long-range feature aggregation and propagation in a video with linear complexity. Consequently, our PCAN outperforms standard non-local attention [40] and video transformer [41] on both the large-scale Youtube-VIS and BDD100K MOTS benchmarks.
|
| 21 |
+
|
| 22 |
+
Our main contributions are summarized as follows: (i) We introduce the PCAN module for efficiently utilizing long-term spatio-temporal video information. (ii) We develop a MOTS approach that employs PCAN on frame and instance-level. (iii) We further represent the appearance of each video tracklet with contrastive foreground and background prototypes, which are propagated over time. (iv) We extensively analyze our approach. Our PCAN outperforms previous approaches on the challenging self-driving dataset BDD100K [50] and the semantically diverse YouTube-VIS dataset [46].
|
| 23 |
+
|
| 24 |
+
# 2 Related work
|
| 25 |
+
|
| 26 |
+
Video instance segmentation (VIS) Existing VIS methods [46, 2, 21] widely adapt the twostage paradigm of Mask R-CNN [11] and its variants [13, 15] by adding an additional tracking branch. Thus, their typical pipelines first detect regions of interest (RoIs) and then use the instance features after RoIAlign to regress object mask and associate cross-frame instances. More recent works [5, 18, 22, 48] employ a one-stage instance segmentation method, e.g. the anchor-free FCOS detector [34], which predicts a linear combination of mask bases [3] as its final segmentation. The aforementioned approaches make very limited use of temporal information to enhance the quality of the segmentation, instead relying on single image-based mask prediction, or only model short-term temporal correlation between two consecutive frames [18, 30]. In the context of long-term temporal association, the offline method VisTr [41] adapts vision transformer [6] for VIS, but suffers from a huge computational burden and memory consumption due to the dense pixel-level attention operations over long sequences. Compared to these methods, our PCAN temporally aggregates and propagates the prototypical features with both the long-term benefit and linear complexity.
|
| 27 |
+
|
| 28 |
+
Multiple Object Tracking and Segmentation (MOTS) Similar to VIS, MOTS methods [37, 27, 29] mainly follow the tracking-by-detection paradigm. Objects are first detected and segmented, followed by association between frames. Track R-CNN [37] integrates temporal context feature from two neighboring frames using 3D convolutions. TrackFormer [25] performs joint object detection and tracking by recurrently using Transformers, while Stem-Seg [1] adopts a short 3D convolutional spatio-temporal volume to learn pixel embedding by treating segmentation as a bottom-up grouping. In contrast, our approach clusters appearance features in a long spatio-temporal volume with explicit foreground and background prototypes that are updates online. Besides, the mixture Gaussian components in instance appearance module equips PCAN a stronger modeling ability compared to instance-level average pooling [33, 49] or single Gaussian model [51, 14].
|
| 29 |
+
|
| 30 |
+
Temporal attention models Video understanding usually requires long-range sequential modeling of relations between spatio-temporal locations. Recently, attention-based approaches, such as non-local attention [40, 39, 28, 12] and transformers [8, 35, 16], have been successfully adopted in video classification and action recognition. These tasks [23, 32, 43] involve dense pixel-level attention, leading to quadratic complexity in the sequence length, thus making them excessively expensive for long sequences. Improved temporal attention models mainly include double attention mechanism [7] on image recognition with global-local decomposition, and clustered attention Transformer [38] for language sequence modeling. Besides, recent prototypical methods [19, 45] use the EM algorithm for single-image semantic segmentation or few-shot learning [33]. Unlike these methods, our PCAN uses compact prototypical representation both for temporal feature aggregation and compact instance appearance feature propagation.
|
| 31 |
+
|
| 32 |
+
# 3 Method
|
| 33 |
+
|
| 34 |
+
We propose an approach for Multiple Object Tracking and Segmentation. Given a video sequence, the goal is to detect, track, and segment objects from a predefined set of object categories. Specifically, we consider the online setting, where the predictions only depend on current and past frames.
|
| 35 |
+
|
| 36 |
+
# 3.1 Traditional Cross-Attention
|
| 37 |
+
|
| 38 |
+
To utilize the rich temporal information to improve the segmentation prediction, recent approaches [28, 12] have employed cross-attention. We consider past spatio-temporal information encoded in a memory M, consisting of deep features of size $H \times W \times T \times C$ . The memory encapsulates valuable information about the past appearances and predictions of objects and background in a scene. To attend to the memory, the information is first separately embedded into key $\mathbf { k } ^ { M }$ and value $\mathbf { v } ^ { M }$ feature vectors. The keys are used to address relevant memories whose corresponding values are returned. The standard memory reading process is a non-local operation computed as the weighted sum,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
y _ { i } = \frac { 1 } { Z _ { i } } \sum _ { j = 1 } ^ { H \times W \times T } \exp ( \mathbf { k } _ { i } ^ { Q } \cdot \mathbf { k } _ { j } ^ { M } ) \mathbf { v } _ { j } ^ { M } ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\mathbf { k } ^ { Q }$ denotes query key map, which is predicted from the current frame. Further, $i$ and $j$ are the index of each query and the memory location, and $\begin{array} { r } { Z _ { i } = \sum _ { j } \exp ( \mathbf { k } _ { i } ^ { Q } \cdot \mathbf { k } _ { j } ^ { M } ) } \end{array}$ is the normalizing factor.
|
| 45 |
+
|
| 46 |
+
Although proven effective, the standard attention operation (1) is known to suffer from poor computational and memory scaling properties [20]. In particular, since all queries are matched to all keys, it experiences a quadratic scaling $\mathcal { O } ( ( H W ) ^ { 2 } )$ of computations in the spatial size $H W$ of the feature map. This is particularly problematic for segmentation tasks, where fine-grained high-resolution information is desired to improve the quality of the predictions.
|
| 47 |
+
|
| 48 |
+
# 3.2 Prototypical Cross-Attention
|
| 49 |
+
|
| 50 |
+
To address the aforementioned limitations of the standard cross-attention, we introduce the prototypical cross-attention to first condense sets of high-resolution feature vectors in the past frames. Our approach is based on a clustered memory $\mathbf { M } _ { c }$ . We call these clusters prototypes, since they correspond to representative items in the memory. While clustering effectively reduces the number of items in the memory, it also serves to deprecate noisy information, leading to a more generalizable and robust representation of the memory.
|
| 51 |
+
|
| 52 |
+
To employ an attention mechanism, similar to (1), we require a clustering of the memory that generates a principled continuous and differentiable clustering assignment function. We therefore cluster the keys in the memory by fitting a Gaussian Mixture Model (GMM),
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Overview of our frame-level prototypical cross-attention. For a frame $\hat { t }$ in the memory we first perform GMM-based clustering to achieve the key $\mathbf { k } _ { \hat { t } j } ^ { \mu }$ and value $\mathbf { v } _ { \hat { t } j } ^ { \mu }$ prototypes. Given the key encoding $\mathbf { k } _ { t }$ of the current frame, we attend to the prototypes to generate the reconstructed feature $\mathbf { y } _ { \hat { t } }$ , which are then aggregated temporally and fused with the current value encoding $\mathbf { v } _ { t }$ .
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
p ( \mathbf { k } ) = \frac { 1 } { N } \sum _ { j = 1 } ^ { N } p ( \mathbf { k } | z = j ) , \qquad p ( \mathbf { k } | z = j ) = \frac { 1 } { ( 2 \pi \sigma ^ { 2 } ) ^ { \frac { D } { 2 } } } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { k } - \mathbf { k } _ { j } ^ { \mu } \| ^ { 2 } \right)
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Here, $N$ denotes the number of Gaussian mixtures, $D$ is the feature dimension of the keys. We use a constant variance parameter $\sigma ^ { 2 }$ and uniform cluster priors $\begin{array} { r } { p ( z = j ) = \frac { 1 } { N } } \end{array}$ , where $z$ denotes the latent cluster assignment variable. The component means $\mathbf { k } ^ { \mu }$ represent the prototype keys in the memory. We generate the clustering (2) using the standard Expectation-Maximization algorithm.
|
| 62 |
+
|
| 63 |
+
The GMM allows us to compute a soft cluster assignment by evaluating the posterior probability of the latent assignment variable $z$ . Using Bayes rule, the probability of a key value $\mathbf { k }$ to be assigned to the $j$ th prototype is derived as,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
p ( z = j | \mathbf { k } ) = \frac { p ( \mathbf { k } | z = j ) p ( z = j ) } { \sum _ { l = 1 } ^ { N } p ( \mathbf { k } | z = l ) p ( z = l ) } = \frac { \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { k } - \mathbf { k } _ { j } ^ { \mu } \| ^ { 2 } \right) } { \sum _ { l = 1 } ^ { N } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { k } - \mathbf { k } _ { l } ^ { \mu } \| ^ { 2 } \right) } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The resulting cluster assignment can thus be written as a SoftMax operation, where the corresponding logits are provided by the negative cluster distance $\| \mathbf { k } - \mathbf { k } _ { j } ^ { \mu } \| ^ { 2 }$ scaled with a temperature of $2 \sigma ^ { 2 }$ .
|
| 70 |
+
|
| 71 |
+
Since the clustering is performed in the key space of the memory, we next retrieve the corresponding value prototypes. To this end, we employ the key cluster assignment probabilities in (3) to compute the values for each memory prototype,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathbf { v } _ { j } ^ { \mu } = \sum _ { l = 1 } ^ { H \times W } p ( z = j | \mathbf { k } _ { l } ^ { M } ) \mathbf { v } _ { l } ^ { M } .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
For attending to our clustered memory, we first predict the key encodings We then read from the clustered memory by computing the average over t $\mathbf { k } _ { i } ^ { Q }$ of the query imvalue prototypes $\mathbf { v } _ { j } ^ { \mu }$ weighted with the cluster assignment probabilities,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathbf { y } _ { i } = \sum _ { j = 1 } ^ { N } p ( z = j | \mathbf { k } _ { i } ^ { Q } ) \mathbf { v } _ { j } ^ { \mu } = \frac { 1 } { Z _ { i } } \sum _ { j = 1 } ^ { N } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { k } _ { i } ^ { Q } - \mathbf { k } _ { j } ^ { \mu } \| ^ { 2 } \right) \mathbf { v } _ { j } ^ { \mu } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
The final attention operation has much similarity with the original dot-product cross attention (1). Note that the key-query similarity in our approach is measured by Euclidian distance instead of a dot-product. Importantly, our formulation (5) attends to a reduced set of $N$ prototypes, while the original attention (1) requires attending to the full spatio-temporal memory of size $H \times W \times T$ .
|
| 84 |
+
|
| 85 |
+
# 3.3 Prototypical Cross-Attention Network
|
| 86 |
+
|
| 87 |
+
Here, we propose the Prototypical Cross-Attention Network (PCAN) for MOTS by integrating our prototypical cross-attention module into both the frame-level and instance-level. The former aims to align and aggregate temporal frame features stored in memory, while the latter is for propagating the instance appearance features over time and produce instance cross-attention maps to help segmentation. Besides, we also design a prototypical instance appearance module to represent each video tracklet with contrastive mixture foreground and background prototypes.
|
| 88 |
+
|
| 89 |
+
# 3.3.1 Frame-level Prototypical Cross-Attention
|
| 90 |
+
|
| 91 |
+
In Figure 2, prototypical cross-attention first produces prototypes by fitting a Gaussian mixtures model (2) to the feature in the memory. To provide further flexibility when dynamically updating the memory compute the $\mathbf { M }$ , we first perforkey prototypes wise clustering for each reference frame feature at , and retrieve the corresponding value embeddings $\hat { t }$ $N$ $\{ \mathbf { k } _ { \hat { t } i } ^ { \mu } \} _ { j = 1 } ^ { N }$ $\{ \mathbf { v } _ { \hat { t } j } ^ { \mu } \} _ { j = 1 } ^ { N }$ using (4) for each memory frame $\hat { t }$ independently. The key and value features are predicted using two parallel convolutional layers.
|
| 92 |
+
|
| 93 |
+
Frame-wise prototypical memory attention Given the query key encoding $\mathbf { k } _ { t i } ^ { Q }$ of the current frame $t$ , we perform prototypical cross-attention to each memory frame $\hat { t }$ independently using our formulation (3) as,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
{ \bf y } _ { \hat { t } i } = \frac { 1 } { Z _ { \hat { t } \hat { t } } } \sum _ { j = 1 } ^ { N } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| { \bf k } _ { t i } - { \bf k } _ { \hat { t } j } ^ { \mu } \| ^ { 2 } \right) { \bf v } _ { \hat { t } j } ^ { \mu } , \qquad Z _ { \hat { t } i } = \sum _ { l = 1 } ^ { N } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \| { \bf k } _ { t i } ^ { Q } - { \bf k } _ { \hat { t } \hat { t } } ^ { \mu } \| ^ { 2 } \right) .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Note that the index $i$ refers to a spatial coordinate in the current frame. The resulting feature map $\mathbf { y } _ { \hat { t } }$ can intuitively be seen as a projection of features from frame $\hat { t }$ to the current frame. This projection essentially aligns the condensed feature information in frame $\hat { t }$ with the current frame.
|
| 100 |
+
|
| 101 |
+
Temporal feature aggregation Since frame-wise attention does not fuse temporal information, we perform a temporal aggregation. The temporal information $\mathbf { y } _ { \hat { t } }$ in (6) from different frames $\hat { t }$ are fused as a linear combination, weighted by the feature similarity with the current frame. Specifically, the temporally aggregated representation is obtained as
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\bar { \mathbf { y } } _ { t i } = \sum _ { \hat { t } = 1 } ^ { t } w _ { \hat { t } i } \mathbf { y } _ { \hat { t } i } , \qquad w _ { \hat { t } i } = \frac { \exp ( \mathbf { y } _ { t i } \cdot \mathbf { y } _ { \hat { t } i } ) } { \sum _ { s = 1 } ^ { t } \exp ( \mathbf { y } _ { t i } \cdot \mathbf { y } _ { s i } ) } .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Note that ${ \hat { t } } = t$ in the sum refers to the value embedding $\mathbf { y } _ { t i } = \mathbf { v } _ { t i } ^ { Q }$ extracted from the current frame. The contribution of each frame $\hat { t }$ is thus weighted by the similarity to this current frame prediction using the attention weights $w _ { \hat { t } i }$ . This strategy ensures that incorrect or dissimilar regions are suppressed when computing the final aggregated feature embedding $\bar { \mathbf { y } } _ { t }$ . To handle object with large-scale variation and produce more fine-grained instance mask prediction, we further extend temporal aggregation to multi-level using different levels of the extracted FPN features, as detailed in the supplementary material.
|
| 108 |
+
|
| 109 |
+
# 3.3.2 Instance-level Prototypical Cross-Attention
|
| 110 |
+
|
| 111 |
+
Contrastive foreground and background representation In additional to the condensed frame-level representation, for more accurate segmentation results, we further encode each tracked object with compact and robust appearance prototypes. To further empower our proposed attention mechanism, we utilize the initially detected object mask to identify each foreground instance. We then separately model the extracted foreground and background features using a GMM (2). We denote the resulting foreground prototypes as $\mathbf { k } _ { t j . } ^ { + }$ and background prototypes as $\mathbf { k } _ { t j } ^ { - }$ . The former thus focuses on the appearance of the specific object, creating a rich and dynamic appearance model. When employed in our prototypical cross-attention framework (Section 3.2), it provides fine-grained attention from localized prototypes that naturally learn to focus specific parts of views of the object, as visualized in Fig. 3. Furthermore, the background prototypes $\mathbf { k } _ { t j } ^ { - }$ capture valuable information about the background appearance, which can greatly alleviate the segmentation process. For each object instance we attend to the foreground and background prototypes separately using (3). The results are concatenated together with the initial mask detection to the Temporal Segmentation Head (TSM) for final prediction, as illustrated in Figure 3.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Our instance-level prototypical attention with foreground and background prototypes and temporal propagation. The foreground/background attention maps from (bottom) demonstrate the localized and discriminative appearance representation. Temporal Segmentation Module (TSM) takes the current frame, initial mask, and instance attention maps as input and generates the final mask.
|
| 115 |
+
|
| 116 |
+
Tracklet feature propagation and updating To effectively model the object appearance change and preserve the most relevant information, we design a recurrent instance appearance updating scheme. From the first video frame where object appears, the accumulated prototypes $\bar { \mathbf { k } } _ { t j } ^ { + }$ , $\bar { \mathbf { k } } _ { t j } ^ { - }$ for the instance are propagated to the subsequent frames and updated with new appearance prototypes $\mathbf { k } _ { t j } ^ { + }$ , $\mathbf { k } _ { t j } ^ { - }$ using an update rate $\lambda$ as,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\bar { \mathbf { k } } _ { t j } ^ { + } = ( 1 - \lambda ) \bar { \mathbf { k } } _ { t - 1 , j } ^ { + } + \lambda \mathbf { k } _ { t j } ^ { + } , \qquad \bar { \mathbf { k } } _ { t j } ^ { - } = ( 1 - \lambda ) \bar { \mathbf { k } } _ { t - 1 , j } ^ { - } + \lambda \mathbf { k } _ { t j } ^ { - } .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Figure 3 also reveals the consistency of the attended region of a specific prototype $j$
|
| 123 |
+
|
| 124 |
+
# 4 Experiments
|
| 125 |
+
|
| 126 |
+
Here, we present comprehensive evaluation and analysis of our approach. Experiments are performed on two large scale datasets, namely YouTube-VIS [46] and BDD100K [50].
|
| 127 |
+
|
| 128 |
+
# 4.1 Experiment setup
|
| 129 |
+
|
| 130 |
+
Youtube-VIS YouTube-VIS-2019 [46] dataset contains 2,883 high quality videos with 131k annotated object instances belonging to 40 diverse categories. The task is to simultaneously classifying, segment and track object instances belonging to these categories. The evaluation metrics for this task are an adaptation of the Average Precision (AP) and Average Recall (AR) of image instance segmentation.
|
| 131 |
+
|
| 132 |
+
BDD100K We also evaluate on the large-scale tracking and segmentation dataset of BDD100K [50], which is a challenging self-driving dataset with 154 videos (30,817 images) for training, 32 videos (6,475 images) for validation, and 37 videos (7,484 images) for testing. The dataset provides 8 annotated categories for evaluation, where the images in the tracking set are annotated per 5 FPS with 30 FPS frame rate. We adopt the well-established MOTS metrics [37] to our task.
|
| 133 |
+
|
| 134 |
+
Implementation details We implement PCAN based on two different existing MOTS approaches. For Youtube-VIS, we adopt ResNet with FPN pre-trained on COCO as the backbone, and build our segmentation tracker on the one-stage segmentation model [5]. Both the instance and frame cross-attention is built on the extracted FPN features. Our model is trained with initial learning rate 0.0025 on 4 GPUs using SGD, and executes with a speed of 15.0 FPS on ResNet-50. Similar to [46, 22, 18], we use the input size $3 6 0 \times 6 4 0$ for training. On BDD100K, we build PCAN by extending the two-stage MOT method [29] with our temporal segmentation modules. We follow the same training strategy of QDTrack-mots [29]. More details can be found in supplemental material.
|
| 135 |
+
|
| 136 |
+
Table 1: Comparison with state-of-the-art on the YouTube-VIS validation set. Results are reported in terms of mask accuracy (AP) and recall (AR). Asterisks ∗ denote concurrent works on arXiv.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Method</td><td>Backbone</td><td>Type</td><td>Online</td><td>AP</td><td>AP50</td><td>AP75</td><td>AR1</td><td>AR10</td></tr><tr><td>VisTr*[41]</td><td>ResNet-50</td><td>Transformer</td><td>×</td><td>35.6</td><td>56.8</td><td>37.0</td><td>35.2</td><td>40.2</td></tr><tr><td>OSMN [47]</td><td>ResNet-50</td><td>Two-stage</td><td>√</td><td>23.4</td><td>36.5</td><td>25.7</td><td>28.9</td><td>31.1</td></tr><tr><td>FEELVOS [36]</td><td>ResNet-50</td><td>Two-stage</td><td>√</td><td>26.9</td><td>42.0</td><td>29.7</td><td>29.9</td><td>33.4</td></tr><tr><td>DeepSORT[42]</td><td>ResNet-50</td><td>Two-stage</td><td>√</td><td>26.1</td><td>42.9</td><td>26.1</td><td>27.8</td><td>31.3</td></tr><tr><td>MaskTrack R-CNN [46]</td><td>ResNet-50</td><td>Two-stage</td><td>√</td><td>30.3</td><td>51.1</td><td>32.6</td><td>31.0</td><td>35.5</td></tr><tr><td>STEm-Seg[1]</td><td>ResNet-50</td><td> One-stage</td><td></td><td>30.6</td><td>50.7</td><td>33.5</td><td>31.6</td><td>37.1</td></tr><tr><td>SipMask [5]</td><td>ResNet-50</td><td>One-stage</td><td></td><td>32.5</td><td>53.0</td><td>33.3</td><td>33.5</td><td>38.9</td></tr><tr><td>STMask*[18]</td><td>ResNet-50</td><td>One-stage</td><td>x<></td><td>33.5</td><td>52.1</td><td>36.9</td><td>31.1</td><td>39.2</td></tr><tr><td>SG-Net* [22]</td><td>ResNet-50</td><td>One-stage</td><td>√</td><td>34.8</td><td>56.1</td><td>36.8</td><td>35.8</td><td>40.8</td></tr><tr><td>PCAN (Ours)</td><td>ResNet-50</td><td>One-stage</td><td>√</td><td>36.1</td><td>54.9</td><td>39.4</td><td>36.3</td><td>41.6</td></tr><tr><td>STMask*[18]</td><td>ResNet-101</td><td>One-stage</td><td>√</td><td>36.3</td><td>55.2</td><td>39.9</td><td>33.7</td><td>42.0</td></tr><tr><td>SG-Net* [22]</td><td>ResNet-101</td><td>One-stage</td><td>√</td><td>36.3</td><td>57.1</td><td>39.6</td><td>35.9</td><td>43.0</td></tr><tr><td>PCAN (Ours)</td><td>ResNet-101</td><td>One-stage</td><td>√</td><td>37.6</td><td>57.2</td><td>41.3</td><td>37.2</td><td>43.9</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 2: State-of-the-art comparison on the BDD100K segmentation tracking validation set. I: ImageNet. C: COCO. S: Cityscapes. B: BDD100K. "-fix" means adopting the pretrained model from the BDD100K tracking set, fixing the existing parts, and only training the added mask head.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Method</td><td>Pretrained</td><td>Online</td><td>mMOTSA↑</td><td>mMOTSP↑</td><td>mIDF个</td><td>ID sw.↓</td><td>mAP↑</td></tr><tr><td>SortIoU</td><td>I, C, S</td><td>√</td><td>10.3</td><td>59.9</td><td>21.8</td><td>15951</td><td>22.2</td></tr><tr><td>MaskTrackRCNN [36]</td><td>I, C, S</td><td>√</td><td>12.3</td><td>59.9</td><td>26.2</td><td>9116</td><td>22.0</td></tr><tr><td>STEm-Seg [1]</td><td>1,C, s</td><td>×</td><td>12.2</td><td>58.2</td><td>25.4</td><td>8732</td><td>21.8</td></tr><tr><td>QDTrack-mots [29]</td><td>1, C,S</td><td>√</td><td>22.5</td><td>59.6</td><td>40.8</td><td>1340</td><td>22.4</td></tr><tr><td>QDTrack-mots-fix [29]</td><td>I, B</td><td>√</td><td>23.5</td><td>66.3</td><td>44.5</td><td>973</td><td>25.5</td></tr><tr><td>PCAN (Ours)</td><td>I,B</td><td>√</td><td>27.4</td><td>66.7</td><td>45.1</td><td>876</td><td>26.6</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# 4.2 State-of-the-Art Comparison
|
| 145 |
+
|
| 146 |
+
We compare our approach with the state-of-the-art methods on the aforementioned large-scale MOTS/VIS benchmarks Youtube-VIS and BDD100K, where PCAN outperforms all existing methods without bells and whistles, and shows efficacy to both one-stage and two-stage segmentation frameworks. We follow the official metrics of each benchmark to evaluate our model.
|
| 147 |
+
|
| 148 |
+
Youtube-VIS The results of Youtube-VIS benchmark is in Table 1, where PCAN achieves the best mask AP of $3 6 . 1 \%$ using ResNet-50 and $3 7 . 6 \%$ using ResNet-101 respectively, while being an online method. Our approach consistently surpasses most recent SOTA methods, including STMask [18] and SG-Net [22] by a significant margin. These methods only conduct temporal modeling between two adjacent frames for feature correlation. Compared to our baseline SipMask [5], a single-image based segmentation with object centerness association, PCAN improves the mask AP from $3 2 . 5 \%$ to $3 6 . 1 \%$ , which shows the effectiveness of long-term temporal modeling in helping object tracking and segmentation.
|
| 149 |
+
|
| 150 |
+
BDD100K Table 2 shows our results on BDD100K tracking and segmentation benchmark, where PCAN outperforms the strong baseline methods MaskTrackRCNN [46] and QDTrack-mots [29]. Our approach achieves a large advantage in mMOTSA, with over 3 points gain and around $10 \%$ ID switches decrease. MOTSA measures segmentation as well as tracking quality, while ID Switches can measure the performance of identity consistency. The significant advancements demonstrate that our method with prototypical cross-attention enables more accurate pixel-wise object tracking by effectively exploiting temporal information.
|
| 151 |
+
|
| 152 |
+
# 4.3 Ablation study and analysis
|
| 153 |
+
|
| 154 |
+
We conduct detailed ablation studies on Youtube-VIS validation set, where we investigate the effect of our proposed prototypical cross-attention components for MOTS during training and testing.
|
| 155 |
+
|
| 156 |
+
Effect of frame-level prototypical cross-attention module To study the importance of temporal information amount, we conduct an ablation study on models with different input temporal window lengths in Table 3. A temporal length of 1 thus means that no prior temporal information guidance is used during video instance segmentation. By varying the frame length from 1 to 32, the mask AP increases from $3 2 . 5 \%$ to $3 5 . 4 \%$ , which reveals that richer temporal information with multiple views of a segmented object indeed brings more gain to model performance. For the number of frame-level prototypes, we used 64 during training and testing. The results on YouTube-VIS in Table 8 show that the precision saturates for larger numbers of prototypes.
|
| 157 |
+
|
| 158 |
+
Table 3: Results of varying temporal memory length in our PCAN on YouTube-VIS.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Length</td><td>AP</td><td>AP50</td><td>AP75</td><td>AR1</td><td>AR10</td></tr><tr><td>1</td><td>32.5</td><td>53.0</td><td>33.3</td><td>33.5</td><td>38.9</td></tr><tr><td>2</td><td>33.7</td><td>53.8</td><td>35.3</td><td>33.9</td><td>39.5</td></tr><tr><td>4</td><td>33.9</td><td>54.0</td><td>36.8</td><td>34.1</td><td>40.0</td></tr><tr><td>8</td><td>34.2</td><td>53.7</td><td>37.6</td><td>34.4</td><td>40.3</td></tr><tr><td>16</td><td>34.6</td><td>53.7</td><td>38.3</td><td>35.4</td><td>40.5</td></tr><tr><td>32</td><td>35.4</td><td>53.8</td><td>39.1</td><td>35.9</td><td>41.0</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 4: Effect of multi-layer prototypical feature fusion with tube length 4 on YouTube-VIS.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>FPN Layer</td><td>AP</td><td>AP50</td><td>AP75</td><td>AR1</td><td>AR10</td></tr><tr><td>P3</td><td>30.8</td><td>51.7</td><td>32.0</td><td>32.6</td><td>37.0</td></tr><tr><td>P4</td><td>32.0</td><td>51.5</td><td>34.1</td><td>32.6</td><td>37.2</td></tr><tr><td>P5</td><td>32.9</td><td>52.1</td><td>35.9</td><td>33.2</td><td>38.6</td></tr><tr><td>P3-P4</td><td>33.1</td><td>52.3</td><td>35.6</td><td>33.6</td><td>38.5</td></tr><tr><td>P3-P5</td><td>33.9</td><td>54.0</td><td>36.8</td><td>34.1</td><td>40.0</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 5: Comparison with non-local attention [39] and transformer [6, 41] on YouTube-VIS.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Length</td><td colspan="3">Prototypical Cross-Attention</td><td colspan="3">Non-local Attention</td><td colspan="3">Transformer (Multi-Head Self-Attention)</td></tr><tr><td>AP</td><td>FLOPs(B)</td><td>Memory(M)</td><td>AP</td><td>FLOPs(B)</td><td>Memory(M)</td><td>AP</td><td>FLOPs(B)</td><td>Memory(M)</td></tr><tr><td>2</td><td>33.7</td><td>5.8</td><td>323</td><td>33.2</td><td>24.3</td><td>2497</td><td>24.6</td><td>103.8</td><td>5321</td></tr><tr><td>4</td><td>33.9</td><td>12.0</td><td>652</td><td>33.3</td><td>49.1</td><td>4763</td><td>25.8</td><td>387.2</td><td>9844</td></tr><tr><td>8</td><td>34.2</td><td>23.7</td><td>1419</td><td>33.6</td><td>99.6</td><td>9631</td><td>28.3</td><td>1413.3</td><td>18762</td></tr></table>
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Qualitative impact of our PCAM on YouTube-VIS. Mask colors encode object identity. Our frame-level PCAM (second row) helps provide consistent detections and preserve identities compared to the baseline (first row). The instance-level PCAM (fourth row) provides more accurate masks, while further improving identity consistency compared to not employing our module (third row).
|
| 172 |
+
|
| 173 |
+
Effect of multi-layer temporal aggregation Since we perform temporal feature aggregation on the extracted FPN features, to help deal with objects with partial occlusion and large-scale variation, we also study the effect of using different levels of the extracted FPN features. In Table 4, we select the FPN feature map from P3-P5 layers for (excluding P6 and P7 due to impractical computation cost), and perform prototypical temporal aggregation on each FPN layer. We find that multi-layer information is also important to final model performance.
|
| 174 |
+
|
| 175 |
+
Computation and memory efficiency In Table 5 we analyze different attention mechanisms. Compared to standard space-time memory reading using non-local attention [39, 28] or recent popular transformer [41, 6] with multi-head self-attention layer, the prototypical cross-attention with condensed prototypes not only enjoys high accuracy advantage, but also largely reduces the memory consumption and computation amount. For input tube length 8, the prototypical memory consumption is less than $10 \%$ of the transformer with negligible FLOPs computation due to the small number of representative prototypes in (5).
|
| 176 |
+
|
| 177 |
+
Effect of instance-level prototypical appearance module We analyze the instance-level prototypical cross-attention module, which represents each video tracklet using the contrastive prototypes. In
|
| 178 |
+
|
| 179 |
+
Table 6: Ablation study on number of instancelevel prototypes on YouTube-VIS.
|
| 180 |
+
|
| 181 |
+
<table><tr><td rowspan=1 colspan=1>Pos.Proto.Number丨Neg.Proto.Number</td><td rowspan=1 colspan=1>Pos.Proto.Number丨Neg.Proto.Number</td><td rowspan=1 colspan=1>AP AP50</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>32.5 53.0</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>32.4 52.3</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>32.1 52.4</td></tr><tr><td rowspan=2 colspan=1>15</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>32.7 52.8</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>33.1 53.6</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>33.9 54.1</td></tr><tr><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>33.6 53.8</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 7: Ablation on instance-level EM feature propagation and updating on YouTube-VIS.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>version</td><td>AP</td><td>AP50</td></tr><tr><td>No instance prototype propagation</td><td>33.5</td><td>53.2</td></tr><tr><td>Using initial instance prototype</td><td>33.0</td><td>52.8</td></tr><tr><td>Update momentum = 0.2</td><td>34.3</td><td>53.8</td></tr><tr><td>Update momentum = 0.5</td><td>34.0</td><td>53.6</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Table 8: Ablation on number of framelevel prototypes on YouTube-VIS.
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Proto.Number</td><td>AP</td><td>AP50</td></tr><tr><td>8</td><td>32.6</td><td>52.8</td></tr><tr><td>16</td><td>33.1</td><td>53.3</td></tr><tr><td>32</td><td>33.9</td><td>53.5</td></tr><tr><td>64</td><td>34.2</td><td>53.7</td></tr><tr><td>128</td><td>34.1</td><td>53.8</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 9: Results of varying EM iterations for our PCAN on YouTube-VIS.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Iteration number</td><td>AP</td><td>AP50</td><td>AP75</td><td>AR1</td><td>AR10</td></tr><tr><td>1</td><td>33.3</td><td>53.4</td><td>35.8</td><td>33.2</td><td>38.8</td></tr><tr><td>2</td><td>33.7</td><td>53.9</td><td>36.4</td><td>33.6</td><td>39.3</td></tr><tr><td>4</td><td>33.7</td><td>54.1</td><td>36.5</td><td>33.9</td><td>39.5</td></tr><tr><td>6</td><td>33.9</td><td>54.0</td><td>36.8</td><td>34.1</td><td>40.0</td></tr><tr><td>8</td><td>33.6</td><td>53.6</td><td>36.1</td><td>33.7</td><td>39.3</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Table 6, we study the influence of instance prototype number and the effect of foreground-background contrasting. Using both positive and negative prototypes improves AP from $3 2 . 5 \%$ to $3 3 . 9 \%$ . Compared to the single prototype representation, the GMM demonstrate a stronger appearance modeling ability. We further find that the performance saturates when the number is larger than 60. In the Figure 6 and supplementary file, we provide additional instance cross-attention maps visualization to highlight the various attended regions.
|
| 196 |
+
|
| 197 |
+
In Table 7, we investigate the effectiveness of instance prototype (including the both positive and negative ones) propagation in an online manner, and compared it with using the instance prototype in the initial frame or current frame. We find that updating object prototypes recurrently with a momentum of 0.2 improves video segmentation AP of $1 . 3 \%$ .
|
| 198 |
+
|
| 199 |
+
Influence of EM iteration number We study the influence of EM iteration number $T$ during condensing prototypes and the results are shown in Table 9. Using temporal memory length 4, we find that the accuracy gains of PCAN increase with more iterations from 1 to 6, and the improvement starts to saturate when $T \geqslant 6$ . We use the same iteration number during training and test.
|
| 200 |
+
|
| 201 |
+
Ablation study on KITTI-MOTS We also train PCAN on the KITTI-MOTS [37] training set and conduct ablations on the instance and frame PCAMs. In Table 10, PCAN with window size 8 on val set also shows significant improvements compared to the TrackR-CNN [37] (a two-stage tracker based on Mask R-CNN) on the benchmark. Note that many published methods on KITTI-MOTS, such as Vip-DeepLab [31], EagerMOT [17] and MOTSFusion [24], use 3D bounding boxes, LIDAR point clouds, or optical flow (PointTrack [44]). In contrast, our method only relies on RGB images.
|
| 202 |
+
|
| 203 |
+
Qualitative analysis In Figure 4, we showcase qualitative ablation results of PCAN on Youtube-VIS. Compared to the baseline, we see that our model results in more consistent segmentation and better tracking using prototypical cross-attention module. We also provide visual results on BDD100K in Figure 5, where PCAN produces robust tracking and segmentation results even under large object appearance change (first row) or low illumination (second row). In the 3rd row, PCAN has limitations in handling missing detections (the person in the first frame) with limited appearance information under extreme lighting, and produce tracking errors in the second frame when visible parts of the same car is totally different across frame and with low appearance similarity.
|
| 204 |
+
|
| 205 |
+
Cross-Attention Visualization In Figure 6, we visualize instance-level prototypical cross-attention of the interested car for both the corresponding foreground and background regions on three continuous frames on BDD100K, where the attended region of each object prototype reveals the implicit unsupervised temporal consistency. More visualization cases on instance and frame cross-attention maps and relevant analysis are in the supplementary file.
|
| 206 |
+
|
| 207 |
+
Societal impact PCAN has high potential impact in important applications, such as transportation, sports analysis, and self-driving vehicles. However, this powerful technology can be deployed in human monitoring and surveillance as well which raise ethical and privacy issues. Potential negative impact can be avoided by enforcing a strict and secure data privacy regulation such as the GDPR,
|
| 208 |
+
|
| 209 |
+
Table 10: Ablation study of PCAN on KITTI-MOTS [37] validation set.
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Method</td><td>|Car-MOTSA</td><td>Ped-MOTSA</td><td>Car-MOTSP</td><td>Ped-MOTSP</td></tr><tr><td>TrackR-CNN [37]</td><td>87.8</td><td>65.1</td><td>87.2</td><td>75.7</td></tr><tr><td rowspan="3">PCAN w/o frame PCAM PCAN w/o instance PCAM</td><td>87.3</td><td>65.3</td><td>86.9</td><td>75.0</td></tr><tr><td>87.8</td><td>65.8</td><td>87.1</td><td>75.5</td></tr><tr><td>89.6</td><td>66.4</td><td>88.3</td><td>76.1</td></tr></table>
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 5: Qualitative results of our method on BDD100K. PCAN produces robust tracking and segmentation results under large motion and appearance changes (1st row) and heavy traffic in low-light conditions (2nd row). In the 3rd row, PCAN misses a detection (the person to the left in 1st frame), and produces tracking errors (2nd frame) when it covers totally different regions of the car with low appearance similarity. Zoom for better view. Video results are in the suppl. file.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 6: Instance cross-attention maps visualization for the car specified by the red dotted bounding box on BDD100K. We select the first four foreground/background prototypes as example, where each one focuses on specific car sub-regions with implicit unsupervised temporal consistency over time. proper technology management education, and having an open dialogue among various stakeholders on how such technology should be deployed and regulated.
|
| 218 |
+
|
| 219 |
+
# 5 Conclusion
|
| 220 |
+
|
| 221 |
+
We present PCAN, a new online method for MOTS. PCAN first distills the space-time memory into a set of frame-level and instance-level prototypes, followed by cross-attention to retrieve rich information from the past frames. In contrast to most previous MOTS methods with limited temporal consideration, PCAN efficiently performs long-term temporal propagation and aggregation, and achieves large performance gain on the two largest MOTS benchmarks with low computation and memory cost. We validate the efficacy of PCAN on both the existing one-stage and two-stage trackers. We believe PCAN will significantly benefit more video understanding tasks in the future.
|
| 222 |
+
|
| 223 |
+
# Acknowledgments and Disclosure of Funding
|
| 224 |
+
|
| 225 |
+
This research is supported in part by the Research Grant Council of the Hong Kong SAR under grant no. 16201818 and Kuaishou Technology.
|
| 226 |
+
|
| 227 |
+
# References
|
| 228 |
+
|
| 229 |
+
[1] Ali Athar, Sabarinath Mahadevan, Aljoša Ošep, Laura Leal-Taixé, and Bastian Leibe. Stem-seg: Spatiotemporal embeddings for instance segmentation in videos. In ECCV, 2020. [2] Gedas Bertasius and Lorenzo Torresani. Classifying, segmenting, and tracking object instances in video with mask propagation. In CVPR, 2020.
|
| 230 |
+
[3] Daniel Bolya, Chong Zhou, Fanyi Xiao, and Yong Jae Lee. Yolact: Real-time instance segmentation. In ICCV, 2019.
|
| 231 |
+
[4] Sergi Caelles, Kevis-Kokitsi Maninis, Jordi Pont-Tuset, Laura Leal-Taixé, Daniel Cremers, and Luc Van Gool. One-shot video object segmentation. In CVPR, 2017.
|
| 232 |
+
[5] Jiale Cao, Rao Muhammad Anwer, Hisham Cholakkal, Fahad Shahbaz Khan, Yanwei Pang, and Ling Shao. Sipmask: Spatial information preservation for fast image and video instance segmentation. In ECCV, 2020.
|
| 233 |
+
[6] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
|
| 234 |
+
[7] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. $a ^ { 2 }$ -nets: Double attention networks. In NeurIPS, 2018.
|
| 235 |
+
[8] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2020.
|
| 236 |
+
[9] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In ICCV, 2019.
|
| 237 |
+
[10] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, 2012.
|
| 238 |
+
[11] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017.
|
| 239 |
+
[12] Ping Hu, Fabian Caba, Oliver Wang, Zhe Lin, Stan Sclaroff, and Federico Perazzi. Temporally distributed networks for fast video semantic segmentation. In CVPR, 2020.
|
| 240 |
+
[13] Zhaojin Huang, Lichao Huang, Yongchao Gong, Chang Huang, and Xinggang Wang. Mask scoring r-cnn. In CVPR, 2019.
|
| 241 |
+
[14] Joakim Johnander, Martin Danelljan, Emil Brissman, Fahad Shahbaz Khan, and Michael Felsberg. A generative appearance model for end-to-end video object segmentation. In CVPR, 2019.
|
| 242 |
+
[15] Lei Ke, Yu-Wing Tai, and Chi-Keung Tang. Deep occlusion-aware instance segmentation with overlapping bilayers. In CVPR, 2021.
|
| 243 |
+
[16] Lei Ke, Yu-Wing Tai, and Chi-Keung Tang. Occlusion-aware video object inpainting. In ICCV, 2021.
|
| 244 |
+
[17] Aleksandr Kim, Aljoša Ošep, and Laura Leal-Taix’e. Eagermot: 3d multi-object tracking via sensor fusion. In IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 245 |
+
[18] Minghan Li, Shuai Li, Lida Li, and Lei Zhang. Spatial feature calibration and temporal fusion for effective one-stage video instance segmentation. In CVPR, 2021.
|
| 246 |
+
[19] Xia Li, Zhisheng Zhong, Jianlong Wu, Yibo Yang, Zhouchen Lin, and Hong Liu. Expectation-maximization attention networks for semantic segmentation. In ICCV, 2019.
|
| 247 |
+
[20] Yingwei Li, Xiaojie Jin, Jieru Mei, Xiaochen Lian, Linjie Yang, Cihang Xie, Qihang Yu, Yuyin Zhou, Song Bai, and Alan L Yuille. Neural architecture search for lightweight non-local networks. In CVPR, 2020.
|
| 248 |
+
[21] Chung-Ching Lin, Ying Hung, Rogerio Feris, and Linglin He. Video instance segmentation tracking with a modified vae architecture. In CVPR, 2020.
|
| 249 |
+
[22] Dongfang Liu, Yiming Cui, Wenbo Tan, and Yingjie Chen. Sg-net: Spatial granularity network for one-stage video instance segmentation. In CVPR, 2021.
|
| 250 |
+
[23] Xiankai Lu, Wenguan Wang, Danelljan Martin, Tianfei Zhou, Jianbing Shen, and Van Gool Luc. Video object segmentation with episodic graph memory networks. In ECCV, 2020.
|
| 251 |
+
[24] Jonathon Luiten, Tobias Fischer, and Bastian Leibe. Track to reconstruct and reconstruct to track. IEEE Robotics and Automation Letters, 5(2):1803–1810, 2020.
|
| 252 |
+
[25] Tim Meinhardt, Alexander Kirillov, Laura Leal-Taixe, and Christoph Feichtenhofer. Trackformer: Multiobject tracking with transformers. arXiv preprint arXiv:2101.02702, 2021.
|
| 253 |
+
[26] Anton Milan, Laura Leal-Taixé, Ian Reid, Stefan Roth, and Konrad Schindler. Mot16: A benchmark for multi-object tracking. arXiv preprint arXiv:1603.00831, 2016.
|
| 254 |
+
[27] Anton Milan, Laura Leal-Taixé, Konrad Schindler, and Ian Reid. Joint tracking and segmentation of multiple targets. In CVPR, 2015.
|
| 255 |
+
[28] Seoung Wug Oh, Joon-Young Lee, Ning Xu, and Seon Joo Kim. Video object segmentation using space-time memory networks. In ICCV, 2019.
|
| 256 |
+
[29] Jiangmiao Pang, Linlu Qiu, Xia Li, Haofeng Chen, Qi Li, Trevor Darrell, and Fisher Yu. Quasi-dense similarity learning for multiple object tracking. In CVPR, 2021.
|
| 257 |
+
[30] Jiyang Qi, Yan Gao, Yao Hu, Xinggang Wang, Xiaoyu Liu, Xiang Bai, Serge Belongie, Alan Yuille, Philip Torr, and Song Bai. Occluded video instance segmentation. arXiv preprint arXiv:2102.01558, 2021.
|
| 258 |
+
[31] Siyuan Qiao, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Vip-deeplab: Learning visual perception with depth-aware video panoptic segmentation. In CVPR, 2021.
|
| 259 |
+
[32] Hongje Seong, Junhyuk Hyun, and Euntai Kim. Kernelized memory network for video object segmentation. In ECCV, 2020.
|
| 260 |
+
[33] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017.
|
| 261 |
+
[34] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In ICCV, 2019.
|
| 262 |
+
[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.
|
| 263 |
+
[36] Paul Voigtlaender, Yuning Chai, Florian Schroff, Hartwig Adam, Bastian Leibe, and Liang-Chieh Chen. Feelvos: Fast end-to-end embedding learning for video object segmentation. In CVPR, 2019.
|
| 264 |
+
[37] Paul Voigtlaender, Michael Krause, Aljosa Osep, Jonathon Luiten, Berin Balachandar Gnana Sekar, Andreas Geiger, and Bastian Leibe. Mots: Multi-object tracking and segmentation. In CVPR, 2019.
|
| 265 |
+
[38] Apoorv Vyas, Angelos Katharopoulos, and François Fleuret. Fast transformers with clustered attention. NeurIPS, 2020.
|
| 266 |
+
[39] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018.
|
| 267 |
+
[40] Xiaolong Wang and Abhinav Gupta. Videos as space-time region graphs. In ECCV, 2018.
|
| 268 |
+
[41] Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. arXiv preprint arXiv:2011.14503v1, 2020.
|
| 269 |
+
[42] Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In IEEE international conference on image processing (ICIP), 2017.
|
| 270 |
+
[43] Haozhe Xie, Hongxun Yao, Shangchen Zhou, Shengping Zhang, and Wenxiu Sun. Efficient regional memory network for video object segmentation. In CVPR, 2021.
|
| 271 |
+
[44] Zhenbo Xu, Wei Zhang, Xiao Tan, Wei Yang, Huan Huang, Shilei Wen, Errui Ding, and Liusheng Huang. Segment as points for efficient online multi-object tracking and segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), 2020.
|
| 272 |
+
[45] Boyu Yang, Chang Liu, Bohao Li, Jianbin Jiao, and Qixiang Ye. Prototype mixture models for few-shot semantic segmentation. In ECCV, 2020.
|
| 273 |
+
[46] Linjie Yang, Yuchen Fan, and Ning Xu. Video instance segmentation. In ICCV, 2019.
|
| 274 |
+
[47] Linjie Yang, Yanran Wang, Xuehan Xiong, Jianchao Yang, and Aggelos K Katsaggelos. Efficient video object segmentation via network modulation. In CVPR, 2018.
|
| 275 |
+
[48] Shusheng Yang, Yuxin Fang, Xinggang Wang, Yu Li, Chen Fang, Ying Shan, Bin Feng, and Wenyu Liu. Crossover learning for fast online video instance segmentation. In ICCV, 2021.
|
| 276 |
+
[49] Zongxin Yang, Yunchao Wei, and Yi Yang. Collaborative video object segmentation by foregroundbackground integration. In ECCV, 2020.
|
| 277 |
+
[50] Fisher Yu, Haofeng Chen, Xin Wang, Wenqi Xian, Yingying Chen, Fangchen Liu, Vashisht Madhavan, and Trevor Darrell. Bdd100k: A diverse driving dataset for heterogeneous multitask learning. In CVPR, 2020.
|
| 278 |
+
[51] Chi Zhang, Guosheng Lin, Fayao Liu, Rui Yao, and Chunhua Shen. Canet: Class-agnostic segmentation networks with iterative refinement and attentive few-shot learning. In CVPR, 2019.
|
md/train/5NA1PinlGFu/5NA1PinlGFu.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COLORIZATION TRANSFORMER
|
| 2 |
+
|
| 3 |
+
Manoj Kumar, Dirk Weissenborn & Nal Kalchbrenner Google Research, Brain Team {mechcoder,diwe,nalk}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present the Colorization Transformer, a novel approach for diverse high fidelity image colorization based on self-attention. Given a grayscale image, the colorization proceeds in three steps. We first use a conditional autoregressive transformer to produce a low resolution coarse coloring of the grayscale image. Our architecture adopts conditional transformer layers to effectively condition grayscale input. Two subsequent fully parallel networks upsample the coarse colored low resolution image into a finely colored high resolution image. Sampling from the Colorization Transformer produces diverse colorings whose fidelity outperforms the previous state-of-the-art on colorising ImageNet based on FID results and based on a human evaluation in a Mechanical Turk test. Remarkably, in more than $60 \%$ of cases human evaluators prefer the highest rated among three generated colorings over the ground truth. The code and pre-trained checkpoints for Colorization Transformer are publicly available at this url.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+

|
| 12 |
+
Figure 1: Samples of our model showing diverse, high-fidelity colorizations.
|
| 13 |
+
|
| 14 |
+
Image colorization is a challenging, inherently stochastic task that requires a semantic understanding of the scene as well as knowledge of the world. Core immediate applications of the technique include producing organic new colorizations of existing image and video content as well as giving life to originally grayscale media, such as old archival images (Tsaftaris et al., 2014), videos (Geshwind, 1986) and black-and-white cartoons (Sykora et al., 2004; Qu et al., 2006; Cinarel & Zhang, 2017). \` Colorization also has important technical uses as a way to learn meaningful representations without explicit supervision (Zhang et al., 2016; Larsson et al., 2016; Vondrick et al., 2018) or as an unsupervised data augmentation technique, whereby diverse semantics-preserving colorizations of labelled images are produced with a colorization model trained on a potentially much larger set of unlabelled images.
|
| 15 |
+
|
| 16 |
+
The current state-of-the-art in automated colorization are neural generative approaches based on log-likelihood estimation (Guadarrama et al., 2017; Royer et al., 2017; Ardizzone et al., 2019). Probabilistic models are a natural fit for the one-to-many task of image colorization and obtain better results than earlier determinisitic approaches avoiding some of the persistent pitfalls (Zhang et al., 2016). Probabilistic models also have the central advantage of producing multiple diverse colorings that are sampled from the learnt distribution.
|
| 17 |
+
|
| 18 |
+
In this paper, we introduce the Colorization Transformer (ColTran), a probabilistic colorization model composed only of axial self-attention blocks (Ho et al., 2019b; Wang et al., 2020). The main advantages of axial self-attention blocks are the ability to capture a global receptive field with only√ two layers and $\mathcal { O } ( D \sqrt { D } )$ instead of $\mathcal { O } ( D ^ { 2 } )$ complexity. They can be implemented efficiently using matrix-multiplications on modern accelerators such as TPUs (Jouppi et al., 2017). In order to enable colorization of high-resolution grayscale images, we decompose the task into three simpler sequential subtasks: coarse low resolution autoregressive colorization, parallel color and spatial super-resolution. For coarse low resolution colorization, we apply a conditional variant of Axial Transformer (Ho et al., 2019b), a state-of-the-art autoregressive image generation model that does not require custom kernels (Child et al., 2019). While Axial Transformers support conditioning by biasing the input, we find that directly conditioning the transformer layers can improve results significantly. Finally, by leveraging the semi-parallel sampling mechanism of Axial Transformers we are able to colorize images faster at higher resolution than previous work (Guadarrama et al., 2017) and as an effect this results in improved colorization fidelity. Finally, we employ fast parallel deterministic upsampling models to super-resolve the coarsely colorized image into the final high resolution output. In summary, our main contributions are:
|
| 19 |
+
|
| 20 |
+
• First application of transformers for high-resolution $( 2 5 6 \times 2 5 6 )$ image colorization.
|
| 21 |
+
• We introduce conditional transformer layers for low-resolution coarse colorization in Section 4.1. The conditional layers incorporate conditioning information via multiple learnable components that are applied per-pixel and per-channel. We validate the contribution of each component with extensive experimentation and ablation studies.
|
| 22 |
+
We propose training an auxiliary parallel prediction model jointly with the low resolution coarse colorization model in Section 4.2. Improved FID scores demonstrate the usefulness of this auxiliary model.
|
| 23 |
+
• We establish a new state-of-the-art on image colorization outperforming prior methods by a large margin on FID scores and a 2-Alternative Forced Choice (2AFC) Mechanical Turk test. Remarkably, in more than $60 \%$ of cases human evaluators prefer the highest rated among three generated colorings over the ground truth.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Colorization methods have initially relied on human-in-the-loop approaches to provide hints in the form of scribbles (Levin et al., 2004; Ironi et al., 2005; Huang et al., 2005; Yatziv & Sapiro, 2006; Qu et al., 2006; Luan et al., 2007; Tsaftaris et al., 2014; Zhang et al., 2017; Ci et al., 2018) and exemplar-based techniques that involve identifying a reference source image to copy colors from (Reinhard et al., 2001; Welsh et al., 2002; Tai et al., 2005; Ironi et al., 2005; Pitié et al., 2007; Morimoto et al., 2009; Gupta et al., 2012; Xiao et al., 2020). Exemplar based techniques have been recently extended to video as well (Zhang et al., 2019a). In the past few years, the focus has moved on to more automated, neural colorization methods. The deterministic colorization techniques such as CIC (Zhang et al., 2016), LRAC (Larsson et al., 2016), LTBC (Iizuka et al., 2016), Pix2Pix (Isola et al., 2017) and DC (Cheng et al., 2015; Dahl, 2016) involve variations of CNNs to model per-pixel color information conditioned on the intensity.
|
| 28 |
+
|
| 29 |
+
Generative colorization models typically extend unconditional image generation models to incorporate conditioning information from a grayscale image. Specifically, cINN (Ardizzone et al., 2019) use conditional normalizing flows (Dinh et al., 2014), VAE-MDN (Deshpande et al., 2017; 2015) and SCC-DC (Messaoud et al., 2018) use conditional VAEs (Kingma & Welling, 2013), and cGAN (Cao et al., 2017) use GANs (Goodfellow et al., 2014) for generative colorization. Most closely related to ColTran are other autoregressive approaches such as PixColor (Guadarrama et al., 2017) and PIC (Royer et al., 2017) with PixColor obtaining slightly better results than PIC due to its CNN-based upsampling strategy. ColTran is similar to PixColor in the usage of an autoregressive model for low resolution colorization and parallel spatial upsampling. ColTran differs from PixColor in the following ways. We train ColTran in a completely unsupervised fashion, while the conditioning network in PixColor requires pre-training with an object detection network that provides substantial semantic information. PixColor relies on PixelCNN (Oord et al., 2016) that requires a large depth to model interactions between all pixels. ColTran relies on Axial Transformer (Ho et al., 2019b) and can model all interactions between pixels with just 2 layers. PixColor uses different architectures for conditioning, colorization and super-resolution, while ColTran is conceptually simpler as we use self-attention blocks everywhere for both colorization and superresolution. Finally, we train our autoregressive model on a single coarse channel and a separate color upsampling network that improves fidelity (See: 5.3). The multi-stage generation process in ColTran that upsamples in depth and in size is related to that used in Subscale Pixel Networks (Menick & Kalchbrenner, 2018) for image generation, with differences in the order and representation of bits as well as in the use of fully parallel networks. The self-attention blocks that are the building blocks of ColTran were initially developed for machine translation (Vaswani et al., 2017), but are now widely used in a number of other applications including density estimation (Parmar et al., 2018; Child et al., 2019; Ho et al., 2019a; Weissenborn et al., 2019) and GANs (Zhang et al., 2019b)
|
| 30 |
+
|
| 31 |
+
# 3 BACKGROUND: AXIAL TRANSFORMER
|
| 32 |
+
|
| 33 |
+
# 3.1 ROW AND COLUMN SELF-ATTENTION
|
| 34 |
+
|
| 35 |
+
Self-attention (SA) has become a standard building block in many neural architectures. Although the complexity of self-attention is quadratic with the number of input elements (here pixels), it has become quite popular for image modeling recently (Parmar et al., 2018; Weissenborn et al., 2019) due to modeling innovations that don’t require running global self-attention between all pixels. Following the work of (Ho et al., 2019b) we employ standard qkv self-attention (Vaswani et al., 2017) within rows and columns of an image. By alternating row- and column self-attention we effectively allow global exchange of information between all pixel positions. For the sake of brevity we omit the exact equations for multihead self-attention and refer the interested reader to the Appendix H for more details. Row/column attention layers are the core components of our model. We use them in the autoregressive colorizer, the spatial upsampler and the color upsampler.
|
| 36 |
+
|
| 37 |
+
# 3.2 AXIAL TRANSFORMER
|
| 38 |
+
|
| 39 |
+
Ths Axial Transformer (Ho et al., 2019b) is an autoregressive model that applies (masked) row- and column self-attention operations in a way that efficiently summarizes all past information $\mathbf { x } _ { i , < j }$ and $\mathbf x _ { < i , }$ · to model a distribution over pixel $\mathbf { x } _ { i , j }$ at position $i , j$ . Causal masking is employed by setting all $A _ { m , n } = 0$ where $n > m$ during self-attention (see Eq. 15).
|
| 40 |
+
|
| 41 |
+
Outer decoder. The outer decoder computes a state ${ \bf { s } } _ { o }$ over all previous rows $\mathbf { x } _ { \leq i , }$ · by applying $N$ layers of full row self-attention followed by masked column self-attention. (Eq 2). ${ \bf { s } } _ { o }$ is shifted down by a single row, such that the output context $\mathbf { o } _ { i , j }$ at position $i , j$ only contains information about pixels $\mathbf x _ { < i , }$ · from prior rows. (Eq 3)
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r l } { \mathbf { e } = \mathrm { E m b e d d i n g s } ( \mathbf { x } ) } \\ { \mathbf { s } _ { o } = \mathrm { M a s k e d C o l u m n } ( \mathrm { R o w } ( \mathbf { e } ) ) } \\ { \mathbf { o } = \mathrm { S h i f t D o w n } ( \mathbf { s } _ { o } ) } \end{array} \quad \quad \times N
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Inner decoder. The embeddings to the inner decoder are shifted right by a single column to mask the current pixel $\mathbf { x } _ { i , j }$ . The context o from the outer decoder conditions the inner decoder by biasing the shifted embeddings. It then computes a final state $\mathbf { h }$ , by applying $N$ layers of masked row-wise self-attention to infuse additional information from prior pixels of the same row $\mathbf { x } _ { i , < j }$ (Eq 4). $\mathbf { h } _ { i , j }$ comprises information about all past pixels $\mathbf { x } _ { < i }$ and $\mathbf { x } _ { i , < j }$ . A dense layer projects $\mathbf { h }$ into a distribution $p ( \mathbf { x } _ { i j } )$ over the pixel at position $( i , j )$ conditioned on all previous pixels $\mathbf { x } _ { i , < j }$ and $\mathbf { x } _ { < i , \cdot }$ .
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } { \mathbf { z } = \mathbf { o } + \mathrm { S h i f t R i g h t } ( \mathbf { e } ) } & { { } } \\ { \mathbf { h } = \mathbf { M a s k e d R o w } ( \mathbf { z } ) } & { { } \times N } \\ { p ( \mathbf { x } _ { i j } ) = \mathrm { D e n s e } ( \mathbf { h } ) } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Encoder. As shown above, the outer and inner decoder operate on 2-D inputs, such as a single channel of an image. For multi-channel RGB images, when modeling the "current channel", the Axial Transformer incorporates information from prior channels of an image (as per raster order) with an encoder. The encoder encodes each prior channel independently with a stack of unmasked row/column attention layers. The encoder outputs across all prior channels are summed to output a conditioning context c for the "current channel". The context conditions the outer and inner decoder by biasing the inputs in Eq 1 and Eq 4 respectively.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 2: Depiction of ColTran. It consists of 3 individual models: an autoregressive colorizer (left), a color upsampler (middle) and a spatial upsampler (right). Each model is optimized independently. The autoregressive colorizer (ColTran core) is an instantiation of Axial Transformer (Sec. 3.2, Ho et al. (2019b)) with conditional transformer layers and an auxiliary parallel head proposed in this work (Sec. 4.1). During training, the groundtruth coarse low resolution image is both the input to the decoder and the target. Masked layers ensure that the conditional distributions for each pixel depends solely on previous ground-truth pixels. (See Appendix G for a recap on autoregressive models). ColTran upsamplers are stacked row/column attention layers that deterministically upsample color and space in parallel. Each attention block (in green) is residual and consists of the following operations: layer-norm multihead self-attention $ \mathrm { M L P } .$
|
| 57 |
+
|
| 58 |
+
Sampling. The Axial Transformer natively supports semi-parallel sampling that avoids reevaluation of the entire network to generate each pixel of a RGB image. The encoder is run once per-channel, the outer decoder is run once per-row and the inner decoder is run once per-pixel. The context from the outer decoder and the encoder is initially zero. The encoder conditions the outer decoder (Eq 1) and the encoder $^ +$ outer decoder condition the inner decoder (Eq 4). The inner decoder then generates a row, one pixel at a time via Eqs. (4) to (6). After generating all pixels in a row, the outer decoder recomputes context via Eqs. (1) to (3) and the inner decoder generates the next row. This proceeds till all the pixels in a channel are generated. The encoder, then recomputes context to generate the next channel.
|
| 59 |
+
|
| 60 |
+
# 4 PROPOSED ARCHITECTURE
|
| 61 |
+
|
| 62 |
+
Image colorization is the task of transforming a grayscale image $x ^ { g } \in \mathbb { R } ^ { H \times W \times 1 }$ into a colored image $\boldsymbol { x } \in \mathbb { R } ^ { H \times W \times 3 }$ . The task is inherently stochastic; for a given grayscale image $x ^ { g }$ , there exists a conditional distribution over $x$ , $p ( x | x ^ { g } )$ . Instead of predicting $x$ directly from $x ^ { g }$ , we instead sequentially predict two intermediate low resolution images $x ^ { s \downarrow }$ and $x ^ { s \downarrow c \downarrow }$ with different color depth first. Besides simplifying the task of high-resolution image colorization into simpler tasks, the smaller resolution allows for training larger models.
|
| 63 |
+
|
| 64 |
+
We obtain $x ^ { s \downarrow }$ , a spatially downsampled representation of $x$ , by standard area interpolation. $x ^ { s \downarrow c \downarrow }$ is a 3 bit per-channel representation of $x ^ { s \downarrow }$ , that is, each color channel has only 8 intensities. Thus, there are $8 ^ { \hat { 3 } } = 5 1 2$ coarse colors per pixel which are predicted directly as a single “color” channel. We rewrite the conditional likelihood $p ( x | x ^ { g } )$ to incorporate the intermediate representations as follows:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r l } & { p ( x | x ^ { g } ) = p ( x | x ^ { g } ) \cdot 1 = p ( x | x ^ { g } ) \cdot p ( x ^ { s \downarrow c \downarrow } , x ^ { s \downarrow } | x , x ^ { g } ) = p ( x ^ { s \downarrow c \downarrow } , x ^ { s \downarrow } , x | x ^ { g } ) } \\ & { \qquad = p ( x | x ^ { s \ast } , x ^ { g } ) \cdot p ( x ^ { s \downarrow } | x ^ { s \downarrow c \downarrow } , x ^ { g } ) \cdot p ( x ^ { s \downarrow c \downarrow } | x ^ { g } ) } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
ColTran core (Section 4.1), a parallel color upsampler and a parallel spatial upsampler (Section 4.3) model $p ( x ^ { s _ { \downarrow } c _ { \downarrow } } | x ^ { g } ) , p ( x ^ { s _ { \downarrow } } | x ^ { s _ { \downarrow } \bar { c } _ { \downarrow } } , x ^ { g } )$ and $p ( x | x ^ { s \downarrow } )$ respectively. In the subsections below, we describe
|
| 71 |
+
|
| 72 |
+
<table><tr><td>Component</td><td>Unconditional</td><td>Conditional</td></tr><tr><td>Self-Attention</td><td>y = Softmax( gkT )v V/D</td><td>qck y = Softmax( )vc √D where ∀z=k,q,ν</td></tr><tr><td>MLP</td><td>y = ReLU(xU1+bi)U2 +b2</td><td>Zc =(cU²) z+(cU²) h = ReLU(xU1 +bi)U2 +b2 y=(cUf)h+(cUf)</td></tr><tr><td>Layer Norm</td><td>y = βNorm(x) +γ</td><td>y = βcNorm(x) +γc whereμ= βc,γc C∈RHXWXDC∈RHWXD μ = (u·c)Ua uERHW</td></tr></table>
|
| 73 |
+
|
| 74 |
+
Table 1: We contrast the different components of unconditional self-attention with self-attention conditioned on context $\mathbf { c } \in \mathbb { R } ^ { M \times N \times D }$ . Learnable parameters specific to conditioning are denoted by $\mathbf { u }$ and $U _ { \cdot } \in \mathbb { R } ^ { D \times D }$ .
|
| 75 |
+
|
| 76 |
+
these individual components in detail. From now on we will refer to all low resolutions as $M \times N$ and high resolution as $H \times W$ . An illustration of the overall architecture is shown in Figure 2.
|
| 77 |
+
|
| 78 |
+
# 4.1 COLTRAN CORE
|
| 79 |
+
|
| 80 |
+
In this section, we describe ColTran core, a conditional variant of the Axial Transformer (Ho et al., 2019b) for low resolution coarse colorization. ColTran Core models a distribution $p _ { c } ( x ^ { s \downarrow c \downarrow } | x ^ { g } )$ over 512 coarse colors for every pixel, conditioned on a low resolution grayscale image in addition to the colors from previously predicted pixels as per raster order (Eq. 9).
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
p _ { c } ( x ^ { s \downarrow c \downarrow } | x ^ { g } ) = \prod _ { i = 1 } ^ { M } \prod _ { j = 1 } ^ { N } p _ { c } ( x _ { i j } ^ { s \downarrow c \downarrow } | x ^ { g } , x _ { < i } ^ { s \downarrow c \downarrow } , x _ { i , < j } ^ { s \downarrow c \downarrow } )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Given a context representation $\mathbf { c } \in \mathbb { R } ^ { M \times N \times D }$ we propose conditional transformer layers in Table 1. Conditional transformer layers have conditional versions of all components within the standard attention block (see Appendix H, Eqs. 14-18).
|
| 87 |
+
|
| 88 |
+
Conditional Self-Attention. For every layer in the decoder, we apply six $1 \times 1$ convolutions to c to obtain three scale and shift vectors which we apply element-wise to q, $\mathbf { k }$ and $\mathbf { v }$ of the self-attention operation (Appendix 3.1), respectively.
|
| 89 |
+
|
| 90 |
+
Conditional MLP. A standard component of the transformer architecture is a two layer pointwise feed-forward network after the self-attention layer. We scale and shift to the output of each MLP conditioned on c as for self-attention.
|
| 91 |
+
|
| 92 |
+
Conditional Layer Norm. Layer normalization (Ba et al., 2016) globally scales and shifts a given normalized input using learnable vectors $\beta , \gamma$ . Instead, we predict $\beta _ { c }$ and $\gamma _ { c }$ as a function of c. We first aggregate c into a global 1-D representation $\overline { { \mathbf { c } } } \in \mathbb { R } ^ { L }$ via a learnable, spatial pooling layer. Spatial pooling is initialized as a mean pooling layer. Similar to 1-D conditional normalization layers (Perez et al., 2017; De Vries et al., 2017; Dumoulin et al., 2016; Huang & Belongie, 2017), we then apply a linear projection on c to predict $\beta _ { c }$ and $\gamma _ { c }$ , respectively.
|
| 93 |
+
|
| 94 |
+
A grayscale encoder consisting of multiple, alternating row and column self-attention layers encodes the grayscale image into the initial conditioning context $\mathbf { c } ^ { g }$ . It serves as both context for the conditional layers and as additional input to the embeddings of the outer decoder. The sum of the outer decoder’s output and $\mathbf { c } ^ { g }$ condition the inner decoder. Figure 2 illustrates how conditioning is applied in the autoregressive core of the ColTran architecture.
|
| 95 |
+
|
| 96 |
+
Conditioning every layer via multiple components allows stronger gradient signals through the encoder and as an effect the encoder can learn better contextual representations. We validate this empirically by outperforming the native Axial Transformer that conditions context states by biasing (See Section 5.2 and Section 5.4).
|
| 97 |
+
|
| 98 |
+
We additionally found it beneficial to train an auxiliary parallel prediction model that models $\widetilde { p } _ { c } ( x ^ { s \downarrow c \downarrow } )$ edirectly on top of representations learned by the grayscale encoder which we found beneficial for regularization (Eq. 10)
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\widetilde { p } _ { c } ( x ^ { s \downarrow c \downarrow } | x ^ { g } ) = \prod _ { i = 1 } ^ { M } \prod _ { j = 1 } ^ { N } \widetilde { p } _ { c } ( x _ { i j } ^ { s \downarrow c \downarrow } | x ^ { g } )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Intuitively, this forces the model to compute richer representations and global color structure already at the output of the encoder which can help conditioning and therefore has a beneficial, regularizing effect on learning. We apply a linear projection, $U _ { \mathrm { p a r a l l e l } } \in \mathbb { R } ^ { L \times 5 1 2 }$ on top of $\mathbf { c } ^ { g }$ (the output of the grayscale encoder) into a per-pixel distribution over 512 coarse colors. It was crucial to tune the relative contribution of the autoregressive and parallel predictions to improve performance which we study in Section 5.3
|
| 105 |
+
|
| 106 |
+
# 4.3 COLOR & SPATIAL UPSAMPLING
|
| 107 |
+
|
| 108 |
+
In order to produce high-fidelity colorized images from low resolution, coarse color images and a given high resolution grayscale image, we train color and spatial upsampling models. They share the same architecture while differing in their respective inputs and resolution at which they operate. Similar to the grayscale encoder, the upsamplers comprise of multiple alternating layers of row and column self-attention. The output of the encoder is projected to compute the logits underlying the per pixel color probabilities of the respective upsampler. Figure 2 illustrates the architectures
|
| 109 |
+
|
| 110 |
+
Color Upsampler. We convert the coarse image $x ^ { s \downarrow c \downarrow } \in \mathbb { R } ^ { M \times N \times 1 }$ of 512 colors back into a 3 bit RGB image with 8 symbols per channel. The channels are embedded using separate embedding matrices to $\mathbf { x } _ { k } ^ { s \downarrow c \downarrow } \in \bar { \mathbb { R } } ^ { M \times N \times \bar { D } }$ , where $k \in \{ R , G , B \}$ indicates the channel. We upsample each channel individually conditioning only on the respective channel’s embedding. The channel embedding is summed with the respective grayscale embedding for each pixel and serve as input to the subsequent self-attention layers (encoder). The output of the encoder is further projected to per pixel-channel probability distributions $\widetilde { p } _ { c \uparrow } ( x _ { k } ^ { s _ { \downarrow } } | x ^ { s _ { \downarrow } c _ { \downarrow } } , \dot { x } ^ { g } ) \in \mathbb { R } ^ { M \times N \times 2 5 6 }$ over 256 color intensities for all $k \in \{ R , G , B \}$ (Eq. 11).
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\widetilde { p } _ { c \uparrow } ( x ^ { s _ { \downarrow } } | x ^ { g } ) = \prod _ { i = 1 } ^ { M } \prod _ { j = 1 } ^ { N } \widetilde { p } _ { c \uparrow } ( x _ { i j } ^ { s _ { \downarrow } } | x ^ { g } , x ^ { s _ { \downarrow } c _ { \downarrow } } )
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Spatial Upsampler. We first naively upsample $\boldsymbol { x } ^ { s _ { \downarrow } } \in \mathbb { R } ^ { M \times N \times 3 }$ into a blurry, high-resolution RGB image using area interpolation. As above, we then embed each channel of the blurry RGB image and run a per-channel encoder exactly the same way as with the color upsampler. The output of the encoder is finally projected to per pixel-channel probability distributions $\bar { \tilde { p } } _ { s \uparrow } ( x _ { k } ^ { - } | x ^ { s \downarrow } , x ^ { g } ) \in \mathbf { \bar { \mathbb { R } } } ^ { H \times W \times 2 5 6 }$ over 256 color intensities for all $k \in \{ R , G , { \bar { B } } \}$ . (Eq. 12)
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\widetilde { p } _ { s \uparrow } ( x | x ^ { g } ) = \prod _ { i = 1 } ^ { H } \prod _ { j = 1 } ^ { W } \widetilde { p } _ { s \uparrow } ( x _ { i j } | x ^ { g } , x ^ { s \downarrow } )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
In our experiments, similar to (Guadarrama et al., 2017), we found parallel upsampling to be sufficient for high quality colorizations. Parallel upsampling has the huge advantage of fast generation which would be notoriously slow for full autoregressive models on high resolution. To avoid plausible minor color inconsistencies between pixels, instead of sampling each pixel from the predicted distribution in (Eq. 12 and Eq. 11), we just use the argmax. Even though this slightly limits the potential diversity of colorizations, in practice we observe that sampling only coarse colors via ColTran core is enough to produce a great variety of colorizations.
|
| 123 |
+
|
| 124 |
+
Objective. We train our architecture to minimize the negative log-likelihood (Eq. 13) of the data. $p _ { c } / \widetilde { p } _ { c } , \widetilde { p } _ { s \uparrow } , \widetilde { p } _ { c \uparrow }$ are maximized independently and $\lambda$ is a hyperparameter that controls the relative e e econtribution of $p _ { c }$ and $\widetilde { p } _ { c }$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { L } = ( 1 - \lambda ) \log p _ { c } + \lambda \log \widetilde { p } _ { c } + \log \widetilde { p } _ { c \uparrow } + \log \widetilde { p } _ { s \uparrow }
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 3: Per pixel log-likelihood of coarse colored $6 4 \times 6 4$ images over the validation set as a function of training steps. We ablate the various components of the ColTran core in each plot. Left: ColTran with Conditional Transformer Layers vs a baseline Axial Transformer which conditions via addition (ColTran-B). ColTran-B $2 x$ and ColTran-B $_ { 4 x }$ refer to wider baselines with increased model capacity. Center: Removing each conditional sub-component one at a time (no cLN, no $c M L P$ and no $c A t t$ ). Right: Conditional shifts only (Shift), Conditional scales only (Scale), removal of kq conditioning in cAtt (cAtt, only v) and fixed mean pooling in cLN (cLN, mean pool). See Section 5.2 for more details.
|
| 132 |
+
|
| 133 |
+
# 5 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
# 5.1 TRAINING AND EVALUATION
|
| 136 |
+
|
| 137 |
+
We evaluate ColTran on colorizing $2 5 6 \times 2 5 6$ grayscale images from the ImageNet dataset (Russakovsky et al., 2015). We train the ColTran core, color and spatial upsamplers independently on 16 TPUv2 chips with a batch-size of 224, 768 and 32 for 600K, 450K and 300K steps respectively. We use 4 axial attention blocks in each component of our architecture, with a hidden size of 512 and 4 heads. We use RMSprop (Tieleman & Hinton, 2012) with a fixed learning rate of $3 e - 4$ . We set apart 10000 images from the training set as a holdout set to tune hyperparameters and perform ablations. To compute FID, we generate 5000 samples conditioned on the grayscale images from this holdout set. We use the public validation set to display qualitative results and report final numbers.
|
| 138 |
+
|
| 139 |
+
# 5.2 ABLATIONS OF COLTRAN CORE
|
| 140 |
+
|
| 141 |
+
The autoregressive core of ColTran models downsampled, coarse-colored images of resolution $6 4 \times 6 4$ with 512 coarse colots, conditioned on the respective grayscale image. In a series of experiments we ablate the different components of the architecture (Figure 3). In the section below, we refer to the conditional self-attention, conditional layer norm and conditional MLP subcomponents as cAtt, cLN and cMLP respectively. We report the per-pixel log-likelihood over 512 coarse colors on the validation set as a function of training steps.
|
| 142 |
+
|
| 143 |
+
Impact of conditional transformer layers. The left side of Figure 3 illustrates the significant improvement in loss that ColTran core (with conditional transformer layers) achieves over the original Axial Transformer (marked ColTran-B). This demonstrates the usefulness of our proposed conditional layers. Because conditional layers introduce a higher number of parameters we additionally compare to and outperform the original Axial Transformer baselines with $2 \mathbf { x }$ and 4x wider MLP dimensions (labeled as ColTran- $. B 2 x$ and ColTran- $B 4 x$ ). Both ColTran- $. B 2 x$ and ColTran- $. B 4 x$ have an increased parameter count which makes for a fair comparison. Our results show that the increased performance cannot be explained solely by the fact that our model has more parameters.
|
| 144 |
+
|
| 145 |
+
Importance of each conditional component. We perform a leave-one-out study to determine the importance of each conditional component. We remove each conditional component one at a time and retrain the new ablated model. The curves no cLN, no cMLP and no $c A t t$ in the middle of Figure 3 quantifies our results. While each conditional component improves final performance, cAtt plays the most important role.
|
| 146 |
+
|
| 147 |
+
Multiplicative vs Additive Interactions. Conditional transformer layers employ both conditional shifts and scales consisting of additive and multiplicative interactions, respectively. The curves Scale and Shift on the right hand side of Figure 3 demonstrate the impact of these interactions via ablated architectures that use conditional shifts and conditional scales only. While both types of interactions are important, multiplicative interactions have a much stronger impact.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Left: FID of generated $6 4 \times 6 4$ coarse samples as a function of training steps for $\lambda = 0 . 0 1$ and $\lambda = 0 . 0$ . Center: Final FID scores as a function of $\lambda$ . Right: FID as a function of log-likelihood.
|
| 151 |
+
|
| 152 |
+
Context-aware dot product attention. Self-attention computes the similarity between pixel representations using a dot product between q and $\mathbf { k }$ (See: Eq 15). cAtt applies conditional shifts and scales on q, k and allow modifying this similarity based on contextual information. The curve $c A t t$ , only $\nu$ on the right of Figure 3 shows that removing this property, by conditioning only on $\mathbf { v }$ leads to worse results.
|
| 153 |
+
|
| 154 |
+
Fixed vs adaptive global representation: cLN aggregates global information with a flexible learnable spatial pooling layer. We experimented with a fixed mean pooling layer forcing all the cLN layers to use the same global representation with the same per-pixel weight. The curve cLN, mean pool on the right of Figure 3 shows that enforcing this constraint causes inferior performance as compared to even having no cLN. This indicates that different aggregations of global representations are important for different cLN layers.
|
| 155 |
+
|
| 156 |
+
# 5.3 OTHER ABLATIONS
|
| 157 |
+
|
| 158 |
+
Auxiliary Parallel Model. We study the effect of the hyperparameter $\lambda$ , which controls the contribution of the auxiliary parallel prediction model described in Section 4.2. For a given $\lambda$ , we now optimize $\hat { p _ { c } } ( \lambda ) = ( 1 - \bar { \lambda } ) \log p _ { c } ( . ) + \lambda \log \widetilde { p } _ { c } ( . )$ instead of just $\log p _ { c } ( . )$ . Note that $\widetilde { p } _ { c } ( . )$ , models e eeach pixel independently, which is more difficult than modelling each pixel conditioned on previous pixels given by $\bar { p } _ { c } ( . )$ . Hence, employing $\hat { p } _ { c } ( \lambda )$ as a holdout metric, would just lead to a trivial soluion at $\lambda = 0$ . Instead, the FID of the generated coarse $6 4 \mathrm { x } 6 4$ samples provides a reliable way to find an optimal value of $\lambda$ . In Figure 4, at $\lambda = 0 . 0 1$ , our model converges to a better FID faster with a marginal but consistent final improvement. At higher values the performance deteriorates quickly.
|
| 159 |
+
|
| 160 |
+
Upsamplers. Upsampling coarse colored, low-resolution images to a higher resolution is much simpler. Given ground truth $6 4 \times 6 4$ coarse images, the ColTran upsamplers map these to fine grained $2 5 6 \times 2 5 6$ images without any visible artifacts and FID of 16.4. For comparison, the FID between two random sets of 5000 samples from our holdout set is 15.5. It is further extremely important to provide the grayscale image as input to each of the individual upsamplers, without which the generated images appear highly smoothed out and the FID drops to 27.0. We also trained a single upsampler for both color and resolution. The FID in this case drops marginally to 16.6.
|
| 161 |
+
|
| 162 |
+
# 5.4 FRECHET INCEPTION DISTANCE
|
| 163 |
+
|
| 164 |
+
We compute FID using colorizations of 5000 grayscale images of resolution $2 5 6 \times 2 5 6$ from the ImageNet validation set as done in (Ardizzone et al., 2019). To compute the FID, we ensure that there is no overlap between the grayscale images that condition ColTran and those in the ground-truth distribution. In addition to ColTran, we report two additional results ColTran-S and ColTran-B. ColTran- $. B$ refers to the baseline Axial Transformer that conditions via addition at the input. PixColor samples smaller $2 8 \times 2 8$ colored images autoregressively as compared to ColTran’s $6 4 \times 6 4$ . As a control experiment, we train an autoregressive model on resolution $2 8 \times 2 8$ (ColTran-S) to disentangle architectural choices and the inherent stochasticity of modelling higher resolution images. ColTran-S and ColTran- $B$ obtains FID scores of 22.06 and 19.98 that significantly improve over the previous best FID of 24.32. Finally, ColTran achieves the best FID score of 19.37. All results are presented in Table 2 left.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Models</td><td>FID</td></tr><tr><td>ColTran ColTran-B</td><td>19.37 ± 0.09 19.98 ± 0.20</td></tr><tr><td>ColTran-S PixColor[16]</td><td>22.06 ± 0.13 24.32 ± 0.21</td></tr><tr><td>cGAN [3] cINN [1]</td><td>24.41 ± 0.27 25.13 ± 0.3</td></tr><tr><td>VAE-MDN[11]</td><td>25.98 ± 0.28</td></tr><tr><td>Ground truth Grayscale</td><td>14.68 ± 0.15 30.19 ± 0.1</td></tr></table>
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Models</td><td>AMTFooling rate</td></tr><tr><td>ColTran (Oracle) ColTran (Seed 1)</td><td>62.0%±0.99</td></tr><tr><td>ColTran (Seed 2)</td><td>40.5 %± 0.81 42.3 % ± 0.76</td></tr><tr><td>ColTran( (Seed 3)</td><td>41.7 %± 0.83</td></tr><tr><td>PixColor [16] (Oracle)</td><td>38.3%±0.98</td></tr><tr><td>PixColor (Seed 1)</td><td>33.3 %±1.04</td></tr><tr><td>PixColor (Seed 2)</td><td></td></tr><tr><td>PixColor (Seed 3)</td><td>35.4 % ± 1.01</td></tr><tr><td></td><td>33.2 % ± 1.03</td></tr><tr><td>CIC [56]</td><td>29.2 %±0.98</td></tr><tr><td>LRAC [27]</td><td>30.9 % ± 1.02</td></tr><tr><td>LTBC [22]</td><td>25.8 % ± 0.97</td></tr></table>
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Table 2: We outperform various state-of-the-art colorization models both on FID (left) and human evaluation (right). We obtain the FID scores from (Ardizzone et al., 2019) and the human evaluation results from (Guadarrama et al., 2017). ColTran-B is a baseline Axial Transformer that conditions via addition and ColTran-S is a control experiment where we train ColTran core (See: 4.1) on smaller $2 8 \times 2 8$ colored images.
|
| 172 |
+
Figure 5: We display the per-pixel, maximum predicted probability over 512 colors as a proxy for uncertainty.
|
| 173 |
+
|
| 174 |
+
Correlation between FID and Log-likelihood. For each architectural variant, Figure 4 right illustrates the correlation between the log-likelihood and FID after 150K training steps. There is a moderately positive correlation of 0.57 between the log-likelihood and FID. Importantly, even an absolute improvement on the order of $0 . 0 1 \textrm { - } 0 . 0 2$ can improve FID significantly. This suggests that designing architectures that achieve better log-likelihood values is likely to lead to improved FID scores and colorization fidelity.
|
| 175 |
+
|
| 176 |
+
# 5.5 QUALITATIVE EVALUATION
|
| 177 |
+
|
| 178 |
+
Human Evaluation. For our qualitative assessment, we follow the protocol used in PixColor (Guadarrama et al., 2017). ColTran colorizes 500 grayscale images, with 3 different colorizations per image, denoted as seeds. Human raters assess the quality of these colorizations with a two alternative-forced choice (2AFC) test. We display both the ground-truth and recolorized image sequentially for one second in random order. The raters are then asked to identify the image with fake colors. For each seed, we report the mean fooling rate over 500 colorizations and 5 different raters. For the oracle methods, we use the human rating to pick the best-of-three colorizations. ColTran’s best seed achieves a fooling rate of $4 2 . 3 \%$ compared to the $3 5 . 4 \%$ of PixColor’s best seed. ColTran Oracle achieves a fooling rate of $62 \%$ , indicating that human raters prefer ColTran’s best-of-three colorizations over the ground truth image itself.
|
| 179 |
+
|
| 180 |
+
Visualizing uncertainty. The autoregressive core model of ColTran should be highly uncertain at object boundaries when colors change. Figure 5 illustrates the per-pixel, maximum predicted probability over 512 colors as a proxy for uncertainty. We observe that the model is indeed highly uncertain at edges and within more complicated textures.
|
| 181 |
+
|
| 182 |
+
# 6 CONCLUSION
|
| 183 |
+
|
| 184 |
+
We presented the Colorization Transformer (ColTran), an architecture that entirely relies on selfattention for image colorization. We introduce conditional transformer layers, a novel building block for conditional, generative models based on self-attention. Our ablations show the superiority of employing this mechanism over a number of different baselines. Finally, we demonstrate that ColTran can generate diverse, high-fidelity colorizations on ImageNet, which are largely indistinguishable from the ground-truth even for human raters.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Lynton Ardizzone, Carsten Lüth, Jakob Kruse, Carsten Rother, and Ullrich Köthe. Guided image generation with conditional invertible neural networks. arXiv preprint arXiv:1907.02392, 2019.
|
| 189 |
+
|
| 190 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 191 |
+
|
| 192 |
+
Yun Cao, Zhiming Zhou, Weinan Zhang, and Yong Yu. Unsupervised diverse colorization via generative adversarial networks, 2017.
|
| 193 |
+
|
| 194 |
+
Zezhou Cheng, Qingxiong Yang, and Bin Sheng. Deep colorization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 415–423, 2015.
|
| 195 |
+
|
| 196 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 197 |
+
|
| 198 |
+
Yuanzheng Ci, Xinzhu Ma, Zhihui Wang, Haojie Li, and Zhongxuan Luo. User-guided deep anime line art colorization with conditional adversarial networks. In Proceedings of the 26th ACM international conference on Multimedia, pp. 1536–1544, 2018.
|
| 199 |
+
|
| 200 |
+
Ceyda Cinarel and Byoung-Tak Zhang. Into the colorful world of webtoons: Through the lens of neural networks. In 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR), volume 3, pp. 35–40. IEEE, 2017.
|
| 201 |
+
|
| 202 |
+
Ryan Dahl. Automatic colorization, 2016.
|
| 203 |
+
|
| 204 |
+
Harm De Vries, Florian Strub, Jérémie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C Courville. Modulating early visual processing by language. In Advances in Neural Information Processing Systems, pp. 6594–6604, 2017.
|
| 205 |
+
|
| 206 |
+
Aditya Deshpande, Jason Rock, and David Forsyth. Learning large-scale automatic image colorization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 567–575, 2015.
|
| 207 |
+
|
| 208 |
+
Aditya Deshpande, Jiajun Lu, Mao-Chuang Yeh, Min Jin Chong, and David Forsyth. Learning diverse image colorization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6837–6845, 2017.
|
| 209 |
+
|
| 210 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 211 |
+
|
| 212 |
+
Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. arXiv preprint arXiv:1610.07629, 2016.
|
| 213 |
+
|
| 214 |
+
David M Geshwind. Method for colorizing black and white footage, August 19 1986. US Patent 4,606,625.
|
| 215 |
+
|
| 216 |
+
Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
|
| 217 |
+
|
| 218 |
+
Sergio Guadarrama, Ryan Dahl, David Bieber, Mohammad Norouzi, Jonathon Shlens, and Kevin Murphy. Pixcolor: Pixel recursive colorization. arXiv preprint arXiv:1705.07208, 2017.
|
| 219 |
+
|
| 220 |
+
Raj Kumar Gupta, Alex Yong-Sang Chia, Deepu Rajan, Ee Sin Ng, and Huang Zhiyong. Image colorization using similar images. In Proceedings of the 20th ACM international conference on Multimedia, pp. 369–378, 2012.
|
| 221 |
+
|
| 222 |
+
Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019a.
|
| 223 |
+
|
| 224 |
+
Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv preprint arXiv:1912.12180, 2019b.
|
| 225 |
+
|
| 226 |
+
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.
|
| 227 |
+
|
| 228 |
+
Yi-Chin Huang, Yi-Shin Tung, Jun-Cheng Chen, Sung-Wen Wang, and Ja-Ling Wu. An adaptive edge detection based colorization algorithm and its applications. In Proceedings of the 13th annual ACM international conference on Multimedia, pp. 351–354, 2005.
|
| 229 |
+
|
| 230 |
+
Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Let there be color! joint end-to-end learning of global and local image priors for automatic image colorization with simultaneous classification. ACM Transactions on Graphics (ToG), 35(4):1–11, 2016.
|
| 231 |
+
|
| 232 |
+
Revital Ironi, Daniel Cohen-Or, and Dani Lischinski. Colorization by example. In Rendering Techniques, pp. 201–210. Citeseer, 2005.
|
| 233 |
+
|
| 234 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1125–1134, 2017.
|
| 235 |
+
|
| 236 |
+
Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Matt Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon. In-datacenter performance analysis of a tensor processing unit, 2017.
|
| 237 |
+
|
| 238 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 239 |
+
|
| 240 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Learning representations for automatic colorization. In European conference on computer vision, pp. 577–593. Springer, 2016.
|
| 241 |
+
|
| 242 |
+
Anat Levin, Dani Lischinski, and Yair Weiss. Colorization using optimization. In ACM SIGGRAPH 2004 Papers, pp. 689–694. 2004.
|
| 243 |
+
|
| 244 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730–3738, 2015.
|
| 245 |
+
|
| 246 |
+
Qing Luan, Fang Wen, Daniel Cohen-Or, Lin Liang, Ying-Qing Xu, and Heung-Yeung Shum. Natural image colorization. In Proceedings of the 18th Eurographics conference on Rendering Techniques, pp. 309–320, 2007.
|
| 247 |
+
|
| 248 |
+
Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018.
|
| 249 |
+
|
| 250 |
+
Safa Messaoud, David Forsyth, and Alexander G. Schwing. Structural consistency and controllability for diverse colorization. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018.
|
| 251 |
+
|
| 252 |
+
Yuji Morimoto, Yuichi Taguchi, and Takeshi Naemura. Automatic colorization of grayscale images using multiple images on the web. In SIGGRAPH 2009: Talks, pp. 1–1. 2009.
|
| 253 |
+
|
| 254 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
|
| 255 |
+
|
| 256 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 257 |
+
|
| 258 |
+
Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. arXiv preprint arXiv:1709.07871, 2017.
|
| 259 |
+
|
| 260 |
+
François Pitié, Anil C Kokaram, and Rozenn Dahyot. Automated colour grading using colour distribution transfer. Computer Vision and Image Understanding, 107(1-2):123–137, 2007.
|
| 261 |
+
|
| 262 |
+
Yingge Qu, Tien-Tsin Wong, and Pheng-Ann Heng. Manga colorization. ACM Transactions on Graphics (TOG), 25(3):1214–1220, 2006.
|
| 263 |
+
|
| 264 |
+
Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34–41, 2001.
|
| 265 |
+
|
| 266 |
+
Amelie Royer, Alexander Kolesnikov, and Christoph H Lampert. Probabilistic image colorization. arXiv preprint arXiv:1705.04258, 2017.
|
| 267 |
+
|
| 268 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 269 |
+
|
| 270 |
+
Daniel Sykora, Jan Buriánek, and Ji \` ˇrí Žára. Unsupervised colorization of black-and-white cartoons. In Proceedings of the 3rd international symposium on Non-photorealistic animation and rendering, pp. 121–127, 2004.
|
| 271 |
+
|
| 272 |
+
Yu-Wing Tai, Jiaya Jia, and Chi-Keung Tang. Local color transfer via probabilistic segmentation by expectation-maximization. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), volume 1, pp. 747–754. IEEE, 2005.
|
| 273 |
+
|
| 274 |
+
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.
|
| 275 |
+
|
| 276 |
+
Sotirios A Tsaftaris, Francesca Casadio, Jean-Louis Andral, and Aggelos K Katsaggelos. A novel visualization tool for art history and conservation: Automated colorization of black and white archival photographs of works of art. Studies in conservation, 59(3):125–135, 2014.
|
| 277 |
+
|
| 278 |
+
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.
|
| 279 |
+
|
| 280 |
+
Carl Vondrick, Abhinav Shrivastava, Alireza Fathi, Sergio Guadarrama, and Kevin Murphy. Tracking emerges by colorizing videos. In Proceedings of the European conference on computer vision (ECCV), pp. 391–408, 2018.
|
| 281 |
+
|
| 282 |
+
Huiyu Wang, Yukun Zhu, Bradley Green, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Axialdeeplab: Stand-alone axial-attention for panoptic segmentation. arXiv preprint arXiv:2003.07853, 2020.
|
| 283 |
+
|
| 284 |
+
Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. arXiv preprint arXiv:1906.02634, 2019.
|
| 285 |
+
|
| 286 |
+
Tomihisa Welsh, Michael Ashikhmin, and Klaus Mueller. Transferring color to greyscale images. In Proceedings of the 29th annual conference on Computer graphics and interactive techniques, pp. 277–280, 2002.
|
| 287 |
+
|
| 288 |
+
Chufeng Xiao, Chu Han, Zhuming Zhang, Jing Qin, Tien-Tsin Wong, Guoqiang Han, and Shengfeng He. Example-based colourization via dense encoding pyramids. In Computer Graphics Forum, volume 39, pp. 20–33. Wiley Online Library, 2020.
|
| 289 |
+
|
| 290 |
+
Liron Yatziv and Guillermo Sapiro. Fast image and video colorization using chrominance blending. IEEE transactions on image processing, 15(5):1120–1129, 2006.
|
| 291 |
+
|
| 292 |
+
Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
|
| 293 |
+
|
| 294 |
+
Bo Zhang, Mingming He, Jing Liao, Pedro V Sander, Lu Yuan, Amine Bermak, and Dong Chen. Deep exemplar-based video colorization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8052–8061, 2019a.
|
| 295 |
+
|
| 296 |
+
Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International Conference on Machine Learning, pp. 7354–7363. PMLR, 2019b.
|
| 297 |
+
|
| 298 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016.
|
| 299 |
+
|
| 300 |
+
Richard Zhang, Jun-Yan Zhu, Phillip Isola, Xinyang Geng, Angela S Lin, Tianhe Yu, and Alexei A Efros. Real-time user-guided image colorization with learned deep priors. arXiv preprint arXiv:1705.02999, 2017.
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 6: Left: FID vs training steps, with and without polyak averaging. Right: The effect of K in top-K sampling on FID. See Appendix B and E
|
| 304 |
+
|
| 305 |
+
# ACKNOWLEDGEMENTS
|
| 306 |
+
|
| 307 |
+
We would like to thank Mohammad Norouzi, Rianne van den Berg, Mostafa Dehghani for their useful comments on the draft and Avital Oliver for assistance in the Mechanical Turk setup.
|
| 308 |
+
|
| 309 |
+
# CHANGELOG
|
| 310 |
+
|
| 311 |
+
• v2: Dataset Sharding fix across multiple TPU workers. This changed the FID scores of ColTran, ColTran-B and ColTran-S from their v1 values of 19.71, 21.6 and 21.9 to their v2 values of 19.37, 19.98 and 22.06 respecitvely.
|
| 312 |
+
|
| 313 |
+
# A CODE, CHECKPOINTS AND TENSORBOARD FILES
|
| 314 |
+
|
| 315 |
+
Our implementation is open-sourced in the google-research framework at https://github.com/googleresearch/google-research/tree/master/coltran with a zip compressed version here. Our full set of hyperparameters are available here.
|
| 316 |
+
|
| 317 |
+
We provide pre-trained checkpoints of the colorizer and upsamplers on ImageNet at https://console.cloud.google.com/storage/browser/gresearch/coltran. Finally, reference tensorboard files for our training runs are available at colorizer tensorboard, color upsampler tensorboard and spatial upsampler tensorboard.
|
| 318 |
+
|
| 319 |
+
# B EXPONENTIAL MOVING AVERAGE
|
| 320 |
+
|
| 321 |
+
We found using an exponential moving average (EMA) of our checkpoints, extremely crucial to generate high quality samples. In Figure 6, we display the FID as a function of training steps, with and without EMA. On applying EMA, our FID score improves steadily over time.
|
| 322 |
+
|
| 323 |
+
# C NUMBER OF PARAMETERS AND INFERENCE SPEED
|
| 324 |
+
|
| 325 |
+
Inference speed. ColTran core can sample a batch of 20 64x64 grayscale images in around 3.5 -5 minutes on a P100 GPU vs PixColor that takes 10 minutes to colorize $2 8 \mathbf { x } 2 8$ grayscale images on a K40 GPU. Sampling 28x28 colorizations takes around 30 seconds. The upsampler networks take in the order of milliseconds.
|
| 326 |
+
|
| 327 |
+
Further, in our naive implementation, we recompute the activations, $\mathbf { c } U _ { s } ^ { z } , \mathbf { c } U _ { b } ^ { z } , \mathbf { c } U _ { s } ^ { f } , \mathbf { c } U _ { b } ^ { f }$ in Table 1 to generate every pixel in the inner decoder. Instead, we can compute these activations once per-grayscale image in the encoder and once per-row in the outer decoder and reuse them. This is likely to speed up sampling even more and we leave this engineering optimization for future work.
|
| 328 |
+
|
| 329 |
+
Number of parameters. ColTran has a total of ColTran core (46M) + Color Upsampler $\left( 1 4 \mathbf { M } \right) +$ Spatial Upsampler $( 1 4 \mathbf { M } ) = 7 4 \mathbf { M }$ parameters. In comparison, PixColor has Conditioning network $( 4 4 \mathbf { M } ) + \mathbf { \Phi }$ Colorizer network $( 1 1 \mathbf { M } ) + 1$ Refinement Network $( 2 8 \mathbf { M } ) = 8 3 \mathbf { M }$ parameters.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 7: Ablated models. Gated: Gated conditioning layers as done in (Oord et al., 2016) and $c A t t + c M L P ,$ global: Global conditioning instead of pointwise conditioning in cAtt and cLN.
|
| 333 |
+
|
| 334 |
+
# D LOWER COMPUTE REGIME
|
| 335 |
+
|
| 336 |
+
We retrained the autoregressive colorizer and color upsampler on 4 TPUv2 chips (the lowest configuration) with a reduced-batch size of 56 and 192 each. For the spatial upsampler, we found that a batch-size of 8 was sub-optimal and lead to a large deterioration in loss. We thus used a smaller spatial upsampler with 2 axial attention blocks with a batch-size of 16 and trained it also on 4 TPUv2 chips. The FID drops from 19.71 to 20.9 which is still significantly better than the other models in 2. We note that in this experiment, we use only 12 TPUv2 chips in total while PixColor (Guadarrama et al., 2017) uses a total of 16 GPUs.
|
| 337 |
+
|
| 338 |
+
# E IMPROVED FID WITH TOP-K SAMPLING
|
| 339 |
+
|
| 340 |
+
We can improve colorization fidelity and remove artifacts due to unnatural colors via Top-K sampling at the cost of reduced colorization diversity. In this setting, for a given pixel ColTran generates a color from the top-K colors (instead of 512 colors) as determined by the predicted probabilities. Our results in Figure 6 $K = 4$ and $K = 8$ demonstrate a performance improvement over the baseline ColTran model with $K = 5 1 2$
|
| 341 |
+
|
| 342 |
+
# F ADDITIONAL ABLATIONS:
|
| 343 |
+
|
| 344 |
+
Additional ablations of our conditional transformer layers are in Figure 7 which did not help.
|
| 345 |
+
|
| 346 |
+
• Conditional transformer layers based on Gated layers (Oord et al., 2016) (Gated) • A global conditioning layer instead of pointwise conditioning in cAtt and cLN. $c A t t + c M L P ,$ global
|
| 347 |
+
|
| 348 |
+
# G AUTOREGRESSIVE MODELS
|
| 349 |
+
|
| 350 |
+
Autoregressive models are a family of probabilistic methods that model joint distribution of data $P ( x )$ or a sequence of symbols $\left( x _ { 1 } , x _ { 2 } , \ldots x _ { n } \right)$ as a product of conditionals $\textstyle \prod _ { i = 1 } ^ { N } P ( x _ { i } | { x _ { < i } } )$ . During training, the input to autoregressive models are the entire sequence of ground-truth symbols. Masking ensures that the contribution of all "future" symbols in the sequence are zeroed out. The outputs of the autoregressive model are the corresponding conditional distributions. $P ( x _ { i } | \boldsymbol x _ { < i } )$ . Optimizing the parameters of the autoregressive model proceeds by a standard log-likelihood objective.
|
| 351 |
+
|
| 352 |
+
Generation happens sequentially, symbol-by-symbol. Once a symbol $x _ { i }$ is generated, the entire sequence $( x _ { 1 } , x _ { 2 } , \ldots x _ { i } )$ are fed to the autoregressive model to generate $x _ { i + 1 }$ .
|
| 353 |
+
|
| 354 |
+
In the case of autoregressive image generation symbols typically correspond to the 3 RGB pixelchannel. These are generated sequentially in raster-scan order, channel by channel and pixel by pixel.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 8: We train our colorization model on ImageNet and display high resolution colorizations from LSUN
|
| 358 |
+
|
| 359 |
+
# H ROW/COLUMN SELF-ATTENTION
|
| 360 |
+
|
| 361 |
+
In the following we describe row self-attention, that is, we omit the height dimension as all operations are performed in parallel for each column. Given the representation of a single row within of an image $\mathbf { x } _ { i } ,$ · $\in \mathbb { R } ^ { W \times D }$ , row-wise self-attention block is applied as follows:
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { r l r } & { [ \mathbf { q } , \mathbf { k } , \mathbf { v } ] = \mathrm { L N } ( \mathbf { x } _ { i , \cdot } ) U _ { q k v } } & { U _ { q k v } \in \mathbb { R } ^ { D \times 3 D _ { h } } } \\ & { A = \mathrm { s o f t m a x } \left( \mathbf { q } \mathbf { k } ^ { \top } / \sqrt { D _ { h } } \right) } & { A \in \mathbb { R } ^ { W \times W } } \\ & { \mathrm { S A } ( \mathbf { x } _ { i , \cdot } ) = A \mathbf { v } } \\ & { \mathrm { M S A } ( \mathbf { x } _ { i , \cdot } ) = \left[ \mathrm { S A } _ { 1 } ( \mathbf { x } _ { i , \cdot } ) , \mathrm { S A } _ { 2 } ( \mathbf { x } _ { i , \cdot } ) , \cdots , \mathrm { S A } _ { k } ( \mathbf { x } _ { i , \cdot } ) \right] U _ { o u t } } & { U _ { o u t } \in \mathbb { R } ^ { k \cdot D _ { h } \times D } } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
LN refers to the application of layer normalization (Ba et al., 2016). Finally, we apply residual connections and a feed-forward neural network with a single hidden layer and ReLU activation (MLP) after each self-attention block as it is common practice in transformers.
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\begin{array} { r } { \hat { \mathbf { x } } _ { i , \cdot } = \mathrm { M L P } ( \mathrm { L N } ( \mathbf { x } _ { i , \cdot } ^ { \prime } ) ) + \mathbf { x } _ { i , \cdot } ^ { \prime } , \qquad \mathbf { x } _ { i , \cdot } ^ { \prime } = \mathrm { M S A } ( \mathbf { x } _ { i , \cdot } ) + \mathbf { x } _ { i , \cdot } } \end{array}
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Column-wise self-attention over $\mathbf { x } _ { \cdot , j } \in \mathbb { R } ^ { H \times D }$ works analogously.
|
| 374 |
+
|
| 375 |
+
# I OUT OF DOMAIN COLORIZATIONS
|
| 376 |
+
|
| 377 |
+
We use our trained colorization model on ImageNet to colorize high-resolution grayscale images from LSUN $2 5 6 \times 2 5 6$ ( $\mathrm { Y u }$ et al., 2015) and low-resolution grayscale images from Celeb-A (Liu
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 9: We train our colorization model on ImageNet and display low resolution colorizations from Celeb-A
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 10: Top: Colorizations Bottom: Ground truth. From left to right, our colorizations have a progressively higher fooling rate.
|
| 384 |
+
|
| 385 |
+
et al., 2015) $6 4 \times 6 4$ . Note that these models were trained only on ImageNet and not finetuned on Celeb-A or LSUN.
|
| 386 |
+
|
| 387 |
+
# J NUMBER OF AXIAL ATTENTION BLOCKS
|
| 388 |
+
|
| 389 |
+
We did a very small hyperparameter sweep using the baseline axial transformer (no conditional layers) with the following configurations:
|
| 390 |
+
|
| 391 |
+
• hidden size $= 5 1 2$ , number of blocks $= 4$ • hidden size $= 1 0 2 4$ , number of blocks $= 2$ • hidden size $= 5 1 2$ , number of blocks $= 2$
|
| 392 |
+
|
| 393 |
+
Once we found the optimal configuration, we fixed this for all future architecture design.
|
| 394 |
+
|
| 395 |
+
# K ANALYSIS OF MTURK RATINGS
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 11: In each column, we display the ground truth followed by 3 samples. Left: Diverse and real. Center: Realism improves from left to right. Right: Failure cases
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 12: We display the per-pixel, maximum predicted probability over 512 colors as a proxy for uncertainty.
|
| 402 |
+
|
| 403 |
+
We analyzed our samples on the basis of the MTurk ratings in Figure 11. To the left, we show images, where all the samples have a fool rate $> 6 0 \%$ . Our model is able to show diversity in color for both high-level structure and low-level details. In the center, we display samples that have a high variance in MTurk ratings, with a difference of $80 \%$ between the best and the worst sample. All of these are complex objects, that our model is able to colorize reasonably well given multiple attempts. To the right of Figure 11, we show failure cases where all samples have a fool rate of $0 \%$ , For these cases, our model is unable to colorize highly complex structure, that would arguably be difficult even for a human.
|
| 404 |
+
|
| 405 |
+
# L MORE PROBABILITY MAPS
|
| 406 |
+
|
| 407 |
+
We display additional probability maps to visualize uncertainty as done in 5.5.
|
| 408 |
+
|
| 409 |
+
# M MORE SAMPLES
|
| 410 |
+
|
| 411 |
+
We display a wide-diversity of colorizations from ColTran that were not cherry-picked.
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
|
| 421 |
+

|
md/train/8VXvj1QNRl1/8VXvj1QNRl1.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE TRANSFER OF DISENTANGLED REPRESENTA-TIONS IN REALISTIC SETTINGS
|
| 2 |
+
|
| 3 |
+
Andrea Dittadi,∗†1 Frederik Trauble, ¨ ∗2 Francesco Locatello,2,3 Manuel Wuthrich, ¨ 2
|
| 4 |
+
Vaibhav Agrawal,2 Ole Winther,1,4,5 Stefan Bauer,2,6 Bernhard Scholkopf ¨ 2
|
| 5 |
+
1Technical University of Denmark, $^ { 2 } \mathrm { M a x }$ Planck Institute for Intelligent Systems,
|
| 6 |
+
3ETH Zurich, Department for Computer Science, 4Copenhagen University Hospital,
|
| 7 |
+
5University of Copenhagen , 6CIFAR Azrieli Global Scholar
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Learning meaningful representations that disentangle the underlying structure of the data generating process is considered to be of key importance in machine learning. While disentangled representations were found to be useful for diverse tasks such as abstract reasoning and fair classification, their scalability and real-world impact remain questionable. We introduce a new high-resolution dataset with 1M simulated images and over 1,800 annotated real-world images of the same setup. In contrast to previous work, this new dataset exhibits correlations, a complex underlying structure, and allows to evaluate transfer to unseen simulated and realworld settings where the encoder i) remains in distribution or ii) is out of distribution. We propose new architectures in order to scale disentangled representation learning to realistic high-resolution settings and conduct a large-scale empirical study of disentangled representations on this dataset. We observe that disentanglement is a good predictor for out-of-distribution (OOD) task performance.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Disentangled representations hold the promise of generalization to unseen scenarios (Higgins et al., 2017b), increased interpretability (Adel et al., 2018; Higgins et al., 2018) and faster learning on downstream tasks (van Steenkiste et al., 2019; Locatello et al., 2019a). However, most of the focus in learning disentangled representations has been on small synthetic datasets whose ground truth factors exhibit perfect independence by design. More realistic settings remain largely unexplored. We hypothesize that this is because real-world scenarios present several challenges that have not been extensively studied to date. Important challenges are scaling (much higher resolution in observations and factors), occlusions, and
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Images from the simulated dataset (left) and from the real-world setup (right).
|
| 19 |
+
|
| 20 |
+
correlation between factors. Consider, for instance, a robotic arm moving a cube: Here, the robot arm can occlude parts of the cube, and its end-effector position exhibits correlations with the cube’s position and orientation, which might be problematic for common disentanglement learners (Trauble ¨ et al., 2020). Another difficulty is that we typically have only limited access to ground truth labels in the real world, which requires robust frameworks for model selection when no or only weak labels are available.
|
| 21 |
+
|
| 22 |
+
The goal of this work is to provide a path towards disentangled representation learning in realistic settings. First, we argue that this requires a new dataset that captures the challenges mentioned above. We propose a dataset consisting of simulated observations from a scene where a robotic arm interacts with a cube in a stage (see Fig. 1). This setting exhibits correlations and occlusions that are typical in real-world robotics. Second, we show how to scale the architecture of disentanglement methods to perform well on this dataset. Third, we extensively analyze the usefulness of disentangled representations in terms of out-of-distribution downstream generalization, both in terms of held-out factors of variation and sim2real transfer. In fact, our dataset is based on the TriFinger robot from Wuthrich et al. (2020), which can be built to test the deployment of models in the real ¨ world. While the analysis in this paper focuses on the transfer and generalization of predictive models, we hope that our dataset may serve as a benchmark to explore the usefulness of disentangled representations in real-world control tasks.
|
| 23 |
+
|
| 24 |
+
The contributions of this paper can be summarized as follows:
|
| 25 |
+
|
| 26 |
+
• We propose a new dataset for disentangled representation learning, containing 1M simulated high-resolution images from a robotic setup, with seven partly correlated factors of variation. Additionally, we provide a dataset of over 1,800 annotated images from the corresponding real-world setup that can be used for challenging sim2real transfer tasks. These datasets are made publicly available.1
|
| 27 |
+
We propose a new neural architecture to successfully scale VAE-based disentanglement learning approaches to complex datasets.
|
| 28 |
+
• We conduct a large-scale empirical study on generalization to various transfer scenarios on this challenging dataset. We train 1,080 models using state-of-the-art disentanglement methods and discover that disentanglement is a good predictor for out-of-distribution (OOD) performance of downstream tasks.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Disentanglement methods. Most state-of-the-art disentangled representation learning approaches are based on the framework of variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014). A (high-dimensional) observation $_ { \textbf { \em x } }$ is assumed to be generated according to the latent variable model $p _ { \theta } ( \pmb { x } | \pmb { z } ) p ( \pmb { z } )$ where the latent variables $_ { z }$ have a fixed prior $p ( z )$ . The generative model $p _ { \theta } ( { \pmb x } | { \pmb z } )$ and the approximate posterior distribution $q _ { \phi } ( \pmb { z } | \pmb { x } )$ are typically parameterized by neural networks, which are optimized by maximizing the evidence lower bound (ELBO):
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\mathcal { L } _ { V A E } = \mathbb { E } _ { q _ { \phi } ( z | x ) } [ \log p _ { \theta } ( \pmb { x } | z ) ] - D _ { \mathrm { K L } } ( q _ { \phi } ( z | \pmb { x } ) | | p ( z ) ) \le \log p ( \pmb { x } )
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
As the above objective does not enforce any structure on the latent space except for some similarity to $p ( z )$ , different regularization strategies have been proposed, along with evaluation metrics to gauge the disentanglement of the learned representations (Higgins et al., $2 0 1 7 \mathrm { a }$ ; Kim & Mnih, 2018; Burgess et al., 2018; Kumar et al., 2018; Chen et al., 2018; Eastwood & Williams, 2018). Recently, Locatello et al. (2019b, Theorem 1) showed that the purely unsupervised learning of disentangled representations is impossible. This limitation can be overcome without the need for explicitly labeled data by introducing weak labels (Locatello et al., 2020; Shu et al., 2019). Ideas related to disentangling the factors of variation date back to the non-linear ICA literature (Comon, 1994; Hyvarinen & Pajunen, 1999; Bach & Jordan, 2002; Jutten & Karhunen, 2003; Hyvarinen & ¨ Morioka, 2016; Hyvarinen et al., 2019; Gresele et al., 2019). Recent work combines non-linear ICA with disentanglement (Khemakhem et al., 2020; Sorrenson et al., 2020; Klindt et al., 2020).
|
| 39 |
+
|
| 40 |
+
Evaluating disentangled representations. The BetaVAE (Higgins et al., 2017a) and FactorVAE (Kim & Mnih, 2018) scores measure disentanglement by performing an intervention on the factors of variation and predicting which factor was intervened on. The Mutual Information Gap (MIG) (Chen et al., 2018), Modularity (Ridgeway & Mozer, 2018), DCI Disentanglement (Eastwood & Williams, 2018) and SAP scores (Kumar et al., 2018) are based on matrices relating factors of variation and codes (e.g. pairwise mutual information, feature importance and predictability).
|
| 41 |
+
|
| 42 |
+
Datasets for disentanglement learning. dSprites (Higgins et al., 2017a), which consists of binary low-resolution 2D images of basic shapes, is one of the most commonly used synthetic datasets for disentanglement learning. Color-dSprites, Noisy-dSprites, and Scream-dSprites are slightly more challenging variants of dSprites. The SmallNORB dataset contains toy images rendered under different lighting conditions, elevations and azimuths (LeCun et al., 2004). Cars3D (Reed et al., 2015) exhibits different car models from Fidler et al. (2012) under different camera viewpoints. 3dshapes is a popular dataset of simple shapes in a 3D scene (Kim & Mnih, 2018). Finally, Gondal et al. (2019) proposed MPI3D, containing images of physical 3D objects with seven factors of variation, such as object color, shape, size and position available in a simulated, simulated and highly realistic rendered simulated variant. Except MPI3D which has over 1M images, the size of the other datasets is limited with only 17, 568 to 737, 280 images. All of the above datasets exhibit perfect independence of all factors, the number of possible states is on the order of 1M or less, and due to their static setting they do not allow for dynamic downstream tasks such as reinforcement learning. In addition, except for SmallNORB, the image resolution is limited to 64x64 and there are no occlusions.
|
| 43 |
+
|
| 44 |
+
Other related work. Locatello et al. (2020) probed the out-of-distribution generalization of downstream tasks trained on disentangled representations. However, these representations are trained on the entire dataset. Generalization and transfer performance especially for representation learning has likewise been studied in Dayan (1993); Muandet et al. (2013); Heinze-Deml & Meinshausen (2017); Rojas-Carulla et al. (2018); Suter et al. (2019); Li et al. (2018); Arjovsky et al. (2019); Krueger et al. (2020); Gowal et al. (2020). For the role of disentanglement in causal representation learning we refer to the recent overview by Scholkopf et al. (2021). Tr ¨ auble et al. (2020) systematically investi- ¨ gated the effects of correlations between factors of variation on disentangled representation learners. Transfer of learned disentangled representations from simulation to the real world has been recently investigated by Gondal et al. (2019) on the MPI3D dataset, and previously by Higgins et al. (2017b) in the context of reinforcement learning. Sim2real transfer is of major interest in the robotic learning community, because of limited data and supervision in the real world (Tobin et al., 2017; Rusu et al., 2017; Peng et al., 2018; James et al., 2019; Yan et al., 2020; Andrychowicz et al., 2020).
|
| 45 |
+
|
| 46 |
+
A new challenging dataset. Simulated images in our dataset are derived from the trifinger robot platform introduced by Wuthrich et al. ¨ (2020). The motivation for choosing this setting is that (1) it is challenging due to occlusions, correlations, and other difficulties encountered in robotic settings, (2) it requires modeling of fine details such as tip links at high resolutions, and (3) it corresponds to a robotic setup, so that learned representations can be used for control and reinforcement learning in simulation and in the real world. The scene comprises a robot finger with three joints that can be controlled to manipulate a cube in a bowl-shaped stage. Fig. 1 shows examples of scenes from our dataset. The data is generated from 7 different factors of variation (FoV)
|
| 47 |
+
|
| 48 |
+
3 SCALING DISENTANGLED REPRESENTATIONS TO COMPLEX SCENARIOS
|
| 49 |
+
Table 1: Factors of variation in the proposed dataset. Values are linearly spaced in the specified intervals. Joint angles are in radians, cube positions in meters.
|
| 50 |
+
|
| 51 |
+
<table><tr><td rowspan=1 colspan=2>FoV Values</td></tr><tr><td rowspan=1 colspan=1>Upper joint</td><td rowspan=1 colspan=1>30 values in[-0.65,+0.65]</td></tr><tr><td rowspan=1 colspan=1>Middle joint 30 values in</td><td rowspan=1 colspan=1>[-0.5,+0.5]</td></tr><tr><td rowspan=1 colspan=1>Lower joint 30 values in</td><td rowspan=1 colspan=1>[-0.8,+0.8]</td></tr><tr><td rowspan=2 colspan=1>Cube position X 30 values in[-0.11, +0.11]Cube position y 30 values in[-0.11, +0.11]</td><td rowspan=1 colspan=1>+0.11]</td></tr><tr><td rowspan=1 colspan=1>[-0.11, +0.11]</td></tr><tr><td rowspan=1 colspan=1>Cube rotation 10 values in [0°,81°]</td><td rowspan=2 colspan=1>12 values in [0°,330°]</td></tr><tr><td rowspan=1 colspan=1>Cube color hue 12 values in [0°,330°]</td></tr></table>
|
| 52 |
+
|
| 53 |
+
listed in Table 1. Unlike in previous datasets, not all FoVs are independent: The end-effector (the tip of the finger) can collide with the floor or the cube, resulting in infeasible combinations of the factors (see Appendix B.1). We argue that such correlations are a key feature in real-world data that is not present in existing datasets. The high FoV resolution results in approximately 1.52 billion feasible states, but the dataset itself only contains one million of them (approximately $0 . 0 6 5 \%$ of all possible FoV combinations), realistically rendered into $1 2 8 \times 1 2 8$ images. Additionally, we recorded an annotated dataset under the same conditions in the real-world setup: we acquired 1,809 camera images from the same viewpoint and recorded the labels of the 7 underlying factors of variation. This dataset can be used for out-of-distribution evaluations, few-shot learning, and testing other sim2real aspects.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 2: Latent traversals of a trained model that perfectly disentangles the dataset’s FoVs. In each column, all latent variables but one are fixed.
|
| 57 |
+
|
| 58 |
+
Model architecture. When scaling disentangled representation learning to more complex datasets, such as the one proposed here, one of the main bottlenecks in current VAE-based approaches is the flexibility of the encoder and decoder networks. In particular, using the architecture from Locatello et al. (2019b), none of the models we trained correctly captured all factors of variation or yielded high-quality reconstructions. While the increased image resolution already presents a challenge, the main practical issue in our new dataset is the level of detail that needs to be modeled. In particular, we identified the cube rotation and the lower joint position to be the factors of variation that were the hardest to capture. This is likely because these factors only produce relatively small changes in the image and hence the reconstruction error.
|
| 59 |
+
|
| 60 |
+
To overcome these issues, we propose a deeper and wider neural architecture than those commonly used in the disentangled representation learning literature, where the encoder and decoder typically have 4 convolutional and 2 fully-connected layers. Our encoder consists of a convolutional layer, 10 residual blocks, and 2 fully-connected layers. Some residual blocks are followed by 1x1 convolutions that change the number of channels, or by average pooling that downsamples the tensors by a factor of 2 along the spatial dimensions. Each residual block consists of two 3x3 convolutions with a leaky ReLU nonlinearity, and a learnable scalar gating mechanism (Bachlechner et al., 2020). Overall, the encoder has 23 convolutional layers and 2 fully connected layers. The decoder mirrors this architecture, with average pooling replaced by bilinear interpolation for upsampling. The total number of parameters is approximately 16.3M. See Appendix A for further implementation details.
|
| 61 |
+
|
| 62 |
+
Experimental setup. We perform a large-scale empirical study on the simulated dataset introduced above by training 1,080 $\beta$ -VAE models.2 For further experimental details we refer the reader to Appendix A. The hyperparameter sweep is defined as follows:
|
| 63 |
+
|
| 64 |
+
• We train the models using either unsupervised learning or weakly supervised learning (Locatello et al., 2020). In the weakly supervised case, a model is trained with pairs of images that differ in $k$ factors of variation. Here we fix $k = 1$ as it was shown to lead to higher disentanglement by Locatello et al. (2020). The dataset therefore consists of $5 0 0 \mathrm { k }$ pairs of images that differ in only one FoV.
|
| 65 |
+
• We vary the parameter $\beta$ in $\{ 1 , 2 , 4 \}$ , and use linear deterministic warm-up (Bowman et al., 2015; Sønderby et al., 2016) over the first $\{ 0 , 1 0 0 0 0 , 5 0 0 0 0 \}$ training steps.
|
| 66 |
+
• The latent space dimensionality is in $\{ 1 0 , 2 5 , 5 0 \}$ .
|
| 67 |
+
• Half of the models are trained with additive noise in the input image. This choice is motivated by the fact that adding noise to the input of neural networks has been shown to be beneficial for out-of-distribution generalization (Sietsma & Dow, 1991; Bishop, 1995).
|
| 68 |
+
• Each of the 108 resulting configurations is trained with 10 random seeds.
|
| 69 |
+
|
| 70 |
+
Can we scale up disentanglement learning? Most of the trained VAEs in our empirical study fully capture all the elements of a scene, correctly model heavy occlusions, and generate detailed, high-quality samples and reconstructions (see Appendix B.2). From visual inspections such as the latent traversals in Fig. 2, we observe that many trained models fully disentangle the ground-truth factors of variation. This, however, appears to only be possible in the weakly supervised scenario. The fact that models trained without supervision learn entangled representations is in line with the impossibility result for the unsupervised learning of disentangled representations from Locatello et al. (2019b). Latent traversals from a selection of models with different degrees of disentanglement are presented in Appendix B.3. Interestingly, the high-disentanglement models seem to correct for correlations and interpolate infeasible states, i.e. the fingertip traverses through the cube or the floor.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 3: Left: Disentanglement metrics aggregating all hyperparameters except for supervision type. Right: Rank correlations (Spearman) of ELBO, reconstruction loss, and the test error of a GBT classifier trained on 10,000 labelled data points with disentanglement metrics. The upper rank correlations correspond to the unsupervised models and the lower to the weakly supervised models.
|
| 74 |
+
|
| 75 |
+
Summary: The proposed architecture can scale disentanglement learning to more realistic settings, but a form of weak supervision is necessary to achieve high disentanglement.
|
| 76 |
+
|
| 77 |
+
How useful are common disentanglement metrics in realistic scenarios? The violin plot in Fig. 3 (left) shows that DCI and MIG measure high disentanglement under weak supervision and lower disentanglement in the unsupervised setting. This is consistent with our qualitative conclusion from visual inspection of the models (Appendix B.3) and with the aforementioned impossibility result. Many of the models trained with weak supervision exhibit a very high DCI score $2 9 \%$ of them have ${ > } 9 9 \%$ DCI, some of them up to $9 9 . 8 9 \%$ ). SAP and Modularity appear to be ineffective at capturing disentanglement in this setting, as also observed by Locatello et al. (2019b). Finally, note that the BetaVAE and FactorVAE metrics are not straightforward to be evaluated on datasets that do not contain all possible combinations of factor values. According to Fig. 3 (right), DCI and MIG strongly correlate with test accuracy of GBT classifiers predicting the FoVs. In the weakly supervised setting, these metrics are strongly correlated with the ELBO (positively) and with the reconstruction loss (negatively). We illustrate these relationships in more detail in Appendix B.4. Such correlations were also observed by Locatello et al. (2020) on significantly less complex datasets, and can be exploited for unsupervised model selection: these unsupervised metrics can be used as proxies for disentanglement metrics, which would require fully labeled data.
|
| 78 |
+
|
| 79 |
+
Summary: DCI and MIG appear to be useful disentanglement metrics in realistic scenarios, whereas other metrics seem to fall short of capturing disentanglement or can be difficult to compute. When using weak supervision, we can select disentangled models with unsupervised metrics.
|
| 80 |
+
|
| 81 |
+
# 4 FRAMEWORK FOR THE EVALUATION OF OOD GENERALIZATION
|
| 82 |
+
|
| 83 |
+
Previous work has focused on evaluating the usefulness of disentangled representations for various downstream tasks, such as predicting ground truth factors of variation, fair classification, and abstract reasoning. Here we propose a new framework for evaluating the out-of-distribution (OOD) generalization properties of representations. More specifically, we consider a downstream task – in our case, regression of ground truth factors – trained on a learned representation of the data, and evaluate the performance on a held-out test set. While the test set typically follows the same distribution as the training set (in-distribution generalization), we also consider test sets that follow a different distribution (out-of-distribution generalization). Our goal is to investigate to what extent, if at all, downstream tasks trained on disentangled representations exhibit a higher degree of OOD generalization than those trained on entangled representations.
|
| 84 |
+
|
| 85 |
+
Let $D$ denote the training set for disentangled representation learning. To investigate OOD generalization, we train downstream regression models on a subset $D _ { 1 } \subset D$ to predict ground truth factor values from the learned representation computed by the encoder. We independently train one predictor per factor. We then test the regression models on a set $D _ { 2 }$ that differs distributionally from the training set $D _ { 1 }$ , as it either contains images corresponding to held-out values of a chosen FoV (e.g. unseen object colors), or it consists of real-world images. We now differentiate between two scenarios: (1) $D _ { 2 } \subset D$ , i.e. the OOD test set is a subset of the dataset for representation learning; (2) $D$ and $D _ { 2 }$ are disjoint and distributionally different. These two scenarios will be denoted by $O O D I$ and $O O D 2$ , respectively. For example, consider the case in which distributional shifts are based on one FoV: the color of the object. Then, we could define these datasets such that images in $D$ always contain a red or blue object, and those in $D _ { 1 } \subset D$ always contain a red object. In the OOD1 scenario, images in $D _ { 2 }$ would always contain a blue object, whereas in the OOD2 case they would always contain an object that is neither red nor blue.
|
| 86 |
+
|
| 87 |
+
The regression models considered here are Gradient Boosted Trees (GBT), random forests, and MLPs with $\{ 1 , 2 , 3 \}$ hidden layers. Since random forests exhibit a similar behavior to GBTs, and all MLPs yield similar results to each other, we choose GBTs and the 2-layer MLP as representative models and only report results for those. To quantify prediction quality, we normalize the ground truth factor values to the range $[ 0 , 1 ]$ , and compute the mean absolute error (MAE). Since the values are normalized, we can define our transfer metric as the average of the MAE over all factors (except for the FoV that is OOD).
|
| 88 |
+
|
| 89 |
+
# 5 BENEFITS AND TRANSFER OF STRUCTURED REPRESENTATIONS
|
| 90 |
+
|
| 91 |
+
Experimental setup. We evaluate the transfer metric introduced in Section 4 across all 1,080 trained models. To compute this metric, we train regression models to predict the ground truth factors of variation, and test them under distributional shift. We consider distributional shifts in terms of cube color or sim2real, and we do not evaluate downstream prediction of cube color. We report scores for two different regression models: a Gradient Boosted Tree (GBT) and an MLP with 2 hidden layers of size 256. In Appendix A we provide details on the datasets used in this section.
|
| 92 |
+
|
| 93 |
+
In the OOD1 setting, we have $D _ { 2 } ~ \subset ~ D$ , hence the encoder is in-distribution: we are testing the predictor on representations of images that were in the training set of the representation learning algorithm. Therefore, we expect the representations to be meaningful. We consider three scenarios:
|
| 94 |
+
|
| 95 |
+
OOD1-A: The regression models are trained on 1 cube color (red) and evaluated on the remaining 7 colors. OOD1-B: The regression models are trained on 4 cube colors with high hue in the HSV space, and evaluated on 4 cube colors with low hue (extrapolation). OOD1-C: The regression models are again trained and evaluated on 4 cube colors, but the training and evaluation colors are alternating along the hue dimension (interpolation).
|
| 96 |
+
|
| 97 |
+
In the more challenging setting where even the encoder goes out-of-distribution (OOD2, with $D _ { 2 } \cap$ $D = \varnothing$ ), we train the regression models on a subset of the training set $D$ that includes all 8 cube colors, and we consider the two following scenarios:
|
| 98 |
+
|
| 99 |
+
• OOD2-A: The regression models are evaluated on simulated data, on 4 cube colors that are out of the encoder’s training distribution.
|
| 100 |
+
• OOD2-B: The regression models are evaluated on real-world images of the robotic setup, without any adaptation or fine-tuning.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 4: Higher disentanglement corresponds to better generalization across all OOD1 scenarios, as seen from the transfer scores (left). The transfer score is computed as the mean absolute prediction error of ground truth factor values (lower is better). This correlation is particularly evident in the GBT case, whereas MLPs appear to exhibit better OOD1 transfer with very high disentanglement only. These results are mirrored in the Spearman rank correlations between transfer scores and disentanglement metrics (right).
|
| 104 |
+
|
| 105 |
+
Is disentanglement correlated with OOD1 generalization? In Fig. 4 we consistently observe a negative correlation between disentanglement and transfer error across all OOD1 settings. The correlation is mild when using MLPs, strong when using GBTs. This difference is expected, as GBTs have an axis-alignment bias whereas MLPs can – given enough data and capacity – disentangle an entangled representation more easily. Our results therefore suggest that highly disentangled representations are useful for generalizing out-of-distribution as long as the encoder remains in-distribution. This is in line with the correlation found by Locatello et al. (2019b) between disentanglement and the GBT10000 metric. There, however, GBTs are tested on the same distribution as the training distribution, while here we test them under distributional shift. Given that the computation of disentanglement scores requires labels, this is of little benefit in the unsupervised setting. However, it can be exploited in the weakly supervised setting, where disentanglement was shown to correlate with ELBO and reconstruction loss (Section 3). Therefore, model selection for representations that transfer well in these scenarios is feasible based on the ELBO or reconstruction loss, when weak supervision is available. Note that, in absolute terms, the OOD generalization error with encoder in-distribution (OOD1) is very low in the high-disentanglement case (the only exception being the MLP in the OOD1-C case, with the 1-7 color split, which seems to overfit). This suggests that disentangled representations can be useful in downstream tasks even when transferring out of the training distribution.
|
| 106 |
+
|
| 107 |
+
Summary: Disentanglement seems to be positively correlated with OOD generalization of downstream tasks, provided that the encoder remains in-distribution (OOD1). Since in the weakly supervised case disentanglement correlates with the ELBO and the reconstruction loss, model selection can be performed using these metrics as proxies for disentanglement. These metrics have the advantage that they can be computed without labels, unlike disentanglement metrics.
|
| 108 |
+
|
| 109 |
+
Is disentanglement correlated with OOD2 generalization? As seen in Fig. 5, the negative correlation between disentanglement and GBT transfer error is weaker when the encoder is out of distribution (OOD2). Nonetheless, we observe a non-negligible correlation for GBTs in the OOD2- A case, where we investigate out-of-distribution generalization along one FoV, with observations in $D _ { 2 }$ still generated from the same simulator. In the OOD2-B setting, where the observations are taken from cameras in the corresponding real-world setting, the correlation between disentanglement and transfer performance appears to be minor at best. This scenario can be considered a variant of zero-shot sim2real generalization.
|
| 110 |
+
|
| 111 |
+
Summary: Disentanglement has a minor effect on out-of-distribution generalization outside of the training distribution of the encoder (OOD2).
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 5: Disentanglement affects generalization across the OOD2 scenarios only minimally as seen from transfer scores (left) and corresponding rank correlations with disentanglement metrics (right).
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 6: Noise improves generalization across the OOD2 scenarios and less so for the OOD1 scenarios as seen from the transfer scores. Top row: Spearman rank correlation coefficients between transfer metrics and presence of noise in the input.
|
| 118 |
+
|
| 119 |
+
What else matters for OOD2 generalization? Results in Fig. 6 suggest that adding Gaussian noise to the input during training as described in Section 3 leads to significantly better OOD2 generalization, and has no effect on OOD1 generalization. Adding noise to the input of neural networks is known to lead to better generalization (Sietsma & Dow, 1991; Bishop, 1995). This is in agreement with our results, since OOD1 generalization does not require generalization of the encoder, while OOD2 does. Interestingly, closer inspection reveals that the contribution of different factors of variation to the generalization error can vary widely. See Appendix B.5 for further details. In particular, with noisy input, the position of the cube is predicted accurately even in real-world images ${ < } 5 \%$ mean absolute error on each axis). This is promising for robotics applications, where the true state of the joints is observable but inference of the cube position relies on object tracking methods. Fig. 7 shows an example of real-world inputs and reconstructions of their simulated equivalents.
|
| 120 |
+
|
| 121 |
+
Summary: Adding input noise during training appears to be significantly beneficial for OOD2 generalization, while having no effect when the encoder is kept in its training distribution (OOD1).
|
| 122 |
+
|
| 123 |
+
# 6 CONCLUSION
|
| 124 |
+
|
| 125 |
+
Despite the growing importance of the field and the potential societal impact in the medical domain (Chartsias et al., 2018) and fair decision making (Locatello et al., 2019a), state-of-the-art approaches for learning disentangled representations have so far only been systematically evaluated on synthetic toy datasets. Here we introduced a new high-resolution dataset with 1M simulated images and over 1,800 annotated real-world images of the same setup. This dataset exhibits a number of challenges and features which are not present in previous datasets: it contains correlations between factors, occlusions, a complex underlying structure, and it allows for evaluation of transfer to unseen simulated and real-world settings. We proposed a new VAE architecture to scale disentangled representation learning to this realistic setting and conducted a large-scale empirical study of disentangled representations on this dataset. We discovered that disentanglement is a good predictor of OOD generalization of downstream tasks and showed that, in the context of weak supervision, model selection for good OOD performance can be based on the ELBO or the reconstruction loss, which are accessible without explicit labels. Our setting allows for studying a wide variety of interesting downstream tasks in the future, such as reinforcement learning or learning a dynamics model of the environment. Finally, we believe that in the future it will be important to take further steps in the direction of this paper by considering settings with even more complex structures and stronger correlations between factors.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 7: Zero-shot transfer to real-world observations of our models trained in simulation. Left: input; right: reconstruction.
|
| 129 |
+
|
| 130 |
+
# ACKNOWLEDGEMENTS
|
| 131 |
+
|
| 132 |
+
The authors thank Shruti Joshi and Felix Widmaier for their useful comments on the simulated setup, Anirudh Goyal for helpful discussions and comments, and CIFAR for the support. We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Frederik Trauble.¨
|
| 133 |
+
|
| 134 |
+
# REFERENCES
|
| 135 |
+
|
| 136 |
+
Tameem Adel, Zoubin Ghahramani, and Adrian Weller. Discovering interpretable representations for both deep generative and discriminative models. In International Conference on Machine Learning, pp. 50–59, 2018.
|
| 137 |
+
|
| 138 |
+
OpenAI: Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. The International Journal of Robotics Research, 39(1):3–20, 2020.
|
| 139 |
+
|
| 140 |
+
Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
|
| 141 |
+
|
| 142 |
+
Francis Bach and Michael Jordan. Kernel independent component analysis. Journal of Machine Learning Research, 3(7):1–48, 2002.
|
| 143 |
+
|
| 144 |
+
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.
|
| 145 |
+
|
| 146 |
+
Chris M Bishop. Training with noise is equivalent to tikhonov regularization. Neural computation, 7(1):108–116, 1995.
|
| 147 |
+
|
| 148 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
|
| 149 |
+
|
| 150 |
+
Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in beta-VAE. arXiv preprint arXiv:1804.03599, 2018.
|
| 151 |
+
|
| 152 |
+
Agisilaos Chartsias, Thomas Joyce, Giorgos Papanastasiou, Scott Semple, Michelle Williams, David Newby, Rohan Dharmakumar, and Sotirios A Tsaftaris. Factorised spatial representation learning: Application in semi-supervised myocardial segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 490–498. Springer, 2018.
|
| 153 |
+
|
| 154 |
+
Tian Qi Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, 2018.
|
| 155 |
+
|
| 156 |
+
Pierre Comon. Independent component analysis, a new concept? Signal Processing, 36(3):287–314, 1994.
|
| 157 |
+
|
| 158 |
+
Peter Dayan. Improving generalization for temporal difference learning: The successor representation. Neural Computation, 5(4):613–624, 1993.
|
| 159 |
+
|
| 160 |
+
Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. In International Conference on Learning Representations, 2018.
|
| 161 |
+
|
| 162 |
+
Sanja Fidler, Sven Dickinson, and Raquel Urtasun. 3d object detection and viewpoint estimation with a deformable 3d cuboid model. In Advances in neural information processing systems, pp. 611–619, 2012.
|
| 163 |
+
|
| 164 |
+
Muhammad Waleed Gondal, Manuel Wuthrich, Djordje Miladinovi ¨ c, Francesco Locatello, Martin ´ Breidt, Valentin Volchkov, Joel Akpo, Olivier Bachem, Bernhard Scholkopf, and Stefan Bauer. ¨ On the transfer of inductive bias from simulation to the real world: a new disentanglement dataset. In Advances in Neural Information Processing Systems, 2019.
|
| 165 |
+
|
| 166 |
+
Sven Gowal, Chongli Qin, Po-Sen Huang, Taylan Cemgil, Krishnamurthy Dvijotham, Timothy Mann, and Pushmeet Kohli. Achieving robustness in the wild via adversarial mixing with disentangled representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1211–1220, 2020.
|
| 167 |
+
|
| 168 |
+
Luigi Gresele, Paul K. Rubenstein, Arash Mehrjou, Francesco Locatello, and Bernhard Scholkopf.¨ The incomplete rosetta stone problem: Identifiability results for multi-view nonlinear ica. In Conference on Uncertainty in Artificial Intelligence (UAI), 2019.
|
| 169 |
+
|
| 170 |
+
Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. arXiv preprint arXiv:1710.11469, 2017.
|
| 171 |
+
|
| 172 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations, 2017a.
|
| 173 |
+
|
| 174 |
+
Irina Higgins, Arka Pal, Andrei Rusu, Loic Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. Darla: Improving zero-shot transfer in reinforcement learning. In International Conference on Machine Learning, 2017b.
|
| 175 |
+
|
| 176 |
+
Irina Higgins, Nicolas Sonnerat, Loic Matthey, Arka Pal, Christopher P Burgess, Matko Bosnjak, ˇ Murray Shanahan, Matthew Botvinick, Demis Hassabis, and Alexander Lerchner. Scan: Learning hierarchical compositional visual concepts. In International Conference on Learning Representations, 2018.
|
| 177 |
+
|
| 178 |
+
Aapo Hyvarinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ica. In Advances in Neural Information Processing Systems, 2016.
|
| 179 |
+
|
| 180 |
+
Aapo Hyvarinen and Petteri Pajunen. Nonlinear independent component analysis: Existence and ¨ uniqueness results. Neural Networks, 1999.
|
| 181 |
+
|
| 182 |
+
Aapo Hyvarinen, Hiroaki Sasaki, and Richard E Turner. Nonlinear ica using auxiliary variables and generalized contrastive learning. In International Conference on Artificial Intelligence and Statistics, 2019.
|
| 183 |
+
|
| 184 |
+
Stephen James, Paul Wohlhart, Mrinal Kalakrishnan, Dmitry Kalashnikov, Alex Irpan, Julian Ibarz, Sergey Levine, Raia Hadsell, and Konstantinos Bousmalis. Sim-to-real via sim-to-sim: Dataefficient robotic grasping via randomized-to-canonical adaptation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12627–12637, 2019.
|
| 185 |
+
|
| 186 |
+
Christian Jutten and Juha Karhunen. Advances in nonlinear blind source separation. In International Symposium on Independent Component Analysis and Blind Signal Separation, pp. 245–256, 2003.
|
| 187 |
+
|
| 188 |
+
Ilyes Khemakhem, Diederik Kingma, Ricardo Monti, and Aapo Hyvarinen. Variational autoencoders and nonlinear ica: A unifying framework. In International Conference on Artificial Intelligence and Statistics, pp. 2207–2217, 2020.
|
| 189 |
+
|
| 190 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, 2018.
|
| 191 |
+
|
| 192 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 193 |
+
|
| 194 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
|
| 195 |
+
|
| 196 |
+
David Klindt, Lukas Schott, Yash Sharma, Ivan Ustyuzhaninov, Wieland Brendel, Matthias Bethge, and Dylan Paiton. Towards nonlinear disentanglement in natural data with temporal sparse coding. arXiv preprint arXiv:2007.10930, 2020.
|
| 197 |
+
|
| 198 |
+
David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). arXiv preprint arXiv:2003.00688, 2020.
|
| 199 |
+
|
| 200 |
+
Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. In International Conference on Learning Representations, 2018.
|
| 201 |
+
|
| 202 |
+
Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In IEEE Conference on Computer Vision and Pattern Recognition, 2004.
|
| 203 |
+
|
| 204 |
+
Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 624–639, 2018.
|
| 205 |
+
|
| 206 |
+
Francesco Locatello, Gabriele Abbati, Thomas Rainforth, Stefan Bauer, Bernhard Scholkopf, and ¨ Olivier Bachem. On the fairness of disentangled representations. In Advances in Neural Information Processing Systems, pp. 14611–14624, 2019a.
|
| 207 |
+
|
| 208 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Sylvain Gelly, Bernhard Scholkopf, and Olivier ¨ Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In International Conference on Machine Learning, 2019b.
|
| 209 |
+
|
| 210 |
+
Francesco Locatello, Ben Poole, Gunnar Ratsch, Bernhard Sch¨ olkopf, Olivier Bachem, and¨ Michael Tschannen. Weakly-supervised disentanglement without compromises. arXiv preprint arXiv:2002.02886, 2020.
|
| 211 |
+
|
| 212 |
+
Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain generalization via invariant ¨ feature representation. In International Conference on Machine Learning, pp. 10–18, 2013.
|
| 213 |
+
|
| 214 |
+
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.
|
| 215 |
+
|
| 216 |
+
Scott Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In Advances in Neural Information Processing Systems, 2015.
|
| 217 |
+
|
| 218 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 219 |
+
|
| 220 |
+
Karl Ridgeway and Michael C Mozer. Learning deep disentangled embeddings with the f-statistic loss. In Advances in Neural Information Processing Systems, 2018.
|
| 221 |
+
|
| 222 |
+
Mateo Rojas-Carulla, Bernhard Scholkopf, Richard Turner, and Jonas Peters. Invariant models for ¨ causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342, 2018.
|
| 223 |
+
|
| 224 |
+
Andrei A Rusu, Matej Vecer ˇ ´ık, Thomas Rothorl, Nicolas Heess, Razvan Pascanu, and Raia Hadsell. ¨ Sim-to-real robot learning from pixels with progressive nets. In Conference on Robot Learning, pp. 262–270, 2017.
|
| 225 |
+
|
| 226 |
+
Bernhard Scholkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, ¨ Anirudh Goyal, and Yoshua Bengio. Towards causal representation learning. arXiv preprint arXiv:2102.11107, 2021.
|
| 227 |
+
|
| 228 |
+
Rui Shu, Yining Chen, Abhishek Kumar, Stefano Ermon, and Ben Poole. Weakly supervised disentanglement with guarantees. arXiv preprint arXiv:1910.09772, 2019.
|
| 229 |
+
|
| 230 |
+
Jocelyn Sietsma and Robert JF Dow. Creating artificial neural networks that generalize. Neural networks, 4(1):67–79, 1991.
|
| 231 |
+
|
| 232 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016.
|
| 233 |
+
|
| 234 |
+
Peter Sorrenson, Carsten Rother, and Ullrich Kothe. Disentanglement by nonlinear ica with general ¨ incompressible-flow networks (gin). arXiv preprint arXiv:2001.04872, 2020.
|
| 235 |
+
|
| 236 |
+
Raphael Suter, Djordje Miladinovic, Bernhard Scholkopf, and Stefan Bauer. Robustly disentangled ¨ causal mechanisms: Validating deep representations for interventional robustness. In International Conference on Machine Learning, pp. 6056–6065. PMLR, 2019.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
Frederik Trauble, Elliot Creager, Niki Kilbertus, Francesco Locatello, Andrea Dittadi, Anirudh ¨ Goyal, Bernhard Scholkopf, and Stefan Bauer. On disentangled representations learned from ¨ correlated data. arXiv preprint arXiv:2006.07886, 2020.
|
| 241 |
+
|
| 242 |
+
Sjoerd van Steenkiste, Francesco Locatello, Jurgen Schmidhuber, and Olivier Bachem. Are disen- ¨ tangled representations helpful for abstract visual reasoning? arXiv preprint arXiv:1905.12506, 2019.
|
| 243 |
+
|
| 244 |
+
Manuel Wuthrich, Felix Widmaier, Felix Grimminger, Joel Akpo, Shruti Joshi, Vaibhav Agrawal, ¨ Bilal Hammoud, Majid Khadiv, Miroslav Bogdanovic, Vincent Berenz, et al. Trifinger: An opensource robot for learning dexterity. arXiv preprint arXiv:2008.03596, 2020.
|
| 245 |
+
|
| 246 |
+
Mengyuan Yan, Qingyun Sun, Iuri Frosio, Stephen Tyree, and Jan Kautz. How to close sim-real gap? transfer with segmentation! arXiv preprint arXiv:2005.07695, 2020.
|
| 247 |
+
|
| 248 |
+
# A IMPLEMENTATION DETAILS
|
| 249 |
+
|
| 250 |
+
Training. We train the $\beta$ -VAEs by maximizing the following objective function:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\mathcal { L } _ { V A E } ^ { \beta } = \mathbb { E } _ { q _ { \phi } ( z | \mathbf { x } ) } [ \log p _ { \theta } ( \mathbf { x } | z ) ] - \beta D _ { \mathrm { K L } } ( q _ { \phi } ( z | \mathbf { x } ) \| p ( z ) ) \leq \log p ( \mathbf { x } )
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
with $\beta > 0$ using the Adam optimizer (Kingma & Ba, 2014) with default parameters. We use a batch size of 64 and train for 400k steps. The learning rate is initialized to 1e-4 and halved at 150k and $3 0 0 \mathrm { k }$ training steps. We clip the global gradient norm to 1.0 before each weight update. Following Locatello et al. (2019b), we use a Gaussian encoder with an isotropic Gaussian prior for the latent variable, and a Bernoulli decoder. Our implementation of weakly supervised learning is based on Ada-GVAE (Locatello et al., 2020), but uses a symmetrized KL divergence:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\tilde { D } _ { \mathrm { K L } } ( p , q ) = \frac { 1 } { 2 } D _ { \mathrm { K L } } ( p \Vert q ) + \frac { 1 } { 2 } D _ { \mathrm { K L } } ( q \Vert p )
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
to infer which latent dimensions should be aggregated.
|
| 263 |
+
|
| 264 |
+
The noise added to the encoder’s input consists of two independent components, both iid Gaussian with zero mean: one is independent for each subpixel (RGB) and has standard deviation 0.03, the other is a $8 \times 8$ pixel-wise (greyscale) noise with standard deviation 0.15, bilinearly upsampled by a factor of 16. The latter has been designed (by visual inspection) to roughly mimic observation noise in the real images due to complex lighting conditions.
|
| 265 |
+
|
| 266 |
+
Neural architecture. Architectural details are provided in Tables 2 and 3, and Fig. 8 provides a high-level overview. In preliminary experiments, we observed that batch normalization, layer normalization, and dropout did not significantly affect performance in terms of ELBO, model samples, and disentanglement scores, both in the unsupervised and weakly supervised settings. On the other hand, layer normalization before the posterior parameterization (last layer of the encoder) appeared to be beneficial for stability in early training. While using an architecture based on residual blocks leads to fast convergence, in practice we observed that it may be challenging to keep the gradients in check at the beginning of training.3 In order to solve this issue, we resorted to a simple scalar gating mechanism in the residual blocks (Bachlechner et al., 2020) such that each residual block is initialized to the identity.
|
| 267 |
+
|
| 268 |
+
Datasets and OOD evaluation. Because we evaluate OOD generalization in terms of cube color hue (except in the sim2real case), we first sampled 8 color hues at random from the 12 specified in Table 1. The chosen hues are: $[ 0 ^ { \circ } , 1 2 0 ^ { \circ }$ , $1 5 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , $2 1 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ , $3 0 0 ^ { \circ } , 3 3 0 ^ { \circ } ]$ ]. Then, the dataset $D$ used for training VAEs is generated by randomly sampling values for the factors of variation from Table 1, with the color hue restricted to the above-mentioned values. This makes OOD2 evaluation possible, specifically OOD2-A where the learned predictors are tested on representations extracted from images with held-out values of the cube hue.
|
| 269 |
+
|
| 270 |
+
For evaluation of out-of-distribution generalization, we train the downstream predictors on a subset $D _ { 1 } \subset D$ of the representation training set. The downstream training set $D _ { 1 }$ is sampled at random from $D$ but only contains a (not necessarily proper) subset of the 8 cube colors. This subset contains 1 color in the OOD1-A case, 4 colors in OOD1-B and OOD1-C, all 8 colors in OOD2 (in this case $D _ { 1 }$ is simply a random subset of $D$ ). Then we test the downstream predictors on a set $D _ { 2 }$ distributionally different from $D _ { 1 }$ in terms of cube color (all OOD1 scenarios as well as OOD2-A) or sim2real (OOD2-B). In the OOD1 case, $D _ { 2 }$ is also a subset of $D$ and is generated the same way. In each OOD1 case, the test set $D _ { 2 }$ is paired with its corresponding $D _ { 1 }$ that was used to train the downstream predictors. $D _ { 2 }$ contains all colors in $D$ minus those in $D _ { 1 }$ . In the OOD2-A case, $D _ { 2 }$ is a separate dataset containing $5 \mathrm { k }$ simulated images like those in $D$ , except that these only contain the 4 colors that were left out from the VAE training set $D$ (hue in $[ 3 0 ^ { \circ } , 6 0 ^ { \circ } , 9 0 ^ { \circ } , 2 4 0 ^ { \circ } ] )$ . In the OOD2-B case, the set $D _ { 2 }$ is the dataset of real images. Following previous work (e.g. the GBT10000 metric in Locatello et al. (2019b)), the training set $D _ { 1 }$ and test set $D _ { 2 }$ for downstream tasks contain 10k and $5 \mathrm { k }$ images, respectively, except in the OOD2-B case, where the size is limited by the size of the real dataset.
|
| 271 |
+
|
| 272 |
+
<table><tr><td colspan="2">Encoder</td></tr><tr><td>Operation</td><td>Output Shape</td></tr><tr><td>Input Conv 5x5, stride 2, 64 ch. LeakyReLU(0.02) 2x ResidualBlock(64)</td><td>128×128×K 64×64×64</td></tr><tr><td>Conv 1x1,128 channels AveragePool(2) 2x ResidualBlock(128)</td><td>64×64×128 32×32×128</td></tr><tr><td>AveragePool(2) 2x ResidualBlock(128) Conv 1x1,256 channels</td><td>16×16×128</td></tr><tr><td>AveragePool(2) 2x ResidualBlock(256) AveragePool(2)</td><td>16×16×256 8×8×256</td></tr><tr><td>2x ResidualBlock(256) Flatten LeakyReLU(0.02)</td><td>4×4×256 一</td></tr><tr><td></td><td>4096 512</td></tr><tr><td>FC(512) LeakyReLU(0.02) LayerNorm 2x FC(d)</td><td>一 2d</td></tr></table>
|
| 273 |
+
|
| 274 |
+
<table><tr><td colspan="2">Decoder</td></tr><tr><td>Operation</td><td>Output Shape</td></tr><tr><td>Input FC(512)</td><td>d 512</td></tr><tr><td>LeakyReLU(0.02) FC(4096)</td><td></td></tr><tr><td rowspan="2">Reshape 2x ResidualBlock(256) BilinearInterpolation(2)</td><td>4096 4×4×256</td></tr><tr><td></td></tr><tr><td>2x ResidualBlock(256) Conv 1x1,128 channels</td><td>8×8×256 8×8×128</td></tr><tr><td>BilinearInterpolation(2) 2x ResidualBlock(128) BilinearInterpolation(2)</td><td>16×16×128</td></tr><tr><td>2x ResidualBlock(128) Conv 1x1, 64 channels BilinearInterpolation(2)</td><td>32×32×128</td></tr><tr><td></td><td>32×32×64 64×64×64</td></tr><tr><td>2x ResidualBlock(64) BilinearInterpolation(2)</td><td></td></tr><tr><td>LeakyReLU(0.02) Conv 5x5,K channels</td><td>128×128×64 128×128×K</td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 2: Encoder (left) and decoder (right) architectures. The latent space dimensionality is denoted by $d$ , and $K = 3$ indicates the number of image channels. Last line in the encoder architecture: the fully connected layer parameterizing the log variance of the approximate posterior distributions of the latent variables has custom initialization. The weights are initialized with $1 / 1 0$ standard deviation than the default value, and the biases are initialized to $- 1$ instead of 0. Empirically, this together with (learnable) LayerNorm was beneficial for training stability at the beginning of training.
|
| 277 |
+
|
| 278 |
+
Table 3: Architecture of one residual block. The scalar gate is implemented by multiplying the tensor by a learnable scalar parameter before adding it to the block input. Initializing the residual block to the identity by setting this parameter to zero has been originally proposed by Bachlechner et al. (2020). The tensor shape is constant throughout the residual block.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Residual Block</td></tr><tr><td>Input: shape H × W ×C LeakyReLU(0.02) Conv 3x3, C channels</td></tr></table>
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 8: Schemes of the encoder (top) and decoder (bottom) architectures. In both schemes, information flows left to right. Blue blocks represent convolutional layers: those labeled “conv” have 5x5 kernels and stride 2, while those labeled “1x1” have 1x1 kernels. Each orange block represents a pair of residual blocks (implementation details of a residual block are provided in Table 3). Green blocks in the encoder represent average pooling with stride 2, and those in the decoder denote bilinear upsampling by a factor of 2. Red blocks represent fully-connected layers. The block labeled “norm” indicates layer normalization. Dashed lines denote tensor reshaping.
|
| 284 |
+
|
| 285 |
+
# B ADDITIONAL RESULTS
|
| 286 |
+
|
| 287 |
+
# B.1 DATASET CORRELATIONS
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 9: Feasible states of the 2nd and 3rd DoF when the angle of the 1st DoF is 0. Angles are in radians.
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 10: Density of feasible states of 2nd and 3rd DoF over the whole training dataset. Darker shades of blue indicate regions of higher density. Angles are in radians.
|
| 294 |
+
|
| 295 |
+
# B.2 SAMPLES AND RECONSTRUCTIONS
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 11: Samples generated by a trained model. This model was selected based on the ELBO.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 12: Input reconstructions by a trained model. This model was selected based on the ELBO. Image inputs are on odd columns, reconstructions on even columns.
|
| 302 |
+
|
| 303 |
+
#
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 13: Latent traversals for a model with low DCI score (0.15) in (a), medium DCI score (0.5) in (b), and high DCI score (1.0) in (c).
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 14: Scatter plots of unsupervised metrics (left: ELBO; right: reconstruction loss) vs disentanglement (top: MIG; bottom: DCI) for 1,080 trained models, color-coded according to supervision. Each point represents a trained model.
|
| 310 |
+
|
| 311 |
+
# B.5 OUT-OF-DISTRIBUTION TRANSFER
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 15: Transfer metric in OOD2-A (top) and OOD2-B (bottom) settings, decomposed according to the factor of variation and presence of input noise. When noise is added to the input during training, the inferred cube position error is relatively low (the scores are the mean absolute error, and they are normalized to [0, 1]). This is particularly useful in the OOD2-B setting (real world) where the joint state is anyway considered known, while object position has to be inferred with tracking methods.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 16: Reconstructions of real-world images (OOD2-B) for a model with low DCI score (0.15) in (a), medium DCI score (0.5) in (b), and high DCI score (1.0) in (c).
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 17: Reconstructions of simulated images with encoder out-of-distribution colors (OOD2-A) for a model with low DCI score (0.15) in (a), medium DCI score (0.5) in (b), and high DCI score (1.0) in (c).
|
md/train/8jFiomKUnaT/8jFiomKUnaT.md
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Revisiting Multi-Codebook Quantization
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Multi-Codebook Quantization (MCQ) is a generalized version of existing codebook
|
| 11 |
+
2 based quantizations for Approximate Nearest Neighbor (ANN) search. Therefore,
|
| 12 |
+
3 MCQ theoretically has the potential to achieve the best performance because so
|
| 13 |
+
4 lutions of other codebook-based quantization methods are all covered by MCQ’s
|
| 14 |
+
5 solution space under the same codebook size setting. However, finding the opti
|
| 15 |
+
6 mal solution to MCQ is proved to be NP-hard due to its encoding process, i.e.,
|
| 16 |
+
7 converting an input vector to a binary code. To tackle this, researchers apply
|
| 17 |
+
8 constraints to it to find near-optimal solutions, or employ heuristic algorithms
|
| 18 |
+
9 which are still time-consuming for encoding. Different from previous approaches,
|
| 19 |
+
10 this paper takes the first attempt to find a deep solution to MCQ. The encoding
|
| 20 |
+
11 network is designed to be as simple as possible, so the very complex encoding
|
| 21 |
+
12 problem becomes simply a feed-forward. Compared with other methods on three
|
| 22 |
+
13 datasets, our method shows state-of-the-art performance. Notably, our method
|
| 23 |
+
14 is $1 1 \times - 3 8 \times$ faster than heuristic algorithms for encoding, which makes it more
|
| 24 |
+
15 practical for real scenery of large-scale retrieval. Our code is publicly available:
|
| 25 |
+
16 https://github.com/DeepMCQ/DeepQ.
|
| 26 |
+
|
| 27 |
+
# 17 1 Introduction
|
| 28 |
+
|
| 29 |
+
18 Rapidly increasing multimedia contents in recent years raise an urgent request for retrieval in a
|
| 30 |
+
19 short time. Unlike the exhaustive routine [31, 20], Approximate Nearest Neighbor (ANN) search
|
| 31 |
+
20 significantly reduces retrieval time while preserving high recall. It has been widely applied to various
|
| 32 |
+
21 scenarios, such as database indexing, fast image retrieval, and recommender systems.
|
| 33 |
+
22 As a typical approach, vector quantization (VQ) [7] is at first developed as a compression technique,
|
| 34 |
+
23 which uses a codebook to approximate vectors. People further find the power of VQ to preserve
|
| 35 |
+
24 similarities between quantized features and enable VQ to perform ANN search. In order to achieve
|
| 36 |
+
25 low quantization errors with limited codebook size, a multi-codebook structure is introduced. The
|
| 37 |
+
26 proposal of the Multi-Codebook Quantization (MCQ) [2] describes the approach as a combination
|
| 38 |
+
27 of one codeword for each sub-codebook, and previous methods [9, 6, 19, 30, 10, 3] are summarized
|
| 39 |
+
28 as exceptional cases of MCQ or constrained MCQs. The quantization codes are designed to be
|
| 40 |
+
29 compacted, which results in negligible storage cost and high-quality results.
|
| 41 |
+
30 However, the optimization of MCQ without any constraints is formally NP-hard. [14] models
|
| 42 |
+
31 it as the minimization on several fully-connected Markov Random Fields (MRFs). As a result,
|
| 43 |
+
32 current researches aim at solving MCQ under acceptable computational costs. Other than applying
|
| 44 |
+
33 constraints on it [34, 4, 15], another approach designs algorithms in a heuristic way [2, 14, 16]. The
|
| 45 |
+
34 latter achieves better performance but suffers from slow encoding.
|
| 46 |
+
35 There are chances to employ neural networks’ power to solve MCQ, where people expect to obtain
|
| 47 |
+
36 higher performance and encoding efficiency than previous methods. [11, 5, 28, 33, 27] already give
|
| 48 |
+
37 the way to treat codebook as network parameter and update it by gradient-descent, but they are
|
| 49 |
+
38 all still under constraints that hinder performance. Morozov and Babenko [18] and Sablayrolles et
|
| 50 |
+
39 al. [22] map datapoints to learned space, which are not flexible, especially when performing the
|
| 51 |
+
40 reconstruction. Therefore in this paper, we give our first attempt to solve MCQ in a deep learning
|
| 52 |
+
41 approach, without constraints and work-arounds. Our contributions can be summarized as three-folds:
|
| 53 |
+
42 • Our novel approach, Deep Multi-Codebook Quantization (DeepQ), fully considers encoding
|
| 54 |
+
43 difficulty and time complexity in MCQ. With the high efficient and parallelized encoding networks,
|
| 55 |
+
44 our method significantly reduces encoding time.
|
| 56 |
+
45 To tackle the NP-hard encoding problem and non-differentiable gradient estimation, we employ and
|
| 57 |
+
46 further revise a policy gradient method. Value-Corrected Proximal Policy Optimization (VC-PPO)
|
| 58 |
+
47 is proposed to speed up convergence in the training phase.
|
| 59 |
+
48 Experiments conducted on a benchmark dataset validate our proposed method. Furthermore, to
|
| 60 |
+
49 evaluate the scalability of the method, it is tested on million-scale datasets to show the effectiveness
|
| 61 |
+
50 of our proposed algorithm.
|
| 62 |
+
|
| 63 |
+
# 51 2 Related Works
|
| 64 |
+
|
| 65 |
+
52 Vector quantization is a routine to approximate vectors by a codebook. Typical applications include
|
| 66 |
+
53 clustering, compression, and Approximate Nearest Neighbor (ANN) search. The famous proposal
|
| 67 |
+
54 $k$ -means [7], also known as Lloyd’s algorithm [13], clusters the dataset into uniformly sized convex
|
| 68 |
+
55 cells. When it is applied to ANN search, datapoints from the base set are quantized into their
|
| 69 |
+
56 nearest centriods and represented by indices. The distance from a given query to any datapoint
|
| 70 |
+
57 is approximated by the distance from the query to the datapoint’s centriod, which is effectively
|
| 71 |
+
58 pre-computed and stored in a lookup table. To perform fine-grained clustering as well as reducing the
|
| 72 |
+
59 space and time complexity, they [9, 6, 19, 10, 30] divide the feature space orthogonally by performing
|
| 73 |
+
60 $k$ -means in each subspace concurrently. Meanwhile, the introduced sub-codebook structure reveals
|
| 74 |
+
61 the prototype of MCQ. Formally, [2] gives a well definition of MCQ, and previous works are all
|
| 75 |
+
62 summarized into constrained MCQs. Specifically, subspace $k$ -means must keep orthogonality among
|
| 76 |
+
63 sub-codebooks. Zhang et al. [34] loosens the orthogonality constraint, but sub-codebooks are still
|
| 77 |
+
64 weakly-orthogonal. Chen et al. [4] and Martinez et al. [15] propose hierarchical $k$ -means, where
|
| 78 |
+
65 vectors are quantized coarse-to-fine. If constraints are moved, MCQ is not easy to solve. Current
|
| 79 |
+
66 state-of-the-art methods develop heuristic algorithms to help to encode. Specifically, Babenko and
|
| 80 |
+
67 Lempitsky [2] employs beam search, Martinez et al. [14, 16] give algorithm based on Iterated
|
| 81 |
+
68 Conditional Modes (ICM). However, the above methods do not achieve satisfied time complexity in
|
| 82 |
+
69 encoding yet.
|
| 83 |
+
70 When neural networks and gradient descent become a fashion, a few attempts to integrate quantization
|
| 84 |
+
71 into deep retrieval networks are proposed. Klein and Wolf [11] and Song et al. [5] propose Deep
|
| 85 |
+
72 Product Quantization (DPQ) and Deep Progressive Quantization $\mathrm { ( D P g Q ) }$ which update codebook by
|
| 86 |
+
73 soft relaxation, but they are still under the same constraints as [9, 15]. Sablayrolles et al. [22] and
|
| 87 |
+
74 Morozov and Babenko [18] give pipelines to encode compact representations for compressed-domain
|
| 88 |
+
75 search, but they do not strictly follow the paradigm of MCQ.
|
| 89 |
+
|
| 90 |
+
# 76 3 Preliminaries
|
| 91 |
+
|
| 92 |
+
77 Given a vector $\pmb { x } \in \mathbb { R } ^ { D }$ , its quantized vector $\tilde { \pmb { x } }$ are composed by several codewords in a codebook
|
| 93 |
+
78 $C$ . More Specifically, $C = ( \bar { C } _ { m } )$ , $C _ { m } \in \mathbb { R } ^ { K \times D }$ , $1 \leq m \leq M$ contains $M$ sub-codebooks and $K$
|
| 94 |
+
79 codewords for each. Quantization codes are formed by $\pmb { b } = ( \pmb { b } _ { m } )$ , $\pmb { b _ { m } } \in \{ 1 , 2 , \cdots , K \}$ , $1 \leq m \leq$
|
| 95 |
+
80 $M$ , which indicates the picked codeword in each sub-codebook. For the whole training set $X = \{ x \}$
|
| 96 |
+
81 with $N$ datapoints, MCQ aims at finding the optimal quantization codes ${ \boldsymbol { B } } = \{ { \boldsymbol { b } } \}$ and codebook $C$
|
| 97 |
+
82 to minimize following objective:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\underset { C , B } { \operatorname* { m i n } } \ \underset { { \bf { x } } \in { \cal { X } } } { \mathbb { E } } \operatorname { Q } \left( { \bf { x } } , { \bf { b } } , C \right) = \underset { C , B } { \operatorname* { m i n } } \ \underset { { \bf { x } } \in { \cal { X } } } { \mathbb { E } } \left\| { \bf { x } } - \sum _ { m = 1 } ^ { M } C _ { m b _ { m } } \right\| _ { 2 }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
83 where $C _ { m { \pmb b } _ { m } } \in \mathbb { R } ^ { D }$ is the $b _ { m }$ -th codeword of the $m$ -th sub-codebook. The sum of picked codewords
|
| 104 |
+
84 $\sum C _ { m { \pmb b } _ { m } }$ tries to approximate $_ { \textbf { \em x } }$ . $C$ and $^ { b }$ are stored for further retrieval. Some of the previously
|
| 105 |
+
85 mentioned methods [9, 6, 4, 15, 34] are treated as constrained MCQs, as they are all represented
|
| 106 |
+
86 as special cases of (1). Specifically, when $M = 1$ , (1) becomes VQ. Or if any two sub-codebooks
|
| 107 |
+
87 $C _ { i } , C _ { j }$ are orthogonal, it will be PQ or OPQ.
|
| 108 |
+
88 The optimization of (1) without any constraints is proved to be NP-hard [14]. To tackle this, we
|
| 109 |
+
89 propose a Expectation-Maximization style solution. Following sections will explain the deep neural
|
| 110 |
+
90 network for encoding $^ { b }$ (Section 4.1), the way to solve $C$ (Section 4.2), and how to conduct retrieval
|
| 111 |
+
91 (Section 4.3), respectively.
|
| 112 |
+
|
| 113 |
+
# 92 4 Methodology
|
| 114 |
+
|
| 115 |
+
# 93 4.1 Expectation: Encoding $\textbf { { B } }$ with neural networks
|
| 116 |
+
|
| 117 |
+
94 Our first step, is to find a potential code $^ { b }$ by given $_ { \textbf { \em x } }$ and
|
| 118 |
+
95 a fixed $C$ . A policy $\pi$ parameterized by $\theta$ is employed to
|
| 119 |
+
96 take possible solution of $^ { b }$ by feeding $_ { \textbf { \em x } }$ :
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\pi = \left( \pi _ { m } \right) = \pi \left( \pmb { x } \mid \theta _ { m } \right) , 1 \leq m \leq M .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
97 More specifically, $\pi$ produces $M$ Categorical distribu
|
| 126 |
+
98 tions Categorical $( K , \pmb { p } _ { m 1 } , \cdots , \pmb { p } _ { m K } )$ , where $\pmb { p } _ { m j }$ is
|
| 127 |
+
99 the probability to pick the $j$ -th codeword in the $m$ -th
|
| 128 |
+
100 sub-codebook. A potential encoding $\boldsymbol { b } _ { m }$ is generated by
|
| 129 |
+
101 drawing samples from $\pi _ { m }$ , which then helps us to pick
|
| 130 |
+
102 codeword $C _ { m b _ { m } }$ . Therefore:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\pmb { b _ { m } } \sim \pi _ { m } \left( \pmb { x } \mid \theta _ { m } \right) = \operatorname { C a t e g o r i c a l } ( K , \pmb { p _ { m } } ) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
103 Since the independence among different sub-codebooks
|
| 137 |
+
104 is a prerequisite of MCQ, $\boldsymbol { b } _ { m }$ should be drawn from $\pi _ { m }$
|
| 138 |
+
105 independently. Intuitively, the probability of $^ { b }$ to be a
|
| 139 |
+
106 specific ${ \pmb { b } } ^ { \star }$ is derived by conditional independence:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\operatorname* { P r } \left( \boldsymbol { b } = \boldsymbol { b } ^ { \star } \right) = \prod _ { m = 1 } ^ { M } \operatorname* { P r } \left( \boldsymbol { b } _ { m } = \boldsymbol { b } _ { m } ^ { \star } \right) = \prod _ { m = 1 } ^ { M } p _ { m \boldsymbol { b } _ { m } ^ { \star } } .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
107 We adopt the power of neural networks to model
|
| 146 |
+
108 $\pi _ { m }$ . Specifically, $\theta _ { m }$ produces $K$ unnormalized log
|
| 147 |
+
109 probabilities $\ell _ { m }$ and $\pmb { p } _ { m j }$ is obtained by Softmax. To
|
| 148 |
+
110 keep the independence, $\dot { \theta _ { m } }$ will not share parameters with
|
| 149 |
+
111 each other.
|
| 150 |
+
112 Therefore, $\theta$ , or our proposed IndepNet is illustrated in
|
| 151 |
+
113 Figure 1. We first build a basic structure called IndepBlock and duplicate this block for $M$ times as
|
| 152 |
+
114 $\theta _ { 1 } , \theta _ { 2 } , \cdots , \theta _ { M }$ . We try to keep the basic structure really simple to achieve high efficiency during
|
| 153 |
+
115 training and encoding. As the figure shows, IndepBlock is an hourglass network contains 6 layer
|
| 154 |
+
116 groups (consists of a linear layer with ReLU activation and layer-normalization) with skip-connections.
|
| 155 |
+
117 The last three outputs are concatenated and further fed into a final linear layer with $K$ outputs as
|
| 156 |
+
118 $\ell _ { m } = ( \ell _ { m 1 } , \cdot \cdot \cdot , \bar { \ell } _ { m K } )$ , and therefore:
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 1: Our proposed IndepNet for producing probabilities of choosing each codeword. IndepBlock is duplicated for $M$ times without shared parameters, in order to keep independence between different IndepBlocks. Categorical distribution is built upon output from the IndepBlock. Then, quantization code $b _ { m }$ associated with sub-codebook $C _ { m }$ is sampled from distribution.
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\pmb { p } _ { m j } = \mathrm { S o f t m a x } \left( \pmb { \ell } _ { m } \right) _ { j } , \ w h e r e \ \pmb { \ell } _ { m } = \theta _ { m } \left( \pmb { x } \right) .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
# 119 4.1.1 Gradient estimation
|
| 166 |
+
|
| 167 |
+
120 The objective of training $\theta$ is formed as:
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\operatorname* { m i n } _ { \pmb { \pi } } \operatorname* { \mathbb { E } } _ { \pmb { x } \in \pmb { X } } \mathrm { Q } \left( \pmb { x } , \pmb { b } , \pmb { C } \right) .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
121 However, the optimization faces two problems: 1) The encoding of $^ { b }$ involves sampling from discrete
|
| 174 |
+
122 distributions, which is non-differentiable, 2) All possible encoding of $^ { b }$ is $\mathcal { O } \left( \overset { \bullet } { K } { } ^ { M } \right)$ . Exhaustive
|
| 175 |
+
123 search becomes impracticable.
|
| 176 |
+
124 Therefore, gradient estimation over discrete, stochastic computation graph is required to train $\theta$ .
|
| 177 |
+
125 Mainstream methods [23, 32, 17] include score function gradient estimator, pathwise gradient
|
| 178 |
+
126 estimator, etc. Meanwhile, minimizing (6) is also faced with the high-variance problem during
|
| 179 |
+
127 gradient estimation. To tackle this, the advantage function is introduced [12, 25]. Specifically in
|
| 180 |
+
128 our work, a value network called QENet parameterized by $\tau$ is proposed to model a value function
|
| 181 |
+
129 $v = \mathrm { V } \left( \cdot \mid \tau \right)$ . It performs a regression task to minimize the following objectives:
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\operatorname* { m i n } _ { \tau } \underset { \pmb { x } \in \pmb { X } } { \mathbb { E } } \| \mathrm { Q } \left( \pmb { x } , \pmb { b } , \pmb { C } \right) - \mathrm { V } \left( \pmb { x } , \pmb { b } , \pmb { C } \mid \tau \right) \| _ { 2 } .
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Advantages 130 $\hat { A }$ is then estimated by
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\hat { A } = \operatorname { Q } \left( \mathbf { { x } } , \boldsymbol { b } , \boldsymbol { C } \right) - \operatorname { V } \left( \mathbf { { x } } , \boldsymbol { b } , \boldsymbol { C } \mid \tau \right) .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
131 The detailed architecture of QENet is shown in Figure 2.
|
| 194 |
+
132 We reuse the IndepBlock to generate $v$ by $M + 1$ blocks:
|
| 195 |
+
133 $\boldsymbol { \tau } = \left( \tau _ { 1 } , \cdot \cdot \cdot , \tau _ { M } , \tau _ { x } \right)$ . Specifically, latent representation
|
| 196 |
+
134 for each selected-codeword $C _ { m b _ { m } }$ is obtained by:
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\pmb { \iota } _ { m } = \tau _ { m } ( C _ { m { \pmb b } _ { m } } ) .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
135 The last IndepBlock $\tau _ { x }$ is introduced to transform $_ { \textbf { \em x } }$ . Then,
|
| 203 |
+
136 all the outputs from IndepBlocks are summed up to get
|
| 204 |
+
137 scalar value $v$ (denoted as “reduce-sum”):
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
v = { \mathrm { s u m } } ( \iota _ { 1 } , \cdot \cdot \cdot , \iota _ { M } , \iota _ { x } ) .
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 2: Our proposed QENet for advantage estimation. First $M$ IndepBlocks are fed by $M$ selected codewords and the last one is fed by $_ { \textbf { \em x } }$ . Outputs are summed up to get scalar value $v$ .
|
| 212 |
+
|
| 213 |
+
138 Value-corrected proximal policy optimization We
|
| 214 |
+
139 propose a variant of score function gradient estimator
|
| 215 |
+
140 called Value Corrected Proximal Policy Optimization (VC
|
| 216 |
+
141 PPO) based on PPO to get simple but efficient Trust Re
|
| 217 |
+
142 gion updates [26, 24]. In the real scenario of large-scale
|
| 218 |
+
143 ANN search, the training size $N$ is usually larger than $1 0 k$ . Conventional PPO still does not satisfy
|
| 219 |
+
144 us due to the speed of convergence. Therefore, we revise and propose the Value-Corrected PPO
|
| 220 |
+
145 (VC-PPO) to achieve fast training. Firstly in the sampling stage, $b _ { o }$ and $v _ { o }$ is produced from datapoint
|
| 221 |
+
146 $_ { \textbf { \em x } }$ over whole training set $\boldsymbol { X }$ by freezing current policy network and value network as $\theta _ { o } , \tau _ { o }$ :
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
\begin{array} { r l } & { b _ { o } \sim \pi \left( \pmb { x } \mid \theta _ { o } \right) , } \\ & { v _ { o } = \mathrm { V } \left( \pmb { x } , b _ { o } , C \mid \tau _ { o } \right) . } \end{array}
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
147 The probability of producing the sampled $b _ { o }$ is denoted as $p _ { o } = \operatorname* { P r } \left( \pmb { b } _ { o } \mid \pmb { x } , \pmb { \theta } _ { o } \right)$ , calculated by
|
| 228 |
+
148 equation (4). Finally, our surrogate objectives of VC-PPO is defined as [8]:
|
| 229 |
+
|
| 230 |
+
149
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\begin{array} { r l } & { \mathcal { L } _ { \theta } = \operatorname* { m i n } \left( \frac { \operatorname* { P r } \left( b _ { o } \mid \boldsymbol { x } , \theta \right) } { \operatorname* { P r } \left( b _ { o } \mid \boldsymbol { x } , \theta _ { o } \right) } \hat { A } , \right. } \\ & { \qquad \left. \mathrm { c l i p } _ { 1 - \epsilon } ^ { 1 + \epsilon } \left( \frac { \operatorname* { P r } \left( b _ { o } \mid \boldsymbol { x } , \theta \right) } { \operatorname* { P r } \left( b _ { o } \mid \boldsymbol { x } , \theta _ { o } \right) } \right) \hat { A } \right) , } \\ & { \mathcal { L } _ { \tau } = \operatorname* { m a x } \left( \left( \operatorname { Q } \left( \boldsymbol { x } , b _ { o } , C \right) - \mathrm { V } \left( \boldsymbol { x } , b _ { o } , C \mid \tau \right) \right) ^ { 2 } , \right. } \\ & { \qquad \left. \left( \mathrm { Q } \left( \boldsymbol { x } , b _ { o } , C \right) - \boldsymbol { v } _ { o } - \mathrm { c l i p } _ { - \epsilon } ^ { + \epsilon } \left( \mathrm { V } \left( \boldsymbol { x } , b _ { o } , C \mid \tau \right) - \boldsymbol { v } _ { o } \right) \right) ^ { 2 } \right) . } \end{array}
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
150 Here, The $\mathrm { c l i p } \left( \cdot \right)$ forces the policy and value to be not too far from old ones and $\epsilon$ is the clip-range.
|
| 237 |
+
151 In both equations, it prevents a large update ratio leading to an unstable policy. The key difference
|
| 238 |
+
152 between the original PPO and our VC-PPO is, we use $\mathrm { V } \left( \boldsymbol { x } , \boldsymbol { b _ { o } } , \boldsymbol { C } \mid \tau \right)$ other than the recorded old
|
| 239 |
+
153 value $v _ { o }$ from sampling stage to estimate advantage. This modification is treated as a value-correction
|
| 240 |
+
154 process. Correcting value leads to a precise estimation on advantage, which is based on two reasons:
|
| 241 |
+
155 a) Biases are introduced into advantage estimation if we use $v _ { o }$ , since the policy is getting better and
|
| 242 |
+
156 better during training but $\tau _ { o }$ is froze, and 2) The calculation of $\mathrm { V } \left( \boldsymbol { x } , \boldsymbol { b _ { o } } , \boldsymbol { C } \mid \tau \right)$ can be done instantly
|
| 243 |
+
157 without introducing significant computational overhead. To further encourage the network choose
|
| 244 |
+
158 codewords uniformly, a regularization is applied to $\theta$ to maximize the entropy of $\pi$ :
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
e _ { \theta } = - \sum _ { m = 1 } ^ { M } \sum _ { j = 1 } ^ { K } p _ { m j } \log { p _ { m j } }
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
159 which forces network to try more codeword combinations.
|
| 251 |
+
|
| 252 |
+
# 60 4.2 Maximization: Solve $C$ by least-squares
|
| 253 |
+
|
| 254 |
+
161 To give the closed-form derivation of solving $C$ by given $\boldsymbol { X }$ and $\textbf { { B } }$ , We will firstly rewrite Equation
|
| 255 |
+
162 (1) to a matrix formulation. Since $\pmb { b } = ( \pmb { b } _ { 1 } , \pmb { b } _ { 2 } , \pmb { \cdot \cdot \cdot } , \pmb { b } _ { M } )$ and ${ \pmb b } _ { m } \in \{ 1 , 2 , \cdots \dot { K } \}$ is the index of
|
| 256 |
+
163 selected codeword in the $i$ -th sub-codebook, a one-hot encoding and a concatenation on each $b _ { m }$ :
|
| 257 |
+
164 $\pmb { b } _ { m } ^ { \prime } = \mathrm { o n e - h o t } ( \pmb { b } _ { m } )$ , $\pmb { b } ^ { \prime } = ( \pmb { b } _ { 1 } ^ { \prime } , \cdots , \pmb { b } _ { m } ^ { \prime } )$ will convert the quantization code to a $M$ -hot vector i.e. a
|
| 258 |
+
165 vector that contains $M$ segments, and each segment contains exactly one 1 and remaining 0, where
|
| 259 |
+
1 is the entry of picked codeword. Correspondingly, a reshape is applied to 166 $C \colon C ^ { \prime } = \left( \begin{array} { c } { { C _ { 1 } } } \\ { { C _ { 2 } } } \\ { { \vdots } } \\ { { C _ { M } } } \end{array} \right) \in$
|
| 260 |
+
|
| 261 |
+
$\mathbb { R } ^ { ( M \times K ) \times D }$ . (1) will become:
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\operatorname* { m i n } _ { \boldsymbol { C ^ { \prime } } } \left\| \boldsymbol { X } - \boldsymbol { B ^ { \prime } } \boldsymbol { C ^ { \prime } } \right\| _ { 2 } ^ { 2 } .
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
168 This equation is formally a linear least-squares regression, where $\pmb { { B } } ^ { \prime } \in \{ 0 , 1 \} ^ { N \times ( M \times K ) }$ is known
|
| 268 |
+
169 and $\boldsymbol { X }$ is target. Although there is a bunch of algorithms to solve it, we finally choose gelsy [1],
|
| 269 |
+
170 which in our experiments shows the best results. The solution is to first apply a QR factorization with
|
| 270 |
+
171 column permutation on $B ^ { \prime }$ :
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
B ^ { \prime } = Q \left( \begin{array} { c c } { { R _ { 1 1 } } } & { { R _ { 1 2 } } } \\ { { 0 } } & { { R _ { 2 2 } } } \end{array} \right) P ^ { \intercal }
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
where 172 $Q$ and $\pmb { R } = \left( \begin{array} { c c } { R _ { 1 1 } } & { R _ { 1 2 } } \\ { 0 } & { R _ { 2 2 } } \end{array} \right)$ is the factorization matrix and $_ { r }$ is an orthogonal matrix that 173 permutes columns of $B ^ { \prime }$ until $\pmb { R } _ { 1 1 }$ is well-conditioned (its estimated condition number approaches 174 0). With the permutation, $ { R _ { 2 2 } }$ becomes negligible. Moreover, $\mathbf { R } _ { 1 2 }$ is erased by another orthogonal 175 transformation:
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\begin{array} { r l } { \bigg ( R _ { 1 1 } } & { { } R _ { 1 2 } \bigg ) \bigg ( R _ { 1 1 } \quad R _ { 1 2 } \bigg ) = \bigg ( T _ { 1 1 } \quad 0 \bigg ) Z } \\ { 0 } & { { } R _ { 2 2 } \bigg ) \bigg ( T _ { 0 } \qquad 0 \bigg ) = \bigg ( T _ { 0 } \quad 0 \bigg ) Z } \end{array}
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
where 176 $\mathbf { T }$ and $z$ are from the orthogonal transformation of $\pmb { R }$ . Then, $C ^ { \prime }$ is derived by:
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\begin{array} { r } { B ^ { \prime } = Q \left( \begin{array} { c c } { T _ { 1 1 } } & { 0 } \\ { 0 } & { 0 } \end{array} \right) Z P ^ { \intercal } , } \\ { C \gets C ^ { \prime } \gets P Z ^ { \intercal } \left( \begin{array} { c c } { T _ { 1 1 } ^ { - 1 } Q _ { 1 } ^ { \intercal } X } \\ { 0 } \end{array} \right) } \end{array}
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
where 177 $Q _ { 1 }$ is the top $\mathrm { r a n k } ( B ^ { \prime } )$ columns of $Q$ .
|
| 289 |
+
|
| 290 |
+
178 In brief, our overall training approach is summarized into algorithm 1.
|
| 291 |
+
|
| 292 |
+
# 4.3 Fast retrieval
|
| 293 |
+
|
| 294 |
+
80 After training, we are able to encode the base set for retrieval. Other than sampling from $\pi$ , codewords
|
| 295 |
+
81 are simply rolled out by greedy assignments:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\pmb { b } _ { m } ^ { g } = \arg \operatorname* { m a x } \theta _ { m } ( \pmb { x } ) .
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
182 We firstly use the greedy roll-out strategy to obtain $\textbf { { B } }$ in the training set in order to solve the final
|
| 302 |
+
183 codebook. Then, we employ the same strategy to encode the base set.
|
| 303 |
+
184 To further refine assignments, we add an extra step that randomly selects and alters $b _ { i }$ while fixing
|
| 304 |
+
185 others:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { l } { { b _ { i } ^ { g } \underset { b _ { i } ^ { g } } { \operatorname { a r g m i n } } \mathrm { Q } ( x , b ^ { g } , C ) , } } \\ { { \quad i \sim \mathcal { U } [ 1 , M ] . } } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
186 Since this refinement only causes negligible overhead referred to the implementation by [14], in
|
| 311 |
+
187 practice, we benefit from it not only to get lower quantization error but also to obtain acceptable
|
| 312 |
+
188 performance from a fast training, i.e., training within a very few steps before the network is converged.
|
| 313 |
+
189 The encoded and refined base set, combined with the codebook, is finally employed for retrieval. The
|
| 314 |
+
90 LSQ-style lookup table [14] is utilized to speed up similarity search.
|
| 315 |
+
|
| 316 |
+
# 191 4.4 Discussion
|
| 317 |
+
|
| 318 |
+
Our work aims at solving Multi-Codebook Quantization via neural networks. Similar works include Unsupervised Neural Quantization (UNQ) [18] and Spreading Vectors [22]. But ours has several key advantages compared to previous works: 1) Unlike UNQ, which reconstructs features by an encoderdecoder structure, we follow the paradigm of MCQ to directly give binary codes and codebooks for the benefit of speed and storage, for UNQ needs an extra decoding stage during retrieval. 2) UNQ and Spreading Vectors both project original features into a learned space. Although similarities between features are preserved, they still have biases in quantized results. This causes several issues, especially when we want to perform a reconstruction to approximate original features, e.g. data compression.
|
| 319 |
+
|
| 320 |
+
208 Compared to LSQ [14], the state-of-the-art heuris
|
| 321 |
+
209 tic algorithm, our work is the first to tackle MCQ in
|
| 322 |
+
210 a deep learning fashion. The policy network is de
|
| 323 |
+
211 signed to be very simple to get fast encoding speed
|
| 324 |
+
212 and comparable retrieval performance.
|
| 325 |
+
|
| 326 |
+
# Algorithm 1: VC-PPO for Training
|
| 327 |
+
|
| 328 |
+
Inputs: Training set $\boldsymbol { X }$ , max step $T$ , hyper
|
| 329 |
+
parameters $\alpha$ , , learning rates $\eta _ { 1 } , \eta _ { 2 }$ .
|
| 330 |
+
Outputs: Policy $\pi$ .
|
| 331 |
+
Initialize codebook $C$ , parameters $\theta$ and $\tau$ ;
|
| 332 |
+
$i \gets 0$ ;
|
| 333 |
+
while $i < T$ do $^ { \prime * }$ Training loop $^ { * / }$ for $_ { \textbf { \em x } }$ in $\boldsymbol { X }$ do $^ { \prime * }$ Sampling stage $^ { * / }$ Sample $\ b { b _ { o } } \sim \pi \left( \pmb { x } \mid \theta _ { o } \right)$ into $\textbf { { B } }$ ; Compute $v _ { o } , p _ { o }$ into $V$ , $_ { r }$ ; end for $x , b _ { o } , v _ { o } , p _ { o }$ in $X , B , V , P r$ do $^ { \prime * }$ Updating stage $^ { * / }$ $\tau \tau - \eta _ { 1 } \nabla _ { \tau } { \mathcal { L } } _ { \tau }$ ; Compute $\hat { A }$ by (8); $\theta \theta + \eta _ { 2 } \nabla _ { \theta } ( \mathcal { L } _ { \theta } + \alpha \cdot e _ { \theta } ) ;$ end C ← Solved by (15) ∼ (18); $i \gets i + 1$ ;
|
| 334 |
+
end
|
| 335 |
+
return π (· | θ)
|
| 336 |
+
|
| 337 |
+
# 5 Experiments
|
| 338 |
+
|
| 339 |
+
214 Our proposed Deep Multi-Codebook Quantization (DeepQ) is compared against the state-of-the-arts
|
| 340 |
+
215 on a visual-feature dataset (LabelMe22K) to evaluate retrieval performance and encoding speed.
|
| 341 |
+
216 Then, we scale up to make comparisons on commonly used large-scale datasets (SIFT1M and
|
| 342 |
+
217 DEEP1M), whose base sets include 1 million vectors for retrieval. Furthermore, ablation study on
|
| 343 |
+
218 SIFT1M investigates the effectiveness of each component in our proposed pipeline.
|
| 344 |
+
|
| 345 |
+
# 5.1 Datasets and evaluation metrics
|
| 346 |
+
|
| 347 |
+
LabelMe22K [29]: This dataset collects images by the LabelMe annotation tool1 and uses Convolutional Neural Network (CNN) to extract them into 512-d features. It has 22, 019 vectors for training and 2, 000 vectors for test.
|
| 348 |
+
|
| 349 |
+
SIFT1M2 and DEEP1M3: Both datasets contain $1 0 ^ { 4 }$ , $1 0 ^ { 5 }$ , $1 0 ^ { 6 }$ vectors in query, training and base set, respectively. Vectors from SIFT1M is extracted by Scale-Invariant Feature Transform (128-d) while DEEP1M contains 96-d vectors from outputs of a CNN.
|
| 350 |
+
|
| 351 |
+
226 Recall $ @ \{ 1 , 1 0 , 1 0 0 \}$ and quantization error are adopted as evaluation metrics. These two metrics
|
| 352 |
+
227 indicate not only the retrieval performance but also the reconstruction accuracy. Because LabelMe22K
|
| 353 |
+
228 does not have a base set, its training set is adopted as a base set. We train on the training set, and then
|
| 354 |
+
229 encode the base set for evaluations with queries. When calculating recall, groundtruth is defined as
|
| 355 |
+
230 the nearest neighbor of each query in the base set (sorted by l2 distance). As for quantization error,
|
| 356 |
+
231 the average value of $\wr ( { \pmb x } , { \pmb b } , { \pmb C } )$ is reported over all $_ { \textbf { \em x } }$ in the base set.
|
| 357 |
+
|
| 358 |
+
We compare our proposal with both shallow and deep methods, including three classic quantization: OPQ [6], SQ [15] and $\mathbf { L S Q + + }$ [14, 16] (denoted as LSQ for simplicity. Also, these two in our experiments have similar performance), as well as three graident-based methods: DPQ [11], $\mathbf { D P g Q }$ [5] and DRQ [28]. DPQ and PQNet [33] have basically the same architecture that extend PQ with gradient-descent, so we only report the performance of DPQ. Additionally, UNQ [18] is also included, although they introduce an extra decoder and re-ranking trick for retrieval.
|
| 359 |
+
|
| 360 |
+
# 5.2 Implementation details
|
| 361 |
+
|
| 362 |
+
Our method is implemented with PyTorch,4 the popular deep learning package in Python. Codebook $C$ is solved by Intel MKL that has been fully optimized for speed. As for network training, we adopt Adam optimizer with AMSGrad [21] and hyperparameters are tuned by grid search. Specifically, learning rates $\eta _ { 1 } = \eta _ { 2 } =$ $2 \times 1 0 ^ { - 4 }$ , with an exponetial learning rate decay $\gamma = 0 . 9 9 9 9$ . Batch-size in updating stage is 2000, while other hyper-parameters $\epsilon = 0 . 2$ , $\alpha = 0 . 0 5$ . Additionally, during training, we insert dropout layers after every layernormalization in all layer-groups to tackle overfitting. More detailed settings as well as specifications of $I n$ - depNet $\theta$ and QENet $\tau$ on each dataset
|
| 363 |
+
|
| 364 |
+
<table><tr><td rowspan="3">Method</td><td colspan="6">LabelMe22K</td></tr><tr><td rowspan="2">R@1</td><td>32 bits</td><td rowspan="2">R@100</td><td rowspan="2">R@1</td><td rowspan="2">64 bits R@10</td><td rowspan="2">R@100</td></tr><tr><td>R@10</td></tr><tr><td>OPQ</td><td>18.70</td><td>57.25</td><td>90.10</td><td>32.30</td><td>80.40</td><td>98.00</td></tr><tr><td>SQ</td><td>18.45</td><td>57.60</td><td>90.85</td><td>32.65</td><td>82.05</td><td>99.05</td></tr><tr><td>LSQ</td><td>21.20</td><td>60.85</td><td>94.35</td><td>36.45</td><td>86.25</td><td>99.15</td></tr><tr><td>DPQ</td><td>8.60</td><td>32.80</td><td>77.50</td><td>15.35</td><td>48.75</td><td>90.75</td></tr><tr><td>DPgQ</td><td>19.85</td><td>57.80</td><td>90.70</td><td>35.05</td><td>84.10</td><td>98.90</td></tr><tr><td>DRQ</td><td>9.65</td><td>34.15</td><td>80.15</td><td>30.75</td><td>77.35</td><td>97.10</td></tr><tr><td>UNQ</td><td>22.25</td><td>61.20</td><td>89.30</td><td>37.10</td><td>85.55</td><td>98.80</td></tr><tr><td>Ours</td><td>24.45</td><td>69.05</td><td>97.65</td><td>39.60</td><td>87.60</td><td>99.80</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table 1: Recall(R $) @ \{ 1 , 1 0 , 1 0 0 \}$ on LabelMe22K dataset $( \% )$ . Ours outperforms state-of-the-arts by at least $2 . 2 0 \%$ $7 . 8 5 \%$ , $3 . 3 0 \%$ (32 bits), and $2 . 7 0 \%$ , $1 . 4 5 \%$ , $0 . 6 5 \%$ (64 bits), respectively.
|
| 367 |
+
|
| 368 |
+
(LabelMe22K, SIFT1M, DEEP1M) can be found in supplementary material.
|
| 369 |
+
|
| 370 |
+
As for quantization code-lengths, $K = 2 5 6$ codewords for each sub-codebook and $M = \{ 4 , 8 \}$ sub-codebooks are employed in total. We follow [2] to report “effective” code-lengths (additional code-length for storing $\lVert \boldsymbol { x } \rVert$ for lookup table is ignored). Therefore code-lengths become $\{ 3 2 , 6 4 \}$ bits, respectively.
|
| 371 |
+
|
| 372 |
+
For a fair comparison, experiments are conducted on a single machine, equipped with Intel Xeon E5-2678v3 CPU, 256 GiB RAM, and NVIDIA RTX 3090 GPU. For other methods, we re-run on all datasets under unified settings with implementations provided by the authors.
|
| 373 |
+
|
| 374 |
+
# 5.3 Comparisons with state-of-the-arts
|
| 375 |
+
|
| 376 |
+
Under the small training set and base set settings on LabelMe22K, we get the results placed in Table 1. Our method takes the highest recall on this dataset, outperforming the state-of-the-art by $2 . 2 0 \%$ , $7 . 8 5 \%$ , $3 . 3 0 \%$ on 32 bits for $\mathbf { R } \ @ 1$ , $\mathrm { R @ 1 0 }$ and $\mathbf { R } @ \mathbf { 1 } 0 0$ . It also outperforms the best competitor by $2 . 7 0 \%$ , $1 . 4 5 \%$ , $0 . 6 5 \%$ on 64 bits. In brief, All methods except for UNQ are generally split into three styles: 1) PQ-like: OPQ and DPQ. 2) SQ-like: SQ, $\mathrm { D P g Q }$ and DRQ. 3) MCQ: LSQ and ours. Generally, DPQ, $\mathrm { D P g Q }$ , and DRQ achieve similar results compared to their shallow versions. However, since they are still constrained MCQs, they show worse performances than 3). The performance of LSQ is worse than ours, shows the effectiveness of neural networks for modeling the MCQ encoding problem. As for UNQ, it takes several extra tricks i.e., another network for decoding and re-ranking in retrieval. Although it beats LSQ, our network still shows the power of MCQ to win the competition.
|
| 377 |
+
|
| 378 |
+
<table><tr><td rowspan="3">Method</td><td colspan="6">SIFT1M</td><td colspan="6">DEEP1M</td></tr><tr><td></td><td>32 bits</td><td></td><td></td><td>64 bits</td><td></td><td></td><td>32 bits</td><td></td><td></td><td>64 bits</td><td></td></tr><tr><td>R@1</td><td>R@10</td><td>R@100</td><td>R@1</td><td>R@10</td><td>R@100</td><td>R@1</td><td>R@10</td><td>R@100</td><td>R@1</td><td>R@10</td><td>R@100</td></tr><tr><td>OPQ</td><td>5.34</td><td>22.03</td><td>56.72</td><td>22.84</td><td>60.27</td><td>92.19</td><td>3.07</td><td>15.39</td><td>48.40</td><td>15.34</td><td>50.06</td><td>87.96</td></tr><tr><td>sQ</td><td>9.45</td><td>34.88</td><td>70.07</td><td>24.41</td><td>65.48</td><td>93.17</td><td>6.41</td><td>26.79</td><td>70.25</td><td>19.95</td><td>56.31</td><td>91.27</td></tr><tr><td>LSQ</td><td>11.43</td><td>40.48</td><td>80.52</td><td>33.23</td><td>78.37</td><td>98.72</td><td>7.29</td><td>28.96</td><td>72.93</td><td>21.12</td><td>61.47</td><td>93.98</td></tr><tr><td>DPQ</td><td>5.41</td><td>22.97</td><td>58.57</td><td>21.87</td><td>59.39</td><td>91.66</td><td>1.59</td><td>8.96</td><td>33.09</td><td>9.53</td><td>33.45</td><td>72.80</td></tr><tr><td>DPgQ</td><td>9.71</td><td>35.03</td><td>74.19</td><td>27.96</td><td>69.98</td><td>96.04</td><td>6.36</td><td>26.16</td><td>70.02</td><td>18.98</td><td>55.80</td><td>90.95</td></tr><tr><td>DRQ</td><td>1.40</td><td>8.87</td><td>35.27</td><td>18.56</td><td>53.06</td><td>88.45</td><td>4.48</td><td>22.46</td><td>62.57</td><td>16.10</td><td>52.76</td><td>89.31</td></tr><tr><td>UNQ</td><td>10.01</td><td>33.92</td><td>73.39</td><td>28.37</td><td>69.15</td><td>95.99</td><td>5.19</td><td>23.55</td><td>65.09</td><td>16.12</td><td>52.06</td><td>90.10</td></tr><tr><td>Ours</td><td>11.02</td><td>37.73</td><td>76.79</td><td>28.02</td><td>70.22</td><td>96.43</td><td>7.43</td><td>30.03</td><td>72.48</td><td>20.87</td><td>62.06</td><td>94.07</td></tr></table>
|
| 379 |
+
|
| 380 |
+
Table 2: Quantitative comparisons with state-of-the-arts on SIFT1M and DEEP1M datasets. $\operatorname { R e c a l l } ( \mathbf { R } ) @ \left\{ 1 , 1 0 , 1 0 0 \right\}$ are reported $( \% )$ . Ours shows comparable performance with staet-of-the-arts on SIFT1M, while achieving the highest recall in most cases on DEEP1M.
|
| 381 |
+
|
| 382 |
+
# 78 5.3.1 Large-scale retrieval performance
|
| 383 |
+
|
| 384 |
+
Our evaluations on SIFT1M and DEEP1M datasets is presented in Table 2. The training set and base set are scaled up, and retrievals on these datasets become more difficult. We observe expected results on two datasets. Compared to our main competitor, LSQ, our method achieves comparable performance on SIFT1M, and outperforms LSQ on DEEP1M in most cases. Our method achieves higher recall on DEEP1M than SIFT1M. A potential reason is that DEEP1M is under a nearly normal distribution that, in practice, is easier to converge than SIFT1M, which has a larger variance between datapoints. The performance of UNQ in our experiments is lower than expected, possibly due to different dataset settings.
|
| 385 |
+
|
| 386 |
+
Another key advantage of our method is that, different from shallow methods, which are hand-crafted algorithms that find possible solutions manually or with constraints, our DeepQ encodes vectors by only a feed-forward.
|
| 387 |
+
|
| 388 |
+
# 5.3.2 Encoding efficiency
|
| 389 |
+
|
| 390 |
+
In order to verify the encoding efficiency of our method, evaluations of encoding time on SIFT1M with the $1 0 ^ { 6 }$ base set are conducted by checking the total time spent. All of them are run under GPU-acceleration. Additionally, we evaluate the time with and without the extra codewords refinement that introduced in section 4.3 (128 bits results are simulated). As Figure 3 shows, our network is significantly faster than LSQ since it needs to perform local search iteratively for 25 or even 100 rounds. Specifically, to encode SIFT1M base set, LSQ takes 52.84s, 96.99s, 256.86s and 639.18s for 16, 32, 64 and 128 bits respectively. By contrast, our method takes 4.46s, 5.46s, 8.26s and 16.64s, which is $1 1 . 8 \times$ , $1 7 . 8 \times$ , $3 1 . 1 \times$ and $3 8 . 4 \times$ faster than LSQ. Moreover, our method is even faster than most of the constrained MCQs. We also notice that the refinement takes negligible overhead. Although UNQ takes the fastest encoding speed, it still needs to decode and re-rank during retrieval, which slows down its retrieval speed.
|
| 391 |
+
|
| 392 |
+
# 5.3.3 Reconstruction accuracy
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 3: Total encoding time w.r.t. code-length on SIFT1M dataset. For 128 bits, we illustrate the simulated results. The variant Ours\* removes extra refinement step to show its overhead. Our two variants are significantly faster than LSQ while achieving similar performance. Furthermore, our method is slightly faster than most of the constrained MCQs. Our method achieves high performance as well as superior encoding efficiency. UNQ has the shortest time to encode the whole set, however during retrieval, they still need to decode and re-rank that slow down the speed.
|
| 396 |
+
|
| 397 |
+
315 datasets are stated in Table 3. Basically, when the quantization error gets lower, recall will be higher.
|
| 398 |
+
|
| 399 |
+
Table 3: Comparisons of quantization error with state-of-the-arts on three datasets (lower is better). Ours achieves the lowest quantization error in most cases. This gives us benefits of feature reconstruction. Observe that UNQ performs poorly, we believe it focuses more on ranking and similarity preservation, other than reconstruction.
|
| 400 |
+
|
| 401 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SIFT1M</td><td colspan="2">DEEP1M</td><td colspan="2">LabelMe22K</td></tr><tr><td>32 bits</td><td>64 bits</td><td>32 bits</td><td>64 bits</td><td>32 bits</td><td>64 bits</td></tr><tr><td>OPQ</td><td>4.03×104</td><td>2.51×104</td><td>4.25×10-1</td><td>2.70×10-1</td><td>1.25×10-1</td><td>9.25×10-2</td></tr><tr><td>sQ</td><td>3.42 ×104</td><td>2.13×104</td><td>3.24×10-1</td><td>2.10×10-1</td><td>1.25 × 10-1</td><td>9.10 ×10-2</td></tr><tr><td>LSQ</td><td>2.90 ×104</td><td>1.12 × 104</td><td>3.04× 10-1</td><td>1.99 ×10-1</td><td>1.21 ×10-1</td><td>8.57×10-2</td></tr><tr><td>DPQ</td><td>4.01×104</td><td>2.48×104</td><td>4.58×10-1</td><td>3.54×10-1</td><td>1.77 × 10-1</td><td>1.60×10-1</td></tr><tr><td>DPgQ</td><td>3.30×104</td><td>2.10×104</td><td>3.29 ×10-1</td><td>2.12 ×10-1</td><td>1.31 × 10-1</td><td>8.74×10-2</td></tr><tr><td>DRQ</td><td>4.75×104</td><td>2.88×104</td><td>3.52 ×10-1</td><td>2.54×10-1</td><td>1.61 × 10-1</td><td>1.01 × 10-1</td></tr><tr><td>UNQ</td><td>4.14×104</td><td>2.33×104</td><td>3.52 ×10-1</td><td>2.39 ×10-1</td><td>1.48 ×10-1</td><td>1.08×10-1</td></tr><tr><td>Ours</td><td>2.92×104</td><td>1.91 × 104</td><td>2.92×10-1</td><td>1.93×10-1</td><td>1.02×10-1</td><td>6.72×10-2</td></tr></table>
|
| 402 |
+
|
| 403 |
+
316 Ours get the 2nd place on SIFT1M, and the lowest on remaining datasets in most cases. Quantization
|
| 404 |
+
317 error indicates reconstruction accuracy and further shows the quality of codebook generation and
|
| 405 |
+
318 quantization codes selection. Notably, ours significantly outperforms UNQ, which has a strong bias
|
| 406 |
+
319 on the reconstruction task. This is because they focus more on ranking, not the quantization error.
|
| 407 |
+
320 The result shows that our method can be applied to other areas, e.g. vector compression.
|
| 408 |
+
|
| 409 |
+
# 5.4 Ablation study
|
| 410 |
+
|
| 411 |
+
Our ablation study is conducted on the SIFT1M dataset, with the code-length of 32 bits, which in our experiments is sufficient to show how does each component affects our model. We choose the following variants to perform ablation:
|
| 412 |
+
|
| 413 |
+
w/o regularization: which removes $e _ { \theta }$ in the losses, and the output distributions will not be forced to be uniform.
|
| 414 |
+
|
| 415 |
+
w/o return-norm: which does not normalize $R$ , and therefor advantage is computed by $R$ other than $\bar { R }$ .
|
| 416 |
+
|
| 417 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">SIFT1M@32 bits</td></tr><tr><td>QE</td><td>R@1</td><td>R@10</td><td>R@100</td></tr><tr><td>w/o regularization</td><td>3.38×104</td><td>7.60</td><td>29.96</td><td>68.73</td></tr><tr><td>w/o return-norm</td><td>3.06×104</td><td>10.57</td><td>36.44</td><td>76.04</td></tr><tr><td>w/o correction</td><td>3.10×104</td><td>10.09</td><td>35.30</td><td>75.16</td></tr><tr><td>w/o refinement</td><td>3.17 ×104</td><td>9.91</td><td>30.39</td><td>68.28</td></tr><tr><td>DeepQ</td><td>2.92×104</td><td>11.02</td><td>37.73</td><td>76.79</td></tr></table>
|
| 418 |
+
|
| 419 |
+
w/o correction: which removes value correction. So our VC-PPO falls back to the original PPO.
|
| 420 |
+
|
| 421 |
+
Table 4: Ablation study conducted on SIFT1M with 32 bits code-length. Entropy regularization forces network to try more codeword combinations, which help to jump out of local-optima. Return normalization and value correction help for fast convergence. The extra refinement leads to low quantization error and high recall with negligible costs.
|
| 422 |
+
|
| 423 |
+
w/o refinement: which directly encode the base set without extra refinement.
|
| 424 |
+
|
| 425 |
+
Quantization error and recall are evaluated and placed in Table 4. We report the best value they ever met during the training procedure. Specifically, when regularization is removed, it seems that the network is trapped in local-optima and the performance drops. Meanwhile, although return normalization and value correction give us only subtle improvements, we find they help the network to converge quickly. The extra refinement gives us lower quantization error and higher recall, specially when we want to perform fast training before the network is converged.
|
| 426 |
+
|
| 427 |
+
# 43 6 Conclusion and Future Work
|
| 428 |
+
|
| 429 |
+
In this paper, we first review previous works of constrained MCQs, and investigate solutions to unconstrained ones. Since finding the global-optima of MCQ is NP-hard, researchers apply constraints to find near-optimal solutions or employ heuristic algorithms that are still time-consuming. This paper takes the first attempt to find a deep solution to MCQ. The proposed IndepNet is designed to be simple enough to encode vectors extremely fast. Furthermore, our network shows state-of-the-art performance in retrieval and reconstruction tasks. Our method is slow to converge in a large dataset, which hinders our performance. So, our future work will focus on training speedup.
|
| 430 |
+
|
| 431 |
+
# 351 References
|
| 432 |
+
|
| 433 |
+
353 Demmel, J., Bischof, C. H., and Sorensen, D. C. (1990). LAPACK: a portable linear algebra library for
|
| 434 |
+
354 high-performance computers. In SC, pages 2–11.
|
| 435 |
+
355 [2] Babenko, A. and Lempitsky, V. (2014). Additive quantization for extreme vector compression. In CVPR,
|
| 436 |
+
356 pages 931–938.
|
| 437 |
+
357 [3] Babenko, A. and Lempitsky, V. (2015). Tree quantization for large-scale similarity search and classification.
|
| 438 |
+
358 In CVPR, pages 4240–4248.
|
| 439 |
+
359 [4] Chen, Y., Guan, T., and Wang, C. (2010). Approximate nearest neighbor search by residual vector
|
| 440 |
+
360 quantization. Sensors, 10(12):11259–11273.
|
| 441 |
+
361 [5] Gao, L., Zhu, X., Song, J., Zhao, Z., and Shen, H. T. (2019). Beyond product quantization: Deep progressive
|
| 442 |
+
362 quantization for image retrieval. In IJCAI, pages 723–729.
|
| 443 |
+
363 [6] Ge, T., He, K., Ke, Q., and Sun, J. (2013). Optimized product quantization for approximate nearest neighbor
|
| 444 |
+
364 search. In CVPR, pages 2946–2953.
|
| 445 |
+
365 [7] Gray, R. (1984). Vector quantization. IEEE Assp Magazine, 1(2):4–29.
|
| 446 |
+
366 [8] Ilyas, A., Engstrom, L., Santurkar, S., Tsipras, D., Janoos, F., Rudolph, L., and Madry, A. (2020). A closer
|
| 447 |
+
367 look at deep policy gradients. In ICLR.
|
| 448 |
+
368 [9] Jégou, H., Douze, M., and Schmid, C. (2010). Product quantization for nearest neighbor search. IEEE Trans.
|
| 449 |
+
369 Pattern Anal. Mach. Intell., 33(1):117–128.
|
| 450 |
+
370 [10] Kalantidis, Y. and Avrithis, Y. (2014). Locally optimized product quantization for approximate nearest
|
| 451 |
+
371 neighbor search. In CVPR, pages 2329–2336.
|
| 452 |
+
372 [11] Klein, B. and Wolf, L. (2019). End-to-end supervised product quantization for image search and retrieval.
|
| 453 |
+
373 In CVPR, pages 5041–5050.
|
| 454 |
+
374 [12] Konda, V. R. and Tsitsiklis, J. N. (2000). Actor-critic algorithms. In NeurIPS, pages 1008–1014.
|
| 455 |
+
375 [13] Lloyd, S. (1982). Least squares quantization in pcm. IEEE transactions on information theory, 28(2):129–
|
| 456 |
+
376 137.
|
| 457 |
+
377 [14] Martinez, J., Clement, J., Hoos, H. H., and Little, J. J. (2016). Revisiting additive quantization. In ECCV,
|
| 458 |
+
378 pages 137–153. Springer.
|
| 459 |
+
379 [15] Martinez, J., Hoos, H. H., and Little, J. J. (2014). Stacked quantizers for compositional vector compression.
|
| 460 |
+
380 arXiv preprint arXiv:1411.2173.
|
| 461 |
+
381 [16] Martinez, J., Zakhmi, S., Hoos, H. H., and Little, J. J. (2018). Lsq $^ { + + }$ : Lower running time and higher
|
| 462 |
+
382 recall in multi-codebook quantization. In ECCV, pages 491–506.
|
| 463 |
+
383 [17] Mohamed, S., Rosca, M., Figurnov, M., and Mnih, A. (2020). Monte carlo gradient estimation in machine
|
| 464 |
+
384 learning. J. Mach. Learn. Res., 21:132:1–132:62.
|
| 465 |
+
385 [18] Morozov, S. and Babenko, A. (2019). Unsupervised neural quantization for compressed-domain similarity
|
| 466 |
+
386 search. In ICCV, pages 3036–3045.
|
| 467 |
+
387 [19] Norouzi, M. and Fleet, D. J. (2013). Cartesian k-means. In CVPR, pages 3017–3024.
|
| 468 |
+
388 [20] Radenovic, F., Iscen, A., Tolias, G., Avrithis, Y., and Chum, O. (2018). Revisiting oxford and paris:
|
| 469 |
+
389 Large-scale image retrieval benchmarking. In CVPR, pages 5706–5715.
|
| 470 |
+
390 [21] Reddi, S. J., Kale, S., and Kumar, S. (2018). On the convergence of adam and beyond. In ICLR.
|
| 471 |
+
391 [22] Sablayrolles, A., Douze, M., Schmid, C., and Jégou, H. (2019). Spreading vectors for similarity search. In
|
| 472 |
+
392 ICLR.
|
| 473 |
+
393 [23] Schulman, J., Heess, N., Weber, T., and Abbeel, P. (2015a). Gradient estimation using stochastic computa
|
| 474 |
+
394 tion graphs. In NeurIPS, pages 3528–3536.
|
| 475 |
+
395 [24] Schulman, J., Levine, S., Abbeel, P., Jordan, M. I., and Moritz, P. (2015b). Trust region policy optimization.
|
| 476 |
+
396 In ICML, pages 1889–1897.
|
| 477 |
+
397 [25] Schulman, J., Moritz, P., Levine, S., Jordan, M. I., and Abbeel, P. (2016). High-dimensional continuous
|
| 478 |
+
398 control using generalized advantage estimation. In ICLR.
|
| 479 |
+
399 [26] Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. (2017). Proximal policy optimization
|
| 480 |
+
400 algorithms. arXiv preprint arXiv:1707.06347.
|
| 481 |
+
401 [27] Song, J., Lang, R., Zhu, X., Xu, X., Gao, L., and Shen, H. T. (2020). 3d self-attention for unsupervised
|
| 482 |
+
402 video quantization. In ACM SIGIR, pages 1061–1070.
|
| 483 |
+
403 [28] Song, J., Zhu, X., Gao, L., Xu, X.-S., Liu, W., and Shen, H. T. (2019). Deep recurrent quantization for
|
| 484 |
+
404 generating sequential binary codes. In IJCAI, pages 912–918.
|
| 485 |
+
405 [29] Torralba, A., Fergus, R., and Weiss, Y. (2008). Small codes and large image databases for recognition. In
|
| 486 |
+
406 CVPR, pages 1–8. IEEE.
|
| 487 |
+
407 [30] Wang, J., Wang, J., Song, J., Xu, X., Shen, H. T., and Li, S. (2015). Optimized cartesian k-means. IEEE
|
| 488 |
+
408 Transactions on Knowledge and Data Engineering, 27(1):180–192.
|
| 489 |
+
409 [31] Weyand, T., Araujo, A., Cao, B., and Sim, J. (2020). Google landmarks dataset v2 - A large-scale
|
| 490 |
+
410 benchmark for instance-level recognition and retrieval. In CVPR, pages 2572–2581.
|
| 491 |
+
411 [32] Williams, R. J. (1992). Simple statistical gradient-following algorithms for connectionist reinforcement
|
| 492 |
+
412 learning. Machine learning, 8(3-4):229–256.
|
| 493 |
+
413 [33] Yu, T., Yuan, J., Fang, C., and Jin, H. (2018). Product quantization network for fast image retrieval. In
|
| 494 |
+
414 ECCV, pages 186–201.
|
| 495 |
+
415 [34] Zhang, T., Du, C., and Wang, J. (2014). Composite quantization for approximate nearest neighbor search.
|
| 496 |
+
416 In ICML, volume 2, page 3.
|
| 497 |
+
|
| 498 |
+
# 417 Checklist
|
| 499 |
+
|
| 500 |
+
418 The checklist follows the references. Please read the checklist guidelines carefully for information on
|
| 501 |
+
419 how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or
|
| 502 |
+
420 [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing
|
| 503 |
+
421 the appropriate section of your paper or providing a brief inline description. For example:
|
| 504 |
+
|
| 505 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??. • Did you include the license to the code and datasets? [No] The code and the data are proprietary. • Did you include the license to the code and datasets? [N/A]
|
| 506 |
+
|
| 507 |
+
425 Please do not modify the questions and only use the provided macros for your answers. Note that the
|
| 508 |
+
426 Checklist section does not count towards the page limit. In your paper, please delete this instructions
|
| 509 |
+
427 block and only keep the Checklist section heading above along with the questions/answers below.
|
| 510 |
+
|
| 511 |
+
1. For all authors...
|
| 512 |
+
|
| 513 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 514 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 515 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 516 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 517 |
+
|
| 518 |
+
2. If you are including theoretical results...
|
| 519 |
+
|
| 520 |
+
(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]
|
| 521 |
+
|
| 522 |
+
3. If you ran experiments...
|
| 523 |
+
|
| 524 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See https://github.com/ DeepMCQ/DeepQ.
|
| 525 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 5 and supplementary materials.
|
| 526 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 527 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 5.
|
| 528 |
+
|
| 529 |
+
48 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 530 |
+
|
| 531 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 5.
|
| 532 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 533 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See https://github.com/DeepMCQ/DeepQ.
|
| 534 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 535 |
+
|
| 536 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 537 |
+
|
| 538 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 539 |
+
|
| 540 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 541 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 542 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/B1gdkxHFDH/B1gdkxHFDH.md
ADDED
|
@@ -0,0 +1,628 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING INDIVIDUALLY FAIR ML MODELS WITH SENSITIVE SUBSPACE ROBUSTNESS
|
| 2 |
+
|
| 3 |
+
Mikhail Yurochkin
|
| 4 |
+
IBM Research
|
| 5 |
+
MIT-IBM Watson AI Lab
|
| 6 |
+
mikhail.yurochkin@ibm.com
|
| 7 |
+
Amanda Bower†, Yuekai Sun‡
|
| 8 |
+
Department of Mathematics†
|
| 9 |
+
Department of Statistics‡
|
| 10 |
+
University of Michigan
|
| 11 |
+
{amandarg,yuekai}@umich.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We consider training machine learning models that are fair in the sense that their performance is invariant under certain sensitive perturbations to the inputs. For example, the performance of a resume screening system should be invariant under changes to the gender and/or ethnicity of the applicant. We formalize this notion of algorithmic fairness as a variant of individual fairness and develop a distributionally robust optimization approach to enforce it during training. We also demonstrate the effectiveness of the approach on two ML tasks that are susceptible to gender and racial biases.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Machine learning (ML) models are gradually replacing humans in high-stakes decision making roles. For example, in Philadelphia, an ML model classifies probationers as high or low-risk (Metz & Satariano, 2020). In North Carolina, “analytics” is used to report suspicious activity and fraud by Medicaid patients and providers (Metz & Satariano, 2020). Although ML models appear to eliminate the biases of a human decision maker, they may perpetuate or even exacerbate biases in the training data (Barocas & Selbst, 2016). Such biases are especially objectionable when it adversely affects underprivileged groups of users (Barocas & Selbst, 2016).
|
| 20 |
+
|
| 21 |
+
In response, the scientific community has proposed many mathematical definitions of algorithmic fairness and approaches to ensure ML models satisfy the definitions. Unfortunately, this abundance of definitions, many of which are incompatible (Kleinberg et al., 2016; Chouldechova, 2017), has hindered the adoption of this work by practitioners. There are two types of formal definitions of algorithmic fairness: group fairness and individual fairness. Most recent work on algorithmic fairness considers group fairness because it is more amenable to statistical analysis (Ritov et al., 2017). Despite their prevalence, group notions of algorithmic fairness suffer from certain shortcomings. One of the most troubling is there are many scenarios in which an algorithm satisfies group fairness, but its output is blatantly unfair from the point of view of individual users (Dwork et al., 2011).
|
| 22 |
+
|
| 23 |
+
In this paper, we consider individual fairness instead of group fairness. Intuitively, an individually fair ML model treats similar users similarly. Formally, an ML model is a map $h : \mathcal { X } \to \mathcal { Y }$ , where $\mathcal { X }$ and $\mathcal { V }$ are the input and output spaces. The leading notion of individual fairness is metric fairness (Dwork et al., 2011); it requires
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
d _ { y } ( h ( x _ { 1 } ) , h ( x _ { 2 } ) ) \leq L d _ { x } ( x _ { 1 } , x _ { 2 } ) { \mathrm { ~ f o r ~ a l l ~ } } x _ { 1 } , x _ { 2 } \in \mathcal { X } ,
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where $d _ { x }$ and $d _ { y }$ are metrics on the input and output spaces and $L \ge 0$ is a Lipschitz constant. The fair metric $d _ { x }$ encodes our intuition of which samples should be treated similarly by the ML model. We emphasize that $d _ { x } ( x _ { 1 } , x _ { 2 } )$ being small does not imply $x _ { 1 }$ and $x _ { 2 }$ are similar in all respects. Even if $d _ { x } ( x _ { 1 } , x _ { 2 } )$ is small, $x _ { 1 }$ and $x _ { 2 }$ may differ in certain problematic ways, e.g. in their protected/sensitive attributes. This is why we refer to pairs of samples $x _ { 1 }$ and $x _ { 2 }$ such that $d _ { x } ( x _ { 1 } , x _ { 2 } )$ is small as comparable instead of similar.
|
| 30 |
+
|
| 31 |
+
Despite its benefits, individual fairness was dismissed as impractical because there is no widely accepted fair metric for many ML tasks. Fortunately, there is a line of recent work on learning the fair metric from data (Ilvento, 2019; Wang et al., 2019). In this paper, we consider two data-driven choices of the fair metric: one for problems in which the sensitive attribute is reliably observed, and another for problems in which the sensitive attribute is unobserved (see Appendix B).
|
| 32 |
+
|
| 33 |
+
The rest of this paper is organized as follows. In Section 2, we cast individual fairness as a form of robustness: robustness to certain sensitive perturbations to the inputs of an ML model. This allows us to leverage recent advances in adversarial ML to train individually fair ML models. More concretely, we develop an approach to audit ML models for violations of individual fairness that is similar to adversarial attacks (Goodfellow et al., 2014) and an approach to train ML models that passes such audits (akin to adversarial training (Madry et al., 2017)). We justify the approach theoretically (see Section 3) and empirically (see Section 4).
|
| 34 |
+
|
| 35 |
+
# 2 FAIRNESS THROUGH (DISTRIBUTIONAL) ROBUSTNESS
|
| 36 |
+
|
| 37 |
+
To motivate our approach, imagine an auditor investigating an ML model for unfairness. The auditor collects a set of audit data and compares the output of the ML model on comparable samples in the audit data. For example, to investigate whether a resume screening system is fair, the auditor may collect a stack of resumes and change the names on the resumes of Caucasian applicants to names more common among the African-American population. If the system performs worse on the edited resumes, then the auditor may conclude the model treats African-American applicants unfairly. Such investigations are known as correspondence studies, and a prominent example is Bertrand & Mullainathan’s celebrated investigation of racial discrimination in the labor market. In a correspondence study, the investigator looks for inputs that are comparable to the training examples (the edited resumes in the resume screening example) on which the ML model performs poorly. In the rest of this section, we formulate an optimization problem to find such inputs.
|
| 38 |
+
|
| 39 |
+
# 2.1 FAIR WASSERSTEIN DISTANCES
|
| 40 |
+
|
| 41 |
+
Recall $\mathcal { X }$ and $\mathcal { V }$ are the spaces of inputs and outputs. To keep things simple, we assume that the ML task at hand is a classification task, so $\mathcal { V }$ is discrete. We also assume that we have a fair metric $d _ { x }$ of the form
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
d _ { x } ( x _ { 1 } , x _ { 2 } ) ^ { 2 } \triangleq \langle x _ { 1 } - x _ { 2 } , \Sigma ( x _ { 1 } - x _ { 2 } ) \rangle ^ { \frac { 1 } { 2 } } ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\boldsymbol { \Sigma } \in \mathbf { S } _ { \neq } ^ { d \times d }$ . For example, suppose we are given a set of $K$ “sensitive” directions that we wish the metric to ignore; i.e. $d ( x _ { 1 } , x _ { 2 } ) \ll 1$ for any $x _ { 1 }$ and $x _ { 2 }$ such that $x _ { 1 } - x _ { 2 }$ falls in the span of the sensitive directions. These directions may be provided by a domain expert or learned from data (see Section 4 and Appendix B). In this case, we may choose $\Sigma$ as the orthogonal complement projector of the span of the sensitive directions. We equip $\mathcal { X }$ with the fair metric and ${ \mathcal { Z } } \triangleq \chi \times \qquad $ with
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
d _ { z } ( ( x _ { 1 } , y _ { 1 } ) , ( x _ { 2 } , y _ { 2 } ) ) \triangleq d _ { x } ( x _ { 1 } , x _ { 2 } ) + \infty \cdot { \bf 1 } \{ y _ { 1 } \neq y _ { 2 } \} .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
We consider $d _ { z } ^ { 2 }$ as a transport cost function on $\mathcal { Z }$ . This cost function encodes our intuition of which samples are comparable for the ML task at hand. We equip the space of probability distributions on $\mathcal { Z }$ with the fair Wasserstein distance
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { W ( P , Q ) = \operatorname* { i n f } _ { \Pi \in \mathcal { C } ( P , Q ) } \int _ { \mathcal { Z } \times \mathcal { Z } } c ( z _ { 1 } , z _ { 2 } ) d \Pi ( z _ { 1 } , z _ { 2 } ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where ${ \mathcal { C } } ( P , Q )$ is the set of couplings between $P$ and $Q$ . The fair Wasserstein distance inherits our intuition of which samples are comparable through the cost function; i.e. the fair Wasserstein distance between two probability distributions is small if they are supported on comparable areas of the sample space.
|
| 60 |
+
|
| 61 |
+
# 2.2 AUDITING ML MODELS FOR ALGORITHMIC BIAS
|
| 62 |
+
|
| 63 |
+
To investigate whether an ML model performs disparately on comparable samples, the auditor collects a set of audit data $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ and solves the optimization problem
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \operatorname* { m a x } _ { P : W ( P , P _ { n } ) \leq \epsilon } \int _ { \mathcal { Z } } \ell ( z , h ) d P ( z ) , } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\ell : \mathcal { Z } \times \mathcal { H } \mathbf { R } _ { + }$ is a loss function, $h$ is the ML model, $P _ { n }$ is the empirical distribution of the audit data, and $\epsilon > 0$ is a small tolerance parameter. We interpret $\epsilon$ as a moving budget that the auditor may expend to discover discrepancies in the performance of the ML model. This budget forces the auditor to avoid moving samples to incomparable areas of the sample space. We emphasize that equation 2.1 detects aggregate violations of individual fairness. In other words, although the violations that the auditor’s problem detects are individual in nature, the auditor’s problem is only able to detect aggregate violations. We summarize the implicit notion of fairness in equation 2.1 in a definition.
|
| 70 |
+
|
| 71 |
+
Definition 2.1 (distributionally robustly fair (DRF)). An ML model $h \ : \ \mathcal { X } \ \to \ \mathcal { Y }$ is $( \epsilon , \delta )$ - distributionally robustly fair (DRF) WRT the fair metric $d _ { x }$ iff
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \operatorname* { m a x } _ { P : W ( P , P _ { n } ) \leq \epsilon } \int _ { \mathcal { Z } } \ell ( z , h ) d P ( z ) \leq \delta . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Although equation 2.1 is an infinite-dimensional optimization problem, it is possible to solve it exactly by appealing to duality. Blanchet & Murthy showed that the dual of equation 2.1 is
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l r } & { } & { \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , h ) \big ] = \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda } ^ { c } ( Z , h ) \big ] \} , } \\ & { } & { \ell _ { \lambda } ^ { c } ( ( x _ { i } , y _ { i } ) , h ) \triangleq \operatorname* { s u p } _ { x \in \mathcal { X } } \ell ( ( x , y _ { i } ) , \theta ) - \lambda d _ { x } ( x , x _ { i } ) . } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
This is a univariate optimization problem, and it is amenable to stochastic optimization. We describe a stochastic approximation algorithm for equation 2.3 in Algorithm 1. Inspecting the algorithm, we see that it is similar to the PGD algorithm for adversarial attack.
|
| 84 |
+
|
| 85 |
+
# Algorithm 1 stochastic gradient method for equation 2.3
|
| 86 |
+
|
| 87 |
+
Require: starting point $\hat { \lambda } _ { 1 }$ , step sizes $\alpha _ { t } > 0$
|
| 88 |
+
|
| 89 |
+
1: repeat
|
| 90 |
+
2: draw mini-batch $( x _ { t _ { 1 } } , y _ { t _ { 1 } } ) , \dots , ( x _ { t _ { B } } , y _ { t _ { B } } ) \sim P _ { n }$
|
| 91 |
+
3: $\begin{array} { r } { x _ { t _ { b } } ^ { * } \gets \arg \operatorname* { m a x } _ { x \in \mathcal { X } } \ell ( ( x , y _ { t _ { b } } ) , h ) - \lambda d _ { x } ( x _ { t _ { b } } , x ) , } \end{array}$ b ∈ [B]
|
| 92 |
+
4: $\begin{array} { r } { \hat { \lambda } _ { t + 1 } \gets \operatorname* { m a x } \{ 0 , \hat { \lambda } _ { t } - \alpha _ { t } ( \epsilon - \frac { 1 } { B } \sum _ { b = 1 } ^ { B } d _ { x } ( x _ { t _ { b } } , x _ { t _ { b } } ^ { * } ) ) \} } \end{array}$
|
| 93 |
+
5: until converged
|
| 94 |
+
|
| 95 |
+
It is known that the optimal point of equation 2.1 is the discrete measure $\textstyle { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \delta _ { ( T _ { \lambda } ( x _ { i } ) , y _ { i } ) }$ , where $T _ { \lambda } : \mathcal { X } \to \mathcal { X }$ is the unfair map
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r } { T _ { \lambda } ( x _ { i } ) \gets \arg \operatorname* { m a x } _ { x \in \mathcal { X } } \ell ( ( x , y _ { i } ) , h ) - \lambda d _ { x } ^ { 2 } ( x , x _ { i } ) . } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
We call $T _ { \lambda }$ an unfair map because it reveals unfairness in the ML model by mapping samples in the audit data to comparable areas of the sample space that the system performs poorly on. We note that $T _ { \lambda }$ may map samples in the audit data to areas of the sample space that are not represented in the audit data, thereby revealing disparate treatment in the ML model not visible in the audit data alone. We emphasize that $T _ { \lambda }$ more than reveals disparate treatment in the ML model; it localizes the unfairness to certain areas of the sample space.
|
| 102 |
+
|
| 103 |
+
We present a simple example to illustrating fairness through robustness (a similar example appeared in Hashimoto et al. (2018)). Consider the binary classification dataset shown in Figure 1. There are two subgroups of observations in this dataset, and (sub)group membership is the protected attribute (e.g. the smaller group contains observations from a minority subgroup). In Figure 1a we see the decision heatmap of a vanilla logistic regression, which performs poorly on the blue minority subgroup. The two subgroups are separated in the horizontal direction, so the horizontal direction is the sensitive direction. Figure 1b shows that such classifier is unfair with respect to the corresponding fair metric, i.e. the unfair map equation 2.4 leads to significant loss increase by transporting mass along the horizontal direction with very minor change of the vertical coordinate.
|
| 104 |
+
|
| 105 |
+
Comparison with metric fairness Before moving on to training individually fair ML models, we compare DRF with metric fairness equation 1.1. Although we concentrate on the differences between the two definitions here, they are more similar than different: both formalize the intuition that the outputs of a fair ML model should perform similarly on comparable inputs. That said, there are two main differences between the two definitions. First, instead of requiring the output of the ML model to be similar on all inputs comparable to a training example, we require the output to be similar to the training label. Thus DRF not only enforces similarity of the output on comparable inputs, but also accuracy of the ML model on the training data. Second, DRF considers differences between datasets instead of samples by replacing the fair metric on inputs with the fair Wasserstein distance induced by the fair metric. The main benefits of this modifications are (i) it is possible to optimize equation 2.1 efficiently, (ii) we can show this modified notion of individual fairness generalizes.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: Figure (a) depicts a binary classification dataset in which the minority group shown on the right of the plot is underrepresented. This tilts the logistic regression decision boundary in favor of the majority group on the left. Figure (b) shows the unfair map of the logistic regression decision boundary. It maps samples in the minority group towards the majority group. Figure (c) shows an algorithmically fair classifier that treats the majority and minority groups identically.
|
| 109 |
+
|
| 110 |
+
# 2.3 FAIR TRAINING WITH SENSITIVE SUBSPACE ROBUSTNESS
|
| 111 |
+
|
| 112 |
+
We cast the fair training problem as training supervised learning systems that are robust to sensitive perturbations. We propose solving the minimax problem
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\operatorname* { i n f } _ { h \in \mathcal { H } } \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , h ) \big ] = \operatorname* { i n f } _ { h \in \mathcal { H } } \operatorname* { i n f } _ { \lambda \geq 0 } \lambda \epsilon + \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda } ^ { c } ( Z , h ) \big ] ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\ell _ { \lambda } ^ { c }$ is defined in equation 2.3. This is an instance of a distributionally robust optimization (DRO) problem, and it inherits some of the statistical properties of DRO. To see why equation 2.5 encourages individual fairness, recall the loss function is a measure of the performance of the ML model. By assessing the performance of an ML model by its worse-case performance on hypothetical populations of users with perturbed sensitive attributes, minimizing equation 2.5 ensures the system performs well on all such populations. In our toy example, minimizing equation 2.5 implies learning a classifier that is insensitive to perturbations along the horizontal (i.e. sensitive) direction. In Figure 1c this is achieved by the algorithm we describe next.
|
| 119 |
+
|
| 120 |
+
To keep things simple, we assume the hypothesis class is parametrized by $\theta \in \Theta \subset \mathbf { R } ^ { d }$ and replace the minimization with respect to $\mathcal { H }$ by minimization with respect to $\theta$ . In light of the similarities between the DRO objective function and adversarial training, we borrow algorithms for adversarial training (Madry et al., 2017) to solve equation 2.5 (see Algorithm 2).
|
| 121 |
+
|
| 122 |
+
# Algorithm 2 Sensitive Subspace Robustness (SenSR)
|
| 123 |
+
|
| 124 |
+
Require: starting point $\widehat { \theta } _ { 1 }$ , step sizes $\alpha _ { t } , \beta _ { t } > 0$
|
| 125 |
+
|
| 126 |
+
1: repeat
|
| 127 |
+
2: sample mini-batch $( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { B } , y _ { B } ) \sim P _ { n }$
|
| 128 |
+
3: $\begin{array} { r } { x _ { t _ { b } } ^ { * } \gets \arg \operatorname* { m a x } _ { x \in \mathcal { X } } \ell ( ( x , y _ { t _ { b } } ) , \theta ) - \hat { \lambda } _ { t } d _ { x } ( x _ { t _ { b } } , x ) , b } \end{array}$ ∈ [B]
|
| 129 |
+
4: $\begin{array} { r } { \hat { \lambda } _ { t + 1 } \gets \operatorname* { m a x } \{ 0 , \hat { \lambda } _ { t } - \alpha _ { t } ( \epsilon - \frac { 1 } { B } \sum _ { b = 1 } ^ { B } d _ { x } ( x _ { t _ { b } } , x _ { t _ { b } } ^ { * } ) ) \} } \end{array}$
|
| 130 |
+
5: $\begin{array} { r } { \hat { \theta } _ { t + 1 } \gets \hat { \theta } _ { t } - \frac { \beta _ { t } } { B } \sum _ { b = 1 } ^ { B } \partial _ { \theta } \ell ( ( x _ { t _ { b } } ^ { * } , y _ { t _ { b } } ) , \hat { \theta } _ { t } ) } \end{array}$
|
| 131 |
+
6: until converged
|
| 132 |
+
|
| 133 |
+
Related work Our approach to fair training is an instance of distributionally robust optimization (DRO). In DRO, the usual sample-average approximation of the expected cost function is replaced by $\widehat { L } _ { \mathrm { D R O } } ( \theta ) \triangleq \operatorname* { s u p } _ { P \in { \mathcal U } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ]$ , where $\mathcal { U }$ is a (data dependent) uncertainty set of probability distributions. The uncertainty set may be defined by moment or support constraints (Chen et al., 2007; Delage & Ye, 2010; Goh & Sim, 2010), $f$ -divergences (Ben-Tal et al., 2012; Lam & Zhou,
|
| 134 |
+
|
| 135 |
+
2015; Miyato et al., 2015; Namkoong & Duchi, 2016), and Wasserstein distances (ShafieezadehAbadeh et al., 2015; Blanchet et al., 2016; Esfahani & Kuhn, 2015; Lee & Raginsky, 2017; Sinha et al., 2017). Most similar to our work is Hashimoto et al. (2018): they show that DRO with a $\chi ^ { 2 }$ -neighborhood of the training data prevents representation disparity, i.e. minority groups tend to suffer higher losses because the training algorithm ignores them. One advantage of picking a Wasserstein uncertainty set is the set depends on the geometry of the sample space. This allows us to encode the correct notion of individual fairness for the ML task at hand in the Wasserstein distance.
|
| 136 |
+
|
| 137 |
+
Our approach to fair training is also similar to adversarial training (Madry et al., 2017), which hardens ML models against adversarial attacks by minimizing adversarial losses of the form ${ \mathrm { s u p } } _ { u \in \mathcal { U } } \ell ( z + u , \theta )$ , where $\mathcal { U }$ is a set of allowable perturbations (Szegedy et al., 2013; Goodfellow et al., 2014; Papernot et al., 2015; Carlini & Wagner, 2016; Kurakin et al., 2016). Typically, $\mathcal { U }$ is a scaled $\ell _ { p }$ -norm ball: $\mathcal { U } = \{ u : \| u \| _ { p } \leq \epsilon \}$ . Most similar to our work is Sinha et al. (2017): they consider an uncertainty set that is a Wasserstein neighborhood of the training data.
|
| 138 |
+
|
| 139 |
+
There are a few papers that consider adversarial approaches to algorithmic fairness. Zhang et al. (2018) propose an adversarial learning method that enforces equalized odds in which the adversary learns to predict the protected attribute from the output of the classifier. Edwards & Storkey (2015) propose an adversarial method for learning classifiers that satisfy demographic parity. Madras et al. (2018) generalize their method to learn classifiers that satisfy other (group) notions of algorithmic fairness. Garg et al. (2019) propose to use adversarial logit pairing (Kannan et al., 2018) to achieve fairness in text classification using a pre-specified list of counterfactual tokens.
|
| 140 |
+
|
| 141 |
+
# 3 SENSR TRAINS INDIVIDUALLY FAIR ML MODELS
|
| 142 |
+
|
| 143 |
+
One of the main benefits of our approach is it provably trains individually fair ML models. Further, it is possible for the learner to certify that an ML model is individually fair a posteriori. As we shall see, both are consequences of uniform convergence results for the DR loss class. More concretely, we study how quickly the uniform convergence error
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r } { \delta _ { n } \triangleq \operatorname* { s u p } _ { \theta \in \Theta } \left\{ \left| \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \left[ \ell ( Z , \theta ) \right] - \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \left[ \ell ( Z , \theta ) \right] \right| \right\} , } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $W _ { * }$ is the Wasserstein distance on $\Delta ( \mathcal { Z } )$ with a transportation cost function $c _ { * }$ that is possibly different from $c$ , vanishes. We permit some discrepancy in the (transportation) cost function to study the effect of a data-driven choice of $c$ . In the rest of this section, we regard $c _ { * }$ as the exact cost function and $c$ as a cost function learned from human supervision. We start by stating our assumptions on the ML task:
|
| 150 |
+
|
| 151 |
+
(A1) the feature space $\mathcal { X }$ is bounded: $D \triangleq \operatorname* { m a x } \{ \mathsf { d i a m } ( \boldsymbol { \mathcal { X } } ) , \mathsf { d i a m } _ { * } ( \boldsymbol { \mathcal { X } } ) \} < \infty ;$
|
| 152 |
+
(A2) the functions in the loss class $\mathcal { L } = \{ \ell ( \cdot , \theta ) : \theta \in \Theta \}$ are non-negative and bounded: $0 \leq \ell ( z , \theta ) \leq M$ for all $z \in { \mathcal { Z } }$ and $\theta \in \Theta$ , and $L$ -Lipschitz with respect to $d _ { x }$ : $\begin{array} { r } { \operatorname* { s u p } _ { \theta \in \Theta } \{ \operatorname* { s u p } _ { ( x _ { 1 } , y ) , ( x _ { 2 } , y ) \in \mathbb { Z } } \vert \ell ( ( x _ { 1 } , y ) , \theta ) - \ell ( ( x _ { 2 } , y ) , \theta ) \vert \} \leq L d _ { x } ( x _ { 1 } , x _ { 2 } ) ; } \end{array}$
|
| 153 |
+
|
| 154 |
+
(A3) the discrepancy in the (transportation) cost function is uniformly bounded:
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\begin{array} { r } { \operatorname* { s u p } _ { ( x _ { 1 } , y ) , ( x _ { 2 } , y ) \in \mathcal { Z } } \left| c ( ( x _ { 1 } , y ) , ( x _ { 2 } , y ) ) - c _ { * } ( ( x _ { 1 } , y ) , ( x _ { 2 } , y ) ) \right| \le \delta _ { c } D ^ { 2 } . } \end{array}
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
Assumptions A1 and A2 are standard (see (Lee & Raginsky, 2017, Assumption 1, 2, 3)) in the DRO literature. We emphasize that the constant $L$ in Assumption A2 is not the constant $L$ in the definition of metric fairness; it may be much larger. Thus most models that satisfy the conditions of the loss class are not individually fair in a meaningful sense.
|
| 161 |
+
|
| 162 |
+
Assumption A3 deserves further comment. Under A1, A3 is mild. For example, if the exact fair metric is
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
d _ { x } ( x _ { 1 } , x _ { 2 } ) = ( x _ { 1 } - x _ { 2 } ) ^ { T } \Sigma _ { * } ( x _ { 1 } - x _ { 2 } ) ^ { \frac { 1 } { 2 } } ,
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
then the error in the transportation cost function is at most
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\begin{array} { r l } & { | c ( ( x _ { 1 } , y ) , ( x _ { 2 } , y ) ) - c _ { * } ( ( x _ { 1 } , y ) , ( x _ { 2 } , y ) ) | } \\ & { \quad = | ( x _ { 1 } - x _ { 2 } ) ^ { T } \Sigma ( x _ { 1 } - x _ { 2 } ) - ( x _ { 1 } - x _ { 2 } ) ^ { T } \Sigma _ { * } ( x _ { 1 } - x _ { 2 } ) | } \\ & { \quad \leq D ^ { 2 } \frac { \| \Sigma - \Sigma _ { * } \| _ { 2 } } { \lambda _ { \operatorname* { m i n } } ( \Sigma _ { * } ) } , } \end{array}
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
We see that the error in the transportation cost function vanishes in the large-sample limit as long as $\Sigma$ is a consistent estimator of $\Sigma _ { * }$ .
|
| 175 |
+
|
| 176 |
+
We state the uniform convergence result in terms of the entropy integral of the loss class: ${ \mathfrak { C } } ( { \mathcal { L } } ) =$ $\begin{array} { r } { \int _ { 0 } ^ { \infty } \sqrt { \log N _ { \infty } ( \mathcal { F } , r ) } d r } \end{array}$ , where egral is $N _ { \infty } ( \mathcal { L } , r )$ as the of the $r$ -covering number of the loss class in the uniformmplexity of the loss class.
|
| 177 |
+
|
| 178 |
+
Proposition 3.1 (uniform convergence). Under Assumptions A1–A3, equation 3.1 satisfies
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\delta _ { n } \leq \frac { 4 8 \mathfrak { C } ( \mathcal { L } ) } { \sqrt { n } } + \frac { 4 8 L D ^ { 2 } } { \sqrt { n \epsilon } } + \frac { L \delta _ { c } D ^ { 2 } } { \sqrt { \epsilon } } + M ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } }
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
with probability at least $1 - t$
|
| 185 |
+
|
| 186 |
+
We note that Proposition 3.1 is similar to the generalization error bounds by Lee & Raginsky (2017). The main novelty in Proposition 3.1 is allowing error in the transportation cost function. We see that the discrepancy in the transportation cost function may affect the rate at which the uniform convergence error vanishes: it affects the rate if $\delta _ { c }$ is $\omega _ { P } ( \frac { 1 } { \sqrt { n } } )$ .
|
| 187 |
+
|
| 188 |
+
A consequence of uniform convergence is SenSR trains individually fair classifiers (if there are such classifiers in the hypothesis class). By individually fair ML model, we mean an ML model that has a small gap
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\begin{array} { r } { \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] , } \end{array}
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
The gap is the difference between the optimal value of the auditor’s optimization problem equation 2.1 and the (non-robust) risk. A small gap implies the auditor cannot significantly increase the loss by moving samples from $P _ { * }$ to comparable samples.
|
| 195 |
+
|
| 196 |
+
Proposition 3.2. Under the assumptions $A I { - } A 3$ , as long as there is $\bar { \theta } \in \Theta$ such that
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\begin{array} { r } { \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \bar { \theta } ) \big ] \leq \delta ^ { * } } \end{array}
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
for some $\delta ^ { * } > 0$ , $\begin{array} { r } { \widehat { \theta } \in \arg \operatorname* { m i n } _ { \theta \in \Theta } \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \left[ \ell ( Z , h ) \right] } \end{array}$ satisfies
|
| 203 |
+
|
| 204 |
+
$$
|
| 205 |
+
\begin{array} { r } { \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \left[ \ell ( Z , \hat { \theta } ) \right] - \mathbb { E } _ { P _ { * } } \left[ \ell ( Z , \hat { \theta } ) \right] \leq \delta ^ { * } + 2 \delta _ { n } , } \end{array}
|
| 206 |
+
$$
|
| 207 |
+
|
| 208 |
+
where $\delta _ { n }$ is the uniform convergence error equation 3.1.
|
| 209 |
+
|
| 210 |
+
Proposition 3.2 guarantees Algorithm 2 trains an individually fair ML model. More precisely, if there are models in $\mathcal { H }$ that are (i) individually fair and (ii) achieve small test error, then Algorithm 2 trains such a model. It is possible to replace equation 3.4 with other conditions, but a condition to its effect cannot be dispensed with entirely. If there are no individually fair models in $\mathcal { H }$ , then it is not possible for equation 2.5 to learn an individually fair model. If there are individually fair models in $\mathcal { H }$ , but they all perform poorly, then the goal of learning an individually fair model is futile.
|
| 211 |
+
|
| 212 |
+
Another consequence of uniform convergence is equation 3.3 is close to its empirical counterpart
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\begin{array} { r } { \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ] . } \end{array}
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
In other words, the gap generalizes. This implies equation 3.5 is a certificate of individual fairness; i.e. it is possible for practitioners to check whether an ML model is individually fair by evaluating equation 3.5.
|
| 219 |
+
|
| 220 |
+
Proposition 3.3. Under the assumptions A1–A3, for any $\epsilon > 0$ ,
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
\begin{array} { r } { \operatorname* { s u p } _ { \theta \in \Theta } \Big \{ \operatorname* { s u p } _ { P : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ] - ( \operatorname* { s u p } _ { P : W ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] \Big \} = \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] . } \end{array}
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
# 4 COMPUTATIONAL RESULTS
|
| 227 |
+
|
| 228 |
+
In this section, we present results from using SenSR to train individually fair ML models for two tasks: sentiment analysis and income prediction. We pick these two tasks to demonstrate the efficacy of SenSR on problems with structured (income prediction) and unstructured (sentiment analysis) inputs and in which the sensitive attribute (income prediction) is observed and unobserved (sentiment analysis). We refer to Appendix C and D for the implementation details.
|
| 229 |
+
|
| 230 |
+
Table 1: Sentiment prediction experiments over 10 restarts
|
| 231 |
+
|
| 232 |
+
<table><tr><td></td><td>Acc.,%</td><td>Race gap</td><td>Gend. gap</td><td>Cuis. gap</td></tr><tr><td>SenSR</td><td>94±1</td><td>0.30±.05</td><td>0.19±.03</td><td>0.23±.05</td></tr><tr><td>SenSR-E</td><td>93±1</td><td>0.11±.04</td><td>0.04±.03</td><td>1.11±.15</td></tr><tr><td>Baseline</td><td>95±1</td><td>7.01±.44</td><td>5.59±.37</td><td>4.10±.44</td></tr><tr><td>Project</td><td>94±1</td><td>1.00±.56</td><td>1.99±.58</td><td>1.70±.41</td></tr><tr><td>Sinha+ Bolukb.+</td><td>94±1 94±1</td><td>3.88±.26 6.85±.53</td><td>1.42±.29 4.33±.46</td><td>1.33±.18 3.44±.29</td></tr></table>
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 2: Box-plots of sentiment scores
|
| 236 |
+
|
| 237 |
+
# 4.1 FAIR SENTIMENT PREDICTION WITH WORD EMBEDDINGS
|
| 238 |
+
|
| 239 |
+
Problem formulation We study the problem of classifying the sentiment of words using positive (e.g. ‘smart’) and negative (e.g. ‘anxiety’) words compiled by Hu & Liu (2004). We embed words using 300-dimensional GloVe (Pennington et al., 2014) and train a one layer neural network with 1000 hidden units. Such classifier achieves $9 5 \%$ test accuracy, however it entails major individual fairness violation. Consider an application of this sentiment classifier to summarizing customer reviews, tweets or news articles. Human names are typical in such texts and should not affect the sentiment score, hence we consider fair metric between any pair of names to be 0. Then sentiment score for all names should be the same to satisfy the individual fairness. To make a connection to group fairness, following the study of Caliskan et al. (2017) that reveals the biases in word embeddings, we evaluate the fairness of our sentiment classifier using male and female names typical for Caucasian and African-American ethnic groups. We emphasize that to satisfy individual fairness, the sentiment of any name should be the same.
|
| 240 |
+
|
| 241 |
+
Comparison metrics To evaluate the gap between two groups of names, $\mathcal { N } _ { 0 }$ for Caucasian (or female) and $\mathcal { N } _ { 1 }$ for African-American (or male), we report $\begin{array} { r } { \frac { 1 } { | \mathcal { N } _ { 0 } | } \sum _ { n \in \mathcal { N } _ { 0 } } ( h ( n ) _ { 1 } - h ( n ) _ { 0 } ) \ - } \end{array}$ $\begin{array} { r } { \frac { 1 } { | \mathcal { N } _ { 1 } | } \sum _ { n \in \mathcal { N } _ { 1 } } ( h ( n ) _ { 1 } - h ( n ) _ { 0 } ) } \end{array}$ , where $h ( n ) _ { k }$ is logits for class $k$ of name $n$ $k = 1$ is the positive class). We use list of names provided in Caliskan et al. (2017), which consists of 49 Caucasian and 45 African-American names, among those 48 are female and 46 are male. The gap between African-American and Caucasian names is reported as Race gap, while the gap between male and female names is reported as Gend. gap in Table 1. As in Speer (2017), we also compare sentiment difference of two sentences: “Let’s go get Italian food” and “Let’s go get Mexican food”, i.e. cuisine gap (abbreviated Cuis. gap in Table 1), as a test of generalization beyond names. To embed these sentences we average their word embeddings.
|
| 242 |
+
|
| 243 |
+
Sensitive subspace We consider embeddings of 94 names that we use for evaluation as sensitive directions, which may be regarded as utilizing the expert knowledge, i.e. these names form a list of words that an expert believes should be treated equally. Fair metric is then defined using an orthogonal complement projector of the span of sensitive directions as we discussed in Section 2.1. When expert knowledge is not available, or we wish to achieve general fairness for names, we utilize a side dataset of popular baby names in New York City.1 The dataset has 11k names, however only 32 overlap with the list of names used for evaluation. Embeddings of these names define a group of comparable samples that we use to learn sensitive directions with SVD (see Appendix B.2 and Algorithm 3 for details). We take top 50 singular vectors to form the sensitive subspace. It is worth noting that, unlike many existing approaches in the fairness literature, we do not use any protected attribute information. Our algorithm only utilizes training words, their sentiments and a vanilla list of names.
|
| 244 |
+
|
| 245 |
+
Results From the box-plots in Figure 2, we see that both race and gender gaps are significant when using the baseline neural network classifier. It tends to predict Caucasian names as “positive”, while the median for African-American names is negative; the median sentiment for female names is higher than that for male names. We considered three other approaches to this problem: the algorithm of Bolukbasi et al. (2016) for pre-processing word embeddings; pre-processing via projecting out the sensitive subspace that we used for training SenSR (this is analogous to Prost et al. (2019)); training a distributionally robust classifier with Euclidean distance cost (Sinha et al., 2017). All approaches improved upon the baseline, however only SenSR can be considered individually fair. Our algorithm practically eliminates gender and racial gaps and achieves the notion of individual fairness as can be seen from almost equal predicted sentiment score for all names. We remark that using expert knowledge (i.e. evaluation names) allowed SenSR-E (E for expert) to further improve both group and individual fairness. However we warn practitioners that if the expert knowledge is too specific, generalization outside of the expert knowledge may not be very good. In Table 1 we report results averaged across 10 repetitions with $90 \% / 1 0 \%$ train/test splits, where we also verify that accuracy trade-off with the baseline is minor. In the right column we present the generalization check, i.e. comparing a pair of sentences unrelated to names. Utilizing expert knowledge led to a fairness over-fitting effect, however we still see improvement over other methods. When utilizing SVD of a larger dataset of names we observe better generalization. Our generalization check suggests that fairness over-fitting is possible, therefore datasets and procedure for verifying fairness generalization are needed.
|
| 246 |
+
|
| 247 |
+
Table 2: Summary of Adult classification experiments over 10 restarts
|
| 248 |
+
|
| 249 |
+
<table><tr><td></td><td>B-Acc,%</td><td>S-Con.</td><td>GR-Con.</td><td>GapG RMS</td><td>GapR RMS</td><td>GapG max</td><td>GapR max</td></tr><tr><td>SenSR</td><td>78.9</td><td>.934</td><td>.984</td><td>.068</td><td>.055</td><td>.087</td><td>.067</td></tr><tr><td>Baseline</td><td>82.9</td><td>.848</td><td>.865</td><td>.179</td><td>.089</td><td>.216</td><td>.105</td></tr><tr><td>Project</td><td>82.7</td><td>.868</td><td>1.00</td><td>.145</td><td>.064</td><td>.192</td><td>.086</td></tr><tr><td>Adv.Debias.</td><td>81.5</td><td>.807</td><td>.841</td><td>.082</td><td>.070</td><td>.110</td><td>.078</td></tr><tr><td>CoCL</td><td>79.0</td><td>1</td><td>1</td><td>.163</td><td>.080</td><td>.201</td><td>.109</td></tr></table>
|
| 250 |
+
|
| 251 |
+
# 4.2 ADULT
|
| 252 |
+
|
| 253 |
+
Problem formulation Demonstrating the broad applicability of SenSR outside of natural language processing tasks, we apply SenSR to a classification task on the Adult (Dua & Graff, 2017) data set to predict whether an individual makes at least $\$ 50\mathrm { k }$ based on features like gender and occupation for approximately 45,000 individuals. Models that predict income without fairness considerations can contribute to the problem of differences in pay between genders or races for the same work. Throughout this section, gender (male or female) and race (Caucasian or non-Caucasian) are binary.
|
| 254 |
+
|
| 255 |
+
Comparison metrics Arguably a classifier is individually unfair if the classifications for two data points that are the same on all features except demographic features are different. Therefore, to assess individual fairness, we report spouse consistency (S-Con.) and gender and race consistency (GR-Con.), which are measures of how often classifications change only because of differences in demographic features. For S-Con (resp. GR-con), we make 2 (resp. 4) copies of every data point where the only difference is that one is a husband and the other is a wife (resp. difference is in gender and race). S-Con (resp. GR-Con) is the fraction of corresponding pairs (resp. quadruples) that have the same classification. We also report various group fairness measures proposed by De-Arteaga et al. (2019) with respect to race or gender based on true positive rates, i.e. the ability of a classifier to correctly identify a given class. See Appendix D.5 for the definitions. We report $\mathrm { G a p } _ { R } ^ { \mathrm { R M S } }$ , ${ \mathrm { G a p } } _ { G } ^ { \mathrm { R M S } }$ ${ \mathrm { G a p } } _ { R } ^ { \operatorname* { m a x } }$ , and ${ \mathrm { G a p } } _ { G } ^ { \mathrm { m a x } }$ where $R$ refers to race, and $G$ refers to gender. We use balanced accuracy (Bacc) instead of accuracy2 to measure predictive ability since only $2 5 \%$ of individuals make at least $\$ 50\mathbf { k }$ .
|
| 256 |
+
|
| 257 |
+
Sensitive subspace Let $\{ ( x _ { i } , x _ { g _ { i } } ) \} _ { i = 1 } ^ { m }$ be the set of features $x _ { i } ~ \in ~ \mathbb { R } ^ { D }$ of the data except the coordinate for gender is zeroed and where $x _ { g _ { i } }$ indicates the gender of individual $i$ . For $\gamma > 0$ , let D 1m Pmi=1 −xgi (wT xi) + log(1 + ewT xi ) + γkwk2, i.e. wg is the learned hyperplane that classifies gender given by regularized logistic regression. Let $e _ { g } \in \mathbb { R } ^ { D }$ (resp. $e _ { r }$ ) be the vector that is 1 in the gender (resp. race) coordinate and 0 elsewhere. Then the sensitive subspace is the span of $[ w _ { g } , e _ { g } , e _ { r } ]$ . See Appendix B.1 for details.
|
| 258 |
+
|
| 259 |
+
Results See Table 2 for the average3 of each metric on the test sets over ten $80 \% / 2 0 \%$ train/test splits for Baseline, Project (projecting features onto the orthogonal complement of the sensitive subspace before training), CoCL (De-Arteaga et al., 2019), Adversarial Debiasing (Zhang et al., 2018), and SenSR. With the exception of CoCL (De-Arteaga et al., 2019), each classifier is a 100 unit single hidden layer neural network. The Baseline clearly exhibits individual and group fairness violations. While SenSR has the lowest B-acc, SenSR is the best by a large margin for S-Con. and has the best group fairness measures. We expect SenSR to do well on GR-consistency since the sensitive subspace includes the race and gender directions. However, SenSR’s individually fair performance generalizes: the sensitive directions do not directly use the husband and wife directions, yet SenSR performs well on S-Con. Furthermore, SenSR outperforms Project on S-Con and group fairness measures illustrating that SenSR does much more than just ignoring the sensitive subspace. CoCL only barely improves group fairness compared to the baseline with a significant drop in Bacc and while Adversarial Debiasing also improves group fairness, it is worse than the baseline on individual fairness measures illustrating that group fairness does not imply individual fairness.
|
| 260 |
+
|
| 261 |
+
# 5 SUMMARY
|
| 262 |
+
|
| 263 |
+
We consider the task of training ML systems that are fair in the sense that their performance is invariant under certain perturbations in a sensitive subspace. This notion of fairness is a variant of individual fairness (Dwork et al., 2011). One of the main barriers to the adoption of individual fairness is the lack of consensus on a fair metric for many ML tasks. To circumvent this issue, we consider two approaches to learning a fair metric from data: one for problems in which the sensitive attribute is observed, and another for problems in which the sensitive attribute is unobserved. Given a data-driven choice of fair metric, we provide an algorithm that provably trains individually fair ML models.
|
| 264 |
+
|
| 265 |
+
# ACKNOWLEDGMENTS
|
| 266 |
+
|
| 267 |
+
This work was supported by the National Science Foundation under grants DMS-1830247 and DMS-1916271.
|
| 268 |
+
|
| 269 |
+
# REFERENCES
|
| 270 |
+
|
| 271 |
+
Solon Barocas and Andrew D. Selbst. Big Data’s Disparate Impact. SSRN Electronic Journal, 2016. ISSN 1556-5068. doi: 10.2139/ssrn.2477899.
|
| 272 |
+
|
| 273 |
+
Rachel K. E. Bellamy, Kuntal Dey, Michael Hind, Samuel C. Hoffman, Stephanie Houde, Kalapriya Kannan, Pranay Lohia, Jacquelyn Martino, Sameep Mehta, Aleksandra Mojsilovic, Seema Nagar, Karthikeyan Natesan Ramamurthy, John Richards, Diptikalyan Saha, Prasanna Sattigeri, Moninder Singh, Kush R. Varshney, and Yunfeng Zhang. AI Fairness 360: An extensible toolkit for detecting, understanding, and mitigating unwanted algorithmic bias, October 2018. URL https://arxiv.org/abs/1810.01943.
|
| 274 |
+
|
| 275 |
+
Aharon Ben-Tal, Dick den Hertog, Anja De Waegenaere, Bertrand Melenberg, and Gijs Rennen. Robust Solutions of Optimization Problems Affected by Uncertain Probabilities. Management Science, 59(2):341–357, November 2012. ISSN 0025-1909. doi: 10.1287/mnsc.1120.1641.
|
| 276 |
+
|
| 277 |
+
Marianne Bertrand and Sendhil Mullainathan. Are Emily and Greg More Employable Than Lakisha and Jamal? A Field Experiment on Labor Market Discrimination. American Economic Review, 94(4):991–1013, September 2004. ISSN 0002-8282. doi: 10.1257/0002828042002561.
|
| 278 |
+
|
| 279 |
+
Jose Blanchet and Karthyek R. A. Murthy. Quantifying Distributional Model Risk via Optimal Transport. arXiv:1604.01446 [math, stat], April 2016.
|
| 280 |
+
|
| 281 |
+
Jose Blanchet, Yang Kang, and Karthyek Murthy. Robust Wasserstein Profile Inference and Applications to Machine Learning. arXiv:1610.05627 [math, stat], October 2016.
|
| 282 |
+
|
| 283 |
+
Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In Advances in neural information processing systems, pp. 4349–4357, 2016.
|
| 284 |
+
|
| 285 |
+
Aylin Caliskan, Joanna J. Bryson, and Arvind Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183–186, April 2017. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.aal4230.
|
| 286 |
+
|
| 287 |
+
Nicholas Carlini and David Wagner. Towards Evaluating the Robustness of Neural Networks. arXiv:1608.04644 [cs], August 2016.
|
| 288 |
+
|
| 289 |
+
Xin Chen, Melvyn Sim, and Peng Sun. A Robust Optimization Perspective on Stochastic Programming. Operations Research, 55:1058–1071, 2007. doi: 10.1287/opre.1070.0441.
|
| 290 |
+
|
| 291 |
+
Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. arXiv:1703.00056 [cs, stat], February 2017.
|
| 292 |
+
|
| 293 |
+
Maria De-Arteaga, Alexey Romanov, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, and Adam Tauman Kalai. Bias in bios: A case study of semantic representation bias in a high-stakes setting. arXiv preprint arXiv:1901.09451, 2019.
|
| 294 |
+
|
| 295 |
+
Erick Delage and Yinyu Ye. Distributionally Robust Optimization Under Moment Uncertainty with Application to Data-Driven Problems. Operations Research, 58:595–612, 2010. doi: 10.1287/ opre.1090.0741.
|
| 296 |
+
|
| 297 |
+
Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive. ics.uci.edu/ml.
|
| 298 |
+
|
| 299 |
+
Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Rich Zemel. Fairness Through Awareness. arXiv:1104.3913 [cs], April 2011.
|
| 300 |
+
|
| 301 |
+
Harrison Edwards and Amos Storkey. Censoring Representations with an Adversary. arXiv:1511.05897 [cs, stat], November 2015.
|
| 302 |
+
|
| 303 |
+
Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven Distributionally Robust Optimization Using the Wasserstein Metric: Performance Guarantees and Tractable Reformulations. May 2015.
|
| 304 |
+
|
| 305 |
+
Sahaj Garg, Vincent Perot, Nicole Limtiaco, Ankur Taly, Ed H Chi, and Alex Beutel. Counterfactual fairness in text classification through robustness. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 219–226. ACM, 2019.
|
| 306 |
+
|
| 307 |
+
Joel Goh and Melvyn Sim. Distributionally Robust Optimization and Its Tractable Approximations. Operations Research, 58(4-part-1):902–917, August 2010. ISSN 0030-364X, 1526-5463. doi: 10.1287/opre.1090.0795.
|
| 308 |
+
|
| 309 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. December 2014.
|
| 310 |
+
|
| 311 |
+
Tatsunori B. Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness Without Demographics in Repeated Loss Minimization. arXiv:1806.08010 [cs, stat], June 2018.
|
| 312 |
+
|
| 313 |
+
Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 168–177. ACM, 2004.
|
| 314 |
+
|
| 315 |
+
Christina Ilvento. Metric Learning for Individual Fairness. arXiv:1906.00250 [cs, stat], June 2019.
|
| 316 |
+
|
| 317 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
|
| 318 |
+
|
| 319 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 320 |
+
|
| 321 |
+
Jon Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent Trade-Offs in the Fair Determination of Risk Scores. arXiv:1609.05807 [cs, stat], September 2016.
|
| 322 |
+
|
| 323 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial Machine Learning at Scale. November 2016.
|
| 324 |
+
|
| 325 |
+
H. Lam and Enlu Zhou. Quantifying uncertainty in sample average approximation. In 2015 Winter Simulation Conference (WSC), pp. 3846–3857, December 2015. doi: 10.1109/WSC.2015. 7408541.
|
| 326 |
+
|
| 327 |
+
Jaeho Lee and Maxim Raginsky. Minimax Statistical Learning with Wasserstein Distances. arXiv:1705.07815 [cs], May 2017.
|
| 328 |
+
|
| 329 |
+
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning Adversarially Fair and Transferable Representations. arXiv:1802.06309 [cs, stat], February 2018.
|
| 330 |
+
|
| 331 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards Deep Learning Models Resistant to Adversarial Attacks. arXiv:1706.06083 [cs, stat], June 2017.
|
| 332 |
+
|
| 333 |
+
Cade Metz and Adam Satariano. An Algorithm That Grants Freedom, or Takes It Away. The New York Times, February 2020. ISSN 0362-4331.
|
| 334 |
+
|
| 335 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional Smoothing with Virtual Adversarial Training. arXiv:1507.00677 [cs, stat], July 2015.
|
| 336 |
+
|
| 337 |
+
Hongseok Namkoong and John C. Duchi. Stochastic Gradient Methods for Distributionally Robust Optimization with F-divergences. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS’16, pp. 2216–2224, Barcelona, Spain, 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9.
|
| 338 |
+
|
| 339 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The Limitations of Deep Learning in Adversarial Settings. November 2015.
|
| 340 |
+
|
| 341 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 342 |
+
|
| 343 |
+
Flavien Prost, Nithum Thain, and Tolga Bolukbasi. Debiasing embeddings for reduced gender bias in text classification. arXiv preprint arXiv:1908.02810, 2019.
|
| 344 |
+
|
| 345 |
+
Ya’acov Ritov, Yuekai Sun, and Ruofei Zhao. On conditional parity as a notion of nondiscrimination in machine learning. arXiv:1706.08519 [cs, stat], June 2017.
|
| 346 |
+
|
| 347 |
+
Soroosh Shafieezadeh-Abadeh, Peyman Mohajerin Esfahani, and Daniel Kuhn. Distributionally Robust Logistic Regression. September 2015.
|
| 348 |
+
|
| 349 |
+
Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying Some Distributional Robustness with Principled Adversarial Training. arXiv:1710.10571 [cs, stat], October 2017.
|
| 350 |
+
|
| 351 |
+
Robyn Speer. How to make a racist ai without really trying, 2017.
|
| 352 |
+
|
| 353 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. December 2013.
|
| 354 |
+
|
| 355 |
+
Hanchen Wang, Nina Grgic-Hlaca, Preethi Lahoti, Krishna P. Gummadi, and Adrian Weller. An Empirical Study on Learning Fairness Metrics for COMPAS Data with Human Supervision. arXiv:1910.10255 [cs], October 2019.
|
| 356 |
+
|
| 357 |
+
Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating Unwanted Biases with Adversarial Learning. arXiv:1801.07593 [cs], January 2018.
|
| 358 |
+
|
| 359 |
+
# A PROOFS
|
| 360 |
+
|
| 361 |
+
# A.1 PROOF OF PROPOSITION 3.1
|
| 362 |
+
|
| 363 |
+
By the duality result of Blanchet & Murthy (2016), for any $\epsilon > 0$ ,
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { r l } & { \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] } \\ & { \quad = \underset { \lambda \geq 0 } { \operatorname* { i n f } } \big \{ \lambda \epsilon + \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda } ^ { c _ { * } } ( Z , \theta ) \big ] \big \} - \lambda _ { n } \epsilon + \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { n } } ^ { c } ( Z , \theta ) \big ] } \\ & { \quad \leq \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda _ { n } } ^ { c _ { * } } ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { n } } ^ { c } ( Z , \theta ) \big ] , } \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
where $\begin{array} { r } { \lambda _ { n } \in \arg \operatorname* { m i n } _ { \lambda \geq 0 } \lambda \epsilon + \mathbb { E } _ { P _ { n } } \left[ \ell _ { \lambda } ^ { c } ( Z , \theta ) \right] } \end{array}$ . By assumption A3,
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r l } & { | \ell _ { \lambda _ { n } } ^ { c _ { * } } ( z , \theta ) - \ell _ { \lambda _ { n } } ^ { c } ( z , \theta ) | } \\ & { \quad = \bigg | \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } \ \ell ( ( x _ { 2 } , y ) , \theta ) - \lambda _ { n } c _ { * } ( ( x , y ) , ( x _ { 2 } , y ) ) - \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } \ \ell ( ( x _ { 2 } , y ) , \theta ) - \lambda _ { n } c ( ( x , y ) , ( x _ { 2 } , y ) ) \bigg | } \\ & { \quad \le \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } \ \lambda _ { n } | c _ { * } ( ( x , y ) , ( x _ { 2 } , y ) ) - c ( ( x , y ) , ( x _ { 2 } , y ) ) | } \\ & { \quad \le \lambda _ { n } \delta _ { c } \cdot D ^ { 2 } . } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
This implies
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r l } & { \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \left[ \ell ( Z , \theta ) \right] - \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \left[ \ell ( Z , \theta ) \right] } \\ & { \quad \leq \mathbb { E } _ { P _ { * } } \left[ \ell _ { \lambda _ { n } } ^ { c _ { * } } ( Z , \theta ) \right] - \mathbb { E } _ { P _ { n } } \left[ \ell _ { \lambda _ { n } } ^ { c _ { * } } ( Z , \theta ) \right] + \lambda _ { n } \delta _ { c } D ^ { 2 } . } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
This bound is crude; it is possible to obtain sharper bounds under additional assumptions on the loss and transportation cost functions. We avoid this here to keep the result as general as possible.
|
| 382 |
+
|
| 383 |
+
Similarly,
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] } \\ & { \quad \leq \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { * } } ^ { c } ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda _ { * } } ^ { c _ { * } } ( Z , \theta ) \big ] } \\ & { \quad \leq \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { * } } ^ { c _ { * } } ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda _ { * } } ^ { c _ { * } } ( Z , \theta ) \big ] + \lambda _ { * } \delta _ { c } D ^ { 2 } , } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
where $\begin{array} { r } { \lambda _ { * } \in \arg \operatorname* { m i n } _ { \lambda \geq 0 } \{ \lambda \epsilon + \mathbb { E } _ { P _ { * } } \left[ \ell _ { \lambda } ^ { c _ { * } } ( Z , \theta ) \right] \} _ { } , } \end{array}$ .
|
| 390 |
+
|
| 391 |
+
Lemma A.1 (Lee & Raginsky (2017)). Let $\tilde { \lambda } \in \arg \operatorname* { m i n } _ { \lambda \geq 0 } \lambda \epsilon + \mathbb { E } _ { P } \big [ \ell _ { \lambda } ^ { c } ( Z , \theta ) \big ]$ . As long as the function in the loss class are $L$ -Lipschitz with respect to $d _ { x }$ (see Assumption $A 2$ ), $\begin{array} { r } { \tilde { \lambda } \le \frac { L } { \sqrt { \epsilon } } } \end{array}$ .
|
| 392 |
+
|
| 393 |
+
Proof. By the optimality of $\tilde { \lambda }$ ,
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { r l } & { \tilde { \lambda } \epsilon \le \tilde { \lambda } \epsilon + \mathbb { E } _ { P } \big [ \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } \ell ( ( x _ { 2 } , Y ) , \theta ) - \tilde { \lambda } d _ { x } ( X , x _ { 2 } ) ^ { 2 } - \ell ( ( X , Y ) , \theta ) \big ] } \\ & { \quad = \tilde { \lambda } \epsilon + \mathbb { E } _ { P } \big [ \ell _ { \tilde { \lambda } } ^ { c } ( Z , \theta ) - \ell ( Z , \theta ) \big ] } \\ & { \quad \le \lambda \epsilon + \mathbb { E } _ { P } \big [ \ell _ { \lambda } ^ { c } ( Z , \theta ) - \ell ( Z , \theta ) \big ] } \\ & { \quad = \lambda \epsilon + \mathbb { E } _ { P } \big [ \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } \ell ( ( x _ { 2 } , Y ) , \theta ) - \ell ( ( X , Y ) , \theta ) - \lambda d _ { x } ( X , x _ { 2 } ) ^ { 2 } \big ] } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
for any $\lambda \geq 0$ . By Assumption A2, the right side is at most
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { \tilde { \lambda } \epsilon \leq \lambda \epsilon + \mathbb { E } _ { P } \big [ \underset { x _ { 2 } \in \mathcal { X } } { \operatorname* { s u p } } L d _ { x } ( X , x _ { 2 } ) - \lambda d _ { x } ( X , x _ { 2 } ) ^ { 2 } \big ] } \\ & { \quad \leq \lambda \epsilon + \underset { t \geq 0 } { \operatorname* { s u p } } L t - \lambda t ^ { 2 } } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
We minimize the right side WRT $t$ (set $\begin{array} { r } { t = \frac { L } { 2 \lambda } . } \end{array}$ ) and $\lambda$ (set $\begin{array} { r } { \lambda = \frac { L } { 2 \sqrt { \epsilon } } \rangle } \end{array}$ ) to obtain $\tilde { \lambda } \epsilon \leq L \sqrt { \epsilon }$
|
| 406 |
+
|
| 407 |
+
By Lemma A.1, we have
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\begin{array} { r l } & { \displaystyle \operatorname* { s u p } _ { { \boldsymbol { \Sigma } } : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , { \boldsymbol { \theta } } ) \big ] - \operatorname* { s u p } _ { P : W ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , { \boldsymbol { \theta } } ) \big ] \leq \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda _ { n } } ^ { c _ { * } } ( Z , { \boldsymbol { \theta } } ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { n } } ^ { c _ { * } } ( Z , { \boldsymbol { \theta } } ) \big ] + \frac { L \delta _ { c } L } { \sqrt { \epsilon } } } \\ & { \displaystyle \operatorname* { s u p } _ { { \boldsymbol { \Sigma } } : W ( P , P _ { n } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , { \boldsymbol { \theta } } ) \big ] - \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , { \boldsymbol { \theta } } ) \big ] \leq \mathbb { E } _ { P _ { n } } \big [ \ell _ { \lambda _ { * } } ^ { c _ { * } } ( Z , { \boldsymbol { \theta } } ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell _ { \lambda _ { * } } ^ { c _ { * } } ( Z , { \boldsymbol { \theta } } ) \big ] + \frac { L \delta _ { c } D } { \sqrt { \epsilon } } } \end{array}
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
We combine the preceding bounds to obtain
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { r l } & { \bigg | \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] \bigg | } \\ & { \quad \leq \underset { f \in \mathcal { L } ^ { c _ { * } } } { \operatorname* { s u p } } \big | \int _ { \mathcal { Z } } f ( z ) d ( P _ { n } - P _ { * } ) ( z ) \big | + \frac { L \delta _ { c } D ^ { 2 } } { \sqrt { \epsilon } } , } \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
where $\begin{array} { r } { \mathcal { L } ^ { c _ { * } } = \{ \ell _ { \lambda } ^ { c _ { * } } ( \cdot , \theta ) : \lambda \in [ 0 , \frac { L } { \sqrt { \epsilon } } ] , \theta \in \Theta \} } \end{array}$ is the DR loss class. In the rest of the proof, we bound $\begin{array} { r } { \operatorname* { s u p } _ { f \in \mathcal { L } ^ { c _ { * } } } \big | \int _ { \mathcal { Z } } f ( z ) d ( P _ { * } - \dot { P _ { n } } ) ( z ) \big | } \end{array}$ with standard techniques from statistical learning theory. Assumption A2 implies the functions in $\scriptstyle { \dot { \mathcal { F } } }$ are bounded:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
0 \leq \ell ( ( x _ { 1 } , y _ { 1 } ) , \theta ) - \underline { { \lambda d _ { \sigma } ( \alpha _ { \hat { \operatorname { T } } } , \mathcal { X } _ { 1 } ) } } \leq \ell _ { \lambda } ^ { c } ( z _ { 1 } , \theta ) \leq \operatorname* { s u p } _ { x _ { 2 } \in \mathcal { X } } \ell ( ( x _ { 2 } , y _ { 1 } ) , \theta ) \leq M .
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
This implies has bounded differences, so $\delta _ { n }$ concentrates sharply around its expectation. By the bounded-differences inequality and a symmetrization argument,
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\operatorname* { s u p } _ { f \in { \mathcal { L } } ^ { c _ { * } } } \big | \int _ { { \mathcal { Z } } } f ( z ) d \bigl ( P _ { n } - P _ { * } \bigr ) ( z ) \big | \leq 2 \Re _ { n } ( { \mathcal { L } } ^ { c _ { * } } ) + M ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } }
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
WP at least $1 - t$ , where $\Re _ { n } ( \mathcal { F } )$ is the Rademacher complexity of $\mathcal { F }$ :
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\Re _ { n } ( { \mathcal { F } } ) = \mathbb { E } { \left[ \operatorname* { s u p } _ { f \in { \mathcal { F } } } { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( Z _ { i } ) \right] } .
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
Lemma A.2. The Rademacher complexity of the DR loss class is at most
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\Re _ { n } ( \mathcal { L } ^ { c } ) \leq \frac { 2 4 \mathfrak { C } ( \mathcal { L } ) } { \sqrt { n } } + \frac { 2 4 L D ^ { 2 } } { \sqrt { n \epsilon } } .
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Proof. process r complexity of is sub-Gaussia $\mathcal { L } ^ { c }$ , we first show that the RT to a pseudometric. $\mathcal { L } ^ { c }$ -iet cherand $\begin{array} { r } { X _ { f } \triangleq \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( Z _ { i } ) } \end{array}$ $f _ { 1 } = \ell _ { \lambda _ { 1 } } ^ { c } ( \cdot , \theta _ { 1 } )$ $f _ { 2 } = \ell _ { \lambda _ { 2 } } ^ { c } ( \cdot , \theta _ { 2 } )$ . Define
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
d _ { \mathscr { L } ^ { c } } ( f _ { 1 } , f _ { 2 } ) \triangleq \| \ell ( \cdot , \theta _ { 1 } ) - \ell ( \cdot , \theta _ { 2 } ) \| _ { \infty } + D ^ { 2 } | \lambda _ { 1 } - \lambda _ { 2 } | .
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
We check that $X _ { f }$ is sub-Gaussian WRT $d _ { \mathcal { L } ^ { c } }$ :
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r l } & { \mathbb { E } \Big [ \exp ( t ( X _ { f _ { 1 } } - X _ { f _ { 2 } } ) ) \Big ] } \\ & { \quad = \mathbb { E } \Big [ \exp \Big ( \displaystyle \frac { l } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } \big ( \mathcal { E } _ { \lambda _ { 1 } } ^ { \kappa } ( Z _ { i } , \theta _ { 1 } ) - \mathcal { E } _ { \lambda _ { 2 } } ^ { \kappa } ( Z _ { \lambda } , \theta _ { 2 } ) \big ) \big ) \Big ] } \\ & { \quad = \mathbb { E } \Big [ \exp \Big ( \displaystyle \frac { l } { n } \sigma \big ( \mathcal { E } _ { \lambda _ { 1 } } ^ { \kappa } ( Z , \theta _ { 1 } ) - \mathcal { E } _ { \lambda _ { 2 } } ^ { \kappa } ( Z , \theta _ { 2 } ) \big ) \Big ) \Big ] ^ { n } } \\ & { \quad = \mathbb { E } \Big [ \exp \Big ( \displaystyle \frac { l } { n } \sigma \big ( \operatorname* { s u p } _ { \lambda = \lambda } \mathrm { ~ f ~ } \mathcal { E } ( ( x _ { 1 } , Y ) , \theta _ { 1 } ) - \lambda _ { 1 } d _ { x } ( x _ { 1 } , X ) ^ { 2 } - \ell ( ( x _ { 2 } , Y ) , \theta _ { 2 } ) + \lambda _ { 2 } d _ { x } ( X , x _ { 2 } ) ^ { 2 } ) ) \big ) \Big ] } \\ & { \quad = \mathbb { E } \Big [ \exp \Big ( \displaystyle \frac { l } { n } \sigma \big ( \operatorname* { s u p } _ { \lambda = \lambda } \mathcal { E } ( ( x _ { 1 } , Y ) , \theta _ { 1 } ) - \ell ( ( x _ { 1 } , Y ) , \theta _ { 2 } ) + ( \lambda _ { 2 } - \lambda _ { 1 } ) d _ { x } ( x _ { 1 } , X ) ^ { 2 } ) ) \big ) \Big ] ^ { n } } \\ & { \quad \le \exp \Big ( \displaystyle \frac { 1 } { n } \sigma \big ( \mathcal { E } _ { \lambda _ { 1 } } ^ { \kappa } ( x _ { 2 } ( \theta _ { 1 } , Y _ { 2 } ) ) . } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Let $N ( \mathcal { L } ^ { c } , d _ { \mathcal { L } ^ { c } } , \epsilon )$ be the $\epsilon$ -covering number of $( \mathcal { L } ^ { c } , d _ { \mathcal { L } ^ { c } } )$ . We observe
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r } { N ( \mathcal { L } ^ { c } , d _ { \mathcal { L } ^ { c } } , \epsilon ) \leq N ( \mathcal { L } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) \cdot N ( [ 0 , \frac { L } { \sqrt { \epsilon } } ] , | \cdot | , \frac { \epsilon } { 2 D ^ { 2 } } ) } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
By Dudley’s entropy integral,
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { l } { \displaystyle \mathfrak { R } _ { n } ( \mathcal { L } ^ { c } ) \leq \frac { 1 2 } { \sqrt { n } } \int _ { 0 } ^ { \infty } \log N ( \mathcal { L } ^ { c } , d _ { \mathcal { L } ^ { c } } , \epsilon ) ^ { \frac { 1 } { 2 } } d \epsilon } \\ { \displaystyle \quad \quad \leq \frac { 1 2 } { \sqrt { n } } \int _ { 0 } ^ { \infty } \big ( \log N ( \mathcal { L } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) + N \big ( [ 0 , \frac { L } { \sqrt { \epsilon } } ] , | \cdot | , \frac { \epsilon } { 2 D ^ { 2 } } \big ) \big ) ^ { \frac { 1 } { 2 } } d \epsilon } \\ { \displaystyle \quad \leq \frac { 1 2 } { \sqrt { n } } \bigg ( \int _ { 0 } ^ { \infty } \log N ( \mathcal { L } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) ^ { \frac { 1 } { 2 } } d \epsilon + \int _ { 0 } ^ { \infty } N \big ( [ 0 , \frac { L } { \sqrt { \epsilon } } ] , | \cdot | , \frac { \epsilon } { 2 D ^ { 2 } } \big ) ^ { \frac { 1 } { 2 } } d \epsilon \bigg ) } \\ { \displaystyle \quad \leq \frac { 2 4 \mathfrak { C } ( \mathcal { L } ) } { \sqrt { n } } + \frac { 2 4 L D ^ { 2 } } { \sqrt { n \epsilon } } \int _ { 0 } ^ { \frac { 1 } { 2 } } \log ( \frac { 1 } { \epsilon } ) d \epsilon } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
where we recalled equation A.1 in the second step. We evalaute the integral on the right side to arrive at the stated bound: $\begin{array} { r } { \int _ { 0 } ^ { \frac { 1 } { 2 } } \log ( \frac { 1 } { \epsilon } ) d \epsilon < 1 } \end{array}$ . □
|
| 468 |
+
|
| 469 |
+
By Lemma A.2,
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\operatorname* { s u p } _ { f \in \mathcal { L } ^ { c _ { * } } } \left. \int _ { \mathcal { Z } } f ( z ) d ( P _ { n } - P _ { * } ) ( z ) \right. \leq \frac { 4 8 \mathfrak { C } ( \mathcal { L } ) } { \sqrt { n } } + \frac { 4 8 L D ^ { 2 } } { \sqrt { n \epsilon } } + M ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } ,
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
which implies
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { r l } & { \boxed { \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] } \Biggr | _ { \begin{array} { l } { \epsilon } \\ { \epsilon } \end{array} } } \\ & { \leq \frac { 4 8 \mathfrak { E } ( \mathcal { L } ) } { \sqrt { n } } + \frac { 4 8 L D ^ { 2 } } { \sqrt { n \epsilon } } + \frac { L \delta _ { c } D ^ { 2 } } { \sqrt { \epsilon } } + M ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } . } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
WP at least $1 - t$ .
|
| 482 |
+
|
| 483 |
+
# A.2 PROOFS OF PROPOSITIONS 3.2 AND 3.3
|
| 484 |
+
|
| 485 |
+
Proof of Proposition 3.2. It is enough to show
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array} { r } { \operatorname* { s u p } _ { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } \mathbb { E } _ { P } \big [ \ell ( Z , \hat { \theta } ) \big ] \leq \delta ^ { * } + 2 \delta _ { n } } \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
because the loss function is non-negative. We have
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\begin{array} { r l } { \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \hat { \theta } ) \big ] \leq \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \hat { \theta } ) \big ] + \delta _ { n } } & { } \\ { \leq \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \bar { \theta } ) \big ] + \delta _ { n } } & { } \\ { \leq \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \bar { \theta } ) \big ] + 2 \delta _ { n } } & { } \\ { \leq \delta ^ { * } + 2 \delta _ { n } . } & { } \end{array}
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
# Proof of Proposition 3.3.
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\begin{array} { r l } & { \underset { P : W _ { * } ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \left( \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ] \right) - \underset { P : W ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \left( \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] \right) } \\ & { = \underset { P : W _ { * } ( P , P _ { * } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] - \underset { P : W ( P , P _ { n } ) \leq \epsilon } { \operatorname* { s u p } } \mathbb { E } _ { P } \big [ \ell ( Z , \theta ) \big ] + \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ] } \\ & { \leq \delta _ { n } + \mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ] } \end{array}
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
The loss function is bounded, so it is possible to bound $\mathbb { E } _ { P _ { * } } \big [ \ell ( Z , \theta ) \big ] - \mathbb { E } _ { P _ { n } } \big [ \ell ( Z , \theta ) \big ]$ by standard uniform convergence results on bounded loss classes.
|
| 504 |
+
|
| 505 |
+
# B DATA-DRIVEN FAIR METRICS
|
| 506 |
+
|
| 507 |
+
# B.1 LEARNING THE FAIR METRIC FROM OBSERVATIONS OF THE SENSITIVE ATTRIBUTE
|
| 508 |
+
|
| 509 |
+
Here we assume the sensitive attribute is discrete and is observed for a small subset of the training data. Formally, we assume this subset of the training data has the form $\{ ( X _ { i } , K _ { i } , Y _ { i } ) \}$ , where $K _ { i }$ is the sensitive attribute of the $i$ -th subject. To learn the sensitive subspace, we fit a softmax regression model to the data
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
\mathbb { P } ( K _ { i } = l \mid \boldsymbol { X } _ { i } ) = \frac { \mathsf { e x p } ( a _ { l } ^ { T } \boldsymbol { X } _ { i } + b _ { l } ) } { \sum _ { l = 1 } ^ { k } \mathsf { e x p } ( a _ { l } ^ { T } \boldsymbol { X } _ { i } + b _ { l } ) } , l = 1 , \ldots , k ,
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
and take the span of $A = \left[ a _ { 1 } \ldots a _ { k } \right]$ as the sensitive subspace to define the fair metric as
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
d _ { x } ( x _ { 1 } , x _ { 2 } ) ^ { 2 } = ( x _ { 1 } - x _ { 2 } ) ^ { T } ( I - P _ { \mathsf { r a n } ( A ) } ) ( x _ { 1 } - x _ { 2 } ) .
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
This approach readily generalizes to sensitive attributes that are not discrete-valued: replace the softmax model by an appropriate generalized linear model.
|
| 522 |
+
|
| 523 |
+
In many applications, the sensitive attribute is part of a user’s demographic information, so it may not be available due to privacy restrictions. This does not preclude the proposed approach because the sensitive attribute is only needed to learn the fair metric and is neither needed to train the classifier nor at test time.
|
| 524 |
+
|
| 525 |
+
# B.2 LEARNING THE FAIR METRIC FROM COMPARABLE SAMPLES
|
| 526 |
+
|
| 527 |
+
In this section, we consider the task of learning a fair metric from supervision in a form of comparable samples. This type of supervision has been considered in the literature on debiasing learned representations. For example, method of Bolukbasi et al. (2016) for removing gender bias in word embeddings relies on sets of words whose embeddings mainly vary in a gender subspace (e.g. (king, queen)).
|
| 528 |
+
|
| 529 |
+
To keep things simple, we focus on learning a generalized Mahalanobis distance
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
d _ { x } ( x _ { 1 } , x _ { 2 } ) = ( \varphi ( x _ { 1 } ) - \varphi ( x _ { 2 } ) ) ^ { T } { \widehat \Sigma } ( \varphi ( x _ { 1 } ) - \varphi ( x _ { 2 } ) ) ^ { \frac { 1 } { 2 } } ,
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
where $\varphi ( \boldsymbol { x } ) : \boldsymbol { \mathcal { X } } \mathbf { R } ^ { d }$ is a known feature map and $\widehat { \Sigma } \in \mathbf { S } _ { + } ^ { d \times d }$ is a covariance matrix. Our approach is based on a factor model
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\varphi _ { i } = A _ { * } u _ { i } + B _ { * } v _ { i } + \epsilon _ { i } ,
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
where $\varphi _ { i } ~ \in \textbf { R } ^ { d }$ is the learned representation of $x _ { i }$ , $u _ { i } \in \mathbf { R } ^ { K }$ (resp. $v _ { i } \in \mathbf { R } ^ { L }$ ) is the sensitive/irrelevant (resp. relevant) attributes of $x _ { i }$ to the task at hand, and $\epsilon _ { i }$ is an error term. For example, in Bolukbasi et al. (2016), the learned representations are the embeddings of words in the vocabulary, and the sensitive attribute is the gender bias of the words. The sensitive and relevant attributes are generally unobserved.
|
| 542 |
+
|
| 543 |
+
Recall our goal is to obtain $\widehat { \Sigma }$ so that equation B.2 is small whenever $v _ { 1 } \approx v _ { 2 }$ . One possible choice of $\widehat { \Sigma }$ is the projection matrix onto the orthogonal complement of $\mathsf { r a n } ( A )$ , which we denote by $P _ { \mathsf { r a n } ( A ) }$ . bIndeed,
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\begin{array} { r } { d _ { x } ( x _ { 1 } , x _ { 2 } ) ^ { 2 } = ( \varphi _ { 1 } - \varphi _ { 2 } ) ^ { T } ( I - P _ { \mathrm { r a n } ( A ) } ) ( \varphi _ { 1 } - \varphi _ { 2 } ) \qquad } \\ { \approx ( v _ { 1 } - v _ { 2 } ) ^ { T } B _ { * } ^ { T } ( I - P _ { \mathrm { r a n } ( A ) } ) B _ { * } ( v _ { 1 } - v _ { 2 } ) , } \end{array}
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
which is small whenever $v _ { 1 } \approx v _ { 2 }$ . Although $\mathsf { r a n } ( A )$ is unknown, it is possible to estimate it from the learned representations and groups of comparable samples by factor analysis.
|
| 550 |
+
|
| 551 |
+
The factor model attributes variation in the learned representations to variation in the sensitive and relevant attributes. We consider two samples comparable if their relevant attributes are similar. In other words, if $\mathcal { T } \subset [ n ]$ is (the indices of) a group of comparable samples, then
|
| 552 |
+
|
| 553 |
+
$$
|
| 554 |
+
H \Phi _ { \mathcal { T } } = H U _ { \mathcal { T } } A _ { * } ^ { T } + H V _ { \mathcal { T } } B _ { * } ^ { \mathcal { F } ^ { \mathcal { F } } } \widetilde { \stackrel { \approx } { + } } H E _ { \mathcal { T } } \approx H U _ { \mathcal { T } } A _ { * } ^ { T } + H E _ { \mathcal { T } } ,
|
| 555 |
+
$$
|
| 556 |
+
|
| 557 |
+
where $\begin{array} { r } { H = I _ { | \mathcal { T } | } - \frac { 1 } { | \mathcal { T } | } 1 _ { | \mathcal { T } | } 1 _ { | \mathcal { T } | } ^ { T } } \end{array}$ is the centering or de-meaning matrix and the rows of $\Phi _ { \mathcal { T } }$ (resp. $U _ { \mathcal { I } }$ , $V _ { \mathcal { T } } ,$ ) are $\varphi _ { i }$ (resp. $u _ { i } , v _ { i } ,$ ). If this group of samples have identical relevant attributes, i.e. $V _ { \mathcal { I } } = 1 _ { | \mathcal { I } | } v ^ { T }$ for some $v$ , then $H V _ { \mathcal { I } }$ vanishes exactly. As long as $u _ { i }$ and $\epsilon _ { i }$ are uncorrelated (e.g. $\mathbb { E } \big [ u _ { i } \epsilon _ { i } ^ { T } \big ] = 0 ,$ ), equation B.5 implies
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
\mathbb { E } \big [ \Phi _ { \mathcal { T } } ^ { T } H \Phi _ { \mathcal { T } } \big ] \approx A \mathbb { E } \big [ U _ { \mathcal { T } } ^ { T } H U _ { \mathcal { T } } \big ] A ^ { T } + \mathbb { E } \big [ E _ { \mathcal { T } } ^ { T } H E _ { \mathcal { T } } \big ] ,
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
This suggests estimating $\mathsf { r a n } ( A )$ from the learned representations and groups of comparable samples by factor analysis. We summarize our approach in Algorithm 3.
|
| 564 |
+
|
| 565 |
+
# Algorithm 3 estimating $\widehat { \Sigma }$ for the fair metric
|
| 566 |
+
|
| 567 |
+
1: Input: $\{ \varphi _ { i } \} _ { i = 1 } ^ { n }$ , comparable groups $\mathcal { T } _ { 1 } , \ldots , \mathcal { T } _ { G }$
|
| 568 |
+
2: $\begin{array} { r } { \widehat { A } ^ { T } \in \arg \operatorname* { m i n } _ { W _ { g } , A } \{ \frac { 1 } { 2 } \sum _ { g = 1 } ^ { G } \| H _ { g } \Phi _ { \mathcal { T } _ { g } } - W _ { g } A ^ { T } \| _ { F } ^ { 2 } \} } \end{array}$
|
| 569 |
+
3: $Q \operatorname { q r } ( { \widehat { A } } )$
|
| 570 |
+
4: $\widehat { \Sigma } I _ { d } - Q Q ^ { T }$
|
| 571 |
+
|
| 572 |
+
. factor analysis . get orthonormal basis of ran $( \widehat { A } )$
|
| 573 |
+
|
| 574 |
+
# C SENSR IMPLEMENTATION DETAILS
|
| 575 |
+
|
| 576 |
+
This section is to accompany the implementation of the SenSR algorithm and is best understood by reading it along with the code implemented using TensorFlow.4 We discuss choices of learning rates and few specifics of the code. Words in italics correspond to variables in the code and following notation in parentheses defines corresponding name in Table 3, where we summarize all hyperparameter choices.
|
| 577 |
+
|
| 578 |
+
Handling class imbalance Datasets we study have imbalanced classes. To handle it, on every epoch $( E )$ (i.e. number of epochs) we subsample a batch size $( B )$ training samples enforcing equal number of observations per class. This procedure can be understood as data augmentation.
|
| 579 |
+
|
| 580 |
+
Perturbations specifics Our implementation of SenSR algorithm has two inner optimization problems — subspace perturbation and full perturbation (when $\epsilon > 0$ ). Subspace perturbation can be viewed as an initialization procedure for the attack. We implement both using Adam optimizer (Kingma & Ba, 2014) inside the computation graph for better efficiency, i.e. defining corresponding perturbation parameters as Variables and re-setting them to zeros after every epoch. This is in contrast with a more common strategy in the adversarial robustness implementations, where perturbations (i.e. attacks) are implemented using tf.gradients with respect to the input data defined as a Placeholder.
|
| 581 |
+
|
| 582 |
+
Learning rates As mentioned above, in addition to regular Adam optimizer for learning the parameters we invoke two more for the inner optimization problems of SenSR. We use same learning rate of 0.001 for the parameters optimizer, however different learning rates across datasets for subspace step(s) and full step $( f )$ . Two other related parameters are number of steps of the inner optimizations: subspace epoch(se) and full epoch $( f e )$ . We observed that setting subspace perturbation learning rate too small may prevent our algorithm from reducing unfairness, however setting it big does not seem to hurt. On the other hand, learning rate for full perturbation should not be set too big as it may prevent algorithm from solving the original task. Note that full perturbation learning rate should be smaller than perturbation budget $e p s ( \epsilon )$ — we always use $\epsilon / 1 0$ . In general, malfunctioning behaviors are immediately noticeable during training and can be easily corrected, therefore we did not need to use any hyperparameter optimization tools.
|
| 583 |
+
|
| 584 |
+
Table 3: SenSR hyperparameter choices in the experiments
|
| 585 |
+
|
| 586 |
+
<table><tr><td></td><td>E</td><td>B</td><td>S</td><td>se</td><td>E</td><td>f</td><td>fe</td></tr><tr><td>Sentiment</td><td>4K</td><td>1K</td><td>0.1</td><td>10</td><td>0.1</td><td>0.01</td><td>10</td></tr><tr><td>Adult</td><td>12K</td><td>1K</td><td>10</td><td>50</td><td>10-3</td><td>10-4</td><td>40</td></tr></table>
|
| 587 |
+
|
| 588 |
+
Table 4: Summary of Adult classification experiments over 10 restarts
|
| 589 |
+
|
| 590 |
+
<table><tr><td></td><td>Accuracy</td><td>B-TPR</td><td>GapG RMS</td><td>GaPR RMS</td><td>GapG max</td><td>GapR max</td></tr><tr><td>SenSR</td><td>.787±.003</td><td>.789±.003</td><td>.068±.004</td><td>.055±.003</td><td>.087±.005</td><td>.067±.004</td></tr><tr><td>Baseline</td><td>.813±.001</td><td>.829±.001</td><td>.179±.004</td><td>.089±.003</td><td>.216±.003</td><td>.105±.003</td></tr><tr><td>Project</td><td>.813±.001</td><td>.827±.001</td><td>.145±.004</td><td>.064±.003</td><td>.192±.004</td><td>.086±.004</td></tr><tr><td>Adv. Debias.</td><td>.812±.001</td><td>.815±.002</td><td>.082±.005</td><td>.070±.006</td><td>.110±.006</td><td>.078±.005</td></tr><tr><td>CoCL</td><td>1</td><td>.790</td><td>.163</td><td>.080</td><td>.201</td><td>.109</td></tr></table>
|
| 591 |
+
|
| 592 |
+
# D ADDITIONAL ADULT EXPERIMENT DETAILS
|
| 593 |
+
|
| 594 |
+
# D.1 PREPROCESSING
|
| 595 |
+
|
| 596 |
+
The continuous features in Adult are the following: age, fnlwgt, capital-gain, capital-loss, hours-per-week, and education-num. The categorical features are the following: workclass, education, marital-stataus, occupation, relationship, race, sex, native-country. See Dua & Graff (2017) for a description of each feature. We remove fnlwgt and education but keep education-num, which is a integer representation of education. We do not use native-country, but use race and sex as predictive features. We treat race as binary: individuals are either White or non-White. For every categorical feature, we use one hot encoding. For every continuous feature, we standardize, i.e., subtract the mean and divide by the standard deviation. We remove anyone with missing data leaving 45,222 individuals.
|
| 597 |
+
|
| 598 |
+
This data is imbalanced: $2 5 \%$ make at least $\$ 50\mathbf { k }$ per year. Furthermore, there is demographic imbalance with respect to race and gender as well as class imbalance on the outcome when conditioning on race or gender: $86 \%$ of individuals are white of which $26 \%$ make at least $\$ 50\mathbf { k }$ a year; $67 \%$ of individuals are male of which $31 \%$ make at least $\$ 50\mathbf { k }$ a year; $11 \%$ of females make at least $\$ 50\mathbf { k }$ a year; and $15 \%$ of non-whites make at least $\$ 50\mathbf { k }$ a year.
|
| 599 |
+
|
| 600 |
+
# D.2 FULL EXPERIMENTAL RESULTS
|
| 601 |
+
|
| 602 |
+
See Tables 4 and 5 for the full experiment results. The tables report the average and the standard error for each metric on the test set for 10 train and test splits.
|
| 603 |
+
|
| 604 |
+
# D.3 SENSITIVE SUBSPACE
|
| 605 |
+
|
| 606 |
+
To learn the hyperplane that classifies females and males, we use our implementation of regularized logistic regression with a batch size of 5k, 5k epochs, and . $1 \ell _ { 2 }$ regularization.
|
| 607 |
+
|
| 608 |
+
Table 5: Summary of individual fairness metrics in Adult classification experiments over 10 restarts
|
| 609 |
+
|
| 610 |
+
<table><tr><td></td><td>Spouse Consistency</td><td>Gender and Race Consistency</td></tr><tr><td>SenSR</td><td>.934±.012</td><td>.984±.000</td></tr><tr><td>Baseline</td><td>.848±.008</td><td>.865±.004</td></tr><tr><td>Project</td><td>.868±.005</td><td>1±0</td></tr><tr><td>Adv.Debias.</td><td>.807±.002</td><td>.841±.012</td></tr></table>
|
| 611 |
+
|
| 612 |
+
# D.4 HYPERPARAMETERS AND TRAINING
|
| 613 |
+
|
| 614 |
+
For each model, we use the same 10 train/test splits where use $80 \%$ of the data for training. Because of the class imbalance, each minibatch is sampled so that there are an equal number of training points from both the “income at least $\$ 50\mathrm { k }$ class” and the “income below $\$ 50\mathbf { k }$ class.”
|
| 615 |
+
|
| 616 |
+
# D.4.1 BASELINE, PROJECT, AND SENSR
|
| 617 |
+
|
| 618 |
+
See Table 3 for the hyperparameters we used when training Baseline, Project, and SenSR (Baseline and Project use a subset). Hyperparameters are defined in Appendix C.
|
| 619 |
+
|
| 620 |
+
# D.4.2 ADVESARIAL DEBIASING
|
| 621 |
+
|
| 622 |
+
We used Zhang et al. (2018)’s adversarial debiasing implementation in IBM’s AIF360 package (Bellamy et al., 2018) where the source code was modified so that each mini-batch is balanced with respect to the binary labels just as we did with our experiments and dropout was not used. Hyperparameters are the following: adversary loss weight $\qquad = \ . 0 0 1$ , num epochs $= 5 0 0$ , batch size $= 1 0 0 0$ , and privileged groups are defined by binary gender and binary race.
|
| 623 |
+
|
| 624 |
+
# D.5 GROUP FAIR METRICS
|
| 625 |
+
|
| 626 |
+
Let $\mathcal { C }$ be a set of classes, $A$ be a binary protected attribute and $Y , { \hat { Y } } \in { \mathcal { C } }$ be the true class label and the predicted class label. Then for $a \in \{ 0 , 1 \}$ and $c \in { \mathcal { C } }$ define $\mathrm { T P R } _ { a , c } = \mathbb { P } ( \hat { Y } = c | A = a , Y = c )$ ; $\begin{array} { r l } & { \mathrm { G a p } _ { A , c } = \mathrm { T P R } _ { 0 , c } - \mathrm { T P R } _ { 1 , c } ; \mathrm { G a p } _ { A } ^ { \mathrm { R M S } } = \sqrt { \frac { 1 } { | C | } \sum _ { c \in C } \mathrm { G a p } _ { A , c } ^ { 2 } } ; \mathrm { G a p } _ { A } ^ { \mathrm { m a x } } = \mathrm { a r g m a x } _ { c \in C } | \mathrm { G a p } _ { A , c } | } \\ & { \mathrm { B a l a n c e d ~ A c c } = \frac { 1 } { | C | } \sum _ { c \in C } \mathbb { P } ( \hat { Y } = c | Y = c ) . } \end{array}$
|
| 627 |
+
|
| 628 |
+
For Adult, we report GapRMR , ${ \mathrm { G a p } } _ { G } ^ { \mathrm { R M S } }$ , ${ \mathrm { G a p } } _ { R } ^ { \operatorname* { m a x } }$ , and ${ \mathrm { G a p } } _ { G } ^ { \mathrm { m a x } }$ where $\mathcal { C }$ is composed of the two classes that correspond to whether someone made at least $\$ 50\mathbf { k }$ , $R$ refers to race, and $G$ refers to gender.
|
md/train/BklEF3VFPB/BklEF3VFPB.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS STABLE AND COMPREHENSIVE DOMAIN ALIGNMENT: MAX-MARGIN DOMAIN-ADVERSARIAL TRAINING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Domain adaptation tackles the problem of transferring knowledge from a labelrich source domain to an unlabeled or label-scarce target domain. Recently domain-adversarial training (DAT) has shown promising capacity to learn a domaininvariant feature space by reversing the gradient propagation of a domain classifier. However, DAT is still vulnerable in several aspects including (1) training instability due to the overwhelming discriminative ability of the domain classifier in adversarial training, (2) restrictive feature-level alignment, and (3) lack of interpretability or systematic explanation of the learned feature space. In this paper, we propose a novel Max-margin Domain-Adversarial Training (MDAT) by designing an Adversarial Reconstruction Network (ARN). The proposed MDAT stabilizes the gradient reversing in ARN by replacing the domain classifier with a reconstruction network, and in this manner ARN conducts both feature-level and pixel-level domain alignment without involving extra network structures. Furthermore, ARN demonstrates strong robustness to a wide range of hyper-parameters settings, greatly alleviating the task of model selection. Extensive empirical results validate that our approach outperforms other state-of-the-art domain alignment methods. Additionally, the reconstructed target samples are visualized to interpret the domain-invariant feature space which conforms with our intuition.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks have gained great success on a wide range of tasks such as visual recognition and machine translation (LeCun et al., 2015). They usually require a large number of labeled data that can be prohibitively expensive to collect, and even with sufficient supervision their performance can still be poor when being generalized to a new environment. The problem of discrepancy between the training and testing data distribution is commonly referred to as domain shift (Shimodaira, 2000). To alleviate the effect of such shift, domain adaptation sets out to obtain a model trained in a label-rich source domain to generalize well in an unlabeled target domain. Domain adaptation has benefited various applications in many practical scenarios, including but not limited to object detection under challenging conditions (Chen et al., 2018), cost-effective learning using only synthetic data to generalize to real-world imagery (Vazquez et al., 2013), etc.
|
| 12 |
+
|
| 13 |
+
Prevailing methods for unsupervised domain adaptation (UDA) are mostly based on domain alignment which aims to learn domain-invariant features by reducing the distribution discrepancy between the source and target domain using some pre-defined metrics such as maximum mean discrepancy (Tzeng et al., 2014). Recently, Ganin & Lempitsky (2015) proposed to achieve domain alignment by domainadversarial training (DAT) that reverses the gradients of a domain classifier to maximize domain confusion. Having yielded remarkable performance gain, DAT was employed in many subsequent UDA methods (Long et al., 2018; Shu et al., 2018). Even so, there still exist three critical issues of DAT that hinder its performance: (1) as the domain classifier has high-capacity to discriminate two domains, the unbalanced adversarial training cannot continuously provide effective gradients, which is usually overcome by manually adjusting the weights of adversarial training according to specific tasks; (2) DAT-based methods cannot deal with pixel-level domain shift (Hoffman et al., 2018); (3) the domain-invariant features learned by DAT are only based on intuition but difficult to interpret, which impedes the investigation of the underlying mechanism of adversarial domain adaptation.
|
| 14 |
+
|
| 15 |
+
To overcome the aforementioned difficulties, we propose an innovative DAT approach, namely Max-margin Domain-Adversarial Training (MDAT), to realize stable and comprehensive domain alignment. To demonstrate its effectiveness, we develop an Adversarial Reconstruction Network (ARN) that only utilizes MDAT for UDA. Specifically, ARN consists of a shared feature extractor, a label predictor, and a reconstruction network (i.e. decoder) that serves as a domain classifier. Supervised learning is conducted on source domain, and MDAT helps learn domain-invariant features. In MDAT, the decoder only focuses on reconstructing samples on source domain and pushing the target domain away from a margin, while the feature extractor aims to fool the decoder by learning to reconstruct samples on target domain. In this way, three critical issues can be solved by MDAT: (1) the max-margin loss reduces the discriminative capacity of domain classifier, leading to balanced and thus stable adversarial training; (2) without involving new network structures, MDAT achieves both pixel-level and feature-level domain alignment; (3) visualizing the reconstructed samples reveals how the source and target domains are aligned. We evaluate ARN with MDAT on five visual and non-visual UDA benchmarks. It achieves significant improvement to DAT on all tasks with pixel-level or higher-level domain shift. We also observe that it is insensitive to the choices of hyperparameters and as such is favorable for replication in practice. In principle, our approach is generic and can be used to enhance any UDA methods that leverage domain alignment as an ingredient.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
Domain adaptation aims to transfer knowledge from one domain to another. Ben-David et al. (2010) provide an upper bound of the test error on the target domain in terms of the source error and the $\mathcal { H } \triangle \mathcal { H }$ -distance. As the source error is stationary for a fixed model, the goal of most UDA methods is to minimize the $\mathcal { H } \triangle \mathcal { H }$ -distance by reducing some metrics such as Maximum Mean Discrepancy (MMD) (Tzeng et al., 2014; Long et al., 2015) and CORAL (Sun & Saenko, 2016). Inspired by Generative Adversarial Networks (GAN) (Goodfellow et al., 2014), Ganin & Lempitsky (2015) proposed to learn domain-invariant features by adversarial training, which has inspired many UDA methods thereafter. Adversarial Discriminative Domain Adaptation (ADDA) tried to fool the label classifier by adversarial training but not in an end-to-end manner. CyCADA (Hoffman et al., 2018) and PixelDA (Bousmalis et al., 2017) leveraged GAN to conduct both feature-level and pixel-level domain adaptation, which yields significant improvement yet the network complexity is high.
|
| 20 |
+
|
| 21 |
+
Another line of approaches that are relevant to our method is the reconstruction network (i.e. the decoder network). The success of image-to-image translation corroborates that it helps learn pixellevel features in an unsupervised manner. In UDA, Ghifary et al. (2016) employed a decoder network for pixel-level adaptation, and Domain Separate Network (DSN) (Bousmalis et al., 2016) further leveraged multiple reconstruction networks to learn domain-specific features. These approaches treat the decoder network as an independent component that is irrelevant to domain alignment (Glorot et al., 2011). In this paper, our approach proposes to utilize the decoder network as domain classifier in MDAT which enables both feature-level and pixel-level domain alignment in a stable and straightforward fashion.
|
| 22 |
+
|
| 23 |
+
# 3 PROBLEM FORMULATION
|
| 24 |
+
|
| 25 |
+
# 3.1 PROBLEM DEFINITION AND NOTATIONS
|
| 26 |
+
|
| 27 |
+
In unsupervised domain adaptation, we assume that the model works with a labeled dataset $\mathbf { X } _ { S }$ and an unlabeled dataset $\mathbf { X } _ { T }$ . Let $\mathbf { X } _ { S } = \{ ( \mathbf { x } _ { i } ^ { s } , y _ { i } ^ { s } ) \} _ { i \in [ N _ { s } ] }$ denote the labeled dataset of $N _ { s }$ samples from the source domain, and the certain label $y _ { i } ^ { s }$ belongs to the label space $Y$ that is a finite set $( Y = 1 , 2 , . . . , K )$ . The other dataset $\mathbf { X } _ { T } = \{ \mathbf { x } _ { i } ^ { t } \} _ { i \in [ N _ { t } ] }$ has $N _ { t }$ samples from the target domain but has no labels. We further assume that two domains have different distributions, i.e. $\mathbf { x } _ { i } ^ { s } \sim \mathcal { D } _ { S }$ and $\mathbf { x } _ { i } ^ { t } \sim \mathcal { D } _ { T }$ . In other words, there exist some domain shift (Ben-David et al., 2010) between $\mathcal { D } _ { S }$ and $\mathcal { D } _ { T }$ . The ultimate goal is to learn a model that can predict the label $y _ { i } ^ { t }$ given the target input $\mathbf { x } _ { i } ^ { t }$ .
|
| 28 |
+
|
| 29 |
+
# 3.2 IMBALANCED MINIMAX GAME IN DOMAIN-ADVERSARIAL TRAINING
|
| 30 |
+
|
| 31 |
+
To achieve domain alignment, Domain-Adversarial Training (DAT) is a minimax game between a shared feature extractor $F$ for two domains and a domain classifier $D$ . The domain classifier is
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: The proposed architecture is composed of a shared feature extractor $G _ { e }$ for two domains, a label predictor $G _ { y }$ and a reconstruction network $G _ { r }$ . In addition to the basic supervised learning in the source domain, our adversarial reconstruction training enables the extractor $G _ { e }$ to learn domain-invariant features. Specifically, the network $G _ { r }$ aims to reconstruct the source samples $x ^ { s }$ and to impede the reconstruction of the target samples $x ^ { t }$ , while the extractor $G _ { e }$ tries to fool the reconstruction network in order to reconstruct the target samples $x ^ { t }$ .
|
| 35 |
+
|
| 36 |
+
trained to determine whether the input sample belongs to the source or the target domain while the feature extractor learns to deceive the domain classifier, which is formulated as:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\operatorname* { m i n } _ { F } \operatorname* { m a x } _ { D } \mathcal { L } _ { D A T } ( D _ { s } , D _ { t } ) = \mathbb { E } _ { x \sim D _ { s } } [ \ln F ( x ) ] + \mathbb { E } _ { x \sim D _ { t } } [ \ln \left( 1 - D ( F ( x ) ) \right) ] .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
In DAT, we usually utilize CNN as the feature extractor and fully connected layers (FC) as the domain classifier. DAT reduces the cross-domain discrepancy, achieving significant performance improvement for UDA. Nevertheless, the training of DAT is rather unstable. Without sophisticated tuning of the hyper-parameters, DAT cannot reach the convergence. Through empirical experiments, we observe that such instability is due to the imbalanced minimax game. The binary domain classifier $D$ can easily achieve convergence with very high accuracy at an early training epoch, while it is much harder for the feature extractor $F$ to fool the domain classifier and to simultaneously perform well on the source domain. In this sense, the domain classifier dominates DAT, and the only solution is to palliate the training of $D$ by tuning the hyper-parameters according to different tasks. In our method, we restrict the capacity of the domain classifier so as to form a minimax game in a harmonious manner. Inspired by the max-margin loss in Support Vector Machine (SVM) (Cristianini et al., 2000) (i.e. hinge loss), if we push the source domain and the target domain away from a margin rather than as far as possible, then the training task of $F$ to fool $D$ becomes easier. For a binary domain classifier, we define the margin loss as
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathcal { L } _ { m a r g i n } ( y ) = [ 0 , m - t \cdot y ] ^ { + } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $y$ is the predicted domain label, $[ \cdot ] ^ { + } : = m a x ( 0 , \cdot )$ , $m$ is a positive margin and $t$ is the ground truth label for two domains $t = - 1$ for the source domain and $t = 1$ for the target domain). Then we introduce our MDAT scheme based on an innovative network architecture.
|
| 49 |
+
|
| 50 |
+
# 3.3 MAX-MARGIN DOMAIN-ADVERSARIAL TRAINING
|
| 51 |
+
|
| 52 |
+
Besides the training instability issue, DAT also suffers from restrictive feature-level alignment – lack of pixel-level alignment. To realize stable and comprehensive domain alignment together, we first propose an Adversarial Reconstruction Network (ARN) and then elaborate MDAT.
|
| 53 |
+
|
| 54 |
+
As depicted in Figure 1, our model consists of three parts including a shared feature extractor $G _ { e }$ for both domains, a label predictor $G _ { y }$ and a reconstruction network $G _ { r }$ . Let the feature extractor $G _ { e } ( \mathbf { x } ; \theta _ { e } )$ be a function parameterized by $\theta _ { e }$ which maps an input sample $\mathbf { X }$ to a deep embedding z. Let the label predictor $G _ { y } ( \pmb { z } ; \theta _ { y } )$ be a task-specific function parameterized by $\theta _ { y }$ which maps an embedding $\mathbf { z }$ to a task-specific prediction $\hat { y }$ . The reconstruction network $G _ { r } ( \pmb { z } ; \bar { \theta } _ { r } )$ is a decoding function parameterized by $\theta _ { r }$ that maps an embedding $\mathbf { z }$ to its corresponding reconstruction $\hat { \bf x }$ .
|
| 55 |
+
|
| 56 |
+
The first learning objective for the feature extractor $G _ { e }$ and label predictor $G _ { y }$ is to perform well in the source domain. For a supervised $\mathrm { K }$ -way classification problem, it is simply achieved by minimizing the negative log-likelihood of the ground truth class for each sample:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathcal { L } _ { t a s k } = \sum _ { i = 1 } ^ { N _ { s } } \mathcal { L } _ { y } ( \mathbf { x } _ { i } ^ { s } , \mathbf { y } _ { i } ^ { s } ) = - \sum _ { i = 1 } ^ { N _ { s } } \mathbf { y } _ { i } ^ { s } \cdot \log G _ { y } ( G _ { e } ( \mathbf { x } _ { i } ^ { s } ; \boldsymbol { \theta } _ { e } ) ; \boldsymbol { \theta } _ { y } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\mathbf { y } _ { i } ^ { s }$ is the one-hot encoding of the class label $y _ { i } ^ { s }$ and the logarithm operation is conducted on the softmax predictions of the model.
|
| 63 |
+
|
| 64 |
+
The second objective is to render the feature learning to be domain-invariant. This is motivated by the covariate shift assumption (Shimodaira, 2000) that indicates if the feature distributions $\dot { S } ( \mathbf { z } ) = \{ G _ { e } ( \mathbf { x } ; \theta _ { e } ) | \mathbf { \bar { x } } \sim \mathcal { D } _ { S } \}$ and $T ( \mathbf { z } ) = \{ G _ { e } ( \mathbf { x } ; \boldsymbol { \theta } _ { e } ) | \mathbf { x } \sim \mathcal { D } _ { T } \}$ are similar, the source label predictor $G _ { y }$ can achieve a similar high accuracy in the target domain. To this end, we design a decoder network $G _ { r }$ that serves as a domain classifier, and then MDAT could be applied for stable training. Different from the normal binary domain classifier, MDAT lets the decoder network $G _ { r }$ only reconstruct the features in the source domain and push the features in the target domain away from a margin $m$ . In this way, the decoder has the functionality of distinguishing the source domain from the target domain. The objective of training $G _ { r }$ is formulated as
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\operatorname* { m i n } _ { \theta _ { r } } \sum _ { i = 1 } ^ { N _ { s } + N _ { t } } \mathcal { L } _ { m a r g i n } ( \mathcal { L } _ { r } ( \mathbf { x } _ { i } ) ) = \operatorname* { m i n } _ { \theta _ { r } } \sum _ { i = 1 } ^ { N _ { s } } \mathcal { L } _ { r } ( \mathbf { x } _ { i } ^ { s } ) + \sum _ { j = 1 } ^ { N _ { t } } [ m - \mathcal { L } _ { r } ( \mathbf { x } _ { j } ^ { t } ) ] ^ { + } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $m$ is a positive margin and $\textstyle { \mathcal { L } } _ { r } ( \cdot )$ is the mean squared error (MSE) term for the reconstruction loss that is defined as
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathcal { L } _ { r } ( \mathbf { x } ) = | | G _ { r } ( G _ { e } ( \mathbf { x } ; \boldsymbol { \theta } _ { e } ) ; \boldsymbol { \theta } _ { r } ) - \mathbf { x } | | _ { 2 } ^ { 2 } ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $| | \cdot | | _ { 2 } ^ { 2 }$ denotes the squared $L _ { 2 }$ -norm.
|
| 77 |
+
|
| 78 |
+
Oppositely, to form a minimax game, the feature extractor $G _ { e }$ learns to deceive $G _ { r }$ such that the learned target features are indistinguishable to the source ones, which is formulated by:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { m i n } _ { \theta _ { e } } \sum _ { j = 1 } ^ { N _ { t } } \mathcal { L } _ { r } ( \mathbf { x } _ { j } ^ { t } ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Then the whole learning procedure of ARN with MDAT can be formulated by:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { l } { { \displaystyle \operatorname* { m i n } _ { \theta _ { e } , \theta _ { c } } \sum _ { i = 1 } ^ { N _ { s } } } \mathcal { L } _ { y } ( \mathbf { x } _ { i } ^ { s } , \mathbf { y } _ { i } ^ { s } ) + \alpha \sum _ { j = 1 } ^ { N _ { t } } \mathcal { L } _ { r } ( \mathbf { x } _ { j } ^ { t } ) , \ ~ } \\ { { \displaystyle \operatorname* { m i n } _ { \theta _ { r } } \sum _ { i = 1 } ^ { N _ { s } } } \mathcal { L } _ { r } ( \mathbf { x } _ { i } ^ { s } ) + \sum _ { j = 1 } ^ { N _ { t } } [ m - \mathcal { L } _ { r } ( \mathbf { x } _ { j } ^ { t } ) ] ^ { + } , \ ~ } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\mathcal { L } _ { y }$ denotes the negative log-likelihood of the ground truth class for labeled sample $\left( \mathbf { x } _ { i } ^ { s } , \mathbf { y } _ { i } ^ { s } \right)$ and $\alpha$ controls the interaction of the loss terms. In the following section, we provide theoretical justifications on how MDAT reduces the distribution discrepancy, and discuss why it is superior to the classic DAT.
|
| 91 |
+
|
| 92 |
+
# 3.4 THEORETICAL JUSTIFICATIONS
|
| 93 |
+
|
| 94 |
+
In this section, we provide the theoretical justifications on how the proposed method reduces the distribution discrepancy for UDA. The rationale behind domain alignment is motivated from the learning theory of non-conservative domain adaptation problem by Ben-David et al. (Ben-David et al., 2010):
|
| 95 |
+
|
| 96 |
+
Theorem 3.1 Let $\mathcal { H }$ be the hypothesis space where $h \in \mathcal H$ . Let $( \mathcal { D } _ { S } , \epsilon _ { s } )$ and $( \mathcal { D } _ { T } , \epsilon _ { t } )$ be the two domains and their corresponding generalization error functions. The expected error for the target domain is upper bounded by
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\epsilon _ { t } ( h ) \leq \epsilon _ { s } ( h ) + \frac { 1 } { 2 } d _ { \mathscr { H } \triangle \mathscr { H } } ( \mathscr { D } _ { S } , \mathscr { D } _ { T } ) + \lambda , \forall h \in \mathscr { H } ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $\begin{array} { r } { d _ { \mathcal { H } \triangle \mathcal { H } } ( \mathcal { D } _ { S } , \mathcal { D } _ { T } ) = 2 \operatorname* { s u p } _ { h _ { 1 } , h _ { 2 } \in \mathcal { H } } \big | \operatorname* { P r } _ { x \sim \mathcal { D } _ { S } } [ h _ { 1 } ( x ) \neq h _ { 2 } ( x ) ] - \operatorname* { P r } _ { x \sim \mathcal { D } _ { T } } [ h _ { 1 } ( x ) \neq h _ { 2 } ( x ) ] \big | } \end{array}$ and $\lambda = \mathrm { m i n } _ { h } [ \epsilon _ { s } ( h ) + \epsilon _ { t } ( h ) ]$ .
|
| 103 |
+
|
| 104 |
+
Theoretically, when we minimize the $\mathcal { H } \triangle \mathcal { H }$ -distance, the upper bound of the expected error for the target domain is reduced accordingly. As derived in DAT (Ganin $\&$ Lempitsky, 2015), assuming a family of domain classifiers $\mathcal { H } _ { d }$ to be rich enough to contain the symmetric difference hypothesis set of $\mathcal { H } _ { p }$ , such that $\mathcal { H } _ { p } \triangle \mathcal { H } _ { p } = \{ h | h = h _ { 1 } \oplus \bar { h } _ { 2 } , h _ { 1 } , h _ { 2 } \in \mathcal { H } _ { p } \}$ where $\oplus$ is XOR-function, the empirical $\mathcal { H } _ { p } \triangle \mathcal { H } _ { p }$ -distance has an upper bound with regard to the optimal domain classifier $h$ :
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
d _ { \mathcal H _ { p } \triangle \mathcal H _ { p } } ( \hat { D } _ { S } , \hat { D } _ { T } ) \le 2 \operatorname* { s u p } _ { h \in \mathcal H _ { d } } \vert \operatorname* { P r } _ { \mathbf z \sim \hat { D } _ { S } } [ h ( \mathbf z ) = 0 ] + \operatorname* { P r } _ { \mathbf z \sim \hat { D } _ { T } } [ h ( \mathbf z ) = 1 ] - 1 \vert ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\hat { \mathcal { D } } _ { S }$ and $\hat { \mathcal { D } } _ { T }$ denote the distributions of the source and target feature space ${ \mathcal { Z } } _ { S }$ and ${ \mathcal { Z } } _ { T }$ , respectively. Note that the MSE of $G _ { r }$ plus a ceiling function is a form of domain classifier $h ( \mathbf { z } )$ , i.e. $\lceil [ m - \bar { \mathcal { L } } _ { r } ( \cdot ) ] ^ { + } - 0 . 5 \rceil$ for $m = 1$ . It maps source samples to 0 and target samples to 1 which is exactly the upper bound in Eq.10. Therefore, our reconstruction network $G _ { r }$ maximizes the domain discrepancy with a margin and the feature extractor learns to minimize it oppositely.
|
| 111 |
+
|
| 112 |
+
# 3.5 DISCUSSIONS
|
| 113 |
+
|
| 114 |
+
Compared with the conventional DAT-based methods that are usually based on a binary logistic network (Ganin & Lempitsky, 2015), the proposed ARN with MDAT is more attractive and incorporates new merits conceptually and theoretically:
|
| 115 |
+
|
| 116 |
+
(1) Stable training and insensitivity to hyper-parameters. Using the decoder as domain classifier with a margin loss to restrain its overwhelming capacity in adversarial training, the minimax game can continuously provide effective gradients for training the feature extractor. Moreover, through the experiments in Section 4, we discover that our method shows strong robustness to the hyperparameters, i.e. $\alpha$ and $m$ , greatly alleviating the parameters tuning for model selection.
|
| 117 |
+
|
| 118 |
+
(2) Richer information for comprehensive domain alignment. Rather than DAT that uses a bit of domain information, MDAT utilizes the reconstruction network as the domain classifier that could capture more domain-specific and pixel-level features during the unsupervised reconstruction (Bousmalis et al., 2016). Therefore, MDAT further helps address pixel-level domain shift apart from the feature-level shift, leading to comprehensive domain alignment in a straightforward manner.
|
| 119 |
+
|
| 120 |
+
(3) Feature visualization for method validation. Another key merit of MDAT is that MDAT allows us to visualize the features directly by the reconstruction network. It is crucial to understand to what extent the features are aligned since this helps to reveal the underlying mechanism of adversarial domain adaptation. We will detail the interpretability of these adapted features in Section 4.3.
|
| 121 |
+
|
| 122 |
+
# 4 EXPERIMENT
|
| 123 |
+
|
| 124 |
+
In this section, we evaluate the proposed ARN with MDAT on a number of visual and non-visual UDA tasks with varying degrees of domain shift. We conduct ablation study to corroborate the effectiveness of MDAT and unsupervised reconstruction for UDA. Then the sensitivity of the hyperparameters is investigated, and the adapted features are interpreted via the reconstruction network in ARN.
|
| 125 |
+
|
| 126 |
+
Setup. We evaluate our method on four classic visual UDA datasets and a WiFi-based Gesture Recognition (WGR) dataset (Zou et al., 2019). The classic datasets have middle level of domain shift including MNIST (LeCun et al., 1998), USPS (Hull, 1994), Street View House Numbers (SVHN) (Netzer et al., 2011) and Synthetic Digits (SYN). For a fair comparison, we follow the same CNN architecture as DANN (Ganin & Lempitsky, 2015) while using the inverse of $G _ { e }$ as $G _ { r }$ with pooling operation replaced by upsampling. For the penalty term $\alpha$ , we choose 0.02 by searching over the grid $\lbrace 1 0 ^ { - 2 } , \dot { 1 } \rbrace$ . We also obtain the optimal margin $m = 5$ by a search over $\{ 1 0 ^ { \dot { - } 1 } , 1 0 \}$ . Then we use the same hyperparameter settings for all tasks to show the robustness. For the optimization, we simply use Adam Optimizer $( l r = 2 \times 1 0 ^ { - 4 } , \beta _ { 1 } = 0 . 5 , \beta _ { 2 } = 0 . 9 9 9 )$ and train all experiments for 50 epochs with batch size 128. We implemented our model and conducted all the experiments using the PyTorch framework. More implementation details are illustrated in the appendix.
|
| 127 |
+
|
| 128 |
+
Baselines. We evaluate the efficacy of our approach by comparing it with existing UDA methods that perform three ways of domain alignment. Specifically, MMD regularization (Long et al., 2015) and Correlation Alignment (Sun & Saenko, 2016) employ the statistical distribution matching. DRCN (Ghifary et al., 2016) and DSN (Bousmalis et al., 2016) use the reconstruction error for UDA,
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Source Target</td><td>MNIST USPS</td><td>USPS MNIST</td><td>SVHN MNIST</td><td>SYN SVHN</td></tr><tr><td>Source-Only model</td><td>78.2</td><td>63.4</td><td>54.9</td><td>86.7</td></tr><tr><td>Train on target</td><td>96.5</td><td>99.4</td><td>99.4</td><td>91.3</td></tr><tr><td>[S] MMD (Long et al., 2015)</td><td>81.1</td><td>-</td><td>71.1</td><td>88.0</td></tr><tr><td>[S] CORAL (Sun & Saenko, 2016)</td><td>80.7</td><td>-</td><td>63.1</td><td>85.2</td></tr><tr><td>[R] DRCN* (Ghifary et al.,2016)</td><td>91.8</td><td>73.7</td><td>82.0</td><td>87.5</td></tr><tr><td>[R] DSN (Bousmalis et al., 2016)</td><td>91.3</td><td>-</td><td>82.7</td><td>91.2</td></tr><tr><td>[A] DANN (Ganin et al., 2016)</td><td>85.1</td><td>73.0</td><td>74.7</td><td>90.3</td></tr><tr><td>[A] ADDA (Tzeng et al., 2017)</td><td>89.4</td><td>90.1</td><td>76.0</td><td>-</td></tr><tr><td>[A] CyCADA (Hoffman et al., 2018)</td><td>95.6</td><td>96.5</td><td>90.4</td><td>-</td></tr><tr><td>[A] CADA (Zou et al., 2019)</td><td>96.4</td><td>97.0</td><td>90.9</td><td>1</td></tr><tr><td>[A] MECA (Morerio et al.,2018)</td><td>-</td><td>-</td><td>95.2</td><td>90.3</td></tr><tr><td>ARN w.0. MDAT</td><td>93.1±0.3</td><td>76.5±1.2</td><td>67.4±0.9</td><td>86.8±0.5</td></tr><tr><td>ARN with MDAT (proposed)</td><td>98.6±0.3</td><td>98.4±0.1</td><td>97.4±0.3</td><td>92.0±0.2</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 1: We compare with general, statistics-based (S), reconstruction-based $\mathbf { ( R ) }$ and adversarialbased (A) state-of-the-art approaches. We repeated each experiment for 3 times and report the average and standard deviation (std) of the test accuracy in the target domain.
|
| 133 |
+
|
| 134 |
+
while many prevailing UDA methods adopt domain-adversarial training including DANN (Ganin & Lempitsky, 2015), ADDA (Tzeng et al., 2017), MECA (Morerio et al., 2018), CyCADA (Hoffman et al., 2018) and CADA (Zou et al., 2019). For all transfer tasks, we follow the same protocol as DANN (Ganin & Lempitsky, 2015) that uses official training data split in both domains for training and evaluates the testing data split in the target domain.
|
| 135 |
+
|
| 136 |
+
# 4.1 OVERALL RESULTS
|
| 137 |
+
|
| 138 |
+
MNIST USPS. Both datasets are composed of grey-scale handwritten images with diverse stroke weights, leading to low-level domain shift. Since USPS has only 7291 training images, USPS ${ \bf { \Gamma } } \to \mathbf { M N I S T }$ is more difficult. As shown in Table 1, our method achieves state-of-the-art accuracy of $9 8 . 6 \%$ on MNIST USPS and $9 8 . 4 \%$ on USPS MNIST, which demonstrates that ARN can tackle low-level domain shift by only using ART (rather than many adversarial UDA methods that adopt other loss terms to adjust classifier boundaries or conduct style transfer).
|
| 139 |
+
|
| 140 |
+
Table 2: Comparisons on WGR.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan=1 colspan=1>SourceTarget</td><td rowspan=1 colspan=1>Room ARoom B</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Source-only[S] MMD</td><td rowspan=2 colspan=1>58.4±0.761.2±0.569.3±0.3</td></tr><tr><td rowspan=1 colspan=1>[R] DRCN</td></tr><tr><td rowspan=1 colspan=1>[A]DANN</td><td rowspan=1 colspan=1>68.2±0.2</td></tr><tr><td rowspan=1 colspan=1>[A] ADDA</td><td rowspan=1 colspan=1>71.5±0.3</td></tr><tr><td rowspan=1 colspan=1>[A] CADA</td><td rowspan=1 colspan=1>88.8±0.1</td></tr><tr><td rowspan=1 colspan=1>ARN+MDAT</td><td rowspan=1 colspan=1>91.3±0.2</td></tr></table>
|
| 143 |
+
|
| 144 |
+
SVHN MNIST and $\mathbf { S Y N } { } \mathbf { S V H N }$ . The SVHN dataset contains RGB digit images that introduce significant variations such as scale, background, embossing, rotation, slanting and even multiple digits. The SYN data consists of $5 0 k$ RGB images of varying color, background, blur and orientation. These two tasks have tremendous pixel-level domain shfit. The proposed method achieves a state-ofthe-art performance of $9 7 . 4 \%$ for $\mathbf { S V H N { \to } M N I S T }$ , far ahead of other DAT-based methods, significantly improving the classic DANN by $2 2 . 7 \%$ . Similarly, ARN with MDAT also achieves a noticeable improvement of $5 . 3 \%$ compared with the source-only model, even outperforming the supervised SVHN accuracy $9 1 . 3 \%$ .
|
| 145 |
+
|
| 146 |
+
WiFi Gesture Recognition with Distant Domains. To evaluate the proposed method on a non-visual UDA task, we applied our method to the WiFi gesture recognition dataset (Zou et al., 2019). The WiFi data of six gestures was collected in two rooms regarded as two domains. The results in Table 2 demonstrate that our approach significantly improves classification accuracy against Source-Only and DANN by $3 2 . 9 \%$ and $2 3 . 1 \%$ , respectively.
|
| 147 |
+
|
| 148 |
+
Table 3: The accuracy $( \% )$ with different hyperparameters on SVHN MNIST.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>a</td><td>0.01</td><td>0.03</td><td>0.07</td><td>0.1</td><td>0.2</td><td>0.3</td><td>0.5</td><td>1.0</td></tr><tr><td>DANN</td><td>71.1</td><td>74.1</td><td>72.7</td><td>74.1</td><td>74.7</td><td>9.6</td><td>9.7</td><td>10.3</td></tr><tr><td>ARN (m = 1)</td><td>95.7</td><td>95.9</td><td>93.3</td><td>93.2</td><td>80.1</td><td>75.3</td><td>73.1</td><td>67.5</td></tr><tr><td>m</td><td>0.1</td><td>0.3</td><td>0.5</td><td>0.7</td><td>1.0</td><td>2.0</td><td>5.0</td><td>10.0</td></tr><tr><td>ARN(α = 2e-2)</td><td>64.5</td><td>75.2</td><td>90.0</td><td>92.6</td><td>96.0</td><td>97.4</td><td>97.7</td><td>96.7</td></tr></table>
|
| 151 |
+
|
| 152 |
+
# 4.2 ABLATION STUDY AND SENSITIVITY ANALYSIS
|
| 153 |
+
|
| 154 |
+
The contribution of MDAT and image reconstruction in ARN. We design an ablation study to verify the contribution of MDAT and unsupervised reconstruction in ARN. To this end, we discard the term $\dot { \mathcal { L } } _ { r } ( \mathbf { x } ^ { t } )$ in Eq.4, and evaluate the method, denoted as ARN w.o. MDAT in Table 1. (1) Comparing ARN w.o. MDAT with source-only model, we can infer the effect of unsupervised reconstruction for UDA. It is observed that ARN w.o. MDAT improves tasks with low-level domain shift such as MNIST USPS, which conforms with our discussion that the unsupervised reconstruction is instrumental in learning low-level features. (2) Comparing ARN w.o. MDAT with the original ARN, we can infer the contribution of MDAT. Table 1 shows that the MDAT achieves an impressive marginof-improvement. For USPS MNIST and SV $\mathbf { H N } { } \mathbf { M N }$ IST, the MDAT improves ARN w.o. MDAT by around $30 \%$ . It demonstrates that MDAT which helps learn domain-invariant representations is the main reason for the tremendous improvement.
|
| 155 |
+
|
| 156 |
+
Parameter sensitivity. We investigate the effect of $\alpha$ and $m$ on S $\mathbf { \nabla } \sqrt { \mathbf { H N } } \to \mathbf { M }$ NIST. The results in Table 3 show that ARN achieves good performance as $\alpha \in [ 0 . 0 1 , 0 . 1 ]$ and even with larger $\alpha$ ARN is able to achieve convergence. In comparison, denoting $\alpha$ as the weight of adversarial loss, the DANN cannot converge when $\alpha > 0 . 2$ . For the sensitivity of $m$ , the accuracy of ARN exceeds $9 6 . 0 \%$ as $m \geq 1$ . These analyses validate that the training of ARN is not sensitive to the parameters and even in the worst cases ARN can achieve convergence.
|
| 157 |
+
|
| 158 |
+
Gradients and training procedure. We draw the training procedure with regard to loss and target accuracy in Figure 2(b) and Figure 2(a), respectively. In Figure 2(b), ARN has smoother and more effective gradients $( \mathcal { L } _ { r } )$ for all $\alpha$ , while the loss of DAT domain classifier $( \mathcal { L } _ { d } )$ gets extremely small at the beginning. This observation conforms with our intuition, which demonstrates that by restricting the capacity of domain classifier MDAT provides more effective gradients for training feature extractor, leading to a more stable training procedure. This could be further validated in Figure 2(b) where the ARN accuracy is more stable than that of DAT across training epochs.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: The training procedure with regard to loss and test accuracy. ( $\mathcal { L } _ { e } : = \mathrm { E q }$ . 6; $\mathcal { L } _ { r }$ := Eq. 4; $\mathcal { L } _ { d }$ is the domain loss of DAT (Ganin & Lempitsky, 2015); $\alpha$ is the penalty term of $\mathcal { L } _ { e }$ and $\mathcal { L } _ { d }$ .)
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>Source Images</td><td>Target Images</td><td>R-Target Images</td></tr><tr><td>MNIST→USPS</td><td>72/04149 97349665 34727121</td><td>06181328 Li;97210 10140198</td><td>618132 108:019 3</td></tr><tr><td>USPS→MNIST</td><td>01870009 z568928i 35418305</td><td>7210414a 97349665 341727121</td><td>72104197 97s41665 34727121</td></tr><tr><td>SVHN→MNIST</td><td>0103457N0 2 19 5 5259.012 1310</td><td>59069015 0740131 2413512</td><td>9101e19101115 :1061:01511 gCk ES52</td></tr><tr><td>SYN-→SVHN</td><td>14366 40570 6.75/ 65 3607 37 1236:83811 094</td><td>6s 31 140885 3 96 品 3913b8m</td><td>64040003 30296651 39)-0s81</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 4: Visualizing the source image, target images and reconstructed target images (R-Target Images) for four digit adaptation tasks.
|
| 166 |
+
|
| 167 |
+
# 4.3 VISUALIZATION AND ANALYSIS
|
| 168 |
+
|
| 169 |
+
Interpreting MDAT features via reconstructed images. One of the key advantages of ARN is that by visualizing the reconstructed target images we can infer how the features are domain-invariant. We reconstruct the MDAT features of the test data and visualize them in Table 4. It is observed that the target features are reconstructed to source-like images by the decoder $G _ { r }$ . As discussed before, intuitively, MDAT forces the target features to mimic the source features, which conforms with our visualization. Similar to image-to-image translation, this indicates that our method conducts implicit feature-to-feature translation that transfers the target features to source-like features, and hence the features become domain-invariant.
|
| 170 |
+
|
| 171 |
+
T-SNE embeddings. We analyze the performance of domain alignment for DANN (DAT) (Ganin & Lempitsky, 2015) and ARN (MDAT) by plotting T-SNE embeddings of the features $\mathbf { z }$ on the task SVHN MNIST. In Figure 3(a), the source-only model obtains diverse embeddings for each category but the domains are not aligned. In Figure 3(b), the DANN aligns two domains but the decision boundaries of the classifier are vague. In Figure 3(c), the proposed ARN effectively aligns two domains for all categories and the classifier boundaries are much clearer.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 3: T-SNE visualization on SVHN MNIST with their corresponding domain labels (red: target; blue: source) and category labels (10 classes) shown in the left and right subfigures, respectively.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION
|
| 177 |
+
|
| 178 |
+
We proposed a new domain alignment approach namely max-margin domain-adversarial training (MDAT) and a MDAT-based network for unsupervised domain adaptation. The proposed method offers effective and stable gradients for the feature learning via an adversarial game between the feature extractor and the reconstruction network. The theoretical analysis provides justifications on how it minimizes the distribution discrepancy. Extensive experiments demonstrate the effectiveness of our method and we further interpret the features by visualization that conforms with our insight. Potential evaluation on semi-supervised learning constitutes our future work.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1-2):151–175, 2010.
|
| 183 |
+
|
| 184 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Advances in Neural Information Processing Systems, pp. 343–351, 2016.
|
| 185 |
+
|
| 186 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3722–3731, 2017.
|
| 187 |
+
|
| 188 |
+
Yuhua Chen, Wen Li, Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Domain adaptive faster r-cnn for object detection in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3339–3348, 2018.
|
| 189 |
+
|
| 190 |
+
Nello Cristianini, John Shawe-Taylor, et al. An introduction to support vector machines and other kernel-based learning methods. Cambridge university press, 2000.
|
| 191 |
+
|
| 192 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1180–1189, Lille, France, 07–09 Jul 2015. PMLR.
|
| 193 |
+
|
| 194 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 195 |
+
|
| 196 |
+
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
|
| 197 |
+
|
| 198 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 513–520, 2011.
|
| 199 |
+
|
| 200 |
+
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.
|
| 201 |
+
|
| 202 |
+
Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. CyCADA: Cycle-consistent adversarial domain adaptation. In Proceedings of the 35th International Conference on Machine Learning, pp. 1989–1998, 2018.
|
| 203 |
+
|
| 204 |
+
Jonathan J. Hull. A database for handwritten text recognition research. IEEE Transactions on Pattern Analysis and Machine Intelligence, 16(5):550–554, 1994.
|
| 205 |
+
|
| 206 |
+
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.
|
| 207 |
+
|
| 208 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 209 |
+
|
| 210 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pp. 97–105, 2015.
|
| 211 |
+
|
| 212 |
+
Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. In Advances in Neural Information Processing Systems, 2018.
|
| 213 |
+
|
| 214 |
+
Pietro Morerio, Jacopo Cavazza, and Vittorio Murino. Minimal-entropy correlation alignment for unsupervised deep domain adaptation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJWechg0Z.
|
| 215 |
+
|
| 216 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, volume 2011, pp. 5, 2011.
|
| 217 |
+
|
| 218 |
+
Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of statistical planning and inference, 90(2):227–244, 2000.
|
| 219 |
+
|
| 220 |
+
Rui Shu, Hung H Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised domain adaptation. In Proc. 6th International Conference on Learning Representations, 2018.
|
| 221 |
+
|
| 222 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European Conference on Computer Vision, pp. 443–450. Springer, 2016.
|
| 223 |
+
|
| 224 |
+
Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. CoRR, abs/1412.3474, 2014. URL http://arxiv.org/ abs/1412.3474.
|
| 225 |
+
|
| 226 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Computer Vision and Pattern Recognition (CVPR), volume 1, pp. 4, 2017.
|
| 227 |
+
|
| 228 |
+
David Vazquez, Antonio M Lopez, Javier Marin, Daniel Ponsa, and David Geronimo. Virtual and real world adaptation for pedestrian detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(4):797–809, 2013.
|
| 229 |
+
|
| 230 |
+
Han Zou, Yuxun Zhou, Jianfei Yang, Huihan Liu, Hari Prasanna Das, and Costas J Spanos. Consensus adversarial domain adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5997–6004, 2019.
|
| 231 |
+
|
| 232 |
+
# APPENDIX
|
| 233 |
+
|
| 234 |
+
# IMPLEMENTATION DETAILS
|
| 235 |
+
|
| 236 |
+
Hyperparameter For all tasks, we simply use the same hyperparameters that are chosen from the sensitivity analysis. We use $\alpha = 0 . 0 2$ and $m = 5 . 0$ , and we reckon that better results can be obtained by tuning the hyperparameters for specific tasks.
|
| 237 |
+
|
| 238 |
+
Network Architecture For a fair comparison, we follow the network in DANN (Ganin & Lempitsky, 2015) for digit adaptation and simply build the reconstruction network by the inverse network of the extractor. Here we draw the network architectures in Table 5. For WiFi gesture recognition, we adopt the same architecture as CADA (Zou et al., 2019) that is a modified version of LeNet-5.
|
| 239 |
+
|
| 240 |
+
Table 5: The network architecture used in the experiments.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=1>Layer Index|</td><td rowspan=1 colspan=1>Feature Extractor</td><td rowspan=1 colspan=2>Decoder Network一Label Predictor</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=3>32 × 32 × 3 Image</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1> 5 × 5 conv. 64 ReLU</td><td rowspan=1 colspan=1>2048 dense, ReLU</td><td rowspan=1 colspan=1>10 dense, softmax</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3 × 3 max-pool, stride 2</td><td rowspan=1 colspan=1>3072 dense, ReLU</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>5 × 5 conv. 64 ReLU</td><td rowspan=1 colspan=2> 5 × 5 conv. 128 ReLU</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1> 3 × 3 max-pool, stride 2</td><td rowspan=1 colspan=1>upsample 2</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5 × 5 conv. 128 ReLU</td><td rowspan=1 colspan=1>5 × 5 conv. 64 ReLU</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1> 3072 dense,dropout, ReLU</td><td rowspan=1 colspan=1>upsample 2 一</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>2048 dense, dropout ReLU丨 5 × 5 conv. 64 ReLU</td><td rowspan=1 colspan=1>2048 dense, dropout ReLU丨 5 × 5 conv. 64 ReLU</td><td rowspan=1 colspan=1></td></tr></table>
|
| 243 |
+
|
| 244 |
+
# SENSITIVITY
|
| 245 |
+
|
| 246 |
+
We have presented all the results of the sensitivity study in Section 4.2, and now we show their detailed training procedures in Figure 4(a) and 4(b). It is observed that the accuracy increases when $\alpha$ drops or the margin $m$ increases. The reason is very simple: (1) when $\alpha$ is too large, it affects the effect of supervised training on source domain; (2) when the margin $m$ is small, the divergence between source and target domain (i.e. $\mathcal { H } \triangle \mathcal { H }$ -distance) cannot be measured well.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 4: The training procedure of ARN with different hyper-parameters.
|
| 250 |
+
|
| 251 |
+
# VISUALIZATION
|
| 252 |
+
|
| 253 |
+
Here we provide more visualization of the reconstructed images of target samples. In Figure 5, the target samples are shown in the left column while their corresponding reconstructed samples are shown in the right. We can see that for low-level domain shift such as $\mathbf { M N I S T } { } \mathbf { U S P } \mathbf { \xi }$ S, the reconstructed target samples are very source-like while preserving their original shapes and skeletons. However, for larger domain shift in Figure 5(c) and 5(d), they are reconstructed to source-like same digits but simultaneously some noises are removed. Specifically, in Figure 5(d), we can see that one target sample (SVHN) may contain more than one digits that are noises for recognition. After reconstruction, only the right digits are reconstructed. Some target samples may suffer from terrible illumination conditions but their reconstructed digits are very clear, which is amazing.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: Visualization of the target samples and their corresponding reconstructed target samples.
|
md/train/D51irFX8UOG/D51irFX8UOG.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H139Q_gAW/H139Q_gAW.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING GRAPH CONVOLUTION FILTERS FROM DATA MANIFOLD
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Convolution Neural Network (CNN) has gained tremendous success in computer vision tasks with its outstanding ability to capture the local latent features. Recently, there has been an increasing interest in extending CNNs to the general spatial domain. Although various types of graph convolution and geometric convolution methods have been proposed, their connections to traditional 2D-convolution are not well-understood. In this paper, we show that depthwise separable convolution is a path to unify the two kinds of convolution methods in one mathematical view, based on which we derive a novel Depthwise Separable Graph Convolution that subsumes existing graph convolution methods as special cases of our formulation. Experiments show that the proposed approach consistently outperforms other graph convolution and geometric convolution baselines on benchmark datasets in multiple domains.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Convolution Neural Network (CNN) (LeCun et al., 1995) has been proven to be an efficient model family in extracting hierarchical local patterns from grid-structured data, which has significantly advanced the state-of-the-art performance of a wide range of machine learning tasks, including image classification, object detection and audio recognition (LeCun et al., 2015). Recently, growing attention has been paid to dealing with data with an underlying graph/non-Euclidean structure, such as prediction tasks in sensor networks (Xingjian et al., 2015), transportation systems (Li et al., 2017), and 3D shape correspondence application in the computation graphics (Bronstein et al., 2017). How to replicate the success of CNNs for manifold-structured data remains an open challenge.
|
| 12 |
+
|
| 13 |
+
Many graph convolution and geometric convolution methods have been proposed recently. The spectral convolution methods (Bruna et al., 2013; Defferrard et al., 2016; Kipf & Welling, 2016) are the mainstream algorithm developed as the graph convolution methods. Because their theory is based on the graph Fourier analysis (Shuman et al., 2013), one of their major limitations is that in this model the knowledge learned from different graphs is not transferrable (Monti et al., 2016). Other group of approaches is geometric convolution methods, which focuses on various ways to leverage spatial information about nodes(Masci et al., 2015; Boscaini et al., 2016; Monti et al., 2016). Existing models mentioned above are either not capable of capturing spatial-wise local information as in the standard convolution, or tend to have very large parameter space and hence, are prone to overfitting. As a result, both the spectral and the geometric convolution methods have not produced the results comparable to CNNs on related tasks. Such a misalignment makes it harder to leverage the rapidly developing 2D-convolution techniques in the generic spatial domain. We note graph convolution methods are also widely used in the pure graph structure data, like citation networks and social networks (Kipf & Welling, 2016). Our paper will only focus on the data with the spatial information.
|
| 14 |
+
|
| 15 |
+
In this paper, we provide a unified view of the graph convolution and traditional 2D-convolution methods with the label propagation process (Zhu et al., 2003). It helps us better understand and compare the difference between them. Based on it, we propose a novel Depthwise Separable Graph Convolution (DSGC), which inherits the strength of depthwise separable convolution that has been extensively used in different state-of-the-art image classification frameworks including Inception Network (Szegedy et al., 2016), Xception Network (Chollet, 2016) and MobileNet (Howard et al., 2017). Compared with previous graph and geometric methods, the DSGC is more expressive and aligns closer to the depthwise separable convolution network, and shares the desirable characteristic of small parameter size as in the depthwise separable convolution. In experiments section, we evaluate the DSGC and baselines in three different machine learning tasks. The experiment results show that the performance of the proposed method is close to the standard convolution network in the image classification task on CIFAR dataset. And it outperforms previous graph convolution and geometric convolution methods in all tasks. Furthermore, we demonstrate that the proposed method can easily leverage the advanced technique developed for the standard convolution network to enhance the model performance, such as the Inception module (Szegedy et al., 2016), the DenseNet architecture (Huang et al., 2016) and the Squeeze-and-Excitation block (Hu et al., 2017).
|
| 16 |
+
|
| 17 |
+
The main contribution of this paper is threefold:
|
| 18 |
+
|
| 19 |
+
• A unified view of traditional 2D-convolution and graph convolution methods by introducing depthwise separable convolution.
|
| 20 |
+
• A novel Depthwise Separable Graph Convolution (DSGC) for spatial domain data.
|
| 21 |
+
• We demonstrate the efficiency of the DSGC with extensive experiments and show that it can facilitate the advanced technique of the standard convolution network to improve the model performance.
|
| 22 |
+
|
| 23 |
+
# 2 A GRAPH PERSPECTIVE OF CONVOLUTION
|
| 24 |
+
|
| 25 |
+
We provide a unified view of label propagation and graph convolution by showing that they are different ways to aggregate local information over the graphs or data manifolds. We then discuss connections between graph convolution and depthwise separable convolution over the 2D-grid graph, which motivates us to propose a new formulation that subsumes both methods as special cases.
|
| 26 |
+
|
| 27 |
+
Unless otherwise specified, we denote a matrix by $\boldsymbol { X }$ , the $i$ -th row in the matrix by $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , and $( i , j )$ -th element in the matrix by $x _ { i j }$ . Superscripts are used to distinguish different matrices when necessary. All the operations being discussed below can be viewed as a function that transforms input feature maps $\pmb { X } \in \mathbb { R } ^ { N \times P }$ to output feature maps $\pmb { Y } \in \mathbb { R } ^ { N \times Q }$ , where $N$ is the number of nodes in the graph and $P , Q$ are the number of input and features (channels) associated with each node respectively. We use $\mathcal { N } ( i )$ to denote the set of neighbors for $i$ -th node.
|
| 28 |
+
|
| 29 |
+
# 2.1 LABEL PROPAGATION
|
| 30 |
+
|
| 31 |
+
Label propagation (LP) (Zhu et al., 2003) is a classic approach to aggregate local information over a graph. The basic version of LP can be written as
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
y _ { i q } = \sum _ { j \in \mathcal { N } ( i ) } w _ { i j } x _ { j q }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $W$ is a normalized adjacency matrix that summarizes the graph structure. The intuition is that the value of node $i$ is updated via a weighted combination of its neighbors.
|
| 38 |
+
|
| 39 |
+
# 2.2 GRAPH CONVOLUTION
|
| 40 |
+
|
| 41 |
+
Graph convolution (Kipf & Welling, 2016) (GC) is a recently proposed graph convolution operator that can be viewed as an extension of LP, formulated as
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
y _ { i q } = \sum _ { j \in \mathcal { N } ( i ) } w _ { i j } z _ { j q } \quad w h e r e \quad z _ { j } = U \pmb { x } _ { j }
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $W$ is a symmetrically normalized adjacency matrix with a ridge on its diagonal, which is a deterministic matrix given the input data, and $\dot { \pmb { U } } \in \mathbb { R } ^ { P \times Q }$ represents a linear transformation. Following the Chollet (2016), $W$ is named as the spatial filter and $U$ is named as the channel filter. The original form of graph convolution, such as the Spectral Network (Bruna et al., 2013), is derived from graph signal processing (Shuman et al., 2013) as a generalization of Fourier analysis to the domain of graphs. Several limitations of the Spectral Network, such as its high computation complexity and the lack of locality, are addressed in Defferrard et al. (2016) (ChebyNet) and further refined by Kipf & Welling (2016) via approximation.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Visualization of different convolution operations with three output channels. We use different colors to represent different filters (weight configurations of the links). (a) DSC defined on 2D grid graphs. (b) GC defined on generic graphs. (c) DSGC defined on generic graphs.
|
| 51 |
+
|
| 52 |
+
To Compare LP with GC, the former only utilizes the graphical information, while the latter has an additional linear transformation of $\boldsymbol { \mathscr { x } } _ { j }$ to into the intermediate representation $z _ { j }$ via matrix $U$ . This additional step makes GC capable of capturing the dependencies among features (channels), which yields performance improvement.
|
| 53 |
+
|
| 54 |
+
# 2.3 DEPTHWISE SEPARABLE CONVOLUTION
|
| 55 |
+
|
| 56 |
+
For a full 2d-convolution layer, the convolution filters encode channel correlation and spatial correlation simultaneously (Chollet, 2016). Then depthwise separable convolution (DSC) is proposed under the intuition that the channel correlation and spatial correlation could be decoupled, and has been found successful in several modern architectures for image classification (Chollet, 2016). We choose to focus on DSC (instead of full convolution) because of its strong empirical performance with a small number of parameters, and its intimate connections to GC which will be revealed in the following. And we discuss the full convolution formulation with the label propagation process in Section 5.
|
| 57 |
+
|
| 58 |
+
By viewing each pixel in the image as a node, DSC can be formulated in a graph-based fashion
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
y _ { i q } = \sum _ { j \in \mathcal { N } ( i ) } w _ { \Delta _ { i j } } ^ { ( q ) } z _ { j q } \quad w h e r e \quad z _ { j } = U x _ { j }
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\Delta _ { i j }$ denotes the relative position of pixel $i$ and pixel $j$ on the image, and $w ^ { ( q ) }$ can be viewed as a lookup table with the pixel-pixel offset $\Delta _ { i j }$ as the key, according to the stationarity (weightsharing) assumption of convolution. In the context of images, $\mathcal { N } ( i )$ denotes the index set of surrounding pixels for $i$ -th pixel, which is equivalent to the $k$ -nearest neighbor set under the Euclidean distant metric. For example, the size of $\bar { \mathcal { N } } ( i )$ , or $k$ , is 9 for a $3 \times 3$ convolution filter (considering self-loop).
|
| 65 |
+
|
| 66 |
+
# 3 PROPOSED METHOD
|
| 67 |
+
|
| 68 |
+
# 3.1 DEPTHWISE SEPARABLE GRAPH CONVOLUTION
|
| 69 |
+
|
| 70 |
+
We notice that the formulation of GC and DSC is similar except that
|
| 71 |
+
|
| 72 |
+
1. Spatial filters in DSC are channel-specific, while GC uses a global spatial filter. 2. Spatial filters in DSC are learned from the data (under the stationarity constraints), while the filter in GC is a constant matrix with the given input.
|
| 73 |
+
|
| 74 |
+
On the one hand, DSC does not apply to the domain of generic spatial data lying on the manifold where the space of $\Delta _ { i j }$ (defined as the difference of the spatial coordinates between node $i$ and node $j$ ) can be infinite. On the other hand, GC suffers from the restriction that all channels have to share the same given spatial filter. This heavily constrains the model capacity, which would be more severe when the deeper network structure is used. In the context of graphs, it would be desirable to have multiple spatial filters—to capture a diverse set of diffusion patterns over the graph or data manifold, which is the same as the convolution filters in the image domain.
|
| 75 |
+
|
| 76 |
+
To address these limitations, we propose Depthwise Separable Graph Convolution (DSGC) which naturally generalizes both GC and DSC
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
y _ { i q } = \sum _ { j \in \mathcal { N } ( i ) } w ^ { ( q ) } ( \Delta _ { i j } ) z _ { j q } \quad w h e r e \quad z _ { j } = U x _ { j }
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where we slightly abuse the notation by overloading $w ^ { ( q ) } ( \cdot )$ as a function, which maps $\Delta _ { i j }$ to a real number, and $\mathcal { N } ( i )$ still represents the $k$ -nearest neighbor sets. To understand the proposed formulation, notice
|
| 83 |
+
|
| 84 |
+
1. Different from DSC, the stationarity requirement is implemented in a “soft” manner by defining a function instead of by the set of equality constraints. In our experiment, each $w ^ { ( q ) } ( \cdot )$ is a function parameterized by a two-layer MLP.
|
| 85 |
+
2. Different from GC, channel-specific convolution is enabled by learning multiple spatial convolution filters. This amounts to simultaneously constructing multiple graphs under the different node-node similarity metrices, where the metrices are implicitly defined by neural networks and hence, are jointly optimized during the training.
|
| 86 |
+
|
| 87 |
+
Overfitting is a common issue in graph-based applications, due to limited data available. To alleviate this issue, we propose an option to group the channels into $C$ groups, where $D = Q / C$ channels in the same group would share the same filter.
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
w ^ { ( q ) } ( \cdot ) = w ^ { ( q ^ { \prime } ) } ( \cdot ) \quad i f \quad \lfloor \frac { q } { D } \rfloor = \lfloor \frac { q ^ { \prime } } { D } \rfloor
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
# 3.2 NORMALIZATION
|
| 94 |
+
|
| 95 |
+
The context of each node in any given generic graph, namely its connection pattern with neighbors, can be non-stationary over different parts of the graph, while it is constant in the 2d-grid graphs. It is, therefore, a common practice to normalize the adjacency matrix in order to make the nodes adaptive to their own contexts (Eq.1). A natural way to carry out normalization for DSGC is to apply a softmax function over the predicted spatial filter weights at each node, which can be written as $\tilde { \pmb { w } } _ { i } = s o f t m a x ( \pmb { w } _ { i } )$ , where ${ \pmb w } _ { i }$ stands for the $i$ -th row of spatial filter $W$ learned by a neural network. We empirically find normalization leads to better performance and significantly speeds up the convergence.
|
| 96 |
+
|
| 97 |
+
In the following experiments, we use the proposed depthwise separable graph convolution with a linear highway bypass as the basic convolution component and imitate the rest setting of the standard convolution neural network to solve different machine learning tasks.
|
| 98 |
+
|
| 99 |
+
# 4 EXPERIMENTS
|
| 100 |
+
|
| 101 |
+
# 4.1 EXPERIMENT SETTING
|
| 102 |
+
|
| 103 |
+
We evaluate the proposed Depthwise Separable Graph Convolution (DSGC) method with representative baselines in the prediction tasks of image classification, time series forecasting, and document categorization. The algorithms are implemented in PyTorch; all the data and the code are made publicly accessible 1. For controlled experiments, all the graph convolution methods share the same empirical settings unless otherwise specified, including network structures, the dimension of latent factors, and so on. The optimization algorithm is applied to all models. The neural network used to model the spatial convolution filter $( w ^ { ( q ) } ( \cdot ) )$ in Eq.4 is a two-layers MLP with 256 hidden dimension and tanh activation function. We have conducted ablation tests with the two-layer MLP by changing the number of layers and activation function of each hidden layer, and by trying several weight sharing strategies. The results are very similar; the two-layer MLP provides a reasonable performance with the shortest running time. Appendix A contains more details, such as the network architecture and model hyper-parameters.
|
| 104 |
+
|
| 105 |
+
# 4.2 EVALUATION ON IMAGE CLASSIFICATION
|
| 106 |
+
|
| 107 |
+
We conduct experiments on CIFAR10 and CIFAR100 (Krizhevsky & Hinton, 2009), which are popular benchmark datasets in image classification. Both sets contain 60000 images with $3 2 \times 3 2$ pixels but CIFAR10 has 10 category labels and CIFAR100 has 100 category labels. Each image is typically treated as a $3 2 \times 3 2$ grid structure for standard image-based convolution. To enable the comparison on generic graphs, we create the modified versions of CIFAR10 and CIFAR100, respectively, by subsampling only $2 5 \%$ of the pixels from each graph. As illustrated in Figure 2, the subsampling results in irregularly scattered nodes for each image.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 2: How to construct subsampled CIFAR datasets: (a) is an example image from CIFAR dataset. (b) is the subsampled pixels map. The blue points indicate which points are sampled. (c) is the image after sampling, where the black points are those being sampled out.
|
| 111 |
+
|
| 112 |
+
For comparison we include the traditional 2d convolution and graph convolution networks as baselines, including standard CNN; Xception network (Chollet, 2016) which uses the depthwise separable convolution; DCNN (Atwood & Towsley, 2016), the method using multi-hops random walk as the graph filters; ChebyNet (Defferrard et al., 2016), the method using Chebyshev polynomial to approximate the Fourier transformation of (irregular) graphs; GCN (Kipf & Welling, 2016) which is described in Section 2; MoNet (Monti et al., 2016), the method using Gaussian function to define the propagation weights over (irregular) graphs. For a fair comparison, we use the VGG13 architecture (Simonyan & Zisserman, 2014) in all the methods above as the basic platform, and replace the convolution layers according to the methods. The pooling layer is performed by the kmean clustering. The centroid of each clusters is regarded as the new node after pooling, and its hidden vector is the mean or max over the nodes in the cluster, based on the pooling method. Notice that, we only normalize the input signals to [0,1] and do not have other preprocessing or data augmentation.
|
| 113 |
+
|
| 114 |
+
The experiment results are summarized in Table 1. Firstly, we observe that Xception and CNN have the best results; this is not surprising because both methods use grid-based convolution which is naturally suitable for image recognition. Secondly, DSGC outperforms all the other graph-based convolution methods, and its performance is very close to that of the grid-based convolution methods. Furthermore, contributed by the depthwise separable convolution and sharing graph technique, our model can achieve the competitive performance without increasing the number of parameters as GCN, the one with the smallest number of parameters among the graph convolution approaches. In appendix A.4, we further report the variance of DSGC model, which shows the improvement is significant and stable.
|
| 115 |
+
|
| 116 |
+
# 4.3 EVALUATION ON TIME SERIES FORECASTING
|
| 117 |
+
|
| 118 |
+
As another important application domain, here we are interested in how to effectively utilize the locality information about sensor networks in time series forecasting. For example, how to incorporate the longitudes/latitudes of sensors w.r.t. temporal cloud movement is an important question in spatiotemporal modeling for predicting the output of solar energy farms in the United States. Appendix A provides the formal definition of this task.
|
| 119 |
+
|
| 120 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>Subsampled Graphs</td><td rowspan=1 colspan=5>Original Graphs</td></tr><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=3>CIFAR100</td><td rowspan=1 colspan=1>P</td></tr><tr><td rowspan=5 colspan=1>DCNN (Atwood & Towsley, 2016)ChebyNet (Defferrard et al., 2016)GCN (Kipf & Welling,2016)MoNet (Monti et al., 2016)DSGC</td><td rowspan=5 colspan=1>43.68%25.04%26.78%21.20%18.72%</td><td rowspan=5 colspan=1>76.65%49.44%51.30%47.87%44.33%</td><td rowspan=1 colspan=1>12M</td><td rowspan=1 colspan=1>55.56%</td><td rowspan=1 colspan=3>84.16%</td><td rowspan=1 colspan=1>50M</td></tr><tr><td rowspan=2 colspan=1>10M5.6M</td><td rowspan=2 colspan=1>12.99%19.09%</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=2>36.96%</td><td rowspan=1 colspan=1>19M</td></tr><tr><td rowspan=1 colspan=2>41.64 %</td><td rowspan=1 colspan=2>41.64 %</td><td rowspan=1 colspan=1>9.8M</td></tr><tr><td rowspan=1 colspan=1>11M</td><td rowspan=1 colspan=1>8.34%</td><td rowspan=1 colspan=3>29.56%</td><td rowspan=1 colspan=1>20M</td></tr><tr><td rowspan=1 colspan=1>5.7M</td><td rowspan=1 colspan=1>7.31%</td><td rowspan=1 colspan=3>27.29%</td><td rowspan=1 colspan=1>9.9M</td></tr><tr><td rowspan=2 colspan=1>CNN (Simonyan & Zisserman, 2014)Xception (Chollet,2016)</td><td rowspan=2 colspan=1>18.03%17.07%</td><td rowspan=2 colspan=1>43.42%41.54%</td><td rowspan=1 colspan=1>18M</td><td rowspan=1 colspan=1>6.86%</td><td rowspan=1 colspan=3>26.86%</td><td rowspan=1 colspan=1>18M</td></tr><tr><td rowspan=1 colspan=1>3.1M</td><td rowspan=1 colspan=1>7.08%</td><td rowspan=1 colspan=3>26.84%</td><td rowspan=1 colspan=1>3.1M</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 1: Test-set error rates: P is the number of parameters
|
| 123 |
+
|
| 124 |
+
We choose three publicly available benchmark datasets for this task:
|
| 125 |
+
|
| 126 |
+
• The U.S Historical Climatology Network $\mathrm { ( U S H C N ) }$ dataset contains daily climatological data from 1,218 meteorology sensors over the years from 1915 to 2000. The sequence length is 32,507. It includes five subsets, and each has a climate variable: (1) maximum temperature, (2) minimum temperature, (3) precipitation, (4) snowfall and (5) snow depth. We use the daily maximum temperature data and precipitation data, and refer them as the USHCN-TMAX and USHCN-PRCP sets, respectively.
|
| 127 |
+
• The solar power production records in the year of $2 0 0 6 ^ { 3 }$ has the data with the production rate of every 10 minutes from 1,082 solar power stations in the west of the U.S. The sequence length is 52,560. We refer this set of data as Solar.
|
| 128 |
+
|
| 129 |
+
All the datasets have been split into the training set $( 6 0 \% )$ , the validation set $( 2 0 \% )$ and the test set $( 2 0 \% )$ in chronological order.
|
| 130 |
+
|
| 131 |
+
All the graph convolution methods (DCNN, ChebyNet, GCN and MoNet) in the previous section (Section 4.2) are included to form the baselines for comparison. We also add traditional methods for time series forecasting, such as (1) Autoregressive model (AR) which predicts future signal using a window of historical data based on a linear assumption about temporal dependencies, (2) Vector autoregressive model (VAR) which extends AR to the multivariate version, namely, the input is the signals from all sensors in the history window, and (3) the LSTNet deep neural network model (Lai et al., 2017) which combines the strengths of CNN, RNN and AR. None of those methods is capable of leveraging locational dependencies via graph convolution. We exclude the CNN and Xception methods, the 2D-grid based convolution, which could not be generalized to irregular graphs which we focus here.
|
| 132 |
+
|
| 133 |
+
Table 2 summarizes the evaluation results of all the methods, where the performance is measured using the Root Square Mean Error (RMSE). The best result on each dataset is highlighted in boldface. The first chunk of three methods does not leverage the spatial or locational information in data. The second chuck consists of the neural network models which leverage the spatial information about sensor networks. The graph convolution methods in the second chunk clearly outperforms the methods in the first chunk, which does not explicitly model the spacial correlation within sensor networks. Overall, our proposed method (DSGC) has the best performance on all the datasets, demonstrating its strength in capturing informative local propagation patterns temporally and specially.
|
| 134 |
+
|
| 135 |
+
# 4.4 DOCUMENT CATEGORIZATION
|
| 136 |
+
|
| 137 |
+
For the application to text categorization we use the 20NEWS dataset (Joachims (1996)) for our experiments. It consists of 18,845 text documents associated with 20 topic labels. Individual words in the document vocabulary are the nodes in the graph for convolution. Each node also has its word embedding vector which is learned by running the Word2Vec algorithm (Mikolov et al. (2013)) on this corpus. Following the experiment settings in Defferrard et al. (2016) we select the top 1000 most frequent words as the nodes. Table 3 summarizes the results of the graph convolution methods plus three popular traditional classifiers (Linear SVM, Multivariate Naive Bayes and Softmax). DSGC has the best result on this dataset. Notice that the traditional classifiers are trained and tested with
|
| 138 |
+
|
| 139 |
+
Table 2: Time series prediction: Experiment result in terms of RMSE.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Dataset</td><td>USHCN-TMAX</td><td>USHCN-PRCP</td><td>Solar</td></tr><tr><td>AR VAR</td><td>8.2354</td><td>30.3825</td><td>0.03195</td></tr><tr><td>LSTNet (Lai et al., 2017)</td><td>17.9743 10.1973</td><td>29.2597 29.0624</td><td>0.03296 0.02865</td></tr><tr><td>DCNN (Atwood & Towsley, 2016)</td><td>6.5188</td><td>29.0424</td><td>0.02652</td></tr><tr><td>ChebyNet (Defferrard et al., 2016)</td><td>5.5823</td><td>27.1298</td><td>0.02531</td></tr><tr><td>GCN (Kipf & Welling, 2016)</td><td>5.4671</td><td>27.1172</td><td>0.02512</td></tr><tr><td>MoNet (Monti et al., 2016)</td><td>5.8263</td><td>26.8076</td><td>0.02564</td></tr><tr><td>DSGC</td><td>5.1738</td><td>25.8228</td><td>0.02453</td></tr></table>
|
| 142 |
+
|
| 143 |
+
the feature set of the top 1000 words, which is the same setting as in the graph convolution models.
|
| 144 |
+
If all words are used, traditional classifiers would have higher performance.
|
| 145 |
+
|
| 146 |
+
Table 3: Accuracy on the validation set. The results with † come from Defferrard et al. (2016).
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Accuracy</td></tr><tr><td rowspan=1 colspan=1>Linear SVM†Multinomial Naive Bayes†SoftmaxtFC2500tFC2500-FC500t</td><td rowspan=1 colspan=1>65.90%68.51%66.28%64.64%65.76%</td></tr><tr><td rowspan=1 colspan=1>DCNN (Atwood & Towsley, 2016)ChebyNet (Defferrard et al., 2016)GCN (Kipf & Welling, 2016)MoNet (Monti et al., 2016)DSGC</td><td rowspan=1 colspan=1>70.35%70.92%71.01%70.60%71.88%</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 4.5 DSGC VARIANTS WITH ADVANCED CONVOLUTION ARCHITECTURES
|
| 151 |
+
|
| 152 |
+
The proposed convolution method (DSGC) can be considered as an equivalent component to the depthwise separable convolution method. Naturally, we can leverage the technique developed for the standard convolution network to improve the DSGC framework. Hence we examine DSGC with the following techniques which are popular in recent years for standard convolution over images: (1) Inception module (Szegedy et al., 2016), (2) DenseNet framework (Huang et al., 2016) and (3) Squeeze-and-Excitation block (Hu et al., 2017). The details of those architectures are included in the Appendix A. The results are presented in Table 4. Clearly, combined with the advantageous techniques/architectures, the performance of DSGC in image classificationcan can be further improved. It demonstrates that the DSGC can easily enjoy the benefit of the traditional 2d-convolution network development.
|
| 153 |
+
|
| 154 |
+
Table 4: Summary of error rate on the test set in different settings.
|
| 155 |
+
|
| 156 |
+
<table><tr><td></td><td colspan="3">Subsampled Graphs</td><td colspan="3">Original Graphs</td></tr><tr><td>Dataset</td><td>CIFAR10</td><td>CIFAR100</td><td>P</td><td>CIFAR10</td><td>CIFAR100</td><td>P</td></tr><tr><td>DSGC-VGG13</td><td>18.72%</td><td>44.33%</td><td>5.7M</td><td>7.31%</td><td>27.29%</td><td>9.9M</td></tr><tr><td>DSGC-INCEPTION</td><td>18.27%</td><td>43.41%</td><td>9.9M</td><td>6.44%</td><td>28.55%</td><td>12M</td></tr><tr><td>DSGC-DenseNet</td><td>17.17%</td><td>43.34%</td><td>2.7M</td><td>7.14%</td><td>26.50%</td><td>2.9M</td></tr><tr><td>DSGC-SE</td><td>18.71%</td><td>44.15%</td><td>6.1M</td><td>7.00%</td><td>27.26%</td><td>10M</td></tr><tr><td>CNN</td><td>18.03%</td><td>43.42%</td><td>18M</td><td>6.86%</td><td>26.86%</td><td>18M</td></tr><tr><td>Xception</td><td>17.07%</td><td>41.54%</td><td>3.1M</td><td>7.08%</td><td>26.84%</td><td>3.1M</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 4.6 TRAINING TIME COMPARISON
|
| 159 |
+
|
| 160 |
+
In table 5, we report the mean training time per epoch for DSGC and GCN, the fastest graph convolution baseline. In DSGC, our model computes the convolution weight for each edge of the graph, which requires more computation resources. However, we always perform the graph convolution on the sparse graph, which the number of edges grows only linearly in the graph size. Therefore the training is fairly efficient. Notably, learning the convolution filters as in DSGC leads to consistently better performance over all previous methods, with around $0 . 5 \mathrm { x } - 3 \mathrm { x }$ running time.
|
| 161 |
+
|
| 162 |
+
Table 5: Training time per epoch for GCN and DSGC methods. The unit is minute.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Dataset</td><td>CIFAR</td><td>USHCN-TMAX</td><td>20news</td></tr><tr><td>GCN</td><td>1.75</td><td>0.465</td><td>0.207</td></tr><tr><td>DSGC</td><td>3.81</td><td>1.73</td><td>0.280</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 5 RELATED WORK
|
| 167 |
+
|
| 168 |
+
In this section, we will summarize the graph convolution methods proposed in recent years with the label propagation process, which reveals the difference between traditional 2D-convolution and them. Firstly, we provide the formulation of the full convolution (LeCun et al., 1995),
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
y _ { i q } = \sum _ { p = 1 } ^ { P } \sum _ { j \in \mathcal { N } ( i ) } w _ { \Delta _ { i j } } ^ { ( p q ) } x _ { j p }
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
different from the depthwise separable convolution, it captures the channel correlation and spatial correlation simultaneously by $W ^ { ( p q ) }$ , which leads to the larger number of parameters.
|
| 175 |
+
|
| 176 |
+
In Spectral Network (Bruna et al., 2013), the authors try to leverage the graph Fourier transformation as the basic convolution operation in the graph domain, which can be written as,
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
y _ { i q } = \sum _ { p = 1 } ^ { P } \sum _ { j \in \mathcal { N } ( i ) } w _ { i j } ^ { ( p q ) } x _ { j p } w h e r e W ^ { p q } = \Phi \Lambda ^ { p q } \Phi ^ { T }
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where $\Phi \in \mathbb { R } ^ { n \times n }$ contains the eigenvectors of Laplacian matrix of the graph, and $\Lambda$ is a diagonal matrix and learned by the supervision data. The Spectral Network can be matched with the full convolution, but with the different filter subspace, in other words, with different basic filters. However, it suffers from several limitations. (1) It needs to conduct eigenvector decomposition over the Laplacian Matrix, which is a very expensive operation. (2) The filters are not localized in the spatial domain. (3) The number of parameters grows linearly with the number of nodes in the graph. In order to address the previous problems, researchers try to use the Chebyshev polynomial to approximate the non-parameter filter $\Lambda$ , which is referred to as ChebyNet (Defferrard et al., 2016). It can be written as,
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
y _ { i q } = \sum _ { k = 1 } ^ { K } \sum _ { j \in \mathcal { N } ( i ) } T _ { k } ( L ) _ { i j } z _ { i q } ^ { ( k ) } \quad w h e r e \quad z _ { i } ^ { ( k ) } = U ^ { ( k ) } \pmb { x } _ { j }
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
where $T _ { k } ( L )$ is the $k$ -th order Chebyshev polynomial term. The ChebyNet can be considered as the integration of $K$ depthwise separable convolution components in a layer. But still, it suffers from the similar limitation as the GCN, which is using one graph filter over all channels and the graph filter is constant given the input. So its model capacity still cannot compare with depthwise separable convolution. With larger $K$ , the ChebyNet can approximate the non-parameter filers in the Spectral Network. However, it would require large number of parameters and face the similar limitation as the Spectral Network.
|
| 189 |
+
|
| 190 |
+
Besides the graph convolution methods, researchers propose another type of models, geometric convolution methods (Masci et al., 2015; Boscaini et al., 2016; Monti et al., 2016), to deal with data in the general spatial domain. Here, we introduce the most advanced one, MoNet (Monti et al., 2016) framework, which is also the most related one to our paper. The updating formula of MoNet in the label propagation process is,
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
y _ { i q } = \sum _ { k = 1 } ^ { K } \sum _ { j \in \mathcal { N } ( i ) } w _ { k } \mathopen { } \mathclose \bgroup \left( v ( i , j ) \aftergroup \egroup \right) z _ { j q } ^ { ( k ) } \quad w h e r e \quad z _ { j } ^ { ( k ) } = { U ^ { k } } x _ { j }
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
where $w _ { k } ( v ) = e x p ( - { \textstyle \frac { 1 } { 2 } } ( v - \mu _ { k } ) ^ { T } \Sigma _ { k } ^ { - 1 } ( v - \mu _ { k } ) )$ , and $v ( i , j )$ is a mapping from a node pair to a embedding vector, similar to $\Delta _ { i j }$ in our model. $\mu _ { k } , \Sigma _ { k }$ are both model parameters, and $\Sigma _ { k }$ is constrained as the diagonal matrix. MoNet can be viewed as an extension of the ChebyNet by letting the graph filters learn from the data. But it still has two limitations compared with the depthwise separable convolution and proposed method: (1) It uses a simple Gaussian function, which is weaker than non-parametric filter in the depthwise separable convolution, and neural network function in the proposed method. (2) It uses a graph filter for all channels. In order to capture complex propagation patterns in a layer, the model requires a larger $K$ , which leads to much larger number of parameters. And finally the experiment results show that the proposed method (DSGC) consistently outperforms the MoNet with less parameters in multiple tasks.
|
| 197 |
+
|
| 198 |
+
# 6 CONCLUSION
|
| 199 |
+
|
| 200 |
+
In this paper, we propose a novel Depthwise Separable Graph Convolution (DSGC) Network which is explicitly generalized from the depthwise separable convolution, and goes beyond to the general graph space. The extensive experiments on multi-field benchmark datasets demonstrate that our method can outperform strong baseline methods with a relatively small number of model parameters, and that it can be easily extended to leverage the advanced techniques/architectures in standard convolution networks for further improvement of the performance. In future work, we want to explore its impact on a broader range of applications, such as social networks and molecular structures by leveraging technical improvements about node/edge embedding based on graph structure information.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
|
| 205 |
+
|
| 206 |
+
Davide Boscaini, Jonathan Masci, Emanuele Rodola, and Michael Bronstein. Learning shape cor- \` respondence with anisotropic convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 3189–3197, 2016.
|
| 207 |
+
|
| 208 |
+
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.
|
| 209 |
+
|
| 210 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 211 |
+
|
| 212 |
+
Franc¸ois Chollet. Xception: Deep learning with depthwise separable convolutions. arXiv preprint arXiv:1610.02357, 2016.
|
| 213 |
+
|
| 214 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844–3852, 2016.
|
| 215 |
+
|
| 216 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 217 |
+
|
| 218 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. arXiv preprint arXiv:1709.01507, 2017.
|
| 219 |
+
|
| 220 |
+
Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016.
|
| 221 |
+
|
| 222 |
+
Thorsten Joachims. A probabilistic analysis of the rocchio algorithm with tfidf for text categorization. Technical report, Carnegie-mellon univ pittsburgh pa dept of computer science, 1996.
|
| 223 |
+
|
| 224 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 225 |
+
|
| 226 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 229 |
+
|
| 230 |
+
Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporal patterns with deep neural networks. arXiv preprint arXiv:1703.07015, 2017.
|
| 231 |
+
|
| 232 |
+
Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 233 |
+
|
| 234 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 235 |
+
|
| 236 |
+
Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Graph convolutional recurrent neural network: Data-driven traffic forecasting. arXiv preprint arXiv:1707.01926, 2017.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
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. arXiv preprint arXiv:1611.08402, 2016.
|
| 243 |
+
|
| 244 |
+
David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30(3):83–98, 2013.
|
| 245 |
+
|
| 246 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 247 |
+
|
| 248 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 249 |
+
|
| 250 |
+
SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pp. 802–810, 2015.
|
| 251 |
+
|
| 252 |
+
Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pp. 912–919, 2003.
|
| 253 |
+
|
| 254 |
+
Table 6: Neural Network architecture for CIFAR datasets. Please see the text for more details.
|
| 255 |
+
|
| 256 |
+
<table><tr><td rowspan=1 colspan=1>Layers</td><td rowspan=1 colspan=3>VGG13</td><td rowspan=1 colspan=3>DSGC-VGG13</td><td rowspan=1 colspan=3>DSGC-DenseNet</td></tr><tr><td rowspan=1 colspan=1>Convolution</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>3 ×3conv]×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=2>9-conv×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>9-conv×6</td><td rowspan=1 colspan=1>×6</td></tr><tr><td rowspan=1 colspan=1>Transition</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3>1-conv</td></tr><tr><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=3>2 × 2 max-pooling</td><td rowspan=1 colspan=6>4 max-pooling</td></tr><tr><td rowspan=1 colspan=1>Convolution</td><td rowspan=1 colspan=2>3×3 conv×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>9-convx2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=2>9-conv</td><td rowspan=1 colspan=1>×12</td></tr><tr><td rowspan=1 colspan=1>Transition</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3>1-conv</td></tr><tr><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=3>2×2 max-pooling</td><td rowspan=1 colspan=6>4 max-pooling</td></tr><tr><td rowspan=1 colspan=1>Convolution</td><td rowspan=1 colspan=2>[3×3conv]×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>9-conv]x 2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[9-conv]×24</td><td rowspan=1 colspan=1>×24</td></tr><tr><td rowspan=1 colspan=1>Transition</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3>1-conv</td></tr><tr><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=3>2 × 2 max-pooling</td><td rowspan=1 colspan=6>4 max-pooling</td></tr><tr><td rowspan=1 colspan=1>Convolution</td><td rowspan=1 colspan=2>3×3conv×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=3>9-convx2</td><td rowspan=1 colspan=3>9-conv× 16</td></tr><tr><td rowspan=1 colspan=1>Transition</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=3>1-conv</td></tr><tr><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=3>2×2 max-pooling</td><td rowspan=1 colspan=6>4 max-pooling</td></tr><tr><td rowspan=1 colspan=1>Convolution</td><td rowspan=1 colspan=2>3×3conv]×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>9-conv×2</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=3></td></tr><tr><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=3>2 ×2 max-pooling</td><td rowspan=1 colspan=6>4 max-pooling</td></tr><tr><td rowspan=1 colspan=1>Classifier</td><td rowspan=1 colspan=9>512D fully-connected, softmax</td></tr></table>
|
| 257 |
+
|
| 258 |
+
# A EXPERIMENT DETAIL
|
| 259 |
+
|
| 260 |
+
A.1 IMPLEMENTATION DETAILS OF CIFAR EXPERIMENT
|
| 261 |
+
|
| 262 |
+
In section 4.2 and 4.5, we conduct the experiment on the CIFAR10 and CIFAR100 datasets. We will introduce the architecture settings for the DSGC and baseline models. Table 6 illustrates the basic architecture used in the experiment. In the DSGC-VGG13 and DSGC-DenseNet models, the $k$ -conv refers to the spatial convolution (Eq.4) with $k$ -nearest neighbors as the neighbor setting. So the 1-conv is the same as the $1 \times 1$ conv, which is doing linear transformation on channels. The hidden dimensions of VGG13 and DSGC-VGG13 are set as $\{ 2 5 6 , 5 1 2 , 5 1 2 , 5 1 2 \}$ and $\{ 2 5 6 , 5 1 2 , 5 1 2 , 1 0 2 4 \}$ . The growth rate of DSGC-DenseNet is 32. And the baseline graph and geometric convolution methods use the identical architecture as DSGC-VGG13. For the subsampled CIFAR experiment, We eliminate the first convolution, transition and pooling layer, and change the spatial convolution from 9-conv to {16-conv, 12-conv, 8-conv, 4-conv}. For the DSGC-SE, we follow the method described in Hu et al. (2017) to add the SE block to DSGC-VGG13 architecture. We use the dropout scheme described in Huang et al. (2016) for the DSGC-DenseNet model, and add the dropout layer after the pooling layer for VGG13 and DSGC-VGG13 models. For the DSGCInception model, we imitate the design of the Inception Network (Szegedy et al. (2016)). The key idea is letting a convolution layer have different size of convolution filters. We use a simple example as our Inception module, which is illustrated in Figure 3.
|
| 263 |
+
|
| 264 |
+
For the CNN model, we still format the input signal in the matrix shape. The signals in invalid points are set as 0. Furthermore, to perform the fair comparison with standard CNN in the subsampled situation, we append a mask matrix as an additional channel for input signals to indicate whether the pixel is valid or not. For the MoNet, we also apply the softmax trick described in Section 3, which accelerates its training process and improves its final result. For the ChebyNet, we set the polynomial order as $K = 3$ .
|
| 265 |
+
|
| 266 |
+
For the $\triangle _ { i j }$ used in DSGC and MoNet, we use a 5 dimension feature vector. We denote the coordinate of $i$ -th node as $( x _ { i } , y _ { i } )$ , and $\triangle x _ { i j } = x _ { i } - x _ { j } , \triangle y _ { i j } = y _ { i } - y _ { j } , \triangle d _ { i j } = \triangle x _ { i j } ^ { 2 } + \triangle y _ { i j } ^ { 2 }$ . Then $\begin{array} { r } { \triangle _ { i j } = ( s i g n ( \triangle x _ { i j } ) , | \triangle x _ { i j } | , s i g n ( \triangle y _ { i j } ) , | \triangle y _ { i j } | , \triangle d _ { i j } ) } \end{array}$ .
|
| 267 |
+
|
| 268 |
+
The same learning schedule is applied to all models. We use SGD to train the model for 400 epochs. The initial learning rate is 0.1, and is divided by 10 at $50 \%$ and $7 5 \%$ of the total number of training epochs.
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 3: Inception Module
|
| 272 |
+
|
| 273 |
+
# A.2 IMPLEMENTATION DETAILS OF TIME SERIES PREDICTION
|
| 274 |
+
|
| 275 |
+
Firstly, we will give the formal definition of the time series forecasting, that is, spatiotemporal regression problem. We formulate the the spatiotemporal regression problem as a multivariate time series forecasting task with the sensors’ location as the input. More formally, given a series of time series signals observed from sensors $Y = \{ y _ { 1 } , y _ { 2 } , \cdot \cdot \cdot , y _ { T } \}$ where $\ b { y } _ { t } \in \mathbb { R } ^ { n }$ and $n$ are the number of sensors, and the locations of sensors $\pmb { L } = \{ l _ { 1 } , l _ { 2 } , \cdots , l _ { n } \}$ where $\bar { \boldsymbol { l } } _ { i } \in \mathbb { R } ^ { 2 }$ and indicates the coordinate of the sensor, the task is to predict a series of future signals in a rolling forecasting fashion. That being said, to predict ${ \pmb { y } } _ { T + h }$ where $h$ is the desirable horizon ahead of the current time stamp $T$ , we assume $\{ { \pmb y } _ { 1 } , { \pmb y } _ { 2 } , \dotsb , { \pmb y } _ { T } \}$ are available. Likewise, to predict the signal of the next time stamp ${ \pmb y } _ { T + h + 1 }$ , we assume $\{ { \pmb y } _ { 1 } , { \pmb y } _ { 2 } , \cdot \cdot \cdot , { \pmb y } _ { T } , { \pmb y } _ { T + 1 } \}$ are available. In this paper, we follow the setting of the autoregressive model. Define a window size $p$ which is a hyper-parameter firstly. The model input at time stamp $T$ is $X _ { T } = \{ y _ { T - p + 1 } , \cdot \cdot \cdot , y _ { T } \} \in \mathbb { R } ^ { n \times p }$ . In the experiments of this paper, the horizon is always set as 1.
|
| 276 |
+
|
| 277 |
+
Intuitively, different sensors may have node-level hidden features to influence its propagation patterns and final outputs. Then for each node, the model learns a node embedding vector and concatenate it with the input signals. By using this trick, each node has limited freedom to interface with its propagation patterns. This trick is proven to be useful in this task, USHCN-PRCP and Solar specifically. We set the embedding size as 10 for these two datasets.
|
| 278 |
+
|
| 279 |
+
One thing readers may notice is that there are $10 \%$ data in USHCN dataset missing. To deal with that, we add an additional feature channel to indicate which point is missing. For the time series models, we tune the historical window $p$ according to the validation set. For the rest of models, we set the window size $p = 1 8$ for Solar dataset and $p = 6$ for USHCN datasets. The network architecture used in this task is 7 convolution layers followed by a regression layer. The $\triangle _ { i j }$ setting is the same as the previous one. We use the Adam optimizer (Kingma & Ba, 2014) for this task, and train each model 200 epochs with learning rate 0.001.
|
| 280 |
+
|
| 281 |
+
# A.3 IMPLEMENTATION DETAILS OF DOCUMENT CATEGORIZATION
|
| 282 |
+
|
| 283 |
+
The data preprocessing follows the experiment details in Defferrard et al. (2016). And the network architecture for all models is 5 convolution layers followed by two MLP layers as the classifier. After each convolution layer, a dropout layer is performed with dropout rate of 0.5. The nodes’ coordinate is the word embedding, and the method to calculate $\triangle _ { i j }$ is similar to the previous ones. The optimizer used in this task is the same as the CIFAR experiment.
|
| 284 |
+
|
| 285 |
+
# A.4 VARIANCE OF DSGC PERFORMANCE
|
| 286 |
+
|
| 287 |
+
In this section, we report the variance of DSGC method in all 3 tasks. We run the DSGC model for 10 times and report the mean $\pm$ std: CIFAR $7 . 3 9 \pm 0 . 1 3 6$ , USHCN-TMAX $5 . 2 1 1 \pm 0 . 0 4 9 8$ , 20news $7 1 . 7 0 \pm 0 . 2 8 5$ . Obviously, the variance is significantly smaller than the performance gap between the DSGC model and best baseline results (CIFAR 8.34, USHCN-TMAX 5.467, 20news 71.01).
|
md/train/H178hw9ex/H178hw9ex.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DYNAMIC STEERABLE FRAME NETWORKS
|
| 2 |
+
|
| 3 |
+
Jorn-Henrik Jacobsen ¨ 1, Bert De Brabandere2, Arnold W.M. Smeulders1
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Amsterdam 2ESAT-PSI, KU Leuven {j.jacobsen,a.w.m.smeulders}@uva.nl bert.debrabandere@esat.kuleuven.be
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Filters in a convolutional network are typically parametrized in a pixel basis. As an orthonormal basis, pixels may represent any arbitrary vector in $\mathbb { R } ^ { n }$ . In this paper, we relax this orthonormality requirement and extend the set of viable bases to the generalized notion of frames. When applying suitable frame bases to ResNets on Cifar- $^ { 1 0 + }$ we demonstrate improved error rates by substitution only. By exploiting the transformation properties of such generalized bases, we arrive at steerable frames, that allow to continuously transform CNN filters under arbitrary Lie-groups. Further allowing us to locally separate pose from canonical appearance. We implement this in the Dynamic Steerable Frame Network, that dynamically estimates the transformations of filters, conditioned on its input. The derived method presents a hybrid of Dynamic Filter Networks and Spatial Transformer Networks that can be implemented in any convolutional architecture, as we illustrate in two examples. First, we illustrate estimation properties of steerable frames with a Dynamic Steerable Frame Network, compared to a Dynamic Filter Network on the task of edge detection, where we show clear advantages of the derived steerable frames. Lastly, we insert the Dynamic Steerable Frame Network as a module in a convolutional LSTM on the task of limited-data hand-gesture recognition from video and illustrate effective dynamic regularization and show clear advantages over Spatial Transformer Networks. In this paper, we have laid out the foundations of Frame-based convolutional networks and Dynamic Steerable Frame Networks while illustrating their advantages for continuously transforming features and data-efficient learning.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
For images, as well as any other sensory data, convolutional networks are typically learned from individual pixel values. Using them as a basis of the learned parameters is the standard approach for almost all CNNs. In this paper, we argue, that the pixel basis is not necessarily the best choice for representing signals. We show, that suitable alternatives yield increased classification performance by replacement only, while such a replacement adds additional properties to the learned filters that allow us to transform them under arbitrary pre-defined Lie groups.
|
| 14 |
+
|
| 15 |
+
From our perspective, the pixel values span an orthogonal basis for the filters in the network (in every layer). Such a pixel basis is complete as it may represent an arbitrary vector in $\mathbb { R } ^ { n }$ by linear combination, where $n$ is the dimensionality of the filter. In this paper we consider alternatives to this basis, both orthogonal bases, and non-orthogonal frames, arriving at superior expressiveness through steerable function spaces that allow us to transform filters locally and continuously, conditioned on their input.
|
| 16 |
+
|
| 17 |
+
Utilizing the steerability properties of frames in practice, we propose Dynamic Steerable Frame Networks (DSFNs) that fill the gap between Spatial Transformer Networks (STNs) (Jaderberg et al., 2015) and Dynamic Filter Networks (DFNs) (De Brabandere et al., 2016). STNs are not locally adaptive, thus they fail in many cases where it is not beneficial to transform the image globally as it would destroy discriminative information (multiple deformable objects, discriminative dynamic movements) or where global registration is performed as a preprocessing step (medical images).
|
| 18 |
+
|
| 19 |
+
DFNs are overcoming this restriction by locally transforming filters instead of globally transforming the whole feature stack as STNs do. However, DFNs are black boxes and not data-efficient, as they introduce many unconstrained parameters. Such a behavior is undesirable when data is limited and interpretability is key. DSFNs are locally adaptive, interpretable and data-efficient. They overcome the weaknesses of both approaches by combining their strengths, as illustrated in multiple experiments.
|
| 20 |
+
|
| 21 |
+
Our contributions:
|
| 22 |
+
|
| 23 |
+
• We argue that suitable frame bases are beneficial when representing sensory data compared to the commonly used pixel basis. • Exploiting the transformation properties of frames further, we derive Dynamic Steerable Frame Networks that are able to continuously transform features locally and fill the gap between Spatial Transformer Networks and Dynamic Filter Networks. Dynamic Steerable Frame Networks learn to separate pose and feature. This enables the network to be locally equivariant or invariant with respect to certain feature poses, or even to perform in network quasi data-augmentation, while only the inputs and the backpropagated error signals determine which and to what extent these are applied.
|
| 24 |
+
|
| 25 |
+
We introduce the generalized notion of frames to CNNs that extend possible bases to learn from to non-orthogonal and overcomplete sets without loss in generalization. We show that many choices are possible, while overcomplete, non-orthogonal bases consistently outperform the pixel basis when applied to a ResNet (He et al., 2016) for image classification, as illustrated on Cifar- $^ { 1 0 + }$ . We derive the Dynamic Steerable Frame Networks, based on the notion of steerable frames, that can locally adapt the filters in every feature map, conditioned on the input. We illustrate the strength of the approach in an edge detection task, where it outperforms a Dynamic Filter Network. We further show in a limited data video classification task, that Dynamic Steerable Frame Networks improve classification performance over Spatial Transformer Networks when global invariance is not desirable.
|
| 26 |
+
|
| 27 |
+
# 2 DYNAMICALLY STEERABLE FRAME NETWORKS
|
| 28 |
+
|
| 29 |
+
# 2.1 FRAMES
|
| 30 |
+
|
| 31 |
+
Frames are a natural generalization of orthogonal bases (Christensen, 2003). In frame terminology, an orthonormal basis is a Parseval-tight frame with unit norm. Every tight frame preserves the signal norm and exhibits perfect reconstruction. Frames can be seen as a superset of orthogonal bases in the sense that every basis is a frame, but not the reverse, see figure 1. The advantage of considering frames over orthogonal bases is that intrinsic signal properties can be spelled out explicitly in the new representation with the advantage, that these properties are directly accessible during learning. From an overcomplete representation, it will be more easily visible which part of the features is robust and which part is sensitive to accidental noise variations.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
|
| 35 |
+
Figure 1: a) Is an orthonormal basis in $\mathbb { R } ^ { 2 }$ , $u _ { 1 }$ and $u _ { 2 }$ are linearly independent and span the space of $\mathbb { R } ^ { \tilde { 2 } }$ . A dot in this example represents a filter in a convolutional network with coefficients $\{ \bar { v } _ { 1 } , v _ { 2 } \}$ . b) A tight frame in $\mathbb { R } ^ { 2 }$ . $u _ { 1 } , u _ { 2 }$ and $u _ { 3 }$ are linearly dependent. A dot in this example represents a convolutional filter with coefficients $\{ v _ { 1 } , v _ { 2 } , v _ { 3 } \}$ . The frame is an overcomplete representation, again spanning $\mathbb { R } ^ { 2 }$ and again preserving the norm. Note that the set of filter coefficients as represented by the dot is not unique. Thus even if one $v$ is obstructed by noisy updates or measurements, the filter may still be robust.
|
| 36 |
+
|
| 37 |
+
In a standard convolutional network, a filter kernel is a linear combination over the standard basis for $l ^ { 2 } ( \mathbb { N } )$ . The standard basis is composed from a delta function for every dimension and $W _ { i }$ is the $i _ { t h }$ filter of the network with parameters $w _ { n } ^ { i }$ :
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { l } { { \displaystyle e _ { 1 } = \{ 1 , 0 , 0 , . . . , 0 \} } } \\ { { \displaystyle e _ { 2 } = \{ 0 , 1 , 0 , . . . , 0 \} } } \\ { { \displaystyle . . . } } \\ { { \displaystyle e _ { n } = \{ 0 , 0 , 0 , . . . , 1 \} } } \\ { { \displaystyle W _ { i } = \sum _ { n = 1 } ^ { N } w _ { n } ^ { i } e _ { n } } } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Without loss of generalization the orthonormal standard basis can be replaced by a frame to include non-orthogonality, overcompleteness, increased symmetries or steerability into the representation. Changing from the pixel to an arbitrary frame is as simple as replacing the pixel basis $e _ { n }$ with a frame of choice with elements $v _ { n }$ as follows:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
W _ { i } = \sum _ { n = 1 } ^ { N } w _ { n } ^ { i } v _ { n }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $w _ { 1 } ^ { i } , . . . , w _ { n } ^ { i }$ are again the filter coefficients being learned.
|
| 50 |
+
|
| 51 |
+
In practice for CNNs working on images we investigate derived bases from steerability requirements, orthogonal polynomials, Framelets and members of the Gaussian derivative family. See figure 2 for a selection of frames.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: An illustrative plot of multiple 3x3 spanning sets: a) Pixel-basis, b) Orthogonal Polynomial, c) Non-orthogonal Frame. Note the increased symmetries in b) and c).
|
| 55 |
+
|
| 56 |
+
# 2.2 STEERING FRAMES UNDER ARBITRARY LIE-GROUPS
|
| 57 |
+
|
| 58 |
+
A pleasant property of many frames is steerability (Unser & Chenouard, 2013; Hel-Or & Teo, 1998; Michaelis & Sommer, 1995), the power of a function to represent transformed versions of itself by linear combination. The advantage of steerability in CNNs working on images is the ability to produce infinitely many transformed variants of a visual feature $f ^ { \tau } ( \breve { x } , y ) \in \breve { \mathbb { R } ^ { 2 } } \to \mathbb { R }$ from its canonical appearance.
|
| 59 |
+
|
| 60 |
+
To achieve this goal we cast these variations as the result of the action of a family of transformations $g ( \tau )$ on the canonical features $f ( x , y )$ , where $\tau \in R ^ { k }$ parametrizes these $k$ -parameter transformations. If the problem at hand requires the distinction between multiple unknown poses of the same feature in a typical CNN they all have to be computed exhaustively to determine if a particular pose is present or not. Things go out of hand when the search space is a continuous transformation group, such as the Lie group of affine transformations, requiring $k \infty$ number of feature maps which is computationally intractable or requires expensive searches over all possible transformations (Gens & Domingos, 2014). One way out is to coarsely sample a few equally spaced points on the equivariant transformation manifold or to restrict the space to a smaller group (Cohen & Welling, 2016; Dieleman et al., 2016). What remains, however, is that the number of resulting feature maps for more general groups quickly becomes infeasible. An elegant way to overcome these limitations is the concept of steerability by (Freeman & Adelson, 1991; Perona, 1992; Unser & Chenouard, 2013) which is taken as inspiration here.
|
| 61 |
+
|
| 62 |
+
In this work, we focus on Lie groups. Transformations $g ( \tau )$ over a range constitute a Lie group if they are closed under composition, they are associative, they are invertible, there exists an identity element, and their maps for inverse and composition are infinitely differentiable (Hel-Or & Teo, 1998). Teo and colleagues (Teo & Hel-Or, 1998) have given the following definition.
|
| 63 |
+
|
| 64 |
+
Definition 1 (Steerability): $A$ function $f ( x , y )$ : $\mathbb { R } ^ { 2 } \to \mathbb { R }$ is steerable under a $k$ -parameter Lie transformation group $G$ if any transformation $g ( \tau ) \in G$ of f can be written as a linear combination of a fixed, finite set of frame functions $\phi _ { m } ( x , y )$ :
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
g ( \tau ) f ( x , y ) = \sum _ { m = 1 } ^ { M } \beta _ { m } ( \tau ) \phi _ { m } ( x , y ) = \mathbf { B } ^ { T } ( \tau ) \Phi ( x , y )
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Where $\mathbf { B } ^ { T } ( \tau )$ denote the collected steering functions describing the transformation and $\Phi ( x , y )$ the collected steerable frame functions.
|
| 71 |
+
|
| 72 |
+
A function steerable under a k-parameter Lie group is capable of representing infinitely many states of a particular set of transformations. In many cases, only a finite set of frame functions is needed to represent these. In CNN terms, this means that a limited number of feature maps are sufficient to represent complete continuous transformation groups when the frame functions and the steering functions are chosen appropriately. Finding appropriate frame functions is the biggest challenge in steering arbitrary functions over arbitrary Lie groups.
|
| 73 |
+
|
| 74 |
+
To study the action of a Lie group $G$ on a function we use the close relation between the Lie group and its tangent space. The Algebra’s tangent space spanned by the group’s infinitesimal generators. The differential operators of the group action are obtained by computing the derivative of the group action with respect to its parameters at the identity element. A Lie Algebra can be considered as an ”infinitesimal” Lie group. If the group is simply connected, the group action on a visual feature $f ( x , y )$ can be obtained via the exponential map (Teo & Hel-Or, 1998):
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
g ( \tau _ { 1 } , . . . , \tau _ { k } ) f ( x , y ) = e ^ { ( \sum _ { i = 1 } ^ { k } \tau _ { i } L _ { i } ) } f ( x , y )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
e ^ { \tau _ { i } L _ { i } } = I + \tau _ { i } L _ { i } + \frac { 1 } { 2 ! } \tau _ { i } ^ { 2 } L _ { i } ^ { 2 } + . . .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $L _ { i }$ are the group’s infinitesimal generators and $I$ is the identity element. This implies that one can compute the Taylor expansion with respect to the desired transformation group parameters to obtain elements of the group. If a finite frame set is equivariant towards the desired transformation group (it contains the orbit of the function to be steered), the series expansion yields linearly dependent elements after a finite number of steps. Then the frame is globally steerable under the desired transformation group. If this is not the case, as for example when scaling a Gaussian function, a finite frame set is only sufficient to accurately steer the function over a bounded interval, the function is locally steerable, but not globally.
|
| 87 |
+
|
| 88 |
+
# 2.3 SEPARATING POSE AND CANONICAL APPEARANCE
|
| 89 |
+
|
| 90 |
+
When training a CNN the functions represented by each feature naturally change from update to update. It is desirable to separate the frame functions from the effective features as learned by the network. In such a Structured Receptive Fields Network (RFNN) (Jacobsen et al., 2016), each filters parameters are not its mere pixel values, but the coefficients weighting the sum over a fixed frame set. Thus, analogous to equation 1, every effective filter $W _ { i } ( x , y )$ has the following form:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
W _ { i } ( x , y ) = w _ { 1 } ^ { i } v _ { 1 } + w _ { 2 } ^ { i } v _ { 2 } + \ldots + w _ { n } ^ { i } v _ { n } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $v _ { n }$ denotes the $n _ { t h }$ element of the frame.
|
| 97 |
+
|
| 98 |
+
To be able to separate a features pose from its canonical appearance, we are interested in a steerable version of an arbitrary filter $W _ { i } ( x , y )$ under a $\mathbf { k }$ -parameter Lie group. From 5 follows:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
g ( \tau ) W _ { i } ( x , y ) = \sum _ { n = 1 } ^ { N } w _ { n } ^ { i } g ( \tau ) v _ { n } ^ { i } .
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
And by substituting according to equation 2 it follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
g ( \tau ) W _ { i } ( x , y ) = \sum _ { n = 1 } ^ { N } w _ { n } ^ { i } \sum _ { m = 1 } ^ { M } \beta _ { m } ( \tau ) \phi _ { m } ( x , y ) .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Thus it is sufficient to determine the group action on the fixed frame by steering it to separate the canonical feature itself from its $\mathrm { k }$ -parameter variants, i.e. $v _ { n } ^ { i }$ govern the weight of each frame coefficient to form a feature $W _ { i } ( x , y )$ and $\beta _ { m }$ are the steering functions governing the transformation of $g ( \tau )$ acting on $W _ { i } ( x , y )$ as a whole. From now on learning and transforming features amounts to a point-wise multiplication of frame coefficients with cos, sin and exp activation functions, which is suitable for learning in a CNN.
|
| 111 |
+
|
| 112 |
+
# 2.4 DERIVING THE FRAME AND STEERING FUNCTIONS
|
| 113 |
+
|
| 114 |
+
Now the problem is reduced to finding a suitable frame as a function space underlying the learned filters. There are many approaches to derive a function space that is closed under the desired transformation group and as we show, many options give rise to bases that work considerably well when inserted into state-of-the-art CNNs. The most straightforward way is to derive it from the group’s infinitesimal generators, for brevity we refer the interested reader to (Hel-Or & Teo, 1998) and directly cite some derived equivariant function spaces from the paper.
|
| 115 |
+
|
| 116 |
+
<table><tr><td colspan="2">Steerable Function Spaces</td></tr><tr><td>X,y Translation</td><td>xPyqeax+βy</td></tr><tr><td>X,y Scaling</td><td>xayβln(x)pln(y)q</td></tr><tr><td>Rotation & Uniform Scaling</td><td>raln(r)peik</td></tr><tr><td>X,y Translation & x,y Scaling& Rotation</td><td>xpyq</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 1: Examples of function spaces closed under various non-Abelian multi-parameter groups, as derived in (Hel-Or & Teo, 1998). They can readily be used as a frame for CNNs by the procedure we derive here.
|
| 119 |
+
|
| 120 |
+
Once a frame is chosen, we can simply check if it is closed under the given transformation group by verifying for each generator $L _ { i }$ that:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
{ \cal L } _ { i } \Phi ( x , y ) = { \bf B } _ { i } \Phi ( x , y ) ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\mathbf { B } _ { i }$ is some finite dimensional $n \times n$ matrix. If this is the case, the function space is equivariant under the transformation group and we can compute the steering equations of the group composed of multiple generators as:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbf { A } ( \tau ) = e ^ { \tau _ { k } \mathbf { B } _ { k } } \cdot \ldots \cdot e ^ { \tau _ { 1 } \mathbf { B } _ { 1 } } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
To arrive at a practical solution, we have to consider the problem that locally bounded functions can not be steered globally with a finite steerable frame. To achieve a suitable approximation for our case, we separate scaling into two parts, an inner $\{ \sigma _ { x } , \sigma _ { y } \}$ and an outer scale $\sigma _ { a }$ , where a stands for aperture. The inner scale can directly be steered via the above derivation and represents the slope of the local measurement taken by a filter, while the outer scale represents the size and shape of the filters receptive field. To achieve anisotropic receptive fields, we propose to first steer the scale at every pixel and steer the derived function space on this non-uniformly scaled grid, resulting in locally deformable receptive fields. Due to associativity of convolution, we can combine steering the derived function space and the receptive field scale into one operation. In this work, we use a second order approximation of the Gaussian that is capable of giving a good approximation to common CNN receptive field sizes 3x3, 5x5 and $7 \mathbf { x } 7$ . For scaling over larger ranges, we recommend the spectral decomposition approach (Koutaki & Uchimura, 2014).
|
| 133 |
+
|
| 134 |
+
# 2.5 DYNAMIC STEERABLE FRAME NETWORKS
|
| 135 |
+
|
| 136 |
+
Estimating the local pose of a feature from a steerable function space is analytically intractable in the case of most multi-parameter groups. In this paper, we introduce the Dynamic Steerable Frame Network that combines the advantages of steerable function spaces with the power of neural network function estimators, by estimating pose parameters from a function space equivariant under the transformation group at hand. Specifically, our architecture is inspired by the recently introduced Dynamic Filter Networks (De Brabandere et al., 2016). The Dynamic Filter Network (DFN) generates one feature per location in a feature map, which boils down to a locally connected convolution layer, for which the parameters are generated by a different network that estimates them from the input, yielding a different filter kernel for every location in the input.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3: The Dynamic Steerable Frame Network. The network transforms an input image to a steerable frame $\Phi$ (here an example with 3 frame functions) and estimates the local feature pose at each location in this equivariant space with a small pose estimating network. Then it outputs a set of pose coordinates $\tau _ { \mathbf { k } }$ , that are dependent on the group parametrization chosen. They are inserted into the matrix of steering equations $\beta ( \tau )$ and applied to the frame $\Phi$ , yielding the locally steered frame. In the same operation, we integrate the weights $w _ { n }$ , that govern the feature maps canonical feature appearance, these are the weights learned by a normal CNN. The Dynamic Steerable Frame Network can decide to commute with a set of poses, to be invariant to them, to only look for certain poses or to act like a normal CNN, where each feature map has one pose and one canonical appearance assigned to itself. This is only determined by the input data and the backpropagated error signals.
|
| 140 |
+
|
| 141 |
+
The DFN takes the form:
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
O ( x , y ) = F _ { \tau } ^ { x , y } ( I ( x , y ) ) ,
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
where $F _ { \tau } ^ { x , y }$ are generated by another network from the input. We propose the Dynamic Steerable Frame Network, where the parameters $\theta$ that condition the filter are pose transformation parameters of the steerable function space, estimated from the input, similar to how it is done in the Spatial Transformer Networks, just that in our case we aim for locally adaptive filters. The filters $F _ { \tau } ^ { x , y }$ share the same set of weights in the whole feature map, so they represent the same canonical appearance everywhere. While their local pose is dynamically estimated by a Pose-Generating Network $\Psi$ that takes the form:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\tau ( x , y ) = \Psi ( I ( x , y ) ) .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
Thus, the canonical appearance is translation invariant, but its geometrical pose is not. In terms of equation 5, this means the set of $w _ { n } ^ { i }$ is fixed, but the frame $v _ { n } ^ { \tau ( x , y ) }$ is locally transformed under a pre-defined k-parameter group with parameters $\tau$ . See figure 5 for an illustration.
|
| 154 |
+
|
| 155 |
+
The method consists of two parts: i) A Pose-Generating network estimating local pose parameters of a feature conditioned on the input from a steerable input space. ii) A Dynamic Filtering mechanism, convolving transformed versions of a feature with every location in the input feature map, based on the estimates of the pose generating network. Due to linearity of convolution, we can first perform a transformation of the input into the steerable frame space and in this space we perform i) and ii) as point-wise multiplications.
|
| 156 |
+
|
| 157 |
+
# 3 RELATED WORK
|
| 158 |
+
|
| 159 |
+
Steerable Filters is a concept established early for signal processing. Initially introduced by (Freeman & Adelson, 1991), the concept was extended to the Steerable Pyramid by (Simoncelli & Freeman, 1995) and further extended to a Lie-group formulation by (Hel-Or & Teo, 1998; Michaelis & Sommer, 1995). Further, steerability has recently been extended to tight frames, presenting Simoncelli’s Steerable Pyramid and multiple other Wavelets arising as a special case of the non-orthogonal Riesz transform (Unser & Chenouard, 2013). Steerable pyramids have been applied to CNNs as a pre-processing step (Xue et al., 2016), but have not yet been learnable. We incorporate steerable frames in CNNs to increase their de facto expressiveness and to allow them to learn their configurations, rather than picking them a priori.
|
| 160 |
+
|
| 161 |
+
Convolutional Networks with alternative bases have been proposed with various degrees of flexibility. A number of works utilizes change of basis to stabilize training and increase convergence behavior (Rippel et al., 2015; Arjovsky et al., 2015). Another line of research is concerned with complex-valued CNNs, either learned (Tygert et al., 2016), or fully designed like the Scattering networks (Bruna & Mallat, 2013; Oyallon & Mallat, 2015).
|
| 162 |
+
|
| 163 |
+
Scattering, as well as the complex-valued networks, rest upon a direct connection between the signal processing literature and CNNs. Inspired by the former, Structured Receptive Field Networks are learned from an overcomplete multi-scale frame, effectively improving performance for small datasets due to restricted feature spaces (Jacobsen et al., 2016). Also related is the work on Groupequivariant CNNs (Cohen & Welling, 2016) and Cyclic Pooling (Dieleman et al., 2016), where equivariance towards the dihedral group is theoretically guaranteed, yielding increased accuracy. Inspired by CNNs learned from alternative bases, we introduce the general principle of Frame-based convolutional networks that allow for non-orthogonal, overcomplete and steerable feature spaces.
|
| 164 |
+
|
| 165 |
+
Another way to impose structure onto CNN representations and subsequently increase their dataefficiency is to incorporate explicit geometrical transformations into them. Either by learning transformation operators and group representations (Cohen et al., 2014; Wang et al., 2009). Or by predefining the possible transformations, as done in Transforming Autoencoders (Hinton et al., 2011), which map their inputs from the image to pose space through a neural network. The Spatial Transformer Networks (Jaderberg et al., 2015) learn global transformation parameters in a similar way while applying them to a nonlinear co-registration of the feature stack to some learned pose. This yields especially high performance on tasks where centering the objects is beneficial. Dynamic Filter Networks move one step further and estimate filters for each location, conditioned on their input. These approaches are all dynamic in a sense that they condition their parameters on the input appearance. We combine the idea of Dynamic Filter Networks with explicit pose prediction into Dynamic Steerable Frame Networks that can estimate poses from continuous input space, conditioned on the input. As such, we overcome the difficulty of estimating local pose, while being able to separate pose and feature learning globally.
|
| 166 |
+
|
| 167 |
+
# 4 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
# 4.1 GENERALIZING PIXELS TO FRAMES ON CIFAR- $^ { 1 0 + }$
|
| 170 |
+
|
| 171 |
+
To show the validity of general frame representations, we compare different bases in a state-of-theart pre-activation deep residual network architecture (He et al., 2016) on the Cifar- $^ { 1 0 + }$ (Krizhevsky & Hinton, 2009) dataset with moderate data augmentation of crops and flips.
|
| 172 |
+
|
| 173 |
+
<table><tr><td colspan="4">Error on Cifar10+</td></tr><tr><td>Method</td><td>Pixel</td><td>Image Frame</td><td>Naive Frame</td></tr><tr><td>ResNet-20</td><td>7.85%</td><td>7.61%</td><td>8.97%</td></tr><tr><td>ResNet-56</td><td>6.68%</td><td>6.08%</td><td>7.30%</td></tr><tr><td>ResNet-110</td><td>5.84%</td><td>5.34%</td><td>6.96%</td></tr><tr><td>Densenet K12 L40</td><td>5.28%</td><td>4.99%</td><td>6.39%</td></tr><tr><td>Densenet K12 L100</td><td>4.16%</td><td>3.78%</td><td>5.21%</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Table 2: Results on Cifar10 with moderate data-augmentation (crops/flips) with the recently introduced pre-activation Residual network and Densenet with the standard pixel-basis, a steerable frame basis designed for natural images and the naive steerable $x ^ { p } y ^ { q }$ frame from table 3 that does not take natural image statistics into account. The natural image statistics based frame outperforms the pixelbasis consistently, while the naive frame consinstently performs about $1 \%$ worse than the baseline, highlighting the benefit of a frame suitable for the type of input data.
|
| 176 |
+
|
| 177 |
+
We evaluated our approach on multiple networks and network sizes. The setup used for the ResNet is as described in (He et al., 2016). The batch size is chosen to be 64 and we train for 164 epochs with the described learning rate decrease. The ResNet architectures used are without bottlenecks having 20, 56 and 110 layers. For the Densenets we follow (Huang et al., 2016) and evaluate on the ${ \mathrm { K } } { = } 1 2$ and $_ { \mathrm { L = 4 0 } }$ , and the ${ \mathrm { K } } { = } 1 2$ and ${ \mathrm { L } } { = } 1 0 0$ models. We run our experiments in Keras (Chollet, 2015) and Tensorflow (Abadi et al., 2016). In the first experiment, we run the models on the standard pixel basis to get a viable baseline. Secondly, we replace the pixel-basis with widely-used frames that take natural image statistics into account, namely non-orthogonal, overcomplete Gaussian derivatives (Florack et al., 1992) and non-orthogonal framelets (Daubechies et al., 2003) in an alternating fashion, yielding superior performance compared to the pixel-basis by replacement only.
|
| 178 |
+
|
| 179 |
+
We also show that the naive $x ^ { p } y ^ { q }$ frame (see table 1) performs consistently worse than the other two choices, as it does not take natural image properties into account, while it is important to mention that this $1 \%$ performance decrease also comes with additional properties that might be highly beneficial in particular tasks. We have also found orthogonal polynomials to not work very well (around $3 \%$ performance decrease), which is in line with our expectation that suitable frames should take natural image statistics into account. 2D frames are generated from 1D functions via the following generating process:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
F r a m e = \{ v _ { 0 } , v _ { 1 } , v _ { 2 } , v _ { 3 } \} \otimes \{ v _ { 0 } , v _ { 1 } , v _ { 2 } , v _ { 3 } \} ^ { T } .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
The results are reported in table 2. The fact that the pixel-basis can be replaced by steerable frames and performance even improves when the frame is chosen well, is remarkable, as this means every filter in the CNN enjoys additional properties, while performance improves in the standard setting already and finding suitable frames is not more expensive than running the same smallest CNN as many times as one has frames to choose from, as the performance we observed was consistent across multiple model sizes. Frame-based CNNs run at the same runtime as vanilla CNNs.
|
| 186 |
+
|
| 187 |
+
# 4.2 DYNAMIC STEERABLE FRAME NETWORKS
|
| 188 |
+
|
| 189 |
+
In this section we report two experiments. The first experiment is an edge detection task, highlighting the difference between our approach and multiple baselines in a fine-grained pixel-wise labeling task. In the second experiment, we apply a 2D convolutional LSTM on a small hand gesture recognition video dataset to illustrate how the Dynamic Steerable Frame Network regularizes the model effectively and to illustrate its benefits over Spatial Transform Networks.
|
| 190 |
+
|
| 191 |
+
The model used in both experiments is learned from a steerable Gauss-Hermite frame. The Dynamic Steerable Frame Network consists of three processing steps. 1) Change to frame space on the input, 2) the Pose-Generating network estimates the pose from this transformed input, outputting a set of pose variables for each location in the image. 3) the steering functions derived in section 2.4 are applied to these pose variable maps and effectively act as nonlinear pose-parametrized activation functions that regularize the Pose-Generating network to output an explicitly interpretable pose space. Finally, a 1x1 convolution layer is applied to the already transformed output maps, representing the weights $w _ { n } ^ { i }$ , governing the canonical appearance of the $i _ { t h }$ feature map, see also figure 5. Dynamic Steerable Frame Networks run at the same computational cost as vanilla Dynamic Filter Networks.
|
| 192 |
+
|
| 193 |
+
# 4.2.1 EDGE DETECTION
|
| 194 |
+
|
| 195 |
+
In this experiment, we compare a Dynamic Filter Network (De Brabandere et al., 2016) baseline with an autoencoder and a Dynamic Steerable Frame Network on the task of edge detection. The problem is formulated as a pixel-wise classification task and reported is the root mean-squared error on an unseen test set. The labels are the edges. The dataset is infinite, as we produce random blobs and create the edge labels with a standard scikit image function. The standard DFN can freely learn an input layer with 2 filters and 3 subsequent 1x1 layers that can non-linearly recombine the inputs, whereas the Frame DFN receives a steerable frame as an input, allowing it to leverage the finegrained orientation information without the need to learn it. The Dynamic Steerable Frame Network has the exact same architecture as the DFN but is geometrically regularized on its output as can be seen in figure 5, as an input it receives a first order Gauss-Hermite frame that can be steered globally towards rotation and locally towards scale.
|
| 196 |
+
|
| 197 |
+
Location varying methods are clearly superior in this task, compared to the location invariant autoencoder. The DFN increases its performance substantially when getting the steerable frame as an input, indicating its inability to learn a continuously transforming frame by itself. Finally, the Dynamic Steerable Frame Network clearly outperforms all baselines due to its ability to continuously transform its filters in a well-regularized manner. As an extra, we get the local feature pose for free from the output of the DSFN, the baseline has no notion of an explicit pose parameter, see figure 4.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Method</td><td>RMSE</td></tr><tr><td>Autoencoder</td><td>18.034</td></tr><tr><td>DFN</td><td>5.669</td></tr><tr><td>Frame DFN DSFN</td><td>1.554 0.778</td></tr></table>
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 4: Results on the edge detection task. Top is an illustration of a test image, bottom one sample from the actual infinite dataset, reported is root mean squared error. Autoencoder denotes a vanilla location invariant autoencoder. DFN denotes the plain Dynamic Filter Network, Frame DFN denotes a DFN whos input is a frame, DSFN denotes the Dynamic Steerable Frame Network. a) is the input, b) is the label, c) the prediction and d) the angular pose variable. d) is an output we get for free when training DSFNs, while a DFN has no notion of interpretable angle variables. Location varying methods clearly outperform the static autoencoder, while learning the DFN from a steerable frame increases performance again substantially. The DSFN substantially outperforms all other methods due to its continuously transforming input and output space.
|
| 203 |
+
|
| 204 |
+
# 4.2.2 SMALL SCALE VIDEO CLASSIFICATION
|
| 205 |
+
|
| 206 |
+
To show the ability of the Dynamic Steerable Frame Network to effectively regularize in dynamic settings where poses play an important role and where Spatial Transformer Networks do not work well, we apply it on the task of Hand-Gesture Recognition. Namely, on the Cambridge Hand-Gesture dataset (Kim & Cipolla, 2009), consisting of 9 classes of hand movement and poses in 900 videos, we use 750 for training, 50 for validation and 100 for testing. The dataset is very small and contains classes where global movement plays an important role and thus provides a good test bed to show effectiveness of the DSFN regularization ability compared to Spatial Transformers.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>convLSTM</td><td>1 Layer</td><td>2 Layer</td><td>rot/scale-DSFN</td><td>rot/scale-STN</td><td>affine-STN</td></tr><tr><td># Params</td><td>905k</td><td>913k</td><td>907k</td><td>971k</td><td>1037k</td></tr><tr><td> Accuracy</td><td>35.42%</td><td>39.31%</td><td>62.18%</td><td>21.34%</td><td>12.21 %</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 3: Results on the Cambridge Hand-Gesture Recognition dataset, to illustrate the effectiveness of pose regularization provided by the Dynamic Steerable Frame Network. Adding the DSFN module to the convLSTM drastically improves performance. Increasing the capacity of the baseline to two layers, does not make up for the difference in performance, while adding the STN to the convLSTM decreases performance significantly, as the STN does not manage to learn meaningful global transformations that do not remove the class-specific information content. This is further substantiated by an increased performance when removing the ability to shear and translate the input from the STN. The DSFN outperforms all other approaches while only adding 2k free parameters to the baseline.
|
| 211 |
+
|
| 212 |
+
Our baseline model is a convolutional LSTM with 10 output feature maps, batch normalization and a dense layer for classification. As a second baseline, we increase the capacity of the model by adding a second LSTM layer and a second batch normalization step. We combine two instances of a Spatial Transformer Network with a convolutional LSTM, one that can perform full affine transformations and one that is restricted to rotation and scaling. The DSFN module is applied to the input layer of the smaller model with 4 output feature maps. The setup of the steerable frame used in this model is a Gauss-Hermite frame.
|
| 213 |
+
|
| 214 |
+
The steerability is uniquely parametrized as: $\{ B _ { s } B _ { \theta } \}$ . Allowing for scaling and rotation. Both Spatial Transformer Networks do not manage to learn useful warps of the input image and therefore decrease performance of the baseline. The affine model only manages to correctly classify multiple instances of a static class that has no movement information related to its label, while the rot/scale model increases performance, but still does not manage to learn useful scalings or rotations. The DSFN manages to learn locally rotation and scale invariant filters, that follow the boundaries and other features across the video as desired. Results are reported in Table 3.
|
| 215 |
+
|
| 216 |
+
For visualizations of the learned transformations, see Appendix A. The results illustrate the effectiveness of the DSFN to regularize the LSTM on a small-scale task where mostly local invariance is desired, but global invariance destroys most of the class-specific information. The DSFN improves performance over the baseline by about $22 \%$ , while the Spatial Transformer Network decreases performance by about $15 \%$ , or even to random in the full-affine case.
|
| 217 |
+
|
| 218 |
+
# 5 DISCUSSION
|
| 219 |
+
|
| 220 |
+
We have introduced the notion of Frame-based convolutional networks. Our experiments illustrate that a simple replacement of the standard basis by a frame suitable for natural images leads to increased performance.
|
| 221 |
+
|
| 222 |
+
The insight that multiple frames can be considered as viable spanning sets for CNN representations leads us to steerable frames whose properties we exploit explicitly in our derived Dynamic Steerable Frame Networks, such that they can readily be accessed during training. The proposed method is a hybrid of Dynamic Filter Networks and Spatial Transformer Networks, enabling locally adaptive filtering with geometrical constraints.
|
| 223 |
+
|
| 224 |
+
We illustrate the effectiveness of the approach on an edge detection task, that requires fine-grained pixel-wise labeling, where Dynamic Steerable Frame Networks outperform a standard Dynamic Filter Network and an autoencoder baseline. Further, we illustrate the ability of the Dynamic Steerable Frame Network to regularize recurrent networks in a small-data video classification scenario where Spatial Transformer Networks fail to learn meaningful transformations.
|
| 225 |
+
|
| 226 |
+
Future work is to apply the model to other problem domains like egocentric video, robotics applications, as well as volumetric medical imaging videos of moving organs. We expect our Dynamic Steerable Frame Network approach to be beneficial in any problem where spatiotemporal continuity, data-efficiency, or interpretable pose spaces are key.
|
| 227 |
+
|
| 228 |
+
# ACKNOWLEDGEMENTS
|
| 229 |
+
|
| 230 |
+
We would like to thank Edouard Oyallon and Taco Cohen for insightful comments and discussions.
|
| 231 |
+
|
| 232 |
+
# REFERENCES
|
| 233 |
+
|
| 234 |
+
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.
|
| 235 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. arXiv preprint arXiv:1511.06464, 2015.
|
| 236 |
+
Joan Bruna and Stephane Mallat. Invariant scattering convolution networks. ´ IEEE transactions on pattern analysis and machine intelligence, 35(8):1872–1886, 2013.
|
| 237 |
+
Franc¸ois Chollet. Keras. https://github.com/fchollet/keras, 2015.
|
| 238 |
+
Ole Christensen. An introduction to frames and Riesz bases, volume 7. Springer, 2003.
|
| 239 |
+
Taco Cohen, Max Welling, et al. Learning the irreducible representations of commutative lie groups. In ICML, pp. 1755–1763, 2014.
|
| 240 |
+
Taco S Cohen and Max Welling. Group equivariant convolutional networks. arXiv preprint arXiv:1602.07576, 2016.
|
| 241 |
+
Ingrid Daubechies, Bin Han, Amos Ron, and Zuowei Shen. Framelets: Mra-based constructions of wavelet frames. Applied and computational harmonic analysis, 14(1):1–46, 2003.
|
| 242 |
+
Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. arXiv preprint arXiv:1605.09673, 2016.
|
| 243 |
+
|
| 244 |
+
Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. arXiv preprint arXiv:1602.02660, 2016.
|
| 245 |
+
|
| 246 |
+
Luc MJ Florack, Bart M ter Haar Romeny, Jan J Koenderink, and Max A Viergever. Scale and the differential structure of images. Image and Vision Computing, 10(6):376–388, 1992.
|
| 247 |
+
|
| 248 |
+
William T Freeman and Edward H Adelson. The design and use of steerable filters. IEEE Transactions on Pattern analysis and machine intelligence, 13(9):891–906, 1991.
|
| 249 |
+
|
| 250 |
+
Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014.
|
| 251 |
+
|
| 252 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. arXiv preprint arXiv:1603.05027, 2016.
|
| 253 |
+
|
| 254 |
+
Yacov Hel-Or and Patrick C Teo. Canonical decomposition of steerable functions. Journal of Mathematical Imaging and Vision, 9(1):83–95, 1998.
|
| 255 |
+
|
| 256 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 257 |
+
|
| 258 |
+
Gao Huang, Zhuang Liu, and Kilian Q Weinberger. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016.
|
| 259 |
+
|
| 260 |
+
Jorn-Henrik Jacobsen, Jan van Gemert, Zhongyu Lou, and Arnold W.M. Smeulders. Structured ¨ receptive fields in cnns. 2016.
|
| 261 |
+
|
| 262 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
|
| 263 |
+
|
| 264 |
+
Tae-Kyun Kim and Roberto Cipolla. Canonical correlation analysis of video volume tensors for action categorization and detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(8):1415–1428, 2009.
|
| 265 |
+
|
| 266 |
+
Gou Koutaki and Keiichi Uchimura. Scale-space processing using polynomial representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2744– 2751, 2014.
|
| 267 |
+
|
| 268 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 269 |
+
|
| 270 |
+
Markus Michaelis and Gerald Sommer. A lie group approach to steerable filters. Pattern Recognition Letters, 16(11):1165–1174, 1995.
|
| 271 |
+
|
| 272 |
+
Edouard Oyallon and Stephane Mallat. Deep roto-translation scattering for object classification. ´ In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865– 2873, 2015.
|
| 273 |
+
|
| 274 |
+
Pietro Perona. Steerable-scalable kernels for edge detection and junction analysis. In ECCV, pp. 3–18. Springer, 1992.
|
| 275 |
+
|
| 276 |
+
Oren Rippel, Jasper Snoek, and Ryan P Adams. Spectral representations for convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 2449–2457, 2015.
|
| 277 |
+
|
| 278 |
+
Eero P Simoncelli and William T Freeman. The steerable pyramid: a flexible architecture for multiscale derivative computation. In ICIP (3), pp. 444–447, 1995.
|
| 279 |
+
|
| 280 |
+
Patrick C Teo and Yacov Hel-Or. Lie generators for computing steerable functions. Pattern Recognition Letters, 19(1):7–17, 1998.
|
| 281 |
+
|
| 282 |
+
Mark Tygert, Joan Bruna, Soumith Chintala, Yann LeCun, Serkan Piantino, and Arthur Szlam. A mathematical motivation for complex-valued convolutional networks. Neural computation, 2016.
|
| 283 |
+
|
| 284 |
+
Michael Unser and Nicolas Chenouard. A unifying parametric framework for 2d steerable wavelet transforms. SIAM Journal on Imaging Sciences, 6(1):102–135, 2013.
|
| 285 |
+
|
| 286 |
+
Jimmy Wang, Jascha Sohl-Dickstein, and Bruno Olshausen. Unsupervised learning of lie group operators from image sequences. In Frontiers in Systems Neuroscience. Conference Abstract: Computational and systems neuroscience, 2009.
|
| 287 |
+
|
| 288 |
+
Tianfan Xue, Jiajun Wu, Katherine L Bouman, and William T Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. arXiv preprint arXiv:1607.02586, 2016.
|
| 289 |
+
|
| 290 |
+
# APPENDIX A VISUALIZING DSFN AND STN TRANSFORMATIONS
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 5: Visualizations of the learned transformations by the Dynamic Steerable Frame Network (DSFN top) and the Spatial Transformer Network (STN bottom) on the hand-gesture recognition dataset. The STN zooms and rotates the hands arbitrarily and apparently removes important information content thereby, leading to low classification accuracy. The DSFN acts locally and adaptively filters the hands in multiple ways. Note that the DSFN did not learn fully rotation invariant filters in all 4 cases, but in 3 cases produces different filter responses for different sides of the hand. However, it does follow the contours of the hand and segments the borders from the background. This indicates that full rotation invariance is not suitable for this task. This would be hard to assess if one had to choose the degree of invariance a priori, while the DSFN has the means to learn the necessary amount of local invariance.
|
| 294 |
+
|
| 295 |
+
# APPENDIX B EQUIVARIANCE PROOF & STEERING EQUATION DERIVATION
|
| 296 |
+
|
| 297 |
+
To prove that a frame is equivariant with respect to the action of a group transformation, determined by its generator $L _ { i }$ , we simply have to show that:
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
{ \cal L } _ { i } \Phi ( x , y ) = { \bf B } _ { i } \Phi ( x , y ) ,
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
Where $\mathbf { B } _ { i }$ is some $n \times n$ matrix.
|
| 304 |
+
|
| 305 |
+
In case of the Hermite polynomials (here considered up to second order), we have:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\Phi ( x , y ) = \{ 1 , x , y , x ^ { 2 } - 1 , x y , y ^ { 2 } - 1 \} .
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
To verify that these functions span an equivariant function space with respect to rotation, we apply the generator of rotations to the frame and verify that equation 13 holds. The generator of rotations
|
| 312 |
+
|
| 313 |
+
in the plane is given by $\begin{array} { r } { L _ { r } = - x \frac { d } { d y } + y \frac { d } { d x } } \end{array}$ , applied to each frame element, we get:
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
L _ { r } \Phi ( x , y ) = \left[ \begin{array} { c } { 0 } \\ { y } \\ { - x } \\ { 2 x y } \\ { - x ^ { 2 } + y ^ { 2 } } \\ { - 2 x y } \end{array} \right] = \mathbf { B } _ { r } \left[ \begin{array} { c } { 1 } \\ { x } \\ { y } \\ { x ^ { 2 } - 1 } \\ { x y } \\ { y ^ { 2 } - 1 } \end{array} \right] .
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
It is straightforward to solve this linear system and obtain the $6 \times 6$ matrix $B _ { r }$ :
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\mathbf { B } _ { r } = \left[ \begin{array} { c c c c c c c } { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 1 } & { 0 } & { 0 } & { 0 } \\ { 0 } & { - 1 } & { 0 } & { 0 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { 2 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { - 1 } & { 0 } & { 1 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { - 2 } & { 0 } \end{array} \right] . \quad \left[ \begin{array} { c c c c c c } \end{array} \right.
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Thus, we have proven that the function space is closed under the action of the group and the Hermite polynomials constitute an equivariant function space with respect to rotation.
|
| 326 |
+
|
| 327 |
+
Subsequently, the exponential map directly yields the steering equations collected in the interpolation matrix $\dot { \mathbf { A } } ^ { \theta }$ , that can rotate the whole frame by $\theta$ :
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { l l } { { \Phi ^ { \theta } ( x , y ) = e ^ { \theta \mathbf { B } _ { r } } \Phi ( x , y ) = \mathbf { A } ^ { \theta } \Phi ( x , y ) , } } & { { } } \\ { { \ } } & { { } } \\ { { \Phi ^ { \theta } ( x , y ) = \left[ \begin{array} { c c c c c c } { { 1 } } & { { 0 } } & { { 0 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { \cos \theta } } & { { \sin \theta } } & { { 0 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { - \sin \theta } } & { { \cos \theta } } & { { 0 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { 0 } } & { { { \frac { 1 } { 2 } } + { \frac { 1 } { 2 } } \cos 2 \theta } } & { { \sin 2 \theta } } & { { { \frac { 1 } { 2 } } - { \frac { 1 } { 2 } } \cos 2 \theta } } \\ { { 0 } } & { { 0 } } & { { 0 } } & { { - { \frac { 1 } { 2 } } \sin 2 \theta } } & { { \cos 2 \theta } } & { { { \frac { 1 } { 2 } } \sin 2 \theta } } \\ { { 0 } } & { { 0 } } & { { 0 } } & { { { \frac { 1 } { 2 } } - { \frac { 1 } { 2 } } \cos 2 \theta } } & { { - \sin 2 \theta } } & { { { \frac { 1 } { 2 } } + { \frac { 1 } { 2 } } \cos 2 \theta } } \end{array} \right] \left[ \begin{array} { c } { { 1 } } \\ { { x } } \\ { { y } } \\ { { x ^ { 2 } - 1 } } \\ { { x y } } \\ { { y ^ { 2 } - 1 } } \end{array} \right] . } } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
$\Phi ^ { \theta } ( x , y )$ is the frame rotated by some angle $\theta$ . Combining this result with equation 7, gives us the possibility to rotate any learned feature by arbitrary and continuous angles $\theta$ . The whole procedure is completely analogous for any other Lie group transformation. Further, k-parameter transformation groups can be composed according to equation 9 from smaller groups. Here an example of the general linear group of rotation, anisotropic scalings and skew:
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\Phi ^ { \{ \theta _ { 1 } , s _ { x } , s _ { y } , \theta _ { 2 } \} } ( x , y ) = { \bf A } ^ { \{ \theta _ { 1 } , s _ { x } , s _ { y } , \theta _ { 2 } \} } \Phi ( x , y ) = e ^ { \theta _ { 2 } \mathbf { B } _ { r } } \cdot e ^ { s _ { x } \mathbf { B } _ { s x } } \cdot e ^ { s _ { y } \mathbf { B } _ { s y } } \cdot e ^ { \theta _ { 1 } \mathbf { B } _ { r } } \Phi ( x , y ) .
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
# APPENDIX C BACKPROPAGATION THROUGH STEERABLE FILTERS
|
| 340 |
+
|
| 341 |
+
Will be added to final manuscript.
|
md/train/H1MW72AcK7/H1MW72AcK7.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OPTIMAL CONTROL VIA NEURAL NETWORKS: ACONVEX APPROACH
|
| 2 |
+
|
| 3 |
+
Yize Chen∗, Yuanyuan Shi∗, Baosen Zhang
|
| 4 |
+
Department of Electrical and Computer Engineering,
|
| 5 |
+
University of Washington,
|
| 6 |
+
Seattle, WA 98195, USA
|
| 7 |
+
{yizechen, yyshi, zhangbao}@uw.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Control of complex systems involves both system identification and controller design. Deep neural networks have proven to be successful in many identification tasks, however, from model-based control perspective, these networks are difficult to work with because they are typically nonlinear and nonconvex. Therefore many systems are still identified and controlled based on simple linear models despite their poor representation capability. In this paper we bridge the gap between model accuracy and control tractability faced by neural networks, by explicitly constructing networks that are convex with respect to their inputs. We show that these input convex networks can be trained to obtain accurate models of complex physical systems. In particular, we design input convex recurrent neural networks to capture temporal behavior of dynamical systems. Then optimal controllers can be achieved via solving a convex model predictive control problem. Experiment results demonstrate the good potential of the proposed input convex neural network based approach in a variety of control applications. In particular we show that in the MuJoCo locomotion tasks, we could achieve over $10 \%$ higher performance using $5 \times$ less time compared with state-of-the-art model-based reinforcement learning method; and in the building HVAC control example, our method achieved up to $20 \%$ energy reduction compared with classic linear models.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Decisions on how to best operate and control complex physical systems such as the power grid, commercial and industrial buildings, transportation networks and robotic systems are of critical societal importance. These systems are often challenging to control because they tend to have complicated and poorly understood dynamics, sometimes with legacy components are built over a long period of time (Wolf, 2009). Therefore detailed models for these systems may not be available or may be intractable to construct. For instance, since buildings account for $40 \%$ of the global energy consumption (Cheng et al., 2008), many approaches have been proposed to operate buildings more efficiently by controlling their heating, ventilation, and air conditioning (HVAC) systems (Zhang et al., 2017). Most of these methods, however, suffer from two drawbacks. On one hand, a detailed physics model of a building can be used to accurately describe its behavior, but this model can take years to develop. On the other hand, simple control algorithms have been developed by using linear (RC circuit) models (Ma et al., 2012) to represent buildings, but the performance of these models may be poor since the building dynamics can be far from linear (Shaikh et al., 2014).
|
| 16 |
+
|
| 17 |
+
In this paper, we leverage the availability of data to strike a balance between requiring painstaking manual construction of physics based models and the risk of not capturing rich and complex system dynamics through models that are too simplistic. In recent years—with the growing deployment of sensors in physical and robotics systems—large amount of operational data have been collected, such as in smart buildings (Suryadevara et al., 2015), legged robotics (Meger et al., 2015) and manipulators (Deisenroth et al., 2011). Using these data, the system dynamics can be learned directly and then automatically updated at periodic intervals. One popular method is to parameterize these complex system dynamics using deep neural networks to capturing complex relationships (He et al., 2016; Vaswani et al., 2017), yet few research investigated how to integrate deep learning models into real-time closed-loop control of physical systems.
|
| 18 |
+
|
| 19 |
+
A key reason that deep neural networks have not been directly applied in control is that even though they provide good performances in learning system behaviors, optimization on top of these networks is challenging (Kawaguchi, 2016). Neural networks, because of their structures, are generally not convex from input to output. Therefore, many control applications (e.g., where real-time decisions need to be made) choose to favor the computational tractability offered by linear models despite their poor fitting performances.
|
| 20 |
+
|
| 21 |
+
In this paper we tackle the modeling accuracy and control tractability tradeoff by building on the input convex neural networks (ICNN) in (Amos et al., 2017) to both represent system dynamics and to find optimal control policies. By making the neural network convex from input to output, we are able to obtain both good predictive accuracies and tractable computational optimization problems. The overall methodology is shown in Fig. 1. Our proposed method (shown in Fig. 1 (b)) firstly utilizes an input convex network model to learn the system dynamics and then computes the best control decisions via solving a convex model predictive control (MPC) problem, which is tractable and has optimality guarantees. This is different from existing methods that uses model-free end-to-end controller which directly maps input to output (shown in Fig. 1 (a)). Another major contribution of our work is that we explicitly prove that ICNN can represent all convex functions and systems dynamics, and is exponentially more efficient than widely used convex piecewise linear approximations (Magnani & Boyd, 2009).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Our proposed model-based method, (a) an input convex neural network is first trained to learn the system dynamics, then (b) we solve a convex predictive control problem to find the optimal actions which are input convex neural networks’ inputs. The optimization steps are also based on objectives and dynamics constraints represented by the trained networks.
|
| 25 |
+
|
| 26 |
+
# 1.1 RELATED WORK
|
| 27 |
+
|
| 28 |
+
The work in (Amos et al., 2017) was an impetus for this paper. The key differences are that the goal in (Amos et al., 2017) is to show that ICNN can achieve similar classification performances as conventional neural networks and how the former can be used in inference and prediction problems. Our goal is to use these networks for optimization and closed-loop control, and in a sense that we are more interested in the overall system performances and not directly the performance of the networks. We also extend the class of networks to include RNNs to capture dynamical systems.
|
| 29 |
+
|
| 30 |
+
Control and decision-making have used deep learning mainly in model-free end-to-end controller settings (shown in Fig. 1 (a)), such as sequential decision making in game (Mnih et al., 2013), robotics manipulation (Levine & Koltun, 2014; Levine et al., 2016), and control of cyber-physical systems (Wei et al., 2017; O’Neill et al., 2010). However, much of the success relies heavily on a reinforcement learning setup where the optimal state-action relationship can be learned via a large number of samples. However, many physical systems do not fit into the reinforcement learning process, where both the sample collection is limited by real-time operations, and there are physical model constraints hard to represent efficiently.
|
| 31 |
+
|
| 32 |
+
To address the above sample efficiency, safety and model constraints incompatibility concerns faced by model-free reinforcement learning algorithms in physical system control, we consider a model-based control approach in this work. Model-based control algorithms often involve two stages – system identification and controller design. For the system identification stage, the goal is to learn a fixed form of system model to minimize some prediction error (Ljung, 1998). Most efficient model-based control algorithms have used a relatively simple function estimator for the system dynamics identification (Nagabandi et al., 2018), such as linear model (Ma et al., 2012) and Gaussian processes (Meger et al., 2015; Deisenroth et al., 2011). These simplified models are sample-efficient to learn, and can be nicely incorporated in the sub-sequent optimal control problems. However, such simple models may not have enough representation capacity in modeling large-scale or high-dimension systems with nonlinear dynamics. Deep neural networks (DNNs) feature powerful representation capability, while the main challenge of using DNNs for system identification is that such models are typically highly non-linear and non-convex (Kawaguchi, 2016), which causes great difficulty for following decision making. A recent work from (Nagabandi et al., 2018) is close in spirit as our proposed method. Similarly, the authors use a model-based approach for robotics control, where they first fit a neural network for the system dynamics and then use the fitted network in an MPC loop. However, since (Nagabandi et al., 2018) use conventional NN for system identification, they cannot solve the MPC problem to global optimality. Our work shows how the proposed ICNN control algorithm achieves the benefits from both sides of the world. The optimization with respect to inputs can be implemented using off-the-shelf deep learning optimizers, while we are able to obtain good identification accuracies and tractable computational optimization problems by using proposed method at the same time.
|
| 33 |
+
|
| 34 |
+
# 2 CLOSED-LOOP CONTROL WITH INPUT CONVEX NEURAL NETWORKS
|
| 35 |
+
|
| 36 |
+
In this paper, we consider the settings where a neural network is used in a closed-loop system. The fundamental goal is to optimize system performance which is beyond the learning performance of network on its own. In this section we describe how input convex neural networks (ICNN) can be extremely useful in these systems by considering two related problems. First, we show how ICNN perform in single-shot optimization problems. Then we extend the results to an input convex recurrent neural networks (ICRNN), which allows us to both capture systems’ complex dynamics and make time-series decisions.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Input convex neural network. Input convex neural network. (a) Input convex feed-forward neural networks (ICNN). One notable addition is the direct “passthrough” layers $\mathbf { D } _ { 2 : k }$ that connect the inputs to hidden units for better model representation ability. (b) The proposed input convex recurrent neural networks (ICRNN) architectures. In our control settings, we keep all weights in both networks nonnegative, while expanding the inputs with $- \mathbf { u }$ .
|
| 40 |
+
|
| 41 |
+
# 2.1 SINGLE-SHOT PROBLEM
|
| 42 |
+
|
| 43 |
+
The following proposition states a simple sufficient condition for a neural network to be input convex:
|
| 44 |
+
|
| 45 |
+
Proposition 1. The feedforward neural network in Fig. 2(a) is convex from input to output given that all weights between layers $\mathbf { W } _ { 1 : k }$ and weights in the “passthrough” layers $\mathbf { D } _ { 2 : k }$ are non-negative, and all of the activation functions are convex and nondecreasing (e.g. ReLU).
|
| 46 |
+
|
| 47 |
+
The structure of the input convex neural network (ICNN) structure in Proposition 1 is motivated by the structure in (Amos et al., 2017) but modified to be more suitable to control of dynamical systems. In (Amos et al., 2017) it only requires $\mathbf { W } _ { 2 : k }$ to be non-negative while having no restrictions on weights $\mathbf { W } _ { 1 }$ and $\mathbf { D } _ { 2 : k }$ . Our construction achieves the exact representation by expanding the inputs to include both u $( \in \mathbb { R } ^ { d } )$ and $- \mathbf { u }$ . Then any negative weights in $\mathbf { W } _ { 1 }$ and $\mathbf { D } _ { 2 : k }$ in (Amos et al., 2017)’s ICNN structure is set to zero and its negation (which is positive) is added as the weight for corresponding $- \mathbf { u }$ . The reason for our construction is to allow the network to be “rolled out in time” when we are dealing with dynamical systems and multiple networks need to be composed together.
|
| 48 |
+
|
| 49 |
+
An simple example that demonstrates how the proposed ICNN can be used to fit a convex function comes form fitting the $| u |$ function. This function is convex and both decreasing and increasing. Let the activation function be $R e L U ( \cdot ) = \operatorname* { m a x } ( \cdot , 0 )$ . We can write $| u | = - u + 2 R e L U ( u )$ (Amos et al., 2017). However, in this representation, we need a negative weight, the $^ { - 1 }$ in front of $u$ , and this would be troublesome if we compose several networks together. In our proposed ICNN structure with all positive weights and input negation duplicates, we can write $| \boldsymbol { u } | = \overset { \cdot } { \boldsymbol { \nu } } + 2 R e L U ( \boldsymbol { u } )$ , where we impose a constraint $\nu = - u$ . Such doubline on the number of input variables may potentially make the network harder to train. Yet during control, having all of the weights positive maintains the convexity between inputs and outputs even if multiple steps are considered which will be discussed in Section 2.2. The constraint $\nu = - u$ is linear and can be easily included in any convex optimization.
|
| 50 |
+
|
| 51 |
+
This proposition follows directly from composition of convex functions (Boyd & Vandenberghe, 2004). Although it allows for any increasing convex activation functions, in this paper we work with the popular ReLU activation function. Two notable additions in ICNN compared with conventional feedforward neural networks are: 1) Addition of the direct “passthrough” layers connecting inputs to hidden layers and conventional feedforward layers connecting hidden layers for better representation power. 2) the expanded inputs that include both u and $- \mathbf { u }$ . The proposed ICNN structure is shown in Fig. 2(a). Note that such construction guarantees that the network is convex and non-decreasing with respect to the expanded inputs $\hat { \mathbf { u } } = \left[ \begin{array} { l } { \mathbf { u } } \\ { - \mathbf { u } } \end{array} \right]$ , while the output can achieve either decreasing or non-decreasing functions over u.
|
| 52 |
+
|
| 53 |
+
Fundamentally, ICNN allows us to use neural networks in decision making processes by guaranteeing the solution is unique and globally optimal. Since many complex input and output relationships can be learned through deep neural networks, it is natural to consider using the learned network in an optimization problem in the form of
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { \mathbf { u } } f ( \mathbf { u } ; \mathbf { W } ) } \\ { \displaystyle \mathrm { s . t . } \ \mathbf { u } \in \mathcal { U } , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\boldsymbol { \mathcal U }$ is a convex feasible space. Then if $f$ is an ICNN, optimizing over $\mathbf { u }$ is a convex problem, which can be solved efficiently to global optimality. Note that we will always duplicate the variables by introducing $\mathbf { v } = - \mathbf { u }$ , but again this does not change the convexity of the problem. Of course, since the weights of the network are restricted to be nonnegative, the performance of the network (e.g., classification) may be worse. A common thread we observe in this paper is that trading off classification performance with tractability can be preferable.
|
| 60 |
+
|
| 61 |
+
# 2.2 CLOSED-LOOP CONTROL AND RECURRENT NEURAL NETWORKS
|
| 62 |
+
|
| 63 |
+
In addition to the single-shot optimization problem in (1), we are interested in optimally controlling a dynamical system. To model the temporal dependency of the system dynamics, we propose to use recurrent neural networks (instead of feed-forward neural networks). Recurrent networks carry an internal state of the system, which introduces coupling with previous inputs to the system. Fig. 2(b) shows the proposed input convex recurrent neural networks (ICRNN) structure. This network maps from input $\hat { \mathbf { u } }$ to output $y$ with memory unit $\mathbf { z }$ according to the following Eq. (2),
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r l } & { \mathbf { z } _ { t } = \sigma _ { 1 } \left( \mathbf { U } \hat { \mathbf { u } } _ { t } + \mathbf { W } \mathbf { z } _ { t - 1 } + \mathbf { D } _ { 2 } \hat { \mathbf { u } } _ { t - 1 } \right) , } \\ & { y _ { t } = \sigma _ { 2 } \left( \mathbf { V } \mathbf { z } _ { t } + \mathbf { D } _ { 1 } \mathbf { z } _ { t - 1 } + \mathbf { D } _ { 3 } \hat { \mathbf { u } } _ { t } \right) , } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\hat { \mathbf { u } } = \left[ \mathbf { \Pi } _ { - \mathbf { u } } ^ { \mathbf { u } } \right]$ , and $D _ { 1 } , D _ { 2 } , D _ { 3 }$ are added direct “passthrough” layers for augmenting representation power. If we unroll the dynamics with respect to time, we have $y _ { t } = f ( \hat { \mathbf { u } } _ { 1 } , \hat { \mathbf { u } } _ { 2 } , . . . , \hat { \mathbf { u } } _ { t } ; \boldsymbol { \theta } )$ where $\theta =$
|
| 70 |
+
|
| 71 |
+
$[ \mathbf { U } , \mathbf { V } , \mathbf { W } , \mathbf { D } _ { 1 } , \mathbf { D } _ { 2 } , \mathbf { D } _ { 3 } ]$ are network parameters, and $\sigma _ { 1 } , \sigma _ { 2 }$ denote the nonlinear activation functions.
|
| 72 |
+
The next proposition states a sufficient condition for the network to be input convex.
|
| 73 |
+
|
| 74 |
+
Proposition 2. The network shown in Fig. $2 ( b )$ is a convex function from inputs to output if all weights $U , V , W , D _ { 1 } , D _ { 2 } , D _ { 3 }$ are non-negative, and all activation functions are convex and nondecreasing (e.g. ReLU).
|
| 75 |
+
|
| 76 |
+
The proof of this proposition again follows directly from the composition rule of convex functions. Similarly to the ICNN case, by expanding the inputs vector to include both $\mathbf { u }$ and $- \mathbf { u }$ and restricting all weights to be non-negative, the resulted ICRNN structure is a convex and non-decreasing mapping from inputs to output.
|
| 77 |
+
|
| 78 |
+
The proposed ICRNN structure can be leveraged to represent system dynamics for close-loop control. Consider a physical system with discrete-time dynamics, at time step $t$ , let’s define $\mathbf { s } _ { t }$ as the system states, $\mathbf { u } _ { t }$ as the control actions, and $y _ { t }$ as the system output. For example, for the real-time control of a building system, $\mathbf { s } _ { t }$ includes the room temperature, humidity, etc; $\mathbf { u } _ { t }$ denotes the building appliance scheduling, room temperature set-points, etc; and output $y _ { t }$ is the building energy consumption. In addition, there maybe exogenous variables that impact the output of the system, for example, outside temperature will impact the energy consumption of the building. However, since the exogenous variables are not impacted by any of the control actions we take, we suppress them in the formulation below. The time evolution of a system is described by
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r } { y _ { t } = f ( \mathbf { s } _ { t } , \mathbf { u } _ { t } ) , } \\ { \mathbf { s } _ { t + 1 } = g ( \mathbf { s } _ { t } , \mathbf { u } _ { t } ) } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where (4b) describes the coupling between the current inputs to the future system states. Physical systems described by (4) may have significant inertia in the sense that the outcome of any control actions is delayed in time and there are significant couplings across time periods.
|
| 85 |
+
|
| 86 |
+
Since we use ICRNNs to represent both the system dynamics $g ( \cdot )$ and the output $f ( \cdot )$ , the control variable u expands as uˆ . The optimal receding horizon control problem at time $t$ can be written as,
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l } { \underset { \mathbf { u } , \mathbf { u } + 1 , \mathbf { u } + 1 } { \mathrm { m i n i m i z e } } } & { C ( \hat { \mathbf { x } } , \mathbf { y } ) = \overset { t + T } { \underset { \mathbf { u } \in \mathcal { I } } { \sum } } J ( \hat { \mathbf { x } } _ { \tau } , y _ { \tau } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { y _ { \tau } = f ( \hat { \mathbf { x } } _ { \tau - n _ { w } } , \hat { \mathbf { x } } _ { \tau - n _ { w } + 1 } , \dots , \hat { \mathbf { x } } _ { \tau } ) , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { s } _ { \tau } = g ( \hat { \mathbf { x } } _ { \tau - n _ { w } } , \hat { \mathbf { x } } _ { \tau - n _ { w } + 1 } , \dots , \hat { \mathbf { x } } _ { \tau - 1 } , \hat { \mathbf { u } } _ { \tau } ) , \forall \tau \in [ t , t + T ] } \\ & { \hat { \mathbf { x } } _ { \tau } = \left[ \underset { \mathbf { u } \tau } { \hat { \mathbf { s } } _ { \tau } } \right] , \ \hat { \mathbf { u } } _ { \tau } = \left[ \mathbf { u } _ { \tau } \right] , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { v } _ { \tau } = - \mathbf { u } _ { \tau } , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { s } _ { \tau } \in \mathcal { I } _ { f o o s h b l e } , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { u } _ { \tau } \in \mathcal { U } _ { f o o s h b l e } , \forall \tau \in [ t , t + T ] } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where a new variable $\hat { \mathbf { x } } = \left[ \mathbf { s } _ { t } , \hat { \mathbf { u } } _ { t } \right]$ is introduced for notational simplicity, which called system inputs. It is the collection of system states $\mathbf { s } _ { t }$ and duplicated control actions $\mathbf { u } _ { t }$ and $- \mathbf { u } _ { t }$ , therefore ensuring the mapping from ${ \bf u } _ { t }$ to any future states and outputs remains convex. $J ( \hat { \mathbf { x } } _ { \tau } , y _ { \tau } )$ is the control system cost incurs at time $\tau$ , that is a function of both the system inputs $\hat { \mathbf { x } } _ { \tau }$ and output $y _ { \tau }$ . The functions $f ( \cdot )$ and $g ( \cdot )$ in Eq. (5b)-(5c) are parameterized as ICRNNs, which represent the system dynamics from sequence of inputs $\big ( \hat { \mathbf { x } } _ { \tau - n _ { w } } , \hat { \mathbf { x } } _ { \tau - n _ { w } + 1 } , . . . , \hat { \mathbf { x } } _ { \tau } \big )$ to the system output $y _ { \tau }$ , and the dynamics from control actions to system states, respectively. $n _ { w }$ is the memory window length of the recurrent neural network. The equations (5d) and (5e) duplicate the input variables $\mathbf { u }$ and enforce the consistency condition between $\mathbf { u }$ and its negation v. Lastly, (5f) and $( 5 \mathrm { g } )$ are the constraints on feasible system states and control actions respectively. Note that as a general formulation, we do not include the duplication tricks on state variables, so the dynamics fitted by (5b) and (5c) are non-decreasing over state space, which are not equivalent to those dynamics represented by linear systems. However, since we are not restricting the control space, and we have explicitly included multiple previous states in the system transition dynamics, so the non-decreasing constraint over state space should not restrict the representation capacity by much. In Section.3 we theoretically prove the representability of proposed networks.
|
| 93 |
+
|
| 94 |
+
Optimization problem in (5) is a convex optimization with respect to (w.r.t.) inputs $\mathbf { u } = [ \mathbf { u } _ { t } , . . . , \mathbf { u } _ { t + T } ]$ provided the cost function $J ( \hat { \mathbf { x } } _ { \tau } , y _ { \tau } ) = J ( \mathbf { s } _ { \tau } , \hat { \mathbf { u } } _ { \tau } , y _ { \tau } )$ is convex w.r.t. $\hat { \mathbf { u } } _ { \tau }$ , and convex, nondecreasing w.r.t. $\mathbf { s } _ { \tau }$ and $y _ { \tau }$ . A problem is convex if and only if both the objective function and constraints are convex. In the above problem, $J ( \mathbf { s } _ { \tau } , \hat { \mathbf { u } } _ { \tau } , y _ { \tau } )$ is convex and nondecreasing w.r.t. $\mathbf { s } _ { \tau }$ and $y _ { \tau } ; \mathbf { s } _ { \tau }$ and $y _ { \tau }$ are parameterized as ICRNNs, i.e., (5a) and (5b), such that they are convex w.r.t. $\hat { \mathbf { u } } _ { \tau }$ . Therefore following the composition rule of convex functions, the objective function is convex w.r.t. inputs $\mathbf { u } = [ \mathbf { u } _ { t } , . . . , \mathbf { u } _ { t + T } ]$ . Besides, all the equality constraints (5d) and (5e) are affine. Suppose both the state feasibile set (5f) and action feasibile set $( 5 \mathrm { g } )$ are convex, the overall optimization is convex.
|
| 95 |
+
|
| 96 |
+
The convexity of the problem in (5) guarantees that it can be solved efficiently and optimally using gradient descend method. Since both the objective function (5a) and the constraints (5b)-(5c) are parameterized as neural networks, and their gradients can be calculated via back-propagation with the modification where cost is propagated to the input rather than the weights of the network. For implementation, the gradients can be convinently calculated via existing modules such as Tensorflow viaback-propagation. Let $\mathbf { u } ^ { * } = \{ \mathbf { u } _ { t } ^ { * } , \mathbf { u } _ { t + 1 } ^ { * } , . . . , \mathbf { u } _ { t + T } ^ { * } \}$ be the optimal solution of the optimization problem at time $t$ . Then the first element of $\mathbf { u } ^ { * }$ is implemented to the real-time system control, that is $\mathbf { u } _ { t } ^ { * }$ . The optimization problem is repeated at time $t + 1$ , based on the updated state prediction using $\mathbf { u } _ { t } ^ { * }$ , yielding a model predictive control strategy.
|
| 97 |
+
|
| 98 |
+
# 3 EFFICIENCY AND REPRESENTATION POWER OF ICNN
|
| 99 |
+
|
| 100 |
+
Besides the computational traceability of the input convex networks, as an system identification model, we are also interested its predictive accuracies and capacity. This section provides theoretical analysis on the representation ability and efficiency of input convex neural networks.
|
| 101 |
+
|
| 102 |
+
# 3.1 REPRESENTATION POWER OF INPUT CONVEX NEURAL NETWORK
|
| 103 |
+
|
| 104 |
+
Definition 1. Given a function $f : \mathbb { R } ^ { d } \mathbb { R }$ , we say that the function $\hat { f }$ approximate $f$ within ε if $| f ( \mathbf { x } ) - { \hat { f } } ( \mathbf { x } ) | \leq \varepsilon$ for all $\mathbf { X }$ in the domain of $f$ .
|
| 105 |
+
|
| 106 |
+
Theorem 1. [Representation power of ICNN] For any Lipschitz convex function over a compact domain, there exists a neural network with nonnegative weights and ReLU activation functions that approximates it within $\varepsilon$ .
|
| 107 |
+
|
| 108 |
+
Lemma 1. Given a continuous Lipschitz convex function $f : \mathbb { R } ^ { d } \mathbb { R }$ with compact domain and $\varepsilon > 0$ , it can be approximated within ε by maximum of a finite number of affine functions. That is, there exists $\hat { f } ( \mathbf { x } ) \stackrel { } { = } \mathrm { m a x } _ { i = 1 , \ldots , N } \{ { \mu _ { \mathrm { i } } } ^ { T } \mathbf { x } + b _ { i } \}$ such that $| { \dot { f } } ( \mathbf { x } ) { \dot { - } } { \hat { f } } ( \mathbf { x } ) | \leq \varepsilon$ for all $\mathbf { x } \in d o m f$ .
|
| 109 |
+
|
| 110 |
+
Sketch of proof for Theorem 1. Supposing Lemma 1 is true, the proof of Theorem 1 boils down to showing that neural network with nonnegative weights and ReLU activation functions can exactly represent a maximum of affine functions. The proof is constructive. We first construct a neural network with ReLU activation functions and both positive and negative weights, then we show that the weights between different layers of the network can be restricted to be nonnegative by a simple duplication trick. Specifically, since the weights in the input layer and passthrough layers in the ICNN can be negative, we simply add a negation of each input variable (e.g. both $\mathbf { X }$ and $- \mathbf { X }$ are given as inputs) to the network. These variables need satisfy a consistency constraint since one is the negation of the other. Since this constraint is linear, it preserves the convexity of optimization problems. The details of the proofs are given in the Appendix B.
|
| 111 |
+
|
| 112 |
+
This proof is similar in spirit to theorems in (Hanin, 2017; Arora et al., 2016). The key new result is a simpler construction than the one used in (Hanin, 2017) and the restriction to nonnegative weights between the layers. □
|
| 113 |
+
|
| 114 |
+
Similar to Theorem 1, an analogous result about the representation power of ICRNN can be shown for systems with convex dynamics. Given a dynamical system described by rolled out system dynamics $y _ { t } = f ( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { t } )$ is convex, then there exists a recurrent neural network with nonnegative weights and ReLU activation functions that approximates it within ε. A broad range of systems can be captured by this model. For example, the linear quadratic (Gaussian) regulator problem can be described using a ICRNN if we identify $y$ as the cost of the regulator (Skogestad & Postlethwaite, 2007; Boyd et al., 1994).1 An example of a nonlinear system is the control of electrochemical batteries. It can be shown from first principles that the degradation of these types of batteries is convex in their charge and discharge actions (Shi et al., 2018) and our framework offers a powerful data-driven way to control batteries found in electric vehicles, cell phones, and power systems.
|
| 115 |
+
|
| 116 |
+
# 3.2 ICNN VS. CONVEX PIECEWISE LINEAR FITTING
|
| 117 |
+
|
| 118 |
+
In the proof of Theorem 1, we first approximate a convex function by a maximum of affine functions then construct a neural network according to this maximum. Then a natural question is why learn a neural network and not directly the affine functions in the maximum? This approach was taken in (Magnani & Boyd, 2009), where a convex piecewise-linear function (max of affine functions) are directly learned from data through a regression problem.
|
| 119 |
+
|
| 120 |
+
A key reason that we propose to use ICNN (or ICRNN) to fit a function rather than directly finding a maximum of affine functions is that the former is a much more efficient parameterization than the latter. As stated in Theorem 2, a maximum of $K$ affine functions can be represented by an ICNN with $K$ layers, where each layer only requires a single ReLU activation function. However, given a single layer ICNN with $K$ ReLU activation functions, it may take a maximum of $2 ^ { K }$ affine functions to represent it exactly. Therefore in practice, it would be much easier to train a good ICNN than finding a good set of affine functions.
|
| 121 |
+
|
| 122 |
+
Theorem 2. [Efficiency of Representation]
|
| 123 |
+
|
| 124 |
+
1. Let fICNN : $\mathbb { R } ^ { d } \to \mathbb { R }$ be an input convex neural network with K ReLU activation functions. Then $\Omega ( 2 ^ { K } )$ functions are required to represent fICNN using a max of affine functions. 2. Let $f _ { C P L } : \mathbb { R } ^ { d } \mathbb { R }$ be a max of $K$ affine functions. Then $O ( K )$ activation functions are sufficient to represent fCPL exactly with an ICNN.
|
| 125 |
+
|
| 126 |
+
The proof of this theorem is given in Appendix C.
|
| 127 |
+
|
| 128 |
+
# 4 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
In this section, we verify the effectiveness of ICNN and ICRNN by presenting experimental results on two decision-making problems: continuous control benchmarks on MuJoco locomotion tasks (Todorov et al., 2012) and energy management of reference large-scale commercial building (Crawley et al., 2001), respectively. The proposed method can be used as a flexible building block in decision making problems, where we use ICNN to represent system dynamics for MuJoco simulators, and we use ICRNN in an end-to-end fashion to find the optimal control inputs. Both examples demonstrate that proposed method: 1) discovers the connection between controllable variables and the system dynamics or cost objectives; 2) is lightweight and sample-efficient; 3) achieves generalizable and more stable control performances compared with previous model-based reinforcement learning and simplified linear control approaches.
|
| 131 |
+
|
| 132 |
+
# 4.1 MUJOCO LOCOMOTION TASKS
|
| 133 |
+
|
| 134 |
+
Experimental Setup We consider four simulated robotic locomotion tasks: swimmer, half-cheetah, hopper, ant implemented in MuJoCo under the OpenAI rllab framework (Duan et al., 2016). We train and represent the locomotion state transition dynamics $\mathbf { s } _ { t + 1 } = g ( \mathbf { s } _ { t } , \mathbf { u } _ { t } ) ^ { 2 }$ using a 2-layer ICNN with ReLU activations, which could be integrated into the following finite-horizon control problem to find the optimal action sequence $\mathbf { u } _ { t } , . . . , \mathbf { u } _ { t + T }$ for fixed looking ahead horizon $T$ :
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { r l } { \underset { \mathbf { u } _ { t } , \ldots , \mathbf { u } _ { t + T } } { \mathrm { m i n i m i z e } } } & { - \underset { \tau = t } { \overset { t + T } { \sum } } r ( \mathbf { s } _ { \tau } , \mathbf { u } _ { \tau } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \mathbf { s } _ { \tau + 1 } = g ( \mathbf { s } _ { \tau } , \mathbf { u } _ { \tau } ) , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { u } _ { \tau } \in \mathcal { U } _ { f e a s i b l e } , \forall \tau \in [ t , t + T ] } \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
where the objective (6a) is convex because $r ( \mathbf { s } _ { \tau } , \mathbf { u } _ { \tau } )$ is a concave reward function related to system states such as velocity and control actions (the detailed forms of $r ( \mathbf { s } _ { \tau } , \mathbf { u } _ { \tau } )$ for different locomotion tasks are listed in Appendix D). To achieve better model generalization on locomotion dynamics, we also followed (Nagabandi et al., 2018), and applied DAGGER (Ross et al., 2011) to iteratively collect labeled robotic rollouts and train the supervised dyamics model (6b) using on-policy locomotion samples. See Appendix D for furthur simulation hyperparameters and experimental details. For each aggregated iterations of collecting rollouts data and training ICNN model, we validate the controller performance on standalone validation rollouts by optimally solving (6).
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 3: Average rollout reward for random-shooting method vs ICNN on four MuJoCo tasks. The horizontal axis indicates the aggregated iteration, and vertical axis indicates average reward. Plotted curves are averaged over 3 random seeds, and the shaded region shows the standard deviation.
|
| 144 |
+
|
| 145 |
+
Baselines We compare our system modeling and continuous control method with state-of-the-art model-based RL algorithm (Nagabandi et al., 2018), where the authors used a normal multi-layer perceptrons (MLP) model to parameterize the system dynamics (6b). We refer to their method as random-shooting algorithm, since they can not solve (6) to optimality, and they used pre-defined number of random-shooting control sequences (denoted as $K$ ) to query the trained MLP and find a best sequence as the rollout policy. Such a method is able to find good control policies in the degree of $\mathrm { \dot { 1 } 0 ^ { 4 } }$ timesteps, which are much more sample-efficient than model-free RL methods (Duan et al., 2016; Mnih et al., 2015). To make fair comparisons with baseline method, we keep the same setup on the rollouts number and initial random action training. Our framework makes the neural networks convex w.r.t input by adding passthrough links to the 2-layer model and keeping all the layer weights nonnegative. We evaluate the performance of both algorithms on three randomly selected fixed random seeds for four tasks. Similar to the fine tuning steps in (Nagabandi et al., 2018), control policies found by ICNN can also be plugged in as initialized policies for subsequent model-free reinforcement learning algorithms.
|
| 146 |
+
|
| 147 |
+
Continuous Control Performance During training, we found both ICNN and MLP are able to predict robotic states quite accurately based on (6b). This provides a good system dynamics model which is beneficial to solve control policies. The control performances are shown in Fig. 3, where we compare the average reward of proposed method and random-shooting method with $K = 1 0 0$ over 10 validation rollouts during each aggregated iteration (see Fig. 8 in Appendix D.4 for random shooting performance with varying $K _ { \cdot }$ ). The policy found by ICNN outperforms the random-shooting method in all settings with varying horizon $T$ for all of the four locomotion tasks.
|
| 148 |
+
|
| 149 |
+
Intuitively, ICNN should perform better when the action space is larger, since random-shooting method can not search through the action space efficiently with a fixed $K$ . This is illustrated in the example of ant, where with more training samples aggregated and MLP model representing more accurate dynamics, random-shooting gets stuck to find better control policies and there is little improvement reflected in the control performance. Moreover, since we are skipping the expensive process on calculating rewards of each random shooting trajectory and finding the best one, our method only implements ICNN inference step based on (6) and is much faster than random shooting methods in most settings, especially when $K$ is large (see Table. 2 for wall-clock time in Appendix D.3). For instance, in the case of Swimmer, our proposed method only uses $\frac { 1 } { 5 }$ of time compared to (Nagabandi et al., 2018). This also indicates that our method is even much more sample-efficient than off-the-shelf model-free RL methods, where we use two orders of magnitude less training data to reach similar validation rewards (Duan et al., 2016; Mnih et al., 2015) (see Fig. 9 in Appendix D.4).
|
| 150 |
+
|
| 151 |
+
# 4.2 BUILDING ENERGY MANAGEMENT
|
| 152 |
+
|
| 153 |
+
Experimental Setup We now move on to optimally control a dynamical system with significant inertia. We consider the real-time control problem of building’s HVAC (heating, ventilation, and air conditioning) system to reduce its energy consumption. Building energy management remains to be a hard problem in control area. The exact system dynamics are unknown and hard to model due to the complex heating transfer dynamics, time-varying environments and the scale of the system in terms of states and actions (Kouro et al., 2009). At time $t$ , we assume the building’s running profile $\mathbf { x } _ { t } : = \left[ \mathbf { s } _ { t } , \mathbf { u } _ { t } \right]$ is available, where $\mathbf { s } _ { t }$ denotes building system states, including outside temperature, room temperature measurements, zone occupancies and etc. $\mathbf { u } _ { t }$ denotes a collection of control actions such as room temperature set points and appliance schedule. Output is the electricity consumption $P _ { t }$ .
|
| 154 |
+
|
| 155 |
+
This is a model predictive control problem in the sense that we want to find the best control inputs that minimize the overall energy consumption of building by looking ahead several time steps. To achieve this goal, we firstly learn an ICRNN model $f ( \cdot )$ of the building dynamics, which is trained to minimize the error between $P _ { t }$ and $f \left( \mathbf { x } _ { t - n _ { w } } , . . . , \mathbf { x } _ { t } \right)$ , while $n _ { w }$ denotes the memory window of recurrent neural networks. Then we solve:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\begin{array} { r l } { \underset { \mathbf { u } _ { t } , . . . , \mathbf { u } _ { t + T } } { \mathrm { m i n i m i z e } } } & { \overset { t + T } { \underset { \tau = t } { \sum } } f \big ( \mathbf { x } _ { \tau - n _ { w } } , . . . , \mathbf { x } _ { \tau } \big ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \mathbf { s } _ { \tau } = g \big ( \mathbf { x } _ { \tau - n _ { w } } , . . . , \mathbf { x } _ { \tau - 1 } , \mathbf { u } _ { \tau } \big ) , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { u } _ { \tau } \leq \mathbf { u } _ { \tau } \leq \bar { \mathbf { u } } _ { \tau } , \forall \tau \in [ t , t + T ] } \\ & { \mathbf { s } _ { \tau } \leq \mathbf { s } _ { \tau } \leq \bar { \mathbf { s } } _ { \tau } , \forall \tau \in [ t , t + T ] } \end{array}
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
where the objective (7a) is minimizing the total energy consumption in future $T$ steps ( $T$ is the model predictive control horizon), and (7b) is used for modeling building states, in which $g ( \cdot )$ are parameterized as ICRNNs. Note that the formulation (7) is also flexible with different loss functions. For instance, in practice, we could reuse trained dynamics model (7b), and integrate electricity prices into the overall objective so that we could directly learn real-time actions to minimize electricity bills (please refer to Appendix E for more results). The constraints on control actions ${ \bf u } _ { t }$ and system states $\mathbf { s } _ { t }$ are given in (7c) and (7d). For instance, the temperature set points as well as real measurements should not exceed user-defined comfort regions.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Results for constrained optimization of building energy management. (a) ICRNN is able to model the building dynamics as accurately as conventional RNN; (b) Compared to conventional RNN model, ICRNN finds control actions which lead to $1 1 . 5 2 \%$ more of energy savings, and (c) ICRNN provides stable control actions while decisions generated by conventional RNN vary dramatically.
|
| 165 |
+
|
| 166 |
+
To test the performance of the proposed method, we set up a 12-story large office building, which is a reference EnergyPlus commercial building model from US Department of Energy (DoE) 3, with a total floor area of 498,584 square feet which is divided into 16 separate zones. By using the whole year’s weather profile, we simulate the building running through the year and record $( \mathbf { x } _ { t } , P _ { t } )$ with a resolution of 10 minutes. We use 10 months’ data to train the ICRNN and subsequent 2 months’ data for testing. We use 39 building system state variables $\mathbf { s } _ { t }$ (uncontrollable), along with 16 control variables $\mathbf { u } _ { t }$ . Output is a single value of building energy consumption at each time step. We set the model predictive control horizon $T = 3 6$ (six hours). We employ an ICRNN with recurrent layer of dimension 200 to fit the building input-output dynamics $f ( \cdot )$ . The model is trained to minimize the MSE between its predictions and the actual building energy consumption using stochastic gradient descent. We use the same network structure and training scheme to fit state transition dynamics $g ( \cdot )$
|
| 167 |
+
|
| 168 |
+
Baseline We set the model-based forecasting and optimization benchmark using an linear resistorcircuit (RC) circuit model to represent the heat transfer in building systems, and solve for the optimal control actions via MPC (Ma et al., 2012). At each step, MPC algorithm takes into account the forecasted states of the building based on the fitted RC model and implements the current step control actions. We also compare the performance of ICRNN against the conventionally trained RNN in terms of building dynamics fitting performance and control performance. To solve the MPC problem with conventional RNN models, we also use gradient-based method with respect to controls. However, since conventional RNN models are generally not convex from input to output, there is no guarantee to reach a global optimum (or even a local one).
|
| 169 |
+
|
| 170 |
+
Results In terms of the fitting performance, ICRNN provides a competitive result compared to conventional RNN model. The overall test root mean square error (RMSE) is 0.054 for ICRNN and 0.051 for conventional RNN, both of which are much smaller than the error made by RC model (0.240). Fig. 4(a) shows the fitting performance on 5 working days in test data. This illustrates the good performance of ICRNN in modeling building HVAC system dynamics. Then by using the learned ICRNN model of building dynamics, we obtain the suggested room control actions ${ \boldsymbol u } _ { t } ^ { * }$ by solving the optimal building control problem (7). As shown in Fig. 4(b), with the same constraints on building temperature interval of $[ 1 9 ^ { \circ } C , 2 4 ^ { \circ } C ]$ , the building energy consumption is reduced by $2 3 . 2 5 \%$ after implementing the new temperature set points calculated by ICRNN. On the contrary, since there is no guarantee for finding optimal control actions by optimizing over conventional RNN’s input, the control solutions given by conventional RNN could only reduce $1 1 . 7 3 \%$ of electricity. Solutions given by RC model only saves $4 . 0 7 \%$ of electricity. More importantly, in Fig. 4(c) we demonstrate the control actions outputted by our method against MPC with conventional RNN in two randomly selected building zones, the building basement and top floor central area. It shows that our proposed approach is able to find a group of stable control actions for the building system control. While in the conventional RNN case, it generates control set points which have undesirable, drastic variations.
|
| 171 |
+
|
| 172 |
+
# 5 SUMMARY AND DISCUSSION
|
| 173 |
+
|
| 174 |
+
In this work we proposed a novel optimal control framework that uses deep neural networks engineered to be convex from the input to the output. This framework bridges machine learning and control by representing system dynamics using input convex (recurrent) neural networks. We show that many interesting data-driven control problems can be cast as convex optimization problems using the proposed network architecture. Experiments on both benchmark MuJoCo locomotion tasks and building energy management demonstrate our methodology’s potential in a variety of control and optimization problems.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Brandon Amos, Lei Xu, and J Zico Kolter. Input convex neural networks. In International Conference on Machine Learning, pp. 146–155, 2017.
|
| 179 |
+
|
| 180 |
+
Raman Arora, Amitabh Basu, Poorya Mianjy, and Anirbit Mukherjee. Understanding deep neural networks with rectified linear units. arXiv preprint arXiv:1611.01491, 2016.
|
| 181 |
+
|
| 182 |
+
Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 183 |
+
|
| 184 |
+
Stephen Boyd, Laurent El Ghaoui, Eric Feron, and Venkataramanan Balakrishnan. Linear matrix inequalities in system and control theory, volume 15. Siam, 1994.
|
| 185 |
+
|
| 186 |
+
Chia-Chin Cheng, S Pouffary, N Svenningsen, and John M Callaway. The kyoto protocol, the clean development mechanism and the building and construction sector: A report for the unep sustainable buildings and construction initiative, 2008.
|
| 187 |
+
|
| 188 |
+
Morris G Cox. An algorithm for approximating convex functions by means by first degree splines. The Computer Journal, 14(3):272–275, 1971.
|
| 189 |
+
|
| 190 |
+
Drury B Crawley, Linda K Lawrie, Frederick C Winkelmann, Walter F Buhl, Y Joe Huang, Curtis O Pedersen, Richard K Strand, Richard J Liesen, Daniel E Fisher, Michael J Witte, et al. Energyplus: creating a new-generation building energy simulation program. Energy and buildings, 33(4): 319–331, 2001.
|
| 191 |
+
|
| 192 |
+
Marc Peter Deisenroth, Carl Edward Rasmussen, and Dieter Fox. Learning to control a low-cost manipulator using data-efficient reinforcement learning. 2011.
|
| 193 |
+
|
| 194 |
+
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.
|
| 195 |
+
|
| 196 |
+
Momcilo M Gavrilovi ˇ c. Optimal approximation of convex curves by functions which are piecewise´ linear. Journal of Mathematical Analysis and Applications, 52(2):260–282, 1975.
|
| 197 |
+
|
| 198 |
+
Boris Hanin. Universal function approximation by deep neural nets with bounded width and relu activations. arXiv preprint arXiv:1708.02691, 2017.
|
| 199 |
+
|
| 200 |
+
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.
|
| 201 |
+
|
| 202 |
+
Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
|
| 203 |
+
|
| 204 |
+
Samir Kouro, Patricio Cortés, René Vargas, Ulrich Ammann, and José Rodríguez. Model predictive control—a simple and powerful method to control power converters. IEEE Transactions on industrial electronics, 56(6):1826–1838, 2009.
|
| 205 |
+
|
| 206 |
+
Sergey Levine and Vladlen Koltun. Learning complex neural network policies with trajectory optimization. In International Conference on Machine Learning, pp. 829–837, 2014.
|
| 207 |
+
|
| 208 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 209 |
+
|
| 210 |
+
Lennart Ljung. System identification. In Signal analysis and prediction, pp. 163–173. Springer, 1998.
|
| 211 |
+
|
| 212 |
+
Yudong Ma, Anthony Kelman, Allan Daly, and Francesco Borrelli. Predictive control for energy efficient buildings with thermal storage: Modeling, stimulation, and experiments. IEEE Control Systems, 32(1):44–64, 2012.
|
| 213 |
+
|
| 214 |
+
Alessandro Magnani and Stephen P Boyd. Convex piecewise-linear fitting. Optimization and Engineering, 10(1):1–17, 2009.
|
| 215 |
+
|
| 216 |
+
David Meger, Juan Camilo Gamboa Higuera, Anqi Xu, Philippe Giguere, and Gregory Dudek. Learning legged swimming gaits from experience. In Robotics and Automation (ICRA), 2015 IEEE International Conference on, pp. 2332–2338. IEEE, 2015.
|
| 217 |
+
|
| 218 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Daniel O’Neill, Marco Levorato, Andrea Goldsmith, and Urbashi Mitra. Residential demand response using reinforcement learning. In Smart Grid Communications (SmartGridComm), 2010 First IEEE International Conference on, pp. 409–414. IEEE, 2010.
|
| 225 |
+
|
| 226 |
+
Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011.
|
| 227 |
+
|
| 228 |
+
HL Royden and PM Fitzpatrick. Real analysis. 4th, 2010.
|
| 229 |
+
|
| 230 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015.
|
| 231 |
+
|
| 232 |
+
Pervez Hameed Shaikh, Nursyarizal Bin Mohd Nor, Perumal Nallagownden, Irraivan Elamvazuthi, and Taib Ibrahim. A review on optimized control systems for building energy and comfort management of smart sustainable buildings. Renewable and Sustainable Energy Reviews, 34: 409–429, 2014.
|
| 233 |
+
|
| 234 |
+
Y. Shi, B. Xu, Y. Tan, D. Kirschen, and B. Zhang. Optimal battery control under cycle aging mechanisms in pay for performance settings. IEEE Transactions on Automatic Control, pp. 1–1, 2018. ISSN 0018-9286. doi: 10.1109/TAC.2018.2867507.
|
| 235 |
+
|
| 236 |
+
Sigurd Skogestad and Ian Postlethwaite. Multivariable feedback control: analysis and design, volume 2. Wiley New York, 2007.
|
| 237 |
+
|
| 238 |
+
Nagender Kumar Suryadevara, Subhas Chandra Mukhopadhyay, Sean Dieter Tebje Kelly, and Satinder Pal Singh Gill. Wsn-based smart sensors and actuator for power management in intelligent buildings. IEEE/ASME transactions on mechatronics, 20(2):564–571, 2015.
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
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. 6000–6010, 2017.
|
| 243 |
+
|
| 244 |
+
Shuning Wang. General constructive representations for continuous piecewise-linear functions. IEEE Transactions on Circuits and Systems I: Regular Papers, 51(9):1889–1896, 2004.
|
| 245 |
+
|
| 246 |
+
T. Wei, Y. Wang, and Q. Zhu. Deep reinforcement learning for building hvac control. In The Design and Automation Conference, 2017.
|
| 247 |
+
|
| 248 |
+
W. Wolf. Cyber-physical systems. Computer, 42:88–89, 2009.
|
| 249 |
+
|
| 250 |
+
Zhaohui Zhang, Ruilong Deng, Tao Yuan, and S Joe Qin. Distributed optimization of multi-building energy systems with spatially and temporally coupled constraints. In American Control Conference (ACC), 2017, pp. 2913–2918. IEEE, 2017.
|
| 251 |
+
|
| 252 |
+
# APPENDIX
|
| 253 |
+
|
| 254 |
+
# A. TOY EXAMPLE
|
| 255 |
+
|
| 256 |
+
Consider a synthetic example which contains two circles of noisy input data $\mathbf { u } \in \mathbb { R } ^ { 2 }$ , along with discrete data label $y \in \{ 0 , 1 \}$ which is based on input coming from inner loop $( y = 0 )$ or outer loop $( y = 1$ ). Suppose a decision maker is interested in finding the u that maximizes the probability of $y$ being 0. This optimization problem can be solved by firstly learning a neural network classifier from $\mathbf { u }$ to $y$ , and then to find the $\mathbf { u }$ point which minimizes the output of the neural network. More specifically, let $f _ { N N }$ be a conventional neural network and fICNN be an ICNN. Then the objective becomes minimizing $f _ { N N } ( { \mathbf { u } } )$ or $f _ { I C N N } ( \mathbf { u } )$ .
|
| 257 |
+
|
| 258 |
+
Figure 5 shows the decision boundaries for $f _ { N N }$ and fICNN, respectively. These networks are composed of 2 hidden layers, with 200 neurons in each layer, and are trained using the same random seed, same number of samples (100) until loss convergence. The decision boundaries of a conventional network have many “zigzags”, which makes solving (1) challenging, especially if u is constrained. In contrast, the ICNN has convex level sets (by construction) as decision boundaries, which leads to a convex optimization problem.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 5: Toy example on classifying circle data with label 0 (blue cross) and label 1 (red cross) along with conventional neural networks (left) and ICNN (right) decision contour lines. A decision maker is interested in finding a $\mathbf { u }$ that has the highest probability of being labeled 0.
|
| 262 |
+
|
| 263 |
+
APPENDIX B. PROOF OF THEOREM 1
|
| 264 |
+
|
| 265 |
+
Proof. Lemma 1 follows from well established facts in function analysis stating that piecewise linear functions are dense in the space of all continuous functions over compact sets (Royden & Fitzpatrick, 2010) and convex piecewise linear functions are dense in the space of all convex continuous functions (Cox, 1971; Gavrilovic, 1975). Using the fact that convex piecewise linear ´ functions can be represented as a maximum of affine functions (Magnani & Boyd, 2009; Wang, 2004) gives the desired result in the lemma.
|
| 266 |
+
|
| 267 |
+
Lemma 1 shows that all continuous Lipschitz convex functions $f ( \mathbf { x } ) : \mathbb { R } ^ { d } \mathbb { R }$ over convex compact sets can be approximated using maximum of affine functions. Then it suffices to show that an ICNN can exactly represent a maximum of affine functions. To do this, we first construct a neural network with ReLU activation function with both positive and negative weights that can represent a maximum of affine functions. Then we show how to restrict all weights to be nonnegative.
|
| 268 |
+
|
| 269 |
+
As a starting example, consider a maximum of two affine functions
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
f _ { C P L } ( \mathbf { x } ) = \operatorname* { m a x } \{ \mathbf { a } _ { 1 } ^ { T } \mathbf { x } + b _ { 1 } , \mathbf { a } _ { 2 } ^ { T } \mathbf { x } + b _ { 2 } \} .
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
To obtain the exact same function using a neural network, we first rewrite it as
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
f _ { C P L } ( \boldsymbol { x } ) = ( \mathbf { a } _ { 2 } ^ { T } \mathbf { x } + b _ { 2 } ) + \operatorname* { m a x } \left( ( \mathbf { a } _ { 1 } - \mathbf { a } _ { 2 } ) ^ { T } \mathbf { x } + ( b _ { 1 } - b _ { 2 } ) , 0 \right) .
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
Now define a two-layer neural network with layers $\mathbf { z } _ { 1 }$ and $\mathbf { z } _ { 2 }$ as shown in Fig. 6:
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
\begin{array} { r l } & { z _ { 1 } = \sigma \left( ( { \bf a } _ { 1 } - { \bf a } _ { 2 } ) ^ { T } { \bf x } + ( b _ { 1 } - b _ { 2 } ) \right) , } \\ & { z _ { 2 } = z _ { 1 } + { \bf a } _ { 2 } ^ { T } { \bf x } + b _ { 2 } } \end{array}
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
where $\sigma$ is the ReLU activation function and the second layer is linear. By construction, this neural network is the same function as $f _ { C P L }$ given in (8).
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 6: A simple two-layer neural networks. In alignment with (10), $W _ { 1 }$ denotes the first-layer weights ${ \bf a } _ { 1 } - { \bf a } _ { 2 }$ and bias $b _ { 1 } - b _ { 2 }$ , and $W _ { 2 }$ denotes the linear second layer. Direct layer is denoted as $D _ { 2 }$ for weights $\mathbf { a } _ { 2 }$ and bias $b _ { 2 }$ .
|
| 291 |
+
|
| 292 |
+
The above argument extends directly to a maximum of $K$ linear functions. Suppose
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
f _ { C P L } ( \mathbf { x } ) = \operatorname* { m a x } \{ \mathbf { a } _ { 1 } ^ { T } \mathbf { x } + b _ { 1 } , . . . , \mathbf { a } _ { K } ^ { T } \mathbf { x } + b _ { K } \}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Again the trick is to rewrite $f _ { C P L } ( \mathbf { x } )$ as a nested maximum of affine functions. For notational convenience, let $L _ { i } = \mathbf { a } _ { i } ^ { T } \mathbf { x } + b _ { i }$ , $L _ { i } ^ { \prime } = L _ { i } - L _ { i + 1 }$ . Then
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r l } { f _ { C P L } = \operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { K } \} } \\ { = \operatorname* { m a x } \{ \operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { K - 1 } \} , L _ { K } \} } \\ { = L _ { K } + \sigma \left( \operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { K - 1 } \} - L _ { K } \right) } \\ { } & { = L _ { K } + \sigma \left( \operatorname* { m a x } \{ \operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { K - 2 } \} , L _ { K - 1 } \} - L _ { K } , 0 \right) } \\ { } & { = L _ { K } + \sigma \left( L _ { K - 1 } - L _ { K } + \sigma \left( \operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { K - 2 } \} - L _ { K - 1 } , 0 \right) , 0 \right) } \\ { } & { = . . . } \\ { } & { = L _ { K } + \sigma \left( L _ { K - 1 } ^ { \prime } + \sigma \left( L _ { K - 2 } ^ { \prime } + \sigma \left( L _ { - } ^ { \prime } \sigma \left( L _ { 2 } ^ { \prime } + \sigma \left( L _ { 1 } - L _ { 2 } , 0 \right) , 0 \right) , . . . , 0 \right) , 0 \right) , 0 \right) . } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
The last equation describes a $K$ layer neural network, where the layers are:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l } & { z _ { 1 } = \sigma \left( L _ { 1 } - L _ { 2 } , 0 \right) = \sigma \left( \left( \mathbf { a } _ { 1 } - \mathbf { a } _ { 2 } \right) ^ { T } \mathbf { x } + \left( b _ { 1 } - b _ { 2 } \right) \right) , } \\ & { z _ { 2 } = \sigma \left( L _ { 2 } ^ { \prime } + z _ { 1 } , 0 \right) = \sigma \left( z _ { 1 } + \left( \mathbf { a } _ { 2 } - \mathbf { a } _ { 3 } \right) ^ { T } \mathbf { x } + \left( b _ { 2 } - b _ { 3 } \right) \right) , } \\ & { . . . . . . } \\ & { z _ { i } = \sigma \left( L _ { i } ^ { \prime } + z _ { i - 1 } , 0 \right) = \sigma \left( z _ { i - 1 } + \left( \mathbf { a } _ { i } - \mathbf { a } _ { i + 1 } \right) ^ { T } \mathbf { x } + \left( b _ { i } - b _ { i + 1 } \right) \right) , } \\ & { . . . . . . } \\ & { z _ { K } = z _ { K - 1 } + L _ { K } = h _ { K } \left( z _ { K - 1 } + L _ { K } \right) = \left( z _ { K - 1 } + \mathbf { a } _ { K } ^ { T } \mathbf { x } + b _ { K } \right) . } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
Each layer of of this neural network uses only a single activation function.
|
| 311 |
+
|
| 312 |
+
Although the above neural network exactly represent a maximum of linear functions, it is not convex since the coefficients between layers could be negative. In particular, each layer involves an inner product of the form $( \mathbf { a } _ { i } - \mathbf { a } _ { i + 1 } ) ^ { T } \mathbf { x }$ and the coefficients are not necessarily nonnegative. To overcome this, we simply expand the input to include $\mathbf { X }$ and $- \mathbf { X }$ . Namely, define a new input $\hat { \mathbf { x } } \in \mathbb { R } ^ { 2 d }$ as
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\hat { \mathbf { x } } = \left[ \begin{array} { l } { \mathbf { x } } \\ { - \mathbf { x } } \end{array} \right] .
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
Then any inner product of the form $\mathbf { h } ^ { T } \mathbf { x }$ can be written as
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
{ \begin{array} { r l } & { \mathbf { h } ^ { T } \mathbf { x } = { \displaystyle \sum _ { j = 1 } ^ { d } h _ { i } x _ { i } } } \\ & { \qquad = \displaystyle \sum _ { i : h _ { i } \geq 0 } h _ { i } x _ { i } + \displaystyle \sum _ { i : h _ { i } < 0 } h _ { i } x _ { i } } \\ & { \qquad = \displaystyle \sum _ { i : h _ { i } \geq 0 } h _ { i } x _ { i } + \displaystyle \sum _ { i : h _ { i } < 0 } ( - h _ { i } ) ( - x _ { i } ) } \\ & { \qquad = \displaystyle \sum _ { i : h _ { i } \geq 0 } h _ { i } { \hat { x } } _ { i } + \displaystyle \sum _ { i : h _ { i } \leq 0 } ( - h _ { i } ) ( { \hat { x } } _ { i + d } ) , } \end{array} }
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
where all coefficients are nonnegative in the above sum.
|
| 325 |
+
|
| 326 |
+
Therefore any inner product between a coefficient vector and the input $\mathbf { X }$ can be written as an inner product between a nonnegative coefficient vector and the expanded input $\hat { \mathbf { x } }$ . Therefore, without loss of generality, we can limit all of the weights between layers to be nonnegative, and thus the neural network to be input convex. Note that in optimization problems, we need to enforce consistency in $\hat { \mathbf { x } }$ be including (12) as a constraint. However, this is a linear equality constraint, which maintains the convexity of the optimization problem.
|
| 327 |
+
|
| 328 |
+
# APPENDIX C. PROOF OF THEOREM 2
|
| 329 |
+
|
| 330 |
+
Proof. The second statement of Theorem 2 directly follows the construction in the proof of Theorem 1, which shows that a maximum of $K$ affine functions can be represent by a $K$ -layer ICNN (with a single ReLU function in each layer). So it remains to show the first statement of Theorem 2.
|
| 331 |
+
|
| 332 |
+
To show that a maximum of affine functions can require exponential number of pieces to approximate a function specified by an ICNN with $K$ activation functions, consider a network with 1 hidden layer of K nodes and the weights of direct “passthrough” layers are set to 0:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
f _ { I C N N } ( \mathbf { x } ) = \sum _ { i = 1 } ^ { K } w _ { 1 i } \pmb { \sigma } ( \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } ) ,
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
It contains $3 K$ parameters: $\mathbf { w } _ { 0 i } , w _ { 1 i }$ and $b _ { i }$ , where $\mathbf { w } _ { 0 i } \in \mathbb { R } ^ { d }$ and $w _ { 1 i } , b _ { i } \in \mathbb { R }$ .
|
| 339 |
+
|
| 340 |
+
In order to represent the same function by a maximum of affine functions, we need to assess the value of every activation unit $\sigma ( \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } )$ . If $\mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } \geq 0 , \sigma ( \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } ) = \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i }$ ; otherwise, $\sigma ( \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } ) = 0$ . In total, we have $2 ^ { K }$ potential combinations of piecewise-linear function, including
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r l } { L _ { 1 } } & { = \left( \displaystyle \sum _ { i = 1 } ^ { K } w _ { 1 i } \mathbf { w } _ { 0 i } \right) ^ { T } \mathbf { x } + \displaystyle \sum _ { i = 1 } ^ { K } w _ { 1 i } b _ { i } , \mathrm { i f ~ a l l ~ } \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } \geq 0 } \\ { L _ { 2 } } & { = \left( \displaystyle \sum _ { i = 2 } ^ { K } w _ { 1 i } \mathbf { w } _ { 0 i } \right) ^ { T } \mathbf { x } + \displaystyle \sum _ { i = 2 } ^ { K } w _ { 1 i } b _ { i } , \mathrm { i f ~ } \mathbf { w } _ { 0 1 } ^ { T } \mathbf { x } + b _ { 1 } < 0 \mathrm { ~ a n d ~ a l l ~ o t h e r ~ } \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } \geq 0 } \\ { L _ { 3 } } & { = \left( w _ { 1 1 } \mathbf { w } _ { 0 1 } + \displaystyle \sum _ { i = 3 } ^ { K } w _ { 1 i } \mathbf { w } _ { 0 i } \right) ^ { T } \mathbf { x } + w _ { 1 i } b _ { i } + \displaystyle \sum _ { i = 3 } ^ { K } w _ { 1 i } b _ { i } , \mathrm { i f ~ } \mathbf { w } _ { 0 2 } ^ { T } \mathbf { x } + b _ { 2 } < 0 \mathrm { ~ a n d ~ o t h e r ~ } \mathbf { w } _ { 0 i } ^ { T } \mathbf { x } + b _ { i } \geq 0 } \\ & { \qquad \quad \cdots \cdots . } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
So the following maximum over $2 ^ { K }$ pieces is required to represent the single linear ICNN:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\operatorname* { m a x } \{ L _ { 1 } , L _ { 2 } , . . . , L _ { 2 ^ { K } } \} .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Table 1: Environment and training details for four MuJoCo locomotion tasks.
|
| 353 |
+
|
| 354 |
+
<table><tr><td>Environment</td><td>Swimmer</td><td>Half-Cheetah</td><td>Hopper</td><td>Ant</td></tr><tr><td>Reward Function</td><td>-0.511312</td><td>s1-0.0512</td><td>1+1- 0.005||2012</td><td>s1+0.5- 0.00511012</td></tr><tr><td>Rollout Horizon</td><td>333</td><td>1000</td><td>200</td><td>1000</td></tr><tr><td>Rollout Numbers</td><td>25</td><td>10</td><td>30</td><td>400</td></tr><tr><td>Training Epochs</td><td>60</td><td>60</td><td>40</td><td>60</td></tr></table>
|
| 355 |
+
|
| 356 |
+
APPENDIX D. EXPERIMENTAL DETAILS ON MUJOCO TASKS
|
| 357 |
+
|
| 358 |
+
# D.1 DATA COLLECTION
|
| 359 |
+
|
| 360 |
+
Rollout Samples To train the neural network dynamics model (both ICNN and MLP), we first collect initial rollout data using fully random action sequences $\mathbf { u } _ { t } \sim \mathrm { U n i f o r m } [ \mathbf { - 1 } , \mathbf { 1 } ]$ with a random chosen initial state. During the data collection process in aggregated iterations, to improve model generalization and explore larger state spaces, we add Gaussian noise to the optimal control policies $\mathbf { u } _ { t } = \mathbf { u } _ { t } + \mathcal { N } ( 0 , 0 . 0 0 1 )$ .
|
| 361 |
+
|
| 362 |
+
Neural Networks Training We represent the MuJoCo dynamics with a 2-hidden-layer neural networks with hidden sizes 512 − 512. The passthrough links of ICNN are of same size of corresponding added layers. We train both models using Adam optimizer with a learning rate 0.001 and a mini-batch size of 512. Due to the different complexity of MuJoCo tasks, we vary training epochs and summarize the training details in Table. 1.
|
| 363 |
+
|
| 364 |
+
# D.2 ENVIRONMENT DETAILS
|
| 365 |
+
|
| 366 |
+
In all of the MuJoCo locomotion tasks, s includes state variables such as robot positions, velocity along each axis; u includes action efforts for the agent. We use standard reward functions $r ( \mathbf { s } _ { t } , \mathbf { u } _ { t } )$ for moving tasks, which could be also promptly calculated in (6a) as the control objective. For the ease of neural network training and action sampling, we normalize all the action and states in the range of $[ - 1 , \mathbf { 1 } ]$ . We use DAGGER (Ross et al., 2011) for 6 aggregated iterations for all cases, and during aggregated iteration, we use a split of $10 \%$ random rollouts collected as described in 5, and other $90 \%$ coming from past iterations’ control policies (on-policy rollouts). Note that we use 10 random control sequences in our method to initialize the policy finding approach and avoid the long computation time for taking gradients on finding optimal ${ \bf u } _ { t }$ . Other environment parameters are described in Table. 1.
|
| 367 |
+
|
| 368 |
+
# D.3 WALL-CLOCK TIME
|
| 369 |
+
|
| 370 |
+
In Table.2, we show the average run time for the total of 6 aggregation iterations over 3 runs. Finding control policies via ICNN is using less or equal training time compared to random-shooting method with $K = 1 0 0$ , while achieving better task rewards than $K = 1 0 0 0$ for different control horizons. All the experiments are running on a computer with 8 cores Intel I7 6700 CPU. Note that we do not use GPU for accelerating ICNN optimization step (6), which could furthur improve our method’s efficiency.
|
| 371 |
+
|
| 372 |
+
# D.4 DETAILS OF SIMULATION RESULTS
|
| 373 |
+
|
| 374 |
+
MuJoCo Dynamics Modeling In Fig. 7, we compare the ICNN and normal MLP fitting performance of the MuJoCo dynamics modeling (6b), which illustrates that both MLP and ICNN are able to find a data-driven dynamics model for ant MuJoCo agent, which is of the most complex dynamics we considered for locomotion tasks. The multi-step prediction errors of ICNN is comparable to normal MLP used in (Nagabandi et al., 2018) for different length of rollout steps.
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Swimmer</td><td rowspan="2">ICNN</td></tr><tr><td>K=100</td><td>K=300</td><td>K=1000</td></tr><tr><td>H=4</td><td>18.36</td><td>18.48</td><td>40.20</td><td>16.41</td></tr><tr><td>H=10</td><td>21.74</td><td>25.41</td><td>71.49</td><td>18.71</td></tr><tr><td>H=50</td><td>40.01</td><td>70.31</td><td>169.49</td><td>36.24</td></tr><tr><td colspan="3">Half-Cheetah</td><td>K=1000</td><td>ICNN</td></tr><tr><td>H=4</td><td>K=100 34.40</td><td>K=300 47.72</td><td>88.49</td><td></td></tr><tr><td>H=10</td><td>48.86</td><td>74.60</td><td>181.34</td><td>34.93 36.39</td></tr><tr><td>H=50</td><td>113.58</td><td>275.61</td><td>816.32</td><td>83.66</td></tr><tr><td colspan="3"></td><td></td><td></td></tr><tr><td rowspan="2">H=4</td><td>K=100</td><td>Hopper K=300</td><td>K=1000</td><td>ICNN</td></tr><tr><td>5.48</td><td>6.30</td><td>7.76</td><td>5.61</td></tr><tr><td>H=10</td><td>5.97</td><td>7.89</td><td>9.34</td><td>5.14</td></tr><tr><td>H=50</td><td>10.89</td><td>14.77</td><td>38.02</td><td>9.16</td></tr><tr><td rowspan="2"></td><td></td><td>Ant</td><td></td><td></td></tr><tr><td>K=100</td><td>K=300</td><td>K=1000</td><td>ICNN</td></tr><tr><td>H=4</td><td>399.39</td><td>415.51</td><td>433.35</td><td>349.13</td></tr><tr><td>H=10</td><td>480.60</td><td>481.34</td><td>511.93</td><td>459.63</td></tr><tr><td>H=50</td><td>979.73</td><td>1024.5</td><td>1075.52</td><td>929.5</td></tr></table>
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Table 2: Average wall clock time (in minutes) for random-shooting model-based reinforcement learning method and ICNN.
|
| 380 |
+
Figure 7: Multistep prediction errors by ICNN and MLP. $\mathrm { X }$ -Axis and Y-Axis are of log scale.
|
| 381 |
+
|
| 382 |
+
More Simulation Results In Fig. 8, we compare our control method with random-shooting approach with varying settings on shooting number $K$ , which shows that our approach is more efficient in finding control policies.
|
| 383 |
+
|
| 384 |
+
In Fig. 9, we compare our control method with the rllab implementation of trust region policy optimization (TRPO) (Schulman et al., 2015), an end-to-end deep reinforcement learning approach for mujoco locomotion tasks. More specifically, we compare the algorithms’ performances with relatively few available rollout samples. While our approach quickly learns the dynamics and then find control actions via optimization steps, TRPO is hard to learn the actions directly with few provided rollouts. Similarly to the model-based and model-free (Mb-Mf) approach described in (Nagabandi et al., 2018), our control method could provide good initialization samples for the model-free algorithms, which could greatly accelerate the training process of model-free algorithms.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 8: Cumulative reward for one validation rollout of random shooting method vs ICNN
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 9: Average return for control of Mujoco tasks by ICNN, random-shooting method (Nagabandi et al., 2018) and TRPO (Schulman et al., 2015).
|
| 391 |
+
|
| 392 |
+
APPENDIX E. DETAILS ON BUILDING ENERGY MANAGEMENT
|
| 393 |
+
|
| 394 |
+
# E.1 MINIMIZING ELECTRICITY COSTS
|
| 395 |
+
|
| 396 |
+
To further demonstrate the potential of our proposed control framework in dealing with different real world tasks, we modify the setting of the building control example in Section 4.2 to a more complicated case. Instead of directly minimize the total energy consumption of building, we aim to minimize the total energy cost of building which subject to a varying time-of-use electrical price $\lambda$ The optimization problem in (7) should be re-written as,
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { r l } { \underset { \mathbf { u } _ { t } , \ldots , \mathbf { u } _ { t + T } } { \mathrm { m i n i m i z e } } } & { \displaystyle \sum _ { \tau = 0 } ^ { T } \lambda _ { \tau } \cdot f \big ( \mathbf { x } _ { t + \tau - n _ { w } } , \ldots , \mathbf { x } _ { t + \tau } \big ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \mathbf { s } _ { t + \tau } = g \big ( \mathbf { x } _ { t + \tau - n _ { w } } , \ldots , \mathbf { x } _ { t + \tau - 1 } , \mathbf { u } _ { t + \tau } \big ) , \forall \tau } \\ & { \mathbf { u } _ { t + \tau } \le \mathbf { u } _ { t + \tau } \le \overline { { \mathbf { u } } } _ { t + \tau } , \forall \tau } \\ & { \mathbf { s } _ { t + \tau } \le \mathbf { s } _ { t + \tau } \le \overline { { \mathbf { s } } } _ { t + \tau } , \forall \tau } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
where the objective (14a) is minimizing the total energy cost of building in future $T$ steps ( $T$ is the model predictive control horizon) subject to time-of-use electricity price $\lambda _ { \tau }$ , and (14b) is used for modeling building states, in which $g ( \cdot )$ are parameterized as ICRNNs. Same as the previous building control case, we have constraints on both control actions ${ \bf u } _ { t }$ and system states $\mathbf { s } _ { t }$ are given in (14c) and (14d). For instance, the temperature set points as well as real measurements should not exceed user-defined comfort regions. In Fig. 10 we visualize our model flexibility by using Seattle’s Time-of-Use (TOU) price from Seattle City Light 4, and minimizing one week’s electricity bills. We could see ICRNN capture the long term relationships between control variables and final costs, and raise the energy consumption during off-peak price a little, but reduce the energy consumption during peak hours.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 10: (a) 24 hour price signal along with (b) optimization results on one-week electricity usage of building using ICRNN.
|
| 406 |
+
|
| 407 |
+
# E.2 CONTROL CONSTRAINTS EFFECTS
|
| 408 |
+
|
| 409 |
+
In Fig. 11 we add one more comparison on the control constraints effects on the final control performance by using ICRNN. Interestingly, with different set point constraints, the ICRNN finds similar solutions for off-peak electricity usage, which may correspond to necessary energy consumptions, such as lightning and ventilation. Moreover, when we set no constraints on the system, it would cut down more than $80 \%$ of total energy during peak hours.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 11: Results on one-week electricity usage of building using input convex neural network control method based upon different control constrains.
|
md/train/H1bM1fZCW/H1bM1fZCW.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADNORM: GRADIENT NORMALIZATION FOR ADAPTIVE LOSS BALANCING IN DEEP MULTITASK NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep multitask networks, in which one neural network produces multiple predictive outputs, are more scalable and often better regularized than their single-task counterparts. Such advantages can potentially lead to gains in both speed and performance, but multitask networks are also difficult to train without finding the right balance between tasks. We present a novel gradient normalization (GradNorm) technique which automatically balances the multitask loss function by directly tuning the gradients to equalize task training rates. We show that for various network architectures, for both regression and classification tasks, and on both synthetic and real datasets, GradNorm improves accuracy and reduces overfitting over single networks, static baselines, and other adaptive multitask loss balancing techniques. GradNorm also matches or surpasses the performance of exhaustive grid search methods, despite only involving a single asymmetry hyperparameter $\alpha$ . Thus, what was once a tedious search process which incurred exponentially more compute for each task added can now be accomplished within a few training runs, irrespective of the number of tasks. Ultimately, we hope to demonstrate that gradient manipulation affords us great control over the training dynamics of multitask networks and may be one of the keys to unlocking the potential of multitask learning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Single-task learning in computer vision has enjoyed much success in deep learning, with many models now performing at or beyond human accuracies for a wide array of tasks. However, a system that strives for full scene understanding cannot focus on one problem, but needs to perform many diverse perceptual tasks simultaneously. Such systems must also be efficient, especially within the restrictions of limited compute environments in embedded systems such as smartphones, wearable devices, and robots/drones. Multitask learning most naturally lends itself to this problem by sharing weights amongst different tasks within the same model and producing multiple predictions in one forward pass. Such networks are not only scalable, but the shared features within these networks tend to be better regularized and boost performance as a result. In the ideal limit, we can thus have the best of both worlds with multitask networks: both more efficiency and higher performance.
|
| 12 |
+
|
| 13 |
+
The key difficulty in multitask learning lies in the balancing of tasks, and perhaps the simplest way to control this balance is to choose the correct joint loss function. In practice, the multitask loss function is often assumed to be linear in the single task losses, $\begin{array} { r } { L = \sum _ { i } ^ { - } w _ { i } L _ { i } } \end{array}$ , where the sum runs over $T$ tasks. The challenge is then to find the best value for each $w _ { i }$ that balances the contribution of each task for optimal model training. Our proposed method is furthermore an adaptive method, allowing $w _ { i }$ to vary with the training step $t$ , and so $w _ { i } = w _ { i } ( t )$ .
|
| 14 |
+
|
| 15 |
+
Our key insight lies in the observation that these $w _ { i } ( t )$ influence training only because they control the magnitude of the gradients generated from task $i$ . As such, manipulating the gradient norms themselves would be a more direct way to control the training dynamics. More specifically, we propose a simple heuristic that penalizes the network when backpropagated gradients from any task are too large or too small. The correct balance is struck when tasks are training at similar rates; if task $i$ is training relatively quickly, then its weight $w _ { i } ( t )$ should decrease relative to other task weights $w _ { j } ( t ) | _ { j \neq i }$ to allow other tasks more influence on the network. Our method can be said to be a form of batch normalization (Ioffe & Szegedy (2015)) for backpropagation, ensuring that gradients from each task per batch lie on a common statistical scale. We will show that, when implemented, gradient normalization leads to across-the-board improvements in accuracy and suppresses overfitting.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Gradient Normalization. Imbalanced gradient norms (left) result in suboptimal training within a multitask network, so we implement a novel gradient loss $L _ { \mathrm { g r a d } }$ (right) which detects such imbalances in gradient norms amongst tasks and tunes the weights in the loss function to compensate. We illustrate here a simplified case where such balancing results in equalized gradient norms, but in general some tasks may need higher or lower gradient norms relative to other tasks for optimal task balancing (discussed further in Section 3).
|
| 19 |
+
|
| 20 |
+
Our main contributions to the field of multitask learning are as follows:
|
| 21 |
+
|
| 22 |
+
1. An attractively simple heuristic for multitask loss balancing involving training rate equalization, which is implemented through a novel gradient loss function. 2. A simplification to exhaustive grid search (which has compute complexity $\mathcal { O } ( N ^ { T } )$ for $N$ grid points in one dimension) that only involves tuning one robust hyperparameter. 3. Demonstration that direct interaction with gradients provides a powerful way of reasoning about multitask learning.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Multitask learning has existed well before the advent of deep learning (Caruana (1998); Bakker & Heskes (2003)), but the robust learned features within deep networks have spurned renewed interest. Although our primary application area is computer vision, multitask learning has applications in multiple other fields, from natural language processing (Hashimoto et al. (2016); Collobert & Weston (2008); Søgaard & Goldberg (2016)) to speech synthesis (Wu et al. (2015); Seltzer & Droppo (2013)), from very domain-specific applications like traffic prediction (Huang et al. (2014)) to very general cross-domain work (Bilen & Vedaldi (2017)).
|
| 27 |
+
|
| 28 |
+
Multitask learning is very well-suited to the field of computer vision, where making multiple robust predictions is crucial for complete scene understanding. Deep networks have been used to solve various subsets of multiple vision tasks, from 3-task networks (Eigen & Fergus (2015); Teichmann et al. (2016)) to much larger subsets as in UberNet (Kokkinos (2016)). Often, single computer vision problems can even be framed as multitask problems, such as in Mask R-CNN for instance segmentation (He et al. (2017)) or YOLO-9000 for object detection (Redmon & Farhadi (2016)). Researchers often assume a fixed loss function or network architecture, but there has also been significant work on finding optimal ways to relate tasks to each other in a multitask model. Clustering methods have shown success beyond deep models (Kang et al. (2011); Jacob et al. (2009)), while constructs such as deep relationship networks (Long & Wang (2015)) and cross-stich networks (Misra et al. (2016)) search for meaningful relationships between tasks and learn which features to share between them. Work in Warde-Farley et al. (2014) and Lu et al. (2016) use groupings amongst labels to search through possible architectures for learning. Perhaps the most relevant to the current work, Kendall et al. (2017) uses a joint likelihood formulation to derive task weights based on the intrinsic uncertainty in each task.
|
| 29 |
+
|
| 30 |
+
# 3 METHODOLOGY
|
| 31 |
+
|
| 32 |
+
# 3.1 A GRADIENT LOSS FUNCTION BASED ON RATE BALANCING
|
| 33 |
+
|
| 34 |
+
We begin with the standard multitask loss function with time dependency, $\begin{array} { r } { L ( t ) = \sum w _ { i } ( t ) L _ { i } ( t ) } \end{array}$ , and our goal is to learn the functions $w _ { i } ( t )$ . We argued in Section 1 that $w _ { i } ( t )$ is intimately related to the norm of gradients from each task backpropagated into the network. We thus must motivate a set of desirable gradient magnitudes, and use those desired magnitudes to set the task weights $w _ { i } ( t )$ .
|
| 35 |
+
|
| 36 |
+
Consider the norms of gradients from task $i$ on some set of weights $W$ within the network, n $\mathsf { \Omega } ^ { \mathsf { \tiny { l o r m } } } ( \nabla _ { W } L _ { i } ( t ) )$ (specific choices for $W$ to be discussed later). Our method of gradient normalization (hereafter referred to as GradNorm) works in two steps: (1) We first scale all gradient norms to an equal value as a neutral starting point. This value is most naturally chosen to be the average gradient norm amongst tasks, $E _ { \mathrm { t a s k } } [ \mathrm { n o r m } ( \nabla _ { W } L _ { i } ( t ) ) ]$ , where we use $E _ { \mathrm { t a s k } } [ X ]$ to denote the average value of a task-dependent quantity $X$ across tasks. (2) We then modify gradient norms with a rate balancing term that ensures no task trains relatively too slowly. The gradient norms of task $i$ should grow when task $i$ trains relatively slowly, thereby boosting more sluggish tasks. Gradient norms thus should be an increasing function of the relative inverse training rate for each task.
|
| 37 |
+
|
| 38 |
+
To quantify training rates, we choose the loss ratio of task $i$ at training step $t$ , $L _ { i } ^ { \prime } ( t ) : = L _ { i } ( t ) / L _ { i } ( 0 )$ , as a measure of task $i$ ’s inverse training rate; smaller values of $L _ { i } ^ { \prime } ( t )$ would mean that task $i$ has trained more. If $L _ { i } ^ { \prime } ( t )$ denotes the inverse training rate of task $i$ , then the relative inverse training rate is just $L _ { i } ^ { \prime } ( t ) / \dot { E _ { \mathrm { t a s k } } } [ L _ { i } ^ { \prime } ( t ) ]$ . Using this simple loss ratio metric is valid for both regression squared loss and classification cross-entropy loss, as we will see in Section $5 . 2 ^ { 1 }$ .
|
| 39 |
+
|
| 40 |
+
Our desired gradient norms are therefore:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { r l } & { \mathrm { n o r m } ( \nabla _ { W } L _ { i } ( t ) ) \mapsto ( \mathrm { a v e r a g e \ : g r a d i e n t \ : n o r m } ) \times ( \mathrm { r e l a t i v e \ : i n v e r s e \ : t r a i n i n g \ : r a t e \ : o f \ : t a s k \ : } i ) ^ { \alpha } } \\ & { \qquad = E _ { \mathrm { t a s k } } [ \mathrm { n o r m } ( \nabla _ { W } L ( t ) ) ] \left( \frac { L _ { i } ^ { \prime } ( t ) } { E _ { \mathrm { t a s k } } [ L _ { i } ^ { \prime } ( t ) ] } \right) ^ { \alpha } } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\alpha$ is an additional hyperparameter. $\alpha$ sets the strength of rate balancing in the multitask problem, and also is a measure of the asymmetry between tasks. In cases where tasks are very different in their complexity, leading to different learning dynamics, a higher value of $\alpha$ should be used to pull tasks back towards a common training rate more forcefully. When tasks are more symmetric (e.g. the synthetic examples in Section 4), a lower value of $\alpha$ is appropriate. Note that $\alpha = 0$ will always try to pin the norms of backpropped gradients from each task to be equal at $W$ .
|
| 47 |
+
|
| 48 |
+
Equation 1 sets a desired target for our gradient norms, and we want to update our loss weights $w _ { i } ( t )$ to move gradient norms towards this target. To accomplish this, GradNorm is implemented as a loss function $L _ { \mathrm { g r a d } }$ which is just the L1 distance between actual gradient norms and the targets in Equation 1:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
L _ { \mathrm { g r a d } } ^ { ( i ) } ( t ; W ) = \left| \mathrm { n o r m } ( \nabla _ { W } L _ { i } ( t ) ) - E _ { \mathrm { t a s k } } [ \mathrm { n o r m } ( \nabla _ { W } L ( t ) ) ] \left( \frac { L _ { i } ^ { \prime } ( t ) } { E _ { \mathrm { t a s k } } [ L ^ { \prime } ( t ) ] } \right) ^ { \alpha } | . \right.
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The above loss is for one task; the full loss is just the mean of the individual task losses, $\begin{array} { r } { L _ { \mathrm { g r a d } } ( t ; W ) = ( 1 / T ) \sum _ { i } L _ { \mathrm { g r a d } } ^ { ( i ) } ( t ; W ) } \end{array}$ . $L _ { \mathrm { g r a d } }$ is then differentiated with respect to each $w _ { i } ( t )$ , and its gradients are applied via standard update rules to update these weights (see Figure 1 for a schematic view). In principle, it is also possible to update all network weights (not just $w _ { i } ( t ) )$ based on gradient of $L _ { \mathrm { g r a d } }$ , but in practice this adds undue complexity to the problem and often degrades performance.
|
| 55 |
+
|
| 56 |
+
We can choose $W$ , the weights upon which we rate balance gradient norms, to be any subset of weights within layers of our network. In practice, in order to save on compute overhead, we choose $W$ to be the weights in the last layer which is shared amongst all three tasks. This simplification greatly shortens the number of layers $L _ { \mathrm { g r a d } }$ must be backpropagated through, and with this choice of $W$ in our experiments GradNorm only adds $\sim 5 \%$ of additional compute time. After every update step, we also renormalize the weights $w _ { i } ( t )$ so that $\begin{array} { r } { \sum _ { i } w _ { i } ( t ) = T } \end{array}$ in order to decouple gradient normalization from the global learning rate.
|
| 57 |
+
|
| 58 |
+
# 4 A SIMPLE TOY EXAMPLE
|
| 59 |
+
|
| 60 |
+
To illustrate GradNorm on a simple system, we consider $T$ regression tasks onto the functions
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
f _ { i } ( { \bf x } ) = \sigma _ { i } \operatorname { t a n h } ( ( B + \epsilon _ { i } ) { \bf x } ) ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where tanh acts element-wise. We use squared loss to train each task. The matrices $B$ and $\epsilon _ { i }$ have elements generated IID from $\mathcal { N } ( 0 , 1 0 )$ and $\mathcal { N } ( 0 , 3 . 5 )$ , respectively. Our task is thus to perform regression on multiple tasks with shared information $B$ along with information specific to each task, $\epsilon _ { i }$ . The $\sigma _ { i }$ are fixed scalars which set the variance of the outputs $f _ { i }$ . Higher values of $\sigma _ { i }$ induce higher values of squared loss for that task. These tasks are harder to learn due to the higher variances in their response values, but they also backpropagate larger gradients. Classically, such a scenario can lead to suboptimal training dynamics as the higher $\sigma _ { i }$ tasks tend to dominate the training.
|
| 67 |
+
|
| 68 |
+
All toy problem runs use a 4-layer fully-connected ReLU-activated network with 100 neurons per layer as a common trunk. A final affine transformation per task gives $T$ final predictions. Inputs are in $\mathbb { R } ^ { 2 5 0 }$ , and outputs lie in $\mathbb { R } ^ { 1 0 0 }$ . To ensure consistency, we only compare models initialized to the same random values and fed data generated from a fixed random seed. The asymmetry $\alpha$ is set low to 0.12 for these experiments, as the output functions $f _ { i }$ are all of the same form.
|
| 69 |
+
|
| 70 |
+
In these toy problems, we measure the task-normalized test-time loss, which is the sum of the test loss ratios for each task, $\textstyle \sum _ { i } L _ { i } ^ { \prime } ( t )$ . A simple sum of losses is wholly inadequate to judge the overall performance of a multitask network, as it biases itself towards tasks with higher loss scales, and there exists no general metric by which to judge multitask performance in any setting. Luckily, our toy problem was designed with tasks which are statistically identical except for their loss scales $\sigma _ { i }$ . For this simple example, there is therefore a clear measure of overall network performance, which is the sum of losses with each loss normalized to its $\sigma _ { i }$ - precisely the sum of loss ratios.
|
| 71 |
+
|
| 72 |
+
In the case of $T = 2$ , we choose the values $( \sigma _ { 0 } , \sigma _ { 1 } ) = ( 1 . 0 , 1 0 0 . 0 )$ . Classically, task 1 can suppress task 0’s influence during training due to its higher loss scale. As shown in the top panels of Figure 2, gradient normalization remedies the issue by increasing $w _ { 0 } ( t )$ to counteract the larger gradients coming from $T _ { 1 }$ , and the improved task balance results in better test-time performance.
|
| 73 |
+
|
| 74 |
+
The possible benefits of gradient normalization become even clearer when the number of tasks increases. For $T = 1 0$ , we sample the $\sigma _ { i }$ from a normal distribution and plot the results in the bottom row of Figure 2. GradNorm significantly improves test time performance over naively weighting each task the same. Like $T = 2$ , for $T = 1 0$ the $w _ { i } ( t )$ grow larger for smaller $\sigma _ { i }$ tasks; GradNorm is giving tasks with smaller loss scales more breathing room.
|
| 75 |
+
|
| 76 |
+
For both $T = 2$ and $T = 1 0$ , GradNorm is more stable and outperforms the uncertainty weighting proposed by Kendall et al. (2017). Uncertainty weighting, which enforces that $w _ { i } ( t ) \ \tilde { \mathbf { \Omega } } \sim 1 / \bar { L } _ { i } ( t ) \mathbf { \dot { \Omega } }$ , tends to grow weights too large and too quickly as the loss for each task drops. Although such networks train quickly at the onset, the training soon crashes as the global learning rate grows too large. This issue is exacerbated as uncertainty weighting allows $w _ { i } ( t )$ to change unconstrained (compared to GradNorm which ensures $\sum w _ { i } ( t ) = \bar { T }$ always), which pushes global learning rate up even further.
|
| 77 |
+
|
| 78 |
+
Overall, the traces for each $w _ { i } ( t )$ during a single GradNorm run seem fairly stable and convergent. In fact, in Section 5.3 we will see how the time-averaged weights $E _ { t } [ w _ { i } ( t ) ]$ lie close to the optimal static weights, suggesting GradNorm can greatly simplify the tedious grid search procedure.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Gradient Normalization on a toy 2-task (top) and 10-task (bottom) system. Diagrams of the network structure with loss scales are on the left, traces of $w _ { i } ( t )$ during training in the middle, and task-normalized test loss curves on the right. $\alpha = 0 . 1 2$ for all runs.
|
| 82 |
+
|
| 83 |
+
# 5 APPLICATION TO A LARGE REAL-WORLD DATASET
|
| 84 |
+
|
| 85 |
+
We primarily use NYUv2 as our dataset of choice. The standard NYUv2 dataset carries depth, surface normals, and semantic segmentation labels (which we cluster into 13 distinct classes). NYUv2 is quite small as a dataset, with a training split of ${ \sim } 8 0 0$ examples, but contains both regression and classification labels, making it a good choice to test the robustness of GradNorm.
|
| 86 |
+
|
| 87 |
+
To show GradNorm in action on a more large-scale multitask dataset, we also expand NYUv2 to 40,000 images complete with pixel-wise depth, surface normals, and room keypoint labels. Keypoint labels are obtained through professional human labeling services, while surface normals are generated from camera parameters and the depth maps through standard methods.
|
| 88 |
+
|
| 89 |
+
Following Lee et al. (2017), the state-of-the-art in room layout prediction, all inputs are downsampled to $3 2 0 \times 3 2 0$ pixels and outputs to $8 0 \mathrm { ~ x ~ } 8 0$ pixels. These resolutions also speed up training without compromising complexity in the inputs or labels.
|
| 90 |
+
|
| 91 |
+
# 5.1 MODEL AND INDIVIDUAL TASK LOSSES
|
| 92 |
+
|
| 93 |
+
We try two different models: (1) a SegNet (Badrinarayanan et al. (2015); Lee et al. (2017)) network with a symmetric VGG16 (Simonyan & Zisserman (2014)) encoder/decoder, and (2) an FCN (Long et al. (2015)) network with a modified ResNet-50 (He et al. (2016)) encoder and shallow ResNet decoder. The VGG SegNet reuses maxpool indices to perform upsampling, while the ResNet FCN learns all upsampling filters. The ResNet architecture is further thinned (both in its filters and activations) to contrast with the heavier, more complex VGG SegNet: stride-2 layers are moved earlier and all 2048-filter layers are replaced by 1024-filter layers. Ultimately, the VGG SegNet has 29M parameters versus 15M for the thin ResNet. Although we will focus on the VGG SegNet in our more in-depth analysis, by designing and testing on two extremely different network topologies we will further demonstrate that GradNorm is very robust to the choice of base model.
|
| 94 |
+
|
| 95 |
+
We use standard pixel-wise loss functions for each task: cross entropy for segmentation, squared loss for depth, and cosine similarity for normals. As in Lee et al. (2017), for room layout we generate Gaussian heatmaps for each of 48 room keypoint types and predict these heatmaps with a pixel-wise squared loss. Note that all regression tasks are quadratic losses (our surface normal prediction uses a cosine loss which is quadratic to leading order), allowing us to use the loss ratio $L _ { i } ^ { \prime } ( t )$ of each task as a direct proxy for each task’s inverse training rate.
|
| 96 |
+
|
| 97 |
+
Table 1: Test error, 320x320 NYUv2 for GradNorm and various baselines.
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Model Type and Weighting Method</td><td>Depth Error (m)</td><td>Segmentation 100-mloU (%)</td><td>Normals Error (1-|cosl)</td></tr><tr><td>VGG SegNet, Depth Only</td><td>1.038</td><td>=</td><td></td></tr><tr><td>VGG SegNet, Segmentation Only</td><td>-</td><td>70.0</td><td>=</td></tr><tr><td>VGG SegNet, Normals Only</td><td>=</td><td>=</td><td>0.169</td></tr><tr><td>VGG SegNet, Equal Weights</td><td>0.944</td><td>70.1</td><td>0.192</td></tr><tr><td>VGG SegNet, GradNorm Converged Weights</td><td>0.939</td><td>67.5</td><td>0.171</td></tr><tr><td>VGG SegNet, GradNorm α = 1.5</td><td>0.925</td><td>67.8</td><td>0.174</td></tr></table>
|
| 100 |
+
|
| 101 |
+
# 5.2 NETWORK PERFORMANCE
|
| 102 |
+
|
| 103 |
+
In Table 1 we display the performance of GradNorm on the NYUv2 dataset (with input/output resolutions as described in Section 5). Specific training schemes for all NYUv2 models are detailed in Appendix A. We see that GradNorm improves the performance of all three tasks with respect to the equal-weights baseline (where $w _ { i } ( t ) = 1$ for all $^ { t , i }$ ), and that GradNorm either surpasses or matches (within statistical noise) the best performance of single networks for each task. The GradNorm Converged Weights network is derived by calculating the GradNorm time-averaged weights $E _ { t } [ w _ { i } ( t ) ]$ for each task (e.g. by averaging curves like those found in Appendix B), and retraining a network with weights fixed to those values. GradNorm thus can also be used to extract good values for static weights. We pursue this idea further in Section 5.3 and show that these weights lie very close to the optimal weights extracted from exhaustive grid search.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Model Type and Weighting Method</td><td>Depth Error (m)</td><td>Keypoint Error (%)</td><td>Normals Error (1-|cos|)</td></tr><tr><td>Thin ResNet FCN, Depth Only</td><td>0.725</td><td>-</td><td>1</td></tr><tr><td>Thin ResNet FCN,Keypoint Only</td><td>1</td><td>7.90</td><td>=</td></tr><tr><td>Thin ResNet FCN, Normals Only</td><td>1</td><td>-</td><td>0.155</td></tr><tr><td>Thin ResNet FCN,Equal Weights</td><td>0.697</td><td>7.80</td><td>0.172</td></tr><tr><td>Thin ResNet FCN, Unc. Weighting (Kendall et al. (2017))</td><td>0.702</td><td>7.96</td><td>0.182</td></tr><tr><td>Thin ResNetFCN,GradNorm Converged Weights</td><td>0.695</td><td>7.63</td><td>0.156</td></tr><tr><td>Thin ResNet FCN, GradNorm α = 1.5</td><td>0.663</td><td>7.32</td><td>0.155</td></tr><tr><td>VGG SegNet, Depth Only</td><td>0.689</td><td>-</td><td>-</td></tr><tr><td>VGG SegNet, Keypoint Only</td><td>1</td><td>8.39</td><td>1</td></tr><tr><td>VGG SegNet, Normals Only</td><td>-</td><td>1</td><td>0.142</td></tr><tr><td>VGG SegNet, Equal Weights</td><td>0.658</td><td>8.39</td><td>0.155</td></tr><tr><td>VGG SegNet, Unc.Weighting (Kendall et al. (2017))</td><td>0.649</td><td>8.00</td><td>0.158</td></tr><tr><td>VGG SegNet, GradNorm Converged Weights</td><td>0.638</td><td>7.69</td><td>0.137</td></tr><tr><td>VGG SegNet, GradNorm α = 1.5</td><td>0.629</td><td>7.73</td><td>0.139</td></tr></table>
|
| 106 |
+
|
| 107 |
+
# Table 2: Test error, expanded 320x320 NYUv2 for GradNorm and various baselines.
|
| 108 |
+
|
| 109 |
+
To show how GradNorm can perform in the presence of a much larger dataset, we also perform extensive experiments on the expanded NYUv2 dataset, which carries a factor of $5 0 \mathrm { x }$ more data. The results are shown in Table 2. As with the standard NYUv2 runs, GradNorm networks outperform other multitask methods, and either matches (within noise) or surpasses the performance of singletask networks.
|
| 110 |
+
|
| 111 |
+
Figure 3 shows test and training loss curves for GradNorm ( $\alpha = 1 . 5$ ) and baselines on the expanded NYUv2 dataset for our VGG SegNet models. GradNorm improves test-time depth error by $\sim 5 \%$ , despite ending with much higher training loss. GradNorm achieves this by aggressively rate balancing the network (enforced by a high asymmetry $\alpha = 1 . 5$ ), and ultimately suppresses the depth weight $w _ { \mathrm { d e p t h } } ( t )$ to lower than 0.10 (see Appendix B for more details). The same trend exists for keypoint regression, and is a clear signal of network regularization. In contrast, the uncertainty weighting technique (Kendall et al. (2017)) causes both test and training error to move in lockstep, and thus is not a good regularizer. Only results for the VGG SegNet are shown here, but the Thin ResNet FCN produces consistent results.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Test and training loss curves for all tasks in expanded NYUv2, VGG16 backbone. GradNorm versus an equal weights baseline and uncertainty weighting (Kendall et al. (2017)).
|
| 115 |
+
|
| 116 |
+
5.3 GRADIENT NORMALIZATION FINDS OPTIMAL GRID-SEARCH WEIGHTS IN ONE PASS
|
| 117 |
+
|
| 118 |
+
For our VGG SegNet, we train 100 networks from scratch with random task weights on expanded NYUv2. Weights are sampled from a uniform distribution and renormalized to sum to $T = 3$ . For computational efficiency, we only train for 15000 iterations out of the normal 80000, and then compare the performance of that network to our GradNorm $\alpha = 1 . 5$ VGG SegNet network at the same 15000 steps. The results are shown in Figure 4.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Gridsearch performance for random task weights, expanded NYUv2. Average change in performance across three tasks for a static network with weights $w _ { i } ^ { \mathrm { s t a t i c } }$ is plotted against the $L _ { 2 }$ distance between $w _ { i } ^ { \mathrm { s t a t i c } }$ and our GradNorm network’s time-averaged weights, $E _ { t } [ w _ { i } ( t ) ]$ . All comparisons are made at 15000 steps of training.
|
| 122 |
+
|
| 123 |
+
Even after 100 networks trained, grid search still falls short of our GradNorm network. But even more remarkably, there is a strong, negative correlation between network performance and task weight distance to our time-averaged GradNorm weights. At an $L _ { 2 }$ distance of $\sim 3$ , grid search networks on average have almost double the errors per task compared to our GradNorm network. GradNorm has effectively allowed us to “cheat” and immediately find the optimal grid search weights without actually performing grid search, simplifying a process that is usually notoriously laborious.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: Visualizations at inference time. Expanded NYUv2 with room layout labels is shown on the left, while downsampled NYUv2 with semantic segmentation labels is shown on the right.
|
| 127 |
+
|
| 128 |
+
# 5.4 QUALITATIVE RESULTS
|
| 129 |
+
|
| 130 |
+
Figure 5 shows visualizations of the VGG SegNet outputs on test set images along with the ground truth, for both the expanded and downsampled NYUv2 datasets. Ground truth labels are juxtaposed with outputs from the equal weights network, 3 single networks, and our best GradNorm network. The qualitative improvements are incremental, but we find the GradNorm network tends to output smoother, more detailed pixel map predictions when compared to the other two baselines.
|
| 131 |
+
|
| 132 |
+
# 6 CONCLUSIONS
|
| 133 |
+
|
| 134 |
+
Gradient normalization acts as a good model regularizer and leads to superb performance in multitask networks by operating directly on the gradients in the network. GradNorm is driven by the attractively simple heuristic of rate balancing, and can accommodate problems of varying complexities within the same unified model using a single hyperparameter representing task asymmetry. A GradNorm network can also be used to quickly extract optimal fixed task weights, removing the need for exhaustive grid search methods that become exponentially more expensive with the number of tasks. We hope that our work has not only introduced a new methodology for quickly balancing multitask networks, but also has shown how direct gradient manipulation can be a powerful way to reason about task relationships within a multitask framework.
|
| 135 |
+
|
| 136 |
+
# REFERENCES
|
| 137 |
+
|
| 138 |
+
Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. arXiv preprint arXiv:1511.00561, 2015.
|
| 139 |
+
|
| 140 |
+
Bart Bakker and Tom Heskes. Task clustering and gating for bayesian multitask learning. Journal of Machine Learning Research, 4(May):83–99, 2003.
|
| 141 |
+
|
| 142 |
+
Hakan Bilen and Andrea Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. arXiv preprint arXiv:1701.07275, 2017.
|
| 143 |
+
|
| 144 |
+
Rich Caruana. Multitask learning. In Learning to learn, pp. 95–133. Springer, 1998.
|
| 145 |
+
|
| 146 |
+
Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160–167. ACM, 2008.
|
| 147 |
+
|
| 148 |
+
David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2650–2658, 2015.
|
| 149 |
+
|
| 150 |
+
Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A joint many-task model: Growing a neural network for multiple nlp tasks. arXiv preprint arXiv:1611.01587, 2016.
|
| 151 |
+
|
| 152 |
+
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.
|
| 153 |
+
|
| 154 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. ´ arXiv preprint arXiv:1703.06870, 2017.
|
| 155 |
+
|
| 156 |
+
Wenhao Huang, Guojie Song, Haikun Hong, and Kunqing Xie. Deep architecture for traffic flow prediction: deep belief networks with multitask learning. IEEE Transactions on Intelligent Transportation Systems, 15 (5):2191–2201, 2014.
|
| 157 |
+
|
| 158 |
+
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.
|
| 159 |
+
|
| 160 |
+
Laurent Jacob, Jean-philippe Vert, and Francis R Bach. Clustered multi-task learning: A convex formulation. In Advances in neural information processing systems, pp. 745–752, 2009.
|
| 161 |
+
|
| 162 |
+
Zhuoliang Kang, Kristen Grauman, and Fei Sha. Learning with whom to share in multi-task feature learning. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 521–528, 2011.
|
| 163 |
+
|
| 164 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. arXiv preprint arXiv:1705.07115, 2017.
|
| 165 |
+
|
| 166 |
+
Iasonas Kokkinos. Ubernet: Training a universal convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. arXiv preprint arXiv:1609.02132, 2016.
|
| 167 |
+
|
| 168 |
+
Chen-Yu Lee, Vijay Badrinarayanan, Tomasz Malisiewicz, and Andrew Rabinovich. Roomnet: End-to-end room layout estimation. arXiv preprint arXiv:1703.06241, 2017.
|
| 169 |
+
|
| 170 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3431–3440, 2015.
|
| 171 |
+
|
| 172 |
+
Mingsheng Long and Jianmin Wang. Learning multiple tasks with deep relationship networks. arXiv preprint arXiv:1506.02117, 2015.
|
| 173 |
+
|
| 174 |
+
Yongxi Lu, Abhishek Kumar, Shuangfei Zhai, Yu Cheng, Tara Javidi, and Rogerio Feris. Fully-adaptive feature sharing in multi-task networks with applications in person attribute classification. arXiv preprint arXiv:1611.05377, 2016.
|
| 175 |
+
|
| 176 |
+
Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3994– 4003, 2016.
|
| 177 |
+
|
| 178 |
+
Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. arXiv preprint arXiv:1612.08242, 2016.
|
| 179 |
+
|
| 180 |
+
Michael L Seltzer and Jasha Droppo. Multi-task learning in deep neural networks for improved phoneme recognition. In Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, pp. 6965–6969. IEEE, 2013.
|
| 181 |
+
|
| 182 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 183 |
+
|
| 184 |
+
Anders Søgaard and Yoav Goldberg. Deep multi-task learning with low level tasks supervised at lower layers. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, volume 2, pp. 231–235, 2016.
|
| 185 |
+
|
| 186 |
+
Marvin Teichmann, Michael Weber, Marius Zoellner, Roberto Cipolla, and Raquel Urtasun. Multinet: Realtime joint semantic reasoning for autonomous driving. arXiv preprint arXiv:1612.07695, 2016.
|
| 187 |
+
|
| 188 |
+
David Warde-Farley, Andrew Rabinovich, and Dragomir Anguelov. Self-informed neural network structure learning. arXiv preprint arXiv:1412.6563, 2014.
|
| 189 |
+
|
| 190 |
+
Zhizheng Wu, Cassia Valentini-Botinhao, Oliver Watts, and Simon King. Deep neural networks employing multi-task learning and stacked bottleneck features for speech synthesis. In Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on, pp. 4460–4464. IEEE, 2015.
|
| 191 |
+
|
| 192 |
+
# Appendices
|
| 193 |
+
|
| 194 |
+
# A GENERAL TRAINING CHARACTERISTICS
|
| 195 |
+
|
| 196 |
+
All runs are trained at a batch size of 24 across 4 Titan X GTX 12GB GPUs and run at 30fps on a single GPU at inference. NYUv2 runs begin with a learning rate of 2e-5. Expanded NYUv2 runs last 80000 steps with a learning rate decay of 0.2 every 25000 steps. Downsampled NYUv2 runs last 20000 steps with a learning rate decay of 0.2 every 6000 steps. Updating $w _ { i } ( t )$ is performed at a learning rate of 0.025 for both GradNorm and the uncertainty weighting (Kendall et al. (2017)) baseline. All optimizers are Adam, although we find that GradNorm is insensitive to the optimizer chosen. We implement GradNorm using TensorFlow v1.2.1.
|
| 197 |
+
|
| 198 |
+
# B EFFECTS OF TUNING THE ASYMMETRY $\alpha$
|
| 199 |
+
|
| 200 |
+
The only hyperparameter in our technique is the asymmetry $\alpha$ . The optimal value of $\alpha$ for NYUv2 lies near $\alpha = 1 . 5$ , while in the highly symmetric toy example in Section 4 we used $\alpha = 0 . 1 2$ . This observation reinforces why we call $\alpha$ an asymmetry parameter.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 6: Weights $w _ { i } ( t )$ during training, expanded NYUv2. Traces of how the task weights $w _ { i } ( t )$ change during training for two different values of $\alpha$ . A larger value of $\alpha$ pushes weights farther apart, leading to less symmetry between tasks.
|
| 204 |
+
|
| 205 |
+
Tuning $\alpha$ leads to performance gains, but we found that for NYUv2, almost any value of $0 < \alpha < 3$ will improve network performance over an equal weights baseline. Figure 6 shows that higher values of $\alpha$ tend to push the weights $w _ { i } ( t )$ further apart, which more aggressively reduces the influence of tasks which overfit or learn too quickly (in our case, depth). Remarkably, at $\alpha = 1 . 7 5$ (not shown) $w _ { \mathrm { d e p t h } } ( t )$ is suppressed to below 0.02 at no detriment to network performance on the depth task.
|
md/train/H1gdF34FvS/H1gdF34FvS.md
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVANTAGE-WEIGHTED REGRESSION: SIMPLE ANDSCALABLE OFF-POLICY REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we aim to develop a simple and scalable reinforcement learning algorithm that uses standard supervised learning methods as subroutines. Our goal is an algorithm that utilizes only simple and convergent maximum likelihood loss functions, while also being able to leverage off-policy data. Our proposed approach, which we refer to as advantage-weighted regression (AWR), consists of two standard supervised learning steps: one to regress onto target values for a value function, and another to regress onto weighted target actions for the policy. The method is simple and general, can accommodate continuous and discrete actions, and can be implemented in just a few lines of code on top of standard supervised learning methods. We provide a theoretical motivation for AWR and analyze its properties when incorporating off-policy data from experience replay. We evaluate AWR on a suite of standard OpenAI Gym benchmark tasks, and show that it achieves competitive performance compared to a number of well-established state-of-the-art RL algorithms. AWR is also able to acquire more effective policies than most off-policy algorithms when learning from purely static datasets with no additional environmental interactions. Furthermore, we demonstrate our algorithm on challenging continuous control tasks with highly complex simulated characters. (Video1)
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Model-free reinforcement learning can be a general and effective methodology for training agents to acquire sophisticated behaviors with minimal assumptions on the underlying task (Mnih et al., 2015; Heess et al., 2017; Pathak et al., 2017). However, reinforcement learning algorithms can be substantially more complex to implement and tune than standard supervised learning methods. Arguably the simplest reinforcement learning methods are policy gradient algorithms (Sutton et al., 2000), which directly differentiate the expected return and perform gradient ascent. Unfortunately, these methods can be notoriously unstable and are typically on-policy (or nearly on-policy), often requiring a substantial number of samples to learn effective behaviors. Our goal is to develop a reinforcement learning algorithm that is simple, easy to implement, and can readily incorporate off-policy experience data.
|
| 12 |
+
|
| 13 |
+
In this work, we propose advantage-weighted regression (AWR), a simple off-policy algorithm for model-free RL. Each iteration of the AWR algorithm simply consists of two supervised regression steps: one for training a value function baseline via regression onto cumulative rewards, and another for training the policy via weighted regression. The complete algorithm is shown in Algorithm 1.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
|
| 17 |
+
Figure 1: Complex simulated character trained using advantage-weighted regression. Left: Humanoid performing a spinkick. Right: Dog performing a canter.
|
| 18 |
+
|
| 19 |
+
AWR can accommodate continuous and discrete actions, and can be implemented in just a few lines of code on top of standard supervised learning methods. Despite its simplicity, we find that AWR achieves competitive results when compared to commonly used on-policy and off-policy RL algorithms, and can effectively incorporate fully off-policy data, which has been a challenge for other RL algorithms. Our derivation presents an interpretation of AWR as a constrained policy optimization procedure, and provides a theoretical analysis of the use of off-policy data with experience replay.
|
| 20 |
+
|
| 21 |
+
We first revisit the original formulation of reward-weighted regression, an on-policy RL method that utilizes supervised learning to perform policy updates, and then propose a number of new design decisions that significantly improve performance on a suite of standard continuous control benchmark tasks. We then provide a theoretical analysis of AWR, including the capability to incorporate off-policy data with experience replay. Although the design of AWR involves only a few simple design decisions, we show experimentally that these additions provide for a large improvement over previous methods for regression-based policy search, such as reward-weighted regression (RWR) (Peters & Schaal, 2007), while also being substantially simpler than more modern methods, such as MPO (Abdolmaleki et al., 2018). We show that AWR achieves competitive performance when compared to several well-established state-of-the-art on-policy and off-policy algorithms. We further demonstrate our algorithm on challenging control tasks with complex simulated characters.
|
| 22 |
+
|
| 23 |
+
# 2 PRELIMINARIES
|
| 24 |
+
|
| 25 |
+
In reinforcement learning, the objective is to learn a control policy that enables an agent to maximize its expected return for a given task. At each time step $t$ , the agent observes the state of the environment $\mathbf { s } _ { t } \in \cal { S }$ , and samples an action $\mathbf { a } _ { t } \in \mathcal { A }$ from a policy $\mathbf { a } _ { t } \sim \pi ( \mathbf { a } _ { t } | \mathbf { s } _ { t } )$ . The agent then applies that action, which results in a new state $\mathbf { s } _ { t + 1 }$ and a scalar reward $r _ { t } = r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . The goal is to learn an optimal policy that maximizes the agent’s expected discounted return $J ( \pi )$ ,
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
J ( \pi ) = \mathbb { E } _ { \tau \sim p _ { \pi } ( \tau ) } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \right] = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { a \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ r ( \mathbf { s } , \mathbf { a } ) \right] ,
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
whicy e, $p _ { \pi } ( \tau )$ nts the likelihood of a tr is the discount factor. $\tau = \{ ( \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , r _ { 0 } ) , ( \mathbf { s } _ { 1 } , \mathbf { a } _ { 1 } , r _ { 1 } ) , \ldots \}$ $\pi$ $\gamma \in [ 0 , 1 )$ $\begin{array} { r } { d _ { \pi } ( \mathbf { s } ) = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } p ( \mathbf { s } _ { t } = \mathbf { s } | \pi ) } \end{array}$ $\pi$ $p ( \mathbf { s } _ { t } = \mathbf { s } | \boldsymbol { \pi } )$ is the likelihood of the agent being in state s after following $\pi$ for $t$ timesteps. A popular class of algorithms for solving this problem is policy gradient (PG) methods, which directly estimates the gradient of the expected return with respect to the policy parameters $\nabla _ { \pi } J ( \pi )$ , and then updates the policy with gradient ascent. Basic PG algorithms are generally on-policy methods, which require the data to be sampled from the same policy that is being optimized. This can result in poor sample efficiency, but PG algorithms can be modified to utilize off-policy data.
|
| 32 |
+
|
| 33 |
+
An alternative class of RL methods is expectation-maximization algorithms. Instead of estimating the gradient of the expected return, EM algorithms first construct an estimate of the optimal policy using a dataset of experiences (E-step), and then projects this estimate onto the space of parameterized policies (M-step). An early example of an EM-based RL algorithm is reward-weighted regression (RWR) (Peters et al., 2010). At each iteration, the $\mathrm { E }$ -step constructs an estimate of the optimal policy according to $\pi ^ { * } ( \mathbf { a } | \mathbf { s } ) \propto \pi _ { k } ( \mathbf { a } | \mathbf { s } ) \mathrm { e x p } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } / \beta \right)$ , where $\boldsymbol { \mathcal { U } } _ { k }$ represents the policy at the kth iteration of the algorithm, $\begin{array} { r } { \mathcal { R } _ { \mathbf { s } , \mathbf { a } } = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } } \end{array}$ is the return, and $\cdot$ is a temperature parameter. Then the M-step projects $\cdot$ onto the space of parameterized policies by solving a supervised regression problem:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\pi _ { k + 1 } = \arg \operatorname* { m a x } _ { \pi } \quad \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { k } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi _ { k } ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \mathcal { R } _ { \mathbf { s } , \mathbf { a } } \right) \right] .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
The RWR update can be interpreted as fitting a new policy $\pi _ { k + 1 }$ to samples collected under the current policy $\pi _ { k }$ , where the likelihood of each action is weighted by the exponentiated return received for that action. Since EM algorithms do not directly estimate the gradient of the expected return with respect to the current policy, they can be more amenable to learning from off-policy data.
|
| 40 |
+
|
| 41 |
+
# Algorithm 1 Advantage-Weighted Regression
|
| 42 |
+
|
| 43 |
+
<table><tr><td colspan="2">1:π1 ← random policy 2:D←@</td></tr><tr><td colspan="2">3: for iteration = 1,.., kmax do</td></tr><tr><td colspan="2">4: add trajectories {Ti} sampled via πk to D</td></tr><tr><td>5:</td><td>V ← arg minv Es,a~D[|/Ra - V(s)l²]</td></tr><tr><td>7: end for</td><td>6:Tk+1←argmaxEs,aD[gπ(as)exp((R-V(s)]</td></tr></table>
|
| 44 |
+
|
| 45 |
+
# 3 ADVANTAGE-WEIGHTED REGRESSION
|
| 46 |
+
|
| 47 |
+
In this work, we present advantage-weighted regression (AWR), a simple off-policy RL algorithm based on reward-weighted regression. We first provide an overview of the complete advantageweighted regression algorithm, and then describe its theoretical motivation and analyze its properties. The complete AWR algorithm is summarized in Algorithm 1. Each iteration $k$ of AWR consists of the following simple steps. First, the current policy $\pi _ { k } ( \mathbf { a } | \mathbf { s } )$ is used to sample a batch of trajectories $\{ \tau _ { i } \}$ that are then stored in the replay buffer $\mathcal { D }$ , which is structured as a first-in first-out (FIFO) queue, as is common for off-policy reinforcement learning algorithms (Mnih et al., 2015; Lillicrap et al., 2016). Then, the entire buffer $\mathcal { D }$ is used to fit a value function $\dot { V } _ { k } ^ { \mathcal { D } } ( { \bf s } )$ to the trajectories in the replay buffer, which can be done with simple Monte Carlo return estimates $\begin{array} { r } { \mathcal { R } _ { { \bf s } , { \bf a } } ^ { \mathcal { D } } = \sum _ { t = 0 } ^ { T } \gamma ^ { t } r _ { t } } \end{array}$ . Finally, the same buffer is used to fit a new policy using advantage-weighted regression, where each state-action pair in the buffer is weighted according to the exponentiated advantage $\begin{array} { r } { \exp ( \frac { 1 } { \beta } A ^ { D } ( { \bf s } , { \bf a } ) ) } \end{array}$ , with the advantage given by $A ^ { \mathcal { D } } ( \mathbf { s } , \mathbf { a } ) = \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } } - V ^ { \mathcal { D } } ( \mathbf { s } )$ and $\beta$ is a hyperparameter. AWR uses only supervised regression as learning subroutines, making the algorithm very simple to implement. In the following subsections, we first motivate the algorithm as an approximation to a constrained policy search problem, and then extend our analysis to incorporate experience replay.
|
| 48 |
+
|
| 49 |
+
# 3.1 DERIVATION
|
| 50 |
+
|
| 51 |
+
In this section, we derive the AWR algorithm as an approximate optimization of a constrained policy search problem. Our goal is to find a policy that maximizes the expected improvement $\mathsf { \bar { \eta } } ( \pi ) \mathsf { \bar { = } } J ( \pi ) \bar { - } J ( \mu )$ over a sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ . We first derive AWR for the setting where the sampling policy is a single Markovian policy. Then, in the next section, we extend our result to the setting where the data is collected from multiple policies, as in the case of experience replay that we use in practice. The expected improvement $\eta ( \pi )$ can be expressed in terms of the advantage Schu $A ^ { \mu } ( \mathbf { s } , \mathbf { a } ) = \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } )$ with respect to the sampling policy $\mu$ (Kakade & Langford, 2002;
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r } { \eta ( \pi ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \mu } ( \mathbf { s } , \mathbf { a } ) \right] = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] , } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu }$ denotes the return obtained by performing action a in state s and following $\mu$ for the following timesteps, and $\begin{array} { r } { V ^ { \mu } ( \mathbf { s } ) = \int _ { a } \mu ( \mathbf { a } | \mathbf { s } ) \mathcal { R } _ { \mathbf { s } } ^ { \mathbf { a } } } \end{array}$ da corresponds to the value function of $\mu$ . This objective differs from the ones used in the derivations of related algorithms, such as RWR and REPS (Peters & Schaal, 2007; Peters et al., 2010; Abdolmaleki et al., 2018), which maximize the expected return $J ( \pi )$ instead of the expected improvement. The expected improvement directly gives rise to an objective that involves the advantage. We will see later that this yields weights for the policy update that differ in a subtle but important way from standard reward-weighted regression. As we show in our experiments, this difference results in a large empirical improvement.
|
| 58 |
+
|
| 59 |
+
The objective in Equation 3 can be difficult to optimize due to the dependency between $d _ { \pi } ( \mathbf { s } )$ and $\pi$ , as well as the need to collect samples from $\pi$ . Following Schulman et al. (2015), we can instead optimize an approximation $\hat { \eta } ( \pi )$ of $\eta ( \pi )$ using the state distribution of $\mu$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \hat { \eta } ( \pi ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Here, $\hat { \eta } ( \pi )$ matches $\eta ( \pi )$ to first order (Kakade & Langford, 2002), and provides a good estimate of $\eta$ if $\pi$ and $\mu$ are close in terms of the KL-divergence (Schulman et al., 2015). Using this objective,
|
| 66 |
+
|
| 67 |
+
we can formulate the following constrained policy search problem:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } { \underset { \pi } { \arg \operatorname* { m a x } } } & { \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } } \\ { \mathrm { s . t . } } & { \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) d \mathbf { s } \leq \epsilon . } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The constraint in Equation 6 ensures that the new policy $\pi$ is close to the data distribution of $\mu$ , and therefore the surrogate objective $\hat { \eta } ( \pi )$ remains a reasonable approximation to $\eta ( \pi )$ . We refer the reader to Schulman et al. (2015) for a detailed derivation and an error bound.
|
| 74 |
+
|
| 75 |
+
We can derive AWR as an approximate solution to this constrained optimization. This derivation follows a similar procedure as Peters et al. (2010), and begins by forming the Langrangian of the constrained optimization problem presented above,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } ( \pi , \beta ) = \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } + \beta \left( \epsilon - \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) d \mathbf { s } \right)
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\beta$ is a Lagrange multiplier. Differentiating ${ \mathcal { L } } ( \pi , \beta )$ with respect to $\pi ( \mathbf { a } | \mathbf { s } )$ and solving for the optimal policy $\pi ^ { * }$ results in the following expression for the optimal policy
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\pi ^ { * } ( \mathbf { a } | \mathbf { s } ) = \frac { 1 } { Z ( \mathbf { s } ) } \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
with $Z ( \mathbf { s } )$ being the partition function. A detailed derivation is available in Appendix A. If $\pi$ is represented by a function approximator (e.g., a neural network), a new policy can be obtained by projecting $\pi ^ { * }$ onto the manifold of parameterized policies,
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r l } { \underset { \pi } { \arg \operatorname* { m i n } } } & { \mathbb { E } _ { \mathbf { s } \sim \mathcal { D } } \left[ \mathrm { D } _ { \mathrm { K L } } \left( \pi ^ { * } ( \cdot | \mathbf { s } ) | | \pi ( \cdot | \mathbf { s } ) \right) \right] } \\ & { = \underset { \pi } { \arg \operatorname* { m a x } } } & { \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \mu ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) \right] . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
While this derivation for AWR largely follows the derivations used in prior work (Peters et al., 2010; Abdolmaleki et al., 2018), our expected improvement objective introduces a baseline $V ^ { \mu } ( \mathbf { s } )$ to the policy update, which as we show in our experiments, is a crucial component for an effective algorithm. A similar advantage-weighting scheme has been previously used for fitted Q-iteration (Neumann & Peters, 2009), where the policy is given by $-$ . In this definition, the likelihood of an action does not depend on its likelihood under the sampling distribution, and therefore does not enforce a trust region with respect to the sampling distribution. Next, we extend AWR to incorporate experience replay for off-policy training, where the sampling policy is no longer a single policy, but rather a mixture of policies from past iterations.
|
| 94 |
+
|
| 95 |
+
# 3.2 EXPERIENCE REPLAY AND OFF-POLICY LEARNING
|
| 96 |
+
|
| 97 |
+
A crucial design decision of AWR is the choice of sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ . Standard implementations of RWR typically follow an on-policy approach, where the sampling policy is selected to be the current policy $\mu ( \mathbf { a } | \mathbf { s } ) = \pi _ { k } ( \mathbf { a } | \mathbf { s } )$ at iteration $k$ . This can be sample inefficient, as data collected at each iteration of the algorithms are discarded after a single update iteration. Importance sampling can be incorporated into RWR to reuse data from previous iterations, but at the cost of larger variance from the importance sampling estimator (Kober & Peters, 2009). Instead, we can improve sample efficiency of AWR by incorporating experience replay and explicitly accounting for training data from a mixture of multiple prior policies. As described in Algorithm 1, at each iteration, AWR collects a batch of data using the latest policy $\pi _ { k }$ , and then stores this data in a replay buffer $\mathcal { D }$ , which also contains data collected from previous policies $\{ \pi _ { 1 } , \cdots , \pi _ { k } \}$ . The value function and pdated using samples drawn from icy as a mixture of policies from p $\mathcal { D }$ . Thvious replay stterations odeling, where $\begin{array} { r } { \mu _ { k } ( \tau ) = \sum _ { i = 1 } ^ { k } w _ { i } \pi _ { i } ( \tau ) } \end{array}$ $\pi _ { i } ( \tau ) \stackrel { - } { = } p ( \stackrel { - } { \tau } | \stackrel { - } { \pi } _ { i } )$ $\tau$ $\pi _ { i }$ $i$
|
| 98 |
+
and the weights $\textstyle \sum _ { i } w _ { i } = 1$ specify the probabilities of selecting each policy $\pi _ { i }$ .
|
| 99 |
+
|
| 100 |
+
We now extend the derivation from the previous section to the off-policy setting with experience replay, and show that Algorithm 1 indeed optimizes the expected improvement over a sampling policy modeled by the replay buffer. Given a replay buffer consisting of trajectories from past policies, the joint state-action distribution of $\mu$ is given by $\begin{array} { r } { \mu ( \mathbf { s } , \mathbf { a } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } \end{array}$ , and similarly for the marginal state distribution $\begin{array} { r } { d _ { \mu } ( \mathbf { s } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) } \end{array}$ . The expected improvement can now be expressed with respect to the set of sampling policies in the replay buffer: $\begin{array} { r } { \hat { \eta ( \pi ) } = J ( \pi ) - \sum _ { i } w _ { i } J ( \pi _ { i } ) } \end{array}$ . Similar to Equation 3, $\eta ( \pi )$ can be expressed in terms of the advantage $A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) = \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( \mathbf { s } )$ of each sampling policies,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\eta ( \pi ) = J ( \pi ) - \sum _ { i } w _ { i } J ( \pi _ { i } ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \sum _ { i } w _ { i } A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
As before, we can optimize an approximation $\hat { \eta } ( \pi )$ of $\eta ( \pi )$ using the state distribution of $\mu$
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\hat { \eta } ( \pi ) = \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] = \sum _ { i = 1 } ^ { k } w _ { i } \left( \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] \right)
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
In Appendix $\mathbf { B }$ , we show that the update procedure in Algorithm 1 optimizes the following objective:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r l } { \arg \operatorname* { m a x } } & { \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } \left( \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right] \right) } \\ { \mathbf { s . t . } } & { \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \boldsymbol { \mu } ( \cdot | \mathbf { s } ) \right) \right] \leq \epsilon , } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\begin{array} { r } { \mu ( \mathbf { a } | \mathbf { s } ) = \frac { \mu ( \mathbf { s } , \mathbf { a } ) } { d _ { \mu } ( \mathbf { s } ) } = \frac { \sum _ { i } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } } \end{array}$ represents the conditional action distribution defined by the replay buffer. This objective can be solved via the Lagrangian to yield the following update:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r l } { \underset { \pi } { \arg \frac { \operatorname* { m a x } } { \operatorname* { m a x } } } } & { \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - \frac { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) V ^ { \pi _ { j } } ( \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right) \right) \right] , } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where the expectations can be approximated by simply sampling from $\mathcal { D }$ following Line 6 of Algorithm 1. A detailed derivation is available in Appendix B. Note, the baseline in the exponent now consists of an average of the value functions of the different policies. One approach for estimating this quantity would be to fit separate value functions $V ^ { \pi _ { i } }$ for each policy. However, if only a small amount of data is available from each policy, then $V ^ { \pi _ { i } }$ could be highly inaccurate ( $\mathrm { F u }$ et al., 2019). Therefore, instead of learning separate value functions, we fit a single mean value function $\bar { V } ( \mathbf { s } )$ that directly estimates the weighted average of $V ^ { \pi _ { i } }$ ’s,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\bar { V } = \underset { V } { \arg \operatorname* { m i n } } \sum _ { i } w _ { i } \mathbb { E } _ { { \mathbf { s } } , \sim d _ { \pi _ { i } } ( { \mathbf { s } } ) } \mathbb { E } _ { { \mathbf { a } } \sim \pi _ { i } ( { \mathbf { a } } | { \mathbf { s } } ) } \big [ | | \mathcal { R } _ { { \mathbf { s } } , { \mathbf { a } } } ^ { \pi _ { i } } - V ( { \mathbf { s } } ) | | ^ { 2 } \big ]
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
This loss can also be approximated by simply sampling from the replay buffer following Line 5 of Algorithm 1. The optimal solution $\begin{array} { r } { \bar { V } ( \mathbf { s } ) = \bar { \frac { - \sum _ { i } w _ { i } d _ { \pi _ { i } } ^ { - } ( \mathbf { s } ) \bar { V } ^ { \pi _ { i } } ( \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } } } \end{array}$ is exactly the baseline in Equation 15.
|
| 131 |
+
|
| 132 |
+
# 3.3 IMPLEMENTATION DETAILS
|
| 133 |
+
|
| 134 |
+
Finally, we discuss several design decisions that are important for a practical implementation of AWR. An overview of AWR is provided in Algorithm 1. The policy update in Equation 10 requires sampling states from the discounted state distribution $d _ { \mu } ( \mathbf { s } )$ . However, we found that simply sampling states uniformly from $\mathcal { D }$ was also effective, and simpler to implement. This is a common strategy used in standard implementations of RL algorithms (Dhariwal et al., 2017). When updating the value function and policy, Monte Carlo estimates can be used to approximate the expected return $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } }$ of samples in $\mathcal { D }$ , but this can result in a high-variance estimate. Instead, we opt to approximate $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } }$ using $\mathrm { T D } ( \lambda )$ to obtain a lower-variance estimate (Sutton & Barto, 1998). $\mathrm { T D } ( \lambda )$ is applied by bootstrapping with the value function $V _ { k - 1 } ^ { \mathcal { D } } ( { \mathbf s } )$ from the previous iteration. A simple Monte Carlo return estimator can also be used though, as shown in our experiments, but this produces somewhat worse results. To further simplify the algorithm, instead of adaptively updating the Lagrange multiplier $\beta$ , as is done in previous methods (Peters & Schaal, 2007; Peters et al., 2010; Abdolmaleki et al., 2018), we find that simply using a fixed constant for $\beta$ is also effective. The weights $\begin{array} { r } { \omega _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } } = \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } } - V ^ { \mathcal { D } } ( \mathbf { s } ) \right) \right) } \end{array}$ used to update the policy can occasionally assume excessively large values, which can cause gradients to explode. We therefore apply weight clipping $\hat { \omega } _ { \mathbf { s } , \mathbf { a } } ^ { D } = \overline { { \operatorname* { m i n } \left( \omega _ { \mathbf { s } , \mathbf { a } } ^ { D } , \omega _ { \operatorname* { m a x } } \right) } }$ with a threshold $\omega _ { \mathrm { m a x } }$ to mitigate issues due to exploding weights.
|
| 135 |
+
|
| 136 |
+
# 4 RELATED WORK
|
| 137 |
+
|
| 138 |
+
Existing RL methods can be broadly categorized into on-policy and off-policy algorithms (Sutton & Barto, 1998). On-policy algorithms generally update the policy using data collected from the same policy. A popular class of on-policy algorithms is policy gradient methods (Williams, 1992; Sutton et al., 2000), which have been shown to be effective for a diverse array of complex tasks (Heess et al., 2017; Pathak et al., 2017; Peng et al., 2018; Rajeswaran et al., 2018). However, on-policy algorithms are typically data inefficient, requiring a large number of interactions with the environment. Offpolicy algorithms improve sample efficiency by enabling a policy to be trained using data from other sources, such as data collected from different agents or data from previous iterations of the algorithm. Importance sampling is a simple strategy for incorporating off-policy data (Sutton & Barto, 1998; Meuleau et al., 2000; Hachiya et al., 2009), but can introduce optimization instabilities due to the potentially large variance of the importance sampling estimator. Dynamic programming methods based on Q-function learning can also leverage off-policy data (Precup et al., 2001; Mnih et al., 2015; Lillicrap et al., 2016; Gu et al., 2016; Haarnoja et al., 2018b). But these methods can be notoriously unstable, and in practice, require a variety of stabilization techniques to ensure more consistent performance (Hasselt et al., 2016; Wang et al., 2016; Munos et al., 2016; Hessel et al., 2017; Fujimoto et al., 2018; Nachum et al., 2018; Fu et al., 2019). Furthermore, it can be difficult to apply these methods to learn from fully off-policy data, where an agent is unable to collect additional environmental interactions (Fujimoto et al., 2019; Kumar et al., 2019).
|
| 139 |
+
|
| 140 |
+
Alternatively, policy search can also be formulated under an expectation-maximization framework. This approach has lead to a variety of EM-based RL algorithms (Peters et al., 2010; Neumann, 2011; Abdolmaleki et al., 2018), an early example of which is reward-weighted regression (RWR) (Peters & Schaal, 2007). RWR presents a simple on-policy RL algorithm that casts policy search as a supervised regression problem. A similar algorithm, relative entropy policy search (REPS) (Peters et al., 2010), can also be derived from the dual formulation of a constrained policy search problem. RWR has a number appealing properties: it has a very simple update rule, and since each iteration corresponds to supervised learning, it can be more stable and easier to implement than many of the previously mentioned RL methods. Despite these advantages, RWR has not been shown to be an effective RL algorithm when combined with neural network function approximators, as demonstrated in prior work and our own experiments (Schulman et al., 2015; Duan et al., 2016). In this work, we propose a number of modifications to the formulation of RWR to produce an effective off-policy deep RL algorithm, while still retaining much of the simplicity of previous methods.
|
| 141 |
+
|
| 142 |
+
Policy updates using supervised regression have been used in a number of prior work. The optimization problem being solved in REPS is similar to AWR (Peters et al., 2010), but REPS optimizes the expected return instead of the expected improvement. The weights in REPS also contains a Bellman error term that superficially resembles advantages, but are computed using a linear value function derived from a feature matching constraint. Learning the REPS value function requires minimization of a dual function, which is a complex function of the Bellman error, while the value function in AWR can be learned with simple supervised regression. More recently, Abdolmaleki et al. (2018) proposed MPO, a deep RL variant of REPS, which applies a partial EM algorithm for policy optimization. The method first fits a Q-function of the current policy via bootstrapping, and then performs a policy improvement step with respect to this Q-function under a trust region constraint that penalizes large policy changes. MPO uses off-policy data for training a Q-function critic via bootstrapping and employs Retrace $( \lambda )$ for off-policy correction (Munos et al., 2016). In contrast, AWR is substantially simpler, as it can simply fit a value function to the observed returns in a replay buffer, and performs weighted supervised regression on the actions to fit the policy. Oh et al. (2018) proposed self-imitation learning (SIL), which augments policy gradient algorithms with an auxiliary behaviour cloning loss to reuse samples from past experiences. In contrast to SIL, AWR is a standalone algorithm, and does not need to be combined with an auxiliary RL algorithm. Neumann & Peters (2009) proposed LAWER, a kernel-based fitted Q-iteration algorithm where the Bellman error is weighted by the normalized advantage of each state-action pair. This was then followed by a soft-policy improvement step. Similar to Neumann & Peters (2009), our method also uses exponentiated advantages during policy updates, but their definition of the policy is different from the one in AWR and does not enforce a trust region constraint. Furthermore, AWR does not perform fitted Q-iteration, and instead utilizes off-policy data in a simple constrained policy search procedure. Wang et al. (2018) applied a similar advantage-weighting scheme for imitation learning, but the method was not demonstrated for the RL setting. In this work, we propose several design decisions that are vital for an effective RL algorithm. We also provide a theoretical analysis of AWR when combined with experience replay, and show that the algorithm indeed optimizes the expected improvement with respect to a trajectory-level mixture of past policies modeled by a replay buffer.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Snapshots of AWR policies trained on OpenAI Gym tasks. Our simple algorithm learns effective policies for a diverse set of discrete and continuous control tasks.
|
| 146 |
+
|
| 147 |
+
# 5 EXPERIMENTS
|
| 148 |
+
|
| 149 |
+
Our experiments aim to comparatively evaluate the performance of AWR to commonly used onpolicy and off-policy deep RL algorithms. We evaluate our method on the OpenAI Gym benchmarks (Brockman et al., 2016), consisting of discrete and continuous control tasks. We also evaluate our method on complex motion imitation tasks with high-dimensional simulated characters, including a 34 DoF humanoid and 64 DoF dog (Peng et al., 2018). We then demonstrate the effectiveness of AWR on fully off-policy learning, by training on static datasets of demonstrations collected from demo policies. Behaviors learned by the policies are best seen in the supplementary video1. Code for our implementation of AWR is available at sites.google.com/view/awr-supp/. At each iteration, the agent collects a batch of approximately 2000 samples, which are stored in the replay buffer $\mathcal { D }$ along with samples from previous iterations. The replay buffer stores 50k of the most recent samples. Updates to the value function and policy are performed by uniformly sampling minibatches of 256 samples from $\mathcal { D }$ . The value function is updated with 200 gradient steps per iteration, and the policy is updated with 1000 steps. Detailed hyperparameter settings are provided in Appendix C.
|
| 150 |
+
|
| 151 |
+
# 5.1 BENCHMARKS
|
| 152 |
+
|
| 153 |
+
We compare AWR to a number of state-of-the-art RL algorithms, including on-policy algorithms, such as TRPO (Schulman et al., 2015) and PPO (Schulman et al., 2017), off-policy algorithms, such as DDPG (Lillicrap et al., 2016), TD3 (Fujimoto et al., 2018), and SAC (Haarnoja et al., 2018a), as well as RWR (Peters & Schaal, 2007), which we include for comparison due to its similarity to AWR.2 TRPO and PPO use the implementations from OpenAI baselines (Dhariwal et al., 2017). DDPG, TD3, and SAC uses the implementations from RLkit (Pong, 2019). RWR is a custom implementation following the algorithm described by Peters & Schaal (2007).
|
| 154 |
+
|
| 155 |
+
Snapshots of the AWR policies are shown in Figure 2. Learning curves comparing the different algorithms on the OpenAI Gym benchmarks are shown in Figure 3, and Table 1 summarizes the average returns of the final policies across 5 training runs initialized with different random seeds. Overall, AWR shows competitive performance with the state-of-the-art deep RL algorithms. It significantly outperforms on-policy methods such as PPO and TRPO in both sample efficiency and asymptotic performance. While it is not yet as sample efficient as current state-of-the-art off-policy methods, such SAC and TD3, it is generally able to achieve a similar asymptotic performance, despite using only simple supervised regression for both policy and value function updates. The complex Humanoid-V2 task proved to be the most challenging case for AWR, and its performance still lags well behind SAC. Note that RWR generally does not perform well on any of these tasks. This sug
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 3: Learning curves of the various algorithms when applied to OpenAI Gym tasks. Results are averaged across 5 random seeds. AWR is generally competitive with the best current methods.
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>TRPO</td><td rowspan=1 colspan=1>PPO</td><td rowspan=1 colspan=1>DDPG</td><td rowspan=1 colspan=1>TD3</td><td rowspan=1 colspan=1>SAC</td><td rowspan=1 colspan=1>RWR</td><td rowspan=1 colspan=1>AWR(Ours)</td></tr><tr><td rowspan=1 colspan=1>Ant-v2</td><td rowspan=1 colspan=1>2901±85</td><td rowspan=1 colspan=1>1161±389</td><td rowspan=1 colspan=1>72± 1550</td><td rowspan=1 colspan=1>4285±671</td><td rowspan=1 colspan=1>5909±371</td><td rowspan=1 colspan=1>181±19</td><td rowspan=1 colspan=1>5067± 256</td></tr><tr><td rowspan=1 colspan=1>HalfCheetah-v2</td><td rowspan=1 colspan=1>3302 ± 428</td><td rowspan=1 colspan=1>4920±429</td><td rowspan=1 colspan=1>10563±382</td><td rowspan=1 colspan=1>4309±1238</td><td rowspan=1 colspan=1>9297 ±1206</td><td rowspan=1 colspan=1>1400±370</td><td rowspan=1 colspan=1>9136±184</td></tr><tr><td rowspan=1 colspan=1>Hopper-v2</td><td rowspan=1 colspan=1>1880±337</td><td rowspan=1 colspan=1>1391 ± 304</td><td rowspan=1 colspan=1>855±282</td><td rowspan=1 colspan=1>935±489</td><td rowspan=1 colspan=1>2769±552</td><td rowspan=1 colspan=1>605±114</td><td rowspan=1 colspan=1>3405±121</td></tr><tr><td rowspan=1 colspan=1>Humanoid-v2</td><td rowspan=1 colspan=1>552±9</td><td rowspan=1 colspan=1>695±59</td><td rowspan=1 colspan=1>4382 ± 423</td><td rowspan=1 colspan=1>81 ±17</td><td rowspan=1 colspan=1>8048±700</td><td rowspan=1 colspan=1>509±18</td><td rowspan=1 colspan=1>4996 ± 697</td></tr><tr><td rowspan=1 colspan=1>LunarLander-v2</td><td rowspan=1 colspan=1>104± 94</td><td rowspan=1 colspan=1>121± 49</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>185±23</td><td rowspan=1 colspan=1>229±2</td></tr><tr><td rowspan=1 colspan=1>Walker2d-v2</td><td rowspan=1 colspan=1>2765±168</td><td rowspan=1 colspan=1>2617 ±362</td><td rowspan=1 colspan=1>401± 470</td><td rowspan=1 colspan=1>4212 ± 427</td><td rowspan=1 colspan=1>5805±587</td><td rowspan=1 colspan=1>406±64</td><td rowspan=1 colspan=1>5813±483</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 1: Final returns for different algorithms on the OpenAI Gym tasks, with $\pm$ corresponding to one standard deviation of the average return across 5 random seeds. In terms of final performance, AWR generally performs comparably or better than prior methods.
|
| 163 |
+
|
| 164 |
+
gests that, although AWR is simple and easy to implement, the particular modifications it makes compared to standard RWR are critical for effective performance. To illustrate AWR’s generality on tasks with discrete actions, we compare AWR to TRPO, PPO, and RWR on LunarLander-v2. DDPG, TD3, and SAC are not easily applicable to discrete action spaces due to their need to backpropagate from the Q-function to the policy. On this discrete control task, AWR also shows strong performance compared to the other algorithms.
|
| 165 |
+
|
| 166 |
+
# 5.2 ABLATION EXPERIMENTS
|
| 167 |
+
|
| 168 |
+
To determine the effects of various design decisions, we evaluate the performance of AWR when key components of the algorithm have been removed. The experiments include an on-policy version of AWR (On-Policy), where only data collected from the latest policy is used to perform updates. We also compare with a version of AWR without the baseline $V ( \mathbf { s } )$ (No Baseline), which corresponds to using the standard RWR weights $\begin{array} { r } { \omega _ { \mathbf { s } , \mathbf { a } } = \exp ( \frac { 1 } { \beta } \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ) } \end{array}$ , and another version that uses Monte Carlo return estimates instead of $\mathrm { T D } ( \lambda )$ $\left( \mathrm { N o } \mathrm { T D } ( \lambda ) \right)$ ). The effects of these components are illustrated in Figure 4. Overall, these design decisions appear to be vital for an effective algorithm, with the most crucial components being the use of experience replay and a baseline. Updates using only on-policy data can lead to instabilities and result in noticeable degradation in performance, which may be due to overfitting on a smaller dataset. This issue might be mitigated by collecting a larger batch of on-policy data per iteration, but this can also negatively impact sample efficiency. Removing the baseline also noticeably hampers performance. Using simple Monte Carlo return estimates instead of $\mathrm { T D } ( \lambda )$ seems to be a viable alternative, and the algorithm still achieves competitive performance on some tasks. When combined, these different components yield substantial performance gains over standard RWR.
|
| 169 |
+
|
| 170 |
+
To better evaluate the effect of experience replay on AWR, we compare the performance of policies trained with different capacities for the replay buffer. Figure 4 illustrates the learning curves for buffers of size 5k, 20k, 50k, $1 0 0 \mathrm { k }$ , and $5 0 0 \mathrm { k }$ , with $5 0 \mathrm { k }$ being the default buffer size in our experiments. The size of the replay buffer appears to have a significant impact on overall performance. Smaller buffer sizes can result in instabilities during training, which again may be an effect of overfitting to a smaller dataset. As the buffer size increases, AWR remains stable even when the dataset is dominated by off-policy data from previous iterations. In fact, performance over the course of training appears more stable with larger replay buffers, but progress can also become slower. Since the sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ is modeled by the replay buffer, a larger buffer can limit the rate at which $\mu$ changes by maintaining older data for more iterations. Due to the trust region penalty in Equation 7, a slower changing $\mu$ also prevents the policy $\pi$ from changing quickly. The replay buffer therefore provides a simple mechanism to trade-off between stability and learning speed.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 4: Left: Learning curves comparing AWR with various components removed. Each component appears to contribute to improvements in performance, with the best performance achieved when all components are combined. Right: Learning curves comparing AWR with different capacity replay buffers. AWR remains stable with large replay buffers containing primarily off-policy data from previous iterations of the algorithm.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: Snapshots of $3 4 ~ \mathrm { D o F }$ humanoid and $6 4 ~ \mathrm { D o F }$ dog trained with AWR to imitate reference motion recorded from real world subjects. AWR is able to learn sophisticated skills with characters with large numbers of degrees of freedom.
|
| 177 |
+
|
| 178 |
+
# 5.3 MOTION IMITATION
|
| 179 |
+
|
| 180 |
+
The Gym benchmarks present relatively low-dimensional tasks. In this section, we study how AWR can solve higher-dimensional tasks with complex simulated characters, including a $3 4 ~ \mathrm { D o F }$ humanoid and 64 DoF dog. The objective of the tasks is to imitate reference motion clips recorded using motion capture from real world subjects. The experimental setup follows the motion imitation framework proposed by Peng et al. (2018). Motion clips are collected from publicly available datasets (CMU; SFU; Zhang et al., 2018). The skills include highly dynamics motions, such as spinkicks and canters (i.e. running), and motions that requires more coordinated movements of the character’s body, such as a cartwheel. Snapshots of the behaviors learned by the AWR policies are available in Figure 5. Table 2 compares the performance of AWR to RWR and the highly-tuned PPO implementation from Peng et al. (2018). Learning curves for the different algorithms are shown in Figure 6. AWR performs well across the set of challenging skills, consistently achieving comparable or better performance than PPO. RWR struggles with controlling the humanoid, but exhibits stronger performance on the dog. This performance difference may be due to the more dynamic and acrobatic skills of the humanoid, compared to the more standard locomotion skills of the dog.
|
| 181 |
+
|
| 182 |
+
# 5.4 OFF-POLICY LEARNING WITH STATIC DATASETS
|
| 183 |
+
|
| 184 |
+
Since AWR is an off-policy RL algorithm, it has the advantage of being able to leverage data from other sources. This not only accelerates the learning process on standard tasks, as discussed above, but also allows us to apply AWR in a fully off-policy setting, where the algorithm is provided with a static dataset of transitions, and then tasked with learning the best possible policy. To evaluate our method in this setting, we use the off-policy tasks proposed by Kumar et al. (2019). The objective of these tasks is to learn policies solely from static datasets, without collecting any additional data from the policy that is being trained. The dataset consists of trajectories $\tau \stackrel { - } { = } \{ \left( { \bf s } _ { 0 } , { \bf a } _ { 0 } , r _ { 0 } \right) , \left( { \bf s } _ { 1 } , { \bf a } _ { 1 } , r _ { 1 } \right) , \ldots \}$ from rollouts of a demo policy. Unlike standard imitation learning tasks, which only observes the states and actions from the demo policy, the dataset also provides the reward received by the demo policy at each step. The demo policies are trained using SAC on various OpenAI Gym tasks. A dataset of 1 million timesteps is collected for each task.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>PPO</td><td rowspan=1 colspan=1>RWR</td><td rowspan=1 colspan=1>AWR (Ours)</td></tr><tr><td rowspan=1 colspan=1>Humanoid:Cartwheel</td><td rowspan=1 colspan=1>0.76±0.02</td><td rowspan=1 colspan=1>0.03 ±0.01</td><td rowspan=1 colspan=1>0.78±0.07</td></tr><tr><td rowspan=1 colspan=1>Humanoid:Spinkick</td><td rowspan=1 colspan=1>0.70±0.02</td><td rowspan=1 colspan=1>0.05± 0.03</td><td rowspan=1 colspan=1>0.77 ± 0.04</td></tr><tr><td rowspan=1 colspan=1>Dog:Canter</td><td rowspan=1 colspan=1>0.76±0.03</td><td rowspan=1 colspan=1>0.78±0.04</td><td rowspan=1 colspan=1>0.86±0.01</td></tr><tr><td rowspan=1 colspan=1>Dog:Trot</td><td rowspan=1 colspan=1>0.86±0.01</td><td rowspan=1 colspan=1>0.86±0.01</td><td rowspan=1 colspan=1>0.86±0.03</td></tr><tr><td rowspan=1 colspan=1>Dog:Turn</td><td rowspan=1 colspan=1>0.75±0.02</td><td rowspan=1 colspan=1>0.75±0.03</td><td rowspan=1 colspan=1>0.82±0.03</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Table 2: Performance statistics of algorithms on the motion imitation tasks. Returns are normalized between the minimum and maximum possible returns per episode.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 6: Learning curves on motion imitation tasks. On these challenging tasks, AWR generally learns faster than PPO and RWR.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 7: Performance of various algorithms on off-policy learning tasks with static datasets. AWR is able to learn policies that are comparable or better than the original demo policies.
|
| 195 |
+
|
| 196 |
+
For AWR, we simply treat the dataset as the replay buffer $\mathcal { D }$ and directly apply the algorithm without additional modifications. Figure 7 compares AWR with other algorithms when applied to the datasets. We include comparisons to the performance of the original demo policy used to generate the dataset (Demo) and a behavioral cloning policy (BC). The comparisons also include recent off-policy methods: batch-constrained Q-learning (BCQ) (Fujimoto et al., 2019) and bootstrapping error accumulation reduction (BEAR) (Kumar et al., 2019), which have shown strong performance on off-policy learning with static datasets. Note that both of these prior methods are modifications to existing off-policy RL methods, such as TD3 and SAC, which are already quite complex. In contrast, AWR is simple and requires no modifications for the fully off-policy setting. Despite not collecting any additional data, AWR is able to learn effective policies from these fully off-policy datasets, achieving comparable or better performance than the original demo policies. On-policy methods, such as PPO performs poorly in this off-policy setting. Q-function based methods, such as TD3 and SAC, can in principle handle off-policy data but, as discussed in prior work, tend to struggle in this setting in practice (Fujimoto et al., 2019; Kumar et al., 2019). Indeed, standard behavioral cloning (BC) often outperforms these standard RL methods. In this fully off-policy setting, AWR can be interpreted as an advantage-weighted form of behavioral cloning, which assigns higher likelihoods to demonstration actions that receive higher advantages. Unlike Q-function based methods, AWR is less susceptible to issues from out-of-distribution actions as the policy is always trained on observed actions from the behaviour data (Kumar et al., 2019). AWR also shows comparable performance to BEAR and BCQ, which are specifically designed for this off-policy setting and introduce considerable algorithmic overhead.
|
| 197 |
+
|
| 198 |
+
# 6 DISCUSSION AND FUTURE WORK
|
| 199 |
+
|
| 200 |
+
We presented advantage-weighted regression, a simple off-policy reinforcement learning algorithm, where policy updates are performed using standard supervised learning methods. Despite its simplicity, our algorithm is able to solve challenging control tasks with complex simulated agents, and achieve competitive performance on standard benchmarks compared to a number of well-established RL algorithms. Our derivation introduces several new design decisions, and our experiments verify the importance of these components. AWR is also able to learn from fully off-policy datasets, demonstrating comparable performance to state-of-the-art off-policy methods. While AWR is effective for a diverse suite of tasks, it is not yet as sample efficient as the most efficient off-policy algorithms. We believe that exploring techniques for improving sample efficiency and performance on fully off-policy learning can open opportunities to deploy these methods in real world domains. We are also interested in exploring applications that are particularly suitable for these regression-based RL algorithms, as compared to other classes of RL techniques. A better theoretical understanding of the convergence properties of these algorithms, especially when combined with experience replay, could also be valuable for the development of future algorithms.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ S1ANxQW0b.
|
| 205 |
+
|
| 206 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 207 |
+
|
| 208 |
+
CMU. Cmu graphics lab motion capture database. http://mocap.cs.cmu.edu/.
|
| 209 |
+
|
| 210 |
+
Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https: //github.com/openai/baselines, 2017.
|
| 211 |
+
|
| 212 |
+
Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In ICML, pp. 1329–1338, 2016. URL http: //proceedings.mlr.press/v48/duan16.html.
|
| 213 |
+
|
| 214 |
+
Justin Fu, Aviral Kumar, Matthew Soh, and Sergey Levine. Diagnosing bottlenecks in deep qlearning algorithms. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2021–2030, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/fu19a.html.
|
| 215 |
+
|
| 216 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1587–1596, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/fujimoto18a.html.
|
| 217 |
+
|
| 218 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2052–2062, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http: //proceedings.mlr.press/v97/fujimoto19a.html.
|
| 219 |
+
|
| 220 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2829–2838, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/v48/gu16.html.
|
| 221 |
+
|
| 222 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1861–1870, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018a. PMLR. URL http://proceedings.mlr.press/ $\mathtt { v 8 0 }$ /haarnoja18b.html.
|
| 223 |
+
|
| 224 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1861–1870, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018b. PMLR. URL http://proceedings.mlr.press/ v80/haarnoja18b.html.
|
| 225 |
+
|
| 226 |
+
Hirotaka Hachiya, Takayuki Akiyama, Masashi Sugiayma, and Jan Peters. Adaptive importance sampling for value function approximation in off-policy reinforcement learning. Neural Netw., 22(10):1399–1410, December 2009. ISSN 0893-6080. doi: 10.1016/j.neunet.2009.01.002. URL http://dx.doi.org/10.1016/j.neunet.2009.01.002.
|
| 227 |
+
|
| 228 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI’16, pp. 2094–2100. AAAI Press, 2016. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3016100.3016191.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Daniel Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. CoRR, abs/1710.02298, 2017. URL http:// arxiv.org/abs/1710.02298.
|
| 233 |
+
|
| 234 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the Nineteenth International Conference on Machine Learning, ICML ’02, pp. 267–274, San Francisco, CA, USA, 2002. Morgan Kaufmann Publishers Inc. ISBN 1-55860- 873-7. URL http://dl.acm.org/citation.cfm?id $\cdot ^ { = }$ 645531.656005.
|
| 235 |
+
|
| 236 |
+
Jens Kober and Jan R. Peters. Policy search for motor primitives in robotics. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 849–856. Curran Associates, Inc., 2009. URL http://papers.nips.cc/paper/ 3545-policy-search-for-motor-primitives-in-robotics.pdf.
|
| 237 |
+
|
| 238 |
+
Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. CoRR, abs/1906.00949, 2019. URL http://arxiv.org/ abs/1906.00949.
|
| 239 |
+
|
| 240 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Manfred Otto Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. ICLR, 2016.
|
| 241 |
+
|
| 242 |
+
Nicolas Meuleau, Leonid Peshkin, Leslie P. Kaelbling, and Kee eung Kim. Off-policy policy search. Technical report, 2000.
|
| 243 |
+
|
| 244 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, February 2015. ISSN 00280836. URL http://dx.doi.org/10.1038/nature14236.
|
| 245 |
+
|
| 246 |
+
Remi Munos, Thomas Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient off-´ policy reinforcement learning. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS’16, pp. 1054–1062, USA, 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3157096. 3157214.
|
| 247 |
+
|
| 248 |
+
Ofir Nachum, Mohammad Norouzi, George Tucker, and Dale Schuurmans. Learning gaussian policies from smoothed action value functions, 2018. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1nLkl-0Z.
|
| 249 |
+
|
| 250 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML’10, pp. 807–814, USA, 2010. Omnipress. ISBN 978-1-60558-907-7. URL http://dl.acm.org/citation.cfm?id=3104322.3104425.
|
| 251 |
+
|
| 252 |
+
Gerhard Neumann. Variational inference for policy search in changing situations. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML’11, pp. 817–824, USA, 2011. Omnipress. ISBN 978-1-4503-0619-5. URL http://dl.acm. org/citation.cfm?id=3104482.3104585.
|
| 253 |
+
|
| 254 |
+
Gerhard Neumann and Jan R. Peters. Fitted q-iteration by advantage weighted regression. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 1177–1184. Curran Associates, Inc., 2009. URL http://papers.nips.cc/paper/ 3501-fitted-q-iteration-by-advantage-weighted-regression.pdf.
|
| 255 |
+
|
| 256 |
+
Junhyuk Oh, Yijie Guo, Satinder Singh, and Honglak Lee. Self-imitation learning. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 3878–3887, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/oh18b.html.
|
| 257 |
+
|
| 258 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, July 2017.
|
| 259 |
+
|
| 260 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Exampleguided deep reinforcement learning of physics-based character skills. ACM Trans. Graph., 37 (4):143:1–143:14, July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201311. URL http: //doi.acm.org/10.1145/3197517.3201311.
|
| 261 |
+
|
| 262 |
+
Jan Peters and Stefan Schaal. Reinforcement learning by reward-weighted regression for operational space control. In Proceedings of the 24th International Conference on Machine Learning, ICML ’07, pp. 745–750, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-793-3. doi: 10.1145/ 1273496.1273590. URL http://doi.acm.org/10.1145/1273496.1273590.
|
| 263 |
+
|
| 264 |
+
Jan Peters, Katharina Mulling, and Yasemin Alt ¨ un. Relative entropy policy search. In ¨ Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, AAAI’10, pp. 1607–1612. AAAI Press, 2010. URL http://dl.acm.org/citation.cfm?id=2898607.2898863.
|
| 265 |
+
|
| 266 |
+
Vitchyr Pong. Rlkit. https://github.com/vitchyr/rlkit, 2019.
|
| 267 |
+
|
| 268 |
+
Doina Precup, Richard S. Sutton, and Sanjoy Dasgupta. Off-policy temporal difference learning with function approximation. In Proceedings of the Eighteenth International Conference on Machine Learning, ICML ’01, pp. 417–424, San Francisco, CA, USA, 2001. Morgan Kaufmann Publishers Inc. ISBN 1-55860-778-1. URL http://dl.acm.org/citation.cfm?i $\mathtt { d } = 6 4 5 5 3 0$ . 655817.
|
| 269 |
+
|
| 270 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. In Proceedings of Robotics: Science and Systems (RSS), 2018.
|
| 271 |
+
|
| 272 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1889–1897, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr. press/v37/schulman15.html.
|
| 273 |
+
|
| 274 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/ 1707.06347.
|
| 275 |
+
|
| 276 |
+
SFU. Sfu motion capture database. http://mocap.cs.sfu.ca/.
|
| 277 |
+
|
| 278 |
+
Richard S. Sutton and Andrew G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981.
|
| 279 |
+
|
| 280 |
+
Richard S Sutton, David A. McAllester, Satinder P. Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In S. A. Solla, T. K. Leen, and K. Muller (eds.), ¨ Advances in Neural Information Processing Systems 12, pp. 1057–1063. MIT Press, 2000.
|
| 281 |
+
|
| 282 |
+
Qing Wang, Jiechao Xiong, Lei Han, peng sun, Han Liu, and Tong Zhang. Exponentially weighted imitation learning for batched historical data. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 6288–6297. Curran Associates, Inc., 2018.
|
| 283 |
+
|
| 284 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and ´ Nando de Freitas. Sample efficient actor-critic with experience replay. CoRR, abs/1611.01224, 2016. URL http://arxiv.org/abs/1611.01224.
|
| 285 |
+
|
| 286 |
+
Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8(3-4):229–256, May 1992. ISSN 0885-6125. doi: 10.1007/ BF00992696. URL https://doi.org/10.1007/BF00992696.
|
| 287 |
+
|
| 288 |
+
He Zhang, Sebastian Starke, Taku Komura, and Jun Saito. Mode-adaptive neural networks for quadruped motion control. ACM Trans. Graph., 37(4):145:1–145:11, July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201366. URL http://doi.acm.org/10.1145/ 3197517.3201366.
|
| 289 |
+
|
| 290 |
+
# A AWR DERIVATION
|
| 291 |
+
|
| 292 |
+
In this section, we derive the AWR algorithm as an approximate optimization of a constrained policy search problem. Our goal is to find a policy that maximize the expected improvement $\eta ( \pi ) ~ =$ $J ( \pi ) \stackrel { - } { - } J ( \mu )$ over a sampling policy $\mu ( \mathbf { a } | \mathbf { s } )$ . We start with a lemma from Kakade & Langford (2002), which shows that the expected improvement can be expressed in terms of the advantage $A ^ { \mu } ( \mathbf { s } , \mathbf { a } ) = \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } )$ with respect to the sampling policy $\mu$ , where $\mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu }$ denotes the return obtained by performing action a in state s and following $\mu$ for the following timesteps, and $V ^ { \mu } ( \mathbf { s } ) =$ $\int _ { \mathbf { a } } \mu ( \mathbf { a } | \mathbf { s } ) \dot { \mathcal { R } } _ { \mathbf { s } } ^ { \mathbf { a } }$ da corresponds to the value function of $\mu$ ,
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r l } & { \mathbb { E } _ { \tau \sim p _ { \tau } ( \tau ) } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } A ^ { \mu } ( s _ { t } , \mathbf { a } _ { t } ) \right] } \\ & { = \mathbb { E } _ { \tau \sim p _ { \tau } ( \tau ) } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( \tau ( s _ { t } , \mathbf { a } _ { t } ) + \gamma V ^ { \mu } ( s _ { t + 1 } ) - V ^ { \mu } ( s _ { t } ) \right) \right] } \\ & { = \mathbb { E } _ { \tau \sim p _ { \tau } ( \tau ) } \left[ - V ^ { \mu } ( \mathbf { a } _ { 0 } ) + \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , \mathbf { a } _ { t } ) \right] } \\ & { = - \mathbb { E } _ { s _ { 0 } \sim p ( \mathbf { s } _ { 0 } ) } \left[ V ^ { \mu } ( \mathbf { s } _ { 0 } ) \right] + \mathbb { E } _ { \tau \sim p _ { \tau } ( \tau ) } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , \mathbf { a } _ { t } ) \right] } \\ & { = - J ( \mu ) + J ( \pi ) } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
We can rewrite Equation 22 with an expectation over states instead of trajectories:
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r l } & { \displaystyle \eta ( \boldsymbol { \pi } ) = \mathbb { E } _ { \boldsymbol { \tau } \sim p _ { \boldsymbol { \pi } } ( \boldsymbol { \tau } ) } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } A ^ { \mu } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] } \\ & { \qquad = \displaystyle \sum _ { t = 0 } ^ { \infty } \int _ { \mathbf { s } } p ( \mathbf { s } _ { t } = \mathbf { s } | \pi ) \int _ { \mathbf { a } } \boldsymbol { \pi } ( \mathbf { a } | \mathbf { s } ) \gamma ^ { t } A ^ { \mu } ( \mathbf { s } , \mathbf { a } ) d \mathbf { a } \ d \mathbf { s } } \\ & { \qquad = \displaystyle \int _ { \mathbf { s } } \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } p ( \mathbf { s } _ { t } = \mathbf { s } | \pi ) \int _ { \mathbf { a } } \boldsymbol { \pi } ( \mathbf { a } | \mathbf { s } ) A ^ { \mu } ( \mathbf { s } , \mathbf { a } ) d \mathbf { a } d \mathbf { s } } \\ & { \qquad = \displaystyle \int _ { \mathbf { s } } d \boldsymbol { \pi } ( \mathbf { s } ) \int _ { \mathbf { a } } \boldsymbol { \pi } ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] \ d \mathbf { a } d \mathbf { s } , } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
where $\begin{array} { r } { d _ { \pi } ( \mathbf { s } ) \ = \ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } p ( \mathbf { s } _ { t } \ = \ \mathbf { s } | \pi ) } \end{array}$ represents the unnormalized discounted state distribution induced by the policy $\pi$ (Sutton & Barto, 1998), and $p ( \mathbf { s } _ { t } = \mathbf { s } | \boldsymbol { \pi } )$ is the likelihood of the agent being in state s after following $\pi$ for $t$ timesteps.
|
| 305 |
+
|
| 306 |
+
The objective in Equation 25 can be difficult to optimize due to the dependency between $d _ { \pi } ( \mathbf { s } )$ and $\pi$ , as well as the need to collect samples from $\pi$ . Following Schulman et al. (2015), we can optimize an approximation $\hat { \eta } ( \pi )$ of $\eta ( \pi )$ using the state distribution of $\mu$ ,
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\widehat { \eta } ( \pi ) = \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } .
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
$\hat { \eta } ( \pi )$ matches $\eta ( \pi )$ to first order (Kakade $\&$ Langford, 2002), and provides a reasonable estimate of $\eta$ if $\pi$ and $\mu$ are similar. Using this objective, we can formulate the following constrained policy search problem:
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { r l } { \arg \operatorname* { m a x } } & { \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } } \\ { \mathrm { s . t . } } & { \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) | | \mu ( \cdot | \mathbf { s } ) \right) \leq \epsilon , \quad \forall \mathbf { s } } \\ & { \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) d \mathbf { a } = 1 , \quad \forall \mathbf { s } . } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
Since enforcing the pointwise $\mathrm { K L }$ constraint in Equation 28 at all states is intractable, we relax the constraint by enforcing it only in expectation $\begin{array} { r } { \int _ { \bf s } d _ { \mu } ( { \bf s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | { \bf s } ) | | \mu ( \cdot | { \bf s } ) \right) d { \bf s } \leq \epsilon } \end{array}$ . To further
|
| 319 |
+
|
| 320 |
+
simplify the optimization problem, we relax the hard KL constraint by converting it into a soft constraint with coefficient $\beta$ ,
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\begin{array} { r l } { \underset { \pi } { \operatorname { r g m a x } } } & { ( \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) [ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) ] d \mathbf { a } d \mathbf { s } ) + \beta ( \epsilon - \displaystyle \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } ( \pi ( \cdot | \mathbf { s } ) ) | | \mu ( \cdot | \mathbf { s } ) ) d \mathbf { s } ) } \\ { \mathrm { s . t . ~ } } & { \displaystyle \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) d \mathbf { a } = 1 , \quad \forall \mathbf { s } . } \end{array}
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Next we form the Lagrangian,
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { l } { { \displaystyle \left. \pi , \beta , \alpha \right. = \left( \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right] d \mathbf { a } d \mathbf { s } \right) + \beta \left( \epsilon - \int _ { \mathbf { s } } d _ { \mu } ( \mathbf { s } ) \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) \right| | \mu ( \cdot | \mathbf { s } ) \right) d \mathbf { s } \ , } } \\ { { \displaystyle \qquad + \int _ { \mathbf { s } } \alpha _ { \mathbf { s } } \left( 1 - \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) d \mathbf { a } \right) d \mathbf { s } , \ } } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
with $\beta$ and $\alpha = \{ \alpha _ { \mathbf { s } } \mid \forall \mathbf { s } \in S \}$ corresponding to the Lagrange multipliers. Differentiating $\mathcal { L } ( \pi , \beta , \alpha )$ with respect to $\pi ( \mathbf { a } | \mathbf { s } )$ results in
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\frac { \partial \mathcal { L } } { \partial \pi ( \mathbf { a } | \mathbf { s } ) } = d _ { \mu } ( \mathbf { s } ) \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) - \beta d _ { \mu } ( \mathbf { s } ) \log \pi ( \mathbf { a } | \mathbf { s } ) + \beta d _ { \mu } ( \mathbf { s } ) \log \mu ( \mathbf { a } | \mathbf { s } ) - \beta d _ { \mu } ( \mathbf { s } ) - \alpha _ { \mathbf { s } } .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Setting to zero and solving for $\pi ( \mathbf { a } | \mathbf { s } )$ gives
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\log \pi ( \mathbf { a } | \mathbf { s } ) = \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) + \log \mu ( \mathbf { a } | \mathbf { s } ) - 1 - \frac { 1 } { d _ { \mu } ( \mathbf { s } ) } \frac { \alpha _ { \mathbf { s } } } { \beta }
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\pi ( \mathbf { a } | \mathbf { s } ) = \mu ( \mathbf { a } | \mathbf { s } ) \mathrm { e x p } \left( { \frac { 1 } { \beta } } \left( { \mathcal { R } } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) \mathrm { e x p } \left( - { \frac { 1 } { d _ { \mu } ( \mathbf { s } ) } } { \frac { \alpha _ { \mathbf { s } } } { \beta } } - 1 \right)
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
Since $\begin{array} { r } { \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) ~ d \mathbf { a } = 1 } \end{array}$ , the second exponential term is the partition function $Z ( \mathbf { s } )$ that normalizes the conditional action distribution,
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
Z ( \mathbf { s } ) = \exp \left( \frac { 1 } { d _ { \mu } ( \mathbf { s } ) } \frac { \alpha _ { \mathbf { s } } } { \beta } + 1 \right) = \int _ { \mathbf { a } ^ { \prime } } \mu ( \mathbf { a } ^ { \prime } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } ^ { \prime } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) d \mathbf { a } ^ { \prime } .
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
The optimal policy is therefore given by,
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
\pi ^ { \ast } ( \mathbf { a } | \mathbf { s } ) = \frac { 1 } { Z ( \mathbf { s } ) } \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right)
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
If $\pi$ is represented by a function approximator, the optimal policy $\pi ^ { * }$ can be projected onto the manifold of parameterized policies by solving the following supervised regression problem
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
\begin{array} { r l } & { \underset { \pi } { \arg \operatorname* { m i n } } \quad \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathrm { K L } } \left( \pi ^ { * } ( \cdot | \mathbf { s } ) | | \pi ( \cdot | \mathbf { s } ) \right) \right] } \\ & { = \underset { \pi } { \arg \operatorname* { m i n } } \quad \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathrm { K L } } \left( \frac { 1 } { Z ( \mathbf { s } ) } \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) \bigg | \bigg | \pi ( \cdot | \mathbf { s } ) \right) \right] } \\ & { = \underset { \pi } { \arg \operatorname* { m a x } } \quad \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \mu ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mu } - V ^ { \mu } ( \mathbf { s } ) \right) \right) \right] , } \end{array}
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
# B AWR DERIVATION WITH EXPERIENCE REPLAY
|
| 367 |
+
|
| 368 |
+
In this section, we extend the derivation presented in Appendix A to incorporate experience replay using a replay buffer containing data from previous policies. To recap, the sampling distribution is a mixture of $k$ past policies $\{ \pi _ { 1 } , \cdots , \pi _ { k } \}$ , where the mixture is performed at the trajectory level. First, we define the trajectory distribution $\mu ( \tau )$ , marginal state-action distribution $\mu ( \mathbf { s } , \mathbf { a } )$ , and marginal state distribution $d _ { \mu } ( \mathbf { s } )$ of the replay buffer according to:
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\mu ( \tau ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \tau ) , \qquad \mu ( \mathbf { s } , \mathbf { a } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \mathbf { a } | \mathbf { s } ) , \quad d _ { \mu } ( \mathbf { s } ) = \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } )
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
where the weights $\textstyle \sum _ { i } w _ { i } = 1$ specify the probabilities of selecting each policy $\pi _ { i }$ . The conditional action distribution $\mu ( \mathbf { a } | \mathbf { s } )$ induced by the replay buffer is given by:
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\mu ( \mathbf { a } | \mathbf { s } ) = \frac { \mu ( \mathbf { s } , \mathbf { a } ) } { d _ { \mu } ( \mathbf { s } ) } = \frac { \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } { \sum _ { j = 1 } ^ { k } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } .
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
Next, using Lemma 6.1 from Kakade & Langford (2002) (also derived in Appendix A), the expected improvement of $\pi$ over each policy $\pi _ { i }$ satisfies
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
J ( \pi ) = J ( \pi _ { i } ) + \mathbb { E } _ { \mathbf { s } \sim d _ { \pi } ( \mathbf { s } ) , a \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) \right]
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
The expected improvement over the mixture can then be expressed with respect to the individual policies,
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r l } { { \eta ( \boldsymbol { \pi } ) = J ( \boldsymbol { \pi } ) - J ( \boldsymbol { \mu } ) } } \\ & { = J ( \boldsymbol { \pi } ) - \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } J ( \pi _ { i } ) } \\ & { = \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } ( J ( \boldsymbol { \pi } ) - J ( \pi _ { i } ) ) } \\ & { = \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } ( \mathbb { E } _ { \mathbf { s } \sim d _ { \boldsymbol { \pi } } ( \mathbf { s } ) , \mathbf { a } \sim \boldsymbol { \pi } ( \mathbf { a } \mid \mathbf { s } ) } [ A ^ { \pi _ { i } } ( \mathbf { s } , \mathbf { a } ) ] ) } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
In order to ensure that the policy $\pi$ is similar to the past policies, we constrain $\pi$ against the conditional action distributions of the replay buffer,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { r } { \mathbb { E } _ { \mathbf { s } \sim \mu ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \mathbf { a } | \mathbf { s } ) \Big | \Big | \mu ( \mathbf { a } | \mathbf { s } ) \right) \right] \leq \varepsilon . } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
Note that constraining $\pi$ against $\mu ( \mathbf { a } | \mathbf { s } )$ has a number of desirable properties. First, the constraint prevents the policy $\pi$ from choosing actions that are vastly different from all of the policies $\{ \pi _ { 1 } , \cdots , \pi _ { k } \}$ . Second, the mixture weight assigned to each $\pi _ { i }$ in the definition of $\mu$ depends on the marginal state density $d _ { \pi _ { i } } ( \mathbf { s } )$ for the particular policy. This property is desirable as the policy $\pi$ is now constrained to be similar to $\pi _ { i }$ only at states that are likely to be visited by $\pi _ { i }$ . This then yields the following constrained objective:
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\begin{array} { r l } { \arg \operatorname* { m a x } } & { \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } \mathbb { E } _ { { \mathbf { s } } \sim d _ { \pi _ { i } } ( { \mathbf { s } } ) } \mathbb { E } _ { { \mathbf { a } } \sim \pi ( { \mathbf { a } } | { \mathbf { s } } ) } \left[ \mathcal { R } _ { { \mathbf { s } } , { \mathbf { a } } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( { \mathbf { s } } ) \right] } \\ { \mathrm { s . t . } } & { \mathbb { E } _ { { \mathbf { s } } \sim d _ { \mu } ( { \mathbf { s } } ) } \left[ \mathrm { D } _ { { \mathrm { K L } } } \left( \pi ( \cdot | { \mathbf { s } } ) | | \mu ( \cdot | { \mathbf { s } } ) \right) \right] \leq \epsilon , } \\ & { \displaystyle \int _ { { \mathbf { a } } } \pi ( { \mathbf { a } } | { \mathbf { s } } ) d { \mathbf { a } } = 1 , \quad \forall { \mathbf { s } } . } \end{array}
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
The Lagrangian of the above objective is given by:
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { r l } & { \mathcal { L } ( \pi , \beta , \boldsymbol { \alpha } ) = \left( \displaystyle \sum _ { i } w _ { i } \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi ( \mathbf { a } | \mathbf { s } ) } \left[ \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( \mathbf { s } ) \right] \right) } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad + \beta \left( \epsilon - \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \mathrm { D } _ { \mathrm { K L } } \left( \pi ( \cdot | \mathbf { s } ) \bigg | \bigg | \frac { \sum _ { i = 1 } ^ { k } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \pi _ { i } ( \cdot | \mathbf { s } ) } { \sum _ { j = 1 } ^ { k } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right) \right) } \\ & { \quad \quad \quad \quad \quad \quad + \displaystyle \int _ { \mathbf { s } } \alpha _ { \mathbf { s } } \left( 1 - \int _ { \mathbf { a } } \pi ( \mathbf { a } | \mathbf { s } ) d \mathbf { a } \right) d \mathbf { s } , } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Solving the Lagrangian following the same procedure as Appendix A leads to an optimal policy of the following form:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\pi ^ { \ast } ( \mathbf { a } | \mathbf { s } ) = \frac { 1 } { Z ( \mathbf { s } ) } \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \frac { \sum _ { i } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( \mathbf { s } ) \right) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right)
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
Finally, if $\pi$ is represented by a function approximator, the optimal policy $\pi ^ { * }$ can be projected onto the manifold of parameterized policies by solving the following supervised regression problem
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { r l r } { \underset { \pi } { \arg \operatorname* { m i n } } } & { \mathbb { E } _ { \mathbf { s } , \sim d _ { \mu } ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathbf { K L } } \left( \pi ^ { * } ( \cdot | \mathbf { s } ) | | \pi ( \cdot | \mathbf { s } ) \right) \right] } & { \left. ( 5 3 ) \right. } \\ & { = \underset { \pi } { \arg \operatorname* { m i n } } } & { \mathbb { E } _ { \mathbf { s } \sim d _ { \mu } ( \mathbf { s } ) } \left[ \mathrm { D } _ { \mathbf { K L } } \left( \frac { 1 } { Z ( \mathbf { s } ) } \left. \mu ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \frac { \sum _ { i } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \left. \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - V ^ { \pi _ { i } } ( \mathbf { s } ) \right) \right)} { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right| \right| \pi ( \cdot | \mathbf { s } ) \right) \right] } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
One of the challenges of optimizing the objective in Equation 54 is that computing the expected return in the exponent requires rolling out multiple policies starting from the same state, which would require the environment to be resettable to any given state. Therefore, to obtain a more practical objective, we approximate the expected return across policies using a single rollout from the replay buffer,
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\frac { \sum _ { i } w _ { i } d _ { \pi _ { i } } ( \mathbf { s } ) \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \approx \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \mathcal { D } } \mathrm { ~ s u c h ~ t h a t ~ } ( \mathbf { s } , \mathbf { a } ) \in \mathcal { D }
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
This single-sample estimator results in a biased estimate of the exponentiated advantage, because the expectation with respect to the mixture weights appears in the exponent. But in practice, we find this biased estimator to be effective for our experiments. Therefore, the objective used in practice is given by:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\begin{array} { r l } { \underset { \pi } { \arg \operatorname* { m a x } } } & { ~ \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } \mathbb { E } _ { \mathbf { s } \sim d _ { \pi _ { i } } ( \mathbf { s } ) } \mathbb { E } _ { \mathbf { a } \sim \pi _ { i } ( \mathbf { a } | \mathbf { s } ) } \left[ \log \pi ( \mathbf { a } | \mathbf { s } ) \exp \left( \frac { 1 } { \beta } \left( \mathcal { R } _ { \mathbf { s } , \mathbf { a } } ^ { \pi _ { i } } - \frac { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) V ^ { \pi _ { j } } ( \mathbf { s } ) } { \sum _ { j } w _ { j } d _ { \pi _ { j } } ( \mathbf { s } ) } \right) \right) \right] , } \end{array}
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where the expectations can be approximated by simply sampling from $\mathcal { D }$ following Line 6 of Algorithm 1. Note, the baseline in the exponent now consists of an average of the value functions of the different policies. One approach for estimating this quantity would be to fit separate value functions $V ^ { \pi _ { i } }$ for each policy. However, if only a small amount of data is available from each policy, then $V ^ { \pi _ { i } }$ could be highly inaccurate. Therefore, instead of learning separate value functions, we fit a single mean value function $\bar { V } ( \mathbf { s } )$ that directly estimates the weighted average of $V ^ { \pi _ { i } }$ ’s,
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\bar { V } = \underset { V } { \arg \operatorname* { m i n } } \sum _ { i } w _ { i } \mathbb { E } _ { { \mathbf { s } } , \sim d _ { \pi _ { i } } ( { \mathbf { s } } ) } \mathbb { E } _ { { \mathbf { a } } \sim \pi _ { i } ( { \mathbf { a } } | { \mathbf { s } } ) } \big [ | | \mathcal { R } _ { { \mathbf { s } } , { \mathbf { a } } } ^ { \pi _ { i } } - V ( { \mathbf { s } } ) | | ^ { 2 } \big ]
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
This loss can also be approximated by simply sampling from the replay buffer following Line 5 of Algorithm 1. The optimal solution V¯ (s) = Pi widπi (s)VP πi (s)w d (s) i s exactly the baseline in Equation 56.
|
| 441 |
+
|
| 442 |
+
# C EXPERIMENTAL SETUP
|
| 443 |
+
|
| 444 |
+
In our experiments, the policy is represented by a fully-connected network with 2 hidden layers consisting of 128 and 64 ReLU units respectively (Nair & Hinton, 2010), followed by a linear output layer. The value function is modeled by a separate network with a similar architecture, but consists of a single linear output unit for the value. Stochastic gradient descent with momentum is used to update both the policy and value function. The stepsize of the policy and value function are $5 \times 1 0 ^ { - 5 }$ and $1 \times 1 0 ^ { - 4 }$ respectively, and a momentum of 0.9 is used for both. The temperature is set to $\beta = 0 . 0 5$ for all experiments, and $\lambda = 0 . 9 5$ is used for $\mathrm { T D } ( \lambda )$ . The weight clipping threshold $\omega _ { \mathrm { m a x } }$ is set to 20. At each iteration, the agent collects a batch of approximately 2000 samples, which are stored in the replay buffer $\mathcal { D }$ along with samples from previous iterations. The replay buffer stores $5 0 \mathrm { k }$ of the most recent samples. Updates to the value function and policy are performed by uniformly sampling minibatches of 256 samples from $\mathcal { D }$ . The value function is updated with 200 gradient steps per iteration, and the policy is updated with 1000 gradient steps.
|
| 445 |
+
|
| 446 |
+
# D SIMILARITIES TO POLICY GRADIENTS
|
| 447 |
+
|
| 448 |
+
On the surface, the AWR policy update bears striking similarities to a conventional policy gradient (PG) update (Sutton et al., 2000):
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\_
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
However, there are a number of subtle but important differences between the two. First, basic policy gradient algorithms are on-policy methods, which requires the data to be sampled from the same policy $\cdot$ that is being optimized s $\sim d _ { \pi } ( \mathbf { s } )$ and a $\sim \pi ( \mathbf { a } | \mathbf { s } )$ , whereas AWR can in principle learn using data from any sampling distribution $\cdot$ . This requirement for policy gradient methods is because PG directly differentiates through the sampling distribution to compute the gradient of the expected return with respect to the policy parameters. But with AWR and other EM algorithms, they first construct an estimate of the optimal action distribution at each state, and then projects that action distribution onto the space of parameterized policies. Therefore AWR does not need to differentiate through the sampling distribution, which is a critical feature for settings such as batch RL, where the sampling distribution (e.g. demo policy) may not be available to the agent. In AWR, the log probability of an action $\cdot$ is weighted by the exponentiated advantage $\cdot$ , while in PG the log probability is weighted just by the advantage $\cdot$ without the exponential. Since the exponentiated advantage is non-negative, the objective used in the AWR update is a maximum likelihood objective that tries to maximize the likelihood of all actions, but to varying amounts depending on the exponentiated advantage. In the case of PG, the advantage can be both positive and negative, therefore PG updates decrease the likelihood of actions with negative advantages, and thus it is not a conventional maximum likelihood objective. In practice, negative TD updates are often a source of instability when applying PG to off-policy data.
|
| 455 |
+
|
| 456 |
+
# E ADDITIONAL EXPERIMENTS
|
| 457 |
+
|
| 458 |
+
A comprehensive comparison of AWR with prior methods on all of the tasks considered are available in Figure 8 and 9.
|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
Figure 8: Learning curves of the various algorithms when applied to OpenAI Gym tasks. Results are averaged over 5 random seeds. AWR is generally competitive with the best current methods.
|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
Figure 9: Learning curves on motion imitation tasks. On these challenging tasks, AWR generally learns faster than PPO and RWR.
|
| 465 |
+
|
| 466 |
+
# E.1 WEIGHT CLIPPING
|
| 467 |
+
|
| 468 |
+
To analyze the effects of weight clipping on the stability of AWR, we compare learning curves of policies trained with weight clipping using a threshold of $\cdot$ , and policies trained without weight clipping. Figure 10 compares the learning curves with and without clipping. 5 separate AWR runs with different random seeds are visualized separately. With weight clipping, performance remains stable throughout training. Policies trained without weight clipping are substantially more unstable, exhibiting drastic fluctuations in performance as a result of exploding gradients from excessively large weights. Some training runs without clipping are terminated early due to exploding gradients causing the networks to output NaNs. These experiments suggest that weight clipping is vital for ensuring stable training with AWR.
|
| 469 |
+
|
| 470 |
+

|
| 471 |
+
Figure 10: Learning curves comparing AWR policies trained with and without weight clipping. Weight clipping is vital for ensuring stable training with AWR. Policies trained without weight clipping are susceptible to exploding gradients due to excessively large weights.
|
md/train/HJ94fqApW/HJ94fqApW.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING THE SMALLER-NORM-LESSINFORMATIVE ASSUMPTION IN CHANNEL PRUNING OF CONVOLUTION LAYERS
|
| 2 |
+
|
| 3 |
+
Jianbo $\mathbf { Y e ^ { * } }$
|
| 4 |
+
College of Information Sciences and Technology
|
| 5 |
+
The Pennsylvania State University
|
| 6 |
+
jxy198@ist.psu.edu
|
| 7 |
+
Xin Lu, Zhe Lin
|
| 8 |
+
Adobe Research
|
| 9 |
+
{xinl,zlin}@adobe.com
|
| 10 |
+
James Z. Wang
|
| 11 |
+
College of Information Sciences and Technology
|
| 12 |
+
The Pennsylvania State University
|
| 13 |
+
jwang@ist.psu.edu
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Model pruning has become a useful technique that improves the computational efficiency of deep learning, making it possible to deploy solutions in resourcelimited scenarios. A widely-used practice in relevant work assumes that a smallernorm parameter or feature plays a less informative role at the inference time. In this paper, we propose a channel pruning technique for accelerating the computations of deep convolutional neural networks (CNNs) that does not critically rely on this assumption. Instead, it focuses on direct simplification of the channel-tochannel computation graph of a CNN without the need of performing a computationally difficult and not-always-useful task of making high-dimensional tensors of CNN structured sparse. Our approach takes two stages: first to adopt an end-toend stochastic training method that eventually forces the outputs of some channels to be constant, and then to prune those constant channels from the original neural network by adjusting the biases of their impacting layers such that the resulting compact model can be quickly fine-tuned. Our approach is mathematically appealing from an optimization perspective and easy to reproduce. We experimented our approach through several image learning benchmarks and demonstrate its interesting aspects and competitive performance.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Not all computations in a deep neural network are of equal importance. In a typical deep learning pipeline, an expert crafts a neural architecture, which is trained using a prepared dataset. The success of training a deep model often requires trial and error, and such loop usually has little control on prioritizing the computations happening in the neural network. Recently researchers started to develop model-simplification methods for convolutional neural networks (CNNs), bearing in mind that some computations are indeed non-critical or redundant and hence can be safely removed from a trained model without substantially degrading the model’s performance. Such methods not only accelerate computational efficiency but also possibly alleviate the model’s overfitting effects.
|
| 22 |
+
|
| 23 |
+
Discovering which subsets of the computations of a trained CNN are more reasonable to prune, however, is nontrivial. Existing methods can be categorized from either the learning perspective or from the computational perspective. From the learning perspective, some methods use a dataindependent approach where the training data does not assist in determining which part of a trained CNN should be pruned, e.g. He et al. (2017) and Zhang et al. (2016), while others use a datadependent approach through typically a joint optimization in generating pruning decisions, e.g., Han et al. (2015) and Anwar et al. (2017). From the computational perspective, while most approaches focus on setting the dense weights of convolutions or linear maps to be structured sparse, we propose here a method adopting a new conception to achieve in effect the same goal.
|
| 24 |
+
|
| 25 |
+
Instead of regarding the computations of a CNN as a collection of separate computations sitting at different layers, we view it as a network flow that delivers information from the input to the output through different channels across different layers. We believe saving computations of a CNN is not only about reducing what are calculated in an individual layer, but perhaps more importantly also about understanding how each channel is contributing to the entire information flow in the underlying passing graph as well as removing channels that are less responsible to such process. Inspired by this new conception, we propose to design a “gate” at each channel of a CNN, controlling whether its received information is actually sent out to other channels after processing. If a channel “gate” closes, its output will always be a constant. In fact, each designed “gate” will have a prior intention to close, unless it has a “strong” duty in sending some of its received information from the input to subsequent layers. We find that implementing this idea in pruning CNNs is unsophisticated, as will be detailed in Sec 4.
|
| 26 |
+
|
| 27 |
+
Our method neither introduces any extra parameters to the existing CNN, nor changes its computation graph. In fact, it only introduces marginal overheads to existing gradient training of CNNs. It also possess an attractive feature that one can successively build multiple compact models with different inference performances in a single round of resource-intensive training (as in our experiments). This eases the process to choose a balanced model to deploy in production. Probably, the only applicability constraint of our method is that all convolutional layers and fully-connected layer (except the last layer) in the CNN should be batch normalized (Ioffe & Szegedy, 2015). Given batch normalization has becomes a widely adopted ingredient in designing state-of-the-art deep learning models, and many successful CNN models are using it, we believe our approach has a wide scope of potential impacts.1
|
| 28 |
+
|
| 29 |
+
In this paper, we start from rethinking a basic assumption widely explored in existing channel pruning work. We point out several issues and gaps in realizing this assumption successfully. Then, we propose our alternative approach, which works around several numerical difficulties. Finally, we experiment our method across different benchmarks and validate its usefulness and strengths.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Reducing the size of neural network for speeding up its computational performance at inference time has been a long-studied topic in the communities of neural network and deep learning. Pioneer works include Optimal Brain Damage (LeCun et al., 1990) and Optimal Brain Surgeon (Hassibi & Stork, 1993). More recent developments focused on either reducing the structural complexity of a provided network or training a compact or simplified network from scratch. Our work can be categorized into the former, thus the literature review below revolves around reducing the structural complexity.
|
| 34 |
+
|
| 35 |
+
To reduce the structural complexity of deep learning models, previous work have largely focused on sparsifying the weights of convolutional kernels or the feature maps across multiple layers in a network (Anwar et al., 2017; Han et al., 2015). Some recent efforts proposed to impose structured sparsity on those vector components motivated from the implementation perspective on specialized hardware (Wen et al., 2016; Zhou et al., 2016; Alvarez & Salzmann, 2016; Lebedev & Lempitsky, 2016). Yet as argued by Molchanov et al. (2017), regularization-based pruning techniques require per layer sensitivity analysis which adds extra computations. Their method relies on global rescaling of criteria for all layers and does not require sensitivity estimation, a beneficial feature that our approach also has. To our knowledge, it is also unclear how widely useful those works are in deep learning. In Section 3, we discuss in details the potential issues in regularization-based pruning techniques potentially hurting them being widely applicable, especially for those that regularize high-dimensional tensor parameters or use magnitude-based pruning methods. Our approach works around the mentioned issues by constraining the anticipated pruning operations only to batchnormalized convolutional layers. Instead of posing structured sparsity on kernels or feature maps, we enforce sparsity on the scaling parameter $\gamma$ in batch normalization operator. This blocks the sample-wise information passing through part of the channels in convolution layer, and in effect implies one can safely remove those channels.
|
| 36 |
+
|
| 37 |
+
A recent work by Huang & Wang (2017) used a similar technique as ours to remove unimportant residual modules in ResNet by introducing extra scaling factors to the original network. However, some optimization subtleties as to be pointed out in our paper were not well explained. Another recent work called Network-Slimming (Liu et al., 2017) also aims to sparsify the scaling parameters of batch normalization. But instead of using off-the-shelf gradient learning like theirs, we propose a new algorithmic approach based on ISTA and rescaling trick, improving robustness and speed of the undergoing optimization. In particular, the work of Liu et al. (2017) was able to prune VGG-A model on ImageNet. It is unclear how their work would deal with the $\gamma { - } W$ rescaling effect and whether their approach can be adopted to large pre-trained models, such as ResNets and Inceptions. We experimented with the pre-trained ResNet-101 and compared to most recent work that were shown to work well with large CNNs. We also experimented with an image segmentation model which has an inception-like module (pre-trained on ImageNet) to locate foreground objects.
|
| 38 |
+
|
| 39 |
+
# 3 RETHINKING THE SMALLER-NORM-LESS-INFORMATIVE ASSUMPTION
|
| 40 |
+
|
| 41 |
+
In most regularized linear regressions, a large-norm coefficient is often a strong indicator of a highly informative feature. This has been widely perceived in statistics and machine learning communities. Removing features which have a small coefficient does not substantially affect the regression errors. Therefore, it has been an established practice to use tractable norm to regularize the parameters in optimizing a model and pick the important ones by comparing their norms after training. However, this assumption is not unconditional. By using Lasso or ridge regression to select important predictors in linear models, one always has to first normalize each predictor variable. Otherwise, the result might not be explanatory. For example, ridge regression penalizes more the predictors which has low variance, and Lasso regression enforces sparsity of coefficients which are already small in OLS. Such normalization condition for the right use of regularization is often unsatisfied for nonconvex learning. For example, one has to carefully consider two issues outlined below. We provides these two cases to exemplify how regularization could fail or be of limited usage. There definitely exist ways to avoid the described failures.
|
| 42 |
+
|
| 43 |
+
Model Reparameterization. In the first case, we show that it is not easy to have fine-grained control of the weights’ norms across different layers. One has to either choose a uniform penalty in all layers or struggle with the reparameterization patterns. Consider to find a deep linear (convolutional) network subject to a least square with Lasso: for $\lambda > 0$ ,
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname* { m i n } _ { \{ W _ { i } \} _ { i = 1 } ^ { 2 n } } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \| W _ { 2 n } \ast \ldots \ast W _ { 2 } \ast W _ { 1 } \ast x - y \| ^ { 2 } + \lambda \sum _ { i = 1 } ^ { n } \| W _ { 2 i } \| _ { 1 } .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The above formulation is not a well-defined problem because for any parameter set 0 2n $\{ W _ { i } \} _ { i = 1 } ^ { 2 n }$ , one i=1can always find another parameter set {W i } i=1 such that it achieves a smaller total loss while keeping the corresponding $l _ { 0 }$ norm unchanged by actually setting
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
W _ { i } ^ { \prime } = \alpha W _ { i } , i = 1 , 3 , \ldots , 2 n - 1 \mathrm { ~ a n d ~ } W _ { i } ^ { \prime } = W _ { i } / \alpha , i = 2 , 4 , \ldots , 2 n .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\alpha > 1$ . In another word, for any $\epsilon > 0$ , one can always find a parameter set $\{ W _ { i } \} _ { i = 1 } ^ { 2 n }$ (which is usually non-sparse) that minimizes the first least square loss while having its second Lasso term less than $\epsilon$ .
|
| 56 |
+
|
| 57 |
+
We note that gradient-based learning is highly inefficient in exploring such model reparameterization patterns. In fact, there are some recent discussions around this (Dinh et al., 2017). If one adopts a pre-trained model, and augments its original objective with a new norm-based parameter regularization, the new gradient updates may just increase rapidly or it may take a very long time for the variables traveling along the model’s reparameterization trajectory. This highlights a theoretical gap questioning existing sparsity-inducing formulation and actual computational algorithms whether they can achieve widely satisfactory parameter sparsification for deep learning models.
|
| 58 |
+
|
| 59 |
+
Transform Invariance. In the second case, we show that batch normalization is not compatible with weight regularization. The example is penalizing $l _ { 1 }$ - or $l _ { 2 }$ -norms of filters in convolution layer which is then followed by a batch normalization: at the $l$ -th layer, we let
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
x ^ { l + 1 } = \operatorname* { m a x } \{ \gamma \cdot \mathbf { B N } _ { \mu , \sigma , \epsilon } ( W ^ { l } * x ^ { l } ) + \beta , 0 \} ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\gamma$ and $\beta$ are vectors whose length is the number of channels. Likewise, one can clearly see that any uniform scaling of $W ^ { l }$ which changes its $l _ { 1 }$ - and $l _ { 2 }$ -norms would have no effects on the output $x ^ { l + 1 }$ . Alternatively speaking, if one is interested in minimizing the weight norms of multiple layers together, it becomes unclear how to choose proper penalty for each layer. Theoretically, there always exists an optimizer that can change the weight to one with infinitesimal magnitude without hurting any inference performance. As pointed by one of the reviewers, one can tentatively avoid this issue by projecting the weights to the surface of unit ball. Then one has to deal with a non-convex feasible set of parameters, causing extra difficulties in developing optimization for data-dependent pruning methods. It is also worth noting that some existing work used such strategy in a layer-by-layer greedy way (He et al., 2017; Zhang et al., 2016).
|
| 66 |
+
|
| 67 |
+
Based on this discussion, many existing works which claim to use Lasso, group Lasso (e.g. Wen et al. (2016); Anwar et al. (2017)), or thresholding (e.g. Molchanov et al. (2017)) to enforce parameter sparsity have some theoretical gaps to bridge. In fact, many heuristic algorithms in neural net pruning actually do not naturally generate a sparse parameterized solution. More often, thresholding is used to directly set certain subset of the parameters in the network to zeros, which can be problematic. The reason is in essence around two questions. First, by setting parameters less than a threshold to zeros, will the functionality of neural net be preserved approximately with certain guarantees? If yes, then under what conditions? Second, how should one set those thresholds for weights across different layers? Not every layer contributes equally in a neural net. It is expected that some layers act critically for the performance but only use a small computation and memory budget, while some other layers help marginally for the performance but consume a lot resources. It is naturally more desirable to prune calculations in the latter kind of layers than the former.
|
| 68 |
+
|
| 69 |
+
In contrast with these existing approaches, we focus on enforcing sparsity of a tiny set of parameters in CNN — scale parameter $\gamma \mathbf { s }$ in all batch normalization. Not only placing sparse constraints on $\gamma$ is simpler and easier to monitor, but more importantly, we have two strong reasons:
|
| 70 |
+
|
| 71 |
+
1. Every $\gamma$ always multiplies a normalized random variable, thus the channel importance becomes comparable across different layers by measuring the magnitude values of $\gamma$ ;
|
| 72 |
+
2. The reparameterization effect across different layers is avoided if its subsequent convolution layer is also batch-normalized. In other words, the impacts from the scale changes of $\gamma$ parameter are independent across different layers.
|
| 73 |
+
|
| 74 |
+
Nevertheless, our current work still falls short of a strong theoretical guarantee. We believe by working with normalized feature inputs and their regularized coefficients together, one is closer to a more robust and meaningful approach. Sparsity is not the goal, but to find less important channels using sparsity inducing formulation is.
|
| 75 |
+
|
| 76 |
+
# 4 CHANNEL PRUNING OF BATCH-NORMALIZED CNN
|
| 77 |
+
|
| 78 |
+
We describe the basic principle and algorithm of our channel pruning technique.
|
| 79 |
+
|
| 80 |
+
# 4.1 PRELIMINARIES
|
| 81 |
+
|
| 82 |
+
Pruning constant channels. Consider convolution with batch normalization:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
x ^ { l + 1 } = \operatorname* { m a x } \left\{ \gamma ^ { l } \cdot { \mathrm { B N } } _ { \mu ^ { l } , \sigma ^ { l } , \epsilon ^ { l } } ( W ^ { l } * x ^ { l } ) + \beta ^ { l } , 0 \right\} .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
For the ease of notation, we let $\gamma = \gamma ^ { l }$ . Note that if some element in $\gamma$ is set to zero, say, $\gamma [ k ] = 0$ , its output image xl+1:,:,:,k becomes a constant $\beta _ { k }$ , and a convolution of a constant image channel is almost everywhere constant (except for padding regions, an issue to be discussed later). Therefore, we show those constant image channels can be pruned while the same functionality of network is approximately kept:
|
| 89 |
+
|
| 90 |
+
• If the subsequent convolution layer does not have batch normalization,
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
x ^ { l + 2 } = \operatorname* { m a x } \left\{ W ^ { l + 1 } * x ^ { l + 1 } + b ^ { l + 1 } , 0 \right\} ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
its values (a.k.a. elements in $\beta$ ) is absorbed into the bias term by the following equation
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
b _ { n e w } ^ { l + 1 } : = b ^ { l + 1 } + I ( \gamma = 0 ) \cdot \mathrm { R e L U } ( \beta ) ^ { T } \mathrm { s u m . r e d u c e d } ( W _ { : , : , \cdot } ^ { l + 1 } , ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
such that
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
x ^ { l + 2 } \approx \mathrm { m a x } \left\{ W ^ { l + 1 } * _ { \gamma } x ^ { l + 1 } + b _ { n e w } ^ { l + 1 } , 0 \right\} ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\ast _ { \gamma }$ denotes the convolution operator which is only calculated along channels indexed by non-zeros of $\gamma$ . Remark that $W ^ { * } =$ sum reduced $( W _ { : , : , \cdot , \cdot } )$ if $\begin{array} { r } { W _ { a , b } ^ { * } = \sum _ { i , j } W _ { i , j , a , b } } \end{array}$ .
|
| 109 |
+
|
| 110 |
+
• If the subsequent convolution layer has batch normalization,
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
x ^ { l + 2 } = \operatorname * { m a x } \left\{ \gamma ^ { l + 1 } \cdot { \bf B } { \bf N } _ { \mu ^ { l + 1 } , \sigma ^ { l + 1 } , \epsilon ^ { l + 1 } } \left( W ^ { l + 1 } * x ^ { l + 1 } \right) + \beta ^ { l + 1 } , 0 \right\} ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
instead its moving average is updated as
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { r } { \mu _ { n e w } ^ { l + 1 } : = \mu ^ { l + 1 } - I ( \gamma = 0 ) \cdot \mathrm { R e L U } ( \beta ) ^ { T } \mathrm { s u m . r e d u c e d } ( W _ { : , : , \cdot , \cdot } ^ { l + 1 } ) , } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
such that
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
x ^ { l + 2 } \approx \operatorname * { m a x } \left\{ \gamma ^ { l + 1 } \cdot { \bf B N } _ { \mu _ { n e w } ^ { l + 1 } , \sigma ^ { l + 1 } , \epsilon ^ { l + 1 } } \left( W ^ { l + 1 } * _ { \gamma } x ^ { l + 1 } \right) + \beta ^ { l + 1 } , 0 \right\} .
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
Remark that the approximation $( \approx )$ is strictly equivalence $( = )$ if no padding is used in the convolution operator $^ *$ , a feature that the parallel work Liu et al. (2017) does not possess. When the original model uses padding in computing convolution layers, the network function is not strictly preserved after pruning. In our practice, we fine-tune the pruned network to fix such performance degradation at last. In short, we formulate the network pruning problem as simple as to set more elements in $\gamma$ to zero. It is also much easier to deploy the pruned model, because no extra parameters or layers are introduced into the original model.
|
| 129 |
+
|
| 130 |
+
To better understand how it works in an entire CNN, imagine a channel-to-channel computation graph formed by the connections between layers. In this graph, each channel is a node, their inference dependencies are represented by directed edges. The $\gamma$ parameter serves as a “dam” at each node, deciding whether let the received information “flood” through to other nodes following the graph. An end-to-end training of channel pruning is essentially like a flood control system. There suppose to be rich information of the input distribution, and in two ways, much of the original input information is lost along the way of CNN inference, and the useful part — that is supposed to be preserved by the network inference — should be label sensitive. Conventional CNN has one way to reduce information: transforming feature maps (non-invertible) via forward propagation. Our approach introduces the other way: block information at each channel by forcing its output being constant using ISTA.
|
| 131 |
+
|
| 132 |
+
ISTA. Despite the gap between Lasso and sparsity in the non-convex settings, we found that ISTA (Beck & Teboulle, 2009) is still a useful sparse promoting method. But we just need to use it more carefully. Specifically, we adopt ISTA in the updates of $\gamma \mathbf { s }$ . The basic idea is to project the parameter at every step of gradient descent to a potentially more sparse one subject to a proxy problem: let $l$ denote the training loss of interest, at the $( t + 1 )$ -th step, we set
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\gamma _ { t + 1 } = \operatorname* { m i n } _ { \gamma } \frac { 1 } { \mu _ { t } } \| \gamma - \gamma _ { t } + \mu _ { t } \nabla _ { \gamma } l _ { t } \| ^ { 2 } + \lambda \| \gamma \| _ { 1 } \mathrm { ~ , ~ }
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\nabla _ { \gamma } l _ { t }$ is the derivative with respect to $\gamma$ computed at step $t$ , $\mu _ { t }$ is the learning rate, $\lambda$ is the penalty. In the stochastic learning, $\nabla _ { \gamma } l _ { t }$ is estimated from a mini-batch at each step. Eq. (1) has closed form solution as
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\gamma _ { t + 1 } = \mathrm { p r o x } _ { \mu _ { t } \lambda } \bigl ( \gamma _ { t } - \mu _ { t } \nabla _ { \gamma } l _ { t } \bigr ) ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $\mathrm { p r o x } _ { \eta } ( x ) = \operatorname* { m a x } \{ | x | - \eta , 0 \} \cdot \mathrm { s g n } ( x )$ . The ISTA method essentially serves as a “flood control system” in our end-to-end learning, where the functionality of each $\gamma$ is like that of a dam. When $\gamma$ is zero, the information flood is totally blocked, while $\gamma \neq 0$ , the same amount of information is passed through in form of geometric quantities whose magnitudes are proportional to $\gamma$ .
|
| 145 |
+
|
| 146 |
+
Scaling effect. One can also see that if $\gamma$ is scaled by $\alpha$ meanwhile $W ^ { l + 1 }$ is scaled by $1 / \alpha$ , that is,
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\gamma : = \alpha \gamma , \qquad W ^ { l + 1 } : = \frac { 1 } { \alpha } W ^ { l + 1 }
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
the output $x ^ { l + 2 }$ is unchanged for the same input $x ^ { l }$ . Despite not changing the output, scaling of $\gamma$ and $W ^ { l + 1 }$ also scales the gradients $\nabla _ { \gamma } l$ and $\nabla _ { W ^ { l + 1 } } l$ by $1 / \alpha$ and $\alpha$ , respectively. As we observed, the parameter dynamics of gradient learning with ISTA depends on the scaling factor $\alpha$ if one decides to choose it other than 1.0. Intuitively, if $\alpha$ is large, the optimization of $\bar { W } ^ { l + 1 }$ is progressed much slower than that of $\gamma$ .
|
| 153 |
+
|
| 154 |
+
# 4.2 THE ALGORITHM
|
| 155 |
+
|
| 156 |
+
We describe our algorithm below. The following method applies to both training from scratch or re-training from a pre-trained model. Given a training loss $l$ , a convolutional neural net $\mathcal { N }$ , and hyper-parameters $\rho , \alpha , \mu _ { 0 }$ , our method proceeds as follows:
|
| 157 |
+
|
| 158 |
+
1. Computation of sparse penalty for each layer. Compute the memory cost per channel for each layer denoted by $\setminus { l }$ and set the ISTA penalty for layer $l$ to $\rho \lambda ^ { l }$ . Here
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\lambda ^ { l } = \frac { 1 } { I _ { w } ^ { i } \cdot I _ { h } ^ { i } } \left[ k _ { w } ^ { l } \cdot k _ { h } ^ { l } \cdot c ^ { l - 1 } + \sum _ { l ^ { \prime } \in \mathcal { T } ( l ) } k _ { w } ^ { l ^ { \prime } } \cdot k _ { h } ^ { l ^ { \prime } } \cdot c ^ { l ^ { \prime } } + I _ { w } ^ { l } \cdot I _ { h } ^ { l } \right] ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where
|
| 165 |
+
|
| 166 |
+
• $I _ { w } ^ { i } \cdot I _ { h } ^ { i }$ is the size of input image of the neural network.
|
| 167 |
+
• $k _ { w } ^ { l } \cdot k _ { h } ^ { l }$ is the kernel size of the convolution at layer $l$ . Likewise, $k _ { w } ^ { l ^ { \prime } } \cdot k _ { h } ^ { l ^ { \prime } }$ is the kernel size of subsequent convolution at layer $l ^ { \prime }$ .
|
| 168 |
+
• $\tau ( l )$ represents the set of the subsequent convolutional layers of layer $l$
|
| 169 |
+
• $c ^ { l - 1 }$ denotes the channel size of the previous layer, which the $l$ -th convolution operates over; and $c ^ { l ^ { \prime } }$ denotes the channel size of one subsequent layer $l ^ { \prime }$ .
|
| 170 |
+
• $I _ { w } ^ { l } \cdot I _ { h } ^ { l }$ is the image size of the feature map at layer $l$ .
|
| 171 |
+
|
| 172 |
+
2. $\gamma { = } W$ rescaling trick. For layers whose channels are going to get reduced, scale all $\gamma ^ { l } \mathbf { s }$ i n batch normalizations by $\alpha$ meanwhile scale weights in their subsequent convolutions by $1 / \alpha$ .
|
| 173 |
+
|
| 174 |
+
3. End-to-End training with ISTA on $\gamma$ . Train $\mathcal { N }$ by the regular SGD, with the exception that $\gamma ^ { l } \mathbf { s }$ are updated by ISTA, where the initial learning rate is $\mu _ { 0 }$ . Train $\mathcal { N }$ until the loss $l$ plateaus, the total sparsity of $\gamma ^ { l } \mathbf { s }$ converges, and Lasso $\textstyle { \dot { \rho } } \sum _ { l } \lambda ^ { l } \| \gamma ^ { l } \| _ { 1 }$ converges.
|
| 175 |
+
4. Post-process to remove constant channels. Prune channels in layer $l$ whose elements in $\gamma ^ { l }$ are zero and output the pruned model $\widetilde { \mathcal { N } }$ by absorbing all constant channels into subsequent layers (as described in the earlier section.).
|
| 176 |
+
5. $\gamma { = } W$ rescaling trick. For $\gamma ^ { l } \mathbf { s }$ and weights in $\widetilde { \mathcal { N } }$ which were scaled in Step 2 before training, scale them by $1 / \alpha$ and $\alpha$ respectively (scaling back).
|
| 177 |
+
6. Fine-tune $\widetilde { \mathcal { N } }$ using regular stochastic gradient learning.
|
| 178 |
+
|
| 179 |
+
Remark that choosing a proper $\alpha$ as used in Steps 2 and 5 is necessary for using a large $\mu _ { t } \cdot \rho$ in ISTA, which makes the sparsification progress of $\gamma ^ { l } \mathbf { s }$ faster.
|
| 180 |
+
|
| 181 |
+
# 4.3 GUIDELINES FOR TUNING HYPER-PARAMETERS
|
| 182 |
+
|
| 183 |
+
We summarize the sensitivity of hyper-parameters and their impacts for optimization below:
|
| 184 |
+
|
| 185 |
+
• $\mu$ (learning rate): larger $\mu$ leads to fewer iterations for convergence and faster progress of sparsity. But if if $\mu$ too large, the SGD approach wouldn’t converge. • $\rho$ (sparse penalty): larger $\rho$ leads to more sparse model at convergence. If trained with a very large $\rho$ , all channels will be eventually pruned.
|
| 186 |
+
|
| 187 |
+
• $\alpha$ (rescaling): we use $\alpha$ other than 1. only for pretrained models, we typically choose $\alpha$ from $\{ 0 . 0 0 1 , 0 . 0 1 , 0 . 1 , 1 \}$ and smaller $\alpha$ warms up the progress of sparsity.
|
| 188 |
+
|
| 189 |
+
We recommend the following parameter tuning strategy. First, check the cross-entropy loss and the regularization loss, select $\rho$ such that these two quantities are comparable at the beginning. Second, choose a reasonable learning rate. Third, if the model is pretrained, check the average magnitude of $\gamma \mathbf { s }$ in the network, choose $\alpha$ such that the magnitude of rescaled $\gamma ^ { l }$ is around $1 0 0 \bar { \mu } \lambda ^ { l } \rho$ . We found as long as one choose those parameters in the right range of magnitudes, the optimization progress is enough robust. Again one can monitor the mentioned three quantities during the training and terminate the iterations when all three quantities plateaus.
|
| 190 |
+
|
| 191 |
+
There are several patterns we found during experiments that may suggest the parameter tuning has not been successful. If during the first few epochs the Lasso-based regularization loss keeps decreasing linearly while the sparsity of $\gamma \mathbf { s }$ stays near zero, one may decrease $\alpha$ and restart. If during the first few epochs the sparsity of $\gamma \mathbf { s }$ quickly raise up to $100 \%$ , one may decrease $\rho$ and restart. If during the first few epochs the cross-entropy loss keeps at or increases dramatically to a non-informative level, one may decrease $\mu$ or $\rho$ and restart.
|
| 192 |
+
|
| 193 |
+
# 5 EXPERIMENTS
|
| 194 |
+
|
| 195 |
+
# 5.1 CIFAR-10 EXPERIMENT
|
| 196 |
+
|
| 197 |
+
We experiment with the standard image classification benchmark CIFAR-10 with two different network architectures: ConvNet and ResNet-20 (He et al., 2016). We resize images to $3 2 \times 3 2$ and zero-pad them to $4 0 \times 4 0$ . We pre-process the padded images by randomly cropping with size $3 2 \times 3 2$ , randomly flipping, randomly adjusting brightness and contrast, and standardizing them such that their pixel values have zero mean and one variance.
|
| 198 |
+
|
| 199 |
+
ConvNet For reducing the channels in ConvNet, we are interested in studying whether one can easily convert a over-parameterized network into a compact one. We start with a standard 4-layer convolutional neural network whose network attributes are specified in Table 1. We use a fixed learning rate $\mu _ { t } = 0 . 0 1$ , scaling parameter $\alpha = 1 . 0$ , and set batch size to 125.
|
| 200 |
+
|
| 201 |
+
Model A is trained from scratch using the base model with an initial warm-up $\rho ~ = ~ 0 . 0 0 0 2$ for $3 0 \mathrm { k }$ steps, and then is trained by raising up $\rho$ to 0.001. After the termination criterion are met, we prune the channels of the base model to generate a smaller network called model A. We evaluate the classification performance of model A with the running exponential average of its parameters. It is found that the test accuracy of model A is even better than the base model. Next, we start from the pre-trained model A to create model B by raising $\rho$ up to 0.002. We end up with a smaller network called model B, which is about $1 \%$ worse than model A, but saves about one third parameters. Likewise, we start from the pre-trained model B to create model C. The detailed statistics and its pruned channel size are reported in Table 1. We also train a reference ConvNet from scratch whose channel sizes are 32-64-64-128 with totally 224,008 parameters and test accuracy being $8 6 . 3 \%$ . The referenced model is not as good as Model B, which has smaller number of parameters and higher accuracy.
|
| 202 |
+
|
| 203 |
+
We have two major observations from the experiment: (1) When the base network is overparameterized, our approach not only significantly reduces the number of channels of the base model but also improves its generalization performance on the test set. (2) Performance degradation seems unavoidable when the channels in a network are saturated, and our approach gives satisfactory tradeoff between test accuracy and model efficiency.
|
| 204 |
+
|
| 205 |
+
ResNet-20 We also want to verify our second observation with the state-of-art models. We choose the popular ResNet-20 as our base model for the CIFAR-10 benchmark, whose test accuracy is $92 \%$ . We focus on pruning the channels in the residual modules in ResNet-20, which has 9 convolutions in total. As detailed in Table 2, model A is trained from scratch using ResNet-20’s network structure as its base model. We use a warm-up $\rho = 0 . 0 0 1$ for 30k steps and then train with $\rho = 0 . 0 0 5$ . We are able to remove $37 \%$ parameters from ResNet-20 with only about 1 percent accuracy loss. Likewise, Model B is created from model A with a higher penalty $\rho = 0 . 0 1$ .
|
| 206 |
+
|
| 207 |
+
Table 1: Comparisons between different pruned networks and the base network.
|
| 208 |
+
|
| 209 |
+
<table><tr><td colspan="4">base</td><td>model A</td><td>model B</td><td></td><td>model C</td></tr><tr><td>layer</td><td>output</td><td>kernel</td><td>channel</td><td>channel</td><td>channel</td><td></td><td>channel</td></tr><tr><td>conv1</td><td>32 × 32</td><td>5×5</td><td>96</td><td>53</td><td>41</td><td></td><td>31</td></tr><tr><td>pool1</td><td>16 ×16</td><td>3×3</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>conv2</td><td>16 ×16</td><td>5×5</td><td>192</td><td>86</td><td></td><td>64</td><td>52</td></tr><tr><td>pool2</td><td>8×8</td><td>3×3</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>conv3</td><td>8×8</td><td>3×3</td><td>192</td><td>67</td><td></td><td>52</td><td>40</td></tr><tr><td>pool4</td><td>4×4</td><td>3×3</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>fc</td><td>1×1</td><td>4×4</td><td>384</td><td>128</td><td>128</td><td></td><td>127</td></tr><tr><td>p</td><td></td><td></td><td></td><td></td><td>0.001</td><td>0.002</td><td>0.008</td></tr><tr><td>param. size</td><td></td><td></td><td>1,986,760</td><td>309,655</td><td></td><td>207,583</td><td>144,935</td></tr><tr><td>test accuracy (%)</td><td></td><td></td><td>89.0</td><td>89.5</td><td></td><td>87.6</td><td>86.0</td></tr></table>
|
| 210 |
+
|
| 211 |
+
Table 2: Comparisons between ResNet-20 and its two pruned versions. The last columns are the number of channels of each residual modules after pruning.
|
| 212 |
+
|
| 213 |
+
<table><tr><td></td><td>group - block</td><td>1-1</td><td>1-2</td><td>1-3</td><td>2-1</td><td>2-2</td><td>2-3</td><td>3-1</td><td>3-2</td><td>3-3</td></tr><tr><td>ResNet-20</td><td>channels param size.= 281,304 test accuracy (%) = 92.0</td><td>16</td><td>16</td><td>16</td><td>32</td><td>32</td><td>32</td><td>64</td><td>64</td><td>64</td></tr><tr><td>model A</td><td>channels param size. = 176,596 test accuracy (%) = 90.9</td><td>12</td><td>6</td><td>11</td><td>32</td><td>28</td><td>28</td><td>47</td><td></td><td>3425</td></tr><tr><td>model B</td><td>channels param size.= 90,504 test accuracy (%) = 88.8</td><td>8</td><td>2</td><td>今</td><td></td><td>271816</td><td></td><td>25</td><td>9</td><td>8</td></tr></table>
|
| 214 |
+
|
| 215 |
+
# 5.2 ILSVRC2012 EXPERIMENT
|
| 216 |
+
|
| 217 |
+
We experiment our approach with the pre-trained ResNet-101 on ILSVRC2012 image classification dataset (He et al., 2016). ResNet-101 is one of the state-of-the-art network architecture in ImageNet Challenge. We follow the standard pipeline to pre-process images to $2 2 4 \times 2 2 4$ for training ResNets. We adopt the pre-trained TensorFlow ResNet-101 model whose single crop error rate is $2 3 . 6 \%$ with about $4 . 4 7 \times 1 0 ^ { 7 }$ parameters.2 We set the scaling parameter $\alpha = 0 . 0 1$ , the initial learning rate $\mu _ { t } = 0 . 0 0 1$ , the sparsity penalty $\rho = 0 . 1$ , and the batch $\mathrm { s i z e } = 1 2 8$ (across 4 GPUs). The learning rate is decayed every four epochs with rate 0.86. We create two pruned models from the different iterations of training ResNet-101: one has $2 . 3 6 \times 1 0 ^ { 7 }$ parameters and the other has $1 . 7 3 \times 1 0 ^ { 7 }$ parameters. We then fine-tune these two models using the standard way for training ResNet-101, and report their error rates. The Top-5 error rate increases of both models are less than $0 . 5 \%$ . The Top-1 error rates are summarized in Table 3. To our knowledge, only a few works have reported their performance on this very large-scale benchmark w.r.t. the Top-1 errors. We compare our approach with some recent works in terms of model parameter size, flops, and error rates. As shown in Table 3, our model v2 has achieved a compression ratio more than 2.5 while maintaining more than $1 \%$ lower error rates than that of other state-of-the-art models at comparable size of parameters.
|
| 218 |
+
|
| 219 |
+
In the first experiment (CIFAR-10), we train the network from scratch and allocate enough steps for both $\gamma$ and $W$ adjusting their own scales. Thus, initialization of an improper scale of $\gamma { - } W$ is not really an issue given we optimize with enough steps. But for the pre-trained models which were originally optimized without any constraints of $\gamma$ , the $\gamma \mathbf { s }$ scales are often unanticipated. It actually takes as many steps as that of training from scratch for $\gamma$ to warm up. By adopting the rescaling trick setting $\alpha$ to a smaller value, we are able to skip the warm-up stage and quick start to sparsify $\gamma \mathbf { s }$ . For example, it might take more than a hundred epoch to train ResNet-101, but it only takes about 5-10 epochs to complete the pruning and a few more epochs to fine-tune.
|
| 220 |
+
|
| 221 |
+
<table><tr><td>network</td><td>param size.</td><td>fops</td><td>error (%)</td><td>ratio</td></tr><tr><td>resnet-50 pruned (Huang & Wang,2017)</td><td>~1.65×107</td><td>3.03×109</td><td>~26.8</td><td>66%</td></tr><tr><td>resnet-101 pruned (v2,ours)</td><td>1.73 ×107</td><td>3.69×109</td><td>25.44</td><td>39%</td></tr><tr><td>resnet-34 pruned (Li et al., 2017)</td><td>1.93 ×107</td><td>2.76 ×109</td><td>27.8</td><td>89%</td></tr><tr><td>resnet-34</td><td>2.16 ×107</td><td>3.64×109</td><td>26.8</td><td>1</td></tr><tr><td>resnet-101 pruned (v1, ours)</td><td>2.36×107</td><td>4.47 ×109</td><td>24.73</td><td>53%</td></tr><tr><td>resnet-50</td><td>2.5×107</td><td>4.08 ×109</td><td>24.8</td><td>1</td></tr><tr><td>resnet-101</td><td>4.47 × 107</td><td>7.8×109</td><td>23.6</td><td>1</td></tr></table>
|
| 222 |
+
|
| 223 |
+
Table 3: Attributes of different versions of ResNet and their single crop errors on ILSVRC2012 benchmark. The last column means the parameter size of pruned model vs. the base model.
|
| 224 |
+
|
| 225 |
+
# 5.3 IMAGE FOREGROUND-BACKGROUND SEGMENTATION EXPERIMENT
|
| 226 |
+
|
| 227 |
+
As we have discussed about the two major observations in Section 5.1, a more appealing scenario is to apply our approach in pruning channels of over-parameterized model. It often happens when one adopts a pre-trained network on a large task (such as ImageNet classification) and fine-tunes the model to a different and smaller task (Molchanov et al., 2017). In this case, one might expect that some channels that have been useful in the first pre-training task are not quite contributing to the outputs of the second task.
|
| 228 |
+
|
| 229 |
+
We describe an image segmentation experiment whose neural network model is composed from an inception-like network branch and a densenet network branch. The entire network takes a $2 2 4 \times 2 2 4$ image and outputs binary mask at the same size. The inception branch is mainly used for locating the foreground objects while the densenet network branch is used to refine the boundaries around the segmented objects. This model was originally trained on multiple datasets.
|
| 230 |
+
|
| 231 |
+
In our experiment, we attempt to prune channels in both the inception branch and densenet branch. We set $\alpha = 0 . 0 1$ , $\rho = 0 . 5$ , $\bar { \mu _ { t } } = \bar { 2 } \times 1 0 ^ { - 5 }$ , and batch size $= 2 4$ . We train the pre-trained base model until all termination criterion are met, and build the pruned model for fine-tuning. The pruned model saves $86 \%$ parameters and $81 \%$ flops of the base model. We also compare the fine-tuned pruned model with the pre-trained base model across different test benchmark. Mean IOU is used as the evaluation metric.3 It shows that pruned model actually improves over the base model on four of the five test datasets with about $2 \% \sim 5 \%$ , while it performs worse than the base model on the most challenged dataset DUT-Omron, whose foregrounds might contain multiple objects.
|
| 232 |
+
|
| 233 |
+
Table 4: mIOU reported on different test datasets for the base model and the pruned model.
|
| 234 |
+
|
| 235 |
+
<table><tr><td></td><td>base model</td><td>pruned model</td></tr><tr><td>test dataset (#images)</td><td>mIOU</td><td>mIOU</td></tr><tr><td>MSRA10K (Liu et al., 2011) (2,500)</td><td>83.4%</td><td>85.5%</td></tr><tr><td>DUT-Omron (Yang et al., 2013) (1,292)</td><td>83.2%</td><td>79.1%</td></tr><tr><td>Adobe Flickr-portrait (Shen et al., 20i6) (150)</td><td>88.6%</td><td>93.3%</td></tr><tr><td>Adobe Flickr-hp (Shen et al., 2016) (300)</td><td>84.5%</td><td>89.5%</td></tr><tr><td>COCO-person (Lin et al.,2014) (50)</td><td>84.1%</td><td>87.5%</td></tr><tr><td>param.size</td><td>1.02 ×107</td><td>1.41 × 106</td></tr><tr><td>flops</td><td>5.68 ×109</td><td>1.08 × 109</td></tr></table>
|
| 236 |
+
|
| 237 |
+
# 6 CONCLUSIONS
|
| 238 |
+
|
| 239 |
+
We proposed a model pruning technique that focuses on simplifying the computation graph of a deep convolutional neural network. Our approach adopts ISTA to update the $\gamma$ parameter in batch normalization operator embedded in each convolution. To accelerate the progress of model pruning, we use a $\gamma { - } W$ rescaling trick before and after stochastic training. Our method cleverly avoids some possible numerical difficulties such as mentioned in other regularization-based related work, hence is easier to apply for practitioners. We empirically validated our method through several benchmarks and showed its usefulness and competitiveness in building compact CNN models.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Jose M Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In Advances in Neural Information Processing Systems, pp. 2270–2278, 2016.
|
| 244 |
+
|
| 245 |
+
Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Structured pruning of deep convolutional neural networks. ACM Journal on Emerging Technologies in Computing Systems (JETC), 13(3):32, 2017.
|
| 246 |
+
|
| 247 |
+
Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009.
|
| 248 |
+
|
| 249 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Proceedings of International Conference on Machine Learning, 2017.
|
| 250 |
+
|
| 251 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems, pp. 1135–1143, 2015.
|
| 252 |
+
|
| 253 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in Neural Information Processing Systems, pp. 164–171, 1993.
|
| 254 |
+
|
| 255 |
+
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.
|
| 256 |
+
|
| 257 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of International Conference on Computer Vision, 2017.
|
| 258 |
+
|
| 259 |
+
Zehao Huang and Naiyan Wang. Data-driven sparse structure selection for deep neural networks. arXiv preprint arXiv:1707.01213, 2017.
|
| 260 |
+
|
| 261 |
+
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.
|
| 262 |
+
|
| 263 |
+
Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2554–2564, 2016.
|
| 264 |
+
|
| 265 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in Neural Information Processing Systems, pp. 598–605, 1990.
|
| 266 |
+
|
| 267 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In International Conference on Learning Representations, 2017.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
Tie Liu, Zejian Yuan, Jian Sun, Jingdong Wang, Nanning Zheng, Xiaoou Tang, and Heung-Yeung Shum. Learning to detect a salient object. IEEE Transactions on Pattern analysis and machine intelligence, 33(2): 353–367, 2011.
|
| 272 |
+
|
| 273 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. arXiv preprint arXiv:1708.06519, 2017.
|
| 274 |
+
|
| 275 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient transfer learning. In International Conference on Learning Representations, 2017.
|
| 276 |
+
|
| 277 |
+
Xiaoyong Shen, Aaron Hertzmann, Jiaya Jia, Sylvain Paris, Brian Price, Eli Shechtman, and Ian Sachs. Automatic portrait segmentation for image stylization. In Computer Graphics Forum, volume 35, pp. 93–102. Wiley Online Library, 2016.
|
| 278 |
+
|
| 279 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 280 |
+
|
| 281 |
+
Chuan Yang, Lihe Zhang, Huchuan Lu, Xiang Ruan, and Ming-Hsuan Yang. Saliency detection via graphbased manifold ranking. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3166–3173, 2013.
|
| 282 |
+
|
| 283 |
+
Xiangyu Zhang, Jianhua Zou, Kaiming He, and Jian Sun. Accelerating very deep convolutional networks for classification and detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(10): 1943–1955, 2016.
|
| 284 |
+
|
| 285 |
+
Hao Zhou, Jose M Alvarez, and Fatih Porikli. Less is more: Towards compact cnns. In European Conference on Computer Vision, pp. 662–677. Springer, 2016.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 1: Visualization of the number of pruned channels at each convolution in the inception branch. Colored regions represents the number of channels kept. The height of each bar represents the size of feature map, and the width of each bar represents the size of channels. It is observed that most of channels in the bottom layers are kept while most of channels in the top layers are pruned.
|
md/train/HJGwcKclx/HJGwcKclx.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SOFT WEIGHT-SHARING FOR NEURAL NETWORK COMPRESSION
|
| 2 |
+
|
| 3 |
+
Karen Ullrich University of Amsterdam karen.ullrich@uva.nl
|
| 4 |
+
|
| 5 |
+
Max Welling
|
| 6 |
+
University of Amsterdam
|
| 7 |
+
Canadian Institute for Advanced Research (CIFAR)
|
| 8 |
+
welling.max@gmail.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
The success of deep learning in numerous application domains created the desire to run and train them on mobile devices. This however, conflicts with their computationally, memory and energy intense nature, leading to a growing interest in compression. Recent work by Han et al. (2015a) propose a pipeline that involves retraining, pruning and quantization of neural network weights, obtaining state-of-the-art compression rates. In this paper, we show that competitive compression rates can be achieved by using a version of ”soft weight-sharing” (Nowlan & Hinton, 1992). Our method achieves both quantization and pruning in one simple (re-)training procedure. This point of view also exposes the relation between compression and the minimum description length (MDL) principle.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
”Bigger is better” is the ruling maxim in deep learning land. Deep neural nets with billions of parameters are no longer an exception. Networks of such size are unfortunately not practical for mobile, on-device applications which face strong limitations with respect to memory and energy consumption. Compressing neural networks could not only improve memory and energy consumption, but also lead to less network bandwidth, faster processing and better privacy. It has been shown that large networks are heavily over-parametrized and can be compressed by approximately two orders of magnitude without significant loss of accuracy. Apparently, over-parametrization is beneficial for optimization, but not necessary for accurate prediction. This observation has opened the door for a number of highly successful compression algorithms, which either train the network from scratch (Hinton et al., 2015; Iandola et al., 2016; Courbariaux & Bengio, 2016; Courbariaux et al., 2016) or apply compression post-optimization (Han et al., 2015b;a; Guo et al., 2016; Chen et al., 2015; Wen et al., 2016).
|
| 17 |
+
|
| 18 |
+
It has been long known that compression is directly related to (variational) Bayesian inference and the minimum description principle (Hinton & Van Camp, 1993). One can show that good compression can be achieved by encoding the parameters of a model using a good prior and specifying the parameters up to an uncertainty given, optimally, by the posterior distribution. An ingenious bitsback argument can then be used to get a refund for using these noisy weights. A number of papers have appeared that encode the weights of a neural network with limited precision (say 8 bits per weight), effectively cashing in on this ”bits-back” argument (Gupta et al., 2015; Courbariaux et al., 2014; Venkatesh et al., 2016). Some authors go so far of arguing that even a single bit per weight can be used without much loss of accuracy (Courbariaux et al., 2015; Courbariaux & Bengio, 2016).
|
| 19 |
+
|
| 20 |
+
In this work we follow a different but related direction, namely to learn the prior that we use to encode the parameters. In Bayesian statistics this is known as empirical Bayes. To encourage compression of the weights to $K$ clusters, we fit a mixture of Gaussians prior model over the weights. This idea originates from the nineties, known as soft weight-sharing (Nowlan & Hinton, 1992) where it was used to regularize a neural network. Here our primary goal is network compression, but as was shown in Hinton & Van Camp (1993) these two objectives are almost perfectly aligned. By fitting the mixture components alongside the weights, the weights tend to concentrate very tightly around a number of cluster components, while the cluster centers optimize themselves to give the network high predictive accuracy. Compression is achieved because we only need to encode $K$ cluster means (in full precision) in addition to the assignment of each weight to one of these $J$ values (using $\log ( J )$ bits per weight). We find that competitive compression rates can be achieved by this simple idea.
|
| 21 |
+
|
| 22 |
+
# 2 MDL VIEW ON VARIATIONAL LEARNING
|
| 23 |
+
|
| 24 |
+
Model compression was first discussed in the context of information theory. The minimum description length (MDL) principle identifies the best hypothesis to be the one that best compresses the data. More specifically, it minimizes the cost to describe the model (complexity cost $\mathcal { L } ^ { C }$ ) and the misfit between model and data (error cost $\mathcal { L } ^ { E }$ ) (Rissanen, 1978; 1986). It has been shown that variational learning can be reinterpreted as an MDL problem (Wallace, 1990; Hinton & Van Camp, 1993; Honkela & Valpola, 2004; Graves, 2011). In particular, given data $\mathcal D = \left\{ \mathbf X = \{ \mathbf x _ { n } \} _ { n = 1 } ^ { N } , \mathbf T = \{ \mathbf t _ { n } \} _ { n = 1 } ^ { N } \right\}$ , a set of parameters $\mathbf { w } = \{ w _ { i } \} _ { i = 1 } ^ { I }$ that describes the model and an approximation $q ( \mathbf { w } )$ of the posterior $p ( \mathbf { w } | \mathcal { D } )$ , the variational lower bound, also known as negative variational free energy, $\mathcal { L } ( q ( \mathbf { w } ) , \mathbf { w } )$ can be decomposed in terms of error and complexity losses
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
{ \mathcal { L } } ( q ( \mathbf { w } ) , \mathbf { w } ) = - \mathbb { E } _ { q ( \mathbf { w } ) } \left[ \log \left( { \frac { p ( { \mathcal { D } } | \mathbf { w } ) p ( \mathbf { w } ) } { q ( \mathbf { w } ) } } \right) \right] = \underbrace { \mathbb { E } _ { q ( \mathbf { w } ) } \left[ - \log p ( { \mathcal { D } } | \mathbf { w } ) \right] } _ { { \mathcal { L } } ^ { E } } + \underbrace { \mathrm { K L } ( q ( \mathbf { w } ) | | p ( \mathbf { w } ) ) } _ { { \mathcal { L } } ^ { C } }
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
where $p ( \mathbf { w } )$ is the prior over $\mathbf { w }$ and $p ( \mathcal { D } | \mathbf { w } )$ is the model likelihood. According to Shannon’s source coding theorem, $\mathring { \mathcal { L } } ^ { E }$ lower bounds the expected amount of information needed to communicate the targets $\mathbf { T }$ , given the receiver knows the inputs $\mathbf { X }$ and the model w. The functional form of the likelihood term is conditioned by the target distribution. For example, in case of regression the predictions of the model are assumed be normally distributed around the targets $\mathbf { T }$ .
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
p ( \mathcal { D } | \mathbf { w } ) = p ( \mathbf { T } | \mathbf { X } , \mathbf { w } ) = \prod _ { n = 1 } ^ { N } \mathcal { N } ( \mathbf { t } _ { n } | \mathbf { x } _ { n } , \mathbf { w } )
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
where $\mathcal { N } ( \mathbf { t } _ { n } , \mathbf { x } _ { n } , \mathbf { w } )$ is a normal distribution. Another typical example is classification where the conditional distribution of targets given data is assumed to be Bernoulli distributed1. These assumptions eventually lead to the well known error functions, namely cross-entropy error and squared error for classification and regression, respectively.
|
| 37 |
+
|
| 38 |
+
Before however we can communicate the data we first seek to communicate the model. Similarly to $\mathcal { L } ^ { E } , \mathcal { L } ^ { C }$ is a lower bound for transmitting the model. More specifically, if sender and receiver agree on a prior, $\mathcal { L } ^ { C }$ is the expected cost of communicating the parameters w. This cost is again twofold,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\mathrm { K L } ( q ( \mathbf { w } ) | | p ( \mathbf { w } ) ) = \mathbb { E } _ { q ( \mathbf { w } ) } \left[ - \log p ( \mathbf { w } ) \right] - H ( q ( \mathbf { w } ) )
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $H ( \cdot )$ denotes the entropy. In Wallace (1990) and Hinton & Van Camp (1993) it was shown that noisy encoding of the weights can be beneficial due to the bits-back argument if the uncertainty does not harm the error loss too much. The number of bits to get refunded by an uncertain weight distribution $q ( \mathbf { w } )$ is given by its entropy. Further, it can be shown that the optimal distribution for $q ( \mathbf { w } )$ is the Bayesian posterior distribution. While bits-back is proven to be an optimal coding scheme (Honkela $\&$ Valpola, 2004), it is often not practical in real world settings. A practical way to cash in on noisy weights (or bits-back) is to only encode a weight value up to a limited number of bits. To see this, assume a factorized variational posteriors $q ( \mathbf { w } ) { \bar { \mathbf { \Gamma } } } = \prod q ( w _ { i } )$ . Each posterior $q ( w _ { i } )$ is associated with a Dirac distribution up to machine precision, for example, a Gaussian distribution with variance $\sigma$ , for small values of $\sigma$ . This implies that we formally incur a very small refund per weight,
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
H ( q ( \mathbf { w } ) ) = - \intop _ { \Omega } q ( \mathbf { w } ) \log q ( \mathbf { w } ) \mathrm { d } \mathbf { w } = - \intop _ { \mathbb { R } ^ { I } } \mathcal { N } ( \mathbf { w } | \mathbf { 0 } , \sigma \mathbf { I } ) \log \mathcal { N } ( \mathbf { w } | \mathbf { 0 } , \sigma \mathbf { I } ) = [ \log ( 2 \pi e \sigma ^ { 2 } ) ] ^ { I } .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Note that the more coarse the quantization of weights the more compressible the model. The bitsback scheme makes three assumptions: (i) weights are being transmitted independently, (ii) weights are independent of each other (no mutual information), and (iii) the receiver knows the prior. Han et al. (2015a) show that one can successfully exploit (i) and (ii) by using a form of arithmetic coding (Witten et al., 1987). In particular, they employ range coding schemes such as the Sparse Matrix Format (discussed in Appendix A). This is beneficial because the weight distribution has low entropy. Note that the cost of transmitting the prior should be negligible. Thus a factorized prior with different parameters for each factor is not desirable.
|
| 51 |
+
|
| 52 |
+
The main objective of this work is to find a suitable prior for optimizing the cross-entropy between a delta posterior $q ( \mathbf { w } )$ and the prior $p ( \mathbf { w } )$ while at the same time keeping a practical coding scheme in mind. Recall that the cross entropy is a lower bound on the average number of bits required to encode the weights of the neural network (given infinite precision). Following Nowlan & Hinton (1992) we will model the prior $p ( \mathbf { w } )$ as a mixture of Gaussians,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
p ( \mathbf { w } ) = \prod _ { i = 1 } ^ { I } \sum _ { j = 0 } ^ { J } \pi _ { j } \mathcal { N } ( w _ { i } | \mu _ { j } , \sigma _ { j } ^ { 2 } ) .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
We learn the mixture parameters $\mu _ { j } , \sigma _ { j } ,$ $\pi _ { j }$ via maximum likelihood simultaneously with the network weights. This is equivalent to an empirical Bayes approach in Bayesian statistics. For stateof-the-art compression schemes pruning plays a major role. By enforcing an arbitrary “zero” component to have fixed $\mu _ { 0 } = 0$ location and $\pi _ { 0 }$ to be close to 1, a desired weight pruning rate can be enforced. In this scenario $\pi _ { 0 }$ may be fixed or trainable. In the latter case a Beta distribution as hyperprior might be helpful. The approach naturally encourages quantization because in order to optimize the cross-entropy the weights will cluster tightly around the cluster means, while the cluster means themselves move to some optimal location driven by $\mathcal { L } ^ { E }$ . The effect might even be so strong that it is beneficial to have a Gamma hyper-prior on the variances of the mixture components to prevent the components from collapsing. Furthermore, note that, mixture components merge when there is not enough pressure from the error loss to keep them separated because weights are attracted by means and means are attracted by weights hence means also attract each other. In that way the network learns how many quantization intervals are necessary. We demonstrate that behaviour in Figure 3.
|
| 59 |
+
|
| 60 |
+
# 3 RELATED WORK
|
| 61 |
+
|
| 62 |
+
There has been a recent surge in interest in compression in the deep neural network community. Denil et al. (2013) showed that by predicting parameters of neural networks there is great redundancy in the amount of parameters being used. This suggests that pruning, originally introduced to reduce structure in neural networks and hence improve generalization, can be applied to the problem of compression and speed-up (LeCun et al., 1989). In fact, (Han et al., 2015b; Guo et al., 2016) show that neural network survive severe weight pruning (up to $9 9 \%$ ) without significant loss of accuracy. A variational version is is proposed by Molchanov et al. (2017), the authors learn the dropout rate for each weight in the network separately. Some parameters will effectively be pruned when the dropout rate is very high. In an approach slightly orthogonal to weight pruning, (Wen et al., 2016) applied structural regularization to prune entire sets of weights from the neural network. Such extreme weight pruning can lead to entire structures being obsolete, which for the case of convolutional filters, can greatly speed up prediction. Most importantly for compression, however, is that in conjunction with Compressed Sparse Column (CSC) format, weight pruning is a highly effective way to store and transfer weights. In Appendix A we discuss CSC format in more detail.
|
| 63 |
+
|
| 64 |
+
Reducing the bit size per stored weight is another approach to model compression. For example, reducing 32 bit floats to 1 bit leads to a $3 2 \times$ storage improvement. Gong et al. (2014) proposed and experimented with a number of quantization approaches: binary quantization, $\mathbf { k }$ -means quantization, product quantization and residual quantization. Other work finds optimal fixed points (Lin et al., 2015), applies hashing (Chen et al., 2015) or minimizes the estimation error (Wu et al., 2015). Merolla et al. (2016) demonstrates that neural networks are robust against certain amounts of low precision; indeed several groups have exploited this and showed that decreasing the weight encoding precision has little to no effect on the accuracy loss (Gupta et al., 2015; Courbariaux et al., 2014; Venkatesh et al., 2016). Pushing the idea of extreme quantization, (Courbariaux et al., 2015) and Courbariaux & Bengio (2016) trained networks from scratch that use only 1bit weights with floating point gradients; to achieve competitive results, however, they require many more of these weights.
|
| 65 |
+
|
| 66 |
+
Han et al. (2015a) elaborate on combining these ideas. They introduce an multi-step algorithm that compresses CNNS up to $4 9 \times$ . First, weights are pruned (giving $9 - 1 3 \times$ compression); second they quantize the weights (increasing compression to $2 7 - 3 1 \times )$ ; and last, they apply Huffman Encoding (giving a final compression of $3 5 - 4 9 \times )$ . The quantization step is trainable in that after each weight is assigned to a cluster centroid, the centroids get trained with respect to the original loss function. Note that this approach has several restrictions: the number of weights set to zero is fixed after the pruning step, as is the assignment of a weight to a given cluster in the second step. Our approach overcomes all these restrictions.
|
| 67 |
+
|
| 68 |
+
A final approach to compressing information is to apply low rank matrix decomposition. First introduced by (Denton et al., 2014) and Jaderberg et al. (2014), and elaborated on by using low rank filters (Ioannou et al., 2015), low rank regularization (Tai et al., 2015) or combining low rank decomposition with sparsity (Liu et al., 2015).
|
| 69 |
+
|
| 70 |
+
# 4 METHOD
|
| 71 |
+
|
| 72 |
+
This section presents the procedure of network compression as applied in the experiment section. A summary can be found in Algorithm 1.
|
| 73 |
+
|
| 74 |
+
# 4.1 GENERAL SET-UP
|
| 75 |
+
|
| 76 |
+
We retrain pre-trained neural networks with soft weight-sharing and factorized Dirac posteriors. Hence we optimize
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l } & { \mathcal { L } ( \mathbf { w } , \{ \mu _ { j } , \sigma _ { j } , \pi _ { j } \} _ { j = 0 } ^ { J } ) = \mathcal { L } ^ { E } + \tau \mathcal { L } ^ { C } } \\ & { \qquad = - \log p ( \mathbf { T } | \mathbf { X } , \mathbf { w } ) - \tau \log p ( \mathbf { w } , \{ \mu _ { j } , \sigma _ { j } , \pi _ { j } \} _ { j = 0 } ^ { J } ) , } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
via gradient descent, specifically using Adam (Kingma & Ba, 2014). The KL divergence reduces to the prior because the entropy term does not depend on any trainable parameters. Note that, similar to (Nowlan & Hinton, 1992) we weigh the log-prior contribution to the gradient by a factor of $\tau = 0 . 0 0 5$ . In the process of retraining the weights, the variances, means, and mixing proportions of all but one component are learned. For one component, we fix $\mu _ { j = 0 } = 0$ and $\pi _ { j = 0 } = 0 . 9 9 9$ . Alternatively we can train $\pi _ { j = 0 }$ as well but restrict it by a Beta distribution hyper-prior. Our Gaussian MM prior is initialized with $2 ^ { 4 } + 1 = 1 7$ components. We initialize the learning rate for the weights and means, log-variances and log-mixing proportions separately. The weights should be trained with approximately the same learning rate used for pre-training. The remaining learning rates are set to $5 \cdot 1 0 ^ { - 4 }$ . Note that this is a very sensitive parameter. The Gaussian mixtures will collapse very fast as long as the error loss does not object. However if it collapses too fast weights might be left behind, thus it is important to set the learning rate such that the mixture does collapse too soon. If the learning rate is too small the mixture will converge too slowly. Another option to keep the mixture components from collapsing is to apply an Inverse-Gamma hyperprior on the mixture variances.
|
| 83 |
+
|
| 84 |
+
# 4.2 INITIALIZATION OF MIXTURE MODEL COMPONENTS
|
| 85 |
+
|
| 86 |
+
In principle, we follow the method proposed by Nowlan & Hinton (1992). We distribute the means of the 16 non-fixed components evenly over the range of the pre-trained weights. The variances will be initialized such that each Gaussian has significant probability mass in its region. A good orientation for setting a good initial variance is weight decay rate the original network has been trained on. The trainable mixing proportions are initialized evenly $\pi _ { j } = ( 1 - \pi _ { j = 0 } ) / J$ . We also experimented with other approaches such as distributing the means such that each component assumes an equal amount of probability. We did not observe any significant improvement over the simpler initialization procedure.
|
| 87 |
+
|
| 88 |
+
# 4.3 POST-PROCESSING
|
| 89 |
+
|
| 90 |
+
After re-training we set each weight to the mean of the component that takes most responsibility for it i.e. we quantize the weights. Before quantizing, however, there might be redundant components
|
| 91 |
+
|
| 92 |
+
as explained in section 2. To eliminate those we follow Adhikari & Hollmen (2012) by computing ´ the KL divergence between all components. For a KL divergence smaller than a threshold, we merge two components as follows
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\pi _ { \mathrm { n e w } } = \pi _ { i } + \pi _ { j } , \mu _ { \mathrm { n e w } } = \frac { \pi _ { i } \mu _ { i } + \pi _ { j } \mu _ { j } } { \pi _ { i } + \pi _ { j } } , \sigma _ { \mathrm { n e w } } ^ { 2 } = \frac { \pi _ { i } \sigma _ { i } ^ { 2 } + \pi _ { j } \sigma _ { j } ^ { 2 } } { \pi _ { i } + \pi _ { j } }
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
for two components with indices $i$ and $j$ .
|
| 99 |
+
|
| 100 |
+
Finally, for practical compression we use the storage format used in Han et al. (2015a) (see Appendix A).
|
| 101 |
+
|
| 102 |
+
Algorithm 1 Soft weight-sharing for compression, our proposed algorithm for neural network model compression. It is divided into two main steps: network re-training and post-processing.
|
| 103 |
+
|
| 104 |
+
Require: $\tau \mathrm { s e t }$ the trade-off between error and complexity loss
|
| 105 |
+
Require: $\Theta $ set parameters for gradient decent scheme such as learning rate or momentum
|
| 106 |
+
Require: $\alpha , \beta \gets { \sf s e t }$ gamma hyper-prior parameter (optional) $\mathbf { w } \gets$ initialize network weights with pre-trained network weights $\theta = \{ \mu _ { j } , \sigma _ { j } , \pi _ { j } \} _ { j = 1 } ^ { J } $ initialize mixture parameters (see Sec. 4.2) while $\mathbf { w } , \theta$ not converged do $\mathbf { w } , \theta \gets \nabla _ { \mathbf { w } , \theta } \mathcal { L } ^ { E } + \overline { { \tau } } \mathcal { L } ^ { C }$ update $\mathbf { w }$ and $\theta$ with the gradient decent scheme of choice end while $\mathbf { w } \gets \mathop { \mathrm { a r g m a x } } _ { \mu _ { k } } \frac { \pi _ { k } \mathcal { N } ( \mathbf { w } | \mu _ { k } , \sigma _ { k } ) } { \sum \pi _ { j } \mathcal { N } ( \mathbf { w } | \mu _ { j } , \sigma _ { j } ) }$ compute final weight by setting it to the mean that takes most responsibility (for details see Sec. 4.3)
|
| 107 |
+
|
| 108 |
+
# 5 MODELS
|
| 109 |
+
|
| 110 |
+
We test our compression procedure on two neural network models used in previous work we compare against in our experiments:
|
| 111 |
+
|
| 112 |
+
(a) LeNet-300-100 an MNIST model described in LeCun et al. (1998). As no pre-trained model is available, we train our own, resulting in an error rate of $1 . 8 9 \%$ .
|
| 113 |
+
(b) LeNet-5-Caffe a modified version of the LeNet-5 MNIST model in LeCun et al. (1998). The model specification can be downloaded from the Caffe MNIST tutorial page 2. As no pre-trained model is available, we train our own, resulting in an error rate of $0 . 8 8 \%$ .
|
| 114 |
+
(c) ResNets have been invented by He et al. (2015) and further developed by He et al. (2016) and Zagoruyko & Komodakis (2016). We choose a model version of the latter authors. In accordance with their notation, we choose a network with depth 16, width $k = 4$ and no dropout. This model has $2 . 7 \mathbf { M }$ parameters. In our experiments, we follow the authors by using only light augmentation, i.e., horizontal flips and random shifts by up to 4 pixels. Furthermore the data is normalized. The authors report error rates of $5 . 0 2 \%$ and $2 4 . 0 3 \%$ for CIFAR-10 and CIFAR-100 respectively. By reimplementing their model we trained models that achieve errors $6 . 4 8 \%$ and $2 8 . 2 3 \%$ .
|
| 115 |
+
|
| 116 |
+
# 6 EXPERIMENTS
|
| 117 |
+
|
| 118 |
+
# 6.1 INITIAL EXPERIMENT
|
| 119 |
+
|
| 120 |
+
First, we run our algorithm without any hyper-priors, an experiment on LeNet-300-100. In Figure 1 we visualise the original distribution over weights, the final distribution over weight and how each weight changed its position in the training process. After retraining, the distribution is sharply peaked around zero. Note that with our procedure the optimization process automatically determines how many weights per layer are pruned. Specifically in this experiment, $96 \%$ of the first layer (235K parameter), $90 \%$ of the second (30K) and only $18 \%$ of the final layer (10K) are pruned. From observations of this and other experiments, we conclude that the amount of pruned weights depends mainly on the number of parameters in the layer rather than its position or type (convolutional or fully connected).
|
| 121 |
+
|
| 122 |
+
Evaluating the model reveals a compression rate of 64.2. The accuracy of the model does not drop significantly from 0.9811 to 0.9806. However, we do observe that the mixture components eventually collapse, i.e., the variances go to zero. This makes the prior inflexible and the optimization can easily get stuck because the prior is accumulating probability mass around the mixture means. For a weight, escaping from those high probability plateaus is impossible. This motivates the use hyper-priors such as an Inverse-Gamma prior on the variances to essentially lower bound them.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 1: On top we show the distribution of a pretrained network. On the right the same distribution after retraining. The change in value of each weight is illustrated by a scatter plot.
|
| 126 |
+
|
| 127 |
+
6.2 HYPER-PARAMETER TUNING USING BAYESIAN OPTIMIZATION
|
| 128 |
+
|
| 129 |
+
The proposed procedure offers various freedoms: there are many hyper-parameters to optimize, one may use hyper-priors as motivated in the previous section or even go as far as using other distributions as mixture components.
|
| 130 |
+
|
| 131 |
+
To cope with the variety of choices, we optimize 13 hyper-parameters using the Bayesian optimization tool Spearmint Snoek et al. (2012). These include the learning rates of the weight and mixing components, the number of components, and $\tau$ . Furthermore, we assume an Inverse-Gamma prior over the variances separately for the zero component and the other components and a Beta prior over the zero mixing components.
|
| 132 |
+
|
| 133 |
+
In these experiments, we optimize re-training hyperparameters for LeNet-300-100 and LeNet-5- Caffe. Due to computational restrictions, we set the number of training epochs to 40 (previously 100), knowing that this may lead to solutions that have not fully converged. Spearmint acts on an objective that balances accuracy loss vs compression rate. The accuracy loss in this case is measured over the training data. The results are shown in Figure 2. In the illustration we use the accuracy loss as given by the test data. The best results predicted by our spearmint objective are colored in dark blue. Note that we achieve competitive results in this experiment despite the restricted optimization time of 40 epochs, i.e. 18K updates.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 2: We show the results of optimizing hyper-parameters with spearmint. Specifically, we plot the accuracy loss of a re-trained network against the compression rate. Each point represents one hyper-parameter setting. The guesses of the optimizer improve over time. We also present the results of other methods for comparison. Left: LeNet-300-100 Right: LeNet-5-Caffe.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3: Illustration of our mixture model compression procedure on LeNet-5-Caffe. Left: Dynamics of Gaussian mixture components during the learning procedure. Initially there are $1 7 \mathrm { \ c o m { - } }$ ponents, including the zero component. During learning components are absorbed into other components, resulting in roughly 6 significant components. Right: A scatter plot of initial versus final weights, along with the Gaussian components’ uncertainties. The initial weight distribution is roughly one broad Gaussian, whereas the final weight distribution matches closely the final, learned prior which has become very peaked, resulting in good quantization properties.
|
| 140 |
+
|
| 141 |
+
The conclusions from this experiment are a bit unclear, on the one hand we do achieve state-ofthe-art results for LeNet-5-Caffe, on the other hand there seems to be little connection between the parameter settings of best results. One wonders if a 13 dimensional parameter space can be searched efficiently with the amount of runs we were conducting. It may be more reasonable to get more inside in the optimization process and tune parameters according to those.
|
| 142 |
+
|
| 143 |
+
# 6.3 COMPRESSION RESULTS
|
| 144 |
+
|
| 145 |
+
We compare our compression scheme with Han et al. (2015a) and Guo et al. (2016) in Table 1. The results on MNIST networks are very promising. We achieve state-of-the-art compression rates in both examples. We can furthermore show results for a light version of ResNet with 2.7M parameters to illustrate that our method does scale to modern architectures. We used more components (64)
|
| 146 |
+
|
| 147 |
+
Table 1: Compression Results. We compare methods based on the post-processing error (we also indicate the starting error), the accuracy loss $\Delta$ , the number of non zero weights $| \mathbf { W } _ { \neq 0 } |$ and the final compression rate CR based on the method proposed by Han et al. (2015a).
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>Method</td><td>Top-1 Error[%]</td><td>△[%]</td><td>[W|[106]</td><td>W0 [%] W</td><td>CR</td></tr><tr><td rowspan="3">LeNet-300-100</td><td>Han et al. (2015a)</td><td>1.64 → 1.58</td><td>0.06</td><td>0.2</td><td>8.0</td><td>40</td></tr><tr><td>Guo et al. (2016)</td><td>2.28→ 1.99</td><td>-0.29</td><td></td><td>1.8</td><td>56</td></tr><tr><td>Ours</td><td>1.89 →1.94</td><td>-0.05</td><td></td><td>4.3</td><td>64</td></tr><tr><td rowspan="3">LeNet-5-Caffe</td><td>Han et al. (2015a)</td><td>0.80 →0.74</td><td>-0.06</td><td>0.4</td><td>8.0</td><td>39</td></tr><tr><td>Guo et al. (2016)</td><td>0.91 →0.91</td><td>0.00</td><td></td><td>0.9</td><td>108</td></tr><tr><td>Ours</td><td>0.88 →0.97</td><td>0.09</td><td></td><td>0.5</td><td>162</td></tr><tr><td>ResNet (light)</td><td>Ours</td><td>6.48 →8.50</td><td>2.02</td><td>2.7</td><td>6.6</td><td>45</td></tr></table>
|
| 150 |
+
|
| 151 |
+
here to cover the large regime of weights. However, for large networks such as VGG with 138M parameters the algorithm is too slow to get usable results. We propose a solution for this problem in Appendix C; however, we do not have any experimental results yet.
|
| 152 |
+
|
| 153 |
+
# 7 DISCUSSION AND FUTURE WORK
|
| 154 |
+
|
| 155 |
+
In this work we revived a simple and principled regularization method based on soft weight-sharing and applied it directly to the problem of model compression. On the one hand we showed that we can optimize the MDL complexity lower bound, while on the other hand we showed that our method works well in practice when being applied to different models. A short-coming of the method at the moment is its computational cost and the ease of implementation. For the first, we provide a proposal that will be tested in future work. The latter is an open question at the moment. Note that our method—since it is optimizing the lower bound directly—will most likely also work when applied to other storage formats, such as those proposed originally by Hinton & Van Camp (1993). In the future we would like to extend beyond Dirac posteriors as done in Graves (2011) by extending the weight sharing prior to more general priors. For example, from a compression point of view, we could learn to prune entire structures from the network by placing Bernoulli priors over structures such as convolutional filters or ResNet units. Furthermore, it could be interesting to train models from scratch or in a student-teacher setting.
|
| 156 |
+
|
| 157 |
+
# ACKNOWLEDGEMENTS
|
| 158 |
+
|
| 159 |
+
We would like to thank Louis Smit, Christos Louizos, Thomas Kipf, Rianne van den Berg and Peter O’Connor for helpful discussions on the paper and the public code3.
|
| 160 |
+
|
| 161 |
+
This research has been supported by Google.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Prem Raj Adhikari and Jaakko Hollmen. Multiresolution mixture modeling using merging of mix- ´ ture components. 2012.
|
| 166 |
+
|
| 167 |
+
Christopher M Bishop. Pattern recognition. Machine Learning, 2006.
|
| 168 |
+
|
| 169 |
+
Wenlin Chen, James T Wilson, Stephen Tyree, Kilian Q Weinberger, and Yixin Chen. Compressing convolutional neural networks. arXiv preprint arXiv:1506.04449, 2015.
|
| 170 |
+
|
| 171 |
+
Matthieu Courbariaux and Yoshua Bengio. Binarynet: Training deep neural networks with weights and activations constrained to $+ 1$ or $- 1$ . arXiv preprint arXiv:1602.02830, 2016.
|
| 172 |
+
|
| 173 |
+
Matthieu Courbariaux, Jean-Pierre David, and Yoshua Bengio. Training deep neural networks with low precision multiplications. arXiv preprint arXiv:1412.7024, 2014.
|
| 174 |
+
|
| 175 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015.
|
| 176 |
+
|
| 177 |
+
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training neural networks with weights and activations constrained to $+ 1$ or $- 1$ 2016.
|
| 178 |
+
|
| 179 |
+
Misha Denil, Babak Shakibi, Laurent Dinh, Nando de Freitas, et al. Predicting parameters in deep learning. In Advances in Neural Information Processing Systems, pp. 2148–2156, 2013.
|
| 180 |
+
|
| 181 |
+
Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in Neural Information Processing Systems, pp. 1269–1277, 2014.
|
| 182 |
+
|
| 183 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
|
| 184 |
+
|
| 185 |
+
Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pp. 2348–2356, 2011.
|
| 186 |
+
|
| 187 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, pp. 1379–1387, 2016.
|
| 188 |
+
|
| 189 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. CoRR, abs/1502.02551, 392, 2015.
|
| 190 |
+
|
| 191 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. CoRR, abs/1510.00149, 2, 2015a.
|
| 192 |
+
|
| 193 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural networks. In Advances in Neural Information Processing Systems, pp. 1135– 1143, 2015b.
|
| 194 |
+
|
| 195 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 196 |
+
|
| 197 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. arXiv preprint arXiv:1603.05027, 2016.
|
| 198 |
+
|
| 199 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 200 |
+
|
| 201 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 202 |
+
|
| 203 |
+
Antti Honkela and Harri Valpola. Variational learning and bits-back coding: an informationtheoretic view to bayesian learning. IEEE Transactions on Neural Networks, 15(4):800–810, 2004.
|
| 204 |
+
|
| 205 |
+
Forrest N Iandola, Matthew W Moskewicz, Khalid Ashraf, Song Han, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and¡ 1mb model size. arXiv preprint arXiv:1602.07360, 2016.
|
| 206 |
+
|
| 207 |
+
Yani Ioannou, Duncan Robertson, Jamie Shotton, Roberto Cipolla, and Antonio Criminisi. Training cnns with low-rank filters for efficient image classification. arXiv preprint arXiv:1511.06744, 2015.
|
| 208 |
+
|
| 209 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
|
| 210 |
+
|
| 211 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 212 |
+
|
| 213 |
+
Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In NIPs, volume 2, pp. 598–605, 1989.
|
| 214 |
+
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.
|
| 215 |
+
Darryl D Lin, Sachin S Talathi, and V Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. arXiv preprint arXiv:1511.06393, 2015.
|
| 216 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015.
|
| 217 |
+
Paul Merolla, Rathinakumar Appuswamy, John Arthur, Steve K Esser, and Dharmendra Modha. Deep neural networks are robust to weight binarization and other non-linear distortions. arXiv preprint arXiv:1606.01981, 2016.
|
| 218 |
+
Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. arXiv preprint arXiv:1701.05369, 2017.
|
| 219 |
+
Steven J Nowlan and Geoffrey E Hinton. Simplifying neural networks by soft weight-sharing. Neural computation, 4(4):473–493, 1992.
|
| 220 |
+
Jorma Rissanen. Modeling by shortest data description. Automatica, 14(5):465–471, 1978.
|
| 221 |
+
Jorma Rissanen. Stochastic complexity and modeling. The annals of statistics, pp. 1080–1100, 1986.
|
| 222 |
+
Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pp. 400–407, 1951.
|
| 223 |
+
Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In Advances in neural information processing systems, pp. 2951–2959, 2012.
|
| 224 |
+
Cheng Tai, Tong Xiao, Xiaogang Wang, et al. Convolutional neural networks with low-rank regularization. arXiv preprint arXiv:1511.06067, 2015.
|
| 225 |
+
Ganesh Venkatesh, Eriko Nurvitadhi, and Debbie Marr. Accelerating deep convolutional networks using low-precision and sparsity. arXiv preprint arXiv:1610.00324, 2016.
|
| 226 |
+
Chris S Wallace. Classification by minimum-message-length inference. In International Conference on Computing and Information, pp. 72–81. Springer, 1990.
|
| 227 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances In Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 228 |
+
Ian H Witten, Radford M Neal, and John G Cleary. Arithmetic coding for data compression. Communications of the ACM, 30(6):520–540, 1987.
|
| 229 |
+
Jiaxiang Wu, Cong Leng, Yuhang Wang, Qinghao Hu, and Jian Cheng. Quantized convolutional neural networks for mobile devices. arXiv preprint arXiv:1512.06473, 2015.
|
| 230 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 231 |
+
|
| 232 |
+
# APPENDIX
|
| 233 |
+
|
| 234 |
+
# A REVIEW OF STATE-OF-THE-ART NEURAL NETWORK COMPRESSION
|
| 235 |
+
|
| 236 |
+
We apply the compression scheme proposed by Han et al. (2015b;a) that highly optimizes the storage utilized by the weights. First of all, the authors store the weights in regular compressed sparse-row (CSR) format. Instead of storing $| W ^ { ( l ) } |$ parameters with a bit length of (commonly) $p _ { \mathrm { o r i g } } = 3 2 $ bit, CSR format stores three vectors (A, IR, IC).
|
| 237 |
+
|
| 238 |
+
• A stores all non-zero entries. It is thus of size $| W ^ { ( l ) } | _ { \neq 0 } \times p _ { \mathrm { o r i g } }$ , where $\vert W ^ { ( l ) } \vert _ { \neq 0 }$ is the number of non-zero entries in $W ^ { ( l ) }$ .
|
| 239 |
+
• IR Is defined recursively: $\mathrm { { I R } _ { 0 } ~ = ~ 0 }$ , $\mathrm { I R } _ { k } \ = \mathrm { I R } _ { k - 1 } +$ (number of non-zero entries in the $( k - 1 )$ -th row of $W ^ { ( l ) }$ ). It got $K + 1$ entries each of size $p _ { \mathrm { o r i g } }$ .
|
| 240 |
+
• IC contains the column index in $W ^ { ( l ) }$ of each element of A. The size is hence, $| W ^ { ( l ) } | _ { \neq 0 } \times$ $p _ { \mathrm { o r i g } }$ .
|
| 241 |
+
|
| 242 |
+
An example shall illustrate the format, let
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
W ^ { ( l ) } = \left( \begin{array} { c c c c } { { 0 } } & { { 0 } } & { { 0 } } & { { 1 } } \\ { { 0 } } & { { 2 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { 0 } } & { { 0 } } \\ { { 2 } } & { { 5 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { 0 } } & { { 1 } } \end{array} \right)
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
than
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\begin{array} { r } { \mathbf { A } = [ 1 , 2 , 2 , 5 , 1 ] } \\ { \mathbf { I R } = [ 0 , 1 , 2 , 2 , 4 , 5 ] } \\ { \mathbf { I C } = [ 3 , 1 , 0 , 1 , 3 ] } \end{array}
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
The compression rate achieved by applying the CSC format naively is
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
r _ { p } = \frac { | W ^ { ( l ) } | } { 2 | W ^ { ( l ) } | \neq 0 + ( K + 1 ) }
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
However, this result can be significantly improved by optimizing each of the three arrays.
|
| 261 |
+
|
| 262 |
+
# A.1 STORING THE INDEX ARRAY IR
|
| 263 |
+
|
| 264 |
+
To optimize IR, note that the biggest number in IR is $\vert W ^ { ( l ) } \vert _ { \neq 0 }$ . This number will be much smaller than $2 ^ { p _ { \mathrm { o r i g } } }$ . Thus one could try to find $p \in \mathbf { Z } _ { + }$ such that $| W ^ { ( l ) } | _ { \neq 0 } < 2 ^ { p _ { \mathrm { p r u n } } }$ . A codebook would not be necessary. Thus instead of storing $( K + 1 )$ values with $p _ { \mathrm { o r i g } }$ , we store them with $p _ { \mathrm { p r u n } }$ depth.
|
| 265 |
+
|
| 266 |
+
# A.2 STORING THE INDEX ARRAY IC
|
| 267 |
+
|
| 268 |
+
Instead of storing the indexes, we store the differences between indexes. Thus there is a smaller range of values being used. We further shrink the range of utilized values by filling A with zeros whenever the distance between two non-zero weights extends the span of $2 _ { \mathrm { p r u n } } ^ { p ^ { \mathrm { - } } }$ . Han et al. (2015a) propose $\mathrm { p } = 5$ for fully connected layers and $\mathtt { p } = 8$ for convolutional layers. An illustration of the process can is shown in Fig. 4. Furthermore, the indexes will be compressed Hoffman encoding.
|
| 269 |
+
|
| 270 |
+
# A.3 STORING THE WEIGHT ARRAY A
|
| 271 |
+
|
| 272 |
+
In order to minimize the storage occupied by A. We quantize the values of A. Storing indexes in A and a consecutive codebook. Indexing can be improved further by again applying Huffman encoding.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 4: Illustration of the process described in A.2. IC is represented by relative indexes(diff). If the a relative index is larger than $8 ( = 2 ^ { \bar { 3 } } )$ , A will be filled with an additional zero. Figure from Han et al. (2015a).
|
| 276 |
+
|
| 277 |
+
# B CONFIGURING THE HYPER-PRIORS
|
| 278 |
+
|
| 279 |
+
# B.1 GAMMA DISTRIBUTION
|
| 280 |
+
|
| 281 |
+
The Gamma distribution is the conjugate prior for the precision of a univariate Gaussian distribution.
|
| 282 |
+
It is defined for positive random variables $\lambda > 0$ .
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\Gamma ( \lambda | \alpha , \beta ) = \frac { \beta ^ { \alpha } } { \Gamma ( \alpha ) } \lambda ^ { \alpha - 1 } e ^ { - \beta \lambda }
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
For our purposes it is best characterised by its mode $\lambda ^ { * } = \frac { \alpha - 1 } { \beta }$ and its variance $\operatorname { v a r } _ { \gamma } = { \frac { \alpha } { \beta ^ { 2 } } }$ I n our experiments we set the desired variance of the mixture components to 0.05. This corresponds to $\lambda ^ { * } \stackrel { - } { = } 1 / ( 0 . 0 5 ) ^ { 2 } = 4 0 0$ . We show the effect of different choices for the variance of the Gamma distribution in Figure 5.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 5: Gamma distribution with $\lambda ^ { * } ~ = ~ 1 0 0$ . $\alpha$ and $\beta$ correspond to different choices for the variance of the distribution.
|
| 292 |
+
|
| 293 |
+
# B.2 BETA DISTRIBUTION
|
| 294 |
+
|
| 295 |
+
The Beta distribution is the conjugate prior for the Bernoulli distribution, thus is often used to represent the probability for a binary event. It is defined for some random variable $\pi _ { j = 0 } \in [ 0 , 1 ]$
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\mathcal { B } ( \pi _ { j = 0 } | \alpha , \beta ) = \frac { \Gamma ( \alpha + \beta ) } { \Gamma ( \alpha ) \Gamma ( \beta ) } ( \pi _ { j = 0 } ) ^ { \alpha - 1 } ( 1 - \pi _ { j = 0 } ) ^ { \beta - 1 }
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
with $\alpha , \beta \ > \ 0$ . $\alpha$ and $\beta$ can be interpreted as the effective number of observations prior to an experiment, of $\pi _ { j = 0 } = 1$ and $\pi _ { j = 0 } = 0$ , respectively. In the literature, $\alpha + \beta$ is defined as the pseudo-count. The higher the pseudo-count the stronger the prior. In Figure 6, we show the Beta distribution at constant mode $\pi _ { j = 0 } ^ { * } = \frac { \alpha - 1 } { \alpha + \beta - 2 } = 0 . 9$ . Note, that, the beta distribution is a special case of the Dirichlet distribution in a different problem setting it might be better to rely on this distribution to control all $\pi _ { j }$ .
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 6: Beta distribution with $\pi _ { j = 0 } ^ { * } = 0 . 9$ . $\alpha$ and $\beta$ correspond to different choices for the pseudocount.
|
| 305 |
+
|
| 306 |
+
# C SCALABILITY
|
| 307 |
+
|
| 308 |
+
Neural Networks are usually trained with a form of batch gradient decent (GD) algorithm. These methods fall into the umbrella of stochastic optimization (Robbins $\&$ Monro, 1951). Here the model parameters $\mathbf { W }$ are updated iteratively. At each iteration $t$ , a set of $B$ data instances is used to compute a noisy approximation of the posterior derivative with respect to $\mathbf { W }$ given all data instances $N$ .
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\nabla _ { \mathbf { W } } \log p ( \mathbf { W } | \mathcal { D } ) = \frac { N } { B } \sum _ { n = 1 } ^ { B } \nabla _ { \mathbf { W } } \log p ( \mathbf { t } _ { n } | \mathbf { x } _ { n } , \mathbf { w } ) + \sum _ { i = 1 } ^ { I } \nabla _ { \mathbf { W } } \log p ( w _ { i } )
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
This gradient approximation can subsequently be used in various update schemes such as simple GD.
|
| 315 |
+
|
| 316 |
+
For large models estimating the prior gradient can be an expensive operation. This is why we propose to apply similar measures for the gradient estimation of the prior as we did for the likelihood term. To do so, we sample $\mathbf { K }$ weights randomly. The noisy approximation of the posterior derivative is
|
| 317 |
+
|
| 318 |
+
now:
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\nabla _ { \mathbf { W } } \log p ( \mathbf { W } | \mathcal { D } ) = \frac { N } { B } \sum _ { n = 1 } ^ { B } \nabla _ { \mathbf { w } } \log p ( \mathbf { t } _ { n } | \mathbf { x } _ { n } , \mathbf { w } ) + \frac { I } { K } \sum _ { i = 1 } ^ { K } \nabla _ { \mathbf { w } } \log p ( w _ { i } )
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
# D FILTER VISUALISATION
|
| 325 |
+
|
| 326 |
+
In Figure D we show the pre-trained and compressed filters for the first and second layers of LeNet5-Caffe. For some of the feature maps from layer 2 seem to be redundant hence the almost empty columns. In Figure D we show the pre-trained and compressed filters for the first and second layers of LeNet-300-100.
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 7: Convolution filters from LeNet-5-Caffe. Left: Pre-trained filters. Right: Compressed filters. The top filters are the 20 first layer convolution weights; the bottom filters are the 20 by 50 convolution weights of the second layer.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 8: Feature filters for LeNet-300-100. Left: Pre-trained filters. Right: Compressed filters.
|
| 333 |
+
|
| 334 |
+

|
md/train/HJgLZR4KvH/HJgLZR4KvH.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DYNAMICS-AWARE UNSUPERVISED DISCOVERY OF SKILLS
|
| 2 |
+
|
| 3 |
+
Archit Sharma∗, Shixiang Gu, Sergey Levine, Vikash Kumar, Karol Hausman Google Brain {architsh,shanegu,slevine,vikashplus,karolhausman}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Conventionally, model-based reinforcement learning (MBRL) aims to learn a global model for the dynamics of the environment. A good model can potentially enable planning algorithms to generate a large variety of behaviors and solve diverse tasks. However, learning an accurate model for complex dynamical systems is difficult, and even then, the model might not generalize well outside the distribution of states on which it was trained. In this work, we combine model-based learning with model-free learning of primitives that make modelbased planning easy. To that end, we aim to answer the question: how can we discover skills whose outcomes are easy to predict? We propose an unsupervised learning algorithm, Dynamics-Aware Discovery of Skills (DADS), which simultaneously discovers predictable behaviors and learns their dynamics. Our method can leverage continuous skill spaces, theoretically, allowing us to learn infinitely many behaviors even for high-dimensional state-spaces. We demonstrate that zero-shot planning in the learned latent space significantly outperforms standard MBRL and model-free goal-conditioned RL, can handle sparsereward tasks, and substantially improves over prior hierarchical RL methods for unsupervised skill discovery. We have open-sourced our implementation at: https://github.com/google-research/dads
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: A humanoid agent discovers diverse locomotion primitives without any reward using DADS. We show zero-shot generalization to downstream tasks by composing the learned primitives using model predictive control, enabling the agent to follow an online sequence of goals (green markers) without any additional training.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Deep reinforcement learning (RL) enables autonomous learning of diverse and complex tasks with rich sensory inputs, temporally extended goals, and challenging dynamics, such as discrete gameplaying domains (Mnih et al., 2013; Silver et al., 2016), and continuous control domains including locomotion (Schulman et al., 2015; Heess et al., 2017) and manipulation (Rajeswaran et al., 2017; Kalashnikov et al., 2018; Gu et al., 2017). Most of the deep RL approaches learn a Q-function or a policy that are directly optimized for the training task, which limits their generalization to new scenarios. In contrast, MBRL methods (Li & Todorov, 2004; Deisenroth & Rasmussen, 2011; Watter et al., 2015) can acquire dynamics models that may be utilized to perform unseen tasks at test time. While this capability has been demonstrated in some of the recent works (Levine et al., 2016; Nagabandi et al., 2018; Chua et al., 2018b; Kurutach et al., 2018; Ha & Schmidhuber,
|
| 15 |
+
|
| 16 |
+
2018), learning an accurate global model that works for all state-action pairs can be exceedingly challenging, especially for high-dimensional system with complex and discontinuous dynamics. The problem is further exacerbated as the learned global model has limited generalization outside of the state distribution it was trained on and exploring the whole state space is generally infeasible. Can we retain the flexibility of model-based RL, while using model-free RL to acquire proficient low-level behaviors under complex dynamics?
|
| 17 |
+
|
| 18 |
+
While learning a global dynamics model that captures all the different behaviors for the entire statespace can be extremely challenging, learning a model for a specific behavior that acts only in a small part of the state-space can be much easier. For example, consider learning a model for dynamics of all gaits of a quadruped versus a model which only works for a specific gait. If we can learn many such behaviors and their corresponding dynamics, we can leverage model-predictive control to plan in the behavior space, as opposed to planning in the action space. The question then becomes: how do we acquire such behaviors, considering that behaviors could be random and unpredictable? To this end, we propose Dynamics-Aware Discovery of Skills (DADS), an unsupervised RL framework for learning low-level skills using model-free RL with the explicit aim of making model-based control easy. Skills obtained using DADS are directly optimized for predictability, providing a better representation on top of which predictive models can be learned. Crucially, the skills do not require any supervision to learn, and are acquired entirely through autonomous exploration. This means that the repertoire of skills and their predictive model are learned before the agent has been tasked with any goal or reward function. When a task is provided at test-time, the agent utilizes the previously learned skills and model to immediately perform the task without any further training.
|
| 19 |
+
|
| 20 |
+
The key contribution of our work is an unsupervised reinforcement learning algorithm, DADS, grounded in mutual-information-based exploration. We demonstrate that our objective can embed learned primitives in continuous spaces, which allows us to learn a large, diverse set of skills. Crucially, our algorithm also learns to model the dynamics of the skills, which enables the use of model-based planning algorithms for downstream tasks. We adapt the conventional model predictive control algorithms to plan in the space of primitives, and demonstrate that we can compose the learned primitives to solve downstream tasks without any additional training.
|
| 21 |
+
|
| 22 |
+
# 2 PRELIMINARIES
|
| 23 |
+
|
| 24 |
+
Mutual information can been used as an objective to encourage exploration in reinforcement learning (Houthooft et al., 2016; Mohamed & Rezende, 2015). According to its definition, ${ \mathcal { T } } ( X ; Y ) ~ { \stackrel { } { = } } ~$ $\mathcal { H } ( X ) - \mathcal { H } ( X \mid Y )$ , maximizing mutual information $\mathcal { T }$ with respect to $Y$ amounts to maximizing the entropy $\mathcal { H }$ of $X$ while minimizing the conditional entropy $\mathcal { H } ( X \mid Y )$ . In the context of RL, $X$ is usually a function of the state and $Y$ a function of actions. Maximizing this objective encourages the state entropy to be high, making the underlying policy to be exploratory. Recently, multiple works (Eysenbach et al., 2018; Gregor et al., 2016; Achiam et al., 2018) apply this idea to learn diverse skills which maximally cover the state space.
|
| 25 |
+
|
| 26 |
+
To leverage planning-based control, MBRL estimates the true dynamics of the environment by learning a model $\hat { p } ( s ^ { \prime } \mid \bar { s } , a )$ . This allows it to predict a trajectory of states $\hat { \tau } _ { H } = ( s _ { t } , \hat { s } _ { t + 1 } , \dots \hat { s } _ { t + H } )$ resulting from a sequence of actions without any additional interaction with the environment. While model-based RL methods have been demonstrated to be sample efficient compared to their modelfree counterparts, learning an effective model for the whole state-space is challenging. An openproblem in model-based RL is to incorporate temporal abstraction in model-based control, to enable high-level planning and move-away from planning at the granular level of actions.
|
| 27 |
+
|
| 28 |
+
These seemingly unrelated ideas can be combined into a single optimization scheme, where we first discover skills (and their models) without any extrinsic reward and then compose these skills to optimize for the task defined at test time using model-based planning. At train time, we assume a Markov Decision Process (MDP) $\mathcal { M } _ { 1 } \equiv ( S , \mathcal { A } , p )$ . The state space $s$ and action space $\mathcal { A }$ are assumed to be continuous, and the $\mathcal { A }$ bounded. We assume the transition dynamics $p$ to be stochastic, such that $p : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \mapsto [ 0 , \infty )$ . We learn a skill-conditioned policy $\pi ( \boldsymbol { a } \mid s , z )$ , where the skills $z$ belongs to the space $\mathcal { Z }$ , detailed in Section 3. We assume that the skills are sampled from a prior $p ( z )$ over $\mathcal { Z }$ . We simultaneously learn a skill-conditioned transition function $q ( s ^ { \prime } \mid s , z )$ , coined as skill-dynamics, which predicts the transition to the next state $s ^ { \prime }$ from the current state $s$ for the skill $z$ under the given dynamics $p$ . At test time, we assume an MDP $\mathcal { M } _ { 2 } \equiv ( \mathcal { S } , \mathcal { A } , p , r )$ , where $s , A , p$ match those defined in $\mathcal { M } _ { 1 }$ , and the reward function $r : S \times A \mapsto ( - \infty , \infty )$ . We plan in $\mathcal { Z }$ using $q ( s ^ { \prime } \mid s , z )$ to compose the learned skills $z$ for optimizing $r$ in $\mathcal { M } _ { 2 }$ , which we detail in Section 4.
|
| 29 |
+
|
| 30 |
+
# 3 DYNAMICS-AWARE DISCOVERY OF SKILLS (DADS)
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: The agent $\pi$ interacts with the environment to produce a transition $s s ^ { \prime }$ . Intrinsic reward is computed by computing the transition probability under $q$ for the current skill $z$ , compared to random samples from the prior $p ( \bar { z } )$ . The agent maximizes the intrinsic reward computed for a batch of episodes, while $q$ maximizes the log-probability of the actual transitions of $( s , z ) \to s ^ { \prime }$ .
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
We use the information theoretic paradigm of mutual information to obtain our unsupervised skill discovery algorithm. In particular, we propose to maximize the mutual information between the next state $s ^ { \prime }$ and current skill $z$ conditioned on the current state $s$ .
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \begin{array} { r } { \mathcal { T } ( s ^ { \prime } ; z \mid s ) = \mathcal { H } ( z \mid s ) - \mathcal { H } ( z \mid s ^ { \prime } , s ) } \\ { = \mathcal { H } ( s ^ { \prime } \mid s ) - \mathcal { H } ( s ^ { \prime } \mid s , z ) } \end{array} } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Mutual information in Equation 1 quantifies how much can be known about $s ^ { \prime }$ given $z$ and $s$ , or symmetrically, $z$ given the transition from $s s ^ { \prime }$ . From Equation 2, maximizing this objective corresponds to maximizing the diversity of transitions produced in the environment, that is denoted by the entropy $\mathcal { H } ( s ^ { \prime } \mid s )$ , while making $z$ informative about the next state $s ^ { \prime }$ by minimizing the entropy $\mathcal { H } ( s ^ { \prime } \mid s , z )$ . Intuitively, skills $z$ can be interpreted as abstracted action sequences which are identifiable by the transitions generated in the environment (and not just by the current state). Thus, optimizing this mutual information can be understood as encoding a diverse set of skills in the latent space $\mathcal { Z }$ , while making the transitions for a given $z \in { \mathcal { Z } }$ predictable. We use the entropydecomposition in Equation 2 to connect this objective with model-based control.
|
| 44 |
+
|
| 45 |
+
We want to optimize the our skill-conditioned controller $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ such that the latent space $z \sim p ( z )$ is maximally informative about the transitions $s s ^ { \prime }$ . Using the definition of conditional mutual information, we can rewrite Equation 2 as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
{ \mathcal { T } } ( s ^ { \prime } ; z \mid s ) = \int p ( z , s , s ^ { \prime } ) \log { \frac { p ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } } d s ^ { \prime } d s d z
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
We assume the following generative model: $p ( z , s , s ^ { \prime } ) = p ( z ) p ( s \mid z ) p ( s ^ { \prime } \mid s , z )$ , where $p ( z )$ is user specified prior over $\mathcal { Z }$ , $p ( s | z )$ denotes the stationary state-distribution induced by $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ for a skill $z$ and $p ( s ^ { \prime } \mid s , z )$ denotes the transition distribution under skill $z$ . Note, $p ( s ^ { \prime } \mid s , z ) =$ $\textstyle { \int p ( s ^ { \prime } \mid s , a ) \pi ( a \mid s , z ) d a }$ is intractable to compute because the underlying dynamics are unknown. However, we can variationally lower bound the objective as follows:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \mathbb { Z } ( s ^ { \prime } ; z \mid s ) = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { p ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] } \\ & { \phantom { = } = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { q \phi ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] + \mathbb { E } _ { s , z \sim p } \Big [ \mathcal { D } _ { K L } \big ( p ( s ^ { \prime } \mid s , z ) \mid \mid q _ { \phi } ( s ^ { \prime } \mid s , z ) \big ) \Big ] } \\ & { \phantom { = } \geq \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { q \phi ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where we have used the non-negativity of KL-divergence, that is $\mathcal { D } _ { K L } \ge 0$ . Note, skill-dynamics $q _ { \phi }$ represents the variational approximation for the transition function $p ( s ^ { \prime } \mid s , z )$ , which enables model-based control as described in Section 4. Equation 4 suggests an alternating optimization between $q _ { \phi }$ and $\pi$ , summarized in Algorithm 1. In every iteration:
|
| 58 |
+
|
| 59 |
+
(Tighten variational lower bound) We minimize $D _ { K L } \bar { ( } p ( s ^ { \prime } \mid s , z ) \parallel q _ { \phi } ( s ^ { \prime } \mid s , z ) )$ with respect to the parameters $\phi$ on $z , s \sim p$ to tighten the lower bound. For general function approximators like neural networks, we can write the gradient for $\phi$ as follows:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \nabla _ { \phi } \mathbb { E } _ { s , z } [ \mathcal { D } _ { K L } ( p ( s ^ { \prime } \mid s , z ) \mid \mid q _ { \phi } ( s ^ { \prime } \mid s , z ) ) ] = \nabla _ { \phi } \mathbb { E } _ { z , s , s ^ { \prime } } \Big [ \log \frac { p ( s ^ { \prime } \mid s , z ) } { q _ { \phi } ( s ^ { \prime } \mid s , z ) } \Big ] } \\ { = - \mathbb { E } _ { z , s , s ^ { \prime } } \Big [ \nabla _ { \phi } \log q _ { \phi } ( s ^ { \prime } \mid s , z ) \Big ] } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
which corresponds to maximizing the likelihood of the samples from $p$ under $q _ { \phi }$ (Maximize approximate lower bound) After fitting $q _ { \phi }$ , we can optimize $\pi$ to maximize $\mathbb { E } _ { z , s , s ^ { \prime } } [ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s ) ]$ . Note, this is a reinforcement-learning style optimization with a reward function $\log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s )$ . However, $\log p ( s ^ { \prime } \mid s )$ is intractable to compute, so we approximate the reward function for $\pi$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
r _ { z } ( s , a , s ^ { \prime } ) = \log \frac { q _ { \phi } ( s ^ { \prime } \mid s , z ) } { \sum _ { i = 1 } ^ { L } q _ { \phi } ( s ^ { \prime } \mid s , z _ { i } ) } + \log L , \quad z _ { i } \sim p ( z ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
The approximation is motivated as follows: $\begin{array} { r } { p ( s ^ { \prime } \mid s ) = \int p ( s ^ { \prime } \mid s , z ) p ( z | s ) d z \approx \int q _ { \phi } ( s ^ { \prime } \mid } \end{array}$ $\begin{array} { r } { s , z ) p ( z ) d z \approx \frac { 1 } { L } \sum _ { i = 1 } ^ { L } q _ { \phi } ( s ^ { \prime } \mid s , z _ { i } ) } \end{array}$ for $z _ { i } \sim p ( z )$ , where $L$ denotes the number of samples from the prior. We are using the marginal of variational approximation $q _ { \phi }$ over the prior $p ( z )$ to approximate the marginal distribution of transitions. We discuss this approximation in Appendix C. Note, the final reward function $r _ { z }$ encourages the policy $\pi$ to produce transitions that are (a) predictable under $q _ { \phi }$ (predictability) and (b) different from the transitions produced under $z _ { i } \sim p ( z )$ (diversity).
|
| 72 |
+
|
| 73 |
+
To generate samples from $p ( z , s , s ^ { \prime } )$ , we use the rollouts from the current policy $\pi$ for multiple samples $z \sim p ( z )$ in an episodic setting for a fixed horizon $T$ . We also introduce entropy regularization for $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , z )$ , which encourages the policy to discover action-sequences with similar state-transitions and to be clustered under the same skill $z$ , making the policy robust besides encouraging exploration (Haarnoja et al., 2018a). The use of entropy regularization can be justified from an information bottleneck perspective as discussed for Information Maximization algorithm in (Mohamed $\&$ Rezende, 2015). This is even more extensively discussed from the graphical model perspective in Appendix B, which connects unsupervised skill discovery and information bottleneck literature, while also revealing the temporal nature of skills $z$ . Details corresponding to implementation and hyperparameters are discussed in Appendix A.
|
| 74 |
+
|
| 75 |
+
# 4 PLANNING USING SKILL DYNAMICS
|
| 76 |
+
|
| 77 |
+
Given the learned skills $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ and their respective skill-transition dynamics $q _ { \phi } ( s ^ { \prime } \mid s , z )$ , we can perform model-based planning in the latent space $\mathcal { Z }$ to optimize for a reward $r$ that is given to the agent at test time. Note, that this essentially allows us to perform zero-shot planning given the unsupervised pre-training procedure described in Section 3.
|
| 78 |
+
|
| 79 |
+
In order to perform planning, we employ the model-predictive-control (MPC) paradigm Garcia et al. (1989), which in a standard setting generates a set of action plans $P _ { k } = ( a _ { k , 1 } , \dots a _ { k , H } ) \sim P$ for a planning horizon $H$ . The MPC plans can be generated due to the fact that the planner is able to simulate the trajectory $\hat { \tau } _ { k } = \left( s _ { k , 1 } , a _ { k , 1 } \ldots s _ { k , H + 1 } \right)$ assuming access to the transition dynamics $\hat { p } ( s ^ { \prime } \mid s , a )$ . In addition, each plan computes the reward $r ( \hat { \tau } _ { k } )$ for its trajectory according to the reward function $r$ that is provided for the test-time task. Following the MPC principle, the planner selects the best plan according to the reward function $r$ and executes its first action $a _ { 1 }$ . The planning algorithm repeats this procedure for the next state iteratively until it achieves its goal.
|
| 80 |
+
|
| 81 |
+
We use a similar strategy to design an MPC planner to exploit previously-learned skill-transition dynamics $q _ { \phi } ( s ^ { \prime } \mid s , z )$ . Note that unlike conventional model-based RL, we generate a plan $P _ { k } =$ $\left( z _ { k , 1 } , \ldots z _ { k , { H _ { P } } } \right)$ in the latent space $\mathcal { Z }$ as opposed to the action space $\mathcal { A }$ that would be used by a standard planner. Since the primitives are temporally meaningful, it is beneficial to hold a primitive for a horizon $H _ { Z } > 1$ , unlike actions which are usually held for a single step. Thus, effectively, the planning horizon for our latent space planner is $H = H _ { P } \times H _ { Z }$ , enabling longer-horizon planning using fewer primitives. Similar to the standard MPC setting, the latent space planner simulates the trajectory $\hat { \tau } _ { k } = \left( s _ { k , 1 } , z _ { k , 1 } , a _ { k , 1 } , s _ { k , 2 } , z _ { k , 2 } , a _ { k , 2 } , \ldots s _ { k , H + 1 } \right)$ and computes the reward $r ( \hat { \tau } _ { k } )$ . After a small number of trajectory samples, the planner selects the first latent action $z _ { 1 }$ of the best plan, executes it for $H _ { Z }$ steps in the environment, and the repeats the process until goal completion.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: At test time, the planner executes simulates the transitions in environment using skill-dynamics $q$ , and updates the distribution of plans according to the computed reward on the simulated trajectories. After a few updates to the plan, the first primitive is executed in the environment using the learned agent $\pi$ .
|
| 85 |
+
|
| 86 |
+
The latent planner $P$ maintains a distribution of latent plans, each of length $H _ { P }$ . Each element in the sequence represents the distribution of the primitive to be executed at that time step. For continuous spaces, each element of the sequence can be modelled using a normal distribution, $\mathcal { N } ( \mu _ { 1 } , \Sigma ) , \dots \mathcal { N } ( \mu _ { H _ { P } } , \Sigma )$ . We refine the planning distributions for $R$ steps, using $K$ samples of latent plans $P _ { k }$ , and compute the $r _ { k }$ for the simulated trajectory $\hat { \tau } _ { k }$ . The update for the parameters follows that in Model Predictive Path Integral (MPPI) controller Williams et al. (2016):
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mu _ { i } = \sum _ { k = 1 } ^ { K } \frac { \exp ( \gamma r _ { k } ) } { \sum _ { p = 1 } ^ { K } \exp ( \gamma r _ { p } ) } z _ { k , i } \quad \forall i = 1 , \ldots H _ { P }
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
While we keep the covariance matrix of the distributions fixed, it is possible to update that as well as shown in Williams et al. (2016). We show an overview of the planning algorithm in Figure 3, and provide more implementation details in Appendix A.
|
| 93 |
+
|
| 94 |
+
# 5 RELATED WORK
|
| 95 |
+
|
| 96 |
+
Central to our method is the concept of skill discovery via mutual information maximization. This principle, proposed in prior work that utilized purely model-free unsupervised RL methods (Daniel et al., 2012; Florensa et al., 2017; Eysenbach et al., 2018; Gregor et al., 2016; Warde-Farley et al., 2018; Thomas et al., 2018), aims to learn diverse skills via a discriminability objective: a good set of skills is one where it is easy to distinguish the skills from each other, which means they perform distinct tasks and cover the space of possible behaviors. Building on this prior work, we distinguish our skills based on how they modify the original uncontrolled dynamics of the system. This simultaneously encourages the skills to be both diverse and predictable. We also demonstrate that constraining the skills to be predictable makes them more amenable for hierarchical composition and thus, more useful on downstream tasks.
|
| 97 |
+
|
| 98 |
+
Another line of work that is conceptually close to our method copes with intrinsic motivation (Oudeyer & Kaplan, 2009; Oudeyer et al., 2007; Schmidhuber, 2010) which is used to drive the agent’s exploration. Examples of such works include empowerment Klyubin et al. (2005); Mohamed & Rezende (2015), count-based exploration Bellemare et al. (2016); Oh et al. (2015); Tang et al. (2017); Fu et al. (2017), information gain about agent’s dynamics Stadie et al. (2015) and forward-inverse dynamics models Pathak et al. (2017). While our method uses an informationtheoretic objective that is similar to these approaches, it is used to learn a variety of skills that can be directly used for model-based planning, which is in contrast to learning a better exploration policy for a single skill.
|
| 99 |
+
|
| 100 |
+
The skills discovered using our approach can also provide extended actions and temporal abstraction, which enable more efficient exploration for the agent to solve various tasks, reminiscent of hierarchical RL (HRL) approaches. This ranges from the classic option-critic architecture (Sutton et al., 1999; Stolle & Precup, 2002; Perkins et al., 1999) to some of the more recent work (Bacon et al., 2017; Vezhnevets et al., 2017; Nachum et al., 2018; Hausman et al., 2018). However, in contrast to end-to-end HRL approaches (Heess et al., 2016; Peng et al., 2017), we can leverage a stable, two-phase learning setup. The primitives learned through our method provide action and temporal abstraction, while planning with skill-dynamics enables hierarchical composition of these primitives, bypassing many problems of end-to-end HRL.
|
| 101 |
+
|
| 102 |
+
In the second phase of our approach, we use the learned skill-transition dynamics models to perform model-based planning - an idea that has been explored numerous times in the literature. Model-based reinforcement learning has been traditionally approached with methods that are well-suited for lowdata regimes such as Gaussian Processes (Rasmussen, 2003) showing significant data-efficiency gains over model-free approaches (Deisenroth et al., 2013; Kamthe & Deisenroth, 2017; Kocijan et al., 2004; Ko et al., 2007). More recently, due to the challenges of applying these methods to highdimensional state spaces, MBRL approaches employs Bayesian deep neural networks (Nagabandi et al., 2018; Chua et al., 2018b; Gal et al., 2016; Fu et al., 2016; Lenz et al., 2015) to learn dynamics models. In our approach, we take advantage of the deep dynamics models that are conditioned on the skill being executed, simplifying the modelling problem. In addition, the skills themselves are being learned with the objective of being predictable, further assists with the learning of the dynamics model. There also have been multiple approaches addressing the planning component of MBRL including linear controllers for local models (Levine et al., 2016; Kumar et al., 2016; Chebotar et al., 2017), uncertainty-aware (Chua et al., 2018b; Gal et al., 2016) or deterministic planners (Nagabandi et al., 2018) and stochastic optimization methods (Williams et al., 2016). The main contribution of our work lies in discovering model-based skill primitives that can be further combined by a standard model-based planner, therefore we take advantage of an existing planning approach - Model Predictive Path Integral (Williams et al., 2016) that can leverage our pre-trained setting.
|
| 103 |
+
|
| 104 |
+
# 6 EXPERIMENTS
|
| 105 |
+
|
| 106 |
+
Through our experiments, we aim to demonstrate that: (a) DADS as a general purpose skill discovery algorithm can scale to high-dimensional problems; (b) discovered skills are amenable to hierarchical composition and; (c) not only is planning in the learned latent space feasible, but it is competitive to strong baselines. In Section 6.1, we provide visualizations and qualitative analysis of the skills learned using DADS. We demonstrate in Section 6.2 and Section 6.4 that optimizing the primitives for predictability renders skills more amenable to temporal composition that can be used for Hierarchical RL.We benchmark against state-of-the-art model-based RL baseline in Section 6.3, and against goal-conditioned RL in Section 6.5.
|
| 107 |
+
|
| 108 |
+
# 6.1 QUALITATIVE ANALYSIS
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 4: Skills learned on different MuJoCo environments in the OpenAI gym. DADS can discover diverse skills without any extrinsic rewards, even for problems with high-dimensional state and action spaces.
|
| 112 |
+
|
| 113 |
+
In this section, we provide a qualitative discussion of the unsupervised skills learned using DADS. We use the MuJoCo environments (Todorov et al., 2012) from the OpenAI gym as our test-bed (Brockman et al., 2016). We find that our proposed algorithm can learn diverse skills without any reward, even in problems with high-dimensional state and actuation, as illustrated in Figure 4. DADS can discover primitives for Half-Cheetah to run forward and backward with multiple different gaits, for Ant to navigate the environment using diverse locomotion primitives and for Humanoid to walk using stable locomotion primitives with diverse gaits and direction. The videos of the discovered primitives are available at: https://sites.google.com/view/dads-skill
|
| 114 |
+
|
| 115 |
+
Qualitatively, we find the skills discovered by DADS to be predictable and stable, in line with implicit constraints of the proposed objective. While the Half-Cheetah will learn to run in both backward and forward directions, DADS will disincentivize skills which make Half-Cheetah flip owing to the reduced predictability on landing. Similarly, skills discovered for Ant rarely flip over, and tend to provide stable navigation primitives in the environment. This also incentivizes the Humanoid, which is characteristically prone to collapsing and extremely unstable by design, to discover gaits which are stable for sustainable locomotion.
|
| 116 |
+
|
| 117 |
+
One of the significant advantages of the proposed objective is that it is compatible with continuous skill spaces, which has not been shown in prior work on skill discovery (Eysenbach et al., 2018). Not only does this allow us to embed a large and diverse set of skills into a compact latent space, but also the smoothness of the learned space allows us to interpolate between behaviors generated in the environment. We demonstrate this on the Ant environment (Figure 5), where we learn two-dimensional continuous skill space with a uniform prior over $( - 1 , 1 )$ in each dimension, and compare it to a discrete skill space with a uniform prior over 20 skills. Similar to Eysenbach et al. (2018), we restrict the observation space of the skill-dynamics $q$ to the cartesian coordinates $( x , y )$ . We hereby call this the $x$ -y prior, and discuss its role in Section 6.2.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 5: (Left, Centre) X-Y traces of Ant skills and (Right) Heatmap to visualize the learned continuous skill space. Traces demonstrate that the continuous space offers far greater diversity of skills, while the heatmap demonstrates that the learned space is smooth, as the orientation of the X-Y trace varies smoothly as a function of the skill.
|
| 121 |
+
|
| 122 |
+
In Figure 5, we project the trajectories of the learned Ant skills from both discrete and continuous spaces onto the Cartesian plane. From the traces of the skills, it is clear that the continuous latent space can generate more diverse trajectories. We demonstrate in Section 6.3, that continuous primitives are more amenable to hierarchical composition and generally perform better on downstream tasks. More importantly, we observe that the learned skill space is semantically meaningful. The heatmap in Figure 5 shows the orientation of the trajectory (with respect to the $x$ -axis) as a function of the skill $z \in { \mathcal { Z } }$ , which varies smoothly as $z$ is varied, with explicit interpolations shown in Appendix D.
|
| 123 |
+
|
| 124 |
+
# 6.2 SKILL VARIANCE ANALYSIS
|
| 125 |
+
|
| 126 |
+
In an unsupervised skill learning setup, it is important to optimize the primitives to be diverse. However, we argue that diversity is not sufficient for the learned primitives to be useful for downstream tasks. Primitives must exhibit low-variance behavior, which enables long-horizon composition of the learned skills in a hierarchical setup. We analyze the variance of the $x { - } y$ trajectories in the environment, where we also benchmark the variance of the primitives learned by DIAYN (Eysenbach et al., 2018). For DIAYN, we use the $x { - } y$ prior for the skill-discriminator, which biases the discovered skills to diversify in the x-y space. This step was necessary for that baseline to obtain a competitive set of navigation skills. Figure 6 (Top-Left) demonstrates that DADS, which optimizes the primitives for predictability and diversity, yields significantly lower-variance primitives when compared to DIAYN, which only optimizes for diversity. This is starkly demonstrated in the plots of X-Y traces of skills learned in different setups. Skills learned by DADS show significant control over the trajectories generated in the environment, while skills from DIAYN exhibit high variance in the environment, which limits their utility for hierarchical control. This is further demonstrated quantitatively in Section 6.4.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6: (Top-Left) Standard deviation of Ant’s position as a function of steps in the environment, averaged over multiple skills and normalized by the norm of the position. (Top-Right to Bottom-Left Clockwise) X-Y traces of skills learned using DIAYN with $x { - } y$ prior, DADS with $x { - } y$ prior and DADS without x-y prior, where the same color represents trajectories resulting from the execution of the same skill $z$ in the environment. High variance skills from DIAYN offer limited utility for hierarchical control.
|
| 130 |
+
|
| 131 |
+
While optimizing for predictability already significantly reduces the variance of the trajectories generated by a primitive, we find that using the $x { - } y$ prior with DADS brings down the skill variance even further. For quantitative benchmarks in the next sections, we assume that the Ant skills are learned using an $x { - } y$ prior on the observation space, for both DADS and DIAYN.
|
| 132 |
+
|
| 133 |
+
# 6.3 MODEL-BASED REINFORCEMENT LEARNING
|
| 134 |
+
|
| 135 |
+
The key utility of learning a parametric model $q _ { \phi } \big ( s ^ { \prime } | s , z \big )$ is to take advantage of planning algorithms for downstream tasks, which can be extremely sample-efficient. In our setup, we can solve testtime tasks in zero-shot, that is without any learning on the downstream task. We compare with the state-of-the-art model-based RL method (Chua et al., 2018a), which learns a dynamics model parameterized as $p ( s ^ { \prime } | s , a )$ , on the task of the Ant navigating to a specified goal with a dense reward. Given a goal $g$ , reward at any position $u$ is given by $r ( \bar { u } ) = \bar { - } \| g - \bar { u } \| _ { 2 }$ . We benchmark our method against the following variants:
|
| 136 |
+
|
| 137 |
+
• Random-MBRL (rMBRL): We train the model $p ( s ^ { \prime } | s , a )$ on randomly collected trajectories, and test the zero-shot generalization of the model on a distribution of goals.
|
| 138 |
+
|
| 139 |
+
• Weak-oracle MBRL (WO-MBRL): We train the model $p ( s ^ { \prime } | s , a )$ on trajectories generated by the planner to navigate to a goal, randomly sampled in every episode. The distribution of goals during training matches the distribution at test time.
|
| 140 |
+
|
| 141 |
+
• Strong-oracle MBRL (SO-MBRL): We train the model $p ( s ^ { \prime } | s , a )$ on a trajectories generated by the planner to navigate to a specific goal, which is fixed for both training and test time.
|
| 142 |
+
|
| 143 |
+
Amongst the variants, only the rMBRL matches our assumptions of having an unsupervised taskagnostic training. Both WO-MBRL and SO-MBRL benefit from goal-directed exploration during training, a significant advantage over DADS, which only uses mutual-information-based exploration.
|
| 144 |
+
|
| 145 |
+
We use ∆ = PHt=1 −r(u)Hkgk2 a s the metric, which represents the distance to the goal $g$ averaged over the episode (with the same fixed horizon $H$ for all models and experiments), normalized by the initial distance to the goal $g$ . Therefore, lower $\Delta$ indicates better performance and $0 < \Delta \le 1$ (assuming the agent goes closer to the goal). The test set of goals is fixed for all the methods, sampled from $[ - 1 5 , 1 5 ] ^ { 2 }$ .
|
| 146 |
+
|
| 147 |
+
Figure 7 demonstrates that the zero-shot planning significantly outperforms all model-based RL baselines, despite the advantage of the baselines being trained on the test goal(s). For the experiment depicted in Figure 7 (Right), DADS has an unsupervised pre-training phase, unlike SO-MBRL which is training directly for the task. A comparison with Random-MBRL shows the significance of mutual-information-based exploration, especially with the right parameterization and priors. This experiment also demonstrates the advantage of learning a continuous space of primitives, which outperforms planning on discrete primitives.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 7: (Left) The results of the MPPI controller on skills learned using DADS-c (continuous primitives) and DADS-d (discrete primitives) significantly outperforms state-of-the-art model-based RL. (Right) Planning for a new task does not require any additional training and outperforms model-based RL being trained for the specific task.
|
| 151 |
+
|
| 152 |
+
# 6.4 HIERARCHICAL CONTROL WITH UNSUPERVISED PRIMITIVES
|
| 153 |
+
|
| 154 |
+
We benchmark hierarchical control for primitives learned without supervision, against our proposed scheme using an MPPI based planner on top of DADS-learned skills. We persist with the task of Ant-navigation as described in 6.3. We benchmark against Hierarchical DIAYN (Eysenbach et al., 2018), which learns the skills using the DIAYN objective, freezes the low-level policy and learns a meta-controller that outputs the skill to be executed for the next $H _ { Z }$ steps. We provide the x-y prior to the DIAYN’s disciminator while learning the skills for the Ant agent. The performance of the meta-controller is constrained by the low-level policy, however, this hierarchical scheme is agnostic to the algorithm used to learn the low-level policy. To contrast the quality of primitives learned by the DADS and DIAYN, we also benchmark against Hierarchical DADS, which learns a meta-controller the same way as Hierarchical DIAYN, but learns the skills using DADS.
|
| 155 |
+
|
| 156 |
+
From Figure 8 (Left) We find that the meta-controller is unable to compose the skills learned by DIAYN, while the same meta-controller can learn to compose skills by DADS to navigate the Ant to different goals. This result seems to confirm our intuition described in Section 6.2, that the high variance of the DIAYN skills limits their temporal compositionality. Interestingly, learning a RL meta-controller reaches similar performance to the MPPI controller, taking an additional 200, 000 samples per goal.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 8: (Left) A RL-trained meta-controller is unable to compose primitive learned by DIAYN to navigate Ant to a goal, while it succeeds to do so using the primitives learned by DADS. (Right) Goal-Conditioned RL (GCRL-dense/sparse) does not generalize outside its training distribution, while MPPI controller on learned skills (DADS-dense/sparse) experiences significantly smaller degrade in performance.
|
| 160 |
+
|
| 161 |
+
# 6.5 GOAL-CONDITIONED RL
|
| 162 |
+
|
| 163 |
+
To demonstrate the benefits of our approach over model-free RL, we benchmark against goalconditioned RL on two versions of Ant-navigation: (a) with a dense reward $r ( u )$ and (b) with a sparse reward $r ( u ) = 1$ if $\| u - g \| _ { 2 } \leq \epsilon$ , else 0. We train the goal-conditioned RL agent using soft actor-critic, where the state variable of the agent is augmented with $u - g$ , the position delta to the goal. The agent gets a randomly sampled goal from $[ - 1 0 , 1 0 ] ^ { 2 }$ at the beginning of the episode.
|
| 164 |
+
|
| 165 |
+
In Figure 8 (Right), we measure the average performance of the all the methods as a function of the initial distance of the goal, ranging from 5 to 30 metres. For dense reward navigation, we observe that while model-based planning on DADS-learned skills degrades smoothly as the initial distance to goal to increases, goal-conditioned RL experiences a sudden deterioration outside the goal distribution it was trained on. Even within the goal distribution observed during training of goal-conditioned RL model, skill-space planning performs competitively to it. With sparse reward navigation, goal-conditioned RL is unable to navigate, while MPPI demonstrates comparable performance to the dense reward up to about 20 metres. This highlights the utility of learning task-agnostic skills, which makes them more general while showing that latent space planning can be leveraged for tasks requiring long-horizon planning.
|
| 166 |
+
|
| 167 |
+
# 7 CONCLUSION
|
| 168 |
+
|
| 169 |
+
We have proposed a novel unsupervised skill learning algorithm that is amenable to model-based planning for hierarchical control on downstream tasks. We show that our skill learning method can scale to high-dimensional state-spaces, while discovering a diverse set of low-variance skills. In addition, we demonstrated that, without any training on the specified task, we can compose the learned skills to outperform competitive model-based baselines that were trained with the knowledge of the test tasks. We plan to extend the algorithm to work with off-policy data, potentially using relabelling tricks (Andrychowicz et al., 2017; Nachum et al., 2018) and explore more nuanced planning algorithms. We plan to apply the hereby-introduced method to different domains, such as manipulation and enable skill/model discovery directly from images.
|
| 170 |
+
|
| 171 |
+
# 8 ACKNOWLEDGEMENTS
|
| 172 |
+
|
| 173 |
+
We would like to thank Evan Liu, Ben Eysenbach, Anusha Nagabandi for their help in reproducing the baselines for this work. We are thankful to Ben Eysenbach for their comments and discussion on the initial drafts. We would also like to acknowledge Ofir Nachum, Alex Alemi, Daniel Freeman, Yiding Jiang, Allan Zhou and other colleagues at Google Brain for their helpful feedback and discussions at various stages of this work. We are also thankful to Michael Ahn and others in Adept team for their support, especially with the infrastructure setup and scaling up the experiments.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Watten- ´ berg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
|
| 178 |
+
|
| 179 |
+
Joshua Achiam, Harrison Edwards, Dario Amodei, and Pieter Abbeel. Variational option discovery algorithms. arXiv preprint arXiv:1807.10299, 2018.
|
| 180 |
+
|
| 181 |
+
David Barber Felix Agakov. The im algorithm: a variational approach to information maximization. Advances in Neural Information Processing Systems, 16:201, 2004.
|
| 182 |
+
|
| 183 |
+
Alexander A Alemi and Ian Fischer. Therml: Thermodynamics of machine learning. arXiv preprint arXiv:1807.04162, 2018.
|
| 184 |
+
|
| 185 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. CoRR, abs/1707.01495, 2017. URL http://arxiv.org/abs/1707.01495.
|
| 186 |
+
|
| 187 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 188 |
+
|
| 189 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 190 |
+
|
| 191 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. URL http://arxiv.org/ abs/1606.01540.
|
| 192 |
+
|
| 193 |
+
Yevgen Chebotar, Karol Hausman, Marvin Zhang, Gaurav Sukhatme, Stefan Schaal, and Sergey Levine. Combining model-based and model-free updates for trajectory-centric reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 703–711. JMLR. org, 2017.
|
| 194 |
+
|
| 195 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. CoRR, abs/1805.12114, 2018a. URL http://arxiv.org/abs/1805.12114.
|
| 196 |
+
|
| 197 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4759–4770, 2018b.
|
| 198 |
+
|
| 199 |
+
Imre Csiszar and Frantisek Matus. Information projections revisited. ´ IEEE Transactions on Information Theory, 49(6):1474–1490, 2003.
|
| 200 |
+
|
| 201 |
+
Christian Daniel, Gerhard Neumann, and Jan Peters. Hierarchical relative entropy policy search. In Artificial Intelligence and Statistics, pp. 273–281, 2012.
|
| 202 |
+
|
| 203 |
+
Marc Deisenroth and Carl E Rasmussen. Pilco: A model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pp. 465–472, 2011.
|
| 204 |
+
|
| 205 |
+
Marc Peter Deisenroth, Dieter Fox, and Carl Edward Rasmussen. Gaussian processes for dataefficient learning in robotics and control. IEEE transactions on pattern analysis and machine intelligence, 37(2):408–423, 2013.
|
| 206 |
+
|
| 207 |
+
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.
|
| 208 |
+
|
| 209 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
|
| 210 |
+
|
| 211 |
+
Nir Friedman, Ori Mosenzon, Noam Slonim, and Naftali Tishby. Multivariate information bottleneck. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 152–161. Morgan Kaufmann Publishers Inc., 2001.
|
| 212 |
+
|
| 213 |
+
Justin Fu, Sergey Levine, and Pieter Abbeel. One-shot learning of manipulation skills with online dynamics adaptation and neural network priors. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 4019–4026. IEEE, 2016.
|
| 214 |
+
|
| 215 |
+
Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models 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. 2577–2587. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 6851-ex2-exploration-with-exemplar-models-for-deep-reinforcement-learning. pdf.
|
| 216 |
+
|
| 217 |
+
Yarin Gal, Rowan McAllister, and Carl Edward Rasmussen. Improving pilco with bayesian neural network dynamics models. In Data-Efficient Machine Learning workshop, ICML, volume 4, 2016.
|
| 218 |
+
|
| 219 |
+
Carlos E Garcia, David M Prett, and Manfred Morari. Model predictive control: theory and practice—a survey. Automatica, 25(3):335–348, 1989.
|
| 220 |
+
|
| 221 |
+
Karol Gregor, Danilo Jimenez Rezende, and Daan Wierstra. Variational intrinsic control. arXiv preprint arXiv:1611.07507, 2016.
|
| 222 |
+
|
| 223 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 3389–3396. IEEE, 2017.
|
| 224 |
+
|
| 225 |
+
David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems, pp. 2455–2467, 2018.
|
| 226 |
+
|
| 227 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018a.
|
| 228 |
+
|
| 229 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. CoRR, abs/1812.05905, 2018b. URL http://arxiv.org/abs/ 1812.05905.
|
| 230 |
+
|
| 231 |
+
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. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ rk07ZXZRb.
|
| 232 |
+
|
| 233 |
+
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.
|
| 234 |
+
|
| 235 |
+
Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, SM Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 236 |
+
|
| 237 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Curiosity-driven exploration in deep reinforcement learning via bayesian neural networks. CoRR, abs/1605.09674, 2016. URL http://arxiv.org/abs/1605.09674.
|
| 238 |
+
|
| 239 |
+
Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 240 |
+
|
| 241 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
|
| 242 |
+
|
| 243 |
+
Sanket Kamthe and Marc Peter Deisenroth. Data-efficient reinforcement learning with probabilistic model predictive control. arXiv preprint arXiv:1706.06491, 2017.
|
| 244 |
+
|
| 245 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 246 |
+
|
| 247 |
+
Alexander S Klyubin, Daniel Polani, and Chrystopher L Nehaniv. Empowerment: A universal agentcentric measure of control. In 2005 IEEE Congress on Evolutionary Computation, volume 1, pp. 128–135. IEEE, 2005.
|
| 248 |
+
|
| 249 |
+
Jonathan Ko, Daniel J Klein, Dieter Fox, and Dirk Haehnel. Gaussian processes and reinforcement learning for identification and control of an autonomous blimp. In Proceedings 2007 ieee international conference on robotics and automation, pp. 742–747. IEEE, 2007.
|
| 250 |
+
|
| 251 |
+
Jus Kocijan, Roderick Murray-Smith, Carl Edward Rasmussen, and Agathe Girard. Gaussian pro- ˇ cess model based predictive control. In Proceedings of the 2004 American Control Conference, volume 3, pp. 2214–2219. IEEE, 2004.
|
| 252 |
+
|
| 253 |
+
Vikash Kumar, Emanuel Todorov, and Sergey Levine. Optimal control with learned local models: Application to dexterous manipulation. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 378–383. IEEE, 2016.
|
| 254 |
+
|
| 255 |
+
Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. arXiv preprint arXiv:1802.10592, 2018.
|
| 256 |
+
|
| 257 |
+
Ian Lenz, Ross A Knepper, and Ashutosh Saxena. Deepmpc: Learning deep latent features for model predictive control. In Robotics: Science and Systems. Rome, Italy, 2015.
|
| 258 |
+
|
| 259 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 260 |
+
|
| 261 |
+
Weiwei Li and Emanuel Todorov. Iterative linear quadratic regulator design for nonlinear biological movement systems. In ICINCO (1), pp. 222–229, 2004.
|
| 262 |
+
|
| 263 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 264 |
+
|
| 265 |
+
Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 2125–2133, 2015.
|
| 266 |
+
|
| 267 |
+
Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3307–3317, 2018.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015.
|
| 272 |
+
|
| 273 |
+
Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? a typology of computational approaches. Frontiers in neurorobotics, 1:6, 2009.
|
| 274 |
+
|
| 275 |
+
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.
|
| 276 |
+
|
| 277 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In ICML, 2017.
|
| 278 |
+
|
| 279 |
+
Xue Bin Peng, Glen Berseth, KangKang Yin, and Michiel Van De Panne. Deeploco: Dynamic locomotion skills using hierarchical deep reinforcement learning. ACM Transactions on Graphics (TOG), 36(4):41, 2017.
|
| 280 |
+
|
| 281 |
+
Theodore J Perkins, Doina Precup, et al. Using options for knowledge transfer in reinforcement learning. University of Massachusetts, Amherst, MA, USA, Tech. Rep, 1999.
|
| 282 |
+
|
| 283 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017.
|
| 284 |
+
|
| 285 |
+
Carl Edward Rasmussen. Gaussian processes in machine learning. In Summer School on Machine Learning, pp. 63–71. Springer, 2003.
|
| 286 |
+
|
| 287 |
+
Jurgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). ¨ IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
|
| 288 |
+
|
| 289 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael I Jordan, and Philipp Moritz. Trust region policy optimization. In Icml, volume 37, pp. 1889–1897, 2015.
|
| 290 |
+
|
| 291 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 292 |
+
|
| 293 |
+
Sergio Guadarrama, Anoop Korattikara, Oscar Ramirez, Pablo Castro, Ethan Holly, Sam Fishman, Ke Wang, Ekaterina Gonina, Chris Harris, Vincent Vanhoucke, Eugene Brevdo. TF-Agents: A library for reinforcement learning in tensorflow. https://github.com/tensorflow/ agents, 2018. URL https://github.com/tensorflow/agents. [Online; accessed 30-November-2018].
|
| 294 |
+
|
| 295 |
+
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, 2016.
|
| 296 |
+
|
| 297 |
+
Noam Slonim, Gurinder S Atwal, Gasper Tkacik, and William Bialek. Estimating mutual information and multi–information in large networks. arXiv preprint cs/0502017, 2005.
|
| 298 |
+
|
| 299 |
+
Bradly C. Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. CoRR, abs/1507.00814, 2015. URL http://arxiv. org/abs/1507.00814.
|
| 300 |
+
|
| 301 |
+
Martin Stolle and Doina Precup. Learning options in reinforcement learning. In International Symposium on abstraction, reformulation, and approximation, pp. 212–223. Springer, 2002.
|
| 302 |
+
|
| 303 |
+
Richard S Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181– 211, 1999.
|
| 304 |
+
|
| 305 |
+
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.
|
| 306 |
+
|
| 307 |
+
Valentin Thomas, Emmanuel Bengio, William Fedus, Jules Pondard, Philippe Beaudoin, Hugo Larochelle, Joelle Pineau, Doina Precup, and Yoshua Bengio. Disentangling the independently controllable factors of variation by interacting with the world, 2018.
|
| 308 |
+
|
| 309 |
+
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.
|
| 310 |
+
|
| 311 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3540– 3549. JMLR. org, 2017.
|
| 312 |
+
|
| 313 |
+
David Warde-Farley, Tom Van de Wiele, Tejas Kulkarni, Catalin Ionescu, Steven Hansen, and Volodymyr Mnih. Unsupervised control through non-parametric discriminative rewards. arXiv preprint arXiv:1811.11359, 2018.
|
| 314 |
+
|
| 315 |
+
Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in neural information processing systems, pp. 2746–2754, 2015.
|
| 316 |
+
|
| 317 |
+
Grady Williams, Paul Drews, Brian Goldfain, James M Rehg, and Evangelos A Theodorou. Aggressive driving with model predictive path integral control. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 1433–1440. IEEE, 2016.
|
| 318 |
+
|
| 319 |
+
# A IMPLEMENTATION DETAILS
|
| 320 |
+
|
| 321 |
+
All of our models are written in the open source Tensorflow-Agents (Sergio Guadarrama, Anoop Korattikara, Oscar Ramirez, Pablo Castro, Ethan Holly, Sam Fishman, Ke Wang, Ekaterina Gonina, Chris Harris, Vincent Vanhoucke, Eugene Brevdo, 2018), based on Tensorflow (Abadi et al., 2015).
|
| 322 |
+
|
| 323 |
+
# A.1 SKILL SPACES
|
| 324 |
+
|
| 325 |
+
When using discrete spaces, we parameterize $\mathcal { Z }$ as one-hot vectors. These one-hot vectors are randomly sampled from the uniform prior $\begin{array} { r } { p ( z ) = \frac { 1 } { D } } \end{array}$ , where $D$ is the number of skills. We experiment with $D \leq 1 2 8$ . For discrete skills learnt for MuJoCo Ant in Section 6.3, we use $D = 2 0$ . For continuous spaces, we sample $z \sim \mathrm { U n i f o r m } ( - 1 , 1 ) ^ { D }$ . We experiment with $D = 2$ for Ant learnt with x-y prior, $D = 3$ for Ant learnt without x-y prior (that is full observation space), to $D = 5$ for Humanoid on full observation spaces. The skills are sampled once in the beginning of the episode and fixed for the rest of the episode. However, it is possible to resample the skill from the prior within the episode, which allows for every skill to experience a different distribution than the initialization distribution. This also encourages discovery of skills which can be composed temporally. However, this increases the hardness of problem, especially if the skills are re-sampled from the prior frequently.
|
| 326 |
+
|
| 327 |
+
# A.2 AGENT
|
| 328 |
+
|
| 329 |
+
We use SAC as the optimizer for our agent $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ , in particular, EC-SAC (Haarnoja et al., 2018b). The $s$ input to the policy generally excludes global co-ordinates $( x , y )$ of the centre-ofmass, available for a lot of enviroments in OpenAI gym, which helps produce skills agnostic to the location of the agent. We restrict to two hidden layers for our policy and critic networks. However, to improve the expressivity of skills, it is beneficial to increase the capacity of the networks. The hidden layer sizes can vary from (128, 128) for Half-Cheetah to (512, 512) for Ant and (1024, 1024) for Humanoid. The critic $Q ( s , a , z )$ is similarly parameterized. The target function for critic $Q$ is updated every iteration using a soft updates with co-efficient of 0.005. We use Adam (Kingma & Ba, 2014) optimizer with a fixed learning rate of $3 e \mathrm { ~ - ~ } 4$ , and a fixed initial entropy co-efficient $\beta = 0 . 1$ . While the policy is parameterized as a normal distribution $\mathcal { N } ( \mu ( s , z ) , \Sigma ( s , z ) )$ where $\Sigma$ is a diagonal covariance matrix, it undergoes through tanh transformation, to transform the output to the range $( - 1 , 1 )$ and constrain to the action bounds.
|
| 330 |
+
|
| 331 |
+
# A.3 SKILL-DYNAMICS
|
| 332 |
+
|
| 333 |
+
Skill-dynamics, denoted by $q ( s ^ { \prime } \mid s , z )$ , is parameterized by a deep neural network. A common trick in model-based RL is to predict the $\Delta s = s ^ { \prime } - s$ , rather than the full state $s ^ { \prime }$ . Hence, the prediction network is $q ( \Delta s \mid s , z )$ . Note, both parameterizations can represent the same set of functions. However, the latter will be easy to learn as $\Delta s$ will be centred around 0. We exclude the global coordinates from from the state input to $q$ . However, we can (and we still do) predict $\Delta _ { x } , \Delta _ { y }$ , because reward functions for goal-based navigation generally rely on the position prediction from the model. This represents another benefit of predicting state-deltas, as we can still predict changes in position without explicitly knowing the global position.
|
| 334 |
+
|
| 335 |
+
The output distribution is modelled as a Mixture-of-Experts (Jacobs et al., 1991). We fix the number of experts to be 4. We model each expert as a Gaussian distribution. The input $( s , z )$ goes through two hidden layers (the same capacity as that of policy and critic networks, for example (512, 512) for Ant). The output of the two hidden layers is used as an input to the mixture-of-experts, which is linearly transformed to output the parameters of the Gaussian distribution, and a discrete distribution over the experts using a softmax distribution. In practice, we fix the covariance matrix of the Gaussian experts to be an identity matrix, so we only need to output the means for the experts. We use batch-normalization for both input and the hidden layers. We normalize the output targets using their batch-average and batch-standard deviation, similar to batch-normalization.
|
| 336 |
+
|
| 337 |
+
# A.4 OTHER HYPERPARAMETERS
|
| 338 |
+
|
| 339 |
+
The episode horizon is generally kept shorter for stable agents like Ant (200), while longer for unstable agents like Humanoid (1000). For Ant, longer episodes do not add value, but Humanoid can benefit from longer episodes as it helps it filter skills which are unstable. The optimization scheme is on-policy, and we collect 2000 steps for Ant and 4000 steps for Humanoid in one iteration. The intuition is to experience trajectories generated by multiple skills (approximately 10) in a batch. Re-sampling skills can enable experiencing larger number of skills. Once a batch of episodes is collected, the skill-dynamics is updated using Adam optimizer with a fixed learning rate of $3 e - 4$ . The batch size is 128, and we carry out 32 steps of gradient descent. To compute the intrinsic reward, we need to resample the prior for computing the denominator. For continuous spaces, we set $L = 5 0 0$ . For discrete spaces, we can marginalize over all skills. After the intrinsic reward is computed, the policy and critic networks are updated for 128 steps with a batch size of 128. The intuition is to ensure that every sample in the batch is seen for policy and critic updates about $3 - 4$ times in expectation.
|
| 340 |
+
|
| 341 |
+
# A.5 PLANNING AND EVALUATION SETUPS
|
| 342 |
+
|
| 343 |
+
For evaluation, we fix the episode horizon to 200 for all models in all evaluation setups. Depending upon the size of the latent space and planning horizon, the number of samples from the planning distribution $P$ is varied between $1 0 - 2 0 0$ . For $H _ { P } = 1 , H _ { Z } = 1 0$ and a $2 D$ latent space, we use 50 samples from the planning distribution $P$ . The co-efficient $\gamma$ for MPPI is fixed to 10. We use a setting of $H _ { P } = 1$ and $H _ { Z } = 1 0$ for dense-reward navigation, in which case we set the number of refine steps $R = 1 0$ . However, for sparse reward navigation it is important to have a longer horizon planning, in which case we set $H _ { P } = 4 , H _ { Z } = 2 5$ with a higher number of samples from the planning distribution (200 from $P$ ). Also, when using longer planning horizons, we found that smoothing the sampled plans help. Thus, if the sampled plan is $z _ { 1 } , z _ { 2 } , z _ { 3 } , z _ { 4 } \ldots$ we smooth the plan to make $\bar { z _ { 2 } } = \beta z _ { 1 } \bar { + } ( 1 \bar { - } \beta ) z _ { 2 }$ and so on, with $\beta = 0 . 9$ .
|
| 344 |
+
|
| 345 |
+
For hierarchical controllers being learnt on top of low-level unsupervised primitives, we use PPO (Schulman et al., 2017) for discrete action skills, while we use SAC for continuous skills. We keep the number of steps after which the meta-action is decided as 10 (that is $H _ { Z } = 1 0$ ). The hidden layer sizes of the meta-controller are (128, 128). We use a learning rate of $1 e - 4$ for PPO and $3 e - 4$ for SAC.
|
| 346 |
+
|
| 347 |
+
For our model-based RL baseline PETS, we use an ensemble size of 3, with a fixed planning horizon of 20. For the model, we use a neural network with two hidden layers of size 400. In our experiments, we found that MPPI outperforms CEM, so we report the results using the MPPI as our controller.
|
| 348 |
+
|
| 349 |
+
# B GRAPHICAL MODELS, INFORMATION BOTTLENECK AND UNSUPERVISED SKILL LEARNING
|
| 350 |
+
|
| 351 |
+
We now present a novel perspective on unsupervised skill learning, motivated from the literature on information bottleneck. This section takes inspiration from (Alemi & Fischer, 2018), which helps us provide a rigorous justification for our objective proposed earlier. To obtain our unsupervised RL objective, we setup a graphical model $P$ as shown in Figure 9, which represents the distribution of trajectories generated by a given policy $\pi$ . The joint distribution is given by:
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
p ( s _ { 1 } , a _ { 1 } \ldots a _ { T - 1 } , s _ { T } , z ) = p ( z ) p ( s _ { 1 } ) \prod _ { t = 1 } ^ { T - 1 } \pi ( a _ { t } | s _ { t } , z ) p ( s _ { t + 1 } | s _ { t } , a _ { t } ) .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 9: Graphical model for the world $P$ in which the trajectories are generated while interacting with the environment. Shaded nodes represent the distributions we optimize.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 10: Graphical model for the world $N$ which is the desired representation of the world.
|
| 362 |
+
|
| 363 |
+
We setup another graphical model $N$ , which represents the desired model of the world. In particular, we are interested in approximating $p ( s ^ { \prime } | s , z )$ , which represents the transition function for a particular primitive. This abstraction helps us get away from knowing the exact actions, enabling model-based planning in behavior space (as discussed in the main paper). The joint distribution for $N$ shown in Figure 10 is given by:
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\eta ( s _ { 1 } , a _ { 1 } , \ldots s _ { T } , a _ { T } , z ) = \eta ( z ) \eta ( s _ { 1 } ) \prod _ { t = 1 } ^ { T - 1 } \eta ( a _ { t } ) \eta ( s _ { t + 1 } | s _ { t } , z ) .
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
The goal of our approach is to optimize the distribution $\pi ( a | s , z )$ in the graphical model $P$ to minimize the distance between the two distributions, when transforming to the representation of the graphical model $Z$ . In particular, we are interested in minimizing the KL divergence between $p$ and $\eta$ , that is $\mathcal { D } _ { K L } ( \boldsymbol { p } | | \boldsymbol { \eta } )$ . Note, if $N$ had the same structure as $P$ , the information lost in projection would be 0 for any valid $P$ . Interestingly, we can exploit the following result from in Friedman et al. (2001) to setup the objective for $\pi$ , without explicitly knowing $\eta$ :
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\operatorname* { m i n } _ { \eta } \mathcal { D } _ { K L } ( p | | \eta ) = \mathcal { I } _ { P } - \mathcal { I } _ { N } ,
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
where $\mathcal { T } _ { P }$ and $\mathcal { T } _ { N }$ represents the multi-information for distribution $P$ on the respective graphical models. Note, $\begin{array} { r } { \operatorname* { m i n } _ { \eta \in N } \mathcal { D } _ { K L } ( p | | \eta ) } \end{array}$ , which is the reverse information projection (Csiszar´ $\&$ Matus, 2003). The multi-information (Slonim et al., 2005) for a graphical model $G$ with nodes $g _ { i }$ is defined as:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\mathcal { T } _ { G } = \sum _ { i } I ( g _ { i } ; P a ( g _ { i } ) ) ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
where $P a ( g _ { i } )$ denotes the nodes upon which $g _ { i }$ has direct conditional dependence in $G$ . Using this definition, we can compute the multi-information terms:
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\mathcal { Z } _ { P } = \sum _ { t = 1 } ^ { T } I ( a _ { t } ; \{ s _ { t } , z \} ) + \sum _ { t = 2 } ^ { T } I ( s _ { t } ; \{ s _ { t - 1 } , a _ { t - 1 } \} ) \quad \mathrm { a n d } \quad \mathcal { Z } _ { N } = \sum _ { t = 2 } ^ { T } I ( s _ { t } ; \{ s _ { t - 1 } , z \} ) .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Following the Optimal Frontier argument in (Alemi & Fischer, 2018), we introduce Lagrange multipliers $\beta _ { t } \ge 0 , \delta _ { t } \ge 0$ for the information terms in $\mathcal { T } _ { P }$ to setup an objective $R ( \pi )$ to be maximized with respect to $\pi$ :
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
R ( \pi ) = \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; \{ s _ { t } , z \} ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) - \delta _ { t } \mathcal { Z } ( s _ { t + 1 } ; \{ s _ { t } , a _ { t } \} )
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
As the underlying dynamics are fixed and unknown, we simplify the optimization by setting $\delta _ { t } = $ 0 which intuitively corresponds to us neglecting the unchangeable information of the underlying dynamics. This gives us
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { l } { \displaystyle R ( \pi ) = \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; \{ s _ { t } , z \} ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) } \\ { \displaystyle \geq \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; z \mid s _ { t } ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Here, we have used the chain rule of mutual information: ${ \cal { T } } ( s _ { t + 1 } ; \{ s _ { t } , z \} ) ~ = ~ { \cal { T } } ( s _ { t + 1 } ; s _ { t } ) ~ + ~$ $\mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } ) \geq \mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } )$ , resulting from the non-negativity of mutual information. This yield us an information bottleneck style objective where we maximize the mutual information motivated in Section 3, while minimizing $\mathcal { T } ( a _ { t } ; \{ s _ { t } , z \} )$ . We can show that the minimization of the latter mutual information corresponds to entropy regularization of $\pi ( a _ { t } \mid s _ { t } , z )$ , as follows:
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { \mathcal { Z } ( a _ { t } ; \{ s _ { t } , z \} ) = \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { \pi ( a _ { t } ) } \Big ] } \\ & { \quad \quad \quad \quad = \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { p ( a _ { t } ) } \Big ] - \mathcal { D } _ { K L } \big ( \pi ( a _ { t } ) \mid | p ( a _ { t } ) \big ) } \\ & { \quad \quad \quad \quad \quad \leq \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { p ( a _ { t } ) } \Big ] } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
for some arbitrary distribution $\log p ( a _ { t } )$ (for example uniform). Again, we have used the nonnegativity of $\mathcal { D } _ { K L }$ to get the inequality. We use Equation 19 in Equation 16 to get:
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
R ( \pi ) \geq \sum _ { t = 1 } ^ { T - 1 } \mathcal { Z } ( s _ { t + 1 } ; z \mid s _ { t } ) - \beta _ { t } \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } \mid s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \pi ( a _ { t } \mid s _ { t } , z ) \Big ]
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
where we have ignored $p ( a _ { t } )$ as it is a constant with respect to optimization for $\pi$ . This motivates the use of entropy regularization. We can follow the arguments in Section 3 to obtain an approximate lower bound for $\mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } )$ . The above discussion shows how DADS can be motivated from a graphical modelling perspective, while justifying the use of entropy regularization from an information bottleneck perspective. This objective also explicates the temporally extended nature of $z$ , and how it corresponds to a sequence of actions producing a predictable sequence of transitions in the environment.
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 11: Graphical model for the world $P$ representing the stationary state, action distribution. Shaded nodes represent the distributions we optimize.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 12: Graphical model for the world $N$ using which we is the representation we are interested in.
|
| 418 |
+
|
| 419 |
+
We can carry out the exercise for the reward function in Eysenbach et al. (2018) (DIAYN) to provide a graphical model interpretation of the objective used in the paper. To conform with objective in the paper, we assume to be sampling to be state-action pairs from skill-conditioned stationary distributions in the world $P$ , rather than trajectories. The objective to be maximized is given by:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l } & { R ( \pi ) = - \mathscr { T } _ { P } + \mathscr { T } _ { Q } } \\ & { \quad \quad = - I ( a ; \{ s , z \} ) + I ( z ; s ) } \\ & { \quad \quad = \mathbb { E } _ { \pi } [ \log \frac { p ( z | s ) } { p ( z ) } - \log \frac { \pi ( a | s , z ) } { \pi ( a ) } ] } \\ & { \quad \quad \geq \mathbb { E } _ { \pi } [ \log q _ { \phi } ( z | s ) - \log p ( z ) - \log \pi ( a | s , z ) ] = R ( \pi , q _ { \phi } ) } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
where we have used the variational inequalities to replace $p ( z | s )$ with $q _ { \phi } ( z | s )$ and $\pi ( a )$ with a uniform prior over bounded actions $p ( a )$ (which is ignored as a constant).
|
| 426 |
+
|
| 427 |
+
# C APPROXIMATING THE REWARD FUNCTION
|
| 428 |
+
|
| 429 |
+
We revisit Equation 4 and the resulting approximate reward function constructed in Equation 6. The maximization objective for policy was:
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
R ( \pi \mid q _ { \phi } ) = \mathbb { E } _ { z , s , s ^ { \prime } } \big [ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s ) \big ]
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
The computational problem arises from the intractability of $\begin{array} { r } { p ( s ^ { \prime } \mid s ) = \int p ( s ^ { \prime } \mid s , z ) p ( z \mid s ) d z } \end{array}$ , where both $p ( s ^ { \prime } \mid s , \bar { z } )$ and $p ( z \mid s ) \propto p ( s \mid z ) p ( z )$ are intractable. Unfortunately, any variational approximation results in an improper lower bound for the objective. To see that:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { r l } & { R ( \pi \mid q _ { \phi } ) = \operatorname { \mathbb { E } } _ { z , s , s ^ { \prime } } \left[ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log q ( s ^ { \prime } \mid s ) \right] - \mathcal { D } _ { K L } ( p ( s ^ { \prime } \mid s ) \mid \mid q ( s ^ { \prime } \mid s ) ) } \\ & { \quad \quad \quad \leq \operatorname { \mathbb { E } } _ { z , s , s ^ { \prime } } \left[ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log q ( s ^ { \prime } \mid s ) \right] } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
where the inequality goes the wrong way for any variational approximation $q ( s ^ { \prime } \mid s )$ . Our approximation can be seen as a special instantiation of $\begin{array} { r } { q ( s ^ { \prime } \mid s ) = \int q _ { \phi } ( s ^ { \prime } \mid \bar { s } , z ) p ( z ) d z } \end{array}$ . This approximation is simple to compute as generating samples from the prior $p ( z )$ is inexpensive and effectively requires only a forward pass through $q _ { \phi }$ . Reusing $q _ { \phi }$ to approximate $p ( s ^ { \prime } \bar { | } s )$ makes intuitive sense because we want $q _ { \phi }$ to reasonably approximate $p ( s ^ { \prime } \mid s , z )$ (which is why we collect large batches of data and take multiple steps of gradient descent for fitting $q _ { \phi } .$ ). While sampling from the prior $p ( z )$ is crude, sampling $p ( z \mid s )$ can be computationally prohibitive. For a certain class of problems, especially locomotion, sampling from $p ( z )$ is a reasonable approximation as well. We want our primitives/skills to be usable from any state, which is especially the case with locomotion. Empirically, we have found our current approximation provides satisfactory results. We also discuss some other potential solutions (and their limitations):
|
| 442 |
+
|
| 443 |
+
(a) One could potentially use another network $q _ { \beta } ( z \mid s )$ to approximate $p ( z \mid s )$ by minimizing $\mathbb { E } _ { s , z \sim p } \big [ D _ { K L } ( p ( z \mid s ) \mid \mid q _ { \beta } ( z \mid s ) ) \big ]$ . Note, the resulting approximation would still be an improper lower bound for $R ( \pi \mid q _ { \phi } )$ . However, sampling from this $q _ { \beta }$ might result in a better approximation than sampling from the prior $p ( z )$ for some problems.
|
| 444 |
+
|
| 445 |
+
(b) We can bypass the computational intractability of $p ( s ^ { \prime } \mid s )$ by exploiting the variational lower bounds from Agakov (2004). We use the following inequality, used in Hausman et al. (2018):
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\mathcal { H } ( x ) \geq \int p ( x , z ) \log \frac { q ( z | x ) } { p ( x , z ) } d x d z
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
where $q$ is a variational approximation to the posterior $p ( z | x )$ .
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\begin{array} { r l } & { I ( s ^ { \prime } ; z | s ) = - { \mathcal { H } } ( s ^ { \prime } | s , z ) + { \mathcal { H } } ( s ^ { \prime } | s ) } \\ & { \qquad \geq \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \phi } ( s ^ { \prime } | s , z ) \right] + \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \alpha } ( z | s ^ { \prime } , s ) \right] + { \mathcal { H } } ( s ^ { \prime } , z | s ) } \\ & { \qquad = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \phi } ( s ^ { \prime } | s , z ) + \log q _ { \alpha } ( z | s ^ { \prime } , s ) \right] + { \mathcal { H } } ( s ^ { \prime } , z | s ) } \end{array}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
where we have used the inequality for $\mathcal { H } ( s ^ { \prime } | s )$ to introduce the variational posterior for skill inference $q _ { \alpha } ( z \mid s ^ { \prime } , s )$ besides the conventional variational lower bound to introduce $q ( s ^ { \prime } \mid s , z )$ . Further decomposing the leftover entropy:
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\mathcal { H } ( s ^ { \prime } , z | s ) = \mathcal { H } ( z | s ) + \mathcal { H } ( s ^ { \prime } | s , z )
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Reusing the variational lower bound for marginal entropy from Agakov (2004), we get:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { l } { \displaystyle \mathcal { H } ( s ^ { \prime } | s , z ) \geq \mathbb { E } _ { s , z } \Big [ \int p ( s ^ { \prime } , a | s , z ) \log \frac { q ( a | s ^ { \prime } , s , z ) } { p ( s ^ { \prime } , a | s , z ) } d s ^ { \prime } d a \Big ] } \\ { \displaystyle \qquad = - \log c + \mathcal { H } ( s ^ { \prime } , a | s , z ) } \\ { \displaystyle \qquad = - \log c + \mathcal { H } ( s ^ { \prime } | s , a , z ) + \mathcal { H } ( a | s , z ) } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Since, the choice of posterior is upon us, we can choose $q ( a | s ^ { \prime } , s , z ) = 1 / c$ to induce a uniform distribution for the bounded action space. For $\mathcal { H } ( s ^ { \prime } | s , a , z )$ , notice that the underlying dynamics $p ( s ^ { \prime } | s , a )$ are independent of $z$ , but the actions do depend upon $z$ . Therefore, this corresponds to entropy-regularized RL when the dynamics of the system are deterministic. Even for stochastic dynamics, the analogy might be a good approximation , assuming the underlying dynamics are not very entropic. The final objective (making this low-entropy dynamics assumption) can be written as:
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
I ( s ^ { \prime } ; z | s ) \geq \mathbb { E } _ { s } \mathbb { E } _ { p ( s ^ { \prime } , z | s ) } [ \log q _ { \phi } ( s ^ { \prime } | s , z ) + \log q _ { \alpha } ( z | s ^ { \prime } , s ) - \log p ( z | s ) ] + \mathcal { H } ( a | s , z )
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
While this does bypass the intractability of $p ( s ^ { \prime } \mid s )$ , it runs into the intractable $p ( z \mid s )$ , despite deploying significant mathematical machinery and additional assumptions. Any variational approximation for $\bar { p ( z \mid s ) }$ would again result in an improper lower bound for ${ \mathcal { T } } ( s ^ { \prime } ; z \mid s )$ .
|
| 476 |
+
|
| 477 |
+
(c) One way to a make our approximation $q ( s ^ { \prime } \mid s )$ to more closely resemble $p ( s ^ { \prime } \mid s )$ is to change our generative model $p ( z , s , s ^ { \prime } )$ . In particular, if we resample $z \sim p ( z )$ for every timestep of the rollout from $\pi$ , we can indeed write ${ \\\bar { p } } ( z \mid s ) = p ( z )$ . Note, $p ( s ^ { \prime } \mid s )$ is still intractable to compute, but marginalizing $q _ { \phi } ( s ^ { \prime } \mid s , z )$ over $p ( z )$ becomes a better approximation of $p ( s ^ { \prime } \mid s )$ . However, this severely dampens the interpretation of our latent space $\mathcal { Z }$ as temporally extended actions (or skills). It becomes better to interpret the latent space $\mathcal { Z }$ as dimensional reduction of action space. Empirically, we found that this significantly throttles the learning, not yielding useful or interpretable skills.
|
| 478 |
+
|
| 479 |
+
# D INTERPOLATION IN CONTINUOUS LATENT SPACE
|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
Figure 13: Interpolation in the continuous primitive space learned using DADS on the Ant environment corresponds to interpolation in the trajectory space. (Left) Interpolation from $z ~ = ~ [ 1 . 0 , 1 . 0 ]$ (solid blue) to $z \doteq [ - 1 . 0 , 1 . 0 ]$ (dotted cyan); (Middle) Interpolation from $z \overset { - } { = } \left[ 1 . 0 , 1 . 0 \right]$ (solid blue) to $z \dot { = } [ - 1 . 0 , - 1 . 0 ]$ (dotted cyan); (Right) Interpolation from $z = [ \bar { 1 } . 0 , 1 . 0 ]$ (solid blue) to $z = [ 1 . 0 , - 1 . 0 ]$ (dotted cyan).
|
| 483 |
+
|
| 484 |
+
# E MODEL PREDICTION
|
| 485 |
+
|
| 486 |
+
From Figure 14, we observe that skill-dynamics can provide robust state-predictions over long planning horizons. When learning skill-dynamics with $x - y$ prior, we observe that the error in prediction rises slower with horizon as compared to the norm of the actual position. This provides strong evidence of cooperation between the primitives and skill-dynamics learned using DADS with $x - y$ prior. As the error-growth for skill-dynamics learned on full-observation space is sub-exponential, similar argument can be made for DADS without $x - y$ prior as well (albeit to a weaker extent).
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
Figure 14: (Left) Prediction error in the Ant’s co-ordinates (normalized by the norm of the actual position) for skill-dynamics. (Right) X-Y traces of actual trajectories (colored) compared to trajectories predicted by skill-dynamics (dotted-black) for different skills.
|
md/train/HJxDugSFDB/HJxDugSFDB.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC LATENT ACTOR-CRITIC: DEEP REINFORCEMENT LEARNING WITH A LATENT VARIABLE MODEL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep reinforcement learning (RL) algorithms can use high-capacity deep networks to learn directly from image observations. However, these kinds of observation spaces present a number of challenges in practice, since the policy must now solve two problems: a representation learning problem, and a task learning problem. In this paper, we aim to explicitly learn representations that can accelerate reinforcement learning from images. We propose the stochastic latent actor-critic (SLAC) algorithm: a sample-efficient and high-performing RL algorithm for learning policies for complex continuous control tasks directly from high-dimensional image inputs. SLAC learns a compact latent representation space using a stochastic sequential latent variable model, and then learns a critic model within this latent space. By learning a critic within a compact state space, SLAC can learn much more efficiently than standard RL methods. The proposed model improves performance substantially over alternative representations as well, such as variational autoencoders. In fact, our experimental evaluation demonstrates that the sample efficiency of our resulting method is comparable to that of model-based RL methods that directly use a similar type of model for control. Furthermore, our method outperforms both model-free and model-based alternatives in terms of final performance and sample efficiency, on a range of difficult image-based control tasks. Our code and videos of our results are available at our website.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep reinforcement learning (RL) algorithms can automatically learn to solve certain tasks from raw, low-level observations such as images. However, these kinds of observation spaces present a number of challenges in practice: on one hand, it is difficult to directly learn from these high-dimensional inputs, but on the other hand, it is also difficult to tease out a compact representation of the underlying task-relevant information from which to learn instead. For these reasons, deep RL directly from low-level observations such as images remains a challenging problem. Particularly in continuous domains governed by complex dynamics, such as robotic control (Tassa et al., 2018; Brockman et al., 2016), standard approaches still require separate sensor setups to monitor details of interest in the environment, such as the joint positions of a robot or specific pose information of objects of interest. To instead be able to learn directly from the more general and rich modality of vision would greatly advance the current state of our learning systems, so we aim to study precisely this. Standard model-free deep RL aims to use direct end-to-end training to explicitly unify these tasks of representation learning and task learning. However, solving both problems together is difficult, since an effective policy requires an effective representation, but in order for an effective representation to emerge, the policy or value function must provide meaningful gradient information using only the model-free supervision signal (i.e., the reward function). In practice, learning directly from images with standard RL algorithms can be slow, sensitive to hyperparameters, and inefficient. In contrast to end-to-end learning with RL, predictive learning can benefit from a rich and informative supervision signal before the agent has even made progress on the task or received any rewards. This leads us to ask: can we explicitly learn a latent representation from raw low-level observations that makes deep RL easier, through learning a predictive latent variable model?
|
| 12 |
+
|
| 13 |
+
Predictive models are commonly used in model-based RL for the purpose of planning (Deisenroth & Rasmussen, 2011; Finn & Levine, 2017; Nagabandi et al., 2018; Chua et al., 2018; Zhang et al., 2019) or generating cheap synthetic experience for RL to reduce the required amount of interaction with the real environment (Sutton, 1991; Gu et al., 2016). However, in this work, we are primarily concerned with their potential to alleviate the representation learning challenge in RL. We devise a stochastic predictive model by modeling the high-dimensional observations as the consequence of a latent process, with a Gaussian prior and latent dynamics, as illustrated in Figure 1. A model with an entirely stochastic latent state has the appealing interpretation of being able to properly represent uncertainty about any of the state variables, given its past observations. We demonstrate in our work that fully stochastic state space models can in fact be learned effectively: With a well-designed stochastic network, such models outperform fully deterministic models, and contrary to the observations in prior work (Hafner et al., 2019; Buesing et al., 2018), are actually comparable to partially stochastic models. Finally, we note that this explicit representation learning, even on low-reward data, allows an agent with such a model to make progress on representation learning even before it makes progress on task learning.
|
| 14 |
+
|
| 15 |
+
Equipped with this model, we can then perform RL in the learned latent space of the predictive model. We posit—and confirm experimentally—that our latent variable model provides a useful representation for RL. Our model represents a partially observed Markov decision process (POMDP), and solving such a POMDP exactly would be computationally intractable (Astrom, 1965; Kaelbling et al., 1998; Igl et al., 2018). We instead propose a simple approximation that trains a Markovian critic on the (stochastic) latent state and trains an actor on a history of observations and actions. The resulting stochastic latent actor-critic (SLAC) algorithm loses some of the benefits of full POMDP solvers, but it is easy and stable to train. It also produces good results, in practice, on a range of challenging problems, making it an appealing alternative to more complex POMDP solution methods.
|
| 16 |
+
|
| 17 |
+
The main contributions of our SLAC algorithm are useful representations learned from our stochastic sequential latent variable model, as well as effective RL in this learned latent space. We show experimentally that our approach substantially improves on both model-free and model-based RL algorithms on a range of image-based continuous control benchmark tasks, attaining better final performance and learning more quickly than algorithms based on (a) end-to-end deep RL from images, (b) learning in a latent space produced by various alternative latent variable models, such as a variational autoencoder (VAE) (Kingma & Welling, 2014), and (c) model-based RL based on latent state-space models with partially stochastic variables (Hafner et al., 2019).
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Representation learning in RL. End-to-end deep RL can in principle learn representations directly as part of the RL process (Mnih et al., 2013). However, prior work has observed that RL has a “representation learning bottleneck”: a considerable portion of the learning period must be spent acquiring good representations of the observation space (Shelhamer et al., 2016). This motivates the use of a distinct representation learning procedure to acquire these representations before the agent has even learned to solve the task. The use of auxiliary supervision in RL to learn such representations has been explored in a number of prior works (Lange & Riedmiller, 2010; Finn et al., 2016; Jaderberg et al., 2017; Higgins et al., 2017; Ha & Schmidhuber, 2018; Nair et al., 2018; Oord et al., 2018; Gelada et al., 2019; Dadashi et al., 2019). In contrast to this class of representation learning algorithms, we explicitly learn a latent variable model of the POMDP, in which the latent representation and latent-space dynamics are jointly learned. By modeling covariances between consecutive latent states, we make it feasible for our proposed algorithm to perform Bellman backups directly in the latent space of the learned model.
|
| 22 |
+
|
| 23 |
+
Partial observability in RL. Our work is also related to prior research on RL under partial observability. Prior work has studied exact and approximate solutions to POMDPs, but they require explicit models of the POMDP and are only practical for simpler domains (Kaelbling et al., 1998). Recent work has proposed end-to-end RL methods that use recurrent neural networks to process histories of observations and (sometimes) actions, but without constructing a model of the POMDP (Hausknecht & Stone, 2015; Foerster et al., 2016; Zhu et al., 2018). Other works, however, learn latent-space dynamical system models and then use them to solve the POMDP with model-based RL (Watter et al., 2015; Wahlström et al., 2015; Karl et al., 2017; Zhang et al., 2019; Hafner et al., 2019).
|
| 24 |
+
|
| 25 |
+
Although some of these works learn latent variable models that are similar to ours, these model-based methods are often limited by compounding model errors and finite horizon optimization. In contrast to these works, our approach does not use the model for prediction and performs infinite horizon policy optimization. Our approach benefits from the good asymptotic performance of model-free RL, while at the same time leveraging the improved latent space representation for sample efficiency. Other works have also trained latent variable models and used their representations as the inputs to model-free RL algorithms. They use representations encoded from latent states sampled from the forward model (Buesing et al., 2018), belief representations obtained from particle filtering (Igl et al., 2018), or belief representations obtained directly from a learned belief-space forward model (Gregor et al., 2019). Our approach is closely related to these prior methods, in that we also use model-free RL with a latent state representation that is learned via prediction. However, instead of using belief representations, our method learns a critic directly on latent states samples.
|
| 26 |
+
|
| 27 |
+
Sequential latent variable models. Several previous works have explored various modeling choices to learn stochastic sequential models (Krishnan et al., 2015; Archer et al., 2015; Karl et al., 2016; Fraccaro et al., 2016; 2017; Doerr et al., 2018a). In the context of using sequential models for RL, previous works have typically observed that partially stochastic state space models are more effective than fully stochastic ones (Buesing et al., 2018; Igl et al., 2018; Hafner et al., 2019). In these models, the state of the underlying MDP is modeled with the deterministic state of a recurrent network (e.g., LSTM (Hochreiter & Schmidhuber, 1997) or GRU (Cho et al., 2014)), and optionally with some stochastic random variables. As mentioned earlier, a model with a latent state that is entirely stochastic has the appealing interpretation of learning a representation that can properly represent uncertainty about any of the state variables, given past observations. We demonstrate in our work that fully stochastic state space models can in fact be learned effectively and, with a well-designed stochastic network, such models perform on par to partially stochastic models and outperform fully deterministic models.
|
| 28 |
+
|
| 29 |
+
# 3 REINFORCEMENT LEARNING AND MODELING
|
| 30 |
+
|
| 31 |
+
This work addresses the problem of learning maximum entropy policies from high-dimensional observations in POMDPs, by simultaneously learning a latent representation of the underlying MDP state using variational inference and learning the policy in a maximum entropy RL framework. In this section, we describe maximum entropy RL (Ziebart, 2010; Haarnoja et al., 2018a; Levine, 2018) in fully observable MDPs, as well as variational methods for training latent state space models for POMDPs.
|
| 32 |
+
|
| 33 |
+
# 3.1 MAXIMUM ENTROPY RL IN FULLY OBSERVABLE MDPS
|
| 34 |
+
|
| 35 |
+
In a Markov decision process (MDP), an agent at time $t$ takes an action $\mathbf { a } _ { t } \in \mathcal A$ from state $\mathbf { s } _ { t } \in \cal { S }$ and reaches the next state $\mathbf { s } _ { t + 1 } \in S$ according to some stochastic transition dynamics $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . The initial state ${ \bf s } _ { 1 }$ comes from a distribution $p ( \mathbf { s } _ { 1 } )$ , and the agent receives a reward $r _ { t }$ on each of the transitions. Standard RL aims to learn the parameters $\phi$ of some policy $\pi _ { \phi } ( \mathbf { a } _ { t } | \mathbf { s } _ { t } )$ such that the expected sum of rewards is maximized under the induced trajectory distribution $\rho _ { \pi }$ . This objective can be modified to incorporate an entropy term, such that the policy also aims to maximize the expected entropy $\mathcal { H } ( \pi _ { \phi } ( \cdot | \mathbf { s } _ { t } ) )$ under the induced trajectory distribution $\rho _ { \pi }$ . This formulation has a close connection to variational inference (Ziebart, 2010; Haarnoja et al., 2018a; Levine, 2018), and we build on this in our work. The resulting maximum entropy objective is
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\boldsymbol { \phi } ^ { * } = \arg \operatorname* { m a x } _ { \boldsymbol { \phi } } \sum _ { t = 1 } ^ { T } \underset { ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \sim \rho _ { \pi } } { \mathbb { E } } [ r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) + \alpha \mathcal { H } ( \pi _ { \boldsymbol { \phi } } ( \cdot | \mathbf { s } _ { t } ) ) ] ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $r$ is the reward function, and $\alpha$ is a temperature parameter that controls the trade-off between optimizing for the reward and for the entropy (i.e., stochasticity) of the policy. Soft actor-critic (SAC) (Haarnoja et al., 2018a) uses this maximum entropy RL framework to derive soft policy iteration, which alternates between policy evaluation and policy improvement within the described maximum entropy framework. SAC then extends this soft policy iteration to handle continuous action spaces by using parameterized function approximators to represent both the Q-function $Q _ { \theta }$ (critic) and the policy $\pi _ { \phi }$ (actor). The soft Q-function parameters $\theta$ are optimized to minimize the
|
| 42 |
+
|
| 43 |
+
soft Bellman residual,
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l } & { \quad J _ { Q } ( \theta ) = \underset { ( \mathbf { s } _ { t } , \mathbf { a } _ { t } , r _ { t } , \mathbf { s } _ { t + 1 } ) \sim \mathcal { D } } { \mathbb { E } } \left[ \frac { 1 } { 2 } \left( Q _ { \theta } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) - ( r _ { t } + \gamma V _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } ) ) \right) ^ { 2 } \right] , } \\ & { V _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } ) = \underset { \mathbf { a } _ { t + 1 } \sim \pi _ { \phi } } { \mathbb { E } } \left[ Q _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } , \mathbf { a } _ { t + 1 } ) - \alpha \log \pi _ { \phi } ( \mathbf { a } _ { t + 1 } | \mathbf { s } _ { t + 1 } ) \right] , } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\mathcal { D }$ is the replay buffer, $\gamma$ is the discount factor, and $\bar { \theta }$ are delayed parameters. The policy parameters $\phi$ are optimized to update the policy towards the exponential of the soft Q-function,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
J _ { \pi } ( \phi ) = \underset { \mathbf { s } _ { t } \sim \mathcal { D } } { \mathbb { E } } \left[ \underset { \mathbf { a } _ { t } \sim \pi _ { \phi } } { \mathbb { E } } \left[ \alpha \log ( \pi _ { \phi } ( \mathbf { a } _ { t } \vert \mathbf { s } _ { t } ) ) - Q _ { \theta } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] \right] .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Results of this stochastic, entropy maximizing RL framework demonstrate improved robustness and stability. SAC also shows the sample efficiency benefits of an off-policy learning algorithm, in conjunction with the high performance benefits of a long-horizon planning algorithm. Precisely for these reasons, we choose to extend the SAC algorithm in this work to formulate our SLAC algorithm.
|
| 56 |
+
|
| 57 |
+
3.2 SEQUENTIAL LATENT VARIABLE MODELS AND AMORTIZED VARIATIONAL INFERENCE IN POMDPS
|
| 58 |
+
|
| 59 |
+
To learn representations for RL, we use latent variable models trained with amortized variational inference. The learned model must be able to process a large number of pixels that are present in the entangled image $\mathbf { x }$ , and it must tease out the relevant information into a compact and disentangled representation $\mathbf { z }$ . To learn such a model, we can consider maximizing the probability of each observed datapoint $\mathbf { x }$ from some training set $\mathcal { D }$ under the entire generative process $\begin{array} { r } { p ( \mathbf { x } ) \stackrel { \mathbf { \theta } } { = } \int p ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) \mathrm { d } \mathbf { z } } \end{array}$ . This objective is intractable to compute in general due to the marginalization of the latent variables $\mathbf { z }$ . In amortized variational inference, we utilize the following bound on the log-likelihood (Kingma $\&$ Welling, 2014),
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { E _ { \mathbf { x } \sim D } \left[ \log p ( \mathbf { x } ) \right] \geq E _ { \mathbf { x } \sim D } \left[ E _ { \mathbf { z } \sim q } \left[ \log p ( \mathbf { x } | \mathbf { z } ) \right] - \mathrm { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } | \mathbf { x } ) \ \Vert \ p ( \mathbf { z } ) \right) \right] . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
We can maximize the probability of the observed datapoints (i.e., the left hand side of Equation (5)) by learning an encoder $q ( \mathbf { z } | \mathbf { x } )$ and a decoder $p ( \mathbf { x } | \mathbf { z } )$ , and then directly performing gradient ascent on the right hand side of the equation. In this setup, the distributions of interest are the prior $p ( \mathbf { z } )$ , the observation model $p ( \mathbf { x } | \mathbf { z } )$ , and the posterior $q ( \mathbf { z } | \mathbf { x } )$ .
|
| 66 |
+
|
| 67 |
+
Although such generative models have been shown to successfully model various types of complex distributions (Kingma & Welling, 2014) by embedding knowledge of the distribution into an informative latent space, they do not have a built-in mechanism for the use of temporal information when performing inference. In the case of partially observable environments, as we discuss below, the representative latent state $\mathbf { z } _ { t }$ corresponding to a given non-Markovian observation $\mathbf { x } _ { t }$ needs to be informed by past observations.
|
| 68 |
+
|
| 69 |
+
Consider a partially observable MDP (POMDP), where an action $\mathbf { a } _ { t } \in \mathcal A$ from latent state $\mathbf { z } _ { t } \in { \mathcal { Z } }$ results in latent state $\mathbf { z } _ { t + 1 } \in \mathcal { Z }$ and emits a corresponding observation $\mathbf { x } _ { t + 1 } \in \mathcal { X }$ . We make an explicit distinction between an observation $\mathbf { x } _ { t }$ and the underlying latent state $\mathbf { z } _ { t }$ , to emphasize that the latter is unobserved and the distribution is not known a priori. Analogous to the fully observable MDP, the initial state distribution is $p ( \mathbf { z } _ { 1 } )$ , the transition probability distribution is $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , and the reward is $r _ { t }$ . In addition, the observation model is given by $\dot { p } ( { \mathbf x } _ { t } | { \mathbf z } _ { t } )$ .
|
| 70 |
+
|
| 71 |
+
As in the case for VAEs, a generative model of these observations $\mathbf { x } _ { t }$ can be learned by maximizing the log-likelihood. In the POMDP setting, however, we note that $\mathbf { x } _ { t }$ alone does not provide all necessary information to infer $\mathbf { z } _ { t }$ , and thus, prior temporal information must be taken into account. This brings us to the discussion of sequential latent variable models. The distributions of interest are the priors $p ( \mathbf { z } _ { 1 } )$ and $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , the observation model $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , and the approximate posteriors $q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . The log-likehood of the observations can then be bounded, similarly to the VAE bound in Equation (5), as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { l } { { \displaystyle \log p ( { \bf x } _ { 1 : \tau + 1 } | { \bf a } _ { 1 : \tau } ) \geq \sum _ { z _ { 1 : \tau + 1 } \sim q } \left[ \sum _ { t = 1 } ^ { \tau + 1 } \log p ( { \bf x } _ { t } | { \bf z } _ { t } ) - \mathrm { D } _ { \mathrm { K L } } \left( q ( { \bf z } _ { 1 } | { \bf x } _ { 1 } ) \parallel p ( { \bf z } _ { 1 } ) \right) \right. } \ ~ } \\ { { \displaystyle \left. - \sum _ { t = 1 } ^ { \tau } \mathrm { D } _ { \mathrm { K L } } \left( q ( { \bf z } _ { t + 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } , { \bf a } _ { t } ) \parallel p ( { \bf z } _ { t + 1 } | { \bf z } _ { t } , { \bf a } _ { t } ) \right) \right] . } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Prior work (Hafner et al., 2019; Buesing et al., 2018; Doerr et al., 2018b) has explored modeling such non-Markovian observation sequences, using methods such as recurrent neural networks with deterministic hidden state, as well as probabilistic state-space models. In this work, we enable the effective training of a fully stochastic sequential latent variable model, and bring it together with a maximum entropy actor-critic RL algorithm to create SLAC: a sample-efficient and highperforming RL algorithm for learning policies for complex continuous control tasks directly from high-dimensional image inputs.
|
| 78 |
+
|
| 79 |
+
# 4 JOINT MODELING AND CONTROL AS INFERENCE
|
| 80 |
+
|
| 81 |
+
Our method aims to learn maximum entropy policies from high-dimensional, non-Markovian observations in a POMDP, while also learning a model of that POMDP. The model alleviates the representation learning problem, which in turn helps with the policy learning problem. We formulate the control problem as inference in a probabilistic graphical model with latent variables, as shown in Figure 1.
|
| 82 |
+
|
| 83 |
+
For a fully observable MDP, the control problem can be embedded into a graphical model by introducing a binary random variable ${ \mathcal { O } } _ { t }$ , which indicates if time step $t$ is optimal. When its distribution is chosen to be $p ( \mathcal { O } _ { t } = 1 | \mathbf { s } _ { t } , \mathbf { a } _ { t } ) = \exp \left( r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right)$ , then maximization of $p ( \mathcal { O } _ { 1 : T } )$ via approximate inference in that model yields the optimal policy for the maximum entropy objective (Levine, 2018).
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 1: Graphical model of POMDP with optimality variables for $t \geq \tau + 1$ .
|
| 87 |
+
|
| 88 |
+
In a POMDP setting, the distribution can analogously be given by $p ( \mathcal { O } _ { t } = 1 | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = \exp ( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) )$ . Instead of maximizing the likelihood of the optimality variables alone, we jointly model the observations (including the observed rewards of the past time steps) and learn maximum entropy policies by maximizing the marginal likelihood $p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } )$ . This objective represents both the likelihood of the observed data from the past $\tau$ steps, as well as the optimality of the agent’s actions for future steps. We factorize our variational distribution into a product of recognition terms $q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , dynamics terms $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , and policy terms $\pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } { { q ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) } \quad } & { } \\ & { = q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \prod _ { t = 1 } ^ { \tau } q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) . } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
The variational distribution uses the dynamics for future time steps to prevent the agent from controlling the transitions and from choosing optimistic actions (Levine, 2018). The posterior over the actions represents the agent’s policy $\pi$ . Although this derivation uses a policy that is conditioned on the latent state, our algorithm, which will be described in the next section, learns a parametric policy that is directly conditioned on observations and actions. This approximation allows us to directly execute the policy without having to perform inference on the latent state at run time.
|
| 95 |
+
|
| 96 |
+
We use the posterior from Equation (7) to obtain the evidence lower bound (ELBO) of the marginal likelihood,
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \log p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } ) \geq \underset { ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } ) \sim q } { \mathbb { E } } \left[ \underset { t = 1 } { \overset { \tau + 1 } { \sum } } \log p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) \right. } \\ & { ~ \left. - \operatorname { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \parallel p ( \mathbf { z } _ { 1 } ) \right) - \underset { t = 1 } { \overset { \tau } { \sum } } \operatorname { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \parallel p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \right) \right. } \\ & { ~ \left. ~ + \underset { t = \tau + 1 } { \overset { T } { \sum } } \left( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \log p ( \mathbf { a } _ { t } ) - \log \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) \right) \right] , } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $p ( \mathbf { a } _ { t } )$ is the action prior. The full derivation of the ELBO is given in Appendix A. This derivation assumes that the reward function, which determines $p ( \mathcal { O } _ { t } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , is known. However, in many RL problems, this is not the case. In that situation, we can simply append the reward to the observation, and learn the reward along with $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ . This requires no modification to our method other than changing the observation space, and we use this approach in all of our experiments. We do this to learn latent representations that are more relevant to the task, but we do not use predictions from it. Instead, the RL objective uses rewards from the agent’s experience, as in model-free RL.
|
| 103 |
+
|
| 104 |
+
# 5 STOCHASTIC LATENT ACTOR CRITIC
|
| 105 |
+
|
| 106 |
+
We now describe our stochastic latent actor critic (SLAC) algorithm, which approximately maximizes the ELBO using function approximators to model the prior and posterior distributions. The ELBO objective in Equation (8) can be split into a model objective and a maximum entropy RL objective. The model objective can directly be optimized, while the maximum entropy RL objective can be solved via message passing. We can learn Q-functions for the messages, and then we can rewrite the RL objective to express it in terms of these messages. Additional details of the derivation of the SLAC objectives are given in Appendix A.
|
| 107 |
+
|
| 108 |
+
Latent Variable Model: The first part of the ELBO corresponds to training the latent variable model to maximize the likelihood of the observations, analogous to the ELBO in Equation (6) for the sequential latent variable model. The distributions of the latent variable model are diagonal Gaussian distributions, where the means and variances are outputs of neural networks. The distribution parameters $\psi$ of this model are optimized to maximize the first part of the ELBO. The model loss is
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { l } \displaystyle { J _ { M } ( \psi ) = \underset { ( \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } , r _ { 1 : \tau } ) \sim \mathcal { D } } { \mathbb { E } } [ \underset { \mathbf { z } _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } [ \sum _ { t = 1 } ^ { \tau + 1 } \log p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) } \\ { \displaystyle - \mathrm { D } _ { \mathrm { K L } } ( q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) ) \| p _ { \psi } ( \mathbf { z } _ { 1 } ) ) - \sum _ { t = 1 } ^ { \tau } \mathrm { D } _ { \mathrm { K L } } ( q _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \parallel p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) ] ] . } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We use the reparameterization trick to sample from the filtering distribution $q _ { \psi } ( \mathbf { z } _ { 1 : \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$
|
| 115 |
+
|
| 116 |
+
Critic and Actor: The second part of the ELBO corresponds to the maximum entropy RL objective. As in the fully observable case from Section 3.1 and as described by Levine (2018), this optimization can be solved via message passing of soft $\mathbf { Q }$ -values, except that we use the latent states $\mathbf { z }$ rather than the true states s. For continuous state and action spaces, this message passing is approximated by minimizing the soft Bellman residual, which we use to train our soft Q-function parameters $\theta$ ,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { r l } & { J _ { Q } ( \theta ) = \underset { ( \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } , r _ { \tau } ) \sim \mathcal { D } } { \mathbb { E } } \left[ \underset { \mathbf { z } _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \frac { 1 } { 2 } \left( Q _ { \theta } ( \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) \right. \right. \right. } \\ & { \left. \left. \left. - \left( r _ { \tau } + \gamma _ { \mathbf { a } _ { \tau + 1 } \sim \pi _ { \psi } } \mathbb { E } _ { \bar { \theta } } ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) - \alpha \log \pi _ { \phi } ( \mathbf { a } _ { \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) \right] \right) \right) ^ { 2 } \right] , } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\bar { \theta }$ are delayed parameters, obtained as exponential moving averages of $\theta$ . Notice that the latents ${ \bf z } _ { \tau }$ and $\mathbf { z } _ { \tau + 1 }$ , which are used in the Bellman backup, are sampled from the same joint, i.e. $\mathbf { z } _ { \tau + 1 } \sim q _ { \psi } ( \mathbf { z } _ { \tau + 1 } | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } )$ . The RL objective, which corresponds to the second part of the ELBO, can be rewritten in terms of the soft Q-function. The policy parameters $\phi$ are optimized to maximize this objective, analogously to soft actor-critic (Haarnoja et al., 2018a). The policy loss is then
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
J _ { \pi } ( \phi ) = \underset { ( \mathbf x _ { 1 : \tau + 1 } , \mathbf a _ { 1 : \tau } ) \sim \mathcal D } { \mathbb { E } } \left[ \underset { \mathbf z _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \underset { \mathbf a _ { \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \alpha \log \pi _ { \phi } ( \mathbf a _ { \tau + 1 } | \mathbf x _ { 1 : \tau + 1 } , \mathbf a _ { 1 : \tau } ) - Q _ { \theta } ( \mathbf z _ { \tau + 1 } , \mathbf a _ { \tau + 1 } ) \right] \right] \right] .
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
We assume a uniform action prior, so $p ( \mathbf { a } _ { t } )$ is a constant term that we omit from the policy loss. We use the reparameterization trick to sample from the policy, and the policy loss only uses the last sample $\mathbf { z } _ { \tau + 1 }$ of the sequence for the critic. Although the policy used in our derivation is conditioned in the latent state, our learned parametric policy is conditioned directly on the past observations and actions, so that the learned policy can be executed at run time without requiring inference of the latent state. Finally, we note that for the expectation over latent states in the Bellman residual in Equation (10), rather than sampling latent states $\mathbf { z } \sim \mathcal { Z }$ , we sample latent states from the filtering distribution $q _ { \psi } ( \mathbf { z } _ { 1 : \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$ . This design choice allows us to minimize the critic loss for samples that are most relevant for $Q$ , while also allowing the critic loss to use the Q-function in the same way as implied by the policy loss in Equation (11).
|
| 129 |
+
|
| 130 |
+
SLAC is outlined in Algorithm 1. The actor-critic component follows prior work, with automatic tuning of the temperature $\alpha$ and two Q-functions to mitigate underestimation (Fujimoto et al., 2018; Haarnoja et al., 2018a;b). SLAC can be viewed as a variant of SAC (Haarnoja et al., 2018a) where the critic is trained on the stochastic latent state of our sequential latent variable model. The backup for the critic is performed on a tuple $\left( \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } , r _ { \tau } , \mathbf { z } _ { \tau + 1 } \right)$ , sampled from the posterior $q ( \mathbf { z } _ { \tau + 1 } , \mathbf { z } _ { \tau } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$ . The critic can, in principle, take advantage of the perfect knowledge of the state $\mathbf { z } _ { t }$ , which makes learning easier. However, the parametric policy does not have access to $\mathbf { z } _ { t }$ , and must make decisions based on a history of observations and actions. SLAC is not a model-based algorithm, in that in does not use the model for prediction, but we see in our experiments that SLAC can achieve similar sample efficiency as a model-based algorithm.
|
| 131 |
+
|
| 132 |
+
<table><tr><td colspan="2">Algorithm1StochasticLatentActor-Critic(SLAC) Require: E,γ,01,02,Φ</td></tr><tr><td>X1~Ereset() D↑(x1)</td><td>>Environment and initial parameters for model, actor, and critic > Sample initial observation from the environment >Initialize replay buffer with initial observation</td></tr><tr><td>for each iteration do</td><td></td></tr><tr><td>for each environment step do at ~ π(at|X1:t,a1:t-1)</td><td>> Sample action from the policy</td></tr><tr><td>rt,Xt+1 ~ Estep(at)</td><td>>Sample transition from the environment</td></tr><tr><td>D ← DU(at,rt,Xt+1)</td><td>> Store the transition in the replay buffer</td></tr><tr><td></td><td></td></tr><tr><td>for each gradient step do</td><td></td></tr><tr><td>←φ-λM∀JM(φ)</td><td>Update model weights</td></tr><tr><td>θ←0-入QVθJQ(0i) fori∈{1,2}</td><td>>Update the Q-function weights</td></tr><tr><td>Φ←Φ-λπ∀Jπ(Φ)</td><td>Update policy weights</td></tr><tr><td>θ←vi+(1-v)θ fori∈{1,2}</td><td>>Update target critic network weights</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 6 LATENT VARIABLE MODEL
|
| 135 |
+
|
| 136 |
+
We briefly summarize our full model architecture here, with full details in Appendix B. Motivated by the recent success of autoregressive latent variables in VAEs (Razavi et al., 2019; Maaloe et al., 2019), we factorize the latent variable $\mathbf { z } _ { t }$ into two stochastic layers, ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$ , as shown in Figure 2. This factorization results in latent distributions that are more expressive, and it allows for some parts of the prior and posterior distributions to be shared. We found this design to produce high quality reconstructions and samples, and utilize it in all of our experiments. The generative model $p$ and the inference model $q$ are given by
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { \quad p _ { \psi } ( { \bf z } _ { 1 } ) = p _ { \psi } ( { \bf z } _ { 1 } ^ { 2 } | { \bf z } _ { 1 } ^ { 1 } ) p ( { \bf z } _ { 1 } ^ { 1 } ) , } \\ & { \quad p _ { \psi } ( { \bf z } _ { t + 1 } | { \bf z } _ { t } , { \bf a } _ { t } ) = p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 2 } | { \bf z } _ { t + 1 } ^ { 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 1 } | { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) , } \\ & { \quad \quad q _ { \psi } ( { \bf z } _ { 1 } | { \bf x } _ { 1 } ) = p _ { \psi } ( { \bf z } _ { 1 } ^ { 2 } | { \bf z } _ { 1 } ^ { 1 } ) q _ { \psi } ( { \bf z } _ { 1 } ^ { 1 } | { \bf x } _ { 1 } ) , } \\ & { \quad q _ { \psi } ( { \bf z } _ { t + 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } , { \bf a } _ { t } ) = p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 2 } | { \bf z } _ { t + 1 } ^ { 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) q _ { \psi } ( { \bf z } _ { t + 1 } ^ { 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Note that we choose the variational distribution $q$ over ${ \bf z } _ { t } ^ { 2 }$ to be the same as the model $p$ . Thus, the KL divergence in $J _ { M }$ simplifies to the divergence between $q$ and $p$ over ${ \bf z } _ { t } ^ { 1 }$ . We use a multivariate standard normal distribution for $p ( \mathbf { z } _ { 1 } ^ { 1 } )$ , since it is not conditioned on any variables, i.e. ${ \bf z } _ { 1 } ^ { 1 } \sim \mathcal { N } ( { \bf 0 } , I )$ . The conditional distributions of our model are diagonal Gaussian, with means and variances given by neural networks. Unlike models from prior work (Hafner et al., 2019; Buesing et al., 2018; Doerr et al., 2018b), which have deterministic and stochastic paths and use recurrent neural networks, ours is fully stochastic, i.e. our latent state is a Markovian latent random variable formed by the concatenation of ${ \bf z } _ { t } ^ { 1 }$ and $ { \mathbf { z } } _ { t } ^ { 2 }$ . Further details are discussed in Appendix B.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Diagram of our full model. Solid arrows show the generative model, dashed arrows show the inference model. Rewards are not shown for clarity.
|
| 146 |
+
|
| 147 |
+
# 7 EXPERIMENTAL EVALUATION
|
| 148 |
+
|
| 149 |
+
We evaluate SLAC on numerous image-based continuous control tasks from both the DeepMind Control Suite (Tassa et al., 2018) and OpenAI Gym (Brockman et al., 2016), as illustrated in Figure 3. Full details of SLAC’s network architecture are described in Appendix B. Aside from the value of action repeats (i.e. control frequency) for the tasks, we kept all of SLAC’s hyperparameters constant across all tasks in all domains. Training and evaluation details are given in Appendix C, and image samples from our model for all tasks are shown in Appendix D. Additionally, visualizations of our results and code are available on the project website.2
|
| 150 |
+
|
| 151 |
+
# 7.1 COMPARATIVE EVALUATION ON CONTINUOUS CONTROL BENCHMARK TASKS
|
| 152 |
+
|
| 153 |
+
To provide a comparative evaluation against prior methods, we evaluate SLAC on four tasks (cheetah run, walker walk, ball-in-cup catch, finger spin) from the DeepMind Control Suite (Tassa et al., 2018), and four tasks (cheetah, walker, ant, hopper) from OpenAI Gym (Brockman et al., 2016). Note that the Gym tasks are typically used with low-dimensional state observations, while we evaluate on them with raw image observations. We compare our method to the following state-of-the-art model-based and model-free algorithms:
|
| 154 |
+
|
| 155 |
+
SAC (Haarnoja et al., 2018a): This is an off-policy actor-critic algorithm, which represents a comparison to state-of-the-art model-free learning. We include experiments showing the performance of SAC based on true state (as an upper bound on performance) as well as directly from raw images.
|
| 156 |
+
|
| 157 |
+
MPO (Abdolmaleki et al., 2018b;a): This is an off-policy actor-critic algorithm that performs an expectation maximization form of policy iteration, learning directly from raw images.
|
| 158 |
+
|
| 159 |
+
D4PG (Barth-Maron et al., 2018): This is also an off-policy actor-critic algorithm, learning directly from raw images. The results reported in the plots below are the performance after $1 0 ^ { 8 }$ training steps, as stated in the benchmarks from (Tassa et al., 2018).
|
| 160 |
+
|
| 161 |
+
PlaNet (Hafner et al., 2019): This is a model-based RL method for learning from images, which uses a partially stochastic sequential latent variable model, but without explicit policy learning. Instead, the model is used for planning with model predictive control (MPC), where each plan is optimized with the cross entropy method (CEM).
|
| 162 |
+
|
| 163 |
+
DVRL (Igl et al., 2018): This is an on-policy model-free RL algorithm that also trains a partially stochastic latent-variable POMDP model. DVRL uses the full belief over the latent state as input into both the actor and critic, as opposed to our method, which trains the critic with the latent state and the actor with a history of actions and observations.
|
| 164 |
+
|
| 165 |
+
Our experiments on the DeepMind Control Suite in Figure 4 show that the sample efficiency of SLAC is comparable or better than both model-based and model-free alternatives. This indicates that overcoming the representation learning bottleneck, coupled with efficient off-policy RL, provides for fast learning similar to model-based methods, while attaining final performance comparable to fully model-free techniques that learn from state. SLAC also substantially outperforms DVRL. This difference can be explained in part by the use of an efficient off-policy RL algorithm, which can better take advantage of the learned representation.
|
| 166 |
+
|
| 167 |
+
We also evaluate SLAC on continuous control benchmark tasks from OpenAI Gym in Figure 5. We notice that these tasks are much more challenging than the DeepMind Control Suite tasks, because the rewards are not as shaped and not bounded between 0 and 1, the dynamics are different, and the episodes terminate on failure (e.g., when the hopper or walker falls over). PlaNet is unable to solve the last three tasks, while for the cheetah task, it learns a suboptimal policy that involves flipping the cheetah over and pushing forward while on its back. To better understand the performance of fixed-horizon MPC on these tasks, we also evaluated with the ground truth dynamics (i.e., the true simulator), and found that even in this case, MPC did not achieve good final performance, suggesting that infinite horizon policy optimization, of the sort performed by SLAC and model-free algorithms, is important to attain good results on these tasks.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Example image observations for our continuous control benchmark tasks: DeepMind Control’s cheetah run, walker walk, ball-in-cup catch, and finger spin, and OpenAI Gym’s half cheetah, walker, hopper, and ant (left to right). Images are rendered at a resolution of $6 4 \times 6 4$ pixels.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 4: Experiments on the DeepMind Control Suite from images (unless otherwise labeled as "state"). SLAC (ours) converges to similar or better final performance than the other methods, while almost always achieving reward as high as the upper bound SAC baseline that learns from true state. Note that for these experiments, 1000 environments steps corresponds to 1 episode.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: Experiments on the OpenAI Gym benchmark tasks from images. SLAC (ours) converges to higher performance than both PlaNet and SAC on all four of these tasks. The number of environments steps in each episode is variable, depending on the termination.
|
| 177 |
+
|
| 178 |
+
Our experiments show that SLAC successfully learns complex continuous control benchmark tasks from raw image inputs. On the DeepMind Control Suite, SLAC exceeds the performance of PlaNet on three of the tasks, and matches its performance on the walker task. However, on the harder image-based OpenAI Gym tasks, SLAC outperforms PlaNet by a large margin. In both domains, SLAC substantially outperforms all prior model-free methods. We note that the prior methods that we tested generally performed poorly on the image-based OpenAI Gym tasks, despite considerable hyperparameter tuning.
|
| 179 |
+
|
| 180 |
+
# 7.2 EVALUATING THE LATENT VARIABLE MODEL
|
| 181 |
+
|
| 182 |
+
We next study the tradeoffs between different design choices for the latent variable model. We compare our fully stochastic model, as described in Section 6, to a standard non-sequential VAE model (Kingma & Welling, 2014), which has been used in multiple prior works for representation learning in RL (Higgins et al., 2017; Ha & Schmidhuber, 2018; Nair et al., 2018), the partially stochastic model used by PlaNet (Hafner et al., 2019), as well as three variants of our model: a simple filtering model that does not factorize the latent variable into two layers of stochastic units, a fully deterministic model that removes all stochasticity from the hidden state dynamics, and a partially stochastic model that has both deterministic and stochastic transitions, similar to the PlaNet model, but with our architecture. Both the fully deterministic and partially stochastic models use the same architecture as our fully stochastic model, including the same two-level factorization of the latent variable. In all cases, we use the RL framework of SLAC and only vary the choice of model for representation learning. As shown in the comparison in Figure 6, our fully stochastic model outperforms prior models as well as the deterministic and simple variants of our own model. The partially stochastic variant of our model matches the performance of our fully stochastic model but, contrary to the conclusions in prior work (Hafner et al., 2019; Buesing et al., 2018), the fully stochastic model performs on par, while retaining the appealing interpretation of a stochastic state space model. We hypothesize that these prior works benefit from the deterministic paths (realized as an LSTM or GRU) because they use multi-step samples from the prior. In contrast, our method uses samples from the posterior, which are conditioned on same-step observations, and thus these latent samples are less sensitive to the propagation of the latent states through time.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 6: Comparison of different design choices for the latent variable model.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 7: Example image sequence seen for the cheetah task (first row), corresponding posterior sample (reconstruction) from our model (second row), and generated prediction from the generative model (last two rows). The second to last row is conditioned on the first frame (i.e., the posterior model is used for the first time step while the prior model is used for all subsequent steps), whereas the last row is not conditioned on any ground truth images. Note that all of these sampled sequences are conditioned on the same action sequence, and that our model produces highly realistic samples, even when predicting via the generative model.
|
| 189 |
+
|
| 190 |
+
# 7.3 QUALITATIVE PREDICTIONS FROM THE LATENT VARIABLE MODEL
|
| 191 |
+
|
| 192 |
+
We show example image samples from our learned sequential latent variable model for the cheetah task in Figure 7, and we include the other tasks in Appendix D. Samples from the posterior show the images $\mathbf { x } _ { t }$ as constructed by the decoder $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , using a sequence of latents $\mathbf { z } _ { t }$ that are encoded and sampled from the posteriors, $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } \big )$ . Samples from the prior, on the other hand, use a sequence of latents where $\mathbf { z } _ { 1 }$ is sampled from $p ( \mathbf { z } _ { 1 } )$ and all remaining latents $\mathbf { z } _ { t }$ are from the propagation of the previous latent state through the latent dynamics $p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . Note that these prior samples do not use any image frames as inputs, and thus they do not correspond to any ground truth sequence. We also show samples from the conditional prior, which is conditioned on the first image from the true sequence: for this, the sampling procedure is the same as the prior, except that $\mathbf { z } _ { 1 }$ is encoded and sampled from the posterior $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ , rather than being sampled from $p ( \mathbf { z } _ { 1 } )$ . We notice that the generated images samples can be sharper and more realistic by using a smaller variance for $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ when training the model, but at the expense of a representation that leads to lower returns. Finally, note that we do not actually use the samples from the prior for training.
|
| 193 |
+
|
| 194 |
+
# 8 DISCUSSION
|
| 195 |
+
|
| 196 |
+
We presented SLAC, an efficient RL algorithm for learning from high-dimensional image inputs that combines efficient off-policy model-free RL with representation learning via a sequential stochastic state space model. Through representation learning in conjunction with effective task learning in the learned latent space, our method achieves improved sample efficiency and final task performance as compared to both prior model-based and model-free RL methods.
|
| 197 |
+
|
| 198 |
+
While our current SLAC algorithm is fully model-free, in that predictions from the model are not utilized to speed up training, a natural extension of our approach would be to use the model predictions themselves to generate synthetic samples. Incorporating this additional synthetic modelbased data into a mixed model-based/model-free method could further improve sample efficiency and performance. More broadly, the use of explicit representation learning with RL has the potential to not only accelerate training time and increase the complexity of achievable tasks, but also enable reuse and transfer of our learned representation across tasks.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Jonas Degrave, Steven Bohez, Yuval Tassa, Dan Belov, Nicolas Heess, and Martin A. Riedmiller. Relative entropy regularized policy iteration. arXiv preprint arXiv:1812.02256, 2018a.
|
| 203 |
+
|
| 204 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Rémi Munos, Nicolas Heess, and Martin A. Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations (ICLR), 2018b.
|
| 205 |
+
|
| 206 |
+
Evan Archer, Il Memming Park, Lars Buesing, John Cunningham, and Liam Paninski. Black box variational inference for state space models. arXiv preprint arXiv:1511.07367, 2015.
|
| 207 |
+
|
| 208 |
+
Karl J Astrom. Optimal control of markov processes with incomplete state information. Journal of mathematical analysis and applications, 1965.
|
| 209 |
+
|
| 210 |
+
Gabriel Barth-Maron, Matthew W Hoffman, David Budden, Will Dabney, Dan Horgan, Alistair Muldal, Nicolas Heess, and Timothy Lillicrap. Distributed distributional deterministic policy gradients. In International Conference on Learning Representations (ICLR), 2018.
|
| 211 |
+
|
| 212 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 213 |
+
|
| 214 |
+
Lars Buesing, Theophane Weber, Sébastien Racanière, S. M. Ali Eslami, Danilo Jimenez Rezende, David P. Reichert, Fabio Viola, Frederic Besse, Karol Gregor, Demis Hassabis, and Daan Wierstra. Learning and querying fast generative models for reinforcement learning. arXiv preprint arXiv:1802.03006, 2018.
|
| 215 |
+
|
| 216 |
+
Kyunghyun Cho, Bart van Merriënboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, ˘ Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2014.
|
| 217 |
+
|
| 218 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 219 |
+
|
| 220 |
+
Robert Dadashi, Adrien Ali Taïga, Nicolas Le Roux, Dale Schuurmans, and Marc G Bellemare. The value function polytope in reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
|
| 221 |
+
|
| 222 |
+
Marc Deisenroth and Carl E Rasmussen. PILCO: A model-based and data-efficient approach to policy search. In International Conference on Machine Learning (ICML), 2011.
|
| 223 |
+
|
| 224 |
+
Andreas Doerr, Christian Daniel, Martin Schiegg, Nguyen-Tuong Duy, Stefan Schaal, Marc Toussaint, and Trimpe Sebastian. Probabilistic recurrent state-space models. In International Conference on Machine Learning (ICML), 2018a.
|
| 225 |
+
|
| 226 |
+
Andreas Doerr, Christian Daniel, Martin Schiegg, Duy Nguyen-Tuong, Stefan Schaal, Marc Toussaint, and Sebastian Trimpe. Probabilistic recurrent state-space models. In International Conference on Machine Learning (ICML), 2018b.
|
| 227 |
+
|
| 228 |
+
Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In International Conference on Robotics and Automation (ICRA), 2017.
|
| 229 |
+
|
| 230 |
+
Chelsea Finn, Xin Yu Tan, Yan Duan, Trevor Darrell, Sergey Levine, and Pieter Abbeel. Deep spatial autoencoders for visuomotor learning. In International Conference on Robotics and Automation (ICRA), 2016.
|
| 231 |
+
|
| 232 |
+
Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Neural Information Processing Systems (NIPS), 2016.
|
| 233 |
+
|
| 234 |
+
Marco Fraccaro, Soren Kaae Sonderby, Ulrich Paquet, and Ole Winther. Sequential neural models with stochastic layers. In Neural Information Processing Systems (NIPS), 2016.
|
| 235 |
+
|
| 236 |
+
Marco Fraccaro, Simon Kamronn, Ulrich Paquet, and Ole Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. In Neural Information Processing Systems (NIPS), 2017.
|
| 237 |
+
|
| 238 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning (ICML), 2018.
|
| 239 |
+
|
| 240 |
+
Carles Gelada, Saurabh Kumar, Jacob Buckman, Ofir Nachum, and Marc G Bellemare. Deepmdp: Learning continuous latent space models for representation learning. In International Conference on Machine Learning (ICML), 2019.
|
| 241 |
+
|
| 242 |
+
Karol Gregor, Danilo Jimenez Rezende, Frederic Besse, Yan Wu, Hamza Merzic, and Aaron van den Oord. Shaping belief states with generative environment models for rl. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 243 |
+
|
| 244 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning (ICML), 2016.
|
| 245 |
+
|
| 246 |
+
David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018.
|
| 247 |
+
|
| 248 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning (ICML), 2018a.
|
| 249 |
+
|
| 250 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b.
|
| 251 |
+
|
| 252 |
+
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 (ICML), 2019.
|
| 253 |
+
|
| 254 |
+
Matthew Hausknecht and Peter Stone. Deep recurrent Q-learning for partially observable MDPs. In AAAI Fall Symposium on Sequential Decision Making for Intelligent Agents, 2015.
|
| 255 |
+
|
| 256 |
+
Irina Higgins, Arka Pal, Andrei Rusu, Loic Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. In International Conference on Machine Learning (ICML), 2017.
|
| 257 |
+
|
| 258 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 1997.
|
| 259 |
+
|
| 260 |
+
Maximilian Igl, Luisa Zintgraf, Tuan Anh Le, Frank Wood, and Shimon Whiteson. Deep variational reinforcement learning for POMDPs. In International Conference on Machine Learning (ICML), 2018.
|
| 261 |
+
|
| 262 |
+
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 (ICLR), 2017.
|
| 263 |
+
|
| 264 |
+
Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial intelligence, 101(1-2):99–134, 1998.
|
| 265 |
+
|
| 266 |
+
Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. In International Conference on Learning Representations (ICLR), 2016.
|
| 267 |
+
|
| 268 |
+
Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. In International Conference on Learning Representations (ICLR), 2017.
|
| 269 |
+
|
| 270 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 271 |
+
|
| 272 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2014.
|
| 273 |
+
|
| 274 |
+
Rahul G. Krishnan, Uri Shalit, and David Sontag. Deep kalman filters. arXiv preprint arXiv:1511.05121, 2015.
|
| 275 |
+
|
| 276 |
+
Sascha Lange and Martin Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In International Joint Conference on Neural Networks (IJCNN), 2010.
|
| 277 |
+
|
| 278 |
+
Sergey Levine. Reinforcement learning and control as probabilistic inference: Tutorial and review. arXiv preprint arXiv:1805.00909, 2018.
|
| 279 |
+
|
| 280 |
+
Lars Maaloe, Marco Fraccaro, Valentin Liévin, and Ole Winther. Biva: A very deep hierarchy of latent variables for generative modeling. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 281 |
+
|
| 282 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing Atari with deep reinforcement learning. In NIPS Deep Learning Workshop, 2013.
|
| 283 |
+
|
| 284 |
+
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 International Conference on Robotics and Automation (ICRA), 2018.
|
| 285 |
+
|
| 286 |
+
Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 287 |
+
|
| 288 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 289 |
+
|
| 290 |
+
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. 2019.
|
| 291 |
+
|
| 292 |
+
Evan Shelhamer, Parsa Mahmoudieh, Max Argus, and Trevor Darrell. Loss is its own reward: Self-supervision for reinforcement learning. arXiv preprint arXiv:1612.07307, 2016.
|
| 293 |
+
|
| 294 |
+
Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM SIGART Bulletin, 2(4):160–163, 1991.
|
| 295 |
+
|
| 296 |
+
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. arXiv preprint arXiv:1801.00690, 2018.
|
| 297 |
+
|
| 298 |
+
Niklas Wahlström, Thomas B Schön, and Marc Peter Deisenroth. From pixels to torques: Policy learning with deep dynamical models. arXiv preprint arXiv:1502.02251, 2015.
|
| 299 |
+
|
| 300 |
+
Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Neural Information Processing Systems (NIPS), 2015.
|
| 301 |
+
|
| 302 |
+
Marvin Zhang, Sharad Vikram, Laura Smith, Pieter Abbeel, Matthew J Johnson, and Sergey Levine. SOLAR: Deep structured latent representations for model-based reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
|
| 303 |
+
|
| 304 |
+
Pengfei Zhu, Xin Li, Pascal Poupart, and Guanghui Miao. On improving deep reinforcement learning for POMDPs. arXiv preprint arXiv:1804.06309, 2018.
|
| 305 |
+
|
| 306 |
+
Brian D Ziebart. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. 2010.
|
| 307 |
+
|
| 308 |
+
# A DERIVATION OF THE EVIDENCE LOWER BOUND AND SLAC OBJECTIVES
|
| 309 |
+
|
| 310 |
+
In this appendix, we discuss how the SLAC objectives can be derived from applying a variational inference scheme to the control as inference framework for reinforcement learning (Levine, 2018) . In this framework, the problem of finding the optimal policy is cast as an inference problem, conditioned on the evidence that the agent is behaving optimally. While Levine (2018) derives this in the fully observed case, we present a derivation in the POMDP setting.
|
| 311 |
+
|
| 312 |
+
We aim to maximize the marginal likelihood $p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } )$ , where $\tau$ is the number of steps that the agent has already taken. This likelihood reflects that the agent cannot modify the past $\tau$ actions and they might have not been optimal, but it can choose the future actions up to the end of the episode, such that the chosen future actions are optimal. Notice that unlike the standard control as inference framework, in this work we not only maximize the likelihood of the optimality variables but also the likelihood of the observations, which provides additional supervision for the latent representation. This does not come up in the MDP setting since the state representation is fixed and learning a dynamics model of the state would not change the model-free equations derived from the maximum entropy RL objective.
|
| 313 |
+
|
| 314 |
+
For reference, we restate the factorization of our variational distribution:
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\begin{array} { r l } { q ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) } & { } \\ { = q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \displaystyle \prod _ { t = 1 } ^ { \tau } q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) . } \end{array}
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
As discussed by Levine (2018), the agent does not have control over the stochastic dynamics, so we use the dynamics $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ for $t \geq \tau + 1$ in the variational distribution in order to prevent the agent from choosing optimistic actions.
|
| 321 |
+
|
| 322 |
+
The joint likelihood is
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r l } & { p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } , \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } ) } \\ & { \qquad \quad \quad \quad \quad \tau - 1 } \\ & { \qquad = p ( \mathbf { z } _ { 1 } ) \displaystyle \prod _ { t = 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = 1 } ^ { \tau + 1 } p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } p ( \mathcal { O } _ { t } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } p ( \mathbf { a } _ { t } ) . } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
We use the posterior from Equation (12) and Jensen’s inequality to obtain the ELBO of the marginal likelihood,
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r l } & { \log p ( { \mathbf x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } ) \mathbf { a } _ { 1 : \tau } ) } \\ & { \qquad = \log \displaystyle \int _ { z _ { 1 : T } \mathbf { a } _ { \star + 1 : T } } \int _ { \mathbf { \alpha } } p ( { \mathbf x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } , \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | { \mathbf a } _ { 1 : \tau } ) \mathrm { d } \mathbf { z } _ { 1 : T } \mathrm { d } { \mathbf a } _ { \tau + 1 : T } } \\ & { \qquad \quad \stackrel { \mathrm { \scriptsize ~ \sum ~ } } { \geq } \displaystyle _ { ( \mathbf { \alpha } _ { 1 : T } , \mathbf { a } _ { \star + 1 : T } ) \times \tau } [ \displaystyle \sum _ { \ell = 1 } ^ { r + 1 } \log p ( { \mathbf x } _ { \ell } | \mathbf { z } _ { \ell } ) } \\ & { \qquad \quad - \mathrm { \textstyle ~ D e L } ( q ( { \mathbf z } _ { 1 } | \mathbf { x } _ { 1 } ) | | p ( { \mathbf z } _ { 1 } ) ) - \displaystyle \sum _ { \ell = 1 } ^ { T } \mathrm { D } _ { \mathrm { K L } } ( q ( { \mathbf z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) | | p ( { \mathbf z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) } \\ & { \qquad \quad + \displaystyle \sum _ { \ell = r + 1 } ^ { T } ( r ( { \mathbf z } _ { t } , \mathbf { a } _ { t } ) + \log p ( { \mathbf a } _ { t } ) - \log \pi ( { \mathbf a } _ { t } | \mathbf { z } _ { t } ) ) ] . } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Notice that the dynamics terms $\log p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ for $t \geq \tau + 1$ from the posterior and the prior cancel each other out in the ELBO.
|
| 335 |
+
|
| 336 |
+
The first part of the ELBO corresponds to the model objective. When using the parametric function approximators, the negative of it corresponds directly to the model loss in Equation (9).
|
| 337 |
+
|
| 338 |
+
The second part of the ELBO corresponds to the maximum entropy RL objective. We assume a uniform action prior, so the $\log p ( \mathbf { a } _ { t } )$ term is a constant term that can be omitted when optimizing
|
| 339 |
+
|
| 340 |
+
this objective. We use message passing to optimize this objective, with messages defined as
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r l } & { Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \underset { \mathbf { z } _ { t + 1 } \sim q ( \cdot | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) } { \mathbb { E } } \left[ V ( \mathbf { z } _ { t + 1 } ) \right] } \\ & { ~ V ( \mathbf { z } _ { t } ) = \log \int \exp ( Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) \mathrm { d } \mathbf { a } _ { t } . } \\ & { ~ \mathbf { a } _ { t } } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Then, the maximum entropy RL objective can be expressed in terms of the messages as
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r l } & { \displaystyle \mathop { \mathbb { E } } _ { ( \mathbf { z } _ { \tau + 1 : T } , \mathbf { a } _ { \tau + 1 : T } ) \sim q } [ \displaystyle \sum _ { t = \tau + 1 } ^ { T } ( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) - \log \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) ) ] } \\ & { \displaystyle = \mathop { \mathbb { E } } _ { \mathbf { z } _ { \tau + 1 } \sim q ( \cdot | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) } [ \mathbf { a } _ { \tau + 1 \sim \pi ( \cdot | \mathbf { z } _ { \tau + 1 } ) } [ Q ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) - \log \pi ( \mathbf { a } _ { \tau + 1 } | \mathbf { z } _ { \tau + 1 } ) ] ] } \\ & { \displaystyle = \mathop { \mathbb { E } } _ { \mathbf { z } _ { \tau + 1 } \sim q ( \cdot | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) } [ - \mathrm { D } _ { \mathrm { K L } } ( \pi ( \mathbf { a } _ { \tau + 1 } | \mathbf { z } _ { \tau + 1 } ) \displaystyle \frac { \exp ( Q ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) ) } { \exp ( V ( \mathbf { z } _ { \tau + 1 } ) ) } ) + V ( \mathbf { z } _ { \tau + 1 } ) ] , } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
where the first equality is obtained from dynamic programming (see Levine (2018) for details), the second equality holds from the definition of KL divergence, and $\exp \left( V ( \mathbf { z } _ { t } ) \right)$ is the normalization factor for $\exp { ( Q ( { \bf z } _ { t } , { \bf a } _ { t } ) ) }$ with respect to $\mathbf { a } _ { t }$ . Since the KL divergence term is minimized when its two arguments represent the same distribution, the optimal policy is given by
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) = \exp { ( Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) - V ( \mathbf { z } _ { t } ) ) } .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Noting that the KL divergence term is zero for the optimal action, the equality from Equation (18) can be used in Equation (15) to obtain
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathcal { Q } ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \mathop { \mathbb { E } } _ { \substack { \mathbf { z } _ { t + 1 } \sim \mathbf { q } ( \cdot | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) } } \left[ \mathop { \mathbb { E } } _ { \mathbf { a } _ { \tau + 1 } \sim \pi \left( \cdot | \mathbf { z } _ { \tau + 1 } \right) } \left[ Q ( \mathbf { z } _ { t + 1 } , \mathbf { a } _ { t + 1 } ) - \log \pi ( \mathbf { a } _ { t + 1 } | \mathbf { z } _ { t + 1 } ) \right] \right] .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
This equation corresponds to the standard Bellman backup with a soft maximization for the value function.
|
| 365 |
+
|
| 366 |
+
As mentioned in Section 5, our algorithm conditions the parametric policy in the history of observations and actions, which allows us to directly execute the policy without having to perform inference on the latent state at run time. When using the parametric function approximators, the negative of the maximum entropy RL objective, written as in Equation (17), corresponds to the policy loss in Equation (11). Lastly, the Bellman backup of Equation (20) corresponds to the Bellman residual in Equation (10) when approximated by a regression objective.
|
| 367 |
+
|
| 368 |
+
We showed that the SLAC objectives can be derived from applying variational inference in the control as inference framework in the POMDP setting. This leads to the joint likelihood of the past observations and future optimality variables, which we aim to optimize by maximizing the ELBO of the log-likelihood. We decompose the ELBO into the model objective and the maximum entropy RL objective. We express the latter in terms of messages of Q-functions, which in turn are learned by minimizing the Bellman residual. These objectives lead to the model, policy, and critic losses.
|
| 369 |
+
|
| 370 |
+
# B NETWORK ARCHITECTURES
|
| 371 |
+
|
| 372 |
+
Recall that our full sequential latent variable model has two layers of latent variables, which we denote ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$ . We found this design to provide a good balance between ease of training and expressivity, producing good reconstructions and generations and, crucially, providing good representations for reinforcement learning. For reference, we reproduce the model diagram from the main paper in Figure 8. Note that this diagram represents the Bayes net corresponding to our full model. However, since all of the latent variables are stochastic, this visualization also presents the design of the computation graph. Inference over the latent variables is performed using amortized variational inference, with all training done via reparameterization. Hence, the computation graph can be deduced from the diagram by treating all solid arrows as part of the generative model and all dashed arrows as part of approximate posterior. The generative model consists of the following probability distributions, as described in the main paper:
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 8: Diagram of our full model, reproduced from the main paper. Solid arrows show the generative model, dashed arrows show the inference model. Rewards are not shown for clarity.
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r l } & { \mathbf { z } _ { 1 } ^ { 1 } \sim p ( \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \quad \mathbf { z } _ { 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } | \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 1 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } | \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } | \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \quad \mathbf { x } _ { t } \sim p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } ) } \\ & { \quad \quad r _ { t } \sim p _ { \psi } ( r _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } , \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t + 1 } ^ { 2 } ) . } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
The initial distribution $p ( \mathbf { z } _ { 1 } ^ { 1 } )$ is a multivariate standard normal distribution $\mathcal { N } ( \mathbf { 0 } , \pmb { I } )$ . All of the other distributions are conditional and parameterized by neural networks with parameters $\psi$ . The networks for $p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } | \mathbf { z } _ { 1 } ^ { 1 } )$ , $p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } | \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } )$ , $\dot { p } _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } | \mathbf { z } _ { t + 1 } ^ { 1 } , \dot { \mathbf { z } } _ { t } ^ { 2 } , \mathbf { a } _ { t } )$ , and $p _ { \psi } ( r _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { \hat { z } } _ { t } ^ { 2 } , \mathbf { a } _ { t } , \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t + 1 } ^ { 2 } )$ consist of two fully connected layers, each with 256 hidden units, and a Gaussian output layer. The Gaussian layer is defined such that it outputs a multivariate normal distribution with diagonal variance, where the mean is the output of a linear layer and the diagonal standard deviation is the output of a fully connected layer with softplus non-linearity. The observation model $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } )$ consists of 5 transposed convolutional layers $( 2 5 6 ~ 4 \times 4 , ~ 1 2 8 ~ 3 \times 3 , 6 4 ~ 3 \times 3 , 3 2 ~ 3 \times 3$ , and $3 \ 5 \times 5$ filters, respectively, stride 2 each, except for the first layer). The output variance for each image pixel is fixed to 0.1.
|
| 382 |
+
|
| 383 |
+
The variational distribution $q$ , also referred to as the inference model or the posterior, is represented by the following factorization:
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \mathbf { z } _ { 1 } ^ { 1 } \sim q _ { \psi } ( \mathbf { z } _ { 1 } ^ { 1 } \vert \mathbf { x } _ { 1 } ) } \\ & { \mathbf { z } _ { 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } \vert \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 1 } \sim q _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } \vert \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } \vert \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) . } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Note that the variational distribution over $\mathbf { z } _ { 1 } ^ { 2 }$ and $\mathbf { z } _ { t + 1 } ^ { 2 }$ is intentionally chosen to exactly match the generative model $p$ , such that this term does not appear in the KL-divergence within the ELBO, and a separate variational distribution is only learned over $\mathbf { z } _ { 1 } ^ { 1 }$ and $\mathbf { z } _ { t + 1 } ^ { 1 }$ . This intentional design decision simplifies the inference process. The networks representing the distributions $q _ { \psi } ( \mathbf { z } _ { 1 } ^ { 1 } | \mathbf { x } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } ^ { 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } \big )$ both consist of 5 convolutional layers $3 2 5 \times 5$ , $6 4 3 \times 3$ , $1 2 8 3 \times 3$ , $2 5 6 3 \times 3$ , and $2 5 6 4 \times 4$ filters, respectively, stride 2 each, except for the last layer), 2 fully connected layers (256 units each), and a Gaussian output layer. The parameters of the convolution layers are shared among both distributions.
|
| 390 |
+
|
| 391 |
+
The latent variables have 32 and 256 dimensions, respectively, i.e. $\mathbf { z } _ { t } ^ { 1 } \in \mathbb { R } ^ { 3 2 }$ and $\mathbf { z } _ { t } ^ { 2 } \in \mathbb { R } ^ { 2 5 6 }$ . For the image observations, $\mathbf { x } _ { t } \in [ 0 , 1 ] ^ { 6 4 \times 6 4 \times 3 }$ . All the layers, except for the output layers, use leaky ReLU non-linearities. Note that there are no deterministic recurrent connections in the network—all networks are feedforward, and the temporal dependencies all flow through the stochastic units ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$
|
| 392 |
+
|
| 393 |
+
For the reinforcement learning process, we use a critic network $Q _ { \theta }$ consisting of 2 fully connected layers (256 units each) and a linear output layer. The actor network $\pi _ { \phi }$ consists of 5 convolutional layers, 2 fully connected layers (256 units each), a Gaussian layer, and a tanh bijector, which constrains the actions to be in the bounded action space of $[ - 1 , 1 ]$ . The convolutional layers are the same as the ones from the latent variable model, but the parameters of these layers are not updated by the actor objective. The same exact network architecture is used for every one of the experiments in the paper.
|
| 394 |
+
|
| 395 |
+
Table 1: Action repeats and the corresponding agent’s control time step used in our experiments.
|
| 396 |
+
|
| 397 |
+
<table><tr><td>Benchmark</td><td>Task</td><td>Action repeat</td><td>Original control time step</td><td>Effective control time step</td></tr><tr><td rowspan="4">DeepMind Control Suite</td><td>cheetah run</td><td>4</td><td>0.01</td><td>0.04</td></tr><tr><td>walker walk</td><td>2</td><td>0.025</td><td>0.05</td></tr><tr><td>ball-in-cup catch</td><td>4</td><td>0.02</td><td>0.08</td></tr><tr><td>finger spin</td><td>2</td><td>0.02</td><td>0.04</td></tr><tr><td rowspan="4">OpenAI Gym</td><td>HalfCheetah-v2</td><td>1</td><td>0.05</td><td>0.05</td></tr><tr><td>Walker2d-v2</td><td>4</td><td>0.008</td><td>0.032</td></tr><tr><td>Hopper-v2</td><td>2</td><td>0.008</td><td>0.016</td></tr><tr><td>Ant-v2</td><td>4</td><td>0.05</td><td>0.2</td></tr></table>
|
| 398 |
+
|
| 399 |
+
# C TRAINING AND EVALUATION DETAILS
|
| 400 |
+
|
| 401 |
+
The control portion of our algorithm uses the same hyperparameters as SAC (Haarnoja et al., 2018a), except for a smaller replay buffer size of 100000 environment steps (instead of a million) due to the high memory usage of image observations. All of the parameters are trained with the Adam optimizer (Kingma & Ba, 2015), and we perform one gradient step per environment step. The Q-function and policy parameters are trained with a learning rate of 0.0003 and a batch size of 256. The model parameters are trained with a learning rate of 0.0001 and a batch size of 32. We use sequences of length $\tau = 8$ for all the tasks. Note that the sequence length can be less than $\tau$ for the first $t$ steps $( t < \tau$ ) of each episode.
|
| 402 |
+
|
| 403 |
+
We use action repeats for all the methods, except for D4PG for which we use the reported results from prior work (Tassa et al., 2018). The number of environment steps reported in our plots correspond to the unmodified steps of the benchmarks. Note that the methods that use action repeats only use a fraction of the environment steps reported in our plots. For example, 3 million environment steps of the cheetah task correspond to 750000 samples when using an action repeat of 4. The action repeats used in our experiments are given in Table 1.
|
| 404 |
+
|
| 405 |
+
Unlike in prior work (Haarnoja et al., 2018a;b), we use the same stochastic policy as both the behavioral and evaluation policy since we found the deterministic greedy policy to be comparable or worse than the stochastic policy.
|
| 406 |
+
|
| 407 |
+
# D ADDITIONAL PREDICTIONS FROM THE LATENT VARIABLE MODEL
|
| 408 |
+
|
| 409 |
+
We show additional samples from our model in Figure 9 and Figure 10. Samples from the posterior show the images $\mathbf { x } _ { t }$ as constructed by the decoder $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , using a sequence of latents $\mathbf { z } _ { t }$ that are encoded and sampled from the posteriors, $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { \dot { x } } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } \big )$ . Samples from the prior, on the other hand, use a sequence of latents where $\mathbf { z } _ { 1 }$ is sampled from $p ( \mathbf { z } _ { 1 } )$ and all remaining latents $\mathbf { z } _ { t }$ are from the propagation of the previous latent state through the latent dynamics $p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . These samples do not use any image frames as inputs, and thus they do not correspond to any ground truth sequence. We also show samples from the conditional prior, which is conditioned on the first image from the true sequence: for this, the sampling procedure is the same as the prior, except that $\mathbf { z } _ { 1 }$ is encoded and sampled from the posterior $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ , rather than being sampled from $p ( \mathbf { z } _ { 1 } )$ .
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 9: Example image sequences, along with generated image samples, for three of the DM Control tasks that we used in our experiments. See Figure 7 for more details and for image samples from the cheetah task.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 10: Example image sequences, along with generated image samples, for the four OpenAI Gym tasks that we used in our experiments.
|
md/train/HkuVu3ige/HkuVu3ige.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON ORTHOGONALITY AND LEARNING RECURRENTNETWORKS WITH LONG TERM DEPENDENCIES
|
| 2 |
+
|
| 3 |
+
Eugene Vorontsov 1,2, Chiheb Trabelsi 1,2, Samuel Kadoury 1,3, Chris Pal 1,2
|
| 4 |
+
|
| 5 |
+
1 Ecole Polytechnique de Montr ´ eal, Montr ´ eal, Canada ´ 2 Montreal Institute for Learning Algorithms, Montreal, Canada ´ 3 CHUM Research Center, Montreal, Canada ´ {eugene.vorontsov, chiheb.trabelsi, samuel.kadoury, christopher.pal}@polymtl.ca
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
It is well known that it is challenging to train deep neural networks and recurrent neural networks for tasks that exhibit long term dependencies. The vanishing or exploding gradient problem is a well known issue associated with these challenges. One approach to addressing vanishing and exploding gradients is to use either soft or hard constraints on weight matrices so as to encourage or enforce orthogonality. Orthogonal matrices preserve gradient norm during backpropagation and can therefore be a desirable property; however, we find that hard constraints on orthogonality can negatively affect the speed of convergence and model performance. This paper explores the issues of optimization convergence, speed and gradient stability using a variety of different methods for encouraging or enforcing orthogonality. In particular we propose a weight matrix factorization and parameterization strategy through which we can bound matrix norms and therein control the degree of expansivity induced during backpropagation.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The depth of deep neural networks confers representational power, but also makes model optimization more challenging. Training deep networks with gradient descent based methods is known to be difficult as a consequence of the vanishing and exploding gradient problem (Hochreiter & Schmidhuber, 1997). Typically, exploding gradients are avoided by clipping large gradients (Pascanu et al., 2013) or introducing an $L _ { 2 }$ or $L _ { 1 }$ weight norm penalty. The latter has the effect of bounding the spectral radius of the linear transformations, thus limiting the maximal gain across the transformation. Krueger & Memisevic (2015) attempt to stabilize the norm of propagating signals directly by penalizing differences in successive norm pairs in the forward pass and Pascanu et al. (2013) propose to penalize successive gradient norm pairs in the backward pass. These regularizers affect the network parameterization with respect to the data instead of penalizing weights directly.
|
| 14 |
+
|
| 15 |
+
Both expansivity and contractivity of linear transformations can also be limited by more tightly bounding their spectra. By limiting the transformations to be orthogonal, their singular spectra are limited to unitary gain causing the transformations to be norm-preserving. Le et al. (2015) and Henaff et al. (2016) have respectively shown that identity initialization and orthogonal initialization can be beneficial. Arjovsky et al. (2015) have gone beyond initialization, building unitary recurrent neural network (RNN) models with transformations that are unitary by construction which they achieved by composing multiple basic unitary transformations. The resulting transformations, for some n-dimensional input, cover only some subset of possible $n \times n$ unitary matrices but appear to perform well on simple tasks and have the benefit of having low complexity in memory and computation.
|
| 16 |
+
|
| 17 |
+
The entire set of possible unitary or orthogonal parameterizations forms the Stiefel manifold. At a much higher computational cost, gradient descent optimization directly along this manifold can be done via geodesic steps (Nishimori, 2005; Tagare, 2011). Recent work (Wisdom et al., 2016) has proposed the optimization of unitary matrices along the Stiefel manifold using geodesic gradient descent. To produce a full-capacity parameterization for unitary matrices they use some insights from Tagare (2011), combining the use of a canonical inner products and Cayley transformations. Their experimental work indicates that full capacity unitary RNN models can solve the copy memory problem whereas both LSTM networks and restricted capacity unitary RNN models having similar complexity appear unable to solve the task for a longer sequence length ( $T = 2 0 0 0$ ).
|
| 18 |
+
|
| 19 |
+
In contrast, here we explore the optimization of real valued matrices within a configurable margin about the Stiefel manifold. We suspect that a strong constraint of orthogonality limits the model’s representational power, hindering its performance, and may make optimization more difficult. We explore this hypothesis empirically by employing a factorization technique that allows us to limit the degree of deviation from the Stiefel manifold. While we use geodesic gradient descent, we simultaneously update the singular spectra of our matrices along Euclidean steps, allowing optimization to step away from the manifold while still curving about it.
|
| 20 |
+
|
| 21 |
+
# 1.1 VANISHING AND EXPLODING GRADIENTS
|
| 22 |
+
|
| 23 |
+
The issue of vanishing and exploding gradients as it pertains to the parameterization of neural networks can be illuminated by looking at the gradient back-propagation chain through a network.
|
| 24 |
+
|
| 25 |
+
A neural network with $n$ hidden layers has pre-activations
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\mathbf { a } _ { i } ( \mathbf { h } _ { i - 1 } ) = \mathbf { W } _ { i } \mathbf { \ h } _ { i - 1 } + \mathbf { \ b } _ { i } , \ i \in \{ 2 , \cdots , n \}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
For notational convenience, we combine parameters $\mathbf { W } _ { i }$ and $\mathbf { b } _ { i }$ to form an affine matrix θ. We can see that for some loss function $L$ at layer $n$ , the derivative with respect to parameters $\theta _ { i }$ is:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\frac { \partial { \cal L } } { \partial \Theta _ { i } } = \frac { \partial { \bf a } _ { n + 1 } } { \partial \Theta _ { i } } \frac { \partial { \cal L } } { \partial { \bf a } _ { n + 1 } }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
The partial derivatives for the pre-activations can be decomposed as follows:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r l r } { { \frac { \partial \mathbf { a } _ { i + 1 } } { \partial \mathbf { \boldsymbol { \Theta } } _ { i } } = \frac { \partial \mathbf { a } _ { i } } { \partial \mathbf { \boldsymbol { \Theta } } _ { i } } \frac { \partial \mathbf { h } _ { i } } { \partial \mathbf { a } _ { i } } \frac { \partial \mathbf { a } _ { i + 1 } } { \partial \mathbf { h } _ { i } } } } \\ & { } & { = \frac { \partial \mathbf { a } _ { i } } { \partial \mathbf { \boldsymbol { \Theta } } _ { i } } \mathbf { \boldsymbol { D } } _ { i } \mathbf { \boldsymbol { W } } _ { i + 1 } \to \frac { \partial \mathbf { a } _ { i + 1 } } { \partial \mathbf { a } _ { i } } = \mathbf { \boldsymbol { D } } _ { i } \mathbf { \boldsymbol { W } } _ { i + 1 } , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\mathbf { D _ { i } }$ is the Jacobian corresponding to the activation function, containing partial derivatives of the hidden units at layer $i + 1$ with respect to the pre-activation inputs. Typically, $\mathbf { D }$ is diagonal. Following the above, the gradient in equation 2 can be fully decomposed into a recursive chain of matrix products:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\frac { \partial L } { \partial \pmb { \theta } _ { i } } = \frac { \partial \mathbf { a } _ { i } } { \partial \pmb { \theta } _ { i } } \prod _ { j = i } ^ { n } ( \mathbf { D } _ { j } \mathbf { W } _ { j + 1 } ) \frac { \partial L } { \partial \mathbf { a } _ { n + 1 } }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
In (Pascanu et al., 2013), it is shown that the 2-norm of $\frac { \partial \mathbf { a } _ { i + 1 } } { \partial \mathbf { a } _ { i } }$ is bounded by the product of the norms of the non-linearity’s Jacobian and transition matrix at time $t$ (layer $i$ ), as follows:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\left\| \frac { \partial \mathbf { a } _ { t + 1 } } { \partial \mathbf { a } _ { t } } \right\| \leq \left\| \mathbf { D } _ { t } \right\| \left\| \mathbf { W } _ { t } \right\| \leq \lambda _ { \mathbf { D } _ { t } } \lambda _ { \mathbf { W } _ { t } } = \eta _ { t } ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\lambda _ { \mathbf { D } _ { t } }$ and $\lambda _ { \mathbf { W } _ { t } }$ are the largest singular values of the non-linearity’s Jacobian $\mathbf { D } _ { t }$ and the transition matrix $\mathbf { W } _ { t }$ . In RNNs, $\mathbf { W } _ { t }$ is shared across time and can be simply denoted as $\mathbf { W }$ .
|
| 56 |
+
|
| 57 |
+
Equation 5 shows that the gradient can grow or shrink at each layer depending on the gain of each layer’s linear transformation $\mathbf { W }$ and the gain of the Jacobian $\mathbf { D }$ . The gain caused by each layer is magnified across all time steps or layers. It is easy to have extreme amplification in a recurrent neural network where $\mathbf { W }$ is shared across time steps and a non-unitary gain in W is amplified exponentially. The phenomena of extreme growth or contraction of the gradient across time steps or layers are known as the exploding and the vanishing gradient problems, respectively. It is sufficient for RNNs to have $\eta _ { t } \leq 1$ at each time $t$ to enable the possibility of vanishing gradients, typically for some large number of time steps $T$ . The rate at which a gradient (or forward signal) vanishes depends on both the parameterization of the model and on the input data. The parameterization may be conditioned by placing appropriate constraints on W. It is worth keeping in mind that the Jacobian $\mathbf { D }$ is typically contractive, thus tending to be norm-reducing) and is also data-dependent, whereas W can vary from being contractive to norm-preserving, to expansive and applies the same gain on the forward signal as on the back-propagated gradient signal.
|
| 58 |
+
|
| 59 |
+
# 2 OUR APPROACH
|
| 60 |
+
|
| 61 |
+
Vanishing and exploding gradients can be controlled to a large extent by controlling the maximum and minimum gain of $\mathbf { W }$ . The maximum gain of a matrix $\mathbf { W }$ is given by the spectral norm which is given by
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
| | \mathbf { W } | | _ { 2 } = \operatorname* { m a x } \left[ \frac { | | \mathbf { W } \mathbf { x } | | } { | | \mathbf { x } | | } \right] .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
By keeping our weight matrix W close to orthogonal, one can ensure that it is close to a normpreserving transformation (where the spectral norm is equal to one, but the minimum gain is also one). One way to achieve this is via a simple soft constraint or regularization term of the form:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\lambda \sum _ { i } | | \mathbf { W } _ { i } ^ { T } \mathbf { W } _ { i } - \mathbf { I } | | ^ { 2 } .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
However, it is possible to formulate a more direct parameterization or factorization for W which permits hard bounds on the amount of expansion and contraction induced by W. This can be achieved by simply parameterizing $\mathbf { W }$ according to its singular value decomposition, which consists of the composition of orthogonal basis matrices $\mathbf { U }$ and $\mathbf { V }$ with a diagonal spectral matrix S containing the singular values which are real and positive by definition. We have
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbf { W } = \mathbf { U } \mathbf { S } \mathbf { V } ^ { T } .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Since the spectral norm or maximum gain of a matrix is equal to its largest singular value, this decomposition allows us to control the maximum gain or expansivity of the weight matrix by controlling the magnitude of the largest singular value. Similarly, the minimum gain or contractivity of a matrix can be obtained from the minimum singular value.
|
| 80 |
+
|
| 81 |
+
We can keep the bases $\mathbf { U }$ and $\mathbf { V }$ orthogonal via geodesic gradient descent along the set of weights that satisfy $\mathbf { \dot { U } } ^ { T } \mathbf { U } = \mathbf { I }$ and $\mathbf { V } ^ { T } \mathbf { V } = \mathbf { I }$ respectively. The submanifolds that satisfy these constraints are called Stiefel manifolds. We discuss how this is achieved in more detail below, then discuss our construction for bounding the singular values.
|
| 82 |
+
|
| 83 |
+
During optimization, in order to maintain the orthogonality of an orthogonally-initialized matrix M, i.e. where $\mathbf { M } = \mathbf { U }$ , $\mathbf { M } = \mathbf { V }$ or $\mathbf { M } = \mathbf { W }$ if so desired, we employ a Cayley transformation of the update step onto the Stiefel manifold of (semi-)orthogonal matrices, as in Nishimori (2005) and Tagare (2011). Given an orthogonally-initialized parameter matrix $\mathbf { M }$ and its Jacobian, $\mathbf { G }$ with respect to the objective function, an update is performed as follows:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { l } { \mathbf { A } = \mathbf { G } \mathbf { M } ^ { T } - \mathbf { M } \mathbf { G } ^ { T } } \\ { \mathbf { M } _ { n e w } = \mathbf { M } + ( \mathbf { I } + \frac { \eta } { 2 } \mathbf { A } ) ^ { - 1 } ( \mathbf { I } - \frac { \eta } { 2 } \mathbf { A } ) , } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathbf { A }$ is a skew-symmetric matrix (that depends on the Jacobian and on the parameter matrix) which is mapped to an orthogonal matrix via a Cayley transform and $\eta$ is the learning rate.
|
| 90 |
+
|
| 91 |
+
While the update rule in (9) allows us to maintain an orthogonal hidden to hidden transition matrix W if desired, we are interested in exploring the effect of stepping away from the Stiefel manifold. As such, we parameterize the transition matrix W in factorized form, as a singular value decomposition with orthogonal bases $\mathbf { U }$ and $\mathbf { V }$ updated by geodesic gradient descent using the Cayley transform approach above.
|
| 92 |
+
|
| 93 |
+
If W is an orthogonal matrix, the singular values in the diagonal matrix S are all equal to one. However, in our formulation we allow these singular values to deviate from one and employ a sigmoidal parameterization to apply a hard constraint on the maximum and minimum amount of deviation. Specifically, we define a margin $m$ around 1 within which the singular values must lie. This is achieved with the parameterization
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
s _ { i } = 2 m ( \sigma ( p _ { i } ) - 0 . 5 ) + 1 , \qquad s _ { i } \in \{ \mathrm { d i a g } ( \mathbf { S } ) \} , \ m \in [ 0 , \ 1 ] .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
The singular values are thus restricted to the range $[ 1 - m , 1 + m ]$ and the underlying parameters $p _ { i }$ are updated freely via stochastic gradient descent. Note that this parameterization strategy also has implications on the step sizes that gradient descent based optimization will take when updating the singular values – they tend to be smaller compared to models with no margin constraining their values. Specifically, a singular value’s progression toward a margin is slowed the closer it is to the margin. The sigmoidal parameterization can also impart another effect on the step size along the spectrum which needs to be accounted for. Considering 10, the gradient backpropagation of some loss $L$ toward parameters $p _ { i }$ is found as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\frac { d L } { d p _ { i } } = \frac { d s _ { i } } { d p _ { i } } \frac { d L } { d s _ { i } } = 2 m \frac { d \sigma ( p _ { i } ) } { d p _ { i } } \frac { d L } { d s _ { i } } .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
From (11), it can be seen that the magnitude of the update step for $p _ { i }$ is scaled by the margin hyperparameter $m$ . This means for example that for margins less than one, the effective learning rate for the spectrum is reduced in proportion to the margin. Consequently, we adjust the learning rate along the spectrum to be independent of the margin by renormalizing it by ${ \it 2 m }$ .
|
| 106 |
+
|
| 107 |
+
This margin formulation both guarantees singular values lie within a well defined range and slows deviation from orthogonality. Alternatively, one could enforce the orthogonality of $\mathbf { U }$ and $\mathbf { V }$ and impose a regularization term corresponding to a mean one Gaussian prior on these singular values. This encourages the weight matrix W to be norm preserving with a controllable strength equivalent to the variance of the Gaussian. We also explore this approach further below.
|
| 108 |
+
|
| 109 |
+
# 3 EXPERIMENTS
|
| 110 |
+
|
| 111 |
+
In this section, we explore hard and soft orthogonality constraints on factorized weight matrices for recurrent neural network hidden to hidden transitions. With hard orthogonality constraints on $\mathbf { U }$ and $\mathbf { V }$ , we investigate the effect of widening the spectral margin or bounds on convergence and performance. Loosening these bounds allows increasingly larger margins within which the transition matrix W can deviate from orthogonality. We confirm that orthogonal initialization is useful as noted in Henaff et al. (2016), and we show that although strict orthogonality guarantees stable gradient norm, loosening orthogonality constraints can increase the rate of gradient descent convergence. We begin our analyses on tasks that are designed to stress memory: a sequence copying task and a basic addition task (Hochreiter & Schmidhuber, 1997). We then move on to tasks on real data that require models to capture long-range dependencies: digit classification based on sequential and permuted MNIST vectors (Le et al., 2015; LeCun et al., 1998). Finally, we look at a basic language modeling task using the Penn Treebank dataset (Marcus et al., 1993).
|
| 112 |
+
|
| 113 |
+
The copy and adding tasks, introduced by Hochreiter & Schmidhuber (1997), are synthetic benchmarks with pathologically hard long distance dependencies that require long-term memory in models. The copy task consists of an input sequence that must be remembered by the network, followed by a series of blank inputs terminated by a delimiter that denotes the point at which the network must begin to output a copy of the initial sequence. We use an input sequence of $T + 2 0$ elements that begins with a sub-sequence of 10 elements to copy, each containing a symbol $a _ { i } \in \{ a _ { 1 } , . . . , a _ { p } \}$ out of $p = \delta$ possible symbols. This sub-sequence is followed by $T - 1$ elements of the blank category $a _ { \theta }$ which is terminated at step $T$ by a delimiter symbol $a _ { p + 1 }$ and 10 more elements of the blank category. The network must learn to remember the initial 10 element sequence for $T$ time steps and output it after receiving the delimiter symbol.
|
| 114 |
+
|
| 115 |
+
The goal of the adding task is to add two numbers together after a long delay. Each number is randomly picked at a unique position in a sequence of length $T$ . The sequence is composed of $T$ values sampled from a uniform distribution in the range $[ 0 , 1 )$ , with each value paired with an indicator value that identifies the value as one of the two numbers to remember (marked 1) or as a value to ignore (marked 0). The two numbers are positioned randomly in the sequence, the first in the range $[ 0 , \frac { T } { 2 } - 1 ]$ and the second in the range $\begin{array} { r l r } { { [ \frac { T } { 2 } , T - 1 ] } } \end{array}$ , where 0 marks the first element. The network must learn to identify and remember the two numbers and output their sum.
|
| 116 |
+
|
| 117 |
+
The sequential MNIST task from Le et al. (2015), MNIST digits are flattened into vectors that can be traversed sequentially by a recurrent neural network. The goal is to classify the digit based on the sequential input of pixels. The simple variant of this task is with a simple flattening of the image matrices; the harder variant of this task includes a random permutation of the pixels in the input vector that is determined once for an experiment. The latter formulation introduces longer distance dependencies between pixels that must be interpreted by the classification model.
|
| 118 |
+
|
| 119 |
+
The English Penn Treebank (PTB) dataset from Marcus et al. (1993) is an annotated corpus of English sentences, commonly used for benchmarking language models. We employ a sequential character prediction task: given a sentence, a recurrent neural network must predict the next character at each step, from left to right. We use input sequences of variable length, with each sequence containing one sentence. We model 49 characters including lowercase letters (all strings are in lowercase), numbers, common punctuation, and an unknown character placeholder. In our experiments on two subsets of the data: in the first, we first use $23 \%$ of the data with strings with up to 75 characters and in the second we include over $9 9 \%$ of the dataset, picking strings with up to 300 characters.
|
| 120 |
+
|
| 121 |
+
# 3.1 LOOSENING HARD ORTHOGONALITY CONSTRAINTS
|
| 122 |
+
|
| 123 |
+
In this section, we experimentally explore the effect of loosening hard orthogonality constraints through loosening the spectral margin defined above for the hidden to hidden transition matrix.
|
| 124 |
+
|
| 125 |
+
In all experiments, we employed RMSprop (Tieleman & Hinton, 2012) when not using geodesic gradient descent. We used minibatches of size 50 and for generated data (the copy and adding tasks), we assumed an epoch length of 100 minibatches. We cautiously introduced gradient clipping at magnitude 100 (unless stated otherwise) in all of our RNN experiments although it may not be required and we consistently applied a small weight decay of 0.0001. Unless otherwise specified, we trained all simple recurrent neural networks with the hidden to hidden matrix factorization as in (8) using geodesic gradient descent on the bases (learning rate $1 0 ^ { - 6 }$ ) and RMSprop on the other parameters (learning rate 0.0001), using a tanh transition nonlinearity, and clipping gradients of 100 magnitude. The neural network code was built on the Theano framework (Theano Development Team, 2016). When parameterizing a matrix in factorized form, we apply the weight decay on the composite matrix rather than on the factors in order to be consistent across experiments. For MNIST and PTB, test set metrics were computed based on the parameterization that gave the best validation set accuracy.
|
| 126 |
+
|
| 127 |
+
# 3.1.1 CONVERGENCE ON SYNTHETIC MEMORY TASKS
|
| 128 |
+
|
| 129 |
+
For different sequence lengths $T$ of the copy and adding tasks, we trained a factorized RNN with 128 hidden units and various spectral margins $m$ . For the copy task, we used Elman networks without a transition non-linearity as in Henaff et al. (2016). We discuss our investigations into the use of a non-linearity on the copy task in the Appendix.
|
| 130 |
+
|
| 131 |
+
As shown in Figure 1 we see an increase in the rate of convergence as we increase the spectral margin. This observation generally holds across the tested sequence lengths ( $T = 2 0 0$ , $T \stackrel { = } { = } 5 0 0$ , $T = 1 0 0 0 , \ T = 1 0 0 0 0 )$ ; however, large spectral margins hinder convergence on extremely long sequence lengths. At sequence length $T = 1 0 0 0 0$ , parameterizations with spectral margins larger than 0.001 converge slower than when using a margin of 0.001. In addition, the experiment without a margin failed to converge on the longest sequence length. This follows the expected pattern where stepping away from the Stiefel manifold may help with gradient descent optimization but loosening orthogonality constraints can reduce the stability of signal propagation through the network.
|
| 132 |
+
|
| 133 |
+
For the adding task, we trained a factorized RNN on $T = 1 0 0 0$ length sequences, using a ReLU activation function on the hidden to hidden transition matrix. The mean squared error (MSE) is shown for different spectral margins in Figure 5 in the Appendix. Testing spectral margins $m = 0$ , $m = 1 , \ m = 1 0 , \ m = 1 0 0$ , and no margin, we find that the models with the purely orthogonal ( $\mathrm { ~ m ~ } = 0$ ) and the unconstrained (no margin) transition matrices failed to begin converging beyond baseline MSE within 2000 epochs.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 1: Accuracy curves on the copy task for sequence lengths of (from left to right) ${ \mathrm { T } } { = } 2 0 0$ , $\mathrm { T } { = } 5 0 0$ , $\scriptstyle \mathrm { T = 1 0 0 0 }$ , $\scriptstyle \mathrm { T = 1 0 0 0 0 }$ given different spectral margins. Convergence speed increases with margin size; however, large margin sizes are ineffective at longer sequence lengths $\mathrm { { T } = 1 0 0 0 0 }$ , right).
|
| 137 |
+
|
| 138 |
+
Table 1: Ordered sequential MNIST classification with different margin sizes and an LSTM.
|
| 139 |
+
|
| 140 |
+
<table><tr><td>margin</td><td>initialization</td><td>accuracy</td></tr><tr><td>0</td><td>orthogonal</td><td>77.18</td></tr><tr><td>0.001</td><td>orthogonal</td><td>79.26</td></tr><tr><td>0.01</td><td>orthogonal</td><td>85.47</td></tr><tr><td>0.1</td><td>orthogonal</td><td>94.10</td></tr><tr><td>1</td><td>orthogonal</td><td>93.84</td></tr><tr><td>none</td><td>orthogonal</td><td>93.24</td></tr><tr><td>none</td><td>Glorot normal</td><td>66.71</td></tr><tr><td>none</td><td>identity</td><td>53.53</td></tr><tr><td></td><td>LSTM</td><td>97.30</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 2: Permuted sequential MNIST classification with different margin sizes and an LSTM.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>margin</td><td>initialization</td><td>accuracy</td></tr><tr><td>0</td><td>orthogonal</td><td>83.56</td></tr><tr><td>0.001 0.01</td><td>orthogonal</td><td>84.59 89.63</td></tr><tr><td>0.1</td><td>orthogonal orthogonal</td><td>91.44</td></tr><tr><td>1</td><td>orthogonal</td><td>90.83</td></tr><tr><td>none</td><td>orthogonal</td><td>90.51</td></tr><tr><td>none</td><td>Glorot normal</td><td>79.33</td></tr><tr><td>none</td><td>identity</td><td></td></tr><tr><td></td><td>LSTM</td><td>42.72 92.62</td></tr></table>
|
| 145 |
+
|
| 146 |
+
# 3.1.2 PERFORMANCE ON REAL DATA
|
| 147 |
+
|
| 148 |
+
Having confirmed that an orthogonality constraint can negatively impact convergence rate, we seek to investigate the effect on model performance for tasks on real data. We show the results of experiments on permuted sequential MNIST in Table 2 and ordered sequential MNIST in Table 1. The loss curves are shown in Figure 6 in the Appendix and reveal an increased convergence rate for larger spectral margins. We trained the factorized RNN models with 128 hidden units for 120 epochs. We also trained an LSTM with 128 hidden units on both tasks for 150 epochs, configured with peephole connections, orthogonally initialized (and forget gate bias initialized to one), and trained with RMSprop (learning rate 0.0001, clipping gradients of magnitude 1).
|
| 149 |
+
|
| 150 |
+
We show the results of experiments on PTB character prediction, in terms of bits per character (bpc) and prediction accuracy, for a subset of short sequences (up to 75 characters; $23 \%$ of data) in Table 3 and for a subset of long sequences (up to 300 characters; $9 9 \%$ of data) in Table 4. We trained factorized RNN models with 512 hidden units for 200 epochs with geodesic gradient descent on the bases (learning rate $1 0 ^ { - 6 }$ ) and RMSprop on the other parameters (learning rate 0.001), using a tanh transition nonlinearity, and clipping gradients of 30 magnitude.
|
| 151 |
+
|
| 152 |
+
Interestingly, for both the ordered and permuted sequential MNIST tasks, models with a non-zero margin significantly outperform those that are constrained to have purely orthogonal transition matrices (margin of zero). The best results on both the ordered and sequential MNIST tasks were yielded by models with a spectral margin of 0.1, at $9 4 . 1 0 \%$ accuracy and $9 1 . 4 4 \%$ accuracy, respectively. An LSTM outperformed the RNNs in both tasks; nevertheless, RNNs with hidden to hidden transitions initialized as orthogonal matrices performed admirably without a memory component and without all of the additional parameters associated with gates. Indeed, orthogonally initialized RNNs performed almost on par with the LSTM in the permuted sequential MNIST task which presents longer distance dependencies than the ordered task. Although the optimal margin appears to be 0.1, RNNs with large margins perform almost identically to an RNN without a margin, as long as the transition matrix is initialized as orthogonal. On these tasks, orthogonal initialization appears to significantly outperform Glorot normal initialization (Glorot & Bengio, 2010) or initializing the matrix as identity. It is interesting to note that for the MNIST tasks, orthogonal initialization appears useful while orthogonality constraints appear mainly detrimental. This suggests that while orthogonality helps early training by stabilizing gradient flow across many time steps, orthogonality constraints may need to be loosened on some tasks so as not to over-constrain the model’s representational ability.
|
| 153 |
+
|
| 154 |
+
Table 3: Character prediction on PTB sentences of to 75 characters, using different margins.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>margin</td><td>initialization</td><td>bpc</td><td>accuracy</td></tr><tr><td>0</td><td>orthogonal</td><td>2.16</td><td>55.31</td></tr><tr><td>0.01</td><td>orthogonal</td><td>2.16</td><td>55.33</td></tr><tr><td>0.1</td><td>orthogonal</td><td>2.12</td><td>55.37</td></tr><tr><td>1</td><td>orthogonal</td><td>2.06</td><td>57.07</td></tr><tr><td>100</td><td>orthogonal</td><td>2.04</td><td>57.51</td></tr><tr><td>none</td><td>orthogonal</td><td>2.06</td><td>57.38</td></tr><tr><td>none</td><td>Glorot normal</td><td>2.08</td><td>57.37</td></tr><tr><td>none</td><td>identity</td><td>2.25</td><td>53.83</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 4: Character prediction on PTB sentences of up to 300 characters, using different margins.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>margin</td><td>initialization bpc</td><td>accuracy</td></tr><tr><td>0</td><td>orthogonal 2.20</td><td>54.88</td></tr><tr><td>0.01</td><td>orthogonal 2.20</td><td>54.83</td></tr><tr><td>0.1</td><td>orthogonal 2.24</td><td>54.10</td></tr><tr><td>1</td><td>orthogonal 2.36</td><td>51.12</td></tr><tr><td>100</td><td>orthogonal 2.36</td><td>51.20</td></tr><tr><td>none</td><td>orthogonal 2.34</td><td>51.30</td></tr><tr><td>none</td><td>Glorot normal 2.34</td><td>51.04</td></tr><tr><td>none</td><td>identity 2.68</td><td>45.35</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Curiously, larger margins and even models without sigmoidal constraints on the spectrum (no margin) performed well as long as they were initialized to be orthogonal, suggesting that evolution away from orthogonality is not a serious problem on MNIST. It is not surprising that orthogonality is useful for the MNIST tasks since they depend on long distance signal propagation with a single output at the end of the input sequence. On the other hand, character prediction with PTB produces an output at every time step. Constraining deviation from orthogonality proved detrimental for short sentences (Table 3) and beneficial when long sentences were included (Table 4). Furthermore, Glorot normal initialization did not perform worse than orthogonal initialization for PTB. Since an output is generated for every character in a sentence, short distance signal propagation is possible. Thus it is possible that the RNN is first learning very local dependencies between neighbouring characters and that given enough context, constraining deviation from orthogonality can help force the network to learn longer distance dependencies.
|
| 163 |
+
|
| 164 |
+
# 3.1.3 SPECTRAL AND GRADIENT EVOLUTION
|
| 165 |
+
|
| 166 |
+
It is interesting to note that even long sequence lengths $( \mathrm { T } { = } 1 0 0 0 )$ ) in the copy task can be solved efficiently with rather large margins on the spectrum. In Figure 2 we look at the gradient propagation of the loss from the last time step in the network with respect to the hidden activations. We can see that for a purely orthogonal parameterization of the transition matrix (when the margin is zero), the gradient norm is preserved across time steps, as expected. We further observe that with increasing margin size, the number of update steps over which this norm preservation survives decreases, though surprisingly not as quickly as expected.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 2: The norm of the gradient of the loss from the last time step with respect to the hidden units at a given time step for a length 220 RNN over 1000 update iterations for different margins. Iterations are along the abscissa and time steps are denoted along the ordinate. The first column margins are: 0, 0.001, 0.01. The second column margins are: 0.1, 1, no margin. Gradient norms are normalized across the time dimension.
|
| 170 |
+
|
| 171 |
+
Although the deviation of singular values from one should be slowed by the sigmoidal parameterizations, even parameterizations without a sigmoid (no margin) can be effectively trained for all but the longest sequence lengths. This suggests that the spectrum is not deviating far from orthogonality and that inputs to the hidden to hidden transitions are mostly not aligned along the dimensions of greatest expansion or contraction. We evaluated the spread of the spectrum in all of our experiments and found that indeed, singular values tend to stay well within their prescribed bounds and only reach the margin when using a very large learning rate that does not permit convergence. Furthermore, when transition matrices are initialized as orthogonal, singular values remain near one throughout training even without a sigmoidal margin for tasks that require long term memory (copy, adding, sequential MNIST). On the other hand, singular value distributions tend to drift away from one for PTB character prediction which may help explain why enforcing an orthogonality constraint can be helpful for this task, when modeling long sequences. Interestingly, singular values spread out less for longer sequence lengths (nevertheless, the $\scriptstyle \mathrm { T = 1 0 0 0 0 }$ copy task could not be solved with no sigmoid on the spectrum).
|
| 172 |
+
|
| 173 |
+
We visualize the spread of singular values for different model parameterizations on the permuted sequential MNIST task in Figure 3. Curiously, we find that the distribution of singular values tends to shift upward to a mean of approximately 1.05 on both the ordered and permuted sequential MNIST tasks. We note that in those experiments, a tanh transition nonlinearity was used which is contractive in both the forward signal pass and the gradient backward pass. An upward shift in the distribution of singular values of the transition matrix would help compensate for that contraction. Indeed, (Saxe et al., 2013) describe this as a possibly good regime for learning in deep neural networks. That the model appears to evolve toward this regime suggests that deviating from it may incur a cost. This is interesting because the cost function cannot take into account numerical issues such as vanishing or exploding gradients (or forward signals); we do not know what could make this deviation costly. That the transition matrix may be compensating for the contraction of the tanh is supported by further experiments: applying a 1.05 pre-activation gain appears to allow a model with a margin of 0 to nearly match the top performance reached on both of the MNIST tasks. Furthermore, when using the OPLU norm-preserving activation function (Chernodub & Nowicki, 2016), we found that orthogonally initialized models performed equally well with all margins, achieving over $90 \%$ accuracy on the permuted sequential MNIST task. Unlike orthgonally initialized models, the RNN on the bottom right of Figure 3 with Glorot normal initialized transition matrices, begins and ends with a wide singular spectrum. While there is no clear positive shift in the distribution of singular values, the mean value appears to very gradually increase for both the ordered and permuted sequential MNIST tasks. If the model is to be expected to positively shift singular values to compensate for the contractivity of the tanh nonlinearity, it is not doing so well for the Glorot-initialized case; however, this may be due to the inefficiency of training as a result of vanishing gradients, given that initialization.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: Singular value evolution on the permuted sequential MNIST task for factorized RNNs with different margin sizes. Margins are, from left to right: top row: 0.001, 0.01, 0.1; bottom row: 1, no margin, no margin. The singular value distributions are summarized with the mean (green line, center) and standard deviation (green shading about mean), minimum (red, bottom) and maximum (blue, top) values. All models are initialized with orthogonal hidden to hidden transition matrices except for the model on the bottom right where Glorot normal initialization is used.
|
| 177 |
+
|
| 178 |
+
# 3.2 EXPLORING SOFT ORTHOGONALITY CONSTRAINTS
|
| 179 |
+
|
| 180 |
+
Having established that it may indeed be useful to step away from orthogonality, here we explore two forms of soft constraints (rather than hard bounds as above) on hidden to hidden transition matrix orthogonality. The first is a simple penalty that directly encourages a transition matrix W to be orthogonal, of the form $\lambda | | \mathbf { W } ^ { T } \mathbf { W } \bar { \mathbf { \Lambda } } - \mathbf { I } | | _ { 2 } ^ { 2 }$ . This is similar to the orthogonality penalty introduced by Henaff et al. (2016). In the first two subfigures on the left of Figure 4, we explore the effect of weakening this form of regularization. We trained both a regular non-factorized RNN on the $T = 2 0 0$ copy task and a factorized RNN with orthogonal bases on the $T = 5 0 0$ copy task. For the regular RNN, we had to reduce the learning rate to $\mathrm { \bar { 1 0 } ^ { - 5 } }$ . Here again we see that weakening the strength of the orthogonality-encouraging penalty can increase convergence speed.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 4: Accuracy curves on the copy task for different strengths of soft orthogonality constraints. A soft orthogonality constraint is applied to the transition matrix W for a regular RNN on $T = 2 0 0$ (Left) and the same is applied on a factorized RNN on $T = 5 0 0$ (Left center). Another constraint in the form of a mean one Gaussian prior on the singular values is applied to a factorized RNN on $T = 2 0 0$ (Right center); the same is applied to a factorized RNN with a sigmoidal parameterization of the spectrum, using a large margin of 1 (Right). Loosening orthogonality speeds convergence.
|
| 184 |
+
|
| 185 |
+
The second approach we explore replaces the sigmoidal margin parameterization with a mean one Gaussian prior on the singular values. In the two right subfigures of Figure 4, we visualize the accuracy on the length 200 copy task, using geoSGD (learning rate $1 0 ^ { - 6 }$ ) to keep $\mathbf { U }$ and $\mathbf { V }$ orthogonal and different strengths of a Gaussian prior with mean one on the singular values. We trained these experiments with regular SGD on the spectrum and other non-orthogonal parameter matrices, using a $\mathrm { i 0 ^ { - 5 } }$ learning rate. We see that priors which are too strong lead to slow convergence. Loosening the strength of the prior makes the optimization more efficient. Furthermore, we compare a direct parameterization of the spectrum (no sigmoid) in Figure 4 with a sigmoidal parameterization, using a large margin of 1. Without the sigmoidal parameterization, optimization quickly becomes unstable; on the other hand, the optimization also becomes unstable if the prior is removed completely in the sigmoidal formulation (margin 1). These results further motivate the idea that parameterizations that deviate from orthogonality may perform better than purely orthogonal ones, as long as they are sufficiently constrained to avoid instability during training.
|
| 186 |
+
|
| 187 |
+
# 4 CONCLUSIONS
|
| 188 |
+
|
| 189 |
+
We have explored a number of methods for controlling the expansivity of gradients during backpropagation based learning in RNNs through manipulating orthogonality constraints and regularization on matrices. Our experiments indicate that while orthogonal initialization may be beneficial, maintaining constraints on orthogonality can be detrimental. Indeed, moving away from hard constraints on matrix orthogonality can help improve optimization convergence rate and model performance. However, we also observe with synthetic tasks that relaxing regularization which encourages the spectral norms of weight matrices to be close to one, or allowing bounds on the spectral norms of weight matrices to be too wide, can reverse these gains and may lead to unstable optimization.
|
| 190 |
+
|
| 191 |
+
# ACKNOWLEDGMENTS
|
| 192 |
+
|
| 193 |
+
We thank the Natural Sciences and Engineeering Research Council (NSERC) of Canada and Samsung for supporting this research.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. arXiv preprint arXiv:1511.06464, 2015.
|
| 198 |
+
|
| 199 |
+
Artem Chernodub and Dimitri Nowicki. Norm-preserving orthogonal permutation linear unit activation functions (oplu). arXiv preprint arXiv:1604.02313, 2016.
|
| 200 |
+
|
| 201 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010.
|
| 202 |
+
|
| 203 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
|
| 204 |
+
|
| 205 |
+
Mikael Henaff, Arthur Szlam, and Yann LeCun. Orthogonal rnns and long-memory tasks. arXiv preprint arXiv:1602.06662, 2016.
|
| 206 |
+
|
| 207 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 208 |
+
|
| 209 |
+
David Krueger and Roland Memisevic. Regularizing rnns by stabilizing activations. arXiv preprint arXiv:1511.08400, 2015.
|
| 210 |
+
|
| 211 |
+
Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
|
| 212 |
+
|
| 213 |
+
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.
|
| 214 |
+
|
| 215 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 216 |
+
|
| 217 |
+
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.
|
| 218 |
+
|
| 219 |
+
Yasunori Nishimori. A note on riemannian optimization methods on the stiefel and the grassmann manifolds. dim, 1:2, 2005.
|
| 220 |
+
|
| 221 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. ICML (3), 28:1310–1318, 2013.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Hemant D Tagare. Notes on optimization on stiefel manifolds. Technical report, Tech. Rep., Yale University, 2011.
|
| 226 |
+
|
| 227 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/ 1605.02688.
|
| 228 |
+
|
| 229 |
+
T. Tieleman and G. Hinton. Lecture 6.5—RmsProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 230 |
+
|
| 231 |
+
Scott Wisdom, Thomas Powers, John R. Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. To appear in NIPS, 2016.
|
| 232 |
+
|
| 233 |
+
# 5 APPENDIX
|
| 234 |
+
|
| 235 |
+
# 5.1 ADDITIONAL FIGURES
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 5: Mean squared error (MSE) curves on the adding task for different spectral margins $m$ . For a trivial baseline solution of always outputting the same number, the expected baseline MSE is 0.167.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 6: Loss curves for different factorized RNN parameterizations on the sequential MNIST task (left) and the permuted sequential MNIST task (right). The spectral margin is denoted by m; models with no margin have singular values that are directly optimized with no constraints; Glorot refers to a factorized RNN with no margin that is initialized with Glorot normal initialization.
|
| 242 |
+
|
| 243 |
+
# 5.2 COPY TASK NONLINEARITY
|
| 244 |
+
|
| 245 |
+
We found that nonlinearities such as a rectified linear unit (ReLU) (Nair & Hinton, 2010) or hyperbolic tangent (tanh) made the copy task far more difficult to solve. Using tanh, a short sequence length ( $T = 1 0 0$ ) copy task required both a soft constraint that encourages orthogonality and thousands of epochs for training. It is worth noting that in the unitary evolution recurrent neural network of Arjovsky et al. (2015), the non-linearity (referred to as the ”modReLU”) is actually initialized as an identity operation that is free to deviate from identity during training. Furthermore, Henaff et al. (2016) derive a solution mechanism for the copy task that drops the non-linearity from an RNN. To explore this further, we experimented with a parametric leaky ReLU activation function (PReLU) which introduces a trainable slope $\alpha$ for negative valued inputs $x$ , producing $f ( x ) = m a x ( x , 0 ) + \alpha m i n ( x , 0 )$ (He et al., 2015). Setting the slope $\alpha$ to one would make the PReLU equivalent to an identity function. We experimented with clamping $\alpha$ to 0.5, 0.7 or 1 in a factorized RNN with a spectral margin of 0.3 and found that only the model with $\alpha = 1$ solved the $T = 1 0 0 0$ length copy task. We also experimented with a trainable slope $\alpha$ , initialized to 0.7 and found that it converges to 0.96, further suggesting the optimal solution for the copy task is without a transition nonlinearity. Since the copy task is purely a memory task, one may imagine that a transition nonlinearity such as a tanh or ReLU may be detrimental to the task as it can lose information. Thus, we also tried a recent activation function that preserves information, called an orthogonal permutation linear unit (OPLU) (Chernodub & Nowicki, 2016). The OPLU preserves norm, making a fully norm-preserving RNN possible. Interestingly, this activation function allowed us to recover identical results on the copy task to those without a nonlinearity for different spectral margins.
|
| 246 |
+
|
| 247 |
+
# 5.3 METHOD RUNNING TIME
|
| 248 |
+
|
| 249 |
+
Although the method proposed in section 2 relies on a matrix inversion, an operation with $O ( n ^ { 3 } )$ complexity for an $\textbf { n } \times \textbf { n }$ matrix, the running time of an RNN factorized in such a way actually remains reasonable. This running time is summarized in Table 5 and includes all computations in the graph, together with the matrix inversion. As this method is meant to be used only for the analysis in this work, we find the running times acceptable for that purpose. Models were run on an Nvidia GTX-770 GPU and were run against the $\mathrm { T } { = } 1 0 0$ length copy task.
|
| 250 |
+
|
| 251 |
+
Table 5: Run time in seconds for 1000 iterations on a $\mathrm { T } { = } 1 0 0$ copy task of a regular RNN trained with stochastic gradient descent (SGD) compared against a factorized RNN trained with geodesic SGD on the bases (geoSGD) and regular SGD for other parameters.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>hidden units</td><td>SGD</td><td>geoSGD</td></tr><tr><td>128</td><td>21.9 ± 0.2</td><td>40.4 ± 0.1</td></tr><tr><td>500</td><td>46.7 ± 0.2</td><td>161.4 ± 0.2</td></tr><tr><td>1000</td><td>95.4 ± 0.3</td><td>711.2 ± 0.8</td></tr></table>
|
md/train/HygaikBKvS/HygaikBKvS.md
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OFF-POLICY ACTOR-CRITIC WITH SHARED EXPERIENCE REPLAY
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We investigate the combination of actor-critic reinforcement learning algorithms with uniform large-scale experience replay and propose solutions for two challenges: (a) efficient actor-critic learning with experience replay (b) stability of off-policy learning where agents learn from other agents behaviour. We employ those insights to accelerate hyper-parameter sweeps in which all participating agents run concurrently and share their experience via a common replay module.
|
| 8 |
+
|
| 9 |
+
To this end we analyze the bias-variance tradeoffs in V-trace, a form of importance sampling for actor-critic methods. Based on our analysis, we then argue for mixing experience sampled from replay with on-policy experience, and propose a new trust region scheme that scales effectively to data distributions where V-trace becomes unstable.
|
| 10 |
+
|
| 11 |
+
We provide extensive empirical validation of the proposed solution. We further show the benefits of this setup by demonstrating state-of-the-art data efficiency on Atari among agents trained up until 200M environment frames.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Value-based and actor-critic policy gradient methods are the two leading techniques of constructing general and scalable reinforcement learning agents (Sutton et al., 2018). Both have been combined with non-linear function approximation (Tesauro, 1995; Williams, 1992), and have achieved remarkable successes on multiple challenging domains; yet, these algorithms still require large amounts of data to determine good policies for any new environment. To improve data efficiency, experience replay agents store experience in a memory buffer (replay) (Lin, 1992), and reuse it multiple times to perform reinforcement learning updates (Riedmiller, 2005). Experience replay allows to generalize prioritized sweeping (Moore & Atkeson, 1993) to the non-tabular setting (Schaul et al., 2015), and can also be used to simplify exploration by including expert (e.g., human) trajectories (Hester et al., 2017). Overall, experience replay can be very effective at reducing the number of interactions with the environment otherwise required by deep reinforcement learning algorithms (Schaul et al., 2015). Replay is often combined with the value-based Q-learning (Mnih et al., 2015), as it is an off-policy algorithm by construction, and can perform well even if the sampling distribution from replay is not aligned with the latest agent’s policy. Combining experience replay with actor-critic algorithms can be harder due to their on-policy nature. Hence, most established actor-critic algorithms with replay such as (Wang et al., 2017; Gruslys et al., 2018; Haarnoja et al., 2018) employ and maintain Q-functions to learn from the replayed off-policy experience.
|
| 16 |
+
|
| 17 |
+
In this paper, we demonstrate that off-policy actor-critic learning with experience replay can be achieved without surrogate Q-function approximators using V-trace by employing the following approaches: a) off-policy replay experience needs to be mixed with a proportion of on-policy experience. We show experimentally (Figure 2) and theoretically that the V-trace policy gradient is otherwise not guaranteed to converge to a locally optimal solution. b) a trust region scheme (Conn et al., 2000; Schulman et al., 2015; 2017) can mitigate bias and enable efficient learning in a strongly off-policy regime, where distinct agents share experience through a commonly shared replay module. Sharing experience permits the agents to benefit from parallel exploration (Kretchmar, 2002) (Figures 1 and 3).
|
| 18 |
+
|
| 19 |
+
Our paper is structured as follows: In Section 2 we revisit pure importance sampling for actor-critic agents (Degris et al., 2012) and V-trace, which is notable for allowing to trade off bias and variance in its estimates. We recall that variance reduction is necessary (Figure 4 left) but is biased in V-trace. We derive proposition 2 stating that off-policy V-trace is not guaranteed to converge to a locally optimal solution – not even in an idealized scenario when provided with the optimal value function. Through theoretical analysis (Section 3) and experimental validation (Figure 2) we determine that mixing on-policy experience into experience replay alleviates the problem. Furthermore we propose a trust region scheme (Conn et al., 2000; Schulman et al., 2015; 2017) in Section 4 that enables efficient learning even in a strongly off-policy regime, where distinct agents share the experience replay module and learn from each others experience. We define the trust region in policy space and prove that the resulting estimator is correct (i.e. estimates an improved return).
|
| 20 |
+
|
| 21 |
+
As a result, we present state-of-the-art data efficiency in Section 5 in terms of median human normalized performance across 57 Atari games (Bellemare et al., 2013), as well as improved learning efficiency on DMLab30 (Beattie et al., 2016) (Table 1).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Sharing experience between agents leads to more efficient hyper-parameter sweeps on 57 Atari games. Prior art results are presented as horizontal lines (with scores cited from Gruslys et al. (2018), Hessel et al. (2017) and Mnih et al. (2013)). Note that the only previous agent “R2D2” that achieved a score beyond $4 0 0 \%$ required more than 3,000 million environment steps (see Kapturowski et al. (2019), page 14, Figure 9). We present the pointwise best agent from hyper-parameter sweeps with and without experience replay (shared and not shared). Each sweep contains 9 agents with different learning rate and entropy cost combinations. Replay experiment were repeated twice and ran for 50M steps. To report scores at 200M we ran the baseline and one shared experience replay agent for 200M steps.
|
| 25 |
+
|
| 26 |
+
Table 1: Comparison of state-of-the-art agents on 57 Atari games trained up until 200M environment steps (per game) and DMLab-30 trained until 10B steps (multi-task; all games combined). The first two rows are quoted from Xu et al. (2018) and Hessel et al. (2019), the third is our implementation of a pixel control agent from Hessel et al. (2019) and the last two rows are our proposed LASER (LArge Scale Experience Replay) agent. All agents use hyper-parameter sweeps expect for the marked.
|
| 27 |
+
|
| 28 |
+
<table><tr><td colspan="2">Atari Median</td><td></td><td>DMLab-30 MedianDMLab-30 Mean-Capped</td></tr><tr><td>IMPALA Meta-Gradient (no sweep)</td><td>287.6% at 200M</td><td></td><td>-</td></tr><tr><td>PopArt-IMPALA</td><td></td><td></td><td>73.5%</td></tr><tr><td>PopArt-IMPALA+PixelControl</td><td>=</td><td>85.5%</td><td>77.6%</td></tr><tr><td>LASER: Experience Replay (no sweep)</td><td>431% at 200M</td><td></td><td></td></tr><tr><td>LASER: Experience Replay</td><td>(233% at 50M)</td><td>95.4%</td><td>79.6%</td></tr><tr><td>LASER: Shared Experience Replay</td><td>(370% at 50M), 448% at200M</td><td>97.2%</td><td>81.7%</td></tr></table>
|
| 29 |
+
|
| 30 |
+
# 2 THE ISSUE WITH IMPORTANCE SAMPLING: BIAS AND VARIANCE IN V-TRACE
|
| 31 |
+
|
| 32 |
+
V-trace importance sampling is a popular off-policy correction for actor-critic agents (Espeholt et al., 2018). In this section we revisit how V-trace controls the (potentially infinite) variance that arises from naive importance sampling. We note that this comes at the cost of a biased estimate (see Proposition 1) and creates a failure mode (see Proposition 2) which makes the policy gradient biased. We discuss our solutions for said issues in Section 4.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Left: Learning entirely off-policy from experience replay fails, while combining on-policy data with experience replay leads to improved data efficiency: We present sweeps on DMLab-30 with experience replays of 10M capacity. A ratio of $8 7 . 5 \%$ implies that there are 7 replayed transitions in the batch for each online transition. Furthermore we consider an agent identical to “LASER $8 7 . 5 \%$ replay” which however draws all samples from replay. Its batch thus does not contain any online data and we observe a significant performance decrease (see Proposition 2 and 3). The shading represents the point-wise best and worst replica among 3 repetitions. The solid line is the mean. Right: The effect of capacity in experience replay with $\mathrm { \bar { 8 7 . 5 \% } }$ replay data per batch on sweeps on DMLab-30. Data-efficiency improves with larger capacity.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 3: Left: Naively sharing experience between distinct agents in a hyper-parameter sweep fails (green) and is worse than the no-replay baseline (blue). The proposed trust region estimator mitigates the issue (red). Right: Combining population based training with trust region estimation improves performance further. All replay experiments use a capacity of 10 million observations and ${ \bar { 8 } } 7 . 5 \%$ replay data per batch.
|
| 39 |
+
|
| 40 |
+
# 2.1 REINFORCEMENT LEARNING
|
| 41 |
+
|
| 42 |
+
We follow the notation of Sutton et al. (2018) where an agent interacts with its environment, to collect rewards. On each discrete time-step $t$ , the agent selects an action $a _ { t }$ ; it receives in return a reward $r _ { t }$ and an observation $o _ { t + 1 }$ , encoding a partial view of the environment’s state $s _ { t + 1 }$ . In the fully observable case, the RL problem is formalized as a Markov Decision Process (Bellman, 1957): a tuple $( \boldsymbol { S } , \boldsymbol { A } , \boldsymbol { p } , \gamma )$ , where $s , A$ denotes finite sets of states and actions, $p$ models rewards and state transitions (so that $r _ { t } , s _ { t + 1 } \sim p ( s _ { t } , a _ { t } ) )$ , and $\gamma$ is a fixed discount factor. A policy is a mapping $\pi ( a | s )$ from states to action probabilities. The agent seeks an optimal policy $\pi ^ { * }$ that maximizes the value, defined as the expectation of the cumulative discounted returns $\begin{array} { r } { \dot { \boldsymbol { G } } _ { t } = \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \boldsymbol { r } _ { t + k } } \end{array}$ .
|
| 43 |
+
|
| 44 |
+
Off-policy learning is the problem of finding, or evaluating, a policy $\pi$ from data generated by a different policy $\mu$ . This arises in several settings. Experience replay (Lin, 1992) mixes data from multiple iterations of policy improvement. In large-scale RL, decoupling acting from learning (Nair et al., 2015; Horgan et al., 2018; Espeholt et al., 2018) causes the experience to lag behind the latest agent policy. Finally, it is often useful to learn multiple general value functions (Sutton et al., 2011; Mankowitz et al., 2018; Lample & Chaplot, 2016; Mirowski et al., 2017; Jaderberg et al., 2017b) or options (Sutton et al., 1999; Bacon et al., 2017) from a single stream of experience.
|
| 45 |
+
|
| 46 |
+
# 2.2 NAIVE IMPORTANCE SAMPLING
|
| 47 |
+
|
| 48 |
+
On-policy n-step bootstraps give more accurate value estimates in expectation with larger $n$ (Sutton et al., 2018). They are used in many reinforcement learning agents (Mnih et al., 2016; Schulman et al., 2017; Hessel et al., 2017). Unfortunately $n$ must be chosen suitably as the estimates variance increases with $n$ too.
|
| 49 |
+
|
| 50 |
+
It is desirable to obtain benefits akin to n-step returns in the off-policy case. To this end multi-step importance sampling (Kahn, 1955) can be used. This however adds another source of (potentially infinite (Sutton et al., 2018)) variance to the estimate.
|
| 51 |
+
|
| 52 |
+
Importance sampling can estimate the expected return $V ^ { \pi }$ from trajectories sampled from $\mu \neq \pi$ as long as $\mu$ is non-zero whereever $\pi$ is. We employ a previously estimated value function $V$ as a bootstrap to estimate expected returns. Following Degris et al. (2012), a multi-step formulation of the expected return is
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
V ^ { \pi } ( s _ { t } ) = \mathbf { E } _ { \mu } \left[ V ( s _ { t } ) + \sum _ { k = 0 } ^ { K - 1 } \gamma ^ { k } \Big ( \prod _ { i = 0 } ^ { k } \frac { \pi _ { t + i } } { \mu _ { t + i } } \Big ) \delta _ { t + k } V \right]
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\mathbf { E } _ { \mu }$ denotes the expectation under policy $\mu$ up to an episode termination, $\delta _ { t } V ~ = ~ r _ { t } +$ $\gamma V ( s _ { t + 1 } ) - V ( s _ { t } )$ is the temporal difference error in consecutive states $s _ { t + 1 }$ , $s _ { t }$ , and $\pi _ { t } = \pi _ { t } ( a _ { t } | s _ { t } )$ . Importance sampling estimates can have high variance. Tree Backup (Precup et al., 2000), and $\mathbf { Q } ( \lambda )$ (Sutton et al., 2014) address this, but reduce the number of steps before bootstrapping even when this is undesirable (as in the on-policy case). RETRACE (Munos et al., 2016) makes use of full returns in the on-policy case, but it introduces a zero-mean random variable at each step, adding variance to empirical estimates in both on- and off-policy cases.
|
| 59 |
+
|
| 60 |
+
# 2.3 BIAS-VARIANCE ANALYSIS & FAILURE MODE OF $\mathrm { v . }$ -TRACE IMPORTANCE SAMPLING
|
| 61 |
+
|
| 62 |
+
V-trace (Espeholt et al., 2018) reduces the variance of importance sampling by trading off variance for a biased estimate of the return – resulting in a failure mode (see Proposition 2). It uses clipped importance sampling ratios to approximate $V ^ { \pi }$ by $\begin{array} { r } { V ^ { \tilde { \pi } } ( s _ { t } ) = V ( s _ { t } ) + \sum _ { k = 0 } ^ { K - 1 } \gamma ^ { k } \Big ( \prod _ { i = 0 } ^ { k - 1 } c _ { i } \Big ) \rho _ { t } \delta _ { t + k } V } \end{array}$ where $V$ is a learned state value estimate used to bootstrap, and $\rho _ { t } = \operatorname* { m i n } \left[ \pi _ { t } / \dot { \mu } _ { t } , \bar { \rho } \right]$ , $c _ { t } \dot { = } \operatorname* { m i n } \left[ \pi _ { t } / \mu _ { t } , \bar { c } \right]$ are the clipped importance ratios. Note that, differently from RETRACE, V-trace fully recovers the Monte Carlo return when on policy. It similarly reweights the policy gradient as:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\nabla V ^ { \tilde { \pi } } ( s _ { t } ) \stackrel { \mathrm { d e f } } { = } \mathbf { E } _ { \mu } \left[ \rho _ { t } \nabla ( \log \pi _ { t } ) ( r _ { t } + \gamma V ^ { \tilde { \pi } } ( s _ { t + 1 } ) ) \right]
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Note that $\nabla V ^ { \tilde { \pi } } ( s _ { t } )$ recovers the naively importance sampled policy gradient for $\bar { \rho } \infty$ . In the literature, it is common to subtract a baseline from the action-value estimate $r _ { t } + \gamma V ^ { \tilde { \pi } } ( s _ { t + 1 } )$ to reduce variance (Williams, 1992), omitted here for simplicity. The constants $\bar { \rho } \ge \bar { c } \ge 1$ (typically chosen $\bar { \rho } = \bar { c } = 1$ ) define the level of clipping, and improve stability by ensuring a bounded variance. For any given $\bar { \rho }$ , the bias introduced by V-trace in the value and policy gradient estimates increases with the difference between $\pi$ and $\mu$ . We analyze this in the following propositions.
|
| 69 |
+
|
| 70 |
+
Proposition 1. The V-trace value estimate $V ^ { \tilde { \pi } }$ is biased: It does not match the expected return of $\pi$ but the return of a related implied policy $\tilde { \pi }$ defined by equation 3 that depends on the behaviour
|
| 71 |
+
|
| 72 |
+
policy µ:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\tilde { \pi } _ { \mu } ( a | x ) = \frac { \operatorname* { m i n } \left[ \bar { \rho } \mu ( a | x ) , \pi ( a | x ) \right] } { \sum _ { b \in A } \operatorname* { m i n } \left[ \bar { \rho } \mu ( b | x ) , \pi ( b | x ) \right] }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Proof. See Espeholt et al. (2018).
|
| 79 |
+
|
| 80 |
+
Note that the biased policy $\tilde { \pi } _ { \mu }$ can be very different from $\pi$ . Hence the V-trace value estimate $V ^ { \tilde { \pi } }$ may be very different from $V ^ { \pi }$ as well. As an illustrative example, consider two policies over a set of two actions, e.g. “left” and “right” represented as a tuple of probabilities. Let us investigate $\mu = ( \phi , 1 - \phi )$ and $\bar { \pi } = ( 1 - \phi , \phi )$ defined for any suitably small $\phi \leq 1$ . Observe that $\pi$ and $\mu$ share no trajectories (state-action sequences) in the limit as $\phi 0$ and they get more focused on one action. A practical example of this could be two policies, one almost always taking a left turn and one always taking the right. Given sufficient data of either policy it is possible to estimate the value of the other e.g. with naive importance sampling. However observe that V-trace with $\bar { \rho } = 1$ will always estimate a biased value - even given infinite data. Observe that $\sin \left[ \mu ( a | x ) , \pi ( a | x ) \right] = \sin \left[ \phi , 1 - \phi \right]$ for both actions. Thus $\tilde { \pi } _ { \mu }$ is uniform rather than resembling $\pi$ the policy. The $\mathrm { V } .$ -trace estimate $V ^ { \tilde { \pi } }$ would thus compute the average value of "left" and "right" – poorly representing the true $V ^ { \pi }$ .
|
| 81 |
+
|
| 82 |
+
Proposition 2. The V-trace policy gradient is biased: given the the optimal value function $V ^ { * }$ the $V .$ -trace policy gradient does not converge to a locally optimal $\pi ^ { * }$ for all off-policy behaviour distributions $\mu$ .
|
| 83 |
+
|
| 84 |
+
Proof. See Appendix C.
|
| 85 |
+
|
| 86 |
+
# 3 MIXING ON- AND OFF-POLICY EXPERIENCE
|
| 87 |
+
|
| 88 |
+
In Proposition 2 we presented a failure mode in $\mathrm { v } .$ -trace where the variance reduction biases the value estimate and policy gradient. V-trace computes biased $\mathbf { Q }$ -estimates $Q ^ { \omega } \neq Q$ resulting in a wrong local policy gradient: $\nabla { \bf E } _ { \pi ( a | s ) } \left[ Q ^ { \omega } ( s , a ) \right] \neq \nabla { \bf E } _ { \pi ( a | s ) } \left[ Q ( s , a ) \right] .$ . In equation 10 we show that $Q ^ { \omega } ( s , a ) = Q ( s , a ) \omega ( s , a )$ where $\begin{array} { r } { \omega ( s , a ) = \mathrm { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a | s ) } { \pi ( a | s ) } \right] \leq 1 } \end{array}$ .
|
| 89 |
+
|
| 90 |
+
The question of how biased the resulting policy will be depends on whether the distortion changes the argmax of the Q-function. Little distortions that do not change the argmax will result in the same local fixpoint of the policy improvement. The policy will continue to select the optimal action and it will not be biased at this state. The policy will however be biased if the Q-function is distorted too much. For example consider a $\omega ( s , a )$ that swaps the argmax for the 2nd largest value, the regret will then be the difference between the maximum and the 2nd largest value. Intuitively speaking the more distorted the $Q ^ { \omega }$ , the larger will be the regret compared to the optimal policy.
|
| 91 |
+
|
| 92 |
+
More precisely, the regret of learning a policy that maximizes the distorted $Q ^ { \omega }$ at state $s$ is:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
R ( s ) = Q ( s , a ^ { * } ) - Q ( s , a _ { \mathrm { a c t u a l } } ) = \operatorname* { m a x } _ { b } Q ( s , b ) - Q ( s , a _ { \mathrm { a c t u a l } } )
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $a ^ { * } ~ = ~ \operatorname { a r g m a x } _ { b } ( Q , b )$ is the optimal action according to the real $Q$ and $\begin{array} { r l } { a _ { \mathrm { a c t u a l } } } & { { } = } \end{array}$ a $\mathrm { r g m a x } [ Q ^ { \omega } ( s , a ) ] = \mathrm { a r g m a x } [ Q ( s , a ) \omega ( s , a ) ]$ , is the optimal action according to the distorted $Q ^ { \omega }$ . For generality, we denote $A ^ { * }$ as the set of best actions - covering the case with multiple with identical optimal Q-values.
|
| 99 |
+
|
| 100 |
+
Proposition 3 provides a mitigation: Clearly the V-trace policy gradient will converge to the same solution as the true on-policy gradient if the argmax of the Q-function is preserved at all states in a tabular setting. We show that this can be achieved by mixing a sufficient proportion $\alpha$ of on-policy experience into the computation.
|
| 101 |
+
|
| 102 |
+
We show in equation 13 in the Appendix that choosing $\alpha$ such that
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\frac { \alpha } { 1 - \alpha } > _ { b \notin A ^ { * } } \left[ \frac { Q ^ { \omega } ( s , b ) - Q ^ { \omega } ( s , a ^ { * } ) } { Q ( s , a ^ { * } ) - Q ( s , b ) } \right] \frac { d ^ { \mu } ( s ) } { d ^ { \pi } ( s ) } \mathrm { f o r } Q ^ { \omega } ( s , a ) = Q ( s , a ) \omega ( s , a )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
will result in a policy that correctly chooses the best action at state $s$ . Note that $\frac { \alpha } { 1 - \alpha } \to \infty$ as $\alpha 1$
|
| 109 |
+
|
| 110 |
+
Intuitively: the larger the action value gap of the real Q-function $Q ( s , a ^ { * } ) - Q ( s , b )$ the lower the right hand side and the less on-policy data is required. If $\begin{array} { r } { \operatorname* { m a x } _ { b } [ ( Q ( s , b ) \omega ( s , b ) - Q ( s , a ^ { * } ) \omega ( s , a ^ { * } ) ] } \end{array}$ is negative, then $\alpha$ may be as small as zero and we enabling even pure off-policy learning. Finally note that the right hand side decreases due to $d ^ { \mu } ( s ) / d ^ { \pi } ( s )$ if $\pi$ visits the state $s$ more often than $\mu$ .
|
| 111 |
+
|
| 112 |
+
All of those conditions can be computed and checked if an accurate Q-function and state distribution is accessible. How to use imperfect Q-function estimates to adaptively choose such an $\alpha$ remain a question for future research.
|
| 113 |
+
|
| 114 |
+
We provide experimental evidence for these results with function approximators in the 3-dimensional simulated environment DMLab-30 with various $\alpha \ge 1 / 8$ in Section 5.3 and Figure 2. We observe that $\alpha = 1 / 8$ is sufficient to facilitate stable learning. Furthermore it results in better data-efficiency than pure on-policy learning as it utilizes off-policy replay experience.
|
| 115 |
+
|
| 116 |
+
Proposition 3. Mixing on-policy data into the V-trace policy gradient with the ratio α reduces the bias by providing a regularization to the implied state-action values. In the general function approximation case it changes the off-policy $V .$ -trace policy gradient from $\begin{array} { r l } { \sum _ { s } d ^ { \mu } ( \bar { s } ) \mathbf { E } _ { \pi } \left[ ( \dot { Q } ( s , a ) \nabla \log \pi ( a | s ) \right] } \end{array}$ to $\begin{array} { r } { \sum _ { s } \mathbf { E } _ { \pi } \left[ Q ^ { \alpha } ( s , a ) \nabla \log \pi ( a | s ) \right] } \end{array}$ where $Q ^ { \alpha } = Q d ^ { \pi } ( s ) \alpha + Q ^ { \overline { { { \omega } } } } \bar { d } ^ { \mu } ( s ) ( 1 - \alpha )$ is a regularized stateaction estimate and $d ^ { \pi }$ , $d ^ { \mu }$ are the state distributions for $\pi$ and $\mu$ . Note that there exists $\alpha \leq 1$ such that $Q ^ { \alpha }$ has the same argmax (i.e. best action) as $Q$ .
|
| 117 |
+
|
| 118 |
+
# Proof. See Appendix C.
|
| 119 |
+
|
| 120 |
+
Mixing online data with replay data has also been argued for by Zhang & Sutton (2017), as a heuristic way of reducing the sensitivity of reinforcement learning algorithms to the size of the replay memory. Proposition 3 grounds this in the theoretical properties of V-trace.
|
| 121 |
+
|
| 122 |
+
# 4 TRUST REGION SCHEME FOR OFF-POLICY V-TRACE
|
| 123 |
+
|
| 124 |
+
To mitigate the bias and variance problem of V-trace and importance sampling we propose a trust region scheme that adaptively selects only suitable behaviour distributions when estimating the state-value of $\pi$ . To this end we introduce a behaviour relevance function that classifies behaviour as relevant. We then define a trust-region estimator that computes expectations (such as expected returns, or the policy gradient) only on relevant transitions. In proposition 4 and 5 we show that this trust region estimator indeed computes new state-value estimates that improve over the current value function. While our analysis and proof is general we propose a suitable behaviour relevance function in section 4.3 that employs the Kullback Leibler divergence between target policy $\pi$ and implied policy $\tilde { \pi } _ { \mu } \colon \mathrm { K L } \left( \pi ( \cdot | s ) \bar { | } | \tilde { \pi } _ { \mu } ( \cdot | s ) \right)$ . We provide experimental validation in Figure 3.
|
| 125 |
+
|
| 126 |
+
# 4.1 BEHAVIOUR RELEVANCE FUNCTIONS
|
| 127 |
+
|
| 128 |
+
In off-policy learning we often consider a family of behaviour policies either indexed by training iteration $t$ : $M _ { T } = \{ \mu _ { t } | t < T \}$ for experience replay, or by a different agent $k$ : $M _ { K } = \{ \bar { \mu _ { k } } | k \in K \bar \}$ when training multiple agents. In the classic experience replay case we then sample a time $t$ and locate the transition $\tau$ that was generated earlier via $\mu _ { t }$ . This extends naturally to the multiple agent case where we sample an agent index $k$ and then obtain a transition for such agent or tuples of $( k , t )$ . Without loss of generality we simplify this notation and index sampled behaviour policies by a random variable $z \sim Z$ that represents the selection process. While online reinforcement learning algorithms process transitions $\tau \sim \pi$ , off-policy algorithms process $\tau \sim \mu _ { z }$ for $z \sim Z$ . In this notation, given equation (1) and a bootstrap $V$ , the expectation of importance sampled off-policy returns at state $s _ { t }$ is described by:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
V _ { \mathrm { m i x } } ^ { \pi } ( s _ { t } ) = \mathbf { E } _ { z } \Big [ \mathbf { E } _ { \mu _ { z } | z } \big [ G ^ { \pi , \mu _ { z } } ( s _ { t } ) \big ] \Big ]
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\begin{array} { r } { G ^ { \pi , \mu } ( s _ { t } ) = V ( s _ { t } ) + \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \Big ( \prod _ { i = 0 } ^ { k } \frac { \pi _ { t + i } } { \mu _ { t + i } } \Big ) \delta _ { t + k } V } \end{array}$ is a single importance sampled return.
|
| 135 |
+
Note that the on-policy return $\begin{array} { r } { G ^ { \pi , \pi } ( s _ { t } ) = V ( s _ { t } ) + \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } r _ { t + k } } \end{array}$ .
|
| 136 |
+
|
| 137 |
+
Above $\mathbf { E } _ { \mu _ { z } | z }$ represents the expectation of sampling from a given $\mu _ { z }$ . The conditioning on $z$ is a notational reminder that this expectation does not sample $z$ or $\mu _ { z }$ but experience from $\mu _ { z }$ . For any
|
| 138 |
+
|
| 139 |
+
sampled $z$ we obtain a $\mu _ { z }$ and observe that the inner expectation wrt. experience of $\mu _ { z }$ in equation (4) recovers the expected on-policy return in expectation:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r l } { \mathbf { E } _ { \mu _ { z } | z } \left[ G ^ { \pi , \mu _ { z } } ( s _ { t } ) \right] = \mathbf { E } _ { \mu _ { z } | z } \left[ V ( s _ { t } ) + \displaystyle \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \Big ( \displaystyle \prod _ { i = 0 } ^ { k } \frac { \pi _ { t + i } } { \mu _ { z , t + i } } \Big ) \delta _ { t + k } V \right] } & { } \\ { = \mathbf { E } _ { \pi } \left[ V ( s _ { t } ) + \displaystyle \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \Big ( \displaystyle \prod _ { i = 0 } ^ { k } \frac { \mu _ { z , t + i } } { \mu _ { z , t + i } } \Big ) \delta _ { t + k } V \right] } & { } \\ { = \mathbf { E } _ { \pi } \left[ V ( s _ { t } ) + \displaystyle \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } r _ { t + k } \right] = \mathbf { E } _ { \pi } \left[ G ^ { \pi , \pi } ( s _ { t } ) \right] = V ^ { \pi } ( s _ { t } ) } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Thus $V _ { \mathrm { m i x } } ^ { \pi } ( s _ { t } ) = \mathbf { E } _ { z } \left[ \mathbf { E } _ { \pi } \left[ G ^ { \pi , \pi } ( s _ { t } ) \right] \right] = \mathbf { E } _ { \pi } \left[ G ^ { \pi , \pi } ( s _ { t } ) \right] = V ^ { \pi } ( s _ { t } )$ . This holds provided that $\mu _ { z }$ is non-zero wherever $\pi$ is. This fairly standard assumption leads us straight to the core of the problem: it may be that some behaviours $\mu _ { z }$ are ill-suited for estimating the inner expectation. However, standard importance sampling applied to very off-policy experience divides by small $\mu$ resulting in high or even infinite variance. Similarly, $\mathrm { v } .$ -trace attempts to compute an estimate of the return following $\pi$ resulting in limited variance at the cost of a biased estimate in turn.
|
| 146 |
+
|
| 147 |
+
The key idea of our proposed solution is to compute the return estimate for $\pi$ at each state only from a subset of suitable behaviours $\mu _ { z }$ :
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
M _ { \beta , \pi } ( s ) = \{ \mu _ { z } | z \in Z { \mathrm { ~ a n d ~ } } \beta ( \pi , \mu , s ) < b \}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
as determined by a behaviour relevance function $\beta ( \pi , \mu , s ) : ( M _ { Z } , M _ { Z } , S ) \mathbb { R }$ and a threshold $b$ . The behaviour relevance function decides if experience from a behaviour is suitable to compute an expected return for $\pi$ . It can be chosen to control properties of $V _ { \mathrm { m i x } } ^ { \pi }$ by restricting the expectation on subsets of $Z$ . In particular it can be used to control the variance of an importance sampled estimator: Observe that the inner expectation $\begin{array} { r } { \mathsf { E } _ { \mu _ { z } } \left[ G ^ { \pi , \mu } ( s _ { t } ) \big | z \right] } \end{array}$ in equation (4) already matches the expected return $V ^ { \pi }$ . Thus we can condition the expectation on arbitrary subsets of $Z$ without changing the expected value of $V _ { \mathrm { m i x } } ^ { \pi }$ . This allows us to reject high variance $G ^ { \pi , \mu }$ without introducing a bias in $V _ { \mathrm { m i x } } ^ { \pi }$ . The same technique can be applied to $\mathrm { V } .$ -trace where we can reject return estimates with high bias.
|
| 154 |
+
|
| 155 |
+
# 4.2 DERIVATION OF TRUST REGION ESTIMATORS
|
| 156 |
+
|
| 157 |
+
Using a behaviour relevance function $\beta ( s )$ we can define a trust region estimator for regular importance sampling (IS) and $\mathrm { V } .$ -trace and show their correctness.
|
| 158 |
+
|
| 159 |
+
We define the trust region estimator as the conditional expectation
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
V _ { \mathrm { t r u s t e d } } ^ { \pi } ( s _ { t } ) = \mathbf { E } _ { z } \Big [ \mathbf { E } _ { \mu _ { z } \vert z } \big [ G ^ { \pi , \mu _ { z } , \beta } ( s _ { t } ) \big ] \Big \vert \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ]
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
with $\lambda$ -returns $G$ , chosen as $G _ { \mathrm { I S } }$ for importance sampling and $G _ { \mathrm { V t r a c e } }$ for $\mathrm { V } .$ -trace:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } } ( s _ { t } ) = V ( s _ { t } ) + \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \Big ( \prod _ { i = 0 } ^ { k } \lambda _ { \pi , \mu _ { z } } ( s _ { t + i } ) \frac { \pi _ { t + i } } { \mu _ { z , t + i } } \Big ) \delta _ { t + k } V
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } } ( s _ { t } ) = V ( s _ { t } ) + \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } \Big ( \prod _ { i = 0 } ^ { k - 1 } \lambda _ { \pi , \mu _ { z } } ( s _ { t + i } ) c _ { z , t + i } \Big ) \lambda _ { \pi , \mu _ { z } } ( s _ { t + k } ) \rho _ { z , t + k } \delta _ { t + k } V
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $\lambda _ { \pi , \mu } ( s _ { t } )$ is designed to constraint Monte-Carlo bootstraps to relevant behaviour: $\lambda _ { \pi , \mu } ( s _ { t } ) =$ $\mathbb { 1 } _ { \beta ( \pi , \mu , s _ { t } ) < b }$ and s bo $\begin{array} { r } { \rho _ { z , t + k } = \operatorname* { m i n } \left[ \frac { \pi _ { t + i } } { \mu _ { z , t + i } } , \bar { \rho } \right] } \end{array}$ and a mu $c _ { z , t + k }$ are behaviour dependent clipped importancep return estimators with adaptive length. Note $G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } }$ $G _ { \mathrm { V t r a c e } } ^ { \bar { \pi } , \mu _ { z } }$
|
| 176 |
+
IS that only estimators with length $\geq 1$ e are used in $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ . Due to Minkowski’s inequality the trust region estimator thus shows at least the same contraction as a 1-step bootstrap, but can be faster due to its adaptive nature:
|
| 177 |
+
Proposition 4. Let that they all have th $G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } }$ be a set fix point mportance sampling estimaand contract with at least rs as defined in equation 7. Note. Then the contraction properties $V ^ { \pi }$ $\gamma$
|
| 178 |
+
carry over to $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ . $I n$ particular $| V _ { \mathrm { t r u s t e d } } ^ { \pi } - V ^ { \pi } | _ { \infty } \leq \gamma | V - V ^ { \pi } | _ { \infty }$ .
|
| 179 |
+
|
| 180 |
+
Proof. See Appendix C.
|
| 181 |
+
|
| 182 |
+
Proposition 5. Let $G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } }$ be a set of $V .$ -trace estimators (see equation 8) with corresponding fixed (see equation 3) to which they contract at a speed of an algorithm and behaviour specific $\eta _ { z }$ . Then $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ moves towards $V ^ { \beta } = \mathbf { E } _ { z | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \left[ \bar { V ^ { z } } \right]$ shrinking the distance as follows $\begin{array} { r } { \big | V _ { \mathrm { t r u s t e d } } ^ { \pi } - V ^ { \beta } \big | _ { \infty } < \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } | \eta _ { z } ( V - V ^ { z } ) | _ { \infty } \leq \eta _ { \operatorname* { m a x } } \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } | ( V - V ^ { z } ) | _ { \infty } } \end{array}$ with $\eta _ { \mathrm { m a x } } = \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \eta _ { z }$ .
|
| 183 |
+
|
| 184 |
+
# Proof. See Appendix C.
|
| 185 |
+
|
| 186 |
+
Note how the choice of π $\beta$ and t s $M _ { \beta , \pi }$ enables us discard ill-suited $G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } }$ from the estimation of . Recall that $\mathrm { v } .$ -trace fixed points $V _ { z }$ are biased. Thus $\beta$ allows us to selectively create the V-trace target $V ^ { \beta } = \mathbf { E } _ { z | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \left[ V ^ { z } \right]$ and control its bias and the shrinkage $\begin{array} { r } { \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } | \eta _ { z } ( V ( s ) - V ^ { z } ( s ) ) | _ { \infty } } \end{array}$ (see Proposition 5). Similarly it can control cases where we can not use the exact importance sampled estimator. The same approach based on nested expectations can be applied to the expectation of the policy gradient estimate and allows to control the bias and greediness (see Proposition 2) there as well.
|
| 187 |
+
|
| 188 |
+
# 4.3 IMPLEMENTATION DETAILS
|
| 189 |
+
|
| 190 |
+
In Proposition 5 we have seen that the quality of the trust region V-trace return estimator depends on $\beta$ . A suitable choice of $\beta$ can move the return estimate $V ^ { \beta }$ closer to $V ^ { \pi }$ and improve the shrinkage by reducing $\begin{array} { r } { \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \left| \eta _ { z } ( V ( s ) - V ^ { z } ( s ) ) \right| _ { \infty } } \end{array}$ . Hence, we employ a behaviour relevance function $\beta _ { \mathrm { K L } }$ that rejects high bias transitions by estimating the Kulback-Leibler divergence between the target policy $\pi$ and the implied policy $\tilde { \pi } _ { \mu _ { z } }$ for a sampled behaviour $\mu _ { z }$ . Recall from Proposition 1 that $\tilde { \pi } _ { \mu _ { z } }$ determines the fixed point of the $\mathrm { V } .$ -trace estimator for behaviour $\mu _ { z }$ and thus determines the bias in $V ^ { z }$ .
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\beta _ { \mathrm { K L } } ( \pi , \mu , s ) = \mathrm { K L } \left( \pi ( \cdot | s ) | | \tilde { \pi } _ { \mu } ( \cdot | s ) \right)
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
Note that the behaviour probabilities $\mu _ { z }$ can be evaluated and saved to the replay when the agent executes the behaviour, similarly the target policy $\pi$ is represented by the agents neural network. Using both and equation 3, $\tilde { \pi } _ { \mu }$ can be computed. For large or infinite action spaces a Monte Carlo estimate of the KL divergence can be computed.
|
| 197 |
+
|
| 198 |
+
It is possible to define separate behaviour relevance functions for the policy and value estimate. For simplicity we reject transitions entirely for all estimates and do not consider rejected transitions for the policy gradient and value gradient updates or auxiliary tasks. As described above we stop the Monte-Carlo bootstraps once they reach undesirable state-behaviour pairs. Note that this censoring procedure is computed from state dependent $\beta ( \pi , \mu , s )$ and ensures that the choice of bootstrapping does not depend on the sampled actions. Note that rejection by an action-based criteria such as small $\pi ( { a } | { s } ) / \mu ( { a } | { s } )$ would introduce an additional bias which we avoid by choosing $\beta _ { \mathrm { K L } }$ .
|
| 199 |
+
|
| 200 |
+
# 5 EXPERIMENTS
|
| 201 |
+
|
| 202 |
+
We present experiments to support the following claims:
|
| 203 |
+
|
| 204 |
+
• Section 5.2: Uniform experience replay obtains comparable results as prioritized experience replay, while being simpler to implement and tune.
|
| 205 |
+
• Section 5.3: Using fresh experience before inserting it in experience replay is better than learning purely off-policy from experience replay – in line with Proposition 3.
|
| 206 |
+
• Section 5.4: Sharing experience without trust region performs poorly as suggested by Proposition 2. Off-Policy Trust-Region V-trace solves this issue.
|
| 207 |
+
• Section 5.5: Sharing experience can take advantage of parallel exploration and obtains state-of-the-art performance on Atari games, while also saving memory through sharing a single experience replay.
|
| 208 |
+
|
| 209 |
+
# 5.1 EXPERIMENTAL SETUP & METHODOLOGY
|
| 210 |
+
|
| 211 |
+
We use the V-trace distributed reinforcement learning agent (Espeholt et al., 2018) as our baseline. In our experiments we consider two experimental platforms: Atari and DeepMind Lab. On Atari we consider the common single task training regime, where a different agent is trained, from scratch, on each of the tasks. Following Xu et al. (2018) we use a discount of 0.995. Motivated by recent work by Kaiser et al. (2019), we use the IMPALA deep network and increased the number of channels $4 \times$ . We use $9 6 \%$ replay data per batch. Differently from Espeholt et al. (2018), we do not use gradient clipping by norm (Pascanu et al., 2012). Updates are computed on mini-batches of 32 (regular) and 128 (replay) trajectories, each corresponding to 19 steps in the environment. In the context of DeepMind Lab, we consider the multi-task suite DMLab-30 (Espeholt et al., 2018), as the visuals and the dynamics are more consistent across tasks. Furthermore the multi-task regime is particularly suitable for the investigation of strongly off-policy data distributions arising from sharing the replay across agents, as concurrently learning agents can easily be stuck in different policy plateaus, generating substantially different data (Schaul et al., 2019). As in Espeholt et al. (2018), in the multi-task setting each agent trains simultaneously on a uniform mixture of all tasks rather than individually on each game. The score of an agent is thus the median across all 30 tasks. Following Hessel et al. (2019), we augment our agent with multi-task Pop-Art normalization and PixelControl. We use a PreCo LSTM (Amos et al., 2018) instead of the vanilla one (Hochreiter & Schmidhuber, 1997). Updates are computed on mini-batches of multiple trajectories chosen as above, each corresponding to 79 steps in the environment. In early experiments we found that computing the entropy cost only on the online data provided slightly better results, hence we have done so throughout our experiments.
|
| 212 |
+
|
| 213 |
+
In all our experiments, experience sampled from memory is mixed with online data within each minibatch – following Proposition 3. Episodes are removed in a first in first out order, so that replay always holds the most recent experience. Unless explicitly stated otherwise we consider hyper-parameter sweeps, some of which share experience via replay. In this setting multiple agents start from-scratch, run concurrently at identical speed, and add their new experience into a common replay buffer. All agents will then draw uniform samples from the replay buffer. On DMLab-30 we consider both regular hyper-parameter sweeps and sweeps with population based training (PBT) (Jaderberg et al., 2017a). On DMLab-30 sweeps contain 10 agents with hyper-parameters sampled similar as Espeholt et al. (2018) but fixed RMSProp $\epsilon = 0 . 1$ . On Atari sweeps contain 9 agents with different constant learning rate and entropy cost combinations $\{ 3 \cdot 1 0 ^ { - 4 } , 6 \cdot \bar { 1 } 0 ^ { - 4 } , 1 . 2 \cdot 1 0 ^ { - 3 } \} \times \{ 5 \cdot 1 0 ^ { - 3 } , 1 \cdot 1 0 ^ { - 2 } , 2 \cdot 1 0 ^ { - 2 } \}$ (distributed by factors $\{ 1 / 2 , 1 , 2 \}$ around the initial parameters reported in Espeholt et al. (2018)). Although our focus is on efficient hyper-parameter sweeps given crude initial parameters, we also present a single-agent LASER experiment using the same tuned schedule as Espeholt et al. (2018), a $8 7 . 5 \%$ replay ratio and a 15M replay. We store the entire episodes in the replay buffer and replay each episode from the beginning, using the most recent network parameters to recompute the LSTM states along the way: this is particularly critical when sharing experience between different agents, which may have arbitrarily different state representations.
|
| 214 |
+
|
| 215 |
+
# 5.2 UNIFORM AND PRIORITIZED EXPERIENCE REPLAY
|
| 216 |
+
|
| 217 |
+
Prioritized experience replay has the potential to provide more efficient learning compared to uniform experience replay (Schaul et al., 2015; Horgan et al., 2018). However, it also introduces a number of new hyper-parameters and design choices: the most critical are the priority metric, how strongly to bias the sampling distribution, and how to correct for the resulting bias. Uniform replay is instead almost parameter-free, requires little tuning and can be easily shared between multiple agents. Experiments provided in Figure 4 in the appendix showed little benefit of actor critic prioritized replay on DMLab-30. Furthermore priorities are typically computed from the agent specific metrics such as the TD-error, which are ill-defined when replay is shared among multiple agents. Hence we used uniform replay for our further investigations.
|
| 218 |
+
|
| 219 |
+
# 5.3 MIXING ON- AND OFF-POLICY EXPERIENCE AND REPLAY CAPACITY
|
| 220 |
+
|
| 221 |
+
Figure 2 (left) shows that performance degrades significantly when online data is not present in the batch. This experimentally validates Propositions 2 and 3 that highlight difficulties of learning purely off-policy. Furthermore Figure 2 (right) shows that best results are obtained with experience replay of 10M capacity and $8 7 . 5 \%$ ratio. A ratio of $8 7 . 5 \% = 7 / 8$ corresponds to 7 replay samples for each online sample. We have considered ratios of $1 / 2 , 3 / 4$ , and $7 / 8$ and observed stable training for all of them. Observe that among those values, larger ratios are more data-efficient as they take advantage of more replayed experience per training step.
|
| 222 |
+
|
| 223 |
+
5.4 SHARED EXPERIENCE REPLAY WITH OFF-POLICY TRUST REGION V-TRACE
|
| 224 |
+
|
| 225 |
+
In line with proposition 2 we observe in Figure 3 (left) that hyper-parameter sweeps without trustregion are even surpassed by the baseline without experience replay. State-of-the-art results are obtained in Figure 3 (right) when experience is shared with trust-region in a PBT sweep.
|
| 226 |
+
|
| 227 |
+
Observe that this indicates parallel exploration benefits and saves memory at the same time: in our sweep of 10 replay agents the difference between $1 0 \times 1 0 \mathrm { M }$ (separate replays) and 10M (shared replay) is 10-fold. This effect would be even more pronounced with larger sweeps.
|
| 228 |
+
|
| 229 |
+
As discussed in section 2.3, the bias in V-trace occurs due to the clipping of importance ratios. A potential solution of reducing the bias would be to increase the $\bar { \rho }$ threshold to clip less aggressively and accept increased variance. Figure 4 in the appendix shows that this is not a solution.
|
| 230 |
+
|
| 231 |
+
# 5.5 EVALUATION ON ATARI
|
| 232 |
+
|
| 233 |
+
We apply our proposed agent to Atari which has been a long established suite to evaluate reinforcement algorithms (Bellemare et al., 2013). Since we focus on sample-efficient learning we present our results in comparison to prior work at 200M steps (Figure 1). Shared experience replay obtains even better performance than not shared experience replay. This confirms the efficient use of parallel exploration (Kretchmar, 2002). The fastest prior agent to reach $4 0 0 \%$ is presented by Kapturowski et al. (2019) requiring more than 3,000M steps. LASER with shared replay achieves $4 2 3 \%$ in 60M per agent. Given 200M steps it achieves $4 4 8 \%$ . We also present a single (no sweep) LASER agent that achieves $4 3 1 \%$ in 200M steps.
|
| 234 |
+
|
| 235 |
+
# 6 CONCLUSION
|
| 236 |
+
|
| 237 |
+
We have presented LASER – an off-policy actor-critic agent which employs a large and shared experience replay to achieve data-efficiency. By sharing experience between concurrently running experiments in a hyper-parameter sweep it is able to take advantage of parallel exploration. As a result it achieves state-of-the-art data efficiency on 57 Atari games given 200M environment steps. Furthermore it achieves competitive results on both DMLab-30 and Atari under regular, not shared experience replay conditions.
|
| 238 |
+
|
| 239 |
+
To facilitate this algorithm we have proposed two approaches: a) mixing replayed experience and on-policy data and b) a trust region scheme. We have shown theoretically and demonstrated through a series of experiments that they enable learning in strongly off-policy settings, which present a challenge for conventional importance sampling schemes.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Brandon Amos, Laurent Dinh, Serkan Cabi, Thomas Rothörl, Sergio Gomez Colmenarejo, Alistair Muldal, Tom Erez, Yuval Tassa, Nando de Freitas, and Misha Denil. Learning awareness models. In ICLR, 2018.
|
| 244 |
+
|
| 245 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. AAAI, 2017.
|
| 246 |
+
|
| 247 |
+
Charles Beattie, Joel Z. Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Küttler, Andrew Lefrancq, Simon Green, Víctor Valdés, Amir Sadik, Julian Schrittwieser, Keith Anderson, Sarah York, Max Cant, Adam Cain, Adrian Bolton, Stephen Gaffney, Helen King, Demis Hassabis, Shane Legg, and Stig Petersen. Deepmind lab. Arxiv, abs/1612.03801, 2016.
|
| 248 |
+
|
| 249 |
+
Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An evaluation platform for general agents. JAIR, 2013.
|
| 250 |
+
|
| 251 |
+
Richard Bellman. A markovian decision process. Journal of Mathematics and Mechanics, 1957.
|
| 252 |
+
|
| 253 |
+
Andrew R. Conn, Nicholas I. M. Gould, and Philippe L. Toint. Trust-Region Methods. SIAM, Philadelphia, PA, USA, 2000.
|
| 254 |
+
|
| 255 |
+
Thomas Degris, Martha White, and Richard S. Sutton. Off-policy actor-critic. In ICML, 2012.
|
| 256 |
+
|
| 257 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir 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 ICML, 2018.
|
| 258 |
+
|
| 259 |
+
Audrunas Gruslys, Will Dabney, Mohammad Gheshlaghi Azar, Bilal Piot, Marc Bellemare, and Remi Munos. The reactor: A fast and sample-efficient actor-critic agent for reinforcement learning. In ICLR, 2018.
|
| 260 |
+
|
| 261 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In ICML, 2018.
|
| 262 |
+
|
| 263 |
+
Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Daniel Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. Arxiv, abs/1710.02298, 2017.
|
| 264 |
+
|
| 265 |
+
Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. In AAAI, 2019.
|
| 266 |
+
|
| 267 |
+
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. In AAAI, 2017.
|
| 268 |
+
|
| 269 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735.
|
| 270 |
+
|
| 271 |
+
Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado van Hasselt, and David Silver. Distributed prioritized experience replay. In ICLR, 2018.
|
| 272 |
+
|
| 273 |
+
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. Arxiv, abs/1711.09846, 2017a.
|
| 274 |
+
|
| 275 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. ICLR, 2017b.
|
| 276 |
+
|
| 277 |
+
Herman Kahn. Use of different monte carlo sampling techniques. Santa Monica, Calif., 1955.
|
| 278 |
+
|
| 279 |
+
Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H. Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, Ryan Sepassi, George Tucker, and Henryk Michalewski. Model-based reinforcement learning for atari. Arxiv, abs/1903.00374, 2019.
|
| 280 |
+
|
| 281 |
+
Steven Kapturowski, Georg Ostrovski, John Quan, Remi Munos, and Will Dabney. Recurrent experience replay in distributed reinforcement learning. In ICLR, 2019.
|
| 282 |
+
|
| 283 |
+
R.M Kretchmar. Parallel reinforcement learning. SCI2002. The 6th World Conference on Systemics, Cybernetics, and Informatics. Orlando, FL, 2002.
|
| 284 |
+
|
| 285 |
+
Guillaume Lample and Devendra Singh Chaplot. Playing FPS games with deep reinforcement learning. In AAAI, 2016.
|
| 286 |
+
|
| 287 |
+
Long-Ji Lin. Reinforcement Learning for Robots Using Neural Networks. PhD thesis, Pittsburgh, PA, USA, 1992. UMI Order No. GAX93-22750.
|
| 288 |
+
|
| 289 |
+
Daniel J. Mankowitz, Augustin Zídek, André Barreto, Dan Horgan, Matteo Hessel, John Quan, Junhyuk Oh, Hado van Hasselt, David Silver, and Tom Schaul. Unicorn: Continual learning with a universal, off-policy agent. Arxiv, abs/1802.08294, 2018.
|
| 290 |
+
|
| 291 |
+
Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J. Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, Dharshan Kumaran, and Raia Hadsell. Learning to navigate in complex environments. In ICLR, 2017.
|
| 292 |
+
|
| 293 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. Arxiv, abs/1312.5602, 2013.
|
| 294 |
+
|
| 295 |
+
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.
|
| 296 |
+
|
| 297 |
+
Volodymyr Mnih, Adrià Puigdomènech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, 2016.
|
| 298 |
+
|
| 299 |
+
Andrew Moore and C. G. Atkeson. Prioritized sweeping: Reinforcement learning with less data and less real time. Machine Learning, 13, October 1993.
|
| 300 |
+
|
| 301 |
+
Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc Bellemare. Safe and efficient off-policy reinforcement learning. In NIPS. 2016.
|
| 302 |
+
|
| 303 |
+
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, abs/1507.04296, 2015.
|
| 304 |
+
|
| 305 |
+
David S. Olton. Mazes, maps, and memory. American Psychologist, 1979.
|
| 306 |
+
|
| 307 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. Understanding the exploding gradient problem. Arxiv, abs/1211.5063, 2012.
|
| 308 |
+
|
| 309 |
+
Doina Precup, Richard S. Sutton, and Satinder P. Singh. Eligibility traces for off-policy policy evaluation. In ICML, 2000.
|
| 310 |
+
|
| 311 |
+
Martin Riedmiller. Neural fitted q iteration – first experiences with a data efficient neural reinforcement learning method. In ECML, 2005.
|
| 312 |
+
|
| 313 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. In ICLR, 2015.
|
| 314 |
+
|
| 315 |
+
Tom Schaul, Diana Borsa, Joseph Modayil, and Razvan Pascanu. Ray interference: a source of plateaus in deep reinforcement learning. 2019.
|
| 316 |
+
|
| 317 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1889–1897, Lille, France, 07–09 Jul 2015. PMLR.
|
| 318 |
+
|
| 319 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. Arxiv, abs/1707.06347, 2017.
|
| 320 |
+
|
| 321 |
+
Richard S. Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artif. Intell., 112(1-2):181–211, August 1999. ISSN 0004-3702. doi: 10.1016/S0004-3702(99)00052-1.
|
| 322 |
+
|
| 323 |
+
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. Proc. of 10th Int. Conf. on Autonomous Agents and Multiagent Systems (AAMAS 2011), 2011.
|
| 324 |
+
|
| 325 |
+
Richard S. Sutton, Ashique Rupam Mahmood, Doina Precup, and Hado van Hasselt. A new $\mathsf { q } ( \lambda )$ with interim forward view and Monte Carlo equivalence. In ICML, 2014.
|
| 326 |
+
|
| 327 |
+
Richard S. Sutton, Andrew G. Barto, and Francis Bach. Reinforcement Learning: An Introduction. MIT press, 2018.
|
| 328 |
+
|
| 329 |
+
Gerald Tesauro. Temporal difference learning and td-gammon. Commun. ACM, 38(3):58–68, March 1995. ISSN 0001-0782. doi: 10.1145/203330.203343.
|
| 330 |
+
|
| 331 |
+
Edward C. Tolman. Cognitive maps in rats and men. The Psychological Review, 1948.
|
| 332 |
+
|
| 333 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double Qlearning. In AAAI, 2016.
|
| 334 |
+
|
| 335 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. In ICLR, 2017.
|
| 336 |
+
|
| 337 |
+
Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. ML, 1992.
|
| 338 |
+
|
| 339 |
+
Zhongwen Xu, Hado P van Hasselt, and David Silver. Meta-gradient reinforcement learning. In NIPS. 2018.
|
| 340 |
+
|
| 341 |
+
Shangtong Zhang and Richard S. Sutton. A deeper look at experience replay. Arxiv, abs/1712.01275, 2017.
|
| 342 |
+
|
| 343 |
+
# APPENDIX A ADDITIONAL EXPERIMENTS
|
| 344 |
+
|
| 345 |
+
# A.1 REDUCED CLIPPING IN V-TRACE DOES NOT ENABLE SHARED EXPERIENCE REPLAY
|
| 346 |
+
|
| 347 |
+
Increasing the clipping constant $\bar { \rho }$ in $\mathrm { v } .$ -trace reduces bias in favour of increased variance. We investigate if reducing bias in this manner enables sharing experience replay between multiple agents in a hyper-parameter sweep. Figure 4 (left) shows that this is not a solution, thus motivating our trust region scheme.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 4: Left: Increasing the V-trace clipping constant $\bar { \rho }$ does not enable shared experience replay. In fact sharing experience replay in this particular way is worse than pure online learning. This motivates the use of our proposed trust region scheme. On a side note, increased clipping thresholds resulting in worse performance verifies the importance of variance reduction through clipping. Right: Median human normalized performance across 30 tasks for the best agent in a sweep, averaged across 2 replicas. All replay experiments use $5 0 \%$ replay ratio and a capacity of 3 million observations. We investigate if uncorrected LSTM states can be used in combination with different replay modes. We consider uniform sampling and prioritization via the critic’s loss, and include both full $\begin{array} { r } { \beta = 1 } \end{array}$ ) and partial $\beta = 0 . 5$ ) importance corrections
|
| 351 |
+
|
| 352 |
+
A.2 PRIORITIZED AND UNIFORM EXPERIENCE REPLAY, LSTM STATES
|
| 353 |
+
|
| 354 |
+
With prioritized experience replay each transition $\tau$ is sampled with probability $P ( \tau ) \propto p _ { \tau } ^ { \alpha }$ , for a suitable unnormalized priority score $p _ { \tau }$ and a global tunable parameter $\alpha$ . It is common (Schaul et al., 2015; Horgan et al., 2018; Hessel et al., 2017) to then weight updates computed from that sample by $1 / P ( \tau ) ^ { \beta }$ for $0 < \beta \leq 1$ , where $\beta = 1$ fully corrects for the bias introduced in the state distribution. In one step temporal difference methods, typical priorities are based on the immediate TD-error, and are typically recomputed after a transition is sampled from replay. This means low priorities might stay low and get stale – even if the transition suddenly becomes relevant. To alleviate this issue, the sampling distribution is mixed with a uniform, as controlled by a third hyper parameter $\epsilon$ .
|
| 355 |
+
|
| 356 |
+
The performance of agents with prioritized experience replay can be quite sensitive to the hyperparameters $\alpha$ , $\beta$ , and $\epsilon$ .
|
| 357 |
+
|
| 358 |
+
A critical practical consideration is how to implement random access for recurrent memory agents such as agents using an LSTM. Prioritized agents sample a presumably interesting transition from the past. This transition may be at any position within the episode. To infer the correct recurrent memory-state at this environment-state all earlier environment-states within that episode would need to be replayed. A prioritized agent with a random access pattern would thus require costly LSTM refreshes for each sampled transition. If LSTM states are not recomputed representational missmatch (Kapturowski et al., 2019) occurs.
|
| 359 |
+
|
| 360 |
+
Sharing experience between multiple agents amplifies the issue of LSTM state representation missmatch. Here each agent has its own network parameters and the state representations between agents may be arbitrarily different.
|
| 361 |
+
|
| 362 |
+
As a mitigation Kapturowski et al. (2019) use a burn-in window or to initialize with a constant starting state. We note that those solutions can only partially mitigate the fundamental issue and that counter examples such as arbitrarily long T-Mazes (Tolman, 1948; Olton, 1979) can be constructed easily.
|
| 363 |
+
|
| 364 |
+
We thus advocate for uniform sampling. In our implementation we uniformly sample an episode. Then we replay each episode from the beginning, using the most recent network parameters to recompute the LSTM states along the way: this is particularly critical when sharing experience between different agents, which may have arbitrarily different state representations.
|
| 365 |
+
|
| 366 |
+
This solution is exact and cost-efficient as it only requires one additional forward pass for each learning step (forward $^ +$ backward pass).
|
| 367 |
+
|
| 368 |
+
An even more cost efficient approach would be to not refresh LSTM states at all. Naturally this comes at the cost of representational missmatch. However it would allow for an affordable implementation of prioritized experience replay. We investigate this in Figure 4 (right) and observe that it is not viable. We compare a baseline V-trace agent with no experience replay, one with uniform experience replay, and two different prioritized replay agents. We do not refresh LSTM states for any of the agents.
|
| 369 |
+
|
| 370 |
+
The uniform replay agent is more data efficient then the baseline, and also saturates at a higher level of performance. The best prioritized replay agent uses full importance sampling corrections ( $\begin{array} { r } { \beta = 1 , } \end{array}$ ). However it performs no higher than with uniform replay. We therefore we used uniform replay with full state correction for all our investigations in the paper.
|
| 371 |
+
|
| 372 |
+
# A.3 EVALUATION PROTOCOL
|
| 373 |
+
|
| 374 |
+
For evaluation, we average episode returns within buckets of 1M (Atari) and 10M (DMLab) environment steps for each agent instance, and normalize scores on each game by using the scores of a human expert and a random agent (van Hasselt et al., 2016). In the multi-task setting, we then define the performance of each agent as the median normalized score of all levels that the agent trains on. Given the use of population based training, we need to perform the comparisons between algorithms at the level of sweeps. We do so by selecting the best performing agent instance within each sweep at any time. Note that for the multi-task setting, our approach of first averaging across many episodes, then taking the median across games, on DMLab further downsampling to 100M env steps, and only finally selecting the maximum within the sweep, results in substantially lower variance than if we were to compute the maximum before the median and smoothing.
|
| 375 |
+
|
| 376 |
+
All DMLab-30 sweeps are repeated $3 \times$ with the exception of $\rho = 2$ and $\rho = 4$ in Figure 4. We then plot a shaded area between the point-wise best and worst replica and a solid line for the mean. Atari sweeps having 57 games are summarized and plotted by the median of the human-normalized scores.
|
| 377 |
+
|
| 378 |
+
# APPENDIX B ALGORITHM PSEUDOCODE
|
| 379 |
+
|
| 380 |
+
We present algorithm pseudocode for LASER with trust region (Algorithm 1). For clarity we present a version without LSTM and focus on the single agent case. The multi-agent case is a simple extension where all agents save to the same replay database and also sample from the same replay. Also each agent starts with different network parameters and hyper-parameters. The LSTM state recomputation can be achieved with Replayer Threads (nearly identical to Actor Threads) that sample entire epsiodes from replay, step through them while reevaluating the LSTM state and slice the experience into trajectories of length $T$ . Similar to regular LSTM Actor Threads from Espeholt et al. (2018) the Replayer Threads send each trajectory together with an LSTM state to the learning thread via a queue. The Learner Thread initializes the LSTM with the transmitted state when the LSTM is unrolled over the trajectory.
|
| 381 |
+
|
| 382 |
+
# Algorithm 1 Single Agent LASER with Trust Region
|
| 383 |
+
|
| 384 |
+
<table><tr><td>Initialize parameter vectors 0. Initialize π1 = 0. Actor Thread: while training is ongoing do</td></tr><tr><td>Sample trajectory unroll u = { t}tε{1...T} of length Tby acting in the environment using the latest πk Where Tt = (St,at,rt, μt = Tk(St|-)). Enqueue u into Lerner Queue, wait if full. Add u into Replay Database.</td></tr><tr><td>Remove oldest trajectory if database has reached desired capacity limit. end while</td></tr><tr><td>Learner Thread: Given: Batch size B,online fraction α. for training iteration k do</td></tr><tr><td>Form training batch U = {ub}b∈{1,.,B} of B trajectories of length T, by dequeuing Bα trajectories from Lerner Queue and sampling B(1 -α) trajectories from Replay Database.</td></tr><tr><td>Evaluate the target policy πk on the sampled transitions in U: i.e. πk(Sb,tl·). Compute behaviour relevance mask M with Mb,t = KL(πk(Sb,tl-)llμb,t) < b where μb,t, Sb,t are obtained from Ub,t ·</td></tr><tr><td>Compute trust-region V-trace return Vt,b using 8 where Xπ,μ(Sb,t) = Mb,t. Let[Lv(0)lt,b=1(Vt,b-Vθ(st,b))². LetAt,b = Vt,b- Vθ(st,b) and [Lp(0)]t,b = pt,blog[πe(St,b|at,b)]At,b,Where ρ is the clipped v-trace importance sampling ratio.</td></tr></table>
|
| 385 |
+
|
| 386 |
+
# APPENDIX C PROPOSITIONS
|
| 387 |
+
|
| 388 |
+
We have stated five propositions in our paper for which we provide proofs below.
|
| 389 |
+
|
| 390 |
+
Proposition 1. The V-trace value estimate $V ^ { \tilde { \pi } }$ is biased: It does not match the expected return of $\pi$ but the return of a related implied policy $\tilde { \pi }$ defined by equation 9 that depends on the behaviour policy $\mu$ :
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\tilde { \pi } _ { \mu } ( a | x ) = \frac { \operatorname* { m i n } \left[ \bar { \rho } \mu ( a | x ) , \pi ( a | x ) \right] } { \sum _ { b \in A } \operatorname* { m i n } \left[ \bar { \rho } \mu ( b | x ) , \pi ( b | x ) \right] }
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
Proof. See Espeholt et al. (2018).
|
| 397 |
+
|
| 398 |
+
Proposition 2. The V-trace policy gradient is biased: given the the optimal value function $V ^ { * }$ the $V .$ -trace policy gradient does not converge to a locally optimal $\pi ^ { * }$ for all off-policy behaviour distributions $\mu$ .
|
| 399 |
+
|
| 400 |
+
Proof. Proof by contradiction:
|
| 401 |
+
|
| 402 |
+
Consider a tabular counter example with a single (locally) optimal policy at $s _ { t }$ given by $\pi ^ { * } ( s _ { t } ) =$ argmaxπ $\textstyle \left[ \sum _ { a \in A } \pi ( a | s _ { t } ) Q ^ { * } ( a , s _ { t } ) \right]$ that always selects the action argmax $\mathbf { \Omega } _ { a } Q ^ { * } ( a , s _ { t } )$ .
|
| 403 |
+
|
| 404 |
+
Even in this ideal tabular setting V-trace policy gradient estimates a different $\tilde { \pi } ^ { * }$ rather than the optimal $\pi ^ { * }$ as follows
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { r l } { \nabla V ^ { * , \pi } ( s _ { t } ) = \mathbf { E } _ { \mu } \left[ \rho _ { t } ( r _ { t } + \gamma V ^ { * } ( s _ { t + 1 } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } & { } \\ & { = \mathbf { E } _ { \mu } \left[ \rho _ { t } Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \mu } \left[ \operatorname* { m i n } \left[ \frac { \pi ( a _ { t } | s _ { t } ) } { \mu ( a _ { t } | s _ { t } ) } , \bar { \rho } \right] Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \mu } \left[ \frac { \pi ( a _ { t } | s _ { t } ) } { \mu ( a _ { t } | s _ { t } ) } \operatorname* { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } ) } \right] Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \pi } \left[ \operatorname* { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } ) } \right] Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \pi } \left[ \operatorname* { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } ) } \right] Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \pi } \left[ \operatorname* { o r } ( s _ { t } , a _ { t } ) Q ^ { * } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \\ & { = \mathbf { E } _ { \pi } \left[ Q ^ { * , \pi } ( s _ { t } , a _ { t } ) \nabla \log \pi ( a _ { t } | s _ { t } ) \right] } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Observe how the optimal Q-function $Q ^ { * }$ is scaled by $\begin{array} { r } { \omega ( s _ { t } , a _ { t } ) = \operatorname* { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } ) } \right] \leq 1 } \end{array}$ resulting in implied state-action values $Q ^ { \ast , \omega }$ . This penalizes actions where $\mu ( a _ { t } | \bar { s } _ { t } ) \bar { \rho } < \pi ( a _ { t } \bar { | } s _ { t } )$ and makes V-trace greedy w.r.t. to the remaining ones. Thus $\mu$ can be chosen adversarially to corrupt the optimal state action value. Note that $\bar { \rho }$ is a constant typically chosen to be 1.
|
| 411 |
+
|
| 412 |
+
To prove the lemma consider a counter example such as an MDP with two actions and $Q ^ { * } = ( 2 , 5 )$ and $\mu = ( 0 . 9 , 0 . 1 )$ and initial $\pi = ( 0 . 5 , 0 . 5 )$ . Here the second action with expected return 5 is clearly favourable. Abusing notation $\mu / \pi = ( 1 . 8 , 0 . 2 )$ . Thus $Q ^ { \tilde { \pi } , \omega } = ( 2 * 1 , 5 * \bar { 0 . 2 } ) = ( 2 , 1 )$ . Therefore $\tilde { \pi } ^ { * } = ( 1 , 0 )$ wrongly selects the first action. □
|
| 413 |
+
|
| 414 |
+
Proposition 3. Mixing on-policy data into the V-trace policy gradient with the ratio $\alpha$ reduces the bias by providing a regularization to the implied state-action values. In the general function approximation case it changes the off-policy $V .$ -trace policy gradient from $\begin{array} { r l } { \sum _ { s } d ^ { \mu } ( s ) \mathbf { E } _ { \pi } \left[ ( Q ( s , a ) \nabla \log \pi ( a | s ) \right] } \end{array}$ to $\begin{array} { r l } { \sum _ { s } \mathbf { E } _ { \pi } \left[ Q ^ { \alpha } ( s , a ) \nabla \log ^ { - } \pi ( a | s ) \right] } \end{array}$ where $Q ^ { \alpha } = Q d ^ { \pi } ( s ) \alpha + Q ^ { \overline { { { \omega } } } } \bar { d } ^ { \mu } ( s ) ( 1 - \bar { \alpha } )$ is a regularized stateaction estimate and $d ^ { \pi }$ , $d ^ { \mu }$ are the state distributions for $\pi$ and $\mu$ . Note that there exists $\alpha \leq 1$ such that $Q ^ { \alpha }$ has the same argmax (i.e. best action) as $Q$ .
|
| 415 |
+
|
| 416 |
+
Proof. Note that the on-policy policy gradient is given by
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\nabla J _ { \mathrm { o n } } ( \pi ) = \sum _ { s } d ^ { \pi } ( s ) \mathbf { E } _ { \pi } \left[ Q ( s , a ) \nabla \log \pi ( a | s ) \right]
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Similarly the off-policy $\mathrm { V } .$ -trace gradient is given by
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\nabla J _ { \mathrm { o f f } } ( \pi ) = \sum _ { s } d ^ { \mu } ( s ) \mathbf { E } _ { \pi } \left[ \omega ( s , a ) Q ( s , a ) \nabla \log \pi ( a | s ) \right]
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
with the V-trace distortion factor $\begin{array} { r } { \omega ( s _ { t } , a _ { t } ) = \operatorname* { m i n } \left[ 1 , \bar { \rho } \frac { \mu ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } ) } \right] \leq 1 } \end{array}$ that can de-emphasize action values and $Q ^ { \omega } ( s , a ) = \omega ( s , a ) Q ( s , a )$ .
|
| 429 |
+
|
| 430 |
+
The $\alpha$ -interpolation of both gradients can be transformed as follows:
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\begin{array} { r l } { \tau [ ( \alpha , \alpha + 1 ) - \alpha ] \dot { \alpha } \dot { \theta } _ { 0 } [ \dot { \varepsilon } ] = } & { \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ G _ { i } ^ { ( i ) } , G _ { i } ^ { ( i ) } , \varepsilon ] [ \Phi _ { i } [ \dot { \varepsilon } ] + \varepsilon _ { i } ^ { \prime } ( G _ { i } ^ { ( i ) } ) } \\ & { \mathrm { ( 1 ) } \quad \omega \dot { \varepsilon } ] \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ G _ { i } ^ { ( i ) } , \varepsilon ] [ \Phi _ { i } [ \dot { \varepsilon } ] \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } ] \varepsilon _ { i } \omega ^ { \prime } ] [ \dot { \varepsilon } ] } \\ & { - \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ G _ { i } ^ { ( i ) } , \omega ] \nabla [ \Phi _ { i } [ \dot { \varepsilon } ] \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } ] ] } \\ & { + \sum _ { i = 1 } ^ { N } \partial _ { i } ^ { ( j ) } [ \Phi _ { i } [ \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } _ { i } ] ] [ \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } ] ] } \\ & { - \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ G _ { i } ^ { ( i ) } , \varepsilon ] [ \Phi _ { i } [ \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } _ { i } ] ] ] } \\ & { + \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ G _ { i } ^ { ( i ) } , \varepsilon ] [ \Phi _ { i } [ \varepsilon _ { i } \omega ^ { \prime } ] [ \Phi _ { i } [ \dot { \varepsilon } _ { i } ] ] ] } \\ & - \sum _ { i = 1 } ^ { N } \dot { \varepsilon } [ \Phi _ { i } [ \varepsilon _ { i } ] [ \Phi _ { i } [ \varepsilon _ { i } ^ { \prime } ] - \varepsilon _ { i } [ \Phi _ { i } [ \varepsilon _ { i } ^ { \prime } ] ] [ \Phi _ { i } [ \varepsilon _ { i } ^ { \prime } ] ] [ \Phi _ { i } [ \varepsilon _ { i } \end{array}
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Interpretation of Proposition 3 As discussed in section 3 the $\mathrm { v } .$ -trace policy gradient will have the correct local fixpoint at state $s$ if the argmax of the state-value function is preserved despite the distortion: i.e. if $\begin{array} { r } { \operatorname { a r g m a x } _ { a } [ Q ( s , a ) ] = \operatorname { a r g m a x } _ { a } [ Q ^ { \omega } ( s , a ) ] } \end{array}$ . Respectively when mixing in an $\alpha \in [ 0 , 1 )$ share of online data the fixpoint will be preserved if
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
\begin{array} { r } { \operatorname { a r g m a x } _ { a } [ Q ( s , a ) ] = \operatorname { a r g m a x } _ { a } [ Q ^ { \alpha } ( s , a ) ] } \end{array}
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
Let $a ^ { * } = \operatorname { a r g m a x } _ { b } ( Q , b )$ be any best action and $A ^ { * }$ be set of best actions. Then equation 12 is equivalent to:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
Q ^ { \alpha } ( s , a ^ { * } ) > Q ^ { \alpha } ( s , b ) \forall b \notin A ^ { * }
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
Using the definition of $Q ^ { \alpha }$ this can be rewritten as:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
Q ( s , a ^ { * } ) d ^ { \pi } ( s ) \alpha + Q ^ { \omega } ( s , a ^ { * } ) d ^ { \mu } ( s ) ( 1 - \alpha ) > Q ( s , b ) d ^ { \pi } ( s ) \alpha + Q ^ { \omega } ( s , b ) d ^ { \mu } ( s ) ( 1 - \alpha ) \forall b \notin A ^ { * }
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
Which can be rearranged to:
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
[ Q ( s , a ^ { * } ) d ^ { \pi } ( s ) - Q ( s , b ) d ^ { \pi } ( s ) ] \alpha > [ Q ^ { \omega } ( s , b ) d ^ { \mu } ( s ) - Q ^ { \omega } ( s , a ^ { * } ) d ^ { \mu } ( s ) ] ( 1 - \alpha ) \forall b \notin A ^ { * }
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
By definition $Q ( s , a ^ { * } ) d ^ { \pi } ( s ) - Q ( s , b ) d ^ { \pi } ( s ) > 0 \forall b \notin A ^ { * }$ , hence:
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
\frac { \alpha } { 1 - \alpha } > \frac { Q ^ { \omega } ( s , b ) - Q ^ { \omega } ( s , a ^ { * } ) } { Q ( s , a ^ { * } ) - Q ( s , b ) } \frac { d ^ { \mu } ( s ) } { d ^ { \pi } ( s ) } \forall b \notin { \cal A } ^ { * }
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
It follows that the policy gradient will have the same local fixpoint if
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\frac { \alpha } { 1 - \alpha } > \operatorname* { m a x } _ { b \notin A ^ { * } } \left[ \frac { Q ^ { \omega } ( s , b ) - Q ^ { \omega } ( s , a ^ { * } ) } { Q ( s , a ^ { * } ) - Q ( s , b ) } \right] \frac { d ^ { \mu } ( s ) } { d ^ { \pi } ( s ) }
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
Note that $\textstyle { \frac { \alpha } { 1 - \alpha } } \to \infty$ as $\alpha 1$ . Mixing-in more online data thus increases the left hand side. Also note that the right hand side decreases due to $d ^ { \mu } ( s ) / d ^ { \pi } ( s )$ if $\pi$ visits the state $s$ more often than $\mu$ . Furthermore the larger the action value gap in the real Q-function $Q ( s , a ^ { * } ) - Q ( s , b )$ the lower the right hand side. Finally the denominator will be negative if $\begin{array} { r } { \operatorname* { m a x } _ { b \notin { A ^ { * } } } [ Q ^ { \omega } ( s , b ) ] < Q ^ { \omega } ( s , a ^ { * } ) } \end{array}$ thus enabling correct learning even in the pure off-policy case with $\alpha = 0$ .
|
| 473 |
+
|
| 474 |
+
Note that all of those conditions can be computed and checked if an accurate Q-function and state distribution is accessible. How to use imperfect Q-function estimates to adaptively choose such an $\alpha$ remain a question for future research.
|
| 475 |
+
|
| 476 |
+
Proposition 4. Let that they all have th $G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } }$ be a set fix point mportance sampling estimaand contract with at least rs as defined in equation 7. Note. Then the contraction properties carry over to $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ . $I n$ particular $V ^ { \pi }$ $| V _ { \mathrm { t r u s t e d } } ^ { \pi } - V ^ { \pi } | _ { \infty } \leq \gamma | V - V ^ { \pi } | _ { \infty }$ $\gamma$ .
|
| 477 |
+
|
| 478 |
+
Proof. Let us consider the set of importance sampling estimators as defined in 7 and note that they all contract to the same fixed point $V ^ { \pi }$ with at least $\begin{array} { r } { \left| \mathbf { E } _ { \mu _ { z } | z } \left[ G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } } ( s ) \right] - V ^ { \pi } ( s ) \right| _ { \infty } \le } \end{array}$ $\gamma \left| V ( s ) - V ^ { \pi } ( s ) \right| _ { \infty }$ for any state $s$ .
|
| 479 |
+
|
| 480 |
+
By Minkowski’s inequality the contraction properties of importance sampled Monte-Carlo bootstraps carry over to $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ which is a $p ( z | \mu _ { z } \in \mathbf { \bar { M } } _ { \beta , \pi } ( s _ { t } ) )$ weighted average:
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { r l } & { \left| V _ { \mathrm { t r u s t e d } } ^ { \pi } ( s ) - V ^ { \pi } ( s ) \right| _ { \infty } = \left| \mathbf E _ { z } \Big [ \mathbf E _ { \mu _ { z } | z } \left[ G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } } ( s ) \right] \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] - V ^ { \pi } ( s ) \right| _ { \infty } } \\ & { \qquad = \Big | \mathbf E _ { z } \Big [ \mathbf E _ { \mu _ { z } | z } \left[ G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } } ( s ) \right] - V ^ { \pi } ( s ) \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] \Big | _ { \infty } } \\ & { \qquad \le \mathbf E _ { z } \Big [ \left| \mathbf E _ { \mu _ { z } | z } \left[ G _ { \mathrm { I S } } ^ { \pi , \mu _ { z } } ( s ) \right] - V ^ { \pi } ( s _ { t } ) \right| _ { \infty } \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] } \\ & { \qquad < \mathbf E _ { z } \Big [ \gamma | V ( s ) - V ^ { \pi } ( s ) | _ { \infty } \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] } \\ & { \qquad = \gamma \left| V ( s ) - V ^ { \pi } ( s ) \right| _ { \infty } } \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
Proposition 5. Let $G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } }$ be a set of $V .$ -trace estimators (see equation 8) with corresponding fixed points (see equation $\cdot$ ) to which they contract at a speed of an algorithm and behaviour specific $\eta _ { z }$ . Then $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ moves towards $V ^ { \beta ^ { * } } = \mathbf { { E } } _ { z \mid \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \left[ \tilde { V ^ { z } } \right]$ shrinking the distance as follows $\begin{array} { r } { \big | V _ { \mathrm { t r u s t e d } } ^ { \pi } - V ^ { \beta } \big | _ { \infty } < \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } | \eta _ { z } ( V - V ^ { z } ) | _ { \infty } \leq \eta _ { \operatorname* { m a x } } \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } | ( V - V ^ { z } ) | _ { \infty } } \end{array}$ with $\eta _ { \mathrm { m a x } } = \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \eta _ { z }$ .
|
| 487 |
+
|
| 488 |
+
Proof. Recall the contraction properties of a $\mathbf { V }$ -trace importance sampled Monte-Carlo bootstraps $G _ { \mathrm { V t r a c e } } ^ { \pi , \bar { \mu } _ { z } }$ being
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\left| \mathbf { E } _ { \mu _ { z } | z } \left[ G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } } ( s ) \right] - V ^ { z } ( s ) \right| _ { \infty } < \eta _ { z } \left| V ( s ) - V ^ { z } ( s ) \right| _ { \infty }
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
for an algorithm and behaviour specific $\eta _ { z } ~ < ~ 1$ for a $z$ dependent fixed point $V ^ { z }$ and for any bootstrap $V$ . We then show that $V _ { \mathrm { t r u s t e d } } ^ { \pi }$ moves towards the weighted average of fixed points $V ^ { \beta } = \mathbf { E } _ { z | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \left[ V ^ { z } \right]$ , since
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\big | V _ { \mathrm { t r u s t e d } } ^ { \pi } ( s ) - V ^ { \beta } ( s ) \big | _ { \infty } < \eta _ { \mathrm { m a x } } \operatorname* { m a x } _ { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } \big | V ( s ) - V ^ { z } ( s ) \big | _ { \infty }
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
holds for any bootstrap function $V$ as we show below.
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\begin{array} { r l } & { | V _ { \mathrm { t r u s t e d } } ^ { \pi } ( s ) - V ^ { \beta } ( s ) | _ { \infty } = | \mathbf { E } _ { z } \Big [ \mathbf { E } _ { \mu _ { z } | z } \big [ G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } } ( s ) \big ] - V ^ { z } ( s ) \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] | _ { \infty } } \\ & { \qquad \leq \mathbf { E } _ { z } [ | \mathbf { E } _ { \mu _ { z } | z } \big [ G _ { \mathrm { V t r a c e } } ^ { \pi , \mu _ { z } } ( s ) \big ] - V ^ { z } ( s ) \big | _ { \infty } \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) ] } \\ & { \qquad < \mathbf { E } _ { z } \Big [ \big | \eta _ { z } \big ( V ( s ) - V ^ { z } ( s ) \big ) \big | _ { \infty } \Big | \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) \Big ] } \\ & { \qquad \leq \underset { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } { \operatorname* { m a x } } \big | \eta _ { z } \big ( V ( s ) - V ^ { z } ( s ) \big ) \big | _ { \infty } } \\ & { \qquad \leq \eta _ { \operatorname* { m a x } } \underset { \mu _ { z } \in M _ { \beta , \pi } ( s _ { t } ) } { \operatorname* { m a x } } \big | V ( s ) - V ^ { z } ( s ) \big | _ { \infty } } \end{array}
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
# APPENDIX D DETAILED ATARI RESULTS
|
| 507 |
+
|
| 508 |
+
We display the Atari per-level performance of various agents at 50M and 200M environment steps in Table 2. The scores correspond to the agents presented in Figure 1. The LASER scores are computed by averaging the last 100 episode returns before 50M or respectively 200M environment frames have been experienced. Following the procedure defined by Mnih et al. (2015) we initialize the environment with a random number of no-op actions (up to 37 in our case). Again following Mnih et al. (2015) episodes are terminated after 30 minutes of gameplay. Note that Xu et al. (2018) have not published per-level scores. Rainbow scores are obtained from Hessel et al. (2017).
|
| 509 |
+
|
| 510 |
+
Table 2: Per level performance of various agents at 50M and 200M environment steps (see Figure 1).
|
| 511 |
+
|
| 512 |
+
<table><tr><td rowspan="2">Game</td><td rowspan="2">LASER Shared (sweep at 50M)</td><td rowspan="2">LASERShared (sweep at 200M)</td><td rowspan="2">LASER (no sweep at 200M)</td><td rowspan="2">Rainbow (no sweep at 200M)</td></tr><tr><td></td></tr><tr><td>alien</td><td>18635.3</td><td>18277.3</td><td>35565.9</td><td>9491.7</td></tr><tr><td>amidar</td><td>1838.3</td><td>2695</td><td>1829.2</td><td>5131.2</td></tr><tr><td>assault</td><td>26027.1</td><td>40603.2</td><td>21560.4</td><td>14198.5</td></tr><tr><td>asterix</td><td>496735.0</td><td>240770</td><td>240090</td><td>428200</td></tr><tr><td>asteroids</td><td>232651</td><td>257420.1</td><td>213025</td><td>2712.8</td></tr><tr><td>atlantis</td><td>889934.0</td><td>866584</td><td>841200</td><td>826660</td></tr><tr><td>bank_heist</td><td>1333.1</td><td>1712.8</td><td>569.4</td><td>1358</td></tr><tr><td>battle_zone</td><td>66900</td><td>131880.0</td><td>64953.3</td><td>62010</td></tr><tr><td>beam_rider</td><td>80830.5</td><td>125795.2</td><td>90881.6</td><td>16850.2</td></tr><tr><td>berzerk</td><td>46651.6</td><td>64513.1</td><td>25579.5</td><td>2545.6</td></tr><tr><td>bowling</td><td>42.4</td><td>47.4</td><td>48.3</td><td>30</td></tr><tr><td>boxing</td><td>99.8</td><td>99.4</td><td>100.0</td><td>99.6</td></tr><tr><td>breakout</td><td>852.5</td><td>850.3</td><td>747.9</td><td>417.5</td></tr><tr><td>centipede</td><td>208008</td><td>409702.8</td><td>292792</td><td>8167.3</td></tr><tr><td>chopper_command</td><td>24814</td><td>727333</td><td>761699.0</td><td>16654</td></tr><tr><td>crazy_climber</td><td>160494</td><td>88818</td><td>167820</td><td>168788.5</td></tr><tr><td>defender</td><td>355447</td><td>369397.0</td><td>336953</td><td>55105</td></tr><tr><td>demon_attack</td><td>133557</td><td>138000.6</td><td>133530</td><td>111185</td></tr><tr><td>double_dunk</td><td>0.1</td><td>23.5</td><td>14</td><td>-0.3</td></tr><tr><td>enduro</td><td>0</td><td>0</td><td>0</td><td>2125.9</td></tr><tr><td>fishing_derby</td><td>45.4</td><td>62.6</td><td>45.2</td><td>31.3</td></tr><tr><td>freeway</td><td>34.0</td><td>34.0</td><td>0</td><td>34.0</td></tr><tr><td>frostbite</td><td>5297.4</td><td>2230.8</td><td>5083.5</td><td>9590.5</td></tr><tr><td>gopher</td><td>86222.2</td><td>39721.2</td><td>114820.7</td><td>70354.6</td></tr><tr><td>gravitar</td><td>1360.5</td><td>2812.0</td><td>1106.2</td><td>1419.3</td></tr><tr><td>hero</td><td>30159.2</td><td>36510.6</td><td>31628.7</td><td>55887.4</td></tr><tr><td>ice_hockey</td><td>20.2</td><td>38.7</td><td>17.4</td><td>1.1</td></tr><tr><td>jamesbond</td><td>21663</td><td>60402.5</td><td>37999.8</td><td>19809</td></tr><tr><td>kangaroo</td><td>13932</td><td>14187</td><td>14308</td><td>14637.5</td></tr><tr><td>krull</td><td>9559.3</td><td>5743.6</td><td>9387.5</td><td>8741.5</td></tr><tr><td>kung_fu_master</td><td>65032</td><td>81792</td><td>607443.0</td><td>52181</td></tr><tr><td>montezuma_revenge</td><td>1</td><td>1</td><td>0.3</td><td>384.0</td></tr><tr><td>ms_pacman</td><td>6089.3</td><td>6890.7</td><td>6565.5</td><td>5380.4</td></tr><tr><td>name_this_game</td><td>25998.9</td><td>27910.7</td><td>26219.5</td><td>13136</td></tr><tr><td>phoenix</td><td>458355</td><td>628711.6</td><td>519304</td><td>108529</td></tr><tr><td>pitfall</td><td>-0.2</td><td>-0.2</td><td>-0.6</td><td>0.0</td></tr><tr><td>pong</td><td>21.0</td><td>21.0</td><td>21.0</td><td>20.9</td></tr><tr><td>private_eye</td><td>100</td><td>100</td><td>96.3</td><td>4234.0</td></tr><tr><td>qbert</td><td>20283.8</td><td>24600.8</td><td>21449.6</td><td>33817.5</td></tr><tr><td>riverraid</td><td>24138.1</td><td>35491.5</td><td>40362.7</td><td>22920.8</td></tr><tr><td>road_runner</td><td>52942</td><td>63762.0</td><td>45289</td><td>62041</td></tr><tr><td>robotank</td><td>63.6</td><td>67.8</td><td>62.1</td><td>61.4</td></tr><tr><td>seaquest</td><td>1802.2</td><td>557213.3</td><td>2890.3</td><td>15898.9</td></tr><tr><td>skiing</td><td>-8904.8</td><td>-8980.1</td><td>-29968.4</td><td>-12957.8</td></tr><tr><td>solaris</td><td>2222.4</td><td>3017.6</td><td>2273.5</td><td>3560.3</td></tr><tr><td>space_invaders</td><td>36071.4</td><td>53124.3</td><td>51037.4</td><td>18789</td></tr><tr><td>star_gunner</td><td>331327</td><td>602540.0</td><td>321528</td><td>127029</td></tr><tr><td>surround</td><td>9.8</td><td>9.8</td><td>8.4</td><td>9.7</td></tr><tr><td>tennis</td><td>0</td><td>0</td><td>12.2</td><td>0</td></tr><tr><td>time_pilot</td><td>77899</td><td>113603.0</td><td>105316</td><td>12926</td></tr><tr><td>tutankham</td><td>251.8</td><td>268.5</td><td>278.9</td><td>241</td></tr><tr><td>up_n_down</td><td>341988</td><td>368586.5</td><td>345727</td><td>125755</td></tr><tr><td>venture</td><td>0</td><td>0</td><td>0</td><td>5.5</td></tr><tr><td>video_pinball</td><td>513121</td><td>397451</td><td>511835</td><td>533936.5</td></tr><tr><td>wizard_of_wor</td><td>22280</td><td>45335.0</td><td>29059.3</td><td>17862.5</td></tr><tr><td>yars_revenge</td><td>145055</td><td>144370</td><td>166292.3</td><td>102557</td></tr><tr><td>zaxxon</td><td>50486</td><td>106862.0</td><td>41118</td><td>22209.5</td></tr></table>
|
md/train/HyxnnnVtwB/HyxnnnVtwB.md
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HIGH-PERFORMANCE RNNS WITH SPIKING NEURONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The increasing need for compact and low-power computing solutions for machine learning applications has triggered significant interest in energy-efficient neuromorphic systems. However, most of these architectures rely on spiking neural networks, which typically perform poorly compared to their non-spiking counterparts in terms of accuracy. In this paper, we propose a new adaptive spiking neuron model that can be abstracted as a low-pass filter. This abstraction enables faster and better training of spiking networks using back-propagation, without simulating spikes. We show that this model dramatically improves the inference performance of a recurrent neural network and validate it with three complex spatio-temporal learning tasks: the temporal addition task, the temporal copying task, and a spoken-phrase recognition task. We estimate at least $5 0 0 \times$ higher energy-efficiency using our models on compatible neuromorphic chips in comparison to Cortex-M4, a popular embedded microprocessor.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Exponential growth in computational power and efficiency have played a vital role in the development of neural networks and their training algorithms. However, it has also led to higher design complexity and increasing difficulty to keep up with Moore’s law (Schaller, 1997; Waldrop, 2016). Recent years have also seen the movement of computation from data-centres to compact, distributed, and portable embedded systems. These factors have created a demand for energy-efficient AI-capable devices, leading to the development of dedicated and optimized von Neumann-style Artificial Neural Network (ANN) accelerators (Aimar et al., 2018; Cavigelli and Benini, 2016; Chen et al., 2016) and a renewed interest in neuromorphic systems (Chicca et al., 2014; Frenkel et al., 2019; Davies et al., 2018; Moradi et al., 2018; Akopyan et al., 2015; Qiao et al., 2015; Neckar et al., 2019).
|
| 12 |
+
|
| 13 |
+
A key difference between neural networks deployed on von Neumann systems and most neuromorphic platforms is the use of spikes or train of pulses to represent signals in the latter. Such networks are called Spiking Neural Networks (SNNs). Spiking neuromorphic systems have a number of features that inhibit their use in real-world problems: (1) mixed-signal circuits suffer from Complementary Metal-Oxide-Semiconductor (CMOS) mismatch (Pelgrom et al., 1989) that degrades performance; (2) rate-based SNNs generate a large number of spikes to represent signals that reduces their energy benefit; (3) complex spiking dynamics makes it difficult to train them using gradient-descent methods. In this paper, we describe a new neuron model that addresses these problems and discuss how its Low-Pass Filter (LPF) abstraction enables training spiking Recurrent Neural Networks (RNNs) using the backpropagation algorithm (or Backprop). This is a significant breakthrough as it enables training and deployment of energy-efficient spiking neural network devices without simulating complex spiking dynamics.
|
| 14 |
+
|
| 15 |
+
# 2 PROCESSING-IN-MEMORY FOR RNNS
|
| 16 |
+
|
| 17 |
+
Consider an RNN layer with $n$ nodes. At each time-step, the processor computes one or several matrix products of the form $y = W . x$ , where $_ y$ and $x$ are vectors of length $n$ , and $W$ is a 2-D matrix of size $n \times n$ . When operating on a von Neumann system with batch-size 1, as is common in most edge applications, the bottleneck in throughput and energy-efficiency is the $O ( n ^ { 2 } )$ memory fetches of $W$ at every timestep. An in-memory matrix multiplier addresses this problem. It is a module where a “read” from the memory location of the $W$ matrix, using “X” as the “address” gives out “Y”, without ever moving $W$ . This leads to a quadratic reduction in energy consumption. Processing in-memory systems have been implemented for various tasks such as DNA sequencing (Ghose et al., 2018), graph processing (Ahn et al., 2015), etc and with dramatic reduction in energy consumption.
|
| 18 |
+
|
| 19 |
+
The energy reduction from in-memory computing is well established, but the key challenge with deploying such systems is the absence of compatible algorithms. In this paper, we propose an RNN model for such a system. The implementation of the in-memory module depends on how $x$ and $y$ are encoded and transported. It can be synchronous or asynchronous and analogue or digital. We adopt an asynchronous digital approach as it offers some implementation advantages. Encoding information in binary digital format is less susceptible to noise in comparison to analogue. Asynchronous signalling allows the energy-consumption to scale in proportion to chip activity, while also permitting lowlatency response. Chips implementing such schemes have been published in literature (Qiao et al., 2015; Moradi et al., 2018). The model presented in this paper is designed to integrate on similar chips (A reference framework is described in supplementary section D). However, most of the algorithmic ideas presented in this paper are general and applicable to a range of compute systems.
|
| 20 |
+
|
| 21 |
+
# 3 THE SPIKING NEURON MODEL
|
| 22 |
+
|
| 23 |
+
Spiking neuron models for encoding signals typically use rate- or time-coded spike-generation schemes (Diehl et al., 2015; Rueckauer et al., 2017; Bohte, 2012; Mostafa, 2017). In rate-coding, the firing rate of the neuron is proportional to the input signal. Therefore, achieving high data-resolution with rate-coding requires a large number of spikes, which is not energy-efficient (Nair and Indiveri, 2019). To address this problem, several time-coding schemes have been proposed. In this work, we build on existing models to propose an Adaptive Integrate and Fire (aI&F) neuron model, which can also be interpreted as an asynchronous $\Sigma \Delta$ circuit (Nair and Indiveri, 2019; Bohte, 2012; Yoon, 2016). This mechanism reduces the spike count by only transmitting the error between an internal state and the input. The aI&F neuron model implemented with current-mode neuromorphic circuits (Nair and Indiveri, 2019) can be described by the following equations:
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\begin{array} { c } { { \tau _ { m e m } \displaystyle \frac { d I _ { m e m } } { d t } = \alpha _ { L } ( I _ { L } - I _ { m e m } ) - s + i } } \\ { { \tau _ { w } \displaystyle \frac { d s } { d t } = \alpha _ { s } ( I _ { m e m } - I _ { L } ) - s } } \\ { { \displaystyle I _ { m e m } = 0 , \mathrm { w h e n } I _ { m e m } > \Delta } } \end{array}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where the currents $I _ { m e m }$ and $I _ { L }$ represent the “membrane potential” and “leak reversal potential” variables. The term $s$ represents the neuron adaptation current, $i$ the input current, $\tau _ { m e m }$ the membrane time constant, $\alpha _ { L }$ a gain factor, $\Delta$ the threshold, $\alpha _ { s }$ the adaptation coupling parameter and $\tau _ { w }$ is the adaptation time constant. The aI&F model is a feedback loop that tries to decrease the difference between the $i ( t )$ and $s ( t )$ . The difference, $i ( t ) - s ( t )$ , is filtered with gain, $\alpha _ { L }$ , and time constant, $\tau _ { m e m }$ . When the output of this filter, $I _ { m e m }$ , exceeds the spiking threshold, $\Delta$ , $I _ { m e m }$ is reset and a spike is generated. The $\Sigma \Delta$ circuit model used in this work is different from the aI&F model in the computation of the feedback term. Instead of filtering $I _ { m e m }$ , we operate on the spike train generated by the spiking neuron. This ensures that the noise inserted by the spike-generation mechanism is also suppressed by the $\Sigma \Delta$ feedback. The modified feedback equation is as follows:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\tau _ { k } \frac { d s } { d t } = \alpha _ { s } ( \delta _ { i } I _ { i n } - I _ { L } ) - s
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Where, $\delta _ { i }$ indicates the spike train and $I _ { i n }$ is a programmable maximum current value that the analogue filter implementation can generate. The product $\delta _ { i } I _ { i n }$ models the feedback filter that integrates a current $I _ { i n }$ for the duration of the spikes. Figure 1a shows a block diagram of the circuit implementation of the Equation 3 with the modification described by Equation 4. In this diagram, $F ( s )$ is a first order LPF that receives inputs to the neuron. $H ( s )$ is a first-order low-pass filter that produces $s ( t )$ in response to spikes generated by the neuron. $\operatorname { \dot { \cal E } } ( s )$ is also a first-order low-pass filter on the difference between the input current $i ( t )$ and the feedback signal $s ( t )$ . When the output of $E ( s )$ , $I _ { m e m }$ , exceeds the spiking threshold $( \Delta )$ of the neuron, a spike-event is produced. With each spike-event, $s ( t )$ increases and $i ( t ) - s ( t )$ decreases. Figure 1b shows the asynchronous $\Sigma \Delta$ feedback loop in action for a test-case. It can be shown that the Laplace domain representation of the output spike train can be expressed by the equation:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
Y ( s ) = { \frac { X ( s ) F ( s ) E ( s ) } { 1 + H ( s ) E ( s ) } } + { \frac { N ( s ) } { 1 + H ( s ) E ( s ) } }
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: (a) The block marked pulse $\Delta$ encoder is similar to the aI&F neuron model. The LPF stage at the input makes it an asynchronous $\Sigma \Delta$ loop. (b) Evolution of the feedback signal, $s ( t )$ , over time. The sudden jumps in $s ( t )$ correspond to spike events, $y ( t )$ .
|
| 43 |
+
|
| 44 |
+
where, $N ( s )$ indicates the Laplace-domain representation of the noise introduced into the loop, for example by the spike generation mechanism. The $\Sigma \Delta$ loop described by Equation 5 is similar to a continuous-time $\Sigma \Delta$ modulation loop (Pavan et al., 2017) with the key difference being that the output spikes are unipolar. This is valuable because the output of a conventional $\Sigma \Delta$ loop is always active ( $+ 1$ or $^ { - 1 }$ ), whereas the asynchronous model is only active at the time of a spike event, making the model more energy-efficient.
|
| 45 |
+
|
| 46 |
+
The input signals to the neuron may be encoded as spikes trains or as continuous analogue values from a sensor. The transmitted analogue signal is reconstructed from a spike train by simply low-pass filtering it. An advantage of the $\Sigma \Delta$ neuron model is that it comes with a low-pass filter in its input stage. Therefore, a $\Sigma \Delta$ neuron is a “codec” - It can both encode an analogue signal into a spike train and decode an incoming spike train back to the transmitted analogue signal. As the low-pass filter at the input stage is agnostic of the type of input to it, a $\Sigma \Delta$ can encode and decode both types of signals - spike trains or continuous analogue ones. A description of the biological motivation and noise-filtering properties of the model is provided in supplementary section A. The circuit implementing this model has been fully characterized in Nair and Indiveri (2019).
|
| 47 |
+
|
| 48 |
+
# 4 TRAINING A SPIKING RNN WITHOUT SIMULATING SPIKES
|
| 49 |
+
|
| 50 |
+
The neuron model introduced in the previous section allows us to train a recurrent SNN by treating the spiking neurons as LPFs and modifying the recurrent ANN equations suitably. We will show that the trained weight parameters of the recurrent ANN model can be mapped to a recurrent SNN, without additional training. We measure the effectiveness of this mapping procedure by comparing the temporal dynamics of the neurons in the recurrent ANN to the low-pass filtered spike trains generated by the spiking neurons in the corresponding recurrent SNN. In this demonstration, we use high precision synaptic weights. This is typically not available in most spiking neuromorphic platforms. However, the same mapping procedure can be used for mapping ANNs trained with binary or noisy weights. Before introducing the mapping procedure, we describe three operations that are needed for it.
|
| 51 |
+
|
| 52 |
+
Input re-scaling: When implementing an SNN in mixed-signal neuromorphic systems, the state variables of the neuron are represented by voltages or currents that are of the order of $\mathrm { m V }$ or nA. Using such small values when training an ANN in software may lead to computational instability. To avoid this we train the network with normalized input signals and re-scale the parameters and activation functions after training. For example, if a single layer calculation is represented as $y = \sigma _ { n l } ( W \cdot x )$ , where $\sigma _ { n l }$ is a non-linear activation function, $x$ , $W$ and $y$ are the inputs, weights, and outputs from the layer, respectively, then, to re-scale the inputs by a factor $\gamma$ , the activation function used in the ANN will be modified, during inference, as $y = \overline { { \sigma _ { n l } } } ( W \cdot \gamma \cdot x )$ , where, $\overline { { \sigma _ { n l } } } ( . ) = \sigma _ { n l } \left( \frac { . } { \gamma } \right)$
|
| 53 |
+
|
| 54 |
+
Low-pass filtering: The input signal can be reconstructed from the spikes trains generated by the $\Sigma \Delta$ neuron if $s ( t )$ tracks $i ( t )$ (Equation 4). This is because $s ( t )$ is obtained by filtering the neuron spike train. This is why a $\Sigma \Delta$ neuron can be modelled as an LPF with time constant $\tau _ { w }$ . The LPF approximation ignores the high-frequency components injected by the spiking mechanism, as they are suppressed by feedback loop (the $N ( s )$ term in the transfer function of $\Sigma \Delta$ neuron, Equation 5). We model this by using a discrete-time Euler approximation to incorporate a LPF-term at the output of the RNN stage. This results in the Low-Pass Recurrent Neural Network (lpRNN) cell by a simple tweak to the classical equation:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
y _ { t } = \alpha \odot y _ { t - 1 } + ( 1 - \alpha ) \odot \sigma ( W _ { r e c } \cdot y _ { t - 1 } + W _ { i n } \cdot x _ { t } + b )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where, $\sigma , \odot$ and $\cdot$ denote non-linearity, element-wise Hadamard product and matrix multiplication functions, respectively. The variables $\alpha$ , $y _ { n }$ , $x _ { n }$ , $W _ { r e c }$ , $W _ { i n }$ , and $b$ represent the retention ratio vector, input vector, output vector, recurrent connectivity weight matrix, input connectivity weight matrix, and biases, respectively. The subscripts on variable $y$ and $x$ indicate the time step. $\alpha$ models the time constant of the recurrent ANN, and it is matched to the SNN time constant by setting it to $\alpha = e ^ { \frac { - T s } { \tau _ { s } } }$ where, $T s$ is the time-step of the input data-stream fed to the recurrent ANN, and $\tau _ { s }$ is the feedback time constant of the $\Sigma \Delta$ neurons used in the desiredSNN.
|
| 61 |
+
|
| 62 |
+
For example, if the recurrent ANN is being trained to detect speech from an audio-signal, then $T s$ should be set equal to the time difference between the consecutive samples. The value of $\tau _ { s }$ , for the ANN set to $m i n ( \tau _ { w } , \tau _ { m e m } )$ in the $\Sigma \Delta$ equations. $\tau _ { s }$ must therefore be chosen such that the signals being transmitted lie well within the pass-band of the feedback filter. This ensures that all the in-band components are transmitted well, even when different neurons in the systems have different values of $\tau _ { s }$ , for example, due to mismatch. This is an important observation for mixed-signal systems, where mismatch effects may result in different neurons to have differing time-constants. We will demonstrate that the effect of device mismatch is well-tolerated for most practical cases and leads to gradual degradation in performance as it increases. It must be noted that while computing $T s$ or the bandwidth of an audio or sensor measurement is easy, it is not trivial for data-sets such as text.
|
| 63 |
+
|
| 64 |
+
Saturating non-linearity: It has already been shown in the literature that the Rectified Linear Unit (ReLU) non-linearity is a good non-linear model of the aI&F neuron (Yoon, 2016; Bohte, 2012). However, the $\Sigma \Delta$ neuron also filters incoming spike trains using a low-pass filter which limits its maximum output current to $I _ { i n }$ (see Equation 4). To model this effect we can either set $I _ { i n }$ in the SNN to the largest activation output found in the ANN simulation or clamp the maximum output of the activation function in the ANN simulation to $I _ { i n }$ . In our experiments, we do the latter.
|
| 65 |
+
|
| 66 |
+
# 4.1 THE MAPPING PROCEDURE
|
| 67 |
+
|
| 68 |
+
First, the recurrent ANN cell is modified by replacing the RNN units with the lpRNN. The modified network is then trained using Backprop with conventional Autograd tools provided by libraries such as PyTorch or Tensorflow. This gives us the synaptic weights for the recurrent SNN. Then, the largest value attained by the state variables in the trained network is mapped to $I _ { i n }$ . This ensures that the spiking neurons do not saturate. Finally, the inputs to the SNN are re-scaled to suitable currents or voltage values as described earlier.
|
| 69 |
+
|
| 70 |
+
Limitation: A recurrent SNN is a continuous-time system that spikes hundreds to thousands of times per second to achieve the necessary transmission accuracy. Therefore, the time step of the transient simulation needs to be made very fine. The mapping algorithm assumes that the mapped SNN operates on the same sequence that the original ANN is trained on. This is a problem. Training a recurrent ANN on a long sequence using back-propagation is computationally expensive and often intractable because of vanishing and exploding gradients. For example, with speech signals sampled at the standard rate of $4 4 . 1 \mathrm { k H z }$ , even a short utterance is thousands of samples long. If we are unable to train an ANN for the desired task, the mapping mechanism is useless. Our approach to addressing this issue is to train the ANN with sub-sampled signals. After we compute the desired weights, we rescale the time-constants of the network before mapping it to the SNN. If the simulation time-step for the SNN is TsSNN and that of ANN is TsANN , then the time constants of the two simulations are given by $\alpha _ { A N N } = e ^ { - \frac { T _ { s _ { A N N } } } { \tau } }$ and $\alpha _ { S N N } = e ^ { - \frac { T _ { s _ { S N N } } } { \tau } }$ . We only rescale the time constants without changing the weights of the mapped network, introducing inaccuracies in the mapped network. The mismatch arises because a single time-step of the ANN corresponds to several simulation time-steps in the mapped SNN TsANNTs ). The mapping is exact for a first-order LPF because of the Linear Time-Invariant (LTI) property. However, even though an RNN is non-linear, by making the low-pass filtering effect more dominant (for example, with $\alpha = 0 . 9 9$ ), we observe that the mapped dynamics match well.
|
| 71 |
+
|
| 72 |
+
# 5 EXPERIMENTAL RESULTS
|
| 73 |
+
|
| 74 |
+
All the spiking simulations in the following sections are run on a custom transient mixed-signal modeling library, called spiking simulator for systems of 1st-order LPFs (Spiker). The motivation for design and operation of Spiker is described in supplementary section E.
|
| 75 |
+
|
| 76 |
+
# 5.1 ENCODING PERFORMANCE OF THE SIGMA–DELTA NEURON MODEL
|
| 77 |
+
|
| 78 |
+
The $\Sigma \Delta$ neuron model used in the mapped SNN is not an ideal transmitter of information as the spiking mechanism introduces error akin to quantization noise. This is analogous to use of low bit-precision in conventional ANNs. It is important to measure how much precision is available using a metric that is meaningful for the proposed spiking architecture. We measure this using a Signal-to-Distortion ratio (SDR) metric when encoding a sinusoidal input and reconstructing it with an LPF. The SDR is the ratio between the energy contained in the transmitted signal and total energy in all other frequency components generated by the distortions introduced in the signal chain. The results of these experiments are shown in Figure 2. We note in Figure 2a that highest SDR of the $\Sigma \Delta$ neuron is 55dB, with a 20 dB/decade roll-off as a function of frequency with a pole corresponding to $\tau _ { m e m }$ . Figure 2b highlights the input amplitude-dependence of the SDR. We note in Figure 2b that the SDR improves as a logarithmic function of the input amplitude and then drops suddenly. The logarithmic improvement in SDR is because the error component corresponding to the spiking threshold, $\Delta$ , becomes a smaller fraction of the input amplitude. The sudden drop occurs when the input amplitude approaches and exceeds $I _ { i n }$ in Equation 4. This is because the maximum attainable value of the feedback term, $s ( t )$ in Equation 4 is $I _ { i n }$ . Under these conditions, $I _ { m e m }$ is always greater than $s ( t )$ , causing the neuron to fire at a very high rate. For the rest of the SNN simulations in this paper, the $\Sigma \Delta$ neuron settings listed in Figure 2 caption are used.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: SDR of the $\Sigma \Delta$ neuron as a function of sinusoidal input parameters. The $\Sigma \Delta$ neuron is fed a single-tone sinusoid riding on a DC bias to ensures that the input is non-negative. The transient simulations are run with a simulation time step of $1 \mu \mathrm { s }$ . This is the reason for the saturation in the firing rate in (b). The SDR ratio is reported after subtracting the DC component. The neuron parameters for the simulation are $\tau _ { m e m } = 0 . 0 0 7 s$ , $\tau _ { w } = 0 . 0 0 1 4 s$ , $\alpha _ { L } = 5 0 0 0$ , $\alpha _ { s } = 1$ , $\Delta = 0 . 1 n A$ , $I _ { i n } = 4 0 n A$ , $I _ { L } = 0 n A$ .
|
| 82 |
+
|
| 83 |
+
# 5.2 DEMONSTRATION OF THE MAPPING MECHANISM
|
| 84 |
+
|
| 85 |
+
We demonstrate the mapping mechanism using multi-layer RNNs. The ANN dynamics are compared against a signal obtained by low-pass filtering the spike trains generated by the $\Sigma \Delta$ neuron. Our assertion is that the mapping mechanism will map any recurrent ANN to an equivalent recurrent SNN. Therefore, instead of demonstrating the mapping for a particular task, we set synaptic weights to random samples from a Gaussian distribution. We then compare the dynamics of all the neuron units in the mapped and original networks. To ensure that our nodes do not saturate, we constrain the largest eigenvalue of the recurrent weight matrices to 1.4. The motivation for this trick was from obtained from Echo-State Networks (ESNs)(Jaeger, 2002; Jaeger et al., 2007). The quality or goodness of fit is measured using an Normalized mean square error (NMSE) metric, which measures the mean square error normalized by the signal power. It is used to compare two time series signals $x _ { r e f }$ and $x$ using the following formulation:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
N M S E = 1 - \frac { | | x _ { r e f } - x | | ^ { 2 } } { | | x _ { r e f } - m e a n ( x _ { r e f } ) | | ^ { 2 } }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where, $| | . | |$ indicates the L2 norm. The $N M S E$ metric lies between 1 and $- \infty$ , with 1 indicating a perfect match and $- \infty$ indicating a very bad fit. If $N M S E = 0$ , then $\mathbf { X }$ is at least as good a fit as a straight line at $x _ { r e f } .$ . In our results, we report the mean and standard deviation in the NMSE scores for all the units in a layer.
|
| 92 |
+
|
| 93 |
+
The effectiveness of the mapping mechanism is demonstrated using a four-layer RNN. The input and output stages are implemented as fully-connected feed-forward layers, and the recurrent layers are also interleaved with fully-connected layers. The input feature dimension was set to two and the output to three. The input data was a weighted sum of sinusoidal signals that were band-limited to $5 0 \mathrm { H z }$ and sampled at 1 MHz for 0.2 seconds. The high sampling rate is necessary to accurately capture the dynamics of the SNN, whose neuron models are highly non-linear, in a transient simulation. The length of the simulation is a key consideration as we want our mapped SNN implementation to remain matched for arbitrarily long sequences. Computational considerations limited the duration of our simulations, but this should be tested before large scale deployment in real-world use.
|
| 94 |
+
|
| 95 |
+
Fully-digital neuromorphic platforms, such as Intel Loihi, IBM TrueNorth, or SpinNaker, do not suffer for mismatch issues. However, mixed-signal neuromorphic chips, such as Qiao et al. (2015); Neckar et al. (2019); Schemmel et al. (2012), are potentially more energy-efficient than their digital counterparts but suffer from device mismatch. A $\Sigma \Delta$ feedback loop naturally compensates for such effects (Pavan et al., 2017) but there are many components in the model that lies outside the feedback loop. To study this, we add the effect of mismatch in our simulations by sampling the parameters, $p$ of the mapped SNN:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
p = p \cdot ( 1 + c _ { v _ { p } } \cdot \mathcal { N } ( 0 , 1 ) )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where, $c _ { v _ { p } }$ is the coefficient of variation $\begin{array} { r } { ( = \frac { s t a n d a r d d e v i a t i o n } { m e a n } ) } \end{array}$ in the parameter, $p$ . To understand the statistics in the quality of the mapping mechanism, we generate multiple samples of network parameters and measure the quality of fit. These results are tabulated in Tables 1 and 2, where we list the measured mean of and standard deviation in $N M S E$ values for a 4-layer RNN with 51 and 500 units per layer, respectively. With no mismatch effects, the reconstruction is very good to all layers, in both cases. Furthermore, we observe nearly perfect reproduction of the network dynamics for up to 2 layers, and a gradual degradation as the size, depth and mismatch of the network increases. We note that the mapping mechanism is robust for $c _ { v _ { p } } < 0 . 2$ . Reduced mismatch sensitivity is useful for design of neuromorphic chips because it simplifies the design, and that, in turn, reduces the energy and area consumed by these chips. Visualization of the transient dynamics of all the nodes in the original and mapped RNNs is provided in supplementary section F. Finally, the performance of the mapping algorithm comparing the dynamics of the ANN with sub-sampled data to that of the SNN is shown in Table 3. The length of the SNN simulation is $0 . 2 s$ , translating to input sequence lengths, L. We note that the mapping technique works well for fairly high sub-sampling ratios and shows significant degradation only for $L = 2 0$ . Note that a near perfect match ( $N M S E > 0 . 5$ ) is achieved up for depth of two. This restricts the models used for benchmarking in Section 5.3.
|
| 102 |
+
|
| 103 |
+
# 5.3 LEARNING PERFORMANCE OF THE LPRNN CELL
|
| 104 |
+
|
| 105 |
+
The key idea behind enabling the mapping between an recurrent ANN to its spiking equivalent was the addition of a low pass filter to the the state variables. It must be highlighted that the idea of using a low-pass filter model for neurons is fairly old and has been studied in various contexts (Beer, 1995; Mozer, 1992; Jaeger et al., 2007). The novelty in this work is in identifying its use in the mapping mechanism and in the study of its learning properties. The mapping procedure would be of no use if the resulting ANN was unable to perform as well as their unfiltered counterparts in learning tasks, and it is the focus of this section.
|
| 106 |
+
|
| 107 |
+
In our experiments, we set $\alpha$ in Equation 6 by sampling from a distribution with a common mean value shared by all the neuron units in the network. This simplifies the design of the neuromorphic system by eliminating the need to create precise tunable time constants in the neuron implementations.
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="3">Layer</td><td colspan="4">μNMSE</td><td colspan="4">ONMSE</td></tr><tr><td>CuP =0</td><td>Cup = 0.2</td><td>Cup =1</td><td>Cup =2</td><td>Cup =0</td><td>Cup = 0.2</td><td>Cup =1</td><td>Cup =2</td></tr><tr><td>Rec. layer 1</td><td>1.0</td><td>0.9</td><td>-5.1</td><td>-4.0</td><td>0.1</td><td>0.3</td><td>55.1</td><td>15.5</td></tr><tr><td>Rec. layer 2</td><td>1.0</td><td>0.5</td><td>-8.8</td><td>-17.5</td><td>0.1</td><td>1.1</td><td>54.4</td><td>41.4</td></tr><tr><td>Rec. layer 3</td><td>0.9</td><td>-1.5</td><td>-36.8</td><td>-100.2</td><td>0.1</td><td>6.4</td><td>117.1</td><td>300.0</td></tr><tr><td>Rec. layer 4</td><td>0.9</td><td>-3.7</td><td>-107.5</td><td>-278.9</td><td>0.2</td><td>8.2</td><td>202.4</td><td>535.9</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 1: Mapping a four layer network with 51 units per layer for different mismatch values.
|
| 112 |
+
|
| 113 |
+
<table><tr><td rowspan="2">Layer</td><td colspan="4">μNMSE</td><td colspan="4">ONMSE</td></tr><tr><td>Cup =0</td><td>Cup = 0.2</td><td>Cup =1</td><td>Cup =2</td><td>Cup =0</td><td>Cup = 0.2</td><td>Cup =1</td><td>cup = 2</td></tr><tr><td>Rec. layer 1</td><td>1.0</td><td>1.0</td><td>0.4</td><td>0.6</td><td>0.1</td><td>0.1</td><td>1.8</td><td>1.3</td></tr><tr><td>Rec. layer 2</td><td>0.9</td><td>-1.0</td><td>-48.9</td><td>-132.0</td><td>0.1</td><td>1.6</td><td>52.1</td><td>143.7</td></tr><tr><td>Rec. layer 3</td><td>0.8</td><td>-6.8</td><td>-185.1</td><td>-683.6</td><td>0.2</td><td>2.9</td><td>73.2</td><td>295.9</td></tr><tr><td>Rec. layer 4</td><td>0.2</td><td>-6.3</td><td>-133.7</td><td>-416.3</td><td>0.9</td><td>3.5</td><td>64.0</td><td>203.6</td></tr></table>
|
| 114 |
+
|
| 115 |
+
Table 2: Mapping a four layer network with 500 units per layer for different mismatch values.
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="3">Layer</td><td colspan="4">μNMSE</td><td colspan="4">ONMSE</td></tr><tr><td>TsANN =10μs L = 20000</td><td>100μs 2000</td><td>1ms 200</td><td>10ms 20</td><td>10 μs 20000</td><td>100μs 2000</td><td>1ms 200</td><td>10ms 20</td></tr><tr><td>Rec. layer 1</td><td>1.0</td><td>1.0</td><td>0.8</td><td>-0.4</td><td>0.0</td><td>0.0</td><td>0.1</td><td>0.4</td></tr><tr><td>Rec. layer 2</td><td>0.9</td><td>1.0</td><td>0.7</td><td>-1.7</td><td>0.8</td><td>0.0</td><td>0.2</td><td>5.2</td></tr><tr><td>Rec.layer 3</td><td>0.9</td><td>0.9</td><td>0.4</td><td>-1.6</td><td>0.5</td><td>0.1</td><td>1.0</td><td>2.2</td></tr><tr><td>Rec. layer 4</td><td>0.9</td><td>0.9</td><td>0.1</td><td>-2.0</td><td>0.3</td><td>0.3</td><td>1.2</td><td>2.2</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 3: Performance when mapping resampled data for a four layer network with 128 units per layer.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Task</td><td colspan="3">Results in this work</td><td rowspan="2">Reference literature</td></tr><tr><td>SimpleRNN</td><td>lpRNN</td><td>LSTM</td></tr><tr><td>Temporal addition</td><td>40 steps</td><td>642 steps</td><td>8</td><td>5000 steps (Li et al., 2018)</td></tr><tr><td>Temporal copy</td><td>30 steps</td><td>120 steps</td><td>200 steps</td><td>500 steps (Arjovsky et al., 2016)</td></tr><tr><td>Spoken phrase (acc.)</td><td>27%</td><td>93%</td><td>92%</td><td>90% (Sainath and Parada, 2015)</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 4: The performance of the lpRNN cell on three benchmarks. The reference literature column reports the best results (to our knowledge) with neural networks with less than 100K parameters. lpRNN and SimpleRNN networks for the add and copy tasks used a single layer with 128 hidden units. Arjovsky et al. (2016) use unitary recurrent weight matrices and Li et al. (2018) use two layers of 128-unit IndRNN layers. The spoken phrase task reference is a CNN model released as a Tensorflow example (Google, 2019).
|
| 124 |
+
|
| 125 |
+
First, we study the short-term memory capabilities of the lpRNNs using the synthetic addition and copying tasks (Hochreiter and Schmidhuber, 1997; Arjovsky et al., 2016; Le et al., 2015). Next, we compare the performance of the lpRNN cell vs a SimpleRNN cell in a speech recognition task. We summarize the key observations in this section and details are in the supplementary material.
|
| 126 |
+
|
| 127 |
+
Temporal addition task: The addition task (Le et al., 2015) involves processing two parallel input data streams of equal length. The first stream comprises random numbers $\in ( 0 , 1 )$ and the second is full of zeros except at two time steps. The network is trained to generate the sum of the two numbers in the first data stream corresponding to the time-steps when the second stream had non-zero entries. The baseline to beat is a mean square error (mse) of 0.1767, corresponding to a network that always generates 1. We adopt a curriculum learning (Bengio et al., 2009) procedure for this task, by first training the RNN cell on a short sequence and progressively increasing the number of time steps. Each curriculum used 10,000 training and 1000 test samples. The length of the task was incremented when the mse went below 0.001. The SimpleRNN cell failed to converge beyond sequences of length 40, while the lpRNN cell converged to mse $< 0 . 0 0 1$ for sequences up to 642 steps. Interestingly, the
|
| 128 |
+
|
| 129 |
+
Long Short-Term Memory (LSTM) cell learnt a general solution when trained by this procedure and could solve arbitrarily long sequences, even with just two hidden units in the cell!
|
| 130 |
+
|
| 131 |
+
Temporal copying task: We train the RNN cells on a varying length copying task as defined in (Graves et al., 2014) instead of the original definition (Hochreiter and Schmidhuber, 1997; Arjovsky et al., 2016). This problem is harder to solve than the temporal addition task. The network receives a sequence of up to S symbols (in the original definition, S is fixed) drawn from an alphabet of size K. At the end of S symbols, a sequence of T blank symbols ending with a trigger symbol is passed. The trigger symbol indicates that the network should reproduce the first S symbols in the same order. We adopt a curriculum learning procedure here too and first train the network on a short sequence $( \mathrm { T } { = } 3 )$ and gradually increase it $( \mathrm { T } { \leq } 2 0 0 )$ . The sequence length is incremented when the categorical accuracy is better than $9 9 \%$ . The SimpleRNN cell failed at this task even for $\mathrm { T } { = } 3 0$ . The lpRNN cell was able to achieve $9 9 \%$ accuracy for up to 120 time steps. After that, it generates $\mathrm { T }$ blank entries accurately but the accuracy of the last S symbols drops (For ${ \mathrm { T } } { = } 2 0 0$ , it was $96 \%$ ).
|
| 132 |
+
|
| 133 |
+
Spoken phrase classification: The target for the lpRNN cell are neuromorphic platforms that are typically resource-constrained, due to power, memory, and area restrictions. Therefore, we test the performance of the lpRNN cell on a problem that is compatible with such systems (see supplementary section D). We chose a limited vocabulary spoken commands detection task using the Google commands dataset (Warden, 2018), which comprises 36 classes of short-length spoken commands such as “left”, “up”, or “go”. The dataset was created for hardware and algorithm developers to evaluate their low footprint neural network models in limited dictionary speech recognition tasks. The neural network receives a Mel-spectrogram as inputs, and comprises, from input to output, two fully-connected dense layers with 128 and 32 units with batch normalization, two RNN layers with 128 units, two fully-connected dense layers, topped by a softmax readout. In total, the network has about 80K trainable parameters. We use Adam optimizer (Kingma and Ba, 2014), with a learning rate of 0.001 for training. We note that all lpRNN variants massively outperform the SimpleRNN and slightly outperform the LSTM variants, all with the same number of parameters. We further note that the performance of the network peaks for certain values of $\alpha$ and the random sampling case. The high performance of the lpRNN cell is a crucial result because not only did the addition of the low-pass filter enable mapping of the recurrent ANN model to neuromorphic platforms, it also resulted in a much-improved performance.
|
| 134 |
+
|
| 135 |
+
Table 5: Performance of the lpRNN cell on the Google commands classification task with different filtering coefficients, $\alpha$ . $\alpha = 0$ is equivalent to a SimpleRNN and $\alpha = 1$ is an MLP.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>α</td><td>[0.1,1]</td><td>0</td><td>0.1</td><td>0.5</td><td>0.8</td><td>0.9</td><td>0.99</td><td>1</td></tr><tr><td> Accuracy</td><td>93%</td><td>26%</td><td>25%</td><td>69%</td><td>92%</td><td>93%</td><td>90%</td><td>4%</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Energy-efficiency estimation: We compare the energy cost of computing a two-layer RNN with 128 hidden units (used in the audio task) for an in-memory lpRNN system with $\Sigma \Delta$ neurons against Cortex-M4, a popular low-power microprocessor used in milliWatt-range applications. We conservatively estimate that our implementation yields $5 0 0 \times$ better energy-efficiency in this instance. Larger networks will see a dramatic increase in this difference. (see supplementary section J).
|
| 140 |
+
|
| 141 |
+
# 6 CONCLUSION AND OUTLOOK
|
| 142 |
+
|
| 143 |
+
We presented a novel aI&F spiking neuron model and discussed its spike-coding and noise-tolerance benefits. Then, we discussed how the LPF abstraction of the aI&F neuron model enables training of recurrent SNNs without having to simulate the complex dynamics of a large network of spiking neurons. This strategy enables training a recurrent SNN using standard optimization algorithms such as backpropagation. The mapping technique that allowed us to achieve this result is studied in detail, including its limitations.. We observe a dramatic improvement in the performance of the RNN cell with the addition of the low-pass filtering term. We think that this improvement is because the LPF acts as a temporal regularizer (see supplementary section C). Current spiking RNNs are benchmarked on much simpler tasks than presented in this paper, often due to the computational cost and lack of algorithms for training them. The importance of this work lies in proposing algorithmic solutions to address this key problem, to enable a new generation of ultra-low-power neuromorphic chips.
|
| 144 |
+
|
| 145 |
+
# REFERENCES
|
| 146 |
+
|
| 147 |
+
Ahn, J., Yoo, S., Mutlu, O., and Choi, K. (2015). Pim-enabled instructions: a low-overhead, locality-aware processing-in-memory architecture. In 2015 ACM/IEEE 42nd Annual International Symposium on Computer Architecture (ISCA), pages 336–348. IEEE.
|
| 148 |
+
|
| 149 |
+
Aimar, A., Mostafa, H., Calabrese, E., Rios-Navarro, A., Tapiador-Morales, R., Lungu, I.-A., Milde, M. B., Corradi, F., Linares-Barranco, A., Liu, S.-C., et al. (2018). Nullhop: A flexible convolutional neural network accelerator based on sparse representations of feature maps. IEEE transactions on neural networks and learning systems.
|
| 150 |
+
|
| 151 |
+
Akopyan, F., Sawada, J., Cassidy, A., Alvarez-Icaza, R., Arthur, J., Merolla, P., Imam, N., Nakamura, Y., Datta, P., Nam, G.-J., et al. (2015). Truenorth: Design and tool flow of a 65 mw 1 million neuron programmable neurosynaptic chip. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 34(10):1537–1557.
|
| 152 |
+
|
| 153 |
+
Arjovsky, M., Shah, A., and Bengio, Y. (2016). Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pages 1120–1128.
|
| 154 |
+
|
| 155 |
+
ARM (2019). Arm cortex. Datasheet Cortex-M4. Accessed on 2019-11-07.
|
| 156 |
+
|
| 157 |
+
Bai, S., Kolter, J. Z., and Koltun, V. (2018). An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271.
|
| 158 |
+
|
| 159 |
+
Beer, R. D. (1995). On the dynamics of small continuous-time recurrent neural networks. Adaptive Behavior, 3(4):469–509.
|
| 160 |
+
|
| 161 |
+
Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48. ACM.
|
| 162 |
+
|
| 163 |
+
Bohte, S. M. (2012). Efficient spike-coding with multiplicative adaptation in a spike response model. In Advances in Neural Information Processing Systems, pages 1835–1843.
|
| 164 |
+
|
| 165 |
+
Brette, R. and Gerstner, W. (2005). Adaptive exponential integrate-and-fire model as an effective description of neuronal activity. Journal of neurophysiology, 94(5):3637–3642.
|
| 166 |
+
|
| 167 |
+
Cavigelli, L. and Benini, L. (2016). Origami: A 803-gop/s/w convolutional network accelerator. IEEE Transactions on Circuits and Systems for Video Technology, 27(11):2461–2475.
|
| 168 |
+
|
| 169 |
+
Chan, V., Liu, S.-C., and van Schaik, A. (2007). Aer ear: A matched silicon cochlea pair with address event representation interface. IEEE Transactions on Circuits and Systems I: Regular Papers, 54(1):48–59.
|
| 170 |
+
|
| 171 |
+
Chen, Y.-H., Krishna, T., Emer, J. S., and Sze, V. (2016). Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks. IEEE Journal of Solid-State Circuits, 52(1):127– 138.
|
| 172 |
+
|
| 173 |
+
Chicca, E., Stefanini, F., Bartolozzi, C., and Indiveri, G. (2014). Neuromorphic electronic circuits for building autonomous cognitive systems. Proceedings of the IEEE, 102(9):1367–1388.
|
| 174 |
+
|
| 175 |
+
Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555.
|
| 176 |
+
|
| 177 |
+
Davies, M., Srinivasa, N., Lin, T.-H., Chinya, G., Cao, Y., Choday, S. H., Dimou, G., Joshi, P., Imam, N., Jain, S., et al. (2018). Loihi: A neuromorphic manycore processor with on-chip learning. IEEE Micro, 38(1):82–99.
|
| 178 |
+
|
| 179 |
+
Diehl, P. U., Neil, D., Binas, J., Cook, M., Liu, S.-C., and Pfeiffer, M. (2015). Fast-classifying, highaccuracy spiking deep networks through weight and threshold balancing. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1–8. IEEE.
|
| 180 |
+
|
| 181 |
+
Frenkel, C., Lefebvre, M., Legat, J.-D., and Bol, D. (2019). A 0.086-mm2 12.7-pj/sop 64k-synapse 256-neuron online-learning digital spiking neuromorphic processor in 28-nm cmos. IEEE transactions on biomedical circuits and systems, 13(1):145–158.
|
| 182 |
+
|
| 183 |
+
Gers, F. A., Schmidhuber, J., and Cummins, F. (2000). Learning to forget: Continual prediction with lstm. Neural Computation, 12(10):2451–2471.
|
| 184 |
+
|
| 185 |
+
Gerstner, W. and Kistler, W. M. (2002). Spiking neuron models: Single neurons, populations, plasticity. Cambridge university press.
|
| 186 |
+
|
| 187 |
+
Gewaltig, M.-O. and Diesmann, M. (2007). Nest (neural simulation tool). Scholarpedia, 2(4):1430.
|
| 188 |
+
|
| 189 |
+
Ghose, S., Hsieh, K., Boroumand, A., Ausavarungnirun, R., and Mutlu, O. (2018). Enabling the adoption of processing-in-memory: Challenges, mechanisms, future research directions. arXiv preprint arXiv:1802.00320.
|
| 190 |
+
|
| 191 |
+
Google (2019). Audio recognition. Github source code for Tensorflow v1.x. Accessed on 2019-11-07.
|
| 192 |
+
|
| 193 |
+
Graves, A., Wayne, G., and Danihelka, I. (2014). Neural turing machines. CoRR, abs/1410.5401.
|
| 194 |
+
|
| 195 |
+
Hamilton, T. J., Jin, C., Van Schaik, A., and Tapson, J. (2008). An active 2-d silicon cochlea. IEEE Transactions on biomedical circuits and systems, 2(1):30–43.
|
| 196 |
+
|
| 197 |
+
Henaff, M., Szlam, A., and LeCun, Y. (2016). Recurrent orthogonal networks and long-memory tasks. arXiv preprint arXiv:1602.06662.
|
| 198 |
+
|
| 199 |
+
Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735– 1780.
|
| 200 |
+
|
| 201 |
+
Hu, Y., Huber, A., Anumula, J., and Liu, S.-C. (2018). Overcoming the vanishing gradient problem in plain recurrent networks. arXiv preprint arXiv:1801.06105.
|
| 202 |
+
|
| 203 |
+
Jaeger, H. (2002). Tutorial on training recurrent neural networks, covering BPPT, RTRL, EKF and the" echo state network" approach. GMD-Forschungszentrum Informationstechnik.
|
| 204 |
+
|
| 205 |
+
Jaeger, H., Lukoševicius, M., Popovici, D., and Siewert, U. (2007). Optimization and applications of ˇ echo state networks with leaky-integrator neurons. Neural networks, 20(3):335–352.
|
| 206 |
+
|
| 207 |
+
Kim, Y., Jernite, Y., Sontag, D., and Rush, A. M. (2016). Character-aware neural language models. In Thirtieth AAAI Conference on Artificial Intelligence.
|
| 208 |
+
|
| 209 |
+
Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
|
| 210 |
+
|
| 211 |
+
Le, Q. V., Jaitly, N., and Hinton, G. E. (2015). A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941.
|
| 212 |
+
|
| 213 |
+
Li, S., Li, W., Cook, C., Zhu, C., and Gao, Y. (2018). Independently recurrent neural network (indrnn): Building a longer and deeper rnn. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5457–5466.
|
| 214 |
+
|
| 215 |
+
Marcus, M., Kim, G., Marcinkiewicz, M. A., MacIntyre, R., Bies, A., Ferguson, M., Katz, K., and Schasberger, B. (1994). The penn treebank: annotating predicate argument structure. In Proceedings of the workshop on Human Language Technology, pages 114–119. Association for Computational Linguistics.
|
| 216 |
+
|
| 217 |
+
Moradi, S., Qiao, N., Stefanini, F., and Indiveri, G. (2018). A scalable multicore architecture with heterogeneous memory structures for dynamic neuromorphic asynchronous processors (DYNAPs). Biomedical Circuits and Systems, IEEE Transactions on, 12(1):106–122.
|
| 218 |
+
|
| 219 |
+
Mostafa, H. (2017). Supervised learning based on temporal coding in spiking neural networks. IEEE transactions on neural networks and learning systems, 29(7):3227–3235.
|
| 220 |
+
|
| 221 |
+
Mozer, M. C. (1992). Induction of multiscale temporal structure. In Advances in neural information processing systems, pages 275–282.
|
| 222 |
+
|
| 223 |
+
Nair, M. V. and Indiveri, G. (2019). An ultra-low power sigma-delta neuron circuit. In 2019 IEEE International Symposium on Circuits and Systems (ISCAS), pages 1–5.
|
| 224 |
+
|
| 225 |
+
Neckar, A., Fok, S., Benjamin, B. V., Stewart, T. C., Oza, N. N., Voelker, A. R., Eliasmith, C., Manohar, R., and Boahen, K. (2019). Braindrop: A mixed-signal neuromorphic architecture with a dynamical systems-based programming model. Proceedings of the IEEE, 107(1):144–164.
|
| 226 |
+
|
| 227 |
+
Neil, D., Pfeiffer, M., and Liu, S.-C. (2016). Phased lstm: Accelerating recurrent network training for long or event-based sequences. In Advances in neural information processing systems, pages 3882–3890.
|
| 228 |
+
|
| 229 |
+
Oliphant, T. (2006). Guide to NumPy.
|
| 230 |
+
|
| 231 |
+
Pascanu, R., Mikolov, T., and Bengio, Y. (2013). On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318.
|
| 232 |
+
|
| 233 |
+
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. In NIPS Autodiff Workshop.
|
| 234 |
+
|
| 235 |
+
Pavan, S., Schreier, R., and Temes, G. C. (2017). Understanding delta-sigma data converters. John Wiley & Sons.
|
| 236 |
+
|
| 237 |
+
Pelgrom, M., Duinmaijer, A., and Welbers, A. (1989). Matching properties of MOS transistors. IEEE Journal of Solid-State Circuits, 24(5):1433–1440.
|
| 238 |
+
|
| 239 |
+
Qiao, N., Mostafa, H., Corradi, F., Osswald, M., Stefanini, F., Sumislawska, D., and Indiveri, G. (2015). A reconfigurable on-line learning spiking neuromorphic processor comprising 256 neurons and 128k synapses. Frontiers in neuroscience, 9:141.
|
| 240 |
+
|
| 241 |
+
Rethinagiri, S. K., Palomar, O., Ben Atitallah, R., Niar, S., Unsal, O., and Kestelman, A. C. (2014). System-level power estimation tool for embedded processor based platforms. In Proceedings of the 6th Workshop on Rapid Simulation and Performance Evaluation: Methods and Tools, page 5. ACM.
|
| 242 |
+
|
| 243 |
+
Rueckauer, B., Lungu, I.-A., Hu, Y., Pfeiffer, M., and Liu, S.-C. (2017). Conversion of continuousvalued deep networks to efficient event-driven networks for image classification. Frontiers in neuroscience, 11:682.
|
| 244 |
+
|
| 245 |
+
Sainath, T. and Parada, C. (2015). Convolutional neural networks for small-footprint keyword spotting.
|
| 246 |
+
|
| 247 |
+
Sarpeshkar, R. (1998). Analog versus digital: Extrapolating from electronics to neurobiology. Neural Computation, 10(7):1601–1638.
|
| 248 |
+
|
| 249 |
+
Schaller, R. R. (1997). Moore’s law: past, present and future. IEEE spectrum, 34(6):52–59.
|
| 250 |
+
|
| 251 |
+
Schemmel, J., Grübl, A., Hartmann, S., Kononov, A., Mayr, C., Meier, K., Millner, S., Partzsch, J., Schiefer, S., Scholze, S., Schüffny, R., and Schwartz, M. (2012). Live demonstration: A scaled-down version of the BrainScaleS wafer-scale neuromorphic system. In IEEE International Symposium on Circuits and Systems ISCAS 2012, page 702.
|
| 252 |
+
|
| 253 |
+
Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2014). Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958.
|
| 254 |
+
|
| 255 |
+
Stimberg, M., Brette, R., and Goodman, D. (2019). Brian 2: an intuitive and efficient neural simulator. BioRxiv, page 595710.
|
| 256 |
+
|
| 257 |
+
Waldrop, M. M. (2016). The chips are down for moore’s law. Nature News, 530(7589):144.
|
| 258 |
+
|
| 259 |
+
Wang, Y. and Tian, F. (2016). Recurrent residual learning for sequence classification. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 938–943.
|
| 260 |
+
|
| 261 |
+
Warden, P. (2018). Speech commands: A dataset for limited-vocabulary speech recognition. arXiv preprint arXiv:1804.03209.
|
| 262 |
+
|
| 263 |
+
Xingjian, S., Chen, Z., Wang, H., Yeung, D.-Y., Wong, W.-K., and Woo, W.-c. (2015). Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pages 802–810.
|
| 264 |
+
|
| 265 |
+
Yoon, Y. C. (2016). Lif and simplified srm neurons encode signals into spikes via a form of asynchronous pulse sigma–delta modulation. IEEE transactions on neural networks and learning systems, 28(5):1192–1205.
|
| 266 |
+
|
| 267 |
+
A MOTIVATION FOR THE USE OF THE SIGMA-DELTA NEURON MODEL
|
| 268 |
+
|
| 269 |
+
# A.1 CODING MECHANISM
|
| 270 |
+
|
| 271 |
+
A neuron in deep learning has one primary function - the non-linear transformation of its input. However, a biological neuron and its neuromorphic counterpart have the added job of encoding information in spike trains. The most popular model for this encoding mechanism is rate coding, where the neuron fires at a rate proportional to the incoming signal. This mechanism is not efficient for transmitting high-resolution data. For example, to transmit a signal at 8-bit resolution, it will require O(256) spikes for each sample. An improvement to this coding mechanism is theaI&F model (Brette and Gerstner, 2005), which can be interpreted as an asynchronous delta-sigma $( \Delta \Sigma )$ loop (Yoon, 2016; Bohte, 2012; Nair and Indiveri, 2019). The $\Delta \Sigma$ mechanism is a time-coding model that is more efficient in its use of spike trains (Nair and Indiveri, 2019) than rate-coding models. Other time-coding schemes have also been proposed in literature (Rueckauer et al., 2017; Gerstner and Kistler, 2002). However, the advantage of the $\Delta \Sigma$ interpretation is that it leads to highly power-efficient circuit implementations (Nair and Indiveri, 2019) that is tolerant to mismatch and noise effects. Furthermore, the model allows us to treat the neuron state as an analogue variable and ignoring the specific timing details of the encoding spike trains (Nair and Indiveri, 2019). The independence from the monitoring precise spike-times is beneficial because state-dependency, noise and device mismatch cause different neurons to generate spikes at different times for the same input. Modelling it is computationally expensive. The $\Delta \Sigma$ feedback loop ensures that they all represent the same signal with the same accuracy in spite of their differences (Nair and Indiveri, 2019). This abstraction enables the network designer to only look at the internal state of the neuron when optimizing the network weights for an SNN. It is a crucial enabler for this paper as simulating and training mismatch-prone SNNs is computationally much more expensive than ANNs.
|
| 272 |
+
|
| 273 |
+
# A.2 BIOLOGICAL NEURAL NETWORKS ARE LOW PASS FILTERING
|
| 274 |
+
|
| 275 |
+
Activation functions used in neural networks and apply a non-linearity to a weighted sum of input signals. However, ANNs assume that when the input changes, the internal state of the neuron or dendrites can also change immediately to reflect the new input. This behaviour ignores the fact that biological neuronal channels are LPFs (Gerstner and Kistler, 2002). Modelling the inertial or low-pass filtering property is essential to implement and study recurrent neural networks in any neuromorphic system as the transitional dynamics deviate completely in its absence. The $\Delta \Sigma$ neuron models the filtering behaviour with a first-order low pass filter. We argue that not only is this modelling essential, it is also a useful constraint to impose on RNNs.
|
| 276 |
+
|
| 277 |
+
# A.3 CHANNEL NOISE AND RECONSTRUCTION ACCURACY IN A SPIKING NEURON
|
| 278 |
+
|
| 279 |
+
The $\Sigma \Delta$ scheme encodes the information in the relative timing of the spikes. This implies that any noise in the spike timing, i.e. jitter, introduced during transmission of the spikes will result in distortion of the reconstructed signal, for example, in situations when the transmitting and receiving neurons are on separate chips. The distortions are modelled by a random variable $\Delta _ { t }$ , which is sampled from a normal random distribution, $\Delta _ { t } \sim \mathcal { N } ( 0 , j _ { \sigma } ^ { 2 } )$ with probability distribution function $P r ( \bar { \Delta } _ { t } )$ . Note that a fixed delay does not contribute to distortion and is ignored. To compute the effect of spike timing noise, we calculate the Laplace domain representation of the transmitted signal as follows. If $I _ { D } ( t )$ is the Dirac delta function, the transmitted spike train $y ( t )$ , jitter-affected spike train, $y ^ { \prime } ( t )$ , the desired filtered spike train, $s ( t )$ , and the filtered version of the jitter-affected spike-train,
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure A.1: The different transfer function of the $\Sigma \Delta$ neuron model. Red: Signal transfer function, Blue: noise transfer function, Green: Signal transfer function with spike timing noise.
|
| 283 |
+
|
| 284 |
+
$r ( t )$ can be expressed as,
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { c } { y ( t ) = \displaystyle \sum _ { k = 0 } ^ { N } I _ { D } ( t - k _ { k } ) } \\ { y ^ { \prime } ( t ) = \displaystyle \sum _ { k = 0 } ^ { N } I _ { D } ( t - k _ { k } - \Delta _ { t } ) } \\ { s ( t ) = y ( t ) \star h ( t ) = \displaystyle \sum _ { k = 0 } ^ { N } h ( t - t _ { k } ) } \\ { \implies S ( s ) = \displaystyle \sum _ { k = 0 } ^ { N } H ( s ) e ^ { - \alpha t _ { k } } } \\ { r ( t ) = y ^ { \prime } ( t ) \star h ( t ) = \displaystyle \sum _ { k = 0 } ^ { N } h ( t - t _ { k } - \Delta _ { t } ) } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
The mean value of $r ( t )$ can then be computed as
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { l } { \displaystyle \bar { r } ( t ) = E [ r ( t ) ] = \sum _ { k = 0 } ^ { N } \int _ { \Delta _ { t } = - \infty } ^ { \infty } P r ( \Delta _ { t } ) \cdot h ( t - t _ { k } - \Delta _ { t } ) } \\ { \displaystyle = \sum _ { k = 0 } ^ { N } P r \star h ( t - t _ { k } ) } \\ { \displaystyle \Longrightarrow \ \overline { { R } } ( s ) = \mathcal { L } \{ \bar { r } ( t ) \} = \sum _ { k = 0 } ^ { N } P ( s ) H ( s ) e ^ { - s t _ { k } } = P ( s ) S ( s ) } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
where, $P ( s ) = \mathcal { L } \{ \mathrm { P r } ( t ) \} = e ^ { \frac { s ^ { 2 } j _ { \sigma } ^ { 2 } } { 2 } }$ . $\overline { { R } } ( s )$ is plotted in Figure A.1 as the recovery transfer function $j _ { \sigma } = 1 m s$
|
| 297 |
+
affect the signal transmission accuracy.
|
| 298 |
+
|
| 299 |
+
# B COMPARISON TO OTHER RNN MODELS
|
| 300 |
+
|
| 301 |
+
The low pass filtering behaviour of neurons is well-known in neuro-scientific literature (and in other fields) and has been studied in the past with RNNs as well(Beer, 1995; Mozer, 1992; Jaeger et al., 2007). For example, ESNs as proposed by Herbert Jaeger (Jaeger et al., 2007) has an identical formulation to the lpRNN where the recurrent layer uses leaky integration units. In ESNs, the spectral radius of the initialization values of the recurrent kernel is constrained to confers an “echo-state property” to the network. The recurrent or input connectivity weights are not trained during the learning process. Instead, only the read-out linear classifier is trained. In the lpRNN model, the spectral radius of the recurrent kernel is not constrained and all the weight matrices, including the retention ratios if required, are trained. lpRNN also shares similarities with recurrent residual networks proposed by Yiren Wang (Wang and Tian, 2016), which are described by the following equations
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
y _ { t } = f ( g ( y _ { t - 1 } ) ) + \sigma ( y _ { t - 1 } , x _ { t } , W )
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
where $W$ denotes input and recurrent kernels, and other symbols have the same meaning as equation 6. In equation 16, $g$ and $f$ are identity and a hyperbolic tangent functions, respectively. A comparison can also be made with the LT-RNN model proposed by Mikael Henaff (Henaff et al., 2016), whose update equations are:
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\begin{array} { l } { h _ { t } = \sigma ( W _ { i n } \cdot x + b ) + V \cdot h _ { t - 1 } } \\ { y _ { t } = W \cdot h _ { t } } \end{array}
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
where $W$ and $V$ are 2-D transition matrices that are learned during the training process. In this case, it is possible that the LT-RNN cell reduces to an lpRNN, but is unlikely to occur in practice. Similar analogies can also be made to the IndRNN model (Li et al., 2018) and recurrent identity networks (Hu et al., 2018). Generally speaking, the main difference between the lpRNN cells and popular RNN models in use today is the(re)indroduction of the filtering term into the RNN model with impositions on boundary and train-ability conditions. We see that in addition to enabling their use in neuromorphic platforms, this results in more stable convergence properties due to a temporal regularization effect, as described in the Section C.
|
| 314 |
+
|
| 315 |
+
# C MEMORY IN AN LPRNN
|
| 316 |
+
|
| 317 |
+
We can analyze the evolution of an lpRNN cell by using an approach similar to the power iteration method, described by Razvan Pascanu (Pascanu et al., 2013). To do this analysis, we approximate the lpRNN update equation as:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
y _ { t } = \alpha \odot y _ { t - 1 } + ( 1 - \alpha ) \odot ( W _ { r e c } \cdot y _ { t - 1 } + W _ { i n } \cdot x _ { t } + b )
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
where, for simplicity, we also make the added assumption that all units of the lpRNN layer have the same retention factor, $\alpha$ . The gradient terms during back-propagation through time can now be expressed as a product of several terms that have the form:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\frac { \delta y _ { t } } { \delta y _ { k } } = [ ( 1 - \alpha ) W _ { r e c } ^ { T } + \alpha ] ^ { l }
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
where, $t$ and $k$ , are time step indices with $t > k$ and $l = t - k$ . If an eigenvalue of the $W _ { r e c } ^ { T }$ matrix is , then the corresponding eigenvalue of the matrix $[ ( 1 - \alpha ) W _ { r e c } ^ { T } + \alpha ]$ re can be written as
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
( 1 - \alpha ) \lambda + \alpha
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
Looking at the eigenvalue of the gradient terms as computed in equation 21, we note that $\alpha$ acts like a temporal regularizer on the eigenvalues of the recurrent network. It can also be seen that by scaling $\alpha$ to lie between 0 and 1, the operation of the network shifts between that of purely non-inertial recurrent to a completely inertial network stuck in its initial state, respectively. This insight helps us understand why lpRNNs perform well in long memory tasks.
|
| 336 |
+
|
| 337 |
+
Hochreiter (Hochreiter and Schmidhuber, 1997) defined the constant error carousel (CEC) as a central feature of the LSTM networks that allowed it to remember past events. In a crude sense, this corresponds to setting the retention ratio, $\alpha = 1$ . Forget gates were subsequently added by Felix A. Gers (Gers et al., 2000) to the original LSTM structure, that allowed the network to also erase unnecessary events that were potentially trapped in the CEC. This means that the average effective weight of the self-connection in the CEC was made $< 1$ . A randomly initialized set of $\alpha$ values with a reasonably large number of cells appears to have similar functionality. By setting $\alpha < 1$ , the network is guaranteed to lose memory over time, but if some of the $\alpha \mathbf { s }$ are close to 1, it may retain the information for a longer time frame. Moreover, the regularization effect of $\alpha \mathbf { s }$ also prevents the eigenvalues of the recurrent network from becoming too small, ensuring that memory is never lost immediately. We expect that the lpRNN model has a reduced representational power than gated RNN cells, not simply because it has $4 \mathbf { x }$ fewer parameters, but because the lpRNN state is guaranteed to fade with time whereas a gated cell can potentially store a state indefinitely.
|
| 338 |
+
|
| 339 |
+
# D THE NEUROMORPHIC SIGNAL CHAIN
|
| 340 |
+
|
| 341 |
+
The $\Delta \Sigma$ mapping mechanism requires defining suitable time constants for the lpRNN cell being trained by backprop. This can be derived for continuous-time signals from sensors or real-world signals such as an audio input by taking into account the bandwidth of the incoming signals as described earlier. We illustrate a reference neuromorphic signal chain for processing audio input in Figure D.2. The data received from the audio sensor is first filtered by an audio filtering stage such as the cochlea chips (Chan et al., 2007; Sarpeshkar, 1998; Hamilton et al., 2008). These systems typically implement mel-spaced filter banks. A neural network processes the filter outputs and drives an actuator system. A minimal configuration of weights and connectivity required to implement the lpRNN cell in a neuromorphic platform is illustrated in Figure D.2. It is a memory array with spiking neurons attached to the periphery of the system. Each memory cell acts as a transconductance stage - it receives voltage spikes and generates a scaled output current. These currents are summed by the Kirchoff’s current law and integrated by the neurons. Readers familiar with memory design and computer architecture may identify this as an in-memory computational unit. An in-memory neural network accelerator is energy-efficient, primarily because it eliminates movement of synaptic weights (Ghose et al., 2018; Qiao et al., 2015) from the memory to a far-away processing module. Instead, the activations of the neurons are transmitted to the other nodes in the network. The computation is no longer memory-bound unlike RNN computation on von Neumann style architecture. Figure D.2 implements a single spiking RNN stage (equivalent to an lpRNN), with green and red boxes highlighting the input and recurrent kernels, respectively. The architecture can be modified to implement a fully connected layer by eliminating recurrent connections. Note that an equivalent configuration can be also set up in fully-digital neuromorphic systems such as (Frenkel et al., 2019; Davies et al., 2018; Akopyan et al., 2015) that do not suffer from noise and mismatch issues, but may consume more area and power.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure D.2: Top: A neuromorphic signal chain. Bottom: Architecture of an SNN accelerator implementing an lpRNN.
|
| 345 |
+
|
| 346 |
+
Spiker is a transient-simulator for simulating large networks of spiking neurons and synapses using the Basic Linear Algebra Subprogams (BLAS) libraries. It is written in Python and uses the
|
| 347 |
+
|
| 348 |
+
Numpy (Oliphant, 2006) library. There is also a PyTorch (Paszke et al., 2017) version that supports Graphical Processing Unit (GPU)-acceleration. Unlike spiking simulation tools like Brian2 (Stimberg et al., 2019) or NEST (Gewaltig and Diesmann, 2007), which are general-purpose solvers of Ordnary Differential Equations (ODEs), Spiker is a highly-specific simulator for systems where the only differential equation implemented is that of a first-order LPFs. The simulator is not designed to solve any differential equation. Instead, it allows us to run massive simulations of large networks comprising neuron and synapse models whose building blocks include first-order LPFs.
|
| 349 |
+
|
| 350 |
+
# E.1 HOW DOES SPIKER WORK?
|
| 351 |
+
|
| 352 |
+
Key idea #1 Constraining the support to first-order LPFs has the advantage that it allows us to create closed-form solutions to the differential equations at all time-step resolutions without loss of accuracy. The differential equation corresponding to a first-order LPF is the following:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\tau { \frac { d x } { d t } } = - x
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
The closed-form solution to this, ignoring the initial conditions takes the form
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
x = x _ { 0 } \cdot e ^ { \frac { - t } { \tau } }
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
A useful property of the exponential function is that $e ^ { - t 1 + t 2 } = e ^ { - t 1 } \cdot e ^ { - t 2 }$ . Therefore, we have a simple closed-form method to compute the state of a LPF at any arbitrary time, given an initial condition. This implies that if all the building blocks of a system are made of modules which have an exponential solution, then, given their initial state, it is possible to compute the state of the entire system at some arbitrary time in the future, precisely. This is a well-known property of all LTI systems.
|
| 365 |
+
|
| 366 |
+
Key idea #2 However, a spiking system is not LTI. Therefore, it is not possible to predict the state of a spiking neural network at an arbitrary time in the future. Instead, the Spiker simulator takes tiny temporal steps and computes the state of the network variables at each step using the closed-form solution. At the end of each time-step, the neuron models check if it should spike and then resets the corresponding variable to zero. The spiking input to the synapses is a train of 1-bit values corresponding to the presence or absence of an incident spike from an upstream neuron. This implies that the precision of the spike-event is limited to the resolution of the simulation time-step. However, the key insight here is that, if the signals being transmitted have a bandwidth much smaller than the simulation time-step, the higher-order effects can be safely assumed to be gone.
|
| 367 |
+
|
| 368 |
+
Moreover, in spiking neurons, small amounts of jitter in the spike-timing is well-tolerated. This is because of the noise-cancelling property of the feedback loop. Therefore, the Spiker simulator allows the user to set the simulation time-step to a large value that offers fast transient simulations — a fast-simulation trades-off against the precision of the simulated spike-timing.
|
| 369 |
+
|
| 370 |
+
Finally, the simulator also allows us to program and simulate noise and mismatch effects in the neuron parameters, such as mismatch in the spiking threshold and time-constants. The Spiker simulator was used to run all the SNN simulations in this paper.
|
| 371 |
+
|
| 372 |
+
# F VISUALIZING MAPPING OF A RECURRENT SNN
|
| 373 |
+
|
| 374 |
+
The top row of Figure F.3 shows the mapping mechanism in action for a single test case. We note that as the depth of the network increases, the quality of fit degrades, but is still close to perfect as measured by the NMSE metric. The bottom row of Figure F.3 shows the mapping mechanism in action for devices with a very large $c _ { v _ { p } } = 1$ . We note that even in such cases, the performance in lower layers remains fairly stable and only gradually degrades as the depth increases.
|
| 375 |
+
|
| 376 |
+
# G CONVERGENCE PLOTS FOR THE GOOGLE SPOKEN COMMANDS TASK
|
| 377 |
+
|
| 378 |
+
Figure G.4 shows the convergence plots for various values of $\alpha$ .
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure F.3: Dynamics in a two-layer RNN with 51 units per layer. The SNN output shown in the figures is the trace obtain by filtering the spike trains. The NMSE measures the quality of fit with 1 indicating a perfect match and $- \infty$ a very bad fit as described in Equation 7.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure G.4: Performance of the lpRNN cell on the Google commands detection task: Categorical accuracy (Left) and Cross entropy loss (Right). We note that as higher values of $\alpha$ and random sampling results in faster convergence and better accuracy.
|
| 385 |
+
|
| 386 |
+
# H MAPPING THE GOOGLE SPOKEN COMMANDS NETWORK
|
| 387 |
+
|
| 388 |
+
Each 1-second recording from the dataset is transformed using the Mel-spectrogram into 25 frequency and 128 temporal bins. This sequence represents a single speech command for the ANN. Mapping the trained ANN to an SNN is challenging because of the limitation described earlier; A short length sequence does not give the SNN enough time to generate the spikes required to transmit information. On the other hand, it is too difficult to train a longer length sequence that is several thousand samples long. To address this issue, we train the ANN using the short sequence with 128 bins and demonstrate the mapped SNN by feeding it the same spectrogram data that is up-sampled to $1 \ : \mathrm { M H z }$ . The quality of the mapped recurrent SNN is demonstrated using the weights from the trained recurrent ANN for a single case in Figure H.5. The bottom row of Figure H.5 also shows the mapping mechanism in action for RNN layers that are affected by mismatch with $c _ { v _ { p } } = 0 . 2$ . The results indicate an excellent fit between the mapped and the original networks, even with mismatch. The prediction made by the SNN also matched that of the ANN. Unfortunately, it is computationally prohibitive to compare the accuracy results of the SNN to the reference model on the full dataset. We only demonstrate the mapping accuracy for the two recurrent layers of the network in Figure H.5 for a single command in this paper. A complete analysis of the accuracy performance will require testing on a neuromorphic system and will be the focus of a follow-up work.
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure H.5: Mapping a 2-layer 128 unit recurrent ANN trained to discriminate commands from the Google speech dataset to an equivalent recurrent SNN. The top row shows the mapping in action for neuron models unaffected by mismatch and the bottom row demonstrates it for mismatched units. The lpRNN cells have $\alpha = 0 . 9 9$ .
|
| 392 |
+
|
| 393 |
+
# I EXTENDING THE LOW-PASS FILTERING IDEA TO OTHER RNN MODELS
|
| 394 |
+
|
| 395 |
+
Our goal with introducing lpRNN cell was to enable faster and better training of SNNs. However, the analysis performed here indicates that low pass filtering also provides temporal regularization features which can benefit ANN-RNNs such as LSTMs. Therefore, we propose to extend the LSTM formulation by applying a low pass filter at the output $( h )$ , and call it an lpLSTM cell:
|
| 396 |
+
|
| 397 |
+
Forget gate: $f _ { t } = S i g m o i d ( W _ { f } x _ { t } + W _ { r e c _ { f } } h _ { t - 1 } + b _ { f } )$ Input gate: $i _ { t } = S i g m o i d ( W _ { i } x _ { t } + W _ { r e c _ { i } } h _ { t - 1 } + b _ { i } )$ Output gate: $o _ { t } = S i g m o i d ( W _ { o } x _ { t } + W _ { r e c _ { o } } h _ { t - 1 } + b _ { o } )$ $\mathrm { S t a t e : ~ } c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \mathit { R e l u } ( W _ { c } x _ { t } + W _ { r e c _ { c } } h _ { t - 1 } + b _ { c } )$ ${ \mathrm { O u t p u t : ~ } } { \bar { h } } _ { t } = o _ { t } \odot R e l u ( c _ { t } )$ Filtered Output : $\mathbf { \Phi } : h _ { t } = \alpha \odot h _ { t - 1 } + ( 1 - \alpha ) \odot \bar { h } _ { t }$
|
| 398 |
+
|
| 399 |
+
where, $W _ { r e c _ { x } }$ , $W _ { x }$ , $b _ { x }$ indicate the recurrent kernel, input kernel, and bias for the corresponding gate or state. Similar formulations for other RNN cells such as GRU (Chung et al., 2014), IndRNN (Li et al., 2018), Phased-LSTMs (Neil et al., 2016), Convolutional LSTMs (Xingjian et al., 2015), etc can be easily made.
|
| 400 |
+
|
| 401 |
+
# I.1 EXPERIMENTAL RESULTS FOR THE LPLSTM CELL
|
| 402 |
+
|
| 403 |
+
In this section, we benchmark the Low-Pass Long Short-Term Memory (lpLSTM) cells to their unfiltered variants. In our experiments, the learning rate was set to 0.005 and normalized gradient was clipped to 1. Current works describe use of various task-specific initialization constraints to solve the addition and copying tasks better (Henaff et al., 2016; Le et al., 2015). Instead of that, we use a data-driven curriculum learning protocol in our experiments and are able to obtain dramatically improved performance on these tasks. The networks used for the copying and addition tasks are fairly small. We also test it on a character-level language modelling task with the Penn Treebank dataset (Marcus et al., 1994) using a large network with roughly 19M parameters(Kim et al., 2016). We swap the lpLSTM cells with an LSTM cells in our experiments and the network architecture and hyper-parameter settings were left unchanged from the values reported by the original authors. A summary of our observations are as follows: The lpRNN cell exhibits a dramatically improved performance over the SimpleRNN cell. The low pass filter appears to have a temporal stabilization effect even for LSTM cells. However, when other regularization and stabilization techniques such as Dropout(Srivastava et al., 2014) are introduced, the benefit appears muted. It is possible that the large networks with low-pass RNN layers require network architecture tweaks to benefit from the filtering property, but it was not investigated in this work.
|
| 404 |
+
|
| 405 |
+
# I.1.1 TEMPORAL ADDITION TASK
|
| 406 |
+
|
| 407 |
+
The addition task (Le et al., 2015) involves processing two parallel input data streams of equal length. The first stream comprises random numbers $\in ( 0 , 1 )$ and the second is full of zeros except at 2 time steps. At the end of the sequence, the network should output the sum of the two numbers in the first data stream corresponding to the time-steps when the second stream had non-zero entries. The baseline to beat is a mean square error (mse) of 0.1767, corresponding to a network that always generates 1.
|
| 408 |
+
|
| 409 |
+
We first train the RNN cell being tested on a short sequence and progressively increase the length. Each curriculum used 10,000 training and 1000 test samples. The results are shown in Figures I.6, where each stage of the curriculum learning process is marked with bands of different colours. The width of the band indicates the number of epochs taken for convergence. The length of the task was incremented when the mse went below 0.001. With random initialization, the SimpleRNN cell failed to converge beyond sequence length 40, even with curriculum learning. On the other hand, both the lpRNN and LSTM cells benefit from the curriculum learning protocol. The lpRNN cell was able to transfer learning for sequences shorter than 150 steps. While, the benefits of curriculum learning appears to have reduced beyond that, the lpRNN cells were able to achieve better than 0.001 mse for sequences up to 642. The performance of the lpRNN cell is at par or slightly inferior to other works in literature (Hochreiter and Schmidhuber, 1997; Arjovsky et al., 2016; Le et al., 2015; Hu et al., 2018), we achieved this result purely by random initialization. Another interesting outcome of this experiment was the effectiveness of a 2-unit LSTM cell in solving this task. It was was able to add sequences much longer(we tested up to 100K) than any reported work (where the networks are only able to solve the task for about 1/100th of the sequence length).
|
| 410 |
+
|
| 411 |
+
Given the effectiveness of the training protocol, we made the task more complex by allowing the second stream to have up to 10 unmasked entries during training. The trained cell was tested with a data stream having more than 10 masked entries. The LSTM cell was successful in solving this problem a mse less than 1e-3, indicating that it learnt a general add and accumulate operation. Figure I.6c shows the evolution of the gating functions, internal state, and the state variables of an LSTM cell that was trained only on a fixed length sequence of 100 with mse less than 0.001. Contrast this against the stable dynamics of the network trained by curriculum learning in Figure I.6d in a 100K sequence with mse less than 1e-3 (Figure I.6) indicating almost perfect long-term memory and addition. To our knowledge, this kind of generalized learning by an LSTM cell has not been shown before.
|
| 412 |
+
|
| 413 |
+
# I.1.2 TEMPORAL COPYING TASK
|
| 414 |
+
|
| 415 |
+
We train the RNN cells on a varying length copying task as defined in (Graves et al., 2014) instead of the original definition (Hochreiter and Schmidhuber, 1997; Arjovsky et al., 2016). This problem is harder to solve than the temporal addition task. The network receives a sequence of up to S symbols (in the original definition, S is fixed) drawn from an alphabet of size K. At the end of S symbols, a sequence of T blank symbols ending with a trigger symbol is passed. The trigger symbol indicates that the network should reproduce the first S symbols in the same order. We first train the network on a short sequence $\scriptstyle ( \mathrm { T } = 3 )$ ) and gradually increase it $( \mathrm { T } { \leq } 2 0 0 )$ . The sequence length is incremented when the categorical accuracy is better than $9 9 \%$ .
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
Figure I.6: Curriculum learning on the masked addition task. LSTM cell trained without curriculum learning results in unstable state variables (c). When trained with curriculum learning it looks much more stable (d). Stars in (c) and (d) indicate value of the add mask.
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
Figure I.7: Curriculum learning on the variable length copying task for a 256 unit lpRNN (top left) and a 128 unit LSTM cell (top right) and a 128 unit lpLSTM cell(bottom left and right).
|
| 422 |
+
|
| 423 |
+
The SimpleRNN cell failed at this task even for $\mathrm { T } { = } 3 0$ with categorical accuracy dropping to $84 \%$ when it predicted only $\mathrm { \Omega } _ { \mathrm { { S + T } } }$ blank symbols. The lpRNN cell was able to achieve $9 9 \%$ accuracy for up to 120 time steps. After that, it generates $\mathrm { T }$ blank entries accurately but the accuracy of the last S symbols drops (For ${ \mathrm { T } } { = } 2 0 0$ , it was $9 6 \%$ ). However, the LSTM cell achieves more than $9 9 . 5 \pm \%$ accuracy for all tested sequence lengths, highlighting the advantage of curriculum learning. This is a big improvement over reported results (Arjovsky et al., 2016; Graves et al., 2014; Bai et al., 2018) where LSTM cells solved the task for much smaller values of $S$ and $T$ .
|
| 424 |
+
|
| 425 |
+
We observed stability issues when training an LSTM cell for sequences longer than 30, even if it eventually converged by using smaller learning rates and gradient norm scaling. This makes a good test case to validate the temporal regularization property of the lpLSTM cell. In our tests, the lpLSTM cell converged without instability with categorical accuracy higher than $9 9 . 5 \%$ for all tested values of $\mathrm { T } ( \in [ 3 , 5 0 0 ] )$ ). It also to generalized larger values of S than the other cells $( \leq 2 5 )$ . The lpLSTM cell exhibited a gradual degradation in performance for larger values of S. We stop our simulations when the categorical accuracy fell below $96 \%$ . These results are summarized in Figure I.7.
|
| 426 |
+
|
| 427 |
+
# I.1.3 PENN TREEBANK (PTB) CHARACTER MODEL
|
| 428 |
+
|
| 429 |
+
We studied temporal regularization in a network trained on the PTB dataset (Marcus et al., 1994) by replacing the LSTM cells by its low pass variants. We choose a model with 19M parameters (Kim et al., 2016) and trained all variants using the same settings as described in (Kim et al., 2016) for 25 epochs. We note that both lpLSTM cells converge to a better score on the training set and a marginally poorer score on the train/validation set (refer Table 6). The lpLSTM cell with relu activation also converges unlike the plain relu LSTM cell validating our claim on temporal regularization.
|
| 430 |
+
|
| 431 |
+
Table 6: Impact of temporal regularization on the Penn Treebank model.
|
| 432 |
+
|
| 433 |
+
<table><tr><td></td><td>Activation</td><td>Train perplexity</td><td>Validation Perplexity</td><td>Test Perplexity</td></tr><tr><td>LSTM</td><td>relu</td><td>approx. 641</td><td>approx. 641</td><td>Fails to converge</td></tr><tr><td></td><td>tanh</td><td>46.0948</td><td>83.9807</td><td>80.0873</td></tr><tr><td>lpLSTM</td><td>tanh</td><td>41.0545</td><td>84.6127</td><td>81.7519</td></tr><tr><td></td><td>relu</td><td>43.0602</td><td>84.1484</td><td>80.6946</td></tr></table>
|
| 434 |
+
|
| 435 |
+
# J ENERGY CONSUMPTION ESTIMATION
|
| 436 |
+
|
| 437 |
+
In this section, we describe the procedure used for comparing the power consumption of the inmemory architecture against a Cortex-M4 processor. This processor was chosen as it is one of the most common low-power MCU platforms in use today.
|
| 438 |
+
|
| 439 |
+
In our analysis, we make a highly-optimistic estimate for the performance of the Cortex-M4 (ARM, 2019). We assume that there are no cache misses, that multiply and add operations take one clock cycle, the read from DRAM only consumes 6 pJ/bit, and also assume that the MCU is fully available for RNN computation. In particular, note that the memory cost per DRAM access should also include the address and data bus power consumption. This has been completely ignored in this analysis to keep things highly optimal on the Cortex-M4 side. We see that in such a configuration, the Cortex-M4 consumes only a few mW of power. In practice, the active power consumption of such processors tend to be in hundreds of mW (Rethinagiri et al., 2014).
|
| 440 |
+
|
| 441 |
+
We estimate the performance of the in-memory unit (also in $1 8 0 \mathrm { n m }$ technology for the known neuron implementation (Nair and Indiveri, 2019)). These results are then tabulated and system activity is modelled for two RNN models in Figure J.8a (2 layer RNN with 128 units/layer) and Figure J.8b (4 layer RNN with 500 units/layer).
|
| 442 |
+
|
| 443 |
+
The energy cost for the Cortex-M4 is modelled by the following equation:
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
E _ { t o t } = \left( C l k _ { m u l } \cdot N _ { m u l } + C l k _ { a d d } \cdot N _ { a d d } \right) \cdot E _ { c l k } + M \cdot E _ { m e m }
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
# where
|
| 450 |
+
|
| 451 |
+
• $E _ { t o t }$ : Total power consumed • $C l k _ { m u l }$ : Number of clocks for multiply • $N _ { m u l }$ : Number of multiply operations in the task. • $C l k _ { a d d }$ : Number of clocks for addition. • $N _ { a d d }$ : Number of add operations in the task. • $E _ { c l k }$ : Energy consumed by the processor per clock. • $M$ : Number of memory bit accesses • $E _ { m e m }$ : Energy cost of a accessing a single bit.
|
| 452 |
+
|
| 453 |
+
The energy cost for the in-memory architecture is modelled by the following equation:
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
E _ { t o t } = ( N \cdot E _ { s p i k e } + M ) \cdot N _ { s p i k e s }
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
# where
|
| 460 |
+
|
| 461 |
+
• N: Number of neurons
|
| 462 |
+
• $E _ { s p i k e }$ : Energy per spike
|
| 463 |
+
• $N _ { s p i k e s }$ : Total number of spikes. This is computed for the $\Sigma \Delta$ model by computing the average firing rate as a function of the desired bit precision. This is approximating by equating the desired firing rate of the $\Sigma \Delta$ neuron to that of an oversampled clock necessary to achieve a desired Signal to Noise Ratio (SNR) (Pavan et al., 2017).
|
| 464 |
+
• M: Memory access cost. This is modelled by the the product of the read current while a spike is active.
|
| 465 |
+
|
| 466 |
+
Each of the terms in the computation of the power consumption of the Cortex and in-memory systems are in turn calculated based on a number of hardware and operational assumptions that are listed in the tables. We note an improved energy-efficiency of several hundred times across the board in both configurations. We also note that the energy-savings is much higher for the larger network. This is simply because the number of sequential compute operations increases quadratically.
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
|
| 470 |
+
# (a) For a two-layer RNN with 128 units per layer
|
| 471 |
+
|
| 472 |
+

|
| 473 |
+
(b) For a four-layer RNN with 500 units per layer
|
| 474 |
+
Figure J.8: Energy consumption comparison between an in-memory RNN accelerator implementing the lpRNN model against a Cortex M4.
|
md/train/Ig-VyQc-MLK/Ig-VyQc-MLK.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/JbuYF437WB6/JbuYF437WB6.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIRECTED ACYCLIC GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Veronika Thost & Jie Chen∗
|
| 4 |
+
MIT-IBM Watson AI Lab, IBM Research
|
| 5 |
+
Veronika.Thost@ibm.com, chenjie@us.ibm.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Graph-structured data ubiquitously appears in science and engineering. Graph neural networks (GNNs) are designed to exploit the relational inductive bias exhibited in graphs; they have been shown to outperform other forms of neural networks in scenarios where structure information supplements node features. The most common GNN architecture aggregates information from neighborhoods based on message passing. Its generality has made it broadly applicable. In this paper, we focus on a special, yet widely used, type of graphs—DAGs—and inject a stronger inductive bias—partial ordering—into the neural network design. We propose the directed acyclic graph neural network, DAGNN, an architecture that processes information according to the flow defined by the partial order. DAGNN can be considered a framework that entails earlier works as special cases (e.g., models for trees and models updating node representations recurrently), but we identify several crucial components that prior architectures lack. We perform comprehensive experiments, including ablation studies, on representative DAG datasets (i.e., source code, neural architectures, and probabilistic graphical models) and demonstrate the superiority of DAGNN over simpler DAG architectures as well as general graph architectures.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Graph-structured data is ubiquitous across various disciplines (Gilmer et al., 2017; Zitnik et al., 2018; Sanchez-Gonzalez et al., 2020). Graph neural networks (GNNs) use both the graph structure and node features to produce a vectorial representation, which can be used for classification, regression (Hu et al., 2020), and graph decoding (Li et al., 2018; Zhang et al., 2019). Most popular GNNs update node representations through iterative message passing between neighboring nodes, followed by pooling (either flat or hierarchical (Lee et al., 2019; Ranjan et al., 2020)), to produce a graph representation (Li et al., 2016; Kipf & Welling, 2017; Gilmer et al., 2017; Velickovi ˇ c et al., ´ 2018; Xu et al., 2019). The relational inductive bias (Santoro et al., 2017; Battaglia et al., 2018; Xu et al., 2020)—neighborhood aggregation—empowers GNNs to outperform graph-agnostic neural networks. To facilitate subsequent discussions, we formalize a message-passing neural network (MPNN) architecture, which computes representations $h _ { v } ^ { \ell }$ for all nodes $v$ in a graph $\mathcal { G }$ in every layer $\ell$ and a final graph representation $h _ { \mathcal { G } }$ , as (Gilmer et al., 2017):
|
| 14 |
+
|
| 15 |
+
$$
|
| 16 |
+
\begin{array} { r l } & { h _ { v } ^ { \ell } = \mathrm { C O M B I N E } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , \mathrm { A G G R E G A T E } ^ { \ell } \big ( \underbrace { \{ h _ { u } ^ { \ell - 1 } \mid u \in \mathcal { N } ( v ) \} } _ { \ell } \big ) \Big ) , \quad \ell = 1 , \dots , L , } \\ & { h _ { \mathcal { G } } = \mathrm { R E A D O U T } \Big ( \{ h _ { v } ^ { L } , v \in \mathcal { V } \} \Big ) , } \end{array}
|
| 17 |
+
$$
|
| 18 |
+
|
| 19 |
+
where $h _ { v } ^ { 0 }$ is the input feature of $v$ , $\mathcal { N } ( v )$ denotes a neighborhood of node $v$ (sometimes including $v$ itself), $\nu$ denotes the node set of $\mathcal { G }$ , $L$ is the number of layers, and AGGREGAT $\mathrm { E } ^ { \ell }$ , COMBINE\`, and READOUT are parameterized neural networks. For notational simplicity, we omit edge attributes; but they can be straightforwardly incorporated into the framework (1)–(2).
|
| 20 |
+
|
| 21 |
+
Directed acyclic graphs (DAGs) are a special type of graphs, yet broadly seen across domains. Examples include parsing results of source code (Allamanis et al., 2018), logical formulas (Crouse et al., 2019), and natural language sentences, as well as probabilistic graphical models (Zhang et al., 2019), neural architectures (Zhang et al., 2019), and automated planning problems (Ma et al., 2020).
|
| 22 |
+
|
| 23 |
+
A directed graph is a DAG if and only if the edges define a partial ordering over the nodes. The partial order is an additionally strong inductive bias one naturally desires to incorporate into the neural network. For example, a neural architecture seen as a DAG defines the acyclic dependency of computation, an important piece of information when comparing architectures and predicting their performance. Hence, this information should be incorporated into the architecture representation for higher predictive power.
|
| 24 |
+
|
| 25 |
+
In this work, we propose DAGNNs—directed acyclic graph neural networks—that produce a representation for a DAG driven by the partial order. In particular, the order allows for updating node representations based on those of all their predecessors sequentially, such that nodes without successors digest the information of the entire graph. Such a processing manner substantially differs from that of MPNNs where the information landed on a node is limited by a multi-hop local neighborhood and thus restricted by the depth $L$ of the network.
|
| 26 |
+
|
| 27 |
+
Modulo details to be elaborated in sections that follow, the DAGNN framework reads
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\begin{array} { r l } & { h _ { v } ^ { \ell } = F ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , G ^ { \ell } \big ( \underbrace { \{ h _ { u } ^ { \ell } \mid u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } } _ { h \mathcal { G } } \big ) \Big ) , \quad \ell = 1 , \dots , L , } \\ & { h _ { \mathcal { G } } = R \Big ( \{ h _ { v } ^ { \ell } , \ell = 0 , 1 , \dots , L , v \in \mathcal { T } \} \Big ) , } \end{array}
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\mathcal { P } ( v )$ denotes the set of direct predecessors of $v , \tau$ denotes the set of nodes without (direct) successors, and $G ^ { \ell } , F ^ { \ell }$ , and $R$ are parameterized neural networks that play similar roles to AGGREGAT $\mathrm { E } ^ { \ell }$ , $\mathrm { C O M B I N E } ^ { \ell }$ , and READOUT, respectively.
|
| 34 |
+
|
| 35 |
+
A notable difference between (3)–(4) and (1)–(2) is that the superscript $\ell - 1$ inside the underlined part of (1) is advanced to $\ell$ in the counterpart in (3). In other words, MPNN aggregates neighborhood information from the past layer, whereas DAGNN uses the information in the current layer. An advantage is that DAGNN always uses more recent information to update node representations.
|
| 36 |
+
|
| 37 |
+
Equations (3)–(4) outline several other subtle but important differences between DAGNN and MPNNs, such as the use of only direct predecessors for aggregation and the pooling on only nodes without successors. All these differences are unique to the special structure a DAG enjoys. Exploiting this structure properly should yield a more favorable vectorial representation of the graph. In Section 2, we will elaborate the specifics of (3)–(4). The technical details include (i) attention for node aggregation, (ii) multiple layers for expressivity, and (iii) topological batching for efficient implementation, all of which yield an instantiation of the DAGNN framework that is state of the art.
|
| 38 |
+
|
| 39 |
+
For theoretical contributions, we study topological batching and justify that this technique yields maximal parallel concurrency in processing DAGs. Furthermore, we show that the mapping defined by DAGNN is invariant to node permutation and injective under mild assumptions. This result reassures that the graph representation extracted by DAGNN is discriminative.
|
| 40 |
+
|
| 41 |
+
Because DAGs appear in many different fields, neural architectures for DAGs (including, notably, D-VAE (Zhang et al., 2019)) or special cases (e.g., trees) are scattered around the literature over the years. Generally, they are less explored compared to MPNNs; and some are rather applicationspecific. In Section 3, we unify several representative architectures as special cases of the framework (3)–(4). We compare the proposed architecture to them and point out the differences that lead to its superior performance.
|
| 42 |
+
|
| 43 |
+
In Section 4, we detail our comprehensive, empirical evaluation on datasets from three domains: (i) source code parsed to DAGs (Hu et al., 2020); (ii) neural architecture search (Zhang et al., 2019), where each architecture is a DAG; and (iii) score-based Bayesian network learning (Zhang et al., 2019). We show that DAGNN outperforms many representative DAG architectures and MPNNs.
|
| 44 |
+
|
| 45 |
+
Overall, this work contributes a specialized graph neural network, a theoretical study of its properties, an analysis of a topological batching technique for enhancing parallel concurrency, a framework interpretation that encompasses prior DAG architectures, and comprehensive evaluations. Supported code is available at https://github.com/vthost/DAGNN.
|
| 46 |
+
|
| 47 |
+
# 2 THE DAGNN MODEL
|
| 48 |
+
|
| 49 |
+
A $D A G$ is a directed graph without cycles. Denote by $\mathcal { G } = ( \nu , \mathcal { E } )$ a DAG, where $\nu$ and $\mathcal { E } \subset \mathcal { V } \times \mathcal { V }$ are the node set and the edge set, respectively. A (strong) partial order over a set $S$ is a binary relation $\leq$ that is transitive and asymmetric. Some authors use reflexivity versus irreflexivity to distinguish weak partial order over strong partial order. To unify concepts, we forbid self-loops (which otherwise are considered cycles) in the DAG and mean strong partial order throughout. A set $S$ with partial order $\leq$ is called a poset and denoted by a tuple $( S , \leq )$ .
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: Processing of node $v \ = \ 3$ (orange). For each layer $\ell$ , we collect representations $h _ { v } ^ { \ell }$ for all nodes $v$ in a matrix $\mathcal { H } ^ { \ell }$ , where each row represents one node. The initial feature matrix is $\mathcal { X } = \mathcal { H } ^ { 0 }$ . In the first layer, the representations of the direct predecessors $\mathcal { P } ( v ) = \{ 0 , 1 , 2 \}$ (blue) have been computed; they are aggregated together with the past representation of $v$ (orange) to produce a message. The GRU treats the message as the hidden state and the past representation of $v$ as input and outputs an updated representation for $v$ (green). This new representation will be used by $v$ ’s direct successors $\{ 4 \}$ in the same layer and also as input to the next layer. Note that the figure illustrates the processing of only one node. In practice, a batch of nodes is processed; see Section 2.2.
|
| 53 |
+
|
| 54 |
+
A DAG $( \nu , \mathcal { E } )$ and a poset $( S , \leq )$ are closely related. For any DAG, one can define a unique partial order $\leq$ on the node set $\nu$ , such that for all pairs of elements $u , v \in \mathcal { V }$ , $u \leq v$ if and only if there is a directed path from $u$ to $v$ . On the other hand, for any poset $( S , \leq )$ , there exists (possibly more than) one DAG that uses $S$ as the node set and that admits a directed path from $u$ to $v$ whenever $u \leq v$ .
|
| 55 |
+
|
| 56 |
+
In a DAG, all nodes without (direct) predecessors are called sources and we collect them in the set $s$ . Similarly, all nodes without (direct) successors are called targets and we collect them in the set $\tau$ . Additionally, we let $\mathcal { X } = \{ h _ { v } ^ { 0 } , v \in \mathcal { V } \}$ be the set of input node features.
|
| 57 |
+
|
| 58 |
+
# 2.1 MODEL
|
| 59 |
+
|
| 60 |
+
The main idea of DAGNN is to process nodes according to the partial order defined by the DAG. Using the language of MPNN, at every node $v$ , we “aggregate” information from its neighbors and “combine” this aggregated information (the “message”) with $v$ ’s information to update the representation of $v$ . The main differences to MPNN are that (i) we use the current-layer, rather than the past-layer, information to compute the current-layer representation of $v$ and that (ii) we aggregate from the direct-predecessor set $\mathcal { P } ( v )$ only, rather than the entire (or randomly sampled) neighborhood $\mathcal { N } ( v )$ . They lead to a straightforward difference in the final “readout” also. In the following, we propose an instantiation of Equations (3)–(4). See Figure 1 for an illustration of the architecture.
|
| 61 |
+
|
| 62 |
+
One layer. We use the attention mechanism to instantiate the aggregate operator $G ^ { \ell }$ . For a node $v$ at the $\ell$ -th layer, the output message $m _ { v } ^ { \ell }$ computed by $G ^ { \ell }$ is a weighted combination of $h _ { u } ^ { \ell }$ for all nodes $u \in \mathcal { P } ( v )$ at the same layer $\ell$ :
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\underbrace { m _ { v } ^ { \ell } } _ { \mathrm { m e s s a g e } } : = G ^ { \ell } \Big ( \{ h _ { u } ^ { \ell } \mid u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } \Big ) = \sum _ { u \in \mathcal { P } ( v ) } \alpha _ { v u } ^ { \ell } \Big ( \underbrace { h _ { v } ^ { \ell - 1 } } _ { \mathrm { q u e r y } } , \underbrace { h _ { u } ^ { \ell } } _ { \mathrm { k e y } } \Big ) \underbrace { h _ { u } ^ { \ell } } _ { \mathrm { v a l u e } } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The weighting coefficients $\alpha _ { v u } ^ { \ell }$ follow the query-key design in usual attention mechanisms, whereby the representation of $v$ in the past layer, $h _ { v } ^ { \ell - 1 }$ , serves as the query. Specifically, we define
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\alpha _ { v u } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , h _ { u } ^ { \ell } \Big ) = \operatorname * { s o f t m a x } _ { u \in \mathcal { P } ( v ) } \Big ( { w _ { 1 } ^ { \ell } } ^ { \top } h _ { v } ^ { \ell - 1 } + { w _ { 2 } ^ { \ell } } ^ { \top } h _ { u } ^ { \ell } \Big ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $w _ { 1 } ^ { \ell }$ and $w _ { 2 } ^ { \ell }$ are model parameters. We use the additive form, as opposed to the usual dotproduct form,1 since it involves fewer parameters. An additional advantage is that it is straightforward to incorporate edge attributes into the model, as will be discussed soon.
|
| 75 |
+
|
| 76 |
+
The combine operator $F ^ { \ell }$ combines the message $m _ { v } ^ { \ell }$ with the previous representation of $v$ , $h _ { v } ^ { \ell - 1 }$ and produces an updated representation $h _ { v } ^ { \ell }$ . We employ a recurrent architecture, which is usually used for processing data in sequential order but similarly suits processing in partial order:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r } { \begin{array} { r } { h _ { v } ^ { \ell } = F ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , m _ { v } ^ { \ell } \Big ) = \mathrm { G R U } ^ { \ell } \Big ( \underbrace { h _ { v } ^ { \ell - 1 } } _ { \mathrm { i n p u t } } \overbrace { \underbrace { m _ { v } ^ { \ell } } _ { \mathrm { s t a t e } } } ^ { \widehat { m _ { v } ^ { \ell } } } \Big ) , } \end{array} } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $h _ { v } ^ { \ell - 1 }$ , $m _ { v } ^ { \ell }$ , and $h _ { v } ^ { \ell }$ are treated as the input, past state, and updated state/output of a GRU, respectively. This design differs from most MPNNs that use simple summation or concatenation to combine the representations. It further differs from GG-NN (Li et al., 2016) (which also employs a GRU), wherein the roles of the two arguments are switched. In GG-NN, the message is treated as the input and the node representation is treated as the state. In contrast, we start from node features and naturally use them as inputs. The message tracks the processed part of the graph and serves better the role of a hidden state, being recurrently updated.
|
| 83 |
+
|
| 84 |
+
By convention, we define $G ^ { \ell } ( \varnothing , \cdot ) = 0$ for the aggregator so that for nodes with an empty directpredecessor set, the message (or, equivalently, the initial state of the GRU) is zero.
|
| 85 |
+
|
| 86 |
+
Bidirectional processing. Just like in sequence models where a sequence may be processed by either the natural order or the reversed order, we optionally invert the directions of the edges in $\mathcal { G }$ to create a reverse $D A G { \tilde { \mathcal { G } } }$ . We will use the tilde notation for all terms related to the reverse DAG. For example, the representation of node $v$ in $\ddot { \mathcal { G } }$ at the $\ell$ -th layer is denoted by $\widetilde { h } _ { v } ^ { \ell }$ .
|
| 87 |
+
|
| 88 |
+
Readout. After $L$ layers of (bidirectional) processing, we use the computed node representations to produce the graph representation. We follow a common practice—concatenate the representations across layers, perform a max-pooling across nodes, and apply a fully-connected layer to produce the output. Different from the usual practice, however, we pull across only the target nodes and concatenate the pooling results from the two directions. Recall that the target nodes contain information of the entire graph following the partial order. Mathematically, the readout $R$ produces
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
h _ { \mathscr { G } } = \mathrm { F C } \Big ( \operatorname { M a x - P o o l } _ { v \in { \mathscr { T } } } \big ( \operatorname { \mu } _ { \ell = 0 } ^ { L } h _ { v } ^ { \ell } \big ) \mathbb { \mu } \operatorname { M a x - P o o l } _ { u \in { \mathscr { S } } } \big ( \operatorname { \mu } _ { \ell = 0 } ^ { L } \widetilde { h } _ { u } ^ { \ell } \big ) \Big ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Note that the target set $\widetilde { \tau }$ of $\widetilde { \mathcal G }$ is the same as the source set $s$ of $\mathcal { G }$ . If the processing is unidirectional, the right pooling in (8) is dropped.
|
| 95 |
+
|
| 96 |
+
Edge attributes. The instantiation of the framework so far has not considered edge attributes. It is in fact simple to incorporate them. Let $\tau ( u , v )$ be the type of an edge $( u , v )$ and let $y _ { \tau }$ be a representation of edges of type $\tau$ . We insert this information during message calculation in the aggregator. Specifically, we replace the attention weights $\alpha _ { v u } ^ { \ell }$ defined in (6) by
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\alpha _ { v u } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , h _ { u } ^ { \ell } \Big ) = \operatorname * { s o f t m a x } _ { u \in \mathcal { P } ( v ) } \Big ( \boldsymbol { w } _ { 1 } ^ { \ell } { } ^ { \top } h _ { v } ^ { \ell - 1 } + \boldsymbol { w } _ { 2 } ^ { \ell } { } ^ { \top } h _ { u } ^ { \ell } + \boldsymbol { w } _ { 3 } ^ { \ell } { } ^ { \top } \boldsymbol { y } _ { \tau ( u , v ) } \Big ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
In practice, we experiment with slightly fewer parameters by setting $w _ { 3 } ^ { \ell } = w _ { 1 } ^ { \ell }$ and find that the model performs equally well. The edge representations $y _ { \tau }$ are trainable embeddings of the model. Alternatively, if input edge features are provided, $y _ { \tau ( u , v ) }$ can be replaced by a neural networktransformed embedding for the edge $( u , v )$ .
|
| 103 |
+
|
| 104 |
+
# 2.2 TOPOLOGICAL BATCHING
|
| 105 |
+
|
| 106 |
+
A key difference to MPNN is that DAGNN processes nodes sequentially owing to the nature of the aggregator $G ^ { \ell }$ , obeying the partial order. Thus, for computational efficiency, it is important to maximally exploit concurrency so as to better leverage parallel computing resources (e.g., GPUs). One observation is that nodes without dependency may be grouped together and processed concurrently, if their predecessors have all been processed. See Figure 2 for an illustration.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2: Topological batching. Left: for the original graph $\mathcal { G }$ ; right: for the reverse graph $\widetilde { \mathcal G }$ .
|
| 110 |
+
|
| 111 |
+
To materialize this idea, we consider topological batching, which partitions the node set $\nu$ into ordered batches $\{ B _ { i } \} _ { i \geq 0 }$ so that (i) the $B _ { i }$ ’s are disjoint and their union is $\nu$ ; (ii) for every pair of nodes $u , v \in B _ { i }$ for some $i$ , there is not a directed path from $u$ to $v$ or from $v$ to $u$ ; (iii) for every $i > 0$ , there exists one node in $B _ { i }$ such that it is the tail of an edge whose head is in $\boldsymbol { B } _ { i - 1 }$ . The concept was proposed by Crouse et al. (2019);2 in what follows, we derive several properties that legitimizes its use in our setting. First, topological batching produces the minimum number of sequential batches such that all nodes in each batch can be processed in parallel.
|
| 112 |
+
|
| 113 |
+
Theorem 1. The number of batches from a partitioning that satisfies (i)–(iii) described in the preceding paragraph is equal to the number of nodes in the longest path of the DAG. As a consequence, this partitioning produces the minimum number of ordered batches such that for all $u \leq v$ , if $u \in B _ { i }$ and $v \in B _ { j }$ , then $i < j$ . Note that the partial order $\leq$ is defined at the beginning of Section 2.
|
| 114 |
+
|
| 115 |
+
The partitioning procedure may be as follows. All nodes without direct predecessors, $s$ , form the initial batch. Iteratively, remove the batch just formed from the graph, as well as the edges emitting from these nodes. The nodes without direct predecessors in the remaining graph form the next batch. Remark 1. To satisfy Properties (i)–(iii), it is not necessary that $\boldsymbol { B _ { 0 } } = \boldsymbol { S }$ ; but the above procedure achieves so. Applying this procedure on the reverse DAG $\widetilde { \mathcal G }$ , we obtain $\widetilde { B } _ { 0 } = { \mathcal T }$ . Note that the last batch for $\mathcal { G }$ may not be the same as $\tau$ ; and the last batch for $\widetilde { \mathcal G }$ may not be the same as $s$ either.
|
| 116 |
+
|
| 117 |
+
Remark 2. Topological batching can be straightforwardly extended to multiple graphs for better parallel concurrency: one merges the $B _ { i }$ for the same $i$ across graphs into a single batch. This is equivalent to treating the multiple DAGs as a single (albeit disconnected) DAG and applying topological batching on it.
|
| 118 |
+
|
| 119 |
+
# 2.3 PROPERTIES
|
| 120 |
+
|
| 121 |
+
In the following, we summarize properties of the DAGNN model; they are consistent with the corresponding results for MPNNs. To formalize these results, we let $\mathcal { M } : \mathcal { V } \times \mathcal { E } \times \mathcal { X } \to h _ { \mathcal { G } }$ denote the mapping defined by Equations (3)–(4). For notational consistency, we omit bidirectional processing, and thus ignore the tilde term in (8). The first results state that DAGNN produces the same graph representation invariant to node permutation.
|
| 122 |
+
|
| 123 |
+
Theorem 2. The graph representation $h _ { \mathcal { G } }$ is invariant to node indexing if all $G ^ { \ell } , F ^ { \ell }$ , and $R$ are so.
|
| 124 |
+
|
| 125 |
+
Corollary 3. The functions $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ defined in (5)–(8) are invariant to node indexing. Hence, the resulting graph representation $h _ { \mathcal { G } }$ is, too.
|
| 126 |
+
|
| 127 |
+
The next result states that the framework will not produce the same graph representation for different graphs (i.e., non-isomorphic graphs), under a common condition.
|
| 128 |
+
|
| 129 |
+
Theorem 4. The mapping $\mathcal { M }$ is injective if $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ , considered as multiset functions, are so.
|
| 130 |
+
|
| 131 |
+
The condition required by Theorem 4 is not restrictive. There exist (infinitely many) injective multiset functions $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ , although the ones instantiated by (5)–(8) are not necessarily injective. The modification to injection can be done by using the $\epsilon$ -trick applied in GIN (Xu et al., 2019), but, similar to the referenced work, the $\epsilon$ that ensures injection is unknown. In practice, it is either set as zero or treated as a tunable hyperparameter.
|
| 132 |
+
|
| 133 |
+
# 3 COMPARISON TO RELATED MODELS
|
| 134 |
+
|
| 135 |
+
In this section, we compare to the most closely related architectures for DAGs, including trees. Natural language processing is a major source of these architectures, since semantic parsing forms a rooted tree or a DAG. Recently, D-VAE (Zhang et al., 2019) has been suggested as a generalpurpose autoencoder for DAGs. Its encoder architecture is the most similar one to ours, but we highlight notable differences that support the improvement DAGNN gains over the D-VAE encoder. All the models we compare with may be considered as restricted cases of the framework (3)–(4).
|
| 136 |
+
|
| 137 |
+
Rooted trees do usually not come with directed edges, because either direction (top-down or bottomup) is sensible. Hence, we use the terminology “parent” and “child” instead. Unified under our framework, recursive neural networks tailored to trees (Socher et al., 2011; 2012; 2013; Ebrahimi & Dou, 2015) are applied to a fixed number of children when the aggregator acts on a concatenation of the child representations. Moreover, they assume that internal nodes do not come with input representations and hence the combine operator misses the first argument.
|
| 138 |
+
|
| 139 |
+
Tree-LSTM (Tai et al., 2015; Zhu et al., 2015; Zhang et al., 2016; Kiperwasser & Goldberg, 2016) and DAG-RNN (Shuai et al., 2016), like DAGNN, employ a recurrent architecture as the combine operator, but the message (hidden state) therein is a naive sum or element-wise product of child representations. In a variant of Tree-LSTM, the naive sum is replaced by a sum of child representations multiplied by separate weight matrices. A limitation of this variant is that the number of children must be the same and the children must be ordered. Another limitation is that both architectures assume that there is a single terminal node (in which case a readout is not invoked).
|
| 140 |
+
|
| 141 |
+
The most similar architecture to DAGNN is the encoder of D-VAE. There are two notable differences. First, D-VAE uses the gated sum as aggregator but we use attention which leverages the information of not only the summands $( h _ { u } ^ { \ell } )$ but also that of the node under consideration $( h _ { v } ^ { \ell - 1 } )$ . This additional source of information enables attention driven by external factors and improves over self attention. Second, similar to all the aforementioned models, D-VAE does not come with a layer notion. On the contrary, we use multiple layers, which are more natural and powerful in the light of findings about general GNNs. Our empirical results described in the following section confirm so.
|
| 142 |
+
|
| 143 |
+
# 4 EVALUATION
|
| 144 |
+
|
| 145 |
+
In this section, we demonstrate the effectiveness of DAGNN on multiple datasets and tasks over a comprehensive list of baselines. We compare timing and show that the training cost of DAGNN is comparable with that of other DAG architectures. We also conduct ablation studies to verify the importance of its components, which prior DAG architectures lack.
|
| 146 |
+
|
| 147 |
+
# 4.1 DATASETS, TASKS, METRICS, AND BASELINES
|
| 148 |
+
|
| 149 |
+
The OGBG-CODE dataset (Hu et al., 2020) contains 452,741 Python functions parsed into DAGs. We consider the TOK task, predicting the tokens that form the function name; it is included in the Open Graph Benchmark (OGB). Additionally, we introduce the LP task, predicting the length of the longest path of the DAG. The metric for TOK is the F1 score and that for LP is accuracy. Because of the vast size, we also create a $15 \%$ training subset, OGBG-CODE-15, for similar experiments.
|
| 150 |
+
|
| 151 |
+
For this dataset, we consider three basic baselines and several GNN models for comparison. For the TOK task, the Node2Token baseline predicts tokens from the attributes of the second graph node, while the TargetInGraph baseline predicts tokens that appear in both the ground truth and in the attributes of some graph node. These baselines exploit the fact that the tokens form node attributes and that the second node’s attribute contains the function name if it is part of the vocabulary. For the LP task, the MajorityInValid baseline constantly predicts the majority length seen from the validation set. The considered GNN models include four from OGB: GCN (Kipf & Welling, 2017), GIN (Xu et al., 2019), GCN-VN, GIN-VN (where -VN means adding a virtual node connecting all existing nodes); two using attention/gated-sum mechanisms: GAT (Velickovi ˇ c et al., 2018), ´ GG-NN (Li et al., 2016); two hierarchical pooling approaches using attention: SAGPool (Lee et al., 2019), ASAP (Ranjan et al., 2020); and the D-VAE encoder.
|
| 152 |
+
|
| 153 |
+
Table 1: Prediction performance on the full dataset OGBG-CODE and a $15 \%$ subset OGBGCODE-15 for two tasks: TOK and LP. Best results are boldfaced and second best are underlined.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Model</td><td>TOK</td><td>TOK-15</td><td>LP</td><td>LP-15</td></tr><tr><td>F1↑</td><td>F1个</td><td>Acc ↑</td><td>Acc ↑</td></tr><tr><td>Node2Token</td><td>13.04±0.00</td><td>13.04±0.00</td><td>-</td><td>=</td></tr><tr><td>TargetInGraph</td><td>27.32±0.00</td><td>27.08±0.00</td><td></td><td>1</td></tr><tr><td>MajorityInValid</td><td>-</td><td>=</td><td>22.66±0.00</td><td>22.66±0.00</td></tr><tr><td>GCN</td><td>31.63±0.18</td><td>24.39±0.40</td><td>95.55±0.62</td><td>90.66±2.00</td></tr><tr><td>GCN-VN</td><td>32.63±0.13</td><td>24.44±0.25</td><td>96.62±0.44</td><td>92.87±1.19</td></tr><tr><td>GIN</td><td>31.63±0.20</td><td>21.49±0.61</td><td>98.36±0.32</td><td>92.53±2.30</td></tr><tr><td>GIN-VN</td><td>32.04±0.18</td><td>21.10±0.61</td><td>98.60±0.23</td><td>93.27±2.53</td></tr><tr><td>GAT</td><td>33.59±0.32</td><td>27.37±0.16</td><td>93.71±0.24</td><td>83.15±1.34</td></tr><tr><td>GG-NN</td><td>28.04±0.27</td><td>23.15±0.49</td><td>96.48±0.27</td><td>89.16±2.31</td></tr><tr><td>SAGPool</td><td>31.88±0.39</td><td>24.45±0.77</td><td>72.68±14.29</td><td>60.66±11.42</td></tr><tr><td>ASAP</td><td>28.30±0.72</td><td>25.06±0.37</td><td>87.84±2.77</td><td>71.56±3.76</td></tr><tr><td>D-VAE</td><td>32.64±0.17</td><td>27.08±0.39</td><td>99.90±0.02</td><td>99.78±0.01</td></tr><tr><td>DAGNN</td><td>34.41±0.38</td><td>29.11±0.44</td><td>99.93±0.01</td><td>99.86±0.04</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 2: Predictive performance of latent representations for datasets NA and BN.
|
| 158 |
+
|
| 159 |
+
<table><tr><td></td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Model</td><td>RMSE↓</td><td>Pearson'sr↑</td><td>RMSE↓</td><td>Pearson'sr个</td></tr><tr><td>S-VAE</td><td>0.521±0.002</td><td>0.847±0.001</td><td>0.499±0.006</td><td>0.873±0.002</td></tr><tr><td>GraphRNN</td><td>0.579±0.002</td><td>0.807±0.001</td><td>0.779±0.007</td><td>0.634±0.002</td></tr><tr><td>GCN</td><td>0.482±0.003</td><td>0.871±0.001</td><td>0.599±0.006</td><td>0.809±0.002</td></tr><tr><td>DeepGMG</td><td>0.478±0.002</td><td>0.873±0.001</td><td>0.843±0.007</td><td>0.555±0.003</td></tr><tr><td>D-VAE</td><td>0.375±0.003</td><td>0.924±0.001</td><td>0.281±0.004</td><td>0.964±0.001</td></tr><tr><td>DAGNN</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr></table>
|
| 160 |
+
|
| 161 |
+
The NA dataset (Zhang et al., 2019) contains 19,020 neural architectures generated by the ENAS software. The task is to predict the architecture performance on CIFAR-10 under the weight-sharing scheme. Since it is a regression task, the metrics are RMSE and Pearson’s $r$ . To gauge performance with Zhang et al. (2019), we similarly train (unsupervised) autoencoders and use sparse Gaussian process regression on the latent representation to predict the architecture performance. DAGNN serves as the encoder and we pair it with an adaptation of the D-VAE decoder (see Appendix D). We compare to D-VAE and all the autoencoders compared therein: S-VAE (Bowman et al., 2016), GraphRNN (You et al., 2018), GCN (Zhang et al., 2019), and DeepGMG (Li et al., 2018).
|
| 162 |
+
|
| 163 |
+
The BN dataset (Zhang et al., 2019) contains 200,000 Bayesian networks generated by using the R package bnlearn. The task is to predict the BIC score that measures how well a BN fits the Asia dataset (Lauritzen & Spiegelhalter, 1988). We use the same metrics and baselines as for NA.
|
| 164 |
+
|
| 165 |
+
# 4.2 RESULTS AND DISCUSSION
|
| 166 |
+
|
| 167 |
+
Prediction performance, token prediction (TOK), Table 1. The general trend is the same across the full dataset and the $15 \%$ subset. DAGNN performs the best. GAT achieves the second best result, surprisingly outperforming D-VAE (the third best). Hence, using attention as aggregator during message passing benefits this task. On the $15 \%$ subset, only DAGNN, GAT, and D-VAE match or surpass the TargetInGraph baseline. Note that not all ground-truth tokens are in the vocabulary and thus the best achievable F1 is 90.99. Even so, all methods are far from reaching this ceiling performance. Furthermore, although most of the MPNN models (middle section of the table) use as many as five layers for message passing, the generally good performance of DAGNN and D-VAE indicates that DAG architectures not restricted by the network depth benefit from the inductive bias.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Average training time per epoch, on logarithmic scale. Standard deviation is negligible.
|
| 171 |
+
|
| 172 |
+
Table 3: Ablation results.
|
| 173 |
+
|
| 174 |
+
<table><tr><td rowspan="3">Configuration</td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>F1↑</td><td>Acc↑</td><td>RMSE↓</td><td>Pearson'sr个</td><td>RMSE↓</td><td>Pearson'sr个</td></tr><tr><td>DAGNN</td><td>29.11±0.44</td><td>99.86±0.04</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr><tr><td>Gated-sum aggr.</td><td>24.98±0.45</td><td>99.88±0.02</td><td>0.451±0.002</td><td>0.887±0.001</td><td>0.486±0.005</td><td>0.878±0.001</td></tr><tr><td>Single layer</td><td>28.39±0.80</td><td>99.74±0.10</td><td>0.277±0.003</td><td>0.960±0.001</td><td>0.324±0.008</td><td>0.950±0.001</td></tr><tr><td>FC layer</td><td>26.08±0.80</td><td>99.85±0.02</td><td>0.280±0.004</td><td>0.959±0.001</td><td>0.362±0.002</td><td>0.934±0.001</td></tr><tr><td>Pool all nodes</td><td>28.40±0.08</td><td>99.78±0.05</td><td>0.302±0.002</td><td>0.952±0.001</td><td>0.098±0.003</td><td>0.996±0.001</td></tr><tr><td>W/o edge attr.</td><td>28.85±0.24</td><td>99.82±0.03</td><td>-</td><td>-</td><td>1</td><td>-</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Prediction performance, length of longest path (LP), Table 1. This analytical task interestingly reveals that many of the findings for the TOK task do not directly carry over. DAGNN still performs the best, but the second place is achieved by D-VAE while GAT lags far behind. The unsatisfactory performance of GAT indicates that attention alone is insufficient for DAG representation learning. The hierarchical pooling methods also perform disappointingly, showing that ignoring nodes may modify important properties of the graph (in this case, the longest path). It is worth noting that DAGNN and D-VAE achieve nearly perfect accuracy. This result corroborates the theory of $\mathrm { X u }$ et al. (2020), who state that when the inductive bias is aligned with the reasoning algorithm (in this case, path tracing), the model learns to reason more easily and achieves better sample efficiency.
|
| 177 |
+
|
| 178 |
+
Prediction performance, scoring the DAG, Table 2. On NA and BN, DAGNN also outperforms D-VAE, which in turn outperforms the other four baselines (among them, DeepGMG works the best on NA and S-VAE works the best on BN, consistent with the findings of Zhang et al. (2019).) While D-VAE demonstrates the benefit of incorporating the DAG bias, DAGNN proves the superiority of its architectural components, as will be further verified in the subsequent ablation study.
|
| 179 |
+
|
| 180 |
+
Time cost, Figure 3. The added expressivity of DAGNN comes with a tradeoff: the sequential processing of the topological batches requires more time than does the concurrent processing of all graph nodes, as in MPNNs. Figure 3 shows that such a trade-off is innate to DAG architectures, including the D-VAE encoder. Moreover, the figure shows that, when used as a component of a larger architecture (autoencoder), the overhead of DAGNN may not be essential. For example, in this particular experiment, DeepGMG (paired with the S-VAE encoder) takes an order of magnitude more time than does DAGNN (paired with the D-VAE decoder). Most importantly, not reflected in the figure is that DAGNN learns better and faster at larger learning rates, leading to fewer learning epochs. For example, DAGNN reaches the best performance at epoch 45, while D-VAE at around 200.
|
| 181 |
+
|
| 182 |
+
Ablation study, Table 3. While the D-VAE encoder performs competitively owing similarly to the incorporation of the DAG bias, what distinguishes our proposal are several architecture components that gain further performance improvement. In Table 3, we summarize results under the following cases: replacing attention in the aggregator by gated sum; reducing the multiple layers to one; replacing the GRUs by fully connected layers; modifying the readout by pooling over all nodes; and removing the edge attributes. One observes that replacing attention generally leads to the highest degradation in performance, while modifying other components yields losses too. There are two exceptions. One occurs on LP-15, where gated-sum aggregation surprisingly outperforms attention by a tight margin, considering the standard deviation. The other occurs on the modification of the readout for the BN dataset. In this case, a Bayesian network factorizes the joint distribution of all variables (nodes) it includes. Even though the DAG structure characterizes the conditional independence of the variables, they play equal roles to the BIC score and thus it is possible that emphasis of the target nodes adversely affects the predictive performance. In this case, pooling over all nodes appears to correct the overemphasis.
|
| 183 |
+
|
| 184 |
+
Table 4: DAGNN results for different numbers of layers.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan="2">#Layers</td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>F1个</td><td>Acc 个</td><td>RMSE↓</td><td>Pearson'sr个</td><td>RMSE↓</td><td>Pearson's r 个</td></tr><tr><td>1</td><td>28.39±0.80</td><td>99.74±0.10</td><td>0.277±0.003</td><td>0.960±0.001</td><td>0.324±0.008</td><td>0.950±0.001</td></tr><tr><td>2</td><td>29.11±0.44</td><td>99.86±0.04</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr><tr><td>3</td><td>28.96±0.27</td><td>99.81±0.06</td><td>0.260±0.004</td><td>0.965±0.001</td><td>0.129±0.011</td><td>0.993±0.001</td></tr><tr><td>4</td><td>28.91±0.43</td><td>99.78±0.04</td><td>0.265±0.004</td><td>0.963±0.001</td><td>0.129±0.014</td><td>0.993±0.002</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Sensitivity analysis, Table 4 and Figure 4. It is well known that MPNNs often achieve best performance with a small number of layers, a curious behavior distinct from other neural networks. It is important to see if such a behavior extends to DAGNN. In Table 4, we list the results for up to four layers. One observes that indeed the best performance occurs at either two or three layers. In other words, one layer is insufficient (as already demonstrated in the ablation study) and more than three layers offer no advantage. We further extend the experimentation on TOK-15 with additional layers and plot the results in Figure 4. The trend corroborates that the most significant improvement occurs when going beyond a single layer. It is also interesting to see that a single layer yields the highest variance subject to randomization.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 4: Extending Table 4 with further layers on TOK-15.
|
| 192 |
+
|
| 193 |
+
Structure learning, Figure 5. For an application of DAGNN, we extend the use of the BN dataset to learn the Bayesian network for the Asia data. In particular, we take the Bayesian optimization approach and optimize the BIC score over the latent space of DAGs. We use the graphs in BN as pivots and encode every graph by using DAGNN. The optimization yields a DAG with BIC score −11107.29 (see Figure 5). This DAG is almost the same as the ground truth (see Figure 2 of Lauritzen & Spiegelhalter (1988)), except that it does not include the edge from “visit to Asia?” to “Tuberculosis?”. It is interesting to note that the identified DAG has a higher BIC score than that of the ground truth, −11109.74. Furthermore, the BIC score is also much higher than that found by using the D-VAE encoder, $- 1 1 1 2 5 . 7 5$ (Zhang et al., 2019). This encouraging result corroborates the superior encoding quality of DAGNN and the effective use of it in downstream tasks.
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 5: The Bayesian network identified by using Bayesian optimization over the latent space encoded by DAGNN.
|
| 197 |
+
|
| 198 |
+
# 5 CONCLUSIONS
|
| 199 |
+
|
| 200 |
+
We have developed DAGNN, a GNN model for a special yet widely used class of graphs—DAGs. It incorporates the partial ordering entailed by DAGs as a strong inductive bias towards representation learning. With the blessing of this inductive bias, we demonstrate that DAGNNs outperform MPNNs on several representative datasets and tasks. Through ablation studies, we also show that the DAGNN model is well designed, with several components serving as crucial contributors to the performance gain over other models that also incorporate the DAG bias, notably, D-VAE. Furthermore, we theoretically study a batching technique that yields maximal parallel concurrency in processing DAGs and prove that DAGNN is permutation invariant and injective.
|
| 201 |
+
|
| 202 |
+
# ACKNOWLEDGMENTS
|
| 203 |
+
|
| 204 |
+
This work is supported in part by DOE Award DE-OE0000910. Most experiments were conducted on the Satori cluster (satori.mit.edu).
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Miltiadis Allamanis, Earl T. Barr, Premkumar T. Devanbu, and Charles A. Sutton. A survey of machine learning for big code and naturalness. ACM Comput. Surv., 51(4):81:1–81:37, 2018.
|
| 209 |
+
|
| 210 |
+
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vin´ıcius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, C¸ aglar Gulc¸ehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish ¨ Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018. URL http://arxiv.org/abs/1806.01261.
|
| 211 |
+
|
| 212 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy ´ Bengio. Generating sentences from a continuous space. In Yoav Goldberg and Stefan Riezler (eds.), Proc. of Conference on Computational Natural Language Learning, CoNLL, pp. 10–21, 2016.
|
| 213 |
+
|
| 214 |
+
Maxwell Crouse, Ibrahim Abdelaziz, Cristina Cornelio, Veronika Thost, Lingfei Wu, Kenneth Forbus, and Achille Fokoue. Improving graph neural network representations of logical formulae with subgraph pooling, 2019.
|
| 215 |
+
|
| 216 |
+
Javid Ebrahimi and Dejing Dou. Chain based RNN for relation classification. In Proc. of Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT, pp. 1244–1249, 2015.
|
| 217 |
+
|
| 218 |
+
Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In Proc. of ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
|
| 219 |
+
|
| 220 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Doina Precup and Yee Whye Teh (eds.), Proc. of International Conference on Machine Learning, ICML, volume 70 of Proceedings of Machine Learning Research, pp. 1263–1272. PMLR, 2017.
|
| 221 |
+
|
| 222 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. CoRR, abs/2005.00687, 2020. URL https://arxiv.org/abs/2005.00687.
|
| 223 |
+
|
| 224 |
+
Eliyahu Kiperwasser and Yoav Goldberg. Easy-first dependency parsing with hierarchical tree lstms. Trans. Assoc. Comput. Linguistics, 4:445–461, 2016. URL https://transacl.org/ojs/ index.php/tacl/article/view/798.
|
| 225 |
+
|
| 226 |
+
Thomas Kipf and Max Welling. Semi-supervised learning with graph convolutional neural networks. In Proc. of International Conference on Learning Representations, ICLR, 2017.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 229 |
+
|
| 230 |
+
S. L. Lauritzen and D. J. Spiegelhalter. Local computations with probabilities on graphical structures and their application to expert systems. Journal of the Royal Statistical Society. Series B (Methodological), 50(2):157–224, 1988. ISSN 00359246.
|
| 231 |
+
|
| 232 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In Proc. of International Conference on Machine Learning, ICML, volume 97 of Proceedings of Machine Learning Research, pp. 3734–3743. PMLR, 2019.
|
| 233 |
+
|
| 234 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard S. Zemel. Gated graph sequence neural networks. In Yoshua Bengio and Yann LeCun (eds.), Proc. of International Conference on Learning Representations, ICLR, 2016.
|
| 235 |
+
|
| 236 |
+
Yujia Li, Oriol Vinyals, Chris Dyer, Razvan Pascanu, and Peter W. Battaglia. Learning deep generative models of graphs. CoRR, abs/1803.03324, 2018.
|
| 237 |
+
|
| 238 |
+
Tengfei Ma, Patrick Ferber, Siyu Huo, Jie Chen, and Michael Katz. Online planner selection with graph neural networks and adaptive scheduling. In Proc. of Thirty-Fourth Conference on Artificial Intelligence, AAAI, 2020.
|
| 239 |
+
|
| 240 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Proc. of Advances in Neural Information Processing Systems, NeurIPS, pp. 8024–8035. 2019.
|
| 241 |
+
|
| 242 |
+
Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In Jennifer G. Dy and Andreas Krause (eds.), Proc. of International Conference on Machine Learning, ICML, volume 80 of Proceedings of Machine Learning Research, pp. 4092–4101. PMLR, 2018.
|
| 243 |
+
|
| 244 |
+
Ekagra Ranjan, Soumya Sanyal, and Partha P. Talukdar. ASAP: adaptive structure aware pooling for learning hierarchical graph representations. In Proc. of The Thirty-Fourth Conference on Artificial Intelligence, AAAI, pp. 5470–5477, 2020.
|
| 245 |
+
|
| 246 |
+
Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter W. Battaglia. Learning to simulate complex physics with graph networks. CoRR, abs/2002.09405, 2020. URL https://arxiv.org/abs/2002.09405.
|
| 247 |
+
|
| 248 |
+
Adam Santoro, David Raposo, David G. T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter W. Battaglia, and Tim Lillicrap. A simple neural network module for relational reasoning. pp. 4967– 4976, 2017.
|
| 249 |
+
|
| 250 |
+
Marco Scutari. Learning bayesian networks with the bnlearn r package. Journal of Statistical Software, Articles, 35(3):1–22, 2010. ISSN 1548-7660.
|
| 251 |
+
|
| 252 |
+
Bing Shuai, Zhen Zuo, Bing Wang, and Gang Wang. Dag-recurrent neural networks for scene labeling. In Proc. of Conference on Computer Vision and Pattern Recognition, CVPR, pp. 3620– 3629, 2016.
|
| 253 |
+
|
| 254 |
+
Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Proc. Advances in Neural Information Processing, NIPS, pp. 1257–1264, 2005.
|
| 255 |
+
|
| 256 |
+
Richard Socher, Cliff Chiung-Yu Lin, Andrew Y. $\mathrm { N g }$ , and Christopher D. Manning. Parsing natural scenes and natural language with recursive neural networks. In Proc. of International Conference on Machine Learning, ICML, pp. 129–136, 2011.
|
| 257 |
+
|
| 258 |
+
Richard Socher, Brody Huval, Christopher D. Manning, and Andrew Y. Ng. Semantic compositionality through recursive matrix-vector spaces. In Proc. of Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, EMNLPCoNLL, pp. 1201–1211, 2012.
|
| 259 |
+
|
| 260 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proc. of Conference on Empirical Methods in Natural Language Processing, EMNLP, pp. 1631–1642, 2013.
|
| 261 |
+
|
| 262 |
+
Kai Sheng Tai, Richard Socher, and Christopher D. Manning. Improved semantic representations from tree-structured long short-term memory networks. In Proc. of Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL, pp. 1556– 1566, 2015.
|
| 263 |
+
|
| 264 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. Proc. of International Conference on Learning Representations, ICLR, 2018.
|
| 265 |
+
|
| 266 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In Proc. of International Conference on Learning Representations, ICLR, 2019.
|
| 267 |
+
|
| 268 |
+
Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In Proc. of International Conference on Learning Representations, ICLR, 2020.
|
| 269 |
+
|
| 270 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L. Hamilton, and Jure Leskovec. Graphrnn: Generating realistic graphs with deep auto-regressive models. In Jennifer G. Dy and Andreas Krause (eds.), Proc. of International Conference on Machine Learning, ICML, volume 80 of Proceedings of Machine Learning Research, pp. 5694–5703. PMLR, 2018.
|
| 271 |
+
|
| 272 |
+
Muhan Zhang, Shali Jiang, Zhicheng Cui, Roman Garnett, and Yixin Chen. D-VAE: A variational autoencoder for directed acyclic graphs. In Proc. of Annual Conference on Neural Information Processing Systems, NeurIPS, pp. 1586–1598, 2019.
|
| 273 |
+
|
| 274 |
+
Xingxing Zhang, Liang Lu, and Mirella Lapata. Top-down tree long short-term memory networks. In Kevin Knight, Ani Nenkova, and Owen Rambow (eds.), Proc. of Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT, pp. 310–320, 2016.
|
| 275 |
+
|
| 276 |
+
Xiao-Dan Zhu, Parinaz Sobhani, and Hongyu Guo. Long short-term memory over recursive structures. In Proc. of International Conference on Machine Learning, ICML, volume 37 of JMLR Workshop and Conference Proceedings, pp. 1604–1612. JMLR.org, 2015.
|
| 277 |
+
|
| 278 |
+
Marinka Zitnik, Monica Agrawal, and Jure Leskovec. Modeling polypharmacy side effects with graph convolutional networks. Bioinform., 34(13):i457–i466, 2018.
|
| 279 |
+
|
| 280 |
+
# A PROOFS
|
| 281 |
+
|
| 282 |
+
Proof of Theorem $^ { l }$ . Let $( v _ { 1 } , v _ { 2 } , \ldots , v _ { d } )$ be a longest path of the DAG. The number of batches must be at least $d$ , because otherwise there exists a batch that contains at least two nodes on this path, violating Property (ii). On the other hand, given the partitioning, according to Property (iii), one may trace a directed path, one node from each batch, starting from the last one. The longest path must be at least that long. In other words, the number of batches must be at most the number of nodes on the longest path. Hence, these two numbers are equal. The consequence stated by the theorem straightforwardly follows. □
|
| 283 |
+
|
| 284 |
+
Proof of Theorem 2. We first show that $h _ { v } ^ { \ell }$ is invairant to the indexing of $v$ by double induction on $\ell$ and $v$ . The base case is $\ell = 1$ and $v \in B _ { 0 }$ . In this case, $m _ { v } ^ { 1 } = G ^ { 1 } \overline { { { ( \emptyset , h _ { v } ^ { 0 } ) } } } \doteq 0$ is invairant to the indexing of $v$ . Then, $h _ { v } ^ { 1 } = F ^ { 1 } ( h _ { v } ^ { 0 } , m _ { v } ^ { 1 } )$ is, too. In the induction, if for all $\ell ^ { \prime } < \ell$ and all $v ^ { \prime }$ , and for $\ell ^ { \prime } = \ell$ and $v ^ { \prime } \in B _ { 0 } \cup \dots \cup B _ { i - 1 }$ , $h _ { v ^ { \prime } } ^ { \ell ^ { \prime } }$ is invairant to the indexing of $v ^ { \prime }$ , then for $\ell ^ { \prime } = \ell$ and $v \in B _ { i }$ , $m _ { v } ^ { \ell } = G ^ { \ell } ( \{ h _ { u } ^ { \ell } \ | \ u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } )$ and $h _ { v } ^ { \ell } = F ^ { \ell } ( h _ { v } ^ { \ell } , m _ { v } ^ { \ell } )$ are both invairant to the indexing of $v$ . Thus, by induction, for all $\ell ^ { \prime } = \ell$ and all $v$ , $h _ { v } ^ { \ell ^ { \prime } }$ is invairant to the indexing of $v$ . Then, by an outer induction, for all $\ell$ and all $v$ , $h _ { v } ^ { \ell }$ is invairant to the indexing of $v$ .
|
| 285 |
+
|
| 286 |
+
Therefore, $h _ { \mathcal { G } } = R ( \{ h _ { v } ^ { \ell } , \ell = 0 , 1 , \ldots , L , v \in \mathcal { T } \} .$ ) is invairant to the indexing of the nodes in $\tau$ and thus of the entire node set. □
|
| 287 |
+
|
| 288 |
+
Proof of Corollary $^ 3$ . The function $G ^ { \ell }$ is invariant to node indexing because it is a weighted sum of the elements in its first argument, $\{ h _ { u } ^ { \ell } \}$ , whereas the weights are parameterized by using the same parameter $w _ { 2 } ^ { \ell }$ for these elements.
|
| 289 |
+
|
| 290 |
+
The function $F ^ { \ell }$ is invariant to node indexing because its two arguments are clearly distinguished.
|
| 291 |
+
|
| 292 |
+
The function $R$ is invariant to node indexing because the FC layer applies to the pooling result of $h _ { v } ^ { \ell }$ for a fixed set of $v$ . □
|
| 293 |
+
|
| 294 |
+
Proof of Theorem 4. Suppose two graphs $\mathcal { G }$ and $\mathcal { G } ^ { \prime }$ have the same representation $h _ { \mathcal { G } } = h _ { \mathcal { G } ^ { \prime } }$ . Then, from the function $R$ , they must have the same target set $\tau$ and same node representations $h _ { v } ^ { \ell }$ for all nodes $v \in \mathcal T$ and all layers $\ell$ . In particular, for the last layer $\ell = L$ , from the functions $F ^ { L }$ and $G ^ { L }$ , each of these nodes, $v$ , from the two graphs must have the same set of direct predecessors $\mathcal { P } ( v )$ , each element $u$ of which have the same representation $h _ { u } ^ { L }$ across graphs. By backward induction, the two graphs must have the same node set $\nu$ and edge set $\mathcal { E }$ . Moreover, for each node $v \in \mathcal V$ , the last-layer representation $h _ { v } ^ { L }$ must be the same.
|
| 295 |
+
|
| 296 |
+
Furthermore, from the injection property of $F ^ { \ell }$ , if a node $v$ shares the same node representation $h _ { v } ^ { \ell }$ across graphs, then its past-layer representation $h _ { v } ^ { \ell - 1 }$ must also be the same across graphs. A backward reduction traces back to the initial representation $h _ { v } ^ { 0 }$ , which concludes that the two graphs must have the same set of input node features $\mathcal { X }$ . □
|
| 297 |
+
|
| 298 |
+
# B DATASET DETAILS
|
| 299 |
+
|
| 300 |
+
OGBG-CODE. The OGBG-CODE dataset was recently included in the Open Graph Benchmark (OGB) (Hu et al., 2020, Section 6.3). It contains 452,741 Python method definitions extracted from thousands of popular Github repositories. The method definitions are represented as DAGs by augmenting the abstract syntax trees with edges connecting the sequence of source code tokens. Hence, there are two types of edges. The min/avg/max numbers of nodes in the graphs are 11/125/36123, respectively. We use the node features provided by the dataset, including node type, attributes, depth in the AST, and pre-order traversal index.
|
| 301 |
+
|
| 302 |
+
The task suggested by Hu et al. (2020) is to predict the sub-tokens forming the method name, also known as “code summarization”. The task is considered a proxy measure of how well a model captures the code semantics (Allamanis et al., 2018). We additionally consider the task of predicting the length of the longest path in the graph. We treat it as a 275-way classification because the maximum length is 275. The distribution of the lengths/classes is shown in Appendix E. To avoid triviality, for this task we remove the AST depth from the node feature set.
|
| 303 |
+
|
| 304 |
+
We adopt OGB’s project split, whose training set consists of Github projects not seen in the validation and test sets. We also experiment with a subset of the data, OGBG-CODE-15, which contains only randomly chosen $15 \%$ of the OGBG-CODE training data. Validation and test sets remain the same.
|
| 305 |
+
|
| 306 |
+
In addition to OGBG-CODE, we further experiment with two DAG datasets, NA and BN, used by Zhang et al. (2019) for evaluating their model D-VAE. To compare with the results reported in the referenced work, we focus on the predictive performance of the latent representations of the DAGs obtained from autoencoders. We adopt the given 90/10 splits.
|
| 307 |
+
|
| 308 |
+
Neural architectures (NA). This dataset is created in the context of neural architecture search. It contains 19,020 neural architectures generated from the ENAS software (Pham et al., 2018). Each neural architecture has 6 layers (i.e., nodes) sampled from 6 different types of components, plus an input and output layer. The input node vectors are one-hot encodings of the component types. The weight-sharing accuracy (Pham et al., 2018) (a proxy of the true accuracy) on CIFAR-10 (Krizhevsky, 2009) is taken as performance measure. Details about the generation process can be found in Zhang et al. (2019, Appendix H).
|
| 309 |
+
|
| 310 |
+
Bayesian networks (BN). This dataset contains 200,000 random 8-node Bayesian networks generated by using the R package bnlearn (Scutari, 2010). The Bayesian Information Criterion (BIC) score is used to measure how well the DAG structure fits the Asia dataset (Lauritzen & Spiegelhalter, 1988). The input node vectors are one-hot encodings of the node indices according to topological sort. See Zhang et al. (2019, Appendix I) for further details.
|
| 311 |
+
|
| 312 |
+
# C BASELINE DETAILS
|
| 313 |
+
|
| 314 |
+
Baselines for OGBG-CODE. We use three basic measures to set up baseline performance, two for token prediction and one for the longest path task. (1) Node2Token: This method uses the attribute of the second node of the graph as prediction. We observe that the second node either contains the function name, if the token occurs in the vocabulary (which is not always the case because some function names consist of multiple words), or contains “None”. (2) TargetInGraph: This method pretends that it knows the ground-truth tokens but predicts only those occurring in the graph. One would expect that a learning model may be able to outperform this method if it learns the associations of tokens outside the current graph. (3) MajorityInValid: This method always predicts the majority length seen in the validation set.
|
| 315 |
+
|
| 316 |
+
Additionally, we compare with multiple GNN models. Some of them are the GNN implementations offered by OGB: GCN, GIN, GCN-VN, and GIN-VN. The latter two are extensions of the first two by including a virtual node (i.e., an additional node that is connected to all nodes in the graph). Note that the implementations do not strictly follow the architectures described in the original papers (Kipf & Welling, 2017; Xu et al., 2019). In particular, edge types are incorporated and inverse edges are added for bidirectional message passing.
|
| 317 |
+
|
| 318 |
+
Since our model features attention mechanisms, we include GAT (Velickovi ˇ c et al., 2018) and ´ GGNN (Li et al., 2016) for comparison. We also include two representative hierarchical pooling approaches, which use attention to determine node pooling: SAGPool (Lee et al., 2019) and ASAP (Ranjan et al., 2020). Lastly, we compare with the encoder of D-VAE (Zhang et al., 2019, Appendix E, F).
|
| 319 |
+
|
| 320 |
+
Baselines for NA and BN. Over NA and BN, we consider D-VAE and the baselines in Zhang et al. (2019, Appendix J). S-VAE (Bowman et al., 2016) applies a standard GRU-based RNN variational autoencoder to the topologically sorted node sequence, with node features augmented by the information of incoming edges, and decodes the graph by generating an adjacency matrix. GraphRNN (You et al., 2018) by itself serves as a decoder; we pair it with S-VAE encoder. GCN uses a GCN encoder while takes the decoder of D-VAE. DeepGMG (Li et al., 2018) similarly uses a GNN-based encoder but employs its own decoder (which is similar to the one in D-VAE). Note that all these baselines are autoencoders and our objective is to compare the performance of the latent representations.
|
| 321 |
+
|
| 322 |
+
# D MODEL CONFIGURATIONS AND TRAINING
|
| 323 |
+
|
| 324 |
+
D.1 EXPERIMENT PROTOCOL AND HYPERPARAMETER TUNING
|
| 325 |
+
|
| 326 |
+
Our evaluation protocols and procedures closely follow those of Hu et al. (2020); Zhang et al. (2019). For OGBG-CODE, we only changed the following. We used 5-fold cross validation due to the size of the dataset and the number of baselines for comparison. Since we compared with vast kinds of models in addition to the OGB baselines, we swept over a large range of learning rates and, for each model, picked the best from the set {1e-4, 5e-4, 1e-3, 15e-4, 2e-3, 5e-3, 1e-2, 15e-3} based on performance on OGBG-CODE-15. We stopped training when the validation metric did not improve further under a patience of 20 epochs, for all models but D-VAE and DAGNN. For the latter two, we used a patience of 10. Moreover, for these two models we used gradient clipping (at 0.25) due to the recurrent layers and a batch size of 80. Note that OGB uses 10-fold cross validation with a fixed learning rate of 1e-3, a fixed epoch number 30, and a batch size 128.
|
| 327 |
+
|
| 328 |
+
For NA and BN, we followed the exact training settings of Zhang et al. (2019, Appendix K). For DAGNN, we started the learning rate scheduler at 1e-3 (instead of 1e-4) and stopped at a maximum number of epochs, 100 for NA and 50 for BN (instead of 300 and 100, respectively). We also trained a sparse Gaussian process (SGP) (Snelson & Ghahramani, 2005) as the predictive model, as described in Zhang et al. (2019, Appendix L), to evaluate the performance of the latent representations. The prediction results were averaged over 10 folds.
|
| 329 |
+
|
| 330 |
+
For the Bayesian network learning experiment we similarly took over the settings of Zhang et al.
|
| 331 |
+
(2019), running ten rounds of Bayesian optimization.
|
| 332 |
+
|
| 333 |
+
# D.2 BASELINE MODELS
|
| 334 |
+
|
| 335 |
+
All models were implemented in PyTorch (Paszke et al., 2019). For OGBG-CODE, we used the GCN and GIN models provided by the benchmark. We implemented a GAT model as described in Velickovi ˇ c et al. (2018) and GG-NN in Li et al. (2016). We used the SAGPool implementation of Lee ´ et al. (2019) and ASAP from the Pytorch Geometric Benchmark Suite https://github.com/ rusty1s/pytorch_geometric/tree/master/benchmark. All these models were implemented using PyTorch Geometric (Fey & Lenssen, 2019). We used the parameters suggested in OGB (e.g., 5 GNN layers, with embedding and hidden dimension 300), with the exception of ASAP where we used 3 instead of 5 layers due to memory constraints.
|
| 336 |
+
|
| 337 |
+
Since the D-VAE implementation does not support topological batching as we do, and also because of other miscellaneous restrictions (e.g., a single source node and target node), we reimplement D-VAE by using our DAGNN codebase. The reimplementation reproduces the results reported by Zhang et al. (2019). See Appendix F for more details.
|
| 338 |
+
|
| 339 |
+
# D.3 DAGNN IMPLEMENTATION
|
| 340 |
+
|
| 341 |
+
For DAGNN, we used hidden dimension 300. As suggested by OGB, we used independent linear classifiers to predict sub-tokens at each position of the sub-token sequence. Similarly, we used a linear classifier to predict the length of the longest path.
|
| 342 |
+
|
| 343 |
+
For the NA and BN datasets, we took the baseline implementations as well as training and evaluation procedures from Zhang et al. (2019). In particular, we used the corresponding configuration of DVAE for the BN dataset. For DAGNN, we used the same hidden dimension 501 and adapted the decoder of D-VAE (by replacing the use of D-VAE encoder in part of the decoding process with our encoder). Additionally, we used bidirectional processing for token prediction over OGBG-CODE and for the experiment over BN. Since it did not offer improvement in performance for the longest path length prediction and for the experiment over NA but consumed too much time, for these cases we used unidirectional processing.
|
| 344 |
+
|
| 345 |
+
# E DETAILS ON THE LONGEST PATH EXPERIMENT
|
| 346 |
+
|
| 347 |
+
We observe that for the MPNN baselines, the longest path results shown in Table 1 are much worse on the $15 \%$ subset than on the full dataset. We speculate whether the poorer performance is caused by purely the size of training data, or additionally by the discrepancy of data distributions. Figure 6 shows that the data distributions are rather similar. Hence, we conclude that the degrading performance of MPNNs on a smaller training set is due to their low sample efficiency, in contrast to DAG architectures (D-VAE and DAGNN) that perform similarly on both the full set and the subset.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 6: Distribution of the longest path lengths, for OGBG-CODE (left) and OGBG-CODE-15 (right). To improve readability, we ignored a tiny amount of graphs whose longest path length $> 3 0$ . There are 58 such graphs in OGBG-CODE and 21 in OGBG-CODE-15.
|
| 351 |
+
|
| 352 |
+
# F REIMPLEMENTATION OF D-VAE
|
| 353 |
+
|
| 354 |
+
The original D-VAE implementation processes nodes sequentially and thus is time consuming. Therefore, we reimplement D-VAE by using our DAGNN codebase, in particular supporting topological batching. Table 5 shows that our reimplementation reproduces closely the results obtained by the original D-VAE implementation.
|
| 355 |
+
|
| 356 |
+
Table 5: Predictive performance of latent DAG representations for NA and BN. Comparison of the original implementation and our reimplementation.
|
| 357 |
+
|
| 358 |
+
<table><tr><td></td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Model</td><td>RMSE</td><td>Pearson's r</td><td>RMSE</td><td>Pearson's r</td></tr><tr><td>D-VAE (orig)</td><td>0.375±0.003</td><td>0.924±0.001</td><td>0.281±0.004</td><td>0.964±0.001</td></tr><tr><td>D-VAE (ours)</td><td>0.375±0.004</td><td>0.925±0.001</td><td>0.219±0.003</td><td>0.977±0.000</td></tr></table>
|
| 359 |
+
|
| 360 |
+
# G ADDITIONAL ABLATION RESULTS
|
| 361 |
+
|
| 362 |
+
As mentioend in the main text, bidirectional processing is optional; it does not necessarily improve over unidirectional. Indeed, Table 6 shows that bidirectional works better on TOK-15 and BN, but unidirectional works better on LP-15 and NA. However, either way, DAGNN outperforms all baselines reported in Table 1 and 2, with only one exception: on LP-15, D-VAE performs worse than unidirectional but better than bidirectional.
|
| 363 |
+
|
| 364 |
+
Table 6: Bidirectional vs. unidirectional processing.
|
| 365 |
+
|
| 366 |
+
<table><tr><td></td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Bidirectional?</td><td>F1↑</td><td>Acc ↑</td><td>RMSE↓</td><td>Pearson's r↑</td><td>RMSE↓</td><td>Pearson's r 个</td></tr><tr><td>No</td><td>28.44±0.19</td><td>99.85±0.02</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.146±0.035</td><td>0.992±0.001</td></tr><tr><td>Yes</td><td>29.11±0.44</td><td>99.50±0.22</td><td>0.324±0.003</td><td>0.945±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr></table>
|
md/train/P7GUAXxS3ym/P7GUAXxS3ym.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Improving Coherence and Consistency in Neural Sequence Models with Dual-System, Neuro-Symbolic Reasoning
|
| 2 |
+
|
| 3 |
+
# Maxwell Nye∗ MIT
|
| 4 |
+
|
| 5 |
+
Joshua B. Tenenbaum MIT
|
| 6 |
+
|
| 7 |
+
Michael Henry Tessler MIT DeepMind
|
| 8 |
+
|
| 9 |
+
Brenden M. Lake NYU Facebook AI Research
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Human reasoning can be understood as an interplay between two systems: the intuitive and associative (“System 1”) and the deliberative and logical (“System 2”). Neural sequence models—which have been increasingly successful at performing complex, structured tasks—exhibit the advantages and failure modes of System 1: they are fast and learn patterns from data, but are often inconsistent and incoherent. In this work, we seek a lightweight, training-free means of improving existing System 1-like sequence models by adding System 2-inspired logical reasoning. We explore several variations on this theme in which candidate generations from a neural sequence model are examined for logical consistency by a symbolic reasoning module, which can either accept or reject the generations. Our approach uses neural inference to mediate between the neural System 1 and the logical System 2. Results in robust story generation and grounded instruction-following show that this approach can increase the coherence and accuracy of neurally-based generations.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Despite recent success, neural sequence models often fail to produce consistent and coherent generations. When generating stories, language models may forget the attributes of specific characters (such as personality and background information) (Welleck et al., 2018), ignore previously established relationships between characters (such as family relationships) (Sinha et al., 2019), or otherwise contradict prior statements (Brown et al., 2020). Similarly, neural models can make statements that contradict basic world knowledge or the logical entailment structure of known facts.
|
| 18 |
+
|
| 19 |
+
Lake & Murphy (2020) illustrated several of these issues with GPT-2 (Radford et al., 2019). When given prompts of the form “A dolphin is a ”, GPT-2 predicts that the most likely answer is “mammal”, “fish”, or “bird” depending on small differences in the wording of the prompt. In another example, GPT-2 states that unicorns have “four horns,” directly after implying that unicorns only have one horn. Upon diagnosing such issues, it is unclear how to apply a targeted fix to the model, especially if retraining or fine-tuning is impractical.
|
| 20 |
+
|
| 21 |
+
In this work, we draw on insights from cognitive science, especially from “dual process” theories of reasoning (Evans, 2003), to explore how neural sequence models can better interface with prior knowledge and be made more coherent and consistent. According to dual process theories, human cognition can be understood as an interplay between a more intuitive and associative “System 1” and a more deliberative and logical “System 2.” Within this broad framework, automatic actions are driven by System 1, whereas System 2 engages for more deliberative control: for example, judging the validity of a logical argument that requires multiple steps of reasoning (Kahneman, 2013).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Schematic of dual-system approach to text generation. Conditioned on previous text, a “System $1 ^ { \circ }$ neural generation model produces candidate next sentences. Semantic parses for each candidate are generated via few-shot parsing from GPT-3 and compared to a minimal world model to check consistency. Only candidates consistent with the world model state are incorporated into the final generation.
|
| 25 |
+
|
| 26 |
+
The prominent neural language models of today are single systems, with weaknesses akin to those exhibited by the human System 1. For example, the cognitive reflection test (CRT) (Frederick, 2005) is a classic probe of System 1 vs. System 2 reasoning in humans. Participants answer a set of simple questions that have superficially compelling, but logically invalid, answers. These incorrect answers are often generated as a first “gut” response (putatively, by System 1 intuitive thinking); upon reflection, however, participants often realize that their responses were not logically or mathematically consistent (via more explicit System 2 reasoning). Consider the CRT problem on the left below:
|
| 27 |
+
|
| 28 |
+
A ball and a bat cost $\$ 10$ . The bat costs one dollar more than the ball. How much does the ball cost?
|
| 29 |
+
|
| 30 |
+
<table><tr><td>Total cost in prompt</td><td>GPT-3 response</td></tr><tr><td>$1.10</td><td>10 cents</td></tr><tr><td>$1.20</td><td>20 cents</td></tr><tr><td>$1.30</td><td>$0.30</td></tr><tr><td>$1.70</td><td>$0.70</td></tr></table>
|
| 31 |
+
|
| 32 |
+
Reading quickly, you might be tempted to say the ball costs 10 cents. Most participants give this response, in fact, especially if they are under time pressure or have limited attention (Kahneman, 2013). Of course, if the bat is $\$ 1.00$ more than the ball, and the ball costs 10 cents, then the total cost would be $\$ 120$ . The correct answer is that the ball costs 5 cents. Notably, in this and other classic CRT problems, GPT-3 (Brown et al., 2020) predicts the same “gut” response (prediction in red above; the table above shows that adjusting the price in the prompt also leads to similar effects; see Appendix Figure 8 for more CRT examples). GPT-3 appears vulnerable to the same sort of intuitive, unsystematic pattern recognition errors as humans—in this case, incorrectly subtracting one dollar from $\$ 1.10$ , without confirming that the answer satisfies each of the problem constraints.
|
| 33 |
+
|
| 34 |
+
Numerous studies have shown that engagement of System 2-style effort can help “override or inhibit default responses emanating from System 1” (Evans, 2003), correcting inconsistent or un-systematic intuitive impulses. For example, when System 2 is engaged by asking people to take more time to respond, people’s accuracy improves on the CRT task above (Kahneman, 2013). It has been argued that integrating System 2 processing could similarly improve AI systems (Goyal & Bengio, 2020; Garcez & Lamb, 2020), and here we explore this idea as applied to neural sequence models.
|
| 35 |
+
|
| 36 |
+
In this work, we take inspiration from dual process theories to explore a neuro-symbolic generation system, wherein predictions from a neural model are treated as System 1 proposals, and a logical, deliberative System 2 filters these proposals for consistency and soundness (see Figure 1). We further take inspiration from the fact that humans often do not need explicit supervision to reason about new problems or domains (e.g., see human evaluation task in Section 4.2) and require that the System 2 module not need additional problem-specific training, especially on example contradictions or commonsense violations. People can handle novelty by reconfiguring, rather than retraining, their internal models (Lake et al., 2017), and we strive to build machine systems capable of the same. We show how a lightweight, easy-to-implement System 2 model can help improve coherence and consistency by adding a small amount of symbolic reasoning.
|
| 37 |
+
|
| 38 |
+
We tackle two kinds of domains: text generation and instruction following. In both cases, we construct generative models over sequences by using a neural generation model to propose candidate generations and a symbolic world model that can accept or reject the generations and resample proposals if necessary. We first illustrate the approach by generating short stories based on the bAbI dataset (Weston et al., 2015); this pedagogical, synthetic example illustrates how basic commonsense knowledge of objects, agents, and places can inform a text generation model. We then test our approach on rich, natural language vignettes based on CLUTRR (Sinha et al., 2019), focusing on ensuring consistency of family and interpersonal relationships. In both text generation domains, we interface between the explicit logical knowledge/reasoning of System 2 and generations of System 1 using a few-shot learning approach with state-of-the-art neural language models (GPT-3), which requires no additional training or fine-tuning. Even using off-the-shelf transformers and symbolic solvers, our dual-system model improves the consistency and coherence of text generations as measured by human judges. We test our approach also on instruction following, showing how goalprediction models and execution models can easily be combined to achieve improved performance in low-data regimes. We show improvements over previous work in the gSCAN grounded compositional challenge (Ruis et al., 2020); a dual-system model requires much less data to train than previous models, and achieves higher accuracy and stronger generalization. Overall, our findings indicate that neuro-symbolic, dual process models are a promising means of addressing longstanding problems of robustness and consistency in neural sequence models.
|
| 39 |
+
|
| 40 |
+
# 2 Related Work
|
| 41 |
+
|
| 42 |
+
Our approach incorporates semantic parsing (Liang, 2016) as a component of a generative process, where neural generation is used in conjunction with parsing techniques. In our text generation experiments, we employ GPT-3 to perform few-shot semantic parsing without fine-tuning. Related work includes few or zero-shot semantic parsing using pre-training techniques and paraphrasing (Su & Yan, 2017; Herzig & Berant, 2020). It also includes semantic parsing systems trained either without supervision (Liang et al., 2017; Mou et al., 2017; Muhlgay et al., 2019), or with synthetic language data (Marzoev et al., 2020; Xu et al., 2020b).
|
| 43 |
+
|
| 44 |
+
One popular technique for improving neural generations is generate-and-rerank, wherein one model generates proposals and another reranks them. This broad approach has been used in image generation (Ramesh et al., 2021), text generation (Holtzman et al., 2018; Shen et al., 2019; Deng et al., 2020), dialogue systems (for control, coherence and safety (Welleck et al., 2018; Smith et al., 2020; Nie et al., 2020; Xu et al., 2020a)), and instruction following (Kurita & Cho, 2020). Reranking is generally used to improve outputs with respect to relatively broad, holistic criteria. Here, our goal is to make generation robust to particular types of logical errors by pruning with respect to explicit symbolic constraints. Our approach can thus be considered closely related to techniques which employ explicit search to find generations satisfying particular logical constraints. Similar methods, such as guess-and-check or beam search pruning, have had success in neural program synthesis (Devlin et al., 2017; Nye et al., 2020).
|
| 45 |
+
|
| 46 |
+
Recent work in NLP has used template-based planning, in which a model generates text by first generating a plan or skeleton, and filling in the missing words to produce naturalistic text (Xu et al., 2018; Hua & Wang, 2020). To generate stories, Martin et al. (2018) parses previous sentences into events and does planning in event space. Our work extends previous entity/relation/event planning in that the world model is not used for planning, but rather for post-checking candidate generations. Structured parsing of this type is also related to dialog tracking techniques such as slot-filling (Pieraccini et al., 1992). In our work, fully compositional logical facts are extracted from utterances. It is therefore more closely related to systems which extract programs from dialogue, such as Andreas et al. (2020).
|
| 47 |
+
|
| 48 |
+
Recent work has also studied incorporating symbolic constraints into a neural decoding strategy in the context of natural language. Miao et al. (2019) introduce an MCMC-based inference-time propose-and-reject strategy for satisfying constraints. They test on constraints such as paraphrase and grammatical error correction. Lu et al. (2020) introduces “NeuroLogic decoding,” which uses logical constraints on neural language models to produce generations which contain (or do not contain) required (or forbidden) keywords. In these works, the constraints are lexical or based on word/sentence similarity (and provided in the problem setup for Lu et al. (2020)), whereas we study logical constraints on the world state decoded directly from observations or generations at test time. Other approaches for solving reasoning tasks end-to-end include Goyal et al. (2021), Serafini & d’Avila Garcez (2016), and Schlag & Schmidhuber (2018).
|
| 49 |
+
|
| 50 |
+
# 3 Integrating System 1 and System 2
|
| 51 |
+
|
| 52 |
+
We introduce our dual-system approach using examples from the bAbI domain (Weston et al., 2015), which we also use to perform diagnostic experiments. Consider generating a simple story involving people, places and objects, such as (from Figure 1):
|
| 53 |
+
|
| 54 |
+
Daniel went to the garden. Mary traveled to the office. Daniel grabbed the apple.
|
| 55 |
+
|
| 56 |
+
A model tasked with generating such stories must juggle several simultaneous demands: staying on topic and maintaining consistency of style and other textural elements (for which people rely on System 1), as well as maintaining consistency with previous statements and commonsense knowledge (for which people rely on both systems). Consider continuing the story with one of the following:
|
| 57 |
+
|
| 58 |
+
(a) Daniel went to the patio. (b) Mary dropped the apple there.
|
| 59 |
+
|
| 60 |
+
Sentence (a) is reasonable; sentence (b) is not because it is Daniel, not Mary, who has the apple. During generation, how might a model distinguish between these candidates? Perhaps a well-trained neural language model could track constraints of these sorts. Neural language models to date, however, often violate these types of commonsense, hard constraints without a large high-quality corpus or explicit training on detecting violations of commonsense (Sinha et al., 2019).
|
| 61 |
+
|
| 62 |
+
We address this problem by decomposing text generation into two parts: candidate generation facilitated by deep neural networks and a logical pruning process implemented via a separate symbolic module. Consider again the example above. To ensure consistency, our model would extract from the text the features of the world that are subject to the hard, logical constraints, such as the location of objects and who is holding them. These constraints can then be checked against an explicit representation of current state of the world. For sentences (a) and (b), the system would extract and go(Daniel, patio) and drop(Mary, apple), respectively. A minimal world model would track the state of the apple, such that it maintains apple.holder $=$ Daniel (or equivalently, Daniel.inventory $=$ [apple]). When such a model is given a parse of a candidate generation, drop(Mary, apple), the mismatch between the current state and the proposed change would cause a violation, and the candidate generation will be rejected.
|
| 63 |
+
|
| 64 |
+
The main steps of our general approach are illustrated in Figure 1: generate proposals from a System 1 proposal model, extract facts with a fact extraction model, and filter proposed generations by ensuring that they satisfy the constraints given by the extracted facts and the minimal world model.
|
| 65 |
+
|
| 66 |
+
System 1: Generation. We use neural sequence models to produce System 1 generations. In text generation domains, we use a large, pre-trained model that can be fine-tuned or conditioned via a short prompt to generate relevant text. Text sampled from the System 1 model will be treated as candidate utterances, which will be parsed and filtered by System 2 (described below). For the bAbI examples, we use GPT-3 as our System 1 proposal model through few-shot prompting with 10 example bAbI stories as context, generating a new story one candidate sentence at a time.
|
| 67 |
+
|
| 68 |
+
System 2: Fact extraction. A fact extractor, or parser, is used to mediate between the System 1 candidate proposals and the minimal world model within System 2. In our text generation domains, we use a pre-trained GPT-3 model without fine-tuning to perform parsing.
|
| 69 |
+
|
| 70 |
+
For bAbI, our prompt consist of an initial descriptive sentence “Please parse the following statements into commands. The available commands are pickup, drop, and go.” and a small set $( < 1 0 )$ of representative semantic parsing examples (input $=$ sentences; output $=$ correct parses, such as go(Bob, roof)). The parse of each utterance is produced via few-shot prompting (Brown et al., 2020): the utterance is added to the end of the prompt, and the subsequent GPT-3 generation is interpreted as the target parse. We found that this simple parsing technique works well and could easily be applied to other parsing-based tasks, as in Shin et al. (2021). The parsing prompts are reproduced in full in the Appendix. As discussed in Section 5, for the $\mathrm { g S C A N }$ instruction following domain, fact extraction is performed with a learned goal location prediction model.
|
| 71 |
+
|
| 72 |
+
System 2: Minimal world model. We use a lightweight, incomplete description of the state of the world as a world model in each domain, e.g., commonsense information about the people, objects and locations (Figure 1). The goal is not to track and verify all the possible information; instead, we aim for minimalism, capturing just a few commonsense (or application-critical) variables that we want to ensure are correct. The world model facilitates tracking of long-range logical dependencies and logical consequences, especially those which are not readily decodable from surface forms. The world model also lets us integrate rule-based world-knowledge without retraining (and without the need for a large set of labeled examples).
|
| 73 |
+
|
| 74 |
+
For the bAbI examples, the minimal world model keeps track of the people, locations and objects introduced in the story so far (Figure 1). This encodes constraints on possible actions related to human core knowledge competencies (objects, agents, places) present early in human development (Spelke & Kinzler, 2007); specifically, a person or object can only be in one place at a time, an object can only be possessed by a single person at a time, a person cannot “go” to a room they are already in, and a person cannot pick up an object if it is in a different room. See the Appendix for details.
|
| 75 |
+
|
| 76 |
+
Search. At generation time, the interaction between System 1 generation and System 2 parsing yields a neuro-symbolic, guess-and-check search strategy. In a text generation scenario, where text is sampled from the model, our dual-system model improves upon a naive, neural-only sampling method by using the System 2 model to reject candidate utterances which are incompatible with the current state. When a candidate is rejected, a new candidate utterance is sampled from the System 1 model, which is again checked by System 2. This process repeats until a candidate utterance is accepted by System 2 (i.e., the utterance is compatible with the world state). This procedure allows the model to effectively search the space of candidate utterances, guided by the logical constraints from the minimal world model. In this work, we use straightforward probabilistic sampling to illustrate that the approach works with even a very simple search mechanism. We imagine that the search procedure could be further optimized by applying, for example, beam search or stochastic beam sampling.
|
| 77 |
+
|
| 78 |
+
Diagnostic bAbI experiments. We use Task $\# 2$ from bAbI as a diagnostic test for our neuro-symbolic dual-system model. As shown above, this task consists of synthetically-generated short stories involving people, places and objects, and questions concerning the locations of objects in these stories. We investigate performance on both question answering (QA) tasks and story generation. For the QA tasks, we parse each sentence in the story to encode each fact into the world model and parse the final question to query the world model, returning the answer given by the world
|
| 79 |
+
|
| 80 |
+
GPT-3 only: John went to the bedroom.
|
| 81 |
+
John picked up the apple there.
|
| 82 |
+
Mary took the apple there.
|
| 83 |
+
Mary travelled to the office.
|
| 84 |
+
Daniel went back to the garden.
|
| 85 |
+
Mary went to the bedroom.
|
| 86 |
+
John went to the bedroom.
|
| 87 |
+
Sandra went to the bedroom.
|
| 88 |
+
Sandra travelled to the office.
|
| 89 |
+
Mary went back to the office.
|
| 90 |
+
Where is the apple? A: office GPT-3 $^ +$ world model: John went to the bedroom.
|
| 91 |
+
John picked up the apple there.
|
| 92 |
+
Mary travelled to the office.
|
| 93 |
+
Daniel went back to the garden.
|
| 94 |
+
Mary went to the bedroom.
|
| 95 |
+
Sandra went to the bedroom.
|
| 96 |
+
Sandra travelled to the office.
|
| 97 |
+
Mary went back to the office.
|
| 98 |
+
Where is the apple? A: bedroom
|
| 99 |
+
|
| 100 |
+
Figure 2: Example bAbI stories generated by GPT-3 only (left) and our dual-system model (right). Logically inconsistent lines are written in red text, and are removed from the story-so-far at generation time.
|
| 101 |
+
|
| 102 |
+
model. We compare with two alternative models (Table 3 in the Appendix): GPT-3 by itself and a dual-system baseline that uses a neural Natural Language Inference (NLI) model as its System 2. The NLI-based dual-system model generates 10 candidates from GPT-3 and selects the candidate with the highest predicted probability of entailment under the NLI model given the context. We use the RoBERTa MNLI model as our off-the-shelf neural NLI model (Liu et al., 2019), which operates as a System 2 that does not use additional problem-specific data or fine-tuning.2 On 200 held-out tasks, our GPT-3-based “fact extractor” achieves $100 \%$ QA accuracy, far exceeding the performance of GPT-3 alone $( 2 9 . 0 \% )$ or GPT-3 generation with neural NLI scoring $( 3 2 . 5 \%$ ; also see Table 3 in the Appendix). These results show that GPT-3 can be made to answer questions successfully when used for parsing with a world model, even when GPT-3 alone does not achieve high QA accuracy.
|
| 103 |
+
|
| 104 |
+
To test story generation, we use our GPT-3-based System 1 proposal model (few-shot prompted on 10 example stories) to sample a new bAbI story, line-by-line. If a generated utterance is inconsistent with the current state as indicated by the System 2 world model, a new utterance is sampled from System 1 (repeating until a consistent utterance is sampled). Figure 2 shows how the dual-system approach generates stories that mimic the statistical structure of bAbI stories, while remaining logically sound In contrast, GPT-3 alone was not able to maintain logical coherence. In a set of 50 generated stories, all stories required at least one sentence to be resampled to maintain coherence, and over half of the generated sentences $( 5 3 . 1 \% )$ were rejected by our System 2 model to maintain logical consistency. These results demonstrate that equipping GPT-3 with a minimal world model produces logically coherent stories that mimic the textural structure of the bAbI domain. In the next section, we apply this approach to mimicking human-generated short stories in natural language.
|
| 105 |
+
|
| 106 |
+
# 4 Coherent Language Generation - CLUTRR
|
| 107 |
+
|
| 108 |
+
We apply our dual-system approach to a dataset of natural language using the CLUTRR dataset. CLUTRR contains human-written stories about people and their family relationships (see example in Figure 3). As with bAbI, CLUTRR was originally designed as a Question Answering challenge; instead, we use it to evaluate coherent language generation by querying models to generate complete CLUTRR-style stories or to complete partially-generated stories. Our particular aim is to produce stories with coherent and logically consistent family relationships. As above, our language generation setup consists of pre-trained language models acting as our System 1 proposer, a minimal world model as System 2, and a neural semantic parser (implemented via few-shot GPT-3 prediction) as a bridge between the two systems. We use human judgments to assess whether our neuro-symbolic, dual-system model produces more consistent and coherent stories relative to a baseline.
|
| 109 |
+
|
| 110 |
+
# 4.1 Model specification
|
| 111 |
+
|
| 112 |
+
Kristin and her son Justin went to visit her mother Carol on a nice Sunday afternoon.They went out for a movie together and had a good time.
|
| 113 |
+
|
| 114 |
+
Q:How is Carol related to Justin ?
|
| 115 |
+
|
| 116 |
+
As our System 1 proposal model, we used pretrained neural models to produce candidate generations one sentence at a time. We experimented with GPT-3 as our System 1 model (which we used above for bAbI), but found generations too unreliable, often outputting the empty string. Instead, we used a BART model (Lewis et al., 2019) that was fine-tuned on the
|
| 117 |
+
|
| 118 |
+
CLUTRR training corpus. This model also gives us an opportunity to compare against a best-case neural “single-system” baseline, specifically fine-tuned on story data. To maintain a state of family relations, we use a constraint solver in our “System $2 ^ { \circ }$ to encode family relationships (e.g., child(x, ${ \tt y } )$ , spouse $\mathbf { \Psi } ( \mathbf { x } , \mathbf { \Psi } z ) ,$ ) and check that the candidate utterances do not contradict the previous statements (e.g., a person cannot be their own child or married to their sibling). We implemented the world model as a set of logical relations and constraints using the Z3 solver (De Moura & Bjørner, 2008). For instance, we require that the parent of $\mathtt { x }$ cannot also be the uncle of x: For all x, y, $\mathtt { u n c l e ( x , y ) } \Rightarrow \neg \mathtt { c h i l d ( y , x ) }$ . To check a candidate utterance, we query the solver to determine if the set of constraints is satisfiable or if there is a contradiction. The full set of constraints and other details can be found in the Appendix. We again used GPT-3 as our semantic parser, extracting parses for each candidate utterance via few-shot learning. This parsing approach worked well, even for the natural language in this domain. We observed that parsing with GPT-3 was more successful when the target parse was naturalistic, i.e., “Bob is Joe’s father.” rather than “father(Bob, Joe)”. The parsing prompt is reproduced in full in the Appendix.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Example trial from CLUTRR human judgement experiment. Participants were instructed to select which of two options makes the most sense given the prompt. One option was generated by the System 1 model only (“single-system”), while the other was generated by the dual-system model.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 3: Sample story from the CLUTRR dataset. Each story consists of a sequence of humangenerated sentences concerning family relationships. Adapted from Sinha et al. (2019).
|
| 125 |
+
Figure 5: CLUTRR human judgment experiment results. Bars denote proportions of dual-system generations selected as making more sense over single-system generations, in each of four conditions. Error-bars denote bootstrapped $9 5 \%$ confidence intervals of the item means. The points denote means for each individual item in the experiment and are jittered horizontally for clarity.
|
| 126 |
+
|
| 127 |
+
Table 1: Statistics from CLUTRR story generation. We report the percentage of generations (on both a per-line and per-story basis) for which the System 2 world model did not detect an error. The dual-system model is able to detect many inconsistencies in the neural single-system generations, and most can be corrected by re-sampling new candidates (up to a limit of ten).
|
| 128 |
+
|
| 129 |
+
<table><tr><td rowspan="2"></td><td colspan="2">% w/out error detected (per line)</td><td colspan="2">% w/out error detected (per story)</td></tr><tr><td>single-system (neural gen. only)</td><td>dual-system (neural gen.+world model)</td><td>single-system (neural gen. only)</td><td>dual-system (neural gen.+world model)</td></tr><tr><td>prompt from dataset</td><td>82.8</td><td>97.1</td><td>60</td><td>96.1</td></tr><tr><td>prompt from model</td><td>71.9</td><td>96.3</td><td>36.4</td><td>93.5</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 4.2 Human judgments
|
| 132 |
+
|
| 133 |
+
We test our dual-system neural generation $^ +$ world model method in its ability to generate stories that are deemed by naive human participants to be more naturalistic and coherent than those generated from the baseline models. Specifically, we asked participants to select which of two continuations made the most sense to them, where one continuation was generated from the neural model alone (single-system) and the other from a dual-system model (either the world model System 2 or the neural NLI System 2).
|
| 134 |
+
|
| 135 |
+
Participants. Participants $\mathbf { N } = 1 0 1$ ) were recruited on the crowd-sourcing platform Prolific and compensated $\$ 2$ for the task ( ${ \sim } 1 5$ minutes, so roughly $\$ 8/\mathrm{ h o u r }$ ). Participants gave informed consent, and the study was approved by MIT’s IRB. 21 participants were excluded for failing an instruction quiz, incorrectly answering more than one of five filler questions, or finishing the task too quickly. The data we collected contains no personally identifiable information or offensive content.
|
| 136 |
+
|
| 137 |
+
Procedure. Participants began the experiment by reading a set of instructions and answering comprehension questions. On each main trial, participants were shown a prompt consisting of several sentences and were asked to choose which of two possible continuations made the most sense (an example trial is shown in Figure 4). Participants were instructed that if a name appeared multiple times within a trial, then it referred to the same person, whereas if a name appeared across trials, then it was not referring to the same person. For each trial, one continuation option was generated by the neural only single-system baseline, while the other was a dual-system generation. We selected generations from the neural only baseline that were rejected by the System 2 model in order to maximize the differences between the models’ generations; thus, human judgments pertain to generations that the models disagreed on. Each participant performed between 20 and 26 trials.
|
| 138 |
+
|
| 139 |
+
Materials. Participants were randomly assigned to one of four between-participant conditions, which varied according to the kind of prompt and the kind of dual-system model. The prompt was either generated from the model (up to the point of disagreement between System 1 and System 2 models; “Prompts from model” condition) or taken completely from the length 4 CLUTRR systematic generalization test dataset (“Prompts from dataset” condition). To generate prompts for the “from model” condition, we took the first sentence of each story from the CLUTRR test dataset and generated subsequent prompt sentences from the dual-system model; sentences were generated until the two systems disagreed (i.e., System 1 generated a sentence that System 2 rejected), at which point the “rejected sentence” served as the neural only (single-system) baseline generation and the first resampled sentence that System 2 accepted served as the dual-system generation. Prompts were sampled to a maximum length of four sentences. The dual-system model shown to participants used a System 2 based on either our constraint-based “world model” or the neural NLI baseline.
|
| 140 |
+
|
| 141 |
+
Table 1 catalogs critical statistics from the stimulus generation process. We generated vignettes from the System 1 model and report the percentage of System 1 generations which are deemed correct by the System 2 model.3 We also report the percentage of generations corrected by the System 2 model (i.e., if System 1 made an error, could System 2 fix it within 10 attempts?). We report these statistics on both a per-story and per-line basis. According to System 2, the System 1 generation model makes a lot of errors (only $3 6 . 4 \%$ of stories and $7 1 . 9 \%$ of lines were error-free, in the “from model" condition). In most instances, re-sampling new generations yields stories that, according to
|
| 142 |
+
|
| 143 |
+
Table 2: Accuracy on $\mathrm { g } \mathrm { S C A N }$ splits. Models were trained on 5000 examples (only $2 . 5 \%$ of the gSCAN training data). See Appendix Table 4 for additional results.)
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Test split:</td><td>single-system5</td><td>dual-system</td></tr><tr><td>dev</td><td>71.7</td><td>83.3</td></tr><tr><td>random</td><td>57.2</td><td>74.7</td></tr><tr><td>yellow squares</td><td>68.1</td><td>81.3</td></tr><tr><td>red squares</td><td>64.9</td><td>78.1</td></tr><tr><td>novel direction</td><td>0.0</td><td>0.01</td></tr><tr><td>relativity</td><td>41.0</td><td>53.6</td></tr><tr><td>class inference</td><td>68.1</td><td>76.2</td></tr><tr><td>adverb (k=1)</td><td>0.0</td><td>0.0</td></tr><tr><td>adverb to verb</td><td>20.8</td><td>21.8</td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3">³From Heinze-Deml & Bouchacourt (2020)</td></tr></table>
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 6: Schematic of our dual-system approach to $\mathrm { g S C A N }$ . We train a neural sequence model to predict both a distribution over action sequences, and a distribution over target locations. At test time, we decode candidate action sequences from the model, execute them on the gridworld, and only accept a sequence that brings the agent to the predicted target location (shown in green).
|
| 149 |
+
|
| 150 |
+
System 2, no longer contain logical errors within a budget of 10 samples $9 3 . 5 \%$ of stories and $9 6 . 3 \%$ of lines were error-free, respectively).
|
| 151 |
+
|
| 152 |
+
Results. The human evaluation indicates that System 2 is indeed correcting genuine errors in the stories. As summarized in Figure 5, participants strongly preferred the dual-system neural generation $^ +$ world model continuations in comparison to the neural only single-system continuations (proportion preferring dual-system $= 0 . 8 4$ ; bootstrapped $9 5 \%$ confidence interval [0.77, 0.89] and 0.79 [0.77, 0.89] for the “from dataset” and “from model” prompt conditions, respectively). The dual-system approach, however, did not improve generation quality when the System 2 was based on an off-the-shelf neural NLI model (Proportion preferring dual-system $= 0 . 5 1$ ; [0.40, 0.64] for “from dataset”; 0.58 [0.48, 0.68] for “from model”). Thus, when using a minimal world model, the dual-system approach dramatically improves logical consistency without any need for additional training or fine-tuning. People clearly prefer neuro-symbolic generations from the dual-system model over purely neural generations from a single-system model.4
|
| 153 |
+
|
| 154 |
+
# 5 Grounded Instruction Following
|
| 155 |
+
|
| 156 |
+
The dual-system approach offers a general-purpose means of improving upon generative, neural sequence models by incorporating logical constraints. To highlight its generality, we examine how the dual-system perspective can be deployed in a very different domain: grounded instruction following. In Heinze-Deml & Bouchacourt (2020), a learned target location predictor was used to increase the accuracy of a neural action sequence generation model. Here, we show how to increase performance further by enforcing consistency between the target location predictor and the action sequence generator in our dual-system framework.
|
| 157 |
+
|
| 158 |
+
We use the gSCAN benchmark (Ruis et al., 2020), a recently proposed grounded instruction following dataset designed to measure compositional generalization in neural systems. Given an initial gridworld state and an instruction, e.g., “walk to the big square,” an agent must predict the sequence of low-level actions which achieve the goal, e.g., “TURN LEFT, WALK, TURN LEFT, WALK” (See Figure 6). The dataset contains several test splits, each testing different aspects of compositional generalization.
|
| 159 |
+
|
| 160 |
+
Our model builds on Heinze-Deml & Bouchacourt (2020) by using an LSTM to predict the correct action sequence and target location. Given a command $c$ and an initial gridworld state $s$ , the neural network defines two distributions: a distribution over action sequences $q _ { a } ( a | c , s )$ and a distribution over target grid locations $q _ { l o c } ( l | c , s )$ . Heinze-Deml & Bouchacourt (2020) showed that when these distributions share parameters, using location prediction as an auxiliary loss improves the accuracy of the action sequence prediction model. We can further exploit these two models by noticing that when a predicted action sequence is not consistent with a predicted target location, then either the action sequence or the target location must be incorrect. Since the target location is much simpler to predict, and thus much more likely to be correctly predicted, if a predicted action sequence is not consistent with the predicted target location, then the action sequence is most likely incorrect. Our dual-system framework can use this property to increase action sequence prediction accuracy. Consider the initial state and command in Figure 6. Our model predicts candidate action sequences, and also predicts that the most likely target location is the grid containing the bigger yellow square (highlighted in red). The model then executes the candidate action sequences, and only accepts a sequence which results in the agent standing in the target location.
|
| 161 |
+
|
| 162 |
+
In the language of our dual-system approach, we treat the distribution over actions $q _ { a } ( a | c , s )$ as our System 1 proposal model. The distribution over target locations $q _ { l o c } ( l | c , s )$ serves as a fact extractor model, which extract a location constraint $l$ . As a minimal world model, we use a deterministic gridworld execution model $T ( a , s _ { 0 } ) \to s _ { f }$ , which takes a state and action and predicts the resulting state. At test time, we first extract the predicted location as $l = \arg \operatorname* { m a x } _ { l ^ { \prime } } q _ { l o c } ( l ^ { \prime } | c )$ We then search through the possible action sequences from $q _ { a } ( \cdot | c )$ , conditioned on agreement with $l$ . In our experiments, we use a sample-based search with a maximum budget of 50 samples. We trained models on random subsets of the gSCAN training set of varying sizes: 5000 datapoints, 8000 datapoints, and 20000 datapoints $2 . 5 \%$ , $4 \%$ and $10 \%$ of the original training set, respectively).
|
| 163 |
+
|
| 164 |
+
Results. The results show that the System 2 execution model improves performance without the need for any additional training (see Table 2 for results training on 5000 examples). In contrast to the single-system model, the dual-system model allows for sampling many candidate action sequences from the neural network, accepting only consistent sequences. This guess-and-check approach greatly increases the evaluation accuracy, improving upon prior work on gSCAN, particularly in low-data regimes.
|
| 165 |
+
|
| 166 |
+
# 6 Limitations
|
| 167 |
+
|
| 168 |
+
In its current form, our approach is most useful in domains where naturalistic, learned generation is necessary and where a small number of mission-critical logical constraints can be explicitly articulated. Our system will be less useful when constraints are more difficult to articulate (e.g., creative domains such as writing poetry) or when there are many constraints, since the minimal world model must be hand-engineered. Enforcing strict constraints may also pose risks: if the constraints are not only logical but cultural, they may be harmful if misapplied. However, these constraints must be articulated explicitly in a symbolic model, and are thus easier to identify and correct.
|
| 169 |
+
|
| 170 |
+
The current few-shot parsing technique may also suffer from a limited capacity. For more complex domains, the number of examples required to specify the desired parsing behavior may be too large (i.e., they may not fit in the input window) or too complex for a model to perform parsing accurately. While some tasks may not be suitable, the complexity of the world model need not necessarily increase hand-in-hand with the complexity of the application domain. A dual-system model will be most successful when tracking just a few critical variables (e.g., tracking consistency in family relations, as in our experiments, or tracking scheduling constraints when discussing a team plan).
|
| 171 |
+
|
| 172 |
+
A promising direction for future work is to incorporate learning into the System 2 world model. Currently, the minimal world knowledge that exists in System 2 can be easily modified, but changes must be made by hand. Improvements would come from automatically learning and updating this structured knowledge, possibly by incorporating neuro-symbolic learning techniques (Ellis et al., 2020; Mao et al., 2019), or other neuro-symbolic integration work such as Tsamoura et al. (2021); Michael & Valiant (2008).
|
| 173 |
+
|
| 174 |
+
Learning could improve our dual-system approach in other ways, e.g., by training a neural module to mimic the actions of a symbolic System 2. The symbolic System 2 judgments could be used as a source of supervision; candidate utterances rejected by the symbolic System 2 model could be used as examples of contradictory sentences, and accepted utterances could be used as examples of noncontradictory statements. This oversight could help train a neural System 2 contradiction-detection model capable of more subtleties than its symbolic counterpart, especially in domains where labeled examples are otherwise unavailable. This approach may also help us understand aspects of human learning, where certain tasks that require slower, logical reasoning can be habitualized over time and tackled by faster, more intuitive reasoning.
|
| 175 |
+
|
| 176 |
+
Recent work (Li et al., 2021) has shown that large pre-trained neural models learn to approximately represent certain types of structured semantic information. However, it is not yet clear how representational fidelity translates to logical coherence during generative tasks. Our current approach allows us to explicitly fix logical errors in generation, which may ultimately be caused by representational errors. Understanding how we might leverage our approach to improve the representation of structured knowledge within neural models is a promising direction for future work, which could lead to increased generation consistency and coherence.
|
| 177 |
+
|
| 178 |
+
# 7 Conclusion
|
| 179 |
+
|
| 180 |
+
Inspired by dual process theories from cognitive science, we combine the respective strengths of neural and symbolic approaches to build more robust models that can more effectively incorporate domain knowledge. For language generation, we showed that equipping neural generation with a minimal symbolic world model increased language coherence and consistency. For grounded instruction following, we showed that requiring test-time consistency between predicted action sequences and goal locations led to improved performance, especially in low-data regimes. Our neuro-symbolic approach can readily be applied to other domains and types of prior knowledge, as a lightweight way of improving the coherence and consistency of powerful neural sequence models.
|
| 181 |
+
|
| 182 |
+
This paper just scratches the surface of how structured knowledge can make neural systems more robust; we hope to inspire further work into neuro-symbolic systems which possess the robustness and commonsense necessary for human-level intelligence.
|
| 183 |
+
|
| 184 |
+
# Acknowledgments
|
| 185 |
+
|
| 186 |
+
We thank Laura Ruis, Jacob Andreas, Yewen (Evan) Pu, Joe O’Connor and Guy Davidson for helpful comments on an earlier version of this manuscript. MN is supported by a NSF Graduate Research Fellowship.
|
| 187 |
+
|
| 188 |
+
# References
|
| 189 |
+
|
| 190 |
+
Andreas, J., Bufe, J., Burkett, D., Chen, C., Clausman, J., Crawford, J., Crim, K., DeLoach, J., Dorner, L., Eisner, J., et al. Task-oriented dialogue as dataflow synthesis. Transactions of the Association for Computational Linguistics, 8:556–571, 2020.
|
| 191 |
+
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 192 |
+
De Moura, L. and Bjørner, N. Z3: An efficient smt solver. In Tools and Algorithms for the Construction and Analysis of Systems, pp. 337–340. Springer, 2008.
|
| 193 |
+
Deng, Y., Bakhtin, A., Ott, M., Szlam, A., and Marc’Aurelio Ranzato. Residual energy-based models of text generation. In International Conference on Learning Representations (ICLR), pp. 1–18, 2020.
|
| 194 |
+
Devlin, J., Uesato, J., Bhupatiraju, S., Singh, R., Mohamed, A.-r., and Kohli, P. Robustfill: Neural program learning under noisy i/o. ICML, 2017.
|
| 195 |
+
Ellis, K., Wong, C., Nye, M., Sable-Meyer, M., Cary, L., Morales, L., Hewitt, L., Solar-Lezama, A., and Tenenbaum, J. B. Dreamcoder: Growing generalizable, interpretable knowledge with wake-sleep bayesian program learning. arXiv preprint arXiv:2006.08381, 2020.
|
| 196 |
+
Evans, J. S. B. In two minds: dual-process accounts of reasoning. Trends in cognitive sciences, 7(10): 454–459, 2003.
|
| 197 |
+
Frederick, S. Cognitive reflection and decision making. Journal of Economic perspectives, 19(4): 25–42, 2005.
|
| 198 |
+
Garcez, A. d. and Lamb, L. C. Neurosymbolic ai: The 3rd wave. arXiv preprint arXiv:2012.05876, 2020.
|
| 199 |
+
Goyal, A. and Bengio, Y. Inductive biases for deep learning of higher-level cognition. arXiv preprint arXiv:2011.15091, 2020.
|
| 200 |
+
Goyal, A., Didolkar, A., Ke, N. R., Blundell, C., Beaudoin, P., Heess, N., Mozer, M., and Bengio, Y. Neural production systems. CoRR, abs/2103.01937, 2021. URL https://arxiv.org/abs/ 2103.01937.
|
| 201 |
+
Heinze-Deml, C. and Bouchacourt, D. Think before you act: A simple baseline for compositional generalization. arXiv preprint arXiv:2009.13962, 2020.
|
| 202 |
+
Herzig, J. and Berant, J. Span-based semantic parsing for compositional generalization. arXiv preprint arXiv:2009.06040, 2020.
|
| 203 |
+
Holtzman, A., Buys, J., Forbes, M., Bosselut, A., Golub, D., and Choi, Y. Learning to write with cooperative discriminators. arXiv preprint arXiv:1805.06087, 2018.
|
| 204 |
+
Hua, X. and Wang, L. Pair: Planning and iterative refinement in pre-trained transformers for long text generation. In EMNLP, 2020.
|
| 205 |
+
Kahneman, D. Thinking, fast and slow. kindle ed, 2013.
|
| 206 |
+
Kurita, S. and Cho, K. Generative language-grounded policy in vision-and-language navigation with bayes’ rule. arXiv preprint arXiv:2009.07783, 2020.
|
| 207 |
+
Lake, B. M. and Murphy, G. L. Word meaning in minds and machines. arXiv preprint arXiv:2008.01766, 2020.
|
| 208 |
+
Lake, B. M., Ullman, T. D., Tenenbaum, J. B., and Gershman, S. J. Building machines that learn and think like people. Behavioral and Brain Sciences, 40:E253, 2017.
|
| 209 |
+
Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461, 2019.
|
| 210 |
+
Li, B. Z., Nye, M., and Andreas, J. Implicit representations of meaning in neural language models. arXiv preprint arXiv:2106.00737, 2021.
|
| 211 |
+
Liang, C., Berant, J., Le, Q. V., Forbus, K., and Lao, N. Neural symbolic machines: Learning semantic parsers on freebase with weak supervision. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 23–33, Vancouver, Canada, 2017. URL http://aclanthology.coli.uni-saarland.de/pdf/P/P17/P17-1003.pdf.
|
| 212 |
+
Liang, P. Learning executable semantic parsers for natural language understanding. Communications of the ACM, 59(9):68–76, 2016.
|
| 213 |
+
Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
|
| 214 |
+
Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 215 |
+
Lu, X., West, P., Zellers, R., Bras, R. L., Bhagavatula, C., and Choi, Y. Neurologic decoding:(un) supervised neural text generation with predicate logic constraints. arXiv preprint arXiv:2010.12884, 2020.
|
| 216 |
+
Mao, J., Gan, C., Kohli, P., Tenenbaum, J. B., and Wu, J. The neuro-symbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. arXiv preprint arXiv:1904.12584, 2019.
|
| 217 |
+
Martin, L. J., Ammanabrolu, P., Hancock, W., Singh, S., Harrison, B., and Riedl, M. O. Event representations for automated story generation with deep neural nets. In AAAI, 2018.
|
| 218 |
+
Marzoev, A., Madden, S., Kaashoek, M. F., Cafarella, M., and Andreas, J. Unnatural language processing: Bridging the gap between synthetic and natural language data. arXiv preprint arXiv:2004.13645, 2020.
|
| 219 |
+
Miao, N., Zhou, H., Mou, L., Yan, R., and Li, L. Cgmh: Constrained sentence generation by metropolis-hastings sampling. In AAAI, 2019.
|
| 220 |
+
Michael, L. and Valiant, L. G. A first experimental demonstration of massive knowledge infusion. 2008.
|
| 221 |
+
Mou, L., Lu, Z., Li, H., and Jin, Z. Coupling distributed and symbolic execution for natural language queries. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2518–2526. PMLR, 06–11 Aug 2017. URL http://proceedings.mlr.press/v70/mou17a.html.
|
| 222 |
+
Muhlgay, D., Herzig, J., and Berant, J. Value-based search in execution space for mapping instructions to programs. pp. 1942–1954, 01 2019. doi: 10.18653/v1/N19-1193.
|
| 223 |
+
Nie, Y., Williamson, M., Bansal, M., Kiela, D., and Weston, J. I like fish, especially dolphins: Addressing contradictions in dialogue modelling. arXiv preprint arXiv:2012.13391, 2020.
|
| 224 |
+
Nye, M. I., Solar-Lezama, A., Tenenbaum, J. B., and Lake, B. M. Learning compositional rules via neural program synthesis. arXiv preprint arXiv:2003.05562, 2020.
|
| 225 |
+
Pieraccini, R., Tzoukermann, E., Gorelov, Z., Gauvain, J.-L., Levin, E., Lee, C.-H., and Wilpon, J. A speech understanding system based on statistical representation of semantics. In [Proceedings] ICASSP-92: 1992 IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 1, pp. 193–196 vol.1, 1992. doi: 10.1109/ICASSP.1992.225939.
|
| 226 |
+
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 227 |
+
Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Radford, A., Chen, M., and Sutskever, I. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 228 |
+
Ruis, L., Andreas, J., Baroni, M., Bouchacourt, D., and Lake, B. M. A benchmark for systematic generalization in grounded language understanding. arXiv preprint arXiv:2003.05161, 2020.
|
| 229 |
+
Schlag, I. and Schmidhuber, J. Learning to reason with third-order tensor products. CoRR, abs/1811.12143, 2018. URL http://arxiv.org/abs/1811.12143.
|
| 230 |
+
Serafini, L. and d’Avila Garcez, A. S. Logic tensor networks: Deep learning and logical reasoning from data and knowledge. CoRR, abs/1606.04422, 2016. URL http://arxiv.org/abs/1606. 04422.
|
| 231 |
+
Shen, S., Fried, D., Andreas, J., and Klein, D. Pragmatically informative text generation. arXiv preprint arXiv:1904.01301, 2019.
|
| 232 |
+
Shin, R., Lin, C. H., Thomson, S., Chen, C., Roy, S., Platanios, E. A., Pauls, A., Klein, D., Eisner, J., and Van Durme, B. Constrained language models yield few-shot semantic parsers. arXiv preprint arXiv:2104.08768, 2021.
|
| 233 |
+
Sinha, K., Sodhani, S., Dong, J., Pineau, J., and Hamilton, W. L. Clutrr: A diagnostic benchmark for inductive reasoning from text. arXiv preprint arXiv:1908.06177, 2019.
|
| 234 |
+
Smith, E. M., Gonzalez-Rico, D., Dinan, E., and Boureau, Y.-L. Controlling style in generated dialogue. arXiv preprint arXiv:2009.10855, 2020.
|
| 235 |
+
Spelke, E. S. and Kinzler, K. D. Core knowledge. Developmental Science, 10(1):89–96, 2007.
|
| 236 |
+
Su, Y. and Yan, X. Cross-domain semantic parsing via paraphrasing. arXiv preprint arXiv:1704.05974, 2017.
|
| 237 |
+
Tsamoura, E., Hospedales, T., and Michael, L. Neural-symbolic integration: A compositional perspective. Proceedings of the AAAI Conference on Artificial Intelligence, 35(6):5051–5060, May 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/16639.
|
| 238 |
+
Welleck, S., Weston, J., Szlam, A., and Cho, K. Dialogue natural language inference. arXiv preprint arXiv:1811.00671, 2018.
|
| 239 |
+
Weston, J., Bordes, A., Chopra, S., Rush, A. M., van Merriënboer, B., Joulin, A., and Mikolov, T. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015.
|
| 240 |
+
Xu, J., Ren, X., Zhang, Y., Zeng, Q., Cai, X., and Sun, X. A skeleton-based model for promoting coherence among sentences in narrative story generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4306–4315, Brussels, Belgium, OctoberNovember 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1462. URL https://www.aclweb.org/anthology/D18-1462.
|
| 241 |
+
Xu, J., Ju, D., Li, M., Boureau, Y.-L., Weston, J., and Dinan, E. Recipes for safety in open-domain chatbots. arXiv preprint arXiv:2010.07079, 2020a.
|
| 242 |
+
Xu, S., Semnani, S. J., Campagna, G., and Lam, M. S. Autoqa: From databases to qa semantic parsers with only synthetic training data. arXiv preprint arXiv:2010.04806, 2020b.
|
md/train/SJgw51HFDr/SJgw51HFDr.md
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPARSE WEIGHT ACTIVATION TRAINING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Training convolutional neural networks (CNNs) is time consuming. Prior work has explored how to reduce the computational demands of training by eliminating gradients with relatively small magnitude. We show that eliminating small magnitude components has limited impact on the direction of high-dimensional vectors. However, in the context of training a CNN, we find that eliminating small magnitude components of weight and activation vectors allows us to train deeper networks on more complex datasets versus eliminating small magnitude components of gradients. We propose Sparse Weight Activation Training (SWAT), an algorithm that embodies these observations. SWAT reduces computations by $50 \%$ to $80 \%$ with better accuracy at a given level of sparsity versus the Dynamic Sparse Graph algorithm. SWAT also reduces memory footprint by $23 \%$ to $37 \%$ for activations and $50 \%$ to $80 \%$ for weights.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The usage of convolutional neural networks (CNNs) has dominated a wide variety of complex computer vision tasks, such as object recognition (Krizhevsky et al., 2012; Szegedy et al., 2015), object detection (Szegedy et al., 2013; Ren et al., 2015), and image restoration (Dong et al., 2014; Zhang et al., 2017). However, CNNs are compute and memory intensive; even a moderately sized CNN model, like ResNet-50 with tens of millions of parameters, requires billions of floating-point operations and consumes tens of gigabytes to store weights and activations during training.
|
| 12 |
+
|
| 13 |
+
Previous works propose techniques for reducing computations and memory consumption during CNN training. Such techniques include quantization where every operation is quantized in lowprecision during training such a (Zhou et al., 2016; Choi et al., 2018; Wu et al., 2016; Wang et al., 2018), or, use fixed-point integers instead of floating-point numbers (Wu et al., 2018; Das et al., 2018).
|
| 14 |
+
|
| 15 |
+
An orthogonal approach to reduce computations is sparsification, a process in which we eliminate computations involving small values. meProp (Sun et al., 2017; Wei et al., 2017) sparsifies backpropagating by selecting a subset of output gradients in each layer. Using only the top $5 \%$ of the gradients (ranked by magnitude), meProp can train a CNN and MLP on MNIST dataset without accuracy loss. The computational flow of meProp is shown in Figure 1a and 1b. meProp does not modify the forward pass. In the backward pass meProp performs a “Top-K” operation on the output activation gradients which sets components not ranked in the Top-K by magnitude to zero. It then uses the sparsified output activation gradients to (potentially more efficiently) compute the input activation and weight gradients. Our experiments suggest meProp fails to converge on larger networks and datasets.
|
| 16 |
+
|
| 17 |
+
Recently, Liu et al. (2019) proposed a method of reducing computation during training and inference by constructing a dynamic sparse graph (DSG) using random projection for dimensionality reduction. DSG loses accuracy on ImageNet dataset.
|
| 18 |
+
|
| 19 |
+
In this work, we propose an alternative technique, Sparse Weight Activation Training (SWAT), that can train deep CNNs on complex data sets like ImageNet. Compared to DSG, SWAT is a straightforward technique which uses less expensive Top-K operation, inspired by meProp, while achieving better accuracy than DSG on ImageNet.
|
| 20 |
+
|
| 21 |
+
This paper provides the following contributions:
|
| 22 |
+
|
| 23 |
+
• It shows that dropping gradients during back-propagation is harmful to network convergence especially when training a deeper model on a complex dataset. In this case the model suffers high accuracy loss.
|
| 24 |
+
• It proposes SWAT, a sparse training algorithm that can train a broad range of deep CNNs with minimal accuracy loss on complex datasets like CIFAR10, CIFAR100, and ImageNet. SWAT reduces the total number of operations during training by $50 \% - 8 0 \%$ . It also achieves $23 \% - 3 7 \%$ activation and $50 \% - 8 0 \%$ weight footprint reduction during the backward pass. SWAT algorithm uses sparse weight both in the forward and backward passes, and therefore model learns sparse weights, i.e., a pruned architecture; If the model has been trained using SWAT with $S \%$ sparsity during training, then during inference, weight can be pruned to $S \%$ without sacrificing any loss in accuracy.
|
| 25 |
+
• We perform empirical studies to provide insight into why ‘SWAT performs well; we showed that Top-K sparsification in general preserves direction in high-dimensional space.
|
| 26 |
+
|
| 27 |
+
# 2 SPARSITY INDUCED TRAINING
|
| 28 |
+
|
| 29 |
+
# 2.1 PRELIMINARIES
|
| 30 |
+
|
| 31 |
+
Let us consider a deep CNN with $\mathrm { L }$ convolutional layers trained using mini-batch stochastic gradient descent, where the $l ^ { t h }$ layer maps the input activation $\left( a _ { l - 1 } \right)$ using function $f _ { l }$ from $\large \mathbf { \large { R } } ^ { N \times C _ { l - 1 } \times H _ { l - 1 } \times W _ { l - 1 } } R ^ { N \times C _ { l } \times \large { H _ { l } \times W _ { l } } }$ . $f _ { l }$ computes $C _ { l }$ channel of output feature maps, each of dimension $R ^ { H _ { l } \times W _ { l } }$ , using $C _ { l - 1 }$ channels of input feature maps of dimension $R ^ { H _ { l - 1 } \times \hat { W } _ { l - 1 } }$ fo r each of the $N$ samples in the mini-batch. The ${ { l } ^ { t h } }$ layer has weights $w _ { l } \in R ^ { C _ { l } \times C _ { l - 1 } \times H _ { f } \times W _ { f } }$ . The forward pass of the $l ^ { t h }$ layer can be defined as:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
a _ { l } = f _ { l } ( a _ { l - 1 } , w _ { l } )
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
During back-propagation the ${ { l } ^ { t h } }$ layer receives the gradient of the loss $L$ w.r.t its output activation $( \bigtriangledown a _ { l } )$ . This is used to compute the gradient of the loss w.r.t its input activation $( \bigtriangledown a _ { l - 1 } )$ and weight $( \bigtriangledown _ { w _ { l } } )$ . Thus, the backward pass for the $l ^ { t h }$ layer can be defined as:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \nabla _ { a _ { l - 1 } } = F _ { l } ( \nabla _ { a _ { l } } , w _ { l } ) } \\ { \nabla _ { w _ { l } } = F _ { l } ( \nabla _ { a _ { l } } , a _ { l - 1 } ) } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: meProp versus SWAT (a) Shows the forward and backward pass of MeProp and SWAT for a fully connected layer. (b) Computational flow of meProp for any layer $l$ (c) Computational flow of SWAT for any layer $l$ .
|
| 45 |
+
|
| 46 |
+
# 2.2 SPARSE WEIGHT ACTIVATION TRAINING
|
| 47 |
+
|
| 48 |
+
Our goal is to reduce the computations required during the training process. SWAT does this by effectively transforming small magnitude components of vectors into zero values. Since multiplication of any number by zero results in zero the multiplication is not necessary. Such a sparsification process can be applied in a number of ways in the context of the backpropagation algorithm. Ideally, the modified training algorithm will retain both model accuracy and rate of convergence.
|
| 49 |
+
|
| 50 |
+
We explore the sensitivity to applying this sparsification process at different points. We look at the sensitivity of the model convergence to sparse input i.e. weight $( w _ { l } )$ and input activation $( a _ { l } )$ for forward pass and weights $( w _ { l } )$ , input activation $( a _ { l } )$ and output activation gradient $( \bigtriangledown a _ { l } )$ for the backward pass as shown in Equation 1 , 2 and 3.
|
| 51 |
+
|
| 52 |
+
Figure 2a shows the result of our analysis of sparsification in the forward pass. Here we train ResNet-18 on CIFAR-100 after modifying the forward pass to use sparse inputs in Equation 1 for weights $( w _ { l } )$ and separately activations $( a _ { l } )$ while keeping the backward pass unchanged (i.e., only the forward pass computation is sparse). The results show that network convergence is more tolerant to sparse weights $( w _ { l } )$ compared to sparse activations $( a _ { l } )$ . Thus, as shown in Figure 1a and 1c, SWAT uses sparse weights in the forward pass.
|
| 53 |
+
|
| 54 |
+
Figure 2b shows the result of our analysis of sparsification in the backward pass. We modify Equation 2 and Equation 3 to sparsify either output gradient $( \bigtriangledown a _ { l } )$ , as in meProp (see Figure 1b), or sparsify activations $( a _ { l } )$ and weights $( w _ { l } )$ . The results show accuracy is extremely sensitive to sparsification of output gradients. Such sparsity consistently results in networks converging to lower accuracy compared to using sparse activations and weights. Thus, as shown in Figure 1a and 1c, SWAT uses sparse weights and activations in the backward pass. The overall SWAT training algorithm is presented in Algorithm 1.
|
| 55 |
+
|
| 56 |
+
SWAT uses sparse computation in both the forward and the backward passes, while meProp (Sun et al., 2017) uses sparse computation only in the backward pass. SWAT uses sparse weights and activations in the backward pass allowing compression of weights and activations in the forward pass1. Effectively, reducing overall memory access overhead of fetching weights in the backward pass and activation storage overhead because only Top- $K \%$ are saved. This memory benefit is not present for meProp since dense weights and activations are needed in the backward pass, whereas there is no storage benefit of sparsifying the output gradients since they are temporary values generated during back-propagation.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: Convergence Analysis: (a) Sensitivity Analysis of ResNet18 for the Forward Pass on the CIFAR100 dataset. (b) Sensitivity Analysis of ResNet18 for the Backward Pass on the CIFAR100 dataset. (c) Shows the training curve of ResNet18 on ImageNet for meProp and SAW algorithm. Learning rate is reduced by $\frac { 1 } { 1 0 } ^ { \mathit { \bar { t } h } }$ at $3 0 ^ { t h }$ and $4 0 ^ { t h }$ epoch.
|
| 60 |
+
|
| 61 |
+
To compare SWAT’s approach to that of meProp, we use a variant of SWAT that only sparsifies the backward pass; we shall refer to this version of SWAT as SAW (Sparse Activation and Weight back-propagation). We compare the performance of the meProp and SAW with deep networks, and complex datasets2. Figure 2c shows SAW and meProp convergence of ResNet18 with the ImageNet dataset; it compares the performance of meProp at $30 \%$ and $50 \%$ sparsity to SAW $80 \%$ sparsity. As we can see, meProp converges to a good solution at sparsity of $30 \%$ . However, at $50 \%$ sparsity, meProp suffers from overfitting and fails to generalize (between epochs 5 to 30), and at the same time, it is unable to reach an accuracy level above $45 \%$ . These results suggest that dropping output activation gradient $( \bigtriangledown a _ { l } )$ is generally harmful during back-propagation. On the other hand, SAW succeeds to converge to an accuracy of $64 \%$ even at a much higher sparsity of $80 \%$ .
|
| 62 |
+
|
| 63 |
+
Algorithm 1: Training an $L$ layer network using SWAT or SAW Algorithm
|
| 64 |
+
|
| 65 |
+
<table><tr><td colspan="3">The data: A mini-batch of inputs & targets (ao,a*), training iteration t, previous weights wt, learning rate n. The result: Update weights wt+1.</td></tr><tr><td colspan="3">Step 1.Forward Computation; end forl=1 toL do</td></tr><tr><td>if l==‘ConvolutionLayer' or‘LinearLayer' then</td><td></td><td>Step 2.Backward Computation;</td></tr><tr><td>if algorithm ==‘SWAT' then</td><td>aL</td><td>Compute the gradient of the output layer aloss(aL,a*). daL</td></tr><tr><td>at← forward(wt,at-1);</td><td>wt↑ frOPk(wt);</td><td>for l=L to 1 do</td></tr><tr><td>at-1fTOPK(at-1);</td><td></td><td>wt,al-1 ← save_for_backwardl;</td></tr><tr><td>else</td><td></td><td>Val-1 ← backward_input(Va,wt);</td></tr><tr><td></td><td></td><td>Vw-介</td></tr><tr><td></td><td>// algorithm == `SAW';</td><td>backward_weight(Va,at-1);</td></tr><tr><td>at ↔ forward(wt,at-1)</td><td></td><td></td></tr><tr><td>wt← frOPK(wt);</td><td>end</td><td></td></tr><tr><td>a-1←fTOPk(a-1);</td><td></td><td></td></tr><tr><td>end</td><td></td><td>Step 3.Parameter Update;</td></tr><tr><td>save_for_backwardl ← wt,al-1;</td><td></td><td>for l=1 to L do</td></tr><tr><td></td><td></td><td>wt+1 ← Optimizer(wt,Vw,n);</td></tr><tr><td>else</td><td></td><td></td></tr><tr><td></td><td>end</td><td></td></tr><tr><td>al ↑ forward(wt,al-1);</td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>save for_backwardl ← wt,al-1;</td><td></td><td></td></tr></table>
|
| 66 |
+
|
| 67 |
+
Top-K Selection: Given CNNs operate on tensors with many dimensions, there are several options for how to select which components are set to zero during sparsification. Our CNNs operate on fourth-order tensors, $T ~ \in ~ \hat { R } ^ { N \times C \times H \times W }$ . Below we evaluate three variants of the Top-K operation illustrated in the right side of Figure 3. We also compared against a null hypothesis in which randomly selected components of a tensor are set to zero.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Different ways of performing top- $\mathbf { \delta } \cdot \mathbf { k }$ operation. ‘N’ denotes the #samples in the minibatch or filters in the layer, ‘C’ denotes the #channels in the layer. $\mathbf { \hat { H } } ^ { \prime }$ and ‘W’ denote the height and width of the filter/activation map in the layer. Color represent the selected activations/weights by the Top-K operation.
|
| 71 |
+
|
| 72 |
+
The first variant, labeled TOPK-NCHW in Figure 3, selects activations and weights to set to zero by considering the entire mini-batch. This variant performs Top-K operation over the entire tensor, $\bar { f } _ { T O P K } ^ { \{ N , C , H , W \} } ( \bar { T } )$ , where the superscript represents the dimension along which the Top-K operation is performed. The second variant (TOPK-CHW) performs Top-K operation over the dimensions $C , H$ and W i.e., f {C,H,W }T OP K (T ) , i.e., selects K % of input activations from every mini-batch sample and $K \%$ of weights from every filter in the layer. The third variant (TOPK-HW) is the strictest form of
|
| 73 |
+
|
| 74 |
+
Top-K operation. It select $K \%$ of activations or weights from all channels, and thereby performing the Top-K operation over the dimension $H$ and $W$ , i.e., $f _ { T O P K } ^ { \{ H , W \} } ( T _ { H , W } )$ .
|
| 75 |
+
|
| 76 |
+
The left side of Figure 3 shows the accuracy achieved on ResNet-18 for CIFAR100 when using SAW configured with each of these Top-K variants along with a variant where a random subset of components is set to zero. The results show, first, that randomly selecting works only for low sparsity. At high sparsity all variants of Top- $\mathbf { \nabla } \cdot \mathbf { K }$ outperform random selection by a considerable margin. Second, they show that the more constrainted the Top-K operation the less accuracy achieved. Constraining Top-K results in selecting some activations or weights which are quite small. Similarly, some essential activations and weights are discarded just to satisfy the constraint.
|
| 77 |
+
|
| 78 |
+
# 3 RESULTS
|
| 79 |
+
|
| 80 |
+
In this section, we present our experimental results of SWAT algorithm on different architectures and datasets and we quantify the theoretical reduction in compute and memory bandwidth achievable using SWAT.
|
| 81 |
+
|
| 82 |
+
# 3.1 EXPERIMENTAL SETUP
|
| 83 |
+
|
| 84 |
+
We implement SWAT and SAW algorithms in PyTorch Framework (Paszke et al., 2017); models are trained on three different datasets: CIFAR10, CIFAR100 (Krizhevsky et al., 2009) and ImageNet ILSVRC2012 (Deng et al., 2009) and are evaluated on four different architectures ResNet18, 34, 50, 101 (He et al., 2016), Wide Residual Networks (Zagoruyko & Komodakis, 2016), DenseNet-BC-121 (Huang et al., 2017), and VGG-16 (Simonyan & Zisserman, 2014) with batchnormalization (Ioffe & Szegedy, 2015). Batch-Normalization statistics are computed using the running average (with momentum 0.9). We use SGD with momentum as our optimization algorithm with an initial learning rate of 0.1, momentum of 0.9 and weight decay $\lambda$ of 0.0001.
|
| 85 |
+
|
| 86 |
+
For CIFAR10 and CIFAR100 dataset, ResNet, VGG, and DenseNet models are trained for 150 epochs, and learning rate are reduced by $( 1 / 1 0 ) ^ { t h }$ at the 50-th and the 100-th epoch whereas WRN is trained for 200 epochs and the learning rate is annealed by a factor of $( 1 / 5 ) ^ { t h }$ at 60-th, 120-th and 160-th epoch. ResNet, VGG, and WRN are trained using a batch-size of 128 whereas DenseNet is trained with a batch-size of 64. We run each experiment with three different seeds and use the average value for all the plots.
|
| 87 |
+
|
| 88 |
+
For training on ImageNet dataset, we use $2 2 4 \times 2 2 4$ random crops from the input images or its horizontal flip and the input image is normalized by the per-color mean and standard deviation. Networks are trained for 50 epochs with the mini batch-size of 256 samples, and the learning rate are reduced by $( 1 / 1 0 ) ^ { t h }$ after 30-th and 40-th epoch.
|
| 89 |
+
|
| 90 |
+
# 3.2 ACCURACY ANALYSIS
|
| 91 |
+
|
| 92 |
+
In this section, we provide a comprehensive analysis of SWAT and SAW algorithms and show the influence of sparsity on validation accuracy; thereby showing the potential of reducing computation during training with negligible accuracy loss. We furthermore discuss the impact on rate of convergence and the robustness of the algorithm on a wide range of models with different depths and widths. Last, we provide an alternative to Top-K for efficient software/hardware implementation.
|
| 93 |
+
|
| 94 |
+
Accuracy on CIFAR10 and CIFAR100: Figure 4 shows the accuracy of the SWAT and SAW algorithms at different sparsity budgets on CIFAR10 and CIFAR100 dataset. From the graph, we can conclude that models can be trained using SWAT and SAW algorithm up to $6 0 \%$ sparsity with almost zero accuracy loss and suffer only a slight accuracy loss at $7 0 \%$ sparsity. For CIFAR10 dataset at $7 0 \%$ sparsity, VGG-16 and DenseNet-121 have an accuracy loss of around $0 . 5 7 \%$ for SWAT $( 0 . 2 6 \%$ for SAW) and $0 . 4 \%$ for SWAT $( 0 . 2 3 \%$ for SAW) whereas ResNet-18 gains an accuracy of $0 . 0 2 \%$ for SWAT ( $0 . 1 \%$ for SAW). For CIFAR100 dataset at $7 0 \%$ sparsity, ResNet-18, VGG-16 and DenseNetBC-121 lose an accuracy of around $0 . 5 \%$ , $0 . 4 1 \%$ and $0 . 6 8 \%$ for SAW and $0 . 4 \%$ , $0 . 9 9 \%$ and $1 . 7 8 \%$ for SWAT respectively. At $8 0 \%$ sparsity the accuracy loss on CIFAR10 and 100 is less than $1 . 8 \%$ for SAW and less than $2 . 5 \%$ for SWAT.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 4: Comprehensive analysis of sparsity vs accuracy trade-off: (a) Accuracy of SWAT and SAW algorithms on CIFAR10 dataset. (b) Accuracy of SWAT and SAW algorithms on CIFAR100 dataset. The dashed line represents the baseline accuracy for the corresponding model. Datapoints for SAW algorithm are represented as dots whereas for SWAT algorithm they are represented as stars.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 5: Trend of SWAT algorithm on ImageNet dataset: (a) Validation curve of SWAT algorithm (b) Validation Accuracy of SWAT, SAW and DSG algorithms at different sparsity constraints. Dotted line represents the baseline back-propagation algorithm. ‘RN18’ represent ResNet18, ‘DN121’ represent DenseNet-BC-121 and ‘DSG’ denote the results reported by the Dynamic Sparse Graph(Liu et al., 2019) algorithm.
|
| 101 |
+
|
| 102 |
+
Accuracy on ImageNet: Figure 5a shows the validation curve of the SWAT algorithm on ImageNet dataset for three different architectures and Figure 5b shows the accuracy obtained by the SWAT and SAW algorithms. The result shows that the SWAT and SAW algorithms lose negligible accuracy at $5 0 \%$ sparsity for all three architectures. The solution is within an accuracy loss of $0 . 2 6 - 1 . 0 1 \dot { \% }$ compared to the baseline solution. For high sparsity of $7 0 \%$ , ResNet-18, VGG-16 and DenseNet-BC-121 lose only around $1 . 5 2 \%$ , $1 . 6 \%$ and $2 . 2 6 \%$ accuracy for the SWAT and $1 . 4 2 \%$ , $1 . 2 8 \%$ and $1 . 8 2 \%$ for the SAW algorithm respectively. Both the algorithms perform better than the DSG algorithm proposed by (Liu et al., 2019), which accelerates training by performing dimensionality reduction search and performing the forward and backward passes in low dimensional space. The accuracy loss of DSG at $5 0 \%$ sparsity is around $2 . 8 3 \%$ for ResNet-18 and $1 . 5 4 \%$ for VGG-16 compared to the SWAT accuracy loss of $0 . 2 7 \%$ and $0 . 8 6 \%$ for ResNet-18 and VGG-16 respectively.
|
| 103 |
+
|
| 104 |
+
Impact on rate of Convergence: We define the rate of convergence is the number of epochs it takes to reach the saturation accuracy. Figure 5a shows the validation curve of SWAT algorithm when training ResNet-18, VGG-16 and DenseNet-BC-121 on ImageNet dataset. As shown in Figure, when the learning rate is 0.1 (i.e. between epoch 0 and 30) the SWAT algorithm reaches the saturation accuracy around the 15th epoch approximately the same epoch when the baseline algorithm also reaches saturation. Similarly, when the learning rate is 0.01 (i.e. between epoch 0-40th) both SWAT and the baseline saturate at epoch $3 5 \mathrm { t h }$ . The experiment at $5 0 \%$ and $7 0 \%$ sparsity shows that SWAT algorithm converges with slight accuracy loss but at the same rate compared to the baseline algorithm.
|
| 105 |
+
|
| 106 |
+
Influence of Depth and Width: Network depth (#layers) and width (#channels) are two important design criteria. Previous studies (Lu et al., 2017; Raghu et al., 2017; Sharir & Shashua, 2018) have found that both depth and width affect network expressivity. Increasing network depth helps in learning complex abstraction, whereas increasing width helps in learning more features. Ideally, we want SWAT and SAW algorithms to work with models of varying depth and width. Therefore, we study the influence of depth and width on the SWAT and SAW algorithms. Figure 6a shows the accuracy of ResNet-50, ResNet-101 and WRN-28-10 on CIFAR100 datasets at four different sparsities $0 \%$ , $5 0 \%$ , $7 0 \%$ and $8 0 \%$ . The result for deeper networks shows that enforcing sparsity up to $7 0 \%$ is beneficial for training as the ResNet-50 and ResNet-100 converged to an accuracy higher than the baseline training. At $8 0 \%$ sparsity, ResNet-101 loses accuracy of a mere $0 . 1 8 \%$ whereas ResNet-50 still has an accuracy advantage of $0 . 1 9 \%$ over the baseline. WRN-28-10 lose accuracy on training with SWAT and SAW algorithm, but the accuracy loss is only $0 . 6 7 \%$ for SAW and $0 . 4 9 \%$ for SWAT at $7 0 \%$ sparsity.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 6: (a) Influence of Depth and Width: Accuracy of SAW and SWAT algorithms on CI FAR100 dataset for ResNet-50,101 and WRN-28-10 (b) Threshold value (K-th largest values) in Top-K operation of different layers during training
|
| 110 |
+
|
| 111 |
+
Efficient Top-K Implementation: Top- $K ^ { 3 }$ operation on 1 dimensional array of size $n$ can be naively implemented using sorting. The computational complexity of a naive Top- $\mathbf { \nabla } \cdot \mathbf { K }$ operation is $O ( n \log n )$ . The computational complexity can be reduced to $O ( n )$ , if the $\mathbf { k }$ -th largest element can be found in $O ( n )$ time, since for this case the Top-K operation can be implemented by a threshold operation. The K-th largest element can be computed in $O ( n )$ average time using quickselect (Hoare, 1961) or in $\theta ( n )$ time using BFPRT (Blum et al., 1973) or introselect (Musser, 1997). The computation can be further reduced since we found experimentally that for a given layer, the K-th largest elements is almost constant during training as shown in Figure 6b. So we don’t need to compute the K-th largest elements during every training iteration and can be computed once in a while after multiple iterations.
|
| 112 |
+
|
| 113 |
+
3.3 COMPUTATIONAL AND MEMORY OVERHEAD REDUCTION DURING TRAINING
|
| 114 |
+
|
| 115 |
+
In this section, we will quantify the reduction in computational and memory overhead, using SWAT, over the baseline training algorithm.
|
| 116 |
+
|
| 117 |
+
Computation Reduction: SWAT sparsifying the computation in During CNN training, most of the computation is in the convolution and fully connected layer, therefore sparsifying the computation in both of these layers can result in linear speed-up during training. Figure 7 shows the computational reduction possible by SWAT for three different architecture while training on ImageNet dataset. SWAT achieves a computation reduction of $2 \mathbf { x }$ , $3 . 3 \mathrm { x }$ , and $5 \mathbf { x }$ at $50 \%$ , $70 \%$ , and $80 \%$ sparsity respectively. Note that the overall overhead of implementing efficient Top-K operation using BFRT/introselect $^ +$ thresholding, as described in the pre
|
| 118 |
+
|
| 119 |
+
algorithm is accelerating CNN training by both the forward and the backward pass.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 7: Computational reduction in SWAT at different sparsity. “RN” denotes ResNet, “DN” denote DenseNet (Dataset: ImageNet)
|
| 123 |
+
|
| 124 |
+
vious section, is only $1 \%$ additional computation during training. Another benefit of using SWAT
|
| 125 |
+
|
| 126 |
+
is that the model learns a sparse architecture and therefore, sparse weights are used during Inference.
|
| 127 |
+
Thus, the same computational benefit of $2 { - } 5 \mathbf { x }$ is possible for Inference as well.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 8: Reduction in memory accesses during the backward pass. (a) Reduction in parameter access (b) Reduction in activation access per sample (Dataset: ImageNet)
|
| 131 |
+
|
| 132 |
+
Memory Overhead Reduction: During training, most of the weights and activations are stored in DRAM and accessing DRAM consumes three orders of magnitude more energy consumption than computation (Horowitz). So reducing the memory access during training will directly reduce the energy consumption. SWAT algorithm uses sparse input activation $\left( a _ { l - 1 } \right)$ and weight $( w _ { l - 1 } )$ in the backward, so input activation and weight can be compressed and stored in the memory in sparse format thereby reducing the DRAM access in the backward pass. Figure 8a shows the reduction of $2 \mathbf { x }$ , $3 . 3 \mathrm { x }$ , and ${ 5 } \mathbf { x }$ at sparsity of $50 \%$ , $70 \%$ and $80 \%$ in the parameters access in the backward pass. The other significant memory overhead is saving the activation, and this overhead is dependent not only on the model size but also on the batch-size used during training. Figure 8b shows the activation memory overhead for different architectures for a mini-batch size of 1. The graph only shows the activation of batch-normalization and convolutional layer since memory overhead for the activations of the linear layer is negligible compared to them. Note that SWAT algorithm sparsifies the computation of the linear, and convolutional layers, so full input activation of the batch-normalization layer are saved for the backward pass. Thus, SWAT algorithm achieves activation compression of around 1.3x, 1.5x, and $1 . 7 \mathbf { x }$ at sparsity of around $50 \%$ , $70 \%$ , and $80 \%$ . The activation of batch-normalization layer limits the overall activation compression.
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTAL ANALYSIS OF SWAT BEHAVIOUR
|
| 135 |
+
|
| 136 |
+
In this section, we will give some experimental evidence which explains why the SWAT algorithm is working so well in practice. The experiment shows the general behavior of vector sparsification in high dimensional space. Let us first define two new terminologies which we are going to use in this section: “Top-K sparsification” and “Sparsification Angle”4. Top-K sparsification of a vector $v$ selects $K \%$ of the highest magnitude component and set the rest of the component to zero. Sparsification angle is the angle between the original and the Top-K sparsified instance of that vector.
|
| 137 |
+
|
| 138 |
+
# 4.1 VECTOR SPARSIFICATION IN HIGH-DIMENSIONAL SPACE
|
| 139 |
+
|
| 140 |
+
A vector in high-dimensional space behaves differently from their low dimensional counterpart. It is well known that in high-dimension, two independent isotropic vectors tend to be orthogonal. Recently Anderson & Berg (2017) extended the analysis of the geometry of high-dimensional vectors to binary vectors. They proved that the angle between any random vector, drawn from a rotationally invariant distribution, and its binarized version would be concentrated around $3 7 ^ { \circ }$ . Thus, binarization of high dimensional vector approximately preserves their direction. We apply a similar kind of geometry analysis to high dimensional sparsified vectors. We show that sparsification indeed preserves direction in high-dimensional space, which is contrary to our low-dimensional intuition.
|
| 141 |
+
|
| 142 |
+
The first question we need to answer is how should we sparsify a vector $v ~ \in ~ R ^ { d }$ such that the sparsification angle is minimum between the original and the sparsified instance of the original vector (has only $K \%$ non-zero component). We found that the cosine angle is minimum when the $K \%$ non-zero component corresponds to the $K \%$ highest magnitude component, i.e., Top K sparsification. The proof is in the appendix.
|
| 143 |
+
|
| 144 |
+
We did an experiment for analyzing how Top K sparsification affect angle as shown in Figure 9a, Here we are showing the sparsification angle distribution for a 1000 dimensional vector drawn from standard normal distribution at different sparsity. The peak of sparsification angle at $9 0 \%$ sparsity is concentrated around $4 8 ^ { \circ }$ which is much less than peak of random vectors which is concentrated around $9 0 ^ { \circ }$ . Similarly, the peak up to $8 0 \%$ sparsity is concentrated at an angle of $3 6 . 4 ^ { \circ }$ only. This suggest that deviation caused by sparsification is indeed small in high-dimension.
|
| 145 |
+
|
| 146 |
+
For our next experiment shown in Figure 9b, we study how much a vector of a given dimension, drawn from standard normal distribution, can be maximally sparsified such that the sparsification angle is less than $\delta$ . We can see that the percentage of Top-K components needed for $\delta = \{ 2 0 ^ { \circ } , \bar { 3 } 0 ^ { \circ } , 4 0 ^ { \circ } \}$ is around only $4 3 \%$ , $2 9 \%$ and $1 8 \%$ respectively with a variance less than $3 \%$ as shown in Figure ${ 9 \mathrm { c } }$ . Thus, these experiment suggest that a high-dimensional vector can be sparsified up to $7 0 \%$ , which will lead a deviation $( \delta )$ of only $3 0 ^ { \circ }$ . All the above experimental results are dependent on the distribution from which random vectors are drawn, in Figure 9e, we calculate the sparsification angle during training ResNet18 on CIFAR100 dataset at $7 0 \%$ Sparsity. Here the sparsification angle for weight and activation is less than $3 6 ^ { \circ }$ for all the layer in the network. So the experiment suggests that the above analysis is applicable during training.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 9: Vector sparsification in high-dimension approximately preserves the direction:(a) Shows the sparsification angle distribution at different Top-K percentage for a 1000 dimensional vector in 10, 000 trials. Random represents the angle distribution between 2 random vectors. (b) and (c) Shows the percentage of Top-K components needed for sparsification angle to be within $\delta$ in 1000 trials and the variance in those trials. (d) Shows the relation between Top-K sparsification and the sparsification angle in 1000 trials. (e) Shows how the sparsification angle (at $7 0 \%$ sparsification) varies during training for ResNet-18 architecture on CIFAR100 dataset.
|
| 150 |
+
|
| 151 |
+
# 5 RELATED WORK
|
| 152 |
+
|
| 153 |
+
We can classify most of the previous studies which focus on accelerating training or inference in the following broad categories:
|
| 154 |
+
|
| 155 |
+
Pruning: Most of the pruning work focuses on inference optimization. Weight pruning can be classified into two broad categories of structured and unstructured pruning. The idea of unstructured pruning can be traced back to LeCun et al. (1990); Hassibi & Stork (1993), which prune the network using the saliency of parameters derived from the second-order information of loss function. Han et al. (2015b;a) pruned network parameters using a magnitude based method. There are several other unstructured pruning methods such as Molchanov et al. (2017); Louizos et al. (2017), but the drawback of all these methods is that it is difficult to extract parallelism on hardware. In contrast, structured pruning such as Liu et al. (2017); Li et al. (2016b); He et al. (2017); Luo et al. (2017); Wen et al. (2016); Molchanov et al. (2016) removes entire channels or filters at a time which preserves the inherent regular computation structure, and therefore it is easy to extract parallelism on hardware.
|
| 156 |
+
|
| 157 |
+
Quantization: Quantized networks can be used to accelerate both training and inference since energy consumption in the hardware is directly proportional to bit-width of the operands. There are many works which focus on quantizing weights for efficient inference such as McDonnell (2018); Wu et al. (2016); Zhu et al. (2016); Li et al. (2016a); Courbariaux et al. (2015) whereas much other work focuses on accelerating training as well, such as Banner et al. (2018); Choi et al. (2018); Wang et al. (2018); Lin et al. (2017a); Zhou et al. (2016); Courbariaux et al. (2016); Rastegari et al. (2016); Gupta et al. (2015). Some of the other work such as Zhao et al. (2019); McKinstry et al. (2018); Zhou et al. (2017); Mellempudi et al. (2017) shows that training from scratch is not necessary for finding the quantized model, but one can find a quantized model from pre-trained full precision models. Other work focuses on discrete training and inference using Integers such as Wu et al. (2018); Das et al. (2018); Jacob et al. (2018); Lin et al. (2016) since integer added/multiplier is more efficient than floating-point adder/multiplier. Few studies such as Louizos et al. (2019); Jung et al. (2019); Zhang et al. (2018); Zhou et al. (2018); Hou & Kwok (2018); Hou et al. (2016) formulate the quantization as an optimization problem to minimize the accuracy loss due to quantization. Few other work such as Yang et al. (2019); De Sa et al. (2018) focus on improving the learning algorithm by proposing novel stochastic averaging of the low precision iterates or using SVRG to reduce the variance and by dynamically adjusting the precision representation using bit centering. Few works instead of quantizing the entire model to a fixed bit-width focus on per tensor or parameter quantization such as Sakr & Shanbhag (2019); Khoram & Li (2018). Compared to all these works, our work is orthogonal as we eliminate the computation instead of reducing the computation precision.
|
| 158 |
+
|
| 159 |
+
Tensor Decomposition and Dimentionality Reduction: There are few works on compressing the models by performing tensor decomposition or by learning compact structure. Alvarez & Salzmann (2017) introduce a regularizer that promotes the parameter matrix to have a low rank. Thus the algorithm encourages the model to learn a compact structure by accounting for compression during the training itself. Novikov et al. (2015) showed that tensor decomposition could be used to compress a fully connected layer by using only a few parameters. Later, Garipov et al. (2016) extended it for the convolutional layer. The idea was to reshape the kernel into a tensor of higher-order and then to factorize it.
|
| 160 |
+
|
| 161 |
+
Distributed Training: There are few works (Stich et al., 2018; Lin et al., 2017b) which look at reducing the communication overhead in distributed training by transferring only sparse gradients during gradient aggregation step but these works are accumulating the rest of the gradients locally for subsequent iterations. Compared to all these works, our work objective is different as we are concerned with accelerating single node training, whereas their objective is minimizing communication during distributed training.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION
|
| 164 |
+
|
| 165 |
+
In this work, we propose SWAT, a robust training algorithm based on the insight that sparsifying weights and activation during training has little impact on convergence. SWAT sparsify both the forward and the backward passes, thereby eliminating lots of redundant computation such as addition and multiplication by zero. SWAT is a simpler technique and performs better than the recently proposed dimensionality reduction (DSG) technique for accelerating training. Our experiments over various benchmarks demonstrate significant computation reduction of up to $2 { - } 5 \mathbf { x }$ for training and inference and provides a memory footprint reduction of activation by $1 . 3 – 1 . 7 \mathrm { x }$ and reduction in memory access overhead for weight by $2 { - } 5 \mathbf { x }$ in the backward pass.
|
| 166 |
+
|
| 167 |
+
# REFERENCES
|
| 168 |
+
|
| 169 |
+
Jorge Albericio, Patrick Judd, Tayler Hetherington, Tor Aamodt, Natalie Enright Jerger, and Andreas Moshovos. Cnvlutin: Ineffectual-neuron-free deep neural network computing. ACM SIGARCH Computer Architecture News, 44(3):1–13, 2016.
|
| 170 |
+
|
| 171 |
+
Jose M Alvarez and Mathieu Salzmann. Compression-aware training of deep networks. In Advances in Neural Information Processing Systems, pp. 856–867, 2017.
|
| 172 |
+
|
| 173 |
+
Alexander G Anderson and Cory P Berg. The high-dimensional geometry of binary neural networks. arXiv preprint arXiv:1705.07199, 2017.
|
| 174 |
+
|
| 175 |
+
Ron Banner, Itay Hubara, Elad Hoffer, and Daniel Soudry. Scalable methods for 8-bit training of neural networks. In Advances in Neural Information Processing Systems, pp. 5145–5153, 2018.
|
| 176 |
+
|
| 177 |
+
Manuel Blum, Robert W. Floyd, Vaughan Pratt, Ronald L. Rivest, and Robert E. Tarjan. Time bounds for selection. Journal of Computer and System Sciences, 7(4):448 – 461, 1973. ISSN 0022-0000. doi: https://doi.org/10.1016/S0022-0000(73)80033-9. URL http://www. sciencedirect.com/science/article/pii/S0022000073800339.
|
| 178 |
+
|
| 179 |
+
Jungwook Choi, Pierce I-Jen Chuang, Zhuo Wang, Swagath Venkataramani, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Bridging the accuracy gap for 2-bit quantized neural networks (qnn). arXiv preprint arXiv:1807.06964, 2018.
|
| 180 |
+
|
| 181 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pp. 3123–3131, 2015.
|
| 182 |
+
|
| 183 |
+
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained $\mathrm { t o } + 1$ or-1. arXiv preprint arXiv:1602.02830, 2016.
|
| 184 |
+
|
| 185 |
+
Dipankar Das, Naveen Mellempudi, Dheevatsa Mudigere, Dhiraj Kalamkar, Sasikanth Avancha, Kunal Banerjee, Srinivas Sridharan, Karthik Vaidyanathan, Bharat Kaul, Evangelos Georganas, Alexander Heinecke, Pradeep Dubey, Jesus Corbal, Nikita Shustrov, Roma Dubtsov, Evarist Fomenko, and Vadim Pirogov. Mixed precision training of convolutional neural networks using integer operations. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $_ { \cdot } =$ H135uzZ0-.
|
| 186 |
+
|
| 187 |
+
Christopher De Sa, Megan Leszczynski, Jian Zhang, Alana Marzoev, Christopher R Aberger, Kunle Olukotun, and Christopher Re. High-accuracy low-precision training. ´ arXiv preprint arXiv:1803.03383, 2018.
|
| 188 |
+
|
| 189 |
+
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.
|
| 190 |
+
|
| 191 |
+
Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Learning a deep convolutional network for image super-resolution. In European conference on computer vision, pp. 184–199. Springer, 2014.
|
| 192 |
+
|
| 193 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 194 |
+
|
| 195 |
+
Timur Garipov, Dmitry Podoprikhin, Alexander Novikov, and Dmitry Vetrov. Ultimate tensorization: compressing convolutional and fc layers alike. arXiv preprint arXiv:1611.03214, 2016.
|
| 196 |
+
|
| 197 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pp. 1737–1746, 2015.
|
| 198 |
+
|
| 199 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a.
|
| 200 |
+
|
| 201 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pp. 1135–1143, 2015b.
|
| 202 |
+
|
| 203 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in neural information processing systems, pp. 164–171, 1993.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1389–1397, 2017.
|
| 208 |
+
|
| 209 |
+
C. A. R. Hoare. Algorithm 65: Find. Commun. ACM, 4(7):321–322, July 1961. ISSN 0001-0782. doi: 10.1145/366622.366647. URL http://doi.acm.org/10.1145/366622.366647.
|
| 210 |
+
|
| 211 |
+
Mark Horowitz. Energy table for $4 5 \mathrm { n m }$ process, Stanford VLSI wiki.
|
| 212 |
+
|
| 213 |
+
Lu Hou and James T. Kwok. Loss-aware weight quantization of deep networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=BkrSv0lA-.
|
| 214 |
+
|
| 215 |
+
Lu Hou, Quanming Yao, and James T Kwok. Loss-aware binarization of deep networks. arXiv preprint arXiv:1611.01600, 2016.
|
| 216 |
+
|
| 217 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700–4708, 2017.
|
| 218 |
+
|
| 219 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 220 |
+
|
| 221 |
+
Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2704–2713, 2018.
|
| 222 |
+
|
| 223 |
+
Sangil Jung, Changyong Son, Seohyung Lee, Jinwoo Son, Jae-Joon Han, Youngjun Kwak, Sung Ju Hwang, and Changkyu Choi. Learning to quantize deep networks by optimizing quantization intervals with task loss. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4350–4359, 2019.
|
| 224 |
+
|
| 225 |
+
Soroosh Khoram and Jing Li. Adaptive quantization of neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ SyOK1Sg0W.
|
| 226 |
+
|
| 227 |
+
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.
|
| 228 |
+
|
| 229 |
+
Alex Krizhevsky et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 230 |
+
|
| 231 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pp. 598–605, 1990.
|
| 232 |
+
|
| 233 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016a.
|
| 234 |
+
|
| 235 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016b.
|
| 236 |
+
|
| 237 |
+
Darryl Lin, Sachin Talathi, and Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. In International Conference on Machine Learning, pp. 2849–2858, 2016.
|
| 238 |
+
|
| 239 |
+
Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. In Advances in Neural Information Processing Systems, pp. 345–353, 2017a.
|
| 240 |
+
|
| 241 |
+
Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887, 2017b.
|
| 242 |
+
|
| 243 |
+
Liu Liu, Lei Deng, Xing Hu, Maohua Zhu, Guoqi Li, Yufei Ding, and Yuan Xie. Dynamic sparse graph for efficient deep learning. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ H1goBoR9F7.
|
| 244 |
+
|
| 245 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2736–2744, 2017.
|
| 246 |
+
|
| 247 |
+
Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through l 0 regularization. arXiv preprint arXiv:1712.01312, 2017.
|
| 248 |
+
|
| 249 |
+
Christos Louizos, Matthias Reisser, Tijmen Blankevoort, Efstratios Gavves, and Max Welling. Relaxed quantization for discretized neural networks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id ${ . } =$ HkxjYoCqKX.
|
| 250 |
+
|
| 251 |
+
Zhou Lu, Hongming Pu, Feicheng Wang, Zhiqiang Hu, and Liwei Wang. The expressive power of neural networks: A view from the width. In Advances in neural information processing systems, pp. 6231–6239, 2017.
|
| 252 |
+
|
| 253 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proceedings of the IEEE international conference on computer vision, pp. 5058–5066, 2017.
|
| 254 |
+
|
| 255 |
+
Mark D. McDonnell. Training wide residual networks for deployment using a single bit for each weight. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ rytNfI1AZ.
|
| 256 |
+
|
| 257 |
+
Jeffrey L McKinstry, Steven K Esser, Rathinakumar Appuswamy, Deepika Bablani, John V Arthur, Izzet B Yildiz, and Dharmendra S Modha. Discovering low-precision networks close to fullprecision networks for efficient embedded inference. arXiv preprint arXiv:1809.04191, 2018.
|
| 258 |
+
|
| 259 |
+
Naveen Mellempudi, Abhisek Kundu, Dheevatsa Mudigere, Dipankar Das, Bharat Kaul, and Pradeep Dubey. Ternary neural networks with fine-grained quantization. arXiv preprint arXiv:1705.01462, 2017.
|
| 260 |
+
|
| 261 |
+
Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2498–2507. JMLR. org, 2017.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
David R. Musser. Introspective sorting and selection algorithms. Software: Practice and Experience, 27(8):983–993, 1997. doi: 10.1002/(SICI)1097-024X(199708)27:8h983:: AID-SPE117i3.0.CO;2-\#. URL https://onlinelibrary.wiley.com/doi/ abs/10.1002/%28SICI%291097-024X%28199708%2927%3A8%3C983%3A% 3AAID-SPE117%3E3.0.CO%3B2-%23.
|
| 266 |
+
|
| 267 |
+
Alexander Novikov, Dmitrii Podoprikhin, Anton Osokin, and Dmitry P Vetrov. Tensorizing neural networks. In Advances in neural information processing systems, pp. 442–450, 2015.
|
| 268 |
+
|
| 269 |
+
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 2017 ACM/IEEE 44th Annual International Symposium on Computer Architecture (ISCA), pp. 27–40. IEEE, 2017.
|
| 270 |
+
|
| 271 |
+
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.
|
| 272 |
+
|
| 273 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl Dickstein. On the expressive power of deep neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2847–2854. JMLR. org, 2017.
|
| 274 |
+
|
| 275 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
|
| 276 |
+
|
| 277 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 91–99. Curran Associates, Inc., 2015.
|
| 278 |
+
|
| 279 |
+
Charbel Sakr and Naresh Shanbhag. Per-tensor fixed-point quantization of the back-propagation algorithm. In International Conference on Learning Representations, 2019. URL https:// openreview.net/forum?id $=$ rkxaNjA9Ym.
|
| 280 |
+
|
| 281 |
+
Or Sharir and Amnon Shashua. On the expressive power of overlapping architectures of deep learning. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ HkNGsseC-.
|
| 282 |
+
|
| 283 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 284 |
+
|
| 285 |
+
Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified sgd with memory. In Advances in Neural Information Processing Systems, pp. 4447–4458, 2018.
|
| 286 |
+
|
| 287 |
+
Xu Sun, Xuancheng Ren, Shuming Ma, and Houfeng Wang. meprop: Sparsified back propagation for accelerated deep learning with reduced overfitting. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3299–3308. JMLR. org, 2017.
|
| 288 |
+
|
| 289 |
+
Christian Szegedy, Alexander Toshev, and Dumitru Erhan. Deep neural networks for object detection. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 2553–2561. Curran Associates, Inc., 2013. URL http://papers.nips.cc/paper/ 5207-deep-neural-networks-for-object-detection.pdf.
|
| 290 |
+
|
| 291 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015.
|
| 292 |
+
|
| 293 |
+
Naigang Wang, Jungwook Choi, Daniel Brand, Chia-Yu Chen, and Kailash Gopalakrishnan. Training deep neural networks with 8-bit floating point numbers. In Advances in neural information processing systems, pp. 7675–7684, 2018.
|
| 294 |
+
|
| 295 |
+
Bingzhen Wei, Xu Sun, Xuancheng Ren, and Jingjing Xu. Minimal effort back propagation for convolutional neural networks. arXiv preprint arXiv:1709.05804, 2017.
|
| 296 |
+
|
| 297 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in neural information processing systems, pp. 2074–2082, 2016.
|
| 298 |
+
|
| 299 |
+
Jiaxiang Wu, Cong Leng, Yuhang Wang, Qinghao Hu, and Jian Cheng. Quantized convolutional neural networks for mobile devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4820–4828, 2016.
|
| 300 |
+
|
| 301 |
+
Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id=HJGXzmspb.
|
| 302 |
+
|
| 303 |
+
Guandao Yang, Tianyi Zhang, Polina Kirichenko, Junwen Bai, Andrew Gordon Wilson, and Chris De Sa. Swalp: Stochastic weight averaging in low precision training. In International Conference on Machine Learning, pp. 7015–7024, 2019.
|
| 304 |
+
|
| 305 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 306 |
+
|
| 307 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 365–382, 2018.
|
| 308 |
+
|
| 309 |
+
Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3929–3938, 2017.
|
| 310 |
+
|
| 311 |
+
Shijin Zhang, Zidong Du, Lei Zhang, Huiying Lan, Shaoli Liu, Ling Li, Qi Guo, Tianshi Chen, and Yunji Chen. Cambricon-x: An accelerator for sparse neural networks. In The 49th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 20. IEEE Press, 2016.
|
| 312 |
+
|
| 313 |
+
Ritchie Zhao, Yuwei Hu, Jordan Dotzel, Christopher De Sa, and Zhiru Zhang. Improving neural network quantization using outlier channel splitting. arXiv preprint arXiv:1901.09504, 2019.
|
| 314 |
+
|
| 315 |
+
Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017.
|
| 316 |
+
|
| 317 |
+
Aojun Zhou, Anbang Yao, Kuan Wang, and Yurong Chen. Explicit loss-error-aware quantization for low-bit deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9426–9435, 2018.
|
| 318 |
+
|
| 319 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 320 |
+
|
| 321 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 322 |
+
|
| 323 |
+
# APPENDIX A PROOF SHOWING TOP-K IS THE BEST SPARSIFICATION FUNCTION
|
| 324 |
+
|
| 325 |
+
Definition 1 Sparsifying Function $( f _ { S } )$ : Given a parameter $1 < k \leq d$ , let $f _ { S } \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } ^ { d } }$ be a function that selects $\mathbf { k }$ component of vector and sets the rest of the component to zero. For a vector $v \in \mathbb { R } ^ { d } , f _ { S } ( v ) = \mathbb { I } _ { k } ( \mathbf { v } ) \odot \bar { \mathbf { v } }$ , where $\mathbb { I } _ { k } ( \mathbf { v } )$ is an indicator vector having $\mathbf { k }$ non-zero values determined by input vector $v$ .
|
| 326 |
+
|
| 327 |
+
Definition 2 Top-K Sparsifying Function $( f _ { T O P K } )$ : Given a parameter $1 < k \leq d$ , let $f _ { T O P K }$ $: \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ is a special sparsifying function that sets all but the $\mathbf { k }$ highest component of input vector in absolute value to zero. More precisely, for a vector $v \in \mathbb { R } ^ { d }$ , $f _ { T O P K } ( v ) = \mathbb { I } _ { t o p k } ( \mathbf { v } ) \odot \mathbf { v }$ where $\mathbb { I } _ { t o p k }$ is an indicator function, $\mathbb { I } ( \bar { i } \in \{ \pi _ { 1 } , \cdot \cdot \cdot , \pi _ { k } \} )$ , and $\pi$ is a permutation of $[ d ]$ such that $| v | _ { \pi _ { i } } \geq | \bar { v } | _ { \pi _ { i + 1 } }$ for $i = 1 , \ldots , d - 1$ .
|
| 328 |
+
|
| 329 |
+
Definition 3 Sparsification Angle $\mathbf { \eta } ^ { ( \theta ) }$ : For a vector $v \in \mathbb { R } ^ { d }$ , the deviation in the direction caused by sparsification $f _ { S } ( . )$ is defined as the sparsification angle, i.e., it is the angle between the vector $v$ and sparse vector $f _ { S } ( v )$ .
|
| 330 |
+
|
| 331 |
+
Lemma A.1. For any vector $\boldsymbol { v } ~ \in ~ \mathbb { R } ^ { d }$ and of all the sparsifying function $f _ { S }$ , Top- $K$ sparsifying function $( f _ { T O P K } )$ causes the minimum deviation in direction i.e. minimum sparsification angle.
|
| 332 |
+
|
| 333 |
+
Proof. Given a parameter $k ~ \in ~ [ 1 , d ]$ , for a vector $\textbf { v } = \mathbf { \Omega } ( v _ { 1 } , \cdot \cdot \cdot , v _ { n } ) ^ { \mathrm { T } } ~ \in ~ \mathbb { R } ^ { d }$ let ${ \bf f } _ { \bf S } ( { \bf v } ) { \bf \rho } = { \bf \rho }$ $( m _ { 1 } \bar { v } _ { 1 } , \cdot \cdot \cdot , m _ { d } \bar { v _ { d } } ) ^ { \mathrm { T } } \in \mathbb R ^ { d }$ such that $\dot { m } _ { i } \in \{ 0 , 1 \} \ \forall i$ , be the Top-K indicator mask i.e., $m _ { i } = 1$ only if $i ^ { t h }$ component of $v$ is selected by the sparsifying function.
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\begin{array} { r } { \cos \langle f _ { S } ( \mathbf { v } ) , \mathbf { v } \rangle = \frac { f _ { S } ( \mathbf { v } ) \cdot \mathbf { v } } { \| f _ { S } ( \mathbf { v } ) \| \| \mathbf { v } \| } = \frac { \displaystyle \frac { \frac { d } { \sum } ( m _ { i } v _ { i } ^ { 2 } ) } { i = 1 } = } { \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } ( m _ { i } v _ { i } ) ^ { 2 } } \displaystyle \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } v _ { i } ^ { 2 } } } = \frac { \displaystyle \frac { \sum _ { i = 1 } ^ { d } ( m _ { i } v _ { i } ) ^ { 2 } } { i = 1 } } { \displaystyle \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } ( m _ { i } v _ { i } ) ^ { 2 } } \displaystyle \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } v _ { i } ^ { 2 } } } } \\ { = \frac { \displaystyle \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } ( m _ { i } v _ { i } ) ^ { 2 } } } { \displaystyle \sqrt { \displaystyle \sum _ { i = 1 } ^ { d } v _ { i } ^ { 2 } } } = \frac { \displaystyle \frac { \| f _ { S } ( \mathbf { v } ) \| } { \displaystyle \| \mathbf { v } \| } } { \displaystyle \| \mathbf { v } \| } } \end{array}
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
In other words,
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
{ \mathrm { S p a r s i f y i n g ~ A n g l e } } ( \theta ) = \operatorname { a r c c o s } { \frac { \| f _ { S } ( \mathbf { v } ) \| } { \| \mathbf { v } \| } }
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
arccos is a strictly decreasing function, so to minimize $\theta$ , $\| f _ { S } ( \mathbf { v } ) \|$ must be maximized. Therefore Top-K component of the vector $v$ magnitude wise should be selected. □
|
| 346 |
+
|
| 347 |
+
# APPENDIX B PERIODIC TOP-K & EFFECT OF BATCH-NORMALIZATION
|
| 348 |
+
|
| 349 |
+
Periodic Top-K For Efficient Implementation: In section 3.2, we have shown there is a little variation in the $^ { 6 } \mathrm { K }$ -th’ largest element during training, and it remains approximately constant as training proceed. Therefore, the Top-K does not need to be computed every iteration and can be periodically computed after some iterations. We define the number of iterations between computing the threshold for Top-K as the “Top-K period.
|
| 350 |
+
|
| 351 |
+
<table><tr><td rowspan=1 colspan=1>Top-K Period</td><td rowspan=1 colspan=1>70% Sparsity</td><td rowspan=1 colspan=1>90% Sparsity</td></tr><tr><td rowspan=1 colspan=1>Default Top-K</td><td rowspan=1 colspan=1>76.41</td><td rowspan=1 colspan=1>73.81</td></tr><tr><td rowspan=1 colspan=1>10 Iteration</td><td rowspan=1 colspan=1>76.59</td><td rowspan=1 colspan=1>73.64</td></tr><tr><td rowspan=1 colspan=1>20 Iteration</td><td rowspan=1 colspan=1>76.03</td><td rowspan=1 colspan=1>73.45</td></tr><tr><td rowspan=1 colspan=1>50 Iteration</td><td rowspan=1 colspan=1>76.06</td><td rowspan=1 colspan=1>74.09</td></tr><tr><td rowspan=1 colspan=1>100 Iteration</td><td rowspan=1 colspan=1>76.52</td><td rowspan=1 colspan=1>73.29</td></tr></table>
|
| 352 |
+
|
| 353 |
+
We have empirically confirmed that the periodic Top-K performs equally well as the default Top-K implementation. The table above shows top1 validation accuracy from single runs of ResNet-18 on CIFAR 100 with different Top-K periods (i.e., Top-K is computed after every 10, 25, 50, and 100 iterations respectively). This data suggests the converged accuracy is indeed not significantly impacted when employing our proposed Periodic Top K implementation.
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure 10: Sparsity Variation using Periodic Top-K Implementation. Network: ResNet-18, Dataset: CIFAR100, Top-K period: 100 iterations, Target Sparsity: $90 \%$
|
| 357 |
+
|
| 358 |
+
Since the periodic Top-K used the same threshold during the entire period, therefore, it is crucial to confirm that periodic Top-K implementation does not adversely affect the sparsity during training. We dumped the amount of sparsity obtained in weights and activation using periodic Top-K with period 100 iteration with target sparsity of $90 \%$ . Figure10 shows the sparsity during training using periodic Top-K implementation is concentrated around our targeted sparsity, and the fluctuation decreases as training proceeds confirming our hypothesis that chosen Top-K parameter stabilizes i.e. the Top-K threshold converge to a fixed value during the latter epochs.
|
| 359 |
+
|
| 360 |
+
The Top-K periods need not to be fixed throughout the training. The Top-K period can be increased as the training proceeds because the chosen Top-K parameters are unlikely to change at the later training iterations. To demonstrate this we perform a new experiment. We train ResNet-18 on CIFAR 100 for 150 epochs (learning rate decayed at epoch 50,100) using a version of SWAT which computes Top-K periodically but with increasing Top-K period for later epochs. The Top-K schedule used during training is shown below:
|
| 361 |
+
|
| 362 |
+
<table><tr><td rowspan=1 colspan=2>Scheduled Top-K</td><td rowspan=2 colspan=1>Top-KImplementation</td><td rowspan=1 colspan=2>Top-1 Accuracy</td></tr><tr><td rowspan=1 colspan=1>Epoch 0-50</td><td rowspan=1 colspan=1>3 times per epoch</td><td rowspan=1 colspan=1>70% Sparsity</td><td rowspan=1 colspan=1>90% Sparsity</td></tr><tr><td rowspan=1 colspan=1>Epoch 50-100</td><td rowspan=1 colspan=1>1 time per epoch</td><td rowspan=1 colspan=1>once per iteration</td><td rowspan=1 colspan=1>76.36</td><td rowspan=1 colspan=1>73.63</td></tr><tr><td rowspan=1 colspan=1>Epoch 100-150</td><td rowspan=1 colspan=1>1 time per 5 epoch</td><td rowspan=1 colspan=1>Scheduled Top-K</td><td rowspan=1 colspan=1>76.41</td><td rowspan=1 colspan=1>73.81</td></tr></table>
|
| 363 |
+
|
| 364 |
+
Note: 1 epoch has 392 iterations.
|
| 365 |
+
|
| 366 |
+
Sparsification of Batch-Normalization Layer: The activations and weights of BN layers are not sparsified in SWAT. Empirically, we found that sparsifying weights and activations are harmful to convergence. This is because the weight (gamma) of BN layers is a scaling factor for an entire output channel, therefore, making even a single BN weight (gamma) zero makes the entire output channel zero. Similarly, dropping activations affects the mean and variance computed by BN. Empirically we found that the BN layer is extremely sensitive to changes in the per channel mean and variance. For example, when ResNet18 is trained on CIFAR 100 using SWAT with $70 \%$ sparsity and we sparsify the BN layer activations, accuracy is degraded by $4 . 9 \%$ compared to training with SWAT without sparsifying the BN layers. Therefore, the activations of batch-normalization layer are not sparsified.
|
| 367 |
+
|
| 368 |
+
The parameters in a BN layer constitute less than $1 . 0 1 \%$ to the total parameters in the network and the total computation in the BN layer is less than $0 . 8 \%$ of the total computation in one forward and backward pass. Therefore, not sparsifying batch-normalization layers only affects the activation overhead in the backward pass.
|
| 369 |
+
|
| 370 |
+
Comparision with Lottery Ticket Hypothesis: The Lottery Ticket Hypothesis (Frankle & Carbin, 2018) showed the difficulty of training with a sparse architecture and that sparse training is very sensitive to initial conditions. The Lottery Ticket showed if one could pick the right initial conditions for the weights, one can train with a sparse network. SWAT is interesting in that it does train a sparse network without the need for oracle information about initialization values.
|
| 371 |
+
|
| 372 |
+
We believe the crucial difference that enables SWAT to work despite the observation in the Lottery Ticket Hypothesis paper is the following. SWAT updates which weights are part of the sparse network rather than attempting to train a single unchanging sparse network. SWAT may work because it dynamically searches for the sparse architecture that will work with a given set of initial conditions.
|
| 373 |
+
|
| 374 |
+
# APPENDIX C INDEXING OVERHEAD
|
| 375 |
+
|
| 376 |
+
To estimate the indexing overhead, we need to understand the generic architecture of the sparse CNN accelerator, the sparse format in which data is stored, and how the computations are mapped to the accelerator.
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
(a) Generic Architecture of Sparse CNN Accelerator
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
(b) Each PEs is responsible for creating a portion of the output (Parashar et al., 2017)
|
| 383 |
+
|
| 384 |
+
Sparse Accelerator: At a high-level of abstraction, all the sparse accelerators (Parashar et al., 2017; Zhang et al., 2016; Albericio et al., 2016) have a 2D array of processing units (PEs) where each processing unit has an array of multipliers and have a dedicated weight, activation, and accumulation buffer. They have an indexing unit for enabling the sparse multiplication. The computations are spatially mapped and scheduled to these processing units by a control and scheduling logic. Each of the PE generates partial products which get accumulated to compute the output values and finally stored in the DRAM.
|
| 385 |
+
|
| 386 |
+
Mapping Computations: Let us consider a convolutional layer, which maps the input activations in $\hat { ( R ^ { N \times C \times H _ { I } \times W _ { I } } ) }$ to out $( R ^ { N \times F \times H _ { O } \times W _ { O } } )$ . The layer computes $F$ channels of output feature maps, each of dimension $R ^ { H _ { O } \times W _ { O } }$ , using $C$ channel of input feature maps of dimension $R ^ { H _ { I } \times W _ { I } }$ for each of the $N$ samples in the mini-batch. The layer has parameter $w \in R ^ { F \times C \times H _ { K } \times W _ { K } }$ .
|
| 387 |
+
|
| 388 |
+
The data: w,in
|
| 389 |
+
The result: out
|
| 390 |
+
for $h _ { o } = I$ to $H _ { O }$ do for $w _ { o } = I$ to $W _ { O }$ do for $f = I$ to $F$ do for $c = l$ to $C$ do for $h _ { k } = I$ to $H _ { K }$ do for $w _ { k } = { \cal I }$ to $W _ { K }$ do c ∗ = c ; $h ^ { * } = h _ { o } + h _ { k }$ ; $\boldsymbol { w ^ { * } } = \boldsymbol { w _ { o } } + \boldsymbol { w _ { k } }$ ; $\mathbf { o u t } [ f ] [ h _ { o } ] [ w _ { o } ] + = \mathbf { w } [ f ] [ c ] [ h _ { k } ] [ w _ { k } ] \times \mathbf { i n } [ c ^ { * } ] [ h ^ { * } ] [ w ^ { * } ] ) ;$ end end end end end
|
| 391 |
+
end
|
| 392 |
+
|
| 393 |
+
Thus, as shown in algorithm 1, each activation is reused $F \times C \times H _ { K } \times W _ { K }$ times, each weight is reused $N \times C \times \times H _ { K } \times W _ { K }$ times and the total computation is as follow:
|
| 394 |
+
|
| 395 |
+
The first three ‘for’ loops are independent and can be mapped independently to the PEs, whereas the inner three ‘for’ loop generate the partial products. The different sparse accelerators have different ways of mapping the ‘for’ loops spatially over the PEs for maximizing reuse and minimizing the data transfer to and from the DRAM.
|
| 396 |
+
|
| 397 |
+
From now onwards, we are assuming the mapping of the algorithm over the PEs inspired by the SCNN architecture (Parashar et al., 2017). Each PEs is responsible for generating a chunk of output values, as shown in Figure 11b. The control unit is responsible for partitioning and transferring the corresponding input activations to each PE, whereas each PE has the entire sparse weights. Depending on the buffer size, either the entire index offset or only a block of index offset can be computed and distributed to the PEs.
|
| 398 |
+
|
| 399 |
+
Sparse Storage Format: In the forward pass, only weights are sparse. Each filter weights are independently stored in sparse format i.e. weights are sparsified along the dimension $R ^ { C \times { \breve { H _ { K } } } \times W _ { K } }$ . Figure 12a shows the storage of a single filter in a sparse format. The value is stored in 2 vectors; data vector and index vector. The data vectors contain only the non-zero data values, whereas the index vector contains the number of zero values before the corresponding data values.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
(a) Storage format for sparse weights
|
| 403 |
+
|
| 404 |
+
Storage Overhead for Index: Bits required for storing weights in dense format: (Assuming each weight value is stored in 32 bits)
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
D e n s e W e i g h t S t o r a g e = F \times C \times H \times W \times 3 2
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Let the weights have sparsity $S$ . The number of non-zero values present in the data vector is $( 1 - S ) \times$ $F \times C \times H \times W$ , and the number of zero values present in the data vector is $S \times F \times C \times H \times W$ . Assuming the sparsity is uniformly distributed, the number of zero values between 2 consecutive non-zero values is $\begin{array} { r } { \frac { \check { S } \times F \times C \times H \times \check { W } } { ( 1 - S ) \times F \times C \times H \times W } = \frac { S } { 1 - S } } \end{array}$ . Therefore, the number of bits used for encoding the index vector is $\mathit { m a x } ( \lceil \log _ { 2 } \frac { S } { 1 - S } \rceil , 1 )$ bits. Taking the maximum is required when the ratio is less than one. In this case 1 bit indicates whether the next value is zero or not. The bits required for storing weights in the sparse format:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
d a t a \ v e c t o r = ( 1 - S ) \times F \times C \times H \times W \times 3 2 \ b i t
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
i n d e x \ v e c t o r = ( 1 - S ) \times F \times C \times H \times W \times m a x ( \lceil { \log _ { 2 } \frac { S } { 1 - S } } \rceil , 1 )
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
S p a r s e W e i g h t S t o r a g e = ( 1 - S ) \times F \times C \times H \times W \times [ 3 2 + m a x ( \lceil \log _ { 2 } \frac { S } { 1 - S } \rceil , 1 ) ]
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
Therefore, storage is decreased by a factor of 32(1−S)×[32+max(dlog2 S1−S e,1)] . For 70% sparsity the reduction in storage space is $3 . 1 3 X$ .
|
| 425 |
+
|
| 426 |
+
Index Computation Overhead: The computation performed by each PE is shown in algorithm 1.
|
| 427 |
+
|
| 428 |
+
Algorithm 1: Sparse Forward Pass Computation for a input sample on P Ei(Assuming Stride=1)
|
| 429 |
+
|
| 430 |
+
The data: w, $P E _ { i }$ (in) The result: $P E _ { i }$ (out)
|
| 431 |
+
|
| 432 |
+
//STEP-1: Data-Structure Initialization Phase; $c [ F ] [ l e n ( \mathbf { i n d e x . v e c t o r } ) ] = 0 ;$ h[F ][len(index vector)] = 0; $w [ F ] [ l e n ( { \bf i n d e x . v e c t o r } ) ] = 0 $ ;
|
| 433 |
+
|
| 434 |
+
//STEP-2: Index Offset Calculation Phase;
|
| 435 |
+
for $f = I$ to $F$ do accumulated index $= 0$ ; for ind $= I$ :len(index vector) do accumulated index $; + =$ index vector[ind]; c[f ][ind], h[f ][ind], $w [ f ] [ i n d ] =$ computeIndex(accumulated index); end
|
| 436 |
+
end
|
| 437 |
+
//STEP-3: Computations Phase;
|
| 438 |
+
for $h _ { o } = I$ to $P \bar { E _ { i } } ( H _ { O } )$ do for $w _ { o } = I$ to $P E _ { i } ( W _ { O } )$ do for $f = I$ to $F$ do for ind = 1:len(index vector) do $c ^ { * } = c [ f ] [ i n d ]$ ; $h ^ { * } = h _ { o } + h [ f ] [ i n d ]$ ; $w ^ { * } = w _ { o } + w [ f ] [ i n d ]$ ; $\mathbf { o u t } [ f ] [ h _ { o } ] [ w _ { o } ] + = \mathbf { d a t a . v e c t o r } [ i n d ] \times { P E _ { i } ( \mathbf { i n } ) [ c ^ { * } ] [ h ^ { * } ] [ w ^ { * } ] } ;$ end end end
|
| 439 |
+
end
|
| 440 |
+
|
| 441 |
+
The indexing involved during the Computation Phase is just a base $^ +$ offset addition. The same kind of index computation is present in dense convolution(algorithm 1). Therefore, the only additional indexing computation is during the Indexing Offset Calculation Phase. Let the weights have sparsity $S$ .
|
| 442 |
+
|
| 443 |
+
where $\alpha$ is the overhead of the computeIndex function. computeIndex function is accumulating the current index and calculating the 3 offset $( c [ f ] [ i n d ] , h [ f ] [ i n \dot { d } ] , w [ f ] [ i n d ] )$ . Therefore, the value of $\alpha$ will be approximately around 4.
|
| 444 |
+
|
| 445 |
+
Therefore,
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
T o t a l ~ O p e r a t i o n ~ f o r ~ S p a r s e ~ C o n v o l u t i o n = S \times F \times C \times H _ { K } \times W _ { K } \times ( \alpha + H _ { O } \times W _ { O } )
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Since the $H _ { O } \times W _ { O } > > \alpha$ , the indexing overhead is minimal compared to the benefit obtained by performing sparse convolution.
|
| 452 |
+
|
| 453 |
+
Chip Area Consideration: Considering the chip area (#T ransistors available) is very critical when designing a custom accelerator since it decides the number of the computational units that can be fabricated on a given area. Generally, the number of transistors needed for a dense computation unit is less than that of the sparse computation unit. This is because of the extra chip area required for the indexing, arbitration, and controlling logic. Based on the area value mentioned in the SCNN paper(Parashar et al., 2017), the scaling factor for adjusting the performance of the sparse CNN accelerator is 0.75 i.e., On a given area, we can have almost $1 . 3 3 \times$ more dense computation units compared to sparse computation units.
|
| 454 |
+
|
| 455 |
+
Backward Pass: The computation in the backward pass is the deconvolution operation. Since deconvolution operation is very similar to the convolution operation therefore the overhead of index computation in the backward pass would be of the same order compared to the computation in the forward pass.
|
md/train/SJzR2iRcK7/SJzR2iRcK7.md
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-CLASS CLASSIFICATION WITHOUT MULTICLASS LABELS
|
| 2 |
+
|
| 3 |
+
Yen-Chang $\mathbf { H s u ^ { 1 } }$ , Zhaoyang $\mathbf { L } \mathbf { v } ^ { 1 }$ , Joel Schlosser2, Phillip Odom2, and Zsolt Kira12
|
| 4 |
+
|
| 5 |
+
1Georgia Institute of Technology 2Georgia Tech Research Institute 1{yenchang.hsu,zhaoyang.lv,zkira}@gatech.edu 2{joel.schlosser,phillip.odom}@gtri.gatech.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
This work presents a new strategy for multi-class classification that requires no class-specific labels, but instead leverages pairwise similarity between examples, which is a weaker form of annotation. The proposed method, meta classification learning, optimizes a binary classifier for pairwise similarity prediction and through this process learns a multi-class classifier as a submodule. We formulate this approach, present a probabilistic graphical model for it, and derive a surprisingly simple loss function that can be used to learn neural network-based models. We then demonstrate that this same framework generalizes to the supervised, unsupervised cross-task, and semi-supervised settings. Our method is evaluated against state of the art in all three learning paradigms and shows a superior or comparable accuracy, providing evidence that learning multi-class classification without multi-class labels is a viable learning option.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
One of the most common settings for machine learning is classification, which involves learning a function $f$ to map the input data $x$ to a class label $y \in \{ 1 , 2 , . . , C \}$ . The most successful method for learning such a function is deep neural networks, owing its popularity to its capability to approximate a complex nonlinear mapping between high-dimensional data (e.g. images) and the classes. Despite the success of deep learning, a neural network demands a large amount of class-specific labels for learning a discriminative model, i.e. $P ( y | x )$ . This type of labeling can be expensive to collect, requires a-priori knowledge of all classes, and limits the form of supervision required. For example, the classes may be ambiguous or non-expert human annotators may be able to more easily provide information about whether two instances are of the same class or not, rather than identifying the specific class. A final problem is that different methods are necessary depending on what type of data is available, ranging from supervised learning (known classes) to cross-task unsupervised learning (unknown classes in the target domain) and semi-supervised learning (mix of labeled and unlabeled with known classes). Unsupervised learning with unknown classes is especially difficult to support.
|
| 14 |
+
|
| 15 |
+
To relax these limitations, we propose to reduce the problem of classification to a meta problem that underlies a set of learning problems. Instead of solving the target task directly (learning a multi-class discriminative model such as a neural network), we instead learn a model that does not require explicit class label $y$ but rather a weaker form of information. In the context of classification, the meta problem that we use is a binary decision problem. Note that such a conversion to a different task (e.g. binary) is called a problem reduction method (Allwein et al., 2000) which has had a long history in the literature, especially in ensemble methods and binarization techniques (Galar et al., 2011). The most well-known strategies are "one-vs-all" (Anand et al., 1995; Rifkin & Klautau, 2004) and "one-vs-one" (Knerr et al., 1990; Hastie & Tibshirani, 1998; Wu et al., 2004). Although they have varied ensembling strategies, all of them share the same task encapsulating scheme, as illustrated in Figure 1a; specifically the binary classifiers are the sub-modules of a multi-class classifier (i.e. the multi-class classifier consists of multiple binary classifiers). These schemes still require that the class label $y$ be available to create the inputs for each binary classifier, and therefore these strategies do not relax the labeling requirements mentioned earlier.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Problem reduction schemes for multi-class classification. This work proposes scheme (b), which introduces a binary classifier that captures $s _ { i j }$ . Note that $s _ { i j }$ represents the probability that $x _ { i }$ and $x _ { j }$ belong to the same class.
|
| 19 |
+
|
| 20 |
+
In this work, we propose a novel strategy to address the above limitations. Our method reverses the task encapsulation order so that a multi-class classifier becomes a sub-module of a binary classifier, as illustrated in Figure 1b. The connection between the two classifiers is elucidated in Section 3. There are two highlights in Figure 1b. First, class labels $y _ { i }$ are not required in the learning stage. Instead, our method uses pairs of data $( x _ { i } , x _ { j } )$ as input and pairwise similarity $s _ { i j }$ for the supervision. Second, there is only one binary classifier in the scheme and it is present only during the training stage. In other words, the ephemeral binary task assists the learning of a multi-class classifier without being involved in the inference. When using a neural network with softmax outputs for the multi-class classifier, the proposed scheme can learn a discriminative model with only pairwise information.
|
| 21 |
+
|
| 22 |
+
We specifically make the following contributions: 1) We analyze the problem setting and show that the loss we can use for this encapsulation can be easily derived, and we present an intuitive probabilistic graphical model interpretation for doing so, 2) We evaluate its performance compared to vanilla supervised learning of neural networks which uses multi-class labels, and visualize the loss landscape to better understand the underlying optimization difficulty, and 3) We demonstrate support for learning classifiers in more challenging problem domains, e.g. in unsupervised cross-task transfer and semi-supervised learning. We show how our meta classification framework can support all three learning paradigms, and evaluate it against several state-of-the-art methods. The experimental results show that the same meta classification approach is superior or comparable to state of the art across the three problem domains (supervised learning, unsupervised cross-task learning, and semi-supervised learning), demonstrating flexibility to support even unknown types and numbers of classes.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Supervised learning and problem reduction: Allwein et al. (2000) presents a unifying framework for multi-class classification by reducing it to multiple binary problems. The concepts for achieving such reduction, one-vs-all and one-vs-one, have been widely adopted and analyzed (Galar et al., 2011). The two strategies have been used to create several popular algorithms, such as variants of support vector machine (Weston & Watkins, 1998), AdaBoost (Freund & Schapire, 1997; Schapire & Singer, 1999), and decision trees (Fürnkranz, 2003). Despite the long history of reduction, our proposed scheme (Figure 1b) has not been explored. Furthermore, the scheme can be deployed easily by replacing the learning objective, which is fully compatible with deep neural networks for classification, a desirable property for broad applicability.
|
| 27 |
+
|
| 28 |
+
Unsupervised cross-task transfer learning: This learning scheme is proposed by Hsu et al. (2018). The method transfers the pairwise similarity as the meta knowledge to an unlabeled dataset of different classes. It then uses a constrained clustering algorithm with predicted pairwise constraints (binarized pairwise similarity) to discover the unseen classes. This learning scheme shares the same supervision (pairwise similarity) as ours, and therefore relates our method to constrained clustering algorithms. One class of such approaches uses the constraints to learn a distance metric, and then applies a generic clustering algorithm such as K-means or hierarchical clustering to obtain the cluster assignments. This includes DML (Xing et al., 2003), ITML (Davis et al., 2007), SKMS (Anand et al., 2014), SKKm (Anand et al., 2014; Amid et al., 2016), and SKLR (Amid et al., 2016). The second class of methods incorporates the constraints into the cluster assignment objective. Some constrained spectral clustering algorithms, e.g. CSP (Wang et al., 2014) and COSC (Rangapuram & Hein, 2012) use this strategy. There are also approaches combine both distance metric learning and a clustering objective jointly, such as MPCKMeans (Bilenko et al., 2004), CECM (Antoine et al., 2012), and Kullback–Leibler divergence based contrastive loss (KCL) (Hsu & Kira, 2016; Hsu et al., 2018). Our new learning objective for Figure 1b can replace the above objectives in the cross-task transfer learning scheme.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: Graphical representation for the meta classification task; $X _ { i }$ represents the node of input data, $Y _ { i }$ represents the class label, $S _ { i j }$ is pairwise similarity between instances $i$ and $j$ , and $\theta$ represents the neural network parameters.
|
| 32 |
+
|
| 33 |
+
Semi-supervised learning: Our meta classification strategy can easily plug into a semi-supervised learning scheme. Our comparison focuses on state-of-the-art methods which solely involve adding a consistency regularization (Laine & Aila, 2017; Sajjadi et al., 2016; Miyato et al., 2018; Tarvainen & Valpola, 2017) or Pseudo-Labeling (Lee, 2013) for training a neural network. Another line of strategy combines weak supervision, such as similar pairs, and unlabeled data to learn a binary classifier (Bao et al., 2018). We present a new method by augmenting Figure 1b with the Pseudo-Labeling strategy.
|
| 34 |
+
|
| 35 |
+
# 3 META CLASSIFICATION LEARNING
|
| 36 |
+
|
| 37 |
+
A natural way to analyze problems with observed and unobserved information is through a probabilistic graphical model. In figure 2, we show the graphical model for our problem, where classspecific labels $Y$ are latent while pairwise similarities $S$ are observed. Specifically, we denote $\mathbf { X } = \{ X _ { 1 } , . . , X _ { n } \}$ , $\mathbf { Y } = \{ Y _ { 1 } , . . , Y _ { n } \}$ , and $\mathbf { S } = \{ S _ { i j } \} _ { 1 \leq i , j \leq n }$ to represent the nodes for samples, class labels, and pairwise similarities, respectively. In the model, we have $Y _ { i } \in \{ 1 , 2 , . . , C \}$ and $S _ { i j } \in \{ 0 , 1 \}$ . Then we have $\mathsf { P } ( S _ { i j } = 1 | Y _ { i } , Y _ { j } ) = 1$ when $Y _ { i } = Y _ { j }$ and zero probability otherwise; similarly, $\bar { \mathsf { P } } ( S _ { i j } = 0 | Y _ { i } , Y _ { j } ) = \bar { 1 }$ when $Y _ { i } \neq Y _ { j }$ . The output of a discriminative classifier with parameters $\theta$ is $f ( x _ { i } ; \theta ) = \mathsf { P } ( Y _ { i } | x _ { i } ; \theta )$ , where $f ( \overline { { \boldsymbol { x } } } _ { i } ; \boldsymbol { \theta } )$ outputs a categorical distribution. Now we describe the likelihood that the model explains the observed labeling (either with class labeling or pairwise labeling).
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathcal { L } ( \boldsymbol { \theta } ; \mathbf { X } , \mathbf { Y } , \mathbf { S } ) = \mathbb { P } ( \mathbf { X } , \mathbf { Y } , \mathbf { S } ; \boldsymbol { \theta } ) = \mathbb { P } ( \mathbf { S } | \mathbf { Y } ) \mathbb { P } ( \mathbf { Y } | \mathbf { X } ; \boldsymbol { \theta } ) \mathbb { P } ( \mathbf { X } )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
When $\mathbf { S }$ is fully observed while $\mathbf { Y }$ is unknown, calculating the likelihood requires marginalizing $\mathbf { Y }$ by computing $\begin{array} { r l } { \sum _ { \mathbf { Y } } \mathbb { P } ( \mathbf { S } | \mathbf { Y } ) \mathbb { P } ( \mathbf { Y } | \mathbf { X } ; \boldsymbol { \theta } ) } & { { } } \end{array}$ , which is intractable. The pairwise term $\begin{array} { r } { \mathsf { P } ( \mathbf { S } | \mathbf { Y } ) = } \end{array}$ $\begin{array} { r } { \prod _ { i , j } \mathbb { P } ( S _ { i j } | Y _ { i } , Y _ { j } ) } \end{array}$ makes all $Y _ { i }$ dependent on each other and prohibits efficient factorization. Thus, we approximate the computation by imposing additional independences such that $S i j \perp \bf { S } \backslash \{ \it { S } _ { i j } \} \lvert \it { X } _ { i } , \it { X } _ { j }$ (see Appendix $\mathbf { D }$ for a discussion of these). Now we can compute the likelihood with the observed nodes $X _ { i } = x _ { i }$ and $S _ { i j } = s _ { i j }$ :
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l } & { { \mathcal { L } } ( \boldsymbol { \theta } ; \mathbf { X } , \mathbf { S } ) \approx \displaystyle \sum _ { \mathbf { Y } } \mathbb { P } ( \mathbf { S } | \mathbf { Y } ) \mathbb { P } ( \mathbf { Y } | \mathbf { X } ; \boldsymbol { \theta } ) } \\ & { \quad \quad \approx \displaystyle \prod _ { i , j } \Big ( \displaystyle \sum _ { Y _ { i } = Y _ { j } } \mathbb { 1 } \big [ s _ { i j } = \boldsymbol { 1 } ] \mathbb { P } ( Y _ { i } | x _ { i } ; \boldsymbol { \theta } ) \mathbb { P } ( Y _ { j } | x _ { j } ; \boldsymbol { \theta } ) + } \\ & { \quad \quad \quad \displaystyle \sum _ { Y _ { i } \neq Y _ { j } } \mathbb { 1 } \big [ s _ { i j } = 0 \big ] \mathbb { P } ( Y _ { i } | x _ { i } ; \boldsymbol { \theta } ) \mathbb { P } ( Y _ { j } | x _ { j } ; \boldsymbol { \theta } ) \Big ) . } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Equation (2) omits the $\mathtt { P } ( \mathbf { X } )$ since $\mathbf { X }$ are observed leaf nodes. It is straightforward to take a negative logarithm on equation 3 and derive a loss function:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { l } { \displaystyle { L _ { m e t a } ( \theta ) = - \sum _ { i , j } \log \bigg ( \sum _ { Y _ { i } = Y _ { j } } \mathbb { I } [ s _ { i j } = 1 ] \mathbb { P } ( Y _ { i } | x _ { i } ; \theta ) \mathbb { P } ( Y _ { j } | x _ { j } ; \theta ) + } } \\ { \displaystyle { \sum _ { Y _ { i } \neq Y _ { j } } \mathbb { I } [ s _ { i j } = 0 ] \mathbb { P } ( Y _ { i } | x _ { i } ; \theta ) \mathbb { P } ( Y _ { j } | x _ { j } ; \theta ) \bigg ) } } \\ { = - \sum _ { i , j } s _ { i j } \log ( f ( x _ { i } ; \theta ) ^ { T } f ( x _ { j } ; \theta ) ) + ( 1 - s _ { i j } ) \log ( 1 - f ( x _ { i } ; \theta ) ^ { T } f ( x _ { j } ; \theta ) ) . } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Then we define the function $g$ by the probability of having the same class label, which is calculated by the inner product between two categorical distributions:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
g ( x _ { i } , x _ { j } , f ( \cdot , \theta ) ) = f ( x _ { i } ; \theta ) ^ { T } f ( x _ { j } ; \theta ) = \hat { s } _ { i j }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Here we use $\hat { s } _ { i j }$ to denote the predicted similarity (as opposed to ground truth similarity $s _ { i j }$ ). By plugging equation 6 into equation 5, $L _ { m e t a }$ has the form of a binary cross-entropy loss:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
L _ { m e t a } = - \sum _ { i , j } s _ { i j } \log \hat { s } _ { i j } + ( 1 - s _ { i j } ) \log ( 1 - \hat { s } _ { i j } ) .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
In Figure 1b, the multi-class classifier corresponds to $f$ while the binary classifier corresponds to $g$ . In other words, it is surprisingly simple to wrap a multi-class classifier by a binary classifier as described above. Since there are no learnable parameters in $g$ , the weights optimized with the meta criterion $L _ { m e t a }$ are all in the neural network $f$ . To minimize $L _ { m e t a }$ , $f ( x _ { i } ; \theta )$ and $f ( x _ { j } ; \theta )$ must output a sharply peaked distribution with the peak happening only at the same output node when $s _ { i j } = 1$ In the case of $s _ { i j } = 0$ , the two distributions must have as little overlap as possible to minimize the loss. In the latter case, the two samples are pushed to be activated at the output nodes of different classes. Both properties of $f$ ’s output distribution are typical characteristics of a classifier learned with class labels and using multi-class cross-entropy. The properties also illustrate the intuition of why minimizing $L _ { m e t a }$ helps $f$ learn outputs similar to a multi-class classifier.
|
| 68 |
+
|
| 69 |
+
Lastly, because of the likelihood nature of $L _ { m e t a }$ , we call the learning criterion a Meta Classification Likelihood (MCL) in the rest of the paper.
|
| 70 |
+
|
| 71 |
+
# 4 LEARNING PARADIGMS
|
| 72 |
+
|
| 73 |
+
The supervision used in MCL is the pairwise labeling $S$ . Due to its weaker form compared to class labels, we have the flexibility to collect it in a supervised, cross-task transfer, or semi-supervised manner. The collection method determines the learning paradigms. In the first two learning paradigms, other methods (see Related Work Section) have also used pair-wise constraints similarly; our novelty is the derivation of our new learning objective, MCL, which can replace the other objectives. In the semi-supervised learning scenario, the proposed Pseudo-MCL is a new method. Details are elaborated below.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: The training flows for each learning paradigm. $X _ { L }$ represents the labeled data with class label $Y _ { L }$ . $X _ { U L }$ is unlabeled data. $\hat { S }$ is the predicted pairwise similarity while $S$ is used as the learning target. The similarity prediction network (SPN) in (b) is learned on a labeled auxiliary dataset and transferred to the target dataset $X _ { U L }$ .
|
| 77 |
+
|
| 78 |
+
# 4.1 SUPERVISED LEARNING
|
| 79 |
+
|
| 80 |
+
Supervised pairwise labeling can be directly collected from humans, or converted from existing class labeling by having $S = \{ s _ { i j } \} _ { 1 \leq i , j \leq n }$ , where $s _ { i j } = 1$ if $x _ { i }$ and $x _ { j }$ belong to the same class, otherwise $s _ { i j } = 0$ . In our experiments, we use the latter setting to enable comparison to other supervised algorithms. Figure 3a illustrates the training process.
|
| 81 |
+
|
| 82 |
+
# 4.2 UNSUPERVISED LEARNING
|
| 83 |
+
|
| 84 |
+
Pairwise labeling can come from several natural cues, such as spatial and temporal proximity. For example, the patches in an image can be similar because of their spatial closeness, and the frames of video in a short time usually have similar content. Additionally, useful pairwise information can be found in the edges in social networks or in the network of academic citations. All of the above are potential applications of this work.
|
| 85 |
+
|
| 86 |
+
Another strategy that is unsupervised in the target domain is to collect pairwise labels through transfer learning. Hsu et al. (2018) proposes a method in which a similarity prediction network (SPN) can be learned from a labeled auxiliary dataset. Then the SPN is applied on the unlabeled target dataset to predict $S$ (the probability of being in the same class). In the last step, the predicted $S$ is fed into a network (in that case optimized via Kullback–Leibler divergence based contrastive loss) to discover the categories in the unlabeled target dataset. Figure 3b illustrates above process. Note that the classes between the auxiliary dataset and target dataset may have an overlap (cross-domain transfer) or not (cross-task transfer) (Hsu et al., 2018). In both cases, the predicted pairwise similarity is noisy (especially in the latter case); therefore the transfer learning strategy creates a challenging scenario for learning classifiers. Its difficulty makes it a good benchmark to evaluate the robustness of our methods and is used in our experiments.
|
| 87 |
+
|
| 88 |
+
# 4.3 SEMI-SUPERVISED LEARNING
|
| 89 |
+
|
| 90 |
+
We propose a new strategy to obtain the $S$ for semi-supervised learning. Figure 3c illustrates the method under the typical semi-supervised learning setting, which takes a common dataset $D$ used for supervised learning and discards the labels for most of the dataset. The labeled and unlabeled portions in $D$ are $D _ { L } = \left( X _ { L } , Y _ { L } \right)$ and $D _ { U L } = X _ { U L }$ correspondingly. The main idea is to create a pseudosimilarity $S _ { L + U L }$ for the meta classifier (similar to Pseudo-Labeling (Lee, 2013)) by binarizing the predicted $\hat { S } _ { L + U L }$ at probability 0.5. We call the method Pseudo-MCL, and we note that here interestingly $g$ is not static as it iteratively improves as $f$ improves. Another way to create similarity is data augmentation, inspired by the $\Pi$ -model (Laine & Aila, 2017) or Stochastic Perturbations (Sajjadi et al., 2016). An image perturbed in different ways naturally belong to the same class, and thus provides free ground-truth similarity. The similarity from both methods can be easily combined to $S _ { L + U L }$ by having a logical-OR operation for the two binarized similarities. The learning objective is the sum of the multi-class cross-entropy and Pseudo-MCL, so the mapping between output nodes and classes are automatically decided by the supervised part of learning.
|
| 91 |
+
|
| 92 |
+
# 5 EXPERIMENTS
|
| 93 |
+
|
| 94 |
+
# 5.1 EXPERIMENTAL SETUP AND NETWORK OPTIMIZATION
|
| 95 |
+
|
| 96 |
+
In all experiments, we use a standard gradient-based method for training a neural network by optimizing the learning criterion. For example, with stochastic gradient descent, we calculate MCL within a mini-batch of data. In that case, the $i$ and $j$ correspond to the index of data in a mini-batch $b$ . The outputs of $f ( \cdot ; \theta )$ are enumerated in $| b | ( | b | - 1 ) / 2$ pairs in a mini-batch before calculation of MCL. Our empirical finding is that this enumeration introduces a negligible overhead to the training time. We also note that for large datasets, this only samples from the full set of pairwise information.
|
| 97 |
+
|
| 98 |
+
One limitation of learning a classifier without class labels is losing the mapping (the identifiability) between the output nodes and the semantic class. A simple method to obtain the mapping is by using a part of the training data with class labels and assigning the output nodes to the dominant class which activates the node (here we obtain the optimal assignment by the Hungarian algorithm (Kuhn, 1955), which is commonly used in evaluating the clustering accuracy (Yang et al., 2010)). Note, however, that for unsupervised problems we do not need to do this except to quantitatively evaluate our method; otherwise the outputs can be seen as arbitrary clusters.
|
| 99 |
+
|
| 100 |
+
# 5.2 SUPERVISED LEARNING WITH WEAK LABELS
|
| 101 |
+
|
| 102 |
+
This section empirically compares MCL to multi-class cross-entropy (CE) and the strong baseline using pairwise similarity (Kullback–Leibler divergence based contrastive loss (KCL) (Hsu & Kira, 2016; Hsu et al., 2018)), in a supervised learning setting. Specifically, we would like to demonstrate that we can achieve similar classification rates as cross-entropy (the standard objective for multi-class classification) using only pairwise similarity, and show that the previous pairwise criterion cannot do this likely due to a poor loss landscape. We compare the classification accuracy of these criteria with varied network depths and varied dataset difficulty. The visualization of loss landscape is provided in Appendix A. The formulation of KCL and how it relates to MCL is available in Appendix B.
|
| 103 |
+
|
| 104 |
+
# 5.2.1 QUANTITATIVE ANALYSIS
|
| 105 |
+
|
| 106 |
+
We compare the classification accuracy on three image datasets: MNIST (LeCun, 1998) is a 10-class handwritten digit dataset with 60000 images for training, and 10000 for testing; CIFAR10 and CIFAR100 (Krizhevsky, 2009) instances are colored $3 2 \times 3 2$ images of objects such as cat, dog, and ship. They both have 50000 images for training and 10000 for testing.
|
| 107 |
+
|
| 108 |
+
Network Architectures: We use convolution neural networks with a varied number of layers: LeNet (LeCun et al., 1998) and VGG (Simonyan & Zisserman, 2014). We add VGG8, which only has one convolution layer before each pooling layer, as the supplement between LeNet and VGG11. The list of architectures also includes ResNet (He et al., 2016a) with pre-activation (He et al., 2016b)). The number of output nodes $K$ in the last fully connected layer is set to the true number of categories for this section. Since the learning objectives KCL and MCL both work on pairs of inputs, we have a pairwise enumeration layer (Hsu et al., 2018) between the network outputs and the loss function.
|
| 109 |
+
|
| 110 |
+
Training Configurations: All networks in this section are trained from scratch with randomly initialized weights. By default, we use Adam (Kingma & Ba, 2014) to optimize the three criterion with mini-batch size 100 and initial learning rate 0.001. On MNIST the learning rate was dropped every 10 epochs by a factor of 0.1 with 30 epochs in total. On CIFAR10/100 we use the same setting except that the learning rate is dropped at 80 and 120 epochs with 140 epochs in total. For CIFAR100, the mini-batch size was 1000 and the learning rate dropped at epoch 100 and 150 with 180 epochs in total. In the experiments with ResNet, we use SGD instead of Adam since SGD converges to a higher accuracy when keeping other settings the same as above. The learning rate for SGD starts with 0.1 and decays with a factor of 0.1 at the number of epochs described above.
|
| 111 |
+
|
| 112 |
+
Table 1: The classification error rate (lower is better) on three datasets with different objective functions and different neural network architectures. CE denotes that the network uses class-specific labels for training with a multi-class cross-entropy. MCL only uses the binarized similarity for learning with the meta-classification criterion. KCL is a strong baseline which also uses binarized similarity. The \* symbol indicates the worst cases of KCL. The performance in parenthesis means its network uses a better initialization (VGG16 and VGG8) or a learning schedule which is 10 times longer (VGG11). The two treatments are discussed in Section 5.2.1. We only use VGG8 for CIFAR100 since KCL performs the best with it on CIFAR10. Each value is the average of 3 runs.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Dataset</td><td>#class</td><td>Network</td><td>(Class label)</td><td colspan="2">(Pairwise label)</td></tr><tr><td>MNIST</td><td></td><td></td><td>CE</td><td>KCL</td><td>MCL</td></tr><tr><td></td><td>10</td><td>LeNet LeNet</td><td>0.6% 14.9%</td><td>0.5% 16.4%</td><td>0.6% 15.1%</td></tr><tr><td rowspan="8">CIFAR10</td><td rowspan="8">10</td><td>VGG8</td><td></td><td>10.2%</td><td></td></tr><tr><td></td><td>10.2%</td><td></td><td>10.2%</td></tr><tr><td>VGG11</td><td>8.9%</td><td>72.2(10.4)%</td><td>9.4%</td></tr><tr><td>VGG16</td><td>7.6%</td><td>*81.1(10.3)%</td><td>8.3%</td></tr><tr><td>ResNet18</td><td>6.7%</td><td>73.8%</td><td>6.6%</td></tr><tr><td>ResNet34</td><td>6.6%</td><td>79.3%</td><td>6.3%</td></tr><tr><td>ResNet50</td><td>6.6%</td><td>79.6%</td><td>5.9%</td></tr><tr><td>ResNet101</td><td>6.5%</td><td>79.9%</td><td>5.6%</td></tr><tr><td>CIFAR100</td><td>100</td><td>VGG8</td><td>35.4%</td><td>*45.3(40.2)%</td><td>36.1%</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Results and discussion: The results in Table 1 show that MCL achieves similar classification performance as CE with different network depths and three datasets. In contrast, KCL has degenerate performance when the networks are deeper or the dataset is more difficult. This might be due to a limitation of using KL-divergence, specifically that when two probability distributions are the same, the divergence will be zero no matter what the values are. This property may introduce bad local minima or small gradients for learning. To investigate such a perspective, we apply two strategies. First, we use a large learning rate (0.2) with SGD to avoid bad local minima and make the training schedule 10 times longer for exploring the parameter space. This setting helps KCL with VGG11, in that the error rate drops from $7 2 . 2 \%$ to $1 0 . 4 \%$ , but not with VGG16 (from $8 1 . 1 \%$ to $7 6 . 8 \%$ ). In the second strategy, we select the worst conditions (the values with \* notion) in Table 1 for KCL and pre-train the networks with only $4 \mathrm { k \Omega }$ labels with CE to initialize the networks. Then we use KCL with the full training set to finish the training. With a better initialization, KCL can reach a performance close to CE and MCL. The performance is shown with parenthesis in Table 1. The results of both strategies indicate that KCL has bad local minima or plateaus in its loss surface (see Section A in Appendix). Unlike KCL, MCL can converge to a performance close to CE with random initialization in all of our experiments. Furthermore, MCL outperforms CE with a deeper network (error rate $5 . 6 \%$ versus $6 . 5 \%$ with ResNet101). Such a result indicates that MCL is less prone to overfitting (in the Table 1, all ResNets achieve a training error less than $0 . 1 \%$ ).
|
| 117 |
+
|
| 118 |
+
# 5.3 UNSUPERVISED CROSS-TASK TRANSFER LEARNING
|
| 119 |
+
|
| 120 |
+
The second experiment follows the transfer learning scenario proposed by Hsu et al. (2018) and is summarized in Section 4.2. This scenario has two settings. The first is when the number of output nodes $K$ equal to the number of ground truth classes $C$ in a dataset. This setting is the same as a multi-class classification task, except no labels (both class labels or similarity labels) are provided in the target dataset. The second setting is having an unknown $C$ , which is closer to a clustering problem. One strategy to address the unknown $C$ is to set a large $K$ , and we rely on the clustering algorithm to use only a necessary number of clusters to describe the dataset while leaving the extra clusters empty.
|
| 121 |
+
|
| 122 |
+
Table 2: Unsupervised cross-task transfer learning on Omniglot. The performance (higher is better) is averaged across 20 alphabets (datasets), in which each has 20 to 47 letters (classes). The ACC and NMI without brackets have the number of output nodes $K$ equal to the true number of classes in a dataset, while columns with " $\mathrm { { K = } } 1 0 0 )$ " represent the case where the number of classes is unknown and a fixed $K = 1 0 0$ is used.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Method</td><td>ACC</td><td>ACC (K=100)</td><td>NMI</td><td>NMI (K=100)</td></tr><tr><td>K-means (MacQueen et al., 1967)</td><td>21.7%</td><td>18.9%</td><td>0.353</td><td>0.464</td></tr><tr><td>LPNMF (Cai et al., 2009)</td><td>22.2%</td><td>16.3%</td><td>0.372</td><td>0.498</td></tr><tr><td>LSC (Chen & Cai,2011)</td><td>23.6%</td><td>18.0%</td><td>0.376</td><td>0.500</td></tr><tr><td>ITML (Davis et al., 2007)</td><td>56.7%</td><td>47.2%</td><td>0.674</td><td>0.727</td></tr><tr><td>SKKm (Anand et al., 2014)</td><td>62.4%</td><td>46.9%</td><td>0.770</td><td>0.781</td></tr><tr><td>SKLR (Amid et al., 2016)</td><td>66.9%</td><td>46.8%</td><td>0.791</td><td>0.760</td></tr><tr><td>CSP (Wang et al., 2014)</td><td>62.5%</td><td>65.4%</td><td>0.812</td><td>0.812</td></tr><tr><td>MPCK-means (Bilenko et al., 2004)</td><td>81.9%</td><td>53.9%</td><td>0.871</td><td>0.816</td></tr><tr><td>KCL (Hsu et al., 2018)</td><td>82.4%</td><td>78.1%</td><td>0.889</td><td>0.874</td></tr><tr><td>MCL (ours)</td><td>83.3%</td><td>80.2%</td><td>0.897</td><td>0.893</td></tr></table>
|
| 125 |
+
|
| 126 |
+
We use constrained clustering algorithms as the baselines since they can use the pairwise inputs from a similarity prediction network (SPN) (Hsu et al., 2018). In this section, the same set of binarized pairwise similarity prediction is provided to all algorithms for a fair comparison. The metric in this section is still the classification accuracy. The mapping between output nodes and classes is calculated by the Hungarian algorithm, in which each class only matches to one output node. The unmapped output nodes are all subject to the classification error. We also include the normalized mutual information (NMI) (Strehl & Ghosh, 2002) metric. We use two datasets in the evaluation.
|
| 127 |
+
|
| 128 |
+
Omniglot (Lake et al., 2015): This dataset has 20 images for each of 1623 different handwritten characters. The characters are from 50 different alphabets and were separated into 30 background sets $( O m n i g l o t _ { b g } )$ ) and 20 evaluation sets $( O m n i g l o t _ { e v a l } )$ by the dataset author. The procedure uses the Omniglotbg set (964 characters in total) to learn the similarity function and applies it to the cross-task transfer learning on the 20 evaluation sets (this same input is used for all compared algorithms). In this test, the backbone network for classification has four convolution layers and has weights randomly initialized. Both MCL and KCL are optimized by Adam with mini-batch size 100.
|
| 129 |
+
|
| 130 |
+
ImageNet (Deng et al., 2009): The 1000-class dataset is separated into 882-class and 118-class subsets as the random split in Vinyals et al. (2016). The procedure uses ImageN et882 for learning the similarity prediction function and randomly samples 30 classes ( $\mathrm { \sim } 3 9 \mathrm { k }$ images) from $I m a g e N e t _ { 1 1 8 }$ for the unlabeled target data. In this test, the backbone classification network is Resnet-18 and has weights initialized by classification on $I m a g e N e t _ { 8 8 2 }$ . Both learning objectives (KCL and MCL) are optimized by SGD with mini-batch size 100.
|
| 131 |
+
|
| 132 |
+
Results and Discussion: We follow the evaluation procedure (including network architectures) used in Hsu et al. (2018), therefore the results can be directly compared. The results shown in Table 2 and 3 demonstrate a clear advantage for MCL over other methods. KCL also performs well, but MCL beats its performance with a larger gap when $C$ is unknown (ACC with $\mathrm { K } { = } 1 0 0 $ ). MCL also estimates the number of classes in a dataset better than KCL (Appendix Table 5). The advantage of MCL over KCL in this section is not due to the ease of optimization, since the network is shallow in the Omniglot experiment and the network is pre-trained in the ImageNet experiment. The advantage may due to the fact that MCL is free of hyper-parameters and so performs better than KCL which uses a heuristic threshold $\sigma = 2$ ) (Hsu & Kira, 2016) for its margin.
|
| 133 |
+
|
| 134 |
+
Table 3: Unsupervised cross-task transfer learning on ImageNet. The values (higher is better) are the average of three random subsets in $I m a g e N e t _ { 1 1 8 }$ . Each subset has 30 classes. The "ACC" has $K = 3 0$ . All methods use the features (outputs of average pooling) from Resnet-18 pre-trained with ImageNet882 classification.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Method</td><td>ACC</td><td>ACC(K=100)</td><td>NMI</td><td>NMI(K=100)</td></tr><tr><td>K-means</td><td>71.9%</td><td>34.5%</td><td>0.713</td><td>0.671</td></tr><tr><td>LSC</td><td>73.3%</td><td>33.5%</td><td>0.733</td><td>0.655</td></tr><tr><td>LPNMF</td><td>43.0%</td><td>21.8%</td><td>0.526</td><td>0.500</td></tr><tr><td>KCL</td><td>73.8%</td><td>65.2%</td><td>0.750</td><td>0.715</td></tr><tr><td>MCL</td><td>74.4%</td><td>71.5%</td><td>0.762</td><td>0.765</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 4: Test error rates (lower is better) obtained by various semi-supervised learning approaches on CIFAR-10 with all but 4,000 labels removed. Supervised refers to using only 4,000 labeled samples from CIFAR-10 without any unlabeled data. All the methods use ResNet-18 and standard data augmentation.
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Method</td><td>CIFAR10 4k labels</td></tr><tr><td>Supervised Pseudo-Label</td><td>25.4 ± 1.0% 19.8 ± 0.7%</td></tr><tr><td>II-model VAT</td><td>19.6 ± 0.4% 18.2 ± 0.4%</td></tr><tr><td>SPN-MCL</td><td>22.8 ± 0.5%</td></tr><tr><td>Pseudo-MCL</td><td>18.0 ± 0.4%</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 5.4 SEMI-SUPERVISED LEARNING
|
| 143 |
+
|
| 144 |
+
We evaluate the semi-supervised learning performance of the Pseudo-MCL on the standard benchmark dataset CIFAR-10. The Pseudo-MCL is compared to two state-of-the-art methods, which are VAT (Miyato et al., 2018) and Π-Model (Laine & Aila, 2017; Sajjadi et al., 2016). Our list of baselines additionally includes Pseudo-Labeling (Lee, 2013) and SPN-MCL since they share a similar strategy with Pseudo-MCL. The SPN-MCL uses the same strategy presented in the Section 4.2 for unsupervised learning, except that the SPN is trained with only the labeled portion (e.g. 4k labeled data) of CIFAR10 in this section. We also note that the SPN serves as a static function to provide the similarity for optimizing the regular MCL objective.
|
| 145 |
+
|
| 146 |
+
Experiment Setting: To construct the $D _ { L }$ , four thousand labeled data are randomly sampled from the training set (50k images) of CIFAR10. This leaves $4 6 \mathrm { k }$ unlabeled data for $D _ { U L }$ . We use 5 random $D _ { L } / D _ { U L }$ splits to calculate the average performance. The images are augmented by the standard procedure which includes random cropping, random horizontal flipping, and normalization to zero mean with unit variance. The model for all method is the ResNet-18 (pre-activation version, He et al. (2016b)), which has no dropout as in a standard model. We use Adam to optimize the objective functions of all methods. The procedure begins with learning the supervised model with only the $4 \mathrm { k }$ labeled data; then all other methods have a fine-tuning with $D _ { L } + D _ { U L }$ based on the learned supervised model. The supervised model (with only 4k data) is trained with initial learning rate 0.001 and a decay with factor 0.1 at epochs 80 and 120 for a total of 140 epochs. All the semi-supervised methods are trained with initial learning rate 0.001 and have a decay with factor 0.1 at epoch 150 and 250 for a total of 300 epochs. We use a shared implementation among all methods so that the major difference between methods is the regularization term in the learning objective. Appendix C.1 provides the description for hyperparameter tuning.
|
| 147 |
+
|
| 148 |
+
# Results and Discussion:
|
| 149 |
+
|
| 150 |
+
Table 4 presents the comparison and shows that Pseudo-MCL is on-par with the state-of-the-art method VAT (Miyato et al., 2018). The performance difference between SPN-MCL and Pseudo-MCL clearly demonstrates the benefits of having the binary classifier and the multi-class classifier optimized together. Note that comparing our Table 4 and a recent review (Oliver et al., 2018), we have a lower baseline performance due to a lighter regularization (no dropout) and no extra data augmentation (such as adding Gaussian noise), but the relative ranking between methods is consistent. Therefore we confirm the effectiveness of Pseudo-MCL. Lastly, Pseudo-MCL is free of hyperparameter, which is a very appealing characteristic for learning with few data.
|
| 151 |
+
|
| 152 |
+
# 6 CONCLUSION
|
| 153 |
+
|
| 154 |
+
We presented a new strategy to learn a multi-class classification via a binary decision problem. We formulate the problem setting via a probabilistic graphical model and derive a simple likelihood objective that can be effectively optimized via neural networks. We show how this same framework can be used for three learning paradigms: supervised learning, unsupervised cross-task transfer learning, and semi-supervised learning. Results show comparable or improved results over state of the art, especially in the challenging unsupervised cross-task setting. This demonstrates the power of using pairwise similarity as weak labels to relax the requirement of class-specific labeling. We hope the presented perspective of meta classification inspires additional approaches to learning with fewer labeled data (e.g. domain adaptation and few-shot learning) as well as application to domains where weak labels are easier to obtain.
|
| 155 |
+
|
| 156 |
+
# ACKNOWLEDGMENTS
|
| 157 |
+
|
| 158 |
+
This work was supported by the National Science Foundation and National Robotics Initiative (grant # IIS-1426998) and DARPA’s Lifelong Learning Machines (L2M) program, under Cooperative Agreement HR0011-18-2-001.
|
| 159 |
+
|
| 160 |
+
# REFERENCES
|
| 161 |
+
|
| 162 |
+
Erin L Allwein, Robert E Schapire, and Yoram Singer. Reducing multiclass to binary: A unifying approach for margin classifiers. Journal of machine learning research, 1(Dec):113–141, 2000.
|
| 163 |
+
|
| 164 |
+
Ehsan Amid, Aristides Gionis, and Antti Ukkonen. Semi-supervised kernel metric learning using relative comparisons. arXiv preprint arXiv:1612.00086, 2016.
|
| 165 |
+
|
| 166 |
+
Rangachari Anand, Kishan Mehrotra, Chilukuri K Mohan, and Sanjay Ranka. Efficient classification for multiclass problems using modular neural networks. IEEE Transactions on Neural Networks, 6 (1):117–124, 1995.
|
| 167 |
+
|
| 168 |
+
Saket Anand, Sushil Mittal, Oncel Tuzel, and Peter Meer. Semi-supervised kernel mean shift clustering. IEEE transactions on pattern analysis and machine intelligence, 36(6):1201–1215, 2014.
|
| 169 |
+
|
| 170 |
+
Violaine Antoine, Benjamin Quost, M-H Masson, and Thierry Denoeux. Cecm: Constrained evidential c-means algorithm. Computational Statistics & Data Analysis, 56(4):894–914, 2012.
|
| 171 |
+
|
| 172 |
+
Han Bao, Gang Niu, and Masashi Sugiyama. Classification from pairwise similarity and unlabeled data. In Proceedings of the 35th International Conference on Machine Learning, 2018.
|
| 173 |
+
|
| 174 |
+
Mikhail Bilenko, Sugato Basu, and Raymond J Mooney. Integrating constraints and metric learning in semi-supervised clustering. In Proceedings of the twenty-first international conference on Machine learning, pp. 11. ACM, 2004.
|
| 175 |
+
|
| 176 |
+
Deng Cai, Xiaofei He, Xuanhui Wang, Hujun Bao, and Jiawei Han. Locality preserving nonnegative matrix factorization. In IJCAI, volume 9, pp. 1010–1015, 2009.
|
| 177 |
+
|
| 178 |
+
Xinlei Chen and Deng Cai. Large scale spectral clustering with landmark-based representation. In AAAI, volume 5, pp. 14, 2011.
|
| 179 |
+
|
| 180 |
+
Jason V Davis, Brian Kulis, Prateek Jain, Suvrit Sra, and Inderjit S Dhillon. Information-theoretic metric learning. In Proceedings of the 24th international conference on Machine learning, pp. 209–216. ACM, 2007.
|
| 181 |
+
|
| 182 |
+
J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009.
|
| 183 |
+
|
| 184 |
+
Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119–139, 1997.
|
| 185 |
+
|
| 186 |
+
Johannes Fürnkranz. Round robin ensembles. Intelligent Data Analysis, 7(5):385–403, 2003.
|
| 187 |
+
|
| 188 |
+
Mikel Galar, Alberto Fernández, Edurne Barrenechea, Humberto Bustince, and Francisco Herrera. An overview of ensemble methods for binary classifiers in multi-class problems: Experimental study on one-vs-one and one-vs-all schemes. Pattern Recognition, 44(8):1761–1776, 2011.
|
| 189 |
+
|
| 190 |
+
Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014.
|
| 191 |
+
|
| 192 |
+
Trevor Hastie and Robert Tibshirani. Classification by pairwise coupling. In Advances in neural information processing systems, pp. 507–513, 1998.
|
| 193 |
+
|
| 194 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016a.
|
| 195 |
+
|
| 196 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pp. 630–645. Springer, 2016b.
|
| 197 |
+
|
| 198 |
+
Yen-Chang Hsu and Zsolt Kira. Neural network-based clustering using pairwise constraints. International Conference on Learning Representations (ICLR) workshop, 2016.
|
| 199 |
+
|
| 200 |
+
Yen-Chang Hsu, Zhaoyang Lv, and Zsolt Kira. Learning to cluster in order to transfer across domains and tasks. In International Conference on Learning Representations (ICLR), 2018.
|
| 201 |
+
|
| 202 |
+
Daniel Jiwoong Im, Michael Tao, and Kristin Branson. An empirical analysis of deep network loss surfaces. 2016.
|
| 203 |
+
|
| 204 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 205 |
+
|
| 206 |
+
Stefan Knerr, Léon Personnaz, and Gérard Dreyfus. Single-layer learning revisited: a stepwise procedure for building and training a neural network. In Neurocomputing, pp. 41–50. Springer, 1990.
|
| 207 |
+
|
| 208 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 209 |
+
|
| 210 |
+
Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
|
| 211 |
+
|
| 212 |
+
Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. International Conference on Learning Representations, 2017.
|
| 213 |
+
|
| 214 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 215 |
+
|
| 216 |
+
Yann LeCun. The mnist database of handwritten digits. 1998.
|
| 217 |
+
|
| 218 |
+
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.
|
| 219 |
+
|
| 220 |
+
Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. 2013.
|
| 221 |
+
|
| 222 |
+
Hao Li, Zheng Xu, Gavin Taylor, and Tom Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
|
| 223 |
+
|
| 224 |
+
James MacQueen et al. Some methods for classification and analysis of multivariate observations. In Proceedings of the fifth Berkeley symposium on mathematical statistics and probability, volume 1, pp. 281–297. Oakland, CA, USA., 1967.
|
| 225 |
+
|
| 226 |
+
Takeru Miyato, Shin-ichi Maeda, Shin Ishii, and Masanori Koyama. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 2018.
|
| 227 |
+
|
| 228 |
+
Avital Oliver, Augustus Odena, Colin Raffel, Ekin D Cubuk, and Ian J Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. arXiv preprint arXiv:1804.09170, 2018.
|
| 229 |
+
|
| 230 |
+
Syama Sundar Rangapuram and Matthias Hein. Constrained 1-spectral clustering. In AISTATS, volume 30, pp. 90, 2012.
|
| 231 |
+
|
| 232 |
+
Ryan Rifkin and Aldebaro Klautau. In defense of one-vs-all classification. Journal of machine learning research, 5(Jan):101–141, 2004.
|
| 233 |
+
|
| 234 |
+
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, pp. 1163–1171, 2016.
|
| 235 |
+
|
| 236 |
+
Robert E Schapire and Yoram Singer. Improved boosting algorithms using confidence-rated predictions. Machine learning, 37(3):297–336, 1999.
|
| 237 |
+
|
| 238 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 239 |
+
|
| 240 |
+
Alexander Strehl and Joydeep Ghosh. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. Journal of machine learning research, 3(Dec):583–617, 2002.
|
| 241 |
+
|
| 242 |
+
Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in neural information processing systems, pp. 1195–1204, 2017.
|
| 243 |
+
|
| 244 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. NIPS, 2016.
|
| 245 |
+
|
| 246 |
+
Xiang Wang, Buyue Qian, and Ian Davidson. On constrained spectral clustering and its applications. Data Mining and Knowledge Discovery, pp. 1–30, 2014.
|
| 247 |
+
|
| 248 |
+
Jason Weston and Chris Watkins. Multi-class support vector machines. Technical report, Citeseer, 1998.
|
| 249 |
+
|
| 250 |
+
Ting-Fan Wu, Chih-Jen Lin, and Ruby C Weng. Probability estimates for multi-class classification by pairwise coupling. Journal of Machine Learning Research, 5(Aug):975–1005, 2004.
|
| 251 |
+
|
| 252 |
+
Eric P Xing, Michael I Jordan, Stuart J Russell, and Andrew Y Ng. Distance metric learning with application to clustering with side-information. In Advances in neural information processing systems, pp. 521–528, 2003.
|
| 253 |
+
|
| 254 |
+
Yi Yang, Dong Xu, Feiping Nie, Shuicheng Yan, and Yueting Zhuang. Image clustering using local discriminant models and global integration. IEEE Transactions on Image Processing, 2010.
|
| 255 |
+
|
| 256 |
+
# APPENDICES
|
| 257 |
+
|
| 258 |
+
# A LOSS LANDSCAPE VISUALIZATION
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 4: The loss landscape visualizations. Dark green represents a low loss value while yellow means high value. The bottom part of each diagram is the 2D contour of its 3D surface. The vertical axis of CE is logarithmic to better visualize its dynamic range (Li et al., 2017).
|
| 262 |
+
|
| 263 |
+
We visualize the three loss functions: CE, MCL, and KCL. The loss surfaces are plotted with the function (Goodfellow et al., 2014; Im et al., 2016; Li et al., 2017):
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
f ( \alpha , \beta ) = L ( \theta ^ { * } + \alpha \delta + \beta \eta ; D )
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
where $\theta ^ { * }$ are the parameters of the model trained with loss function $L$ and labeled dataset $D = ( X , Y )$ . The $\delta$ and $\eta$ variables are two directions for a 2D projection of $\theta$ . The $\alpha$ and $\beta$ are the amount of shift along $\delta$ and $\eta$ from the origin $\theta ^ { * }$ . This method allows us to better understand the landscape of loss around the solution.
|
| 270 |
+
|
| 271 |
+
To choose $\delta$ and $\eta$ , one straightforward method is to use random projections. However, it cannot be used to compare the geometry across different networks or loss functions, because of the scale invariance in network weights. One source of such invariance is batch normalization. In such cases, the size (i.e., norm) of a filter (assume a convolution layer) is irrelevant because the output of each layer is re-scaled during batch normalization. Li et al. (2017) propose Filter-wise Normalization to address the above concern. We adopt this strategy to normalize the two random projections and make the relative flatness between loss surfaces comparable. We call this a random projection method.
|
| 272 |
+
|
| 273 |
+
Another way to choose $\delta$ and $\eta$ is to use solutions from different loss functions. Since we have three loss functions all able to solve the same multi-class classification problem, we can use one solution (e.g. $\theta _ { M C L } ^ { * }$ from MCL) for the $\theta ^ { * }$ and use the remaining two solutions (e.g. $\theta _ { C E } ^ { * }$ and $\theta _ { K C L } ^ { * }$ ) for the two projections (e.g. $\delta = \theta _ { C E } ^ { * } - \theta _ { M C L } ^ { * }$ and $\eta = \theta _ { K C L } ^ { * } - \theta _ { M C L } ^ { * } )$ . We call this a mutual projection method.
|
| 274 |
+
|
| 275 |
+
Visualization Setting: This section uses CIFAR10 and VGG11. We choose VGG11 because it is the smallest network that KCL cannot be optimized well with a regular learning schedule. For each learning objectives, we use the best-learned models in that error rates are less than $1 0 . 4 \%$ (see Table 1). The parameters of three models $( \theta _ { C E } ^ { * } , \theta _ { M C L } ^ { * } , \theta _ { K C L } ^ { * } )$ are used to construct an interpolated one: $\theta = \theta ^ { * } + \alpha \delta + \beta \eta$ . A $9 1 \mathbf { x } 9 1$ grid is used to enumerate the combinations of $\alpha$ and $\beta$ , which are the scales for the two projected directions. The loss values associated with each $( \alpha , \beta )$ are plotted in the z-direction to form a surface for visualization. Similar to Li et al. (2017), the vertical axis of CE is logarithmic to better visualize its dynamic range. For more details please refer to Li et al. (2017).
|
| 276 |
+
|
| 277 |
+
Results and Discussion: In the random projection (Figure 4a), the loss landscape with CE is similar to previous work (Li et al., 2017) which shows a nice convexity with a not-too-deep neural network (ResNet18). The solutions of MCL and KCL are both surrounded by a plateau of high loss, but MCL has a wider concave region. The same wide concavity can be seen in the mutual projection (Figure 4b). This is a possible explanation for why MCL still converges to a good local minimum with a randomly initialized network. Besides, the mutual projection shows that the geometry of MCL’s loss landscape is similar to CE’s surface, while KCL has a sharp low-loss region only around its solutions. This might be a reason why it requires a prolonged training schedule to find a good local minimum. Overall, MCL is qualitatively more similar to CE in the visualization of loss landscape.
|
| 278 |
+
|
| 279 |
+
# B KCL VERSUS MCL
|
| 280 |
+
|
| 281 |
+
From the view of optimization objective, the KLD-based Contrastive Loss (KCL) has a form close to our MCL although it is originally designed for clustering. In the KCL paper (Hsu & Kira, 2016; Hsu et al., 2018), it interprets the softmax output of a neural network as outputting a probability distribution over cluster assignments. Then a contrastive loss function is defined using KL-divergence to measure the distance between two distributions $\hat { \mathbf { y } } _ { i } = f ( x _ { i } ; \theta )$ and $\hat { \mathbf { y } } _ { j } ~ = ~ f ( x _ { j } ; \theta )$ . The cost between a similar pair $( x _ { i } , x _ { j } )$ , in which $s _ { i j } = 1$ , is given by:
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
\begin{array} { r } { L _ { K C L } ^ { + } ( x _ { i } , x _ { j } ) = D _ { \mathrm { K L } } ( \hat { \bf y } _ { i } | | \hat { \bf y } _ { j } ) + D _ { \mathrm { K L } } ( \hat { \bf y } _ { j } | | \hat { \bf y } _ { i } ) . } \end{array}
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
If $( x _ { i } , x _ { j } )$ is a dissimilar pair $( s _ { i j } = 0 )$ ), then $\hat { \mathbf { y } } _ { i }$ and ${ \hat { \mathbf { y } } } _ { j }$ are expected to be different distributions, which is described by a hinge-loss function with a hyper-parameter $\sigma$ for the margin.
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
\begin{array} { r } { L _ { K C L } ^ { - } ( x _ { i } , x _ { j } ) = L _ { h } ( D _ { \mathrm { K L } } ( \hat { \bf y } _ { i } | | \hat { \bf y } _ { j } ) , \sigma ) + L _ { h } ( D _ { \mathrm { K L } } ( \hat { \bf y } _ { j } | | \hat { \bf y } _ { i } ) , \sigma ) , } \end{array}
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
Then the total contrastive loss (KCL) has the form:
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
L _ { K C L } = \sum _ { i , j } s _ { i j } L _ { K C L } ^ { + } ( x _ { i } , x _ { j } ) + ( 1 - s _ { i j } ) L _ { K C L } ^ { - } ( x _ { i } , x _ { j } ) .
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
In comparing KCL and MCL, we find that they are similar in using pairwise similarity and have no requirement on the number of output nodes $K$ no matter what the true number of classes $C$ is. They can also be plugged into the training of neural networks in the same way, in that switching MCL to KCL can easily be done by replacing the learning criterion. Although they are similar in terms of usage, their formulation has a fundamental difference. KCL is inspired by metric learning, in that KL-divergence is the metric for evaluating the pairwise distance. Our MCL is inspired by the concept of meta classification learning and explained by a maximum likelihood estimation. The most significant difference is that MCL is free of hyperparameter. Therefore MCL does not require cross-validation for hyperparameter tuning. This property is crucial for unsupervised learning or when only a few instances of labeled data are available.
|
| 300 |
+
|
| 301 |
+
Table 5: Estimates for the number of characters across the 20 datasets in $O m n i g l o t _ { e v a l }$ when $C$
|
| 302 |
+
is unknown. The bold number means the prediction has error smaller or equal to 3. The number
|
| 303 |
+
of dand inant clusters is defiis the size of cluster d by . For $\begin{array} { r } { N D C = \sum _ { i = 1 } ^ { K } \left[ C _ { i } > = E [ C _ { i } ] \right] } \end{array}$ , where e alpha $[ \cdot ]$ is an Iverson Bracket has 1000 images and $C _ { i }$ $i$ $E [ C _ { i } ]$
|
| 304 |
+
$K = 1 0 0$ . The $A D i f$ represents average difference (Hsu et al., 2018).
|
| 305 |
+
|
| 306 |
+
<table><tr><td>Alphabet</td><td>#class</td><td>SKMS</td><td>KCL</td><td>MCL</td></tr><tr><td>Angelic</td><td>20</td><td>16</td><td>26</td><td>22</td></tr><tr><td>Atemayar Q.</td><td>26</td><td>17</td><td>34</td><td>26</td></tr><tr><td>Atlantean</td><td>26</td><td>21</td><td>41</td><td>25</td></tr><tr><td>Aurek_Besh</td><td>26</td><td>14</td><td>28</td><td>22</td></tr><tr><td>Avesta</td><td>26</td><td>8</td><td>32</td><td>23</td></tr><tr><td>Ge_ez</td><td>26</td><td>18</td><td>32</td><td>25</td></tr><tr><td>Glagolitic</td><td>45</td><td>18</td><td>45</td><td>36</td></tr><tr><td>Gurmukhi</td><td>45</td><td>12</td><td>43</td><td>31</td></tr><tr><td>Kannada</td><td>41</td><td>19</td><td>44</td><td>30</td></tr><tr><td>Keble</td><td>26</td><td>16</td><td>28</td><td>23</td></tr><tr><td>Malayalam</td><td>47</td><td>12</td><td>47</td><td>35</td></tr><tr><td>Manipuri</td><td>40</td><td>17</td><td>41</td><td>33</td></tr><tr><td>Mongolian</td><td>30</td><td>28</td><td>36</td><td>29</td></tr><tr><td>Old Church S.</td><td>45</td><td>23</td><td>45</td><td>38</td></tr><tr><td>Oriya</td><td>46</td><td>22</td><td>49</td><td>32</td></tr><tr><td>Sylheti</td><td>28</td><td>11</td><td>50</td><td>30</td></tr><tr><td>Syriac_Serto</td><td>23</td><td>19</td><td>38</td><td>24</td></tr><tr><td>Tengwar</td><td>25</td><td>12</td><td>41</td><td>26</td></tr><tr><td>Tibetan</td><td>42</td><td>15</td><td>42</td><td>34</td></tr><tr><td>ULOG</td><td>26</td><td>15</td><td>40</td><td>27</td></tr><tr><td>ADif</td><td></td><td>16.3</td><td>6.35</td><td>5.1</td></tr></table>
|
| 307 |
+
|
| 308 |
+
# C EXPERIMENTAL SETTING
|
| 309 |
+
|
| 310 |
+
# C.1 HYPERPARAMETER TUNING FOR SEMI-SUPERVISED LEARNING
|
| 311 |
+
|
| 312 |
+
All the semi-supervised learning objectives $L _ { S S L }$ here can be represented as a weighted sum of a supervised term $L _ { s u p }$ and an unsupervised regularization term $L _ { r e g }$ :
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
{ \cal L } _ { S S L } = \alpha { \cal L } _ { s u p } ( X _ { L } , Y _ { L } ) + \beta { \cal L } _ { r e g } ( X _ { L } \cup X _ { U L } )
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
For a fair comparison, one should give the same budget for tuning the hyperparameters, such as $\alpha$ and $\beta$ . One strategy is applying an exhaustive grid search in the hyperparameter space. Such searching requires doing cross-validation and may not be applicable when the number of labeled data is small. We adopt another strategy that gives zero tuning budget for all. We decide the $\alpha$ and $\beta$ by natural statistics, which is the ratio between the amount of data be seen by the $L _ { s u p }$ and $L _ { r e g }$ . Specifically:
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\alpha = \frac { | D _ { L } | } { | D | + | D _ { L } | } , \beta = \frac { | D | } { | D | + | D _ { L } | }
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
One method, VAT (Miyato et al., 2018), has extra hyperparameters (e.g. the $\epsilon$ ) in its design. In that case, we use the values decided in the original paper for this dataset.
|
| 325 |
+
|
| 326 |
+
# D ASSUMPTIONS IN META CLASSIFICATION LIKELIHOOD
|
| 327 |
+
|
| 328 |
+
# D.1 SIMPLIFIED LIKELIHOOD
|
| 329 |
+
|
| 330 |
+
In section 3, the original likelihood (eq. 2) relies on an additional independence assumption to simplify its negative logarithm form to a binary cross-entropy. Such an simplification raises the question of whether equation (3) is over-simplified. For the supervised learning case (Section 4.1 with results in Section 5.2), where the constraints are ground truth, the global solution of our likelihood is also the solution for the original likelihood. This is because if an instance is misclassified, then it will break some pair-wise constraints in both likelihoods and no longer be optimal.
|
| 331 |
+
|
| 332 |
+
Of course, in practice, there could be two issues. First, the optimization methods for more complex models (e.g. stochastic gradient descent) may find local minima. Although it is hard to show theory for this in the general case, where local optima may be found, in such cases our visualization of the loss landscape (see Appendix A) provides some evidence that our method has a landscape that reduces poor local minima compared to prior work (KCL, Hsu et al. (2018)). The second potential issue is when constraints may be noisy. In such cases, for example, if the noise is high and there is a dependency structure to be leveraged, jointly optimizing across many or all constraints with the original likelihood may provide additional performance (at the expense of tractability). In practice, noisy constraints actually occur in our cross-task transfer learning experiments where our similarity prediction has significant errors (e.g. in Table 3 ImageNet experiments the similar pair precision, similar pair recall, dissimilar pair precision, and dissimilar pair recall are 0.812, 0.655, 0.982, and 0.992 respectively). The strong performance in terms of classification accuracy for the cross-task transfer experiments (Tables 2 and 3) shows that our simplification is robust to noise.
|
| 333 |
+
|
| 334 |
+
Overall, the fact that we have demonstrated our method on five image datasets and three application scenarios (Section 5.2 for supervised learning, 5.3 for unsupervised cross-task transfer learning, and 5.4 for semi-supervised learning) empirically support that the proposed likelihood can overcome these two issues. It would be interesting future work to develop methods that can incorporate constraints jointly, however.
|
| 335 |
+
|
| 336 |
+
# D.2 SEPARABILITY ASSUMPTIONS
|
| 337 |
+
|
| 338 |
+
Note that we assume separability of semantic categories in a dataset. This means that when the constraints are given (supervised learning), there is sufficient information (in the features) to separate or to group the samples. In the case of no given constraints (unsupervised or semi-supervised learning), there is also sufficient information to estimate the pairwise similarity. However, these are common assumptions that are inherent in discriminative models.
|
md/train/SkA-IE06W/SkA-IE06W.md
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WHEN IS A CONVOLUTIONAL FILTER EASY TO LEARN?
|
| 2 |
+
|
| 3 |
+
Simon S. Du Carnegie Mellon University ssdu@cs.cmu.edu
|
| 4 |
+
|
| 5 |
+
Jason D. Lee University of Southern California jasonlee@marshall.usc.edu
|
| 6 |
+
|
| 7 |
+
Yuandong Tian Facebook AI Research yuandong@fb.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We analyze the convergence of (stochastic) gradient descent algorithm for learning a convolutional filter with Rectified Linear Unit (ReLU) activation function. Our analysis does not rely on any specific form of the input distribution and our proofs only use the definition of ReLU, in contrast with previous works that are restricted to standard Gaussian input. We show that (stochastic) gradient descent with random initialization can learn the convolutional filter in polynomial time and the convergence rate depends on the smoothness of the input distribution and the closeness of patches. To the best of our knowledge, this is the first recovery guarantee of gradient-based algorithms for convolutional filter on non-Gaussian input distributions. Our theory also justifies the two-stage learning rate strategy in deep neural networks. While our focus is theoretical, we also present experiments that justify our theoretical findings.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep convolutional neural networks (CNN) have achieved the state-of-the-art performance in many applications such as computer vision (Krizhevsky et al., 2012), natural language processing (Dauphin et al., 2016) and reinforcement learning applied in classic games like Go (Silver et al., 2016). Despite the highly non-convex nature of the objective function, simple first-order algorithms like stochastic gradient descent and its variants often train such networks successfully. On the other hand, the success of convolutional neural network remains elusive from an optimization perspective.
|
| 16 |
+
|
| 17 |
+
When the input distribution is not constrained, existing results are mostly negative, such as hardness of learning a 3-node neural network (Blum & Rivest, 1989) or a non-overlap convolutional filter (Brutzkus & Globerson, 2017). Recently, Shamir (2016) showed learning a simple one-layer fully connected neural network is hard for some specific input distributions.
|
| 18 |
+
|
| 19 |
+
These negative results suggest that, in order to explain the empirical success of SGD for learning neural networks, stronger assumptions on the input distribution are needed. Recently, a line of research (Tian, 2017; Brutzkus & Globerson, 2017; Li & Yuan, 2017; Soltanolkotabi, 2017; Zhong et al., 2017) assumed the input distribution be standard Gaussian $N ( 0 , { \bf I } )$ and showed (stochastic) gradient descent is able to recover neural networks with ReLU activation in polynomial time.
|
| 20 |
+
|
| 21 |
+
One major issue of these analysis is that they rely on specialized analytic properties of the Gaussian distribution (c.f. Section 1.1) and thus cannot be generalized to the non-Gaussian case, in which real-world distributions fall into. For general input distributions, new techniques are needed.
|
| 22 |
+
|
| 23 |
+
In this paper we consider a simple architecture: a convolution layer, followed by a ReLU activation function, and then average pooling. Formally, we let $\mathbf { x } \in \mathbb { R } ^ { d }$ be an input sample, e.g., an image, we generate $k$ patches from $\mathbf { x }$ , each with size $p$ : $\mathbf { Z } \in \mathbb { R } ^ { p \times k }$ where the $i$ -th column is the $i$ -th patch generated by some known function ${ \bf Z } _ { i } = { \bf Z } _ { i } ( { \bf x } )$ . For a filter with size 2 and stride 1, $\mathbf { Z } _ { i } ( \mathbf { x } )$ is the $i$ -th and $( i + 1 )$ -th pixels. Since for convolutional filters, we only need to focus on the patches instead of the input, in the following definitions and theorems, we will refer $\mathbf { Z }$ as input and let $\mathcal { Z }$ as the distribution of $\mathbf { Z }$ : $( \sigma ( x ) = \operatorname* { m a x } ( x , 0 )$ is the ReLU activation function)
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: (a) Architecture of the network we are considering. Given input $X$ , we extract its patches $\{ \bar { Z } _ { i } \}$ and send them to a shared weight vector w. The outputs are then sent to ReLU and then summed to yield the final label (and its estimation). (b)-(c) Two conditions we proposed for convergence. We want the data to be (b) highly correlated and (c) concentrated more on the direction aligned with the ground truth vector $\mathbf { w } ^ { * }$ .
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
f ( \mathbf { w } , \mathbf { Z } ) = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \sigma \left( \mathbf { w } ^ { \top } \mathbf { Z } _ { i } \right) .
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
See Figure 1 (a) for a graphical illustration. Such architectures have been used as the first layer of many works in computer vision (Lin et al., 2013; Milletari et al., 2016). We address the realizable case, where training data are generated from (1) with some unknown teacher parameter $\mathbf { w } _ { \ast }$ under input distribution $\mathcal { Z }$ . Consider the $\ell _ { 2 }$ loss $\ell ( \mathbf { w } , \mathbf { Z } ) = \frac { 1 } { 2 } \left( f ( \mathbf { w } , \mathbf { Z } ) - f ( \mathbf { w } _ { * } , \mathbf { Z } ) \right) ^ { 2 }$ . We learn by (stochastic) gradient descent, i.e.,
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\mathbf { w } _ { t + 1 } = \mathbf { w } _ { t } - \eta _ { t } g ( \mathbf { w } _ { t } )
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $\eta _ { t }$ is the step size which may change over time and $g ( \mathbf { w } _ { t } )$ is a random function where its expectation equals to the population gradient $\begin{array} { r } { \mathbb { E } \left[ g ( \mathbf { w } ) \right] = \mathbb { E } _ { \mathbf { Z } \sim \mathcal { Z } } \left[ \nabla \ell \left( \mathbf { w } , \mathbf { Z } \right) \right] . } \end{array}$ The goal of our analysis is to understand the conditions where $\mathbf { w } \to \mathbf { w } _ { * }$ , if w is optimized under (stochastic) gradient descent.
|
| 39 |
+
|
| 40 |
+
In this setup, our main contributions are as follows:
|
| 41 |
+
|
| 42 |
+
• Learnability of Filters: We show if the input patches are highly correlated (Section 3), i.e., $\theta \left( \mathbf { Z } _ { i } , \mathbf { Z } _ { j } \right) \leq \rho$ for some small $\rho > 0$ , then gradient descent and stochastic gradient descent with random initialization recovers the filter in polynomial time.1 Furthermore, strong correlations imply faster convergence. To the best of our knowledge, this is the first recovery guarantee of randomly initialized gradient-based algorithms for learning filters (even for the simplest one-layer one-neuron network) on non-Gaussian input distribution, answering an open problem in (Tian, 2017).
|
| 43 |
+
|
| 44 |
+
• Distribution-Aware Convergence Rate. We formally establish the connection between the smoothness of the input distribution and the convergence rate for filter weights recovery where the smoothness in our paper is defined as the ratio between the largest and the least eigenvalues of the second moment of the activation region (Section 2). We show that a smoother input distribution leads to faster convergence, and Gaussian distribution is a special case that leads to the tightest bound. This theoretical finding also justifies the twostage learning rate strategy proposed by (He et al., 2016; Szegedy et al., 2017) if the step size is allowed to change over time.
|
| 45 |
+
|
| 46 |
+
# 1.1 RELATED WORKS
|
| 47 |
+
|
| 48 |
+
In recent years, theorists have tried to explain the success of deep learning from different perspectives. From optimization point of view, optimizing neural network is a non-convex optimization problem. Pioneered by Ge et al. (2015), a class of non-convex optimization problems that satisfy strict saddle property can be optimized by perturbed (stochastic) gradient descent in polynomial time (Jin et al., 2017).2 This motivates the research of studying the landscape of neural networks (Soltanolkotabi et al., 2017; Kawaguchi, 2016; Choromanska et al., 2015; Hardt & Ma, 2016; Haeffele & Vidal, 2015; Mei et al., 2016; Freeman & Bruna, 2016; Safran & Shamir, 2016; Zhou & Feng, 2017; Nguyen & Hein, 2017) However, these results cannot be directly applied to analyzing the convergence of gradient-based methods for ReLU activated neural networks.
|
| 49 |
+
|
| 50 |
+
From learning theory point of view, it is well known that training a neural network is hard in the worst cases (Blum & Rivest, 1989; Livni et al., 2014; Sˇ´ıma, 2002; Shalev-Shwartz et al., 2017a;b) and recently, Shamir (2016) showed either “niceness” of the target function or of the input distribution alone is sufficient for optimization algorithms used in practice to succeed. With some additional assumptions, many works tried to design algorithms that provably learn a neural network with polynomial time and sample complexity (Goel et al., 2016; Zhang et al., 2016; 2015; Sedghi & Anandkumar, 2014; Janzamin et al., 2015; Gautier et al., 2016; Goel & Klivans, 2017). However, these algorithms are tailored for certain architecture and cannot explain why (stochastic) gradient based optimization algorithms work well in practice.
|
| 51 |
+
|
| 52 |
+
Focusing on gradient-based algorithms, a line of research analyzed the behavior of (stochastic) gradient descent for Gaussian input distribution. Tian (2017) showed population gradient descent is able to find the true weight vector with random initialization for one-layer one-neuron model. Brutzkus & Globerson (2017) showed population gradient descent recovers the true weights of a convolution filter with non-overlapping input in polynomial time. Li & Yuan (2017) showed SGD can recover the true weights of a one-layer ResNet model with ReLU activation under the assumption that the spectral norm of the true weights is bounded by a small constant. All the methods use explicit formulas for Gaussian input, which enable them to apply trigonometric inequalities to derive the convergence. With the same Gaussian assumption, Soltanolkotabi (2017) shows that the true weights can be exactly recovered by projected gradient descent with enough samples in linear time, if the number of inputs is less than the dimension of the weights.
|
| 53 |
+
|
| 54 |
+
Other approaches combine tensor approaches with assumptions of input distribution. Zhong et al. (2017) proved that with sufficiently good initialization, which can be implemented by tensor method, gradient descent can find the true weights of a 3-layer fully connected neural network. However, their approach works with known input distributions. Soltanolkotabi (2017) used Gaussian width (c.f. Definition 2.2 of (Soltanolkotabi, 2017)) for concentrations and his approach cannot be directly extended to learning a convolutional filter.
|
| 55 |
+
|
| 56 |
+
In this paper, we adopt a different approach that only relies on the definition of ReLU. We show as long as the input distribution satisfies weak smoothness assumptions, we are able to find the true weights by SGD in polynomial time. Using our conclusions, we can justify the effectiveness of large amounts of data (which may eliminate saddle points), two-stage and adaptive learning rates used by He et al. (2016); Szegedy et al. (2017), etc.
|
| 57 |
+
|
| 58 |
+
# 1.2 ORGANIZATION
|
| 59 |
+
|
| 60 |
+
This paper is organized as follows. In Section 2, we analyze the simplest one-layer one-neuron model where we state our key observation and establish the connection between smoothness and convergence rate. In Section 3, we discuss the performance of (stochastic) gradient descent for learning a convolutional filter. We provide empirical illustrations in Section 4 and conclude in Section 5. We place most of our detailed proofs in the Appendix.
|
| 61 |
+
|
| 62 |
+
# 1.3 NOTATIONS
|
| 63 |
+
|
| 64 |
+
Let $\left\| \cdot \right\| _ { 2 }$ denote the Euclidean norm of a finite-dimensional vector. For a matrix A, we use $\lambda _ { \mathrm { m a x } }$ (A) to denote its largest singular value and $\lambda _ { \operatorname* { m i n } } \left( \mathbf { A } \right)$ its smallest singular value. Note if A is a positive semidefinite matrix, $\lambda _ { \operatorname* { m a x } } \left( \mathbf { A } \right)$ and $\lambda _ { \operatorname* { m i n } } \left( \mathbf { A } \right)$ represent the largest and smallest eigenvalues of $\mathbf { A }$ , respectively. Let $O ( \cdot )$ and $\Theta ( \cdot )$ denote the standard Big-O and Big-Theta notations that hide absolute constants. We assume the gradient function is uniformly bounded, i.e., There exists $B > 0$ such that $\| g ( \mathbf { w } ) \| _ { 2 } \leq B$ . This condition is satisfied as long as patches, w and noise are all bounded.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: (a) The four regions considered in our analysis. $\mathbf { ( b ) }$ Illustration of $L \left( \phi \right) , \gamma ( \phi )$ and $L _ { - \mathbf { w } _ { * } } ( \phi )$ defined in Definition 2.1 and Assumption 2.1.
|
| 68 |
+
|
| 69 |
+
# 2 WARM UP: ANALYZING ONE-LAYER ONE-NEURON MODEL
|
| 70 |
+
|
| 71 |
+
Before diving into the convolutional filter, we first analyze the special case for $k = 1$ , which is equivalent to the one-layer one-neuron architecture. The analysis in this simple case will give us insights for the fully general case. For the ease of presentation, we define following two events and corresponding second moments
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r l } & { S ( \mathbf { w } , \mathbf { w } _ { * } ) = \left\{ \mathbf { Z } : \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} , \quad S ( \mathbf { w } , - \mathbf { w } _ { * } ) = \left\{ \mathbf { Z } : \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right\} , } \\ & { \qquad \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } = \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) \right\} \right] , \quad \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } = \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ S ( \mathbf { w } , - \mathbf { w } _ { * } ) \right\} \right] . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\mathbb { I } \left\{ \cdot \right\}$ is the indicator function. Intuitively, $S ( \mathbf { w } , \mathbf { w } _ { * } )$ is the joint activation region of w and $\mathbf { w } _ { \ast }$ and $S ( \mathbf { w } , - \mathbf { w } _ { * } )$ is the joint activation region of w and $- \mathbf { w } _ { \ast }$ . See Figure 2 (a) for the graphical illustration. With some simple algebra we can derive the population gradient.
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \mathbb { E } \left[ \nabla \ell \left( \mathbf { w } , \mathbf { Z } \right) \right] = \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \left( \mathbf { w } - \mathbf { w } _ { * } \right) + \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w } . } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
One key observation is we can write the inner product $\left. \nabla _ { \mathbf { w } } \ell \left( \mathbf { w } \right) , \mathbf { w } - \mathbf { w } _ { * } \right.$ as the sum of two non-negative terms (c.f. Lemma A.1). This observation directly leads to the following Theorem 2.1.
|
| 84 |
+
|
| 85 |
+
Theorem 2.1. Suppose for any $\mathbf { w } _ { 1 } , \mathbf { w } _ { 2 }$ with $\theta \left( \mathbf { w } _ { 1 } , \mathbf { w } _ { 2 } \right) < \pi$ , E $\mathbf { \sigma } _ { : } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) \right\} \right] \succ 0$ and the initialization $\mathbf { w } _ { 0 }$ satisfies $\ell \left( \mathbf { w } _ { 0 } \right) < \ell \left( \mathbf { 0 } \right)$ then gradient descent algorithm recovers $\mathbf { w } _ { \ast }$ .
|
| 86 |
+
|
| 87 |
+
The first assumption is about the non-degeneracy of input distribution. For $\theta \left( \mathbf { w } _ { 1 } , \mathbf { w } _ { 2 } \right) < \pi$ , one case that the assumption fails is that the input distribution is supported on a low-dimensional space, or degenerated. The second assumption on the initialization is to ensure that gradient descent does not converge to ${ \bf w } = { \bf 0 }$ , at which the gradient is undefined. This is a general convergence theorem that holds for a wide class of input distribution and initialization points. In particular, it includes Theorem 6 of (Tian, 2017) as a special case. If the input distribution is degenerate, i.e., there are holes in the input space, the gradient descent may stuck around saddle points and we believe more data are needed to facilitate the optimization procedure This is also consistent with empirical evidence in which more data are helpful for optimization.
|
| 88 |
+
|
| 89 |
+
# 2.1 CONVERGENCE RATE OF ONE-LAYER ONE-NEURON MODEL
|
| 90 |
+
|
| 91 |
+
In the previous section we showed if the distribution is regular and the weights are initialized appropriately, gradient descent recovers the true weights when it converges. In practice we also want to know how many iterations are needed. To characterize the convergence rate, we need some quantitative assumptions. We note that different set of assumptions will lead to a different rate and ours is only one possible choice. In this paper we use the following quantities.
|
| 92 |
+
|
| 93 |
+
Definition 2.1 (The Largest/Smallest eigenvalue Values of the Second Moment on Intersection of two Half Spaces). For $\phi \in [ 0 , \pi ]$ , define
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\gamma ( \phi ) = \operatorname* { m i n } _ { \mathbf { w } : \mathcal { L } \mathbf { w } , \mathbf { w } _ { * } = \phi } \lambda _ { \operatorname* { m i n } } \left( \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \right) , \quad L ( \phi ) = \operatorname* { m a x } _ { \mathbf { w } : \mathcal { L } \mathbf { w } , \mathbf { w } _ { * } = \phi } \lambda _ { \operatorname* { m a x } } \left( \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \right) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
These two conditions quantitatively characterize the angular smoothness of the input distribution. For a given angle $\phi$ , if the difference between $\gamma ( \phi )$ and $L ( \phi )$ is large then there is one direction has large probability mass and one direction has small probability mass, meaning the input distribution is not smooth. On the other hand, if $\gamma ( \phi )$ and $L ( \phi )$ are close, then all directions have similar probability mass, which means the input distribution is smooth. The smoothest input distributions are rotationally invariant distributions (e.g. standard Gaussian) which have $\gamma ( \phi ) \ : = \ : L ( \phi )$ . For analogy, we can think of $L ( \phi )$ as Lipschitz constant of the gradient and $\gamma ( \phi )$ as the strong convexity parameter in the optimization literature but here we also allow they change with the angle. Also observe that when $\phi = \pi$ , $\gamma ( \phi ) = L ( \phi ) = 0$ because the intersection has measure 0 and both $\gamma ( \phi )$ and $L ( \phi )$ are monotonically decreasing.
|
| 100 |
+
|
| 101 |
+
Our next assumption is on the growth of $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } }$ . Note that when $\boldsymbol { \theta } \left( \mathbf { w } , \mathbf { w } _ { * } \right) = 0$ , then ${ \bf A } _ { { \bf w } , - { \bf w } _ { * } } =$ 0 because the intersection between w and $- \mathbf { w } _ { \ast }$ has 0 measure. Also, $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } }$ grows as the angle between w and $\mathbf { w } _ { \ast }$ becomes larger.
|
| 102 |
+
|
| 103 |
+
In the following, we assume the operator norm of $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } }$ increases smoothly with respect to the angle. The intuition is that as long as input distribution bounded probability density with respect to the angle, the operator norm of $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } }$ is bounded. We show in Theorem A.1 that $\beta = 1$ for rotational invariant distribution and in Theorem A.2 that $\beta = p$ for standard Gaussian distribution.
|
| 104 |
+
|
| 105 |
+
Assumption 2.1. We assume there exists $\beta ~ > ~ 0$ that for $0 ~ \leq ~ \phi ~ \leq ~ \pi / 2 ,$ , $L _ { - w _ { * } } ( \phi )$ , $\begin{array} { r } { \operatorname* { m a x } _ { \mathbf { w } , \theta ( \mathbf { w } , \mathbf { w } _ { * } ) \leq \phi } \lambda _ { \operatorname* { m a x } } \left( \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \right) \leq \beta \phi } \end{array}$ .
|
| 106 |
+
|
| 107 |
+
Now we are ready to state the convergence rate.
|
| 108 |
+
|
| 109 |
+
Theorem 2.2. Suppose the initialization $\mathbf { w } _ { 0 }$ satisfies $\left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } ~ < ~ \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ . Denote $\phi _ { t } ~ =$ $\begin{array} { r } { \arcsin \left( \frac { \| \mathbf { w _ { t } } - \mathbf { w _ { * } } \| _ { 2 } } { \| \mathbf { w _ { * } } \| _ { 2 } } \right) } \end{array}$ then if step size is set as $\begin{array} { r } { 0 \leq \eta _ { t } \leq \operatorname* { m i n } _ { 0 \leq \phi \leq \phi _ { t } } \frac { \gamma ( \phi ) } { 2 ( L ( \phi ) + 4 \beta ) ^ { 2 } } } \end{array}$ , we have for $t = 1 , 2 , \dots$
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \leq \left( 1 - \frac { \eta _ { t } \gamma \left( \phi _ { t } \right) } { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Note both $\gamma ( \phi )$ and $L ( \phi )$ increases as $\phi$ decreases so we can choose a constant step size $\begin{array} { r } { \eta _ { t } \ = \ \Theta \left( \frac { \gamma ( \phi _ { 0 } ) } { ( L ( 0 ) + \beta ) ^ { 2 } } \right) } \end{array}$ This theorem implies that we can find the $\epsilon$ -close solution of $\mathbf { w } _ { \ast }$ in $\begin{array} { r } { O \left( \frac { ( L ( 0 ) + \beta ) ^ { 2 } } { \gamma ^ { 2 } ( \phi _ { 0 } ) } \log \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations. It also suggests a direct relation between the smoothness of the distribution and the convergence rate. For smooth distribution where $\gamma ( \phi )$ and $L ( \phi )$ are close and $\beta$ is small then $\frac { ( L ( 0 ) + \beta ) ^ { 2 } } { \gamma ^ { 2 } ( \phi _ { 0 } ) }$ is relatively small and we need fewer iterations. On the other hand, if $L ( \phi )$ or $\beta$ is much larger than $\gamma ( \phi )$ , we will need more iterations. We verify this intuition in Section 4.
|
| 116 |
+
|
| 117 |
+
If we are able to choose the step sizes adaptively $\begin{array} { r } { \eta _ { t } \ = \ \Theta \left( \frac { \gamma ( \phi _ { t } ) } { ( L ( \phi _ { t } ) + \beta ) ^ { 2 } } \right) } \end{array}$ γ(φt)(L(φt)+β)2 , like using methods proposed by Lin & Xiao (2014), we may improve the computational complexity to $\begin{array} { r } { O \left( \operatorname* { m a x } _ { \phi \leq \phi _ { 0 } } \frac { \left( L \left( \phi \right) + \beta \right) ^ { 2 } } { \gamma ^ { 2 } \left( \phi \right) } \log \left( \frac { 1 } { \epsilon } \right) \right) , } \end{array}$ 0 (L(φ)+β)2γ2(φ) log 1 . This justifies the use of two-stage learning rate strategy proposed by He et al. (2016); Szegedy et al. (2017) where at the beginning we need to choose learning to be small because $\frac { \gamma ( \phi _ { 0 } ) } { 2 ( L ( \phi _ { 0 } ) + 2 \beta ) ^ { 2 } }$ is small and later we can choose a large learning rate because as the angle between $\mathbf { w } _ { t }$ and $\mathbf { w } _ { \ast }$ becomes smaller, $\frac { \gamma ( \phi _ { t } ) } { 2 ( L ( \phi _ { t } ) + 2 \beta ) ^ { 2 } }$ becomes bigger.
|
| 118 |
+
|
| 119 |
+
The theorem requires the initialization satisfying $\left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } < \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ , which can be achieved by random initialization with constant success probability. See Section 3.2 for a detailed discussion.
|
| 120 |
+
|
| 121 |
+
# 3 MAIN RESULTS FOR LEARNING A CONVOLUTIONAL FILTER
|
| 122 |
+
|
| 123 |
+
In this section we generalize ideas from the previous section to analyze the convolutional filter. First, for given w and $\mathbf { w } _ { \ast }$ we define four events that divide the input space of each patch $\mathbf { Z } _ { i }$ . Each event
|
| 124 |
+
|
| 125 |
+
corresponds to a different activation region induced by w and $\mathbf { w } _ { \ast }$ , similar to (3).
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r } { { \cal S } ( { \bf w } , { \bf w } _ { \ast } ) _ { i } = \left\{ { \bf Z } _ { i } : { \bf w } ^ { \top } { \bf Z } _ { i } \geq 0 , { \bf w } _ { \ast } ^ { \top } { \bf Z } _ { i } \geq 0 \right\} , \quad { \cal S } ( { \bf w } , - { \bf w } _ { \ast } ) _ { i } = \left\{ { \bf Z } _ { i } : { \bf w } ^ { \top } { \bf Z } _ { i } \geq 0 , { \bf w } _ { \ast } ^ { \top } { \bf Z } _ { i } \leq 0 \right\} , } \\ { \left. \right\} ( - { \bf w } , - { \bf w } _ { \ast } ) _ { i } = \left\{ { \bf Z } _ { i } : { \bf w } ^ { \top } { \bf Z } _ { i } \leq 0 , { \bf w } _ { \ast } ^ { \top } { \bf Z } _ { i } \leq 0 \right\} , \quad { \cal S } ( - { \bf w } , { \bf w } _ { \ast } ) _ { i } = \left\{ { \bf Z } _ { i } : { \bf w } ^ { \top } { \bf Z } _ { i } \leq 0 , { \bf w } _ { \ast } ^ { \top } { \bf Z } _ { i } \geq 0 \right\} . } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Please check Figure 2 (a) again for illustration. For the ease of presentation we also define the average over all patches in each region
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l r } { { \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} , \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } \} , } } \\ & { } & { \mathbf { Z } _ { S ( - \mathbf { w } , \mathbf { w } _ { * } ) } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathbf { Z } _ { i } \mathbb { I } \{ S ( - \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Next, we generalize the smoothness conditions analogue to Definition 2.1 and Assumption 2.1. Here the smoothness is defined over the average of patches.
|
| 138 |
+
|
| 139 |
+
Assumption 3.1. For $\phi \in [ 0 , \pi ]$ , define
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r } { \gamma ( \phi ) = \underset { \mathbf { w } : \theta ( \mathbf { w } , \mathbf { w } _ { * } ) = \phi } { \operatorname* { m i n } } \lambda _ { \operatorname* { m i n } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } ^ { \top } \right] \right) , } \\ { L ( \phi ) = \underset { \mathbf { w } : \theta ( \mathbf { w } , \mathbf { w } _ { * } ) = \phi } { \operatorname* { m a x } } \lambda _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } ^ { \top } \right] \right) . } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
We assume for all $0 \leq \phi \leq \pi / 2 , \operatorname* { m a x } _ { \mathbf { w } : \theta ( \mathbf { w } , \mathbf { w } _ { * } ) = \phi } \lambda _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } ^ { \top } \right] \right) \leq \beta \phi$ for some $\beta > 0$ .
|
| 146 |
+
|
| 147 |
+
The main difference between the simple one-layer one-neuron network and the convolution filter is two patches may appear in different regions. For a given sample, there may exists patch $\mathbf { Z } _ { i }$ and $\mathbf { Z } _ { j }$ such that $\mathbf { Z } _ { i } \in S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i }$ and $\mathbf Z _ { j } \in \bar { S } ( \mathbf w , - \mathbf w _ { * } ) _ { j }$ and their interaction plays an important role in the convergence of (stochastic) gradient descent. Here we assume the second moment of this interaction, i.e., cross-covariance, also grows smoothly with respect to the angle.
|
| 148 |
+
|
| 149 |
+
Assumption 3.2. We assume there exists $L _ { c r o s s } > 0$ such that
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r l r } { \displaystyle \operatorname* { m a x } _ { \mathbf { w } : \boldsymbol { \theta } ( \mathbf { w } , \mathbf { w } _ { * } ) \leq \boldsymbol { \phi } } \lambda _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } ^ { \top } \right] \right) + \lambda _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( - \mathbf { w } , \mathbf { w } _ { * } ) } ^ { \top } \right] \right) } & \\ & { } & { + \lambda _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( - \mathbf { w } , \mathbf { w } _ { * } ) } ^ { \top } \right] \right) \leq L _ { c r o s s } \boldsymbol { \phi } . } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
First note if $\phi = 0$ , then ${ \mathbf { Z } } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) }$ and ${ \mathbf { Z } } _ { S ( - \mathbf { w } , \mathbf { w } _ { * } ) }$ has measure 0 and this assumption models the growth of cross-covariance. Next note this $L _ { c r o s s }$ represents the closeness of patches. If $\mathbf { Z } _ { i }$ and $\mathbf { Z } _ { j }$ are very similar, then the joint probability density of $\mathbf Z _ { i } \in S ( \mathbf w , \mathbf w _ { * } ) _ { i }$ and $\mathbf Z _ { j } \in S ( \mathbf w , - \mathbf w _ { * } ) _ { j }$ is small which implies $L _ { c r o s s }$ is small. In the extreme setting, $\mathbf { Z } _ { 1 } = \ldots = \mathbf { Z } _ { k }$ , we have $L _ { \mathrm { c r o s s } } \doteq 0$ because in this case the events $\{ \mathbf { Z } _ { i } \in S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} \cap \{ \mathbf { Z } _ { j } \in S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } \}$ , $\{ \mathbf { Z } _ { i } \in S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} \cap$ $\{ \mathbf { Z } _ { j } \in S ( - \mathbf { w } , \mathbf { w } _ { * } ) _ { j } \}$ and $\{ \mathbf { Z } _ { i } \in S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } \} \cap \{ \mathbf { Z } _ { j } \in S ( - \mathbf { w } , \mathbf { w } _ { * } ) _ { j } \}$ all have measure 0.
|
| 156 |
+
|
| 157 |
+
Now we are ready to present our result on learning a convolutional filter by gradient descent.
|
| 158 |
+
|
| 159 |
+
Theorem 3.1. If the initialization satisfies $\begin{array} { r l r } { \| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \| _ { 2 } } & { { } < } & { \| \mathbf { w } _ { * } \| _ { 2 } } \end{array}$ and denote $\begin{array} { r l } { \phi _ { t } } & { { } = } \end{array}$ $\begin{array} { r } { \arcsin \left( \frac { \| \mathbf { w } _ { t } - \mathbf { w } _ { * } \| _ { 2 } } { \| \mathbf { w } _ { * } \| _ { 2 } } \right) } \end{array}$ tisfies , we ha $\begin{array} { r l r } { \gamma ( \phi _ { 0 } ) } & { { } > } & { 6 L _ { \mathrm { c r o s s } } } \end{array}$ $i f$ $\eta _ { t }$ ≤ $\begin{array} { r } { \operatorname* { m i n } _ { 0 \leq \phi \leq \phi _ { t } } \frac { \gamma ( \phi ) - 6 L _ { \mathrm { c r o s s } } } { 2 ( L ( \phi ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) ^ { 2 } } } \end{array}$ $t = 1 , 2 , \dots$ $\begin{array} { r } { \phi _ { t } \triangleq \arcsin \left( \frac { \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) } \end{array}$
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \leq \left( 1 - \frac { \eta ( \gamma ( \phi _ { t } ) - 6 L _ { \mathrm { c r o s s } } ) } { 2 } \right) \| \mathbf { w } _ { t } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 }
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Our theorem suggests if the initialization satisfies $\gamma ( \phi _ { 0 } ) ~ > ~ 6 L _ { \mathrm { c r o s s } }$ , we obtain linear convergence rate. In Section 3.1, we give a concrete example showing closeness of patches implies large $\gamma ( \phi )$ and small $L _ { \mathrm { c r o s s } }$ . Similar to Theorem 2.2, if the step size is chosen so that $\eta _ { t } =$ find the γ(φ0)−6Lcross(LS(w,w∗)(0)+10Lcross+4β)2 , in O γ(φ0)−6LcrossLS(w,w∗)(0)+10Lcross+4β 2 log 1 iterations, we can
|
| 166 |
+
|
| 167 |
+
In practice,we never get a true population gradient but only stochastic gradient $g ( \mathbf { w } )$ (c.f. Equation (2)). The following theorem shows SGD also recovers the underlying filter.
|
| 168 |
+
|
| 169 |
+
Theorem 3.2. Let $\phi _ { * } ~ = ~ \mathrm { a r g m a x } _ { \phi } \gamma ( \phi ) ~ \ge ~ 6 L _ { \mathrm { c r o s s } }$ . Denote ${ r _ { 0 } } ~ = ~ \left\| { \bf w } _ { 0 } - { \bf w } _ { * } \right\| _ { 2 } , ~ \phi _ { 0 } ~ =$ $\arcsin { \left( \frac { r _ { 0 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) }$ $\begin{array} { r } { \phi _ { 1 } = \frac { \phi _ { * } + \phi _ { 0 } } { 2 } } \end{array}$ $\epsilon$ $\begin{array} { r } { \eta _ { t } = \Theta \left( \frac { \epsilon ^ { 2 } ( \gamma ( \phi _ { 1 } ) - 6 L _ { \mathrm { c r o s s } } ) ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } } { B ^ { 2 } } \right) } \end{array}$ , then we have in T = O B22(γ(φ1)−6Lcross)2kw∗k22 l
|
| 170 |
+
least $1 - \delta$ we have $\left\| \mathbf { w } _ { T } - \mathbf { w } _ { * } \right\| \leq \epsilon \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ .
|
| 171 |
+
|
| 172 |
+
Unlike the vanilla gradient descent case, here the convergence rate depends on $\phi _ { 1 }$ instead of $\phi _ { 0 }$ . This is because of the randomness in SGD and we need a more robust initialization. We choose $\phi _ { 1 }$ to be the average of $\phi _ { 0 }$ and $\phi _ { * }$ for the ease of presentation. As will be apparent in the proof we only require $\phi _ { 0 }$ not very close to $\phi _ { * }$ . The proof relies on constructing a martingale and use Azuma-Hoeffding inequality and this idea has been previously used by Ge et al. (2015).
|
| 173 |
+
|
| 174 |
+
3.1 WHAT DISTRIBUTION IS EASY FOR SGD TO LEARN A CONVOLUTIONAL FILTER?
|
| 175 |
+
|
| 176 |
+
Different from One-Layer One-Neuron model, here we also requires the Lipschitz constant for closeness $L _ { \mathrm { c r o s s } }$ to be relatively small and $\gamma ( \phi _ { 0 } )$ to be relatively large. A natural question is: What input distributions satisfy this condition?
|
| 177 |
+
|
| 178 |
+
Here we give an example. We show if (1) patches are close to each other (2) the input distribution has small probability mass around the decision boundary then the assumption in Theorem 3.1 is satisfied. See Figure 1 (b)-(c) for the graphical illustrations.
|
| 179 |
+
|
| 180 |
+
Theorem 3.3. Denote $\begin{array} { r } { { \bf Z } _ { a v g } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } { \bf Z } _ { i } } \end{array}$ . Suppose all patches have unit norm 3 and for all for all $i , \theta \left( { \bf Z } _ { i } , { \bf Z } _ { a v g } \right) \leq \rho .$ . Further assume there exists $L \geq 0$ such that for any $\phi \le \rho$ and for all $\mathbf { Z } _ { i }$
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\mathbb { P } \left[ \theta \left( \mathbf { Z } _ { i } , \mathbf { w } _ { * } \right) \in \left[ \frac { \pi } { 2 } - \phi , \frac { \pi } { 2 } + \phi \right] \right] \leq \mu \phi , \quad \mathbb { P } \left[ \theta \left( \mathbf { Z } _ { i } , \mathbf { w } _ { * } \right) \in - \left[ \frac { \pi } { 2 } - \phi , - \frac { \pi } { 2 } + \phi \right] \right] \leq \mu \phi ,
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
then we have
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\begin{array} { c } { \gamma \left( \phi _ { 0 } \right) \geq \gamma _ { a v g } \left( \phi _ { 0 } \right) - 4 \left( 1 - \cos \rho \right) a n d L _ { \mathrm { c r o s s } } \leq 3 \mu . } \\ { { \mathrm { } } } \\ { \gamma _ { a v g } ( \phi _ { 0 } ) = \sigma _ { \operatorname* { m i n } } \left( \mathbb { E } \left[ { \mathbf Z } { \mathbf Z } ^ { \top } \mathbb { I } \left\{ { \mathbf w } _ { 0 } ^ { \top } { \mathbf Z } \geq 0 , { \mathbf w } _ { * } ^ { \top } { \mathbf Z } \geq 0 \right\} \right] \right) , a n a l o g u e t o D e f i n i t i o n 2 . I . } \end{array}
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Several comments are in sequel. We view $\rho$ as a quantitative measure of the closeness between different patches, i.e., $\rho$ small means they are similar. This lower bound is monotonically decreasing as a function of $\rho$ and note when $\rho = 0$ , $\dot { \sigma } _ { \mathrm { m i n } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) } ^ { \top } \right] \right) = \gamma _ { a v g } ( \phi _ { 0 } )$ which recovers Definition 2.1.
|
| 193 |
+
|
| 194 |
+
For the upper bond on $L _ { \mathrm { c r o s s } }$ , $\mu$ represents the upper bound of the probability density around the decision boundary. For example if $\mathbb { P } \left[ \theta \left( \mathbf { Z } _ { i } , \mathbf { w } _ { * } \right) ^ { \star } \in \left[ \frac { \pi } { 2 } - \phi , \frac { \pi } { 2 } + \phi \right] \right] \propto \phi ^ { 2 }$ , then for $\phi$ in a small neighborhood around $\pi / 2$ , say radius $\epsilon$ , we have $\begin{array} { r } { \mathbb { P } \left[ \theta \left( \mathbf { Z } _ { i } , \mathbf { w } _ { * } \right) \in \left[ \frac { \pi } { 2 } - \phi , \frac { \pi } { 2 } + \phi \right] \right] \lesssim \epsilon \phi } \end{array}$ . This assumption is usually satisfied in real world examples like images because the image patches are not usually close to the decision boundary. For example, in computer vision, the local image patches often form clusters and is not evenly distributed over the appearance space. Therefore, if we use linear classifier to separate their cluster centers from the rest of the clusters, near the decision boundary the probability mass should be very low.
|
| 195 |
+
|
| 196 |
+
# 3.2 THE POWER OF RANDOM INITIALIZATION
|
| 197 |
+
|
| 198 |
+
For one-layer one-neuron model, we need initialization $\left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } < \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ and for the convolution filter, we need a stronger initialization $\lVert \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \rVert _ { 2 } < \lVert \mathbf { w } _ { * } \rVert _ { 2 } \cos \left( \phi _ { * } \right)$ . The following theorem
|
| 199 |
+
|
| 200 |
+
shows with uniformly random initialization we have constant probability to obtain a good initialization. Note with this theorem at hand, we can boost the success probability to arbitrary close to 1 by random restarts. The proof is similar to (Tian, 2017).
|
| 201 |
+
|
| 202 |
+
Theorem 3.4. If we uniformly sample $\mathbf { w } _ { 0 }$ from a $p$ -dimensional ball with radius $\alpha \Vert \mathbf { w } _ { * } \Vert$ so that $\alpha \leq \sqrt { \frac { 1 } { 2 \pi p } }$ , then with probability at least $\begin{array} { r } { { \frac { 1 } { 2 } } - { \sqrt { \frac { \pi p } { 2 } } } \alpha } \end{array}$ , we have $\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \| _ { 2 } \leq \sqrt { 1 - \alpha ^ { 2 } } \| \mathbf { w } _ { * } \|$ .
|
| 203 |
+
|
| 204 |
+
To apply this general initialization theorem to our convolution filter case, we can choose $\alpha = \cos \phi _ { * }$ Therefore, with some simple algebra we have the following corollary.
|
| 205 |
+
|
| 206 |
+
Corollary 3.1. Suppose $\begin{array} { r } { \cos \left( \phi _ { * } \right) < \frac { 1 } { \sqrt { 8 \pi p } } } \end{array}$ , then $i f \mathbf { w } _ { 0 }$ is uniformly sampled from a ball with center 0 and radius $\left\| \mathbf { w } _ { * } \right\| \cos \left( \phi _ { * } \right)$ , we have with probability at least $\begin{array} { r } { \frac { 1 } { 2 } - \cos \left( \phi _ { * } \right) \sqrt { \frac { \pi p } { 2 } } > \frac { 1 } { 4 } } \end{array}$ .
|
| 207 |
+
|
| 208 |
+
The assumption of this corollary is satisfied if the patches are close to each other as discussed in the previous section.
|
| 209 |
+
|
| 210 |
+
# 4 EXPERIMENTS
|
| 211 |
+
|
| 212 |
+
In this section we use simulations to verify our theoretical findings. We first test how the smoothness affect the convergence rate in one-layer one-neuron model described in Section 2 To construct input distribution with different $L ( \phi ) , \gamma ( \phi )$ and $\beta$ (c.f. Definition 2.1 and Assumption 2.1), we fix the patch to have unit norm and use a mixture of truncated Gaussian distribution to model on the angle around $\mathbf { w } _ { \ast }$ and around the $- \mathbf { w } _ { \ast }$ Specifically, the probability density of $\angle \mathbf { Z } , \mathbf { w } _ { \ast }$ is sampled from $\begin{array} { r } { \frac { 1 } { 2 } N ( 0 , \sigma ) \mathbb { I } _ { [ - \pi / 2 , \pi / 2 ] } + \frac { 1 } { 2 } N ( - \pi , \sigma ) \mathbb { \hat { I } } _ { [ - \pi / 2 , \pi / 2 ] } } \end{array}$ . Note by definitions of $L ( \phi )$ and $\gamma ( \phi )$ if $\sigma 0$ the probability mass is centered around $\mathbf { w } _ { \ast }$ , so the distribution is very spiky and $L ( \phi ) / \gamma ( \phi )$ and $\beta$ will be large. On the other hand, if $\sigma \infty$ , then input distribution is close to the rotation invariant distribution and $L ( \phi ) / \gamma ( \phi )$ and $\beta$ will be small. Figure 3a verifies our prediction where we fix the initialization and step size.
|
| 213 |
+
|
| 214 |
+
Next we test how the closeness of patches affect the convergence rate in the convolution setting. We first generate a single patch $\widetilde { \mathbf { Z } }$ using the above model with $\sigma = 1$ , then generate each unit norm $\mathbf { Z } _ { i }$ whose angle with $\bar { \bf z }$ , $\angle \mathbf { Z } _ { i } , \tilde { \mathbf { Z } }$ is sampled from $\mathcal { L } \mathbf { Z } _ { i } , \widetilde { \mathbf { Z } } \sim N ( 0 , \sigma _ { 2 } ) \mathbb { I } _ { [ - \pi , \pi ) }$ . Figure 3b shows as variance between patches becomes smaller, we obtain faster convergence rate, which coincides with Theorem 3.1.
|
| 215 |
+
|
| 216 |
+
We also test whether SGD can learn a filter on real world data. Here we choose MNIST data and generate labels using two filters. One is random filter where each entry is sampled from a standard Gaussian distribution (Figure 4a) and the other is a Gabor filter (Figure 4b). Figure 3a and Figure 3c show convergence rates of SGD with different initializations. Here, better initializations give faster rates, which coincides our theory. Note that here we report the relative loss, logarithm of squared error divided by the square of mean of data points instead of the difference between learned filter and true filter because we found SGD often cannot converge to the exact filter but rather a filter with near zero loss. We believe this is because the data are approximately lying in a low dimensional manifold in which the learned filter and the true filter are equivalent. To justify this conjecture, we try to interpolate the learned filter and the true filter linearly and the result filter has similar low loss (c.f. Figure 5). Lastly, we visualize the true filters and the learned filters in Figure 4 and we can see that the they have similar patterns.
|
| 217 |
+
|
| 218 |
+
# 5 CONCLUSIONS AND FUTURE WORKS
|
| 219 |
+
|
| 220 |
+
In this paper we provide the first recovery guarantee of (stochastic) gradient descent algorithm with random initialization for learning a convolution filter when the input distribution is not Gaussian. Our analyses only used the definition of ReLU and some mild structural assumptions on the input distribution. Here we list some future directions.
|
| 221 |
+
|
| 222 |
+
One possibility is to extend our result to deeper and wider architectures. Even for two-layer fullyconnected network, the convergence of (stochastic) gradient descent with random initialization is not known. Existing results either requires sufficiently good initialization (Zhong et al., 2017) or relies on special architecture (Li & Yuan, 2017). However, we believe the insights from this paper is helpful to understand the behaviors of gradient-based algorithms in these settings.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 3: Convergence rates of SGD (a) with different smoothness where larger $\sigma$ is smoother; (b) with different closeness of patches where smaller $\sigma _ { 2 }$ is closer; (c) for a learning a random filter with different initialization on MNIST data; ${ \bf \Pi } ( { \bf d } )$ for a learning a Gabor filter with different initialization on MNIST data.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 4: Visualization of true and learned filters. For each pair, the left one is the underlying truth and the right is the filter learned by SGD.
|
| 229 |
+
|
| 230 |
+
Another direction is to consider the agnostic setting, where the label is not equal to the output of a neural network. This will lead to different dynamics of (stochastic) gradient descent and we may need to analyze the robustness of the optimization procedures. This problem is also related to the expressiveness of the neural network (Raghu et al., 2016) where if the underlying function is not equal bot is close to a neural network. We believe our analysis can be extend to this setting.
|
| 231 |
+
|
| 232 |
+
# REFERENCES
|
| 233 |
+
|
| 234 |
+
Avrim Blum and Ronald L Rivest. Training a 3-node neural network is np-complete. In Advances in neural information processing systems, pp. 494–501, 1989.
|
| 235 |
+
|
| 236 |
+
Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. arXiv preprint arXiv:1702.07966, 2017.
|
| 237 |
+
|
| 238 |
+
Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The´ loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pp. 192–204, 2015.
|
| 239 |
+
|
| 240 |
+
Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016.
|
| 241 |
+
|
| 242 |
+
Simon S Du, Chi Jin, Jason D Lee, Michael I Jordan, Barnabas Poczos, and Aarti Singh. Gradient descent can take exponential time to escape saddle points. arXiv preprint arXiv:1705.10412, 2017.
|
| 243 |
+
|
| 244 |
+
C Daniel Freeman and Joan Bruna. Topology and geometry of half-rectified network optimization. arXiv preprint arXiv:1611.01540, 2016.
|
| 245 |
+
|
| 246 |
+
Antoine Gautier, Quynh N Nguyen, and Matthias Hein. Globally optimal training of generalized polynomial neural networks with nonlinear spectral methods. In Advances in Neural Information Processing Systems, pp. 1687–1695, 2016.
|
| 247 |
+
|
| 248 |
+
Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle pointsonline stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pp. 797–842, 2015.
|
| 249 |
+
|
| 250 |
+
Surbhi Goel and Adam Klivans. Learning depth-three neural networks in polynomial time. arXiv preprint arXiv:1709.06010, 2017.
|
| 251 |
+
|
| 252 |
+
Surbhi Goel, Varun Kanade, Adam Klivans, and Justin Thaler. Reliably learning the relu in polynomial time. arXiv preprint arXiv:1611.10258, 2016.
|
| 253 |
+
|
| 254 |
+
Benjamin D Haeffele and Rene Vidal. Global optimality in tensor factorization, deep learning, and ´ beyond. arXiv preprint arXiv:1506.07540, 2015.
|
| 255 |
+
|
| 256 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016.
|
| 257 |
+
|
| 258 |
+
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.
|
| 259 |
+
|
| 260 |
+
Majid Janzamin, Hanie Sedghi, and Anima Anandkumar. Beating the perils of non-convexity: Guaranteed training of neural networks using tensor methods. arXiv preprint arXiv:1506.08473, 2015.
|
| 261 |
+
|
| 262 |
+
Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. arXiv preprint arXiv:1703.00887, 2017.
|
| 263 |
+
|
| 264 |
+
Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
|
| 265 |
+
|
| 266 |
+
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.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. arXiv preprint arXiv:1705.09886, 2017.
|
| 271 |
+
|
| 272 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 273 |
+
|
| 274 |
+
Qihang Lin and Lin Xiao. An adaptive accelerated proximal gradient method and its homotopy continuation for sparse optimization. In International Conference on Machine Learning, pp. 73– 81, 2014.
|
| 275 |
+
|
| 276 |
+
Roi Livni, Shai Shalev-Shwartz, and Ohad Shamir. On the computational efficiency of training neural networks. In Advances in Neural Information Processing Systems, pp. 855–863, 2014.
|
| 277 |
+
|
| 278 |
+
Song Mei, Yu Bai, and Andrea Montanari. The landscape of empirical risk for non-convex losses. arXiv preprint arXiv:1607.06534, 2016.
|
| 279 |
+
|
| 280 |
+
Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 565–571. IEEE, 2016.
|
| 281 |
+
|
| 282 |
+
Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. arXiv preprint arXiv:1704.08045, 2017.
|
| 283 |
+
|
| 284 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. arXiv preprint arXiv:1606.05336, 2016.
|
| 285 |
+
|
| 286 |
+
Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pp. 774–782, 2016.
|
| 287 |
+
|
| 288 |
+
Hanie Sedghi and Anima Anandkumar. Provable methods for training neural networks with sparse connectivity. arXiv preprint arXiv:1412.2693, 2014.
|
| 289 |
+
|
| 290 |
+
Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Failures of gradient-based deep learning. In International Conference on Machine Learning, pp. 3067–3075, 2017a.
|
| 291 |
+
|
| 292 |
+
Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Weight sharing is crucial to succesful optimization. arXiv preprint arXiv:1706.00687, 2017b.
|
| 293 |
+
|
| 294 |
+
Ohad Shamir. Distribution-specific hardness of learning neural networks. arXiv preprint arXiv:1609.01037, 2016.
|
| 295 |
+
|
| 296 |
+
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.
|
| 297 |
+
|
| 298 |
+
Jiˇr´ı Sˇ´ıma. Training a single sigmoidal neuron is hard. Neural Computation, 14(11):2709–2728, 2002.
|
| 299 |
+
|
| 300 |
+
Mahdi Soltanolkotabi. Learning relus via gradient descent. arXiv preprint arXiv:1705.04591, 2017.
|
| 301 |
+
|
| 302 |
+
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.
|
| 303 |
+
|
| 304 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, pp. 4278–4284, 2017.
|
| 305 |
+
|
| 306 |
+
Yuandong Tian. An analytical formula of population gradient for two-layered relu network and its applications in convergence and critical point analysis. arXiv preprint arXiv:1703.00560, 2017.
|
| 307 |
+
|
| 308 |
+
Yuchen Zhang, Jason D Lee, Martin J Wainwright, and Michael I Jordan. Learning halfspaces and neural networks with random initialization. arXiv preprint arXiv:1511.07948, 2015.
|
| 309 |
+
|
| 310 |
+
Yuchen Zhang, Jason D Lee, and Michael I Jordan. l1-regularized neural networks are improperly learnable in polynomial time. In International Conference on Machine Learning, pp. 993–1001, 2016.
|
| 311 |
+
|
| 312 |
+
Kai Zhong, Zhao Song, Prateek Jain, Peter L Bartlett, and Inderjit S Dhillon. Recovery guarantees for one-hidden-layer neural networks. arXiv preprint arXiv:1706.03175, 2017.
|
| 313 |
+
|
| 314 |
+
Pan Zhou and Jiashi Feng. The landscape of deep learning algorithms. arXiv preprint arXiv:1705.07038, 2017.
|
| 315 |
+
|
| 316 |
+
# A PROOFS AND ADDITIONAL THEOREMS
|
| 317 |
+
|
| 318 |
+
A.1 PROOFS OF THE THEOREM IN SECTION 2
|
| 319 |
+
|
| 320 |
+
# Lemma A.1.
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\begin{array} { r } { \left. \nabla _ { \mathbf { w } } \ell \left( \mathbf { w } \right) , \mathbf { w } - \mathbf { w } _ { * } \right. = \left( \mathbf { w } - \mathbf { w } _ { * } \right) ^ { \top } \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \left( \mathbf { w } - \mathbf { w } _ { * } \right) + \left( \mathbf { w } - \mathbf { w } _ { * } \right) ^ { \top } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w } . } \end{array}
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
and both terms are non-negative.
|
| 327 |
+
|
| 328 |
+
Proof. Since $\mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \succeq 0$ and $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \succeq 0$ (positive-semidefinite), both the first term and one part of the second term $\mathbf { w } ^ { \top } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w }$ are non-negative. The other part of the second term is
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
- \mathbf { w } _ { \ast } ^ { \intercal } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { \ast } } \mathbf { w } = - \mathbb { E } \left[ \left( \mathbf { w } _ { \ast } ^ { \intercal } \mathbf { Z } \right) \left( \mathbf { w } ^ { \intercal } \mathbf { Z } \right) \mathbb { I } \left\{ \mathbf { w } ^ { \intercal } \mathbf { Z } \geq 0 , \mathbf { w } _ { \ast } ^ { \intercal } \mathbf { Z } \leq 0 \right\} \right] \geq 0 .
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Proof of Theorem 2.1. The assumption on the input distribution ensures when $\theta \left( \mathbf { w } , \mathbf { w } _ { * } \right) \ \ne \ \pi .$ , $\mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \ \succ \ \mathbf { 0 }$ and when $\theta \left( \mathbf { w } , \mathbf { w } _ { * } \right) \neq \ 0$ , $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \ \succ \ \mathbf { 0 }$ . Now when gradient descent converges we have $\nabla _ { \mathbf { w } } \ell \left( \mathbf { w } \right) = \mathbf { 0 }$ . We have the following theorem. By assumption, since $\ell \left( \mathbf { w } \right) < \ell \left( \mathbf { 0 } \right)$ and gradient descent only decreases function value, we will not converge to $\mathbf { w } = \mathbf { 0 }$ . Note that at any critical points, $\left. \nabla _ { \mathbf { w } } \ell \left( \mathbf { w } \right) , \mathbf { w } - \mathbf { w } _ { * } \right. = 0$ , from Lemma A.1, we have:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r l } { \left( \mathbf { w } - \mathbf { w } _ { * } \right) ^ { \top } \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \left( \mathbf { w } - \mathbf { w } _ { * } \right) } & { = 0 } \\ { \left( \mathbf { w } - \mathbf { w } _ { * } \right) ^ { \top } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w } } & { = 0 . } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Suppose we are converging to a critical point $\mathbf { w } \neq \mathbf { w } _ { * }$ . There are two cases:
|
| 341 |
+
|
| 342 |
+
• If $\theta \left( \mathbf { w } , \mathbf { w } _ { * } \right) \neq \pi$ , then we have $\left( \mathbf { w } - \mathbf { w } _ { * } \right) ^ { \top } \mathbf { A } _ { \mathbf { w } , \mathbf { w } _ { * } } \left( \mathbf { w } - \mathbf { w } _ { * } \right) > 0$ , which contradicts with Eqn. 6. • If $\theta \left( \mathbf { w } , \mathbf { w } _ { * } \right) ~ = ~ \pi$ , without loss of generality, let $\textbf { w } = \mathbf { \Gamma } - \alpha \mathbf { w } _ { * }$ for some $\alpha \ > \ 0$ . By the assumption we know $\mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \quad \succ \quad 0$ . Now the second equation becomes $( \mathbf { w } - \mathbf { w } _ { * } ) ^ { \top } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w } = ( 1 + \gamma ) \mathbf { w } _ { * } \mathbf { A } _ { \mathbf { w } , - \mathbf { w } _ { * } } \mathbf { w } _ { * } > 0$ , which contradicts with Eqn. 7.
|
| 343 |
+
|
| 344 |
+
Therefore we have $\mathbf { w } = \mathbf { w } _ { * }$ .
|
| 345 |
+
|
| 346 |
+
Proof of Theorem 2.2. Our proof relies on the following simple but crucial observation: if $\left\| \mathbf { w } - \mathbf { w } _ { * } \right\| _ { 2 } < \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ , then
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\theta \left( \mathbf { w } , \mathbf { w } _ { * } \right) \leq \arcsin \left( \frac { \left\| \mathbf { w } - \mathbf { w } _ { * } \right\| _ { 2 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
We denote $\boldsymbol { \theta } \left( \mathbf { w } _ { t } , \mathbf { w } _ { * } \right) = \boldsymbol { \theta } _ { t }$ and by the observation we have $\theta _ { t } \leq \phi _ { t }$ . Recall the gradient descent dynamics,
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { r l } & { w _ { t + 1 } = \mathbf { w } _ { t } - \eta \nabla _ { \mathbf { w } _ { t } } \ell ( \mathbf { w } _ { t } ) } \\ & { \qquad = \mathbf { w } _ { t } - \eta \left( \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { \star } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] ( \mathbf { w } _ { t } - \mathbf { w } _ { \star } ) - \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { \star } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } \right) . } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Consider the squared distance to the optimal weight
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r l } & { \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } \\ & { = \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } \\ & { \quad - \eta \left( \mathbf { w _ { t } } - \mathbf { w } _ { * } \right) ^ { \top } \left( \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] \left( \mathbf { w } _ { t } - \mathbf { w } _ { * } \right) - \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } \right) } \\ & { \quad + \eta ^ { 2 } \left\| \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] \left( \mathbf { w } _ { t } - \mathbf { w } _ { * } \right) - \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } \right\| _ { 2 } ^ { 2 } . } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
By our analysis in the previous section, the second term is smaller than
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\begin{array} { r } { - \eta \left( \mathbf { w _ { t } } - \mathbf { w _ { * } } \right) ^ { \top } \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] \left( \mathbf { w } _ { t } - \mathbf { w } _ { * } \right) \leq - \eta \gamma ( \theta _ { t } ) \left. \mathbf { w } _ { t } - \mathbf { w } _ { * } \right. _ { 2 } ^ { 2 } } \end{array}
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
where we have used our assumption on the angle. For the third term, we expand it as
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\begin{array} { r l } & { \left\| \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] ( \mathbf { w } _ { t } - \mathbf { w } _ { * } ) - \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } \right\| _ { 2 } ^ { 2 } } \\ & { = \left\| \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] ( \mathbf { w } _ { t } - \mathbf { w } _ { * } ) \right\| _ { 2 } ^ { 2 } } \\ & { \quad - 2 \left( \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \mathbb { I } \left\{ \mathbf { w } _ { t } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \geq 0 \right\} \right] ( \mathbf { w } _ { t } - \mathbf { w } _ { * } ) \right) ^ { \top } \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } } \\ & { \quad + \left\| \mathbb { E } \left[ \mathbf { w } ^ { \top } \mathbf { Z } \geq 0 , \mathbf { w } _ { * } ^ { \top } \mathbf { Z } \leq 0 \right] \mathbf { w } _ { t } \right\| _ { 2 } ^ { 2 } } \\ & \leq L ^ { 2 } ( \theta _ { t } ) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } + 2 L ( \theta _ { t } ) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } \cdot 2 \beta \frac { \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } + \left( 2 \beta \frac { \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) \end{array}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
Therefore, in summary,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } { \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \leq \left( 1 - \eta \gamma ( \theta _ { t } ) + \eta ^ { 2 } \left( L ( \theta _ { t } ) + 4 \beta \right) ^ { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } & { } \\ { \leq \left( 1 - \frac { \eta \gamma ( \theta _ { t } ) } { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } & { } \\ { \leq \left( 1 - \frac { \eta \gamma ( \phi _ { t } ) } { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } & { } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
where the first inequality is by our assumption of the step size and second is because $\theta _ { t } \leq \phi _ { t }$ and $\gamma ( \cdot )$ is monotonically decreasing. □
|
| 383 |
+
|
| 384 |
+
Theorem A.1 (Rotational Invariant Distribution). For any unit norm rotational invariant input distribution, we have $\beta = 1$ .
|
| 385 |
+
|
| 386 |
+
Proof of Theorem A.1. Without loss of generality, we only need to focus on the plane spanned by w and $\mathbf { w } _ { \ast }$ and suppose $\mathbf { w } _ { * } = ( 1 , 0 ) ^ { \top }$ . Then
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
{ \boldsymbol { \mathrm { ? } } } \left[ \mathbf { Z } \mathbf { Z } ^ { \mathsf { T } } \mathbb { I } \left\{ S ( \mathbf { w } , - \mathbf { w } _ { * } ) \right\} \right] = \int _ { - { \boldsymbol { \pi } } / 2 } ^ { - { \boldsymbol { \pi } } / 2 + { \boldsymbol { \phi } } } { \binom { \cos \theta } { \sin \theta } } \left( \cos \theta , \sin \theta \right) \mathrm { d } \theta = { \frac { 1 } { 2 } } \left( { \boldsymbol { \phi } } - \sin \phi \cos \phi \qquad - \sin ^ { 2 } \phi \cos \theta \right) { \boldsymbol { \phi } } = { \frac { \sin ^ { 2 } \phi } { \sin \phi } } { \boldsymbol { \phi } } = { \frac { \sin ^ { 2 } \phi } { \cos \phi } } { \boldsymbol { \phi } } .
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
It has two eigenvalues
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\lambda _ { 1 } ( \phi ) = { \frac { \phi + \sin \phi } { 2 } } \operatorname { a n d } \lambda _ { 2 } ( \phi ) = { \frac { \phi - \sin \phi } { 2 } } .
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
Theorem A.2. If $\mathbf { Z } \sim N ( 0 , \mathbf { I } )$ , then $\beta \leq p$
|
| 399 |
+
|
| 400 |
+
Proof. Note in previous theorem we can integrate angle and radius separately then multiply them together. For Gaussian distribution, we have $\begin{array} { r } { \mathbb { E } \left[ \left. \mathbf { Z } \right. _ { 2 } ^ { 2 } \right] \leq p } \end{array}$ . The result follows. □
|
| 401 |
+
|
| 402 |
+
# A.2 PROOFS OF THEOREMS IN SECTION 3
|
| 403 |
+
|
| 404 |
+
Proof of Theorem 3.1. The proof is very similar to Theorem 2.2. Notation-wise, for two events $S _ { 1 } , S _ { 2 }$ we use $S _ { 1 } S _ { 2 }$ as a shorthand for $S _ { 1 } \cap S _ { 2 }$ and $S _ { 1 } + S _ { 2 }$ as a shorthand for $S _ { 1 } \cup S _ { 2 }$ . Denote $\boldsymbol { \theta } _ { t } = \boldsymbol { \theta } \left( \mathbf { w } _ { t } , \mathbf { w } _ { * } \right)$ . First note with some routine algebra, we can write the gradient as
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { r l } & { \nabla _ { \mathbf { w } _ { t } } \ell \left( \mathbf { w } _ { t } \right) } \\ & { = \mathbb { E } \left[ \sum _ { ( i , j ) = ( 1 , 1 ) } ^ { ( d , d ) } \mathbf { Z } _ { i } \mathbf { Z } _ { j } ^ { \top } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { j } \right\} \right] \left( \mathbf { w } - \mathbf { w } _ { * } \right) } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { r l } & { + \mathbb { E } \left[ \underset { ( i , j ) = ( 1 , 1 ) } { \overset { ( d , d ) } { \sum } } \mathbf { Z } _ { i } \mathbf { Z } _ { j } ^ { \top } { \mathbb { I } \left\{ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } + S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { j } } \right\} } \right] \mathbf { w } } \\ & { + \mathbb { E } \left[ \underset { ( i , j ) = ( 1 , 1 ) } { \overset { ( d , d ) } { \sum } } \mathbf { Z } _ { i } \mathbf { Z } _ { j } ^ { \top } { \mathbb { I } \left\{ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } } \right\} } \right] \mathbf { w } } \\ & { - \mathbb { E } \left[ \underset { ( i , j ) = ( 1 , 1 ) } { \overset { ( d , d ) } { \sum } } \mathbf { Z } _ { i } \mathbf { Z } _ { j } ^ { \top } { \mathbb { I } \left\{ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } S ( - \mathbf { w } , \mathbf { w } _ { * } ) _ { j } + S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { j } + S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { i } S ( - \mathbf { w } , \mathbf { w } _ { * } ) _ { j } } \right\} } \right] \mathbf { w } } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
We first examine the inner product between the gradient and $\mathbf { w } - \mathbf { w } _ { * }$ .
|
| 415 |
+
|
| 416 |
+
h∇wt \`(w), w − w∗i
|
| 417 |
+
= (w − w )> E (Xd,d) ZiZj I nS(w, w∗)iS(w, w∗)j o (w − w∗) $\begin{array} { r l } & \quad + ( \textbf { v } - \textbf { v } ^ { 2 } ) ^ { 2 } ( \displaystyle \sum _ { j = 0 } ^ { N } \alpha ^ { 2 } \textbf { { S u p p e r } } + \beta ^ { 2 } ) ^ { 2 } + ( \textbf { v } - \textbf { v } ^ { 2 } ) ^ { 2 } ( \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } + \beta ^ { 2 } \\ \end{array}$ ∗)iS(w, −w∗)j o w ∗)iS(−w, w∗)j o w∗
|
| 418 |
+
$\begin{array} { r l } & { \begin{array} { r l } & { \mathrm { i } } \\ & { = \left( \nu - \nu \right) ^ { 2 } , } \\ { \nu \left( \frac { \nu } { 2 } \right) ^ { 2 } , } \\ { = \left( \nu - \nu \right) ^ { 4 } , } \\ { \nu \left( \frac { \nu } { 2 } \right) ^ { 4 } , } \end{array} } \end{array}$ ∗)iS(−w, w∗)j o w∗ ( − w , w ∗ ) j o op
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\begin{array} { l } { + \| { \mathbb { E } [ \begin{array} { c } { ( { d , d } ) } \\ { ( { i , j } ) = ( { 1 , 1 } ) } \end{array} { \mathbf { Z } } _ { i } { \mathbf { Z } } _ { j } { \mathbb { I } \{ { S } ( { \mathbf { w } } , - { \mathbf { w } } _ { * } ) _ { i } S ( { \mathbf { w } } , { \mathbf { w } } _ { * } ) _ { j } \} } ] } \| _ { \sigma _ { p } } + \| { \mathbb { E } [ \begin{array} { c } { ( { d , d } ) } \\ { \displaystyle { \sum _ { i , j = ( { 1 , 1 } ) } ^ { { d } } { \mathbf { Z } } _ { i } { \mathbf { Z } } _ { j } { \mathbb { I } \{ { S } ( { \mathbf { w } } , - { \mathbf { w } } _ { * } ) _ { i } S ( - { \mathbf { w } } , { \mathbf { w } } _ { * } ) _ { j } \} } } \end{array} ] } { S ( - \mathbf { w } _ { * } ) _ { i } { \mathbf { Z } } _ { j } } } } \\ { \geq \gamma ( \theta _ { t } ) \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } ^ { 2 } - 3 L _ { \mathrm { c r o s s } } \phi _ { t } \| { \mathbf { w } } _ { * } \| _ { 2 } \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } } \\ { \geq \gamma ( \theta _ { t } ) \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } ^ { 2 } - 6 L _ { \mathrm { c r o s s } } \frac { \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } } { \| { \mathbf { w } } _ { * } \| _ { 2 } } \cdot \| { \mathbf { w } } _ { * } \| _ { 2 } \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } } \\ { \geq ( \gamma ( \theta _ { t } ) - 6 L _ { \mathrm { c r o s s } } ) \| { \mathbf { w } } _ { t } - { \mathbf { w } } _ { * } \| _ { 2 } ^ { 2 } } \end{array}
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
where the first inequality we used the definitions of the regions; the second inequality we used the definition of operator norm; the third inequality we used the fact $\left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } \leq \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ ; the fourth inequality we used the definition of $L _ { \mathrm { c r o s s } }$ and the fifth inequality we used $\phi \leq 2 \sin \phi$ for any $0 \leq \phi \leq \pi / 2$ . Next we can upper bound the norm of the gradient using similar argument
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
\begin{array} { r l } & { \| \nabla _ { \mathbf { w } _ { t } } \ell ( \mathbf { w } _ { t } ) \| _ { 2 } \leq L \left( \theta _ { t } \right) \| \mathbf { w } _ { t } - \mathbf { w } _ { * } \| _ { 2 } + 1 0 L _ { \mathrm { c r o s s } } \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| + 2 \beta \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } } \\ & { \qquad = ( L ( \theta _ { t } ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } . } \end{array}
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
Therefore, using the dynamics of gradient descent, putting the above two bounds together, we have
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\begin{array} { r l } & { \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \leq \left( 1 - \eta \left( \gamma ( \theta _ { t } ) - 6 L _ { \mathrm { c r o s s } } \right) + \eta ^ { 2 } ( L ( \theta _ { t } ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) ^ { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } \\ & { \qquad \leq \left( 1 - \frac { \eta \left( \gamma \left( \theta _ { t } \right) - 6 L _ { \mathrm { c r o s s } } \right) } { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } \\ & { \qquad \leq \left( 1 - \frac { \eta \left( \gamma \left( \phi _ { t } \right) - 6 L _ { \mathrm { c r o s s } } \right) } { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } } \end{array}
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
where the last step we have used our choice of $\eta _ { t }$ and $\theta _ { t } \leq \phi _ { t }$ .
|
| 437 |
+
|
| 438 |
+
The proof of Theorem 3.2 consists of two parts. First we show if $\eta$ is chosen properly and $T$ is not to big, then for all $1 \leq t \leq T$ , with high probability the iterates stat in a neighborhood of $\mathbf { w } _ { \ast }$ . Next, conditioning on this, we derive the rate.
|
| 439 |
+
|
| 440 |
+
Lemma A.2. Denote $r _ { 0 } = \left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } < \left\| \mathbf { w } _ { * } \right\| _ { 2 } \sin \phi _ { * }$ . Given $0 < r _ { 1 } < \| \mathbf { w } _ { * } \| _ { 2 } \sin \phi _ { * }$ , number of iterations $T \in \mathbb { Z } _ { + + }$ and failure probability $\delta$ , denote $\begin{array} { r } { \phi _ { 1 } = \arcsin \left( \frac { r _ { 1 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) } \end{array}$ then if the step size satisfies
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\begin{array} { c } { { 0 < 1 - \eta \gamma ( \phi _ { 1 } ) + \eta ^ { 2 } ( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) ^ { 2 } < 1 } } \\ { { \left( r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } \right) ^ { 2 } } } \\ { { { \cal T } \left( 1 + 2 \eta \alpha T \right) \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } \right) ^ { 2 } \log \left( \displaystyle \frac { T } { \delta } \right) } } \end{array}
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
with $\alpha = \gamma ( \phi _ { 1 } ) - \eta ( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta )$ . Then with probability at least $1 - \delta$ , for all $t =$ $1 , \ldots , T$ , we have
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| \leq r _ { 1 } .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Proof of Lemma A.2. Let $g ( \mathbf { w } _ { t } ) = \mathbb { E } \left[ \nabla _ { \mathbf { w } _ { t } } \ell \left( \mathbf { w } _ { t } \right) \right] + \xi _ { t }$ . We denote $\mathcal { F } _ { t } = \sigma \left\{ \xi _ { 1 } , \ldots , \xi _ { t } \right\}$ , the sigmaalgebra generated by $\xi _ { 1 } , \ldots , \xi _ { t }$ and define the event
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { r } { \mathcal { C } _ { t } = \left\{ \forall \tau \leq t , \| \mathbf { w } _ { \tau } - \mathbf { w } _ { * } \| \leq r _ { 1 } \right\} . } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
Consider
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { r l } & { \quad \mathbb { E } \left[ \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \mathbb { I } _ { C _ { t } } \big | \mathcal { F } _ { t } \right] } \\ & { = \mathbb { E } \left[ \left\| \mathbf { w } _ { t } - \eta \nabla _ { \mathbf { w } _ { t } } \ell ( \mathbf { w } _ { t } ) - \mathbf { w } _ { * } - \eta \xi _ { t } \right\| _ { 2 } ^ { 2 } \mathbb { I } _ { C _ { t } } \big | \mathcal { F } _ { t } \right] } \\ & { \leq \left( \left( 1 - \eta \gamma ( \phi _ { 1 } ) + \eta ^ { 2 } \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) ^ { 2 } \right) \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } + \eta ^ { 2 } B ^ { 2 } \right) \mathbb { I } _ { C _ { t } } } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
where the inequality follows by our analysis of gradient descent together with definition of $\mathcal { C } _ { t }$ and $\mathbb { E } \left[ \xi _ { t } | \mathcal { F } _ { t } \right] = 0$ . Define
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
G _ { t } = \left( 1 - \eta \alpha \right) ^ { - t } \left( \left| \left| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right| \right| _ { 2 } ^ { 2 } - \frac { \eta B ^ { 2 } } { \alpha } \right) .
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
By our analysis above, we have
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\mathbb { E } \left[ G _ { t + 1 } \mathbb { I } _ { { \mathcal { C } } _ { t } } | { \mathcal { F } } _ { t } \right] \leq G _ { t } \mathbb { I } _ { { \mathcal { C } } _ { t } } \leq G _ { t } \mathbb { I } _ { { \mathcal { C } } _ { t - 1 } }
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
where the last inequality is because $\mathcal { C } _ { t }$ is a subset of $\mathcal { C } _ { t - 1 }$ . Therefore, $\boldsymbol { G } _ { t } \mathbb { I } _ { \boldsymbol { c } _ { t - 1 } }$ is a super-martingale and we may apply Azuma-Hoeffding inequality. Before that, we need to bound the difference between $G _ { t } \mathbb { I } _ { \boldsymbol { c } _ { t } }$ and its expectation. Note
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\begin{array} { r l } & { G _ { t } \mathbb { I } _ { \mathcal { C } _ { t - 1 } } - \mathbb { E } \left[ G _ { t } \mathbb { I } _ { \mathcal { C } _ { t - 1 } } \right] \left. \mathcal { F } _ { t - 1 } \right. = \left( 1 - \eta \alpha \right) ^ { - t } \left. \left. \mathbf { w } _ { t } - \mathbf { w } _ { * } \right. _ { 2 } ^ { 2 } - \mathbb { E } \left[ \left. \mathbf { w } _ { t } - \mathbf { w } _ { * } \right. _ { 2 } ^ { 2 } \right] \left. \mathcal { F } _ { t - 1 } \right. \mathbb { I } _ { \mathcal { C } _ { t - 1 } } \right. } \\ & { \qquad = \left( 1 - \eta \alpha \right) ^ { - t } \left. 2 \eta \langle \xi _ { t } , \mathbf { w } _ { t } - \eta \nabla _ { \mathbf { w } _ { t } } \ell ( \mathbf { w } _ { t } ) - \mathbf { w } _ { * } - \eta ^ { 2 } \mathbb { E } \left[ \left. \xi _ { t } \right. _ { 2 } ^ { 2 } \left. \mathcal { F } _ { t - 1 } \right] \right. \mathbb { I } _ { \mathcal { C } _ { t - 1 } } \right. } \\ & { \qquad \leq \left( 1 - \eta \alpha \right) ^ { - t } \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) \left. \mathbf { w } _ { t } - \mathbf { w } _ { * } \right. _ { 2 } + \eta ^ { 2 } B ^ { 2 } \right) \mathbb { I } _ { \mathcal { C } _ { t - 1 } } } \\ & { \qquad \leq \left( 1 - \eta \alpha \right) ^ { - t } \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } \right) } \\ & { \qquad \triangleq d _ { t } . } \end{array}
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Therefore for all $t \leq T$
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\begin{array} { r l } & { c _ { t } ^ { 2 } \triangleq \displaystyle \sum _ { \tau = 1 } ^ { t } d _ { \tau } ^ { 2 } } \\ & { \quad = \displaystyle \sum _ { \tau = 1 } ^ { t } \left( 1 - \eta \alpha \right) ^ { - 2 t } \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } \right) ^ { 2 } } \\ & { \quad \le t \left( 1 - \eta \alpha \right) ^ { - 2 t } \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } \right) ^ { 2 } } \\ & { \quad \le T \left( 1 + 2 \eta \alpha T \right) \left( 2 \eta B \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } \right) ^ { 2 } } \end{array}
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
where the first inequality we used $1 - \eta \alpha < 1$ , the second we used $t \leq T$ and the third we used our assumption on $\eta$ . Let us bound at $( t + 1 )$ -th step, the iterate goes out of the region,
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { r l } { \mathbb { P } \left[ \mathcal { G } _ { t } \cap \left\{ \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } > r _ { 1 } \right\} \right] = \mathbb { P } \left[ \mathcal { G } _ { t } \cap \left\{ \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } > r _ { 1 } ^ { 2 } \right\} \right] } & { } \\ & { = \mathbb { P } \left[ C _ { t } \cap \left\{ \left\| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } > r _ { 0 } ^ { 2 } + \left( r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } \right) \right\} \right] } \\ & { = \mathbb { P } \left[ \mathcal { C } _ { t } \cap \left\{ G _ { t + 1 } \left( 1 - \eta \alpha \right) ^ { t } + \frac { \eta B ^ { 2 } } { \alpha } \geq G _ { 0 } + \frac { \eta B ^ { 2 } } { \alpha } + r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } \right\} \right] } \\ & { \leq \mathbb { P } \left[ \mathcal { C } _ { t } \cap \left\{ G _ { t + 1 } - G _ { 0 } \geq r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } \right\} \right] } \\ & { \leq \exp \left\{ - \frac { \left( r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } \right) ^ { 2 } } { 2 c _ { t } ^ { 2 } } \right\} } \\ & { \leq \frac { \delta } { T } } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
where the second inequality we used Azuma-Hoeffding inequality, the last one we used our assumption of $\eta$ . Therefore for all $0 \leq t \leq T$ , we have with probability at least $1 - \delta , { \mathcal { C } } _ { t }$ happens. □
|
| 495 |
+
|
| 496 |
+
Now we can derive the rate.
|
| 497 |
+
|
| 498 |
+
Lemma A.3. Denote $r _ { 0 } = \left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } < \left\| \mathbf { w } _ { * } \right\| _ { 2 } \sin \phi _ { * }$ . Given $0 < r _ { 1 } < \| \mathbf { w } _ { * } \| _ { 2 } \sin \phi _ { * }$ , number of iterations $T \in \mathbb { Z } _ { + + }$ and failure probability $\delta _ { i }$ , denote $\begin{array} { r } { \phi _ { 1 } = \arcsin \left( \frac { r _ { 1 } } { \left\| \mathbf { w } _ { * } \right\| _ { 2 } } \right) } \end{array}$ then if the step size satisfies
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\begin{array} { r l r } { { 0 < 1 - \eta \gamma ( \phi _ { 1 } ) + \eta ^ { 2 } ( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) ^ { 2 } < 1 } } \\ & { } & { \frac { ( r _ { 1 } ^ { 2 } - r _ { 0 } ^ { 2 } ) ^ { 2 } } { T ( 1 + 2 \eta \alpha T ) ( 2 \eta B ( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) r _ { 1 } + \eta ^ { 2 } B ^ { 2 } ) ^ { 2 } } \ge \log ( \frac { T } { \delta } ) } \\ & { } & { \eta T ( \gamma ( \phi _ { 1 } ) - \eta ( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta ) ^ { 2 } ) \ge \log ( \frac { r _ { 0 } ^ { 2 } } { \epsilon ^ { 2 } \mathbf { w } _ { * } _ { 2 } ^ { 2 } \delta } ) } \end{array}
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
$$
|
| 505 |
+
\epsilon ^ { 2 } \left( \gamma ( \phi _ { 1 } ) - \eta \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right) ^ { 2 } \right) \left\| \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \geq \eta B ^ { 2 }
|
| 506 |
+
$$
|
| 507 |
+
|
| 508 |
+
with $\alpha = \gamma \left( \phi _ { 1 } \right) - \eta \left( L ( 0 ) + 1 0 L _ { \mathrm { c r o s s } } + 4 \beta \right)$ , then we have with probability $1 - 2 \delta$ ,
|
| 509 |
+
|
| 510 |
+
$$
|
| 511 |
+
\left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } \leq 2 \epsilon \left\| \mathbf { w } _ { * } \right\| _ { 2 } .
|
| 512 |
+
$$
|
| 513 |
+
|
| 514 |
+
Proof of Lemma A.3. We use the same notations in the proof of Lemma A.2. By the analysis of Lemma A.2, we know
|
| 515 |
+
|
| 516 |
+
$$
|
| 517 |
+
\begin{array} { r } { \mathbb { E } \left[ \| \mathbf { w } _ { t + 1 } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \mathbb { I } _ { \mathcal { C } _ { t } } \big | \mathcal { F } _ { t } \right] \leq \left( ( 1 - \eta \alpha ) \| \mathbf { w } _ { t } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } + \eta ^ { 2 } B ^ { 2 } \right) \mathbb { I } _ { \mathcal { C } _ { t } } . } \end{array}
|
| 518 |
+
$$
|
| 519 |
+
|
| 520 |
+
Therefore we have
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\mathbb { E } \left[ \left\| \mathbf { w } _ { t } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } \mathbb { I } _ { \mathcal { C } _ { t } } - \frac { \eta B ^ { 2 } } { \alpha } \right] \leq \left( 1 - \eta \alpha \right) ^ { t } \left( \left\| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \right\| _ { 2 } ^ { 2 } - \frac { \eta B } { \alpha } \right) .
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
Now we can bound the failure probability
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\begin{array} { r l } { \mathbb { P } [ \| \mathbf { w } _ { T } - \mathbf { w } _ { * } \| _ { 2 } \geq 2 \epsilon \| \mathbf { w } _ { * } \| _ { 2 } ] \leq \mathbb { P } [ \| \mathbf { w } _ { T } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } - \frac { \eta B ^ { 2 } } { \alpha } \geq \epsilon ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } ] } & { } \\ & { \leq \mathbb { P } [ \{ \| \mathbf { w } _ { T } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \mathbb { T } _ { \epsilon _ { * } } - \frac { \eta B ^ { 2 } } { \alpha } \geq \epsilon ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \} \cup \mathcal { C } _ { t } ^ { * } ] } \\ & { \leq \mathbb { P } [ \{ \| \mathbf { w } _ { T } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \} \mathbb { I } _ { \epsilon _ { * } } - \frac { \eta B ^ { 2 } } { \alpha } \geq \epsilon ^ { 2 } \| \mathbf { w } \| _ { 2 } ^ { 2 } ] ] + \delta } \\ & { \leq \frac { \mathbb { E } [ \| \mathbf { w } _ { T } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } \mathbb { I } _ { \epsilon _ { * } } - \frac { \eta B ^ { 2 } } { \alpha } ] } { \epsilon ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } } + \delta } \\ & { \leq \frac { ( 1 - \eta \alpha ) ^ { 4 } ( \| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } - \frac { \eta B } { \alpha } ) } { \epsilon ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } } + \frac { \eta B } { \alpha } } \\ & { \leq \frac { ( 1 - \eta \alpha ) ^ { 4 } ( \| \mathbf { w } _ { 0 } - \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } - \frac { \eta B } { \alpha } ) } { \epsilon ^ { 2 } \| \mathbf { w } _ { * } \| _ { 2 } ^ { 2 } } + \delta } \end{array}
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
The first inequality we used the last assumption. The second inequality we used the probability of an event is upper bound by any superset of this event. The third one we used Lemma A.2 and the union bound. The fourth one we used Markov’s inequality. □
|
| 533 |
+
|
| 534 |
+
Now we can specify the $T$ and $\eta$ and derive the convergence rate of SGD for learning a convolution filter.
|
| 535 |
+
|
| 536 |
+
Proof of Theorem 3.2. With the choice of $\eta$ and $T$ , it is straightforward to check they satisfies conditions in Lemma A.3. □
|
| 537 |
+
|
| 538 |
+
Proof of Theorem 3.3. We first prove the lower bound of $\gamma \left( \phi _ { 0 } \right)$ .
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\begin{array} { r l } & { \mathbb { E } \left[ \left( \displaystyle \sum _ { i = 1 } ^ { k } \mathbf { Z } _ { i } [ \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} \right) \left( \displaystyle \sum _ { i = 1 } ^ { k } \mathbf { Z } _ { i } [ \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} ^ { \top } ] \right) ^ { \top } \right] } \\ & { = \mathbb { E } \left[ k \mathbf { Z } + \displaystyle \sum _ { i = 1 } ^ { k } \left( \mathbf { Z } _ { i } \mathbf { I } \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} - \mathbf { Z } \right) \left( k \mathbf { Z } + \displaystyle \sum _ { i = 1 } ^ { k } \left( \mathbf { Z } _ { i } \mathbf { I } \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} - \mathbf { Z } \right) \right) ^ { \top } \right] } \\ & { = k ^ { 2 } \mathbb { E } \left[ \mathbf { Z } \mathbf { Z } ^ { \top } \right] + k \mathbb { E } \left[ \mathbf { Z } \left( \displaystyle \sum _ { i = 1 } ^ { k } \left( \mathbf { Z } _ { i } \mathbf { I } \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} - \mathbf { Z } \right) \right) ^ { \top } \right] } \\ & { \quad + k \mathbb { E } \left[ \left( \displaystyle \sum _ { i = 1 } ^ { k } \left( \mathbf { Z } _ { i } \mathbf { I } \left\{ \mathcal { S } ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} - \mathbf { Z } \right) \right) \mathbf { Z } ^ { \top } \right] } \end{array}
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\begin{array} { r l } & { + \mathbb { E } [ ( \displaystyle \sum _ { i = 1 } ^ { k } ( \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} - \mathbf { Z } _ { 1 } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { 1 } \} ) ) ( \displaystyle \sum _ { i = 1 } ^ { k } ( \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} - \mathbf { Z } _ { 1 } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { 1 } \} ) ) } \\ & { \displaystyle \mathrm { ~ } \displaystyle \mathrm { ~ } \mathrm { ~ } \displaystyle \mathrm { ~ } z k ^ { 2 } \mathbb { E } [ \mathbf { Z } \mathbf { Z } ^ { \top } ] + k \mathbb { E } [ \mathbf { Z } ( \displaystyle \sum _ { i = 1 } ^ { k } ( \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} - \mathbf { Z } ) ) ^ { \top } ] } \\ & { + \displaystyle k \mathbb { E } [ ( \displaystyle \sum _ { i = 1 } ^ { k } ( \mathbf { Z } _ { i } \mathbb { I } \{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \} - \mathbf { Z } ) ) \mathbf { Z } ^ { \top } ] } \end{array}
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
Note because $\mathbf { Z } _ { i } \mathbf { s }$ have unit norm and by law of cosines $\begin{array} { r } { \| \mathbf { Z } \left( \mathbf { Z } _ { i } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} - \mathbf { Z } \right) \| _ { o p } \leq 2 ( 1 - \mathbf { \alpha } } \end{array}$ $\cos \rho )$ ). Therefore,
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
r _ { \mathrm { m i n } } \left( \mathbb { E } \left[ \left( \sum _ { i = 1 } ^ { d } \mathbf { Z } _ { i } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} \right) \left( \sum _ { i = 1 } ^ { d } \mathbf { Z } _ { i } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } \right\} \right) ^ { \top } \right] \right) \geq k ^ { 2 } ( \gamma _ { 1 } ( \phi _ { 0 } ) - 4 ( 1 - \cos \rho ) ) .
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
Now we prove the upper bound of $L _ { \mathrm { c r o s s } }$ . Notice that
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\begin{array} { r } { \left\| \mathbb { E } \left[ \mathbf { Z } _ { i } \mathbf { Z } _ { j } ^ { \top } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } \right\} \right] \right\| _ { 2 } \leq \mathbb { E } \left[ \| \mathbf { Z } _ { i } \| _ { 2 } \| \mathbf { Z } _ { j } \| _ { 2 } \mathbb { I } \left\{ S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } \right\} \right] } \\ { = \int _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } } \left( \int _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } } \mathrm { d } \mathbb { P } \left( \mathbf { Z } _ { i } | \mathbf { Z } _ { j } \right) \right) \mathrm { d } \mathbb { P } \left( \theta _ { j } \right) . } \end{array}
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
If $\phi \leq \psi$ , then by our assumption, we have
|
| 561 |
+
|
| 562 |
+
$$
|
| 563 |
+
\int _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } } \left( \int _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } } { \mathrm { d } } \mathbb { P } \left( \mathbf { Z } _ { i } | \mathbf { Z } _ { j } \right) \right) { \mathrm { d } } \mathbb { P } \left( \theta _ { j } \right) \leq \int _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } } { \mathrm { d } } \mathbb { P } \left( \mathbf { Z } _ { j } \right) \leq L \phi .
|
| 564 |
+
$$
|
| 565 |
+
|
| 566 |
+
On the other hand, if $\phi \geq \gamma$ , let $\theta _ { j }$ be the angle between $\mathbf { w } _ { \ast }$ and $\mathbf { Z } _ { j }$ , we have
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
\begin{array} { r l } & { \displaystyle \int _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) _ { j } } \left( \int _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } } { \mathrm { d } \mathbb { P } } ( \mathbf { Z } _ { i } | \mathbf { Z } _ { j } ) \right) { \mathrm { d } \mathbb { P } } \left( \theta _ { j } \right) \leq \int _ { \frac { \pi } { 2 } } ^ { \frac { \pi } { 2 } + \gamma } \left( \int _ { S ( \mathbf { w } , \mathbf { w } _ { * } ) _ { i } } { \mathrm { d } \mathbb { P } } ( \mathbf { Z } _ { i } | \mathbf { Z } _ { j } ) \right) { \mathrm { d } \mathbb { P } } \left( \theta _ { j } \right) } \\ & { \qquad \leq L \gamma } \\ & { \qquad \leq L \phi . } \end{array}
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
Therefore, $\begin{array} { r } { \sigma _ { \operatorname* { m a x } } \left( { \mathbb E } \left[ { \mathbf { Z } } _ { S ( { \mathbf { w } } , { \mathbf { w } } _ { \ast } ) } { \mathbf { Z } } _ { S ( { \mathbf { w } } , - { \mathbf { w } } _ { \ast } ) } ^ { \top } \right] \right) ~ \leq ~ L \phi } \end{array}$ . Using similar arguments we can show $\sigma _ { \operatorname* { m a x } } \left( { \mathbb E } \left[ { \mathbf Z } _ { S ( { \mathbf w } , { \mathbf w } _ { \ast } ) } { \mathbf Z } _ { S ( - { \mathbf w } , { \mathbf w } _ { \ast } ) } \right] \right) \leq L \phi$ and $\begin{array} { r } { \ ' \sigma _ { \operatorname* { m a x } } \left( \mathbb { E } \left[ \mathbf { Z } _ { S ( \mathbf { w } , - \mathbf { w } _ { * } ) } \mathbf { Z } _ { S ( - \mathbf { w } , \mathbf { w } _ { * } ) } \right] \right) \leq L \phi . } \end{array}$
|
| 573 |
+
|
| 574 |
+
Proof of Theorem 3.4. We use the same argument by Tian (2017). Let $r _ { i n i t }$ be the initialization radius. The failure probability is lower bounded
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
\frac { 1 } { 2 } \left( r _ { i n i t } \right) - \frac { \left( \frac { r _ { i n i t } ^ { 2 } } { 2 \left\| \mathbf { w } _ { * } \right\| _ { 2 } } + \frac { \left\| \mathbf { w } _ { * } \right\| _ { 2 } \cos \left( \phi _ { * } \right) } { 2 } \right) \delta V _ { k - 1 } \left( r _ { i n i t } \right) } { V _ { k } \left( r _ { i n i t } \right) } .
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
Therefore, $r _ { i n i t } = \cos \left( \phi _ { * } \right) \left\| \mathbf { w } _ { * } \right\| _ { 2 }$ maximizes this lower bound. Plugging this optimizer in and using formula for the volume of the Euclidean ball, the failure probability is lower bounded by
|
| 581 |
+
|
| 582 |
+
$$
|
| 583 |
+
\frac { 1 } { 2 } - \cos \left( \phi _ { * } \right) \frac { \pi \Gamma \left( p / 2 + 1 \right) } { \Gamma \left( p / 2 + 1 / 2 \right) } \geq \frac { 1 } { 2 } - \cos \left( \phi _ { * } \right) \sqrt { \frac { \pi p } { 2 } }
|
| 584 |
+
$$
|
| 585 |
+
|
| 586 |
+
where we used Gautschi’s inequality for the last step.
|
| 587 |
+
|
| 588 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 589 |
+
|
| 590 |
+
Figure 5 show the loss of linear interpolation between the learned filter $w$ and ground truth filter $w _ { * }$ .
|
| 591 |
+
Our interpolation has the form $w _ { i n t e r } = \alpha w + ( 1 - \alpha ) w _ { * }$ where $\alpha \in [ 0 , 1 ]$ is the interpolation ratio.
|
| 592 |
+
Note that for all interpolation ratios, the loss remains very low.
|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
Figure 5: Loss of linear interpolation between learned filter and the true filter.
|
md/train/SkZxCk-0Z/SkZxCk-0Z.md
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAN NEURAL NETWORKS UNDERSTAND LOGICAL ENTAILMENT?
|
| 2 |
+
|
| 3 |
+
Richard Evans∗
|
| 4 |
+
|
| 5 |
+
David Saxton∗
|
| 6 |
+
|
| 7 |
+
David Amos
|
| 8 |
+
|
| 9 |
+
Pushmeet Kohli
|
| 10 |
+
|
| 11 |
+
Edward Grefenstette∗
|
| 12 |
+
DeepMind
|
| 13 |
+
{richardevans,saxton,davidamos,pushmeet,etg}@google.com
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
We introduce a new dataset of logical entailments for the purpose of measuring models’ ability to capture and exploit the structure of logical expressions against an entailment prediction task. We use this task to compare a series of architectures which are ubiquitous in the sequence-processing literature, in addition to a new model class—PossibleWorldNets—which computes entailment as a “convolution over possible worlds”. Results show that convolutional networks present the wrong inductive bias for this class of problems relative to LSTM RNNs, treestructured neural networks outperform LSTM RNNs due to their enhanced ability to exploit the syntax of logic, and PossibleWorldNets outperform all benchmarks.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
This paper seeks to answer two questions: “Can neural networks understand logical formulae well enough to detect entailment?”, and, more generally, “Which architectures are best at inferring, encoding, and relating features in a purely structural sequence-based problem?”. In answering these questions, we aim to better understand the inductive biases of popular architectures with regard to structure and abstraction in sequence data. Such understanding would help pave the road to agents and classifiers that reason structurally, in addition to reasoning on the basis of essentially semantic representations. In this paper, we provide a testbed for evaluating some aspects of neural networks’ ability to reason structurally and abstractly. We use it to compare a variety of popular network architectures and a new model we introduce, called PossibleWorldNet.
|
| 22 |
+
|
| 23 |
+
Neural network architectures lie at the heart of a variety of applications. They are practically ubiquitous across vision tasks (LeCun et al., 1995; Krizhevsky et al., 2012; Simonyan & Zisserman, 2014) and natural language understanding, from machine translation (Kalchbrenner & Blunsom, 2013; Sutskever et al., 2014; Bahdanau et al., 2014) to textual entailment (Bowman et al., 2015; Rocktaschel et al., 2015) via sentiment analysis (Socher et al., 2013; Kalchbrenner et al., 2014) and ¨ reading comprehension (Hermann et al., 2015; Hill et al., 2015; Rajpurkar et al., 2016). They have been used to synthesise programs (Ling et al., 2016; Parisotto et al., 2016; Devlin et al., 2017) or internalise algorithms (Graves et al., 2016; Grefenstette et al., 2015; Joulin & Mikolov, 2015; Kaiser & Sutskever, 2015; Reed & De Freitas, 2015). They form the basis of reinforcement learning agents capable of playing video games (Mnih et al., 2015), difficult perfect information games (Silver et al., 2016; Tian & Zhu, 2015), and navigating complex environments from raw pixels (Mirowski et al., 2016). An important question in this context is to find the inductive and generalisation properties of different neural architectures, particularly towards the ability to capture structure present in the input, an ability that might be important for many language and reasoning tasks. However, there is little work on studying these inductive biases in isolation by running these models on tasks that are primarily or purely about sequence structure, which we intend to address.
|
| 24 |
+
|
| 25 |
+
The paper’s contribution is three-fold. First, we introduce a new dataset for training and evaluating models. Second, we provide a thorough evaluation of the existing neural models on this dataset. Third, inspired by the semantic (model-theoretic) definition of entailment, we propose a variant of the TreeNet that evaluates the formulas in multiple different “possible worlds”, and which significantly outperforms the benchmarks. The structure of this paper is as follows. In Section 2, we introduce the new dataset and describe a generic data generation process for entailment datasets, which offers certain guarantees against the presence of superficial exploitable biases. In Section 3, we describe a series of baseline models used to validate the dataset, benchmarks from which we will derive our analyses of popular model architectures, and also introduce our new neural model, the PossibleWorldNet. In Section 4, we describe the structure of experiments, from which we obtained the results presented and discussed in Section 5. We offer a brief survey of related work in Section 6, before making concluding remarks in Section 7.
|
| 26 |
+
|
| 27 |
+
# 2 DATASET CREATION
|
| 28 |
+
|
| 29 |
+
Formal logics provide a symbolic toolkit for encoding and examining patterns of reasoning. They are structural calculi aiming to codify the norms of correct thought. The meanings of such statements are invariant to what the particular propositions stand for: to understand the entailment $( p \land q ) \models q$ , we only need to understand the semantics of—or related syntactic rules governing—a finite set of logical connectives, while $p$ and $q$ are meaningless arbitrary symbols selected to stand for distinct propositions. In other words, the problem of determining whether an entailment holds is a purely structural sequence-based problem: to evaluate whether an entailment is true, only the meaning of— or inference rules governing—the connectives is relevant. Everything else only has meaning via its place in the structure specified by an expression. These qualities suggest that detecting logical entailment is an excellent task for measuring the ability of models to capture, understand, or exploit structure. We present in this paper a generic process for generating entailment datasets, explained in detail in Appendix A, for any given logical system. In the specific dataset—generated through this process—presented in this section, we will focus on propositional logic, which is decidable but requires a worst case of $O ( 2 ^ { n } )$ operations (e.g. resolution steps, truth table rows), where $n$ is the number of unique propositional variables, to verify entailment.
|
| 30 |
+
|
| 31 |
+
Our dataset∗ $\mathcal { D }$ is composed of triples of the form $( A , B , A \models B )$ , where $A$ and $B$ are formulas of propositional logic, and $A \models B$ is 1 if $A$ entails $B$ , and 0 otherwise. For example, the data point $( p \land q , q , 1 )$ is positive because $p \wedge q$ entails $q$ , whereas $( q \vee r , r , 0 )$ is negative because $q \vee r$ does not entail $r$ . Entailment is primarily a semantic notion: $A$ entails $B$ if every model in which $A$ is true is also a model in which $B$ is true.
|
| 32 |
+
|
| 33 |
+
We impose various requirements on the dataset, to rule out superficial structural differences between $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ that can be easily exploited by “trivial” baselines†. We impose the following high level constraints on our data through the generative process, explained in detail in Appendix A: our classes must be balanced, and formulas in positive and negative examples must have the same distribution over length. Furthermore, we attempt to ensure that there are no recognisable differences in the distributions of lexical or syntactic features between the positive and negative examples. It would not be acceptable, for example, if a typical $B$ formula in a positive entailment $( A , B , 1 )$ had more disjunctions than a $B ^ { \prime }$ formula in a negative entailment $( A ^ { \prime } , B ^ { \prime } , 0 )$ .
|
| 34 |
+
|
| 35 |
+
If we simply sample formulas $A$ and $B$ and evaluate whether $A \models B$ , there are significant differences between the distributions of formulas for the positive and negative examples, which models can learn to exploit without needing to understand the structure of the problem. To avoid these issues, we use a different approach, that satisfies the above requirements. We sample 4-tuples of formulas $\left( A _ { 1 } , B _ { 1 } , A _ { 2 } , B _ { 2 } \right)$ such that:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
A _ { 1 } \models B _ { 1 } \qquad A _ { 2 } \models B _ { 2 } \qquad A _ { 1 } \uplus B _ { 2 } \qquad A _ { 2 } \uplus B _ { 1 }
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Here, each of the four formulas appears in one positive entailment and one negative entailment. This way, we minimise crude structural differences between the positive and negative examples. Here is a simple example (although the actual dataset has much longer formulas) of such a 4-tuple of datapoints:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
p \models p \lor q \qquad \neg p \land \neg q \models \neg q \qquad p \nmid \nleftarrow q \qquad \neg p \land \neg q \nmid \nleftarrow p \lor q
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Table 1: Dataset Statistics
|
| 48 |
+
|
| 49 |
+
<table><tr><td></td><td>Size</td><td>Mean # Vars</td><td>Mean # Ops</td><td>Mean Length</td><td>Mean 2# Vars</td></tr><tr><td>Train</td><td>100,000</td><td>4.5</td><td>5.3</td><td>11.3</td><td>52.2</td></tr><tr><td>Validate</td><td>5,000</td><td>5.1</td><td>6.8</td><td>13.0</td><td>75.7</td></tr><tr><td>Test (easy)</td><td>5,000</td><td>5.2</td><td>6.9</td><td>13.1</td><td>81.0</td></tr><tr><td>Test (hard)</td><td>5,000</td><td>5.8</td><td>17.4</td><td>31.5</td><td>184.4</td></tr><tr><td>Test (big)</td><td>5,000</td><td>8.0</td><td>20.9</td><td>38.7</td><td>3310.8</td></tr><tr><td>Test (massive)</td><td>2,230</td><td>18.4</td><td>49.4</td><td>88.8</td><td>848,570.0</td></tr><tr><td>Test (exam)</td><td>100</td><td>2.4</td><td>3.9</td><td>8.6</td><td>5.8</td></tr></table>
|
| 50 |
+
|
| 51 |
+
To generate these 4-tuples, we first generate pairs $( A , B )$ such that $A \models B$ . (To test if $A \models B$ , we test whether $A \land \lnot B$ is satisfiable, using minisat (Sorensson & Een, 2005)). Then we search through the set of pairs, looking for pairs of pairs, $( A _ { 1 } , B _ { 1 } )$ and $( A _ { 2 } , B _ { 2 } )$ , such that $A _ { 1 } \nvDash B _ { 2 }$ and $A _ { 2 } \nvDash B _ { 1 }$ . We present, in Appendix A, the full details of this generative process, its constraints and guarantees, and how we used particular baselines to validate the data.
|
| 52 |
+
|
| 53 |
+
# 2.1 SPLITTING THE DATASET
|
| 54 |
+
|
| 55 |
+
We produced train, validation, and test (easy) by generating one large set of 4-tuples, and splitting them into groups of sizes 100000, 5000, and 5000. The difficulty of evaluating an entailment depends on the number of propositional variables and the number of operators in the two formulas. In training, validation, and test (easy), we sample the number of propositional variables uniformly between 1 and 10 (there are 26 propositional variables in total: $a$ to $z$ ). In test (hard), we sample uniformly between 5 and 10. Our formula sampling method takes a parameter specifying the desired number of operators in the formula. In training, validation, and test (easy), the number of operators in a formula is sampled uniformly between 1 and 10. In our hard test set, the number of operators in a formula is sampled uniformly between 15 and 20.
|
| 56 |
+
|
| 57 |
+
For the test (big) dataset, we sampled formulas using between 1 and 20 variables (uniformly), and between 10 and 30 operators (again, uniformly). For test (massive), we used a different generating mechanism. We first sampled pairs of formulas $A$ , $B$ such that $A \models B$ . These had between 20 and 26 variables, and between 20 and 30 operators each. Then we generated a $B ^ { * }$ by mutating $B$ and checking that $A \nvDash B ^ { * }$ . See Table 1 for detailed statistics of the dataset sections, including the average difficulty (based on a complexity of $O ( 2 ^ { \# \operatorname { V a r s } } ) )$ of sequents in each fold.
|
| 58 |
+
|
| 59 |
+
The test (exam) dataset was assembled from 100 examples of logical entailment in the wild. We looked through various logic textbooks for classic examples of entailments. From these textbooks, we extracted true entailment triples $( A , B , 1 )$ where $A \models B$ . We added false triples $( A , B ^ { * } , 0 )$ , by mutating $B$ into $B ^ { * }$ and checking that $A \nvDash B ^ { * }$ .
|
| 60 |
+
|
| 61 |
+
In order to test models’ ability to generalise to new unseen formulas, we pruned out cases where formulas seen in validation and test were $\alpha$ -equivalent (equivalent up to renaming of symbols) to formulas seen in training. So, for example, if it had seen $p \Vdash ( \neg q \land p )$ in training, we did not want $r \Vdash ( \neg s \land r )$ to appear in either the test or validation sets. To do this, we converted all formulas to de-Bruijn form (see Pierce (2002), Chapter 6), and filtered out formulas in validation and test whose de-Bruijn form was identical to one of those in training. This prevents the system from being able to simply memorise examples it has seen in training.
|
| 62 |
+
|
| 63 |
+
# 2.2 DATA AUGMENTATION THROUGH SYMBOLIC VOCABULARY PERMUTATION
|
| 64 |
+
|
| 65 |
+
As discussed above, the logical connectives $( \vee , \wedge , \dots )$ are the only elements of the language in each dataset that have consistent implicit semantics across expressions. In this sense, two entailments $p \wedge q \vdash q$ and $a \wedge b \mapsto b$ should ideally be treated as identical by the model. To encourage models to capture this invariance, we add an optional data processing layer during training (not testing) whereby symbols are consistently replaced by other symbols of the same type within individual entailments before being input to the network according to the process described below. This is achieved by randomly sampling a permutation of $a , \ldots , z$ (the propositional variables used) for every training example, and applying this permutation to the left and right sequents. This process is analogous to augmenting image classification training with random reflections and crops.
|
| 66 |
+
|
| 67 |
+
# 3 MODELS
|
| 68 |
+
|
| 69 |
+
In this section, we first describe a couple of baseline models that verify the basic difficulty of the dataset, followed by a description of benchmark models which are commonly used (with some variation) in a variety of problems, and finally by a description of our new model, PossibleWorldNet.
|
| 70 |
+
|
| 71 |
+
# 3.1 BASELINES
|
| 72 |
+
|
| 73 |
+
The classes in the dataset are balanced in training, validation, and both test sets, so a random baseline (and a constant, majority-class predicting baseline) will obtain an accuracy of $50 \%$ on the test sets.
|
| 74 |
+
|
| 75 |
+
We define two neural baselines which, we believe, should not be able to perform competitively on this task, but may do better than random. The first is a linear bag of words (Linear BoW) model which embeds each symbol to a vector, and averages them, to produce a representation of each side of the sequent. These representations are then passed through a linear layer:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
P ( A \models B ) = \sigma \left( W \cdot \mathsf { c o n c a t } \left( g ( A ) , g ( B ) \right) + b \right) \quad \mathrm { w h e r e } \quad g ( X ) = \frac { 1 } { | X | } \sum _ { x \in X } \mathsf { e m b e d } ( x )
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
The second is a similar architecture, where the final linear layer is replaced with a multi-layer perceptron (MLP BoW):
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
P ( A \models B ) = \sigma ( { \mathrm { M L P } } ( \operatorname { c o n c a t } \left( g ( A ) , g ( B ) \right) ) ) \quad { \mathrm { w h e r e } } \quad g ( X ) = { \frac { 1 } { | X | } } \sum _ { x \in X } { \mathrm { e m b e d } } ( x )
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
In both of these cases, the baselines are expected to have limited performance since they can only capture entailment by modelling the contribution of symbols individually, rather than by modelling structure, since the summation in $g$ destroys all structural information (including word order). We use these results to provide an indication of the difficulty of the dataset.
|
| 88 |
+
|
| 89 |
+
# 3.2 BENCHMARKS
|
| 90 |
+
|
| 91 |
+
We present here a series of benchmark models, not only to serve the purpose of being grounds for comparison for new models tested against this dataset, but also to compare and contrast the performance of fairly ubiquitous model architectures on this purely syntactic problem.
|
| 92 |
+
|
| 93 |
+
We distinguish two categories of models: encoding models and relational models. Encoding models, with exceptions specified below, jointly learn an encoding function $f$ and an MLP, such that given a sequent $A \models B$ , the model expresses
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
P ( A \models B ) = \sigma \left( \operatorname { M L P } ( \operatorname { c o n c a t } ( f ( A ) , f ( B ) ) ) \right) .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
In this sense $f$ produces a representation of each side of the sequent which contains all the information needed for the MLP to decide on entailment. In contrast, relational models will observe the pair of expressions and make a decision, perhaps by traversing both expressions, or by relating substructure of one expression to that of the other. These models express a more general formulation
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
P ( A \models B ) = \sigma \left( f ( A , B ) \right) .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
# 3.2.1 ENCODER BENCHMARKS
|
| 106 |
+
|
| 107 |
+
The first encoder benchmark implemented is a Deep Convolutional Network Encoder (ConvNet Encoders), akin to architectures described in the convolutional networks for text literature (Kalchbrenner et al., 2014; Zhang et al., 2015; Kim et al., 2016). Here, the encoder function $f$ is a stack of one dimensional convolutions over sequence symbols embedded by an embedding operation embedSeq, interleaved with max pooling layers every $k$ layers (which is a model hyperparameter), followed by $n$ (also a hyperparameter) fully connected layers:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
f ( X ) = \mathbf { M L P } ( \mathbf { C o n v 1 D } _ { n } ( . . . \mathbf { m a x P o o l } ( \mathbf { C o n v 1 D } _ { k } ( . . . \mathbf { C o n v 1 D } _ { 1 } ( \mathbf { e m b e d S e q } ( X ) ) ) . . . ) ) . . ) )
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
The second and third encoder benchmarks are an LSTM (Hochreiter & Schmidhuber, 1997) encoder network (LSTM Encoders), and its bidirectional LSTM variant (BiDirLSTM Encoders). For the LSTM encoder, we embed the sequence symbols, and run an LSTM RNN over them, ignoring the output until the final state:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
f ( X ) = h _ { \mathrm { f i n a l } } \quad \mathrm { w h e r e } \quad h _ { \mathrm { f i n a l } } = \mathrm { L S T M } ( \mathrm { e m b e d S e q } ( X ) )
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
For the bidirectional variant, two separate LSTM RNNs ${ \mathrm { L S T M } } ^ { }$ and $\mathrm { L S T M } ^ { }$ are run over the sequence in opposite directions. Their respective final states are concatenated to form a representation of the expression:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { \begin{array} { r l } { f ( X ) = \mathrm { c o n c a t } ( h _ { \mathrm { f i n a l } } ^ { \left. } , h _ { \mathrm { f i n a l } } ^ { \right. } ) } & { \mathrm { w h e r e } \quad h _ { \mathrm { f i n a l } } ^ { \left. } = \mathrm { L S T M } ^ { \left. } ( \mathrm { e m b e d S e q } ( X ) ) } \\ { \mathrm { a n d } \quad h _ { \mathrm { f i n a l } } ^ { \right. } = \mathrm { L S T M } ^ { \right. } ( \mathrm { e m b e d S e q } ( X ) ) } \end{array} } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
The benchmarks described thus far do not explicitly condition on structure, even when it is known, as they are designed to traverse a sequence from left to right and model dependencies in the data implicitly. In contrast, we now consider encoder benchmarks which rely on the provision of the syntactic structure of the sequence they encode, and exploit it to determine the order of composition. This inductive bias, which may be incorrect in certain domains (e.g., where no syntax is defined) or difficult to achieve in domains such as natural language text (where syntactic structure is latent and ambiguous), is easy to achieve for logic (where the syntax is known). The experiments below will seek to demonstrate whether is a helpful inductive architectural bias.
|
| 126 |
+
|
| 127 |
+
The fourth and fifth encoding benchmarks are (tree) recursive neural networks (Tai et al., 2015; Le & Zuidema, 2015; Zhu et al., 2015; Allamanis et al., 2016), also known as TreeRNNs. These recursively encode the logical expression using the parse structure‡, where leaf nodes of the tree (propositional variables) are embedded as learnable vectors, and each logical operator then combines one or more of these embedded values to produce a new embedding. For example, the expression $( \neg a ) \lor b$ is parsed as the tree with leaves $a$ and $b$ , a unary node $\neg$ (with input the embedding of $a$ ), and a binary node $\vee$ (with inputs the embeddings of $\neg a$ and $b$ ). Following Allamanis et al. (2016), the fourth encoding benchmark is a simple TreeRNN (TreeNet Encoders), where each operator ‘op’ concatenates its inputs to a vector $x$ , and produces the output
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
p = { \frac { h } { \| h \| _ { 2 } } } \quad { \mathrm { w h e r e } } \quad h = W _ { 1 } ^ { \mathrm { o p } } x + W _ { 2 } ^ { \mathrm { o p } } \sigma ( W _ { 3 } ^ { \mathrm { o p } } x + b _ { 3 } ^ { \mathrm { o p } } ) + b _ { 1 } ^ { \mathrm { o p } } .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
The fifth and final encoding benchmark (TreeLSTM Encoders) is a variant of TreeRNNs which adapts LSTM cell updates. This helps capture long range dependencies and propagate gradient within the tree. Our implementation follows Tai et al. (2015), modified to have per-op parameters as per TreeRNNs (see, also, the work by Le & Zuidema (2015) and Zhu et al. (2015)).
|
| 134 |
+
|
| 135 |
+
# 3.2.2 RELATIONAL BENCHMARKS
|
| 136 |
+
|
| 137 |
+
In addition to these encoding benchmarks, we define a pair of relational benchmarks, following Rocktaschel et al. (2015). We will traverse the entire sequent with LSTM RNNs or bidirectional ¨ LSTM RNNs but concatenating the left hand side and right hand side sequences into a single sequence separated by a held-out symbol (effectively standing for $\vDash$ ). For the LSTM variant (LSTM Traversal), the model is:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
P ( A \models B ) = \sigma ( \mathbf { M L P } ( h _ { \mathrm { f i n a l } } ) ) \quad \mathrm { w h e r e } \quad h _ { \mathrm { f i n a l } } = \mathbf { L S T M } ( \mathrm { e m b e d S e q } ( \mathrm { j o i n } ( A , \mathrm { ^ { c } \vdash ^ { \circ } , } B ) ) )
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
For the bidirectional case (BiDirLSTM Traversal), the extension is
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r l } { P ( A \models B ) = \sigma ( \mathbf { M L P } ( h _ { \mathrm { f i n a l } } ^ { } ) ) } & { \mathrm { w h e r e } \quad h _ { \mathrm { f i n a l } } ^ { } = \mathrm { c o n c a t } ( h _ { \mathrm { f i n a l } } ^ { } , h _ { \mathrm { f i n a l } } ^ { } ) } \\ & { \mathrm { w i t h } \quad h _ { \mathrm { f i n a l } } ^ { } = \mathbf { L S T M } ^ { } ( \mathrm { e m b e d S e q } ( X ) ) } \\ & { \mathrm { a n d } \quad h _ { \mathrm { f i n a l } } ^ { } = \mathbf { L S T M } ^ { } ( \mathrm { e m b e d S e q } ( X ) ) } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
# 3.2.3 THE TRANSFORMER BENCHMARK
|
| 150 |
+
|
| 151 |
+
We also benchmark the Transformer model, also known as Attention Is All You Need (Vaswani et al., 2017), which is a sequence-to-sequence model achieving state-of-the-art results in machine translation. As in the relational LSTM models, we concatenate and embed the sequents, but instead of separating the sequents by a held-out symbol, we add a learnable bias to the right sequent in this embedding. This augments the Transformer’s method of adding timing signals to distinguishing symbols at different positions. We then decode a sequence of length 1 and apply a linear transformation to get the final entailment prediction logits.
|
| 152 |
+
|
| 153 |
+
# 3.3 THE POSSIBLEWORLDNET
|
| 154 |
+
|
| 155 |
+
In this section, we introduce our new model. Inspired by the semantic (model-theoretic) definition of entailment, we propose a variant on TreeNets that evaluates the pair of formulas in different “possible worlds”.
|
| 156 |
+
|
| 157 |
+
Entailment is, first and foremost, a semantic notion. Given a set $\mathcal { W }$ of worlds,
|
| 158 |
+
|
| 159 |
+
Here $s a t : W o r l d \times F o r m u l a B o o l$ indicates whether a formula is satisfied in a particular world.
|
| 160 |
+
|
| 161 |
+
We shall first define a variant of sat that produces integers, and then define another variant that operates on real values. First, define $s a t _ { 2 } : W o r l d \times F o r m u l a \{ 0 , 1 \}$ :
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
s a t _ { 2 } ( w , A ) = \mathbb { 1 } ( s a t ( w , A ) )
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
Using $s a t _ { 2 }$ , we can redefine entailment as:
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
A \models B \operatorname { i f f } \forall w \in \mathcal { W } s a t _ { 2 } ( w , A ) \leq s a t _ { 2 } ( w , B )
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Assume we have a finite set of worlds ${ \mathcal { W } } = \{ w _ { 1 } , . . . , w _ { n } \}$ ; then we can recast as:
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
P ( A \mid = B ) = \prod _ { i = 1 } ^ { n } \mathbb { 1 } ( s a t _ { 2 } ( w _ { i } , A ) \leq s a t _ { 2 } ( w _ { i } , B ) )
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
We are going to produce a relaxation of Proposition 1 by replacing $s a t _ { 2 }$ and $\leq$ with continuous functions. Assume we have a variant of $s a t _ { 2 }$ that produces vectors of real values:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
s a t _ { 3 } : W o r l d \times F o r m u l a \mathbb { R } ^ { d }
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
Assume we have a function $f : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } [ 0 , 1 ]$ that generalises $\leq$ to vectors of real values. Now we can rewrite as:
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
P ( A \left| = B \right. ) = \prod _ { i = 1 } ^ { n } f ( s a t _ { 3 } ( w _ { i } , A ) , s a t _ { 3 } ( w _ { i } , B ) )
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
In our neural model, $f$ is implemented by a simple linear layer using learnable weights $W _ { f }$ and $b _ { f }$ :
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
f ( x , y ) = \sigma ( W _ { f } \cdot \operatorname { c o n c a t } ( x , y ) + b _ { f } )
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
We use a set of random vectors to represent our worlds $\{ w _ { 1 } , . . . , w _ { n } \}$ , where $w _ { i } \in \mathbb { R } ^ { k }$ is a vector of length $k$ of values drawn uniformly randomly. We implement $s a t _ { 3 }$ using a simplified TreeNN (see Section 3.2) as described below. Since $s a t _ { 3 }$ depends on the particular world $w _ { i }$ we are currently evaluating, we add an additional parameter to the TreeNN so that the embedder has access to the current world $w _ { i }$ . We add an additional weight matrix $W _ { 4 } ^ { o p }$ so that propositional variables can learn which aspect of the current world to focus on. If the formula is of the form $o p ( l , r )$ , where $o p$ is nullary (a propositional variable), unary (e.g., negation), or binary (e.g., conjunction), and $l$ and $r$ are the embeddings of the constituents of the expression, then
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
s a t _ { 3 } ( w _ { i } , o p ( l , r ) ) = \frac { h } { \| h \| _ { 2 } } \quad \mathrm { w h e r e } \quad h = \left\{ \begin{array} { l l } { W _ { 4 } ^ { o p } w _ { i } } & { \mathrm { w h e r e ~ } o p \mathrm { ~ i s ~ n u l l a r y ~ ( l e a f ) } } \\ { W _ { 1 } ^ { o p } x + b _ { 1 } ^ { o p } } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $x = \mathrm { c o n c a t } ( l , r )$ .
|
| 204 |
+
|
| 205 |
+
To evaluate whether $A \models B$ , the PossibleWorldNet generates a set of imagined “worlds”, and then evaluates $A$ and $B$ in each of those worlds. It is a form of “convolution over possible worlds”. As we will see in Section 5, the quality of the model increases steadily as we increase the number of imagined worlds.
|
| 206 |
+
|
| 207 |
+
This architecture was inspired by semantic (model-theoretic) approaches to detecting entailment, but it does not encode any constraint on propositional logic in particular or formal logic in general. The procedure of evaluating sentences in multiple worlds, and combining those evaluations in one product, is just what “entailment” means; so we speculate that an architecture like this should, in principle, be equally applicable to other logics (e.g., intuitionistic logic, modal logics, first-order logic) and also to non-formal entailments in natural language sentences.
|
| 208 |
+
|
| 209 |
+
Abstracting away from the particular interpretation of these vectors as “worlds”, this method generates $n$ copies of the model with shared weights, one for each vector $w _ { i }$ ; each nullary operator learns a different projection on $w _ { i }$ . It makes predictions via a linear layer combining two representations, and then takes the product of the predictions as the overall prediction.
|
| 210 |
+
|
| 211 |
+
# 4 EXPERIMENTAL SETUP
|
| 212 |
+
|
| 213 |
+
For each encoder benchmark architecture, the parameters of the encoders for the left and right hand sides of the sequent are shared. The MLP which performs binary classification to detect entailment based on the expression representations produced by the encoders is model-specific (re-initialised for each model) and jointly trained. Symbol embedding matrices are also model-specific, shared across encoders, and jointly trained.
|
| 214 |
+
|
| 215 |
+
We implemented all architectures in TensorFlow (Abadi et al., 2016). We optimised all models with Adam (Kingma & Ba, 2014). We grid searched across learning rates in $[ 1 \mathrm { e } { - } 5 , 1 \mathrm { e } { - } 4 , 1 \mathrm { e } { - } 3 ]$ , minibatch sizes in [64, 128], and trained each model thrice with different random seeds. Per architecture, we grid-searched across specific hyperparameters as follows. We searched across 2 and 3 layer MLPs wherever an MLP existed in a benchmark, and across layer sizes in [32, 64] for MLP hidden layers, embedding sizes, and RNN cell size (where applicable). Additionally for convolutional networks, we searched across a number of convolutional layers in [4, 6, 8], across kernel size in [5, 7, 9], across number of channels in [32, 64], and across pooling interval in $[ 0 , 5 , 3 , 1 ]$ (where 0 indicates no pooling). For the Transformer model, we searched across the number of encoder and decoder layers in the range [6, 8, 10], dropout probability in the range $[ 0 , 0 . 1 , 0 . 5 ]$ , and filter size in the range [128, 256, 384]. Finally, for all models, we ran them with and without the symbol permutation data augmentation technique described in Section 2.2.
|
| 216 |
+
|
| 217 |
+
As a result of the grid search, we selected the best model for each architecture against validation results, and record training, validation, and all test accuracies for the associated time step, which we present below.
|
| 218 |
+
|
| 219 |
+
# 5 RESULTS AND DISCUSSION
|
| 220 |
+
|
| 221 |
+
Experimental results are shown in Table 2. The test scores of the best performing overall model are indicated in bold. The test scores of the best performing model which does not have privileged access to the syntax or semantics of the logic (i.e. excluding TreeRNN-based models) are italicised. The best benchmark test results are underlined.
|
| 222 |
+
|
| 223 |
+
We observe that the baselines are doing better than random (8.2 points above for the easy test set, for the MLP BoW, and 2.6 above random for the hard test set). This indicates that there are some small number of exploitable regularities at the symbolic level in this dataset, but that they do not provide significant information.
|
| 224 |
+
|
| 225 |
+
The baseline results show that convolution networks and BiDirLSTMs encoders obtain relatively mediocre results compared to other models, as do LSTM and BiDirLSTM Traversal models. LSTM encoders is the best performing model which does not have privileged access to the syntax trees. Their success relative to BiDirLSTMs Encoders could be due to their reduced number of parameters guarding against overfitting, and rendering them easier to optimise, but it is plausible BiDirLSTMs Encoders would perform similarly with a more fine-grained grid search. Both tree-based models take the lead amongst the benchmarks, with the TreeLSTM being the best performing benchmark overall on both test sets. For most models except baselines, the symbol permutation data augmentation yielded 2–3 point increase in accuracy on weaker models (BiDirLSTM encoders and traversals, an convolutional networks) and between 7–15 point increases for the Tree-based models. This indicates that this data augmentation strategy is particularly well fitted for letting structure-aware models capture, at the representational level, the arbitrariness of symbols indicating unbound variables.
|
| 226 |
+
|
| 227 |
+
Table 2: Propositional Logic Model Accuracy.
|
| 228 |
+
|
| 229 |
+
<table><tr><td colspan="2">model</td><td>valid</td><td>test (easy)</td><td>test (hard)</td><td>test (big)</td><td>test (massive)</td><td>test (exam)</td></tr><tr><td rowspan="2">baselines</td><td>Linear BoW</td><td>52.6</td><td>51.4</td><td>50.0</td><td>49.7</td><td>50.0</td><td>52.0</td></tr><tr><td>MLP BoW</td><td>57.8</td><td>57.1</td><td>51.0</td><td>55.8</td><td>49.9</td><td>56.0</td></tr><tr><td rowspan="8">benchmark models</td><td>Transformer</td><td>57.1</td><td>56.8</td><td>50.8</td><td>51.2</td><td>50.3</td><td>46.9</td></tr><tr><td>ConvNet Encoders</td><td>59.3</td><td>59.7</td><td>52.6</td><td>54.9</td><td>50.4</td><td>54.0</td></tr><tr><td>LSTM Encoders</td><td>68.3</td><td>68.3</td><td>58.1</td><td>61.1</td><td>52.7</td><td>70.0</td></tr><tr><td>BiDirLSTM Encoders</td><td>66.6</td><td>65.8</td><td>58.2</td><td>61.5</td><td>51.6</td><td>78.0</td></tr><tr><td>TreeNet Encoders</td><td>72.7</td><td>72.2</td><td>69.7</td><td>67.9</td><td>56.6</td><td>85.0</td></tr><tr><td>TreeLSTMEncoders</td><td>79.1</td><td>77.8</td><td>74.2</td><td>74.2</td><td>59.3</td><td>75.0</td></tr><tr><td>LSTMTraversal</td><td>62.5</td><td>61.8</td><td>56.2</td><td>57.3</td><td>50.6</td><td>61.0</td></tr><tr><td>BiDirLSTMTraversal</td><td>63.3</td><td>64.0</td><td>55.0</td><td>57.9</td><td>50.5</td><td>66.0</td></tr><tr><td>new model</td><td>PossibleWorldNet</td><td>98.7</td><td>98.6</td><td>96.7</td><td>93.9</td><td>73.4</td><td>96.0</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Overall, these results show clearly that models that exploit structure in problems where it is provided, unambiguous, and a central feature of the task, outperform models which must implicitly model the structure of sequences. LSTM-based encoders provide robust and competitive results, although bidirectionality is not necessarily always the obvious choice due to optimisation and overfitting problems. Perhaps counter-intuitively, given the results of Rocktaschel et al. (2015), traversal ¨ models do not outperform encoding models in this pair-of-sequences traversal problem, indicating that they may be better at capturing the sort of long-range dependencies need to recognise textual entailment better than they are at capturing structure in general.
|
| 232 |
+
|
| 233 |
+
We conclude, from these benchmark results, that tree structured networks may be a better choice for domains with unambiguous syntax, such as analysing formal languages or programs. For domains such as natural language understanding, both convolutional and recurrent network architectures have had some success, but our experiments indicate that this may be due to the fact that existing tasks favour models which capture representational or semantic regularities, and do not adequately test for structural or syntactic reasoning. In particular, the poor performance of convolutional nets on this task serves as a useful indicator that while they present the right inductive bias for capturing structure in images, where topological proximity usually indicates a joint semantic contribution (pixels close by are likely to contribute to the same “part” of an image, such as an edge or pattern), this inductive bias does not carry over to sequences particularly well (where dependencies may be significantly more sparse, structured, and distant)§. The results for the transformer benchmark indicate that while this architecture can capture sufficient structure for machine translation, allowing for the appropriate word order in the output, and accounting for disambiguation or relational information where it exists within sentences, it does not capture with sufficient precision the more hierarchical structure which exists in logical expressions.
|
| 234 |
+
|
| 235 |
+
The best performing model overall is the PossibleWorldNet, which achieves significantly higher results than the other models, with $9 9 . 3 \%$ accuracy on test (easy), and $9 7 . 3 \%$ accuracy on test (hard). This is as to be expected, as it has the strongest inductive bias. This inductive bias has two components. First, the model has knowledge of the syntactic structure of the expression, since it is a variant of a TreeNet. Second, inspired by the definition of semantic (model-theoretic) entailment in general, the model evaluates the pair of formulas in lots of different situations (“possible worlds”) and combines the various results together in a product¶.
|
| 236 |
+
|
| 237 |
+
The quality of the PossibleWorldNet depends directly on the number of “possible worlds” it considers (see Figure 1). As we increase the number of possible worlds, the validation error rate goes down steadily. Note that the data-efficiency also increases as we increase the number of worlds. This is because adding worlds to the model does not increase the number of model parameters—it just increases the number of different “possibilities” that are considered.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 1: The quality of the PossibleWorldNet as we vary the number of possible worlds
|
| 241 |
+
|
| 242 |
+
In propositional logic, of course, if we are allowed to generate every single truth-value assignment, then it is trivial to detect entailment by checking each one. In our big test set, there are on average more than 3,000 possible truth-value assignments. In our massive test set, there are on average over 800,000 possible assignments. (See Table 1). The PossibleWorldNet considers at most 256 different worlds, which is only $7 \%$ of the expected total number of rows needed in the big test set, and only $0 . 0 3 \%$ of the expected number of rows needed for the massive test set.
|
| 243 |
+
|
| 244 |
+
To understand this result, we sample 32, 64, 128 and 256 truth table rows (variable truth-value assignments) for each pair of formulas in Test (hard), and reject entailment if a single evaluation for the formulas amongst these finds the left hand side to be true while the right hand side is false. This gives us an estimate of the accuracy of sampling a number of truth table rows equal to the number of possible worlds in our model. We estimate that these statistical methods have $7 5 . 9 \%$ , $8 6 . 5 \%$ , $9 3 . 4 \%$ and $9 7 . 2 \%$ chance of finding a countermodel, respectively. This seems to indicate that PossibleWorldNet is capable of exploiting repeated computation across projections of random noise in order to learn, solely based on the label likelihood objective, something akin to a modelbased solution to entailment by treating the random-noise as variable valuations.
|
| 245 |
+
|
| 246 |
+
# 6 RELATED WORK
|
| 247 |
+
|
| 248 |
+
Zaremba et al. (2014) show how a neural architecture can be used to optimise matrix expressions. They generate all expressions up to a certain depth, group them into equivalence classes, and train a recursive neural network classifier to detect whether two expressions are in the same equivalence class. They use a recursive neural network (Socher et al., 2012) to guide the search for an optimised equivalent expression. There are two major differences between this work and ours. First, the classifier is predicting whether two matrix expressions (e.g. $A$ and $( A ^ { T } ) ^ { T } ,$ ) compute the same values; this is an equivalence relation, while entailment is a partial order. Second, their dataset consists of matrix expressions containing at most one variable, while our formulas contain many variables.
|
| 249 |
+
|
| 250 |
+
Allamanis et al. (2016) use a recursive neural network to learn whether two expressions are equivalent. They tested on two datasets: propositional logic and polynomials. There are two main differences between their approach and ours. First, we consider entailment while they consider equivalence; equivalence is a symmetric relation, while entailment is not symmetric. Second, we consider entailment as a relational classification problem: given a pair of expressions $A$ and $B$ , predict whether $A$ entails $B$ . In their paper, by contrast, they generate a set of $k$ equivalence-classes of formulas with the same truth-conditions, and ask the network to predict which of these $k$ classes a single formula falls into. Their task is more specific: their network is only able to classify a formula from a new equivalence class that has not been seen during training if it has additional auxiliary information about that class (e.g. exemplar members of the class).
|
| 251 |
+
|
| 252 |
+
Recognizing textual entailment (RTE) between natural language sentences is a central task in natural language processing. (See Dagan et al. (2006); for a recent dataset, see Bowman et al. (2015)). Some approaches (e.g., Wang & Jiang (2015) and Rocktaschel et al. (2015)) use LSTMs with attention, ¨ while others (e.g., Yin et al. (2015)) use a convolutional neural network with attention. Of course, recognizing entailment between natural language sentences is a very different task from recognizing entailment between logical formulas. Evaluating an entailment between natural language sentences requires understanding the meaning of the non-logical terms in the sentence. For example, the inference from “An ice skating rink placed outdoors is full of people” to “A lot of people are in an ice skating park” requires knowing the non-logical semantic information that an outdoors ice skating rink is also an ice skating park.
|
| 253 |
+
|
| 254 |
+
Current neural models do not always understand the structure of the sentences they are evaluating. In Bowman et al. (2015), all the neural models they considered wrongly claimed that “A man wearing padded arm protection is being bitten by a German shepherd dog” entails “A man bit a dog”. We believe that isolating the purely structural sub-problem will be useful because only networks that can reliably predict entailment in a purely formal setting, such as propositional (or first-order) logic, will be capable of getting these sorts of examples consistently correct.
|
| 255 |
+
|
| 256 |
+
# 7 CONCLUSION
|
| 257 |
+
|
| 258 |
+
In this paper, we have introduced a new process for generating datasets for the purpose of recognising logical entailment. This was used to compare benchmarks and a new model on a task which is primarily about understanding and exploiting structure. We have established two clear results on the basis of this task. First, and perhaps most intuitively, architectures which make explicit use of structure will perform significantly better than those which must implicitly capture it. Second, the best model is the one that has a strong architectural bias towards capturing the possible world semantics of entailment. In addition to these two points, experimental results also shed some light on the relative abilities of implicit structure models—namely LSTM and Convolution networkbased architectures—to capture structure, showing that convolutional networks may not present the right inductive bias to capture and exploit the heterogeneous and deeply structured syntax in certain sequence-based problems, both for formal and natural languages.
|
| 259 |
+
|
| 260 |
+
This conclusion is to be expected: the most successful models are those with the most prior knowledge about the generic structure of the task at hand. But our dataset throws new light on this unsurprising thought, by providing a new data-point on which to evaluate neural models’ ability to understand structural sequence problems. Logical entailment, unlike textual entailment, depends only on the meaning of the logical operators, and of the place particular arbitrarily-named variables hold within a structure. Here, we have a task in which a network’s understanding of structure can be disentangled from its understanding of the meaning of words.
|
| 261 |
+
|
| 262 |
+
# ACKNOWLEDGMENTS
|
| 263 |
+
|
| 264 |
+
We thank our colleagues at DeepMind for their insightful comments during the preparation of this paper, and in particular Yujia Li, Chris Dyer, and Alex Graves.
|
| 265 |
+
|
| 266 |
+
# REFERENCES
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Miltiadis Allamanis, Pankajan Chanthirasegaran, Pushmeet Kohli, and Charles Sutton. Learning continuous semantic representations of symbolic expressions. arXiv preprint arXiv:1611.01423, 2016.
|
| 271 |
+
|
| 272 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 273 |
+
|
| 274 |
+
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. arXiv preprint arXiv:1508.05326, 2015.
|
| 275 |
+
|
| 276 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment, pp. 177–190. Springer, 2006.
|
| 277 |
+
|
| 278 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. arXiv preprint arXiv:1703.07469, 2017.
|
| 279 |
+
|
| 280 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, 2016.
|
| 281 |
+
|
| 282 |
+
Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Advances in Neural Information Processing Systems, pp. 1828–1836, 2015.
|
| 283 |
+
|
| 284 |
+
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems, pp. 1693–1701, 2015.
|
| 285 |
+
|
| 286 |
+
Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. arXiv preprint arXiv:1511.02301, 2015.
|
| 287 |
+
|
| 288 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 289 |
+
|
| 290 |
+
Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Advances in neural information processing systems, pp. 190–198, 2015.
|
| 291 |
+
|
| 292 |
+
Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015.
|
| 293 |
+
|
| 294 |
+
Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In EMNLP, volume 3, pp. 413, 2013.
|
| 295 |
+
|
| 296 |
+
Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for modelling sentences. arXiv preprint arXiv:1404.2188, 2014.
|
| 297 |
+
|
| 298 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. Character-aware neural language models. In AAAI, pp. 2741–2749, 2016.
|
| 299 |
+
|
| 300 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 301 |
+
|
| 302 |
+
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.
|
| 303 |
+
|
| 304 |
+
Phong Le and Willem Zuidema. Compositional distributional semantics with long short term memory. arXiv preprint arXiv:1503.02510, 2015.
|
| 305 |
+
|
| 306 |
+
Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 307 |
+
|
| 308 |
+
Wang Ling, Edward Grefenstette, Karl Moritz Hermann, Toma´s Ko ˇ cisk ˇ y, Andrew Senior, Fumin \` Wang, and Phil Blunsom. Latent predictor networks for code generation. arXiv preprint arXiv:1603.06744, 2016.
|
| 309 |
+
|
| 310 |
+
Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andy Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
|
| 311 |
+
|
| 312 |
+
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.
|
| 313 |
+
|
| 314 |
+
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. arXiv preprint arXiv:1611.01855, 2016.
|
| 315 |
+
|
| 316 |
+
Benjamin C Pierce. Types and programming languages. MIT press, 2002.
|
| 317 |
+
|
| 318 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
|
| 319 |
+
|
| 320 |
+
Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
|
| 321 |
+
|
| 322 |
+
Tim Rocktaschel, Edward Grefenstette, Karl Moritz Hermann, Tom ¨ a´s Ko ˇ cisk ˇ y, and Phil Blunsom. \` Reasoning about entailment with neural attention. arXiv preprint arXiv:1509.06664, 2015.
|
| 323 |
+
|
| 324 |
+
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.
|
| 325 |
+
|
| 326 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 327 |
+
|
| 328 |
+
Richard Socher, Brody Huval, Christopher D Manning, and Andrew Y Ng. Semantic compositionality through recursive matrix-vector spaces. In Proceedings of the 2012 joint conference on empirical methods in natural language processing and computational natural language learning, pp. 1201–1211. Association for Computational Linguistics, 2012.
|
| 329 |
+
|
| 330 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , 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.
|
| 331 |
+
|
| 332 |
+
Niklas Sorensson and Niklas Een. Minisat v1. 13-a sat solver with conflict-clause minimization. SAT, 2005(53):1–2, 2005.
|
| 333 |
+
|
| 334 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 335 |
+
|
| 336 |
+
Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
|
| 337 |
+
|
| 338 |
+
Yuandong Tian and Yan Zhu. Better computer go player with neural network and long-term prediction. arXiv preprint arXiv:1511.06410, 2015.
|
| 339 |
+
|
| 340 |
+
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. 6000–6010, 2017.
|
| 341 |
+
|
| 342 |
+
Shuohang Wang and Jing Jiang. Learning natural language inference with lstm. arXiv preprint arXiv:1512.08849, 2015.
|
| 343 |
+
|
| 344 |
+
Wenpeng Yin, Hinrich Schutze, Bing Xiang, and Bowen Zhou. Abcnn: Attention-based convolu- ¨ tional neural network for modeling sentence pairs. arXiv preprint arXiv:1512.05193, 2015.
|
| 345 |
+
|
| 346 |
+
Wojciech Zaremba, Karol Kurach, and Rob Fergus. Learning to discover efficient mathematical identities. In Advances in Neural Information Processing Systems, pp. 1278–1286, 2014.
|
| 347 |
+
|
| 348 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in neural information processing systems, pp. 649–657, 2015.
|
| 349 |
+
|
| 350 |
+
Xiaodan Zhu, Parinaz Sobihani, and Hongyu Guo. Long short-term memory over recursive structures. In International Conference on Machine Learning, pp. 1604–1612, 2015.
|
| 351 |
+
|
| 352 |
+
# A THE DATASET
|
| 353 |
+
|
| 354 |
+
# A.1 DATASET REQUIREMENTS
|
| 355 |
+
|
| 356 |
+
Our dataset $\mathcal { D }$ is composed of triples of the form $( A , B , A \models B )$ , where $A \models B$ is 1 if $A$ entailsk $B$ , and 0 otherwise. For example:
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { c } { { ( p \wedge q , q , 1 ) } } \\ { { ( q \vee r , r , 0 ) } } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
We wanted to ensure that simple baseline models are unable to exploit simple statistical regularities to perform well in this task. We define a series of baseline models which, due to their structure or the information they have access to, should not be able to solve the entailment recognition problem described in this paper. We distinguish baselines for which we believe there is little chance of them detecting entailment, from those for which there categorically cannot be true modelling of entailment. The baselines which categorically cannot detect entailment are encoding models which only observe one side of the sequent:
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
P ( A \models B ) = \sigma \left( \mathbf { M L P } ( f ( A ) ) \right) \quad { \mathrm { o r } } \quad P ( A \models B ) = \sigma \left( \mathbf { M L P } ( f ( B ) ) \right)
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
where $f$ is a linear bag of words encoder, an MLP bag of words encoder, or a TreeNet.
|
| 369 |
+
|
| 370 |
+
Because the dataset contains a roughly balanced number of positive and negative examples, it follows that we should expect any model which only sees part of the sequent to perform in line with a random classifier. If they outperform a random baseline on test, there is a structural or symbolic regularity on one side (or both) which is sufficient to identify some subset of positive or negative examples. We use these baselines to verify the soundness of the generation process.
|
| 371 |
+
|
| 372 |
+
Let $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ be the positive and negative entailments:
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { c } { \mathcal { D } ^ { + } = \{ ( A , B ) \mid ( A , B , 1 ) \in \mathcal { D } \} } \\ { \mathcal { D } ^ { - } = \{ ( A , B ) \mid ( A , B , 0 ) \in \mathcal { D } \} } \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
We impose various requirements on the dataset, to rule out superficial syntactic differences between $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ that can be easily exploited by the simple baselines described above. We require that our classes are balanced:
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\begin{array} { r c l } { | \mathcal { D } ^ { + } | } & { = } & { | \mathcal { D } ^ { - } | } \end{array}
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
We do not want there to be any obvious difference in the length of formulas in $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ :
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\begin{array} { r l r } { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } l e n g t h ( A ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } l e n g t h ( A ) } \\ { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } l e n g t h ( B ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } l e n g t h ( B ) } \end{array}
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
We want there to be the same number of new free variables (variables appearing in $\mathbf { B }$ that do not appear in A) in both $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ :
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r l r } { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } | v a r s ( B ) - v a r s ( A ) | } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } | v a r s ( B ) - v a r s ( A ) | } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
Let $n u m ( A , o p )$ be the number of occurrences of operator $o p$ in formula $A$ . So, for example, $n u m ( \neg ( p \land \neg q ) , \neg ) = 2$ . We impose the constraint that for each operator $o p \in \{ \neg , \land , \lor , \to \}$ , that
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { r l r } { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } { \pi } u m ( A , o p ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } { \pi } u m ( A , o p ) } \\ { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } { n u m } ( B , o p ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } { n u m } ( B , o p ) } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
kThroughout, we focus on classical propositional logic, and do not consider e.g., intuitionistic entailment.
|
| 403 |
+
|
| 404 |
+
Furthermore, we require that the number of occurrences of an operator at each level in the abstract syntax tree is the same in $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ . It would not be acceptable if, for example, a typical $B ^ { + }$ from ${ \dot { \mathcal { D } } } ^ { + }$ had more disjunctions at the top of the syntax tree than $B ^ { - }$ from $\mathcal { D } ^ { - }$ . Let $n u m \_ a t ( B , l e v e l , o p )$ be the number of occurrences of operator $o p$ at level in the syntax tree for $B$ . We also require that, for each op and level:
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { r l r } { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } n u m _ { - } a t ( A , l e v e l , o p ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } n u m _ { - } a t ( A , l e v e l , o p ) } \\ { \underset { ( A , B ) \sim \mathcal { D } ^ { + } } { \mathbb { E } } n u m _ { - } a t ( B , l e v e l , o p ) } & { = } & { \underset { ( A , B ) \sim \mathcal { D } ^ { - } } { \mathbb { E } } n u m _ { - } a t ( B , l e v e l , o p ) } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
# A.2 DATASET GENERATION
|
| 411 |
+
|
| 412 |
+
# A.2.1 A NAIVE APPROACH TO DATASET GENERATION
|
| 413 |
+
|
| 414 |
+
A simple way to generate an entailment dataset would be to alternate between first sampling formulas $A ^ { + }$ and $\dot { B } ^ { + }$ such that $A ^ { + } \models B ^ { + }$ , and second sampling formulas $A ^ { - }$ and $B ^ { - }$ such that $A ^ { \bar { - } } \nvDash B ^ { - }$ . Since we are alternating between $\vDash$ and $\nvDash$ , we are guaranteed to produce balanced classes. Unfortunately, this straightforward approach generates datasets that violate most of our requirements above. See Table 3 for the details.
|
| 415 |
+
|
| 416 |
+
In particular, the mean number of negations, conjunctions, and disjunctions at the top of the syntax tree $( n u m . a t ( \cdot , 0 , o p ) )$ is markedly different. $A ^ { + }$ has significantly more conjunctions at the top of the syntax tree than $A ^ { - }$ , while $B ^ { + }$ has significantly fewer than $B ^ { - }$ . Conversely, $A ^ { + }$ has significantly fewer disjunctions at the top of the syntax tree than $A ^ { - }$ , while $B ^ { + }$ has significantly more than $B ^ { - }$ .
|
| 417 |
+
|
| 418 |
+
The mean number of satisfying truth-value assignments $( s a t ( \cdot ) )$ is also markedly different: $A ^ { + }$ is true in on average 3.7 truth-value assignments (i.e. it is a very specific formula which is only true under very particular circumstances), while $A ^ { - }$ is true in 10.3 truth-value assignments (i.e. it is true in a wider range of circumstances).
|
| 419 |
+
|
| 420 |
+
If we look at the mean number of variables appearing in $B$ that do not appear in $A$ , there is also a striking difference between $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ . The mean number of new variables in $\mathnormal { v a r s } ( B ^ { + } ) ~ -$ $v a r s ( A ^ { \ + } )$ is 0.80 while the mean number of new variables in var $s ( B ^ { - } ) - v a r s ( A ^ { - } )$ is 1.39 with a $\chi ^ { 2 }$ of 3308.1 and 8 degrees of freedom.
|
| 421 |
+
|
| 422 |
+
We can use these statistics to develop simple heuristic baselines that will be unreasonably effective on the dataset described above: we can estimate whether $A \models B$ by comparing the lengths of $A$ and $B$ , or by looking at the number of variables in $B$ that do not appear in $A$ , or by looking at the topmost connective in $A$ and $B$ .
|
| 423 |
+
|
| 424 |
+
Table 3: Requirement violations in the naive approach, with $\vert \mathcal { D } \vert = 5 0 , 0 0 0$
|
| 425 |
+
|
| 426 |
+
<table><tr><td></td><td>A+</td><td>A-</td><td>x²</td><td>x² df</td><td>B+</td><td>B-</td><td>x²</td><td>x² df</td></tr><tr><td>length(.)</td><td>6.62</td><td>6.45</td><td>70.6</td><td>9</td><td>8.33</td><td>8.28</td><td>304.9</td><td>16</td></tr><tr><td>num(.,-)</td><td>1.47</td><td>1.33</td><td>309.4</td><td>8</td><td>1.77</td><td>1.91</td><td>139.0</td><td>9</td></tr><tr><td>num(·, ^)</td><td>1.52</td><td>1.33</td><td>308.6</td><td>8</td><td>1.70</td><td>1.94</td><td>134.0</td><td>11</td></tr><tr><td>num(-,v)</td><td>1.30</td><td>1.40</td><td>86.9</td><td>8</td><td>1.95</td><td>1.69</td><td>127.0</td><td>10</td></tr><tr><td>num_at(·,0,-)</td><td>0.31</td><td>0.22</td><td>532.4</td><td>1</td><td>0.18</td><td>0.30</td><td>350.9</td><td>1</td></tr><tr><td>num_at(·,1,-)</td><td>0.32</td><td>0.31</td><td>7.5</td><td>2</td><td>0.39</td><td>0.41</td><td>3.2</td><td>2</td></tr><tr><td>num_at(·,2,-)</td><td>0.31</td><td>0.31</td><td>8.8</td><td>4</td><td>0.56</td><td>0.54</td><td>5.3</td><td>4</td></tr><tr><td>num_at(-,0, ^)</td><td>0.35</td><td>0.2</td><td>1382.9</td><td>1</td><td>0.13</td><td>0.33</td><td>1076.4</td><td>1</td></tr><tr><td>num_at(.,1, ^)</td><td>0.32</td><td>0.31</td><td>36.5</td><td>2</td><td>0.39</td><td>0.40</td><td>6.5</td><td>2</td></tr><tr><td>num_at(-,2,^)</td><td>0.31</td><td>0.32</td><td>3.2</td><td>4</td><td>0.56</td><td>0.53</td><td>16.5</td><td>4</td></tr><tr><td>num_at(.,0, v)</td><td>0.16</td><td>0.28</td><td>1070.3</td><td>1</td><td>0.34</td><td>0.16</td><td>752.4</td><td>1</td></tr><tr><td>num_at(.,1, ν)</td><td>0.30</td><td>0.32</td><td>66.0</td><td>2</td><td>0.42</td><td>0.34</td><td>141.1</td><td>2</td></tr><tr><td>num_at(-,2,ν)</td><td>0.32</td><td>0.31</td><td>12.9</td><td>4</td><td>0.57</td><td>0.52</td><td>39.7</td><td>4</td></tr><tr><td>#sat(.)</td><td>3.7</td><td>10.3</td><td>11265</td><td>174</td><td>22.1</td><td>11.7</td><td>3702.8</td><td>241</td></tr></table>
|
| 427 |
+
|
| 428 |
+
# A.2.2 OUR PREFERRED APPROACH TO DATASET GENERATION
|
| 429 |
+
|
| 430 |
+
In order to satisfy our requirements above, we took a different approach to dataset generation. In order to ensure that there are no crude statistical measurements that can detect differences between $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ , we change the generation procedure so that every formula appears in both $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ . We sample 4-tuples of formulas $\left( A _ { 1 } , B _ { 1 } , A _ { 2 } , B _ { 2 } \right)$ such that:
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\begin{array} { r l r } { A _ { 1 } } & { \mapsto } & { B _ { 1 } } \\ { A _ { 2 } } & { \mapsto } & { B _ { 2 } } \\ { A _ { 1 } } & { \mapsto } & { B _ { 2 } } \\ { A _ { 2 } } & { \mapsto } & { B _ { 1 } } \end{array}
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Here, each of the four formulas appears in one positive entailment and one negative entailment∗∗.
|
| 437 |
+
|
| 438 |
+
Using this alternative approach, we are able to satisfy the requirements above. By construction, the mean length, number of operators at a certain level in the syntax tree, and the number of satisfying truth-value assignments is exactly the same for $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ . See Table 4.
|
| 439 |
+
|
| 440 |
+
The only crude difference remaining is in the number of new variables. If we look at the number of variables appearing in $B$ that do not appear in $A$ , there is a noticeable difference between $\mathcal { D } ^ { + }$ and $\mathcal { D } ^ { - }$ . The mean number of new variables in var $s ( B ^ { + } ) - v a r s ( A ^ { + } )$ is 1.25 while the mean number of new variables in var $s ( B ^ { - } ) - v a r s ( A ^ { - } )$ is 1.60 with a $\chi ^ { 2 }$ of 922.1 and 8 degrees of freedom.
|
| 441 |
+
|
| 442 |
+
Table 4: Statistics for the preferred approach that generates 4-tuples, with $\vert \mathcal { D } \vert = 5 0 , 0 0 0$
|
| 443 |
+
|
| 444 |
+
<table><tr><td></td><td>A+</td><td>A-</td><td>x²</td><td>x² df</td><td>B+</td><td>B-</td><td>X²</td><td>x² df</td></tr><tr><td>length(.)</td><td>6.33</td><td>6.33</td><td>0.0</td><td>9</td><td>6.38</td><td>6.38</td><td>0.0</td><td>16</td></tr><tr><td>num(-,-)</td><td>1.42</td><td>1.42</td><td>0.0</td><td>9</td><td>1.26</td><td>1.26</td><td>0.0</td><td>8</td></tr><tr><td>num(·,^)</td><td>1.63</td><td>1.63</td><td>0.0</td><td>7</td><td>1.16</td><td>1.16</td><td>0.0</td><td>7</td></tr><tr><td>num(., v)</td><td>1.14</td><td>1.14</td><td>0.0</td><td>7</td><td>1.53</td><td>1.53</td><td>0.0</td><td>8</td></tr><tr><td>num_at(·,0,-)</td><td>0.33</td><td>0.33</td><td>0.0</td><td>1</td><td>0.16</td><td>0.16</td><td>0.0</td><td>1</td></tr><tr><td>num_at(·,1,-)</td><td>0.29</td><td>0.29</td><td>0.0</td><td>2</td><td>0.32</td><td>0.32</td><td>0.0</td><td>2</td></tr><tr><td>num_at(·,2,-)</td><td>0.30</td><td>0.30</td><td>0.0</td><td>3</td><td>0.31</td><td>0.31</td><td>0.0</td><td>4</td></tr><tr><td>num_at(.,0, ^)</td><td>0.49</td><td>0.49</td><td>0.0</td><td>1</td><td>0.1</td><td>0.1</td><td>0.0</td><td>1</td></tr><tr><td>num_at(·,1,^)</td><td>0.34</td><td>0.34</td><td>0.0</td><td>2</td><td>0.31</td><td>0.31</td><td>0.0</td><td>2</td></tr><tr><td>num_at(.,2, ^)</td><td>0.30</td><td>0.30</td><td>0.0</td><td>4</td><td>0.30</td><td>0.30</td><td>0.0</td><td>4</td></tr><tr><td>num_at(.,0, v)</td><td>0.08</td><td>0.08</td><td>0.0</td><td>1</td><td>0.39</td><td>0.39</td><td>0.0</td><td>1</td></tr><tr><td>num_at(.,1, ν)</td><td>0.27</td><td>0.27</td><td>0.0</td><td>2</td><td>0.35</td><td>0.35</td><td>0.0</td><td>2</td></tr><tr><td>num_at(.,2,ν)</td><td>0.29</td><td>0.29</td><td>0.0</td><td>3</td><td>0.29</td><td>0.29</td><td>0.0</td><td>3</td></tr><tr><td>#sat(-)</td><td>3.86</td><td>3.86</td><td>0.0</td><td>86</td><td>14.42</td><td>14.42</td><td>0.0</td><td>157</td></tr></table>
|
| 445 |
+
|
| 446 |
+
# A.3 DATASET EXAMPLE
|
| 447 |
+
|
| 448 |
+
Our method generates 4-tuples such as the following:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { r l r l } { p \vee p } & { \in } & { ( r c ) ( ( r v ) \vee p ) } \\ { ( ( g \vee p ) \vee s ) ( g g ) \wedge r } & { \in } & { r \wedge ( r r ) } \\ { p \vee p } & { \nvDash } & { r \wedge ( r r ) } \\ { ( ( g \vee p ) \vee s ) ( g g ) \wedge r } & { \nvDash } & { ( r c ) ( ( r v ) \vee p ) } \end{array}
|
| 452 |
+
$$
|
md/train/SygKyeHKDH/SygKyeHKDH.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MAKING EFFICIENT USE OF DEMONSTRATIONS TOSOLVE HARD EXPLORATION PROBLEMS
|
| 2 |
+
|
| 3 |
+
Caglar Gulcehre∗, Tom Le Paine∗, Bobak Shahriari, Misha Denil, Matt Hoffman, Hubert Soyer, Richard Tanburn, Steven Kapturowski, Neil Rabinowitz, Duncan Williams, Gabriel Barth-Maron, Ziyu Wang, Nando de Freitas, Worlds Team DeepMind
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper introduces R2D3, an agent that makes efficient use of demonstrations to solve hard exploration problems in partially observable environments with highly variable initial conditions. We also introduce a suite of eight tasks that combine these three properties, and show that R2D3 can solve several of the tasks where other state of the art methods (both with and without demonstrations) fail to see even a single successful trajectory after tens of billions of steps of exploration.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement learning from demonstrations has proven to be an effective strategy for attacking problems that require sample efficiency and involve hard exploration. For example, Aytar et al. (2018), Pohlen et al. (2018) and Salimans and Chen (2018b) have shown that RL with demonstrations can address the hard exploration problem in Montezuma’s Revenge. Vecerík et al. (2017), Merel et al. ˇ (2017) and Paine et al. (2018) have demonstrated similar results in robotics. Many other works have shown that demonstrations can accelerate learning and address hard-exploration tasks (e.g. see Hester et al., 2018; Kim et al., 2013; Nair et al., 2018; Kang et al., 2018).
|
| 12 |
+
|
| 13 |
+
In this paper, we attack the problem of learning from demonstrations in hard exploration tasks in partially observable environments with highly variable initial conditions. These three aspects together conspire to make learning challenging:
|
| 14 |
+
|
| 15 |
+
1. Sparse rewards induce a difficult exploration problem, which is a challenge for many state of the art RL methods. An environment has sparse reward when a non-zero reward is only seen after taking a long sequence of correct actions. Our approach is able to solve tasks where standard methods run for billions of steps without seeing a single non-zero reward.
|
| 16 |
+
2. Partial observability forces the use of memory, and also reduces the generality of information provided by a single demonstration, since trajectories cannot be broken into isolated transitions using the Markov property. An environment has partial observability if the agent can only observe a part of the environment at each timestep.
|
| 17 |
+
3. Highly variable initial conditions (i.e. changes in the starting configuration of the environment in each episode) are a big challenge for learning from demonstrations, because the demonstrations can not account for all possible configurations. When the initial conditions are fixed it is possible to be extremely efficient through tracking (Aytar et al., 2018; Peng et al., 2018); however, with a large variety of initial conditions the agent is forced to generalize over environment configurations not present in demonstrations. Generalizing between different initial conditions is known to be difficult (Ghosh et al., 2017; Langlois et al., 2019; Zolna et al., 2019).
|
| 18 |
+
|
| 19 |
+
Our approach to these problems combines demonstrations with off-policy, recurrent Q-learning in a way that allows us to make very efficient use of the available data. In particular, we vastly outperform behavioral cloning using the same set of demonstrations in all of our experiments.
|
| 20 |
+
|
| 21 |
+
Another desirable property of our approach is that our agents are able to learn to outperform the demonstrators, and in some cases even to discover strategies that the demonstrators were not aware of. In one of our tasks the agent is able to discover and exploit a bug in the environment in spite of all the demonstrators completing the task in the intended way.
|
| 22 |
+
|
| 23 |
+
Learning from a small number of demonstrations under highly variable initial conditions is not straight-forward. We identify a key parameter of our algorithm, the demo-ratio, which controls the proportion of expert demonstrations vs agent experience in each training batch. This hyper-parameter has a dramatic effect on the performance of the algorithm. Surprisingly, we find that the optimal demo ratio is very small (but non-zero) across a wide variety of tasks.
|
| 24 |
+
|
| 25 |
+
The mechanism our agents use to efficiently extract information from expert demonstrations is to use them in a way that guides (or biases) the agent’s own autonomous exploration of the environment. Although this mechanism is not obvious from the algorithm construction, our behavioral analysis confirms the presence of this guided exploration effect.
|
| 26 |
+
|
| 27 |
+
To demonstrate the effectiveness of our approach we introduce a suite of tasks (which we call the Hard-Eight suite) that exhibit our three targeted properties. The tasks are set in a procedurallygenerated 3D world, and require complex behavior (e.g. tool use, long-horizon memory) from the agent to succeed. The tasks are designed to be difficult challenges in our targeted setting, and several state of the art methods (themselves ablations of our approach) fail to solve them.
|
| 28 |
+
|
| 29 |
+
The main contributions of this paper are, firstly we design a new agent that makes efficient use of demonstrations to solve sparse reward tasks in partially observed environments with highly variable initial conditions. Secondly, we provide an analysis of the mechanism our agents use to exploit information from the demonstrations. Lastly, we introduce a suite of eight tasks that support this line of research.
|
| 30 |
+
|
| 31 |
+
# 2 RECURRENT REPLAY DISTRIBUTED DQN FROM DEMONSTRATIONS
|
| 32 |
+
|
| 33 |
+
We propose a new agent, which we refer to as Recurrent Replay Distributed DQN from Demonstrations (R2D3). R2D3 is designed to make efficient use of demonstrations to solve sparse reward tasks in partially observed environments with highly variable initial conditions. This section gives an overview of the agent, and detailed pseudocode can be found in Section 2.1.
|
| 34 |
+
|
| 35 |
+
The architecture of the R2D3 agent is shown in Figure 1. There are several actor processes, each running independent copies of the behavior against an instance of the environment. Each actor streams its experience to a shared
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: The R2D3 distributed system diagram. The learner samples batches that are a mixture of demonstrations and the experiences the agent generates by interacting with the environment over the course of training. The ratio between demos and agent experiences is a key hyper-parameter which must be carefully tuned to achieve good performance.
|
| 39 |
+
|
| 40 |
+
agent replay buffer, where experience from all actors is aggregated and globally prioritized (Schaul et al., 2016; Horgan et al., 2018) using a mixture of max and mean of the TD-errors with priority exponent $\eta = 1 . 0$ as in Kapturowski et al. (2018). The actors periodically request the latest network weights from the learner process in order to update their behavior.
|
| 41 |
+
|
| 42 |
+
In addition to the agent replay, we maintain a second demo replay buffer, which is populated with expert demonstrations of the task to be solved. Expert trajectories are also prioritized using the scheme of Kapturowski et al. (2018). Maintaining separate replay buffers for agent experience and expert demonstrations allows us to prioritize the sampling of agent and expert data separately.
|
| 43 |
+
|
| 44 |
+
The learner process samples batches of data from both the agent and demo replay buffers simultaneously. A hyperparameter $\rho$ , the demo ratio, controls the proportion of data coming from expert demonstrations versus from the agent’s own experience. The demo ratio is implemented at a batch level by randomly choosing whether to sample from the expert replay buffer independently for each element with probability $\rho$ . Using a stochastic demo ratio in this way allows us to target demo ratios that are smaller than the batch size, which we found to be very important for good performance. The objective optimized by the learner uses of $n$ -step, double Q-learning (with $n = 5$ ) and a dueling architecture (Wang et al., 2016; Hessel et al., 2018). In addition to performing network updates, the learner is also responsible for pushing updated priorities back to the replay buffers.
|
| 45 |
+
|
| 46 |
+
In each replay buffer, we store fixed-length $m = 8 0$ ) sequences of $( s , a , r )$ tuples where adjacent sequences overlap by 40 time-steps. The sequences never cross episode boundaries. Given a single batch of trajectories we unroll both online and target networks (Mnih et al., 2015) on the same sequence of states to generate value estimates with the recurrent state initialized to zero. Proper initialization of the recurrent state would require always replaying episodes from the beginning, which would add significant complexity to our implementation. As an approximation of this we treat the first 40 steps of each sequence as a burn-in phase, and apply the training objective to the final 40 steps only. An alternative approximation would be to store stale recurrent states in replay, but we did not find this to improve performance over zero initialization with burn-in.
|
| 47 |
+
|
| 48 |
+
# 2.1 R2D3 AGENT
|
| 49 |
+
|
| 50 |
+
In this section, we provide the pseudocode for the R2D3. First, the agent has a single learner process which samples from both demonstration and agent buffers in order to update its policy parameters, the pseudocode of the R2D3 learner can be found in Algorithm 1.
|
| 51 |
+
|
| 52 |
+
# Algorithm 1 Learner
|
| 53 |
+
|
| 54 |
+
<table><tr><td>Inputs: replay of expert demonstrations D,replay of agent experiences R,batch size B,sequence length m, and number of actors A.</td></tr><tr><td>Initialize policy weights 0.</td></tr><tr><td>Initialize target policy weights 0' ←0.</td></tr><tr><td>Launch A actors and replicate policy weights θ to each actor.</td></tr><tr><td>for nsteps do</td></tr><tr><td>Sample transition sequences (St:t+m,at:t+m,Tt:t+m) from replay D with probability p or from replay R with probability (1- ρ),to construct a mini-batch of size B.</td></tr><tr><td>Calculate loss using target network.</td></tr><tr><td>Perform a gradient descent step to update 0.</td></tr><tr><td>If t mod ttarget = O,update the target policy weights 0' ←0.</td></tr><tr><td>If t mod tactor = O,replicate policy weights to the actors.</td></tr><tr><td>end for</td></tr></table>
|
| 55 |
+
|
| 56 |
+
The R2D3 agent has $A$ parallel actor processes which interact with a copy of the environment in order to obtain data which is then inserted into the agent buffer. The agents periodically update their parameters to match those being updated on the learner. The pseudocode for the actors is provided in Algorithm 2.
|
| 57 |
+
|
| 58 |
+
<table><tr><td>Algorithm 2 Actor</td></tr><tr><td>repeat</td></tr><tr><td>Sample action from behavior policy a ←π(s)</td></tr><tr><td>Execute αand observe s'and r</td></tr><tr><td>Store(s,a,s',r) in R</td></tr><tr><td>until learner finishes.</td></tr></table>
|
| 59 |
+
|
| 60 |
+
# 3 BACKGROUND
|
| 61 |
+
|
| 62 |
+
Exploration remains one of the most fundamental challenges for reinforcement learning. So-called “hard-exploration” domains are those in which rewards are sparse, and optimal solutions typically have long and sparsely-rewarded trajectories. Hard-exploration domains may also have many distracting dead ends that the agent may not be able to recover from once it gets into a certain state. In recent years, the most notable such domains are Atari environments, including Montezuma’s Revenge and Pitfall (Bellemare et al., 2013). These domains are particularly tricky for classical RL algorithms because even finding a single non-zero reward to bootstrap from is incredibly challenging.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Hard-Eight task suite. In each task an agent $( \pmb { \nabla } )$ must interact with objects in its environment in order to gain access to a large apple $( \pmb { \bigtriangledown } )$ that provides reward. The 3D environment is also procedurally generated so that every episode the state of the world including object shapes, colors, and positions is different. From the point of view of the agent the environment is partially observed. Because it may take hundreds of low-level actions to collect an apple the reward is sparse which makes exploration difficult.
|
| 66 |
+
|
| 67 |
+
A common technique used to address the difficulty of exploration is to encourage the agent to visit under-explored areas of the state-space (Schmidhuber, 1991). Such techniques are commonly known as intrinsic motivation (Chentanez et al., 2005) or count-based exploration (Bellemare et al., 2016). However, these approaches do not scale well as the state space grows, as they still require exhaustive search in sparse reward environments. Additionally, recent empirical results suggest that these methods do not consistently outperform -greedy exploration (Taïga et al., 2019). The difficulty of exploration is also a consequence of the current inability of our agents to abstract the world and learn scalable, causal models with explanatory power. Instead they often use low-level features or handcrafted heuristics and lack the generalization power necessary to work in a more abstract space. Hints can be provided to the agent which bias it towards promising regions of the state space either via reward-shaping $\mathrm { N g }$ et al., 1999) or by introducing a sequence of curriculum tasks (Bengio et al., 2009; Graves et al., 2017). However, these approaches can be difficult to specify and, in the case of reward shaping, often lead to unexpected behavior where the agent learns to exploit the modified rewards.
|
| 68 |
+
|
| 69 |
+
Another hallmark of hard-exploration benchmarks is that they tend to be fully-observable and exhibit little variation between episodes. Nevertheless, techniques like random no-ops and “sticky actions” have been proposed to artificially increase episode variance in Atari (Machado et al., 2018), an alternative is to instead consider domains with inherent variability. Other recent work on the Obstacle Tower challenge domain (Juliani et al., 2019) is similar to our task suite in this regard. Reliance on determinism of the environment is one of the chief criticisms of imitation leveled by Juliani (2018), who offers a valuable critique on Aytar et al. (2018), Ecoffet et al. (2019) and Salimans and Chen (2018a). In contrast, our approach is able to solve tasks with substantial per-episode variability.
|
| 70 |
+
|
| 71 |
+
GAIL (Ho and Ermon, 2016) is another imitation learning method, however standard GAIL does not work in the following settings: 1) POMDPs (Gangwani et al., 2019; Zołna et al., 2019), 2) from ˙ pixels (Li et al., 2017; Reed et al., 2018), 3) off policy (Kostrikov et al., 2018) and 4) with variable initial conditions (Zolna et al., 2019). Our setting combines all of these, so we leave extending GAIL to this combined setting for future work.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: High-level steps necessary to solve the Baseball task. Each step in this sequence must be completed in order, and must be implemented by the agent as a sequence of low level actions (no option structure is available to the agent). The necessity of completing such a long sequence of high level steps makes it unlikely that the task will ever be solved by random exploration. Note that each step involves interaction with physical objects, shown in bold.
|
| 75 |
+
|
| 76 |
+
# 4 HARD-EIGHT TASK SUITE
|
| 77 |
+
|
| 78 |
+
To address the difficulty of hard exploration in partially observable problems with highly variable initital conditions we introduce a collection of eight tasks, which exhibit these properties. Due to the generated nature of these tasks and the rich form of interaction between the agent and environment, we see greatly increased levels of variability between episodes. From the perspective of the learning process, these tasks are particularly interesting because just memorizing an open loop sequence of actions is unlikely to achieve even partial success on a new episode. The nature of interaction with the environment combined with a limited field of view also necessitates the use of memory in the agent.
|
| 79 |
+
|
| 80 |
+
All of the tasks in the Hard-Eight task suite share important common properties that make them hard exploration problems. First, each task emits sparse rewards—in all but one task the only positive instantaneous reward obtained also ends the episode. The visual observations in each task are also first-person and thus the state of the world is only ever partially observed. Several of the tasks are constructed to ensure that that it is not possible to observe all task relevant information simultaneously.
|
| 81 |
+
|
| 82 |
+
Finally, each task is subject to a highly variable initial conditions. This is accomplished by including several procedural elements, including colors, shapes and configurations of task relevant objects. The procedural generation ensures that simply copying the actions from a demonstration is not sufficient for successful execution, which is a sharp contrast to the the case of Atari (Pohlen et al., 2018). A more detailed discussion of these aspects can be found in Appendix A and videos of agents and humans performing these tasks can be found at https://bit.ly/2mAAUgg.
|
| 83 |
+
|
| 84 |
+
Each task makes use of a standardized avatar with a first-person view of the environment, controlled by the same discretized action space consisting of 46 discrete actions. In all tasks the agent is rewarded for collecting apples and often this is the only reward obtained before the episode ends. A depiction of each task is shown in Figure 2. A description of the procedural elements and filmstrip of a successful episode for each task is provided in Appendix A.
|
| 85 |
+
|
| 86 |
+
Each of these tasks requires the agent to complete a sequence of high-level steps to complete the task. An example from the task suite is shown in Figure 3. The agent must: find the bat, pick up the bat, knock the ball off the plinth, pick up the ball, activate the sensor with the ball (opening the door), walk through the door, and collect the large apple.
|
| 87 |
+
|
| 88 |
+
We are hoping that our release of the Hard-Eight tasks 1 will enable machine learning researchers to try imitation learning or inverse reinforcement learning algorithms on more complicated tasks.
|
| 89 |
+
|
| 90 |
+
# 5 BASELINES
|
| 91 |
+
|
| 92 |
+
In this section we discuss the baselines and ablations we use to compare against our R2D3 agent in the experiments. We compare to Behavior Cloning (a common baseline for learning from demonstrations) as well as two ablations of our method which individually remove either recurrence or demonstrations from R2D3. The two ablations correspond to two different state of the art methods from the literature.
|
| 93 |
+
|
| 94 |
+
Behavior Cloning BC is a simple and common baseline method for learning policies from demonstrations (Pomerleau, 1989; Rahmatizadeh et al., 2018). This algorithm corresponds to a supervised learning approach to imitation learning which uses only expert trajectories as its training dataset to fit a parameterized policy mapping states to actions. For discrete actions this corresponds to a classification task, which we fit using the cross-entropy loss. If the rewards of trajectories in the training dataset are consistently high, BC is known to outperform recent batch-RL methods (Fujimoto et al., 2018). To enable fair comparison we trained our BC agent using the same recurrent neural network architecture that we used for our R2D3 algorithm (see Figure 4).
|
| 95 |
+
|
| 96 |
+
No Demonstrations The first ablation we consider is to remove demonstrations from R2D3. This corresponds to setting the demo ratio (see Figure 1) to $\rho = 0$ . This special case of R2D3 corresponds exactly to the R2D2 agent of Kapturowski et al. (2018), which itself extends DQN (Mnih et al., 2015) to partially observed environments by combining it with recurrence and the distributed training architecture of Ape-X DQN (Horgan et al., 2018). This ablation is itself state of the art on Atari-57 and DMLab-30, making it an extremely strong baseline.
|
| 97 |
+
|
| 98 |
+
No Recurrence The second ablation we consider is to replace the recurrent value function of R2D3 with a feed-forward reactive network. We do this separately from the no demonstrations ablation, leaving the full system in Figure 1 in tact, with only the structure of the network changed. If we further fix the demo ratio to $\rho = 0 . 2 5$ then this ablation corresponds to the DQfD agent of Hester et al. (2018), which is competitive on hard-exploration Atari environments such as Montezuma’s Revenge. However, we do not restrict ourselves to $\rho = 0 . 2 5$ , and instead optimize over the demo ratio for the ablation as well as for our main agent.
|
| 99 |
+
|
| 100 |
+
# 6 EXPERIMENTS
|
| 101 |
+
|
| 102 |
+
We evaluate the performance of our R2D3 agent alongside state-of-the-art deep RL baselines. As discussed in Section 5, we compare our R2D3 agent to BC (standard LfD baseline) R2D2 (off-policy SOTA), DQfD (LfD SOTA). We use our own implementations for all agents, and we plan to release code for all agents including R2D3.
|
| 103 |
+
|
| 104 |
+
For each task in the Hard-Eight suite, we trained R2D3, R2D2, and DQfD using $2 5 6 ~ \epsilon$ -greedy CPU-based actors and a single GPU-based learner process. Following Horgan et al. (2018), the $i$ -th actor was assigned a distinct noise parameter $\epsilon _ { i } \in [ 0 . 4 ^ { 8 } , 0 . 4 ]$ where each $\epsilon _ { i }$ is regularly spaced in $\log _ { 0 . 4 }$ space. For each of the algorithms their common hyperparameters were held fixed. Additionally, for R2D3 and DQfD the demo ratio was varied to study its effect. For BC we also varied the learning rate independently in a vain attempt to find a successful agent.
|
| 105 |
+
|
| 106 |
+
All agents act in the environment with an action-repeat factor of 2, i.e. the actions received by the environment are repeated twice before passing the observation to the agent. Using an action repeat of 4 is common in other domains like Atari (Bellemare et al., 2012; Mnih et al., 2015); however, we found that using an action repeat of 4 made the Hard-Eight tasks too difficult for our demonstrators. Using an action repeat of 2 allowed us to strike a compromise between ease of demonstration (high action repeats prohibiting smooth and intuitive motion) and ease of learning for the agents (low action repeats increase the number of steps required to complete the task).
|
| 107 |
+
|
| 108 |
+
Figure 4 illustrates the neural network architecture of the different agents. As much as possible we use the same network architecture across all agents, deviating only for DQfD, where the recurrent head is replaced with an equally sized feed-forward layer. We briefly outline the training setup below, and give an explicit enumeration of the hyperparameters in Appendix B.
|
| 109 |
+
|
| 110 |
+
For R2D3, R2D2 and DQfD we use the Adam optimizer (Kingma and Ba, 2014) with a fixed learning rate of $2 \times 1 0 ^ { - 4 }$ . We use hyperparameters that are shown to work well for similar environments. We use distributed training with 256 parallel actors, trained for at least 10 billion actor steps for all tasks.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 4: (a) Recurrent head used by R2D3 agents. (b) Feedforward head used by the DQfD agent. Heads in both a) and b) are used to compute the $\mathrm { \bf Q }$ values. (c) Architecture used to compute the input feature representations. Frames of size 96x72 are fed into a ResNet, the output is then augmented by concatenating the previous action $a _ { t - 1 }$ , previous reward $r _ { t - 1 }$ , and other proprioceptive features $f _ { t }$ , such as accelerations, whether the avatar hand is holding an object, and the hand’s relative distance to the avatar.
|
| 114 |
+
|
| 115 |
+
For the BC agent the training regime is slightly different, since this agent does not interact with the environment during training. For BC we also use the Adam optimizer but we additionally perform a hyperparameter sweep over learning rates $\{ 1 0 ^ { - 5 } , 1 0 ^ { - 4 } , 1 0 ^ { \div 3 } \}$ . Since there is no notion of actor steps in BC we trained for 500k learner steps instead.
|
| 116 |
+
|
| 117 |
+
During the course of training, an evaluator process periodically queries the learner process for the latest network weights and runs the resulting policy on an episode, logging both the final return and the total number of steps (actor or learner steps, as appropriate) performed at the time the of evaluation.
|
| 118 |
+
|
| 119 |
+
We collected a total of 100 demonstrations for each task spread across three different experts (each expert contributed roughly one third of the demonstrations for each task). Demonstrations for the tasks were collected using keyboard and mouse controls mapped to the agent’s exact action space, which was necessary to enable both behaviour cloning and learning from demonstrations. We show statistics related to the human demonstration data which we collected from three experts in Table 1.
|
| 120 |
+
|
| 121 |
+
# 6.1 LEARNING THE HARD-EIGHT TASKS
|
| 122 |
+
|
| 123 |
+
In Figure 5, we report the return against the number of actor steps, averaged over five random initializations. We find that none of the baselines succeed in any of the eight environments. Meanwhile, R2D3 learns six out of the eight tasks, and reaches or exceeds human performance in four of them. The fact that R2D3 learns at all in this setting with only 100 demonstrations per task demonstrates the ability of the agent to make very efficient use of the demonstrations. This is in contrast to BC and DQfD which use the same demonstrations, and both fail to learn a single task from the suite.
|
| 124 |
+
|
| 125 |
+
All methods, including R2D3, fail to solve two of the tasks: Remember Sensor and Throw Across. These are the two tasks in the suite that are most demanding in terms of memory requirements for the agent, and it is possible that our zero-initialization with burn-in strategy for handling LSTM states in replay does not give R2D3 sufficient context to complete these tasks successfully. Future work should explore the better handling of recurrent states as a possible avenue towards success on these tasks. R2D3, BC, and DQfD receive some negative returns on Remember Sensor, which indicates that the agents navigate down the hallway and walks over penalty sensors.
|
| 126 |
+
|
| 127 |
+
R2D3 performed better than our average human demonstrator on Baseball, Drawbridge, Navigate Cubes and the Wall Sensor tasks. The behavior on Wall Sensor Stack in particular is quite interesting. On this task R2D3 found a completely different strategy than the human demonstrators by exploiting a bug in the implementation of the environment. The intended strategy for this task is to stack two blocks on top of each other so that one of them can remain in contact with a wall mounted sensor, and this is the strategy employed by the demonstrators. However, due to a bug in the environment the strategy learned by R2D3 was to trick the sensor into remaining active even when it is not in contact with the key by pressing the key against it in a precise way.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 5: Reward vs actor steps curves for R2D3 and baselines on the Hard-Eight task suite. The curves are computed as the mean performance for the same agent across 5 different seeds per task. Error regions show the $9 5 \%$ confidence interval for the mean reward across seeds. Several curves overlap exactly at zero reward for the full range of the plots. R2D3 can perform human-level or better on Baseball, Drawbridge, Navigate Cubes and Wall Sensor. R2D2 could not get any positive rewards on any of the tasks. DQfD and BC agents occasionally see rewards on Drawbridge and Navigate Cubes tasks, but this happens rarely enough that the effect is not visible in the plots. Indicators $( \pmb { \bigtriangledown } )$ mark analysis points in Section 6.3.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6 | Success rate (see main text) for R2D3 across all tasks with at least one successful seed, as a function of demo ratio. The square markers for each demo ratio denote the mean success rate, and the error bars show a bootstrapped estimate of the [25, 75] percentile interval for the mean estimate. The lower demo ratios consistently outperform the higher demo ratios across the suite of tasks.
|
| 134 |
+
|
| 135 |
+
Table 1 | Human demonstration statistics. We collected 100 demos for each tasks from three human demonstrators. We report mean lengths (in number of frames) and rewards of the episodes along with the standard deviations for each task.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Task Name</td><td>Reward</td><td>Episode Len.</td></tr><tr><td>Baseball</td><td>7.8 ± 4.1</td><td>492 ±121</td></tr><tr><td>Drawbridge</td><td>12.3 ± 2.5</td><td>641 ± 137</td></tr><tr><td>Navigate Cubes</td><td>7.9 ± 4.1</td><td>638 ± 185</td></tr><tr><td>Push Blocks</td><td>9.1 ± 2.9</td><td>683 ± 270</td></tr><tr><td>Remember Sensor</td><td>7.7 ± 1.4</td><td>853±188</td></tr><tr><td>Throw Across</td><td>5.4 ± 4.9</td><td>464 ± 172</td></tr><tr><td>Wall Sensor</td><td>9.1 ± 2.8</td><td>280±87</td></tr><tr><td>Wall Sensor Stack</td><td>8.6± 3.5</td><td></td></tr><tr><td></td><td></td><td>521 ±107</td></tr></table>
|
| 138 |
+
|
| 139 |
+
In light of the uniform failure of our baselines to learn on the Hard-Eight suite we made several attempts at training other models on the task suite; however, these attempts were all unsuccessful. For example, we tried adding randomized prior functions (Osband et al., 2018) to R2D2, but this approach was still unable to obtain reward on any of the Hard-Eight tasks. We also trained an IMPALA agent with pixel control (Jaderberg et al., 2016) as auxiliary reward to help with exploration, but this approach also failed to learn on any of the tasks we attempted. We omit these results from Figure 5, only keeping the most relevant baselines.
|
| 140 |
+
|
| 141 |
+
# 6.2 EFFECT OF THE DEMO RATIO
|
| 142 |
+
|
| 143 |
+
In our experiments on Hard-Eight tasks (see Figure 5), we did a hyperparameter search and chose the best hyperparameters for each method independently. In this section, we look more closely at how the demo ratio $( \rho )$ affects learning in R2D3. To do this we look at how the success rate of R2D3 across the entire Hard-Eight task suite varies as a function of the demo ratio.
|
| 144 |
+
|
| 145 |
+
The goal of each task in the Hard-Eight suite is to collect a large apple, which ends the episode and gives a large reward. We consider an episode successful if the large apple is collected. An agent that executes many episodes in the environment will either succeed or fail at each one. We consider an agent successful if, after training, at least $7 5 \%$ of its final 25 episodes are successful. Finally, an individual agent with a fixed set of hyperparameters may still succeed or fail depending on the randomness in the environment and the initialization of the agent.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 7: Guided exploration behavior in the Push Blocks task. (a) Spatial pattern of exploration behavior at $\sim 5 \mathrm { B }$ actor steps (reward-driven learning kicks off for R2D3 only after ${ \sim } 2 0 \mathrm { B }$ steps). Overlay of agent’s trajectories over 200 episodes. Blocks and sensors are not shown for clarity. R2D2 appears to follow a random walk. R2D3 concentrates on a particular spatial region. (b) Interactions between the agent and blocks during the first 12B steps. Each line shows a different random seed. R2D2 rarely pushes the blocks. (c) Example trajectory of R2D3 after training, the agent pushes the blue block onto the blue sensor, then collects the apple (green star).
|
| 149 |
+
|
| 150 |
+
We train several R2D3 agents on each tractable task2 in the Hard-Eight suite, varying only the demo ratio while keeping other hyperparameters fixed at the values used for the learning experiment. We consider four different demo ratios across six tasks, with five seeds for each task (120 trained agents). Figure 6 shows estimates of the success rate for the R2D3 algorithm for each different demo ratio, aggregated across all tasks. We observe that tuning the demo ratio has a strong effect on the success rate across the task suite, and that the best demo ratio is quite small. See Appendix C.3 for further results.
|
| 151 |
+
|
| 152 |
+
# 6.3 GUIDED EXPLORATION BY DEMONSTRATION
|
| 153 |
+
|
| 154 |
+
The typical strategy for exploration in RL is to either use a stochastic policy and sample actions, or to use a deterministic policy and take random actions some small $\epsilon$ fraction of the time. Given sufficient time both of these approaches will in theory cover the space of possible behaviors, but in practice the amount of time required to achieve this coverage can be prohibitively long. In this experiment, we compare the behavior of R2D3 to the behavior of R2D2 (which is equivalent to R2D3 without demonstrations) on two of the tasks from the Hard-Eight suite. Even very early in training (well before R2D3 is able to reliably complete the tasks) we see many more task-relevant actions from R2D3 than from R2D2, suggesting that the effect of demonstrations is to bias R2D3 towards exploring relevant parts of the environment.
|
| 155 |
+
|
| 156 |
+
In Figure 7 we begin by examining the Push Blocks tasks. The task here is to push a particular block onto a sensor to give access to a large apple, and we examine the behavior of both R2D3 and R2D2 after 5B steps, which is long before R2D3 begins to solve the task with any regularity (see Figure 5). Looking at the distribution of spatial locations for the agents it is clear that R2D2 essentially diffuses randomly around the room, while R2D3 spends much more time in task-relevant parts of the environment (e.g. away from the walls). We also record the total distance traveled by the moveable blocks in the room, and find that R2D3 tends to move the blocks significantly more often than R2D2, even before it has learned to solve the task.
|
| 157 |
+
|
| 158 |
+
# 7 CONCLUSION
|
| 159 |
+
|
| 160 |
+
In this paper, we introduced the R2D3 agent, which is designed to make efficient use of demonstrations to learn in partially observable environments with sparse rewards and highly variable initial conditions. We showed through several experiments on eight very difficult tasks that our approach is able to outperform multiple state of the art baselines, two of which are themselves ablations of R2D3.
|
| 161 |
+
|
| 162 |
+
We also identified a key parameter of our algorithm, the demo ratio, and showed that careful tuning of this parameter is critical to good performance. Interestingly we found that the optimal demo ratio is surprisingly small but non-zero, which suggests that there may be a risk of overfitting to the demonstrations at the cost of generalization. For future work, we could investigate how this optimal demo ratio changes with the total number of demonstrations and, more generally, the distribution of expert trajectories relative to the task variability.
|
| 163 |
+
|
| 164 |
+
We introduced the Hard-Eight suite of tasks and used them in all of our experiments. These tasks are specifically designed to be partially observable tasks with sparse rewards and highly variable initial conditions, making them an ideal testbed for showcasing the strengths of R2D3 in contrast to existing methods in the literature.
|
| 165 |
+
|
| 166 |
+
Our behavioral analysis showed that the mechanism R2D3 uses to efficiently extract information from expert demonstrations is to use them in a way that guides (or biases) the agent’s own autonomous exploration of the environment. An in-depth analysis of agent behavior on the Hard-Eight task suite is a promising direction for understanding how different RL algorithms make selective use of information.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Martin Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. In 12th USENIX Symposium on Operating Systems Design and Implementation, pages 265–283, 2016.
|
| 171 |
+
Yusuf Aytar, Tobias Pfaff, David Budden, Thomas Paine, Ziyu Wang, and Nando de Freitas. Playing hard exploration games by watching YouTube. In Advances in Neural Information Processing Systems, pages 2930–2941, 2018.
|
| 172 |
+
Marc G Bellemare, Joel Veness, and Michael Bowling. Investigating contingency awareness using Atari 2600 games. In AAAI Conference on Artificial Intelligence, pages 864–871, 2012.
|
| 173 |
+
Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 174 |
+
Marc G Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pages 1471–1479, 2016.
|
| 175 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In International Conference on Machine Learning, pages 41–48, 2009.
|
| 176 |
+
Nuttapong Chentanez, Andrew G Barto, and Satinder P Singh. Intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pages 1281–1288, 2005.
|
| 177 |
+
Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. Go-explore: a new approach for hard-exploration problems. arXiv preprint arXiv:1901.10995, 2019.
|
| 178 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv preprint arXiv:1812.02900, 2018.
|
| 179 |
+
Tanmay Gangwani, Joel Lehman, Qiang Liu, and Jian Peng. Learning belief representations for imitation learning in pomdps. arXiv preprint arXiv:1906.09510, 2019.
|
| 180 |
+
Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-and-conquer reinforcement learning. arXiv preprint arXiv:1711.09874, 2017.
|
| 181 |
+
Alex Graves, Marc G Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated curriculum learning for neural networks. In International Conference on Machine Learning, pages 1311–1320, 2017.
|
| 182 |
+
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. In AAAI Conference on Artificial Intelligence, pages 3215–3222, 2018.
|
| 183 |
+
|
| 184 |
+
Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Ian Osband, John Agapiou, Joel Z. Leibo, and Audrunas Gruslys. Deep Q-learning from demonstrations. In AAAI Conference on Artificial Intelligence, pages 3223–3230, 2018.
|
| 185 |
+
|
| 186 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pages 4565–4573, 2016.
|
| 187 |
+
|
| 188 |
+
Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado van Hasselt, and David Silver. Distributed prioritized experience replay. In International Conference on Learning Representations, 2018.
|
| 189 |
+
|
| 190 |
+
John D Hunter. Matplotlib: A 2D graphics environment. Computing in science & engineering, 9(3):90–95, 2007.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
Arthur Juliani. On “solving” Montezuma’s revenge. https://medium.com/@awjuliani/ on-solving-montezumas-revenge-2146d83f0bc3, 2018. Accessed: 2019-19-21.
|
| 195 |
+
|
| 196 |
+
Arthur Juliani, Ahmed Khalifa, Vincent-Pierre Berges, Jonathan Harper, Hunter Henry, Adam Crespi, Julian Togelius, and Danny Lange. Obstacle tower: A generalization challenge in vision, control, and planning. In AAAI-19 Workshop on Games and Simulations for Artificial Intelligence, 2019.
|
| 197 |
+
|
| 198 |
+
Bingyi Kang, Zequn Jie, and Jiashi Feng. Policy optimization with demonstrations. In International Conference on Machine Learning, pages 2469–2478, 2018.
|
| 199 |
+
|
| 200 |
+
Steven Kapturowski, Georg Ostrovski, John Quan, Remi Munos, and Will Dabney. Recurrent experience replay in distributed reinforcement learning. In International Conference on Learning Representations, 2018.
|
| 201 |
+
|
| 202 |
+
Beomjoon Kim, Amir-massoud Farahmand, Joelle Pineau, and Doina Precup. Learning from limited demonstra tions. In Advances in Neural Information Processing Systems, pages 2859–2867, 2013.
|
| 203 |
+
|
| 204 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 205 |
+
|
| 206 |
+
Ilya Kostrikov, Kumar Krishna Agrawal, Debidatta Dwibedi, Sergey Levine, and Jonathan Tompson. Discriminator-actor-critic: Addressing sample inefficiency and reward bias in adversarial imitation learning. arXiv preprint arXiv:1809.02925, 2018.
|
| 207 |
+
|
| 208 |
+
Eric Langlois, Shunshi Zhang, Guodong Zhang, Pieter Abbeel, and Jimmy Ba. Benchmarking model-based reinforcement learning. arXiv preprint arXiv:1907.02057, 2019.
|
| 209 |
+
|
| 210 |
+
Yunzhu Li, Jiaming Song, and Stefano Ermon. Infogail: Interpretable imitation learning from visual demonstrations. In Advances in Neural Information Processing Systems, pages 3812–3822, 2017.
|
| 211 |
+
|
| 212 |
+
Marlos C Machado, Marc G Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the arcade learning environment: Evaluation protocols and open problems for general agents. Journal of Artificial Intelligence Research, 61:523–562, 2018.
|
| 213 |
+
|
| 214 |
+
Wes McKinney et al. Data structures for statistical computing in python. In Proceedings of the 9th Python in Science Conference, pages 51–56, 2010.
|
| 215 |
+
|
| 216 |
+
Josh Merel, Yuval Tassa, Sriram Srinivasan, Jay Lemmon, Ziyu Wang, Greg Wayne, and Nicolas Heess. Learning human behaviors from motion capture by adversarial imitation. arXiv preprint arXiv:1707.02201, 2017.
|
| 217 |
+
|
| 218 |
+
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.
|
| 219 |
+
|
| 220 |
+
Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In IEEE International Conference on Robotics and Automation, pages 6292–6299, 2018.
|
| 221 |
+
|
| 222 |
+
Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In International Conference on Machine Learning, pages 278–287, 1999.
|
| 223 |
+
|
| 224 |
+
Travis Oliphant. Guide to NumPy. USA: Trelgol Publishing, 2006.
|
| 225 |
+
|
| 226 |
+
Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Advances in Neural Information Processing Systems, pages 8617–8629, 2018.
|
| 227 |
+
|
| 228 |
+
Tom Le Paine, Sergio Gómez Colmenarejo, Ziyu Wang, Scott Reed, Yusuf Aytar, Tobias Pfaff, Matt W Hoffman, Gabriel Barth-Maron, Serkan Cabi, David Budden, et al. One-shot high-fidelity imitation: Training large-scale deep nets with RL. arXiv preprint arXiv:1810.05017, 2018.
|
| 229 |
+
|
| 230 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Example-guided deep reinforcement learning of physics-based character skills. ACM Transactions on Graphics, 37(4):1:14, 2018.
|
| 231 |
+
|
| 232 |
+
Tobias Pohlen, Bilal Piot, Todd Hester, Mohammad Gheshlaghi Azar, Dan Horgan, David Budden, Gabriel Barth-Maron, Hado van Hasselt, John Quan, Mel Vecerík, et al. Observe and look further: Achieving ˇ consistent performance on atari. arXiv preprint arXiv:1805.11593, 2018.
|
| 233 |
+
|
| 234 |
+
Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Advances in neural information processing systems, pages 305–313, 1989.
|
| 235 |
+
|
| 236 |
+
Rouhollah Rahmatizadeh, Pooya Abolghasemi, Ladislau Bölöni, and Sergey Levine. Vision-based multi-task manipulation for inexpensive robots using end-to-end learning from demonstration. In IEEE International Conference on Robotics and Automation, pages 3758–3765, 2018.
|
| 237 |
+
|
| 238 |
+
Scott Reed, Yusuf Aytar, Ziyu Wang, Tom Paine, Aäron van den Oord, Tobias Pfaff, Sergio Gomez, Alexander Novikov, David Budden, and Oriol Vinyals. Visual imitation with a minimal adversary. 2018.
|
| 239 |
+
|
| 240 |
+
Tim Salimans and Richard Chen. Learning Montezuma’s revenge from a single demonstration. https://openai.com/blog/ learning-montezumas-revenge-from-a-single-demonstration, 2018a. Accessed: 2019-19-22.
|
| 241 |
+
|
| 242 |
+
Tim Salimans and Richard Chen. Learning Montezuma’s revenge from a single demonstration. arXiv preprint arXiv:1812.03381, 2018b.
|
| 243 |
+
|
| 244 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. In International Conference on Learning Representations, 2016.
|
| 245 |
+
|
| 246 |
+
Jürgen Schmidhuber. Curious model-building control systems. In IEEE International Joint Conference on Neural Networks, pages 1458–1463, 1991.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
|
| 250 |
+
Matej Vecerík, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas ˇ Rothörl, Thomas Lampe, and Martin Riedmiller. Leveraging demonstrations for deep reinforcement learning on robotics problems with sparse rewards. arXiv preprint arXiv:1707.08817, 2017.
|
| 251 |
+
|
| 252 |
+
Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Hasselt, Marc Lanctot, and Nando Freitas. Dueling network architectures for deep reinforcement learning. In International Conference on Machine Learning, pages 1995–2003, 2016.
|
| 253 |
+
|
| 254 |
+
Konrad Zolna, Scott Reed, Alexander Novikov, Sergio Gomez Colmenarej, David Budden, Serkan Cabi, Misha Denil, Nando de Freitas, and Ziyu Wang. Task-relevant adversarial imitation learning. arXiv preprint arXiv:1910.01077, 2019.
|
| 255 |
+
|
| 256 |
+
Konrad Zołna, Negar Rostamzadeh, Yoshua Bengio, Sungjin Ahn, and Pedro O Pinheiro. Reinforced imitation ˙ in heterogeneous action space. arXiv preprint arXiv:1904.03438, 2019.
|
| 257 |
+
|
| 258 |
+
# A HARD-EIGHT TASK SUITE DETAILS
|
| 259 |
+
|
| 260 |
+
Sparse rewards All of the tasks emit sparse rewards, indeed in all but one task the only positive instantaneous reward obtained also ends the episode successfully. In other words, for standard RL algorithms to learn by bootstrapping, the actors must first solve the task inadvertently, and must do so with no intermediate signal to guide them.
|
| 261 |
+
|
| 262 |
+
Partial observability Visual observations are all first-person, which means that some relevant features of the state of the world may be invisible to the agent simply because they are behind it or around a corner. Some tasks (e.g. Remember Sensor, are explicitly designed so that this is the case).
|
| 263 |
+
|
| 264 |
+
Highly Variable Initial Conditions Many of the elements of the tasks are procedurally generated, which leads to significant variability between episodes of the same task. In particular, the starting position and orientation of the agent are randomized and similarly, where they are present, the shapes, colors, and textures of various objects are randomly sampled from a set of available such features. Therefore a single (or small number of) demonstration(s) is not sufficient to guide an agent to solve the task as it is in the case of DQfD on Atari (Pohlen et al., 2018).
|
| 265 |
+
|
| 266 |
+
Observation specification All of the tasks provide the same observation space. In particular, a visual channel consisting of 96 by 72 RGB pixels, as well as accelerations of the avatar, force applied by the avatar hand on the object, whether if the avatar is holding anything or not, and the distance of a held object from the face of the avatar (zero when there is no held object).
|
| 267 |
+
|
| 268 |
+
Action specification The action space consists of four displacement and four rotation actions (8), duplicated for coarse and fine-grained movement (16) as well as for movement with and without grasping (32). The avatar also has an invisible “hand” which can be used to manipulate objects in the environment. The location of the hand is controlled by the avatar gaze direction, plus an additional two actions that control the distance of the hand from the body (34). A grasped object can be manipulated by six rotation actions (two for each rotational degree of freedom; 40) as well as four additional actions controlling the distance of the hand from the body at coarse and fine speed (44). Finally there is an independent grasp action (to hold an object without moving), and a no-op action (total 46). Compared to course actions, fine-grained actions result in slower movements, allowing the agent to perform careful manipulations.
|
| 269 |
+
|
| 270 |
+
# A.1 INDIVIDUAL TASK DETAILS
|
| 271 |
+
|
| 272 |
+
This section gives addition details on each task in our suite including a sequence frames from a successful task execution (performed by a human) and a list of the procedural elements randomized per episode. Videos of agents and humans performing these tasks can be found at https://bit. ly/2mAAUgg.
|
| 273 |
+
|
| 274 |
+
# Baseball
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
|
| 278 |
+
The agent spawns in a small room with a sensor and a key object resting high atop a plinth. The agent must find a stick and use it to knock the key object of the plinth in order to activate the sensor. Activating the sensor opens a door to an adjoining room with a large apple which ends the episode.
|
| 279 |
+
|
| 280 |
+
Procedural elements
|
| 281 |
+
|
| 282 |
+
• Initial position and orientation of the agent • Wall, floor and object materials and colors • Initial position of the stick • Position of plinth
|
| 283 |
+
|
| 284 |
+
# Drawbridge
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
|
| 288 |
+
The agent spawns at one end of a network of branching platforms separated by drawbridges, which can be activated by touching a key object to a sensor. Activating a drawbridge with a key object destroys the key. Each platform is connected to several drawbridges, but has only one key object available. Some paths through the level have small apples which give reward. The agent must choose the most rewarding path through the level to obtain a large apple at the end which ends the episode.
|
| 289 |
+
|
| 290 |
+
Procedural elements
|
| 291 |
+
|
| 292 |
+
• Initial position and orientation of the agent • Wall, floor, ceiling and object materials and colors • Positions of the small apples throughout the network of ledges
|
| 293 |
+
|
| 294 |
+
# Navigate Cubes
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
|
| 298 |
+
The agent spawns on one side of a large room. On the other side of the room on a raised platform there is a large apple which ends the episode. Across the center of the room there is a wall of movable blocks. The agent must dig through the wall of blocks and find a ramp onto the goal platform in order to collect the large apple.
|
| 299 |
+
|
| 300 |
+
Procedural elements
|
| 301 |
+
|
| 302 |
+
• Initial position and orientation of the agent • Wall, floor and object materials and colors
|
| 303 |
+
|
| 304 |
+
# Push Blocks
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
|
| 308 |
+
The agent spawns in a medium sized room with a recessed sensor in the floor. There are several objects in the room that can be pushed but not lifted. The agent must push a block whose color matches the sensor into the recess in order to open a door to an adjoining room which contains a large apple which ends the episode. Pushing a wrong object into the recess makes the level impossible to complete.
|
| 309 |
+
|
| 310 |
+
Procedural elements
|
| 311 |
+
|
| 312 |
+
• Initial position and orientation of the agent
|
| 313 |
+
• Wall, floor, object materials and colors
|
| 314 |
+
• Positions of the objects
|
| 315 |
+
• Sensor required color
|
| 316 |
+
|
| 317 |
+
# Remember Sensor
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
|
| 321 |
+
The agent spawns near a sensor of a random color. The agent must travel down a long hallway to a room full of blocks and select one that matches the color of the sensor. Bringing the correct block back to the sensor allows access to a large apple which ends the episode. In addition to being far away, traveling between the hallway and the block room requires the agent to cross penalty sensors which incurs a small negative reward.
|
| 322 |
+
|
| 323 |
+
Procedural elements
|
| 324 |
+
|
| 325 |
+
• Initial position and orientation of the agent • Sensor required color • Number of objects in the block room • Position of objects in the block room • Shape and material of the objects in the block room
|
| 326 |
+
|
| 327 |
+
# Throw Across
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
|
| 331 |
+
The agent spawns in a U shaped room with empty space between the legs of the U. There are two key objects near the agent spawn point. The agent must throw one of the key objects across the void, and carry the other around the bottom of the U. Both key objects are needed to open two locked doors which then give access to a large apple which ends the episode.
|
| 332 |
+
|
| 333 |
+
Procedural elements
|
| 334 |
+
|
| 335 |
+
• Initial position and orientation of the agent • Wall, floor and object materials and colors • Color and material of the sensors • Initial positions of the two key objects
|
| 336 |
+
|
| 337 |
+
# Wall Sensor
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
|
| 341 |
+
The agent spawns in a small room with a wall mounted sensor and a key object. The agent must pick up the key and touch it to the sensor which opens a door. In the adjoining room there is a large apple which ends the episode.
|
| 342 |
+
|
| 343 |
+
Procedural elements
|
| 344 |
+
|
| 345 |
+
• Initial position and orientation of the agent
|
| 346 |
+
• Position of the sensor
|
| 347 |
+
• Position of the key object
|
| 348 |
+
|
| 349 |
+
# Wall Sensor Stack
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
|
| 353 |
+
The agent spawns in a small room with a wall mounted sensor and two key objects. This time one of key objects must be in constant contact with the sensor in in order for the door to remain open. The agent must stack the two objects so one can rest against the sensor, allowing the agent to pass through to an adjoining room with a large apple which ends the episode.
|
| 354 |
+
|
| 355 |
+
Procedural elements
|
| 356 |
+
|
| 357 |
+
• Initial position and orientation of the agent • Wall, floor and object materials and colors • Initial positions of both key objects • Position of the sensor
|
| 358 |
+
|
| 359 |
+
# B HYPER-PARAMETERS
|
| 360 |
+
|
| 361 |
+
In Table 2, we report the shared set of hyper-parameters across different models and tasks.
|
| 362 |
+
|
| 363 |
+
Table 2: Hyper-parameters used for all experiments.
|
| 364 |
+
|
| 365 |
+
<table><tr><td>Hyperparameters</td><td>Values</td></tr><tr><td>Network</td><td>See Figure 4</td></tr><tr><td>Environment</td><td></td></tr><tr><td>Image height</td><td>72</td></tr><tr><td>Image width</td><td>96</td></tr><tr><td>Color</td><td>RGB</td></tr><tr><td>Action repeats</td><td>2</td></tr><tr><td>Observation spec</td><td>See section A</td></tr><tr><td>Action spec</td><td>See section A</td></tr><tr><td>Learner</td><td></td></tr><tr><td>Learning rate Optimizer</td><td>2e-4 Adam (Kingma and Ba, 2014)</td></tr><tr><td>Global norm gradient clipping Discount factor (y) Batch size (B)</td><td>True 0.997</td></tr><tr><td>Target update period (ttarget)</td><td>32 400</td></tr><tr><td>Actor update period (tactor)</td><td>200</td></tr><tr><td>Prioritized sampling</td><td>True</td></tr><tr><td>Sequence length (m)</td><td>80</td></tr><tr><td>Burn in length</td><td>40</td></tr><tr><td>Asymmetric reward clipping</td><td></td></tr><tr><td></td><td>True</td></tr><tr><td>Number of actors (A)</td><td>256</td></tr><tr><td></td><td></td></tr><tr><td>Max replay capacity</td><td>500000</td></tr><tr><td>Min replay capacity</td><td>25000</td></tr></table>
|
| 366 |
+
|
| 367 |
+
# C EXPERIMENTS
|
| 368 |
+
|
| 369 |
+
# C.1 SURPASSING THE EXPERTS
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 8: Guided exploration behavior in the Baseball task. (a) Sub-behaviors expressed by five R2D2 and five R2D3 agents after 0.5B steps of training (left) and 4B steps of training (right). Each point is estimated from 200 episodes. At 0.5B steps, none of the agents received any reward over the 200 evaluation episodes, while at 4B steps, three of the R2D3 agents received reward on almost every episode. Even when the R2D3 agents are not receiving reward, they are expressing some of the necessary behaviors provided through human demonstrations. (b) R2D3 agents eventually surpass human performance. The 3 of 5 R2D3 agents shown in (a) which start obtaining rewards continue to bootstrap towards more efficient policies than humans.
|
| 373 |
+
|
| 374 |
+
An important property of R2D3 is that although the agents are trained from demonstrations, the behaviors they achieve are able to surpass the skill of the demonstrations they were trained from. This can be seen quantitatively from reward curves in Figure 5, where the R2D3 agent surpasses the human baseline performance on four of the eight tasks (e.g. Baseball, Navigate Cubes, Wall Sensor and Wall Sensor Stack).
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 9: We show the rewards of the R2D3 agent on different tasks for each seed separately.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 10: R2D3 learning curves with varying demo ratios for all tasks.
|
| 381 |
+
|
| 382 |
+
In some of these cases the improved score is simply a matter of executing the optimal strategy more fluently than the demonstrators. For example, this is the case in the Baseball task, where the human demonstrators are handicapped by the fact that the human interface to the agent action space makes it awkward to rotate a held object. This makes picking up the stick and orienting it properly to knock the ball off the plinth into a tricky task for humans, but the agents are able to refine their behavior to be much more efficient (see Figure 8c).
|
| 383 |
+
|
| 384 |
+
The behavior on Wall Sensor is especially interesting, however in this case the agents find a completely different strategy than the human demonstrators by exploiting a bug in the implementation of the environment. The intended strategy for this task is to stack two blocks on top of each other so that one of them can remain in contact with a wall mounted sensor, and this is the strategy employed by the demonstrators. However, due to a bug in the environment it is also possible to trick the sensor into remaining active even when it is not in contact with the key by pressing the key against it in a precise way. The R2D3 agents are able to discover this bug and exploit it, resulting in superhuman scores on this task even though this strategy is not present in the demonstrations.
|
| 385 |
+
|
| 386 |
+
# C.2 ADDITIONAL EXPERIMENTS
|
| 387 |
+
|
| 388 |
+
We also ran a few additional experiments to get more information about the tasks we did not solve, or solved incorrectly. Videos for these experiments are available at https://bit.ly/2mAAUgg.
|
| 389 |
+
|
| 390 |
+
Remember Sensor This task requires a long memory, and also has the longest episodes length of any task in the Hard Eight suite. In an attempt to mitigate these issues, we trained the agent using a higher action repeat which reduces the episode length, and used stale lstm states instead of zero lstm states which provides information from earlier in the episode. This allows R2D3 to learn policies that display reasonable behavior, retrieving a random block and bringing it back to the hallway. Using this method it can occasionally solve the task.
|
| 391 |
+
|
| 392 |
+
Throw Across The demonstrations collected for this task had a very low success rate of $54 \%$ . We attempted to compensate for this by collecting an additional 30 demos. When we trained R2D3 with all 130 demos all seeds solved the task.
|
| 393 |
+
|
| 394 |
+
Wall Sensor Stack The original Wall Sensor Stack environment had a bug that the R2D3 agent was able to exploit. We fixed the bug and verified the agent can learn the proper stacking behavior.
|
| 395 |
+
|
| 396 |
+
# C.3 ADDITION DETAILS FOR MAIN EXPERIMENTS
|
| 397 |
+
|
| 398 |
+
In Figure 9, we show the performance of the R2D3 agents for each seed separately. On task such as Drawbridge, Navigate Cubes and Wall Sensor, all seeds take off quite rapidly and they have very low variance for the rewards between different seeds. However, on Wall Sensor Stack task while one seed takes off quite rapidly, and the rest of them are just flat. In Figure 10, we elaborate on Figure 6. For Baseball, Navigate Cubes, Push Blocks, and Wall Sensor Stack, a demo ratio of 1/256 works best. On Drawbridge and Wall Sensor all demo ratios are similarly effective.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 11: Further detail of guided exploration behavior in the Push Blocks task (as in Figure 7). (a) Proportion of episodes in which the agent pushes a crate into the recess during the initial 12B steps of training. (b) Proportion of episodes in which the crate pushed into the recess actually matches the sensor color. Data are only shown when crates are pushed into the recess on at least 5 out of 200 episodes. Dashed line shows the probability expected if a random crate was pushed into the recess. Thus, while (c) shows that by 12B steps the R2D3 agent may have reasonable success in pushing crates into the recess, it has not yet mastered the logic that the crate color must much the sensor color.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 12: Further detail of guided exploration behavior in the Push Blocks task (as in Figure 7). (a) Spatial pattern of exploration behavior for the R2D2 agent over the course of ${ \sim } 1 2 \mathrm { B }$ steps of training. Each row shows a different random seed; the number of training steps increases from the leftmost column to the rightmost column. There is little variation in how the policy manifests as explorative behavior across seeds and training time. (b) As in (a), for R2D3. Given demonstrations, the policies now show substantial variation across seeds and training time.
|
md/train/SygcCnNKwr/SygcCnNKwr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Syxt5oC5YQ/Syxt5oC5YQ.md
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AGGREGATED MOMENTUM: STABILITY THROUGH PASSIVE DAMPING
|
| 2 |
+
|
| 3 |
+
James Lucas, Shengyang Sun, Richard Zemel, Roger Grosse University of Toronto; Vector Institute {jlucas, ssy, zemel, rgrosse}@cs.toronto.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Momentum is a simple and widely used trick which allows gradient-based optimizers to pick up speed along low curvature directions. Its performance depends crucially on a damping coefficient $\beta$ . Large $\beta$ values can potentially deliver much larger speedups, but are prone to oscillations and instability; hence one typically resorts to small values such as 0.5 or 0.9. We propose Aggregated Momentum $( A g g M o )$ , a variant of momentum which combines multiple velocity vectors with different $\beta$ parameters. $\mathbf { A g g M o }$ is trivial to implement, but significantly dampens oscillations, enabling it to remain stable even for aggressive $\beta$ values such as 0.999. We reinterpret Nesterov’s accelerated gradient descent as a special case of AggMo and analyze rates of convergence for quadratic objectives. Empirically, we find that AggMo is a suitable drop-in replacement for other momentum methods, and frequently delivers faster convergence with little to no tuning.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
In spite of a wide range of modern optimization research, gradient descent with momentum and its variants remain the tool of choice in machine learning. Momentum methods can help the optimizer pick up speed along low curvature directions without becoming unstable in high-curvature directions. The simplest of these methods, classical momentum (Polyak, 1964), has an associated damping coefficient, $0 \leq \beta < 1$ , which controls how quickly the momentum vector decays. The choice of $\beta$ imposes a tradoff between speed and stability: in directions where the gradient is small but consistent, the terminal velocity is proportional to $1 / ( 1 - \beta )$ , suggesting that $\beta$ slightly less than 1 could deliver much improved optimization performance. However, large $\beta$ values are prone to oscillations and instability (O’Donoghue & Candes, 2015; Goh, 2017), requiring a smaller learning rate and hence slower convergence.
|
| 12 |
+
|
| 13 |
+
Finding a way to dampen the oscillations while preserving the high terminal velocity of large beta values could dramatically speed up optimization. Sutskever et al. (2013) found that Nesterov accelerated gradient descent (Nesterov, 1983), which they reinterpreted as a momentum method, was more stable than classical momentum for large $\beta$ values and gave substantial speedups for training neural networks. However, the reasons for the improved performance remain somewhat mysterious. O’Donoghue & Candes (2015) proposed to detect oscillations and eliminate them by resetting the velocity vector to zero. But in practice it is difficult to determine an appropriate restart condition.
|
| 14 |
+
|
| 15 |
+
In this work, we introduce Aggregated Momentum (AggMo), a variant of classical momentum which maintains several velocity vectors with different $\beta$ parameters. AggMo averages the velocity vectors when updating the parameters. We find that this combines the advantages of both small and large $\beta$ values: the large values allow significant buildup of velocity along low curvature directions, while the small values dampen the oscillations, hence stabilizing the algorithm. AggMo is trivial to implement and incurs almost no computational overhead.
|
| 16 |
+
|
| 17 |
+
We draw inspiration from the physics literature when we refer to our method as a form of passive damping. Resonance occurs when a system is driven at specific frequencies but may be prevented through careful design (Goldstein, 2011). Passive damping can address this in structures by making use of different materials with unique resonant frequencies. This prevents any single frequency from producing catastrophic resonance. By combining several momentum velocities together we achieve a similar effect — no single frequency is driving the system and so oscillation is prevented.
|
| 18 |
+
|
| 19 |
+
In this paper we analyze rates of convergence on quadratic functions. We also provide theoretical convergence analysis showing that AggMo achieves converging average regret in online convex programming (Zinkevich, 2003). To evaluate AggMo empirically we compare against other commonly used optimizers on a range of deep learning architectures: deep autoencoders, convolutional networks, and long-term short-term memory (LSTM).
|
| 20 |
+
|
| 21 |
+
In all of these cases, we find that AggMo works as a drop-in replacement for classical momentum, in the sense that it works at least as well for a given $\beta$ parameter. But due to its stability at higher $\beta$ values, it often delivers substantially faster convergence than both classical and Nesterov momentum when its maximum $\beta$ value is tuned.
|
| 22 |
+
|
| 23 |
+
# 2 Background: momentum-based optimization
|
| 24 |
+
|
| 25 |
+
Classical momentum We consider a function $f : \mathbb { R } ^ { d } \mathbb { R }$ to be minimized with respect to some variable $\pmb \theta$ . Classical momentum (CM) minimizes this function by taking some initial point $\pmb { \theta } _ { 0 }$ and running the following iterative scheme,
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma _ { t } \mathbf { v } _ { t } , } \end{array}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where $\gamma _ { t }$ denotes a learning rate schedule, $\beta$ is the damping coefficient and we set $\mathbf { v } _ { 0 } = 0$ . Momentum can speed up convergence but it is often difficult to choose the right damping coefficient, $\beta$ . Even with momentum, progress in a low curvature direction may be very slow. If the damping coefficient is increased to overcome this then high curvature directions may cause instability and oscillations.
|
| 32 |
+
|
| 33 |
+
Nesterov momentum Nesterov’s Accelerated Gradient (Nesterov, 1983; 2013) is a modified version of the gradient descent algorithm with improved convergence and stability. It can be written as a momentum-based method (Sutskever et al., 2013),
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma _ { t - 1 } \beta \mathbf { v } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma _ { t } \mathbf { v } _ { t } . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Nesterov momentum seeks to solve stability issues by correcting the error made after moving in the direction of the velocity, v. In fact, it can be shown that for a quadratic function Nesterov momentum adapts to the curvature by effectively rescaling the damping coefficients by the eigenvalues of the quadratic (Sutskever et al., 2013).
|
| 40 |
+
|
| 41 |
+
Quadratic convergence We begin by studying convergence on quadratic functions, which have been an important test case for analyzing convergence behavior (Sutskever et al., 2013; O’Donoghue & Candes, 2015; Goh, 2017), and which can be considered a proxy for optimization behavior near a local minimum (O’Donoghue & Candes, 2015).
|
| 42 |
+
|
| 43 |
+
We analyze the behavior of these optimizers along the eigenvectors of a quadratic function in Figure 1. In the legend, $\lambda$ denotes the corresponding eigenvalue. In (a) we use a low damping coefficient $\langle \beta = 0 . 9 )$ while (b) shows a high damping coefficient $\beta = 0 . 9 9 9 \mathrm { \Omega }$ ). When using a low damping coefficient it takes many iterations to find the optimal solution. On the other hand, increasing the damping coefficient from 0.9 to 0.999 causes oscillations which prevent convergence. When using CM in practice we seek the critical damping coefficient which allows us to rapidly approach the optimum without becoming unstable (Goh, 2017). On the other hand, Nesterov momentum with $\bar { \beta } = 0 . 9 9 9$ is able to converge more quickly within high curvature regions than CM but retains oscillations for the quadratics exhibiting lower curvature.
|
| 44 |
+
|
| 45 |
+
# 3 Passive damping through Aggregated Momentum
|
| 46 |
+
|
| 47 |
+
Aggregated Momentum We propose Aggregated Momentum (AggMo), a variant of gradient descent which aims to improve stability while providing the convergence benefits of larger damping coefficients. We modify the gradient descent algorithm by including several velocity vectors each with their own damping coefficient. At each optimization step these velocities are updated and then averaged to produce the final velocity used to update the parameters. This updated iterative procedure can be written as follows,
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Minimizing a quadratic function. All optimizers use a fixed learning rate of 0.33. In the legend, $\lambda$ denotes the corresponding eigenvalues.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Breaking oscillations with passive damping. The arrows show the direction and relative amplitude of the velocities at various points in time. We discuss points (1) and (2) in Section 3.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l } & { { \mathbf { v } } _ { t } ^ { ( i ) } = \beta ^ { ( i ) } { \mathbf { v } } _ { t - 1 } ^ { ( i ) } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) , \mathrm { ~ f o r ~ a l l ~ } i , } \\ & { ~ \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \displaystyle \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } { \mathbf { v } } _ { t } ^ { ( i ) } , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\mathbf { v } _ { 0 } ^ { ( i ) } = 0$ for each $i$ . We refer to the vector $\beta = [ \beta ^ { ( 1 ) } , \dots , \beta ^ { ( K ) } ]$ as the damping vector.
|
| 60 |
+
|
| 61 |
+
By taking advantage of several damping coefficients, AggMo is able to optimize well over illconditioned curvature. Figure 1 (d) shows the optimization along the eigenvectors of a quadratic function using AggMo. AggMo dampens oscillations quickly for all eigenvalues and converges faster than CM and Nesterov in this case.
|
| 62 |
+
|
| 63 |
+
In Figure 2 we display the AggMo velocities during optimization. At point (1) the velocities are aligned towards the minima, with the $\beta = 0 . 9 9 9$ velocity contributing substantially more to each update. By point (2) the system has begun to oscillate. While the $\beta = 0 . 9 9 9$ velocity is still pointed away from the minima, the $\beta = 0 . 9$ velocity has changed direction and is damping the system. Combining the velocities allows AggMo to achieve fast convergence while reducing the impact of oscillations caused by large $\beta$ values.
|
| 64 |
+
|
| 65 |
+
# 3.1 Using AggMo
|
| 66 |
+
|
| 67 |
+
Choosing the damping vector Recall that in a direction with small but steady gradient, the terminal velocity is proportional to $1 / ( 1 - \beta )$ . We found that a good choice of damping vectors was therefore to space the terminal velocities exponentially. To do so, we specify an exponential scale-factor, $a$ and a count $K$ . The damping vector is then constructed as $\bar { \beta ^ { ( i ) } } = \bar { 1 } - a ^ { i - 1 }$ , for $i = 1 \dots K$ . We fix $a = 0 . 1$ throughout and vary only $K$ . A good default choice is $K = 3$ which corresponds to $\beta = [ 0 , 0 . 9 , 0 . 9 9 ]$ ]. We found this setting to be both stable and effective in all of our experiments.
|
| 68 |
+
|
| 69 |
+
Computational/Memory overhead There is very little additional computational overhead when using AggMo compared to CM, as it only requires a handful of extra addition and multipliciation operations on top of the single gradient evaluation. There is some memory overhead due to storing the $K$ velocity vectors, which are each the same size as the parameter vector. However, for most modern deep learning applications, the memory cost at training time is dominated by the activations rather than the parameters (Gomez et al., 2017; Chen et al., 2016; Werbos, 1990; Hochreiter & Schmidhuber, 1997), so the overhead will generally be small.
|
| 70 |
+
|
| 71 |
+
# 4 Recovering Nesterov momentum
|
| 72 |
+
|
| 73 |
+
In this section we show that we can recover Nesterov Momentum (Equation 2) using a simple generalization of Aggregated Momentum (Equation 3). We now introduce separate learning rates for each velocity, $\gamma ^ { ( i ) }$ , so that the iterate update step from Equation 3 is replaced with,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\pmb \theta _ { t } = \pmb \theta _ { t - 1 } + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \gamma _ { t } ^ { ( i ) } \mathbf v _ { t } ^ { ( i ) } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
with eacase of $\beta = [ 0 , \beta ]$ updand $\gamma _ { t } ^ { ( 1 ) } = 2 \gamma$ , $\gamma _ { t } ^ { ( 2 ) } = 2 \beta \gamma$ o recover Nesterov momentum we consider the special. The AggMo update rule can now be written as,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \cfrac { \gamma ^ { ( 2 ) } } { 2 } \mathbf { v } _ { t } - \cfrac { \gamma ^ { ( 1 ) } } { 2 } \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \quad \quad = \pmb { \theta } _ { t - 1 } + \gamma \beta ^ { 2 } \mathbf { v } _ { t - 1 } - ( 1 + \beta ) \gamma \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) . } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Similarly, we may write the Nesterov momentum update with constant learning rate $\gamma _ { t } = \gamma$ as,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } - \gamma \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } ) . } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Now we consider Equation 6 when using the reparameterization given by $\phi _ { t } = \pmb { \theta } _ { t } + \gamma \beta \mathbf { v } _ { t }$ ,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \phi _ { t } - \gamma \beta \mathbf { v } _ { t } = \phi _ { t - 1 } - \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) , } \\ & { \qquad \Rightarrow \phi _ { t } = \phi _ { t - 1 } + \gamma \beta \mathbf { v } _ { t } - \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) , } \\ & { \qquad = \phi _ { t - 1 } + \gamma \beta ^ { 2 } \mathbf { v } _ { t - 1 } - ( 1 + \beta ) \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
It follows that the update to $\phi$ from Nesterov is identical to the $\mathbf { A g g M o }$ update to $\pmb \theta$ , and we have $\phi _ { 0 } = \pmb { \theta } _ { 0 }$ . We can think of the $\phi$ reparameterization as taking a half-step forward in the Nesterov optimization allowing us to directly compare the iterates at each time step. We note also that if $\gamma _ { t } ^ { ( 1 ) } = \gamma _ { t } ^ { ( 2 ) } = 2 \gamma$ γ(2)t = 2γ then the equivalence holds approximately when β is sufficiently close to 1. We demonstrate this equivalence empirically in Appendix B.
|
| 98 |
+
|
| 99 |
+
This formulation allows us to reinterpret Nesterov momentum as a weighted average of a gradient update and a momentum update. Moreover, by showing that AggMo recovers Nesterov momentum we gain access to the same theoretical convergence results that Nesterov momentum achieves.
|
| 100 |
+
|
| 101 |
+
# 5 Convergence analysis
|
| 102 |
+
|
| 103 |
+
# 5.1 Analyzing quadratic convergence
|
| 104 |
+
|
| 105 |
+
We can learn a great deal about optimizers by carefully reasoning about their convergence on quadratic functions. O’Donoghue & Candes (2015) point out that in practice we do not know the condition number of the function to be optimized and so we aim to design algorithms which work well over a
|
| 106 |
+
|
| 107 |
+
# Convergence Rates on Quadratics
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Convergence on quadratics of varying condition number. AggMo interpolates between the convergence rates of CM at $\beta = 0 . 9$ and $\beta = 0 . 9 9$ .
|
| 111 |
+
|
| 112 |
+
large possible range. Sharing this motivation, we consider the convergence behaviour of momentum optimizers on quadratic functions with fixed hyperparameters over a range of condition numbers.
|
| 113 |
+
|
| 114 |
+
To compute the convergence rate, $| | \pmb { \theta } _ { t } - \pmb { \theta } ^ { * } | | ^ { 2 }$ , we model each optimizer as a linear dynamical systems as in Lessard et al. (2016). The convergence rate is then determined by the eigenvalues of this system. We leave details of this computation to appendix B.
|
| 115 |
+
|
| 116 |
+
Figure 3 displays the convergence rate of each optimizer for quadratics with condition numbers $( \kappa )$ from $1 0 ^ { 1 }$ to $1 0 ^ { 7 }$ . The blue dashed line displays the optimal convergence rate achievable by CM with knowledge of the condition number — an unrealistic scenario in practice. The two curves corresponding to CM (red and purple) each meet the optimal convergence rate when the condition number is such that $\beta$ is critical. On the left of this critical point, where the convergence rates for CM are flat, the system is ”under-damped” meaning there are complex eigenvalues corresponding to oscillations.
|
| 117 |
+
|
| 118 |
+
We observe that the convergence rate of AggMo interpolates smoothly between the convergence rates of CM with $\beta = 0 . 9$ and $\beta = 0 . 9 9$ as the condition number varies. AggMo’s ability to quickly kill oscillations leads to an approximately three-times faster convergence rate than Nesterov momentum in the under-damped regime without sacrificing performance on larger condition numbers.
|
| 119 |
+
|
| 120 |
+
# 5.2 Additional convergence analysis
|
| 121 |
+
|
| 122 |
+
We evaluate the convergence rate of AggMo in the setting of online convex programming, as proposed in Zinkevich (2003). This is an increasingly common setting to analyze optimization algorithms tailored to machine learning (Duchi et al., 2011; Kingma & Ba, 2014; Reddi et al., 2018). Notably, this is equivalent to analyzing the convergence rate in the setting of stochastic convex optimization.
|
| 123 |
+
|
| 124 |
+
We consider a sequence of unknown convex cost functions, $f _ { 1 } ( { \pmb \theta } ) , \dots , f _ { T } ( { \pmb \theta } )$ . At each time $t$ , our goal is to predict the parameter $\pmb { \theta } _ { t }$ which minimizes the regret,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
R ( T ) = \sum _ { t = 1 } ^ { T } \left[ f _ { t } ( \theta _ { t } ) - f _ { t } ( \theta ^ { * } ) \right] ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\pmb { \theta } ^ { * }$ is the fixed point parameter minimizing √ $\textstyle \sum _ { t = 1 } ^ { T } f _ { t } ( \theta * )$ . We are able to show that AggMo has regret bounded by $O ( \sqrt { T } )$ - a result asymptotically comparable to the best known bound (Duchi et al., 2011). We adopt the following definitions from Duchi et al. (2011) to simplify the notation. We write $g _ { t } = \nabla f _ { t } ( \pmb { \theta } _ { t } )$ with $g _ { t , i }$ as the $\dot { \mathbf { \zeta } } _ { i } \mathbf { \mathit { h } }$ element of this vector. Additionally, we write $g _ { 1 : t , i } \in \mathbb { R } ^ { t }$ as the vector containing the $i ^ { t h }$ element of the gradient over the first $t$ iterations; $g _ { 1 : t , i } = [ g _ { 1 , i } , . . . , g _ { t , i } ]$ . Then the following theorem holds,
|
| 131 |
+
|
| 132 |
+
Theorem 1. Assume that $f _ { t }$ has bounded gradients, $| | \nabla f _ { t } ( \pmb { \theta } ) | | _ { 2 } < G , | | \nabla f _ { t } ( \pmb { \theta } ) | | _ { \infty } < G _ { \infty }$ , $\forall \pmb { \theta } \in \mathbb { R } ^ { d }$ Moreover, assume that each $\theta _ { t }$ generated by AggMo satisfies $| | \pmb { \theta } _ { n } - \pmb { \theta } _ { m } | | _ { 2 } \leq D , | | \pmb { \theta } _ { n } - \pmb { \theta } _ { m } | | _ { \infty } \leq D _ { \infty }$ for all $m , n \in \{ 1 , \ldots , T \}$ . Let $\gamma _ { t } = \frac { \gamma } { \sqrt { t } }$ and $\beta _ { t } ^ { ( i ) } = \beta ^ { ( i ) } \lambda ^ { t }$ , $\lambda \in ( 0 , 1 )$ . Then AggMo achieves the following regret bound, for all $T \geq 1$ .
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 K \gamma ( 1 - \lambda ) ^ { 2 } } \sum _ { i = 1 } ^ { K } \beta ^ { ( i ) } .
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
It immediately follows that the average regret of AggMo converges, i.e. that √ $R ( T ) / T \to 0$ , by observing that $| | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \leq G _ { \infty } ^ { 2 } \sqrt { T } , \forall j$ . The full proof is given in Appendix C alongside some open questions on the convergence of AggMo.
|
| 139 |
+
|
| 140 |
+
While the statement of Theorem 1 requires strict assumptions we note that this result is certainly non-trivial. Reddi et al. (2018) showed that the average regret of Adam (Kingma & Ba, 2014) is not guaranteed to converge under the same assumptions.
|
| 141 |
+
|
| 142 |
+
# 6 Related work
|
| 143 |
+
|
| 144 |
+
The convergence of momentum methods has been studied extensively, both theoretically and empirically (Wibisono & Wilson, 2015; Wibisono et al., 2016; Wilson et al., 2016; Kidambi et al., 2018). By analyzing the failure modes of existing methods these works motivate successful momentum schemes. Sutskever et al. (2013) explored the effect of momentum on the optimization of neural networks and introduced the momentum view of Nesterov’s accelerated gradient. They focused on producing good momentum schedules during optimization to adapt to ill-conditioned curvature. Despite strong evidence that this approach works well, practitioners today still typically opt for a fixed momentum schedule and vary the learning rate instead.
|
| 145 |
+
|
| 146 |
+
In Appendix C.1 we show that AggMo evolves as a $( \mathsf { K } { + } 1 )$ -th order finite difference equation, enabling AggMo to utilize greater expressiveness over the gradient history. Liang et al. (2016) also introduce dependence on a larger gradient history by adding lagged momentum terms. However, in doing so the authors introduce many new hyperparameters to be tuned.
|
| 147 |
+
|
| 148 |
+
Adaptive gradient methods have been introduced to deal with the ill-conditioned curvature that we often observe in deep learning (Duchi et al., 2011; Kingma & Ba, 2014; Zeiler, 2012; Tieleman & Hinton, 2012). These methods typically approximate the local curvature of the objective to adapt to the geometry of the data. Natural gradient descent (Amari, 1998) preconditions by the Fisher information matrix, which can be shown to approximate the Hessian under certain assumptions (Martens, 2014). Several methods have been proposed to reduce the computational and memory cost of this approach (Martens & Grosse, 2015; Martens, 2010) but these are difficult to implement and introduce additional hyperparameters and computational overhead compared to SGD.
|
| 149 |
+
|
| 150 |
+
Another line of adaptive methods seeks to detect when oscillations occur during optimization. O’Donoghue & Candes (2015) proposed using an adaptive restarting scheme to remove oscillations whenever they are detected. In its simplest form, this is achieved by setting the momentum velocity to zero whenever the loss increases. Further work has suggested using an adaptive momentum schedule instead of zeroing (Srinivasan et al., 2018). Although this technique works well for well-conditioned convex problems it is difficult to find an appropriate restart condition for stochastic optimization where we do not have an accurate computation of the loss. On the other hand, AggMo’s passive damping approach addresses the oscillation problem without the need to detect its occurrence.
|
| 151 |
+
|
| 152 |
+
# 7 Evaluation
|
| 153 |
+
|
| 154 |
+
We evaluated the AggMo optimizer on the following deep learning architectures; deep autoencoders, convolutional networks, and LSTMs. To do so we used four datasets: MNIST (LeCun et al., 1998), CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009) and Penn Treebank (Marcus et al., 1993). In each experiment we compared AggMo to classical momentum, Nesterov momentum, and Adam. These optimizers are by far the most commonly used and even today remain very difficult to outperform in a wide range of tasks. For each method, we performed a grid search over the learning rate and the damping coefficient. For AggMo, we keep the scale $a = 0 . 1$ fixed and vary $K$ as discussed in Section 3.1. Full details of the experimental set up for each task can be found in Appendix D with additional results given in Appendix E.
|
| 155 |
+
|
| 156 |
+
For each of the following experiments we choose to report the validation and test performance of the network in addition to the final training loss when it is meaningful to do so. We include these generalization results because recent work has shown that the choice of optimizer may have a significant effect on the generalization error of the network in practice (Wilson et al., 2017).
|
| 157 |
+
|
| 158 |
+
Table 1: MNIST Autoencoder We display the training MSE for the hyperparameter setting that achieved the best training loss. The validation and test errors are displayed for the hyperparameter setting that achieved the best validation MSE. In each case the average loss and standard deviation over 15 runs is displayed.
|
| 159 |
+
Training Loss Convergence For Increasing Damping Coefficients
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Optimizer</td><td>Train Optimal</td><td colspan="2">Validation Optimal</td></tr><tr><td>Train Loss</td><td>Val. Loss</td><td>Test Loss</td></tr><tr><td>CM</td><td>2.51 ±0.06</td><td>3.55 ± 0.15</td><td>3.45 ± 0.15</td></tr><tr><td>Nesterov</td><td>1.52 ± 0.02</td><td>3.20± 0.01</td><td>3.13 ±0.02</td></tr><tr><td>Adam</td><td>1.44 ± 0.02</td><td>3.80 ± 0.04</td><td>3.72 ± 0.05</td></tr><tr><td>AggMo</td><td>1.39 ± 0.02</td><td>3.05 ± 0.03</td><td>2.96 ± 0.03</td></tr></table>
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Convergence of Autoencoders Training loss during the first 350 epochs of training with each optimizer. The shaded region corresponds to one standard deviation over 15 runs.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 5: Damping Coefficient Investigation Optimizing autoencoders on MNIST with varying damping coefficients and fixed learning rate. Nesterov is unstable with $\beta = 0 . 9 9 9$ .
|
| 168 |
+
|
| 169 |
+
# 7.1 Autoencoders
|
| 170 |
+
|
| 171 |
+
We trained fully-connected autoencoders on the MNIST dataset using a set-up similar to that of Sutskever et al. (2013). While their work focused on finding an optimal momentum schedule we instead kept the momentum fixed and applied a simple learning rate decay schedule. For CM and Nesterov we evaluated damping coefficients in the range: $\{ 0 . 0 , 0 . 9 , 0 . 9 \dot { 9 } , 0 . 9 9 9 \}$ . For Adam, it is standard to use $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ . Since $\beta _ { 1 }$ is analogous to the momentum damping parameter, we considered $\beta _ { 1 } \in \{ 0 . 9 , 0 . 9 9 , 0 . 9 9 9 \}$ and kept $\beta _ { 2 } = \mathsf { \bar { 0 } } . 9 9 9$ . For AggMo, we explored $K$ in $\{ 2 , 3 , 4 \}$ . Each model was trained for 1000 epochs.
|
| 172 |
+
|
| 173 |
+
We report the training, validation, and test errors in Table 1. Results are displayed for the hyperparameters that achieved the best training loss and also for those that achieved the best validation loss. While Adam is able to perform well on the training objective it is unable to match the performance of AggMo or Nesterov on the validation/test sets. AggMo achieves the best performance in all cases.
|
| 174 |
+
|
| 175 |
+
In these experiments the optimal damping coefficient for both CM and Nesterov was $\beta = 0 . 9 9$ while the optimal damping vector for AggMo was $\beta = [ 0 . 0 , 0 . 9 , 0 . 9 9 , 0 . 9 9 9 ]$ , given by $K = 4$ . In Figure 4 we compare the convergence of each of the optimizers under the optimal hyperparameters for the training loss.
|
| 176 |
+
|
| 177 |
+
Increasing damping coefficients During our experiments we observed that AggMo remains stable during optimization for learning rates an order of magnitude (or more) larger than is possible for CM and Nesterov with $\beta$ equal to the max damping coefficient used in AggMo.
|
| 178 |
+
|
| 179 |
+
We further investigated the effect of increasing the maximum damping coefficient of AggMo in Figure 5. The learning rate is fixed at 0.1 and we vary $K$ from 2 to 5. We compared to Nesterov with damping coefficients in the same range (max of 0.9999) and a fixed learning rate of 0.05 (to be consistent with our analysis in Section 4). We do not include the curves for which training is unstable: Nesterov with $\beta \in \{ 0 . { \dot { 9 } } 9 9 , 0 . 9 9 9 9 \}$ and AggMo with $K = 5$ . AggMo is able to take advantage of the larger damping coefficient of 0.999 and achieves the fastest overall convergence.
|
| 180 |
+
|
| 181 |
+
# 7.2 Classification
|
| 182 |
+
|
| 183 |
+
For the following experiments we evaluated AggMo using two network architectures: a neural network with 5 convolutional layers (CNN-5) and the ResNet-32 architecture (He et al., 2016). We use data augmentation and regularization only for the latter. Each model was trained for 400 epochs.
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan="2">Optimizer</td><td colspan="2">CNN-5 (CIFAR-10)</td><td colspan="2">ResNet-32 (CIFAR-10)</td><td colspan="2">ResNet-32 (CIFAR-100)</td></tr><tr><td>Val. (%)</td><td>Test (%)</td><td>Val. (%)</td><td>Test (%)</td><td>Val. (%)</td><td>Test (%)</td></tr><tr><td>CM</td><td>64.1</td><td>63.43</td><td>94.20</td><td>93.16</td><td>70.38</td><td>70.21</td></tr><tr><td>Nesterov</td><td>65.14</td><td>64.32</td><td>94.16</td><td>93.18</td><td>70.34</td><td>70.08</td></tr><tr><td>Adam</td><td>63.67</td><td>62.86</td><td>92.36</td><td>90.94</td><td>67.20</td><td>68.08</td></tr><tr><td>AggMo</td><td>65.98</td><td>65.09</td><td>93.87</td><td>93.16</td><td>70.28</td><td>70.11</td></tr><tr><td>CM (β = 0.9)</td><td>64.1</td><td>63.43</td><td>94.10</td><td>93.36</td><td>70.38</td><td>70.21</td></tr><tr><td>Nesterov (β = 0.9)</td><td>64.13</td><td>63.04</td><td>94.16</td><td>93.18</td><td>70.34</td><td>70.08</td></tr><tr><td>AggMo (Default)</td><td>65.98</td><td>65.09</td><td>93.87</td><td>93.16</td><td>70.28</td><td>70.11</td></tr></table>
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Table 2: Classification accuracy on CIFAR-10 and CIFAR-100 We display results using the optimal hyperparameters for CM, Nesterov, Adam and AggMo on the validation set and also with default settings for CM, Nesterov and AggMo.
|
| 189 |
+
Figure 6: ResNet-32 Trained On CIFAR-100 The training loss and validation accuracy during training on CIFAR-100 for each optimizer.
|
| 190 |
+
|
| 191 |
+
For each optimizer we report the accuracy on a randomly held out validation set and the test set. All of the models achieve near-perfect accuracy on the training set and so we do not report this. The results are displayed in Table 2. On the small convolutional network without regularization, AggMo significantly out performed the other methods. For both of the ResNet-32 experiments we observed the best validation accuracy with CM. This is perhaps expected as the model architecture and hyperparameters were likely to have been tuned using CM. Despite this, we observed that AggMo performed consistently well and had the fastest overall convergence.
|
| 192 |
+
|
| 193 |
+
We found that our proposed default hyperparameters for AggMo $a = 0 . 1$ , $K = 3$ ) led to much faster convergence than CM and Nesterov with $\beta = 0 . 9$ , a common default choice. Figure 6 shows the training loss and validation accuracy during training for each optimizer used to train the ResNet32 model. The hyperparameters used for each plot are those which obtained the best validation accuracy. AggMo converged most quickly on the training objective without sacrificing final validation performance.
|
| 194 |
+
|
| 195 |
+
Surprisingly, we found that using AggMo we were also able to train the ResNet-32 architecture on CIFAR-100 without using batch normalization. With a limited search over learning rates we achieved $6 9 . 3 2 \%$ test error compared to a best value of $6 7 . 2 6 \%$ using CM. We also found that, with batch normalization removed, optimization with AggMo remained stable at larger learning rates than with CM.
|
| 196 |
+
|
| 197 |
+
We note that the additional network hyperparameters (e.g. weight decay) are defaults which were likely picked as they work well with classical momentum. This may disadvantage the other optimizers, including our own. Despite this, we found that we are able to outperform CM with the AggMo and Nesterov optimizers without additional tuning of any of these hyperparameters.
|
| 198 |
+
|
| 199 |
+
# 7.3 Language modeling
|
| 200 |
+
|
| 201 |
+
We trained LSTM Language Models on the Penn Treebank dataset. We followed the experimental setup of Merity et al. (2017) and made use of the code provided by the authors. We used the optimal hyperparameter settings described by the authors and vary only the learning rate, momentum and whether gradient clipping is used. The network hyperparameters were tuned using SGD and may not be optimal for the other optimizers we evaluate (including our own). We followed only the base model training used in Merity et al. (2017) and do not include the fine-tuning and continuous cache optimization steps. Each model was trained for 750 epochs.
|
| 202 |
+
|
| 203 |
+
As noted in Merity et al. (2017), it is typically observed that SGD without momentum performs better than momentum-based methods in language modeling tasks. However, in our experiments we observed all momentum-based optimizers but CM outperform SGD without momentum. Surprisingly, we found that Adam is well-suited to this task and achieves the best training, validation, and test performance. We believe that the heavy regularization used when training the network makes Adam a good choice. AggMo is very close in terms of final performance to Adam.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 7: Convergence of LSTM The training and validation perplexity during training. For each model we use the hyperparameters that obtained the best validation loss. We found that there was very little difference when choosing hyperparameters based on training performance.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Optimizer</td><td>Train Perplexity</td><td>Val. Perplexity</td><td>Test Perplexity</td></tr><tr><td>*SGD + ASGD</td><td>35.68</td><td>61.17</td><td>59.26</td></tr><tr><td>SGD</td><td>35.34</td><td>63.39</td><td>62.41</td></tr><tr><td>CM</td><td>50.34</td><td>70.37</td><td>68.21</td></tr><tr><td>Nesterov</td><td>34.91</td><td>60.84</td><td>58.44</td></tr><tr><td>Adam</td><td>32.88</td><td>60.25</td><td>57.83</td></tr><tr><td>AggMo</td><td>33.22</td><td>60.36</td><td>57.79</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 3: Penn Treebank LSTM Perplexity across different optimizers. We display the train, validation, and test error for the optimization run that produced the best validation loss. \* uses ASGD (Polyak & Juditsky, 1992) and corresponds to the base model reported in Merity et al. (2017)
|
| 211 |
+
|
| 212 |
+
Table 3 contains the results for the hyperparameter settings which achieved the best validation error for each optimizer. The first row (denoted \*) uses the scheme suggested in Merity et al. (2017): once the validation loss plateaus we switch to the ASGD (Polyak & Juditsky, 1992) optimizer. The other rows instead decay the learning rate when the validation loss plateaus.
|
| 213 |
+
|
| 214 |
+
Figure 7 compares the convergence of the training and validation perplexity of each optimizer. While the momentum methods converge after 300 epochs, the momentum-free methods converged much more slowly. Surprisingly, we found that SGD worked best without any learning rate decay. Adam converged most quickly and achieved a validation perplexity which is comparable to that of AggMo. While gradient clipping is critical for SGD without momentum, which utilizes a large learning rate, we found that all of the momentum methods perform better without gradient clipping.
|
| 215 |
+
|
| 216 |
+
In short, while existing work encourages practitioners to avoid classical momentum we found that using other momentum methods may significantly improve convergence rates and final performance. AggMo worked especially well on this task over a large range of damping coefficients and learning rates.
|
| 217 |
+
|
| 218 |
+
# 8 Conclusion
|
| 219 |
+
|
| 220 |
+
Aggregated Momentum is a simple extension to classical momentum which is easy to implement and has negligible computational overhead on modern deep learning tasks. We showed empirically that AggMo is able to remain stable even with large damping coefficients and enjoys faster convergence rates as a consequence of this. Nesterov momentum can be viewed as a special case of AggMo. (Incidentally, we found that despite its lack of adoption by deep learning practitioners, Nesterov momentum also showed substantial advantages compared to classical momentum.) On the tasks we explored, AggMo could be used as a drop-in replacement for existing optimizers with little-to-no additional hyperparameter tuning. But due to its stability at higher $\beta$ values, it often delivered substantially faster convergence than both classical and Nesterov momentum.
|
| 221 |
+
|
| 222 |
+
# References
|
| 223 |
+
|
| 224 |
+
Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998.
|
| 225 |
+
|
| 226 |
+
Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016.
|
| 227 |
+
|
| 228 |
+
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.
|
| 229 |
+
|
| 230 |
+
Gabriel Goh. Why momentum really works. Distill, 2(4):e6, 2017.
|
| 231 |
+
|
| 232 |
+
Herbert Goldstein. Classical mechanics. Pearson Education India, 2011.
|
| 233 |
+
|
| 234 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in Neural Information Processing Systems, pp. 2211–2221, 2017.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 239 |
+
|
| 240 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 241 |
+
|
| 242 |
+
Rahul Kidambi, Praneeth Netrapalli, Prateek Jain, and Sham M Kakade. On the insufficiency of existing momentum schemes for stochastic optimization. arXiv preprint arXiv:1803.05591, 2018.
|
| 243 |
+
|
| 244 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 245 |
+
|
| 246 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
|
| 250 |
+
Laurent Lessard, Benjamin Recht, and Andrew Packard. Analysis and design of optimization algorithms via integral quadratic constraints. SIAM Journal on Optimization, 26(1):57–95, 2016.
|
| 251 |
+
|
| 252 |
+
Jingwei Liang, Jalal Fadili, and Gabriel Peyre. A multi-step inertial forward-backward splitting ´ method for non-convex optimization. In Advances in Neural Information Processing Systems, pp. 4035–4043, 2016.
|
| 253 |
+
|
| 254 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 255 |
+
|
| 256 |
+
James Martens. Deep learning via hessian-free optimization. In ICML, volume 27, pp. 735–742, 2010.
|
| 257 |
+
|
| 258 |
+
James Martens. New insights and perspectives on the natural gradient method. arXiv preprint arXiv:1412.1193, 2014.
|
| 259 |
+
|
| 260 |
+
James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In International conference on machine learning, pp. 2408–2417, 2015.
|
| 261 |
+
|
| 262 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing lstm language models. arXiv preprint arXiv:1708.02182, 2017.
|
| 263 |
+
|
| 264 |
+
Yurii Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). volume 27, pp. 372–367, 1983.
|
| 265 |
+
|
| 266 |
+
Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013.
|
| 267 |
+
|
| 268 |
+
Brendan O’Donoghue and Emmanuel Candes. Adaptive restart for accelerated gradient schemes. Foundations of computational mathematics, 15(3):715–732, 2015.
|
| 269 |
+
|
| 270 |
+
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.
|
| 271 |
+
|
| 272 |
+
Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
|
| 273 |
+
|
| 274 |
+
Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.
|
| 275 |
+
|
| 276 |
+
Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. In International Conference on Learning Representations, 2018. URL https://openreview. net/forum?id ${ . } = { }$ ryQu7f-RZ.
|
| 277 |
+
|
| 278 |
+
Vishwak Srinivasan, Adepu Ravi Sankar, and Vineeth N Balasubramanian. Adine: an adaptive momentum method for stochastic gradient descent. In Proceedings of the ACM India Joint International Conference on Data Science and Management of Data, pp. 249–256. ACM, 2018.
|
| 279 |
+
|
| 280 |
+
Weijie Su, Stephen Boyd, and Emmanuel Candes. A differential equation for modeling nesterovs accelerated gradient method: Theory and insights. In Advances in Neural Information Processing Systems, pp. 2510–2518, 2014.
|
| 281 |
+
|
| 282 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
|
| 283 |
+
|
| 284 |
+
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.
|
| 285 |
+
|
| 286 |
+
Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990.
|
| 287 |
+
|
| 288 |
+
Andre Wibisono and Ashia C Wilson. On accelerated methods in optimization. arXiv preprint arXiv:1509.03616, 2015.
|
| 289 |
+
|
| 290 |
+
Andre Wibisono, Ashia C Wilson, and Michael I Jordan. A variational perspective on accelerated methods in optimization. Proceedings of the National Academy of Sciences, 113(47):E7351–E7358, 2016.
|
| 291 |
+
|
| 292 |
+
Ashia C Wilson, Benjamin Recht, and Michael I Jordan. A lyapunov analysis of momentum methods in optimization. arXiv preprint arXiv:1611.02635, 2016.
|
| 293 |
+
|
| 294 |
+
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.
|
| 295 |
+
|
| 296 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 297 |
+
|
| 298 |
+
Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 928–936, 2003.
|
| 299 |
+
|
| 300 |
+
# Appendices
|
| 301 |
+
|
| 302 |
+
# A Nesterov Equivalence
|
| 303 |
+
|
| 304 |
+
In this section we demonstrate this equivalence on two toy problems. In each of the figures included here we take $\beta = 0 . 9 9 9$ .
|
| 305 |
+
|
| 306 |
+
We first consider a 2D quadratic function, $f ( \mathbf { x } ) = \mathbf { x } ^ { T } A \mathbf { x }$ , where $A$ has eigenvalues 1.0 and 0.001.The learning rates for each optimizer are set as described in Section 4. Each optimizer is initialized at the same position. Figure 8 shows both optimizers following the same optimization trajectories. In this setting, the two paths are also visually indistinguishable with $\gamma _ { t } ^ { ( 1 ) } = \dot { \gamma _ { t } } ^ { ( 2 ) } = 2 \gamma$ for $\mathbf { A g g M o }$ .
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
|
| 310 |
+
Figure 8: Equivalence of Nesterov and AggMo when $\beta = 0 . 9 9 9$ . The optimization plots for $f ( x ) = \mathbf { x } ^ { T } A \mathbf { x }$ are visibly identical (circles correspond to AggMo and squares to Nesterov - the markers are offset for readability).
|
| 311 |
+
|
| 312 |
+
We now optimize the Rosenbrock function, given by,
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
f ( x , y ) = ( y - x ^ { 2 } ) ^ { 2 } + 1 0 0 ( x - 1 ) ^ { 2 }
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
This function has a global minimum at $( x , y ) = 1$ . Once again the optimizers are initialized at the same point but for this example we take $\gamma _ { t } ^ { ( 1 ) } = \gamma _ { t } ^ { ( 2 ) } = 2 \gamma$ for $\mathbf { A g g M o }$ . Figure 9 shows the optimization trajectories of both algorithms. In this case we see that the updates are initially indistinguishable but begin to differ as the algorithms approach the origin.
|
| 319 |
+
|
| 320 |
+
# B Quadratic Convergence Analysis
|
| 321 |
+
|
| 322 |
+
In this section we present details of the convergence rate computations in Figure 3. We also present some additional supporting results.
|
| 323 |
+
|
| 324 |
+
We first note that for quadratic functions of the form $f ( \mathbf { x } ) = \frac { 1 } { 2 } \mathbf { x } ^ { T } A x + b ^ { T } \mathbf { x }$ xT Ax + bT x we can write the AggMo optimization procedure as a linear dynamical systems in $K \bar { + } 1$ variables:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \vdots } \\ { \mathbf { v } _ { t + 1 } ^ { ( K ) } } \\ { \mathbf { x } _ { t + 1 } - \mathbf { x } ^ { * } } \end{array} \right] = B \left[ \begin{array} { c } { \mathbf { v } _ { t } ^ { ( 1 ) } } \\ { \vdots } \\ { \mathbf { v } _ { t } ^ { ( K ) } } \\ { \mathbf { x } _ { t } - \mathbf { x } ^ { * } } \end{array} \right]
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 9: Approximate equivalence of Nesterov and AggMo when $\beta = 0 . 9 9 9$ . The optimization trajectories are initially visibly identical but begin to differ slightly after more iterations.
|
| 332 |
+
|
| 333 |
+
The spectral norm of the matrix $B$ determines the rate at which the linear dynamical system converges and thus bounds $| | \mathbf { x } _ { t } - \mathbf { x } ^ { * } | | ^ { 2 }$ (Lessard et al., 2016). We can write down the exact form of $B$ as follows,
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
B = \left[ \begin{array} { c c c c c } { \beta ^ { ( 1 ) } I } & { 0 } & { \cdots } & { 0 } & { - A } \\ { 0 } & { \beta ^ { ( 2 ) } I } & { \ddots } & { \vdots } & { \vdots } \\ { \vdots } & { \ddots } & { \ddots } & { 0 } & { - A } \\ { 0 } & { \cdots } & { 0 } & { \beta ^ { ( K ) } I } & { - A } \\ { \frac { \gamma \beta ^ { ( 1 ) } } { K } I } & { \frac { \gamma \beta ^ { ( 2 ) } } { K } I } & { \cdots } & { \frac { \gamma \beta ^ { ( K ) } } { K } I } & { ( I - \gamma A ) } \end{array} \right]
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
We note in particular that in the special case of $K = 1$ (CM) we recover the characteristic equation of O’Donoghue & Candes (2015):
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
u ^ { 2 } - ( 1 + \beta - \gamma \lambda _ { i } ) u + \beta = 0
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Which in turn yields the critical damping coefficient and optimal rate, with
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\beta ^ { * } = \left( \frac { \sqrt { \kappa } - 1 } { \sqrt { \kappa } + 1 } \right) ^ { 2 } .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
When $\beta < \beta ^ { * }$ the system is over-damped and exhibits slow monotone convergence (Figure 1 (a)). When $\beta > \beta ^ { * }$ the system is under-damped and the characteristic equation yields imaginary solutions that correspond to oscillations (Figure 1 (b)) with convergence rate equal to $1 - | \beta |$ . At the critical damping coefficient the convergence is optimal at $1 . 0 - { \frac { { \sqrt { \kappa } } - 1 } { { \sqrt { \kappa } } + 1 } }$
|
| 352 |
+
|
| 353 |
+
We can combine this analysis with Theorem 2 from Sutskever et al. (2013) to recover similar convergence bounds for Nesterov momentum.
|
| 354 |
+
|
| 355 |
+
Producing Figure 3 To produce the curves in Figure 3 we compute the eigenvalues directly from the matrix $B$ for matrices $A$ with varying condition numbers. While we can find the optimal learning rate for CM and Nesterov momentum in closed form we have been unable to do so for AggMo. Therefore, we instead perform a fine-grained grid search to approximate the optimal learning rate for each condition number.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 10: Velocity during quadratic optimization with CM, Nesterov, and AggMo. (Best viewed in color) The shaded region shows the direction and relative magnitude of the velocities throughout optimization for each optimizer. $\mathbf { A g g M o }$ has multiple shaded regions corresponding to the different velocities.
|
| 359 |
+
|
| 360 |
+
Studying Velocity We now present a brief study illustrating how using multiple velocities can break oscillations during optimization.
|
| 361 |
+
|
| 362 |
+
Figure 10 shows the optimization of a 1-D quadratic function with CM, Nesterov, and AggMo. The shaded region around each curve represents the direction and relative magnitude of the velocities term during optimization. CM (a) has a single velocity and oscillates at a near-constant amplitude. For Nesterov momentum (b) we display the velocity and the ”error-correcting” term. AggMo (c) has shaded regions for each velocity. For AggMo, the velocity with $\beta = 0 . 9$ oscillates at a higher frequency and thus damps the whole system.
|
| 363 |
+
|
| 364 |
+
# C Convergence Proof
|
| 365 |
+
|
| 366 |
+
Here we present the proof of Theorem $^ { 5 1 }$ . We introduce some simplifying notation used in Duchi et al. (2011). We write $g _ { t } = \nabla f ( \theta _ { t } )$ , with $g _ { t , i }$ denoting the $i ^ { \mathrm { { t h } } }$ element of the vector $g _ { t }$ . We further write $g _ { 1 : t , i } \in \mathbb { R } ^ { t }$ for the $i ^ { \mathrm { { t h } } }$ dimension of gradients up to iteration $t$ .
|
| 367 |
+
|
| 368 |
+
We begin with the following lemma,
|
| 369 |
+
Lemma 1. We write $\mathbf { v } _ { t , j } ^ { i }$ to indicate the $j ^ { t h }$ element of the $i ^ { t h }$ velocity at time $t$ . Assume $g _ { t }$ is
|
| 370 |
+
bounded, then the following holds for all $j$ ,
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) } { } ^ { 2 } } { \sqrt { t } } \leq | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sqrt { 1 + \log ( T ) } \sum _ { i = 1 } ^ { K } \frac { 1 } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } }
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
Proof We begin by expanding the last term in the sum using the update equations,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } & { \displaystyle \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } = \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } _ { h } ^ { ( i ) } ) ^ { T - h } g _ { h , j } \right) ^ { 2 } } \\ & { \qquad \leq \sum _ { t = 1 } ^ { T - 1 } \displaystyle \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } \right) \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } g _ { h , j } ^ { 2 } \right) } \\ & { \qquad \leq \displaystyle \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \frac { 1 } { 1 - \boldsymbol { \beta } ^ { ( i ) } } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } g _ { h , j } ^ { 2 } \right) } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
The first inequality is obtained via Cauchy-inequality follows directly from the fact chat $\beta _ { t } ^ { ( i ) } \le \beta$ for all . We $t$ . The secondn apply this $\begin{array} { r } { \sum _ { h = 1 } ^ { T } ( \beta ^ { ( i ) } ) ^ { T - h } < 1 / ( 1 - \beta ^ { ( i ) } ) } \end{array}$ $t$
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\begin{array} { r l } { \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { N } \frac { \partial _ { i } ^ { j } } { \partial t } } & { = \sum _ { j = 1 } ^ { N } \sum _ { i = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ { \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \frac { \partial _ { i } ^ { j } } { \partial t } } & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ & { = \sum _ { i = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { = \sum _ { i = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \end{array}
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Under equality we swap the order of sums and collect terms under $g _ { t }$ . The third inequality follows from $\textstyle \sum _ { j = 1 } ^ { t } ( \beta ^ { ( i ) } ) ^ { j - t } < 1 / ( 1 - \beta )$ . The fourth inequality is an application of Cauchy-Schwarz. The final inequality is from the harmonic sum bound: $\textstyle \sum _ { t = 1 } ^ { T } 1 / t \leq 1 + \log ( T )$ . This completes the proof.
|
| 389 |
+
|
| 390 |
+
Proof of Theorem 1 From the update equations we may write,
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { c } { \displaystyle \pmb { \theta } _ { t + 1 } = \pmb { \theta } _ { t } + \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } \mathbf { v } _ { t } ^ { ( i ) } } \\ { = \displaystyle \pmb { \theta } _ { t } + \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } ( \beta _ { t } ^ { ( i ) } \mathbf { v } _ { t - 1 } ^ { ( i ) } - g _ { t } ) } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
We now shift focus to only the $j ^ { \mathrm { t h } }$ dimension. We subtract $\theta { * _ { j } }$ from both sides and square,
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
( \pmb { \theta } _ { t + 1 , j } - \pmb { \theta } _ { j } ^ { * } ) ^ { 2 } = ( \pmb { \theta } _ { t , j } - \pmb { \theta } _ { j } ^ { * } ) ^ { 2 } + 2 \frac { \gamma _ { t } } { K } ( \pmb { \theta } _ { t , j } - \pmb { \theta } _ { j } ^ { * } ) \sum _ { i = 1 } ^ { K } ( \beta _ { t } ^ { ( i ) } \mathbf { v } _ { t - 1 , j } ^ { ( i ) } - g _ { t , j } ) + \frac { \gamma _ { t } ^ { 2 } } { K ^ { 2 } } ( \sum _ { i = 1 } ^ { K } \mathbf { v } _ { t , j } ^ { ( i ) } ) ^ { 2 }
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
We can rearrange this expression and bound as follows,
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } { \epsilon _ { 1 } ( \theta _ { 2 } - \theta _ { 3 } ^ { * } ) - \frac { 1 } { 2 \pi ^ { 2 } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \langle \theta _ { 3 } , \dots , \theta _ { 3 } ^ { * } \rangle \frac { 1 } { \epsilon _ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , } \\ { - \frac { 1 } { \sqrt { \pi ^ { 2 } } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \frac { 1 } { \sqrt { \pi ^ { 2 } } } \sqrt { \langle \theta _ { 1 } , \dots , \theta _ { 3 } ^ { * } \rangle \langle \theta _ { 2 } ^ { * } , \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } } } \\ - \frac { 1 } { 2 \pi ^ { 2 } } \frac { 1 } { \sqrt { \pi ^ { 2 } } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \frac { 1 } { \sqrt { \pi ^ { 2 } } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } \sqrt { \pi ^ { 2 } } } \\ - \frac { 1 } { 2 \pi ^ { 2 } } \frac { 1 } \sqrt \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
The first inequality is an application of Young’s inequality. For the second inequality we use the sum-of-squares inequality. We now make use of convexity, and take the sum over dimensions and time,
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { r l } { \displaystyle \sum _ { i = 1 } ^ { n } f ( \theta _ { i } ) - f ( \theta ^ { i } ) \in \sum _ { t = 1 } ^ { n } \sum _ { n = 1 } ^ { \infty } \partial _ { t } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle } \\ { \displaystyle } & { \le \sum _ { t = 1 } ^ { N } \frac { 1 } { 2 \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { 2 \pi ^ { 3 } \nu } \Big [ ( \theta _ { i , t } \partial _ { t } g _ { t } ) ^ { 2 } - ( \theta _ { i } - \pi _ { i } - \theta _ { i } ^ { t } ) ^ { 2 } \Big ] + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi \beta _ { i - 1 } } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } } \\ & { \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { 2 \pi ^ { 3 } } \partial _ { t } \langle \theta _ { i - 1 , t } ^ { t } \rangle ^ { 2 } + \frac { 1 } { 2 K } \frac { K } { \pi ^ { 2 } \nu ^ { 2 } } \langle \theta _ { i } , \theta _ { i } ^ { t } \rangle } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { N } \frac { 1 } { 2 \pi ^ { 4 } } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } \frac { 1 } { K } \frac { 1 } { K } + \frac { 1 } { \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { K } } \\ & { \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi ^ { 3 } } \frac { 1 } { K } \Big [ \theta _ { i , t } \partial _ { t } ^ { t } \Big ] \overset { ( 3 ) } { \le } \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi ^ { 3 } } } \\ & \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } K } \frac \partial _ { t } ^ ( 2 \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
We now make use of the bounding assumptions, $| | \pmb \theta _ { m } - \pmb \theta _ { n } | | _ { 2 } \leq D$ and $| | \pmb \theta _ { m } - \pmb \theta _ { n } | | _ { \infty } \leq D _ { \infty }$ ,
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 \gamma } \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \sum _ { t = 1 } ^ { T } \beta ^ { ( i ) } \lambda ^ { t - 1 } \sqrt { t }
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
The first two terms are collapsed using a telescoping sum. Using $\textstyle \sum _ { t } \lambda ^ { t - 1 } { \sqrt { t } } \leq 1 / ( 1 - \lambda ) ^ { 2 }$ , we achieve the following bound,
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 K \gamma ( 1 - \lambda ) ^ { 2 } } \sum _ { i = 1 } ^ { K } \beta ^ { ( i ) }
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
# C.1 Open Questions on Convergence
|
| 427 |
+
|
| 428 |
+
While studying the convergence properties of AggMo we made several interesting observations which presented theoretical challenges. We present some of these observations here to shed light on key differences between AggMo and existing momentum methods. We hope that these will provoke further study.
|
| 429 |
+
|
| 430 |
+
Further reduction of $B$ In Appendix $\mathbf { B }$ we derived the matrix $B$ in order to get bounds on the convergence. We can further reduce $B$ to block diagonal form, where the $j ^ { t h }$ block takes the form,
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
B _ { j } = \left[ \begin{array} { c c c c c } { \beta ^ { ( 1 ) } } & { 0 } & { \cdots } & { 0 } & { - \lambda _ { j } } \\ { 0 } & { \beta ^ { ( 2 ) } } & { \ddots } & { \vdots } & { \vdots } \\ { \vdots } & { \ddots } & { \ddots } & { 0 } & { - \lambda _ { j } } \\ { 0 } & { \cdots } & { 0 } & { \beta ^ { ( K ) } } & { - \lambda _ { j } } \\ { \frac { \gamma \beta ^ { ( 1 ) } } { K } } & { \frac { \gamma \beta ^ { ( 2 ) } } { K } } & { \cdots } & { \frac { \gamma \beta ^ { ( K ) } } { K } } & { ( 1 - \gamma \lambda _ { j } ) } \end{array} \right]
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
From this relatively simple form we may be able to derive a closed-form solution for the eigenvalues which would allow us to reason theoretically about the quadratic convergence properties of $\mathbf { A g g M o }$ . An easier goal would be finding suitable conditions under which the eigenvalues are complex and the system is under-damped.
|
| 437 |
+
|
| 438 |
+
Finite Difference Equation In this section we demonstrate that the dynamics of AggMo can be written as a $( K + 1 )$ -th order finite difference equation. While most momentum methods can be viewed as the discretization of second order ODEs (Wilson et al., 2016) it seems that AggMo does not fall into this class of algorithms. As a consequence, it becomes difficult to apply existing convergence proof techniques to AggMo.
|
| 439 |
+
|
| 440 |
+
For simplicity, we assume a fixed learning rate $\gamma$ for all time steps. We will first tackle the special case $K = 2$ . From the AggMo update rule, we have
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 2 ) } } \end{array} \right] = \left[ \begin{array} { c c c c c c } { 0 } & { 0 } & { \beta _ { 1 } } & { 0 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { \beta _ { 2 } } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { \beta _ { 1 } } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { \beta _ { 2 } } \\ { 0 } & { 0 } & { \frac { \gamma } { K } } & { \frac { \gamma } { K } } & { 1 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { \frac { \gamma } { K } } & { 1 + \frac { \gamma } { K } } \end{array} \right] \left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 2 ) } } \end{array} \right] - \left[ \begin{array} { c } { \nabla _ { \theta } f ( \theta _ { t } ) } \\ { \nabla _ { \theta } f ( \theta _ { t } ) } \\ { \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \theta _ { t } - \theta _ { t - 1 } } \\ { \theta _ { t - 1 } - \theta _ { t - 2 } } \end{array} \right]
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
Denoting the matrices as symbols correspondingly, it becomes $\mathbf { v } = \mathbf { B } \mathbf { v } - \mathbf { g }$ , therefore
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\mathbf { v } = - ( \mathbf { I } - \mathbf { B } ) ^ { - 1 } \mathbf { g }
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Denote $\delta _ { t } = \theta _ { t } - \theta _ { \star }$ , then $\theta _ { t } - \theta _ { t - 1 } = \delta _ { t } - \delta _ { t - 1 }$ . Note that $\begin{array} { r } { \theta _ { t + 1 } = \theta _ { t } + \frac { \gamma _ { t + 1 } } { 2 } \big ( \mathbf { v } _ { t + 1 } ^ { ( 1 ) } + \mathbf { v } _ { t + 1 } ^ { ( 2 ) } \big ) } \end{array}$ , plugging Eq 10 into it, we have
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\delta _ { t + 1 } = \delta _ { t } - { \frac { \gamma } { 2 } } [ 1 , 1 , 0 , 0 , \cdots ] ^ { \top } ( \mathbf { I } - \mathbf { B } ) ^ { - 1 } \mathbf { g }
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
Which reduces to the following finite difference equation,
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\dot { \iota } _ { t + 1 } = ( 1 + \beta _ { 1 } + \beta _ { 2 } ) \delta _ { t } + ( \beta _ { 1 } + \beta _ { 2 } + \beta _ { 1 } \beta _ { 2 } ) \delta _ { t - 1 } - \beta _ { 1 } \beta _ { 2 } \delta _ { t - 2 } + \frac { \gamma } { 2 } ( 2 \nabla _ { \theta } f ( \theta _ { t } ) - ( \beta _ { 1 } + \beta _ { 2 } ) \nabla _ { \theta } f ( \theta _ { t - 1 } ) )
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
For $K \geq 2$ , we only need to change $\operatorname { E q } 9$ accordingly, follow the remaining derivations, and recover a $( K + 1 )$ -th order difference equation. We could also derive the same result using sequence elimination, made simpler with some sensible variable substitutions.
|
| 465 |
+
|
| 466 |
+
This result is of considerable importance. Existing momentum methods can generally be rewritten as a second order difference equation (Section 2 in O’Donoghue & Candes (2015)) which then induce a second order ODE (Su et al., 2014; Wibisono & Wilson, 2015). The momentum optimization procedure can then be thought of as a discretization of a Hamiltonian flow. On the other hand, AggMo does not obviously lend itself to the analytical tools developed in this setting - it is not obvious whether the form in AggMo is indeed a discretization of a Hamiltonian flow.
|
| 467 |
+
|
| 468 |
+
# D Experiments
|
| 469 |
+
|
| 470 |
+
All of our experiments are conducted using the pytorch library Paszke et al. (2017). In each experiment we make use of early stopping to determine the run with the best validation performance.
|
| 471 |
+
|
| 472 |
+
# D.1 Autoencoders
|
| 473 |
+
|
| 474 |
+
For the autoencoders we train fully connected networks with encoders using the following architecture: 784-1000-500-250-30. The decoder reverses this architecture. We use relu activations throughout the network. We train for a total of 1000 epochs using a multiplicative learning rate decay of 0.1 at 200, 400, and 800 epochs. We train using batch sizes of 200.
|
| 475 |
+
|
| 476 |
+
For these experiments the training set consists of $90 \%$ of the training data with the remaining $10 \%$ being used for validation.
|
| 477 |
+
|
| 478 |
+
For each optimizer we searched over the following range of learning rates: $\{ \ : 0 . 1 , 0 . 0 5 , 0 . 0 1 , 0 . 0 0 5 .$ 0.001, 0.0005, 0.0001, 0.00005, 0.00001}.
|
| 479 |
+
|
| 480 |
+
# D.2 Classification
|
| 481 |
+
|
| 482 |
+
For each of the classification tasks we train for a total of 400 epochs using batchsizes of 128. We make use of a multiplicative learning rate decay of 0.1 at 150 and 250 epochs. For each of these experiments we use $80 \%$ of the training data for training and use the remaining $20 \%$ as validation.
|
| 483 |
+
|
| 484 |
+
In these experiments we searched over the following learning rates for all optimizers: $\left\{ \ 0 . 1 , 0 . 0 5 \right.$ 0.01, 0.005, 0.001, 0.0005, 0.0001 $\}$ . We searched over the same damping coefficients as in the autoencoder experiments. Each model was trained for a total of 500 epochs.
|
| 485 |
+
|
| 486 |
+
When training without batch normalization we explored a smaller range of learning rates for both CM and AggMo: $\{ 0 . 1 , 0 . 0 5 , 0 . 0 1 , 0 . 0 0 5 \}$ .
|
| 487 |
+
|
| 488 |
+
CNN-5 The CNN-5 model uses relu activations throughout and 2x2 max pooling with stride 2. The first convolutional layer uses an 11x11 kernel with a stride of 4. This is followed by a max pooling layer. There is then a 5x5 convolutional kernel followed by max pooling. The network then uses three 3x3 convolutional layers and a final max pooling layer before feeding into a fully connected output layer. We do not use any regularization when training this model.
|
| 489 |
+
|
| 490 |
+
ResNet-32 We use the ResNet-32 architecture on both CIFAR-10 and CIFAR-100. We make use of a weight decay of 0.0005 and use batch normalization (Ioffe & Szegedy, 2015). We introduce data augmentation by using random crops with a padding of 4 and use random horizontal flips with probability 0.5.
|
| 491 |
+
|
| 492 |
+
# D.3 LSTM Language Modelling
|
| 493 |
+
|
| 494 |
+
We train LSTMs with 3-layers containing 1150 hidden units per layer, and a 400 embedding size. Within the network we use dropout on the layers with probability 0.4. The hidden layers use dropout with probability 0.3 and the input embedding layers use dropout with probability 0.65 while the embedding layer itself uses dropout with probability 0.1. We also apply the weight drop method proposed in Merity et al. (2017) with probability 0.5. L2 regularization is applied on the RNN activations with a scaling of 2.0, we also use temporal activation regularization (slowness regularization) with scaling 1.0. Finally, all weights receive a weight decay of $1 . 2 \mathrm { e } { \cdot } 6 .$ .
|
| 495 |
+
|
| 496 |
+
We train the model using variable sequence lengths and batch sizes of 80. We measure the validation loss during training and decrease the learning rate if the validation loss has not decreased for 15 epochs. We found that a learning rate decay of 0.5 worked best for all optimizers except for SGD which achieved best performance with a fixed learning rate.
|
| 497 |
+
|
| 498 |
+
For SGD, CM, AggMo and Nesterov we searched over learning rates in the range $\{ 5 0 , 3 0 , 1 0 , 5$ 2.5, 1, 0.1, 0.01}. We found that Adam required much smaller learning rates in this setting and so searched over values in the range $\{ 0 . 1 , 0 . 0 \dot { 5 } , 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 1 , 0 . 0 0 0 5 , 0 . 0 0 0 1 \}$ . We searched over the damping coefficients as in the previous experiments. Each model was trained for 750 epochs, as in Merity et al. (2017).
|
| 499 |
+
|
| 500 |
+
# E Additional Results
|
| 501 |
+
|
| 502 |
+
In this section we display some of the experimental results which we are unable to fit in the main paper.
|
| 503 |
+
|
| 504 |
+
# E.1 Toy Problem
|
| 505 |
+
|
| 506 |
+
To better understand how AggMo is able to help in non-convex settings we explore its effectiveness on a simple non-convex toy problem. The function we aim to optimize is defined as follows,
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\begin{array} { c } { { f ( x , y ) = \log ( e ^ { x } + e ^ { - x } ) + } } \\ { { b \log \left( e ^ { e ^ { x } ( y - \sin ( a x ) ) } + e ^ { - e ^ { x } ( y - \sin ( a x ) ) } \right) } } \end{array}
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+

|
| 513 |
+
Figure 11: Comparison of classical momentum and aggregated momentum on toy problem (13) with $a = 8 , b =$ 10. In each case the optimizer is initialized at $( x , y ) = ( - 2 , 0 )$
|
| 514 |
+
|
| 515 |
+
Table 4: MNIST Autoencoder with default settings We display the training MSE for the initial learning rate that achieved the best training loss. The validation and test errors are displayed for the initial learning rate that achieved the best validation MSE.
|
| 516 |
+
|
| 517 |
+
<table><tr><td rowspan="2">Optimizer</td><td>Train Optimal</td><td colspan="2">Validation Optimal</td></tr><tr><td>Train Loss</td><td>Val. Loss</td><td>Test Loss</td></tr><tr><td>CM β = 0.9</td><td>2.07</td><td>4.95</td><td>4.98</td></tr><tr><td>Nesterov β = 0.9</td><td>1.94</td><td>4.63</td><td>4.62</td></tr><tr><td>AggMo (Default)</td><td>1.60</td><td>3.14</td><td>3.04</td></tr></table>
|
| 518 |
+
|
| 519 |
+
where $a$ and $b$ are constants which may be varied. We choose this function because it features flat regions and a series of non-convex funnels with varied curvature. The optimizer must traverse the flat regions quickly whilst remaining stable within the funnels. This function has an optimal value at $( x , y ) { \overset { \vartriangle } { = } } ( 0 , { \dot { 0 } } )$ .
|
| 520 |
+
|
| 521 |
+
Figure 11 compares the performance of classical momentum and aggregated momentum when optimizing Equation 13 with $a = 8 , b = 1 0$ . We see that GD with $\beta = 0$ and $\beta = 0 . 9$ are unable to leave the flat region around $x < - 1$ . For GD with $\beta = 0 . 9 9 9$ the optimizer enters the funnels but frequently becomes unstable with oscillations and finally overshoots the optimum. Compared to GD, AggMo is able to quickly traverse both the flat region and the funnels while remaining stable. AggMo also successfully slows down quickly once reaching the optimum.
|
| 522 |
+
|
| 523 |
+
# E.2 Comparison at default damping settings
|
| 524 |
+
|
| 525 |
+
In this section we present results using the default damping coefficient settings for the autoencoder and LSTM experiments.
|
| 526 |
+
|
| 527 |
+
The default settings for CM, Nesterov, and AggMo are compared in Table 4. The default settings of AggMo outperform both CM and Nesterov significantly. Moreover, while the AggMo default settings perform similarly to the best results in Table 1 there is a large gap for the CM and Nesterov defaults. This suggests that for this task AggMo is less sensitive to hyperparameter tuning than the other methods.
|
| 528 |
+
|
| 529 |
+
For the LSTM experiments we found that all methods worked best with their default damping coefficients except for Nesterov momentum which used $\beta = 0 . 9 9$ . For Nesterov momentum with $\beta = 0 . 9$ the validation perplexity was 63.67 and the test perplexity was 61.45. AggMo with default settings achieved better training, validation and test perplexity than both the CM and Nesterov defaults.
|
| 530 |
+
|
| 531 |
+
# F Beta-Averaged Momentum
|
| 532 |
+
|
| 533 |
+
In this section we present a continuous analog of AggMo which provides additional insight into its effectiveness.
|
| 534 |
+
|
| 535 |
+
The AggMo update rule features the average of several velocities with some chosen damping coefficients, $\beta$ . A natural extension to this formulation instead considers a mapping from beta values to velocities with the space of velocities being integrated over instead of summed. Explicitly, we write this update rule as,
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = b \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma \displaystyle \int _ { 0 } ^ { 1 } \mathbf { v } _ { t } \pi ( b ) d b } \end{array}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
Where $\pi ( b )$ is a probability density defined on $[ 0 , 1 ]$ . We can link this back to aggregated momentum in the following way. If we sampled $b ^ { ( i ) }$ under the density $\pi$ for $i = 1 : M$ then the procedure described by Equation 3 is approximating Equation 14 via Monte Carlo Integration.
|
| 542 |
+
|
| 543 |
+
Although this seems like a reasonable idea, it is not obvious whether we can compute this integral in closed form. We can understand this update rule by expanding $\mathbf { v } _ { t }$ recursively,
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\begin{array} { l } { \displaystyle \mathbf { v } _ { t } = b \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \displaystyle \quad = b ( b \mathbf { v } _ { t - 2 } - \nabla _ { \theta } f ( \theta _ { t - 2 } ) ) - \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \displaystyle \quad = b ^ { t } \mathbf { v } _ { 0 } - \sum _ { i = 1 } ^ { t } b ^ { i - 1 } \nabla _ { \theta } f ( \theta _ { t - i } ) } \\ { \displaystyle \quad = - \sum _ { i = 1 } ^ { t } b ^ { i - 1 } \nabla _ { \theta } f ( \theta _ { t - i } ) = - \sum _ { i = 0 } ^ { t - 1 } b ^ { t - i - 1 } \nabla _ { \theta } f ( \theta _ { i } ) } \end{array}
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
Thus we can write the update rule for $\mathbf { x } _ { t }$ as,
|
| 550 |
+
|
| 551 |
+
$$
|
| 552 |
+
\pmb \theta _ { t } = \pmb \theta _ { t - 1 } - \gamma \sum _ { i = 1 } ^ { t } \nabla _ { \pmb \theta } f ( \pmb \theta _ { t - i } ) \int _ { 0 } ^ { 1 } b ^ { i - 1 } \pi ( b ) d b
|
| 553 |
+
$$
|
| 554 |
+
|
| 555 |
+
Thus to compute the update rule we must compute the raw moments of $b$ . Fortunately, for the special case where $\pi$ is the density function of a Beta distribution then we have closed form solutions for the raw moments of $b \sim B e t a ( \alpha , \beta )$ (note that $\beta$ here is not referring to a damping coefficient) then these raw moments have a closed form:
|
| 556 |
+
|
| 557 |
+
$$
|
| 558 |
+
\mathbb { E } [ b ^ { k } ] = \prod _ { r = 0 } ^ { k - 1 } \frac { \alpha + r } { \alpha + \beta + r }
|
| 559 |
+
$$
|
| 560 |
+
|
| 561 |
+
This provides a closed form solution to compute $\theta _ { t }$ given $\pmb { \theta } _ { t - 1 }$ and the history of all previous gradients. We refer to this update scheme as Beta-Averaged Momentum. Unfortunately, each update requires the history of all previous gradients to be computed. We may find some reasonable approximation to the update rule. For example, we could keep only the $T$ most recently computed gradients.
|
| 562 |
+
|
| 563 |
+
Figure 12 shows the optimization of 1D quadratics using Beta-Averaged Momentum. The trajectories are similar to those achieved using the original AggMo formulation.
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
Figure 12: Beta-Averaged GD with a Beta prior on momentum $( \alpha = 1 0 0 , \beta = 1 )$ ).
|
md/train/UcoXdfrORC/UcoXdfrORC.md
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MODEL-BASED VISUAL PLANNING WITH SELF-SUPERVISED FUNCTIONAL DISTANCES
|
| 2 |
+
|
| 3 |
+
Stephen $\mathbf { T i a n } ^ { 1 }$ , Suraj $\mathbf { N a i r ^ { 2 } }$ , Frederik Ebert1, Sudeep Dasari3, Benjamin Eysenbach3,
|
| 4 |
+
Chelsea $\mathbf { F i n n ^ { 2 } }$ , Sergey Levine1
|
| 5 |
+
1University of California, Berkeley
|
| 6 |
+
2Stanford University
|
| 7 |
+
3Carnegie Mellon University
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
A generalist robot must be able to complete a variety of tasks in its environment. One appealing way to specify each task is in terms of a goal observation. However, learning goal-reaching policies with reinforcement learning remains a challenging problem, particularly when hand-engineered reward functions are not available. Learned dynamics models are a promising approach for learning about the environment without rewards or task-directed data, but planning to reach goals with such a model requires a notion of functional similarity between observations and goal states. We present a self-supervised method for model-based visual goal reaching, which uses both a visual dynamics model as well as a dynamical distance function learned using model-free reinforcement learning. Our approach learns entirely using offline, unlabeled data, making it practical to scale to large and diverse datasets. In our experiments, we find that our method can successfully learn models that perform a variety of tasks at test-time, moving objects amid distractors with a simulated robotic arm and even learning to open and close a drawer using a real-world robot. In comparisons, we find that this approach substantially outperforms both model-free and model-based prior methods. Videos and visualizations are available here: https://sites.google.com/berkeley.edu/mbold.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Designing general-purpose robots that can perform a wide range of tasks remains an open problem in AI and robotics. Reinforcement learning (RL) represents a particularly promising tool for learning robotic behaviors when skills can be learned one at a time from user-defined reward functions. However, general-purpose robots will likely require large and diverse repertoires of skills, and learning individual tasks one at a time from manually-specified rewards is onerous and time-consuming. How can we design learning systems that can autonomously acquire general-purpose knowledge that allows them to solve many different downstream tasks?
|
| 16 |
+
|
| 17 |
+
To address this problem, we must resolve three questions. (1) How can the robot be commanded to perform specific downstream tasks? A simple and versatile choice is to define tasks in terms of desired outcomes, such as an example observation of the completed task. (2) What types of data should this robot learn from? In settings where modern machine learning attains the best generalization results (Deng et al., 2009; Rajpurkar et al., 2016; Devlin et al., 2018), a common theme is that excellent generalization is achieved by learning from large and diverse task-agnostic datasets. In the context of RL, this means we need offline methods that can use all sources of prior data, even in the absence of reward labels. As collecting new experience on a physical robot is often expensive, offline data is often more practical to use in real-world settings (Levine et al., 2020). (3) What should the robot learn from this data to enable goal-reaching? Similar to prior work (Botvinick & Weinstein, 2014; Watter et al., 2015; Finn & Levine, 2017; Ebert et al., 2018b), we note that policies and value functions are specific to a particular task, while a predictive model captures the physics of the environment independently of the task, and thus can be used for solving almost any task. This makes model learning particularly effective for learning from large and diverse datasets, which do not necessarily contain successful behaviors.
|
| 18 |
+
|
| 19 |
+
While model-based approaches have demonstrated promising results, including for vision-based tasks in real-world robotic systems (Ebert et al., 2018a; Finn & Levine, 2017), such methods face two major challenges. First, predictive models on raw images are only effective over short horizons, as uncertainty accumulates far into the future (Denton & Fergus, 2018; Finn et al., 2016; Hafner et al., 2019b; Babaeizadeh et al., 2017). Second, using such models for planning toward goals requires a notion of similarity between images. While prior methods have utilized latent variable models (Watter et al., 2015; Nair et al., 2018), $\ell _ { 2 }$ pixel-space distance (Nair & Finn, 2020), and other heuristic measures of similarity (Ebert et al., 2018b), these metrics only capture visual similarity. To enable reliable control with predictive models, we instead need distances that are aware of dynamics.
|
| 20 |
+
|
| 21 |
+
In this paper, we propose Model-Based RL with Offline Learned Distances (MBOLD), which aims to address both of these challenges by learning predictive models together with image-based distance functions that reflect functionality, from offline, unlabeled data. The learned distance function estimates of the number of steps that the optimal policy would take to transition from one state to another, incorporating not just visual appearance, but also an understanding of dynamics. However, to learn dynamical distances from task-agnostic data, supervised regression will lead to overestimation, since the paths in the data are not all optimal for any task. Instead, we utilize approximate dynamic programming for distance estimation. While prior work has studied such methods to learn goal-conditioned policies in online model-free RL settings (Eysenbach et al., 2019; Florensa et al., 2019), we extend it to the offline setting and show that approximate dynamic programming techniques derived from Q-learning style Bellman updates can learn effective shortest path dynamical distances. Although this procedure resembles model-free reinforcement learning, we find empirically that it does not by itself produce useful policies. Instead, our method (Fig. 1) combines the strengths of dynamics models and distance functions, using the predictive model to plan over short horizons, and using the learned distances to provide a global cost that captures progress toward distant goals.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: The robot must find actions that quickly achieve the desired goal. State transitions and the true optimal distances between states are unknown, so our method learns an approximate shortest distance function and dynamics model directly on images. These models allow the robot to find the shortest path to the goal at test-time.
|
| 25 |
+
|
| 26 |
+
The primary contribution of this work is an offline, self-supervised approach for solving arbitrary goal-reaching tasks by combining planning with predictive models and learned dynamical distances. To our knowledge, our method is the first to directly combine predictive models on images with dynamical distance estimators on images, entirely from random, offline data without reward labels. Through our experimental evaluation on challenging robotic object manipulation tasks, including simulated object relocation and real-world drawer manipulation, we find that our method can outperform previously introduced reward specification methods for visual model-based control with a relative performance improvement of at least $50 \%$ across all tasks, and compares favorably to prior work in model-based and model-free RL. We also find that combining Q-functions with planning improves dramatically over policies directly learned with model-free RL.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Offline and Model-based RL: A number of prior works have studied the problem of learning behaviors from existing offline datasets. While recent progress has been made in applying model-free RL techniques to this problem of offline or batch RL (Fujimoto et al., 2019; Wu et al., 2019; Kumar et al., 2019; 2020; Nair et al., 2020b), one approach that has shown promise is offline model-based RL (Lowrey et al., 2019; Kidambi et al., 2020; Yu et al., 2020; Argenson & Dulac-Arnold, 2020), where the agent learns a predictive model of the world from data. Such model-based methods have seen success both in the offline and online RL settings, and have a rich history of being effective for planning (Deisenroth & Rasmussen, 2011; Watter et al., 2015; McAllister & Rasmussen, 2016; Chua et al., 2018; Amos et al., 2018; Hafner et al., 2019b; Nagabandi et al., 2018; Kahn et al., 2020; Dong et al., 2020) or policy optimization (Sutton, 1991; Weber et al., 2017; Ha & Schmidhuber, 2018; Janner et al., 2019; Wang & Ba, 2019; Hafner et al., 2019a). However, the vast majority of these prior works consider the single task setting where the agent aims to maximize a single task reward. In contrast, in this work we circumvent the need for task rewards by adopting a selfsupervised multi-task approach, where a single learned model is used to perform a variety of tasks, specified in a flexible and general way by desired outcomes – i.e., goal images.
|
| 31 |
+
|
| 32 |
+
Self-supervised goal reaching: While the standard RL problem involves optimizing for a taskspecific reward, an alternative and potentially more general formulation involves learning a generic goal reaching policy, without task-specific reward labels. In fact, a number of prior works learn goal-conditioned policies using model-free RL (Kaelbling, 1993; Nair et al., 2018; Mandlekar et al., 2019; Nair et al., 2020a), or variants of goal-conditioned behavioral cloning (GCBC) (Ghosh et al., 2019; Ding et al., 2019; Lynch et al., 2020). In our experiments, we show that our method outperforms both model-free approaches and goal-conditioned behavioral cloning. A number of methods combine model-free and model-based elements by planning over a graph representation (Eysenbach et al., 2019; Nasiriany et al., 2019; Savinov et al., 2018; Liu et al., 2020). Such methods can struggle in higher dimensions, where constructing graphs that adequately cover the space may require an excessive number of samples. We compare to these methods in our experiments. Similarly to Finn & Levine (2017); Ebert et al. (2018b); Nair & Finn (2020); Yen-Chen et al. (2019); Suh & Tedrake (2020), our method uses an action-conditioned video prediction model to generate plans. However, these prior methods generally utilize hand-crafted image similarity reward measures such as $\ell _ { 2 }$ pixel-error (Ebert et al., 2018a; Nair & Finn, 2020) and pixel-flow prediction (Finn & Levine, 2017). In complex scenes, this can become a major bottleneck: predictions degrade rapidly further in the future, making an informative image similarity metric critical for effective planning. We propose to learn functional similarity metrics in terms of dynamical distances, which we find can be combined with predictive models to attain significantly improved results.
|
| 33 |
+
|
| 34 |
+
Dynamical distance learning: Our method learns dynamical distances – distances that represent shortest paths – from offline data. In the literature, dynamical distances have been learned via direct regression using online data (Hartikainen et al., 2019), representation learning (Warde-Farley et al., 2018; Yu et al., 2019b), or via Q-learning by relabeling goals (Eysenbach et al., 2019; Florensa et al., 2019). While these last two works are most similar to ours, in that they also employ approximate dynamic programming to learn distances, our method directly combines these dynamical distances with visual predictive models and planning. Lastly, while prior work has also explored combining model-based planning with value functions (Zhong et al., 2013; Lowrey et al., 2019; Hafner et al., 2019a; Schrittwieser et al., 2019; Argenson & Dulac-Arnold, 2020), these works consider the single task domain with a reward function, while our learned value function considers the multi-task goal reaching domain from entirely random, offline data without reward labels.
|
| 35 |
+
|
| 36 |
+
# 3 THE SELF-SUPERVISED OFFLINE RL PROBLEM STATEMENT
|
| 37 |
+
|
| 38 |
+
In this section, we introduce notation and define the problem setting. We will employ a Markov decision process (MDP) with state observations $s _ { t } \in S$ and actions $a _ { t } \in \mathcal A$ , both indexed by time $t \in { 0 , 1 , \cdots , H }$ , where $H$ denotes the maximum episode length. The initial state is sampled from an initial state distribution $s _ { 0 } \sim p _ { 0 } ( s _ { 0 } )$ , and subsequent states are sampled according to Markovian dynamics: $s _ { t + 1 } \sim p ( s _ { t + 1 } \mid s _ { t } , a _ { t } ) $ . Actions are sampled $a _ { t } \sim \pi ( a _ { t } \ \bar { | } \ s _ { t } , s _ { g } )$ from a policy that is conditioned on both the current state and a goal state $s _ { g } \in \mathcal S$ . In our experiments, both the state and goal are images (i.e., $\mathcal { S } = \mathbb { R } ^ { H \times W \times 3 } )$ ).
|
| 39 |
+
|
| 40 |
+
We tackle offline learning in this setting, assuming access to a fixed dataset $\mathcal { D }$ consisting of trajectories $\left\{ s _ { 0 } , a _ { 0 } , s _ { 1 } , . . . s _ { T } \right\}$ of the agent interacting with the environment. This data can include any environment interactions, from expert demonstrations to trajectories which are not particularly successful at any task. In our experiments, we use data collected using a random policy, which is inexpensive to obtain. The agent does not have access to the environment to collect additional training data. Given this dataset, the objective is to determine the optimal goal-conditioned policy $\pi ^ { \star } ( a _ { t } \mid s _ { t } , s _ { g } )$ , under which the agent is able to transition to any goal state $s _ { g }$ from any starting state $s _ { t }$ in the minimum number of time steps possible. Note that unlike in the standard formulation of the RL problem, the agent does not receive any reward signal from its environment.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 2: Model-based visual goal reaching: (Left) During offline learning, we train an imagebased predictive model and distance function on the same random dataset. (Right) At test time, we use the learned distance model for MPC, plugging in the learned distance as a cost function.
|
| 44 |
+
|
| 45 |
+
# 4 MODEL-BASED VISUAL GOAL-REACHING
|
| 46 |
+
|
| 47 |
+
In this section we will introduce our method, MBOLD, for offline, goal-conditioned reinforcement learning. MBOLD, illustrated in Fig. 2, is composed of two neural networks: a predictive model and a learned distance function. The video-predictive dynamics model allows the agent to predict the result of hypothetical sequences of actions. However, this model cannot accurately predict far into the future, and has no notion of whether the predicted outcomes are desirable. Thus, we also learn a distance function, corresponding to a value function with a self-supervised goal-reaching reward, which will estimate the timestep length of the shortest path between a predicted state and a given goal. Both networks are trained on the same offline dataset.
|
| 48 |
+
|
| 49 |
+
At test-time, we use the learned dynamics model and distance function for model-predictive control (MPC). MBOLD predicts future states for candidate action sequences using the learned dynamics model, and uses the learned distance function to determine which action sequence will lead the agent closest to the goal. The first of the actions is then executed, and planning repeats upon receiving the subsequent observation from the environment. The remainder of this section describes how we learn the dynamics model and distance function, and use them to perform control.
|
| 50 |
+
|
| 51 |
+
Dynamics learning. Our method learns environment dynamics in order to solve for actions during test time, without an explicit task reward signal during training. MBOLD can use arbitrary imagebased forward models, including latent variable models (Hafner et al., 2019b; Lee et al., 2019). The particular choice of model is a design decision when implementing our method. In our implementation, we use a convolutional video prediction model adapted from SAVP (Lee et al., 2018). The network takes as input the current observation $s _ { t }$ and a sequence of $h$ actions $\scriptstyle a _ { t : t + h - 1 }$ and returns a prediction for the next $h$ image observations, $\hat { f } _ { \theta } ( s _ { t } , a _ { t : t + h - 1 } ) = \{ \hat { s } _ { t + 1 } , \dots , \hat { s } _ { t + h } \}$ . We train this model to minimize the $\ell _ { 2 }$ image reconstruction loss:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { \mathcal { D } } \left[ \frac { 1 } { h } \sum _ { t ^ { \prime } = t } ^ { t + h } \| \hat { f } _ { \theta } ( s _ { t } , a _ { t : t + h - 1 } ) [ t ^ { \prime } - t ] - s _ { t ^ { \prime } } \| ^ { 2 } \right] .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Distance learning. Our method also learns a dynamical distance function, so that it can evaluate a functional notion of distance from the predicted states to the goal state, for use as a planning cost. However, the environment does not provide a reward signal that might be used to deduce these distances. Indeed, the offline dataset is typically composed of highly suboptimal trajectories, so our method may not even have access to examples of shortest path trajectories between states. Our key observation is that a goal-conditioned Q-function trained on a modified MDP with an indicator cost function yields values that correspond to shortest path distances in the original environment. Thus, Q-learning-like methods can recover optimal distance functions even from sub-optimal data.
|
| 58 |
+
|
| 59 |
+
We therefore formulate an MDP by augmenting environment trajectories with the reward function $r ( s _ { t } , a , s _ { t + 1 } , g ) = \mathbf { 1 } _ { \mathrm { s } _ { t + 1 } = \mathrm { s } _ { \mathrm { g } } }$ , adding a discount factor of $\gamma$ , and considering episodes terminated once they reach the goal state. Note that $s _ { t }$ , $s _ { t + 1 }$ , and $g$ all represent images, and the reward is only given when the next state and goal images exactly match. During training, goals are sampled according to a distribution on $s$ , which we will discuss later. If $\gamma < 1$ , the Q-values for a policy that maximizes expected discounted returns in this MDP can be directly mapped to shortest path distances. Specifically, in discrete state environments, the optimal $\mathbf { Q }$ -function can be written as $Q ( s , a , g ) = \gamma ^ { d ( s , a , g ) }$ , where $d ( s , a , g )$ is a shortest path distance between $s$ and $g$ after taking action $a$ . Similarly, we can recover $d ( s , a , g ) = \log _ { \gamma } Q ( s , a , g )$ . Ultimately, our Q-learning approach corresponds to the following Bellman error optimization objective:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\operatorname* { m i n } _ { \phi } \mathbb { E } _ { s _ { t } , a _ { t } , s _ { t + 1 } \sim \mathcal { D } , g \sim \mathcal { S } } \left[ Q _ { \phi } ( s _ { t } , a _ { t } , g ) - ( { \bf 1 } _ { s _ { t + 1 } = g } + \gamma { \bf 1 } _ { s _ { t + 1 } \neq g } \operatorname* { m a x } _ { a _ { t + 1 } } Q _ { \phi } ( s _ { t + 1 } , a _ { t + 1 } , g ) ) \right] ^ { 2 } .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
In practice, we use a deep network to represent the $\mathrm { Q }$ -function. During training, we sample transitions $( s _ { t } , a _ { t } , s _ { t + 1 } , g )$ to optimize the objective in Equation 2. The first three components $( s _ { t } , a _ { t } , s _ { t + 1 } )$ can be sampled randomly from the dataset. However, trajectories in the offline dataset may not be directed towards any particular goals, so a key challenge lies in selecting which goals $g$ to choose. The next section describes our approach to sampling these goals.
|
| 66 |
+
|
| 67 |
+
Selecting goals for relabeling transitions. Na¨ıvely choosing $g$ , say by sampling random states uniformly from the dataset, will provide an extremely sparse reward signal, as two random state images will almost never be exactly identical. The sparse reward problem can be mitigated by selectively sampling as goals the states that were actually reached in future time steps along the same trajectory as $s _ { t }$ (Kaelbling, 1993; Andrychowicz et al., 2017). More precisely, to sample goals for a transition at time step $t$ , we sample a discrete time offset $\Delta \sim \mathrm { G e o m } ( p )$ , where $p \in [ 0 , 1 ]$ is a hyper-parameter, and use the state at time $t + \Delta$ as the goal. Note that if $\Delta = 1$ , the reward for this transition is 1, avoiding the sparsity issue.
|
| 68 |
+
|
| 69 |
+
However, relabeling all transitions in this way creates a major issue: since the distance function would only be trained on goals that were actually reached, it would systematically underestimate the distance to unreachable goals. Put another way, goals that were not reached from $s _ { t }$ would be out-of-distribution goals for the resulting Q-function. We found this to result in poor performance. In practice, prior work (Kaelbling, 1993; Andrychowicz et al., 2017) actually relabels with a mixture of reached goals and commanded but not necessarily reached goals.
|
| 70 |
+
|
| 71 |
+
These prior methods can obtain such “negative” goals based on the goals that were commanded during online data collection. This is impossible in our setting, since our offline data may not even have been collected with a goal-directed policy. We therefore need a procedure to select such “negative” goals that are distant yet relevant. Randomly selecting dataset states will lead to pairs of images that are clearly distant with high probability (e.g., pairs in which all objects and the robot have been moved), but not necessarily relevant. We would like a goal sampling procedure that produces less obvious examples of distant states, which are more informative for training. Hard negative mining is one example of such a procedure, where pairs are selected based on the model’s predictions, but is computationally expensive with large datasets.
|
| 72 |
+
|
| 73 |
+
Instead, we build upon the intuition that distance functions are likely to pay excessive attention to fully actuated factors in the state, such as the position of the robot’s arm, because they are strongly predictive of distances. We propose sampling “negative” goal states $g$ which have similar actuated components to reached states. When randomly sampling pairs of states under this constraint, the underactuated dimensions (e.g. the objects), which are generally not known, are likely to have distinct positions. Hence, these data points can serve as informative hard negatives that encourage the model to pay more attention to the difficult, underactuated parts of the state. Unlike hard negative mining, this sampling approach is computationally inexpensive, as it does not rely on the current distance function, and practical, as actuated components of the state can typically be measured through encoders on the actuator. In practice, we sample these “negative” goals from observations across all dataset trajectories via nearest-neighbors search, using arm joint $\ell _ { 2 }$ distance as the similarity key. Note that this does assume proprioceptive state information from the agent (e.g. robot joint angles), which is almost always available in real-world robotics settings, but does not require knowledge about object positions or other ground-truth environment information. While we use actuator information for generating training examples, the distance function and dynamics model use only image observations and actions as inputs. See Appendix A.1 for details.
|
| 74 |
+
|
| 75 |
+
Control via MBOLD. At test-time, the learned distance function and dynamics model are used together to solve control tasks via MPC. In other words, the dynamics model predicts how candidate actions will affect the environment, and the distance model rates predicted sequences based on which bring the agent closest to the user-defined goal state. This mechanism works as follows: given the current state $s _ { t }$ , goal state $s _ { g }$ , candidate actions $a _ { t : t + h - 1 }$ , and predicted future states $\hat { f } _ { \theta } \big ( s _ { t } , a _ { t : t + h - 1 } \big )$ from the learned dynamics model, the learned distance function calculates
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 3: Comparative evaluation results: (Left) Example initial states and task definitions for Sawyer object pushing and Franka door sliding simulated environments, as well as the real-world drawer closing task. Note that “hard” tasks require the arm to take detours from moving to the final arm position in order to relocate the object. Arrows indicate successful trajectories. (Right) MBOLD is consistently able to outperform prior methods on these harder manipulation tasks, and by a larger margin on the most difficult tasks (“hard” variants of object pushing and door sliding). Error bars show standard deviations over 5 seeds.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
V ( a _ { t : t + h - 1 } ) = \operatorname* { m a x } _ { \alpha } Q _ { \phi } ( \hat { f } _ { \theta } ( s _ { t } , a _ { t : t + h - 1 } ) [ t + h ] , \alpha , s _ { g } ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
In practice, the maximization over $\alpha$ is performed by an actor network learned simultaneously with the Q-function. $V \big ( a _ { t : t + h - 1 } \big )$ acts as an objective function for MPC. Plainly, the controller’s goal is to find candidate actions $a _ { t : t + h - 1 }$ which minimize the dynamical distance to the goal $h$ steps into the future. After this process completes, the best action is executed by the agent. Note that this controller re-plans after every action taken in the environment (i.e every timestep), in order to prevent errors in dynamics prediction from compounding.
|
| 85 |
+
|
| 86 |
+
MPC Algorithm. MBOLD uses the CEM algorithm (De Boer et al., 2005) to optimize the objective in Equation 3. It begins by sampling $N$ random trajectories from a prior multi-variate Gaussian distribution. Then, the top $K$ actions which score highest according to $V \big ( a _ { t : t + h - 1 } \big )$ are selected as candidates. A new Gaussian distribution is fit on these candidates, and the loop starts over again by sampling fresh actions from this distribution. After $I$ iterations, the loop finishes and returns the best action found so far. See Appendix A.2 for full CEM implementation details.
|
| 87 |
+
|
| 88 |
+
# 5 EXPERIMENTS
|
| 89 |
+
|
| 90 |
+
Our experiments aim to answer three questions: (1) How does MBOLD compare to prior modelbased and model-free methods when learning to reach goals from task-agnostic offline data? (2) Can our method perform visual robotic manipulation in real-world settings? (3) How do different dynamical distance learning methods compare to MBOLD in terms of providing effective distance functions for planning?
|
| 91 |
+
|
| 92 |
+
We first evaluate our method, prior methods, and baselines on three simulated tasks with visual observations: (1) a simple reaching task that requires moving a Sawyer 7-DoF arm to a goal location, which provides a way to validate implementations of all methods, (2) object pushing, in which a Sawyer arm must relocate an object to a particular goal location, in environments with 1 or 3 objects, and (3) door sliding, which requires repositioning a sliding door with a Franka 7-DoF arm. These tasks are challenging because they require long-horizon planning without access to intermediate rewards.
|
| 93 |
+
|
| 94 |
+
For each task, we define the action space $\mathcal { A }$ such that actions control the Cartesian position of the robot’s end-effector, as well as the robot’s gripper. We randomly generate a set of 100 test goals, consisting of a goal image and starting state, for each task, on which all methods are tested. A trial is considered successful if the final distance to the goal of each relevant object, e.g. slide position for the door sliding task, ends below a given threshold. For the object relocation task, we evaluate each method on two scenes, containing one and three objects. All evaluation goals require the robot to move one of the objects, with the others serving as distractors. We also study two levels of difficulty: “regular,” where goals are generated from random trajectories in which the object moves a certain minimum distance, and “hard,” where the arm is additionally enforced to be distant from the object in the goal observation, requiring the robot to push the object and then withdraw the arm. We depict the tasks in Fig. 3 (left) and provide full experimental details in Appendix A.3.
|
| 95 |
+
|
| 96 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MBOLD(ours)</td><td rowspan=1 colspan=1>Visual Foresight(l2 pixel error)</td></tr><tr><td rowspan=1 colspan=1>Drawer openDrawer close</td><td rowspan=1 colspan=1>8/107/10</td><td rowspan=1 colspan=1>5/100/10</td></tr></table>
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 4: Real-world robot evaluation: (Left) Third-person view of an example task setting and (Right) results. Success rates are computed using 10 trials for each task. Each task is specified by a goal image, and as in previous experiments, the same trained models are used across tasks. Task success is determined by the final position of the drawer only.
|
| 100 |
+
|
| 101 |
+
For all tasks, we generate an offline dataset by running random policies for 1e4 episodes of 30 timesteps each. We provide only this offline dataset to all methods, with no online training. At test time, the agent only receives the goal image and current observation at each step, and no intermediate rewards besides those that it computes itself.
|
| 102 |
+
|
| 103 |
+
Comparative evaluation. We compare MBOLD to prior work in model-based and model-free RL. As MBOLD uses purely offline data and does not require rewards from the environment, we make modifications to these methods where necessary to provide a fair comparison. Many of these prior methods (though not all) require the environment to provide a ground truth reward signal. In this case, we provide these methods with simple “uninformative” rewards, following prior work (Nair et al., 2018), which consist of the MSE between the current and goal image. Many of these methods were initially presented in the online setting. The offline setting is harder for RL methods (Fujimoto et al., 2019; Wu et al., 2019; Kumar et al., 2019), partially explaining their poor performance.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 5: Comparisons on the simple reaching task, where most methods attain good performance.
|
| 107 |
+
|
| 108 |
+
See Appendix B for details on all baselines. We compare MBOLD to the following methods:
|
| 109 |
+
|
| 110 |
+
• Reinforcement Learning with Imagined Goals (RIG) (Nair et al., 2018): RIG is a model-free RL method for visual goal-reaching. Unlike the other methods, we still allow RIG to collect additional online data to train its policy. Dreamer (Hafner et al., 2019a): Dreamer, a model-based method for image-based tasks, also uses a combination of value functions and planning, but uses online data collection and, crucially, ground truth reward signals. We adapt Dreamer for the offline, reward-free setting. Dreamer $\ell _ { 2 }$ arm distance: We additionally compare with an “oracle” version of Dreamer that uses privileged information about the ground-truth position of the arm.
|
| 111 |
+
• Search on the Replay Buffer (SoRB) (Eysenbach et al., 2019): SoRB performs planning on a graph constructed using learned distances, learned without a reward function.
|
| 112 |
+
• Goal-Conditioned Behavior Cloning: We train a behavior cloning model using goals sampled from observations achieved further in a given trajectory. This can be viewed as an offline variant of GCSL (Ghosh et al., 2019) or a non-recurrent version of Lynch et al. (2020).
|
| 113 |
+
• Visual Foresight (Ebert et al., 2018b): Visual Foresight also plans with an action-conditioned video prediction model, but uses (among other choices) $\ell _ { 2 }$ pixel error as a cost function.
|
| 114 |
+
|
| 115 |
+
Since all methods are trained from offline data with no additional environment interaction, we present final performance on the test goals as a bar graph, rather than learning curves. The comparison on the simple reaching task is shown in Figure 5, and suggests that on this task, many of the methods perform quite well. However, on the substantially more complex tasks, shown in Figure 3, we see clearer differentiation between the different algorithms. On harder object pushing tasks, MBOLD attains the best performance, by a considerable margin. Interestingly, simple goalconditioned behavioral cloning actually represents one of the strongest baselines on this task. On the hardest simulated door sliding task, our method attains the best performance by a large margin.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 6: Heatmap visualizations of our distance functions. Each pixel in every heatmap represents the distance between a generated starting image containing the object at that $( x , y )$ coordinate and the fixed goal image (pictured on left). All three distance functions show a minimum when the object position is near the goal position of $( 0 . 1 , - 0 . 0 5 )$ . However, our Q-function produces a better-shaped signal than the direct regression model, and avoids occlusion errors - like the local minimum at high $_ y$ -values, which plague pixel-wise MSE.
|
| 119 |
+
|
| 120 |
+
Real-world evaluation. We additionally evaluate MBOLD in a real-world drawer manipulation task using a 7-DoF Franka arm. We train the dynamics model and distance function on a preexisting dataset of 1000 trajectories collected by a weakly supervised batch exploration algorithm in prior work (Chen et al., 2020). As shown in Figure 4, MBOLD outperforms visual foresight on both manipulation tasks with visual inputs, particularly on drawer closing, for which simply matching the arm position in the goal image does not solve the task. The success of our method in this domain highlights that our method can be applied to offline datasets collected using different exploration strategies. While MBOLD performs well on manipulation tasks even with complex real-world visuals, we find that the negative sampling procedure we adopt limits precision in matching highly actuated components such as the arm position. We perform additional analysis through simulated experiments detailed in Appendix E.1. Videos of both simulated and real-world task execution can be found at the project website: https://sites.google.com/berkeley.edu/mbold.
|
| 121 |
+
|
| 122 |
+
Qualitative analysis. In this section, we examine the distance functions learned by MBOLD, and show qualitatively that our learned distances better model the dependence of functional separation between two states on the relative positions of objects in their scenes. Figure 6 presents heatmaps of predicted distances for a fixed goal image on the object pushing task, as the initial observation is varied based on object position. The robot arm is set to the same position in each initial image. We see that the Qfunction is able to learn a relatively well-shaped distance which accounts for the object position.
|
| 123 |
+
|
| 124 |
+
We additionally visualize baseline distance models for comparison. First, we look at an ablation of our distance model, which is trained via re
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 7: Our learned distance function yields higher success rates than alternative approaches from prior work, such as the $\ell _ { 2 }$ distance of a VAE latent space (Nair et al., 2018) and temporal distance regression (Hartikainen et al., 2019). We also see consistent improvements from using negative transition mining, especially on “hard” tasks.
|
| 128 |
+
|
| 129 |
+
gression to map pairs of states randomly sampled from a given dataset trajectory to the number of timesteps separating them in that trajectory, and can be viewed as an offline variant of DDL (Hartikainen et al., 2019). We call this scheme that effectively predicts random walk distances “temporal distance regression.” The second baseline we compare to is pixel-wise mean-squared error.
|
| 130 |
+
|
| 131 |
+
We find that the temporal distance regression model produces more sharply peaked distances than the Q-function, and performed worse as a reward signal during planning, as we find through our ablation experiments. The pixel-wise MSE metric produces low distances near the goal object position, but is impacted by occlusions of the objects as well as the position of the visually pronounced arm. While this analysis does not necessarily directly correspond to control performance, as it ignores the movement of the robot, it demonstrates that our learned distances are aware of the functional similarity of nearby object positions, despite the fact that they are learned entirely from images with actions corresponding to the movement of the arm, not the object.
|
| 132 |
+
|
| 133 |
+
Ablations. Our ablation studies aim to answer three questions: (1) How does Q-learning for learning dynamical distances compare to alternative distance metrics, such as distance in the latent space of a VAE, or dynamical distances learned using direct regression on temporal distances found in random data? (2) How important is mining negative transitions to the performance of our method? (3) How beneficial is it to combine the learned distance function with planning through a predictive model, as compared to directly acting using the learned policy, as in standard model-free offline RL?
|
| 134 |
+
|
| 135 |
+
To answer the first two questions, we perform experiments in the object pushing domain. We evaluate alternative distance metrics for visual planning, by duplicating the planning setup, using the same dynamics model, and only modifying the metric used for scoring candidate trajectories. The first distance we consider is Euclidean distance in the latent space of a VAE, that is, $d ( s , g ) = \lVert e ( s ) - e ( g ) \rVert _ { 2 }$ , where $e$ is a learned encoder, which resembles the reward function used in prior work on image-based goal reaching (Nair et al., 2018). The second is the direct temporal distance regression model described previously. As shown in Figure 7, Q-function distances outperform alternative distances on all of the object pushing tasks. While the temporal distance regression scheme provides competitive performance in some settings, it often provides overestimates of distances between states rather than shortest paths, as shown qualitatively in Figure 6.
|
| 136 |
+
|
| 137 |
+
We also find that the negative transition mining scheme also consistently improves performance, and is particularly important for the “hard” tasks. We hypothesize this is because augmenting the training data in this way causes learned distance functions to better take into account the positions of objects in the scene, rather than just visually prominent components such as arm position.
|
| 138 |
+
|
| 139 |
+
Table 1: Comparison of success rates $\pm$ standard deviation across 5 random training seeds for our method, which combines Q-functions and planning with a model, to a baseline that uses the Q-function to choose actions directly without planning.
|
| 140 |
+
|
| 141 |
+
To address the third question, we compare our method, which uses learned distances for planning, to the policy discovered when performing Q-learning to learn dynamical distances. As shown in Table 1, the policy learned directly
|
| 142 |
+
|
| 143 |
+
<table><tr><td></td><td>Q-function + planning</td><td>Q-function only</td></tr><tr><td>1 object push 3 object push Reach</td><td>55.2± 4.3% 44.8± 2.9% 94.4 ± 3.3%</td><td>19.2 ±3.6% 15.6 ± 3.6% 31.8± 5.2%</td></tr></table>
|
| 144 |
+
|
| 145 |
+
from offline RL alone is greatly outperformed by MBOLD. We hypothesize that this is due to challenges in advantage learning from offline data with extremely sparse rewards.
|
| 146 |
+
|
| 147 |
+
# 6 CONCLUSION
|
| 148 |
+
|
| 149 |
+
We presented a self-supervised approach to tackling goal-reaching tasks, which learns to reach unseen visual goals given only an offline, random dataset without reward labels. Our method combines the strengths of predictive models and learned dynamical distances, where a predictive model can provide effective predictions for planning actions over short horizons, while dynamical distances can provide a useful planning cost that captures distance to goals over longer horizons. By performing visual model predictive control with a learned visual dynamics model and a goal conditioned Q-function as the planning cost, we find that our method is able to perform goal reaching tasks more effectively than model-based planning approaches that utilize other reward specification techniques, as well as purely model-free methods. We show that MBOLD can also scale to real-world manipulation settings and learn from offline datasets collected with various exploration strategies, outperforming visual foresight on a drawer manipulation task. By leveraging offline data collected without a specific goal in mind, our method may make it possible to utilize large, unstructured, openworld robotic manipulation datasets. Scaling up this method to more complex real-world systems and large data sources therefore represents a particularly exciting direction for future work, which may broaden the capabilities and generality of robotic systems.
|
| 150 |
+
|
| 151 |
+
Acknowledgements. We thank students from the Robotic AI and Learning Lab for insightful feedback on earlier drafts of this paper and Aurick Zhou and Danijar Hafner for helpful discussions. This work was supported in part by Schmidt Futures, the Fannie and John Hertz Foundation, the Office of Naval Research (grants N00014-20-1-2675, N00014-16-1-2420, & N00014-19-1-2042), and the National Science Foundation (DGE-1745016 and through an NSF GRFP (GRFP 2018259676)). This research used the Savio computational cluster resource provided by the Berkeley Research Computing program at the University of California, Berkeley.
|
| 152 |
+
|
| 153 |
+
# REFERENCES
|
| 154 |
+
|
| 155 |
+
Brandon Amos, Laurent Dinh, Serkan Cabi, Thomas Rothorl, Sergio G ¨ omez Colmenarejo, Alistair ´ Muldal, Tom Erez, Yuval Tassa, Nando de Freitas, and Misha Denil. Learning awareness models, 2018.
|
| 156 |
+
|
| 157 |
+
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.
|
| 158 |
+
|
| 159 |
+
Arthur Argenson and Gabriel Dulac-Arnold. Model-based offline planning. arXiv preprint arXiv:2008.05556, 2020.
|
| 160 |
+
|
| 161 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017.
|
| 162 |
+
|
| 163 |
+
Matthew Botvinick and Ari Weinstein. Model-based hierarchical reinforcement learning and human action control. Philosophical Transactions of the Royal Society B: Biological Sciences, 369 (1655):20130480, 2014.
|
| 164 |
+
|
| 165 |
+
Annie S. Chen, HyunJi Nam, Suraj Nair, and Chelsea Finn. Batch exploration with examples for scalable robotic reinforcement learning, 2020.
|
| 166 |
+
|
| 167 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4754–4765, 2018.
|
| 168 |
+
|
| 169 |
+
Pieter-Tjerk De Boer, Dirk P Kroese, Shie Mannor, and Reuven Y Rubinstein. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19–67, 2005.
|
| 170 |
+
|
| 171 |
+
M. Deisenroth and C. Rasmussen. Pilco: A model-based and data-efficient approach to policy search. In ICML, 2011.
|
| 172 |
+
|
| 173 |
+
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.
|
| 174 |
+
|
| 175 |
+
Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. arXiv preprint arXiv:1802.07687, 2018.
|
| 176 |
+
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
Yiming Ding, Carlos Florensa, Pieter Abbeel, and Mariano Phielipp. Goal-conditioned imitation learning. In Advances in Neural Information Processing Systems, pp. 15324–15335, 2019.
|
| 180 |
+
|
| 181 |
+
Kefan Dong, Yuping Luo, Tianhe Yu, Chelsea Finn, and Tengyu Ma. On the expressivity of neural networks for deep reinforcement learning. In International Conference on Machine Learning, pp. 2627–2637. PMLR, 2020.
|
| 182 |
+
|
| 183 |
+
Frederik Ebert, Sudeep Dasari, Alex X. Lee, S. Levine, and Chelsea Finn. Robustness via retrying: Closed-loop robotic manipulation with self-supervised learning. In Conference on Robot Learning, 2018a.
|
| 184 |
+
|
| 185 |
+
Frederik Ebert, Chelsea Finn, Sudeep Dasari, Annie Xie, Alex Lee, and Sergey Levine. Visual foresight: Model-based deep reinforcement learning for vision-based robotic control. arXiv preprint arXiv:1812.00568, 2018b.
|
| 186 |
+
|
| 187 |
+
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.
|
| 188 |
+
|
| 189 |
+
Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 2786–2793. IEEE, 2017.
|
| 190 |
+
|
| 191 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pp. 64–72, 2016.
|
| 192 |
+
|
| 193 |
+
Carlos Florensa, Jonas Degrave, Nicolas Heess, Jost Tobias Springenberg, and Martin Riedmiller. Self-supervised learning of image embedding for continuous control, 2019.
|
| 194 |
+
|
| 195 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning, pp. 1582–1591, 2018.
|
| 196 |
+
|
| 197 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062, 2019.
|
| 198 |
+
|
| 199 |
+
Dibya Ghosh, Abhishek Gupta, Ashwin Reddy, Justin Fu, Coline Devin, Benjamin Eysenbach, and Sergey Levine. Learning to reach goals via iterated supervised learning, 2019.
|
| 200 |
+
|
| 201 |
+
David Ha and Jurgen Schmidhuber. World models, 2018. ¨
|
| 202 |
+
|
| 203 |
+
Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. arXiv preprint arXiv:1912.01603, 2019a.
|
| 204 |
+
|
| 205 |
+
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, 2019b.
|
| 206 |
+
|
| 207 |
+
Kristian Hartikainen, Xinyang Geng, Tuomas Haarnoja, and Sergey Levine. Dynamical distance learning for semi-supervised and unsupervised skill discovery. In International Conference on Learning Representations, 2019.
|
| 208 |
+
|
| 209 |
+
Michael Janner, Justin Fu, Marvin Zhang, and Sergey Levine. When to trust your model: Modelbased policy optimization. In Advances in Neural Information Processing Systems, pp. 12519– 12530, 2019.
|
| 210 |
+
|
| 211 |
+
Jeff Johnson, Matthijs Douze, and Herve J ´ egou. Billion-scale similarity search with gpus. ´ arXiv preprint arXiv:1702.08734, 2017.
|
| 212 |
+
|
| 213 |
+
Leslie Pack Kaelbling. Learning to achieve goals. In IN PROC. OF IJCAI-93, pp. 1094–1098. Morgan Kaufmann, 1993.
|
| 214 |
+
|
| 215 |
+
Gregory Kahn, Pieter Abbeel, and Sergey Levine. Badgr: An autonomous self-supervised learningbased navigation system. arXiv preprint arXiv:2002.05700, 2020.
|
| 216 |
+
|
| 217 |
+
Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, and Thorsten Joachims. Morel: Modelbased offline reinforcement learning. In Advances in neural information processing systems, 2020.
|
| 218 |
+
|
| 219 |
+
Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, pp. 11784–11794, 2019.
|
| 220 |
+
|
| 221 |
+
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 222 |
+
|
| 223 |
+
Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
|
| 224 |
+
|
| 225 |
+
Alex X. Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model, 2019.
|
| 226 |
+
|
| 227 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 228 |
+
|
| 229 |
+
Kara Liu, Thanard Kurutach, Christine Tung, Pieter Abbeel, and Aviv Tamar. Hallucinative topological memory for zero-shot visual planning. 2020.
|
| 230 |
+
|
| 231 |
+
Kendall Lowrey, Aravind Rajeswaran, Sham Kakade, Emanuel Todorov, and Igor Mordatch. Plan Online, Learn Offline: Efficient Learning and Exploration via Model-Based Control. In International Conference on Learning Representations (ICLR), 2019.
|
| 232 |
+
|
| 233 |
+
Corey Lynch, Mohi Khansari, Ted Xiao, Vikash Kumar, Jonathan Tompson, Sergey Levine, and Pierre Sermanet. Learning latent plans from play. In Conference on Robot Learning, pp. 1113– 1132, 2020.
|
| 234 |
+
|
| 235 |
+
Ajay Mandlekar, Fabio Ramos, Byron Boots, Li Fei-Fei, Animesh Garg, and Dieter Fox. Iris: Implicit reinforcement without interaction at scale for learning control from offline robot manipulation data. arXiv preprint arXiv:1911.05321, 2019.
|
| 236 |
+
|
| 237 |
+
Rowan McAllister and C. Rasmussen. Improving pilco with bayesian neural network dynamics models. 2016.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Anusha Nagabandi, Kurt Konolige, Sergey Levine, and Vikash Kumar. Deep dynamics models for learning dexterous manipulation. In Conference on Robot Learning, pp. 1101–1112, 2020.
|
| 242 |
+
|
| 243 |
+
Ashvin Nair, Shikhar Bahl, Alexander Khazatsky, Vitchyr Pong, Glen Berseth, and Sergey Levine. Contextual imagined goals for self-supervised robotic learning. In Conference on Robot Learning, pp. 530–539, 2020a.
|
| 244 |
+
|
| 245 |
+
Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. arXiv preprint arXiv:2006.09359, 2020b.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Suraj Nair and Chelsea Finn. Hierarchical foresight: Self-supervised learning of long-horizon tasks via visual subgoal generation. In International Conference on Learning Representations (ICLR), 2020.
|
| 250 |
+
|
| 251 |
+
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.
|
| 252 |
+
|
| 253 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
|
| 254 |
+
|
| 255 |
+
Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference on Learning Representations (ICLR), 2018.
|
| 256 |
+
|
| 257 |
+
Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, Timothy Lillicrap, and David Silver. Mastering atari, go, chess and shogi by planning with a learned model, 2019.
|
| 258 |
+
|
| 259 |
+
H. J. Terry Suh and Russ Tedrake. The surprising effectiveness of linear models for visual foresight in object pile manipulation, 2020.
|
| 260 |
+
|
| 261 |
+
Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160–163, 1991.
|
| 262 |
+
|
| 263 |
+
Tingwu Wang and Jimmy Ba. Exploring model-based planning with policy networks, 2019.
|
| 264 |
+
|
| 265 |
+
David Warde-Farley, Tom Van de Wiele, Tejas Kulkarni, Catalin Ionescu, Steven Hansen, and Volodymyr Mnih. Unsupervised control through non-parametric discriminative rewards, 2018.
|
| 266 |
+
|
| 267 |
+
Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in neural information processing systems, pp. 2746–2754, 2015.
|
| 268 |
+
|
| 269 |
+
Theophane Weber, S ´ ebastien Racani ´ ere, David P. Reichert, Lars Buesing, Arthur Guez, \` Danilo Jimenez Rezende, Adria Puigdomenech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, \` Razvan Pascanu, Peter Battaglia, Demis Hassabis, David Silver, and Daan Wierstra. Imaginationaugmented agents for deep reinforcement learning, 2017.
|
| 270 |
+
|
| 271 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
|
| 272 |
+
|
| 273 |
+
Lin Yen-Chen, Maria Bauza, and Phillip Isola. Experience-embedded visual foresight. In Conference on Robot Learning, 2019.
|
| 274 |
+
|
| 275 |
+
Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on Robot Learning (CoRL), 2019a. URL https://arxiv.org/abs/1910. 10897.
|
| 276 |
+
|
| 277 |
+
Tianhe Yu, Gleb Shevchuk, Dorsa Sadigh, and Chelsea Finn. Unsupervised visuomotor control through distributional planning networks. Robotics: Science and Systems XV, Jun 2019b. doi: 10.15607/rss.2019.xv.020. URL http://dx.doi.org/10.15607/RSS.2019.XV.020.
|
| 278 |
+
|
| 279 |
+
Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization. In Advances in neural information processing systems, 2020.
|
| 280 |
+
|
| 281 |
+
Mingyuan Zhong, Mikala Johnson, Yuval Tassa, Tom Erez, and Emanuel Todorov. Value function approximation and model predictive control. In 2013 IEEE symposium on adaptive dynamic programming and reinforcement learning (ADPRL), pp. 100–107. IEEE, 2013.
|
| 282 |
+
|
| 283 |
+
# A MBOLD IMPLEMENTATION DETAILS
|
| 284 |
+
|
| 285 |
+
# A.1 DISTANCE FUNCTION
|
| 286 |
+
|
| 287 |
+
This section explains the implementation details for our distance function. Following prior work (Fujimoto et al., 2018), we learn two independent Q-functions and use the minimum for performing Bellman backups. Recall that we sampled goals from two distributions: future states in the same trajectories, and states from different trajectories where the robot arm was in a similar position. To implement the second strategy, we fit a $k$ -nearest neighbors graph on 200000 (about $6 0 \%$ of total) dataset observations, and use the $\ell _ { 2 }$ arm joint distance as the similarity key. Each batch contains equal numbers of transitions generated from each goal sampling method. For computational efficiency, we implement the $k$ -NN search using the GPU-enabled FAISS library (Johnson et al., 2017).
|
| 288 |
+
|
| 289 |
+
We relabel half of the transitions in each training batch with reached goals and the other half with “negative” goals with similar actuated components, finding through ablation experiments that this combination achieves stronger performance compared to using just reached goals in our evaluation environments. In other domains, more careful consideration is required to determine if the assumptions which motivate this “negative” goal sampling strategy are satisfied.
|
| 290 |
+
|
| 291 |
+
We also modify the reward specification scheme by providing a small positive reward at each step where the goal is not reached, and then a large positive reward upon reaching the goal. Specifically, we choose to give a reward of 1 by default and 10 when the goal is reached (compared to 0 and 1 respectively as presented in the discussion in Section 4), although we do not extensively tune this parameter. We find that it does not affect performance in a statistically significant way (results for each reward choice are within 1 standard deviation of one another) to choose this reward over the $( 0 , 1 )$ rewards. Note that this does not change the interpretation of the Q-function as a shortest path distance, merely slightly complicating the conversion calculations from Q-values to distances in timesteps.
|
| 292 |
+
|
| 293 |
+
Finally, we add an additional loss term to perform conservative Q-learning (CQL) (Kumar et al., 2020), a method for offline model-free RL, which penalizes Q-values of randomly selected actions and increases Q-values of in-dataset actions. We use the Lagrangian version of CQL to automatically tune the weighting term, and detail the parameters below. We find using CQL improves performance on the door sliding task from a mean success rate of $4 1 \%$ to $5 8 \%$ , but does not significantly impact performance on the others.
|
| 294 |
+
|
| 295 |
+
The Q-function network architecture consists of convolutional and fully connected layers. We define a network called the convolutional encoder, which will be used throughout the appendix. This takes as input an image of shape $6 4 \times 6 4 \times 6$ , containing the starting and goal images concatenated channelwise, and consists of 4 2D convolutional layers, with [8, 16, 32, 64] filters, respectively, with all with kernel size $( 4 , 4 )$ and strides of $( 2 , 2 )$ . We use Leaky ReLU activations after each intermediate convolutional layer, and batch-norm layers after the second and third Leaky ReLUs.
|
| 296 |
+
|
| 297 |
+
We flatten the output of the convolutional encoder, concatenate the inputted actions, and feed the features through 6 fully-connected linear layers of 128 units each, with the final layer outputting a single value. Each intermediate fully-connected layer is followed by a ReLU activation and a batch-norm layer.
|
| 298 |
+
|
| 299 |
+
The actor network architecture first contains the above “convolutional encoder”, whose outputs are flattened and input into a 10 layer MLP with 128 fully connected units each, and ReLU activations and batch-norm layers in between. The final output, of dimension 4, is passed through a tanh activation to constrain it to the normalized action space $[ - 1 , 1 ]$ .
|
| 300 |
+
|
| 301 |
+
Additional training hyperparameters are detailed in Table 2.
|
| 302 |
+
|
| 303 |
+
# A.2 MODEL-PREDICTIVE CONTROL
|
| 304 |
+
|
| 305 |
+
In Table 3, we describe the parameters for model-based planning in our experiments. These parameters are shared across all tasks and planning costs (in ablation experiments). Most values are selected based on prior work (Ebert et al., 2018b). We find that replanning every 6 steps produces slightly better performance than replanning every 13 steps, but not by a large margin, and we do not tune this further due to computation constraints. We sample actions using the filtering scheme described in Nagabandi et al. (2020) to make sequences smoother in time. We initialize sampling distributions using each environment’s data collection parameters, as shown in Table 4.
|
| 306 |
+
|
| 307 |
+
Table 2: Hyperparameters for distance learning
|
| 308 |
+
|
| 309 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>Dataset size</td><td rowspan=1 colspan=1>10000 trajectories</td></tr><tr><td rowspan=1 colspan=1>Train/test/val split</td><td rowspan=1 colspan=1>0.9/0.05/0.05</td></tr><tr><td rowspan=1 colspan=1>Trajectory length</td><td rowspan=1 colspan=1>30 steps</td></tr><tr><td rowspan=1 colspan=1>Observation dimensions</td><td rowspan=1 colspan=1>64×64×3</td></tr><tr><td rowspan=1 colspan=1>Stateobservations inkNN graph</td><td rowspan=1 colspan=1>200000</td></tr><tr><td rowspan=1 colspan=1>Goal relabeling sampling parameter (p)</td><td rowspan=1 colspan=1>0.3 (tuned over [0.2, 0.3])</td></tr><tr><td rowspan=1 colspan=1>Discount factor (y)</td><td rowspan=1 colspan=1>0.8</td></tr><tr><td rowspan=1 colspan=1>Learning rate</td><td rowspan=1 colspan=1>3e-4</td></tr><tr><td rowspan=1 colspan=1>Target network update Polyak factor</td><td rowspan=1 colspan=1>0.995</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=1>Actor network noise o</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>Actor network maximum noise magnitude</td><td rowspan=1 colspan=1>0.2</td></tr><tr><td rowspan=1 colspan=1>Training iterations</td><td rowspan=1 colspan=1>93750 (300 epochs)</td></tr><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=1>Adam</td></tr><tr><td rowspan=1 colspan=1>CQL Lagrange multiplier learning rate</td><td rowspan=1 colspan=1>1e-3</td></tr><tr><td rowspan=1 colspan=1>CQL slack parameter T (object pushing)</td><td rowspan=1 colspan=1>3.0</td></tr><tr><td rowspan=1 colspan=1>CQL slack parameter T (reaching)</td><td rowspan=1 colspan=1>3.0</td></tr><tr><td rowspan=1 colspan=1>CQL slack parameter 7 (door sliding)</td><td rowspan=1 colspan=1>10.0</td></tr><tr><td rowspan=1 colspan=1>CQL number of randomly selected actions</td><td rowspan=1 colspan=1>10</td></tr></table>
|
| 310 |
+
|
| 311 |
+
To compute the planning cost described in Equation 3, we maximize over $\alpha$ by feeding in the final predicted state to the policy network learned by TD3, and using the outputted action as the maximizer.
|
| 312 |
+
|
| 313 |
+
Table 3: Hyperparameters for model-based planning
|
| 314 |
+
|
| 315 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>Planning horizon (h)</td><td rowspan=1 colspan=1>13 steps</td></tr><tr><td rowspan=1 colspan=1>Actions executed per planning step (k)</td><td rowspan=1 colspan=1>6 actions</td></tr><tr><td rowspan=1 colspan=1>CEMIterations</td><td rowspan=1 colspan=1>3iterations</td></tr><tr><td rowspan=1 colspan=1>Elite sample fraction</td><td rowspan=1 colspan=1>0.05 (10 samples)</td></tr><tr><td rowspan=1 colspan=1>Samplesper CEMiteration</td><td rowspan=1 colspan=1>200 samples</td></tr></table>
|
| 316 |
+
|
| 317 |
+
# A.3 ENVIRONMENTS
|
| 318 |
+
|
| 319 |
+
The Sawyer environments are adapted from the Meta-World benchmark (Yu et al., 2019a), and the door sliding environment is based off of the environment presented by Lynch et al. (2020). For each task, we define the 4-dimensional action space $\mathcal { A }$ such that actions control the Cartesian position of the robot’s end-effector, as well as the robot’s gripper.
|
| 320 |
+
|
| 321 |
+
We randomly generate a set of 100 different test goals for each setting. Each task is defined by a goal image and starting state, on which all methods are tested. We define success for each task in terms of the final distance to the goal of each relevant object, e.g. object position for the object repositioning task. A trial is considered successful if the final distance is below a certain threshold $\epsilon$ manually chosen for each task, listed in the table below. We evaluate the success rate of each method over 5 different random training seeds.
|
| 322 |
+
|
| 323 |
+
We generate offline datasets for each task by running random policies for $1 e 4$ episodes of 30 timesteps each. In the beginning of each episode, object positions are reset uniformly randomly over the range of possible positions across each joint. The random policy actions are drawn using a filtering technique, which smooths random zero-mean Gaussian samples across time. We apply the
|
| 324 |
+
|
| 325 |
+
correlated noise scheme described by Nagabandi et al. (2020), setting the hyperparameter $\beta = 0 . 5$ .
|
| 326 |
+
The parameters of the multi-variate Gaussian samples in each dimension are listed in Table 4.
|
| 327 |
+
|
| 328 |
+
Table 4: Environment and task details
|
| 329 |
+
|
| 330 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Reaching</td><td rowspan=1 colspan=1>Object pushing</td><td rowspan=1 colspan=1>Door sliding</td></tr><tr><td rowspan=1 colspan=1>Data colln. stdev (diag(Σ))</td><td rowspan=1 colspan=1>[0.6, 0.6, 0.3, 0.3]</td><td rowspan=1 colspan=1>[0.6, 0.6, 0.3, 0.3]</td><td rowspan=1 colspan=1>[0.3, 0.3, 0.3, 0.15]</td></tr><tr><td rowspan=1 colspan=1>Object compared in success threshold</td><td rowspan=1 colspan=1>Arm end effector</td><td rowspan=1 colspan=1>Block</td><td rowspan=1 colspan=1>Slide</td></tr><tr><td rowspan=1 colspan=1>Success distance threshold</td><td rowspan=1 colspan=1>0.05m</td><td rowspan=1 colspan=1>0.05m</td><td rowspan=1 colspan=1>0.075m</td></tr></table>
|
| 331 |
+
|
| 332 |
+
# B COMPARATIVE EVALUATION IMPLEMENTATION DETAILS
|
| 333 |
+
|
| 334 |
+
B.1 REINFORCEMENT LEARNING WITH IMAGINED GOALS (NAIR ET AL., 2018)
|
| 335 |
+
|
| 336 |
+
In this section, we will discuss implementation details of our adaptation of Reinforcement Learning with Imagined Goals (RIG). We begin by training a $\beta$ -VAE with latent dimension 8. The VAE is trained on randomly sampled states from the entire offline dataset. For the loss, we use a combination of a maximum likelihood term and a KL divergence term which constrains the latent space to a unit Gaussian. In particular, we compute the mean pixel error, that is, $\frac { 1 } { H W } \| s - \hat { s } \| _ { 2 } ^ { 2 }$ , where $s$ is the original image, and $\hat { s }$ is the reconstruction, both normalized to be in $[ 0 , 1 ]$ . We add this to the KL divergence between the latent distribution and the unit Gaussian, with a weighting factor of $1 e ^ { - 3 }$ on the KL penalty.
|
| 337 |
+
|
| 338 |
+
The architecture of the VAE encoder consists of the “convolutional encoder” described in section A.1, whose features are passed through two FC layers with 128 units with a ReLU activation and batch-norm layer in between. The VAE decoder takes as input latent states into two FC layers with 128 units with a batch-norm layer and ReLU activation after each. This is followed by the inverted architecture of the encoder, consisting of transposed 2D convolutions.
|
| 339 |
+
|
| 340 |
+
Then, we perform model-free RL in a modified MDP, using encoded observations as a substitute for environment observations, and computing rewards as negative $\ell _ { 2 }$ distances in latent space. We sample random goals from the multivariate Gaussian prior $( \mathcal { N } ( 0 , I ) )$ at the beginning of every episode. We use the open-source implementation of soft actor-critic (SAC) in RLKit, and use the default SAC parameters and architecture found in the implementation, making the following modifications: We increase the number of layers of all MLP networks from 2 to 6. We use a maximum path length of 30 steps for consistency with our other experiments, and a discount factor of 0.95. Along with the goal sampled from the prior at the beginning of each episode, we find that relabeling goals with the achieved observation at the end of the trajectory improves performance, and add these transitions to the replay buffer as well. Note that unlike in the original RIG formulation, we do not update the weights of the learned VAE using data collected online. We evaluate the learned policy after 600 epochs of training, long after environment returns plateau.
|
| 341 |
+
|
| 342 |
+
# B.2 DREAMER (HAFNER ET AL., 2019A)
|
| 343 |
+
|
| 344 |
+
Dreamer, a model-based method for image-based tasks, also uses a combination of value functions and planning. We adapt Dreamer from its original single-task setting to learn a goal-conditioned policy, reward predictor, and value function; however, we do not condition the dynamics model on the goal. Dreamer has been previously demonstrated only in settings where the environment provides rewards to the agent, so we modify the method to learn from unlabeled, offline data by using experience replay. We find that using an indicator reward function as in our method or a heuristically defined reward function, image MSE, causes Dreamer to struggle to learn. We thus additionally demonstrate the performance of Dreamer using a manually specified arm distance reward for the Sawyer reaching task.
|
| 345 |
+
|
| 346 |
+
We build off of the open source implementation of Dreamer by the original authors, written in TensorFlow2 and found at https://github.com/danijar/dreamer. Specifically, to modify the networks to support goal-conditioning, we add independent convolutional encoders which take the goal image as input to each network. Each encoder consists of 2D convolution layers with [32, 64, 128, 256] filters and kernel sizes of 4 to each network, and we concatenate the flattened features to the inputs of each network. We additionally increase the number of fully-connected layers for the value and actor networks from 3 and 2 respectively to 10. We use a discount factor of $\gamma = 0 . 9 5$ . All other hyperparameter values are defaults from the public implementation.
|
| 347 |
+
|
| 348 |
+
For training, we relabel trajectories sampled from the fixed, offline dataset with a uniformly randomly selected observation from the trajectory as the goal. In most of our experiments, we compute the negative pixel-wise MSE as the reward, but in one reaching experiment, we use the negative $\ell _ { 2 }$ Euclidean distance between the arm end-effector position and the goal end-effector position. We train for 2000 iterations for each experiment, although initial experiments in which we trained for $2 0 \mathbf { x }$ longer did not yield improved results.
|
| 349 |
+
|
| 350 |
+
# B.3 GOAL-CONDITIONED BEHAVIOR CLONING
|
| 351 |
+
|
| 352 |
+
To train a goal-conditioned behavior cloning policy, we begin by relabeling random transitions from the dataset with goals which are later achieved in those trajectories. Specifically, we sample stategoal pairs from trajectories in the dataset by first selecting the initial state index $t _ { i }$ uniformly from all timesteps, and then selecting the goal state index $t _ { g }$ uniformly from timesteps greater than $t _ { i }$ . We then train a neural network to predict the transition action $a _ { i }$ given the state $s _ { i }$ and the relabeled goal $s _ { g }$ , using a mean-squared error loss.
|
| 353 |
+
|
| 354 |
+
The network architecture is the same as that of the actor network used in Q-learning for MBOLD, described in Appendix A.1. We train the model for 3125000 iterations (1000 epochs) using a batch size of 32, and use the same optimizer and learning rate as the distance learned for MBOLD.
|
| 355 |
+
|
| 356 |
+
B.4 SEARCH ON THE REPLAY BUFFER (EYSENBACH ET AL., 2019)
|
| 357 |
+
|
| 358 |
+
For Search on the Replay Buffer (SoRB), we train a distributional Q-function to represent distances as in the original paper. Distributional RL discretizes possible value estimates into a set of bins – we use 10 for all of our experiments. We train this distributional Q-function for 300 epochs, as in the distance function training for MBOLD. We also use the same architecture and training scheme, altering the number of outputs to 10 bins and using the KL-divergence loss for the distributional Q-function as in Eysenbach et al. (2019). However, unlike in Eysenbach et al. (2019), we train on just the fixed, offline dataset. We then perform the planning portion of SoRB with the “maxdist” parameter set to 4, after manual tuning. We use a graph size of 2000 states for all experiments, due to computational constraints.
|
| 359 |
+
|
| 360 |
+
We find that the policy learned through Q-learning performs very poorly at reaching subgoals, so we instead substitute the goal-conditioned behavior cloning policy for this purpose. We find that this greatly improves performance across all tasks.
|
| 361 |
+
|
| 362 |
+
# B.5 VISUAL FORESIGHT (EBERT ET AL., 2018B)
|
| 363 |
+
|
| 364 |
+
To compare MBOLD to visual foresight, we use the same dynamics model and planning setup as in MBOLD, however, we substitute the learned dynamical distance function with the $\ell _ { 2 }$ pixel error cost used in visual foresight.
|
| 365 |
+
|
| 366 |
+
# C ABLATION EXPERIMENTS IMPLEMENTATION DETAILS
|
| 367 |
+
|
| 368 |
+
# C.1 VAE DISTANCE
|
| 369 |
+
|
| 370 |
+
We use the same architecture as the VAE used in the RIG comparison described in Appendix B. We set the latent space dimension to 256 and weight the KL divergence term using a factor of $1 e ^ { - 5 }$ . We train the model for 3125000 iterations (1000 epochs) using a batch size of 32, and use the same optimizer and learning rate as the distance learned for MBOLD.
|
| 371 |
+
|
| 372 |
+
# C.2 TEMPORAL DISTANCE REGRESSION
|
| 373 |
+
|
| 374 |
+
To train the temporal distance regression model, we sample state-goal pairs from trajectories in the dataset by first selecting the initial state index $t _ { i }$ uniformly from all timesteps, and then selecting the goal state index $t _ { g }$ uniformly from timesteps greater than $t _ { i }$ . We compute the label for this pair as $\operatorname* { m i n } ( t _ { g } - t _ { i } , m a \bar { x } d i s t )$ , where maxdist is a hyperparameter we set to 10. The maxdist parameter helps to improve the optimality of distances on average. We train the neural network to regress this target label using an $\ell _ { 2 }$ error loss. We train the network for 3125000 iterations (1000 epochs) with a batch size of 32, and use the same optimizer and learning rate as the distance learned for MBOLD.
|
| 375 |
+
|
| 376 |
+
The architecture for the temporal distance regression model begins with the convolutional encoder described in Appendix B. Its flattened outputs are fed into 5 fully-connected layers of 256 units each, with batch-norm and ReLU activations after each intermediate layer.
|
| 377 |
+
|
| 378 |
+
# C.3 Q-FUNCTION POLICY
|
| 379 |
+
|
| 380 |
+
We find that the policy directly learned by our method when learning distances performs extremely poorly. However, performing Q-learning using random shooting over 100 uniformly random actions selected from $[ - 1 , \bar { 1 } ] ^ { 4 }$ to optimize over actions to compute target values produces much better results when used directly as a policy, compared to using an actor network to perform this optimization as in our method. Therefore, we report results from acting according to this random shooting method. At test time, we estimate the optimal action $a ^ { \star } = \arg \operatorname* { m a x } _ { a } Q ( s _ { t } , a , g )$ by again sampling 100 uniformly random actions, and selecting the best one.
|
| 381 |
+
|
| 382 |
+
# D COMPUTATIONAL COMPLEXITY ANALYSIS
|
| 383 |
+
|
| 384 |
+
In this section, we discuss the computation complexity of training and acting using MBOLD.
|
| 385 |
+
|
| 386 |
+
Training: Training the dynamics model takes about $3 0 \mathrm { h r }$ while training the distance function takes about $5 \mathrm { h r }$ . These training times are dwarfed by the cost of collecting data in the real world, which could take on the order of 3-4 days in the real world (but can be reused for various tasks). In contrast, a single RL approach only requires learning the distance function. While this means that it takes MBOLD significantly longer to train than the single RL approach, note that the dynamics model can be shared across many tasks. We train the dynamics model for $2 0 0 \mathrm { k }$ and distance function for 94k training steps. A training step for the dynamics model involves one forward and backward pass through the dynamics model. A training step for the distance function requires sampling positive and negative goals, two Q-function forward passes and a policy network forward pass to compute target values and current Q-values, and a backward pass to update model parameters. In contrast, a single RL approach would just learn the distance function, not the dynamics model. From the above estimates, this means that training steps for the dynamics model are around 3 times slower than training steps for the distance model. Because the dynamics model can be used to perform many tasks, this cost is amortized over these tasks, as compared to a single RL approach.
|
| 387 |
+
|
| 388 |
+
Acting: Selecting a sequence of actions (6 actions in our experiments) using MBOLD requires one forward pass of the dynamics model for each CEM iteration (3 total in our experiments), and one forward pass through the distance function and policy network. Amortized over a trajectory, this amounts to about 2 seconds wall clock time per action, which can be sped up by around $2 \mathbf { x }$ with similar performance by replanning less frequently. For a single RL approach, each action would require just one forward pass through the policy network.
|
| 389 |
+
|
| 390 |
+
# E ABLATION EXPERIMENTS
|
| 391 |
+
|
| 392 |
+
# E.1 NEGATIVE MINING & ACTUATED STATE COMPONENTS
|
| 393 |
+
|
| 394 |
+
The ablation experiments presented in Section 5 demonstrate that the negative mining technique can improve performance on manipulation tasks, as evaluated by the final position of the object being manipulated. However, in experiments performed in the real-world Franka drawer setting which only required the robot arm to “reach” to a particular location to match the goal, we found that MBOLD achieved a mean final Euclidean distance to goal of $0 . 1 4 \mathrm { { m } }$ , while Visual Foresight achieved 0.066m over 10 trials. Here, we conduct additional experiments in simulation to investigate the effect of negative mining on reaching goals based on accuracy of matching the highly actuated components, for example, the robot arm. In the single-object block pushing setting, we evaluate the performance of distance functions trained with and without negative mining on reaching the desired goal arm position. We perform the evaluation using (1) the set of test goals used in our original experiments, which include object movement, and (2) an additional set of test goals which only require robot arm movement. We present the results in Table 6. We find that training without negative mining improves the planner’s ability to reach goal arm positions when goals also require object movement, but note that this results in weaker performance in actually relocating those objects, establishing a trade-off. When goals are selected to require just arm movement, performance is comparable with and without the negative sampling scheme.
|
| 395 |
+
|
| 396 |
+
# E.2 PLANNING HORIZON ABLATIONS
|
| 397 |
+
|
| 398 |
+
In this section, we investigate the effect of the planning horizon $h$ on control performance. After training distance functions according to Appendix A.1, we perform planning with three different settings for $h$ on the simulated block pushing tasks. We present the results in Figure 8. We find that a longer planning horizon is beneficial, especially for solving more difficult tasks. We hypothesize that this is because longer planning horizons allow the planner and distance function to better distinguish promising predicted states, while the fidelity of state predictions remains relatively high.
|
| 399 |
+
|
| 400 |
+
# E.3 RANDOM OBJECT RESET ABLATIONS
|
| 401 |
+
|
| 402 |
+
In this section, we perform experiments to evaluate the impact of the distribution of initial object position on task performance. In particular, we look at the single-object Sawyer pushing task. We collect an additional dataset with the same policy and other parameters as that used in the main comparative evaluations, but restrict the random object initialization position to be within $[ - 0 . 0 5 , 0 . 0 5 ] ^ { 2 }$ as opposed to $[ - 0 . 2 , 0 . 2 ] ^ { 2 }$ . This represents a 16x reduction in the area of possible initializations. We then train a new dynamics model and distance function from scratch and compare the control performance on the same benchmark tasks from the main comparisons. We present the results in Table 5. We find that the control performance on these tasks remain within one standard deviation despite the restriction in reset position.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 8: Results for planning horizon ablations.
|
| 406 |
+
|
| 407 |
+
Table 5: Comparison of success rates for our method when trained using a dataset where object positions at the start of each episode were greatly restricted, compared to uniform over the entire space. Standard deviations are over 5 random seeds.
|
| 408 |
+
|
| 409 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Uniform reset</td><td rowspan=1 colspan=1>Restricted reset</td></tr><tr><td rowspan=1 colspan=1>1 object push (regular)1 object push (hard)</td><td rowspan=1 colspan=1>55.2 ± 4.3%40.2 ± 7.2%</td><td rowspan=1 colspan=1>54.5 ± 3.9%43.2 ± 7.2%</td></tr></table>
|
| 410 |
+
|
| 411 |
+
Table 6: Effect of training using negative mining on final arm position matching performance. A final $\ell _ { 2 }$ distance to goal arm position of $0 . 0 5 \mathrm { m }$ or less is considered a success. Standard deviations of success rates are computed over 5 random seeds.
|
| 412 |
+
|
| 413 |
+
<table><tr><td rowspan=1 colspan=1>Test goals</td><td rowspan=1 colspan=1>MBOLD</td><td rowspan=1 colspan=1>MBOLD (nonegative mining)</td></tr><tr><td rowspan=1 colspan=1>No object movementObject movement</td><td rowspan=1 colspan=1>89.2 ±1.9%64.4± 5.9%</td><td rowspan=1 colspan=1>91.6 ± 2.3%83.4± 4.0%</td></tr></table>
|
md/train/WA39qkJvLi/WA39qkJvLi.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Uncertainty-Driven Loss for Single Image Super-Resolution
|
| 2 |
+
|
| 3 |
+
Qian $\mathbf { N i n g ^ { 1 } }$ , Weisheng $\mathbf { D o n g } ^ { 1 }$ ∗, Xin Li2, Jinjian $\mathbf { W } \mathbf { u } ^ { 1 }$ , Guangming Shi1 1School of Artificial Intelligence, Xidian University, Xi’an 710071, China 2Lane Dep. of CSEE, West Virginia University, Morgantown WV 26506, USA ningqian@stu.xidian.edu.cn, {wsdong,jinjian.wu}@mail.xidian.edu.cn xin.li@mail.wvu.edu, gmshi@xidian.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
In low-level vision such as single image super-resolution (SISR), traditional MSE or $\mathcal { L } _ { 1 }$ loss function treats every pixel equally with the assumption that the importance of all pixels is the same. However, it has been long recognized that texture and edge areas carry more important visual information than smooth areas in photographic images. How to achieve such spatial adaptation in a principled manner has been an open problem in both traditional model-based and modern learning-based approaches toward SISR. In this paper, we propose a new adaptive weighted loss for SISR to train deep networks focusing on challenging situations such as textured and edge pixels with high uncertainty. Specifically, we introduce variance estimation characterizing the uncertainty on a pixel-by-pixel basis into SISR solutions so the targeted pixels in a high-resolution image (mean) and their corresponding uncertainty (variance) can be learned simultaneously. Moreover, uncertainty estimation allows us to leverage conventional wisdom such as sparsity prior for regularizing SISR solutions. Ultimately, pixels with large certainty (e.g., texture and edge pixels) will be prioritized for SISR according to their importance to visual quality. For the first time, we demonstrate that such uncertainty-driven loss can achieve better results than $M S E$ or $\mathcal { L } _ { 1 }$ loss for a wide range of network architectures. Experimental results on three popular SISR networks show that our proposed uncertainty-driven loss has achieved better PSNR performance than traditional loss functions without any increased computation during testing. The code is available at https://see.xidian.edu.cn/faculty/wsdong/Projects/UDL-SR.htm
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Single image super-resolution (SISR) aims at reconstructing high-resolution (HR) images from their corresponding degraded low-resolution (LR) images. Since the publication of super-resolution with convolutional neural network (SRCNN) [1], there has been a flurry of works on deep learning-based approaches toward SISR - e.g., EDSR [2], DPDNN [3], RCAN [4], SAN [5], and MoG-DUN [6]. The unifying theme along this line of research appears to be that deeper, bigger, and more complex networks can achieve improved SISR performance by facilitating the reconstruction of high-frequency details such as textures and edges in photographic images. Such improvement has been achieved by novel network architectures (e.g., skip connections [2]), new attention mechanism (e.g., residue channel attention [4]), and closed-loop supervision [7]. Surprisingly, most of these existing methods have adopted $M S E$ or $\mathcal { L } _ { 1 }$ loss to optimize the parameters of networks.
|
| 12 |
+
|
| 13 |
+
The commonly used practice, such as $M S E$ or $\mathcal { L } _ { 1 }$ loss, treats every pixel equally regardless of whether the pixel is in texture/edge regions or smooth areas. The optimality of such non-adaptive loss function has been questioned in the literature of SISR calling for the proposition of perceptual loss function (e.g., [9]). From a Bayesian perspective, the assumption underlying the $M S E$ or $\bar { \mathcal { L } } _ { 1 }$ loss is that each pixel obeys the independent and identically distribution with the same variance. Taking $\mathcal { L } _ { 1 }$ loss as an example, the likelihood of all pixels in an image can be formulated as
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Illustration of the difference (d) between HR image (b) and SR image (c) reconstructed by EDSR network [2] on dataset Set14 [8]. The image reconstructed by EDSR network is shown in (c) and (d) shows the absolute difference between the HR image and SR image. Best viewed in color.
|
| 17 |
+
|
| 18 |
+
$$
|
| 19 |
+
p ( \pmb { x } \mid \pmb { y } , \pmb { W } ) = \prod _ { l = 1 } ^ { M } c \exp ( - \frac { \vert \vert \pmb { x } ^ { ( l ) } - \pmb { f } ^ { ( W ) } ( \pmb { y } ^ { ( l ) } ) \vert \vert _ { 1 } } { \sigma } ) ,
|
| 20 |
+
$$
|
| 21 |
+
|
| 22 |
+
where $_ { \textbf { \em x } }$ and $\textbf { { y } }$ denote the pair of HR and LR image, $f ^ { ( W ) } ( \cdot )$ denotes an arbitrary SISR network parameterized by $W$ , and $c , \sigma$ denote spatially invariant constants. However, such assumption of stationarity or spatial invariance of image prior model is invalid for photographic images in the real world. For instance, if one compares the ground-truth (HR image) and the SR image reconstructed by EDSR [2] as shown in Fig. 1 (c), it can be observed that texture areas (e.g., hair of baboon) are not restored as good as smooth areas (e.g., nose of baboon). Fig. 1 (d) depicts the absolute difference between the HR image and reconstructed SR image, from which we can observe spatial variation of the difference map. Such observation implies that the uncertainty of texture and edge areas as characterized by the variance is much larger than that in smooth areas. How to address such uncertainty-driven loss for SISR sets up the stage for this paper.
|
| 23 |
+
|
| 24 |
+
In this paper, we propose a new adaptive weighted loss (uncertainty-driven loss) for SISR by assigning texture and edge areas with higher weights during the training process. Unlike previous work of perceptual loss [9] focusing on characterizing content and style consistency, we target at explicitly estimating the variance field underlying the unknown HR image in the first step, which can be exploited as an auxiliary signal for guiding the SISR solution in the second step. A direct consequence of our two-step learning approach is that it delivers not only higher visual quality but also improved objective performance such as PSNR and SSIM. Moreover, uncertainty estimation perspective allows us to easily incorporate existing models such as Jefferey’s prior [10, 11] into the proposed SISR solution. It follows that the network training boils down to two sequential steps in which the variance map is estimated from the first step and serves as the attention signal for the second step. The main technical contributions are summarized as follows.
|
| 25 |
+
|
| 26 |
+
• Uncertainty modeling and estimation. We propose to cast SISR into a Bayesian estimation framework under which SR image (mean) and uncertainty (variance) are derived simultaneously. Unlike previous works in which pixels with large uncertainty are attenuated for high-level vision tasks, we advocate to prioritize them for low-level vision tasks such as SISR.
|
| 27 |
+
Uncertainty-driven loss (UDL). The estimation of variance map facilitates the training of SISR network by dividing it into two steps. In the first step, an estimating sparsity uncertainty (ESU) loss function was derived from the classical Jeffrey’s prior to estimate the variance map. In the second step, the estimated variance map serves as the guidance signal leading to adaptive weighted loss named uncertainty-driven loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ .
|
| 28 |
+
Universality of UDL. The proposed uncertainty loss can easily be employed in any existing SISR network to improve performance and do not increase any additional computation cost during testing.
|
| 29 |
+
• Experimental results on three different baseline networks show that our proposed uncertaintydriven loss has achieved better PSNR performance than traditional $M S E$ or $\mathcal { L } _ { 1 }$ loss.
|
| 30 |
+
|
| 31 |
+
# 2 Related Work
|
| 32 |
+
|
| 33 |
+
# 2.1 Uncertainty in Deep Learning
|
| 34 |
+
|
| 35 |
+
Many works [12–14] have introduced uncertainty into the regression with input-dependent noises problems, and studied the nature and behavior of uncertainty for a long time. More recently, modeling uncertainty in deep learning have improved the performance and robustness of deep networks in many computer vision tasks [15–17] such as image classification [18], image segmentation [15, 16], and face recognition [17, 19]. The uncertainty in deep learning can be roughly divided into two categories [20]. Epistemic/model uncertainty describes how much the model is uncertain about its predictions. Another type is aleatoric/data uncertainty which refers to noise inherent in observation data. In [15], they presented a Bayesian deep learning framework combining aleatoric uncertainty with epistemic uncertainty for per-pixel semantic segmentation and depth regression tasks. Chang et al.[17] investigated the data uncertainty with estimated mean and variance in face recognition. Those uncertainty-based loss function proposed by those works [15–17] can be summarized as
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\mathcal { L } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 2 } } { 2 \sigma _ { i } ^ { 2 } } + \frac { 1 } { 2 } \ln \sigma _ { i } ^ { 2 } ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $f ( \pmb { y } _ { i } )$ and $\sigma _ { i } ^ { 2 }$ denote the learned mean and variance respectively. Using above loss function indeed improved their robustness to noisy data. In those tasks, the pixels with high uncertainty were regarded as unreliable pixels which would bear loss attenuation. On the contrary, in SISR tasks, the pixels with high uncertainty (e.g., complex texture or edge areas) should be prioritized since those regions visually more important than pixels in smooth areas. That can explain why applying above loss into SISR directly leads performance decline.
|
| 42 |
+
|
| 43 |
+
# 2.2 Modeling Uncertainty for SISR
|
| 44 |
+
|
| 45 |
+
To the best of our knowledge, only two works [21, 22] have studied the behavior of uncertainty for SISR in the open literature. [22] used batch-normalization uncertainty to analyze SISR uncertainty, improving the robustness of the network against adversarial attack. The most recent advance related to our work is Gradient Rescaling Attention Model (GRAM) [21], which analyses the effect of aleatoric/data uncertainty on SISR reconstruction. By decreasing the loss attenuation of large variance pixels, GRAM achieves better results than applying above uncertainty loss into SISR directly. However, GRAM [21] loss remains attenuated when the variance of pixels is high, which contradicts the intuition of prioritizing texture and edge pixels. Thus, GRAM [21] is still inferior to baseline methods since the proposed method fails to prioritize the pixels of large variance. Different from GRAM, we propose a novel uncertainty-driven loss (UDL) to enforce the network concentrating more on the pixels with large variance aiming at better reconstruction of texture and edge regions. By quantifying the uncertainty in SISR under deep Bayesian framework, our proposed method has achieved better results than baseline methods.
|
| 46 |
+
|
| 47 |
+
# 3 Methodology
|
| 48 |
+
|
| 49 |
+
Unlike traditional $M S E$ or $\mathcal { L } _ { 1 }$ loss treating every pixel equally, the proposed new adaptive weighted loss for SISR aims at prioritizing texture and edge pixels that are visually more important than pixels in smooth areas. Toward this objective, we first introduce an approach of estimating intermediate results of SR image (mean) and uncertainty (variance) simultaneously in SISR. Then, with Jeffrey’s prior term, a regularized approach of estimating sparse uncertainty is proposed for more accurate uncertainty estimation. An important new insight brought by this paper is that unlike high-level vision tasks where pixels with large uncertainty are assigned lower weights to attenuate their impact $I I 5 J ,$ one should prioritize these pixels in low-level vision tasks such as SISR. Such observation implies that the attenuation of weighting coefficients in loss function needs to be properly translated into the attention mechanism given the specific vision problem as the context.
|
| 50 |
+
|
| 51 |
+
In previous study [15], it has been shown that explicitly representing aleatoric uncertainty can lead to performance and robustness improvement to noise data in high-level vision tasks such as image segmentation. Such improvement can be explained away by attenuating the weights of pixels with large uncertainty. However, attenuation has to go the opposite direction in low-level vision tasks such as SISR - i.e., larger weights should be assigned to the pixels with high uncertainty (e.g., texture and edge pixels) because they are visually more important than pixels in smooth regions. It should be noted that existing work such as gradient rescaling strategy in GRAM [21] fails to recognize such difference and does not prioritize pixels with high uncertainty. In this paper, we propose a new adaptive weighted loss named uncertainty-driven loss (UDL) for properly turning attenuation into attention for SISR.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: The overview of training SISR network with proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss. The whole training process can divided into two steps; the first step estimates the uncertainty $\pmb \theta$ precisely and the second step generates the final mean value $f ( \boldsymbol { y } )$ . In step1 shown in (a), the mean value $f ( \boldsymbol { y } )$ and variance $\pmb \theta$ are pretrained by $\mathcal { L } _ { \mathrm { E S U } }$ loss. During step2, as shown in (b), the mean value $f ( y )$ network is trained by ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss, while the network of inferring variance $\pmb \theta$ is fixed. Note that the mean value $f ( \boldsymbol { y } )$ network of step2 starts training from the pretrained network of step1. The Nearest Upsampling denotes interpolation operator.
|
| 55 |
+
|
| 56 |
+
# 3.1 Estimating Uncertainty (EU) in SISR.
|
| 57 |
+
|
| 58 |
+
As discussed in [15], there are two classes of uncertainty in Bayesian modeling: aleatoric uncertainty capturing noise inherent in observation data and epistemic uncertainty accounting for uncertainty of model about its predictions. We opt to study the former (aleatoric uncertainty) and explore its application into SISR by designing new uncertainty-driven loss (UDL) functions in this paper. In order to better quantify aleatoric uncertainty in SISR, we use ${ \mathbf { } } _ { \mathbf { } } \mathbf { } _ { \mathbf { } } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf { } \Psi \mathbf \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { }$ to denote the low-resolution (LR) image and the corresponding high-resolution (HR) image respectively. Let $f ( \cdot )$ denotes an arbitrary SISR network and the aleatoric uncertainty can be denoted by an additive term $\theta _ { i }$ . This way, the overall observation model can be formulated as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\pmb { x } _ { i } = f ( \pmb { y } _ { i } ) + \epsilon \pmb { \theta } _ { i } ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\epsilon$ represents the Laplace distribution with zero-mean and unit-variance. Existing deep-learning based SISR methods target at training a network to learn the SR image (mean) $f ( \pmb { y } _ { i } )$ only. To more accurately characterize aleatoric uncertainty for SISR, we propose to estimate not only the SR image (mean) $\dot { f } ( \pmb { y } _ { i } )$ but also the uncertainty (variance) $\theta _ { i }$ simultaneously.
|
| 65 |
+
|
| 66 |
+
For a given LR image $\mathbf { \nabla } _ { \mathbf { \psi } _ { 3 } } \psi _ { i }$ and corresponding HR image $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , a Laplace distribution 2 is assumed for characterizing the likelihood function by
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
p ( \pmb { x } _ { i } , \pmb { \theta } _ { i } | \pmb { y } _ { i } ) = \frac { 1 } { 2 \pmb { \theta } _ { i } } \exp ( - \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 1 } } { \pmb { \theta } _ { i } } ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $f ( \pmb { y } _ { i } )$ and $\theta _ { i }$ denote the SR image (mean) and the uncertainty (variance) which are learned by deep neural networks (DNNs) respectively. Then, the log likelihood can be formulated as follows,
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\ln p ( { \pmb x } _ { i } , \pmb \theta _ { i } | { \pmb y } _ { i } ) = - \frac { | | { \pmb x } _ { i } - f ( { \pmb y } _ { i } ) | | _ { 1 } } { \pmb \theta _ { i } } - \ln \pmb \theta _ { i } - \ln 2
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: SISR visual quality comparisons of EDSR-S [2] with different loss function on ‘Img_005’ from Set5 [23] (bicubic-downsampling $\times 4 )$ ). Best viewed in color.
|
| 80 |
+
|
| 81 |
+
For numerical stability, we train the networks to estimate log variance $\begin{array} { r } { s _ { i } = \ln \theta _ { i } } \end{array}$ as shown in Fig. 2 (a). At last, the maximum likelihood estimation of (5) can be reformulated as the minimization of following loss function for estimating uncertainty (EU) in SISR.
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal { L } _ { E U } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \exp ( - s _ { i } ) \vert \vert \pmb { x } _ { i } - f ( \pmb { y } _ { i } ) \vert \vert _ { 1 } + s _ { i }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Jeffrey’s Prior for Estimating Sparse Uncertainty (ESU) in SISR. The loss function $\mathcal { L } _ { \mathrm { E U } }$ includes two terms; the first one is associated with fidelity term and the second one prevents the network from predicting infinite uncertainty for all pixels. Those two terms reach equilibrium but there is no prior that imposed on the uncertainty estimation. Therefore, based on the observation that the uncertainty is sparse in view of the whole image as shown in Fig. 2, we propose to impose Jeffrey’s prior [10] $\begin{array} { r } { p ( \dot { \boldsymbol { w } } ) \propto \frac { 1 } { w } } \end{array}$ on uncertainty $\theta _ { i }$ , which can be expressed as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\nu ( x _ { i } , \theta _ { i } | y _ { i } ) = p ( x _ { i } | y _ { i } , \theta _ { i } ) p ( \theta _ { i } ) \propto \frac { 1 } { 2 \theta _ { i } } \exp ( - \frac { \left| | x _ { i } - f ( y _ { i } ) | \right| _ { 1 } } { \theta _ { i } } ) \frac { 1 } { \theta _ { i } } = \frac { 1 } { 2 \theta _ { i } ^ { 2 } } \exp ( - \frac { \left| | x _ { i } - f ( y _ { i } ) | \right| _ { 1 } } { \theta _ { i } } )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Then the log likelihood and loss function can be separately formulated as follows,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\ln p ( \pmb { x } _ { i } | \pmb { y } _ { i } ) = - \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 1 } } { \pmb { \theta } _ { i } } - 2 \ln \pmb { \theta } _ { i } - \ln 2
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { E S U } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \exp ( - s _ { i } ) | | x _ { i } - f ( \pmb { y } _ { i } ) | | _ { 1 } + 2 s _ { i }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The limitations of $\mathcal { L } _ { \bf E U }$ and ${ \mathcal { L } } _ { \mathbf { E S U } }$ loss. Applying $\mathcal { L } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ loss leads to more accurate estimation of uncertainty (variance field), but counter-intuitively, they do not directly improve the performance of SISR. We have conducted experiments comparing those three different loss functions to verify the above claim. As shown in Tab. 1, the average PSNR and SSIM results of $\mathcal { L } _ { \mathrm { E S U } }$ and $\mathcal { L } _ { \mathrm { E U } }$ are notably lower than the original results. The reason behind this observation is that both ${ \mathcal { L } } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ loss functions have incorporated the variance term $( \pmb \theta _ { i } )$ into the divisor of the absolution difference term. Consequently, a pixel with a large variance will be penalized after the division and has less impact on the overall loss function. Note that such attenuation of pixels with large uncertainty is preferred for high-level vision tasks, as demonstrated in previous works [15–17] on image classification [18], image segmentation [15, 16], and face recognition [17, 19].
|
| 104 |
+
|
| 105 |
+
Low-level vision tasks such as SISR are much different. As shown in Fig. 1, pixels with large uncertainty carry visually important information such as textured and edges. They need to be prioritized (opposite to attenuation) and given larger instead of smaller weights. To verify such claim, we have presented a simple example comparing the visual results between $\mathcal { L } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ as shown in Fig. 3. It can be seen that the uncertainty captured by $\mathcal { L } _ { \mathrm { E S U } }$ loss is better than $\mathcal { L } _ { \mathrm { E U } }$ loss. The improvement of $\mathcal { L } _ { \mathrm { E S U } }$ in Eq. (9) over $\mathcal { L } _ { \mathrm { E U } }$ in Eq. (6) is attributed to the prioritization of pixels with large uncertainty ( $\boldsymbol { s } _ { i }$ values). Fig. 3 (f) clearly demonstrate superiority of exploiting the sparsity constraint with the uncertainty estimation.
|
| 106 |
+
|
| 107 |
+
Table 1: Average PSNR and SSIM results for BI degradation on five datasets for investigating three different loss. The best performance is shown in bold. We record the results in $1 . 2 \times 1 0 ^ { \overline { { 5 } } }$ iterations.
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Base Model</td><td rowspan="2">Scale</td><td rowspan="2">Loss</td><td colspan="2">Set5[23]</td><td colspan="2">Set14 [8]</td><td colspan="2">BSD100[24]</td><td colspan="2">Urban100 [25]</td><td colspan="2">Manga109 [26]</td></tr><tr><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td></tr><tr><td rowspan="3">EDSR-S[2]</td><td rowspan="3">×4</td><td>Original</td><td>30.93</td><td>0.8740</td><td>27.80</td><td>0.7627</td><td>27.05</td><td>0.7190</td><td>24.71</td><td>0.7351</td><td>28.14</td><td>0.8693</td></tr><tr><td>LEU</td><td>30.19</td><td>0.8627</td><td>27.29</td><td>0.7538</td><td>26.78</td><td>0.7120</td><td>24.21</td><td>0.7179</td><td>26.78</td><td>0.8481</td></tr><tr><td>LESU</td><td>30.31</td><td>0.8637</td><td>27.39</td><td>0.7543</td><td>26.83</td><td>0.7124</td><td>24.27</td><td>0.7192</td><td>26.92</td><td>0.8496</td></tr></table>
|
| 110 |
+
|
| 111 |
+
# 3.2 Uncertainty-Driven Loss (UDL) for SISR
|
| 112 |
+
|
| 113 |
+
Improvement of $\mathcal { L } _ { \mathrm { E S U } }$ over $\mathcal { L } _ { \mathrm { E U } }$ inspired us to go one step further. To better prioritize pixels with large uncertainty, we propose a new adaptive weighted loss named uncertainty-driven loss (UDL) for SISR. Unlike $\mathcal { L } _ { \mathrm { E S U } }$ loss putting a larger weight to the second term than $\mathcal { L } _ { \mathrm { E U } }$ , we suggest that the first term can also be modified to directly associate the aleatoric/data uncertainty of $f ( \pmb { y } _ { i } )$ . That is, instead of using $e x p ( - s _ { i } )$ to attenuate the importance of pixels with large uncertainty, we need to use a monotonically increasing function to prioritize them. Linear scaling would be a natural option, which leads to the following loss function
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathcal { L } _ { U D L } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \hat { s _ { i } } | | \pmb { x } _ { i } - f ( \pmb { y } _ { i } ) | | _ { 1 } ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where ${ \hat { s } } _ { i } = s _ { i } - \operatorname* { m i n } ( s _ { i } )$ is a non-negative linear scaling function. To prevent uncertainty value from degenerating into zeros, the result of uncertainty estimation network in the first step will be passed to the second step as the attention signal $\displaystyle s = \ln \theta$ ), as shown in Fig. 2. By leveraging the log variance to represent the challenging and cumbersome pixels with higher uncertainty, we propose a new weighted loss named uncertainty-driven loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ . In ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss, texture and edge pixels with higher uncertainty tend to have larger weights than those in smooth regions. In summary, the uncertainty estimation $\pmb \theta$ serves as the bridge connecting two steps: it is the output of the first step; but passed on to the second step as the guidance required for calculating ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss.
|
| 120 |
+
|
| 121 |
+
# 3.3 Two-step Training of Dual Networks
|
| 122 |
+
|
| 123 |
+
As shown in Fig. 2, the whole training process can be divided into two steps; the first step estimates the uncertainty $\pmb { \theta }$ precisely and the second step generates the final mean value $f ( \boldsymbol { y } )$ with the aid from the estimated uncertainty $\pmb \theta$ from step1. More specifically, the mean value $f ( y )$ and variance $\theta$ are pre-trained by $\mathcal { L } _ { \mathrm { E S U } }$ loss during step1 as shown in Fig. 2 (a). After the uncertainty has been estimated, the mean value $f ( \boldsymbol { y } )$ network is trained by ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss with variance $\theta$ as shown in Fig. 2 (b), while the network of inferring variance $\pmb { \theta }$ is fixed.
|
| 124 |
+
|
| 125 |
+
Note that the mean value $f ( \boldsymbol { y } )$ network of step2 starts training from the pre-trained network of step1. Such partial parameter sharing is a salient property of our proposed dual networks with parallel symmetric attention [27]. In theory, we can extend the two-step training into multiple-step training by alternating between the estimation of uncertainty (variance $\pmb \theta$ ) and mean value $f ( \boldsymbol { y } )$ . Conceptually, an improved estimation of unknown HR image can leads to an improved estimation of aleatoric uncertainty and vice versa. This line of reasoning will lead to the pursuit of a deep equilibrium model [28] for SISR; but it is beyond the scope of this paper.
|
| 126 |
+
|
| 127 |
+
# 3.4 Discussions: Why UDL Outperforms GRAM?
|
| 128 |
+
|
| 129 |
+
To the best of our knowledge, only one work GRAM [21] has studied data uncertainty in SISR, which is the most related to our work. We will discuss connections and differences between proposed UDL and GRAM [21] here. First, both GRAM [21] and our work has found out that applying the traditional uncertainty loss designed for high-level computer vision tasks into SISR task directly results in performance decline. For high-level computer vision tasks, the pixels with higher uncertainty indicates less confidence in final inference, which needs loss attenuation. However, for SISR tasks, the pixels with higher uncertainty (e.g., texture and edge pixels) should be prioritized with larger weights because they are visually more important than pixels in smooth regions. To solve this problem, GRAM [21] proposes to use uncertainty to generate an attention mask that decreases loss attenuation. However, GRAM [21] loss still is attenuated when the variance of pixels is high. Thus, GRAM [21] is still inferior to baseline method since it still does not prioritize pixels with high uncertainty.
|
| 130 |
+
|
| 131 |
+
Different from GRAM, we propose an uncertainty-driven loss to assign the pixels with high variance more weight to prioritize them. Besides, modeling uncertainty under Bayesian framework allows us to leverage sparsity prior for a more precise estimation of uncertainty. Ultimately, our proposed method consists of those two technical contributions that achieve better results than baseline methods and outperform GRAM.
|
| 132 |
+
|
| 133 |
+
# 4 Experiments
|
| 134 |
+
|
| 135 |
+
# 4.1 Experimental Settings
|
| 136 |
+
|
| 137 |
+
Datasets and Metrics. 800 high-quality (2K resolution) images from the DIV2K dataset [29] have been used for training. Following EDSR [2], five standard benchmark datasets: Set5 [23], Set14 [8], BSD100[24], Urban100 [25], Manga109 [26] are used for testing. Performance evaluation in terms of of PSNR and SSIM [30] metrics is conducted on the luminance (Y) channel only.
|
| 138 |
+
|
| 139 |
+
Training Setting. We randomly select 16 RGB LR patches sized by $4 8 \times 4 8$ as the inputs. The image patches are randomly rotated by $9 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ and flipped horizontally. The ADAM algorithm [31] with $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9$ , $\epsilon \overset { \cdot } { = } 1 0 ^ { - 8 }$ is adopted to optimize the network. The initial learning rate is $1 0 ^ { - 4 }$ and decreases by half for every $2 \times 1 0 ^ { 5 }$ minibatch updates.
|
| 140 |
+
|
| 141 |
+
Degradation models. To demonstrate the effectiveness of our proposed uncertainty-driven loss in varying degradation scenarios, we have designed the following experiments with two different degradation models. Let BI denotes bicubic downsampling. The second one is BD which uses Gaussian blur followed by nearest downsampling to generate LR images. Specifically, we apply $1 1 \times 1 1$ sized Gaussian kernel with a standard deviation 1.6 for blurring in our experiments.
|
| 142 |
+
|
| 143 |
+
SISR Networks. We choose three different networks to verify the effectiveness of proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss. The first one is EDSR-S or called baseline network in [2]. EDSR-S [2] mainly consists of 16 Resblock with 64 channels, having $1 . 5 M$ parameters. The second one is DPDNN[3] where denoiser network is U-net under model-guided framework. The last one is a big network EDSR[2], consisting of 32 Resblock with 256 channels, having $4 3 M$ parameters. The analysis of training cost can be found in our supplementary material.
|
| 144 |
+
|
| 145 |
+
# 4.2 Ablation Study
|
| 146 |
+
|
| 147 |
+
Table 2: Average PSNR and SSIM results for BI degradation on five datasets for investigating three different loss. The best performance is shown in bold. We record the results in $4 \times 1 0 ^ { 5 }$ iterations.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2">Base Model</td><td rowspan="2">Scale</td><td rowspan="2">Loss</td><td colspan="2">Set5[23]</td><td colspan="2">Set14[8]</td><td colspan="2">BSD100 [24]</td><td colspan="2">Urban100[25]</td><td colspan="2">Manga109 [26]</td></tr><tr><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td></tr><tr><td rowspan="3">EDSR-S[2]</td><td rowspan="3">×4</td><td>Original</td><td>31.61</td><td>0.8862</td><td>28.22</td><td>0.7721</td><td>27.30</td><td>0.7271</td><td>25.25</td><td>0.7575</td><td>29.31</td><td>0.8907</td></tr><tr><td>LEU+LUDL</td><td>31.83</td><td>0.8895</td><td>28.33</td><td>0.7754</td><td>27.37</td><td>0.7297</td><td>25.49</td><td>0.7665</td><td>29.70</td><td>0.8959</td></tr><tr><td>LESU+LUDL</td><td>31.90</td><td>0.8897</td><td>28.37</td><td>0.7755</td><td>27.40</td><td>0.7301</td><td>25.54</td><td>0.7671</td><td>29.77</td><td>0.8967</td></tr></table>
|
| 150 |
+
|
| 151 |
+
To further verify the effectiveness of sparse uncertainty estimation at step1, we have conducted an ablation study to compare the final PSNR/SSIM results of ${ \mathcal { L } } _ { \mathrm { U D L } }$ with $\mathcal { L } _ { \mathrm { E U } }$ or with $\mathcal { L } _ { \mathrm { E S U } }$ at step1. In our ablation study, we have used $\times 4$ bicubic down-sampling degradation on five frequently-used benchmark datasets with EDSR-S backbone[2]. As shown in Tab. 2, both ${ \mathcal { L } } _ { \mathrm { E U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ and ${ \mathcal { L } } _ { \mathrm { E S U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ loss have achieved better performance than original loss. Besides, ${ \mathcal { L } } _ { \mathrm { E S U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ loss obtains better results than $\mathcal { L } _ { \mathrm { E U } } { + } \mathcal { L } _ { \mathrm { U D L } }$ due to more accurate uncertainty estimation as shown in Fig. 3 (e) and (f).
|
| 152 |
+
|
| 153 |
+
# 4.3 Analysis of Different Weighted Loss
|
| 154 |
+
|
| 155 |
+
There are many different weighted loss guided by different weight maps, such as Error_map, Gradient_map which can also reveal the challenging pixels. We have conducted experiments with a weighted loss function where the weight is a pixel-wise gradient or Error_map. The PSNR results of five benchmark datasets for investigating the influence of different weighted loss functions can be summarized in Tab. 3.
|
| 156 |
+
|
| 157 |
+
The $H R$ _gradient_map and $L R$ _gradien_map denote calculating gradient map from high-resolution (ground truth) images and low-resolution images respectively. The calculation of gradient can be formulated as
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\begin{array} { r } { V ( i , j ) = I ( i + 1 , j ) - I ( i , j ) , H ( i , j ) = I ( i , j + 1 ) - I ( i , j ) , G ( i , j ) = | | ( V ( i , j ) , H ( i , j ) | | _ { 2 } , } \end{array}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
Table 3: Average PSNR and $\Delta$ PSNR results with BI degradation on five datasets for investigating the influence of different weighted loss functions. The best performance is shown in bold.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1>Weighted loss</td><td rowspan=1 colspan=1>Set5</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Set14</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>BSD100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Urban100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Manga109</td><td rowspan=1 colspan=1>△</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>31.61</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>28.22</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>27.30</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>25.25</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>29.31</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>Uncertainty(Ours)</td><td rowspan=1 colspan=1>31.90</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>28.37</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.54</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>29.77</td><td rowspan=1 colspan=1>0.46个</td></tr><tr><td rowspan=1 colspan=1>Error_map</td><td rowspan=1 colspan=1>31.77</td><td rowspan=1 colspan=1>0.16个</td><td rowspan=1 colspan=1>28.30</td><td rowspan=1 colspan=1>0.08个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.40</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>29.57</td><td rowspan=1 colspan=1>0.26个</td></tr><tr><td rowspan=1 colspan=1>HR_gradient_map</td><td rowspan=1 colspan=1>31.68</td><td rowspan=1 colspan=1>0.07个</td><td rowspan=1 colspan=1>28.27</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.42</td><td rowspan=1 colspan=1>0.17个</td><td rowspan=1 colspan=1>29.45</td><td rowspan=1 colspan=1>0.14个</td></tr><tr><td rowspan=1 colspan=1>LR_gradient_map</td><td rowspan=1 colspan=1>31.69</td><td rowspan=1 colspan=1>0.08个</td><td rowspan=1 colspan=1>28.29</td><td rowspan=1 colspan=1>0.07个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.38</td><td rowspan=1 colspan=1>0.13个</td><td rowspan=1 colspan=1>29.50</td><td rowspan=1 colspan=1>0.19个</td></tr></table>
|
| 166 |
+
|
| 167 |
+
where $I$ denotes pixels value and $i , j$ denotes position of pixels. Note that we adjust the scaling functions of Error_map, HR_gradient_map and LR_gradient_map to get the best performance.
|
| 168 |
+
|
| 169 |
+
From the Tab. 3, one can be observed that other weighted loss functions can indeed improve the PSNR results, but only to certain degrees. Comparing four different weight maps, our proposed uncertainty weighted loss function can bring the biggest improvement. Although the Error_map can represent the variance of a single pixel, the Error_map lacks semantic information or local information to capture a more precise estimation of variance comparing uncertainty. With regard to the gradient map of HR or LR images, those gradient maps only well match the edges of images and have a certain correlation to variance. Comparing the visual results of Error_map, HR_gradient_map and $L R$ _gradient_map with uncertainty map, those maps only detect edges of images and fail reflecting complex texture details which are important to final reconstruction performance. Therefore, uncertainty-weighted loss can is still valuable for achieving the best performance among other weighted maps.
|
| 170 |
+
|
| 171 |
+
# 4.4 Analysis of Different Scaling Functions
|
| 172 |
+
|
| 173 |
+
We have conducted experiments with several various monotonically increasing functions (including linear and non-linear) and the results can be summarized in Tab. 4.
|
| 174 |
+
|
| 175 |
+
Table 4: Average PSNR and $\Delta$ PSNR results with BI degradation on five datasets for investigating the influence of different scaling functions. The best performance are shown in bold.
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan=1 colspan=1>Scaling functions</td><td rowspan=1 colspan=1>Set5</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Set14</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>BSD100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Urban100</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Manga109</td><td rowspan=1 colspan=1>A</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>31.61</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>28.22</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>27.30</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>25.25</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>29.31</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>s-min(s)</td><td rowspan=1 colspan=1>31.90</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>28.37</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.54</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>29.77</td><td rowspan=1 colspan=1>0.46个</td></tr><tr><td rowspan=1 colspan=1>exp(s)</td><td rowspan=1 colspan=1>31.80</td><td rowspan=1 colspan=1>0.19个</td><td rowspan=1 colspan=1>28.34</td><td rowspan=1 colspan=1>0.12个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.53</td><td rowspan=1 colspan=1>0.28个</td><td rowspan=1 colspan=1>29.66</td><td rowspan=1 colspan=1>0.35个</td></tr><tr><td rowspan=1 colspan=1>e.xp(s)(1/2)</td><td rowspan=1 colspan=1>31.86</td><td rowspan=1 colspan=1>0.25个</td><td rowspan=1 colspan=1>28.36</td><td rowspan=1 colspan=1>0.14↑</td><td rowspan=1 colspan=1>27.41</td><td rowspan=1 colspan=1>0.11个</td><td rowspan=1 colspan=1>25.55</td><td rowspan=1 colspan=1>0.30↑</td><td rowspan=1 colspan=1>29.71</td><td rowspan=1 colspan=1>0.40↑</td></tr><tr><td rowspan=1 colspan=1>log(s)-min(log(s))</td><td rowspan=1 colspan=1>31.89</td><td rowspan=1 colspan=1>0.28个</td><td rowspan=1 colspan=1>28.39</td><td rowspan=1 colspan=1>0.17个</td><td rowspan=1 colspan=1>27.42</td><td rowspan=1 colspan=1>0.12个</td><td rowspan=1 colspan=1>25.57</td><td rowspan=1 colspan=1>0.32个</td><td rowspan=1 colspan=1>29.74</td><td rowspan=1 colspan=1>0.43个</td></tr></table>
|
| 178 |
+
|
| 179 |
+
The best and second-best performances are shown in bold. Overall, four various monotonically increasing functions have achieved better results than the baseline method. The best two scaling functions are linear scaling and log scaling with a slight difference as shown in the above table. Since the linear scaling function achieves a comparable performance with low computational cost, we advocate this choice in this paper.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: SISR visual quality comparisons of EDSR-S [2] with different loss function on ‘Img_004’ and $\mathrm { \hbar } ^ { 4 } \mathrm { I m g \_ 0 1 } 6 ^ { , }$ from Urban100 [25] (bicubic-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 5: SISR visual quality comparisons of DPDNN [3] with different loss function on ‘Img_095 from BSD100 [24] (bicubic-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 186 |
+
|
| 187 |
+
Table 5: Average PSNR and SSIM results for BI degradation on five benchmark datasets. The best performance is shown in bold. Note that ${ \mathcal { L } } _ { \mathrm { U D L } }$ -Ours denotes adopting $\mathcal { L } _ { \mathrm { E S U } }$ at step1 and ${ \mathcal { L } } _ { \mathrm { U D L } }$ at step2 for simplicity.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan=2 colspan=1>Base Model</td><td rowspan=2 colspan=1>Scale</td><td rowspan=2 colspan=1>Loss</td><td rowspan=1 colspan=2>Set5[23]</td><td rowspan=1 colspan=1>Set]</td><td rowspan=1 colspan=1>4[8]</td><td rowspan=1 colspan=2>BSD100 [24]</td><td rowspan=1 colspan=1>Urban</td><td rowspan=1 colspan=1>00[25]</td><td rowspan=1 colspan=1>Manga</td><td rowspan=1 colspan=1>109[26]</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>37.6637.4837.95</td><td rowspan=1 colspan=1>0.85940.95890.9604</td><td rowspan=1 colspan=1>33.2232.9933.50</td><td rowspan=1 colspan=1>0.91460.91260.9165</td><td rowspan=1 colspan=1>31.9531.7632.13</td><td rowspan=1 colspan=1>0.89690.89460.8991</td><td rowspan=1 colspan=1>30.7130.1131.54</td><td rowspan=1 colspan=1>0.92050.91340.9304</td><td rowspan=1 colspan=1>37.7937.3838.38</td><td rowspan=1 colspan=1>0.97520.97390.9767</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>37.7537.7438.00</td><td rowspan=1 colspan=1>0.96000.95970.9605</td><td rowspan=1 colspan=1>33.3033.2733.63</td><td rowspan=1 colspan=1>0.91500.91480.9176</td><td rowspan=1 colspan=1>32.0931.9832.16</td><td rowspan=1 colspan=1>0.89900.89730.8995</td><td rowspan=1 colspan=1>31.5030.9731.72</td><td rowspan=1 colspan=1>0.92200.92380.9331</td><td rowspan=1 colspan=1>-38.1438.55</td><td rowspan=1 colspan=1>-0.97580.9769</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>38.1137.8738.29</td><td rowspan=1 colspan=1>0.96020.96040.9615</td><td rowspan=1 colspan=1>33.9233.4334.14</td><td rowspan=1 colspan=1>0.91950.91640.9236</td><td rowspan=1 colspan=1>32.3232.0832.40</td><td rowspan=1 colspan=1>0.90130.89900.9027</td><td rowspan=1 colspan=1>32.9331.4632.99</td><td rowspan=1 colspan=1>0.93510.93010.9446</td><td rowspan=1 colspan=1>39.1037.9139.53</td><td rowspan=1 colspan=1>0.97730.97650.9787</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>33.9033.2734.15</td><td rowspan=1 colspan=1>0.92310.91780.9251</td><td rowspan=1 colspan=1>29.9529.6030.15</td><td rowspan=1 colspan=1>0.83520.82980.8388</td><td rowspan=1 colspan=1>28.8528.6028.99</td><td rowspan=1 colspan=1>0.79960.79360.8021</td><td rowspan=1 colspan=1>27.3026.5227.72</td><td rowspan=1 colspan=1>0.83440.81420.8430</td><td rowspan=1 colspan=1>32.5231.1432.97</td><td rowspan=1 colspan=1>0.93690.92580.9406</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM[21]LUDL-Ours</td><td rowspan=1 colspan=1>33.9333.9234.30</td><td rowspan=1 colspan=1>0.92400.92410.9267</td><td rowspan=1 colspan=1>30.0230.0030.31</td><td rowspan=1 colspan=1>0.83600.83620.8419</td><td rowspan=1 colspan=1>29.0028.8629.10</td><td rowspan=1 colspan=1>0.80100.80000.8047</td><td rowspan=1 colspan=1>27.6127.3728.02</td><td rowspan=1 colspan=1>0.84200.83530.8505</td><td rowspan=1 colspan=1>132.4133.27</td><td rowspan=1 colspan=1>10.93730.9435</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>34.6534.3434.83</td><td rowspan=1 colspan=1>0.92800.92700.9312</td><td rowspan=1 colspan=1>30.5230.2830.69</td><td rowspan=1 colspan=1>0.84620.84120.8497</td><td rowspan=1 colspan=1>29.2529.0729.28</td><td rowspan=1 colspan=1>0.80930.80440.8109</td><td rowspan=1 colspan=1>28.8027.9828.99</td><td rowspan=1 colspan=1>0.86530.87890.8697</td><td rowspan=1 colspan=1>34.1733.3234.63</td><td rowspan=1 colspan=1>0.94760.94320.9502</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.6131.0831.90</td><td rowspan=1 colspan=1>0.88620.87870.8897</td><td rowspan=1 colspan=1>28.2227.8928.37</td><td rowspan=1 colspan=1>0.77210.76700.7755</td><td rowspan=1 colspan=1>27.3027.1227.40</td><td rowspan=1 colspan=1>0.72710.72290.7301</td><td rowspan=1 colspan=1>25.2524.8125.54</td><td rowspan=1 colspan=1>0.75750.74290.7671</td><td rowspan=1 colspan=1>29.3128.1829.77</td><td rowspan=1 colspan=1>0.89070.87620.8967</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.7231.8932.20</td><td rowspan=1 colspan=1>0.88900.89130.8944</td><td rowspan=1 colspan=1>28.2828.3728.60</td><td rowspan=1 colspan=1>0.77300.77720.7819</td><td rowspan=1 colspan=1>27.4427.4127.56</td><td rowspan=1 colspan=1>0.72900.73140.7356</td><td rowspan=1 colspan=1>25.5325.6326.09</td><td rowspan=1 colspan=1>0.76800.77080.7862</td><td rowspan=1 colspan=1>-29.7030.38</td><td rowspan=1 colspan=1>-0.90030.9082</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>32.4632.3232.59</td><td rowspan=1 colspan=1>0.89680.89710.8998</td><td rowspan=1 colspan=1>28.8028.7328.87</td><td rowspan=1 colspan=1>0.78760.78580.7889</td><td rowspan=1 colspan=1>27.7127.6627.78</td><td rowspan=1 colspan=1>0.74200.73950.7431</td><td rowspan=1 colspan=1>26.6426.3526.75</td><td rowspan=1 colspan=1>0.80330.79550.8054</td><td rowspan=1 colspan=1>31.0230.7331.24</td><td rowspan=1 colspan=1>0.91480.91250.9167</td></tr></table>
|
| 190 |
+
|
| 191 |
+
# 4.5 Results with BI Degradation Model
|
| 192 |
+
|
| 193 |
+
For bicubic downsampling (BI), we have compared proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function with GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ on three different SISR networks. The average PSNR and SSIM results in Tab. 5 are cited from corresponding papers or retrained from officially released code. It is easy to see that our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function is superior to GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ in terms of PSNR and SSIM values. Note that the improvements achieved by our proposed method do not bring any additional computation cost during testing time. Comparing EDSR-S ( $. 5 M$ parameters) with EDSR ( $4 3 M$ parameters), our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ can bring lightweight networks with more greater performance improvements than big ones. The visual image comparison results are reported in Fig. 4 and Fig. 5. As shown in Fig. 4, our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ has recovered with fewer visible artifacts (e.g., the circular pattern of the roof and the lines on the glassy surface) than original loss and GRAM [21]. Fig. 4 (f) depicts the uncertainty learned by our ${ \mathcal { L } } _ { \mathrm { U D L } }$ , revealing the challenging pixels with poor reconstruction performance. From Fig. 5, vertical center-line of window has been recover more clear with precisely estimated uncertainty shown in (e) and (f), while DPDNN and DPDNN-GRAM [21] failed to discern shown in (c) and (d) respectively. More visual comparisons can be found in supplementary material.
|
| 194 |
+
|
| 195 |
+
Table 6: Average PSNR and SSIM results for BD degradation on five benchmark datasets. The best performance is shown in bold. Note that ${ \mathcal { L } } _ { \mathrm { U D L } }$ -Ours denotes adopting $\mathcal { L } _ { \mathrm { E S U } }$ at step1 and ${ \mathcal { L } } _ { \mathrm { U D L } }$ at step2 for simplicity.
|
| 196 |
+
|
| 197 |
+
<table><tr><td rowspan=2 colspan=1>Base Model</td><td rowspan=2 colspan=1>Scale</td><td rowspan=2 colspan=1>Loss</td><td rowspan=1 colspan=2>Set5[23]</td><td rowspan=1 colspan=2>Set14 [8]</td><td rowspan=1 colspan=3>BSD100 [24]</td><td rowspan=1 colspan=1>Urban</td><td rowspan=1 colspan=1>00[25]</td><td rowspan=1 colspan=1>Manga</td><td rowspan=1 colspan=1>09[26]</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=2>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.7030.9831.97</td><td rowspan=1 colspan=1>0.89030.87910.8927</td><td rowspan=1 colspan=1>28.3727.8528.45</td><td rowspan=1 colspan=1>0.77780.76670.7793</td><td rowspan=1 colspan=2>27.3727.0527.41</td><td rowspan=1 colspan=1>0.73200.72250.7321</td><td rowspan=1 colspan=1>25.7724.7925.95</td><td rowspan=1 colspan=1>0.77890.74520.7842</td><td rowspan=1 colspan=1>29.8328.1230.18</td><td rowspan=1 colspan=1>0.90140.87730.9053</td></tr><tr><td rowspan=2 colspan=1>DPDNN [3]</td><td rowspan=2 colspan=1>×4</td><td rowspan=2 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=2 colspan=1>31.8631.7532.03</td><td rowspan=2 colspan=1>0.89230.89130.8949</td><td rowspan=2 colspan=1>28.3828.3328.60</td><td rowspan=2 colspan=1>0.77800.77650.7828</td><td rowspan=2 colspan=2>27.3627.3227.48</td><td rowspan=1 colspan=1>0.73110.7302</td><td rowspan=1 colspan=1>25.8225.62</td><td rowspan=1 colspan=1>0.78120.7739</td><td rowspan=1 colspan=1>29.7729.55</td><td rowspan=2 colspan=1>0.90330.90030.9097</td></tr><tr><td rowspan=1 colspan=1>27.48</td><td rowspan=1 colspan=1>0.7355</td><td rowspan=1 colspan=1>26.21</td><td rowspan=1 colspan=1>0.7931</td><td rowspan=1 colspan=1>30.35</td></tr><tr><td rowspan=5 colspan=1>EDSR [2]</td><td rowspan=5 colspan=1>×4</td><td rowspan=5 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=5 colspan=1>32.1732.1332.37</td><td rowspan=5 colspan=1>0.89750.89630.8986</td><td rowspan=5 colspan=1>28.6528.5727.74</td><td rowspan=1 colspan=1>0.7856</td><td rowspan=4 colspan=2>27.5927.49</td><td rowspan=1 colspan=1>0.7400</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td rowspan=3 colspan=1>0.7362</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td rowspan=2 colspan=1>26.5626.19</td><td rowspan=2 colspan=1>0.80430.7916</td><td rowspan=2 colspan=1>30.6630.48</td><td rowspan=3 colspan=1>0.91340.90970.9149</td></tr><tr><td rowspan=1 colspan=1>0.7822</td></tr><tr><td rowspan=1 colspan=1>0.7867</td><td rowspan=1 colspan=2>27.62</td><td rowspan=1 colspan=1>0.7407</td><td rowspan=1 colspan=1>26.65</td><td rowspan=1 colspan=1>0.8065</td><td rowspan=1 colspan=1>30.81</td></tr></table>
|
| 198 |
+
|
| 199 |
+
# 4.6 Results with BD Degradation Model
|
| 200 |
+
|
| 201 |
+
For blur downsampling (BD), we have compared proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function with GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ on three different baseline networks. The average PSNR and SSIM results in Tab. 6 are retrained from officially released code. It is easy to see that our propose ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function is superior to GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ in terms of PSNR and SSIM values. The visual image comparison results of BD degradation are reported in Fig. 6 and Fig. 7. Note that the BD degradation involves Gaussian blur, increasing difficulty in recovering structure patterns. From Fig. 6, we can see that our SR result (Fig. 6 (e)) of $\mathrm { \nabla ^ { \cdot } I m g \ 1 0 9 ^ { \cdot } }$ is the closest to that of the ground-truth. In another challenging image $\mathbf { \dot { \tau } } ^ { \mathrm { \prime } } \mathbf { I m g 0 7 8 } ^ { \prime }$ from Urban100 [25]), our method can recover much more reliable textured details as shown in Fig. 7 (e); while all other methods have severe aliasing artifacts (i.e., distorted tile patterns). The visual quality improvement achieved by ${ \mathcal { L } } _ { \mathrm { U D L } }$ is mainly due to the fact that our proposed method makes full use of the captured uncertainty to train deep networks focusing on the challenging pixels with high uncertainty. More visual comparisons can be found in our supplementary material.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 6: SISR visual quality comparisons of DPDNN [3] with different loss function on ‘Img_109 from Manga109 [26] (blur-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 7: SISR visual quality comparisons of EDSR [2] with different loss function on ‘Img_078’ from Urban100 [25] (blur-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 208 |
+
|
| 209 |
+
# 5 Conclusion
|
| 210 |
+
|
| 211 |
+
In this paper, we propose a new adaptive weighted loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ for SISR to train SISR networks focusing on challenging pixels with high uncertainty (e.g., textured and edge pixels). Specifically, variance estimation is introduced into SISR so that the high-resolution images (mean) and their corresponding uncertainty (variance) can be learned simultaneously. Moreover, modeling uncertainty under Bayesian framework allows us to leverage sparsity prior for a more precise estimation of uncertainty. Ultimately, pixels with large certainty (e.g., texture and edge pixels) will be prioritized for SISR according to their importance to visual quality. For the first time, we demonstrate that such uncertainty-driven loss can achieve better results than $M S E$ or $\mathcal { L } _ { 1 }$ loss. Experimental results on three popular SISR networks show that our proposed uncertainty-driven loss has achieved better PSNR performance than traditional loss functions without any increased computation during testing.
|
| 212 |
+
|
| 213 |
+
# Acknowledgement
|
| 214 |
+
|
| 215 |
+
This work was supported in part by the National Key R&D Program of China under Grant 2018AAA0101400 and the Natural Science Foundation of China under Grant 61991451, Grant 61632019, Grant 61621005, and Grant 61836008. Xin Li’s work is partially supported by the NSF under grants IIS-1951504 and OAC-1940855, the DoJ/NIJ under grant NIJ 2018-75-CX-0032, and the WV Higher Education Policy Commission Grant (HEPC.dsr.18.5).
|
| 216 |
+
|
| 217 |
+
# References
|
| 218 |
+
|
| 219 |
+
[1] Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Learning a deep convolutional network for image super-resolution. In European Conference on Computer Vision, pages 184–199, 2014.
|
| 220 |
+
[2] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 1132–1140, 2017.
|
| 221 |
+
[3] Weisheng Dong, Peiyao Wang, Wotao Yin, Guangming Shi, Fangfang Wu, and Xiaotong Lu. Denoising prior driven deep neural network for image restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(10):2305–2318, 2019.
|
| 222 |
+
[4] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 286–301, 2018.
|
| 223 |
+
[5] Tao Dai, Jianrui Cai, Yongbing Zhang, Shu-Tao Xia, and Lei Zhang. Second-order attention network for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 11065–11074, 2019.
|
| 224 |
+
[6] Qian Ning, Weisheng Dong, Guangming Shi, Leida Li, and Xin Li. Accurate and lightweight image super-resolution with model-guided deep unfolding network. IEEE Journal of Selected Topics in Signal Processing, 15(2):240–252, 2021. doi: 10.1109/JSTSP.2020.3037516.
|
| 225 |
+
[7] Yong Guo, Jian Chen, Jingdong Wang, Qi Chen, Jiezhang Cao, Zeshuai Deng, Yanwu Xu, and Mingkui Tan. Closed-loop matters: Dual regression networks for single image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5407–5416, 2020.
|
| 226 |
+
[8] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In Proceedings of the 7th international conference on Curves and Surfaces, pages 711–730, 2010.
|
| 227 |
+
[9] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision, pages 694–711. Springer, 2016.
|
| 228 |
+
[10] Mario AT Figueiredo. Adaptive sparseness using jeffreys prior. In NIPS, pages 697–704, 2001.
|
| 229 |
+
[11] Qian Ning, Weisheng Dong, Fangfang Wu, Jinjian Wu, Jie Lin, and Guangming Shi. Spatial-temporal gaussian scale mixture modeling for foreground estimation. Proceedings of the AAAI Conference on Artificial Intelligence, 34(07):11791–11798, Apr. 2020. doi: 10.1609/aaai.v34i07.6851. URL https: //ojs.aaai.org/index.php/AAAI/article/view/6851.
|
| 230 |
+
[12] Paul W Goldberg, Christopher KI Williams, and Christopher M Bishop. Regression with input-dependent noise: A gaussian process treatment. Advances in neural information processing systems, 10:493–499, 1997.
|
| 231 |
+
[13] WA Wright. Bayesian approach to neural-network modeling with input uncertainty. IEEE Transactions on Neural Networks, 10(6):1261–1270, 1999.
|
| 232 |
+
[14] Christopher M Bishop and Cazhaow S Qazaz. Regression with input-dependent noise: A bayesian treatment. Advances in neural information processing systems, pages 347–353, 1997.
|
| 233 |
+
[15] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/ 2650d6089a6d640c5e85b2b88265dc2b-Paper.pdf.
|
| 234 |
+
[16] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence, 39 (12):2481–2495, 2017.
|
| 235 |
+
[17] Jie Chang, Zhonghao Lan, Changmao Cheng, and Yichen Wei. Data uncertainty learning in face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5710– 5719, 2020.
|
| 236 |
+
[18] Yingjie Gu, Zhong Jin, and Steve C Chiu. Active learning combining uncertainty and diversity for multi-class image classification. IET Computer Vision, 9(3):400–407, 2015.
|
| 237 |
+
[19] Yichun Shi and Anil K Jain. Probabilistic face embeddings. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6902–6911, 2019.
|
| 238 |
+
[20] Armen Der Kiureghian and Ove Ditlevsen. Aleatory or epistemic? does it matter? Structural safety, 31(2): 105–112, 2009.
|
| 239 |
+
[21] Changwoo Lee and Ki-Seok Chung. Gram: Gradient rescaling attention model for data uncertainty estimation in single image super resolution. In 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pages 8–13. IEEE, 2019.
|
| 240 |
+
[22] Aupendu Kar and Prabir Kumar Biswas. Fast bayesian uncertainty estimation and reduction of batch normalized single image super-resolution network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4957��4966, June 2021.
|
| 241 |
+
[23] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In British Machine Vision Conference 2012, pages 1–10, 2012.
|
| 242 |
+
[24] D. Martin, C. Fowlkes, D. Tal, and J. Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001, volume 2, pages 416–423, 2001.
|
| 243 |
+
[25] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5197–5206, 2015.
|
| 244 |
+
[26] Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools and Applications, 76 (20):21811–21838, 2017.
|
| 245 |
+
[27] Yingqian Wang, Xinyi Ying, Longguang Wang, Jungang Yang, Wei An, and Yulan Guo. Symmetric parallax attention for stereo image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pages 766–775, June 2021.
|
| 246 |
+
[28] Davis Gilton, Gregory Ongie, and Rebecca Willett. Deep equilibrium architectures for inverse problems in imaging. arXiv preprint arXiv:2102.07944, 2021.
|
| 247 |
+
[29] Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, and Lei Zhang. Ntire 2017 challenge on single image super-resolution: Methods and results. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 114–125, 2017.
|
| 248 |
+
[30] Zhou Wang, A.C. Bovik, H.R. Sheikh, and E.P. Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600–612, 2004.
|
| 249 |
+
[31] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. URL http://arxiv.org/abs/1412.6980.
|
md/train/ZEoMBPtvqey/ZEoMBPtvqey.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TransformerFusion: Monocular RGB Scene Reconstruction using Transformers
|
| 2 |
+
|
| 3 |
+
Aljaž Božicˇ 1 Pablo Palafox 1 Justus Thies 1,2 Angela Dai 1 Matthias Nießner 1
|
| 4 |
+
|
| 5 |
+
1Technical University of Munich 2Max Planck Institute for Intelligent Systems, Tübingen, Germany aljazbozic.github.io/transformerfusion
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We introduce TransformerFusion, a transformer-based 3D scene reconstruction approach. From an input monocular RGB video, the video frames are processed by a transformer network that fuses the observations into a volumetric feature grid representing the scene; this feature grid is then decoded into an implicit 3D scene representation. Key to our approach is the transformer architecture that enables the network to learn to attend to the most relevant image frames for each 3D location in the scene, supervised only by the scene reconstruction task. Features are fused in a coarse-to-fine fashion, storing fine-level features only where needed, requiring lower memory storage and enabling fusion at interactive rates. The feature grid is then decoded to a higher-resolution scene reconstruction, using an MLP-based surface occupancy prediction from interpolated coarse-to-fine 3D features. Our approach results in an accurate surface reconstruction, outperforming state-of-the-art multi-view stereo depth estimation methods, fully-convolutional 3D reconstruction approaches, and approaches using LSTM- or GRU-based recurrent networks for video sequence fusion.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Monocular 3D reconstruction is a core task in 3D computer vision, aiming to reconstruct a complete and accurate 3D geometry of an object or an environment from only 2D observations captured by an RGB camera. A geometric understanding is key to applications such as robotic or autonomous vehicle navigation or interaction, as well as model creation and scene editing for augmented and virtual reality. In addition, geometric scene reconstructions form the basis for 3D scene understanding, supporting tasks such as 3D object detection, semantic, and instance segmentation [34, 35, 36, 29, 7, 43, 15, 16].
|
| 14 |
+
|
| 15 |
+
While state-of-the-art SLAM systems [3, 41] achieve robust and scale-accurate camera tracking leveraging both visual and inertial measurements, dense and complete 3D reconstruction of largescale environments from monocular video remains a very challenging problem – particularly for interactive settings. Simultaneously, notable progress has been made on multi-view depth estimation, estimating depth from pairs of images by averaging features extracted from the images in a feature cost volume [42, 17, 19, 38, 13]. Unfortunately, averaging features across a full video sequence can lead to equal-weight treatment of each individual frame, despite some frames possibly containing less information in various regions (e.g., from motion blur, rolling shutter artifacts, very glancing or partial views of objects), making high-fidelity scene reconstruction challenging.
|
| 16 |
+
|
| 17 |
+
Inspired by the recent advances in natural language processing (NLP) that leverage transformer-based models for sequence to sequence modelling [40, 11, 2], we propose a transformer-based method that fuses a sequence of RGB input frames into a 3D representation of a scene at interactive rates. Key to our approach is a learned feature fusion of the video frames using a transformer-based architecture, which learns to attend to the most informative image features to reconstruct a local 3D region of the scene. A new observed RGB frame is encoded into a 2D feature map, and unprojected into a 3D volume, where our transformer learns a fused 3D feature for each location in the 3D volume from the image view features. This enables extraction of the most informative view features for each location in the 3D scene. The 3D features are fused in coarse-to-fine fashion, providing both improved reconstruction performance as well as interactive runtime. These features are then decoded into high-resolution scene geometry with an MLP-based surface occupancy prediction.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: TransformerFusion is an online scene reconstruction method that takes a monocular RGB video as input. The features extracted from each observed image are fused incrementally with a transformer architecture. This fusion approach learns to attend to the most relevant image frames for each 3D location (see view attention color maps of the most relevant frame) achieving state-of-the-art reconstruction results.
|
| 21 |
+
|
| 22 |
+
In summary, our main contributions to achieve robust and accurate scene reconstructions are:
|
| 23 |
+
|
| 24 |
+
• Learned multi-view feature fusion in the temporal domain using a transformer network that attends to only the most informative features of the image views for reconstructing each location in a scene.
|
| 25 |
+
• A coarse-to-fine hierarchy of our transformer-based feature fusion that enables an online reconstruction approach running at interactive frame-rates.
|
| 26 |
+
|
| 27 |
+
# 2 Related Work
|
| 28 |
+
|
| 29 |
+
Multi-view depth estimation. Estimating depth from multi-view image observations has been long-studied in computer vision. COLMAP [37] introduced a patch matching based approach which achieves impressive accuracy and remains established as one of the most popular methods for multiview stereo. While COLMAP offers robust depth estimation for distinctive features in images, the patch matching struggles to densely reconstruct areas without many distinctive color features, such as floor and walls. Recently, learning-based approaches that build data-driven priors from large-scale datasets have improved depth estimation in these challenging scenarios. Some proposed methods rely only on a 2D network with multiple images concatenated as input [42]. Several recent approaches instead build a shared 3D feature cost volume in reference camera space using feature averaging [13, 17, 19, 25, 26]. These approaches estimate the reference frame’s depth within a local window of frames, but some also propagate information from previously estimated depth maps by using probabilistic filtering [25], a Gaussian process [17], or an LSTM bottleneck layer [13]. Such multi-view depth estimation approaches predict single-view depth maps, which must be fused together to construct a geometric 3D representation of the observed scene.
|
| 30 |
+
|
| 31 |
+
3D reconstruction from monocular RGB input. Multi-view depth estimation approaches can be combined with depth fusion approaches, such as volumetric fusion [6], to obtain a volumetric reconstruction of the observed scene. MonoFusion [33] is one of the first methods using depth estimate from a real-time variant of PatchMatch stereo [1]. However, fusing noisy depth estimates causes artifacts in the 3D reconstruction, which lead to the development of recent approaches that directly predict the 3D surface reconstruction instead of per-frame depth estimates. One of the first approaches to predict 3D surface occupancy from two input RGB images is SurfaceNet [20], which converts volumetrically averaged colors into 3D surface occupancies using a 3D convolutional network. Atlas [28] extends this approach to a multi-view setting, while also leveraging learned features instead of colors. Recently, NeuralRecon [39] proposed a real-time 3D reconstruction framework, adding GRU units distributed in 3D to fuse reconstructions from different local windows of frames. Our approach also fuses together learned features from RGB frame input in an online fashion, but our transformer-based multi-view feature fusion enables relying only on the most informative features from the observed frames for a particular spatial location in the reconstructed scene, producing more accurate 3D reconstructions.
|
| 32 |
+
|
| 33 |
+
Transformers in computer vision. The transformer architecture [40] has achieved profound impact in many computer vision tasks in addition to its natural language processing origins. For a detailed survey, we refer the reader to [22]. In computer vision, transformers have been leveraged successfully for tasks such as object detection [4], video classification [44], image classification [12], image generation [30], and human reconstruction [45]. In this work, we propose transformer-based feature fusion for 3D scene reconstruction from a monocular video. Given a sequence of observed RGB frames, our approach learns to attend to the most informative features from each image to predict a dense occupancy field.
|
| 34 |
+
|
| 35 |
+
# 3 End-to-end 3D Reconstruction using Transformers
|
| 36 |
+
|
| 37 |
+
Given a set of $N$ RGB images $\mathrm { I } _ { i } \in \mathbb { R } ^ { W \times H \times 3 }$ of a scene with corresponding camera intrinsic parameters ${ \bf K } _ { i } \in \mathbb { R } ^ { 3 \times 3 }$ and extrinsic poses $\mathbf { P } _ { i } \in \mathbb { R } ^ { 4 \times 4 }$ , our method reconstructs the scene geometry by predicting occupancy values $o \in [ 0 , 1 ]$ for every 3D point in the scene. Fig. 2 shows an overview of our approach. Each input image $\mathrm { I } _ { i }$ is processed by a 2D convolutional encoder $\Theta$ , extracting coarse and fine image features ( $\Phi _ { i } ^ { c }$ and $\Phi _ { i } ^ { f }$ , respectively):
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\Theta : \operatorname { I } _ { i } \in \mathbb { R } ^ { W \times H \times 3 } \mapsto ( \Phi _ { i } ^ { c } , \Phi _ { i } ^ { f } )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
From these 2D image features, we construct a 3D feature grid in world space. To this end, we regularly sample grid points in 3D at a coarse resolution of every $v _ { c } = 3 0 \mathrm { c m }$ and a fine resolution of $v _ { f } = 1 0 \mathrm { c m }$ . For these coarse and fine sample points, we query corresponding 2D features in all $N$ images and predict fused coarse $\psi ^ { c }$ and fine 3D features $\psi ^ { f }$ using transformer networks [40]:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l } & { \mathcal T _ { c } : ( \Phi _ { 1 } ^ { c } , \dots , \Phi _ { N } ^ { c } ) \mapsto ( \psi ^ { c } , w ^ { c } ) } \\ & { } \\ & { \mathcal T _ { f } : ( \Phi _ { 1 } ^ { f } , \dots , \Phi _ { N } ^ { f } ) \mapsto ( \psi ^ { f } , w ^ { f } ) } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Note that we also store the intermediate attention weights $w ^ { c }$ and $w ^ { f }$ of the first transformer layers for efficient view selection, which is explained in Sec. 3.4.
|
| 50 |
+
|
| 51 |
+
To further improve the features in the 3D spatial domain, we apply 3D convolutional networks $\mathcal { C } _ { c }$ and $\mathcal { C } _ { f }$ , at the coarse and fine level, respectively:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \mathcal { C } _ { c } : \{ \psi ^ { c } \} _ { C \times C \times C } \mapsto \{ \tilde { \psi } ^ { c } \} _ { C \times C \times C } } \\ & { \mathcal { C } _ { f } : \{ ( \tilde { \psi } ^ { c } , \psi ^ { f } ) \} _ { F \times F \times F } \mapsto \{ \tilde { \psi } ^ { f } \} _ { F \times F \times F } } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Finally, to predict the scene geometry occupancy for a point $\mathbf { p } \in \mathbb { R } ^ { 3 }$ , the coarse $\tilde { \psi } _ { c }$ and fine features $\tilde { \psi } _ { f }$ are trilinearly interpolated and a multi-layer perceptron $s$ maps these features to occupancies:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
S : ( \tilde { \psi } ^ { c } , \tilde { \psi } ^ { f } ) \mapsto o \in [ 0 , 1 ]
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
This extraction of surface occupancies is inspired by convolutional occupancy networks [32] and IFNets [5]. From this occupancy field we extract a surface mesh with Marching cubes [27]. Note that in addition to surface occupancy, we also predict occupancy masks for near-surface locations at the coarse and fine levels. These masks are used for coarse-to-fine surface filtering (see Sec. 3.2), which improves reconstruction performance with a focus on the surface geometry prediction and enables interactive runtime.
|
| 64 |
+
|
| 65 |
+
We train our approach in end-to-end fashion by supervising the surface occupancy predictions using the following loss:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathcal { L } = \mathcal { L } _ { c } + \mathcal { L } _ { f } + \mathcal { L } _ { o } ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\mathcal { L } _ { c }$ and $\mathcal { L } _ { f }$ denote binary cross-entropy (BCE) losses on occupancy mask predictions for near-surface locations at the coarse and fine levels, respectively (see Sec. 3.2), and $\mathcal { L } _ { o }$ denotes a BCE loss for surface occupancy prediction (see Sec. 3.3).
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 2: Method overview: given multiple input images, we compute coarse and fine level features. Using a transformer architecture, we separately fuse these coarse and fine features in a voxel grid. To improve the spatial features, we use a refinement network for both the coarse and the fine features. From these feature grids, we extract an occupancy field using a lightweight MLP.
|
| 75 |
+
|
| 76 |
+
# 3.1 Learning Temporal Feature Fusion via Transformers
|
| 77 |
+
|
| 78 |
+
For a spatial location $ { \mathbf { p } } \in \mathbb { R } ^ { 3 }$ in the scene reconstruction, we learn to fuse coarse $\psi ^ { c }$ and fine level features $\psi ^ { f }$ from the $N$ coarse and fine feature images $\Phi _ { i } ^ { c }$ and $\Phi _ { i } ^ { f }$ , respectively), which are extracted by the 2D encoder $\Theta$ . Specifically, we train two instances of a transformer model, one for fusing coarse-level features $\psi ^ { c }$ and one for fusing fine-level features $\psi ^ { f }$ . Both transformers $\mathcal { T } _ { c }$ and $\mathcal { T } _ { f }$ share the same architecture. Thus, for simplicity, we omit the coarse and fine notation in the following.
|
| 79 |
+
|
| 80 |
+
Our transformer model $\tau$ is independently applied to each sample point in world space. For a point p, the transformer network takes a series of 2D features $\phi _ { i }$ as input that are bilinearly sampled from the feature maps $\Phi _ { i }$ at the corresponding projective image location. The projective image location is computed via a full-perspective projection $\Pi _ { i } ( \mathbf { p } ) = \pi ( \mathbf { K } _ { i } ( \mathbf { R } _ { i } \mathbf { p } + \mathbf { t } _ { i } ) )$ , assuming known camera intrinsics $\mathbf { K } _ { i }$ and extrinsics $\mathbf { P } _ { i } = ( \mathbf { R } _ { i } , \mathbf { t } _ { i } )$ . To inform the transformer about invalid features (i.e., a sample point is projected outside an image), we also provide the pixel validity $v _ { i } \in \{ 0 , 1 \}$ as input. In addition to these 2D features $\phi _ { i }$ , we concatenate the projected depth $d _ { i } = ( \mathbf { R } _ { i } \mathbf { p } + \mathbf { t } _ { i } ) _ { z }$ , and the viewing ray $\mathbf { r _ { i } } = ( \mathbf { p } - \mathbf { c } _ { i } ) / | | \mathbf { p } - \mathbf { c } _ { i } | | _ { 2 }$ to the input $( \mathbf { c } _ { i } \in \mathbb { R } ^ { 3 }$ denoting the camera center of view $\ddot { \iota }$ ). These input features are converted to an embedding vector $\theta _ { i } \in \mathbb { R } ^ { \mathbf { \bar { D } } }$ using a linear layer $\theta _ { i } = \mathbf { F C N } ( \phi _ { i } , d _ { i } \overline { { , } } v _ { i } , \mathbf { r _ { i } } )$ , before feeding it into the transformer network that then predicts a fused feature $\boldsymbol { \psi } \in \mathbb { R } ^ { D }$ :
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathcal { T } : ( \theta _ { 1 } , \dots , \theta _ { N } ) \mapsto ( \psi , w )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
As described above, $w$ denotes the attention values of the initial attention layer, which are used for view selection to speed-up fusion (see Sec. 3.4).
|
| 87 |
+
|
| 88 |
+
Transformer architecture. We followed [12] when designing the transformer architecture $\tau$ It consists of 8 modules of feed-forward and attention layers, using multi-head attention with 4 attention heads and embedding dimension $D = 2 5 6$ . Feed-forward layers process the temporal inputs independently, and contain ReLU activation, linear layers with residual connection, and layer norm.
|
| 89 |
+
|
| 90 |
+
The model returns both fused feature $\boldsymbol { \psi } \in \mathbb { R } ^ { D }$ and attention weights $w \in \mathbb { R } ^ { N }$ over all temporal inputs from the initial attention layer that are later used for selecting which views to maintain over longer sequences of input image views.
|
| 91 |
+
|
| 92 |
+
# 3.2 Spatial Feature Refinement
|
| 93 |
+
|
| 94 |
+
While the transformer network fuses 2D observations in the temporal domain, we additionally imbue explicit spatial reasoning by applying a 3D CNN to spatially refine the fused features $\{ \psi ^ { c } \} _ { C \times C \times C }$ and $\{ \psi ^ { f } \} _ { F \times F \times F }$ that are computed by the transformers $\mathcal { T } _ { c }$ and $\mathcal { T } _ { f }$ on the coarse and fine grid, respectively. The coarse features $\{ \psi ^ { c } \} _ { C \times C \times C }$ are refined by a 3D CNN $\mathcal { C } _ { c }$ consisting of 3 residual blocks that maintain the same spatial resolution and produce refined features $\{ \tilde { \psi } ^ { c } \} _ { C \times C \times C }$ . These features are upsampled to a fine grid resolution using nearest-neighbor upsampling, and concatenated with fused features at fine level $\{ \psi ^ { f } \} _ { F \times F \times F }$ . A fine-level 3D CNN $\mathcal { C } _ { f }$ is then applied to the concatenated features, resulting in refined fine features $\{ \tilde { \psi } ^ { f } \} _ { F \times F \times F }$ . Both, coarse $\tilde { \psi } ^ { c }$ and fine features $\tilde { \psi } ^ { f }$ are used for surface occupancy prediction.
|
| 95 |
+
|
| 96 |
+
Coarse-to-fine surface filtering. The refined features are also used to predict occupancy masks for near-surface locations at both coarse and fine levels, thus, filtering out free-space regions and sparsifying the volume, such that the higher-resolution and computationally expensive fine-scale surface extraction is performed only in regions close to the surface. To achieve this, additional 3D CNN layers $\mathcal { M } _ { c }$ and $\mathcal { M } _ { f }$ are applied to the refined features, outputting a near-surface mask $m ^ { c } , m ^ { f } \in [ 0 , 1 ]$ for every grid point:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { l } { { \mathcal { M } _ { c } : \{ \tilde { \psi } ^ { c } \} _ { C \times C \times C } \mapsto \{ m ^ { c } \} _ { C \times C \times C } } } \\ { { \mathcal { M } _ { f } : \{ \tilde { \psi } ^ { f } \} _ { F \times F \times F } \mapsto \{ m ^ { f } \} _ { F \times F \times F } } } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Only spatial regions where both $m ^ { c }$ and $m ^ { f }$ are larger than 0.5, i.e., close to the surface, are processed further to compute the final surface reconstruction; other regions are determined to be free space. This improves the overall reconstruction performance by focusing the capacity of the surface prediction network to close-to-the-surface regions and enables a significant runtime speed-up.
|
| 103 |
+
|
| 104 |
+
Intermediate supervision of near-surface masks generated from the ground truth scene reconstru $m ^ { c }$ and n, de $m ^ { f }$ is employed using masks ng the grid point as near-s $m _ { \mathrm { g t } } ^ { c }$ and e if t $m _ { \mathrm { g t } } ^ { f }$ exists ground truth surface in the radius of $v _ { c }$ or $v _ { f }$ from the point. Binary cross entropy losses $\mathcal { L } _ { c } = \mathrm { B C E } ( m ^ { c } , m _ { \mathrm { g t } } ^ { c } )$ and $\mathcal { L } _ { f } = \mathrm { B C E } ( m ^ { f } , m _ { \mathrm { g t } } ^ { f } )$ are applied.
|
| 105 |
+
|
| 106 |
+
# 3.3 Surface Occupancy Prediction
|
| 107 |
+
|
| 108 |
+
The final surface reconstruction is predicted by decoding the coarse and fine feature grids to occupancy values $o \in [ 0 , 1 ]$ , with values $o \geq 0 . 5$ representing occupied points and values $o < 0 . 5$ representing free-space points. For a point $\mathbf { p } \in \mathbf { \bar { \mathbb { R } } ^ { 3 } }$ , we compute its feature representation by trilinearly interpolating coarse and fine grid features:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r } { \psi _ { \mathbf { p } } ^ { c } = \mathrm { T r i l i n e a r } ( \mathbf { p } , \{ \tilde { \psi } ^ { c } \} _ { C \times C \times C } ) } \\ { \psi _ { \mathbf { p } } ^ { f } = \mathrm { T r i l i n e a r } ( \mathbf { p } , \{ \tilde { \psi } ^ { f } \} _ { F \times F \times F } ) } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We concatenate the interpolated features and predict the point’s occupancy as $o = S ( \psi _ { \mathbf { p } } ^ { c } , \psi _ { \mathbf { p } } ^ { f } )$ , where $s$ is a multi-layer perceptron (MLP) with 3 modules of feed-forward layers, containing ReLU activation, linear layer with residual connection, and layer norm.
|
| 115 |
+
|
| 116 |
+
Surface occupancy supervision. We train on $1 . 5 \times 1 . 5 \times 1 . 5 \ : \mathrm { m }$ volumetric chunks of scenes for training efficiency. To supervise the surface occupancy loss, 1k points are sampled inside the chunk, with $8 \hat { 0 } \%$ of samples drawn from a truncation region at most $1 0 ~ \mathrm { c m }$ from the surface, and $2 0 \%$ sampled uniformly inside the chunk. Ground truth occupancy values ${ \cal O } _ { \mathrm { g t } }$ are computed using the ScanNet RGB-D reconstructions [8]. For uniform samples it is straightforward to generate unoccupied point samples by sampling points in free space in front of the visible surface, but it is unknown whether a point sample is occupied when it lies behind seen surfaces. In order to prevent artifacts behind walls, we follow the data processing applied in [28] and additionally label point samples as occupied, if they are sampled in areas where an entire vertical column of voxels is occluded in the scene. A binary cross entropy loss $\mathcal { L } _ { o } = \mathrm { B C E } ( o , o _ { \mathrm { g t } } )$ is then applied to the occupancy predictions $o$
|
| 117 |
+
|
| 118 |
+
# 3.4 View Selection for Online Scene Reconstruction
|
| 119 |
+
|
| 120 |
+
We aim to consider all $N$ frames as input to our transformer for each 3D location in a scene; however, this becomes extremely computationally expensive with long videos or large-scale scenes, which prohibits online scene reconstruction. Instead, we proceed with the reconstruction incrementally, processing every video frame one-by-one, while keeping only a small number $K = 1 6$ of measurements for every 3D point. We visualize this online approach in Fig. 1.
|
| 121 |
+
|
| 122 |
+
During training, for efficiency, we use only $K _ { t }$ random images for each training volume. At test time, we leverage the attention weights $w ^ { c }$ and $w ^ { f }$ of the initial transformer layers to determine which views to keep in the set of $K$ measurements. Specifically, for a new RGB frame, we extract its 2D features, and run feature fusion for every coarse and fine grid point inside the camera frustum. This returns the fused feature and also the attention weights over all currently accumulated input measurements. Whenever the maximum number of $K$ measurements is reached, a selection is made by dropping out a measurement with lowest attention weight before adding new measurements in the latest frame. This guarantees a low number of input measurements, speeding up fusion processing times considerably. Furthermore, by using coarse-to-fine filtering, described in Sec. 3.2, we can further accelerate fusion by only considering higher resolution points in the area near the estimated surface. Together with incremental processing that results in high performance benefits, our approach performs per-frame feature fusion at about 7 FPS despite an unoptimized implementation.
|
| 123 |
+
|
| 124 |
+
# 3.5 Training Scheme
|
| 125 |
+
|
| 126 |
+
Our approach has been implemented using the PyTorch library [31]. The architecture details of the used networks are specified in the supplemental document. To train our approach we use ScanNet dataset [8], an RGB-D dataset of indoor apartments. We follow the established train-val-test split. For training, we randomly sample $1 . 5 \times 1 . 5 \times 1 . 5 \ : \mathrm { m }$ volume chunks of the train scenes, sampling less chunks in free space and more samples in areas with non-structural objects, i.e. not only consisting of floor or walls. This results in $\approx 1 6 5 \mathrm { k }$ training chunks. For each chunk, we randomly sample $K _ { t } = 8$ RGB images among all frames that include the chunk in their camera frustums.
|
| 127 |
+
|
| 128 |
+
The 2D convolutional encoder $\Theta$ for image feature extraction is implemented as a ResNet-18 [14] network, pre-trained on ImageNet [24]. During training, a batch size of 4 chunks is used with an Adam [23] optimizer with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , $\epsilon = 1 \bar { 0 } ^ { - 8 }$ and weight regularization of $1 0 ^ { - 4 }$ . We use a learning rate of $1 0 ^ { - 4 }$ with 5k warm-up steps at initialization, and square root learning rate decay afterwards. When computing the losses of coarse and fine surface filtering predictions, a higher weight of 2.0 is applied to near-surface voxels, to increase recall and improve overall robustness. Training takes about 30 hours using an Intel Xeon 6242R Processor and an Nvidia RTX 3090 GPU.
|
| 129 |
+
|
| 130 |
+
# 4 Experiments
|
| 131 |
+
|
| 132 |
+
Metrics. To evaluate our monocular scene reconstruction, we use several measures of reconstruction performance. We evaluate geometric accuracy and completion, with accuracy measuring the average point-to-point error from predicted to ground truth vertices, completion measuring the error in the opposite direction, and chamfer as the average of accuracy and completion (in cm). To account for possibly different mesh resolutions among methods, we uniformly sample $2 0 0 \mathrm { k }$ points over mesh faces of every reconstructed mesh. Additionally, we threshold these point-to-point errors and compute precision and recall by computing the ratio of point-to-point matches within distance $\leq 5$ cm. Since it is easy to maximize either precision (by predicting only a few but accurate points) or recall (by over-completing reconstructions with noisy surface), we found the most reliable metric to be F-score, determined by both precision and recall.
|
| 133 |
+
|
| 134 |
+
Our ground truth reconstructions are obtained by automated 3D reconstruction [9] from RGB-D videos of real-world environments and, thus, they are often incomplete due to unobserved and occluded regions in the scene. To avoid penalizing methods for reconstructing a more complete scene w.r.t. the available ground truth, we apply an additional occlusion mask at evaluation.
|
| 135 |
+
|
| 136 |
+
As most state of the art, particularly for depth estimation, rely on a pre-sampled set of keyframes (based on sufficient translation or rotation difference between camera poses), we evaluate all approaches based on sequences of sampled keyframes, using the keyframe selection of [13].
|
| 137 |
+
|
| 138 |
+
Table 1: Quantitative comparison with baselines and ablations on test set of Scannet dataset [8].
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Method</td><td>Acc↓</td><td>Compl↓</td><td>Chamfer↓</td><td>Prec ↑</td><td>Recall 个</td><td>F-score ↑</td></tr><tr><td>RevisitingSI[18]</td><td>14.29</td><td>16.19</td><td>15.24</td><td>0.346</td><td>0.293</td><td>0.314</td></tr><tr><td>MVDepthNet [42]</td><td>12.94</td><td>8.34</td><td>10.64</td><td>0.443</td><td>0.487</td><td>0.460</td></tr><tr><td>GPMVS [17]</td><td>12.90</td><td>8.02</td><td>10.46</td><td>0.453</td><td>0.510</td><td>0.477</td></tr><tr><td>ESTDepth [26]</td><td>12.71</td><td>7.54</td><td>10.12</td><td>0.456</td><td>0.542</td><td>0.491</td></tr><tr><td>DPSNet[19]</td><td>11.94</td><td>7.58</td><td>9.77</td><td>0.474</td><td>0.519</td><td>0.492</td></tr><tr><td>DELTAS [38]</td><td>11.95</td><td>7.46</td><td>9.71</td><td>0.478</td><td>0.533</td><td>0.501</td></tr><tr><td>DeepVideoMVS[13]</td><td>10.68</td><td>6.90</td><td>8.79</td><td>0.541</td><td>0.592</td><td>0.563</td></tr><tr><td>COLMAP [37]</td><td>10.22</td><td>11.88</td><td>11.05</td><td>0.509</td><td>0.474</td><td>0.489</td></tr><tr><td>NeuralRecon [39]</td><td>5.09</td><td>9.13</td><td>7.11</td><td>0.630</td><td>0.612</td><td>0.619</td></tr><tr><td>Atlas [28]</td><td>7.16</td><td>7.61</td><td>7.38</td><td>0.675</td><td>0.605</td><td>0.636</td></tr><tr><td>Ours: w/o TRSF,avg</td><td>7.23</td><td>9.74</td><td>8.48</td><td>0.635</td><td>0.501</td><td>0.557</td></tr><tr><td>Ours: :w/o TRSF,weight</td><td>6.11</td><td>11.12</td><td>8.61</td><td>0.686</td><td>0.512</td><td>0.583</td></tr><tr><td>Ours: W/o TRSF, conv</td><td>6.56</td><td>9.84</td><td>8.20</td><td>0.661</td><td>0.524</td><td>0.582</td></tr><tr><td>Ours: w/o spatial ref.</td><td>10.46</td><td>16.91</td><td>13.68</td><td>0.479</td><td>0.295</td><td>0.361</td></tr><tr><td>Ours: w/o C2F filter</td><td>6.57</td><td>7.69</td><td>7.13</td><td>0.678</td><td>0.592</td><td>0.631</td></tr><tr><td>Ours: w/o proj. depth</td><td>8.06</td><td>10.02</td><td>9.04</td><td>0.594</td><td>0.475</td><td>0.525</td></tr><tr><td>Ours: w/o viewing ray</td><td>5.71</td><td>8.59</td><td>7.15</td><td>0.706</td><td>0.559</td><td>0.621</td></tr><tr><td>Ours: 30 cm voxel size</td><td>7.92</td><td>17.33</td><td>12.63</td><td>0.491</td><td>0.258</td><td>0.335</td></tr><tr><td>Ours: 15 cm 1 voxel size</td><td>5.79</td><td>9.62</td><td>7.71</td><td>0.686</td><td>0.520</td><td>0.589</td></tr><tr><td>Ours:4 images,RND</td><td>8.01</td><td>10.28</td><td>9.15</td><td>0.587</td><td>0.445</td><td>0.502</td></tr><tr><td>Ours: 4 images</td><td>6.80</td><td>8.40</td><td>7.60</td><td>0.661</td><td>0.524</td><td>0.581</td></tr><tr><td>Ours: 8 images, RND</td><td>6.74</td><td>8.55</td><td>7.64</td><td>0.665</td><td>0.544</td><td>0.596</td></tr><tr><td>Ours: 8 images</td><td>6.17</td><td>7.69</td><td>6.93</td><td>0.704</td><td>0.584</td><td>0.636</td></tr><tr><td>Ours: 16 images, RND</td><td>5.80</td><td>8.56</td><td>7.18</td><td>0.711</td><td>0.584</td><td>0.638</td></tr><tr><td>Ours</td><td>5.52</td><td>8.27</td><td>6.89</td><td>0.728</td><td>0.600</td><td>0.655</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 4.1 Comparison with State of the Art
|
| 143 |
+
|
| 144 |
+
In Tab. 1, we compare our approach with state-of-the-art methods. All methods are trained on the ScanNet dataset [8], using the official train/val/test split. We use the pre-trained models provided by the authors for MVDepthNet [42], GPMVS [17] and DPSNet [19] which are fine-tuned on ScanNet. For baselines that predict depth in a reference camera frame instead of directly reconstructing 3D surface, a volumetric fusion method [6] is used to fuse different depth maps into a 3D truncated signed distance field. The single-view depth prediction method RevisitingSI [18] suffers from the more challenging task formulation without the use of multiple views, leading to noisier depth predictions and inconsistencies between frames. Multi-view depth estimation methods leverage the additional view information for improved performance, with the LSTM-based approach of DeepVideoMVS [13] achieving the best performance among these approaches. Reconstruction quality further improves with methods that directly predict the 3D surface geometry, such as NeuralRecon [39] and Atlas [28]. Our transformer-based feature fusion approach enables more robust reconstruction and outperforms all existing methods in both chamfer distance and F-score. The performance improvement can also be clearly seen in the qualitative comparisons in Fig. 3.
|
| 145 |
+
|
| 146 |
+
# 4.2 Ablations
|
| 147 |
+
|
| 148 |
+
To demonstrate the effectiveness of our design choices, we conducted a quantitative ablation study which is shown in Tab. 1 and discussed in the following.
|
| 149 |
+
|
| 150 |
+
What is the impact of learning to fuse features from different views with transformers? We evaluate the effect of our learned feature fusion by replacing the transformer blocks with a multi-layer perceptron (MLP) that processes input image observations independently. The per-view outputs of this MLP are fused using an average (w/o TRSF, avg) or using a weighted average with weights predicted by the MLP (w/o TRSF, weight). Additionally, we implemented convolutional feature fusion, using a 1-dimensional CNN that processes features in temporal domain and predicts fused features (w/o TRSF, conv). We find that our transformer-based view fusion effectively learns to attend to the most informative views for a specific location, resulting in significantly improved performance over these feature fusion alternatives.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 3: Qualitative comparison of scene reconstructions on test set of ScanNet dataset [8]; note that only RGB input is used by each method while the ground truth is reconstructed using the input depth.
|
| 154 |
+
|
| 155 |
+
Does spatial feature refinement help reconstruction performance? Spatial feature refinement is indeed very important for reconstruction quality. It enables the model to aggregate feature information in spatial domain and produce more spatially consistent and complete reconstructions, without it (w/o spatial ref.) the geometry completion (and recall metric) are considerably worse.
|
| 156 |
+
|
| 157 |
+
How important is coarse-to-fine filtering? Predicting the coarse and fine near-surface masks provides an additional performance improvement compared to the model without it (w/o C2F filter), as it allows more focus on surface geometry. Furthermore, this enables a speed-up of the fusion runtime by a factor of approximately 3.5, resulting in processing times of 7 FPS (instead of 2 FPS).
|
| 158 |
+
|
| 159 |
+
Are additional inputs to the transformer networks needed? Existing reconstruction approaches [39, 28] aggregate 2D features using a simple average operation. In comparison, our approach uses a transformer to learn the feature fusion. That makes it possible to use additional inputs that don’t support a straight-forward average operation, but could be very informative for the task of multi-view surface reconstruction, such as projected depth and viewing ray. In Tab. 1 we conducted an additional quantitative ablation study w.r.t. the input to the transformer networks. Both the projected depth as well as the view ray help the transformer to better fuse the features for the task of 3D reconstruction.
|
| 160 |
+
|
| 161 |
+
How does voxel size of feature grids influence reconstruction performance? We compared the reconstruction performance when using different voxel sizes for the feature grid. We only varied fine feature grid resolution, voxel size of coarse grid was always $3 0 \mathrm { c m }$ . More specifically, we replaced the voxel size of $1 0 \mathrm { c m }$ at the fine grid level with $3 0 \mathrm { c m }$ and $1 5 \mathrm { { c m } }$ . In both cases, the performance decreased considerably; i.e., the higher the resolution, the better the results. That is reflected also in qualitative comparison in the supplemental document.
|
| 162 |
+
|
| 163 |
+
How many views should be used for feature fusion? In our experiments, we use a limited number of $K = 1 6$ frame observations to inform the feature for every 3D grid location. We find that these views all contribute, with performance degrading somewhat with sparser sets of observations $K = 8$ or $K = 4$ ). The number of frames is limited because of execution time and memory consumption for bigger scenes.
|
| 164 |
+
|
| 165 |
+
How effective is frame selection using attention weights? The $K$ frames for each 3D grid feature are selected based on the computed attention weights and are updated during scanning. To evaluate this frame selection, we compare against a frame selection scheme that randomly selects frames that observe the 3D location (RND), which results in a noticeable drop in performance for both chamfer and F-score. The performance difference is even larger when using less views for fusion $K = 8$ or $K = 4$ ), where view selection becomes even more important. In Fig. 1, we visualize the most important view for locations in the scene, selected by the highest attention weight. Relatively smooth transitions between selected views among neighboring 3D locations suggest that view selection is spatially consistent. To illustrate the frame selection, we also visualize all selected frames with corresponding attention weights for specific 3D locations in the supplemental document.
|
| 166 |
+
|
| 167 |
+
# 4.3 Limitations
|
| 168 |
+
|
| 169 |
+
Under severe occlusions and partial observation of the scene, our method can struggle to reconstruct details of certain objects, such as chair legs, monitor stands, or books on the shelves. Furthermore, transparent objects, such as glass windows without frames, are often inaccurately reconstructed as empty space. We show qualitative examples of these failure cases in Fig. 4. These challenging scenarios are often not properly reconstructed even when using ground truth RGB-D data, and we believe that using self-supervised losses [10] for monocular scene reconstruction could be an interesting future research direction. Additionally, higher resolution geometric fidelity could potentially be achieved by sparse operations in 3D or learning local geometric priors on detailed synthetic data [21].
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 4: Limitations of our approach are the lack of detail at partially observed and occluded objects, and inaccurate reconstruction of transparent surfaces, such as glass windows.
|
| 173 |
+
|
| 174 |
+
# 5 Conclusion
|
| 175 |
+
|
| 176 |
+
We introduced TransformerFusion for monocular 3D scene reconstruction, leveraging a new transformer-based approach for online feature fusion from RGB input views. A coarse-to-fine formulation of our transformer-based feature fusion improves the effective reconstruction performance as well as the runtime. Our feature fusion learns to exploit the most informative image view features for geometric reconstruction, achieving state-of-the-art reconstruction performance. We believe that our interactive scanning approach provides exciting avenues for future research, and enables new possibilities in learning multi-view perception and 3D scene understanding.
|
| 177 |
+
|
| 178 |
+
# Broader Impact
|
| 179 |
+
|
| 180 |
+
Our work proposes a novel monocular scene reconstruction approach that can be used for applications in the field of augmented and virtual reality, and also serves as a basis for 3D scene understanding from monocular RGB input, enabling navigation of autonomous agents in unknown environments. Being a building block for these applications, we need to be aware of the potential negative societal impacts of some applications, such as the improper use of autonomous robots in military, or labor market disruptions as a consequence of job automation. Since our approach is data-driven, using RGB-D data as supervision, we also need to be aware of related privacy concerns when capturing new datasets for 3D reconstruction.
|
| 181 |
+
|
| 182 |
+
# Acknowledgments
|
| 183 |
+
|
| 184 |
+
This project is funded by the Bavarian State Ministry of Science and the Arts and coordinated by the Bavarian Research Institute for Digital Transformation (bidt), a TUM-IAS Rudolf Mößbauer Fellowship, the ERC Starting Grant Scan2CAD (804724), and the German Research Foundation (DFG) Grant Making Machine Learning on Static and Dynamic 3D Data Practical.
|
| 185 |
+
|
| 186 |
+
# References
|
| 187 |
+
|
| 188 |
+
[1] M. Bleyer, C. Rhemann, and C. Rother. Patchmatch stereo-stereo matching with slanted support windows. In Bmvc, volume 11, pages 1–11, 2011.
|
| 189 |
+
[2] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 190 |
+
[3] C. Campos, R. Elvira, J. J. G. Rodríguez, J. M. Montiel, and J. D. Tardós. Orb-slam3: An accurate open-source library for visual, visual-inertial and multi-map slam. arXiv preprint arXiv:2007.11898, 2020.
|
| 191 |
+
[4] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229. Springer, 2020.
|
| 192 |
+
[5] J. Chibane, T. Alldieck, and G. Pons-Moll. Implicit functions in feature space for 3d shape reconstruction and completion. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, jun 2020.
|
| 193 |
+
[6] B. Curless and M. Levoy. A volumetric method for building complex models from range images. In Proceedings of the 23rd annual conference on Computer graphics and interactive techniques, pages 303–312, 1996.
|
| 194 |
+
[7] A. Dai and M. Nießner. 3dmv: Joint 3d-multi-view prediction for 3d semantic scene segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 452–468, 2018.
|
| 195 |
+
[8] A. Dai, A. X. Chang, M. Savva, M. Halber, T. Funkhouser, and M. Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5828–5839, 2017.
|
| 196 |
+
[9] A. Dai, M. Nießner, M. Zollhöfer, S. Izadi, and C. Theobalt. Bundlefusion: Real-time globally consistent 3d reconstruction using on-the-fly surface reintegration. ACM Transactions on Graphics (ToG), 36(4):1, 2017.
|
| 197 |
+
[10] A. Dai, C. Diller, and M. Nießner. Sg-nn: Sparse generative neural networks for self-supervised scene completion of rgb-d scans. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 849–858, 2020.
|
| 198 |
+
[11] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 199 |
+
[12] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 200 |
+
[13] A. Düzçeker, S. Galliani, C. Vogel, P. Speciale, M. Dusmanu, and M. Pollefeys. Deepvideomvs: Multi-view stereo on video with recurrent spatio-temporal fusion, 2020.
|
| 201 |
+
[14] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 202 |
+
[15] J. Hou, A. Dai, and M. Nießner. 3d-sis: 3d semantic instance segmentation of rgb-d scans. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4421–4430, 2019.
|
| 203 |
+
[16] J. Hou, A. Dai, and M. Nießner. Revealnet: Seeing behind objects in rgb-d scans. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2098–2107, 2020.
|
| 204 |
+
[17] Y. Hou, J. Kannala, and A. Solin. Multi-view stereo by temporal nonparametric fusion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2651–2660, 2019.
|
| 205 |
+
[18] J. Hu, M. Ozay, Y. Zhang, and T. Okatani. Revisiting single image depth estimation: Toward higher resolution maps with accurate object boundaries. 2019.
|
| 206 |
+
[19] S. Im, H.-G. Jeon, S. Lin, and I. S. Kweon. Dpsnet: End-to-end deep plane sweep stereo. arXiv preprint arXiv:1905.00538, 2019.
|
| 207 |
+
[20] M. Ji, J. Gall, H. Zheng, Y. Liu, and L. Fang. Surfacenet: An end-to-end 3d neural network for multiview stereopsis. In Proceedings of the IEEE International Conference on Computer Vision, pages 2307–2315, 2017.
|
| 208 |
+
[21] C. Jiang, A. Sud, A. Makadia, J. Huang, M. Nießner, T. Funkhouser, et al. Local implicit grid representations for 3d scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6001–6010, 2020.
|
| 209 |
+
[22] S. Khan, M. Naseer, M. Hayat, S. W. Zamir, F. S. Khan, and M. Shah. Transformers in vision: A survey. arXiv preprint arXiv:2101.01169, 2021.
|
| 210 |
+
[23] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 211 |
+
[24] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 212 |
+
[25] C. Liu, J. Gu, K. Kim, S. G. Narasimhan, and J. Kautz. Neural rgb (r) d sensing: Depth and uncertainty from a video camera. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10986–10995, 2019.
|
| 213 |
+
[26] X. Long, L. Liu, W. Li, C. Theobalt, and W. Wang. Multi-view depth estimation using epipolar spatiotemporal network. CVPR, 2021.
|
| 214 |
+
[27] W. E. Lorensen and H. E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. ACM siggraph computer graphics, 21(4):163–169, 1987.
|
| 215 |
+
[28] Z. Murez, T. van As, J. Bartolozzi, A. Sinha, V. Badrinarayanan, and A. Rabinovich. Atlas: End-to-end 3d scene reconstruction from posed images. In ECCV, 2020. URL https://arxiv.org/abs/2003.10432.
|
| 216 |
+
[29] Y. Nie, J. Hou, X. Han, and M. Nießner. Rfd-net: Point scene understanding by semantic instance reconstruction. arXiv preprint arXiv:2011.14744, 2020.
|
| 217 |
+
[30] N. Parmar, A. Vaswani, J. Uszkoreit, L. Kaiser, N. Shazeer, A. Ku, and D. Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 218 |
+
[31] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
|
| 219 |
+
[32] S. Peng, M. Niemeyer, L. Mescheder, M. Pollefeys, and A. Geiger. Convolutional occupancy networks. In European Conference on Computer Vision (ECCV), Cham, Aug. 2020. Springer International Publishing.
|
| 220 |
+
[33] V. Pradeep, C. Rhemann, S. Izadi, C. Zach, M. Bleyer, and S. Bathiche. Monofusion: Real-time 3d reconstruction of small scenes with a single web camera. In 2013 IEEE International Symposium on Mixed and Augmented Reality (ISMAR), pages 83–88. IEEE, 2013.
|
| 221 |
+
[34] C. R. Qi, H. Su, K. Mo, and L. J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652–660, 2017.
|
| 222 |
+
[35] C. R. Qi, L. Yi, H. Su, and L. J. Guibas. Pointnet $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. arXiv preprint arXiv:1706.02413, 2017.
|
| 223 |
+
[36] C. R. Qi, O. Litany, K. He, and L. J. Guibas. Deep hough voting for 3d object detection in point clouds. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9277–9286, 2019.
|
| 224 |
+
[37] J. L. Schönberger, E. Zheng, M. Pollefeys, and J.-M. Frahm. Pixelwise View Selection for Unstructured Multi-View Stereo. In European Conference on Computer Vision (ECCV), 2016.
|
| 225 |
+
[38] A. Sinha, Z. Murez, J. Bartolozzi, V. Badrinarayanan, and A. Rabinovich. Deltas: Depth estimation by learning triangulation and densification of sparse points. In ECCV, 2020. URL https://arxiv.org/ abs/2003.08933.
|
| 226 |
+
[39] J. Sun, Y. Xie, L. Chen, X. Zhou, and H. Bao. NeuralRecon: Real-time coherent 3D reconstruction from monocular video. CVPR, 2021.
|
| 227 |
+
[40] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 228 |
+
[41] L. von Stumberg, V. Usenko, and D. Cremers. Direct sparse visual-inertial odometry using dynamic marginalization. In International Conference on Robotics and Automation (ICRA), May 2018.
|
| 229 |
+
[42] K. Wang and S. Shen. Mvdepthnet: Real-time multiview depth estimation neural network. In 2018 International conference on 3d vision (3DV), pages 248–257. IEEE, 2018.
|
| 230 |
+
[43] W. Wang, R. Yu, Q. Huang, and U. Neumann. Sgpn: Similarity group proposal network for 3d point cloud instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2569–2578, 2018.
|
| 231 |
+
[44] X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 232 |
+
[45] P. Zins, Y. Xu, E. Boyer, S. Wuhrer, and T. Tung. Learning implicit 3d representations of dressed humans from sparse views. arXiv preprint arXiv:2104.08013, 2021.
|
md/train/gEzN9bBbLt8/gEzN9bBbLt8.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STEM: A Stochastic Two-Sided Momentum Algorithm Achieving Near-Optimal Sample and Communication Complexities for Federated Learning
|
| 2 |
+
|
| 3 |
+
Prashant Khanduri University of Minnesota khand095@umn.edu
|
| 4 |
+
|
| 5 |
+
Pranay Sharma Carnegie Mellon University pranaysh@andrew.cmu.edu
|
| 6 |
+
|
| 7 |
+
Haibo Yang The Ohio State University yang.5952@buckeyemail.osu.edu
|
| 8 |
+
|
| 9 |
+
Mingyi Hong⇤ University of Minnesota mhong@umn.edu
|
| 10 |
+
|
| 11 |
+
Jia Liu The Ohio State University liu@ece.osu.edu
|
| 12 |
+
|
| 13 |
+
Ketan Rajawat Indian Institute of Technology Kanpur ketan@iitk.ac.in
|
| 14 |
+
|
| 15 |
+
Pramod K. Varshney Syracuse University varshney@syr.edu
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Federated Learning (FL) refers to the paradigm where multiple worker nodes (WNs) build a joint model by using local data. Despite extensive research, for a generic non-convex FL problem, it is not clear, how to choose the WNs’ and the server’s update directions, the minibatch sizes, and the number of local updates, so that the WNs use the minimum number of samples and communication rounds to achieve the desired solution. This work addresses the above question and considers a class of stochastic algorithms where the WNs perform a few local updates before communication. We show that when both the WN’s and the server’s directions are chosen based on certain stochastic momentum estimator, the algorithm requires $\tilde { \mathcal O } ( \epsilon ^ { - 3 / 2 } )$ samples and $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ communication rounds to compute an $\epsilon$ -stationary solution. To the best of our knowledge, this is the first FL algorithm that achieves such near-optimal sample and communication complexities simultaneously. Further, we show that there is a trade-off curve between the number of local updates and the minibatch sizes, on which the above sample and communication complexities can be maintained. Finally, we show that for the classical FedAvg (a.k.a. Local SGD, which is a momentum-less special case of the STEM), a similar trade-off curve exists, albeit with worse sample and communication complexities. Our insights on this trade-off provides guidelines for choosing the four important design elements for FL algorithms, the number of local updates, WNs’ and server’s update directions, and minibatch sizes to achieve the best performance.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
In Federated Learning (FL), multiple worker nodes (WNs) collaborate with the goal of learning a joint model, by only using local data. Therefore it has become popular for machine learning problems where datasets are massively distributed [1]. In FL, the data is often collected at or off-loaded to multiple WNs which in collaboration with a server node (SN) jointly aim to learn a centralized model [2, 3]. The local WNs share the computational load and since the data is local to each WN, FL also provides some level of data privacy $\mathbb { H }$ . A classical distributed optimization problem that $K$ WNs aim to solve:
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: The 3D surface in (a) plots the communication complexity of the proposed STEM for different minibatch sizes and number of local updates. The surface is generated such that each point represents STEM with a particular choice of $( b , I )$ , so that it requires $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ samples to achieve $\epsilon$ -stationarity. Plot (b) shows the optimal trade off between the minibatch sizes and the number of local updates at each WN (i.e., achieving the lowest communication and sample complexities). Both plots are generated for an accuracy of $\epsilon = 1 0 ^ { - 3 }$ and all the constants dependent on system parameters (variance of stochastic gradients, heterogeneity parameter, optimality gap, Lipschitz constants, etc.) are assumed to be 1. Fed STEM is a special case of STEM where $\mathcal { O } ( 1 )$ minibatch is used; Minibatch STEM is a special case of STEM where $\mathcal { O } ( 1 )$ local updates are used.
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } \bigg \{ f ( x ) : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } f ^ { ( k ) } ( x ) : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } _ { \xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) } } \big [ f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) \big ] \bigg \} .
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
where $f ^ { ( k ) } : \mathbb { R } ^ { d } \mathbb { R }$ denotes the smooth (possibly non-convex) objective function and $\xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) }$ represents the sample/s drawn from distribution $\mathcal { D } ^ { ( k ) }$ at the $k ^ { \mathrm { { t h } } }$ WN with $k \in [ K ]$ . When the distributions $\mathcal { D } ^ { ( k ) }$ are different across the WNs, it is referred to as the heterogeneous data setting.
|
| 33 |
+
|
| 34 |
+
The optimization performance of non-convex FL algorithms is typically measured by the total number of samples accessed (cf. Definition $\boxed { 2 . 2 }$ and the total rounds of communication (cf. Definition $2 . 3 )$ required by each WN to achieve an $\epsilon$ -stationary solution (cf. Definition $\boxed { 2 . 1 }$ . To minimize the sample and the communication complexities, FL algorithms rely on the following four key design elements: (i) the WNs’ local model update directions, (ii) Minibatch size to compute each local direction, (iii) the number of local updates before WNs share their parameters, and (iv) the SN’s update direction. How to find effective FL algorithms by (optimally) designing these parameters has received significant research interest recently.
|
| 35 |
+
|
| 36 |
+
Contributions. The main contributions of this work are listed below:
|
| 37 |
+
|
| 38 |
+
1) We propose the Stochastic Two-Sided Momentum (STEM) algorithm, that utilizes certain momentum-assisted stochastic gradient directions for both the WNs and SN updates. We show that there exists an optimal trade off between the minibatch sizes and number of local updates, such that on the trade-off curve STEM requires $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } ) ^ { 2 }$ samples and $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ communication rounds to reach an $\epsilon$ -stationary solution; see Figure $\bigstar$ for an illustration. These complexity results are the best achievable for first-order stochastic FL algorithms (under certain assumptions, cf. Assumption $\bigstar \bigstar$ ; see $\pm \boxed { 5 } \boxed { 8 } \parallel$ and $\mathbb { B } \mathbb { n o }$ , as well as Remark $\checkmark$ of this paper for discussions regarding optimality. To the best of our knowledge, STEM is the first algorithm which – (i) simultaneously achieves the optimal sample and communication complexities for FL and (ii) can optimally trade off the minibatch sizes and the number of local updates.
|
| 39 |
+
|
| 40 |
+
2) A momentum-less special case of our STEM result further reveals some interesting insights of the classical FedAvg algorithm (a.k.a. the Local SGD) [11–13]. Specifically, we show that for FedAvg, there also exists a trade-off between the minibatch sizes and the number of local updates, such that it requires $\mathcal { O } ( \epsilon ^ { - 2 } )$ samples and $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ communication rounds to achieve an $\epsilon$ -stationary solution.
|
| 41 |
+
|
| 42 |
+
<table><tr><td>Algorithm</td><td>Work</td><td>Sample</td><td>Comm.</td><td>Minibatch (b)</td><td>Local Updates (I) /round</td></tr><tr><td>FedAvg</td><td>国园 国国</td><td>0(€-2)</td><td>0(c-3/2) 0(c-2)</td><td>0(1) 0(1) 2(1-v)</td><td>0(c-1/2) 0(1) 3v</td></tr><tr><td>SCAFFOLD*</td><td>this work 国</td><td>0(c-2)</td><td>O(e-3/2) 0(c-2)</td><td>O(c 4-v) 0(1)</td><td>O(c−2(4-D)) 0(1)</td></tr><tr><td>FedPD/FedProx*</td><td>四/□</td><td>O(c-2)</td><td>0(e-1)</td><td>0(1)</td><td>0(e-1)</td></tr><tr><td>MIME†/FedGLOMO</td><td>/8</td><td>0(c-3/2)</td><td>O(€-3/2)</td><td>0(1)</td><td>0(1)</td></tr><tr><td>STEM Fed STEM Minibatch STEM*</td><td> this work</td><td>O(€-3/2)</td><td>O(e-1)</td><td>( 0(1) O(e-1/2)</td><td>O(∈−(3)) O(∈-1/2) 0(1)</td></tr></table>
|
| 43 |
+
|
| 44 |
+
Table 1: Comparison of FedAvg and STEM with different FL algorithms for various choices of the minibatch sizes $( b )$ and the number of per node local updates between two rounds of communication $( I )$ . $^ \circ \nu \in [ 0 , 1 ]$ trades off $^ { b }$ and $I$ ; $\nu = 1$ (resp. $\nu = 0$ ) uses multiple (resp. $\mathcal { O } ( 1 ) .$ ) local updates and $\mathcal { O } ( 1 )$ (resp. multiple) samples. Fed STEM and Minibatch STEM are two variants of the proposed STEM. ‡The data heterogeneity assumption is weaker than Assumption $2$ (please see $\bigstar \bigstar$ for details). †Requires bounded Hessian dissimilarity to model data heterogeneity across WNs. ⇤Guarantees for Minibatch STEM with $I = 1$ and SCAFFOLD are independent of the data heterogeneity.
|
| 45 |
+
|
| 46 |
+
Collectively, our insights on the trade-offs provide practical guidelines for choosing different design elements for FL algorithms.
|
| 47 |
+
|
| 48 |
+
Related Works. FL algorithms were first proposed in the form of FedAvg [11], where the local update directions at each WN were chosen to be the SGD updates. Earlier works analyzed these algorithms in the homogeneous data setting [19–25], while many recent studies have focused on designing new algorithms to deal with heterogeneous data settings, as well as problems where the local loss functions are non-convex [9, 10, 12–16, 18, 26–32]. In $\bar { \mathbb { E } 2 } \mathbb { I }$ , the authors showed that Parallel Restarted SGD (Local SGD or FedAvg [11]) achieves linear speed up while requiring $\mathcal { O } ( \epsilon ^ { - 2 } )$ samples and $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ rounds of communication to reach an $\epsilon$ -stationary solution. In $\bar { \textregistered }$ , a Momentum SGD was proposed, which achieved the same sample and communication complexities as Parallel Restarted SGD $\mathbb { \lVert 1 2 \rVert }$ , without requiring that the second moments of the gradients be bounded. Further, it was shown that under the homogeneous data setting, the communication complexity can be improved to $\mathcal { O } ( \epsilon ^ { - 1 } )$ while maintaining the same sample complexity. The works in $\boxed { 1 5 } \boxed { 1 6 }$ conducted tighter analysis for FedAvg with partial WN participation with $\mathcal { O } ( 1 )$ local updates and batch sizes. Their analysis showed that FedAvg’s sample and communication complexities are both $\mathcal { O } ( \epsilon ^ { - 2 } )$ . Additionally, SCAFFOLD was proposed in $\bar { \| 1 5 \| }$ , which utilized variance reduction based local update directions $\mathbb { \lVert 3 3 \rVert }$ to achieve the same sample and communication complexities as FedAvg. Similarly, VRL-SGD proposed in $\left[ \left[ 2 9 \right] \right]$ also utilized variance reduction and showed improved communication complexity of $\mathcal { O } ( \epsilon ^ { - 1 } )$ , while requiring the same computations as FedAvg. Importantly, both SCAFFOLD and VRL-SGD’s guarantees were independent of the data heterogeneity. The FedProx proposed in $\mathbb { I O } ]$ used a penalty based method to improve the communication complexity of FedAvg (i.e., the Parallel Restarted and Momentum SGD [14, $\mathbb { L } 2 \mathbb { I }$ ) to $\mathcal { O } ( \epsilon ^ { - 1 } )$ . FedProx used a gradient similarity assumption to model data heterogeneity which can be stringent for many practical applications. This assumption was relaxed by FedPD proposed in $\mathbb { \left[ 9 \right] }$ .
|
| 49 |
+
|
| 50 |
+
Recently, the works [17, 18] proposed to utilize hybrid momentum gradient estimators [7, 8]. The MIME algorithm $\mathbb { \ m }$ matched the optimal sample complexity (under certain smoothness assumptions) of $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ of the centralized non-convex stochastic optimization algorithms [5–8]. Similarly, Fed-GLOMO $[ \overline { { 1 8 } } ]$ achieved the same sample complexity while employing compression to further reduce communication. Both MIME and Fed-GLOMO required $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ communication rounds to achieve an $\epsilon$ -stationary solution. Please see Table $\bigtriangledown$ for a summary of the above discussion.
|
| 51 |
+
|
| 52 |
+
The comparison of Local SGD (FedAvg) to Minibatch SGD for convex and strongly convex problems with homogeneous data setting was first conducted in $\mathbb { \underline { { \ m } } }$ and later extended to heterogeneous setting in $\mathbb { \lVert \rVert 3 \rVert }$ . It was shown that Minibatch SGD almost always dominates the Local SGD. In contrast, it was shown in $\pmb { \Vert 2 4 \Vert }$ that Local SGD dominates Minibatch SGD in terms of generalization performance. Although existing FL results are rich, but they are somehow ad hoc and there is a lack of principled understanding of the algorithms. We note that the proposed STEM algorithmic framework provides a theoretical framework that unifies all existing $\mathrm { F L }$ results on sample and communication complexities.
|
| 53 |
+
|
| 54 |
+
Notations. The expected value of a random variable $X$ is denoted by $\mathbb { E } [ X ]$ and its expectation conditioned on an Event $A$ is denoted as $\mathbb { E } [ X | \mathrm { E v e n t ~ } A ]$ . We denote by $\mathbb { R }$ (and $\mathbb { R } ^ { d }$ ) the real line (and the $d$ -dimensional Euclidean space). The set of natural numbers is denoted by $\mathbb { N }$ . Given a positive integer $K \in \mathbb N$ , we denote $[ K ] \triangleq \{ 1 , 2 , \dots , K \}$ . Notation $\| \cdot \|$ denotes the $\ell _ { 2 }$ -norm and $\langle \cdot , \cdot \rangle$ the Euclidean inner product. For a discrete set $\boldsymbol { B }$ , $| B |$ denotes the cardinality of the set. Uniform distribution over a discrete set $\{ 1 , \ldots , T \}$ is denoted as ${ \dot { \mathcal { U } } } \{ 1 , \dots , T \}$ .
|
| 55 |
+
|
| 56 |
+
# 2 Preliminaries
|
| 57 |
+
|
| 58 |
+
Before we proceed to the algorithms, we make the following assumptions about problem $( 1 )$ .
|
| 59 |
+
|
| 60 |
+
Assumption 1 (Sample Gradient Lipschitz Smoothness). The stochastic functions $f ^ { ( k ) } ( \cdot , \xi ^ { ( k ) } )$ with $\xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) }$ for all $k \in [ K ]$ , satisfy the mean squared smoothness property, i.e, we have
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { \mathbb { E } \| \nabla f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) - \nabla f ^ { ( k ) } ( y ; \xi ^ { ( k ) } ) \| ^ { 2 } \leq L ^ { 2 } \| x - y \| ^ { 2 } \mathrm { ~ f o r ~ a l l ~ } x , y \in \mathbb { R } ^ { d } . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Assumption 2 (Unbiased gradient and Variance Bounds). (i) Unbiased Gradient. The stochastic gradients computed at each WN are unbiased
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathbb { E } [ \nabla f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) ] = \nabla f ^ { ( k ) } ( x ) , \forall \xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) } , \forall k \in [ K ] .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
(ii) Intra- and inter- node Variance Bound. The following bounds hold:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r } { \mathbb { \tilde { z } } \| \nabla f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) - \nabla f ^ { ( k ) } ( x ) \| ^ { 2 } \leq \sigma ^ { 2 } , \| \nabla f ^ { ( k ) } ( x ) - \nabla f ^ { ( \ell ) } ( x ) \| ^ { 2 } \leq \zeta ^ { 2 } , \forall \xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) } , \forall k , \ell \in [ K ] . } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Note that Assumption $^ 1$ is stronger than directly assuming $f ^ { ( k ) }$ ’s are Lipschitz smooth (which we will refer to as the averaged gradient Lipschitz smooth condition), but it is still a rather standard assumption in SGD analysis. For example it has been used in analyzing centralized SGD algorithms such as SPIDER $ { \mathbb { I } }$ , SNVRG $\pmb { \Vert 6 \Vert }$ , STORM $\mathbb { [ [ \big ] ] }$ (and many others) as well as in FL algorithms such as MIME $ { \mathbb { I } } ^ { [ 1 2 ] }$ and Fed-GLOMO $\pm \textcircled { 1 8 } \textcircled { 1 }$ . The second relation in Assumption $2 \cdot$ (ii) quantifies the data heterogeneity, and we call $\zeta > 0$ as the heterogeneity parameter. This is a typical assumption required to evaluate the performance of FL algorithms. If data distributions across individual WNs are identical, i.e., $\mathcal { D } ^ { ( k ) } \stackrel { = } { = } \mathcal { D } ^ { ( \ell ) }$ for all $k , \ell \in [ K ]$ then we have $\zeta = 0$ .
|
| 79 |
+
|
| 80 |
+
Next, we define the $\epsilon$ -stationary solution for non-convex optimization problems, as well as quantify the computation and communication complexities to achieve an $\epsilon$ -stationary point.
|
| 81 |
+
|
| 82 |
+
Definition 2.1 $\epsilon$ -Stationary Point). A point $x$ is called $\epsilon$ -stationary if $\| \nabla f ( x ) \| ^ { 2 } \leq \epsilon$ . Moreover, a stochastic algorithm is said to achieve an $\epsilon$ -stationary point in $t$ iterations if $\begin{array} { r } { \ddot { \mathbb { E } } [ \| \nabla f ( x _ { t } ) \| ^ { 2 } ] \le \epsilon . } \end{array}$ where the expectation is over the stochasticity of the algorithm until time instant $t$ .
|
| 83 |
+
|
| 84 |
+
Definition 2.2 (Sample complexity). We assume an Incremental First-order Oracle (IFO) framework $\pmb { \Vert 3 4 \Vert }$ where, given a sample $\xi ^ { ( k ) } \sim \mathcal { D } ^ { ( k ) }$ at the $k ^ { \mathrm { { t h } } }$ node and iterate $x$ , the oracle returns $( f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) , \nabla f ^ { ( k ) } ( x ; \xi ^ { ( k ) } ) )$ . Each access to the oracle is counted as a single IFO operation. We measure the sample (and computational) complexity in terms of the total number of calls to the IFO by all WNs to achieve an $\epsilon$ -stationary point given in Definition 2.1.
|
| 85 |
+
|
| 86 |
+
Definition 2.3 (Communication complexity). We define a communication round as a one back-andforth sharing of parameters between the WNs and the SN. Then the communication complexity is defined to be the total number of communication rounds between any WN and the SN required to achieve an $\epsilon$ -stationary point given in Definition 2.1.
|
| 87 |
+
|
| 88 |
+
# 3 The STEM algorithm and the trade-off analysis
|
| 89 |
+
|
| 90 |
+
In this section, we discuss the proposed algorithm and present the main results. The key in the algorithm design is to carefully balance all the four design elements mentioned in Sec. $^ { 1 , }$ so that sufficient and useful progress can be made between two rounds of communication.
|
| 91 |
+
|
| 92 |
+
Let us discuss the key steps of STEM, listed in Algorithm $\nsupseteq$ In Step 10, each node locally updates its model parameters using the local direction $d _ { t } ^ { k }$ , computed by using $b$ stochastic gradients at two
|
| 93 |
+
|
| 94 |
+
1: Input: Parameters: $c > 0$ , the number of local updates $I$ , batch size $b$ , stepsizes $\{ \eta _ { t } \}$ .
|
| 95 |
+
2: Initialize: Iterate $\begin{array} { r } { x _ { 1 } ^ { ( k ) } = \bar { x } _ { 1 } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } x _ { 1 } ^ { ( k ) } } \end{array}$ , descent direction $\begin{array} { r } { d _ { 1 } ^ { ( k ) } = \bar { d } _ { 1 } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } d _ { 1 } ^ { ( k ) } } \end{array}$
|
| 96 |
+
with $\begin{array} { r } { d _ { 1 } ^ { ( k ) } = \frac { 1 } { B } \sum _ { \xi _ { 1 } ^ { ( k ) } \in \mathcal { B } _ { 1 } ^ { ( k ) } } \nabla f ^ { ( k ) } ( x _ { 1 } ^ { ( k ) } ; \xi _ { 1 } ^ { ( k ) } ) } \end{array}$ and $| B _ { 1 } ^ { ( k ) } | = B$ for $k \in [ K ]$ .
|
| 97 |
+
3: Perform: $x _ { 2 } ^ { ( k ) } = x _ { 1 } ^ { k } - \eta _ { 1 } d _ { 1 } ^ { ( k ) }$ , $\forall k \in [ K ]$
|
| 98 |
+
4: for $t = 1$ to $T$ do
|
| 99 |
+
5: for $k = 1$ to $K$ do #at the WN
|
| 100 |
+
6: $\mathcal { d } _ { t + 1 } ^ { ( k ) } = \frac { 1 } { b } \sum _ { \xi _ { t + 1 } ^ { ( k ) } \in \mathcal { B } _ { t + 1 } ^ { ( k ) } } ^ { \pi \Delta } \nabla f ^ { ( k ) } ( x _ { t + 1 } ^ { ( k ) } ; \xi _ { t + 1 } ^ { ( k ) } ) + \left( 1 - a _ { t + 1 } \right) \bigg ( d _ { t } ^ { ( k ) } - \frac { 1 } { b } \sum _ { \xi _ { t + 1 } ^ { ( k ) } \in \mathcal { B } _ { t + 1 } ^ { ( k ) } } \nabla f ^ { ( k ) } ( x _ { t } ^ { ( k ) } ; \xi _ { t + 1 } ^ { ( k ) } ) \bigg )$
|
| 101 |
+
where we choose $| B _ { t + 1 } ^ { ( k ) } | = b$ , and $a _ { t + 1 } = c \cdot \eta _ { t } ^ { 2 }$ ;
|
| 102 |
+
7: 8: if $t$ $I = 0$ #at the SN
|
| 103 |
+
$\begin{array} { r } { d _ { t + 1 } ^ { ( k ) } = \bar { d } _ { t + 1 } : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } d _ { t + 1 } ^ { ( k ) } } \end{array}$
|
| 104 |
+
9: 10: e $\begin{array} { r l } & { x _ { t + 2 } ^ { ( k ) ^ { \bot } } : = \bar { x } _ { t + 1 } - \eta _ { t + 1 } \bar { d } _ { t + 1 } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } x _ { t + 1 } ^ { ( k ) } - \eta _ { t + 1 } \bar { d } _ { t + 1 } } \end{array}$ $x _ { t + 2 } ^ { ( k ) } = x _ { t + 1 } ^ { ( k ) } - \eta _ { t + 1 } d _ { t + 1 } ^ { ( k ) }$ #server-side momentum
|
| 105 |
+
11: end if
|
| 106 |
+
12: end for
|
| 107 |
+
13: end for
|
| 108 |
+
14: Return: $\scriptstyle { \bar { x } } _ { a }$ where $a \sim \mathcal { U } \{ 1 , . . . , T \}$ .
|
| 109 |
+
|
| 110 |
+
consecutive iterates $x _ { t + 1 } ^ { ( k ) }$ and $x _ { t } ^ { ( k ) }$ . After every $I$ local steps, the WNs share their current local models $\{ x _ { t + 1 } ^ { ( k ) } \} _ { k = 1 } ^ { K }$ and directions $\{ d _ { t + 1 } ^ { ( k ) } \} _ { k = 1 } ^ { K }$ with the SN. The SN aggregates these quantities, and performs a server-side momentum step, before returning $\bar { x } _ { t + 1 }$ and $\bar { d } _ { t + 1 }$ to all the WNs. Because both the WNs and the SN perform momentum based updates, we call the algorithm a stochastic two-sided momentum algorithm. The key parameters are: $b$ the minibatch size, $I$ the local update steps between two communication rounds, $\eta _ { t }$ the stepsizes, and $a _ { t }$ the momentum parameters.
|
| 111 |
+
|
| 112 |
+
One key technical innovation of our algorithm design is to identify the most suitable way to incorporate momentum based directions in FL algorithms. Although the momentum-based gradient estimator itself is not new and has been used in the literature before (see e.g., in $\mathbb { \left[ \bigstar \bigstar \right] }$ and $\lVert \overline { { 1 7 } } \rVert \overline { { 1 8 } } \rVert$ to improve the sample complexities of centralized and decentralized stochastic optimization problems, respectively), it is by no means clear if and how it can contribute to improve the communication complexity of FL algorithms. We show that in the FL setting, the local directions together with the local models have to be aggregated by the SN so to avoid being influenced too much by the local data. More importantly, besides the WNs, the SN also needs to perform updates using the (aggregated) momentum directions. Finally, such two-sided momentum updates have to be done carefully with the correct choice of minibatch size $b$ , and the number of local updates $I$ . Overall, it is the judicious choice of all these design elements that results in the optimal sample and communication complexities.
|
| 113 |
+
|
| 114 |
+
Next, we present the convergence guarantees of the STEM algorithm.
|
| 115 |
+
|
| 116 |
+
# 3.1 Main results: convergence guarantees for STEM
|
| 117 |
+
|
| 118 |
+
In this section, we analyze the performance of STEM. We first present our main result, and then provide discussions about a few parameter choices. In the next subsection, we discuss a special case of STEM related to the classical FedAvg and minibatch SGD algorithms.
|
| 119 |
+
|
| 120 |
+
Theorem 3.1. Under the Assumptions 1 and 2, suppose the stepsize sequence is chosen as:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\eta _ { t } = \frac { \bar { \kappa } } { ( w _ { t } + \sigma ^ { 2 } t ) ^ { 1 / 3 } } ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where we define :
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\bar { \kappa } = \frac { ( b K ) ^ { 2 / 3 } \sigma ^ { 2 / 3 } } { L } , \quad w _ { t } = \operatorname * { m a x } \bigg \{ 2 \sigma ^ { 2 } , 4 0 9 6 L ^ { 3 } I ^ { 3 } \bar { \kappa } ^ { 3 } - \sigma ^ { 2 } t , \frac { c ^ { 3 } \bar { \kappa } ^ { 3 } } { 4 0 9 6 L ^ { 3 } I ^ { 3 } } \bigg \} .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Further, let us set $\begin{array} { r } { c = \frac { 6 4 L ^ { 2 } } { b K } + \frac { \sigma ^ { 2 } } { 2 4 \bar { \kappa } ^ { 3 } L I } = L ^ { 2 } \bigg ( \frac { 6 4 } { b K } + \frac { 1 } { 2 4 ( b K ) ^ { 2 } I } \bigg ) } \end{array}$ and set the initial batch size as $B = b I$ ; set the local updates $I$ and minibatch size b as follows:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
I = \mathcal { O } \big ( ( T / K ^ { 2 } ) ^ { \nu / 3 } \big ) , \quad b = \mathcal { O } \big ( ( T / K ^ { 2 } ) ^ { 1 / 2 - \nu / 2 } \big )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\nu$ satisfies $\nu \in [ 0 , 1 ]$ . Then for STEM the following holds:
|
| 139 |
+
|
| 140 |
+
(i) For $\scriptstyle { \bar { x } } _ { a }$ chosen according to Algorithm $\perp$ we have:
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\mathbb { E } \Vert \nabla f ( \bar { x } _ { a } ) \Vert ^ { 2 } = \mathcal { O } \Bigg ( \frac { f ( \bar { x } _ { 1 } ) - f ^ { * } } { K ^ { 2 \nu / 3 } T ^ { 1 - \nu / 3 } } \Bigg ) + \tilde { \mathcal { O } } \Bigg ( \frac { \sigma ^ { 2 } } { K ^ { 2 \nu / 3 } T ^ { 1 - \nu / 3 } } \Bigg ) + \tilde { \mathcal { O } } \Bigg ( \frac { \zeta ^ { 2 } } { K ^ { 2 \nu / 3 } T ^ { 1 - \nu / 3 } } \Bigg ) .
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
(ii) For any $\nu \in [ 0 , 1 ]$ , we have
|
| 147 |
+
|
| 148 |
+
Sample Complexity: The sample complexity of STEM is $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ . This implies that each WN requires at most $\tilde { \mathcal { O } } ( K ^ { - 1 } \epsilon ^ { - 3 / 2 } )$ gradient computations, thereby achieving linear speedup with the number of WNs present in the network.
|
| 149 |
+
|
| 150 |
+
Communication Complexity: The communication complexity of STEM is $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ .
|
| 151 |
+
|
| 152 |
+
The proof of this result is relegated to the Supplemental Material. A few remarks are in order.
|
| 153 |
+
|
| 154 |
+
Remark 1 (Near-Optimal sample and communication complexities). Theorem $3 . 1$ suggests that when $I$ and $b$ are selected appropriately, then STEM achieves $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ and $\tilde { \mathcal { O } } ( \overline { { \epsilon ^ { - 1 } } } )$ sample and communication complexities. Taking them separately, these complexity bounds are the best achievable by the existing FL algorithms (upto logarithmic factors regardless of sample or batch Lipschitz smooth assumption) $[ [ 3 5 ] ]$ ; see Table $\bigstar \bigstar$ We note that the $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ complexity is the best possible that can be achieved by centralized SGD with the sample Lipschitz gradient assumption; see $\pmb { \Vert 5 \Vert }$ . On the other hand, the $\bar { \mathcal { O } } ( \epsilon ^ { - 1 } )$ complexity bound is also likely to be the optimal, since in $\mathbb { P }$ the authors showed that even when the local steps use a class of (deterministic) first-order algorithms, $\mathcal { O } ( \epsilon ^ { - 1 } )$ is the best achievable communication complexity. The only difference is that $\pmb { \mathbb { Q } } \|$ does not explicitly assume the inter-node variance bound (i.e., the second relation in Assumption $2 \cdot$ -(ii)). We leave the precise characterization of the communication lower bound with inter-node variance as future work. □
|
| 155 |
+
|
| 156 |
+
Remark 2 (Large Batch Sizes and/or Local Updates). At first glance, it may seem that the requirement of STEM to compute large mini-batches and/or local updates (cf. Table $^ { 1 ) }$ to achieve this (near) optimal performance is a drawback, however, we note that it is in fact an advantage of STEM that it allows the WNs to perform larger number of local updates (or compute large minibatches) without communicating often. This follows from the fact that irrespective of the number of local updates (or batch sizes) STEM achieves near-optimal communication complexity while attaining optimal overall sample complexity. Moreover, note that even with $b = I = \mathcal { O } ( 1 )$ (i.e., $b$ and $I$ are chosen as constants), STEM achieves the same (optimal) sample and communication complexities as achieved by FedGLOMO [18] and MIME [17]. We further note that to the best of our knowledge the algorithms that achieve the communication complexity of $\mathcal { O } ( \epsilon ^ { - 1 } )$ either require the number of local updates or the batch-sizes that depend on the solution accuracy $\epsilon$ . For example, FedProx $\mathbb { \ m }$ , FedPD $\pmb { \mathbb { Q } } \mathbf { \| }$ , and FedDyn $\textcircled { \lvert 3 6 \rvert }$ rely on solving the “local problems" to achieve an $\epsilon$ -accuracy, which implies that the number of local updates (or the batch sizes) implicitly depends on the desired solution accuracy $\epsilon$ , as is the case for STEM. Similarly, as shown in $\bar { \lVert 1 2 \rVert }$ and $\bar { \lVert 1 4 \rVert }$ the communication complexity of FedAvg and its momentum version can be improved from $\mathcal { O } ( \epsilon ^ { - 2 } )$ to $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ when the number of local updates (or batch size) is chosen as $\mathcal { O } ( \epsilon ^ { - 1 / 2 } )$ (cf. Section $\boxed { 3 . 2 }$ for a more detailed discussion).
|
| 157 |
+
|
| 158 |
+
Remark 3 (The Optimal Batch Sizes and Local Updates Trade-off). The parameter $\nu \in [ 0 , 1 ]$ is used to balance the local minibatch sizes $b$ , and the number of local updates $I$ . Eqs. in $( 3 )$ suggest that when $\nu$ increases from 0 to 1, $b$ decreases and $I$ increases. Specifically, if $\nu = 1$ , then $b$ is a constant but $I = \mathcal { O } ( T ^ { 1 / 3 } / K ^ { 2 / 3 } )$ . In this case, each WN chooses a small minibatch while executing multiple local updates, and STEM resembles a FedAvg (a.k.a. Local SGD) algorithm but with double-sided momentum update directions, and is referred to as Fed STEM. In contrast, if $\nu = 0$ , then $b = \mathcal { O } ( T ^ { 1 / 2 } / K )$ but $I$ is a constant. In this case, each WN chooses a large batch size while executing only a few, or even one, local updates, and STEM resembles the Minibatch SGD, but again with different update directions, and is referred to as Minibatch STEM. Such a trade-off can be seen in Fig. 1b. Due to space limitation, these two special cases will be precisely stated in the supplementary materials as corollaries of Theorem 3.1. □
|
| 159 |
+
|
| 160 |
+
# Algorithm 2 The FedAvg Algorithm
|
| 161 |
+
|
| 162 |
+
1: Input: $\{ \eta _ { t } \} _ { t = 0 } ^ { T } ; I$ , the # of local updates per communication round; $b$ , the minibatch sizes.
|
| 163 |
+
2: for $t = 1$ to $T$ do
|
| 164 |
+
3: 4: 5: for $\begin{array} { r l } & { \mathcal { \kappa } _ { t } ^ { = } \stackrel { \mathrm { ~ L ~ U ~ O ~ } \Lambda } { = } \mathbf { 0 } } \\ & { d _ { t } ^ { ( k ) } = \frac { 1 } { b } \sum _ { \xi _ { t } ^ { ( k ) } \in \mathcal { B } _ { t } ^ { ( k ) } } \nabla f ^ { ( k ) } ( x _ { t } ^ { ( k ) } ; \xi _ { t } ^ { ( k ) } ) \mathrm { ~ w i t h ~ } | \mathcal { B } _ { t } ^ { ( k ) } | = b } \\ & { x _ { t + 1 } ^ { ( k ) } = x _ { t } ^ { ( k ) } - \eta _ { t } d _ { t } ^ { ( k ) } } \\ & { \mathbf { i f } t \operatorname* { m o d } I = 0 \mathbf { \Lambda } \mathbf { t h e n } } \\ & { ~ x _ { t + 1 } ^ { ( k ) } = \bar { x } _ { t + 1 } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } x _ { t + 1 } ^ { ( k ) } } \\ & { \mathbf { e n d } \mathbf { \Phi } \mathbf { i f } } \end{array}$ $k = 1$ $K$
|
| 165 |
+
6:
|
| 166 |
+
7:
|
| 167 |
+
8:
|
| 168 |
+
9: end for
|
| 169 |
+
10: end for
|
| 170 |
+
11: Return: $\scriptstyle { \bar { x } } _ { a }$ where $a \sim \mathcal { U } \{ 1 , . . . , T \}$ .
|
| 171 |
+
|
| 172 |
+
Remark 4 (The Sub-Optimal Batch Sizes and Local Updates Trade-off). From our proof (Theorem ${ \bf C . 1 0 }$ included in the supplemental material), we can see that STEM requires $\bar { \tilde { O } } ( \operatorname* { m a x } \big \{ ( b \cdot$ $I ) \epsilon ^ { - 1 } , K ^ { - 1 } \epsilon ^ { - 3 / 2 } \rbrace )$ samples and $\tilde { \mathcal { O } } \big ( \operatorname* { m a x } \big \{ \epsilon ^ { - 1 } , ( b \cdot I ) ^ { - 1 } K ^ { - 1 } \epsilon ^ { - 3 / 2 } \big \} \big )$ and communication rounds. According to the above expressions, if $b \cdot I$ increases beyond $\mathcal { O } ( K ^ { - 1 } \epsilon ^ { - 1 / 2 } )$ , then the sample complexity will increase from the optimal $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ ; otherwise, the optimal sample complexity $\tilde { \mathcal O } ( \epsilon ^ { - 3 / 2 } )$ is maintained. On the other hand, if $b \cdot I$ decreases beyond $\mathcal { O } ( K ^ { - 1 } \epsilon ^ { - 1 / 2 } )$ , the communication complexity increases from $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ . For instance, if we choose $b = \mathcal { O } ( 1 )$ and $I = { \mathcal { O } } ( 1 )$ the communication complexity becomes $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ while the optimal sample complexity $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 / 2 } )$ is maintained. This trade-off is illustrated in Figure $\boxed { 1 \mathrm { a } }$ where we maintain the optimal sample complexity, while changing $b$ and $I$ to generate the trade-off surface. □
|
| 173 |
+
|
| 174 |
+
Remark 5 (Data Heterogeneity). The term $\begin{array} { r } { \tilde { \mathcal { O } } \biggl ( \frac { \zeta ^ { 2 } } { K ^ { 2 \nu / 3 } T ^ { 1 - \nu / 3 } } \biggr ) } \end{array}$ in the gradient bound $\textcircled{4}$ captures the effect of the heterogeneity of data across WNs, where $\zeta$ is the parameter characterizing the intra-node variance and has been defined in Assumption $\bigstar$ (ii). Highly heterogeneous data with large $\zeta ^ { 2 }$ can adversely impact the performance of STEM. Note that such a dependency on $\zeta$ also appears in other existing FL algorithms, such as $\boxed { 9 } \boxed { 1 4 } \boxed { 1 8 }$ . However, there is one special case of STEM that does not depend on the parameter $\zeta$ . This is the case where $I = 1$ , i.e., the minibatch SGD counterpart of STEM where only a single local iteration is performed between two communication rounds. We have the following corollary. □
|
| 175 |
+
|
| 176 |
+
Corollary 1 (Minibatch STEM). Under Assumptions $\boldsymbol { I } a n d \boldsymbol { 2 }$ , and choose the algorithm parameters as in Theorem $\boxed { 3 . I }$ At each WN, choose $I = 1$ , $b = ( T / K ^ { 2 } ) ^ { 1 / 2 }$ , and the initial batch size $B = \boldsymbol { b } \cdot \boldsymbol { I }$ . Then STEM satisfies:
|
| 177 |
+
|
| 178 |
+
(i) For $\bar { x } _ { a }$ chosen according to Algorithm $\perp$ we have
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\mathbb { E } \| \nabla f ( \bar { x } _ { a } ) \| ^ { 2 } = \mathcal { O } \Big ( \frac { f ( \bar { x } _ { 1 } ) - f ^ { * } } { T } \Big ) + \tilde { \mathcal { O } } \Big ( \frac { \sigma ^ { 2 } } { T } \Big ) .
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
(ii) Minibatch STEM achieves $\tilde { \mathcal O } ( \epsilon ^ { - 3 / 2 } )$ sample and $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ communication complexity.
|
| 185 |
+
|
| 186 |
+
Next, we show that FedAvg also exhibits a trade-off similar to that of STEM but with worse sample and communication complexities.
|
| 187 |
+
|
| 188 |
+
# 3.2 Special cases: The FedAvg algorithm
|
| 189 |
+
|
| 190 |
+
We briefly discuss another interesting special case of STEM, where the local momentum update is replaced by the conventional SGD (i.e., $a _ { t } = 1 , ~ \forall ~ t )$ , while the server does not perform the momentum update (i.e., $\bar { d } _ { t } = 0 , \forall t )$ . This is essentially the classical FedAvg algorithm, just that it balances the number of local updates $I$ and the minibatch size $b$ . We show that this algorithm also exhibits a trade-off between $b$ and $I$ and on the trade-off curve it achieves $\mathcal { O } ( \epsilon ^ { - 2 } )$ sample complexity and $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ communication complexity.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Algorithm</td><td> Training Acc.</td><td>Testing Acc.</td></tr><tr><td>FedAvg</td><td>78.2</td><td>74.1</td></tr><tr><td>FedProx</td><td>79.2</td><td>74.8</td></tr><tr><td>FedDyn</td><td>68.9</td><td>66.0</td></tr><tr><td>SCAFFOLD</td><td>71.9</td><td>74.0</td></tr><tr><td>MIME</td><td>82.6</td><td>76.8</td></tr><tr><td>FedGLOMO</td><td>76.1</td><td>72.8</td></tr><tr><td> STEM</td><td>80.1</td><td>78.8</td></tr></table>
|
| 193 |
+
|
| 194 |
+
(a) Mild heterogeneity, $b = 6 4$ , and $I = 7$ .
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Algorithm</td><td>Training Acc.</td><td>Testing Acc.</td></tr><tr><td>FedAvg</td><td>73.6</td><td>75.4</td></tr><tr><td>FedProx</td><td>80.0</td><td>75.2</td></tr><tr><td>FedDyn</td><td>76.1</td><td>71.3</td></tr><tr><td>SCAFFOLD</td><td>72.5</td><td>73.7</td></tr><tr><td>MIME</td><td>61.5</td><td>58.6</td></tr><tr><td>FedGLOMO</td><td>10.0</td><td>10.0</td></tr><tr><td>STEM</td><td>81.1</td><td>78.5</td></tr></table>
|
| 197 |
+
|
| 198 |
+
(b) Moderate heterogeneity, $b = 8$ , and $I = 6 1$
|
| 199 |
+
|
| 200 |
+
Table 2: Training and testing accuracy of different algorithms on CIFAR-10 dataset for different batch-sizes, number of local updates, and heteregeneity settings.
|
| 201 |
+
|
| 202 |
+
Theorem 3.2 (The FedAvg Algorithm). Under Assumptions 1 and 2, suppose the stepsize is chosen as: $\begin{array} { r } { \eta = \sqrt { \frac { b K } { T } } } \end{array}$ ; Let us set:
|
| 203 |
+
|
| 204 |
+
$$
|
| 205 |
+
I = \mathcal { O } \big ( ( T / K ^ { 3 } ) ^ { \nu / 4 } \big ) , \quad b = \mathcal { O } \big ( ( T / K ^ { 3 } ) ^ { 1 / 3 - \nu / 3 } \big )
|
| 206 |
+
$$
|
| 207 |
+
|
| 208 |
+
where $\nu \in [ 0 , 1 ]$ is a constant. Then for FedAvg with $T \geq 8 1 L ^ { 2 } I ^ { 2 } b K$ , the following holds
|
| 209 |
+
|
| 210 |
+
(i) For $\scriptstyle { \bar { x } } _ { a }$ chosen according to Algorithm $2 ,$ we have
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\mathbb { E } \Vert \nabla f ( \bar { x } _ { a } ) \Vert ^ { 2 } = \mathcal { O } \Bigg ( \frac { f ( \bar { x } _ { 1 } ) - f ^ { * } } { K ^ { \nu / 2 } T ^ { 2 / 3 - \nu / 6 } } \Bigg ) + \mathcal { O } \Bigg ( \frac { \sigma ^ { 2 } } { K ^ { \nu / 2 } T ^ { 2 / 3 - \nu / 6 } } \Bigg ) + \mathcal { O } \Bigg ( \frac { \zeta ^ { 2 } } { K ^ { \nu / 2 } T ^ { 2 / 3 - \nu / 6 } } \Bigg ) .
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
(ii) For any choice of $\nu \in [ 0 , 1 ]$ we have:
|
| 217 |
+
|
| 218 |
+
Sample Complexity: The sample complexity of FedAvg is $\mathcal { O } ( \epsilon ^ { - 2 } )$ . This implies that each WN requires at most $\tilde { \mathcal { O } } ( K ^ { - 1 } \epsilon ^ { - 2 } )$ gradient computations, thereby achieving linear speedup with the number of WNs in the network.
|
| 219 |
+
|
| 220 |
+
Communication Complexity: The communication complexity of FedAvg is $\mathcal { O } ( \epsilon ^ { - 3 / 2 } )$ .
|
| 221 |
+
|
| 222 |
+
Note that the requirement on $T$ being lower bounded is only relevant for theoretical purposes, a similar requirement was also imposed in $[ \mathbb { 1 4 } ]$ to prove convergence. Again, the parameter $\nu \in [ 0 , 1 ]$ in the statement of Theorem $\boxed { 3 . 2 }$ balances $I$ and $b$ at each WN while maintaining state-of-the-art sample and communication complexities; please see Table $\bigstar$ for a comparison of those bounds with existing FedAvg bounds. For $\nu = 1$ , FedAvg (cf. Theorem $3 . 2 )$ reduces to FedAvg proposed in [12, 14] and for $\nu = 0$ , the algorithm can be viewed as a large batch FedAvg with constant local updates [15, 16]. Note that similar to STEM, it is known that for $I = 1$ , the Minibatch SGD’s performance is independent of the heterogeneity parameter, $\zeta \equiv \mathbb { I I } 3 \mathbb { I }$ . We also point out that if Algorithm $\perp$ uses Nesterov’s or Polyak’s momentum $[ \textcircled { 1 4 } ]$ at local WNs instead of the recursive momentum estimator we get the same guarantees as in Theorem $\underline { { \boldsymbol { \vert 3 . 2 \vert } } }$
|
| 223 |
+
|
| 224 |
+
In summary, this section established that once the WN’s and the SN’s update directions (SGD in FedAvg and momentum based directions in STEM) are fixed, there exists a sequence of optimal choices of the number of local updates $I$ , and the batch sizes $b$ , which guarantees the best possible sample and communication complexities for the particular algorithm. The trade-off analysis presented in this section provides some useful guidelines for how to best select $b$ and $I$ in practice. Our subsequent numerical results will also verify that if $b$ or $I$ are not chosen judiciously, then the practical performance of the algorithms can degrade significantly.
|
| 225 |
+
|
| 226 |
+
# 4 Numerical results
|
| 227 |
+
|
| 228 |
+
In this section, we validate the proposed STEM algorithm and compare its performance with the de facto standard FedAvg [11], and the algorithms stated in Table $^ { 1 . }$ Note that instead of FedPD we include the performance comparison with FedDyn $\left[ \left[ 3 6 \right] \right]$ since they are known to be very closely related. The goal of our experiments are three-fold: (1) To show that STEM performs on par, if not better, compared to other algorithms in different heterogeneity settings, (2) there are multiple ways to reach the desired solution accuracy, one can either choose a large batch size and perform only a few local updates or select a smaller batch size and perform multiple local updates, and finally, (3) if the local updates and the batch sizes are not chosen appropriately, the WNs might need to perform excessive computations to achieve the desired solution accuracy, thereby slowing down convergence.
|
| 229 |
+
|
| 230 |
+
Table 3: Training and testing accuracy on CIFAR-10 dataset for high heterogeneity, $b =$ 128 and $I = 6$ .
|
| 231 |
+
|
| 232 |
+
<table><tr><td>Algorithm</td><td>Training Acc.</td><td>Testing Acc.</td></tr><tr><td>FedAvg</td><td>57.6</td><td>57.1</td></tr><tr><td>FedProx</td><td>59.1</td><td>58.5</td></tr><tr><td>FedDyn</td><td>51.2</td><td>51.3</td></tr><tr><td>SCAFFOLD</td><td>53.1</td><td>54.7</td></tr><tr><td>MIME</td><td>56.1</td><td>55.1</td></tr><tr><td>FedGLOMO</td><td>56.8</td><td>56.1</td></tr><tr><td> STEM</td><td>58.5</td><td>57.4</td></tr></table>
|
| 233 |
+
|
| 234 |
+
Table 4: Training and testing accuracy on Shakespeare dataset.
|
| 235 |
+
|
| 236 |
+
<table><tr><td>Algorithm</td><td>Training Acc.</td><td>Testing Acc.</td></tr><tr><td>FedAvg</td><td>40.1</td><td>39.2</td></tr><tr><td>FedProx</td><td>43.5</td><td>43.2</td></tr><tr><td>FedDyn</td><td>43.7</td><td>43.2</td></tr><tr><td>SCAFFOLD</td><td>40.3</td><td>41.3</td></tr><tr><td>MIME</td><td>32.1</td><td>32.1</td></tr><tr><td>FedGLOMO</td><td>40.3</td><td>40.1</td></tr><tr><td> STEM</td><td>44.5</td><td>43.8</td></tr></table>
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 2: Training loss and the testing accuracy for classification on MNIST data set against the number of samples accessed at each WN for moderate heterogeneity setting with $b = 8$ .
|
| 240 |
+
|
| 241 |
+
Data and Parameter Settings: We compare the algorithms for image classification tasks on CIFAR10 and MNIST data sets with 100 WNs, and for next character prediction task on Shakespeare dataset $\pmb { \Vert 3 7 } \Vert$ with 143 WNs in the network. For both CIFAR-10 and MNIST, each WN implements a two-hidden-layer convolutional neural network (CNN) architecture followed by three linear layers for CIFAR-10 and two for MNIST. For CIFAR-10 (and MNIST) datset, we consider three settings with mild, moderate and high heterogeneity. For all the three settings, the data is partitioned into disjoint sets among the WNs. In the mild heterogeneity setting, the WNs have access to partitioned data from all the classes. In the moderate (resp. high) heterogeneity setting the data is partitioned such that each WN can access data from only 5 (resp. 2) out of 10 classes. For CIFAR-10 (resp. MNIST), each WN has access to 490 (resp. 540) samples for training and 90 (resp. 80) samples for testing purposes.
|
| 242 |
+
|
| 243 |
+
We also compare the performance of algorithms on a popular FL benchmarking dataset, Shakespeare dataset $\mathbb { B } \mathbb { Z }$ . For this task, we adopt the settings from $\dot { \left[ \left| 1 0 \right| \right] }$ and utilize a 2-Layer LSTM network with 100 hidden units and an 8-D embedding layer at each WN. Each WN has access to 3616 samples on average, and the samples are randomly split into an $80 \%$ training set and a $20 \%$ testing set. We randomly sample 10 nodes out of 143 for the training purpose. All the experiments are implemented on a single NVIDIA Quadro RTX 5000 GPU. More details are provided in appendix.
|
| 244 |
+
|
| 245 |
+
For the proposed STEM algorithm, recall that the step-size is $\eta _ { t } = \bar { \kappa } / ( w _ { t } + \sigma ^ { 2 } t ) ^ { 1 / 3 }$ with momentum parameter defined as $a _ { t } = { c } \eta _ { t } ^ { 2 }$ . The step-size is used to update the iterates while the momentum parameter is used to construct the stochastic gradient estimate (cf. Algorithm 1 and Theorem $\boxed { 3 . 1 }$ . For the experiments, we set $w _ { t } = \sigma ^ { 2 } = 1$ and $c \doteq \bar { c } / \bar { \kappa } ^ { 2 }$ and tune for $\bar { \kappa } \in [ 1 0 ^ { - 1 } , 1 0 ^ { - 2 } ]$ for the CIFAR-10 dataset and for ${ \bar { \kappa } } \in \{ 1 0 ^ { 1 } , 1 0 ^ { 0 } , 1 0 ^ { - 1 } , 1 0 ^ { - 2 } \}$ for the Shakespeare dataset. For both the datasets we tune for $\bar { c }$ in the range [1, 10]. For FedProx $\mathbb { m }$ and FedDyn $\lVert \dot { \boldsymbol { 3 6 } } \rVert$ we choose the regularization constant to be 0.1. The momentum parameters for FedGLOMO $\pm \textcircled { 1 8 } \textcircled { 1 }$ and MIME $\mathbb { \ m }$ are set based on the choices given in the respective papers. Specifically, for FedGLOMO we choose the parameter $\beta _ { k } = 0 . 2$ and design the momentum gradient using a damping factor given in Appendix A.4 of FedGLOMO $\mathbb { \left[ \left[ 8 \right] \right] }$ . Moreover, for MIME we choose the momentum parameter as 0.9. For the rest of the algorithms (including FedAvg and SCAFFOLD), the step-size is tuned from the set $\{ 1 0 ^ { 1 } , 1 0 ^ { 0 } , 1 0 ^ { - 1 } , \hat { 1 0 } ^ { - 2 } \}$ .
|
| 246 |
+
|
| 247 |
+
Discussion: We evaluate the training and testing performance of STEM against multiple algorithms for different heterogeneity settings, minibatch sizes, and number of local updates. In Tables $\bigstar$ $\boxed { 2 \mathbf { b } }$ and $\bigstar ,$ we compare the training and testing accuracy of STEM to that of other algorithms on the CIFAR-10 dataset. Specific, heterogeneity settings, the choices of minibatches, and number of local updates are stated along with the tables. Note that STEM performs uniformly well under all the conditions. Moreover, note from Table $2 { \mathbf { b } }$ that FedGLOMO diverges once the number of local updates are high. Also, note from Table $\textcircled { 3 }$ that FedProx and STEM adapt well to high heterogeneity. Finally, with the next set of experiments we emphasize the importance of choosing $b$ and $I$ carefully. In Figure $\bigstar ,$ we compare the training and testing performance of STEM, FedAvg and SCAFFOLD, against the number of samples accessed at each WN for the classification task on MNIST dataset with moderate heterogeneity. We fix $b = 8$ and conduct experiments under two settings, one with $I = 6 7$ , and the other with $I = 5 3 6$ local updates at each WN. Note that although a large number of local updates might lead to fewer communication rounds but it can make the sample complexity extremely high as is demonstrated by Figure $2 .$ For example, Figure $\bigtriangledown$ shows that to reach testing accuracy of $9 6 - 9 7 \%$ with $I = 6 7$ , STEM requires approximately $\overline { { 5 0 } } 0 0 - 6 0 0 0$ samples, in contrast with $I = 5 3 6$ it requires more than 25000 samples at each WN. Similar behavior can be observed if we fix $I > 1$ and increase the local batch sizes. This implies not choosing the local updates and the batch sizes judiciously might lead to increased sample complexity. Additional experiments are included in the supplementary material to further evaluate the performance of the proposed algorithms.
|
| 248 |
+
|
| 249 |
+
# Conclusion
|
| 250 |
+
|
| 251 |
+
In this work, we proposed a novel algorithm STEM, for distributed stochastic non-convex optimization with applications to FL. We showed that STEM reaches an $\epsilon$ -stationary point with $\tilde { \mathcal O } ( \epsilon ^ { - 3 / 2 } )$ sample complexity while achieving linear speed-up with the number of WNs. Moreover, the algorithm achieves a communication complexity of $\tilde { \mathcal { O } } ( \epsilon ^ { - 1 } )$ . We established a (optimal) trade-off that allows interpolation between varying choices of local updates and the batch sizes at each WN while maintaining (near optimal) sample and communication complexities. We showed that FedAvg (a.k.a LocalSGD) also exhibits a similar trade-off while achieving worse complexities. Our results provide guidelines to carefully choose the number of local updates, update directions, and minibatch sizes to achieve the best performance. The future directions of this work include developing lower bounds on communication complexity that establishes the tightness of the analysis conducted in this work.
|
| 252 |
+
|
| 253 |
+
# Acknowledgement
|
| 254 |
+
|
| 255 |
+
We thank the anonymous reviewers for their valuable comments and suggestions. The work of Prashant Khanduri and Mingyi Hong was supported by NSF grant CMMI-1727757, AFOSR grant 19RT0424 and ARO grant W911NF-19-1-0247. The work of Mingyi Hong was also supported by an IBM Faculty Research award. The work of Jia Liu has been supported in part by NSF grants CAREER CNS-2110259, CNS-2112471, CNS-2102233, CCF-2110252, ECCS-2140277, and a Google Faculty Research Award.
|
| 256 |
+
|
| 257 |
+
References
|
| 258 |
+
[1] J. Konecnˇ y, H. B. McMahan, D. Ramage, and P. Richtárik, “Federated optimization: Distributed \` machine learning for on-device intelligence,” arXiv preprint arXiv:1610.02527, 2016.
|
| 259 |
+
[2] M. Li, D. G. Andersen, A. J. Smola, and K. Yu, “Communication efficient distributed machine learning with the parameter server,” in Advances in Neural Information Processing Systems 27, Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, Eds. Curran Associates, Inc., 2014, pp. 19–27.
|
| 260 |
+
[3] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang et al., “Large scale distributed deep networks,” in Advances in neural information processing systems, 2012, pp. 1223–1231.
|
| 261 |
+
[4] T. Léauté and B. Faltings, “Protecting privacy through distributed computation in multi-agent decision making,” Journal of Artificial Intelligence Research, vol. 47, pp. 649–695, 2013.
|
| 262 |
+
[5] C. Fang, C. J. Li, Z. Lin, and T. Zhang, “Spider: Near-optimal non-convex optimization via stochastic path-integrated differential estimator,” in Advances in Neural Information Processing Systems, 2018, pp. 689–699.
|
| 263 |
+
[6] D. Zhou, P. Xu, and Q. Gu, “Stochastic nested variance reduction for nonconvex optimization,” arXiv preprint arXiv:1806.07811, 2018.
|
| 264 |
+
[7] A. Cutkosky and F. Orabona, “Momentum-based variance reduction in non-convex SGD,” in Advances in Neural Information Processing Systems 32. Curran Associates, Inc., 2019, pp. 15 236–15 245.
|
| 265 |
+
[8] Q. Tran-Dinh, N. H. Pham, D. T. Phan, and L. M. Nguyen, “Hybrid stochastic gradient descent algorithms for stochastic nonconvex optimization,” arXiv preprint arXiv:1905.05920, 2019.
|
| 266 |
+
[9] X. Zhang, M. Hong, S. Dhople, W. Yin, and Y. Liu, “Fedpd: A federated learning framework with adaptivity to non-iid data,” IEEE Transactions on Signal Processing, pp. 1–1, 2021.
|
| 267 |
+
[10] T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, “Federated optimization in heterogeneous networks,” arXiv preprint arXiv:1812.06127, 2018.
|
| 268 |
+
[11] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, “Communication-efficient learning of deep networks from decentralized data,” in Artificial Intelligence and Statistics. PMLR, 2017, pp. 1273–1282.
|
| 269 |
+
[12] H. Yu, S. Yang, and S. Zhu, “Parallel restarted sgd with faster convergence and less communication: Demystifying why model averaging works for deep learning,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 33, no. 01, 2019, pp. 5693–5700.
|
| 270 |
+
[13] B. Woodworth, K. K. Patel, and N. Srebro, “Minibatch vs local sgd for heterogeneous distributed learning,” arXiv preprint arXiv:2006.04735, 2020.
|
| 271 |
+
[14] H. Yu, R. Jin, and S. Yang, “On the linear speedup analysis of communication efficient momentum sgd for distributed non-convex optimization,” in International Conference on Machine Learning. PMLR, 2019, pp. 7184–7193.
|
| 272 |
+
[15] S. P. Karimireddy, S. Kale, M. Mohri, S. Reddi, S. Stich, and A. T. Suresh, “Scaffold: Stochastic controlled averaging for federated learning,” in International Conference on Machine Learning. PMLR, 2020, pp. 5132–5143.
|
| 273 |
+
[16] H. Yang, M. Fang, and J. Liu, “Achieving linear speedup with partial worker participation in non-iid federated learning,” arXiv preprint arXiv:2101.11203, 2021.
|
| 274 |
+
[17] S. P. Karimireddy, M. Jaggi, S. Kale, M. Mohri, S. J. Reddi, S. U. Stich, and A. T. Suresh, “Mime: Mimicking centralized stochastic algorithms in federated learning,” arXiv preprint arXiv:2008.03606, 2020.
|
| 275 |
+
[18] R. Das, A. Hashemi, S. Sanghavi, and I. S. Dhillon, “Improved convergence rates for non-convex federated learning with compression,” arXiv preprint arXiv:2012.04061, 2020.
|
| 276 |
+
[19] B. Woodworth, K. K. Patel, S. U. Stich, Z. Dai, B. Bullins, H. B. McMahan, O. Shamir, and N. Srebro, “Is local sgd better than minibatch sgd?” arXiv preprint arXiv:2002.07839, 2020.
|
| 277 |
+
[20] H. Yu and R. Jin, “On the computation and communication complexity of parallel sgd with dynamic batch sizes for stochastic non-convex optimization,” in International Conference on Machine Learning. PMLR, 2019, pp. 7174–7183.
|
| 278 |
+
[21] J. Wang and G. Joshi, “Cooperative sgd: A unified framework for the design and analysis of local-update sgd algorithms,” Journal of Machine Learning Research, vol. 22, no. 213, pp. 1–50, 2021.
|
| 279 |
+
[22] A. Khaled, K. Mishchenko, and P. Richtárik, “Better communication complexity for local sgd,” arXiv, 2019.
|
| 280 |
+
[23] S. U. Stich, “Local sgd converges fast and communicates little,” arXiv preprint arXiv:1805.09767, 2018.
|
| 281 |
+
[24] T. Lin, S. U. Stich, K. K. Patel, and M. Jaggi, “Don’t use large mini-batches, use local sgd,” in International Conference on Learning Representations, 2020.
|
| 282 |
+
[25] F. Zhou and G. Cong, “On the convergence properties of a k-step averaging stochastic gradient descent algorithm for nonconvex optimization,” in Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, 7 2018, pp. 3219–3227.
|
| 283 |
+
[26] F. Sattler, S. Wiedemann, K.-R. Müller, and W. Samek, “Robust and communication-efficient federated learning from non-iid data,” IEEE transactions on neural networks and learning systems, vol. 31, no. 9, pp. 3400–3413, 2019.
|
| 284 |
+
[27] Y. Zhao, M. Li, L. Lai, N. Suda, D. Civin, and V. Chandra, “Federated learning with non-iid data,” arXiv preprint arXiv:1806.00582, 2018.
|
| 285 |
+
[28] J. Wang, V. Tantia, N. Ballas, and M. Rabbat, “Slowmo: Improving communication-efficient distributed sgd with slow momentum,” arXiv preprint arXiv:1910.00643, 2019.
|
| 286 |
+
[29] X. Liang, S. Shen, J. Liu, Z. Pan, E. Chen, and Y. Cheng, “Variance reduced local sgd with lower communication complexity,” arXiv preprint arXiv:1912.12844, 2019.
|
| 287 |
+
[30] P. Sharma, P. Khanduri, S. Bulusu, K. Rajawat, and P. K. Varshney, “Parallel restarted SPIDER – communication efficient distributed nonconvex optimization with optimal computation complexity,” arXiv preprint arXiv:1912.06036, 2019.
|
| 288 |
+
[31] S. J. Reddi, S. Kale, and S. Kumar, “On the convergence of adam and beyond,” arXiv preprint arXiv:1904.09237, 2019.
|
| 289 |
+
[32] A. Koloskova, N. Loizou, S. Boreiri, M. Jaggi, and S. Stich, “A unified theory of decentralized sgd with changing topology and local updates,” in International Conference on Machine Learning. PMLR, 2020, pp. 5381–5393.
|
| 290 |
+
[33] R. Johnson and T. Zhang, “Accelerating stochastic gradient descent using predictive variance reduction,” in Advances in Neural Information Processing Systems 26. Curran Associates, Inc., 2013, pp. 315–323.
|
| 291 |
+
[34] L. Bottou, F. E. Curtis, and J. Nocedal, “Optimization methods for large-scale machine learning,” SIAM Review, vol. 60, no. 2, pp. 223–311, 2018.
|
| 292 |
+
[35] Y. Drori and O. Shamir, “The complexity of finding stationary points with stochastic gradient descent,” in International Conference on Machine Learning. PMLR, 2020, pp. 2658–2667.
|
| 293 |
+
[36] D. A. E. Acar, Y. Zhao, R. Matas, M. Mattina, P. Whatmough, and V. Saligrama, “Federated learning based on dynamic regularization,” in International Conference on Learning Representations, 2020.
|
| 294 |
+
[37] S. Caldas, S. M. K. Duddu, P. Wu, T. Li, J. Konecnˇ ý, H. B. McMahan, V. Smith, and A. Talwalkar, “Leaf: A benchmark for federated settings,” 2019.
|
md/train/goEdyJ_nVQI/goEdyJ_nVQI.md
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On the Validity of Modeling SGD with Stochastic Differential Equations (SDEs)
|
| 2 |
+
|
| 3 |
+
Zhiyuan Li Sadhika Malladi Sanjeev Arora Princeton University {zhiyuanli,smalladi,arora}@cs.princeton.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
It is generally recognized that finite learning rate (LR), in contrast to infinitesimal LR, is important for good generalization in real-life deep nets. Most attempted explanations propose approximating finite-LR SGD with Ito Stochastic Differential ˆ Equations (SDEs), but formal justification for this approximation (e.g., (Li et al., 2019a)) only applies to SGD with tiny LR. Experimental verification of the approximation appears computationally infeasible. The current paper clarifies the picture with the following contributions: (a) An efficient simulation algorithm SVAG that provably converges to the conventionally used Ito SDE approximation. (b) A theo- ˆ retically motivated testable necessary condition for the SDE approximation and its most famous implication, the linear scaling rule (Goyal et al., 2017), to hold. (c) Experiments using this simulation to demonstrate that the previously proposed SDE approximation can meaningfully capture the training and generalization properties of common deep nets.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Training with Stochastic Gradient Gescent (SGD) (1) and finite learning rate (LR) is largely considered essential for getting best performance out of deep nets: using infinitesimal LR (which turns the process into Gradient Flow (GF)) or finite LR with full gradients results in noticeably worse test error despite sometimes giving better training error (Wu et al., 2020; Smith et al., 2020; Bjorck et al., 2018).
|
| 12 |
+
|
| 13 |
+
Mathematical explorations of the implicit bias of finite-LR SGD toward good generalization have focused on the noise arising from gradients being estimated from small batches. This has motivated modeling SGD as a stochastic process and, in particular, studying Stochastic Differential Equations (SDEs) to understand the evolution of net parameters.
|
| 14 |
+
|
| 15 |
+
Early attempts to analyze the effect of noise try to model it as as a fixed Gaussian (Jastrzebski et al., 2017; Mandt et al., 2017). Current approaches approximate SGD using a parameter-dependent noise distribution that match the first and second order moments of of the SGD (Equation (2)). It is important to realize that this approximation is heuristic for finite LR, meaning it is not known whether the two trajectories actually track each other closely. Experimental verification seems difficult because simulating the (continuous) SDE requires full gradient/noise computation over suitably fine time intervals. Recently, Li et al. (2017, 2019a); Feng et al. (2017); Hu et al. (2019) provided rigorous proofs that the trajectories are arbitrarily close in a natural sense, but the proof needs the LR of SGD to be an unrealistically small (unspecified) constant so the approximation remains heuristic. In the worst case, the LR needs to be exponentially small, i.e., $e ^ { - { \bar { \Omega } } { \bar { ( } } T ) }$ , where $T$ is the continuous training time. Furthermore, noise plays no role in these approximation analyses and the same analysis indeed shows GD, SGD and SDE all converge weakly to GF at the same rate. Thus whenever their requirements for LR are met, there should be no performance difference between SGD and full-batch GD. However, for a common practical LR choice we observe some difference in Figure 1, indicating that the LR is usually outside of the regime their result requires.
|
| 16 |
+
|
| 17 |
+
Setting aside the issue of correctness of the SDE approximation, there is no doubt it has yielded important insights of practical importance, especially the linear scaling rule (LSR; see Definition 2.1) relating batch size and optimal LR, which allows much faster training using high parallelism (Krizhevsky, 2014; Goyal et al., 2017). However, since the scaling rule depends upon the validity of the SDE approximation, it is not mathematically understood when the rule fails. (Empirical investigation, with some intuition based upon analysis of simpler models, appears in (Goyal et al., 2017; Smith et al., 2020).
|
| 18 |
+
|
| 19 |
+
This paper casts new light on the SDE approximation via the following contributions:
|
| 20 |
+
|
| 21 |
+
1. A new and efficient numerical method, Stochastic Variance Amplified Gradient (SVAG), to test if the trajectories of SGD and its corresponding SDE are close for a given model, dataset, and hyperparameter configuration. In Theorem 4.3, we prove (using ideas similar to Li et al. (2019a)) that SVAG provides an order-1 weak approximation to the corresponding SDE. (Section 4)
|
| 22 |
+
2. Empirical testing showing that the trajectory under SVAG converges and closely follows SGD, suggesting (in combination with the previous result) that the SDE approximation can be a meaningful approach to understanding the implicit bias of SGD in deep learning.
|
| 23 |
+
3. New theoretical insight into the observation in (Goyal et al., 2017; Smith et al., 2020) that linear scaling rule fails at large LR/batch sizes (Section 5). It applies to networks that use normalization layers (scale-invariant nets in Arora et al. (2019b)), which includes most popular architectures. We give a necessary condition for the SDE approximation to hold: at equilibrium, the squared gradient norm must be smaller than its variance.
|
| 24 |
+
|
| 25 |
+
# 2 Preliminaries and Overview
|
| 26 |
+
|
| 27 |
+
We use $| \cdot |$ to denote the $\ell _ { 2 }$ norm of a vector and $\otimes$ to denote the tensor product. Stochastic Gradient Descent (SGD) is often used to solve optimization problems of the form $\begin{array} { r } { \operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } \mathcal { L } ( x ) : = \mathbb { E } _ { \gamma } \mathcal { L } _ { \gamma } ( x ) } \end{array}$ where $\{ \mathcal { L } _ { \gamma } : \gamma \in \Gamma \}$ is a family of functions from $\mathbb { R } ^ { d }$ to $\mathbb { R }$ and $\gamma$ is a $\Gamma$ -valued variable, e.g., denoting a random batch of training data. We consider the general case of an expectation over arbitrary index sets and distributions.
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
x _ { k + 1 } = x _ { k } - \eta \nabla { \mathcal { L } } _ { \gamma _ { k } } ( x _ { k } ) , \qquad ( S G D )
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where each $\gamma _ { k }$ is an i.i.d. random variable with the same distribution as $\gamma$ . Taking learning rate (LR) $\eta$ toward 0 turns SGD into (deterministic) Gradient Descent (GD) with infinitesimal LR, also called Gradient Flow. Infinitesimal LR is more compatible with traditional calculus-based analyses, but SGD with finite LR yields the best generalization properties in practice. Stochastic processes give a way to (heuristically) model SGD as a continuous-time evolution (i.e., stochastic differential equation or SDE) without ignoring the crucial role of noise. Driven by the intuition that the benefit of SGD depends primarily on the covariance of noise in gradient estimation (and not, say, the higher moments), researchers arrived at following SDE for parameter vector $X _ { t }$ :
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathrm { d } X _ { t } = - \nabla \mathcal { L } \big ( X _ { t } \big ) \mathrm { d } t + \big ( \eta \Sigma ( X _ { t } ) \big ) ^ { 1 / 2 } \mathrm { d } W _ { t } \qquad ( S D E a p p r o x i m a t i o n )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $W _ { t }$ is Wiener Process, and $\Sigma ( X ) : = \mathbb { E } [ ( \nabla \mathcal { L } _ { \gamma } ( X ) - \nabla \mathcal { L } ( X ) ) ( \mathcal { L } _ { \gamma } ( X ) - \nabla \mathcal { L } ( X ) ) ^ { \top } ]$ is the covariance of the gradient noise. When the gradient noise is modeled by white noise as above, it is called an Ito SDE ˆ . Replacing $W _ { t }$ with a more general distribution with stationary and independent increments (i.e., a $L \acute { e }$ vy process , described in Definition A.1) yields a $L e \nu y S D E$ .
|
| 40 |
+
|
| 41 |
+
The SDE view—specifically, the belief in key role played by noise covariance—motivated the famous Linear Scaling Rule, a rule of thumb to train models with large minibatch sizes (e.g., in highly parallel architectures) by changing LR proportionately, thereby preserving the scale of the gradient noise.
|
| 42 |
+
|
| 43 |
+
Definition 2.1 (Linear Scaling Rule (LSR)). (Krizhevsky, 2014; Goyal et al., 2017) When multiplying the minibatch size by $\kappa > 0$ , multiply the learning rate (LR) also by $\kappa$ .
|
| 44 |
+
|
| 45 |
+
If the SDE approximation accurately captures the SGD dynamics for a specific training setting, then LSR should work; however, LSR can work even when the SDE approximation fails. We hope to (1) understand when and why the SDE approximation can fail and (2) provide provable and practically applicable guidance on when LSR can fail. Experimentally verifying if the SDE approximation is valid is computationally challenging, because it requires repeatedly computing the full gradient and the noise covariance at very fine time intervals, e.g. the Euler-Maruyama method Equation (16). We are not aware of any empirical verification using conventional techniques, which we discuss in more detail in Appendix A.1. Section 4 gives a new, tractable simulation algorithm, SVAG, and presents theory and experiments suggesting it is a reasonably good approximation to both the SDE and SGD.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: Non-Gaussian noise is not essential to SGD performance. SGD with batch size 125 and NGD with matching covariance have close train and test curves when training on CIFAR-10. $\eta = 0 . 8$ for all three settings and is decayed by 0.1 at step 24000. GD achieves $7 5 . 5 \%$ test accuracy, and SGD and NGD achieve $8 9 . 4 \%$ and $8 9 . 3 \%$ , respectively. We smooth the training curve by dividing it into intervals of 100 steps and recording the average. For efficient sampling of Gaussian noise, we use GroupNorm instead of BatchNorm and turn off data augmentation. The sudden drop of accuracy when using GD is not a coincidence, but a consequence of interplay between normalization and Weight Decay. See more discussion and implementation details in Appendix F.3.
|
| 49 |
+
|
| 50 |
+
Formalizing closeness of two stochastic processes. Two stochastic processes (e.g., SGD and SDE) track each other closely if they lead to similar distributions on outcomes (e.g., trained nets). Mathematics formulates closeness of distributions in terms of expectations of suitable classes of test functions1; see Section 4.2. The test functions of greatest interest for ML are of course train and test error. These do not satisfy formal conditions such as differentiability assumed in classical theory but can be still used in experiments (see Figure 4). Section 5 uses test functions such as weight norm $\left| x _ { t } \right|$ , gradient norm $| \nabla \mathcal { L } ( \bar { x _ { t } } ) |$ and trace of noise covariance $\mathrm { T r } [ \Sigma ( x _ { t } ) ]$ and proves a sufficient condition for the failure of SDE approximation.
|
| 51 |
+
|
| 52 |
+
Mathematical analyses of closeness of SGD and SDE will often consider the discrete process
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r l r l } & { \hat { x } _ { k + 1 } = \hat { x } _ { k } - \eta \nabla \mathcal { L } ( \hat { x } _ { k } ) + \eta \Sigma ^ { \frac { 1 } { 2 } } ( \hat { x } _ { k } ) z _ { k } , } & & { ( N o i s y \ G r a d i e n t \ D e s c e n t / N G D ) } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $z _ { k } \overset { \mathrm { i . i . d . } } { \sim } N ( 0 , I _ { d } )$ . A basic step in analysis will be the following Error Decomposition:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathbb { E } g ( X _ { \eta k } ) - \mathbb { E } g ( x _ { k } ) = \underbrace { ( \mathbb { E } g ( X _ { \eta k } ) ) - \mathbb { E } g ( \hat { x } _ { k } ) ) } _ { \mathrm { D i s c r e t i z a t i o n ~ E r r o r ~ \eta ~ } } + \underbrace { ( \mathbb { E } g ( \hat { x } _ { k } ) - \mathbb { E } g ( x _ { k } ) ) } _ { \mathrm { G a p ~ d u e t o ~ n o n . } \mathrm { G a u s s i a n ~ n o i s e } }
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Understanding the failure caused by discretization error: In Section 5, a testable condition of SDE approximation is derived for scale-invariant nets (i.e. nets using normalization layers). This condition only involves the Noise-Signal-Ratio, but not the shape of the noise. We further extend this condition to LSR and develops a method predicting the largest batch size at which LSR succeeds, which only takes a single run with small batch size.
|
| 65 |
+
|
| 66 |
+
# 2.1 Understanding the Role of Non-Gaussian Noise
|
| 67 |
+
|
| 68 |
+
Some works have challenged the traditional assumption that SGD noise is Gaussian. Simsekli et al. (2019); Nguyen et al. (2019) suggested that SGD noise is heavy-tailed, which Zhou et al. (2020) claimed causes adaptive gradient methods to generalize better than SGD. Xie et al. (2021) argued that the experimental evidence in (Simsekli et al., 2019) made strong assumptions on the nature of the gradient noise, and we furthermore prove in Appendix B.3 that their measurement method could flag Gaussian distributions as non-Gaussian. Below, we clarify how the Gaussian noise assumption interacts with our findings.
|
| 69 |
+
|
| 70 |
+
Non-Gaussian noise is not essential to SGD performance. We provide experimental evidence in Figure 1 and Appendix F.3 that SGD (1) and NGD (3) with matching covariances achieve similar test performance on CIFAR10 ( $\sim 8 9 \%$ ), suggesting that even if the gradient noise in SGD is non-Gaussian, modeling it by a Gaussian estimation is sufficient to understand generalization properties. Similar experiments were conducted in (Wu et al., 2020) but used SGD with momentum and BatchNorm, which prevents the covariance of NGD noise from being equal to that of SGD. These findings confirm the conclusion in (Cheng et al., 2020) that differences in the third-and-higher moments in SGD noise don’t affect the test accuracy significantly, though differences in the second moments do.
|
| 71 |
+
|
| 72 |
+
LSR can work when SDE approximation fails. We note that (Smith et al., 2020) derives LSR (Definition 2.1) by assuming the Ito SDE approximation ( ˆ 2) holds, but in fact the validity of the SDE approximation is a sufficient but not necessary condition for LSR to work. In Section B.1, we provide a concrete example where LSR holds for all LRs and batch sizes, but the dynamics are constantly away from the Ito SDE limit. This example also illustrates that the failure of the SDE approximation ˆ can be caused solely by non-Gaussian noise, even when there is no discretization error (i.e., the loss landscape and noise distribution are parameter-independent).
|
| 73 |
+
|
| 74 |
+
SVAG does not require Gaussian gradient noise. In Section 4, we present an efficient algorithm SVAG to simulate the Ito SDE corresponding to a given training setting. In particular, Theorem ˆ 4.3 reveals that SVAG simultaneously causes the discretization error and the gap by non-Gaussian noise to disappear as it converges to the SDE approximation. From Figure 4 and Appendix F.1, we can observe that for vision tasks, the test accuracy of deep nets trained by SGD in standard settings stays the same when interpolating towards SDE via SVAG, suggesting that neither the potentially non-Gaussian nature of SGD noise nor the discrete nature of SGD dynamics is an essential ingredient of the generalization mystery of deep learning.
|
| 75 |
+
|
| 76 |
+
# 3 Related Work
|
| 77 |
+
|
| 78 |
+
Applications of the SDE approximation in deep learning. One component of the SDE approximation is the gradient noise distribution. When the noise is an isotropic Gaussian distribution (i.e., $\Sigma ( X _ { t } ) \equiv I \Sigma$ ), then the equilibrium of the SDE is the Gibbs distribution. Shi et al. (2020) used an isotropic Gaussian noise assumption to derive a convergence rate on SGD that clarifies the role of the LR during training. Several works have relaxed the isotropic assumption but assume the noise is constant. Mandt et al. (2017) assumed the covariance $\Sigma ( X )$ is locally constant to show that SGD can be used to perform Bayesian posterior inference. Zhu et al. (2019) argued that when constant but anisotropic SGD noise aligns with the Hessian of the loss, SGD is able to more effectively escape sharp minima. When noise covariance $\Sigma ( X _ { t } )$ is uniformly positive definite, Hu et al. (2019) showed that SDE approximation Equation (2) escapes strict saddle points in $O ( \ln \eta ^ { - 1 } )$ time, which matches the $O ( \eta ^ { - 1 } \mathbf { \bar { l n } } \eta ^ { - 1 } )$ escaping rate for SGD (Fang et al., 2019; Jin et al., 2017).
|
| 79 |
+
|
| 80 |
+
Recently, many works have used the most common form of the SDE approximation (2) with parameterdependent noise covariance. Li et al. (2020) and Kunin et al. (2020) used the symmetry of loss (scale invariance) to derive properties of dynamics (i.e., $\Sigma ( X _ { t } ) X _ { t } = 0 \Sigma$ ). Li et al. (2020) further used this property to explain the phenomenon of sudden rising error after LR decay in training. Smith et al. (2020) used the SDE to derive the linear scaling rule (Goyal et al. (2017) and Definition 2.1) for infinitesimally small LR. Xie et al. (2021) constructed a SDE-motivated diffusion model to propose why SGD favors flat minima during optimization. Cheng et al. (2020) analyzed MCMC-like continuous dynamics and construct an algorithm that provably converges to this limit, although their dynamics do not model SGD.
|
| 81 |
+
|
| 82 |
+
Theoretical Foundations of the SDE approximation for SGD. Despite the popularity of using SDEs to study SGD, theoretical justification for this approximation has generally relied upon tiny LR (Li et al., 2019a; Hu et al., 2019). Cheng et al. (2020) proved a strong approximation result for an SDE and MCMC-like dynamics, but not SGD. Wu et al. (2020) argued that gradient descent with Gaussian noise can generalize as well as SGD, but their convergence proof also relied on an infinitesimally small LR.
|
| 83 |
+
|
| 84 |
+
LR and Batch Size. It is well known that using large batch size or small LR will lead to worse generalization (Bengio, 2012; LeCun et al., 2012). According to (Keskar et al., 2017), generalization is harmed by the tendency for large-batch training to converge to sharp minima, but Dinh et al. (2017) argued that the invariance in ReLU networks can permit sharp minima to generalize well too. Li et al. (2019b) argued that the LR can change the order in which patterns are learned in a non-homogeneous synthetic dataset. Several works (Hoffer et al., 2017; Smith and Le, 2018; Chaudhari and Soatto, 2018; Smith et al., 2018) have had success using a larger LR to preserve the scale of the gradient noise and hence maintain the generalization properties of small-batch training. The relationship between LR and generalization remains hazy, as (Shallue et al., 2019) empirically demonstrated that the generalization error can depend on many other training hyperparameters.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Ito SDE (ˆ 2), SVAG (5), and SGD (1) trajectories (blue) sampled from a distribution (green). Li et al. (2019a) show that $\forall T$ , $\exists \eta$ such that SDE (a) and SGD (c) are order-1 weak approximations (Definition 4.2) of each other. Our result (Theorem 4.3) shows that $\forall T , \eta$ , $\exists l$ such that SDE (a) and SVAG (b) are order-1 weak approximations of each other. In particular, Li et al. (2019a) requires an infinitesimal $\eta$ and our result holds for finite $\eta$ .
|
| 88 |
+
|
| 89 |
+
# 4 Stochastic Variance Amplified Gradient (SVAG)
|
| 90 |
+
|
| 91 |
+
Experimental verification of the SDE approximation appears computationally intractable by traditional methods. We provide an algorithm, Stochastic Variance Amplified Gradient (SVAG), that efficiently simulates and provably converges to the Ito SDE ( ˆ 2) for a given training setting (Theorem 4.3). Moreover, we use SVAG to experimentally verify that the SDE approximation closely tracks SGD for many common settings (Figure 4; additional settings in Appendix F).
|
| 92 |
+
|
| 93 |
+
# 4.1 The SVAG Algorithm
|
| 94 |
+
|
| 95 |
+
For a chosen hyperparameter $l \in \mathbb { N } ^ { + }$ , we define
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
x _ { k + 1 } = x _ { k } - \frac { \eta } { l } \nabla \mathcal { L } _ { \bar { \gamma } _ { k } } ^ { l } ( x _ { k } ) ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\bar { \gamma } _ { k } = ( \gamma _ { k , 1 } , \gamma _ { k , 2 } )$ with $\gamma _ { k , 1 } , \gamma _ { k , 2 }$ sampled independently and
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal { L } _ { \bar { \gamma } _ { k } } ^ { l } ( \cdot ) : = \frac { 1 + \sqrt { 2 l - 1 } } { 2 } \mathcal { L } _ { \gamma _ { k , 1 } } ( \cdot ) + \frac { 1 - \sqrt { 2 l - 1 } } { 2 } \mathcal { L } _ { \gamma _ { k , 2 } } ( \cdot ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
SVAG is equivalent to performing SGD on a new distribution of loss functions constructed from the original distribution: the new loss function is a linear combination of two independently sampled losses $\mathcal { L } _ { \gamma _ { k , 1 } }$ and $\mathcal { L } _ { \gamma _ { k , 2 } }$ , usually corresponding to the losses on two independent batches. This ensures that the expected gradient is preserved while amplifying the gradient covariance by a factor of $l$ , i.e., $\begin{array} { r } { \sqrt { \frac { \eta } { l } } \Sigma ^ { l } ( x ) = \sqrt { \eta } \Sigma ^ { 1 } ( x ) } \end{array}$ , where $\Sigma ^ { l } ( \boldsymbol { x } ) : = \mathbb { E } [ ( \nabla \mathcal { L } _ { \boldsymbol { \bar { \gamma } } } ^ { l } ( \boldsymbol { x } ) - \nabla \mathcal { L } ^ { l } ( \boldsymbol { x } ) ) ( \mathcal { L } _ { \boldsymbol { \bar { \gamma } } } ^ { l } ( \boldsymbol { x } ) - \nabla \mathcal { L } ^ { l } ( \boldsymbol { x } ) ) ^ { \top } ]$ . Therefore, the Ito SDE that matches the first and second order moments is always ( ˆ 2). We note that SVAG is equivalent to SGD when $l = 1$ , and both the expectation and covariance of the one-step update $( x _ { k + 1 } - x _ { k } )$ are proportional to $1 / l$ , meaning the direction of the update is noisier when $l$ increases.
|
| 108 |
+
|
| 109 |
+
# 4.2 SVAG Approximates the SDE
|
| 110 |
+
|
| 111 |
+
Definition 4.1 (Test Functions). Class $G$ of continuous functions $\mathbb { R } ^ { d } \to \mathbb { R }$ has polynomial growth if $\forall g \in G$ there exist positive integers $\kappa _ { 1 } , \kappa _ { 2 } > 0$ such that for all $x \in \mathbb { R } ^ { d }$ , $| g ( x ) \bar { | } \leq \kappa _ { 1 } ( 1 + | \bar { x } | ^ { 2 \kappa _ { 2 } } )$ .
|
| 112 |
+
|
| 113 |
+
For $\alpha \in \mathbb { N } ^ { + }$ , we denote by $G ^ { \alpha }$ the set of $\alpha$ -times continuously differentiable functions $g$ where all partial derivatives of form $\frac { \partial ^ { \overline { { \alpha } } } g } { \partial x _ { 1 } ^ { \alpha _ { 1 } } \cdots \partial x _ { d } ^ { \alpha _ { d } } }$ s.t. Pdi=1 ↵i = ↵ ↵, are also in G.
|
| 114 |
+
|
| 115 |
+
Definition 4.2 (Order- $\alpha$ weak approximation). Let $\{ X _ { t } ^ { \eta } : t \in [ 0 , T ] \}$ $\{ x _ { k } ^ { \eta } \} _ { k = 0 } ^ { \lfloor \frac { T } { \eta } \rfloor }$ be families ⌘ continuous and discrete stochastic processes parametrized by $\eta$ . We say $\{ X _ { t } ^ { \eta } \}$ and $\{ x _ { k } ^ { \eta } \}$ $\alpha$
|
| 116 |
+
|
| 117 |
+
weak approximations of each other if for every $g \in G ^ { 2 ( \alpha + 1 ) }$ , there is a constant $C > 0$ independent of $l$ such that
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\operatorname* { m a x } _ { k = 0 , \ldots , \lfloor \frac { T } { \eta } \rfloor } \Big | \mathbb { E } g ( x _ { k } ^ { \eta } ) - \mathbb { E } g ( X _ { k \eta } ^ { \eta } ) \Big | \leq C \eta ^ { \alpha } .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
When applicable, we drop the superscript $\eta$ , and say $\{ X _ { t } \}$ and $\{ x _ { k } \}$ are order- $\alpha$ (or $\alpha$ order) approximations of each other.
|
| 124 |
+
|
| 125 |
+
We now show that SVAG converges weakly to the Ito SDE approximation in ( ˆ 2) when $l \infty$ , i.e., $x _ { l k }$ and $X _ { k \eta }$ have the roughly same distribution. Figure 2 highlights the differences between our result and (Li et al., 2019a). Figure 4 provide verification of the below theorem, and additional settings are studied in Appendix F.
|
| 126 |
+
|
| 127 |
+
Theorem 4.3. Suppose the following conditions2 are met:
|
| 128 |
+
|
| 129 |
+
(i) $\mathcal { L } \equiv \mathbb { E } \mathcal { L } _ { \gamma }$ is ${ \mathcal { C } } ^ { \infty }$ -smooth, and $\mathcal { L } \in G ^ { 4 }$ .
|
| 130 |
+
(ii) $| \nabla \mathcal { L } _ { \gamma } ( x ) - \nabla \mathcal { L } _ { \gamma } ( y ) | \le L _ { \gamma } | x - y |$ , for all $x , y \in \mathbb { R } ^ { d }$ , where $L _ { \gamma } > 0$ is a random variable with finite moments, i.e., $\mathbb { E } L _ { \gamma } ^ { k }$ is bounded for $k \in \mathbb { N } ^ { + }$ .
|
| 131 |
+
(iii) $\Sigma ^ { \frac { 1 } { 2 } } ( X )$ is ${ \mathcal { C } } ^ { \infty }$ -smooth in $X$ .
|
| 132 |
+
|
| 133 |
+
Let $T > 0$ be a constant and $l$ be the SVAG hyperparameter (5). Define $\{ X _ { t } : t \in [ 0 , T ] \}$ as the stochastic process (independent of $\eta$ ) satisfying the Ito SDE ( ˆ 2) and $\{ x _ { k } ^ { \eta / \iota } : 1 \leq k \leq \lfloor l T / \eta \rfloor \}$ as the trajectory of SVAG (5) where $x _ { 0 } = X _ { 0 }$ . Then, SVAG $\{ x _ { k } ^ { \eta / l } \}$ is an order-1 weak approximation of the $S D E \left\{ X _ { t } \right\}$ , i.e. for each $g \in G ^ { 4 }$ , there exists a constant $C > 0$ independent of $l$ such that
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\operatorname* { m a x } _ { k = 0 , \dots , \lfloor l T / \eta \rfloor } | \mathbb { E } g ( x _ { k } ^ { \eta / \iota } ) - \mathbb { E } g ( X _ { \frac { k \eta } { l } } ) | \leq C l ^ { - 1 } .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Remark 4.4. Lipschitz conditions like (ii) are often not met by deep learning objectives. For instance using normalization schemes can make derivatives unbounded, but if the trajectory $\{ x _ { t } \}$ stays bounded away from the origin and infinity, then (ii) holds.
|
| 140 |
+
|
| 141 |
+
Remark 4.5. Though technically the weak approximation result (Theorem 4.3) only applies when the stochastic gradient is sampled independently at each step, experimentally we found the difference between performance of SGD and SVAG is negligible among different sampling methods, including random shuffling, sampling with and without replacement. (See detailed discussions in Appendix F.1 and Figure 7) This experimental evidence suggests the validity of SDE approximation doesn’t change with sampling methods used in practice.
|
| 142 |
+
|
| 143 |
+
# 4.3 Proof Overview
|
| 144 |
+
|
| 145 |
+
Let $\{ X _ { t } ^ { x , s } : t \geq s \}$ denote the stochastic process obeying the Ito SDE ( ˆ 2) starting from time $s$ and with the initial condition $X _ { s } ^ { x , s } = x$ and $\{ x _ { k } ^ { x , j } : k \geq j \}$ denote the stochastic process (depending on l) satisfying SVAG (5) with initial condition xx,jj $x _ { j } ^ { x , j } = x$ . For convenience, we define $\widetilde { X } _ { k } : = X _ { \frac { k \eta } { l } }$ and write $\widetilde { X } _ { k } ^ { x , j } : = X _ { \frac { k \eta } { l } } ^ { x , \frac { j \eta } { l } }$ . Alternatively, we write $\widetilde { X } _ { k } ( x , j ) : = \widetilde { X } _ { k } ^ { x , j }$ and $x _ { k } ( x , j ) : = x _ { k } ^ { x , j }$ .
|
| 146 |
+
|
| 147 |
+
Now for any $\begin{array} { r } { 1 \le k \le \lfloor \frac { l T } { \eta } \rfloor } \end{array}$ , we interpolate between a SVAG solution $x _ { k }$ and SDE solution $\smash { \widetilde { X } } _ { k }$ through a series of hybrid trajectories $\widetilde { X } _ { k } ( \boldsymbol { x } _ { j } , j )$ , i.e., the weight achieved by running SVAG for the first $j$ steps and then SDE from time $j$ to $k$ . The two limits of the interpolation are $\widetilde { X } _ { k } ( x _ { k } , k ) = x _ { k }$ (i.e., SVAG solution after $k$ steps) and $\widetilde { X } _ { k } ( x _ { 0 } , 0 ) = \widetilde { X } _ { k }$ (i.e., SDE solution after $k$ time). This yields the following error decomposition for a test function $g \in G$ (see Definition 4.1).
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
| \mathbb { E } g ( x _ { k } ) - \mathbb { E } g ( X _ { \frac { k \eta } { l } } ) | = | \mathbb { E } g ( x _ { k } ) - \mathbb { E } g ( \widetilde { X } _ { k } ) | \leq \sum _ { j = 0 } ^ { k - 1 } \left| \mathbb { E } g ( \widetilde { X } _ { k } ( x _ { j + 1 } , j + 1 ) ) - \mathbb { E } g ( \widetilde { X } _ { k } ( x _ { j } , j ) ) \right|
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
Note that each pair of adjacent hybrid trajectories only differ by a single step of SVAG or SDE. We show that the one-step increments of SVAG and SDE are close in distribution along the entire trajectory by computing their moments (Lemmas 4.6 and 4.7). Then, using the Taylor expansion of $g$ , we can show that the single-step approximation error from switching from SVAG to SDE is uniformly upper bounded by $\begin{array} { r } { O \big ( \frac { \eta ^ { 2 } } { l ^ { 2 } } \big ) } \end{array}$ . (See Figure 6 for demonstration) Hence, the total error is $\begin{array} { r } { O ( k \frac { \eta ^ { 2 } } { l ^ { 2 } } ) = O ( \frac { \eta } { l } ) } \end{array}$ .
|
| 154 |
+
|
| 155 |
+
Lemma 4.6. Define the one-step increment of the Ito SDE as ˆ $\widetilde { \Delta } ( x ) = \widetilde { X } _ { 1 } ^ { x , 0 } - x$ . Then we have
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\begin{array} { r l r l } & { ( i ) \mathbb { E } \widetilde { \Delta } ( x ) = - \frac { \eta } { l } \nabla \mathcal { L } ( x ) + \mathcal { O } ( l ^ { - 2 } ) , } & { \quad } & { } & { ( \mathrm { i i } ) \mathbb { E } \widetilde { \Delta } ( x ) \widetilde { \Delta } ( x ) ^ { \top } = \frac { \eta ^ { 2 } } { l } \Sigma ( x ) + \mathcal { O } ( l ^ { - 2 } ) , } \\ & { ( i i ) \mathbb { E } \widetilde { \Delta } ( x ) ^ { \otimes 3 } = \mathcal { O } ( l ^ { - 2 } ) , } & { \quad } & { } & { ( \mathrm { i v } ) \sqrt { \mathbb { E } | \widetilde { \Delta } ( x ) ^ { \otimes 4 } | ^ { 2 } } = \mathcal { O } ( l ^ { - 2 } ) . } \end{array}
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
Lemma 4.7. Define the one-step increment of SVAG as $\Delta ( x ) = x _ { 1 } ^ { x , 0 } - x$ . Then we have
|
| 162 |
+
|
| 163 |
+
(i) $\begin{array} { r } { \mathbb E \Delta ( x ) = - \frac { \eta } { l } \nabla \mathcal L ( x ) } \end{array}$ , (iii) (ii) $\begin{array} { r l } & { \mathbb { E } \Delta ( x ) \Delta ( x ) ^ { \overset { } { \top } } = \frac { \eta ^ { 2 } } { l } \Sigma ( x ) + \frac { \eta ^ { 2 } } { l ^ { 2 } } \nabla \mathcal { L } ( x ) \nabla \mathcal { L } ( x ) ^ { \top } = \frac { \eta ^ { 2 } } { l } \Sigma ( x ) + \mathcal { O } ( l ^ { - 2 } ) , } \\ & { \mathbb { E } \Delta ( x ) ^ { \otimes 3 } = \frac { \eta ^ { 3 } } { l ^ { 2 } } \frac { 3 - l ^ { - 1 } } { 2 } \Lambda ( x ) + \frac { \eta ^ { 3 } } { l ^ { 3 } } ( 3 \overline { { \nabla \mathcal { L } ( x ) \otimes \Sigma ( x ) } } + \nabla \mathcal { L } ( x ) ^ { \otimes 3 } ) = \mathcal { O } ( l ^ { - 2 } ) } \end{array}$ (iv) $\sqrt { \mathbb { E } | \Delta ( x ) ^ { \otimes 4 } | ^ { 2 } } = \mathcal { O } ( l ^ { - 2 } )$ ,
|
| 164 |
+
|
| 165 |
+
where $\Lambda ( x ) : = \mathbb { E } ( \nabla { \mathcal { L } } _ { \gamma _ { 1 } } ( x ) - \nabla { \mathcal { L } } ( x ) ) ^ { \otimes 3 }$ , and $\overline { { \tau } }$ denotes the symmetrization of tensor $\tau$ , i.e., $\begin{array} { r } { \overline { { \mathcal { T } } } _ { i j k } = \frac { 1 } { 6 } \sum _ { i ^ { \prime } , j ^ { \prime } , k ^ { \prime } } \mathcal { T } _ { i ^ { \prime } j ^ { \prime } k ^ { \prime } } } \end{array}$ , where $i ^ { \prime } , j ^ { \prime } , k ^ { \prime }$ sums over all permutation of $i , j , k$ .
|
| 166 |
+
|
| 167 |
+
Though (i) and (ii) in Lemma 4.7 hold for any discrete update with $\begin{array} { r } { \mathrm { L R } = \frac { \eta } { l } } \end{array}$ that matches the first and second order moments of SDE (2), (iii) and (iv) could fail. For example, when decreasing LR according to LSR (Definition 2.1), even if we can use a fractional batch size and sample an infinitely divisible noise distribution, we may arrive at a different continuous limit if (iii) and (iv) are not satisfied. (See a more detailed discussion in Appendix B.2) SVAG is not the unique way to ensure (iii) and (iv), and any other design (e.g. using three copies per step and with different weights) satisfying Lemma 4.7 are also first order approximations of SDE (2), by the same proof.
|
| 168 |
+
|
| 169 |
+
# 5 Understanding the Failure of SDE Approximation and LSR
|
| 170 |
+
|
| 171 |
+
In this section, we analyze how discretization error, caused by large LR, leads to the failure of the SDE approximation (Section 5.1) and LSR (Section 5.2) for scale invariant networks (e.g., nets equipped with BatchNorm (Ioffe and Szegedy, 2015) and GroupNorm (Wu and He, 2018)). To get best generalization, practitioners often add Weight Decay (WD, a.k.a $\ell _ { 2 }$ regularization; see (7)). Intriguingly, unlike the traditional setting where $\ell _ { 2 }$ regularization controls the capacity of function space, for scale invariant networks, each norm ball has the same expressiveness regardless of the radius, and thus WD only regularize the model implicitly via affecting the dynamics. Li et al. (2020) explained such phenomena by showing for training with Normalization, WD and constant LR, the parameter norm converges and WD affects ‘effective LR’ by controlling the limiting value of the parameter norm. That paper also gave experiments showing that the training loss will reach some plateau, and gave evidence of training reaching an ”equilibrium” distribution that it does not get out of unless if some hyperparameter is changed. Throughout this section we assume the existence of equilibrium for SGD and SDE.
|
| 172 |
+
|
| 173 |
+
To quantify differences in training algorithms, we would ideally work with statistics like the train/test loss and accuracy achieved, but characterizing optimization and generalization properties of deep networks beyond the NTK regime (Jacot et al., 2018; Allen-Zhu et al., 2019b; Du et al., 2019; Arora et al., $2 0 1 9 \mathrm { a }$ ; Allen-Zhu et al., 2019a) is in general an open problem. Therefore, we rely on other natural test functions (Definition 5.1).
|
| 174 |
+
|
| 175 |
+
# 5.1 Failure of SDE Approximation
|
| 176 |
+
|
| 177 |
+
In Theorem 5.2, we show that the SDE-approximation of SGD is bound to fail for these scale-invariant nets when LR gets too large. Specifically, using above-mentioned results we show that the equilibrium distributions of SGD and SDE are quite far from each other with respect to expectations of these natural test functions (Definition 5.1).
|
| 178 |
+
|
| 179 |
+
We consider the below SDE (6) with arbitrary expected loss $\mathcal { L } ( x )$ and covariance $\overline { { \Sigma } } ( x )$ , and the moment-matching SGD (7) satisfying $\mathbb { E } \mathcal { L } _ { \gamma } ( x ) = \mathcal { L } ( x )$ and $\overline { { \Sigma } } ( x ) = \eta \Sigma ( x )$ where $\Sigma ( x )$ is the covariance of $\nabla { \mathcal { L } } _ { \gamma } ( x )$ . In the entire Section 5, we will assume that for all $\gamma$ , $\mathcal { L } _ { \gamma }$ is scale invariant (Arora et al., 2019b; Li and Arora, 2020a), i.e., $\mathcal { L } _ { \gamma } ( x ) = \mathcal { L } _ { \gamma } ( c x ) , \forall c > 0$ and $x \in \mathbb { R } ^ { d } \backslash \{ 0 \}$ . 3
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\begin{array} { l } { \displaystyle \mathrm { d } X _ { t } = - \nabla \big ( \mathcal { L } ( X _ { t } ) + \frac { \lambda } { 2 } | X _ { t } | ^ { 2 } \big ) \mathrm { d } t + \overline { { \Sigma } } ^ { 1 / 2 } ( X _ { t } ) \mathrm { d } W _ { t } } \\ { \displaystyle x _ { k + 1 } = x _ { k } - \eta \nabla \big ( \mathcal { L } _ { \gamma _ { k } } ( x _ { k } ) + \frac { \lambda } { 2 } | x _ { k } | ^ { 2 } \big ) } \end{array}
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
We will measure the closeness of two distributions by three test functions: squared weight norm $| x | ^ { 2 }$ , squared gradient norm $| \nabla \mathcal { L } ( x ) | ^ { 2 }$ , and trace of noise covariance $\operatorname { T r } [ \Sigma ( x ) ]$ . We say two equilibrium distributions are $C$ -close if expectations of these test functions are within a multiplicative constant $C$
|
| 186 |
+
|
| 187 |
+
Definition 5.1 $C$ -closeness). Assuming the existence of the following limits, we use
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\begin{array} { r l r l } & { R _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } | x _ { t } | ^ { 2 } , } & & { \overline { { R } } _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } | X _ { t } | ^ { 2 } , } \\ & { G _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } | \nabla \mathcal { L } ( x _ { t } ) | ^ { 2 } , } & & { \overline { { G } } _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } | \nabla \mathcal { L } ( X _ { t } ) | ^ { 2 } , } \\ & { N _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } [ \mathrm { T r } [ \Sigma ( x _ { t } ) ] , } & & { \overline { { N } } _ { \infty } : = \underset { t \infty } { \mathrm { l i m } } \mathbb { E } [ \mathrm { T r } [ \overline { { \Sigma } } ( X _ { t } ) ] ] } \end{array}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
to denote the limiting squared weight norm, gradient norm and trace of covariance for SGD (7) and SDE (6). We say the two equilibriums are $C$ -close to each other iff
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\frac { 1 } { C } \leq \frac { R _ { \infty } } { \overline { { R } } _ { \infty } } , \frac { G _ { \infty } } { \overline { { G } } _ { \infty } } , \frac { \eta N _ { \infty } } { \overline { { N } } _ { \infty } } \leq C .
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
We call $\frac { N _ { \infty } } { G _ { \infty } }$ an d N1G the noise-to-signal ratio (NSR), and below we show that it plays an important 1role. When the LR of SGD significantly exceeds the NSR of the corresponding SDE, the approximation fails. Of course, we lack a practical way to calculate NSR of the SDE so this result is existential rather than effective. Therefore we give a condition in terms of NSR of the SGD that suffices to imply failure of the approximation. Experiments later in the paper show this condition is effective at showing divergence from SDE behavior.
|
| 200 |
+
|
| 201 |
+
Theorem 5.2. If either (i). $\begin{array} { r } { \eta > \frac { \overline { { N } } _ { \infty } } { \overline { { G } } _ { \infty } } ( C ^ { 2 } - 1 ) } \end{array}$ or (ii). $\begin{array} { r } { \frac { N _ { \infty } } { G _ { \infty } } < \frac { 1 } { C ^ { 2 } - 1 } } \end{array}$ , then the equilibria of SDE (6) and SGD (7) are not -close.
|
| 202 |
+
|
| 203 |
+
The high-level idea behind Theorem 5.2 is the observation that the norm dynamics of SGD (10) and SDE (9) differ by a second order discretization error related to the norm of full-batch gradient, $\eta ^ { 2 } \mathbb { E } | \nabla \mathcal { L } ( x _ { k } ) | ^ { 2 }$ . Thus intuitively, the two dynamics can be close only when the difference is tiny and negligible. We can make the argument formal by comparing the relationships between the above defined three metrics at the equilibrium of SGD Equation (11) and SDE Equation (12), and thus conclude that a sufficiently large noise-to-signal ratio (NSR) is a necessary condition for $C$ -closeness.
|
| 204 |
+
|
| 205 |
+
Here the role of scale invariance is to simplify the norm dynamics of both SGD (10) and SDE (9) by removing the cross term. This is because of a well-known property of scale-invariance, the orthogonality between gradient and the weight itself, i.e., $\langle \nabla \mathcal { L } _ { \gamma } ( x ) , \bar { x } \rangle \bar { = } 0$ for any $x , \gamma$ . (Lemma E.7)
|
| 206 |
+
|
| 207 |
+
Proof of Theorem 5.2. We will prove the the contrapositive statement: if the equilibriums of (7) and (6) are $C$ -close, then $\begin{array} { r } { \eta \leq \frac { \overline { { N } } _ { \infty } } { \overline { { G } } _ { \infty } } ( C ^ { 2 } - 1 ) } \end{array}$ and $\begin{array} { r } { \frac { 1 } { C ^ { 2 } - 1 } \le \frac { N _ { \infty } } { G _ { \infty } } } \end{array}$ N1G . Following the derivation in (Li et al., 2020), by Ito’s lemma: ˆ
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
\frac { \mathrm { d } } { \mathrm { d } t } \mathbb { E } | X _ { t } | ^ { 2 } = - 2 \lambda \mathbb { E } | X _ { t } | ^ { 2 } + \mathbb { E } \operatorname { T r } [ \Sigma ( X _ { t } ) ] .
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
Again by the orthogonality between gradient and weight, it can be shown that for SGD (7),
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\begin{array} { r l } & { \mathbb { E } | x _ { k + 1 } | ^ { 2 } - \mathbb { E } | x _ { k } | ^ { 2 } = ( 1 - \eta \lambda ) ^ { 2 } \mathbb { E } | x _ { k } | ^ { 2 } + \eta ^ { 2 } \mathbb { E } | \nabla { \mathcal { L } } _ { \gamma _ { k } } ( x _ { k } ) | ^ { 2 } - \mathbb { E } | x _ { k } | ^ { 2 } } \\ & { \qquad = \eta \lambda ( - 2 + \eta \lambda ) \mathbb { E } | x _ { k } | ^ { 2 } + \eta ^ { 2 } \mathbb { E } | \nabla { \mathcal { L } } ( x _ { k } ) | ^ { 2 } + \eta ^ { 2 } \mathbb { E } \operatorname { T r } [ \Sigma ( x _ { k } ) ] } \end{array}
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
If both $x _ { k }$ and $X _ { t }$ have reached their equilibriums, both LHS of (9) and (10) are 0, and therefore
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
\begin{array} { r l r } { ( 2 - \eta \lambda ) \lambda R _ { \infty } = \eta G _ { \infty } + \eta N _ { \infty } , } & { { } } & { } \\ { 2 \lambda \overline { { R } } _ { \infty } = } & { { } } & { \overline { { N } } _ { \infty } . } \end{array}
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
Combining (11), (12), and (8), we have
|
| 226 |
+
|
| 227 |
+
$$
|
| 228 |
+
\eta G _ { \infty } + \eta N _ { \infty } \leq 2 \lambda R _ { \infty } \leq 2 \lambda C \overline { { R } } _ { \infty } = C \overline { { N } } _ { \infty } .
|
| 229 |
+
$$
|
| 230 |
+
|
| 231 |
+
Applying (8) again, we hav $\eta \overline { { G } } _ { \infty } + \overline { { N } } _ { \infty } \leq C \eta ( G _ { \infty } + N _ { \infty } ) \leq C ^ { 2 } \overline { { N } } _ { \infty } \leq C ^ { 3 } \eta N _ { \infty }$ . The proof is completed by comparing the first and third, the second and the fourth terms respectively. □
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure 3: Experimental verification for our theory on predicting the failure of Linear Scaling Rule. We modify PreResNet-32 and VGG-19 to be scale-invariant (according to Appendix C of (Li et al., 2020)). All three settings use the same LR schedule, ${ \mathrm { L R } } { = } 0 . 8$ initially and is decayed by 0.1 at epoch 250 with 300 epochs total budget. Here, phase $G _ { t }$ and fore $N _ { t }$ are the empirical estimations of decay). Per the approximated ve $G _ { \infty }$ and of T $N _ { \infty }$ taken afterem 5.6, i.e., first, we $B ^ { * } = { \breve { \kappa } } B \stackrel { \cdot } { \ } \lesssim C ^ { 2 } B N _ { \infty } ^ { B } / G _ { \infty } ^ { B }$ use baseline runs with different batch sizes $B$ to report the maximal and minimal predicted critical batch size, defined as the intersection of the threshold $( G _ { t } / N _ { t } \stackrel { . } { = } C ^ { 2 }$ ) with the green and blue lines, respectively. We choose a threshold of $C ^ { 2 } = 2$ , and consider LSR to fail if the final test error exceeds the lowest achieved test error by more than $20 \%$ of its value, marked by the red region on the plot. Further settings and discussion are in Appendix F.
|
| 235 |
+
|
| 236 |
+
Remark 5.3. Since the order-1 approximation fails for large $L R$ , it’s natural to ask if higher-order SDE approximation works. In Theorem E.4 we give a partial answer, that the same gap happens $\begin{array} { r } { \eta \gtrsim \frac { \overline { { N } } _ { \infty } } { \overline { { G } } _ { \infty } } ( C ^ { 2 } - 1 ) } \end{array}$ . This suggests failure of SDE approximation may be due to missing some second order term, and thus higherorder approximation in principle could avoid such failure. On the other hand, when approximation fails in such ways, e.g., increasing batch size along LSR, the performance of SGD degrades while SDE remains good. This suggests the higher-order correction term may not be very helpful for generalization.
|
| 237 |
+
|
| 238 |
+
# 5.2 Failure of Linear Scaling Rule
|
| 239 |
+
|
| 240 |
+
In this section we derive a similar necessary condition for LSR to hold.
|
| 241 |
+
|
| 242 |
+
Similar to Definition 5.1, we will use $R _ { \infty } ^ { B , \eta } , G _ { \infty } ^ { B , \eta } , N _ { \infty } ^ { B , \eta }$ as test functions for equilibrium achieved by SGD (7) when training with LR and mini-batches of size . We first introduce the concept of Linear Scaling Invariance (LSI). Note here wthe covariance scales inversely to batch size, ed ratio . $N _ { \infty } ^ { B , \eta } / ( \kappa N _ { \infty } ^ { \kappa B , \kappa \eta } )$ because ${ { \Sigma } ^ { B } } ( x ) = \kappa { { \Sigma } ^ { \kappa B } } ( x )$
|
| 243 |
+
|
| 244 |
+
Definition 5.4 $( C , \kappa )$ -Linear Scaling Invariance). We say SGD (7) with batch size $B$ and LR $\eta$ exhibits $( C , \kappa )$ -LSI if, for a constant $C$ such that $0 < C < \sqrt { \kappa }$ ,
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\frac { 1 } { C } \leq \frac { R _ { \infty } ^ { B , \eta } } { R _ { \infty } ^ { \kappa B , \kappa \eta } } , \frac { N _ { \infty } ^ { B , \eta } } { \kappa N _ { \infty } ^ { \kappa B , \kappa \eta } } , \frac { G _ { \infty } ^ { B , \eta } } { G _ { \infty } ^ { \kappa B , \kappa \eta } } \leq C .
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
We show below that $( C , \kappa )$ -LSI fails if the NSR $\frac { N _ { \infty } } { G _ { \infty } }$ is too small, thereby giving a certificate for failure of $( C , \kappa )$ -LSI even without a baseline run.
|
| 251 |
+
|
| 252 |
+
Theorem 5.5. For any $B , \eta , C$ , and $\kappa$ such that
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\frac { N _ { \infty } ^ { \kappa B , \kappa \eta } } { G _ { \infty } ^ { \kappa B , \kappa \eta } } < ( 1 - \frac { 1 } { \kappa } ) \frac { 1 } { C ^ { 2 } - 1 } - \frac { 1 } { \kappa } ,
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
SGD with batch size $B$ and LR $\eta$ does not exhibit $( C , \kappa )$ -LSI.
|
| 259 |
+
|
| 260 |
+
We now present a simple and efficient procedure to find the largest $\kappa$ for which $( C , \kappa )$ -LSI will hold, providing useful guidance to make hyper-parameter tuning more efficient. Before doing so, one must choose an appropriate value for $C$ , which controls how close the test functions must be for us to consider LSR to have “worked.” It is an open question what value of $C$ will ensure that the two settings achieve similar test performance, but throughout our experiments across various datasets and archand res in Figure 3 and Appendix F, we find that from a baseline run. Then, one can straightfo $C = { \sqrt { 2 } }$ works well. One can estcompute the value for the ate thre $G _ { \infty } ^ { B , \eta }$ $N _ { \infty } ^ { B , \eta }$ $\kappa$ given in the theorem below. We conduct this process in Figure 3 and Appendix $\mathrm { F }$ to test our theory.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 4: SVAG converges quickly and matches SGD (left) or shows the failure of the SDE approximation when LSR breaks (right). We train PreResNet32 with BN on CIFAR-10 for 300 epochs, decaying $\eta$ by 0.1 at epoch 250. SVAG takes $l$ smaller steps to simulate the continuous dynamics in $\eta$ time, so we plot the accuracy against “effective steps,” and we note that SVAG with $l = 1$ is equivalent to SGD. We predict in Figure 3 that LSR (and thus, the SDE approximation) breaks at $B = 1 0 2 4$ for this training setting, and here we observe SVAG converges to a limiting trajectory different from SGD, suggesting that the SDE approximation did indeed break.
|
| 264 |
+
|
| 265 |
+
Theorem 5.6. For any $B , \eta , C$ , and
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\kappa > C ^ { 2 } ( 1 + \frac { N _ { \infty } ^ { B , \eta } } { G _ { \infty } ^ { B , \eta } } ) , ~ ( \approx C ^ { 2 } \frac { N _ { \infty } ^ { B , \eta } } { G _ { \infty } ^ { B , \eta } } \ w h e n \ \frac { N _ { \infty } ^ { B , \eta } } { G _ { \infty } ^ { B , \eta } } \gg 1 ) ,
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
SGD with batch size $B$ and LR ⌘ does not exhibit $( C , \kappa )$ -LSI.
|
| 272 |
+
|
| 273 |
+
# 6 Experiments
|
| 274 |
+
|
| 275 |
+
We provide our code at https://github.com/sadhikamalladi/svag. Figure 3 provides experimental evidence that measurements from a single baseline run can be used to predict when LSR will break, thereby providing verification for Theorem 5.6. Surprisingly, it turns out the condition in Theorem 5.6 is not only sufficient but also close to necessary. Figure 4 and Appendix F.1 test SVAG on common architectures and datasets and report the results. Theorem 4.3 shows that SVAG converges to the SDE as $l \infty$ , but we note that SVAG needs $l$ times as many steps as SGD to match the SDE. Therefore, in order for SVAG to be a computationally efficient simulation of the SDE, we hope to observe convergence for small values of $l$ . This is confirmed in Figure 4 and Appendix F.1. The success of SVAG in matching SGD in many cases indicates that studying the Ito SDE can yield ˆ insights about the behavior of SGD. We note our experiments are limited in the sense that it only confirms the closeness of train/test accuracy curves, which doesn’t verify the weak convergence guaranteed in Theorem 4.3. But at least, the experiments suggest that SDE and SVAG with large $l$ are interesting learning algorithms to study, with similar or even better generalization than SGD. Moreover, in the case where we expect the SDE approximation to fail (e.g., when LSR fails), SVAG does indeed converge to a different limiting trajectory from the SGD trajectory.
|
| 276 |
+
|
| 277 |
+
# 7 Conclusion
|
| 278 |
+
|
| 279 |
+
We present a computationally efficient simulation SVAG (Section 4) that provably converges to the canonical order-1 SDE (2), which we use to verify that the SDE is a meaningful approximation for SGD in common deep learning settings (Section 6). We relate the discretization error to LSR (Definition 2.1): in Section 5 we derive a testable necessary condition for the SDE approximation and LSR to hold, and in Figure 3 we demonstrate its applicability to standard settings.
|
| 280 |
+
|
| 281 |
+
# Acknowledgement
|
| 282 |
+
|
| 283 |
+
The authors acknowledge support from NSF, ONR, Simons Foundation, DARPA and SRC. ZL is also supported by Microsoft Research PhD Fellowship.
|
| 284 |
+
|
| 285 |
+
# References
|
| 286 |
+
|
| 287 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019a. URL https://proceedings.neurips.cc/ paper/2019/file/62dad6e273d32235ae02b7d321578ee8-Paper.pdf.
|
| 288 |
+
|
| 289 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 242–252, Long Beach, California, USA, 09–15 Jun 2019b. PMLR.
|
| 290 |
+
|
| 291 |
+
Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pages 322–332. PMLR, 2019a.
|
| 292 |
+
|
| 293 |
+
Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch normalization. In International Conference on Learning Representations, 2019b.
|
| 294 |
+
|
| 295 |
+
Yoshua Bengio. Practical recommendations for gradient-based training of deep architectures. In Neural networks: Tricks of the trade, pages 437–478. Springer, 2012.
|
| 296 |
+
|
| 297 |
+
Lukas Biewald. Experiment tracking with weights and biases, 2020. URL https://www.wandb. com/. Software available from wandb.com.
|
| 298 |
+
|
| 299 |
+
Nils Bjorck, Carla P Gomes, Bart Selman, and Kilian Q Weinberger. Understanding batch normalization. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems 31, pages 7694–7705. Curran Associates, Inc., 2018.
|
| 300 |
+
|
| 301 |
+
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.
|
| 302 |
+
|
| 303 |
+
Xiang Cheng, Dong Yin, Peter Bartlett, and Michael Jordan. Stochastic gradient and langevin processes. In International Conference on Machine Learning, pages 1810–1819. PMLR, 2020.
|
| 304 |
+
|
| 305 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1019–1028. JMLR.org, 2017.
|
| 306 |
+
|
| 307 |
+
Simon S. Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019.
|
| 308 |
+
|
| 309 |
+
Cong Fang, Zhouchen Lin, and Tong Zhang. Sharp analysis for nonconvex sgd escaping from saddle points. In Conference on Learning Theory, pages 1192–1234. PMLR, 2019.
|
| 310 |
+
|
| 311 |
+
Yuanyuan Feng, Lei Li, and Jian-Guo Liu. Semi-groups of stochastic gradient descent and online principal component analysis: properties and diffusion approximations. arXiv preprint arXiv:1712.06509, 2017.
|
| 312 |
+
|
| 313 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, ´ Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 314 |
+
|
| 315 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 316 |
+
|
| 317 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 1731–1741. Curran Associates, Inc., 2017.
|
| 318 |
+
|
| 319 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Fix your classifier: the marginal value of training the last weight layer. In International Conference on Learning Representations, 2018.
|
| 320 |
+
|
| 321 |
+
Wenqing Hu, Chris Junchi Li, Lei Li, and Jian-Guo Liu. On the diffusion approximation of nonconvex stochastic gradient descent. Annals of Mathematical Sciences and Applications, 4(1), 2019.
|
| 322 |
+
|
| 323 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on International Conference on Machine Learning-Volume 37, pages 448–456. JMLR. org, 2015.
|
| 324 |
+
|
| 325 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. CesaBianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems 31, pages 8571–8580. Curran Associates, Inc., 2018.
|
| 326 |
+
|
| 327 |
+
Stanisław Jastrzebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in sgd. arXiv preprint arXiv:1711.04623, 2017.
|
| 328 |
+
|
| 329 |
+
Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. In International Conference on Machine Learning, pages 1724–1732. PMLR, 2017.
|
| 330 |
+
|
| 331 |
+
Sato Ken-Iti. Levy processes and infinitely divisible distributions ´ . Cambridge university press, 1999.
|
| 332 |
+
|
| 333 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations, 2017.
|
| 334 |
+
|
| 335 |
+
P.E. Kloeden and E. Platen. Numerical Solution of Stochastic Differential Equations. Stochastic Modelling and Applied Probability. Springer Berlin Heidelberg, 2011. ISBN 9783540540625. URL https://books.google.com/books?id $=$ BCvtssom1CMC.
|
| 336 |
+
|
| 337 |
+
Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
|
| 338 |
+
|
| 339 |
+
Daniel Kunin, Javier Sagastuy-Brena, Surya Ganguli, Daniel L. K. Yamins, and Hidenori Tanaka. Neural mechanics: Symmetry and broken conservation laws in deep learning dynamics, 2020.
|
| 340 |
+
|
| 341 |
+
Yann A. LeCun, Leon Bottou, Genevieve B. Orr, and Klaus-Robert M ´ uller. ¨ Efficient BackProp, pages 9–48. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. ISBN 978-3-642-35289-8. doi: 10.1007/978-3-642-35289-8 3.
|
| 342 |
+
|
| 343 |
+
Qianxiao Li, Cheng Tai, and E Weinan. Stochastic modified equations and adaptive stochastic gradient algorithms. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 2101–2110. JMLR. org, 2017.
|
| 344 |
+
|
| 345 |
+
Qianxiao Li, Cheng Tai, and E Weinan. Stochastic modified equations and dynamics of stochastic gradient algorithms i: Mathematical foundations. J. Mach. Learn. Res., 20:40–1, 2019a.
|
| 346 |
+
|
| 347 |
+
Yuanzhi Li, Colin Wei, and Tengyu Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d’ Alche-Buc, E. Fox, and R. Garnett, editors, ´ Advances in Neural Information Processing Systems 32, pages 11674–11685. Curran Associates, Inc., 2019b.
|
| 348 |
+
|
| 349 |
+
Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. In International Conference on Learning Representations, 2020a. URL https://openreview.net/ forum?id ${ \bf \Phi } = { \bf \Phi }$ rJg8TeSFDH.
|
| 350 |
+
|
| 351 |
+
Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. In International Conference on Learning Representations, 2020b.
|
| 352 |
+
|
| 353 |
+
Zhiyuan Li, Kaifeng Lyu, and Sanjeev Arora. Reconciling modern deep learning with traditional optimization analyses: The intrinsic learning rate. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/ paper/2020/hash/a7453a5f026fb6831d68bdc9cb0edcae-Abstract.html.
|
| 354 |
+
|
| 355 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 356 |
+
|
| 357 |
+
Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. The Journal of Machine Learning Research, 18(1):4873–4907, 2017.
|
| 358 |
+
|
| 359 |
+
Mohammad Mohammadi, Adel Mohammadpour, and Hiroaki Ogata. On estimating the tail index and the spectral measure of multivariate $\alpha$ -stable distributions. Metrika, 78(5):549–561, 2015.
|
| 360 |
+
|
| 361 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 362 |
+
|
| 363 |
+
Thanh Huy Nguyen, Umut Simsekli, Mert Gurb ¨ uzbalaban, and Ga ¨ el Richard. First exit time anal- ¨ ysis of stochastic gradient descent under heavy-tailed gradient noise. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman Gar- ´ nett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 273–283, 2019. URL https://proceedings.neurips.cc/paper/ 2019/hash/a97da629b098b75c294dffdc3e463904-Abstract.html.
|
| 364 |
+
|
| 365 |
+
Philip Protter, Denis Talay, et al. The euler scheme for levy driven stochastic differential equations. ´ The Annals of Probability, 25(1):393–423, 1997.
|
| 366 |
+
|
| 367 |
+
Christopher J. Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E. Dahl. Measuring the effects of data parallelism on neural network training. Journal of Machine Learning Research, 20(112):1–49, 2019. URL http://jmlr.org/papers/v20/ 18-789.html.
|
| 368 |
+
|
| 369 |
+
Bin Shi, Weijie J Su, and Michael I Jordan. On learning rates and schrodinger operators. ¨ arXiv preprint arXiv:2004.06977, 2020.
|
| 370 |
+
|
| 371 |
+
Umut Simsekli, Levent Sagun, and Mert Gurbuzbalaban. A tail-index analysis of stochastic gradient noise in deep neural networks. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 5827–5837. PMLR, 09–15 Jun 2019. URL http://proceedings.mlr.press/v97/simsekli19a.html.
|
| 372 |
+
|
| 373 |
+
L. N. Smith. Cyclical learning rates for training neural networks. In 2017 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 464–472, 2017. doi: 10.1109/WACV.2017.58.
|
| 374 |
+
|
| 375 |
+
Samuel L. Smith and Quoc V. Le. A bayesian perspective on generalization and stochastic gradient descent. In International Conference on Learning Representations, 2018.
|
| 376 |
+
|
| 377 |
+
Samuel L. Smith, Pieter-Jan Kindermans, and Quoc V. Le. Don’t decay the learning rate, increase the batch size. In International Conference on Learning Representations, 2018.
|
| 378 |
+
|
| 379 |
+
Samuel L. Smith, Erich Elsen, and Soham De. On the generalization benefit of noise in stochastic gradient descent, 2020.
|
| 380 |
+
|
| 381 |
+
Samuel L. Smith, Benoit Dherin, David G. T. Barrett, and Soham De. On the origin of implicit regularization in stochastic gradient descent, 2021.
|
| 382 |
+
|
| 383 |
+
Jingfeng Wu, Wenqing Hu, Haoyi Xiong, Jun Huan, Vladimir Braverman, and Zhanxing Zhu. On the noisy gradient descent that generalizes as SGD. In Hal Daume III and Aarti Singh, ´ editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 10367–10376, 13–18 Jul 2020.
|
| 384 |
+
|
| 385 |
+
Yuxin Wu and Kaiming He. Group normalization. arXiv preprint arXiv:1803.08494, 2018.
|
| 386 |
+
|
| 387 |
+
Zeke Xie, Issei Sato, and Masashi Sugiyama. A diffusion theory for deep learning dynamics: Stochastic gradient descent exponentially favors flat minima, 2021.
|
| 388 |
+
|
| 389 |
+
Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank J Reddi, Sanjiv Kumar, and Suvrit Sra. Why $\{ { \mathrm { a d a m } } \}$ beats $\{ { \mathrm { s g d } } \}$ for attention models, 2020. URL https: //openreview.net/forum?id $\bar { }$ SJx37TEtDH.
|
| 390 |
+
|
| 391 |
+
Pan Zhou, Jiashi Feng, Chao Ma, Caiming Xiong, Steven HOI, and Weinan E. Towards theoretically understanding why sgd generalizes better than adam in deep learning, 2020.
|
| 392 |
+
|
| 393 |
+
Zhanxing Zhu, Jingfeng Wu, Bing Yu, Lei Wu, and Jinwen Ma. The anisotropic noise in stochastic gradient descent: Its behavior of escaping from sharp minima and regularization effects. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 7654–7663. PMLR, 09–15 Jun 2019.
|
md/train/hqDb8d65Vfh/hqDb8d65Vfh.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Efficiently Identifying Task Groupings for Multi-Task Learning
|
| 2 |
+
|
| 3 |
+
Christopher Fifty1, Ehsan $\mathbf { A m i d } ^ { 1 }$ , Zhe Zhao1, Tianhe $\mathbf { Y } \mathbf { u } ^ { 1 , 2 }$ , Rohan Anil1, Chelsea Finn1,2 Google Research, Brain Team1, Stanford University2 cfifty@google.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Multi-task learning can leverage information learned by one task to benefit the training of other tasks. Despite this capacity, naïvely training all tasks together in one model often degrades performance, and exhaustively searching through combinations of task groupings can be prohibitively expensive. As a result, efficiently identifying the tasks that would benefit from training together remains a challenging design question without a clear solution. In this paper, we suggest an approach to select which tasks should train together in multi-task learning models. Our method determines task groupings in a single run by training all tasks together and quantifying the effect to which one task’s gradient would affect another task’s loss. On the large-scale Taskonomy computer vision dataset, we find this method can decrease test loss by $1 0 . 0 \%$ compared to simply training all tasks together while operating 11.6 times faster than a state-of-the-art task grouping method.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Many of the forefront challenges in applied machine learning demand that a single model performs well on multiple tasks, or optimizes multiple objectives while simultaneously adhering to unmovable inference-time constraints. For instance, autonomous vehicles necessitate low inference time latency to make multiple predictions on a real-time video feed to precipitate a driving action [27]. Robotic arms are asked to concurrently learn how to pick, place, cover, align, and rearrange various objects to improve learning efficiency [25], and online movie recommendation systems model multiple engagement metrics to facilitate low-latency personalized recommendations [13]. Each of the above applications depends on multi-task learning, and advances which improve multi-task learning performance have the potential to make an outsized impact on these and many other domains.
|
| 12 |
+
|
| 13 |
+
Multi-task learning can improve modeling performance by introducing an inductive bias to prefer hypothesis classes that explain multiple objectives and by focusing attention on relevant features [43]. However, it may also lead to severely degraded performance when tasks compete for model capacity or are unable to build a shared representation that can generalize to all objectives. Accordingly, finding groups of tasks that derive benefit from the positives of training together while mitigating the negatives often improves the modeling performance of multi-task learning systems.
|
| 14 |
+
|
| 15 |
+
While recent work has developed new multi-task learning optimization schemes [28, 10, 45, 53, 11, 50], the problem of deciding which tasks should be trained together in the first place is an understudied and complex issue that is often left to human experts [56]. However, a human’s understanding of similarity is motivated by their intuition and experience rather than a prescient knowledge of the underlying structures learned by a neural network. To further complicate matters, the benefit or detriment induced from multi-task learning relies on many non-trivial decisions including, but not limited to, dataset characteristics, model architecture, hyperparameters, capacity, and convergence [51, 49, 46, 47]. As a result, a systematic technique to determine which tasks should train together in a multi-task neural network would be valuable to practitioners and researchers alike [5, 6].
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of our suggested approach to efficiently determine task groupings. (I): Train all tasks together in a multi-task learning model. (II): Compute inter-task affinity scores during training. (III): Select multi-task networks that maximize the inter-task affinity score onto each serving-time task. (IV): Train the resulting networks and deploy to inference.
|
| 19 |
+
|
| 20 |
+
One approach to select task groupings is to exhaustively search over the $2 ^ { | \mathcal { T } | } - 1$ multi-task networks1 for a set of tasks $\tau$ . However, the cost associated with this search can be prohibitive, especially when there is a large number of tasks. It is further complicated by the fact that the set of tasks to which a model is applied may change throughout its lifetime. As tasks are added to or dropped from the set of all tasks, this costly analysis would need to be repeated to determine new groupings. Moreover, as model scale and complexity continues to increase, even approximate task grouping algorithms which evaluate only a subset of combinations may become prohibitively costly and time-consuming to evaluate.
|
| 21 |
+
|
| 22 |
+
In this paper, we aim to develop an efficient framework to select task groupings without sacrificing performance. We propose to measure inter-task affinity by training all tasks together in a single multi-task network and quantifying the effect to which one task’s gradient update would affect another task’s loss. This per-step quantity is averaged across training, and tasks are then grouped together to maximize the affinity onto each task. A visual depiction of the method is shown in Figure 1. Our suggested approach makes no assumptions regarding model architecture and is applicable to any paradigm in which shared parameters are updated with respect to multiple losses.
|
| 23 |
+
|
| 24 |
+
In summary, our primary contribution is to suggest a measure of inter-task affinity that can be used to systematically and efficiently determine task groupings for multi-task learning. Our theoretical analysis shows that grouping tasks by maximizing inter-task affinity will outperform any other task grouping in the convex setting under mild conditions. Further on two challenging multi-task image benchmarks, our empirical analysis finds this approach outperforms training all tasks independently, training all tasks together (with and without training augmentations), and is competitive with a state-of-the-art task grouping method while decreasing runtime by more than an order of magnitude.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Task Groupings. Prevailing wisdom suggests tasks which are similar or share a similar underlying structure may benefit from training together in a multi-task system [9, 8, 4]. Early work in this domain pertaining to the convex setting assume all tasks share a common latent feature representation, and find that model performance can be significantly improved by clustering tasks based on the basis vectors they share in this latent space [26, 30]. However, early convex methods to determine task groupings often make prohibitive assumptions that do not scale to deep neural networks.
|
| 29 |
+
|
| 30 |
+
Deciding which tasks should train together in multi-task neural networks has traditionally been addressed with costly cross-validation techniques or high variance human intuition. An altogether different approach may leverage recent advances in transfer learning focused on understanding task relationships [54, 3, 15, 58, 2]; however, [46] show transfer learning algorithms which determine task similarity do not carry over to the multi-task learning domain and instead propose a multi-task specific framework which trains between ${ \bigl ( } { } _ { 2 } ^ { | T | } { \bigr ) } + | T |$ and $2 ^ { | \mathcal { T } | } - 1$ models to approximate exhaustive search performance. Our approach differs from [46] in that it computes task groupings from only a single training run.
|
| 31 |
+
|
| 32 |
+
Architectures and Training Dynamics. A plethora of multi-task methods addressing what parameters to share among tasks in a model have been developed, such as Neural Architecture Search [19, 47, 49, 35, 22, 39], Soft-Parameter Sharing [40, 14, 52], and asymmetric information transfer [31, 44, 32] to improve multi-task performance. Although this direction is promising, we direct our focus towards when to share tasks in a multi-task network rather than architecture modifications to maximize the benefits from training a fixed set of tasks together. Nevertheless, both approaches are complementary, and architecture augmentations seem to perform best when trained with related tasks [43].
|
| 33 |
+
|
| 34 |
+
Significant effort has also been invested to improve the optimization dynamics of MTL systems. In particular, dynamic loss reweighing has achieved performance superior to using fixed loss weights found with extensive hyperparameter search [28, 18, 37, 10, 45, 33]. Another set of methods seek to mitigate inter-task conflict by manipulating the direction of task gradients rather than simply their magnitude [48, 57, 53, 11, 50, 36]. In our experiments, we compare against Uncertainty Weights [28], GradNorm [10], and PCGrad [53] to contextualize the relative change in performance from splitting tasks into groups. We find that task grouping methods outperform all three training augmentations; nonetheless, they are naturally complementary. In Section 5, our results indicate enhancing the networks found by our method with PCGrad can lead to additional improvements in performance.
|
| 35 |
+
|
| 36 |
+
Looking into the Future. “Lookahead” methods in deep learning can often be characterized by saving the current state of the model, applying one or more gradient updates to a subset of the parameters, reloading the saved state, and then leveraging the information learned from the future state to modify the current set of parameters. This approach has been used extensively in the metalearning [16, 42, 7, 17, 29], optimization [41, 21, 55, 23, 24], and recently auxiliary task learning domains [34]. Unlike the above mentioned methods which look into the future to modify optimization processes, our work adapts this central concept to the multi-task learning domain to characterize task interactions and assign tasks to groups of networks.
|
| 37 |
+
|
| 38 |
+
# 3 Task Grouping Problem Definition
|
| 39 |
+
|
| 40 |
+
We draw a distinction between inference-time latency constraints and inference-time memory budget. The former characterizes the speed at which predictions can be computed, with similarly sized models running in parallel having latency roughly equivalent to a single model running by itself. The latter relates to the number of parameters used by all models during inference, with a $n$ -times parameter model having a similar budget to an $n$ -group of normal-sized models. We configure our analysis to span both dimensions, but also provide analysis into only the latter in the Appendix.
|
| 41 |
+
|
| 42 |
+
Given a set of tasks $\tau$ , a fixed inference-time memory budget $b$ , and latency constraint $c$ , our aim is to assign tasks to networks such that average task performance is maximized. Additionally, each network must have a parameter count less than $c$ ; the networks must span our set of tasks $\tau$ ; and the total number of networks is less than or equal to our memory budget $b$ . Moreover, tasks can be trained in a network without being served from this network during inference. In this case, they are used to assist the learning of the other tasks, and during inference, are served from one of the other multi-task networks. Formulating our task grouping framework in this manner aligns our work with industry trends where inference-time parameter budgets are limited and latency unmovable.
|
| 43 |
+
|
| 44 |
+
More formally, for a set of $n$ tasks $\mathcal { T } = \{ \tau _ { 1 } , \tau _ { 2 } , . . , \tau _ { n } \}$ , we would like to construct a group of $k$ multi-task neural networks $M = \{ m _ { 1 } , m _ { 2 } , . . . , m _ { k } \}$ such that $\forall \tau _ { i } \in \tau$ , ∃ exactly one multi-task network $m _ { j } \in M$ , parameter count of $m _ { j } < c$ , such that $m _ { j }$ makes an inference-time prediction for $t _ { i }$ subject to $k \leq b$ where $b$ is our memory budget. $m _ { j }$ is the $j ^ { t h }$ multi-task network which takes input $\mathcal { X }$ , and concurrently trains a set of tasks $\{ \tau _ { a } , \tau _ { c } , . . . , \tau _ { f } \}$ , but only serves a subset of those tasks at inference. For a given performance measure $\mathcal { P }$ , we can then define the aggregate performance of our task grouping as $\begin{array} { r } { \sum _ { i = 1 } ^ { n ^ { \star } } \mathcal { P } ( \tau _ { i } | M ) } \end{array}$ where $\mathcal { P } ( \tau _ { i } | M )$ computes the performance of task $\tau _ { i }$ from the set of models $M$ using the model $m _ { j }$ which the task grouping algorithm predicts the performance of $\tau _ { i }$ will be highest.
|
| 45 |
+
|
| 46 |
+
# 4 Grouping Tasks by Measuring Inter-Task Affinity
|
| 47 |
+
|
| 48 |
+
We propose a method to group tasks by examining the effect to which one task’s gradient would increase or decrease another task’s loss. We formally define the method in Section 4.1, describe a systematic procedure to go from inter-task affinity scores to a grouping of tasks in Section 4.2, and provide theoretical analysis in Section 4.3.
|
| 49 |
+
|
| 50 |
+
# 4.1 Inter-Task Affinity
|
| 51 |
+
|
| 52 |
+
Within the context of a hard-parameter sharing paradigm, tasks collaborate to build a shared feature representation which is then specialized by individual task-specific heads to output a prediction. Specifically, through the process of successive gradient updates to the shared parameters, tasks implicitly transfer information to each other. As a consequence, we propose to view the extent to which a task’s successive gradient updates on the shared parameters affect the objective of other tasks in the network as a proxy measurement of inter-task affinity.
|
| 53 |
+
|
| 54 |
+
Consider a multitask loss function parameterized by $\{ \theta _ { s } \} \cup \{ \theta _ { i } | i \in \mathcal { T } \}$ where $\theta _ { s }$ represents the shared parameters and $\theta _ { i }$ represents the task $i \in \mathcal T$ specific parameters. Given a batch of examples $\mathcal { X }$ , let
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
L _ { \mathrm { t o t a l } } ( \mathcal { X } , \theta _ { s } , \{ \theta _ { i } \} ) = \sum _ { i \in \mathcal { T } } L _ { i } ( \mathcal { X } , \theta _ { s } , \theta _ { i } ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
denote the total loss where $L _ { i }$ represents the non-negative loss of task $i$ . For simplicity of notation, we set the loss weight of each task to be equal to 1, though our construction generalizes to arbitrary weightings.
|
| 61 |
+
|
| 62 |
+
For a given training batch $\mathcal { X } ^ { t }$ at time-step $t$ , define the quantity $\theta _ { s \mid i } ^ { t + 1 }$ to represent the updated shared parameters after a gradient step with respect to the task . Assuming stochastic gradient descent for 1:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \theta _ { s | i } ^ { t + 1 } : = \theta _ { s } ^ { t } - \eta \nabla _ { \theta _ { s } ^ { t } } L _ { i } ( \mathcal { X } ^ { t } , \theta _ { s } ^ { t } , \theta _ { i } ^ { t } ) . } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
We can now calculate a lookahead loss for each task by using the updated shared parameters while keeping the task-specific parameters as well as the input batch unchanged. That is, in order to assess the effect of the gradient update of task $i$ on a given task $j$ , we can compare the loss of task $j$ before and after applying the gradient update from task $i$ onto the shared parameters. To eliminate the scale discrepancy among different task losses, we consider the ratio of a task’s loss before and after the gradient step on the shared parameters as a scale invariant measure of relative progress. We can then define an asymmetric measure for calculating the affinity of task $i$ at a given time-step $t$ on task $j$ as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathcal { Z } _ { i j } ^ { t } = 1 - \frac { L _ { j } ( \mathcal { X } ^ { t } , \theta _ { s | i } ^ { t + 1 } , \theta _ { j } ^ { t } ) } { L _ { j } ( \mathcal { X } ^ { t } , \theta _ { s } ^ { t } , \theta _ { j } ^ { t } ) } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Notice that a positive value of $\mathcal { Z } _ { i j } ^ { t }$ indicates that the update on the shared parameters results in a lower loss on task $j$ than the original parameter values, while a negative value of $\mathcal { Z } _ { i j } ^ { t }$ indicates that the shared parameter update is antagonistic for this task’s performance. Our suggested measure of inter-task affinity is computed at a per-step level of granularity, but can be averaged across all steps, every $n$ steps, or a contiguous subset of steps to derive a “training-level” score:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\hat { \mathcal { Z } } _ { i j } = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathcal { Z } _ { i j } ^ { t } .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
In Section 5, we find $\hat { \mathcal { Z } } _ { i j }$ is empirically effective in selecting high performance task groupings and provide an ablation study along this dimension in Section 5.2.
|
| 81 |
+
|
| 82 |
+
# 4.2 Network Selection Algorithm
|
| 83 |
+
|
| 84 |
+
At a high level, our proposed approach trains all tasks together in one model, measures the pairwise task affinities throughout training, identifies task groupings that maximize total inter-task affinity, and then trains the resulting groupings for evaluation on the test set. We denote this framework as Task Affinity Grouping (TAG) and now describe the algorithm to convert inter-task affinity scores into a set of multi-task networks. More formally, given $\bar { ( \mathbf { \xi } _ { 2 } ^ { \vert \mathcal { T } \vert } ) }$ values representing the pairwise intertask affinity scores collected during a single training run, our network selection algorithm should produce $k$ multi-task networks, $k \leq b$ where $b$ is the inference-time memory budget, with the added constraint that every task must be served from exactly one network at inference.
|
| 85 |
+
|
| 86 |
+
For a group composed of a pair of tasks $\{ a , b \}$ , the affinity score onto task $a$ would simply be $\hat { \mathcal { Z } } _ { b \to a }$ and the affinity score onto task $b$ would be $\hat { \mathcal { Z } } _ { a b }$ . For task groupings consisting of three or more tasks, we approximate the inter-task affinity onto a given task by averaging the pairwise affinities onto this given task. Consider the group consisting of tasks $\{ a , b , c \}$ . We can compute the total inter-task affinity onto task $a$ by averaging the pair-wise affinities from tasks $b$ and $c$ onto $a$ : $( \hat { \mathcal { Z } } _ { b a } + \hat { \mathcal { Z } } _ { c a } ) / 2$ .
|
| 87 |
+
|
| 88 |
+
After approximating higher-order affinity scores for each network consisting of three or more tasks, we select a set of $k$ multi-task networks such that the total affinity score onto each task used during inference is maximized. Informally, each task that is being served at inference should train with the tasks which most decrease its loss throughout training. This problem is NP-hard (reduction from Set-Cover) but can be solved efficiently with a branch-and-bound-like algorithm as detailed in [46] or with a binary integer programming solver as done by [54].
|
| 89 |
+
|
| 90 |
+
# 4.3 Theoretical Analysis
|
| 91 |
+
|
| 92 |
+
We now offer a theoretical analysis of our measure of inter-task affinity. Specifically, our goal is to provide an answer to the following question: given that task $b$ induces higher inter-task affinity than task $c$ on task $a$ , does training $\{ a , b \}$ together result in a lower loss on task $a$ than training $\{ a , c \} 2$ Intuitively, we expect the answer to this question to always be positive. However, it is easy to construct counter examples for simple quadratic loss functions where training $\{ a , b \}$ actually induces a higher loss than training $\{ a , c \}$ (see Appendix). Nonetheless, we show that in a convex setting and under some mild assumptions, the grouping suggested by our measure of inter-task affinity must induce a lower loss value on task $a$ .
|
| 93 |
+
|
| 94 |
+
For simplicity of notation, we ignore the task specific parameters and use $L _ { a } ( \theta )$ to denote the loss of task $a$ evaluated at shared parameters $\theta$ . Additionally, we denote the gradient of tasks $a , b ,$ , and $c$ at $\theta$ as $g _ { a } , g _ { b }$ , and $g _ { c }$ , respectively.
|
| 95 |
+
|
| 96 |
+
Lemma 1. Let $L _ { a }$ be a $\alpha$ -strongly convex and $\beta$ -strongly smooth loss function. Given that task $b$ induces higher inter-task affinity than task c on task $a$ , the following inequality holds:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
g _ { a } \cdot g _ { c } - \frac { \beta \eta } { 2 } \| g _ { c } \| ^ { 2 } + \frac { \alpha \eta } { 2 } \| g _ { b } \| ^ { 2 } \leq g _ { a } \cdot g _ { b }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
The proof is given in the Appendix.
|
| 103 |
+
|
| 104 |
+
Proposition 1. Let $L _ { a }$ be a $\alpha$ -strongly convex and $\beta$ -strongly smooth loss function. Let $\begin{array} { r } { \eta \le { \frac { 1 } { \beta } } } \end{array}$ be the learning rate. Suppose that in a given step, task $b$ has higher inter-task affinity than task c on task $a$ . Moreover, suppose that the gradients have equal norm, i.e. $\| g _ { a } \| = \| g _ { b } \| = \| g _ { c } \|$ . Then, taking a gradient step on the parameters using the combined gradient of a and $b$ reduces $L _ { a }$ more so than taking a gradient step on the parameters using the combined gradient of a and $c$ , given that $\begin{array} { r } { \cos ( g _ { a } , g _ { c } ) \le \frac { \eta } { 4 } \frac { \alpha \beta } { \beta - \alpha } - 1 } \end{array}$ where $\textstyle \cos ( u , v ) : = { \frac { u \cdot v } { \| u \| \| v \| } }$ is the cosine similarity between u and $v$ .
|
| 105 |
+
|
| 106 |
+
The proof is given in the Appendix. Proposition 1 intuitively implies the grouping chosen by maximizing per-task inter-task affinity is guaranteed to make more progress than any other group. Moreover, the assumptions for this condition to hold in the convex setting are fairly mild. Specifically, our first assumption relies on the gradients to have equal norms, but our proof can be generalized to when the gradient norms are approximately equal. This is often the case during training when tasks use similar loss functions and/or compute related quantities. The second assumption relies on the cosine similarity between the lower-affinity task $c$ and the primary task $a$ being smaller than a constant. This is a mild assumption since the ratio $\frac { \beta / \alpha } { \beta / \alpha - 1 }$ becomes sufficiently large for the assumption to hold trivially when the Hessian of the loss has a sufficiently small condition number.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2: (Left) time to determine and train task groupings in CelebA. (Right) time to determine and train task groupings in Taskonomy. Note the $\mathbf { y }$ -axis is in log scale, and the time to determine task groupings is incurred only once to determine groupings for all splits.
|
| 110 |
+
|
| 111 |
+
# 5 Experiments
|
| 112 |
+
|
| 113 |
+
We evaluate2 the capacity of TAG to select task groupings on CelebA, a large-scale face attributes dataset [38] and Taskonomy, a massive computer vision dataset of indoor scenes [54]. Following this analysis, we direct our focus towards answering the following questions with ablation experiments on CelebA:
|
| 114 |
+
|
| 115 |
+
• Does our measure of inter-task affinity align with identifying which tasks should train together?
|
| 116 |
+
• Should inter-task affinity be measured at every step of training to determine task groupings?
|
| 117 |
+
• Is measuring the change in train loss comparable with the change in validation loss when computing inter-task affinity?
|
| 118 |
+
• How do inter-task affinities change over the course of training?
|
| 119 |
+
• Do changes in a model’s hyperparameters change which tasks should be trained together?
|
| 120 |
+
|
| 121 |
+
As described in Section 3, we constrain all networks to have the same number of parameters to adhere to a fixed inference-time latency constraint. We provide experimental results removing this constraint, as well as additional experimental results and detail relating to experimental design, in the Appendix.
|
| 122 |
+
|
| 123 |
+
# 5.1 Supervised Task Grouping Evaluation
|
| 124 |
+
|
| 125 |
+
For our task grouping evaluation, we compare two classes of approaches: approaches that determine task groupings, and approaches that train on all tasks together but alter the optimization. In the first class, we consider simply training all tasks together in the same network (MTL), training every task by itself (STL), the expected value from randomly selecting task groupings (RG), grouping tasks by maximizing inter-task cosine similarity between pairs of gradients (CS), our method (TAG ), and HOA [46] which approximates higher-order task groupings from pair-wise task performance. For the latter class, we consider Uncertainty Weights (UW) [28], GradNorm (GN) [10], and PCGrad [53]. In principle, these two classes of approaches are complementary and can be combined.
|
| 126 |
+
|
| 127 |
+
Our empirical findings are summarized in Figure 3. For the task grouping methods TAG , CS, and HOA, we report the time to determine task groupings, not determine task groupings and train the resultant multi-task networks. The runtime of RG is fixed to the time it takes to train a single multitask network, and the runtime of STL is reported as the time it takes to train all single task networks. This is to facilitate comparison between the efficiency of different task grouping methods and provide a high-level overview of how long it takes to select task groupings compared to popular multi-task learning benchmarks. We also include a comparison of the time to determine task groupings and train the resultant multi-task networks among task grouping methods in Figure 2.
|
| 128 |
+
|
| 129 |
+
CelebA. We select a subset of 9 attributes {a1, a2, a3, a4, a5, a6, a7, a8, a9} from the 40 possible attributes in CelebA and optimize the baseline MTL model by tuning architecture, batch size, and learning rate to maximize the performance of training all tasks together on the validation set. We do not tune other methods with the exception of GradNorm, for which we search over {0.1, 0.5, 1.0, 1.5, 2.0, 3.0, 5.0} for alpha. For task grouping algorithms, we evaluate the set of {2-splits, 3-splits, 4-splits} inference-time memory budgets. Each of the multi-task networks has the same number of parameters as the base MTL model; however, the inference-time latency constraint is satisfied as all models may run in parallel. Our findings are summarized in Figure 3 (left). Alternatively, increasing the number of parameters within a single model may significantly increase the time to make a forward pass during inference. Figure 6 visualizes our findings when we remove the inference-time latency constraint from comparison systems.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: (Left) average classification error for 2, 3, and 4-split task groupings for the subset of 9 tasks in CelebA. (Right) total test loss for 2 and 3-split task groupings for the subset of 5 tasks in Taskonomy. All models were run on a TeslaV100 instance with the time to train the full MTL model being approximately 83 minutes in CelebA and 146 hours in Taskonomy. Note the $\mathbf { X }$ -axis is in log scale, and the relative runtime for TAG , CS, and HOA only considers the time to find groups.
|
| 133 |
+
|
| 134 |
+
We find the performance of TAG surpasses that of the HOA, RG, and CS task grouping methods, while operating 22 times faster than HOA. We also find UW, GN, and PCGrad to perform worse than the groups found by either HOA or TAG, suggesting the improvement from identifying tasks which train well together cannot be replaced with current multi-task training augmentations. Nevertheless, we find multi-task training augmentations can be complementary with task grouping methods. For example, augmenting the groups found by TAG with PCGrad improves 2-splits performance by $0 . 8 5 \%$ , 3-splits performance by $0 . 1 8 \%$ , but changes 4-splits performance by $- 0 . 0 8 \%$ .
|
| 135 |
+
|
| 136 |
+
Similar to the results from [46], we find GradNorm [10] can sometimes perform worse than training all tasks together. We reason this difference is due to our common experimental design that loads the weights from the epoch with lowest validation loss to reduce overfitting, and differs from prior work which uses model weights after training for 100 epochs [45]. Reformulating our design to mirror [45], we find training the model to 100 epochs without early stopping results in worse performance on MTL, GradNorm, UW, and PCGrad; however, with this change, each training augmentation method now significantly outperforms the baseline MTL method.
|
| 137 |
+
|
| 138 |
+
Taskonomy. Following the experimental setup of [46], we evaluate the capacity of TAG to select task groupings on the “Semantic Segmentation”, “Depth Estimation”, “Keypoint Detection”, “Edge Detection”, and “Surface Normal Prediction” objectives in Taskonomy. Unlike [46], our evaluation uses an augmented version of the medium Taskonomy split (2.4 TB) as opposed to the Full+ version (12 TB) to reduce computational overhead and increase reproducibility.
|
| 139 |
+
|
| 140 |
+
Our results are summarized in Figure 3 (right). Similar to our findings on CelebA, TAG continues to outperform MTL by $1 0 . 0 \%$ , GN by $7 . 7 \%$ , STL by $1 . 5 \%$ , and RG by $9 . 5 \%$ . Comparing TAG to HOA, we find the 2-split task grouping found by TAG to surpass the performance of that found by HOA by $2 . 5 \%$ , but HOA’s 3-split task grouping performance is superior to that of TAG. In terms of compute, TAG is significantly more efficient than HOA, with HOA demanding an additional 2,008 TeslaV100 GPU hours to find task groupings. To put this cost into perspective, on an 8-GPU, on-demand p3.16xlarge AWS instance, the difference in monetary expenditure between TAG and HOA would be $\$ 6,144.48$ . On a similar note, the performance of TAG and CS on Taskonomy are equivalent, but TAG is more efficient, requiring 140 fewer TeslaV100 GPU hours to compute task groupings.
|
| 141 |
+
|
| 142 |
+
# 5.2 Multi-Task Ablation Studies
|
| 143 |
+
|
| 144 |
+
Does our measure of inter-task affinity correlate with optimal task groupings? To further evaluate if TAG can be used to select which tasks should train together in multi-task learning models, we evaluate its capacity to select the best training partner for a given task. We compare with the optimal (best) and worst auxiliary task computed from the test set and normalize scores with respect to the expected performance of selecting an auxiliary task at random.
|
| 145 |
+
|
| 146 |
+
Our findings are summarized in Table 1 and indicate the performance of auxiliary tasks found by TAG correlates with the performance of the optimal auxiliary task (Pearson’s Correlation of $0 . 9 3 \%$ ). However, a notable exception occurs with attribute a8 where TAG actually selects the worst partner. In this instance, and unlike every other objective in our dataset, no task manifests especially high or low inter-task affinity onto a8. The difference in normalized inter-task affinity for a8 between the best and worst partner predicted by inter-task affinity is 0.04, while the next smallest difference is $4 \mathbf { x }$ larger at 0.16 for a3. A table showing these differences is included in the Appendix. This case represents a limitation of TAG, and it will struggle to find the best auxiliary task for objectives like a8.
|
| 147 |
+
|
| 148 |
+
<table><tr><td></td><td rowspan=1 colspan=1>Tasks</td><td rowspan=1 colspan=3>Improvement in Test AccuracyRelative to Random Groupingoptimal (ours) worst</td></tr><tr><td></td><td rowspan=1 colspan=1>al</td><td rowspan=1 colspan=1>2.60%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>-3.03%</td></tr><tr><td></td><td rowspan=1 colspan=1>a2</td><td rowspan=1 colspan=1>1.53%</td><td rowspan=1 colspan=1>1.29%</td><td rowspan=1 colspan=1>-1.95%</td></tr><tr><td></td><td rowspan=1 colspan=1>a3</td><td rowspan=1 colspan=1>2.37%</td><td rowspan=1 colspan=1>1.72%</td><td rowspan=1 colspan=1>-3.04%</td></tr><tr><td></td><td rowspan=1 colspan=1>a4</td><td rowspan=1 colspan=1>2.67%</td><td rowspan=1 colspan=1>0.72%</td><td rowspan=1 colspan=1>-4.14%</td></tr><tr><td></td><td rowspan=1 colspan=1>a5</td><td rowspan=1 colspan=1>2.75%</td><td rowspan=1 colspan=1>2.29%</td><td rowspan=1 colspan=1>-3.87%</td></tr><tr><td></td><td rowspan=1 colspan=1>a6</td><td rowspan=1 colspan=1>2.04%</td><td rowspan=1 colspan=1>0.00%</td><td rowspan=1 colspan=1>-2.08%</td></tr><tr><td></td><td rowspan=1 colspan=1>a7</td><td rowspan=1 colspan=1>2.40%</td><td rowspan=1 colspan=1>0.74%</td><td rowspan=1 colspan=1>-2.43%</td></tr><tr><td rowspan=2 colspan=2>a8a9</td><td rowspan=1 colspan=1>a8</td><td rowspan=1 colspan=1>1.61%</td><td rowspan=1 colspan=1> -1.59%</td></tr><tr><td rowspan=1 colspan=1>8.38%</td><td rowspan=1 colspan=1>8.38%</td><td rowspan=1 colspan=1>-6.21%</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 1: Performance of each task when trained with it’s partner task relative to the expected performance from random groupings.
|
| 151 |
+
|
| 152 |
+
However, this weakness does not seem to significantly affect the capacity of TAG to select strong task groupings. As no other task exhibits especially high or low inter-task affinity onto a8, it is often slotted into a larger task group rather than being one of the tasks with a large difference in inter-task affinity which precipitates the formation of a new group.
|
| 153 |
+
|
| 154 |
+
# Should inter-task affinity be computed at every step?
|
| 155 |
+
|
| 156 |
+
It is likely that the inter-task affinity of consecutive steps are similar, and it could be the case that inter-task affinity signals at the beginning, middle, or end of training are sufficient for selecting which tasks should train together. In particular, if task relationships crystallize early in training, computing inter-task affinities during the initial stages of training may be sufficient. We evaluate both hypotheses on CelebA and our results are summarized in Table 2.
|
| 157 |
+
|
| 158 |
+
Our findings indicate significant redundancy can be eliminated without degrading performance by computing inter-task affinities every 10 steps rather than every step. This modification increases
|
| 159 |
+
|
| 160 |
+
Table 2: Change in total test accuracy across inference-time memory budget of {2-groups, 3- groups, 4-groups} relative to the expected performance from random groupings. Speedup is relative to computing inter-task affinity in each step.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=2>Relative Performance Relative Speedup</td></tr><tr><td rowspan=6 colspan=1>Every 1 StepEvery 5StepsEvery10StepsEvery25StepsEvery 50 StepsEvery 100 Steps</td><td rowspan=1 colspan=1>5.13%</td><td rowspan=1 colspan=1>1.0x</td></tr><tr><td rowspan=1 colspan=1>5.13%</td><td rowspan=1 colspan=1>2.56x</td></tr><tr><td rowspan=1 colspan=1>5.13%</td><td rowspan=1 colspan=1>3.19x</td></tr><tr><td rowspan=1 colspan=1>4.84%</td><td rowspan=1 colspan=1>3.73x</td></tr><tr><td rowspan=1 colspan=1>3.73%</td><td rowspan=1 colspan=1>3.96x</td></tr><tr><td rowspan=1 colspan=1>2.06%</td><td rowspan=1 colspan=1>4.08x</td></tr><tr><td rowspan=1 colspan=1>First 25%</td><td rowspan=1 colspan=1>3.67%</td><td rowspan=1 colspan=1>4.00x</td></tr><tr><td rowspan=2 colspan=1>Middle 25%Final 25%</td><td rowspan=1 colspan=1>4.31%</td><td rowspan=1 colspan=1>2.95x</td></tr><tr><td rowspan=1 colspan=1>4.02%</td><td rowspan=1 colspan=1>2.34x</td></tr></table>
|
| 163 |
+
|
| 164 |
+
training-time efficiency by $31 \%$ and is used in Section 5.1 to compute task groupings. After this threshold, signal strength decreases and leads to higher task grouping error. We also find that computing inter-task affinities in the first $2 5 \%$ , middle $2 5 \%$ , or final $2 5 \%$ of training degrades task-grouping performance. This result suggest the relationships among tasks change throughout training as measured by inter-task affinity. As a result, we choose to average inter-task affinity scores throughout the entirety of training to determine which tasks should train together.
|
| 165 |
+
|
| 166 |
+
Is change in train loss comparable to change in validation loss? Given multi-task learning’s capacity to improve generalization, computing the change in validation loss after a gradient step may capture a more informative signal as to which tasks should train together. On the other hand, certain datasets may not contain a validation split and loading a batch from the validation set every 10 steps of training would decrease efficiency.
|
| 167 |
+
|
| 168 |
+
To our surprise, the inter-task affinity scores computed on the validation set are very similar to the inter-task affinity scores computed on the training set (Pearson’s Coefficient: 0.9804). For context, this similarity with computing inter-task affinities every step is greater than any other ablation in Table 2 with the exception of “Every 5 Steps” as measured by Pearson’s Coefficient. Moreover, the performance of groupings found by both methods are similar: 49.574 average total error across our inference time budget of {2-groups, 3-groups, 4-groups} compared with 49.576 for groupings found on the validation set.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Total per-epoch inter-task affinities onto tasks {a1, a5, a6} in the CelebA dataset. The y-axis signifies the total change in train loss after applying an update to the shared parameters. Note the relationship among affinities changes. For instance in the center plot representing the inter-task affinity onto a5, a6 initially manifests higher affinity onto a5 than does a7. In later stages of training, this trend is reversed. In the same subplot, a1 manifests higher inter-task affinity over the tasks {a3, a4, a8, a9} at different stages of training.
|
| 172 |
+
|
| 173 |
+
More formally, let $X _ { \mathrm { t r } }$ and $X _ { \mathrm { v a l } }$ be independent and identically distributed random variables for training and validation, respectively. Given the updated shared parameter $\theta _ { s | i } ^ { t + 1 }$ using the gradient of task $i$ calculated on $X _ { \mathrm { t r } }$ , the loss of task $j$ (s.t. $j \neq i$ ) yields similar expectations with respect to $X _ { \mathrm { t r } }$ and $X _ { \mathrm { v a l } }$ . That is,
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\begin{array} { r } { \mathbb { E } _ { \mathrm { v a l } } [ \mathbb { E } _ { \mathrm { t r } } [ \mathcal { L } _ { j } ( X _ { \mathrm { v a l } } ^ { t } , \boldsymbol { \theta } _ { s | i } ^ { t + 1 } , \boldsymbol { \theta } _ { j } ^ { t } ) ] ] \approx \mathbb { E } _ { \mathrm { v a l } } [ \mathcal { L } _ { j } ( X _ { \mathrm { v a l } } ^ { t } , \mathbb { E } _ { \mathrm { u r } } [ \boldsymbol { \theta } _ { s | i } ^ { t + 1 } ] , \boldsymbol { \theta } _ { j } ^ { t } ) ] = \mathbb { E } _ { \mathrm { t r } } [ \mathcal { L } _ { j } ( X _ { \mathrm { t r } } ^ { t } , \mathbb { E } _ { \mathrm { u r } } [ \boldsymbol { \theta } _ { s | i } ^ { t + 1 } ] , \boldsymbol { \theta } _ { j } ^ { t } ) ] . } \end{array}
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
tr val tr the updated shared parameters θt+1s|i . Assuming both tasks have distinct loss functions that do not directly depend on each other during training, we can move the second expectation inside the loss function to obtain the middle term. By using the fact that $X _ { \mathrm { t r } }$ and $X _ { \mathrm { v a l } }$ are identically distributed, thus yielding the same expectation, we can move from the middle term to the rightmost term. Hence, the inter-task affinity computed on the training dataset would approximately equal the inter-task affinity computed on the validation set.
|
| 180 |
+
|
| 181 |
+
How do inter-task affinities change over the course of training? Our analysis on CelebA and Taskonomy suggests inter-task affinities change throughout training, but no obvious patterns emerge related to how inter-task affinities change as a function of time across tasks. Nevertheless, our analysis indicates certain tasks exhibit higher-than-average inter-task affinity and tend to maintain this difference throughout training. We visualize this effect in Figure 4 for three tasks in the CelebA dataset. Figure 4(left) shows that task a7 exhibits significantly higher affinity onto task a1 than any other task in the network, and in a similar comparison, Figure 4(right) indicates that tasks {a5, a7} manifest significantly higher affinity onto a6 than any other task. Shifting our focus to a5 in Figure 4(center), we find $\{ \mathsf { a } 6 , \mathsf { a } 7 \}$ display markedly higher affinity, and a1 sometimes displays higher affinity, onto a5 than the other tasks in the network.
|
| 182 |
+
|
| 183 |
+
One additional observation not captured in Figure 4 relates to the initial steps of training. At this stage of convergence, all tasks seem to manifest positive and similar inter-task affinity. We postulate the representations learned by the model at this early stage may be common among all tasks. For example, the learned representations may extract general-purpose facial characteristics, but specialization occurs quickly thereafter.
|
| 184 |
+
|
| 185 |
+
Can changes in hyperparameters affect task groupings? We define three settings: (i) typical, the base setting, (ii) $\mathtt { b } { = } 0 . 5 \mathrm { x }$ , or halving the batch size, and (iii) $\mathrm { l r } { = } 2 \mathbf { x }$ , or increasing the learning rate by a factor of 2. To determine the ground-truth task groupings, we train all 511 combinations of task groupings from our 9-task subset of CelebA and select the groups in each setting with the lowest total test error. Our aim is to assess the extent to which task groupings chosen in setting $\mathsf { b } { = } 0 . 5 \mathrm { x }$ or $\mathrm { l r } { = } 2 \mathbf { x }$ generalize to the typical setting.
|
| 186 |
+
|
| 187 |
+
Our results are summarized in Table 3. They indicate that simply changing the batch size or learning rate of a model may change which tasks should be trained together, with the groupings found by $\mathrm { l r } { = } 2 \mathbf { x }$ exhibiting worse generalization than those found by $\mathsf { b } { = } 0 . 5 \mathrm { x }$ . This result suggests that how tasks should be trained together does not simply depend on the relationships among tasks, but also on detailed aspects of the model and training. It is notably difficult to build intuition for the latter, illustrating the need to develop automated methods that can take into account these nuances.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan="2">Budget</td><td colspan="2">Improvement in Test Accuracy Relative to Optimal Groupings</td></tr><tr><td>b=0.5x</td><td>lr=2x</td></tr><tr><td>2-groups</td><td>-0.61%</td><td>-1.22%</td></tr><tr><td>3-groups</td><td>-0.25%</td><td>-2.90%</td></tr><tr><td>4-groups</td><td>-1.87%</td><td>-3.21%</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 3: Accuracy of task groupings found by $\mathsf { b } { = } 0 . 5 \mathrm { x }$ and $\scriptstyle 1 \mathbf { r } = 2 \mathbf { x }$ relative to the typical setting.
|
| 192 |
+
|
| 193 |
+
# 6 Conclusion
|
| 194 |
+
|
| 195 |
+
In this work, we present an approach to quantify inter-task affinity in a single training run and show how this quantity can be used to systematically determine which tasks should train together in multitask networks. Our empirical findings indicate our approach is highly competitive. It outperforms multi-task training augmentations like Uncertainty Weights, GradNorm, and PCGrad, and performs competitively with state-of-the-art task grouping methods like HOA, while improving computational efficiency by over an order of magnitude. Further, our findings are supported by extensive analysis that suggests inter-task affinity scores can find close to optimal auxiliary tasks, and in fact, implicitly measure generalization capability among tasks.
|
| 196 |
+
|
| 197 |
+
A plethora of research has been undertaken to design better multi-task learning architectures, or improve the optimization dynamics within multi-task learning systems, with relatively little work addressing the question of which tasks should train together in the first place. It is our hope this work renews interest in this domain, and given the sensitivity of task groupings to even small changes in hyperparameters, encourages the development of efficient and automatic methods to identify which tasks should train together in multi-task learning networks.
|
| 198 |
+
|
| 199 |
+
# 7 Broader Impact
|
| 200 |
+
|
| 201 |
+
Efficiently identifying task groupings in multi-task learning has the potential to save significant time and computational resources in both academic and industry environments. Despite this benefit, there are several risks associated with this work. In particular, inter-task affinities can be mistakenly interpreted as “task similarity”, and incorrectly create an association and/or causation relationship among tasks with high mutual inter-task affinity scores. This association would be especially problematic for datasets involving sensitive prediction quantities related to race, gender, religion, age, status, physical traits, etc., where inter-task affinities could be mistakenly used to support an unfounded conclusion that attempts to posit similarity among tasks. That said, we believe acknowledging these risks mitigates their potential for abuse, and the benefit from this work — most notably decreasing computational resources by over an order of magnitude compared with a state-of-the-art task grouping method while performing competitively in terms of accuracy — merits its dissemination.
|
| 202 |
+
|
| 203 |
+
# Acknowledgement
|
| 204 |
+
|
| 205 |
+
We thank Vince Gatto, Bing-Rong Lin, Nick Bridle, Li Wei, Shawn Andrews, Yuan Gao, and Yuyan Wang for their thoughtful discussion related to a precursor of this work. We also thank James Chen and Linda Wang for providing feedback on an earlier draft of this paper. Lastly, we would like to recognize Zirui Wang for technical support with running experiments as well as our anonymous NeurIPS reviewers for their thoughtful feedback and clear desire to improve this work.
|
| 206 |
+
|
| 207 |
+
# References
|
| 208 |
+
|
| 209 |
+
[1] Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} symposium on operating systems design and implementation ({OSDI} 16), pages 265–283, 2016.
|
| 210 |
+
|
| 211 |
+
[2] Alessandro Achille, Michael Lam, Rahul Tewari, Avinash Ravichandran, Subhransu Maji, Charless C Fowlkes, Stefano Soatto, and Pietro Perona. Task2vec: Task embedding for metalearning. In Proceedings of the IEEE International Conference on Computer Vision, pages 6430–6439, 2019.
|
| 212 |
+
|
| 213 |
+
[3] Alessandro Achille, Giovanni Paolini, Glen Mbeng, and Stefano Soatto. The information complexity of learning tasks, their structure and their distance. arXiv preprint arXiv:1904.03292, 2019.
|
| 214 |
+
|
| 215 |
+
[4] Andreas Argyriou, Theodoros Evgeniou, and Massimiliano Pontil. Convex multi-task feature learning. Machine learning, 73(3):243–272, 2008.
|
| 216 |
+
|
| 217 |
+
[5] Jonathan Baxter. A model of inductive bias learning. Journal of artificial intelligence research, 12:149–198, 2000.
|
| 218 |
+
|
| 219 |
+
[6] Shai Ben-David and Reba Schuller. Exploiting task relatedness for multiple task learning. In Learning Theory and Kernel Machines, pages 567–580. Springer, 2003.
|
| 220 |
+
|
| 221 |
+
[7] Lukas Brinkmeyer, Rafael Rego Drumond, Randolf Scholz, Josif Grabocka, and Lars SchmidtThieme. Chameleon: Learning model initializations across tasks with different schemas. arXiv preprint arXiv:1909.13576, 2019.
|
| 222 |
+
|
| 223 |
+
[8] Rich Caruana. Multitask learning. Machine Learning, 28, pages 41–75, 1997.
|
| 224 |
+
|
| 225 |
+
[9] Richard Caruana. Multitask learning: A knowledge-based source of inductive bias. In Proceedings of the Tenth International Conference on Machine Learning, pages 41–48. Morgan Kaufmann, 1993.
|
| 226 |
+
|
| 227 |
+
[10] Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. arXiv preprint arXiv:1711.02257, 2017.
|
| 228 |
+
|
| 229 |
+
[11] Zhao Chen, Jiquan Ngiam, Yanping Huang, Thang Luong, Henrik Kretzschmar, Yuning Chai, and Dragomir Anguelov. Just pick a sign: Optimizing deep multitask models with gradient sign dropout. Advances in Neural Information Processing Systems, 33, 2020.
|
| 230 |
+
|
| 231 |
+
[12] François Chollet et al. Keras: The python deep learning library. ascl, pages ascl–1806, 2018.
|
| 232 |
+
|
| 233 |
+
[13] Paul Covington, Jay Adams, and Emre Sargin. Deep neural networks for youtube recommendations. In Proceedings of the 10th ACM conference on recommender systems, pages 191–198, 2016.
|
| 234 |
+
|
| 235 |
+
[14] Long Duong, Trevor Cohn, Steven Bird, and Paul Cook. Low resource dependency parsing: Cross-lingual parameter sharing in a neural network parser. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 845–850, 2015.
|
| 236 |
+
|
| 237 |
+
[15] Kshitij Dwivedi and Gemma Roig. Representation similarity analysis for efficient task taxonomy & transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 12387–12396, 2019.
|
| 238 |
+
|
| 239 |
+
[16] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1126–1135. JMLR. org, 2017.
|
| 240 |
+
|
| 241 |
+
[17] Erin Grant, Chelsea Finn, Sergey Levine, Trevor Darrell, and Thomas Griffiths. Recasting gradient-based meta-learning as hierarchical bayes, 2018.
|
| 242 |
+
|
| 243 |
+
[18] Michelle Guo, Albert Haque, De-An Huang, Serena Yeung, and Li Fei-Fei. Dynamic task prioritization for multitask learning. In Proceedings of the European Conference on Computer Vision (ECCV), pages 270–287, 2018.
|
| 244 |
+
|
| 245 |
+
[19] Pengsheng Guo, Chen-Yu Lee, and Daniel Ulbricht. Learning to branch for multi-task learning. arXiv preprint arXiv:2006.01895, 2020.
|
| 246 |
+
[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 247 |
+
[21] Geoffrey E Hinton and David C Plaut. Using fast weights to deblur old memories. In Proceedings of the ninth annual conference of the Cognitive Science Society, pages 177–186, 1987.
|
| 248 |
+
[22] Siyu Huang, Xi Li, Zhi-Qi Cheng, Zhongfei Zhang, and Alexander Hauptmann. GNAS: A greedy neural architecture search method for multi-attribute learning. 2018 ACM Multimedia Conference on Multimedia Conference - MM ’18, 2018.
|
| 249 |
+
[23] Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
|
| 250 |
+
[24] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in neural information processing systems, pages 315–323, 2013.
|
| 251 |
+
[25] Dmitry Kalashnikov, Jacob Varley, Yevgen Chebotar, Benjamin Swanson, Rico Jonschkowski, Chelsea Finn, Sergey Levine, and Karol Hausman. Mt-opt: Continuous multi-task robotic reinforcement learning at scale. arXiv preprint arXiv:2104.08212, 2021.
|
| 252 |
+
[26] Zhuoliang Kang, Kristen Grauman, and Fei Sha. Learning with whom to share in multi-task feature learning. In ICML, 2011.
|
| 253 |
+
[27] Andrej Karpathy. Multi-task learning in the wilderness. ICML, 2019. URL https:// slideslive.com/38917690/multitask-learning-in-the-wilderness.
|
| 254 |
+
[28] Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7482–7491, 2018.
|
| 255 |
+
[29] Taesup Kim, Jaesik Yoon, Ousmane Dia, Sungwoong Kim, Yoshua Bengio, and Sungjin Ahn. Bayesian model-agnostic meta-learning. arXiv preprint arXiv:1806.03836, 2018.
|
| 256 |
+
[30] Abhishek Kumar and Hal Daume III. Learning task grouping and overlap in multi-task learning. arXiv preprint arXiv:1206.6417, 2012.
|
| 257 |
+
[31] Giwoong Lee, Eunho Yang, and Sung Hwang. Asymmetric multi-task learning based on task relatedness and loss. In International conference on machine learning, pages 230–238. PMLR, 2016.
|
| 258 |
+
[32] Hae Beom Lee, Eunho Yang, and Sung Ju Hwang. Deep asymmetric multi-task feature learning. In International Conference on Machine Learning, pages 2956–2964. PMLR, 2018.
|
| 259 |
+
[33] Xi Lin, Hui-Ling Zhen, Zhenhua Li, Qing-Fu Zhang, and Sam Kwong. Pareto multi-task learning. In Advances in Neural Information Processing Systems, pages 12037–12047, 2019.
|
| 260 |
+
[34] Xingyu Lin, Harjatin Singh Baweja, George Kantor, and David Held. Adaptive auxiliary task weighting for reinforcement learning. Advances in neural information processing systems, 32, 2019.
|
| 261 |
+
[35] Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In Proceedings of the European Conference on Computer Vision (ECCV), pages 19–34, 2018.
|
| 262 |
+
[36] Liyang Liu, Yi Li, Zhanghui Kuang, Jing-Hao Xue, Yimin Chen, Wenming Yang, Qingmin Liao, and Wayne Zhang. Towards impartial multi-task learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum? id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ IMPnRXEWpvr.
|
| 263 |
+
[37] Shikun Liu, Edward Johns, and Andrew J Davison. End-to-end multi-task learning with attention. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1871–1880, 2019.
|
| 264 |
+
[38] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. 2015 IEEE International Conference on Computer Vision (ICCV), Dec 2015.
|
| 265 |
+
[39] Yongxi Lu, Abhishek Kumar, Shuangfei Zhai, Yu Cheng, Tara Javidi, and Rogerio Feris. Fully-adaptive feature sharing in multi-task networks with applications in person attribute classification. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jul 2017.
|
| 266 |
+
[40] Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3994–4003, 2016.
|
| 267 |
+
[41] Yu Nesterov. A method of solving a convex programming problem with convergence rate $\mathcal { O } ( 1 / k ^ { 2 } )$ . In Sov. Math. Dokl, volume 27, pages 372–376, 1983.
|
| 268 |
+
[42] Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
|
| 269 |
+
[43] Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017.
|
| 270 |
+
[44] 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.
|
| 271 |
+
[45] Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In Advances in Neural Information Processing Systems, pages 527–538, 2018.
|
| 272 |
+
[46] Trevor Standley, Amir R Zamir, Dawn Chen, Leonidas Guibas, Jitendra Malik, and Silvio Savarese. Which tasks should be learned together in multi-task learning? arXiv preprint arXiv:1905.07553, 2019.
|
| 273 |
+
[47] Ximeng Sun, Rameswar Panda, and Rogerio Feris. Adashare: Learning what to share for efficient deep multi-task learning. arXiv preprint arXiv:1911.12423, 2019.
|
| 274 |
+
[48] Mihai Suteu and Yike Guo. Regularizing deep multi-task networks using orthogonal gradients. arXiv preprint arXiv:1912.06844, 2019.
|
| 275 |
+
[49] Simon Vandenhende, Stamatios Georgoulis, Bert De Brabandere, and Luc Van Gool. Branched multi-task networks: deciding what layers to share. arXiv preprint arXiv:1904.02920, 2019.
|
| 276 |
+
[50] Zirui Wang, Yulia Tsvetkov, Orhan Firat, and Yuan Cao. Gradient vaccine: Investigating and improving multi-task optimization in massively multilingual models. arXiv preprint arXiv:2010.05874, 2020.
|
| 277 |
+
[51] Sen Wu, Hongyang R Zhang, and Christopher Ré. Understanding and improving information transfer in multi-task learning. arXiv preprint arXiv:2005.00944, 2020.
|
| 278 |
+
[52] Yongxin Yang and Timothy M. Hospedales. Trace norm regularised deep multi-task learning. arXiv preprint arXiv:1606.04038, 2016.
|
| 279 |
+
[53] Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. arXiv preprint arXiv:2001.06782, 2020.
|
| 280 |
+
[54] Amir R. Zamir, Alexander Sax, William Shen, Leonidas Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling task transfer learning. 2018 IEEE/CVF Conference, Jun 2018.
|
| 281 |
+
[55] Michael Zhang, James Lucas, Jimmy Ba, and Geoffrey E Hinton. Lookahead optimizer: k steps forward, 1 step back. In Advances in Neural Information Processing Systems, pages 9597–9608, 2019.
|
| 282 |
+
[56] Yu Zhang and Qiang Yang. A survey on multi-task learning. arXiv preprint arXiv:1707.08114, 2017.
|
| 283 |
+
[57] Xiangyun Zhao, Haoxiang Li, Xiaohui Shen, Xiaodan Liang, and Ying Wu. A modulation module for multi-task learning with applications in image retrieval. In Proceedings of the European Conference on Computer Vision (ECCV), pages 401–416, 2018.
|
| 284 |
+
[58] Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu Zhu, Hui Xiong, and Qing He. A comprehensive survey on transfer learning. Proceedings of the IEEE, 2020.
|
md/train/iEEAPq3TUEZ/iEEAPq3TUEZ.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UFC-BERT: Unifying Multi-Modal Controls for Conditional Image Synthesis
|
| 2 |
+
|
| 3 |
+
Zhu Zhang†, Jianxin $\mathbf { M } \mathbf { a } ^ { \dagger }$ , Chang Zhou†, Rui Men†, Zhikang Li†, Ming Ding‡, Jie Tang‡, Jingren Zhou†, and Hongxia Yang† †DAMO Academy, Alibaba Group, ‡Tsinghua University {zhangzhu950310}@gmail.com {jason.mjx, ericzhou.zc, yang.yhx}@alibaba-inc.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Conditional image synthesis aims to create an image according to some multi-modal guidance in the forms of textual descriptions, reference images, and image blocks to preserve, as well as their combinations. In this paper, instead of investigating these control signals separately, we propose a new two-stage architecture, UFC-BERT, to unify any number of multi-modal controls. In UFC-BERT, both the diverse control signals and the synthesized image are uniformly represented as a sequence of discrete tokens to be processed by Transformer. Different from existing two-stage autoregressive approaches such as DALL-E and VQGAN, UFC-BERT adopts non-autoregressive generation (NAR) at the second stage to enhance the holistic consistency of the synthesized image, to support preserving specified image blocks, and to improve the synthesis speed. Further, we design a progressive algorithm that iteratively improves the non-autoregressively generated image, with the help of two estimators developed for evaluating the compliance with the controls and evaluating the fidelity of the synthesized image, respectively. Extensive experiments on a newly collected large-scale clothing dataset M2C-Fashion and a facial dataset MultiModal CelebA-HQ verify that UFC-BERT can synthesize high-fidelity images that comply with flexible multi-modal controls.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Conditional image synthesis aims to create an image according to the given control signals. With the increasing demand for flexible conditional image synthesis, various kinds of control signals have been introduced into this field, which can be divided into three main modalities: (i) textual controls (TC), including the class labels [1] and natural language descriptions [62, 54]; (ii) visual controls $( V C )$ , such as a spatially-aligned sketch map for reference [17, 60] or another image for style transfer [15, 27]; (iii) preservation controls $( P C )$ , which require the synthesized image to preserve some given image blocks, e.g., image outpainting and inpainting [63, 69].
|
| 12 |
+
|
| 13 |
+
However, control signals of various modalities possess different characteristics. Existing works [62, 26, 61] hence typically design separate methods customized for each control modality. Moreover, most of these approaches only utilize one type of control signal and cannot simultaneously combine multiple types of controls in a concise and versatile model. This begs the question: can we integrate any number of multi-modal control signals into a unified framework for flexible conditional image synthesis? There are two inevitable challenges in this setting: (i) how to unify the multi-modal controls and represent them in a unified form, especial when employing multiple control signals from different modalities concurrently; (ii) how to guarantee the fulfillment of the multi-modal controls while ensuring the fidelity of the synthesized image.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: The three main modalities of control signals for conditional image synthesis: Textual Controls (TC), Visual Controls (VC), and Preservation Controls (PC).
|
| 17 |
+
|
| 18 |
+
Recently, two-stage image synthesis [42, 48, 3, 13, 47] has made great progress. The first stage learns a convolutional autoencoder with quantized latent representations for converting an image into a sequence of discrete tokens, e.g., for compressing a $2 5 6 \times 2 5 6$ image into a sequence of $3 2 \times 3 2$ tokens where each token correlates mainly with an $8 \times 8$ block of the image. Converting a sequence of tokens back into an image is also supported. The second stage then typically adopts an autoregressive model, e.g., PixelCNN [41] or a unidirectional Transformer decoder [55], to capture the distribution over sequences of tokens. Particularly, the Transformer-based methods [3, 13, 47] exploit the global expressivity of Transformer to capture long-range relationships between local constituents.
|
| 19 |
+
|
| 20 |
+
In this paper, we make two key observations about the two-stage framework. First, the two-stage framework has the advantage that it can potentially unify the multi-modal control signals and the generated image into a single sequence of discrete tokens. However, existing works [42, 48, 13, 47] largely neglect this advantage of the two-stage framework over the traditional one-stage approaches such as those based mainly on the generative adversarial networks (GAN) [18]. Second, the autoregressive $( A R )$ approach to sequence generation, adopted by the existing two-stage methods such as DALL-E [47] and VQGAN [13], brings undesirable shortcomings: (i) the token-by-token synthesis procedure leads to slow generation speed, especially for the heavyweight Transformer [3, 13, 47]; (ii) each generated token can only catch sight of the previously generated tokens and cannot incorporate bidirectional contexts, which may affect the holistic consistency of image synthesis; (iii) the fixed left-to-right order of autoregressive decoding cannot respond to the preservation control signals unless the image blocks to be preserved are at the beginning of the sequence. Notably, different from AR generation, non-autoregressive (NAR) sequence generation with bidirectional Transformer, i.e., BERT [9], can naturally avoid the three shortcomings.
|
| 21 |
+
|
| 22 |
+
Based on the aforementioned observations, we propose UFC-BERT, a novel BERT-based two-stage framework to UniFy any number of multi-modal Controls for conditional image synthesis. Concretely, the textual, visual, and preservation control signals, as well as the generated image, are uniformly represented as a sequence of discrete tokens, as shown in Figure 2. The textual control consists of word tokens for class labels or natural language descriptions. The visual control(s) and the generated image are both represented as discrete tokens due to the first stage, where each token corresponds to a block within the reference image(s) or the generated image. Zero, one, or more reference images are supported. To preserve a given image block within the generated image, we encode the given image block into discrete tokens and fix corresponding parts of the generated sequence to the tokens.
|
| 23 |
+
|
| 24 |
+
We train UFC-BERT via the masked sequence modeling task, which predicts a masked subset of the target image’s tokens conditioned on both the multi-modal control signals and the generation target’s unmasked tokens. During inference, we adopt Mask-Predict, a NAR generation algorithm [16, 21, 7], which predicts all target tokens at the first iteration and then iteratively re-mask and re-predict a subset of tokens with low confidence scores. To further improve upon the NAR generation algorithm, we exploit the discriminative capability of the BERT architecture [11, 70] and add two estimators (see Figure 2), where one estimator estimates the relevance between the generated image and the control signals, and the other one estimates the image’s fidelity. The two estimators help improve the quality of the synthesized image, because at each iteration we can generate multiple samples and keep only the highly-scored one before starting the next iteration. The two estimators also help save the number of iterations needed, since the algorithm can dynamically terminate if running for more iterations no longer improves the scores.
|
| 25 |
+
|
| 26 |
+
The extensive experiments on M2C-Fashion, a newly collected clothing dataset with tens of millions of image-text pairs, as well as on Multi-Modal CelebA-HQ [28, 61], a public facial dataset, demonstrate UFC-BERT can synthesize high-quality images that comply with various multi-modal controls.
|
| 27 |
+
|
| 28 |
+
# 2 Related Works
|
| 29 |
+
|
| 30 |
+
We have discussed the connection between our work and Two-Stage Image Synthesis in the Introduction. In this section, we further discuss related works from other fields.
|
| 31 |
+
|
| 32 |
+
Conditional Image Synthesis. A variety of control signals have been introduced into conditional image synthesis. The class-conditional generation task [1, 39] adopts class labels as control signals. The text-to-image synthesis task [64, 65, 30, 62, 72, 54] further employs natural language descriptions as controls. The image-to-image translation task generates photo-realism images from visual controls, such as a sketch map [17, 60], semantic label map [26, 4, 58], human pose [37] or another image for style transfer [15, 27]. Moreover, image outpainting and inpainting [25, 63] can be regarded as image synthesis conditioned on preservation control signals, where some image blocks of the desired image are already specified and need to be preserved in the generated image. However, these works only utilize one kind of control signal and design their methods customized for each kind of control. Text-guided image manipulation [10, 40, 69, 31, 61] semantically edits an image, where the text description and the original image serve as control signals. But they still fail to unify multiple modalities in a universal form and cannot easily extend to more control modalities. To promote versatility and extensibility, we propose UFC-BERT to unify any number of multi-modal controls.
|
| 33 |
+
|
| 34 |
+
Visual-Language Transformer. With great progress in language tasks [55, 44, 45, 2], the transformer architecture is being rapidly transferred to other fields such as vision [3, 68, 12] and audio [6]. Recently, pretraining visual-language transformer [43, 24, 70, 7, 35, 53, 67] (e.g. multi-modal BERT) has achieved significant improvements on a variety of downstream tasks, e.g. visual question answering, image captioning [70], and text-to-image generation [7]. Among them, the single-stream architecture [52, 32, 46, 5, 43, 24] uses a single transformer to jointly model a pair of text and image, while the two-stream architecture [35, 36, 53] applies two transformers to separately learn the representations of the text and the image, respectively. Our UFC-BERT is also a variant of the single-stream visual-language transformer, but focuses on flexible multi-modal image synthesis instead of multi-modal pretraining.
|
| 35 |
+
|
| 36 |
+
Non-Autoregressive Sequence Generation. Though it is natural to autoregressively predict tokens from left to right when generating a sequence, autoregressive decoding suffers from the slow speed and sequential error accumulation. Thus, the non-autoregressive generation (NAR) paradigm is proposed to avoid these drawbacks in neural machine translation [19, 20, 29, 16], image captioning [14, 22, 70], and speech synthesis [50, 49]. These approaches often employ the bidirectional Transformer (i.e. BERT) as it is not trained with a specific generation order. Our progressive NAR generation algorithm improves upon the Mask-Predict non-autoregressive algorithm [57, 16, 38, 33], by introducing the relevance estimator and the fidelity estimator to facilitate sample selection and dynamic termination.
|
| 37 |
+
|
| 38 |
+
# 3 UFC-BERT For Multi-Modal Image Synthesis
|
| 39 |
+
|
| 40 |
+
# 3.1 Background: Two-Stage Image Synthesis
|
| 41 |
+
|
| 42 |
+
In this section, we review the two-stage architecture [42, 48, 13, 47] for image synthesis.
|
| 43 |
+
|
| 44 |
+
At the first stage, a codebook $\mathcal { Z } = \{ \mathbf { z } _ { k } \} _ { k = 1 } ^ { K }$ for vector quantization is learned, where $\mathbf { z } _ { k } \in \mathbb { R } ^ { n _ { z } }$ is the $k$ -th code-word in the codebook and $K$ is the number of code-words. An image $\mathbf { X } \in \mathbb { R } ^ { H \times W \times 3 }$ can be transformed into (or from) a collection of code-words $\mathbf { Z } \in \mathbb { R } ^ { h \times w \times n _ { z } }$ . Concretely, a convolutional encoder $E$ first encodes the original image $\mathbf { X }$ as $\hat { \mathbf { Z } } = E ( \mathbf { X } ) \in \mathbb { R } ^ { h \times w \times n _ { z } }$ . Then an element-wise quantization step $\mathbf { q } ( \cdot )$ is applied to each element $\hat { \mathbf { Z } } _ { i j }$ to obtain the element’s closest code-word $\mathbf { z } _ { k }$ , i.e., $\begin{array} { r } { \mathbf q ( \hat { \mathbf Z } _ { i j } ) = \arg \operatorname* { m i n } _ { { \mathbf z } _ { k } \in { \mathcal Z } } \| \hat { \mathbf Z } _ { i j } - { \mathbf z } _ { k } \| } \end{array}$ . For reconstruction, a convolutional decoder $D$ is also learned for recovering image $\hat { \mathbf { X } } \in \mathbb { R } ^ { H \times W \times 3 }$ from $\mathbf { Z }$ such that $\hat { \bf X }$ is close to $\mathbf { X }$ . The first stage can be denoted by
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: The framework of UFC-BERT, where the textual control (TC), vsiual control (VC), and preservation control (PC), as well as the image to generate, collectively form a sequence of tokens.
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { Z } = \mathbf { q } ( E ( \mathbf { X } ) ) , \hat { \mathbf { X } } = D ( \mathbf { Z } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Due to the convolutional layers, each of the $h \times w$ elements of $\hat { \mathbf { Z } }$ mainly correlates with an $\textstyle { \frac { H } { h } } \times { \frac { W } { w } }$ block of the image, though its receptive field may be larger if multiple convolutions are stacked.
|
| 54 |
+
|
| 55 |
+
At the second stage, image $\mathbf { X }$ ’s quantized representation $\mathbf { Z }$ can be rewritten as a sequence of codes $\mathbf { I } \in$ $\{ 0 , \ldots , | \mathcal { Z } | - 1 \} ^ { \overline { { N } } _ { I } }$ , composed of $N _ { I } \left( = h \times w \right)$ indices from the codebook $\mathcal { Z }$ . Thus, image synthesis can be formulated as autoregressive sequence generation, i.e. predicting the distribution $\mathrm { P } \mathrm { \bar { r } } ( I _ { i } | \mathbf { I } _ { < i } , \mathbf { C } )$ of the next token $I _ { i }$ conditioned on the preceding tokens $\mathbf { I } _ { < i }$ and the control signals $\mathbf { C }$ . The distribution is typically modeled using a unidirectional Transformer. The likelihood is then $\mathrm { P r } ( { \bf I } | { \bf C } ) =$ $\begin{array} { r } { \prod _ { i } \operatorname* { P r } ( I _ { i } | \mathbf { I } _ { < i } , \mathbf { \dot { C } } ) } \end{array}$ . Parameters are learned by minimizing $\mathcal { L } _ { \mathrm { A R } } = \mathbb { E } _ { \mathbf { I } \sim d a t a } \left[ - \log \operatorname* { P r } ( \mathbf { I } | \mathbf { C } ) \right]$ .
|
| 56 |
+
|
| 57 |
+
We focus on improving the second stage. Specifically, the autoregressive paradigm adopted by the existing two-stage works [42, 48, 13, 47] suffers from slow generation speed, fails to capture bidirectional contexts, and cannot fully support preservation control signals. We thus propose UFCBERT, a novel NAR approach for stage two, to unify any number of multi-modal controls and tackle the shortcomings of AR. As for stage one, we directly follow VQGAN’s design [47], which improves upon VQVAE [42] by incorporating a perceptual loss [27] and patch-based adversarial training [26].
|
| 58 |
+
|
| 59 |
+
# 3.2 Problem Formulation
|
| 60 |
+
|
| 61 |
+
Conditional image synthesis aims to generate an image that satisfies a set of control signals C. We consider three major modalities of control signals. A Textual Control $( T C )$ consists of a sequence of words $\mathbf { T } \in \{ 0 , \dot { \mathbf { \Omega } } . . . , | \mathcal { W } | - 1 \} ^ { N _ { T } }$ , where $\mathcal { W }$ is the vocabulary and $N _ { T }$ is the number of words in the text. In the two-stage framework, an image can be converted into a sequence of code-words (i.e. tokens) based on stage one’s encoder $E$ and codebook $\mathcal { Z }$ . Thus, a Visual Control $( V C )$ is denoted by a sequence $\mathbf { V } \in \{ 0 , \overline { { \mathbf { \Omega } } } , \mathbf { \Omega } , | \mathcal { Z } | - 1 \} ^ { N _ { V } }$ consisting of code-words from the codebook $\mathcal { Z }$ , where $N _ { V }$ is the sequence length. Similarly, the target (i.e., the image to generate) is a sequence of code-words $\mathbf { I } \in \{ \bar { 0 , } . . . , | \mathcal { Z } | \overset { - } { - } 1 \} ^ { N _ { I } }$ . We support zero, one, or multiple visual controls for flexibility. As for the Preservation Control $( P C )$ , it is a sequence of binary masks $\mathbf { P } \in \{ 0 , 1 \} ^ { N _ { I } }$ with the same length as $\mathbf { I }$ , where 1 means that the token is known (i.e., $I _ { i }$ is ground-truth if $P _ { i } = 1$ ) while 0 means the token needs to be predicted. We aim to design a model at the second stage to synthesize the target image’s sequence I conditioned on $\mathbf { C }$ , i.e., a combination of any number of control signals from $\mathbf { \bar { \{ T } } , V , \bar { P } \}$ .
|
| 62 |
+
|
| 63 |
+
# 3.3 Model Inputs
|
| 64 |
+
|
| 65 |
+
As shown in Figure 2, our UFC-BERT modifies the original BERT model [9] to accommodate any number of multi-modal controls. Similar to BERT, the backbone is a multi-layer bidirectional Transformer encoder, enabling the dependency modeling between all input elements. The input sequence of UFC-BERT always starts with two special tokens [REL] and [FDL] for relevance estimation and fidelity estimation, then goes on with the word sequence $\mathbf { T }$ of textual controls, code sequence V of visual controls, and ends with the code sequence I of the target image to generate. Two special separation tokens [EOT] and [EOV] are appended to the end of the textual and the visual control sequences, respectively. If there are multiple visual controls, another special token [SEP] is inserted to separate them. The sequence I of the target image to generate may be partially or fully masked by a special token [MASK]. When the preservation control $\mathbf { P }$ is present and $P _ { i } = 1$ , token $I _ { i }$ in I is always set to the code-word corresponding to the given image block to be preserved.
|
| 66 |
+
|
| 67 |
+
Each input token’s representation is the sum of the position and token embeddings:
|
| 68 |
+
|
| 69 |
+
Position Embedding. Our UFC-BERT learns independent sets of position embeddings for the different kinds of the inputs to achieve better distinguishment between the various modalities. The position embeddings for the word sequence are the same as BERT, i.e., we use sequential position embeddings. For a visual control or the target image, the position embedding of each token is decided according to where this token lies on the $h \times w$ grid, i.e., we use spatial position embeddings.
|
| 70 |
+
|
| 71 |
+
Token Embedding. For textual controls, we use Byte-Pair Encoding [51] to segment each word into sub-words and then learn sub-word embeddings. Each special token, e.g., [REL] or [MASK], is assigned a dedicated embedding. For visual controls and the target image, we learn an embedding for each code-word. We do not directly use the embeddings from stage one’s codebook due to the decoupling of the two stages.
|
| 72 |
+
|
| 73 |
+
# 3.4 Training: Masked Sequence Modeling with Relevance and Fidelity Estimation
|
| 74 |
+
|
| 75 |
+
As shown in Figure 2, we train UFC-BERT via masked sequence modeling, i.e., predicting the masked tokens in the target image conditioned on the controls. A relevance estimator and a fidelity estimator are also trained in the process, and will be key to our progressive NAR generation algorithm.
|
| 76 |
+
|
| 77 |
+
Task 1: Masked Sequence Modeling. This task is similar to Masked Language Modeling (MLM) in BERT, but incorporates multi-modal control signals when predicting the masked tokens. To construct training samples, we mask parts of the target image I to predict using four strategies: (1) randomly decide the number of tokens to mask, and then randomly mask the desired number of tokens; (2) mask all tokens; (3) mask the tokens within some boxed areas of the image, where the number of boxes and the box sizes are randomly decided; (4) mask the tokens outside some random boxed areas of the image. We use the four strategies with probability 0.70, 0.10, 0.10, and 0.10, respectively. To construct multi-modal control signal $\mathbf { C }$ for each training sample, there are four different combinations: ${ < } T C$ , $V C >$ , ${ < } T C >$ , ${ < } V C >$ , <empty>, where ${ < } T C$ , $V C >$ means the textual and visual controls are simultaneously employed, ${ < } T C >$ or ${ < } V C >$ means only a textual or visual signal is used, and <empty> means no textual or visual control is present. Note that the preservation control is already included in the masked sequence modeling task. Since our dataset does not contain ground-truth pairs of visual controls and target images, we crop one or multiple regions of a target image to construct VC for the target image. Because image synthesis from solely textual controls is more challenging than from other signals, we use the four combinations with probability 0.20, 0.55, 0.20, 0.05, respectively, where textual controls get more attention. We feed UFC-BERT’s outputs at each position of I into a softmax classifier over the codebook $\mathcal { Z }$ , which produces a probability score $Y _ { i } = \mathrm { \bar { P r } } ( I _ { i } | \mathbf { I } _ { U } , \mathbf { C } )$ for each position $i \in M$ , where $M$ is the set of masked positions and $U$ is the unmasked set. Finally, the masked sequence modeling task minimizes the softmax cross-entropy loss $\mathcal { L } _ { \mathrm { M S M } } = \mathbb { E } _ { \mathbf { I } _ { M } , \mathbf { I } _ { U } } \left[ - \log \operatorname* { P r } ( \mathbf { I } _ { M } | \mathbf { I } _ { U } , \mathbf { C } ) \right]$ , where $\begin{array} { r } { \mathrm { P r } ( \mathbf { I } _ { M } ^ { \mathbf { - } } | \mathbf { I } _ { U } , \mathbf { C } ) = \prod _ { i \in M } Y _ { i } } \end{array}$ .
|
| 78 |
+
|
| 79 |
+
Task 2: Relevance Estimation. This task is to learn a binary classifier that judges whether the generated image is relevant or irrelevant to the given multi-modal control $\mathbf { C }$ . Briefly, we add a linear layer on the output corresponding to the special token [REL]. The linear layer outputs a scalar representing the logit, and a binary cross-entropy loss $\mathcal { L } _ { \mathrm { R E L } }$ is added. During training, the training samples from Task 1 serve as the positive instances (i.e. relevant pairs). We construct negative instances (i.e. irrelevant pairs) by swapping the control signals of two training samples.
|
| 80 |
+
|
| 81 |
+
Task 3: Fidelity Estimation. This task aims to distinguish whether the generated image is realistic from the view of human visual cognition. Similar to relevance estimation, we feed the output corresponding to [FDL] into a linear layer for binary classification and add another binary crossentropy loss ${ \mathcal { L } } _ { \mathrm { F D L } }$ . Since the low-fidelity images (i.e. negative instances) do not exist in the dataset, we run UFC-BERT from previous epochs to synthesize images based solely on textual control signals, and use the synthesized images as negative instances.
|
| 82 |
+
|
| 83 |
+
We combine the three tasks’ losses to train UFC-BERT, i.e.,
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { U F C - B E R T } } = \lambda _ { 1 } \mathcal { L } _ { \mathrm { M S M } } + \lambda _ { 2 } \mathcal { L } _ { \mathrm { R E L } } + \lambda _ { 3 } \mathcal { L } _ { \mathrm { F D L } } , } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\lambda _ { 1 }$ , $\lambda _ { 2 }$ and $\lambda _ { 3 }$ are set to 1.0, 0.5, and 0.5 to balance the three losses. The masked sequence modeling task ignores the negative instances from the other two tasks, i.e., irrelevant pairs or unrealistic instances. And the fidelity estimation task is added only after a certain number of epochs.
|
| 90 |
+
|
| 91 |
+
# 3.5 Inference: Progressive Non-Autoregressive Generation
|
| 92 |
+
|
| 93 |
+
We design a Progressive Non-Autoregressive Generation (PNAG) algorithm for conditional image synthesis after training, which improves upon Mask-Predict [16, 21, 7]. Mask-Predict predicts all target tokens when given a fully-masked sequence at the first iteration, and then iteratively re-mask and re-predict a subset of tokens with low probability scores for a constant number of iterations. However, Mask-Predict cannot ensure the efficacy of multi-modal controls and the fidelity of the synthesized images, and requires determining the number of iterations. Our PNAG tackles its drawbacks via sample selection and dynamic termination, based on the relevance and fidelity estimators.
|
| 94 |
+
|
| 95 |
+
Each iteration of our PNAG algorithm consists of a Mask step and then a Predict step. Let $\mathbf { I } ^ { ( t , i n ) } =$ (I (t,in)1 , . $( I _ { 1 } ^ { ( t , i n ) } , \ldots , I _ { N _ { I } } ^ { ( t , i n ) } )$ and $\mathbf { I } ^ { ( t , o u t ) } = ( I _ { 1 } ^ { ( t , o u t ) } , \dots , I _ { N _ { I } } ^ { ( t , o u t ) } )$ , I (t,out)N ) be the state of the target image’s sequence before and after the $t$ -th iteration, respectively. The tokens in $\mathbf { I } ^ { ( 0 , o u t ) }$ for $t = 0$ is all set to [MASK] except for the positions that are controlled by the preservation signals, i.e., except for I(0,out)i t hat has $P _ { i } = 1$ . If a preservation control is present, i.e. $P _ { i } = 1$ , we always set $I _ { i } ^ { ( t , i n ) }$ and $I _ { i } ^ { ( t , o u t ) }$ for all $t$ to be the code-word that corresponds to the provided image block to be preserved.
|
| 96 |
+
|
| 97 |
+
Mask Step. At the beginning of iteration $t$ $\left( t \geq 1 \right)$ ), we construct the input sequence $\mathbf { I } ^ { ( t , i n ) }$ by (re-)masking a subset of tokens in the generated sequence $\mathbf { I } ^ { ( t - 1 , o u t ) }$ from the last iteration. Similar to beam search, we construct $B$ parallel input sequences $\{ \mathbf { I } _ { 1 } ^ { ( t , i n ) } , \ldots , \mathbf { I } _ { B } ^ { ( t , i n ) } \}$ at each iteration. Specifically, we re-mask $n$ tokens of $\mathbf { I } ^ { ( t - 1 , o u t ) }$ to produce each $\mathbf { I } _ { b } ^ { ( t , i n ) }$ . We first sample $N _ { I } - n$ tokens from a multinomial distribution $\mathrm { P r } ^ { ( t , i n ) }$ proportional to the probability scores $\mathbf { Y } ^ { ( t - 1 ) } = \{ Y _ { i } ^ { ( t - 1 ) } \} _ { i = 1 } ^ { N _ { I } }$ (see Equation 3), computed by $\mathrm { P r } ^ { ( t , i n ) } = \mathrm { S o f t m a x } ( \mathbf { Y } ^ { ( t - 1 ) } )$ . And other tokens are re-masked and re-predicted at the next Predict Step. Here $\begin{array} { r } { n = N _ { I } \cdot ( \beta + \frac { T - t } { T - 1 } \cdot ( \alpha - \beta ) ) } \end{array}$ , where $\alpha$ is the initial mask ratio, $\beta$ is the minimum mask ratio, and $T$ is the maximum possible number of iterations, such that the number of tokens to re-mask gradually decreases after every iteration.
|
| 98 |
+
|
| 99 |
+
Predict Step. Given the control $\mathbf { C }$ and an input sequence $\mathbf { I } _ { b } ^ { ( t , i n ) }$ , UFC-BERT estimates a distribution $\mathrm { P r } ( \hat { I } _ { i } | \mathbf { I } _ { b } ^ { ( t , i n ) } , \mathbf { C } )$ for each masked position $i$ . UFC-BERT also estimates the relevance score $S _ { b } ^ { R }$ and fidelity score $S _ { b } ^ { F }$ regarding the image that it is about to synthesize, and summarizes the scores into a comprehensive score $S _ { b } ^ { ( t ) } = \sigma S _ { b } ^ { R } + ( 1 - \sigma ) S _ { b } ^ { F }$ , where $\sigma$ is a coefficient for adjusting the importance of the two. We perform sample selection based on $S _ { b } ^ { ( t ) }$ , i.e., we select the $b$ -th sequen ce I(t,in)b w ith the highest $S _ { b } ^ { ( t ) }$ , discard the others, and then generate $\mathbf { I } ^ { ( t , o u t ) }$ based on the selected $\mathbf { I } _ { b } ^ { ( t , i n ) }$ as follows:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
I _ { i } ^ { ( t , o u t ) } \sim \mathrm { P r } ( \hat { I } _ { i } | \mathbf { I } _ { b } ^ { ( t , i n ) } , \mathbf { C } ) , \qquad Y _ { i } ^ { ( t ) } \gets \mathrm { P r } ( \hat { I } _ { i } = I _ { i } ^ { ( t , o u t ) } | \mathbf { I } _ { b } ^ { ( t , i n ) } , \mathbf { C } ) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where each token $I _ { i } ^ { ( t , o u t ) }$ is sampled from the multinomial distribution $\mathrm { P r } ( \hat { I } _ { i } | \mathbf { I } _ { b } ^ { ( t , i n ) } , \mathbf { C } )$ and the corresponding probability is assigned to $Y _ { i } ^ { ( t ) }$ . Note that we predict tokens for all masked positions regardless of the predictions’ confidence. We also implement dynamic termination based on $S _ { b } ^ { ( t ) }$ . Specifically, if the current iteration’s score $S _ { b } ^ { ( t ) }$ is higher than $S _ { m a x }$ (initialized as zero), we set $S _ { m a x }$ to $S _ { b } ^ { ( t ) }$ and record the current iteration as $t _ { m a x }$ . If $S _ { m a x }$ does not increase after three consecutive iterations, we select $\mathbf { I } ^ { ( t _ { m a x } , o u t ) }$ as the final result and terminate our generation algorithm.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3: Images generated by our UFC-BERT under various combinations of textual controls (TC), visual controls (VC), and preservation controls (PC). Please see the supplemental material for more showcases, where we also include a study on the diversity of the images generated by UFC-BERT and analyze how the multiple control signals interfere with each other.
|
| 109 |
+
|
| 110 |
+
# 4 Experiments
|
| 111 |
+
|
| 112 |
+
# 4.1 Datasets and Hyperparameters
|
| 113 |
+
|
| 114 |
+
In experiments, we focus on two practical fields of image synthesis: fashionable clothing and human faces. We collect a very large-scale clothing dataset M2C-Fashion with Chinese text descriptions, which contains tens of millions of image-text pairs, much larger than the commonly used text-to-image datasets COCO [34] and CUB [56]. Details of the dataset are provided in the supplementary material. We additionally use another high-resolution facial dataset Multi-Modal CelebA-HQ [28, 61].
|
| 115 |
+
|
| 116 |
+
Following the model setting of VQGAN [13], we use the $2 5 6 \times 2 5 6$ image size on the two datasets and transform each image to a discrete sequence of $1 6 \times 1 6$ codes, where the codebook size $| { \mathcal { Z } } |$ is set to 1024. For the BERT model, we set the number of layers, hidden size, and the number of attention heads to 24, 1024, and 16, respectively. Our UFC-BERT has 307M parameters, same as the Transformer used by VQGAN. As for hyper-parameters of PNAG, we set the parallel decoding number $B$ to 5 and the balance coefficient $\sigma$ to 0.5. We set the initial mask ratio $\alpha$ , the minimum mask ratio $\beta$ , and the maximum iteration number $T$ to 0.8, 0.2, and 10, respectively.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
|
| 120 |
+
Figure 4: Image synthesis with multiple visual controls, where we crop regions from $2 \sim 3$ images to serve as the visual controls. UFC-BERT synthesizes images that naturally fuse the visual elements.
|
| 121 |
+
|
| 122 |
+
Table 1: Comparisons with GAN baselines for text-to-image synthesis on Multi-Modal CelebA-HQ.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Method</td><td>AttnGAN [62]</td><td>ControlGAN [30]</td><td>DF-GAN [54]</td><td>DM-GAN [71]</td><td>TediGAN [61]</td><td>UFC-BERT (our)</td></tr><tr><td>FID↓</td><td>125.98</td><td>116.32</td><td>137.60</td><td>131.05</td><td>106.37</td><td>66.72</td></tr><tr><td>LPIPS↓</td><td>0.512</td><td>0.522</td><td>0.581</td><td>0.544</td><td>0.456</td><td>0.448</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Table 2: Comparisons with the autoregressive two-stage method VQGAN for text-to-image synthesis. ↓ means the lower the better, while $\uparrow$ means the opposite. We evaluate speed on the same V100 GPU.
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan="2">Datasets</td><td rowspan="2">Methods</td><td colspan="4">Automatic Metrics</td><td colspan="2">Human Pairwise Study</td><td rowspan="2">Inference Speed</td></tr><tr><td>FID↓</td><td>LPIPS↓</td><td>PSNR↑</td><td>SSIM↑</td><td>Relevance</td><td>Fidelity</td></tr><tr><td rowspan="2">M2C-Fashion</td><td>VQGAN (AR)</td><td>12.48</td><td>0.483</td><td>10.80</td><td>0.56</td><td>38.6%</td><td>44.2%</td><td>8.73 sec/sample</td></tr><tr><td>UFC-BERT (NAR)</td><td>11.53</td><td>0.461</td><td>13.14</td><td>0.58</td><td>61.4%</td><td>55.8%</td><td>0.81 sec/sample</td></tr><tr><td rowspan="2">Multi-Modal CelebA-HQ</td><td>VQGAN (AR)</td><td>52.63</td><td>0.503</td><td>8.98</td><td>0.28</td><td>42.7%</td><td>46.9%</td><td>8.66 sec/sample</td></tr><tr><td>UFC-BERT (NAR)</td><td>66.72</td><td>0.448</td><td>9.56</td><td>0.29</td><td>57.3%</td><td>53.1%</td><td>0.79 sec/sample</td></tr></table>
|
| 129 |
+
|
| 130 |
+
# 4.2 Flexibility of Multi-Modal Controls for Conditional Image Synthesis
|
| 131 |
+
|
| 132 |
+
In this section, we qualitatively verify the synthesis ability of UFC-BERT with three modalities of control signals, i.e., textual, visual, and preservation controls. The textual controls are the texts paired with the images, which are already provided by the two datasets, while the visual controls are code sequences of cropped regions, e.g. regions that represent logos or texture of clothes.
|
| 133 |
+
|
| 134 |
+
In Figure 3, we synthesize images conditioned on combinations of the three types of control signals. The results demonstrate UFC-BERT can unify any number of multi-modal controls to synthesize high-quality images. Further, UFC-BERT supports one or multiple visual controls for more flexible synthesis, as shown in Figure 4 where we generate images given $2 { \sim } 3$ visual controls. We observe that UFC-BERT can reasonably fuse multiple visual elements and produce a harmonious image.
|
| 135 |
+
|
| 136 |
+
# 4.3 Quantitative Comparison to Existing Methods for Text-to-Image Synthesis
|
| 137 |
+
|
| 138 |
+
In this section, we investigate how our UFC-BERT quantitatively compares to existing models. Considering most existing methods only utilize one control signal, we select the most common and challenging task text-to-image synthesis to compare the synthesis ability.
|
| 139 |
+
|
| 140 |
+
First, we compare our UFC-BERT with GAN-based text-to-image models AttnGAN [62], ControlGAN [30], DF-GAN [54], DM-GAN [71] and TediGAN [61] on the Multi-Modal CelebA-HQ dataset. For evalution, we adopt two automatic metrics FID [23] and LPIPS [66]. We report the results on Table 1 and our UFC-BERT achieves the best performance on the two metrics, even outperforming the TediGAN that uses slow and complex instance-level optimization. This demonstrates the two-stage architecture and non-autoregressive generation of UFC-BERT are suitable for text-to-image synthesis.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
|
| 144 |
+
This woman has wavy hair and is wearing earrings, and lipstick.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: The iterative inference process of our PNAG algorithm. The red bounding box means the image has the highest comprehensive score and is selected as the final output result.
|
| 148 |
+
|
| 149 |
+
Besides, we compare our UFC-BERT with the autoregressive two-stage method VQGAN from three aspects: (i) the automatic metrics FID for image quality, as well as LPIPS, PSNR [59] and SSIM [59] for the similarity between the generated image and the ground truth; (ii) the Relevance and Fidelity metrics are evaluated through a user study, where the users are asked to judge which model’s output is more relevant to the textual descriptions, and more photorealistic; (iii) the synthesis speed of the two approaches. Note that the autoregressive inference implementation of VQGAN has been optimized by caching the preceding computation as in Transformer-XL [8], and UFCBERT and VQGAN have the same parameter number (307M) for fair com
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 5: Typical examples of UFC-BERT and VQGAN for text-to-image synthesis, including a counterfactual case.
|
| 153 |
+
|
| 154 |
+
parison. For the user study, the two models receive the same textual signals, and each generates 50 images. We collect the pairwise comparison results from five volunteers.
|
| 155 |
+
|
| 156 |
+
As shown in Table 2, our UFC-BERT achieves better performance for almost all criteria with about $1 1 \times$ speedup. This suggests our non-autoregressive UFC-BERT with progressive NAR generation algorithm can synthesize high-fidelity images relevant to textual descriptions. As for the FID metric, UFC-BERT outperforms VQGAN on M2C-Fashion, but has worse performance on Multi-Modal CelebA-HQ, it may be due to the fact that the autoregressive VQGAN can more easily memorize the pattern of a small dataset (only 30,000 facial images). In Figure 5, we further show typical generated examples to intuitively display the difference between the two approaches, including a case of counterfactual generation. We find that UFC-BERT can synthesize high-quality images, even for the counterfactual case.
|
| 157 |
+
|
| 158 |
+
# 4.4 The Effectiveness of Our Progressive NAR Generation Algorithm
|
| 159 |
+
|
| 160 |
+
In this section, we first visualize in Figure 6 the iterative process of our PNAG inference method based on the relevance and fidelity estimators. The images with red bounding boxes are the final outputs that match the textual control signals. We can find that the fidelity and relevance of the images increase after a few iterations, verifying our PNAG algorithm can guide the inference process towards a better direction and synthesize more realistic images that match the control signals.
|
| 161 |
+
|
| 162 |
+
Table 3: Ablation studies of our PNAG inference algorithm. PNAG(w/o. REF) and PNAG(w/o. FDL) set $B$ to the default value 5. MNAG is the original Mask-Predict algorithm [16].
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Dataset</td><td>Metrics</td><td>MNAG [16]</td><td>PNAG(w/o.REF)</td><td>PNAG(w/o.FDL)</td><td>PNAG(B=1)</td><td>PNAG(B=5)</td><td>PNAG(B=10)</td></tr><tr><td rowspan="2">M2C-Fashion</td><td>FID↓</td><td>14.77</td><td>12.17</td><td>13.14</td><td>12.72</td><td>11.53</td><td>11.14</td></tr><tr><td>LPIPS↓</td><td>0.488</td><td>0.477</td><td>0.469</td><td>0.479</td><td>0.461</td><td>0.456</td></tr><tr><td rowspan="2">Multi-Modal CelebA-HQ</td><td>FID↓</td><td>72.04</td><td>68.90</td><td>70.32</td><td>69.49</td><td>66.72</td><td>65.30</td></tr><tr><td>LPIPS↓</td><td>0.514</td><td>0.469</td><td>0.463</td><td>0.475</td><td>0.448</td><td>0.445</td></tr></table>
|
| 165 |
+
|
| 166 |
+
We then conduct ablation studies of PNAG. As shown in Table 3, we develop three ablated inference methods PNAG(w/o. REF), PNAG(w/o. FDL) and MNAG, where PNAG(w/o. REF) and PNAG(w/o. FDL) discard the relevance estimator and the fidelity estimator, respectively, and MNAG is the original Mask-Predict method [16] without any estimator. The results demonstrate that the two estimators effectively utilize the discriminative capability of UFC-BERT and do help improve the synthesis quality. Additionally, we vary the crucial hyper-parameter of PNAG $B$ (i.e. the parallel decoding number during inference) from 1 to 10, and the results in Table 3 show that a larger $B$ is beneficial to the synthesis quality.
|
| 167 |
+
|
| 168 |
+
# 5 Conclusions
|
| 169 |
+
|
| 170 |
+
We proposed UFC-BERT to unify any number of multi-modal controls in a universal form for conditional image synthesis. We utilized non-autoregressive generation to improve inference speed, enhance holistic consistency, and support preservation controls. Further, we designed a progressive generation algorithm based on relevance and fidelity estimators to ensure relevance and fidelity.
|
| 171 |
+
|
| 172 |
+
# References
|
| 173 |
+
|
| 174 |
+
[1] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 175 |
+
[2] 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.
|
| 176 |
+
[3] Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020.
|
| 177 |
+
[4] Qifeng Chen and Vladlen Koltun. Photographic image synthesis with cascaded refinement networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 1511–1520, 2017.
|
| 178 |
+
[5] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Learning universal image-text representations. 2019.
|
| 179 |
+
[6] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 180 |
+
[7] Jaemin Cho, Jiasen Lu, Dustin Schwenk, Hannaneh Hajishirzi, and Aniruddha Kembhavi. X-lxmert: Paint, caption and answer questions with multi-modal transformers. arXiv preprint arXiv:2009.11278, 2020.
|
| 181 |
+
[8] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 182 |
+
[9] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the Conference on The North American Chapter of the Association for Computational Linguistics, 2019.
|
| 183 |
+
[10] Hao Dong, Simiao Yu, Chao Wu, and Yike Guo. Semantic image synthesis via adversarial learning. In Proceedings of the IEEE International Conference on Computer Vision, pages 5706–5714, 2017.
|
| 184 |
+
[11] Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. arXiv preprint arXiv:1905.03197, 2019.
|
| 185 |
+
[12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 186 |
+
[13] Patrick Esser, Robin Rombach, and Björn Ommer. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 187 |
+
[14] Junlong Gao, Xi Meng, Shiqi Wang, Xia Li, Shanshe Wang, Siwei Ma, and Wen Gao. Masked nonautoregressive image captioning. arXiv preprint arXiv:1906.00717, 2019.
|
| 188 |
+
[15] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2414–2423, 2016.
|
| 189 |
+
[16] Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Mask-predict: Parallel decoding of conditional masked language models. arXiv preprint arXiv:1904.09324, 2019.
|
| 190 |
+
[17] Arnab Ghosh, Richard Zhang, Puneet K Dokania, Oliver Wang, Alexei A Efros, Philip HS Torr, and Eli Shechtman. Interactive sketch & fill: Multiclass sketch-to-image translation. In Proceedings of the IEEE International Conference on Computer Vision, pages 1171–1180, 2019.
|
| 191 |
+
[18] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
|
| 192 |
+
[19] Jiatao Gu, James Bradbury, Caiming Xiong, Victor OK Li, and Richard Socher. Non-autoregressive neural machine translation. arXiv preprint arXiv:1711.02281, 2017.
|
| 193 |
+
[20] Junliang Guo, Xu Tan, Di He, Tao Qin, Linli Xu, and Tie-Yan Liu. Non-autoregressive neural machine translation with enhanced decoder input. In Proceedings of the American Association for Artificial Intelligence, volume 33, pages 3723–3730, 2019.
|
| 194 |
+
[21] Junliang Guo, Zhirui Zhang, Linli Xu, Hao-Ran Wei, Boxing Chen, and Enhong Chen. Incorporating bert into parallel sequence decoding with adapters. In Advances in Neural Information Processing Systems, 2020.
|
| 195 |
+
[22] Longteng Guo, Jing Liu, Xinxin Zhu, Xingjian He, Jie Jiang, and Hanqing Lu. Non-autoregressive image captioning with counterfactuals-critical multi-agent learning. arXiv preprint arXiv:2005.04690, 2020.
|
| 196 |
+
[23] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Günter Klambauer, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a nash equilibrium. 2017.
|
| 197 |
+
[24] Zhicheng Huang, Zhaoyang Zeng, Bei Liu, Dongmei Fu, and Jianlong Fu. Pixel-bert: Aligning image pixels with text by deep multi-modal transformers. arXiv preprint arXiv:2004.00849, 2020.
|
| 198 |
+
[25] Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Let there be color! joint end-to-end learning of global and local image priors for automatic image colorization with simultaneous classification. ACM Transactions on Graphics (ToG), 35(4):1–11, 2016.
|
| 199 |
+
[26] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125–1134, 2017.
|
| 200 |
+
[27] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and superresolution. In Proceedings of the European Conference on Computer Vision, pages 694–711. Springer, 2016.
|
| 201 |
+
[28] 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.
|
| 202 |
+
[29] Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. arXiv preprint arXiv:1802.06901, 2018.
|
| 203 |
+
[30] Bowen Li, Xiaojuan Qi, Thomas Lukasiewicz, and Philip HS Torr. Controllable text-to-image generation. arXiv preprint arXiv:1909.07083, 2019.
|
| 204 |
+
[31] Bowen Li, Xiaojuan Qi, Thomas Lukasiewicz, and Philip HS Torr. Manigan: Text-guided image manipulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7880–7889, 2020.
|
| 205 |
+
[32] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In Proceedings of the American Association for Artificial Intelligence, volume 34, pages 11336–11344, 2020.
|
| 206 |
+
[33] Yi Liao, Xin Jiang, and Qun Liu. Probabilistically masked language model capable of autoregressive generation in arbitrary word order. arXiv preprint arXiv:2004.11579, 2020.
|
| 207 |
+
[34] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Proceedings of the European Conference on Computer Vision, pages 740–755. Springer, 2014.
|
| 208 |
+
[35] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. arXiv preprint arXiv:1908.02265, 2019.
|
| 209 |
+
[36] Jiasen Lu, Vedanuj Goswami, Marcus Rohrbach, Devi Parikh, and Stefan Lee. 12-in-1: Multi-task vision and language representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10437–10446, 2020.
|
| 210 |
+
[37] Liqian Ma, Xu Jia, Qianru Sun, Bernt Schiele, Tinne Tuytelaars, and Luc Van Gool. Pose guided person image generation. arXiv preprint arXiv:1705.09368, 2017.
|
| 211 |
+
[38] Elman Mansimov, Alex Wang, Sean Welleck, and Kyunghyun Cho. A generalized framework of sequence generation with application to undirected sequence models. arXiv preprint arXiv:1905.12790, 2019.
|
| 212 |
+
[40] Seonghyeon Nam, Yunji Kim, and Seon Joo Kim. Text-adaptive generative adversarial networks: manipulating images with natural language. arXiv preprint arXiv:1810.11919, 2018.
|
| 213 |
+
[41] Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders. arXiv preprint arXiv:1606.05328, 2016.
|
| 214 |
+
[42] Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. arXiv preprint arXiv:1711.00937, 2017.
|
| 215 |
+
[43] Di Qi, Lin Su, Jia Song, Edward Cui, Taroon Bharti, and Arun Sacheti. Imagebert: Cross-modal pre-training with large-scale weak-supervised image-text data. arXiv preprint arXiv:2001.07966, 2020.
|
| 216 |
+
[44] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
|
| 217 |
+
[45] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 218 |
+
[46] Wasifur Rahman, Md Kamrul Hasan, Amir Zadeh, Louis-Philippe Morency, and Mohammed Ehsan Hoque. M-bert: Injecting multimodal information in the bert structure. arXiv preprint arXiv:1908.05787, 2019.
|
| 219 |
+
[47] Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 220 |
+
[48] Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019.
|
| 221 |
+
[49] Yi Ren, Chenxu Hu, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. Fastspeech 2: Fast and high-quality end-to-end text to speech. arXiv preprint arXiv:2006.04558, 2020.
|
| 222 |
+
[50] Yi Ren, Yangjun Ruan, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. Fastspeech: Fast, robust and controllable text to speech. arXiv preprint arXiv:1905.09263, 2019.
|
| 223 |
+
[51] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015.
|
| 224 |
+
[52] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. Vl-bert: Pre-training of generic visual-linguistic representations. arXiv preprint arXiv:1908.08530, 2019.
|
| 225 |
+
[53] Hao Tan and Mohit Bansal. Lxmert: Learning cross-modality encoder representations from transformers. arXiv preprint arXiv:1908.07490, 2019.
|
| 226 |
+
[54] Ming Tao, Hao Tang, Songsong Wu, Nicu Sebe, Xiao-Yuan Jing, Fei Wu, and Bingkun Bao. Df-gan: Deep fusion generative adversarial networks for text-to-image synthesis. arXiv preprint arXiv:2008.05865, 2020.
|
| 227 |
+
[55] 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, pages 5998–6008, 2017.
|
| 228 |
+
[56] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
|
| 229 |
+
[57] Alex Wang and Kyunghyun Cho. Bert has a mouth, and it must speak: Bert as a markov random field language model. arXiv preprint arXiv:1902.04094, 2019.
|
| 230 |
+
[58] 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, pages 8798–8807, 2018.
|
| 231 |
+
[59] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004.
|
| 232 |
+
[60] Weihao Xia, Yujiu Yang, and Jing-Hao Xue. Cali-sketch: Stroke calibration and completion for high-quality face image generation from poorly-drawn sketches. arXiv preprint arXiv:1911.00426, 2019.
|
| 233 |
+
[61] Weihao Xia, Yujiu Yang, Jing-Hao Xue, and Baoyuan Wu. Tedigan: Text-guided diverse image generation and manipulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 234 |
+
[62] Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1316–1324, 2018.
|
| 235 |
+
[63] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Free-form image inpainting with gated convolution. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4471–4480, 2019.
|
| 236 |
+
[64] 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, pages 5907–5915, 2017.
|
| 237 |
+
[65] Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, and Dimitris N Metaxas. Stackgan $^ { + + }$ : Realistic image synthesis with stacked generative adversarial networks. IEEE transactions on pattern analysis and machine intelligence, 41(8):1947–1962, 2018.
|
| 238 |
+
[66] 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, pages 586–595, 2018.
|
| 239 |
+
[67] Shengyu Zhang, Tan Jiang, Tan Wang, Kun Kuang, Zhou Zhao, Jianke Zhu, Jin Yu, Hongxia Yang, and Fei Wu. Devlbert: Learning deconfounded visio-linguistic representations. In Proceedings of the 28th ACM International Conference on Multimedia, pages 4373–4382, 2020.
|
| 240 |
+
[68] Shengyu Zhang, Ziqi Tan, Zhou Zhao, Jin Yu, Kun Kuang, Tan Jiang, Jingren Zhou, Hongxia Yang, and Fei Wu. Comprehensive information integration modeling framework for video titling. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2744–2754, 2020.
|
| 241 |
+
[69] Zijian Zhang, Zhou Zhao, Zhu Zhang, Baoxing Huai, and Jing Yuan. Text-guided image inpainting. In Proceedings of the ACM International Conference on Multimedia, pages 4079–4087, 2020.
|
| 242 |
+
[70] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason Corso, and Jianfeng Gao. Unified visionlanguage pre-training for image captioning and vqa. In Proceedings of the American Association for Artificial Intelligence, volume 34, pages 13041–13049, 2020.
|
| 243 |
+
[71] Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5802–5810, 2019.
|
| 244 |
+
[72] Peihao Zhu, Rameen Abdal, Yipeng Qin, and Peter Wonka. Sean: Image synthesis with semantic region-adaptive normalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5104–5113, 2020.
|
md/train/jpm1AfJucwt/jpm1AfJucwt.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING LOSS MODELLING FOR UNSTRUCTURED PRUNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
By removing parameters from deep neural networks, unstructured pruning methods aim at cutting down memory footprint and computational cost, while maintaining prediction accuracy. In order to tackle this otherwise intractable problem, many of these methods model the loss landscape using first or second order Taylor expansions to identify which parameters can be discarded. We revisit loss modelling for unstructured pruning: we show the importance of ensuring locality of the pruning steps, and systematically compare first and second order Taylor expansions. Finally, we show that better preserving the original network function does not necessarily transfer to better performing networks after fine-tuning, suggesting that only considering the impact of pruning on the loss might not be a sufficient objective to design good pruning criteria.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural networks are getting bigger, requiring more and more computational resources not only for training, but also when used for inference. However, resources are sometimes limited, especially on mobile devices and low-power chips. In unstructured pruning, the goal is to remove some parameters (i.e. setting them to zeros), while still maintaining good prediction performances. This is fundamentally a combinatorial optimization problem which is intractable even for small scale neural networks, and thus various heuristics have been developed to prune the model either before training (Lee et al., 2019b; Wang et al., 2020), during training (Louizos et al., 2017; Molchanov et al., 2017; Ding et al., 2019), or in an iterative training/fine-tuning fashion (LeCun et al., 1990; Hassibi & Stork, 1993; Han et al., 2015; Frankle & Carbin, 2018; Renda et al., 2020).
|
| 12 |
+
|
| 13 |
+
Early pruning work Optimal Brain Damage (OBD) (LeCun et al., 1990), and later Optimal Brain Surgeon (OBS) (Hassibi & Stork, 1993), proposed to estimate the importance of each parameter by approximating the effect of removing it, using the second order term of a Taylor expansion of the loss function around converged parameters. This type of approach involves computing the Hessian, which is challenging to compute since it scales quadratically with the number of parameters in the network. Several approximations have thus been explored in the literature (LeCun et al., 1990; Hassibi & Stork, 1993; Heskes, 2000; Zeng & Urtasun, 2019; Wang et al., 2019). However, state-ofthe-art unstructured pruning methods typically rely on Magnitude Pruning (MP) (Han et al., 2015), a simple and computationally cheap criterion based on weight magnitude, that works extremely well in practice (Renda et al., 2020).
|
| 14 |
+
|
| 15 |
+
This paper revisits linear and diagonal quadratic models of the local loss landscape for unstructured pruning. In particular, since these models are local approximations and thus assume that pruning steps correspond to small vectors in parameter space, we propose to investigate how this locality assumption affects their performance. Moreover, we show that the convergence assumption behind OBD and OBS, which is overlooked and violated in current methods, can be relaxed by maintaining the gradient term in the quadratic model. Finally, to prevent having to compute second order information, we propose to compare diagonal quadratic models to simpler linear models.
|
| 16 |
+
|
| 17 |
+
While our empirical study demonstrates that pruning criteria based on linear and quadratic loss models are good at preserving the training loss, it also shows that this benefit does not necessarily transfer to better networks after fine-tuning, suggesting that preserving the loss might not be the best objective to optimize for. Our contributions can be summarized as follows:
|
| 18 |
+
|
| 19 |
+
1. We present pruning criteria based on both linear and diagonal quadratic models of the loss, and show how they compare at preserving training loss compared to OBD and MP.
|
| 20 |
+
|
| 21 |
+
2. We study two strategies to better enforce locality in the pruning steps, pruning in several stages and regularising the step size, and show how they improve the quality of the criteria. 3. We show that using pruning criteria that are better at preserving the loss does not necessarily transfer to better fine-tuned networks, raising questions about the adequacy of such criteria.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND: UNSTRUCTURED PRUNING
|
| 24 |
+
|
| 25 |
+
# 2.1 UNSTRUCTURED PRUNING PROBLEM FORMULATION
|
| 26 |
+
|
| 27 |
+
For a given architecture, neural networks are a family of functions $f _ { \pmb \theta } : \mathcal { X } \mathcal { Y }$ from an input space $\mathcal { X }$ to an output space $\mathcal { V }$ , where $\pmb \theta \in \mathbb { R } ^ { D }$ is the vector that contains all the parameters of the network. Neural networks are usually trained by seeking parameters $\pmb { \theta }$ that minimize the empirical risk $\begin{array} { r } { \mathcal { L } ( \pmb { \theta } ) = \frac { 1 } { N } \sum _ { i } \ell \left( f _ { \pmb { \theta } } \left( x _ { i } \right) , t _ { i } \right) } \end{array}$ of a loss function $\ell$ on a training dataset $\mathcal { D } = \{ ( x _ { i } , t _ { i } ) \} _ { 1 \leq i \leq N } ^ { - }$ composed of $N$ (example, target) pairs.
|
| 28 |
+
|
| 29 |
+
The goal of unstructured pruning is to find a step $\Delta \theta$ to add to the current parameters $\pmb { \theta }$ such that $\lVert \pmb { \theta } + \bar { \Delta } \pmb { \theta } \rVert _ { 0 } = ( 1 - \kappa ) D$ , i.e. the parameter vector after pruning is of desired sparsity $\kappa \in [ 0 , 1 ]$ . While doing so, the performance of the pruned network should be maintained, so $\mathcal { L } ( \pmb { \theta } + \Delta \pmb { \theta } )$ should not differ much from $\mathcal { L } ( \pmb { \theta } )$ . Unstructured pruning thus amounts to the following minimization problem:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\begin{array} { r l } { \underset { \mathbf { \sigma } \times \mathbf { \sigma } } { \mathrm { m i n i m i z e } } } & { { } \Delta \mathcal { L } ( \theta , \Delta \theta ) \overset { \mathrm { d e f } } { = } | \mathcal { L } ( \theta + \Delta \theta ) - \mathcal { L } ( \theta ) | \qquad \mathrm { s . t . } \quad \| \theta + \Delta \theta \| _ { 0 } = ( 1 - \kappa ) D } \end{array}
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Directly solving this problem would require evaluating $\mathcal { L } ( \pmb { \theta } + \Delta \pmb { \theta } )$ for all possible values of $\Delta \theta$ , which is prohibitively expensive, so one needs to rely on heuristics to find good solutions.
|
| 36 |
+
|
| 37 |
+
# 2.2 OPTIMAL BRAIN DAMAGE CRITERION
|
| 38 |
+
|
| 39 |
+
Optimal Brain Damage (OBD) (LeCun et al., 1990) proposes to use a quadratic modelling of $\mathcal { L } ( \pmb { \theta } + \Delta \pmb { \theta } )$ , leading to the following approximation of $\bar { \Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } ) }$ :
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\Delta \mathcal { L } ^ { Q M } ( \pmb { \theta } , \Delta \pmb { \theta } ) = \left| \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } } ^ { \top } \Delta \pmb { \theta } + \frac { 1 } { 2 } \Delta \pmb { \theta } ^ { \top } \mathbf { H } ( \pmb { \theta } ) \Delta \pmb { \theta } \right|
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathbf { H } ( \pmb \theta )$ is the Hessian of $\mathcal { L } ( \pmb \theta )$ . $\mathbf { H } ( \pmb \theta )$ being intractable, even for small-scale networks, its Generalized Gauss-Newton approximation $\mathbf { G } ( \pmb { \theta } )$ (Schraudolph, 2002) is used in practice, as detailed in Appendix A.1 Then, two more approximations are made: first, it assumes the training of the network has converged, thus the gradient of the loss wrt $\pmb \theta$ is $0$ , which makes the linear term vanish. Then, it neglects the interactions between parameters, which corresponds to a diagonal approximation of $\mathbf { G } ( \pmb { \theta } )$ , leading to the following model:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\Delta \mathcal { L } ^ { O B D } ( \pmb { \theta } , \Delta \pmb { \theta } _ { k } ) \approx \frac { 1 } { 2 } \mathbf { G } _ { k k } ( \pmb { \theta } ) \Delta \pmb { \theta } _ { k } ^ { 2 } \qquad \Rightarrow \qquad s _ { k } ^ { \mathrm { O B D } } = \frac { 1 } { 2 } \mathbf { G } _ { k k } ( \pmb { \theta } ) \pmb { \theta } _ { k } ^ { 2 }
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
$s _ { k } ^ { \mathrm { O B D } }$ is the saliuned, so if parameter, estimating how much the loss will change if that parameter. Parameters can thus be ranked by order of importance, and the ones $\Delta \theta _ { k } = - \theta _ { k }$ with the smallest saliencies (i.e. the least influence on the loss) are pruned, while the ones with the biggest saliencies are kept unchanged. This can be interpreted as finding and applying a binary mask $\mathbf { m } \in \{ 0 , 1 \} ^ { D }$ to the parameters such that $\pmb { \theta } + \Delta \pmb { \theta } = \pmb { \theta } \odot \mathbf { m }$ , where $\odot$ is the element-wise product.
|
| 52 |
+
|
| 53 |
+
# 2.3 MAGNITUDE PRUNING CRITERION
|
| 54 |
+
|
| 55 |
+
Magnitude Pruning (MP) (Han et al., 2015), is a popular pruning criterion in which the saliency is simply based on the norm of the parameter:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
s _ { k } ^ { \mathrm { M P } } = \pmb { \theta } _ { k } ^ { 2 }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Despite its simplicity, MP works extremely well in practice (Gale et al., 2019), and is used in current state-of-the-art methods (Renda et al., 2020). We use global MP as baseline in all our experiments.
|
| 62 |
+
|
| 63 |
+
# 2.4 OPTIMAL BRAIN SURGEON
|
| 64 |
+
|
| 65 |
+
Optimal Brain Surgeon (OBS) (Hassibi & Stork, 1993) also relies on the quadratic model in Equation 2 to solve the minimization problem given in Equation 1, but uses the Lagrangian formulation to include the constraint to the solution of the minimization problem. Since OBS requires to compute the inverse of $\mathbf { H } ( \pmb \theta )$ , several approximations have been explored in the literature, including diagonal, as in the original OBS, Kronecker-factored (Martens & Grosse, 2015) as in ML-Prune (Zeng & Urtasun, 2019), or diagonal, but in an Kronecker-factored Eigenbasis (George et al., 2018), as in EigenDamage (Wang et al., 2019). While we use OBD in our demonstrations and experimental setup, everything presented in this paper can also be used in OBS-based methods. We leave that for future work.
|
| 66 |
+
|
| 67 |
+
# 3 REVISITING LOSS MODELLING FOR UNSTRUCTURED PRUNING
|
| 68 |
+
|
| 69 |
+
In this work, we investigate linear and diagonal quadratic models of the loss function and their performance when used for pruning neural networks. In our empirical study, we aim at answering the following questions:
|
| 70 |
+
|
| 71 |
+
1. How do criteria based on weight magnitude, or linear or quadratic models compare at preserving training loss (i.e. at solving the minimization problem in Equation 1)? 2. How does the locality assumption behind criteria based on linear and quadratic models affect their performances? 3. Do pruning criteria that are better at preserving the loss lead to better fine-tuned networks?
|
| 72 |
+
|
| 73 |
+
We now describe the linear and quadratic models we use, as well as the strategies to enforce locality of the pruning steps.
|
| 74 |
+
|
| 75 |
+
# 3.1 LINEAR AND QUADRATIC MODELS
|
| 76 |
+
|
| 77 |
+
In current training strategies, regularization techniques such as early stopping or dropout (Srivastava et al., 2014) are often used to counteract overfitting. In these setups, there is no reason to assume that the training has converged, implying that the linear term in the Taylor expansion should not be neglected. Thus, one can build a pruning criterion similar to OBD that includes the gradient term in the quadratic model from Equation 2, leading to the following saliencies:2
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\Delta \mathcal { L } ^ { Q M } ( \pmb { \theta } , \Delta \pmb { \theta } _ { k } ) \approx \left| \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } _ { k } } ^ { \top } \Delta \pmb { \theta } _ { k } + \frac { 1 } { 2 } \mathbf { G } _ { k k } ( \pmb { \theta } ) \Delta \pmb { \theta } _ { k } ^ { 2 } \right| \Rightarrow s _ { k } ^ { \mathrm { Q M } } = \left| - \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } _ { k } } \pmb { \theta } _ { k } + \frac { 1 } { 2 } \mathbf { G } _ { k k } ( \pmb { \theta } ) \pmb { \theta } _ { k } ^ { 2 } \right|
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Recall the constraint $\Delta \theta _ { k } \in \{ - \theta _ { k } , 0 \}$ , hence the saliencies. This criterion generalizes OBD for networks that are not at convergence, and provides similar saliencies for networks that have converged.
|
| 84 |
+
|
| 85 |
+
To avoid the computational cost associated with computing second order information, which is prohibitive for large scale neural networks, one can use a simpler linear model (LM) instead of a quadratic one to approximate $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ , leading to the following approximation and saliencies:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\Delta \mathcal { L } ^ { L M } ( \pmb { \theta } , \Delta \pmb { \theta } ) = \left| \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } } ^ { \top } \Delta \pmb { \theta } \right| \quad \Rightarrow \quad s _ { k } ^ { \mathrm { L M } } = \left| \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } _ { k } } \pmb { \theta } _ { k } \right|
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
The saliencies of the linear model are very related to the criterion used in Single-shot Network Pruning (Lee et al., 2019b), as demonstrated by Wang et al. (2020).
|
| 92 |
+
|
| 93 |
+
# 3.2 ENFORCING LOCALITY
|
| 94 |
+
|
| 95 |
+
One important point to keep in mind is that linear and quadratic models (whether diagonal or not) are local approximations, and are generally only faithful in a small neighbourhood of the current parameters. Explicitly showing the terms that are neglected, we have:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } ) = \Delta \mathcal { L } ^ { L M } ( \pmb { \theta } , \Delta \pmb { \theta } ) + \mathcal { O } ( \| \Delta \pmb { \theta } \| _ { 2 } ^ { 2 } ) = \Delta \mathcal { L } ^ { Q M } ( \pmb { \theta } , \Delta \pmb { \theta } ) + \mathcal { O } ( \| \Delta \pmb { \theta } \| _ { 2 } ^ { 3 } )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
So when approximating $\Delta \mathcal { L }$ with $\Delta \mathcal { L } ^ { L M }$ we neglect the terms in $\mathcal { O } ( \| \Delta \theta \| _ { 2 } ^ { 2 } )$ , and when approximating $\Delta \mathcal { L }$ with $\Delta \mathcal { L } ^ { Q M }$ we neglect the terms in $\mathcal { O } ( \bar { \| } \Delta \theta \| _ { 2 } ^ { 3 } )$ . Both approximations are thus only valid in a small neighbourhood of $\pmb \theta$ , and are extremely likely to be wrong when $\| \Delta \pmb { \theta } \| _ { 2 }$ is large. We list here different tricks to prevent this from happening.
|
| 102 |
+
|
| 103 |
+
Performing the Pruning in several Stages $\| \Delta \pmb { \theta } \| _ { 2 }$ can be large when a large portion of the parameters is pruned at once. An easy fix typically used to mitigate this issue is to perform the pruning in several stages, re-estimating the model at each stage. The number of stages, which we denote by $\pi$ , is typically overlooked (e.g. both Zeng & Urtasun (2019) and Wang et al. (2019) use only 6 stages of pruning). Our experiments, in upcoming Section 5, show that it has a drastic impact on the performances. Note that, without fine-tuning phases between the different pruning stages, this strategy violates the convergence assumption behind OBD and OBS, since after the first stage of pruning the network is no more at convergence.
|
| 104 |
+
|
| 105 |
+
The sparsity at each stage can be increased following either a linear schedule, where each step prunes the same number of parameter, or an exponential schedule, where the number of parameters pruned at each stage gets smaller and smaller. The later is typically used in the literature (Zeng & Urtasun, 2019; Wang et al., 2019; Frankle & Carbin, 2018; Renda et al., 2020). We compare them in Section 5.
|
| 106 |
+
|
| 107 |
+
Constraining the Step Size As is often done when using quadratic models (e.g. Nocedal & Wright (2006)), one can penalize the model when it decides to take steps that are too large, in order to stay in a region where we can trust the model. This can be done by simply adding the norm penalty $\frac { \lambda } { 2 } \left\| \pmb { \theta } _ { k } \right\| _ { 2 } ^ { 2 }$ to the saliencies computed by any criterion (Equations 3, 5 or 6), where $\lambda$ is a hyper-parameter that controls the strength of the constraint: a small value of $\lambda$ leaves the saliencies unchanged, and a large value of $\lambda$ transforms the pruning criterion into MP (Equation 4).
|
| 108 |
+
|
| 109 |
+
Other Considerations $\| \Delta \pmb { \theta } \| _ { 2 }$ can be large if $\pmb { \theta }$ is large itself. This is dependent on the training procedure of the network, but can be easily mitigated by constraining the norm of the weights, which can be done using $L _ { 2 }$ regularisation or weight decay. Since nowadays weight decay is almost systematically used by default when training networks (e.g. He et al. (2016b); Xie et al. (2017); Devlin et al. (2018)), we do not investigate this further.
|
| 110 |
+
|
| 111 |
+
# 4 METHODOLOGY
|
| 112 |
+
|
| 113 |
+
We follow the main recommendations from Blalock et al. (2020). For fair comparison between criteria, all experiments are from our own PyTorch (Paszke et al., 2017) re-implementation, and ran on V100 GPUs.We use 5 different random seeds, and both mean and standard deviations are reported. We experiment with a MLP on MNIST, and with both VGG11 (Simonyan & Zisserman, 2014) and a pre-activation residual network 18 (He et al., 2016b) on CIFAR10 (Krizhevsky et al., 2009), to have variability in architectures, while using networks with good performance to number of parameters ratio. We further validate our findings on ImageNet (Deng et al., 2009) using a residual network 50 (He et al., 2016a). Although MNIST is not considered a good benchmark for pruning (Blalock et al., 2020), it can still be used to compare the ability of different criteria to solve the minimization problem in Equation 1. See Appendix B for details about splits, data augmentation and hyper-parameters.
|
| 114 |
+
|
| 115 |
+
Pruning Framework Algorithm 1 presents the pruning framework used in this work: we first train the network, then perform several stages of pruning, and finally perform a single phase of fine-tuning, using the same hyper-parameters as for the original training. Global pruning is used for all the criteria. Note that because of their convergence assumption, OBD and OBS advocate for fine-tuning after each stage of pruning. Since LM and QM are not based on this assumption, they should perform well in this proposed framework. While the fine tuning-phase would require hyper-parameters optimisation, Renda et al. (2020) showed that using the same ones as for the original training usually leads to good results. The hyper-parameters used in our experiments are provided in Appendix B.
|
| 116 |
+
|
| 117 |
+
Performance Metrics The performances of the pruning criteria are measured using two metrics: First, we use $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } ) = \bar { | \mathcal { L } ( \pmb { \theta } + \Delta \pmb { \theta } ) - \mathcal { L } ( \pmb { \theta } ) | }$ , which is the quantity that the pruning criteria
|
| 118 |
+
|
| 119 |
+
# Algorithm 1 Pruning Framework
|
| 120 |
+
|
| 121 |
+
Require: Network $f _ { \theta }$ with $\pmb \theta \in \mathbb { R } ^ { D }$ , dataset $\mathcal { D }$ , number of pruning iterations $\pi$ , and sparsity $\kappa$ .
|
| 122 |
+
1: fθ ← Training(fθ, D)
|
| 123 |
+
2: $\kappa _ { 0 } \gets 0$
|
| 124 |
+
3: m ← 1 D
|
| 125 |
+
4: for 5: κi ← κi−1 + (κ−κ0) or $i = 1$ to $\pi$ do $\kappa _ { i } \gets \kappa _ { i - 1 } + ( \kappa - \kappa _ { 0 } ) ^ { i / \pi }$ . Compute sparsity for iteration $i$
|
| 126 |
+
6: s ← Saliencies(fθm, D) $\triangleright$ Compute saliencies (Equation 3, 4, 5 or 6).
|
| 127 |
+
7: m[argsort(s)[: κiD]] ← 0 . Mask the parameters with smallest saliencies.
|
| 128 |
+
8: $f _ { \pmb { \theta } ( \odot \mathbf { m } } \gets \mathrm { T r a i n i n g } ( f _ { \pmb { \theta } ( \odot \mathbf { m } ) } \mathcal { D } )$ . Optional fine-tuning
|
| 129 |
+
9: return fθm, m
|
| 130 |
+
|
| 131 |
+
are designed to minimize (recall Equation 1). Second, we use the validation error gap before/after fine-tuning, which is the metric we ultimately care about when designing pruning methods.
|
| 132 |
+
|
| 133 |
+
# 5 PERFORMANCES BEFORE FINE-TUNING
|
| 134 |
+
|
| 135 |
+
We evaluate the impact of enforcing locality in the LM, QM and OBS criteria. For each criterion, Figure 1 reports $\bar { \Delta \mathcal { L } } ( \theta , \Delta \theta )$ as a function of $\lambda$ , for different number of pruning stages $\pi$ , using the exponential pruning schedule, and Figure 5 in Appendix show the same results for the linear pruning schedule. A typical usage of these criteria would be with a regularisation strength $\lambda = 0$ and a number of pruning stages $\pi \approx 1$ . MP, the baseline, which is invariant to both $\lambda$ and $\pi$ , is also reported in dashed black. For reference, the networks reached a validation error rate before pruning of $1 . 4 7 \pm 0 . 0 4 \%$ for the MLP, $1 0 . 1 6 \pm 0 . 2 9 \%$ for VGG11 and $4 . 8 7 \pm 0 . 0 4 \%$ for the PreActResNet18.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 1: $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ for different number of pruning stages $\pi$ , as a function of $\lambda$ , the step size constraint strength, using either (left) LM, (middle) QM or (right) OBD criteria. MP, which is invariant to $\lambda$ and to the number of pruning stages, is displayed in dashed black. The curves are the mean and the error bars the standard deviation over 5 random seeds. OBD with $\pi = 1$ and $\lambda = 0$ diverged for all of the 5 seeds. Increasing the number of pruning stages drastically reduces $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . A $\lambda > 0$ can also help improving performances. Figure 6 in Appendix contains the same plots, but displaying the validation gap before/after pruning.
|
| 139 |
+
|
| 140 |
+
# 5.1 IMPACT OF THE ASSUMPTIONS BEHIND THE DIFFERENT CRITERIA
|
| 141 |
+
|
| 142 |
+
Locality Assumption Figure 1 shows that increasing the number of pruning stages can drastically reduce $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ when using LM, QM and OBS criteria. It demonstrates the importance of applying local steps when pruning. Constraining the steps size through ${ \frac { \lambda } { 2 } } \left\| \pmb { \theta } _ { k } \right\| _ { 2 } ^ { 2 }$ can also reduce $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ , on CIFAR10 in particular. The trend, however, is less pronounced on MNIST. We hypothesize that it is due to the pruning step size: the MLP contains $2 6 0 \mathrm { k }$ parameters, vs 9.7M for VGG11, so the number of parameters pruned at each stage in VGG11 is still large, even with $\pi = 1 4 0$ . This translates to a bigger $\| \Delta \pmb { \theta } \| _ { 2 }$ that needs to be controlled by the regularisation constraint.
|
| 143 |
+
|
| 144 |
+
Convergence Assumption When performing the pruning in several stages, we also observe that LM and QM can reach better performances than OBD. Without retraining phases between pruning stages, we violate the convergence assumption of OBD. This is however not the case for LM and QM, since they are not based on this assumption. Note that OBD still works reasonably well on VGG11. This could be be related to the depth of VGG11: VGG11 is deeper than the MLP, but not equipped with residual connections like the PreActResNet18.
|
| 145 |
+
|
| 146 |
+
# 5.2 LOSS-PRESERVATION CAPABILITIES OF THE DIFFERENT CRITERIA
|
| 147 |
+
|
| 148 |
+
Table 1 contains the best $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ for each of the networks and pruning criteria. Our main observation is that the criteria that model the loss (LM and QM in particular) are better at preserving the loss than MP. Similarly to Table 1, Table 3 in Appendix contains the best validation error gap before/after pruning, where we can observe similar tendencies.
|
| 149 |
+
|
| 150 |
+
Table 1: Summary of the best $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ across values of $\lambda$ for different networks and pruning criteria, with $\pi = 1 4 0$ . QM achieves better loss-preservation than other criteria. OBD performs worse than QM, since we violate its convergence assumption when pruning in several stages.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan="3">Network</td><td colspan="4">△C(0,△0)</td></tr><tr><td>MP</td><td>OBD</td><td>LM</td><td>QM</td></tr><tr><td>MLP on MNIST</td><td>2.02 ± 0.10</td><td>1.83 ± 0.11</td><td>1.17 ± 0.03</td><td>1.05 ± 0.04</td></tr><tr><td>VGG11 on CIFAR10</td><td>1.84 ± 0.44</td><td>0.89 ± 0.24</td><td>0.90 ± 0.21</td><td>0.86 ± 0.22</td></tr><tr><td>PreActResNet18 on CIFAR10</td><td>2.23 ± 0.14</td><td>1.95 ± 0.46</td><td>1.36 ± 0.18</td><td>1.22 ± 0.31</td></tr></table>
|
| 153 |
+
|
| 154 |
+
# 5.3 LINEAR VS EXPONENTIAL PRUNING SCHEDULE
|
| 155 |
+
|
| 156 |
+
Figure 2 compares the impact of $\| \Delta \pmb { \theta } \| _ { 2 }$ and reports the training error gap when pruning VGG11 on CIFAR10 in several stages, using either the linear or the exponential pruning schedule. We also compare against one-shot pruning, as reference. The exponential schedule allows to maintain a more constant $\bar { \| \Delta \pmb { \theta } \| _ { 2 } }$ throughout the pruning procedure, which limits the maximum size of $\| \Delta \pmb { \theta } \| _ { 2 }$ , and thus better satisfies the locality assumption.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 2: Linear vs exponential schedule using QM on VGG11. Left: $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ vs sparsity, zoomed on the end. Markers denote the 14 pruning stages. Middle: $\| \Delta \pmb { \theta } \| _ { 2 }$ at each stage. Right: Same as Figure 1, but comparing exponential (solid) and linear (dotted) schedules at $9 5 . 6 \%$ sparsity, with $\pi \in \{ 1 4 , 1 4 0 \}$ . We get smaller $\| \Delta \pmb { \theta } \| _ { 2 }$ per pruning stage when using exponential instead of linear schedule, resulting in a smaller $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . It is advantageous to use that schedule when the pruning budged is limited, i.e. when $\pi$ is small. This advantage vanishes for larger values of $\pi$ .
|
| 160 |
+
|
| 161 |
+
# 6 PERFORMANCES AFTER FINE-TUNING
|
| 162 |
+
|
| 163 |
+
We now fine-tune the pruned networks using the same hyper-parameters and number of epochs than for the original training. Table 2 shows the validation error gap between the non-pruned networks and the pruned networks after fine-tuning, for all considered criteria. LM performs better than MP on both the MLP and VGG11 ( $0 . 5 \%$ difference), but all criteria perform similarly on the PreActResNet18. These results are consistent with the observations of Blalock et al. (2020). As reference, global random pruning resulted in validation error rate of $4 7 . 1 8 \pm 6 . 8 \%$ for the MLP, and resulted in non-retrainable networks on CIFAR10 (with $90 \%$ error rate).
|
| 164 |
+
|
| 165 |
+
Table 2: Best validation error gap of the fine-tuned networks (lower is better), for different pruning criteria, across values of $\lambda$ and $\pi$ . LM is better than MP on the MLP and VGG11. All the methods reach similar levels of performance on the PreActResNet18.
|
| 166 |
+
6.1 CORRELATION BETWEEN LOSS-PRESERVATION AND PERFORMANCES AFTER FINE-TUNING
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Network</td><td colspan="4">Gap of Validation Error (%)</td></tr><tr><td>MP</td><td>OBD</td><td>LM</td><td>QM</td></tr><tr><td>MLP on MNIST</td><td>2.4± 0.3</td><td>2.0 ± 0.1</td><td>1.9 ± 0.3</td><td>1.9 ± 0.2</td></tr><tr><td>VGG11 on CIFAR10</td><td>0.2 ± 0.2</td><td>-0.1 ± 0.2</td><td>-0.3 ± 0.1</td><td>-0.1 ± 0.1</td></tr><tr><td>PreActResNet18 on CIFAR10</td><td>0.2± 0.2</td><td>0.2± 0.2</td><td>0.1 ± 0.1</td><td>0.2±0.2</td></tr></table>
|
| 169 |
+
|
| 170 |
+
An important observation is that the hyper-parameters $\lambda$ and $\pi$ that give the best performing criteria in terms of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ in Table 1 are not the same as the ones that give the best performing criteria after fine-tuning in Table 2. We display in Figure 3 scatter plots of all the experiments we ran, to observe how well loss-preservation correlates with performance after fine-tuning.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 3: Gap of validation error after fine-tuning as a function of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . Each point is one experiment, i.e. one one random seed, one $\pi$ and one $\lambda$ . $\rho$ is the Spearman’s rank correlation coefficient computed on all the data points. Except for the MLP on MNIST, there is only a weak correlation between $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ and the gap of validation after fine-tuning. Thus, the performance after pruning cannot be explained solely by the loss-preserving abilities of the pruning criteria.
|
| 174 |
+
|
| 175 |
+
Quite surprisingly, although we are able to obtain networks with smaller $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ , and thus better performing networks right after pruning, the performances after fine-tuning do not correlate significantly with the gap. Except for the MLP on MNIST, whose Spearman’s rank correlation coefficient is $\rho = 0 . 6 7$ , there is only a weak correlation between $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ and the validation error gap after fine-tuning $\mathrm { \Delta \rho = 0 . 2 7 }$ for VGG11 and $\rho = 0 . 2 0$ for PreActResNet18). Figure 10 in Appendix contains the same scatter plots, but showing $\mathcal { L } ( \pmb { \theta } \odot \mathbf { m } )$ after fine-tuning instead of the validation error gap, and similar trends can be observed. Figure 11, also in Appendix, shows similar scatter plots, but for different sparsity levels on VGG11. Finally, Figure 9 in Appendix contains the same scatter plots but displaying the validation error gap before fine-tuning versus the validation error gap before fine-tuning.
|
| 176 |
+
|
| 177 |
+
To verify that these observations are not due to a specific choice of fine-tuning hyper-parameters, we perform a hyper-parameter grid search and report similar results in Appendix C.2. Also, we show in Figure 15 in Appendix C.3 the fine-tuning curves of networks pruned using MP and our best QM criteria. We observe that, except for MNIST, the difference in training loss right after pruning disappears after only one epoch of fine-tuning, erasing the advantage of QM over MP.
|
| 178 |
+
|
| 179 |
+
# 6.2 DISCUSSION
|
| 180 |
+
|
| 181 |
+
These results highlight an important issue: minimizing $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ , no matter what model is used, might be used to design better pruning criteria, but it does not necessarily transfer to a better pruning method when fine-tuning is involved. The performance after fine-tuning cannot be explained solely by the local loss-preserving abilities of the criteria, and other mechanisms might be at play. Thus, the effect of fine-tuning should also be taken into account when designing pruning criteria.
|
| 182 |
+
|
| 183 |
+
For instance, Lee et al. (2019a) and Wang et al. (2020) proposed different heuristics to take into account gradient propagation in the context of foresight pruning, i.e. pruning untrained networks right after initialisation. Wang et al. (2020) argues that minimizing $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ in that context makes little sense, since the network is producing random predictions. In Appendix C.4 we compare our results to two pruning methods based on preserving the gradient flow, GraSP (Wang et al., 2020) and SynFlow (Tanaka et al., 2020), and show that they comply with our observations above.
|
| 184 |
+
|
| 185 |
+
Finally, several recent articles are looking further into the impact of various pruning criteria on subsequent training or fine-tuning (Lubana & Dick, 2020; Evci et al., 2020; Frankle et al., 2020).
|
| 186 |
+
|
| 187 |
+
# 7 SCALING UP TO IMAGENET
|
| 188 |
+
|
| 189 |
+
To investigate whether our observations also hold on larger datasets, we perform similar experiments with LM, QM and OBD on the ResNet50 on ImageNet. Before pruning, the network reached $7 6 . 4 1 \%$ validation accuracy. Figure 4 presents results at $70 \%$ sparsity, in a similar fashion as Figure 1 and Figure 3. We observe a similar trend: The best loss-preserving models are not necessarily the best models after fine-tuning. See Appendix B for the detailed experimental setting, and see Figure 17 for results at $90 \%$ sparsity.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 4: Same as Figure 1 and Figure 3, for the ResNet50 on ImageNet, with a sparsity of $70 \%$ . Increasing the number of pruning stages and constraining the step size reduce $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . However, the best-loss preserving criteria, which maximize the validation accuracy right after pruning, do not produce better networks after fine-tuning. They perform similarly if their validation accuracy after pruning is $> 2 0 \%$ . Criteria that outperform MP right after pruning do not achieve better performance after fine-tuning.
|
| 193 |
+
|
| 194 |
+
# 8 CONCLUSION
|
| 195 |
+
|
| 196 |
+
In this paper, we revisited loss modelling for unstructured pruning. We showed that keeping the gradient term in the diagonal quadratic model allows to relax the convergence assumption behind
|
| 197 |
+
|
| 198 |
+
OBS and OBD. We also showed the importance of locality when using loss models for pruning: increasing the number of pruning stages and constraining the step size are two improvements that produce better loss-preserving pruning criteria and that should be added to the recommendation list of Blalock et al. (2020). Finally we observed that the loss right after pruning does not always correlate with the performances after fine-tuning, suggesting that a better loss before fine-tuning is not solely responsible for the performances after fine-tuning. Thus, future research should focus on ways to model the actual effect of subsequent fine-tuning when designing pruning criteria.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Davis Blalock, Jose Javier Gonzalez Ortiz, Jonathan Frankle, and John Guttag. What is the state of neural network pruning? arXiv preprint arXiv:2003.03033, 2020.
|
| 203 |
+
|
| 204 |
+
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. Ieee, 2009.
|
| 205 |
+
|
| 206 |
+
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.
|
| 207 |
+
|
| 208 |
+
Xiaohan Ding, Xiangxin Zhou, Yuchen Guo, Jungong Han, Ji Liu, et al. Global sparse momentum sgd for pruning very deep neural networks. In NeurIPS, 2019.
|
| 209 |
+
|
| 210 |
+
Utku Evci, Yani A Ioannou, Cem Keskin, and Yann Dauphin. Gradient flow in sparse neural networks and how lottery tickets win. arXiv preprint arXiv:2010.03533, 2020.
|
| 211 |
+
|
| 212 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR, 2018.
|
| 213 |
+
|
| 214 |
+
Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. Pruning neural networks at initialization: Why are we missing the mark? arXiv preprint arXiv:2009.08576, 2020.
|
| 215 |
+
|
| 216 |
+
Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
|
| 217 |
+
|
| 218 |
+
Thomas George, César Laurent, Xavier Bouthillier, Nicolas Ballas, and Pascal Vincent. Fast approximate natural gradient descent in a kronecker factored eigenbasis. In NIPS, 2018.
|
| 219 |
+
|
| 220 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010.
|
| 221 |
+
|
| 222 |
+
Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 223 |
+
|
| 224 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NIPS. 2015.
|
| 225 |
+
|
| 226 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In NIPS, 1993.
|
| 227 |
+
|
| 228 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015.
|
| 229 |
+
|
| 230 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
|
| 231 |
+
|
| 232 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
|
| 233 |
+
|
| 234 |
+
Tom Heskes. On “natural” learning and pruning in multilayered perceptrons. Neural Computation, 2000.
|
| 235 |
+
|
| 236 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. URL http://proceedings.mlr.press/ v37/ioffe15.html.
|
| 237 |
+
|
| 238 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 239 |
+
|
| 240 |
+
Yann LeCun. Who is afraid of convex optimization? NIPS - Workshop on Efficient Learning, 2007. URL https://cs.nyu.edu/\~yann/talks/lecun-20071207-nonconvex.pdf.
|
| 241 |
+
|
| 242 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In NIPS, 1990.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Namhoon Lee, Thalaiyasingam Ajanthan, Stephen Gould, and Philip HS Torr. A signal propagation perspective for pruning neural networks at initialization. arXiv preprint arXiv:1906.06307, 2019a.
|
| 247 |
+
|
| 248 |
+
Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. SNIP: Single-Shot Network Pruning based on Connection Sensitivity. In ICLR, 2019b. URL https://openreview.net/forum?id $=$ B1VZqjAcYX.
|
| 249 |
+
|
| 250 |
+
Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through l_0 regularization. arXiv preprint arXiv:1712.01312, 2017.
|
| 251 |
+
|
| 252 |
+
Ekdeep Singh Lubana and Robert P. Dick. A gradient flow framework for analyzing network pruning, 2020.
|
| 253 |
+
|
| 254 |
+
James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In ICML, 2015.
|
| 255 |
+
|
| 256 |
+
Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In ICML, 2017.
|
| 257 |
+
|
| 258 |
+
Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 259 |
+
|
| 260 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 261 |
+
|
| 262 |
+
Jorge Nocedal and Stephen Wright. Numerical optimization. Springer Science & Business Media, 2006.
|
| 263 |
+
|
| 264 |
+
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.
|
| 265 |
+
|
| 266 |
+
Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning. In ICLR, 2020. URL https://openreview.net/forum?id= S1gSj0NKvB.
|
| 267 |
+
|
| 268 |
+
Nicol N Schraudolph. Fast curvature matrix-vector products for second-order gradient descent. Neural computation, 2002.
|
| 269 |
+
|
| 270 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 271 |
+
|
| 272 |
+
Sidak Pal Singh and Dan Alistarh. Woodfisher: Efficient second-order approximations for model compression. arXiv preprint arXiv:2004.14340, 2020.
|
| 273 |
+
|
| 274 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 2014.
|
| 275 |
+
|
| 276 |
+
Hidenori Tanaka, Daniel Kunin, Daniel LK Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. arXiv preprint arXiv:2006.05467, 2020.
|
| 277 |
+
|
| 278 |
+
Chaoqi Wang, Roger Grosse, Sanja Fidler, and Guodong Zhang. Eigendamage: Structured pruning in the kronecker-factored eigenbasis. arXiv preprint arXiv:1905.05934, 2019.
|
| 279 |
+
|
| 280 |
+
Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. In ICLR, 2020. URL https://openreview.net/forum?id $=$ SkgsACVKPH.
|
| 281 |
+
|
| 282 |
+
Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017.
|
| 283 |
+
|
| 284 |
+
Wenyuan Zeng and Raquel Urtasun. MLPrune: Multi-layer pruning for automated neural network compression, 2019. URL https://openreview.net/forum?id $\equiv$ r1g5b2RcKm.
|
| 285 |
+
|
| 286 |
+
# APPENDIX
|
| 287 |
+
|
| 288 |
+
# A GENERALIZED GAUSS-NEWTON
|
| 289 |
+
|
| 290 |
+
Having to compute $\mathbf { H } ( \pmb \theta )$ is an obvious drawback of quadratic models, and thus a common first step is to approximate $\mathbf { H } ( \pmb \theta )$ using the Generalized Gauss-Newton approximation (Schraudolph, 2002):
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { r l } & { \mathbf { H } ( \theta ) = \underbrace { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { \partial f _ { \theta } \left( x _ { i } \right) ^ { \top } } { \partial \theta } \nabla _ { u = f _ { \theta } \left( x _ { i } \right) } ^ { 2 } \ell \left( u , t _ { i } \right) \frac { \partial f _ { \theta } \left( x _ { i } \right) } { \partial \theta } } _ { \mathbf { G } ( \theta ) , \mathrm { t h e G e n e r a l i z e d ~ G a u s . N e w i o n } } + \underbrace { \sum _ { k } ^ { K } \frac { \partial \ell \left( u , t _ { i } \right) } { \partial u _ { k } } \Big | _ { u = f _ { \theta } \left( x _ { i } \right) } \frac { \partial ^ { 2 } f _ { \theta } \left( x _ { i } \right) _ { k } } { \partial \theta ^ { 2 } } } _ { \approx 0 } } \\ & { \approx \mathbf { G } ( \theta ) } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
where $\mathrm { K }$ is the number of outputs of the network. $\mathbf { G } ( \pmb { \theta } )$ has the advantage of being easier to compute and is also positive semi-definite by construction.
|
| 297 |
+
|
| 298 |
+
# B DETAILS ON THE EXPERIMENTAL SETUP
|
| 299 |
+
|
| 300 |
+
# B.1 SETUP
|
| 301 |
+
|
| 302 |
+
Datasets We use the MNIST dataset (LeCun et al., 1998), and hold-out 10000 examples randomly sampled from the training set for validation. We also use CIFAR10 (Krizhevsky et al., 2009), where the last 5000 examples of the training set are used for validation, and we apply standard data augmentation (random cropping and flipping, as in He et al. (2016b)) during training phases. For ImageNet (Deng et al., 2009), we follow the experimental setting of Goyal et al. (2017).
|
| 303 |
+
|
| 304 |
+
Network Architectures On MNIST, we use a MLP of dimensions 784-300-100-10, with Tanh activation functions. On CIFAR10, we use both: a VGG11 (Simonyan & Zisserman, 2014), equipped with ReLUs (Nair & Hinton, 2010), but no Batch Normalisation (Ioffe & Szegedy, 2015); and the PreActResNet18, which is the 18-layer pre-activation variant of residual networks (He et al., 2016b). MLP leverages Glorot & Bengio (2010) as initialization while the the weights of VGG11 and PreActResNet18 are initialized following He et al. (2015), and the biases are initialized to 0. On ImageNet (Deng et al., 2009), we use a ResNet-50 (He et al., 2016a) with Batch Normalization, and follow the initialization strategy described in (Goyal et al., 2017).
|
| 305 |
+
|
| 306 |
+
# B.2 EXPERIMENTS
|
| 307 |
+
|
| 308 |
+
For the MNIST and CIFAR10 experiments, the network is first trained for a fixed number of epochs, using early stopping on the validation set to select the best performing network.The hyper-parameters used for training are selected via grid search (before even considering pruning). Then we prune a large fraction of the parameters. For OBD, LM and QM, we randomly select, at each iteration of pruning, 1000 examples (10 mini-batches) from the training set to compute the gradients and second order terms of the models.3 Finally, we retrain the network using exactly the same hyper-parameters as for the initial training.
|
| 309 |
+
|
| 310 |
+
For ImageNet, we uses the exact same hyper-parameters than Goyal et al. (2017).
|
| 311 |
+
|
| 312 |
+
MLP on MNIST We train the network for 400 epochs, using SGD with learning rate of 0.01, momentum factor of 0.9, l2 regularisation of 0.0005 and a mini-batch size of 100. We prune $9 8 . 8 5 \%$ of the parameters.
|
| 313 |
+
|
| 314 |
+
VGG11 on CIFAR10 We train the network for 300 epoch, using SGD with a learning rate of 0.01, momentum factor of 0.9, a l2 regularisation of 0.0005 and a mini-batch size of 100. The learning rate is divided by 10 every 60 epochs. We prune $9 5 . 6 \%$ of the parameters.
|
| 315 |
+
|
| 316 |
+
PreActResNet18 on CIFAR10 We train the network for 200 epochs, using SGD with a learning rate of 0.1, momentum factor of 0.9, a l2 regularisation of 0.0005 and a mini-batch size of 100. The learning rate is divided by 10 every 70 epochs. We prune $9 5 . 6 \%$ of the parameters.
|
| 317 |
+
|
| 318 |
+
ResNet50 on ImageNet For ImageNet, we train a ResNet50 using 8 V100 GPUs. The total minibatch size is 256, and we train our baseline network for 90 epochs. The learning rate schedule is identical to Goyal et al. (2017): a linear warm-up in the first 5 epochs and decay by a factor of 10 at epochs 30, 60 and 80. We then prune $70 \%$ of the parameters. After pruning, we fine-tune the models for 90 epochs using a learning rate of $1 e ^ { - 3 }$ . For LM, QM, OBD, we investigates the following hyper-parameter values: $\pi \in \{ 1 , 1 0 0 \}$ $\vert \} , \lambda \in \{ 1 e ^ { - 3 } , 1 e ^ { - 1 } , 0 , 1 0 , \}$ . 1600 examples are used to compute the first and second order terms of the linear and quadratic models.
|
| 319 |
+
|
| 320 |
+
# C SUPPLEMENTARY RESULTS
|
| 321 |
+
|
| 322 |
+
# C.1 PERFORMANCES BEFORE FINE-TUNING
|
| 323 |
+
|
| 324 |
+
Validation error Table Table 3 is the same as Table 1, but containing the best validation error gap before/after pruning instead of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . We can observe a similar trend as in Table 1: LM and QM give better performances than MP, and OBD performs poorly, since the convergence assumption is not respected.
|
| 325 |
+
|
| 326 |
+
Table 3: Best validation error gap before/after pruning for different networks and pruning criteria.
|
| 327 |
+
|
| 328 |
+
<table><tr><td rowspan="3">Network</td><td colspan="4">Gap of Validation Error (%)</td></tr><tr><td>MP</td><td>OBD</td><td>LM</td><td>QM</td></tr><tr><td>MLP onMNIST</td><td>72.09 ± 3.72</td><td>64.89 ± 5.74</td><td>16.35 ± 0.77</td><td>15.22 ± 0.62</td></tr><tr><td>VGG11 on CIFAR10</td><td>56.19 ± 17.9</td><td>18.84 ± 5.54</td><td>5.89 ± 1.52</td><td>5.92 ± 2.14</td></tr><tr><td>PreActResNet18 on CIFAR10</td><td>74.13 ± 4.59</td><td>49.08 ± 8.18</td><td>26.79 ± 8.61</td><td>21.48 ± 5.96</td></tr></table>
|
| 329 |
+
|
| 330 |
+
Linear pruning schedule Figure 5 contains the same experiments than Figure 5, but using the linear schedule instead of the exponential one. There is a drastic difference in performances: One need roughly $1 0 \mathrm { x }$ more stages of pruning with the linear schedule to reach the training gap of the exponential schedule.
|
| 331 |
+
|
| 332 |
+
# C.2 PERFORMANCES AFTER FINE-TUNING
|
| 333 |
+
|
| 334 |
+
Validation error figures Figures 8 and 7 contain the same experiments than Figure 5, but displaying the validation error gap, for linear and exponential schedules, respectively. For completeness, Figure 6 shows the validation error gap before fine-tuning.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 5: Same as Figure 1, but using equally spaced pruning steps. Note the difference in number of pruning iterations.
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 6: Same as Figure 1, but displaying the validation error gap before fine-tuning. With proper number of pruning stages and step size regularization, LM and QM can produce pruned networks that are drastically better than the ones pruned using MP.
|
| 341 |
+
|
| 342 |
+
Validation gap before and after fine-tuning Figure 9 is the same as Figure 3, but showing the validation error gap after fine-tuning as a function of the validation error gap before fine-tuning. As for Figure 3, we do not observe much correlation between the validation error before and after the fine-tuning.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 7: Same as Figure 1, but displaying the validation error gap after fine-tuning.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 8: Same as Figure 7, but using equally spaced pruning steps. Note the difference in number of pruning stages.
|
| 349 |
+
|
| 350 |
+
Training loss after fine-tuning Figure 10 is the same as Figure 3 but showing $\mathcal { L } ( \pmb { \theta } _ { } ( \mathbf { \cdot } ) \mathbf { m } )$ after finetuning as a function of $\Delta \mathcal { L } ( \theta , \Delta \theta )$ . It has a similar trend as Figure 3: there is not much correlation between the loss before and after fine-tuning, except on MNIST.
|
| 351 |
+
|
| 352 |
+
Different sparsity levels Figure 11 shows the performances of different criteria on VGG11 on CIFAR10, for different sparsity levels. When the sparsity is low $( 8 9 . 3 \% )$ , the network has enough capacity to return to its original performances after fine-tuning. When the sparsity is too high $( 9 8 . 6 \% )$ , then all criteria produce networks with random predictions. There might be a sweet spot in between, but one would require more powerful model to verify this supposition.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 9: Same as Figure 3, but showing the validation error gap after fine-tuning as a function of the validation error gap before fine-tuning. Networks with drastically different performance before fine-tuning can still produce similar performances after fine-tuning.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 10: Same as Figure 3, but showing $\mathcal { L } ( \pmb { \theta } \odot \mathbf { m } )$ after fine-tuning as a function of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . Except for the MLP on MNIST, there is only a weak correlation between $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ and $\mathcal { L } ( \pmb { \theta } \odot \mathbf { m } )$ after fine-tuning.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 11: Same as Figure 3, but for different sparsity levels on the VGG11 on CIFAR10. When the sparsity is low, the network has enough capacity to return to its original performances after fine-tuning. When the sparsity is too high, then all criteria produce networks with random predictions.
|
| 362 |
+
|
| 363 |
+
Hyper-parameters optimisation Figure 13 shows the impact of hyper-parameter optimization for the fine-tuning phase. We performed a grid search with three different learning rate (0.1, 0.01, 0.03)
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 12: Same as Figure 11 (left), but zoomed on smaller values of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$
|
| 367 |
+
|
| 368 |
+
and three different l2-regularisation (0, 5e-4, 5e-5). All 9 sets of hyper-parameters were tested on LM, QM and MP on 5 different random seeds. In this set of experiments, we used $\lambda \in \{ 0 , 0 . 0 1 , 0 . 1 , 1 \}$ and $\pi \in \{ 1 4 , 1 4 0 \}$ . Optimizing hyper-parameters for fine-tuning can lead to better performance after fine-tuning, but does not increases the correlation between the performances after fine-tuning and $\Delta \mathcal { L } ( \theta , \Delta \bar { \theta } )$ . The lack of correlation can thus not be explained by bad fine-tuning hyper-parameters.
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
Figure 13: Left: Using the same hyper-parameters for fine-tuning as the ones of the original training. Right: Performing hyper-parameters optimisation for the fine-tuning. This figure shows that optimizing the hyper-parameters for fine-tuning can improve the performances of the network after pruning. However, it reduces the correlation between the performances after fine-tuning and $\Delta \mathcal { L } ( \bar { \theta } , \Delta \theta )$ . The lack of correlation can thus not be explained by poor fine-tuning hyper-parameters.
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
Figure 14: Same as Figure 3, but zooming on the best performing networks in terms of $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$
|
| 375 |
+
|
| 376 |
+
# C.3 FINE-TUNING CURVES
|
| 377 |
+
|
| 378 |
+
To investigate whether one of the networks is suffering from optimization issues during fine-tuning, we show in Figure 15 the fine-tuning curves of networks pruned using MP and our best QM criteria. We observe that, except for MNIST, the difference in training loss right after pruning disappears after only one epoch of fine-tuning, erasing the advantage of QM over MP.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 15: Fine-tuning losses (dotted is training, solid is validation) of networks pruned using MP and QM criteria. All the curves are the average over the 5 seeds. We do not show the standard deviation for clarity. Left: MLP, middle: VGG11 and right: PreActResNet18. Except for MNIST, the difference in loss right after pruning (i.e. at epoch 0) disappears after one epoch of fine-tuning.
|
| 382 |
+
|
| 383 |
+
# C.4 RESULTS USING GRASP AND SYNFLOW
|
| 384 |
+
|
| 385 |
+
We compare our results with two additional pruning methods that focus on preserving the flow of the gradient in the network instead of preserving the loss: GraSP (Wang et al., 2020), a datadependant method, and SynFlow (Tanaka et al., 2020), a data-agnostic one. Both methods were design to be applied at initialisation, so we investigate here their use on trained networks. We use $\pi \in { \bar { \{ 1 , 1 0 0 , 1 0 0 0 \} } }$ , and added our proposed step size constraint $\lambda$ to the pruning criteria as well.
|
| 386 |
+
|
| 387 |
+
Figure 16 shows the scatter plot of the preservation of the loss vs the performance after fine-tuning. Similarly to what we observed before, there is no clear evidence that better preserving the loss lead to better performance after fine-tuning.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 16: Same as Figure 3 showing GraSP and SynFlow on VGG11 (left) and the PreActResnet18 (right). This Figure shows that one can observe a large $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ and yet obtain very good performance after fine-tuning. This is especially true in the case of GraSP for VGG11. Furthermore, we can observe similar behaviour on PreActResNet18 where two different methods can lead to similar performance after fine-tuning while having completely different $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ : GraSP with $\Delta \mathcal { L } ( \pmb { \theta } , \hat { \Delta } \pmb { \theta } ) \approx 1 0 ^ { 8 }$ has fine-tuning performance similar to MP with $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } ) < 1 0 ^ { 1 }$ .
|
| 391 |
+
|
| 392 |
+
# C.5 RESULTS ON IMAGENET
|
| 393 |
+
|
| 394 |
+
Figure 17 is the same as Figure 4, but with $90 \%$ sparsity. At that sparsity level, the validation accuracy right after pruning is close to random for all the pruning criteria. There is however quite a big variation in performances after fine-tuning: at equal performance before fine-tuning, some models achieve $70 \%$ validation accuracy after fine-tuning, while others only reach $60 \%$ .
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 17: Same as Figure 4, but with $90 \%$ sparsity. Increasing the number of pruning stages and constraining the step size reduce $\Delta \mathcal { L } ( \pmb { \theta } , \Delta \pmb { \theta } )$ . However, the best-loss preserving criteria, which maximize the validation accuracy right after pruning, do not produce better networks after fine-tuning.
|
md/train/lMgDDWb1ULW/lMgDDWb1ULW.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Hash Layers For Large Sparse Models
|
| 2 |
+
|
| 3 |
+
# Stephen Roller Sainbayar Sukhbaatar Arthur Szlam Jason Weston
|
| 4 |
+
|
| 5 |
+
Facebook AI Research
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We investigate the training of sparse layers that use different parameters for different inputs based on hashing in large Transformer models. Specifically, we modify the feedforward layer to hash to different sets of weights depending on the current token, over all tokens in the sequence. We show that this procedure either outperforms or is competitive with learning-to-route mixture-of-expert methods such as Switch Transformers and BASE Layers, while requiring no routing parameters or extra terms in the objective function such as a load balancing loss, and no sophisticated assignment algorithm. We study the performance of different hashing techniques, hash sizes and input features, and show that balanced and random hashes focused on the most local features work best, compared to either learning clusters or using longer-range context. We show our approach works well both on large language modeling and dialogue tasks, and on downstream fine-tuning tasks.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Recent studies of Transformer models have shown a clear trend towards improvements with scale in data and model size [1], mirroring the same trend in Machine Learning more generally. However, when architected naively, larger (in terms of parameter count) models are slower to train and to evaluate; and at extreme scale, with current computer systems, necessitate complex engineering to facilitate communication between workers. To address these challenges, researchers have studied Mixtures-of-Experts (MoE) models [2, 3, 4, 5, 6, 7, 8], where a “gater” routes computation through a sparse subset of the weights of the model (the “expert modules”). Specifically in the setting of Transformers for Natural Language Processing (NLP), recent approaches have led to state of the art performance in language modeling [8]. MoE models allow increasing the number of parameters in the model while holding steady the number of computations that affect a given sample.
|
| 14 |
+
|
| 15 |
+
A key component to a MoE model is the routing (gating) strategy. While MoE models can be computationally advantageous per parameter compared to a dense model, they might be functionally less powerful per parameter. A poor routing strategy might lead to expert modules that are not properly specialized (essentially making a stochastic ensemble model); or overly specialized, using the data assignment function to overfit. Meanwhile, the routing strategy itself must be efficient.
|
| 16 |
+
|
| 17 |
+
A standard approach is to train a layer of weights that makes the routing decision based upon the input to the layer to be routed. Classically, this may have been implemented with a softmax over the choice of expert modules, and fitted via backpropagation. However, a dense softmax requires all expert modules to run on all data points at train time, which negates the computational savings. Several works have shown that sparsity can be maintained during training, e.g. [9, 7, 8, 10]. In particular, Switch Transformers [8] select the top expert per token using a softmax over the token’s hidden state, but require a load balancing term in the objective function or they can become imbalanced or degenerate, giving poor results. BASE Layers [10] employ a linear assignment algorithm to try to resolve the same problem.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of the Hash Layer. Tokens are routed to fixed expert modules based on their hash.
|
| 21 |
+
|
| 22 |
+
In this work, we describe a simple, sparse, efficient routing strategy based on hashing input tokens that is effective in the Transformers-for-NLP setting. We show this approach is effective on a number of datasets, comparing favorably to both Switch Transformers and BASE Layers. As the routing strategy requires no extra parameters, no change to the objective function or assignment algorithm, its simplicity means it is robust, fast and easy to implement. We provide detailed analysis to explain why our method works, and in which conditions. Given that when training very large models one may typically have only one shot given the required compute budget, and experimenters will be unable to try many parameter choices, we hence advocate our approach as a strong candidate for such a setting.
|
| 23 |
+
|
| 24 |
+
# 2 Background
|
| 25 |
+
|
| 26 |
+
Let us first introduce the Mixture-of-Experts setting where we apply our hash-based routing strategy. We use the same setting as [11, 8, 10] where a feedforward network (FFN) in a Transformer is replaced by its MoE version. Given a tokenized input sequence $\{ x _ { 1 } , x _ { 2 } , \dots , x _ { T } \}$ of $T$ tokens, a representation for each token is computed in parallel by a standard Transformer [12]
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\mathbf { h } _ { 1 } ^ { L } , \mathbf { h } _ { 2 } ^ { L } , \ldots , \mathbf { h } _ { T } ^ { L } = \mathrm { T R A N S F O R M E R } ( x _ { 1 } , x _ { 2 } , \ldots , x _ { T } ) .
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
The Transformer consists of $L$ layers that computes final hidden states for each token, and each layer is composed of self-attention and FFN sublayers, where FFNs are two-layer fully connected networks
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\bar { \mathbf { h } } _ { t } ^ { l } = \mathrm { S e l f A t t n } ( \mathbf { h } _ { t } ^ { l - 1 } ) \qquad \mathbf { h } _ { t } ^ { l } = \mathrm { F F N } ( \bar { \mathbf { h } } _ { t } ^ { l } ) .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
Here we omit skip-connections and normalization for brevity. We can then replace one or more of the FFN sublayers with expert modules. Replacing the FNN at layer $l$ with $K$ expert FFNs, their output is then mixed with some gating function $g ( \cdot )$ :
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\mathbf h _ { t } ^ { l } = \mathrm { F F N } ( \bar { \mathbf h } _ { t } ^ { l } ) \quad \to \quad \mathbf h _ { t } ^ { l } = \sum _ { i = 1 } ^ { K } g _ { i } ( \bar { \mathbf h } _ { t } ^ { l } ) \mathrm { F F N } _ { i } ( \bar { \mathbf h } _ { t } ^ { l } ) , \quad t = 1 , \dots , T ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where importantly each token is routed to a different mixture of experts, as the gating function depends on the token’s specific hidden state $\bar { \mathbf { h } } _ { t } ^ { l }$ .
|
| 45 |
+
|
| 46 |
+
Sparse MoE methods assume gating values $g _ { i }$ are often zero, so only a few experts need to be computed for better efficiency. As expert FFNs do not share parameters, the number of parameters increases with $K$ while the amount of computations per input token stays the same if the MoE FFN only routes to a single expert, and computation of $g _ { i }$ is cheap. While this allows training of large capacity models with small compute budget, optimizing $g _ { i }$ in the sparse setting can be tricky.
|
| 47 |
+
|
| 48 |
+
# 3 Method
|
| 49 |
+
|
| 50 |
+
In this paper we propose a simple gating mechanism that is especially efficient because only one expert is active, and it has no routing network parameters to be learnt. Recent work [11, 8, 10] has to learn parameters that determine the routing to expert modules based on hidden states, which have to be optimized in tandem with the expert weights themselves. This can potentially cause difficulty because during training membership for each expert is changing while it is trying to learn the mapping for those members. We instead advocate for a fixed mapping to experts. Namely, by hashing the tokens into a fixed number of buckets, each bucket corresponding to an expert:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathbf { h } _ { t } ^ { l } = \mathrm { F F N } _ { \mathrm { h a s h } ( x _ { t } ) } ( \bar { \mathbf { h } } _ { t } ^ { l } ) , \quad t = 1 , \ldots , T .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
While the FFN still takes the hidden state $\bar { \mathbf { h } } _ { t } ^ { l }$ as input, our routing function uses the original input token $x _ { t }$ rather than the hidden state, see Figure 1 for a graphical depiction. We are free to choose from various possible hash functions, which we will consider below. However, for training purposes, the hash function is fixed in advance, and in this way, our routing mechanism requires no training and has no adjustable parameters.
|
| 57 |
+
|
| 58 |
+
# 3.1 Hash Functions
|
| 59 |
+
|
| 60 |
+
Hash functions have long been employed throughout Computer Science [13], and can take a variety of forms. In our work, we generally employ pre-computed hash functions, which use a lookup table during learning – precomputed in advance – to map tokens to expert modules.
|
| 61 |
+
|
| 62 |
+
We consider several kinds of hash functions as possible choices for routing tokens to expert modules. The simplest is Random Hash, wherein we assign every token to a fixed, random expert at initialization. Due to the Zipfian distribution of token frequency, this naturally produces imbalance across the different expert modules. As balancing has been previously shown to be important for training MoE models [8, 10], we also consider Balanced assignment. In this method, we build the lookup table before training the model using the training data distribution by greedily assigning the most frequent tokens to the emptiest buckets. The resulting assignment structure is significantly more balanced than Random Hashing, but not perfect, as the frequency of some tokens exceeds the ideal distribution.
|
| 63 |
+
|
| 64 |
+
Random and Balanced hashing exploit the inductive bias of auto-regressive models and hash on the input token, but we also consider other possibilities: Bigram Hash uses the current and previous token $( x _ { t - 1 } , x _ { t } )$ rather than only the current token, while Previous Token Hash uses the previous token $x _ { t - 1 }$ , ignoring the current input. We also consider a sanity check which hashes based on the Position in the sequence, which we expect to have little impact, as absolute positions carry little information in natural language. Each of these hash functions is used to assess the value of the information being routed-on in our subsequent experimental analysis.
|
| 65 |
+
|
| 66 |
+
As an upper baseline, we also evaluate using an Oracle Future Hash, which hashes based on the output token $x _ { t + 1 }$ , rather than input token. This Oracle Hash checks how powerful routing decisions can be in solving a task. Similarly, we also consider Predicted Future Token Hash, which utilizes a baseline Transformer to make a prediction of the output token, and then hashes over this prediction.
|
| 67 |
+
|
| 68 |
+
Clustered Hashes Based on the intuition that similar tokens may want to be routed to the same expert, we also experiment with Clustered Hashes. We obtain clusters by performing k-means clustering with a fixed number of clusters using token embeddings from a baseline Transformer model. Each expert is assigned a centroid, and tokens are assigned to their closest cluster.
|
| 69 |
+
|
| 70 |
+
Dispersed Hashes We also consider the opposite hypothesis: that similar-tokens should be placed in different buckets, where the assumption is that very similar tokens need fine distinctions which requires more model capacity (hence assigning to different experts). To do this, we use the same $\mathbf { k }$ -means clusters as before, but distribute all tokens within each cluster equally across all buckets.
|
| 71 |
+
|
| 72 |
+
# 3.2 MultiHash Layers
|
| 73 |
+
|
| 74 |
+
In the standard FFN MoE approach, all $K$ expert modules have independent parameters, but here we consider another option. It is known in the hashing literature that multiple hashes can provide better allocations in many contexts [14]. We consider such schemes in the context of sparse routing. Let us assume we are given $N$ different hashing functions, and for a given input token $x$ we compute these hashes, denoted as $k _ { m } = { \mathrm { h a s h } _ { m } } ( x )$ , $m = 1 , \ldots , N$ . Assuming the usual expert FFN is a function $B ( \mathrm { r e l u } ( A ( { \bf h } ) ) )$ where $A : \mathbb { R } ^ { d } \mathbb { R } ^ { D }$ and $B : \mathbb { R } ^ { D } \mathbb { R } ^ { d }$ , we split the linear layers into $N$ segments, $A _ { m } : \mathbb { R } ^ { d } \mathbb { R } ^ { D / N }$ and $B _ { m } : \mathbb { R } ^ { D } \mathbb { R } ^ { d / N }$ . Then we compute:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbf { v } = \mathrm { r e l u } ( [ A _ { k _ { 1 } } ( \mathbf { h } ) , \dots , A _ { k _ { N } } ( \mathbf { h } ) ] ) \qquad \mathrm { F F N } _ { \mathrm { M H } } ( \mathbf { h } ) = [ B _ { k _ { 1 } } ( \mathbf { v } ) , \dots , B _ { k _ { N } } ( \mathbf { v } ) ] .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
That is, use hashing to select the parameters we are going to use for each segment, and then concatenate them together. The advantage is that we are now no longer reliant on the quality of a single hash function, but have multiple chances to produce good quality partitions. This perhaps can also be seen as analogous to the multi-head attention process already used in Transformers.
|
| 81 |
+
|
| 82 |
+
# 4 Related Work
|
| 83 |
+
|
| 84 |
+
Sparse MoE models, where only a few expert modules are active for any input, in particular in the context of NLP, have been studied recently in [6, 11]. In these works, the gating is learned via backpropagation, perhaps with a regularizer to encourage load balancing across experts. [8] showed that models in [11] can be successfully trained with each input assigned to exactly one expert. Another such approach for Transformers, where the routing is learned via solving a linear assignment problem, is studied in [10]. [15] uses a different approach, where product keys enable nearest neighbor search to select parameters. More generally, using MoE to trade off compute time (at the cost of possible data fragmentation) has a long history, see e.g. [3, 7].
|
| 85 |
+
|
| 86 |
+
The approach in this work is different from all of these in that the assignments use no learning whatsoever, and instead make use of the inductive biases possible in the setting of natural language. In particular, we use the fact that $n$ -grams are themselves decent language models [16]. Thus this work is related to previous work attempting to combine neural and $n$ -gram language models [17, 18, 19, 20, 21, 22].
|
| 87 |
+
|
| 88 |
+
Our work is also related to feature hashing in linear models and kernel methods [23, 24], where word or n-gram features are hashed to provide a new lower dimensional feature space. [23] showed that when performing such feature hashing the interaction between random subspaces is negligible with high probability. [25] uses hashing to compress neural networks, rather than increase their parameters as we do here. Work on long-context Transformers has recently used hashing techniques to speed up access to long-range token history via sparse self-attention patterns, particularly in Routing Transformers [26] and the Reformer [27]. In contrast, our work uses hashing to access a large set of parameters via sparse routing, rather than sparse access to input features.
|
| 89 |
+
|
| 90 |
+
# 5 Experiments
|
| 91 |
+
|
| 92 |
+
# 5.1 Tasks
|
| 93 |
+
|
| 94 |
+
Pushshift.io Reddit We use a variant of Reddit discussions, which has also been used in several existing studies, see e.g. [28, 29, 30, 31]. Following [32], we use a previously existing Reddit dataset extracted and obtained by a third party and made available on pushshift.io [33], training to generate a comment conditioned on the full thread leading up to the comment, spanning 1.5B training examples. We use the same BPE dictionary as [34], comprising of 8008 tokens.
|
| 95 |
+
|
| 96 |
+
RoBERTa+cc100en Data We use the same data used to train BASE [10], which consists of approximately 100B tokens, combining corpora used in RoBERTa [35] with the English subset of the CC100 corpus [36]. The GPT2 dictionary, of size 51200, is used for tokenization. For our seq2seq experiments, we arrange this data splitting by sentence to predict the next turn. We consider it as the originally intended language modeling task in our experiments comparing with BASE [10].
|
| 97 |
+
|
| 98 |
+
Wikitext-103 Wikitext-103 is a smaller language modeling benchmark [37] consisting of a collection of Wikipedia articles of over 100 million tokens, and a fixed vocabulary size of 270K tokens is provided. We view this as a seq2seq task in our experiments, again splitting by sentence.
|
| 99 |
+
|
| 100 |
+
Downstream BST tasks Finally, we use the Blended Skill Talk (BST) dialogue tasks used in [34] after pushshift.io Reddit pre-training to evaluate fine-tuning performance of dense vs. sparse models.
|
| 101 |
+
|
| 102 |
+
# 5.2 Experimental Setup
|
| 103 |
+
|
| 104 |
+
Seq2Seq Setup The majority of our experiments are carried out in ParlAI1 platform using an encoder-decoder Transformer framework. We first train several standard (dense) Transformers, with
|
| 105 |
+
|
| 106 |
+
Table 1: Comparison of Models on pushshift.io Reddit. We show three sizes of dense Transformer compared to Switch Transformers and using Hash Layers with various numbers of modules and sparse layers, e.g. $5 \mathrm { x } 1 6$ means 5 sparse layers with 16 modules each. All Switch and Hash Layer modules are built to the same computational complexity as the 11 layer baseline Transformer, but have more parameters; the larger dense models have similar total parameters, but use more compute.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>Model</td><td>Configuration</td><td>Params</td><td>Valid PPL</td><td>Test PPL</td></tr><tr><td>Baseline Transformer</td><td>layers=11,d=1024,D=4096</td><td>222M</td><td>24.90</td><td>24.96</td></tr><tr><td>Wider Transformer (more compute)</td><td>layers=11,d=2048,D=6144</td><td>755M</td><td>23.32</td><td>23.38</td></tr><tr><td>Deeper Transformer (more compute)</td><td>layers=22,d=1536,D=4096</td><td>755M</td><td>22.72</td><td>22.78</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x64,load_bal=0.1</td><td>751M</td><td>23.65</td><td>23.73</td></tr><tr><td>Hash Layer</td><td>layers=11,modules=1x64</td><td>751M</td><td>23.16</td><td>23.23</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x128,load_bal=0.1</td><td>1.28B</td><td>23.52</td><td>23.58</td></tr><tr><td>Hash Layer</td><td>layers=11,modules=1x128</td><td>1.28B</td><td>22.89</td><td>22.95</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=5x16,load_bal=0.01</td><td>852M</td><td>23.19</td><td>23.25</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=5x16,load_bal=0.1</td><td>852M</td><td>23.00</td><td>22.93</td></tr><tr><td>Hash Layer</td><td>layers=11,modules=5x16</td><td>852M</td><td>23.21</td><td>23.27</td></tr></table>
|
| 109 |
+
|
| 110 |
+
Table 2: Comparison of Models on RoBERTa $^ +$ cc100en Data. We compare a dense transformer with the same parameters as our sparse models, except with 1 sparse layer with 64 modules (1x64).
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Model</td><td>Configuration</td><td>Params</td><td>Valid PPL</td></tr><tr><td>Baseline Transformer</td><td>layers=11,d=1024,D=4096</td><td>266M</td><td>28.85</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x64,load_bal=0.1</td><td>795M</td><td>27.41</td></tr><tr><td>Hash Layer</td><td>layers=11,modules=1x64</td><td>794M</td><td>26.99</td></tr></table>
|
| 113 |
+
|
| 114 |
+
2 encoder layers and either 11 or 22 decoder layers, following the structure in [34] for training on pushshift.io Reddit. We refer to the one with 11 layers and embedding size of $d = 1 0 2 4$ and FFN hidden layer size of $D = 4 0 9 6$ as our Baseline Transformer. We also train a "Wider" model with $D = 6 1 4 4$ , and a "Deeper" model with 22 decoder layers, and $D = 4 0 9 6$ . The Baseline model has 222M parameters, and the "Wider" and "Deeper" are selected to both have ${ 7 5 5 } \mathbf { M }$ parameters each. These models are compared to the Hash Layer methods detailed in section 3 and to Switch Transformers of the same sizes and settings. The load balancing for Switch is optimized on the validation set. For both Hash and Switch we use the "Baseline" Transformer size detailed above as the architecture that we add sparse routing layers to by replacing one or more of the original dense layers. All experiments are run for 100k updates; a table of hyperparameters is provided in subsection B.1.
|
| 115 |
+
|
| 116 |
+
BASE Comparison While most of our analysis takes place in the setup described above with models up to 1.28B parameters, to test our methods at scale on larger sparse models, we adopt the BASE Layer setup [10] and code base2 instead where we compare 4.5B parameter Hash and BASE Layer models. This setting uses pure language models rather than the Seq2Seq setup above. We use the architecture, data (RoBERTa+cc100en), and hyperparameters directly from [10], using either a single sparse routing layer consisting of 3 stacked FFNs $D = 8 1 9 2$ ) on the middle layer of a 25 layer network, or 3 routing layers evenly spaced in the network. In order to compare with BASE directly, we keep all hyperparameters fixed and only change the routing method; we use a balanced assignment Hash Layer in this case. We trained until 40k steps had been reached. A table of hyperparameters is provided in subsection B.2.
|
| 117 |
+
|
| 118 |
+
# 5.3 Results and Analysis
|
| 119 |
+
|
| 120 |
+
# 5.3.1 Comparison between Hash, Switch and Dense models
|
| 121 |
+
|
| 122 |
+
Hash vs. Switch routing on a single layer We first compare a Hash layer (with balanced hash) to a Switch layer, on an otherwise dense Transformer, where sparse routing is performed on layer 7 of the decoder. Both methods use 64 expert FFNs with 751M total parameters. Results on pushshift.io Reddit are given in Table 1 (rows 4 and 5) and on the RoBERTa+cc100en data in Table 2 (rows 2 and 3). We find Hash Layers outperforming Switch on both datasets by about 0.4-0.5 perplexity.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 2: Comparison of Hash Layers with other models. (left) Validation perplexity of a baseline Transformer, Switch Transformer, and Hash Layer on the pushshift.io Reddit dataset with 128 modules. (right) Validation perplexity of BASE, Hash Layer, and a deeper Hash Layer model on the RoBERTa+cc100en dataset. All sparse models have the same number of parameters.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Comparing Different Number of Expert Modules and Layer Position. We compare (left) the validation perplexity wrt. the number of expert modules on the pushshift.io Reddit task for a Hash or Switch Layer on layer 7 of an 11 layer decoder in a Transformer. The baseline Transformer obtains a perplexity of 24.9. We compare the performance when adjusting the layer position of a 64 module Hash Layer on the same task (right). Placing on later layers works best.
|
| 129 |
+
|
| 130 |
+
Dense vs. Sparse Models Both Hash and Switch sparse models outperform the dense Baseline (222M parameters) they are based on, as well as the Wider Transformer (755M parameters). However, the Deeper Transformer (755M parameters) outperforms the sparse models which have a similar number of parameters. However, we note that due to its dense rather than conditional compute it is slower in inference speed. We see this as a general trend: good dense models can get more power out of the same number of parameters than sparse models. However, sparse models, although more wasteful in memory, give better perplexity for the same speed (i.e, we should compare to the Baseline Transformer in this case, which has roughly the same amount of computation).
|
| 131 |
+
|
| 132 |
+
Hash layer module size We conduct the same pushshift.io Reddit experiments as above, but altering the number of expert modules in both Hash and Switch. Increasing from 64 to 128 modules (1.28B parameters total) sees an even larger improvement of Hash over Switch (about 0.6 perplexity), see Table 1 (rows 6 and 7), and Figure 2 (left). Trying smaller numbers of modules, 16 and 32, and plotting all the results in Figure 3 (left) we see that for small numbers of modules Hash and Switch perform similarly, but the gap grows larger as the number of modules increases. For small numbers of modules, we hypothesize that learning to route, as Switch does, would be more important to be performant with those choices, but with larger numbers of modules many routing choices could work. Hence, Hash layers can work well in that setting, and learning to route becomes less important.
|
| 133 |
+
|
| 134 |
+
Hash layer position We also experiment to find the best position layer-wise for the sparse routing to take place. In Figure 3 (right) we plot perplexity for the 64 module Hash Layer, placing on different layers of the decoder. We find that later layers perform better, but even the worst performing choice (layer 1) is still performing well compared to other baselines: as good as Switch Transformers using later layers in fact. We note that analysis of BASE Layers [10] showed a similar trend that later layers work well. Hypothesizing that conditional compute gives the ability to make fine-grained specializations, it follows that it is worth making those distinctions after more obvious features have first been extracted. We will return to this argument in later experiments.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 4: Relative frequency for 64 expert modules with Random Hash (left) and Balanced Hash (right). The Zipfian distribution makes perfect balance impossible, but Balanced Hash is closer.
|
| 138 |
+
|
| 139 |
+
Multi-layer routing We evaluate placing sparse routing every other layer, 16 different modules each in Table 1 (rows 8-10). Switch and Hash perform similarly in this setting, with Switch outperforming with the optimal choice of 0.1 load balancing (23.00 vs. 23.21), and the same performance (23.19) for balancing parameter 0.01. Given the results of Figure 3 (left), the small number of modules in this case may make performance close.
|
| 140 |
+
|
| 141 |
+
Downstream fine-tuning We compare several of the pushshift.io Reddit models for the goal of fine-tuning on downstream tasks. We experiment with either fine-tuning the whole model, or freezing some parts of the model during fine-tuning, as well as altering the load balancing for Switch at fine-tune time. Results are given in Appendix A. We find that the fine-tune results generally agree with the original performance on the pre-training pushshift.io Reddit task, and the order of methods is retained. Hash outperforms Switch slightly, both outperform the Baseline model, and the larger dense models perform better, as expected. Freezing parts of the model generally hurts fine-tuning, unless the part frozen is the sparse part of the model. It appears in that case just fine-tuning the dense parts of the model is sufficient for good performance. Only tuning the sparse part of the model, on the other hand, hurts performance, perhaps because the majority of the capacity of the model lies there.
|
| 142 |
+
|
| 143 |
+
# 5.3.2 Hash Function Analysis
|
| 144 |
+
|
| 145 |
+
We evaluate the different choices of hashing function detailed in subsection 3.1. The overall results are given in Table 3 on the pushshift.io Reddit dataset using a 64 module Hash Layer.
|
| 146 |
+
|
| 147 |
+
Random and Balanced Hash Functions We find that fixed random assignment (row 3) and balanced assignment (row 2) perform similarly well in terms of perplexity (23.22 vs. 23.16 valid perplexity). However, balanced assignment, as its name suggests, is more balanced, see Figure 4, which may render it more efficient in terms of distributed training schemes.
|
| 148 |
+
|
| 149 |
+
Clustering Hash Functions Interestingly, using cluster based hashes (“Token clustering”, row 4) performs clearly worse than randomized hashes (23.90 vs. 23.22). We hypothesize that if the goal of conditional computation is to make fine distinctions, then those distinctions are more likely to appear between tokens within the same cluster, hence they should be in different hashes (parts of the compute graph), not the same one. We provide partial evidence for this by hashing within token clusters instead (“Dispersed Hash”, row 5), which restores the performance to be similar to random hashes (23.17 vs. 23.22). We note that learn-to-route methods such as Switch Transformers and BASE use simple functions of the hidden state to perform routing, which generally provide clustered expert modules [10], which could hence be a disadvantage for those methods.
|
| 150 |
+
|
| 151 |
+
Table 4: Comparison of Models on Wikitext-103. We compare a baseline dense Transformer to our sparse models, which have 1 sparse layer with 16 modules (1x16). We show results with two different dictionaries, the BB [34] BPE dictionary (8008 tokens) and the standard one for the task (267,739 tokens). As these are different dictionaries, perplexities are not comparable across columns.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Model</td><td>Configuration</td><td>Std. Dict Valid PPL</td><td>BB Dict Valid PPL</td></tr><tr><td>Baseline Transformer</td><td>layers=8,d=512,D=512</td><td>33.09</td><td>12.58</td></tr><tr><td>Switch Transformer</td><td>layers=8,modules=1x16,load_bal=0.1</td><td>31.76</td><td>11.67</td></tr><tr><td>Hash Layer</td><td>layers=8,modules=1x16</td><td>32.32</td><td>11.58</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Position-based Hash Function We conduct experiments hashing based on sequence position only. We consider this experiment as a sanity check, we did not expect choosing conditional compute based on position in the output sequence to help. Indeed, it turns out that this is no better than the dense Transformer baseline. Thus it appears that routing based on input content is much more important.
|
| 156 |
+
|
| 157 |
+
Bigram Hash Function Hashing based on the last two tokens (bigrams) performs worse than using only the last token (24.19 vs. 23.16). We hypothesize there are two reasons for this: (1) first, the last token is clearly the most pertinent, and bigrams add a less relevant feature; (2) this creates too many hashes, which performs less well. Subsequent experiments will help test these claims.
|
| 158 |
+
|
| 159 |
+
Previous Token Hashing Hashing based on the previous token is clearly worse than using the current token (24.16 vs. 23.16), and gives similar performance to using bigrams, helping confirm the first part of our above bigram hypothesis.
|
| 160 |
+
|
| 161 |
+
Dictionary size We perform experiments on Wikitext-103 in two settings: using the given dictionary of 267k tokens, or using the 8k dictionary we use in our pushshift.io Reddit experiments, following [34]. The results, comparing to Switch and a baseline Transformer, are given in Table 4. We find that Hash works well for the small dictionary, slightly outperforming Switch. However, on the larger dictionary, it performs worse than Switch. As this is the same data but just the tokenization has changed we conclude the hashing induced from the smaller dictionary is easier to learn from, helping confirm the second part of our above bigram hypothesis.
|
| 162 |
+
|
| 163 |
+
Oracle Future Token Hashing We evaluate hashing using the oracle next token that is to be predicted. This yields a perplexity of 1.9. Using oracle information just to choose between modules is sufficient to essentially solve a task.
|
| 164 |
+
|
| 165 |
+
Predicted Future Token Hashing The last result poses the question: if we can predict the next token, and hash based on that prediction instead – will it be better than hashing on the current token? We thus tried hashing using the Baseline Transformer to predict labels, yielding a perplexity of 25.02 – which does not actually beat the Baseline itself. It appears that the bias of the token predictions limits the ability of the sparse routing to improve.
|
| 166 |
+
|
| 167 |
+
Multi-hashing We evaluate the multi-hashing technique described in subsection 3.2. Results are given in Appendix A, comparing to Switch and standard hashing. Even though the same number of parameters is used in all cases, we see improvements for splitting the hash into 2, 4 or 8 different hashes compared to a single hash, with steadily improving results for both 16 or 32 modules.
|
| 168 |
+
|
| 169 |
+
# 5.3.3 Switch Transformer Analysis
|
| 170 |
+
|
| 171 |
+
Switch load balancing We show the performance of Switch for different values of the load balancing parameter on pushshift.io Reddit in Appendix A. Clearly the choice of parameter is important, with results varying over a 1 perplexity point range.
|
| 172 |
+
|
| 173 |
+
Switch with Token-based Routing Given our analysis of oracle and predicted token hashing in subsection 5.3.2, we hypothesize that the hidden representations in layers of the Transformer, being biased towards the predictions of the model, may be suboptimal for routing. We therefore experiment with a hybrid between Switch and Hash Layers: on the sparse layer, instead of using hidden state as the Switch router input, we use the current token instead. To convert the token to a vector we use an extra lookup table, i.e., an extra set of learnable parameters that is the size of the dictionary. These parameters are independent of the hidden state and are only used by the router to learn the best route. Results are given in Table 6. We find this brings some small improvements to Switch for 64 and 128 modules on a single layer, affirming the usefulness of token-based routing.
|
| 174 |
+
|
| 175 |
+
Table 5: Multi-hashing experiments on pushshift.io Reddit. When multi-hashing, the same number of parameters is used, but the FFN weights are split and indexed into multiple hashes and then concatenated together for the forward step.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Model</td><td>Configuration</td><td>Params</td><td>Valid PPL</td><td>Test PPL</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x32,load_bal=0.1</td><td>483M</td><td>23.79</td><td>23.84</td></tr><tr><td>Hash Layer</td><td>layers=11,modules=1x32</td><td>483M</td><td>23.58</td><td>23.65</td></tr><tr><td>MultiHash Layer</td><td>layers=11,modules=1x32,hashes=2</td><td>483M</td><td>23.48</td><td>23.53</td></tr><tr><td>MultiHash Layer</td><td>layers=11,modules=1x32,hashes=4</td><td>483M</td><td>23.38</td><td>23.45</td></tr><tr><td>MultiHash Layer</td><td>layers=11,modules=1x32,hashes=8</td><td>483M</td><td>23.28</td><td>23.34</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 6: Switch Transformers with Token-Based Routing on pushshift.io Reddit. We compare standard Switch which routes based on the hidden state to token feature-routing (‘Token Switch’).
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model</td><td>Configuration</td><td>Params</td><td>Valid PPL</td><td>Test PPL</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x64,load_bal=0.1</td><td>751M</td><td>23.65</td><td>23.73</td></tr><tr><td>Token Switch</td><td>layers=11,modules=1x64,load_bal=0.1</td><td>751M</td><td>23.43</td><td>23.43</td></tr><tr><td>Switch Transformer</td><td>layers=11,modules=1x128,load_bal=0.1</td><td>1.28B</td><td>23.52</td><td>23.58</td></tr><tr><td>Token Switch</td><td>layers=11,modules=1x128,load_bal=0.1</td><td>1.28B</td><td>23.26</td><td>23.32</td></tr></table>
|
| 182 |
+
|
| 183 |
+
# 5.3.4 Comparison to BASE Layers
|
| 184 |
+
|
| 185 |
+
We next compare to BASE Layers. Using the BASE Layer code base, we implement Hash Layers in exactly the same setup, changing only the routing method, and leaving everything else fixed. Figure 2 (right) shows results comparing Hash with BASE for 4.5B parameter models. Across the entire run, we see that Hash outperforms BASE at each training step. During early parts of training, Hash would presumably have an advantage in being able to specialize expert modules earlier, while BASE must learn membership for each of the expert modules. Later in training, BASE becomes mildly unstable presumably as expert assignments shift, while Hash performance continues to improve smoothly.
|
| 186 |
+
|
| 187 |
+
Additionally, to demonstrate Hash Layers remain performant when stacked, we trained a model with 3 Hash Layers (using random hashes), but fewer parameters per expert module so the total parameters remained constant at 4.5B (see subsection B.2). We find that using multiple Hash Layers gives a small but consistent improvement, suggesting Hash Layers will be effective at even more depth.
|
| 188 |
+
|
| 189 |
+
In addition to performance gains compared to BASE, we also find that Hash Layers are more efficient in total computation. In particular, BASE requires two all-to-all communications: the first de-correlates batches in order to make assignment balancing more stochastic, and the second routes states to their assigned expert. As Hash Layers use fixed, pre-computed assignments they avoid the decorrelation step. In practice, we find this gives an improvement of about $11 \%$ in updates-per-second. As the number of expert layers increases, this difference will become more exaggerated.
|
| 190 |
+
|
| 191 |
+
# 6 Conclusion
|
| 192 |
+
|
| 193 |
+
We have introduced a simple and efficient approach to sparse models in the Transformers-for-NLP setting based on hash layers. We showed on a variety of datasets and with analysis in various settings that this approach is highly competitive with existing methods such as Switch Transformers and BASE Layers, whilst being robust and far simpler – requiring no extra learning parameters, assignment algorithm or changes to the objective function. Given that researchers typically have only one opportunity to train very large models, this makes our approach a strong candidate for such runs. While our experiments scale up to 4.5B parameters, we do not reach the scales of large industrial works such as [8], and we hope to see future work conduct such experiments. Finally, given that our routing approach is learning free, our results perhaps suggest that none of the current approaches are routing particularly well. We thus believe learning-to-route should continue to be the study of future work, and consider our work a strong baseline for such research.
|
| 194 |
+
|
| 195 |
+
References
|
| 196 |
+
[1] 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.
|
| 197 |
+
[2] Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 198 |
+
[3] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilistic language model. The journal of machine learning research, 3:1137–1155, 2003.
|
| 199 |
+
[4] Seniha Esen Yuksel, Joseph N Wilson, and Paul D Gader. Twenty years of mixture of experts. IEEE transactions on neural networks and learning systems, 23(8):1177–1193, 2012.
|
| 200 |
+
[5] David Eigen, Marc’Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. arXiv preprint arXiv:1312.4314, 2013.
|
| 201 |
+
[6] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 202 |
+
[7] Sam Gross, Marc’Aurelio Ranzato, and Arthur Szlam. Hard mixtures of experts for large scale weakly supervised vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6865–6873, 2017.
|
| 203 |
+
[8] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021.
|
| 204 |
+
[9] Ronan Collobert, Yoshua Bengio, and Samy Bengio. Scaling large learning problems with hard parallel mixtures. International Journal of pattern recognition and artificial intelligence, 17 (03):349–365, 2003.
|
| 205 |
+
[10] Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. Base layers: Simplifying training of large, sparse models. arXiv preprint arXiv:2103.16716, 2021.
|
| 206 |
+
[11] Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 207 |
+
[12] 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, pages 5998–6008, 2017.
|
| 208 |
+
[13] Thomas H Cormen, Charles E Leiserson, Ronald L Rivest, and Clifford Stein. Introduction to algorithms. MIT press, 2009.
|
| 209 |
+
[14] Andrei Z Broder and Anna R Karlin. Multilevel adaptive hashing. In Proceedings of the first annual ACM-SIAM symposium on Discrete algorithms, pages 43–53, 1990.
|
| 210 |
+
[15] Guillaume Lample, Alexandre Sablayrolles, Marc’Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Large memory layers with product keys. In Advances in Neural Information Processing Systems, pages 8548–8559, 2019.
|
| 211 |
+
[16] Reinhard Kneser and Hermann Ney. Improved backing-off for m-gram language modeling. In 1995 international conference on acoustics, speech, and signal processing, volume 1, pages 181–184. IEEE, 1995.
|
| 212 |
+
[17] Tomáš Mikolov, Martin Karafiát, Lukáš Burget, Jan Cernock ˇ y, and Sanjeev Khudanpur. Recur- \` rent neural network based language model. In Eleventh annual conference of the international speech communication association, 2010.
|
| 213 |
+
[18] Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013.
|
| 214 |
+
|
| 215 |
+
[19] Graham Neubig and Chris Dyer. Generalizing and hybridizing count-based and neural language models. arXiv preprint arXiv:1606.00499, 2016.
|
| 216 |
+
|
| 217 |
+
[20] Sébastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large target vocabulary for neural machine translation. arXiv preprint arXiv:1412.2007, 2014.
|
| 218 |
+
|
| 219 |
+
[21] Armand Joulin, Moustapha Cissé, David Grangier, Hervé Jégou, et al. Efficient softmax approximation for gpus. In International Conference on Machine Learning, pages 1302–1310. PMLR, 2017.
|
| 220 |
+
|
| 221 |
+
[22] Anton Bakhtin, Arthur Szlam, Marc’Aurelio Ranzato, and Edouard Grave. Lightweight adaptive mixture of neural and n-gram language models. arXiv preprint arXiv:1804.07705, 2018.
|
| 222 |
+
|
| 223 |
+
[23] Kilian Weinberger, Anirban Dasgupta, John Langford, Alex Smola, and Josh Attenberg. Feature hashing for large scale multitask learning. In Proceedings of the 26th annual international conference on machine learning, pages 1113–1120, 2009.
|
| 224 |
+
|
| 225 |
+
[24] Bing Bai, Jason Weston, David Grangier, Ronan Collobert, Kunihiko Sadamasa, Yanjun Qi, Olivier Chapelle, and Kilian Weinberger. Learning to rank with (a lot of) word features. Information retrieval, 13(3):291–314, 2010.
|
| 226 |
+
|
| 227 |
+
[25] Wenlin Chen, James Wilson, Stephen Tyree, Kilian Weinberger, and Yixin Chen. Compressing neural networks with the hashing trick. In International conference on machine learning, pages 2285–2294. PMLR, 2015.
|
| 228 |
+
|
| 229 |
+
[26] Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers. Transactions of the Association for Computational Linguistics, 9:53–68, 2021.
|
| 230 |
+
|
| 231 |
+
[27] Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
|
| 232 |
+
|
| 233 |
+
[28] Yinfei Yang, Steve Yuan, Daniel Cer, Sheng-yi Kong, Noah Constant, Petr Pilar, Heming Ge, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. Learning semantic textual similarity from conversations. In Proceedings of The Third Workshop on Representation Learning for NLP, pages 164–174, Melbourne, Australia, July 2018. Association for Computational Linguistics.
|
| 234 |
+
|
| 235 |
+
[29] Pierre-Emmanuel Mazaré, Samuel Humeau, Martin Raison, and Antoine Bordes. Training millions of personalized dialogue agents. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2775–2779, Brussels, Belgium, OctoberNovember 2018. Association for Computational Linguistics.
|
| 236 |
+
|
| 237 |
+
[30] Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. CTRL: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019.
|
| 238 |
+
|
| 239 |
+
[31] Kurt Shuster, Da Ju, Stephen Roller, Emily Dinan, Y-Lan Boureau, and Jason Weston. The dialogue dodecathlon: Open-domain knowledge and image grounded conversational agents, 2019.
|
| 240 |
+
|
| 241 |
+
[32] Samuel Humeau, Kurt Shuster, Marie-Anne Lachaux, and Jason Weston. Poly-encoders: Architectures and pre-training strategies for fast and accurate multi-sentence scoring. In Proceedings of the International Conference on Learning Representations, 2019.
|
| 242 |
+
|
| 243 |
+
[33] Jason Baumgartner, Savvas Zannettou, Brian Keegan, Megan Squire, and Jeremy Blackburn. The pushshift reddit dataset. arXiv preprint arXiv:2001.08435, 2020.
|
| 244 |
+
|
| 245 |
+
[34] Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, Jing Xu, Myle Ott, Kurt Shuster, Eric M Smith, et al. Recipes for building an open-domain chatbot. arXiv preprint arXiv:2004.13637, 2020.
|
| 246 |
+
|
| 247 |
+
[35] 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.
|
| 248 |
+
|
| 249 |
+
[36] Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116, 2019.
|
| 250 |
+
|
| 251 |
+
[37] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 252 |
+
|
| 253 |
+
[38] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. arXiv preprint arXiv:1904.01038, 2019.
|
md/train/lo7GKwmakFZ/lo7GKwmakFZ.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AVERAGE REWARD REINFORCEMENT LEARNING WITH MONOTONIC POLICY IMPROVEMENT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In continuing control tasks, an agent’s average reward per time step is a more natural performance measure compared to the commonly used discounting framework since it can better capture an agent’s long-term behavior. We derive a novel lower bound on the difference of the long-term average reward for two policies. The lower bound depends on the average divergence between the policies and on the so-called Kemeny constant, which measures to what degree the unichain Markov chains associated with the policies are well-connected. We also show that previous work based on the discounted return (Schulman et al., 2015; Achiam et al., 2017) results in a non-meaningful lower bound in the average reward setting. Based on our lower bound, we develop an iterative procedure which produces a sequence of monotonically improved policies for the average reward criterion. When combined with Deep Reinforcement Learning (DRL) methods, the procedure leads to scalable and efficient algorithms for maximizing the agent’s average reward performance. Empirically we demonstrate the effectiveness of our method on continuing control tasks and show how discounting can lead to unsatisfactory performance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The goal of Reinforcement Learning (RL) is to build agents that can learn high-performing behaviors through trial-and-error interactions with the environment. Broadly speaking, modern RL tackles two kinds of problems: episodic tasks and continuing tasks. In episodic tasks, the agent-environment interaction can be broken into separate distinct episodes, and the performance of the agent is simply the sum of the rewards accrued within an episode. Examples of episodic tasks include training an agent to learn to play Go (Silver et al., 2016; 2018) or Atari video games (Mnih et al., 2013), where the episode terminates when the game ends. In continuing tasks, such as controlling robots with long operating lifespans (Peters & Schaal, 2008; Schulman et al., 2015; Haarnoja et al., 2018), there is no natural separation of episodes and the agent-environment interaction continues indefinitely. The performance of an agent in a continuing task is more difficult to quantify since even for bounded reward functions, the total sum of rewards is typically infinite.
|
| 12 |
+
|
| 13 |
+
One way of making the long-term reward objective meaningful for continuing tasks is to apply discounting, i.e., we maximize the discounted sum of rewards $r _ { 0 } + \gamma r _ { 1 } + \gamma ^ { 2 } \bar { r } _ { 2 } + \cdot \cdot \cdot$ for some discount factor $\gamma \in ( 0 , 1 )$ . This is guaranteed to be finite for any bounded reward function. However the discounted objective biases the optimal policy to choose actions that lead to high near-term performance rather than to high long-term performance. Such an objective — while useful in certain applications — is not appropriate when the goal is optimize long-term behavior. As argued in Chapter 10 of Sutton & Barto (2018) and in Naik et al. (2019), a more natural objective is to use the average reward received by an agent over every time-step. While the average reward setting has been extensively studied in the classical Markov Decision Process literature (Howard, 1960; Blackwell, 1962; Veinott, 1966; Bertsekas et al., 1995), it is much less commonly used in reinforcement learning. An important open question is whether recent advances in RL for the discounted reward criterion can be naturally generalized to the average reward setting.
|
| 14 |
+
|
| 15 |
+
One major source of difficulty with modern DRL algorithms lies in controlling the step-size for policy updates. In order to have better control over step-sizes, Schulman et al. (2015) constructed a lower bound on the difference between the expected discounted return for two arbitrary policies $\pi$ and $\pi ^ { \prime }$ . The bound is a function of the divergence between these two policies and the discount factor.
|
| 16 |
+
|
| 17 |
+
Schulman et al. (2015) showed that iteratively maximizing this lower bound generates a sequence of monotonically improved policies in terms of their discounted return.
|
| 18 |
+
|
| 19 |
+
In this paper, we first show that the policy improvement theorem from Schulman et al. (2015) results in a non-meaningful bound in the average reward case. We then derive a novel result which lower bounds the difference of the average rewards based on the divergence of the policies. The bound depends on the average divergence between the policies and on the so-called Kemeny constant, which measures to what degree the unichain Markov chains associated with the policies are wellconnected. We show that iteratively maximizing this lower bound guarantees monotonic average reward policy improvement. Similar to the discounted case, the problem of maximizing the lower bound can be approximated with DRL algorithms which can be optimized using samples collected in the environment. We describe in detail two such algorithms: Average Reward TRPO (ATRPO) and Average Cost CPO (ACPO), which are average reward versions of algorithms based on the discounted criterion (Schulman et al., 2015; Achiam et al., 2017). Using the MuJoCo simulated robotic benchmark, we carry out extensive experiments with the ATRPO algorithm and show that it is more effective than their discounted counterparts for these continuing control tasks. To our knowledge, this is one of the first paper to address DRL using the long-term average reward criterion.
|
| 20 |
+
|
| 21 |
+
# 2 PRELIMINARIES
|
| 22 |
+
|
| 23 |
+
Consider a Markov Decision Process (MDP) (Sutton & Barto, 2018) $( S , { \mathcal { A } } , P , r , \mu )$ where the state space $s$ and action space $\mathcal { A }$ are assumed to be finite. The transition probability is denoted by $P : \mathcal { S } \times \mathcal { A } \times \mathcal { S } [ 0 , 1 ]$ , the bounded reward function $r : \mathcal { S } \times \mathcal { A } [ r _ { \operatorname* { m i n } } , r _ { \operatorname* { m a x } } ]$ , and $\mu : { \mathcal { S } } [ 0 , 1 ]$ is the initial state distribution. Let $\pi = \{ \pi ( a | s ) : s \in S , a \in A \}$ be a stationary policy, and $\Pi$ is the set of all stationary policies. Here we discuss the two objective formulations for continuing control tasks: the average reward approach and discounted reward approach.
|
| 24 |
+
|
| 25 |
+
# Average Reward Approach
|
| 26 |
+
|
| 27 |
+
In this paper, we will focus exclusively on unichain MDPs, which is when the Markov chain corresponding to every policy contains only one recurrent class and a finite but possibly empty set of transient states. The average reward objective is defined as:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\rho ( \pi ) : = \operatorname* { l i m } _ { N \infty } \frac { 1 } { N } \operatorname* { \mathbb { E } } _ { \tau \sim \pi } [ \sum _ { t = 0 } ^ { N - 1 } r ( s _ { t } , a _ { t } ) ] = \operatorname* { \mathbb { E } } _ { s \sim d _ { \pi } } [ r ( s , a ) ] .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Here dπ(s) := limN→∞ 1N PN−1t=0 P (st = s|π) = limt→∞ P (st = s|π) is the stationary state distribution under policy $\pi$ , $\tau = ( s _ { 0 } , a _ { 0 } , \dots , )$ is a sample trajectory. We use $\tau \sim \pi$ to indicate that the trajectory is sampled from policy $\pi$ , i.e. $s _ { 0 } \sim \mu$ , $\bar { a } _ { t } \sim \bar { \pi } ( \cdot | s _ { t } )$ , and $s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } )$ . In the unichain case, the average reward $\rho ( \pi )$ is state-independent for any policy $\pi$ (Bertsekas et al., 1995). We express the average-reward value function as $\begin{array} { r } { \dot { V ^ { \pi } } ( s ) : = \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { t = 0 } ^ { \infty } ( r ( s _ { t } , a _ { t } ) - \rho ( \pi ) ) \bigg | s _ { 0 } = s \right] } \end{array}$ and action-value function as $\begin{array} { r } { Q ^ { \pi } ( s , a ) : = \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { t = 0 } ^ { \infty } ( r ( s _ { t } , a _ { t } ) - \rho ( \pi ) ) \bigg | s _ { 0 } = s , a _ { 0 } = a \right] } \end{array}$ . We define the average reward advantage function as $A ^ { \tilde { \pi } } ( s , a ) : = Q ^ { \pi } ( s , a ) - V ^ { \tilde { \pi } } ( s )$ .
|
| 34 |
+
|
| 35 |
+
# Discounted Reward Approach
|
| 36 |
+
|
| 37 |
+
For some discount factor $\gamma \in ( 0 , 1 )$ , the discounted reward objective is defined as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\rho _ { \gamma } ( \pi ) : = \underset { \tau \sim \pi } { \mathbb { E } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) \right] = \frac { 1 } { 1 - \gamma } \underset { a \sim \pi } { \mathbb { E } } \left[ r ( s , a ) \right] .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\begin{array} { r } { d _ { \pi , \gamma } ( s ) : = ( 1 - \gamma ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } P ( s _ { t } = s | \pi ) } \end{array}$ is known as the future discounted state visitation distribution under policy $\pi$ . Note that unlike the average reward objective, the discounted objective depends on the initial state distribution $\mu$ . It can be easily shown that $d _ { \pi , \gamma } ( s ) \to d _ { \pi } ( s )$ for all $s$ as $\gamma 1$ . The discounted value function is defined as $\begin{array} { r } { V _ { \gamma } ^ { \pi } ( s ) : = \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) \bigg | s _ { 0 } = s \right] } \end{array}$ and discounted action-value function $\begin{array} { r } { Q _ { \gamma } ^ { \pi } ( s , a ) : = \mathbb { E } _ { \tau \sim \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) \bigg | s _ { 0 } = s , a _ { 0 } = a \right] } \end{array}$ . Finally, the discounted advantage function is defined as $A _ { \gamma } ^ { \pi } ( s , \bar { a } ) : = Q _ { \gamma } ^ { \pi } ( s , a ) - \dot { V } _ { \gamma } ^ { \pi } ( s )$ .
|
| 44 |
+
|
| 45 |
+
It is well-known that $\mathrm { l i m } _ { \gamma \to 1 } ( 1 - \gamma ) \rho _ { \gamma } ( \pi ) = \rho ( \pi )$ , implying that the discounted and average reward objectives are equivalent in the limit as $\gamma$ approaches 1 (Blackwell, 1962). We will further discuss the relationship between the discounted and average reward value functions in the supplementary materials and prove that $\begin{array} { r } { \operatorname* { l i m } _ { \gamma \to 1 } A _ { \gamma } ^ { \pi } ( s , a ) = A ^ { \pi } ( s , \bar { a } ) } \end{array}$ (see Corollary A.1).
|
| 46 |
+
|
| 47 |
+
# 3 MONTONICALLY IMPROVEMENT GUARANTEES FOR DISCOUNTED RL
|
| 48 |
+
|
| 49 |
+
In many modern RL literature (Schulman et al., 2015; 2017; Abdolmaleki et al., 2018; Vuong et al., 2019), algorithms iteratively update policies within a local region, i.e., at iteration $k$ we find policy $\pi _ { k + 1 }$ by maximizing $\rho _ { \gamma } ( \pi )$ within some region $D ( \pi , \pi _ { k } ) \leq \delta$ for some divergence measure $D$ . This approach allows us to control the step-size of each update using different choices of $D$ and $\delta$ which can lead to better sample efficiency (Peters & Schaal, 2008). Schulman et al. (2015) derived a policy improvement bound based on a specific choice of $D$ :
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\rho _ { \gamma } ( \pi _ { k + 1 } ) - \rho _ { \gamma } ( \pi _ { k } ) \geq \frac { 1 } { 1 - \gamma } \underset { a \sim \pi _ { k + 1 } } { \mathbb { E } } [ A _ { \gamma } ^ { \pi _ { k } } ( s , a ) ] - C \cdot \operatorname* { m a x } _ { s } [ D _ { \mathrm { T V } } ( \pi _ { k + 1 } \parallel \pi _ { k } ) [ s ] ]
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\begin{array} { r } { D _ { \mathrm { T V } } ( \pi _ { \smash { \left( \vphantom { \left| \frac { s } { s } \right| } \right| } } ^ { \prime } \| \pi ) [ s ] : = \frac { 1 } { 2 } \sum _ { a } | \pi ^ { \prime } ( a | s ) - \pi ( a | s ) [ } \end{array}$ is the total variation divergence for policies $\pi$ and $\pi ^ { \prime }$ , and $C$ is some constant which does not depend on the divergence term $D _ { \mathrm { T V } }$ . Schulman et al. (2015) showed that by choosing $\pi _ { k + 1 }$ such that the right hand side of (3) is maximized, we are guaranteed to have $\rho _ { \gamma } ( \pi _ { k + 1 } ) \geq \rho _ { \gamma } ( \bar { \pi } _ { k } )$ . This provided the theoretical foundation for an entire class of scalable policy optimization algorithms based on efficiently maximizing the right-hand-side of (3) (Schulman et al., 2015; 2017; Wu et al., 2017; Abdolmaleki et al., 2018; Vuong et al., 2019).
|
| 56 |
+
|
| 57 |
+
A natural question arises here is whether the iterative procedure described by Schulman et al. (2015) also guarantees improvement w.r.t. the average reward. Since the discounted and average reward objectives are equivalent when $\gamma 1$ , one may assume that we can also lower bound the policy performance difference of the average reward objective by letting $\gamma 1$ for the bounds in Schulman et al. (2015). Unfortunately this results in a non-meaningful bound. We will demonstrate this through a similar policy improvement bound from Achiam et al. (2017) based on the average divergence but a similar argument can be made for the original bound from Schulman et al. (2015) (see supplementary material for proof and discussion).
|
| 58 |
+
|
| 59 |
+
Proposition 1. Consider the following bound from Achiam et al. (2017)
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
D _ { \pi , \gamma } ^ { - } ( \pi ^ { \prime } ) \leq \rho _ { \gamma } ( \pi ^ { \prime } ) - \rho _ { \gamma } ( \pi ) \leq D _ { \pi , \gamma } ^ { + } ( \pi ^ { \prime } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
D _ { \pi , \gamma } ^ { \pm } ( \pi ^ { \prime } ) = \frac { 1 } { 1 - \gamma } \operatorname * { l i m } _ { s \sim d _ { \pi } } \frac { \mathbb { E } } { \pi ( a | s ) } A _ { \gamma } ^ { \pi } ( s , a ) \bigg ] \pm \frac { 2 \gamma \epsilon _ { \gamma } } { ( 1 - \gamma ) ^ { 2 } } \operatorname * { l i m } _ { s \sim d _ { \pi } } [ D _ { T V } ( \pi ^ { \prime } \parallel \pi ) [ s ] ]
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
and $\begin{array} { r } { \epsilon _ { \gamma } = \operatorname* { m a x } _ { s } \left| \mathbb { E } _ { a \sim \pi ^ { \prime } } [ A _ { \gamma } ^ { \pi } ( s , a ) ] \right| } \end{array}$ . We have:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname* { l i m } _ { \gamma 1 } ( 1 - \gamma ) D _ { \pi , \gamma } ^ { \pm } ( \pi ^ { \prime } ) = \pm \infty
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Since $\begin{array} { r } { \operatorname* { l i m } _ { \gamma \to 1 } ( 1 - \gamma ) ( \rho _ { \gamma } ( \pi ^ { \prime } ) - \rho _ { \gamma } ( \pi ) ) = \rho ( \pi ^ { \prime } ) - \rho ( \pi ) } \end{array}$ , Proposition 1 says (4) becomes trivial when used on the average reward. This result is discouraging as it shows that the policy improvement guarantee from Schulman et al. (2015) does not appear to generalize to the average reward setting. In the next section, we will derive an alternative policy improvement bound for the average reward objective which can be used to generate monotonically improved policies w.r.t. the average reward.
|
| 78 |
+
|
| 79 |
+
# 4 MAIN RESULTS
|
| 80 |
+
|
| 81 |
+
# 4.1 AVERAGE REWARD POLICY IMPROVEMENT THEOREM
|
| 82 |
+
|
| 83 |
+
Let $d _ { \pi } \in \mathbb { R } ^ { | s | }$ be the probability column vector whose components are $d _ { \pi } ( s )$ , $P _ { \pi } \in \mathbb { R } ^ { | S | \times | S | }$ be the transition matrix under policy $\pi$ whose $( s , s ^ { \prime } )$ component is $\begin{array} { r } { P _ { \pi } ( s ^ { \prime } | s ) = \sum _ { a } P ( s ^ { \prime } | s , a ) \pi ( a | s ) } \end{array}$ , and $P _ { \pi } ^ { * } = \operatorname* { l i m } _ { t \infty } P _ { \pi } ^ { t }$ be the limiting distribution for the transition matrix. We use $\left\| \cdot \right\| _ { p }$ to denote the operator norm of a matrix. In particular $\left\| \cdot \right\| _ { 1 }$ and $\left\| \cdot \right\| _ { \infty }$ are the maximum absolute column sum and maximum absolute row sum of a matrix respectively (Horn & Johnson, 2012).
|
| 84 |
+
|
| 85 |
+
Suppose we have a new policy $\pi ^ { \prime }$ obtained via some update rule from the current policy $\pi$ . Similar to the discounted case, we would like to measure their performance difference $\rho ( \pi ^ { \prime } ) - \rho ( \pi )$ using an expression which depends on $\pi$ and some divergence metric between the two policies. The following identity shows that $\rho ( \pi ^ { \prime } ) - \rho ( \pi )$ can be expressed using the advantange function of $\pi$ .
|
| 86 |
+
|
| 87 |
+
Lemma 1. For any two stochastic policies $\pi$ and $\pi ^ { \prime }$ :
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\rho ( \pi ^ { \prime } ) - \rho ( \pi ) = \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \underset { \tau \sim \pi ^ { \prime } } { \mathbb { E } } \left[ \sum _ { t = 0 } ^ { N - 1 } A ^ { \pi } ( s _ { t } , a _ { t } ) \right] = \underset { a \sim \pi ^ { \prime } } { \mathbb { E } } \left[ A ^ { \pi } ( s , a ) \right]
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Lemma 1 is the an extension of the well-known policy difference lemma from Kakade & Langford (2002) to the average reward case. A similar result was proved by Neu et al. (2010) and Even-Dar et al. (2009). For completeness, We will provide a proof based on the Bellman equation as well as a simpler alternative proof in the supplementary material. Note that this expression depends on samples drawn from $\pi ^ { \prime }$ . However we can show through the following lemma that when $d _ { \pi }$ and $d _ { \pi ^ { \prime } }$ are "close," we can evaluate the expression in (6) using samples from $d _ { \pi }$ (see supplementary material for proof).
|
| 94 |
+
|
| 95 |
+
Lemma 2. For any two stochastic policies $\pi$ and $\pi ^ { \prime }$ , the following bound holds:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r l } & { \underset { s \sim d _ { \pi } } { \mathbb { E } } \left[ A ^ { \pi } ( s , a ) \right] - 2 \epsilon D _ { T V } ( d _ { \pi ^ { \prime } } \parallel d _ { \pi } ) \leq \rho ( \pi ^ { \prime } ) - \rho ( \pi ) \leq \underset { s \sim d _ { \pi } } { \mathbb { E } } \left[ A ^ { \pi } ( s , a ) \right] + 2 \epsilon D _ { T V } ( d _ { \pi ^ { \prime } } \parallel d _ { \pi } ) } \\ & { \quad \sim \pi ^ { \prime \prime } } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\begin{array} { r } { \epsilon = \operatorname* { m a x } _ { s } \Big | \mathbb { E } _ { a \sim \pi ^ { \prime } ( a | s ) } \big [ A ^ { \pi } ( s , a ) \big ] \Big | . } \end{array}$
|
| 102 |
+
|
| 103 |
+
Lemma 2 shows us how policy improvement is related to the stationary distribution underlying each policy. In order to study how policy improvement is connected to changes in the actual policies themselves, we need to analyze the relationship between changes in the policies and changes in stationary distributions. It turns out that the sensitivity of the stationary distributions in relation to the policies is related to the structure of the underlying Markov chain.
|
| 104 |
+
|
| 105 |
+
Let $M ^ { \pi } \in \mathbb { R } ^ { | S | \times | S | }$ be the mean first passage time matrix whose elements $M ^ { \pi } ( s , s ^ { \prime } )$ is the expected number of steps it takes to reach state $s ^ { \prime }$ from $s$ under policy $\pi$ . The matrix $M ^ { \pi } ( s , s ^ { \prime } )$ can be calculated via (Theorem 4.4.7 of Kemeny & Snell (1960))
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
M ^ { \pi } ( s , s ^ { \prime } ) = ( I - Z ^ { \pi } + E Z _ { \mathrm { d g } } ^ { \pi } ) D ^ { \pi }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $Z ^ { \pi } = ( I - P _ { \pi } + P _ { \pi } ^ { * } ) ^ { - 1 }$ is known as the fundamental matrix of the Markov chain (Kemeny & Snell, 1960), $E$ is a square matrix consisting of all ones. The subscript ‘dg’ for some square matrix $A$ refers to a diagonal matrix whose elements are the diagonals of $A$ . $\bar { D ^ { \pi } } \in \mathbb { R } ^ { | S | \times | S | }$ is a diagonal matrix whose elements are $1 / d _ { \pi } ( s )$ . One important property of mean first passage time is that given some policy $\pi$ :
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\kappa ^ { \pi } = \sum _ { s ^ { \prime } } d _ { \pi } ( s ^ { \prime } ) { \cal M } ^ { \pi } ( s , s ^ { \prime } )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
is a constant independent of the starting state $s$ . This result is known as the random target lemma (Aldous & Fill, 1995). The constant $\kappa ^ { \pi }$ is sometimes referred to as Kemeny’s constant (Grinstead & Snell, 2012). This constant can be interpreted as the mean number of steps it takes to get to any goal state weighted by the steady-distribution of the goal states. This weighted mean does not depend on the starting state, as mentioned just above. The constant uses a single number to summarize how “well-connected” a Markov chain is. It can also be shown that $\kappa ^ { \pi } = \operatorname { t r a c e } ( Z ^ { \pi } )$ (Grinstead & Snell, 2012). We then have the following result which connects the sensitivity of the stationary distribution to changes to the policy.
|
| 118 |
+
|
| 119 |
+
Lemma 3. The divergence between the stationary distributions $d _ { \pi }$ and $d _ { \pi ^ { \prime } }$ can be upper bounded by the average divergence between policies $\pi$ and $\pi ^ { \prime }$ as follows:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
D _ { T V } ( d _ { \pi ^ { \prime } } \parallel d _ { \pi } ) \le ( \kappa ^ { \pi ^ { \prime } } - 1 ) \underset { s \sim d _ { \pi } } { \mathbb { E } } [ D _ { T V } ( \pi ^ { \prime } \parallel \pi ) [ s ] ]
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
We wish to point out here that Achiam et al. (2017) showed a similar result to Lemma 3 in the discounted case where the change in $d _ { \pi , \gamma }$ can be bounded in terms of the change in policy up to a multiplicative constant which only depends on the discount factor. In the discounted case, this is possible since a discounted MDP is like a finite-horizon MDP problem; in fact, it can be shown to be equivalent to a related finite horizon problem (Proposition 5.3.1, Puterman (1994)). The discount factor can be used to control the effective horizon where larger discount factors correspond to longer horizons. In fact, it can be easily shown that the multiplicative factor from Achiam et al. (2017) goes to infinity as $\gamma 1$ , meaning that the bound is not useful for long horizon problems. In the average reward setting, the sensitivity of the stationary distribution with respect to the policy can vary depending on the chain structure and long-term behavior of the underlying Markov chain. This means that it is only natural that the multiplicative constant in Lemma 3 depends on the transition matrix.
|
| 126 |
+
|
| 127 |
+
This result is also highly intuitive, For very “well-connected” Markov chains where an agent can easily and quickly get to any state, this constant is relatively small and the stationary distributions are not sensitive to small changes in policy. On the other hand, for Markov chains that are “weakly connected,” where on average, it can take a long time to get to some recurrent state in the state space, the factor can become very large. In this case small changes in the policy can have a large impact on the resulting stationary distributions.
|
| 128 |
+
|
| 129 |
+
The following theorem connects the average reward performance of two policies and their average divergence.
|
| 130 |
+
|
| 131 |
+
Theorem 1. For any two stochastic policies $\pi$ and $\pi ^ { \prime }$ , the following bounds hold:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { \rho ( \pi ^ { \prime } ) - \rho ( \pi ) \le \underset { \underset { a \sim \pi } { a \sim \pi } } { \mathbb { E } } \left[ \frac { \pi ^ { \prime } ( a \vert s ) } { \pi ( a \vert s ) } A ^ { \pi } ( s , a ) \right] + 2 \xi \underset { s \sim d _ { \pi } } { \mathbb { E } } [ D _ { T V } ( \pi ^ { \prime } \parallel \pi ) [ s ] ] } \\ & { \rho ( \pi ^ { \prime } ) - \rho ( \pi ) \ge \underset { \underset { a \sim \pi } { s \sim d _ { \pi } } } { \mathbb { E } } \left[ \frac { \pi ^ { \prime } ( a \vert s ) } { \pi ( a \vert s ) } A ^ { \pi } ( s , a ) \right] - 2 \xi \underset { s \sim d _ { \pi } } { \mathbb { E } } [ D _ { T V } ( \pi ^ { \prime } \parallel \pi ) [ s ] ] } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $\begin{array} { r } { \xi = ( \kappa ^ { \pi ^ { \prime } } - 1 ) \operatorname* { m a x } _ { s } \mathbb { E } _ { a \sim \pi ^ { \prime } } | A ^ { \pi } ( s , a ) | . } \end{array}$ .
|
| 138 |
+
|
| 139 |
+
Proof. Combine the bounds from Lemma 2 and Lemma 3. Then rewrite the expectation for $A ^ { \pi } ( s , a )$ as an expectation w.r.t. $\pi$ using importance sampling gives us the desired bound. □
|
| 140 |
+
|
| 141 |
+
The right-hand-side of the bounds in Theorem 1 are guaranteed to be finite. Similar to the discounted case, the multiplicative factor $\xi$ provides a theoretical guidance on the step-sizes for policy updates (Schulman et al., 2015). The bound in Theorem 1 is given in terms of the TV divergence, however the KL divergence is more commonly used in practice. Vuong et al. (2019) compared various divergence measures and showed that the KL has superior empirical performance. The relationship between the TV divergence and KL divergence is given by Pinsker’s inequality (Tsybakov, 2008), which says that for any two distributions $p$ and $q$ : $\bar { D _ { \mathrm { T V } } } ( p \Vert \check { q } ) \leq \sqrt { D _ { \mathrm { K L } } \left( p \Vert q \right) / 2 }$ . We can then show that
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\begin{array} { r } { \underset { s \sim d _ { \pi } } { \mathbb { E } } [ D _ { \mathrm { T V } } ( \pi ^ { \prime } \parallel \pi ) [ s ] ] \leq \underset { s \sim d _ { \pi } } { \mathbb { E } } [ \sqrt { D _ { \mathrm { K L } } \left( \pi ^ { \prime } \parallel \pi \right) [ s ] / 2 } ] \leq \sqrt { \underset { s \sim d _ { \pi } } { \mathbb { E } } [ D _ { \mathrm { K L } } \left( \pi ^ { \prime } \parallel \pi \right) ] [ s ] ] / 2 } } \end{array}
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
where the second inequality comes from Jensen’s inequality. The inequality in (13) shows that the bounds in Theorem 1 still hold when $\mathbb { E } _ { s \sim d _ { \pi } } { \mathsf { \bar { [ } } } D _ { \mathrm { T V } } ( \pi ^ { \prime } \mathrm { \quad } \| \mathrm { \quad } \pi ) [ s ] ]$ is substituted with $\sqrt { \mathbb { E } _ { s \sim d _ { \pi } } [ D _ { \mathrm { K L } } \left( \pi ^ { \prime } \| \pi \right) ] [ s ] / 2 }$ .
|
| 148 |
+
|
| 149 |
+
# 4.2 APPROXIMATE POLICY ITERATION
|
| 150 |
+
|
| 151 |
+
One direct consequence of Theorem 1 is that iteratively maximizing the right-hand-side of (12) generates a monotonically improving sequence of policies w.r.t. the average reward objective. Algorithm 1 gives an approximate policy iteration algorithm that produces such a sequence of policies.
|
| 152 |
+
|
| 153 |
+
Proposition 2. Given an initial policy $\pi _ { 0 }$ , Algorithm $I$ is guaranteed to generate a sequence of policies $\pi _ { 1 } , \pi _ { 2 } , \ldots$ such that $\rho ( \pi _ { 0 } ) \le \rho ( \pi _ { 1 } ) \le \rho ( \pi _ { 2 } ) \le \cdot \cdot \cdot$ .
|
| 154 |
+
|
| 155 |
+
Proof. At iteration $k$ , $\mathbb { E } _ { s \sim d _ { \pi _ { k } } , a \sim \pi } [ A ^ { \pi _ { k } } ( s , a ) ] = 0$ , $\begin{array} { r } { \mathbb { E } _ { s \sim d _ { \pi _ { k } } } \left[ D _ { \mathrm { K L } } \left( \pi \| \pi _ { k } \right) [ s ] \right] = 0 } \end{array}$ for $\pi = \pi _ { k }$ . By Equation (14) and Theorem 1, $\rho ( \pi _ { k + 1 } ) - \rho ( \pi _ { k } ) \geq 0$ . □
|
| 156 |
+
|
| 157 |
+
# Algorithm 1 Approximate Policy Iteration for Average Reward Objective
|
| 158 |
+
|
| 159 |
+
# Initialize: $\pi _ { 0 }$
|
| 160 |
+
|
| 161 |
+
1: for $k = 0 , 1 , 2 , \ldots$ do
|
| 162 |
+
2: Policy evaluation step: evaluate $A ^ { \pi _ { k } } \left( s , a \right)$ for all $s , a$ .
|
| 163 |
+
3: Policy improvement step:
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\pi _ { k + 1 } = \underset { \pi } { \mathrm { a r g m a x } } \left( \underset { s \sim d _ { \pi _ { k } } } { \mathbb { E } } \left[ A ^ { \pi _ { k } } ( s , a ) \right] - \xi \sqrt { 2 \underset { s \sim d _ { \pi _ { k } } } { \mathbb { E } } \left[ D _ { \mathrm { K L } } \left( \pi \| \pi _ { k } \right) [ s ] \right] } \right)
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where $\begin{array} { r } { \xi = ( \kappa ^ { \pi } - 1 ) \operatorname* { m a x } _ { s } \mathbb { E } _ { a \sim \pi } \left| A ^ { \pi _ { k } } ( s , a ) \right| } \end{array}$
|
| 170 |
+
|
| 171 |
+
However, Algorithm 1 is difficult to implement in practice since it requires exact knowledge of the advantage function and transition matrix. Furthermore, calculating the term $\xi$ is impractical for high dimensional problems. In the next section, we will introduce a sample-based algorithm which approximates the update rule given in Equation (14).
|
| 172 |
+
|
| 173 |
+
# 5 PRACTICAL APPLICATIONS
|
| 174 |
+
|
| 175 |
+
As we have noted in the previous section, Algorithm 1 is not practical for problems with large state and action spaces and thus cannot be naïvely applied directly. In this section, we will discuss how Algorithm 1 and Theorem 1 can be used in practice to create algorithms which can effectively solve high dimensional DRL problems. In the Appendix C, we will also discuss how Theorem 1 can be used to solve DRL problems with safety constraints.
|
| 176 |
+
|
| 177 |
+
# 5.1 AVERAGE REWARD TRUST REGION POLICY OPTIMIZATION
|
| 178 |
+
|
| 179 |
+
For DRL problems, it is common to consider some parameterized policy class $\Pi _ { \Theta } \subseteq \Pi$ . Our goal is to devise a computationally tractable version of Algorithm 1 for policies in $\Pi _ { \Theta }$ , i.e., given a policy $\pi _ { \theta _ { k } }$ at iteration $k$ , how do we obtain the best possible $\pi _ { \boldsymbol { \theta } _ { k + 1 } }$ ? We can rewrite the unconstrained optimization problem in (14) as a constrained problem:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\mathop { \mathrm { m a x i m i z e } } _ { \pi _ { \theta } \in \Pi _ { \theta } } ~ \mathop { \mathbb { E } } _ { s \sim d _ { \pi _ { \theta _ { k } } } } ^ { \mathbb { E } } [ A ^ { \pi _ { \theta _ { k } } } ( s , a ) ] ~ \mathrm { s . t . } ~ \bar { D } _ { \mathrm { K L } } ( \pi _ { \theta } ~ \| ~ \pi _ { \theta _ { k } } ) \leq \delta
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
where $\bar { D } _ { \mathrm { K L } } ( \pi _ { \theta } \parallel \pi _ { \theta _ { k } } ) : = \mathbb { E } _ { s \sim d _ { \pi _ { \theta _ { k } } } } [ D _ { \mathrm { K L } } \left( \pi _ { \theta } \| \pi _ { \theta _ { k } } \right) [ s ] ]$ . The constraint set $\{ \pi _ { \theta } \in \Pi _ { \Theta } : \bar { D } _ { \mathrm { K L } } ( \pi _ { \theta } \ \parallel$ $\pi _ { \boldsymbol { \theta } _ { k } } ) \leq \delta \}$ is called the trust region set. This problem can be regarded as an average reward variant of TRPO from Schulman et al. (2015). Note that the advantage function in (15) is the average reward advantage function introduced in Section 2. When we set $\pi _ { \boldsymbol { \theta } _ { k + 1 } }$ to be the optimal solution to (15), $\pi _ { \boldsymbol { \theta } _ { k + 1 } }$ can be shown to have the following performance guarantee:
|
| 186 |
+
|
| 187 |
+
Proposition 3. Let $\pi _ { \boldsymbol { \theta } _ { k + 1 } }$ be the optimal solution to (15) for some $\pi _ { \theta _ { k } } \in \Pi _ { \Theta }$ . The policy performance difference between $\pi _ { \boldsymbol { \theta } _ { k + 1 } }$ and $\pi _ { \theta _ { k } }$ can be lower bounded by
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\begin{array} { r l } & { \rho ( \pi _ { \theta _ { k + 1 } } ) - \rho ( \pi _ { \theta _ { k } } ) \geq - \xi ^ { \pi _ { \theta _ { k + 1 } } } \sqrt { 2 \delta } } \\ & { \xi ^ { \pi _ { \theta _ { k + 1 } } } = \big ( \kappa ^ { \pi _ { \theta _ { k + 1 } } } - 1 \big ) \operatorname* { m a x } _ { s } \mathbb { E } _ { a \sim \pi _ { \theta _ { k + 1 } } } | A ^ { \pi _ { \theta _ { k } } } ( s , a ) | . } \end{array}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
Proof. Since $\bar { D } _ { \mathrm { K L } } ( \pi _ { \theta _ { k } } \parallel \pi _ { \theta _ { k } } ) = 0$ , $\pi _ { \theta _ { k } }$ is a feasible solution. The objective value is 0 for $\pi _ { \boldsymbol { \theta } } = \pi _ { \boldsymbol { \theta } _ { k } }$ The bound follows from (12) and (13) where the average KL is bounded by $\delta$ .
|
| 194 |
+
|
| 195 |
+
Several algorithms have been proposed for efficiently solving the discounted version of (15): Schulman et al. (2015) and Wu et al. (2017) converts (15) into a convex problem via Taylor approximations; another approach is to first solve (15) in the nonparametric policy space and then project the result back into the parameter space (Abdolmaleki et al., 2018; Vuong et al., 2019). These algorithms can be adapted for the average reward case and are theoretically justified via Theorem 1 and Proposition 3. One notable difference compared to the discounted case is the estimation of the critic, as discussed in the next section and in the Appendix D.
|
| 196 |
+
|
| 197 |
+
# 5.2 IMPLEMENTATION
|
| 198 |
+
|
| 199 |
+
In this section, we discuss how the average reward version of the TRPO algorithm (Schulman et al., 2015) — which we will refer to as ATRPO — can be implemented in practice. Algorithm 2 provides a basic outline of the ATRPO algorithm.
|
| 200 |
+
|
| 201 |
+
# Algorithm 2 Average Reward TRPO (ATRPO)
|
| 202 |
+
|
| 203 |
+
Initialize: Policy parameters $\theta _ { 0 }$ , value net parameters $\phi _ { 0 }$ , learning rate $\alpha$ .
|
| 204 |
+
1: for $k = 0 , 1 , 2 , \cdots$ do
|
| 205 |
+
2: 3: Collect a sampleCalculate sample jectory verage r $\{ s _ { t } , a _ { t } , s _ { t + 1 } , r _ { t } \} , t = 1 , \ldots , N$ rom the environment using . $\pi _ { \boldsymbol { \theta } _ { k } }$ . $\pi _ { \boldsymbol { \theta } _ { k } }$ $\begin{array} { r } { \rho = \frac { 1 } { N } \sum _ { t = 1 } ^ { N } r _ { t } } \end{array}$
|
| 206 |
+
4: 5: for $t = 1 , 2 , \ldots , N$ $V _ { t } ^ { \mathrm { t a r g e t } } = r _ { t } - \rho + V _ { \phi _ { k } } ( s _ { t + 1 } )$
|
| 207 |
+
6: Get advantage estimate $\hat { A } ( s _ { t } , a _ { t } ) = r _ { t } - \rho + V _ { \phi _ { k } } ( s _ { t + 1 } ) - V _ { \phi _ { k } } ( s _ { t } )$
|
| 208 |
+
7: Update critic by $\phi _ { k + 1 } \phi _ { k } - \alpha \nabla _ { \phi } \mathcal { L } ( \phi _ { k } )$ where $\mathcal { L } ( \phi _ { k } ) = \frac { 1 } { 2 } \sum _ { t = 1 } ^ { N } \left. V _ { \phi _ { k } } ( s _ { t } ) - V _ { t } ^ { \mathrm { t a r g e t } } \right. ^ { 2 }$
|
| 209 |
+
|
| 210 |
+
8: Use $\hat { A } ( s _ { t } , a _ { t } )$ to update $\theta _ { k }$ using TRPO policy update (Schulman et al., 2015).
|
| 211 |
+
|
| 212 |
+
The major difference between the TRPO algorithm and the ATRPO algorithm is how the target for the critic and the advantage function are calculated. Importantly, simply letting $\gamma 1$ in TRPO does not lead to Algorithm 2. This subtle but important difference leads to a significant improvement in sample efficiency, as shown in the section on experimental results.
|
| 213 |
+
|
| 214 |
+
In Algorithm 2, for illustrative purposes, we use the average reward one-step bootstrapped estimate for the target of the critic and the advantage function. In practice, we instead use an average reward version of the Generalized Advantage Estimator (GAE) from Schulman et al. (2016). In short, GAE uses a tunable eligibility trace parameter $\lambda$ to act as a trade-off between the Monte Carlo estimate and the bootstrapped estimate. In the Appendix D we provide more detail on how GAE can be generalized to the average reward case.
|
| 215 |
+
|
| 216 |
+
# 6 RELATED WORK
|
| 217 |
+
|
| 218 |
+
Dynamic programming algorithms for finding the optimal average reward policies have been wellstudied (Howard, 1960; Blackwell, 1962; Veinott, 1966). In contrary to our method which is based on the policy gradient approach, several Q-learning-like algorithms for problems with unknown dynamics have been proposed, such as R-Learning (Schwartz, 1993), RVI Q-Learning (Abounadi et al., 2001), and CSV-Learning (Yang et al., 2016). Mahadevan (1996) conducted a thorough empirical analysis of the R-Learning algorithm. We note that much of the previous work on average reward RL focuses on the tabular setting without function approximations, and the theoretical properties of many of these Q-learning-based algorithm are not well understood (in particular R-learning). More recently, POLITEX updates policies using a Boltzmann distribution over the sum of action-value function estimates of the previous policies (Abbasi-Yadkori et al., 2019) and Wei et al. (2020) introduced a model-free algorithm for optimizing the average reward of weakly-communicating MDPs. Both methods are shown to have theoretical guarantees under the tabular setting.
|
| 219 |
+
|
| 220 |
+
For policy gradient methods, Baxter & Bartlett (2001) showed that if $1 / ( 1 - \gamma )$ is large compared to the mixing time of the Markov Chain induced by the MDP, then the gradient of $\rho _ { \gamma } ( \pi )$ can accurately approximate the gradient of $\rho ( \pi )$ . Kakade (2001) extended upon this result and provided an error bound on using an optimal discounted policy to maximize the average reward. In contrast, our work directly deals with using policy gradient methods for the average reward objective and provides theoretical guidance on the optimal step size for each policy update.
|
| 221 |
+
|
| 222 |
+
Policy improvement bounds have been extensively explored in the discounted case. The results from Schulman et al. (2015) is an extension of Kakade & Langford (2002) which restricted the policy class to a mixture of policies. Pirotta et al. (2013) also proposed an alternative generalization to Kakade & Langford (2002). Achiam et al. (2017) improved upon Schulman et al. (2015) by replacing the maximum divergence with the average divergence.
|
| 223 |
+
|
| 224 |
+
# 7 EXPERIMENTS
|
| 225 |
+
|
| 226 |
+
Recently, DRL algorithms such as TRPO have proven to be successful for episodic high-dimensional tasks. In our experiments, we wish to study whether for continuing-control tasks, the policy trained with ATRPO can out-perform the policies trained with TRPO with different discount factors.
|
| 227 |
+
|
| 228 |
+
Our design goal for the experiments is to simulate continuing-control tasks where the agent can interact with the environment indefinitely. We consider three tasks (Ant, HalfCheetah, and Humanoid) from the MuJoCo physical simulator (Todorov et al., 2012) implemented in the OpenAI gym (Brockman et al., 2016). The natural goal is to train the agents to run as fast as possible without falling. However the standard MuJoCo tasks are episodic tasks which terminate when the agent falls. We convert these tasks into continuing control tasks via the following: when the agent falls, the agent incurs a large cost for falling, but then continues the trajectory from a random start state. We use these continuing-control tasks for both training and evaluation for both ATRPO and TRPO. More details on the environment can be found in Appendix F.
|
| 229 |
+
|
| 230 |
+
One point we wish to emphasize regarding the experiments is that even though the MuJoCo benchmark is commonly trained using the discounted objective (see e.g. Schulman et al. (2015), Wu et al. (2017), Schulman et al. (2017), Abdolmaleki et al. (2018), Vuong et al. (2019)), it is always evaluated using the undiscounted objective. This is because the undiscounted objective more naturally describes the goals of the MuJoCo agents (e.g., an agent’s performance w.r.t. the reward signal should be equally important at time step 1000 as it is at time step 1). In the case of TRPO (and similarly many other DRL algorithms), discounting is used during training often for mathematical and computational convenience. Prior to our work, there has been no theoretical or empirical evidence to support applying trust region methods to the average reward. In this section, we demonstrate that when the actual objective we want to evaluate is undiscounted, discounting, as is commonly done, is unnecessary and may lead to suboptimal performance.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 1: Learning curves comparing ATRPO and TRPO with different discount factors. The solid lines represent the average reward of trajectories of fixed length of 10,000 time steps averaged over the last 50 trajectories. The results are averaged over 10 random seeds and the shaded region represents one standard deviation.
|
| 234 |
+
|
| 235 |
+
During training, we collect one trajectory of a fixed length of 10,000 using the current policy.1 We then use this data to update the critic and policy networks (see Algorithm 2). This gives us a new policy and critic which we then use to repeat the above process. In Figure 1, we plot the training curves of ATRPO and of TRPO for different discount factors. Detailed specifications and hyperparameter settings can be found in Appendix F.
|
| 236 |
+
|
| 237 |
+
Figure 1 shows that ATRPO improves performance by $5 . 0 \%$ , $3 2 . 8 \%$ , $2 6 . 7 \%$ on HalfCheetah, Ant and Humanoid respectively over TRPO with its best discount factors. One point worth noting is that increasing the discount factor does not necessarily lead to better performance of TRPO. A larger discount factor in principle enables the algorithm to seek a policy that performs well for the average-reward criterion. But, unfortunately, a larger discount factor can also increase the variance of the gradient estimator (Zhao et al., 2011; Schulman et al., 2016) and degrade generalization (Amit et al., 2020). Moreover, algorithms with discounting become unstable as $\gamma 1$ (Naik et al., 2019). The discount factor therefore serves as a hyperparameter which can be tuned to improve performance. This is supported by the observation that the optimal discount factor is different for each environment (0.999, 0.99, 0.95 for HalfCheetah, Ant, and Humanoid respectively), where choosing a suboptimal discount factor can have significant consequences. (For Ant and Humanoid, the optimal discount factor is $3 3 . 9 \%$ and $6 5 . 6 \%$ better than the second best discount factor.) We have shown here that using the average reward criterion not only delivers superior performance but also obviates the need to tune the discount factor.
|
| 238 |
+
|
| 239 |
+
To further support our conclusion, we will also compare ATRPO and TRPO using an alternative evaluation protocol. In this protocol, after every one million samples of training we run 10 separate evaluation trajectories of fixed length 10,000 time steps using the current policy with no exploration. The random seeds used for evaluation are different from those used in training. Figure 2 shows the average reward of these trajectories, Once again ATRPO provides superior performance.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 2: Comparing performance on evaluation trajectories of length 10,000. For each random seed used in training, we use a different unseen random seed to run 10 test trajectories after every 1 million samples of training. The solid line is averaged over these unseen random seeds. The shaded area is one standard deviation.
|
| 243 |
+
|
| 244 |
+
# 8 CONCLUSION
|
| 245 |
+
|
| 246 |
+
In this paper, we introduced a novel policy improvement bound for the average reward criterion. The bound is based on the average divergence between two policies and Kemeny’s constant. We showed that previous existing policy improvement bounds for the discounted case results in a non-meaningful bound for the average reward objective. Our work provided the theoretical justification and the means to generalize the popular trust-region based algorithms to the average reward setting. We demonstrated through a series of experiments that our method is highly effective on high-dimensional continuing control tasks. In particular, we showed that when the natural objective of the task is undiscounted, discounting can lead to suboptimal behavior. To the best of our knowledge, we are one of the first to address how DRL methods can be used to learn undiscounted continuing control tasks with large state and action spaces.
|
| 247 |
+
|
| 248 |
+
# REFERENCES
|
| 249 |
+
|
| 250 |
+
Yasin Abbasi-Yadkori, Peter Bartlett, Kush Bhatia, Nevena Lazic, Csaba Szepesvari, and Gellért Weisz. Politex: Regret bounds for policy iteration using expert prediction. In International Conference on Machine Learning, pp. 3692–3702, 2019.
|
| 251 |
+
|
| 252 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. International Conference on Learning Representation (ICLR), 2018.
|
| 253 |
+
|
| 254 |
+
Jinane Abounadi, D Bertsekas, and Vivek S Borkar. Learning algorithms for markov decision processes with average cost. SIAM Journal on Control and Optimization, 40(3):681–698, 2001.
|
| 255 |
+
|
| 256 |
+
Joshua Achiam. UC Berkeley CS 285 (Fall 2017), Advanced Policy Gradients, 2017. URL: http://rail.eecs.berkeley.edu/deeprlcourse-fa17/f17docs/ lecture_13_advanced_pg.pdf. Last visited on 2020/05/24.
|
| 257 |
+
|
| 258 |
+
Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 22–31. JMLR. org, 2017.
|
| 259 |
+
|
| 260 |
+
David Aldous and James Fill. Reversible markov chains and random walks on graphs, 1995.
|
| 261 |
+
|
| 262 |
+
Eitan Altman. Constrained Markov decision processes, volume 7. CRC Press, 1999.
|
| 263 |
+
|
| 264 |
+
Ron Amit, Ron Meir, and Kamil Ciosek. Discount factor as a regularizer in reinforcement learning. In International conference on machine learning, 2020.
|
| 265 |
+
|
| 266 |
+
Jonathan Baxter and Peter L Bartlett. Infinite-horizon policy-gradient estimation. Journal of Artificial Intelligence Research, 15:319–350, 2001.
|
| 267 |
+
|
| 268 |
+
Dimitri P Bertsekas, Dimitri P Bertsekas, Dimitri P Bertsekas, and Dimitri P Bertsekas. Dynamic programming and optimal control, volume 1,2. Athena scientific Belmont, MA, 1995.
|
| 269 |
+
|
| 270 |
+
David Blackwell. Discrete dynamic programming. The Annals of Mathematical Statistics, pp. 719–726, 1962.
|
| 271 |
+
|
| 272 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 273 |
+
|
| 274 |
+
Grace E Cho and Carl D Meyer. Comparison of perturbation bounds for the stationary distribution of a markov chain. Linear Algebra and its Applications, 335(1-3):137–150, 2001.
|
| 275 |
+
|
| 276 |
+
Eyal Even-Dar, Sham M Kakade, and Yishay Mansour. Online markov decision processes. Mathematics of Operations Research, 34(3):726–736, 2009.
|
| 277 |
+
|
| 278 |
+
Charles Miller Grinstead and James Laurie Snell. Introduction to probability. American Mathematical Soc., 2012.
|
| 279 |
+
|
| 280 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. International Conference on Machine Learning (ICML), 2018.
|
| 281 |
+
|
| 282 |
+
Roger A Horn and Charles R Johnson. Matrix analysis. Cambridge university press, 2012.
|
| 283 |
+
|
| 284 |
+
Ronald A Howard. Dynamic programming and markov processes. John Wiley, 1960.
|
| 285 |
+
|
| 286 |
+
Jeffrey J Hunter. Stationary distributions and mean first passage times of perturbed markov chains. Linear Algebra and its Applications, 410:217–243, 2005.
|
| 287 |
+
|
| 288 |
+
Sham Kakade. Optimizing average reward using discounted rewards. In International Conference on Computational Learning Theory, pp. 605–615. Springer, 2001.
|
| 289 |
+
|
| 290 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In International Conference on Machine Learning, volume 2, pp. 267–274, 2002.
|
| 291 |
+
|
| 292 |
+
L.C.M. Kallenberg. Linear Programming and Finite Markovian Control Problems. Centrum Voor Wiskunde en Informatica, 1983.
|
| 293 |
+
|
| 294 |
+
J.G. Kemeny and I.J. Snell. Finite Markov Chains. Van Nostrand, New Jersey, 1960.
|
| 295 |
+
|
| 296 |
+
Erich L Lehmann and George Casella. Theory of point estimation. Springer Science & Business Media, 2006.
|
| 297 |
+
|
| 298 |
+
Sridhar Mahadevan. Average reward reinforcement learning: Foundations, algorithms, and empirical results. Machine learning, 22(1-3):159–195, 1996.
|
| 299 |
+
|
| 300 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. NIPS Deep Learning Workshop, 2013.
|
| 301 |
+
|
| 302 |
+
Abhishek Naik, Roshan Shariff, Niko Yasui, and Richard S Sutton. Discounted reinforcement learning is not an optimization problem. NeurIPS Optimization Foundations for Reinforcement Learning Workshop, 2019.
|
| 303 |
+
|
| 304 |
+
Gergely Neu, Andras Antos, András György, and Csaba Szepesvári. Online markov decision processes under bandit feedback. In Advances in Neural Information Processing Systems, pp. 1804–1812, 2010.
|
| 305 |
+
|
| 306 |
+
Jan Peters and Stefan Schaal. Reinforcement learning of motor skills with policy gradients. Neural networks, 21(4):682–697, 2008.
|
| 307 |
+
|
| 308 |
+
Matteo Pirotta, Marcello Restelli, Alessio Pecorino, and Daniele Calandriello. Safe policy iteration. In International Conference on Machine Learning, pp. 307–315, 2013.
|
| 309 |
+
|
| 310 |
+
Martin L Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, 1994.
|
| 311 |
+
|
| 312 |
+
Keith W Ross. Constrained markov decision processes with queueing applications. Dissertation Abstracts International Part B: Science and Engineering[DISS. ABST. INT. PT. B- SCI. & ENG.],, 46(4), 1985.
|
| 313 |
+
|
| 314 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015.
|
| 315 |
+
|
| 316 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. International Conference on Learning Representations (ICLR), 2016.
|
| 317 |
+
|
| 318 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 319 |
+
|
| 320 |
+
Anton Schwartz. A reinforcement learning method for maximizing undiscounted rewards. In Proceedings of the tenth international conference on machine learning, volume 298, pp. 298–305, 1993.
|
| 321 |
+
|
| 322 |
+
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, 2016.
|
| 323 |
+
|
| 324 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140–1144, 2018.
|
| 325 |
+
|
| 326 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 327 |
+
|
| 328 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
|
| 329 |
+
|
| 330 |
+
Chen Tessler, Daniel J Mankowitz, and Shie Mannor. Reward constrained policy optimization. International Conference on Learning Representation (ICLR), 2019.
|
| 331 |
+
|
| 332 |
+
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.
|
| 333 |
+
|
| 334 |
+
Alexandre B Tsybakov. Introduction to nonparametric estimation. Springer Science & Business Media, 2008.
|
| 335 |
+
|
| 336 |
+
Arthur F Veinott. On finding optimal policies in discrete dynamic programming with no discounting. The Annals of Mathematical Statistics, 37(5):1284–1294, 1966.
|
| 337 |
+
|
| 338 |
+
Quan Vuong, Yiming Zhang, and Keith W Ross. Supervised policy update for deep reinforcement learning. In International Conference on Learning Representation (ICLR), 2019.
|
| 339 |
+
|
| 340 |
+
Chen-Yu Wei, Mehdi Jafarnia-Jahromi, Haipeng Luo, Hiteshi Sharma, and Rahul Jain. Modelfree reinforcement learning in infinite-horizon average-reward markov decision processes. In International conference on machine learning, 2020.
|
| 341 |
+
|
| 342 |
+
Yuhuai Wu, Elman Mansimov, Roger B Grosse, Shun Liao, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. In Advances in neural information processing systems (NIPS), pp. 5285–5294, 2017.
|
| 343 |
+
|
| 344 |
+
Shangdong Yang, Yang Gao, Bo An, Hao Wang, and Xingguo Chen. Efficient average reward reinforcement learning using constant shifting values. In AAAI, pp. 2258–2264, 2016.
|
| 345 |
+
|
| 346 |
+
Yiming Zhang, Quan Vuong, and Keith Ross. First order constrained optimization in policy space.
|
| 347 |
+
Advances in Neural Information Processing Systems, 33, 2020.
|
| 348 |
+
|
| 349 |
+
Tingting Zhao, Hirotaka Hachiya, Gang Niu, and Masashi Sugiyama. Analysis and improvement of policy gradient estimation. In Advances in Neural Information Processing Systems, pp. 262–270, 2011.
|
md/train/n6jl7fLxrP/n6jl7fLxrP.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/r1VPNiA5Fm/r1VPNiA5Fm.md
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE UNIVERSAL APPROXIMATION POWER OF FINITEWIDTH DEEP RELU NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We show that finite-width deep ReLU neural networks yield rate-distortion optimal approximation (Bolcskei et al., 2018) of a wide class of functions, includ- ¨ ing polynomials, windowed sinusoidal functions, one-dimensional oscillatory textures, and the Weierstrass function, a fractal function which is continuous but nowhere differentiable. Together with the recently established universal approximation result for affine function systems (Bolcskei et al., 2018), this demonstrates ¨ that deep neural networks approximate vastly different signal structures generated by the affine group, the Weyl-Heisenberg group, or through warping, and even certain fractals, all with approximation error decaying exponentially in the number of neurons. We also prove that in the approximation of sufficiently smooth functions finite-width deep networks require strictly fewer neurons than finite-depth wide networks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
A theory establishing a link between the complexity of a neural network and the complexity of the function class to be approximated by the network was recently developed in Bolcskei et al. (2018). ¨ Based on this framework, it was shown (Bolcskei et al., 2018) that all affine function classes are opti- ¨ mally representable by neural networks in the sense of Kolmogorov rate-distortion theory (Donoho, 1993; Grohs, 2015). Equivalently, this means that the approximation error decays exponentially in the number of neurons employed in the approximation.
|
| 12 |
+
|
| 13 |
+
The present paper explores the question of whether the universality result established in Bolcskei¨ et al. (2018) extends beyond affine function classes and answers it in the affirmative. Specifically, we consider the approximation of polynomials, windowed sinusoidal functions (Grochenig & Samarah, ¨ 2000; Grochenig, 2001), one-dimensional oscillatory textures according to Demanet & Ying (2007), ¨ and the Weierstrass function, a fractal function which is continuous everywhere and differentiable nowhere. The central conclusion of this paper is that finite-width ReLU networks of depth scaling poly-logarithmically in the inverse of the approximation error lead to exponentially decaying approximation error for all these different signal structures. This result is established by building on a recent breakthrough in Yarotsky (2016) and recognizing that the width of networks approximating polynomials need not scale linearly in the degree of the polynomial, but can actually be finite independently of the degree. This insight will also allow a sharp statement on the benefit of depth; specifically, we prove that in the approximation of sufficiently smooth functions finite-width deep networks require strictly fewer neurons than finite-depth wide networks.
|
| 14 |
+
|
| 15 |
+
Notation. For the function $f ( \boldsymbol { x } ) \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ , we define $\| f \| _ { L ^ { \infty } ( \Omega ) } : = \operatorname* { i n f } \{ C \geq 0 : | f ( x ) | \leq$ $C$ , for all $x \in \Omega \}$ . For a vector $b \in \mathbb { R } ^ { d }$ , we let $\left\| b \right\| _ { \infty } : = \operatorname* { m a x } _ { i = 1 , \ldots , d } \left| b _ { i } \right|$ , similarly we write $\left\| A \right\| _ { \infty } : = \operatorname* { m a x } _ { i , j } \left| A _ { i , j } \right|$ for the matrix $A \in \mathbb { R } ^ { m \times n }$ . We denote the identity matrix of size $n \times n$ by $\mathbb { I } _ { n }$ . Throughout, log stands for the logarithm to base 2.
|
| 16 |
+
|
| 17 |
+
# 2 SETUP AND BASIC RELU CALCULUS
|
| 18 |
+
|
| 19 |
+
We start by defining ReLU neural networks.
|
| 20 |
+
|
| 21 |
+
Definition 2.1. Let $L , N _ { 0 } , N _ { 1 } , \dots , N _ { L } \in \mathbb { N } .$ . A map $\Phi : \mathbb { R } ^ { N _ { 0 } } \mathbb { R } ^ { N _ { L } }$ given by
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
\Phi ( x ) = \left\{ \begin{array} { l l } { W _ { 2 } ( \rho ( W _ { 1 } ( x ) ) ) , } & { L = 2 } \\ { W _ { L } ( \rho ( W _ { L - 1 } ( \rho ( . . . \rho ( W _ { 1 } ( x ) ) ) ) ) ) , } & { L \geq 3 } \end{array} \right. ,
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
with affine linear maps $W _ { \ell } : \mathbb { R } ^ { N _ { \ell - 1 } } \to \mathbb { R } ^ { N _ { \ell } }$ , $\ell \in \{ 1 , 2 , \ldots , L \}$ , and the ReLU activation function $\rho ( x ) = \mathrm { m a x } ( x , 0 )$ , $x \in \mathbb { R } .$ , acting component-wise (i.e., $\rho ( x _ { 1 } , \cdot \cdot \cdot , x _ { N } ) : = ( \rho ( x _ { 1 } ) , \cdot \cdot \cdot , \rho ( x _ { N } ) ) ;$ i s called a ReLU neural network. The map $W _ { \ell }$ corresponding to layer $\ell$ is given by $W _ { \ell } ( x ) = A _ { \ell } x + b _ { \ell } .$ , with $A _ { \ell } \in \mathbb { R } ^ { N _ { \ell } \times N _ { \ell - 1 } }$ and $b _ { \ell } \in \mathbb { R } ^ { N _ { \ell } }$ . We define the network connectivity as the total number of nonzero entries in the matrices $A _ { \ell }$ , $\ell \in \{ 1 , 2 , \ldots , L \}$ , and the vectors $b _ { \ell }$ , $\ell \in \{ 1 , 2 , \ldots , L \}$ . The depth of the network or, equivalently, the number of layers is ${ \mathcal { L } } ( \Phi ) : = L$ and its width $\mathcal { W } ( \Phi ) : =$ $\mathrm { m a x } _ { \ell = 0 , \ldots , L } N _ { \ell }$ . We further denote by $\begin{array} { r } { B ( \Phi ) : = \operatorname* { m a x } _ { \ell = 1 , \ldots , L } \operatorname* { m a x } \{ \| A _ { \ell } \| _ { \infty } , \| b _ { \ell } \| _ { \infty } \} } \end{array}$ the maximum absolute value of the weights in the network.
|
| 28 |
+
|
| 29 |
+
We designate the class of ReLU networks $\Phi : \mathbb { R } ^ { d } \mathbb { R } ^ { N _ { L } }$ with no more than $L$ layers, width no more than $M$ , input dimension $d$ , and output dimension $N _ { L }$ by $\mathcal { N N } _ { L , M , d , N _ { L } }$ . Note that the connectivity of $\Phi$ is upper-bounded by $L M ( M + 1 )$ .
|
| 30 |
+
|
| 31 |
+
For later use we record three technical results. We first record a technical lemma on the composition of neural networks.1
|
| 32 |
+
|
| 33 |
+
Lemma 2.2. Let $L _ { 1 } , L _ { 2 } , M _ { 1 } , M _ { 2 } , d _ { 1 } , d _ { 2 } , N _ { L _ { 1 } } , N _ { L _ { 2 } } \quad \in \quad \mathbb { N }$ , $\Phi _ { 1 }$ ∈ $\mathcal { N N } _ { L _ { 1 } , M _ { 1 } , d _ { 1 } , N _ { L _ { 1 } } }$ , and $\begin{array} { r l r } { \Phi _ { 2 } } & { { } \in } & { \mathcal { N } \mathcal { N } _ { L _ { 2 } , M _ { 2 } , d _ { 2 } , N _ { L _ { 2 } } } } \end{array}$ with $\begin{array} { r l r } { N _ { L _ { 1 } } } & { { } = } & { d _ { 2 } } \end{array}$ . Then, there exists $a$ network $\Psi \in \mathcal { N } \mathcal { N } _ { L _ { 1 } + L _ { 2 } , \operatorname* { m a x } \left\{ 2 N _ { L _ { 1 } } , M _ { 1 } , M _ { 2 } \right\} , d _ { 1 } , N _ { L _ { 2 } } }$ with $B ( \Psi ) = \operatorname* { m a x } \{ B ( \Phi _ { 1 } ) , B ( \Phi _ { 2 } ) \}$ , satisfying $\Psi ( x ) =$ $\Phi _ { 2 } ( \Phi _ { 1 } ( x ) )$ , for all $\boldsymbol { x } \in \mathbb { R } ^ { d _ { 1 } }$ .
|
| 34 |
+
|
| 35 |
+
Before we can formalize the concept of a linear combination of neural networks, we need a result that shows how to augment network depth while retaining the networks input-output relation
|
| 36 |
+
|
| 37 |
+
Lemma 2.3. Let $L , M , K , d \in \mathbb { N }$ , $\Phi _ { 1 } \in \mathcal { N } \mathcal { N } _ { L , M , d , 1 } ,$ , and $K > L$ . Then, there exists a corresponding network $\Phi _ { 2 } \in \mathcal { N N } _ { K , \operatorname* { m a x } \{ 2 , M \} , d , 1 }$ such that $\Phi _ { 2 } ( x ) = \Phi _ { 1 } ( x )$ for all $x \in \mathbb { R } ^ { d }$ . Moreover, the weights of $\Phi _ { 2 }$ consist of the weights of $\Phi _ { 1 }$ and $\pm 1 3 .$ .
|
| 38 |
+
|
| 39 |
+
The next result formalizes the concept of a linear combination of neural networks.
|
| 40 |
+
|
| 41 |
+
Lemma 2.4. Let $N , L _ { i } , M _ { i } , d _ { i } \in \mathbb { N } ,$ , $a _ { i } \in \mathbb { R } ,$ , $\Phi _ { i } \in \mathcal { N N } _ { L _ { i } , M _ { i } , d _ { i } , 1 }$ , $\begin{array} { r } { i = { 1 , 2 , \dots , N } , d = \sum _ { i = 1 } ^ { N } d _ { i } . } \end{array}$ ks sa $\Phi ^ { 1 } \in \mathcal { N } \mathcal { N } _ { L , M , d , N }$ and $\Phi ^ { 2 } \in \mathcal { N } \mathcal { N } _ { L , M , d , 1 }$ with $L = { \operatorname* { m a x } } _ { i } L _ { i }$ , and $\begin{array} { r } { M \leq \sum _ { i = 1 } ^ { N } \operatorname* { m a x } \{ 2 , M _ { i } \} } \end{array}$
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { l l l } { \Phi ^ { 1 } ( x ) = ( \Phi _ { 1 } ( x _ { 1 } ) } & { \Phi _ { 2 } ( x _ { 2 } ) } & { \dots } & { \Phi _ { N } ( x _ { N } ) ) ^ { T } \quad \mathrm { a n d } } \\ { \Phi ^ { 2 } ( x ) = \displaystyle \sum _ { i = 1 } ^ { N } a _ { i } \Phi _ { i } ( x _ { i } ) , } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
for all $x = ( x _ { 1 } ^ { T } , x _ { 2 } ^ { T } , \ldots , x _ { N } ^ { T } ) ^ { T } \in \mathbb { R } ^ { d }$ with $x _ { i } \in \mathbb { R } ^ { d _ { i } }$ , $i = 1 , 2 , \ldots , N .$ . Moreover, the weights of $\Phi ^ { 1 }$ consist of the weights of the networks $\Phi _ { i }$ , $i = 1 , 2 , \dots , N$ , and $\pm 1$ ’s. The weights of $\Phi ^ { 2 }$ consist of the weights of $\Phi ^ { 1 }$ and $\{ a _ { 1 } , a _ { 2 } , . . . , a _ { N } \}$ .
|
| 48 |
+
|
| 49 |
+
Remark 2.5. Note that if the networks $\Phi _ { i }$ in Lemma 2.4 have shared inputs, the resulting networks $\Phi ^ { 1 }$ and $\Phi ^ { 2 }$ will have fewer than $\begin{array} { r } { d = \sum _ { i = 1 } ^ { N } d _ { i } } \end{array}$ inputs.
|
| 50 |
+
|
| 51 |
+
# 3 APPROXIMATION OF POLYNOMIALS
|
| 52 |
+
|
| 53 |
+
This section shows how the multiplication operation and polynomials can be approximated to within error $\epsilon$ with ReLU networks of finite width and of depth poly-logarithmic in $1 / \epsilon$ . We also note that the approximation results throughout the paper guarantee that the magnitude of the weights in the network does not grow faster than polynomially in the size of the domain over which approximation takes place. Although not shown here for space constraints, the combination of finite width, depth scaling poly-logarithmically in $1 / \epsilon$ , and weights growing no faster than polynomially guarantees rate-distortion optimality in the sense of Bolcskei et al. (2018) and hence exponential error decay. ¨ Previous results on the approximation of the multiplication operation and of polynomials through finite-width ReLU networks reported in Hanin & Sellke (2017); Yarotsky (2018) do not come with bounds on the network weights, have depth scaling polynomially in $1 / \epsilon$ , and therefore do not allow to conclude rate-distortion optimality.
|
| 54 |
+
|
| 55 |
+
The proof ideas for the results in this section are inspired by Yarotsky (2016) and by the “sawtooth” construction of Telgarsky (2015). In contrast to Yarotsky (2016), we consider networks without “skip connections” and of finite and explicitly specified width. Before starting with the approximation of $x ^ { 2 }$ , we note that all our results apply to the multivariate case as well, but we restrict ourselves to the univariate case for simplicity of exposition.
|
| 56 |
+
|
| 57 |
+
Proposition 3.1. There exists a constant $C > 0$ such that for all $\epsilon \in ( 0 , 1 / 2 )$ there is a network $\Phi _ { \epsilon } \bar { \in } \mathcal { N N } _ { \infty , 4 , 1 , 1 }$ satisfying $\begin{array} { r } { \mathcal L ( \Phi _ { \epsilon } ) \leq C \log ( \epsilon ^ { - 1 } ) , \mathcal B ( \Phi _ { \epsilon } ) \leq 4 , \Phi _ { \epsilon } ( 0 ) = 0 , } \end{array}$ and
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\| \Phi _ { \epsilon } ( x ) - x ^ { 2 } \| _ { L ^ { \infty } ( [ 0 , 1 ] ) } \leq \epsilon .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
With Proposition 3.1 we are now ready to show how ReLU networks can approximate the multiplication operation, which will then lead us to the approximation of arbitrary powers of $x$ .
|
| 64 |
+
|
| 65 |
+
Proposition 3.2. There exists a constant $C > 0$ such that for all $D \in \mathbb { R } _ { + }$ and $\epsilon \in ( 0 , 1 / 2 )$ there is $a$ network $\Phi _ { D , \epsilon } \in \mathcal { N } \mathcal { N } _ { \infty , 1 2 , 2 , 1 }$ satisfying $\mathcal { L } ( \Phi _ { D , \epsilon } ) \leq C \log ( \lceil D \rceil ^ { 2 } \epsilon ^ { - 1 } ) , \ : \dot { \mathcal { B } } ( \Phi _ { D , \epsilon } ) \leq \operatorname* { m a x } \{ 4 , 2 \lceil D \rceil ^ { 2 } \} ,$ ,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\| \Phi _ { D , \epsilon } ( x , y ) - x y \| _ { L ^ { \infty } ( [ - D , D ] ^ { 2 } ) } \leq \epsilon ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
and $\Phi _ { D , \epsilon } ( 0 , x ) = \Phi _ { D , \epsilon } ( x , 0 ) = 0 ,$ , for all $x \in \mathbb { R }$ .
|
| 72 |
+
|
| 73 |
+
The next result establishes that arbitrary polynomials can be approximated by ReLU networks of finite and explicitly specified width and of depth growing logarithmically in the inverse of the approximation error. In particular, the width of the approximating network does not grow with the degree of the polynomial as is the case in Yarotsky (2016), Ding et al. (2018), Liang & Srikant (2017). This finite-width aspect is central to the approximation of sinusoidal functions by ReLU networks as described in the next section.
|
| 74 |
+
|
| 75 |
+
Proposition 3.3. There exists a constant $C > 0$ such that for all $m \in \mathbb { N } ,$ , $A \in \mathbb { R } _ { + }$ , $p _ { m } ( x ) =$ $\textstyle \sum _ { i = 0 } ^ { m } a _ { i } x ^ { i }$ with $\begin{array} { r } { \operatorname* { m a x } _ { i = 0 , \ldots , m } \left| a _ { i } \right| = A _ { \ i } } \end{array}$ , $D \in \mathbb { R } _ { + }$ , and $\epsilon \in ( 0 , 1 / 2 )$ , there is a network $\Phi _ { p _ { m } , D , \epsilon } \in$ $\mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ satisfying $\begin{array} { r c l } { \mathcal { L } ( \Phi _ { p _ { m } , D , \epsilon } ) } & { \leq } & { C m ( \log ( \lceil A \rceil ) + \log ( \epsilon ^ { - 1 } ) + m \log ( \lceil D \rceil ) + \log ( m ) ) } \end{array}$ , $B ( \Phi _ { p _ { m } , D , \epsilon } ) \leq \operatorname* { m a x } \{ A , 8 \lceil D \rceil ^ { 2 m - 2 } \}$ , and
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\| \Phi _ { p _ { m } , D , \epsilon } - p _ { m } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \epsilon .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Proof. We start by noting that for $m = 1$ the resulting affine function $p _ { 1 } ( x ) = a _ { 0 } + a _ { 1 } x$ can be realized exactly, i.e., with $\epsilon = 0$ , by a network of depth $L = 2$ with
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
W _ { 1 } ( x ) = \left( { { a _ { 1 } } \atop - { a _ { 1 } } } \right) x + \left( { { a _ { 0 } } \atop - { a _ { 0 } } } \right)
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
and $A _ { 2 } = { ( 1 \ - 1 ) } , b _ { 2 } = 0$ . The proof for $m \geq 2$ will be effected by realizing the monomials $x ^ { k } , k \geq$ 2, through iterative composition of multiplication networks and combining this with a construction which uses the network realizing $x ^ { k }$ not only as a building block in the network realizing $x ^ { k + 1 }$ but also to construct the network approximating the partial sum $\textstyle \sum _ { i = 0 } ^ { k } a _ { i } x ^ { i }$ in parallel.
|
| 88 |
+
|
| 89 |
+
We start by setting $\begin{array} { r } { H _ { D , \eta } ^ { k } : = \lceil D \rceil ^ { k } + \eta \sum _ { s = 0 } ^ { k - 2 } \lceil D \rceil ^ { s } } \end{array}$ , $k \in \mathbb N$ , and let $\Phi _ { H _ { D . n } ^ { k } , \eta } , D \in \mathbb { R } _ { + } , k \in \mathbb { N } ,$ $\eta ~ \in ~ ( 0 , 1 / 2 )$ , be multiplication networks according to Proposition 3.2. For $D \in \mathbb { R } _ { + }$ , $k \in \mathbb N$ , $\eta \in ( 0 , 1 / 2 )$ , we then recursively define $\Psi _ { D , \eta } ^ { k }$ according to $\Psi _ { D , \eta } ^ { 0 } ( x ) = 1$ , $\Psi _ { D , \eta } ^ { 1 } ( x ) = x$ , and $\Psi _ { D , \eta } ^ { k } ( x ) \ : = \ : \Phi _ { H _ { D , \eta } ^ { k - 1 } , \eta } ( x , \Psi _ { D , \eta } ^ { k - 1 } ( x ) ) , k \ : \geq \ : 2$ . Note that $\Psi _ { D , \eta } ^ { k } ( x )$ can be realized through a neural network for all $k \in \mathbb N$ thanks to Lemma 2.2 and the fact that, as already noted above for the case $m = 1$ , any affine function can be realized through a neural network.
|
| 90 |
+
|
| 91 |
+
We first show by induction that
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\| \Psi _ { D , \eta } ^ { k } ( x ) - x ^ { k } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \eta \sum _ { s = 0 } ^ { k - 2 } \lceil D \rceil ^ { s } ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
for all $\eta \in ( 0 , 1 / 2 )$ , $k \geq 2$ . The base case $k = 2$ follows from
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\| \Psi _ { D , \eta } ^ { 2 } ( x ) - x ^ { 2 } \| _ { L ^ { \infty } ( [ - D , D ] ) } = \| \Phi _ { H _ { D , \eta } ^ { 1 } , \eta } ( x , x ) - x ^ { 2 } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \eta .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
We proceed to establishing the induction step $( k - 1 ) \to k$ . The induction assumption is
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\| \Psi _ { D , \eta } ^ { k - 1 } ( x ) - x ^ { k - 1 } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \eta \sum _ { s = 0 } ^ { k - 3 } [ D ] ^ { s } .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Since $\| \Psi _ { D , \eta } ^ { k - 1 } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \| x ^ { k - 1 } \| _ { L ^ { \infty } ( [ - D , D ] ) } + \| \Psi _ { D , \eta } ^ { k - 1 } ( x ) - x ^ { k - 1 } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq H _ { D , \eta } ^ { k - 1 }$ , Propo
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r l } { \| \Psi _ { D , \eta } ^ { k } ( x ) - x ^ { k } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \| \Phi _ { H _ { D , \eta } ^ { k - 1 } , \eta } ( x , \Psi _ { D , \eta } ^ { k - 1 } ( x ) ) - x \Psi _ { D , \eta } ^ { k - 1 } ( x ) \| _ { L ^ { \infty } ( [ - D , D ] ) } } & { } \\ { + \underset { [ - D , D ] } { \operatorname* { m a x } } | x | \| \Psi _ { D , \eta } ^ { k - 1 } ( x ) - x ^ { k - 1 } \| _ { L ^ { \infty } ( [ - D , D ] ) } } & { } \\ { \leq \eta + \lceil D \rceil \eta \underset { s = 0 } { \overset { k - 3 } { \sum } } [ D ] ^ { s } = \eta \underset { s = 0 } { \overset { k - 2 } { \sum } } [ D ] ^ { s } , } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
which completes the proof of the induction step.
|
| 116 |
+
|
| 117 |
+
We are now ready to proceed to the construction of the network approximating the polynomial $\textstyle p _ { m } ( x ) = \sum _ { i = 0 } ^ { m } a _ { i } x ^ { i }$ m . To this end, we first note that the identity mapping $x \mapsto x$ and the linear combination $x , y \mapsto x + a _ { i - 1 } y$ are affine transformations and can thus be realized by a network of $L = 2$ er, a constant there is a $C _ { 2 }$ such work $m \geq 2$ $p _ { m } ( x ) =$ $\scriptstyle \sum _ { \ell = 0 } ^ { \bar { m } } a _ { \ell } x ^ { \ell }$ $i \in \{ 2 , 3 , . . . , m \}$ $\eta ~ \in ~ ( 0 , 1 / 2 )$ $\varphi _ { p _ { m } , D , \eta } ^ { i } \in \dot { \mathcal { N } } \mathcal { N } _ { \infty , 1 6 , 3 , 3 }$ $\mathcal { L } ( \varphi _ { p _ { m } , D , \eta } ^ { i } ) \leq C _ { 2 } \log ( \lceil H _ { D , \eta } ^ { i - 1 } \rceil ^ { 2 } \eta ^ { - 1 } )$ , and $\begin{array} { r } { \mathcal { B } ( \varphi _ { p _ { m } , D , \eta } ^ { i } ) \leq \operatorname* { m a x } \{ 4 , 2 \lceil H _ { D , \eta } ^ { i - 1 } \rceil ^ { 2 } , \operatorname* { m a x } _ { i \in \{ 0 , \dots , m \} } \left| a _ { i } \right| \} } \end{array}$
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
( x \mathrm { ~ ~ { ~ \cal ~ s ~ } ~ } y ) ^ { \top } \Big ( x \mathrm { ~ ~ { ~ \cal ~ s ~ } ~ } + a _ { i - 1 } y \Phi _ { H _ { D , \eta } ^ { i - 1 } , \eta } ( x , y ) \Big ) ^ { \top } .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
The statements in the following apply for all $m \in \mathbb { N }$ , $A \ \in \ \mathbb { R } _ { + }$ , $\textstyle p _ { m } ( x ) \ = \ \sum _ { i = 0 } ^ { m } a _ { i } x ^ { i }$ with $\begin{array} { r } { \operatorname* { m a x } _ { i = 0 , \ldots , m } | a _ { i } | \ \leq \ A , \ D \ \in \ \mathbb { R } _ { + } } \end{array}$ , and now $\epsilon \in ( 0 , 1 / 2 )$ . The network cording to $\Phi _ { p _ { m } , D , \epsilon }$ approximating the $\textstyle p _ { m } ( x ) = \sum _ { i = 0 } ^ { m } a _ { i } x ^ { i }$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array}{c} \Phi _ { p _ { m } , D , \epsilon } ( x ) : = ( 0 \mathrm { ~ ~ { ~ 1 ~ } ~ } a _ { m } ) \varphi _ { p _ { m } , D , \eta _ { \epsilon } } ^ { m } \left( \varphi _ { p _ { m } , D , \eta _ { \epsilon } } ^ { m - 1 } \left( \cdot \cdot \mathrm { ~ ~ { ~ \varphi ~ } ~ } _ { p _ { m } , D , \eta _ { \epsilon } } ^ { 2 } \left( \left( { \mathrm { ~ ~ { ~ 1 ~ } ~ } } \right) x + \left( \begin{ { 0 } \\ { a _ { 0 } } \right) } \end{array} \right) \right) \right) ,
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
with $\eta _ { \epsilon } : = ( \lceil A \rceil m ^ { 2 } \lceil D \rceil ^ { m } ) ^ { - 1 } \epsilon .$ . This yields
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\Phi _ { p _ { m } , D , \epsilon } ( x ) = \sum _ { i = 0 } ^ { m } a _ { i } \Psi _ { D , \eta _ { \epsilon } } ^ { i } ( x ) , \quad \mathrm { f o r ~ a l l } x \in \mathbb { R } .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
Hence equation 5 implies
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { r l r } { { \Big \| \Phi _ { p _ { m } , D , \epsilon } ( x ) - p _ { m } \Big \| _ { L ^ { \infty } ( [ - D , D ] ) } \le \sum _ { i = 0 } ^ { m } | a _ { i } | \| \Psi _ { D , \eta _ { \epsilon } } ^ { i } ( x ) - x ^ { i } \| _ { L ^ { \infty } ( [ - D , D ] ) } \le \sum _ { i = 2 } ^ { m } | a _ { i } | \Bigl ( \eta _ { \epsilon } \sum _ { s = 0 } ^ { i - 2 } [ D ] ^ { s } \Bigr ) } } \\ & { } & { \le \eta _ { \epsilon } \operatorname* { m a x } _ { i \in \{ 2 , \dots , m \} } | a _ { i } | \sum _ { i = 2 } ^ { m } ( i - 1 ) [ D ] ^ { i - 2 } \le A m ^ { 2 } [ D ] ^ { m - 2 } \eta _ { \epsilon } \le \epsilon . } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
vidual networks in the composition, i.e., Thanks to its compositional structure, the width of $\mathcal { W } ( \Phi _ { p _ { m } , D , \epsilon } ) \leq 1 6$ $\Phi _ { p _ { m } , D , \epsilon }$ equals the maximum width of the indi- . Since $H _ { D , \eta _ { \epsilon } } ^ { i - 1 } \le 2 \lceil D \rceil ^ { m - 1 }$ , for $i \leq m$ ,
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \Phi _ { p _ { m } , D , \epsilon } ) \leq \sum _ { i = 2 } ^ { m } \mathcal { L } ( \varphi _ { p _ { m } , D , \eta _ { \epsilon } } ^ { i } ) \leq \sum _ { i = 2 } ^ { m } C _ { 2 } \log ( \lceil H _ { D , \eta _ { \epsilon } } ^ { i - 1 } \rceil ^ { 2 } \eta _ { \epsilon } ^ { - 1 } ) } \\ { \leq C _ { 2 } m \left( \log ( \lceil A \rceil ) + \log ( \epsilon ^ { - 1 } ) + ( 3 m - 2 ) \log ( \lceil D \rceil ) + 2 \log ( m ) + 2 \right) } \\ { \leq 4 C _ { 2 } m \left( \log ( \lceil A \rceil ) + \log ( \epsilon ^ { - 1 } ) + m \log ( \lceil D \rceil ) + \log ( m ) \right) . } \end{array}
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
Finally, we note that
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\mathcal { B } ( \Phi _ { p _ { m } , D , \epsilon } ) = \operatorname* { m a x } \{ 1 , | a _ { 0 } | , | a _ { m } | , \operatorname* { m a x } _ { i \in \{ 2 , 3 , \dots , m \} } \mathcal { B } ( \varphi _ { p _ { m } , D , \eta _ { \epsilon } } ^ { i } ) \} \leq \operatorname* { m a x } \{ A , 8 [ D ] ^ { 2 m - 2 } \} .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
This finalizes the proof.
|
| 154 |
+
|
| 155 |
+
We conclude this section with a result on ReLU networks approximating smooth functions with exponential accuracy. The proof of this statement, provided in the supplement, is based on the theory developed above.
|
| 156 |
+
|
| 157 |
+
Definition 3.4. For $D \in \mathbb { R } _ { + }$ , let the set $S _ { D } \subseteq C ^ { \infty } ( [ - D , D ] , \mathbb { R } )$ be given by
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathcal { S } _ { D } = \left\{ f \in C ^ { \infty } ( [ - D , D ] , \mathbb { R } ) \colon \| f ^ { ( n ) } ( x ) \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq n ! , \mathrm { ~ f o r ~ a l l ~ } n \in \mathbb { N } _ { 0 } \right\} .
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
Lemma 3.5. There exist constants $C > 0$ and a polynomial $\pi$ such that for all $D \in \mathbb { R } _ { + }$ , $f \in S _ { D }$ , and $\epsilon \in ( 0 , 1 / 2 )$ , there is a network $\Psi _ { f , \epsilon } \in \mathcal { N N } _ { \infty , 2 3 , 1 , 1 }$ satisfying $\mathcal { L } ( \Psi _ { f , \epsilon } ) \leq C \lceil D \rceil ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 }$ , $B ( \Psi _ { f , \epsilon } ) \leq \operatorname* { m a x } \{ 1 / D , \lceil D \rceil \} \pi ( \epsilon ^ { - 1 } )$ , and
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\| \Psi _ { f , \epsilon } - f \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \epsilon .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Note that for expositional simplicity Lemma 3.5 covers functions defined on symmetric intervals $[ - D , D ]$ . Close inspection of the proof reveals, however, that for arbitrary intervals $[ a , b ]$ and functions $f \in C ^ { \infty } ( [ a , b ] , \mathbb { R } )$ with $\| f ^ { ( n ) } \| _ { L ^ { \infty } ( [ a , b ] ) } \leq n !$ , for all $n \in \mathbb N$ , the same statement (with $D$ replaced by $b - a$ in the bounds on $\mathcal { L } ( \Psi _ { f , \epsilon } ) , B ( \Psi _ { f , \epsilon } ) )$ holds.
|
| 170 |
+
|
| 171 |
+
# 4 APPROXIMATION OF SINUSOIDAL FUNCTIONS
|
| 172 |
+
|
| 173 |
+
We are now ready to proceed to the approximation of sinusoidal functions.
|
| 174 |
+
|
| 175 |
+
Theorem 4.1. There exists a constant $C$ such that for every $a , D \in \mathbb { R } _ { + }$ , $\epsilon \in ( 0 , 1 / 2 )$ , there is $a$ network $\Psi _ { a , D , \epsilon } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ satisfying $\mathcal { L } ( \Psi _ { a , D , \epsilon } ) \leq C ( ( \log ( 1 / \epsilon ) ) ^ { 2 } + \log ( \lceil a D \rceil ) )$ , $\begin{array} { r } { B ( \Psi _ { a , D , \epsilon } ) \leq } \end{array}$ $C$ , and
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\| \Psi _ { a , D , \epsilon } - \cos ( a \cdot ) \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \epsilon .
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
Proof. We start by approximating $x \mapsto \cos ( 2 \pi x )$ on $[ 0 , 1 ]$ . To this end note the MacLaurin series representation
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\cos ( x ) = \sum _ { n = 0 } ^ { \infty } { \frac { ( - 1 ) ^ { n } } { ( 2 n ) ! } } x ^ { 2 n } , \quad \forall x \in \mathbb { R } .
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Thanks to the Taylor theorem with remainder in Lagrange form, we have, for all $x \in [ 0 , 1 ]$
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\left| \cos ( 2 \pi x ) - \sum _ { n = 0 } ^ { N } \frac { ( - 1 ) ^ { n } } { ( 2 n ) ! } ( 2 \pi x ) ^ { 2 n } \right| \leq \left| \frac { ( 2 \pi x ) ^ { 2 N + 1 } } { ( 2 N + 1 ) ! } \right| \operatorname* { s u p } _ { t \in [ 0 , 1 ] } | \cos ( ^ { 2 N + 1 } ( 2 \pi t ) | \leq \frac { ( 2 \pi ) ^ { 4 N + 2 } } { ( 2 N + 1 ) ! } .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
Next observe that $n ! \geq ( { \frac { n } { e } } ) ^ { n } e$ , for all $n \in \mathbb { N }$ , which implies,
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\frac { ( 2 \pi ) ^ { 4 N + 2 } } { ( 2 N + 1 ) ! } \leq \frac { ( 4 \pi ^ { 2 } ) ^ { 2 N + 1 } } { ( \frac { 2 N + 1 } { e } ) ^ { 2 N + 1 } e } \leq \Big ( \frac { 4 \pi ^ { 2 } e } { 2 N + 1 } \Big ) ^ { 2 N + 1 } , \quad \mathrm { f o r ~ a l l ~ } N \in \mathbb { N } .
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
With $N _ { \epsilon } : = \lceil 2 \pi ^ { 2 } e \log ( 2 / \epsilon ) \rceil$ , we get, for all $\epsilon \in ( 0 , 1 / 2 )$ ,
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\begin{array} { r } { \Big ( \frac { 4 \pi ^ { 2 } e } { 2 N _ { \epsilon } + 1 } \Big ) ^ { 2 N _ { \epsilon } + 1 } = \Big ( \frac { 4 \pi ^ { 2 } e } { 2 \lceil 2 \pi ^ { 2 } e \log ( 2 / \epsilon ) \rceil + 1 } \Big ) ^ { 2 \lceil 2 \pi ^ { 2 } e \log ( 2 / \epsilon ) \rceil + 1 } \leq 2 ^ { - \lceil 2 \pi ^ { 2 } e \log ( 2 / \epsilon ) \rceil } } \\ { \leq 2 ^ { - \log ( 2 / \epsilon ) } = \frac { \epsilon } { 2 } . } \end{array}
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
Noting that $\begin{array} { r } { C _ { 1 } : = \left\lceil \operatorname* { m a x } _ { n \in \mathbb { N } _ { 0 } } \left( \frac { ( 2 \pi ) ^ { 2 n } } { ( 2 n ) ! } \right) \right\rceil < \infty } \end{array}$ and $N _ { \epsilon } \leq C _ { 2 } \log ( \epsilon ^ { - 1 } )$ , for all $\epsilon \in ( 0 , 1 / 2 )$ , with $C _ { 2 } : = 4 \pi ^ { 2 } e + 1$ , application of Proposition 3.3 to
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
p _ { m } ( x ) = p _ { N _ { \epsilon } } ( x ) : = \sum _ { n = 0 } ^ { N _ { \epsilon } } \frac { ( - 1 ) ^ { n } } { ( 2 n ) ! } ( 2 \pi x ) ^ { 2 n } ,
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
with $D = 1$ , establishes the following: There is a constant $C _ { 3 }$ such that, for all $\epsilon \in ( 0 , 1 / 2 )$ , there is a network $\Phi _ { \epsilon / 2 }$ satisfying
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
\left\| \Phi _ { \epsilon / 2 } - p _ { N _ { \epsilon } } \right\| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \leq \frac { \epsilon } { 2 } ,
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
with $\mathcal { W } ( \Phi _ { \epsilon / 2 } ) \leq 1 6 , B ( \Phi _ { \epsilon / 2 } ) \leq C _ { 3 } ,$ , and
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\mathcal { L } ( \Phi _ { \epsilon / 2 } ) \leq C _ { 3 } N _ { \epsilon } ( \log ( C _ { 1 } ) + \log ( 2 / \epsilon ) + N _ { \epsilon } \log ( 1 ) + \log ( N _ { \epsilon } ) ) \leq C _ { 4 } ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } ,
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
where $C _ { 4 } : = C _ { 2 } C _ { 3 } ( 1 + C _ { 1 } + C _ { 2 } )$ . Combining equation 9, equation 10, equation 11, and equation 12, it follows that the network $\Phi _ { \epsilon / 2 }$ approximates the function $x \mapsto \cos ( 2 \pi x )$ on $[ 0 , 1 ]$ to within accuracy $\epsilon$ , i.e., for all $\epsilon \in ( 0 , 1 / 2 )$ , we have
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\| \Phi _ { \epsilon / 2 } - \cos ( 2 \pi \cdot ) \| _ { L ^ { \infty } ( [ 0 , 1 ] ) } \leq \epsilon .
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
We next extend this result to the approximation of $x \mapsto \cos ( a x )$ on the interval $[ - 1 , 1 ]$ for arbitrary $a \in \mathbb { R } _ { + }$ . This will be accomplished by exploiting that $x \mapsto \cos ( 2 \pi x )$ is 1-periodic and even. First recall the “sawtooth” functions $g _ { s } \colon [ 0 , 1 ] \to [ 0 , 1 ] , s \in \mathbb { N }$ , as defined in equation 24. It is straightforward, albeit somewhat tedious, to see that, for all $s \in { \mathbb { N } } _ { 0 }$ , $x \in [ 0 , 1 ]$ ,
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\cos ( 2 \pi 2 ^ { s } x ) = \cos ( 2 \pi g _ { s } ( x ) ) .
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
Similarly, it follows that $\cos ( 2 \pi 2 ^ { s } x ) = \cos ( 2 \pi g _ { s } ( | x | ) )$ , for all $s \in { \mathbb { N } } _ { 0 }$ , $x \in [ - 1 , 1 ]$ . Next, note that for every $a \in \mathbb { R } _ { + }$ , there exists a $C _ { a } \in ( 1 / 2 , 1 ]$ such that $a / ( 2 \pi ) = C _ { a } 2 ^ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil }$ ; we thus have, for all $a \in \mathbb { R } _ { + }$ , $x \in [ - 1 , 1 ]$ ,
|
| 236 |
+
|
| 237 |
+
$$
|
| 238 |
+
\cos ( a x ) = \cos ( 2 \pi 2 ^ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } C _ { a } x ) = \cos \left( 2 \pi g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \right) .
|
| 239 |
+
$$
|
| 240 |
+
|
| 241 |
+
Since $g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \in [ 0 , 1 ]$ , for all $a \in \mathbb { R } _ { + }$ , $x \in [ - 1 , 1 ]$ , it follows from equation 13 that
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\begin{array} { r l } & { \left\| \Phi _ { \epsilon / 2 } \Bigl ( g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \Bigr ) - \cos \bigl ( 2 \pi g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \bigr ) \right\| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } } \\ & { = \left\| \Phi _ { \epsilon / 2 } \Bigl ( g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \Bigr ) - \cos ( a x ) \right\| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \le \epsilon . } \end{array}
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
Now recall that $x \mapsto | x | = \rho ( x ) + \rho ( - x )$ can be implemented by a 2-layer network and consider the realization of $x \mapsto g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } x ) ,$ $a \in \mathbb { R } _ { + }$ , as developed in the proof of Proposition 3.1. Applying Lemma 2.2 twice, then establishes, thanks to (14), the existence of a constant $C _ { 5 }$ such that the network
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
\Psi _ { a , \epsilon } : = \Phi _ { \epsilon / 2 } \bigl ( g _ { \lceil \log ( a ) - \log ( 2 \pi ) \rceil } ( C _ { a } | x | ) \bigr )
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
approximates $\begin{array} { r l r } { x } & { { } \mapsto } & { \cos ( a x ) } \end{array}$ on $[ - 1 , 1 ]$ with accuracy $\epsilon$ , while satisfying $\begin{array} { r l } { \mathcal { L } ( \Psi _ { a , \epsilon } ) } & { { } \leq } \end{array}$ $C _ { 5 } ( ( \log ( 1 / \epsilon ) ) ^ { 2 } + \log ( \lceil a \rceil ) ) , \mathcal { W } ( \Psi _ { a , \epsilon } ) \leq 1 6$ , and $B ( \Psi _ { a , \epsilon } ) \leq C _ { 5 }$ .
|
| 254 |
+
|
| 255 |
+
Finally, we consider the approximation of $x \mapsto \cos ( a x )$ on intervals $[ - D , D ]$ , for arbitrary $D \geq 1$ . To this end, we define, for all $a \in \mathbb { R } _ { + }$ , $D \in [ 1 , \infty )$ , $\epsilon \in ( 0 , 1 / 2 )$ , the network $\Psi _ { a , D , \epsilon } ( x ) : = $ $\Psi _ { a D , \epsilon } \bigl ( \frac { x } { D } \bigr )$ and observe that
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\begin{array} { r l } & { \displaystyle \operatorname* { s u p } _ { x \in [ - D , D ] } | \Psi _ { a , D , \epsilon } ( x ) - \cos ( a x ) | = \operatorname* { s u p } _ { y \in [ - 1 , 1 ] } | \Psi _ { a , D , \epsilon } ( D y ) - \cos ( a D y ) | } \\ & { \quad \quad \quad = \operatorname* { s u p } _ { y \in [ - 1 , 1 ] } | \Psi _ { a D , \epsilon } ( y ) - \cos ( a D y ) | \le \epsilon . } \end{array}
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
This concludes the proof.
|
| 262 |
+
|
| 263 |
+
An approximation result for $\sin ( a x )$ can be obtained directly from Theorem 4.1 simply by noting that $\sin ( x ) = \cos ( x - \pi / 2 )$ , which can be realized by the concatenation of a neural network that performs an affine transformation and a network that approximates $\cos ( x )$ . The formal statement is as follows.
|
| 264 |
+
|
| 265 |
+
Corollary 4.2. There exists a constant $C > 0$ such that for every $a , D \in \mathbb { R } _ { + } , b \in \mathbb { R } , \epsilon \in ( 0 , 1 / 2 )$ there is a network $\Psi _ { a , b , D , \epsilon } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ satisfying
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\| \Psi _ { a , b , D , \epsilon } - \cos ( a \cdot - b ) \| _ { L ^ { \infty } ( [ - D , D ] ) } \le \epsilon ,
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
with $\mathcal { L } ( \Psi _ { a , b , D , \epsilon } ) \leq C ( ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } + \log ( \lceil a D + \lvert b \rvert \rceil ) )$ and $\begin{array} { r } { B ( \Psi _ { a , b , D , \epsilon } ) \leq C } \end{array}$ .
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 1: Left: A function in $\mathcal { F } _ { 1 , 1 0 0 }$ . Right: The function $W _ { \frac { 1 } { \sqrt { 2 } } , 2 }$
|
| 275 |
+
|
| 276 |
+
# 5 OSCILLATORY TEXTURES AND THE WEIERSTRASS FUNCTION
|
| 277 |
+
|
| 278 |
+
Consider the following function class consisting of one-dimensional “oscillatory textures” according to Demanet & Ying (2007).
|
| 279 |
+
|
| 280 |
+
Definition 5.1. Let the sets $\mathcal { F } _ { D , a } , D , a \in \mathbb { R } _ { + }$ , be given by
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\mathcal { F } _ { D , a } = \left\{ \cos ( a g ) h \colon g , h \in S _ { D } \right\} .
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
The efficient approximation of functions in $\mathcal { F } _ { D , a }$ with $a$ large is a notoriously difficult problem due to the combination of the rapidly oscillating cosine term and the warping $g$ . The best available approximation results in the literature (Demanet & Ying, 2007) are based on wave-atom dictionaries2 and yield low-order polynomial approximation rates. In what follows we show that finite-width deep networks drastically improve these results to exponential approximation rates.
|
| 287 |
+
|
| 288 |
+
Proposition 5.2. There exist a constant $C > 0$ and a polynomial $\pi$ such that for all $D , a \in \mathbb { R } _ { + } , f \in$ $\mathcal { F } _ { D , a } ,$ , and $\epsilon \in ( 0 , 1 / 2 )$ there is a network $\Gamma _ { f , \epsilon } \in \mathcal { N N } _ { \infty , 4 6 , 1 , 1 }$ which satisfies
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\| \Gamma _ { f , \epsilon } - f \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \epsilon ,
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\mathcal { L } ( \Gamma _ { f , \epsilon } ) \leq C ( \lceil D \rceil ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } + \log ( \lceil a D \rceil ) ) ) \ : a n d \ : \mathcal { B } ( \Gamma _ { f , \epsilon } ) \leq \operatorname* { m a x } \{ 1 / D , \pi ( \epsilon ^ { - 1 } , \lceil D \rceil , \lceil a \rceil ) \} .
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Finally, we show how the Weierstrass function—a fractal function, which is continuous everywhere but differentiable nowhere—can be approximated with exponential accuracy by deep ReLU networks. Specifically, we consider
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
W _ { p , a } ( x ) = \sum _ { k = 0 } ^ { \infty } p ^ { k } \cos ( a ^ { k } \pi x ) , \quad \mathrm { f o r } p \in ( 0 , 1 / 2 ] , a \in \mathbb { R } _ { + } .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
Let $\begin{array} { r } { \alpha = - \frac { \log ( p ) } { \log ( a ) } } \end{array}$ . It is well known (Zygmund, 2002) that $W _ { p , a }$ possesses Holder smoothness ¨ $\alpha$ which may be arbitrarily small, depending on $p$ and $a$ , see Figure 1 right. While classical approximation methods, for instance sparse approximation in frames, are not suitable owing to the warping operation, it turns out that deep finite-width networks achieve exponential approximation rate. The corresponding formal statement is as follows.
|
| 305 |
+
|
| 306 |
+
Proposition 5.3. There exists a constant $C > 0$ such that, for all $\epsilon \in ( 0 , 1 / 2 )$ , $p \in ( 0 , 1 / 2 ]$ , $a \in \mathbb { R } _ { + }$ , $D \geq 1$ , there is a network $\Psi _ { p , a , D , \epsilon } \in \mathcal { N N } _ { \infty , 2 0 , 1 , 1 }$ satisfying
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r } { \| \Psi _ { p , a , D , \epsilon } - W _ { p , a } \| _ { L ^ { \infty } ( [ - D , D ] ) } \le \epsilon , } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
with $\mathcal { L } ( \Psi _ { p , a , D , \epsilon } ) \leq C ( ( \log ( 1 / \epsilon ) ) ^ { 3 } + 2 ( \log ( 1 / \epsilon ) ) ^ { 2 } \log ( \lceil a \rceil ) + \log ( 1 / \epsilon ) \log ( D ) )$ and $B ( \Psi _ { p , a , D , \epsilon } ) \leq$ $C$ .
|
| 313 |
+
|
| 314 |
+
# 6 FINITE DEPTH IS NOT ENOUGH
|
| 315 |
+
|
| 316 |
+
We next show that, in the approximation of periodic functions, finite-width deep networks require asymptotically smaller connectivity than finite-depth wide networks. This statement is then extended to sufficiently smooth non-periodic functions, thereby formalizing the benefit of deep networks over shallow networks in the approximation of a broad class of functions.
|
| 317 |
+
|
| 318 |
+
We start with preparatory material taken from Telgarsky (2015).
|
| 319 |
+
|
| 320 |
+
Definition 6.1 (Telgarsky (2015)). Let $k \in \mathbb N$ . A function $f : \mathbb { R } \mathbb { R }$ is called $k$ -sawtooth if it is piecewise linear with no more than $k$ pieces, i.e., its domain $\mathbb { R }$ can be partitioned into $k$ intervals such that $f$ is linear on each of these intervals.
|
| 321 |
+
|
| 322 |
+
Lemma 6.2 (Telgarsky (2015)). Every $\Phi \in \mathcal { N N } _ { L , M , 1 , 1 }$ is $( 2 M ) ^ { L }$ -sawtooth.
|
| 323 |
+
|
| 324 |
+
Definition 6.3. For a non-constant $u$ -periodic function $f \in C ( \mathbb { R } )$ , we define
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\xi ( f ) : = \operatorname* { i n f } _ { \delta \in [ 0 , u ) , \atop c , d \in \mathbb { R } } \| f ( x ) - ( c x + d ) \| _ { L ^ { \infty } ( [ \delta , u + \delta ] ) } .
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
The quantity $\xi ( f )$ measures the error incurred by the best linear approximation of $f$ on any segment of length equal to the period of $f$ ; It can hence be interpreted as quantifying the non-linearity of $f$ . The next result states that finite-depth networks with width scaling poly-logarithmically in the highest frequency of the periodic function to be approximated can not achieve arbitrarily small approximation error.
|
| 331 |
+
|
| 332 |
+
Proposition 6.4. Let $f \in C ( \mathbb { R } )$ be a non-constant $u$ -periodic function, let $L \in \mathbb { N }$ and $\pi$ a polynomial. Then there exists $a \in \mathbb { R } _ { + }$ such that for every network $\Phi \in \mathcal { N N } _ { L , M , 1 , 1 }$ with $M \leq \pi ( \log ( a ) )$ it holds that
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\| f ( a x ) - \Phi ( x ) \| _ { L ^ { \infty } ( [ 0 , u ] ) } \geq \xi ( f ) > 0 .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Application of Proposition 6.4 shows that finite-depth networks, owing to $\xi ( \cos ) > 0$ , require faster than poly-logarithmic growth of connectivity in $a$ to approximate $x \mapsto \cos ( a x )$ with arbitrarily small error, whereas finite-width networks, thanks to Theorem 4.1, can accomplish this with polylogarithmic growth in connectivity. The next result, taken from (Frenzen et al., 2010), allows us to extend this conclusion to non-periodic sufficiently smooth functions.
|
| 339 |
+
|
| 340 |
+
Theorem 6.5 (Frenzen et al. (2010)). Let $f \in C ^ { 3 } ( [ a , b ] )$ and consider a piecewise linear approximation of $f$ on $[ a , b ]$ that is accurate to within $\epsilon$ in the $L ^ { \infty } ( [ a , b ] )$ -norm. The minimal number of linear pieces required to accomplish this scales according to
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
s ( \epsilon ) \sim \frac { c } { \sqrt { \epsilon } } , \epsilon 0 , w h e r e c = \frac { 1 } { 4 } \int _ { a } ^ { b } \sqrt { | f ^ { \prime \prime } ( x ) | } d x .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Combining this with Lemma 6.2 yields the following statement on the depth-width tradeoff of networks approximating three-times continuously differentiable functions.
|
| 347 |
+
|
| 348 |
+
Theorem 6.6. Let $f \in C ^ { 3 } ( [ a , b ] )$ with $\begin{array} { r } { \int _ { a } ^ { b } \sqrt { | f ^ { \prime \prime } ( x ) | } d x > 0 , } \end{array}$ , $L \in \mathbb { N }$ , and let $\pi$ be a polynomial. Then there exists $\epsilon > 0$ such that for every network $\Phi \in \mathcal { N N } _ { L , M , 1 , 1 }$ with $M \leq \pi ( \log ( \epsilon ^ { - 1 } ) )$ it holds that
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\| f - \Phi \| _ { L ^ { \infty } ( [ a , b ] ) } \geq \epsilon .
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
This shows that any function which is at least three times continuously differentiable cannot be approximated by finite-depth networks of connectivity scaling poly-logarithmically. In contrast, as Proposition 3.3 and Theorem 4.1 show, finite-width networks can approximate various interesting types of smooth functions such as polynomials and sinusoidal functions at poly-logarithmic connectivity growth rates. Further results on the limitations of finite-depth networks akin to Theorem 6.6 were reported recently in Petersen & Voigtlaender (2017).
|
| 355 |
+
|
| 356 |
+
# REFERENCES
|
| 357 |
+
|
| 358 |
+
H. Bolcskei, P. Grohs, G. Kutyniok, and P. Petersen. Optimal approximation with sparsely connected ¨ deep neural networks. arXiv:1705.01714, 2018.
|
| 359 |
+
L. Demanet and L. Ying. Wave atoms and sparsity of oscillatory patterns. Applied and Computational Harmonic Analysis, 23(3):368–387, 2007.
|
| 360 |
+
Y. Ding, J. Liu, and Y. Shi. On the universal approximability of quantized ReLU neural networks. arXiv:1802.03646, 2018.
|
| 361 |
+
D. L. Donoho. Unconditional bases are optimal bases for data compression and for statistical estimation. Applied and Computational Harmonic Analysis, 1:100–115, 1993.
|
| 362 |
+
C. L. Frenzen, T. Sasao, and J. T. Butler. On the number of segments needed in a piecewise linear approximation. Journal of Computational and Applied Mathematics, 234(2):437 – 446, 2010.
|
| 363 |
+
K. Grochenig. ¨ Foundations of Time-Frequency Analysis. Birkhauser Basel, 2001. ¨
|
| 364 |
+
K. Grochenig and S. Samarah. Nonlinear approximation with local Fourier bases. ¨ Constructive Approximation, 16(3):317–331, Jul 2000.
|
| 365 |
+
P. Grohs. Optimally sparse data representations. Applied and Numerical Harmonic Analysis, 68: 199–248, 2015.
|
| 366 |
+
B. Hanin and M. Sellke. Approximating continuous functions by ReLU nets of minimal width. arXiv:1710.11278, 2017.
|
| 367 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 368 |
+
S. Liang and R. Srikant. Why deep neural networks for function approximation? In ICLR, 2017.
|
| 369 |
+
P. Petersen and F. Voigtlaender. Optimal approximation of piecewise smooth functions using deep ReLU neural networks. ArXiv e-prints, September 2017.
|
| 370 |
+
M. Telgarsky. Representation benefits of deep feedforward networks. arXiv:1509.08101, 2015.
|
| 371 |
+
D. Yarotsky. Error bounds for approximations with deep ReLU networks. arXiv:1610.01145, 2016.
|
| 372 |
+
D. Yarotsky. Optimal approximation of continuous functions by very deep relu networks. arXiv:1802.03620, 2018.
|
| 373 |
+
A. Zygmund. Trigonometric series. Cambridge University Press, 2002.
|
| 374 |
+
|
| 375 |
+
# A PROOFS
|
| 376 |
+
|
| 377 |
+
A.1 PROOF OF LEMMA 2.2
|
| 378 |
+
|
| 379 |
+
Proof. The proof is based on the identity $x = \rho ( x ) - \rho ( - x )$ . First, note that by Definition 2.1, we can write
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\Phi _ { 1 } ( x ) = W _ { L _ { 1 } } ^ { 1 } ( \rho ( \dots W _ { 1 } ^ { 1 } ( x ) ) ) \mathrm { ~ a n d ~ } \Phi _ { 2 } ( x ) = W _ { L _ { 2 } } ^ { 2 } ( \rho ( \dots W _ { 1 } ^ { 2 } ( x ) ) ) .
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
Next, define the affine map given by $\widetilde { W } ( x ) = W _ { 1 } ^ { 2 } \left( \left( \mathbb { I } _ { N _ { L _ { 1 } } } \quad - \mathbb { I } _ { N _ { L _ { 1 } } } \right) x \right)$ , for $x \in \mathbb { R } ^ { 2 N _ { L _ { 1 } } }$ , and note that thanks to
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
W _ { 1 } ^ { 2 } ( \Phi _ { 1 } ( x ) ) = \widetilde { W } ( \rho ( ( { \frac { W _ { L _ { 1 } } ^ { 1 } } { - W _ { L _ { 1 } } ^ { 1 } } } ) ( \rho ( \ldots w _ { 1 } ^ { 1 } ( x ) ) ) ) ) ,
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
the map
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\Psi ( x ) = W _ { L _ { 2 } } ^ { 2 } ( \rho ( \ldots w _ { 2 } ^ { 2 } ( \rho ( \widetilde { W } ( \rho ( ( \stackrel { W _ { L _ { 1 } } ^ { 1 } } { - W _ { L _ { 1 } } ^ { 1 } } ) ( \rho ( \ldots w _ { 1 } ^ { 1 } ( x ) ) ) ) ) ) ) ) )
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
satisfies $\Psi ( x ) = \Phi _ { 2 } ( \Phi _ { 1 } ( x ) )$ , for all $x \in \mathbb { R } ^ { d _ { 1 } }$ , with $\mathcal { L } ( \Psi ) = L _ { 1 } + L _ { 2 } , \mathcal { M } ( \Psi ) \leq 2 M _ { 1 } + 2 M _ { 2 }$ $\mathcal { W } ( \Psi _ { 1 } ) \leq \operatorname* { m a x } \{ 2 N _ { L _ { 1 } } , \mathcal { W } ( \Phi _ { 1 } ) , \mathcal { W } ( \Phi _ { 2 } ) \}$ , and $B ( \Psi ) \leq \operatorname* { m a x } \{ B ( \Phi _ { 1 } ) , B ( \Phi _ { 2 } ) \}$ . □
|
| 398 |
+
|
| 399 |
+
# A.2 PROOF OF LEMMA 2.3
|
| 400 |
+
|
| 401 |
+
Proof. The proof is based on the identity $x = \rho ( x ) - \rho ( - x )$ . First, note that by equation 1 we can write $\Phi _ { 1 } ( x ) { \stackrel { \textstyle - } { = } } W _ { L } ( \rho ( . . . W _ { 1 } ( x ) ) )$ . For $K = L + 1$ , $\Phi _ { 2 }$ is given by
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\Phi _ { 2 } ( x ) = ( 1 \mathrm { ~ \xi ~ } - 1 ) \rho \left( \left( { \frac { W _ { L } } { - W _ { L } } } \right) ( \rho ( \mathrm { ~ \cdot ~ } . . W _ { 1 } ( x ) ) ) \right) \in { \mathcal { N } } { \mathcal { N } } _ { L + 1 , \operatorname* { m a x } \{ 2 , M \} , d , 1 } .
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
For $K > L + 1$ , consider the network
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\Phi _ { 1 } ^ { \prime } ( x ) = \binom { \rho \big ( \Phi _ { 1 } ( x ) \big ) } { \rho \big ( - \Phi _ { 1 } ( x ) \big ) } = \binom { 1 } { 0 } \rho \left( \binom { W _ { L } } { - W _ { L } } \left( \rho \left( \dots W _ { 1 } ( x ) \right) \right) \right) \in \mathcal { N } \mathcal { N } _ { L + 1 , \operatorname* { m a x } \{ 2 , M \} , d , 2 } ,
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
which satisfies ${ \mathcal W } ( \Phi _ { 1 } ^ { \prime } ) = \mathrm { m a x } \{ 2 , { \mathcal W } ( \Phi _ { 1 } ) \}$ . Next, we note that for every network of the form $\Psi ( x ) = \mathbb { I } _ { 2 } \rho ( . . . )$ , the network
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\Psi ^ { \prime } ( x ) : = \mathbb { I } _ { 2 } \rho ( \Psi ( x ) ) ,
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
satisfies $\Psi ^ { \prime } ( x ) = \Psi ( x )$ , for all $\boldsymbol { x } ~ \in ~ \mathbb { R } ^ { d }$ , $\mathcal { L } ( \Psi ^ { \prime } ) = \mathcal { L } ( \Psi ) + 1$ , and $\mathcal { W } ( \Psi ^ { \prime } ) = \operatorname* { m a x } \{ \mathcal { W } ( \Psi ) , 2 \}$ . Moreover, the weights of $\Psi ^ { \prime }$ consist of the weights of $\Psi$ and $\{ 1 \}$ . Noting that $\Phi _ { 1 } ^ { \prime }$ in (21) is of the form $\mathbb { I } _ { 2 } \rho \left( \dots \right)$ and iteratively applying the operation in equation $2 2 \ K - L - 2$ times to $\Phi _ { 1 } ^ { \prime }$ , we obtain a network $\Phi _ { 1 } ^ { \prime \prime } \in \mathcal { N } \mathcal { N } _ { K - 1 , \operatorname* { m a x } \{ 2 , M \} , d , 2 }$ . The proof is concluded by noting that $\Phi _ { 2 } = $ $( 1 ~ - 1 ) \rho \left( \Phi _ { 1 } ^ { \prime \prime } \right) \in \mathcal { N } \mathcal { N } _ { K , \operatorname* { m a x } \{ 2 , M \} , d , 1 }$ satisfies $\Phi _ { 2 } ( x ) = \Phi _ { 1 } ( x )$ , for all $\boldsymbol { x } \in \mathbb { R } ^ { d }$ . □
|
| 420 |
+
|
| 421 |
+
# A.3 PROOF OF LEMMA 2.4
|
| 422 |
+
|
| 423 |
+
Proof. Apply Lemma 2.3 to the networks $\Phi _ { i }$ to get corresponding networks $\tilde { \Phi } _ { i }$ of depth $L$ and set $\Phi ^ { 1 } ( \boldsymbol { x } ) : = \left( \tilde { \Phi } _ { 1 } ( x _ { 1 } ) , \tilde { \Phi } _ { 2 } ( x _ { 2 } ) , \ldots , \tilde { \Phi } _ { N } ( x _ { N } ) \right) ^ { \top }$ , $\Phi ^ { 2 } ( x ) : = ( a _ { 1 } , a _ { 2 } , \ldots , a _ { N } ) \Phi ^ { 1 } ( x )$ . □
|
| 424 |
+
|
| 425 |
+
A.4 PROOF OF PROPOSITION 3.1
|
| 426 |
+
|
| 427 |
+
Proof. Consider the function $g : [ 0 , 1 ] [ 0 , 1 ]$ ,
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
g ( x ) = { \left\{ \begin{array} { l l } { 2 x , } & { { \mathrm { i f ~ } } x < { \frac { 1 } { 2 } } , } \\ { 2 ( 1 - x ) , } & { { \mathrm { i f ~ } } x \geq { \frac { 1 } { 2 } } , } \end{array} \right. }
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
along with the “sawtooth” functions given by its $s$ -fold composition
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
g _ { s } : = \underbrace { g \circ g \circ \cdot \cdot \cdot \circ g } _ { s } , \quad s \geq 2 ,
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
and set $g _ { 0 } ( x ) : = x , g _ { 1 } ( x ) : = g ( x )$ . We next briefly review a fundamental result from Yarotsky (2016) showing how the function $f ( x ) : = x ^ { 2 } , x \in [ \bar { 0 } , 1 ]$ , can be approximated by linear combinations of “sawtooth” functions $g _ { s }$ . Specifically, let $f _ { m }$ be the piecewise linear interpolation of $f$ with $2 ^ { m } + 1$ uniformly spaced “knots” according to
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
f _ { m } \biggl ( \frac { k } { 2 ^ { m } } \biggr ) = \biggl ( \frac { k } { 2 ^ { m } } \biggr ) ^ { 2 } , \quad k = 0 , \ldots , 2 ^ { m } , \quad m \in { \mathbb { N } } _ { 0 } .
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
The function $f _ { m }$ approximates $f$ with error $\epsilon _ { m } = 2 ^ { - 2 m - 2 }$ in the sense of
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\| f _ { m } ( x ) - x ^ { 2 } \| _ { L ^ { \infty } [ 0 , 1 ] } \leq 2 ^ { - 2 m - 2 } .
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Next, note that we can refine interpolation in the sense of going from $f _ { m - 1 }$ to $f _ { m }$ by adjustment with a sawtooth function according to
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
f _ { m } ( x ) = f _ { m - 1 } ( x ) - \frac { g _ { m } ( x ) } { 2 ^ { 2 m } } .
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
This leads to the representation
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
f _ { m } ( x ) = x - \sum _ { s = 1 } ^ { m } \frac { g _ { s } ( x ) } { 2 ^ { 2 s } } .
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
While Yarotsky’s construction Yarotsky (2016) is finalized by realizing equation 26 through a deep ReLU network of width 3 with the help of skip connections He et al. (2016), i.e., connections between nodes in non-consecutive layers, we proceed by constructing an equivalent (in terms of input-output relation) network without skip connections and of width 4. As $g ( \bar { x } ) = 2 \rho ( x ) - 4 \rho ( x -$ $1 / 2 ) + 2 \rho ( x - 1 )$ , it follows that
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
g _ { m } = 2 \rho ( g _ { m - 1 } ) - 4 \rho ( g _ { m - 1 } - 1 / 2 ) + 2 \rho ( g _ { m - 1 } - 1 ) ,
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
and since $f _ { m } = \rho ( f _ { m } ) , \forall m \in { \mathbb { N } } _ { 0 }$ , equation 25 can be rewritten as
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
f _ { m } = \rho ( f _ { m - 1 } ) - 2 ^ { - 2 m } \Big ( 2 \rho ( g _ { m - 1 } ) - 4 \rho ( g _ { m - 1 } - 1 / 2 ) + 2 \rho ( g _ { m - 1 } - 1 ) \Big ) .
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
Equivalently, equation 27 and equation 28 can be cast as a composition of affine linear maps and a ReLU nonlinearity according to
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\binom { g _ { m } } { f _ { m } } = W _ { 1 } ( \rho \binom { g _ { m - 1 } } { f _ { m - 1 } } ) ) ,
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
with
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
V _ { 1 } ( x ) = \left( { \small \begin{array} { c c c c } { 2 } & { - 4 } & { 2 } & { 0 } \\ { - 2 ^ { - 2 m + 1 } } & { 2 ^ { - 2 m + 2 } } & { - 2 ^ { - 2 m + 1 } } & { 1 } \end{array} } \right) { \left( \begin{array} { l } { x _ { 1 } } \\ { x _ { 2 } } \\ { x _ { 3 } } \\ { x _ { 4 } } \end{array} \right) } , & W _ { 2 } ( x ) = \left( { \small \begin{array} { c c c c } { 1 } & { 0 } \\ { 1 } & { 0 } \\ { 1 } & { 0 } \\ { 0 } & { 1 } \end{array} } \right) { \left( \begin{array} { l } { x _ { 1 } } \\ { x _ { 2 } } \\ { x _ { 2 } } \end{array} \right) } - { \left( \begin{array} { l } { 0 } \\ { 1 / 2 } \\ { 1 } \\ { 0 } \end{array} \right) } .
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Applying equation 29 iteratively initialized with $g _ { 0 } ( x ) = x , f _ { 0 } ( x ) = x$ yields
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\binom { g _ { m } } { f _ { m } } = W _ { 1 } \Big ( \rho \Big ( W _ { 2 } \Big ( W _ { 1 } \Big ( \rho \Big ( \dots \rho \Big ( W _ { 2 } \Big ( W _ { 1 } \Big ( \rho \Big ( W _ { 2 } \Big ( x \Big ) \Big ) \Big ) \Big ) \Big ) \Big ) \Big ) \Big ) \Big ) ,
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
and hence shows that $f _ { m }$ can be realized through a network in $\mathcal { N N } _ { m + 1 , 4 , 1 , 1 }$ with weights bounded (in magnitude) by 4. Since $\epsilon _ { m } = 2 ^ { - 2 m - 2 }$ and hence $\log ( 1 / \epsilon _ { m } ) = 2 m + 2$ , the statement follows upon noting that $f _ { m } ( 0 ) = 0 , \forall m \in \mathbb { N } _ { 0 }$ . □
|
| 494 |
+
|
| 495 |
+
# A.5 PROOF OF PROPOSITION 3.2
|
| 496 |
+
|
| 497 |
+
Proof. The proof is based on the identity
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
x y = { \frac { 1 } { 2 } } ( ( x + y ) ^ { 2 } - x ^ { 2 } - y ^ { 2 } ) ,
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
which shows how multiplication can be implemented through the squaring operation. Let $\Psi _ { \delta } ( x )$ be a neural network approximating $x ^ { 2 }$ according to Proposition 3.1, i.e., $\| \bar { \Psi } _ { \delta } ( \ b { x } ) - \ b { x } ^ { 2 } \| _ { L ^ { \infty } [ 0 , 1 ] } \dot { \leq } \delta$ ,
|
| 504 |
+
|
| 505 |
+
$\Psi _ { \delta } ( 0 ) = 0$ . We first extend this approximation result to the interval $[ - D , D ]$ , $D > 1$ . Specifically, we need to find a ReLU network realization of $x ^ { 2 }$ and $y ^ { 2 }$ over $[ - D , D ]$ and of $( x + y ) ^ { 2 }$ over $[ - D , D ] ^ { 2 }$ . This will be accomplished by first noting that
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\left\| 4 \lceil D \rceil ^ { 2 } \Psi _ { \delta } \Big ( \frac { | x | } { 2 \lceil D \rceil } \Big ) - x ^ { 2 } \right\| _ { L ^ { \infty } ( [ - D , D ] ) } \le 4 \lceil D \rceil ^ { 2 } \delta ,
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
and likewise
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
\left\| 4 [ D ] ^ { 2 } \Psi _ { \delta } \Big ( \frac { | x + y | } { 2 [ D ] } \Big ) - ( x + y ) ^ { 2 } \right\| _ { L ^ { \infty } ( [ - D , D ] ) ^ { 2 } } \le 4 [ D ] ^ { 2 } \delta .
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
The network $x \mapsto \Psi _ { \delta } ( | x | )$ has one layer more than the network $x \mapsto \Psi _ { \delta } ( x )$ as it implements $| x | = \rho ( x ) + \rho ( - x )$ in its first layer. Next we define for every $D \in \mathbb { R } _ { + }$ , $\delta \in ( 0 , 1 / 2 )$ the network
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
\Phi _ { D , \delta } ^ { * } ( x , y ) : = 2 \lceil D \rceil ^ { 2 } \left( \Psi _ { \delta } \Big ( \frac { | x + y | } { 2 \lceil D \rceil } \Big ) - \Psi _ { \delta } \Big ( \frac { | x | } { 2 \lceil D \rceil } \Big ) - \Psi _ { \delta } \Big ( \frac { | y | } { 2 \lceil D \rceil } \Big ) \right) ,
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+
and observe that Lemma 2.4 implies that there exists a constant $C > 0$ such that for all $D \in \mathbb { R } _ { + }$ , $\delta \in$ $( 0 , 1 / 2 )$ , $x \in \mathbb { R }$ it holds that $\mathcal { L } ( \Phi _ { D , \delta } ^ { * } ) \leq C \log ( \delta ^ { - 1 } ) , \mathcal { W } ( \Phi _ { D , \delta } ^ { * } ) = 1 2 , \mathcal { B } ( \Phi _ { D , \delta } ^ { * } ) \leq \operatorname* { m a x } \{ 4 , 2 \lceil D \rceil ^ { 2 } \}$ and $\Phi _ { D , \delta } ^ { * } x , 0 ) = \Phi _ { D , \delta } ^ { * } ( 0 , x ) = 0$ . Using Equation 32 in combination with Equation 33 and Equation 34 yields
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\left\| \Phi _ { D , \delta } ^ { * } ( x , y ) - \frac 1 2 \left( ( x + y ) ^ { 2 } - x ^ { 2 } - y ^ { 2 } \right) \right\| _ { L ^ { \infty } ( [ - D , D ] ) ^ { 2 } } \le 6 [ D ] ^ { 2 } \delta .
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
The proof is completed by taking for every D ∈ R+, ∈ (0, 1/2) the network ΦD, := Φ∗D,δD, with δD, := 6dDe2 . 1
|
| 530 |
+
|
| 531 |
+
# A.6 PROOF OF LEMMA 3.5
|
| 532 |
+
|
| 533 |
+
Proof. We first consider the case $D = 1$ . A fundamental result on Chebyshev interpolation, see e.g. (Liang $\&$ Srikant, 2017, Lemma 3), guarantees, for all $f \in S _ { 1 }$ , $n \in \mathbb { N }$ , the existence of a polynomial $P _ { f , n }$ of degree $n$ such that
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
\begin{array} { r } { \| f - P _ { f , n } \| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \le \frac { 1 } { 2 ^ { n } ( n + 1 ) ! } \| f ^ { ( n + 1 ) } \| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \le \frac { 1 } { 2 ^ { n } } . } \end{array}
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
Writing the polynomials $P _ { f , n }$ as $\begin{array} { r } { P _ { f , n } = \sum _ { j = 0 } ^ { n } a _ { f , n , j } x ^ { j } } \end{array}$ , crude— f for our purposes— $c > 0$ $f \in S _ { 1 }$ $n \in \mathbb { N }$
|
| 540 |
+
|
| 541 |
+
$$
|
| 542 |
+
A _ { f , n } : = \operatorname* { m a x } _ { j = 0 , \ldots , n } | a _ { f , n , j } | \leq 2 ^ { c n } .
|
| 543 |
+
$$
|
| 544 |
+
|
| 545 |
+
Application of Proposition 3.3 to $P _ { f , n }$ establishes the existence of a constant $C _ { 1 } > 0$ such that for all $f \in S _ { 1 } , n \in \mathbb { N } , \epsilon \in ( 0 , 1 / 2 )$ , there is a network $\Phi _ { P _ { f , n } , 1 , \epsilon / 2 } \in \mathcal { N } \mathcal { N } _ { \infty , 1 6 , 1 , 1 }$ satisfying $B ( \Phi _ { P _ { f , n } , 1 , \epsilon / 2 } ) \leq \operatorname* { m a x } \{ A _ { f , n } , 8 \} \leq \operatorname* { m a x } \{ 2 ^ { c n } , 8 \}$ ,
|
| 546 |
+
|
| 547 |
+
$$
|
| 548 |
+
\mathcal { L } ( \Phi _ { P _ { f , n } , 1 , \epsilon / 2 } ) \leq C _ { 1 } n ( c n + \log ( 2 / \epsilon ) + \log ( n ) ) ,
|
| 549 |
+
$$
|
| 550 |
+
|
| 551 |
+
and
|
| 552 |
+
|
| 553 |
+
$$
|
| 554 |
+
\begin{array} { r } { \mathopen { } \mathclose \bgroup \left\| \Phi _ { P _ { f , n } , 1 , \epsilon / 2 } - P _ { f , n } \aftergroup \egroup \right\| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \leq \frac { \epsilon } { 2 } . } \end{array}
|
| 555 |
+
$$
|
| 556 |
+
|
| 557 |
+
In the following, we set $n _ { \epsilon } = \lceil \log ( 2 / \epsilon ) \rceil$ and $\Psi _ { f , \epsilon } = \Phi _ { P _ { f , n _ { \epsilon } } , 1 , \epsilon / 2 }$ . Combining equation 36 and equation 38 establishes that for all $f \in S _ { 1 }$ , $\epsilon \in ( 0 , 1 / 2 )$ ,
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
\begin{array} { r l } & { \| \Psi _ { f , \epsilon } - f \| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } \leq \| \Psi _ { f , \epsilon } - P _ { f , n _ { \epsilon } } \| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } + \| P _ { f , n _ { \epsilon } } - f \| _ { L ^ { \infty } ( [ - 1 , 1 ] ) } } \\ & { \qquad \leq \frac { \epsilon } { 2 } + \frac { 1 } { 2 ^ { n _ { \epsilon } } } \leq \frac { \epsilon } { 2 } + \frac { \epsilon } { 2 } = \epsilon . } \end{array}
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
Using $\lceil \log ( 2 / \epsilon ) \rceil \leq 2 \log ( 2 / \epsilon )$ and $\log ( 2 / \epsilon ) \leq 2 \log ( 1 / \epsilon )$ , for all $\epsilon \in ( 0 , 1 / 2 )$ , in equation 37 implies the existence of a constant $C _ { 2 }$ such that for all $f \in S _ { 1 }$ , $\epsilon \in ( 0 , 1 / 2 )$ ,
|
| 564 |
+
|
| 565 |
+
$$
|
| 566 |
+
\mathcal { L } ( \Psi _ { f , \epsilon } ) = \mathcal { L } ( \Phi _ { P _ { f , n _ { \epsilon } } , 1 , \epsilon / 2 } ) \leq C _ { 2 } ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } .
|
| 567 |
+
$$
|
| 568 |
+
|
| 569 |
+
By the same token there exists a polynomial $\pi _ { 1 }$ such that
|
| 570 |
+
|
| 571 |
+
$$
|
| 572 |
+
\begin{array} { r } { \mathcal { B } ( \Psi _ { f , \epsilon } ) = \mathcal { B } ( \Phi _ { P _ { f , n _ { \epsilon } } , 1 , \epsilon / 2 } ) \leq \operatorname* { m a x } \{ 2 ^ { c n _ { \epsilon } } , 8 \} \leq \pi _ { 1 } ( \epsilon ^ { - 1 } ) . } \end{array}
|
| 573 |
+
$$
|
| 574 |
+
|
| 575 |
+
This completes the proof for the case $D = 1$ .
|
| 576 |
+
|
| 577 |
+
We next prove the statement for ${ \cal D } \in \mathsf { \Gamma } ( 0 , 1 )$ . To this end, we start by noting that for $g \in S _ { D }$ , with $D \in ( 0 , 1 )$ , the function $f _ { g } \colon [ - 1 , 1 ] \to { \mathbb { R } } , x \mapsto g ( D x )$ is in $S _ { 1 }$ . Hence, there exists, for every $g \in S _ { D } , \epsilon \in ( 0 , 1 / 2 )$ , a network $\Psi _ { f _ { g } , \epsilon } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ satisfying $\begin{array} { r } { \operatorname* { s u p } _ { x \in [ - 1 , 1 ] } | \Psi _ { f _ { g } , \epsilon } ( x ) - f _ { g } ( x ) | \leq \epsilon . } \end{array}$ , $\begin{array} { r } { \mathcal { L } ( \Psi _ { f _ { g } , \epsilon } ) \ \leq \ C _ { 2 } ( \log ( 1 / \epsilon ) ) ^ { 2 } , } \end{array}$ , and $B ( \Psi _ { f _ { a } , \epsilon } ) ~ \leq ~ \pi _ { 1 } ( \epsilon ^ { - 1 } )$ . The claim is established by taking the network approximating $g ( x )$ to be $\Psi _ { f _ { g } , \epsilon } ^ { \prime } \lbrack x ) : = \Psi _ { f _ { g } , \epsilon } \bigl ( \frac { x } { D } \bigr )$ and noting that
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
\begin{array} { r l } & { \underset { x \in [ - D , D ] } { \operatorname* { s u p } } | \Psi _ { f _ { g } , \epsilon } ^ { \prime } ( x ) - g ( x ) | = \underset { x \in [ - D , D ] } { \operatorname* { s u p } } | \Psi _ { f _ { g } , \epsilon } ( \frac { x } { D } ) - f _ { g } ( \frac { x } { D } ) | } \\ & { \qquad = \underset { x \in [ - 1 , 1 ] } { \operatorname* { s u p } } | \Psi _ { f _ { g } , \epsilon } ( x ) - f _ { g } ( x ) | \le \epsilon , } \end{array}
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
$\mathcal { L } ( \Psi _ { f _ { g } , \epsilon } ^ { \prime } ) \leq C _ { 2 } ( \log ( 1 / \epsilon ) ) ^ { 2 } , \mathcal { W } ( \Psi _ { f _ { g } , \epsilon } ^ { \prime } ) \leq 1 6$ , and $B ( \Psi _ { f _ { g } , \epsilon } ) \leq ( 1 / D ) \pi _ { 1 } ( \epsilon ^ { - 1 } )$ .
|
| 584 |
+
|
| 585 |
+
It remains to prove the statement for the case $D > 1$ . This will be accomplished by approximating $f$ on intervals of length 2 (or less) and stitching the resulting approximations together using a localized partition of unity. To this end consider $a , b \in \mathbb { R }$ such that $1 \leq b - a \leq 2$ , and let $h \in C ^ { \infty } ( [ a , b ] , \mathbb { R } )$ with $\| h ^ { ( n ) } \| _ { L ^ { \infty } ( [ a , b ] ) } \leq n !$ , for all $n \in { \mathbb { N } } _ { 0 }$ . Next, note that the function 0 $\begin{array} { r } { x \mapsto h \left( \frac { b - a } { 2 } x + \frac { b + a } { 2 } \right) } \end{array}$ is in $S _ { 1 }$ . Hence, there exists, for every $\epsilon \in ( 0 , 1 / 2 )$ , a network $\Psi _ { h , \epsilon } ^ { \prime } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ such that $\begin{array} { r } { \operatorname* { s u p } _ { x \in [ - 1 , 1 ] } | \Psi _ { h , \epsilon } ^ { \prime } ( x ) - h \left( \frac { b - a } { 2 } x + \frac { b + a } { 2 } \right) | \leq \epsilon , \mathcal { L } ( \Psi _ { h , \epsilon } ^ { \prime } ) \leq C _ { 2 } ( \log ( 1 / \epsilon ) ) ^ { 2 } } \end{array}$ , and $B ( \Psi _ { h , \epsilon } ^ { \prime } ) \leq \pi _ { 1 } ( \epsilon ^ { - 1 } )$ . The networks $\begin{array} { r } { \Psi _ { h , \epsilon } ( x ) : = \Psi _ { h , \epsilon } ^ { \prime } \left( \frac { 2 } { b - a } x - \frac { b + a } { b - a } \right) } \end{array}$ then satisfy
|
| 586 |
+
|
| 587 |
+
$$
|
| 588 |
+
\operatorname* { s u p } _ { x \in [ a , b ] } | \Psi _ { h , \epsilon } ( x ) - h ( x ) | = \operatorname* { s u p } _ { y \in [ - 1 , 1 ] } | \Psi _ { h , \epsilon } ^ { \prime } ( y ) - h \left( \frac { b - a } { 2 } y + \frac { b + a } { 2 } \right) | \le \epsilon ,
|
| 589 |
+
$$
|
| 590 |
+
|
| 591 |
+
$\mathcal { L } ( \Psi _ { h , \epsilon } ) \leq C _ { 2 } ( \log ( 1 / \epsilon ) ) ^ { 2 }$ , h ${ \mathcal W } ( \Psi _ { h , \epsilon } ) \le 1 6$ and and $\begin{array} { r } { B ( \Psi _ { h , \epsilon } ) \leq \operatorname* { m a x } \lbrace 2 , | b | + | a | \rbrace \pi _ { 1 } ( \epsilon ^ { - 1 } ) } \end{array}$ . Now, for $D > 1$ $N _ { D } \in \mathbb { N }$ $\begin{array} { r } { 1 \le \frac { 2 D } { N _ { D } } \le 2 } \end{array}$
|
| 592 |
+
|
| 593 |
+
$$
|
| 594 |
+
\begin{array} { r } { I _ { D , k } : = \left[ \frac { ( k - 1 ) D } { N _ { D } } , \frac { ( k + 1 ) D } { N _ { D } } \right] , \ k \in \{ - N _ { D } , \ldots , N _ { D } \} . } \end{array}
|
| 595 |
+
$$
|
| 596 |
+
|
| 597 |
+
By equation 40 it follows that, for all $D > 1$ , $f \in S _ { D }$ , $k \in \{ - N _ { D } , \ldots , N _ { D } \}$ , and $\epsilon \in ( 0 , 1 / 2 )$ , there exists a network $\Psi _ { f , k , \epsilon } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ satisfying
|
| 598 |
+
|
| 599 |
+
$$
|
| 600 |
+
\operatorname* { s u p } _ { x \in I _ { D , k } } | \Psi _ { f , k , \epsilon } ( x ) - f ( x ) | \leq { \frac { \epsilon } { 4 } } ,
|
| 601 |
+
$$
|
| 602 |
+
|
| 603 |
+
$\mathcal { L } ( \Psi _ { f , k , \epsilon } ) \leq C _ { 2 } ( \log ( 4 / \epsilon ) ) ^ { 2 }$ , and $B ( \Psi _ { f , k , \epsilon } ) \le \operatorname* { m a x } \{ 2 , 2 | k | \} \pi _ { 1 } ( \epsilon ^ { - 1 } )$ . We next build a partition of unity through ReLU networks. Specifically, let $\chi ( x ) = \rho ( x + 1 ) - 2 \rho ( x ) + \rho ( x - 1 )$ , set $\begin{array} { r } { \chi _ { D , k } ( \dot { x } ) = \chi ( \frac { \mathbf { \tilde { { \rho } } } _ { N _ { D } } } { D } x - k ) } \end{array}$ , $D > 1 .$ , $k \in \mathbb { Z }$ , and note that $\chi _ { D , k } \in \mathcal { N N } _ { 2 , 3 , 1 , 1 }$ . This yields a partition of unity according to
|
| 604 |
+
|
| 605 |
+
$$
|
| 606 |
+
\sum _ { k \in \mathbb { Z } } \chi _ { D , k } ( x ) = 1 , \quad { \mathrm { f o r ~ a l l } } x \in \mathbb { R } .
|
| 607 |
+
$$
|
| 608 |
+
|
| 609 |
+
For $D > 1 , f \in { \mathcal { S } } _ { D } , \epsilon \in ( 0 , 1 / 2 )$ , let $f _ { \epsilon } \colon \mathbb { R } \to \mathbb { R }$ be given by
|
| 610 |
+
|
| 611 |
+
$$
|
| 612 |
+
f _ { \epsilon } ( x ) : = \sum _ { k = - N _ { D } } ^ { N _ { D } } \Phi _ { 2 , \epsilon / 4 } ( \chi _ { D , k } ( x ) , \Psi _ { f , k , \epsilon } ( x ) ) ,
|
| 613 |
+
$$
|
| 614 |
+
|
| 615 |
+
where $\Phi _ { 2 , \epsilon / 4 }$ is the multiplication network from Proposition 3.2. Note that $| f ( x ) | \leq 1$ , for all $x \in [ - D , \dot { D } ]$ , and $| \chi _ { D , k } ( \boldsymbol { x } ) | \le 1$ , for all $x \in [ - D , D ]$ , $k \in \{ - N _ { D } , \ldots , N _ { D } \}$ . Observe further that, for each $x \in [ - D , D ]$ , there are no more than 2 indices $k$ such that $\chi _ { D , k } ( \boldsymbol { x } ) \ne 0$ . Proposition 3.2 therefore implies that the sum in equation 43 has no more than 2 non-zero terms for each $x \in$ $[ - D , D ]$ . Combining equation 41, equation 42, and Proposition 3.2, and noting that $\operatorname { s u p p } ( \chi _ { D , k } ) =$ $I _ { D , k }$ , hence yields
|
| 616 |
+
|
| 617 |
+
$$
|
| 618 |
+
\| f _ { \epsilon } - f \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \epsilon ,
|
| 619 |
+
$$
|
| 620 |
+
|
| 621 |
+
for all $D > 1$ , $f \in S _ { D }$ , $\epsilon \in ( 0 , 1 / 2 )$ . It remains to be shown that the functions $f _ { \epsilon }$ can be realized by networks with the desired properties. To this end, consider for every $D > 1 , f \in S _ { D } , k \in$ $\{ \bar { 1 } , . . . , 2 N _ { D } + 1 \}$ , $\epsilon \in ( 0 , 1 / 2 )$ , the network $\alpha _ { f , k , \epsilon } \in \mathcal { N N } _ { \infty , 1 9 , 1 , 1 }$ given by
|
| 622 |
+
|
| 623 |
+
$$
|
| 624 |
+
\alpha _ { f , k , { \epsilon } } ( x ) : = \Phi _ { 2 , { \epsilon } / 4 } \big ( \chi _ { D , k - ( N _ { D } + 1 ) } ( x ) , \Psi _ { f , k - ( N _ { D } + 1 ) , { \epsilon } } ( x ) \big ) ,
|
| 625 |
+
$$
|
| 626 |
+
|
| 627 |
+
and the network $\beta _ { f , k , \epsilon } \in \mathcal { N N } _ { \infty , 2 3 , 3 , 3 }$ according to
|
| 628 |
+
|
| 629 |
+
$$
|
| 630 |
+
\beta _ { f , k , \epsilon } ( x _ { 1 } , x _ { 2 } , x _ { 3 } ) : = \left( \begin{array} { c } { { x _ { 1 } } } \\ { { \alpha _ { f , k , \epsilon } ( x _ { 2 } ) } } \\ { { x _ { 3 } } } \end{array} \right) .
|
| 631 |
+
$$
|
| 632 |
+
|
| 633 |
+
Further, set $\beta _ { 0 } ( x ) : = ( x , 0 , 0 ) ^ { T }$ and let $A \in \mathbb { R } ^ { 3 \times 3 }$ be such that $A ( y _ { 1 } , y _ { 2 } , y _ { 3 } ) ^ { T } = ( y _ { 1 } , y _ { 1 } , y _ { 2 } + y _ { 3 } ) ^ { T }$ , for all $y _ { 1 } , y _ { 2 } , y _ { 3 } \in \mathbb { R }$ . We can now define, for every $D > 1$ , $f \in S _ { D }$ , $\epsilon \in ( 0 , 1 / 2 )$ , the network $\Psi _ { f , \epsilon } \in \mathcal { N N } _ { \infty , 2 3 , 1 , 1 }$ given by
|
| 634 |
+
|
| 635 |
+
$$
|
| 636 |
+
\Psi _ { f , \epsilon } ( x ) : = ( 0 \ : \ : 1 \ : 1 ) \beta _ { f , 2 N _ { D } + 1 , \epsilon } ( A \beta _ { f , 2 N _ { D } , \epsilon } ( . . . ( A \beta _ { f , 1 , \epsilon } ( A \beta _ { 0 } ( x ) ) ) ) ) .
|
| 637 |
+
$$
|
| 638 |
+
|
| 639 |
+
Direct calculation shows that $f _ { \epsilon } ( x ) = \Psi _ { f , \epsilon } ( x )$ , for all $D > 1$ $1 , f \in \mathcal { S } _ { D } , \epsilon \in ( 0 , 1 / 2 ) , x \in \mathbb { R } .$ Furthermore, thanks to Proposition 3.2, there exists a constant $C _ { 3 } > 0$ such that, for all $D > 1$ , $f \in S _ { D }$ , $\epsilon \in ( 0 , 1 / 2 )$ ,
|
| 640 |
+
|
| 641 |
+
$$
|
| 642 |
+
\mathcal { W } ( \Psi _ { f , \epsilon } ) \leq 4 + \operatorname* { m a x } _ { k \in \{ 1 , \dots , 2 N _ { D } + 1 \} } \mathcal { W } ( \alpha _ { f , k , \epsilon } ) \leq 2 3 ,
|
| 643 |
+
$$
|
| 644 |
+
|
| 645 |
+
$$
|
| 646 |
+
\begin{array} { r l } & { \mathrel { \mathop : } ( \Psi _ { f , c } ) = 2 + \displaystyle \sum _ { k = 1 } ^ { 2 N _ { D } + 1 } \mathcal { L } ( \beta _ { f , k , \epsilon } ) = 2 + \displaystyle \sum _ { k = 1 } ^ { 2 N _ { D } + 1 } \big ( \mathcal { L } ( \Phi _ { 2 , \epsilon / 4 } ) + \operatorname* { m a x } \{ \mathcal { L } ( \chi _ { k - ( N _ { D } + 1 ) } ) , \mathcal { L } ( \Psi _ { f , k - ( N _ { D } + 1 ) , \epsilon } ) \} \big ) } \\ & { \qquad \leq 2 + ( 2 N _ { D } + 1 ) ( C _ { 1 } \log ( 1 6 \epsilon ^ { - 1 } ) + \operatorname* { m a x } \{ 2 , C _ { 2 } ( \log ( 4 \epsilon ^ { - 1 } ) ) ^ { 2 } \} ) \leq C _ { 3 } D ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } , } \end{array}
|
| 647 |
+
$$
|
| 648 |
+
|
| 649 |
+
and
|
| 650 |
+
|
| 651 |
+
$$
|
| 652 |
+
\mathcal { B } ( \Psi _ { f , \epsilon } ) = \operatorname* { m a x } _ { k \in \{ 1 , \dots , 2 N _ { D } + 1 \} } \mathcal { B } ( \alpha _ { f , k , \epsilon } ) \leq \operatorname* { m a x } \{ 8 , 4 D , \operatorname* { m a x } \{ 2 , 8 D \} \pi _ { 1 } ( \epsilon ^ { - 1 } ) \} \leq C ^ { \prime } [ D ] \pi _ { 1 } ( \epsilon ^ { - 1 } ) .
|
| 653 |
+
$$
|
| 654 |
+
|
| 655 |
+
This completes the proof.
|
| 656 |
+
|
| 657 |
+
# A.7 PROOF OF COROLLARY 4.2
|
| 658 |
+
|
| 659 |
+
Proof. For every $a , D \in \mathbb { R } _ { + }$ , $b \in \mathbb { R }$ , $\epsilon \in ( 0 , 1 / 2 )$ take the network given by $\Psi _ { a , b , D , \epsilon } ( x ) : =$ $\Psi _ { a , D + \frac { | b | } { a } , \epsilon } ( x - \textstyle { \frac { b } { a } } )$ with $\Psi _ { a , D + \frac { | b | } { a } , }$ according to Theorem 4.1 and observe that
|
| 660 |
+
|
| 661 |
+
$$
|
| 662 |
+
\operatorname* { s u p } _ { x \in [ - D , D ] } | \Psi _ { a , b , D , \epsilon } ( x ) - \cos ( a x - b ) | = \operatorname* { s u p } _ { [ - ( D + \frac { | b | } { a } ) , D + \frac { | b | } { a } ] } | \Psi _ { a , D + \frac { | b | } { a } , \epsilon } ( y ) - \cos ( a y ) | \le \epsilon .
|
| 663 |
+
$$
|
| 664 |
+
|
| 665 |
+
Applying Theorem 4.1 completes the proof.
|
| 666 |
+
|
| 667 |
+
# A.8 PROOF OF PROPOSITION 5.2
|
| 668 |
+
|
| 669 |
+
Proof. For all $D , a \ \in \ \mathbb { R } _ { + }$ , $f \in \mathcal { F } _ { D , a }$ , let $g _ { f } , h _ { f } \in \mathcal S _ { D }$ be functions such that $f = \cos ( a g _ { f } ) h _ { f }$ holds. Note that Lemma 3.5 guarantees the existence of a constant $C _ { 1 } ~ > ~ 0$ and a polynomial $\pi _ { 1 }$ such that for all $\begin{array} { r } { D , a \ \in \ \bar { \mathbb { R } } _ { + } , \ f \ \in \ { \mathcal { F } } _ { D , a } , \ \epsilon \ \in \ ( 0 , 1 / 2 ) } \end{array}$ there are networks $\Psi _ { h _ { f } , \epsilon } , \Psi _ { g _ { f } , \epsilon } \in$ $\mathcal { N N } _ { \infty , 2 3 , 1 , 1 }$ which satisfy $\mathcal { L } ( \Psi _ { h _ { f } , \epsilon } ) , \mathcal { L } ( \Psi _ { g _ { f } , \epsilon } ) \leq C _ { 1 } \lceil D \rceil ( \log ( [ \frac { \epsilon } { 1 2 \lceil a \rceil } ] ^ { - 1 } ) ) ^ { 2 } , \mathcal { B } ( \Psi _ { h _ { f } , \epsilon } ) , \mathcal { B } ( \Psi _ { g _ { f } , \epsilon } ) ,$ $\operatorname* { m a x } \{ 1 / D , \lceil D \rceil \pi _ { 1 } ( [ \frac { \epsilon } { 1 2 \lceil a \rceil } ] ^ { - 1 } ) \}$ and
|
| 670 |
+
|
| 671 |
+
$$
|
| 672 |
+
\begin{array} { r } { \| \Psi _ { g _ { f } , \epsilon } - g _ { f } \| _ { L ^ { \infty } ( [ - D , D ] ) } , \quad \| \Psi _ { h _ { f } , \epsilon } - h _ { f } \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \frac { \epsilon } { 1 2 \lceil a \rceil } . } \end{array}
|
| 673 |
+
$$
|
| 674 |
+
|
| 675 |
+
Theorem 4.1 further ensures the existence of a constant $C _ { 2 } > 0$ such that for all $a , D \in \mathbb { R } _ { + }$ , $\epsilon ~ \in ~ ( 0 , 1 / 2 )$ there is a neural network $\Phi _ { a , D , \epsilon } ~ \in ~ \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ which satisfies $\begin{array} { l l } { { \mathcal { L } ( \Phi _ { a , D , \epsilon } ) } } & { { \le } } \end{array}$ $C _ { 2 } ( ( \log ( 1 / \epsilon ) ) ^ { 2 } + \log ( \lceil a D \rceil ) )$ , $B ( \Phi _ { a , D , \epsilon } ) \leq C _ { 2 }$ , and
|
| 676 |
+
|
| 677 |
+
$$
|
| 678 |
+
\begin{array} { r } { \| \Phi _ { a , D , \epsilon } - \cos ( a \cdot ) \| _ { L ^ { \infty } ( [ - D , D ] ) } \leq \frac { \epsilon } { 3 } . } \end{array}
|
| 679 |
+
$$
|
| 680 |
+
|
| 681 |
+
Further, thanks to Proposition 3.2, there exists a constant $C _ { 3 } > 0$ such that for all $\epsilon \in ( 0 , 1 / 2 )$ there is a network $\mu _ { \epsilon } \in \mathcal { N N } _ { \infty , 1 2 , 2 , 1 }$ which satisfies $\mathcal { L } ( \mu _ { \epsilon } ) \leq C _ { 3 } \log ( 1 / \epsilon ) , \mathcal { B } ( \mu _ { \epsilon } ) \leq \operatorname* { m a x } \{ 4 , 2 \lceil D \rceil ^ { 2 } \}$ , and
|
| 682 |
+
|
| 683 |
+
$$
|
| 684 |
+
\operatorname* { s u p } _ { x , y \in [ - D , D ] } | \mu _ { \epsilon } ( x , y ) - x y | \leq \frac { \epsilon } { 3 } .
|
| 685 |
+
$$
|
| 686 |
+
|
| 687 |
+
For all $D , a \in \mathbb { R } _ { + } , f \in \mathcal { F } _ { D , a } , \epsilon \in ( 0 , 1 / 2 )$ we define the neural networks
|
| 688 |
+
|
| 689 |
+
$$
|
| 690 |
+
\begin{array} { r } { \Gamma _ { f , \epsilon } : = \mu _ { \epsilon } ( \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ) , \Psi _ { h _ { f } , \epsilon } ) . } \end{array}
|
| 691 |
+
$$
|
| 692 |
+
|
| 693 |
+
First, observe that Equation 45, Equation 46, and $\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathbb { R } } | \frac { d } { d x } \cos ( a x ) | = a } \end{array}$ imply for all $x \in$ $[ - D , D ]$ that
|
| 694 |
+
|
| 695 |
+
$$
|
| 696 |
+
\begin{array} { r l } & { | \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) - \cos ( a g _ { f } ( x ) ) | \le | \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) - \cos ( a \Psi _ { g _ { f } , \epsilon } ( x ) ) | } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad + | \cos ( a \Psi _ { g _ { f } , \epsilon } ( x ) ) - \cos ( a g _ { f } ( x ) ) | } \\ & { \quad \quad \quad \quad \quad \le \frac { \epsilon } { 3 } + a \frac { \epsilon } { 1 2 \lceil a \rceil } \le \frac { 5 \epsilon } { 1 2 } . } \end{array}
|
| 697 |
+
$$
|
| 698 |
+
|
| 699 |
+
Combining this with Equation 45, Equation 47, and $\| \cos \| _ { L ^ { \infty } [ - D , D ] } , \| f \| _ { L ^ { \infty } [ - D , D ] } \le 1$ yields for all $x \in [ - D , D ]$ that
|
| 700 |
+
|
| 701 |
+
$$
|
| 702 |
+
\begin{array} { r l } & { \left| \Gamma _ { f , \epsilon } ( x ) - f ( x ) \right| = \left| \mu _ { \epsilon } \bigl ( \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) , \Psi _ { h _ { f } , \epsilon } ( x ) \bigr ) - \cos ( a g _ { f } ( x ) ) h _ { f } ( x ) \right| } \\ & { \qquad \le \left| \mu _ { \epsilon } \bigl ( \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) , \Psi _ { h _ { f } , \epsilon } ( x ) \bigr ) - \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) \Psi _ { h _ { f } , \epsilon } ( x ) \right| } \\ & { \qquad + \left| \Phi _ { a , D , \epsilon } ( \Psi _ { g _ { f } , \epsilon } ( x ) ) \Psi _ { h _ { f } , \epsilon } ( x ) - \cos ( a g _ { f } ( x ) ) h _ { f } ( x ) \right| } \\ & { \qquad \le \frac { \epsilon } { 3 } + \frac { 5 \epsilon } { 1 2 } + \frac { \epsilon } { 1 2 \left[ a \right] } + \frac { 5 \epsilon } { 1 2 } \frac { \epsilon } { 1 2 \left[ a \right] } \le \epsilon . } \end{array}
|
| 703 |
+
$$
|
| 704 |
+
|
| 705 |
+
By construction there exists a constant $C _ { 4 }$ and a polynomial $\pi _ { 2 }$ such that for all $D , a \in \mathbb { R } _ { + }$ , $f \in \mathcal { F } _ { D , a }$ , $\epsilon \in ( 0 , 1 / 2 )$ it holds that $\mathcal { W } ( \Gamma _ { f , \epsilon } ) = 4 6$ ,
|
| 706 |
+
|
| 707 |
+
$\begin{array} { r } { \mathcal { L } ( \Gamma _ { f , \epsilon } ) \leq \mathcal { L } ( \mu _ { \epsilon } ) + \operatorname* { m a x } \{ \mathcal { L } ( \Phi _ { a , D , \epsilon } ) + \mathcal { L } ( \Psi _ { g _ { f } , \epsilon } ) , \mathcal { L } ( \Psi _ { h _ { f } , \epsilon } ) \} \leq C _ { 4 } [ D ] ( ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } + \log ( \lceil a \rceil ) ) , } \end{array}$ and
|
| 708 |
+
|
| 709 |
+
$$
|
| 710 |
+
\begin{array} { r } { \mathcal { B } ( \Gamma _ { f , \epsilon } ) \leq \operatorname* { m a x } \{ \mathcal { B } ( \mu _ { \epsilon } ) , \mathcal { B } ( \Phi _ { a , D , \epsilon } ) , \mathcal { B } ( \Psi _ { g _ { f } , \epsilon } ) , \mathcal { B } ( \Psi _ { h _ { f } , \epsilon } ) \} \leq \operatorname* { m a x } \{ 1 / D , \pi _ { 2 } ( \epsilon ^ { - 1 } , \lceil D \rceil , \lceil a \rceil ) \} . } \end{array}
|
| 711 |
+
$$
|
| 712 |
+
|
| 713 |
+
This completes the proof.
|
| 714 |
+
|
| 715 |
+
# A.9 PROOF OF PROPOSITION 5.3
|
| 716 |
+
|
| 717 |
+
Proof. For every $N \in { \mathbb { N } }$ , $p \in ( 0 , 1 / 2 )$ , $a \in \mathbb { R } _ { + }$ , $x \in \mathbb { R }$ , let $\begin{array} { r } { S _ { N , p , a } ( x ) = \sum _ { k = 0 } ^ { N } p ^ { k } \cos ( a ^ { k } \pi x ) } \end{array}$ . The geometric sum formula ensures that
|
| 718 |
+
|
| 719 |
+
$$
|
| 720 |
+
\left| S _ { N , p , a } ( x ) - W _ { p , a } ( x ) \right| \leq \sum _ { k = N + 1 } ^ { \infty } \left| p ^ { k } \cos ( a ^ { k } \pi x ) \right| \leq \sum _ { k = N + 1 } ^ { \infty } p ^ { k } = \frac { 1 } { 1 - p } - \frac { 1 - p ^ { N + 1 } } { 1 - p } \leq 2 ^ { - N } .
|
| 721 |
+
$$
|
| 722 |
+
|
| 723 |
+
Let $N _ { \epsilon } : = \lceil \log ( 2 / \epsilon ) \rceil$ , $\epsilon \in ( 0 , 1 / 2 )$ . Next note that Theorem 4.1 ensures the existence of a constant $C _ { 1 } > 0$ such that for all $a , D \in \mathbb { R } _ { + } , k \in \mathbb { N } _ { 0 } , \epsilon \in ( 0 , 1 / 2 )$ there is a network $\phi _ { a ^ { k } , D , \epsilon } \in \mathcal { N N } _ { \infty , 1 6 , 1 , 1 }$ which satisfies $\mathcal { L } ( \phi _ { a ^ { k } , D , \epsilon } ) \leq C _ { 1 } ( ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } + \log ( \lceil a ^ { k } \pi D \rceil ) ) , \mathcal { B } ( \phi _ { a ^ { k } , D , \epsilon } ) \leq C _ { 1 }$ , and
|
| 724 |
+
|
| 725 |
+
$$
|
| 726 |
+
\begin{array} { r } { \| \phi _ { a ^ { k } , D , \epsilon } - \cos ( a ^ { k } \pi \cdot ) \| _ { L ^ { \infty } ( [ - D , D ] ) } \le \frac { \epsilon } { 4 } . } \end{array}
|
| 727 |
+
$$
|
| 728 |
+
|
| 729 |
+
Thanks to $x = \rho ( x ) - \rho ( - x )$ and Lemma 2.3, there exists, for every $L \in \mathbb { N }$ , a neural network $\tau _ { L } \in \mathcal { N N } _ { L , 2 , 1 , 1 }$ which satisfies for all $x \in \mathbb { R }$ that $\tau _ { L } ( x ) = x$ . For all $p \in ( 0 , 1 / 2 )$ , $a , D \in \mathbb { R } _ { + }$ , $k \in { \mathbb { N } } _ { 0 }$ , $\epsilon \in ( 0 , 1 / 2 )$ , define the neural networks
|
| 730 |
+
|
| 731 |
+
$$
|
| 732 |
+
\psi _ { D , \epsilon } ^ { p , a , 0 } ( x ) = \left( p ^ { 0 } \phi _ { a ^ { 0 } , D , \epsilon } ^ { x } ( x ) \right) \quad \mathrm { a n d } \quad \psi _ { D , \epsilon } ^ { p , a , k } ( x _ { 1 } , x _ { 2 } , x _ { 3 } ) = \left( p ^ { k } \phi _ { a ^ { k } , D , \epsilon } ^ { x _ { 1 } } ( x _ { 2 } ) \right) , k > 0 ,
|
| 733 |
+
$$
|
| 734 |
+
|
| 735 |
+
and let $A \in \mathbb { R } ^ { 3 \times 3 }$ be such that $A ( y _ { 1 } , y _ { 2 } , y _ { 3 } ) ^ { T } = ( y _ { 1 } , y _ { 1 } , y _ { 2 } + y _ { 3 } ) ^ { T }$ , for all $\boldsymbol { y } \in \mathbb { R } ^ { 3 }$ . Consider now, for $p \in ( 0 , 1 / 2 )$ , $a , D \in \mathbb { R } _ { + }$ , $\epsilon \in ( 0 , 1 / 2 )$ , the network $\Psi _ { p , a , D , \epsilon }$ defined by
|
| 736 |
+
|
| 737 |
+
$$
|
| 738 |
+
\Psi _ { p , a , D , \epsilon } ( x ) : = ( 0 \mathrm { ~ ~ ~ 1 ~ ~ } 1 ) \psi _ { D , \epsilon } ^ { p , a , N _ { \epsilon } } ( A \psi _ { D , \epsilon } ^ { p , a , N _ { \epsilon } - 1 } ( . . . ( A \psi _ { D , \epsilon } ^ { p , a , 0 } ( x ) ) ) ) .
|
| 739 |
+
$$
|
| 740 |
+
|
| 741 |
+
Note Equation 50 combined with the geometric sum formula implies that for all $p \in ( 0 , 1 / 2 )$ , $a , D \in \mathbb { R } _ { + }$ , $\epsilon \in ( 0 , 1 / 2 )$ , $x \in [ - D , D ]$ we have
|
| 742 |
+
|
| 743 |
+
$$
|
| 744 |
+
\begin{array} { r l } & { | \Psi _ { p , a , D , \epsilon } ( x ) - S _ { N _ { \epsilon } , p , a } ( x ) | = \displaystyle \left| \sum _ { k = 0 } ^ { N _ { \epsilon } } p ^ { k } \phi _ { a ^ { k } , D , \epsilon } ( x ) - \sum _ { k = 0 } ^ { N _ { \epsilon } } p ^ { k } \cos ( a ^ { k } \pi x ) \right| } \\ & { \qquad \le \displaystyle \sum _ { k = 0 } ^ { N _ { \epsilon } } p ^ { k } | \phi _ { a ^ { k } , D , \epsilon } ( x ) - \cos ( a ^ { k } \pi x ) | \le \frac { \epsilon } { 4 } \sum _ { k = 1 } ^ { \infty } 2 ^ { - k } = \frac { \epsilon } { 2 } . } \end{array}
|
| 745 |
+
$$
|
| 746 |
+
|
| 747 |
+
Combining this with Equation 49 establishes that for all $p \in ( 0 , 1 / 2 )$ , $a , D \in \mathbb { R } _ { + }$ , $\epsilon \in ( 0 , 1 / 2 )$ $x \in [ - D , D ]$ it holds
|
| 748 |
+
|
| 749 |
+
$$
|
| 750 |
+
\begin{array} { r } { | \Psi _ { p , a , D , \epsilon } ( x ) - W _ { p , a } ( x ) | \leq 2 ^ { - \lceil { \log ( \frac { 2 } { \epsilon } ) } \rceil } + \frac { \epsilon } { 2 } \leq \frac { \epsilon } { 2 } + \frac { \epsilon } { 2 } = \epsilon . } \end{array}
|
| 751 |
+
$$
|
| 752 |
+
|
| 753 |
+
By construction there exists a constant $C _ { 2 }$ such that for all $p \in ( 0 , 1 / 2 )$ , $a , D \in \mathbb { R } _ { + }$ , $\epsilon \in ( 0 , 1 / 2 )$ we have $\mathcal { W } ( \Psi _ { p , a , D , \epsilon } ) = 2 0$ ,
|
| 754 |
+
|
| 755 |
+
$$
|
| 756 |
+
\begin{array} { r l r } { { \mathcal { L } ( \Psi _ { p , a , D , \epsilon } ) \leq \sum _ { k = 0 } ^ { N _ { \epsilon } } \mathcal { L } ( \phi _ { a ^ { k } , D , \epsilon } ) \leq ( N _ { \epsilon } + 1 ) C _ { 1 } ( ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } + \log ( \lceil a ^ { N _ { \epsilon } } \pi D \rceil ) ) } } \\ & { } & { \leq C _ { 2 } ( ( \log ( \epsilon ^ { - 1 } ) ) ^ { 3 } + ( \log ( \epsilon ^ { - 1 } ) ) ^ { 2 } \log ( \lceil a \rceil ) + \log ( \epsilon ^ { - 1 } ) \log ( D ) ) , } \end{array}
|
| 757 |
+
$$
|
| 758 |
+
|
| 759 |
+
and
|
| 760 |
+
|
| 761 |
+
$$
|
| 762 |
+
\mathcal { B } ( \Psi _ { p , a , D , \epsilon } ) = \operatorname* { m a x } _ { k \in \{ 0 , . . . , N _ { \epsilon } \} } \mathcal { B } ( \phi _ { a ^ { k } , D , \epsilon } ) = C _ { 1 } .
|
| 763 |
+
$$
|
| 764 |
+
|
| 765 |
+
This completes the proof.
|
| 766 |
+
|
| 767 |
+
# A.10 PROOF OF PROPOSITION 6.4
|
| 768 |
+
|
| 769 |
+
Proof. First note that for every polynomial $\tilde { \pi }$ it holds that $\tilde { \pi } ( \log ( t ) ) \in \mathcal { O } ( t ) , t \to \infty$ . Since $x \mapsto$ $( 2 \pi ( x ) ) ^ { L }$ is a polynomial, there exists $a \in \mathbb { N }$ such that $a > ( 2 \pi ( \log ( a ) ) ) ^ { L }$ . Lemma 6.2 now implies that any network $\Phi \in \mathcal { N N } _ { L , M , 1 , 1 }$ with $M \leq \pi ( \log ( a ) )$ is $( 2 \bar { \pi } ( \log ( a ) ) ) ^ { L }$ -sawtooth and therefore has less than $a$ -many different linear pieces. Hence there exists an interval $[ u _ { 1 } , u _ { 2 } ] \subseteq [ 0 , u ]$ with $u _ { 2 } - u _ { 1 } \geq ( u / a )$ on which $\Phi$ is linear. Since $u _ { 2 } - u _ { 1 } \geq ( u / a )$ the interval supports a full period of $f ( a \cdot )$ and we can therefore conclude that
|
| 770 |
+
|
| 771 |
+
$$
|
| 772 |
+
\begin{array} { r } { f ( a \cdot ) - \Phi \| _ { L ^ { \infty } ( [ 0 , u ] ) } \geq \| f ( a \cdot ) - \Phi \| _ { L ^ { \infty } ( [ u _ { 1 } , u _ { 2 } ] ) } \geq \underset { \delta \in [ 0 , u ] , \atop c , d \in \mathbb { R } } { \operatorname* { i n f } } \| f ( x ) - ( c x + d ) \| _ { L ^ { \infty } ( [ \delta , u + \delta ] ) } = \xi ( f ) . } \end{array}
|
| 773 |
+
$$
|
| 774 |
+
|
| 775 |
+
Finally note, that $\xi ( f ) > 0$ holds by assumption, since any continuous $u$ -periodic function which is linear on an interval of length $u$ must be constant.
|
| 776 |
+
|
| 777 |
+
# A.11 PROOF OF THEOREM 6.6
|
| 778 |
+
|
| 779 |
+
Proof. The proof will be effected by contradiction. Assume that for every $\epsilon > 0$ there exists a network $\Phi _ { \epsilon } \overset { \cdot } { \in } \mathcal { N } \mathcal { N } _ { L , M , 1 , 1 }$ with $M \stackrel { \cdot } { \leq } \pi ( \log ( \epsilon ^ { - 1 } ) )$ and $\| f - \Phi _ { \epsilon } \| _ { L ^ { \infty } ( [ a , b ] ) } \stackrel { . } { \leq } \epsilon$ . Since every ReLU network is piecewise linear we can now apply Theorem 6.5 to conclude that there exists a constant $C$ such that for all $\epsilon > 0$ the network $\Phi _ { \epsilon }$ must have at least $C \epsilon ^ { - \frac { 1 } { 2 } }$ many different linear pieces. This leads to a contradiction as, by assumption combined with Lemma 6.2, $\Phi _ { \epsilon }$ is $( 2 \pi ( \log ( \epsilon ^ { - 1 } ) ) ) ^ { L }$ - sawtooth and it holds for every polynomial $\tilde { \pi }$ that $\tilde { \pi } ( \log ( \epsilon ^ { - 1 } ) ) \in o ( \epsilon ^ { - 1 / 2 } )$ , $\epsilon 0$ . □
|
md/train/rJx1Na4Fwr/rJx1Na4Fwr.md
ADDED
|
@@ -0,0 +1,574 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MACER: ATTACK-FREE AND SCALABLE ROBUST TRAINING VIA MAXIMIZING CERTIFIED RADIUS
|
| 2 |
+
|
| 3 |
+
Runtian Zhai1∗, Chen $\mathbf { D a n } ^ { 2 * }$ , Di $\mathbf { H e ^ { 1 * } }$ , Huan Zhang3, Boqing Gong4, Pradeep Ravikumar2, Cho-Jui Hsieh3 & Liwei Wang1 1Peking University 2CMU 3UCLA 4Google ∗Equal Contribution
|
| 4 |
+
|
| 5 |
+
{zhairuntian, di he}@pku.edu.cn, {cdan, pradeepr}@cs.cmu.edu,
|
| 6 |
+
|
| 7 |
+
huanzhang@ucla.edu, boqinggo@outlook.com, chohsieh@cs.ucla.edu, wanglw@cis.pku.edu.c
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Adversarial training is one of the most popular ways to learn robust models but is usually attack-dependent and time costly. In this paper, we propose the MACER algorithm, which learns robust models without using adversarial training but performs better than all existing provable $l _ { 2 }$ -defenses. Recent work (Cohen et al., 2019) shows that randomized smoothing can be used to provide a certified $l _ { 2 }$ radius to smoothed classifiers, and our algorithm trains provably robust smoothed classifiers via MAximizing the CErtified Radius (MACER). The attack-free characteristic makes MACER faster to train and easier to optimize. In our experiments, we show that our method can be applied to modern deep neural networks on a wide range of datasets, including Cifar-10, ImageNet, MNIST, and SVHN. For all tasks, MACER spends less training time than state-of-the-art adversarial training algorithms, and the learned models achieve larger average certified radii.
|
| 12 |
+
|
| 13 |
+
Our code is available at https://github.com/RuntianZ/macer.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Modern neural network classifiers are able to achieve very high accuracy on image classification tasks but are sensitive to small, adversarially chosen perturbations to the inputs (Szegedy et al., 2013; Biggio et al., 2013). Given an image $x$ that is correctly classified by a neural network, a malicious attacker may find a small adversarial perturbation $\delta$ such that the perturbed image $x + \delta$ , though visually indistinguishable from the original image, is assigned to a wrong class with high confidence by the network. Such vulnerability creates security concerns in many real-world applications.
|
| 18 |
+
|
| 19 |
+
Researchers have proposed a variety of defense methods to improve the robustness of neural networks. Most of the existing defenses are based on adversarial training (Szegedy et al., 2013; Madry et al., 2017; Goodfellow et al., 2015; Huang et al., 2015; Athalye et al., 2018; Ding et al., 2020). During training, these methods first learn on-the-fly adversarial examples of the inputs with multiple attack iterations and then update model parameters using these perturbed samples together with the original labels. However, such approaches depend on a particular (class of) attack method. It cannot be formally guaranteed whether the resulting model is also robust against other attacks. Moreover, attack iterations are usually quite expensive. As a result, adversarial training runs very slowly.
|
| 20 |
+
|
| 21 |
+
Another line of algorithms trains robust models by maximizing the certified radius provided by robust certification methods (Weng et al., 2018; Wong & Kolter, 2018; Zhang et al., 2018; Mirman et al., 2018; Wang et al., 2018; Gowal et al., 2018; Zhang et al., 2019c). Using linear or convex relaxations of fully connected ReLU networks, a robust certification method computes a “safe radius” $r$ for a classifier at a given input such that at any point within the neighboring radius- $\cdot r$ ball of the input, the classifier is guaranteed to have unchanged predictions. However, the certification methods are usually computationally expensive and can only handle shallow neural networks with ReLU activations, so these training algorithms have troubles in scaling to modern networks.
|
| 22 |
+
|
| 23 |
+
In this work, we propose an attack-free and scalable method to train robust deep neural networks. We mainly leverage the recent randomized smoothing technique (Cohen et al., 2019). A randomized smoothed classifier $g$ for an arbitrary classifier $f$ is defined as $g ( x ) = \mathbb { E } _ { \eta } f ( x + \eta )$ , in which $\eta \sim$ ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ . While Cohen et al. (2019) derived how to analytically compute the certified radius of the randomly smoothed classifier $g$ , they did not show how to maximize that radius to make the classifier $g$ robust. Salman et al. (2019) proposed SmoothAdv to improve the robustness of $g$ , but it still relies on the expensive attack iterations. Instead of adversarial training, we propose to learn robust models by directly taking the certified radius into the objective. We outline a few challenging desiderata any practical instantiation of this idea would however have to satisfy, and provide approaches to address each of these in turn. A discussion of these desiderata, as well as a detailed implementation of our approach is provided in Section 4. And as we show both theoretically and empirically, our method is numerically stable and accounts for both classification accuracy and robustness.
|
| 24 |
+
|
| 25 |
+
Our contributions are summarized as follows:
|
| 26 |
+
|
| 27 |
+
• We propose an attack-free and scalable robust training algorithm by MAximizing the CErtified Radius (MACER). MACER has the following advantages compared to previous works: – Different from adversarial training, we train robust models by directly maximizing the certified radius without specifying any attack strategies, and the learned model can achieve provable robustness against any possible attack in the certified region. Additionally, by avoiding time-consuming attack iterations, our proposed algorithm runs much faster than adversarial training. Different from other methods (Wong & Kolter, 2018) that maximize the certified radius but are not scalable to deep neural networks, our method can be applied to architectures of any size. This makes our algorithm more practical in real scenarios.
|
| 28 |
+
|
| 29 |
+
• We empirically evaluate our proposed method through extensive experiments on Cifar-10, ImageNet, MNIST, and SVHN. On all tasks, MACER achieves better performance than state-of-the-art algorithms. MACER is also exceptionally fast. For example, on ImageNet, MACER uses $39 \%$ less training time than adversarial training but still performs better.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Neural networks trained by standard SGD are not robust – a small and human imperceptible perturbation can easily change the prediction of a network. In the white-box setting, methods have been proposed to construct adversarial examples with small $\ell _ { \infty }$ or $\ell _ { 2 }$ perturbations (Goodfellow et al., 2015; Madry et al., 2017; Carlini & Wagner, 2016; Moosavi-Dezfooli et al., 2015). Furthermore, even in the black-box setting where the adversary does not have access to the model structure and parameters, adversarial examples can be found by either transfer attack (Papernot et al., 2016) or optimization-based approaches (Chen et al., 2017; Rauber et al., 2017; Cheng et al., 2019). It is thus important to study how to improve the robustness of neural networks against adversarial examples.
|
| 34 |
+
|
| 35 |
+
Adversarial training So far, adversarial training has been the most successful robust training method according to many recent studies. Adversarial training was first proposed in Szegedy et al. (2013) and Goodfellow et al. (2015), where they showed that adding adversarial examples to the training set can improve the robustness against such attacks. More recently, Madry et al. (2017) formulated adversarial training as a min-max optimization problem and demonstrated that adversarial training with PGD attack leads to empirical robust models. Zhang et al. (2019b) further decomposed the robust error as the sum of natural error and boundary error for better performance. Finally, Gao et al. (2019) proved the convergence of adversarial training. Although models obtained by adversarial training empirically achieve good performance, they do not have certified error guarantees.
|
| 36 |
+
|
| 37 |
+
Despite the popularity of PGD-based adversarial training, one major issue is that its speed is too slow. Some recent papers propose methods to accelerate adversarial training. For example, Freem (Shafahi et al., 2019) replays an adversarial example several times in one iteration, YOPO-m-n (Zhang et al., 2019a) restricts back propagation in PGD within the first layer, and Qin et al. (2019) estimates the adversary with local linearization.
|
| 38 |
+
|
| 39 |
+
Robustness certification and provable defense Many defense algorithms proposed in the past few years were claimed to be effective, but Athalye et al. (2018) showed that most of them are based on “gradient masking” and can be bypassed by more carefully designed attacks. It is thus important to study how to measure the provable robustness of a network. A robustness certification algorithm takes a classifier $f$ and an input point $x$ as inputs, and outputs a “safe radius” $r$ such that for any $\delta$ subject to $\| \delta \| \leq r$ , $f ( x ) = f ( x + \delta )$ . Several algorithms have been proposed recently, including the convex polytope technique (Wong & Kolter, 2018), abstract interpretation methods (Singh et al., 2018; Gehr et al., 2018) and the recursive propagation algrithms (Weng et al., 2018; Zhang et al.,
|
| 40 |
+
|
| 41 |
+
2018). These methods can provide attack-agnostic robust error lower bounds. Moreover, to achieve networks with nontrivial certified robust error, one can train a network by minimizing the certified robust error computed by the above-mentioned methods, and several algorithms have been proposed in the past year (Wong & Kolter, 2018; Wong et al., 2018; Wang et al., 2018; Gowal et al., 2018; Zhang et al., $2 0 1 9 \mathrm { c }$ ; Mirman et al., 2018). Unfortunately, they can only be applied to shallow networks with limited activation and run very slowly.
|
| 42 |
+
|
| 43 |
+
More recently, researchers found a new class of certification methods called randomized smoothing. The idea of randomization has been used for defense in several previous works (Xie et al., 2017; Liu et al., 2018) but without any certification. Later on, Lecuyer et al. (2018) first showed that if a Gaussian random noise is added to the input or any intermediate layer. A certified guarantee on small $\ell _ { 2 }$ perturbation can be computed via differential privacy. Li et al. (2018) and Cohen et al. (2019) then provided improved ways to compute the $\ell _ { 2 }$ certified robust error for Gaussian smoothed models. In this paper, we propose a new algorithm to train on these $\ell _ { 2 }$ certified error bounds to significantly reduce the certified error and achieve better provable adversarial robustness.
|
| 44 |
+
|
| 45 |
+
# 3 PRELIMINARIES
|
| 46 |
+
|
| 47 |
+
Problem setup Consider a standard classification task with an underlying data distribution $p _ { \mathrm { d a t a } }$ over pairs of examples $x \in \mathcal { X } \subset \mathbb { R } ^ { d }$ and corresponding labels $y \in \mathcal { Y } = \mathsf { \bar { \{ 1 , 2 , \cdots , K \} } }$ . Usually $p _ { \mathrm { d a t a } }$ is unknown and we can only access a training set ${ \mathcal { S } } = \{ ( x _ { 1 } , y _ { 1 } ) , \cdot \cdot \cdot , ( x _ { n } , y _ { n } ) \}$ in which $( x _ { i } , y _ { i } )$ is i.i.d. drawn from $p _ { \mathrm { d a t a } }$ , $i = 1 , 2 , \cdots , n$ . The empirical data distribution (uniform distribution over $s$ ) is denoted by $\hat { p } _ { \mathrm { d a t a } }$ . Let $f \in { \mathcal { F } }$ be the classifier of interest that maps any $x \in \mathcal { X }$ to $\mathcal { V }$ . Usually $f$ is parameterized by a set of parameters $\theta$ , so we also write it as $f _ { \theta }$ .
|
| 48 |
+
|
| 49 |
+
We call $x ^ { \prime } = x + \delta$ an adversarial example of $x$ to classifier $f _ { \theta }$ if $f _ { \theta }$ can correctly classify $x$ but assigns a different label to $x ^ { \prime }$ . Following many previous works (Cohen et al., 2019; Salman et al., 2019), we focus on the setting where $\delta$ satisfies $\ell _ { 2 }$ norm constraint $\| \delta \| _ { 2 } \le \epsilon$ . We say that the model $f _ { \theta }$ is $l _ { 2 } ^ { \epsilon }$ -robust at $( x , y )$ if it correctly classifies $x$ as $y$ and for any $\lVert \delta \rVert _ { 2 } \leq \epsilon$ , the model classifies $x { + } \delta$ as $y$ . In the problem of robust classification, our ultimate goal is to find a model that is $l _ { 2 } ^ { \epsilon }$ -robust at $( x , y )$ with high probability over $( x , y ) \sim p _ { \mathrm { d a t a } }$ for a given $\epsilon > 0$ .
|
| 50 |
+
|
| 51 |
+
Neural network In image classification we often use deep neural networks. Let $u _ { \theta } : \mathcal { X } \to \mathbb { R } ^ { K }$ be a neural network, whose output at input $x$ is a vector $( u _ { \theta } ^ { 1 } ( \dot { x } ) , . . . , u _ { \theta } ^ { K } ( x ) )$ . The classifier induced by $u _ { \theta } ( x )$ is $f _ { \theta } ( x ) = \arg \operatorname* { m a x } _ { c \in \mathcal { V } } u _ { \theta } ^ { c } ( x )$ .
|
| 52 |
+
|
| 53 |
+
In order to train $\theta$ by minimizing a loss function such as cross entropy, we always use a softmax layer on $u _ { \theta }$ to normalize it into a probability distribution. The resulting network is $z _ { \theta } ( \cdot ; \beta ) : \mathcal { X } \to \mathcal { P } ( \dot { K } ) ^ { 1 }$ , which is given by $z _ { \theta } ^ { c } ( x ; \beta ) = e ^ { \beta u _ { \theta } ^ { c } ( x ) } / \sum _ { c ^ { \prime } \in \mathcal { V } } e ^ { \beta u _ { \theta } ^ { c ^ { \prime } } ( x ) }$ , $\forall c \in \mathcal { D }$ , $\beta$ is the inverse temperature. For simplicity, we will use $z _ { \theta } ( x )$ to refer to $z _ { \theta } ( x ; \beta )$ when the meaning is clear from context. The vector $z _ { \theta } ( \dot { x } ) = \dot { ( } z _ { \theta } ^ { 1 } ( x ) , \cdot \cdot \cdot , z _ { \theta } ^ { K } \dot { ( } x \dot { ) } )$ is commonly regarded as the “likelihood vector”, and $z _ { \theta } ^ { c } ( x )$ measures how likely input $x$ belongs to class $c$ .
|
| 54 |
+
|
| 55 |
+
Robust radius By definition, the $l _ { 2 } ^ { \epsilon }$ -robustness of $f _ { \theta }$ at a data point $( x , y )$ depends on the radius of the largest $l _ { 2 }$ ball centered at $x$ in which $f _ { \theta }$ does not change its prediction. This radius is called the robust radius, which is formally defined as
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
R ( f _ { \theta } ; x , y ) = { \left\{ \begin{array} { l l } { \displaystyle \operatorname* { i n f } _ { f _ { \theta } ( x ^ { \prime } ) \neq f _ { \theta } ( x ) } \| x ^ { \prime } - x \| _ { 2 } , { \mathrm { w h e n ~ } } f _ { \theta } ( x ) = y } \\ { \qquad 0 \qquad , { \mathrm { w h e n ~ } } f _ { \theta } ( x ) \neq y } \end{array} \right. }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Recall that our ultimate goal is to train a classifier which is $l _ { 2 } ^ { \epsilon }$ -robust at $( x , y )$ with high probability over the sampling of $( x , y ) \sim p _ { \mathrm { d a t a } }$ . Mathematically the goal can be expressed as to minimize the expectation of the 0/1 robust classification error. The error is defined as
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
l _ { \epsilon - \mathrm { r o b u s t } } ^ { 0 / 1 } ( f _ { \theta } ; x , y ) : = 1 - \mathbf { 1 } _ { \{ R ( f _ { \theta } ; x , y ) \geq \epsilon \} } ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
and the goal is to minimize its expectation over the population
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
L _ { \epsilon - \mathrm { r o b u s t } } ^ { 0 / 1 } ( f _ { \theta } ) : = \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a t a } } } l _ { \epsilon - \mathrm { r o b u s t } } ^ { 0 / 1 } ( f _ { \theta } ; x , y ) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
It is thus quite natural to improve model robustness via maximizing the robust radius. Unfortunately, computing the robust radius (1) of a classifier induced by a deep neural network is very difficult. Weng et al. (2018) showed that computing the $l _ { 1 }$ robust radius of a deep neural network is NP-hard. Although there is no result for the $l _ { 2 }$ radius yet, it is very likely that computing the $l _ { 2 }$ robust radius is also NP-hard.
|
| 74 |
+
|
| 75 |
+
Certified radius Many previous works proposed certification methods that seek to derive a tight lower bound of $R ( f _ { \theta } ; x , y )$ for neural networks (see Section 2 for related work). We call this lower bound certified radius and denote it by $C R ( f _ { \theta } ; x , y )$ . The certified radius satisfies $0 \le C R ( f _ { \theta } ; x , y ) \le R ( f _ { \theta } ; x , y )$ for any $f _ { \boldsymbol { \theta } } , \boldsymbol { x } , \boldsymbol { y }$ .
|
| 76 |
+
|
| 77 |
+
The certified radius leads to a guaranteed upper bound of the $_ { 0 / 1 }$ robust classification error, which is called $\mathit { O } \nearrow I$ certified robust error. The $_ { 0 / 1 }$ certified robust error of classifier $f _ { \theta }$ on sample $( x , y )$ is defined as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
l _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( f _ { \theta } ; x , y ) : = 1 - \mathbf { 1 } _ { \{ C R ( f _ { \theta } ; x , y ) \ge \epsilon \} }
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
i.e. a sample is counted as correct only if the certified radius reaches $\epsilon$ . The expectation of certified robust error over $( x , y ) \sim p _ { \mathrm { d a t a } }$ serves as a performance metric of the provable robustness:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
L _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( f _ { \theta } ) : = \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a t a } } } l _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( f _ { \theta } ; x , y )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
$C R ( f _ { \theta } ; x , y )$ wer bound of the true. Therefore, a small ust radius, which immediately implies certified robust error leads to a small $L _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( f _ { \theta } ) \ge L _ { \epsilon - \mathrm { r o b u s t } } ^ { 0 / 1 } ( f _ { \theta } )$ $_ { 0 / 1 }$ $_ { 0 / 1 }$ robust classification error.
|
| 90 |
+
|
| 91 |
+
Randomized smoothing In this work, we use the recent randomized smoothing technique (Cohen et al., 2019), which is scalable to any architectures, to obtain the certified radius of smoothed deep neural networks. The key part of randomized smoothing is to use the smoothed version of $f _ { \theta }$ , which is denoted by $g _ { \theta }$ , to make predictions. The formulation of $g _ { \theta }$ is defined as follows.
|
| 92 |
+
|
| 93 |
+
Definition 1. For an arbitrary classifier $f _ { \theta } \in { \mathcal { F } }$ and $\sigma > 0$ , the smoothed classifier gθ of $f _ { \theta }$ is defined as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
g _ { \theta } ( x ) = \underset { c \in \mathcal { V } } { \arg \operatorname* { m a x } } P _ { \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I ) } ( f _ { \theta } ( x + \eta ) = c )
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
In short, the smoothed classifier $g _ { \boldsymbol { \theta } } ( x )$ returns the label most likely to be returned by $f _ { \theta }$ when its input is sampled from a Gaussian distribution ${ \mathcal { N } } ( x , \sigma ^ { 2 } I )$ centered at $x$ . Cohen et al. (2019) proves the following theorem, which provides an analytic form of certified radius:
|
| 100 |
+
|
| 101 |
+
Theorem 1. (Cohen et al., 2019) Let $f _ { \boldsymbol { \theta } } \in \mathcal { F } _ { : }$ , and $\eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ . Let the smoothed classifier gθ be defined as in (6). Let the ground truth of an input $x$ be $y$ . If gθ classifies $x$ correctly, i.e.
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
P _ { \eta } ( f _ { \theta } ( x + \eta ) = y ) \ge \operatorname* { m a x } _ { y ^ { \prime } \ne y } P _ { \eta } ( f _ { \theta } ( x + \eta ) = y ^ { \prime } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Then gθ is provably robust at $x$ , with the certified radius given by
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { l } { { \displaystyle C R ( g _ { \theta } ; x , y ) = \frac { \sigma } { 2 } [ \Phi ^ { - 1 } ( P _ { \eta } ( f _ { \theta } ( x + \eta ) = y ) ) - \Phi ^ { - 1 } ( \underset { y ^ { \prime } \neq y } { \operatorname* { m a x } } P _ { \eta } ( f _ { \theta } ( x + \eta ) = y ^ { \prime } ) ) ] } } \\ { { \displaystyle \qquad = \frac { \sigma } { 2 } [ \Phi ^ { - 1 } ( \mathbb { E } _ { \eta } { \bf 1 } _ { \{ f _ { \theta } ( x + \eta ) = y \} } ) - \Phi ^ { - 1 } ( \underset { y ^ { \prime } \neq y } { \operatorname* { m a x } } \mathbb { E } _ { \eta } { \bf 1 } _ { \{ f _ { \theta } ( x + \eta ) = y ^ { \prime } \} } ) ] } } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\Phi$ is the c.d.f. of the standard Gaussian distribution.
|
| 114 |
+
|
| 115 |
+
# 4 ROBUST TRAINING VIA MAXIMIZING THE CERTIFIED RADIUS
|
| 116 |
+
|
| 117 |
+
As we can see from Theorem 1, the value of the certified radius can be estimated by repeatedly sampling Gaussian noises. More importantly, it can be computed for any deep neural networks. This motivates us to design a training method to maximize the certified radius and learn robust models.
|
| 118 |
+
|
| 119 |
+
To minimize the 0/1 robust classification error in (3) or the 0/1 certified robust error in (5), many previous works (Zhang et al., 2019b; Zhai et al., 2019) proposed to first decompose the error. Note that a classifier $g _ { \theta }$ has a positive 0/1 certified robust error on sample $( x , y )$ if and only if exactly one of the following two cases happens:
|
| 120 |
+
|
| 121 |
+
• $g _ { \boldsymbol { \theta } } ( x ) \neq y$ , i.e. the classifier misclassifies $x$ .
|
| 122 |
+
• $g _ { \boldsymbol { \theta } } ( x ) = y$ , but $C R ( g _ { \theta } ; x , y ) < \epsilon$ , i.e. the classifier is correct but not robust enough.
|
| 123 |
+
|
| 124 |
+
Thus, the 0/1 certified robust error can be decomposed as the sum of two error terms: a $_ { 0 / 1 }$ classification error and a $_ { 0 / 1 }$ robustness error:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\begin{array} { r l } & { l _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( g _ { \theta } ; x , y ) = 1 - \mathbf { 1 } _ { \{ C R ( g _ { \theta } ; x , y ) \geq \epsilon \} } } \\ & { \quad \quad \quad = \underbrace { \mathbf { 1 } _ { \{ g _ { \theta } ( x ) \neq y \} } } _ { \mathrm { 0 / l ~ C l a s s i f i c a t i o n ~ E r r o r } } + \underbrace { \mathbf { 1 } _ { \{ g _ { \theta } ( x ) = y , C R ( g _ { \theta } ; x , y ) < \epsilon \} } } _ { \mathrm { 0 / l ~ R o b u s t n e s s ~ E r r o r } } } \end{array}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
# 4.1 DESIDERATA FOR OBJECTIVE FUNCTIONS
|
| 131 |
+
|
| 132 |
+
Minimizing the 0-1 error directly is intractable. A classic method is to minimize a surrogate loss instead. The surrogate loss for the 0/1 classification error is called classification loss and denoted by $l _ { C } ( g _ { \theta } ; x , y )$ . The surrogate loss for the 0/1 robustness error is called robustness loss and denoted by $l _ { R } ( g _ { \theta } ; x , y )$ . Our final objective function is
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
l ( g _ { \theta } ; x , y ) = l _ { C } ( g _ { \theta } ; x , y ) + l _ { R } ( g _ { \theta } ; x , y )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
We would like our loss functions $l _ { C } ( g _ { \theta } ; x , y )$ and $l _ { R } ( g _ { \theta } ; x , y )$ to satisfy some favorable conditions. These conditions are summarized below as (C1) - (C3):
|
| 139 |
+
|
| 140 |
+
• (C1) (Surrogate condition): Surrogate loss should be an upper bound of the original error function, i.e. $l _ { C } ( g _ { \theta } ; x , y )$ and ${ \bar { l } } _ { R } ( g _ { \theta } ; x , y )$ should be upper bounds of $\mathbf { 1 } _ { \{ g _ { \theta } ( x ) \neq y \} }$ and $\mathbf { 1 } _ { \{ g _ { \theta } ( x ) = y , C R ( g _ { \theta } ; x , y ) < \epsilon \} }$ , respectively.
|
| 141 |
+
• (C2) (Differentiablity): $l _ { C } ( g _ { \theta } ; x , y )$ and $l _ { R } ( g _ { \theta } ; x , y )$ should be (sub-)differentiable with respect to $\theta$ .
|
| 142 |
+
• (C3) (Numerical stability): The computation of $l _ { C } ( g _ { \theta } ; x , y )$ and $l _ { R } ( g _ { \theta } ; x , y )$ and their (sub)gradients with respect to $\theta$ should be numerically stable.
|
| 143 |
+
|
| 144 |
+
The surrogate condition (C1) ensures that $l ( g _ { \boldsymbol { \theta } } ; x , y )$ itself meets the surrogate condition, i.e.
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
l ( g _ { \theta } ; x , y ) = l _ { C } ( g _ { \theta } ; x , y ) + l _ { R } ( g _ { \theta } ; x , y ) \geq l _ { \epsilon - \mathrm { c e r t i f i e d } } ^ { 0 / 1 } ( g _ { \theta } ; x , y )
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Conditions (C2) and (C3) ensure that (10) can be stably minimized with first order methods.
|
| 151 |
+
|
| 152 |
+
# 4.2 SURROGATE LOSSES (FOR CONDITION C1)
|
| 153 |
+
|
| 154 |
+
We next discuss choices of the surrogate losses that ensure we satisfy condition (C1). The classification surrogate loss is relatively easy to design. There are many widely used loss functions from which we can choose, and in this work we choose the cross-entropy loss as the classification loss:
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\mathbf { 1 } _ { \{ g _ { \theta } ( x ) \neq y \} } \leq l _ { C } ( g _ { \theta } ; x , y ) : = l _ { C E } ( g _ { \theta } ( x ) , y )
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
For the robustness surrogate loss, we choose the hinge loss on the certified radius:
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\begin{array} { r l } & { \mathbf { 1 } _ { \left\{ g _ { \theta } ( x ) = y , C R ( g _ { \theta } ; x , y ) < \epsilon \right\} } } \\ & { \leq \lambda \cdot \operatorname* { m a x } \left\{ \epsilon + \tilde { \epsilon } - C R ( g _ { \theta } ; x , y ) , 0 \right\} \cdot \mathbf { 1 } _ { \left\{ g _ { \theta } ( x ) = y \right\} } : = l _ { R } ( g _ { \theta } ; x , y ) } \end{array}
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where $\tilde { \epsilon } > 0$ and $\lambda \geq \frac { 1 } { \tilde { \epsilon } }$ . We use the hinge loss because not only does it satisfy the surrogate condition, but also it is numerically stable, which we will discuss in Section 4.4.
|
| 167 |
+
|
| 168 |
+
# 4.3 DIFFERENTIABLE CERTIFIED RADIUS VIA SOFT RANDOMIZED SMOOTHING (FOR CONDITION C2)
|
| 169 |
+
|
| 170 |
+
The classification surrogate loss in (12) is differentiable with respect to $\theta$ , but the differentiability of the robustness surrogate loss in (13) requires differentiability of $C R ( g _ { \theta } ; x , y )$ . In this section we will show that the randomized smoothing certified radius in (8) does not meet condition (C2), and accordingly, we will introduce soft randomized smoothing to solve this problem.
|
| 171 |
+
|
| 172 |
+
Whether the certified radius (8) is sub-differentiable with respect to $\theta$ boils down to the differentiablity of $\mathbb { E } _ { \eta } \mathbf { 1 } _ { \{ f _ { \theta } ( x + \eta ) = y \} }$ . Theoretically, the expectation is indeed differentiable. However, $\begin{array} { r } { \mathbb { E } _ { \eta } \mathbf { 1 } _ { \{ f _ { \theta } ( x + \eta ) = y \} } \approx \frac { 1 } { k } \sum _ { j = 1 } ^ { k } \mathbf { 1 } _ { \{ f _ { \theta } ( x + \eta _ { j } ) = y \} } } \end{array}$ ation ne, where $\eta _ { j }$ s to be estimated by Monteis i.i.d Gaussian noise and $k$ arlo samplingis the number condition (C2) is still not met from the algorithmic perspective.
|
| 173 |
+
|
| 174 |
+
To tackle this problem, we leverage soft randomized smoothing (Soft-RS). In contrast to the original version of randomized smoothing (Hard-RS), Soft-RS is applied to a neural network $z _ { \theta } ( x )$ whose last layer is softmax. The soft smoothed classifier $\scriptstyle { \tilde { g } } _ { \theta }$ is defined as follows.
|
| 175 |
+
|
| 176 |
+
Definition 2. For a neural network $z _ { \theta } : \mathcal { X } \mathcal { P } ( K )$ whose last layer is softmax and $\sigma > 0$ , the soft smoothed classifier $\scriptstyle { \tilde { g } } _ { \theta }$ of $z _ { \theta }$ is defined as
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\tilde { g } _ { \theta } ( x ) = \underset { c \in \mathcal { V } } { \arg \operatorname* { m a x } } \mathbb { E } _ { \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I ) } [ z _ { \theta } ^ { c } ( x + \eta ) ]
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
Using Lemma 2 in Salman et al. (2019), we prove the following theorem in Appendix A:
|
| 183 |
+
|
| 184 |
+
Theorem 2. Let the ground truth of an input $x$ be y. If g˜θ classifies x correctly, i.e.
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\mathbb { E } _ { \eta } [ z _ { \theta } ^ { y } ( x + \eta ) ] \ge \operatorname* { m a x } _ { y ^ { \prime } \ne y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ]
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
Then $\scriptstyle { \tilde { g } } _ { \theta }$ is provably robust at $x ,$ with the certified radius given by
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
C R ( \tilde { g } _ { \theta } ; x , y ) = \frac { \sigma } { 2 } [ \Phi ^ { - 1 } ( \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y } ( x + \eta ) ] ) - \Phi ^ { - 1 } ( \operatorname* { m a x } _ { y ^ { \prime } \neq y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ] ) ]
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
where $\Phi$ is the c.d.f. of the standard Gaussian distribution.
|
| 197 |
+
|
| 198 |
+
We notice that in Salman et al. (2019) (see its Appendix B), a similar technique was introduced to overcome the non-differentiability in creating adversarial examples to a smoothed classifier. Different from their work, our method uses Soft-RS to obtain a certified radius that is differentiable in practice. The certified radius given by soft randomized smoothing meets condition (C2) in the algorithmic design. Even if we use Monte Carlo sampling to estimate the expectation, (16) is still sub-differentiable with respect to $\theta$ as long as $z _ { \theta }$ is sub-differentiable with respect to $\theta$ .
|
| 199 |
+
|
| 200 |
+
Connection between Soft-RS and Hard-RS We highlight two main properties of Soft-RS. Firstly, it is a differentiable approximation of the original Hard-RS. To see this, note that when $\beta \infty$ , $z _ { \theta } ^ { y } ( x ; \beta ) \xrightarrow { a . e . } { \bf 1 } _ { \{ y = \mathrm { a r g } \mathrm { m a x } _ { c } u _ { \theta } ^ { c } ( x ) \} }$ , so $\scriptstyle { \tilde { g } } _ { \theta }$ converges to $g _ { \theta }$ almost everywhere. Consequently, the Soft-RS certified radius (16) converges to the Hard-RS certified radius (8) almost everywhere as $\beta$ goes to infinity. Secondly, Soft-RS itself provides an alternative way to get a provable robustness guarantee. In Appendix A, we will provide Soft-RS certification procedures that certify $\scriptstyle { \tilde { g } } _ { \theta }$ with the Hoeffding bound or the empirical Bernstein bound.
|
| 201 |
+
|
| 202 |
+
# 4.4 NUMERICAL STABILITY (FOR CONDITION C3)
|
| 203 |
+
|
| 204 |
+
In this section, we will address the numerical stability condition (C3). While Soft-RS does provide us with a differentiable certified radius (16) which we could maximize with first-order optimization methods, directly optimizing (16) suffers from exploding gradients. The problem stems from the inverse cumulative density function $\Phi ^ { - 1 } ( x )$ , whose derivative is huge when $x$ is close to 0 or 1.
|
| 205 |
+
|
| 206 |
+
Fortunately, by minimizing the robustness loss (13) instead, we can maximize the robust radius free from exploding gradients. The hinge loss restricts that samples with non-zero robustness loss must satisfy $\bar { 0 } < \bar { C } \bar { R ( g _ { \theta } ; x , y ) } < \epsilon + \bar { \epsilon }$ , which is equivalent to $0 < \xi _ { \theta } ( x , y ) < \gamma$ where $\xi _ { \theta } ( x , y ) =$ $\begin{array} { r } { \Phi ^ { - 1 } \bigl ( \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y } ( x + \eta ) ] \bigr ) - \Phi ^ { - 1 } ( \operatorname* { m a x } _ { y ^ { \prime } \not = y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ] ) } \end{array}$ and $\begin{array} { r } { \gamma = \frac { 2 ( \epsilon + \tilde { \epsilon } ) } { \sigma } } \end{array}$ . Under this restriction, the derivative of $\Phi ^ { - 1 }$ is always bounded as shown in the following proposition. The proof can be found in Appendix B.
|
| 207 |
+
|
| 208 |
+
Proposition 1. Given any $p _ { 1 } , p _ { 2 } , . . . p _ { K }$ satisfies $p _ { 1 } \ge p _ { 2 } \ge . . . \ge p _ { K } \ge 0$ and $p _ { 1 } + p _ { 2 } + . . . + p _ { K } = 1$ , let $\begin{array} { r } { \bar { \gamma } = \frac { 2 ( \epsilon + \tilde { \epsilon } ) } { \sigma } } \end{array}$ 2(+˜)σ , the derivative of min{[Φ−1(p1)−Φ−1(p2)], γ} with respect to p1 and p2 is bounded.
|
| 209 |
+
|
| 210 |
+
# 4.5 COMPLETE IMPLEMENTATION
|
| 211 |
+
|
| 212 |
+
We are now ready to present the complete MACER algorithm. Expectations over Gaussian samples are approximated with Monte Carlo sampling. Let $\eta _ { 1 } , \cdots , \eta _ { k }$ be $k$ i.i.d. samples from ${ \mathcal { N } } ( 0 , \sigma ^ { \ i } I )$ . The final objective function is
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\begin{array} { l } { l ( \tilde { g } _ { \theta } ; x , y ) = l _ { C } ( \tilde { g } _ { \theta } ; x , y ) + l _ { R } ( \tilde { g } _ { \theta } ; x , y ) } \\ { \displaystyle = - \log \hat { z } _ { \theta } ^ { y } ( x ) + \lambda \cdot \operatorname* { m a x } \{ \epsilon + \tilde { \epsilon } - C R ( \tilde { g } _ { \theta } ; x , y ) , 0 \} \cdot \mathbf { 1 } _ { \{ \tilde { g } _ { \theta } ( x ) = y \} } } \\ { \displaystyle = - \log \hat { z } _ { \theta } ^ { y } ( x ) + \frac { \lambda \sigma } { 2 } \operatorname* { m a x } \{ \gamma - \hat { \xi } _ { \theta } ( x , y ) , 0 \} \cdot \mathbf { 1 } _ { \{ \tilde { g } _ { \theta } ( x ) = y \} } } \end{array}
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
where $\begin{array} { r } { \hat { z } _ { \theta } ( x ) ~ = ~ \frac { 1 } { k } \sum _ { j = 1 } ^ { k } z _ { \theta } ( x + \eta _ { j } ) } \end{array}$ is the empirical expectation of $z _ { \theta } ( x + \eta )$ and $\hat { \xi } _ { \theta } ( x , y ) =$ $\Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x ) ) - \Phi ^ { - 1 } ( \operatorname* { m a x } _ { y ^ { \prime } \neq y } \hat { z } _ { \theta } ^ { y ^ { \prime } } ( x ) )$ . During training we minimize $\mathbb { E } _ { ( x , y ) \sim \hat { p } _ { \mathrm { d a t a } } } l ( \tilde { g } _ { \boldsymbol { \theta } } ; x , y )$ . Detailed implementation is described in Algorithm 1. To simplify the implementation, we choose $\gamma$ to be a hyperparameter instead of ˜. The inverse temperature of softmax $\beta$ is also a hyperparameter.
|
| 219 |
+
|
| 220 |
+
# Algorithm 1 MACER: robust training via MAximizing CErtified Radius
|
| 221 |
+
|
| 222 |
+
1: Input: Training set $\hat { p } _ { \mathrm { d a t a } }$ , noise level $\sigma$ , number of Gaussian samples $k$ , trade-off factor $\lambda$
|
| 223 |
+
hinge factor $\gamma$ , inverse temperature $\beta$ , model parameters $\theta$
|
| 224 |
+
2: for each iteration do
|
| 225 |
+
3: Sample a minibatch $( x _ { 1 } , y _ { 1 } ) , \cdot \cdot \cdot , ( x _ { n } , y _ { n } ) \sim { \hat { p } } _ { \mathrm { d a t a } }$
|
| 226 |
+
4: For each $x _ { i }$ , sample $k$ i.i.d. Gaussian samples $\bar { x } _ { i 1 } , \cdot \cdot \cdot , x _ { i k } \sim \mathcal { N } ( x , \sigma ^ { 2 } I )$
|
| 227 |
+
5: Compute the empirical expectations: $\begin{array} { r } { \hat { z } _ { \theta } ( x _ { i } ) \gets \sum _ { j = 1 } ^ { k } z _ { \theta } ( x _ { i j } ) / k } \end{array}$ for $i = 1 , \cdots , n$
|
| 228 |
+
6: Compute $\mathbb { G } _ { \theta } = \{ ( x _ { i } , y _ { i } ) : \tilde { g } _ { \theta } ( x _ { i } ) = y _ { i } \}$ : $( x _ { i } , y _ { i } ) \in \mathbb { G } _ { \theta } \Leftrightarrow y _ { i } = \arg \operatorname* { m a x } _ { c \in \mathcal { Y } } \hat { z } _ { \theta } ^ { c } ( x _ { i } )$
|
| 229 |
+
7: For each $( x _ { i } , y _ { i } ) \in \mathbb { G } _ { \theta }$ , compute $\hat { y } _ { i }$ : $\hat { y } _ { i } \gets \arg \operatorname* { m a x } _ { c \in \mathcal { V } \backslash \{ y _ { i } \} } \hat { z } _ { \theta } ^ { c } ( x _ { i } )$
|
| 230 |
+
8: For each $( x _ { i } , y _ { i } ) \in \mathbb { G } _ { \theta }$ , compute $\hat { \xi } _ { \theta } ( x _ { i } , y _ { i } ) \colon \hat { \xi } _ { \theta } ( x _ { i } , y _ { i } ) \gets \Phi ^ { - 1 } \big ( \hat { z } _ { \theta } ^ { y _ { i } } ( x _ { i } ) \big ) - \Phi ^ { - 1 } \big ( \hat { z } _ { \theta } ^ { \hat { y } _ { i } } ( x _ { i } ) \big )$
|
| 231 |
+
9: Update $\theta$ with one step of any first-order optimization method to minimize
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
- \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \log \hat { z } _ { \theta } ^ { y _ { i } } ( x _ { i } ) + \frac { \lambda \sigma } { 2 n } \sum _ { ( x _ { i } , y _ { i } ) \in \mathbb { G } _ { \theta } } \operatorname* { m a x } \{ \gamma - \hat { \xi } _ { \theta } ( x _ { i } , y _ { i } ) , 0 \}
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
10: end for
|
| 238 |
+
|
| 239 |
+
Compare to adversarial training Adversarial training defines the problem as a mini-max game and solves it by optimizing the inner loop (attack generation) and the outer loop (model update) iteratively. In our method, we only have a single loop (model update). As a result, our proposed algorithm can run much faster than adversarial training because it does not require additional back propagations to generate adversarial examples.
|
| 240 |
+
|
| 241 |
+
Compare to previous work The overall objective function of our method, a linear combination of a classification loss and a robustness loss, is similar to those of adversarial logit pairing (ALP) (Kannan et al., 2018) and TRADES (Zhang et al., 2019b). In MACER, the $\lambda$ in the objective function (17) can also be viewed as a trade-off factor between accuracy and robustness. However, the robustness term of MACER does not depend on a particular adversarial example $x ^ { \prime }$ , which makes it substantially different from ALP and TRADES.
|
| 242 |
+
|
| 243 |
+
# 5 EXPERIMENTS
|
| 244 |
+
|
| 245 |
+
In this section, we empirically evaluate our proposed MACER algorithm on a wide range of tasks.
|
| 246 |
+
We also study the influence of different hyperparameters in MACER on the final model performance.
|
| 247 |
+
|
| 248 |
+
# 5.1 SETUP
|
| 249 |
+
|
| 250 |
+
To fairly compare with previous works, we follow Cohen et al. (2019) and Salman et al. (2019) to use LeNet for MNIST, ResNet-110 for Cifar-10 and SVHN, and ResNet-50 for ImageNet.
|
| 251 |
+
|
| 252 |
+
MACER Training For Cifar-10, MNIST and SVHN, we train the models for 440 epochs using our proposed algorithm. The learning rate is initialized to be 0.01, and is decayed by 0.1 at the $2 0 0 ^ { \mathrm { t } \mathrm { \hat { h } } } / 4 0 0 ^ { \mathrm { t h } }$ epoch. For all the models, we use $k = 1 6$ , $\gamma = 8 . 0$ and $\beta = 1 6 . 0$ . The value of $\lambda$ trades off the accuracy and robustness and we find that different $\lambda$ leads to different robust accuracy when the model is injected by different levels $( \sigma )$ of noise. We find setting $\lambda = 1 2 . 0$ for $\sigma = 0 . 2 5$ and $\lambda = 4 . 0$ for $\sigma = 0 . 5 0$ works best. For ImageNet, we train the models for 120 epochs. The initial learning rate is set to be 0.1 and is decayed by 0.1 at the $3 0 ^ { \mathrm { t h } } / 6 0 ^ { \mathrm { t h } } / 9 0 ^ { \mathrm { t h } }$ epoch. For all models on ImageNet, we use $k = 2$ , $\gamma = 8 . 0$ and $\beta = 1 6 . 0$ . More details can be found in Appendix C.
|
| 253 |
+
|
| 254 |
+
Baselines We compare the performance of MACER with two previous works. The first work (Cohen et al., 2019) trains smoothed networks by simply minimizing cross-entropy loss. The second one (Salman et al., 2019) uses adversarial training on smoothed networks to improve the robustness. For both baselines, we use checkpoints provided by the authors and report their original numbers whenever available. In addition, we run Cohen et al. (2019)’s method on all tasks as it is a speical case of MACER by setting $k = 1$ and $\lambda = 0$ .
|
| 255 |
+
|
| 256 |
+
Certification Following previous works, we report the approximated certified test set accuracy, which is the fraction of the test set that can be certified to be robust at radius $r$ . However, the approximated certified test set accuracy is a function of the radius $r$ . It is hard to compare two models unless one is uniformly better than the other for all $r$ . Hence, we also use the average certified radius (ACR) as a metric: for each test data $( x , y )$ and model $g$ , we can estimate the certified radius $C R ( g ; x , y )$ . The average certified radius is defined as $\begin{array} { r } { \frac { 1 } { | S _ { t e s t } | } \sum _ { ( x , y ) \in S _ { t e s t } } C R ( g ; x , y ) } \end{array}$ where $\boldsymbol { S } _ { t e s t }$ is the test set. To estimate the certified radius for data points, we use the source code provided by Cohen et al. (2019).
|
| 257 |
+
|
| 258 |
+
# 5.2 RESULTS
|
| 259 |
+
|
| 260 |
+
We report the results on Cifar-10 and ImageNet in the main body of the paper. Results on MNIST and SVHN can be found in Appendix C.2.
|
| 261 |
+
|
| 262 |
+
Table 1: Approximated certified test accuracy and ACR on Cifar-10: Each column is an $l _ { 2 }$ radius.
|
| 263 |
+
|
| 264 |
+
<table><tr><td>0</td><td>Model</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td rowspan="3">0.25</td><td>Cohen-0.25</td><td>0.75</td><td>0.60</td><td>0.43</td><td>0.26</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.416</td></tr><tr><td>Salman-0.25</td><td>0.74</td><td>0.67</td><td>0.57</td><td>0.47</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.538</td></tr><tr><td>MACER-0.25</td><td>0.81</td><td>0.71</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.556</td></tr><tr><td rowspan="3">0.50</td><td>Cohen-0.50</td><td>0.65</td><td>0.54</td><td>0.41</td><td>0.32</td><td>0.23</td><td>0.15</td><td>0.09</td><td>0.04</td><td>0</td><td>0</td><td>0.491</td></tr><tr><td>Salman-0.50</td><td>0.50</td><td>0.46</td><td>0.44</td><td>0.40</td><td>0.38</td><td>0.33</td><td>0.29</td><td>0.23</td><td>0</td><td>0</td><td>0.709</td></tr><tr><td>MACER-0.50</td><td>0.66</td><td>0.60</td><td>0.53</td><td>0.46</td><td>0.38</td><td>0.29</td><td>0.19</td><td>0.12</td><td>0</td><td>0</td><td>0.726</td></tr><tr><td rowspan="3">1.00</td><td>Cohen-1.00</td><td>0.47</td><td>0.39</td><td>0.34</td><td>0.28</td><td>0.21</td><td>0.17</td><td>0.14</td><td>0.08</td><td>0.05</td><td>0.03</td><td>0.458</td></tr><tr><td>Salman-1.00</td><td>0.45</td><td>0.41</td><td>0.38</td><td>0.35</td><td>0.32</td><td>0.28</td><td>0.25</td><td>0.22</td><td>0.19</td><td>0.17</td><td>0.787</td></tr><tr><td>MACER-1.00</td><td>0.45</td><td>0.41</td><td>0.38</td><td>0.35</td><td>0.32</td><td>0.29</td><td>0.25</td><td>0.22</td><td>0.18</td><td>0.16</td><td>0.792</td></tr></table>
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 1: Radius-accuracy curves of different Cifar-10 models.
|
| 268 |
+
|
| 269 |
+
Table 2: Approximated certified test accuracy and ACR on ImageNet: Each column is an $l _ { 2 }$ radius.
|
| 270 |
+
|
| 271 |
+
<table><tr><td>0</td><td>Model</td><td>0.0</td><td>0.5</td><td>1.0</td><td>1.5</td><td>2.0</td><td>2.5</td><td>3.0</td><td>ACR</td></tr><tr><td rowspan="3">0.25</td><td>Cohen-0.25</td><td>0.67</td><td>0.49</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.470</td></tr><tr><td>Salman-0.25</td><td>0.65</td><td>0.56</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.528</td></tr><tr><td>MACER-0.25</td><td>0.68</td><td>0.57</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.544</td></tr><tr><td rowspan="3">0.50</td><td>Cohen-0.50</td><td>0.57</td><td>0.46</td><td>0.37</td><td>0.29</td><td>0</td><td>0</td><td>0</td><td>0.720</td></tr><tr><td>Salman-0.50</td><td>0.54</td><td>0.49</td><td>0.43</td><td>0.37</td><td>0</td><td>0</td><td>0</td><td>0.815</td></tr><tr><td>MACER-0.50</td><td>0.64</td><td>0.53</td><td>0.43</td><td>0.31</td><td>0</td><td>0</td><td>0</td><td>0.831</td></tr><tr><td rowspan="3">1.00</td><td>Cohen-1.00</td><td>0.44</td><td>0.38</td><td>0.33</td><td>0.26</td><td>0.19</td><td>0.15</td><td>0.12</td><td>0.863</td></tr><tr><td>Salman-1.00</td><td>0.40</td><td>0.37</td><td>0.34</td><td>0.30</td><td>0.27</td><td>0.25</td><td>0.20</td><td>1.003</td></tr><tr><td>MACER-1.00</td><td>0.48</td><td>0.43</td><td>0.36</td><td>0.30</td><td>0.25</td><td>0.18</td><td>0.14</td><td>1.008</td></tr></table>
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 2: Radius-accuracy curves of different ImageNet models.
|
| 275 |
+
|
| 276 |
+
Performance The performance of different models on Cifar-10 are reported in Table 1, and in Figure 1 we display the radius-accuracy curves. Note that the area under a radius-accuracy curve is equal to the ACR of the model. First, the plots show that our proposed method consistently achieves significantly higher approximated certified test set accuracy than Cohen et al. (2019). This shows that robust training via maximizing the certified radius is more effective than simply minimizing the cross entropy classification loss. Second, the performance of our model is different from that of Salman et al. (2019) for different $r$ . For example, for $\sigma = 0 . 2 5$ , our model achieves higher accuracy than Salman et al. (2019)’s model when $r = 0 / 0 . 2 5 / 0 . 5$ , but the performance of ours is worse when $r = 0 . 7 5$ . For the average certified radius, our models are better than Salman et al. (2019)’s models2 in all settings. For example, when $\sigma = 0 . 2 5 / 0 . 5 0$ , the ACR of our model is about $3 \%$ larger than that of Salman et al. (2019)’s. The gain of our model is relatively smaller when $\sigma = 1 . 0$ . This is because $\sigma = 1 . 0$ is a very large noise level (Cohen et al., 2019) and both models perform poorly. The ImageNet results are displayed in Table 2 and Figure 2, and the observation is similar. All experimental results show that our proposed algorithm is more effective than previous ones.
|
| 277 |
+
|
| 278 |
+
Training speed Since MACER does not require adversarial attack during training, it runs much faster to learn a robust model. Empirically, we compare MACER with Salman et al. (2019) on the average training time per epoch and the total training hours, and list the statistics in Table 3. For a fair comparison, we use the codes34 provided by the original authors and run all algorithms on the same machine. For Cifar-10 we use one NVIDIA P100 GPU and for ImageNet we use four NVIDIA P100 GPUs. According to our experiments, on ImageNet, MACER achieves $\mathrm { A C R } { = } 0 . 5 4 4$ in 117.90 hours. On the contrary, Salman et al. (2019) only achieves $\mathrm { A C R = } 0 . 5 2 8$ but uses 193.10 hours, which clearly shows that our method is much more efficient.
|
| 279 |
+
|
| 280 |
+
One might question whether the higher performance of MACER comes from the fact that we train for more epochs than previous methods. In Section C.3 we also run MACER for 150 epochs and compare it with the models in Table 3. The results show that when run for only 150 epochs, MACER still achieves a performance comparable with SmoothAdv, and is 4 times faster at the same time.
|
| 281 |
+
|
| 282 |
+
Table 3: Training time and performance of $\sigma = 0 . 2 5$ models.
|
| 283 |
+
|
| 284 |
+
<table><tr><td>Dataset</td><td>Model</td><td> sec/epoch</td><td>Epochs</td><td>Total hrs</td><td>ACR</td></tr><tr><td rowspan="3">Cifar-10</td><td>Cohen-0.25 (Cohen et al., 2019)</td><td>31.4</td><td>150</td><td>1.31</td><td>0.416</td></tr><tr><td>Salman-0.25 (Salman et al., 2019)</td><td>1990.1</td><td>150</td><td>82.92</td><td>0.538</td></tr><tr><td>MACER-0.25 (ours)</td><td>504.0</td><td>440</td><td>61.60</td><td>0.556</td></tr><tr><td rowspan="3">ImageNet</td><td>Cohen-0.25 (Cohen et al., 2019)</td><td>2154.5</td><td>90</td><td>53.86</td><td>0.470</td></tr><tr><td>Salman-0.25 (Salman et al., 2019)</td><td>7723.8</td><td>90</td><td>193.10</td><td>0.528</td></tr><tr><td>MACER-0.25 (ours)</td><td>3537.1</td><td>120</td><td>117.90</td><td>0.544</td></tr></table>
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 3: Effect of hyperparameters on Cifar-10 $\sigma = 0 . 2 5 )$ .
|
| 288 |
+
|
| 289 |
+
# 5.3 EFFECT OF HYPERPARAMETERS
|
| 290 |
+
|
| 291 |
+
In this section, we carefully examine the effect of different hyperparameters in MACER. All experiments are run on Cifar-10 with $\sigma = 0 . 2 5$ or 0.50. The results for $\sigma = 0 . 2 5$ are shown in Figure 3. All details can be found in Appendix C.4.
|
| 292 |
+
|
| 293 |
+
Effect of $k$ We sample $k$ Gaussian samples for each input to estimate the expectation in (16). We can see from Figure 3(a) that using more Gaussian samples usually leads to better performance. For example, the radius-accuracy curve of $k = 1 6$ is uniformly above that of $k = 1$ .
|
| 294 |
+
|
| 295 |
+
Effect of $\lambda$ The radius-accuracy curves in Figure 3(b) demonstrate the trade-off effect of $\lambda$ . From the figure, we can see that as $\lambda$ increases, the clean accuracy drops while the certified accuracy at large radii increases.
|
| 296 |
+
|
| 297 |
+
Effect of $\gamma ~ \gamma$ is defined as the hyperparameter in the hinge loss. From Figure 3(c) we can see that when $\gamma$ is small, the approximated certified test set accuracy at large radii is small since $\gamma$ “truncates” the large radii. As $\gamma$ increases, the robust accuracy improves. It appears that $\gamma$ also acts as a trade-off between accuracy and robustness, but the effect is not as significant as the effect of $\lambda$ .
|
| 298 |
+
|
| 299 |
+
Effect of $\beta$ Similar to Salman et al. (2019)’s finding (see its Appendix B), we also observe that using a larger $\beta$ produces better results. While Salman et al. (2019) pointed out that a large $\beta$ may make training unstable, we find that if we only apply a large $\beta$ to the robustness loss, we can maintain training stability and achieve a larger average certified radius as well.
|
| 300 |
+
|
| 301 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 302 |
+
|
| 303 |
+
In this work we propose MACER, an attack-free and scalable robust training method via directly maximizing the certified radius of a smoothed classifier. We discuss the desiderata such an algorithm would have to satisfy, and provide an approach to each of them. According to our extensive experiments, MACER performs better than previous provable $l _ { 2 }$ -defenses and trains faster. Our strong empirical results suggest that adversarial training is not a must for robust training, and defense based on certification is a promising direction for future research. Moreover, several recent papers (Carmon et al., 2019; Zhai et al., 2019; Stanforth et al., 2019) suggest that using unlabeled data helps improve adversarially robust generalization. We will also extend MACER to the semisupervised setting.
|
| 304 |
+
|
| 305 |
+
# ACKNOWLEDGMENTS
|
| 306 |
+
|
| 307 |
+
We thank Tianle Cai for helpful discussions and suggestions. This work was done when Runtian Zhai was visiting UCLA under the Top-Notch Undergraduate Program of Peking University school of EECS. Chen Dan and Pradeep Ravikumar acknowledge the support of Rakuten Inc., and NSF via IIS1909816. Huan Zhang and Cho-Jui Hsieh acknowledge the support of NSF via IIS1719097. Liwei Wang acknowledges the support of Beijing Academy of Artificial Intelligence.
|
| 308 |
+
|
| 309 |
+
# REFERENCES
|
| 310 |
+
|
| 311 |
+
Anish Athalye, Nicholas Carlini, and David A. Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. CoRR, abs/1802.00420, 2018. URL http://arxiv.org/abs/1802.00420.
|
| 312 |
+
|
| 313 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pp. 387–402. Springer, 2013.
|
| 314 |
+
|
| 315 |
+
Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. CoRR, abs/1608.04644, 2016. URL http://arxiv.org/abs/1608.04644.
|
| 316 |
+
|
| 317 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. arXiv preprint arXiv:1905.13736, 2019.
|
| 318 |
+
|
| 319 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15–26. ACM, 2017.
|
| 320 |
+
|
| 321 |
+
Minhao Cheng, Thong Le, Pin-Yu Chen, Jinfeng Yi, Huan Zhang, and Cho-Jui Hsieh. Queryefficient hard-label black-box attack: An optimization-based approach. 2019.
|
| 322 |
+
|
| 323 |
+
Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. 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. 1310–1320, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 324 |
+
|
| 325 |
+
Gavin Weiguang Ding, Yash Sharma, Kry Yik Chau Lui, and Ruitong Huang. Mma training: Direct input space margin maximization through adversarial training. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HkeryxBtPB.
|
| 326 |
+
|
| 327 |
+
Ruiqi Gao, Tianle Cai, Haochuan Li, Cho-Jui Hsieh, Liwei Wang, and Jason D Lee. Convergence of adversarial training in overparametrized neural networks. In Advances in Neural Information Processing Systems 32. 2019.
|
| 328 |
+
|
| 329 |
+
Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin Vechev. Ai2: Safety and robustness certification of neural networks with abstract interpretation. In 2018 IEEE Symposium on Security and Privacy (SP), pp. 3–18. IEEE, 2018.
|
| 330 |
+
|
| 331 |
+
Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. URL http:// arxiv.org/abs/1412.6572.
|
| 332 |
+
|
| 333 |
+
Sven Gowal, Krishnamurthy Dvijotham, Robert Stanforth, Rudy Bunel, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. On the effectiveness of interval bound propagation for training verifiably robust models. arXiv preprint arXiv:1810.12715, 2018.
|
| 334 |
+
|
| 335 |
+
Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvari. Learning with a strong adver-´ sary. arXiv preprint arXiv:1511.03034, 2015.
|
| 336 |
+
|
| 337 |
+
Harini Kannan, Alexey Kurakin, and Ian J. Goodfellow. Adversarial logit pairing. CoRR, abs/1803.06373, 2018. URL http://arxiv.org/abs/1803.06373.
|
| 338 |
+
|
| 339 |
+
Mathias Lecuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, and Suman Jana. Certified robustness to adversarial examples with differential privacy. arXiv preprint arXiv:1802.03471, 2018.
|
| 340 |
+
|
| 341 |
+
Bai Li, Changyou Chen, Wenlin Wang, and Lawrence Carin. Second-order adversarial attack and certifiable robustness. CoRR, abs/1809.03113, 2018. URL http://arxiv.org/abs/ 1809.03113.
|
| 342 |
+
|
| 343 |
+
Xuanqing Liu, Minhao Cheng, Huan Zhang, and Cho-Jui Hsieh. Towards robust neural networks via random self-ensemble. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 369–385, 2018.
|
| 344 |
+
|
| 345 |
+
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.
|
| 346 |
+
|
| 347 |
+
Andreas Maurer and Massimiliano Pontil. Empirical Bernstein Bounds and Sample Variance Penalization. arXiv e-prints, art. arXiv:0907.3740, Jul 2009.
|
| 348 |
+
|
| 349 |
+
Matthew Mirman, Timon Gehr, and Martin Vechev. Differentiable abstract interpretation for provably robust neural networks. In International Conference on Machine Learning, pp. 3575–3583, 2018.
|
| 350 |
+
|
| 351 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. CoRR, abs/1511.04599, 2015. URL http: //arxiv.org/abs/1511.04599.
|
| 352 |
+
|
| 353 |
+
Nicolas Papernot, Patrick McDaniel, Arunesh Sinha, and Michael Wellman. Towards the science of security and privacy in machine learning. arXiv preprint arXiv:1611.03814, 2016.
|
| 354 |
+
|
| 355 |
+
Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Alhussein Fawzi, Soham De, Robert Stanforth, Pushmeet Kohli, et al. Adversarial robustness through local linearization. arXiv preprint arXiv:1907.02610, 2019.
|
| 356 |
+
|
| 357 |
+
Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017. URL http: //arxiv.org/abs/1707.04131.
|
| 358 |
+
|
| 359 |
+
Hadi Salman, Greg Yang, Jerry Li, Pengchuan Zhang, Huan Zhang, Ilya P. Razenshteyn, and Sebastien Bubeck. Provably robust deep learning via adversarially trained smoothed classifiers. ´ CoRR, abs/1906.04584, 2019. URL http://arxiv.org/abs/1906.04584.
|
| 360 |
+
|
| 361 |
+
Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John P. Dickerson, Christoph Studer, Larry S. Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! CoRR, abs/1904.12843, 2019. URL http://arxiv.org/abs/1904.12843.
|
| 362 |
+
|
| 363 |
+
Gagandeep Singh, Timon Gehr, Matthew Mirman, Markus Puschel, and Martin Vechev. Fast and¨ effective robustness certification. In Advances in Neural Information Processing Systems, pp. 10802–10813, 2018.
|
| 364 |
+
|
| 365 |
+
Robert Stanforth, Alhussein Fawzi, Pushmeet Kohli, et al. Are labels required for improving adversarial robustness? arXiv preprint arXiv:1905.13725, 2019.
|
| 366 |
+
|
| 367 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. CoRR, abs/1312.6199, 2013. URL http://arxiv.org/abs/1312.6199.
|
| 368 |
+
|
| 369 |
+
Shiqi Wang, Yizheng Chen, Ahmed Abdou, and Suman Jana. Mixtrain: Scalable training of formally robust neural networks. arXiv preprint arXiv:1811.02625, 2018.
|
| 370 |
+
|
| 371 |
+
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 Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 5276–5285, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
|
| 372 |
+
|
| 373 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. 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. 5286–5295, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
|
| 374 |
+
|
| 375 |
+
Eric Wong, Frank Schmidt, Jan Hendrik Metzen, and J. Zico Kolter. Scaling provable adversarial defenses. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 8400–8409. Curran Associates, Inc., 2018.
|
| 376 |
+
|
| 377 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
|
| 378 |
+
|
| 379 |
+
Runtian Zhai, Tianle Cai, Di He, Chen Dan, Kun He, John E. Hopcroft, and Liwei Wang. Adversarially robust generalization just requires more unlabeled data. CoRR, abs/1906.00555, 2019. URL http://arxiv.org/abs/1906.00555.
|
| 380 |
+
|
| 381 |
+
Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Accelerating adversarial training via maximal principle. arXiv preprint arXiv:1905.00877, 2019a.
|
| 382 |
+
|
| 383 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. 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. 7472–7482, Long Beach, California, USA, 09–15 Jun 2019b. PMLR. URL http://proceedings.mlr.press/ v97/zhang19p.html.
|
| 384 |
+
|
| 385 |
+
Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. In Advances in neural information processing systems, pp. 4939–4948, 2018.
|
| 386 |
+
|
| 387 |
+
Huan Zhang, Hongge Chen, Chaowei Xiao, Bo Li, Duane Boning, and Cho-Jui Hsieh. Towards stable and efficient training of verifiably robust neural networks. arXiv preprint arXiv:1906.06316, 2019c.
|
| 388 |
+
|
| 389 |
+
# A SOFT RANDOMIZED SMOOTHING
|
| 390 |
+
|
| 391 |
+
In this section we provide theoretical analysis and certification procedures for Soft-RS.
|
| 392 |
+
|
| 393 |
+
# A.1 PROOF OF THEOREM 2
|
| 394 |
+
|
| 395 |
+
Our proof is based on the following lemma:
|
| 396 |
+
|
| 397 |
+
Lemma 1. For any measurable function $f : \mathcal { X } \to [ 0 , 1 ]$ , define $\hat { f } ( x ) = \mathbb { E } _ { \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I ) } f ( x + \eta )$ , then $x \mapsto \Phi ^ { - 1 } ( { \hat { f } } ( x ) )$ is $1 / \sigma$ -Lipschitz.
|
| 398 |
+
|
| 399 |
+
This lemma is the generalized version of Lemma 2 in Salman et al. (2019).
|
| 400 |
+
|
| 401 |
+
Proof of Theorem 2. Let $y ^ { * } = \arg \operatorname* { m a x } _ { y ^ { \prime } \neq y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ]$ . For any $c \in \mathcal { V }$ , define $\hat { z } _ { \theta } ^ { c }$ as:
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\hat { z } _ { \theta } ^ { c } ( x ) = \mathbb { E } _ { \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I ) } [ z _ { \theta } ^ { c } ( x + \eta ) ]
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
Because $z _ { \theta } ^ { c } : \mathcal { X } [ 0 , 1 ]$ , by Lemma 1 we have $x \mapsto \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { c } ( x ) )$ is $1 / \sigma$ -Lipschitz. Thus, $\forall y ^ { \prime } \neq y$ , for any $\delta$ such that $\begin{array} { r } { \| \delta \| _ { 2 } \leq \frac { \sigma } { 2 } [ \Phi ^ { - 1 } ( \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y } ( x + \eta ) ] ) - \Phi ^ { - 1 } ( \operatorname* { m a x } _ { y ^ { \prime } \not = y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ] ) ] } \end{array}$ :
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\begin{array} { r l r } & { } & { \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x + \delta ) ) \ge \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x ) ) - \displaystyle \frac { 1 } { 2 } [ \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x ) ) - \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { * } } ( x ) ) ] } \\ & { } & { \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { \prime } } ( x + \delta ) ) \le \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { \prime } } ( x ) ) + \displaystyle \frac { 1 } { 2 } [ \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x ) ) - \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { * } } ( x ) ) ] } \\ & { } & { \le \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { * } } ( x ) ) + \displaystyle \frac { 1 } { 2 } [ \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y } ( x ) ) - \Phi ^ { - 1 } ( \hat { z } _ { \theta } ^ { y ^ { * } } ( x ) ) ] } \end{array}
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
Therefore, $\Phi ^ { - 1 } \bigl ( \mathbb { E } _ { \eta } z _ { \theta } ^ { y } ( x + \delta + \eta ) \bigr ) \geq \Phi ^ { - 1 } \bigl ( \mathbb { E } _ { \eta } z _ { \theta } ^ { y ^ { \prime } } ( x + \delta + \eta ) \bigr )$ . Due to the monotonicity of $\Phi ^ { - 1 }$ , we have $\begin{array} { r } { \mathbb { E } _ { \eta } z _ { \theta } ^ { y } ( x + \delta + \eta ) \ge \mathbb { E } _ { \eta } z _ { \theta } ^ { y ^ { \prime } } ( x + \delta + \eta ) } \end{array}$ , which implies that $\tilde { g } _ { \theta } ( x + \delta ) = y$ . □
|
| 414 |
+
|
| 415 |
+
# A.2 SOFT-RS CERTIFICATION PROCEDURE
|
| 416 |
+
|
| 417 |
+
Let $z _ { A } = \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y } ( x + \eta ) ]$ and $z _ { B } = \mathrm { m a x } _ { y ^ { \prime } \neq y } \mathbb { E } _ { \eta } [ z _ { \theta } ^ { y ^ { \prime } } ( x + \eta ) ]$ . If there exist $z _ { A } , \overline { { z _ { B } } } \in [ 0 , 1 ]$ such that $P ( z _ { A } \ge \bar { z _ { A } } \land z _ { B } \le \overline { { z _ { B } } } ) \ge 1 - \alpha$ , then with probability at least $1 - \alpha$ , $C R ( \tilde { g } _ { \boldsymbol { \theta } } ; x , y ) \ \geq$ $\begin{array} { r } { \frac { \sigma } { 2 } [ \Phi ^ { - 1 } ( \underline { { z } } _ { A } ) - \Phi ^ { - 1 } ( \overline { { z _ { B } } } ) ] } \end{array}$ . Meanwhile, $z _ { B } \le 1 - z _ { A }$ , so we can take $\overline { { z _ { B } } } = 1 - \underline { { z _ { A } } }$ , and
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
P ( C R ( \tilde { g } _ { \theta } ; x , y ) \ge \sigma \Phi ^ { - 1 } ( z _ { A } ) ) \ge 1 - \alpha
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
It reduces to find a confidence lower bound of $z _ { A }$ . Here we provide two bounds:
|
| 424 |
+
|
| 425 |
+
Hoeffding Bound The random variable $z _ { \theta } ^ { y } ( x + \eta )$ has mean $z _ { A }$ , and $z _ { 1 } ^ { y } , \cdot \cdot \cdot , z _ { k } ^ { y }$ are its $k$ observations. Because $z _ { j _ { . } } ^ { y } \in [ 0 , 1 ]$ for any $j = 1 , \cdots , k$ , we can use Hoeffding’s inequality to obtain a lower confidence bound:
|
| 426 |
+
|
| 427 |
+
Lemma 2. (Hoeffding’s Inequality) Let $X _ { 1 } , . . . , X _ { k }$ be independent random variables bounded by the interval $[ 0 , 1 ]$ . Let $\begin{array} { r } { \overline { { X } } = \frac { 1 } { k } \sum _ { j = 1 } ^ { k } X _ { j } } \end{array}$ , then for any $t \geq 0$
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
P ( { \overline { { X } } } - \mathbb { E } X \geq t ) \leq e ^ { - 2 k t ^ { 2 } }
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Denote $\begin{array} { r } { \hat { z } ^ { y } = \frac { 1 } { k } \sum _ { j = 1 } ^ { k } z _ { j } ^ { y } } \end{array}$ . By Hoeffding’s inequality we have
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
P ( \hat { z } ^ { y } - z _ { A } \geq \sqrt { \frac { - \log \alpha } { 2 k } } ) \leq \alpha
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Hence, a $1 - \alpha$ confidence lower bound $\underline { { z _ { A } } }$ of $z _ { A }$ is
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\underline { { z _ { A } } } = \hat { z } ^ { y } - \sqrt { \frac { - \log \alpha } { 2 k } }
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Empirical Bernstein Bound Maurer & Pontil (2009) provides us with a tighter bound: Theorem 3. (Theorem $^ { 4 }$ in Maurer & Pontil (2009)) Under the conditions of Lemma 2, with probability at least $1 - \alpha$ ,
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\overline { { X } } - \mathbb { E } X \leq \sqrt { \frac { 2 S ^ { 2 } \log \frac { 2 } { \alpha } } { k } } + \frac { 7 \log \frac { 2 } { \alpha } } { 3 ( k - 1 ) }
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
where $S ^ { 2 }$ is the sample variance of $X _ { 1 } , \cdots , X _ { k }$ , i.e.
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
S ^ { 2 } = { \frac { \sum _ { j = 1 } ^ { k } X _ { j } ^ { 2 } - { \frac { ( \sum _ { j = 1 } ^ { k } X _ { j } ) ^ { 2 } } { k } } } { k - 1 } }
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
Consequently, a $1 - \alpha$ confidence lower bound $\underline { { z . A } }$ of $z _ { A }$ is
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\underline { { { z } } } _ { A } = \hat { z } ^ { y } - \sqrt { \frac { 2 S ^ { 2 } \log \frac { 2 } { \alpha } } { k } } - \frac { 7 \log \frac { 2 } { \alpha } } { 3 ( k - 1 ) }
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
The full certification procedure with the above two bounds is described in Algorithm 2.
|
| 464 |
+
|
| 465 |
+
# Algorithm 2 Soft randomized smoothing certification
|
| 466 |
+
|
| 467 |
+
1: # Certify the robustness of $\tilde { g }$ around an input x with Hoeffding bound
|
| 468 |
+
2: function CERTIFYHOEFFDING $( z , \sigma ^ { 2 } , x , \bar { n } _ { 0 } , n , \alpha )$
|
| 469 |
+
3: $\begin{array} { r l } & { \hat { z } _ { 0 } \gets \mathrm { S A M P L E U N D E R N O I S E } ( z , x , n _ { 0 } , \sigma ^ { 2 } ) [ 1 , \hat { z } ] / n _ { 0 } } \\ & { \hat { z } _ { 0 } \gets \mathrm { S A M P I L E U N D E R N O I S E } ( z , x , n _ { 0 } , \sigma ^ { 2 } ) [ 1 , \hat { z } ] / n _ { 0 } } \\ & { \hat { c } _ { A } \gets \mathrm { a r g m a x } _ { c } \hat { z _ { 0 } } ^ { c } } \\ & { \hat { z } _ { A } \gets \mathrm { S A M P L E U N D E R N O I S E } ( z , x , n , \sigma ^ { 2 } ) [ 1 , \hat { c } _ { A } ] / n } \\ & { \underline { { z _ { A } } } \gets \hat { z } _ { A } - \sqrt { \frac { - \log { \alpha } } { 2 n } } } \end{array}$
|
| 470 |
+
4:
|
| 471 |
+
5:
|
| 472 |
+
6:
|
| 473 |
+
7: if $\underline { { z _ { A } } } > \frac { 1 } { 2 }$ then return prediction ${ \hat { c } } _ { A }$ and radius $\sigma \Phi ^ { - 1 } ( \underline { { z _ { A } } } )$
|
| 474 |
+
8: else return ABSTAIN
|
| 475 |
+
9: end function
|
| 476 |
+
10: # Certify with empirical Bernstein bound
|
| 477 |
+
11: function CERTIFYBERNSTEIN $( z , \sigma ^ { 2 } , x , n _ { 0 } , n , \alpha )$
|
| 478 |
+
12: $\hat { z _ { 0 } } \gets \boldsymbol { S }$ AMPLEUNDERNOISE $( z , x , n _ { 0 } , \sigma ^ { 2 } ) [ 1 , : ] / n _ { 0 }$
|
| 479 |
+
13: cˆA ← arg maxc zˆ0c
|
| 480 |
+
14: $A \boldsymbol { \mathrm { S } }$ AMPLEUNDERNOISE(z, x, n, σ2)
|
| 481 |
+
15: zˆA ← A[1, cˆA]/n, S2A ← A[2,cˆA]−A[1,cˆA]2/n
|
| 482 |
+
16: $\begin{array} { r } { \underline { { z _ { A } } } \hat { z } _ { A } - \sqrt { \frac { 2 S _ { A } ^ { 2 } \log ( 2 / \alpha ) } { n } } - \frac { 7 \log ( 2 / \alpha ) } { 3 ( n - 1 ) } } \end{array}$
|
| 483 |
+
17: if $\underline { { z _ { A } } } > \frac { 1 } { 2 }$ then return prediction ${ \hat { c } } _ { A }$ and radius $\sigma \Phi ^ { - 1 } ( \underline { { z _ { A } } } )$
|
| 484 |
+
18: else return ABSTAIN
|
| 485 |
+
19: end function
|
| 486 |
+
|
| 487 |
+
# Helper function: draw num samples from $z ( x + \eta )$ and return the $I ^ { s t }$ and $2 ^ { n d }$ sample mom
|
| 488 |
+
|
| 489 |
+
21: function SAMPLEUNDERNOISE $( z , x$ , num, $\sigma ^ { 2 }$
|
| 490 |
+
|
| 491 |
+
22: Initialize a $2 \times K$ matrix $A ( 0 , \cdot \cdot \cdot , 0 ; 0 , \cdot \cdot \cdot , 0 )$
|
| 492 |
+
23: for $j = 1$ to num do
|
| 493 |
+
24: Sample noise $\eta _ { j } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$
|
| 494 |
+
25: Compute: $z _ { j } = z ( x + \eta _ { j } )$
|
| 495 |
+
26: Increment: $A [ 1 , : ] A [ 1 , : ] + z _ { j } , A [ 2 , : ] A [ 2 , : ] + z _ { j } ^ { 2 }$
|
| 496 |
+
|
| 497 |
+
# A.3 COMPARING SOFT-RS WITH HARD-RS
|
| 498 |
+
|
| 499 |
+
We use Soft-RS during training and use Hard-RS during certification. In this section, we empirically compare these two certification methods. We certify the nine models in Table 4. For each model, we certify with both Hard-RS and Soft-RS. For Hard-RS, we use Clopper-Pearson bound and for Soft-RS, we use the empirical Bernstein bound with different choices of $\beta$ . The results are displayed in Figure 4. The results show that Hard-RS consistently gives a larger lower bound of robust radius than Soft-RS. We also observe that there is a gap between Soft-RS and Hard-RS when $\beta \infty$ , which implies that the empirical Bernstein bound, though tighter than the Hoeffding bound, is still looser than the Clopper-Pearson bound.
|
| 500 |
+
|
| 501 |
+
# B PROOF OF PROPOSITION 1
|
| 502 |
+
|
| 503 |
+
Proof of Proposition $I$ . We only need to consider the case when $\Phi ^ { - 1 } ( p _ { 1 } ) - \Phi ^ { - 1 } ( p _ { 2 } ) \leq \gamma$ since the derivative is zero when $\Phi ^ { - 1 } ( p _ { 1 } ^ { \cdot } ) - \Phi ^ { - 1 } ( p _ { 2 } ) > \gamma$ . Obviously, $p _ { 2 } \leq 0 . 5$ and thus $\Phi ^ { - 1 } ( p _ { 2 } ) \leq 0$ . So $\Phi ^ { - 1 } ( p _ { 1 } ) \leq \gamma$ .
|
| 504 |
+
|
| 505 |
+
Define $p ^ { * } \in ( 0 , 1 )$ such that $\Phi ^ { - 1 } ( p ^ { * } ) = \gamma$ . Since $\Phi ^ { - 1 } ( p )$ is a strictly increasing function of $p , p ^ { * }$ is unique, and $p _ { 1 } \leq p ^ { * }$ . $\operatorname* { m i n } \{ [ \Phi ^ { - 1 } ( p _ { 1 } ) - \Phi ^ { - 1 } ( p _ { 2 } ) ] , \gamma \} = \Phi ^ { - 1 } ( p _ { 1 } ) - \Phi ^ { - 1 } ( p _ { 2 } )$ . Since $p _ { 1 }$ is the largest value and $p _ { 1 } + p _ { 2 } + . . . + p _ { K } = 1$ , we have $\begin{array} { r } { \frac { 1 } { K } \le p _ { 1 } \le p ^ { * } } \end{array}$ . Since $[ \Phi ^ { - 1 } ] ^ { \prime } ( p )$ is continuous in any closed interval of $( 0 , 1 )$ , the derivative of $\Phi ^ { - 1 } ( p _ { 1 } ) - \Phi ^ { - 1 } ( p _ { 2 } )$ with respect to $p _ { 1 }$ is bounded. Similarly, $p _ { 2 }$ is the largest among $p _ { 2 } , . . . p _ { K }$ and $( K - 1 ) p _ { 2 } \geq p _ { 2 } + . . . + p _ { K } = 1 - p _ { 1 } \geq 1 - p ^ { * }$ . Thus $\begin{array} { r } { 1 - p ^ { * } \ge p _ { 2 } \ge \frac { 1 - p ^ { * } } { K - 1 } } \end{array}$ , and the derivative of $\Phi ^ { - 1 } ( p _ { 1 } ) - \Phi ^ { - 1 } ( p _ { 2 } )$ with respect to $p _ { 2 }$ is bounded.
|
| 506 |
+
|
| 507 |
+
# C SUPPLEMENTARY MATERIAL FOR EXPERIMENTS
|
| 508 |
+
|
| 509 |
+
# C.1 COMPARED MODELS
|
| 510 |
+
|
| 511 |
+
In this section we list all compared models in the main body of this paper. Cifar-10 models are listed in Table 4, and ImageNet models are listed in Table 5.
|
| 512 |
+
|
| 513 |
+
Table 4: Models for comparison on Cifar-10.
|
| 514 |
+
|
| 515 |
+
<table><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Description</td></tr><tr><td rowspan=1 colspan=2>Cohen-{0.25,0.50,1.00}</td><td rowspan=1 colspan=1>Cohen et al. (2019)'s models</td></tr><tr><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>Salman-0.25MACER-0.25</td><td rowspan=1 colspan=1>8-sample 10-step SmoothAdv pGD with ε = 1.00MACER with k = 16,λ= 12.0,β= 16.0 and γ = 8.0</td></tr><tr><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>Salman-0.50MACER-0.50</td><td rowspan=1 colspan=1>2-sample 10-step SmoothAdv pGD with ∈ = 2.00MACER with k = 16,λ= 4.0,β= 16.0 and γ = 8.0</td></tr><tr><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>Salman-1.00MACER-1.00</td><td rowspan=1 colspan=1>2-sample 10-step SmoothAdv pGD with e= 2.00MACER with k = 16,dynamic X5, β = 16.0 and γ = 8.0</td></tr></table>
|
| 516 |
+
|
| 517 |
+
Table 5: Models for comparison on ImageNet.
|
| 518 |
+
|
| 519 |
+
<table><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Description</td></tr><tr><td rowspan=1 colspan=2>Cohen-{0.25,0.50,1.00}</td><td rowspan=1 colspan=1>Cohen et al. (2019)'s models</td></tr><tr><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>Salman-0.25MACER-0.25</td><td rowspan=1 colspan=1>1-sample 2-step SmoothAdvDDN with ∈= 1.0MACER with k = 2,λ= 6.0,β= 16.0 and γ = 8.0</td></tr><tr><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>Salman-0.50MACER-0.50</td><td rowspan=1 colspan=1>1-sample 1-step SmoothAdv pGD with ε= 1.0MACER with k = 2, λ= 3.0, β = 16.0 and γ = 8.0</td></tr><tr><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>Salman-1.00MACER-1.00</td><td rowspan=1 colspan=1>1-sample 1-step SmoothAdvpGD with ε= 2.0MACER with k =2,入= 3.0,β= 16.0 and γ = 8.0</td></tr></table>
|
| 520 |
+
|
| 521 |
+
# C.2 RESULTS ON MNIST AND SVHN
|
| 522 |
+
|
| 523 |
+
Here we present experimental results on MNIST and SVHN. For comparison we also report the results produced by Cohen et al. (2019)’s method.
|
| 524 |
+
|
| 525 |
+

|
| 526 |
+
Figure 4: Comparing Soft-RS with Hard-RS on Cifar-10. The three columns correspond to $\sigma =$ 0.25, 0.50, 1.00 respectively.
|
| 527 |
+
|
| 528 |
+
# C.2.1 MNIST
|
| 529 |
+
|
| 530 |
+
The results are reported in Table 6. For all $\sigma$ , we use $k = 1 6$ , $\lambda = 1 6 . 0$ , $\gamma = 8 . 0$ and $\beta = 1 6 . 0$ .
|
| 531 |
+
|
| 532 |
+
Table 6: Approximated certified test accuracy and ACR on MNIST: Each column is an $l _ { 2 }$ radius.
|
| 533 |
+
|
| 534 |
+
<table><tr><td>0</td><td>Method</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td>0.25</td><td>Cohen MACER</td><td>0.99 0.99</td><td>0.97 0.99</td><td>0.94 0.97</td><td>0.89 0.95</td><td>0 0</td><td>0 0</td><td>0 0</td><td>0 0</td><td>0 0</td><td>0 0</td><td>0.887 0.918</td></tr><tr><td>0.50</td><td>Cohen MACER</td><td>0.99 0.99</td><td>0.97 0.98</td><td>0.94 0.96</td><td>0.91 0.94</td><td>0.84 0.90</td><td>0.75 0.83</td><td>0.57 0.73</td><td>0.33 0.50</td><td>0 0</td><td>0 0</td><td>1.453 1.583</td></tr><tr><td>1.00</td><td>Cohen MACER</td><td>0.95 0.89</td><td>0.92 0.85</td><td>0.87 0.79</td><td>0.81 0.75</td><td>0.72 0.69</td><td>0.61 0.61</td><td>0.50 0.54</td><td>0.34 0.45</td><td>0.20 0.36</td><td>0.10 0.28</td><td>1.417 1.520</td></tr></table>
|
| 535 |
+
|
| 536 |
+
# C.2.2 SVHN
|
| 537 |
+
|
| 538 |
+
The results are reported in Table 7. We use $k = 1 6$ , $\lambda = 1 2 . 0$ , $\gamma = 8 . 0$ and $\beta = 1 6 . 0$ .
|
| 539 |
+
|
| 540 |
+
Table 7: Approximated certified test accuracy and ACR on SVHN: Each column is an $l _ { 2 }$ radius.
|
| 541 |
+
|
| 542 |
+
<table><tr><td>0</td><td>Method</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td>0.25</td><td>Cohen MACER</td><td>0.90 0.86</td><td>0.70 0.72</td><td>0.44</td><td>0.26</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.469 0.540</td></tr><tr><td>0.50</td><td>Cohen MACER</td><td>0.67 0.61</td><td>0.48 0.53</td><td>0.56 0.37 0.44</td><td>0.39 0.24 0.35</td><td>0 0.14 0.24</td><td>0 0.08 0.15</td><td>0 0.06 0.09</td><td>0 0.03 0.04</td><td>0 0 0</td><td>0 0 0</td><td>0.434 0.538</td></tr></table>
|
| 543 |
+
|
| 544 |
+
# C.3 MACER TRAINING FOR 150 EPOCHS
|
| 545 |
+
|
| 546 |
+
In Table 8 we report the performance and training time of MACER on Cifar-10 when it is only run for 150 epochs, and compare with SmoothAdv (Salman et al., 2019) and MACER (440 epochs). The learning rate is decayed by 0.1 at epochs 60 and 120. All other hyperparameters are kept the same as in Table 4.
|
| 547 |
+
|
| 548 |
+
Table 8: Approximated certified test accuracy and ACR on Cifar-10: Each column is an $l _ { 2 }$ radius.
|
| 549 |
+
|
| 550 |
+
<table><tr><td>0</td><td>Method</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>ACR</td><td>Epochs</td><td>Total hrs</td></tr><tr><td rowspan="3">0.25</td><td>SmoothAdv</td><td>0.74</td><td>0.67</td><td>0.57</td><td>0.47</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.538</td><td>150</td><td>82.92</td></tr><tr><td>MACER</td><td>0.76</td><td>0.67</td><td>0.57</td><td>0.42</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.531</td><td>150</td><td>21.00</td></tr><tr><td>MACER</td><td>0.81</td><td>0.71</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.556</td><td>440</td><td>61.60</td></tr><tr><td rowspan="3">0.50</td><td>SmoothAdv</td><td>0.50</td><td>0.46</td><td>0.44</td><td>0.40</td><td>0.38</td><td>0.33</td><td>0.29</td><td>0.23</td><td>0.709</td><td>150</td><td>82.92</td></tr><tr><td>MACER</td><td>0.62</td><td>0.57</td><td>0.50</td><td>0.44</td><td>0.38</td><td>0.29</td><td>0.21</td><td>0.13</td><td>0.712</td><td>150</td><td>21.00</td></tr><tr><td>MACER</td><td>0.66</td><td>0.60</td><td>0.53</td><td>0.46</td><td>0.38</td><td>0.29</td><td>0.19</td><td>0.12</td><td>0.726</td><td>440</td><td>61.60</td></tr></table>
|
| 551 |
+
|
| 552 |
+
# C.4 EFFECT OF HYPERPARAMETERS
|
| 553 |
+
|
| 554 |
+
All experiments are run on Cifar-10 with $\sigma = 0 . 2 5$ or 0.50. See Table 9 for detailed experimental settings. Results are reported in Tables 10-13.
|
| 555 |
+
|
| 556 |
+
Table 9: Experimental setting for examining the effect of hyperparameters.
|
| 557 |
+
|
| 558 |
+
<table><tr><td rowspan=1 colspan=1>Experiment</td><td rowspan=1 colspan=1>k</td><td rowspan=1 colspan=1>入</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>β</td></tr><tr><td rowspan=1 colspan=1>Effect of k</td><td rowspan=1 colspan=1>1/2/4/8/16</td><td rowspan=1 colspan=1>12.0</td><td rowspan=1 colspan=1>8.0</td><td rowspan=1 colspan=1>16.0</td></tr><tr><td rowspan=1 colspan=1>Effect of 入</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>0.0/1.0/2.0/4.0/8.0/16.0</td><td rowspan=1 colspan=1>8.0</td><td rowspan=1 colspan=1>16.0</td></tr><tr><td rowspan=1 colspan=1>Effect ofy</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>12.0</td><td rowspan=1 colspan=1>2.0/4.0/6.0/8.0/10.0/12.0/14.0/16.0</td><td rowspan=1 colspan=1>16.0</td></tr><tr><td rowspan=1 colspan=1>Effectof β</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>12.0</td><td rowspan=1 colspan=1>8.0</td><td rowspan=1 colspan=1>1.0/2.0/4.0/8.0/16.0/32.0/64.0</td></tr></table>
|
| 559 |
+
|
| 560 |
+
Table 10: Effect of $k$ : Approximated certified test accuracy and ACR on Cifar-10.
|
| 561 |
+
|
| 562 |
+
<table><tr><td>0</td><td>k</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td rowspan="5">0.25</td><td>1</td><td>0.77</td><td>0.65</td><td>0.45</td><td>0.27</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.448</td></tr><tr><td></td><td>0.81</td><td>0.69</td><td>0.53</td><td>0.38</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.519</td></tr><tr><td>24</td><td>0.79</td><td>0.69</td><td>0.55</td><td>0.38</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.517</td></tr><tr><td>8</td><td>0.78</td><td>0.69</td><td>0.57</td><td>0.41</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.538</td></tr><tr><td>16</td><td>0.81</td><td>0.71</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.556</td></tr><tr><td rowspan="5">0.50</td><td>1</td><td>0.36</td><td>0.31</td><td>0.26</td><td>0.19</td><td>0.12</td><td>0.09</td><td>0.05</td><td>0.02</td><td>0</td><td>0</td><td>0.306</td></tr><tr><td></td><td>0.60</td><td>0.53</td><td>0.47</td><td>0.37</td><td>0.28</td><td>0.19</td><td>0.13</td><td>0.08</td><td>0</td><td>0</td><td>0.589</td></tr><tr><td>24</td><td>0.60</td><td>0.55</td><td>0.50</td><td>0.42</td><td>0.34</td><td>0.26</td><td>0.18</td><td>0.11</td><td>0</td><td>0</td><td>0.665</td></tr><tr><td>8</td><td>0.61</td><td>0.56</td><td>0.50</td><td>0.43</td><td>0.37</td><td>0.28</td><td>0.22</td><td>0.14</td><td>0</td><td>0</td><td>0.699</td></tr><tr><td>16</td><td>0.60</td><td>0.56 0.50</td><td></td><td>0.46</td><td>0.38</td><td>0.29</td><td>0.23</td><td>0.14</td><td>0</td><td>0</td><td>0.712</td></tr></table>
|
| 563 |
+
|
| 564 |
+
Table 11: Effect of $\lambda$ : Approximated certified test accuracy and ACR on Cifar-10.
|
| 565 |
+
|
| 566 |
+
<table><tr><td>0</td><td>入</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td rowspan="6">0.25</td><td>0.0</td><td>0.82</td><td>0.67</td><td>0.51</td><td>0.32</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.488</td></tr><tr><td>1.0</td><td>0.81</td><td>0.68</td><td>0.54</td><td>0.35</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.516</td></tr><tr><td>2.0</td><td>0.81</td><td>0.71</td><td>0.54</td><td>0.36</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.523</td></tr><tr><td>4.0</td><td>0.82</td><td>0.71</td><td>0.56</td><td>0.41</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.540</td></tr><tr><td>8.0</td><td>0.80</td><td>0.70</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.550</td></tr><tr><td>16.0</td><td>0.78</td><td>0.69</td><td>0.57</td><td>0.46</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.550</td></tr><tr><td rowspan="6">0.50</td><td>0.0</td><td>0.69</td><td>0.56</td><td>0.44</td><td>0.31</td><td>0.21</td><td>0.13</td><td>0.06</td><td>0.02</td><td>0</td><td>0</td><td>0.515</td></tr><tr><td>1.0</td><td>0.68</td><td>0.59</td><td>0.52</td><td>0.43</td><td>0.33</td><td>0.23</td><td>0.15</td><td>0.07</td><td>0</td><td>0</td><td>0.662</td></tr><tr><td>2.0</td><td>0.70</td><td>0.61</td><td>0.53</td><td>0.43</td><td>0.36</td><td>0.27</td><td>0.18</td><td>0.09</td><td>0</td><td>0</td><td>0.709</td></tr><tr><td>4.0</td><td>0.66</td><td>0.60</td><td>0.53</td><td>0.46</td><td>0.37</td><td>0.29</td><td>0.19</td><td>0.12</td><td>0</td><td>0</td><td>0.726</td></tr><tr><td>8.0</td><td>0.62</td><td>0.56</td><td>0.50</td><td>0.45</td><td>0.37</td><td>0.29</td><td>0.21</td><td>0.13</td><td>0</td><td>0</td><td>0.700</td></tr><tr><td>16.0</td><td>0.60</td><td>0.56</td><td>0.51</td><td>0.45</td><td>0.36</td><td>0.30</td><td>0.21</td><td>0.14</td><td>0</td><td>0</td><td>0.711</td></tr></table>
|
| 567 |
+
|
| 568 |
+
Table 12: Effect of $\gamma$ : Approximated certified test accuracy and ACR on Cifar-10.
|
| 569 |
+
|
| 570 |
+
<table><tr><td>0</td><td>Y</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td rowspan="7">0.25</td><td>2.0</td><td>0.82</td><td>0.67</td><td>0.47</td><td>0.26</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.455</td></tr><tr><td>4.0</td><td>0.83</td><td>0.70</td><td>0.53</td><td>0.35</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.521</td></tr><tr><td>6.0</td><td>0.80</td><td>0.70</td><td>0.57</td><td>0.40</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.539</td></tr><tr><td>8.0</td><td>0.81</td><td>0.71</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.556</td></tr><tr><td>10.0</td><td>0.78</td><td>0.69</td><td>0.57</td><td>0.44</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.543</td></tr><tr><td>12.0</td><td>0.76</td><td>0.69</td><td>0.58</td><td>0.42</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.534</td></tr><tr><td>14.0</td><td>0.76</td><td>0.68</td><td>0.55</td><td>0.44</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.536</td></tr><tr><td rowspan="6"></td><td>16.0</td><td>0.75</td><td>0.67</td><td>0.56</td><td>0.44</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.534</td></tr><tr><td>2.0</td><td>0.70</td><td>0.61</td><td>0.49</td><td>0.33</td><td>0.23</td><td>0.13</td><td>0.06</td><td>0.03</td><td>0</td><td>0</td><td>0.549</td></tr><tr><td>4.0</td><td>0.68</td><td>0.60</td><td>0.53</td><td>0.44</td><td>0.34</td><td>0.25</td><td>0.15</td><td>0.06</td><td>0</td><td>0</td><td>0.676</td></tr><tr><td>6.0</td><td>0.65</td><td>0.58</td><td>0.51</td><td>0.43</td><td>0.35</td><td>0.28</td><td>0.20</td><td>0.13</td><td>0</td><td>0</td><td>0.706</td></tr><tr><td>8.0</td><td>0.60</td><td>0.56</td><td>0.50</td><td>0.46</td><td>0.38</td><td>0.29</td><td>0.23</td><td>0.14</td><td>0</td><td>0</td><td>0.712</td></tr><tr><td>10.0</td><td>0.58</td><td>0.54</td><td>0.49</td><td>0.44</td><td>0.37</td><td>0.31</td><td>0.24</td><td>0.15</td><td>0</td><td>0</td><td>0.707</td></tr><tr><td></td><td>12.0</td><td>0.56</td><td>0.51</td><td>0.48</td><td>0.43</td><td>0.38</td><td>0.34</td><td>0.26</td><td>0.16</td><td>0</td><td>0</td><td>0.712</td></tr><tr><td></td><td>14.0</td><td>0.51</td><td>0.48</td><td>0.44</td><td>0.38</td><td>0.33</td><td>0.28</td><td>0.22</td><td>0.16</td><td>0</td><td>0</td><td>0.634</td></tr><tr><td></td><td>16.0</td><td>0.57</td><td>0.54</td><td>0.47</td><td>0.41</td><td>0.34</td><td>0.30</td><td>0.24</td><td>0.17</td><td>0</td><td>0</td><td>0.695</td></tr></table>
|
| 571 |
+
|
| 572 |
+
Table 13: Effect of $\beta$ : Approximated certified test accuracy and ACR on Cifar-10.
|
| 573 |
+
|
| 574 |
+
<table><tr><td>0</td><td>阝</td><td>0.00</td><td>0.25</td><td>0.50</td><td>0.75</td><td>1.00</td><td>1.25</td><td>1.50</td><td>1.75</td><td>2.00</td><td>2.25</td><td>ACR</td></tr><tr><td rowspan="7">0.25</td><td>1.0</td><td>0.79</td><td>0.67</td><td>0.54</td><td>0.37</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.513</td></tr><tr><td>2.0</td><td>0.81</td><td>0.69</td><td>0.56</td><td>0.41</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.534</td></tr><tr><td>4.0</td><td>0.79</td><td>0.70</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.549</td></tr><tr><td>8.0</td><td>0.79</td><td>0.71</td><td>0.57</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.541</td></tr><tr><td>16.0</td><td>0.81</td><td>0.71</td><td>0.59</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.556</td></tr><tr><td>32.0</td><td>0.79</td><td>0.70</td><td>0.58</td><td>0.43</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.549</td></tr><tr><td>64.0</td><td>0.74</td><td>0.65</td><td>0.54</td><td>0.42</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0.517</td></tr><tr><td rowspan="7">0.50</td><td>1.0 2.0</td><td>0.67</td><td>0.59</td><td>0.52</td><td>0.43</td><td>0.35</td><td>0.26</td><td>0.19</td><td>0.10</td><td>0</td><td>0</td><td>0.696</td></tr><tr><td></td><td>0.63</td><td>0.57</td><td>0.52</td><td>0.45</td><td>0.37</td><td>0.31</td><td>0.22</td><td>0.13</td><td>0</td><td>0</td><td>0.719</td></tr><tr><td>4.0</td><td>0.60</td><td>0.55</td><td>0.50</td><td>0.45</td><td>0.36</td><td>0.30</td><td>0.22</td><td>0.14</td><td>0</td><td>0</td><td>0.703</td></tr><tr><td>8.0</td><td>0.60</td><td>0.56</td><td>0.52</td><td>0.43</td><td>0.38</td><td>0.30</td><td>0.24</td><td>0.14</td><td>0</td><td>0</td><td>0.713</td></tr><tr><td>16.0</td><td>0.60</td><td>0.56</td><td>0.50</td><td>0.46</td><td>0.38</td><td>0.29</td><td>0.23</td><td>0.14</td><td>0</td><td>0</td><td>0.712</td></tr><tr><td>32.0</td><td>0.59</td><td>0.55</td><td>0.49</td><td>0.44</td><td>0.36</td><td>0.30</td><td>0.23</td><td>0.14</td><td>0</td><td>0</td><td>0.705</td></tr><tr><td>64.0</td><td>0.45</td><td>0.41</td><td>0.38</td><td>0.35</td><td>0.32</td><td>0.26</td><td>0.21</td><td>0.16</td><td>0</td><td>0</td><td>0.579</td></tr></table>
|
md/train/rYhBGWYm6AU/rYhBGWYm6AU.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Intriguing Properties of Contrastive Losses
|
| 2 |
+
|
| 3 |
+
Ting Chen Google Research iamtingchen@google.com
|
| 4 |
+
|
| 5 |
+
Calvin Luo Google Research calvinluo@google.com
|
| 6 |
+
|
| 7 |
+
Lala Li Google Research lala@google.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
We study three intriguing properties of contrastive learning. First, we generalize the standard contrastive loss to a broader family of losses, and we find that various instantiations of the generalized loss perform similarly under the presence of a multi-layer non-linear projection head. Second, we study if instance-based contrastive learning (with a global image representation) can learn well on images with multiple objects present. We find that meaningful hierarchical local features can be learned despite the fact that these objectives operate on global instancelevel features. Finally, we study the phenomenon of feature suppression among competing features shared across augmented views, such as “color distribution” vs “object class”. We construct datasets with explicit and controllable competing features and show that, for contrastive learning, a few bits of easy-to-learn shared features can suppress, and even fully prevent, the learning of other sets of competing features. In scenarios where there are multiple objects in an image, the dominant object would suppress the learning of smaller objects. Existing contrastive learning methods critically rely on data augmentation to favor certain sets of features over others, and could suffer from learning saturation for scenarios where existing augmentations cannot fully address the feature suppression. This poses open challenges to existing contrastive learning techniques 1.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Contrastive learning [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] has recently achieved great successes in learning visual representations without supervision. As shown in [13, 14], contrastive learning can learn representations that rival supervised learning, and significantly improve the state-of-the-art in semi-supervised learning on ImageNet. One successful use case of contrastive loss for self-supervised learning is to make augmented views of the same example agree [1, 2, 13]. A widely used contrastive loss to encourage agreement is based on cross entropy [15, 3, 4, 13]. Given an augmented view of an example, the contrastive prediction task aims to classify a set of candidates into the positive example (i.e. the other augmented view of the same example) and negative ones via the cross entropy loss.
|
| 16 |
+
|
| 17 |
+
In this work, to understand the effectiveness and limitation of existing contrastive learning methods, we study three intriguing aspects. First, we propose a generalization of the standard contrastive loss, and systematically study their performance differences. Second, we study if the instance-based contrastive learning, for which the contrastive loss operates on global representation of an input image, can learn well on images with multiple objects present, and whether or not it leads to meaningful local features. Finally, we systematically study the feature suppression phenomenon in contrastive learning. The suppression effect occurs among competing features shared across augmented views. For example, with random cropping as the augmentation, “color distribution” and “object class” are often competing features as they are likely shared between two augmented views. The suppression effect among competing features can significantly degenerate the representation quality, or even completely disable the learning of certain features, as shown in our experiments. Existing methods critically rely on hand-crafted data augmentation to favor certain sets of competing features than others.
|
| 18 |
+
|
| 19 |
+
Our main findings and contributions are summarized below.
|
| 20 |
+
|
| 21 |
+
• We propose a generalized contrastive loss, and show that differences between contrastive losses are small with a deep projection head.
|
| 22 |
+
• We show that the instance-based objective widely used in existing contrastive learning methods can learn on images with multiple objects, and also learn meaningful local features despite operating on global image representation.
|
| 23 |
+
• We construct three datasets with explicit and controllable competing features to systematically study the feature suppression effect in contrastive learning.
|
| 24 |
+
• We show that a few bits of easy-to-learn shared features can suppress, and even fully prevent, the learning of other sets of competing features. In scenarios where there are multiple objects in an image, the dominant object would suppress the learning of smaller objects. This poses open challenges to existing contrastive learning.
|
| 25 |
+
|
| 26 |
+
# 2 Generalized contrastive loss and differences among its instantiations
|
| 27 |
+
|
| 28 |
+
The common contrastive loss used in most recent work is based on cross entropy [15, 3, 4]. Following the notation in [13], the contrastive loss can be defined between two augmented views $( i , j )$ of the same example for a mini-batch of size of $n$ , and can be written as the following.
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\mathcal { L } ^ { \mathrm { N T - X e n t } } = - \frac { 1 } { n } \sum _ { i , j \in \mathcal { M B } } \log \frac { \exp ( \sin ( z _ { i } , z _ { j } ) / \tau ) } { \sum _ { k = 1 } ^ { 2 n } \mathbb { 1 } _ { [ k \neq i ] } \exp ( \sin ( z _ { i } , z _ { k } ) / \tau ) }
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $z _ { i } , z _ { j }$ are hidden representations of two augmented views of the same example; $\sin ( { \boldsymbol { \mathbf { u } } } , { \boldsymbol { \mathbf { v } } } ) =$ $\pmb { u } ^ { T } \pmb { v } / ( \lVert \pmb { u } \rVert \lVert \pmb { v } \rVert )$ is the cosine similarity between two vectors; $\tau$ is a temperature scalar and $\mathcal { M } \mathcal { B }$ is a randomly sampled mini-batch consisting of augmented pairs of images. In [13], a MLP projection head is introduced between intermediate layer $^ { h }$ (e.g. output of ResNet encoder) and final output $_ { z }$ . It is shown that the projection head is very beneficial and $^ { h }$ is a much better feature representation than $_ { z }$ .
|
| 35 |
+
|
| 36 |
+
In this work, we generalize the standard contrastive loss to the following form.
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\boxed { \mathcal { L } _ { \mathrm { g e n e r a l i z e d c o n t r a s t i v e } } = \mathcal { L } _ { \mathrm { a l i g n m e n t } } + \lambda \mathcal { L } _ { \mathrm { d i s t r i b u t i o n } } }
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
Both terms are defined on hidden representations. $\mathcal { L } _ { \mathrm { a l i g n m e n t } }$ encourages representations of augmented views to be consistent, while ${ \mathcal { L } } _ { \mathrm { d i s t r i b u t i o n } }$ encourages representations (or a random subset of them) to match a prior distribution (of high entropy). It is not difficult to see that the standard contrastive loss in Eq. 1 is a special case as it can be re-written as follows (scaled by a constant $\tau$ ).
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\tau \mathcal { L } ^ { \mathrm { N T - X e n t } } = \underbrace { - \frac { 1 } { n } \sum _ { i , j } \sin ( z _ { i } , z _ { j } ) } _ { \mathcal { L } _ { \mathrm { a l i g n m e n t } } } + \underbrace { \frac { \tau } { n } \sum _ { i } \log \sum _ { k = 1 } ^ { 2 n } \mathbb { 1 } _ { [ k \neq i ] } \exp ( \sin ( z _ { i } , z _ { k } ) / \tau ) } _ { \mathcal { L } _ { \mathrm { d i s t r i b u t i o n } } }
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
This form of factorization in Eq. 3 has been proposed in [16], where the second LogSumExp term is referred to as uniformity since it encourages representation to uniformly distributed in the hypersphere. Different from [16], here we generalize the hypersphere uniform distribution and study a wider set of prior distributions for their effectiveness in learning representations.
|
| 49 |
+
|
| 50 |
+
SWD for supporting diverse prior distributions. One issue of using more diverse set of priors is we cannot rely on LogSumExp for matching the distribution. To this end, we resort to the theory of optimal transport, via Sliced Wasserstein Distance (SWD) [17, 18, 19]. For two sets of equalsized samples from two 1-D distributions, the optimal transport can be obtained by computing two permutations that order the values of both sets of samples respectively. The 1-D Wasserstein distance can then be computed with $\ell _ { 2 }$ distance between the ordered values. For n-D distributions, we first project the samples to $n$ randomly-generated orthogonal 1-D subspaces, and then compute the sum of 1-D Wasserstein distance across all 1-D subspaces. By adjusting the network weights to minimize the SWD, we are able to reduce the mismatch between the distribution of hidden vectors and a known prior distribution. The detailed algorithm can be found in Algorithm 1. With SWD loss, we are able to use a wider set of priors, and Table 1 summarizes instantiations of the generalized contrastive loss with different prior distributions and distribution matching loss.
|
| 51 |
+
|
| 52 |
+
Algorithm 1 Sliced Wasserstein Distance (SWD) loss.
|
| 53 |
+
|
| 54 |
+
<table><tr><td>input: activation vectors H ∈ Rb×d, ,a prior distribution (e.g. Gaussian) sampler S draw prior vectors P ∈ Rb×d using S</td></tr><tr><td></td></tr><tr><td>generate random orthogonal matrix W ∈ Rd×d'</td></tr><tr><td>make projections: H-= HW; P⊥ = PW</td></tr><tr><td>initializeSWDlossl=0</td></tr><tr><td>forj∈{1,2,.,d'} do l =l+ |lsort(H:j)-sort(P:j)|l²</td></tr><tr><td></td></tr><tr><td>end for return l/(dd')</td></tr></table>
|
| 55 |
+
|
| 56 |
+
Table 1: Instantiations of the generalized contrastive loss, i.e. $\mathcal { L } _ { \mathrm { a l i g n m e n t } } + \lambda \mathcal { L } _ { \mathrm { d i s t r i b u t i o n } }$ , that we use in this work. $\tilde { z }$ denotes $\ell _ { 2 }$ -normalized $z \in \mathbb { R } ^ { d }$ , and is only used for uniform hypersphere prior.
|
| 57 |
+
|
| 58 |
+
<table><tr><td>Laign</td><td>Prior distribution</td><td>Ldistribution</td></tr><tr><td>nd∑i, |lzi - zj|l²Uniform hypersphere</td><td></td><td>e∑log∑exp(Tzj/T)</td></tr><tr><td>nd∑ij |lz- zjll2Uniform hypersphere</td><td></td><td>SWD(Z, zprior)</td></tr><tr><td>d∑ij|lz-zjll²Uniform hypercube</td><td></td><td>SWD(Z, Zprior)</td></tr><tr><td>nd∑i,j |lzi - zjll2Normal distribution</td><td></td><td>SWD(Z, Zprior)</td></tr></table>
|
| 59 |
+
|
| 60 |
+
Connection with mutual information. The connection between the standard contrastive loss and mutual information has been shown before [3, 20], where the contrastive loss (a.k.a. InfoNCE loss [3]) is shown to be a lower bound of the mutual information. To connect the generalized contrastive loss to mutual information, we start by the definition of mutual information between two latent variables $U , V$ , which is $I ( U ; V ) = H ( U ) - H ( U | V )$ . Comparing this factorization of mutual information with generalized contrastive loss, it is not difficult to see that: 1) the alignment term $\mathcal { L } _ { \mathrm { a l i g n m e n t } }$ is directly related to $H ( U | V )$ which aims to reduce uncertainty of the other views given one view of the example; and 2) the distribution matching term ${ \mathcal { L } } _ { \mathrm { d i s t r i b u t i o n } }$ can be considered as a proxy to $H ( u )$ for maximizing the entropy in the representation. It is perhaps worth noting that different from mutual information, the generalized contrastive loss (Eq. 2) allows a tunable weight $( \lambda )$ between the alignment and distribution matching term. The weighting scalar $\lambda$ is (inversely) related to the temperature $\tau$ (details in Appendix A.2).
|
| 61 |
+
|
| 62 |
+
Comparing different instantiations of generalized contrastive loss. Here we ask: Is it essential to use a uniform hypersphere prior for the effectiveness of contrastive loss? How much difference does it make when distinct generalized contrastive losses are used? To answer this question, we conduct experiments following SimCLR settings [13, 14], and use the linear evaluation protocol. Detailed experimental setup can be found in Appendix A.1.
|
| 63 |
+
|
| 64 |
+
Figure 1 shows linear evaluation results of models trained with different losses under different training epochs. On CIFAR-10, we see little difference in terms of linear evaluation for variants of the generalized contrastive losses, especially when trained longer than 200 epochs. As for ImageNet, there are some discrepancies between different losses, but they disappear when a deeper 3-layer non-linear projection head is used.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 1: Linear evaluation accuracy of ResNet-50 trained with different losses on CIFAR-10 and ImageNet datasets. Numbers of projection head layers are in parentheses. Differences between variants of generalized contrastive loss are small with a deep projection head. Decoupled NT-Xent loss is introduced in A.2. Numerical results can be found in Appendix A.3.
|
| 68 |
+
|
| 69 |
+
Furthermore, we find that deep projection head not only reduces the differences among different generalized contrastive losses, but has a similar effect for batch size. With proper learning rate scaling across batch sizes (e.g. square root scaling with LARS optimizer [21]), the impact of batch size on representation quality is small. Table 2 demonstrate this phenomenon for the standard contrastive loss, and more results on other losses can be found in Appendix A.3.
|
| 70 |
+
|
| 71 |
+
Table 2: Linear eval accuracy of ResNet-50 on ImageNet.
|
| 72 |
+
|
| 73 |
+
<table><tr><td rowspan="2">Projection head</td><td rowspan="2">Batch size</td><td colspan="4">Epoch</td></tr><tr><td>100</td><td>200</td><td>400</td><td>800</td></tr><tr><td rowspan="3">2 layers</td><td>512</td><td>65.4</td><td>67.3</td><td>68.7</td><td>69.3</td></tr><tr><td>1024</td><td>65.6</td><td>67.6</td><td>68.8</td><td>69.8</td></tr><tr><td>2048</td><td>65.3</td><td>67.6</td><td>69.0</td><td>70.1</td></tr><tr><td rowspan="3">3 layers</td><td>512</td><td>66.6</td><td>68.4</td><td>70.0</td><td>71.0</td></tr><tr><td>1024</td><td>66.8</td><td>68.9</td><td>70.1</td><td>70.9</td></tr><tr><td>2048</td><td>66.8</td><td>69.1</td><td>70.4</td><td>71.3</td></tr><tr><td rowspan="3">4 layers</td><td>512</td><td>66.8</td><td>68.8</td><td>70.0</td><td>70.7</td></tr><tr><td>1024</td><td>67.0</td><td>69.0</td><td>70.4</td><td>70.9</td></tr><tr><td>2048</td><td>67.0</td><td>69.3</td><td>70.4</td><td>71.3</td></tr></table>
|
| 74 |
+
|
| 75 |
+
# 3 Instance-based objective can learn on images with multiple objects and learn good local features
|
| 76 |
+
|
| 77 |
+
Most existing contrastive learning methods [13, 10, 22, 4] define their objectives at the instance level where each image is encoded into a single vector representation (e.g. representations of two random crops of the same image instance are treated as a positive pair). In other words, the objective operates on a global representation of its input rather than on some local regions (of its input). We pose two questions regarding instance-based global objective: 1) when there is only a single (dominant) object in the image, the objective seems reasonable as it encourages the model to learn features relevant to object class, but when there are multiple objects present in the image, can instance-based objective still learn well? 2) Since the instance-based objective uses a global summary of its input, can it still learn good local features (e.g. parts of an object, or multiple objects in the same scheme)? To answer these questions, we use SimCLR as representative for the instance-based objective.
|
| 78 |
+
|
| 79 |
+
# 3.1 SimCLR can learn on images with multiple objects
|
| 80 |
+
|
| 81 |
+
Commonly used self-supervised learning datasets, such as MNIST, CIFAR-10, ImageNet, are object centered, i.e. the image is mainly occupied by a single (dominant) object. To experiment with multiple objects in a controllable setting, we propose a new dataset setting by composing multiple digits as follows.
|
| 82 |
+
|
| 83 |
+
MultiDigits dataset. We place MNIST digits ( $2 8 \times 2 8$ size) on a shared canvas $1 1 2 \times 1 1 2$ size). We vary the number of digits placed on the canvas. One factor that could interfere with learning of multiple digits is overlapping digits, therefore we use two placement strategies: random vs in-grid (Figure 2). Random placement of digits incurs no constraint on where digits can be placed on the canvas, whereas in-grid placement puts each digit in one of the $4 \times 4$ grid cells the canvas is divided into, and no two digits can fall in the same cell. In-grid placement ensures no overlapping of digits.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 2: MultiDigit dataset. More digits lead to more overlapping in random placement.
|
| 87 |
+
|
| 88 |
+
We first pretrain a ResNet-18 with SimCLR or supervised learning with the same augmentation policy (random cropping and resize) on MultiDigits dataset. To access the representation quality, we then train linear classifiers for images with a single digit of size $2 8 \times 2 8$ on the canvas. Similarly during evaluation, we place only one digit of size $2 8 \times 2 8$ on the canvas.
|
| 89 |
+
|
| 90 |
+
As shown in Table 3, representations learned using supervised loss maintains its quality when up to 8 digits are placed in the image. After that the representation becomes worse as the canvas gets more crowded. Notably, representations learned using SimCLR display a similar phenomenon. Regardless of placement strategy, top-1 accuracy stays at the same level up to 8 digits, demonstrating that SimCLR can learn from images with multiple objects. In addition, the increased performance gap between the two placement strategies with increased number of digits shows that object overlapping makes it harder for contrastive losses to learn from multiple objects.
|
| 91 |
+
|
| 92 |
+
Table 3: Top-1 linear evaluation accuracy $( \% )$ for pretrained ResNet-18 on the MultiDigits dataset. We vary the number of digits placed on the canvas during training from 1 to 16. During evaluation only 1 digit is present. As a baseline, a network with random weights gives $18 \%$ top-1 accuracy.
|
| 93 |
+
|
| 94 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Placing of digits</td><td colspan="6">Number of digits (size 28 × 28)</td></tr><tr><td>1</td><td>2</td><td>4</td><td>8</td><td>12</td><td>16</td></tr><tr><td rowspan="2">Supervised</td><td>Random</td><td>99.5</td><td>99.5</td><td>99.3</td><td>99.4</td><td>98.9</td><td>98.3</td></tr><tr><td>In-grid</td><td>99.5</td><td>99.6</td><td>99.5</td><td>99.3</td><td>98.6</td><td>92.4</td></tr><tr><td rowspan="2">SimCLR</td><td>Random</td><td>98.9</td><td>98.9</td><td>99.0</td><td>98.9</td><td>98.2</td><td>96.4</td></tr><tr><td>In-grid</td><td>98.3</td><td>98.6</td><td>99.1</td><td>99.2</td><td>99.1</td><td>98.3</td></tr></table>
|
| 95 |
+
|
| 96 |
+
# 3.2 SimCLR learns local features that exhibit hierarchical properties
|
| 97 |
+
|
| 98 |
+
To understand the local features learned by SimCLR, we apply K-means on intermediate features of the pretrained ResNet with SimCLR, and see how local regions of an image are grouped together. For good representations, we expect that regions of similar objects or object parts should be grouped together.
|
| 99 |
+
|
| 100 |
+
Specifically, we take a pretrained Resnet- $5 0 2 \times$ on ImageNet, and run inference on images (from ImageNet validation set and COCO [23]) of size $4 4 8 \times 4 4 8$ . We run K-means with various numbers of clusters on the l2-normalized hidden features from middle layers of the network (e.g. block group 2,3,4 of the ResNet). We also compare SimCLR learned features with supervised learned features, as well as the raw pixel (RGB) features extracted from each $1 4 \times 1 4$ patch.
|
| 101 |
+
|
| 102 |
+
Figure 3a shows that as the number of clusters increases, the learned representations tend to group image regions based on parts of the object (i.e. facial components of the dog). This phenomenon appears in both SimCLR and supervised learned features, but not with raw pixel features, indicating meaningful local features learned by SimCLR and supervised learning. In Figure 3b, we compare ResNet intermediate features at different layers, and it suggests that earlier layers contain more edge-related features, while later layers contain more object/part features.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 3: Visualizing features on a ImageNet validation image with K-means clustering. Each row denotes a type of local features used, and each column denotes the number of K-means clusters. Later layers of SimCLR/supervised ResNet tend to group by object parts. More visualization examples can be found in https://contrastive-learning.github.io/intriguing.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 4: Visualizing features on two images from COCO. Each row denotes a type of local features (SimCLR, Supervised, and raw pixels; both SimCLR and Supervised are trained on ImageNet), and each column denotes the number of K-means clusters. Region grouping by SimCLR/supervised features tend to overlap with object class.
|
| 109 |
+
|
| 110 |
+
Region grouping results on two COCO images for SimCLR and supervised learning (trained on ImageNet) are shown in Figure 4. Again, region grouping by local features tend to overlap with object class, indicating good local features learned.
|
| 111 |
+
|
| 112 |
+
# 4 Feature suppression limits the potential of contrastive learning
|
| 113 |
+
|
| 114 |
+
Contrastive learning requires good design of data augmentation to work well. As shown in [13], without color augmentations that randomly shift color distribution (while maintaining information regarding object class), the quality of learned representations are significantly worse. In other words, the presence of “color distribution” features suppresses their competing feature of “object class”, and is addressed by color augmentation. However, there may be scenarios where the known augmentations cannot fully address this feature suppression effect, and it can thus limit the potential of contrastive learning. Here we quantitatively study the feature suppression phenomenon by constructing datasets with explicit and controllable competing features, and see how well contrastive learning method could learn.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
|
| 118 |
+
(a) ImageNet images overlaid with MNIST digits. The left most column is original image, and others are augmented views via random crop and color distortion. MNIST digits and ImageNet classes are competing features. We vary the number of unique MNIST digits to control the competing features.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
|
| 122 |
+
(b) Two MNIST digits randomly placed on a shared canvas (of size $1 1 2 \times 1 1 2 )$ . The two digits can have the same size (upper row) or different sizes (lower row), and digits of different sizes can be considered as competing features. We fix the size of one digit and vary the other.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 5: Probing datasets with explicit and controllable competing features.
|
| 126 |
+
|
| 127 |
+
(c) Images (of RGB channels) are concatenated with additional channels of random integer sampled from range of $[ 1 , \log _ { 2 } ( n ) ]$ . The integer, shared between two views, is replicated for spatial dimension and represented as $n$ binary channels. RGB channels and random bits are competing features.
|
| 128 |
+
|
| 129 |
+
# 4.1 Datasets with explicit and controllable competing features
|
| 130 |
+
|
| 131 |
+
To construct datasets with controllable competing features, we leverage two strategies: channel addition that adds different feature information in a shared canvas, and channel concatenation that expand the RGB channels to include additional features. With these strategies, we construct three datasets below.
|
| 132 |
+
|
| 133 |
+
DigitOnImageNet dataset. We overlay MNIST digits on ImageNet images via channel addition/summation (Figure 5a). For each ImageNet image, we assign a unique MNIST digit and replicate it in nine fixed locations before the standard SimCLR augmentations [13] are applied to create augmented views. Therefore the original ImageNet images and added MNIST digits are competing features. Although it is difficult to quantify information in MNIST digits, we can manually control the number of unique MNIST digits used. Ideally, we want the model to learn both set of features so that it could perform well for both MNIST digit and ImageNet object recognition.
|
| 134 |
+
|
| 135 |
+
MultiDigits dataset (varying the size of one digit). This dataset is modified from MultiDigits introduced above. Here we only consider two digits, and vary the size of one of them (Figure 5b). In this work, we place two digits on a canvas of size $1 1 2 \times 1 1 2$ . We fix the size of one of the digits to be $2 0 \times 2 0$ while varying the other from $2 0 \times 2 0$ to $8 0 \times 8 0$ . Digits of different sizes can be considered as competing features. Ideally, we want the model to learn features for digits of all sizes appeared during training.
|
| 136 |
+
|
| 137 |
+
RandBit dataset. We concatenate a real image with an image of a random integer in the channel dimension (Figure 5c). The random integer is randomly sampled from range of $[ 1 , \log _ { 2 } ( n ) ]$ where $n$ is a parameter to control. It is replicated across spatial dimension (i.e. all pixel location shares the same value), and it is also represented as $n$ binary bits/channels instead of an integer or floating number to make it easily learnable. Furthermore, unlike RGB channels, these additional channels of random bits will not be altered by augmentation, so they are identical for both augmented views of the same image. The RGB channels and the added channels of random bits are competing features, and this construction allows us to control the amount of information in the added competing feature, which is $n$ bits. Also, we know that the mutual information between two views given this construction is at least $\log _ { 2 } ( n )$ .
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
4.2 Easy-to-learn features (MNIST digit) suppress the learning of other features (ImageNet object class)
|
| 141 |
+
Figure 6: (a) Supervised learning accuracy on ImageNet classification. (b) Linear evaluation of learned features for both MNIST classification and ImageNet classification on the DigitOnImageNet dataset. Batch size of 1024 and 2-layer projection head is used. Different batch sizes and projection head layers have negligible influence on the trade-off between ImageNet vs MNIST accuracy.
|
| 142 |
+
|
| 143 |
+
On DigitOnImageNet datasets, we vary the number of unique MNIST digits used in the training set, and all MNIST digits are used in the validation/test set. As a baseline, we train supervised ResNet-50 on the created datasets with ImageNet labels, and the number of unique MNIST digits has little impact on the top-1 ImageNet classification accuracy (Figure 6a).
|
| 144 |
+
|
| 145 |
+
We then train SimCLR on the datasets with different temperatures. As shown in Figure 6b, when we increase the number of unique MNIST digits, the linear evaluation performance of the learned features for MNIST classes increases accordingly, while the accuracy for ImageNet classes decreases dramatically. The trade-off between digit recognition ability and object recognition ability shows that simple features suppress the learning of difficult features, when both are shared between two augmented views. Different batch sizes and projection head depths have negligible influence to the outcome we observe here. Therefore, it is difficult to learn both of the competing features using existing contrastive losses (e.g. SimCLR).
|
| 146 |
+
|
| 147 |
+
# 4.3 The presence of dominant object suppresses the learning of features of smaller objects
|
| 148 |
+
|
| 149 |
+
On the MultiDigits dataset, as mentioned, we fix one digit to be size of $2 0 \times 2 0$ while varying the other from $2 0 \times 2 0$ to $8 0 \times 8 0$ , on a canvas of $1 1 2 \times 1 1 2$ . We first pretrain a ResNet-18 with SimCLR or supervised learning with the same augmentation policy (random cropping and resize) and batch size of 1024. To access the representation quality, we then train linear classifiers for each of the digit sizes that appeared during pretraining. For training of the linear classifier, we only place a single digit at a time on the canvas of the same size as during pretraining.
|
| 150 |
+
|
| 151 |
+
The results are summarized in Table 4. For supervised learning, the learned representations for the smaller digit do not change much as the other digit increases its size, and the model perform well for both small and large digits (accuracy $> 9 9 \%$ ). However, for SimCLR, the learned representations of the smaller digit degenerate significantly when the size of the other digit increases, almost to the level of a random untrained network. The dominant object can be learned very well (accuracy $> 9 9 \%$ ) while suppressing the learning of the smaller object. Although tuning temperature has some effects on reducing the feature suppression, the trend stays unchanged.
|
| 152 |
+
|
| 153 |
+
Table 4: Top-1 linear evaluation accuracy $( \% )$ for pretrained ResNet-18 on the MultiDigits dataset. We fix the size of 1st digit while increasing the size of the 2nd digit. For SimCLR, results are presented for two temperatures. Accuracies suffered from a significant drop when increasing 2nd digit size are red colored.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td></td><td colspan="7">2nd digit size (1st digit is kept the same size of 20 × 20)</td></tr><tr><td></td><td></td><td>20×20</td><td>30×30</td><td>40×40</td><td>50×50</td><td>60×60</td><td>70×70</td><td>80×80</td></tr><tr><td rowspan="2">Supervised</td><td>1st digit</td><td>99.1</td><td>99.2</td><td>99.2</td><td>99.2</td><td>99.1</td><td>99.1</td><td>99.0</td></tr><tr><td>2nd digit</td><td>99.1</td><td>99.5</td><td>99.5</td><td>99.6</td><td>99.5</td><td>99.5</td><td>99.6</td></tr><tr><td rowspan="2">SimCLR (t = 0.05)</td><td>1st digit</td><td>97.8</td><td>97.6</td><td>96.2</td><td>96.5</td><td>88.5</td><td>74.5</td><td>39.9</td></tr><tr><td>2nd digit</td><td>97.8</td><td>97.9</td><td>97.8</td><td>98.3</td><td>98.2</td><td>97.7</td><td>98.2</td></tr><tr><td rowspan="2">SimCLR (T = 0.2)</td><td>1st digit</td><td>98.7</td><td>98.8</td><td>98.3</td><td>87.5</td><td>24.9</td><td>19.8</td><td>20.3</td></tr><tr><td>2nd digit</td><td>98.7</td><td>99.2</td><td>99.2</td><td>99.0</td><td>99.1</td><td>98.9</td><td>99.4</td></tr><tr><td rowspan="2">Random net (untrained)</td><td>1st digit</td><td>16.5</td><td>16.7</td><td>16.6</td><td>16.6</td><td>16.6</td><td>16.9</td><td>16.5</td></tr><tr><td>2nd digit</td><td>16.5</td><td>19.1</td><td>21.9</td><td>24.1</td><td>26.5</td><td>28.1</td><td>29.0</td></tr></table>
|
| 156 |
+
|
| 157 |
+
# 4.4 Extra channels with a few bits of easy-to-learn mutual information suppress the learning of all features in RGB channels
|
| 158 |
+
|
| 159 |
+
In the RandBit datasets, we add additional channels (identical across pixels) of random bits to MNIST and ImageNet. As mentioned above, SimCLR augmentation is only applied to RGB channels so extra added channels will be shared among two view.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 7: Linear evaluation of learned features when a few bits of competing features added (on MNIST). Adding a few bits completely disables contrastive learning (across various batch size or losses). Interestingly, it has little effects on a generative model (VAE). The detrimental effects are just as strong for larger datasets such as CIFAR-10 and ImageNet (Appendix B.1).
|
| 163 |
+
|
| 164 |
+
Figure 7 shows the linear evaluation accuracy of models trained on MNIST (with additional random bits added). We observe that the linear evaluation accuracy quickly drops with a few bits of competing feature added. This detrimental effect on the representation quality persists on bigger datasets like CIFAR-10 and ImageNet as well, and cannot be avoided by using different contrastive losses, batch sizes, or memory mechanism based on momentum contrast (details in Appendix B.1). We believe the fact that just a few bits of easy-to-learn features can completely disable the good representation learning is related to the saturation of the distribution matching loss. As shown in Appendix B.2, the linear increase in bits requires an exponential increase in batch size, which is not sustainable as the required batch size can quickly go beyond the size of the dataset size. In practice, we rely on using data augmentation to remove those uninformative easy-to-learn features so that contrastive learning can learn useful representations. Interestingly, the extra bits do not affect a generative model, variational autoencoder [24, 25], nearly as much, despite other settings such as model size are held the same, prompting a potential direction of addressing the issue.
|
| 165 |
+
|
| 166 |
+
# 5 Related Work
|
| 167 |
+
|
| 168 |
+
Our work studies the contrastive loss based on cross entropy loss [15, 3, 4, 13]. This loss is widely used in recent successful contrastive learning methods [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]. In terms of the contrastive loss, our work is perhaps most related to [16], which shows that formulating contrastive loss as alignment and uniformity in the hypersphere gives similar performance as the standard contrastive loss. We further generalize this factorization, and show other distribution matching losses can be used, and they could achieve similar results. Other than standard contrastive loss that directly utilize negative examples, BYOL [22] demonstrates another way to maintain representation distribution/entropy without directly relying on distribution matching, and SWAV [26] shows clustering-based method equipped with proper data augmentations could also achieve similar performance. We conduct preliminary experiments of BYOL on RandBit and found that it also suffers from feature suppression as generalized contrastive loss. It is expected that SWAV would exhibit similar behaviors on RandBit as those random bits could fuel representations for perfect clustering.
|
| 169 |
+
|
| 170 |
+
The connection between contrastive loss and mutual information has been studied before [3, 20]. We show that for the generalized contrastive loss, it can also be related to mutual information. Despite the connection between contrastive loss and mutual information, it has been pointed out that mutual information estimation may suffer from certain limitations [27, 28]. Moreover, [29, 12] show that higher mutual information learned by the network does not warrant better representation quality. In our work, we find adding mutual information bits between two views which are irrelevant to downstream tasks can be harmful for the quality of learned representations. Data augmentation plays an important role at favoring certain bits of mutual information than others.
|
| 171 |
+
|
| 172 |
+
There is a growing number of recent work on the topic of understanding contrastive learning, both theoretically [30, 31, 32, 33, 34] and empirically [16, 12, 35, 36]. However, little work has been done to study the phenomenon of feature suppression. To our knowledge, we are the first one to quantitatively and systematically study this problem. We believe this is still a very open question and could benefit from more future investigation. Finally, the feature suppression effect in unsupervised contrastive learning that we study in this work may also exist in standard supervised learning (“contrastive loss” between examples and class labels), as suggested by [37, 38], though the specific form would be different.
|
| 173 |
+
|
| 174 |
+
# 6 Conclusion
|
| 175 |
+
|
| 176 |
+
In this work, we study three intriguing properties of contrastive losses. In particular, our results highlight that feature suppression is still an open challenge in contrastive learning. While there is a plethora of work on improving contrastive learning, few of them directly aim to address feature suppression. This limitation of contrastive learning becomes a bottleneck for scenarios where existing augmentation cannot fully address the feature suppression phenomenon, and learning would saturate at a level of dissatisfaction.
|
| 177 |
+
|
| 178 |
+
We would also like to point out some limitations of our study. Firstly, we focus mostly on contrastive learning with explicit negatives (e.g. SimCLR and MoCo). We believe other methods based on clustering and/or without negative pairs would exhibit similar phenomenon but we leave that as future work. Secondly, many of our proposed image datasets are not fully realistic despite being composed from some (challenging) natural image datasets such as ImageNet. We admit it is very hard to explore competing features or multiple objects in a controllable fashion on realistic large scale image datasets.
|
| 179 |
+
|
| 180 |
+
# Acknowledgements
|
| 181 |
+
|
| 182 |
+
We specially thank Geoffrey Hinton for many inspiring discussions and helpful advice. We would also like to thank David Fleet, Simon Kornblith, Mohammad Norouzi, Kevin Swersky and Katherine Hermann for insightful discussions. In addition, we are thankful to William Chan and Sara Sabour for ideas on implementation of sorting on TPUs. We also thank the anonymous reviewers for their constructive feedback.
|
| 183 |
+
|
| 184 |
+
References
|
| 185 |
+
[1] Suzanna Becker and Geoffrey E Hinton. Self-organizing neural network that discovers surfaces in randomdot stereograms. Nature, 355(6356):161–163, 1992.
|
| 186 |
+
[2] Alexey Dosovitskiy, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with convolutional neural networks. In Advances in neural information processing systems, pages 766–774, 2014.
|
| 187 |
+
[3] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 188 |
+
[4] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3733–3742, 2018.
|
| 189 |
+
[5] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 190 |
+
[6] Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In Advances in Neural Information Processing Systems, pages 15509–15519, 2019.
|
| 191 |
+
[7] Olivier J Hénaff, Ali Razavi, Carl Doersch, SM Eslami, and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019.
|
| 192 |
+
[8] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 193 |
+
[9] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. arXiv preprint arXiv:1912.01991, 2019.
|
| 194 |
+
[10] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
|
| 195 |
+
[11] Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven CH Hoi. Prototypical contrastive learning of unsupervised representations. arXiv preprint arXiv:2005.04966, 2020.
|
| 196 |
+
[12] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020.
|
| 197 |
+
[13] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 198 |
+
[14] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020.
|
| 199 |
+
[15] Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In Advances in neural information processing systems, pages 1857–1865, 2016.
|
| 200 |
+
[16] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020.
|
| 201 |
+
[17] 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, pages 435–446. Springer, 2011.
|
| 202 |
+
[18] 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.
|
| 203 |
+
[19] Soheil Kolouri, Kimia Nadjahi, Umut Simsekli, Roland Badeau, and Gustavo Rohde. Generalized sliced wasserstein distances. In Advances in Neural Information Processing Systems, pages 261–272, 2019.
|
| 204 |
+
[20] Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A Alemi, and George Tucker. On variational bounds of mutual information. arXiv preprint arXiv:1905.06922, 2019.
|
| 205 |
+
[21] Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017.
|
| 206 |
+
[22] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to selfsupervised learning, 2020.
|
| 207 |
+
[23] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014.
|
| 208 |
+
[24] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 209 |
+
[25] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 210 |
+
[26] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
|
| 211 |
+
[27] David McAllester and Karl Stratos. Formal limitations on the measurement of mutual information. In International Conference on Artificial Intelligence and Statistics, pages 875–884, 2020.
|
| 212 |
+
[28] Jiaming Song and Stefano Ermon. Understanding the limitations of variational mutual information estimators. arXiv preprint arXiv:1910.06222, 2019.
|
| 213 |
+
[29] Michael Tschannen, Josip Djolonga, Paul K Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019.
|
| 214 |
+
[30] Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. arXiv preprint arXiv:1902.09229, 2019.
|
| 215 |
+
[31] Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Demystifying self-supervised learning: An information-theoretical framework. arXiv preprint arXiv:2006.05576, 2020.
|
| 216 |
+
[32] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. arXiv preprint arXiv:2008.10150, 2020.
|
| 217 |
+
[33] Yuandong Tian, Lantao Yu, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020.
|
| 218 |
+
[34] Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. arXiv preprint arXiv:2008.01064, 2020.
|
| 219 |
+
[35] Nanxuan Zhao, Zhirong Wu, Rynson WH Lau, and Stephen Lin. What makes instance discrimination good for transfer learning? arXiv preprint arXiv:2006.06606, 2020.
|
| 220 |
+
[36] Senthil Purushwalkam and Abhinav Gupta. Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases. arXiv preprint arXiv:2007.13916, 2020.
|
| 221 |
+
[37] Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? exploring datasets, architectures, and training. arXiv preprint arXiv:2006.12433, 2020.
|
| 222 |
+
[38] Harshay Shah, Kaustav Tamuly, Aditi Raghunathan, Prateek Jain, and Praneeth Netrapalli. The pitfalls of simplicity bias in neural networks. arXiv preprint arXiv:2006.07710, 2020.
|
| 223 |
+
[39] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
md/train/rkgdYhVtvH/rkgdYhVtvH.md
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNIFYING GRAPH CONVOLUTIONAL NEURAL NETWORKS AND LABEL PROPAGATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Label Propagation (LPA) and Graph Convolutional Neural Networks (GCN) are both message passing algorithms on graphs. Both solve the task of node classification but LPA propagates node label information across the edges of the graph, while GCN propagates and transforms node feature information. However, while conceptually similar, theoretical relation between LPA and GCN has not yet been investigated. Here we study the relationship between LPA and GCN in terms of two aspects: (1) feature/label smoothing where we analyze how the feature/label of one node is spread over its neighbors; And, (2) feature/label influence of how much the initial feature/label of one node influences the final feature/label of another node. Based on our theoretical analysis, we propose an end-to-end model that unifies GCN and LPA for node classification. In our unified model, edge weights are learnable, and the LPA serves as regularization to assist the GCN in learning proper edge weights that lead to improved classification performance. Our model can also be seen as learning attention weights based on node labels, which is more task-oriented than existing feature-based attention models. In a number of experiments on real-world graphs, our model shows superiority over state-of-the-art GCN-based methods in terms of node classification accuracy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Consider the problem of node classification in a graph, where the goal is to learn a mapping $\mathcal { M }$ : $\nu \to \mathcal L$ from nodes $\nu$ to labels $\mathcal { L }$ . Solution to this problem is widely applicable to various scenarios, e.g., inferring income of users in a social network or classifying scientific articles in a citation network. Different from a generic machine learning problem where samples are independent from each other, nodes are connected by edges in the graph, which provide additional information and require more delicate modeling. To capture the graph information, researchers have mainly designed models on the assumption that labels and features vary smoothly over the edges of the graph. In particular, on the label side $\mathcal { L }$ , node labels are propagated and aggregated along edges in the graph, which is known as Label Propagation Algorithm (LPA) (Zhu et al., 2005; Zhou et al., 2004; Zhang & Lee, 2007; Wang & Zhang, 2008; Karasuyama & Mamitsuka, 2013; Gong et al., 2017; Liu et al., 2019a); On the node side $\nu$ , node features are propagated along edges and transformed through neural network layers, which is known as Graph Convolutional Neural Networks (GCN) (Kipf & Welling, 2017; Hamilton et al., 2017; Li et al., 2018; Xu et al., 2018; Liao et al., 2019; Xu et al., 2019; Qu et al., 2019).
|
| 12 |
+
|
| 13 |
+
GCN and LPA are related in that they propagate features and labels on the two sides of the mapping $\mathcal { M }$ , respectively. However, the relationship between GCN and LPA has not yet been investigated. Specifically, what is the theoretical relationship between GCN and LPA, and how can they be combined to develop a more accurate model for node classification in graphs?
|
| 14 |
+
|
| 15 |
+
Here we study the theoretical relationship between GCN and LPA from two viewpoints: (1) Feature/label smoothing, where we show that the intuition behind GCN/LPA is smoothing features/labels of nodes across the edges of the graph, i.e., one node’s feature/label equals the weighted average of features/labels of its neighbors. We prove that if edge weights smooth the node features, they also smooth the node labels with guaranteed upper bound on the approximation error. And, (2) feature/label influence, where we quantify how much the initial feature/label of node $v _ { b }$ influences the output feature/label of node $v _ { a }$ in GCN/LPA by studying the Jacobian/gradient of node $v _ { b }$ with respect to node $v _ { a }$ , and then we also prove their quantitative relationship.
|
| 16 |
+
|
| 17 |
+
Based on the above theoretical analysis, we propose a unified model GCN-LPA for node classification. We show that the key to improving the performance of GCN is to enable nodes within the same class/label to connect more strongly with each other by making edge weights/strengths trainable. Then we prove that increasing the strength of edges between the nodes of the same class is equivalent to increasing the accuracy of LPA’s predictions. Therefore, we can first learn the optimal edge weights by minimizing the loss of predictions in LPA, then plug the optimal edge weights into a GCN to learn node representations and do final classification. In GCN-LPA, we further combine the two steps together and train the whole model in an end-to-end fashion, where the LPA part serves as regularization to assist the GCN part in learning proper edge weights that benefit the separation of different classes. It is worth noticing that GCN-LPA can also be seen as learning attention weights for edges based on node label information, which requires less handcrafting and is more task-oriented than existing work that learns attention weights based on node feature similarity (Velickoviˇ c et al.´ , 2018; Thekumparampil et al., 2018; Zhang et al., 2018; Liu et al., 2019b). Experiments on five datasets indicate that our model outperforms state-of-the-art methods in terms of classification accuracy.
|
| 18 |
+
|
| 19 |
+
# 2 UNIFYING GCN AND LPA
|
| 20 |
+
|
| 21 |
+
In this section, we first formulate the node classification problem and briefly introduce LPA and GCN. We then prove their relationship from the viewpoints of smoothing and influence. Based on our theoretical analysis, we then propose a unified model GCN-LPA, and we also analyze the reason why our model performs better than GCN in node classification.
|
| 22 |
+
|
| 23 |
+
# 2.1 PROBLEM FORMULATION AND PRELIMINARIES
|
| 24 |
+
|
| 25 |
+
We begin by describing the problem of node classification on graphs and introducing notation. Consider a graph $\mathcal { G } = ( \nu , A , X , Y )$ , where $\mathcal { V } = \{ v _ { 1 } , \cdots , v _ { n } \}$ is the set of nodes, $\bar { A ^ { \prime } } \in \mathbb { R } ^ { n \times n }$ is the adjacency matrix (self-loops are included), $\cdot$ is the feature matrix of nodes and $\cdot$ is labels of nodes. $\cdot$ (the $i j$ -th entry of $A$ ) is the weight of the edge connecting $\cdot$ and $v _ { j }$ . $\mathcal { N } ( v )$ denotes the set of immediate neighbors of node $\cdot$ in graph $\cdot$ . Each node $v _ { i }$ has a feature vector $\mathbf { x } _ { i }$ which is the $\cdot$ -th row of $\cdot$ , while only the first $m$ nodes have labels $y _ { 1 } , \cdots , y _ { m }$ from a label set $\mathcal { L } = \{ 1 , \cdots , c \}$ . The goal is to learn a mapping $\mathcal { M } : \mathcal { V } \to \mathcal { L }$ and predict labels of unlabeled nodes.
|
| 26 |
+
|
| 27 |
+
Label Propagation Algorithm. LPA assumes that two connected nodes are likely to have the same label, and thus it propagates labels iteratively along the edges. Let $Y ^ { ( k ) } = [ y _ { 1 } ^ { ( k ) } , \cdot \cdot \cdot , y _ { n } ^ { ( k ) } ] ^ { \top } \in \mathbb { R } ^ { n \times c }$ be the soft label matrix in iteration $\cdot$ , in which the $i$ -th row $y _ { i } ^ { ( k ) \top }$ denotes the predicted label distribution for node $v _ { i }$ in iteration $\cdot$ . When $\cdot$ , the initial label matrix $Y ^ { ( 0 ) } = [ y _ { 1 } ^ { ( 0 ) } , \cdot \cdot \cdot , y _ { n } ^ { ( 0 ) } ] ^ { \top }$ consists of one-hot label indicator vectors $\cdot$ for $i = 1 , \cdots , m$ (i.e., labeled nodes) or zero vectors otherwise (i.e., unlabeled nodes). Let $D$ be the diagonal degree matrix for $A$ with entries $d _ { i i } =$ $\textstyle \sum _ { j } a _ { i j }$ . Then LPA (Zhu et al., 2005) in iteration $k$ is formulated as the following two steps:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\cdot
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
In Eq. (1), all nodes propagate their labels to their neighbors according to weights of edges. Then in Eq. (2), labels of all labeled nodes are reset to their initial values, because LPA wants to persist labels of nodes which are labeled so that unlabeled nodes do not overpower the labeled ones as the initial labels would otherwise fade away.
|
| 34 |
+
|
| 35 |
+
Graph Convolutional Neural Network. GCN is a multi-layer feedforward neural network that propagates and transforms node features across the graph. The layer-wise propagation rule of GCN is $\bar { X } ^ { ( \bar { k } + 1 ) } = \sigma ( D ^ { - \frac { 1 } { 2 } } A D ^ { - \frac { 1 } { 2 } } X ^ { ( k ) } W ^ { ( k ) } )$ , where $W ^ { ( k ) }$ is trainable weight matrix in the $k$ -th layer, $\sigma ( \cdot )$ is an activation function such as ReLU, and $X ^ { ( k ) } = [ \mathbf { x } _ { 1 } ^ { ( k ) } , \cdot \cdot \cdot , \mathbf { x } _ { n } ^ { ( k ) } ] ^ { \intercal }$ are the $k$ -th layer node representations with $X ^ { ( 0 ) } = X$ . To align with the above LPA, we use $D ^ { - 1 } A$ as the normalized adjacency matrix instead of the symmetric one $D ^ { - { \frac { 1 } { 2 } } } A D ^ { - { \frac { 1 } { 2 } } }$ proposed by Kipf & Welling (2017).
|
| 36 |
+
|
| 37 |
+
Therefore, the feature propagation scheme of GCN in layer $k$ is:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
X ^ { ( k + 1 ) } = \sigma ( D ^ { - 1 } A X ^ { ( k ) } W ^ { ( k ) } ) .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Notice similarity between Eqs. (1) and (3). Next we shall study and uncover the relationship between the two equations.
|
| 44 |
+
|
| 45 |
+
# 2.2 FEATURE SMOOTHING AND LABEL SMOOTHING
|
| 46 |
+
|
| 47 |
+
The intuition behind both LPA and GCN is smoothing (Zhu et al., 2003; Li et al., 2018): In LPA, the final label of a node is the weighted average of labels of its neighbors: $\begin{array} { r } { y _ { i } ^ { ( \infty ) } = \frac { 1 } { d _ { i i } } \sum _ { j \in \mathcal { N } ( i ) } a _ { i j } y _ { j } ^ { ( \infty ) } } \end{array}$ ; in GCN, the final node representation is also the weighted average of representations of its neighbors if we assume $\sigma$ is identity function and $W ^ { ( \cdot ) }$ are identity matrices: $\begin{array} { r } { \mathbf { x } _ { i } ^ { \left( \infty \right) } = \frac { 1 } { d _ { i i } } \sum _ { j \in \mathcal { N } ( i ) } \bar { a _ { i j } } \mathbf { x } _ { j } ^ { \left( \infty \right) } } \end{array}$ . Next we show the relationship between feature smoothing and label smoothing:
|
| 48 |
+
|
| 49 |
+
Theorem 1 (Relationship between feature smoothing and label smoothing) Suppose that the latent ground-truth mapping $\mathcal { M } : \textbf { x } \to \ \boldsymbol { y }$ from node features to node labels is differentiable and satisfies $L$ -Lipschitz constraint, i.e., $| \dot { \mathcal { M } } ( \mathbf { x } _ { 1 } ) - \mathcal { M } ( \mathbf { x } _ { 2 } ) | \leq L \| \mathbf { x } _ { 1 } - \mathbf { x } _ { 2 } \| _ { 2 }$ for any $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ $L$ is a constant). If the edge weights $\{ a _ { i j } \}$ approximately smooth $\mathbf { x } _ { i }$ over its immediate neighbors with error $\epsilon _ { i }$ , i.e., $\begin{array} { r } { \mathbf { x } _ { i } \ = \ \frac { 1 } { d _ { i i } } \sum _ { j \in \mathcal { N } ( i ) } a _ { i j } \mathbf { x } _ { j } \ + \ \epsilon _ { i } } \end{array}$ , then the edge weights $\{ a _ { i j } \}$ also approximately smooth $y _ { i }$ over its immediate neighbors with the following approximation error: $\begin{array} { r } { \left| \overline { { y _ { i } } } - \frac { 1 } { d _ { i i } } \sum _ { j \in N ( i ) } a _ { i j } y _ { j } \right| \leq L \| \epsilon _ { i } \| _ { 2 } + o \big ( \operatorname* { m a x } _ { j \in \mathcal { N } ( i ) } ( \| \mathbf { x } _ { j } - \mathbf { x } _ { i } \| _ { 2 } ) \big ) } \end{array}$ , where $o ( \alpha )$ denotes a higher order infinitesimal than $\alpha$ .
|
| 50 |
+
|
| 51 |
+
Proof of Theorem 1 is in Appendix A. Theorem 1 indicates that label smoothing is theoretically guaranteed by feature smoothing. Note that if we treat edge weights $\{ a _ { i j } \}$ learnable, then feature smoothing (i.e., $\epsilon _ { i } \to 0$ ) can be directly achieved by keeping node features $\mathbf { x } _ { i }$ fixed while setting $\{ a _ { i j } \}$ appropriately, without resorting to feature propagation in a multi-layer GCN. Therefore, a simple approach to exploit this theorem would be to learn $\{ a _ { i j } \}$ by reconstructing node feature $\mathbf { x } _ { i }$ from its neighbors, then use the learned $\{ a _ { i j } \}$ to reconstruct node labels $y _ { i }$ (Karasuyama & Mamitsuka, 2013). This is equivalent to first minimizing the difference between $X ^ { ( 0 ) }$ and $X ^ { ( 1 ) }$ by learning $D ^ { - 1 } A$ in a one-layer GCN where $\sigma$ and $W ^ { ( 0 ) }$ are identity, then plug the learned $D ^ { - 1 } A$ in LPA and run it for one iteration.
|
| 52 |
+
|
| 53 |
+
As shown in Theorem 1, the approximation error of labels is dominated by $L \| \epsilon _ { i } \| _ { 2 }$ . However, this error could be fairly large in practice because: (1) The number of immediate neighbors for a given node may be too small to reconstruct its features perfectly, especially in the case where node features are high-dimensional and sparse. For example, in a citation network where node features are one-hot bag-of-words vectors, the feature of one article can never be precisely reconstructed if none of its neighboring articles contains the specific word that appears in this article. As a result, $\lVert \epsilon _ { i } \rVert _ { 2 }$ will be non-neglibible. This explains why it is beneficial to apply LPA and GCN for multiple iterations/layers in order to include information from farther away neighbors. (2) The ground-truth mapping $\mathcal { M }$ may not be sufficiently smooth due to the complex structure of latent manifold and possible noise, which fails to satisfy $L$ -Lipschitz constraint. In other words, the constant $L$ will be extremely large.
|
| 54 |
+
|
| 55 |
+
# 2.3 FEATURE INFLUENCE AND LABEL INFLUENCE
|
| 56 |
+
|
| 57 |
+
To address the above concerns and extend our analysis, we next consider GCN and LPA with multiple layers/iterations, and do not impose any constraint on the ground-truth mapping $\mathcal { M }$ .
|
| 58 |
+
|
| 59 |
+
Consider two nodes $v _ { a }$ and $v _ { b }$ in a graph. Inspired by Koh & Liang (2017) and $\mathrm { X u }$ et al. (2018), we study the relationship between GCN and LPA in terms of influence, i.e., how the output feature/label of $v _ { a }$ will change if the initial feature/label of $v _ { b }$ is varied slightly. Technically, the feature/label influence is measured by the Jacobian/gradient of the output feature/label of $v _ { a }$ with respect to the initial feature/label of $v _ { b }$ . Denote $\mathbf { x } _ { a } ^ { ( k ) }$ as the $k$ -th layer representation vector of $v _ { a }$ in GCN, and $\mathbf { x } _ { b }$ as the initial feature vector of $v _ { b }$ . We quantify the feature influence of $v _ { b }$ on $v _ { a }$ as follows:
|
| 60 |
+
|
| 61 |
+
Definition 1 (Feature influence) The feature influence of node $v _ { b }$ on node $v _ { a }$ after $k$ layers of GCN is the $L l$ -norm of the expected Jacobian matrix $\partial \mathbf { x } _ { a } ^ { ( k ) } / \partial \mathbf { x } _ { b }$ : $I _ { f } ( v _ { a } , v _ { b } ; k ) = \left. \mathbb { E } \big [ \partial \mathbf { x } _ { a } ^ { ( k ) } / \partial \mathbf { x } _ { b } \big ] \right. _ { 1 }$ . The normalized feature influence is then defined as $\begin{array} { r } { \tilde { I } _ { f } ( v _ { a } , v _ { b } ; k ) = I _ { f } ( v _ { a } , v _ { b } ; k ) / \sum _ { v _ { i } \in \mathcal { V } } I _ { f } ( v _ { a } , v _ { i } ; k ) } \end{array}$ .
|
| 62 |
+
|
| 63 |
+
We also consider the label influence of node $v _ { b }$ on node $v _ { a }$ in LPA (this implies that $v _ { a }$ is unlabeled and $v _ { b }$ is labeled). Since different label dimensions of $y _ { i } ^ { ( \cdot ) }$ do not interact with each other in LPA, we assume that all $y _ { i }$ and $y _ { i } ^ { ( \cdot ) }$ are scalars within $[ 0 , 1 ]$ (i.e., a binary classification) for simplicity. Label influence is defined as follows:
|
| 64 |
+
|
| 65 |
+
Definition 2 (Label influence) The label influence of labeled node $v _ { b }$ on unlabeled node $v _ { a }$ after $k$ iterations of LPA is the gradient of $y _ { a } ^ { ( k ) }$ with respect to $y _ { b } \colon I _ { l } ( v _ { a } , v _ { b } ; k ) = \partial y _ { a } ^ { ( k ) } / \partial y _ { b }$ .
|
| 66 |
+
|
| 67 |
+
The following theorem shows the relationship between feature influence and label influence:
|
| 68 |
+
|
| 69 |
+
Theorem 2 (Relationship between feature influence and label influence) Assume the activation function used in GCN is ReLU. Denote $v _ { a }$ as an unlabeled node, $v _ { b }$ as a labeled node, and $\beta$ as the fraction of unlabeled nodes. Then the label influence of $v _ { b }$ on $v _ { a }$ after $k$ iterations of LPA equals, in expectation, to the cumulative normalized feature influence of $v _ { b }$ on $v _ { a }$ after $k$ layers of GCN:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathbb { E } \big [ I _ { l } ( v _ { a } , v _ { b } ; k ) \big ] = \sum _ { j = 1 } ^ { k } \beta ^ { j } \tilde { I } _ { f } ( v _ { a } , v _ { b } ; j ) .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Proof of Theorem 2 is in Appendix B. Intuitively, Theorem 2 shows that if $v _ { b }$ has high label influence on $v _ { a }$ , then the initial feature vector of $v _ { b }$ will also affect the output feature vector of $v _ { a }$ to a large extent. Theorem 2 provides the theoretical guideline for designing our unified model in the next subsection.
|
| 76 |
+
|
| 77 |
+
# 2.4 THE UNIFIED MODEL
|
| 78 |
+
|
| 79 |
+
Before introducing the proposed model, we first rethink the GCN method and see what an ideal node representation should be like. Since we aim to classify nodes, the perfect node representation would be such that nodes with the same label are embedded close together, which would give a large separation between different classes. Intuitively, the key to achieve this goal is to enable nodes within the same class to connect more strongly with each other, so that they are pushed together by the GCN. We can therefore make edge strengths/weights trainable, then learn to increase the intra-class feature influence for each class $i$ : $\begin{array} { r } { \sum _ { v _ { a } , v _ { b } : y _ { a } = i , y _ { b } = i } \tilde { I } _ { f } ( v _ { a } , v _ { b } ) } \end{array}$ by adjusting edge weights. However, this requires operating on Jacobian matrices with the size of $d ^ { ( 0 ) } \times d ^ { ( K ) }$ $\mathbf { \boldsymbol { d } } ^ { ( 0 ) }$ and $d ^ { ( K ) }$ are the dimensions of initial and output features, respectively), which is impractical if initial node features are high-dimensional. Fortunately, we can turn to optimizing the intra-class label influence instead, i.e., $\begin{array} { r } { \sum _ { v _ { a } , v _ { b } : y _ { a } = i , y _ { b } = i } I _ { l } ( v _ { a } , v _ { b } ) } \end{array}$ , according to Theorem 2. We further show that, by the following theorem, the intra-class label influence for a given node $v _ { a }$ is proportional to the probability that $v _ { a }$ is classified correctly by LPA:
|
| 80 |
+
|
| 81 |
+
Theorem 3 (Relationship between label influence and LPA’s prediction) Consider a given node $v _ { a }$ and its label $y _ { a }$ . If we treat node $v _ { a }$ as unlabeled, then the total label influence of nodes with label $y _ { a }$ on node $v _ { a }$ is proportional to the probability that node $v _ { a }$ is classified as $y _ { a }$ by $L P A$ :
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\sum _ { v _ { b } : y _ { b } = y _ { a } } I _ { l } ( v _ { a } , v _ { b } ; k ) \propto \mathrm { P r } \big ( \hat { y } _ { a } ^ { l p a } = y _ { a } \big ) ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\hat { y } _ { a } ^ { l p a }$ is the predicted label of $v _ { a }$ using a $k$ -iteration LPA.
|
| 88 |
+
|
| 89 |
+
Proof of Theorem 3 is in Appendix C. Theorem 3 indicates that, if edge weights $\{ a _ { i j } \}$ maximize the probability that $v _ { a }$ is correctly classified by LPA, then they also maximize the intra-class label influence for node $v _ { a }$ . We can therefore first learn the optimal edge weights $A ^ { * }$ by minimizing the
|
| 90 |
+
|
| 91 |
+
loss of predicted labels by LPA:1
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
A ^ { * } = \underset { A } { \arg \operatorname* { m i n } } L _ { l p a } ( A ) = \underset { A } { \arg \operatorname* { m i n } } \ \frac { 1 } { m } \sum _ { v _ { a } : a \leq m } J ( \hat { y } _ { a } ^ { l p a } , y _ { a } ) ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $J$ is the cross-entropy loss, $\cdot$ and $\cdot$ are the predicted label distribution of $\cdot$ using LPA and the true one-hot label of $\cdot$ , respectively.2 $a \leq m$ means $v _ { a }$ is labeled. The optimal $A ^ { * }$ maximize the probability that each node is correctly labeled by LPA, thus also increasing the intra-class label influence (by Theorem 3) and intra-class feature influence (by Theorem 2). Then we can apply $A ^ { * }$ and the corresponding $D ^ { * }$ to a GCN to predict labels and learn optimal transformation matrices:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { c } { { X ^ { ( k + 1 ) } = \sigma ( D ^ { * ^ { - 1 } } A ^ { * } X ^ { ( k ) } W ^ { ( k ) } ) , \quad k = 0 , 1 , \cdots , K - 1 , } } \\ { { W ^ { * } = \underset { W } { \arg \operatorname* { m i n } } \ : L _ { g c n } ( W , A ^ { * } ) = \underset { W } { \arg \operatorname* { m i n } } } } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\hat { y } _ { a } ^ { g c n }$ (which is the $\cdot$ -th row of $X ^ { ( K ) }$ ) is the predicted label distribution of $v _ { a }$ using the GCN specified in Eq. (7).
|
| 104 |
+
|
| 105 |
+
In practice, it is generally better to combine the above two steps together and train the whole model in an end-to-end fashion:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
W ^ { * } , A ^ { * } = \underset { W , A } { \arg \operatorname* { m i n } } \ L _ { g c n } ( W , A ) + \lambda L _ { l p a } ( A ) ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\lambda$ is the balancing hyper-parameter. In this way, $L _ { l p a } ( A )$ serves as a regularization term that assists the learning of edge weights $A$ , since it is hard for the GCN to learn both $W$ and $A$ simultaneously due to overfitting. The proposed GCN-LPA approach can also be seen as learning the importance of edges that can be used to reconstruct node labels accurately by LPA, then transferring this knowledge from label space to feature space for the GCN. From this perspective, GCN-LPA also connects to Theorem 1 except that the knowledge transfer is in the other direction.
|
| 112 |
+
|
| 113 |
+
It is also worth noticing how the optimal $A ^ { * }$ is configured. The principle here is that we do not modify the basic structure of the original graph (i.e., not adding or removing edges) but only adjusting weights of existing edges. This is equivalent to learning a positive mask matrix $M$ for the adjacency matrix $A$ and taking the Hadamard product $M \circ A = A ^ { * }$ . Each element $M _ { i j }$ can be set as either a free variable or a function of the nodes at edge endpoints, for example, $M _ { i j } \stackrel { } { = } \log ( \exp ( \mathbf { x } _ { i } ^ { \top } \mathbf { H } \mathbf { x } _ { j } ) + 1 )$ where $\mathbf { H }$ is a learnable kernel matrix for measuring feature similarity.
|
| 114 |
+
|
| 115 |
+
# 2.5 ANALYSIS OF GCN-LPA MODEL BEHAVIOR
|
| 116 |
+
|
| 117 |
+
In this subsection, we show benefits of our unified model compared with GCN by analyzing propermodels, where he follo yze the update rule of GCN for nois the normalized weight of edge s: (1) In aggregation step, we cal $v _ { i }$ :.e $\begin{array} { r } { \mathbf { x } _ { i } ^ { ( k + 1 ) } = \sigma \big ( \sum _ { v _ { j } \in \mathcal { N } ( v _ { i } ) } \tilde { a } _ { i j } \mathbf { x } _ { j } ^ { ( k ) } W ^ { ( k ) } \big ) } \end{array}$ $\widetilde { a } _ { i j } = a _ { i j } / d _ { i i }$ $( j , i )$ the aggregated representation ${ \bf h } _ { i } ^ { ( k ) }$ of all neighborhoods $\begin{array} { r } { \bar { \mathcal { N } } ( v _ { i } ) { : } { \mathbf { h } _ { i } ^ { ( k ) } } = \sum _ { v _ { j } \in \mathcal { N } ( v _ { i } ) } \bar { \dot { a } } _ { i j } { \mathbf { x } _ { j } ^ { ( k ) } } } \end{array}$ ; (2) In transformation step, the aggregated representation $\mathbf { h } _ { i } ^ { ( k ) }$ is mapped to a new space by a transformation matrix and nonlinear function: $\mathbf { x } _ { i } ^ { ( k + 1 ) } = \sigma \big ( \mathbf { h } _ { i } ^ { ( \bar { k } ) } W ^ { ( k ) } \big )$ . We show by the following theorem that the aggregation step reduces the overall distance in the embedding space between the nodes that are connected in the graph:
|
| 118 |
+
|
| 119 |
+
Theorem 4 (Shrinking property in GCN) Let $\begin{array} { r } { D ( \mathbf { x } ) = \frac { 1 } { 2 } \sum _ { v _ { i } , v _ { j } } \widetilde { a } _ { i j } \| \mathbf { x } _ { i } - \mathbf { x } _ { j } \| _ { 2 } ^ { 2 } b e _ { } } \end{array}$ a distance metric between the embeddings x of nodes. Then we have $D ( \mathbf { h } ^ { ( k ) } ) \leq D ( \mathbf { x } ^ { ( k ) } )$ .
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 1: Node embeddings of Zachary’s karate club network trained on a node classification task (red vs. blue). Node coordinates in (b)-(e) are the embedding coordinates. Notice that GCN does not produce linearly separable embeddings ((b) vs. (c)), while GCN-LPA performs much better even in the presence of noisy edges ((d) vs. (e)). Additional visualizations are included in Appendix E.
|
| 123 |
+
|
| 124 |
+
Proof of Theorem 4 is in Appendix D. Theorem 4 indicates that the overall distance among connected nodes is reduced after taking one aggregation step, which implies that connected components in the graph “shrink” and nodes within each connected component get closer to each other in the embedding space. In an ideal case where edges only connect nodes with the same label, the aggregation step will push nodes within the same class together, which greatly benefits the transformation step that acts like a hyperplane $W ^ { ( k ) }$ for classification. However, two connected nodes may have different labels. These “noisy” edges will impede the formation of clusters and make the inter-class boundary less clear.
|
| 125 |
+
|
| 126 |
+
Fortunately, in GCN-LPA, edge weights are learned by minimizing the difference between groundtruth labels and labels reconstructed from multi-hop neighbors. This will force the model to increase weight/bandwidth of possible paths that connect nodes with the same label, so that labels can “flow” easily along these paths for the purpose of label reconstruction. In this way, GCN-LPA is able to identify potential intra-class edges and increase their weights to assist learning clustering structures.
|
| 127 |
+
|
| 128 |
+
To illustrate this, we apply a two-layer untrained GCN with randomly initialized transformation matrices to the well-known Zachary’s karate club network (Zachary, 1977) as shown in Figure 1a, which contains 34 nodes of 2 classes and 78 unweighted edges (grey solid lines). We then increase the weights of intra-class edges by ten times to simulate GCN-LPA. We find that GCN works well on this network (Figure 1b), but GCN-LPA performs even better than GCN because the node embeddings are completely linearly separable as shown in Figure 1c. To further justify our claim, we randomly add 20 “noisy” inter-class edges (grey dotted lines) to the original network, from which we observe that GCN is misled by noise and mixes nodes of two classes together (Figure 1d), but GCNLPA still distinguishes the two clusters (Figure 1e) because it is better at “denoising” undesirable edges based on the supervised signal of labels.
|
| 129 |
+
|
| 130 |
+
# 3 CONNECTION TO EXISTING WORK
|
| 131 |
+
|
| 132 |
+
Edge weights play a key role in graph-based node classification as well as representation learning.
|
| 133 |
+
In this section, we discuss three lines of related work that learn edge weights adaptively.
|
| 134 |
+
|
| 135 |
+
Locally linear embedding (LLE) (Roweis & Saul, 2000) and its variants (Zhang & Wang, 2007; Kong et al., 2012) learn edge weights by constructing a linear dependency between a node and its neighbors, then use the learned edge weights to embed high-dimensional nodes into a lowdimensional space. Our work is similar to LLE in the aspect of transferring the knowledge of edge importance from one space to another, but the difference is that LLE is an unsupervised dimension reduction method that learns the graph structure based on local proximity only, while our work is semi-supervised and explores high-order relationship among nodes.
|
| 136 |
+
|
| 137 |
+
Classical LPA (Zhu et al., 2005; Zhou et al., 2004) can only make use of node labels rather than node features. In contrast, adaptive LPA considers node features by making edge weights learnable. Typical techniques of learning edge weights include adopting kernel functions (Zhu et al., 2003; Liu et al., 2019a) (e.g., $a _ { i j } = \bar { \mathrm { e x p } ( - \sum _ { d } ( x _ { i d } - x _ { j d } ) ^ { 2 } / \sigma _ { d } ^ { 2 } ) }$ where $d$ is dimensionality of features), minimizing neighborhood reconstruction error (Wang & Zhang, 2008; Karasuyama & Mamitsuka, 2013), using leave-one-out loss (Zhang $\&$ Lee, 2007), or imposing sparseness on edge weights (Hong et al., 2009). However, in these LPA variants, node features are only used to assist learning the graph structure rather than explicitly mapped to node labels, which limits their capability in node classification. Another notable difference is that adaptive LPA learns edge weights by introducing the regularizations above, while our work takes LPA itself as regularization to learn edge weights.
|
| 138 |
+
|
| 139 |
+
Our method is also conceptually connected to attention mechanisms on graphs (Velickovi ˇ c et al. ´ , 2018; Thekumparampil et al., 2018; Zhang et al., 2018; Liu et al., 2019b), in which an attention weight $\alpha _ { i j }$ is learned between node $v _ { i }$ and $v _ { j }$ . For example, $\alpha _ { i j } = \mathrm { L e a k y R e L U } ( a ^ { \top } [ W \mathbf { x } _ { i } | | W \mathbf { x } _ { j } ] )$ in GAT (Velickovi ˇ c et al. ´ , 2018), $\alpha _ { i j } = a \cdot \cos ( W \mathbf { x } _ { i } , W \mathbf { x } _ { j } )$ in AGNN (Thekumparampil et al., 2018), $\alpha _ { i j } = ( W _ { 1 } \mathbf { x } _ { i } ) ^ { \top } W _ { 2 } \mathbf { x } _ { j }$ in GaAN (Zhang et al., 2018), and $\alpha _ { i j } = \pmb { a } ^ { \top } \operatorname { t a n h } ( W _ { 1 } \mathbf x _ { i } + W _ { 2 } \mathbf x _ { j } )$ in GeniePath (Liu et al., 2019b), where $a$ and $W$ are trainable variables. A significant difference between these attention mechanisms and our work is that attention weights are learned based merely on feature similarity, while we propose that edge weights should be consistent with the distribution of labels on the graph, which requires less handcrafting of the attention function and is more taskoriented. Nevertheless, all the above formulas for calculating attentions can also be used in our model as the implementation of edge weights.
|
| 140 |
+
|
| 141 |
+
# 4 EXPERIMENTS
|
| 142 |
+
|
| 143 |
+
We evaluate our model and present its performance on five datasets including citation networks and coauthor networks. We also study the hyper-parameter sensitivity and provide training time analysis.
|
| 144 |
+
|
| 145 |
+
# 4.1 DATASETS
|
| 146 |
+
|
| 147 |
+
We use the following five datasets in our experiments:
|
| 148 |
+
|
| 149 |
+
Citation networks: We consider three citation network datasets (Sen et al., 2008): Cora, Citeseer, and Pubmed. In these datasets, nodes correspond to documents, edges correspond to citation links, and each node has a sparse bag-of-words feature vector as well as a class label. Coauthor networks: We also use two co-authorship networks (Shchur et al., 2018), Coauthor-CS and Coauthor-Phy, based on Microsoft Academic Graph from the KDD Cup 2016 challenge. Here nodes are authors and an edge indicates that two authors co-authored a paper. Node features represent paper keywords for each author’s papers, and class labels indicate most active fields of study for each author.
|
| 150 |
+
|
| 151 |
+
Statistics of the five datasets are shown in Table 1. We also calculate the intra-class edge rate (the fraction of edges that connect two nodes within the same class), which is significantly higher than inter-class edge rate in all networks. The finding supports our claim in Section 2.5 that node classification benefits from intra-class edges in a graph.
|
| 152 |
+
|
| 153 |
+
# 4.2 BASELINES
|
| 154 |
+
|
| 155 |
+
We compare against the following baselines in our experiments: Multi-layer Perceptron (MLP) and Logistic Regression (LR) are feature-based methods that do not consider the graph structure. Label Propagation (LPA) (Zhu et al., 2005), on the other hand, only consider the graph structure and ignore node features. The rest of baselines are GCN-based methods: Graph Convolutional Network (GCN) (Kipf & Welling, 2017) proposes a first-order approximation to spectral graph convolutions. Graph Attention Network (GAT) (Velickovi ˇ c et al. ´ , 2018) propose an attention mechanism to treat neighbors differently in the aggregation step. Jumping Knowledge Networks (JK-Net) (Xu et al., 2018) leverages different neighborhood ranges for each node to enable structure-aware representation. We use concat as the aggregator for JK-Net. Graph Sampling and Aggregation (GraphSAGE) (Hamilton et al., 2017) is a mini-batch implementation of GCN that uses neighborhood sampling strategy and different aggregation schemes. We use mean as the aggregator for GraphSAGE.
|
| 156 |
+
|
| 157 |
+
Table 1: Dataset statistics after removing self-loops and duplicate edges.
|
| 158 |
+
|
| 159 |
+
<table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Coauthor-CS</td><td>Coauthor-Phy</td></tr><tr><td>#nodes</td><td>2.708</td><td>3,327</td><td>19,717</td><td>18,333</td><td>34,493</td></tr><tr><td>#edges</td><td>5,278</td><td>4,552</td><td>44,324</td><td>81,894</td><td>247,962</td></tr><tr><td># features</td><td>1,433</td><td>3,703</td><td>500</td><td>6,805</td><td>8,415</td></tr><tr><td>#classes</td><td>7</td><td>6</td><td>3</td><td>15</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>80.8%</td><td>93.1%</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 2: Mean and the $9 5 \%$ confidence intervals of test set accuracy for all methods and datasets.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Coauthor-CS</td><td>Coauthor-Phy</td></tr><tr><td>MLP</td><td>64.6± 1.7</td><td>62.0±1.8</td><td>85.9± 0.3</td><td>91.7 ± 1.4</td><td>94.1 ± 1.2</td></tr><tr><td>LR</td><td>77.3 ± 1.8</td><td>71.2 ± 1.8</td><td>86.0 ± 0.6</td><td>91.1 ± 0.6</td><td>93.8 ±1.1</td></tr><tr><td>LPA</td><td>85.3± 0.9</td><td>70.0 ± 1.7</td><td>82.6± 0.6</td><td>91.3 ± 0.2</td><td>94.9 ± 0.4</td></tr><tr><td>GCN</td><td>88.2±0.8</td><td>77.3 ± 1.5</td><td>87.2 ± 0.4</td><td>93.6± 1.5</td><td>96.2± 0.2</td></tr><tr><td>GAT</td><td>87.7 ± 0.3</td><td>76.2 ± 0.9</td><td>86.9 ± 0.5</td><td>93.8 ± 0.4</td><td>96.3 ± 0.7</td></tr><tr><td>JK-Net</td><td>89.1 ± 1.2</td><td>78.3 ± 0.9</td><td>85.8 ± 1.1</td><td>92.4 ± 0.4</td><td>94.8 ± 0.4</td></tr><tr><td>GraphSAGE</td><td>86.8 ± 1.9</td><td>75.2 ± 1.1</td><td>84.7 ± 1.6</td><td>92.6 ± 1.6</td><td>94.5 ± 1.1</td></tr><tr><td>GCN-LPA</td><td>88.5 ± 1.5</td><td>78.7 ± 0.6</td><td>87.8± 0.6</td><td>94.8 ± 0.4</td><td>96.9 ± 0.2</td></tr></table>
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 2: Sensitivity to # LPA iterations on Citeseer dataset.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 3: Sensitivity to $\lambda$ on Citeseer dataset.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 4: Training time per epoch on random graphs.
|
| 173 |
+
|
| 174 |
+
# 4.3 EXPERIMENTAL SETUP
|
| 175 |
+
|
| 176 |
+
Our experiments focus on the transductive setting where we only know labels of part of nodes but have access to the entire graph as well as features of all nodes.3 The ratio of training, validation, and test set are set as $6 : 2 : 2$ . The weight of each edge is treated as a free variable during training. We train our model for 200 epochs using Adam (Kingma & Ba, 2015) and report the test set accuracy when validation set accuracy is maximized. Each experiment is repeated three times and we report the mean and the $9 5 \%$ confidence interval. We initialize weights according to Glorot & Bengio (2010) and row-normalize input features. During training, we apply L2 regularization to the transformation matrices and use the dropout technique (Srivastava et al., 2014). The settings of all other hyper-parameters can be found in Appendix F.
|
| 177 |
+
|
| 178 |
+
# 4.4 RESULTS
|
| 179 |
+
|
| 180 |
+
The results of node classification are summarized in Table 2. Table 2 indicates that only using node features (MLP, LR) or graph structure (LPA) will lead to information loss and cannot fully exploit datasets in general. The results demonstrate that our proposed GCN-LPA model surpasses stateof-the-art GCN/GNN baselines. We note that JK-Net is a strong baseline on Cora, but it does not perform consistently well on other datasets.
|
| 181 |
+
|
| 182 |
+
We investigate the influence of the number of LPA iterations and the training weight of LPA loss term $\lambda$ on the performance of classification. The results on Citeseer dataset are plotted in Figures 2 and 3, respectively, where each line corresponds to a given number of GCN layers in GCN-LPA. From Figure 2 we observe that the performance is boosted at first when the number of LPA iterations increases, then the accuracy stops increasing and decreases since a large number of LPA iterations will include more noisy nodes. Figure 3 shows that training without the LPA loss term (i.e., $\lambda = 0$ ) is more difficult than the case where $\lambda = 1 \sim 5$ , which justifies our aforementioned claim that it is hard for the GCN part to learn both transformation matrices $W$ and edge weights $A$ simultaneously without the assistance of LPA regularization.
|
| 183 |
+
|
| 184 |
+
Table 3: Result of GCN-LPA on Citeseer dataset with differet ratio of labeled nodes in LPA.
|
| 185 |
+
|
| 186 |
+
<table><tr><td>Ratio of labeled nodes</td><td>0%</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td><td>100%</td></tr><tr><td>Accuracy</td><td>75.8 ± 1.0</td><td>76.3 ± 1.1</td><td>76.7±0.8</td><td>77.3 ± 0.7</td><td>78.1 ±0.6</td><td>78.7 ± 0.6</td></tr></table>
|
| 187 |
+
|
| 188 |
+
To further show how much the LPA impacts the performance, we vary the ratio of labeled nodes in LPA from $\cdot$ to $0 \%$ during training, and report the result of acuracy on Citeseer dataset in Table 3. From Table 3 we observe that the performance of GCN-LPA gets worse when the ratio of labeled nodes in LPA decreases. In addition, using more labeled nodes in LPA also helps improve the model stability. Note that a ratio of $0 \%$ does not mean that GCN-LPA is equivalent to GCN (Kipf & Welling, 2017) because the edge weights in GCN-LPA is still trainable, which increases the risk of overfitting the training data.
|
| 189 |
+
|
| 190 |
+
We study the training time of GCN-LPA on random graphs. We use the one-hot identity vector as feature and 0 as label for each node. The size of training set and validation set is 100 and 200, respectively, while the rest is test set. The average number of neighbors for each node is set as 5, and the number of nodes is varied from one thousand to one million. We run GCN-LPA and GCN for 100 epochs on a Microsoft Azure virtual machine with 1 NVIDIA Tesla M60 GPU, 12 Intel Xeon CPUs (E5-2690 v3 $\ @ 2 . 6 0 \mathrm { G H z }$ ), and 128GB of RAM, using the same hyper-parameter setting as in Cora. The training time per epoch of GCN-LPA and GCN is presented in Figure 4. Our result shows that GCN-LPA requires only $9 . 2 \%$ extra training time on average compared to GCN.
|
| 191 |
+
|
| 192 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 193 |
+
|
| 194 |
+
In this paper, we studied the theoretical relationship between two types of well-known graph-based models for node classification, label propagation algorithm and graph convolutional neural networks, from the perspectives of feature/label smoothing and feature/label influence. We then propose a unified model GCN-LPA, which learns transformation matrices and edge weights simultaneously in GCN with the assistance of LPA regularizer. We also analyze why our unified model performs better than traditional GCN in node classification. Experiments on five datasets demonstrate that our model outperforms state-of-the-art baselines, and it is also highly time-efficient with respect to the size of a graph.
|
| 195 |
+
|
| 196 |
+
We point out two avenues of possible directions for future work. First, our proposed model focuses on transductive setting where all node features and the entire graph structure are given. An interesting problem is whether it can be applied to inductive setting where we have no access to test nodes during training. Second, the question of how to generalize the idea of our model to GNNs with different aggregation functions (e.g., concatenation or max-pooling) is also a promising direction.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the 13th International Conference on Artificial Intelligence and Statistics, 2010.
|
| 201 |
+
|
| 202 |
+
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 Lystems, 28 (6), 2017.
|
| 203 |
+
|
| 204 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, 2017.
|
| 205 |
+
|
| 206 |
+
Cheng Hong, Zicheng Liu, and Jie Yang. Sparsity induced similarity measure for label propagation. In Proceedings of the 12th IEEE International Conference on Computer Vision. IEEE, 2009.
|
| 207 |
+
|
| 208 |
+
Masayuki Karasuyama and Hiroshi Mamitsuka. Manifold-based similarity adaptation for label propagation. In Advances in Neural Information Processing Systems, 2013.
|
| 209 |
+
|
| 210 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, 2015.
|
| 211 |
+
|
| 212 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In Proceedings of the 5th International Conference on Learning Representations, 2017.
|
| 213 |
+
|
| 214 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In Proceedings of the 34th International Conference on Machine Learning, 2017.
|
| 215 |
+
|
| 216 |
+
Deguang Kong, Chris Ding, Heng Huang, and Feiping Nie. An iterative locally linear embedding algorithm. In Proceedings of the 29th International Coference on International Conference on Machine Learning. Omnipress, 2012.
|
| 217 |
+
|
| 218 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In The 32nd AAAI Conference on Artificial Intelligence, 2018.
|
| 219 |
+
|
| 220 |
+
Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. Lanczosnet: Multi-scale deep graph convolutional networks. In Proceedings of the 7th International Conference on Learning Representations, 2019.
|
| 221 |
+
|
| 222 |
+
Yanbin Liu, Juho Lee, Minseop Park, Saehoon Kim, Eunho Yang, Sung Ju Hwang, and Yi Yang. Learning to propagate labels: Transductive propagation network for few-shot learning. In Proceedings of the 7th International Conference on Learning Representations, 2019a.
|
| 223 |
+
|
| 224 |
+
Ziqi Liu, Chaochao Chen, Longfei Li, Jun Zhou, Xiaolong Li, Le Song, and Yuan Qi. Geniepath: Graph neural networks with adaptive receptive paths. In The 33rd AAAI Conference on Artificial Intelligence, 2019b.
|
| 225 |
+
|
| 226 |
+
Meng Qu, Yoshua Bengio, and Jian Tang. Gmnn: Graph markov neural networks. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 227 |
+
|
| 228 |
+
Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. science, 290(5500), 2000.
|
| 229 |
+
|
| 230 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3), 2008.
|
| 231 |
+
|
| 232 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. In Neural Information Processing Systems Workshop on Relational Representation Learning, 2018.
|
| 233 |
+
|
| 234 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1), 2014.
|
| 235 |
+
|
| 236 |
+
Kiran K Thekumparampil, Chong Wang, Sewoong Oh, and Li-Jia Li. Attention-based graph neural network for semi-supervised learning. arXiv preprint arXiv:1803.03735, 2018.
|
| 237 |
+
|
| 238 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In Proceedings of the 6th International Conference on Learning Representations, 2018.
|
| 239 |
+
|
| 240 |
+
Fei Wang and Changshui Zhang. Label propagation through linear neighborhoods. IEEE Transactions on Knowledge and Data Engineering, 20(1), 2008.
|
| 241 |
+
|
| 242 |
+
Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In Proceedings of the 35th International Conference on Machine Learning, 2018.
|
| 243 |
+
|
| 244 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In Proceedings of the 7th International Conference on Learning Representations, 2019.
|
| 245 |
+
|
| 246 |
+
Wayne W Zachary. An information flow model for conflict and fission in small groups. Journal of anthropological research, 33(4), 1977.
|
| 247 |
+
|
| 248 |
+
Jiani Zhang, Xingjian Shi, Junyuan Xie, Hao Ma, Irwin King, and Dit-Yan Yeung. Gaan: Gated attention networks for learning on large and spatiotemporal graphs. arXiv preprint arXiv:1803.07294, 2018.
|
| 249 |
+
|
| 250 |
+
Xinhua Zhang and Wee S Lee. Hyperparameter learning for graph based semi-supervised learning algorithms. In Advances in Neural Information Processing Systems, 2007.
|
| 251 |
+
|
| 252 |
+
Zhenyue Zhang and Jing Wang. Mlle: Modified locally linear embedding using multiple weights. In Advances in Neural Information Processing Systems, 2007.
|
| 253 |
+
|
| 254 |
+
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, 2004.
|
| 255 |
+
|
| 256 |
+
Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International Conference on Machine Learning, 2003.
|
| 257 |
+
|
| 258 |
+
Xiaojin Zhu, John Lafferty, and Ronald Rosenfeld. Semi-supervised learning with graphs. PhD thesis, Carnegie Mellon University, language technologies institute, school of , 2005.
|
| 259 |
+
|
| 260 |
+
# APPENDIX
|
| 261 |
+
|
| 262 |
+
A PROOF OF THEOREM 1
|
| 263 |
+
|
| 264 |
+
Proof. Denote $\widetilde { a } _ { i j } = a _ { i j } / d _ { i i }$ as the normalized weight of edge $( j , i )$ . It is clear that $\textstyle \sum _ { j \in N ( i ) } { \tilde { a } } _ { i j } =$ 1. Given that $\mathcal { M }$ is differentiable, we perform a first-order Taylor expansion with Peano’s form of remainder at xi for Pj∈N (i) a˜ij yj :
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\begin{array} { r l } & { \displaystyle \sum _ { j \in { \cal N } ( i ) } \displaystyle \tilde { a } _ { i j } y _ { j } = \sum _ { j \in { \cal N } ( i ) } \tilde { a } _ { i j } \mathcal { M } ( { \bf x } _ { j } ) } \\ & { = \displaystyle \sum _ { j \in { \cal N } ( i ) } \tilde { a } _ { i j } \left( \mathcal { M } ( { \bf x } _ { i } ) + \frac { \partial \mathcal { M } ( { \bf x } _ { i } ) } { \partial { \bf x } ^ { \top } } ( { \bf x } _ { j } - { \bf x } _ { i } ) + o ( \| { \bf x } _ { j } - { \bf x } _ { i } \| _ { 2 } ) \right) } \\ & { = \displaystyle \mathcal { M } ( { \bf x } _ { i } ) + \frac { \partial \mathcal { M } ( { \bf x } _ { i } ) } { \partial { \bf x } ^ { \top } } \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } ( { \bf x } _ { j } - { \bf x } _ { i } ) + \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } o ( \| { \bf x } _ { j } - { \bf x } _ { i } \| _ { 2 } ) } \\ & { = y _ { i } - \displaystyle \frac { \partial \mathcal { M } ( { \bf x } _ { i } ) } { \partial { \bf x } ^ { \top } } \epsilon _ { i } + \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } o ( \| { \bf x } _ { j } - { \bf x } _ { i } \| _ { 2 } ) . } \end{array}
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
According to Cauchy-Schwarz inequality and $L$ -Lipschitz property, we have
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\bigg | \frac { \partial \mathcal { M } ( \mathbf { x } _ { i } ) } { \partial \mathbf { x } ^ { \top } } \boldsymbol { \epsilon } _ { i } \bigg | \leq \bigg \| \frac { \partial \mathcal { M } ( \mathbf { x } _ { i } ) } { \partial \mathbf { x } ^ { \top } } \bigg \| _ { 2 } \| \boldsymbol { \epsilon } _ { i } \| _ { 2 } \leq L \| \boldsymbol { \epsilon } _ { i } \| _ { 2 } .
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
Therefore, the approximation of $y _ { i }$ is bounded by
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\begin{array} { l } { \displaystyle \left. y _ { i } - \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } y _ { j } \right. } \\ { = \displaystyle \left. \frac { \partial \mathcal { M } \big ( \mathbf { x } _ { i } \big ) } { \partial \mathbf { x } ^ { \top } } \epsilon _ { i } - \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } o ( \left. \mathbf { x } _ { j } - \mathbf { x } _ { i } \right. _ { 2 } ) \right. } \\ { \leq \displaystyle \left. \frac { \partial \mathcal { M } \big ( \mathbf { x } _ { i } \big ) } { \partial \mathbf { x } ^ { \top } } \epsilon _ { i } \right. + \displaystyle \left. \sum _ { j \in \mathcal { N } ( i ) } \tilde { a } _ { i j } o ( \left. \mathbf { x } _ { j } - \mathbf { x } _ { i } \right. _ { 2 } ) \right. } \\ { \leq L \lVert \epsilon _ { i } \rVert _ { 2 } + o \big ( \operatorname* { m a x } _ { j \in \mathcal { N } ( i ) } \left( \left. \mathbf { x } _ { j } - \mathbf { x } _ { i } \right. _ { 2 } \right) \big ) . } \end{array}
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
# B PROOF OF THEOREM 2
|
| 283 |
+
|
| 284 |
+
Before proving Theorem 2, we first give two lemmas that demonstrate the exact form of feature influence and label influence defined in this paper. The relationship between feature influence and label influence can then be deduced from their exact forms.
|
| 285 |
+
|
| 286 |
+
Lemma 1 Assume that the nonlinear activation function in GCN is ReLU. Let $\cdot$ be a path $[ v ^ { ( k ) } , v ^ { ( k - 1 ) } , \cdot \cdot \cdot , v ^ { ( 0 ) } ]$ of length $k$ from node $v _ { a }$ to node $v _ { b }$ , where $\boldsymbol { v } ^ { ( k ) } = \boldsymbol { v } _ { a }$ , $\boldsymbol { v } ^ { ( 0 ) } = \boldsymbol { v } _ { b }$ , and $v ^ { ( i - 1 ) } \in \mathcal { N } ( v ^ { ( i ) } ) f$ or $i = k , \cdots , 1$ . Then we have
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\tilde { I } _ { f } ( v _ { a } , v _ { b } ; k ) = \sum _ { \mathcal { P } _ { k } ^ { a b } } \prod _ { i = k } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } ,
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where $\tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } }$ is the normalized weight of edge $( v ^ { ( i ) } , v ^ { ( i - 1 ) } )$ .
|
| 293 |
+
|
| 294 |
+
Proof. See $\mathrm { X u }$ et al. (2018) for the detailed proof.
|
| 295 |
+
|
| 296 |
+
The product term in Eq. (13) is the probability of a given path $\mathcal { P } _ { k } ^ { a b }$ . Therefore, the right hand side in Eq. (13) is the sum over probabilities of all possible paths of length $k$ from $v _ { a }$ to $v _ { b }$ , which is the probability that a random walk starting at $v _ { a }$ ends at $v _ { b }$ after taking $k$ steps.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 5: An illustrating example of label propagation in LPA. Suppose labels are propagated for three iterations, and no self-loop exists. Blue nodes are labeled while white nodes are unlabeled. (a) $\cdot$ ’s label propagates to $\cdot$ (yellow arrows). Note that the propagation of $v _ { a }$ ’s label to $v _ { 3 }$ is cut off since $\cdot$ is labeled thus absorbing $\cdot$ ’s label. (b) $\cdot$ ’s label that propagated to $\cdot$ further propagates to $\cdot$ and $\cdot$ (yellow arrows). Meanwhile, $\cdot$ ’s label is reset to its initial value then propagates from $\cdot$ again (green arrows). (c) The propagating process in iteration 3. Purple arrows denote the propagation of $\cdot$ ’s label starting from $v _ { a }$ for the third time. (d) All possible paths of length no more than three from $\cdot$ to $v _ { b }$ containing unlabeled nodes only. Note that there is no path of length one from $v _ { a }$ to $\cdot$ .
|
| 300 |
+
|
| 301 |
+
Lemma 2 Let $\mathcal { U } _ { j } ^ { a b }$ be a path $[ v ^ { ( j ) } , v ^ { ( j - 1 ) } , \cdot \cdot \cdot , v ^ { ( 0 ) } ]$ of length $j$ from node $v _ { a }$ to node $v _ { b }$ , where $\boldsymbol { v } ^ { ( j ) } = \boldsymbol { v } _ { a }$ , $\boldsymbol { v } ^ { ( 0 ) } = \boldsymbol { v } _ { b }$ , $v ^ { ( i - 1 ) } \in \mathcal { N } ( v ^ { ( i ) } ) f o r i = j , \cdots , 1$ , and all nodes along the path are unlabeled except $v ^ { ( 0 ) }$ . Then we have
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
I _ { l } ( v _ { a } , v _ { b } ; k ) = \sum _ { j = 1 } ^ { k } \sum _ { \mathcal { U } _ { j } ^ { a b } } \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } ,
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
where $\tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } }$ is the normalized weight of edge $( v ^ { ( i ) } , v ^ { ( i - 1 ) } )$ .
|
| 308 |
+
|
| 309 |
+
To intuitively understand this lemma, note that there are two differences between Lemma 1 and Lemma 2: (1) In Lemma 1, $\ddot { I } _ { f } ( v _ { a } , v _ { b } ; k )$ sums over all paths from $v _ { a }$ to $v _ { b }$ of length $\cdot$ , but in Lemma 2, $\cdot$ sums over all paths from $v _ { a }$ to $\cdot$ of length no more than $k$ . The is because in LPA, $\cdot$ ’s label is reset to its initial value after each iteration, which means that the label of $v _ { b }$ serves as a constant signal that begins propagating in the graph again and again after each iteration. (2) In Lemma 1 we consider all possible paths from $\cdot$ to $v _ { b }$ , but in Lemma 2, the paths are restricted to contain unlabeled nodes only. The reason here is the same as above: Since the labels of labeled nodes are reset to their initial values after each iteration in LPA, the influence of $v _ { b }$ ’s label will be absorbed in labeled nodes, and the propagation of $v _ { b }$ ’s label will be cut off at these nodes. Therefore, $v _ { b }$ ’s label can only flow to $v _ { a }$ along the paths with unlabeled nodes only. See Figure 5 for an illustrating example showing the label propagation in LPA.
|
| 310 |
+
|
| 311 |
+
Proof. As mentioned above, a significant difference between LPA and GCN is that all labeled nodes are reset to its original labels after each iteration in LPA. This implies that the initial label $y _ { b }$ of node $v _ { b }$ appears not only as $y _ { b } ^ { ( 0 ) }$ , but also as every $y _ { b } ^ { ( j ) }$ for $j = 1 , \cdots , k - 1$ . Therefore, the influence of $y _ { b }$ on $y _ { a } ^ { ( k ) }$ bis the cumulative influence of $y _ { b } ^ { ( j ) }$ bon $y _ { a } ^ { ( k ) }$ for $j = 0 , 1 , \cdots , k - 1$ :
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
I _ { l } ( v _ { a } , v _ { b } ; k ) = \frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } } = \sum _ { j = 0 } ^ { k - 1 } \frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } } .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
According to the updating rule of LPA, we have
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } } = \frac { \partial \sum _ { v _ { z } \in \mathcal { N } ( v _ { a } ) } \tilde { a } _ { a z } y _ { z } ^ { ( k - 1 ) } } { \partial y _ { b } ^ { ( j ) } } = \sum _ { v _ { z } \in \mathcal { N } ( v _ { a } ) } \tilde { a } _ { a z } \frac { \partial y _ { z } ^ { ( k - 1 ) } } { \partial y _ { b } ^ { ( j ) } } .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
In the above equation, the derivative $\frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } }$ is decomposed into the weighted average of ∂y(k−1)z ∂ y ( j )b , where $v _ { z }$ traverses all neighbors of $v _ { a }$ . For those $v _ { z }$ ’s that are initially labeled, $y _ { z } ^ { ( k - 1 ) }$ is reset to
|
| 324 |
+
|
| 325 |
+
their initial labels in each iteration. Therefore, they are always constant and independent of $\cdot$ meaning that their derivatives w.r.t. $y _ { b } ^ { ( j ) }$ are zero. So we only need to consider the terms where $\cdot$ is an unlabeled node:
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } } = \sum _ { v _ { z } \in \mathcal { N } \left( v _ { a } \right) , z > m } \tilde { a } _ { a z } \frac { \partial y _ { z } ^ { ( k - 1 ) } } { \partial y _ { b } ^ { ( j ) } } ,
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
where $\cdot$ means $v _ { z }$ is unlabeled. To intuitively understand Eq. (17), one can imagine that we perform a random walk starting from node $\cdot$ for one step, where the “transition probability” is the edge weights $\ddot { a }$ , and all nodes in this random walk are restricted to unlabeled nodes only. Note that we can further decompose every $\cdot$ in Eq. (17) in the way similar to what we do for $y _ { a } ^ { ( k ) }$ in Eq. (16). So the expansion in Eq. (17) can be performed iteratively until the index $k$ decreases to $j$ . This is equivalent to performing all possible random walks for $k - j$ steps starting from $v _ { a }$ , where all nodes but the last in the random walk are restricted to be unlabeled nodes:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } } = \sum _ { v _ { z } \in \mathcal { V } } \sum _ { \mathcal { U } _ { k - j } ^ { a \to z } } \left( \prod _ { i = k - j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } \right) \frac { \partial y _ { z } ^ { ( j ) } } { \partial y _ { b } ^ { ( j ) } } ,
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
where $v _ { z }$ in the first summation term is the end node of a random walk, $\cdot$ in the second summation term is an unlabeled-nodes-only path from $\cdot$ to $v _ { z }$ of length $\cdot$ , and the product term is the probability of a given path $\cdot$ . Consider the last term ∂y(j)z $\cdot$ in Eq. (18). We know that $\begin{array} { r } { \frac { \partial y _ { z } ^ { ( j ) } } { \partial y _ { b } ^ { ( j ) } } = 0 } \end{array}$ for all $z \neq b$ and $\begin{array} { r } { \frac { \partial y _ { z } ^ { ( j ) } } { \partial y _ { b } ^ { ( j ) } } = 1 } \end{array}$ for $z = b$ , which means that only those random-walk paths that end exactly at $v _ { b }$ (i.e., the end node $v _ { z }$ is exactly $v _ { b }$ ) count for the computation in Eq. (18). Therefore, we have
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
{ \frac { \partial y _ { a } ^ { ( k ) } } { \partial y _ { b } ^ { ( j ) } } } = \sum _ { \mathcal { U } _ { k - j } ^ { a b } } \prod _ { i = k - j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } ,
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
where $\mathcal { U } _ { k - j } ^ { a b }$ is a path from $v _ { a }$ to $v _ { b }$ of length $k - j$ containing only unlabeled nodes except $v _ { b }$ Substituting the right hand term of Eq. (15) with Eq. (19), we obtain that
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
I _ { l } ( v _ { a } , v _ { b } ; k ) = \sum _ { j = 0 } ^ { k - 1 } \sum _ { \mathcal { U } _ { k - j } ^ { a b } } \prod _ { i = k - j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } = \sum _ { j = 1 } ^ { k } \sum _ { \mathcal { U } _ { j } ^ { a b } } \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Now Theorem 2 can be proved by combining Lemma 1 and Lemma 2:
|
| 350 |
+
|
| 351 |
+
Proof. Suppose that whether a node is labeled or not is independent of each other for the given graph. Then we have
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\begin{array}{c} \mathbb { E } \left[ \tilde { I } _ { i } ( v _ { \alpha } , v _ { b } ; k ) \right] = \mathbb { E } \left[ \sum _ { j = 1 } ^ { k } \sum _ { u _ { j } ^ { - 3 } } \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( - \alpha - 1 ) } , v ^ { ( \alpha ) } } \right] = \sum _ { j = 1 } ^ { k } \mathbb { E } \left[ \sum _ { U _ { j } ^ { - 3 } } \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( - \alpha - 1 ) } , v ^ { ( \alpha ) } } \right] \\ { = \sum _ { j = 1 } ^ { k } \sum _ { \rho \in \rho ^ { \alpha - b } } \mathbb { P } _ { \mathbf { r } } \left( \rho _ { j } ^ { \alpha - b } \mathrm { ~ i s ~ a n ~ u n l a b e l e d e d - n o d e s \cdot o n l y ~ p a n t h } \right) \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( - \alpha - 1 ) } , v ^ { ( \alpha ) } } } \\ { = \sum _ { j = 1 } ^ { k } \sum _ { \rho _ { j } \to b ^ { ( \beta ) } } \beta ^ { j } \prod _ { i = 1 } ^ { 1 } \tilde { a } _ { v ^ { ( - \alpha - 1 ) } , v ^ { ( \alpha ) } } } \\ { = \sum _ { j = 1 } ^ { k } \beta ^ { j } \tilde { I } _ { f } ( v _ { \alpha } , v _ { b } ; j ) . } \end{array}
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
# C PROOF OF THEOREM 3
|
| 358 |
+
|
| 359 |
+
Proof. Denote the set of labels as $\mathcal { L }$ . Since different label dimensions in $y _ { a } ^ { ( \cdot ) }$ do not interact with each other when running LPA, the value of the $y _ { a }$ -th dimension in $y _ { a } ^ { ( \cdot ) }$ (denoted by $y _ { a } ^ { ( \cdot ) } [ y _ { a } ] \rangle$ ) comes only from the nodes with initial label $y _ { a }$ . It is clear that
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
y _ { a } ^ { ( k ) } [ y _ { a } ] = \sum _ { v _ { b } : y _ { b } = y _ { a } } \sum _ { j = 1 } ^ { k } \sum _ { \mathcal { U } _ { j } ^ { a b } } \prod _ { i = j } ^ { 1 } \tilde { a } _ { v ^ { ( i - 1 ) } , v ^ { ( i ) } } ,
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
which equals $\begin{array} { r } { \sum _ { v { b } : y _ { b } = y _ { a } } I _ { l } ( v _ { a } , v _ { b } ; k ) } \end{array}$ according to Lemma 2. Therefore, we have
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\operatorname* { P r } ( { \hat { y } } _ { a } = y _ { a } ) = { \frac { y _ { a } ^ { ( k ) } [ y _ { a } ] } { \sum _ { i \in { \mathcal { L } } } y _ { a } ^ { ( k ) } [ i ] } } \propto y _ { a } ^ { ( k ) } [ y _ { a } ] = \sum _ { v _ { b } : y _ { b } = y _ { a } } I _ { l } ( v _ { a } , v _ { b } ; k )
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
# D PROOF OF THEOREM 4
|
| 372 |
+
|
| 373 |
+
In this proof we assume that the dimension of node representations is one, but note that the conclusion can be easily generalized to the case of multi-dimensional representations since the function $D ( \mathbf { x } )$ can be decomposed into the sum of one-dimensional cases. In the following of this proof, we still use bold notations $\mathbf { x } _ { i } ^ { ( k ) }$ and ${ \bf h } _ { i } ^ { ( k ) }$ to denote node representations, but keep in mind that they are scalars rather than vectors.
|
| 374 |
+
|
| 375 |
+
We give two lemmas before proving Theorem 4. The first one is about the gradient of $D ( \mathbf { x } )$
|
| 376 |
+
|
| 377 |
+
Lemma 3 ) = x(k)i − ∂D(x(k))(k) .
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { r } { \mathbf { x } _ { i } ^ { ( k ) } - \frac { \partial D ( \mathbf { x } ^ { ( k ) } ) } { \partial \mathbf { x } _ { i } ^ { ( k ) } } = \mathbf { x } _ { i } ^ { ( k ) } - \sum _ { v _ { j } \in \mathcal { N } ( v _ { i } ) } \widetilde { a } _ { i j } \big ( \mathbf { x } _ { i } ^ { ( k ) } - \mathbf { x } _ { j } ^ { ( k ) } \big ) = \sum _ { v _ { j } \in \mathcal { N } ( v _ { i } ) } \widetilde { a } _ { i j } \mathbf { x } _ { j } ^ { ( k ) } = \mathbf { h } _ { i } ^ { ( k ) } . } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
It is interesting to see from Lemma 3 that the aggregation step in GCN is equivalent to running gradient descent for one step with a step size of one. However, this is not able to guarantee that $\mathbf { \bar { \Gamma } } D ( \mathbf { h } ^ { ( k ) } ) \leq D ( \mathbf { x } ^ { ( k ) } )$ because the step size may be too large to reduce the value of $D$ .
|
| 384 |
+
|
| 385 |
+
The second lemma is about the Hessian of $D ( \mathbf { x } )$ :
|
| 386 |
+
|
| 387 |
+
Lemma 4 $\nabla ^ { 2 } D ( \mathbf { x } ) \preceq 2 I$ , or equivalently, $2 I - \nabla ^ { 2 } D ( \mathbf { x } )$ is a positive semidefinite matrix.
|
| 388 |
+
|
| 389 |
+
Proof. We first calculate the Hessian of $\begin{array} { r } { D ( { \bf x } ) = \frac { 1 } { 2 } \sum _ { v _ { i } , v _ { j } } \tilde { a } _ { i j } \Vert { \bf x } _ { i } - { \bf x } _ { j } \Vert _ { 2 } ^ { 2 } . } \end{array}$
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\nabla ^ { 2 } D ( { \bf x } ) = \left[ \begin{array} { c c c c } { 1 - \tilde { a } _ { 1 1 } } & { - \tilde { a } _ { 1 2 } } & { \ddots } & { - \tilde { a } _ { 1 n } } \\ { - \tilde { a } _ { 2 1 } } & { 1 - \tilde { a } _ { 2 2 } } & { \ddots } & { - \tilde { a } _ { 2 n } } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { - \tilde { a } _ { n 1 } } & { - \tilde { a } _ { n 2 } } & { \ddots } & { 1 - \tilde { a } _ { n n } } \end{array} \right] = I - D ^ { - 1 } A .
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
Therefore, $2 I - \nabla ^ { 2 } D ( \mathbf { x } ) = I + D ^ { - 1 } A$ . Since $D ^ { - 1 } A$ is Markov matrix (i.e., each entry is nonnegative and the sum of each row is one), its eigenvalues are within the range [-1, 1], so the eigenvalues of $I + D ^ { - 1 } A$ are within the range [0, 2]. Therefore, $I + D ^ { - 1 } A$ is a positive semidefinite matrix, and we have $\nabla ^ { 2 } D ( \mathbf { x } ) \preceq 2 I$ .
|
| 396 |
+
|
| 397 |
+
We can now prove Theorem 4:
|
| 398 |
+
|
| 399 |
+
Proof. Since $D$ is a quadratic function, we perform a second-order Taylor expansion of $D$ around $\mathbf { x } ^ { ( k ) }$ and obtain the following inequality:
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { D ( \mathbf { h } ^ { ( k ) } ) = D ( \mathbf { x } ^ { ( k ) } ) + \nabla D ( \mathbf { x } ^ { ( k ) } ) ^ { \top } ( \mathbf { h } ^ { ( k ) } - \mathbf { x } ^ { ( k ) } ) + \displaystyle \frac { 1 } { 2 } ( \mathbf { h } ^ { ( k ) } - \mathbf { x } ^ { ( k ) } ) ^ { \top } \nabla ^ { 2 } D ( \mathbf { x } ) ( \mathbf { h } ^ { ( k ) } - \mathbf { x } ^ { ( k ) } ) } \\ & { \qquad = D ( \mathbf { x } ^ { ( k ) } ) - \nabla D ( \mathbf { x } ^ { ( k ) } ) ^ { \top } \nabla D ( \mathbf { x } ^ { ( k ) } ) + \displaystyle \frac { 1 } { 2 } \nabla D ( \mathbf { x } ^ { ( k ) } ) ^ { \top } \nabla ^ { 2 } D ( \mathbf { x } ) \nabla D ( \mathbf { x } ^ { ( k ) } ) } \\ & { \qquad \leq D ( \mathbf { x } ^ { ( k ) } ) - \nabla D ( \mathbf { x } ^ { ( k ) } ) ^ { \top } \nabla D ( \mathbf { x } ^ { ( k ) } ) + \nabla D ( \mathbf { x } ^ { ( k ) } ) ^ { \top } \nabla D ( \mathbf { x } ^ { ( k ) } ) = D ( \mathbf { x } ^ { ( k ) } ) . } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
Figure 6: Visualization of GCN and GCN-LPA with $1 \sim 4$ layers on karate club network.
|
| 407 |
+
|
| 408 |
+
E MORE VISUALIZATION RESULTS ON KARATE CLUB NETWORK
|
| 409 |
+
|
| 410 |
+
Figure 6 illustrates more visualization of GCN and GCN-LPA on karate club network. In each subfigure, we vary the number of layers from 1 to 4 to examine how the learned representations evolve. The initial node features are one-hot identity vectors, and the dimension of hidden layers and output layer is 2. The transformation matrices are uniformly initialized within range [-1, 1]. We use sigmoid function as the nonlinear activation function. Comparing the four figures in each row, we conclude that the aggregation step and transformation step in GCN and GCN-LPA do benefit the separation of different classes. Comparing Figure 6a and 6c (or Figure 6b and 6d), we conclude that more inter-class edges will make the separation harder for GCN (or GCN-LPA). Comparing Figure 6a and 6b (or Figure 6c and 6d), we conclude that GCN-LPA is more noise-resistant than GCN, therefore, GCN-LPA can better differentiate classes and identify clustering substructures.
|
| 411 |
+
|
| 412 |
+
# F HYPER-PARAMETER SETTINGS
|
| 413 |
+
|
| 414 |
+
The detailed hyper-parameter settings for all datasets are listed in Table 4. In GCN-LPA, we use the same dimension for all hidden layers. Note that the number of GCN layers and the number of LPA iterations can actually be different since GCN and LPA are implemented as two independent modules. We use grid search to determine hyper-parameters on Cora, and perform fine-tuning on other datasets, i.e., varying one hyper-parameter per time to see if the performance can be further improved. The search spaces for hyper-parameters are as follows:
|
| 415 |
+
|
| 416 |
+
Table 4: Hyper-parameter settings for all datasets.
|
| 417 |
+
|
| 418 |
+
<table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Coauthor-CS</td><td>Coauthor-Phy</td></tr><tr><td>Dimension of hidden layers</td><td>32</td><td>16</td><td>32</td><td>32</td><td>32</td></tr><tr><td># GCN layers</td><td>5</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>#LPA iterations</td><td>5</td><td>5</td><td>1</td><td>2</td><td>3</td></tr><tr><td>L2 weight</td><td>1×10 -4</td><td>5×10-4</td><td>2×10-4</td><td>1×10-4</td><td>1 ×10-4</td></tr><tr><td>LPA weight (入)</td><td>10</td><td>1</td><td>1</td><td>2</td><td>1</td></tr><tr><td>Dropout rate</td><td>0.2</td><td>0</td><td>0</td><td>0.2</td><td>0.2</td></tr><tr><td>Learning rate</td><td>0.05</td><td>0.2</td><td>0.1</td><td>0.1</td><td>0.05</td></tr></table>
|
| 419 |
+
|
| 420 |
+
• Dimension of hidden layers: $\{ 8 , 1 6 , 3 2 \}$ ;
|
| 421 |
+
• # GCN layers: $\{ 1 , 2 , 3 , 4 , 5 , 6 \}$ ;
|
| 422 |
+
• # LPA iterations: $\{ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 \}$ ;
|
| 423 |
+
• L2 weight: $\{ 1 0 ^ { - 7 } , 2 \times 1 0 ^ { - 7 } , 5 \times 1 0 ^ { - 7 } , 1 0 ^ { - 6 } , 2 \times 1 0 ^ { - 6 } , 5 \times 1 0 ^ { - 6 } , 1 0 ^ { - 5 } , 2 \times 1 0 ^ { - 5 } , 5 \times 1 0 ^ { - 6 } , 1 \}$ $1 0 ^ { - 5 } , 1 0 ^ { - 4 } , 2 \times 1 0 ^ { - 4 } , 5 \times 1 0 ^ { - 4 } , 1 0 ^ { - 3 } \}$ ;
|
| 424 |
+
• LPA weight $( \lambda )$ : $\{ 0 , 1 , 2 , 5 , 1 0 , 1 5 , 2 0 \}$ ;
|
| 425 |
+
• Dropout rate: $\{ 0 , 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 , 0 . 5 \}$ ;
|
| 426 |
+
• Learning rate: $\{ 0 . 0 1 , 0 . 0 2 , 0 . 0 5 , 0 . 1 , 0 . 2 , 0 . 5 \}$ ;
|
md/train/w_7JMpGZRh0/w_7JMpGZRh0.md
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WATCH-AND-HELP: A CHALLENGE FOR SOCIAL PER-CEPTION AND HUMAN-AI COLLABORATION
|
| 2 |
+
|
| 3 |
+
Xavier Puig1 Tianmin Shu1 Shuang Li1 Zilin Wang2 Yuan-Hong Liao $^ { 3 , 5 }$ Joshua B. Tenenbaum1 Sanja Fidler3,4,5 Antonio Torralba1
|
| 4 |
+
|
| 5 |
+
1Massachusetts Institute of Technology 2ETH Zurich
|
| 6 |
+
3University of Toronto 4NVIDIA 5Vector Institute
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
In this paper, we introduce Watch-And-Help (WAH), a challenge for testing social intelligence in agents. In WAH, an AI agent needs to help a human-like agent perform a complex household task efficiently. To succeed, the AI agent needs to i) understand the underlying goal of the task by watching a single demonstration of the human-like agent performing the same task (social perception), and ii) coordinate with the human-like agent to solve the task in an unseen environment as fast as possible (human-AI collaboration). For this challenge, we build VirtualHomeSocial, a multi-agent household environment, and provide a benchmark including both planning and learning based baselines. We evaluate the performance of AI agents with the human-like agent as well as with real humans using objective metrics and subjective user ratings. Experimental results demonstrate that the proposed challenge and virtual environment enable a systematic evaluation on the important aspects of machine social intelligence at scale.1
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Humans exhibit altruistic behaviors at an early age (Warneken & Tomasello, 2006). Without much prior experience, children can robustly recognize goals of other people by simply watching them act in an environment, and are able to come up with plans to help them, even in novel scenarios. In contrast, the most advanced AI systems to date still struggle with such basic social skills.
|
| 15 |
+
|
| 16 |
+
In order to achieve the level of social intelligence required to effectively help humans, an AI agent should acquire two key abilities: i) social perception, i.e., the ability to understand human behavior, and ii) collaborative planning, i.e., the ability to reason about the physical environment and plan its actions to coordinate with humans. In this paper, we are interested in developing AI agents with these two abilities.
|
| 17 |
+
|
| 18 |
+
Towards this goal, we introduce a new AI challenge, Watch-And-Help (WAH), which focuses on social perception and human-AI collaboration. In this challenge, an AI agent needs to collaborate with a human-like agent to enable it to achieve the goal faster. In particular, we present a 2-stage framework as shown in Figure 1. In the first, Watch stage, an AI agent (Bob) watches a human-like agent (Alice) performing a task once and infers Alice’s goal from her actions. In the second, Help stage, Bob helps Alice achieve the same goal in a different environment as quickly as possible (i.e., with the minimum number of environment steps).
|
| 19 |
+
|
| 20 |
+
This 2-stage framework poses unique challenges for human-AI collaboration. Unlike prior work which provides a common goal a priori or considers a small goal space (Goodrich & Schultz, 2007; Carroll et al., 2019), our AI agent has to reason about what the human-like agent is trying to achieve by watching a single demonstration. Furthermore, the AI agent has to generalize its acquired knowledge about the human-like agent’s goal to a new environment in the Help stage. Prior work does not investigate such generalization.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Overview of the Watch-And-Help challenge. The challenge has two stages: i) in the Watch stage, Bob will watch a single demonstration of Alice performing a task and infer her goal; ii) then in the Help stage, based on the inferred goal, Bob will work with Alice to help finish the same task as fast as possible in a different environment.
|
| 24 |
+
|
| 25 |
+
To enable multi-agent interactions in realistic environments, we extend an open source virtual platform, VirtualHome (Puig et al., 2018), and build a multi-agent virtual environment, VirtualHomeSocial. VirtualHome-Social simulates realistic and rich home environments where agents can interact with different objects (e.g, by opening a container or grabbing an object) and with other agents (e.g., following, helping, avoiding collisions) to perform complex tasks. VirtualHome-Social also provides i) built-in agents that emulate human behaviors, allowing training and testing of AI agents alongside virtual humans, and ii) an interface for human players, allowing evaluation with real humans and collecting/displaying human activities in realistic environments (a functionality key to machine social intelligence tasks but not offered by existing multi-agent platforms). We plan to open source our environment.
|
| 26 |
+
|
| 27 |
+
We design an evaluation protocol and provide a benchmark for the challenge, including a goal inference model for the Watch stage, and multiple planning and deep reinforcement learning (DRL) baselines for the Help stage. Experimental results indicate that to achieve success in the proposed challenge, AI agents must acquire strong social perception and generalizable helping strategies. These fundamental aspects of machine social intelligence have been shown to be key to humanAI collaboration in prior work (Grosz & Kraus, 1996; Albrecht & Stone, 2018). In this work, we demonstrate how we can systematically evaluate them in more realistic settings at scale.
|
| 28 |
+
|
| 29 |
+
The main contributions of our work are: i) a new social intelligence challenge, Watch-And-Help, for evaluating AI agents’ social perception and their ability to collaborate with other agents, ii) a multiagent platform allowing AI agents to perform complex household tasks by interacting with objects and with built-in agents or real humans, and iii) a benchmark consisting of multiple planning and learning based approaches which highlights important aspects of machine social intelligence.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Human activity understanding. An important part of the challenge is to understand human activities. Prior work on activity recognition has been mostly focused on recognizing short actions (Sigurdsson et al., 2018; Caba Heilbron et al., 2015; Fouhey et al., 2018), predicting pedestrian trajectories (Kitani et al., 2012; Alahi et al., 2016), recognizing group activities (Shu et al., 2015; Choi & Savarese, 2013; Ibrahim et al., 2016), and recognizing plans (Kautz, 1991; Ramırez & Geffner, 2009). We are interested in the kinds of activity understanding that require inferring other people’s mental states (e.g., intentions, desires, beliefs) from observing their behaviors. Therefore, the Watch stage of our challenge focuses on the understanding of humans’ goals in a long sequence of actions instead. This is closely related to work on computational Theory of Mind that aims at inferring humans’ goals by observing their actions (Baker et al., 2017; Ullman et al., 2009; Rabinowitz et al., 2018; Shum et al., 2019). However, in prior work, activities were simulated in toy environments (e.g., 2D grid worlds). In contrast, this work provides a testbed for conducting Theory-of-Mind type of activity understanding in simulated real-world environments.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 2: The system setup for the WAH challenge. An AI agent (Bob) watches a demonstration of a human-like agent (Alice) performing a task, and infers the goal (a set of predicates) that Alice was trying to achieve. Afterwards, the AI agent is asked to work together with Alice to achieve the same goal in a new environment as fast as possible. To do that, Bob needs to plan its actions based on i) its understanding of Alice’s goal, and ii) a partial observation of the environment. It also needs to adapt to Alice’s plan. We simulate environment dynamics and provide observations for both agents in our VirtualHome-Social multi-agent platform. The platform includes a built-in agent as Alice which is able to plan its actions based on the ground-truth goal, and can react to any world state change caused by Bob through re-planning at every step based on its latest observation. Our system also offers an interface for real humans to control Alice and work with an AI agent in the challenge.
|
| 37 |
+
|
| 38 |
+
Human-robot interaction. The helping aspect of the WAH challenge has been extensively studied in human-robot interaction (HRI). However, prior work in HRI has been mainly restricted in lab environments (Goodrich & Schultz, 2007; Dautenhahn, 2007; Nikolaidis et al., 2015; Rozo et al., 2016), and the goals in the collaborative tasks were either shared by both agents or were defined in a small space. The setup in WAH is much more challenging – the goal is sampled from a large space, needs to be inferred from a single demonstration, and must be performed in realistic and diverse household environments through a long sequence of actions.
|
| 39 |
+
|
| 40 |
+
Multi-agent virtual environments. There has been a large body of platforms for various multiagent tasks (Jaderberg et al., 2019; Samvelyan et al., 2019; OpenAI, 2018; Lowe et al., 2017; Resnick et al., 2018; Shu & Tian, 2018; Carroll et al., 2019; Suarez et al., 2019; Baker et al., 2019; Bard et al., 2020). However, these multi-agent platforms can only simulate simple or game-like environments and do not support for human-AI collaborations on real-life activities. Existing platforms for realistic virtual environments mainly focus on single agent settings for tasks such as navigation (Savva et al., 2019; Xia et al., 2018; Brodeur et al., 2017; Zhu et al., 2017; Xia et al., 2018) , embodied question answering (Gordon et al., 2017; Wijmans et al., 2019; Das et al., 2018), or single agent task completion (Puig et al., 2018; Shridhar et al., 2019; Misra et al., 2018; Gao et al., 2019). In contrast, the proposed VirtualHome-Social environment allows AI agents to engage in multi-agent household activities by i) simulating realistic and interactive home environments, ii) incorporating humanoid agents with human-like behaviors into the system, iii) providing a wide range of commands and animations for navigation and object manipulation, and iv) allowing human participation. Because of these features, VirtualHome-Social can serve as a testbed for complex social perception and humanAI collaboration tasks, which is complementary to existing virtual environments.
|
| 41 |
+
|
| 42 |
+
# 3 THE WATCH-AND-HELP CHALLENGE
|
| 43 |
+
|
| 44 |
+
The Watch-And-Help challenge aims to study AI agents’ ability to help humans in household activities. To do that, we design a set of tasks defined by predicates describing the final state of the environment. For each task, we first provide Bob a video that shows Alice successfully performing the activity (Watch stage), and then place both agents in a new environment where Bob has to help Alice achieve the same goal with the minimum number of time steps (Help stage).
|
| 45 |
+
|
| 46 |
+
Figure 2 provides an overview of the system setup for the Watch-And-Help challenge. For this challenge, we build a multi-agent platform, VirtualHome-Social (Section 4), that i) supports concurrent actions from multiple agents and ii) provides observations for the agents. Alice represents a built-in agent in the system; she plans her actions based on her own goal and a partial observation of the environment. Bob serves as an external AI agent, who does not know Alice’s ground-truth goal and only has access to a single demonstration of Alice performing the same task in the past. During the Help stage, Bob receives his observation from the system at each step and sends an action command back to control the avatar in the environment. Alice, on her part, updates her plan at each step based on her latest observation to reflect any world state change caused by Bob. We also allow a human to control Alice in our system. We discuss how the system and the built-in agent work in Section 4.
|
| 47 |
+
|
| 48 |
+
Problem Setup. Formally, each task in the challenge is defined by Alice’s goal $g$ (i.e., a set of goal predicates), a demonstration of Alice taking actions to achieve that goal $D \stackrel { - } { = } \{ s _ { \mathrm { A l i c e } } ^ { t } , a _ { \mathrm { A l i c e } } ^ { t } \} _ { t = 1 } ^ { T }$ (i.e., a sequence of states $s _ { \mathrm { A l i c e } } ^ { t }$ and actions $a _ { \mathrm { A l i c e } } ^ { t } )$ , and a new environment where Bob collaborates with Alice and help achieve the same goal as quickly as possible. During training, the ground-truth goal of Alice is shown to Bob as supervision; during testing, Bob no longer has access to the ground-truth goal and thus has to infer it from the given demonstration.
|
| 49 |
+
|
| 50 |
+
Goal Definitions. We define the goal of a task as a set of predicates and their counts, which describes the target state. Each goal has 2 - 8 predicates. For instance, “ON(plate, dinnertable):2; ON(wineglass, dinnertable): $_ { 1 } \mathfrak { s }$ means “putting two plates and one wine glass onto the dinner table.” The objects in a predicate refer to object classes rather than instances, meaning that any object of a specified class is acceptable. This goal definition reflects different preferences of agents (when setting up a dinner table, some prefer to put water glasses, others may prefer to put wine glasses), increasing the diversity in tasks. We design five predicate sets representing five types of household activities: 1) setting up a dinner table, 2) putting groceries / leftovers to the fridge, 3) preparing a simple meal, 4) washing dishes, and 5) reading a book while having snacks or drinks. In total, there are 30 different types of predicates. In each task, the predicates of a goal are sampled from one of the five predicate sets (as a single household activity). More details about the predicate sets and goal definitions are listed in Appendix B.1.
|
| 51 |
+
|
| 52 |
+
# 4 VIRTUALHOME-SOCIAL
|
| 53 |
+
|
| 54 |
+
Building machine social intelligence for real-life activities poses additional challenges compared to typical multi-agent settings, such as far more unconstrained goal and action spaces, and the need to display human actions realistically for social perception.
|
| 55 |
+
|
| 56 |
+
With that in mind, we create VirtualHome-Social, a new environment where multiple agents (including real humans) can execute actions concurrently and observe each other’s behaviors. Furthermore, we embed planning-based agents in the environment as virtual humans that AI agents can reason about and interact with.
|
| 57 |
+
|
| 58 |
+
In the rest of this section, we describe the observations, actions, and the built-in human-like agent provided in VirtualHome-Social. Appendix A includes more information.
|
| 59 |
+
|
| 60 |
+
Observation space. The environment supports symbolic and visual observations, allowing agents to learn helping behaviors under different conditions. The symbolic observations consist on a scene graph, with nodes representing objects and edges describing spatial relationships between them.
|
| 61 |
+
|
| 62 |
+
Action space. Agents can navigate in the environment and interact with objects in it. To interact with objects, agents need to specify an action and the index of the intended object (e.g., “grab $\langle 3 \rangle ^ { \ast }$ stands for grabbing the object with id 3). An agent can only interact with objects that are within its field of sight, and therefore its action space changes at every step.
|
| 63 |
+
|
| 64 |
+
Human-like agents. To enable a training and testing environment for human-AI interactions, it is critical to incorporate built-in agents that emulate humans when engaging in multi-agent activities. Carroll et al. (2019) has attempted to train policies imitating human demonstrations. But those policies would not reliably perform complex tasks in partially observable environments. Therefore, we devise a planning-based agent with bounded rationality, provided as part of the platform. This agent operates on the symbolic representation of its partial observation of the environment. As shown in Figure 3, it relies on two key components: 1) a belief of object locations in the environment (Figure 13 in Appendix A.3), and 2) a hierarchical planner, which uses Monte Carlo Tree Search (MCTS) (Browne et al., 2012) and regression planning (RP) (Korf, 1987) to find a plan for a given goal based on its belief. At every step, the human-like agent updates its belief based on the latest observation, finds a new plan, and executes the first action of the plan concurrently with other agents. The proposed design allows agents to robustly perform tasks in partially observable environments while producing human-like behaviors2. We provide more details of this agent in Appendix A.3.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 3: Overview of the human-like agent.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 4: The overall design of the baseline models. A goal inference model infers the goal from a demonstration $D$ and feeds it to a helping policy (for learning-based baselines) or to a planner to generate Bob’s action. We adopt a hierarchical approach for all baselines.
|
| 71 |
+
|
| 72 |
+
# 5 BENCHMARK
|
| 73 |
+
|
| 74 |
+
# 5.1 EVALUATION PROTOCOL
|
| 75 |
+
|
| 76 |
+
Training and Testing Setup. We create a training set with 1011 tasks and 2 testing sets (test-1, test-2). Each test set has 100 tasks. We make sure that i) the helping environment in each task is different from the environment in the pairing demonstration (we sample a different apartment and randomize the initial state), and ii) goals (predicate combinations) in the test set are unseen during training. To evaluate generalization, we also hold out 2 apartments for the Help stage in the test sets. For the training set and test-1 set, all predicates in each goal are from the same predicate set, whereas a goal in test-2 consists of predicates sampled from two different predicates sets representing multiactivity scenarios (e.g., putting groceries to the fridge and washing dishes). Note that during testing, the ground-truth goals are not shown to the evaluated Bob agent. More details can be found in Appendix B. An episode is terminated once all predicates in Alice’s goal are satisfied (i.e., a success) or the time limit (250 steps) is reached (i.e., a failure).
|
| 77 |
+
|
| 78 |
+
Evaluation Metrics. We evaluate the performance of an AI agent by three types of metrics: i) success rate, ii) speedup, and iii) a cumulative reward. For speedup, we compare the episode length when Alice and Bob are working together $( L _ { \mathrm { H e l p } } )$ with the episode length when Alice is working alone $( L _ { \mathrm { A l i c e } } )$ , i.e., $L _ { \mathrm { A l i c e } } / L _ { \mathrm { B o b } } - 1$ . To account for both the success rate and the speedup, we define the cumulative reward of an episo with $T$ steps as $\textstyle R = \sum _ { t = 1 } ^ { T } \mathbb { 1 } ( s ^ { t } = s _ { g } ) - 0 . 0 0 4$ , where $s ^ { t }$ is the state at step , $s _ { g }$ is the goal state. $R$ ranges from (failure) to 1 (achieving the goal in zero steps).
|
| 79 |
+
|
| 80 |
+
# 5.2 BASELINES
|
| 81 |
+
|
| 82 |
+
To address this challenge, we propose a set of baselines that consist of two components as shown in Figure 4: a goal inference model and a goal-conditioned helping planner / policy. In this paper, we assume that the AI agent has access to the ground-truth states of objects within its field of view (but one could also use raw pixels as input). We describe our approach for the two components below.
|
| 83 |
+
|
| 84 |
+
Goal inference. We train a goal inference model based on the symbolic representation of states in the demonstration. At each step, we first encode the state using a Transformer (Vaswani et al., 2017) over visible objects and feed the encoded state into a long short-term memory (LSTM) (Hochreiter & Schmidhuber, 1997). We use average pooling to aggregate the latent states from the LSTM over time and build a classifier for each predicate to infer its count. Effectively, we build 30 classifiers, corresponding to the 30 predicates in our taxonomy and the fact that each can appear multiple times.
|
| 85 |
+
|
| 86 |
+
Helping policy/planner. Due to the nature of the tasks in our challenge – e.g., partial observability, a large action space, sparse rewards, strict preconditions for actions – it is difficult to search for a helping plan or learn a helping policy directly over the agent’s actions. To mitigate these difficulties, we propose a hierarchical architecture with two modules for both planning and RL-based approaches as shown in Figure 4. At every step, given the goal inferred from the demonstration, $\hat { g }$ , and the current observation of Bob, a high-level policy or planner will output a predicate as the best subgoal to pursue for the current step; the subgoal is subsequently fed to a low-level policy or planner which will yield Bob’s action $a _ { \mathrm { B o b } } ^ { t }$ at this step. In our baselines, we use either a learned policy or a planner for each module. We use the symbolic representation of visible objects as Bob’s observation $O _ { \mathrm { B o b } } ^ { t }$ for all models. We summarize the overall design of the baseline models as follows (please refer to Appendix C for the details of models and training procedures):
|
| 87 |
+
|
| 88 |
+
HP: A hierarchical planner, where the high-level planner and the low-level planner are implemented by MCTS and regression planning (RP) respectively. This is the same planner as the one for Alice, except that i) it has its own partial observation and thus a different belief from Alice, and ii) when given the ground-truth goal, the high-level planner uses Alice’s plan to avoid overlapping with her.
|
| 89 |
+
|
| 90 |
+
Hybrid: A hybrid model of RL and planning, where an RL policy serves as the high-level policy and an RP is deployed to generated plans for each subgoal sampled from the RL-based high-level policy. This is to train an agent equipped with basic skills for achieving subgoals to help Alice through RL.
|
| 91 |
+
|
| 92 |
+
HRL: A hierarchical RL baseline where high-level and low-level policies are all learned.
|
| 93 |
+
|
| 94 |
+
Random: A naive agent that takes a random action at each step.
|
| 95 |
+
|
| 96 |
+
To show the upper bound performance in the challenge, we also provide two oracles:
|
| 97 |
+
|
| 98 |
+
OracleB: An HP-based Bob agent with full knowledge of the environment and the true goal of Alice
|
| 99 |
+
|
| 100 |
+
OracleA, B: Alice has full knowledge of the environment too.
|
| 101 |
+
|
| 102 |
+
# 5.3 RESULTS
|
| 103 |
+
|
| 104 |
+
We evaluate the Watch stage by measuring the recognition performance of the predicates. The proposed model achieves a precision and recall of 0.85 and 0.96 over the test-1 set. To evaluate the importance of seeing the full demonstration, we test a model that takes as input the graph representation of the last observation, leading to a precision and recall of 0.79 and 0.75. When using actions taken by Alice as the input, the performance increases to a precision and recall of 0.99 and 0.99. The chance precision and recall is 0.08 and 0.09.
|
| 105 |
+
|
| 106 |
+
We report the performance of our proposed baselines (average and standard error across all episodes) in the Help stage in Figure 5. In addition to the full challenge setup, we also report the performance of the helping agents using true goals (indicated by the subscript $\mathrm { T G }$ ) and using random goals $( \mathrm { b y } _ { \mathrm { R G } } )$ , and the performance of Alice working alone. Results show that planning-based approaches are the most effective in helping Alice. Specifically, $\mathbf { H P } _ { \mathrm { T G } }$ achieves the best performance among non-oracle baselines by using the true goals and reasoning about Alice’s future plan, avoiding redundant actions and collisions with her (Figure 6 illustrates an example of collaboration). Using the inferred goals, both HP and Hybrid can offer effective help. However, with a random goal inference $( { \bf H P _ { \mathrm { R G } } } )$ , a capable Bob agent becomes counter productive – frequently undoing what Alice has achieved due to their conflicting goals (conflicts appear in $40 \%$ of the overall episodes, $65 \%$ for Put Groceries and Set Meal). This calls for an AI agent with the ability to adjust its goal inference dynamically by observing Alice’s behavior in the new environment (e.g., Alice correcting a mistake made by Bob signals incorrect goal inference). HRL works no better than Random, even though it shares the same global policy with Hybrid. While the high level policy selects reasonable predicates to perform the task, the low level policy does not manage to achieve the desired goal. In most of the cases, this is due to the agent picking the right object, but failing to put it to the target location afterwards. This suggests that it is crucial for Bob to develop robust abilities to achieve the subgoals. There is no significant difference between Random and Alice baselines $( t ( 9 9 ) = - 1 . 3 8$ , $p = 0 . 1 7 )$ .
|
| 107 |
+
|
| 108 |
+
We also evaluate the baselines in the test-2 set, containing tasks with multiple activities. The goal inference model achieves a precision and recall of 0.68 and 0.64. The performance gap from test-1 indicates that the model fails to generalize to generalize to multi-activity scenarios, overfitting to predicate combinations seen during training. For the Help stage, we evaluate the performance of
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 5: a) Success rate (x axis) and speedup (y axis) of all baselines and oracles. The performance of an effective Bob agent should fall into the upper-right side of the Alice-alone baseline in this plot. b) Cumulative reward in the overall test set and in each household activity category (corresponding to the five predicate sets introduced in Section 3).
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 6: Example helping plan. The arrows indicate moving directions and the circles with black borders indicate moments when agents interacted with objects. When working alone (left), Alice had to search different rooms; but with Bob’s help (right), Alice could finish the task much faster.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 7: Example helping behaviors. We show more examples in the supplementary video.
|
| 118 |
+
|
| 119 |
+
Alice alone, as well as the best performing baseline, HP. Alice achieves a success rate of $9 5 . 4 0 \pm$ 0.01, while the HP baseline achieves a success rate of $8 8 . 6 0 \pm 0 . 0 2$ and a speedup of $0 . 2 1 \pm 0 . 0 4$ . Compared to its performance in the test-1 set, the HP baseline suffers a significant performance degradation in the test-2 set, which is a result of the lower goal recognition accuracy in the Watch stage.
|
| 120 |
+
|
| 121 |
+
To better understand the important factors for the effectiveness of helping, we analyze the helping behaviors exhibited in our experiments and how they affect Alice from the following aspects.
|
| 122 |
+
|
| 123 |
+
Predicting Alice’s Future Action. When coordinating with Alice, Bob should be able to predict Alice’s future actions to efficiently distribute the work and avoid conflicts (Figure 7ab).
|
| 124 |
+
|
| 125 |
+
Helping Alice’s Belief’s Update. In addition to directly achieving predicates in Alice’s goal, Bob can also help by influencing Alice’s belief update. A typical behavior is that when Bob opens containers, Alice can update her belief accordingly and find the goal object more quickly (Figure 7c). This is the main reason why Bob with random actions can sometimes help speed up the task too.
|
| 126 |
+
|
| 127 |
+
Multi-level Actions. The current baselines do not consider plans over low-level actions (e.g., pathfinding). This strategy significantly decreases the search space, but will also result in inefficient pathfinding and inability to predict other agents’ future paths. Consequently, Bob agent sometimes unintentionally blocks Alice (Figure 7d). A better AI agent should consider actions on both levels.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 8: a) Success rate (x axis) and speedup (y axis). b) Cumulative reward with real humans or with the human-like agent. c) Subjective ratings from Exp. 2. Here, Alice refers to humans or the human-like agent acting alone, whereas HP, Hybrid, and $\mathbf { H P } _ { \mathrm { R G } }$ indicate different AI agents helping either humans or the human-like agent. All results are based on the same 30 tasks in the test set.
|
| 131 |
+
|
| 132 |
+
False Belief. Actions taken by an agent may cause another agent to have false beliefs (Figure 7e).
|
| 133 |
+
|
| 134 |
+
# 6 HUMAN EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
Our ultimate goal is to build AI agents that can work with real humans. Thus, we further conduct the following two human experiments, where Alice is controlled by a real human.
|
| 137 |
+
|
| 138 |
+
Experiment 1: Human performing tasks alone. In this experiment, we recruited 6 subjects to perform tasks alone by controlling Alice. Subjects were given the same observation and action space as what the human-like agent had access to. They could click one of the visible objects (including all rooms) and select a corresponding action (e.g., “walking towards”, “open”) from a menu to perform. They could also choose to move forward or turn left/right by pressing arrow keys. We evaluated 30 tasks in the test set. Each task was performed by 2 subjects, and we used the average steps they took as the single-agent performance for that task, which is then used for computing the speedup when AI agents help humans. The performance of a single agent when being controlled by a human or by a human-like agent in these 30 tasks is shown in Fig. 8ab with the label of Alice. Human players are slightly more efficient than the human-like agent but the difference is not significant, as reported by the t-test over the number of steps they took $\bar { ( t ( 2 9 ) = - 1 . 6 3 }$ , $p = . 1 1$ ).
|
| 139 |
+
|
| 140 |
+
Experiment 2: Collaboration with real humans. This experiment evaluates how helpful AI agents are when working with real humans. We recruited 12 subjects and conducted 90 trials of human-AI collaboration using the same 30 tasks as in Exp. 1. In each trial, a subject was randomly paired with one of three baseline agents, HP, Hybrid, and $\mathbf { H P } _ { \mathrm { R G } }$ , to perform a task. After each trial, subjects were asked to rate the AI agent they just worked with on a scale of 1 to 7 based on three criteria commonly used in prior work (Hoffman, 2019): i) how much the agent knew about the true goal (1 - no knowledge, 4 - some knowledge, 7 - perfect knowledge), ii) how helpful you found the agent was (1 - hurting, 4 - neutral, 7 - very helpful), and iii) whether you would trust the agent to do its job (1 - no trust, 4 - neutral, 7 - full trust). For a fair comparison, we made sure that the random goal predictions for $\mathbf { H P } _ { \mathrm { R G } }$ were the same as the ones used in the evaluation with the human-like agent.
|
| 141 |
+
|
| 142 |
+
As shown Figure 8, the ranking of the three baseline AI agents remains the same when the humanlike agent is replaced by real humans, and the perceived performance (subjective ratings) is consistent with the objective scores. We found no significant difference in the objective metrics between helping humans and helping the human-like agent; the only exception is that, when paired with real humans, $\mathbf { H P } _ { \mathrm { R G } }$ had a higher success rate (and consequently a higher average cumulative reward). This is because humans recognized that the AI agent might have conflicting subgoals and would finish other subgoals first instead of competing over the conflicting ones with the AI agent forever, whereas the human-like agent was unable to do so. Appendix D.3 shows an example. This adaption gave humans a better chance to complete the full goal within the time limit. We provide more details of the procedures, results, and analyses of the human experiments in Appendix D.
|
| 143 |
+
|
| 144 |
+
# 7 CONCLUSION
|
| 145 |
+
|
| 146 |
+
In this work, we proposed an AI challenge to demonstrate social perception and human-AI collaboration in common household activities. We developed a multi-agent virtual environment to test an AI agent’s ability to reason about other agents’ mental states and help them in unfamiliar scenarios. Our experimental results demonstrate that the proposed challenge can systematically evaluate key aspects of social intelligence at scale. We also show that our human-like agent behaves similarly to real humans in the proposed tasks and the objects metrics are consistent with subject ratings.
|
| 147 |
+
|
| 148 |
+
Our platform opens up exciting directions of future work, such as online goal inference and direct communication between agents. We hope that the proposed challenge and virtual environment can promote future research on building more sophisticated machine social intelligence.
|
| 149 |
+
|
| 150 |
+
# ACKNOWLEDGMENTS
|
| 151 |
+
|
| 152 |
+
The information provided in this document is derived from an effort sponsored by the Defense Advanced Research Projects Agency (DARPA), and awarded to Raytheon BBN Technologies under Contract Number HR001120C0022.
|
| 153 |
+
|
| 154 |
+
# REFERENCES
|
| 155 |
+
|
| 156 |
+
Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 961–971, 2016.
|
| 157 |
+
|
| 158 |
+
Stefano V Albrecht and Peter Stone. Autonomous agents modelling other agents: A comprehensive survey and open problems. Artificial Intelligence, 258:66–95, 2018.
|
| 159 |
+
|
| 160 |
+
Bowen Baker, Ingmar Kanitscheider, Todor Markov, Yi Wu, Glenn Powell, Bob McGrew, and Igor Mordatch. Emergent tool use from multi-agent autocurricula. arXiv preprint arXiv:1909.07528, 2019.
|
| 161 |
+
|
| 162 |
+
Chris L Baker, Julian Jara-Ettinger, Rebecca Saxe, and Joshua B Tenenbaum. Rational quantitative attribution of beliefs, desires and percepts in human mentalizing. Nature Human Behaviour, 1(4): 1–10, 2017.
|
| 163 |
+
|
| 164 |
+
Nolan Bard, Jakob N Foerster, Sarath Chandar, Neil Burch, Marc Lanctot, H Francis Song, Emilio Parisotto, Vincent Dumoulin, Subhodeep Moitra, Edward Hughes, et al. The hanabi challenge: A new frontier for ai research. Artificial Intelligence, 280:103216, 2020.
|
| 165 |
+
|
| 166 |
+
Simon Brodeur, Ethan Perez, Ankesh Anand, Florian Golemo, Luca Celotti, Florian Strub, Jean Rouat, Hugo Larochelle, and Aaron C. Courville. Home: a household multimodal environment. CoRR, abs/1711.11017, 2017. URL http://arxiv.org/abs/1711.11017.
|
| 167 |
+
|
| 168 |
+
Cameron B Browne, Edward Powley, Daniel Whitehouse, Simon M Lucas, Peter I Cowling, Philipp Rohlfshagen, Stephen Tavener, Diego Perez, Spyridon Samothrakis, and Simon Colton. A survey of monte carlo tree search methods. IEEE Transactions on Computational Intelligence and AI in games, 4(1):1–43, 2012.
|
| 169 |
+
|
| 170 |
+
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, pp. 961–970, 2015.
|
| 171 |
+
|
| 172 |
+
Micah Carroll, Rohin Shah, Mark K Ho, Tom Griffiths, Sanjit Seshia, Pieter Abbeel, and Anca Dragan. On the utility of learning about humans for human-ai coordination. In Advances in Neural Information Processing Systems, pp. 5175–5186, 2019.
|
| 173 |
+
|
| 174 |
+
Devendra Singh Chaplot, Kanthashree Mysore Sathyendra, Rama Kumar Pasumarthi, Dheeraj Rajagopal, and Ruslan Salakhutdinov. Gated-attention architectures for task-oriented language grounding. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 175 |
+
|
| 176 |
+
Wongun Choi and Silvio Savarese. Understanding collective activitiesof people from videos. IEEE transactions on pattern analysis and machine intelligence, 36(6):1242–1257, 2013.
|
| 177 |
+
|
| 178 |
+
Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 2054–2063, 2018.
|
| 179 |
+
|
| 180 |
+
Kerstin Dautenhahn. Socially intelligent robots: dimensions of human–robot interaction. Philosophical transactions of the royal society B: Biological sciences, 362(1480):679–704, 2007.
|
| 181 |
+
|
| 182 |
+
David F Fouhey, Wei-cheng Kuo, Alexei A Efros, and Jitendra Malik. From lifestyle vlogs to everyday interactions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4991–5000, 2018.
|
| 183 |
+
|
| 184 |
+
Chuang Gan, Jeremy Schwartz, Seth Alter, Martin Schrimpf, James Traer, Julian De Freitas, Jonas Kubilius, Abhishek Bhandwaldar, Nick Haber, Megumi Sano, Kuno Kim, Elias Wang, Damian Mrowca, Michael Lingelbach, Aidan Curtis, Kevin Feigelis, Daniel M. Bear, Dan Gutfreund, David Cox, James J. DiCarlo, Josh McDermott, Joshua B. Tenenbaum, and Daniel L. K. Yamins. Threedworld: A platform for interactive multi-modal physical simulation, 2020.
|
| 185 |
+
|
| 186 |
+
Xiaofeng Gao, Ran Gong, Tianmin Shu, Xu Xie, Shu Wang, and Song-Chun Zhu. Vrkitchen: an interactive 3d virtual environment for task-oriented learning. arXiv, abs/1903.05757, 2019.
|
| 187 |
+
|
| 188 |
+
Michael A Goodrich and Alan C Schultz. Human-robot interaction: a survey. Foundations and trends in human-computer interaction, 1(3):203–275, 2007.
|
| 189 |
+
|
| 190 |
+
Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. IQA: visual question answering in interactive environments. CoRR, abs/1712.03316, 2017. URL http://arxiv.org/abs/1712.03316.
|
| 191 |
+
|
| 192 |
+
Barbara Grosz and Sarit Kraus. Collaborative plans for complex group action. Artificial Intelligence, 1996.
|
| 193 |
+
|
| 194 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 195 |
+
|
| 196 |
+
Guy Hoffman. Evaluating fluency in human–robot collaboration. IEEE Transactions on HumanMachine Systems, 49(3):209–218, 2019.
|
| 197 |
+
|
| 198 |
+
Mostafa S Ibrahim, Srikanth Muralidharan, Zhiwei Deng, Arash Vahdat, and Greg Mori. A hierarchical deep temporal model for group activity recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1971–1980, 2016.
|
| 199 |
+
|
| 200 |
+
Max Jaderberg, Wojciech M. Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia 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 3d multiplayer games with population-based reinforcement learning. Science, 364(6443):859–865, 2019.
|
| 201 |
+
|
| 202 |
+
Matthew Johnson, Katja Hofmann, Tim Hutton, and David Bignell. The malmo platform for artificial intelligence experimentation. In IJCAI, pp. 4246–4247, 2016.
|
| 203 |
+
|
| 204 |
+
Henry A Kautz. A formal theory of plan recognition and its implementation. Reasoning about plans, pp. 69–125, 1991.
|
| 205 |
+
|
| 206 |
+
Kris M Kitani, Brian D Ziebart, James Andrew Bagnell, and Martial Hebert. Activity forecasting. In European Conference on Computer Vision, pp. 201–214. Springer, 2012.
|
| 207 |
+
|
| 208 |
+
Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. AI2-THOR: An Interactive 3D Environment for Visual AI. arXiv, 2017.
|
| 209 |
+
|
| 210 |
+
Richard E Korf. Planning as search: A quantitative approach. Artificial intelligence, 33(1):65–88, 1987.
|
| 211 |
+
|
| 212 |
+
Yuan-Hong Liao, Xavier Puig, Marko Boben, Antonio Torralba, and Sanja Fidler. Synthesizing environment-aware activities via activity sketches. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6291–6299, 2019.
|
| 213 |
+
|
| 214 |
+
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.
|
| 215 |
+
|
| 216 |
+
Dipendra Kumar Misra, Andrew Bennett, Valts Blukis, Eyvind Niklasson, Max Shatkhin, and Yoav Artzi. Mapping instructions to actions in 3d environments with visual goal prediction. CoRR, abs/1809.00786, 2018. URL http://arxiv.org/abs/1809.00786.
|
| 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, 2016.
|
| 219 |
+
|
| 220 |
+
Stefanos Nikolaidis, Ramya Ramakrishnan, Keren Gu, and Julie Shah. Efficient model learning from joint-action demonstrations for human-robot collaborative tasks. In 2015 10th ACM/IEEE International Conference on Human-Robot Interaction (HRI), pp. 189–196. IEEE, 2015.
|
| 221 |
+
|
| 222 |
+
OpenAI. Openai five. https://blog.openai.com/openai-five/, 2018.
|
| 223 |
+
|
| 224 |
+
Xavier Puig, Kevin Ra, Marko Boben, Jiaman Li, Tingwu Wang, Sanja Fidler, and Antonio Torralba. Virtualhome: Simulating household activities via programs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8494–8502, 2018.
|
| 225 |
+
|
| 226 |
+
Neil C Rabinowitz, Frank Perbet, H Francis Song, Chiyuan Zhang, SM Eslami, and Matthew Botvinick. Machine theory of mind. arXiv preprint arXiv:1802.07740, 2018.
|
| 227 |
+
|
| 228 |
+
Miquel Ramırez and Hector Geffner. Plan recognition as planning. In Proceedings of the 21st international joint conference on Artifical intelligence. Morgan Kaufmann Publishers Inc, pp. 1778–1783, 2009.
|
| 229 |
+
|
| 230 |
+
Cinjon Resnick, Wes Eldridge, David Ha, Denny Britz, Jakob Foerster, Julian Togelius, Kyunghyun Cho, and Joan Bruna. Pommerman: A multi-agent playground. arXiv preprint arXiv:1809.07124, 2018.
|
| 231 |
+
|
| 232 |
+
Leonel Rozo, Sylvain Calinon, Darwin G Caldwell, Pablo Jimenez, and Carme Torras. Learning physical collaborative robot behaviors from human demonstrations. IEEE Transactions on Robotics, 32(3):513–527, 2016.
|
| 233 |
+
|
| 234 |
+
Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Phil ip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2186–2188, 2019.
|
| 235 |
+
|
| 236 |
+
Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In Proceedings of the IEEE International Conference on Computer Vision, pp. 9339– 9347, 2019.
|
| 237 |
+
|
| 238 |
+
Mohit Shridhar, Jesse Thomason, Daniel Gordon, Yonatan Bisk, Winson Han, Roozbeh Mottaghi, Luke Zettlemoyer, and Dieter Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. arXiv preprint arXiv:1912.01734, 2019.
|
| 239 |
+
|
| 240 |
+
Tianmin Shu and Yuandong Tian. $\textbf { M } ^ { 3 } \textbf { r l }$ : Mind-aware multi-agent management reinforcement learning. arXiv preprint arXiv:1810.00147, 2018.
|
| 241 |
+
|
| 242 |
+
Tianmin Shu, Dan Xie, Brandon Rothrock, Sinisa Todorovic, and Song Chun Zhu. Joint inference of groups, events and human roles in aerial videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4576–4584, 2015.
|
| 243 |
+
|
| 244 |
+
Tianmin Shu, Caiming Xiong, and Richard Socher. Hierarchical and interpretable skill acquisition in multi-task reinforcement learning. arXiv preprint arXiv:1712.07294, 2017.
|
| 245 |
+
|
| 246 |
+
Michael Shum, Max Kleiman-Weiner, Michael L Littman, and Joshua B Tenenbaum. Theory of minds: Understanding behavior in groups through inverse planning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 6163–6170, 2019.
|
| 247 |
+
|
| 248 |
+
Gunnar A Sigurdsson, Abhinav Gupta, Cordelia Schmid, Ali Farhadi, and Karteek Alahari. Charades-ego: A large-scale dataset of paired third and first person videos. arXiv preprint arXiv:1804.09626, 2018.
|
| 249 |
+
Joseph Suarez, Yilun Du, Phillip Isola, and Igor Mordatch. Neural mmo: A massively multiagent game environment for training and evaluating intelligent agents. arXiv preprint arXiv:1903.00784, 2019.
|
| 250 |
+
Tijmen Tieleman and Geoffrey Hinto. Lecture 6.5—rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 251 |
+
Tomer Ullman, Chris Baker, Owen Macindoe, Owain Evans, Noah Goodman, and Joshua B Tenenbaum. Help or hinder: Bayesian models of social goal inference. In Advances in neural information processing systems, pp. 1874–1882, 2009.
|
| 252 |
+
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.
|
| 253 |
+
Felix Warneken and Michael Tomasello. Altruistic helping in human infants and young chimpanzees. Science, 311(5765):1301–1303, 2006.
|
| 254 |
+
Erik Wijmans, Samyak Datta, Oleksandr Maksymets, Abhishek Das, Georgia Gkioxari, Stefan Lee, Irfan Essa, Devi Parikh, and Dhruv Batra. Embodied question answering in photorealistic environments with point cloud perception. CoRR, abs/1904.03461, 2019. URL http: //arxiv.org/abs/1904.03461.
|
| 255 |
+
Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv preprint arXiv:1801.02209, 2018.
|
| 256 |
+
Fei Xia, Amir R Zamir, Zhiyang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson env: Real-world perception for embodied agents. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9068–9079, 2018.
|
| 257 |
+
Yuke Zhu, Daniel Gordon, Eric Kolve, Dieter Fox, Li Fei-Fei, Abhinav Gupta, Roozbeh Mottaghi, and Ali Farhadi. Visual semantic planning using deep successor representations. In Proceedings of the IEEE International Conference on Computer Vision, pp. 483–492, 2017.
|
| 258 |
+
|
| 259 |
+
# A VIRTUALHOME-SOCIAL
|
| 260 |
+
|
| 261 |
+
# A.1 COMPARISON WITH EXISTING PLATFORMS
|
| 262 |
+
|
| 263 |
+
There have been many virtual environments designed for single-agent and multi-agent tasks. Table 1 summarizes the key features of the proposed VirtualHome-Social in comparison with existing virtual platforms. The key features of our environment include i) multiple camera views, ii) both high-level and low-level actions, iii) humanoid avatars with realistic motion simulations, iv) built-in human-like agents emulating human behaviors in household activities, and v) multi-agent capacities.
|
| 264 |
+
|
| 265 |
+
Critically, VirtualHome-Social enables collecting and displaying human activities in realistic environments, which is a key function necessarily for social perception and human-AI collaboration. In contrast, existing multi-agent platforms do no offer such functionality.
|
| 266 |
+
|
| 267 |
+
Table 1: We compare VirtualHome-Social with existing embodied single-agent and multi-agent platforms on the following aspects: 1) action space (high-level actions and/or low-level actions), 2) views (3rd person and/or egocentric views), 3) realistic environments, 4) humanoid agents, 5) human-like built-in agents that other agents can interact with, and 6) multi-agent capabilities.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Platform</td><td>Action</td><td>Views</td><td>Realistic</td><td>Humanoid</td><td>Human-like Agent</td><td>Multi-agent</td></tr><tr><td>Overcooked (Carroll et al.,2019)</td><td>High/Low</td><td>3rdPerson</td><td>No</td><td>No</td><td>Yes</td><td>Yes</td></tr><tr><td>Malmo (Johnson et al.,2016)</td><td>High/Low</td><td>3rd Person/Ego</td><td>No</td><td>No</td><td>No</td><td>Yes</td></tr><tr><td>ThreeDWorld (Gan etal.,2020)</td><td>High/Low</td><td>3rd Person/Ego</td><td>Yes</td><td>No</td><td>No</td><td>Yes</td></tr><tr><td>VRKitchen (Gao et al.,2019)</td><td>High/Low</td><td>3rd Person/Ego</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td></tr><tr><td>AI2-THOR (Kolve et al.,2017)</td><td>High/Low</td><td>Ego</td><td>Yes</td><td>No</td><td>No</td><td>Yes</td></tr><tr><td>House3D(Wu et al.,2018)</td><td>Low</td><td>Ego</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>HoME (Brodeur et al.,2017)</td><td>Low</td><td>Ego</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>Gibson (Xia et al.,2018)</td><td>Low</td><td>Ego</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>AI Habitat (Savva et al., 2019)</td><td>Low</td><td>Ego</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>VirtualHome-Social</td><td>High/Low</td><td>3rd Person/Ego</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></table>
|
| 270 |
+
|
| 271 |
+
# A.2 ENVIRONMENT DESCRIPTION
|
| 272 |
+
|
| 273 |
+
The environment is composed of different apartments with objects that can be placed to generate diverse scenes for the Watch and Help stages. Each object contains a class name, a set of states, 3D coordinates and an index for identification, which is needed for action commands that involve object interaction. The object indices are unique and consistent in the scene so that an agent can track the identities of individual objects throughout an episode.
|
| 274 |
+
|
| 275 |
+
# A.2.1 APARTMENTS
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
|
| 279 |
+
Figure 9: Apartments used in VirtualHome-Social. The last two apartments are uniquely used as helping environments during the testing phase.
|
| 280 |
+
|
| 281 |
+
We provide 7 distinctive apartments in total as shown in Figure 9. For the purpose of testing agents’ generalization abilities, in the Watch-And-Help challenge, the last two apartments are held out for the helping environments in the testing set exclusively.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 10: Avatars available in VirtualHome-Social.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 11: a) VirtualHome-Social provides egocentric views, third-person views and scene graphs with symbolic state representations of objects and agents. It also offers multi-modal inputs (RGB, segmentation, depth, 3D boxes and skeletons). b) Illustration of the action space at one step.
|
| 288 |
+
|
| 289 |
+
# A.2.2 AVATARS
|
| 290 |
+
|
| 291 |
+
VirtualHome-Social provides a pool of diverse humanoid avatars (see Figure 10). This allows us to randomly sample different avatars for both agents in the Watch-And-Help challenge. We hope this can help reduce the biases in the environment. The supplementary video shows an example of this, where the clothing color indicates the role of each agent. For the public release of the platform, we intend to further increase the diversity of the avatar pool.
|
| 292 |
+
|
| 293 |
+
# A.2.3 OBSERVATION
|
| 294 |
+
|
| 295 |
+
The environment supports symbolic and visual observations (Figure 11a), allowing agents to learn helping behaviors under different conditions. The visual observations provide RGB, depth, semantic and instance segmentation, albedo and luminance, normal maps, 3D skeletons and bounding boxes. Building upon Liao et al. (2019), we represent the symbolic observations as a state graph with each node representing the class label and physical state of an object, and each edge representing the spatial relation of two objects. The environment also provides multiple views and supports both full observability and partial observability settings.
|
| 296 |
+
|
| 297 |
+
We show examples of the observations in the supplementary video. In addition to the world states, our system also allows users to include direct messages from other agents as part of the observation for an agent.
|
| 298 |
+
|
| 299 |
+
# A.2.4 ACTION SPACE
|
| 300 |
+
|
| 301 |
+
As shown in Figure 11b, agents in VirtualHome-Social can perform both high-level actions, such as navigating towards a known location, or interacting with an observed object, and low-level actions, such as turning or moving forward for a small step. For actions involving interactions with entities (objects or other agents), an agent needs to specify the indices of the intended entities (e.g., “grab $\langle 3 \rangle ^ { \ast }$ stands for grabbing the object with id 3). An agent can only interact with objects that are within its field of sight, and therefore its action space changes at every step. When executing navigation actions, an agent can only move 1 meter towards the target location within one step. On average, an agent’s action space includes 167 different actions per step.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 12: Schematic of the human-like agent. Based on the state graph sampled from the belief, the hierarchical planner searches for a high-level plan over subgoals using MCTS; then RP searches for a low-level plan over actions for each subgoal. The first action of each plan is sent back to the environment for execution.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 13: The agent’s belief is represented as the location distribution of objects, and is updated at each step based on the previous belief and the latest observation. In the example, the open cabinet reveals that the wine glass can not be in there, and that there is an apple inside, updating the belief accordingly.
|
| 308 |
+
|
| 309 |
+
# A.3 HUMAN-LIKE AGENT
|
| 310 |
+
|
| 311 |
+
We discuss how the human-like agent works in more details here. The agent pipeline can be seen in Figure 12. The agent has access to a partial observation of the environment, limited to the objects that are in the same room and not in some closed container. The agent is equipped with a belief module (Figure 13), that gives information about the unseen objects, under the assumption that the existence of objects in the environment is known, but not their location. For each object in the environment, the belief contains a distribution of the possible locations where it could be. We adopt uniform distributions as the initial belief when the agent has not observed anything.
|
| 312 |
+
|
| 313 |
+
At each time, the agent obtains a partial observation, and updates its belief distribution accordingly. Then, the belief module samples a possible world state from the current distribution. To ensure that the belief state is consistent between steps, we only resample object locations that violate the current belief (e.g. an object was believed to be in the fridge but the agent sees that the fridge is in fact empty).
|
| 314 |
+
|
| 315 |
+
Based on the sampled state, a hierarchical planner will search for the optimal plan for reaching the goal, based on the goal definition. Specifically, we use MCTS to search for a sequence of subgoals (i.e., predicates), and then each subgoal is fed to a regression planner (RP) that will search for an action sequence to achieve the subgoal. For the high-level planner, the subgoal space is obtained by the intersection between what predicates remained to be achieved and what predicates could be achieved based on the sampled state. Note here each subgoal would specify an object instance instead of only the object class defined in the goal so that the low-level planner will be informed which object instances it needs to interact with. For instance, in the example illustrated in Figure 12, there are two plates (whose indices are 12, 52) and the dinner table’s index is 31 according to the sampled state. There are two unsatisfied goal predicates (i.e., two ON(plate, dinnertable)), then a possible subgoal space for the high-level planner would be $\left\{ \operatorname { O N } \left( 1 2 , \quad 3 1 \right) , \operatorname { O N } \left( 5 2 , \quad 3 1 \right) \right\} .$ For RP, it starts from the state defined by the subgoal and searches for the low-level plan backward until it finds an action that is part of the current action space of the agent.
|
| 316 |
+
|
| 317 |
+
To mimic human behaviors in a home setting, we also expect the human-like agent to close containers unless it needs to look inside or put objects into them. For that, we augment the MCTS-based high-level planner with heuristics for the closing behavior – the agent will close an container when it finds no relevant goal objects inside or has already grabbed/put in the all target objects out of that container. We find that this augmentation makes the overall agent behaviors closer to what a real human would do in a household environment.
|
| 318 |
+
|
| 319 |
+
Thanks to the hierarchical design, the planner for the human-like agent can be run in real-time (on average, replanning at each step only takes 0.05 second). This also gives the agent a bounded rationality, in that the plan is not the most optimal but is reasonably efficient. The optimality of the planner can be further tuned by the hyper-parameters of MCTS, such as the number of simulation, the maximum number steps in the rollouts, and the exploration coefficients.
|
| 320 |
+
|
| 321 |
+
# A.4 SPECIFICATIONS
|
| 322 |
+
|
| 323 |
+
The environment can be run in a single or multiple processes. A single process runs at 10 actions per second. We train our models using 10 processes in parallel.
|
| 324 |
+
|
| 325 |
+
# B MORE DETAILS ON THE CHALLENGE SETUP
|
| 326 |
+
|
| 327 |
+
# B.1 PREDICATE SETS FOR GOAL DEFINITIONS
|
| 328 |
+
|
| 329 |
+
Table 2: Predicate sets used for defining the goal of Alice in five types of activities.
|
| 330 |
+
|
| 331 |
+
<table><tr><td rowspan=1 colspan=1>Setup a dinner table</td><td rowspan=1 colspan=1>ON(plate,dinnertable),ON(fork,dinnertable),ON(waterglass,dinnertable),ON(wineglass,dinnertable)</td></tr><tr><td rowspan=1 colspan=1>Put groceries</td><td rowspan=1 colspan=1>IN(cupcake,fridge),IN(pancake,fridge),IN(poundcake,fridge),IN(pudding,fridge),IN(apple,fridge),IN(juice,fridge),IN(wine,fridge)</td></tr><tr><td rowspan=1 colspan=1>Preparea meal</td><td rowspan=1 colspan=1>ON(coffeepot,dinnertable),ON(cupcake,dinnertable),ON(pancake,dinnertable),ON(poundcake,dinnertable),ON(pudding,dinnertable),ON(apple,dinnertable),ON(juice,dinnertable),ON(wine,dinnertable)</td></tr><tr><td rowspan=1 colspan=1>Wash dishes</td><td rowspan=1 colspan=1>IN(plate,dishwasher),IN(fork,dishwasher),IN(waterglass,dishwasher),IN(wineglass,dishwasher)</td></tr><tr><td rowspan=1 colspan=1>Readabook</td><td rowspan=1 colspan=1>HOLD(Alice,book),SIT(Alice,sofa),ON(cupcake,coffeetable),ON(pudding,coffeetable),ON(apple,coffeetable),ON(juice,coffeetable),ON(wine,coffeetable)</td></tr></table>
|
| 332 |
+
|
| 333 |
+
Table 2 summarizes the five predicate sets used for defining goals. Note that VirtualHome-Social supports more predicates for potential future extensions on the goal definitions.
|
| 334 |
+
|
| 335 |
+
# B.2 TRAINING AND TESTING SETUP
|
| 336 |
+
|
| 337 |
+
During training, we randomly sample one of the 1011 training tasks for setting up a training episode. For evaluating an AI agent on the testing set, we run each testing task for five times using different random seeds and report the average performance.
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 14: Initial location distributions of all objects in the environment. Rows are objects and columns are locations. The color indicates the frequency.
|
| 341 |
+
|
| 342 |
+
For training goal inference, we also provide an additional training set of 5303 demonstrations (without pairing helping environments) synthesized in the 5 training apartments. Note that these demonstrations are exclusively used for training goal inference models and would not be used for helping tasks.
|
| 343 |
+
|
| 344 |
+
# B.3 DISTRIBUTION OF INITIAL OBJECT LOCATIONS
|
| 345 |
+
|
| 346 |
+
Figure 14 shows the initial location distribution of all objects in the helping environments sampled for the challenge, and Figure 15 shows the initial location distributions for only the objects involved in the goal predicates.
|
| 347 |
+
|
| 348 |
+
# C IMPLEMENTATION DETAILS OF BASELINES
|
| 349 |
+
|
| 350 |
+
# C.1 GOAL INFERENCE MODULE
|
| 351 |
+
|
| 352 |
+
Figure 16 shows the architecture of the goal inference model described in the paper, where $d = 1 2 8$ indicates the dimension of vectors. In this network, the LSTM has 128 hidden units and the MLP units are comprised of two 128-dim fully connected layers. For both node embeddings and the latent states from the LSTM, we use average pooling.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 15: Initial location distributions of the goal objects. Rows are objects and columns are locations. The color indicates the frequency.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 16: Network architecture of the goal inference model, which encodes the symbolic state sequence in demonstrations and infers the count for each predicate.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 17: Network architecture of the low-level policy in the HRL baseline. Note that the object selection policy also considers “Null” as a dummy object node for actions that do not involve an object, which is not visualized here.
|
| 362 |
+
|
| 363 |
+
# C.2 HIERARCHICAL PLANNER
|
| 364 |
+
|
| 365 |
+
The hierarchical planner (HP) baseline is similar to the planner designed for the human-like agent (Section A.3) but has its own observation and belief. When given the ground-truth goal of Alice, the MCTS-based high-level planner will remove the subgoal that Alice is going to pursue from its own subgoal space.
|
| 366 |
+
|
| 367 |
+
# C.3 GENERAL TRAINING PROCEDURE FOR RL-BASED APPROACHES
|
| 368 |
+
|
| 369 |
+
We train the high-level RL policy by giving ground-truth goals and by using RP as the low-level planner to reach the subgoals sampled from the high-level policy. Whenever a goal predicate is satisfied (either by Alice or by Bob), Bob will get a reward of $+ 2$ ; it will also get a -0.1 penalty after each time step. We adopt the multi-task RL approach introduced in Shu et al. (2017) to train the lowlevel policy in a single-agent setting, where we randomly sample one of the predicates in the goal in each training episode and set it to be the objective for Bob. This is to ensure that Bob can learn to achieve subgoals through the low-level policy by himself. The HRL baseline is implemented by combining the high-level and low-level policies that are trained separately.
|
| 370 |
+
|
| 371 |
+
# C.4 LOW-LEVEL POLICY
|
| 372 |
+
|
| 373 |
+
Figure 17 illustrates the network architecture for the low-level policy. We use the symbolic observation (only the visible object nodes) as input, and encode them in the same way as Figure 16 does. We encode two object classes in the given subgoal $s g$ (i.e., a predicate) through word2vec encoding yielding two 128-dim vectors. We then concatenate these two vectors and feed them to a fully connected layer to get a 128-dim goal encoding. Based on the goal encoding, we further get two attention vectors, $\sigma _ { \mathrm { { o b j e c t } } }$ and $\sigma _ { \mathrm { t y p e } }$ . Each element of the attention vectors ranges from 0 to 1. For each object node, we use the element-wise product of $\sigma _ { \mathrm { { o b j e c t } } }$ and its node embedding to get its reshaped representation. Similarly, we can get the reshaped context representation by an element-wise product of the context embedding and $\sigma _ { \mathrm { t y p e } }$ . This is inspired by a common goal-conditioned policy network architecture (Chaplot et al., 2018; Shu et al., 2017), which helps extract state information relevant to the goal. From each reshaped node representation, we can get a scalar for each object representing the log-likelihood of selecting that object to interact with for the current action. After a softmax over all the object logits, we get the object selection policy $\pi _ { \mathrm { o b j e c t } } ( k | o ^ { t } , s g )$ , where $k$ is the index of the object instance selected from all visible objects (which also includes “Null” for actions that do not involve an object). For encoding the history, we feed the reshaped context representation to an LSTM with 128 hidden units. Based on the latent state from the LSTM, we get i) the action type policy $\pi _ { \mathrm { t y p e } } ( a | o ^ { t } , s g )$ , which selects an action type (i.e., “open,” “close,” “grab,” “put,” “walk,”
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 18: Network architecture the high-level policy for the Hybrid and the HRL baselines.
|
| 377 |
+
|
| 378 |
+
or “follow”), and ii) the value function $V ( o ^ { t } , s g )$ . The sampled $k$ and $a$ jointly define the action for the AI agent. Note that some sampled combinations may not be valid actions, which will not be executed by the VirtualHome-Social environment.
|
| 379 |
+
|
| 380 |
+
In addition to the policy and value output, we also build a binary classifier for each visible node to predict whether it is close enough for the agent to interact with according to the symbolic graphs. This closeness prediction serves an auxiliary prediction which helps the network learn a better state representation and consequently greatly improves the sample efficiency.
|
| 381 |
+
|
| 382 |
+
In each training episode, we randomly sample a predicate from the complete goal definition as the final goal of the agent. The agent gets a reward of 0.05 for being close to the target object and/or location, and a reward of 10.0 when it grabs the correct object or puts it to the correct location. Note that when training the low-level policy, we set up a single-agent environment to ensure that the AI agent can learn to achieve a predicate by itself.
|
| 383 |
+
|
| 384 |
+
We adopt a 2-phase curriculum learning similar to Shu et al. (2017): In the first phase, we train a policy for grabbing the target object indicated in the goal. During this phase, a training episode terminates whenever the agent grabs the correct type of object. In the second phase, we train another policy which learns to reuse the learned grabbing policy (which is deployed whenever the “grab” action type is sampled) to get the goal object and then put the grabbed object to target location specified in the goal.
|
| 385 |
+
|
| 386 |
+
We use off-policy advantage actor-critic (A2C) (Mnih et al., 2016) for policy optimization. The network is updated by RMSprop (Tieleman & Hinto, 2012) with a learning rate of 0.001 and a batch size of 32. The first phase is trained with 100,000 episodes and the second phase is trained with 26,000 episodes.
|
| 387 |
+
|
| 388 |
+
# C.5 HIGH-LEVEL POLICY
|
| 389 |
+
|
| 390 |
+
As Figure 18 depicts, the high-level policy (used by Hybrid and HRL baselines) has a similar architecture design as the low-level policy. Compared with the low-level policy, it does not need to define object selection policy; instead, based on the latent state from the LSTM, it outputs the policy for selecting the first and the second object class in a predicate to form a subgoal3. It also augments the goal encoder in the low-level policy with a sum pooling (i.e., Bag of Words) to aggregate the encoding of all predicates in a goal, where predicates are duplicated w.r.t. their counts in the goal definition (e.g., in Figure 18, ON(plate, dinnertable) appears twice, which means there are should be 2 plates on the dinnertable). Similar to the low-level policy, we get an attention vector $\sigma _ { g }$ from the goal encoding to reshape the state representation. In total, the network has three outputs: the object subgoal policy for sampling the object class name in the subgoal, the location subgoal policy for sampling the target location class name in the subgoal, and a value function.
|
| 391 |
+
|
| 392 |
+

|
| 393 |
+
Figure 19: Success rate $\mathbf { \dot { x } }$ axis) and speedup (yaxis) of all the baselines and oracles
|
| 394 |
+
|
| 395 |
+
The high-level policy is trained with a regression planner deployed to find a low-level plan for reaching that subgoal. Note that the regression planner searches for a plan based on a state sampled from the agent’s belief maintained by a belief module discussed in Section A.3. It will also randomly select object instances from the sampled state that fit the defined object classes in the subgoals sampled from the high-level policy.
|
| 396 |
+
|
| 397 |
+
Similar to the low-level policy, we use off-policy A2C for policy optimization, and the network is updated by RMSprop with a learning rate of 0.001 and a batch size of 16. We first train the highlevel policy in a single-agent setting where the AI agent is trained to perform a task by itself; we then finetune the high-level policy in the full training setting where the human-like agent is also present and works alongside with the AI agent. During training, we always provide the ground-truth goal of Alice to the AI agent.
|
| 398 |
+
|
| 399 |
+
# D ADDITIONAL DETAILS OF HUMAN EXPERIMENTS
|
| 400 |
+
|
| 401 |
+
# D.1 HUMAN SUBJECTS
|
| 402 |
+
|
| 403 |
+
Both the collection of human plans as well as the evaluations in our user studies were conducted by recruited participants, who gave informed consent.
|
| 404 |
+
|
| 405 |
+
# D.2 PROCEDURE FOR COLLECTING HUMAN PLANS
|
| 406 |
+
|
| 407 |
+
To collect the tasks for both experiments, we built a web interface on top of VirtualHome-Social, allowing humans to control the characters in the environment. Specifically, the subjects in our human experiments were always asked to control Alice. At every step, humans were given a set of visible objects, and the corresponding actions that they could perform with those objects (in addition to the low-level actions), matching the observation and action space of the human-like agent. When working with an AI agent, both the human player and the AI agent took actions concurrently.
|
| 408 |
+
|
| 409 |
+
In both experiments, human players were given a short tutorial and had a chance to get familiar with the controls. They were shown the exact goals to be achieved, and were instructed to finish the task as fast as possible. For each task, we set the same time limit, i.e., 250 steps. A task is terminated when it exceeds the time limit or when all the goals specified have been reached.
|
| 410 |
+
|
| 411 |
+
The 30 tasks used in the human experiments were randomly sampled from the test set and were evenly distributed across 5 task categories (i.e., 6 tasks for each category).
|
| 412 |
+
|
| 413 |
+
In Experiment 2, each subject was asked to perform 7 or 8 trials. We made sure that each subject got to play with all three baseline AI agents in at least 2 trials.
|
| 414 |
+
|
| 415 |
+
# D.3 EXAMPLE OF HUMAN ADAPTING TO AI AGENTS WITH CONFLICTING GOALS
|
| 416 |
+
|
| 417 |
+
The main reason why real humans work better than the human-like agent when paired with an AI agent that has a conflicting goal (in particular, the $\mathbf { H P } _ { \mathrm { R G } }$ baseline), is that they can recognize the conflicting goal, and avoid competing over the same objects forever. Figure 20 depicts an example of this adaptive behavior from a real human player in Experiment 2, which results in the completion of the task within the time limit. Note that in our experiments, a task is considered successful and terminated once all the predicates in a goal have been achieved.
|
| 418 |
+
|
| 419 |
+
This also calls for an AI agent with the ability to adjust its goal inference dynamically by observing Alice’s behavior in the new environment (e.g., Alice correcting a mistake made by Bob signals incorrect goal inference).
|
| 420 |
+
|
| 421 |
+
# D.4 SUBJECTIVE EVALUATION OF SINGLE AGENT PLANS
|
| 422 |
+
|
| 423 |
+
To evaluate whether people think the human-like agent behaves similarly to humans given the same goals, we recruited another 8 subjects. We showed each subject 15 videos, each of which is a video replay of a human or the human-like agent performing one of the 30 tasks (we randomly selected one human video and one built-in agent video for each task). For each video, subjects were given the goal and asked to rate how much they agreed with the statement, “the character in the video behaves similarly to a human given the same goal in this apartment,” on a Likert scale of 5 (1 is “strongly disagree,” 3 is “neutral,” and 5 is “strongly agree”)4. The average ratings for the characters controlled by the human-like agent and by the real humans are 3.38 $( \pm 0 . 9 3 )$ and 3.7 $: ( \pm 0 . 9 2 ) $ respectively. We found no significant difference between the ratings for the human-like agent’s plans and the ratings for the real humans’ plans in our tasks, as reported by a paired, two-tailed t-test $( t ( 2 9 ) = - 1 . 3 \bar { 5 }$ , $p = . 1 9 ,$ ). This demonstrates that the proposed human-like agent can produce plans that are similar to real humans’ plans in our challenge.
|
| 424 |
+
|
| 425 |
+
Based on the free responses collected from the subjects who rated these videos, human plans look slightly more efficient sometimes since they do not look for objects in unlikely places and avoid moving back and forth between rooms frequently. The human-like agent behaves similarly in most of the time but would occasionally search through the rooms in a counter-intuitive order due to its bounded rationality and the fact that plans are sampled stochastically.
|
| 426 |
+
|
| 427 |
+
# D.5 ADDITIONAL QUANTITATIVE ANALYSES OF HUMAN EXPERIMENT RESULTS
|
| 428 |
+
|
| 429 |
+
To evaluate whether the performance of a baseline AI agent helping the human-like agent reflects the performance of it helping real humans, we conduct paired, two-tailed t-test for the three baselines in Experiment 2 based on their cumulative rewards. For $\mathbf { H P } _ { \mathrm { R G } }$ , there is a significant difference between helping the human-like agent and helping real humans $( t ( 2 9 ) = - 2 . 3 6$ , $p = . 0 3 ,$ ) as discussed in Section 6 and Appendix D.3. However, there is no significant difference for HP $( t ( 2 9 ) = - 1 . 7 8$ , $p = . 1 ,$ ) and Hybrid ( $( t ( 2 9 ) = - 0 . 5$ , $p = . 6 2 )$ ). This validates that, in general, collaboration with
|
| 430 |
+
|
| 431 |
+
# Ground-truth goal:
|
| 432 |
+
|
| 433 |
+
ON(plate, dinnertable): 1
|
| 434 |
+
ON(waterglass, dinnertable): 2
|
| 435 |
+
ON(wineglass, dinnertable): 1
|
| 436 |
+
ON(fork, dinnertable): 2
|
| 437 |
+
A random goal sampled by Bob $( { \mathsf { H P } } _ { \mathsf { R G } } )$ :
|
| 438 |
+
IN(wineglass, dishwasher): 1
|
| 439 |
+
ON(poundcake, dinnertable): 2
|
| 440 |
+
IN(pancake, fridge): 2
|
| 441 |
+
ON(wine, dinnertable): 1
|
| 442 |
+
|
| 443 |
+
# The human-like agent and HPRG
|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
Figure 20: An example of how real human differs from the human-like agent when working with an AI agent (i.e., ${ \bf H P } _ { \mathrm { R G } }$ ) with a conflicting goal. In this example, Bob incorrectly thinks that Alice wants to put the wine glass to the dishwasher whereas Alice actually wants to put it to the dinner table. When controlled by a human-like agent, Alice enters into a loop with Bob trying to change the location of the same object. The real human player, on the other hand, avoids this conflict by first focusing on other objects in the goal, and going back to the conflicting object after all the other goal objects have been placed on the dinner table. Consequently, the real human completes the full task successfully within the time limit.
|
| 447 |
+
|
| 448 |
+
the human-like agent is comparable to collaboration with real humans. Given these analyses, the training and evaluation procedure5 presented in this paper is both scalable and comprehensive.
|
md/train/wta_8Hx2KD/wta_8Hx2KD.md
ADDED
|
@@ -0,0 +1,617 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INCORPORATING SYMMETRY INTO DEEP DYNAMICS MODELS FOR IMPROVED GENERALIZATION
|
| 2 |
+
|
| 3 |
+
Rui Wang ∗
|
| 4 |
+
Computer Science and Engineering
|
| 5 |
+
University of California
|
| 6 |
+
San Diego, CA 92093
|
| 7 |
+
ruw020@ucsd.edu
|
| 8 |
+
Robin Walters \*
|
| 9 |
+
Khoury College of Computer Science
|
| 10 |
+
Northeastern University
|
| 11 |
+
Boston, MA 02115
|
| 12 |
+
r.walters@northeastern.edu
|
| 13 |
+
|
| 14 |
+
# Rose Yu
|
| 15 |
+
|
| 16 |
+
Computer Science and Engineering
|
| 17 |
+
University of California
|
| 18 |
+
San Diego, CA 92093
|
| 19 |
+
roseyu@ucsd.edu
|
| 20 |
+
|
| 21 |
+
# ABSTRACT
|
| 22 |
+
|
| 23 |
+
Recent work has shown deep learning can accelerate the prediction of physical dynamics relative to numerical solvers. However, limited physical accuracy and an inability to generalize under distributional shift limits its applicability to the real world. We propose to improve accuracy and generalization by incorporating symmetries into convolutional neural networks. Specifically, we employ a variety of methods each tailored to enforce a different symmetry. Our models are both theoretically and experimentally robust to distributional shift by symmetry group transformations and enjoy favorable sample complexity. We demonstrate the advantage of our approach on a variety of physical dynamics including Rayleigh–Bénard convection and real-world ocean currents and temperatures. Compared with image or text applications, our work is a significant step towards applying equivariant neural networks to high-dimensional systems with complex dynamics. We open-source our simulation, data and code at https://github.com/Rose-STL-Lab/Equivariant-Net.
|
| 24 |
+
|
| 25 |
+
# 1 INTRODUCTION
|
| 26 |
+
|
| 27 |
+
Modeling dynamical systems in order to forecast the future is of critical importance in a wide range of fields including, e.g., fluid dynamics, epidemiology, economics, and neuroscience [2; 21; 45; 22; 14]. Many dynamical systems are described by systems of non-linear differential equations that are difficult to simulate numerically. Accurate numerical computation thus requires long run times and manual engineering in each application.
|
| 28 |
+
|
| 29 |
+
Recently, there has been much work applying deep learning to accelerate solving differential equations [46; 6]. However, current approaches struggle with generalization. The underlying problem is that physical data has no canonical frame of reference to use for data normalization. For example, it is not clear how to rotate samples of fluid flow such that they share a common orientation. Thus real-world out-of-distribution test data is difficult to align with training data. Another limitation of current approaches is low physical accuracy. Even when mean error is low, errors are often spatially correlated, producing a different energy distribution from the ground truth.
|
| 30 |
+
|
| 31 |
+
We propose to improve the generalization and physical accuracy of deep learning models for physical dynamics by incorporating symmetries into the forecasting model. In physics, Noether’s Law gives a correspondence between conserved quantities and groups of symmetries. By building a neural network which inherently respects a given symmetry, we thus make conservation of the associated quantity more likely and consequently the model’s prediction more physically accurate.
|
| 32 |
+
|
| 33 |
+
A function $f$ is equivariant if when its input $x$ is transformed by a symmetry group $g$ , the output is transformed by the same symmetry,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
f ( g \cdot x ) = g \cdot f ( x ) .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
See Figure 1 for an illustration. In the setting of forecasting, $f$ approximates the underlying dynamical system. The set of valid transformations $g$ is called the symmetry group of the system.
|
| 40 |
+
|
| 41 |
+
By designing a model that is inherently equivariant to transformations of its input, we can guarantee that our model generalizes automatically across these transformations, making it robust to distributional shift. The symmetries we consider, translation, rotation, uniform motion, and scale, have different properties, and thus we tailor our methods for incorporating each symmetry.
|
| 42 |
+
|
| 43 |
+
Specifically, for scale equivariance, we replace the convolution operation with group correlation over the group $G$ generated by translations and rescalings. Our method builds on that of Worrall and Welling [51], with significant novel adaptations to the physics domain: scaling affecting time, space, and magnitude; both up and down scaling; and scaling by any real number. For rotational symmetries, we leverage the key insight of Cohen and Welling [9] that the input, output, and hidden layers of the network are all acted upon by the symmetry group and thus should be treated as representations of the symmetry group. Our rotation-equivariant model is built using the flexible E(2)-CNN framework developed by Weiler and Cesa [49]. In the case of a uniform motion, or Galilean transformation, we show the above methods are too constrained. We use the simple but effective technique of convolutions conjugated by averaging operations.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: Illustration of equivariance of e.g. $f ( { \bar { x } } ) = 2 x$ with respect to ${ \overline { { T } } } = \operatorname { r o t } ( \pi / 4 )$ .
|
| 47 |
+
|
| 48 |
+
Research into equivariant neural networks has mostly been applied to tasks such as image classification and segmentation [27; 50; 49]. In contrast, we design equivariant networks in a completely different context, that of a time series representing a physical process. Forecasting high-dimensional turbulence is a significant step for equivariant neural networks compared to the low-dimensional physics examples and computer vision problems treated in other works.
|
| 49 |
+
|
| 50 |
+
We test on a simulated turbulent convection dataset and on real-world ocean current and temperature data. Ocean currents are difficult to predict using numerical methods due to unknown external forces and complex dynamics not fully captured by simplified mathematical models. These domains are chosen as examples, but since the symmetries we focus on are pervasive in almost all physics problems, we expect our techniques will be widely applicable. Our contributions include:
|
| 51 |
+
|
| 52 |
+
• We study the problem of improving the generalization capability and physical accuracy of deep learning models for learning complex physical dynamics such as turbulence and ocean currents. • We design tailored methods with theoretical guarantees to incorporate various symmetries, including uniform motion, rotation, and scaling, into convolutional neural networks. • When evaluated on turbulent convection and ocean current prediction, our models achieve significant improvement on generalization of both predictions and physical consistency. • For different symmetries, our methods have an average $3 1 \%$ and maximum $7 8 \%$ reduction in energy error when evaluated on turbulent convection with no distributional shift.
|
| 53 |
+
|
| 54 |
+
# 2 MATHEMATICAL PRELIMINARIES
|
| 55 |
+
|
| 56 |
+
# 2.1 SYMMETRY GROUPS AND EQUIVARIANT FUNCTIONS
|
| 57 |
+
|
| 58 |
+
Formal discussion of symmetry relies on the concept of an abstract symmetry group. We give a brief overview, for a more formal treatment see Appendix A, or Lang [28].
|
| 59 |
+
|
| 60 |
+
A group of symmetries or simply group consists of a set $G$ together with a composition map $\circ \colon G \times G \to G$ . The composition map is required to be associative and have an identity $1 \in G$ . Most importantly, composition with any element of $G$ is required to be invertible.
|
| 61 |
+
|
| 62 |
+
Groups are abstract objects, but they become concrete when we let them act. A group $G$ has an action on a set $S$ if there is an action map · $\colon G \times S S$ which is compatible with the composition law. We say further that $S$ is a $G$ -representation if the set $S$ is a vector space and the group acts on $S$ by linear transformations.
|
| 63 |
+
|
| 64 |
+
Definition 1 (invariant, equivariant). Let $f \colon X \to Y$ be a function and $G$ be a group. Assume $G$ acts on $X$ and $Y$ . The function $f$ is $G$ -equivariant if $f ( g x ) = g f ( x )$ for all $x \in X$ and $g \in G$ . The function $f$ is $G$ -invariant if $f ( g x ) = f ( x )$ for all $x \in X$ and $g \in G$ .
|
| 65 |
+
|
| 66 |
+
# 2.2 PHYSICAL DYNAMICAL SYSTEMS
|
| 67 |
+
|
| 68 |
+
We investigate two dynamical systems: Rayleigh–Bénard convection and real-world ocean current and temperature. These systems are governed by Navier-Stokes equations.
|
| 69 |
+
|
| 70 |
+
2D Navier-Stokes (NS) Equations. Let ${ \pmb w } ( { \pmb x } , t )$ be the velocity vector field of a flow. The field $\pmb { w }$ has two components $( u , v )$ , velocities along the $x$ and $y$ directions. The governing equations for this physical system are the momentum equation, continuity equation, and temperature equation,
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\frac { \partial w } { \partial t } = - ( { \pmb w } \cdot { \nabla } ) { \pmb w } - \frac { 1 } { \rho _ { 0 } } \nabla p + \nu \nabla ^ { 2 } { \pmb w } + { \pmb f } ; \quad \nabla \cdot { \pmb w } = 0 ; \quad \frac { \partial H } { \partial t } = \kappa \Delta H - ( { \pmb w } \cdot { \nabla } ) H , ~ ( { \mathcal D } _ { \mathrm { N S } } )
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $H ( { \pmb x } , t )$ is temperature, $p$ is pressure, $\kappa$ is the heat conductivity, $\rho _ { 0 }$ is initial density, $\alpha$ is the coefficient of thermal expansion, $\nu$ is the kinematic viscosity, and $f$ is the buoyant force.
|
| 77 |
+
|
| 78 |
+
# 2.3 SYMMETRIES OF DIFFERENTIAL EQUATIONS
|
| 79 |
+
|
| 80 |
+
By classifying the symmetries of a system of differential equations, the task of finding solutions is made far simpler, since the space of solutions will exhibit those same symmetries. Let $G$ be a group equipped with an action on 2-dimensional space $X = \mathbb { R } ^ { 2 }$ and 3-dimensional spacetime $\hat { X } = \mathbb { R } ^ { 3 }$ . Let $V = \mathbb { R } ^ { d }$ be a $G$ -representation. Denote the set of all $V$ -fields on $\hat { X }$ as ${ \hat { \mathcal { F } } } _ { V } = \{ \pmb { w } : { \hat { X } } V :$ $\pmb { w }$ smooth}. Define $\mathcal { F } _ { V }$ similarly to be $V$ -fields on $X$ . Then $G$ has an induced action on $\hat { \mathcal { F } } _ { V }$ by $( g w ) ( x , t ) \bar { } = g ( \pmb { w } ( g ^ { - 1 } x , g ^ { - 1 } t ) )$ and on $\mathcal { F } _ { V }$ analogously.
|
| 81 |
+
|
| 82 |
+
Consider a system of differential operators $\mathcal { D }$ acting on $\hat { \mathcal { F } } _ { V }$ . Denote the set of solutions $\operatorname { S o l } ( { \mathcal { D } } ) \subseteq { \hat { \mathcal { F } } } _ { V }$ . We say $G$ is a symmetry group of $\mathcal { D }$ if $G$ preserves $\operatorname { S o l } ( \mathcal { D } )$ . That is, if $\varphi$ is a solution of $\mathcal { D }$ , then for all $g \in G , g ( \varphi )$ is also. In order to forecast the evolution of a system $\mathcal { D }$ , we model the forward prediction function $f$ . Let $\pmb { w } \in \mathrm { S o l } ( \mathcal { D } )$ . The input to $f$ is a collection of $k$ snapshots at times $t - k , \dots , t - 1$ denoted ${ \pmb w } _ { t - i } \in \mathcal { F } _ { d }$ . The prediction function $f \colon \mathcal { F } _ { d } ^ { k } \to \mathcal { F } _ { d }$ is defined $f ( \pmb { w } _ { t - k } , \dots , \pmb { w } _ { t - 1 } ) = \pmb { w } _ { t }$ . It predicts the solution at a time $t$ based on the solution in the past. Let $G$ be a symmetry group of $\mathcal { D }$ . Then for $g \in G$ , $g ( w )$ is also a solution of $\mathcal { D }$ . Thus $f ( g \pmb { w } _ { t - k } , . . . , g \pmb { w } _ { t - 1 } ) = g \pmb { w } _ { t }$ . Consequently, $f$ is $G$ -equivariant.
|
| 83 |
+
|
| 84 |
+
# 2.4 SYMMETRIES OF NAVIER-STOKES EQUATIONS
|
| 85 |
+
|
| 86 |
+
The Navier-Stokes equations are invariant under the following five different transformations. Individually each of these types of transformations generates a group of symmetries of the system. The full list of symmetry groups of NS equations and Heat equations are shown in Appendix B.6.
|
| 87 |
+
|
| 88 |
+
• Space translation: $T _ { c } ^ { \mathrm { s p } } \pmb { w } ( \pmb { x } , t ) = \pmb { w } ( \pmb { x } - \pmb { c } , t ) , \pmb { c } \in \mathbb { R } ^ { 2 } ,$ • Time translation: $T _ { \tau } ^ { \mathrm { t i m e } } { \pmb w } ( { \pmb x } , t ) = { \pmb w } ( { \pmb x } , t - \tau ) , \tau \in$ R , • Uniform motion: $T _ { c } ^ { \mathrm { u m } } \pmb { w } ( \pmb { x } , t ) = \pmb { w } ( \pmb { x } , t ) + c , \pmb { c } \in \mathbb { R } ^ { 2 }$ • Rotation/Reflection: $\begin{array} { r } { T _ { R } ^ { \mathrm { r o t } } { \pmb w } ( { \pmb x } , t ) = R { \pmb w } ( R ^ { - 1 } { \pmb x } , t ) , R \in O ( 2 ) , } \end{array}$ • Scaling: $T _ { \lambda } ^ { s c } { \pmb w } ( { \pmb x } , t ) = \lambda { \pmb w } ( \lambda { \pmb x } , \lambda ^ { 2 } t ) , \lambda \in \mathbb { R } _ { > 0 }$ .
|
| 89 |
+
|
| 90 |
+
# 3 METHODOLOGY
|
| 91 |
+
|
| 92 |
+
We prescribe equivariance by training within function classes containing only equivariant functions. Our models can thus be theoretically guaranteed to be equivariant up to discretization error. We incorporate equivariance into two state-of-the-art architectures for dynamics prediction, ResNet and U-net [48]. Below, we describe how we modify the convolution operation in these models for different symmetries $G$ to form four EquG-ResNet and four EquG-Unet models.
|
| 93 |
+
|
| 94 |
+
# 3.1 EQUIVARIANT NETWORKS
|
| 95 |
+
|
| 96 |
+
The key to building equivariant networks is that the composition of equivariant functions is equivariant. Hence, if the maps between layers of a neural network are equivariant, then the whole network will be equivariant. Note that both the linear maps and activation functions must be equivariant. An important consequence of this principle is that the hidden layers must also carry a $G$ -action. Thus, the hidden layers are not collections of scalar channels, but vector-valued $G$ -representations.
|
| 97 |
+
|
| 98 |
+
Equivariant Convolutions. Consider a convolutional layer $\mathcal { F } _ { \mathbb { R } ^ { d _ { \mathrm { i n } } } } \mathcal { F } _ { \mathbb { R } ^ { d _ { \mathrm { o u t } } } }$ with kernel $K$ from a $\mathbb { R } ^ { \bar { d } _ { \mathrm { i n } } }$ -field to a $\mathbb { R } ^ { d _ { \mathrm { o u t } } }$ -field. Let $\mathbb { R } ^ { d _ { \mathrm { i n } } }$ and $\mathbb { R } ^ { d _ { \mathrm { o u t } } }$ be $G$ -representations with action maps $\rho _ { \mathrm { i n } }$ and $\rho _ { \mathrm { o u t } }$ respectively. Cohen et al. [11, Theorem 3.3] prove the network is $G$ -equivariant if and only if
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
K ( g v ) = \rho _ { \mathrm { o u t } } ^ { - 1 } ( g ) K ( v ) \rho _ { \mathrm { i n } } ( g ) \qquad { \mathrm { f o r ~ a l l ~ } } g \in G .
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
A network composed of such equivariant convolutions is called a steerable CNN.
|
| 105 |
+
|
| 106 |
+
Equivariant ResNet and U-net. Equivariant ResNet architectures appear in [9; 10], and equivariant transposed convolution, a feature of U-net, is implemented in [49]. We prove in general that adding skip connections to a network does not affect its equivariance with respect to linear actions and also give a condition for ResNet or Unet to be equivariant in Appendix B.2.
|
| 107 |
+
|
| 108 |
+
Relation to Data Augmentation. To improve generalization, equivariant networks offer a better performing alternative to the popular technique of data augmentation [13]. Large symmetry groups normally require augmentation with many transformed examples. In contrast, for equivariant models, we have following proposition. (See Appendix B.1 for proof.)
|
| 109 |
+
|
| 110 |
+
Proposition 1. $G$ -equivariant models with equivariant loss learn equally (up to sample weight) from any transformation $g ( s )$ of a sample s. Thus data augmentation does not help during training.
|
| 111 |
+
|
| 112 |
+
# 3.2 TIME AND SPACE TRANSLATION EQUIVARIANCE
|
| 113 |
+
|
| 114 |
+
CNNs are time translation-equivariant as long as we predict in an autoregressive manner. Convolutional layers are also naturally space translation-equivariant (if cropping is ignored). Any activation function which acts identically pixel-by-pixel is equivariant.
|
| 115 |
+
|
| 116 |
+
# 3.3 ROTATIONAL EQUIVARIANCE
|
| 117 |
+
|
| 118 |
+
To incorporate rotational symmetry, we model $f$ using $\mathrm { S O } ( 2 )$ -equivariant convolutions and activations within the E(2)-CNN framework of Weiler and Cesa [49]. In practice, we use the cyclic group $G = C _ { n }$ instead of $G = \mathrm { S O ( 2 ) }$ as for large enough $n$ the difference is practically indistinguishable due to space discretization. We use powers of the regular representation $\rho = \mathbb { R } [ C _ { n } ] ^ { m }$ for hidden layers. The representation $\mathbb { R } [ C _ { n } ]$ has basis given by elements of $C _ { n }$ and $C _ { n }$ -action by permutation matrices. It has good descriptivity since it contains all irreducible representations of $C _ { n }$ , and it is compatible with any activation function applied channel-wise.
|
| 119 |
+
|
| 120 |
+
# 3.4 UNIFORM MOTION EQUIVARIANCE
|
| 121 |
+
|
| 122 |
+
Uniform motion is part of Galilean invariance and is relevant to all non-relativistic physics modeling. For a vector field $\dot { \boldsymbol X } : \mathbb R ^ { 2 } \to \mathbb R ^ { 2 }$ and vector $c \in \mathbb { R } ^ { 2 }$ , uniform motion transformation is adding a constant vector field to the vector field $X ( v )$ , $T _ { c } ^ { \mathrm { u m } } ( X ) ( v ) = X ( v ) + c , c \in \mathbb { R } ^ { 2 }$ . By the following corollary, proved in Appendix B.3, enforcing uniform motion equivariance as above by requiring all layers of the CNN to be equivariant severely limits the model.
|
| 123 |
+
|
| 124 |
+
Corollary 2. If $f$ is a CNN alternating between convolutions $f _ { i }$ and channel-wise activations $\sigma _ { i }$ and the combined layers $\sigma _ { i } \circ f _ { i }$ are uniform motion equivariant, then $f$ is affine.
|
| 125 |
+
|
| 126 |
+
To overcome this limitation, we relax the requirement by conjugating the model with shifted input distribution. For each sliding local block in each convolutional layer, we shift the mean of input tensor to zero and shift the output back after convolution and activation function per sample. In other words, if the input is $\mathcal { P } _ { b \times d _ { i n } \times s \times s }$ and the output is $\pmb { \mathcal { Q } } _ { b \times d _ { o u t } } = \sigma ( \pmb { \mathcal { P } } \cdot \boldsymbol { K } )$ for one sliding local block, where $b$ is batch size, $d$ is number of channels, $s$ is the kernel size, and $K$ is the kernel, then
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mu _ { i } = \operatorname { M e a n } _ { j k l } \left( \mathcal { P } _ { i j k l } \right) ; \quad \mathcal { P } _ { i j k l } \mapsto \mathcal { P } _ { i j k l } - \mu _ { i } ; \quad \mathcal { Q } _ { i j } \mapsto \mathcal { Q } _ { i j } + \mu _ { i } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
This will allow the convolution layer to be equivariant with respect to uniform motion. If the input is a vector field, we apply this operation to each element.
|
| 133 |
+
|
| 134 |
+
Proposition 3. A residual block $f ( { \pmb x } ) + { \pmb x }$ is uniform motion equivariant if the residual connection $f$ is uniform motion invariant.
|
| 135 |
+
|
| 136 |
+
By the proposition 3 above that is proved in Appendix B.3, within ResNet, residual mappings should be invariant, not equivariant, to uniform motion. That is, the skip connection $f ^ { ( i , i + 2 ) } = I$ is equivariant and the residual function $f ^ { ( i , i + 1 ) }$ should be invariant. Hence, for the first layer in each residual block, we omit adding the mean back to the output $\mathcal { Q } _ { i j }$ . In the case of Unet, when upscaling, we pad with the mean to preserve the overall mean.
|
| 137 |
+
|
| 138 |
+
# 3.5 SCALE EQUIVARIANCE
|
| 139 |
+
|
| 140 |
+
Scale equivariance in dynamics is unique as the physical law dictates the scaling of magnitude, space and time simultaneously. This is very different from scaling in images regarding resolutions [51]. For example, the Navier-Stokes equations are preserved under a specific scaling ratio of time, space, and velocity given by the transformation
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
T _ { \lambda } \colon \pmb { w } ( \pmb { x } , t ) \mapsto \lambda \pmb { w } ( \lambda \pmb { x } , \lambda ^ { 2 } t ) ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $\lambda \in \mathbb { R } _ { > 0 }$ . We implement two different approaches for scale equivariance, depending on whether we tie the physical scale with the resolution of the data.
|
| 147 |
+
|
| 148 |
+
Resolution Independent Scaling. We fix the resolution and scale the magnitude of the input by varying the discretization step size. An input $w \in \mathcal { F } _ { \mathbb { R } ^ { 2 } } ^ { k }$ with step size $\Delta _ { x } ( w )$ and $\Delta _ { t } ( w )$ can be scaled ${ \pmb w } ^ { \prime } = T _ { \lambda } ^ { s c } ( { \pmb w } ) = \lambda { \pmb w }$ by scaling the magnitude of vector alone, provided the discretization constants are now assumed to be $\Delta _ { x } ( \mathbf { \bar { w } } ^ { \prime } ) = \bar { 1 ^ { \prime } } \lambda \Delta _ { x } ( \pmb { w } )$ and $\Delta _ { t } ( { \mathbf { \boldsymbol { w } } ^ { \prime } } ) \overset { * } { = } 1 / \lambda ^ { 2 } \Delta _ { t } ( { \mathbf { \boldsymbol { w } } } )$ . We refer to this as magnitude equvariance hereafter.
|
| 149 |
+
|
| 150 |
+
To obtain magnitude equivariance, we divide the input tensor by the MinMax scaler (the maximum of the tensor minus the minimum) and scale the output back after convolution and activation per sliding block. We found that the standard deviation and mean L2 norm may work as well but are not as stable as the MinMax scaler. Specifically, using the same notation as in Section 3.4,
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { r } { \pmb { \sigma } _ { i } = \mathrm { M i n M a x } _ { j k l } \left( \pmb { \mathcal { P } } _ { i j k l } \right) ; \quad \pmb { \mathcal { P } } _ { i j k l } \mapsto \pmb { \mathcal { P } } _ { i j k l } / \pmb { \sigma } _ { i } ; \quad \pmb { \mathcal { Q } } _ { i j } \mapsto \pmb { \mathcal { Q } } _ { i j } \cdot \pmb { \sigma } _ { i } . } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
Resolution Dependent Scaling. If the physical scale of the data is fixed, then scaling corresponds to a change in resolution and time step size. To achieve this, we replace the convolution layers with group correlation layers over the group $G = ( \mathbb { R } _ { > 0 } , \cdot ) \times ( \mathbb { R } ^ { 2 } , + )$ of scaling and translations. In convolution, we translate a kernel $K$ across an input $\pmb { w }$ as such $\begin{array} { r } { \pmb { v } ( \pmb { p } ) = \sum _ { \pmb { q } \in \mathbb { Z } ^ { 2 } } \mathbf { \bar { w } } ( \pmb { p } + \pmb { q } ) K ( \pmb { q } ) } \end{array}$ . The $G$ -correlation upgrades this operation by both translating and scaling the kernel relative to the input,
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\pmb { v } ( \pmb { p } , s , \mu ) = \sum _ { \lambda \in \mathbb { R } _ { > 0 } , t \in \mathbb { R } , \pmb { q } \in \mathbb { Z } ^ { 2 } } \lambda \pmb { w } ( \lambda \pmb { p } + \pmb { q } , \lambda ^ { 2 } t , \lambda \mu ) K ( \pmb { q } , s , t , \lambda ) ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where $s$ and $t$ denote the indices of output and input channels respectively. We add an axis to the tensors corresponding the scale factor $\mu$ . Note that we treat the channel as a time dimension both with respective to our input and scaling action. As a consequence, as the number of channels increases in the lower layers of Unet and ResNet, the temporal resolution increases, which is analogous to temporal refinement in numerical methods [24; 31]. For the input $\tilde { w }$ of first layer where $\tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde \mathrm { \Gamma }$ has no levels originally, ${ \pmb w } ( p , s , \lambda ) = \lambda { \tilde { \pmb w } } ( \lambda p , \lambda ^ { 2 } s )$ .
|
| 163 |
+
|
| 164 |
+
Our model builds on the methods of Worrall and Welling [51], but with important adaptations for the physical domain. Our implementation of group correlation equation 5 directly incorporates the physical scaling law equation 3 of the system equation $\mathcal { D } _ { \mathrm { N S } }$ . This affects time, space, and magnitude. (For heat, we drop the magnitude scaling.) The physical scaling law dictates our model should be equivariant to both up and down scaling and by any $\lambda \in \mathbb { R } _ { > 0 }$ . Practically, the sum is truncated to 7 different $1 / 3 \le \lambda \le \bar { 3 }$ and discrete data is continuously indexed using interpolation. Note equation 3 demands we scale anisotropically, i.e. differently across time and space.
|
| 165 |
+
|
| 166 |
+
# 4 RELATED WORK
|
| 167 |
+
|
| 168 |
+
Equivariance and Invariance. Developing neural nets that preserve symmetries has been a fundamental task in image recognition [12; 49; 9; 7; 29; 27; 3; 52; 10; 19; 50; 16; 42]. But these models have never been applied to forecasting physical dynamics. Jaiswal et al. [23]; Moyer et al. [37] proposed approaches to find representations of data that are invariant to changes in specified factors, which is different from our physical symmetries. Ling et al. [30] and Fang et al. [17] studied tensor invariant neural networks to learn the Reynolds stress tensor while preserving Galilean invariance, and Mattheakis et al. [34] embedded even/odd symmetry of a function and energy conservation into neural networks to solve differential equations. But these two papers are limited to fully connected neural networks. Sosnovik et al. [44] extend Worrall and Welling [51] to group correlation convolution. But these two papers are limited to 2D images and are not magnitude equivariant, which is still inadequate for fluid dynamics. Bekkers [4] describes principles for endowing a neural architecture with invariance with respect to a Lie group.
|
| 169 |
+
|
| 170 |
+
Physics-informed Deep Learning. Deep learning models have been used often to model physical dynamics. For example, Wang et al. [48] unified the CFD technique and U-net to generate predictions with higher accuracy and better physical consistency. Kim and Lee [25] studied unsupervised generative modeling of turbulent flows but the model is not able to make real time future predictions given the historic data. Anderson et al. [1] designed rotationally covariant neural network for learning molecular systems. Raissi et al. [40; 41] applied deep neural networks to solve PDEs automatically but these approaches require explicit input of boundary conditions during inference, which are generally not available in real-time. Mohan et al. [35] proposed a purely data-driven DL model for turbulence, but the model lacks physical constraints and interpretability. Wu et al. [53] and Beucler et al. [5] introduced statistical and physical constraints in the loss function to regularize the predictions of the model. However, their studies only focused on spatial modeling without temporal dynamics. Morton et al. [36] incorporated Koopman theory into a encoder-decoder architecture but did not study the symmetry of fluid dynamics.
|
| 171 |
+
|
| 172 |
+
Video Prediction. Our work is related to future video prediction. Conditioning on the observed frames, video prediction models are trained to predict future frames, e.g., [33; 18; 54; 47; 39; 18]. Many of these models are trained on natural videos with complex noisy data from unknown physical processes. Therefore, it is difficult to explicitly incorporate physical principles into these models. Our work is substantially different because we do not attempt to predict object or camera motions.
|
| 173 |
+
|
| 174 |
+
# 5 EXPERIMENTS
|
| 175 |
+
|
| 176 |
+
We test our models on Rayleigh-Bénard convection and real-world ocean currents. We also evaluated on the heat diffusion systems, see Appendix C for more results. The implementation details and a detailed description of energy spectrum error can be found in Appendices D and B.7.
|
| 177 |
+
|
| 178 |
+
Evaluation Metrics. Our goal is to show that adding symmetry improves both the accuracy and the physical consistency of predictions. For accuracy, we use Root Mean Square Error (RMSE) between the forward predictions and the ground truth over all pixels. For physical consistency, we calculate the Energy Spectrum Error (ESE) which is the RMSE of the log of energy spectrum. ESE can indicate whether the predictions preserve the correct statistical distributions of the fluids and obey the energy conservation law, which is a critical metric for physical consistency.
|
| 179 |
+
|
| 180 |
+
Experimental Setup. ResNet[20] and U-net[43] are the best-performing models for our tasks [48] and are well-suited for our tasks. Thus, we implemented these two convolutional architectures equipped with four different symmetries, which we name Equ-ResNet(U-net). We use a rolling window approach to generate sequences with step size 1 for the RBC data and step size 3 for the ocean data. All models predict raw velocity and temperature fields up to 10 steps ahead autoregressively. We use the MSE loss function that accumulates the forecasting errors. We split the data $6 0 \% - 2 0 \% - 2 0 \%$ for training-validation-test across time and report mean errors over five random runs.
|
| 181 |
+
|
| 182 |
+
Table 2: The RMSE and ESE of the ResNet(Unet) and four Equ-ResNets(Unets) predictions on the original and four transformed test sets of Rayleigh-Bénard Convection. Augm is ResNet(Unet) trained on the augmented training set with additional samples applied with random transformations from the relevant symmetry group. Each column contains all models’ prediction errors on the original test set and four different transformed test sets.
|
| 183 |
+
|
| 184 |
+
<table><tr><td rowspan="2"></td><td colspan="5">Root Mean Square Error(103)</td><td colspan="5">Energy Spectrum Errors</td></tr><tr><td>Orig</td><td>UM</td><td>Mag</td><td>Rot</td><td>Scale</td><td>Orig</td><td>UM</td><td>Mag</td><td>Rot</td><td>Scale</td></tr><tr><td>ResNet</td><td>0.67±0.24 2.94±0.84 4.30±1.27</td><td></td><td></td><td>3.46±0.39</td><td>1.96±0.16</td><td></td><td>0.46±0.19 0.56±0.29 0.26±0.14 1.59±0.42 4.32±2.33</td><td></td><td></td><td></td></tr><tr><td>Augm</td><td></td><td>1.10±0.20 1.54±0.12 0.92±0.09 1.01±0.11</td><td></td><td></td><td></td><td></td><td>1.37±0.02 1.14±0.32 1.92±0.21 1.55±0.14</td><td></td><td></td><td></td></tr><tr><td>EquuM</td><td>0.71±0.26 0.71±0.26</td><td></td><td></td><td></td><td></td><td>0.33±0.11 0.33±0.11</td><td></td><td></td><td></td><td></td></tr><tr><td>EquMag</td><td>0.69±0.24</td><td></td><td>0.67±0.14</td><td></td><td></td><td>0.34±0.09</td><td></td><td>0.19±0.02</td><td></td><td></td></tr><tr><td>EquRot</td><td>0.65±0.26</td><td></td><td></td><td>0.76±0.02</td><td></td><td>0.31±0.06</td><td></td><td></td><td>1.23±0.04</td><td></td></tr><tr><td>Equscal</td><td>0.70±0.02</td><td></td><td></td><td></td><td>0.85±0.09</td><td>0.44±0.22</td><td></td><td></td><td></td><td>0.68±0.26</td></tr><tr><td>U-net</td><td>0.64±0.24 2.27±0.82 3.59±1.04 2.78±0.83</td><td></td><td></td><td></td><td>31.65±0.17</td><td>0.50±0.04 0.34±0.10 0.55±0.05 0.91±0.27 4.25±0.57</td><td></td><td></td><td></td><td></td></tr><tr><td>Augm</td><td></td><td>0.75±0.28 1.33±0.33 0.86±0.04 1.11±0.07</td><td></td><td></td><td></td><td></td><td>0.96±0.23 0.44±0.21 1.24±0.04 1.47±0.11</td><td></td><td></td><td></td></tr><tr><td>Equum</td><td>0.68±0.26 0.71±0.24</td><td></td><td></td><td></td><td></td><td></td><td>0.23±0.06 0.14±0.05</td><td></td><td></td><td></td></tr><tr><td>EquMag</td><td>0.67±0.11</td><td></td><td>0.68±0.14</td><td></td><td></td><td>0.42±0.04</td><td></td><td>0.34±0.06</td><td></td><td></td></tr><tr><td>EquRot</td><td>0.68±0.25</td><td></td><td></td><td>0.74±0.01</td><td></td><td>0.11±0.02</td><td></td><td></td><td>1.16±0.05</td><td></td></tr><tr><td>Equscal</td><td>0.69±0.13</td><td></td><td></td><td></td><td>0.90±0.25</td><td>0.45±0.32</td><td></td><td></td><td></td><td>0.89±0.29</td></tr></table>
|
| 185 |
+
|
| 186 |
+
# 5.1 EQUIVARIANCE ERRORS
|
| 187 |
+
|
| 188 |
+
The equivariance errors can be defined as $\mathrm { E E } _ { T } ( x ) = | T ( f ( x ) ) - f ( T ( x ) ) |$ , where $x$ is an input, $f$ is a neural net, $T$ is a transformation from a symmetry group. We empirically measure the equivariance errors of all equivariant models we have designed. Table 1 shows the equivariance errors of ResNet and Equ-ResNet. The transformation $T$ is sampled in the same way as we generated the transformed Rayleigh-Bénard Convection test sets. See more details in Appendix B.5.
|
| 189 |
+
|
| 190 |
+
# 5.2 EXPERIMENTS ON SIMULATED RAYLEIGH-BÉNARD CONVECTION DYNAMICS
|
| 191 |
+
|
| 192 |
+
Data Description. Rayleigh-Bénard Convection occurs in a horizontal layer of fluid heated from below and is a major feature of the El Niño dynamics. The dataset comes from two-dimensional turbulent flow simulated using the Lattice Boltzmann Method [8] with Rayleigh number $2 . 5 \times 1 0 ^ { 8 }$ We divide each $1 7 9 2 \times 2 5 6$ image into 7 square subregions of size $2 5 6 \times 2 5 6$ , then downsample to $6 4 \times 6 4$ pixels. To test the models’ generalization ability, we generate additional four test sets $: 1$ ) UM: added random vectors drawn from $U ( - 1 , 1 )$ ; 2) Mag: multiplied by random values sampled from $U ( 0 , 2 )$ ; 3) Rot: randomly rotated by the multiples of $\pi / 2$ ; 4) Scale: scaled by $\lambda$ sampled from $U ( 1 / 5 , 2 )$ . Due to lack of a fixed reference frame, real-world data would be transformed relative to training data. We use transformed data to mimic this scenario.
|
| 193 |
+
|
| 194 |
+
Prediction Performance. Table 2 shows the prediction RMSE and ESE on the original and four transformed test sets by the non-equivariant ResNet(Unet) and four Equ-ResNets(Unets). Augm is ResNet(Unet) trained on the augmented training set with additional samples with random transformations applied from the relevant symmetry group. The augmented training set contains additional transformed samples and is three times the size of the original training set. Each column contains the prediction errors by the non-equivariant and equivariant models on each test set. On the original test set, all models have similar RMSE, yet the equivariant models have lower ESE. This demonstrates that incorporating symmetries preserves the representation powers of CNNs and even improves models’ physical consistency.
|
| 195 |
+
|
| 196 |
+
Table 1: Equivariance Errors of ResNet(Unets) and Equ-ResNet(Unets).
|
| 197 |
+
|
| 198 |
+
<table><tr><td>EEr(10)</td><td>UM</td><td>Mag</td><td>Rot</td><td>Scale</td></tr><tr><td>ResNets</td><td>2.010</td><td>1.885</td><td>5.895</td><td>1.658</td></tr><tr><td>EqUResNets</td><td>0.0</td><td>0.0</td><td>1.190</td><td>0.579</td></tr><tr><td>Unets</td><td>1.070</td><td>0.200</td><td>1.548</td><td>1.809</td></tr><tr><td>Equunets</td><td>0.0</td><td>0.0</td><td>0.794</td><td>0.481</td></tr></table>
|
| 199 |
+
|
| 200 |
+
On the transformed test sets, we can see that ResNet(Unet) fails, while Equ-ResNets(Unets) performs even much better than Augm-ResNets(Unets). This demonstrates the value of equivariant models over data augmentation for improving generalization. Figure 2 shows the ground truth and the predicted velocity fields at time step 1, 5 and 10 by the ResNet and four Equ-ResNets on the four transformed test samples.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 2: The ground truth and the predicted velocity norm fields $\lVert \boldsymbol { \mathbf { \mathit { w } } } \rVert _ { 2 }$ at time step 1, 5 and 10 by the ResNet and four Equ-ResNets on the four transformed test samples. The first column is the target, the second is ResNet predictions, and the third is predictions by Equ-ResNets.
|
| 204 |
+
|
| 205 |
+
Generalization. In order to evaluate models’ generalization ability with respect to the extent of distributional shift, we created additional test sets with different scale factors from $\frac { 1 } { 5 }$ to 1. Figure 3 shows ResNet and EquScal-ResNet prediction RMSEs (left) and ESEs (right) on the test sets upscaled by different factors. We observed that $\mathtt { E q u } _ { S c a l } - \mathtt { R e } \mathtt { s N e t }$ is very robust across various scaling factors while ResNet does not generalize.
|
| 206 |
+
|
| 207 |
+
Table 3: Performance comparison on transformed train and test sets.
|
| 208 |
+
|
| 209 |
+
<table><tr><td></td><td>RMSE</td><td>ESE</td></tr><tr><td>ResNet Equum</td><td>1.03±0.05 0.69±0.01</td><td>0.96±0.10 0.35±0.13</td></tr><tr><td>ResNet</td><td>1.50±0.02</td><td>0.55±0.11</td></tr><tr><td>EquMag</td><td>0.75±0.04</td><td>0.39±0.02</td></tr><tr><td>ResNet</td><td>1.18±0.05</td><td>1.21±0.04</td></tr><tr><td>EquRot</td><td>0.77±0.01</td><td>0.68±0.01</td></tr><tr><td>ResNet Equscal</td><td>0.92±0.01 0.74±0.03</td><td>1.34±0.07 1.02±0.02</td></tr></table>
|
| 210 |
+
|
| 211 |
+
We also compare ResNet and Equ-ResNet when both train and test sets have random transformations from the relevant symmetry group applied to each sample. This mimics real-world data in which each sample has unknown reference frame. As shown in Table 3 shows Equ-ResNet outperforms ResNet on average by $34 \%$ RMSE and $40 \%$ ESE.
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 3: Left: Prediction RMSE and ESE over five runs of ResNet and $\mathtt { E q u } _ { S c a 1 } - \mathtt { R e s N e t }$ on the Rayleigh-Bénard Convection test set upscaled by different factors. Right: The ground truth and predicted ocean currents $\lVert \boldsymbol { w } \rVert _ { 2 }$ by ResNet and four Equ-ResNets on the test set of future time.
|
| 215 |
+
|
| 216 |
+
5.3 EXPERIMENTS ON REAL WORLD OCEAN DYNAMICS
|
| 217 |
+
|
| 218 |
+
Data Description. We use the reanalysis ocean current velocity data generated by the NEMO ocean engine [32].1 We selected an area from each of the Atlantic, Indian and North Pacific Oceans from 01/01/2016 to 08/18/2017 and extracted $6 4 \times 6 4$ sub-regions for our experiments. The corresponding latitude and longitude ranges for the selected regions are $- 4 4 \sim - 2 3$ , $2 5 { \sim } 4 6$ ), $5 5 \sim 7 6$ , $- 3 9 \mathrm { \sim } - 1 8$ ) and $( - 1 7 4 \sim - 1 5 3$ , $5 { \sim } 2 6$ ) respectively. We not only test all models on the future data but also on a different domain $- 1 8 0 \mathrm { \sim } - 1 5 9$ , ${ \ - } 4 0 \mathrm { \sim } { - } 5 9$ ) in South Pacific Ocean from 01/01/2016 to 12/15/2016.
|
| 219 |
+
|
| 220 |
+
Prediction Performance. Table 4 shows the RMSE and ESE of ResNets(Unets), and equivariant Equ-ResNets(Unets) on the test sets with different time range and spatial domain from the training set. All the equivariant models outperform the non-equivariant baseline on RMSE, and $\mathtt { E q u } _ { S c a 1 } - \mathtt { R e s N e t }$ achieves the lowest RMSE. For ESE, only the $\mathtt { E q u _ { M a g } - R e s N e t }$ (Unet) is worse than the baseline. Also, it is remarkable that the $\mathtt { E q u } _ { \mathtt { R o t } }$ models have significantly lower ESE than others, suggesting that they correctly learn the statistical distribution of ocean currents.
|
| 221 |
+
|
| 222 |
+
Comparison with Data Augmentation. We also compare Equ-ResNets(Unets) ResNets(Unets) that are trained with data-augmentation (Augm) in Table 4. In all cases, equivariant models outperforms the baselines trained with data augmentation. We find that data augmentation sometimes improves slightly on RMSE but not as much as the equivariant models. And, in fact, ESE is uniformly worse for models trained with data augmentation than even the baselines. In contrast, the equivariant models have much better ESE than the baselines with or without augmentation. We believe data augmentation presents a trade-off in learning. Though the model may be less sensitive to the various transformations we consider, we need to train bigger models longer on many more samples. The models may not have enough capacity to learn the symmetry from the augmented data and the dynamics of the fluids at the same time. By comparison, equivariant architectures do not have this issue.
|
| 223 |
+
|
| 224 |
+
Figure 3 shows the ground truth and the predicted ocean currents at time step 1, 5, 10 by different models. We can see that equivariant models’ predictions are more accurate and contain more details than the baselines. Thus, incorporating symmetry into deep learning models can improve the prediction accuracy of ocean currents. The most recent work on this dataset is de Bezenac et al. [15], which combines a warping scheme and a U-net to predict temperature. Since our models can also be applied to advection-diffusion systems, we also investigated the task of ocean temperature field predictions. We observe that $\mathtt { E q u } _ { \mathtt { U M } } - \mathtt { U n e t }$ performs slightly better than de Bezenac et al. [15]. For additional results, see Appendix E.
|
| 225 |
+
|
| 226 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 227 |
+
|
| 228 |
+
We develop methods to improve the generalization of deep sequence models for learning physical dynamics. We incorporate various symmetries by designing equivariant neural networks and demonstrate their superior performance on 2D time series prediction both theoretically and experimentally. Our designs obtain improved physical consistency for predictions. In the case of transformed test data, our models generalize significantly better than their non-equivariant counterparts. Importantly, all of our equivariant models can be combined and can be extended to 3D cases. The group $G$ also acts on the boundary conditions and external forces of a system $\mathcal { D }$ . If these are $G$ -invariant, then the system $\mathcal { D }$ is strictly invariant as in Section 2.3. If not, one must consider a family of solutions $\cup _ { g \in G } \mathrm { S o l } ( g D )$ to retain equivariance. To the best of our best knowledge, there does not exist a single model with equivariance to the full symmetry group of the Navier-Stokes equations. It is possible but non-trivial, and we continue to work on combining different equivariances. Future work also includes speeding up the the scale-equivariant models and incorporating other symmetries into DL models.
|
| 229 |
+
|
| 230 |
+
Table 4: Prediction RMSE and ESE comparison on the two ocean currents test sets.
|
| 231 |
+
|
| 232 |
+
<table><tr><td rowspan="2"></td><td colspan="2">RMSE</td><td colspan="2">ESE</td></tr><tr><td>Testtime</td><td>Testdomain</td><td>Testime</td><td>Testdomain</td></tr><tr><td>ResNet</td><td></td><td>0.71±0.07 0.72±0.04</td><td>0.83±0.06 0.75±0.11</td><td></td></tr><tr><td>Augmum</td><td></td><td>0.70±0.01 0.70±0.07</td><td>1.06±0.06 1.06±0.04</td><td></td></tr><tr><td>AugmMag</td><td>0.76±0.02</td><td>0.71±0.01</td><td>1.08±0.08</td><td>1.05±0.8</td></tr><tr><td>AugmRot</td><td>0.73±0.01</td><td>0.69±0.01</td><td>0.94±0.01</td><td>0.86±0.01</td></tr><tr><td>Augmscal</td><td></td><td>0.97±0.06 0.92±0.04</td><td>0.85±0.03</td><td>30.95±0.11</td></tr><tr><td>EquuM</td><td>0.68±0.06</td><td>0.68±0.16</td><td>0.75±0.06</td><td>50.73±0.08</td></tr><tr><td>EquMag</td><td></td><td>0.66±0.14 0.68±0.11</td><td></td><td>0.84±0.04 0.85±0.14</td></tr><tr><td>EquRot</td><td>0.69±0.01</td><td>10.70±0.08</td><td></td><td>0.43±0.15 0.28±0.20</td></tr><tr><td>Equscal</td><td>0.63±0.02 0.68±0.21</td><td></td><td></td><td>0.44±0.05 0.42±0.12</td></tr><tr><td>U-net Augmum</td><td>0.68±0.02 0.68±0.01</td><td>0.70±0.13 0.73±0.10</td><td></td><td>0.77±0.12 0.73±0.07</td></tr><tr><td>AugmMag</td><td></td><td></td><td></td><td>0.85±0.04 0.83±0.04</td></tr><tr><td></td><td></td><td>0.69±0.02 0.67±0.10</td><td></td><td>0.78±0.03 0.86±0.02</td></tr><tr><td>AugmRot</td><td>0.79±0.01</td><td>0.70±0.01</td><td>0.79±0.01</td><td>10.78±0.02</td></tr><tr><td></td><td>Augmsca10.71±0.01 0.77±0.02</td><td></td><td></td><td>0.84±0.01 0.77±0.02</td></tr><tr><td>EquuM</td><td>0.66±0.10 0.67±0.03</td><td></td><td></td><td>0.73±0.03 0.82±0.13</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EquMag</td><td></td><td>0.63±0.08 0.66±0.09</td><td></td><td>0.74±0.05 0.79±0.04</td></tr><tr><td>EquRot</td><td>0.68±0.05 0.69±0.02</td><td></td><td></td><td>0.42±0.02 0.47±0.07</td></tr><tr><td>Equscal</td><td></td><td>0.65±0.09 0.69±0.05</td><td></td><td>0.45±0.13 0.43±0.05</td></tr></table>
|
| 233 |
+
|
| 234 |
+
# ACKNOWLEDGMENTS
|
| 235 |
+
|
| 236 |
+
This work was supported in part by Google Faculty Research Award, NSF Grant #2037745, and the U. S. Army Research Office under Grant W911NF-20-1-0334. The Titan Xp used for this research was donated by the NVIDIA Corporation. This research used resources of the National Energy Research Scientific Computing Center, a DOE Office of Science User Facility supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC02-05CH11231. We also thank Dragos Bogdan Chirila for providing the turbulent flow data.
|
| 237 |
+
|
| 238 |
+
REFERENCES
|
| 239 |
+
[1] Brandon Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant molecular neural networks. In Advances in neural information processing systems (NeurIPS), 2019.
|
| 240 |
+
[2] John David Anderson and J Wendt. Computational fluid dynamics, volume 206. Springer, 1995.
|
| 241 |
+
[3] Erkao Bao and Linqi Song. Equivariant neural networks and equivarification. arXiv preprint arXiv:1906.07172, 2019.
|
| 242 |
+
[4] Erik J Bekkers. B-spline cnns on lie groups. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1gBhkBFDH.
|
| 243 |
+
[5] Tom Beucler, Michael Pritchard, Stephan Rasp, Pierre Gentine, Jordan Ott, and Pierre Baldi. Enforcing analytic constraints in neural-networks emulating physical systems. arXiv preprint arXiv:1909.00912, 2019.
|
| 244 |
+
[6] Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in neural information processing systems, pages 6571–6583, 2018.
|
| 245 |
+
[7] Benjamin Chidester, Minh N. Do, and Jian Ma. Rotation equivariance and invariance in convolutional neural networks. arXiv preprint arXiv:1805.12301, 2018.
|
| 246 |
+
[8] Dragos Bogdan Chirila. Towards lattice Boltzmann models for climate sciences: The GeLB programming language with applications. PhD thesis, University of Bremen, 2018.
|
| 247 |
+
[9] Taco S. Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning (ICML), pages 2990–2999, 2016.
|
| 248 |
+
[10] Taco S. Cohen and Max Welling. Steerable CNNs. arXiv preprint arXiv:1612.08498, 2016.
|
| 249 |
+
[11] Taco S Cohen, Mario Geiger, and Maurice Weiler. A general theory of equivariant cnns on homogeneous spaces. In Advances in Neural Information Processing Systems, pages 9142–9153, 2019.
|
| 250 |
+
[12] Taco S. Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge equivariant convolutional networks and the icosahedral CNN. In Proceedings of the 36th International Conference on Machine Learning (ICML), volume 97, pages 1321–1330, 2019.
|
| 251 |
+
[13] Tri Dao, Albert Gu, Alexander J Ratner, Virginia Smith, Christopher De Sa, and Christopher Ré. A kernel theory of modern data augmentation. Proceedings of machine learning research, 97:1528, 2019.
|
| 252 |
+
[14] Richard H. Day. Complex economic dynamics-vol. 1: An introduction to dynamical systems and market mechanisms. MIT Press Books, 1, 1994.
|
| 253 |
+
[15] Emmanuel de Bezenac, Arthur Pajot, and Patrick Gallinari. Deep learning for physical processes: Incorporating prior scientific knowledge. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ By4HsfWAZ.
|
| 254 |
+
[16] Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. In International Conference on Machine Learning (ICML), 2016.
|
| 255 |
+
[17] Rui Fang, David Sondak, Pavlos Protopapas, and Sauro Succi. Deep learning for turbulent channel flow. arXiv preprint arXiv:1812.02241, 2018.
|
| 256 |
+
[18] Chelsea Finn, Ian Goodfellow, and Sergey Leine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pages 64–72, 2016.
|
| 257 |
+
[19] Marc Finzi, Samuel Stanton, Pavel Izmailov, and Andrew Gordon Wilson. Generalizing convolutional neural networks for equivariance to lie groups on arbitrary continuous data. arXiv preprint arXiv:2002.12880, 2020.
|
| 258 |
+
|
| 259 |
+
[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv:1505.04597, 2015.
|
| 260 |
+
|
| 261 |
+
[21] Herbert W Hethcote. The mathematics of infectious diseases. SIAM review, 42(4):599–653, 2000.
|
| 262 |
+
|
| 263 |
+
[22] Eugene M. Izhikevich. Dynamical systems in neuroscience. MIT press, 2007.
|
| 264 |
+
|
| 265 |
+
[23] Ayush Jaiswal, Daniel Moyer, Greg Ver Steeg, Wael AbdAlmageed, and Premkumar Natarajan. Invariant representations through adversarial forgetting. arXiv preprint arXiv:1911.04060, 2019.
|
| 266 |
+
|
| 267 |
+
[24] Ihn S Kim and Wolfgang JR Hoefer. A local mesh refinement algorithm for the time domainfinite difference method using maxwell’s curl equations. IEEE Transactions on Microwave Theory and Techniques, 38(6):812–815, 1990.
|
| 268 |
+
|
| 269 |
+
[25] Junhyuk Kim and Changhoon Lee. Deep unsupervised learning of turbulence for inflow generation at various Reynolds numbers. Journal of Computational Physics, page 109216, 2020.
|
| 270 |
+
|
| 271 |
+
[26] Anthony W. Knapp. Lie Groups Beyond an Introduction, volume 140 of Progress in Mathematics. Birkhäuser, Boston, 2nd edition, 2002.
|
| 272 |
+
|
| 273 |
+
[27] Risi Kondor and Shubhendu Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. In Proceedings of the 35th International Conference on Machine Learning (ICML), volume 80, pages 2747–2755, 2018.
|
| 274 |
+
|
| 275 |
+
[28] Serge Lang. Algebra. Springer, Berlin, 3rd edition, 2002.
|
| 276 |
+
|
| 277 |
+
[29] Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 991–999, 2015.
|
| 278 |
+
|
| 279 |
+
[30] Julia Ling, Andrew Kurzawskim, and Jeremy Templeton. Reynolds averaged turbulence modeling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 2017.
|
| 280 |
+
|
| 281 |
+
[31] Vadim Lisitsa, Galina Reshetova, and Vladimir Tcheverda. Finite-difference algorithm with local time-space grid refinement for simulation of waves. Computational geosciences, 16(1): 39–54, 2012.
|
| 282 |
+
|
| 283 |
+
[32] Gurvan Madec et al. NEMO ocean engine, 2015. Technical Note. Institut PierreSimon Laplace (IPSL), France. https://epic.awi.de/id/eprint/39698/1/ NEMO_book_v6039.pdf.
|
| 284 |
+
|
| 285 |
+
[33] Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv preprint arXiv:1511.05440, 2015.
|
| 286 |
+
|
| 287 |
+
[34] Marios Mattheakis, Pavlos Protopapas, D. Sondak, Marco Di Giovanni, and Efthimios Kaxiras. Physical symmetries embedded in neural networks. arXiv preprint arXiv:1904.08991, 2019.
|
| 288 |
+
|
| 289 |
+
[35] Arvind Mohan, Don Daniel, Michael Chertkov, and Daniel Livescu. Compressed convolutional LSTM: An efficient deep learning framework to model high fidelity 3D turbulence. arXiv preprint arXiv:1903.00033, 2019.
|
| 290 |
+
|
| 291 |
+
[36] Jeremy Morton, Antony Jameson, Mykel J. Kochenderfer, and Freddie Witherden. Deep dynamical modeling and control of unsteady fluid flows. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 292 |
+
|
| 293 |
+
[37] Daniel Moyer, Shuyang Gao, Rob Brekelmans, Aram Galstyan, and Greg Ver Steeg. Invariant representations without adversarial training. In Advances in Neural Information Processing Systems (NeurIPS), pages 9084–9093, 2018.
|
| 294 |
+
|
| 295 |
+
[38] Peter J. Olver. Applications of Lie groups to differential equations, volume 107. Springer Science & Business Media, 2000.
|
| 296 |
+
|
| 297 |
+
[39] Sergiu Oprea, P. Martinez-Gonzalez, A. Garcia-Garcia, John Alejandro Castro-Vargas, S. OrtsEscolano, J. Garcia-Rodriguez, and Antonis A. Argyros. A review on deep learning techniques for video prediction. ArXiv, abs/2004.05214, 2020.
|
| 298 |
+
|
| 299 |
+
[40] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part I): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017.
|
| 300 |
+
|
| 301 |
+
[41] Maziar Raissi, Paris Perdikaris, and George E Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686–707, 2019.
|
| 302 |
+
|
| 303 |
+
[42] Anupam K. Gupta Rohan Ghosh. Scale steerable filters for locally scale-invariant convolutional neural networks. arXiv preprint arXiv:1906.03861, 2019.
|
| 304 |
+
|
| 305 |
+
[43] 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, pages 234–241. Springer, 2015.
|
| 306 |
+
|
| 307 |
+
[44] Ivan Sosnovik, Michał Szmaja, and Arnold Smeulders. Scale-equivariant steerable networks. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $=$ HJgpugrKPS.
|
| 308 |
+
|
| 309 |
+
[45] Steven H. Strogatz. Nonlinear dynamics and chaos: with applications to physics, biology, chemistry, and engineering. CRC press, 2018.
|
| 310 |
+
|
| 311 |
+
[46] Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating Eulerian fluid simulation with convolutional networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), volume 70, pages 3424–3433, 2017.
|
| 312 |
+
|
| 313 |
+
[47] Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations (ICLR), 2017.
|
| 314 |
+
|
| 315 |
+
[48] Rui Wang, Karthik Kashinath, Mustafa Mustafa, Adrian Albert, and Rose Yu. Towards physicsinformed deep learning for turbulent flow prediction. arXiv preprint arXiv:1911.08655, 2019.
|
| 316 |
+
|
| 317 |
+
[49] Maurice Weiler and Gabriele Cesa. General E(2)-equivariant steerable CNNs. In Advances in Neural Information Processing Systems (NeurIPS), pages 14334–14345, 2019.
|
| 318 |
+
|
| 319 |
+
[50] Maurice Weiler, Fred A. Hamprecht, and Martin Storath. Learning steerable filters for rotation equivariant CNNs. Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 320 |
+
|
| 321 |
+
[51] Daniel Worrall and Max Welling. Deep scale-spaces: Equivariance over scale. In Advances in Neural Information Processing Systems (NeurIPS), pages 7364–7376, 2019.
|
| 322 |
+
|
| 323 |
+
[52] Daniel E Worrall, Stephan J Garbin, Daniyar Turmukhambetov, and Gabriel J Brostow. Harmonic networks: Deep translation and rotation equivariance. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5028–5037, 2017.
|
| 324 |
+
|
| 325 |
+
[53] Jin-Long Wu, Karthik Kashinath, Adrian Albert, Dragos Chirila, Prabhat, and Heng Xiao. Enforcing statistical constraints in generative adversarial networks for modeling chaotic dynamical systems. Journal of Computational Physics, page 109209, 2019.
|
| 326 |
+
|
| 327 |
+
[54] Tianfan Xue, Jiajun Wu, Katherine Bouman, and Bill Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In Advances in neural information processing systems (NeurIPS), pages 91–99, 2016.
|
| 328 |
+
|
| 329 |
+
# A ADDITIONAL BACKGROUND ON GROUP THEORY
|
| 330 |
+
|
| 331 |
+
We give a brief overview of group theory and representation theory. For a more complete introduction to the topic see Lang [28]. We start with the definition of an abstract symmetry group.
|
| 332 |
+
|
| 333 |
+
Definition 2 (group). A group of symmetries or simply group is a set $G$ together with a binary operation $\circ \colon G \times G \to G$ called composition satisfying three properties:
|
| 334 |
+
|
| 335 |
+
1. (identity) There is an element $1 \in G$ such that $1 \circ g = g \circ 1 = g$ for all $g \in G$ ,
|
| 336 |
+
2. (associativity) $( g _ { 1 } \circ g _ { 2 } ) \circ g _ { 3 } = g _ { 1 } \circ ( g _ { 2 } \circ g _ { 3 } ) { \mathrm { ~ f o r ~ a l l ~ } } g _ { 1 } , g _ { 2 } , g _ { 3 } \in G ,$
|
| 337 |
+
3. (inverses) if $g \in G$ , then there is an element $g ^ { - 1 } \in G$ such that $g \circ g ^ { - 1 } = g ^ { - 1 } \circ g = 1$ .
|
| 338 |
+
|
| 339 |
+
Definition 3 (Lie group). A group $G$ is a Lie group if it is also a smooth manifold over $\mathbb { R }$ and the composition and inversion maps are smooth, i.e. infinitely differentiable.
|
| 340 |
+
|
| 341 |
+
Example 1. Let $G = G L _ { 2 } ( \mathbb { R } )$ be the set of $2 \times 2$ invertible real matrices. The set is closed under inversion and matrix multiplication gives a well-defined composition. This a 4-dimensional real Lie group.
|
| 342 |
+
|
| 343 |
+
Example 2. Let $G = D _ { 3 } = \{ 1 , r , r ^ { 2 } , s , r s , r ^ { 2 } s \}$ where $r$ is rotation by $2 \pi / 3$ and $s$ is reflection over the $y$ -axis. This is the group of symmetries of an equilateral triangle pointing along the $y$ -axis, see Figure 2.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 4: Illustration of $D _ { 3 }$ acting on a triangle with the letter “R”.
|
| 347 |
+
|
| 348 |
+
Groups are abstract objects, but they become concrete when we let them act.
|
| 349 |
+
|
| 350 |
+
Definition 4 (action). A group $G$ acts on a set $S$ if there is an action map · : $G \times S \to S$ satisfying
|
| 351 |
+
|
| 352 |
+
1. $1 \cdot x = x$ for all $x \in S , g \in G$ ,
|
| 353 |
+
|
| 354 |
+
2. $g _ { 1 } \cdot ( g _ { 2 } \cdot x ) = ( g _ { 1 } \circ g _ { 2 } ) \cdot x$ for all $x \in S$ , $g _ { 1 } , g _ { 2 } \in G$ .
|
| 355 |
+
|
| 356 |
+
Definition 5 (representation). We say $S$ is a $G$ -representation if $S$ is an $\mathbb { R }$ -vector space and $G$ acts on $S$ by linear transformations, that is,
|
| 357 |
+
|
| 358 |
+
1. $g \cdot ( x + y ) = g \cdot x + g \cdot y { \mathrm { ~ f o r ~ a l l ~ } } x , y \in S , g \in G ,$
|
| 359 |
+
2. $g \cdot ( c x ) = c ( g \cdot x )$ for all $x \in S , g \in G , c \in \mathbb { R }$ .
|
| 360 |
+
|
| 361 |
+
Example 3. The group $D _ { 3 }$ acts on $S$ , the set of points in an equilateral triangle, as in Figure 2. The vector space $\mathbb { R } ^ { 2 }$ is both a $D _ { 3 }$ -representation and a $G L _ { 2 } ( \mathbb { R } )$ -representation.
|
| 362 |
+
|
| 363 |
+
The language of group theory allows us to formally define equivariance and invariance.
|
| 364 |
+
|
| 365 |
+
Definition 6 (invariant, equivariant). Let $f \colon X \to Y$ be a function and $G$ be a group.
|
| 366 |
+
|
| 367 |
+
1. Assume $G$ acts on $X$ . The function $f$ is $G$ -invariant if $f ( g x ) = x$ for all $x \in X$ and $g \in G$ 2. Assume $G$ acts on $X$ and $Y$ . The function $f$ is $G$ -equivariant if $f ( g x ) = g f ( x )$ for all $x \in X$ and $g \in G$ .
|
| 368 |
+
|
| 369 |
+
See Figure 1 for an illustration. Note that we often omit the different action maps of $G$ on $X$ and on $Y$ in our notion when they are clear from context.
|
| 370 |
+
|
| 371 |
+
We can combine and decompose representations in different ways.
|
| 372 |
+
|
| 373 |
+
Definition 7 (direct sum, tensor product). Let $V$ and $W$ be $G$ -representations.
|
| 374 |
+
|
| 375 |
+
1. The direct sum $V \oplus W$ has underlying set $V \times W$ . As a vector space it has scalars $c ( v , w ) = ( c v , c w )$ and addition $( v _ { 1 } , w _ { 1 } ) + ( v _ { 2 } , w _ { 2 } ) = ( v _ { 1 } + v _ { 2 } , w _ { 1 } + w _ { 2 } )$ . It is a $G$ representation with action $g \cdot ( v , w ) = ( g v , g w )$ .
|
| 376 |
+
|
| 377 |
+
2. The tensor product
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
V \otimes W = \left\{ \sum _ { i } v _ { i } \otimes w _ { i } : v _ { i } \in V , w _ { i } \in W \right\}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
is a $G$ -representation with action $g \cdot v \otimes w = ( g v ) \otimes ( g w )$
|
| 384 |
+
|
| 385 |
+
Definition 8 (irreducible). Let $V$ be a $G$ -representation.
|
| 386 |
+
|
| 387 |
+
1. If $W$ is a subspace of $V$ and is closed under the action of $G$ , i.e. $g w \in W$ for all $w \in$ $W , g \in G$ , then we say it is a subrepresentation.
|
| 388 |
+
|
| 389 |
+
2. If 0 and $V$ itself are the only subrepresentations of $V$ , then it is irreducible.
|
| 390 |
+
|
| 391 |
+
Irreducible representations are the “prime” building blocks of representations. A compact Lie group is one which is closed and bounded. The rotation group $S O ( 2 , \mathbb { R } )$ is compact, but the group $( \mathbb { R } , + )$ is not. All finite groups are also compact Lie groups. The following theorem vastly simplifies our understanding of possible representations of compact Lie groups (see e.g. Knapp [26]).
|
| 392 |
+
|
| 393 |
+
Theorem 4 (Weyl’s Complete Reducibility Theorem). Let $G$ be a compact real Lie group. Every finite-dimensional representation of $V$ is a direct sum of irreducible representations $V = \oplus _ { i } V _ { i }$ .
|
| 394 |
+
|
| 395 |
+
Thus to classify the possible finite-dimensional representations of $G$ , one need only to find all possible irreducible representations of $G$ .
|
| 396 |
+
|
| 397 |
+
# B ADDITIONAL THEORY
|
| 398 |
+
|
| 399 |
+
# B.1 EQUIVARIANT NETWORKS AND DATA AUGMENTATION
|
| 400 |
+
|
| 401 |
+
A classic strategy for dealing with distributional shift by transformations in a group $G$ is to augment the training set $s$ by adding samples transformed under $G$ . That is, using the new training set $\begin{array} { r } { S ^ { \prime } = \bigcup _ { g \in G } \bar { g ( S ) } } \end{array}$ . We show that data augmentation has no advantage for a perfectly equivariant parameterized function $f _ { \theta } ( x )$ since training samples $( x , y )$ and $( g x , g y )$ are equivalent. That is, $f _ { \theta }$ learns the same from $( x , y )$ as from $( g x , g y )$ but with only possibly different sample weight. The following is a more formal statement of Proposition 1.
|
| 402 |
+
|
| 403 |
+
Proposition 5. Let $G$ act on $X$ and $Y$ . Let $f _ { \theta } \colon X \to Y$ be a parameterized class of $G$ -equivariant functions differentiable with respect to $\theta$ . Let $\mathcal { L } \colon Y \times Y \to \mathbb { R }$ be a $G$ -equivariant loss function where $G$ acts on $\mathbb { R }$ by $\chi ,$ , we have,
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\chi ( g ) \nabla _ { \theta } \mathcal { L } ( f _ { \theta } ( x ) , y ) = \nabla _ { \theta } \mathcal { L } ( f _ { \theta } ( g x ) , g y ) .
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Proof. Equality of the gradients follows equality of the functions $\begin{array} { r l } { \mathcal { L } ( f _ { \theta } ( g x ) , g y ) } & { { } = } \end{array}$ $\chi ( g ) \dot { \mathcal { L } } ( g ^ { - 1 } f _ { \theta } ( \bar { g } x ) , y ) = \chi ( \bar { g } ) \dot { \mathcal { L } } ( f _ { \theta } ( x ) , y )$ .
|
| 410 |
+
|
| 411 |
+
In the case of RMSE and rotation or uniform motion, the loss function is invariant. That is, equivariant with $\chi ( g ) = 1$ . Thus the gradient for sample $( x , y )$ and $( g x , g y )$ is equal. In the case of scale, the loss function is equivariant with $G = ( \mathbb { R } _ { > 0 } , \cdot )$ and $\overset { \cdot } { \chi } ( \lambda ) = \overset { \cdot } { \lambda }$ . In that case, the sample $( g x , g y )$ is the same as the sample $( x , y )$ but with sample weight $\chi ( g )$ .
|
| 412 |
+
|
| 413 |
+
# B.2 ADDING SKIP CONNECTIONS PRESERVES EQUIVARIANCE
|
| 414 |
+
|
| 415 |
+
We prove in general that adding skip connections to a network does not affect its equivariance with respect to linear actions in the following proposition 6. Define $f ^ { ( i j ) }$ as the functional mapping between layer $i$ and layer $j$ .
|
| 416 |
+
|
| 417 |
+
Proposition 6. Let the layer $V ^ { ( i ) }$ be a $G$ -representations for $0 \leq i \leq n$ . Let $f ^ { ( i j ) } \colon V ^ { ( i ) } \to V ^ { ( j ) }$ be $G$ -equivariant for $i < j$ . Define recursively $\begin{array} { r } { \pmb { x } ^ { ( j ) } = \sum _ { 0 \leq i < j } f ^ { ( i j ) } ( \pmb { x } ^ { ( i ) } ) } \end{array}$ . Then $\pmb { x } ^ { ( n ) } = f ( \pmb { x } ^ { ( 0 ) } )$ is $G$ -equivariant.
|
| 418 |
+
|
| 419 |
+
Proof. Assume $\mathbf { \boldsymbol { x } } ^ { ( i ) }$ is an equivariant function of $\mathbf { x } ^ { ( 0 ) }$ for $i < j$ . Then by equivariance of $f ^ { ( i j ) }$ and by linearity of the $G$ -action,
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\sum _ { 0 \leq i < j } f ^ { ( i j ) } ( g \pmb { x } ^ { ( i ) } ) = \sum _ { 0 \leq i < j } g f ^ { ( i j ) } ( \pmb { x } ^ { ( i ) } ) = g \pmb { x } ^ { ( j ) } ,
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
for $g \in G$ . By induction, $\pmb { x } ^ { ( n ) } = f ( \pmb { x } ^ { ( 0 ) } )$ is equivariant with respect to $G$
|
| 426 |
+
|
| 427 |
+
Both ResNet and U-net may be modeled as in Proposition 6 with some convolutional and activation components $f ^ { ( i , i + 1 ) }$ and some skip connections $f ^ { ( i \bar { j } ) } = I$ with $j - i \geq 2$ . Since $I$ is equivariant for any $G$ , we thus have:
|
| 428 |
+
|
| 429 |
+
Corollary 7. If the layers of ResNet or $U ^ { . }$ -net are $G$ -representations and the convolutional mappings and activation functions are $G$ -equivariant, then the entire network is $G$ -equivariant.
|
| 430 |
+
|
| 431 |
+
Corollary 7 allows us to build equivariant convolutional networks for rotational and scaling transformations, which are linear actions.
|
| 432 |
+
|
| 433 |
+
# B.3 RESULTS ON UNIFORM MOTION EQUIVARIANCE
|
| 434 |
+
|
| 435 |
+
In this section, we prove that for the combined convolution-activation layers of a CNN to be uniform motion equivariant, the CNN must be an affine function. We assume that the activation function is applied pointwise. That is, the same activation function is applied to every one-dimensional channel independently.
|
| 436 |
+
|
| 437 |
+
Proposition 8. Let $\boldsymbol { X }$ be a tensor of shape $h \times w \times c$ and $K$ be convolutional kernel of shape $k \times k \times c$ . Let $f ( \boldsymbol { X } ) = \boldsymbol { X } * \boldsymbol { K }$ be a convolutional layer which is equivariant with respect to arbitrary uniform motion $X \mapsto X + C$ for $C$ a constant tensor of the same shape as $\boldsymbol { X }$ . That is $C _ { i j k } = c f o r$ all $i , j , k$ for some fixed $c \in \mathbb { R }$ . Then the sum of the weights of $K$ is $I$ .
|
| 438 |
+
|
| 439 |
+
Proof. Since $f$ is equivariant, $\pmb { X } * K + \pmb { C } = ( \pmb { X } + \pmb { C } ) * K$ . By linearity, $C * K = C$ . Then because $C$ is a constant vector field, $\begin{array} { r } { C * K = C ( \sum _ { v } K ( v ) ) } \end{array}$ . As $C$ is arbitrary, $\begin{array} { r } { \sum _ { v } K ( v ) = 1 } \end{array}$ .
|
| 440 |
+
|
| 441 |
+
For an activation function to be uniform motion equivariant, it must be a translation.
|
| 442 |
+
|
| 443 |
+
Proposition 9. Let $\sigma : \mathbb { R } \mathbb { R }$ be a function satisfying $\sigma ( x + c ) = \sigma ( x ) + c .$ . Then $\sigma$ is a translatio
|
| 444 |
+
|
| 445 |
+
Proof. Let $a = \sigma ( 0 )$ . Then $\sigma ( x ) = \sigma ( x + c ) - c$ . Choosing $c = - x$ gives $\sigma ( x ) = a + x$
|
| 446 |
+
|
| 447 |
+
Proposition 10. Let $\boldsymbol { X }$ and $K$ be as in Prop 8. Let $f$ be a convolutional layer with kernel $K$ and $\sigma$ an activation function. Assume $\sigma \colon { \mathbb { R } } \to { \mathbb { R } }$ is piecewise differentiable. Then if the composition $\varphi = \sigma \circ f$ is equivariant with respect to arbitrary uniform motions, it is an affine map of the form $\varphi ( { \boldsymbol { X } } ) = K ^ { \prime } * { \boldsymbol { X } } + b$ , where $b$ is a real number and $\begin{array} { r } { \sum _ { v } K ^ { \prime } ( v ) = 1 } \end{array}$ .
|
| 448 |
+
|
| 449 |
+
Proof. If $f$ is non-zero, then we can choose a tensor $X$ , and constant tensor $C$ full of $c \in \mathbb { R }$ , and $p \in \mathbb { Z } ^ { 2 }$ such that $c$ and $\beta = ( f ( X ) ) _ { p }$ are any two real numbers. Let $\begin{array} { r } { \lambda = \sum _ { v } K ( v ) } \end{array}$ . As before $f ( C ) = \lambda C$ . Equivariance thus implies
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\sigma ( \beta + c \lambda ) = \sigma ( \beta ) + c .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Note $\lambda \neq 0$ , since if $\lambda = 0$ , then $\sigma ( \beta ) = \sigma ( \beta ) + c$ implies $c = 0$ . However $c$ is arbitrary. Let $h = c \lambda$ Then
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
{ \frac { \sigma ( \beta + h ) - \sigma ( \beta ) } { h } } = { \frac { 1 } { \lambda } } .
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
This holds for arbitrary $\beta$ and $h$ , and thus we find $\sigma$ is everywhere differentiable with slope $\lambda ^ { - 1 }$ . So $\sigma ( x ) = x / \lambda + b$ for some $b \in \mathbb { R }$ . We can then rescale the convolution kernel $K ^ { \prime } = K / \lambda$ to get $\varphi ( \boldsymbol { X } ) = K ^ { \prime } * \boldsymbol { X } + \boldsymbol { b } .$ . □
|
| 462 |
+
|
| 463 |
+
Corollary 11 (Corollary 2). If $f$ is a CNN alternating between convolutions $f _ { i }$ and pointwise activations $\sigma _ { i }$ and the combined layers $\sigma _ { i } \circ f _ { i }$ are uniform motion equivariant, then $f$ is affine.
|
| 464 |
+
|
| 465 |
+
Proof. This follows from Proposition 9 and the fact that composition of affine functions is affine.
|
| 466 |
+
|
| 467 |
+
Since our treatment is only for pointwise activation functions, it remains a possibility that more descriptive networks can be constructed using activation functions which span multiple channels.
|
| 468 |
+
|
| 469 |
+
Proposition 12 (Proposition 3). A residual block $f ( { \pmb x } ) + { \pmb x }$ is uniform motion equivariant if the residual connection $f$ is uniform motion invariant.
|
| 470 |
+
|
| 471 |
+
Proof. We denote the uniform motion transformation by $^ c$ by $T _ { c } ^ { \mathrm { u m } } ( \pmb { w } ) = \pmb { w } + \pmb { c }$ . Let $f$ be an invariant residual connection which is a composition of convolution layers and activation functions. Then we compute
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\begin{array} { r l } & { f \big ( T _ { c } ^ { \mathrm { u m } } ( { \pmb w } ) \big ) + T _ { c } ^ { \mathrm { u m } } ( { \pmb w } ) = f ( { \pmb w } ) + { \pmb w } + { \pmb c } } \\ & { \qquad = ( f ( { \pmb w } ) + { \pmb w } ) + { \pmb c } } \\ & { \qquad = T _ { c } ^ { \mathrm { u m } } ( f ( { \pmb w } ) + { \pmb w } ) . } \end{array}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
as desired.
|
| 478 |
+
|
| 479 |
+
# B.4 RESULTS ON SCALE EQUIVARIANCE
|
| 480 |
+
|
| 481 |
+
We show that a scale-invariant CNN in the sense of equation 1 would be extremely limited. Let $G = ( \mathbb { R } _ { > 0 } , \cdot )$ be the rescaling group. It is isomorphic to $( \mathbb { R } , + )$ . For $c$ a real number, $\rho _ { c } ( \lambda ) = \lambda ^ { c }$ gives an action of $G$ on $\mathbb { R }$ . There is also, e.g., a two-dimensional representation
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\rho ( \lambda ) = \left( \begin{array} { c c } { { 1 } } & { { \log ( \lambda ) } } \\ { { 0 } } & { { 1 } } \end{array} \right) .
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Proposition 13. Let $K$ be a $G$ -equivariant kernel for a convolutional layer. Assume $G$ acts on the input layer by $\rho _ { i n }$ and output layer by $\rho _ { o u t }$ . Assume that the input layer is padded with 0s. Then $K$ is $l x l$ .
|
| 488 |
+
|
| 489 |
+
Proof. If $v \ne 0$ then there exists $\lambda \in \mathbb { R } _ { > 0 }$ such that $\lambda v$ is outside the radius of the kernel. So $K ( \lambda v ) = 0$ . Thus by equivariance, for some $n$ ,
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
K ( v ) = \lambda ^ { \mathbf { n } } \rho _ { \mathrm { o u t } } ^ { - 1 } K ( \lambda v ) \rho _ { \mathrm { i n } } = 0 .
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
# B.5 EQUIVARIANCE ERROR.
|
| 496 |
+
|
| 497 |
+
In practice it is difficult to implement a model which is perfectly equivariant. This results in equivariance error $\mathrm { E E } _ { T } ( x ) \stackrel { } { = } \stackrel { \cdot } { | T ( f ( x ) ) - f ( T ( x ) ) | }$ . Given an input $x$ with true output $\hat { y }$ and transformed data $T ( x )$ , the transformed test error $\tilde { \Gamma \mathrm { T E } } = | T ( \hat { y } ) - f ( T ( x ) ) |$ can be bounded using the untransformed test error $\mathrm { T E } = | \hat { y } - f ( x ) |$ and EE.
|
| 498 |
+
|
| 499 |
+
Proposition 14. The transformed test error is bounded
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
\mathrm { T T E } \leq | T | \mathrm { T E } + \mathrm { E E } .
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
Proof. By the triangle inequality
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\begin{array} { r l } & { | T ( \hat { y } ) - f ( T ( x ) ) | \leq | T ( \hat { y } ) - T ( f ( x ) ) | + | T ( f ( x ) ) - f ( T ( x ) ) | } \\ & { \qquad = | T | | \hat { y } - f ( x ) | + \mathrm { E E } . } \end{array}
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
For uniform motion $\mathrm { T T E } \leq \mathrm { E E } + \mathrm { T E }$ since $| T ( \hat { y } ) - T ( f ( x ) ) | = | \hat { y } + c - f ( x ) - c | = \mathrm { T E }$ . Consider $x$ and $y$ as flattened into a vector. $| T | = \operatorname* { s u p } _ { | x | = 1 } | T ( x ) |$ denotes the operator norm. For $g \in S O ( 2 )$ , acting by $T _ { g }$ on vector fields, $\left| T _ { g } \right| = 1$ . For scaling $T ^ { \lambda } ( w ) ( x , t ) = \lambda w ( \lambda x , \lambda ^ { 2 } t )$ , $| T ^ { \lambda } | = \lambda / \sqrt { \lambda ^ { 4 } } = 1 / \lambda$ .
|
| 512 |
+
|
| 513 |
+
B.6 FULL LISTS OF SYMMETRIES OF HEAT AND NS EQUATIONS.
|
| 514 |
+
|
| 515 |
+
Symmetries of NS Equations. The Navier-Stokes equations are invariant under five different transformations (see e.g. [38]),
|
| 516 |
+
|
| 517 |
+
• Space translation: $T _ { c } ^ { \mathrm { s p } } \pmb { w } ( \pmb { x } , t ) = \pmb { w } ( \pmb { x } - \pmb { c } , t ) , \pmb { c } \in \mathbb { R } ^ { 2 }$ , • Time translation: $T _ { \tau } ^ { \mathrm { t i m e } } { \pmb w } ( { \pmb x } , t ) = { \pmb w } ( { \pmb x } , t - \tau ) , \tau$ $\tau \in \mathbb { R }$ , • Uniform motion: $T _ { c } ^ { \mathrm { u m } } \pmb { w } ( \pmb { x } , t ) = \pmb { w } ( \pmb { x } , t ) + c , c \in \mathbb { R } ^ { 2 }$ , • Reflect/rotation: $T _ { R } ^ { \mathrm { r o t } } { \pmb w } ( { \pmb x } , t ) = R { \pmb w } ( R ^ { - 1 } { \pmb x } , t ) , R \in O ( 2 ) ,$ • Scaling: $T _ { \lambda } ^ { s c } { \pmb w } ( { \pmb x } , t ) = \lambda { \pmb w } ( \lambda { \pmb x } , \lambda ^ { 2 } t ) , \lambda \in \mathbb { R } _ { > 0 } .$ .
|
| 518 |
+
|
| 519 |
+
Individually each of these types of transformations generates a group of symmetries of the system.
|
| 520 |
+
Collectively, they form a 7-dimensional symmetry group.
|
| 521 |
+
|
| 522 |
+
Symmetries of Heat Equation. The heat equation has an even larger symmetry group than the NS equations [38]. Let $H ( { \pmb x } , t )$ be a solution to equation $\mathcal { D } _ { \mathrm { h e a t } }$ . Then the following are also solutions:
|
| 523 |
+
|
| 524 |
+
• Space translation: $H ( \pmb { x } - \pmb { v } , t )$ , $\pmb { v } \in \mathbb { R } ^ { 2 }$ ,
|
| 525 |
+
• Time translation: $H ( { \pmb x } , t - c )$ , $c \in \mathbb { R }$ ,
|
| 526 |
+
• Galilean: $e ^ { - { \pmb v } \cdot { \pmb x } + { \pmb v } \cdot { \pmb v } t } H ( { \pmb x } - 2 { \pmb v } t , t ) , { \pmb v } \in \mathbb { R } ^ { 2 }$
|
| 527 |
+
• Reflect/Rotation: $H ( R { \pmb x } , t ) , R \in O ( 2 )$ ,
|
| 528 |
+
• Scaling: $H ( \lambda \mathbf { x } , \lambda ^ { 2 } t )$ , $\lambda \in \mathbb { R } _ { > 0 }$
|
| 529 |
+
• Linearity: $\lambda H ( { \pmb x } , t )$ , $\lambda \in \mathbb { R }$ and $H ( \mathbf { x } , t ) + H _ { 1 } ( \mathbf { x } , t ) , H _ { 1 } \in \mathrm { S o l } ( \mathcal { D } _ { \mathrm { h e a t } } )$ • Inversion: $a ( t ) e ^ { - a ( t ) c x \cdot x } H ( a ( t ) x , a ( t ) t )$ , where $a ( t ) = ( 1 + 4 c t ) ^ { - 1 } , c \in \mathbb { R }$ .
|
| 530 |
+
|
| 531 |
+
# B.7 TURBULENCE KINETIC ENERGY SPECTRUM
|
| 532 |
+
|
| 533 |
+
The turbulence kinetic energy spectrum $E ( k )$ is related to the mean turbulence kinetic energy as
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
\begin{array} { r } { \int _ { 0 } ^ { \infty } E ( k ) d k = ( \overline { { ( u ^ { \prime } ) ^ { 2 } } } + \overline { { ( v ^ { \prime } ) ^ { 2 } } } ) / 2 , } \\ { \overline { { ( u ^ { \prime } ) ^ { 2 } } } = \displaystyle \frac { 1 } { T } \sum _ { t = 0 } ^ { T } ( u ( t ) - \bar { u } ) ^ { 2 } , } \end{array}
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
where the $k$ is the wavenumber and $t$ is the time step. Figure 5 shows a theoretical turbulence kinetic energy spectrum plot. The spectrum can describe the transfer of energy from large scales of motion to the small scales and provides a representation of the dependence of energy on frequency. Thus, the Energy Spectrum Error can indicate whether the predictions preserve the correct statistical distribution and obey the energy conservation law. A trivial example that can illustrate why we need ESE is that if a model simply outputs moving averages of input frames, the accumulated RMSE of predictions might not be high but the ESE would be really big because all the small or even medium eddies are smoothed out.
|
| 540 |
+
|
| 541 |
+

|
| 542 |
+
Figure 5: Theoretical turbulence energy spectrum plot
|
| 543 |
+
|
| 544 |
+
# C HEAT DIFFUSION
|
| 545 |
+
|
| 546 |
+
2D Heat Equation. Let $H ( t , x , y )$ be a scalar field representing temperature. Then $H$ satisfies
|
| 547 |
+
|
| 548 |
+
$$
|
| 549 |
+
\frac { \partial H } { \partial t } = \alpha \Delta H .
|
| 550 |
+
$$
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\left( \mathcal { D } _ { \mathrm { h e a t } } \right)
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
Here $\Delta = \partial _ { x } ^ { 2 } + \partial _ { y } ^ { 2 }$ is the two-dimensional Laplacian and $\alpha \in \mathbb { R } _ { > 0 }$ is the diffusivity.
|
| 557 |
+
|
| 558 |
+
The Heat Equation plays a major role in studying heat transfer, Brownian motion and particle diffusion. We simulate the heat equation at various initial conditions and thermal diffusivity using the finite difference method and generate $6 k$ scalar temperature fields. Figure 6 shows a heat diffusion process where the temperature inside the circle is higher than the outside and the thermal diffusivity is 4. Since the heat equation is much simpler than the NS equations, a shallow CNN suffices to forecast the heat diffusion process.
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 6: Five snapshots in heat diffusion dynamics. The spatial resolution is $5 0 \times 5 0$ pixels.
|
| 562 |
+
|
| 563 |
+
For heat diffusion, due to the law of energy conservation, the sum of each temperature field should be consistent over the entire heat diffusion process. We evaluate the physical characteristics of the predictions using the L1 loss of the thermal energy. Table 5 shows the prediction RMSE and thermal energy loss of the CNNs and three Equ-CNNs on three transformed test sets. We can see that Equ-CNNs consistently outperform CNNs over three test sets.
|
| 564 |
+
|
| 565 |
+
Table 5: The prediction RMSE and thermal energy L1 loss of the CNNs and three Equ-CNNs on three transformed test sets. Equ-CNNs outperform the CNNs over all three test sets.
|
| 566 |
+
|
| 567 |
+
<table><tr><td>Testset$</td><td colspan="3">RMSE (Thermal Energy Loss)</td></tr><tr><td>Models</td><td>Mag</td><td>Rot</td><td>Scale</td></tr><tr><td>CNNs</td><td>0.103 (4696.3)</td><td>0.308 (1125.6)</td><td>0.357 (1447.6)</td></tr><tr><td>Equ-CNNs</td><td>0.028 (107.7)</td><td>0.153 (127.3)</td><td>0.045 (396.6)</td></tr></table>
|
| 568 |
+
|
| 569 |
+
# D IMPLEMENTATION DETAILS
|
| 570 |
+
|
| 571 |
+
# D.1 DATASETS DESCRIPTION
|
| 572 |
+
|
| 573 |
+
Rayleigh-Bénard convection Rayleigh-Bénard convection results from a horizontal layer of fluid heated from below, which is a major feature of the El Nino dynamics. The dataset comes from two dimensional turbulent flow simulated using the Lattice Boltzmann Method [8] with Rayleigh number $= 2 . 5 \times 1 0 ^ { 8 }$ . We divided each $1 7 9 2 \times 2 5 6$ image into 7 square sub-regions of size $2 5 6 \times 2 5 6$ , then downsample them into $6 4 \times 6 4$ pixels sized images. Figure 7 in appendix shows a snapshot in our RBC flow dataset. We generate the following test sets to test the models’ generalization ability.
|
| 574 |
+
|
| 575 |
+
• Uniform motion (UM): transformed test sets by adding random vectors drawn from $U ( - 1 , 1 )$ .
|
| 576 |
+
• Magnitude (Mag): transformed test sets by multiplying random values sampled from $U ( 0 , 2 )$ .
|
| 577 |
+
• Rotation $( R o t )$ : transformed test sets by randomly rotated by the multiples of $\pi / 1 2$ .
|
| 578 |
+
• Scale: transformed test sets by scaling each sample $\lambda$ sampled from $U ( 1 / 5 , 2 )$ .
|
| 579 |
+
|
| 580 |
+

|
| 581 |
+
Figure 7: A snapshot of the Rayleigh-Bénard convection flow, the velocity fields along $x$ direction (left) and $y$ direction (right) [8]. The spatial resolution is $1 7 9 2 \times 2 5 6$ pixels.
|
| 582 |
+
|
| 583 |
+
Ocean Currents We used the reanalysis ocean currents velocity data generated by the NEMO (Nucleus for European Modeling of the Ocean) simulation engine 2. We selected an area from each of the Atlantic, Indian and North Pacific Oceans from 01/01/2016 to 08/18/2017 and extracted $6 4 \times 6 4$ sub-regions for our experiments. The corresponding latitude and longitude ranges for the selected regions are $- 4 4 \sim - 2 3$ , $2 5 { \sim } 4 6 ,$ ), $( 5 5 \sim 7 6$ , ${ - 3 9 } \mathrm { \sim } { - 1 8 } $ ) and $( - 1 7 4 \sim - 1 5 3$ , $5 { \sim } 2 6$ ) respectively. We not only test all models on the future data but also on a different domain $- 1 8 0 \mathrm { \sim } - 1 5 9$ , $- 4 0 \sim - 5 9$ ) in South Pacific Ocean from 01/01/2016 to 12/15/2016. Also, the most recent work on this dataset is [15], which unified a warping scheme and an U-net to predict temperature. So to compare our equivariant models with state-of-arts, we also investigate our models on the task of temperature field predictions. Since the data back to year 2006 that [15] used is no longer available, we collect more recent temperature data from a square region $( - 5 0 \sim - 2 0 , 2 0 \sim 5 0 )$ in Atlantic Ocean from 01/01/2016 to 12/31/2017.
|
| 584 |
+
|
| 585 |
+
# D.2 EXPERIMENTS SETUP
|
| 586 |
+
|
| 587 |
+
We tested our convolutional equivariant layers in two architecture, 18-layer ResNet and 13-layer U-net. One of our goals is to show that adding equivariance improves the physical accuracy of state-of-the-art dynamics prediction. ResNet and ${ \mathrm { U } } - { \mathrm { n e t } }$ are the popular state-of-the-art methods at the moment and our equivariance techniques are well-suited for their architecture. The reason we did not use recurrent models, such as Convolutional LSTM, is that they are slow to train especially for our case where the input length is large. This does not fit our long-term goal of accelerating computation.
|
| 588 |
+
|
| 589 |
+
The input to each model is a $l \times 6 4 \times 6 4 \times 2 \cdot$ -size tensor representing the past $l$ timesteps of the velocity field. The output is a single velocity field. The value of $l$ is a hyper-parameter we tuned. We found the optimal value of $l$ to be around $l = 2 5$ . To predict more timesteps, we apply the model autoregressively, dropping the oldest timestep and concatenating the prediction to the input.
|
| 590 |
+
|
| 591 |
+
To make this a fair comparison, we adjust the hidden dimensions for different equivariant models to make sure that the number of parameters in all models are about the same for either architecture, which can be found in Table 6. Table 7 gives the hyper-parameter tuning ranges for our models. Note that the hidden dimension and the number of layers of the shallow CNNs for the heat diffusion task are also well-tuned.
|
| 592 |
+
|
| 593 |
+
The loss function used is the MSE between the predicted frames and the ground truth for next $k$ steps, where $k$ is a parameter we tuned. We found $k = 3$ or 4 give the best performance. We use $6 0 \% - 2 0 \% - 2 0 \%$ training-validation-test split in time and use the validation set for hyper-parameters tuning based on the average error of predictions. The training set corresponds to the first $60 \%$ of the entire dataset in time and the validation/test sets contains the following $40 \%$ . For fluid flows, we standardize the data by the average of velocity vectors and the standard deviation of the L2 norm of velocity vectors. For sea surface temperature, we did the exact same data preprocessing described in de Bezenac et al. [15].
|
| 594 |
+
|
| 595 |
+
Table 6: The number of parameters in each model and time costs for training an epoch on 8 V100 GPUs.
|
| 596 |
+
|
| 597 |
+
<table><tr><td>ResNet</td><td>Reg</td><td>UM</td><td>Mag</td><td>Rot</td><td>Scale</td><td>U-net</td><td>Reg</td><td>UM</td><td>Mag</td><td>Rot</td><td>Scale</td></tr><tr><td>Params (106)</td><td>11.0</td><td>11.0</td><td>11.0</td><td>10.2</td><td>10.7</td><td></td><td>6.2</td><td>6.2</td><td>6.2</td><td>7.1</td><td>5.9</td></tr><tr><td>Time(min)</td><td>3.04</td><td>5.21</td><td>5.50</td><td>14.31</td><td>160.32</td><td></td><td>2.15</td><td>4.32</td><td>4.81</td><td>11.32</td><td>135.72</td></tr></table>
|
| 598 |
+
|
| 599 |
+
# E ADDITIONAL RESULTS
|
| 600 |
+
|
| 601 |
+
Table 8 shows the RMSEs of temperature predictions. Figure 8 shows the ground truth and the√ predicted velocity norm fields $( \sqrt { u ^ { 2 } + v ^ { 2 } } )$ at time step 1, 5 and 10 by the U-net and four Equ-Unet
|
| 602 |
+
|
| 603 |
+
Table 7: The Hyper-parameter tuning range: Learning rate, the number of accumulated errors for backpropogation, the number of input frames, batch size, and the hidden dimension and the number of layers of the shallow CNNs for heat diffusion
|
| 604 |
+
|
| 605 |
+
<table><tr><td></td><td>Learning rate |#Accum Errors|#Input frames</td><td></td><td>Batch Size</td><td>Hidden dim (CNNs)| #Layers (CNNs)</td><td></td></tr><tr><td>1e-1~ 1e-6</td><td>1~10</td><td>1~30</td><td>4~64</td><td>8~128</td><td>1~10</td></tr></table>
|
| 606 |
+
|
| 607 |
+
on the four transformed test samples. Figure 9 shows the ground truth and the predicted ocean currents $( \sqrt { u ^ { 2 } + v ^ { 2 } } )$ at time step 5 and 10 by the regular ResNet and four Equ-ResNets on the test set of future time.
|
| 608 |
+
|
| 609 |
+
Table 8: The RMSEs of temperature predictions on test data. For equivariant models, the left number in the cell is ResNet and the right number in the cell is U-net
|
| 610 |
+
|
| 611 |
+
<table><tr><td></td><td>CLSTM</td><td>Bézenac</td><td>ResNet U-net</td><td></td><td>EquuM</td><td>Equmag</td><td>EquRot</td><td>Equscal</td></tr><tr><td>RMSE</td><td>0.46</td><td>0.38</td><td>0.41</td><td>0.391</td><td>0.38 1 0.37</td><td>0.39 10.37</td><td>0.3810.40</td><td>0.42 10.41</td></tr></table>
|
| 612 |
+
|
| 613 |
+

|
| 614 |
+
Figure 8: The ground truth and the predicted velocity norm fields $( \sqrt { u ^ { 2 } + v ^ { 2 } } )$ at time step 1, 5 and 10 by the U-net and four Equ-Unet on the four transformed test samples. From left to right, the transformed test samples are the original test samples uniform-motion-shifted by $( 1 , - 0 . 5 )$ , magnitude-scaled by 1.5, rotated by 90 degrees and upscaled by 3 respectively. The first row is the target, the second row is Equ-Unets predictions, and the third row is predictions by U-net.
|
| 615 |
+
|
| 616 |
+

|
| 617 |
+
Figure 9: The ground truth and the predicted ocean currents $( \sqrt { u ^ { 2 } + v ^ { 2 } } )$ at time step 5 and 10 by the regular ResNet and four Equ-ResNets on the test set of future time.
|
md/train/xboZWqM_ELA/xboZWqM_ELA.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEBIASED GRAPH NEURAL NETWORKS WITH AGNOSTIC LABEL SELECTION BIAS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Most existing Graph Neural Networks (GNNs) are proposed without considering the selection bias in data, i.e., the inconsistent distribution between the training set with test set. In reality, the test data is not even available during the training process, making selection bias agnostic. Training GNNs with biased selected nodes leads to significant parameter estimation bias and greatly impacts the generalization ability on test nodes. In this paper, we first present an experimental investigation, which clearly shows that the selection bias drastically hinders the generalization ability of GNNs, and theoretically prove that the selection bias will cause the biased estimation on GNN parameters. Then to remove the bias in GNN estimation, we propose a novel Debiased Graph Neural Networks (DGNN) with a differentiated decorrelation regularizer. The differentiated decorrelation regularizer estimates a sample weight for each labeled node such that the spurious correlation of learned embeddings could be eliminated. We analyze the regularizer in causal view and it motivates us to differentiate the weights of the variables based on their contribution on the confounding bias. Then, these sample weights are used for reweighting GNNs to eliminate the estimation bias, thus help to improve the stability of prediction on unknown test nodes. Comprehensive experiments are conducted on several challenging graph datasets with two kinds of label selection bias. The results well verify that our proposed model outperforms the state-of-the-art methods and DGNN is a flexible framework to enhance existing GNNs.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph Neural Networks (GNNs) are powerful deep learning algorithms on graphs with various applications (Scarselli et al., 2008; Kipf & Welling, 2016; Velickovi ˇ c et al., 2017; Hamilton et al., ´ 2017). Existing GNNs mainly learn a node embedding through aggregating the features from its neighbors, and such message-passing framework is supervised by node label in an end-to-end manner. During this training procedure, GNNs will effectively learn the correlation between the structure pattern and node feature with node label, so that GNNs are capable of learning the embeddings of new nodes and inferring their labels.
|
| 12 |
+
|
| 13 |
+
One basic requirement of GNNs making precise prediction on unseen test nodes is that the distribution of labeled training and test nodes is same, i.e., the structure and feature of labeled training and test nodes follow the similar pattern, so that the learned correlation between the current graph and label can be well generalized to the new nodes. However, in reality, there are two inevitable issues. (1) Because it is difficult to control the graph collection in an unbiased environment, the relationship between the collected real-world graph and the labeled nodes is inevitably biased. Training on such graph will cause biased correlation with node label. Taking a scientist collaboration network as an example, if most scientists with “machine learning” (ML) label collaborate with those with “computer vision” (CV) label, existing GNNs may learn spurious correlation, i.e., scientists who cooperate with CV scientist are ML scientists. If a new ML scientist only connects with ML scientists or the scientists in other areas, it will be probably misclassified. (2) The test node in the real scenario is usually not available, implying that the distribution of new nodes is agnostic. Once the distribution is inconsistent with that in the training nodes, the performance of all the current GNNs will be hindered. Even transfer learning is able to solve the distribution shift problem, however, it still needs the prior of test distribution, which actually cannot be obtained beforehand. Therefore, the agnostic label selection bias greatly affects the generalization ability of GNNs on unknown test data.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Effect of selection bias on GCN and GAT.
|
| 17 |
+
|
| 18 |
+
In order to observe selection bias in real graph data, we conduct an experimental investigation to validate the effect of selection bias on GNNs (details can be seen in Section 2.1). We select training nodes with different biased degrees for each dataset, making the distribution of training nodes and test nodes inconsistent. The results clearly show that selection bias drastically hinders the performance of GNNs on unseen test nodes. Moreover, with heavier bias, the performance drops more. Further, we theoretically analyze how the data selection bias results in the estimation bias in GNN parameters (details can be seen in Section 2.2). Based on the stable learning technique (Kuang et al., 2020), we can assume that the learned embeddings consist of two parts: stable variables and unstable variables. The data selection bias will cause the spurious correlation between these two kinds of variables. Thereby we prove that with the inevitable model misspecification, the spurious correlation will further cause the parameter estimation bias. Once the weakness of the current GNNs with selection bias is identified, one natural question is “how to remove the estimation bias in GNNs?”
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a novel Debiased Graph Neural Network (DGNN) framework for stable graph learning by jointly optimizing a differentiated decorrelation regularizer and a weighted GNN model. Specifically, the differentiated decorrelation regularizer is able to learn a set of sample weights under differentiated variable weights, so that the spurious correlation between stable and unstable variables would be greatly eliminated. Based on the causal view analysis of decorrelation regularizer, we theoretically prove that the weights of variables can be differentiated by the regression weights. Moreover, to better combine the decorrelation regularizer with GNNs, we prove that adding the regularizer to the embedding learned by the second to last layer could be both theoretically sound and flexible. Then the sample weights learned by decorrelation regularizer are used to reweight GNN loss so that the parameter estimation could be unbiased.
|
| 21 |
+
|
| 22 |
+
In summary, the contributions of this paper are three-fold: i) We investigate a new problem of learning GNNs with agnostic label selection bias. The problem setting is general and practical for real applications. ii) We bring the idea of variable decorrelation into GNNs to relieve bias influence on model learning and propose a general framework DGNN which could be adopted to various GNNs. iii) We conduct the experiments on real-world graph benchmarks with two kinds of agnostic label selection bias, and the experimental results demonstrate the effectiveness and flexibility of our model.
|
| 23 |
+
|
| 24 |
+
# 2 EFFECT OF LABEL SELECTION BIAS ON GNNS
|
| 25 |
+
|
| 26 |
+
In this section, we first formulate our target problem as follows:
|
| 27 |
+
|
| 28 |
+
Problem 1 (Semi-supervised Learning on Graph with Agnostic Label Selection Bias). Given a training graph $\mathcal { G } _ { t r a i n } = \{ \mathbf { A } _ { t r a i n } , \mathbf { X } _ { t r a i n } , \mathbf { Y } _ { t r a i n } \} ,$ , where $\mathbf { \bar { A } } _ { t r a i n } \in \mathbb { R } ^ { N \times N }$ ( $N$ nodes) represents the adjacency matrix, $\mathbf { X } _ { t r a i n } \in \mathbb { R } ^ { N \times D }$ (D features) refers to the node features and $\mathbf { Y } _ { t r a i n } \mathbf { \bar { \Pi } } \in \mathbb { R } ^ { n \times C }$ (n labeled nodes, $C$ classes) refers to the available labels for training $( n \ll N )$ , the task is to learn a GNN $g _ { \theta } ( \cdot )$ with parameter $\theta$ to precisely predict the label of nodes on test graph $\mathcal { G } _ { t e s t } =$ $\{ \mathbf { A } _ { t e s t } , \mathbf { X } _ { t e s t } , \mathbf { Y } _ { t e s t } \} ,$ , where distribution $\Psi ( \mathcal { G } _ { t r a i n } ) \neq \Psi ( \mathcal { G } _ { t e s t } )$ .
|
| 29 |
+
|
| 30 |
+
# 2.1 EXPERIMENTAL INVESTIGATION
|
| 31 |
+
|
| 32 |
+
We conduct an experimental investigation to examine whether the state-of-the-art GNNs are sensitive to the selection bias. The main idea is that we will perform two representative GNNs: GCN (Kipf & Welling, 2016) and GAT (Velickovi ˇ c et al., 2017) on three widely used graph datasets: ´ Cora, Citeseer, Pubmed (Sen et al., 2008) with different degrees of bias. If the performance drops sharply in comparison with the scenarios without selection bias, this will demonstrate that GNNs cannot generalize well in selection bias setting.
|
| 33 |
+
|
| 34 |
+
To simulate the agnostic selection bias scenario, we first follow the inductive setting in $\mathrm { { W u } }$ et al. (2019) that masks the validation and test nodes as the training graph $\mathcal { G } _ { t r a i n }$ in the training phase, and then infer the labels of validation and test nodes with whole graph $\mathcal { G } _ { t e s t }$ . In this way, the distribution of test node can be considered agnostic. Following Zadrozny (2004), we design a biased label selection method on training graph $\mathcal { G } _ { t r a i n }$ . The selection variable $e$ is introduced to control whether the node will be selected as labeled nodes, where $e = 1$ means selected and 0 otherwise. For node $i$ , we compute its neighbor distribution ratio: $r _ { i } = | \{ j | j \in \mathcal { N } _ { i } , y _ { j } \neq y _ { i } \} | / | \mathcal { N } _ { i } |$ , where ${ \mathcal { N } } _ { i }$ is neighborhood of node $i$ in $\mathcal { G } _ { t r a i n }$ and $y _ { j } \ne y _ { i }$ means the label of central node $i$ is not the label of its neighborhood node $j$ . And $r _ { i }$ measures the difference between the label of central node $i$ with the labels of its neighborhood. Then we average all the nodes’ $r$ to get a threshold $t$ . For each node, the probability to be selected is: $P ( e _ { i } = 1 | r _ { i } ) = \left\{ \begin{array} { r } { \epsilon \quad r _ { i } \ge t } \\ { 1 - \epsilon \quad r _ { i } < t } \end{array} \right.$ , where ∈ (0.5, 1) is used to control the degree of selection bias and the larger $\epsilon$ means heavier bias. We set $\epsilon$ as $\{ 0 . 7 , 0 . 8 , 0 . 9 \}$ to get three bias degrees for each dataset, termed as Light, Medium, Heavy, respectively. We select 20 nodes for each class for training and the validation and test nodes are same as Yang et al. (2016). Furthermore, we take the unbiased datasets as baselines, where the labeled nodes are selected randomly.
|
| 35 |
+
|
| 36 |
+
Figure 1 is the results of GCN and GAT on biased datasets. The dashed lines mean the performances of GCN/GAT on unbiased datasets and the solid lines refer to the results on biased datasets. We can find that: i) The dashed lines are all above the corresponding coloured solid lines, indicating that selection bias greatly affects the GNNs’ performance. ii) All solid lines decrease monotonically with the increase of bias degree, demonstrating that heavier bias will cause larger performance decrease.
|
| 37 |
+
|
| 38 |
+
# 2.2 THEORETICAL ANALYSIS
|
| 39 |
+
|
| 40 |
+
The above experiment empirically verifies the effect of selection bias on GNNs. Here we theoretically analyze the effect of selection bias on estimating the parameters in GNNs. First, because biased labeled nodes have biased neighborhood structure, GNNs will encode this biased information into the node embeddings. Based on stable learning technique (Kuang et al., 2020), we make following assumption:
|
| 41 |
+
|
| 42 |
+
Assumption 1. All the variables of embeddings learned by GNNs for each node can be decomposed as $\mathbf { H } = \{ \mathbf { S } , \mathbf { V } \}$ , where S represents the stable variables and $\mathbf { V }$ represents the unstable variables. Specifically, for both training and test environment, $\mathbb { E } ( \mathbf { Y } | \mathbf { S } = s , \mathbf { V } = v ) = \mathbb { E } ( \mathbf { Y } | \mathbf { S } = s )$ .
|
| 43 |
+
|
| 44 |
+
Under Assumption 1, the distribution shift between training set and test set is mainly induced by the variation in the joint distribution over $( \mathbf { S } , \mathbf { V } )$ , i.e., $\mathbb { P } ( \mathbf { S } _ { t r a i n } , \mathbf { V } _ { t r a i n } ) \neq \mathbb { P } ( \mathbf { S } _ { t e s t } , \dot { \mathbf { V } } _ { t e s t } )$ . However, there is an invariant relationship between stable variable S and outcome $\mathbf { Y }$ in both training and test environments, which can be expressed as $\mathbb { P } ( \mathbf { Y } _ { t r a i n } | \mathbf { S } _ { t r a i n } ) = \mathbb { P } ( \mathbf { Y } _ { t e s t } | \mathbf { S } _ { t e s t } )$ . Assumption 1 can be guaranteed by $\mathbf { Y \bot V } |$ S. Thus, one can solve the stable prediction problem by developing a function ${ \bar { f } } ( \cdot )$ based on S. However, one can hardly identify such variables in GNNs.
|
| 45 |
+
|
| 46 |
+
Without loss of generality, we take $\mathbf { Y }$ as continuous variable for analysis and have the following assumption:
|
| 47 |
+
|
| 48 |
+
Assumption 2. The true generation process of target variable $\mathbf { Y }$ contains not only the linear combination of stable variables S, but also the nonlinear transformation of stable variables.
|
| 49 |
+
|
| 50 |
+
Based on the above assumptions, we formalize the label generation process as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathbf { Y } = f ( \mathbf { X } , \mathbf { A } ) + \varepsilon = \mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S } { \beta _ { S } } + \mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { V } { \beta _ { V } } + g ( \mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S } ) + \varepsilon ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $\mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) \in \mathbb { R } ^ { N \times p }$ denotes an unknown function of $\mathbf { X }$ and $\mathbf { A }$ that learns node embedding and it can be learned by a GNN, such as GCN and GAT, the output variables of $\mathcal { G } ( \mathbf { X } , \mathbf { A } ; \boldsymbol { \theta } _ { g } )$ can be decomposed as stable variables G (X, A; θg)S ∈ RN×m and unstable variables $\mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { V } \in$ $\mathbf { R } ^ { N \times q } ( m + q = p ) , \beta _ { S } \in { \mathbb R } ^ { m \times 1 }$ and $\beta _ { V } \in \mathbb { R } ^ { q \times 1 }$ are the linear coefficients can be learned by the last layer of GNNs, $\varepsilon$ is the independent random noise, and $g ( \cdot )$ is the nonlinear transformation function of stable variables. According to Assumption 1, we know that coefficients of unstable variables $\mathcal { G } ( \mathbf { X } , \mathbf { A } ; \boldsymbol { \theta } _ { g } ) _ { V }$ are actually 0 (i.e., $\beta _ { V } { = } 0 )$ .
|
| 57 |
+
|
| 58 |
+
For a classical GNN model with linear regressor, its prediction function can be formulated as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\hat { \mathbf { Y } } = \hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S } \hat { \boldsymbol { \beta } } _ { S } + \hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { V } \hat { \boldsymbol { \beta } } _ { V } + \varepsilon .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Compared with Eq. (1), we can find that the parameters of GNN could be unbiasedly estimated if the nonlinear term $g ( \mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S } ) = 0$ , because the GNN model will have the same label generation mechanism as Eq. (1). However, limited by the nonlinear power of GNNs $\mathrm { \Delta X u }$ et al., 2019), it is reasonable to assume that there is a nonlinear term $g ( \mathcal { G } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S } ) \neq 0$ that cannot be fitted by the GNNs. Under this assumption, next, we taking a vanilla GCN (Kipf & Welling, 2016) as an example to illustrate how the distribution shift will induce parameter estimation bias. A two-layer GCN can be formulated as $\hat { \mathbf { A } } \sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } ) \mathbf { W } ^ { ( 1 ) }$ , where $\hat { \bf A }$ is the normalized adjacency matrix, W is the transformation matrix at each layer and $\sigma ( \cdot )$ is the Relu activation function. We decompose GCN as two parts: one is embedding learning part $\hat { \mathbf { A } } \sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } )$ , which can be decomposed as $[ \mathbf { S } ^ { \mathrm { T } } , \mathbf { V } ^ { \mathrm { T } } ]$ , corresponding to $\hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { S }$ and $\hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \theta _ { g } ) _ { V }$ in Eq. (2), and the other part is $\mathbf { W } ^ { ( 1 ) }$ , where the learned parameters can be decomposed as $[ \tilde { \beta } _ { S } , \tilde { \beta } _ { V } ]$ , corresponding to $[ \hat { \beta } _ { S } , \hat { \beta } _ { V } ]$ in Eq. (2). We aim at minimizing the square loss: $\begin{array} { r } { \mathcal { L } _ { G C N } = \sum _ { i = 1 } ^ { n } ( \mathbf { S } _ { i } ^ { \mathrm { T } } \tilde { \boldsymbol { \beta } } _ { S } + \mathbf { V } _ { i } ^ { \mathrm { T } } \tilde { \boldsymbol { \beta } } _ { V } - \mathbf { Y } _ { i } ) ^ { 2 } } \end{array}$ .
|
| 65 |
+
|
| 66 |
+
According to the derivation rule of partitioned regression model, we have:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\tilde { \beta } _ { V } - \beta _ { V } = \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathsf { T } } \mathbf { V } _ { i } \big ) ^ { - 1 } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathsf { T } } g \big ( \mathbf { S } _ { i } \big ) \big ) + \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathsf { T } } \mathbf { V } _ { i } \big ) ^ { - 1 } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathsf { T } } \mathbf { S } _ { i } \big ) \big ( \beta _ { S } - \tilde { \beta } _ { S } \big ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\tilde { \beta } _ { S } - \beta _ { S } = ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { S } _ { i } ^ { \Gamma } \mathbf { S } _ { i } ) ^ { - 1 } ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { S } _ { i } ^ { \Gamma } g ( \mathbf { S } _ { i } ) ) + ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { S } _ { i } ^ { \Gamma } \mathbf { S } _ { i } ) ^ { - 1 } ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { S } _ { i } ^ { \Gamma } \mathbf { V } _ { i } ) ( \beta _ { V } - \tilde { \beta } _ { V } ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $n$ is labeled node size, $\mathbf { S } _ { i }$ is $i$ -th sample of $\mathbf { S }$ , $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathrm { T } } g ( \mathbf { S } _ { i } ) \ : = \ : \mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } g ( \mathbf { S } ) ) + o _ { p } ( 1 ) } \end{array}$ , $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { V } _ { i } ^ { \mathrm { T } } \mathbf { S } _ { i } = \mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } \mathbf { S } ) + o _ { p } ( 1 ) } \end{array}$ and $o _ { p } ( 1 )$ is the error which is negligible. Ideally, $\tilde { \beta } _ { V } - \beta _ { V } = 0$ indicates that there is no bias between the estimated and the real parameter. However, if $\mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } \mathbf { S } ) \neq 0$ or $\mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } g ( \mathbf { S } ) ) \neq 0$ in Eq. (3), ${ \tilde { \beta } } _ { V }$ will be biased, leading to the biased estimation on $\tilde { \beta } _ { S }$ in Eq. (4) as well. Since the correlation between $\mathbf { V }$ and S (or $g ( \mathbf { S } ) )$ might shift in test phase, the biased parameters learned in training set is not the optimal parameters for predicting testing nodes. Therefore, to increase the stability of prediction, we need to unbiasedly estimate the parameters of ${ \tilde { \beta } } _ { V }$ by removing the correlation between $\mathbf { V }$ and S (or $g ( \mathbf { S } ) _ { \cdot }$ ) on training graph, making $\mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } \mathbf { S } ) = 0$ or $\mathbb { E } ( \mathbf { V } ^ { \mathrm { T } } g ( \mathbf { S } ) ) = 0$ . Note that $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { S } _ { i } ^ { \mathrm { T } } g ( \mathbf { S } _ { i } ) } \end{array}$ in Eq. (4) can also cause estimation bias, but the relation between S and $g ( \mathbf { S } )$ is stable across environments, which do not influence the stability to some extent.
|
| 77 |
+
|
| 78 |
+
# 3 PROPOSED MODEL
|
| 79 |
+
|
| 80 |
+
# 3.1 REVISITING ON VARIABLE DECORRELATION IN CAUSAL VIEW
|
| 81 |
+
|
| 82 |
+
To decorrelate $\mathbf { V }$ and $\mathbf { S }$ (or $g ( \mathbf { S } ) _ { \mathfrak { c } }$ ), we should decorrelate the output variables of $\hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \boldsymbol { \theta } _ { g } )$ (Kuang et al., 2020). They propose a Variable Decorrelation (VD) term with sample reweighting technique to eliminate the correlation between each variable pair, in which the sample weights are learned by jointly minimizing the moment discrepancy between each variable pair:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal { L } _ { V D } ( \mathbf { H } ) = \sum _ { j = 1 } ^ { p } | | \mathbf { H } _ { \cdot j } ^ { \mathrm { T } } \boldsymbol { \Lambda } _ { \mathbf { w } } \mathbf { H } _ { \ldots j } / n - \mathbf { H } _ { \cdot j } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { \ldots j } ^ { \mathrm { T } } \mathbf { w } / n | | _ { 2 } ^ { 2 } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where H ∈ Rn×p means the variables needed to be decorrelated, $\mathbf { H } _ { . j }$ is $j$ -th variable of ${ \bf H } , { \bf H } _ { - j } =$ $\mathbf { H } \backslash \mathbf { H } _ { . j }$ means all the remaining variables by setting the value of $j$ -th variable in $\mathbf { H }$ as zero, w $\mathbf { \tau } _ { r } \in \mathbb { R } ^ { n \times 1 }$ are sample weights, $\textstyle \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } = n$ and $\boldsymbol { \Lambda } _ { \mathbf { w } } = \mathrm { d i a g } ( \mathbf { w } _ { 1 } , \cdots , \mathbf { w } _ { n } )$ is the corresponding diagonal matrix. As we can see, $\mathcal { L } _ { V D } ( \mathbf { H } )$ can be reformulated as $\begin{array} { r l } { \phantom { } } & { { } \sum _ { j \neq k } | | \mathbf { H } _ { . j } ^ { \mathrm { T } } \boldsymbol { \Lambda } _ { \mathbf { w } } \mathbf { H } _ { . k } / n - \mathbf { H } _ { . j } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { . k } ^ { \mathrm { T } } \mathbf { w } / n | | _ { 2 } ^ { 2 } } \end{array}$ , and it aims to let $\mathbb { E } ( \mathbf { H } _ { . i } ^ { \mathrm { T } } \mathbf { H } _ { . j } ) = \mathbb { E } ( \mathbf { H } _ { . i } ^ { \mathrm { T } } ) \mathbb { E } ( \mathbf { H } _ { . j } )$ for each variable pair $j$ and $k$ ${ \bf \nabla } . { \mathcal { L } } _ { V D } ( { \bf H } )$ decorrelates all the variable pairs equally. However, decorrelating all the variables requires sufficient samples Kuang et al. (2020), i.e., $n \to \infty$ , which is hard to be satisfied, especially in the semi-supervised setting. In this scenario, we cannot guarantee $\mathcal { L } _ { V D } ( \mathbf { H } ) = 0$ . Therefore the key challenge is how to remove the correlation influencing the unbiased estimation most when $\mathcal { L } _ { V D } ( \dot { \mathbf { H } } ) \neq 0$ .
|
| 89 |
+
|
| 90 |
+
Inspired by confounding balancing technique in observational studies (Hainmueller, 2012), we revisit the variable decorrelation regularizer in causal view and show how to differentiate each variable pair. Confounding balancing techniques are often used for causal effect estimation of treatment $T$ , where the distributions of confounders $\mathbf { X }$ are different between treated $( T = 1 )$ ) and control $( T = 0$ ) groups because of non-random treatment assignment. One could balance the distribution of confounders between treatment and control groups to unbiased estimate causal treatment effects (Yao et al., 2020). Most balancing approaches exploit moments to characterize distributions, and balance them by adjusting sample weights w as follows: $\begin{array} { r } { \mathbf { w } = \arg \operatorname* { m i n } _ { \mathbf { w } } | | \sum _ { i : T _ { i } = 1 } \mathbf { X } _ { i } - \sum _ { i : T _ { i } = 0 } \mathbf { w } _ { i } \cdot \mathbf { X } _ { i } | | _ { 2 } ^ { 2 } } \end{array}$ . After balancing, the treatment $T$ and confounders $\mathbf { X }$ tend to be independent.
|
| 91 |
+
|
| 92 |
+
Given one targeted variable $j$ , under the variables only have linear relation assumption1, its decorrelataion term, $\mathcal { L } _ { V D _ { j } } = | | \mathbf { H } _ { . j } ^ { \mathrm { T } } \boldsymbol { \Lambda } _ { \mathbf { w } } \mathbf { H } _ { . - j } / n - \mathbf { H } _ { . j } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { . - j } ^ { \mathrm { T } } \mathbf { w } / n | | _ { 2 } ^ { 2 }$ , is to make $\mathbf { H } _ { . j }$ independent of $\mathbf { H } _ { . - j }$ , which is same as the confounding balancing term making treatment and confounders independent. Thereby, $\mathcal { L } _ { V _ { \frac { . } { . } } D _ { j } }$ can also be viewed as a confounding balancing term, where $\mathbf { H } _ { . j }$ is treatment and $\mathbf { H } _ { . - j }$ is confounders, illustrated in Fig. 2(a). Hence, our target can be explained as unbiasedly estimate causal effect of each variable which is invariant across training and test set. As different variable may contribute unequally to the confounding bias, it is necessary to differentiate the confounders. The target of differentiating confounders exactly matches our target that removes the correlation of variables influencing the unbiased estimation most.
|
| 93 |
+
|
| 94 |
+
# 3.2 DIFFERETIATED VARIABLE DECORRELATION
|
| 95 |
+
|
| 96 |
+
Considering the continuous treatment, the causal effect of treatment can be measured by Marginal Treatment Effect Function (MTEF) (Kreif et al., 2015), and defined as: $M T E F \ =$ E[Yi(t)]−E[Yi(t−∆t)] , where Yi(t) represents the potential outcome of sample i with treatment status $T = t , \mathbb { E } ( \cdot )$ refers to the expectation function, and $\Delta t$ denotes the increasing level of treatment. With the sample weights w decorrelating treatment and confounders, we can estimate the MTEF by:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\widehat { M T E F } = \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot Y _ { i } ( t ) - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot Y _ { j } ( t - \Delta t ) } { \Delta t } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Next we theoretically analyze how to differentiate confounders’ weights with following theorem.
|
| 103 |
+
|
| 104 |
+
Theorem 1. In observational studies, different confounders make unequal confounding bias on Marginal Treatment Effect Function (MTEF) with their own weights, and the weights can be learned via regressing outcome $Y$ on confounders $\mathbf { X }$ and treatment variable $T$ .
|
| 105 |
+
|
| 106 |
+
We prove Theorem 1 with the following assumption:
|
| 107 |
+
|
| 108 |
+
Assumption 3 (Linearity). The regression of outcome $Y$ on confounders $\mathbf { X }$ and treatment variable $T$ is linear, that is $\begin{array} { r } { Y = \dot { \sum } _ { k \neq t } \alpha _ { k } \mathbf { X } _ { . k } + \alpha _ { t } T + c + \varepsilon , } \end{array}$ , where $\alpha _ { k } \in \alpha$ is the linear coefficient.
|
| 109 |
+
|
| 110 |
+
Under Assumption 3, we can write estimator of $\overline { { M T E } } F$ as:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { r l } & { \widehat { M T E F } = \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot Y _ { i } ( t ) - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot Y _ { j } ( t - \Delta t ) } { \Delta t } } \\ & { \qquad = M T E F + \sum _ { k \neq t } \alpha _ { k } ( \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot \mathbf { X } _ { i k } - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot \mathbf { X } _ { j k } } { \Delta t } ) + \phi ( \varepsilon ) , } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $M T E F$ is the ground truth, $\phi ( \varepsilon )$ means the noise term, and $\phi ( \varepsilon ) \simeq 0$ with Gaussian noise. The detailed derivation can be found in Appendix A. To reduce the bias of $\overline { { M T E } } F$ , we need regulate the term ( ∑i∶Ti=t wi⋅Xik−∑j∶Tj =t−∆t wj ⋅Xjk ), where $\frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot \mathbf { X } _ { i k } - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot \mathbf { X } _ { j k } } { \Delta t }$ means the difference of the $k$ -th confounder between treated and control samples. The parameter $\alpha _ { k }$ represents the confounding bias weight of the $k$ -th confounder, and it is the coefficient of $\mathbf { X } _ { , k }$ . Moreover, because our target is to learn the weight of each variable pair, i.e., between treatment and each confounder, we need to learn the weight $\alpha _ { t }$ of treatment that is the coefficient of $T$ . Hence, the confounder weights and treatment weight can be learned from the regression of observed outcome $Y$ on confounders $\mathbf { X }$ and treatment $T$ under Linearity assumption.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 2: (a) Diagram of decorrelating node embedding with confounding balance. H(K−1) i s the node embedding to be decorrelated. $T$ is the treatment, corresponding to one target variable in H(K−1). $\mathbf { X }$ is the confounders, corresponding to the remaining variables of the target variable in $\mathbf { H } ^ { ( K - 1 ) }$ . $Y$ is the outcome, corresponding to labels. (b) The framework of GNN-DVD. The same color in the two figures represents the same kind of variable.
|
| 120 |
+
|
| 121 |
+
Due to the connection between treatment effect estimation with variable decorrelation as analyzed in Section 3.1, we utilize Theorem 1 to reweight the variable weight in variable decorrelation term. When apply the Theorem 1 to GNNs, the confounders $\mathbf { X }$ should be $\mathbf { H } _ { . - j }$ and treatment is $\mathbf { H } _ { . j }$ , where the embedding $\mathbf { H }$ is learned by $\hat { \mathcal { G } } ( \mathbf { X } , \mathbf { A } ; \boldsymbol { \theta } _ { g } )$ in Eq. (2). And the variable weights $\alpha$ could be computed from the regression coefficients for $\mathbf { H }$ , hence $\alpha$ is equal to $\hat { \beta }$ in Eq. (2). Then the Differentiated Variable Decorrelation (DVD) term can be formulated as follows:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { \mathbf { w } } \mathcal { L } _ { D V D } \big ( \mathbf { H } \big ) = \sum _ { j = 1 } ^ { p } \big ( \boldsymbol { \alpha } ^ { \mathrm { T } } \cdot \mathrm { a b s } \big ( \mathbf { H } _ { \mathcal { I } } ^ { \mathrm { T } } \boldsymbol { \Lambda } _ { \mathbf { w } } \mathbf { H } _ { . - j } / n - \mathbf { H } _ { \mathcal { I } } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { . - j } ^ { \mathrm { T } } \mathbf { w } / n \big ) \big ) ^ { 2 } } \\ { \displaystyle \qquad + \frac { \lambda _ { 1 } } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } ^ { 2 } + \lambda _ { 2 } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } - 1 \big ) ^ { 2 } , s . t . \mathbf { w } \succeq 0 } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\operatorname { a b s } ( { \mathord { \cdot } } )$ means the element-wise absolute value operation, preventing positive and negative values from eliminating. Term $\frac { \lambda _ { 1 } } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } ^ { 2 }$ is added to reduce the variance of sample weights to achieve stability, and the formula $\begin{array} { r } { \lambda _ { 2 } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \mathbf { w } _ { i } } - 1 \big ) ^ { 2 } } \end{array}$ avoids all the sample weights to be 0. The term $\mathbf { w } \succeq 0$ constrains each sample weight to be non-negative. After variable reweighting, the weighted decorrelation term in Eq. (8) can band the weight for variable pair rewrand en as wou $\begin{array} { r l } { \phantom { x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x } } & { { } \phantom { x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x } } \end{array}$ $j$ $k$ $\alpha _ { j } ^ { 2 } \alpha _ { k } ^ { 2 }$ treatment and confounder. We prove the uniqueness property of w in Appendix B, as follows:
|
| 128 |
+
|
| 129 |
+
Theorem 2 (Uniqueness). If $\lambda _ { 1 } n \gg p ^ { 2 } + \lambda _ { 2 }$ , $p ^ { 2 } \gg \operatorname* { m a x } ( \lambda _ { 1 } , \lambda _ { 2 } )$ , $| \mathbf { H } _ { i , j } | \leq c$ and $\left| \alpha _ { i } \right| \leq c$ for some constant c, the solution $\mathbf { \dot { v } } \in \left\{ \mathbf { w } : \left| \mathbf { w } _ { i } \right| \leq c \right\}$ to minimize Eq. (8) is unique.
|
| 130 |
+
|
| 131 |
+
# 3.3 DEBIASED GNN FRAMEWORK
|
| 132 |
+
|
| 133 |
+
In this section, we describe the framework of Debiased GNN that incorporates DVD/VD term with GNNs in a seamless way. As analyzed in Section 2.2, decorrelating $\hat { \mathbf { A } } \sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } )$ could make GCN stable. However, most GNNs follow a layer-by-layer stacking structure, and the output embedding of each layer is more easy to obtain in implementing. Since $\hat { \mathbf { A } } \sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } )$ is the aggregation of the first layer embedding $\sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } )$ , decorrelating these variables may lack the flexibility that incorporates DVD/VD term with other GNN structure. Fortunately, we have the following theorem to identify a more flexible way to combine variable decorrelation with GNNs.
|
| 134 |
+
|
| 135 |
+
Theorem 3. Given p pairwise uncorrelated variables $\mathbf { Z } = ( \mathbf { Z } _ { 1 } , \mathbf { Z } _ { 2 } , \cdots , \mathbf { Z } _ { p } )$ , with a linear aggregation operator $\hat { \bf A }$ , the variables of $\mathbf { Y } = \hat { \mathbf { A } } \mathbf { Z }$ are still pairwise uncorrelated.
|
| 136 |
+
|
| 137 |
+
Proof can be found in Appendix C. The theorem indicates that if the variables of embeddings $\mathbf { Z }$ are uncorrelated, after any form of linear neighborhood aggregation $\hat { \bf A }$ , e.g., average, attention or sum, the variables of transformed embeddings $\mathbf { Y }$ would be also uncorrelated. Therefore, decorrelating $\sigma ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } )$ can also reduce the estimation bias. For a $K$ layers of GNN, we can directly decorrelate the output of $( K - 1 )$ -th layer, i.e., $\sigma ( \hat { \mathbf { A } } { \cdots } { \sigma } ( \hat { \mathbf { A } } \mathbf { X } \mathbf { W } ^ { ( 0 ) } ) { \cdots } { \mathbf { W } } ^ { ( K - 2 ) } )$ for a $K$ layers of GCN.
|
| 138 |
+
|
| 139 |
+
The previous analysis finds a flexible way to incorporate DVD/VD term with GNNs, however, recall that we analyze GNNs based on the least squares loss, and most existing GNNs are designed for classification. Therefore, in the following, we analyze that the previous conclusions are still applicable in classification. We consider the cases that softmax layer is used as the output layer of GNNs and loss is the cross-entropy error function. We use the Newton-Raphson update rule (Bishop, 2006) to bridge the gap between linear regression and multi-classification. According to the Newton-Raphson update rule, the update formula for transformation matrix $\mathbf { W } ^ { ( K - 1 ) }$ of the last layer of GCN can be derived:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r l } & { \mathbf { W } _ { , j } ^ { ( \mathrm { n e w } ) } = \mathbf { W } _ { , j } ^ { ( \mathrm { o l d } ) } - \left( { \boldsymbol { \mathbf { H } } ^ { \mathrm { T } } } \mathbf { R } { \boldsymbol { \mathbf { H } } } \right) ^ { - 1 } \mathbf { H } ^ { \mathrm { T } } ( \mathbf { H } \mathbf { W } _ { , j } ^ { ( \mathrm { o l d } ) } - \mathbf { Y } _ { , j } ) } \\ & { \qquad = \left( \mathbf { H } ^ { \mathrm { T } } \mathbf { R } \mathbf { H } \right) ^ { - 1 } \{ \mathbf { H } ^ { \mathrm { T } } \mathbf { R } \mathbf { H } \mathbf { W } _ { , j } ^ { ( \mathrm { o l d } ) } - \mathbf { H } ^ { \mathrm { T } } ( \mathbf { H } \mathbf { W } _ { , j } ^ { ( \mathrm { o l d } ) } - \mathbf { Y } _ { , j } ) \} = \left( \mathbf { H } ^ { \mathrm { T } } \mathbf { R } \mathbf { H } \right) ^ { - 1 } \mathbf { H } ^ { \mathrm { T } } \mathbf { R } \mathbf { z } , } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $\begin{array} { r } { \mathbf { R } _ { k j } = - \sum _ { n = 1 } ^ { N } \mathbf { H } _ { n } \mathbf { W } _ { . k } ^ { \mathrm { ( o l d ) } } ( \mathbf { I } _ { k j } - \mathbf { H } _ { n } \mathbf { W } _ { . j } ^ { \mathrm { ( o l d ) } } ) } \end{array}$ is a weighing matrix and $\mathbf { I } _ { k j }$ is the element of the identity matrix, and z = HW(old).j − $\mathbf { z } = \mathbf { H } \mathbf { W } _ { . j } ^ { ( \mathrm { o l d } ) } - \mathbf { R } ^ { - 1 } ( \mathbf { Y } _ { . j } - \mathbf { W } _ { . j } \mathbf { H } )$ is an effective target value. Eq. (9) takes the form of a set of normal equations for a weighted least-squares problem. As the weighing matrix R is not constant but depends on the parameter vector W(old).j , we must apply the normal equations iteratively. Each iteration uses the last iteration weight vector W(old).j t matrix $\mathbf { R }$ and regresses the target value $\mathbf { z }$ with $\mathbf { H } \mathbf { W } _ { . j } ^ { ( \mathrm { n e w } ) }$ . Th o compute a revised weighing, the variable decorrelation can also be applied to the GNNs with softmax classifier to reduce the estimation bias in each iteration.
|
| 146 |
+
|
| 147 |
+
Figure 2(b) is the framework of GNN-DVD, and we input the labeled nodes’ embeddings H˜ (K−1) into the regularizer $\mathcal { L } _ { D V D } ( \tilde { \mathbf { H } } ^ { ( K - 1 ) } )$ . As GCN has the formula sof tmax $\mathbf { \mathbf { \mathbf { A } } } \mathbf { H } ^ { ( K - 1 ) } \mathbf { \mathbf { W } } ^ { ( K - 1 ) } )$ , the variable weights of H˜ (K−1) used for differentiating $\mathcal { L } _ { D V D } ( \tilde { \mathbf { H } } ^ { ( K - 1 ) } )$ can be computed from $\alpha = \mathrm { V a r } ( \mathbf { W } ^ { ( K - 1 ) } , \mathrm { a x i s = 1 } )$ , where ${ \mathrm { V a r } } ( \cdot , { \mathrm { a x i s } } = 1 _ { . }$ ) refers to calculating the variance of each row of some matrix and it reflects each variable’s weight for classification which is similar to the regression coefficients. Note that when incorporating VD term with GNNs, we do not need compute the variable weights. Then the sample weights w learned by DVD term have the ability to remove the correlation in $\tilde { \mathbf { H } } ^ { ( K - 1 ) }$ . We propose to use this sample weights to reweight softmax loss:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\operatorname* { m i n } _ { \theta } \mathcal { L } _ { G } = \sum _ { l \in \mathcal { V } _ { L } } \mathbf { w } _ { l } \cdot \ln ( q ( \tilde { \mathbf { H } } _ { l } ^ { ( K ) } ) \cdot \mathbf { Y } _ { l } ) ,
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $q ( \cdot )$ is the softmax function, $\mathcal { { V } } _ { L }$ is the set of labeled node indices and $\theta$ is the set of parameters of GCN. The complexity analysis as well as the optimization of whole algorithm are summarized in Appendix D.
|
| 154 |
+
|
| 155 |
+
# 4 EXPERIMENTS
|
| 156 |
+
|
| 157 |
+
Datasets Here, we validate the effectiveness of our method on node classification with two kinds of selection biased data, i.e., label selection bias and small sample selection bias. For label selection bias, we empoly three widely used graph datasets: Cora, Citeseer and Pubmed (Sen et al., 2008). As in Section 2.1, we make the inductive setting for each graph and get three biased degrees for each graph. For small sample selection bias, we conduct the experiments on NELL dataset (Carlson et al., 2010) that each class only has one labeled node for training. Due to the large scale of this dataset, the test nodes are easily to have distribution shift from training nodes. The details of the datasets and experimental setup are given in Appendix E. One can download codes and datasets for all experiments from the supplementary material.
|
| 158 |
+
|
| 159 |
+
Table 1: Performance of three citation networks. The ‘\*’ indicates the best results of the baselines. Best results of all methods are indicated in bold. $\cdot \%$ gain over GCN/GAT’ means the improvement percent of GCN/GAT-DVD against GCN/GAT, respectively.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Cora</td><td colspan="3">Citeseer</td><td colspan="3">Pubmed</td></tr><tr><td>Light</td><td>Medium</td><td>Heavy</td><td>Light</td><td>Medium</td><td>Heavy</td><td>Light</td><td>Medium</td><td>Heavy</td></tr><tr><td>MLP</td><td>0.5624</td><td>0.5197</td><td>0.5087</td><td>0.4532</td><td>0.3757</td><td>0.3893</td><td>0.6852</td><td>0.6620</td><td>0.6378</td></tr><tr><td>Planetoid (Yang et al., 2016)</td><td>0.5890</td><td>0.5240</td><td>0.5180</td><td>0.5160</td><td>0.5140</td><td>0.4880</td><td>0.7160</td><td>0.6770</td><td>0.6680</td></tr><tr><td>Chebyshev (Defferrard et al.,2016)</td><td>0.7116</td><td>0.7006</td><td>0.6809</td><td>0.6542</td><td>0.6276</td><td>0.5920</td><td>0.7358</td><td>0.6862</td><td>0.6732</td></tr><tr><td>SGC (Wu et al., 2019)</td><td>0.7800</td><td>0.7800</td><td>0.7530</td><td>0.6780</td><td>0.6730*</td><td>0.6200</td><td>0.7880*</td><td>0.7560</td><td>0.6800</td></tr><tr><td>APPNP (Klicpera et al.,2019)</td><td>0.7913</td><td>0.7689</td><td>0.7629</td><td>0.6478</td><td>0.6052</td><td>0.5903</td><td>0.7639</td><td>0.7369</td><td>0.6862</td></tr><tr><td>GNM-GCN (Zhou et al.,2019)</td><td>0.7423</td><td>0.7531</td><td>0.7196</td><td>0.5793</td><td>0.5717</td><td>0.5125</td><td>0.7552</td><td>0.7381</td><td>0.7072</td></tr><tr><td>GNM-GAT (Zhou etal., 2019)</td><td>0.7875</td><td>0.7638</td><td>0.7404</td><td>0.6524</td><td>0.6487</td><td>0.5865</td><td>0.7438</td><td>0.7568</td><td>0.6891</td></tr><tr><td>GCN(Kipf &Welling,2016)</td><td>0.7851</td><td>0.7775</td><td>0.7422</td><td>0.6786</td><td>0.5952</td><td>0.5551</td><td>0.7673</td><td>0.7545</td><td>0.7247</td></tr><tr><td>GCN-VD</td><td>0.7951</td><td>0.7855</td><td>0.7522</td><td>0.6844</td><td>0.6676</td><td>0.6408</td><td>0.7727</td><td>0.7729</td><td>0.7399</td></tr><tr><td>GCN-DVD</td><td>0.7959</td><td>0.7885</td><td>0.7555</td><td>0.6908</td><td>0.6769</td><td>0.6496</td><td>0.7741</td><td>0.7746</td><td>0.7542</td></tr><tr><td>% gain over GCN</td><td>1.38%</td><td>1.41%</td><td>1.79%</td><td>1.8%</td><td>14.2%</td><td>17.0%</td><td>0.89%</td><td>2.67%</td><td>4.07%</td></tr><tr><td>GAT(Velickovic et al.,2017)</td><td>0.8067*</td><td>0.8019*</td><td>0.7578</td><td>0.7033*</td><td>0.6683</td><td>0.6475*</td><td>0.7665</td><td>0.7579*</td><td>0.7068</td></tr><tr><td>GAT-VD</td><td>0.8146</td><td>0.8079</td><td>0.7708</td><td>0.7149</td><td>0.6833</td><td>0.6611</td><td>0.7783</td><td>0.7689</td><td>0.7149</td></tr><tr><td>GAT-DVD</td><td>0.8179</td><td>0.8119</td><td>0.7694</td><td>0.7172</td><td>0.6825</td><td>0.6627</td><td>0.7788</td><td>0.7723</td><td>0.7210</td></tr><tr><td>% gain over GAT</td><td>1.39%</td><td>1.26%</td><td>1.53%</td><td>1.97%</td><td>2.12%</td><td>2.34%</td><td>1.6%</td><td>1.9%</td><td>2.0%</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Baselines Under our proposed framework, we incorporate the VD/DVD term with GCN and GAT called GCN-VD/DVD and GAT-VD/DVD (details in Appendix F), and thus GCN and GAT are two basic baselines. We compare with GNM-GCN/GAT (Zhou et al., 2019) that considers the label selection bias in transductive setting. Moreover, several state-of-the-art GNNs are included: Chebyshev filter (Kipf & Welling, 2016), SGC (Wu et al., 2019) and APPNP (Klicpera et al., 2019). Additionally, we compare with Planetoid (Yang et al., 2016) and MLP trained on the labeled nodes.
|
| 164 |
+
|
| 165 |
+
Results on Label Selection Bias Dataset The results are given in Table 1, and we have the following observations. First, the proposed models (i.e., GCN/GAT with VD/DVD terms) always achieve the best performances in most cases, which well demonstrates that the effectiveness of our proposed debiased GNN framework. Second, comparing with base models, our proposed models all achieve up to $1 7 . 0 \%$ performance improvements, and gain larger improvements under heavier bias scenarios. Since the major difference between our model with base models is the VD/DVD regularizer, we can safely attribute the significant improvements to the effective decorrelation term and its seamless joint with GNN models. Moreover, GCN/GAT-DVD achieve better results that GCN/GAT-VD in most cases. It validates the importance and effectiveness of differentiating variables’ weights in semi-supervised setting. Additional experimental results about the sample weight analysis and parameter sensitivity analysis can be found in Appendix G.
|
| 166 |
+
|
| 167 |
+
Results on Small Sample Selection Bias Dataset As NELL is a large-scale graph, we cannot run GAT on a single GPU with 16GB memory. We only perform GCN-VD/DVD and compare with representative methods which can perform on this dataset. The results are shown in Table 2. First, GCN-VD/DVD achieve significant improvements over GCN. It indicates that selection bias could be induced by a small number of labeled nodes and our proposed method can relieve the estimation bias. Moreover, GCN-DVD further improves GCN-VD with a large margin. It further validates that decorrelating all the variable pairs equally is suboptimal, and our differentiated strategy is effective when labeled nodes are scarce. The reason that GNM-GCN fails is the GNM relies on the accuracy of the IPW estimator that predicts the probability of a node to be selected, however, in this dataset, the ratio of positive and negative samples are extremely unbalanced influencing the performance of IPW.
|
| 168 |
+
|
| 169 |
+
Table 2: Performance of NELL
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Dataset</td><td>MLP</td><td>Planetoid</td><td>SGC</td><td>GNM-GCN</td><td>GCN</td><td>GCN-VD</td><td>GCN-DVD</td></tr><tr><td>NELL</td><td>0.2385</td><td>0.3901</td><td>0.4128</td><td>0.1589</td><td>0.4416</td><td>0.4652</td><td>0.4734</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 5 RELATED WORKS
|
| 174 |
+
|
| 175 |
+
In the past few years, Graph Neural Networks (GNNs) (Scarselli et al., 2008; Kipf & Welling, 2016; Velickovi ˇ c et al., 2017; Xu et al., 2019; Klicpera et al., 2019) have become the major technology ´ to capture patterns encoded in the graph due to its powerful representation capacity. Although the current GNNs have achieved great success, when applied to inductive setting, they all assume that training nodes and test nodes follow the same distribution. However, this assumption does not always hold in real applications. GNM (Zhou et al., 2019) first pays attention on the label selection problem on graph learning, and it learns a IPW estimator to estimate the probability of each node to be selected and uses this probability to reweight the labeled nodes. However, it heavily relies on the accuracy of IPW estimator, which depends on the label assignment distribution of whole graph, hence it is more suitable for transductive setting.
|
| 176 |
+
|
| 177 |
+
To enhance the stability in unseen varied distributions, some literatures (Shen et al., 2020b; Kuang et al., 2020) have revealed the connection between correlation and prediction stability under model misspecification. However, these methods are built on the simple regressions, but GNNs have more complex structure and properties needed to be considered. We also notice that Shen et al. (2020a) propose a differentiated variable decorrelation term for linear regression. However, this decorrelation term requires multiple environment with different correlations between stable variable and unstable variable available in the training stage while our method do not require.
|
| 178 |
+
|
| 179 |
+
# 6 CONCLUSION
|
| 180 |
+
|
| 181 |
+
In this paper, we investigate a general and practical problem: learning GNNs with agnostic selection bias. The selection bias will inevitably cause the GNNs to learn the biased correlation between aggregation mode and class label and make the prediction unstable. We then propose a novel differentiated decorrelated GNN, which combines the debiasing technique with GNNs in a unified framework. Extensive experiments well demonstrate the effectiveness and flexibility of GNN-DVD.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
|
| 186 |
+
|
| 187 |
+
Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka, and Tom M Mitchell. Toward an architecture for never-ending language learning. In AAAI, 2010.
|
| 188 |
+
|
| 189 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. In ICLR, 2016.
|
| 190 |
+
|
| 191 |
+
Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, pp. 3844–3852, 2016.
|
| 192 |
+
|
| 193 |
+
Jens Hainmueller. Entropy balancing for causal effects: A multivariate reweighting method to produce balanced samples in observational studies. Political analysis, pp. 25–46, 2012.
|
| 194 |
+
|
| 195 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pp. 1024–1034, 2017.
|
| 196 |
+
|
| 197 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2016.
|
| 198 |
+
|
| 199 |
+
Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR, 2019.
|
| 200 |
+
|
| 201 |
+
Noémi Kreif, Richard Grieve, Iván Díaz, and David Harrison. Evaluation of the effect of a continuous treatment: a machine learning approach with an application to treatment for traumatic brain injury. Health economics, 24(9):1213–1228, 2015.
|
| 202 |
+
|
| 203 |
+
Kun Kuang, Ruoxuan Xiong, Peng Cui, Susan Athey, and Bo Li. Stable prediction with model misspecification and agnostic distribution shift. In AAAI, 2020.
|
| 204 |
+
|
| 205 |
+
Yuji Nakatsukasa. Absolute and relative weyl theorems for generalized eigenvalue problems. Linear Algebra and its Applications, 432(1):242–248, 2010.
|
| 206 |
+
|
| 207 |
+
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.
|
| 208 |
+
|
| 209 |
+
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.
|
| 210 |
+
|
| 211 |
+
Zheyan Shen, Peng Cui, Jiashuo Liu, Tong Zhang, Bo Li, and Zhitang Chen. Stable learning via differentiated variable decorrelation. In KDD, pp. 2185–2193, 2020a.
|
| 212 |
+
|
| 213 |
+
Zheyan Shen, Peng Cui, Tong Zhang, and Kun Kuang. Stable learning via sample reweighting. In AAAI, pp. 5692–5699, 2020b.
|
| 214 |
+
|
| 215 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In ICLR, 2017.
|
| 216 |
+
|
| 217 |
+
Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In ICML, pp. 6861–6871. PMLR, 2019.
|
| 218 |
+
|
| 219 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019. URL https://openreview.net/forum?id ${ . } = { }$ ryGs6iA5Km.
|
| 220 |
+
|
| 221 |
+
Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. In ICML, 2016.
|
| 222 |
+
|
| 223 |
+
Liuyi Yao, Zhixuan Chu, Sheng Li, Yaliang Li, Jing Gao, and Aidong Zhang. A survey on causal inference. arXiv preprint arXiv:2002.02770, 2020.
|
| 224 |
+
|
| 225 |
+
Bianca Zadrozny. Learning and evaluating classifiers under sample selection bias. In ICML, pp. 114, 2004.
|
| 226 |
+
|
| 227 |
+
Fan Zhou, Tengfei Li, Haibo Zhou, Hongtu Zhu, and Ye Jieping. Graph-based semi-supervised learning with non-ignorable non-response. In NeurIPS, pp. 7015–7025, 2019.
|
| 228 |
+
|
| 229 |
+
A DERIVATION OF $\overline { { M T E } } F$
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\begin{array} { r l } { \widehat { d T F F } F = } & { \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot Y _ { i } ( t ) - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot Y _ { j } ( t - \Delta t ) } { \Delta t } } \\ & { = \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \cdot ( \sum _ { k \neq t } \alpha _ { k } \mathbf { X } _ { i k } + \alpha _ { t } t + c + c ) - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot ( \sum _ { k \neq t } \alpha _ { k } \mathbf { X } _ { j k } + \alpha _ { t } ( t - \Delta t ) } { \Delta t } } \\ & { = \frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \alpha _ { t } t - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \alpha _ { t } ( t - \Delta t ) } { \Delta t } } \\ & { + \frac { ( \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \sum _ { k \neq t } \alpha _ { k } \mathbf { X } _ { i k } - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot \sum _ { k \neq t } \alpha _ { k } \mathbf { X } _ { i k } ) } { \Delta t } + \phi ( \epsilon ) } \\ & { = M T E F + \sum _ { k \neq t } \frac { \sum _ { i : T _ { i } = t } \mathbf { W } _ { i } \cdot \mathbf { X } _ { i k } - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \cdot \mathbf { X } _ { j k } } { \Delta t } ) + \phi ( \epsilon ) , } \end{array}
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
where $\frac { \sum _ { i : T _ { i } = t } \mathbf { w } _ { i } \alpha _ { t } t - \sum _ { j : T _ { j } = t - \Delta t } \mathbf { w } _ { j } \alpha _ { t } ( t - \Delta t ) } { \Delta t }$ is the ground truth of M T EF , $\phi ( \epsilon )$ means the noise term, and $\phi ( \epsilon ) \simeq 0$ with Gaussian noise.
|
| 236 |
+
|
| 237 |
+
# B PROOF OF THEOREM 2
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\hat { \mathbf { v } } = \arg \operatorname* { m i n } _ { \mathbf { w } } \sum _ { j = 1 } ^ { p } ( \alpha ^ { \mathrm { T } } \cdot \mathrm { a b s } ( \mathbf { H } _ { \mathrm { \mathcal { I } } } ^ { \mathrm { T } } \Lambda _ { \mathbf { w } } \mathbf { H } _ { \mathrm { \mathcal { I - \cdot } \mathcal { I } } } / n - \mathbf { H } _ { \mathrm { \mathcal { I } } } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { \mathrm { \mathcal { - I } } } ^ { \mathrm { T } } \mathbf { w } / n ) ) ^ { 2 } + \frac { \lambda _ { 1 } } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } ^ { 2 } + \lambda _ { 2 } ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } - 1 ) ^ { 2 }
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
Proof For simplicity, we denote $\begin{array} { r } { \mathcal { L } _ { 1 } = \sum _ { j = 1 } ^ { p } \big ( \boldsymbol { \alpha } ^ { \mathrm { T } } \cdot \mathrm { a b s } \big ( \mathbf { H } _ { . j } ^ { \mathrm { T } } \boldsymbol { \Lambda } _ { \mathbf { w } } \mathbf { H } _ { . - j } / n - \mathbf { H } _ { . j } ^ { \mathrm { T } } \mathbf { w } / n \cdot \mathbf { H } _ { . - j } ^ { \mathrm { T } } \mathbf { w } / n \big ) \big ) ^ { 2 } , } \end{array}$ $\begin{array} { r } { \mathcal { L } _ { 2 } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { w } _ { i } ^ { 2 } } \end{array}$ , $\begin{array} { r } { \mathcal { L } _ { 3 } = \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf w } _ { i } - 1 \big ) ^ { 2 } } \end{array}$ and $\mathcal { F } ( \mathbf { w } ) = \mathcal { L } _ { 1 } + \lambda _ { 1 } \mathcal { L } _ { 1 } + \lambda _ { 2 } \mathcal { L } _ { 2 }$ . We first calculate the Hessian matrix of $\mathcal { F } ( \mathbf { w } )$ , denoted as ${ \bf { H } } _ { e }$ , to prove the uniqueness of the optimal solution $\hat { \mathbf { w } }$ , as follows:
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\mathbf { H } _ { e } = { \frac { \partial ^ { 2 } { \mathcal { L } } _ { 1 } } { \partial \mathbf { w } ^ { 2 } } } + \lambda _ { 1 } { \frac { \partial ^ { 2 } { \mathcal { L } } _ { 2 } } { \partial \mathbf { w } ^ { 2 } } } + \lambda _ { 2 } { \frac { \partial ^ { 2 } { \mathcal { L } } _ { 3 } } { \partial \mathbf { w } ^ { 2 } } }
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
For the term $\mathcal { L } _ { 1 }$ , we can rewrite it as:
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
\begin{array} { r l } & { \mathcal { L } _ { 1 } = \displaystyle \sum _ { j \neq k } \alpha _ { i } ^ { 2 } \alpha _ { k } ^ { 2 } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { H } _ { i , k } \mathbf { w } _ { i } - \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , k } \mathbf { w } _ { i } \big ) \big ) ^ { 2 } } \\ & { \quad = \displaystyle \sum _ { j \neq k } \alpha _ { i } ^ { 2 } \alpha _ { k } ^ { 2 } \big ( \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { H } _ { i , k } \mathbf { w } _ { i } \big ) ^ { 2 } - ( \frac { 2 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { H } _ { i , k } \mathbf { w } _ { i } ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , k } \mathbf { w } _ { i } \big ) } \\ & { \quad \quad + \big ( \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , k } \mathbf { w } _ { i } \big ) \big ) ^ { 2 } \big ) } \end{array}
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
And when $\begin{array} { r l r } { | { \bf { H } } _ { i , j } | } & { { } \le } & { c , } \end{array}$ , for any variable $j$ and $k$ , and $\begin{array} { r l r } { | \mathbf { w } _ { i } | } & { { } \le } & { c . } \end{array}$ , we have $\begin{array} { r l r } { \frac { \partial ^ { 2 } } { \partial { \bf w } ^ { 2 } } ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , j } { \bf H } _ { i , k } { \bf w } _ { i } ) ^ { 2 } } & { = } & { \mathcal { O } ( \frac { 1 } { n ^ { 2 } } ) } \end{array}$ , $\begin{array} { r l r } { \frac { \partial ^ { 2 } } { \partial { \bf w } ^ { 2 } } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , j } { \bf w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , k } { \bf w } _ { i } \big ) } & { = } & { \mathcal { O } \big ( \frac { 1 } { n ^ { 2 } } \big ) } \end{array}$ and $\begin{array} { r } { \frac { \partial ^ { 2 } } { | { \bf { w } } ^ { 2 } | } \big ( \big ( \frac { 2 } { n } \sum _ { i = 1 } ^ { n } { \bf { H } } _ { i , j } { \bf { H } } _ { i , k } { \bf { w } } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf { H } } _ { i , j } { \bf { w } } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf { H } } _ { i , k } { \bf { w } } _ { i } \big ) \big ) \ = \ { \mathcal O } \big ( \frac { 1 } { n ^ { 2 } } \big ) . } \end{array}$ Then with 2 $| \alpha _ { i } | \ \leq \ c .$ we hav $\begin{array} { r } { \alpha _ { i } ^ { 2 } \alpha _ { k } ^ { 2 } \frac { \partial ^ { 2 } } { \partial { \bf w } ^ { 2 } } \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , j } { \bf H } _ { i , k } { \bf w } _ { i } - \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , j } { \bf w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , k } { \bf w } _ { i } \big ) \big ) ^ { 2 } \ = \ \mathcal { O } \big ( \frac { 1 } { n ^ { 2 } } \big ) . } \end{array}$ $\mathcal { L } _ { 1 }$ is $p ( p - 1 )$ such terms. Then we have
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\frac { \partial ^ { 2 } \mathcal { L } _ { 1 } } { \partial \mathbf { w } ^ { 2 } } = \mathcal { O } ( \frac { p ^ { 2 } } { n ^ { 2 } } ) .
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
With some algebras, we can also have
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\frac { \partial ^ { 2 } \mathcal { L } _ { 2 } } { \partial \mathbf { w } ^ { 2 } } = \frac { 1 } { n } \mathbf { I } ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\frac { \partial ^ { 2 } \mathcal { L } _ { 3 } } { \partial \mathbf { w } ^ { 2 } } = \frac { 1 } { n ^ { 2 } } \mathbf { 1 1 } ^ { \mathrm { T } } ,
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
thus,
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
{ \mathbf H } _ { e } = \mathcal { O } ( \frac { p ^ { 2 } } { n ^ { 2 } } ) + \frac { \lambda _ { 1 } } { n } { \mathbf I } + \frac { \lambda _ { 2 } } { n ^ { 2 } } { \mathbf 1 } { \mathbf I } ^ { \mathrm { T } } = \frac { \lambda _ { 1 } } { n } { \mathbf I } + \mathcal { O } ( \frac { p ^ { 2 } + \lambda _ { 2 } } { n ^ { 2 } } ) .
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
Therefore, if $\begin{array} { r } { \frac { \lambda _ { 1 } } { n } \gg \frac { p ^ { 2 } + \lambda _ { 2 } } { n ^ { 2 } } } \end{array}$ , equivalent to $\lambda _ { 1 } n \gg p ^ { 2 } + \lambda _ { 2 }$ , ${ \bf { H } } _ { e }$ is an almost diagonal matrix. Hence, $\mathbf { H } _ { e }$ is positive definite (Nakatsukasa, 2010). Then the function $\mathcal { F } ( \mathbf { w } )$ is convex on $\mathcal { C } = \left\{ \mathbf { w } : \left| \mathbf { w } _ { i } \right| \leq c \right\}$ , and has unique optimal solution $\hat { \mathbf { w } }$ .
|
| 278 |
+
|
| 279 |
+
over,and use . O $\mathcal { L } _ { 1 }$ is our ma, we have e hop, and $\mathcal { L } _ { 1 }$ $\lambda _ { 1 } \mathcal { L } _ { 2 }$ $\lambda _ { 2 } { \mathcal { L } } _ { 3 }$ $\mathcal { C }$ $\mathcal { L } _ { 1 } ~ = ~ \mathcal { O } ( 1 ) , \mathcal { L } _ { 2 } ~ = ~ \mathcal { O } ( 1 )$ $\begin{array} { r } { \alpha _ { i } ^ { 2 } \alpha _ { k } ^ { 2 } ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \bf H } _ { i , j } { \bf H } _ { i , k } { \bf w } _ { i } - } \end{array}$ $\begin{array} { r } { \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , j } \mathbf { w } _ { i } \big ) \big ( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { H } _ { i , k } \mathbf { w } _ { i } \big ) \big ) ^ { 2 } \ = \ \mathcal { O } ( 1 ) } \end{array}$ . Thus ${ \mathcal { L } } _ { 1 } = { \mathcal { O } } ( p ^ { 2 } )$ . When $p ^ { 2 } \gg \operatorname* { m a x } ( \lambda _ { 1 } , \lambda _ { 2 } )$ , $\mathcal { L } _ { 1 }$ will dominate the regularization terms $\mathcal { L } _ { 2 }$ and $\mathcal { L } _ { 3 }$ .
|
| 280 |
+
|
| 281 |
+
# C PROOF OF THEOREM 3
|
| 282 |
+
|
| 283 |
+
Let $\mathbf { Z } = \{ \mathbf { Z } _ { 1 } , \mathbf { Z } _ { 2 } , \cdots , \mathbf { Z } _ { p } \}$ be $p$ pairwise uncorrelated variables. $\forall \mathbf { Z } _ { i } , \mathbf { Z } _ { j } \in \mathbf { Z } , ( \mathbf { Z } _ { i } ^ { ( 1 ) } , \mathbf { Z } _ { i } ^ { ( 2 ) } , \cdots , \mathbf { Z } _ { i } ^ { ( n ) } )$ and $( \mathbf { Z } _ { j } ^ { ( 1 ) } , \mathbf { Z } _ { j } ^ { ( 2 ) } , \cdots , \mathbf { Z } _ { j } ^ { ( n ) } )$ are $n$ simple random samples drawn from $\mathbf { Z } _ { i }$ and $\mathbf { Z } _ { j }$ respectively, and have let same distribution with $\begin{array} { r } { \mathbf { Y } _ { i } ^ { ( s ) } = \sum _ { k = 1 } ^ { n } a _ { s k } \mathbf { Z } _ { i } ^ { ( k ) } } \end{array}$ $\mathbf { Z } _ { i }$ and and $\mathbf { Z } _ { j }$ $\begin{array} { r } { \dot { \mathbf { Y } } _ { j } ^ { ( v ) } = \sum _ { l = 1 } ^ { n } a _ { v l } \mathbf { Z } _ { j } ^ { ( l ) } } \end{array}$ . Given a linear aggregation matrix ij , and we have following derivation: $\hat { \mathbf { A } } = ( a _ { i j } ) , \forall s , v \in ( 1 , 2 , \cdots , n )$ ,
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
\begin{array} { l } { { \displaystyle { \bf C o v } ( { \bf Y } _ { i } ^ { ( s ) } , { \bf Y } _ { j } ^ { ( v ) } ) = { \bf C o v } ( \sum _ { k = 1 } ^ { n } a _ { s k } { \bf Z } _ { i } ^ { ( k ) } , \sum _ { l = 1 } ^ { n } a _ { v l } { \bf Z } _ { j } ^ { ( l ) } ) } \ ~ } \\ { \displaystyle ~ = \sum _ { k = 1 } ^ { n } \sum _ { l = 1 } ^ { n } a _ { s k } a _ { v l } { \bf C o v } ( { \bf Z } _ { i } ^ { ( k ) } , { \bf Z } _ { j } ^ { ( l ) } ) = \sum _ { k = 1 } ^ { n } \sum _ { l = 1 } ^ { n } a _ { s k } a _ { v l } \delta _ { i j } , } \end{array}
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
where $\delta _ { i j } = 0$ when $i \neq j$ , otherwise $\delta _ { i j } = 1$ . Therefore, when $i \neq j$ , we have $\mathrm { C o v } ( \mathbf { Y } _ { i } ^ { ( s ) } , \mathbf { Y } _ { j } ^ { ( v ) } ) = 0$ and $\mathrm { C o v } ( \mathbf { Y } _ { i } , \mathbf { Y } _ { j } ) = 0$ . Extended the conclusion to multiple variable, $\mathbf { Y } = ( \mathbf { Y } _ { 1 } , \mathbf { Y } _ { 2 } , \cdots , \mathbf { Y } _ { n } )$ are pairwise uncorrelated. Proof completes.
|
| 290 |
+
|
| 291 |
+
# D PSEUDOCODE OF GNN-DVD
|
| 292 |
+
|
| 293 |
+
# Algorithm 1: GNN-DVD Algorithm
|
| 294 |
+
|
| 295 |
+
Input :Training graph $\mathcal { G } _ { t r a i n } = \{ \mathbf { A } , \mathbf { X } , \mathbf { Y } \}$ , and indices of labeled nodes $\mathcal { { V } } _ { L }$ ; Max iteration:maxIter
|
| 296 |
+
Output :GNN parameter $\theta$ and sample weights w
|
| 297 |
+
Initialization : Let $\mathbf { w } = { \boldsymbol { \omega } } \odot { \boldsymbol { \omega } }$ and initialize sample weights $\omega$ with 1; Initialize GNN’s parameters $\theta$ with random uniform distribution; Iteration $t \gets 0$
|
| 298 |
+
|
| 299 |
+
1 while not converged or t < maxIter do
|
| 300 |
+
|
| 301 |
+
2 Optimize ${ \boldsymbol { \theta } } ^ { ( t ) }$ to minimize $\mathcal { L } _ { G }$ ;
|
| 302 |
+
3 Calculate variable weights α(t) from W(K−1);
|
| 303 |
+
4 Optimize ω(t) to minimize $\mathcal { L } _ { D V D } ( \tilde { \mathbf { H } } ^ { ( K - 1 ) } )$ ;
|
| 304 |
+
5 $t = t + 1$ ;
|
| 305 |
+
6 end
|
| 306 |
+
7 Return: $\theta$ and $\mathbf { w } = { \boldsymbol { \omega } } \odot { \boldsymbol { \omega } }$
|
| 307 |
+
|
| 308 |
+
To optimize our GNN-DVD algorithm, we propose an iterative method. Firstly, we let $\mathbf { w } = { \boldsymbol { \omega } } \odot { \boldsymbol { \omega } }$ to ensure non-negativity of w and initialize sample weight $\omega _ { i } = 1$ for each sample $i$ and GNN’s parameters $\theta$ with random uniform distribution. Once the initial values are given, in each iteration, we fix the sample weights $\omega$ and update the GNN’s parameters $\theta$ by $\mathcal { L } _ { G }$ with gradient descent, then compute the confounder weights $\alpha$ from the linear transform matrix $\mathbf { W } ^ { ( K - 1 ) }$ . With $\alpha$ and fixing the GNN’s parameters $\theta$ , we update the sample weights $\omega$ with gradient descent to minimize $\mathcal { L } _ { D V D } ( \mathbf { H } ^ { ( K - 1 ) } )$ . We iteratively update the sample weights w and GNN’s parameters $\theta$ until $\mathcal { L } _ { G }$ converges.
|
| 309 |
+
|
| 310 |
+
Complexity Analysis Compared with base model (e.g., GCN and GAT), the mainly incremental time cost is the complexity from DVD term. The complexity of DVD term is $\mathcal { O } ( { n p } ^ { 2 } )$ , where $n$ is the number of labeled nodes and $p$ is the dimension of embedding. And it is quite smaller than the base model (e.g., the complexity of GCN is linear to the number of edges).
|
| 311 |
+
|
| 312 |
+
# E DATASET DESCRIPTION AND EXPERIMENTAL SETUP
|
| 313 |
+
|
| 314 |
+
# E.1 DATASET DESCRIPTION
|
| 315 |
+
|
| 316 |
+
Table 3: Dataset statistics
|
| 317 |
+
|
| 318 |
+
<table><tr><td>Dataset</td><td>Type</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>Bias degree (c)</td><td>Bias type</td></tr><tr><td>Cora</td><td>Citation network</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>0.7/0.8/0.9</td><td>Label selection bias</td></tr><tr><td>Citeseer</td><td>Citation network</td><td>3,327</td><td>4,732</td><td>6</td><td>3,703</td><td>0.7/0.8/0.9</td><td>Label selection bias</td></tr><tr><td>Pubmed</td><td>Citation network</td><td>19,717</td><td>44,338</td><td>3</td><td>500</td><td>0.7/0.8/0.9</td><td>Label selection bias</td></tr><tr><td>NELL</td><td>Knowledge graph</td><td>65,755</td><td>266,144</td><td>210</td><td>5,414</td><td>One labeled node per class</td><td>Small sample selection bias</td></tr></table>
|
| 319 |
+
|
| 320 |
+
Some statistics of datasets used in our paper are presented in Table 3, including the number of nodes, the number of edges, the number of classes, the number of features, the bias degree $\epsilon$ and bias type. For three citation networks, we conduct the biased labeled node selection process to get three degrees of datasets for each dataset to validate the effect of label selection bias, in which each class in each dataset contains 20 labeled nodes in training set and the validation set and test set are same as Yang et al. (2016). For NELL, because it only has a single labeled node per class in training set, the training nodes are hard to cover all the neighborhood distribution happened in the test set. Hence, we use this dataset to validate the effectiveness of our method on the extreme small labeled nodes size bias. The data splits are also same as Yang et al. (2016). A description of each of dataset is given as follows:
|
| 321 |
+
|
| 322 |
+
• Cora (Sen et al., 2008) is a citation network of Machine Learning papers that collected from 7 classes:{Theory, Case Based, Reinforcement Learning, Genetic Algorithms, Neural Networks, Probabilistic Methods, Rule Learning }. Nodes represent papers, edges refer to the citation relationship, and features are bag-of-words vectors for each paper.
|
| 323 |
+
• Citeseer (Sen et al., 2008) is a citation network of Machine Learning papers that collected from 6 classes:{Agents, Artificial Intelligence, Database, Information Retrieval, Machine Learning, Human Computer Interaction }. Nodes represent papers, edges refer to the citation relationship, and features are bag-of-words vectors for each paper.
|
| 324 |
+
• Pubmed (Sen et al., 2008) is a citation network from the PubMed database, which contains a set of articles (Nodes) related to diabetes and the citation relationship among them. The node features are bag-of-words vectors, and the node label are the diabetes type researched in the articles.
|
| 325 |
+
• NELL Carlson et al. (2010) is a dataset extracted from the knowledge graph, which is a set of entities connected with directed, labeled edges (relations). Our pre-processing scheme is same as Yang et al. (2016), where each entity pair $( e _ { 1 } , r , e _ { 2 } )$ is assigned with separate relation nodes $r _ { 1 }$ and $r _ { 2 }$ as $( e _ { 1 } , r _ { 1 } )$ and $( e _ { 2 } , r _ { 2 } )$ . We use text bag-of-words representation as feature vector of the entities.
|
| 326 |
+
|
| 327 |
+
# E.2 EXPERIMENTAL SETUP
|
| 328 |
+
|
| 329 |
+
As the Section 2.1 has described, for all datasets, to simulate the agnostic selection bias scenario, we first follow the inductive setting in $\mathbf { W } \mathbf { u }$ et al. (2019) that masks the validation and test nodes in the training phase and validation and test with whole graph so that the test nodes will be agnostic. For GCN and GAT, we utilize the same two-layer architecture as their original paper (Kipf & Welling, 2016; Velickovi ˇ c et al., 2017). We use the following sets of hyperparameters for GCN on Cora, ´
|
| 330 |
+
|
| 331 |
+
Citeseer, Pubmed: 0.5 (dropout rate), $5 \cdot { 1 0 } ^ { - 4 }$ (L2 regularization) and 32 (numbder of hidden units); and for NELL: 0.1 (dropout rate), $1 \cdot { 1 0 } ^ { - 5 }$ (L2 regularization) and 64 (number of hidden units). For GAT on Cora, Citeseer, we use: 8 (first layer attention heads), 8 (features each head), 1 (second layer attention head), 0.6 (dropout), 0.0005 (L2 regularization); and for Pubmed: 8 (second layer attention head), 0.001 (L2 regularization), other parameters are same with Cora and Citeseer. To fair comparison, the GNN part of our model uses the same architecture and hyper-parameters with base model and we grid search $\lambda _ { 1 }$ and $\lambda _ { 2 }$ from $\{ 0 . 0 1 , 0 . 1 , 1 , 1 0 , 1 0 0 \}$ . For other baselines, we use the optimal hyper-parameters in literatures on each dataset. For all the experiments, we run 10 times with different random seed and report its average Accuracy results.
|
| 332 |
+
|
| 333 |
+
# F EXTEND TO GAT
|
| 334 |
+
|
| 335 |
+
We can easily incorporate VD/DVD term to other GNNs. We combine them with GAT and more extensions leave as future work. GAT utilizes attention mechanism to aggregate neighbor information. It also follows the linear aggregation and transformation steps. Similar with GCN, the hidden embedding H˜ (K−1) is the input of VD/DVD term, and the variable weights $\alpha$ are calculated from the transformation matrix W(K−1) and the sample weights w are used to reweight the softmax loss. Note that original paper utilizes same transformation matrix $\mathbf { W } ^ { ( K - 1 ) }$ for transforming embedding and learning attention values. Because $\alpha$ means the importance of each variable for classification, and it should be computed from transformation matrix $\mathbf { W } ^ { ( K - 1 ) }$ for transforming embedding, hence we use separate matrix for transforming embedding and learning attention values respectively. This modification does not change the performance of GAT in experiments.
|
| 336 |
+
|
| 337 |
+
# G ADDITIONAL EXPERIMENTS
|
| 338 |
+
|
| 339 |
+
# G.1 SAMPLE WEIGHT ANALYSIS
|
| 340 |
+
|
| 341 |
+
Here we analyze the effect of sample weights w in our model. We compute the amount of correlation in the labeled nodes’ embeddings $\mathbf { \tilde { H } } ^ { ( K - 1 ) }$ learned by standard GCN and the weighted embeddings of the same layer learned by GCN-DVD. Note that, the weights are the last iteration of sample weights of GCN-DVD. Following Cogswell et al. (2016), the amount of correlation of GCN and GCN-DVD are measured by Frobenius norm of cross-corvairance matrix computed from vectors of H˜ (K−1) and weighted H˜ (K−1) respectively. Figure 3 shows the amount of correlation in unweighted and weight embeddings, and we can observe that the embeddings’ correlation in all datasets are reduced, demonstrating that the weights learned by GCN-DVD can reduce the correlations between embedded variables. Moreover, one can observe that it is hard to reduce the correlation to zero. Therefore, the necessity of differentiating variables’ weights will be further validated.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 3: Embedding correlation analysis on unweighted and weighted GCN.
|
| 345 |
+
|
| 346 |
+
# G.2 PARAMETER SENSITIVITY
|
| 347 |
+
|
| 348 |
+
We study the sensitiveness of parameters and report the results of GCN-DVD on three citation networks in Fig. 4-6. The experimental results show that GCN-DVD is relatively stable to $\lambda _ { 1 }$ and $\lambda _ { 2 }$ with wide ranges in most cases, indicating the robustness of our model.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 4: Accuracy of GCN-DVD with different $\lambda _ { 1 }$ and $\lambda _ { 2 }$ on different biased Cora datasets.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 5: Accuracy of GCN-DVD with different $\lambda _ { 1 }$ and $\lambda _ { 2 }$ on different biased Citeseer datasets.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 6: Accuracy of GCN-DVD with different $\lambda _ { 1 }$ and $\lambda _ { 2 }$ on different biased Pubmed datasets.
|